From 9066aceb291f0e81d6180748c04cd63d093846cc Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Wed, 27 Oct 2021 10:30:17 +0200 Subject: [PATCH] Built motion from commit 58e5e647.|2.5.37 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1154 files changed, 1154 insertions(+), 1154 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ebaf333..9bdf558 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-10-27T07:47:58.385Z", + "time": "2021-10-27T08:20:51.951Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8ca7ebe..7091b66 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-27T07:47:58.385Z", + "time": "2021-10-27T08:20:51.951Z", "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 8cc766e..cb66302 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 _0x3435=['integration','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager'];(function(_0x10413d,_0x39ceb2){var _0x26c937=function(_0x3fb540){while(--_0x3fb540){_0x10413d['push'](_0x10413d['shift']());}};_0x26c937(++_0x39ceb2);}(_0x3435,0xfa));var _0x5343=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x3435[_0x5eaa0b];return _0x28b295;};'use strict';var Sequelize=require(_0x5343('0x0'));module[_0x5343('0x1')]={'name':{'type':Sequelize[_0x5343('0x2')],'get':function(_0x9ab4a3){return this[_0x5343('0x3')](_0x5343('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x5343('0x5'),_0x5343('0x6'),'motionbar','jscripty',_0x5343('0x7'),_0x5343('0x8'),'bot','script']],'msg':_0x5343('0x9')}},'comment':_0x5343('0x9')},'data1':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':_0x5343('0xb')},'data2':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x5343('0xa')](0x1000),'comments':_0x5343('0xc')},'data5':{'type':Sequelize[_0x5343('0xa')](0x1000),'comments':_0x5343('0xd')},'data6':{'type':Sequelize[_0x5343('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x5343('0xe')],'comments':_0x5343('0xf')}}; \ No newline at end of file +var _0xe53c=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','STRING','contactManager','integration','motionbar','bot'];(function(_0x2ae2bc,_0x177514){var _0x53c290=function(_0x3ac4c0){while(--_0x3ac4c0){_0x2ae2bc['push'](_0x2ae2bc['shift']());}};_0x53c290(++_0x177514);}(_0xe53c,0xbc));var _0xce53=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xe53c[_0x4a9beb];return _0x2d4c58;};'use strict';var Sequelize=require(_0xce53('0x0'));module[_0xce53('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1493bd){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xce53('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xce53('0x3'),_0xce53('0x4'),_0xce53('0x5'),'jscripty','urlForward','browser',_0xce53('0x6'),_0xce53('0x7')]],'msg':_0xce53('0x8')}},'comment':_0xce53('0x8')},'data1':{'type':Sequelize[_0xce53('0x2')](0x1000),'comment':_0xce53('0x9')},'data2':{'type':Sequelize[_0xce53('0x2')](0x1000),'comment':_0xce53('0xa')},'data3':{'type':Sequelize[_0xce53('0x2')](0x1000),'comment':_0xce53('0xb')},'data4':{'type':Sequelize[_0xce53('0x2')](0x1000),'comments':_0xce53('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xce53('0xd')},'data6':{'type':Sequelize[_0xce53('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xce53('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 7c321c5..6d80269 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 _0x554b=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','error','stack','name','update','body','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x554b,0xa5));var _0xb554=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x554b[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb554('0x0'));var zipdir=require(_0xb554('0x1'));var jsonpatch=require(_0xb554('0x2'));var rp=require(_0xb554('0x3'));var moment=require(_0xb554('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb554('0x5'));var util=require(_0xb554('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb554('0x7'));var ejs=require(_0xb554('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb554('0x9'));var squel=require(_0xb554('0xa'));var crypto=require('crypto');var jsforce=require(_0xb554('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb554('0xc'));var Papa=require('papaparse');var Redis=require(_0xb554('0xd'));var authService=require(_0xb554('0xe'));var qs=require(_0xb554('0xf'));var as=require(_0xb554('0x10'));var hardwareService=require(_0xb554('0x11'));var logger=require(_0xb554('0x12'))(_0xb554('0x13'));var utils=require('../../config/utils');var config=require(_0xb554('0x14'));var licenseUtil=require(_0xb554('0x15'));var db=require(_0xb554('0x16'))['db'];function respondWithStatusCode(_0x2fa647,_0x3e05af){_0x3e05af=_0x3e05af||0xcc;return function(_0x2f22e4){if(_0x2f22e4){return _0x2fa647[_0xb554('0x17')](_0x3e05af);}return _0x2fa647['status'](_0x3e05af)[_0xb554('0x18')]();};}function respondWithResult(_0x21cea3,_0x222173){_0x222173=_0x222173||0xc8;return function(_0x3f3ef6){if(_0x3f3ef6){return _0x21cea3[_0xb554('0x19')](_0x222173)[_0xb554('0x1a')](_0x3f3ef6);}};}function respondWithFilteredResult(_0x3dfb1a,_0x231252){return function(_0x52a2da){if(_0x52a2da){var _0x12171f=typeof _0x231252[_0xb554('0x1b')]===_0xb554('0x1c')&&typeof _0x231252['limit']===_0xb554('0x1c');var _0x2c2474=_0x52a2da[_0xb554('0x1d')];var _0xcf9df=_0x12171f?0x0:_0x231252[_0xb554('0x1b')];var _0xf14b1c=_0x12171f?_0x52a2da[_0xb554('0x1d')]:_0x231252['offset']+_0x231252[_0xb554('0x1e')];var _0x3b5688;if(_0xf14b1c>=_0x2c2474){_0xf14b1c=_0x2c2474;_0x3b5688=0xc8;}else{_0x3b5688=0xce;}_0x3dfb1a[_0xb554('0x19')](_0x3b5688);return _0x3dfb1a['set'](_0xb554('0x1f'),_0xcf9df+'-'+_0xf14b1c+'/'+_0x2c2474)['json'](_0x52a2da);}return null;};}function patchUpdates(_0x4104c0){return function(_0x22a9be){try{jsonpatch[_0xb554('0x20')](_0x22a9be,_0x4104c0,!![]);}catch(_0x344237){return BPromise[_0xb554('0x21')](_0x344237);}return _0x22a9be[_0xb554('0x22')]();};}function saveUpdates(_0x5537bc,_0x410041){return function(_0x299f5a){if(_0x299f5a){return _0x299f5a['update'](_0x5537bc)[_0xb554('0x23')](function(_0x425974){return _0x425974;});}return null;};}function removeEntity(_0x1d073a,_0x1decf5){return function(_0x13057d){if(_0x13057d){return _0x13057d['destroy']()[_0xb554('0x23')](function(){_0x1d073a[_0xb554('0x19')](0xcc)[_0xb554('0x18')]();});}};}function handleEntityNotFound(_0x5d2977,_0x55844d){return function(_0xb84bab){if(!_0xb84bab){_0x5d2977[_0xb554('0x17')](0x194);}return _0xb84bab;};}function handleError(_0x333752,_0x5db5af){_0x5db5af=_0x5db5af||0x1f4;return function(_0x57b897){logger[_0xb554('0x24')](_0x57b897[_0xb554('0x25')]);if(_0x57b897['name']){delete _0x57b897[_0xb554('0x26')];}_0x333752[_0xb554('0x19')](_0x5db5af)['send'](_0x57b897);};}exports[_0xb554('0x27')]=function(_0x31cdd3,_0x12dff9){if(_0x31cdd3[_0xb554('0x28')]['id']){delete _0x31cdd3['body']['id'];}return db[_0xb554('0x29')][_0xb554('0x2a')]({'where':{'id':_0x31cdd3[_0xb554('0x2b')]['id']}})['then'](handleEntityNotFound(_0x12dff9,null))[_0xb554('0x23')](saveUpdates(_0x31cdd3['body'],null))[_0xb554('0x23')](respondWithResult(_0x12dff9,null))[_0xb554('0x2c')](handleError(_0x12dff9,null));};exports[_0xb554('0x2d')]=function(_0x21e869,_0x372703){return db['Action'][_0xb554('0x2a')]({'where':{'id':_0x21e869[_0xb554('0x2b')]['id']}})['then'](handleEntityNotFound(_0x372703,null))['then'](removeEntity(_0x372703,null))[_0xb554('0x2c')](handleError(_0x372703,null));}; \ No newline at end of file +var _0xe014=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x2378ef,_0x1b182e){var _0x9dc6fb=function(_0x4ce9e0){while(--_0x4ce9e0){_0x2378ef['push'](_0x2378ef['shift']());}};_0x9dc6fb(++_0x1b182e);}(_0xe014,0x84));var _0x4e01=function(_0x485fd8,_0xc0730a){_0x485fd8=_0x485fd8-0x0;var _0x2abd04=_0xe014[_0x485fd8];return _0x2abd04;};'use strict';var emlformat=require(_0x4e01('0x0'));var rimraf=require(_0x4e01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e01('0x2'));var rp=require(_0x4e01('0x3'));var moment=require(_0x4e01('0x4'));var BPromise=require(_0x4e01('0x5'));var Mustache=require(_0x4e01('0x6'));var util=require(_0x4e01('0x7'));var path=require(_0x4e01('0x8'));var sox=require('sox');var csv=require(_0x4e01('0x9'));var ejs=require(_0x4e01('0xa'));var fs=require('fs');var fs_extra=require(_0x4e01('0xb'));var _=require('lodash');var squel=require(_0x4e01('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e01('0xd'));var deskjs=require(_0x4e01('0xe'));var toCsv=require(_0x4e01('0x9'));var querystring=require(_0x4e01('0xf'));var Papa=require(_0x4e01('0x10'));var Redis=require(_0x4e01('0x11'));var authService=require(_0x4e01('0x12'));var qs=require(_0x4e01('0x13'));var as=require(_0x4e01('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e01('0x15'))(_0x4e01('0x16'));var utils=require(_0x4e01('0x17'));var config=require(_0x4e01('0x18'));var licenseUtil=require(_0x4e01('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499cf7,_0x3b3527){_0x3b3527=_0x3b3527||0xcc;return function(_0x491e44){if(_0x491e44){return _0x499cf7['sendStatus'](_0x3b3527);}return _0x499cf7['status'](_0x3b3527)[_0x4e01('0x1a')]();};}function respondWithResult(_0x31758b,_0x5373df){_0x5373df=_0x5373df||0xc8;return function(_0x4552e4){if(_0x4552e4){return _0x31758b[_0x4e01('0x1b')](_0x5373df)[_0x4e01('0x1c')](_0x4552e4);}};}function respondWithFilteredResult(_0x3661a4,_0x26ecfe){return function(_0xeb694b){if(_0xeb694b){var _0x109470=typeof _0x26ecfe[_0x4e01('0x1d')]===_0x4e01('0x1e')&&typeof _0x26ecfe[_0x4e01('0x1f')]===_0x4e01('0x1e');var _0xfceb49=_0xeb694b[_0x4e01('0x20')];var _0x2fe641=_0x109470?0x0:_0x26ecfe[_0x4e01('0x1d')];var _0x2bcd39=_0x109470?_0xeb694b[_0x4e01('0x20')]:_0x26ecfe['offset']+_0x26ecfe[_0x4e01('0x1f')];var _0x18a7df;if(_0x2bcd39>=_0xfceb49){_0x2bcd39=_0xfceb49;_0x18a7df=0xc8;}else{_0x18a7df=0xce;}_0x3661a4[_0x4e01('0x1b')](_0x18a7df);return _0x3661a4[_0x4e01('0x21')](_0x4e01('0x22'),_0x2fe641+'-'+_0x2bcd39+'/'+_0xfceb49)[_0x4e01('0x1c')](_0xeb694b);}return null;};}function patchUpdates(_0x2b879c){return function(_0x148a2a){try{jsonpatch[_0x4e01('0x23')](_0x148a2a,_0x2b879c,!![]);}catch(_0x260648){return BPromise['reject'](_0x260648);}return _0x148a2a[_0x4e01('0x24')]();};}function saveUpdates(_0x198d87,_0x5045d6){return function(_0xaa61dd){if(_0xaa61dd){return _0xaa61dd['update'](_0x198d87)[_0x4e01('0x25')](function(_0x15a5dd){return _0x15a5dd;});}return null;};}function removeEntity(_0x5a1702,_0x10f57d){return function(_0x2f68ce){if(_0x2f68ce){return _0x2f68ce[_0x4e01('0x26')]()[_0x4e01('0x25')](function(){_0x5a1702[_0x4e01('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0389,_0x3f42a4){return function(_0x33eacc){if(!_0x33eacc){_0x5a0389['sendStatus'](0x194);}return _0x33eacc;};}function handleError(_0x2a27e6,_0x2823d8){_0x2823d8=_0x2823d8||0x1f4;return function(_0x33c6ac){logger[_0x4e01('0x27')](_0x33c6ac[_0x4e01('0x28')]);if(_0x33c6ac[_0x4e01('0x29')]){delete _0x33c6ac['name'];}_0x2a27e6['status'](_0x2823d8)[_0x4e01('0x2a')](_0x33c6ac);};}exports[_0x4e01('0x2b')]=function(_0x25b2b3,_0x19739b){if(_0x25b2b3[_0x4e01('0x2c')]['id']){delete _0x25b2b3[_0x4e01('0x2c')]['id'];}return db[_0x4e01('0x2d')][_0x4e01('0x2e')]({'where':{'id':_0x25b2b3[_0x4e01('0x2f')]['id']}})[_0x4e01('0x25')](handleEntityNotFound(_0x19739b,null))['then'](saveUpdates(_0x25b2b3[_0x4e01('0x2c')],null))['then'](respondWithResult(_0x19739b,null))[_0x4e01('0x30')](handleError(_0x19739b,null));};exports[_0x4e01('0x26')]=function(_0x527854,_0x23bf2b){return db['Action'][_0x4e01('0x2e')]({'where':{'id':_0x527854[_0x4e01('0x2f')]['id']}})[_0x4e01('0x25')](handleEntityNotFound(_0x23bf2b,null))[_0x4e01('0x25')](removeEntity(_0x23bf2b,null))['catch'](handleError(_0x23bf2b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 50ac3b2..62db1f4 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 _0xb7a5=['./action.attributes','exports','Action','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x320368,_0x445e5e){var _0x3aa97e=function(_0x10bcb7){while(--_0x10bcb7){_0x320368['push'](_0x320368['shift']());}};_0x3aa97e(++_0x445e5e);}(_0xb7a5,0x67));var _0x5b7a=function(_0x3d1968,_0x56be8b){_0x3d1968=_0x3d1968-0x0;var _0x8b014c=_0xb7a5[_0x3d1968];return _0x8b014c;};'use strict';var _=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var logger=require(_0x5b7a('0x2'))('api');var moment=require(_0x5b7a('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b7a('0x4'));var fs=require('fs');var path=require(_0x5b7a('0x5'));var rimraf=require(_0x5b7a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b7a('0x7'));module[_0x5b7a('0x8')]=function(_0x1eb9a7,_0x54a7c5){return _0x1eb9a7['define'](_0x5b7a('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7141=['rimraf','exports','define','Action','../../config/logger','api','moment','bluebird','path'];(function(_0x5e371f,_0x4c00b0){var _0x22ad65=function(_0x28adff){while(--_0x28adff){_0x5e371f['push'](_0x5e371f['shift']());}};_0x22ad65(++_0x4c00b0);}(_0x7141,0x187));var _0x1714=function(_0x415b4d,_0x2e39ab){_0x415b4d=_0x415b4d-0x0;var _0x15bbba=_0x7141[_0x415b4d];return _0x15bbba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1714('0x0'))(_0x1714('0x1'));var moment=require(_0x1714('0x2'));var BPromise=require(_0x1714('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1714('0x4'));var rimraf=require(_0x1714('0x5'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x1714('0x6')]=function(_0x4ddcdc,_0x4cd1e3){return _0x4ddcdc[_0x1714('0x7')](_0x1714('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index d93b9a5..253b428 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x51a03d,_0x54bb89){var _0x4f5f5b=function(_0x5765e4){while(--_0x5765e4){_0x51a03d['push'](_0x51a03d['shift']());}};_0x4f5f5b(++_0x54bb89);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1459c9,_0x1c5103){_0x1459c9=_0x1459c9-0x0;var _0x17ce52=_0x8ef6[_0x1459c9];return _0x17ce52;};'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')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f3c8d92..b2a1e08 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 _0x4b49=['../../components/auth/service','../../components/interaction/service','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x2d7916,_0xeb769c){var _0x2d6c4a=function(_0x6179ae){while(--_0x6179ae){_0x2d7916['push'](_0x2d7916['shift']());}};_0x2d6c4a(++_0xeb769c);}(_0x4b49,0xb8));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x94b4('0x0'));var util=require(_0x94b4('0x1'));var path=require(_0x94b4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x94b4('0x3'));var interaction=require(_0x94b4('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0x94b4('0x5'),auth['isAuthenticated'](),controller[_0x94b4('0x6')]);router[_0x94b4('0x7')](_0x94b4('0x5'),auth[_0x94b4('0x8')](),controller[_0x94b4('0x9')]);module[_0x94b4('0xa')]=router; \ No newline at end of file +var _0x2ccb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout'];(function(_0x1b2baf,_0x5e2a94){var _0x3d25a4=function(_0x26d860){while(--_0x26d860){_0x1b2baf['push'](_0x1b2baf['shift']());}};_0x3d25a4(++_0x5e2a94);}(_0x2ccb,0x1ed));var _0xb2cc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2ccb[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xb2cc('0x0'));var util=require('util');var path=require(_0xb2cc('0x1'));var timeout=require(_0xb2cc('0x2'));var express=require(_0xb2cc('0x3'));var router=express[_0xb2cc('0x4')]();var fs_extra=require(_0xb2cc('0x5'));var auth=require(_0xb2cc('0x6'));var interaction=require(_0xb2cc('0x7'));var config=require(_0xb2cc('0x8'));var controller=require(_0xb2cc('0x9'));router[_0xb2cc('0xa')](_0xb2cc('0xb'),auth[_0xb2cc('0xc')](),controller[_0xb2cc('0xd')]);router[_0xb2cc('0xe')](_0xb2cc('0xb'),auth[_0xb2cc('0xc')](),controller['destroy']);module[_0xb2cc('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1a04160..273a419 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['exports','STRING','TEXT'];(function(_0x1df5f4,_0xe4f23f){var _0x23ce14=function(_0x281104){while(--_0x281104){_0x1df5f4['push'](_0x1df5f4['shift']());}};_0x23ce14(++_0xe4f23f);}(_0x7c09,0x102));var _0x97c0=function(_0x54e41b,_0x3faa37){_0x54e41b=_0x54e41b-0x0;var _0x1f3559=_0x7c09[_0x54e41b];return _0x1f3559;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x42bedd,_0x157a71){var _0x1a2b17=function(_0x2c112a){while(--_0x2c112a){_0x42bedd['push'](_0x42bedd['shift']());}};_0x1a2b17(++_0x157a71);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0xf2ca[_0x3a3d20];return _0x33bc94;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 92a521d..7825f8f 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 _0xe5a2=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','catch','show','params','length','includeAll','merge','find','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','metric','function','replace','format','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','value','getFields','Sequelize','AnalyticMetric','select','from','MetricId','output','web','fullPath','randomstring','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','COUNT(%s)','groupBy','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path'];(function(_0x35009a,_0x4c647b){var _0x41ae8a=function(_0x594c04){while(--_0x594c04){_0x35009a['push'](_0x35009a['shift']());}};_0x41ae8a(++_0x4c647b);}(_0xe5a2,0x98));var _0x2e5a=function(_0x3e8158,_0x377fe3){_0x3e8158=_0x3e8158-0x0;var _0x1825b4=_0xe5a2[_0x3e8158];return _0x1825b4;};'use strict';var emlformat=require(_0x2e5a('0x0'));var rimraf=require(_0x2e5a('0x1'));var zipdir=require(_0x2e5a('0x2'));var jsonpatch=require(_0x2e5a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e5a('0x4'));var util=require(_0x2e5a('0x5'));var path=require(_0x2e5a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e5a('0x8'));var squel=require(_0x2e5a('0x9'));var crypto=require('crypto');var jsforce=require(_0x2e5a('0xa'));var deskjs=require(_0x2e5a('0xb'));var toCsv=require(_0x2e5a('0xc'));var querystring=require(_0x2e5a('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e5a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e5a('0xf'));var as=require(_0x2e5a('0x10'));var hardwareService=require(_0x2e5a('0x11'));var logger=require('../../config/logger')(_0x2e5a('0x12'));var utils=require(_0x2e5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2e5a('0x14'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x431806,_0x4970b9){_0x4970b9=_0x4970b9||0xcc;return function(_0x2dadc9){if(_0x2dadc9){return _0x431806['sendStatus'](_0x4970b9);}return _0x431806[_0x2e5a('0x15')](_0x4970b9)['end']();};}function respondWithResult(_0x55683b,_0x3d1363){_0x3d1363=_0x3d1363||0xc8;return function(_0x3209b6){if(_0x3209b6){return _0x55683b[_0x2e5a('0x15')](_0x3d1363)['json'](_0x3209b6);}};}function respondWithFilteredResult(_0x33d65b,_0xea48b4){return function(_0x3c1119){if(_0x3c1119){var _0xf84490=typeof _0xea48b4[_0x2e5a('0x16')]===_0x2e5a('0x17')&&typeof _0xea48b4[_0x2e5a('0x18')]==='undefined';var _0x4a2834=_0x3c1119[_0x2e5a('0x19')];var _0x7d81dc=_0xf84490?0x0:_0xea48b4[_0x2e5a('0x16')];var _0x58a949=_0xf84490?_0x3c1119[_0x2e5a('0x19')]:_0xea48b4['offset']+_0xea48b4['limit'];var _0x11471a;if(_0x58a949>=_0x4a2834){_0x58a949=_0x4a2834;_0x11471a=0xc8;}else{_0x11471a=0xce;}_0x33d65b['status'](_0x11471a);return _0x33d65b[_0x2e5a('0x1a')](_0x2e5a('0x1b'),_0x7d81dc+'-'+_0x58a949+'/'+_0x4a2834)[_0x2e5a('0x1c')](_0x3c1119);}return null;};}function patchUpdates(_0x26c64b){return function(_0x241a92){try{jsonpatch[_0x2e5a('0x1d')](_0x241a92,_0x26c64b,!![]);}catch(_0xf4786d){return BPromise[_0x2e5a('0x1e')](_0xf4786d);}return _0x241a92[_0x2e5a('0x1f')]();};}function saveUpdates(_0x243ae2,_0x9908b7){return function(_0x5c8c19){if(_0x5c8c19){return _0x5c8c19[_0x2e5a('0x20')](_0x243ae2)[_0x2e5a('0x21')](function(_0x28518f){return _0x28518f;});}return null;};}function removeEntity(_0x33df1e,_0x474ad4){return function(_0x1b3dc5){if(_0x1b3dc5){return _0x1b3dc5[_0x2e5a('0x22')]()[_0x2e5a('0x21')](function(){var _0x26b708=_0x1b3dc5[_0x2e5a('0x23')]({'plain':!![]});var _0x4dcf8d='CustomReports';return db[_0x2e5a('0x24')][_0x2e5a('0x22')]({'where':{'type':_0x4dcf8d,'resourceId':_0x26b708['id']}})[_0x2e5a('0x21')](function(){return _0x1b3dc5;});})[_0x2e5a('0x21')](function(){_0x33df1e[_0x2e5a('0x15')](0xcc)[_0x2e5a('0x25')]();});}};}function handleEntityNotFound(_0x23ed50,_0x16a4b9){return function(_0x1681f2){if(!_0x1681f2){_0x23ed50['sendStatus'](0x194);}return _0x1681f2;};}function handleError(_0x4dea20,_0x445278){_0x445278=_0x445278||0x1f4;return function(_0x4e44b3){logger[_0x2e5a('0x26')](_0x4e44b3[_0x2e5a('0x27')]);if(_0x4e44b3[_0x2e5a('0x28')]){delete _0x4e44b3['name'];}_0x4dea20['status'](_0x445278)['send'](_0x4e44b3);};}exports[_0x2e5a('0x29')]=function(_0x5f52c0,_0x3c66b4){var _0x252e71={},_0x4bf525={},_0x33dff9={'count':0x0,'rows':[]};var _0x46700b=_[_0x2e5a('0x2a')](db[_0x2e5a('0x2b')][_0x2e5a('0x2c')],function(_0x529681){return{'name':_0x529681['fieldName'],'type':_0x529681[_0x2e5a('0x2d')][_0x2e5a('0x2e')]};});_0x4bf525['model']=_['map'](_0x46700b,_0x2e5a('0x28'));_0x4bf525[_0x2e5a('0x2f')]=_[_0x2e5a('0x30')](_0x5f52c0[_0x2e5a('0x2f')]);_0x4bf525[_0x2e5a('0x31')]=_[_0x2e5a('0x32')](_0x4bf525[_0x2e5a('0x33')],_0x4bf525[_0x2e5a('0x2f')]);_0x252e71[_0x2e5a('0x34')]=_['intersection'](_0x4bf525[_0x2e5a('0x33')],qs[_0x2e5a('0x35')](_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x35')]));_0x252e71[_0x2e5a('0x34')]=_0x252e71[_0x2e5a('0x34')]['length']?_0x252e71['attributes']:_0x4bf525[_0x2e5a('0x33')];if(!_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x36')](_0x2e5a('0x37'))){_0x252e71[_0x2e5a('0x18')]=qs[_0x2e5a('0x18')](_0x5f52c0['query'][_0x2e5a('0x18')]);_0x252e71[_0x2e5a('0x16')]=qs['offset'](_0x5f52c0[_0x2e5a('0x2f')]['offset']);}_0x252e71[_0x2e5a('0x38')]=qs[_0x2e5a('0x39')](_0x5f52c0['query'][_0x2e5a('0x39')]);_0x252e71[_0x2e5a('0x3a')]=qs[_0x2e5a('0x31')](_[_0x2e5a('0x3b')](_0x5f52c0[_0x2e5a('0x2f')],_0x4bf525['filters']),_0x46700b);if(_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x3c')]){_0x252e71[_0x2e5a('0x3a')]=_['merge'](_0x252e71[_0x2e5a('0x3a')],{'$or':_['map'](_0x46700b,function(_0x1c8fe9){if(_0x1c8fe9['type']!=='VIRTUAL'){var _0x66db77={};_0x66db77[_0x1c8fe9[_0x2e5a('0x28')]]={'$like':'%'+_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x3c')]+'%'};return _0x66db77;}})});}_0x252e71=_['merge']({},_0x252e71,_0x5f52c0[_0x2e5a('0x3d')]);var _0x5864f6={'where':_0x252e71[_0x2e5a('0x3a')]};return db[_0x2e5a('0x2b')][_0x2e5a('0x19')](_0x5864f6)[_0x2e5a('0x21')](function(_0x23f29f){_0x33dff9[_0x2e5a('0x19')]=_0x23f29f;if(_0x5f52c0[_0x2e5a('0x2f')]['includeAll']){_0x252e71[_0x2e5a('0x3e')]=[{'all':!![]}];}return db[_0x2e5a('0x2b')][_0x2e5a('0x3f')](_0x252e71);})[_0x2e5a('0x21')](function(_0x5da7d3){_0x33dff9['rows']=_0x5da7d3;return _0x33dff9;})[_0x2e5a('0x21')](respondWithFilteredResult(_0x3c66b4,_0x252e71))[_0x2e5a('0x40')](handleError(_0x3c66b4,null));};exports[_0x2e5a('0x41')]=function(_0x4714c8,_0x5ef991){var _0x3707a9={'raw':![],'where':{'id':_0x4714c8[_0x2e5a('0x42')]['id']}},_0x39742c={};_0x39742c[_0x2e5a('0x33')]=_[_0x2e5a('0x30')](db[_0x2e5a('0x2b')][_0x2e5a('0x2c')]);_0x39742c[_0x2e5a('0x2f')]=_[_0x2e5a('0x30')](_0x4714c8[_0x2e5a('0x2f')]);_0x39742c['filters']=_[_0x2e5a('0x32')](_0x39742c[_0x2e5a('0x33')],_0x39742c['query']);_0x3707a9['attributes']=_[_0x2e5a('0x32')](_0x39742c[_0x2e5a('0x33')],qs[_0x2e5a('0x35')](_0x4714c8['query'][_0x2e5a('0x35')]));_0x3707a9[_0x2e5a('0x34')]=_0x3707a9['attributes'][_0x2e5a('0x43')]?_0x3707a9[_0x2e5a('0x34')]:_0x39742c[_0x2e5a('0x33')];if(_0x4714c8[_0x2e5a('0x2f')][_0x2e5a('0x44')]){_0x3707a9[_0x2e5a('0x3e')]=[{'all':!![]}];}_0x3707a9=_[_0x2e5a('0x45')]({},_0x3707a9,_0x4714c8[_0x2e5a('0x3d')]);return db['AnalyticCustomReport'][_0x2e5a('0x46')](_0x3707a9)[_0x2e5a('0x21')](handleEntityNotFound(_0x5ef991,null))[_0x2e5a('0x21')](respondWithResult(_0x5ef991,null))['catch'](handleError(_0x5ef991,null));};exports[_0x2e5a('0x47')]=function(_0x1d156d,_0x1259ab){return db[_0x2e5a('0x2b')][_0x2e5a('0x47')](_0x1d156d['body'],{})[_0x2e5a('0x21')](function(_0x4e8568){var _0xad7b0a=_0x1d156d['user']['get']({'plain':!![]});if(!_0xad7b0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xad7b0a[_0x2e5a('0x48')]===_0x2e5a('0x49')){var _0x28e813=_0x4e8568[_0x2e5a('0x23')]({'plain':!![]});var _0xa1c349=_0x2e5a('0x4a');return db[_0x2e5a('0x4b')]['find']({'where':{'name':_0xa1c349,'userProfileId':_0xad7b0a[_0x2e5a('0x4c')]},'raw':!![]})[_0x2e5a('0x21')](function(_0x5f2429){if(_0x5f2429&&_0x5f2429[_0x2e5a('0x4d')]===0x0){return db[_0x2e5a('0x24')]['create']({'name':_0x28e813[_0x2e5a('0x28')],'resourceId':_0x28e813['id'],'type':_0x2e5a('0x4e'),'sectionId':_0x5f2429['id']},{})[_0x2e5a('0x21')](function(){return _0x4e8568;});}else{return _0x4e8568;}})[_0x2e5a('0x40')](function(_0x1c9934){logger[_0x2e5a('0x26')](_0x2e5a('0x4f'),_0x1c9934);throw _0x1c9934;});}return _0x4e8568;})[_0x2e5a('0x21')](respondWithResult(_0x1259ab,0xc9))[_0x2e5a('0x40')](handleError(_0x1259ab,null));};exports['update']=function(_0xfffb23,_0x4c9bcf){if(_0xfffb23[_0x2e5a('0x50')]['id']){delete _0xfffb23['body']['id'];}return db[_0x2e5a('0x2b')][_0x2e5a('0x46')]({'where':{'id':_0xfffb23['params']['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x4c9bcf,null))[_0x2e5a('0x21')](saveUpdates(_0xfffb23['body'],null))[_0x2e5a('0x21')](respondWithResult(_0x4c9bcf,null))['catch'](handleError(_0x4c9bcf,null));};exports[_0x2e5a('0x22')]=function(_0x647a92,_0x4d801d){return db[_0x2e5a('0x2b')][_0x2e5a('0x46')]({'where':{'id':_0x647a92[_0x2e5a('0x42')]['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x4d801d,null))[_0x2e5a('0x21')](removeEntity(_0x4d801d,null))[_0x2e5a('0x40')](handleError(_0x4d801d,null));};exports[_0x2e5a('0x51')]=function(_0x13d757,_0x5045b2){var _0x3ce217=0xa;var _0x50a53a=[_0x2e5a('0x52'),_0x2e5a('0x53'),_0x2e5a('0x54'),_0x2e5a('0x55')];var _0x6919ca={'SUM':_0x2e5a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':'MIN(%s)','AVG':_0x2e5a('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x254169={'SEC_TO_TIME':_0x2e5a('0x5b'),'DATE':_0x2e5a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x2e5a('0x5d'),'UNIX_TIMESTAMP':_0x2e5a('0x5e')};var _0x2caba6=function(_0x3b3d7f){return!_['includes']([_0x2e5a('0x5f'),_0x2e5a('0x60'),_0x2e5a('0x61'),_0x2e5a('0x62')],_0x3b3d7f);};var _0x5452da=function(_0x2c1717){if(!_0x2c1717||!_0x2c1717['rules'][_0x2e5a('0x43')]){return'';}for(var _0x5ef0bc='(',_0x409211=0x0;_0x409211<_0x2c1717[_0x2e5a('0x63')]['length'];_0x409211+=0x1){_0x409211>0x0&&(_0x5ef0bc+='\x20'+_0x2c1717[_0x2e5a('0x64')]+'\x20');_0x5ef0bc+=_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x65')]?_0x5452da(_0x2c1717['rules'][_0x409211][_0x2e5a('0x65')]):_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x66')]+'\x20'+_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x67')]+(_0x2caba6(_0x2c1717[_0x2e5a('0x63')][_0x409211]['condition'])?'\x20'+_0x2c1717[_0x2e5a('0x63')][_0x409211]['value']:'');}return _0x5ef0bc+')';};var _0x25acb6={'where':{'id':_0x13d757[_0x2e5a('0x42')]['id']}},_0x44f52c,_0x5a6047,_0x5279f1,_0x27f95e,_0x1545c8;_0x25acb6=_['merge']({},_0x25acb6,_0x13d757[_0x2e5a('0x3d')]);return db['AnalyticCustomReport'][_0x2e5a('0x46')](_0x25acb6)[_0x2e5a('0x21')](function(_0x346649){if(_0x346649){_0x44f52c=_0x346649;return _0x346649['getFields']();}return null;})[_0x2e5a('0x21')](function(_0x4e64a2){if(_0x4e64a2){if(!_0x4e64a2[_0x2e5a('0x43')]){throw new db['Sequelize'][(_0x2e5a('0x68'))](_0x2e5a('0x69'),0x193);}_0x5a6047=_0x4e64a2;return db['AnalyticMetric'][_0x2e5a('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x32cfd1){if(_0x32cfd1){_0x5279f1=_[_0x2e5a('0x6a')](_0x32cfd1,'id');var _0x261f91;var _0x556ddf=squel['select']();_0x556ddf['from'](_0x44f52c['table']);for(var _0x3aa46c=0x0;_0x3aa46c<_0x5a6047[_0x2e5a('0x43')];_0x3aa46c+=0x1){_0x261f91=_0x5a6047[_0x3aa46c]['MetricId']?_0x5279f1[_0x5a6047[_0x3aa46c]['MetricId']][_0x2e5a('0x6b')]:_0x5a6047[_0x3aa46c][_0x2e5a('0x66')];_0x261f91=_0x5a6047[_0x3aa46c][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x6919ca[_0x5a6047[_0x3aa46c]['function']],'%s',_0x261f91):_0x261f91;_0x261f91=_0x5a6047[_0x3aa46c]['format']?_[_0x2e5a('0x6d')](_0x254169[_0x5a6047[_0x3aa46c][_0x2e5a('0x6e')]],'%s',_0x261f91):_0x261f91;if(_0x5a6047[_0x3aa46c]['groupBy']){_0x556ddf[_0x2e5a('0x65')](_0x261f91);}_0x5a6047[_0x3aa46c][_0x2e5a('0x6f')]&&_0x556ddf[_0x2e5a('0x38')](_0x261f91,_0x5a6047[_0x3aa46c][_0x2e5a('0x6f')]===_0x2e5a('0x70')?![]:!![]);_0x556ddf[_0x2e5a('0x66')](_0x261f91,_0x5a6047[_0x3aa46c][_0x2e5a('0x71')]||_0x261f91);}if(_0x44f52c['joins']){_0x44f52c['joins']=JSON[_0x2e5a('0x72')](_0x44f52c['joins']);for(var _0x3a05eb=0x0;_0x3a05eb<_0x44f52c['joins'][_0x2e5a('0x43')];_0x3a05eb+=0x1){if(_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x50a53a,_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x2d')])&&_0x44f52c['joins'][_0x3a05eb][_0x2e5a('0x75')]&&_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x76')]&&_0x44f52c['joins'][_0x3a05eb][_0x2e5a('0x77')]){_0x556ddf[_0x44f52c[_0x2e5a('0x73')][_0x3a05eb]['type']](_0x44f52c['joins'][_0x3a05eb]['foreignTable'],null,util[_0x2e5a('0x6e')](_0x2e5a('0x78'),_0x44f52c[_0x2e5a('0x79')],_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x75')],_0x44f52c['joins'][_0x3a05eb]['foreignTable'],_0x44f52c['joins'][_0x3a05eb]['foreignKey']));}}}if(_0x44f52c['conditions']){_0x44f52c[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x44f52c[_0x2e5a('0x7a')]);_0x556ddf['where'](_0x5452da(_0x44f52c[_0x2e5a('0x7a')]['group']));}_0x1545c8=_0x556ddf[_0x2e5a('0x7b')]();_0x556ddf['limit'](_0x3ce217);_0x556ddf[_0x2e5a('0x16')](0x0);logger[_0x2e5a('0x7c')](_0x2e5a('0x7d'),_0x556ddf['toString']());return dbH[_0x2e5a('0x7e')]['query'](_0x556ddf[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')]['SELECT']});}})[_0x2e5a('0x21')](respondWithResult(_0x5045b2,null))[_0x2e5a('0x40')](handleError(_0x5045b2,null));};function runReport(_0x190061,_0x4c94cc,_0x4c2280){var _0x1aa6b5=_0x4c94cc['name'];var _0x158e81=0xa;var _0x2e451f=[_0x2e5a('0x52'),'left_join',_0x2e5a('0x54'),'cross_join'];var _0x25c356={'SUM':_0x2e5a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':_0x2e5a('0x81'),'AVG':_0x2e5a('0x59'),'GROUP_CONCAT':_0x2e5a('0x82'),'GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':_0x2e5a('0x83')};var _0x218984={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2e5a('0x5c'),'HOUR':_0x2e5a('0x84'),'ROUND':_0x2e5a('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485582=function(_0x120da8){return!_[_0x2e5a('0x74')](['IS\x20NULL',_0x2e5a('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x120da8);};var _0x2bb374=function(_0x36ed6c){if(!_0x36ed6c||!_0x36ed6c[_0x2e5a('0x63')][_0x2e5a('0x43')]){return'';}for(var _0x1bbc14='(',_0x522ea7=0x0;_0x522ea7<_0x36ed6c[_0x2e5a('0x63')][_0x2e5a('0x43')];_0x522ea7+=0x1){_0x522ea7>0x0&&(_0x1bbc14+='\x20'+_0x36ed6c[_0x2e5a('0x64')]+'\x20');_0x1bbc14+=_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x65')]?_0x2bb374(_0x36ed6c['rules'][_0x522ea7][_0x2e5a('0x65')]):_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x66')]+'\x20'+_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x67')]+(_0x485582(_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x67')])?'\x20'+_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x85')]:'');}return _0x1bbc14+')';};var _0x53a675={'where':{'id':_0x190061['id']}},_0x514c81,_0x310c50,_0x18df2d,_0x573dae,_0x2e01cf;_0x53a675=_[_0x2e5a('0x45')]({},_0x53a675,_0x4c2280);return db[_0x2e5a('0x2b')][_0x2e5a('0x46')](_0x53a675)[_0x2e5a('0x21')](function(_0x5e78dd){if(_0x5e78dd){_0x514c81=_0x5e78dd;return _0x5e78dd[_0x2e5a('0x86')]();}return null;})['then'](function(_0x2c83f6){if(_0x2c83f6){if(!_0x2c83f6[_0x2e5a('0x43')]){throw new db[(_0x2e5a('0x87'))][(_0x2e5a('0x68'))](_0x2e5a('0x69'),0x193);}_0x310c50=_0x2c83f6;return db[_0x2e5a('0x88')][_0x2e5a('0x3f')]({'raw':!![]});}return null;})[_0x2e5a('0x21')](function(_0x4f329a){if(_0x4f329a){_0x18df2d=_[_0x2e5a('0x6a')](_0x4f329a,'id');var _0x13820d;var _0x92178d=squel[_0x2e5a('0x89')]();_0x92178d[_0x2e5a('0x8a')](_0x514c81['table']);for(var _0x4170bd=0x0;_0x4170bd<_0x310c50['length'];_0x4170bd+=0x1){_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x8b')]?_0x18df2d[_0x310c50[_0x4170bd][_0x2e5a('0x8b')]][_0x2e5a('0x6b')]:_0x310c50[_0x4170bd][_0x2e5a('0x66')];_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x25c356[_0x310c50[_0x4170bd][_0x2e5a('0x6c')]],'%s',_0x13820d):_0x13820d;_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x6e')]?_[_0x2e5a('0x6d')](_0x218984[_0x310c50[_0x4170bd]['format']],'%s',_0x13820d):_0x13820d;if(_0x310c50[_0x4170bd]['groupBy']){_0x92178d[_0x2e5a('0x65')](_0x13820d);}_0x310c50[_0x4170bd][_0x2e5a('0x6f')]&&_0x92178d['order'](_0x13820d,_0x310c50[_0x4170bd]['orderBy']===_0x2e5a('0x70')?![]:!![]);_0x92178d['field'](_0x13820d,_0x310c50[_0x4170bd]['alias']||_0x13820d);}if(_0x514c81[_0x2e5a('0x73')]){_0x514c81['joins']=JSON[_0x2e5a('0x72')](_0x514c81[_0x2e5a('0x73')]);for(var _0x2fe56f=0x0;_0x2fe56f<_0x514c81[_0x2e5a('0x73')]['length'];_0x2fe56f+=0x1){if(_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x2e451f,_0x514c81[_0x2e5a('0x73')][_0x2fe56f]['type'])&&_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x75')]&&_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x76')]&&_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x77')]){_0x92178d[_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x2d')]](_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x76')],null,util[_0x2e5a('0x6e')](_0x2e5a('0x78'),_0x514c81[_0x2e5a('0x79')],_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x75')],_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x76')],_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x77')]));}}}if(_0x514c81['conditions']){_0x514c81[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x514c81[_0x2e5a('0x7a')]);_0x92178d['where'](_0x2bb374(_0x514c81[_0x2e5a('0x7a')][_0x2e5a('0x65')]));}_0x2e01cf=_0x92178d[_0x2e5a('0x7b')]();_0x92178d[_0x2e5a('0x18')](_0x158e81);_0x92178d['offset'](0x0);return;}})[_0x2e5a('0x21')](function(){if(_0x4c94cc[_0x2e5a('0x8c')]===_0x2e5a('0x8d')){return null;}var _0x526ddb=_[_0x2e5a('0x45')](_0x4c94cc,{'name':_0x4c94cc[_0x2e5a('0x8e')]||_0x4c94cc[_0x2e5a('0x28')]||_0x514c81[_0x2e5a('0x28')],'basename':_0x1aa6b5,'savename':util[_0x2e5a('0x6e')]('%s-%s.%s',_0x4c94cc['name']||_0x514c81['name'],require(_0x2e5a('0x8f'))['generate'](0x4),_0x4c94cc[_0x2e5a('0x8c')]||'csv'),'reportId':_0x514c81['id'],'reportType':'custom'});return db[_0x2e5a('0x90')][_0x2e5a('0x47')](_0x526ddb,{'raw':!![]});})[_0x2e5a('0x21')](function(_0x1f49a6){if(_0x514c81[_0x2e5a('0x79')]==='cdr'){_0x2e01cf[_0x2e5a('0x3a')](_0x514c81[_0x2e5a('0x79')]+_0x2e5a('0x91'),_0x4c94cc['startDate'],_0x4c94cc[_0x2e5a('0x92')]);}else{_0x2e01cf[_0x2e5a('0x3a')](_0x514c81['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c94cc['startDate'],_0x4c94cc[_0x2e5a('0x92')]);}if(_0x1f49a6){logger['info'](_0x2e5a('0x93'),_0x2e01cf[_0x2e5a('0x7f')]());require(_0x2e5a('0x94'))[_0x2e5a('0x95')](path[_0x2e5a('0x52')](__dirname,_0x2e5a('0x96'),_0x1f49a6['output']),[_0x1f49a6['id'],_0x2e01cf[_0x2e5a('0x7f')](),path[_0x2e5a('0x52')](__dirname,'../../files/reports',_0x1f49a6[_0x2e5a('0x97')]),_0x1aa6b5]);return _0x1f49a6;}else{var _0xdb45e8=squel['select']();_0xdb45e8['from']('('+_0x2e01cf['toString']()+')',_0x2e5a('0x98'));_0xdb45e8['field'](_0x2e5a('0x99'),_0x2e5a('0x19'));_0x2e01cf[_0x2e5a('0x18')](_0x4c94cc['limit']||_0x158e81);_0x2e01cf[_0x2e5a('0x16')](_0x4c94cc['offset']||0x0);return dbH[_0x2e5a('0x7e')][_0x2e5a('0x2f')](_0xdb45e8[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')][_0x2e5a('0x9a')]})['then'](function(_0x4d2674){if(!_0x4d2674[_0x2e5a('0x43')]){_0x573dae=0x0;}else{_0x573dae=_0x4d2674[0x0][_0x2e5a('0x19')]||0x0;}return dbH['sequelize'][_0x2e5a('0x2f')](_0x2e01cf[_0x2e5a('0x7f')](),{'type':dbH['sequelize'][_0x2e5a('0x80')][_0x2e5a('0x9a')]});})[_0x2e5a('0x21')](function(_0xfc3cd2){return{'rows':_0xfc3cd2||[],'count':_0x573dae};});}});}exports[_0x2e5a('0x9b')]=function(_0x6f2cf,_0x3963e5){return runReport(_0x6f2cf[_0x2e5a('0x42')],_0x6f2cf[_0x2e5a('0x2f')],_0x6f2cf[_0x2e5a('0x3d')])[_0x2e5a('0x21')](respondWithResult(_0x3963e5,null))['catch'](handleError(_0x3963e5,null));};exports[_0x2e5a('0x9c')]=runReport;exports[_0x2e5a('0x2f')]=function(_0x544176,_0x2b86d8){var _0x4bbd50=0xa;var _0x16edd7=['join','left_join',_0x2e5a('0x54'),'cross_join'];var _0x447cdc={'SUM':_0x2e5a('0x56'),'COUNT':_0x2e5a('0x9d'),'COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':_0x2e5a('0x81'),'AVG':_0x2e5a('0x59'),'GROUP_CONCAT':_0x2e5a('0x82'),'GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13312e={'SEC_TO_TIME':_0x2e5a('0x5b'),'DATE':'DATE(%s)','HOUR':_0x2e5a('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x56e9a7=function(_0x4e8b3a){return!_[_0x2e5a('0x74')](['IS\x20NULL',_0x2e5a('0x60'),'IS\x20EMPTY',_0x2e5a('0x62')],_0x4e8b3a);};var _0xb34b1d=function(_0x44ace1){if(!_0x44ace1||!_0x44ace1[_0x2e5a('0x63')][_0x2e5a('0x43')]){return'';}for(var _0x4c4f06='(',_0x31e6ee=0x0;_0x31e6ee<_0x44ace1[_0x2e5a('0x63')][_0x2e5a('0x43')];_0x31e6ee+=0x1){_0x31e6ee>0x0&&(_0x4c4f06+='\x20'+_0x44ace1[_0x2e5a('0x64')]+'\x20');_0x4c4f06+=_0x44ace1['rules'][_0x31e6ee]['group']?_0xb34b1d(_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x65')]):_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x66')]+'\x20'+_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x67')]+(_0x56e9a7(_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x67')])?'\x20'+_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x85')]:'');}return _0x4c4f06+')';};var _0x4a9b7f={'where':{'id':_0x544176['params']['id']}},_0x44f2a2,_0x24d564,_0x1dc4a8,_0x8c6804,_0x191101;_0x4a9b7f=_['merge']({},_0x4a9b7f,_0x544176[_0x2e5a('0x3d')]);return db[_0x2e5a('0x2b')][_0x2e5a('0x46')](_0x4a9b7f)['then'](function(_0x534da3){if(_0x534da3){_0x44f2a2=_0x534da3;return _0x534da3[_0x2e5a('0x86')]();}return null;})[_0x2e5a('0x21')](function(_0x1fe5d3){if(_0x1fe5d3){if(!_0x1fe5d3[_0x2e5a('0x43')]){throw new db['Sequelize'][(_0x2e5a('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x24d564=_0x1fe5d3;return db[_0x2e5a('0x88')][_0x2e5a('0x3f')]({'raw':!![]});}return null;})[_0x2e5a('0x21')](function(_0x5df8dd){if(_0x5df8dd){_0x1dc4a8=_[_0x2e5a('0x6a')](_0x5df8dd,'id');var _0x4f3305;var _0x5e6445=squel['select']();_0x5e6445[_0x2e5a('0x8a')](_0x44f2a2['table']);for(var _0x5af953=0x0;_0x5af953<_0x24d564['length'];_0x5af953+=0x1){_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x8b')]?_0x1dc4a8[_0x24d564[_0x5af953][_0x2e5a('0x8b')]]['metric']:_0x24d564[_0x5af953]['field'];_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x447cdc[_0x24d564[_0x5af953]['function']],'%s',_0x4f3305):_0x4f3305;_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x6e')]?_[_0x2e5a('0x6d')](_0x13312e[_0x24d564[_0x5af953][_0x2e5a('0x6e')]],'%s',_0x4f3305):_0x4f3305;if(_0x24d564[_0x5af953][_0x2e5a('0x9e')]){_0x5e6445[_0x2e5a('0x65')](_0x4f3305);}_0x24d564[_0x5af953][_0x2e5a('0x6f')]&&_0x5e6445['order'](_0x4f3305,_0x24d564[_0x5af953][_0x2e5a('0x6f')]==='DESC'?![]:!![]);_0x5e6445[_0x2e5a('0x66')](_0x4f3305,_0x24d564[_0x5af953][_0x2e5a('0x71')]||_0x4f3305);}if(_0x44f2a2[_0x2e5a('0x73')]){_0x44f2a2['joins']=JSON[_0x2e5a('0x72')](_0x44f2a2[_0x2e5a('0x73')]);for(var _0x28277d=0x0;_0x28277d<_0x44f2a2[_0x2e5a('0x73')][_0x2e5a('0x43')];_0x28277d+=0x1){if(_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x16edd7,_0x44f2a2[_0x2e5a('0x73')][_0x28277d]['type'])&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x75')]&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')]&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x77')]){_0x5e6445[_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x2d')]](_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')],null,util['format'](_0x2e5a('0x78'),_0x44f2a2[_0x2e5a('0x79')],_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x75')],_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')],_0x44f2a2['joins'][_0x28277d]['foreignKey']));}}}if(_0x44f2a2[_0x2e5a('0x7a')]){_0x44f2a2[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x44f2a2[_0x2e5a('0x7a')]);_0x5e6445['where'](_0xb34b1d(_0x44f2a2[_0x2e5a('0x7a')][_0x2e5a('0x65')]));}_0x191101=_0x5e6445[_0x2e5a('0x7b')]();_0x5e6445[_0x2e5a('0x18')](_0x4bbd50);_0x5e6445[_0x2e5a('0x16')](0x0);logger[_0x2e5a('0x7c')](_0x2e5a('0x7d'),_0x5e6445[_0x2e5a('0x7f')]());return dbH[_0x2e5a('0x7e')][_0x2e5a('0x2f')](_0x5e6445[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')][_0x2e5a('0x9a')]});}})[_0x2e5a('0x21')](function(){return{'sql':_0x191101[_0x2e5a('0x7f')]()};})[_0x2e5a('0x21')](respondWithResult(_0x2b86d8,null))[_0x2e5a('0x40')](handleError(_0x2b86d8,null));}; \ No newline at end of file +var _0x2160=['Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','merge','map','type','VIRTUAL','filter','includeAll','rows','keys','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','cross_join','SUM(%s)','GROUP_CONCAT(%s)','ROUND(%s)','IS\x20EMPTY','operator','getFields','AnalyticMetric','keyBy','foreignKey','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','child_process','fork','../../components/export/','countTable','COUNT(*)','QueryTypes','runReport','COUNT(%s)','UNIX_TIMESTAMP(%s)','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set'];(function(_0x3a6dcb,_0x549c96){var _0x3df546=function(_0x6ef635){while(--_0x6ef635){_0x3a6dcb['push'](_0x3a6dcb['shift']());}};_0x3df546(++_0x549c96);}(_0x2160,0x132));var _0x0216=function(_0x56310b,_0x148cc2){_0x56310b=_0x56310b-0x0;var _0x34d7de=_0x2160[_0x56310b];return _0x34d7de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0216('0x0'));var zipdir=require(_0x0216('0x1'));var jsonpatch=require(_0x0216('0x2'));var rp=require(_0x0216('0x3'));var moment=require(_0x0216('0x4'));var BPromise=require(_0x0216('0x5'));var Mustache=require(_0x0216('0x6'));var util=require(_0x0216('0x7'));var path=require(_0x0216('0x8'));var sox=require(_0x0216('0x9'));var csv=require(_0x0216('0xa'));var ejs=require(_0x0216('0xb'));var fs=require('fs');var fs_extra=require(_0x0216('0xc'));var _=require(_0x0216('0xd'));var squel=require('squel');var crypto=require(_0x0216('0xe'));var jsforce=require(_0x0216('0xf'));var deskjs=require(_0x0216('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0216('0x11'));var Papa=require(_0x0216('0x12'));var Redis=require(_0x0216('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0216('0x14'));var as=require(_0x0216('0x15'));var hardwareService=require(_0x0216('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0216('0x17'));var config=require(_0x0216('0x18'));var licenseUtil=require(_0x0216('0x19'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x0216('0x1a')];function respondWithStatusCode(_0x22e8ed,_0x3c9431){_0x3c9431=_0x3c9431||0xcc;return function(_0x20ec81){if(_0x20ec81){return _0x22e8ed[_0x0216('0x1b')](_0x3c9431);}return _0x22e8ed[_0x0216('0x1c')](_0x3c9431)[_0x0216('0x1d')]();};}function respondWithResult(_0x597575,_0x4fb4e9){_0x4fb4e9=_0x4fb4e9||0xc8;return function(_0xc17bb7){if(_0xc17bb7){return _0x597575[_0x0216('0x1c')](_0x4fb4e9)[_0x0216('0x1e')](_0xc17bb7);}};}function respondWithFilteredResult(_0x2835ff,_0x4942b7){return function(_0x89bb91){if(_0x89bb91){var _0x26c3c9=typeof _0x4942b7['offset']===_0x0216('0x1f')&&typeof _0x4942b7[_0x0216('0x20')]===_0x0216('0x1f');var _0x493309=_0x89bb91['count'];var _0x5591fa=_0x26c3c9?0x0:_0x4942b7[_0x0216('0x21')];var _0x5dd8e7=_0x26c3c9?_0x89bb91[_0x0216('0x22')]:_0x4942b7['offset']+_0x4942b7[_0x0216('0x20')];var _0xb9eb10;if(_0x5dd8e7>=_0x493309){_0x5dd8e7=_0x493309;_0xb9eb10=0xc8;}else{_0xb9eb10=0xce;}_0x2835ff['status'](_0xb9eb10);return _0x2835ff[_0x0216('0x23')](_0x0216('0x24'),_0x5591fa+'-'+_0x5dd8e7+'/'+_0x493309)[_0x0216('0x1e')](_0x89bb91);}return null;};}function patchUpdates(_0x101ea5){return function(_0x41c772){try{jsonpatch[_0x0216('0x25')](_0x41c772,_0x101ea5,!![]);}catch(_0x32cf11){return BPromise[_0x0216('0x26')](_0x32cf11);}return _0x41c772[_0x0216('0x27')]();};}function saveUpdates(_0x3fecf0,_0x3b19c4){return function(_0x403a13){if(_0x403a13){return _0x403a13[_0x0216('0x28')](_0x3fecf0)['then'](function(_0x2165d4){return _0x2165d4;});}return null;};}function removeEntity(_0x322318,_0x27e768){return function(_0x36de58){if(_0x36de58){return _0x36de58[_0x0216('0x29')]()[_0x0216('0x2a')](function(){var _0x5c9427=_0x36de58['get']({'plain':!![]});var _0x3cdc9e='CustomReports';return db[_0x0216('0x2b')][_0x0216('0x29')]({'where':{'type':_0x3cdc9e,'resourceId':_0x5c9427['id']}})[_0x0216('0x2a')](function(){return _0x36de58;});})[_0x0216('0x2a')](function(){_0x322318[_0x0216('0x1c')](0xcc)[_0x0216('0x1d')]();});}};}function handleEntityNotFound(_0x2758b3,_0x26ea10){return function(_0x258275){if(!_0x258275){_0x2758b3[_0x0216('0x1b')](0x194);}return _0x258275;};}function handleError(_0x3b37e3,_0x1e0cb0){_0x1e0cb0=_0x1e0cb0||0x1f4;return function(_0x342fce){logger[_0x0216('0x2c')](_0x342fce[_0x0216('0x2d')]);if(_0x342fce[_0x0216('0x2e')]){delete _0x342fce[_0x0216('0x2e')];}_0x3b37e3[_0x0216('0x1c')](_0x1e0cb0)[_0x0216('0x2f')](_0x342fce);};}exports['index']=function(_0x223f97,_0x2ff3cd){var _0x3b9c24={},_0x1d8613={},_0x144bef={'count':0x0,'rows':[]};var _0x336f5f=_['map'](db[_0x0216('0x30')][_0x0216('0x31')],function(_0x503776){return{'name':_0x503776[_0x0216('0x32')],'type':_0x503776['type'][_0x0216('0x33')]};});_0x1d8613[_0x0216('0x34')]=_['map'](_0x336f5f,'name');_0x1d8613[_0x0216('0x35')]=_['keys'](_0x223f97[_0x0216('0x35')]);_0x1d8613['filters']=_[_0x0216('0x36')](_0x1d8613[_0x0216('0x34')],_0x1d8613[_0x0216('0x35')]);_0x3b9c24['attributes']=_[_0x0216('0x36')](_0x1d8613[_0x0216('0x34')],qs[_0x0216('0x37')](_0x223f97[_0x0216('0x35')][_0x0216('0x37')]));_0x3b9c24[_0x0216('0x38')]=_0x3b9c24[_0x0216('0x38')][_0x0216('0x39')]?_0x3b9c24[_0x0216('0x38')]:_0x1d8613[_0x0216('0x34')];if(!_0x223f97[_0x0216('0x35')][_0x0216('0x3a')]('nolimit')){_0x3b9c24[_0x0216('0x20')]=qs['limit'](_0x223f97[_0x0216('0x35')][_0x0216('0x20')]);_0x3b9c24['offset']=qs[_0x0216('0x21')](_0x223f97['query']['offset']);}_0x3b9c24[_0x0216('0x3b')]=qs[_0x0216('0x3c')](_0x223f97['query'][_0x0216('0x3c')]);_0x3b9c24[_0x0216('0x3d')]=qs['filters'](_[_0x0216('0x3e')](_0x223f97[_0x0216('0x35')],_0x1d8613[_0x0216('0x3f')]),_0x336f5f);if(_0x223f97['query']['filter']){_0x3b9c24['where']=_[_0x0216('0x40')](_0x3b9c24[_0x0216('0x3d')],{'$or':_[_0x0216('0x41')](_0x336f5f,function(_0x1437b4){if(_0x1437b4[_0x0216('0x42')]!==_0x0216('0x43')){var _0x51af9a={};_0x51af9a[_0x1437b4['name']]={'$like':'%'+_0x223f97['query'][_0x0216('0x44')]+'%'};return _0x51af9a;}})});}_0x3b9c24=_[_0x0216('0x40')]({},_0x3b9c24,_0x223f97['options']);var _0x154859={'where':_0x3b9c24['where']};return db[_0x0216('0x30')][_0x0216('0x22')](_0x154859)['then'](function(_0x20eedc){_0x144bef[_0x0216('0x22')]=_0x20eedc;if(_0x223f97[_0x0216('0x35')][_0x0216('0x45')]){_0x3b9c24['include']=[{'all':!![]}];}return db[_0x0216('0x30')]['findAll'](_0x3b9c24);})['then'](function(_0x2b4edb){_0x144bef[_0x0216('0x46')]=_0x2b4edb;return _0x144bef;})[_0x0216('0x2a')](respondWithFilteredResult(_0x2ff3cd,_0x3b9c24))['catch'](handleError(_0x2ff3cd,null));};exports['show']=function(_0x3b4afa,_0x22b416){var _0x3adf0a={'raw':![],'where':{'id':_0x3b4afa['params']['id']}},_0x495b41={};_0x495b41[_0x0216('0x34')]=_[_0x0216('0x47')](db['AnalyticCustomReport'][_0x0216('0x31')]);_0x495b41[_0x0216('0x35')]=_[_0x0216('0x47')](_0x3b4afa[_0x0216('0x35')]);_0x495b41['filters']=_[_0x0216('0x36')](_0x495b41['model'],_0x495b41['query']);_0x3adf0a[_0x0216('0x38')]=_[_0x0216('0x36')](_0x495b41[_0x0216('0x34')],qs[_0x0216('0x37')](_0x3b4afa[_0x0216('0x35')]['fields']));_0x3adf0a[_0x0216('0x38')]=_0x3adf0a['attributes'][_0x0216('0x39')]?_0x3adf0a['attributes']:_0x495b41[_0x0216('0x34')];if(_0x3b4afa['query'][_0x0216('0x45')]){_0x3adf0a[_0x0216('0x48')]=[{'all':!![]}];}_0x3adf0a=_[_0x0216('0x40')]({},_0x3adf0a,_0x3b4afa[_0x0216('0x49')]);return db['AnalyticCustomReport'][_0x0216('0x4a')](_0x3adf0a)[_0x0216('0x2a')](handleEntityNotFound(_0x22b416,null))[_0x0216('0x2a')](respondWithResult(_0x22b416,null))[_0x0216('0x4b')](handleError(_0x22b416,null));};exports[_0x0216('0x4c')]=function(_0x39405c,_0x36b41c){return db['AnalyticCustomReport']['create'](_0x39405c[_0x0216('0x4d')],{})[_0x0216('0x2a')](function(_0x1e2dee){var _0xfedda2=_0x39405c[_0x0216('0x4e')]['get']({'plain':!![]});if(!_0xfedda2)throw new Error(_0x0216('0x4f'));if(_0xfedda2[_0x0216('0x50')]===_0x0216('0x4e')){var _0xb9cbce=_0x1e2dee[_0x0216('0x51')]({'plain':!![]});var _0x3ef7c6=_0x0216('0x52');return db[_0x0216('0x53')]['find']({'where':{'name':_0x3ef7c6,'userProfileId':_0xfedda2[_0x0216('0x54')]},'raw':!![]})[_0x0216('0x2a')](function(_0x35b22e){if(_0x35b22e&&_0x35b22e[_0x0216('0x55')]===0x0){return db[_0x0216('0x2b')][_0x0216('0x4c')]({'name':_0xb9cbce[_0x0216('0x2e')],'resourceId':_0xb9cbce['id'],'type':_0x0216('0x56'),'sectionId':_0x35b22e['id']},{})[_0x0216('0x2a')](function(){return _0x1e2dee;});}else{return _0x1e2dee;}})[_0x0216('0x4b')](function(_0x40e2d0){logger[_0x0216('0x2c')](_0x0216('0x57'),_0x40e2d0);throw _0x40e2d0;});}return _0x1e2dee;})[_0x0216('0x2a')](respondWithResult(_0x36b41c,0xc9))['catch'](handleError(_0x36b41c,null));};exports[_0x0216('0x28')]=function(_0x1ecad6,_0x50414e){if(_0x1ecad6[_0x0216('0x4d')]['id']){delete _0x1ecad6[_0x0216('0x4d')]['id'];}return db[_0x0216('0x30')][_0x0216('0x4a')]({'where':{'id':_0x1ecad6[_0x0216('0x58')]['id']}})['then'](handleEntityNotFound(_0x50414e,null))[_0x0216('0x2a')](saveUpdates(_0x1ecad6[_0x0216('0x4d')],null))[_0x0216('0x2a')](respondWithResult(_0x50414e,null))['catch'](handleError(_0x50414e,null));};exports[_0x0216('0x29')]=function(_0x4acaca,_0x43e01c){return db[_0x0216('0x30')][_0x0216('0x4a')]({'where':{'id':_0x4acaca['params']['id']}})[_0x0216('0x2a')](handleEntityNotFound(_0x43e01c,null))[_0x0216('0x2a')](removeEntity(_0x43e01c,null))[_0x0216('0x4b')](handleError(_0x43e01c,null));};exports[_0x0216('0x59')]=function(_0x218149,_0x192282){var _0x331c87=0xa;var _0x33518b=[_0x0216('0x5a'),_0x0216('0x5b'),'right_join','cross_join'];var _0x4f6eb8={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0216('0x5c'),'MAX':_0x0216('0x5d'),'MIN':_0x0216('0x5e'),'AVG':_0x0216('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0216('0x60'),'GROUP_CONCAT DESC':_0x0216('0x61')};var _0x943827={'SEC_TO_TIME':_0x0216('0x62'),'DATE':_0x0216('0x63'),'HOUR':_0x0216('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc5c693=function(_0x5a3f2e){return!_[_0x0216('0x65')]([_0x0216('0x66'),_0x0216('0x67'),'IS\x20EMPTY',_0x0216('0x68')],_0x5a3f2e);};var _0x5cace1=function(_0x344bdb){if(!_0x344bdb||!_0x344bdb['rules'][_0x0216('0x39')]){return'';}for(var _0x407700='(',_0xbb080b=0x0;_0xbb080b<_0x344bdb[_0x0216('0x69')][_0x0216('0x39')];_0xbb080b+=0x1){_0xbb080b>0x0&&(_0x407700+='\x20'+_0x344bdb['operator']+'\x20');_0x407700+=_0x344bdb[_0x0216('0x69')][_0xbb080b][_0x0216('0x6a')]?_0x5cace1(_0x344bdb['rules'][_0xbb080b][_0x0216('0x6a')]):_0x344bdb[_0x0216('0x69')][_0xbb080b][_0x0216('0x6b')]+'\x20'+_0x344bdb[_0x0216('0x69')][_0xbb080b][_0x0216('0x6c')]+(_0xc5c693(_0x344bdb['rules'][_0xbb080b][_0x0216('0x6c')])?'\x20'+_0x344bdb[_0x0216('0x69')][_0xbb080b]['value']:'');}return _0x407700+')';};var _0x1744b9={'where':{'id':_0x218149[_0x0216('0x58')]['id']}},_0x17d7c1,_0x5ef303,_0x15f7f0,_0x144861,_0x311f79;_0x1744b9=_[_0x0216('0x40')]({},_0x1744b9,_0x218149[_0x0216('0x49')]);return db['AnalyticCustomReport'][_0x0216('0x4a')](_0x1744b9)['then'](function(_0xd35957){if(_0xd35957){_0x17d7c1=_0xd35957;return _0xd35957['getFields']();}return null;})[_0x0216('0x2a')](function(_0x12bf74){if(_0x12bf74){if(!_0x12bf74[_0x0216('0x39')]){throw new db[(_0x0216('0x6d'))][(_0x0216('0x6e'))](_0x0216('0x6f'),0x193);}_0x5ef303=_0x12bf74;return db['AnalyticMetric'][_0x0216('0x70')]({'raw':!![]});}return null;})[_0x0216('0x2a')](function(_0x9657fe){if(_0x9657fe){_0x15f7f0=_['keyBy'](_0x9657fe,'id');var _0x5150c7;var _0x4202dd=squel[_0x0216('0x71')]();_0x4202dd[_0x0216('0x72')](_0x17d7c1[_0x0216('0x73')]);for(var _0x513246=0x0;_0x513246<_0x5ef303['length'];_0x513246+=0x1){_0x5150c7=_0x5ef303[_0x513246][_0x0216('0x74')]?_0x15f7f0[_0x5ef303[_0x513246][_0x0216('0x74')]][_0x0216('0x75')]:_0x5ef303[_0x513246][_0x0216('0x6b')];_0x5150c7=_0x5ef303[_0x513246]['function']?_[_0x0216('0x76')](_0x4f6eb8[_0x5ef303[_0x513246][_0x0216('0x77')]],'%s',_0x5150c7):_0x5150c7;_0x5150c7=_0x5ef303[_0x513246][_0x0216('0x78')]?_[_0x0216('0x76')](_0x943827[_0x5ef303[_0x513246][_0x0216('0x78')]],'%s',_0x5150c7):_0x5150c7;if(_0x5ef303[_0x513246][_0x0216('0x79')]){_0x4202dd[_0x0216('0x6a')](_0x5150c7);}_0x5ef303[_0x513246][_0x0216('0x7a')]&&_0x4202dd[_0x0216('0x3b')](_0x5150c7,_0x5ef303[_0x513246]['orderBy']===_0x0216('0x7b')?![]:!![]);_0x4202dd['field'](_0x5150c7,_0x5ef303[_0x513246][_0x0216('0x7c')]||_0x5150c7);}if(_0x17d7c1['joins']){_0x17d7c1[_0x0216('0x7d')]=JSON['parse'](_0x17d7c1[_0x0216('0x7d')]);for(var _0x4134e0=0x0;_0x4134e0<_0x17d7c1[_0x0216('0x7d')][_0x0216('0x39')];_0x4134e0+=0x1){if(_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x42')]&&_[_0x0216('0x65')](_0x33518b,_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x42')])&&_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x7e')]&&_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x7f')]&&_0x17d7c1[_0x0216('0x7d')][_0x4134e0]['foreignKey']){_0x4202dd[_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x42')]](_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x7f')],null,util[_0x0216('0x78')]('%s.%s\x20=\x20%s.%s',_0x17d7c1[_0x0216('0x73')],_0x17d7c1[_0x0216('0x7d')][_0x4134e0]['parentKey'],_0x17d7c1[_0x0216('0x7d')][_0x4134e0][_0x0216('0x7f')],_0x17d7c1[_0x0216('0x7d')][_0x4134e0]['foreignKey']));}}}if(_0x17d7c1[_0x0216('0x80')]){_0x17d7c1[_0x0216('0x80')]=JSON[_0x0216('0x81')](_0x17d7c1[_0x0216('0x80')]);_0x4202dd['where'](_0x5cace1(_0x17d7c1[_0x0216('0x80')]['group']));}_0x311f79=_0x4202dd[_0x0216('0x82')]();_0x4202dd['limit'](_0x331c87);_0x4202dd[_0x0216('0x21')](0x0);logger[_0x0216('0x83')](_0x0216('0x84'),_0x4202dd['toString']());return dbH[_0x0216('0x85')]['query'](_0x4202dd[_0x0216('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x0216('0x87')]});}})['then'](respondWithResult(_0x192282,null))[_0x0216('0x4b')](handleError(_0x192282,null));};function runReport(_0x246d4e,_0x4d5fa7,_0x1ee417){var _0x1d3daf=_0x4d5fa7[_0x0216('0x2e')];var _0x15be24=0xa;var _0x2d2055=[_0x0216('0x5a'),_0x0216('0x5b'),'right_join',_0x0216('0x88')];var _0x4886fe={'SUM':_0x0216('0x89'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0216('0x5c'),'MAX':_0x0216('0x5d'),'MIN':_0x0216('0x5e'),'AVG':_0x0216('0x5f'),'GROUP_CONCAT':_0x0216('0x8a'),'GROUP_CONCAT ASC':_0x0216('0x60'),'GROUP_CONCAT DESC':_0x0216('0x61')};var _0x231a52={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0216('0x63'),'HOUR':_0x0216('0x64'),'ROUND':_0x0216('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x526220=function(_0x4b4314){return!_['includes'](['IS\x20NULL',_0x0216('0x67'),_0x0216('0x8c'),_0x0216('0x68')],_0x4b4314);};var _0x2d69cb=function(_0x4a13c9){if(!_0x4a13c9||!_0x4a13c9[_0x0216('0x69')]['length']){return'';}for(var _0x386437='(',_0x251542=0x0;_0x251542<_0x4a13c9[_0x0216('0x69')][_0x0216('0x39')];_0x251542+=0x1){_0x251542>0x0&&(_0x386437+='\x20'+_0x4a13c9[_0x0216('0x8d')]+'\x20');_0x386437+=_0x4a13c9[_0x0216('0x69')][_0x251542][_0x0216('0x6a')]?_0x2d69cb(_0x4a13c9[_0x0216('0x69')][_0x251542][_0x0216('0x6a')]):_0x4a13c9[_0x0216('0x69')][_0x251542][_0x0216('0x6b')]+'\x20'+_0x4a13c9[_0x0216('0x69')][_0x251542][_0x0216('0x6c')]+(_0x526220(_0x4a13c9['rules'][_0x251542][_0x0216('0x6c')])?'\x20'+_0x4a13c9[_0x0216('0x69')][_0x251542]['value']:'');}return _0x386437+')';};var _0x6a5e1d={'where':{'id':_0x246d4e['id']}},_0x4cb5c5,_0x5c7a8d,_0x3b8b69,_0x39a777,_0x3a6fde;_0x6a5e1d=_[_0x0216('0x40')]({},_0x6a5e1d,_0x1ee417);return db[_0x0216('0x30')][_0x0216('0x4a')](_0x6a5e1d)[_0x0216('0x2a')](function(_0x48ce73){if(_0x48ce73){_0x4cb5c5=_0x48ce73;return _0x48ce73[_0x0216('0x8e')]();}return null;})['then'](function(_0x40baca){if(_0x40baca){if(!_0x40baca[_0x0216('0x39')]){throw new db[(_0x0216('0x6d'))][(_0x0216('0x6e'))](_0x0216('0x6f'),0x193);}_0x5c7a8d=_0x40baca;return db[_0x0216('0x8f')]['findAll']({'raw':!![]});}return null;})[_0x0216('0x2a')](function(_0x5b5df0){if(_0x5b5df0){_0x3b8b69=_[_0x0216('0x90')](_0x5b5df0,'id');var _0x1d2fec;var _0xcc1b4d=squel[_0x0216('0x71')]();_0xcc1b4d[_0x0216('0x72')](_0x4cb5c5[_0x0216('0x73')]);for(var _0x4c94e0=0x0;_0x4c94e0<_0x5c7a8d['length'];_0x4c94e0+=0x1){_0x1d2fec=_0x5c7a8d[_0x4c94e0]['MetricId']?_0x3b8b69[_0x5c7a8d[_0x4c94e0]['MetricId']][_0x0216('0x75')]:_0x5c7a8d[_0x4c94e0][_0x0216('0x6b')];_0x1d2fec=_0x5c7a8d[_0x4c94e0][_0x0216('0x77')]?_[_0x0216('0x76')](_0x4886fe[_0x5c7a8d[_0x4c94e0][_0x0216('0x77')]],'%s',_0x1d2fec):_0x1d2fec;_0x1d2fec=_0x5c7a8d[_0x4c94e0][_0x0216('0x78')]?_['replace'](_0x231a52[_0x5c7a8d[_0x4c94e0][_0x0216('0x78')]],'%s',_0x1d2fec):_0x1d2fec;if(_0x5c7a8d[_0x4c94e0]['groupBy']){_0xcc1b4d[_0x0216('0x6a')](_0x1d2fec);}_0x5c7a8d[_0x4c94e0][_0x0216('0x7a')]&&_0xcc1b4d['order'](_0x1d2fec,_0x5c7a8d[_0x4c94e0]['orderBy']===_0x0216('0x7b')?![]:!![]);_0xcc1b4d['field'](_0x1d2fec,_0x5c7a8d[_0x4c94e0][_0x0216('0x7c')]||_0x1d2fec);}if(_0x4cb5c5[_0x0216('0x7d')]){_0x4cb5c5['joins']=JSON[_0x0216('0x81')](_0x4cb5c5[_0x0216('0x7d')]);for(var _0x5e44bc=0x0;_0x5e44bc<_0x4cb5c5[_0x0216('0x7d')]['length'];_0x5e44bc+=0x1){if(_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc]['type']&&_[_0x0216('0x65')](_0x2d2055,_0x4cb5c5['joins'][_0x5e44bc]['type'])&&_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc][_0x0216('0x7e')]&&_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc][_0x0216('0x7f')]&&_0x4cb5c5['joins'][_0x5e44bc][_0x0216('0x91')]){_0xcc1b4d[_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc][_0x0216('0x42')]](_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc][_0x0216('0x7f')],null,util[_0x0216('0x78')](_0x0216('0x92'),_0x4cb5c5['table'],_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc]['parentKey'],_0x4cb5c5['joins'][_0x5e44bc]['foreignTable'],_0x4cb5c5[_0x0216('0x7d')][_0x5e44bc][_0x0216('0x91')]));}}}if(_0x4cb5c5[_0x0216('0x80')]){_0x4cb5c5[_0x0216('0x80')]=JSON[_0x0216('0x81')](_0x4cb5c5[_0x0216('0x80')]);_0xcc1b4d[_0x0216('0x3d')](_0x2d69cb(_0x4cb5c5['conditions'][_0x0216('0x6a')]));}_0x3a6fde=_0xcc1b4d[_0x0216('0x82')]();_0xcc1b4d[_0x0216('0x20')](_0x15be24);_0xcc1b4d[_0x0216('0x21')](0x0);return;}})[_0x0216('0x2a')](function(){if(_0x4d5fa7[_0x0216('0x93')]==='web'){return null;}var _0x2eb3e4=_[_0x0216('0x40')](_0x4d5fa7,{'name':_0x4d5fa7[_0x0216('0x94')]||_0x4d5fa7[_0x0216('0x2e')]||_0x4cb5c5[_0x0216('0x2e')],'basename':_0x1d3daf,'savename':util[_0x0216('0x78')](_0x0216('0x95'),_0x4d5fa7[_0x0216('0x2e')]||_0x4cb5c5[_0x0216('0x2e')],require(_0x0216('0x96'))[_0x0216('0x97')](0x4),_0x4d5fa7['output']||_0x0216('0x98')),'reportId':_0x4cb5c5['id'],'reportType':_0x0216('0x99')});return db[_0x0216('0x9a')][_0x0216('0x4c')](_0x2eb3e4,{'raw':!![]});})[_0x0216('0x2a')](function(_0x5e9baf){if(_0x4cb5c5[_0x0216('0x73')]===_0x0216('0x9b')){_0x3a6fde[_0x0216('0x3d')](_0x4cb5c5[_0x0216('0x73')]+_0x0216('0x9c'),_0x4d5fa7[_0x0216('0x9d')],_0x4d5fa7['endDate']);}else{_0x3a6fde['where'](_0x4cb5c5[_0x0216('0x73')]+_0x0216('0x9e'),_0x4d5fa7[_0x0216('0x9d')],_0x4d5fa7[_0x0216('0x9f')]);}if(_0x5e9baf){logger[_0x0216('0xa0')]('Run\x20Query:',_0x3a6fde['toString']());require(_0x0216('0xa1'))[_0x0216('0xa2')](path[_0x0216('0x5a')](__dirname,_0x0216('0xa3'),_0x5e9baf['output']),[_0x5e9baf['id'],_0x3a6fde[_0x0216('0x86')](),path[_0x0216('0x5a')](__dirname,'../../files/reports',_0x5e9baf['savename']),_0x1d3daf]);return _0x5e9baf;}else{var _0x56cafa=squel[_0x0216('0x71')]();_0x56cafa[_0x0216('0x72')]('('+_0x3a6fde['toString']()+')',_0x0216('0xa4'));_0x56cafa[_0x0216('0x6b')](_0x0216('0xa5'),_0x0216('0x22'));_0x3a6fde[_0x0216('0x20')](_0x4d5fa7[_0x0216('0x20')]||_0x15be24);_0x3a6fde[_0x0216('0x21')](_0x4d5fa7[_0x0216('0x21')]||0x0);return dbH[_0x0216('0x85')][_0x0216('0x35')](_0x56cafa[_0x0216('0x86')](),{'type':dbH[_0x0216('0x85')][_0x0216('0xa6')]['SELECT']})[_0x0216('0x2a')](function(_0xf294f0){if(!_0xf294f0['length']){_0x39a777=0x0;}else{_0x39a777=_0xf294f0[0x0][_0x0216('0x22')]||0x0;}return dbH[_0x0216('0x85')][_0x0216('0x35')](_0x3a6fde[_0x0216('0x86')](),{'type':dbH[_0x0216('0x85')][_0x0216('0xa6')][_0x0216('0x87')]});})[_0x0216('0x2a')](function(_0x18479c){return{'rows':_0x18479c||[],'count':_0x39a777};});}});}exports['run']=function(_0x56123b,_0x3f57f7){return runReport(_0x56123b['params'],_0x56123b[_0x0216('0x35')],_0x56123b[_0x0216('0x49')])[_0x0216('0x2a')](respondWithResult(_0x3f57f7,null))[_0x0216('0x4b')](handleError(_0x3f57f7,null));};exports[_0x0216('0xa7')]=runReport;exports[_0x0216('0x35')]=function(_0x4e5a07,_0x109a30){var _0x18595e=0xa;var _0x149354=[_0x0216('0x5a'),_0x0216('0x5b'),'right_join',_0x0216('0x88')];var _0x5f150a={'SUM':_0x0216('0x89'),'COUNT':_0x0216('0xa8'),'COUNT DISTINCT':_0x0216('0x5c'),'MAX':'MAX(%s)','MIN':_0x0216('0x5e'),'AVG':_0x0216('0x5f'),'GROUP_CONCAT':_0x0216('0x8a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0216('0x61')};var _0x12ac01={'SEC_TO_TIME':_0x0216('0x62'),'DATE':_0x0216('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x0216('0x8b'),'UNIX_TIMESTAMP':_0x0216('0xa9')};var _0x37d576=function(_0x11f020){return!_['includes']([_0x0216('0x66'),_0x0216('0x67'),_0x0216('0x8c'),_0x0216('0x68')],_0x11f020);};var _0x486e21=function(_0x12cf27){if(!_0x12cf27||!_0x12cf27[_0x0216('0x69')][_0x0216('0x39')]){return'';}for(var _0x1e6def='(',_0x5a7280=0x0;_0x5a7280<_0x12cf27['rules']['length'];_0x5a7280+=0x1){_0x5a7280>0x0&&(_0x1e6def+='\x20'+_0x12cf27[_0x0216('0x8d')]+'\x20');_0x1e6def+=_0x12cf27['rules'][_0x5a7280][_0x0216('0x6a')]?_0x486e21(_0x12cf27['rules'][_0x5a7280][_0x0216('0x6a')]):_0x12cf27['rules'][_0x5a7280][_0x0216('0x6b')]+'\x20'+_0x12cf27[_0x0216('0x69')][_0x5a7280][_0x0216('0x6c')]+(_0x37d576(_0x12cf27[_0x0216('0x69')][_0x5a7280][_0x0216('0x6c')])?'\x20'+_0x12cf27[_0x0216('0x69')][_0x5a7280][_0x0216('0xaa')]:'');}return _0x1e6def+')';};var _0x30e4ea={'where':{'id':_0x4e5a07[_0x0216('0x58')]['id']}},_0x3005ca,_0x3c9b99,_0x537076,_0x44ccd8,_0x2c26eb;_0x30e4ea=_[_0x0216('0x40')]({},_0x30e4ea,_0x4e5a07[_0x0216('0x49')]);return db[_0x0216('0x30')]['find'](_0x30e4ea)[_0x0216('0x2a')](function(_0x3d9071){if(_0x3d9071){_0x3005ca=_0x3d9071;return _0x3d9071[_0x0216('0x8e')]();}return null;})['then'](function(_0x2dcd44){if(_0x2dcd44){if(!_0x2dcd44[_0x0216('0x39')]){throw new db[(_0x0216('0x6d'))][(_0x0216('0x6e'))](_0x0216('0x6f'),0x193);}_0x3c9b99=_0x2dcd44;return db[_0x0216('0x8f')][_0x0216('0x70')]({'raw':!![]});}return null;})[_0x0216('0x2a')](function(_0x502fca){if(_0x502fca){_0x537076=_['keyBy'](_0x502fca,'id');var _0xef4ff9;var _0x4c6506=squel[_0x0216('0x71')]();_0x4c6506[_0x0216('0x72')](_0x3005ca['table']);for(var _0x3ccfcf=0x0;_0x3ccfcf<_0x3c9b99[_0x0216('0x39')];_0x3ccfcf+=0x1){_0xef4ff9=_0x3c9b99[_0x3ccfcf][_0x0216('0x74')]?_0x537076[_0x3c9b99[_0x3ccfcf][_0x0216('0x74')]]['metric']:_0x3c9b99[_0x3ccfcf]['field'];_0xef4ff9=_0x3c9b99[_0x3ccfcf][_0x0216('0x77')]?_[_0x0216('0x76')](_0x5f150a[_0x3c9b99[_0x3ccfcf]['function']],'%s',_0xef4ff9):_0xef4ff9;_0xef4ff9=_0x3c9b99[_0x3ccfcf][_0x0216('0x78')]?_[_0x0216('0x76')](_0x12ac01[_0x3c9b99[_0x3ccfcf][_0x0216('0x78')]],'%s',_0xef4ff9):_0xef4ff9;if(_0x3c9b99[_0x3ccfcf]['groupBy']){_0x4c6506[_0x0216('0x6a')](_0xef4ff9);}_0x3c9b99[_0x3ccfcf]['orderBy']&&_0x4c6506[_0x0216('0x3b')](_0xef4ff9,_0x3c9b99[_0x3ccfcf][_0x0216('0x7a')]==='DESC'?![]:!![]);_0x4c6506['field'](_0xef4ff9,_0x3c9b99[_0x3ccfcf][_0x0216('0x7c')]||_0xef4ff9);}if(_0x3005ca['joins']){_0x3005ca[_0x0216('0x7d')]=JSON[_0x0216('0x81')](_0x3005ca[_0x0216('0x7d')]);for(var _0x17f614=0x0;_0x17f614<_0x3005ca[_0x0216('0x7d')]['length'];_0x17f614+=0x1){if(_0x3005ca[_0x0216('0x7d')][_0x17f614][_0x0216('0x42')]&&_[_0x0216('0x65')](_0x149354,_0x3005ca[_0x0216('0x7d')][_0x17f614][_0x0216('0x42')])&&_0x3005ca['joins'][_0x17f614][_0x0216('0x7e')]&&_0x3005ca[_0x0216('0x7d')][_0x17f614]['foreignTable']&&_0x3005ca['joins'][_0x17f614][_0x0216('0x91')]){_0x4c6506[_0x3005ca[_0x0216('0x7d')][_0x17f614][_0x0216('0x42')]](_0x3005ca['joins'][_0x17f614][_0x0216('0x7f')],null,util[_0x0216('0x78')](_0x0216('0x92'),_0x3005ca[_0x0216('0x73')],_0x3005ca[_0x0216('0x7d')][_0x17f614][_0x0216('0x7e')],_0x3005ca[_0x0216('0x7d')][_0x17f614]['foreignTable'],_0x3005ca[_0x0216('0x7d')][_0x17f614][_0x0216('0x91')]));}}}if(_0x3005ca['conditions']){_0x3005ca[_0x0216('0x80')]=JSON[_0x0216('0x81')](_0x3005ca['conditions']);_0x4c6506[_0x0216('0x3d')](_0x486e21(_0x3005ca[_0x0216('0x80')]['group']));}_0x2c26eb=_0x4c6506[_0x0216('0x82')]();_0x4c6506[_0x0216('0x20')](_0x18595e);_0x4c6506['offset'](0x0);logger[_0x0216('0x83')]('Limited\x20Query:',_0x4c6506[_0x0216('0x86')]());return dbH[_0x0216('0x85')][_0x0216('0x35')](_0x4c6506[_0x0216('0x86')](),{'type':dbH[_0x0216('0x85')][_0x0216('0xa6')][_0x0216('0x87')]});}})[_0x0216('0x2a')](function(){return{'sql':_0x2c26eb[_0x0216('0x86')]()};})['then'](respondWithResult(_0x109a30,null))[_0x0216('0x4b')](handleError(_0x109a30,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index f2abf62..4990b74 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 _0xeb13=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x25807b,_0x3368c0){var _0x21cd77=function(_0x187587){while(--_0x187587){_0x25807b['push'](_0x25807b['shift']());}};_0x21cd77(++_0x3368c0);}(_0xeb13,0x197));var _0x3eb1=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xeb13[_0xa28b1a];return _0x4c9b78;};'use strict';var _=require(_0x3eb1('0x0'));var util=require(_0x3eb1('0x1'));var logger=require(_0x3eb1('0x2'))('api');var moment=require(_0x3eb1('0x3'));var BPromise=require(_0x3eb1('0x4'));var rp=require(_0x3eb1('0x5'));var fs=require('fs');var path=require(_0x3eb1('0x6'));var rimraf=require(_0x3eb1('0x7'));var config=require(_0x3eb1('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x3a8b3d,_0x5814f3){return _0x3a8b3d[_0x3eb1('0x9')](_0x3eb1('0xa'),attributes,{'tableName':_0x3eb1('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ed7=['exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x47b8a8,_0x5cc924){var _0x25347f=function(_0x515680){while(--_0x515680){_0x47b8a8['push'](_0x47b8a8['shift']());}};_0x25347f(++_0x5cc924);}(_0x4ed7,0xab));var _0x74ed=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x4ed7[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require(_0x74ed('0x0'));var util=require(_0x74ed('0x1'));var logger=require(_0x74ed('0x2'))(_0x74ed('0x3'));var moment=require(_0x74ed('0x4'));var BPromise=require(_0x74ed('0x5'));var rp=require(_0x74ed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74ed('0x7'));var config=require(_0x74ed('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x74ed('0x9')]=function(_0x3f8681,_0x703297){return _0x3f8681[_0x74ed('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x74ed('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 ab29f30..9908f9d 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 _0x784b=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x784b,0x171));var _0xb784=function(_0x2d443f,_0x526db0){_0x2d443f=_0x2d443f-0x0;var _0x26cdf6=_0x784b[_0x2d443f];return _0x26cdf6;};'use strict';var _=require(_0xb784('0x0'));var util=require(_0xb784('0x1'));var moment=require(_0xb784('0x2'));var BPromise=require(_0xb784('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb784('0x4'));var db=require(_0xb784('0x5'))['db'];var utils=require(_0xb784('0x6'));var logger=require(_0xb784('0x7'))(_0xb784('0x8'));var config=require(_0xb784('0x9'));var jayson=require(_0xb784('0xa'));var client=jayson[_0xb784('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x346a0e,_0x37b9a4,_0x364ad0){return new BPromise(function(_0x76b1ed,_0x61170b){return client[_0xb784('0xc')](_0x346a0e,_0x364ad0)[_0xb784('0xd')](function(_0x4ffc38){logger[_0xb784('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x37b9a4,_0xb784('0xf'));logger[_0xb784('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x37b9a4,_0xb784('0xf'),JSON[_0xb784('0x11')](_0x4ffc38));if(_0x4ffc38['error']){if(_0x4ffc38[_0xb784('0x12')][_0xb784('0x13')]===0x1f4){logger['error'](_0xb784('0x14'),_0x37b9a4,_0x4ffc38[_0xb784('0x12')]['message']);return _0x61170b(_0x4ffc38['error'][_0xb784('0x15')]);}logger[_0xb784('0x12')](_0xb784('0x14'),_0x37b9a4,_0x4ffc38['error']['message']);return _0x76b1ed(_0x4ffc38[_0xb784('0x12')]['message']);}else{logger[_0xb784('0xe')](_0xb784('0x14'),_0x37b9a4,_0xb784('0xf'));_0x76b1ed(_0x4ffc38[_0xb784('0x16')]['message']);}})['catch'](function(_0x581951){logger[_0xb784('0x12')](_0xb784('0x14'),_0x37b9a4,_0x581951);_0x61170b(_0x581951);});});} \ No newline at end of file +var _0x7f08=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1722d8,_0xa3b9fd){var _0x111fda=function(_0x4ff9d2){while(--_0x4ff9d2){_0x1722d8['push'](_0x1722d8['shift']());}};_0x111fda(++_0xa3b9fd);}(_0x7f08,0x1a3));var _0x87f0=function(_0x82684e,_0x5366af){_0x82684e=_0x82684e-0x0;var _0x7a753a=_0x7f08[_0x82684e];return _0x7a753a;};'use strict';var _=require(_0x87f0('0x0'));var util=require(_0x87f0('0x1'));var moment=require(_0x87f0('0x2'));var BPromise=require(_0x87f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87f0('0x4'));var db=require(_0x87f0('0x5'))['db'];var utils=require(_0x87f0('0x6'));var logger=require(_0x87f0('0x7'))(_0x87f0('0x8'));var config=require('../../config/environment');var jayson=require(_0x87f0('0x9'));var client=jayson[_0x87f0('0xa')][_0x87f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x359561,_0x1ffc46,_0xb31bb9){return new BPromise(function(_0x41b5cc,_0x380056){return client[_0x87f0('0xc')](_0x359561,_0xb31bb9)[_0x87f0('0xd')](function(_0x46c90f){logger[_0x87f0('0xe')](_0x87f0('0xf'),_0x1ffc46,'request\x20sent');logger[_0x87f0('0x10')](_0x87f0('0x11'),_0x1ffc46,_0x87f0('0x12'),JSON[_0x87f0('0x13')](_0x46c90f));if(_0x46c90f[_0x87f0('0x14')]){if(_0x46c90f[_0x87f0('0x14')][_0x87f0('0x15')]===0x1f4){logger[_0x87f0('0x14')](_0x87f0('0xf'),_0x1ffc46,_0x46c90f['error'][_0x87f0('0x16')]);return _0x380056(_0x46c90f[_0x87f0('0x14')]['message']);}logger[_0x87f0('0x14')](_0x87f0('0xf'),_0x1ffc46,_0x46c90f[_0x87f0('0x14')]['message']);return _0x41b5cc(_0x46c90f['error'][_0x87f0('0x16')]);}else{logger[_0x87f0('0xe')](_0x87f0('0xf'),_0x1ffc46,_0x87f0('0x12'));_0x41b5cc(_0x46c90f[_0x87f0('0x17')][_0x87f0('0x16')]);}})[_0x87f0('0x18')](function(_0x1e3328){logger[_0x87f0('0x14')](_0x87f0('0xf'),_0x1ffc46,_0x1e3328);_0x380056(_0x1e3328);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index eb2b46e..6b9a30d 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 _0x0cfb=['/:id/run','run','/:id/query','query','post','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x0cfb,0x162));var _0xb0cf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0cfb[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xb0cf('0x0'));var util=require('util');var path=require(_0xb0cf('0x1'));var timeout=require(_0xb0cf('0x2'));var express=require(_0xb0cf('0x3'));var router=express['Router']();var fs_extra=require(_0xb0cf('0x4'));var auth=require(_0xb0cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0cf('0x6'));var controller=require(_0xb0cf('0x7'));router[_0xb0cf('0x8')]('/',auth[_0xb0cf('0x9')](),controller['index']);router[_0xb0cf('0x8')](_0xb0cf('0xa'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0xb')]);router[_0xb0cf('0x8')](_0xb0cf('0xc'),auth['isAuthenticated'](),controller[_0xb0cf('0xd')]);router[_0xb0cf('0x8')](_0xb0cf('0xe'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0xf')]);router[_0xb0cf('0x8')](_0xb0cf('0x10'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0x11')]);router[_0xb0cf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb0cf('0x13')](_0xb0cf('0xa'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0x14')]);router[_0xb0cf('0x15')]('/:id',auth[_0xb0cf('0x9')](),controller['destroy']);module[_0xb0cf('0x16')]=router; \ No newline at end of file +var _0x52df=['put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','/:id/query','post'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x52df,0x11b));var _0xf52d=function(_0x165c2d,_0x461ec1){_0x165c2d=_0x165c2d-0x0;var _0x23f408=_0x52df[_0x165c2d];return _0x23f408;};'use strict';var multer=require('multer');var util=require(_0xf52d('0x0'));var path=require(_0xf52d('0x1'));var timeout=require(_0xf52d('0x2'));var express=require(_0xf52d('0x3'));var router=express[_0xf52d('0x4')]();var fs_extra=require(_0xf52d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf52d('0x6'));var controller=require(_0xf52d('0x7'));router[_0xf52d('0x8')]('/',auth['isAuthenticated'](),controller[_0xf52d('0x9')]);router[_0xf52d('0x8')](_0xf52d('0xa'),auth[_0xf52d('0xb')](),controller[_0xf52d('0xc')]);router['get']('/:id/preview',auth[_0xf52d('0xb')](),controller['preview']);router[_0xf52d('0x8')](_0xf52d('0xd'),auth[_0xf52d('0xb')](),controller[_0xf52d('0xe')]);router[_0xf52d('0x8')](_0xf52d('0xf'),auth[_0xf52d('0xb')](),controller['query']);router[_0xf52d('0x10')]('/',auth[_0xf52d('0xb')](),controller['create']);router[_0xf52d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf52d('0x12')]);router['delete']('/:id',auth[_0xf52d('0xb')](),controller[_0xf52d('0x13')]);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 8625591..c254174 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x380c5e,_0x4d2c7b){var _0x4baaa9=function(_0x2c1720){while(--_0x2c1720){_0x380c5e['push'](_0x380c5e['shift']());}};_0x4baaa9(++_0x4d2c7b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file +var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x4c1ed4,_0x49f774){var _0x6f5f52=function(_0x352266){while(--_0x352266){_0x4c1ed4['push'](_0x4c1ed4['shift']());}};_0x6f5f52(++_0x49f774);}(_0x814b,0x1a2));var _0xb814=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x814b[_0x145b3c];return _0x1b6e36;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b59da93..07e3acf 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3683d1,_0x14f861){var _0x1af47f=function(_0x57786b){while(--_0x57786b){_0x3683d1['push'](_0x3683d1['shift']());}};_0x1af47f(++_0x14f861);}(_0xf494,0x1c6));var _0x4f49=function(_0x452201,_0x151be2){_0x452201=_0x452201-0x0;var _0x552d57=_0xf494[_0x452201];return _0x552d57;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file +var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xabce[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c08012b..4cf27dc 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 _0x4226=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util','../../config/logger','api','request-promise'];(function(_0x9aa177,_0x79bee0){var _0x3071ba=function(_0x1f6b5e){while(--_0x1f6b5e){_0x9aa177['push'](_0x9aa177['shift']());}};_0x3071ba(++_0x79bee0);}(_0x4226,0x114));var _0x6422=function(_0x78f30d,_0x5679e1){_0x78f30d=_0x78f30d-0x0;var _0x5ad226=_0x4226[_0x78f30d];return _0x5ad226;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var logger=require(_0x6422('0x1'))(_0x6422('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6422('0x3'));var fs=require('fs');var path=require(_0x6422('0x4'));var rimraf=require(_0x6422('0x5'));var config=require('../../config/environment');var attributes=require(_0x6422('0x6'));module[_0x6422('0x7')]=function(_0x5bca5f,_0xca347b){return _0x5bca5f[_0x6422('0x8')](_0x6422('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ceb=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e8053,_0x1de5e3){var _0x38206f=function(_0x4cd635){while(--_0x4cd635){_0x4e8053['push'](_0x4e8053['shift']());}};_0x38206f(++_0x1de5e3);}(_0x2ceb,0xb0));var _0xb2ce=function(_0x6d2ed1,_0x1876b5){_0x6d2ed1=_0x6d2ed1-0x0;var _0x5977c5=_0x2ceb[_0x6d2ed1];return _0x5977c5;};'use strict';var _=require(_0xb2ce('0x0'));var util=require('util');var logger=require(_0xb2ce('0x1'))(_0xb2ce('0x2'));var moment=require(_0xb2ce('0x3'));var BPromise=require(_0xb2ce('0x4'));var rp=require(_0xb2ce('0x5'));var fs=require('fs');var path=require(_0xb2ce('0x6'));var rimraf=require(_0xb2ce('0x7'));var config=require(_0xb2ce('0x8'));var attributes=require(_0xb2ce('0x9'));module[_0xb2ce('0xa')]=function(_0x7b0d71,_0x266ab0){return _0x7b0d71[_0xb2ce('0xb')](_0xb2ce('0xc'),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 46598e4..6d2f432 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 _0x1efa=['error','code','message','request\x20sent','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f14ca,_0x74d66a){var _0x5497de=function(_0x436ac9){while(--_0x436ac9){_0x5f14ca['push'](_0x5f14ca['shift']());}};_0x5497de(++_0x74d66a);}(_0x1efa,0x145));var _0xa1ef=function(_0x1e3aaf,_0x361e79){_0x1e3aaf=_0x1e3aaf-0x0;var _0x1f63c6=_0x1efa[_0x1e3aaf];return _0x1f63c6;};'use strict';var _=require(_0xa1ef('0x0'));var util=require(_0xa1ef('0x1'));var moment=require(_0xa1ef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ef('0x3'))['db'];var utils=require(_0xa1ef('0x4'));var logger=require('../../config/logger')(_0xa1ef('0x5'));var config=require(_0xa1ef('0x6'));var jayson=require(_0xa1ef('0x7'));var client=jayson['client'][_0xa1ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4872db,_0x12e088,_0x241d6f){return new BPromise(function(_0x1a25da,_0x3685aa){return client[_0xa1ef('0x9')](_0x4872db,_0x241d6f)['then'](function(_0x3a46d2){logger[_0xa1ef('0xa')](_0xa1ef('0xb'),_0x12e088,'request\x20sent');logger[_0xa1ef('0xc')](_0xa1ef('0xd'),_0x12e088,'request\x20sent',JSON[_0xa1ef('0xe')](_0x3a46d2));if(_0x3a46d2[_0xa1ef('0xf')]){if(_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x10')]===0x1f4){logger[_0xa1ef('0xf')](_0xa1ef('0xb'),_0x12e088,_0x3a46d2[_0xa1ef('0xf')]['message']);return _0x3685aa(_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x11')]);}logger[_0xa1ef('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12e088,_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x11')]);return _0x1a25da(_0x3a46d2[_0xa1ef('0xf')]['message']);}else{logger[_0xa1ef('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12e088,_0xa1ef('0x12'));_0x1a25da(_0x3a46d2[_0xa1ef('0x13')][_0xa1ef('0x11')]);}})['catch'](function(_0x114560){logger[_0xa1ef('0xf')](_0xa1ef('0xb'),_0x12e088,_0x114560);_0x3685aa(_0x114560);});});} \ No newline at end of file +var _0xdf76=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdf76,0x81));var _0x6df7=function(_0x4744b1,_0x1f53ed){_0x4744b1=_0x4744b1-0x0;var _0xa1e07=_0xdf76[_0x4744b1];return _0xa1e07;};'use strict';var _=require('lodash');var util=require(_0x6df7('0x0'));var moment=require(_0x6df7('0x1'));var BPromise=require(_0x6df7('0x2'));var rs=require(_0x6df7('0x3'));var fs=require('fs');var Redis=require(_0x6df7('0x4'));var db=require(_0x6df7('0x5'))['db'];var utils=require(_0x6df7('0x6'));var logger=require(_0x6df7('0x7'))(_0x6df7('0x8'));var config=require(_0x6df7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x890d15,_0x198a2f,_0x306a2b){return new BPromise(function(_0x35f6eb,_0x50347a){return client[_0x6df7('0xa')](_0x890d15,_0x306a2b)[_0x6df7('0xb')](function(_0x1e0c27){logger[_0x6df7('0xc')](_0x6df7('0xd'),_0x198a2f,_0x6df7('0xe'));logger['debug'](_0x6df7('0xf'),_0x198a2f,_0x6df7('0xe'),JSON['stringify'](_0x1e0c27));if(_0x1e0c27[_0x6df7('0x10')]){if(_0x1e0c27['error'][_0x6df7('0x11')]===0x1f4){logger['error'](_0x6df7('0xd'),_0x198a2f,_0x1e0c27[_0x6df7('0x10')]['message']);return _0x50347a(_0x1e0c27[_0x6df7('0x10')]['message']);}logger['error'](_0x6df7('0xd'),_0x198a2f,_0x1e0c27[_0x6df7('0x10')][_0x6df7('0x12')]);return _0x35f6eb(_0x1e0c27[_0x6df7('0x10')]['message']);}else{logger[_0x6df7('0xc')](_0x6df7('0xd'),_0x198a2f,_0x6df7('0xe'));_0x35f6eb(_0x1e0c27[_0x6df7('0x13')][_0x6df7('0x12')]);}})[_0x6df7('0x14')](function(_0x57aa4a){logger['error'](_0x6df7('0xd'),_0x198a2f,_0x57aa4a);_0x50347a(_0x57aa4a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e2c2196..2a33e9d 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 _0xf7ec=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','delete','destroy','exports'];(function(_0x3165cf,_0x552f9c){var _0x18455a=function(_0x59efeb){while(--_0x59efeb){_0x3165cf['push'](_0x3165cf['shift']());}};_0x18455a(++_0x552f9c);}(_0xf7ec,0x1cc));var _0xcf7e=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xf7ec[_0x47a12a];return _0x30cd40;};'use strict';var multer=require('multer');var util=require(_0xcf7e('0x0'));var path=require(_0xcf7e('0x1'));var timeout=require('connect-timeout');var express=require(_0xcf7e('0x2'));var router=express[_0xcf7e('0x3')]();var fs_extra=require(_0xcf7e('0x4'));var auth=require(_0xcf7e('0x5'));var interaction=require(_0xcf7e('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xcf7e('0x7')]('/',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x9')]);router[_0xcf7e('0x7')](_0xcf7e('0xa'),auth['isAuthenticated'](),controller[_0xcf7e('0xb')]);router['get'](_0xcf7e('0xc'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0xd')]);router[_0xcf7e('0x7')]('/:id/run',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0xe')]);router[_0xcf7e('0x7')](_0xcf7e('0xf'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x10')]);router[_0xcf7e('0x11')]('/',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x12')]);router[_0xcf7e('0x13')]('/:id',auth[_0xcf7e('0x8')](),controller['update']);router[_0xcf7e('0x14')](_0xcf7e('0xa'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x15')]);module[_0xcf7e('0x16')]=router; \ No newline at end of file +var _0xb6a1=['show','/:id/preview','preview','run','/:id/query','query','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2d6374,_0x809eb2){var _0x2c6eab=function(_0x529ee5){while(--_0x529ee5){_0x2d6374['push'](_0x2d6374['shift']());}};_0x2c6eab(++_0x809eb2);}(_0xb6a1,0x14d));var _0x1b6a=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb6a1[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var path=require(_0x1b6a('0x2'));var timeout=require(_0x1b6a('0x3'));var express=require('express');var router=express[_0x1b6a('0x4')]();var fs_extra=require(_0x1b6a('0x5'));var auth=require(_0x1b6a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6a('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x1b6a('0x8')]('/',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0xa')]);router['get'](_0x1b6a('0xb'),auth['isAuthenticated'](),controller[_0x1b6a('0xc')]);router[_0x1b6a('0x8')](_0x1b6a('0xd'),auth['isAuthenticated'](),controller[_0x1b6a('0xe')]);router[_0x1b6a('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x1b6a('0xf')]);router['get'](_0x1b6a('0x10'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x11')]);router['post']('/',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x12')]);router[_0x1b6a('0x13')](_0x1b6a('0xb'),auth[_0x1b6a('0x9')](),controller['update']);router[_0x1b6a('0x14')](_0x1b6a('0xb'),auth['isAuthenticated'](),controller[_0x1b6a('0x15')]);module[_0x1b6a('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index edd2349..52b0411 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 _0x0e21=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports'];(function(_0x393013,_0x4b40c6){var _0x3baf20=function(_0x5c45dc){while(--_0x5c45dc){_0x393013['push'](_0x393013['shift']());}};_0x3baf20(++_0x4b40c6);}(_0x0e21,0x16a));var _0x10e2=function(_0x5ebcaa,_0x639130){_0x5ebcaa=_0x5ebcaa-0x0;var _0x280fb9=_0x0e21[_0x5ebcaa];return _0x280fb9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x10e2('0x0'));module[_0x10e2('0x1')]={'name':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x10e2('0x3')](_0x10e2('0x4'),_0x10e2('0x5'),_0x10e2('0x6')),'allowNull':![],'defaultValue':_0x10e2('0x4')},'savename':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x10e2('0x7')]},'status':{'type':Sequelize[_0x10e2('0x2')],'defaultValue':_0x10e2('0x8')},'type':{'type':Sequelize['ENUM'](_0x10e2('0x9'),_0x10e2('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x10e2('0xb')](0xb)[_0x10e2('0xc')]},'reportType':{'type':Sequelize[_0x10e2('0x2')]}}; \ No newline at end of file +var _0x271e=['csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x28e503,_0x32f985){var _0x196ee=function(_0x1dba84){while(--_0x1dba84){_0x28e503['push'](_0x28e503['shift']());}};_0x196ee(++_0x32f985);}(_0x271e,0x1ca));var _0xe271=function(_0x1a0421,_0x408b09){_0x1a0421=_0x1a0421-0x0;var _0x325eed=_0x271e[_0x1a0421];return _0x325eed;};'use strict';var Sequelize=require(_0xe271('0x0'));var moment=require(_0xe271('0x1'));module[_0xe271('0x2')]={'name':{'type':Sequelize[_0xe271('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xe271('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe271('0x4'),_0xe271('0x5'),_0xe271('0x6')),'allowNull':![],'defaultValue':_0xe271('0x4')},'savename':{'type':Sequelize[_0xe271('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe271('0x7')]},'endDate':{'type':Sequelize[_0xe271('0x7')]},'status':{'type':Sequelize[_0xe271('0x3')],'defaultValue':_0xe271('0x8')},'type':{'type':Sequelize[_0xe271('0x9')](_0xe271('0xa'),_0xe271('0xb')),'allowNull':![],'defaultValue':_0xe271('0xa')},'reportId':{'type':Sequelize[_0xe271('0xc')](0xb)[_0xe271('0xd')]},'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 ba360bf..ac0b9ba 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 _0xd55c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','error','name','index','AnalyticExtractedReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','server/files/reports','Sequelize','ValidationError','exists','join','root','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x24c89b,_0x349631){var _0x5caf2e=function(_0x5b4ae9){while(--_0x5b4ae9){_0x24c89b['push'](_0x24c89b['shift']());}};_0x5caf2e(++_0x349631);}(_0xd55c,0x11d));var _0xcd55=function(_0x1c47ad,_0x30085b){_0x1c47ad=_0x1c47ad-0x0;var _0x288777=_0xd55c[_0x1c47ad];return _0x288777;};'use strict';var emlformat=require(_0xcd55('0x0'));var rimraf=require(_0xcd55('0x1'));var zipdir=require(_0xcd55('0x2'));var jsonpatch=require(_0xcd55('0x3'));var rp=require(_0xcd55('0x4'));var moment=require(_0xcd55('0x5'));var BPromise=require(_0xcd55('0x6'));var Mustache=require(_0xcd55('0x7'));var util=require(_0xcd55('0x8'));var path=require(_0xcd55('0x9'));var sox=require('sox');var csv=require(_0xcd55('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd55('0xb'));var _=require(_0xcd55('0xc'));var squel=require(_0xcd55('0xd'));var crypto=require(_0xcd55('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcd55('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcd55('0x10'));var Papa=require(_0xcd55('0x11'));var Redis=require(_0xcd55('0x12'));var authService=require(_0xcd55('0x13'));var qs=require(_0xcd55('0x14'));var as=require(_0xcd55('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd55('0x16'))(_0xcd55('0x17'));var utils=require('../../config/utils');var config=require(_0xcd55('0x18'));var licenseUtil=require(_0xcd55('0x19'));var db=require(_0xcd55('0x1a'))['db'];function respondWithStatusCode(_0x523362,_0x6bc3b3){_0x6bc3b3=_0x6bc3b3||0xcc;return function(_0x509211){if(_0x509211){return _0x523362[_0xcd55('0x1b')](_0x6bc3b3);}return _0x523362['status'](_0x6bc3b3)[_0xcd55('0x1c')]();};}function respondWithResult(_0x202d49,_0xab2180){_0xab2180=_0xab2180||0xc8;return function(_0x539500){if(_0x539500){return _0x202d49[_0xcd55('0x1d')](_0xab2180)[_0xcd55('0x1e')](_0x539500);}};}function respondWithFilteredResult(_0x1be967,_0x29a12e){return function(_0x581df6){if(_0x581df6){var _0x252976=typeof _0x29a12e[_0xcd55('0x1f')]===_0xcd55('0x20')&&typeof _0x29a12e['limit']===_0xcd55('0x20');var _0x8b1370=_0x581df6[_0xcd55('0x21')];var _0x20d4fb=_0x252976?0x0:_0x29a12e[_0xcd55('0x1f')];var _0x3ca7e8=_0x252976?_0x581df6[_0xcd55('0x21')]:_0x29a12e[_0xcd55('0x1f')]+_0x29a12e[_0xcd55('0x22')];var _0x299632;if(_0x3ca7e8>=_0x8b1370){_0x3ca7e8=_0x8b1370;_0x299632=0xc8;}else{_0x299632=0xce;}_0x1be967[_0xcd55('0x1d')](_0x299632);return _0x1be967[_0xcd55('0x23')](_0xcd55('0x24'),_0x20d4fb+'-'+_0x3ca7e8+'/'+_0x8b1370)[_0xcd55('0x1e')](_0x581df6);}return null;};}function patchUpdates(_0x13ab91){return function(_0x46ec4b){try{jsonpatch[_0xcd55('0x25')](_0x46ec4b,_0x13ab91,!![]);}catch(_0x463e3c){return BPromise[_0xcd55('0x26')](_0x463e3c);}return _0x46ec4b[_0xcd55('0x27')]();};}function saveUpdates(_0x2b1a5b,_0x3777d2){return function(_0xe7c1d0){if(_0xe7c1d0){return _0xe7c1d0[_0xcd55('0x28')](_0x2b1a5b)[_0xcd55('0x29')](function(_0xd57442){return _0xd57442;});}return null;};}function removeEntity(_0x3d237f,_0x3188d5){return function(_0x4267c1){if(_0x4267c1){return _0x4267c1['destroy']()[_0xcd55('0x29')](function(){var _0x23929d=_0x4267c1[_0xcd55('0x2a')]({'plain':!![]});var _0x5b1fff=_0xcd55('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b1fff,'resourceId':_0x23929d['id']}})[_0xcd55('0x29')](function(){return _0x4267c1;});})[_0xcd55('0x29')](function(){_0x3d237f['status'](0xcc)[_0xcd55('0x1c')]();});}};}function handleEntityNotFound(_0x2e24ed,_0x286bf6){return function(_0x4fa723){if(!_0x4fa723){_0x2e24ed[_0xcd55('0x1b')](0x194);}return _0x4fa723;};}function handleError(_0x3f119a,_0x826c06){_0x826c06=_0x826c06||0x1f4;return function(_0x16047b){logger[_0xcd55('0x2c')](_0x16047b['stack']);if(_0x16047b['name']){delete _0x16047b[_0xcd55('0x2d')];}_0x3f119a['status'](_0x826c06)['send'](_0x16047b);};}exports[_0xcd55('0x2e')]=function(_0x49c701,_0x5bfe50){var _0x5922f2={},_0x3dc377={},_0x41d4bc={'count':0x0,'rows':[]};var _0x568b92=_['map'](db[_0xcd55('0x2f')]['rawAttributes'],function(_0x2ff94b){return{'name':_0x2ff94b[_0xcd55('0x30')],'type':_0x2ff94b['type'][_0xcd55('0x31')]};});_0x3dc377[_0xcd55('0x32')]=_['map'](_0x568b92,_0xcd55('0x2d'));_0x3dc377[_0xcd55('0x33')]=_['keys'](_0x49c701['query']);_0x3dc377[_0xcd55('0x34')]=_[_0xcd55('0x35')](_0x3dc377[_0xcd55('0x32')],_0x3dc377[_0xcd55('0x33')]);_0x5922f2[_0xcd55('0x36')]=_[_0xcd55('0x35')](_0x3dc377[_0xcd55('0x32')],qs[_0xcd55('0x37')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x37')]));_0x5922f2[_0xcd55('0x36')]=_0x5922f2['attributes'][_0xcd55('0x38')]?_0x5922f2[_0xcd55('0x36')]:_0x3dc377['model'];if(!_0x49c701['query'][_0xcd55('0x39')](_0xcd55('0x3a'))){_0x5922f2[_0xcd55('0x22')]=qs[_0xcd55('0x22')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x22')]);_0x5922f2[_0xcd55('0x1f')]=qs[_0xcd55('0x1f')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x1f')]);}_0x5922f2[_0xcd55('0x3b')]=qs[_0xcd55('0x3c')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x3c')]);_0x5922f2[_0xcd55('0x3d')]=qs['filters'](_[_0xcd55('0x3e')](_0x49c701[_0xcd55('0x33')],_0x3dc377['filters']),_0x568b92);if(_0x49c701[_0xcd55('0x33')][_0xcd55('0x3f')]){_0x5922f2['where']=_[_0xcd55('0x40')](_0x5922f2[_0xcd55('0x3d')],{'$or':_[_0xcd55('0x41')](_0x568b92,function(_0x31a361){if(_0x31a361[_0xcd55('0x42')]!==_0xcd55('0x43')){var _0x44ad44={};_0x44ad44[_0x31a361[_0xcd55('0x2d')]]={'$like':'%'+_0x49c701['query'][_0xcd55('0x3f')]+'%'};return _0x44ad44;}})});}_0x5922f2=_['merge']({},_0x5922f2,_0x49c701[_0xcd55('0x44')]);var _0x348fce={'where':_0x5922f2[_0xcd55('0x3d')]};return db[_0xcd55('0x2f')][_0xcd55('0x21')](_0x348fce)[_0xcd55('0x29')](function(_0x4ab128){_0x41d4bc[_0xcd55('0x21')]=_0x4ab128;if(_0x49c701[_0xcd55('0x33')]['includeAll']){_0x5922f2[_0xcd55('0x45')]=[{'all':!![]}];}return db[_0xcd55('0x2f')][_0xcd55('0x46')](_0x5922f2);})[_0xcd55('0x29')](function(_0x1ddb84){_0x41d4bc[_0xcd55('0x47')]=_0x1ddb84;return _0x41d4bc;})['then'](respondWithFilteredResult(_0x5bfe50,_0x5922f2))[_0xcd55('0x48')](handleError(_0x5bfe50,null));};exports[_0xcd55('0x49')]=function(_0x9dab47,_0x3fb47c){var _0x4152c3={'raw':!![],'where':{'id':_0x9dab47[_0xcd55('0x4a')]['id']}},_0x1bab0e={};_0x1bab0e[_0xcd55('0x32')]=_[_0xcd55('0x4b')](db[_0xcd55('0x2f')]['rawAttributes']);_0x1bab0e[_0xcd55('0x33')]=_[_0xcd55('0x4b')](_0x9dab47[_0xcd55('0x33')]);_0x1bab0e[_0xcd55('0x34')]=_[_0xcd55('0x35')](_0x1bab0e[_0xcd55('0x32')],_0x1bab0e[_0xcd55('0x33')]);_0x4152c3[_0xcd55('0x36')]=_['intersection'](_0x1bab0e[_0xcd55('0x32')],qs[_0xcd55('0x37')](_0x9dab47[_0xcd55('0x33')][_0xcd55('0x37')]));_0x4152c3['attributes']=_0x4152c3[_0xcd55('0x36')][_0xcd55('0x38')]?_0x4152c3[_0xcd55('0x36')]:_0x1bab0e[_0xcd55('0x32')];if(_0x9dab47[_0xcd55('0x33')]['includeAll']){_0x4152c3[_0xcd55('0x45')]=[{'all':!![]}];}_0x4152c3=_[_0xcd55('0x40')]({},_0x4152c3,_0x9dab47[_0xcd55('0x44')]);return db[_0xcd55('0x2f')]['find'](_0x4152c3)[_0xcd55('0x29')](handleEntityNotFound(_0x3fb47c,null))[_0xcd55('0x29')](respondWithResult(_0x3fb47c,null))[_0xcd55('0x48')](handleError(_0x3fb47c,null));};exports[_0xcd55('0x4c')]=function(_0x54a95b,_0x118d0e){return db[_0xcd55('0x2f')][_0xcd55('0x4c')](_0x54a95b[_0xcd55('0x4d')],{})[_0xcd55('0x29')](function(_0x953632){var _0xdbd1e5=_0x54a95b[_0xcd55('0x4e')][_0xcd55('0x2a')]({'plain':!![]});if(!_0xdbd1e5)throw new Error(_0xcd55('0x4f'));if(_0xdbd1e5[_0xcd55('0x50')]===_0xcd55('0x4e')){var _0x34695d=_0x953632[_0xcd55('0x2a')]({'plain':!![]});var _0x143b4a=_0xcd55('0x2b');return db[_0xcd55('0x51')][_0xcd55('0x52')]({'where':{'name':_0x143b4a,'userProfileId':_0xdbd1e5['userProfileId']},'raw':!![]})[_0xcd55('0x29')](function(_0x46f4e6){if(_0x46f4e6&&_0x46f4e6[_0xcd55('0x53')]===0x0){return db[_0xcd55('0x54')]['create']({'name':_0x34695d[_0xcd55('0x2d')],'resourceId':_0x34695d['id'],'type':_0x46f4e6[_0xcd55('0x2d')],'sectionId':_0x46f4e6['id']},{})[_0xcd55('0x29')](function(){return _0x953632;});}else{return _0x953632;}})[_0xcd55('0x48')](function(_0xfc7e39){logger['error'](_0xcd55('0x55'),_0xfc7e39);throw _0xfc7e39;});}return _0x953632;})['then'](respondWithResult(_0x118d0e,0xc9))[_0xcd55('0x48')](handleError(_0x118d0e,null));};exports[_0xcd55('0x28')]=function(_0x247f21,_0x5800c8){if(_0x247f21['body']['id']){delete _0x247f21[_0xcd55('0x4d')]['id'];}return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x247f21['params']['id']}})[_0xcd55('0x29')](handleEntityNotFound(_0x5800c8,null))[_0xcd55('0x29')](saveUpdates(_0x247f21[_0xcd55('0x4d')],null))[_0xcd55('0x29')](respondWithResult(_0x5800c8,null))['catch'](handleError(_0x5800c8,null));};exports['destroy']=function(_0x2680aa,_0x31e40e){return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x2680aa[_0xcd55('0x4a')]['id']}})[_0xcd55('0x29')](handleEntityNotFound(_0x31e40e,null))[_0xcd55('0x29')](removeEntity(_0x31e40e,null))['catch'](handleError(_0x31e40e,null));};exports[_0xcd55('0x56')]=function(_0x2b654f,_0x62a445,_0x4e0f6b){return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x2b654f[_0xcd55('0x4a')]['id']},'attributes':[_0xcd55('0x2d'),_0xcd55('0x57'),'savename',_0xcd55('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x62a445,null))['then'](function(_0x6db47b){if(_0x6db47b){if(!fs['existsSync'](path['join'](config['root'],_0xcd55('0x59'),_0x6db47b['savename']))){throw new db[(_0xcd55('0x5a'))][(_0xcd55('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2b654f[_0xcd55('0x33')][_0xcd55('0x5c')]){return _0x62a445[_0xcd55('0x1b')](0xc8);}return _0x62a445['download'](path[_0xcd55('0x5d')](config[_0xcd55('0x5e')],_0xcd55('0x59'),_0x6db47b['savename']),util['format']('%s.%s',_0x6db47b['basename']||_0x6db47b[_0xcd55('0x2d')],_0x6db47b[_0xcd55('0x58')][_0xcd55('0x5f')]()));}})[_0xcd55('0x48')](handleError(_0x62a445,null));}; \ No newline at end of file +var _0x3f02=['Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','download','basename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','savename','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set'];(function(_0x4a916a,_0x47c2be){var _0xe976a7=function(_0x1d215a){while(--_0x1d215a){_0x4a916a['push'](_0x4a916a['shift']());}};_0xe976a7(++_0x47c2be);}(_0x3f02,0xfd));var _0x23f0=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3f02[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0x23f0('0x0'));var rimraf=require(_0x23f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23f0('0x2'));var rp=require(_0x23f0('0x3'));var moment=require(_0x23f0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x23f0('0x5'));var util=require(_0x23f0('0x6'));var path=require(_0x23f0('0x7'));var sox=require(_0x23f0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23f0('0x9'));var _=require('lodash');var squel=require(_0x23f0('0xa'));var crypto=require(_0x23f0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23f0('0xc'));var querystring=require('querystring');var Papa=require(_0x23f0('0xd'));var Redis=require('ioredis');var authService=require(_0x23f0('0xe'));var qs=require(_0x23f0('0xf'));var as=require(_0x23f0('0x10'));var hardwareService=require(_0x23f0('0x11'));var logger=require('../../config/logger')(_0x23f0('0x12'));var utils=require(_0x23f0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x23f0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28503b,_0x4ecde1){_0x4ecde1=_0x4ecde1||0xcc;return function(_0x3711a6){if(_0x3711a6){return _0x28503b[_0x23f0('0x15')](_0x4ecde1);}return _0x28503b['status'](_0x4ecde1)['end']();};}function respondWithResult(_0x9783d8,_0x334dbf){_0x334dbf=_0x334dbf||0xc8;return function(_0x2f4a9b){if(_0x2f4a9b){return _0x9783d8[_0x23f0('0x16')](_0x334dbf)[_0x23f0('0x17')](_0x2f4a9b);}};}function respondWithFilteredResult(_0x42720d,_0x2d0d6e){return function(_0x88fcad){if(_0x88fcad){var _0x43be07=typeof _0x2d0d6e[_0x23f0('0x18')]==='undefined'&&typeof _0x2d0d6e[_0x23f0('0x19')]===_0x23f0('0x1a');var _0x4af8df=_0x88fcad[_0x23f0('0x1b')];var _0x5beac1=_0x43be07?0x0:_0x2d0d6e[_0x23f0('0x18')];var _0x273528=_0x43be07?_0x88fcad[_0x23f0('0x1b')]:_0x2d0d6e[_0x23f0('0x18')]+_0x2d0d6e[_0x23f0('0x19')];var _0x48feba;if(_0x273528>=_0x4af8df){_0x273528=_0x4af8df;_0x48feba=0xc8;}else{_0x48feba=0xce;}_0x42720d[_0x23f0('0x16')](_0x48feba);return _0x42720d[_0x23f0('0x1c')](_0x23f0('0x1d'),_0x5beac1+'-'+_0x273528+'/'+_0x4af8df)['json'](_0x88fcad);}return null;};}function patchUpdates(_0x4f2fc3){return function(_0x4c61fe){try{jsonpatch[_0x23f0('0x1e')](_0x4c61fe,_0x4f2fc3,!![]);}catch(_0x28c486){return BPromise[_0x23f0('0x1f')](_0x28c486);}return _0x4c61fe[_0x23f0('0x20')]();};}function saveUpdates(_0x8d0fdb,_0x5b4010){return function(_0x40741d){if(_0x40741d){return _0x40741d[_0x23f0('0x21')](_0x8d0fdb)[_0x23f0('0x22')](function(_0x4cb003){return _0x4cb003;});}return null;};}function removeEntity(_0xd14e89,_0x2a587b){return function(_0x206cd9){if(_0x206cd9){return _0x206cd9[_0x23f0('0x23')]()[_0x23f0('0x22')](function(){var _0x40fb14=_0x206cd9[_0x23f0('0x24')]({'plain':!![]});var _0x2ce797=_0x23f0('0x25');return db[_0x23f0('0x26')]['destroy']({'where':{'type':_0x2ce797,'resourceId':_0x40fb14['id']}})['then'](function(){return _0x206cd9;});})[_0x23f0('0x22')](function(){_0xd14e89[_0x23f0('0x16')](0xcc)[_0x23f0('0x27')]();});}};}function handleEntityNotFound(_0x35d22f,_0x5bcdfc){return function(_0x2a3bd2){if(!_0x2a3bd2){_0x35d22f[_0x23f0('0x15')](0x194);}return _0x2a3bd2;};}function handleError(_0x3b98b2,_0x59c756){_0x59c756=_0x59c756||0x1f4;return function(_0xcccb5a){logger[_0x23f0('0x28')](_0xcccb5a['stack']);if(_0xcccb5a[_0x23f0('0x29')]){delete _0xcccb5a[_0x23f0('0x29')];}_0x3b98b2['status'](_0x59c756)[_0x23f0('0x2a')](_0xcccb5a);};}exports[_0x23f0('0x2b')]=function(_0x378cc1,_0x16d481){var _0xd3a150={},_0x3b1d17={},_0x4158e1={'count':0x0,'rows':[]};var _0xb53e1=_[_0x23f0('0x2c')](db[_0x23f0('0x2d')][_0x23f0('0x2e')],function(_0x29b544){return{'name':_0x29b544[_0x23f0('0x2f')],'type':_0x29b544[_0x23f0('0x30')]['key']};});_0x3b1d17[_0x23f0('0x31')]=_[_0x23f0('0x2c')](_0xb53e1,_0x23f0('0x29'));_0x3b1d17[_0x23f0('0x32')]=_[_0x23f0('0x33')](_0x378cc1[_0x23f0('0x32')]);_0x3b1d17[_0x23f0('0x34')]=_[_0x23f0('0x35')](_0x3b1d17[_0x23f0('0x31')],_0x3b1d17['query']);_0xd3a150['attributes']=_['intersection'](_0x3b1d17[_0x23f0('0x31')],qs[_0x23f0('0x36')](_0x378cc1[_0x23f0('0x32')][_0x23f0('0x36')]));_0xd3a150[_0x23f0('0x37')]=_0xd3a150[_0x23f0('0x37')][_0x23f0('0x38')]?_0xd3a150[_0x23f0('0x37')]:_0x3b1d17[_0x23f0('0x31')];if(!_0x378cc1[_0x23f0('0x32')][_0x23f0('0x39')](_0x23f0('0x3a'))){_0xd3a150[_0x23f0('0x19')]=qs[_0x23f0('0x19')](_0x378cc1[_0x23f0('0x32')][_0x23f0('0x19')]);_0xd3a150[_0x23f0('0x18')]=qs['offset'](_0x378cc1['query']['offset']);}_0xd3a150[_0x23f0('0x3b')]=qs[_0x23f0('0x3c')](_0x378cc1[_0x23f0('0x32')][_0x23f0('0x3c')]);_0xd3a150[_0x23f0('0x3d')]=qs[_0x23f0('0x34')](_[_0x23f0('0x3e')](_0x378cc1['query'],_0x3b1d17[_0x23f0('0x34')]),_0xb53e1);if(_0x378cc1[_0x23f0('0x32')][_0x23f0('0x3f')]){_0xd3a150['where']=_[_0x23f0('0x40')](_0xd3a150[_0x23f0('0x3d')],{'$or':_[_0x23f0('0x2c')](_0xb53e1,function(_0x209878){if(_0x209878[_0x23f0('0x30')]!==_0x23f0('0x41')){var _0x1136a4={};_0x1136a4[_0x209878[_0x23f0('0x29')]]={'$like':'%'+_0x378cc1[_0x23f0('0x32')][_0x23f0('0x3f')]+'%'};return _0x1136a4;}})});}_0xd3a150=_['merge']({},_0xd3a150,_0x378cc1[_0x23f0('0x42')]);var _0x2ad171={'where':_0xd3a150[_0x23f0('0x3d')]};return db[_0x23f0('0x2d')]['count'](_0x2ad171)['then'](function(_0xaeb28c){_0x4158e1[_0x23f0('0x1b')]=_0xaeb28c;if(_0x378cc1[_0x23f0('0x32')][_0x23f0('0x43')]){_0xd3a150['include']=[{'all':!![]}];}return db[_0x23f0('0x2d')][_0x23f0('0x44')](_0xd3a150);})['then'](function(_0x5a2c1b){_0x4158e1[_0x23f0('0x45')]=_0x5a2c1b;return _0x4158e1;})[_0x23f0('0x22')](respondWithFilteredResult(_0x16d481,_0xd3a150))[_0x23f0('0x46')](handleError(_0x16d481,null));};exports[_0x23f0('0x47')]=function(_0x57d006,_0x27bcca){var _0x4d9736={'raw':!![],'where':{'id':_0x57d006[_0x23f0('0x48')]['id']}},_0x4aa4e3={};_0x4aa4e3[_0x23f0('0x31')]=_[_0x23f0('0x33')](db[_0x23f0('0x2d')][_0x23f0('0x2e')]);_0x4aa4e3[_0x23f0('0x32')]=_[_0x23f0('0x33')](_0x57d006['query']);_0x4aa4e3['filters']=_[_0x23f0('0x35')](_0x4aa4e3[_0x23f0('0x31')],_0x4aa4e3[_0x23f0('0x32')]);_0x4d9736[_0x23f0('0x37')]=_[_0x23f0('0x35')](_0x4aa4e3['model'],qs[_0x23f0('0x36')](_0x57d006['query'][_0x23f0('0x36')]));_0x4d9736[_0x23f0('0x37')]=_0x4d9736['attributes'][_0x23f0('0x38')]?_0x4d9736[_0x23f0('0x37')]:_0x4aa4e3[_0x23f0('0x31')];if(_0x57d006['query']['includeAll']){_0x4d9736[_0x23f0('0x49')]=[{'all':!![]}];}_0x4d9736=_[_0x23f0('0x40')]({},_0x4d9736,_0x57d006[_0x23f0('0x42')]);return db[_0x23f0('0x2d')][_0x23f0('0x4a')](_0x4d9736)[_0x23f0('0x22')](handleEntityNotFound(_0x27bcca,null))[_0x23f0('0x22')](respondWithResult(_0x27bcca,null))[_0x23f0('0x46')](handleError(_0x27bcca,null));};exports[_0x23f0('0x4b')]=function(_0x5b08e2,_0x24a567){return db['AnalyticExtractedReport']['create'](_0x5b08e2[_0x23f0('0x4c')],{})[_0x23f0('0x22')](function(_0x51b794){var _0x1b296a=_0x5b08e2[_0x23f0('0x4d')]['get']({'plain':!![]});if(!_0x1b296a)throw new Error(_0x23f0('0x4e'));if(_0x1b296a[_0x23f0('0x4f')]===_0x23f0('0x4d')){var _0x4f600e=_0x51b794[_0x23f0('0x24')]({'plain':!![]});var _0x4af873=_0x23f0('0x25');return db[_0x23f0('0x50')][_0x23f0('0x4a')]({'where':{'name':_0x4af873,'userProfileId':_0x1b296a['userProfileId']},'raw':!![]})[_0x23f0('0x22')](function(_0x13dcf7){if(_0x13dcf7&&_0x13dcf7[_0x23f0('0x51')]===0x0){return db[_0x23f0('0x26')][_0x23f0('0x4b')]({'name':_0x4f600e['name'],'resourceId':_0x4f600e['id'],'type':_0x13dcf7['name'],'sectionId':_0x13dcf7['id']},{})['then'](function(){return _0x51b794;});}else{return _0x51b794;}})[_0x23f0('0x46')](function(_0x5d10b2){logger[_0x23f0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d10b2);throw _0x5d10b2;});}return _0x51b794;})[_0x23f0('0x22')](respondWithResult(_0x24a567,0xc9))[_0x23f0('0x46')](handleError(_0x24a567,null));};exports[_0x23f0('0x21')]=function(_0x1c5850,_0x1b8b46){if(_0x1c5850['body']['id']){delete _0x1c5850[_0x23f0('0x4c')]['id'];}return db[_0x23f0('0x2d')][_0x23f0('0x4a')]({'where':{'id':_0x1c5850['params']['id']}})[_0x23f0('0x22')](handleEntityNotFound(_0x1b8b46,null))[_0x23f0('0x22')](saveUpdates(_0x1c5850[_0x23f0('0x4c')],null))[_0x23f0('0x22')](respondWithResult(_0x1b8b46,null))['catch'](handleError(_0x1b8b46,null));};exports[_0x23f0('0x23')]=function(_0x4c37f8,_0x171a6b){return db['AnalyticExtractedReport'][_0x23f0('0x4a')]({'where':{'id':_0x4c37f8[_0x23f0('0x48')]['id']}})[_0x23f0('0x22')](handleEntityNotFound(_0x171a6b,null))[_0x23f0('0x22')](removeEntity(_0x171a6b,null))[_0x23f0('0x46')](handleError(_0x171a6b,null));};exports[_0x23f0('0x52')]=function(_0x5f4519,_0x13dd30,_0x2338db){return db[_0x23f0('0x2d')][_0x23f0('0x4a')]({'where':{'id':_0x5f4519[_0x23f0('0x48')]['id']},'attributes':[_0x23f0('0x29'),_0x23f0('0x53'),'savename',_0x23f0('0x54')],'raw':!![]})[_0x23f0('0x22')](handleEntityNotFound(_0x13dd30,null))[_0x23f0('0x22')](function(_0x4b43fb){if(_0x4b43fb){if(!fs[_0x23f0('0x55')](path[_0x23f0('0x56')](config[_0x23f0('0x57')],'server/files/reports',_0x4b43fb['savename']))){throw new db[(_0x23f0('0x58'))][(_0x23f0('0x59'))](_0x23f0('0x5a'));}if(_0x5f4519[_0x23f0('0x32')]['exists']){return _0x13dd30['sendStatus'](0xc8);}return _0x13dd30[_0x23f0('0x52')](path['join'](config[_0x23f0('0x57')],'server/files/reports',_0x4b43fb[_0x23f0('0x5b')]),util['format'](_0x23f0('0x5c'),_0x4b43fb[_0x23f0('0x53')]||_0x4b43fb['name'],_0x4b43fb[_0x23f0('0x54')][_0x23f0('0x5d')]()));}})['catch'](handleError(_0x13dd30,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9353c0c..4feb994 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 _0x0e4b=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','request-promise','path','../../config/environment'];(function(_0xefd7df,_0xe44e5b){var _0x28b914=function(_0x156cdf){while(--_0x156cdf){_0xefd7df['push'](_0xefd7df['shift']());}};_0x28b914(++_0xe44e5b);}(_0x0e4b,0x145));var _0xb0e4=function(_0x3162b1,_0x14bf24){_0x3162b1=_0x3162b1-0x0;var _0x54ae57=_0x0e4b[_0x3162b1];return _0x54ae57;};'use strict';var _=require(_0xb0e4('0x0'));var util=require('util');var logger=require(_0xb0e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb0e4('0x2'));var fs=require('fs');var path=require(_0xb0e4('0x3'));var rimraf=require('rimraf');var config=require(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module[_0xb0e4('0x6')]=function(_0x5d16e5,_0x21429e){return _0x5d16e5[_0xb0e4('0x7')](_0xb0e4('0x8'),attributes,{'tableName':_0xb0e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eaf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0x3eaf,0x177));var _0xf3ea=function(_0x329149,_0x11c22a){_0x329149=_0x329149-0x0;var _0x49f210=_0x3eaf[_0x329149];return _0x49f210;};'use strict';var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));var logger=require(_0xf3ea('0x2'))('api');var moment=require(_0xf3ea('0x3'));var BPromise=require(_0xf3ea('0x4'));var rp=require(_0xf3ea('0x5'));var fs=require('fs');var path=require(_0xf3ea('0x6'));var rimraf=require(_0xf3ea('0x7'));var config=require(_0xf3ea('0x8'));var attributes=require(_0xf3ea('0x9'));module[_0xf3ea('0xa')]=function(_0xdee155,_0x1bfaeb){return _0xdee155[_0xf3ea('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0xf3ea('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 7d822c9..fb45d90 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 _0xdda4=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2deecf,_0x50aba8){var _0x2f5c1a=function(_0x1c98f2){while(--_0x1c98f2){_0x2deecf['push'](_0x2deecf['shift']());}};_0x2f5c1a(++_0x50aba8);}(_0xdda4,0x1a6));var _0x4dda=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xdda4[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require(_0x4dda('0x0'));var moment=require('moment');var BPromise=require(_0x4dda('0x1'));var rs=require(_0x4dda('0x2'));var fs=require('fs');var Redis=require(_0x4dda('0x3'));var db=require(_0x4dda('0x4'))['db'];var utils=require(_0x4dda('0x5'));var logger=require(_0x4dda('0x6'))(_0x4dda('0x7'));var config=require(_0x4dda('0x8'));var jayson=require(_0x4dda('0x9'));var client=jayson[_0x4dda('0xa')][_0x4dda('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f7fd8,_0x335764,_0x199afc){return new BPromise(function(_0x296f64,_0x3d3ab6){return client['request'](_0x2f7fd8,_0x199afc)[_0x4dda('0xc')](function(_0x4c243a){logger['info'](_0x4dda('0xd'),_0x335764,_0x4dda('0xe'));logger[_0x4dda('0xf')](_0x4dda('0x10'),_0x335764,_0x4dda('0xe'),JSON[_0x4dda('0x11')](_0x4c243a));if(_0x4c243a[_0x4dda('0x12')]){if(_0x4c243a[_0x4dda('0x12')]['code']===0x1f4){logger[_0x4dda('0x12')](_0x4dda('0xd'),_0x335764,_0x4c243a[_0x4dda('0x12')]['message']);return _0x3d3ab6(_0x4c243a['error'][_0x4dda('0x13')]);}logger[_0x4dda('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x335764,_0x4c243a[_0x4dda('0x12')]['message']);return _0x296f64(_0x4c243a[_0x4dda('0x12')][_0x4dda('0x13')]);}else{logger['info'](_0x4dda('0xd'),_0x335764,'request\x20sent');_0x296f64(_0x4c243a['result'][_0x4dda('0x13')]);}})[_0x4dda('0x14')](function(_0x355375){logger[_0x4dda('0x12')](_0x4dda('0xd'),_0x335764,_0x355375);_0x3d3ab6(_0x355375);});});} \ No newline at end of file +var _0x8fbd=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0xa85630,_0x2a21f0){var _0x701d5f=function(_0x279782){while(--_0x279782){_0xa85630['push'](_0xa85630['shift']());}};_0x701d5f(++_0x2a21f0);}(_0x8fbd,0x173));var _0xd8fb=function(_0xca8989,_0x386ec5){_0xca8989=_0xca8989-0x0;var _0xc29e7f=_0x8fbd[_0xca8989];return _0xc29e7f;};'use strict';var _=require(_0xd8fb('0x0'));var util=require(_0xd8fb('0x1'));var moment=require('moment');var BPromise=require(_0xd8fb('0x2'));var rs=require(_0xd8fb('0x3'));var fs=require('fs');var Redis=require(_0xd8fb('0x4'));var db=require(_0xd8fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8fb('0x6'))('rpc');var config=require(_0xd8fb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd8fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20cac5,_0x4f7aaf,_0x4f109c){return new BPromise(function(_0x9eda06,_0x4ad7cc){return client[_0xd8fb('0x9')](_0x20cac5,_0x4f109c)[_0xd8fb('0xa')](function(_0x24ccb9){logger[_0xd8fb('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4f7aaf,_0xd8fb('0xc'));logger[_0xd8fb('0xd')](_0xd8fb('0xe'),_0x4f7aaf,'request\x20sent',JSON[_0xd8fb('0xf')](_0x24ccb9));if(_0x24ccb9[_0xd8fb('0x10')]){if(_0x24ccb9['error'][_0xd8fb('0x11')]===0x1f4){logger['error'](_0xd8fb('0x12'),_0x4f7aaf,_0x24ccb9[_0xd8fb('0x10')][_0xd8fb('0x13')]);return _0x4ad7cc(_0x24ccb9[_0xd8fb('0x10')][_0xd8fb('0x13')]);}logger[_0xd8fb('0x10')](_0xd8fb('0x12'),_0x4f7aaf,_0x24ccb9[_0xd8fb('0x10')]['message']);return _0x9eda06(_0x24ccb9[_0xd8fb('0x10')][_0xd8fb('0x13')]);}else{logger[_0xd8fb('0xb')](_0xd8fb('0x12'),_0x4f7aaf,_0xd8fb('0xc'));_0x9eda06(_0x24ccb9[_0xd8fb('0x14')][_0xd8fb('0x13')]);}})[_0xd8fb('0x15')](function(_0x30e54e){logger[_0xd8fb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4f7aaf,_0x30e54e);_0x4ad7cc(_0x30e54e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index d921dab..e6f50cc 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 _0xbd1e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2513c7,_0x30ca8f){var _0x51d34b=function(_0x35937e){while(--_0x35937e){_0x2513c7['push'](_0x2513c7['shift']());}};_0x51d34b(++_0x30ca8f);}(_0xbd1e,0x109));var _0xebd1=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0xbd1e[_0x5442a5];return _0x130af0;};'use strict';var multer=require(_0xebd1('0x0'));var util=require(_0xebd1('0x1'));var path=require(_0xebd1('0x2'));var timeout=require(_0xebd1('0x3'));var express=require(_0xebd1('0x4'));var router=express[_0xebd1('0x5')]();var fs_extra=require(_0xebd1('0x6'));var auth=require(_0xebd1('0x7'));var interaction=require(_0xebd1('0x8'));var config=require(_0xebd1('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0xebd1('0xa')]('/',auth[_0xebd1('0xb')](),controller[_0xebd1('0xc')]);router[_0xebd1('0xa')](_0xebd1('0xd'),auth[_0xebd1('0xb')](),controller[_0xebd1('0xe')]);router[_0xebd1('0xa')]('/:id/download',auth[_0xebd1('0xb')](),controller['download']);router[_0xebd1('0xf')]('/',auth[_0xebd1('0xb')](),controller[_0xebd1('0x10')]);router['put'](_0xebd1('0xd'),auth['isAuthenticated'](),controller[_0xebd1('0x11')]);router[_0xebd1('0x12')](_0xebd1('0xd'),auth[_0xebd1('0xb')](),controller[_0xebd1('0x13')]);module[_0xebd1('0x14')]=router; \ No newline at end of file +var _0xff24=['download','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','show','get','/:id/download'];(function(_0x2bdc52,_0x467198){var _0x347e99=function(_0x232dd0){while(--_0x232dd0){_0x2bdc52['push'](_0x2bdc52['shift']());}};_0x347e99(++_0x467198);}(_0xff24,0x139));var _0x4ff2=function(_0x3a383d,_0x9b89ec){_0x3a383d=_0x3a383d-0x0;var _0x1e4cd1=_0xff24[_0x3a383d];return _0x1e4cd1;};'use strict';var multer=require('multer');var util=require(_0x4ff2('0x0'));var path=require(_0x4ff2('0x1'));var timeout=require(_0x4ff2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4ff2('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ff2('0x4'));var controller=require(_0x4ff2('0x5'));router['get']('/',auth[_0x4ff2('0x6')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4ff2('0x7')]);router[_0x4ff2('0x8')](_0x4ff2('0x9'),auth[_0x4ff2('0x6')](),controller[_0x4ff2('0xa')]);router[_0x4ff2('0xb')]('/',auth[_0x4ff2('0x6')](),controller[_0x4ff2('0xc')]);router[_0x4ff2('0xd')](_0x4ff2('0xe'),auth[_0x4ff2('0x6')](),controller[_0x4ff2('0xf')]);router[_0x4ff2('0x10')](_0x4ff2('0xe'),auth[_0x4ff2('0x6')](),controller[_0x4ff2('0x11')]);module[_0x4ff2('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4c03256..0e7cfd3 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 _0x0fa5=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x335dda,_0x572399){var _0x3a2c49=function(_0x21f348){while(--_0x21f348){_0x335dda['push'](_0x335dda['shift']());}};_0x3a2c49(++_0x572399);}(_0x0fa5,0xa5));var _0x50fa=function(_0x295a5c,_0xfd0b5){_0x295a5c=_0x295a5c-0x0;var _0x53339e=_0x0fa5[_0x295a5c];return _0x53339e;};'use strict';var Sequelize=require(_0x50fa('0x0'));module[_0x50fa('0x1')]={'field':{'type':Sequelize[_0x50fa('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x50fa('0x3')]},'groupBy':{'type':Sequelize[_0x50fa('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50fa('0x3')]},'custom':{'type':Sequelize[_0x50fa('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2cf6=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x34479b,_0x53b1d1){var _0x23e1b8=function(_0x22d0e6){while(--_0x22d0e6){_0x34479b['push'](_0x34479b['shift']());}};_0x23e1b8(++_0x53b1d1);}(_0x2cf6,0x1a3));var _0x62cf=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x2cf6[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x62cf('0x0'));module['exports']={'field':{'type':Sequelize[_0x62cf('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x62cf('0x2')]},'groupBy':{'type':Sequelize[_0x62cf('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x62cf('0x2')]},'custom':{'type':Sequelize[_0x62cf('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 9c095f3..13c59f6 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 _0x2dff=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','json','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','params','merge','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x43b5ff,_0x491b75){var _0x4fa086=function(_0xbd7ec3){while(--_0xbd7ec3){_0x43b5ff['push'](_0x43b5ff['shift']());}};_0x4fa086(++_0x491b75);}(_0x2dff,0x8b));var _0xf2df=function(_0x1d65e4,_0x49f4f0){_0x1d65e4=_0x1d65e4-0x0;var _0x1e7fe3=_0x2dff[_0x1d65e4];return _0x1e7fe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2df('0x0'));var zipdir=require(_0xf2df('0x1'));var jsonpatch=require(_0xf2df('0x2'));var rp=require(_0xf2df('0x3'));var moment=require(_0xf2df('0x4'));var BPromise=require(_0xf2df('0x5'));var Mustache=require(_0xf2df('0x6'));var util=require(_0xf2df('0x7'));var path=require(_0xf2df('0x8'));var sox=require(_0xf2df('0x9'));var csv=require(_0xf2df('0xa'));var ejs=require(_0xf2df('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf2df('0xc'));var crypto=require(_0xf2df('0xd'));var jsforce=require(_0xf2df('0xe'));var deskjs=require(_0xf2df('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf2df('0x10'));var Papa=require(_0xf2df('0x11'));var Redis=require(_0xf2df('0x12'));var authService=require(_0xf2df('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf2df('0x14'));var hardwareService=require(_0xf2df('0x15'));var logger=require(_0xf2df('0x16'))(_0xf2df('0x17'));var utils=require(_0xf2df('0x18'));var config=require(_0xf2df('0x19'));var licenseUtil=require(_0xf2df('0x1a'));var db=require(_0xf2df('0x1b'))['db'];function respondWithStatusCode(_0x3e9e7a,_0x24e163){_0x24e163=_0x24e163||0xcc;return function(_0x47ab5d){if(_0x47ab5d){return _0x3e9e7a[_0xf2df('0x1c')](_0x24e163);}return _0x3e9e7a['status'](_0x24e163)[_0xf2df('0x1d')]();};}function respondWithResult(_0xaa6c2e,_0x5f1761){_0x5f1761=_0x5f1761||0xc8;return function(_0x28acb1){if(_0x28acb1){return _0xaa6c2e['status'](_0x5f1761)['json'](_0x28acb1);}};}function respondWithFilteredResult(_0x4a9484,_0x358e8a){return function(_0x2ce2de){if(_0x2ce2de){var _0x37f9b4=typeof _0x358e8a['offset']===_0xf2df('0x1e')&&typeof _0x358e8a['limit']===_0xf2df('0x1e');var _0xf524bb=_0x2ce2de[_0xf2df('0x1f')];var _0x2186a2=_0x37f9b4?0x0:_0x358e8a[_0xf2df('0x20')];var _0x4a019d=_0x37f9b4?_0x2ce2de[_0xf2df('0x1f')]:_0x358e8a[_0xf2df('0x20')]+_0x358e8a[_0xf2df('0x21')];var _0x232d9e;if(_0x4a019d>=_0xf524bb){_0x4a019d=_0xf524bb;_0x232d9e=0xc8;}else{_0x232d9e=0xce;}_0x4a9484[_0xf2df('0x22')](_0x232d9e);return _0x4a9484['set']('Content-Range',_0x2186a2+'-'+_0x4a019d+'/'+_0xf524bb)[_0xf2df('0x23')](_0x2ce2de);}return null;};}function patchUpdates(_0xbab6d2){return function(_0x16ee71){try{jsonpatch['apply'](_0x16ee71,_0xbab6d2,!![]);}catch(_0x1b81e8){return BPromise[_0xf2df('0x24')](_0x1b81e8);}return _0x16ee71[_0xf2df('0x25')]();};}function saveUpdates(_0x839925,_0x3a4337){return function(_0x30ac4b){if(_0x30ac4b){return _0x30ac4b[_0xf2df('0x26')](_0x839925)[_0xf2df('0x27')](function(_0x27c17e){return _0x27c17e;});}return null;};}function removeEntity(_0x3389f6,_0x1caa88){return function(_0x191419){if(_0x191419){return _0x191419[_0xf2df('0x28')]()[_0xf2df('0x27')](function(){_0x3389f6[_0xf2df('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b1b9,_0x5a2299){return function(_0x141ce6){if(!_0x141ce6){_0x40b1b9[_0xf2df('0x1c')](0x194);}return _0x141ce6;};}function handleError(_0x3fb4f1,_0x400cbc){_0x400cbc=_0x400cbc||0x1f4;return function(_0x6a7373){logger[_0xf2df('0x29')](_0x6a7373[_0xf2df('0x2a')]);if(_0x6a7373[_0xf2df('0x2b')]){delete _0x6a7373['name'];}_0x3fb4f1['status'](_0x400cbc)[_0xf2df('0x2c')](_0x6a7373);};}exports['index']=function(_0x3a739b,_0x37d607){var _0x4f8f87={},_0x277bbd={},_0x2ccffe={'count':0x0,'rows':[]};var _0x37c6b6=_[_0xf2df('0x2d')](db[_0xf2df('0x2e')]['rawAttributes'],function(_0x1c98c9){return{'name':_0x1c98c9['fieldName'],'type':_0x1c98c9[_0xf2df('0x2f')]['key']};});_0x277bbd[_0xf2df('0x30')]=_[_0xf2df('0x2d')](_0x37c6b6,_0xf2df('0x2b'));_0x277bbd[_0xf2df('0x31')]=_[_0xf2df('0x32')](_0x3a739b[_0xf2df('0x31')]);_0x277bbd[_0xf2df('0x33')]=_[_0xf2df('0x34')](_0x277bbd[_0xf2df('0x30')],_0x277bbd[_0xf2df('0x31')]);_0x4f8f87[_0xf2df('0x35')]=_[_0xf2df('0x34')](_0x277bbd[_0xf2df('0x30')],qs[_0xf2df('0x36')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x36')]));_0x4f8f87[_0xf2df('0x35')]=_0x4f8f87['attributes'][_0xf2df('0x37')]?_0x4f8f87[_0xf2df('0x35')]:_0x277bbd[_0xf2df('0x30')];if(!_0x3a739b[_0xf2df('0x31')][_0xf2df('0x38')](_0xf2df('0x39'))){_0x4f8f87[_0xf2df('0x21')]=qs[_0xf2df('0x21')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x21')]);_0x4f8f87[_0xf2df('0x20')]=qs[_0xf2df('0x20')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x20')]);}_0x4f8f87[_0xf2df('0x3a')]=qs[_0xf2df('0x3b')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3b')]);_0x4f8f87[_0xf2df('0x3c')]=qs[_0xf2df('0x33')](_[_0xf2df('0x3d')](_0x3a739b[_0xf2df('0x31')],_0x277bbd[_0xf2df('0x33')]),_0x37c6b6);if(_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3e')]){_0x4f8f87[_0xf2df('0x3c')]=_['merge'](_0x4f8f87[_0xf2df('0x3c')],{'$or':_[_0xf2df('0x2d')](_0x37c6b6,function(_0x2110c5){if(_0x2110c5[_0xf2df('0x2f')]!==_0xf2df('0x3f')){var _0x3c2b08={};_0x3c2b08[_0x2110c5['name']]={'$like':'%'+_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3e')]+'%'};return _0x3c2b08;}})});}_0x4f8f87=_['merge']({},_0x4f8f87,_0x3a739b[_0xf2df('0x40')]);var _0x5516e4={'where':_0x4f8f87[_0xf2df('0x3c')]};return db[_0xf2df('0x2e')][_0xf2df('0x1f')](_0x5516e4)[_0xf2df('0x27')](function(_0x534518){_0x2ccffe['count']=_0x534518;if(_0x3a739b[_0xf2df('0x31')][_0xf2df('0x41')]){_0x4f8f87['include']=[{'all':!![]}];}return db[_0xf2df('0x2e')]['findAll'](_0x4f8f87);})['then'](function(_0x5c800c){_0x2ccffe[_0xf2df('0x42')]=_0x5c800c;return _0x2ccffe;})[_0xf2df('0x27')](respondWithFilteredResult(_0x37d607,_0x4f8f87))[_0xf2df('0x43')](handleError(_0x37d607,null));};exports['show']=function(_0x6ee061,_0x38dbce){var _0x3e0aea={'raw':![],'where':{'id':_0x6ee061[_0xf2df('0x44')]['id']}},_0x439d72={};_0x439d72['model']=_['keys'](db[_0xf2df('0x2e')]['rawAttributes']);_0x439d72[_0xf2df('0x31')]=_[_0xf2df('0x32')](_0x6ee061[_0xf2df('0x31')]);_0x439d72['filters']=_[_0xf2df('0x34')](_0x439d72[_0xf2df('0x30')],_0x439d72[_0xf2df('0x31')]);_0x3e0aea[_0xf2df('0x35')]=_[_0xf2df('0x34')](_0x439d72['model'],qs[_0xf2df('0x36')](_0x6ee061[_0xf2df('0x31')][_0xf2df('0x36')]));_0x3e0aea[_0xf2df('0x35')]=_0x3e0aea[_0xf2df('0x35')][_0xf2df('0x37')]?_0x3e0aea[_0xf2df('0x35')]:_0x439d72[_0xf2df('0x30')];if(_0x6ee061[_0xf2df('0x31')][_0xf2df('0x41')]){_0x3e0aea['include']=[{'all':!![]}];}_0x3e0aea=_[_0xf2df('0x45')]({},_0x3e0aea,_0x6ee061[_0xf2df('0x40')]);return db['AnalyticFieldReport'][_0xf2df('0x46')](_0x3e0aea)[_0xf2df('0x27')](handleEntityNotFound(_0x38dbce,null))[_0xf2df('0x27')](respondWithResult(_0x38dbce,null))[_0xf2df('0x43')](handleError(_0x38dbce,null));};exports[_0xf2df('0x47')]=function(_0x16b1e1,_0x179510){return db[_0xf2df('0x2e')][_0xf2df('0x47')](_0x16b1e1[_0xf2df('0x48')],{})[_0xf2df('0x27')](respondWithResult(_0x179510,0xc9))[_0xf2df('0x43')](handleError(_0x179510,null));};exports[_0xf2df('0x49')]=function(_0x5d35c3,_0x2ec8de){return db['AnalyticFieldReport']['bulkCreate'](_0x5d35c3[_0xf2df('0x48')],{'raw':![],'individualHooks':!![]})[_0xf2df('0x27')](respondWithResult(_0x2ec8de,0xc9))[_0xf2df('0x43')](handleError(_0x2ec8de,null));};exports[_0xf2df('0x26')]=function(_0x575c32,_0x1d4456){if(_0x575c32[_0xf2df('0x48')]['id']){delete _0x575c32[_0xf2df('0x48')]['id'];}return db[_0xf2df('0x2e')]['find']({'where':{'id':_0x575c32[_0xf2df('0x44')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x1d4456,null))[_0xf2df('0x27')](saveUpdates(_0x575c32['body'],null))[_0xf2df('0x27')](respondWithResult(_0x1d4456,null))[_0xf2df('0x43')](handleError(_0x1d4456,null));};exports[_0xf2df('0x28')]=function(_0xf4cd87,_0x334a43){return db[_0xf2df('0x2e')]['find']({'where':{'id':_0xf4cd87[_0xf2df('0x44')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x334a43,null))['then'](removeEntity(_0x334a43,null))[_0xf2df('0x43')](handleError(_0x334a43,null));};exports[_0xf2df('0x4a')]=function(_0x47d797,_0x5a9a8e){return db[_0xf2df('0x2e')][_0xf2df('0x28')]({'where':{'id':_0x47d797['query'][_0xf2df('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xf2df('0x27')](respondWithResult(_0x5a9a8e,0xcc))['catch'](handleError(_0x5a9a8e,null));};exports[_0xf2df('0x4c')]=function(_0x307603,_0x5f3036,_0x4e66ec){return db[_0xf2df('0x4d')][_0xf2df('0x4e')]({'where':{'id':_0x307603[_0xf2df('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f3036,null))['then'](function(_0x2e3927){if(_0x2e3927){return db[_0xf2df('0x4f')][_0xf2df('0x50')](function(_0x19e69b){return db[_0xf2df('0x2e')][_0xf2df('0x28')]({'where':{'CustomReportId':_0x307603[_0xf2df('0x44')]['id']},'transaction':_0x19e69b})['then'](function(_0x1003f4){var _0x25616e=_[_0xf2df('0x2d')](_0x307603[_0xf2df('0x48')],function(_0x27db3e){delete _0x27db3e['id'];_0x27db3e['CustomReportId']=_0x307603['params']['id'];return _0x27db3e;});return db[_0xf2df('0x2e')][_0xf2df('0x49')](_0x25616e,{'transaction':_0x19e69b});});})[_0xf2df('0x27')](function(){return db[_0xf2df('0x2e')]['findAll']({'where':{'CustomReportId':_0x307603[_0xf2df('0x44')]['id']}});});}})[_0xf2df('0x27')](respondWithResult(_0x5f3036,null))['catch'](handleError(_0x5f3036,null));}; \ No newline at end of file +var _0xae24=['params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','include','findAll','rows','catch','show','includeAll','options','find','bulkCreate','body'];(function(_0xda1945,_0x9964ef){var _0xa56b92=function(_0x4e026d){while(--_0x4e026d){_0xda1945['push'](_0xda1945['shift']());}};_0xa56b92(++_0x9964ef);}(_0xae24,0xf9));var _0x4ae2=function(_0x16ff75,_0x5b16fb){_0x16ff75=_0x16ff75-0x0;var _0x49188a=_0xae24[_0x16ff75];return _0x49188a;};'use strict';var emlformat=require(_0x4ae2('0x0'));var rimraf=require(_0x4ae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ae2('0x2'));var rp=require(_0x4ae2('0x3'));var moment=require('moment');var BPromise=require(_0x4ae2('0x4'));var Mustache=require(_0x4ae2('0x5'));var util=require(_0x4ae2('0x6'));var path=require(_0x4ae2('0x7'));var sox=require('sox');var csv=require(_0x4ae2('0x8'));var ejs=require(_0x4ae2('0x9'));var fs=require('fs');var fs_extra=require(_0x4ae2('0xa'));var _=require(_0x4ae2('0xb'));var squel=require('squel');var crypto=require(_0x4ae2('0xc'));var jsforce=require(_0x4ae2('0xd'));var deskjs=require(_0x4ae2('0xe'));var toCsv=require(_0x4ae2('0x8'));var querystring=require(_0x4ae2('0xf'));var Papa=require(_0x4ae2('0x10'));var Redis=require(_0x4ae2('0x11'));var authService=require(_0x4ae2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ae2('0x13'));var logger=require(_0x4ae2('0x14'))(_0x4ae2('0x15'));var utils=require(_0x4ae2('0x16'));var config=require(_0x4ae2('0x17'));var licenseUtil=require(_0x4ae2('0x18'));var db=require(_0x4ae2('0x19'))['db'];function respondWithStatusCode(_0x40a842,_0x33f466){_0x33f466=_0x33f466||0xcc;return function(_0x4f8a76){if(_0x4f8a76){return _0x40a842['sendStatus'](_0x33f466);}return _0x40a842[_0x4ae2('0x1a')](_0x33f466)[_0x4ae2('0x1b')]();};}function respondWithResult(_0x3ea15d,_0x1de8d7){_0x1de8d7=_0x1de8d7||0xc8;return function(_0x2731b2){if(_0x2731b2){return _0x3ea15d[_0x4ae2('0x1a')](_0x1de8d7)[_0x4ae2('0x1c')](_0x2731b2);}};}function respondWithFilteredResult(_0x59359e,_0x2507ea){return function(_0x10a571){if(_0x10a571){var _0x5377c5=typeof _0x2507ea[_0x4ae2('0x1d')]==='undefined'&&typeof _0x2507ea['limit']==='undefined';var _0x2eab56=_0x10a571['count'];var _0x5cf3fc=_0x5377c5?0x0:_0x2507ea['offset'];var _0x31535c=_0x5377c5?_0x10a571['count']:_0x2507ea[_0x4ae2('0x1d')]+_0x2507ea[_0x4ae2('0x1e')];var _0x4503eb;if(_0x31535c>=_0x2eab56){_0x31535c=_0x2eab56;_0x4503eb=0xc8;}else{_0x4503eb=0xce;}_0x59359e[_0x4ae2('0x1a')](_0x4503eb);return _0x59359e[_0x4ae2('0x1f')](_0x4ae2('0x20'),_0x5cf3fc+'-'+_0x31535c+'/'+_0x2eab56)[_0x4ae2('0x1c')](_0x10a571);}return null;};}function patchUpdates(_0x20b162){return function(_0x4803f4){try{jsonpatch['apply'](_0x4803f4,_0x20b162,!![]);}catch(_0x531883){return BPromise['reject'](_0x531883);}return _0x4803f4[_0x4ae2('0x21')]();};}function saveUpdates(_0xf6b441,_0x927dae){return function(_0x5b9901){if(_0x5b9901){return _0x5b9901[_0x4ae2('0x22')](_0xf6b441)[_0x4ae2('0x23')](function(_0x40b018){return _0x40b018;});}return null;};}function removeEntity(_0x5616c4,_0x173a25){return function(_0x36a9fe){if(_0x36a9fe){return _0x36a9fe[_0x4ae2('0x24')]()[_0x4ae2('0x23')](function(){_0x5616c4['status'](0xcc)[_0x4ae2('0x1b')]();});}};}function handleEntityNotFound(_0x4da07a,_0x51fb0a){return function(_0x28bf2b){if(!_0x28bf2b){_0x4da07a['sendStatus'](0x194);}return _0x28bf2b;};}function handleError(_0x50d988,_0x2c9629){_0x2c9629=_0x2c9629||0x1f4;return function(_0x4cbafb){logger['error'](_0x4cbafb['stack']);if(_0x4cbafb[_0x4ae2('0x25')]){delete _0x4cbafb[_0x4ae2('0x25')];}_0x50d988[_0x4ae2('0x1a')](_0x2c9629)[_0x4ae2('0x26')](_0x4cbafb);};}exports[_0x4ae2('0x27')]=function(_0x1b0720,_0x3feaa7){var _0x455aec={},_0x2edfe1={},_0x26f39f={'count':0x0,'rows':[]};var _0x152f5f=_[_0x4ae2('0x28')](db[_0x4ae2('0x29')][_0x4ae2('0x2a')],function(_0x5d3d3a){return{'name':_0x5d3d3a[_0x4ae2('0x2b')],'type':_0x5d3d3a['type'][_0x4ae2('0x2c')]};});_0x2edfe1[_0x4ae2('0x2d')]=_[_0x4ae2('0x28')](_0x152f5f,_0x4ae2('0x25'));_0x2edfe1[_0x4ae2('0x2e')]=_[_0x4ae2('0x2f')](_0x1b0720[_0x4ae2('0x2e')]);_0x2edfe1[_0x4ae2('0x30')]=_[_0x4ae2('0x31')](_0x2edfe1[_0x4ae2('0x2d')],_0x2edfe1[_0x4ae2('0x2e')]);_0x455aec[_0x4ae2('0x32')]=_['intersection'](_0x2edfe1['model'],qs[_0x4ae2('0x33')](_0x1b0720['query'][_0x4ae2('0x33')]));_0x455aec[_0x4ae2('0x32')]=_0x455aec[_0x4ae2('0x32')][_0x4ae2('0x34')]?_0x455aec[_0x4ae2('0x32')]:_0x2edfe1[_0x4ae2('0x2d')];if(!_0x1b0720[_0x4ae2('0x2e')]['hasOwnProperty'](_0x4ae2('0x35'))){_0x455aec[_0x4ae2('0x1e')]=qs['limit'](_0x1b0720[_0x4ae2('0x2e')]['limit']);_0x455aec[_0x4ae2('0x1d')]=qs[_0x4ae2('0x1d')](_0x1b0720[_0x4ae2('0x2e')][_0x4ae2('0x1d')]);}_0x455aec[_0x4ae2('0x36')]=qs[_0x4ae2('0x37')](_0x1b0720[_0x4ae2('0x2e')][_0x4ae2('0x37')]);_0x455aec[_0x4ae2('0x38')]=qs[_0x4ae2('0x30')](_[_0x4ae2('0x39')](_0x1b0720[_0x4ae2('0x2e')],_0x2edfe1[_0x4ae2('0x30')]),_0x152f5f);if(_0x1b0720[_0x4ae2('0x2e')][_0x4ae2('0x3a')]){_0x455aec[_0x4ae2('0x38')]=_[_0x4ae2('0x3b')](_0x455aec['where'],{'$or':_['map'](_0x152f5f,function(_0x464723){if(_0x464723[_0x4ae2('0x3c')]!=='VIRTUAL'){var _0x2a78cb={};_0x2a78cb[_0x464723['name']]={'$like':'%'+_0x1b0720[_0x4ae2('0x2e')][_0x4ae2('0x3a')]+'%'};return _0x2a78cb;}})});}_0x455aec=_[_0x4ae2('0x3b')]({},_0x455aec,_0x1b0720['options']);var _0x51b188={'where':_0x455aec[_0x4ae2('0x38')]};return db['AnalyticFieldReport']['count'](_0x51b188)['then'](function(_0x2d1c3d){_0x26f39f['count']=_0x2d1c3d;if(_0x1b0720[_0x4ae2('0x2e')]['includeAll']){_0x455aec[_0x4ae2('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4ae2('0x3e')](_0x455aec);})[_0x4ae2('0x23')](function(_0x58570d){_0x26f39f[_0x4ae2('0x3f')]=_0x58570d;return _0x26f39f;})['then'](respondWithFilteredResult(_0x3feaa7,_0x455aec))[_0x4ae2('0x40')](handleError(_0x3feaa7,null));};exports[_0x4ae2('0x41')]=function(_0x43fa69,_0x21d4bc){var _0x1eb640={'raw':![],'where':{'id':_0x43fa69['params']['id']}},_0x5f0aac={};_0x5f0aac[_0x4ae2('0x2d')]=_[_0x4ae2('0x2f')](db[_0x4ae2('0x29')]['rawAttributes']);_0x5f0aac[_0x4ae2('0x2e')]=_[_0x4ae2('0x2f')](_0x43fa69[_0x4ae2('0x2e')]);_0x5f0aac[_0x4ae2('0x30')]=_[_0x4ae2('0x31')](_0x5f0aac[_0x4ae2('0x2d')],_0x5f0aac[_0x4ae2('0x2e')]);_0x1eb640[_0x4ae2('0x32')]=_[_0x4ae2('0x31')](_0x5f0aac[_0x4ae2('0x2d')],qs[_0x4ae2('0x33')](_0x43fa69['query'][_0x4ae2('0x33')]));_0x1eb640[_0x4ae2('0x32')]=_0x1eb640[_0x4ae2('0x32')][_0x4ae2('0x34')]?_0x1eb640[_0x4ae2('0x32')]:_0x5f0aac[_0x4ae2('0x2d')];if(_0x43fa69[_0x4ae2('0x2e')][_0x4ae2('0x42')]){_0x1eb640[_0x4ae2('0x3d')]=[{'all':!![]}];}_0x1eb640=_['merge']({},_0x1eb640,_0x43fa69[_0x4ae2('0x43')]);return db[_0x4ae2('0x29')][_0x4ae2('0x44')](_0x1eb640)['then'](handleEntityNotFound(_0x21d4bc,null))[_0x4ae2('0x23')](respondWithResult(_0x21d4bc,null))[_0x4ae2('0x40')](handleError(_0x21d4bc,null));};exports['create']=function(_0x2baffa,_0x4e0ed4){return db[_0x4ae2('0x29')]['create'](_0x2baffa['body'],{})[_0x4ae2('0x23')](respondWithResult(_0x4e0ed4,0xc9))[_0x4ae2('0x40')](handleError(_0x4e0ed4,null));};exports[_0x4ae2('0x45')]=function(_0x41e8c9,_0x317893){return db[_0x4ae2('0x29')]['bulkCreate'](_0x41e8c9[_0x4ae2('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x317893,0xc9))['catch'](handleError(_0x317893,null));};exports[_0x4ae2('0x22')]=function(_0x5418ac,_0x133757){if(_0x5418ac[_0x4ae2('0x46')]['id']){delete _0x5418ac[_0x4ae2('0x46')]['id'];}return db['AnalyticFieldReport'][_0x4ae2('0x44')]({'where':{'id':_0x5418ac[_0x4ae2('0x47')]['id']}})[_0x4ae2('0x23')](handleEntityNotFound(_0x133757,null))[_0x4ae2('0x23')](saveUpdates(_0x5418ac[_0x4ae2('0x46')],null))[_0x4ae2('0x23')](respondWithResult(_0x133757,null))[_0x4ae2('0x40')](handleError(_0x133757,null));};exports[_0x4ae2('0x24')]=function(_0x2e937e,_0xc5da91){return db['AnalyticFieldReport']['find']({'where':{'id':_0x2e937e['params']['id']}})[_0x4ae2('0x23')](handleEntityNotFound(_0xc5da91,null))[_0x4ae2('0x23')](removeEntity(_0xc5da91,null))[_0x4ae2('0x40')](handleError(_0xc5da91,null));};exports[_0x4ae2('0x48')]=function(_0x44fd23,_0x21b0d1){return db[_0x4ae2('0x29')][_0x4ae2('0x24')]({'where':{'id':_0x44fd23['query'][_0x4ae2('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x4ae2('0x23')](respondWithResult(_0x21b0d1,0xcc))[_0x4ae2('0x40')](handleError(_0x21b0d1,null));};exports[_0x4ae2('0x4a')]=function(_0x490ca1,_0x46107d,_0x884e1c){return db[_0x4ae2('0x4b')][_0x4ae2('0x4c')]({'where':{'id':_0x490ca1[_0x4ae2('0x47')]['id']}})[_0x4ae2('0x23')](handleEntityNotFound(_0x46107d,null))[_0x4ae2('0x23')](function(_0x22e151){if(_0x22e151){return db[_0x4ae2('0x4d')][_0x4ae2('0x4e')](function(_0x442a41){return db[_0x4ae2('0x29')][_0x4ae2('0x24')]({'where':{'CustomReportId':_0x490ca1[_0x4ae2('0x47')]['id']},'transaction':_0x442a41})[_0x4ae2('0x23')](function(_0x12bd5e){var _0x3474a9=_[_0x4ae2('0x28')](_0x490ca1['body'],function(_0x3c9bd5){delete _0x3c9bd5['id'];_0x3c9bd5[_0x4ae2('0x4f')]=_0x490ca1[_0x4ae2('0x47')]['id'];return _0x3c9bd5;});return db[_0x4ae2('0x29')][_0x4ae2('0x45')](_0x3474a9,{'transaction':_0x442a41});});})[_0x4ae2('0x23')](function(){return db[_0x4ae2('0x29')]['findAll']({'where':{'CustomReportId':_0x490ca1[_0x4ae2('0x47')]['id']}});});}})[_0x4ae2('0x23')](respondWithResult(_0x46107d,null))[_0x4ae2('0x40')](handleError(_0x46107d,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 7e8a67e..7b1783e 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 _0xdcad=['bluebird','request-promise','path','../../config/environment','exports','define','AnalyticFieldReport','../../config/logger'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xdcad,0xcf));var _0xddca=function(_0x431e6e,_0x4c4775){_0x431e6e=_0x431e6e-0x0;var _0xe20f3f=_0xdcad[_0x431e6e];return _0xe20f3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xddca('0x0'))('api');var moment=require('moment');var BPromise=require(_0xddca('0x1'));var rp=require(_0xddca('0x2'));var fs=require('fs');var path=require(_0xddca('0x3'));var rimraf=require('rimraf');var config=require(_0xddca('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xddca('0x5')]=function(_0x4ef1e7,_0x1c1e63){return _0x4ef1e7[_0xddca('0x6')](_0xddca('0x7'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf794=['AnalyticFieldReport','analytics_report_fields','lodash','bluebird','request-promise','rimraf','define'];(function(_0x53821d,_0x1fd786){var _0x427dbe=function(_0x5882cc){while(--_0x5882cc){_0x53821d['push'](_0x53821d['shift']());}};_0x427dbe(++_0x1fd786);}(_0xf794,0x18a));var _0x4f79=function(_0x4bebb5,_0x437fe5){_0x4bebb5=_0x4bebb5-0x0;var _0x278218=_0xf794[_0x4bebb5];return _0x278218;};'use strict';var _=require(_0x4f79('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4f79('0x1'));var rp=require(_0x4f79('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f79('0x3'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x96e7d2,_0xd24163){return _0x96e7d2[_0x4f79('0x4')](_0x4f79('0x5'),attributes,{'tableName':_0x4f79('0x6'),'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 0f697e9..f982ad1 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 _0x6391=['jayson/promise','client','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x1954de,_0x3dc727){var _0x5b46f1=function(_0x134848){while(--_0x134848){_0x1954de['push'](_0x1954de['shift']());}};_0x5b46f1(++_0x3dc727);}(_0x6391,0x162));var _0x1639=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x6391[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x1639('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1639('0x1'));var rs=require(_0x1639('0x2'));var fs=require('fs');var Redis=require(_0x1639('0x3'));var db=require(_0x1639('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1639('0x5'))('rpc');var config=require(_0x1639('0x6'));var jayson=require(_0x1639('0x7'));var client=jayson[_0x1639('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51cfad,_0x1f1c3b,_0x406745){return new BPromise(function(_0x2477dc,_0x1ca08f){return client['request'](_0x51cfad,_0x406745)['then'](function(_0x27d39b){logger[_0x1639('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,'request\x20sent');logger[_0x1639('0xa')](_0x1639('0xb'),_0x1f1c3b,_0x1639('0xc'),JSON[_0x1639('0xd')](_0x27d39b));if(_0x27d39b['error']){if(_0x27d39b[_0x1639('0xe')][_0x1639('0xf')]===0x1f4){logger[_0x1639('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,_0x27d39b['error'][_0x1639('0x10')]);return _0x1ca08f(_0x27d39b['error'][_0x1639('0x10')]);}logger[_0x1639('0xe')](_0x1639('0x11'),_0x1f1c3b,_0x27d39b[_0x1639('0xe')]['message']);return _0x2477dc(_0x27d39b[_0x1639('0xe')][_0x1639('0x10')]);}else{logger[_0x1639('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,_0x1639('0xc'));_0x2477dc(_0x27d39b['result'][_0x1639('0x10')]);}})[_0x1639('0x12')](function(_0x5d3d74){logger[_0x1639('0xe')](_0x1639('0x11'),_0x1f1c3b,_0x5d3d74);_0x1ca08f(_0x5d3d74);});});} \ No newline at end of file +var _0xe86c=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe86c,0x19f));var _0xce86=function(_0x19c39d,_0x5d8906){_0x19c39d=_0x19c39d-0x0;var _0x251800=_0xe86c[_0x19c39d];return _0x251800;};'use strict';var _=require('lodash');var util=require(_0xce86('0x0'));var moment=require('moment');var BPromise=require(_0xce86('0x1'));var rs=require(_0xce86('0x2'));var fs=require('fs');var Redis=require(_0xce86('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce86('0x4'));var logger=require(_0xce86('0x5'))(_0xce86('0x6'));var config=require(_0xce86('0x7'));var jayson=require(_0xce86('0x8'));var client=jayson['client'][_0xce86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3269a7,_0x100c08,_0x34a3f3){return new BPromise(function(_0x1c8742,_0x588e81){return client['request'](_0x3269a7,_0x34a3f3)['then'](function(_0x45db38){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x100c08,_0xce86('0xa'));logger['debug'](_0xce86('0xb'),_0x100c08,_0xce86('0xa'),JSON[_0xce86('0xc')](_0x45db38));if(_0x45db38[_0xce86('0xd')]){if(_0x45db38[_0xce86('0xd')][_0xce86('0xe')]===0x1f4){logger[_0xce86('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x100c08,_0x45db38[_0xce86('0xd')]['message']);return _0x588e81(_0x45db38[_0xce86('0xd')][_0xce86('0xf')]);}logger[_0xce86('0xd')](_0xce86('0x10'),_0x100c08,_0x45db38[_0xce86('0xd')][_0xce86('0xf')]);return _0x1c8742(_0x45db38['error'][_0xce86('0xf')]);}else{logger[_0xce86('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x100c08,'request\x20sent');_0x1c8742(_0x45db38[_0xce86('0x12')][_0xce86('0xf')]);}})[_0xce86('0x13')](function(_0xf4a10){logger[_0xce86('0xd')](_0xce86('0x10'),_0x100c08,_0xf4a10);_0x588e81(_0xf4a10);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bf19d14..95d2739 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(_0x15a3b0,_0x1ef3d3){var _0x56c9b7=function(_0xa7800e){while(--_0xa7800e){_0x15a3b0['push'](_0x15a3b0['shift']());}};_0x56c9b7(++_0x1ef3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0xa22320,_0x4f7303){var _0x1c8646=function(_0x58c7ce){while(--_0x58c7ce){_0xa22320['push'](_0xa22320['shift']());}};_0x1c8646(++_0x4f7303);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 fdd089e..ea8570f 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 _0x48bc=['STRING','TEXT','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x48bc,0x1b6));var _0xc48b=function(_0x363b62,_0x4d22dd){_0x363b62=_0x363b62-0x0;var _0x5ded2b=_0x48bc[_0x363b62];return _0x5ded2b;};'use strict';var Sequelize=require(_0xc48b('0x0'));module[_0xc48b('0x1')]={'name':{'type':Sequelize[_0xc48b('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc48b('0x2')]},'metric':{'type':Sequelize[_0xc48b('0x3')]},'description':{'type':Sequelize[_0xc48b('0x2')]}}; \ No newline at end of file +var _0xd757=['name','sequelize','exports','STRING'];(function(_0x505d93,_0x56b600){var _0x15c184=function(_0x243d16){while(--_0x243d16){_0x505d93['push'](_0x505d93['shift']());}};_0x15c184(++_0x56b600);}(_0xd757,0x1e5));var _0x7d75=function(_0x35f806,_0xacce7){_0x35f806=_0x35f806-0x0;var _0x467c3a=_0xd757[_0x35f806];return _0x467c3a;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a896f9e..5430e35 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','sendStatus','end','status','json'];(function(_0x5aca58,_0xe9bc4b){var _0x5de6c6=function(_0x1e8300){while(--_0x1e8300){_0x5aca58['push'](_0x5aca58['shift']());}};_0x5de6c6(++_0xe9bc4b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x58d408,_0x165433){_0x58d408=_0x58d408-0x0;var _0x5047b2=_0xe5b3[_0x58d408];return _0x5047b2;};'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'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,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(_0x17fb1f,_0x5ce003){var _0x58a105=function(_0x4b8013){while(--_0x4b8013){_0x17fb1f['push'](_0x17fb1f['shift']());}};_0x58a105(++_0x5ce003);}(_0x24ca,0x1bc));var _0xa24c=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0x24ca[_0x325501];return _0x2c1626;};'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 9a0ccc8..201f661 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 _0x8917=['define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3bca94,_0x5445d5){var _0x4049c9=function(_0x3a8fa5){while(--_0x3a8fa5){_0x3bca94['push'](_0x3bca94['shift']());}};_0x4049c9(++_0x5445d5);}(_0x8917,0x1d7));var _0x7891=function(_0x18bb0b,_0x5201cd){_0x18bb0b=_0x18bb0b-0x0;var _0x2812c5=_0x8917[_0x18bb0b];return _0x2812c5;};'use strict';var _=require(_0x7891('0x0'));var util=require('util');var logger=require(_0x7891('0x1'))(_0x7891('0x2'));var moment=require(_0x7891('0x3'));var BPromise=require(_0x7891('0x4'));var rp=require(_0x7891('0x5'));var fs=require('fs');var path=require(_0x7891('0x6'));var rimraf=require(_0x7891('0x7'));var config=require(_0x7891('0x8'));var attributes=require(_0x7891('0x9'));module['exports']=function(_0x46b52a,_0x43a48e){return _0x46b52a[_0x7891('0xa')](_0x7891('0xb'),attributes,{'tableName':_0x7891('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf25=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbf25,0x15e));var _0x5bf2=function(_0x4667d2,_0x38491f){_0x4667d2=_0x4667d2-0x0;var _0x281eda=_0xbf25[_0x4667d2];return _0x281eda;};'use strict';var _=require(_0x5bf2('0x0'));var util=require('util');var logger=require(_0x5bf2('0x1'))(_0x5bf2('0x2'));var moment=require(_0x5bf2('0x3'));var BPromise=require(_0x5bf2('0x4'));var rp=require(_0x5bf2('0x5'));var fs=require('fs');var path=require(_0x5bf2('0x6'));var rimraf=require('rimraf');var config=require(_0x5bf2('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x5bf2('0x8')]=function(_0x3f47fd,_0x5ed7d8){return _0x3f47fd[_0x5bf2('0x9')](_0x5bf2('0xa'),attributes,{'tableName':_0x5bf2('0xb'),'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 4e41a55..7543384 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 _0xa092=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x6c40ba,_0x5e39fa){var _0x7a54dd=function(_0x166452){while(--_0x166452){_0x6c40ba['push'](_0x6c40ba['shift']());}};_0x7a54dd(++_0x5e39fa);}(_0xa092,0x1d3));var _0x2a09=function(_0x1b3f63,_0x5578c9){_0x1b3f63=_0x1b3f63-0x0;var _0x39005d=_0xa092[_0x1b3f63];return _0x39005d;};'use strict';var _=require(_0x2a09('0x0'));var util=require(_0x2a09('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a09('0x2'));var fs=require('fs');var Redis=require(_0x2a09('0x3'));var db=require(_0x2a09('0x4'))['db'];var utils=require(_0x2a09('0x5'));var logger=require(_0x2a09('0x6'))('rpc');var config=require(_0x2a09('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f5732,_0x459e6d,_0x986720){return new BPromise(function(_0x26fdea,_0x38d19b){return client['request'](_0x2f5732,_0x986720)[_0x2a09('0x8')](function(_0x828c4){logger[_0x2a09('0x9')](_0x2a09('0xa'),_0x459e6d,_0x2a09('0xb'));logger['debug'](_0x2a09('0xc'),_0x459e6d,_0x2a09('0xb'),JSON[_0x2a09('0xd')](_0x828c4));if(_0x828c4[_0x2a09('0xe')]){if(_0x828c4[_0x2a09('0xe')][_0x2a09('0xf')]===0x1f4){logger[_0x2a09('0xe')](_0x2a09('0xa'),_0x459e6d,_0x828c4[_0x2a09('0xe')][_0x2a09('0x10')]);return _0x38d19b(_0x828c4[_0x2a09('0xe')]['message']);}logger[_0x2a09('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x459e6d,_0x828c4[_0x2a09('0xe')]['message']);return _0x26fdea(_0x828c4[_0x2a09('0xe')][_0x2a09('0x10')]);}else{logger[_0x2a09('0x9')](_0x2a09('0xa'),_0x459e6d,_0x2a09('0xb'));_0x26fdea(_0x828c4[_0x2a09('0x11')][_0x2a09('0x10')]);}})['catch'](function(_0xace625){logger[_0x2a09('0xe')](_0x2a09('0xa'),_0x459e6d,_0xace625);_0x38d19b(_0xace625);});});} \ No newline at end of file +var _0xd0ef=['code','message','result','util','bluebird','ioredis','rpc','../../config/environment','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd0ef,0x8b));var _0xfd0e=function(_0x249c46,_0x1192ed){_0x249c46=_0x249c46-0x0;var _0x4bac35=_0xd0ef[_0x249c46];return _0x4bac35;};'use strict';var _=require('lodash');var util=require(_0xfd0e('0x0'));var moment=require('moment');var BPromise=require(_0xfd0e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd0e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd0e('0x3'));var config=require(_0xfd0e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xfd0e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6aee,_0x557c9f,_0x216752){return new BPromise(function(_0x57928e,_0x2f6585){return client[_0xfd0e('0x6')](_0x5b6aee,_0x216752)['then'](function(_0xcb13c5){logger[_0xfd0e('0x7')](_0xfd0e('0x8'),_0x557c9f,_0xfd0e('0x9'));logger[_0xfd0e('0xa')](_0xfd0e('0xb'),_0x557c9f,_0xfd0e('0x9'),JSON[_0xfd0e('0xc')](_0xcb13c5));if(_0xcb13c5[_0xfd0e('0xd')]){if(_0xcb13c5[_0xfd0e('0xd')][_0xfd0e('0xe')]===0x1f4){logger[_0xfd0e('0xd')](_0xfd0e('0x8'),_0x557c9f,_0xcb13c5['error'][_0xfd0e('0xf')]);return _0x2f6585(_0xcb13c5[_0xfd0e('0xd')][_0xfd0e('0xf')]);}logger[_0xfd0e('0xd')](_0xfd0e('0x8'),_0x557c9f,_0xcb13c5[_0xfd0e('0xd')][_0xfd0e('0xf')]);return _0x57928e(_0xcb13c5[_0xfd0e('0xd')]['message']);}else{logger['info'](_0xfd0e('0x8'),_0x557c9f,_0xfd0e('0x9'));_0x57928e(_0xcb13c5[_0xfd0e('0x10')][_0xfd0e('0xf')]);}})['catch'](function(_0x32a39f){logger[_0xfd0e('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x557c9f,_0x32a39f);_0x2f6585(_0x32a39f);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index dbe1e83..46b32db 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 _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x135652,_0x4f2320){var _0x49e17a=function(_0x5eefe7){while(--_0x5eefe7){_0x135652['push'](_0x135652['shift']());}};_0x49e17a(++_0x4f2320);}(_0x4fd7,0xe6));var _0x74fd=function(_0x1cfdfd,_0x4e09f6){_0x1cfdfd=_0x1cfdfd-0x0;var _0xd09110=_0x4fd7[_0x1cfdfd];return _0xd09110;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router; \ No newline at end of file +var _0x9973=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','create','put','update','delete','destroy'];(function(_0x538ce4,_0x23eb32){var _0x27b2c5=function(_0x185007){while(--_0x185007){_0x538ce4['push'](_0x538ce4['shift']());}};_0x27b2c5(++_0x23eb32);}(_0x9973,0x157));var _0x3997=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9973[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0x3997('0x0'));var path=require(_0x3997('0x1'));var timeout=require('connect-timeout');var express=require(_0x3997('0x2'));var router=express[_0x3997('0x3')]();var fs_extra=require(_0x3997('0x4'));var auth=require(_0x3997('0x5'));var interaction=require(_0x3997('0x6'));var config=require(_0x3997('0x7'));var controller=require(_0x3997('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3997('0x9')]);router[_0x3997('0xa')](_0x3997('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3997('0xc')](),controller[_0x3997('0xd')]);router[_0x3997('0xe')](_0x3997('0xb'),auth[_0x3997('0xc')](),controller[_0x3997('0xf')]);router[_0x3997('0x10')](_0x3997('0xb'),auth[_0x3997('0xc')](),controller[_0x3997('0x11')]);module[_0x3997('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index c95457d..fba073d 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 _0x97dd=['exports','TEXT','sequelize'];(function(_0x22d7ea,_0x557536){var _0x35ccc3=function(_0x2e2b43){while(--_0x2e2b43){_0x22d7ea['push'](_0x22d7ea['shift']());}};_0x35ccc3(++_0x557536);}(_0x97dd,0x71));var _0xd97d=function(_0x205bcb,_0x187305){_0x205bcb=_0x205bcb-0x0;var _0x517b8f=_0x97dd[_0x205bcb];return _0x517b8f;};'use strict';var Sequelize=require(_0xd97d('0x0'));module[_0xd97d('0x1')]={'tree':{'type':Sequelize[_0xd97d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd392=['sequelize','exports'];(function(_0x1c7371,_0x2748ff){var _0x2f34b5=function(_0x1c1a44){while(--_0x1c1a44){_0x1c7371['push'](_0x1c7371['shift']());}};_0x2f34b5(++_0x2748ff);}(_0xd392,0xd8));var _0x2d39=function(_0x2e88bc,_0x584e6e){_0x2e88bc=_0x2e88bc-0x0;var _0x492979=_0xd392[_0x2e88bc];return _0x492979;};'use strict';var Sequelize=require(_0x2d39('0x0'));module[_0x2d39('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index e835ed0..4badb44 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 _0x86d5=['save','update','then','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x86d5,0xb8));var _0x586d=function(_0x12ee31,_0x4fb176){_0x12ee31=_0x12ee31-0x0;var _0x5ede94=_0x86d5[_0x12ee31];return _0x5ede94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x586d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x586d('0x1'));var rp=require(_0x586d('0x2'));var moment=require(_0x586d('0x3'));var BPromise=require(_0x586d('0x4'));var Mustache=require(_0x586d('0x5'));var util=require('util');var path=require(_0x586d('0x6'));var sox=require(_0x586d('0x7'));var csv=require('to-csv');var ejs=require(_0x586d('0x8'));var fs=require('fs');var fs_extra=require(_0x586d('0x9'));var _=require(_0x586d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x586d('0xb'));var deskjs=require(_0x586d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x586d('0xd'));var Papa=require(_0x586d('0xe'));var Redis=require(_0x586d('0xf'));var authService=require(_0x586d('0x10'));var qs=require(_0x586d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x586d('0x12'));var logger=require(_0x586d('0x13'))(_0x586d('0x14'));var utils=require(_0x586d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x586d('0x16'))['db'];function respondWithStatusCode(_0x7f50b9,_0x23c6a6){_0x23c6a6=_0x23c6a6||0xcc;return function(_0x2faa1b){if(_0x2faa1b){return _0x7f50b9[_0x586d('0x17')](_0x23c6a6);}return _0x7f50b9[_0x586d('0x18')](_0x23c6a6)[_0x586d('0x19')]();};}function respondWithResult(_0x2ab4a3,_0x4abf8b){_0x4abf8b=_0x4abf8b||0xc8;return function(_0x377e9d){if(_0x377e9d){return _0x2ab4a3[_0x586d('0x18')](_0x4abf8b)[_0x586d('0x1a')](_0x377e9d);}};}function respondWithFilteredResult(_0x1e715b,_0xc427ad){return function(_0x1c27c6){if(_0x1c27c6){var _0x36ebeb=typeof _0xc427ad[_0x586d('0x1b')]==='undefined'&&typeof _0xc427ad[_0x586d('0x1c')]===_0x586d('0x1d');var _0xac99a0=_0x1c27c6[_0x586d('0x1e')];var _0x83c30a=_0x36ebeb?0x0:_0xc427ad['offset'];var _0x4f08ef=_0x36ebeb?_0x1c27c6[_0x586d('0x1e')]:_0xc427ad[_0x586d('0x1b')]+_0xc427ad['limit'];var _0xc89485;if(_0x4f08ef>=_0xac99a0){_0x4f08ef=_0xac99a0;_0xc89485=0xc8;}else{_0xc89485=0xce;}_0x1e715b['status'](_0xc89485);return _0x1e715b[_0x586d('0x1f')](_0x586d('0x20'),_0x83c30a+'-'+_0x4f08ef+'/'+_0xac99a0)[_0x586d('0x1a')](_0x1c27c6);}return null;};}function patchUpdates(_0x4a98d1){return function(_0x3595bd){try{jsonpatch[_0x586d('0x21')](_0x3595bd,_0x4a98d1,!![]);}catch(_0x5a24bb){return BPromise[_0x586d('0x22')](_0x5a24bb);}return _0x3595bd[_0x586d('0x23')]();};}function saveUpdates(_0x2c89cf,_0x5ed444){return function(_0x13d532){if(_0x13d532){return _0x13d532[_0x586d('0x24')](_0x2c89cf)['then'](function(_0x7f92bb){return _0x7f92bb;});}return null;};}function removeEntity(_0x3cf200,_0x5ccd59){return function(_0x5e7656){if(_0x5e7656){return _0x5e7656['destroy']()[_0x586d('0x25')](function(){_0x3cf200[_0x586d('0x18')](0xcc)[_0x586d('0x19')]();});}};}function handleEntityNotFound(_0x7017d1,_0x1c174a){return function(_0x4f93b1){if(!_0x4f93b1){_0x7017d1[_0x586d('0x17')](0x194);}return _0x4f93b1;};}function handleError(_0x190570,_0x2b0c5f){_0x2b0c5f=_0x2b0c5f||0x1f4;return function(_0x290ade){logger[_0x586d('0x26')](_0x290ade['stack']);if(_0x290ade[_0x586d('0x27')]){delete _0x290ade[_0x586d('0x27')];}_0x190570[_0x586d('0x18')](_0x2b0c5f)['send'](_0x290ade);};}exports['index']=function(_0x2bdd3a,_0x3d0553){var _0x64df75={},_0x223f97={},_0x457d18={'count':0x0,'rows':[]};var _0x2270d9=_[_0x586d('0x28')](db[_0x586d('0x29')][_0x586d('0x2a')],function(_0x5a5df0){return{'name':_0x5a5df0[_0x586d('0x2b')],'type':_0x5a5df0['type'][_0x586d('0x2c')]};});_0x223f97[_0x586d('0x2d')]=_['map'](_0x2270d9,_0x586d('0x27'));_0x223f97[_0x586d('0x2e')]=_[_0x586d('0x2f')](_0x2bdd3a[_0x586d('0x2e')]);_0x223f97[_0x586d('0x30')]=_[_0x586d('0x31')](_0x223f97[_0x586d('0x2d')],_0x223f97[_0x586d('0x2e')]);_0x64df75[_0x586d('0x32')]=_[_0x586d('0x31')](_0x223f97[_0x586d('0x2d')],qs[_0x586d('0x33')](_0x2bdd3a[_0x586d('0x2e')]['fields']));_0x64df75[_0x586d('0x32')]=_0x64df75[_0x586d('0x32')][_0x586d('0x34')]?_0x64df75[_0x586d('0x32')]:_0x223f97[_0x586d('0x2d')];if(!_0x2bdd3a[_0x586d('0x2e')]['hasOwnProperty'](_0x586d('0x35'))){_0x64df75[_0x586d('0x1c')]=qs[_0x586d('0x1c')](_0x2bdd3a['query'][_0x586d('0x1c')]);_0x64df75['offset']=qs[_0x586d('0x1b')](_0x2bdd3a['query'][_0x586d('0x1b')]);}_0x64df75['order']=qs[_0x586d('0x36')](_0x2bdd3a[_0x586d('0x2e')][_0x586d('0x36')]);_0x64df75['where']=qs['filters'](_[_0x586d('0x37')](_0x2bdd3a['query'],_0x223f97[_0x586d('0x30')]),_0x2270d9);if(_0x2bdd3a[_0x586d('0x2e')]['filter']){_0x64df75[_0x586d('0x38')]=_[_0x586d('0x39')](_0x64df75['where'],{'$or':_[_0x586d('0x28')](_0x2270d9,function(_0x423122){if(_0x423122[_0x586d('0x3a')]!==_0x586d('0x3b')){var _0x332e2f={};_0x332e2f[_0x423122[_0x586d('0x27')]]={'$like':'%'+_0x2bdd3a['query'][_0x586d('0x3c')]+'%'};return _0x332e2f;}})});}_0x64df75=_[_0x586d('0x39')]({},_0x64df75,_0x2bdd3a[_0x586d('0x3d')]);var _0x5877ad={'where':_0x64df75[_0x586d('0x38')]};return db['AnalyticTreeReport'][_0x586d('0x1e')](_0x5877ad)['then'](function(_0x3b8b44){_0x457d18['count']=_0x3b8b44;if(_0x2bdd3a['query'][_0x586d('0x3e')]){_0x64df75[_0x586d('0x3f')]=[{'all':!![]}];}return db[_0x586d('0x29')][_0x586d('0x40')](_0x64df75);})[_0x586d('0x25')](function(_0x1968a8){_0x457d18[_0x586d('0x41')]=_0x1968a8;return _0x457d18;})[_0x586d('0x25')](respondWithFilteredResult(_0x3d0553,_0x64df75))[_0x586d('0x42')](handleError(_0x3d0553,null));};exports[_0x586d('0x43')]=function(_0x52a269,_0x51f326){var _0x5a3eb6={'raw':!![],'where':{'id':_0x52a269['params']['id']}},_0x458533={};_0x458533[_0x586d('0x2d')]=_['keys'](db[_0x586d('0x29')]['rawAttributes']);_0x458533[_0x586d('0x2e')]=_[_0x586d('0x2f')](_0x52a269[_0x586d('0x2e')]);_0x458533['filters']=_[_0x586d('0x31')](_0x458533['model'],_0x458533[_0x586d('0x2e')]);_0x5a3eb6['attributes']=_[_0x586d('0x31')](_0x458533['model'],qs[_0x586d('0x33')](_0x52a269['query']['fields']));_0x5a3eb6['attributes']=_0x5a3eb6['attributes'][_0x586d('0x34')]?_0x5a3eb6[_0x586d('0x32')]:_0x458533['model'];if(_0x52a269[_0x586d('0x2e')]['includeAll']){_0x5a3eb6['include']=[{'all':!![]}];}_0x5a3eb6=_[_0x586d('0x39')]({},_0x5a3eb6,_0x52a269[_0x586d('0x3d')]);return db['AnalyticTreeReport'][_0x586d('0x44')](_0x5a3eb6)[_0x586d('0x25')](handleEntityNotFound(_0x51f326,null))[_0x586d('0x25')](respondWithResult(_0x51f326,null))[_0x586d('0x42')](handleError(_0x51f326,null));};exports[_0x586d('0x45')]=function(_0x16450e,_0x2be22c){return db[_0x586d('0x29')][_0x586d('0x45')](_0x16450e['body'],{})[_0x586d('0x25')](respondWithResult(_0x2be22c,0xc9))['catch'](handleError(_0x2be22c,null));};exports[_0x586d('0x24')]=function(_0x40225c,_0x15072c){if(_0x40225c[_0x586d('0x46')]['id']){delete _0x40225c['body']['id'];}return db['AnalyticTreeReport'][_0x586d('0x44')]({'where':{'id':_0x40225c['params']['id']}})[_0x586d('0x25')](handleEntityNotFound(_0x15072c,null))[_0x586d('0x25')](saveUpdates(_0x40225c['body'],null))[_0x586d('0x25')](respondWithResult(_0x15072c,null))[_0x586d('0x42')](handleError(_0x15072c,null));};exports[_0x586d('0x47')]=function(_0x132c68,_0x39d07b){return db[_0x586d('0x29')][_0x586d('0x44')]({'where':{'id':_0x132c68[_0x586d('0x48')]['id']}})[_0x586d('0x25')](handleEntityNotFound(_0x39d07b,null))['then'](removeEntity(_0x39d07b,null))[_0x586d('0x42')](handleError(_0x39d07b,null));}; \ No newline at end of file +var _0x7f79=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','type','key','keys','query','intersection'];(function(_0x2282f1,_0x1a1c3f){var _0x573d4f=function(_0x2c9b08){while(--_0x2c9b08){_0x2282f1['push'](_0x2282f1['shift']());}};_0x573d4f(++_0x1a1c3f);}(_0x7f79,0xf6));var _0x97f7=function(_0x2557ff,_0x1b45dc){_0x2557ff=_0x2557ff-0x0;var _0x34f4a2=_0x7f79[_0x2557ff];return _0x34f4a2;};'use strict';var emlformat=require(_0x97f7('0x0'));var rimraf=require(_0x97f7('0x1'));var zipdir=require(_0x97f7('0x2'));var jsonpatch=require(_0x97f7('0x3'));var rp=require(_0x97f7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x97f7('0x5'));var path=require(_0x97f7('0x6'));var sox=require(_0x97f7('0x7'));var csv=require(_0x97f7('0x8'));var ejs=require(_0x97f7('0x9'));var fs=require('fs');var fs_extra=require(_0x97f7('0xa'));var _=require(_0x97f7('0xb'));var squel=require('squel');var crypto=require(_0x97f7('0xc'));var jsforce=require(_0x97f7('0xd'));var deskjs=require(_0x97f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97f7('0xf'));var Papa=require(_0x97f7('0x10'));var Redis=require(_0x97f7('0x11'));var authService=require(_0x97f7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x97f7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97f7('0x14'));var utils=require(_0x97f7('0x15'));var config=require(_0x97f7('0x16'));var licenseUtil=require(_0x97f7('0x17'));var db=require(_0x97f7('0x18'))['db'];function respondWithStatusCode(_0x48fd4d,_0xff1cb1){_0xff1cb1=_0xff1cb1||0xcc;return function(_0x4cf7d0){if(_0x4cf7d0){return _0x48fd4d[_0x97f7('0x19')](_0xff1cb1);}return _0x48fd4d[_0x97f7('0x1a')](_0xff1cb1)[_0x97f7('0x1b')]();};}function respondWithResult(_0x10a112,_0x27fea7){_0x27fea7=_0x27fea7||0xc8;return function(_0x16c256){if(_0x16c256){return _0x10a112['status'](_0x27fea7)[_0x97f7('0x1c')](_0x16c256);}};}function respondWithFilteredResult(_0x3abe02,_0x318d12){return function(_0x16b2a5){if(_0x16b2a5){var _0x3f2fd6=typeof _0x318d12[_0x97f7('0x1d')]===_0x97f7('0x1e')&&typeof _0x318d12[_0x97f7('0x1f')]==='undefined';var _0x2ad3e1=_0x16b2a5['count'];var _0x7b3a54=_0x3f2fd6?0x0:_0x318d12[_0x97f7('0x1d')];var _0x3960f9=_0x3f2fd6?_0x16b2a5[_0x97f7('0x20')]:_0x318d12[_0x97f7('0x1d')]+_0x318d12[_0x97f7('0x1f')];var _0x1525ea;if(_0x3960f9>=_0x2ad3e1){_0x3960f9=_0x2ad3e1;_0x1525ea=0xc8;}else{_0x1525ea=0xce;}_0x3abe02[_0x97f7('0x1a')](_0x1525ea);return _0x3abe02['set']('Content-Range',_0x7b3a54+'-'+_0x3960f9+'/'+_0x2ad3e1)[_0x97f7('0x1c')](_0x16b2a5);}return null;};}function patchUpdates(_0x247396){return function(_0x500850){try{jsonpatch['apply'](_0x500850,_0x247396,!![]);}catch(_0x513d09){return BPromise[_0x97f7('0x21')](_0x513d09);}return _0x500850[_0x97f7('0x22')]();};}function saveUpdates(_0x203acb,_0x20ff2f){return function(_0x1eecbe){if(_0x1eecbe){return _0x1eecbe[_0x97f7('0x23')](_0x203acb)[_0x97f7('0x24')](function(_0x1013c2){return _0x1013c2;});}return null;};}function removeEntity(_0x57ab95,_0x35b454){return function(_0xba97c7){if(_0xba97c7){return _0xba97c7[_0x97f7('0x25')]()[_0x97f7('0x24')](function(){_0x57ab95[_0x97f7('0x1a')](0xcc)[_0x97f7('0x1b')]();});}};}function handleEntityNotFound(_0x2f6e89,_0x45c015){return function(_0x115b56){if(!_0x115b56){_0x2f6e89[_0x97f7('0x19')](0x194);}return _0x115b56;};}function handleError(_0x22a639,_0x567822){_0x567822=_0x567822||0x1f4;return function(_0x1a0fe4){logger[_0x97f7('0x26')](_0x1a0fe4[_0x97f7('0x27')]);if(_0x1a0fe4[_0x97f7('0x28')]){delete _0x1a0fe4[_0x97f7('0x28')];}_0x22a639[_0x97f7('0x1a')](_0x567822)['send'](_0x1a0fe4);};}exports[_0x97f7('0x29')]=function(_0x2ef3c2,_0x13444a){var _0x5d0311={},_0x1d521f={},_0x22cc83={'count':0x0,'rows':[]};var _0x4a0ece=_[_0x97f7('0x2a')](db[_0x97f7('0x2b')][_0x97f7('0x2c')],function(_0x51e9c0){return{'name':_0x51e9c0['fieldName'],'type':_0x51e9c0[_0x97f7('0x2d')][_0x97f7('0x2e')]};});_0x1d521f['model']=_[_0x97f7('0x2a')](_0x4a0ece,'name');_0x1d521f['query']=_[_0x97f7('0x2f')](_0x2ef3c2[_0x97f7('0x30')]);_0x1d521f['filters']=_[_0x97f7('0x31')](_0x1d521f['model'],_0x1d521f['query']);_0x5d0311[_0x97f7('0x32')]=_['intersection'](_0x1d521f[_0x97f7('0x33')],qs['fields'](_0x2ef3c2['query'][_0x97f7('0x34')]));_0x5d0311['attributes']=_0x5d0311[_0x97f7('0x32')][_0x97f7('0x35')]?_0x5d0311[_0x97f7('0x32')]:_0x1d521f[_0x97f7('0x33')];if(!_0x2ef3c2[_0x97f7('0x30')][_0x97f7('0x36')](_0x97f7('0x37'))){_0x5d0311[_0x97f7('0x1f')]=qs[_0x97f7('0x1f')](_0x2ef3c2['query'][_0x97f7('0x1f')]);_0x5d0311[_0x97f7('0x1d')]=qs[_0x97f7('0x1d')](_0x2ef3c2[_0x97f7('0x30')][_0x97f7('0x1d')]);}_0x5d0311[_0x97f7('0x38')]=qs[_0x97f7('0x39')](_0x2ef3c2[_0x97f7('0x30')][_0x97f7('0x39')]);_0x5d0311[_0x97f7('0x3a')]=qs['filters'](_[_0x97f7('0x3b')](_0x2ef3c2['query'],_0x1d521f[_0x97f7('0x3c')]),_0x4a0ece);if(_0x2ef3c2[_0x97f7('0x30')][_0x97f7('0x3d')]){_0x5d0311[_0x97f7('0x3a')]=_[_0x97f7('0x3e')](_0x5d0311[_0x97f7('0x3a')],{'$or':_[_0x97f7('0x2a')](_0x4a0ece,function(_0x219435){if(_0x219435['type']!=='VIRTUAL'){var _0x56ca79={};_0x56ca79[_0x219435[_0x97f7('0x28')]]={'$like':'%'+_0x2ef3c2['query'][_0x97f7('0x3d')]+'%'};return _0x56ca79;}})});}_0x5d0311=_[_0x97f7('0x3e')]({},_0x5d0311,_0x2ef3c2[_0x97f7('0x3f')]);var _0xabc2ab={'where':_0x5d0311['where']};return db[_0x97f7('0x2b')][_0x97f7('0x20')](_0xabc2ab)[_0x97f7('0x24')](function(_0x2ef41b){_0x22cc83[_0x97f7('0x20')]=_0x2ef41b;if(_0x2ef3c2[_0x97f7('0x30')][_0x97f7('0x40')]){_0x5d0311[_0x97f7('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x97f7('0x42')](_0x5d0311);})[_0x97f7('0x24')](function(_0x3072b8){_0x22cc83[_0x97f7('0x43')]=_0x3072b8;return _0x22cc83;})['then'](respondWithFilteredResult(_0x13444a,_0x5d0311))[_0x97f7('0x44')](handleError(_0x13444a,null));};exports[_0x97f7('0x45')]=function(_0x53d660,_0x4d4146){var _0x3db242={'raw':!![],'where':{'id':_0x53d660['params']['id']}},_0x511821={};_0x511821[_0x97f7('0x33')]=_[_0x97f7('0x2f')](db[_0x97f7('0x2b')][_0x97f7('0x2c')]);_0x511821[_0x97f7('0x30')]=_['keys'](_0x53d660[_0x97f7('0x30')]);_0x511821['filters']=_[_0x97f7('0x31')](_0x511821[_0x97f7('0x33')],_0x511821['query']);_0x3db242[_0x97f7('0x32')]=_['intersection'](_0x511821[_0x97f7('0x33')],qs[_0x97f7('0x34')](_0x53d660[_0x97f7('0x30')][_0x97f7('0x34')]));_0x3db242[_0x97f7('0x32')]=_0x3db242['attributes']['length']?_0x3db242[_0x97f7('0x32')]:_0x511821[_0x97f7('0x33')];if(_0x53d660[_0x97f7('0x30')]['includeAll']){_0x3db242[_0x97f7('0x41')]=[{'all':!![]}];}_0x3db242=_['merge']({},_0x3db242,_0x53d660[_0x97f7('0x3f')]);return db[_0x97f7('0x2b')][_0x97f7('0x46')](_0x3db242)['then'](handleEntityNotFound(_0x4d4146,null))[_0x97f7('0x24')](respondWithResult(_0x4d4146,null))['catch'](handleError(_0x4d4146,null));};exports[_0x97f7('0x47')]=function(_0x4730ed,_0x20a70d){return db[_0x97f7('0x2b')][_0x97f7('0x47')](_0x4730ed[_0x97f7('0x48')],{})[_0x97f7('0x24')](respondWithResult(_0x20a70d,0xc9))[_0x97f7('0x44')](handleError(_0x20a70d,null));};exports[_0x97f7('0x23')]=function(_0x1b88e9,_0x176fda){if(_0x1b88e9['body']['id']){delete _0x1b88e9[_0x97f7('0x48')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x1b88e9['params']['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x176fda,null))[_0x97f7('0x24')](saveUpdates(_0x1b88e9[_0x97f7('0x48')],null))[_0x97f7('0x24')](respondWithResult(_0x176fda,null))['catch'](handleError(_0x176fda,null));};exports[_0x97f7('0x25')]=function(_0x49bb2d,_0x43983f){return db['AnalyticTreeReport'][_0x97f7('0x46')]({'where':{'id':_0x49bb2d[_0x97f7('0x49')]['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x43983f,null))['then'](removeEntity(_0x43983f,null))['catch'](handleError(_0x43983f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 77c592f..0106073 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 _0xbbfc=['util','../../config/logger','api','moment','bluebird','request-promise','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbfc,0x82));var _0xcbbf=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xbbfc[_0x277af0];return _0x43bd7c;};'use strict';var _=require('lodash');var util=require(_0xcbbf('0x0'));var logger=require(_0xcbbf('0x1'))(_0xcbbf('0x2'));var moment=require(_0xcbbf('0x3'));var BPromise=require(_0xcbbf('0x4'));var rp=require(_0xcbbf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbbf('0x6'));module[_0xcbbf('0x7')]=function(_0x77b3fe,_0x44d400){return _0x77b3fe['define'](_0xcbbf('0x8'),attributes,{'tableName':_0xcbbf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a6d=['request-promise','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','bluebird'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9a6d,0x178));var _0xd9a6=function(_0x336986,_0x54dcc4){_0x336986=_0x336986-0x0;var _0xa3325d=_0x9a6d[_0x336986];return _0xa3325d;};'use strict';var _=require(_0xd9a6('0x0'));var util=require(_0xd9a6('0x1'));var logger=require(_0xd9a6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd9a6('0x3'));var rp=require(_0xd9a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd9a6('0x5'));var attributes=require(_0xd9a6('0x6'));module[_0xd9a6('0x7')]=function(_0x458c9f,_0x207264){return _0x458c9f[_0xd9a6('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xd9a6('0x9'),'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 663b8c1..e82fb78 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x6243bb,_0x269bd7){var _0x16ef17=function(_0x5771f1){while(--_0x5771f1){_0x6243bb['push'](_0x6243bb['shift']());}};_0x16ef17(++_0x269bd7);}(_0x2ef3,0xba));var _0x32ef=function(_0x4eac29,_0x2b4300){_0x4eac29=_0x4eac29-0x0;var _0x238dfe=_0x2ef3[_0x4eac29];return _0x238dfe;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xadb5,0xad));var _0x5adb=function(_0x119e8d,_0x334dd){_0x119e8d=_0x119e8d-0x0;var _0x5a3ca5=_0xadb5[_0x119e8d];return _0x5a3ca5;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index ad01c3c..34504a0 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 _0x89db=['put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x37f85c,_0x47b996){var _0x30c9da=function(_0x3ba669){while(--_0x3ba669){_0x37f85c['push'](_0x37f85c['shift']());}};_0x30c9da(++_0x47b996);}(_0x89db,0x101));var _0xb89d=function(_0x177de5,_0x7de17b){_0x177de5=_0x177de5-0x0;var _0x86f211=_0x89db[_0x177de5];return _0x86f211;};'use strict';var multer=require('multer');var util=require(_0xb89d('0x0'));var path=require(_0xb89d('0x1'));var timeout=require(_0xb89d('0x2'));var express=require(_0xb89d('0x3'));var router=express[_0xb89d('0x4')]();var fs_extra=require(_0xb89d('0x5'));var auth=require(_0xb89d('0x6'));var interaction=require(_0xb89d('0x7'));var config=require(_0xb89d('0x8'));var controller=require(_0xb89d('0x9'));router[_0xb89d('0xa')]('/',auth[_0xb89d('0xb')](),controller[_0xb89d('0xc')]);router[_0xb89d('0xa')](_0xb89d('0xd'),auth[_0xb89d('0xb')](),controller[_0xb89d('0xe')]);router['post']('/',auth[_0xb89d('0xb')](),controller['create']);router[_0xb89d('0xf')]('/:id',auth[_0xb89d('0xb')](),controller[_0xb89d('0x10')]);router['delete'](_0xb89d('0xd'),auth[_0xb89d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbdcb=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x434054,_0x2adbb2){var _0x2209f7=function(_0x32d5d2){while(--_0x32d5d2){_0x434054['push'](_0x434054['shift']());}};_0x2209f7(++_0x2adbb2);}(_0xbdcb,0x161));var _0xbbdc=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xbdcb[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0xbbdc('0x0'));var path=require(_0xbbdc('0x1'));var timeout=require(_0xbbdc('0x2'));var express=require(_0xbbdc('0x3'));var router=express['Router']();var fs_extra=require(_0xbbdc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbbdc('0x5'));var config=require(_0xbbdc('0x6'));var controller=require(_0xbbdc('0x7'));router[_0xbbdc('0x8')]('/',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xa')]);router[_0xbbdc('0x8')](_0xbbdc('0xb'),auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbbdc('0xd')]('/:id',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xe')]);router[_0xbbdc('0xf')](_0xbbdc('0xb'),auth['isAuthenticated'](),controller[_0xbbdc('0x10')]);module[_0xbbdc('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 307aede..bc16472 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 _0x95d9=['STRING','sequelize','exports'];(function(_0x49d21f,_0x6e7f5){var _0x1b93f2=function(_0x1cd8e7){while(--_0x1cd8e7){_0x49d21f['push'](_0x49d21f['shift']());}};_0x1b93f2(++_0x6e7f5);}(_0x95d9,0x97));var _0x995d=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x95d9[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x995d('0x0'));module[_0x995d('0x1')]={'name':{'type':Sequelize[_0x995d('0x2')]},'basename':{'type':Sequelize[_0x995d('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf53f=['sequelize','exports','STRING'];(function(_0x5c3bca,_0xf0623e){var _0x17bff5=function(_0x14293c){while(--_0x14293c){_0x5c3bca['push'](_0x5c3bca['shift']());}};_0x17bff5(++_0xf0623e);}(_0xf53f,0x8d));var _0xff53=function(_0x263896,_0x209331){_0x263896=_0x263896-0x0;var _0x15a568=_0xf53f[_0x263896];return _0x15a568;};'use strict';var Sequelize=require(_0xff53('0x0'));module[_0xff53('0x1')]={'name':{'type':Sequelize[_0xff53('0x2')]},'basename':{'type':Sequelize[_0xff53('0x2')]},'type':{'type':Sequelize[_0xff53('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2f4302b..8f427f0 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 _0x73b3=['keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query'];(function(_0x558fe9,_0x1ca3f7){var _0x554d2a=function(_0x16895a){while(--_0x16895a){_0x558fe9['push'](_0x558fe9['shift']());}};_0x554d2a(++_0x1ca3f7);}(_0x73b3,0x82));var _0x373b=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x73b3[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0x373b('0x0'));var rimraf=require(_0x373b('0x1'));var zipdir=require(_0x373b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x373b('0x3'));var moment=require('moment');var BPromise=require(_0x373b('0x4'));var Mustache=require(_0x373b('0x5'));var util=require('util');var path=require(_0x373b('0x6'));var sox=require(_0x373b('0x7'));var csv=require(_0x373b('0x8'));var ejs=require(_0x373b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x373b('0xa'));var squel=require(_0x373b('0xb'));var crypto=require(_0x373b('0xc'));var jsforce=require(_0x373b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x373b('0xe'));var Papa=require(_0x373b('0xf'));var Redis=require('ioredis');var authService=require(_0x373b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x373b('0x11'));var hardwareService=require(_0x373b('0x12'));var logger=require(_0x373b('0x13'))(_0x373b('0x14'));var utils=require('../../config/utils');var config=require(_0x373b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x373b('0x16'))['db'];function respondWithStatusCode(_0x2ca878,_0x2fda51){_0x2fda51=_0x2fda51||0xcc;return function(_0x12277d){if(_0x12277d){return _0x2ca878['sendStatus'](_0x2fda51);}return _0x2ca878[_0x373b('0x17')](_0x2fda51)[_0x373b('0x18')]();};}function respondWithResult(_0x4cb186,_0x1cf216){_0x1cf216=_0x1cf216||0xc8;return function(_0x20c8b5){if(_0x20c8b5){return _0x4cb186[_0x373b('0x17')](_0x1cf216)[_0x373b('0x19')](_0x20c8b5);}};}function respondWithFilteredResult(_0x425074,_0x7fa2d0){return function(_0x3ce803){if(_0x3ce803){var _0x1a0378=typeof _0x7fa2d0[_0x373b('0x1a')]==='undefined'&&typeof _0x7fa2d0['limit']===_0x373b('0x1b');var _0x328114=_0x3ce803[_0x373b('0x1c')];var _0x5ab218=_0x1a0378?0x0:_0x7fa2d0[_0x373b('0x1a')];var _0x973f23=_0x1a0378?_0x3ce803[_0x373b('0x1c')]:_0x7fa2d0[_0x373b('0x1a')]+_0x7fa2d0[_0x373b('0x1d')];var _0x24daf5;if(_0x973f23>=_0x328114){_0x973f23=_0x328114;_0x24daf5=0xc8;}else{_0x24daf5=0xce;}_0x425074[_0x373b('0x17')](_0x24daf5);return _0x425074[_0x373b('0x1e')]('Content-Range',_0x5ab218+'-'+_0x973f23+'/'+_0x328114)[_0x373b('0x19')](_0x3ce803);}return null;};}function patchUpdates(_0x7834ce){return function(_0x118a0d){try{jsonpatch[_0x373b('0x1f')](_0x118a0d,_0x7834ce,!![]);}catch(_0x439aea){return BPromise[_0x373b('0x20')](_0x439aea);}return _0x118a0d['save']();};}function saveUpdates(_0x3e5197,_0x502cf7){return function(_0x1d2684){if(_0x1d2684){return _0x1d2684[_0x373b('0x21')](_0x3e5197)[_0x373b('0x22')](function(_0x213686){return _0x213686;});}return null;};}function removeEntity(_0x4ec9ba,_0x3a4273){return function(_0x23be95){if(_0x23be95){return _0x23be95[_0x373b('0x23')]()['then'](function(){_0x4ec9ba['status'](0xcc)[_0x373b('0x18')]();});}};}function handleEntityNotFound(_0x23528a,_0x209f17){return function(_0x5311f5){if(!_0x5311f5){_0x23528a[_0x373b('0x24')](0x194);}return _0x5311f5;};}function handleError(_0x5f2fa7,_0x106144){_0x106144=_0x106144||0x1f4;return function(_0x2b251c){logger[_0x373b('0x25')](_0x2b251c[_0x373b('0x26')]);if(_0x2b251c[_0x373b('0x27')]){delete _0x2b251c[_0x373b('0x27')];}_0x5f2fa7[_0x373b('0x17')](_0x106144)[_0x373b('0x28')](_0x2b251c);};}exports[_0x373b('0x29')]=function(_0x5398c5,_0x1a6b9e){var _0x117eca={},_0x8692ce={},_0x114551={'count':0x0,'rows':[]};var _0xca40de=_[_0x373b('0x2a')](db[_0x373b('0x2b')][_0x373b('0x2c')],function(_0x45d1d1){return{'name':_0x45d1d1[_0x373b('0x2d')],'type':_0x45d1d1[_0x373b('0x2e')][_0x373b('0x2f')]};});_0x8692ce[_0x373b('0x30')]=_[_0x373b('0x2a')](_0xca40de,_0x373b('0x27'));_0x8692ce[_0x373b('0x31')]=_[_0x373b('0x32')](_0x5398c5[_0x373b('0x31')]);_0x8692ce[_0x373b('0x33')]=_[_0x373b('0x34')](_0x8692ce[_0x373b('0x30')],_0x8692ce[_0x373b('0x31')]);_0x117eca[_0x373b('0x35')]=_[_0x373b('0x34')](_0x8692ce[_0x373b('0x30')],qs[_0x373b('0x36')](_0x5398c5['query'][_0x373b('0x36')]));_0x117eca[_0x373b('0x35')]=_0x117eca[_0x373b('0x35')][_0x373b('0x37')]?_0x117eca['attributes']:_0x8692ce[_0x373b('0x30')];if(!_0x5398c5[_0x373b('0x31')]['hasOwnProperty'](_0x373b('0x38'))){_0x117eca[_0x373b('0x1d')]=qs[_0x373b('0x1d')](_0x5398c5[_0x373b('0x31')][_0x373b('0x1d')]);_0x117eca['offset']=qs[_0x373b('0x1a')](_0x5398c5[_0x373b('0x31')][_0x373b('0x1a')]);}_0x117eca[_0x373b('0x39')]=qs[_0x373b('0x3a')](_0x5398c5[_0x373b('0x31')][_0x373b('0x3a')]);_0x117eca[_0x373b('0x3b')]=qs[_0x373b('0x33')](_[_0x373b('0x3c')](_0x5398c5['query'],_0x8692ce[_0x373b('0x33')]),_0xca40de);if(_0x5398c5[_0x373b('0x31')][_0x373b('0x3d')]){_0x117eca[_0x373b('0x3b')]=_[_0x373b('0x3e')](_0x117eca[_0x373b('0x3b')],{'$or':_[_0x373b('0x2a')](_0xca40de,function(_0xc90bdf){if(_0xc90bdf[_0x373b('0x2e')]!==_0x373b('0x3f')){var _0x3feae3={};_0x3feae3[_0xc90bdf[_0x373b('0x27')]]={'$like':'%'+_0x5398c5['query'][_0x373b('0x3d')]+'%'};return _0x3feae3;}})});}_0x117eca=_[_0x373b('0x3e')]({},_0x117eca,_0x5398c5[_0x373b('0x40')]);var _0x391d22={'where':_0x117eca[_0x373b('0x3b')]};return db[_0x373b('0x2b')][_0x373b('0x1c')](_0x391d22)[_0x373b('0x22')](function(_0x269b52){_0x114551[_0x373b('0x1c')]=_0x269b52;if(_0x5398c5[_0x373b('0x31')]['includeAll']){_0x117eca[_0x373b('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x373b('0x42')](_0x117eca);})[_0x373b('0x22')](function(_0x26bb98){_0x114551[_0x373b('0x43')]=_0x26bb98;return _0x114551;})['then'](respondWithFilteredResult(_0x1a6b9e,_0x117eca))[_0x373b('0x44')](handleError(_0x1a6b9e,null));};exports['show']=function(_0x51cae0,_0x128959){var _0x3b1f07={'raw':!![],'where':{'id':_0x51cae0[_0x373b('0x45')]['id']}},_0x486b26={};_0x486b26[_0x373b('0x30')]=_[_0x373b('0x32')](db[_0x373b('0x2b')]['rawAttributes']);_0x486b26[_0x373b('0x31')]=_[_0x373b('0x32')](_0x51cae0[_0x373b('0x31')]);_0x486b26[_0x373b('0x33')]=_['intersection'](_0x486b26[_0x373b('0x30')],_0x486b26['query']);_0x3b1f07['attributes']=_[_0x373b('0x34')](_0x486b26[_0x373b('0x30')],qs['fields'](_0x51cae0[_0x373b('0x31')]['fields']));_0x3b1f07[_0x373b('0x35')]=_0x3b1f07[_0x373b('0x35')][_0x373b('0x37')]?_0x3b1f07[_0x373b('0x35')]:_0x486b26[_0x373b('0x30')];if(_0x51cae0[_0x373b('0x31')][_0x373b('0x46')]){_0x3b1f07[_0x373b('0x41')]=[{'all':!![]}];}_0x3b1f07=_[_0x373b('0x3e')]({},_0x3b1f07,_0x51cae0[_0x373b('0x40')]);return db['Attachment'][_0x373b('0x47')](_0x3b1f07)[_0x373b('0x22')](handleEntityNotFound(_0x128959,null))[_0x373b('0x22')](respondWithResult(_0x128959,null))['catch'](handleError(_0x128959,null));};exports['clone']=function(_0x17e02d,_0x4cacd2){var _0x49aae2={'where':{'id':_0x17e02d[_0x373b('0x45')]['id']}},_0x416f20={};_0x416f20[_0x373b('0x30')]=_[_0x373b('0x32')](db[_0x373b('0x2b')]['rawAttributes']);_0x49aae2['attributes']=_[_0x373b('0x34')](_0x416f20[_0x373b('0x30')],qs[_0x373b('0x36')](_0x17e02d[_0x373b('0x31')][_0x373b('0x36')]));_0x49aae2['attributes']=_0x49aae2['attributes'][_0x373b('0x37')]?_0x49aae2['attributes']:_0x416f20[_0x373b('0x30')];if(_0x17e02d[_0x373b('0x31')]['includeAll']){_0x49aae2[_0x373b('0x41')]=[{'all':!![]}];}_0x49aae2=_[_0x373b('0x3e')]({},_0x49aae2,_0x17e02d[_0x373b('0x40')]);return db['Attachment'][_0x373b('0x47')](_0x49aae2)['then'](handleEntityNotFound(_0x4cacd2,null))[_0x373b('0x22')](function(_0xe4c800){if(_0xe4c800){var _0x2fb243=_0xe4c800[_0x373b('0x48')]({'plain':!![]});_0x2fb243=qs[_0x373b('0x49')](_0x2fb243,['id',_0x373b('0x4a'),_0x373b('0x4b')]);_0x17e02d[_0x373b('0x4c')]=_[_0x373b('0x49')](_0x17e02d['body'],['id',_0x373b('0x4a'),_0x373b('0x4b')]);return db[_0x373b('0x2b')][_0x373b('0x4d')](_['merge'](_0x2fb243,_0x17e02d[_0x373b('0x4c')]),{'include':_0x17e02d['query'][_0x373b('0x46')]?[{'all':!![]}]:undefined});}})[_0x373b('0x22')](respondWithResult(_0x4cacd2,0xc9))['catch'](handleError(_0x4cacd2,null));};exports[_0x373b('0x21')]=function(_0x305c97,_0x46bca0){if(_0x305c97[_0x373b('0x4c')]['id']){delete _0x305c97[_0x373b('0x4c')]['id'];}return db[_0x373b('0x2b')]['find']({'where':{'id':_0x305c97[_0x373b('0x45')]['id']}})[_0x373b('0x22')](handleEntityNotFound(_0x46bca0,null))[_0x373b('0x22')](saveUpdates(_0x305c97[_0x373b('0x4c')],null))['then'](respondWithResult(_0x46bca0,null))[_0x373b('0x44')](handleError(_0x46bca0,null));};exports[_0x373b('0x23')]=function(_0x359c74,_0x397d50){return db[_0x373b('0x2b')][_0x373b('0x47')]({'where':{'id':_0x359c74[_0x373b('0x45')]['id']}})[_0x373b('0x22')](handleEntityNotFound(_0x397d50,null))['then'](removeEntity(_0x397d50,null))[_0x373b('0x44')](handleError(_0x397d50,null));};exports[_0x373b('0x4d')]=function(_0x5555ad,_0xf05ce,_0x917137){_0x5555ad[_0x373b('0x4c')][_0x373b('0x27')]=_0x5555ad['file'][_0x373b('0x4e')];_0x5555ad[_0x373b('0x4c')][_0x373b('0x4f')]=_0x5555ad[_0x373b('0x50')][_0x373b('0x51')];_0x5555ad[_0x373b('0x4c')][_0x373b('0x2e')]=_0x5555ad[_0x373b('0x50')][_0x373b('0x52')];return db[_0x373b('0x2b')][_0x373b('0x4d')](_0x5555ad[_0x373b('0x4c')])['then'](respondWithResult(_0xf05ce,0xc9))['catch'](handleError(_0xf05ce,null));};exports[_0x373b('0x53')]=function(_0x5de6d6,_0x2ecf5d,_0x42e946){return db[_0x373b('0x2b')][_0x373b('0x54')]({'where':{'id':_0x5de6d6['params']['id']},'raw':!![]})[_0x373b('0x22')](handleEntityNotFound(_0x2ecf5d,null))[_0x373b('0x22')](function(_0xd54f31){if(_0xd54f31){var _0x1a1090=_0xd54f31[_0x373b('0x55')]!==null;var _0x2f60db=path['join'](config[_0x373b('0x56')],_0x373b('0x57'));if(_0x1a1090){_0x2f60db=path[_0x373b('0x58')](_0x2f60db,_0x373b('0x59'));}var _0x6f5962=path[_0x373b('0x58')](_0x2f60db,_0xd54f31[_0x373b('0x4f')]);return _0x2ecf5d['download'](_0x6f5962);}})[_0x373b('0x44')](handleError(_0x2ecf5d,null));}; \ No newline at end of file +var _0xf6bd=['include','findAll','rows','catch','show','params','find','clone','get','createdAt','updatedAt','body','omit','create','file','basename','filename','mimetype','findOne','join','root','server/files/attachments/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','keys','filters','model','query','intersection','fields','length','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x5e7fd6,_0x577578){var _0x3cb0a4=function(_0x4d23c6){while(--_0x4d23c6){_0x5e7fd6['push'](_0x5e7fd6['shift']());}};_0x3cb0a4(++_0x577578);}(_0xf6bd,0x1d4));var _0xdf6b=function(_0x529351,_0x3ac704){_0x529351=_0x529351-0x0;var _0x41cd56=_0xf6bd[_0x529351];return _0x41cd56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf6b('0x0'));var zipdir=require(_0xdf6b('0x1'));var jsonpatch=require(_0xdf6b('0x2'));var rp=require(_0xdf6b('0x3'));var moment=require(_0xdf6b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf6b('0x5'));var util=require('util');var path=require(_0xdf6b('0x6'));var sox=require('sox');var csv=require(_0xdf6b('0x7'));var ejs=require(_0xdf6b('0x8'));var fs=require('fs');var fs_extra=require(_0xdf6b('0x9'));var _=require(_0xdf6b('0xa'));var squel=require(_0xdf6b('0xb'));var crypto=require(_0xdf6b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf6b('0x7'));var querystring=require('querystring');var Papa=require(_0xdf6b('0xd'));var Redis=require('ioredis');var authService=require(_0xdf6b('0xe'));var qs=require(_0xdf6b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf6b('0x10'));var logger=require(_0xdf6b('0x11'))('api');var utils=require(_0xdf6b('0x12'));var config=require(_0xdf6b('0x13'));var licenseUtil=require(_0xdf6b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ab943,_0x3c0d04){_0x3c0d04=_0x3c0d04||0xcc;return function(_0xef595b){if(_0xef595b){return _0x2ab943[_0xdf6b('0x15')](_0x3c0d04);}return _0x2ab943[_0xdf6b('0x16')](_0x3c0d04)[_0xdf6b('0x17')]();};}function respondWithResult(_0x4ddb70,_0x42b493){_0x42b493=_0x42b493||0xc8;return function(_0x5f13b1){if(_0x5f13b1){return _0x4ddb70['status'](_0x42b493)[_0xdf6b('0x18')](_0x5f13b1);}};}function respondWithFilteredResult(_0x23d10c,_0x2af757){return function(_0x33515a){if(_0x33515a){var _0x368edd=typeof _0x2af757['offset']===_0xdf6b('0x19')&&typeof _0x2af757[_0xdf6b('0x1a')]===_0xdf6b('0x19');var _0x298b2e=_0x33515a['count'];var _0x4a2886=_0x368edd?0x0:_0x2af757[_0xdf6b('0x1b')];var _0x870a27=_0x368edd?_0x33515a[_0xdf6b('0x1c')]:_0x2af757[_0xdf6b('0x1b')]+_0x2af757[_0xdf6b('0x1a')];var _0x520b6e;if(_0x870a27>=_0x298b2e){_0x870a27=_0x298b2e;_0x520b6e=0xc8;}else{_0x520b6e=0xce;}_0x23d10c[_0xdf6b('0x16')](_0x520b6e);return _0x23d10c[_0xdf6b('0x1d')](_0xdf6b('0x1e'),_0x4a2886+'-'+_0x870a27+'/'+_0x298b2e)['json'](_0x33515a);}return null;};}function patchUpdates(_0x3e59dc){return function(_0x3a694a){try{jsonpatch[_0xdf6b('0x1f')](_0x3a694a,_0x3e59dc,!![]);}catch(_0x613cba){return BPromise[_0xdf6b('0x20')](_0x613cba);}return _0x3a694a[_0xdf6b('0x21')]();};}function saveUpdates(_0x1f0bf2,_0x1e5528){return function(_0x2122f7){if(_0x2122f7){return _0x2122f7[_0xdf6b('0x22')](_0x1f0bf2)[_0xdf6b('0x23')](function(_0x3318c2){return _0x3318c2;});}return null;};}function removeEntity(_0x45e899,_0x7261a9){return function(_0x2f613b){if(_0x2f613b){return _0x2f613b[_0xdf6b('0x24')]()[_0xdf6b('0x23')](function(){_0x45e899[_0xdf6b('0x16')](0xcc)[_0xdf6b('0x17')]();});}};}function handleEntityNotFound(_0x106604,_0x49032d){return function(_0x1ecf85){if(!_0x1ecf85){_0x106604[_0xdf6b('0x15')](0x194);}return _0x1ecf85;};}function handleError(_0x42fd2d,_0x11dada){_0x11dada=_0x11dada||0x1f4;return function(_0x1d2226){logger[_0xdf6b('0x25')](_0x1d2226[_0xdf6b('0x26')]);if(_0x1d2226[_0xdf6b('0x27')]){delete _0x1d2226['name'];}_0x42fd2d[_0xdf6b('0x16')](_0x11dada)[_0xdf6b('0x28')](_0x1d2226);};}exports[_0xdf6b('0x29')]=function(_0x263cae,_0x5c59b6){var _0x595bc9={},_0x137386={},_0x495120={'count':0x0,'rows':[]};var _0x2291a6=_[_0xdf6b('0x2a')](db[_0xdf6b('0x2b')][_0xdf6b('0x2c')],function(_0x24cb53){return{'name':_0x24cb53[_0xdf6b('0x2d')],'type':_0x24cb53[_0xdf6b('0x2e')][_0xdf6b('0x2f')]};});_0x137386['model']=_[_0xdf6b('0x2a')](_0x2291a6,_0xdf6b('0x27'));_0x137386['query']=_[_0xdf6b('0x30')](_0x263cae['query']);_0x137386[_0xdf6b('0x31')]=_['intersection'](_0x137386[_0xdf6b('0x32')],_0x137386[_0xdf6b('0x33')]);_0x595bc9['attributes']=_[_0xdf6b('0x34')](_0x137386[_0xdf6b('0x32')],qs[_0xdf6b('0x35')](_0x263cae[_0xdf6b('0x33')][_0xdf6b('0x35')]));_0x595bc9['attributes']=_0x595bc9['attributes'][_0xdf6b('0x36')]?_0x595bc9[_0xdf6b('0x37')]:_0x137386[_0xdf6b('0x32')];if(!_0x263cae[_0xdf6b('0x33')]['hasOwnProperty'](_0xdf6b('0x38'))){_0x595bc9[_0xdf6b('0x1a')]=qs[_0xdf6b('0x1a')](_0x263cae['query']['limit']);_0x595bc9[_0xdf6b('0x1b')]=qs[_0xdf6b('0x1b')](_0x263cae[_0xdf6b('0x33')][_0xdf6b('0x1b')]);}_0x595bc9[_0xdf6b('0x39')]=qs[_0xdf6b('0x3a')](_0x263cae[_0xdf6b('0x33')]['sort']);_0x595bc9[_0xdf6b('0x3b')]=qs[_0xdf6b('0x31')](_[_0xdf6b('0x3c')](_0x263cae[_0xdf6b('0x33')],_0x137386[_0xdf6b('0x31')]),_0x2291a6);if(_0x263cae[_0xdf6b('0x33')]['filter']){_0x595bc9[_0xdf6b('0x3b')]=_[_0xdf6b('0x3d')](_0x595bc9[_0xdf6b('0x3b')],{'$or':_[_0xdf6b('0x2a')](_0x2291a6,function(_0x44b06e){if(_0x44b06e[_0xdf6b('0x2e')]!==_0xdf6b('0x3e')){var _0x51fa52={};_0x51fa52[_0x44b06e[_0xdf6b('0x27')]]={'$like':'%'+_0x263cae[_0xdf6b('0x33')][_0xdf6b('0x3f')]+'%'};return _0x51fa52;}})});}_0x595bc9=_[_0xdf6b('0x3d')]({},_0x595bc9,_0x263cae[_0xdf6b('0x40')]);var _0x509a77={'where':_0x595bc9[_0xdf6b('0x3b')]};return db[_0xdf6b('0x2b')][_0xdf6b('0x1c')](_0x509a77)[_0xdf6b('0x23')](function(_0x182304){_0x495120[_0xdf6b('0x1c')]=_0x182304;if(_0x263cae[_0xdf6b('0x33')][_0xdf6b('0x41')]){_0x595bc9[_0xdf6b('0x42')]=[{'all':!![]}];}return db[_0xdf6b('0x2b')][_0xdf6b('0x43')](_0x595bc9);})['then'](function(_0x29f720){_0x495120[_0xdf6b('0x44')]=_0x29f720;return _0x495120;})['then'](respondWithFilteredResult(_0x5c59b6,_0x595bc9))[_0xdf6b('0x45')](handleError(_0x5c59b6,null));};exports[_0xdf6b('0x46')]=function(_0x212d6e,_0x5c184f){var _0x7e9f13={'raw':!![],'where':{'id':_0x212d6e[_0xdf6b('0x47')]['id']}},_0x4e0492={};_0x4e0492[_0xdf6b('0x32')]=_[_0xdf6b('0x30')](db['Attachment']['rawAttributes']);_0x4e0492[_0xdf6b('0x33')]=_[_0xdf6b('0x30')](_0x212d6e[_0xdf6b('0x33')]);_0x4e0492['filters']=_['intersection'](_0x4e0492[_0xdf6b('0x32')],_0x4e0492[_0xdf6b('0x33')]);_0x7e9f13[_0xdf6b('0x37')]=_['intersection'](_0x4e0492[_0xdf6b('0x32')],qs[_0xdf6b('0x35')](_0x212d6e[_0xdf6b('0x33')][_0xdf6b('0x35')]));_0x7e9f13[_0xdf6b('0x37')]=_0x7e9f13[_0xdf6b('0x37')][_0xdf6b('0x36')]?_0x7e9f13['attributes']:_0x4e0492[_0xdf6b('0x32')];if(_0x212d6e[_0xdf6b('0x33')]['includeAll']){_0x7e9f13['include']=[{'all':!![]}];}_0x7e9f13=_[_0xdf6b('0x3d')]({},_0x7e9f13,_0x212d6e[_0xdf6b('0x40')]);return db[_0xdf6b('0x2b')][_0xdf6b('0x48')](_0x7e9f13)['then'](handleEntityNotFound(_0x5c184f,null))['then'](respondWithResult(_0x5c184f,null))[_0xdf6b('0x45')](handleError(_0x5c184f,null));};exports[_0xdf6b('0x49')]=function(_0x449732,_0x152c7f){var _0x228cb3={'where':{'id':_0x449732[_0xdf6b('0x47')]['id']}},_0x268c39={};_0x268c39[_0xdf6b('0x32')]=_[_0xdf6b('0x30')](db[_0xdf6b('0x2b')][_0xdf6b('0x2c')]);_0x228cb3[_0xdf6b('0x37')]=_[_0xdf6b('0x34')](_0x268c39[_0xdf6b('0x32')],qs[_0xdf6b('0x35')](_0x449732[_0xdf6b('0x33')]['fields']));_0x228cb3[_0xdf6b('0x37')]=_0x228cb3[_0xdf6b('0x37')]['length']?_0x228cb3[_0xdf6b('0x37')]:_0x268c39['model'];if(_0x449732[_0xdf6b('0x33')]['includeAll']){_0x228cb3[_0xdf6b('0x42')]=[{'all':!![]}];}_0x228cb3=_[_0xdf6b('0x3d')]({},_0x228cb3,_0x449732[_0xdf6b('0x40')]);return db[_0xdf6b('0x2b')]['find'](_0x228cb3)[_0xdf6b('0x23')](handleEntityNotFound(_0x152c7f,null))[_0xdf6b('0x23')](function(_0xf2ec9){if(_0xf2ec9){var _0x551272=_0xf2ec9[_0xdf6b('0x4a')]({'plain':!![]});_0x551272=qs['omit'](_0x551272,['id',_0xdf6b('0x4b'),_0xdf6b('0x4c')]);_0x449732[_0xdf6b('0x4d')]=_[_0xdf6b('0x4e')](_0x449732[_0xdf6b('0x4d')],['id',_0xdf6b('0x4b'),_0xdf6b('0x4c')]);return db['Attachment']['create'](_[_0xdf6b('0x3d')](_0x551272,_0x449732[_0xdf6b('0x4d')]),{'include':_0x449732[_0xdf6b('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xdf6b('0x23')](respondWithResult(_0x152c7f,0xc9))['catch'](handleError(_0x152c7f,null));};exports[_0xdf6b('0x22')]=function(_0xacad0a,_0x152426){if(_0xacad0a[_0xdf6b('0x4d')]['id']){delete _0xacad0a[_0xdf6b('0x4d')]['id'];}return db[_0xdf6b('0x2b')][_0xdf6b('0x48')]({'where':{'id':_0xacad0a['params']['id']}})[_0xdf6b('0x23')](handleEntityNotFound(_0x152426,null))[_0xdf6b('0x23')](saveUpdates(_0xacad0a[_0xdf6b('0x4d')],null))[_0xdf6b('0x23')](respondWithResult(_0x152426,null))[_0xdf6b('0x45')](handleError(_0x152426,null));};exports['destroy']=function(_0x509d70,_0x4bffdf){return db[_0xdf6b('0x2b')][_0xdf6b('0x48')]({'where':{'id':_0x509d70[_0xdf6b('0x47')]['id']}})[_0xdf6b('0x23')](handleEntityNotFound(_0x4bffdf,null))['then'](removeEntity(_0x4bffdf,null))[_0xdf6b('0x45')](handleError(_0x4bffdf,null));};exports[_0xdf6b('0x4f')]=function(_0x1c93fb,_0x48334e,_0x5c6e28){_0x1c93fb[_0xdf6b('0x4d')][_0xdf6b('0x27')]=_0x1c93fb[_0xdf6b('0x50')]['originalname'];_0x1c93fb[_0xdf6b('0x4d')][_0xdf6b('0x51')]=_0x1c93fb[_0xdf6b('0x50')][_0xdf6b('0x52')];_0x1c93fb[_0xdf6b('0x4d')][_0xdf6b('0x2e')]=_0x1c93fb[_0xdf6b('0x50')][_0xdf6b('0x53')];return db[_0xdf6b('0x2b')]['create'](_0x1c93fb[_0xdf6b('0x4d')])[_0xdf6b('0x23')](respondWithResult(_0x48334e,0xc9))[_0xdf6b('0x45')](handleError(_0x48334e,null));};exports['download']=function(_0x15a9ee,_0x5a5401,_0x1272a0){return db[_0xdf6b('0x2b')][_0xdf6b('0x54')]({'where':{'id':_0x15a9ee[_0xdf6b('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5a5401,null))['then'](function(_0x40027f){if(_0x40027f){var _0x3bb88b=_0x40027f['ChatOfflineMessageId']!==null;var _0xf75b83=path[_0xdf6b('0x55')](config[_0xdf6b('0x56')],_0xdf6b('0x57'));if(_0x3bb88b){_0xf75b83=path[_0xdf6b('0x55')](_0xf75b83,'offline-chat/');}var _0x231f89=path['join'](_0xf75b83,_0x40027f[_0xdf6b('0x51')]);return _0x5a5401[_0xdf6b('0x58')](_0x231f89);}})[_0xdf6b('0x45')](handleError(_0x5a5401,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 763a30c..b1e36a1 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 _0xcfda=['bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments','lodash','util','api','moment'];(function(_0x5be986,_0x458f50){var _0x17d2b5=function(_0x38c620){while(--_0x38c620){_0x5be986['push'](_0x5be986['shift']());}};_0x17d2b5(++_0x458f50);}(_0xcfda,0xd8));var _0xacfd=function(_0x34685f,_0x468943){_0x34685f=_0x34685f-0x0;var _0x4ebee5=_0xcfda[_0x34685f];return _0x4ebee5;};'use strict';var _=require(_0xacfd('0x0'));var util=require(_0xacfd('0x1'));var logger=require('../../config/logger')(_0xacfd('0x2'));var moment=require(_0xacfd('0x3'));var BPromise=require(_0xacfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xacfd('0x5'));var rimraf=require(_0xacfd('0x6'));var config=require(_0xacfd('0x7'));var attributes=require('./attachment.attributes');module[_0xacfd('0x8')]=function(_0x23fb97,_0x2fa34a){return _0x23fb97['define'](_0xacfd('0x9'),attributes,{'tableName':_0xacfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd10=['request-promise','path','../../config/environment','./attachment.attributes','Attachment','attachments','util','api','moment','bluebird'];(function(_0x117c97,_0x5c7ba2){var _0xb3a3fe=function(_0x197dea){while(--_0x197dea){_0x117c97['push'](_0x117c97['shift']());}};_0xb3a3fe(++_0x5c7ba2);}(_0xdd10,0x1a0));var _0x0dd1=function(_0x2978f4,_0x3b1b6d){_0x2978f4=_0x2978f4-0x0;var _0x40ffd8=_0xdd10[_0x2978f4];return _0x40ffd8;};'use strict';var _=require('lodash');var util=require(_0x0dd1('0x0'));var logger=require('../../config/logger')(_0x0dd1('0x1'));var moment=require(_0x0dd1('0x2'));var BPromise=require(_0x0dd1('0x3'));var rp=require(_0x0dd1('0x4'));var fs=require('fs');var path=require(_0x0dd1('0x5'));var rimraf=require('rimraf');var config=require(_0x0dd1('0x6'));var attributes=require(_0x0dd1('0x7'));module['exports']=function(_0xb57146,_0x34b4ff){return _0xb57146['define'](_0x0dd1('0x8'),attributes,{'tableName':_0x0dd1('0x9'),'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 4510e67..fff5389 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 _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x5344b8,_0x13b897){_0x5344b8=_0x5344b8-0x0;var _0x3f7bd2=_0x3eec[_0x5344b8];return _0x3f7bd2;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});}; \ No newline at end of file +var _0x13c0=['message','result','catch','CreateAttachment','create','body','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x48b515,_0x21d750){var _0x103162=function(_0x1dcffc){while(--_0x1dcffc){_0x48b515['push'](_0x48b515['shift']());}};_0x103162(++_0x21d750);}(_0x13c0,0x79));var _0x013c=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0x13c0[_0x5d4ca7];return _0x3efc03;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});}exports[_0x013c('0x16')]=function(_0x34d59f){var _0x4268cf=this;return new Promise(function(_0x25eb26,_0x5a9142){return db['Attachment'][_0x013c('0x17')](_0x34d59f[_0x013c('0x18')],{'raw':_0x34d59f['options']?_0x34d59f[_0x013c('0x19')][_0x013c('0x1a')]===undefined?!![]:![]:!![]})[_0x013c('0x1b')](function(_0x38bac2){logger[_0x013c('0xc')]('CreateAttachment',_0x34d59f);logger[_0x013c('0xf')](_0x013c('0x16'),_0x34d59f,JSON['stringify'](_0x38bac2));_0x25eb26(_0x38bac2);})[_0x013c('0x15')](function(_0x82f9f1){logger['error']('CreateAttachment',_0x82f9f1[_0x013c('0x13')],_0x34d59f);_0x5a9142(_0x4268cf[_0x013c('0x12')](0x1f4,_0x82f9f1[_0x013c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d2e5963..f685038 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(_0x514b67,_0x35ab51){var _0x2295fb=function(_0x4f5bd1){while(--_0x4f5bd1){_0x514b67['push'](_0x514b67['shift']());}};_0x2295fb(++_0x35ab51);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0xb10b[_0x1b8bda];return _0x1f7050;};'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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x3d3cb2,_0x510d42){var _0x370783=function(_0x535029){while(--_0x535029){_0x3d3cb2['push'](_0x3d3cb2['shift']());}};_0x370783(++_0x510d42);}(_0xadb5,0xad));var _0x5adb=function(_0x2b8979,_0x557bc4){_0x2b8979=_0x2b8979-0x0;var _0x2ba0e1=_0xadb5[_0x2b8979];return _0x2ba0e1;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index afa26a8..a06dc04 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 _0x23cb=['minutes','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x23cb,0x1b0));var _0xb23c=function(_0x6054be,_0x2f4ffa){_0x6054be=_0x6054be-0x0;var _0xd1d697=_0x23cb[_0x6054be];return _0xd1d697;};'use strict';var _=require(_0xb23c('0x0'));var passport=require(_0xb23c('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xb23c('0x2')];var moment=require(_0xb23c('0x3'));var db=require(_0xb23c('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xb23c('0x5'))[_0xb23c('0x6')];var utils=require(_0xb23c('0x7'));exports[_0xb23c('0x8')]=passport['authenticate'](_0xb23c('0x9'),{'failureRedirect':_0xb23c('0xa'),'scope':[_0xb23c('0xb'),_0xb23c('0xc')],'session':![]});exports[_0xb23c('0xd')]=passport[_0xb23c('0xe')]('google',{'failureRedirect':_0xb23c('0xa'),'session':![]});passport[_0xb23c('0xf')](new GoogleStrategy({'clientID':config[_0xb23c('0x9')]?config[_0xb23c('0x9')][_0xb23c('0x10')]:'id','clientSecret':config[_0xb23c('0x9')]?config[_0xb23c('0x9')][_0xb23c('0x11')]:_0xb23c('0x12'),'callbackURL':config['google']?config[_0xb23c('0x9')][_0xb23c('0x13')]:''},function(_0x503cb7,_0x2a14bb,_0x3cd603,_0x5b8bb4){var _0xe04b8f,_0x55e737;return db[_0xb23c('0x14')][_0xb23c('0x15')]({'where':{'id':0x1},'attributes':[_0xb23c('0x16'),'blockDuration'],'raw':!![]})[_0xb23c('0x17')](function(_0x8d1e7a){_0xe04b8f=_0x8d1e7a;return db[_0xb23c('0x18')][_0xb23c('0x19')]({'where':{'email':_[_0xb23c('0x1a')](_0x3cd603[_0xb23c('0x1b')],_0xb23c('0x1c')),'role':{'$or':[_0xb23c('0x1d'),_0xb23c('0x1e'),_0xb23c('0x1f')]}}});})[_0xb23c('0x17')](function(_0x3ac11b){_0x55e737=_0x3ac11b;if(_0x55e737){if(_0x55e737[_0xb23c('0x20')]){return _0x5b8bb4(_0xb23c('0x21'));}else if(_0xe04b8f[_0xb23c('0x22')]>0x0){if(_0x55e737[_0xb23c('0x23')]){if(moment(_0x55e737['blockedAt'])['add'](_0xe04b8f[_0xb23c('0x22')],_0xb23c('0x24'))>moment()){return _0x5b8bb4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x55e737,0x0,![],null)[_0xb23c('0x17')](function(){return utils[_0xb23c('0x25')](_0x55e737);})['then'](function(){return _0x5b8bb4(null,_0x55e737);});}}else{return utils[_0xb23c('0x25')](_0x55e737)['then'](function(){return _0x5b8bb4(null,_0x55e737);});}}else{return utils[_0xb23c('0x25')](_0x55e737)[_0xb23c('0x17')](function(){return _0x5b8bb4(null,_0x55e737);});}}return _0x5b8bb4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb23c('0x26')](function(_0xd13bd){_0x5b8bb4(_0xd13bd);});})); \ No newline at end of file +var _0x2484=['getLicense','passport-google-oauth20','moment','../../mysqldb','signToken','../../config/utils','login','authenticate','google','/login','email','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','map','emails','value','admin','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser'];(function(_0x3bb33c,_0x35584c){var _0x2ed44c=function(_0x1cc4bb){while(--_0x1cc4bb){_0x3bb33c['push'](_0x3bb33c['shift']());}};_0x2ed44c(++_0x35584c);}(_0x2484,0xef));var _0x4248=function(_0x1d83db,_0x89d115){_0x1d83db=_0x1d83db-0x0;var _0x2dc1d1=_0x2484[_0x1d83db];return _0x2dc1d1;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x4248('0x0'))['Strategy'];var moment=require(_0x4248('0x1'));var db=require(_0x4248('0x2'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x4248('0x3')];var utils=require(_0x4248('0x4'));exports[_0x4248('0x5')]=passport[_0x4248('0x6')](_0x4248('0x7'),{'failureRedirect':_0x4248('0x8'),'scope':['profile',_0x4248('0x9')],'session':![]});exports['callback']=passport[_0x4248('0x6')](_0x4248('0x7'),{'failureRedirect':_0x4248('0x8'),'session':![]});passport[_0x4248('0xa')](new GoogleStrategy({'clientID':config[_0x4248('0x7')]?config[_0x4248('0x7')][_0x4248('0xb')]:'id','clientSecret':config[_0x4248('0x7')]?config[_0x4248('0x7')][_0x4248('0xc')]:_0x4248('0xd'),'callbackURL':config[_0x4248('0x7')]?config[_0x4248('0x7')][_0x4248('0xe')]:''},function(_0x46824b,_0x3ba88c,_0xfa805,_0x17db1b){var _0x4b7460,_0x5cdc75;return db[_0x4248('0xf')][_0x4248('0x10')]({'where':{'id':0x1},'attributes':[_0x4248('0x11'),'blockDuration'],'raw':!![]})['then'](function(_0x18d252){_0x4b7460=_0x18d252;return db[_0x4248('0x12')]['find']({'where':{'email':_[_0x4248('0x13')](_0xfa805[_0x4248('0x14')],_0x4248('0x15')),'role':{'$or':[_0x4248('0x16'),'user',_0x4248('0x17')]}}});})[_0x4248('0x18')](function(_0x503bb6){_0x5cdc75=_0x503bb6;if(_0x5cdc75){if(_0x5cdc75[_0x4248('0x19')]){return _0x17db1b(_0x4248('0x1a'));}else if(_0x4b7460[_0x4248('0x1b')]>0x0){if(_0x5cdc75[_0x4248('0x1c')]){if(moment(_0x5cdc75[_0x4248('0x1d')])[_0x4248('0x1e')](_0x4b7460[_0x4248('0x1b')],_0x4248('0x1f'))>moment()){return _0x17db1b(_0x4248('0x1a'));}else{return utils[_0x4248('0x20')](_0x5cdc75,0x0,![],null)[_0x4248('0x18')](function(){return utils[_0x4248('0x21')](_0x5cdc75);})[_0x4248('0x18')](function(){return _0x17db1b(null,_0x5cdc75);});}}else{return utils[_0x4248('0x21')](_0x5cdc75)['then'](function(){return _0x17db1b(null,_0x5cdc75);});}}else{return utils[_0x4248('0x21')](_0x5cdc75)['then'](function(){return _0x17db1b(null,_0x5cdc75);});}}return _0x17db1b(_0x4248('0x1a'));})['catch'](function(_0x2fd2e1){_0x17db1b(_0x2fd2e1);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index dc036c7..902399e 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 _0x25f6=['./authGoogle.controller','get','login','/callback','callback','setTokenCookie','exports','express','passport','Router'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x25f6,0x197));var _0x625f=function(_0x57a352,_0xbd7532){_0x57a352=_0x57a352-0x0;var _0x5cd613=_0x25f6[_0x57a352];return _0x5cd613;};'use strict';var express=require(_0x625f('0x0'));var passport=require(_0x625f('0x1'));var router=express[_0x625f('0x2')]();var controller=require(_0x625f('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x625f('0x4')]('/',controller[_0x625f('0x5')]);router['get'](_0x625f('0x6'),controller[_0x625f('0x7')],authService['isMiddleware'],userController['login'],authService[_0x625f('0x8')]);module[_0x625f('0x9')]=router; \ No newline at end of file +var _0x7333=['setTokenCookie','exports','express','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','login'];(function(_0x561195,_0x1f9dec){var _0x5c87c3=function(_0x32ee97){while(--_0x32ee97){_0x561195['push'](_0x561195['shift']());}};_0x5c87c3(++_0x1f9dec);}(_0x7333,0xfc));var _0x3733=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7333[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x3733('0x0'));var passport=require('passport');var router=express[_0x3733('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x3733('0x2'));var authService=require(_0x3733('0x3'));router[_0x3733('0x4')]('/',controller['login']);router[_0x3733('0x4')](_0x3733('0x5'),controller[_0x3733('0x6')],authService['isMiddleware'],userController[_0x3733('0x7')],authService[_0x3733('0x8')]);module[_0x3733('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e4b1682..2e86d7c 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 _0xe0dc=['send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','passwordHistoryLimit','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify'];(function(_0x2e447a,_0x2d694f){var _0x1a3e77=function(_0x585e08){while(--_0x585e08){_0x2e447a['push'](_0x2e447a['shift']());}};_0x1a3e77(++_0x2d694f);}(_0xe0dc,0x77));var _0xce0d=function(_0x135c17,_0x1188b2){_0x135c17=_0x135c17-0x0;var _0x2546b0=_0xe0dc[_0x135c17];return _0x2546b0;};'use strict';var util=require('util');var passport=require(_0xce0d('0x0'));var LocalStrategy=require(_0xce0d('0x1'))[_0xce0d('0x2')];var jayson=require('jayson/promise');var _=require(_0xce0d('0x3'));var rs=require(_0xce0d('0x4'));var moment=require('moment');var db=require(_0xce0d('0x5'))['db'];var authService=require(_0xce0d('0x6'));var utils=require(_0xce0d('0x7'));var client=jayson[_0xce0d('0x8')][_0xce0d('0x9')]({'port':0x232b});function localAuthenticate(_0x499c84,_0x2af3f4,_0x3c9bd5,_0x2d8919){var _0x267b83,_0x374cd8;return db['Setting'][_0xce0d('0xa')]({'where':{'id':0x1},'attributes':[_0xce0d('0xb'),_0xce0d('0xc')],'raw':!![]})[_0xce0d('0xd')](function(_0x1a8bef){_0x267b83=_0x1a8bef;return _0x499c84[_0xce0d('0xa')]({'attributes':['id',_0xce0d('0xe'),'password','salt',_0xce0d('0xf'),_0xce0d('0x10'),_0xce0d('0x11'),'blockedAt',_0xce0d('0x12')],'where':{'name':_0x2af3f4,'role':{'$or':[_0xce0d('0x13'),_0xce0d('0x14'),_0xce0d('0x15')]}}});})[_0xce0d('0xd')](function(_0xd45c05){if(!_0xd45c05||_0xd45c05&&_0xd45c05[_0xce0d('0xe')]!==_0x2af3f4){throw new Error(_0xce0d('0x16'));}else{_0x374cd8=_0xd45c05;return _0x374cd8;}})[_0xce0d('0xd')](function(){_0x374cd8[_0xce0d('0x17')](_0x3c9bd5,function(_0x98505d,_0x6852f1){var _0x1f8b05=_0x374cd8[_0xce0d('0x12')]+0x1;if(_0x98505d){return _0x2d8919(_0x98505d);}else if(!_0x6852f1){if(_0x374cd8['disabled']){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}else if(_0x267b83[_0xce0d('0xb')]>0x0){if(_0x374cd8[_0xce0d('0x11')]){if(_0x267b83[_0xce0d('0xc')]>0x0){if(moment(_0x374cd8['blockedAt'])[_0xce0d('0x18')](_0x267b83[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xce0d('0x1a')](_0x374cd8,_0x1f8b05,![],null)[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1f8b05>=_0x267b83[_0xce0d('0xb')]){return utils['clearBlockUser'](_0x374cd8,0x0,!![],moment())[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xce0d('0x1a')](_0x374cd8,_0x1f8b05,![],null)[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});});}}}else{return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}}else{if(_0x374cd8[_0xce0d('0x10')]){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x267b83[_0xce0d('0xb')]>0x0){if(_0x374cd8['blocked']){if(_0x267b83['blockDuration']>0x0){if(moment(_0x374cd8[_0xce0d('0x1b')])[_0xce0d('0x18')](_0x267b83[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x374cd8,0x0,![],null)[_0xce0d('0xd')](function(){return utils[_0xce0d('0x1c')](_0x374cd8);})[_0xce0d('0xd')](function(){return _0x2d8919(null,_0x374cd8);});}}else{return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xce0d('0x1a')](_0x374cd8,0x0,![],null)[_0xce0d('0xd')](function(){return utils[_0xce0d('0x1c')](_0x374cd8);})['then'](function(){return _0x2d8919(null,_0x374cd8);})[_0xce0d('0x1d')](function(_0x3a0b50){return _0x2d8919(null,![],_0x3a0b50);});}}else{if(_0x374cd8[_0xce0d('0x11')]){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}else{return utils['getLicense'](_0x374cd8)['then'](function(){return _0x2d8919(null,_0x374cd8);});}}}});})[_0xce0d('0x1d')](function(_0x2d9d9f){return _0x2d8919(null,![],_0x2d9d9f);});}function sendServiceMail(_0x2fbaca){return db[_0xce0d('0x1e')][_0xce0d('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xce0d('0xe'),_0xce0d('0x20')],'include':[{'model':db[_0xce0d('0x21')],'as':_0xce0d('0x22')}]})[_0xce0d('0xd')](function(_0x452503){if(!_0x452503){throw new Error(_0xce0d('0x23'));}var _0x2ac5a1={'tls':{'rejectUnauthorized':![]}};if(_0x452503[_0xce0d('0x22')][_0xce0d('0x24')]){_0x2ac5a1[_0xce0d('0x24')]=_0x452503['Smtp'][_0xce0d('0x24')];}else{_0x2ac5a1['host']=_0x452503['Smtp'][_0xce0d('0x25')];_0x2ac5a1['port']=_0x452503[_0xce0d('0x22')]['port'];_0x2ac5a1[_0xce0d('0x26')]=_0x452503[_0xce0d('0x22')][_0xce0d('0x26')];}if(_0x452503[_0xce0d('0x22')]['authentication']){_0x2ac5a1[_0xce0d('0x27')]={'user':_0x452503['Smtp'][_0xce0d('0x14')],'pass':_0x452503[_0xce0d('0x22')][_0xce0d('0x28')]};}var _0x50438f={'account':_0x2ac5a1,'message':_[_0xce0d('0x29')]({'from':util[_0xce0d('0x2a')](_0xce0d('0x2b'),_0x452503[_0xce0d('0xe')],_0x452503[_0xce0d('0x20')]||_0x452503['Smtp'][_0xce0d('0x14')])},_0x2fbaca)};return client[_0xce0d('0x2c')](_0xce0d('0x2d'),_0x50438f);})[_0xce0d('0xd')](function(_0x46da95){if(_0x46da95[_0xce0d('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x46da95['error'][_0xce0d('0x2f')]||JSON[_0xce0d('0x30')](_0x46da95[_0xce0d('0x2e')])));}return!![];});}function handleError(_0x226cc0,_0x43bc5e,_0x216908){return _0x226cc0['status'](_0x43bc5e||0x1f4)[_0xce0d('0x31')]({'message':_0x216908?_0x216908[_0xce0d('0x2f')]||_0x216908:''});}exports[_0xce0d('0x32')]=function(_0x47cefc,_0x2ccd1b,_0x44e043){passport[_0xce0d('0x17')](_0xce0d('0x33'),function(_0x5f3d8b,_0x3b7a10,_0x4b0724){var _0x215004=_0x5f3d8b||_0x4b0724;if(_0x215004){return handleError(_0x2ccd1b,0x191,_0x215004);}if(!_0x3b7a10){return handleError(_0x2ccd1b,0x194,{'message':_0xce0d('0x34')});}else{var _0x50df43={'payload':{'id':_0x3b7a10['id'],'role':_0x3b7a10[_0xce0d('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xce0d('0x35')](_0x50df43)[_0xce0d('0xd')](function(_0x312ba4){_0x2ccd1b[_0xce0d('0x36')]({'id':_0x3b7a10['id'],'token':_0x312ba4,'statusCall':'','isAlreadyLogged':_0x3b7a10[_0xce0d('0x37')]});});}})(_0x47cefc,_0x2ccd1b,_0x44e043);};exports[_0xce0d('0x38')]=function(_0x1e6059,_0xed794,_0x22cd15){if(!_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')]){return handleError(_0xed794,0x1f4,{'message':_0xce0d('0x3a')});}var _0x5206d3=rs[_0xce0d('0x3b')]();_0x1e6059['body'][_0xce0d('0x20')]=_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')]['trim']()[_0xce0d('0x3c')]();var _0x2290ab;return db[_0xce0d('0x3d')][_0xce0d('0xa')]({'where':{'id':0x1},'attributes':[_0xce0d('0xb'),_0xce0d('0xc')],'raw':!![]})[_0xce0d('0xd')](function(_0x1205ae){_0x2290ab=_0x1205ae;return db[_0xce0d('0x3e')][_0xce0d('0x1f')]({'where':{'email':_0x1e6059[_0xce0d('0x39')]['email']}});})[_0xce0d('0xd')](function(_0x432ded){if(!_0x432ded){throw new Error(_0xce0d('0x3f'));}if(_0x432ded['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x432ded['blocked']){if(moment(_0x432ded[_0xce0d('0x1b')])[_0xce0d('0x18')](_0x2290ab[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){throw new Error(_0xce0d('0x40'));}else{_0x432ded[_0xce0d('0x11')]=![];_0x432ded[_0xce0d('0x1b')]=null;}}_0x432ded[_0xce0d('0x41')]=_0x5206d3;_0x432ded[_0xce0d('0x42')]=Date[_0xce0d('0x43')]()+0x36ee80;return _0x432ded[_0xce0d('0x44')]();})[_0xce0d('0xd')](function(){return sendServiceMail({'to':_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')],'subject':_0xce0d('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xce0d('0x46')+_0xce0d('0x47')+_0x1e6059['headers']['host']+'/reset/'+_0x5206d3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xce0d('0xd')](function(){_0xed794[_0xce0d('0x48')](0xc8)[_0xce0d('0x31')]({'message':_0xce0d('0x49')});})[_0xce0d('0x1d')](function(_0x36ca3c){return handleError(_0xed794,0x1f4,_0x36ca3c);});};exports['reset']=function(_0x5ba16e,_0x150f8e,_0x5c029c){return db[_0xce0d('0x3e')][_0xce0d('0x1f')]({'where':{'resetPasswordToken':_0x5ba16e[_0xce0d('0x4a')][_0xce0d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xce0d('0x43')]()}}})['then'](function(_0x41b501){if(!_0x41b501){throw new Error(_0xce0d('0x4c'));}return db[_0xce0d('0x3d')][_0xce0d('0xa')]({'attributes':['id',_0xce0d('0x4d'),_0xce0d('0x4e'),'passwordHistoryLimit']})['then'](function(_0x15e46b){if(_0x15e46b[_0xce0d('0x4d')])authService[_0xce0d('0x4f')](_0x5ba16e[_0xce0d('0x39')][_0xce0d('0x50')]);if(!_0x15e46b['enforcePasswordHistory']||!_0x41b501['previousPasswords'])return _0x41b501;authService[_0xce0d('0x51')](_0x5ba16e['body'][_0xce0d('0x50')],_0x41b501[_0xce0d('0x52')],_0x15e46b[_0xce0d('0x53')]);return _0x41b501;})['then'](function(){_0x41b501[_0xce0d('0x50')]=_0x5ba16e[_0xce0d('0x39')][_0xce0d('0x50')];_0x41b501[_0xce0d('0x41')]=null;_0x41b501[_0xce0d('0x42')]=null;return _0x41b501[_0xce0d('0x44')]();});})[_0xce0d('0xd')](function(){_0x150f8e[_0xce0d('0x48')](0xc8)[_0xce0d('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x279d8c){return handleError(_0x150f8e,0x1f4,_0x279d8c);});};passport['use'](new LocalStrategy({'usernameField':_0xce0d('0xe'),'passwordField':_0xce0d('0x50')},function(_0x185056,_0x5650b3,_0x1033b0){return localAuthenticate(db[_0xce0d('0x3e')],_0x185056,_0x5650b3,_0x1033b0);})); \ No newline at end of file +var _0x59b9=['Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut'];(function(_0x448db7,_0x1fe374){var _0x43ce2f=function(_0x5ca70e){while(--_0x5ca70e){_0x448db7['push'](_0x448db7['shift']());}};_0x43ce2f(++_0x1fe374);}(_0x59b9,0x1f2));var _0x959b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x59b9[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x959b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x959b('0x1'))['Strategy'];var jayson=require(_0x959b('0x2'));var _=require(_0x959b('0x3'));var rs=require(_0x959b('0x4'));var moment=require('moment');var db=require(_0x959b('0x5'))['db'];var authService=require(_0x959b('0x6'));var utils=require(_0x959b('0x7'));var client=jayson[_0x959b('0x8')][_0x959b('0x9')]({'port':0x232b});function localAuthenticate(_0x5735fc,_0x2121d5,_0x513430,_0x2ba1f4){var _0x4ee695,_0x14f410;return db[_0x959b('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x959b('0xb'),_0x959b('0xc')],'raw':!![]})[_0x959b('0xd')](function(_0x59b9bd){_0x4ee695=_0x59b9bd;return _0x5735fc[_0x959b('0xe')]({'attributes':['id','name',_0x959b('0xf'),_0x959b('0x10'),_0x959b('0x11'),_0x959b('0x12'),'blocked',_0x959b('0x13'),_0x959b('0x14')],'where':{'name':_0x2121d5,'role':{'$or':[_0x959b('0x15'),'user',_0x959b('0x16')]}}});})[_0x959b('0xd')](function(_0x4b37ab){if(!_0x4b37ab||_0x4b37ab&&_0x4b37ab[_0x959b('0x17')]!==_0x2121d5){throw new Error(_0x959b('0x18'));}else{_0x14f410=_0x4b37ab;return _0x14f410;}})[_0x959b('0xd')](function(){_0x14f410[_0x959b('0x19')](_0x513430,function(_0x720ff7,_0x4d8b7f){var _0x3e030a=_0x14f410['loginAttempts']+0x1;if(_0x720ff7){return _0x2ba1f4(_0x720ff7);}else if(!_0x4d8b7f){if(_0x14f410[_0x959b('0x12')]){return _0x2ba1f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ee695[_0x959b('0xb')]>0x0){if(_0x14f410[_0x959b('0x1a')]){if(_0x4ee695[_0x959b('0xc')]>0x0){if(moment(_0x14f410[_0x959b('0x13')])['add'](_0x4ee695['blockDuration'],_0x959b('0x1b'))>moment()){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}else{return utils['clearBlockUser'](_0x14f410,_0x3e030a,![],null)[_0x959b('0xd')](function(){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});});}}else{return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}}else{if(_0x3e030a>=_0x4ee695['allowedLoginAttempts']){return utils[_0x959b('0x1c')](_0x14f410,0x0,!![],moment())[_0x959b('0xd')](function(){return _0x2ba1f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x959b('0x1c')](_0x14f410,_0x3e030a,![],null)[_0x959b('0xd')](function(){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});});}}}else{return _0x2ba1f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x14f410[_0x959b('0x12')]){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}else if(_0x4ee695[_0x959b('0xb')]>0x0){if(_0x14f410[_0x959b('0x1a')]){if(_0x4ee695['blockDuration']>0x0){if(moment(_0x14f410[_0x959b('0x13')])[_0x959b('0x1d')](_0x4ee695[_0x959b('0xc')],_0x959b('0x1b'))>moment()){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}else{return utils[_0x959b('0x1c')](_0x14f410,0x0,![],null)[_0x959b('0xd')](function(){return utils[_0x959b('0x1e')](_0x14f410);})[_0x959b('0xd')](function(){return _0x2ba1f4(null,_0x14f410);});}}else{return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}}else{return utils[_0x959b('0x1c')](_0x14f410,0x0,![],null)[_0x959b('0xd')](function(){return utils[_0x959b('0x1e')](_0x14f410);})[_0x959b('0xd')](function(){return _0x2ba1f4(null,_0x14f410);})[_0x959b('0x1f')](function(_0x7fdf71){return _0x2ba1f4(null,![],_0x7fdf71);});}}else{if(_0x14f410[_0x959b('0x1a')]){return _0x2ba1f4(null,![],{'message':_0x959b('0x18')});}else{return utils['getLicense'](_0x14f410)[_0x959b('0xd')](function(){return _0x2ba1f4(null,_0x14f410);});}}}});})['catch'](function(_0x51aff9){return _0x2ba1f4(null,![],_0x51aff9);});}function sendServiceMail(_0x4dac31){return db[_0x959b('0x20')][_0x959b('0x21')]({'where':{'service':!![]},'attributes':['id',_0x959b('0x17'),_0x959b('0x22')],'include':[{'model':db[_0x959b('0x23')],'as':_0x959b('0x24')}]})[_0x959b('0xd')](function(_0x20b490){if(!_0x20b490){throw new Error(_0x959b('0x25'));}var _0x15fca7={'tls':{'rejectUnauthorized':![]}};if(_0x20b490[_0x959b('0x24')]['service']){_0x15fca7['service']=_0x20b490[_0x959b('0x24')][_0x959b('0x26')];}else{_0x15fca7[_0x959b('0x27')]=_0x20b490[_0x959b('0x24')][_0x959b('0x27')];_0x15fca7[_0x959b('0x28')]=_0x20b490[_0x959b('0x24')][_0x959b('0x28')];_0x15fca7[_0x959b('0x29')]=_0x20b490[_0x959b('0x24')]['secure'];}if(_0x20b490[_0x959b('0x24')][_0x959b('0x2a')]){_0x15fca7[_0x959b('0x2b')]={'user':_0x20b490[_0x959b('0x24')][_0x959b('0x2c')],'pass':_0x20b490[_0x959b('0x24')][_0x959b('0x2d')]};}var _0x1b0121={'account':_0x15fca7,'message':_[_0x959b('0x2e')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x20b490[_0x959b('0x17')],_0x20b490[_0x959b('0x22')]||_0x20b490[_0x959b('0x24')]['user'])},_0x4dac31)};return client[_0x959b('0x2f')](_0x959b('0x30'),_0x1b0121);})[_0x959b('0xd')](function(_0x42164d){if(_0x42164d[_0x959b('0x31')]){throw new Error(util[_0x959b('0x32')](_0x959b('0x33'),_0x42164d['error']['message']||JSON[_0x959b('0x34')](_0x42164d[_0x959b('0x31')])));}return!![];});}function handleError(_0x8cb556,_0x1c22b8,_0xd866a1){return _0x8cb556[_0x959b('0x35')](_0x1c22b8||0x1f4)[_0x959b('0x36')]({'message':_0xd866a1?_0xd866a1[_0x959b('0x37')]||_0xd866a1:''});}exports[_0x959b('0x38')]=function(_0x10166d,_0xb1f76,_0x16f4da){passport[_0x959b('0x19')]('local',function(_0x420991,_0x1d623f,_0x568312){var _0x460963=_0x420991||_0x568312;if(_0x460963){return handleError(_0xb1f76,0x191,_0x460963);}if(!_0x1d623f){return handleError(_0xb1f76,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4d91ee={'payload':{'id':_0x1d623f['id'],'role':_0x1d623f[_0x959b('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x959b('0x39')](_0x4d91ee)[_0x959b('0xd')](function(_0x6853b){_0xb1f76[_0x959b('0x3a')]({'id':_0x1d623f['id'],'token':_0x6853b,'statusCall':'','isAlreadyLogged':_0x1d623f[_0x959b('0x3b')]});});}})(_0x10166d,_0xb1f76,_0x16f4da);};exports[_0x959b('0x3c')]=function(_0x4e12d6,_0x3ab78e,_0x36706b){if(!_0x4e12d6[_0x959b('0x3d')][_0x959b('0x22')]){return handleError(_0x3ab78e,0x1f4,{'message':_0x959b('0x3e')});}var _0x44fd3f=rs[_0x959b('0x3f')]();_0x4e12d6[_0x959b('0x3d')][_0x959b('0x22')]=_0x4e12d6[_0x959b('0x3d')][_0x959b('0x22')][_0x959b('0x40')]()[_0x959b('0x41')]();var _0x368a47;return db['Setting'][_0x959b('0xe')]({'where':{'id':0x1},'attributes':[_0x959b('0xb'),_0x959b('0xc')],'raw':!![]})[_0x959b('0xd')](function(_0x2b2b2b){_0x368a47=_0x2b2b2b;return db[_0x959b('0x42')][_0x959b('0x21')]({'where':{'email':_0x4e12d6['body'][_0x959b('0x22')]}});})[_0x959b('0xd')](function(_0x6b3420){if(!_0x6b3420){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x6b3420['disabled']){throw new Error(_0x959b('0x43'));}if(_0x6b3420[_0x959b('0x1a')]){if(moment(_0x6b3420['blockedAt'])[_0x959b('0x1d')](_0x368a47[_0x959b('0xc')],'minutes')>moment()){throw new Error(_0x959b('0x44'));}else{_0x6b3420[_0x959b('0x1a')]=![];_0x6b3420['blockedAt']=null;}}_0x6b3420['resetPasswordToken']=_0x44fd3f;_0x6b3420[_0x959b('0x45')]=Date[_0x959b('0x46')]()+0x36ee80;return _0x6b3420[_0x959b('0x47')]();})[_0x959b('0xd')](function(){return sendServiceMail({'to':_0x4e12d6['body']['email'],'subject':_0x959b('0x48'),'text':_0x959b('0x49')+_0x959b('0x4a')+'https://'+_0x4e12d6[_0x959b('0x4b')][_0x959b('0x27')]+'/reset/'+_0x44fd3f+'\x0a\x0a'+_0x959b('0x4c')});})[_0x959b('0xd')](function(){_0x3ab78e[_0x959b('0x35')](0xc8)['send']({'message':_0x959b('0x4d')});})[_0x959b('0x1f')](function(_0x331db){return handleError(_0x3ab78e,0x1f4,_0x331db);});};exports[_0x959b('0x4e')]=function(_0x14df34,_0x1c015d,_0x4cc670){return db['User']['find']({'where':{'resetPasswordToken':_0x14df34[_0x959b('0x4f')]['token'],'resetPasswordExpires':{'$gt':Date[_0x959b('0x46')]()}}})[_0x959b('0xd')](function(_0x4b3478){if(!_0x4b3478){throw new Error(_0x959b('0x50'));}return db[_0x959b('0xa')][_0x959b('0xe')]({'attributes':['id',_0x959b('0x51'),_0x959b('0x52'),'passwordHistoryLimit']})[_0x959b('0xd')](function(_0x459081){if(_0x459081[_0x959b('0x51')])authService[_0x959b('0x53')](_0x14df34[_0x959b('0x3d')][_0x959b('0xf')]);if(!_0x459081[_0x959b('0x52')]||!_0x4b3478[_0x959b('0x54')])return _0x4b3478;authService[_0x959b('0x55')](_0x14df34[_0x959b('0x3d')][_0x959b('0xf')],_0x4b3478[_0x959b('0x54')],_0x459081[_0x959b('0x56')]);return _0x4b3478;})[_0x959b('0xd')](function(){_0x4b3478[_0x959b('0xf')]=_0x14df34[_0x959b('0x3d')][_0x959b('0xf')];_0x4b3478['resetPasswordToken']=null;_0x4b3478[_0x959b('0x45')]=null;return _0x4b3478['save']();});})[_0x959b('0xd')](function(){_0x1c015d[_0x959b('0x35')](0xc8)['send']({'message':_0x959b('0x57')});})['catch'](function(_0x5f2092){return handleError(_0x1c015d,0x1f4,_0x5f2092);});};passport[_0x959b('0x58')](new LocalStrategy({'usernameField':_0x959b('0x17'),'passwordField':_0x959b('0xf')},function(_0x1f6fbe,_0xe7811c,_0x27213a){return localAuthenticate(db['User'],_0x1f6fbe,_0xe7811c,_0x27213a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index bcd1c63..c7730e1 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 _0x2bc3=['post','login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller'];(function(_0x4983b2,_0x25cb64){var _0x315d3a=function(_0x1827a3){while(--_0x1827a3){_0x4983b2['push'](_0x4983b2['shift']());}};_0x315d3a(++_0x25cb64);}(_0x2bc3,0xf9));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x32bc('0x0'));var router=express[_0x32bc('0x1')]();var controller=require(_0x32bc('0x2'));router[_0x32bc('0x3')]('/',controller[_0x32bc('0x4')]);router[_0x32bc('0x3')](_0x32bc('0x5'),controller[_0x32bc('0x6')]);router['post'](_0x32bc('0x7'),controller[_0x32bc('0x8')]);module['exports']=router; \ No newline at end of file +var _0xee04=['post','/reset/:token','reset','exports','express','./authLocal.controller','/forgot'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xee04,0x74));var _0x4ee0=function(_0x483fdd,_0x2f3984){_0x483fdd=_0x483fdd-0x0;var _0x37d5c8=_0xee04[_0x483fdd];return _0x37d5c8;};'use strict';var express=require(_0x4ee0('0x0'));var router=express['Router']();var controller=require(_0x4ee0('0x1'));router['post']('/',controller['login']);router['post'](_0x4ee0('0x2'),controller['forgot']);router[_0x4ee0('0x3')](_0x4ee0('0x4'),controller[_0x4ee0('0x5')]);module[_0x4ee0('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 30d3c2f..aff215f 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 _0xd9f3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x251504,_0x5abb14){var _0x56ef48=function(_0x33b0ae){while(--_0x33b0ae){_0x251504['push'](_0x251504['shift']());}};_0x56ef48(++_0x5abb14);}(_0xd9f3,0x111));var _0x3d9f=function(_0x1f78aa,_0x36db6f){_0x1f78aa=_0x1f78aa-0x0;var _0x3cb5f9=_0xd9f3[_0x1f78aa];return _0x3cb5f9;};'use strict';var Sequelize=require(_0x3d9f('0x0'));module[_0x3d9f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3d9f('0x2')]},'description':{'type':Sequelize[_0x3d9f('0x2')]},'status':{'type':Sequelize[_0x3d9f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3d9f('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xcd7e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2cc93b,_0x43bbec){var _0x10445e=function(_0x3669f5){while(--_0x3669f5){_0x2cc93b['push'](_0x2cc93b['shift']());}};_0x10445e(++_0x43bbec);}(_0xcd7e,0xc2));var _0xecd7=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xcd7e[_0xd13a88];return _0x1c993c;};'use strict';var Sequelize=require(_0xecd7('0x0'));module[_0xecd7('0x1')]={'name':{'type':Sequelize[_0xecd7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xecd7('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xecd7('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xecd7('0x4')],'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 8997390..6ea99c3 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 _0x8a92=['then','rows','catch','show','params','options','create','update','body','find','addConditions','Condition','ids','omit','getConditions','pick','nolimit','addActions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','sendStatus','name','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x385eee,_0x270cca){var _0x41fd49=function(_0x6bb501){while(--_0x6bb501){_0x385eee['push'](_0x385eee['shift']());}};_0x41fd49(++_0x270cca);}(_0x8a92,0xbb));var _0x28a9=function(_0x1494a3,_0x1e2a9b){_0x1494a3=_0x1494a3-0x0;var _0x262530=_0x8a92[_0x1494a3];return _0x262530;};'use strict';var emlformat=require(_0x28a9('0x0'));var rimraf=require(_0x28a9('0x1'));var zipdir=require(_0x28a9('0x2'));var jsonpatch=require(_0x28a9('0x3'));var rp=require(_0x28a9('0x4'));var moment=require(_0x28a9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x28a9('0x6'));var util=require(_0x28a9('0x7'));var path=require(_0x28a9('0x8'));var sox=require(_0x28a9('0x9'));var csv=require(_0x28a9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28a9('0xb'));var squel=require('squel');var crypto=require(_0x28a9('0xc'));var jsforce=require(_0x28a9('0xd'));var deskjs=require(_0x28a9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x28a9('0xf'));var Papa=require(_0x28a9('0x10'));var Redis=require(_0x28a9('0x11'));var authService=require(_0x28a9('0x12'));var qs=require(_0x28a9('0x13'));var as=require(_0x28a9('0x14'));var hardwareService=require(_0x28a9('0x15'));var logger=require(_0x28a9('0x16'))('api');var utils=require(_0x28a9('0x17'));var config=require(_0x28a9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28a9('0x19'))['db'];function respondWithStatusCode(_0x11b390,_0x4b31e4){_0x4b31e4=_0x4b31e4||0xcc;return function(_0x4d283a){if(_0x4d283a){return _0x11b390['sendStatus'](_0x4b31e4);}return _0x11b390['status'](_0x4b31e4)[_0x28a9('0x1a')]();};}function respondWithResult(_0x373ada,_0x120cb8){_0x120cb8=_0x120cb8||0xc8;return function(_0x14b41f){if(_0x14b41f){return _0x373ada[_0x28a9('0x1b')](_0x120cb8)['json'](_0x14b41f);}};}function respondWithFilteredResult(_0x56fdc6,_0x19c450){return function(_0x439d43){if(_0x439d43){var _0xa45b6a=typeof _0x19c450[_0x28a9('0x1c')]==='undefined'&&typeof _0x19c450[_0x28a9('0x1d')]===_0x28a9('0x1e');var _0x423cb6=_0x439d43[_0x28a9('0x1f')];var _0x1c8739=_0xa45b6a?0x0:_0x19c450['offset'];var _0xc6d99f=_0xa45b6a?_0x439d43[_0x28a9('0x1f')]:_0x19c450['offset']+_0x19c450['limit'];var _0x2097c7;if(_0xc6d99f>=_0x423cb6){_0xc6d99f=_0x423cb6;_0x2097c7=0xc8;}else{_0x2097c7=0xce;}_0x56fdc6[_0x28a9('0x1b')](_0x2097c7);return _0x56fdc6[_0x28a9('0x20')](_0x28a9('0x21'),_0x1c8739+'-'+_0xc6d99f+'/'+_0x423cb6)['json'](_0x439d43);}return null;};}function patchUpdates(_0x544775){return function(_0xebfca7){try{jsonpatch['apply'](_0xebfca7,_0x544775,!![]);}catch(_0x4a7af3){return BPromise[_0x28a9('0x22')](_0x4a7af3);}return _0xebfca7[_0x28a9('0x23')]();};}function saveUpdates(_0x3de8e2,_0x2cf5e1){return function(_0x500297){if(_0x500297){return _0x500297['update'](_0x3de8e2)['then'](function(_0x27f089){return _0x27f089;});}return null;};}function removeEntity(_0x2fe7bf,_0x412eb3){return function(_0x1e2b77){if(_0x1e2b77){return _0x1e2b77[_0x28a9('0x24')]()['then'](function(){_0x2fe7bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa0ab21,_0x134795){return function(_0x3fb900){if(!_0x3fb900){_0xa0ab21[_0x28a9('0x25')](0x194);}return _0x3fb900;};}function handleError(_0x159c3d,_0x4b35ac){_0x4b35ac=_0x4b35ac||0x1f4;return function(_0x4628b3){logger['error'](_0x4628b3['stack']);if(_0x4628b3['name']){delete _0x4628b3[_0x28a9('0x26')];}_0x159c3d[_0x28a9('0x1b')](_0x4b35ac)['send'](_0x4628b3);};}exports[_0x28a9('0x27')]=function(_0x50e5e5,_0x429e7b){var _0x3c233c={},_0x46cba7={},_0x3cd009={'count':0x0,'rows':[]};var _0x2c2048=_[_0x28a9('0x28')](db[_0x28a9('0x29')][_0x28a9('0x2a')],function(_0x2b24ea){return{'name':_0x2b24ea[_0x28a9('0x2b')],'type':_0x2b24ea[_0x28a9('0x2c')][_0x28a9('0x2d')]};});_0x46cba7['model']=_[_0x28a9('0x28')](_0x2c2048,_0x28a9('0x26'));_0x46cba7['query']=_[_0x28a9('0x2e')](_0x50e5e5[_0x28a9('0x2f')]);_0x46cba7[_0x28a9('0x30')]=_['intersection'](_0x46cba7[_0x28a9('0x31')],_0x46cba7[_0x28a9('0x2f')]);_0x3c233c[_0x28a9('0x32')]=_[_0x28a9('0x33')](_0x46cba7[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x34')]));_0x3c233c[_0x28a9('0x32')]=_0x3c233c[_0x28a9('0x32')][_0x28a9('0x35')]?_0x3c233c[_0x28a9('0x32')]:_0x46cba7[_0x28a9('0x31')];if(!_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x36')]('nolimit')){_0x3c233c['limit']=qs[_0x28a9('0x1d')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x1d')]);_0x3c233c['offset']=qs['offset'](_0x50e5e5['query'][_0x28a9('0x1c')]);}_0x3c233c[_0x28a9('0x37')]=qs[_0x28a9('0x38')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x3c233c[_0x28a9('0x39')]=qs[_0x28a9('0x30')](_['pick'](_0x50e5e5[_0x28a9('0x2f')],_0x46cba7[_0x28a9('0x30')]),_0x2c2048);if(_0x50e5e5['query'][_0x28a9('0x3a')]){_0x3c233c[_0x28a9('0x39')]=_[_0x28a9('0x3b')](_0x3c233c[_0x28a9('0x39')],{'$or':_[_0x28a9('0x28')](_0x2c2048,function(_0x1bab6f){if(_0x1bab6f[_0x28a9('0x2c')]!==_0x28a9('0x3c')){var _0x2dfe32={};_0x2dfe32[_0x1bab6f[_0x28a9('0x26')]]={'$like':'%'+_0x50e5e5[_0x28a9('0x2f')]['filter']+'%'};return _0x2dfe32;}})});}_0x3c233c=_[_0x28a9('0x3b')]({},_0x3c233c,_0x50e5e5['options']);var _0x584522={'where':_0x3c233c[_0x28a9('0x39')]};return db['Automation'][_0x28a9('0x1f')](_0x584522)['then'](function(_0x3cdcee){_0x3cd009[_0x28a9('0x1f')]=_0x3cdcee;if(_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x3d')]){_0x3c233c['include']=[{'all':!![]}];}return db[_0x28a9('0x29')]['findAll'](_0x3c233c);})[_0x28a9('0x3e')](function(_0x12dd3f){_0x3cd009[_0x28a9('0x3f')]=_0x12dd3f;return _0x3cd009;})['then'](respondWithFilteredResult(_0x429e7b,_0x3c233c))[_0x28a9('0x40')](handleError(_0x429e7b,null));};exports[_0x28a9('0x41')]=function(_0x32b87f,_0x541787){var _0x597e8d={'raw':![],'where':{'id':_0x32b87f[_0x28a9('0x42')]['id']}},_0x18c94a={};_0x18c94a['model']=_['keys'](db['Automation']['rawAttributes']);_0x18c94a[_0x28a9('0x2f')]=_[_0x28a9('0x2e')](_0x32b87f[_0x28a9('0x2f')]);_0x18c94a['filters']=_['intersection'](_0x18c94a[_0x28a9('0x31')],_0x18c94a['query']);_0x597e8d['attributes']=_[_0x28a9('0x33')](_0x18c94a[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x32b87f[_0x28a9('0x2f')]['fields']));_0x597e8d[_0x28a9('0x32')]=_0x597e8d['attributes'][_0x28a9('0x35')]?_0x597e8d[_0x28a9('0x32')]:_0x18c94a[_0x28a9('0x31')];if(_0x32b87f[_0x28a9('0x2f')][_0x28a9('0x3d')]){_0x597e8d['include']=[{'all':!![]}];}_0x597e8d=_[_0x28a9('0x3b')]({},_0x597e8d,_0x32b87f[_0x28a9('0x43')]);return db[_0x28a9('0x29')]['find'](_0x597e8d)[_0x28a9('0x3e')](handleEntityNotFound(_0x541787,null))[_0x28a9('0x3e')](respondWithResult(_0x541787,null))[_0x28a9('0x40')](handleError(_0x541787,null));};exports['create']=function(_0x13e724,_0x428188){return db[_0x28a9('0x29')][_0x28a9('0x44')](_0x13e724['body'],{})[_0x28a9('0x3e')](respondWithResult(_0x428188,0xc9))['catch'](handleError(_0x428188,null));};exports[_0x28a9('0x45')]=function(_0x418426,_0x228dbd){if(_0x418426['body']['id']){delete _0x418426['body']['id'];}return db[_0x28a9('0x29')]['find']({'where':{'id':_0x418426[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0x228dbd,null))[_0x28a9('0x3e')](saveUpdates(_0x418426[_0x28a9('0x46')],null))['then'](respondWithResult(_0x228dbd,null))[_0x28a9('0x40')](handleError(_0x228dbd,null));};exports[_0x28a9('0x24')]=function(_0x8a6749,_0xf27f14){return db[_0x28a9('0x29')][_0x28a9('0x47')]({'where':{'id':_0x8a6749[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0xf27f14,null))[_0x28a9('0x3e')](removeEntity(_0xf27f14,null))['catch'](handleError(_0xf27f14,null));};exports[_0x28a9('0x48')]=function(_0x1b0200,_0x3c4884,_0x2d4f88){return db[_0x28a9('0x49')][_0x28a9('0x47')]({'where':{'id':_0x1b0200['params']['id']}})['then'](handleEntityNotFound(_0x3c4884,null))[_0x28a9('0x3e')](function(_0x5c231e){if(_0x5c231e){return _0x5c231e[_0x28a9('0x48')](_0x1b0200[_0x28a9('0x46')][_0x28a9('0x4a')],_[_0x28a9('0x4b')](_0x1b0200[_0x28a9('0x46')],[_0x28a9('0x4a'),'id'])||{});}})[_0x28a9('0x3e')](respondWithResult(_0x3c4884,null))[_0x28a9('0x40')](handleError(_0x3c4884,null));};exports[_0x28a9('0x4c')]=function(_0x29ee32,_0x58ed36,_0x14eb23){var _0x131f83={};var _0x52400d={};var _0x3724a1;var _0xbc5d33;return db['Automation']['findOne']({'where':{'id':_0x29ee32[_0x28a9('0x42')]['id']}})['then'](handleEntityNotFound(_0x58ed36,null))[_0x28a9('0x3e')](function(_0x3b5f44){if(_0x3b5f44){_0x3724a1=_0x3b5f44;_0x52400d[_0x28a9('0x31')]=_[_0x28a9('0x2e')](db['Condition']['rawAttributes']);_0x52400d[_0x28a9('0x2f')]=_['keys'](_0x29ee32['query']);_0x52400d[_0x28a9('0x30')]=_[_0x28a9('0x33')](_0x52400d[_0x28a9('0x31')],_0x52400d[_0x28a9('0x2f')]);_0x131f83[_0x28a9('0x32')]=_[_0x28a9('0x33')](_0x52400d[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x29ee32['query'][_0x28a9('0x34')]));_0x131f83['attributes']=_0x131f83['attributes'][_0x28a9('0x35')]?_0x131f83['attributes']:_0x52400d['model'];_0x131f83['order']=qs[_0x28a9('0x38')](_0x29ee32[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x131f83[_0x28a9('0x39')]=qs['filters'](_[_0x28a9('0x4d')](_0x29ee32[_0x28a9('0x2f')],_0x52400d[_0x28a9('0x30')]));if(_0x29ee32['query'][_0x28a9('0x3a')]){_0x131f83['where']=_[_0x28a9('0x3b')](_0x131f83[_0x28a9('0x39')],{'$or':_['map'](_0x131f83['attributes'],function(_0x75d099){var _0xc879c0={};_0xc879c0[_0x75d099]={'$like':'%'+_0x29ee32[_0x28a9('0x2f')][_0x28a9('0x3a')]+'%'};return _0xc879c0;})});}_0x131f83=_[_0x28a9('0x3b')]({},_0x131f83,_0x29ee32[_0x28a9('0x43')]);return _0x3724a1[_0x28a9('0x4c')](_0x131f83);}})[_0x28a9('0x3e')](function(_0x45699e){if(_0x45699e){_0xbc5d33=_0x45699e[_0x28a9('0x35')];if(!_0x29ee32[_0x28a9('0x2f')]['hasOwnProperty'](_0x28a9('0x4e'))){_0x131f83[_0x28a9('0x1d')]=qs[_0x28a9('0x1d')](_0x29ee32['query'][_0x28a9('0x1d')]);_0x131f83[_0x28a9('0x1c')]=qs['offset'](_0x29ee32[_0x28a9('0x2f')]['offset']);}return _0x3724a1['getConditions'](_0x131f83);}})[_0x28a9('0x3e')](function(_0x27e5ed){if(_0x27e5ed){return _0x27e5ed?{'count':_0xbc5d33,'rows':_0x27e5ed}:null;}})[_0x28a9('0x3e')](respondWithResult(_0x58ed36,null))[_0x28a9('0x40')](handleError(_0x58ed36,null));};exports['addActions']=function(_0x284b59,_0xa5531,_0x276f7f){return db['Action'][_0x28a9('0x47')]({'where':{'id':_0x284b59[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0xa5531,null))[_0x28a9('0x3e')](function(_0x536406){if(_0x536406){return _0x536406[_0x28a9('0x4f')](_0x284b59[_0x28a9('0x46')][_0x28a9('0x4a')],_[_0x28a9('0x4b')](_0x284b59['body'],[_0x28a9('0x4a'),'id'])||{});}})[_0x28a9('0x3e')](respondWithResult(_0xa5531,null))[_0x28a9('0x40')](handleError(_0xa5531,null));};exports['getActions']=function(_0x1effcf,_0x32325c,_0x35955c){var _0x139dfc={};var _0x23a2b7={};var _0x290b84;var _0x375cd2;return db[_0x28a9('0x29')][_0x28a9('0x50')]({'where':{'id':_0x1effcf[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0x32325c,null))['then'](function(_0x2e45a0){if(_0x2e45a0){_0x290b84=_0x2e45a0;_0x23a2b7[_0x28a9('0x31')]=_['keys'](db[_0x28a9('0x51')][_0x28a9('0x2a')]);_0x23a2b7[_0x28a9('0x2f')]=_[_0x28a9('0x2e')](_0x1effcf[_0x28a9('0x2f')]);_0x23a2b7[_0x28a9('0x30')]=_[_0x28a9('0x33')](_0x23a2b7[_0x28a9('0x31')],_0x23a2b7[_0x28a9('0x2f')]);_0x139dfc['attributes']=_[_0x28a9('0x33')](_0x23a2b7[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x1effcf['query']['fields']));_0x139dfc[_0x28a9('0x32')]=_0x139dfc[_0x28a9('0x32')][_0x28a9('0x35')]?_0x139dfc[_0x28a9('0x32')]:_0x23a2b7[_0x28a9('0x31')];_0x139dfc[_0x28a9('0x37')]=qs['sort'](_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x139dfc[_0x28a9('0x39')]=qs[_0x28a9('0x30')](_[_0x28a9('0x4d')](_0x1effcf[_0x28a9('0x2f')],_0x23a2b7[_0x28a9('0x30')]));if(_0x1effcf[_0x28a9('0x2f')]['filter']){_0x139dfc[_0x28a9('0x39')]=_['merge'](_0x139dfc[_0x28a9('0x39')],{'$or':_[_0x28a9('0x28')](_0x139dfc['attributes'],function(_0x29042c){var _0x31eb0e={};_0x31eb0e[_0x29042c]={'$like':'%'+_0x1effcf[_0x28a9('0x2f')]['filter']+'%'};return _0x31eb0e;})});}_0x139dfc=_[_0x28a9('0x3b')]({},_0x139dfc,_0x1effcf['options']);return _0x290b84[_0x28a9('0x52')](_0x139dfc);}})[_0x28a9('0x3e')](function(_0x16fd1d){if(_0x16fd1d){_0x375cd2=_0x16fd1d['length'];if(!_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x36')](_0x28a9('0x4e'))){_0x139dfc['limit']=qs[_0x28a9('0x1d')](_0x1effcf[_0x28a9('0x2f')]['limit']);_0x139dfc['offset']=qs[_0x28a9('0x1c')](_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x1c')]);}return _0x290b84[_0x28a9('0x52')](_0x139dfc);}})[_0x28a9('0x3e')](function(_0x1d85d9){if(_0x1d85d9){return _0x1d85d9?{'count':_0x375cd2,'rows':_0x1d85d9}:null;}})[_0x28a9('0x3e')](respondWithResult(_0x32325c,null))[_0x28a9('0x40')](handleError(_0x32325c,null));}; \ No newline at end of file +var _0xa8e8=['ids','omit','getConditions','findOne','rawAttributes','options','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','Automation','rows','catch','show','params','keys','find','create','body','addConditions','Condition'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xa8e8,0x1b8));var _0x8a8e=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xa8e8[_0x3f2d02];return _0x54092b;};'use strict';var emlformat=require(_0x8a8e('0x0'));var rimraf=require(_0x8a8e('0x1'));var zipdir=require(_0x8a8e('0x2'));var jsonpatch=require(_0x8a8e('0x3'));var rp=require(_0x8a8e('0x4'));var moment=require(_0x8a8e('0x5'));var BPromise=require(_0x8a8e('0x6'));var Mustache=require(_0x8a8e('0x7'));var util=require(_0x8a8e('0x8'));var path=require(_0x8a8e('0x9'));var sox=require('sox');var csv=require(_0x8a8e('0xa'));var ejs=require(_0x8a8e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a8e('0xc'));var squel=require(_0x8a8e('0xd'));var crypto=require(_0x8a8e('0xe'));var jsforce=require(_0x8a8e('0xf'));var deskjs=require(_0x8a8e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a8e('0x11'));var Papa=require(_0x8a8e('0x12'));var Redis=require(_0x8a8e('0x13'));var authService=require(_0x8a8e('0x14'));var qs=require(_0x8a8e('0x15'));var as=require(_0x8a8e('0x16'));var hardwareService=require(_0x8a8e('0x17'));var logger=require('../../config/logger')(_0x8a8e('0x18'));var utils=require(_0x8a8e('0x19'));var config=require(_0x8a8e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ddfaf,_0x4e66ab){_0x4e66ab=_0x4e66ab||0xcc;return function(_0xe29433){if(_0xe29433){return _0x7ddfaf['sendStatus'](_0x4e66ab);}return _0x7ddfaf[_0x8a8e('0x1b')](_0x4e66ab)[_0x8a8e('0x1c')]();};}function respondWithResult(_0x2b2eb3,_0x48d900){_0x48d900=_0x48d900||0xc8;return function(_0x5c1c7f){if(_0x5c1c7f){return _0x2b2eb3[_0x8a8e('0x1b')](_0x48d900)[_0x8a8e('0x1d')](_0x5c1c7f);}};}function respondWithFilteredResult(_0x2ce303,_0x35b28f){return function(_0x25d086){if(_0x25d086){var _0x48b333=typeof _0x35b28f['offset']===_0x8a8e('0x1e')&&typeof _0x35b28f[_0x8a8e('0x1f')]===_0x8a8e('0x1e');var _0x4d8603=_0x25d086[_0x8a8e('0x20')];var _0x471dd9=_0x48b333?0x0:_0x35b28f[_0x8a8e('0x21')];var _0x173ca8=_0x48b333?_0x25d086[_0x8a8e('0x20')]:_0x35b28f[_0x8a8e('0x21')]+_0x35b28f[_0x8a8e('0x1f')];var _0x5d39bb;if(_0x173ca8>=_0x4d8603){_0x173ca8=_0x4d8603;_0x5d39bb=0xc8;}else{_0x5d39bb=0xce;}_0x2ce303['status'](_0x5d39bb);return _0x2ce303['set'](_0x8a8e('0x22'),_0x471dd9+'-'+_0x173ca8+'/'+_0x4d8603)[_0x8a8e('0x1d')](_0x25d086);}return null;};}function patchUpdates(_0x4e3b32){return function(_0x1e2b6c){try{jsonpatch[_0x8a8e('0x23')](_0x1e2b6c,_0x4e3b32,!![]);}catch(_0x51f905){return BPromise[_0x8a8e('0x24')](_0x51f905);}return _0x1e2b6c[_0x8a8e('0x25')]();};}function saveUpdates(_0x389181,_0x5e3890){return function(_0x373155){if(_0x373155){return _0x373155[_0x8a8e('0x26')](_0x389181)[_0x8a8e('0x27')](function(_0xf1e895){return _0xf1e895;});}return null;};}function removeEntity(_0x3b3da7,_0x2626ca){return function(_0x4d47d2){if(_0x4d47d2){return _0x4d47d2[_0x8a8e('0x28')]()[_0x8a8e('0x27')](function(){_0x3b3da7[_0x8a8e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a1516,_0x2abc35){return function(_0x111fbf){if(!_0x111fbf){_0x1a1516['sendStatus'](0x194);}return _0x111fbf;};}function handleError(_0x258f18,_0x346531){_0x346531=_0x346531||0x1f4;return function(_0x5f3911){logger[_0x8a8e('0x29')](_0x5f3911[_0x8a8e('0x2a')]);if(_0x5f3911[_0x8a8e('0x2b')]){delete _0x5f3911[_0x8a8e('0x2b')];}_0x258f18[_0x8a8e('0x1b')](_0x346531)[_0x8a8e('0x2c')](_0x5f3911);};}exports[_0x8a8e('0x2d')]=function(_0x2e1a80,_0x3cdbe3){var _0xe16e9f={},_0x2db771={},_0xf64686={'count':0x0,'rows':[]};var _0x34990c=_[_0x8a8e('0x2e')](db['Automation']['rawAttributes'],function(_0x1da9b9){return{'name':_0x1da9b9['fieldName'],'type':_0x1da9b9[_0x8a8e('0x2f')]['key']};});_0x2db771[_0x8a8e('0x30')]=_[_0x8a8e('0x2e')](_0x34990c,_0x8a8e('0x2b'));_0x2db771[_0x8a8e('0x31')]=_['keys'](_0x2e1a80[_0x8a8e('0x31')]);_0x2db771['filters']=_[_0x8a8e('0x32')](_0x2db771['model'],_0x2db771[_0x8a8e('0x31')]);_0xe16e9f[_0x8a8e('0x33')]=_['intersection'](_0x2db771[_0x8a8e('0x30')],qs[_0x8a8e('0x34')](_0x2e1a80[_0x8a8e('0x31')][_0x8a8e('0x34')]));_0xe16e9f[_0x8a8e('0x33')]=_0xe16e9f[_0x8a8e('0x33')][_0x8a8e('0x35')]?_0xe16e9f[_0x8a8e('0x33')]:_0x2db771['model'];if(!_0x2e1a80[_0x8a8e('0x31')]['hasOwnProperty'](_0x8a8e('0x36'))){_0xe16e9f[_0x8a8e('0x1f')]=qs[_0x8a8e('0x1f')](_0x2e1a80['query'][_0x8a8e('0x1f')]);_0xe16e9f[_0x8a8e('0x21')]=qs[_0x8a8e('0x21')](_0x2e1a80['query'][_0x8a8e('0x21')]);}_0xe16e9f[_0x8a8e('0x37')]=qs[_0x8a8e('0x38')](_0x2e1a80['query'][_0x8a8e('0x38')]);_0xe16e9f[_0x8a8e('0x39')]=qs['filters'](_[_0x8a8e('0x3a')](_0x2e1a80['query'],_0x2db771[_0x8a8e('0x3b')]),_0x34990c);if(_0x2e1a80[_0x8a8e('0x31')][_0x8a8e('0x3c')]){_0xe16e9f[_0x8a8e('0x39')]=_[_0x8a8e('0x3d')](_0xe16e9f[_0x8a8e('0x39')],{'$or':_[_0x8a8e('0x2e')](_0x34990c,function(_0x2cd88d){if(_0x2cd88d[_0x8a8e('0x2f')]!==_0x8a8e('0x3e')){var _0x22ab89={};_0x22ab89[_0x2cd88d[_0x8a8e('0x2b')]]={'$like':'%'+_0x2e1a80[_0x8a8e('0x31')][_0x8a8e('0x3c')]+'%'};return _0x22ab89;}})});}_0xe16e9f=_[_0x8a8e('0x3d')]({},_0xe16e9f,_0x2e1a80['options']);var _0xd0f112={'where':_0xe16e9f[_0x8a8e('0x39')]};return db['Automation']['count'](_0xd0f112)[_0x8a8e('0x27')](function(_0x3e3281){_0xf64686['count']=_0x3e3281;if(_0x2e1a80[_0x8a8e('0x31')][_0x8a8e('0x3f')]){_0xe16e9f[_0x8a8e('0x40')]=[{'all':!![]}];}return db[_0x8a8e('0x41')]['findAll'](_0xe16e9f);})[_0x8a8e('0x27')](function(_0x4796eb){_0xf64686[_0x8a8e('0x42')]=_0x4796eb;return _0xf64686;})[_0x8a8e('0x27')](respondWithFilteredResult(_0x3cdbe3,_0xe16e9f))[_0x8a8e('0x43')](handleError(_0x3cdbe3,null));};exports[_0x8a8e('0x44')]=function(_0x25d571,_0x2103e1){var _0x11c6ac={'raw':![],'where':{'id':_0x25d571[_0x8a8e('0x45')]['id']}},_0x110a24={};_0x110a24[_0x8a8e('0x30')]=_['keys'](db['Automation']['rawAttributes']);_0x110a24[_0x8a8e('0x31')]=_[_0x8a8e('0x46')](_0x25d571['query']);_0x110a24[_0x8a8e('0x3b')]=_[_0x8a8e('0x32')](_0x110a24[_0x8a8e('0x30')],_0x110a24['query']);_0x11c6ac[_0x8a8e('0x33')]=_['intersection'](_0x110a24[_0x8a8e('0x30')],qs[_0x8a8e('0x34')](_0x25d571[_0x8a8e('0x31')][_0x8a8e('0x34')]));_0x11c6ac[_0x8a8e('0x33')]=_0x11c6ac[_0x8a8e('0x33')]['length']?_0x11c6ac[_0x8a8e('0x33')]:_0x110a24[_0x8a8e('0x30')];if(_0x25d571['query'][_0x8a8e('0x3f')]){_0x11c6ac[_0x8a8e('0x40')]=[{'all':!![]}];}_0x11c6ac=_[_0x8a8e('0x3d')]({},_0x11c6ac,_0x25d571['options']);return db['Automation'][_0x8a8e('0x47')](_0x11c6ac)[_0x8a8e('0x27')](handleEntityNotFound(_0x2103e1,null))['then'](respondWithResult(_0x2103e1,null))[_0x8a8e('0x43')](handleError(_0x2103e1,null));};exports['create']=function(_0x1cd642,_0x165787){return db[_0x8a8e('0x41')][_0x8a8e('0x48')](_0x1cd642[_0x8a8e('0x49')],{})['then'](respondWithResult(_0x165787,0xc9))[_0x8a8e('0x43')](handleError(_0x165787,null));};exports['update']=function(_0x40c227,_0x2db90e){if(_0x40c227[_0x8a8e('0x49')]['id']){delete _0x40c227['body']['id'];}return db[_0x8a8e('0x41')][_0x8a8e('0x47')]({'where':{'id':_0x40c227['params']['id']}})[_0x8a8e('0x27')](handleEntityNotFound(_0x2db90e,null))[_0x8a8e('0x27')](saveUpdates(_0x40c227[_0x8a8e('0x49')],null))[_0x8a8e('0x27')](respondWithResult(_0x2db90e,null))[_0x8a8e('0x43')](handleError(_0x2db90e,null));};exports[_0x8a8e('0x28')]=function(_0x29d900,_0x4106e1){return db[_0x8a8e('0x41')][_0x8a8e('0x47')]({'where':{'id':_0x29d900['params']['id']}})[_0x8a8e('0x27')](handleEntityNotFound(_0x4106e1,null))[_0x8a8e('0x27')](removeEntity(_0x4106e1,null))[_0x8a8e('0x43')](handleError(_0x4106e1,null));};exports[_0x8a8e('0x4a')]=function(_0x47d410,_0x1c968d,_0x59b383){return db[_0x8a8e('0x4b')][_0x8a8e('0x47')]({'where':{'id':_0x47d410['params']['id']}})['then'](handleEntityNotFound(_0x1c968d,null))[_0x8a8e('0x27')](function(_0x21bc61){if(_0x21bc61){return _0x21bc61[_0x8a8e('0x4a')](_0x47d410[_0x8a8e('0x49')][_0x8a8e('0x4c')],_[_0x8a8e('0x4d')](_0x47d410[_0x8a8e('0x49')],[_0x8a8e('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x1c968d,null))[_0x8a8e('0x43')](handleError(_0x1c968d,null));};exports[_0x8a8e('0x4e')]=function(_0x404916,_0x29debf,_0x3c3ef9){var _0xca20c3={};var _0x2a4a33={};var _0x30f0f4;var _0x4b1811;return db[_0x8a8e('0x41')][_0x8a8e('0x4f')]({'where':{'id':_0x404916[_0x8a8e('0x45')]['id']}})[_0x8a8e('0x27')](handleEntityNotFound(_0x29debf,null))[_0x8a8e('0x27')](function(_0x159e76){if(_0x159e76){_0x30f0f4=_0x159e76;_0x2a4a33[_0x8a8e('0x30')]=_[_0x8a8e('0x46')](db[_0x8a8e('0x4b')][_0x8a8e('0x50')]);_0x2a4a33[_0x8a8e('0x31')]=_[_0x8a8e('0x46')](_0x404916['query']);_0x2a4a33[_0x8a8e('0x3b')]=_['intersection'](_0x2a4a33[_0x8a8e('0x30')],_0x2a4a33[_0x8a8e('0x31')]);_0xca20c3['attributes']=_[_0x8a8e('0x32')](_0x2a4a33[_0x8a8e('0x30')],qs[_0x8a8e('0x34')](_0x404916[_0x8a8e('0x31')][_0x8a8e('0x34')]));_0xca20c3[_0x8a8e('0x33')]=_0xca20c3[_0x8a8e('0x33')][_0x8a8e('0x35')]?_0xca20c3[_0x8a8e('0x33')]:_0x2a4a33[_0x8a8e('0x30')];_0xca20c3[_0x8a8e('0x37')]=qs['sort'](_0x404916[_0x8a8e('0x31')][_0x8a8e('0x38')]);_0xca20c3[_0x8a8e('0x39')]=qs[_0x8a8e('0x3b')](_[_0x8a8e('0x3a')](_0x404916[_0x8a8e('0x31')],_0x2a4a33[_0x8a8e('0x3b')]));if(_0x404916['query'][_0x8a8e('0x3c')]){_0xca20c3[_0x8a8e('0x39')]=_[_0x8a8e('0x3d')](_0xca20c3[_0x8a8e('0x39')],{'$or':_[_0x8a8e('0x2e')](_0xca20c3['attributes'],function(_0x2eaa2f){var _0x194d05={};_0x194d05[_0x2eaa2f]={'$like':'%'+_0x404916[_0x8a8e('0x31')][_0x8a8e('0x3c')]+'%'};return _0x194d05;})});}_0xca20c3=_[_0x8a8e('0x3d')]({},_0xca20c3,_0x404916[_0x8a8e('0x51')]);return _0x30f0f4['getConditions'](_0xca20c3);}})[_0x8a8e('0x27')](function(_0x5942c4){if(_0x5942c4){_0x4b1811=_0x5942c4['length'];if(!_0x404916['query'][_0x8a8e('0x52')](_0x8a8e('0x36'))){_0xca20c3[_0x8a8e('0x1f')]=qs['limit'](_0x404916['query'][_0x8a8e('0x1f')]);_0xca20c3[_0x8a8e('0x21')]=qs[_0x8a8e('0x21')](_0x404916[_0x8a8e('0x31')][_0x8a8e('0x21')]);}return _0x30f0f4[_0x8a8e('0x4e')](_0xca20c3);}})[_0x8a8e('0x27')](function(_0x24601d){if(_0x24601d){return _0x24601d?{'count':_0x4b1811,'rows':_0x24601d}:null;}})[_0x8a8e('0x27')](respondWithResult(_0x29debf,null))['catch'](handleError(_0x29debf,null));};exports[_0x8a8e('0x53')]=function(_0x32fa73,_0x576475,_0x3aee3d){return db[_0x8a8e('0x54')]['find']({'where':{'id':_0x32fa73[_0x8a8e('0x45')]['id']}})[_0x8a8e('0x27')](handleEntityNotFound(_0x576475,null))['then'](function(_0x859adc){if(_0x859adc){return _0x859adc[_0x8a8e('0x53')](_0x32fa73[_0x8a8e('0x49')][_0x8a8e('0x4c')],_[_0x8a8e('0x4d')](_0x32fa73[_0x8a8e('0x49')],['ids','id'])||{});}})[_0x8a8e('0x27')](respondWithResult(_0x576475,null))['catch'](handleError(_0x576475,null));};exports[_0x8a8e('0x55')]=function(_0x41e566,_0x2d75cd,_0x312729){var _0x566493={};var _0x25dd5c={};var _0x52eaf7;var _0x3d4957;return db[_0x8a8e('0x41')][_0x8a8e('0x4f')]({'where':{'id':_0x41e566[_0x8a8e('0x45')]['id']}})[_0x8a8e('0x27')](handleEntityNotFound(_0x2d75cd,null))[_0x8a8e('0x27')](function(_0x2a0605){if(_0x2a0605){_0x52eaf7=_0x2a0605;_0x25dd5c[_0x8a8e('0x30')]=_[_0x8a8e('0x46')](db[_0x8a8e('0x54')][_0x8a8e('0x50')]);_0x25dd5c[_0x8a8e('0x31')]=_[_0x8a8e('0x46')](_0x41e566['query']);_0x25dd5c[_0x8a8e('0x3b')]=_[_0x8a8e('0x32')](_0x25dd5c['model'],_0x25dd5c[_0x8a8e('0x31')]);_0x566493[_0x8a8e('0x33')]=_['intersection'](_0x25dd5c[_0x8a8e('0x30')],qs[_0x8a8e('0x34')](_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x34')]));_0x566493['attributes']=_0x566493['attributes'][_0x8a8e('0x35')]?_0x566493[_0x8a8e('0x33')]:_0x25dd5c[_0x8a8e('0x30')];_0x566493[_0x8a8e('0x37')]=qs[_0x8a8e('0x38')](_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x38')]);_0x566493['where']=qs['filters'](_[_0x8a8e('0x3a')](_0x41e566[_0x8a8e('0x31')],_0x25dd5c[_0x8a8e('0x3b')]));if(_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x3c')]){_0x566493[_0x8a8e('0x39')]=_['merge'](_0x566493[_0x8a8e('0x39')],{'$or':_[_0x8a8e('0x2e')](_0x566493[_0x8a8e('0x33')],function(_0x114d4e){var _0x2730f0={};_0x2730f0[_0x114d4e]={'$like':'%'+_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x3c')]+'%'};return _0x2730f0;})});}_0x566493=_[_0x8a8e('0x3d')]({},_0x566493,_0x41e566[_0x8a8e('0x51')]);return _0x52eaf7[_0x8a8e('0x55')](_0x566493);}})[_0x8a8e('0x27')](function(_0xd4b360){if(_0xd4b360){_0x3d4957=_0xd4b360[_0x8a8e('0x35')];if(!_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x52')]('nolimit')){_0x566493[_0x8a8e('0x1f')]=qs[_0x8a8e('0x1f')](_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x1f')]);_0x566493[_0x8a8e('0x21')]=qs['offset'](_0x41e566[_0x8a8e('0x31')][_0x8a8e('0x21')]);}return _0x52eaf7['getActions'](_0x566493);}})[_0x8a8e('0x27')](function(_0x47667c){if(_0x47667c){return _0x47667c?{'count':_0x3d4957,'rows':_0x47667c}:null;}})[_0x8a8e('0x27')](respondWithResult(_0x2d75cd,null))[_0x8a8e('0x43')](handleError(_0x2d75cd,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c1d0f6b..cf8d89c 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 _0x63a1=['define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x63a1,0xe6));var _0x163a=function(_0x5e6f63,_0x36f9ba){_0x5e6f63=_0x5e6f63-0x0;var _0x3e1b24=_0x63a1[_0x5e6f63];return _0x3e1b24;};'use strict';var _=require(_0x163a('0x0'));var util=require(_0x163a('0x1'));var logger=require(_0x163a('0x2'))(_0x163a('0x3'));var moment=require(_0x163a('0x4'));var BPromise=require(_0x163a('0x5'));var rp=require(_0x163a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x163a('0x7'));var config=require(_0x163a('0x8'));var attributes=require('./automation.attributes');module[_0x163a('0x9')]=function(_0x46e19b,_0x3f2000){return _0x46e19b[_0x163a('0xa')](_0x163a('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x594a=['tools_automations','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x594a,0xd2));var _0xa594=function(_0x12f53b,_0x26807f){_0x12f53b=_0x12f53b-0x0;var _0x287270=_0x594a[_0x12f53b];return _0x287270;};'use strict';var _=require('lodash');var util=require(_0xa594('0x0'));var logger=require(_0xa594('0x1'))('api');var moment=require(_0xa594('0x2'));var BPromise=require(_0xa594('0x3'));var rp=require(_0xa594('0x4'));var fs=require('fs');var path=require(_0xa594('0x5'));var rimraf=require('rimraf');var config=require(_0xa594('0x6'));var attributes=require(_0xa594('0x7'));module[_0xa594('0x8')]=function(_0x21c7cc,_0x393d1a){return _0x21c7cc[_0xa594('0x9')]('Automation',attributes,{'tableName':_0xa594('0xa'),'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 f24d842..cba8771 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 _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57d640,_0x4af08a){var _0xd11d78=function(_0x44e824){while(--_0x44e824){_0x57d640['push'](_0x57d640['shift']());}};_0xd11d78(++_0x4af08a);}(_0x9148,0x10d));var _0x8914=function(_0x4a5070,_0x43eca5){_0x4a5070=_0x4a5070-0x0;var _0x1800de=_0x9148[_0x4a5070];return _0x1800de;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});} \ No newline at end of file +var _0x20d8=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x31d2d0,_0x59bec0){var _0x2ad877=function(_0x16b0ef){while(--_0x16b0ef){_0x31d2d0['push'](_0x31d2d0['shift']());}};_0x2ad877(++_0x59bec0);}(_0x20d8,0xee));var _0x820d=function(_0x26a0a4,_0x5be4cb){_0x26a0a4=_0x26a0a4-0x0;var _0x2481a3=_0x20d8[_0x26a0a4];return _0x2481a3;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('Automation,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index cc7ab36..6bd5611 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 _0xdb4b=['addActions','put','/:id','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getActions','post','addConditions'];(function(_0x56b557,_0x4e06b1){var _0x596b6a=function(_0x5e5033){while(--_0x5e5033){_0x56b557['push'](_0x56b557['shift']());}};_0x596b6a(++_0x4e06b1);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x54691d,_0x391ae4){_0x54691d=_0x54691d-0x0;var _0x4636bd=_0xdb4b[_0x54691d];return _0x4636bd;};'use strict';var multer=require('multer');var util=require(_0xbdb4('0x0'));var path=require('path');var timeout=require(_0xbdb4('0x1'));var express=require(_0xbdb4('0x2'));var router=express[_0xbdb4('0x3')]();var fs_extra=require(_0xbdb4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbdb4('0x5'));var config=require(_0xbdb4('0x6'));var controller=require(_0xbdb4('0x7'));router[_0xbdb4('0x8')]('/',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xa')]);router[_0xbdb4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbdb4('0xb')]);router[_0xbdb4('0x8')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller['getConditions']);router[_0xbdb4('0x8')]('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xd')]);router[_0xbdb4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbdb4('0xe')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xf')]);router['post']('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x10')]);router[_0xbdb4('0x11')](_0xbdb4('0x12'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x13')]);router['delete']('/:id',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x14')]);module['exports']=router; \ No newline at end of file +var _0x01fe=['addConditions','/:id/actions','addActions','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getActions','post'];(function(_0x17c361,_0x50fec3){var _0x3bf205=function(_0x509918){while(--_0x509918){_0x17c361['push'](_0x17c361['shift']());}};_0x3bf205(++_0x50fec3);}(_0x01fe,0x102));var _0xe01f=function(_0x4daf7f,_0x869fa4){_0x4daf7f=_0x4daf7f-0x0;var _0x1ad812=_0x01fe[_0x4daf7f];return _0x1ad812;};'use strict';var multer=require(_0xe01f('0x0'));var util=require('util');var path=require(_0xe01f('0x1'));var timeout=require(_0xe01f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe01f('0x3'));var auth=require(_0xe01f('0x4'));var interaction=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var controller=require('./automation.controller');router[_0xe01f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe01f('0x8')]);router[_0xe01f('0x7')](_0xe01f('0x9'),auth[_0xe01f('0xa')](),controller[_0xe01f('0xb')]);router['get'](_0xe01f('0xc'),auth[_0xe01f('0xa')](),controller['getConditions']);router[_0xe01f('0x7')]('/:id/actions',auth[_0xe01f('0xa')](),controller[_0xe01f('0xd')]);router['post']('/',auth[_0xe01f('0xa')](),controller['create']);router[_0xe01f('0xe')](_0xe01f('0xc'),auth[_0xe01f('0xa')](),controller[_0xe01f('0xf')]);router[_0xe01f('0xe')](_0xe01f('0x10'),auth[_0xe01f('0xa')](),controller[_0xe01f('0x11')]);router['put'](_0xe01f('0x9'),auth[_0xe01f('0xa')](),controller[_0xe01f('0x12')]);router[_0xe01f('0x13')](_0xe01f('0x9'),auth[_0xe01f('0xa')](),controller[_0xe01f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 241e49d..8b1efd5 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 _0xf577=['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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xf577,0x1da));var _0x7f57=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xf577[_0x2080a3];return _0x8d7d17;};'use strict';var Sequelize=require(_0x7f57('0x0'));module[_0x7f57('0x1')]={'name':{'type':Sequelize[_0x7f57('0x2')],'unique':_0x7f57('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7f57('0x2')]},'active':{'type':Sequelize[_0x7f57('0x6')],'defaultValue':0x0,'comment':_0x7f57('0x7')},'limitCalls':{'type':Sequelize[_0x7f57('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7f57('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7f57('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7f57('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'comment':_0x7f57('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7f57('0x10')},'dialTimezone':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x11'),'never',_0x7f57('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7f57('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7f57('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7f57('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7f57('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7f57('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7f57('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7f57('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7f57('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x19'),_0x7f57('0x1a')),'defaultValue':_0x7f57('0x19')},'dialPrefix':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7f57('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x24')}}; \ No newline at end of file +var _0xcabe=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','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)','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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x23a11d,_0x24442c){var _0x2e593c=function(_0x435799){while(--_0x435799){_0x23a11d['push'](_0x23a11d['shift']());}};_0x2e593c(++_0x24442c);}(_0xcabe,0x1ef));var _0xecab=function(_0x4edb2b,_0x798bc1){_0x4edb2b=_0x4edb2b-0x0;var _0x5ada87=_0xcabe[_0x4edb2b];return _0x5ada87;};'use strict';var Sequelize=require(_0xecab('0x0'));module['exports']={'name':{'type':Sequelize[_0xecab('0x1')],'unique':_0xecab('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xecab('0x3')),'allowNull':![],'defaultValue':_0xecab('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xecab('0x4')],'defaultValue':0x0,'comment':_0xecab('0x5')},'limitCalls':{'type':Sequelize[_0xecab('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xecab('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xecab('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xecab('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xecab('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xecab('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xecab('0x10'),_0xecab('0x11'),_0xecab('0x12')),'defaultValue':_0xecab('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xecab('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xecab('0x6')](0x9)[_0xecab('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xecab('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xecab('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xecab('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xecab('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xecab('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xecab('0x6')](0x9)[_0xecab('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xecab('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xecab('0x6')](0x9)[_0xecab('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xecab('0x6')](0x9)[_0xecab('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xecab('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xecab('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xecab('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xecab('0x6')](0x9)[_0xecab('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xecab('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xecab('0x1b')](_0xecab('0x1c'),_0xecab('0x1d')),'defaultValue':_0xecab('0x1c')},'dialPrefix':{'type':Sequelize[_0xecab('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xecab('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xecab('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xecab('0x6')](0x3)[_0xecab('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xecab('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xecab('0x6')](0x5)[_0xecab('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xecab('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 621f5da..91bd53c 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 _0x86ec=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','select','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash'];(function(_0x5eb215,_0x3c9318){var _0x9af3a1=function(_0x129122){while(--_0x129122){_0x5eb215['push'](_0x5eb215['shift']());}};_0x9af3a1(++_0x3c9318);}(_0x86ec,0x102));var _0xc86e=function(_0x139e81,_0x53418){_0x139e81=_0x139e81-0x0;var _0x348c8c=_0x86ec[_0x139e81];return _0x348c8c;};'use strict';var emlformat=require(_0xc86e('0x0'));var rimraf=require(_0xc86e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc86e('0x2'));var rp=require(_0xc86e('0x3'));var moment=require(_0xc86e('0x4'));var BPromise=require(_0xc86e('0x5'));var Mustache=require('mustache');var util=require(_0xc86e('0x6'));var path=require(_0xc86e('0x7'));var sox=require(_0xc86e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc86e('0x9'));var squel=require(_0xc86e('0xa'));var crypto=require(_0xc86e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc86e('0xc'));var toCsv=require(_0xc86e('0xd'));var querystring=require(_0xc86e('0xe'));var Papa=require(_0xc86e('0xf'));var Redis=require(_0xc86e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc86e('0x11'));var hardwareService=require(_0xc86e('0x12'));var logger=require('../../config/logger')(_0xc86e('0x13'));var utils=require(_0xc86e('0x14'));var config=require(_0xc86e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9fdc35,_0x434167){_0x434167=_0x434167||0xcc;return function(_0x5b74ab){if(_0x5b74ab){return _0x9fdc35[_0xc86e('0x16')](_0x434167);}return _0x9fdc35['status'](_0x434167)[_0xc86e('0x17')]();};}function respondWithResult(_0x2d5f96,_0x581a05){_0x581a05=_0x581a05||0xc8;return function(_0x2bcf58){if(_0x2bcf58){return _0x2d5f96[_0xc86e('0x18')](_0x581a05)[_0xc86e('0x19')](_0x2bcf58);}};}function respondWithFilteredResult(_0xe7dc41,_0xb2c616){return function(_0x314f60){if(_0x314f60){var _0x5a1eb3=typeof _0xb2c616[_0xc86e('0x1a')]===_0xc86e('0x1b')&&typeof _0xb2c616[_0xc86e('0x1c')]===_0xc86e('0x1b');var _0xe3f46d=_0x314f60[_0xc86e('0x1d')];var _0x2a9198=_0x5a1eb3?0x0:_0xb2c616[_0xc86e('0x1a')];var _0x8d481b=_0x5a1eb3?_0x314f60[_0xc86e('0x1d')]:_0xb2c616[_0xc86e('0x1a')]+_0xb2c616[_0xc86e('0x1c')];var _0x1fbf58;if(_0x8d481b>=_0xe3f46d){_0x8d481b=_0xe3f46d;_0x1fbf58=0xc8;}else{_0x1fbf58=0xce;}_0xe7dc41[_0xc86e('0x18')](_0x1fbf58);return _0xe7dc41['set'](_0xc86e('0x1e'),_0x2a9198+'-'+_0x8d481b+'/'+_0xe3f46d)[_0xc86e('0x19')](_0x314f60);}return null;};}function patchUpdates(_0x3ab039){return function(_0x5bd15b){try{jsonpatch['apply'](_0x5bd15b,_0x3ab039,!![]);}catch(_0x249903){return BPromise['reject'](_0x249903);}return _0x5bd15b[_0xc86e('0x1f')]();};}function saveUpdates(_0x3a6106,_0x4c63a3){return function(_0x1eb523){if(_0x1eb523){return _0x1eb523['update'](_0x3a6106)[_0xc86e('0x20')](function(_0x2e4c7f){return _0x2e4c7f;});}return null;};}function removeEntity(_0x263e9e,_0x442e50){return function(_0x2432fb){if(_0x2432fb){return _0x2432fb[_0xc86e('0x21')]()['then'](function(){var _0x25a01e=_0x2432fb[_0xc86e('0x22')]({'plain':!![]});var _0x451374=_0xc86e('0x23');return db['UserProfileResource'][_0xc86e('0x21')]({'where':{'type':_0x451374,'resourceId':_0x25a01e['id']}})[_0xc86e('0x20')](function(){return _0x2432fb;});})['then'](function(){_0x263e9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e655,_0x4763e3){return function(_0x2ab034){if(!_0x2ab034){_0x52e655[_0xc86e('0x16')](0x194);}return _0x2ab034;};}function handleError(_0x376104,_0x4b0a84){_0x4b0a84=_0x4b0a84||0x1f4;return function(_0xd1e56c){logger[_0xc86e('0x24')](_0xd1e56c[_0xc86e('0x25')]);if(_0xd1e56c['name']){delete _0xd1e56c[_0xc86e('0x26')];}_0x376104['status'](_0x4b0a84)[_0xc86e('0x27')](_0xd1e56c);};}exports[_0xc86e('0x28')]=function(_0x4fc828,_0x18e5d4){var _0x2c20b8={},_0x5c5c2c={},_0x43e25f={'count':0x0,'rows':[]};var _0x4d2f8e=_[_0xc86e('0x29')](db[_0xc86e('0x2a')][_0xc86e('0x2b')],function(_0x16ebc0){return{'name':_0x16ebc0[_0xc86e('0x2c')],'type':_0x16ebc0[_0xc86e('0x2d')]['key']};});_0x5c5c2c[_0xc86e('0x2e')]=_[_0xc86e('0x29')](_0x4d2f8e,'name');_0x5c5c2c[_0xc86e('0x2f')]=_['keys'](_0x4fc828[_0xc86e('0x2f')]);_0x5c5c2c[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x5c5c2c[_0xc86e('0x2e')],_0x5c5c2c[_0xc86e('0x2f')]);_0x2c20b8['attributes']=_[_0xc86e('0x31')](_0x5c5c2c[_0xc86e('0x2e')],qs['fields'](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x2c20b8[_0xc86e('0x33')]=_0x2c20b8[_0xc86e('0x33')][_0xc86e('0x34')]?_0x2c20b8[_0xc86e('0x33')]:_0x5c5c2c[_0xc86e('0x2e')];if(!_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x2c20b8['limit']=qs[_0xc86e('0x1c')](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x2c20b8[_0xc86e('0x1a')]=qs['offset'](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x2c20b8[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x4fc828[_0xc86e('0x2f')]['sort']);_0x2c20b8[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x4fc828[_0xc86e('0x2f')],_0x5c5c2c[_0xc86e('0x30')]),_0x4d2f8e);if(_0x4fc828['query'][_0xc86e('0x3a')]){_0x2c20b8[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x2c20b8['where'],{'$or':_[_0xc86e('0x29')](_0x4d2f8e,function(_0x255889){if(_0x255889[_0xc86e('0x2d')]!==_0xc86e('0x3c')){var _0x51115e={};_0x51115e[_0x255889[_0xc86e('0x26')]]={'$like':'%'+_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x51115e;}})});}_0x2c20b8=_[_0xc86e('0x3b')]({},_0x2c20b8,_0x4fc828[_0xc86e('0x3d')]);var _0x510841={'where':_0x2c20b8[_0xc86e('0x38')]};return db[_0xc86e('0x2a')][_0xc86e('0x1d')](_0x510841)[_0xc86e('0x20')](function(_0xb10538){_0x43e25f[_0xc86e('0x1d')]=_0xb10538;if(_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x2c20b8[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x2a')]['findAll'](_0x2c20b8);})[_0xc86e('0x20')](function(_0x33dd29){_0x43e25f[_0xc86e('0x40')]=_0x33dd29;return _0x43e25f;})[_0xc86e('0x20')](respondWithFilteredResult(_0x18e5d4,_0x2c20b8))[_0xc86e('0x41')](handleError(_0x18e5d4,null));};exports[_0xc86e('0x42')]=function(_0x516279,_0x2ac706){var _0x34d763={'raw':![],'where':{'id':_0x516279[_0xc86e('0x43')]['id']}},_0x3bfb09={};_0x3bfb09[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x2a')][_0xc86e('0x2b')]);_0x3bfb09[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x516279[_0xc86e('0x2f')]);_0x3bfb09[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x3bfb09[_0xc86e('0x2e')],_0x3bfb09[_0xc86e('0x2f')]);_0x34d763['attributes']=_[_0xc86e('0x31')](_0x3bfb09[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x516279[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x34d763[_0xc86e('0x33')]=_0x34d763['attributes'][_0xc86e('0x34')]?_0x34d763[_0xc86e('0x33')]:_0x3bfb09[_0xc86e('0x2e')];if(_0x516279['query'][_0xc86e('0x3e')]){_0x34d763[_0xc86e('0x3f')]=[{'all':!![]}];}_0x34d763=_[_0xc86e('0x3b')]({},_0x34d763,_0x516279[_0xc86e('0x3d')]);return db['Campaign'][_0xc86e('0x45')](_0x34d763)[_0xc86e('0x20')](handleEntityNotFound(_0x2ac706,null))[_0xc86e('0x20')](respondWithResult(_0x2ac706,null))[_0xc86e('0x41')](handleError(_0x2ac706,null));};exports['create']=function(_0x5b3003,_0x345733){return db['Campaign'][_0xc86e('0x46')](_0x5b3003[_0xc86e('0x47')],{})['then'](function(_0x544d31){var _0x52574c=_0x5b3003[_0xc86e('0x48')][_0xc86e('0x22')]({'plain':!![]});if(!_0x52574c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52574c['role']===_0xc86e('0x48')){var _0x25a75e=_0x544d31[_0xc86e('0x22')]({'plain':!![]});var _0x2a71c8=_0xc86e('0x23');return db[_0xc86e('0x49')][_0xc86e('0x45')]({'where':{'name':_0x2a71c8,'userProfileId':_0x52574c[_0xc86e('0x4a')]},'raw':!![]})[_0xc86e('0x20')](function(_0x416ccd){if(_0x416ccd&&_0x416ccd['autoAssociation']===0x0){return db[_0xc86e('0x4b')][_0xc86e('0x46')]({'name':_0x25a75e['name'],'resourceId':_0x25a75e['id'],'type':_0x416ccd[_0xc86e('0x26')],'sectionId':_0x416ccd['id']},{})['then'](function(){return _0x544d31;});}else{return _0x544d31;}})[_0xc86e('0x41')](function(_0x4a0d9f){logger[_0xc86e('0x24')](_0xc86e('0x4c'),_0x4a0d9f);throw _0x4a0d9f;});}return _0x544d31;})[_0xc86e('0x20')](respondWithResult(_0x345733,0xc9))[_0xc86e('0x41')](handleError(_0x345733,null));};exports[_0xc86e('0x4d')]=function(_0x3649ec,_0x3df6da){var _0x1860a1={'where':{'id':_0x3649ec['params']['id']}},_0x18df65={};_0x18df65[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x2a')]['rawAttributes']);_0x1860a1[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x18df65[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x3649ec[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x1860a1[_0xc86e('0x33')]=_0x1860a1[_0xc86e('0x33')]['length']?_0x1860a1['attributes']:_0x18df65[_0xc86e('0x2e')];if(_0x3649ec['query'][_0xc86e('0x3e')]){_0x1860a1[_0xc86e('0x3f')]=[{'all':!![]}];}_0x1860a1=_[_0xc86e('0x3b')]({},_0x1860a1,_0x3649ec[_0xc86e('0x3d')]);return db[_0xc86e('0x2a')][_0xc86e('0x45')](_0x1860a1)[_0xc86e('0x20')](handleEntityNotFound(_0x3df6da,null))['then'](function(_0x43c8fe){if(_0x43c8fe){var _0xaf3677=_0x43c8fe[_0xc86e('0x22')]({'plain':!![]});_0xaf3677=qs[_0xc86e('0x4e')](_0xaf3677,['id','createdAt',_0xc86e('0x4f')]);_0x3649ec[_0xc86e('0x47')]=_[_0xc86e('0x4e')](_0x3649ec[_0xc86e('0x47')],['id',_0xc86e('0x50'),'updatedAt']);return db[_0xc86e('0x2a')][_0xc86e('0x46')](_[_0xc86e('0x3b')](_0xaf3677,_0x3649ec['body']),{'include':_0x3649ec[_0xc86e('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0xc86e('0x20')](function(_0x3a821d){var _0x6c78b5=_0x3649ec[_0xc86e('0x48')][_0xc86e('0x22')]({'plain':!![]});if(!_0x6c78b5)throw new Error(_0xc86e('0x51'));if(_0x6c78b5[_0xc86e('0x52')]===_0xc86e('0x48')){var _0x3a5c12=_0x3a821d['get']({'plain':!![]});var _0x3138e5=_0xc86e('0x23');return db['UserProfileSection'][_0xc86e('0x45')]({'where':{'name':_0x3138e5,'userProfileId':_0x6c78b5[_0xc86e('0x4a')]},'raw':!![]})[_0xc86e('0x20')](function(_0x5671e2){if(_0x5671e2&&_0x5671e2[_0xc86e('0x53')]===0x0){return db[_0xc86e('0x4b')][_0xc86e('0x46')]({'name':_0x3a5c12[_0xc86e('0x26')],'resourceId':_0x3a5c12['id'],'type':_0x5671e2['name'],'sectionId':_0x5671e2['id']},{})['then'](function(){return _0x3a821d;});}else{return _0x3a821d;}})[_0xc86e('0x41')](function(_0x527bd7){logger[_0xc86e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x527bd7);throw _0x527bd7;});}return _0x3a821d;});}})[_0xc86e('0x20')](respondWithResult(_0x3df6da,0xc9))[_0xc86e('0x41')](handleError(_0x3df6da,null));};exports[_0xc86e('0x54')]=function(_0x12b1a9,_0xe74150){if(_0x12b1a9['body']['id']){delete _0x12b1a9[_0xc86e('0x47')]['id'];}return db['Campaign'][_0xc86e('0x45')]({'where':{'id':_0x12b1a9[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0xe74150,null))[_0xc86e('0x20')](saveUpdates(_0x12b1a9['body'],null))[_0xc86e('0x20')](respondWithResult(_0xe74150,null))[_0xc86e('0x41')](handleError(_0xe74150,null));};exports[_0xc86e('0x21')]=function(_0x3cd3d,_0x46a782){return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x3cd3d[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x46a782,null))[_0xc86e('0x20')](removeEntity(_0x46a782,null))['catch'](handleError(_0x46a782,null));};exports[_0xc86e('0x55')]=function(_0x482b58,_0x1fc165,_0x70dc75){var _0x77eb31={'raw':!![],'where':{}};var _0x538907={};var _0x43fc1c={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x482b58['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1fc165,null))[_0xc86e('0x20')](function(_0x1080d8){if(_0x1080d8){_0x538907[_0xc86e('0x2e')]=_['keys'](db[_0xc86e('0x57')][_0xc86e('0x2b')]);_0x538907[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x482b58[_0xc86e('0x2f')]);_0x538907[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x538907[_0xc86e('0x2e')],_0x538907[_0xc86e('0x2f')]);_0x77eb31[_0xc86e('0x33')]=_['intersection'](_0x538907[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x482b58[_0xc86e('0x2f')]['fields']));_0x77eb31[_0xc86e('0x33')]=_0x77eb31[_0xc86e('0x33')][_0xc86e('0x34')]?_0x77eb31[_0xc86e('0x33')]:_0x538907[_0xc86e('0x2e')];if(!_0x482b58[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x77eb31[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x482b58[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x77eb31[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x482b58[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x77eb31[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x482b58['query'][_0xc86e('0x37')]);_0x77eb31[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x482b58['query'],_0x538907[_0xc86e('0x30')]));_0x77eb31[_0xc86e('0x38')][_0xc86e('0x58')]=_0x1080d8['id'];if(_0x482b58[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x77eb31[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x77eb31[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x77eb31['attributes'],function(_0x9f2223){var _0x515da5={};_0x515da5[_0x9f2223]={'$like':'%'+_0x482b58[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x515da5;})});}_0x77eb31=_[_0xc86e('0x3b')]({},_0x77eb31,_0x482b58[_0xc86e('0x3d')]);return db[_0xc86e('0x57')]['count']({'where':_0x77eb31[_0xc86e('0x38')]})[_0xc86e('0x20')](function(_0x51d660){_0x43fc1c[_0xc86e('0x1d')]=_0x51d660;if(_0x482b58['query'][_0xc86e('0x3e')]){_0x77eb31['include']=[{'all':!![]}];}return db[_0xc86e('0x57')][_0xc86e('0x59')](_0x77eb31);})[_0xc86e('0x20')](function(_0x1373ce){_0x43fc1c[_0xc86e('0x40')]=_0x1373ce;return _0x43fc1c;});}})['then'](respondWithFilteredResult(_0x1fc165,_0x77eb31))[_0xc86e('0x41')](handleError(_0x1fc165,null));};exports[_0xc86e('0x5a')]=function(_0x37f6d2,_0x170484,_0x59dd40){var _0x15eeb7={'raw':!![],'where':{}};var _0x4dd141={};var _0x239183={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x37f6d2[_0xc86e('0x43')]['id']}})['then'](handleEntityNotFound(_0x170484,null))[_0xc86e('0x20')](function(_0x5e01f0){if(_0x5e01f0){_0x4dd141[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x5b')][_0xc86e('0x2b')]);_0x4dd141[_0xc86e('0x2f')]=_['keys'](_0x37f6d2['query']);_0x4dd141[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x4dd141['model'],_0x4dd141[_0xc86e('0x2f')]);_0x15eeb7[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x4dd141['model'],qs[_0xc86e('0x32')](_0x37f6d2['query']['fields']));_0x15eeb7['attributes']=_0x15eeb7['attributes'][_0xc86e('0x34')]?_0x15eeb7[_0xc86e('0x33')]:_0x4dd141[_0xc86e('0x2e')];if(!_0x37f6d2[_0xc86e('0x2f')]['hasOwnProperty'](_0xc86e('0x5c'))){_0x15eeb7['limit']=qs[_0xc86e('0x1c')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x15eeb7[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x15eeb7[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x15eeb7['where']=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x37f6d2['query'],_0x4dd141[_0xc86e('0x30')]));_0x15eeb7[_0xc86e('0x38')][_0xc86e('0x58')]=_0x5e01f0['id'];if(_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x15eeb7['where']=_['merge'](_0x15eeb7[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x15eeb7[_0xc86e('0x33')],function(_0x4e7cae){var _0x3de7bb={};_0x3de7bb[_0x4e7cae]={'$like':'%'+_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x3de7bb;})});}_0x15eeb7=_[_0xc86e('0x3b')]({},_0x15eeb7,_0x37f6d2[_0xc86e('0x3d')]);return db[_0xc86e('0x5b')][_0xc86e('0x1d')]({'where':_0x15eeb7[_0xc86e('0x38')]})['then'](function(_0x53b909){_0x239183[_0xc86e('0x1d')]=_0x53b909;if(_0x37f6d2['query'][_0xc86e('0x3e')]){_0x15eeb7[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x5b')][_0xc86e('0x59')](_0x15eeb7);})[_0xc86e('0x20')](function(_0x1e7b8a){_0x239183[_0xc86e('0x40')]=_0x1e7b8a;return _0x239183;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x170484,_0x15eeb7))['catch'](handleError(_0x170484,null));};exports[_0xc86e('0x5d')]=function(_0x4bf747,_0x45b0aa,_0x1f24a5){var _0x259a42={'raw':!![],'where':{}};var _0x222432={};var _0x327aef={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x4bf747[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x45b0aa,null))[_0xc86e('0x20')](function(_0x5b81e6){if(_0x5b81e6){_0x222432[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x5e')][_0xc86e('0x2b')]);_0x222432[_0xc86e('0x2f')]=_['keys'](_0x4bf747[_0xc86e('0x2f')]);_0x222432[_0xc86e('0x30')]=_['intersection'](_0x222432[_0xc86e('0x2e')],_0x222432[_0xc86e('0x2f')]);_0x259a42[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x222432[_0xc86e('0x2e')],qs['fields'](_0x4bf747['query'][_0xc86e('0x32')]));_0x259a42['attributes']=_0x259a42[_0xc86e('0x33')]['length']?_0x259a42['attributes']:_0x222432['model'];if(!_0x4bf747[_0xc86e('0x2f')]['hasOwnProperty'](_0xc86e('0x5c'))){_0x259a42['limit']=qs['limit'](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x259a42[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x259a42[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x259a42[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x4bf747[_0xc86e('0x2f')],_0x222432[_0xc86e('0x30')]));_0x259a42['where'][_0xc86e('0x58')]=_0x5b81e6['id'];if(_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x259a42[_0xc86e('0x38')]=_['merge'](_0x259a42[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x259a42['attributes'],function(_0x5b789c){var _0x24b106={};_0x24b106[_0x5b789c]={'$like':'%'+_0x4bf747[_0xc86e('0x2f')]['filter']+'%'};return _0x24b106;})});}_0x259a42=_[_0xc86e('0x3b')]({},_0x259a42,_0x4bf747[_0xc86e('0x3d')]);return db[_0xc86e('0x5e')][_0xc86e('0x1d')]({'where':_0x259a42[_0xc86e('0x38')]})[_0xc86e('0x20')](function(_0x19b29b){_0x327aef[_0xc86e('0x1d')]=_0x19b29b;if(_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x259a42[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x5e')]['findAll'](_0x259a42);})['then'](function(_0x5bc867){_0x327aef[_0xc86e('0x40')]=_0x5bc867;return _0x327aef;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x45b0aa,_0x259a42))['catch'](handleError(_0x45b0aa,null));};exports['getHopperBlacks']=function(_0x5afab2,_0x5dd41f,_0x9c3fe7){var _0x480105={'raw':!![],'where':{}};var _0xc0171d={};var _0x1cf1df={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x5afab2['params']['id']}})['then'](handleEntityNotFound(_0x5dd41f,null))[_0xc86e('0x20')](function(_0x5be4bb){if(_0x5be4bb){_0xc0171d['model']=_['keys'](db[_0xc86e('0x5f')][_0xc86e('0x2b')]);_0xc0171d[_0xc86e('0x2f')]=_['keys'](_0x5afab2[_0xc86e('0x2f')]);_0xc0171d[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0xc0171d[_0xc86e('0x2e')],_0xc0171d['query']);_0x480105['attributes']=_['intersection'](_0xc0171d[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x5afab2['query'][_0xc86e('0x32')]));_0x480105[_0xc86e('0x33')]=_0x480105[_0xc86e('0x33')][_0xc86e('0x34')]?_0x480105['attributes']:_0xc0171d[_0xc86e('0x2e')];if(!_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x35')](_0xc86e('0x5c'))){_0x480105[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x480105['offset']=qs[_0xc86e('0x1a')](_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x480105['order']=qs[_0xc86e('0x37')](_0x5afab2['query'][_0xc86e('0x37')]);_0x480105[_0xc86e('0x38')]=qs['filters'](_[_0xc86e('0x39')](_0x5afab2['query'],_0xc0171d[_0xc86e('0x30')]));_0x480105['where'][_0xc86e('0x58')]=_0x5be4bb['id'];if(_0x5afab2[_0xc86e('0x2f')]['filter']){_0x480105['where']=_[_0xc86e('0x3b')](_0x480105[_0xc86e('0x38')],{'$or':_['map'](_0x480105[_0xc86e('0x33')],function(_0x4c31c1){var _0x2a53ba={};_0x2a53ba[_0x4c31c1]={'$like':'%'+_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x2a53ba;})});}_0x480105=_[_0xc86e('0x3b')]({},_0x480105,_0x5afab2[_0xc86e('0x3d')]);return db[_0xc86e('0x5f')]['count']({'where':_0x480105[_0xc86e('0x38')]})['then'](function(_0x251c79){_0x1cf1df[_0xc86e('0x1d')]=_0x251c79;if(_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x480105['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xc86e('0x59')](_0x480105);})[_0xc86e('0x20')](function(_0x37a2f4){_0x1cf1df['rows']=_0x37a2f4;return _0x1cf1df;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x5dd41f,_0x480105))[_0xc86e('0x41')](handleError(_0x5dd41f,null));};exports[_0xc86e('0x60')]=function(_0x9abb5c,_0x53a887,_0x47b8bd){var _0x519c80={};var _0x5a5417={};var _0x497c24;var _0x3bb377;return db['Campaign'][_0xc86e('0x56')]({'where':{'id':_0x9abb5c[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x53a887,null))[_0xc86e('0x20')](function(_0x35878b){if(_0x35878b){_0x497c24=_0x35878b;_0x5a5417[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x61')][_0xc86e('0x2b')]);_0x5a5417[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x9abb5c['query']);_0x5a5417['filters']=_[_0xc86e('0x31')](_0x5a5417[_0xc86e('0x2e')],_0x5a5417[_0xc86e('0x2f')]);_0x519c80['attributes']=_[_0xc86e('0x31')](_0x5a5417[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x9abb5c['query'][_0xc86e('0x32')]));_0x519c80[_0xc86e('0x33')]=_0x519c80[_0xc86e('0x33')][_0xc86e('0x34')]?_0x519c80[_0xc86e('0x33')]:_0x5a5417['model'];_0x519c80[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x9abb5c[_0xc86e('0x2f')]['sort']);_0x519c80['where']=qs[_0xc86e('0x30')](_['pick'](_0x9abb5c[_0xc86e('0x2f')],_0x5a5417[_0xc86e('0x30')]));if(_0x9abb5c['query'][_0xc86e('0x3a')]){_0x519c80['where']=_[_0xc86e('0x3b')](_0x519c80[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x519c80[_0xc86e('0x33')],function(_0x21425e){var _0x376dc1={};_0x376dc1[_0x21425e]={'$like':'%'+_0x9abb5c['query'][_0xc86e('0x3a')]+'%'};return _0x376dc1;})});}_0x519c80=_[_0xc86e('0x3b')]({},_0x519c80,_0x9abb5c['options']);return _0x497c24[_0xc86e('0x60')](_0x519c80);}})[_0xc86e('0x20')](function(_0x26aaf1){if(_0x26aaf1){_0x3bb377=_0x26aaf1[_0xc86e('0x34')];if(!_0x9abb5c[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x519c80[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x9abb5c[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x519c80[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x9abb5c['query'][_0xc86e('0x1a')]);}return _0x497c24[_0xc86e('0x60')](_0x519c80);}})[_0xc86e('0x20')](function(_0x13ef83){if(_0x13ef83){return _0x13ef83?{'count':_0x3bb377,'rows':_0x13ef83}:null;}})[_0xc86e('0x20')](respondWithResult(_0x53a887,null))[_0xc86e('0x41')](handleError(_0x53a887,null));};exports[_0xc86e('0x62')]=function(_0x45ae32,_0x4de0eb,_0x3a00f2){var _0x422ea2,_0x526a14;return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x45ae32[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x4de0eb,null))[_0xc86e('0x20')](function(_0x3a6458){if(_0x3a6458){_0x526a14=_0x3a6458;return _0x3a6458[_0xc86e('0x62')](_0x45ae32[_0xc86e('0x47')]['ids'],_[_0xc86e('0x4e')](_0x45ae32[_0xc86e('0x47')],['ids','id'])||{});}return null;})[_0xc86e('0x63')](function(_0x57fed9){var _0x5d8c5b;_0x422ea2=_0x57fed9||[];var _0x54423a=[];if(_0x57fed9){for(var _0x3269b3=0x0;_0x3269b3<_0x57fed9['length'];_0x3269b3+=0x1){var _0x2f7284=_0x57fed9[_0x3269b3]['get']({'plain':!![]});_0x526a14[_0xc86e('0x64')]=_0x45ae32['body'][_0xc86e('0x64')]?_0x45ae32[_0xc86e('0x47')][_0xc86e('0x64')]:_0x526a14['dialCheckDuplicateType'];switch(_0x526a14[_0xc86e('0x64')]){case _0xc86e('0x65'):_0x5d8c5b=squel[_0xc86e('0x66')]()[_0xc86e('0x67')](_0xc86e('0x68'))[_0xc86e('0x69')]([_0xc86e('0x6a'),_0xc86e('0x6b'),_0xc86e('0x6c'),_0xc86e('0x6d'),_0xc86e('0x58'),'createdAt',_0xc86e('0x4f')],squel['select']()['field'](_0xc86e('0x6a'),_0xc86e('0x6a'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x6b'))[_0xc86e('0x6e')]('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284['CmListId'][_0xc86e('0x70')](),_0xc86e('0x6d'))[_0xc86e('0x6e')](_0x45ae32['params']['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))['field']('NOW()',_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))['where']('deletedAt\x20IS\x20NULL')[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xc86e('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc86e('0x75')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xc86e('0x76'))[_0xc86e('0x38')](_0xc86e('0x77'),_0x45ae32[_0xc86e('0x43')]['id']['toString']()))[_0xc86e('0x38')](_0xc86e('0x78'),squel[_0xc86e('0x75')]()['field'](_0xc86e('0x79'))['from'](_0xc86e('0x68'))[_0xc86e('0x38')](_0xc86e('0x77'),_0x45ae32[_0xc86e('0x43')]['id'][_0xc86e('0x70')]())))[_0xc86e('0x70')]();break;case _0xc86e('0x7a'):_0x5d8c5b=squel['insert']()['into'](_0xc86e('0x68'))[_0xc86e('0x69')](['phone','scheduledAt','ContactId','ListId',_0xc86e('0x58'),_0xc86e('0x50'),'updatedAt'],squel['select']()[_0xc86e('0x6e')]('phone',_0xc86e('0x6a'))[_0xc86e('0x6e')](_0xc86e('0x6f'),'scheduledAt')['field']('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')](),_0xc86e('0x6d'))['field'](_0x45ae32[_0xc86e('0x43')]['id']['toString'](),_0xc86e('0x58'))[_0xc86e('0x6e')]('NOW()','createdAt')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))[_0xc86e('0x38')](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')]())[_0xc86e('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0xc86e('0x38')](_0xc86e('0x78'),squel['select']()[_0xc86e('0x6e')](_0xc86e('0x79'))[_0xc86e('0x71')](_0xc86e('0x68'))[_0xc86e('0x38')]('CampaignId\x20=\x20?',_0x45ae32['params']['id'][_0xc86e('0x70')]())))[_0xc86e('0x70')]();break;default:_0x5d8c5b=squel[_0xc86e('0x66')]()[_0xc86e('0x67')]('cm_hopper')[_0xc86e('0x69')]([_0xc86e('0x6a'),_0xc86e('0x6b'),_0xc86e('0x6c'),_0xc86e('0x6d'),'CampaignId',_0xc86e('0x50'),_0xc86e('0x4f')],squel[_0xc86e('0x75')]()[_0xc86e('0x6e')](_0xc86e('0x6a'),'phone')[_0xc86e('0x6e')]('NOW()',_0xc86e('0x6b'))['field']('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284['CmListId'][_0xc86e('0x70')](),'ListId')['field'](_0x45ae32[_0xc86e('0x43')]['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))['where'](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284['CmListId'][_0xc86e('0x70')]())[_0xc86e('0x38')](_0xc86e('0x7c')))[_0xc86e('0x70')]();}_0x54423a[_0xc86e('0x7d')](db[_0xc86e('0x7e')][_0xc86e('0x2f')](_0x5d8c5b));}return BPromise[_0xc86e('0x7f')](_0x54423a);}})[_0xc86e('0x20')](function(){return _0x422ea2;})['then'](respondWithResult(_0x4de0eb,null))[_0xc86e('0x41')](handleError(_0x4de0eb,null));};exports[_0xc86e('0x80')]=function(_0x562981,_0x3a502d,_0x387464){return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x562981['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x3a502d,null))[_0xc86e('0x20')](function(_0xa391d5){if(_0xa391d5){return _0xa391d5[_0xc86e('0x80')](_0x562981[_0xc86e('0x2f')][_0xc86e('0x81')]);}})['then'](function(_0x2e94b1){if(_0x2e94b1){return db['CmHopper']['destroy']({'where':{'ListId':_0x562981[_0xc86e('0x2f')][_0xc86e('0x81')],'CampaignId':_0x562981[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](function(){return _0x2e94b1;});}})[_0xc86e('0x20')](respondWithStatusCode(_0x3a502d,null))[_0xc86e('0x41')](handleError(_0x3a502d,null));};exports[_0xc86e('0x82')]=function(_0x45b4ba,_0x1db1d3,_0x30d30f){var _0x19d13f={};var _0x22a1fe={};var _0x419f32;var _0x570a8e;return db['Campaign']['findOne']({'where':{'id':_0x45b4ba['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1db1d3,null))[_0xc86e('0x20')](function(_0x14f008){if(_0x14f008){_0x419f32=_0x14f008;_0x22a1fe[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x61')][_0xc86e('0x2b')]);_0x22a1fe['query']=_[_0xc86e('0x44')](_0x45b4ba[_0xc86e('0x2f')]);_0x22a1fe[_0xc86e('0x30')]=_['intersection'](_0x22a1fe[_0xc86e('0x2e')],_0x22a1fe[_0xc86e('0x2f')]);_0x19d13f[_0xc86e('0x33')]=_['intersection'](_0x22a1fe['model'],qs['fields'](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x19d13f['attributes']=_0x19d13f['attributes'][_0xc86e('0x34')]?_0x19d13f[_0xc86e('0x33')]:_0x22a1fe[_0xc86e('0x2e')];_0x19d13f[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x19d13f[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x45b4ba[_0xc86e('0x2f')],_0x22a1fe[_0xc86e('0x30')]));if(_0x45b4ba[_0xc86e('0x2f')]['filter']){_0x19d13f[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x19d13f['where'],{'$or':_[_0xc86e('0x29')](_0x19d13f['attributes'],function(_0x7b0349){var _0x123549={};_0x123549[_0x7b0349]={'$like':'%'+_0x45b4ba[_0xc86e('0x2f')]['filter']+'%'};return _0x123549;})});}_0x19d13f=_['merge']({},_0x19d13f,_0x45b4ba['options']);return _0x419f32[_0xc86e('0x82')](_0x19d13f);}})[_0xc86e('0x20')](function(_0x3eb62c){if(_0x3eb62c){_0x570a8e=_0x3eb62c[_0xc86e('0x34')];if(!_0x45b4ba['query'][_0xc86e('0x35')](_0xc86e('0x5c'))){_0x19d13f['limit']=qs[_0xc86e('0x1c')](_0x45b4ba[_0xc86e('0x2f')]['limit']);_0x19d13f[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x1a')]);}return _0x419f32['getBlackLists'](_0x19d13f);}})['then'](function(_0x37f9ae){if(_0x37f9ae){return _0x37f9ae?{'count':_0x570a8e,'rows':_0x37f9ae}:null;}})[_0xc86e('0x20')](respondWithResult(_0x1db1d3,null))[_0xc86e('0x41')](handleError(_0x1db1d3,null));};exports['addBlackLists']=function(_0x3a6ac2,_0x1b50e3,_0x2ad880){var _0x152f34,_0x1295ff;return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x3a6ac2[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1b50e3,null))[_0xc86e('0x20')](function(_0x4c09e0){if(_0x4c09e0){_0x1295ff=_0x4c09e0;return _0x4c09e0[_0xc86e('0x83')](_0x3a6ac2['body'][_0xc86e('0x81')],_['omit'](_0x3a6ac2[_0xc86e('0x47')],['ids','id'])||{});}return null;})[_0xc86e('0x63')](function(_0xf28a74){var _0x1c8195;_0x152f34=_0xf28a74||[];var _0x168903=[];if(_0xf28a74){for(var _0x4277c6=0x0;_0x4277c6<_0xf28a74['length'];_0x4277c6+=0x1){var _0x160753=_0xf28a74[_0x4277c6]['get']({'plain':!![]});_0x1c8195=squel[_0xc86e('0x66')]()[_0xc86e('0x67')](_0xc86e('0x84'))['fromQuery']([_0xc86e('0x6a'),_0xc86e('0x6c'),_0xc86e('0x6d'),_0xc86e('0x58'),_0xc86e('0x50'),_0xc86e('0x4f')],squel[_0xc86e('0x75')]()[_0xc86e('0x6e')]('phone','phone')[_0xc86e('0x6e')]('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x160753[_0xc86e('0x74')]['toString'](),_0xc86e('0x6d'))[_0xc86e('0x6e')](_0x3a6ac2[_0xc86e('0x43')]['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))['from'](_0xc86e('0x72'))[_0xc86e('0x38')](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x160753[_0xc86e('0x74')][_0xc86e('0x70')]())[_0xc86e('0x38')](_0xc86e('0x7c')))[_0xc86e('0x70')]();_0x168903[_0xc86e('0x7d')](db['sequelize'][_0xc86e('0x2f')](_0x1c8195));}return BPromise[_0xc86e('0x7f')](_0x168903);}})[_0xc86e('0x20')](function(){return _0x152f34;})['then'](respondWithResult(_0x1b50e3,null))[_0xc86e('0x41')](handleError(_0x1b50e3,null));};exports[_0xc86e('0x85')]=function(_0x39bdca,_0x49fabe,_0x238604){return db[_0xc86e('0x2a')]['find']({'where':{'id':_0x39bdca['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x49fabe,null))['then'](function(_0x58abb9){if(_0x58abb9){return _0x58abb9['removeBlackLists'](_0x39bdca[_0xc86e('0x2f')]['ids']);}})[_0xc86e('0x20')](function(_0x29823f){if(_0x29823f){return db[_0xc86e('0x5f')][_0xc86e('0x21')]({'where':{'ListId':_0x39bdca[_0xc86e('0x2f')][_0xc86e('0x81')],'CampaignId':_0x39bdca[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](function(){return _0x29823f;});}})['then'](respondWithStatusCode(_0x49fabe,null))[_0xc86e('0x41')](handleError(_0x49fabe,null));}; \ No newline at end of file +var _0xa70c=['phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','ListId','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','end','error','stack','name','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','nolimit','CampaignId','filter','CmHopper','getHopperHistories','order','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL'];(function(_0x33cff0,_0x46b704){var _0xd56897=function(_0x7162b4){while(--_0x7162b4){_0x33cff0['push'](_0x33cff0['shift']());}};_0xd56897(++_0x46b704);}(_0xa70c,0x117));var _0xca70=function(_0x5e5b5e,_0x1d4bde){_0x5e5b5e=_0x5e5b5e-0x0;var _0x296489=_0xa70c[_0x5e5b5e];return _0x296489;};'use strict';var emlformat=require(_0xca70('0x0'));var rimraf=require(_0xca70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca70('0x2'));var moment=require(_0xca70('0x3'));var BPromise=require(_0xca70('0x4'));var Mustache=require(_0xca70('0x5'));var util=require(_0xca70('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca70('0x7'));var squel=require(_0xca70('0x8'));var crypto=require(_0xca70('0x9'));var jsforce=require(_0xca70('0xa'));var deskjs=require(_0xca70('0xb'));var toCsv=require('to-csv');var querystring=require(_0xca70('0xc'));var Papa=require(_0xca70('0xd'));var Redis=require(_0xca70('0xe'));var authService=require(_0xca70('0xf'));var qs=require(_0xca70('0x10'));var as=require(_0xca70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xca70('0x12'));var utils=require(_0xca70('0x13'));var config=require(_0xca70('0x14'));var licenseUtil=require(_0xca70('0x15'));var db=require(_0xca70('0x16'))['db'];function respondWithStatusCode(_0x131611,_0xe40f9d){_0xe40f9d=_0xe40f9d||0xcc;return function(_0x3948b6){if(_0x3948b6){return _0x131611[_0xca70('0x17')](_0xe40f9d);}return _0x131611[_0xca70('0x18')](_0xe40f9d)['end']();};}function respondWithResult(_0x1ff433,_0x57e174){_0x57e174=_0x57e174||0xc8;return function(_0x3c10fa){if(_0x3c10fa){return _0x1ff433[_0xca70('0x18')](_0x57e174)[_0xca70('0x19')](_0x3c10fa);}};}function respondWithFilteredResult(_0x5c6b75,_0x975c78){return function(_0x595bfd){if(_0x595bfd){var _0x5c0b8d=typeof _0x975c78[_0xca70('0x1a')]===_0xca70('0x1b')&&typeof _0x975c78[_0xca70('0x1c')]===_0xca70('0x1b');var _0x1d8d34=_0x595bfd['count'];var _0x557e96=_0x5c0b8d?0x0:_0x975c78[_0xca70('0x1a')];var _0x28d583=_0x5c0b8d?_0x595bfd[_0xca70('0x1d')]:_0x975c78[_0xca70('0x1a')]+_0x975c78['limit'];var _0x27a143;if(_0x28d583>=_0x1d8d34){_0x28d583=_0x1d8d34;_0x27a143=0xc8;}else{_0x27a143=0xce;}_0x5c6b75[_0xca70('0x18')](_0x27a143);return _0x5c6b75[_0xca70('0x1e')]('Content-Range',_0x557e96+'-'+_0x28d583+'/'+_0x1d8d34)[_0xca70('0x19')](_0x595bfd);}return null;};}function patchUpdates(_0xdac8ca){return function(_0x4c16b6){try{jsonpatch[_0xca70('0x1f')](_0x4c16b6,_0xdac8ca,!![]);}catch(_0x529f5f){return BPromise[_0xca70('0x20')](_0x529f5f);}return _0x4c16b6[_0xca70('0x21')]();};}function saveUpdates(_0x38f476,_0x2a016a){return function(_0x54b40f){if(_0x54b40f){return _0x54b40f[_0xca70('0x22')](_0x38f476)['then'](function(_0x1571b){return _0x1571b;});}return null;};}function removeEntity(_0x45292c,_0x111096){return function(_0x5a6aef){if(_0x5a6aef){return _0x5a6aef[_0xca70('0x23')]()[_0xca70('0x24')](function(){var _0x32f834=_0x5a6aef[_0xca70('0x25')]({'plain':!![]});var _0x44eea5='IvrCampaigns';return db['UserProfileResource'][_0xca70('0x23')]({'where':{'type':_0x44eea5,'resourceId':_0x32f834['id']}})[_0xca70('0x24')](function(){return _0x5a6aef;});})[_0xca70('0x24')](function(){_0x45292c[_0xca70('0x18')](0xcc)[_0xca70('0x26')]();});}};}function handleEntityNotFound(_0x26a49f,_0x51d529){return function(_0x519de9){if(!_0x519de9){_0x26a49f[_0xca70('0x17')](0x194);}return _0x519de9;};}function handleError(_0xf54d65,_0x15945e){_0x15945e=_0x15945e||0x1f4;return function(_0x53653c){logger[_0xca70('0x27')](_0x53653c[_0xca70('0x28')]);if(_0x53653c[_0xca70('0x29')]){delete _0x53653c[_0xca70('0x29')];}_0xf54d65[_0xca70('0x18')](_0x15945e)['send'](_0x53653c);};}exports['index']=function(_0x1a7e9f,_0x43ba09){var _0x1f6f93={},_0x108caf={},_0x38049e={'count':0x0,'rows':[]};var _0x6c7a45=_[_0xca70('0x2a')](db[_0xca70('0x2b')][_0xca70('0x2c')],function(_0x4386f5){return{'name':_0x4386f5[_0xca70('0x2d')],'type':_0x4386f5['type'][_0xca70('0x2e')]};});_0x108caf[_0xca70('0x2f')]=_[_0xca70('0x2a')](_0x6c7a45,_0xca70('0x29'));_0x108caf[_0xca70('0x30')]=_[_0xca70('0x31')](_0x1a7e9f[_0xca70('0x30')]);_0x108caf[_0xca70('0x32')]=_[_0xca70('0x33')](_0x108caf[_0xca70('0x2f')],_0x108caf[_0xca70('0x30')]);_0x1f6f93[_0xca70('0x34')]=_[_0xca70('0x33')](_0x108caf[_0xca70('0x2f')],qs['fields'](_0x1a7e9f[_0xca70('0x30')][_0xca70('0x35')]));_0x1f6f93[_0xca70('0x34')]=_0x1f6f93[_0xca70('0x34')][_0xca70('0x36')]?_0x1f6f93['attributes']:_0x108caf[_0xca70('0x2f')];if(!_0x1a7e9f['query'][_0xca70('0x37')]('nolimit')){_0x1f6f93[_0xca70('0x1c')]=qs[_0xca70('0x1c')](_0x1a7e9f[_0xca70('0x30')]['limit']);_0x1f6f93['offset']=qs[_0xca70('0x1a')](_0x1a7e9f['query']['offset']);}_0x1f6f93['order']=qs[_0xca70('0x38')](_0x1a7e9f[_0xca70('0x30')]['sort']);_0x1f6f93[_0xca70('0x39')]=qs[_0xca70('0x32')](_[_0xca70('0x3a')](_0x1a7e9f[_0xca70('0x30')],_0x108caf[_0xca70('0x32')]),_0x6c7a45);if(_0x1a7e9f[_0xca70('0x30')]['filter']){_0x1f6f93[_0xca70('0x39')]=_[_0xca70('0x3b')](_0x1f6f93[_0xca70('0x39')],{'$or':_[_0xca70('0x2a')](_0x6c7a45,function(_0xfaf90d){if(_0xfaf90d[_0xca70('0x3c')]!==_0xca70('0x3d')){var _0x28d631={};_0x28d631[_0xfaf90d[_0xca70('0x29')]]={'$like':'%'+_0x1a7e9f[_0xca70('0x30')]['filter']+'%'};return _0x28d631;}})});}_0x1f6f93=_[_0xca70('0x3b')]({},_0x1f6f93,_0x1a7e9f[_0xca70('0x3e')]);var _0x3a10cf={'where':_0x1f6f93[_0xca70('0x39')]};return db[_0xca70('0x2b')][_0xca70('0x1d')](_0x3a10cf)['then'](function(_0x257830){_0x38049e[_0xca70('0x1d')]=_0x257830;if(_0x1a7e9f['query']['includeAll']){_0x1f6f93[_0xca70('0x3f')]=[{'all':!![]}];}return db[_0xca70('0x2b')][_0xca70('0x40')](_0x1f6f93);})['then'](function(_0xff7a7c){_0x38049e[_0xca70('0x41')]=_0xff7a7c;return _0x38049e;})['then'](respondWithFilteredResult(_0x43ba09,_0x1f6f93))['catch'](handleError(_0x43ba09,null));};exports[_0xca70('0x42')]=function(_0x4d0bc4,_0x7bc834){var _0x48ed27={'raw':![],'where':{'id':_0x4d0bc4[_0xca70('0x43')]['id']}},_0x929c0e={};_0x929c0e[_0xca70('0x2f')]=_[_0xca70('0x31')](db['Campaign'][_0xca70('0x2c')]);_0x929c0e[_0xca70('0x30')]=_[_0xca70('0x31')](_0x4d0bc4[_0xca70('0x30')]);_0x929c0e[_0xca70('0x32')]=_[_0xca70('0x33')](_0x929c0e['model'],_0x929c0e['query']);_0x48ed27[_0xca70('0x34')]=_['intersection'](_0x929c0e[_0xca70('0x2f')],qs['fields'](_0x4d0bc4['query'][_0xca70('0x35')]));_0x48ed27[_0xca70('0x34')]=_0x48ed27[_0xca70('0x34')][_0xca70('0x36')]?_0x48ed27[_0xca70('0x34')]:_0x929c0e[_0xca70('0x2f')];if(_0x4d0bc4[_0xca70('0x30')][_0xca70('0x44')]){_0x48ed27[_0xca70('0x3f')]=[{'all':!![]}];}_0x48ed27=_[_0xca70('0x3b')]({},_0x48ed27,_0x4d0bc4[_0xca70('0x3e')]);return db['Campaign'][_0xca70('0x45')](_0x48ed27)[_0xca70('0x24')](handleEntityNotFound(_0x7bc834,null))[_0xca70('0x24')](respondWithResult(_0x7bc834,null))[_0xca70('0x46')](handleError(_0x7bc834,null));};exports[_0xca70('0x47')]=function(_0x3388ff,_0x1abdd1){return db[_0xca70('0x2b')][_0xca70('0x47')](_0x3388ff[_0xca70('0x48')],{})[_0xca70('0x24')](function(_0x502135){var _0x300295=_0x3388ff[_0xca70('0x49')]['get']({'plain':!![]});if(!_0x300295)throw new Error(_0xca70('0x4a'));if(_0x300295['role']===_0xca70('0x49')){var _0x36c5be=_0x502135[_0xca70('0x25')]({'plain':!![]});var _0x4b8bfe=_0xca70('0x4b');return db['UserProfileSection'][_0xca70('0x45')]({'where':{'name':_0x4b8bfe,'userProfileId':_0x300295[_0xca70('0x4c')]},'raw':!![]})[_0xca70('0x24')](function(_0x32172e){if(_0x32172e&&_0x32172e[_0xca70('0x4d')]===0x0){return db[_0xca70('0x4e')][_0xca70('0x47')]({'name':_0x36c5be[_0xca70('0x29')],'resourceId':_0x36c5be['id'],'type':_0x32172e[_0xca70('0x29')],'sectionId':_0x32172e['id']},{})['then'](function(){return _0x502135;});}else{return _0x502135;}})[_0xca70('0x46')](function(_0x67412){logger[_0xca70('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x67412);throw _0x67412;});}return _0x502135;})[_0xca70('0x24')](respondWithResult(_0x1abdd1,0xc9))[_0xca70('0x46')](handleError(_0x1abdd1,null));};exports[_0xca70('0x4f')]=function(_0x4b75bc,_0x369383){var _0x10b7e0={'where':{'id':_0x4b75bc[_0xca70('0x43')]['id']}},_0x3b3624={};_0x3b3624[_0xca70('0x2f')]=_[_0xca70('0x31')](db[_0xca70('0x2b')][_0xca70('0x2c')]);_0x10b7e0[_0xca70('0x34')]=_['intersection'](_0x3b3624[_0xca70('0x2f')],qs[_0xca70('0x35')](_0x4b75bc[_0xca70('0x30')][_0xca70('0x35')]));_0x10b7e0[_0xca70('0x34')]=_0x10b7e0[_0xca70('0x34')][_0xca70('0x36')]?_0x10b7e0[_0xca70('0x34')]:_0x3b3624[_0xca70('0x2f')];if(_0x4b75bc[_0xca70('0x30')]['includeAll']){_0x10b7e0['include']=[{'all':!![]}];}_0x10b7e0=_[_0xca70('0x3b')]({},_0x10b7e0,_0x4b75bc['options']);return db[_0xca70('0x2b')]['find'](_0x10b7e0)[_0xca70('0x24')](handleEntityNotFound(_0x369383,null))[_0xca70('0x24')](function(_0x42cb31){if(_0x42cb31){var _0x47e585=_0x42cb31[_0xca70('0x25')]({'plain':!![]});_0x47e585=qs[_0xca70('0x50')](_0x47e585,['id',_0xca70('0x51'),'updatedAt']);_0x4b75bc[_0xca70('0x48')]=_[_0xca70('0x50')](_0x4b75bc['body'],['id',_0xca70('0x51'),_0xca70('0x52')]);return db[_0xca70('0x2b')][_0xca70('0x47')](_[_0xca70('0x3b')](_0x47e585,_0x4b75bc['body']),{'include':_0x4b75bc['query']['includeAll']?[{'all':!![]}]:undefined})[_0xca70('0x24')](function(_0x5d32cc){var _0x5d9738=_0x4b75bc[_0xca70('0x49')]['get']({'plain':!![]});if(!_0x5d9738)throw new Error(_0xca70('0x4a'));if(_0x5d9738['role']===_0xca70('0x49')){var _0x486d71=_0x5d32cc[_0xca70('0x25')]({'plain':!![]});var _0x43cafa='IvrCampaigns';return db['UserProfileSection'][_0xca70('0x45')]({'where':{'name':_0x43cafa,'userProfileId':_0x5d9738['userProfileId']},'raw':!![]})['then'](function(_0xfa7d32){if(_0xfa7d32&&_0xfa7d32[_0xca70('0x4d')]===0x0){return db[_0xca70('0x4e')][_0xca70('0x47')]({'name':_0x486d71['name'],'resourceId':_0x486d71['id'],'type':_0xfa7d32['name'],'sectionId':_0xfa7d32['id']},{})[_0xca70('0x24')](function(){return _0x5d32cc;});}else{return _0x5d32cc;}})[_0xca70('0x46')](function(_0x1a2012){logger[_0xca70('0x27')](_0xca70('0x53'),_0x1a2012);throw _0x1a2012;});}return _0x5d32cc;});}})['then'](respondWithResult(_0x369383,0xc9))[_0xca70('0x46')](handleError(_0x369383,null));};exports[_0xca70('0x22')]=function(_0xeef39d,_0x4509a3){if(_0xeef39d['body']['id']){delete _0xeef39d['body']['id'];}return db[_0xca70('0x2b')][_0xca70('0x45')]({'where':{'id':_0xeef39d[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x4509a3,null))['then'](saveUpdates(_0xeef39d[_0xca70('0x48')],null))[_0xca70('0x24')](respondWithResult(_0x4509a3,null))['catch'](handleError(_0x4509a3,null));};exports[_0xca70('0x23')]=function(_0x3a1223,_0x5ec3df){return db[_0xca70('0x2b')][_0xca70('0x45')]({'where':{'id':_0x3a1223[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x5ec3df,null))[_0xca70('0x24')](removeEntity(_0x5ec3df,null))[_0xca70('0x46')](handleError(_0x5ec3df,null));};exports[_0xca70('0x54')]=function(_0x19beb3,_0x30b915,_0x5bf638){var _0x2f6bbe={'raw':!![],'where':{}};var _0x351fa3={};var _0x232ff8={'count':0x0,'rows':[]};return db['Campaign'][_0xca70('0x55')]({'where':{'id':_0x19beb3['params']['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x30b915,null))[_0xca70('0x24')](function(_0x11dd8b){if(_0x11dd8b){_0x351fa3['model']=_[_0xca70('0x31')](db['CmHopper']['rawAttributes']);_0x351fa3[_0xca70('0x30')]=_[_0xca70('0x31')](_0x19beb3[_0xca70('0x30')]);_0x351fa3[_0xca70('0x32')]=_[_0xca70('0x33')](_0x351fa3['model'],_0x351fa3['query']);_0x2f6bbe['attributes']=_[_0xca70('0x33')](_0x351fa3[_0xca70('0x2f')],qs[_0xca70('0x35')](_0x19beb3[_0xca70('0x30')][_0xca70('0x35')]));_0x2f6bbe[_0xca70('0x34')]=_0x2f6bbe['attributes'][_0xca70('0x36')]?_0x2f6bbe[_0xca70('0x34')]:_0x351fa3[_0xca70('0x2f')];if(!_0x19beb3[_0xca70('0x30')]['hasOwnProperty'](_0xca70('0x56'))){_0x2f6bbe['limit']=qs[_0xca70('0x1c')](_0x19beb3['query']['limit']);_0x2f6bbe[_0xca70('0x1a')]=qs[_0xca70('0x1a')](_0x19beb3[_0xca70('0x30')][_0xca70('0x1a')]);}_0x2f6bbe['order']=qs['sort'](_0x19beb3[_0xca70('0x30')][_0xca70('0x38')]);_0x2f6bbe[_0xca70('0x39')]=qs['filters'](_[_0xca70('0x3a')](_0x19beb3[_0xca70('0x30')],_0x351fa3[_0xca70('0x32')]));_0x2f6bbe['where'][_0xca70('0x57')]=_0x11dd8b['id'];if(_0x19beb3[_0xca70('0x30')][_0xca70('0x58')]){_0x2f6bbe['where']=_[_0xca70('0x3b')](_0x2f6bbe[_0xca70('0x39')],{'$or':_['map'](_0x2f6bbe['attributes'],function(_0x6c7fd3){var _0x367e3f={};_0x367e3f[_0x6c7fd3]={'$like':'%'+_0x19beb3['query'][_0xca70('0x58')]+'%'};return _0x367e3f;})});}_0x2f6bbe=_[_0xca70('0x3b')]({},_0x2f6bbe,_0x19beb3[_0xca70('0x3e')]);return db[_0xca70('0x59')][_0xca70('0x1d')]({'where':_0x2f6bbe[_0xca70('0x39')]})[_0xca70('0x24')](function(_0x2c466f){_0x232ff8[_0xca70('0x1d')]=_0x2c466f;if(_0x19beb3['query']['includeAll']){_0x2f6bbe[_0xca70('0x3f')]=[{'all':!![]}];}return db[_0xca70('0x59')][_0xca70('0x40')](_0x2f6bbe);})[_0xca70('0x24')](function(_0x30b714){_0x232ff8[_0xca70('0x41')]=_0x30b714;return _0x232ff8;});}})['then'](respondWithFilteredResult(_0x30b915,_0x2f6bbe))[_0xca70('0x46')](handleError(_0x30b915,null));};exports[_0xca70('0x5a')]=function(_0x48333b,_0x5d421b,_0x41d814){var _0x43b522={'raw':!![],'where':{}};var _0x1b1531={};var _0x49ea87={'count':0x0,'rows':[]};return db['Campaign'][_0xca70('0x55')]({'where':{'id':_0x48333b['params']['id']}})['then'](handleEntityNotFound(_0x5d421b,null))[_0xca70('0x24')](function(_0x2eb421){if(_0x2eb421){_0x1b1531['model']=_[_0xca70('0x31')](db['CmHopperHistory'][_0xca70('0x2c')]);_0x1b1531[_0xca70('0x30')]=_[_0xca70('0x31')](_0x48333b[_0xca70('0x30')]);_0x1b1531[_0xca70('0x32')]=_[_0xca70('0x33')](_0x1b1531[_0xca70('0x2f')],_0x1b1531[_0xca70('0x30')]);_0x43b522[_0xca70('0x34')]=_[_0xca70('0x33')](_0x1b1531['model'],qs['fields'](_0x48333b['query']['fields']));_0x43b522[_0xca70('0x34')]=_0x43b522['attributes'][_0xca70('0x36')]?_0x43b522[_0xca70('0x34')]:_0x1b1531[_0xca70('0x2f')];if(!_0x48333b[_0xca70('0x30')][_0xca70('0x37')](_0xca70('0x56'))){_0x43b522[_0xca70('0x1c')]=qs[_0xca70('0x1c')](_0x48333b[_0xca70('0x30')][_0xca70('0x1c')]);_0x43b522[_0xca70('0x1a')]=qs['offset'](_0x48333b[_0xca70('0x30')][_0xca70('0x1a')]);}_0x43b522[_0xca70('0x5b')]=qs[_0xca70('0x38')](_0x48333b[_0xca70('0x30')]['sort']);_0x43b522[_0xca70('0x39')]=qs['filters'](_['pick'](_0x48333b[_0xca70('0x30')],_0x1b1531[_0xca70('0x32')]));_0x43b522[_0xca70('0x39')][_0xca70('0x57')]=_0x2eb421['id'];if(_0x48333b[_0xca70('0x30')][_0xca70('0x58')]){_0x43b522[_0xca70('0x39')]=_[_0xca70('0x3b')](_0x43b522[_0xca70('0x39')],{'$or':_[_0xca70('0x2a')](_0x43b522[_0xca70('0x34')],function(_0x209963){var _0x277afd={};_0x277afd[_0x209963]={'$like':'%'+_0x48333b[_0xca70('0x30')][_0xca70('0x58')]+'%'};return _0x277afd;})});}_0x43b522=_[_0xca70('0x3b')]({},_0x43b522,_0x48333b[_0xca70('0x3e')]);return db[_0xca70('0x5c')][_0xca70('0x1d')]({'where':_0x43b522['where']})[_0xca70('0x24')](function(_0x1f599e){_0x49ea87[_0xca70('0x1d')]=_0x1f599e;if(_0x48333b['query'][_0xca70('0x44')]){_0x43b522[_0xca70('0x3f')]=[{'all':!![]}];}return db[_0xca70('0x5c')][_0xca70('0x40')](_0x43b522);})[_0xca70('0x24')](function(_0x449fe5){_0x49ea87[_0xca70('0x41')]=_0x449fe5;return _0x49ea87;});}})[_0xca70('0x24')](respondWithFilteredResult(_0x5d421b,_0x43b522))[_0xca70('0x46')](handleError(_0x5d421b,null));};exports[_0xca70('0x5d')]=function(_0x4ba88b,_0x2be345,_0x2ddfc4){var _0x50e892={'raw':!![],'where':{}};var _0x2f2a8a={};var _0x5b5c88={'count':0x0,'rows':[]};return db[_0xca70('0x2b')]['findOne']({'where':{'id':_0x4ba88b[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x2be345,null))[_0xca70('0x24')](function(_0x553882){if(_0x553882){_0x2f2a8a[_0xca70('0x2f')]=_['keys'](db[_0xca70('0x5e')][_0xca70('0x2c')]);_0x2f2a8a[_0xca70('0x30')]=_[_0xca70('0x31')](_0x4ba88b['query']);_0x2f2a8a[_0xca70('0x32')]=_['intersection'](_0x2f2a8a['model'],_0x2f2a8a['query']);_0x50e892[_0xca70('0x34')]=_[_0xca70('0x33')](_0x2f2a8a[_0xca70('0x2f')],qs[_0xca70('0x35')](_0x4ba88b[_0xca70('0x30')]['fields']));_0x50e892[_0xca70('0x34')]=_0x50e892[_0xca70('0x34')][_0xca70('0x36')]?_0x50e892['attributes']:_0x2f2a8a[_0xca70('0x2f')];if(!_0x4ba88b['query']['hasOwnProperty'](_0xca70('0x56'))){_0x50e892[_0xca70('0x1c')]=qs[_0xca70('0x1c')](_0x4ba88b[_0xca70('0x30')][_0xca70('0x1c')]);_0x50e892['offset']=qs[_0xca70('0x1a')](_0x4ba88b[_0xca70('0x30')][_0xca70('0x1a')]);}_0x50e892[_0xca70('0x5b')]=qs[_0xca70('0x38')](_0x4ba88b[_0xca70('0x30')][_0xca70('0x38')]);_0x50e892['where']=qs['filters'](_[_0xca70('0x3a')](_0x4ba88b[_0xca70('0x30')],_0x2f2a8a[_0xca70('0x32')]));_0x50e892[_0xca70('0x39')]['CampaignId']=_0x553882['id'];if(_0x4ba88b[_0xca70('0x30')][_0xca70('0x58')]){_0x50e892[_0xca70('0x39')]=_[_0xca70('0x3b')](_0x50e892[_0xca70('0x39')],{'$or':_[_0xca70('0x2a')](_0x50e892[_0xca70('0x34')],function(_0xe67076){var _0x2c51ac={};_0x2c51ac[_0xe67076]={'$like':'%'+_0x4ba88b['query'][_0xca70('0x58')]+'%'};return _0x2c51ac;})});}_0x50e892=_[_0xca70('0x3b')]({},_0x50e892,_0x4ba88b[_0xca70('0x3e')]);return db[_0xca70('0x5e')][_0xca70('0x1d')]({'where':_0x50e892['where']})[_0xca70('0x24')](function(_0x16c766){_0x5b5c88[_0xca70('0x1d')]=_0x16c766;if(_0x4ba88b[_0xca70('0x30')][_0xca70('0x44')]){_0x50e892[_0xca70('0x3f')]=[{'all':!![]}];}return db[_0xca70('0x5e')][_0xca70('0x40')](_0x50e892);})[_0xca70('0x24')](function(_0x882f05){_0x5b5c88[_0xca70('0x41')]=_0x882f05;return _0x5b5c88;});}})['then'](respondWithFilteredResult(_0x2be345,_0x50e892))[_0xca70('0x46')](handleError(_0x2be345,null));};exports[_0xca70('0x5f')]=function(_0x48b502,_0x325da5,_0x2777ee){var _0x3f633a={'raw':!![],'where':{}};var _0x3b79ad={};var _0x24e5f3={'count':0x0,'rows':[]};return db[_0xca70('0x2b')]['findOne']({'where':{'id':_0x48b502[_0xca70('0x43')]['id']}})['then'](handleEntityNotFound(_0x325da5,null))[_0xca70('0x24')](function(_0x1cc8ef){if(_0x1cc8ef){_0x3b79ad[_0xca70('0x2f')]=_[_0xca70('0x31')](db['CmHopperBlack'][_0xca70('0x2c')]);_0x3b79ad[_0xca70('0x30')]=_[_0xca70('0x31')](_0x48b502[_0xca70('0x30')]);_0x3b79ad[_0xca70('0x32')]=_[_0xca70('0x33')](_0x3b79ad[_0xca70('0x2f')],_0x3b79ad[_0xca70('0x30')]);_0x3f633a[_0xca70('0x34')]=_['intersection'](_0x3b79ad[_0xca70('0x2f')],qs['fields'](_0x48b502[_0xca70('0x30')]['fields']));_0x3f633a[_0xca70('0x34')]=_0x3f633a[_0xca70('0x34')]['length']?_0x3f633a[_0xca70('0x34')]:_0x3b79ad[_0xca70('0x2f')];if(!_0x48b502['query'][_0xca70('0x37')](_0xca70('0x56'))){_0x3f633a[_0xca70('0x1c')]=qs[_0xca70('0x1c')](_0x48b502[_0xca70('0x30')][_0xca70('0x1c')]);_0x3f633a['offset']=qs[_0xca70('0x1a')](_0x48b502[_0xca70('0x30')]['offset']);}_0x3f633a[_0xca70('0x5b')]=qs['sort'](_0x48b502['query'][_0xca70('0x38')]);_0x3f633a[_0xca70('0x39')]=qs['filters'](_[_0xca70('0x3a')](_0x48b502['query'],_0x3b79ad['filters']));_0x3f633a[_0xca70('0x39')]['CampaignId']=_0x1cc8ef['id'];if(_0x48b502[_0xca70('0x30')][_0xca70('0x58')]){_0x3f633a[_0xca70('0x39')]=_[_0xca70('0x3b')](_0x3f633a[_0xca70('0x39')],{'$or':_['map'](_0x3f633a[_0xca70('0x34')],function(_0x2d6435){var _0x451c6b={};_0x451c6b[_0x2d6435]={'$like':'%'+_0x48b502[_0xca70('0x30')][_0xca70('0x58')]+'%'};return _0x451c6b;})});}_0x3f633a=_[_0xca70('0x3b')]({},_0x3f633a,_0x48b502[_0xca70('0x3e')]);return db[_0xca70('0x60')][_0xca70('0x1d')]({'where':_0x3f633a[_0xca70('0x39')]})['then'](function(_0x4a004d){_0x24e5f3[_0xca70('0x1d')]=_0x4a004d;if(_0x48b502['query'][_0xca70('0x44')]){_0x3f633a[_0xca70('0x3f')]=[{'all':!![]}];}return db[_0xca70('0x60')][_0xca70('0x40')](_0x3f633a);})[_0xca70('0x24')](function(_0x44030c){_0x24e5f3[_0xca70('0x41')]=_0x44030c;return _0x24e5f3;});}})[_0xca70('0x24')](respondWithFilteredResult(_0x325da5,_0x3f633a))[_0xca70('0x46')](handleError(_0x325da5,null));};exports[_0xca70('0x61')]=function(_0x5f448c,_0x32f6b1,_0x24d829){var _0x410804={};var _0x283dd3={};var _0x38469a;var _0x2d9a8f;return db[_0xca70('0x2b')]['findOne']({'where':{'id':_0x5f448c[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x32f6b1,null))[_0xca70('0x24')](function(_0x40fca0){if(_0x40fca0){_0x38469a=_0x40fca0;_0x283dd3[_0xca70('0x2f')]=_[_0xca70('0x31')](db[_0xca70('0x62')][_0xca70('0x2c')]);_0x283dd3[_0xca70('0x30')]=_['keys'](_0x5f448c[_0xca70('0x30')]);_0x283dd3[_0xca70('0x32')]=_[_0xca70('0x33')](_0x283dd3[_0xca70('0x2f')],_0x283dd3[_0xca70('0x30')]);_0x410804[_0xca70('0x34')]=_[_0xca70('0x33')](_0x283dd3[_0xca70('0x2f')],qs['fields'](_0x5f448c[_0xca70('0x30')][_0xca70('0x35')]));_0x410804[_0xca70('0x34')]=_0x410804[_0xca70('0x34')][_0xca70('0x36')]?_0x410804[_0xca70('0x34')]:_0x283dd3[_0xca70('0x2f')];_0x410804[_0xca70('0x5b')]=qs[_0xca70('0x38')](_0x5f448c[_0xca70('0x30')][_0xca70('0x38')]);_0x410804['where']=qs['filters'](_[_0xca70('0x3a')](_0x5f448c[_0xca70('0x30')],_0x283dd3[_0xca70('0x32')]));if(_0x5f448c[_0xca70('0x30')][_0xca70('0x58')]){_0x410804['where']=_[_0xca70('0x3b')](_0x410804['where'],{'$or':_[_0xca70('0x2a')](_0x410804[_0xca70('0x34')],function(_0x56040f){var _0x34dffe={};_0x34dffe[_0x56040f]={'$like':'%'+_0x5f448c['query'][_0xca70('0x58')]+'%'};return _0x34dffe;})});}_0x410804=_[_0xca70('0x3b')]({},_0x410804,_0x5f448c['options']);return _0x38469a[_0xca70('0x61')](_0x410804);}})[_0xca70('0x24')](function(_0x9c5186){if(_0x9c5186){_0x2d9a8f=_0x9c5186[_0xca70('0x36')];if(!_0x5f448c[_0xca70('0x30')][_0xca70('0x37')](_0xca70('0x56'))){_0x410804['limit']=qs[_0xca70('0x1c')](_0x5f448c['query'][_0xca70('0x1c')]);_0x410804[_0xca70('0x1a')]=qs[_0xca70('0x1a')](_0x5f448c[_0xca70('0x30')][_0xca70('0x1a')]);}return _0x38469a[_0xca70('0x61')](_0x410804);}})[_0xca70('0x24')](function(_0x25bc55){if(_0x25bc55){return _0x25bc55?{'count':_0x2d9a8f,'rows':_0x25bc55}:null;}})[_0xca70('0x24')](respondWithResult(_0x32f6b1,null))[_0xca70('0x46')](handleError(_0x32f6b1,null));};exports['addLists']=function(_0x4e0b12,_0x23a2b,_0x520184){var _0x3e2b15,_0x3e8123;return db[_0xca70('0x2b')]['find']({'where':{'id':_0x4e0b12[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x23a2b,null))[_0xca70('0x24')](function(_0x7a3e7e){if(_0x7a3e7e){_0x3e8123=_0x7a3e7e;return _0x7a3e7e[_0xca70('0x63')](_0x4e0b12['body'][_0xca70('0x64')],_['omit'](_0x4e0b12[_0xca70('0x48')],[_0xca70('0x64'),'id'])||{});}return null;})[_0xca70('0x65')](function(_0x185bcb){var _0x3a11f4;_0x3e2b15=_0x185bcb||[];var _0x1a80ad=[];if(_0x185bcb){for(var _0x7f2030=0x0;_0x7f2030<_0x185bcb[_0xca70('0x36')];_0x7f2030+=0x1){var _0x4be287=_0x185bcb[_0x7f2030]['get']({'plain':!![]});_0x3e8123['dialCheckDuplicateType']=_0x4e0b12[_0xca70('0x48')]['dialCheckDuplicateType']?_0x4e0b12[_0xca70('0x48')][_0xca70('0x66')]:_0x3e8123[_0xca70('0x66')];switch(_0x3e8123[_0xca70('0x66')]){case _0xca70('0x67'):_0x3a11f4=squel[_0xca70('0x68')]()[_0xca70('0x69')](_0xca70('0x6a'))[_0xca70('0x6b')]([_0xca70('0x6c'),_0xca70('0x6d'),_0xca70('0x6e'),'ListId',_0xca70('0x57'),_0xca70('0x51'),_0xca70('0x52')],squel['select']()['field']('phone',_0xca70('0x6c'))[_0xca70('0x6f')](_0xca70('0x70'),_0xca70('0x6d'))['field']('id',_0xca70('0x6e'))[_0xca70('0x6f')](_0x4be287[_0xca70('0x71')]['toString'](),'ListId')[_0xca70('0x6f')](_0x4e0b12['params']['id']['toString'](),_0xca70('0x57'))[_0xca70('0x6f')](_0xca70('0x70'),_0xca70('0x51'))['field']('NOW()',_0xca70('0x52'))[_0xca70('0x72')](_0xca70('0x73'))[_0xca70('0x39')](_0xca70('0x74'))[_0xca70('0x39')](_0xca70('0x75'),_0x4be287[_0xca70('0x71')][_0xca70('0x76')]())[_0xca70('0x39')](_0xca70('0x77'))[_0xca70('0x39')](_0xca70('0x78'),squel[_0xca70('0x79')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xca70('0x7a'))['where']('CampaignId\x20=\x20?',_0x4e0b12[_0xca70('0x43')]['id']['toString']()))[_0xca70('0x39')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xca70('0x6f')](_0xca70('0x7b'))[_0xca70('0x72')](_0xca70('0x6a'))[_0xca70('0x39')](_0xca70('0x7c'),_0x4e0b12['params']['id']['toString']())))[_0xca70('0x76')]();break;case'onlyIfOpen':_0x3a11f4=squel[_0xca70('0x68')]()[_0xca70('0x69')](_0xca70('0x6a'))[_0xca70('0x6b')]([_0xca70('0x6c'),_0xca70('0x6d'),'ContactId',_0xca70('0x7d'),_0xca70('0x57'),_0xca70('0x51'),_0xca70('0x52')],squel[_0xca70('0x79')]()[_0xca70('0x6f')]('phone',_0xca70('0x6c'))[_0xca70('0x6f')]('NOW()',_0xca70('0x6d'))[_0xca70('0x6f')]('id','ContactId')[_0xca70('0x6f')](_0x4be287[_0xca70('0x71')][_0xca70('0x76')](),'ListId')[_0xca70('0x6f')](_0x4e0b12[_0xca70('0x43')]['id'][_0xca70('0x76')](),_0xca70('0x57'))['field'](_0xca70('0x70'),_0xca70('0x51'))[_0xca70('0x6f')](_0xca70('0x70'),'updatedAt')[_0xca70('0x72')](_0xca70('0x73'))[_0xca70('0x39')]('deletedAt\x20IS\x20NULL')[_0xca70('0x39')](_0xca70('0x75'),_0x4be287[_0xca70('0x71')][_0xca70('0x76')]())['where'](_0xca70('0x77'))[_0xca70('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xca70('0x79')]()[_0xca70('0x6f')](_0xca70('0x7b'))[_0xca70('0x72')]('cm_hopper')[_0xca70('0x39')](_0xca70('0x7c'),_0x4e0b12[_0xca70('0x43')]['id'][_0xca70('0x76')]())))[_0xca70('0x76')]();break;default:_0x3a11f4=squel[_0xca70('0x68')]()['into'](_0xca70('0x6a'))[_0xca70('0x6b')]([_0xca70('0x6c'),'scheduledAt','ContactId',_0xca70('0x7d'),_0xca70('0x57'),_0xca70('0x51'),_0xca70('0x52')],squel['select']()[_0xca70('0x6f')](_0xca70('0x6c'),_0xca70('0x6c'))['field'](_0xca70('0x70'),'scheduledAt')[_0xca70('0x6f')]('id',_0xca70('0x6e'))[_0xca70('0x6f')](_0x4be287[_0xca70('0x71')]['toString'](),'ListId')[_0xca70('0x6f')](_0x4e0b12[_0xca70('0x43')]['id'][_0xca70('0x76')](),_0xca70('0x57'))[_0xca70('0x6f')]('NOW()',_0xca70('0x51'))['field']('NOW()',_0xca70('0x52'))[_0xca70('0x72')](_0xca70('0x73'))[_0xca70('0x39')](_0xca70('0x74'))[_0xca70('0x39')]('ListId\x20=\x20?',_0x4be287[_0xca70('0x71')][_0xca70('0x76')]())[_0xca70('0x39')](_0xca70('0x77')))[_0xca70('0x76')]();}_0x1a80ad['push'](db[_0xca70('0x7e')][_0xca70('0x30')](_0x3a11f4));}return BPromise[_0xca70('0x7f')](_0x1a80ad);}})[_0xca70('0x24')](function(){return _0x3e2b15;})[_0xca70('0x24')](respondWithResult(_0x23a2b,null))[_0xca70('0x46')](handleError(_0x23a2b,null));};exports['removeLists']=function(_0x5810c9,_0x5e6a69,_0x55fb2a){return db[_0xca70('0x2b')][_0xca70('0x45')]({'where':{'id':_0x5810c9[_0xca70('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e6a69,null))['then'](function(_0x1e2e22){if(_0x1e2e22){return _0x1e2e22['removeLists'](_0x5810c9[_0xca70('0x30')][_0xca70('0x64')]);}})[_0xca70('0x24')](function(_0x5d199a){if(_0x5d199a){return db[_0xca70('0x59')]['destroy']({'where':{'ListId':_0x5810c9[_0xca70('0x30')]['ids'],'CampaignId':_0x5810c9[_0xca70('0x43')]['id']}})[_0xca70('0x24')](function(){return _0x5d199a;});}})[_0xca70('0x24')](respondWithStatusCode(_0x5e6a69,null))[_0xca70('0x46')](handleError(_0x5e6a69,null));};exports[_0xca70('0x80')]=function(_0x3c5181,_0x512ef4,_0x53a0bc){var _0x54c404={};var _0x49980a={};var _0x596ae6;var _0x3b75af;return db[_0xca70('0x2b')][_0xca70('0x55')]({'where':{'id':_0x3c5181[_0xca70('0x43')]['id']}})[_0xca70('0x24')](handleEntityNotFound(_0x512ef4,null))['then'](function(_0x51c8df){if(_0x51c8df){_0x596ae6=_0x51c8df;_0x49980a['model']=_[_0xca70('0x31')](db[_0xca70('0x62')][_0xca70('0x2c')]);_0x49980a[_0xca70('0x30')]=_['keys'](_0x3c5181[_0xca70('0x30')]);_0x49980a[_0xca70('0x32')]=_[_0xca70('0x33')](_0x49980a[_0xca70('0x2f')],_0x49980a[_0xca70('0x30')]);_0x54c404[_0xca70('0x34')]=_[_0xca70('0x33')](_0x49980a[_0xca70('0x2f')],qs['fields'](_0x3c5181[_0xca70('0x30')][_0xca70('0x35')]));_0x54c404['attributes']=_0x54c404[_0xca70('0x34')][_0xca70('0x36')]?_0x54c404[_0xca70('0x34')]:_0x49980a[_0xca70('0x2f')];_0x54c404[_0xca70('0x5b')]=qs[_0xca70('0x38')](_0x3c5181[_0xca70('0x30')]['sort']);_0x54c404[_0xca70('0x39')]=qs[_0xca70('0x32')](_[_0xca70('0x3a')](_0x3c5181['query'],_0x49980a[_0xca70('0x32')]));if(_0x3c5181[_0xca70('0x30')][_0xca70('0x58')]){_0x54c404[_0xca70('0x39')]=_[_0xca70('0x3b')](_0x54c404[_0xca70('0x39')],{'$or':_[_0xca70('0x2a')](_0x54c404[_0xca70('0x34')],function(_0x11734d){var _0xf5a30e={};_0xf5a30e[_0x11734d]={'$like':'%'+_0x3c5181[_0xca70('0x30')][_0xca70('0x58')]+'%'};return _0xf5a30e;})});}_0x54c404=_[_0xca70('0x3b')]({},_0x54c404,_0x3c5181[_0xca70('0x3e')]);return _0x596ae6[_0xca70('0x80')](_0x54c404);}})[_0xca70('0x24')](function(_0x47f1c5){if(_0x47f1c5){_0x3b75af=_0x47f1c5[_0xca70('0x36')];if(!_0x3c5181['query']['hasOwnProperty'](_0xca70('0x56'))){_0x54c404[_0xca70('0x1c')]=qs['limit'](_0x3c5181[_0xca70('0x30')]['limit']);_0x54c404[_0xca70('0x1a')]=qs[_0xca70('0x1a')](_0x3c5181[_0xca70('0x30')]['offset']);}return _0x596ae6['getBlackLists'](_0x54c404);}})[_0xca70('0x24')](function(_0x53f73e){if(_0x53f73e){return _0x53f73e?{'count':_0x3b75af,'rows':_0x53f73e}:null;}})[_0xca70('0x24')](respondWithResult(_0x512ef4,null))[_0xca70('0x46')](handleError(_0x512ef4,null));};exports[_0xca70('0x81')]=function(_0x496b31,_0x53b1c6,_0x4a515a){var _0xe55ed2,_0x1a56d7;return db[_0xca70('0x2b')][_0xca70('0x45')]({'where':{'id':_0x496b31[_0xca70('0x43')]['id']}})['then'](handleEntityNotFound(_0x53b1c6,null))[_0xca70('0x24')](function(_0x2bec2a){if(_0x2bec2a){_0x1a56d7=_0x2bec2a;return _0x2bec2a['addBlackLists'](_0x496b31[_0xca70('0x48')]['ids'],_['omit'](_0x496b31[_0xca70('0x48')],[_0xca70('0x64'),'id'])||{});}return null;})[_0xca70('0x65')](function(_0x43b143){var _0x3fda6a;_0xe55ed2=_0x43b143||[];var _0x2f6bed=[];if(_0x43b143){for(var _0x37b399=0x0;_0x37b399<_0x43b143[_0xca70('0x36')];_0x37b399+=0x1){var _0x72c3ef=_0x43b143[_0x37b399]['get']({'plain':!![]});_0x3fda6a=squel[_0xca70('0x68')]()['into'](_0xca70('0x82'))[_0xca70('0x6b')](['phone',_0xca70('0x6e'),_0xca70('0x7d'),_0xca70('0x57'),_0xca70('0x51'),_0xca70('0x52')],squel['select']()[_0xca70('0x6f')](_0xca70('0x6c'),_0xca70('0x6c'))[_0xca70('0x6f')]('id',_0xca70('0x6e'))[_0xca70('0x6f')](_0x72c3ef[_0xca70('0x71')]['toString'](),_0xca70('0x7d'))[_0xca70('0x6f')](_0x496b31[_0xca70('0x43')]['id'][_0xca70('0x76')](),_0xca70('0x57'))[_0xca70('0x6f')]('NOW()','createdAt')[_0xca70('0x6f')](_0xca70('0x70'),'updatedAt')[_0xca70('0x72')](_0xca70('0x73'))[_0xca70('0x39')](_0xca70('0x74'))[_0xca70('0x39')]('ListId\x20=\x20?',_0x72c3ef[_0xca70('0x71')][_0xca70('0x76')]())[_0xca70('0x39')](_0xca70('0x77')))[_0xca70('0x76')]();_0x2f6bed[_0xca70('0x83')](db['sequelize']['query'](_0x3fda6a));}return BPromise[_0xca70('0x7f')](_0x2f6bed);}})[_0xca70('0x24')](function(){return _0xe55ed2;})[_0xca70('0x24')](respondWithResult(_0x53b1c6,null))[_0xca70('0x46')](handleError(_0x53b1c6,null));};exports['removeBlackLists']=function(_0x7b20f5,_0xac58b2,_0x3ca968){return db[_0xca70('0x2b')][_0xca70('0x45')]({'where':{'id':_0x7b20f5['params']['id']}})[_0xca70('0x24')](handleEntityNotFound(_0xac58b2,null))[_0xca70('0x24')](function(_0x5bcf68){if(_0x5bcf68){return _0x5bcf68[_0xca70('0x84')](_0x7b20f5[_0xca70('0x30')][_0xca70('0x64')]);}})['then'](function(_0x48a851){if(_0x48a851){return db[_0xca70('0x60')][_0xca70('0x23')]({'where':{'ListId':_0x7b20f5[_0xca70('0x30')]['ids'],'CampaignId':_0x7b20f5[_0xca70('0x43')]['id']}})[_0xca70('0x24')](function(){return _0x48a851;});}})['then'](respondWithStatusCode(_0xac58b2,null))[_0xca70('0x46')](handleError(_0xac58b2,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 0dcc405..a28b382 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(_0x55b86a,_0x9f9772){var _0x46f950=function(_0x3113b0){while(--_0x3113b0){_0x55b86a['push'](_0x55b86a['shift']());}};_0x46f950(++_0x9f9772);}(_0x7a54,0x106));var _0x47a5=function(_0x525189,_0x23b67c){_0x525189=_0x525189-0x0;var _0x71ffaa=_0x7a54[_0x525189];return _0x71ffaa;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 8c624c5..044b9b3 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 _0x59ce=['../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','findAll','options','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x59ce,0x92));var _0xe59c=function(_0x20a03b,_0x4a8942){_0x20a03b=_0x20a03b-0x0;var _0x3a6628=_0x59ce[_0x20a03b];return _0x3a6628;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var moment=require(_0xe59c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe59c('0x3'));var fs=require('fs');var Redis=require(_0xe59c('0x4'));var db=require(_0xe59c('0x5'))['db'];var utils=require(_0xe59c('0x6'));var logger=require(_0xe59c('0x7'))(_0xe59c('0x8'));var config=require(_0xe59c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe59c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534601,_0x4f07e9,_0x2c1d11){return new BPromise(function(_0x101a79,_0x206753){return client[_0xe59c('0xb')](_0x534601,_0x2c1d11)[_0xe59c('0xc')](function(_0x3981be){logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,_0xe59c('0xf'));logger[_0xe59c('0x10')](_0xe59c('0x11'),_0x4f07e9,_0xe59c('0xf'),JSON[_0xe59c('0x12')](_0x3981be));if(_0x3981be[_0xe59c('0x13')]){if(_0x3981be[_0xe59c('0x13')][_0xe59c('0x14')]===0x1f4){logger[_0xe59c('0x13')](_0xe59c('0xe'),_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x206753(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}logger[_0xe59c('0x13')]('Campaign,\x20%s,\x20%s',_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x101a79(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}else{logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,'request\x20sent');_0x101a79(_0x3981be[_0xe59c('0x16')]['message']);}})['catch'](function(_0xee38fc){logger[_0xe59c('0x13')]('Campaign,\x20%s,\x20%s',_0x4f07e9,_0xee38fc);_0x206753(_0xee38fc);});});}exports[_0xe59c('0x17')]=function(_0x38f4b0){var _0x32bfd7=this;return new Promise(function(_0x529c0d,_0xe9f0a1){return db['Campaign'][_0xe59c('0x18')]({'raw':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1a')]||null:null,'attributes':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1b')]||null:null,'limit':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')]['limit']||null:null,'include':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1c')]?_[_0xe59c('0x1d')](_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1c')],function(_0x58f192){return{'model':db[_0x58f192['model']],'as':_0x58f192['as'],'attributes':_0x58f192[_0xe59c('0x1b')],'include':_0x58f192[_0xe59c('0x1c')]?_['map'](_0x58f192[_0xe59c('0x1c')],function(_0x3ee3e9){return{'model':db[_0x3ee3e9['model']],'as':_0x3ee3e9['as'],'attributes':_0x3ee3e9['attributes'],'include':_0x3ee3e9[_0xe59c('0x1c')]?_[_0xe59c('0x1d')](_0x3ee3e9[_0xe59c('0x1c')],function(_0x391fe7){return{'model':db[_0x391fe7[_0xe59c('0x1e')]],'as':_0x391fe7['as'],'attributes':_0x391fe7[_0xe59c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe59c('0xc')](function(_0x4012c6){logger[_0xe59c('0xd')](_0xe59c('0x17'),_0x38f4b0);logger[_0xe59c('0x10')](_0xe59c('0x17'),_0x38f4b0,JSON[_0xe59c('0x12')](_0x4012c6));_0x529c0d(_0x4012c6);})['catch'](function(_0x21bfdc){logger[_0xe59c('0x13')](_0xe59c('0x17'),_0x21bfdc[_0xe59c('0x15')],_0x38f4b0);_0xe9f0a1(_0x32bfd7[_0xe59c('0x13')](0x1f4,_0x21bfdc['message']));});});}; \ No newline at end of file +var _0x3e25=['limit','include','model','map','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','code','error','message','GetCampaign','Campaign','options','where','attributes'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x3e25,0x14f));var _0x53e2=function(_0x820b8b,_0x3d8dd2){_0x820b8b=_0x820b8b-0x0;var _0x3c051b=_0x3e25[_0x820b8b];return _0x3c051b;};'use strict';var _=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var moment=require(_0x53e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x53e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53e2('0x5'))(_0x53e2('0x6'));var config=require(_0x53e2('0x7'));var jayson=require(_0x53e2('0x8'));var client=jayson[_0x53e2('0x9')][_0x53e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1905b4,_0x31c0fa,_0x431bee){return new BPromise(function(_0x1be9ef,_0xf13761){return client[_0x53e2('0xb')](_0x1905b4,_0x431bee)[_0x53e2('0xc')](function(_0x1570dc){logger[_0x53e2('0xd')](_0x53e2('0xe'),_0x31c0fa,_0x53e2('0xf'));logger[_0x53e2('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x31c0fa,_0x53e2('0xf'),JSON['stringify'](_0x1570dc));if(_0x1570dc['error']){if(_0x1570dc['error'][_0x53e2('0x11')]===0x1f4){logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);return _0xf13761(_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);}logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x1570dc['error'][_0x53e2('0x13')]);return _0x1be9ef(_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);}else{logger[_0x53e2('0xd')](_0x53e2('0xe'),_0x31c0fa,_0x53e2('0xf'));_0x1be9ef(_0x1570dc['result'][_0x53e2('0x13')]);}})['catch'](function(_0x33b1cb){logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x33b1cb);_0xf13761(_0x33b1cb);});});}exports[_0x53e2('0x14')]=function(_0x52bae6){var _0x4213d0=this;return new Promise(function(_0x323e53,_0x4f313a){return db[_0x53e2('0x15')]['findAll']({'raw':_0x52bae6[_0x53e2('0x16')]?_0x52bae6['options']['raw']===undefined?!![]:![]:!![],'where':_0x52bae6[_0x53e2('0x16')]?_0x52bae6[_0x53e2('0x16')][_0x53e2('0x17')]||null:null,'attributes':_0x52bae6[_0x53e2('0x16')]?_0x52bae6['options'][_0x53e2('0x18')]||null:null,'limit':_0x52bae6[_0x53e2('0x16')]?_0x52bae6['options'][_0x53e2('0x19')]||null:null,'include':_0x52bae6['options']?_0x52bae6[_0x53e2('0x16')][_0x53e2('0x1a')]?_['map'](_0x52bae6[_0x53e2('0x16')][_0x53e2('0x1a')],function(_0x9c5566){return{'model':db[_0x9c5566[_0x53e2('0x1b')]],'as':_0x9c5566['as'],'attributes':_0x9c5566[_0x53e2('0x18')],'include':_0x9c5566[_0x53e2('0x1a')]?_[_0x53e2('0x1c')](_0x9c5566[_0x53e2('0x1a')],function(_0x4e5101){return{'model':db[_0x4e5101[_0x53e2('0x1b')]],'as':_0x4e5101['as'],'attributes':_0x4e5101['attributes'],'include':_0x4e5101[_0x53e2('0x1a')]?_['map'](_0x4e5101['include'],function(_0x477f9f){return{'model':db[_0x477f9f[_0x53e2('0x1b')]],'as':_0x477f9f['as'],'attributes':_0x477f9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x53e2('0xc')](function(_0x9ad531){logger['info'](_0x53e2('0x14'),_0x52bae6);logger[_0x53e2('0x10')](_0x53e2('0x14'),_0x52bae6,JSON['stringify'](_0x9ad531));_0x323e53(_0x9ad531);})[_0x53e2('0x1d')](function(_0x23ec9d){logger[_0x53e2('0x12')]('GetCampaign',_0x23ec9d['message'],_0x52bae6);_0x4f313a(_0x4213d0['error'](0x1f4,_0x23ec9d['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 35f88a8..d2b23f8 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 _0xbc4b=['getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','addBlackLists','put','destroy','delete','/:id/lists','removeLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x30d8e7,_0x4f0c59){var _0x11cde7=function(_0x4d101e){while(--_0x4d101e){_0x30d8e7['push'](_0x30d8e7['shift']());}};_0x11cde7(++_0x4f0c59);}(_0xbc4b,0x17a));var _0xbbc4=function(_0x499007,_0x44b8fb){_0x499007=_0x499007-0x0;var _0x52fad7=_0xbc4b[_0x499007];return _0x52fad7;};'use strict';var multer=require(_0xbbc4('0x0'));var util=require('util');var path=require(_0xbbc4('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbc4('0x2'));var router=express[_0xbbc4('0x3')]();var fs_extra=require(_0xbbc4('0x4'));var auth=require(_0xbbc4('0x5'));var interaction=require(_0xbbc4('0x6'));var config=require(_0xbbc4('0x7'));var controller=require(_0xbbc4('0x8'));router[_0xbbc4('0x9')]('/',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0xb')]);router[_0xbbc4('0x9')](_0xbbc4('0xc'),auth['isAuthenticated'](),controller[_0xbbc4('0xd')]);router[_0xbbc4('0x9')](_0xbbc4('0xe'),auth['isAuthenticated'](),controller[_0xbbc4('0xf')]);router[_0xbbc4('0x9')](_0xbbc4('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbbc4('0x9')](_0xbbc4('0x11'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x12')]);router[_0xbbc4('0x9')](_0xbbc4('0x13'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x14')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xbbc4('0x15')]);router[_0xbbc4('0x9')](_0xbbc4('0x16'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x17')]);router[_0xbbc4('0x18')]('/',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x19')]);router[_0xbbc4('0x18')]('/:id/clone',auth[_0xbbc4('0xa')](),controller['clone']);router['post']('/:id/lists',auth[_0xbbc4('0xa')](),controller['addLists']);router[_0xbbc4('0x18')]('/:id/blacklists',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1a')]);router[_0xbbc4('0x1b')](_0xbbc4('0xc'),auth[_0xbbc4('0xa')](),controller['update']);router['delete'](_0xbbc4('0xc'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1c')]);router[_0xbbc4('0x1d')](_0xbbc4('0x1e'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1f')]);router[_0xbbc4('0x1d')](_0xbbc4('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xbbc4('0x20')]=router; \ No newline at end of file +var _0xc415=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x1abc40,_0x418755){var _0x5e8e3a=function(_0x2c1e4c){while(--_0x2c1e4c){_0x1abc40['push'](_0x1abc40['shift']());}};_0x5e8e3a(++_0x418755);}(_0xc415,0xd8));var _0x5c41=function(_0x3e3eb4,_0x123a03){_0x3e3eb4=_0x3e3eb4-0x0;var _0x46b4cc=_0xc415[_0x3e3eb4];return _0x46b4cc;};'use strict';var multer=require(_0x5c41('0x0'));var util=require(_0x5c41('0x1'));var path=require(_0x5c41('0x2'));var timeout=require(_0x5c41('0x3'));var express=require('express');var router=express[_0x5c41('0x4')]();var fs_extra=require(_0x5c41('0x5'));var auth=require(_0x5c41('0x6'));var interaction=require(_0x5c41('0x7'));var config=require(_0x5c41('0x8'));var controller=require(_0x5c41('0x9'));router[_0x5c41('0xa')]('/',auth[_0x5c41('0xb')](),controller[_0x5c41('0xc')]);router[_0x5c41('0xa')](_0x5c41('0xd'),auth[_0x5c41('0xb')](),controller[_0x5c41('0xe')]);router[_0x5c41('0xa')]('/:id/hoppers',auth[_0x5c41('0xb')](),controller[_0x5c41('0xf')]);router[_0x5c41('0xa')](_0x5c41('0x10'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x11')]);router[_0x5c41('0xa')](_0x5c41('0x12'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x13')]);router[_0x5c41('0xa')](_0x5c41('0x14'),auth['isAuthenticated'](),controller[_0x5c41('0x15')]);router[_0x5c41('0xa')](_0x5c41('0x16'),auth['isAuthenticated'](),controller[_0x5c41('0x17')]);router['get'](_0x5c41('0x18'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x19')]);router[_0x5c41('0x1a')]('/',auth['isAuthenticated'](),controller[_0x5c41('0x1b')]);router['post'](_0x5c41('0x1c'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x1d')]);router[_0x5c41('0x1a')](_0x5c41('0x16'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x1e')]);router['post'](_0x5c41('0x18'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x1f')]);router[_0x5c41('0x20')](_0x5c41('0xd'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x21')]);router[_0x5c41('0x22')](_0x5c41('0xd'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x23')]);router['delete'](_0x5c41('0x16'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x24')]);router[_0x5c41('0x22')](_0x5c41('0x18'),auth[_0x5c41('0xb')](),controller[_0x5c41('0x25')]);module[_0x5c41('0x26')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 089691b..24de36b 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 _0xce3d=['VIRTUAL','getDataValue','key','sequelize','TEXT'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0xce3d,0x166));var _0xdce3=function(_0x490f59,_0x51681d){_0x490f59=_0x490f59-0x0;var _0x5e4394=_0xce3d[_0x490f59];return _0x5e4394;};'use strict';var Sequelize=require(_0xdce3('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xdce3('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xdce3('0x2')],'get':function(){return this[_0xdce3('0x3')](_0xdce3('0x4'));}}}; \ No newline at end of file +var _0xd56a=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0xd56a,0x125));var _0xad56=function(_0x3e6194,_0x2b7204){_0x3e6194=_0x3e6194-0x0;var _0x2da881=_0xd56a[_0x3e6194];return _0x2da881;};'use strict';var Sequelize=require(_0xad56('0x0'));module[_0xad56('0x1')]={'key':{'type':Sequelize[_0xad56('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xad56('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xad56('0x4')],'get':function(){return this[_0xad56('0x5')](_0xad56('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 35587b7..0a01855 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 _0x51f4=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3ad776,_0x3b8ad8){var _0x10bd47=function(_0x4e4897){while(--_0x4e4897){_0x3ad776['push'](_0x3ad776['shift']());}};_0x10bd47(++_0x3b8ad8);}(_0x51f4,0xb3));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x451f('0x0'));var rimraf=require(_0x451f('0x1'));var zipdir=require(_0x451f('0x2'));var jsonpatch=require(_0x451f('0x3'));var rp=require(_0x451f('0x4'));var moment=require(_0x451f('0x5'));var BPromise=require(_0x451f('0x6'));var Mustache=require(_0x451f('0x7'));var util=require('util');var path=require(_0x451f('0x8'));var sox=require(_0x451f('0x9'));var csv=require(_0x451f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x451f('0xb'));var _=require(_0x451f('0xc'));var squel=require(_0x451f('0xd'));var crypto=require(_0x451f('0xe'));var jsforce=require(_0x451f('0xf'));var deskjs=require(_0x451f('0x10'));var toCsv=require(_0x451f('0xa'));var querystring=require(_0x451f('0x11'));var Papa=require(_0x451f('0x12'));var Redis=require('ioredis');var authService=require(_0x451f('0x13'));var qs=require(_0x451f('0x14'));var as=require(_0x451f('0x15'));var hardwareService=require(_0x451f('0x16'));var logger=require(_0x451f('0x17'))(_0x451f('0x18'));var utils=require(_0x451f('0x19'));var config=require(_0x451f('0x1a'));var licenseUtil=require(_0x451f('0x1b'));var db=require(_0x451f('0x1c'))['db'];function respondWithStatusCode(_0xeacd9c,_0x5f7eb5){_0x5f7eb5=_0x5f7eb5||0xcc;return function(_0x3471ae){if(_0x3471ae){return _0xeacd9c['sendStatus'](_0x5f7eb5);}return _0xeacd9c[_0x451f('0x1d')](_0x5f7eb5)[_0x451f('0x1e')]();};}function respondWithResult(_0x43f6db,_0x5f4483){_0x5f4483=_0x5f4483||0xc8;return function(_0x4837c7){if(_0x4837c7){return _0x43f6db['status'](_0x5f4483)['json'](_0x4837c7);}};}function respondWithFilteredResult(_0x4187b7,_0x5255fd){return function(_0x5ba41f){if(_0x5ba41f){var _0x286b8f=typeof _0x5255fd[_0x451f('0x1f')]===_0x451f('0x20')&&typeof _0x5255fd[_0x451f('0x21')]==='undefined';var _0xa77027=_0x5ba41f[_0x451f('0x22')];var _0x504335=_0x286b8f?0x0:_0x5255fd[_0x451f('0x1f')];var _0x273e6e=_0x286b8f?_0x5ba41f[_0x451f('0x22')]:_0x5255fd[_0x451f('0x1f')]+_0x5255fd[_0x451f('0x21')];var _0x2a1fc8;if(_0x273e6e>=_0xa77027){_0x273e6e=_0xa77027;_0x2a1fc8=0xc8;}else{_0x2a1fc8=0xce;}_0x4187b7[_0x451f('0x1d')](_0x2a1fc8);return _0x4187b7[_0x451f('0x23')](_0x451f('0x24'),_0x504335+'-'+_0x273e6e+'/'+_0xa77027)['json'](_0x5ba41f);}return null;};}function patchUpdates(_0x1b275f){return function(_0x2effcc){try{jsonpatch[_0x451f('0x25')](_0x2effcc,_0x1b275f,!![]);}catch(_0x18ad17){return BPromise[_0x451f('0x26')](_0x18ad17);}return _0x2effcc['save']();};}function saveUpdates(_0x3dbde8,_0x1f0a7f){return function(_0x2a8580){if(_0x2a8580){return _0x2a8580[_0x451f('0x27')](_0x3dbde8)[_0x451f('0x28')](function(_0x375619){return _0x375619;});}return null;};}function removeEntity(_0x462c43,_0x168753){return function(_0x3d3f94){if(_0x3d3f94){return _0x3d3f94[_0x451f('0x29')]()[_0x451f('0x28')](function(){var _0x59f3bc=_0x3d3f94['get']({'plain':!![]});var _0x580c7f=_0x451f('0x2a');return db[_0x451f('0x2b')][_0x451f('0x29')]({'where':{'type':_0x580c7f,'resourceId':_0x59f3bc['id']}})[_0x451f('0x28')](function(){return _0x3d3f94;});})[_0x451f('0x28')](function(){_0x462c43[_0x451f('0x1d')](0xcc)[_0x451f('0x1e')]();});}};}function handleEntityNotFound(_0x4dbac8,_0x30b8be){return function(_0x5750cc){if(!_0x5750cc){_0x4dbac8['sendStatus'](0x194);}return _0x5750cc;};}function handleError(_0x24b8f3,_0x2dd3dc){_0x2dd3dc=_0x2dd3dc||0x1f4;return function(_0x28306d){logger[_0x451f('0x2c')](_0x28306d[_0x451f('0x2d')]);if(_0x28306d['name']){delete _0x28306d['name'];}_0x24b8f3[_0x451f('0x1d')](_0x2dd3dc)[_0x451f('0x2e')](_0x28306d);};}exports[_0x451f('0x2f')]=function(_0x480f3b,_0x57b925){var _0x18d5b3={},_0x12be7c={},_0x446beb={'count':0x0,'rows':[]};var _0x15a654=_['map'](db['CannedAnswer'][_0x451f('0x30')],function(_0x120efd){return{'name':_0x120efd[_0x451f('0x31')],'type':_0x120efd['type'][_0x451f('0x32')]};});_0x12be7c['model']=_[_0x451f('0x33')](_0x15a654,'name');_0x12be7c['query']=_['keys'](_0x480f3b[_0x451f('0x34')]);_0x12be7c[_0x451f('0x35')]=_['intersection'](_0x12be7c[_0x451f('0x36')],_0x12be7c[_0x451f('0x34')]);_0x18d5b3[_0x451f('0x37')]=_[_0x451f('0x38')](_0x12be7c['model'],qs[_0x451f('0x39')](_0x480f3b[_0x451f('0x34')][_0x451f('0x39')]));_0x18d5b3[_0x451f('0x37')]=_0x18d5b3[_0x451f('0x37')][_0x451f('0x3a')]?_0x18d5b3[_0x451f('0x37')]:_0x12be7c['model'];if(!_0x480f3b['query'][_0x451f('0x3b')](_0x451f('0x3c'))){_0x18d5b3[_0x451f('0x21')]=qs[_0x451f('0x21')](_0x480f3b['query'][_0x451f('0x21')]);_0x18d5b3['offset']=qs[_0x451f('0x1f')](_0x480f3b[_0x451f('0x34')][_0x451f('0x1f')]);}_0x18d5b3['order']=qs['sort'](_0x480f3b['query'][_0x451f('0x3d')]);_0x18d5b3['where']=qs[_0x451f('0x35')](_['pick'](_0x480f3b[_0x451f('0x34')],_0x12be7c[_0x451f('0x35')]),_0x15a654);if(_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]){_0x18d5b3[_0x451f('0x3f')]=_[_0x451f('0x40')](_0x18d5b3[_0x451f('0x3f')],{'$or':[{'key':{'$like':'%'+_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]+'%'}},{'value':{'$like':'%'+_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]+'%'}}]});}_0x18d5b3=_['merge']({},_0x18d5b3,_0x480f3b[_0x451f('0x41')]);var _0x44e7e3={'where':_0x18d5b3['where']};return db[_0x451f('0x42')]['count'](_0x44e7e3)['then'](function(_0x406c7c){_0x446beb[_0x451f('0x22')]=_0x406c7c;if(_0x480f3b[_0x451f('0x34')][_0x451f('0x43')]){_0x18d5b3[_0x451f('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x451f('0x45')](_0x18d5b3);})[_0x451f('0x28')](function(_0x26dcfb){_0x446beb[_0x451f('0x46')]=_0x26dcfb;return _0x446beb;})[_0x451f('0x28')](respondWithFilteredResult(_0x57b925,_0x18d5b3))[_0x451f('0x47')](handleError(_0x57b925,null));};exports[_0x451f('0x48')]=function(_0x296bdc,_0xa0a259){var _0x58539e={'raw':!![],'where':{'id':_0x296bdc[_0x451f('0x49')]['id']}},_0x4ba027={};_0x4ba027[_0x451f('0x36')]=_[_0x451f('0x4a')](db['CannedAnswer'][_0x451f('0x30')]);_0x4ba027['query']=_[_0x451f('0x4a')](_0x296bdc['query']);_0x4ba027['filters']=_['intersection'](_0x4ba027[_0x451f('0x36')],_0x4ba027[_0x451f('0x34')]);_0x58539e['attributes']=_[_0x451f('0x38')](_0x4ba027['model'],qs[_0x451f('0x39')](_0x296bdc[_0x451f('0x34')][_0x451f('0x39')]));_0x58539e[_0x451f('0x37')]=_0x58539e['attributes'][_0x451f('0x3a')]?_0x58539e[_0x451f('0x37')]:_0x4ba027[_0x451f('0x36')];if(_0x296bdc[_0x451f('0x34')][_0x451f('0x43')]){_0x58539e[_0x451f('0x44')]=[{'all':!![]}];}_0x58539e=_[_0x451f('0x40')]({},_0x58539e,_0x296bdc[_0x451f('0x41')]);return db['CannedAnswer'][_0x451f('0x4b')](_0x58539e)[_0x451f('0x28')](handleEntityNotFound(_0xa0a259,null))[_0x451f('0x28')](respondWithResult(_0xa0a259,null))['catch'](handleError(_0xa0a259,null));};exports['update']=function(_0x477fcf,_0x39fe89){if(_0x477fcf[_0x451f('0x4c')]['id']){delete _0x477fcf['body']['id'];}return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':{'id':_0x477fcf[_0x451f('0x49')]['id']}})['then'](handleEntityNotFound(_0x39fe89,null))[_0x451f('0x28')](saveUpdates(_0x477fcf[_0x451f('0x4c')],null))[_0x451f('0x28')](respondWithResult(_0x39fe89,null))[_0x451f('0x47')](handleError(_0x39fe89,null));};exports[_0x451f('0x29')]=function(_0x221214,_0x3a3cb0){return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':{'id':_0x221214['params']['id']}})[_0x451f('0x28')](handleEntityNotFound(_0x3a3cb0,null))[_0x451f('0x28')](removeEntity(_0x3a3cb0,null))['catch'](handleError(_0x3a3cb0,null));};exports[_0x451f('0x4d')]=function(_0x2d8986,_0x440adc){var _0x2ae6b0={'key':_0x2d8986[_0x451f('0x4c')]['key']};if(_0x2d8986['body'][_0x451f('0x4e')]){_0x2ae6b0[_0x451f('0x4e')]=_0x2d8986[_0x451f('0x4c')][_0x451f('0x4e')];}else if(_0x2d8986[_0x451f('0x4c')][_0x451f('0x4f')]){_0x2ae6b0[_0x451f('0x4f')]=_0x2d8986[_0x451f('0x4c')][_0x451f('0x4f')];}else if(_0x2d8986[_0x451f('0x4c')][_0x451f('0x50')]){_0x2ae6b0[_0x451f('0x50')]=_0x2d8986['body'][_0x451f('0x50')];}else if(_0x2d8986[_0x451f('0x4c')]['ChatWebsiteId']){_0x2ae6b0[_0x451f('0x51')]=_0x2d8986['body'][_0x451f('0x51')];}return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':_0x2ae6b0})[_0x451f('0x28')](function(_0x4d3ec3){if(_0x4d3ec3){throw new db[(_0x451f('0x52'))][(_0x451f('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x451f('0x4d')](_0x2d8986[_0x451f('0x4c')]);})['then'](function(_0x483244){var _0x42153f=_0x2d8986['user']['get']({'plain':!![]});if(!_0x42153f)throw new Error(_0x451f('0x54'));if(_0x42153f['role']===_0x451f('0x55')){var _0x94ea8b=_0x483244[_0x451f('0x56')]({'plain':!![]});return db[_0x451f('0x57')][_0x451f('0x4b')]({'where':{'name':_0x451f('0x2a'),'userProfileId':_0x42153f[_0x451f('0x58')]},'raw':!![]})[_0x451f('0x28')](function(_0x2c8e57){if(_0x2c8e57&&_0x2c8e57[_0x451f('0x59')]===0x0){return db['UserProfileResource'][_0x451f('0x4d')]({'name':_0x94ea8b[_0x451f('0x5a')],'resourceId':_0x94ea8b['id'],'type':_0x2c8e57['name'],'sectionId':_0x2c8e57['id']},{})['then'](function(){return _0x483244;});}else{return _0x483244;}})[_0x451f('0x47')](function(_0x433a42){logger['error'](_0x451f('0x5b'),_0x433a42);throw _0x433a42;});}return _0x483244;})['then'](respondWithResult(_0x440adc,0xc9))[_0x451f('0x47')](handleError(_0x440adc,null));}; \ No newline at end of file +var _0x2947=['ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x2947,0x1e0));var _0x7294=function(_0x530cd1,_0x189bfa){_0x530cd1=_0x530cd1-0x0;var _0x4bf252=_0x2947[_0x530cd1];return _0x4bf252;};'use strict';var emlformat=require(_0x7294('0x0'));var rimraf=require(_0x7294('0x1'));var zipdir=require(_0x7294('0x2'));var jsonpatch=require(_0x7294('0x3'));var rp=require(_0x7294('0x4'));var moment=require(_0x7294('0x5'));var BPromise=require(_0x7294('0x6'));var Mustache=require(_0x7294('0x7'));var util=require(_0x7294('0x8'));var path=require(_0x7294('0x9'));var sox=require('sox');var csv=require(_0x7294('0xa'));var ejs=require(_0x7294('0xb'));var fs=require('fs');var fs_extra=require(_0x7294('0xc'));var _=require(_0x7294('0xd'));var squel=require(_0x7294('0xe'));var crypto=require(_0x7294('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7294('0x10'));var toCsv=require(_0x7294('0xa'));var querystring=require(_0x7294('0x11'));var Papa=require(_0x7294('0x12'));var Redis=require(_0x7294('0x13'));var authService=require(_0x7294('0x14'));var qs=require(_0x7294('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7294('0x16'))('api');var utils=require(_0x7294('0x17'));var config=require(_0x7294('0x18'));var licenseUtil=require(_0x7294('0x19'));var db=require(_0x7294('0x1a'))['db'];function respondWithStatusCode(_0x4ce9a3,_0x2f1cf4){_0x2f1cf4=_0x2f1cf4||0xcc;return function(_0x2cbcdd){if(_0x2cbcdd){return _0x4ce9a3[_0x7294('0x1b')](_0x2f1cf4);}return _0x4ce9a3[_0x7294('0x1c')](_0x2f1cf4)[_0x7294('0x1d')]();};}function respondWithResult(_0x2a2ebd,_0x56e9ae){_0x56e9ae=_0x56e9ae||0xc8;return function(_0x408052){if(_0x408052){return _0x2a2ebd['status'](_0x56e9ae)[_0x7294('0x1e')](_0x408052);}};}function respondWithFilteredResult(_0x2f8c5c,_0x1a3752){return function(_0x2f1191){if(_0x2f1191){var _0x4c4f66=typeof _0x1a3752[_0x7294('0x1f')]===_0x7294('0x20')&&typeof _0x1a3752[_0x7294('0x21')]===_0x7294('0x20');var _0x16e122=_0x2f1191[_0x7294('0x22')];var _0x433039=_0x4c4f66?0x0:_0x1a3752[_0x7294('0x1f')];var _0x2f5206=_0x4c4f66?_0x2f1191[_0x7294('0x22')]:_0x1a3752[_0x7294('0x1f')]+_0x1a3752[_0x7294('0x21')];var _0x18f261;if(_0x2f5206>=_0x16e122){_0x2f5206=_0x16e122;_0x18f261=0xc8;}else{_0x18f261=0xce;}_0x2f8c5c[_0x7294('0x1c')](_0x18f261);return _0x2f8c5c[_0x7294('0x23')](_0x7294('0x24'),_0x433039+'-'+_0x2f5206+'/'+_0x16e122)[_0x7294('0x1e')](_0x2f1191);}return null;};}function patchUpdates(_0x249384){return function(_0x41becd){try{jsonpatch[_0x7294('0x25')](_0x41becd,_0x249384,!![]);}catch(_0x3ca2e4){return BPromise[_0x7294('0x26')](_0x3ca2e4);}return _0x41becd['save']();};}function saveUpdates(_0xe5d7e6,_0x25d6ff){return function(_0x278999){if(_0x278999){return _0x278999[_0x7294('0x27')](_0xe5d7e6)['then'](function(_0x38cdfe){return _0x38cdfe;});}return null;};}function removeEntity(_0x5a92d3,_0xef2d30){return function(_0x5dc06d){if(_0x5dc06d){return _0x5dc06d[_0x7294('0x28')]()[_0x7294('0x29')](function(){var _0x425a5c=_0x5dc06d[_0x7294('0x2a')]({'plain':!![]});var _0x4c0934=_0x7294('0x2b');return db[_0x7294('0x2c')]['destroy']({'where':{'type':_0x4c0934,'resourceId':_0x425a5c['id']}})['then'](function(){return _0x5dc06d;});})[_0x7294('0x29')](function(){_0x5a92d3[_0x7294('0x1c')](0xcc)[_0x7294('0x1d')]();});}};}function handleEntityNotFound(_0x3f4864,_0x3a773f){return function(_0x513374){if(!_0x513374){_0x3f4864['sendStatus'](0x194);}return _0x513374;};}function handleError(_0x218c20,_0x5ce472){_0x5ce472=_0x5ce472||0x1f4;return function(_0x4ba8e1){logger[_0x7294('0x2d')](_0x4ba8e1[_0x7294('0x2e')]);if(_0x4ba8e1[_0x7294('0x2f')]){delete _0x4ba8e1[_0x7294('0x2f')];}_0x218c20[_0x7294('0x1c')](_0x5ce472)['send'](_0x4ba8e1);};}exports['index']=function(_0x3c6def,_0x2d5ed1){var _0x53fbbe={},_0x5d298a={},_0x3c6d41={'count':0x0,'rows':[]};var _0x3b59eb=_[_0x7294('0x30')](db[_0x7294('0x31')][_0x7294('0x32')],function(_0x3308ac){return{'name':_0x3308ac[_0x7294('0x33')],'type':_0x3308ac[_0x7294('0x34')][_0x7294('0x35')]};});_0x5d298a[_0x7294('0x36')]=_[_0x7294('0x30')](_0x3b59eb,_0x7294('0x2f'));_0x5d298a[_0x7294('0x37')]=_['keys'](_0x3c6def[_0x7294('0x37')]);_0x5d298a[_0x7294('0x38')]=_[_0x7294('0x39')](_0x5d298a[_0x7294('0x36')],_0x5d298a[_0x7294('0x37')]);_0x53fbbe[_0x7294('0x3a')]=_[_0x7294('0x39')](_0x5d298a[_0x7294('0x36')],qs[_0x7294('0x3b')](_0x3c6def[_0x7294('0x37')][_0x7294('0x3b')]));_0x53fbbe[_0x7294('0x3a')]=_0x53fbbe[_0x7294('0x3a')][_0x7294('0x3c')]?_0x53fbbe['attributes']:_0x5d298a['model'];if(!_0x3c6def[_0x7294('0x37')][_0x7294('0x3d')](_0x7294('0x3e'))){_0x53fbbe['limit']=qs[_0x7294('0x21')](_0x3c6def[_0x7294('0x37')][_0x7294('0x21')]);_0x53fbbe[_0x7294('0x1f')]=qs[_0x7294('0x1f')](_0x3c6def[_0x7294('0x37')]['offset']);}_0x53fbbe[_0x7294('0x3f')]=qs['sort'](_0x3c6def['query'][_0x7294('0x40')]);_0x53fbbe[_0x7294('0x41')]=qs['filters'](_[_0x7294('0x42')](_0x3c6def[_0x7294('0x37')],_0x5d298a['filters']),_0x3b59eb);if(_0x3c6def['query'][_0x7294('0x43')]){_0x53fbbe[_0x7294('0x41')]=_[_0x7294('0x44')](_0x53fbbe['where'],{'$or':[{'key':{'$like':'%'+_0x3c6def['query'][_0x7294('0x43')]+'%'}},{'value':{'$like':'%'+_0x3c6def[_0x7294('0x37')][_0x7294('0x43')]+'%'}}]});}_0x53fbbe=_[_0x7294('0x44')]({},_0x53fbbe,_0x3c6def[_0x7294('0x45')]);var _0x53b4c4={'where':_0x53fbbe[_0x7294('0x41')]};return db['CannedAnswer']['count'](_0x53b4c4)[_0x7294('0x29')](function(_0x562389){_0x3c6d41[_0x7294('0x22')]=_0x562389;if(_0x3c6def['query'][_0x7294('0x46')]){_0x53fbbe[_0x7294('0x47')]=[{'all':!![]}];}return db[_0x7294('0x31')][_0x7294('0x48')](_0x53fbbe);})[_0x7294('0x29')](function(_0x1e3974){_0x3c6d41[_0x7294('0x49')]=_0x1e3974;return _0x3c6d41;})[_0x7294('0x29')](respondWithFilteredResult(_0x2d5ed1,_0x53fbbe))['catch'](handleError(_0x2d5ed1,null));};exports[_0x7294('0x4a')]=function(_0x2d0a2d,_0x5d7dcd){var _0x518d11={'raw':!![],'where':{'id':_0x2d0a2d[_0x7294('0x4b')]['id']}},_0x1bbd6b={};_0x1bbd6b[_0x7294('0x36')]=_[_0x7294('0x4c')](db[_0x7294('0x31')][_0x7294('0x32')]);_0x1bbd6b[_0x7294('0x37')]=_[_0x7294('0x4c')](_0x2d0a2d[_0x7294('0x37')]);_0x1bbd6b['filters']=_[_0x7294('0x39')](_0x1bbd6b['model'],_0x1bbd6b[_0x7294('0x37')]);_0x518d11[_0x7294('0x3a')]=_[_0x7294('0x39')](_0x1bbd6b[_0x7294('0x36')],qs[_0x7294('0x3b')](_0x2d0a2d[_0x7294('0x37')][_0x7294('0x3b')]));_0x518d11[_0x7294('0x3a')]=_0x518d11[_0x7294('0x3a')][_0x7294('0x3c')]?_0x518d11[_0x7294('0x3a')]:_0x1bbd6b[_0x7294('0x36')];if(_0x2d0a2d[_0x7294('0x37')][_0x7294('0x46')]){_0x518d11[_0x7294('0x47')]=[{'all':!![]}];}_0x518d11=_[_0x7294('0x44')]({},_0x518d11,_0x2d0a2d[_0x7294('0x45')]);return db['CannedAnswer'][_0x7294('0x4d')](_0x518d11)[_0x7294('0x29')](handleEntityNotFound(_0x5d7dcd,null))[_0x7294('0x29')](respondWithResult(_0x5d7dcd,null))[_0x7294('0x4e')](handleError(_0x5d7dcd,null));};exports[_0x7294('0x27')]=function(_0x283804,_0x1d60d6){if(_0x283804[_0x7294('0x4f')]['id']){delete _0x283804[_0x7294('0x4f')]['id'];}return db[_0x7294('0x31')][_0x7294('0x4d')]({'where':{'id':_0x283804[_0x7294('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d60d6,null))[_0x7294('0x29')](saveUpdates(_0x283804[_0x7294('0x4f')],null))['then'](respondWithResult(_0x1d60d6,null))[_0x7294('0x4e')](handleError(_0x1d60d6,null));};exports[_0x7294('0x28')]=function(_0x29d2e7,_0xd7d91f){return db[_0x7294('0x31')][_0x7294('0x4d')]({'where':{'id':_0x29d2e7['params']['id']}})[_0x7294('0x29')](handleEntityNotFound(_0xd7d91f,null))['then'](removeEntity(_0xd7d91f,null))[_0x7294('0x4e')](handleError(_0xd7d91f,null));};exports[_0x7294('0x50')]=function(_0x49340e,_0x45fad5){var _0x212ede={'key':_0x49340e['body'][_0x7294('0x35')]};if(_0x49340e['body'][_0x7294('0x51')]){_0x212ede[_0x7294('0x51')]=_0x49340e[_0x7294('0x4f')][_0x7294('0x51')];}else if(_0x49340e[_0x7294('0x4f')][_0x7294('0x52')]){_0x212ede[_0x7294('0x52')]=_0x49340e['body'][_0x7294('0x52')];}else if(_0x49340e[_0x7294('0x4f')][_0x7294('0x53')]){_0x212ede[_0x7294('0x53')]=_0x49340e['body'][_0x7294('0x53')];}else if(_0x49340e[_0x7294('0x4f')][_0x7294('0x54')]){_0x212ede[_0x7294('0x54')]=_0x49340e[_0x7294('0x4f')][_0x7294('0x54')];}return db[_0x7294('0x31')][_0x7294('0x4d')]({'where':_0x212ede})['then'](function(_0x4f5871){if(_0x4f5871){throw new db[(_0x7294('0x55'))][(_0x7294('0x56'))](_0x7294('0x57'));}return db[_0x7294('0x31')]['create'](_0x49340e[_0x7294('0x4f')]);})[_0x7294('0x29')](function(_0x3feb06){var _0x33e28a=_0x49340e[_0x7294('0x58')]['get']({'plain':!![]});if(!_0x33e28a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33e28a[_0x7294('0x59')]===_0x7294('0x58')){var _0x485917=_0x3feb06[_0x7294('0x2a')]({'plain':!![]});return db[_0x7294('0x5a')]['find']({'where':{'name':_0x7294('0x2b'),'userProfileId':_0x33e28a[_0x7294('0x5b')]},'raw':!![]})[_0x7294('0x29')](function(_0x4ab5ad){if(_0x4ab5ad&&_0x4ab5ad[_0x7294('0x5c')]===0x0){return db[_0x7294('0x2c')][_0x7294('0x50')]({'name':_0x485917[_0x7294('0x2f')],'resourceId':_0x485917['id'],'type':_0x4ab5ad[_0x7294('0x2f')],'sectionId':_0x4ab5ad['id']},{})[_0x7294('0x29')](function(){return _0x3feb06;});}else{return _0x3feb06;}})[_0x7294('0x4e')](function(_0x542026){logger[_0x7294('0x2d')](_0x7294('0x5d'),_0x542026);throw _0x542026;});}return _0x3feb06;})[_0x7294('0x29')](respondWithResult(_0x45fad5,0xc9))[_0x7294('0x4e')](handleError(_0x45fad5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9081d36..e41162e 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 _0x657b=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1f74af,_0x3d34b1){var _0x55374f=function(_0x26c179){while(--_0x26c179){_0x1f74af['push'](_0x1f74af['shift']());}};_0x55374f(++_0x3d34b1);}(_0x657b,0x131));var _0xb657=function(_0x28d518,_0x473f87){_0x28d518=_0x28d518-0x0;var _0x87c9a1=_0x657b[_0x28d518];return _0x87c9a1;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require('bluebird');var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module[_0xb657('0x9')]=function(_0x25738d,_0x446b17){return _0x25738d['define'](_0xb657('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb657('0xb'),'collate':_0xb657('0xc')});}; \ No newline at end of file +var _0x30da=['path','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x30da,0x14f));var _0xa30d=function(_0x3593ab,_0x59be19){_0x3593ab=_0x3593ab-0x0;var _0x2aeb65=_0x30da[_0x3593ab];return _0x2aeb65;};'use strict';var _=require(_0xa30d('0x0'));var util=require('util');var logger=require(_0xa30d('0x1'))(_0xa30d('0x2'));var moment=require(_0xa30d('0x3'));var BPromise=require(_0xa30d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa30d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa30d('0x6'));module['exports']=function(_0x2add1f,_0x29e56e){return _0x2add1f[_0xa30d('0x7')](_0xa30d('0x8'),attributes,{'tableName':_0xa30d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 4c1e561..6acbceb 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(_0x167198,_0x55bffd){var _0x21acf6=function(_0x34e7ae){while(--_0x34e7ae){_0x167198['push'](_0x167198['shift']());}};_0x21acf6(++_0x55bffd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0xc60eca,_0x27c6b0){var _0x861046=function(_0x1650c4){while(--_0x1650c4){_0xc60eca['push'](_0xc60eca['shift']());}};_0x861046(++_0x27c6b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 c488043..db8e07e 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 _0xba06=['create','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xba06,0x1e0));var _0x6ba0=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xba06[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0x6ba0('0x0'));var path=require(_0x6ba0('0x1'));var timeout=require(_0x6ba0('0x2'));var express=require(_0x6ba0('0x3'));var router=express[_0x6ba0('0x4')]();var fs_extra=require(_0x6ba0('0x5'));var auth=require(_0x6ba0('0x6'));var interaction=require(_0x6ba0('0x7'));var config=require(_0x6ba0('0x8'));var controller=require(_0x6ba0('0x9'));router[_0x6ba0('0xa')]('/',auth[_0x6ba0('0xb')](),controller[_0x6ba0('0xc')]);router[_0x6ba0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6ba0('0xd')]);router['post']('/',auth[_0x6ba0('0xb')](),controller[_0x6ba0('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6ba0('0xf')]);router[_0x6ba0('0x10')](_0x6ba0('0x11'),auth[_0x6ba0('0xb')](),controller['destroy']);module[_0x6ba0('0x12')]=router; \ No newline at end of file +var _0xa7a0=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7a0,0x64));var _0x0a7a=function(_0x3bdb67,_0x5205bd){_0x3bdb67=_0x3bdb67-0x0;var _0x1a7f46=_0xa7a0[_0x3bdb67];return _0x1a7f46;};'use strict';var multer=require(_0x0a7a('0x0'));var util=require(_0x0a7a('0x1'));var path=require('path');var timeout=require(_0x0a7a('0x2'));var express=require('express');var router=express[_0x0a7a('0x3')]();var fs_extra=require(_0x0a7a('0x4'));var auth=require(_0x0a7a('0x5'));var interaction=require(_0x0a7a('0x6'));var config=require(_0x0a7a('0x7'));var controller=require(_0x0a7a('0x8'));router[_0x0a7a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0a7a('0x9')](_0x0a7a('0xa'),auth[_0x0a7a('0xb')](),controller[_0x0a7a('0xc')]);router[_0x0a7a('0xd')]('/',auth[_0x0a7a('0xb')](),controller[_0x0a7a('0xe')]);router[_0x0a7a('0xf')](_0x0a7a('0xa'),auth[_0x0a7a('0xb')](),controller[_0x0a7a('0x10')]);router[_0x0a7a('0x11')](_0x0a7a('0xa'),auth['isAuthenticated'](),controller[_0x0a7a('0x12')]);module[_0x0a7a('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index d1d4649..34428dd 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 _0x6a00=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x5f418c,_0x470146){var _0x3681eb=function(_0x2369a3){while(--_0x2369a3){_0x5f418c['push'](_0x5f418c['shift']());}};_0x3681eb(++_0x470146);}(_0x6a00,0xc9));var _0x06a0=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x6a00[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x06a0('0x0'));module[_0x06a0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x06a0('0x2')},'clid':{'type':Sequelize[_0x06a0('0x3')]},'src':{'type':Sequelize[_0x06a0('0x3')]},'dst':{'type':Sequelize[_0x06a0('0x3')]},'dcontext':{'type':Sequelize[_0x06a0('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x06a0('0x3')]},'lastdata':{'type':Sequelize[_0x06a0('0x3')]},'duration':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x06a0('0x3')]},'amaflags':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x06a0('0x3')]},'uniqueid':{'type':Sequelize[_0x06a0('0x3')]},'linkedid':{'type':Sequelize[_0x06a0('0x3')]},'sequence':{'type':Sequelize[_0x06a0('0x3')]},'peeraccount':{'type':Sequelize[_0x06a0('0x3')]},'type':{'type':Sequelize[_0x06a0('0x3')]},'tag':{'type':Sequelize[_0x06a0('0x3')]}}; \ No newline at end of file +var _0x9314=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x4f373a,_0xc04bbd){var _0xdbc6ce=function(_0x143956){while(--_0x143956){_0x4f373a['push'](_0x4f373a['shift']());}};_0xdbc6ce(++_0xc04bbd);}(_0x9314,0xb2));var _0x4931=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9314[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x4931('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x4931('0x1')],'allowNull':![],'defaultValue':_0x4931('0x2')},'clid':{'type':Sequelize[_0x4931('0x3')]},'src':{'type':Sequelize[_0x4931('0x3')]},'dst':{'type':Sequelize[_0x4931('0x3')]},'dcontext':{'type':Sequelize[_0x4931('0x3')]},'channel':{'type':Sequelize[_0x4931('0x3')]},'dstchannel':{'type':Sequelize[_0x4931('0x3')]},'lastapp':{'type':Sequelize[_0x4931('0x3')]},'lastdata':{'type':Sequelize[_0x4931('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4931('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4931('0x3')]},'amaflags':{'type':Sequelize[_0x4931('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4931('0x3')]},'userfield':{'type':Sequelize[_0x4931('0x3')]},'uniqueid':{'type':Sequelize[_0x4931('0x3')]},'linkedid':{'type':Sequelize[_0x4931('0x3')]},'sequence':{'type':Sequelize[_0x4931('0x3')]},'peeraccount':{'type':Sequelize[_0x4931('0x3')]},'type':{'type':Sequelize[_0x4931('0x3')]},'tag':{'type':Sequelize[_0x4931('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index bb8eb13..8b092fc 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 _0x31af=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs'];(function(_0x1054fb,_0x2ea752){var _0x36507b=function(_0x145718){while(--_0x145718){_0x1054fb['push'](_0x1054fb['shift']());}};_0x36507b(++_0x2ea752);}(_0x31af,0xde));var _0xf31a=function(_0x504f7b,_0x1ac4e0){_0x504f7b=_0x504f7b-0x0;var _0x2b0904=_0x31af[_0x504f7b];return _0x2b0904;};'use strict';var emlformat=require(_0xf31a('0x0'));var rimraf=require(_0xf31a('0x1'));var zipdir=require(_0xf31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf31a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf31a('0x4'));var util=require(_0xf31a('0x5'));var path=require(_0xf31a('0x6'));var sox=require(_0xf31a('0x7'));var csv=require('to-csv');var ejs=require(_0xf31a('0x8'));var fs=require('fs');var fs_extra=require(_0xf31a('0x9'));var _=require(_0xf31a('0xa'));var squel=require(_0xf31a('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31a('0xc'));var deskjs=require(_0xf31a('0xd'));var toCsv=require(_0xf31a('0xe'));var querystring=require(_0xf31a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf31a('0x10'));var authService=require(_0xf31a('0x11'));var qs=require(_0xf31a('0x12'));var as=require(_0xf31a('0x13'));var hardwareService=require(_0xf31a('0x14'));var logger=require('../../config/logger')(_0xf31a('0x15'));var utils=require(_0xf31a('0x16'));var config=require(_0xf31a('0x17'));var licenseUtil=require(_0xf31a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b662,_0x26b85e){_0x26b85e=_0x26b85e||0xcc;return function(_0x57ed2f){if(_0x57ed2f){return _0x4b662[_0xf31a('0x19')](_0x26b85e);}return _0x4b662[_0xf31a('0x1a')](_0x26b85e)[_0xf31a('0x1b')]();};}function respondWithResult(_0x18d266,_0x451107){_0x451107=_0x451107||0xc8;return function(_0x203031){if(_0x203031){return _0x18d266[_0xf31a('0x1a')](_0x451107)[_0xf31a('0x1c')](_0x203031);}};}function respondWithFilteredResult(_0x3f7c35,_0x22522c){return function(_0x6ea6f1){if(_0x6ea6f1){var _0x1da226=typeof _0x22522c[_0xf31a('0x1d')]===_0xf31a('0x1e')&&typeof _0x22522c[_0xf31a('0x1f')]==='undefined';var _0x454836=_0x6ea6f1[_0xf31a('0x20')];var _0x251ca7=_0x1da226?0x0:_0x22522c[_0xf31a('0x1d')];var _0x4c3589=_0x1da226?_0x6ea6f1[_0xf31a('0x20')]:_0x22522c[_0xf31a('0x1d')]+_0x22522c[_0xf31a('0x1f')];var _0x208da3;if(_0x4c3589>=_0x454836){_0x4c3589=_0x454836;_0x208da3=0xc8;}else{_0x208da3=0xce;}_0x3f7c35[_0xf31a('0x1a')](_0x208da3);return _0x3f7c35['set'](_0xf31a('0x21'),_0x251ca7+'-'+_0x4c3589+'/'+_0x454836)[_0xf31a('0x1c')](_0x6ea6f1);}return null;};}function patchUpdates(_0x5861df){return function(_0x22c9c3){try{jsonpatch[_0xf31a('0x22')](_0x22c9c3,_0x5861df,!![]);}catch(_0x55da11){return BPromise[_0xf31a('0x23')](_0x55da11);}return _0x22c9c3[_0xf31a('0x24')]();};}function saveUpdates(_0x54f9b5,_0x5724b3){return function(_0x534317){if(_0x534317){return _0x534317[_0xf31a('0x25')](_0x54f9b5)[_0xf31a('0x26')](function(_0x5c23db){return _0x5c23db;});}return null;};}function removeEntity(_0x41d359,_0x2a8a22){return function(_0x5d08ee){if(_0x5d08ee){return _0x5d08ee[_0xf31a('0x27')]()['then'](function(){_0x41d359['status'](0xcc)[_0xf31a('0x1b')]();});}};}function handleEntityNotFound(_0x714292,_0x54ad77){return function(_0x4e115c){if(!_0x4e115c){_0x714292['sendStatus'](0x194);}return _0x4e115c;};}function handleError(_0x531179,_0x14c82e){_0x14c82e=_0x14c82e||0x1f4;return function(_0x45df36){logger[_0xf31a('0x28')](_0x45df36['stack']);if(_0x45df36[_0xf31a('0x29')]){delete _0x45df36[_0xf31a('0x29')];}_0x531179[_0xf31a('0x1a')](_0x14c82e)[_0xf31a('0x2a')](_0x45df36);};}exports[_0xf31a('0x2b')]=function(_0x5a55c6,_0xed9bfd){var _0x2ebc27={},_0x52f8aa={},_0x52da7d={'count':0x0,'rows':[]};var _0x203f28=_[_0xf31a('0x2c')](db['Cdr'][_0xf31a('0x2d')],function(_0x221048){return{'name':_0x221048[_0xf31a('0x2e')],'type':_0x221048['type'][_0xf31a('0x2f')]};});_0x52f8aa[_0xf31a('0x30')]=_[_0xf31a('0x2c')](_0x203f28,_0xf31a('0x29'));_0x52f8aa[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x5a55c6['query']);_0x52f8aa[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],_0x52f8aa[_0xf31a('0x31')]);_0x2ebc27[_0xf31a('0x35')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x36')]));_0x2ebc27[_0xf31a('0x35')]=_0x2ebc27[_0xf31a('0x35')][_0xf31a('0x37')]?_0x2ebc27[_0xf31a('0x35')]:_0x52f8aa[_0xf31a('0x30')];if(!_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x38')](_0xf31a('0x39'))){_0x2ebc27[_0xf31a('0x1f')]=qs['limit'](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x1f')]);_0x2ebc27[_0xf31a('0x1d')]=qs[_0xf31a('0x1d')](_0x5a55c6[_0xf31a('0x31')]['offset']);}_0x2ebc27[_0xf31a('0x3a')]=qs[_0xf31a('0x3b')](_0x5a55c6[_0xf31a('0x31')]['sort']);_0x2ebc27[_0xf31a('0x3c')]=qs[_0xf31a('0x33')](_[_0xf31a('0x3d')](_0x5a55c6[_0xf31a('0x31')],_0x52f8aa[_0xf31a('0x33')]),_0x203f28);if(_0x5a55c6['query'][_0xf31a('0x3e')]){_0x2ebc27['where']=_[_0xf31a('0x3f')](_0x2ebc27[_0xf31a('0x3c')],{'$or':_['map'](_0x203f28,function(_0x35d5b6){if(_0x35d5b6[_0xf31a('0x40')]!==_0xf31a('0x41')){var _0x481d92={};_0x481d92[_0x35d5b6[_0xf31a('0x29')]]={'$like':'%'+_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x3e')]+'%'};return _0x481d92;}})});}_0x2ebc27=_[_0xf31a('0x3f')]({},_0x2ebc27,_0x5a55c6[_0xf31a('0x42')]);var _0x2a240d={'where':_0x2ebc27[_0xf31a('0x3c')]};return db[_0xf31a('0x43')][_0xf31a('0x20')](_0x2a240d)['then'](function(_0x3b4aef){_0x52da7d[_0xf31a('0x20')]=_0x3b4aef;if(_0x5a55c6['query'][_0xf31a('0x44')]){_0x2ebc27[_0xf31a('0x45')]=[{'all':!![]}];}return db[_0xf31a('0x43')][_0xf31a('0x46')](_0x2ebc27);})['then'](function(_0x21b871){_0x52da7d[_0xf31a('0x47')]=_0x21b871;return _0x52da7d;})[_0xf31a('0x26')](respondWithFilteredResult(_0xed9bfd,_0x2ebc27))[_0xf31a('0x48')](handleError(_0xed9bfd,null));};exports['show']=function(_0x234e1a,_0x58163c){var _0x303066={'raw':!![],'where':{'id':_0x234e1a[_0xf31a('0x49')]['id']}},_0x172e1c={};_0x172e1c['model']=_[_0xf31a('0x32')](db['Cdr'][_0xf31a('0x2d')]);_0x172e1c[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x234e1a[_0xf31a('0x31')]);_0x172e1c[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x172e1c[_0xf31a('0x30')],_0x172e1c[_0xf31a('0x31')]);_0x303066[_0xf31a('0x35')]=_['intersection'](_0x172e1c[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x234e1a[_0xf31a('0x31')][_0xf31a('0x36')]));_0x303066[_0xf31a('0x35')]=_0x303066[_0xf31a('0x35')][_0xf31a('0x37')]?_0x303066['attributes']:_0x172e1c['model'];if(_0x234e1a[_0xf31a('0x31')][_0xf31a('0x44')]){_0x303066[_0xf31a('0x45')]=[{'all':!![]}];}_0x303066=_[_0xf31a('0x3f')]({},_0x303066,_0x234e1a[_0xf31a('0x42')]);return db[_0xf31a('0x43')]['find'](_0x303066)[_0xf31a('0x26')](handleEntityNotFound(_0x58163c,null))[_0xf31a('0x26')](respondWithResult(_0x58163c,null))[_0xf31a('0x48')](handleError(_0x58163c,null));};exports[_0xf31a('0x4a')]=function(_0x45b8ed,_0x287bc1){return db['Cdr'][_0xf31a('0x4a')](_0x45b8ed[_0xf31a('0x4b')],{})[_0xf31a('0x26')](respondWithResult(_0x287bc1,0xc9))[_0xf31a('0x48')](handleError(_0x287bc1,null));};exports[_0xf31a('0x25')]=function(_0x111f08,_0x20bd0c){if(_0x111f08[_0xf31a('0x4b')]['id']){delete _0x111f08[_0xf31a('0x4b')]['id'];}return db[_0xf31a('0x43')]['find']({'where':{'id':_0x111f08[_0xf31a('0x49')]['id']}})['then'](handleEntityNotFound(_0x20bd0c,null))[_0xf31a('0x26')](saveUpdates(_0x111f08[_0xf31a('0x4b')],null))[_0xf31a('0x26')](respondWithResult(_0x20bd0c,null))[_0xf31a('0x48')](handleError(_0x20bd0c,null));};exports[_0xf31a('0x27')]=function(_0x3a1a26,_0x25ad3d){return db[_0xf31a('0x43')]['find']({'where':{'id':_0x3a1a26[_0xf31a('0x49')]['id']}})[_0xf31a('0x26')](handleEntityNotFound(_0x25ad3d,null))[_0xf31a('0x26')](removeEntity(_0x25ad3d,null))[_0xf31a('0x48')](handleError(_0x25ad3d,null));};exports[_0xf31a('0x4c')]=function(_0x8c6795,_0x4d21ed){return db[_0xf31a('0x43')][_0xf31a('0x4c')]()[_0xf31a('0x26')](respondWithResult(_0x4d21ed,null))[_0xf31a('0x48')](handleError(_0x4d21ed,null));}; \ No newline at end of file +var _0x8d0a=['type','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8d0a,0x65));var _0xa8d0=function(_0x42be6a,_0xd81fd8){_0x42be6a=_0x42be6a-0x0;var _0x2d8d9d=_0x8d0a[_0x42be6a];return _0x2d8d9d;};'use strict';var emlformat=require(_0xa8d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8d0('0x1'));var jsonpatch=require(_0xa8d0('0x2'));var rp=require(_0xa8d0('0x3'));var moment=require(_0xa8d0('0x4'));var BPromise=require(_0xa8d0('0x5'));var Mustache=require(_0xa8d0('0x6'));var util=require(_0xa8d0('0x7'));var path=require(_0xa8d0('0x8'));var sox=require(_0xa8d0('0x9'));var csv=require('to-csv');var ejs=require(_0xa8d0('0xa'));var fs=require('fs');var fs_extra=require(_0xa8d0('0xb'));var _=require(_0xa8d0('0xc'));var squel=require(_0xa8d0('0xd'));var crypto=require(_0xa8d0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8d0('0xf'));var querystring=require(_0xa8d0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa8d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8d0('0x12'));var logger=require(_0xa8d0('0x13'))(_0xa8d0('0x14'));var utils=require(_0xa8d0('0x15'));var config=require(_0xa8d0('0x16'));var licenseUtil=require(_0xa8d0('0x17'));var db=require(_0xa8d0('0x18'))['db'];function respondWithStatusCode(_0x3bf335,_0x329583){_0x329583=_0x329583||0xcc;return function(_0x1bfcb6){if(_0x1bfcb6){return _0x3bf335[_0xa8d0('0x19')](_0x329583);}return _0x3bf335['status'](_0x329583)[_0xa8d0('0x1a')]();};}function respondWithResult(_0x478f66,_0x5a9193){_0x5a9193=_0x5a9193||0xc8;return function(_0x32ea3e){if(_0x32ea3e){return _0x478f66[_0xa8d0('0x1b')](_0x5a9193)['json'](_0x32ea3e);}};}function respondWithFilteredResult(_0x31da9f,_0x459e9d){return function(_0x2946d5){if(_0x2946d5){var _0x44a48e=typeof _0x459e9d[_0xa8d0('0x1c')]===_0xa8d0('0x1d')&&typeof _0x459e9d['limit']===_0xa8d0('0x1d');var _0x470b4a=_0x2946d5['count'];var _0x2f0b00=_0x44a48e?0x0:_0x459e9d[_0xa8d0('0x1c')];var _0x53d168=_0x44a48e?_0x2946d5[_0xa8d0('0x1e')]:_0x459e9d[_0xa8d0('0x1c')]+_0x459e9d['limit'];var _0x582a54;if(_0x53d168>=_0x470b4a){_0x53d168=_0x470b4a;_0x582a54=0xc8;}else{_0x582a54=0xce;}_0x31da9f[_0xa8d0('0x1b')](_0x582a54);return _0x31da9f[_0xa8d0('0x1f')]('Content-Range',_0x2f0b00+'-'+_0x53d168+'/'+_0x470b4a)[_0xa8d0('0x20')](_0x2946d5);}return null;};}function patchUpdates(_0x356a52){return function(_0x446e6f){try{jsonpatch['apply'](_0x446e6f,_0x356a52,!![]);}catch(_0x36891d){return BPromise['reject'](_0x36891d);}return _0x446e6f[_0xa8d0('0x21')]();};}function saveUpdates(_0x4df8a9,_0x337677){return function(_0x27c798){if(_0x27c798){return _0x27c798[_0xa8d0('0x22')](_0x4df8a9)[_0xa8d0('0x23')](function(_0x41667d){return _0x41667d;});}return null;};}function removeEntity(_0x5754b7,_0x47d0d2){return function(_0x265dce){if(_0x265dce){return _0x265dce['destroy']()[_0xa8d0('0x23')](function(){_0x5754b7[_0xa8d0('0x1b')](0xcc)[_0xa8d0('0x1a')]();});}};}function handleEntityNotFound(_0x1ddb63,_0x17bdfc){return function(_0x5b9560){if(!_0x5b9560){_0x1ddb63[_0xa8d0('0x19')](0x194);}return _0x5b9560;};}function handleError(_0x1a396a,_0x26c3cc){_0x26c3cc=_0x26c3cc||0x1f4;return function(_0x2f692d){logger[_0xa8d0('0x24')](_0x2f692d[_0xa8d0('0x25')]);if(_0x2f692d[_0xa8d0('0x26')]){delete _0x2f692d[_0xa8d0('0x26')];}_0x1a396a['status'](_0x26c3cc)[_0xa8d0('0x27')](_0x2f692d);};}exports[_0xa8d0('0x28')]=function(_0xd7943a,_0x13ea0d){var _0x243cc3={},_0x111a4c={},_0x573641={'count':0x0,'rows':[]};var _0x3b0609=_[_0xa8d0('0x29')](db[_0xa8d0('0x2a')][_0xa8d0('0x2b')],function(_0x4c46fc){return{'name':_0x4c46fc[_0xa8d0('0x2c')],'type':_0x4c46fc[_0xa8d0('0x2d')]['key']};});_0x111a4c['model']=_[_0xa8d0('0x29')](_0x3b0609,_0xa8d0('0x26'));_0x111a4c[_0xa8d0('0x2e')]=_[_0xa8d0('0x2f')](_0xd7943a[_0xa8d0('0x2e')]);_0x111a4c[_0xa8d0('0x30')]=_[_0xa8d0('0x31')](_0x111a4c[_0xa8d0('0x32')],_0x111a4c[_0xa8d0('0x2e')]);_0x243cc3[_0xa8d0('0x33')]=_[_0xa8d0('0x31')](_0x111a4c[_0xa8d0('0x32')],qs['fields'](_0xd7943a['query'][_0xa8d0('0x34')]));_0x243cc3['attributes']=_0x243cc3[_0xa8d0('0x33')][_0xa8d0('0x35')]?_0x243cc3[_0xa8d0('0x33')]:_0x111a4c[_0xa8d0('0x32')];if(!_0xd7943a[_0xa8d0('0x2e')]['hasOwnProperty']('nolimit')){_0x243cc3[_0xa8d0('0x36')]=qs[_0xa8d0('0x36')](_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x36')]);_0x243cc3[_0xa8d0('0x1c')]=qs[_0xa8d0('0x1c')](_0xd7943a['query'][_0xa8d0('0x1c')]);}_0x243cc3[_0xa8d0('0x37')]=qs[_0xa8d0('0x38')](_0xd7943a['query'][_0xa8d0('0x38')]);_0x243cc3[_0xa8d0('0x39')]=qs[_0xa8d0('0x30')](_[_0xa8d0('0x3a')](_0xd7943a[_0xa8d0('0x2e')],_0x111a4c[_0xa8d0('0x30')]),_0x3b0609);if(_0xd7943a[_0xa8d0('0x2e')]['filter']){_0x243cc3[_0xa8d0('0x39')]=_[_0xa8d0('0x3b')](_0x243cc3[_0xa8d0('0x39')],{'$or':_[_0xa8d0('0x29')](_0x3b0609,function(_0x2a37d3){if(_0x2a37d3[_0xa8d0('0x2d')]!=='VIRTUAL'){var _0xad4f40={};_0xad4f40[_0x2a37d3[_0xa8d0('0x26')]]={'$like':'%'+_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x3c')]+'%'};return _0xad4f40;}})});}_0x243cc3=_[_0xa8d0('0x3b')]({},_0x243cc3,_0xd7943a[_0xa8d0('0x3d')]);var _0x1c1e05={'where':_0x243cc3[_0xa8d0('0x39')]};return db['Cdr'][_0xa8d0('0x1e')](_0x1c1e05)['then'](function(_0x3cfcc7){_0x573641[_0xa8d0('0x1e')]=_0x3cfcc7;if(_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x3e')]){_0x243cc3[_0xa8d0('0x3f')]=[{'all':!![]}];}return db[_0xa8d0('0x2a')][_0xa8d0('0x40')](_0x243cc3);})[_0xa8d0('0x23')](function(_0x2f563a){_0x573641[_0xa8d0('0x41')]=_0x2f563a;return _0x573641;})[_0xa8d0('0x23')](respondWithFilteredResult(_0x13ea0d,_0x243cc3))[_0xa8d0('0x42')](handleError(_0x13ea0d,null));};exports['show']=function(_0x185626,_0x168479){var _0x39798a={'raw':!![],'where':{'id':_0x185626[_0xa8d0('0x43')]['id']}},_0x271203={};_0x271203[_0xa8d0('0x32')]=_['keys'](db[_0xa8d0('0x2a')][_0xa8d0('0x2b')]);_0x271203[_0xa8d0('0x2e')]=_[_0xa8d0('0x2f')](_0x185626[_0xa8d0('0x2e')]);_0x271203[_0xa8d0('0x30')]=_[_0xa8d0('0x31')](_0x271203[_0xa8d0('0x32')],_0x271203['query']);_0x39798a[_0xa8d0('0x33')]=_['intersection'](_0x271203[_0xa8d0('0x32')],qs[_0xa8d0('0x34')](_0x185626[_0xa8d0('0x2e')][_0xa8d0('0x34')]));_0x39798a['attributes']=_0x39798a[_0xa8d0('0x33')][_0xa8d0('0x35')]?_0x39798a['attributes']:_0x271203[_0xa8d0('0x32')];if(_0x185626[_0xa8d0('0x2e')][_0xa8d0('0x3e')]){_0x39798a['include']=[{'all':!![]}];}_0x39798a=_['merge']({},_0x39798a,_0x185626[_0xa8d0('0x3d')]);return db[_0xa8d0('0x2a')][_0xa8d0('0x44')](_0x39798a)[_0xa8d0('0x23')](handleEntityNotFound(_0x168479,null))['then'](respondWithResult(_0x168479,null))[_0xa8d0('0x42')](handleError(_0x168479,null));};exports[_0xa8d0('0x45')]=function(_0x289bff,_0x352adc){return db[_0xa8d0('0x2a')]['create'](_0x289bff[_0xa8d0('0x46')],{})['then'](respondWithResult(_0x352adc,0xc9))[_0xa8d0('0x42')](handleError(_0x352adc,null));};exports[_0xa8d0('0x22')]=function(_0x3dd3ae,_0x5a2aef){if(_0x3dd3ae[_0xa8d0('0x46')]['id']){delete _0x3dd3ae[_0xa8d0('0x46')]['id'];}return db[_0xa8d0('0x2a')][_0xa8d0('0x44')]({'where':{'id':_0x3dd3ae[_0xa8d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a2aef,null))[_0xa8d0('0x23')](saveUpdates(_0x3dd3ae[_0xa8d0('0x46')],null))['then'](respondWithResult(_0x5a2aef,null))[_0xa8d0('0x42')](handleError(_0x5a2aef,null));};exports[_0xa8d0('0x47')]=function(_0x20b617,_0x1abc35){return db[_0xa8d0('0x2a')][_0xa8d0('0x44')]({'where':{'id':_0x20b617[_0xa8d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x1abc35,null))[_0xa8d0('0x23')](removeEntity(_0x1abc35,null))['catch'](handleError(_0x1abc35,null));};exports['describe']=function(_0x1cb44a,_0x19fd43){return db['Cdr'][_0xa8d0('0x48')]()[_0xa8d0('0x23')](respondWithResult(_0x19fd43,null))[_0xa8d0('0x42')](handleError(_0x19fd43,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c1d9165..4536b71 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(_0x2d67a0,_0x506875){var _0x2547cf=function(_0x51032a){while(--_0x51032a){_0x2d67a0['push'](_0x2d67a0['shift']());}};_0x2547cf(++_0x506875);}(_0x7a54,0x106));var _0x47a5=function(_0x427db1,_0x4d5b2e){_0x427db1=_0x427db1-0x0;var _0xd989ed=_0x7a54[_0x427db1];return _0xd989ed;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4cbaec,_0x44ef3a){var _0x48243a=function(_0x47b3f9){while(--_0x47b3f9){_0x4cbaec['push'](_0x4cbaec['shift']());}};_0x48243a(++_0x44ef3a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 9192d05..4ff8d79 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 _0xcfee=['../../config/environment','jayson/promise','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x271a53,_0x3d0d32){var _0x4e7481=function(_0xf211cc){while(--_0xf211cc){_0x271a53['push'](_0x271a53['shift']());}};_0x4e7481(++_0x3d0d32);}(_0xcfee,0xe2));var _0xecfe=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xcfee[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xecfe('0x0'));var util=require(_0xecfe('0x1'));var moment=require(_0xecfe('0x2'));var BPromise=require(_0xecfe('0x3'));var rs=require(_0xecfe('0x4'));var fs=require('fs');var Redis=require(_0xecfe('0x5'));var db=require(_0xecfe('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecfe('0x7'));var config=require(_0xecfe('0x8'));var jayson=require(_0xecfe('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a53f0,_0x2bf709,_0x1c8b56){return new BPromise(function(_0x2bb29e,_0x1ec7b4){return client['request'](_0x4a53f0,_0x1c8b56)['then'](function(_0xc18e0c){logger[_0xecfe('0xa')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xecfe('0xb'));logger['debug'](_0xecfe('0xc'),_0x2bf709,'request\x20sent',JSON['stringify'](_0xc18e0c));if(_0xc18e0c['error']){if(_0xc18e0c['error'][_0xecfe('0xd')]===0x1f4){logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xc18e0c[_0xecfe('0xe')][_0xecfe('0xf')]);return _0x1ec7b4(_0xc18e0c[_0xecfe('0xe')][_0xecfe('0xf')]);}logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xc18e0c[_0xecfe('0xe')]['message']);return _0x2bb29e(_0xc18e0c['error'][_0xecfe('0xf')]);}else{logger['info'](_0xecfe('0x10'),_0x2bf709,_0xecfe('0xb'));_0x2bb29e(_0xc18e0c['result']['message']);}})[_0xecfe('0x11')](function(_0x25deee){logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0x25deee);_0x1ec7b4(_0x25deee);});});} \ No newline at end of file +var _0xa968=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','moment','randomstring'];(function(_0x42e226,_0x518b5d){var _0x2d9385=function(_0x4e341e){while(--_0x4e341e){_0x42e226['push'](_0x42e226['shift']());}};_0x2d9385(++_0x518b5d);}(_0xa968,0x19f));var _0x8a96=function(_0x13f752,_0x1b3821){_0x13f752=_0x13f752-0x0;var _0x58c643=_0xa968[_0x13f752];return _0x58c643;};'use strict';var _=require(_0x8a96('0x0'));var util=require('util');var moment=require(_0x8a96('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a96('0x2'));var fs=require('fs');var Redis=require(_0x8a96('0x3'));var db=require(_0x8a96('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a96('0x5'))(_0x8a96('0x6'));var config=require(_0x8a96('0x7'));var jayson=require(_0x8a96('0x8'));var client=jayson['client'][_0x8a96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb78422,_0x3db426,_0x33d575){return new BPromise(function(_0x3bfb7b,_0x21f363){return client[_0x8a96('0xa')](_0xb78422,_0x33d575)[_0x8a96('0xb')](function(_0x14abf7){logger[_0x8a96('0xc')]('Cdr,\x20%s,\x20%s',_0x3db426,_0x8a96('0xd'));logger[_0x8a96('0xe')](_0x8a96('0xf'),_0x3db426,_0x8a96('0xd'),JSON[_0x8a96('0x10')](_0x14abf7));if(_0x14abf7[_0x8a96('0x11')]){if(_0x14abf7[_0x8a96('0x11')][_0x8a96('0x12')]===0x1f4){logger[_0x8a96('0x11')](_0x8a96('0x13'),_0x3db426,_0x14abf7[_0x8a96('0x11')]['message']);return _0x21f363(_0x14abf7[_0x8a96('0x11')][_0x8a96('0x14')]);}logger['error'](_0x8a96('0x13'),_0x3db426,_0x14abf7[_0x8a96('0x11')][_0x8a96('0x14')]);return _0x3bfb7b(_0x14abf7['error'][_0x8a96('0x14')]);}else{logger[_0x8a96('0xc')](_0x8a96('0x13'),_0x3db426,_0x8a96('0xd'));_0x3bfb7b(_0x14abf7['result']['message']);}})[_0x8a96('0x15')](function(_0xed741c){logger[_0x8a96('0x11')]('Cdr,\x20%s,\x20%s',_0x3db426,_0xed741c);_0x21f363(_0xed741c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 59e9d6c..612e66e 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x139d3a,_0x23931e){var _0x345d6b=function(_0x3b1433){while(--_0x3b1433){_0x139d3a['push'](_0x139d3a['shift']());}};_0x345d6b(++_0x23931e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x2a58eb,_0x4cf845){var _0x5d4902=function(_0x5ecb6b){while(--_0x5ecb6b){_0x2a58eb['push'](_0x2a58eb['shift']());}};_0x5d4902(++_0x4cf845);}(_0xb10b,0x12a));var _0xbb10=function(_0x566c40,_0x3c2178){_0x566c40=_0x566c40-0x0;var _0x5152ec=_0xb10b[_0x566c40];return _0x5152ec;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c495b0d..f5f31fd 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 _0x90d0=['STRING','noop'];(function(_0x52839f,_0x4ce68b){var _0x250558=function(_0x5f5625){while(--_0x5f5625){_0x52839f['push'](_0x52839f['shift']());}};_0x250558(++_0x4ce68b);}(_0x90d0,0x64));var _0x090d=function(_0x1a2455,_0xdaa32e){_0x1a2455=_0x1a2455-0x0;var _0xd2286c=_0x90d0[_0x1a2455];return _0xd2286c;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x090d('0x0')],'allowNull':![],'defaultValue':_0x090d('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x090d('0x0')]},'interval':{'type':Sequelize[_0x090d('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xe146=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x12f774,_0x54fa1e){var _0xbb7539=function(_0x469d82){while(--_0x469d82){_0x12f774['push'](_0x12f774['shift']());}};_0xbb7539(++_0x54fa1e);}(_0xe146,0xe4));var _0x6e14=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0xe146[_0x55fa03];return _0x2cd7cd;};'use strict';var Sequelize=require(_0x6e14('0x0'));module[_0x6e14('0x1')]={'priority':{'type':Sequelize[_0x6e14('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6e14('0x3')},'appdata':{'type':Sequelize[_0x6e14('0x4')]()},'description':{'type':Sequelize[_0x6e14('0x5')]},'interval':{'type':Sequelize[_0x6e14('0x5')],'defaultValue':_0x6e14('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index a5d52f4..9e03fca 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 _0x280f=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','model','ChatApplication','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x138c15,_0x357fff){var _0x50a854=function(_0x38f423){while(--_0x38f423){_0x138c15['push'](_0x138c15['shift']());}};_0x50a854(++_0x357fff);}(_0x280f,0xe2));var _0xf280=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0x280f[_0x184759];return _0xf26d5f;};'use strict';var emlformat=require(_0xf280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf280('0x1'));var jsonpatch=require(_0xf280('0x2'));var rp=require(_0xf280('0x3'));var moment=require(_0xf280('0x4'));var BPromise=require(_0xf280('0x5'));var Mustache=require(_0xf280('0x6'));var util=require(_0xf280('0x7'));var path=require('path');var sox=require(_0xf280('0x8'));var csv=require(_0xf280('0x9'));var ejs=require(_0xf280('0xa'));var fs=require('fs');var fs_extra=require(_0xf280('0xb'));var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0x9'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var as=require(_0xf280('0x14'));var hardwareService=require(_0xf280('0x15'));var logger=require(_0xf280('0x16'))(_0xf280('0x17'));var utils=require(_0xf280('0x18'));var config=require(_0xf280('0x19'));var licenseUtil=require(_0xf280('0x1a'));var db=require(_0xf280('0x1b'))['db'];function respondWithStatusCode(_0x148d24,_0x56221f){_0x56221f=_0x56221f||0xcc;return function(_0x566eb7){if(_0x566eb7){return _0x148d24[_0xf280('0x1c')](_0x56221f);}return _0x148d24[_0xf280('0x1d')](_0x56221f)[_0xf280('0x1e')]();};}function respondWithResult(_0x1d7175,_0x3e9acc){_0x3e9acc=_0x3e9acc||0xc8;return function(_0x59fb22){if(_0x59fb22){return _0x1d7175[_0xf280('0x1d')](_0x3e9acc)[_0xf280('0x1f')](_0x59fb22);}};}function respondWithFilteredResult(_0x34cadb,_0x224162){return function(_0x1e8f4d){if(_0x1e8f4d){var _0x462177=typeof _0x224162[_0xf280('0x20')]==='undefined'&&typeof _0x224162['limit']==='undefined';var _0x30a9a6=_0x1e8f4d['count'];var _0x11c2b0=_0x462177?0x0:_0x224162['offset'];var _0x2a19e7=_0x462177?_0x1e8f4d[_0xf280('0x21')]:_0x224162['offset']+_0x224162[_0xf280('0x22')];var _0x59b8af;if(_0x2a19e7>=_0x30a9a6){_0x2a19e7=_0x30a9a6;_0x59b8af=0xc8;}else{_0x59b8af=0xce;}_0x34cadb[_0xf280('0x1d')](_0x59b8af);return _0x34cadb[_0xf280('0x23')](_0xf280('0x24'),_0x11c2b0+'-'+_0x2a19e7+'/'+_0x30a9a6)[_0xf280('0x1f')](_0x1e8f4d);}return null;};}function patchUpdates(_0x11db7d){return function(_0x3a4eff){try{jsonpatch[_0xf280('0x25')](_0x3a4eff,_0x11db7d,!![]);}catch(_0x469bdf){return BPromise[_0xf280('0x26')](_0x469bdf);}return _0x3a4eff['save']();};}function saveUpdates(_0x1ad62a,_0x5a1aa1){return function(_0xfb624e){if(_0xfb624e){return _0xfb624e[_0xf280('0x27')](_0x1ad62a)[_0xf280('0x28')](function(_0x32039f){return _0x32039f;});}return null;};}function removeEntity(_0x3de08f,_0x42020c){return function(_0x4c3618){if(_0x4c3618){return _0x4c3618[_0xf280('0x29')]()[_0xf280('0x28')](function(){_0x3de08f[_0xf280('0x1d')](0xcc)[_0xf280('0x1e')]();});}};}function handleEntityNotFound(_0x35cd2d,_0x302132){return function(_0x4509c1){if(!_0x4509c1){_0x35cd2d[_0xf280('0x1c')](0x194);}return _0x4509c1;};}function handleError(_0x485788,_0x368b24){_0x368b24=_0x368b24||0x1f4;return function(_0x1b21fb){logger[_0xf280('0x2a')](_0x1b21fb[_0xf280('0x2b')]);if(_0x1b21fb['name']){delete _0x1b21fb['name'];}_0x485788['status'](_0x368b24)['send'](_0x1b21fb);};}exports['show']=function(_0x3da40e,_0x2409f4){var _0xa1fbb7={'raw':!![],'where':{'id':_0x3da40e['params']['id']}},_0x34edaf={};_0x34edaf[_0xf280('0x2c')]=_['keys'](db[_0xf280('0x2d')][_0xf280('0x2e')]);_0x34edaf['query']=_[_0xf280('0x2f')](_0x3da40e[_0xf280('0x30')]);_0x34edaf[_0xf280('0x31')]=_[_0xf280('0x32')](_0x34edaf['model'],_0x34edaf[_0xf280('0x30')]);_0xa1fbb7[_0xf280('0x33')]=_[_0xf280('0x32')](_0x34edaf[_0xf280('0x2c')],qs[_0xf280('0x34')](_0x3da40e[_0xf280('0x30')][_0xf280('0x34')]));_0xa1fbb7[_0xf280('0x33')]=_0xa1fbb7['attributes'][_0xf280('0x35')]?_0xa1fbb7[_0xf280('0x33')]:_0x34edaf[_0xf280('0x2c')];if(_0x3da40e[_0xf280('0x30')]['includeAll']){_0xa1fbb7['include']=[{'all':!![]}];}_0xa1fbb7=_[_0xf280('0x36')]({},_0xa1fbb7,_0x3da40e['options']);return db[_0xf280('0x2d')][_0xf280('0x37')](_0xa1fbb7)[_0xf280('0x28')](handleEntityNotFound(_0x2409f4,null))[_0xf280('0x28')](respondWithResult(_0x2409f4,null))[_0xf280('0x38')](handleError(_0x2409f4,null));};exports['update']=function(_0x56bb42,_0x5c34a3){if(_0x56bb42[_0xf280('0x39')]['id']){delete _0x56bb42['body']['id'];}return db[_0xf280('0x2d')][_0xf280('0x37')]({'where':{'id':_0x56bb42['params']['id']}})[_0xf280('0x28')](handleEntityNotFound(_0x5c34a3,null))[_0xf280('0x28')](saveUpdates(_0x56bb42[_0xf280('0x39')],null))[_0xf280('0x28')](respondWithResult(_0x5c34a3,null))[_0xf280('0x38')](handleError(_0x5c34a3,null));};exports[_0xf280('0x29')]=function(_0x286b48,_0x22b20a){return db[_0xf280('0x2d')][_0xf280('0x37')]({'where':{'id':_0x286b48['params']['id']}})[_0xf280('0x28')](handleEntityNotFound(_0x22b20a,null))[_0xf280('0x28')](removeEntity(_0x22b20a,null))[_0xf280('0x38')](handleError(_0x22b20a,null));}; \ No newline at end of file +var _0xefe2=['count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xefe2,0xd9));var _0x2efe=function(_0x32d19b,_0xa3dcd){_0x32d19b=_0x32d19b-0x0;var _0x2b3139=_0xefe2[_0x32d19b];return _0x2b3139;};'use strict';var emlformat=require(_0x2efe('0x0'));var rimraf=require(_0x2efe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2efe('0x2'));var rp=require(_0x2efe('0x3'));var moment=require('moment');var BPromise=require(_0x2efe('0x4'));var Mustache=require('mustache');var util=require(_0x2efe('0x5'));var path=require(_0x2efe('0x6'));var sox=require(_0x2efe('0x7'));var csv=require(_0x2efe('0x8'));var ejs=require(_0x2efe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2efe('0xa'));var squel=require(_0x2efe('0xb'));var crypto=require(_0x2efe('0xc'));var jsforce=require(_0x2efe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2efe('0x8'));var querystring=require(_0x2efe('0xe'));var Papa=require(_0x2efe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2efe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2efe('0x11'))(_0x2efe('0x12'));var utils=require(_0x2efe('0x13'));var config=require(_0x2efe('0x14'));var licenseUtil=require(_0x2efe('0x15'));var db=require(_0x2efe('0x16'))['db'];function respondWithStatusCode(_0x39a93b,_0x250023){_0x250023=_0x250023||0xcc;return function(_0x41039a){if(_0x41039a){return _0x39a93b[_0x2efe('0x17')](_0x250023);}return _0x39a93b['status'](_0x250023)['end']();};}function respondWithResult(_0x28681f,_0x1d9e5c){_0x1d9e5c=_0x1d9e5c||0xc8;return function(_0x562753){if(_0x562753){return _0x28681f['status'](_0x1d9e5c)[_0x2efe('0x18')](_0x562753);}};}function respondWithFilteredResult(_0x5195c8,_0x235af3){return function(_0x3b8b31){if(_0x3b8b31){var _0x51cbf3=typeof _0x235af3[_0x2efe('0x19')]===_0x2efe('0x1a')&&typeof _0x235af3['limit']===_0x2efe('0x1a');var _0x499c70=_0x3b8b31['count'];var _0xefd47=_0x51cbf3?0x0:_0x235af3[_0x2efe('0x19')];var _0x16acde=_0x51cbf3?_0x3b8b31[_0x2efe('0x1b')]:_0x235af3[_0x2efe('0x19')]+_0x235af3[_0x2efe('0x1c')];var _0x3017a7;if(_0x16acde>=_0x499c70){_0x16acde=_0x499c70;_0x3017a7=0xc8;}else{_0x3017a7=0xce;}_0x5195c8[_0x2efe('0x1d')](_0x3017a7);return _0x5195c8[_0x2efe('0x1e')](_0x2efe('0x1f'),_0xefd47+'-'+_0x16acde+'/'+_0x499c70)[_0x2efe('0x18')](_0x3b8b31);}return null;};}function patchUpdates(_0x6962df){return function(_0x491958){try{jsonpatch[_0x2efe('0x20')](_0x491958,_0x6962df,!![]);}catch(_0x538f39){return BPromise[_0x2efe('0x21')](_0x538f39);}return _0x491958[_0x2efe('0x22')]();};}function saveUpdates(_0x30ed16,_0x4ebeb6){return function(_0x131169){if(_0x131169){return _0x131169[_0x2efe('0x23')](_0x30ed16)['then'](function(_0x1c4a8d){return _0x1c4a8d;});}return null;};}function removeEntity(_0x368d08,_0xc24859){return function(_0x319b7f){if(_0x319b7f){return _0x319b7f[_0x2efe('0x24')]()[_0x2efe('0x25')](function(){_0x368d08[_0x2efe('0x1d')](0xcc)[_0x2efe('0x26')]();});}};}function handleEntityNotFound(_0x3d4449,_0x301cf2){return function(_0x1beaad){if(!_0x1beaad){_0x3d4449[_0x2efe('0x17')](0x194);}return _0x1beaad;};}function handleError(_0x3059c7,_0x255330){_0x255330=_0x255330||0x1f4;return function(_0x4c5118){logger[_0x2efe('0x27')](_0x4c5118[_0x2efe('0x28')]);if(_0x4c5118[_0x2efe('0x29')]){delete _0x4c5118[_0x2efe('0x29')];}_0x3059c7[_0x2efe('0x1d')](_0x255330)[_0x2efe('0x2a')](_0x4c5118);};}exports[_0x2efe('0x2b')]=function(_0xa11a23,_0x4039cb){var _0x33124f={'raw':!![],'where':{'id':_0xa11a23[_0x2efe('0x2c')]['id']}},_0x56b011={};_0x56b011[_0x2efe('0x2d')]=_[_0x2efe('0x2e')](db[_0x2efe('0x2f')][_0x2efe('0x30')]);_0x56b011['query']=_[_0x2efe('0x2e')](_0xa11a23[_0x2efe('0x31')]);_0x56b011[_0x2efe('0x32')]=_[_0x2efe('0x33')](_0x56b011[_0x2efe('0x2d')],_0x56b011[_0x2efe('0x31')]);_0x33124f[_0x2efe('0x34')]=_[_0x2efe('0x33')](_0x56b011[_0x2efe('0x2d')],qs[_0x2efe('0x35')](_0xa11a23['query'][_0x2efe('0x35')]));_0x33124f[_0x2efe('0x34')]=_0x33124f[_0x2efe('0x34')][_0x2efe('0x36')]?_0x33124f[_0x2efe('0x34')]:_0x56b011[_0x2efe('0x2d')];if(_0xa11a23[_0x2efe('0x31')][_0x2efe('0x37')]){_0x33124f[_0x2efe('0x38')]=[{'all':!![]}];}_0x33124f=_['merge']({},_0x33124f,_0xa11a23[_0x2efe('0x39')]);return db[_0x2efe('0x2f')]['find'](_0x33124f)['then'](handleEntityNotFound(_0x4039cb,null))['then'](respondWithResult(_0x4039cb,null))[_0x2efe('0x3a')](handleError(_0x4039cb,null));};exports[_0x2efe('0x23')]=function(_0x38e44f,_0x5a8ba4){if(_0x38e44f[_0x2efe('0x3b')]['id']){delete _0x38e44f[_0x2efe('0x3b')]['id'];}return db[_0x2efe('0x2f')]['find']({'where':{'id':_0x38e44f['params']['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x5a8ba4,null))['then'](saveUpdates(_0x38e44f[_0x2efe('0x3b')],null))[_0x2efe('0x25')](respondWithResult(_0x5a8ba4,null))[_0x2efe('0x3a')](handleError(_0x5a8ba4,null));};exports['destroy']=function(_0xd3ce22,_0x2ec0cd){return db[_0x2efe('0x2f')][_0x2efe('0x3c')]({'where':{'id':_0xd3ce22[_0x2efe('0x2c')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x2ec0cd,null))[_0x2efe('0x25')](removeEntity(_0x2ec0cd,null))['catch'](handleError(_0x2ec0cd,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 02339ba..89b2631 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 _0x4a06=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x3bd84e,_0x1e4a81){var _0xbf14d1=function(_0x4bdfe4){while(--_0x4bdfe4){_0x3bd84e['push'](_0x3bd84e['shift']());}};_0xbf14d1(++_0x1e4a81);}(_0x4a06,0x1f2));var _0x64a0=function(_0x59b8c9,_0x53714b){_0x59b8c9=_0x59b8c9-0x0;var _0x58f507=_0x4a06[_0x59b8c9];return _0x58f507;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64a0('0xe'),'collate':_0x64a0('0xf')});}; \ No newline at end of file +var _0x1d20=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0x1d20,0x121));var _0x01d2=function(_0x32721a,_0xbe5572){_0x32721a=_0x32721a-0x0;var _0x1c3ade=_0x1d20[_0x32721a];return _0x1c3ade;};'use strict';var _=require(_0x01d2('0x0'));var util=require(_0x01d2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01d2('0x2'));var BPromise=require('bluebird');var rp=require(_0x01d2('0x3'));var fs=require('fs');var path=require(_0x01d2('0x4'));var rimraf=require(_0x01d2('0x5'));var config=require(_0x01d2('0x6'));var attributes=require(_0x01d2('0x7'));module['exports']=function(_0xf73035,_0x5c9464){return _0xf73035[_0x01d2('0x8')](_0x01d2('0x9'),attributes,{'tableName':_0x01d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01d2('0xb'),'collate':_0x01d2('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a14f6db..ba341ff 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 _0x7da0=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x2e22c7,_0x1abc9c){var _0x4cf08b=function(_0x3ba681){while(--_0x3ba681){_0x2e22c7['push'](_0x2e22c7['shift']());}};_0x4cf08b(++_0x1abc9c);}(_0x7da0,0xd3));var _0x07da=function(_0x1537bb,_0x4e525d){_0x1537bb=_0x1537bb-0x0;var _0x14e28e=_0x7da0[_0x1537bb];return _0x14e28e;};'use strict';var _=require('lodash');var util=require(_0x07da('0x0'));var moment=require(_0x07da('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07da('0x2'));var db=require(_0x07da('0x3'))['db'];var utils=require(_0x07da('0x4'));var logger=require('../../config/logger')(_0x07da('0x5'));var config=require(_0x07da('0x6'));var jayson=require(_0x07da('0x7'));var client=jayson[_0x07da('0x8')][_0x07da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x557e26,_0x242904,_0x309d8c){return new BPromise(function(_0x1cef2f,_0x238f40){return client['request'](_0x557e26,_0x309d8c)['then'](function(_0xcaf580){logger[_0x07da('0xa')](_0x07da('0xb'),_0x242904,_0x07da('0xc'));logger[_0x07da('0xd')](_0x07da('0xe'),_0x242904,_0x07da('0xc'),JSON['stringify'](_0xcaf580));if(_0xcaf580[_0x07da('0xf')]){if(_0xcaf580[_0x07da('0xf')]['code']===0x1f4){logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0xcaf580['error']['message']);return _0x238f40(_0xcaf580[_0x07da('0xf')]['message']);}logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0xcaf580[_0x07da('0xf')][_0x07da('0x10')]);return _0x1cef2f(_0xcaf580[_0x07da('0xf')][_0x07da('0x10')]);}else{logger[_0x07da('0xa')](_0x07da('0xb'),_0x242904,_0x07da('0xc'));_0x1cef2f(_0xcaf580[_0x07da('0x11')][_0x07da('0x10')]);}})[_0x07da('0x12')](function(_0x47db72){logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0x47db72);_0x238f40(_0x47db72);});});} \ No newline at end of file +var _0x81a0=['http','request','then','info','request\x20sent','debug','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x33b3ac,_0x58637c){var _0x707c35=function(_0x1e285a){while(--_0x1e285a){_0x33b3ac['push'](_0x33b3ac['shift']());}};_0x707c35(++_0x58637c);}(_0x81a0,0x1ce));var _0x081a=function(_0x4b452c,_0x4e8b35){_0x4b452c=_0x4b452c-0x0;var _0x2df785=_0x81a0[_0x4b452c];return _0x2df785;};'use strict';var _=require('lodash');var util=require(_0x081a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x081a('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x081a('0x2'))('rpc');var config=require(_0x081a('0x3'));var jayson=require(_0x081a('0x4'));var client=jayson[_0x081a('0x5')][_0x081a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x50a122,_0x41a39a,_0x19638b){return new BPromise(function(_0x3fb688,_0x2274d2){return client[_0x081a('0x7')](_0x50a122,_0x19638b)[_0x081a('0x8')](function(_0x4b74c7){logger[_0x081a('0x9')]('ChatApplication,\x20%s,\x20%s',_0x41a39a,_0x081a('0xa'));logger[_0x081a('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x41a39a,_0x081a('0xa'),JSON['stringify'](_0x4b74c7));if(_0x4b74c7[_0x081a('0xc')]){if(_0x4b74c7[_0x081a('0xc')][_0x081a('0xd')]===0x1f4){logger[_0x081a('0xc')](_0x081a('0xe'),_0x41a39a,_0x4b74c7[_0x081a('0xc')][_0x081a('0xf')]);return _0x2274d2(_0x4b74c7[_0x081a('0xc')][_0x081a('0xf')]);}logger['error'](_0x081a('0xe'),_0x41a39a,_0x4b74c7[_0x081a('0xc')]['message']);return _0x3fb688(_0x4b74c7[_0x081a('0xc')]['message']);}else{logger['info'](_0x081a('0xe'),_0x41a39a,_0x081a('0xa'));_0x3fb688(_0x4b74c7[_0x081a('0x10')][_0x081a('0xf')]);}})[_0x081a('0x11')](function(_0x413eba){logger['error'](_0x081a('0xe'),_0x41a39a,_0x413eba);_0x2274d2(_0x413eba);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index d797643..0671990 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 _0x7c4b=['/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x18a282,_0x593f1f){var _0x22a9a4=function(_0x1b55bc){while(--_0x1b55bc){_0x18a282['push'](_0x18a282['shift']());}};_0x22a9a4(++_0x593f1f);}(_0x7c4b,0x149));var _0xb7c4=function(_0x239136,_0x2ac7a1){_0x239136=_0x239136-0x0;var _0x3b7f45=_0x7c4b[_0x239136];return _0x3b7f45;};'use strict';var multer=require(_0xb7c4('0x0'));var util=require('util');var path=require(_0xb7c4('0x1'));var timeout=require(_0xb7c4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb7c4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb7c4('0x4'));var config=require(_0xb7c4('0x5'));var controller=require(_0xb7c4('0x6'));router['get'](_0xb7c4('0x7'),auth[_0xb7c4('0x8')](),controller[_0xb7c4('0x9')]);router[_0xb7c4('0xa')]('/:id',auth[_0xb7c4('0x8')](),controller[_0xb7c4('0xb')]);router[_0xb7c4('0xc')](_0xb7c4('0x7'),auth[_0xb7c4('0x8')](),controller[_0xb7c4('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1db5=['update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put'];(function(_0x2ae15f,_0x3e1860){var _0x42a3d3=function(_0xcd0e60){while(--_0xcd0e60){_0x2ae15f['push'](_0x2ae15f['shift']());}};_0x42a3d3(++_0x3e1860);}(_0x1db5,0x132));var _0x51db=function(_0x59b7a3,_0x17049c){_0x59b7a3=_0x59b7a3-0x0;var _0x5f4055=_0x1db5[_0x59b7a3];return _0x5f4055;};'use strict';var multer=require(_0x51db('0x0'));var util=require(_0x51db('0x1'));var path=require(_0x51db('0x2'));var timeout=require('connect-timeout');var express=require(_0x51db('0x3'));var router=express[_0x51db('0x4')]();var fs_extra=require(_0x51db('0x5'));var auth=require(_0x51db('0x6'));var interaction=require(_0x51db('0x7'));var config=require(_0x51db('0x8'));var controller=require('./chatApplication.controller');router[_0x51db('0x9')](_0x51db('0xa'),auth[_0x51db('0xb')](),controller[_0x51db('0xc')]);router[_0x51db('0xd')](_0x51db('0xa'),auth[_0x51db('0xb')](),controller[_0x51db('0xe')]);router['delete'](_0x51db('0xa'),auth['isAuthenticated'](),controller[_0x51db('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 5ba1f21..6528b37 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 _0x2bb6=['STRING','BOOLEAN'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0x2bb6,0x146));var _0x62bb=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x2bb6[_0x354164];return _0x5db9a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x62bb('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x62bb('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xeda7=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1e5516,_0x5b9430){var _0x2caed7=function(_0x408b5c){while(--_0x408b5c){_0x1e5516['push'](_0x1e5516['shift']());}};_0x2caed7(++_0x5b9430);}(_0xeda7,0x196));var _0x7eda=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xeda7[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require(_0x7eda('0x0'));module[_0x7eda('0x1')]={'name':{'type':Sequelize[_0x7eda('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7eda('0x2')]},'write':{'type':Sequelize[_0x7eda('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 7949474..e0594f7 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 _0xce15=['getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','pick','length','removeMembers','addMessage','ChatGroupId'];(function(_0x351b27,_0x2763b5){var _0x50457b=function(_0x10bab4){while(--_0x10bab4){_0x351b27['push'](_0x351b27['shift']());}};_0x50457b(++_0x2763b5);}(_0xce15,0x1d6));var _0x5ce1=function(_0x234459,_0x8da0cc){_0x234459=_0x234459-0x0;var _0x2a73fb=_0xce15[_0x234459];return _0x2a73fb;};'use strict';var emlformat=require(_0x5ce1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ce1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ce1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5ce1('0x3'));var util=require(_0x5ce1('0x4'));var path=require(_0x5ce1('0x5'));var sox=require('sox');var csv=require(_0x5ce1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce1('0x7'));var _=require(_0x5ce1('0x8'));var squel=require(_0x5ce1('0x9'));var crypto=require('crypto');var jsforce=require(_0x5ce1('0xa'));var deskjs=require(_0x5ce1('0xb'));var toCsv=require(_0x5ce1('0x6'));var querystring=require(_0x5ce1('0xc'));var Papa=require('papaparse');var Redis=require(_0x5ce1('0xd'));var authService=require(_0x5ce1('0xe'));var qs=require(_0x5ce1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ce1('0x10'))(_0x5ce1('0x11'));var utils=require(_0x5ce1('0x12'));var config=require(_0x5ce1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ce1('0x14'))['db'];config[_0x5ce1('0x15')]=_[_0x5ce1('0x16')](config[_0x5ce1('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ce1('0x17'))(new Redis(config[_0x5ce1('0x15')]));require(_0x5ce1('0x18'))[_0x5ce1('0x19')](socket);function respondWithStatusCode(_0x3308be,_0x1fd94b){_0x1fd94b=_0x1fd94b||0xcc;return function(_0x2cf62a){if(_0x2cf62a){return _0x3308be[_0x5ce1('0x1a')](_0x1fd94b);}return _0x3308be[_0x5ce1('0x1b')](_0x1fd94b)['end']();};}function respondWithResult(_0x398554,_0x337358){_0x337358=_0x337358||0xc8;return function(_0x1e1398){if(_0x1e1398){return _0x398554[_0x5ce1('0x1b')](_0x337358)[_0x5ce1('0x1c')](_0x1e1398);}};}function respondWithFilteredResult(_0x2a7b3c,_0x56cc1d){return function(_0xd41287){if(_0xd41287){var _0x1fd248=typeof _0x56cc1d[_0x5ce1('0x1d')]===_0x5ce1('0x1e')&&typeof _0x56cc1d[_0x5ce1('0x1f')]===_0x5ce1('0x1e');var _0x1488d1=_0xd41287[_0x5ce1('0x20')];var _0x251881=_0x1fd248?0x0:_0x56cc1d[_0x5ce1('0x1d')];var _0x5d2d41=_0x1fd248?_0xd41287[_0x5ce1('0x20')]:_0x56cc1d[_0x5ce1('0x1d')]+_0x56cc1d['limit'];var _0xdd7dd4;if(_0x5d2d41>=_0x1488d1){_0x5d2d41=_0x1488d1;_0xdd7dd4=0xc8;}else{_0xdd7dd4=0xce;}_0x2a7b3c[_0x5ce1('0x1b')](_0xdd7dd4);return _0x2a7b3c[_0x5ce1('0x21')](_0x5ce1('0x22'),_0x251881+'-'+_0x5d2d41+'/'+_0x1488d1)[_0x5ce1('0x1c')](_0xd41287);}return null;};}function patchUpdates(_0x5d066d){return function(_0x17c86b){try{jsonpatch[_0x5ce1('0x23')](_0x17c86b,_0x5d066d,!![]);}catch(_0x3ef028){return BPromise[_0x5ce1('0x24')](_0x3ef028);}return _0x17c86b[_0x5ce1('0x25')]();};}function saveUpdates(_0x202ffe,_0x10e462){return function(_0xdd5bf2){if(_0xdd5bf2){return _0xdd5bf2['update'](_0x202ffe)[_0x5ce1('0x26')](function(_0x1389bb){return _0x1389bb;});}return null;};}function removeEntity(_0x571b1e,_0x5257c1){return function(_0xfac949){if(_0xfac949){return _0xfac949[_0x5ce1('0x27')]()['then'](function(){_0x571b1e[_0x5ce1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb162,_0x186282){return function(_0x1bed46){if(!_0x1bed46){_0x4cb162[_0x5ce1('0x1a')](0x194);}return _0x1bed46;};}function handleError(_0x4b4839,_0x4f697f){_0x4f697f=_0x4f697f||0x1f4;return function(_0x587701){logger['error'](_0x587701[_0x5ce1('0x28')]);if(_0x587701[_0x5ce1('0x29')]){delete _0x587701[_0x5ce1('0x29')];}_0x4b4839[_0x5ce1('0x1b')](_0x4f697f)['send'](_0x587701);};}exports[_0x5ce1('0x2a')]=function(_0x2ec785,_0x22a47e){var _0x3ed6ca={},_0x1d9bae={},_0x4cc443={'count':0x0,'rows':[]};var _0xd46306=_[_0x5ce1('0x2b')](db[_0x5ce1('0x2c')][_0x5ce1('0x2d')],function(_0x544744){return{'name':_0x544744[_0x5ce1('0x2e')],'type':_0x544744[_0x5ce1('0x2f')][_0x5ce1('0x30')]};});_0x1d9bae['model']=_[_0x5ce1('0x2b')](_0xd46306,_0x5ce1('0x29'));_0x1d9bae[_0x5ce1('0x31')]=_[_0x5ce1('0x32')](_0x2ec785[_0x5ce1('0x31')]);_0x1d9bae[_0x5ce1('0x33')]=_['intersection'](_0x1d9bae[_0x5ce1('0x34')],_0x1d9bae[_0x5ce1('0x31')]);_0x3ed6ca[_0x5ce1('0x35')]=_['intersection'](_0x1d9bae['model'],qs[_0x5ce1('0x36')](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x36')]));_0x3ed6ca[_0x5ce1('0x35')]=_0x3ed6ca[_0x5ce1('0x35')]['length']?_0x3ed6ca[_0x5ce1('0x35')]:_0x1d9bae['model'];if(!_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x3ed6ca[_0x5ce1('0x1f')]=qs['limit'](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x1f')]);_0x3ed6ca[_0x5ce1('0x1d')]=qs[_0x5ce1('0x1d')](_0x2ec785['query'][_0x5ce1('0x1d')]);}_0x3ed6ca[_0x5ce1('0x39')]=qs['sort'](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3a')]);_0x3ed6ca[_0x5ce1('0x3b')]=qs['filters'](_['pick'](_0x2ec785[_0x5ce1('0x31')],_0x1d9bae[_0x5ce1('0x33')]),_0xd46306);if(_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3c')]){_0x3ed6ca[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x3ed6ca[_0x5ce1('0x3b')],{'$or':_[_0x5ce1('0x2b')](_0xd46306,function(_0x3ee878){if(_0x3ee878['type']!==_0x5ce1('0x3e')){var _0x55ca74={};_0x55ca74[_0x3ee878[_0x5ce1('0x29')]]={'$like':'%'+_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3c')]+'%'};return _0x55ca74;}})});}_0x3ed6ca=_[_0x5ce1('0x3d')]({},_0x3ed6ca,_0x2ec785['options']);var _0x8d6d10={'where':_0x3ed6ca[_0x5ce1('0x3b')]};return db['ChatGroup'][_0x5ce1('0x20')](_0x8d6d10)[_0x5ce1('0x26')](function(_0x400ccf){_0x4cc443[_0x5ce1('0x20')]=_0x400ccf;if(_0x2ec785[_0x5ce1('0x31')]['includeAll']){_0x3ed6ca[_0x5ce1('0x3f')]=[{'all':!![]}];}return db[_0x5ce1('0x2c')][_0x5ce1('0x40')](_0x3ed6ca);})[_0x5ce1('0x26')](function(_0x289545){_0x4cc443[_0x5ce1('0x41')]=_0x289545;return _0x4cc443;})['then'](respondWithFilteredResult(_0x22a47e,_0x3ed6ca))[_0x5ce1('0x42')](handleError(_0x22a47e,null));};exports[_0x5ce1('0x43')]=function(_0x4e513f,_0x1f4429){var _0x477194={'raw':!![],'where':{'id':_0x4e513f[_0x5ce1('0x44')]['id']}},_0x41b56b={};_0x41b56b[_0x5ce1('0x34')]=_[_0x5ce1('0x32')](db[_0x5ce1('0x2c')]['rawAttributes']);_0x41b56b[_0x5ce1('0x31')]=_[_0x5ce1('0x32')](_0x4e513f[_0x5ce1('0x31')]);_0x41b56b[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x41b56b[_0x5ce1('0x34')],_0x41b56b[_0x5ce1('0x31')]);_0x477194['attributes']=_[_0x5ce1('0x45')](_0x41b56b['model'],qs[_0x5ce1('0x36')](_0x4e513f[_0x5ce1('0x31')]['fields']));_0x477194[_0x5ce1('0x35')]=_0x477194[_0x5ce1('0x35')]['length']?_0x477194[_0x5ce1('0x35')]:_0x41b56b[_0x5ce1('0x34')];if(_0x4e513f[_0x5ce1('0x31')][_0x5ce1('0x46')]){_0x477194['include']=[{'all':!![]}];}_0x477194=_[_0x5ce1('0x3d')]({},_0x477194,_0x4e513f[_0x5ce1('0x47')]);return db[_0x5ce1('0x2c')][_0x5ce1('0x48')](_0x477194)[_0x5ce1('0x26')](handleEntityNotFound(_0x1f4429,null))['then'](respondWithResult(_0x1f4429,null))[_0x5ce1('0x42')](handleError(_0x1f4429,null));};exports[_0x5ce1('0x49')]=function(_0x20eb4b,_0x1ec47b){return db[_0x5ce1('0x2c')][_0x5ce1('0x49')](_0x20eb4b[_0x5ce1('0x4a')],{})[_0x5ce1('0x26')](respondWithResult(_0x1ec47b,0xc9))[_0x5ce1('0x42')](handleError(_0x1ec47b,null));};exports['update']=function(_0x3d74b0,_0x52fca2){if(_0x3d74b0['body']['id']){delete _0x3d74b0[_0x5ce1('0x4a')]['id'];}return db['ChatGroup'][_0x5ce1('0x48')]({'where':{'id':_0x3d74b0['params']['id']}})['then'](handleEntityNotFound(_0x52fca2,null))[_0x5ce1('0x26')](saveUpdates(_0x3d74b0[_0x5ce1('0x4a')],null))[_0x5ce1('0x26')](respondWithResult(_0x52fca2,null))[_0x5ce1('0x42')](handleError(_0x52fca2,null));};exports[_0x5ce1('0x27')]=function(_0x269acf,_0x3a7bba){return db[_0x5ce1('0x2c')]['find']({'where':{'id':_0x269acf[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3a7bba,null))['then'](removeEntity(_0x3a7bba,null))['catch'](handleError(_0x3a7bba,null));};exports['describe']=function(_0x5c8e5b,_0x521e41){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x521e41,null))[_0x5ce1('0x42')](handleError(_0x521e41,null));};exports[_0x5ce1('0x4b')]=function(_0x253092,_0x54c333,_0x2035ba){return db[_0x5ce1('0x4c')]['count']({'where':{'ChatGroupId':_0x253092[_0x5ce1('0x44')]['id'],'ToId':_0x253092['user']['id'],'read':![]}})['then'](function(_0x534345){return{'id':_[_0x5ce1('0x4d')](_0x253092[_0x5ce1('0x44')]['id']),'count':_0x534345};})[_0x5ce1('0x26')](respondWithResult(_0x54c333,null))[_0x5ce1('0x42')](handleError(_0x54c333,null));};exports[_0x5ce1('0x4e')]=function(_0x13f05f,_0x4d18ac,_0x29871d){return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0x13f05f['params']['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x4d18ac,null))[_0x5ce1('0x26')](function(_0x4d7222){if(_0x4d7222){return _0x4d7222[_0x5ce1('0x4e')](_0x13f05f[_0x5ce1('0x4a')][_0x5ce1('0x4f')],_['omit'](_0x13f05f[_0x5ce1('0x4a')],['ids','id'])||{});}})[_0x5ce1('0x26')](respondWithResult(_0x4d18ac,null))['catch'](handleError(_0x4d18ac,null));};exports[_0x5ce1('0x50')]=function(_0x2bddcf,_0x3e7c10,_0x43a06f){var _0x9cf6bd={};var _0x516ccc={};var _0x61ff52;var _0x16e18b;return db['ChatGroup'][_0x5ce1('0x51')]({'where':{'id':_0x2bddcf[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3e7c10,null))[_0x5ce1('0x26')](function(_0x351066){if(_0x351066){_0x61ff52=_0x351066;_0x516ccc[_0x5ce1('0x34')]=_['keys'](db[_0x5ce1('0x52')][_0x5ce1('0x2d')]);_0x516ccc['query']=_[_0x5ce1('0x32')](_0x2bddcf['query']);_0x516ccc[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x516ccc['model'],_0x516ccc['query']);_0x9cf6bd[_0x5ce1('0x35')]=_['intersection'](_0x516ccc['model'],qs['fields'](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x36')]));_0x9cf6bd[_0x5ce1('0x35')]=_0x9cf6bd['attributes']['length']?_0x9cf6bd[_0x5ce1('0x35')]:_0x516ccc['model'];_0x9cf6bd[_0x5ce1('0x39')]=qs[_0x5ce1('0x3a')](_0x2bddcf[_0x5ce1('0x31')]['sort']);_0x9cf6bd['where']=qs[_0x5ce1('0x33')](_[_0x5ce1('0x53')](_0x2bddcf['query'],_0x516ccc[_0x5ce1('0x33')]));if(_0x2bddcf['query'][_0x5ce1('0x3c')]){_0x9cf6bd[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x9cf6bd[_0x5ce1('0x3b')],{'$or':_[_0x5ce1('0x2b')](_0x9cf6bd['attributes'],function(_0x149440){var _0x5acdb5={};_0x5acdb5[_0x149440]={'$like':'%'+_0x2bddcf['query']['filter']+'%'};return _0x5acdb5;})});}_0x9cf6bd=_[_0x5ce1('0x3d')]({},_0x9cf6bd,_0x2bddcf[_0x5ce1('0x47')]);return _0x61ff52[_0x5ce1('0x50')](_0x9cf6bd);}})['then'](function(_0x56103f){if(_0x56103f){_0x16e18b=_0x56103f[_0x5ce1('0x54')];if(!_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x9cf6bd['limit']=qs[_0x5ce1('0x1f')](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x1f')]);_0x9cf6bd['offset']=qs[_0x5ce1('0x1d')](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x1d')]);}return _0x61ff52['getMembers'](_0x9cf6bd);}})['then'](function(_0x2c302b){if(_0x2c302b){return _0x2c302b?{'count':_0x16e18b,'rows':_0x2c302b}:null;}})[_0x5ce1('0x26')](respondWithResult(_0x3e7c10,null))[_0x5ce1('0x42')](handleError(_0x3e7c10,null));};exports[_0x5ce1('0x55')]=function(_0x2a776d,_0x3225d0,_0x5d55cc){return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0x2a776d[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3225d0,null))[_0x5ce1('0x26')](function(_0x5bdbb9){if(_0x5bdbb9){return _0x5bdbb9[_0x5ce1('0x55')](_0x2a776d['query'][_0x5ce1('0x4f')]);}})[_0x5ce1('0x26')](respondWithStatusCode(_0x3225d0,null))[_0x5ce1('0x42')](handleError(_0x3225d0,null));};exports[_0x5ce1('0x56')]=function(_0xc2798c,_0x1e952e,_0x5a3bbc){if(_0xc2798c[_0x5ce1('0x4a')]['id']){delete _0xc2798c[_0x5ce1('0x4a')]['id'];}return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0xc2798c['params']['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x1e952e,null))['then'](function(_0x54443c){if(_0x54443c){_0xc2798c['body'][_0x5ce1('0x57')]=_0x54443c['id'];return db[_0x5ce1('0x4c')][_0x5ce1('0x49')](_0xc2798c['body']);}})[_0x5ce1('0x26')](respondWithResult(_0x1e952e,null))['catch'](handleError(_0x1e952e,null));};exports[_0x5ce1('0x58')]=function(_0x30afba,_0xef0841,_0x36bd9e){var _0x20b144={};var _0x2aecb8={};var _0x4a48af;var _0x598142;return db[_0x5ce1('0x2c')][_0x5ce1('0x51')]({'where':{'id':_0x30afba[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0xef0841,null))[_0x5ce1('0x26')](function(_0x18cc5d){if(_0x18cc5d){_0x4a48af=_0x18cc5d;_0x2aecb8['model']=_[_0x5ce1('0x32')](db[_0x5ce1('0x4c')][_0x5ce1('0x2d')]);_0x2aecb8['query']=_[_0x5ce1('0x32')](_0x30afba[_0x5ce1('0x31')]);_0x2aecb8[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x2aecb8[_0x5ce1('0x34')],_0x2aecb8[_0x5ce1('0x31')]);_0x20b144['attributes']=_[_0x5ce1('0x45')](_0x2aecb8[_0x5ce1('0x34')],qs['fields'](_0x30afba['query'][_0x5ce1('0x36')]));_0x20b144[_0x5ce1('0x35')]=_0x20b144[_0x5ce1('0x35')][_0x5ce1('0x54')]?_0x20b144[_0x5ce1('0x35')]:_0x2aecb8['model'];_0x20b144[_0x5ce1('0x39')]=qs[_0x5ce1('0x3a')](_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3a')]);_0x20b144[_0x5ce1('0x3b')]=qs[_0x5ce1('0x33')](_[_0x5ce1('0x53')](_0x30afba['query'],_0x2aecb8[_0x5ce1('0x33')]));if(_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3c')]){_0x20b144[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x20b144['where'],{'$or':_['map'](_0x20b144[_0x5ce1('0x35')],function(_0x38e771){var _0x40586d={};_0x40586d[_0x38e771]={'$like':'%'+_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3c')]+'%'};return _0x40586d;})});}if(_0x30afba[_0x5ce1('0x31')]['$gte']){var _0x287120=_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x59')][_0x5ce1('0x5a')](',');var _0xf260ff={};_0xf260ff[_0x287120[0x0]]={'$gte':moment(_0x287120[0x1])[_0x5ce1('0x5b')](_0x5ce1('0x5c'))};_0x20b144[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x20b144[_0x5ce1('0x3b')],_0xf260ff);}_0x20b144=_['merge']({},_0x20b144,_0x30afba['options']);return _0x4a48af[_0x5ce1('0x58')](_0x20b144);}})['then'](function(_0x1a3348){if(_0x1a3348){_0x598142=_0x1a3348['length'];if(!_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x20b144[_0x5ce1('0x1f')]=qs[_0x5ce1('0x1f')](_0x30afba[_0x5ce1('0x31')]['limit']);_0x20b144[_0x5ce1('0x1d')]=qs['offset'](_0x30afba[_0x5ce1('0x31')]['offset']);}return _0x4a48af[_0x5ce1('0x58')](_0x20b144);}})[_0x5ce1('0x26')](function(_0x5947dd){if(_0x5947dd){return _0x5947dd?{'count':_0x598142,'rows':_0x5947dd}:null;}})['then'](respondWithResult(_0xef0841,null))[_0x5ce1('0x42')](handleError(_0xef0841,null));}; \ No newline at end of file +var _0xa25a=['./chatGroup.socket','register','sendStatus','status','offset','undefined','limit','count','json','reject','save','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','ChatGroup','includeAll','include','rows','catch','show','params','keys','options','find','create','body','update','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','addMessage','ChatGroupId','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis'];(function(_0x36503c,_0x291a43){var _0x1b2e7d=function(_0x53d203){while(--_0x53d203){_0x36503c['push'](_0x36503c['shift']());}};_0x1b2e7d(++_0x291a43);}(_0xa25a,0xa1));var _0xaa25=function(_0x54d0c9,_0x379c87){_0x54d0c9=_0x54d0c9-0x0;var _0x586e5e=_0xa25a[_0x54d0c9];return _0x586e5e;};'use strict';var emlformat=require(_0xaa25('0x0'));var rimraf=require(_0xaa25('0x1'));var zipdir=require(_0xaa25('0x2'));var jsonpatch=require(_0xaa25('0x3'));var rp=require(_0xaa25('0x4'));var moment=require(_0xaa25('0x5'));var BPromise=require(_0xaa25('0x6'));var Mustache=require(_0xaa25('0x7'));var util=require(_0xaa25('0x8'));var path=require('path');var sox=require(_0xaa25('0x9'));var csv=require(_0xaa25('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa25('0xb'));var _=require(_0xaa25('0xc'));var squel=require(_0xaa25('0xd'));var crypto=require(_0xaa25('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaa25('0xf'));var toCsv=require(_0xaa25('0xa'));var querystring=require('querystring');var Papa=require(_0xaa25('0x10'));var Redis=require(_0xaa25('0x11'));var authService=require(_0xaa25('0x12'));var qs=require(_0xaa25('0x13'));var as=require(_0xaa25('0x14'));var hardwareService=require(_0xaa25('0x15'));var logger=require('../../config/logger')(_0xaa25('0x16'));var utils=require(_0xaa25('0x17'));var config=require(_0xaa25('0x18'));var licenseUtil=require(_0xaa25('0x19'));var db=require(_0xaa25('0x1a'))['db'];config['redis']=_[_0xaa25('0x1b')](config['redis'],{'host':_0xaa25('0x1c'),'port':0x18eb});var socket=require(_0xaa25('0x1d'))(new Redis(config[_0xaa25('0x1e')]));require(_0xaa25('0x1f'))[_0xaa25('0x20')](socket);function respondWithStatusCode(_0x483391,_0x4d4601){_0x4d4601=_0x4d4601||0xcc;return function(_0x2aafa4){if(_0x2aafa4){return _0x483391[_0xaa25('0x21')](_0x4d4601);}return _0x483391[_0xaa25('0x22')](_0x4d4601)['end']();};}function respondWithResult(_0x2391e6,_0x491116){_0x491116=_0x491116||0xc8;return function(_0x3ff883){if(_0x3ff883){return _0x2391e6[_0xaa25('0x22')](_0x491116)['json'](_0x3ff883);}};}function respondWithFilteredResult(_0x3c18da,_0xeb8be8){return function(_0x1c9f4a){if(_0x1c9f4a){var _0x40de91=typeof _0xeb8be8[_0xaa25('0x23')]===_0xaa25('0x24')&&typeof _0xeb8be8[_0xaa25('0x25')]==='undefined';var _0x39c9e3=_0x1c9f4a[_0xaa25('0x26')];var _0x3fc098=_0x40de91?0x0:_0xeb8be8['offset'];var _0x3930b0=_0x40de91?_0x1c9f4a[_0xaa25('0x26')]:_0xeb8be8[_0xaa25('0x23')]+_0xeb8be8[_0xaa25('0x25')];var _0x46b929;if(_0x3930b0>=_0x39c9e3){_0x3930b0=_0x39c9e3;_0x46b929=0xc8;}else{_0x46b929=0xce;}_0x3c18da[_0xaa25('0x22')](_0x46b929);return _0x3c18da['set']('Content-Range',_0x3fc098+'-'+_0x3930b0+'/'+_0x39c9e3)[_0xaa25('0x27')](_0x1c9f4a);}return null;};}function patchUpdates(_0x1f2d7b){return function(_0x1f348e){try{jsonpatch['apply'](_0x1f348e,_0x1f2d7b,!![]);}catch(_0x3c394b){return BPromise[_0xaa25('0x28')](_0x3c394b);}return _0x1f348e[_0xaa25('0x29')]();};}function saveUpdates(_0x17e055,_0x46f1a4){return function(_0x1368cd){if(_0x1368cd){return _0x1368cd['update'](_0x17e055)[_0xaa25('0x2a')](function(_0x12f566){return _0x12f566;});}return null;};}function removeEntity(_0x1ff1f1,_0x781b0d){return function(_0x2a20e3){if(_0x2a20e3){return _0x2a20e3[_0xaa25('0x2b')]()[_0xaa25('0x2a')](function(){_0x1ff1f1[_0xaa25('0x22')](0xcc)[_0xaa25('0x2c')]();});}};}function handleEntityNotFound(_0x509605,_0x51f434){return function(_0x554e1e){if(!_0x554e1e){_0x509605[_0xaa25('0x21')](0x194);}return _0x554e1e;};}function handleError(_0x3ed9b5,_0x5caea0){_0x5caea0=_0x5caea0||0x1f4;return function(_0x5aa8cf){logger[_0xaa25('0x2d')](_0x5aa8cf['stack']);if(_0x5aa8cf['name']){delete _0x5aa8cf[_0xaa25('0x2e')];}_0x3ed9b5[_0xaa25('0x22')](_0x5caea0)[_0xaa25('0x2f')](_0x5aa8cf);};}exports[_0xaa25('0x30')]=function(_0x4d10d5,_0xe3c90d){var _0x32e317={},_0x2ecadf={},_0x1850ab={'count':0x0,'rows':[]};var _0x1725f0=_[_0xaa25('0x31')](db['ChatGroup'][_0xaa25('0x32')],function(_0x2e1e19){return{'name':_0x2e1e19[_0xaa25('0x33')],'type':_0x2e1e19[_0xaa25('0x34')][_0xaa25('0x35')]};});_0x2ecadf['model']=_[_0xaa25('0x31')](_0x1725f0,_0xaa25('0x2e'));_0x2ecadf['query']=_['keys'](_0x4d10d5[_0xaa25('0x36')]);_0x2ecadf[_0xaa25('0x37')]=_[_0xaa25('0x38')](_0x2ecadf[_0xaa25('0x39')],_0x2ecadf[_0xaa25('0x36')]);_0x32e317[_0xaa25('0x3a')]=_[_0xaa25('0x38')](_0x2ecadf[_0xaa25('0x39')],qs['fields'](_0x4d10d5[_0xaa25('0x36')][_0xaa25('0x3b')]));_0x32e317[_0xaa25('0x3a')]=_0x32e317[_0xaa25('0x3a')][_0xaa25('0x3c')]?_0x32e317[_0xaa25('0x3a')]:_0x2ecadf['model'];if(!_0x4d10d5[_0xaa25('0x36')][_0xaa25('0x3d')](_0xaa25('0x3e'))){_0x32e317[_0xaa25('0x25')]=qs['limit'](_0x4d10d5['query'][_0xaa25('0x25')]);_0x32e317[_0xaa25('0x23')]=qs[_0xaa25('0x23')](_0x4d10d5[_0xaa25('0x36')][_0xaa25('0x23')]);}_0x32e317[_0xaa25('0x3f')]=qs[_0xaa25('0x40')](_0x4d10d5['query'][_0xaa25('0x40')]);_0x32e317[_0xaa25('0x41')]=qs[_0xaa25('0x37')](_[_0xaa25('0x42')](_0x4d10d5[_0xaa25('0x36')],_0x2ecadf[_0xaa25('0x37')]),_0x1725f0);if(_0x4d10d5[_0xaa25('0x36')][_0xaa25('0x43')]){_0x32e317[_0xaa25('0x41')]=_[_0xaa25('0x44')](_0x32e317[_0xaa25('0x41')],{'$or':_[_0xaa25('0x31')](_0x1725f0,function(_0x3e277e){if(_0x3e277e[_0xaa25('0x34')]!=='VIRTUAL'){var _0x3b00d6={};_0x3b00d6[_0x3e277e['name']]={'$like':'%'+_0x4d10d5['query'][_0xaa25('0x43')]+'%'};return _0x3b00d6;}})});}_0x32e317=_[_0xaa25('0x44')]({},_0x32e317,_0x4d10d5['options']);var _0x455f8e={'where':_0x32e317[_0xaa25('0x41')]};return db[_0xaa25('0x45')][_0xaa25('0x26')](_0x455f8e)[_0xaa25('0x2a')](function(_0x482288){_0x1850ab[_0xaa25('0x26')]=_0x482288;if(_0x4d10d5[_0xaa25('0x36')][_0xaa25('0x46')]){_0x32e317[_0xaa25('0x47')]=[{'all':!![]}];}return db[_0xaa25('0x45')]['findAll'](_0x32e317);})[_0xaa25('0x2a')](function(_0x2bf42e){_0x1850ab[_0xaa25('0x48')]=_0x2bf42e;return _0x1850ab;})[_0xaa25('0x2a')](respondWithFilteredResult(_0xe3c90d,_0x32e317))[_0xaa25('0x49')](handleError(_0xe3c90d,null));};exports[_0xaa25('0x4a')]=function(_0x4d9a02,_0x59914e){var _0x2c2352={'raw':!![],'where':{'id':_0x4d9a02[_0xaa25('0x4b')]['id']}},_0xeb28a3={};_0xeb28a3[_0xaa25('0x39')]=_[_0xaa25('0x4c')](db[_0xaa25('0x45')][_0xaa25('0x32')]);_0xeb28a3[_0xaa25('0x36')]=_['keys'](_0x4d9a02[_0xaa25('0x36')]);_0xeb28a3[_0xaa25('0x37')]=_[_0xaa25('0x38')](_0xeb28a3['model'],_0xeb28a3[_0xaa25('0x36')]);_0x2c2352[_0xaa25('0x3a')]=_[_0xaa25('0x38')](_0xeb28a3[_0xaa25('0x39')],qs['fields'](_0x4d9a02[_0xaa25('0x36')]['fields']));_0x2c2352[_0xaa25('0x3a')]=_0x2c2352[_0xaa25('0x3a')][_0xaa25('0x3c')]?_0x2c2352[_0xaa25('0x3a')]:_0xeb28a3[_0xaa25('0x39')];if(_0x4d9a02[_0xaa25('0x36')][_0xaa25('0x46')]){_0x2c2352[_0xaa25('0x47')]=[{'all':!![]}];}_0x2c2352=_[_0xaa25('0x44')]({},_0x2c2352,_0x4d9a02[_0xaa25('0x4d')]);return db['ChatGroup'][_0xaa25('0x4e')](_0x2c2352)[_0xaa25('0x2a')](handleEntityNotFound(_0x59914e,null))[_0xaa25('0x2a')](respondWithResult(_0x59914e,null))[_0xaa25('0x49')](handleError(_0x59914e,null));};exports[_0xaa25('0x4f')]=function(_0x3cd383,_0x55cb24){return db[_0xaa25('0x45')][_0xaa25('0x4f')](_0x3cd383[_0xaa25('0x50')],{})[_0xaa25('0x2a')](respondWithResult(_0x55cb24,0xc9))[_0xaa25('0x49')](handleError(_0x55cb24,null));};exports[_0xaa25('0x51')]=function(_0x4920e6,_0x55e09f){if(_0x4920e6[_0xaa25('0x50')]['id']){delete _0x4920e6[_0xaa25('0x50')]['id'];}return db[_0xaa25('0x45')]['find']({'where':{'id':_0x4920e6[_0xaa25('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55e09f,null))[_0xaa25('0x2a')](saveUpdates(_0x4920e6[_0xaa25('0x50')],null))[_0xaa25('0x2a')](respondWithResult(_0x55e09f,null))[_0xaa25('0x49')](handleError(_0x55e09f,null));};exports[_0xaa25('0x2b')]=function(_0x1a5f94,_0xb9ea59){return db['ChatGroup'][_0xaa25('0x4e')]({'where':{'id':_0x1a5f94['params']['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0xb9ea59,null))['then'](removeEntity(_0xb9ea59,null))[_0xaa25('0x49')](handleError(_0xb9ea59,null));};exports[_0xaa25('0x52')]=function(_0x4c182c,_0x479f3d){return db[_0xaa25('0x45')][_0xaa25('0x52')]()[_0xaa25('0x2a')](respondWithResult(_0x479f3d,null))[_0xaa25('0x49')](handleError(_0x479f3d,null));};exports['getUnread']=function(_0x5b1f4c,_0x5d0cba,_0x13abf7){return db[_0xaa25('0x53')]['count']({'where':{'ChatGroupId':_0x5b1f4c['params']['id'],'ToId':_0x5b1f4c[_0xaa25('0x54')]['id'],'read':![]}})[_0xaa25('0x2a')](function(_0x1ee78c){return{'id':_[_0xaa25('0x55')](_0x5b1f4c['params']['id']),'count':_0x1ee78c};})['then'](respondWithResult(_0x5d0cba,null))[_0xaa25('0x49')](handleError(_0x5d0cba,null));};exports[_0xaa25('0x56')]=function(_0x1c16fb,_0x8380f0,_0x29a080){return db[_0xaa25('0x45')][_0xaa25('0x4e')]({'where':{'id':_0x1c16fb[_0xaa25('0x4b')]['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0x8380f0,null))[_0xaa25('0x2a')](function(_0xeaac61){if(_0xeaac61){return _0xeaac61['addMembers'](_0x1c16fb['body'][_0xaa25('0x57')],_[_0xaa25('0x58')](_0x1c16fb[_0xaa25('0x50')],[_0xaa25('0x57'),'id'])||{});}})['then'](respondWithResult(_0x8380f0,null))[_0xaa25('0x49')](handleError(_0x8380f0,null));};exports['getMembers']=function(_0x5e7600,_0x1c171d,_0x52271d){var _0x31e2c1={};var _0x2c2ed7={};var _0x41740c;var _0x4300d0;return db[_0xaa25('0x45')]['findOne']({'where':{'id':_0x5e7600[_0xaa25('0x4b')]['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0x1c171d,null))[_0xaa25('0x2a')](function(_0x38dc18){if(_0x38dc18){_0x41740c=_0x38dc18;_0x2c2ed7[_0xaa25('0x39')]=_[_0xaa25('0x4c')](db[_0xaa25('0x59')][_0xaa25('0x32')]);_0x2c2ed7[_0xaa25('0x36')]=_['keys'](_0x5e7600[_0xaa25('0x36')]);_0x2c2ed7[_0xaa25('0x37')]=_[_0xaa25('0x38')](_0x2c2ed7[_0xaa25('0x39')],_0x2c2ed7['query']);_0x31e2c1[_0xaa25('0x3a')]=_[_0xaa25('0x38')](_0x2c2ed7[_0xaa25('0x39')],qs['fields'](_0x5e7600[_0xaa25('0x36')][_0xaa25('0x3b')]));_0x31e2c1[_0xaa25('0x3a')]=_0x31e2c1[_0xaa25('0x3a')]['length']?_0x31e2c1[_0xaa25('0x3a')]:_0x2c2ed7['model'];_0x31e2c1[_0xaa25('0x3f')]=qs['sort'](_0x5e7600[_0xaa25('0x36')][_0xaa25('0x40')]);_0x31e2c1[_0xaa25('0x41')]=qs[_0xaa25('0x37')](_[_0xaa25('0x42')](_0x5e7600['query'],_0x2c2ed7[_0xaa25('0x37')]));if(_0x5e7600[_0xaa25('0x36')]['filter']){_0x31e2c1[_0xaa25('0x41')]=_[_0xaa25('0x44')](_0x31e2c1[_0xaa25('0x41')],{'$or':_[_0xaa25('0x31')](_0x31e2c1[_0xaa25('0x3a')],function(_0x282fa4){var _0x35c6ea={};_0x35c6ea[_0x282fa4]={'$like':'%'+_0x5e7600[_0xaa25('0x36')][_0xaa25('0x43')]+'%'};return _0x35c6ea;})});}_0x31e2c1=_[_0xaa25('0x44')]({},_0x31e2c1,_0x5e7600[_0xaa25('0x4d')]);return _0x41740c[_0xaa25('0x5a')](_0x31e2c1);}})['then'](function(_0x12d19c){if(_0x12d19c){_0x4300d0=_0x12d19c[_0xaa25('0x3c')];if(!_0x5e7600[_0xaa25('0x36')][_0xaa25('0x3d')]('nolimit')){_0x31e2c1[_0xaa25('0x25')]=qs['limit'](_0x5e7600[_0xaa25('0x36')][_0xaa25('0x25')]);_0x31e2c1[_0xaa25('0x23')]=qs['offset'](_0x5e7600[_0xaa25('0x36')][_0xaa25('0x23')]);}return _0x41740c[_0xaa25('0x5a')](_0x31e2c1);}})[_0xaa25('0x2a')](function(_0xa27bea){if(_0xa27bea){return _0xa27bea?{'count':_0x4300d0,'rows':_0xa27bea}:null;}})['then'](respondWithResult(_0x1c171d,null))[_0xaa25('0x49')](handleError(_0x1c171d,null));};exports['removeMembers']=function(_0x2af348,_0x25d6dc,_0x40c139){return db[_0xaa25('0x45')]['find']({'where':{'id':_0x2af348[_0xaa25('0x4b')]['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0x25d6dc,null))[_0xaa25('0x2a')](function(_0x44b754){if(_0x44b754){return _0x44b754['removeMembers'](_0x2af348[_0xaa25('0x36')]['ids']);}})[_0xaa25('0x2a')](respondWithStatusCode(_0x25d6dc,null))[_0xaa25('0x49')](handleError(_0x25d6dc,null));};exports[_0xaa25('0x5b')]=function(_0x423909,_0x35ff8d,_0x3643fa){if(_0x423909[_0xaa25('0x50')]['id']){delete _0x423909['body']['id'];}return db[_0xaa25('0x45')]['find']({'where':{'id':_0x423909[_0xaa25('0x4b')]['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0x35ff8d,null))[_0xaa25('0x2a')](function(_0x5257f7){if(_0x5257f7){_0x423909[_0xaa25('0x50')][_0xaa25('0x5c')]=_0x5257f7['id'];return db[_0xaa25('0x53')]['create'](_0x423909[_0xaa25('0x50')]);}})[_0xaa25('0x2a')](respondWithResult(_0x35ff8d,null))[_0xaa25('0x49')](handleError(_0x35ff8d,null));};exports[_0xaa25('0x5d')]=function(_0x347bc4,_0x4ed5f0,_0x28e03d){var _0x1494f7={};var _0x17bdb9={};var _0x19aeef;var _0xf9be8a;return db['ChatGroup']['findOne']({'where':{'id':_0x347bc4['params']['id']}})[_0xaa25('0x2a')](handleEntityNotFound(_0x4ed5f0,null))['then'](function(_0x457366){if(_0x457366){_0x19aeef=_0x457366;_0x17bdb9[_0xaa25('0x39')]=_[_0xaa25('0x4c')](db['ChatInternalMessage'][_0xaa25('0x32')]);_0x17bdb9[_0xaa25('0x36')]=_[_0xaa25('0x4c')](_0x347bc4[_0xaa25('0x36')]);_0x17bdb9['filters']=_[_0xaa25('0x38')](_0x17bdb9['model'],_0x17bdb9[_0xaa25('0x36')]);_0x1494f7['attributes']=_[_0xaa25('0x38')](_0x17bdb9[_0xaa25('0x39')],qs[_0xaa25('0x3b')](_0x347bc4[_0xaa25('0x36')][_0xaa25('0x3b')]));_0x1494f7[_0xaa25('0x3a')]=_0x1494f7['attributes'][_0xaa25('0x3c')]?_0x1494f7['attributes']:_0x17bdb9['model'];_0x1494f7[_0xaa25('0x3f')]=qs[_0xaa25('0x40')](_0x347bc4[_0xaa25('0x36')][_0xaa25('0x40')]);_0x1494f7[_0xaa25('0x41')]=qs[_0xaa25('0x37')](_[_0xaa25('0x42')](_0x347bc4['query'],_0x17bdb9['filters']));if(_0x347bc4[_0xaa25('0x36')]['filter']){_0x1494f7[_0xaa25('0x41')]=_['merge'](_0x1494f7[_0xaa25('0x41')],{'$or':_[_0xaa25('0x31')](_0x1494f7[_0xaa25('0x3a')],function(_0x28c9f2){var _0x5115e6={};_0x5115e6[_0x28c9f2]={'$like':'%'+_0x347bc4[_0xaa25('0x36')]['filter']+'%'};return _0x5115e6;})});}if(_0x347bc4[_0xaa25('0x36')]['$gte']){var _0x10f60c=_0x347bc4[_0xaa25('0x36')]['$gte'][_0xaa25('0x5e')](',');var _0x30c32d={};_0x30c32d[_0x10f60c[0x0]]={'$gte':moment(_0x10f60c[0x1])['format'](_0xaa25('0x5f'))};_0x1494f7[_0xaa25('0x41')]=_['merge'](_0x1494f7[_0xaa25('0x41')],_0x30c32d);}_0x1494f7=_['merge']({},_0x1494f7,_0x347bc4[_0xaa25('0x4d')]);return _0x19aeef['getMessages'](_0x1494f7);}})[_0xaa25('0x2a')](function(_0x325a74){if(_0x325a74){_0xf9be8a=_0x325a74[_0xaa25('0x3c')];if(!_0x347bc4[_0xaa25('0x36')][_0xaa25('0x3d')](_0xaa25('0x3e'))){_0x1494f7[_0xaa25('0x25')]=qs[_0xaa25('0x25')](_0x347bc4[_0xaa25('0x36')][_0xaa25('0x25')]);_0x1494f7[_0xaa25('0x23')]=qs[_0xaa25('0x23')](_0x347bc4[_0xaa25('0x36')][_0xaa25('0x23')]);}return _0x19aeef[_0xaa25('0x5d')](_0x1494f7);}})[_0xaa25('0x2a')](function(_0x4c6cb4){if(_0x4c6cb4){return _0x4c6cb4?{'count':_0xf9be8a,'rows':_0x4c6cb4}:null;}})[_0xaa25('0x2a')](respondWithResult(_0x4ed5f0,null))[_0xaa25('0x49')](handleError(_0x4ed5f0,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 86aa216..fbb01b5 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 _0xb2ea=['remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0xe6c7e4,_0x5c40c4){var _0x109c83=function(_0x54870b){while(--_0x54870b){_0xe6c7e4['push'](_0xe6c7e4['shift']());}};_0x109c83(++_0x5c40c4);}(_0xb2ea,0x1eb));var _0xab2e=function(_0x101842,_0x4db31b){_0x101842=_0x101842-0x0;var _0x45ce04=_0xb2ea[_0x101842];return _0x45ce04;};'use strict';var EventEmitter=require(_0xab2e('0x0'));var ChatGroup=require(_0xab2e('0x1'))['db'][_0xab2e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xab2e('0x3')](0x0);var events={'afterCreate':_0xab2e('0x4'),'afterUpdate':'update','afterDestroy':_0xab2e('0x5')};function emitEvent(_0x2cebed){return function(_0x42ca08,_0x1dfdc5,_0x5cef90){ChatGroupEvents['emit'](_0x2cebed+':'+_0x42ca08['id'],_0x42ca08);ChatGroupEvents[_0xab2e('0x6')](_0x2cebed,_0x42ca08);_0x5cef90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xab2e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xd417=['remove','emit','hasOwnProperty','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x20ec76,_0x46b58c){var _0x59f146=function(_0x54f5dc){while(--_0x54f5dc){_0x20ec76['push'](_0x20ec76['shift']());}};_0x59f146(++_0x46b58c);}(_0xd417,0x1eb));var _0x7d41=function(_0x548612,_0x3e2dd0){_0x548612=_0x548612-0x0;var _0x14c457=_0xd417[_0x548612];return _0x14c457;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x7d41('0x0'))['db'][_0x7d41('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7d41('0x2')](0x0);var events={'afterCreate':_0x7d41('0x3'),'afterUpdate':_0x7d41('0x4'),'afterDestroy':_0x7d41('0x5')};function emitEvent(_0x25e83c){return function(_0x3e7de3,_0x4026f7,_0x54780b){ChatGroupEvents[_0x7d41('0x6')](_0x25e83c+':'+_0x3e7de3['id'],_0x3e7de3);ChatGroupEvents[_0x7d41('0x6')](_0x25e83c,_0x3e7de3);_0x54780b(null);};}for(var e in events){if(events[_0x7d41('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e4afe1d..cd5c40a 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 _0x8610=['moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','api'];(function(_0x5a2b15,_0x459103){var _0x497e16=function(_0x244aa8){while(--_0x244aa8){_0x5a2b15['push'](_0x5a2b15['shift']());}};_0x497e16(++_0x459103);}(_0x8610,0xae));var _0x0861=function(_0x3064e2,_0x2a3f50){_0x3064e2=_0x3064e2-0x0;var _0x390154=_0x8610[_0x3064e2];return _0x390154;};'use strict';var _=require('lodash');var util=require(_0x0861('0x0'));var logger=require('../../config/logger')(_0x0861('0x1'));var moment=require(_0x0861('0x2'));var BPromise=require('bluebird');var rp=require(_0x0861('0x3'));var fs=require('fs');var path=require(_0x0861('0x4'));var rimraf=require(_0x0861('0x5'));var config=require(_0x0861('0x6'));var attributes=require(_0x0861('0x7'));module[_0x0861('0x8')]=function(_0x2ec4a8,_0x3996f1){return _0x2ec4a8[_0x0861('0x9')](_0x0861('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x888c=['ChatGroup','chat_groups','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define'];(function(_0x85246a,_0x3407f1){var _0x337a3d=function(_0x4a80d3){while(--_0x4a80d3){_0x85246a['push'](_0x85246a['shift']());}};_0x337a3d(++_0x3407f1);}(_0x888c,0x157));var _0xc888=function(_0x2d7170,_0x46f1e2){_0x2d7170=_0x2d7170-0x0;var _0x43e456=_0x888c[_0x2d7170];return _0x43e456;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc888('0x0'))(_0xc888('0x1'));var moment=require('moment');var BPromise=require(_0xc888('0x2'));var rp=require(_0xc888('0x3'));var fs=require('fs');var path=require(_0xc888('0x4'));var rimraf=require(_0xc888('0x5'));var config=require(_0xc888('0x6'));var attributes=require(_0xc888('0x7'));module['exports']=function(_0xd16f87,_0xa5ae4f){return _0xd16f87[_0xc888('0x8')](_0xc888('0x9'),attributes,{'tableName':_0xc888('0xa'),'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 ed9d93c..7da9fd4 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 _0x3dc1=['then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x3dc1,0x127));var _0x13dc=function(_0x40fa11,_0xb9cdd){_0x40fa11=_0x40fa11-0x0;var _0xf527c7=_0x3dc1[_0x40fa11];return _0xf527c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13dc('0x1'));var db=require(_0x13dc('0x2'))['db'];var utils=require(_0x13dc('0x3'));var logger=require(_0x13dc('0x4'))(_0x13dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x13dc('0x6'));var client=jayson[_0x13dc('0x7')]['http']({'port':0x232a});config['redis']=_[_0x13dc('0x8')](config['redis'],{'host':_0x13dc('0x9'),'port':0x18eb});var socket=require(_0x13dc('0xa'))(new Redis(config['redis']));require(_0x13dc('0xb'))[_0x13dc('0xc')](socket);function respondWithRpcPromise(_0x386e43,_0x7b132c,_0x5c1b24){return new BPromise(function(_0x1533de,_0x46d4f){return client['request'](_0x386e43,_0x5c1b24)[_0x13dc('0xd')](function(_0x835a16){logger[_0x13dc('0xe')]('ChatGroup,\x20%s,\x20%s',_0x7b132c,_0x13dc('0xf'));logger[_0x13dc('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x7b132c,_0x13dc('0xf'),JSON['stringify'](_0x835a16));if(_0x835a16[_0x13dc('0x11')]){if(_0x835a16[_0x13dc('0x11')][_0x13dc('0x12')]===0x1f4){logger[_0x13dc('0x11')](_0x13dc('0x13'),_0x7b132c,_0x835a16['error'][_0x13dc('0x14')]);return _0x46d4f(_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);}logger[_0x13dc('0x11')](_0x13dc('0x13'),_0x7b132c,_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);return _0x1533de(_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);}else{logger[_0x13dc('0xe')](_0x13dc('0x13'),_0x7b132c,_0x13dc('0xf'));_0x1533de(_0x835a16[_0x13dc('0x15')]['message']);}})['catch'](function(_0x4c495e){logger[_0x13dc('0x11')]('ChatGroup,\x20%s,\x20%s',_0x7b132c,_0x4c495e);_0x46d4f(_0x4c495e);});});} \ No newline at end of file +var _0x64b0=['redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x31cc87,_0x325e95){var _0x1b8298=function(_0x449b1e){while(--_0x449b1e){_0x31cc87['push'](_0x31cc87['shift']());}};_0x1b8298(++_0x325e95);}(_0x64b0,0x74));var _0x064b=function(_0x1473d6,_0x3c0c6d){_0x1473d6=_0x1473d6-0x0;var _0x3d00b7=_0x64b0[_0x1473d6];return _0x3d00b7;};'use strict';var _=require(_0x064b('0x0'));var util=require(_0x064b('0x1'));var moment=require(_0x064b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x064b('0x3'));var db=require(_0x064b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x064b('0x5'))(_0x064b('0x6'));var config=require('../../config/environment');var jayson=require(_0x064b('0x7'));var client=jayson[_0x064b('0x8')]['http']({'port':0x232a});config[_0x064b('0x9')]=_[_0x064b('0xa')](config[_0x064b('0x9')],{'host':_0x064b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x064b('0x9')]));require(_0x064b('0xc'))[_0x064b('0xd')](socket);function respondWithRpcPromise(_0x4011ac,_0x10c8d2,_0x22d848){return new BPromise(function(_0x472e3d,_0x381aa7){return client['request'](_0x4011ac,_0x22d848)[_0x064b('0xe')](function(_0x4c1b9e){logger[_0x064b('0xf')](_0x064b('0x10'),_0x10c8d2,'request\x20sent');logger[_0x064b('0x11')](_0x064b('0x12'),_0x10c8d2,_0x064b('0x13'),JSON[_0x064b('0x14')](_0x4c1b9e));if(_0x4c1b9e[_0x064b('0x15')]){if(_0x4c1b9e['error'][_0x064b('0x16')]===0x1f4){logger[_0x064b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x10c8d2,_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);return _0x381aa7(_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);}logger[_0x064b('0x15')](_0x064b('0x10'),_0x10c8d2,_0x4c1b9e[_0x064b('0x15')][_0x064b('0x17')]);return _0x472e3d(_0x4c1b9e['error'][_0x064b('0x17')]);}else{logger[_0x064b('0xf')](_0x064b('0x10'),_0x10c8d2,_0x064b('0x13'));_0x472e3d(_0x4c1b9e[_0x064b('0x18')][_0x064b('0x17')]);}})['catch'](function(_0x2ec0a6){logger[_0x064b('0x15')](_0x064b('0x10'),_0x10c8d2,_0x2ec0a6);_0x381aa7(_0x2ec0a6);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b348ecf..ef2cf9b 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 _0xd147=['register','length','chatGroup:','./chatGroup.events','emit','removeListener'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd147,0xed));var _0x7d14=function(_0x1c4d19,_0x1500e8){_0x1c4d19=_0x1c4d19-0x0;var _0x1b539c=_0xd147[_0x1c4d19];return _0x1b539c;};'use strict';var ChatGroupEvents=require(_0x7d14('0x0'));var events=['save','remove','update'];function createListener(_0x51aca8,_0x473275){return function(_0x3aed43){_0x473275[_0x7d14('0x1')](_0x51aca8,_0x3aed43);};}function removeListener(_0x561986,_0x412909){return function(){ChatGroupEvents[_0x7d14('0x2')](_0x561986,_0x412909);};}exports[_0x7d14('0x3')]=function(_0x3f977c){for(var _0x437153=0x0,_0x24e1d5=events[_0x7d14('0x4')];_0x437153<_0x24e1d5;_0x437153++){var _0x30afd6=events[_0x437153];var _0x15727d=createListener(_0x7d14('0x5')+_0x30afd6,_0x3f977c);ChatGroupEvents['on'](_0x30afd6,_0x15727d);}}; \ No newline at end of file +var _0x368f=['./chatGroup.events','save','remove','update','emit','register','chatGroup:'];(function(_0x4c3495,_0x40601a){var _0x5b49a8=function(_0x4a1c7c){while(--_0x4a1c7c){_0x4c3495['push'](_0x4c3495['shift']());}};_0x5b49a8(++_0x40601a);}(_0x368f,0x69));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xf368('0x0'));var events=[_0xf368('0x1'),_0xf368('0x2'),_0xf368('0x3')];function createListener(_0x448d66,_0x2af10b){return function(_0x631dd){_0x2af10b[_0xf368('0x4')](_0x448d66,_0x631dd);};}function removeListener(_0x2c711f,_0x20e49f){return function(){ChatGroupEvents['removeListener'](_0x2c711f,_0x20e49f);};}exports[_0xf368('0x5')]=function(_0xa4d993){for(var _0x3d4e15=0x0,_0xcedb8a=events['length'];_0x3d4e15<_0xcedb8a;_0x3d4e15++){var _0x281f37=events[_0x3d4e15];var _0xbfcc70=createListener(_0xf368('0x6')+_0x281f37,_0xa4d993);ChatGroupEvents['on'](_0x281f37,_0xbfcc70);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index b17cf64..42492ae 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 _0xb084=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','exports','util','path'];(function(_0x5043f6,_0x327737){var _0x2f0adf=function(_0x53af5b){while(--_0x53af5b){_0x5043f6['push'](_0x5043f6['shift']());}};_0x2f0adf(++_0x327737);}(_0xb084,0x178));var _0x4b08=function(_0x4d2819,_0x477b2a){_0x4d2819=_0x4d2819-0x0;var _0x78d15f=_0xb084[_0x4d2819];return _0x78d15f;};'use strict';var multer=require('multer');var util=require(_0x4b08('0x0'));var path=require(_0x4b08('0x1'));var timeout=require(_0x4b08('0x2'));var express=require(_0x4b08('0x3'));var router=express['Router']();var fs_extra=require(_0x4b08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b08('0x5'));var config=require(_0x4b08('0x6'));var controller=require(_0x4b08('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b08('0x8')](_0x4b08('0x9'),auth[_0x4b08('0xa')](),controller[_0x4b08('0xb')]);router[_0x4b08('0x8')](_0x4b08('0xc'),auth['isAuthenticated'](),controller[_0x4b08('0xd')]);router[_0x4b08('0x8')]('/:id/unread',auth[_0x4b08('0xa')](),controller[_0x4b08('0xe')]);router['get'](_0x4b08('0xf'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x10')]);router[_0x4b08('0x8')]('/:id/messages',auth[_0x4b08('0xa')](),controller[_0x4b08('0x11')]);router[_0x4b08('0x12')]('/',auth[_0x4b08('0xa')](),controller[_0x4b08('0x13')]);router[_0x4b08('0x12')](_0x4b08('0xf'),auth['isAuthenticated'](),controller[_0x4b08('0x14')]);router[_0x4b08('0x12')](_0x4b08('0x15'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x16')]);router[_0x4b08('0x17')](_0x4b08('0xc'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x18')]);router[_0x4b08('0x19')](_0x4b08('0xc'),auth[_0x4b08('0xa')](),controller['destroy']);router[_0x4b08('0x19')](_0x4b08('0xf'),auth[_0x4b08('0xa')](),controller['removeMembers']);module[_0x4b08('0x1a')]=router; \ No newline at end of file +var _0x2e71=['getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread'];(function(_0x3965bb,_0x277675){var _0x25529c=function(_0x305891){while(--_0x305891){_0x3965bb['push'](_0x3965bb['shift']());}};_0x25529c(++_0x277675);}(_0x2e71,0xc9));var _0x12e7=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x2e71[_0xd511d];return _0x3f148e;};'use strict';var multer=require(_0x12e7('0x0'));var util=require(_0x12e7('0x1'));var path=require(_0x12e7('0x2'));var timeout=require(_0x12e7('0x3'));var express=require(_0x12e7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x12e7('0x5'));var interaction=require(_0x12e7('0x6'));var config=require('../../config/environment');var controller=require(_0x12e7('0x7'));router[_0x12e7('0x8')]('/',auth[_0x12e7('0x9')](),controller[_0x12e7('0xa')]);router['get'](_0x12e7('0xb'),auth['isAuthenticated'](),controller[_0x12e7('0xc')]);router['get'](_0x12e7('0xd'),auth[_0x12e7('0x9')](),controller[_0x12e7('0xe')]);router[_0x12e7('0x8')](_0x12e7('0xf'),auth[_0x12e7('0x9')](),controller[_0x12e7('0x10')]);router[_0x12e7('0x8')](_0x12e7('0x11'),auth[_0x12e7('0x9')](),controller[_0x12e7('0x12')]);router['get'](_0x12e7('0x13'),auth['isAuthenticated'](),controller[_0x12e7('0x14')]);router[_0x12e7('0x15')]('/',auth['isAuthenticated'](),controller[_0x12e7('0x16')]);router[_0x12e7('0x15')](_0x12e7('0x11'),auth['isAuthenticated'](),controller[_0x12e7('0x17')]);router['post'](_0x12e7('0x13'),auth[_0x12e7('0x9')](),controller[_0x12e7('0x18')]);router[_0x12e7('0x19')](_0x12e7('0xd'),auth['isAuthenticated'](),controller[_0x12e7('0x1a')]);router[_0x12e7('0x1b')](_0x12e7('0xd'),auth[_0x12e7('0x9')](),controller[_0x12e7('0x1c')]);router[_0x12e7('0x1b')](_0x12e7('0x11'),auth[_0x12e7('0x9')](),controller[_0x12e7('0x1d')]);module[_0x12e7('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4c87b00..ed80a7a 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 _0xb78e=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0xb78e,0x1c9));var _0xeb78=function(_0x275f94,_0x2b723a){_0x275f94=_0x275f94-0x0;var _0x302f39=_0xb78e[_0x275f94];return _0x302f39;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb78('0x2')]},'ratingType':{'type':Sequelize[_0xeb78('0x3')](_0xeb78('0x4'),_0xeb78('0x5')),'defaultValue':_0xeb78('0x4')},'ratingMessage':{'type':Sequelize[_0xeb78('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb78('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb78('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb78('0x7')]},'secondDisposition':{'type':Sequelize[_0xeb78('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeb78('0x7')]},'note':{'type':Sequelize[_0xeb78('0x7')]},'browserName':{'type':Sequelize[_0xeb78('0x7')]},'browserVersion':{'type':Sequelize[_0xeb78('0x7')]},'osName':{'type':Sequelize[_0xeb78('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xeb78('0x7')]},'deviceVendor':{'type':Sequelize[_0xeb78('0x7')]},'deviceType':{'type':Sequelize[_0xeb78('0x7')]},'referer':{'type':Sequelize[_0xeb78('0x6')]},'customerIp':{'type':Sequelize[_0xeb78('0x7')]},'formData':{'type':Sequelize[_0xeb78('0x6')](_0xeb78('0x8'))},'read1stAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xeb78('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb78('0x7')]},'customerPort':{'type':Sequelize[_0xeb78('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeb78('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeb78('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x97f5=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN','star','thumb','TEXT'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x97f5,0x72));var _0x597f=function(_0x5e43b1,_0x199a89){_0x5e43b1=_0x5e43b1-0x0;var _0x53e4b3=_0x97f5[_0x5e43b1];return _0x53e4b3;};'use strict';var Sequelize=require(_0x597f('0x0'));module[_0x597f('0x1')]={'closed':{'type':Sequelize[_0x597f('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x597f('0x3'),_0x597f('0x4')),'defaultValue':_0x597f('0x3')},'ratingMessage':{'type':Sequelize[_0x597f('0x5')]},'pathTranscript':{'type':Sequelize[_0x597f('0x5')]},'mailTranscript':{'type':Sequelize[_0x597f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x597f('0x7')]},'disposition':{'type':Sequelize[_0x597f('0x6')]},'secondDisposition':{'type':Sequelize[_0x597f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x597f('0x6')]},'browserName':{'type':Sequelize[_0x597f('0x6')]},'browserVersion':{'type':Sequelize[_0x597f('0x6')]},'osName':{'type':Sequelize[_0x597f('0x6')]},'osVersion':{'type':Sequelize[_0x597f('0x6')]},'deviceModel':{'type':Sequelize[_0x597f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x597f('0x6')]},'referer':{'type':Sequelize[_0x597f('0x5')]},'customerIp':{'type':Sequelize[_0x597f('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x597f('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x597f('0x8')]('in',_0x597f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x597f('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x597f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x597f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8d3d7ac..68b673f 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 _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','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','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x2d3a8c,_0x5f4f76){var _0x95bfa9=function(_0x30be22){while(--_0x30be22){_0x2d3a8c['push'](_0x2d3a8c['shift']());}};_0x95bfa9(++_0x5f4f76);}(_0xd943,0x15d));var _0x3d94=function(_0x4666d8,_0x4b7be9){_0x4666d8=_0x4666d8-0x0;var _0x39cc49=_0xd943[_0x4666d8];return _0x39cc49;};'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 pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('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');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));}; \ No newline at end of file +var _0x1a85=['System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','nolimit','includeAgent','rows','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','body','contact','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','params','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','isNull','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','CmContact','%s%d','agentAlias'];(function(_0x3771ca,_0x348dee){var _0x2db45b=function(_0xeb1d76){while(--_0xeb1d76){_0x3771ca['push'](_0x3771ca['shift']());}};_0x2db45b(++_0x348dee);}(_0x1a85,0x178));var _0x51a8=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x1a85[_0x2ad008];return _0x4538cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var pdf=require(_0x51a8('0x10'));var hardwareService=require(_0x51a8('0x11'));var logger=require(_0x51a8('0x12'))(_0x51a8('0x13'));var utils=require(_0x51a8('0x14'));var config=require(_0x51a8('0x15'));var licenseUtil=require(_0x51a8('0x16'));var db=require(_0x51a8('0x17'))['db'];config[_0x51a8('0x18')]=_[_0x51a8('0x19')](config[_0x51a8('0x18')],{'host':_0x51a8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51a8('0x18')]));require(_0x51a8('0x1b'))[_0x51a8('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0x51a8('0x1d')][_0x51a8('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x39cd45,_0x2b0521,_0x3fbd02,_0x3e0603){return new BPromise(function(_0x1f49ee,_0x516abc){var _0x1c2f25=_0x3e0603||client;return _0x1c2f25[_0x51a8('0x1f')](_0x39cd45,_0x3fbd02)[_0x51a8('0x20')](function(_0x23539e){logger[_0x51a8('0x21')](_0x51a8('0x22'),_0x2b0521,'request\x20sent');logger[_0x51a8('0x23')](_0x51a8('0x24'),_0x2b0521,_0x51a8('0x25'),JSON[_0x51a8('0x26')](_0x23539e));if(_0x23539e[_0x51a8('0x27')]){if(_0x23539e[_0x51a8('0x27')][_0x51a8('0x28')]===0x1f4){logger[_0x51a8('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x23539e[_0x51a8('0x27')]['message']);return _0x516abc(_0x23539e[_0x51a8('0x27')][_0x51a8('0x29')]);}logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x23539e['error'][_0x51a8('0x29')]);return _0x1f49ee(_0x23539e['error']['message']);}else{logger[_0x51a8('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x51a8('0x25'));_0x1f49ee(_0x23539e[_0x51a8('0x2a')][_0x51a8('0x29')]);}})[_0x51a8('0x2b')](function(_0x157554){logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x157554);_0x516abc(_0x157554);});});}function respondWithStatusCode(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0xcc;return function(_0x273ce2){if(_0x273ce2){return _0x1326a2[_0x51a8('0x2c')](_0x5b3f49);}return _0x1326a2[_0x51a8('0x2d')](_0x5b3f49)[_0x51a8('0x2e')]();};}function respondWithResult(_0x1c150d,_0x11aefc){_0x11aefc=_0x11aefc||0xc8;return function(_0x1a886f){if(_0x1a886f){return _0x1c150d[_0x51a8('0x2d')](_0x11aefc)[_0x51a8('0x2f')](_0x1a886f);}};}function respondWithFilteredResult(_0x4b5cda,_0x20c6b5){return function(_0x347a02){if(_0x347a02){var _0x4a1548=typeof _0x20c6b5[_0x51a8('0x30')]==='undefined'&&typeof _0x20c6b5[_0x51a8('0x31')]===_0x51a8('0x32');var _0x143f46=_0x347a02[_0x51a8('0x33')];var _0x2136b4=_0x4a1548?0x0:_0x20c6b5['offset'];var _0x10c19b=_0x4a1548?_0x347a02['count']:_0x20c6b5[_0x51a8('0x30')]+_0x20c6b5[_0x51a8('0x31')];var _0x253a59;if(_0x10c19b>=_0x143f46){_0x10c19b=_0x143f46;_0x253a59=0xc8;}else{_0x253a59=0xce;}_0x4b5cda['status'](_0x253a59);return _0x4b5cda[_0x51a8('0x34')]('Content-Range',_0x2136b4+'-'+_0x10c19b+'/'+_0x143f46)[_0x51a8('0x2f')](_0x347a02);}return null;};}function patchUpdates(_0x192ac4){return function(_0x1ba6a7){try{jsonpatch[_0x51a8('0x35')](_0x1ba6a7,_0x192ac4,!![]);}catch(_0x193e0f){return BPromise['reject'](_0x193e0f);}return _0x1ba6a7[_0x51a8('0x36')]();};}function saveUpdates(_0x53b3b6,_0x9f0e6){return function(_0x2d977b){if(_0x2d977b){return _0x2d977b[_0x51a8('0x37')](_0x53b3b6)['then'](function(_0x1f9cfc){return _0x1f9cfc;});}return null;};}function removeEntity(_0xdc6cc7,_0x2b7833){return function(_0x2429f8){if(_0x2429f8){return _0x2429f8[_0x51a8('0x38')]()['then'](function(){_0xdc6cc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b871,_0x299001){return function(_0x4ec1db){if(!_0x4ec1db){_0x21b871[_0x51a8('0x2c')](0x194);}return _0x4ec1db;};}function handleError(_0x4ec0ac,_0x13723b){_0x13723b=_0x13723b||0x1f4;return function(_0x38aa25){logger[_0x51a8('0x27')](_0x38aa25[_0x51a8('0x39')]);if(_0x38aa25[_0x51a8('0x3a')]){delete _0x38aa25[_0x51a8('0x3a')];}_0x4ec0ac['status'](_0x13723b)['send'](_0x38aa25);};}function getMustacheRender(_0x377b4c,_0x5f524e){return Mustache['render'](_0x377b4c,_['merge'](_0x5f524e[_0x51a8('0x3b')],{'contact':_0x5f524e[_0x51a8('0x3c')],'message':_0x5f524e[_0x51a8('0x29')],'agent':_0x5f524e['agent'],'interaction':_0x5f524e[_0x51a8('0x3d')],'account':_0x5f524e[_0x51a8('0x3e')]}))||'';}function getInteractionUsers(_0x2e6432,_0x310ad2){return new BPromise(function(_0x5d3983,_0x19fa98){try{if(_0x310ad2[_0x2e6432['id']]){_0x2e6432[_0x51a8('0x3f')]=_[_0x51a8('0x40')](_0x310ad2[_0x2e6432['id']],function(_0x4dcbfb){return{'id':_0x4dcbfb['id'],'fullname':_0x4dcbfb[_0x51a8('0x41')]};});}}catch(_0x51d7bd){_0x19fa98(_0x51d7bd);}_0x5d3983(_0x2e6432);});}function getInteractionTags(_0x2032c0,_0x1e637a){return new BPromise(function(_0x2a98bd,_0x37d50b){try{if(_0x2032c0['TagIds']){_0x2032c0[_0x51a8('0x42')]=[];_0x2032c0[_0x51a8('0x43')][_0x51a8('0x44')](',')[_0x51a8('0x45')](function(_0xa33fc){_0x2032c0[_0x51a8('0x42')][_0x51a8('0x46')](_0x1e637a[_0xa33fc]);});}delete _0x2032c0[_0x51a8('0x43')];}catch(_0x3b15c7){_0x37d50b(_0x3b15c7);}_0x2a98bd(_0x2032c0);});}function updateChatInteraction(_0x4b8467,_0x22e6e6,_0x2afb74){return new BPromise(function(_0x4c7c67,_0x53409d){return getInteractionUsers(_0x4b8467,_0x2afb74)[_0x51a8('0x20')](function(_0x19a57c){return getInteractionTags(_0x19a57c,_0x22e6e6);})[_0x51a8('0x20')](function(_0x27b8e5){_0x4c7c67(_0x27b8e5);})[_0x51a8('0x2b')](function(_0x157a51){_0x53409d(_0x157a51);});});}exports[_0x51a8('0x47')]=function(_0x18c697,_0x26ad89){var _0x2e80ed={},_0x4bdee0={},_0x416988={'count':0x0,'rows':[]};var _0x218ae0=_[_0x51a8('0x40')](db[_0x51a8('0x48')][_0x51a8('0x49')],function(_0x22ff0e){return{'name':_0x22ff0e['fieldName'],'type':_0x22ff0e[_0x51a8('0x4a')]['key']};});_0x4bdee0[_0x51a8('0x4b')]=_[_0x51a8('0x40')](_0x218ae0,_0x51a8('0x3a'));_0x4bdee0[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x18c697['query']);_0x4bdee0['filters']=_[_0x51a8('0x4e')](_0x4bdee0[_0x51a8('0x4b')],_0x4bdee0[_0x51a8('0x4c')]);_0x2e80ed[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4bdee0['model'],qs['fields'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2e80ed[_0x51a8('0x4f')]=_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x51')]?_0x2e80ed[_0x51a8('0x4f')]:_0x4bdee0[_0x51a8('0x4b')];if(!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x52')]('nolimit')){_0x2e80ed['limit']=qs['limit'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x31')]);_0x2e80ed[_0x51a8('0x30')]=qs['offset'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2e80ed['order']=qs[_0x51a8('0x53')](_0x18c697['query']['sort']);_0x2e80ed[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x18c697['query'],_0x4bdee0['filters']),_0x218ae0);var _0x3a8f1e=[];var _0x5b0398=squel[_0x51a8('0x57')]()[_0x51a8('0x58')]('id')[_0x51a8('0x58')](_0x51a8('0x3a'))[_0x51a8('0x58')](_0x51a8('0x59'))[_0x51a8('0x5a')](_0x51a8('0x5b'));var _0x29d31e=squel['select']()[_0x51a8('0x58')](_0x51a8('0x5c'))[_0x51a8('0x58')](_0x51a8('0x5d'))['field'](_0x51a8('0x5e'))['from'](_0x51a8('0x5f'),'ui')[_0x51a8('0x60')]('users','u','u.id\x20=\x20ui.UserId');var _0x2628d4=squel[_0x51a8('0x57')]()[_0x51a8('0x5a')](_0x51a8('0x61'),'i')[_0x51a8('0x60')]('cm_contacts','c',_0x51a8('0x62'))[_0x51a8('0x60')](_0x51a8('0x63'),'o',_0x51a8('0x64'))[_0x51a8('0x60')]('chat_websites','a',_0x51a8('0x65'))[_0x51a8('0x60')](_0x51a8('0x66'),'me',_0x51a8('0x67'))[_0x51a8('0x60')](_0x51a8('0x68'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2048c6=squel[_0x51a8('0x69')]();var _0x51f9f7=[];var _0x7ac0ae=squel['expr']();var _0x41cc00;if(_0x18c697['query'][_0x51a8('0x6a')]){_0x41cc00=as[_0x51a8('0x6b')](_0x18c697['query']['search']);var _0x5eb540=_0x41cc00[_0x51a8('0x6c')];for(var _0x1ead77=0x0;_0x1ead77<_0x41cc00[_0x51a8('0x6d')][_0x51a8('0x51')];_0x1ead77++){var _0x149047=_0x41cc00[_0x51a8('0x6d')][_0x1ead77];var _0x3fd347='i';var _0x259153=_['find'](_0x218ae0,[_0x51a8('0x3a'),_0x149047[_0x51a8('0x58')]]);if(!_0x259153){switch(_0x149047['field']){case _0x51a8('0x6e'):if(_0x149047[_0x51a8('0x6f')]==0x1){_0x2628d4[_0x51a8('0x70')]('`'+_0x149047[_0x51a8('0x58')]+_0x51a8('0x71'));}else{_0x2628d4[_0x51a8('0x70')]('`'+_0x149047['field']+'`\x20>\x200');}break;case _0x51a8('0x72'):if(_0x149047['operator']==='$substring'){if(_0x149047['value']['split']('\x20')['length']>0x1){_0x2048c6[_0x5eb540](_0x51a8('0x73'),qs['getFullTextValue'](_0x149047[_0x51a8('0x6f')]),null);}else{var _0x4772cd='%'+_0x149047[_0x51a8('0x6f')]+'%';_0x2048c6[_0x5eb540](_0x51a8('0x74'),_0x4772cd,_0x4772cd,_0x4772cd);}}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),_0x51a8('0x76')]);_0x149047[_0x51a8('0x58')]=_0x51a8('0x76');_0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074['value']['end']);}break;case'Tag':var _0x10c22e=_0x149047[_0x51a8('0x6f')][_0x51a8('0x44')](',')[_0x51a8('0x40')](function(_0x2efb36){return Number(_0x2efb36);});_0x10c22e[_0x51a8('0x45')](function(_0x351c22){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x351c22+',%');});_0x51f9f7=_[_0x51a8('0x7b')](_0x51f9f7,_0x10c22e);break;case _0x51a8('0x7c'):if(_0x149047[_0x51a8('0x7d')]===_0x51a8('0x7e')){_0x2048c6[_0x5eb540](_0x51a8('0x7f'),'%'+_0x149047['value']+'%',null);}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),'UserId']);_0x149047[_0x51a8('0x58')]='UserId';_0x238074=as['buildExpression'](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);}break;case _0x51a8('0x3b'):_0x238074=as[_0x51a8('0x77')]('me',null,_0x149047);_0x2048c6[_0x5eb540](_0x238074['text'],_0x238074['value']['start'],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);break;}}else{var _0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153[_0x51a8('0x4a')],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074['value'][_0x51a8('0x79')],_0x238074['value'][_0x51a8('0x2e')]);}}}else{var _0x1be70f=_(_0x18c697[_0x51a8('0x4c')])[_0x51a8('0x4d')]()[_0x51a8('0x40')](function(_0x3aca4a){return _[_0x51a8('0x80')](_0x218ae0,[_0x51a8('0x3a'),_0x3aca4a])?_0x3aca4a:undefined;})[_0x51a8('0x81')]()[_0x51a8('0x6f')]();if(!_[_0x51a8('0x82')](_0x1be70f)){_0x1be70f['forEach'](function(_0x4b99cb){if(_0x4b99cb===_0x51a8('0x83')){_0x2628d4[_0x51a8('0x54')](_0x51a8('0x84'),[][_0x51a8('0x85')](_0x18c697['query'][_0x4b99cb]));}else if(_0x4b99cb===_0x51a8('0x86')){var _0x4d418a=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x88')];var _0x24fcc3=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x89')];_0x2628d4[_0x51a8('0x54')](_0x51a8('0x8a'),_0x4d418a,_0x24fcc3);}else{if(_0x18c697['query'][_0x4b99cb]===_0x51a8('0x8b')){_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+_0x51a8('0x8c'));}else{_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+'\x20=\x20?',_0x18c697['query'][_0x4b99cb]);}}});}if(_0x18c697[_0x51a8('0x4c')]['read']){if(_0x18c697['query']['read']==0x1){_0x2628d4[_0x51a8('0x70')]('`unreadMessages`\x20=\x200');}else{_0x2628d4['having'](_0x51a8('0x8d'));}}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]){_0x51f9f7=_['isArray'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')])?_0x18c697[_0x51a8('0x4c')]['tag']:new Array(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]);_0x51f9f7[_0x51a8('0x45')](function(_0x16e90a){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x16e90a+',%');});}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8f')]){var _0x245f5b=_0x18c697[_0x51a8('0x4c')]['filter'][_0x51a8('0x90')]('\x5c','\x5c\x5c')[_0x51a8('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x245f5b)){_0x2048c6['or'](_0x51a8('0x91'),_0x245f5b+'%');}else{_0x2048c6['or'](_0x51a8('0x92'),qs['getFullTextValue'](_0x245f5b))['or'](_0x51a8('0x93'),_0x245f5b+'%');}}}_0x2628d4[_0x51a8('0x54')](_0x2048c6);_0x2628d4[_0x51a8('0x94')](_0x51a8('0x95'));var _0x398fb2={'type':db['Sequelize'][_0x51a8('0x96')][_0x51a8('0x97')],'raw':!![]};var _0x12d018=_0x2628d4[_0x51a8('0x98')]();_0x12d018['field'](_0x51a8('0x95'));_0x12d018[_0x51a8('0x58')](_0x51a8('0x99'),_0x51a8('0x6e'));if(_0x2e80ed[_0x51a8('0x9a')]){_0x2e80ed[_0x51a8('0x9a')][_0x51a8('0x45')](function(_0xd22e7b){var _0x540c86=_0xd22e7b[0x0]===_0x51a8('0x9b')?_0xd22e7b[0x0]:'i.'+_0xd22e7b[0x0];_0x2628d4[_0x51a8('0x9a')](_0x540c86,_0xd22e7b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x51a8('0x82')](_0x51f9f7)){_0x2628d4[_0x51a8('0x70')](_0x7ac0ae);_0x12d018['where'](_0x51a8('0x9c'),_0x51f9f7);}BPromise['resolve']()['then'](function(){if(!_0x41cc00){if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return;_0x12d018[_0x51a8('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2628d4['where'](_0x51a8('0x9d'));return;}if(_0x18c697['user'][_0x51a8('0x9e')]!==_0x51a8('0x9f'))return;return _0x18c697[_0x51a8('0xa0')][_0x51a8('0xa1')]({'attributes':['id'],'raw':!![]})[_0x51a8('0x20')](function(_0x28acb8){if(_[_0x51a8('0x82')](_0x28acb8)){_0x12d018[_0x51a8('0x54')](_0x51a8('0xa2'));_0x2628d4[_0x51a8('0x54')](_0x51a8('0xa2'));}else{_0x12d018[_0x51a8('0x54')](_0x51a8('0x84'),_[_0x51a8('0x40')](_0x28acb8,'id'));_0x2628d4[_0x51a8('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x28acb8,'id'));}});})[_0x51a8('0x20')](function(){if(_0x18c697['user']['role']==='agent'&&!_0x41cc00&&!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return[];return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x12d018['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x343fec){_0x416988['count']=_0x343fec[_0x51a8('0x51')];if(_0x416988[_0x51a8('0x33')]===0x0)return[];return db['sequelize']['query'](_0x5b0398[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x8587b9){_0x3a8f1e=_[_0x51a8('0xa5')](_0x8587b9,'id');_0x398fb2=_[_0x51a8('0xa6')](_0x398fb2,{'model':db[_0x51a8('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18c697['query'][_0x51a8('0x50')]){_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x45')](function(_0x566d62){_0x2628d4[_0x51a8('0x58')]('i.'+_0x566d62);});}else{_0x2628d4[_0x51a8('0x58')](_0x51a8('0x99'),'unreadMessages');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa7'),'Account.key');_0x2628d4[_0x51a8('0x58')]('a.mandatoryDisposition',_0x51a8('0xa8'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa9'),_0x51a8('0x9b'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xaa'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xab'),'Contact.firstName');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xac'),_0x51a8('0xad'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xae'),'Contact.email');_0x2628d4['field'](_0x51a8('0xaf'),_0x51a8('0xb0'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb1'),_0x51a8('0xb2'));_0x2628d4['field'](_0x51a8('0xb3'),'Contact.fax');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb4'),'Owner.fullname');_0x2628d4[_0x51a8('0x58')]('o.internal',_0x51a8('0xb5'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb6'),_0x51a8('0x43'));}if(_0x2e80ed[_0x51a8('0x31')])_0x2628d4['limit'](_0x2e80ed[_0x51a8('0x31')]);if(_0x2e80ed[_0x51a8('0x30')])_0x2628d4['offset'](_0x2e80ed[_0x51a8('0x30')]);return db[_0x51a8('0xa3')]['query'](_0x2628d4['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x158c45){if(_0x158c45[_0x51a8('0x51')]>0x0)_0x29d31e['where'](_0x51a8('0xb7'),_[_0x51a8('0x40')](_0x158c45,'id'));return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x29d31e[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x30bf44){var _0x5a32ce=_[_0x51a8('0xb8')](_0x30bf44,_0x51a8('0xb9'));var _0xa29735=[];_0x158c45[_0x51a8('0x45')](function(_0x4ef066){_0xa29735['push'](updateChatInteraction(_0x4ef066,_0x3a8f1e,_0x5a32ce));});return BPromise[_0x51a8('0xba')](_0xa29735);});});})[_0x51a8('0x20')](function(_0x58b25d){_0x416988['rows']=_0x58b25d;return _0x416988;})['then'](respondWithFilteredResult(_0x26ad89,_0x2e80ed))[_0x51a8('0x2b')](handleError(_0x26ad89,null));};exports['show']=function(_0x47c025,_0x517de1){var _0x2164d7={'raw':![],'where':{'id':_0x47c025[_0x51a8('0xbb')]['id']}},_0x4b03f7={};_0x4b03f7[_0x51a8('0x4b')]=_['keys'](db['ChatInteraction'][_0x51a8('0x49')]);_0x4b03f7['query']=_[_0x51a8('0x4d')](_0x47c025[_0x51a8('0x4c')]);_0x4b03f7['filters']=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],_0x4b03f7['query']);_0x2164d7[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],qs['fields'](_0x47c025[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2164d7[_0x51a8('0x4f')]=_0x2164d7['attributes']['length']?_0x2164d7[_0x51a8('0x4f')]:_0x4b03f7[_0x51a8('0x4b')];if(_0x47c025[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2164d7[_0x51a8('0xbd')]=[{'all':!![]}];}_0x2164d7=_[_0x51a8('0xa6')]({},_0x2164d7,_0x47c025[_0x51a8('0xbe')]);return db[_0x51a8('0x48')][_0x51a8('0x75')](_0x2164d7)[_0x51a8('0x20')](handleEntityNotFound(_0x517de1,null))[_0x51a8('0x20')](respondWithResult(_0x517de1,null))[_0x51a8('0x2b')](handleError(_0x517de1,null));};exports[_0x51a8('0xbf')]=function(_0x575c51,_0x4fdc39){return db[_0x51a8('0x48')][_0x51a8('0xbf')](_0x575c51[_0x51a8('0x3b')],{})[_0x51a8('0x20')](respondWithResult(_0x4fdc39,0xc9))[_0x51a8('0x2b')](handleError(_0x4fdc39,null));};exports['update']=function(_0x59a17d,_0x39e8e6){if(_0x59a17d[_0x51a8('0x3b')]['id']){delete _0x59a17d['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x59a17d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x39e8e6,null))[_0x51a8('0x20')](saveUpdates(_0x59a17d['body'],null))['then'](respondWithResult(_0x39e8e6,null))[_0x51a8('0x2b')](handleError(_0x39e8e6,null));};exports['destroy']=function(_0x96219,_0x5bd9a6){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x96219['params']['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x5bd9a6,null))[_0x51a8('0x20')](removeEntity(_0x5bd9a6,null))[_0x51a8('0x2b')](handleError(_0x5bd9a6,null));};exports[_0x51a8('0xc0')]=function(_0x5cacc1,_0x57b718){return db[_0x51a8('0x48')][_0x51a8('0xc0')]()[_0x51a8('0x20')](respondWithResult(_0x57b718,null))[_0x51a8('0x2b')](handleError(_0x57b718,null));};exports['createVidaooSession']=function(_0xaaa86f,_0x5ebf39){var _0x40a229=_0xaaa86f['params']['id'];var _0x1d03c1;var _0x1667b7;var _0x1ae73c;return db[_0x51a8('0x48')]['findOne']({'where':{'id':_0x40a229}})[_0x51a8('0x20')](function(_0x50ced7){_0x1d03c1=_0x50ced7;return db[_0x51a8('0xc1')][_0x51a8('0xc2')]({'where':{'id':_0x50ced7[_0x51a8('0x83')]},'attributes':['id','vidaooApiKey',_0x51a8('0xc3'),_0x51a8('0xc4'),_0x51a8('0xc5'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x14792a){if(_0x14792a&&_0x14792a[_0x51a8('0xc6')]&&_0x14792a[_0x51a8('0xc3')]){_0x1667b7=_0x14792a;var _0x706653={'interaction':{'id':_0x40a229},'agent':{'id':_0xaaa86f['user']['id'],'name':_0xaaa86f['user'][_0x51a8('0x3a')],'fullname':_0xaaa86f['user'][_0x51a8('0x41')],'email':_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]},'contact':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3c')],'account':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3e')]};var _0x5ec5f2={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x14792a[_0x51a8('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]],'buttons':null,'topic':_0x1667b7[_0x51a8('0xc4')],'note':_[_0x51a8('0xc8')](_0x1667b7['vidaooNote'])?null:getMustacheRender(_0x1667b7[_0x51a8('0xc5')],_0x706653),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x51a8('0xc8')](_0x1667b7[_0x51a8('0xc9')])){var _0x1dcdd9=getMustacheRender(_0x1667b7[_0x51a8('0xc9')],_0x706653);var _0x55d905=JSON['parse'](_0x1dcdd9);_0x5ec5f2[_0x51a8('0x3b')]['metadata']=_0x55d905;}}catch(_0x289366){throw new db[(_0x51a8('0xca'))][(_0x51a8('0xcb'))](_0x51a8('0xcc'));}return rp(_0x5ec5f2);}else{throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xcd'));}})[_0x51a8('0x20')](function(_0x26e672){_0x1ae73c=_0x26e672;if(_0x1ae73c['id']){var _0x3dbfd7={'body':_0x1ae73c[_0x51a8('0xce')],'ChatWebsiteId':_0x1667b7['id'],'ChatInteractionId':_0x1d03c1['id'],'direction':_0x51a8('0xcf'),'UserId':_0xaaa86f[_0x51a8('0xa0')]['id']};return db[_0x51a8('0xd0')][_0x51a8('0xbf')](_0x3dbfd7,{});}else{throw new db[(_0x51a8('0xca'))]['ValidationError'](_0x51a8('0xd1'));}})[_0x51a8('0x20')](function(){return _0x1d03c1[_0x51a8('0xd2')]({'vidaooSessionId':_0x1ae73c['id']});})[_0x51a8('0x20')](respondWithResult(_0x5ebf39,null))[_0x51a8('0x2b')](handleError(_0x5ebf39,null));};exports['customUpdate']=function(_0x3ed105,_0x4a48b4){if(_0x3ed105[_0x51a8('0x3b')]['id']){delete _0x3ed105['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x3ed105[_0x51a8('0xbb')]['id']},'include':[{'model':db['CmContact'],'as':_0x51a8('0x72')}]})[_0x51a8('0x20')](handleEntityNotFound(_0x4a48b4,null))[_0x51a8('0x20')](saveUpdates(_0x3ed105[_0x51a8('0x3b')],null))['then'](respondWithResult(_0x4a48b4,null))['catch'](handleError(_0x4a48b4,null));};exports['abandon']=function(_0x1e957d,_0x5ed8f1,_0x5ee996){if(_0x1e957d[_0x51a8('0x3b')]['id']){delete _0x1e957d[_0x51a8('0x3b')]['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x1e957d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](function(_0x5b316b){if(!_0x5b316b){logger[_0x51a8('0x27')](_0x51a8('0xd3'),'abandon',0x194,'entity\x20not\x20found');_0x5ed8f1[_0x51a8('0x2c')](0x194);}else{if(_0x5b316b[_0x51a8('0xd4')]){throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xd5'));}}return _0x5b316b;})[_0x51a8('0x20')](function(_0x3dbaa0){if(_0x3dbaa0){return _0x3dbaa0[_0x51a8('0x37')]({'closed':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd6')],'disposition':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd7')]})[_0x51a8('0x20')](function(_0xc7c551){return _0xc7c551;});}})[_0x51a8('0x20')](function(_0x441b16){return respondWithRpcPromise(_0x51a8('0xd8'),_0x51a8('0xd9'),_0x1e957d['body'],client9004);})[_0x51a8('0x20')](respondWithResult(_0x5ed8f1,null))[_0x51a8('0x2b')](handleError(_0x5ed8f1,null));};exports['attachmentUpload']=function(_0xbc8168,_0x1d9439,_0x4b137c){_0xbc8168[_0x51a8('0x3b')]['name']=_0xbc8168['file'][_0x51a8('0xda')];_0xbc8168['body'][_0x51a8('0xdb')]=_0xbc8168[_0x51a8('0xdc')][_0x51a8('0xdd')];_0xbc8168[_0x51a8('0x3b')]['type']=_0xbc8168['file']['mimetype'];return db['Attachment'][_0x51a8('0xbf')](_0xbc8168[_0x51a8('0x3b')])[_0x51a8('0x20')](respondWithResult(_0x1d9439,0xc9))[_0x51a8('0x2b')](handleError(_0x1d9439,null));};exports[_0x51a8('0xde')]=function(_0x953f85,_0x2d5307,_0x4d7035){return db['ChatInteraction'][_0x51a8('0xc2')]({'where':{'id':_0x953f85['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null))[_0x51a8('0x20')](function(_0x33bea4){if(_0x33bea4){if(_0x33bea4[_0x51a8('0xd6')]){return _0x2d5307[_0x51a8('0x2d')](0x193)[_0x51a8('0x2f')]({'status':0x193,'message':_0x51a8('0xdf')});}return db[_0x51a8('0xe0')][_0x51a8('0xc2')]({'where':{'id':_0x953f85[_0x51a8('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null));}})[_0x51a8('0x20')](function(_0x2d95eb){if(_0x2d95eb){var _0x2559e0=_0x2d95eb[_0x51a8('0xe1')]!==null;var _0x441034=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0xe4'));if(_0x2559e0){_0x441034=path[_0x51a8('0xe2')](_0x441034,_0x51a8('0xe5'));}var _0x4a55c0=path['join'](_0x441034,_0x2d95eb['basename']);return _0x2d5307[_0x51a8('0xe6')](_0x4a55c0);}})[_0x51a8('0x2b')](handleError(_0x2d5307,null));};exports[_0x51a8('0xe7')]=function(_0x58c6df,_0x44fa71){var _0x18179c=null;var _0x17cb9f=null;var _0x43b1d2=null;var _0x4f8535=null;if(_0x58c6df[_0x51a8('0x3b')]['id']){delete _0x58c6df[_0x51a8('0x3b')]['id'];}if(_0x58c6df['body'][_0x51a8('0xe8')]){_0x4f8535=path['join'](config[_0x51a8('0xe3')],_0x51a8('0xe9'),util[_0x51a8('0xea')](_0x51a8('0xeb'),Date['now']()));_0x58c6df[_0x51a8('0x3b')]['pathTranscript']=_0x4f8535;}return db['ChatInteraction'][_0x51a8('0x75')]({'where':{'id':_0x58c6df[_0x51a8('0xbb')]['id']},'include':[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'include':[{'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c')}]}]})[_0x51a8('0x20')](handleEntityNotFound(_0x44fa71,null))['then'](saveUpdates(_0x58c6df[_0x51a8('0x3b')],null))[_0x51a8('0x20')](function(_0x7aa19f){if(_0x7aa19f){_0x18179c=_0x7aa19f;return db[_0x51a8('0xc1')]['find']({'where':{'id':_0x18179c[_0x51a8('0x83')]}});}})[_0x51a8('0x20')](function(_0x350385){if(_0x350385){_0x43b1d2=_0x350385;return db[_0x51a8('0xed')]['find']({'where':{'id':_0x18179c[_0x51a8('0x76')]}});}})[_0x51a8('0x20')](function(_0x584235){if(_0x584235){_0x17cb9f=_0x584235;if(_0x4f8535){var _0x206c27=null;for(var _0x500112=0x1;_0x500112<_0x18179c[_0x51a8('0xec')][_0x51a8('0x51')];++_0x500112){_0x206c27=_0x18179c[_0x51a8('0xec')][_0x500112];var _0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');var _0x5c78b9=_0x58c6df['body'][_0x51a8('0xf1')]||util['format'](_0x51a8('0xee'),_0x51a8('0xf2'),_0x206c27[_0x51a8('0x76')]);switch(_0x43b1d2[_0x51a8('0xf3')]){case _0x51a8('0xf4'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')]('%s%d',_0x43b1d2['agentAlias'],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');break;case _0x51a8('0xf5'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27[_0x51a8('0x7c')][_0x51a8('0xf6')]||_0x206c27[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0');break;case _0x51a8('0xf7'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27['User']['fullname']:_0x51a8('0xf0');break;default:_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):'System';}var _0x13fb74=util[_0x51a8('0xea')]('[%s]\x20%s:\x20%s\x0a',moment(_0x206c27[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0xf8')),_0x206c27[_0x51a8('0xf9')]==='in'?_0x5c78b9:_0x24a6a8,_0x206c27['body']);if(!_0x206c27[_0x51a8('0xfa')]){fs[_0x51a8('0xfb')](_0x4f8535,_0x13fb74);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x51a8('0xfc')],'as':_0x51a8('0xfd'),'raw':!![]}]});}}})[_0x51a8('0x20')](function(_0x359e42){if(_0x359e42&&_0x359e42[_0x51a8('0xfd')]&&_0x58c6df[_0x51a8('0x3b')]){var _0x4eeff2={'tls':{'rejectUnauthorized':![]}};if(_0x359e42[_0x51a8('0xfd')]['service']){_0x4eeff2[_0x51a8('0xfe')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xfe')];}else{_0x4eeff2['host']=_0x359e42[_0x51a8('0xfd')]['host'];_0x4eeff2[_0x51a8('0xff')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xff')];_0x4eeff2['secure']=_0x359e42[_0x51a8('0xfd')][_0x51a8('0x100')];}if(_0x359e42[_0x51a8('0xfd')][_0x51a8('0x101')]){_0x4eeff2[_0x51a8('0x102')]={'user':_0x359e42[_0x51a8('0xfd')]['user'],'pass':_0x359e42['Smtp'][_0x51a8('0x103')]};}return respondWithRpcPromise(_0x51a8('0x104'),_0x51a8('0x105'),{'account':_0x4eeff2,'message':{'from':util['format'](_0x51a8('0x106'),_0x359e42[_0x51a8('0x3a')],_0x359e42[_0x51a8('0xc7')]||_0x359e42[_0x51a8('0xfd')]['user']),'to':_0x58c6df['body'][_0x51a8('0xe8')],'subject':'Mail\x20Transcript','text':util[_0x51a8('0xea')](_0x51a8('0x107'),_0x58c6df[_0x51a8('0x3b')][_0x51a8('0xe8')]),'attachments':[{'path':_0x4f8535}]}})['then'](function(){return _0x18179c;})[_0x51a8('0x2b')](function(_0x4e62f3){console[_0x51a8('0x27')](_0x4e62f3);});}else{return _0x18179c;}})[_0x51a8('0x20')](respondWithStatusCode(_0x44fa71,0xc8))[_0x51a8('0x2b')](handleError(_0x44fa71,null));};exports['addMessage']=function(_0x5e50ea,_0x3589be,_0x10fd78){return db[_0x51a8('0xd0')][_0x51a8('0x75')]({'where':{'id':_0x5e50ea[_0x51a8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3589be,null))[_0x51a8('0x20')](function(_0x288180){if(_0x288180){return _0x288180[_0x51a8('0x108')](_0x5e50ea['body'][_0x51a8('0x109')],_[_0x51a8('0x10a')](_0x5e50ea[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{});}})[_0x51a8('0x20')](respondWithResult(_0x3589be,null))[_0x51a8('0x2b')](handleError(_0x3589be,null));};exports[_0x51a8('0x10b')]=function(_0x52004e,_0x15ac9b,_0x1aed5b){var _0xeba541={'raw':![],'where':{}};var _0xbe375d={};var _0x244d95={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x52004e[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x15ac9b,null))['then'](function(_0x3c7726){if(_0x3c7726){_0xbe375d['model']=_['keys'](db[_0x51a8('0xd0')]['rawAttributes']);_0xbe375d[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x52004e['query']);_0xbe375d['filters']=_[_0x51a8('0x4e')](_0xbe375d['model'],_0xbe375d[_0x51a8('0x4c')]);_0xeba541[_0x51a8('0x4f')]=_['intersection'](_0xbe375d[_0x51a8('0x4b')],qs['fields'](_0x52004e[_0x51a8('0x4c')][_0x51a8('0x50')]));_0xeba541['attributes']=_0xeba541[_0x51a8('0x4f')][_0x51a8('0x51')]?_0xeba541[_0x51a8('0x4f')]:_0xbe375d[_0x51a8('0x4b')];if(!_0x52004e[_0x51a8('0x4c')]['hasOwnProperty']('nolimit')){_0xeba541[_0x51a8('0x31')]=qs[_0x51a8('0x31')](_0x52004e['query'][_0x51a8('0x31')]);_0xeba541['offset']=qs[_0x51a8('0x30')](_0x52004e['query'][_0x51a8('0x30')]);}_0xeba541[_0x51a8('0x9a')]=qs['sort'](_0x52004e['query'][_0x51a8('0x53')]);_0xeba541['where']=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x52004e[_0x51a8('0x4c')],_0xbe375d['filters']));_0xeba541[_0x51a8('0x54')][_0x51a8('0xb9')]=_0x3c7726['id'];if(_0x52004e['query'][_0x51a8('0x8f')]){_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541[_0x51a8('0x54')],{'$or':_[_0x51a8('0x40')](_0xeba541[_0x51a8('0x4f')],function(_0x49a943){var _0xad8ab7={};_0xad8ab7[_0x49a943]={'$like':'%'+_0x52004e[_0x51a8('0x4c')]['filter']+'%'};return _0xad8ab7;})});}if(_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')]){var _0x234a4a=_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')][_0x51a8('0x44')](',');var _0x4b1154={};_0x4b1154[_0x234a4a[0x0]]={'$gte':moment(_0x234a4a[0x1])[_0x51a8('0xea')](_0x51a8('0x10c'))};_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541['where'],_0x4b1154);}_0xeba541=_[_0x51a8('0xa6')]({},_0xeba541,_0x52004e[_0x51a8('0xbe')]);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0xeba541[_0x51a8('0x54')]})[_0x51a8('0x20')](function(_0x45bd8b){_0x244d95[_0x51a8('0x33')]=_0x45bd8b;if(_0x52004e['query'][_0x51a8('0xbc')]){_0xeba541[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0xeba541);})['then'](function(_0x59e0ed){_0x244d95['rows']=_0x59e0ed;return _0x244d95;});}})['then'](respondWithFilteredResult(_0x15ac9b,_0xeba541))[_0x51a8('0x2b')](handleError(_0x15ac9b,null));};exports['getMyMessages']=function(_0x1f1b3b,_0x3b6e0b,_0x312c20){var _0x2f9fe0={'where':{}},_0x1568f3={},_0x45677c={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x1f1b3b[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x3b6e0b,null))[_0x51a8('0x20')](function(_0x30dbd3){if(_0x30dbd3){_0x1568f3[_0x51a8('0x4b')]=_[_0x51a8('0x4d')](db[_0x51a8('0xd0')][_0x51a8('0x49')]);_0x1568f3[_0x51a8('0x4c')]=_['keys'](_0x1f1b3b['query']);_0x1568f3[_0x51a8('0x55')]=_['intersection'](_0x1568f3[_0x51a8('0x4b')],_0x1568f3[_0x51a8('0x4c')]);_0x2f9fe0['attributes']=_[_0x51a8('0x4e')](_0x1568f3[_0x51a8('0x4b')],qs[_0x51a8('0x50')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2f9fe0['attributes']=_0x2f9fe0[_0x51a8('0x4f')]['length']?_0x2f9fe0['attributes']:_0x1568f3[_0x51a8('0x4b')];if(!_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x52')](_0x51a8('0x10e'))){_0x2f9fe0[_0x51a8('0x31')]=qs['limit'](_0x1f1b3b['query'][_0x51a8('0x31')]);_0x2f9fe0[_0x51a8('0x30')]=qs[_0x51a8('0x30')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2f9fe0[_0x51a8('0x9a')]=qs[_0x51a8('0x53')](_0x1f1b3b['query']['sort']);_0x2f9fe0[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x1f1b3b[_0x51a8('0x4c')],_0x1568f3[_0x51a8('0x55')]));_0x2f9fe0[_0x51a8('0x54')]['ChatInteractionId']=_0x30dbd3['id'];if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]){_0x2f9fe0[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0x2f9fe0['where'],{'$or':_[_0x51a8('0x40')](_0x2f9fe0[_0x51a8('0x4f')],function(_0x45f627){var _0x2d5526={};_0x2d5526[_0x45f627]={'$like':'%'+_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]+'%'};return _0x2d5526;})});}_0x2f9fe0[_0x51a8('0x54')]['secret']=![];if(_0x1f1b3b[_0x51a8('0x4c')]['id']){_0x2f9fe0[_0x51a8('0x54')]['id']={'$gt':_0x1f1b3b['query']['id']};}_0x2f9fe0=_[_0x51a8('0xa6')]({},_0x2f9fe0,_0x1f1b3b['options']);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0x2f9fe0['where']})[_0x51a8('0x20')](function(_0x3b31f4){_0x45677c[_0x51a8('0x33')]=_0x3b31f4;_0x2f9fe0[_0x51a8('0xbd')]=[];if(_0x1f1b3b['query'][_0x51a8('0x10f')]){_0x2f9fe0[_0x51a8('0xbd')][_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':'User','attributes':['id','fullname',_0x51a8('0xf6')]});}if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2f9fe0[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0x2f9fe0);})[_0x51a8('0x20')](function(_0x14c1b8){_0x45677c[_0x51a8('0x110')]=_0x14c1b8;return _0x45677c;});}})[_0x51a8('0x20')](respondWithFilteredResult(_0x3b6e0b,_0x2f9fe0))[_0x51a8('0x2b')](handleError(_0x3b6e0b,null));};exports['addTags']=function(_0x675401,_0x35a751,_0x36aac9){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x675401[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x35a751,null))['then'](function(_0x4624f7){if(_0x4624f7){return _0x4624f7[_0x51a8('0x111')](_0x675401['body']['ids'],_['omit'](_0x675401[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{})[_0x51a8('0x112')](function(){return db['Tag'][_0x51a8('0x10d')]({'attributes':['id',_0x51a8('0x3a'),_0x51a8('0x59')],'where':{'id':_0x675401[_0x51a8('0x3b')][_0x51a8('0x109')]}});})['then'](function(_0xa5bcfc){socket[_0x51a8('0x113')](_0x51a8('0x114'),{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]});return{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]};});}})[_0x51a8('0x20')](respondWithResult(_0x35a751,null))[_0x51a8('0x2b')](handleError(_0x35a751,null));};exports[_0x51a8('0x115')]=function(_0x37b8e4,_0x32038c,_0x19002e){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x37b8e4['params']['id']}})['then'](handleEntityNotFound(_0x32038c,null))[_0x51a8('0x20')](function(_0x38729f){if(_0x38729f){return _0x38729f[_0x51a8('0x115')](_0x37b8e4[_0x51a8('0x4c')][_0x51a8('0x109')]);}})[_0x51a8('0x20')](respondWithStatusCode(_0x32038c,null))[_0x51a8('0x2b')](handleError(_0x32038c,null));};exports['download']=function(_0x9c6443,_0x4ec339){var _0x117d9d=moment()[_0x51a8('0x116')]()[_0x51a8('0xa4')]();var _0x5a82d7=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0x117'),'files',_0x51a8('0x118'));var _0x282ded=path['join'](config[_0x51a8('0xe3')],'server',_0x51a8('0x119'),_0x51a8('0x11a'));var _0x3e05bd=path['join'](_0x5a82d7,_0x117d9d);var _0x589252=util[_0x51a8('0xea')](_0x51a8('0x11b'),_0x9c6443['params']['id'],_0x117d9d);var _0x5370db=path[_0x51a8('0xe2')](_0x5a82d7,_0x589252);var _0x42c534=[];_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c'),'attributes':['id',_0x51a8('0x41')],'raw':!![]});_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xed')],'as':_0x51a8('0x72'),'attributes':['id',_0x51a8('0x11c'),_0x51a8('0x11d')],'raw':!![]});if(_0x9c6443[_0x51a8('0x4c')]['attachments']){_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xe0')],'as':_0x51a8('0xe0'),'raw':!![]});}var _0x556783=[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'attributes':['id','body',_0x51a8('0x86'),_0x51a8('0xf9'),'secret',_0x51a8('0x11e')],'include':_0x42c534}];_0x556783['push']({'model':db[_0x51a8('0xc1')],'as':_0x51a8('0x11f'),'attributes':['id',_0x51a8('0x3a')]});_0x556783[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x120'),'attributes':['id','fullname']});return db[_0x51a8('0x48')]['find']({'where':{'id':_0x9c6443[_0x51a8('0xbb')]['id']},'include':_0x556783})[_0x51a8('0x20')](handleEntityNotFound(_0x4ec339,null))['then'](function(_0xf80e41){if(_0xf80e41){var _0x35aed9=_0xf80e41[_0x51a8('0x121')]({'plain':!![]});fs[_0x51a8('0x122')](_0x3e05bd);var _0xcdcbb2={'channel':'Chat','account':_0x35aed9[_0x51a8('0x11f')][_0x51a8('0x3a')],'agent':_0x35aed9[_0x51a8('0x120')]?_0x35aed9[_0x51a8('0x120')]['fullname']:_0x51a8('0x123'),'createdAt':moment(_0x35aed9[_0x51a8('0x86')])['format'](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'closedAt':_0x35aed9['closed']?moment(_0x35aed9['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x35aed9['disposition'],'chatInfo':{'browser':_0x35aed9[_0x51a8('0x124')],'os':_0x35aed9['osName'],'referer':_0x35aed9['referer'],'customerIp':_0x35aed9[_0x51a8('0x125')],'customerPort':_0x35aed9[_0x51a8('0x126')]?_0x35aed9[_0x51a8('0x126')]:_0x51a8('0x123')},'messages':_(_0x35aed9[_0x51a8('0xec')])['tail']()['filter']({'secret':![]})['map'](function(_0x24b953){if(_0x24b953[_0x51a8('0xe0')]){var _0x14df4f=path[_0x51a8('0xe2')](_0x282ded,_0x24b953['Attachment']['basename']);if(fs[_0x51a8('0x127')](_0x14df4f)){fs[_0x51a8('0x128')](_0x14df4f)[_0x51a8('0x129')](fs[_0x51a8('0x12a')](path['join'](_0x3e05bd,_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')])));}}return{'date':moment(_0x24b953[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'sender':_0x24b953[_0x51a8('0xf9')]===_0x51a8('0xcf')?_0x24b953[_0x51a8('0x7c')]?_0x24b953[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0'):_0x24b953['Contact'][_0x51a8('0x11c')]+(_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]?'\x20'+_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]:''),'body':_0x24b953['Attachment']?_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')]:_0x24b953[_0x51a8('0x3b')],'direction':_0x24b953[_0x51a8('0xf9')]==='out'?'A':'C','secret':_0x24b953[_0x51a8('0xfa')],'read':_0x24b953['read'],'attachment':_0x24b953[_0x51a8('0xe0')]};})[_0x51a8('0x6f')]()};return ejs[_0x51a8('0x12b')](path[_0x51a8('0xe2')](config['root'],_0x51a8('0x117'),_0x51a8('0x12c'),_0x51a8('0x12d')),{'interaction':_0xcdcbb2})[_0x51a8('0x20')](function(_0x3f039c){var _0x3a0c33=path['join'](_0x3e05bd,'transcript-'+_0x35aed9['id']+'-'+_0x117d9d+_0x51a8('0x12e'));var _0x3e1da1={'path':_0x3a0c33,'channel':_0x51a8('0x12f'),'interactionId':_0x35aed9['id']};return pdf[_0x51a8('0x130')](_0x3f039c,_0x3e1da1);})[_0x51a8('0x20')](function(){return new BPromise(function(_0x1e55c1,_0x443db8){zipdir(_0x3e05bd,{'saveTo':_0x5370db},function(_0x192d63,_0x2263e3){if(_0x192d63)return _0x443db8(_0x192d63);return _0x1e55c1(_0x2263e3);});})[_0x51a8('0x20')](function(){return new BPromise(function(_0x32d363,_0x3030ff){rimraf(_0x3e05bd,function(_0x357e44){if(_0x357e44)_0x3030ff(_0x357e44);return _0x32d363();});});})[_0x51a8('0x20')](function(){return _0x4ec339[_0x51a8('0xe6')](_0x5370db,_0x589252,function(_0x44b406){if(_0x44b406){console[_0x51a8('0x131')](_0x51a8('0x132'),_0x44b406);}else{fs[_0x51a8('0x133')](_0x5370db);}});});});}else{return _0x4ec339[_0x51a8('0x2c')](0xc8);}})[_0x51a8('0x2b')](handleError(_0x4ec339,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index faca05b..a80f67d 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 _0xc71c=['map','findAll','length','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc71c,0xe6));var _0xcc71=function(_0x4e5c37,_0x170d7b){_0x4e5c37=_0x4e5c37-0x0;var _0x2a80d1=_0xc71c[_0x4e5c37];return _0x2a80d1;};'use strict';var EventEmitter=require(_0xcc71('0x0'));var ChatInteraction=require(_0xcc71('0x1'))['db'][_0xcc71('0x2')];var ChatMessage=require(_0xcc71('0x1'))['db'][_0xcc71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc71('0x4'),'afterUpdate':'update','afterDestroy':_0xcc71('0x5')};function emitEvent(_0x57b0cf){return function(_0x3a1a6c,_0x42ca8a,_0x44688b){_0x3a1a6c[_0xcc71('0x6')]({'attributes':['id'],'raw':!![]})[_0xcc71('0x7')](function(_0x1d7ea6){_0x3a1a6c[_0xcc71('0x8')](_0xcc71('0x9'),_0x1d7ea6[_0xcc71('0xa')](function(_0x2b7e57){return{'id':_0x2b7e57['id']};}));return ChatMessage[_0xcc71('0xb')]({'where':{'ChatInteractionId':_0x3a1a6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc71('0x7')](function(_0x3f16c9){_0x3a1a6c[_0xcc71('0x8')]('unreadMessages',_0x3f16c9[_0xcc71('0xc')]);ChatInteractionEvents[_0xcc71('0xd')](_0x57b0cf+':'+_0x3a1a6c['id'],_0x3a1a6c);ChatInteractionEvents[_0xcc71('0xd')](_0x57b0cf,_0x3a1a6c);_0x44688b(null);})[_0xcc71('0xe')](_0x44688b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcc71('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x9208=['map','findAll','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x48f202,_0x37f19f){var _0x2f6ca4=function(_0x5733fa){while(--_0x5733fa){_0x48f202['push'](_0x48f202['shift']());}};_0x2f6ca4(++_0x37f19f);}(_0x9208,0x103));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x8920('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x8920('0x1')];var ChatMessage=require(_0x8920('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8920('0x3')](0x0);var events={'afterCreate':_0x8920('0x4'),'afterUpdate':_0x8920('0x5'),'afterDestroy':_0x8920('0x6')};function emitEvent(_0x2f0e32){return function(_0x225c3b,_0x47f5c8,_0x1ed8ba){_0x225c3b[_0x8920('0x7')]({'attributes':['id'],'raw':!![]})[_0x8920('0x8')](function(_0x4cf943){_0x225c3b[_0x8920('0x9')](_0x8920('0xa'),_0x4cf943[_0x8920('0xb')](function(_0x5a9a33){return{'id':_0x5a9a33['id']};}));return ChatMessage[_0x8920('0xc')]({'where':{'ChatInteractionId':_0x225c3b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x20ac7e){_0x225c3b[_0x8920('0x9')]('unreadMessages',_0x20ac7e['length']);ChatInteractionEvents[_0x8920('0xd')](_0x2f0e32+':'+_0x225c3b['id'],_0x225c3b);ChatInteractionEvents[_0x8920('0xd')](_0x2f0e32,_0x225c3b);_0x1ed8ba(null);})[_0x8920('0xe')](_0x1ed8ba(null));};}for(var e in events){if(events[_0x8920('0xf')](e)){var event=events[e];ChatInteraction[_0x8920('0x10')](e,emitEvent(event));}}module[_0x8920('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f54c36a..78bb542 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 _0xb8ee=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8ee,0x1a3));var _0xeb8e=function(_0x1e24b1,_0x14ab30){_0x1e24b1=_0x1e24b1-0x0;var _0x212baf=_0xb8ee[_0x1e24b1];return _0x212baf;};'use strict';var _=require(_0xeb8e('0x0'));var util=require('util');var logger=require(_0xeb8e('0x1'))(_0xeb8e('0x2'));var moment=require(_0xeb8e('0x3'));var BPromise=require(_0xeb8e('0x4'));var rp=require(_0xeb8e('0x5'));var fs=require('fs');var path=require(_0xeb8e('0x6'));var rimraf=require('rimraf');var config=require(_0xeb8e('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xeb8e('0x8')]=function(_0x43214b,_0x203858){return _0x43214b['define'](_0xeb8e('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d9058,_0x39c4fc,_0x3ec499){if(_0x4d9058['changed']('closed')){_0x4d9058[_0xeb8e('0xa')]=moment()['format'](_0xeb8e('0xb'));}_0x3ec499(null,_0x4d9058);}},'charset':'utf8mb4','collate':_0xeb8e('0xc')});}; \ No newline at end of file +var _0x8917=['closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','define','changed','closed'];(function(_0x34140e,_0xc6a635){var _0x3ff834=function(_0x9fa4c0){while(--_0x9fa4c0){_0x34140e['push'](_0x34140e['shift']());}};_0x3ff834(++_0xc6a635);}(_0x8917,0x120));var _0x7891=function(_0x26ccc0,_0x489b43){_0x26ccc0=_0x26ccc0-0x0;var _0x43237c=_0x8917[_0x26ccc0];return _0x43237c;};'use strict';var _=require(_0x7891('0x0'));var util=require('util');var logger=require(_0x7891('0x1'))(_0x7891('0x2'));var moment=require(_0x7891('0x3'));var BPromise=require(_0x7891('0x4'));var rp=require(_0x7891('0x5'));var fs=require('fs');var path=require(_0x7891('0x6'));var rimraf=require(_0x7891('0x7'));var config=require('../../config/environment');var attributes=require(_0x7891('0x8'));module['exports']=function(_0x3ab6bc,_0x131f0e){return _0x3ab6bc[_0x7891('0x9')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30efb8,_0x527859,_0x2cee65){if(_0x30efb8[_0x7891('0xa')](_0x7891('0xb'))){_0x30efb8[_0x7891('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2cee65(null,_0x30efb8);}},'charset':_0x7891('0xd'),'collate':_0x7891('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 8e7415a..10f7adc 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 _0x3527=['UpdateChatInteraction','ChatInteraction','body','raw','options','where','attributes','stringify','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x904f36,_0x1f2eac){var _0xc2645c=function(_0x40e08b){while(--_0x40e08b){_0x904f36['push'](_0x904f36['shift']());}};_0xc2645c(++_0x1f2eac);}(_0x3527,0x1b1));var _0x7352=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x3527[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x7352('0x0'));var util=require(_0x7352('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7352('0x2'));var fs=require('fs');var Redis=require(_0x7352('0x3'));var db=require(_0x7352('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7352('0x5'))(_0x7352('0x6'));var config=require(_0x7352('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7352('0x8')]['http']({'port':0x232a});config[_0x7352('0x9')]=_[_0x7352('0xa')](config[_0x7352('0x9')],{'host':_0x7352('0xb'),'port':0x18eb});var socket=require(_0x7352('0xc'))(new Redis(config[_0x7352('0x9')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x58d38c,_0x4afe3e,_0x387a66){return new BPromise(function(_0x336574,_0x3ebbe3){return client[_0x7352('0xd')](_0x58d38c,_0x387a66)[_0x7352('0xe')](function(_0x5720fc){logger[_0x7352('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x4afe3e,_0x7352('0x10'));logger[_0x7352('0x11')](_0x7352('0x12'),_0x4afe3e,'request\x20sent',JSON['stringify'](_0x5720fc));if(_0x5720fc[_0x7352('0x13')]){if(_0x5720fc[_0x7352('0x13')][_0x7352('0x14')]===0x1f4){logger['error'](_0x7352('0x15'),_0x4afe3e,_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);return _0x3ebbe3(_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);}logger['error'](_0x7352('0x15'),_0x4afe3e,_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);return _0x336574(_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);}else{logger['info'](_0x7352('0x15'),_0x4afe3e,'request\x20sent');_0x336574(_0x5720fc['result']['message']);}})['catch'](function(_0x53350e){logger[_0x7352('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4afe3e,_0x53350e);_0x3ebbe3(_0x53350e);});});}exports[_0x7352('0x17')]=function(_0x14c033){var _0x1d2dff=this;return new Promise(function(_0x92d848,_0x2d920d){return db[_0x7352('0x18')]['update'](_0x14c033[_0x7352('0x19')],{'raw':_0x14c033['options']?_0x14c033['options'][_0x7352('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14c033['options']?_0x14c033[_0x7352('0x1b')][_0x7352('0x1c')]||null:null,'attributes':_0x14c033[_0x7352('0x1b')]?_0x14c033[_0x7352('0x1b')][_0x7352('0x1d')]||null:null,'limit':_0x14c033['options']?_0x14c033[_0x7352('0x1b')]['limit']||null:null})['then'](function(_0x443d46){logger['info'](_0x7352('0x17'),_0x14c033);logger['debug'](_0x7352('0x17'),_0x14c033,JSON[_0x7352('0x1e')](_0x443d46));_0x92d848(_0x443d46);})['catch'](function(_0x4e666e){logger[_0x7352('0x13')]('UpdateChatInteraction',_0x4e666e['message'],_0x14c033);_0x2d920d(_0x1d2dff[_0x7352('0x13')](0x1f4,_0x4e666e['message']));});});};exports[_0x7352('0x1f')]=function(_0x207780){return new Promise(function(_0x5cfe75,_0x2444ce){return db[_0x7352('0x18')][_0x7352('0x20')]({'where':_0x207780[_0x7352('0x1b')]?_0x207780[_0x7352('0x1b')][_0x7352('0x1c')]||null:null})[_0x7352('0xe')](function(_0x74cd47){if(_0x74cd47){return _0x74cd47[_0x7352('0x21')](_0x207780[_0x7352('0x19')][_0x7352('0x22')],_['omit'](_0x207780['body'],['ids','id'])||{});}})[_0x7352('0x23')](function(_0x436dc7){logger['info'](_0x7352('0x24'),_0x207780);logger['debug']('AddTags',_0x207780,JSON[_0x7352('0x1e')](_0x436dc7));_0x5cfe75(_0x436dc7);})[_0x7352('0x25')](function(_0x311849){logger[_0x7352('0x13')](_0x7352('0x24'),_0x311849[_0x7352('0x16')],_0x207780);_0x2444ce(_this[_0x7352('0x13')](0x1f4,_0x311849[_0x7352('0x16')]));});});}; \ No newline at end of file +var _0x6aea=['ids','omit','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','update','body','options','raw','where','debug','ChatInteraction','addTags'];(function(_0x2aee27,_0x44a48e){var _0x3d6f8a=function(_0x4bca6c){while(--_0x4bca6c){_0x2aee27['push'](_0x2aee27['shift']());}};_0x3d6f8a(++_0x44a48e);}(_0x6aea,0x72));var _0xa6ae=function(_0x1bdc28,_0x4e9b5f){_0x1bdc28=_0x1bdc28-0x0;var _0x3f7f41=_0x6aea[_0x1bdc28];return _0x3f7f41;};'use strict';var _=require('lodash');var util=require(_0xa6ae('0x0'));var moment=require('moment');var BPromise=require(_0xa6ae('0x1'));var rs=require(_0xa6ae('0x2'));var fs=require('fs');var Redis=require(_0xa6ae('0x3'));var db=require(_0xa6ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6ae('0x5'))(_0xa6ae('0x6'));var config=require(_0xa6ae('0x7'));var jayson=require(_0xa6ae('0x8'));var client=jayson[_0xa6ae('0x9')]['http']({'port':0x232a});config[_0xa6ae('0xa')]=_[_0xa6ae('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa6ae('0xc'))(new Redis(config[_0xa6ae('0xa')]));require('./chatInteraction.socket')[_0xa6ae('0xd')](socket);function respondWithRpcPromise(_0x93d172,_0x40ff7b,_0x5e6440){return new BPromise(function(_0x2b9467,_0x1c9cdb){return client[_0xa6ae('0xe')](_0x93d172,_0x5e6440)[_0xa6ae('0xf')](function(_0x3cdfb5){logger[_0xa6ae('0x10')](_0xa6ae('0x11'),_0x40ff7b,_0xa6ae('0x12'));logger['debug'](_0xa6ae('0x13'),_0x40ff7b,_0xa6ae('0x12'),JSON[_0xa6ae('0x14')](_0x3cdfb5));if(_0x3cdfb5[_0xa6ae('0x15')]){if(_0x3cdfb5[_0xa6ae('0x15')][_0xa6ae('0x16')]===0x1f4){logger[_0xa6ae('0x15')](_0xa6ae('0x11'),_0x40ff7b,_0x3cdfb5[_0xa6ae('0x15')][_0xa6ae('0x17')]);return _0x1c9cdb(_0x3cdfb5[_0xa6ae('0x15')][_0xa6ae('0x17')]);}logger[_0xa6ae('0x15')](_0xa6ae('0x11'),_0x40ff7b,_0x3cdfb5['error'][_0xa6ae('0x17')]);return _0x2b9467(_0x3cdfb5[_0xa6ae('0x15')][_0xa6ae('0x17')]);}else{logger[_0xa6ae('0x10')](_0xa6ae('0x11'),_0x40ff7b,_0xa6ae('0x12'));_0x2b9467(_0x3cdfb5['result'][_0xa6ae('0x17')]);}})[_0xa6ae('0x18')](function(_0x34e9f3){logger['error'](_0xa6ae('0x11'),_0x40ff7b,_0x34e9f3);_0x1c9cdb(_0x34e9f3);});});}exports[_0xa6ae('0x19')]=function(_0xa731d2){var _0x2533be=this;return new Promise(function(_0x2cd588,_0x35b02e){return db['ChatInteraction'][_0xa6ae('0x1a')](_0xa731d2[_0xa6ae('0x1b')],{'raw':_0xa731d2[_0xa6ae('0x1c')]?_0xa731d2[_0xa6ae('0x1c')][_0xa6ae('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa731d2[_0xa6ae('0x1c')]?_0xa731d2[_0xa6ae('0x1c')][_0xa6ae('0x1e')]||null:null,'attributes':_0xa731d2[_0xa6ae('0x1c')]?_0xa731d2[_0xa6ae('0x1c')]['attributes']||null:null,'limit':_0xa731d2[_0xa6ae('0x1c')]?_0xa731d2[_0xa6ae('0x1c')]['limit']||null:null})[_0xa6ae('0xf')](function(_0x580595){logger[_0xa6ae('0x10')](_0xa6ae('0x19'),_0xa731d2);logger[_0xa6ae('0x1f')](_0xa6ae('0x19'),_0xa731d2,JSON[_0xa6ae('0x14')](_0x580595));_0x2cd588(_0x580595);})[_0xa6ae('0x18')](function(_0x58c19b){logger[_0xa6ae('0x15')]('UpdateChatInteraction',_0x58c19b['message'],_0xa731d2);_0x35b02e(_0x2533be['error'](0x1f4,_0x58c19b[_0xa6ae('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x5687b9){return new Promise(function(_0x44fc66,_0x3608c4){return db[_0xa6ae('0x20')]['find']({'where':_0x5687b9[_0xa6ae('0x1c')]?_0x5687b9[_0xa6ae('0x1c')][_0xa6ae('0x1e')]||null:null})[_0xa6ae('0xf')](function(_0x660616){if(_0x660616){return _0x660616[_0xa6ae('0x21')](_0x5687b9['body'][_0xa6ae('0x22')],_[_0xa6ae('0x23')](_0x5687b9[_0xa6ae('0x1b')],['ids','id'])||{});}})['spread'](function(_0x29fa86){logger[_0xa6ae('0x10')](_0xa6ae('0x24'),_0x5687b9);logger[_0xa6ae('0x1f')](_0xa6ae('0x24'),_0x5687b9,JSON['stringify'](_0x29fa86));_0x44fc66(_0x29fa86);})[_0xa6ae('0x18')](function(_0x4f6dd1){logger['error'](_0xa6ae('0x24'),_0x4f6dd1[_0xa6ae('0x17')],_0x5687b9);_0x3608c4(_this['error'](0x1f4,_0x4f6dd1[_0xa6ae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 951a18e..53ff3f0 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 _0xe630=['./chatInteraction.events','save','update','emit','register','length','chatInteraction:'];(function(_0x3ec521,_0x5deda3){var _0x25dfe9=function(_0x19948e){while(--_0x19948e){_0x3ec521['push'](_0x3ec521['shift']());}};_0x25dfe9(++_0x5deda3);}(_0xe630,0x149));var _0x0e63=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xe630[_0x31eb67];return _0x2a8cb8;};'use strict';var ChatInteractionEvents=require(_0x0e63('0x0'));var events=[_0x0e63('0x1'),'remove',_0x0e63('0x2')];function createListener(_0x294aee,_0x45c680){return function(_0x500458){_0x45c680[_0x0e63('0x3')](_0x294aee,_0x500458);};}function removeListener(_0x219cbe,_0x42c141){return function(){ChatInteractionEvents['removeListener'](_0x219cbe,_0x42c141);};}exports[_0x0e63('0x4')]=function(_0x308039){for(var _0x356abb=0x0,_0x3e461b=events[_0x0e63('0x5')];_0x356abb<_0x3e461b;_0x356abb++){var _0x563ad9=events[_0x356abb];var _0x35e304=createListener(_0x0e63('0x6')+_0x563ad9,_0x308039);ChatInteractionEvents['on'](_0x563ad9,_0x35e304);}}; \ No newline at end of file +var _0x348e=['emit','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x47abd1,_0x57b271){var _0x335162=function(_0x381deb){while(--_0x381deb){_0x47abd1['push'](_0x47abd1['shift']());}};_0x335162(++_0x57b271);}(_0x348e,0x7c));var _0xe348=function(_0x5acd96,_0x5672e2){_0x5acd96=_0x5acd96-0x0;var _0x34687b=_0x348e[_0x5acd96];return _0x34687b;};'use strict';var ChatInteractionEvents=require(_0xe348('0x0'));var events=[_0xe348('0x1'),_0xe348('0x2'),_0xe348('0x3')];function createListener(_0x3cc8f7,_0x310156){return function(_0xfbbc88){_0x310156[_0xe348('0x4')](_0x3cc8f7,_0xfbbc88);};}function removeListener(_0x501e08,_0x3a8cbc){return function(){ChatInteractionEvents['removeListener'](_0x501e08,_0x3a8cbc);};}exports[_0xe348('0x5')]=function(_0x3f2252){for(var _0x55dc48=0x0,_0x50c02e=events[_0xe348('0x6')];_0x55dc48<_0x50c02e;_0x55dc48++){var _0x55511a=events[_0x55dc48];var _0x358015=createListener(_0xe348('0x7')+_0x55511a,_0x3f2252);ChatInteractionEvents['on'](_0x55511a,_0x358015);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 22637f8..d42bcd9 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 _0x4691=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','addTags','put','/:id','tracked','chat','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','util','path','connect-timeout','express'];(function(_0x47fa7c,_0x30a43f){var _0x11767b=function(_0x1a6db5){while(--_0x1a6db5){_0x47fa7c['push'](_0x47fa7c['shift']());}};_0x11767b(++_0x30a43f);}(_0x4691,0x13a));var _0x1469=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x4691[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require('multer');var util=require(_0x1469('0x0'));var path=require(_0x1469('0x1'));var timeout=require(_0x1469('0x2'));var express=require(_0x1469('0x3'));var router=express['Router']();var fs_extra=require(_0x1469('0x4'));var auth=require(_0x1469('0x5'));var interaction=require(_0x1469('0x6'));var config=require('../../config/environment');var controller=require(_0x1469('0x7'));router[_0x1469('0x8')]('/',auth[_0x1469('0x9')](),controller[_0x1469('0xa')]);router[_0x1469('0x8')](_0x1469('0xb'),auth['isAuthenticated'](),controller[_0x1469('0xc')]);router[_0x1469('0x8')]('/:id',auth[_0x1469('0xd')](),controller['show']);router[_0x1469('0x8')]('/:id/attachment_download',auth[_0x1469('0xd')](),controller[_0x1469('0xe')]);router[_0x1469('0x8')](_0x1469('0xf'),auth[_0x1469('0x9')](),controller[_0x1469('0x10')]);router['get'](_0x1469('0x11'),auth[_0x1469('0xd')](),controller[_0x1469('0x12')]);router[_0x1469('0x8')](_0x1469('0x13'),auth[_0x1469('0x9')](),controller['download']);router[_0x1469('0x14')]('/',auth[_0x1469('0x9')](),controller[_0x1469('0x15')]);router['post'](_0x1469('0x16'),auth[_0x1469('0x9')](),controller[_0x1469('0x17')]);var upload=multer({'storage':multer[_0x1469('0x18')]({'destination':function(_0x31d223,_0x126f45,_0x181ec0){_0x181ec0(null,path['join'](config[_0x1469('0x19')],_0x1469('0x1a')));},'filename':function(_0x49489d,_0x58b693,_0x499e46){_0x499e46(null,util[_0x1469('0x1b')](_0x1469('0x1c'),Date[_0x1469('0x1d')](),_0x58b693['originalname'][_0x1469('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1469('0x14')](_0x1469('0x1f'),upload[_0x1469('0x20')](_0x1469('0x21')),controller[_0x1469('0x22')]);router[_0x1469('0x14')](_0x1469('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x1469('0x23')]);router[_0x1469('0x14')]('/:id/tags',auth[_0x1469('0x9')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x1469('0x24')]);router[_0x1469('0x25')](_0x1469('0x26'),auth[_0x1469('0x9')](),interaction[_0x1469('0x27')](_0x1469('0x28'),_0x1469('0x29')),controller[_0x1469('0x2a')]);router['put']('/:id/custom_update',controller[_0x1469('0x2b')]);router[_0x1469('0x25')](_0x1469('0x2c'),auth[_0x1469('0xd')](),controller[_0x1469('0x2d')]);router['put'](_0x1469('0x2e'),controller[_0x1469('0x2f')]);router[_0x1469('0x30')](_0x1469('0x26'),auth[_0x1469('0x9')](),interaction[_0x1469('0x27')](_0x1469('0x28'),_0x1469('0x31')),controller[_0x1469('0x32')]);router[_0x1469('0x30')](_0x1469('0x33'),auth[_0x1469('0x9')](),controller['removeTags']);module[_0x1469('0x34')]=router; \ No newline at end of file +var _0x6332=['../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','createVidaooSession','diskStorage','server/files/attachments/','now','originalname','replace','single','file','/:id/tags','chat','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eec25,_0x4b1ebf){var _0x478da2=function(_0x5707fa){while(--_0x5707fa){_0x2eec25['push'](_0x2eec25['shift']());}};_0x478da2(++_0x4b1ebf);}(_0x6332,0x162));var _0x2633=function(_0x4ada91,_0x290c07){_0x4ada91=_0x4ada91-0x0;var _0x50b202=_0x6332[_0x4ada91];return _0x50b202;};'use strict';var multer=require(_0x2633('0x0'));var util=require(_0x2633('0x1'));var path=require(_0x2633('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2633('0x3'));var auth=require(_0x2633('0x4'));var interaction=require(_0x2633('0x5'));var config=require(_0x2633('0x6'));var controller=require(_0x2633('0x7'));router[_0x2633('0x8')]('/',auth[_0x2633('0x9')](),controller[_0x2633('0xa')]);router['get'](_0x2633('0xb'),auth[_0x2633('0x9')](),controller[_0x2633('0xc')]);router[_0x2633('0x8')](_0x2633('0xd'),auth[_0x2633('0xe')](),controller['show']);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2633('0xf')]);router[_0x2633('0x8')]('/:id/messages',auth[_0x2633('0x9')](),controller[_0x2633('0x10')]);router[_0x2633('0x8')](_0x2633('0x11'),auth[_0x2633('0xe')](),controller[_0x2633('0x12')]);router[_0x2633('0x8')]('/:id/download',auth[_0x2633('0x9')](),controller[_0x2633('0x13')]);router[_0x2633('0x14')]('/',auth['isAuthenticated'](),controller[_0x2633('0x15')]);router[_0x2633('0x14')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x2633('0x16')]);var upload=multer({'storage':multer[_0x2633('0x17')]({'destination':function(_0x3e660f,_0x1ed61d,_0x116810){_0x116810(null,path['join'](config['root'],_0x2633('0x18')));},'filename':function(_0x2b8918,_0x3007ed,_0x5c9265){_0x5c9265(null,util['format']('%s-%s',Date[_0x2633('0x19')](),_0x3007ed[_0x2633('0x1a')][_0x2633('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2633('0x14')]('/:id/attachment_upload',upload[_0x2633('0x1c')](_0x2633('0x1d')),controller['attachmentUpload']);router[_0x2633('0x14')]('/:id/messages',auth[_0x2633('0xe')](),controller['addMessage']);router[_0x2633('0x14')](_0x2633('0x1e'),auth[_0x2633('0x9')](),interaction['tracked'](_0x2633('0x1f'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0x2633('0xd'),auth[_0x2633('0x9')](),interaction['tracked'](_0x2633('0x1f'),_0x2633('0x20')),controller[_0x2633('0x21')]);router[_0x2633('0x22')](_0x2633('0x23'),controller[_0x2633('0x24')]);router['put'](_0x2633('0x25'),auth[_0x2633('0xe')](),controller[_0x2633('0x26')]);router[_0x2633('0x22')](_0x2633('0x27'),controller[_0x2633('0x28')]);router[_0x2633('0x29')](_0x2633('0xd'),auth[_0x2633('0x9')](),interaction[_0x2633('0x2a')](_0x2633('0x1f'),_0x2633('0x2b')),controller['destroy']);router[_0x2633('0x29')](_0x2633('0x1e'),auth[_0x2633('0x9')](),controller['removeTags']);module[_0x2633('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ff6447d..7450e7d 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 _0x3798=['TEXT','medium','INTEGER','sequelize'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x3798,0x1c7));var _0x8379=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0x3798[_0x16fe4c];return _0x9999d;};'use strict';var Sequelize=require(_0x8379('0x0'));module['exports']={'body':{'type':Sequelize[_0x8379('0x1')](_0x8379('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8379('0x3')]}}; \ No newline at end of file +var _0xd879=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x3b728d,_0x23c85e){var _0x444a10=function(_0xbdbd5e){while(--_0xbdbd5e){_0x3b728d['push'](_0x3b728d['shift']());}};_0x444a10(++_0x23c85e);}(_0xd879,0x199));var _0x9d87=function(_0x2bbb9c,_0x386715){_0x2bbb9c=_0x2bbb9c-0x0;var _0x5221f6=_0xd879[_0x2bbb9c];return _0x5221f6;};'use strict';var Sequelize=require(_0x9d87('0x0'));module[_0x9d87('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9d87('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9d87('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9d87('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b5eb3c5..593f604 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 _0x724a=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','agent','admin','user','fullname','role','userpic','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','filter','resourceId','push','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status'];(function(_0x127b2d,_0x109548){var _0x576ce2=function(_0x52900a){while(--_0x52900a){_0x127b2d['push'](_0x127b2d['shift']());}};_0x576ce2(++_0x109548);}(_0x724a,0x132));var _0xa724=function(_0x57fa12,_0x4b82fe){_0x57fa12=_0x57fa12-0x0;var _0x5dae05=_0x724a[_0x57fa12];return _0x5dae05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa724('0x0'));var zipdir=require(_0xa724('0x1'));var jsonpatch=require(_0xa724('0x2'));var rp=require(_0xa724('0x3'));var moment=require(_0xa724('0x4'));var BPromise=require(_0xa724('0x5'));var Mustache=require(_0xa724('0x6'));var util=require(_0xa724('0x7'));var path=require(_0xa724('0x8'));var sox=require(_0xa724('0x9'));var csv=require(_0xa724('0xa'));var ejs=require(_0xa724('0xb'));var fs=require('fs');var fs_extra=require(_0xa724('0xc'));var _=require(_0xa724('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa724('0xe'));var deskjs=require(_0xa724('0xf'));var toCsv=require(_0xa724('0xa'));var querystring=require(_0xa724('0x10'));var Papa=require(_0xa724('0x11'));var Redis=require(_0xa724('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa724('0x13'));var as=require(_0xa724('0x14'));var hardwareService=require(_0xa724('0x15'));var logger=require(_0xa724('0x16'))(_0xa724('0x17'));var utils=require('../../config/utils');var config=require(_0xa724('0x18'));var licenseUtil=require(_0xa724('0x19'));var db=require(_0xa724('0x1a'))['db'];config[_0xa724('0x1b')]=_['defaults'](config['redis'],{'host':_0xa724('0x1c'),'port':0x18eb});var socket=require(_0xa724('0x1d'))(new Redis(config[_0xa724('0x1b')]));require(_0xa724('0x1e'))[_0xa724('0x1f')](socket);function respondWithStatusCode(_0x2383e4,_0x4bb51f){_0x4bb51f=_0x4bb51f||0xcc;return function(_0x1ae7d1){if(_0x1ae7d1){return _0x2383e4['sendStatus'](_0x4bb51f);}return _0x2383e4[_0xa724('0x20')](_0x4bb51f)[_0xa724('0x21')]();};}function respondWithResult(_0x5ac2df,_0x3304e0){_0x3304e0=_0x3304e0||0xc8;return function(_0x47eff5){if(_0x47eff5){return _0x5ac2df[_0xa724('0x20')](_0x3304e0)[_0xa724('0x22')](_0x47eff5);}};}function respondWithFilteredResult(_0x1b6b49,_0xb394d){return function(_0x2f14e2){if(_0x2f14e2){var _0x26e5a2=typeof _0xb394d[_0xa724('0x23')]===_0xa724('0x24')&&typeof _0xb394d[_0xa724('0x25')]==='undefined';var _0x2c5adf=_0x2f14e2[_0xa724('0x26')];var _0x563fa3=_0x26e5a2?0x0:_0xb394d[_0xa724('0x23')];var _0x2f7760=_0x26e5a2?_0x2f14e2[_0xa724('0x26')]:_0xb394d[_0xa724('0x23')]+_0xb394d[_0xa724('0x25')];var _0xbe4c63;if(_0x2f7760>=_0x2c5adf){_0x2f7760=_0x2c5adf;_0xbe4c63=0xc8;}else{_0xbe4c63=0xce;}_0x1b6b49[_0xa724('0x20')](_0xbe4c63);return _0x1b6b49[_0xa724('0x27')](_0xa724('0x28'),_0x563fa3+'-'+_0x2f7760+'/'+_0x2c5adf)[_0xa724('0x22')](_0x2f14e2);}return null;};}function patchUpdates(_0x300ed0){return function(_0x283118){try{jsonpatch[_0xa724('0x29')](_0x283118,_0x300ed0,!![]);}catch(_0x22dfab){return BPromise['reject'](_0x22dfab);}return _0x283118[_0xa724('0x2a')]();};}function saveUpdates(_0x32404f,_0x1f19d2){return function(_0x559851){if(_0x559851){return _0x559851[_0xa724('0x2b')](_0x32404f)['then'](function(_0x15390f){return _0x15390f;});}return null;};}function removeEntity(_0x22ec0d,_0x206add){return function(_0x10b808){if(_0x10b808){return _0x10b808[_0xa724('0x2c')]()['then'](function(){_0x22ec0d[_0xa724('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5fe4,_0x13c93e){return function(_0x48816c){if(!_0x48816c){_0x3e5fe4[_0xa724('0x2d')](0x194);}return _0x48816c;};}function handleError(_0x55d9fa,_0x1b5fc2){_0x1b5fc2=_0x1b5fc2||0x1f4;return function(_0x13dc99){logger[_0xa724('0x2e')](_0x13dc99[_0xa724('0x2f')]);if(_0x13dc99[_0xa724('0x30')]){delete _0x13dc99[_0xa724('0x30')];}_0x55d9fa['status'](_0x1b5fc2)[_0xa724('0x31')](_0x13dc99);};}exports[_0xa724('0x32')]=function(_0x2712dc,_0x530232){var _0x2cf1f7={},_0x442a51={},_0x228023={'count':0x0,'rows':[]};var _0x172979=_[_0xa724('0x33')](db[_0xa724('0x34')][_0xa724('0x35')],function(_0x10bc32){return{'name':_0x10bc32[_0xa724('0x36')],'type':_0x10bc32[_0xa724('0x37')][_0xa724('0x38')]};});_0x442a51[_0xa724('0x39')]=_[_0xa724('0x33')](_0x172979,_0xa724('0x30'));_0x442a51[_0xa724('0x3a')]=_['keys'](_0x2712dc['query']);_0x442a51[_0xa724('0x3b')]=_[_0xa724('0x3c')](_0x442a51['model'],_0x442a51[_0xa724('0x3a')]);_0x2cf1f7['attributes']=_[_0xa724('0x3c')](_0x442a51[_0xa724('0x39')],qs[_0xa724('0x3d')](_0x2712dc[_0xa724('0x3a')][_0xa724('0x3d')]));_0x2cf1f7[_0xa724('0x3e')]=_0x2cf1f7[_0xa724('0x3e')][_0xa724('0x3f')]?_0x2cf1f7[_0xa724('0x3e')]:_0x442a51[_0xa724('0x39')];if(!_0x2712dc[_0xa724('0x3a')]['hasOwnProperty'](_0xa724('0x40'))){_0x2cf1f7[_0xa724('0x25')]=qs[_0xa724('0x25')](_0x2712dc[_0xa724('0x3a')][_0xa724('0x25')]);_0x2cf1f7['offset']=qs['offset'](_0x2712dc[_0xa724('0x3a')]['offset']);}_0x2cf1f7[_0xa724('0x41')]=qs[_0xa724('0x42')](_0x2712dc['query'][_0xa724('0x42')]);_0x2cf1f7['where']=qs[_0xa724('0x3b')](_['pick'](_0x2712dc[_0xa724('0x3a')],_0x442a51[_0xa724('0x3b')]),_0x172979);if(_0x2712dc[_0xa724('0x3a')]['filter']){_0x2cf1f7[_0xa724('0x43')]=_[_0xa724('0x44')](_0x2cf1f7[_0xa724('0x43')],{'$or':_['map'](_0x172979,function(_0x2b71f1){if(_0x2b71f1[_0xa724('0x37')]!==_0xa724('0x45')){var _0x11055e={};_0x11055e[_0x2b71f1[_0xa724('0x30')]]={'$like':'%'+_0x2712dc['query']['filter']+'%'};return _0x11055e;}})});}_0x2cf1f7=_['merge']({},_0x2cf1f7,_0x2712dc['options']);var _0x4711b9={'where':_0x2cf1f7[_0xa724('0x43')]};return db['ChatInternalMessage'][_0xa724('0x26')](_0x4711b9)[_0xa724('0x46')](function(_0x523d99){_0x228023[_0xa724('0x26')]=_0x523d99;if(_0x2712dc[_0xa724('0x3a')][_0xa724('0x47')]){_0x2cf1f7[_0xa724('0x48')]=[{'all':!![]}];}return db[_0xa724('0x34')][_0xa724('0x49')](_0x2cf1f7);})[_0xa724('0x46')](function(_0x1b9097){_0x228023[_0xa724('0x4a')]=_0x1b9097;return _0x228023;})[_0xa724('0x46')](respondWithFilteredResult(_0x530232,_0x2cf1f7))[_0xa724('0x4b')](handleError(_0x530232,null));};exports[_0xa724('0x4c')]=function(_0x1af9c3,_0x1f60db){var _0x2fe028={'raw':!![],'where':{'id':_0x1af9c3['params']['id']}},_0x4d8a24={};_0x4d8a24[_0xa724('0x39')]=_[_0xa724('0x4d')](db['ChatInternalMessage'][_0xa724('0x35')]);_0x4d8a24[_0xa724('0x3a')]=_['keys'](_0x1af9c3[_0xa724('0x3a')]);_0x4d8a24[_0xa724('0x3b')]=_[_0xa724('0x3c')](_0x4d8a24[_0xa724('0x39')],_0x4d8a24['query']);_0x2fe028['attributes']=_[_0xa724('0x3c')](_0x4d8a24['model'],qs[_0xa724('0x3d')](_0x1af9c3[_0xa724('0x3a')][_0xa724('0x3d')]));_0x2fe028[_0xa724('0x3e')]=_0x2fe028[_0xa724('0x3e')][_0xa724('0x3f')]?_0x2fe028['attributes']:_0x4d8a24[_0xa724('0x39')];if(_0x1af9c3[_0xa724('0x3a')][_0xa724('0x47')]){_0x2fe028[_0xa724('0x48')]=[{'all':!![]}];}_0x2fe028=_[_0xa724('0x44')]({},_0x2fe028,_0x1af9c3[_0xa724('0x4e')]);return db[_0xa724('0x34')][_0xa724('0x4f')](_0x2fe028)['then'](handleEntityNotFound(_0x1f60db,null))[_0xa724('0x46')](respondWithResult(_0x1f60db,null))[_0xa724('0x4b')](handleError(_0x1f60db,null));};exports['create']=function(_0x7d8897,_0x44fc5f){return db[_0xa724('0x34')][_0xa724('0x50')](_0x7d8897[_0xa724('0x51')],{})['then'](respondWithResult(_0x44fc5f,0xc9))[_0xa724('0x4b')](handleError(_0x44fc5f,null));};exports[_0xa724('0x2b')]=function(_0x4e6632,_0x294668){if(_0x4e6632['body']['id']){delete _0x4e6632[_0xa724('0x51')]['id'];}return db[_0xa724('0x34')]['find']({'where':{'id':_0x4e6632['params']['id']}})[_0xa724('0x46')](handleEntityNotFound(_0x294668,null))['then'](saveUpdates(_0x4e6632[_0xa724('0x51')],null))[_0xa724('0x46')](respondWithResult(_0x294668,null))[_0xa724('0x4b')](handleError(_0x294668,null));};exports[_0xa724('0x2c')]=function(_0x2d00eb,_0x45bf6a){return db[_0xa724('0x34')][_0xa724('0x4f')]({'where':{'id':_0x2d00eb[_0xa724('0x52')]['id']}})['then'](handleEntityNotFound(_0x45bf6a,null))['then'](removeEntity(_0x45bf6a,null))[_0xa724('0x4b')](handleError(_0x45bf6a,null));};exports[_0xa724('0x53')]=function(_0x2d206d,_0x49a838){return db['ChatInternalMessage'][_0xa724('0x53')]()[_0xa724('0x46')](respondWithResult(_0x49a838,null))['catch'](handleError(_0x49a838,null));};function wrapUser(_0x280b6c){return function(_0x2e1512){var _0x119aac=_0x280b6c[_0xa724('0x54')]({'plain':!![]});_0x119aac[_0xa724('0x55')]=[];if(_0x2e1512){_0x119aac['lastMessageAt']=_0x2e1512[_0xa724('0x56')];_0x119aac['lastMessage']=_0x2e1512;}else{_0x119aac['lastMessageAt']=moment(0x0)[_0xa724('0x57')](_0xa724('0x58'));_0x119aac[_0xa724('0x59')]={};}return _0x119aac;};}exports['getUsers']=function(_0x499bd9,_0x47c5fa,_0x31c2c6){var _0x106754=[];return db['User']['findAll']({'where':{'role':[_0xa724('0x5a'),_0xa724('0x5b'),_0xa724('0x5c')]},'attributes':['id',_0xa724('0x5d'),_0xa724('0x30'),_0xa724('0x5e'),_0xa724('0x5f'),'internal',_0xa724('0x60'),_0xa724('0x61'),'allowmessenger',_0xa724('0x62')],'order':qs[_0xa724('0x42')](_0xa724('0x63')),'include':[{'model':db[_0xa724('0x64')],'as':_0xa724('0x65'),'attributes':['id',_0xa724('0x30'),_0xa724('0x37')],'through':{'attributes':[]}}]})[_0xa724('0x46')](function(_0x47f805){if(_0x47f805){var _0x5eeda4=_0x499bd9[_0xa724('0x5c')][_0xa724('0x54')]({'plain':!![]});if(!_0x5eeda4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5eeda4[_0xa724('0x5e')]===_0xa724('0x5c')){return db[_0xa724('0x66')][_0xa724('0x4f')]({'where':{'name':_0xa724('0x67'),'userProfileId':_0x5eeda4['userProfileId']},'raw':!![]})[_0xa724('0x46')](function(_0x21cb7c){if(_0x21cb7c){if(_0x21cb7c[_0xa724('0x68')]===0x0){return db[_0xa724('0x69')][_0xa724('0x49')]({'where':{'sectionId':_0x21cb7c['id']},'raw':!![]})[_0xa724('0x46')](function(_0x4e9ace){var _0x186914=[];if(_['isEmpty'](_0x4e9ace)){_0x186914=_[_0xa724('0x6a')](_0x47f805,function(_0x14b64a){if(_0x14b64a[_0xa724('0x5e')]!=='agent'){return _0x14b64a;}});return _0x186914;}else{for(var _0x1c251a=0x0;_0x1c251a<_0x47f805['length'];_0x1c251a++){var _0x1494f7=_0x47f805[_0x1c251a];if(_0x1494f7[_0xa724('0x5e')]==='agent'){var _0x38dceb=_[_0xa724('0x4f')](_0x4e9ace,function(_0x533888){return _0x533888[_0xa724('0x6b')]===_0x1494f7['id'];});if(_0x38dceb)_0x186914[_0xa724('0x6c')](_0x1494f7);}else{_0x186914[_0xa724('0x6c')](_0x1494f7);}}return _0x186914;}});}else{return _0x47f805;}}else{var _0x359a72=_[_0xa724('0x6a')](_0x47f805,function(_0x154d46){if(_0x154d46[_0xa724('0x5e')]!==_0xa724('0x5a')){return _0x154d46;}});return _0x359a72;}});}else{return _0x47f805;}}})[_0xa724('0x46')](function(_0x36ba6f){var _0x22bb8d=[];if(_0x36ba6f){_0x106754=_0x36ba6f;for(var _0x145a23=0x0;_0x145a23<_0x36ba6f[_0xa724('0x3f')];_0x145a23+=0x1){_0x106754[_0x145a23][_0xa724('0x55')]=[];_0x22bb8d['push'](db['ChatInternalMessage'][_0xa724('0x4f')]({'where':{'FromId':[_0x499bd9[_0xa724('0x5c')]['id'],_0x36ba6f[_0x145a23]['id']],'ToId':[_0x499bd9[_0xa724('0x5c')]['id'],_0x36ba6f[_0x145a23]['id']],'ChatGroupId':null},'attributes':['id',_0xa724('0x56'),_0xa724('0x6d'),'ToId',_0xa724('0x6e'),_0xa724('0x51')],'order':qs[_0xa724('0x42')](_0xa724('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x36ba6f[_0x145a23])));}return BPromise[_0xa724('0x70')](_0x22bb8d);}return[];})['then'](function(_0x5c6b2b){return{'rows':_0x5c6b2b,'count':_0x5c6b2b[_0xa724('0x3f')]};})[_0xa724('0x46')](respondWithResult(_0x47c5fa,null))[_0xa724('0x4b')](handleError(_0x47c5fa,null));}; \ No newline at end of file +var _0x359d=['ChatInternalMessage','includeAll','include','findAll','rows','show','catch','create','body','find','params','destroy','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','admin','user','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','createdAt','FromId','ToId','-createdAt','all','eml-format','rimraf','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','count','limit','Content-Range','apply','reject','save','update','then','end','error','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x3cda70,_0x4eef1b){var _0x1e0498=function(_0x224876){while(--_0x224876){_0x3cda70['push'](_0x3cda70['shift']());}};_0x1e0498(++_0x4eef1b);}(_0x359d,0x1d4));var _0xd359=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x359d[_0x3b632f];return _0x10e788;};'use strict';var emlformat=require(_0xd359('0x0'));var rimraf=require(_0xd359('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd359('0x2'));var moment=require('moment');var BPromise=require(_0xd359('0x3'));var Mustache=require(_0xd359('0x4'));var util=require(_0xd359('0x5'));var path=require(_0xd359('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd359('0x7'));var fs=require('fs');var fs_extra=require(_0xd359('0x8'));var _=require('lodash');var squel=require(_0xd359('0x9'));var crypto=require(_0xd359('0xa'));var jsforce=require(_0xd359('0xb'));var deskjs=require(_0xd359('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd359('0xd'));var Papa=require(_0xd359('0xe'));var Redis=require(_0xd359('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd359('0x10'));var as=require(_0xd359('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd359('0x12'))(_0xd359('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd359('0x14'));var db=require('../../mysqldb')['db'];config[_0xd359('0x15')]=_[_0xd359('0x16')](config[_0xd359('0x15')],{'host':_0xd359('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd359('0x15')]));require(_0xd359('0x18'))[_0xd359('0x19')](socket);function respondWithStatusCode(_0x2db933,_0x482190){_0x482190=_0x482190||0xcc;return function(_0x39749d){if(_0x39749d){return _0x2db933[_0xd359('0x1a')](_0x482190);}return _0x2db933[_0xd359('0x1b')](_0x482190)['end']();};}function respondWithResult(_0x5042f1,_0x43ced4){_0x43ced4=_0x43ced4||0xc8;return function(_0x54497e){if(_0x54497e){return _0x5042f1[_0xd359('0x1b')](_0x43ced4)[_0xd359('0x1c')](_0x54497e);}};}function respondWithFilteredResult(_0x3d866a,_0x149529){return function(_0x4b58df){if(_0x4b58df){var _0x1878c2=typeof _0x149529[_0xd359('0x1d')]==='undefined'&&typeof _0x149529['limit']==='undefined';var _0x41ed02=_0x4b58df[_0xd359('0x1e')];var _0x5766f2=_0x1878c2?0x0:_0x149529['offset'];var _0x26b495=_0x1878c2?_0x4b58df['count']:_0x149529[_0xd359('0x1d')]+_0x149529[_0xd359('0x1f')];var _0x5cd3aa;if(_0x26b495>=_0x41ed02){_0x26b495=_0x41ed02;_0x5cd3aa=0xc8;}else{_0x5cd3aa=0xce;}_0x3d866a[_0xd359('0x1b')](_0x5cd3aa);return _0x3d866a['set'](_0xd359('0x20'),_0x5766f2+'-'+_0x26b495+'/'+_0x41ed02)[_0xd359('0x1c')](_0x4b58df);}return null;};}function patchUpdates(_0x2fffd3){return function(_0xaa083d){try{jsonpatch[_0xd359('0x21')](_0xaa083d,_0x2fffd3,!![]);}catch(_0x19d1dd){return BPromise[_0xd359('0x22')](_0x19d1dd);}return _0xaa083d[_0xd359('0x23')]();};}function saveUpdates(_0x399c5a,_0x2f1c57){return function(_0x514cb7){if(_0x514cb7){return _0x514cb7[_0xd359('0x24')](_0x399c5a)[_0xd359('0x25')](function(_0x5ae091){return _0x5ae091;});}return null;};}function removeEntity(_0x555672,_0x4b06cc){return function(_0x2ca68b){if(_0x2ca68b){return _0x2ca68b['destroy']()['then'](function(){_0x555672['status'](0xcc)[_0xd359('0x26')]();});}};}function handleEntityNotFound(_0x5ca8e4,_0x1bc747){return function(_0x166654){if(!_0x166654){_0x5ca8e4[_0xd359('0x1a')](0x194);}return _0x166654;};}function handleError(_0x2d1f12,_0x632721){_0x632721=_0x632721||0x1f4;return function(_0xc37602){logger[_0xd359('0x27')](_0xc37602['stack']);if(_0xc37602[_0xd359('0x28')]){delete _0xc37602[_0xd359('0x28')];}_0x2d1f12['status'](_0x632721)['send'](_0xc37602);};}exports[_0xd359('0x29')]=function(_0x318c4f,_0x240b15){var _0x182145={},_0x222d60={},_0x1c6ce5={'count':0x0,'rows':[]};var _0x3f7f13=_[_0xd359('0x2a')](db['ChatInternalMessage'][_0xd359('0x2b')],function(_0xa698d2){return{'name':_0xa698d2[_0xd359('0x2c')],'type':_0xa698d2[_0xd359('0x2d')]['key']};});_0x222d60[_0xd359('0x2e')]=_[_0xd359('0x2a')](_0x3f7f13,'name');_0x222d60['query']=_[_0xd359('0x2f')](_0x318c4f[_0xd359('0x30')]);_0x222d60[_0xd359('0x31')]=_[_0xd359('0x32')](_0x222d60['model'],_0x222d60[_0xd359('0x30')]);_0x182145[_0xd359('0x33')]=_['intersection'](_0x222d60[_0xd359('0x2e')],qs[_0xd359('0x34')](_0x318c4f['query'][_0xd359('0x34')]));_0x182145[_0xd359('0x33')]=_0x182145[_0xd359('0x33')][_0xd359('0x35')]?_0x182145[_0xd359('0x33')]:_0x222d60[_0xd359('0x2e')];if(!_0x318c4f[_0xd359('0x30')]['hasOwnProperty'](_0xd359('0x36'))){_0x182145[_0xd359('0x1f')]=qs[_0xd359('0x1f')](_0x318c4f[_0xd359('0x30')][_0xd359('0x1f')]);_0x182145[_0xd359('0x1d')]=qs['offset'](_0x318c4f[_0xd359('0x30')][_0xd359('0x1d')]);}_0x182145['order']=qs[_0xd359('0x37')](_0x318c4f['query']['sort']);_0x182145['where']=qs[_0xd359('0x31')](_[_0xd359('0x38')](_0x318c4f['query'],_0x222d60['filters']),_0x3f7f13);if(_0x318c4f['query'][_0xd359('0x39')]){_0x182145[_0xd359('0x3a')]=_[_0xd359('0x3b')](_0x182145[_0xd359('0x3a')],{'$or':_[_0xd359('0x2a')](_0x3f7f13,function(_0x373dee){if(_0x373dee[_0xd359('0x2d')]!==_0xd359('0x3c')){var _0x532605={};_0x532605[_0x373dee[_0xd359('0x28')]]={'$like':'%'+_0x318c4f[_0xd359('0x30')][_0xd359('0x39')]+'%'};return _0x532605;}})});}_0x182145=_[_0xd359('0x3b')]({},_0x182145,_0x318c4f[_0xd359('0x3d')]);var _0x1e140d={'where':_0x182145[_0xd359('0x3a')]};return db[_0xd359('0x3e')][_0xd359('0x1e')](_0x1e140d)[_0xd359('0x25')](function(_0x3f13e5){_0x1c6ce5[_0xd359('0x1e')]=_0x3f13e5;if(_0x318c4f[_0xd359('0x30')][_0xd359('0x3f')]){_0x182145[_0xd359('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xd359('0x41')](_0x182145);})[_0xd359('0x25')](function(_0x1253e8){_0x1c6ce5[_0xd359('0x42')]=_0x1253e8;return _0x1c6ce5;})[_0xd359('0x25')](respondWithFilteredResult(_0x240b15,_0x182145))['catch'](handleError(_0x240b15,null));};exports[_0xd359('0x43')]=function(_0x3814f3,_0x484b8b){var _0x16b37a={'raw':!![],'where':{'id':_0x3814f3['params']['id']}},_0x396559={};_0x396559[_0xd359('0x2e')]=_[_0xd359('0x2f')](db[_0xd359('0x3e')][_0xd359('0x2b')]);_0x396559[_0xd359('0x30')]=_[_0xd359('0x2f')](_0x3814f3[_0xd359('0x30')]);_0x396559[_0xd359('0x31')]=_['intersection'](_0x396559[_0xd359('0x2e')],_0x396559['query']);_0x16b37a[_0xd359('0x33')]=_[_0xd359('0x32')](_0x396559['model'],qs[_0xd359('0x34')](_0x3814f3['query']['fields']));_0x16b37a[_0xd359('0x33')]=_0x16b37a[_0xd359('0x33')][_0xd359('0x35')]?_0x16b37a[_0xd359('0x33')]:_0x396559['model'];if(_0x3814f3[_0xd359('0x30')][_0xd359('0x3f')]){_0x16b37a[_0xd359('0x40')]=[{'all':!![]}];}_0x16b37a=_[_0xd359('0x3b')]({},_0x16b37a,_0x3814f3['options']);return db[_0xd359('0x3e')]['find'](_0x16b37a)[_0xd359('0x25')](handleEntityNotFound(_0x484b8b,null))[_0xd359('0x25')](respondWithResult(_0x484b8b,null))[_0xd359('0x44')](handleError(_0x484b8b,null));};exports[_0xd359('0x45')]=function(_0x11e6d7,_0x51bee8){return db[_0xd359('0x3e')][_0xd359('0x45')](_0x11e6d7[_0xd359('0x46')],{})[_0xd359('0x25')](respondWithResult(_0x51bee8,0xc9))['catch'](handleError(_0x51bee8,null));};exports['update']=function(_0xcb2169,_0x21afd7){if(_0xcb2169[_0xd359('0x46')]['id']){delete _0xcb2169['body']['id'];}return db[_0xd359('0x3e')][_0xd359('0x47')]({'where':{'id':_0xcb2169[_0xd359('0x48')]['id']}})[_0xd359('0x25')](handleEntityNotFound(_0x21afd7,null))[_0xd359('0x25')](saveUpdates(_0xcb2169['body'],null))[_0xd359('0x25')](respondWithResult(_0x21afd7,null))[_0xd359('0x44')](handleError(_0x21afd7,null));};exports[_0xd359('0x49')]=function(_0x5d486c,_0x16609f){return db[_0xd359('0x3e')][_0xd359('0x47')]({'where':{'id':_0x5d486c[_0xd359('0x48')]['id']}})[_0xd359('0x25')](handleEntityNotFound(_0x16609f,null))[_0xd359('0x25')](removeEntity(_0x16609f,null))[_0xd359('0x44')](handleError(_0x16609f,null));};exports[_0xd359('0x4a')]=function(_0x35825e,_0x51afb3){return db['ChatInternalMessage'][_0xd359('0x4a')]()[_0xd359('0x25')](respondWithResult(_0x51afb3,null))['catch'](handleError(_0x51afb3,null));};function wrapUser(_0x4d0a46){return function(_0x66135d){var _0x1e3578=_0x4d0a46['get']({'plain':!![]});_0x1e3578[_0xd359('0x4b')]=[];if(_0x66135d){_0x1e3578['lastMessageAt']=_0x66135d['createdAt'];_0x1e3578['lastMessage']=_0x66135d;}else{_0x1e3578[_0xd359('0x4c')]=moment(0x0)[_0xd359('0x4d')](_0xd359('0x4e'));_0x1e3578[_0xd359('0x4f')]={};}return _0x1e3578;};}exports[_0xd359('0x50')]=function(_0x1a7ce4,_0x37c58d,_0x205d57){var _0x41cc53=[];return db['User'][_0xd359('0x41')]({'where':{'role':['agent',_0xd359('0x51'),_0xd359('0x52')]},'attributes':['id',_0xd359('0x53'),_0xd359('0x28'),_0xd359('0x54'),_0xd359('0x55'),_0xd359('0x56'),'online','lastLoginAt',_0xd359('0x57'),_0xd359('0x58')],'order':qs['sort'](_0xd359('0x59')),'include':[{'model':db['VoiceQueue'],'as':_0xd359('0x5a'),'attributes':['id',_0xd359('0x28'),_0xd359('0x2d')],'through':{'attributes':[]}}]})[_0xd359('0x25')](function(_0x3ce56b){if(_0x3ce56b){var _0x5a99b0=_0x1a7ce4[_0xd359('0x52')][_0xd359('0x5b')]({'plain':!![]});if(!_0x5a99b0)throw new Error(_0xd359('0x5c'));if(_0x5a99b0[_0xd359('0x54')]===_0xd359('0x52')){return db[_0xd359('0x5d')]['find']({'where':{'name':_0xd359('0x5e'),'userProfileId':_0x5a99b0[_0xd359('0x5f')]},'raw':!![]})[_0xd359('0x25')](function(_0x4b2f23){if(_0x4b2f23){if(_0x4b2f23[_0xd359('0x60')]===0x0){return db[_0xd359('0x61')][_0xd359('0x41')]({'where':{'sectionId':_0x4b2f23['id']},'raw':!![]})[_0xd359('0x25')](function(_0x3eb0cd){var _0x588248=[];if(_[_0xd359('0x62')](_0x3eb0cd)){_0x588248=_[_0xd359('0x39')](_0x3ce56b,function(_0x265119){if(_0x265119[_0xd359('0x54')]!=='agent'){return _0x265119;}});return _0x588248;}else{for(var _0x3d42c0=0x0;_0x3d42c0<_0x3ce56b[_0xd359('0x35')];_0x3d42c0++){var _0x57b96a=_0x3ce56b[_0x3d42c0];if(_0x57b96a[_0xd359('0x54')]===_0xd359('0x63')){var _0xb554f5=_[_0xd359('0x47')](_0x3eb0cd,function(_0x2145b2){return _0x2145b2['resourceId']===_0x57b96a['id'];});if(_0xb554f5)_0x588248[_0xd359('0x64')](_0x57b96a);}else{_0x588248[_0xd359('0x64')](_0x57b96a);}}return _0x588248;}});}else{return _0x3ce56b;}}else{var _0x2f5699=_[_0xd359('0x39')](_0x3ce56b,function(_0x27d40a){if(_0x27d40a[_0xd359('0x54')]!==_0xd359('0x63')){return _0x27d40a;}});return _0x2f5699;}});}else{return _0x3ce56b;}}})['then'](function(_0x20ed14){var _0x450fb5=[];if(_0x20ed14){_0x41cc53=_0x20ed14;for(var _0x7bbdbf=0x0;_0x7bbdbf<_0x20ed14[_0xd359('0x35')];_0x7bbdbf+=0x1){_0x41cc53[_0x7bbdbf]['messages']=[];_0x450fb5['push'](db[_0xd359('0x3e')][_0xd359('0x47')]({'where':{'FromId':[_0x1a7ce4[_0xd359('0x52')]['id'],_0x20ed14[_0x7bbdbf]['id']],'ToId':[_0x1a7ce4['user']['id'],_0x20ed14[_0x7bbdbf]['id']],'ChatGroupId':null},'attributes':['id',_0xd359('0x65'),_0xd359('0x66'),_0xd359('0x67'),'read',_0xd359('0x46')],'order':qs[_0xd359('0x37')](_0xd359('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd359('0x25')](wrapUser(_0x20ed14[_0x7bbdbf])));}return BPromise[_0xd359('0x69')](_0x450fb5);}return[];})[_0xd359('0x25')](function(_0x184efb){return{'rows':_0x184efb,'count':_0x184efb[_0xd359('0x35')]};})[_0xd359('0x25')](respondWithResult(_0x37c58d,null))[_0xd359('0x44')](handleError(_0x37c58d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b8f5553..76a7451 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 _0x2143=['events','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2143,0xf0));var _0x3214=function(_0x25d895,_0x455c2e){_0x25d895=_0x25d895-0x0;var _0x10a795=_0x2143[_0x25d895];return _0x10a795;};'use strict';var EventEmitter=require(_0x3214('0x0'));var ChatInternalMessage=require(_0x3214('0x1'))['db'][_0x3214('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3214('0x3'),'afterUpdate':_0x3214('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f46cf){return function(_0x3539a2,_0x481fd1,_0x18373c){ChatInternalMessageEvents[_0x3214('0x5')](_0x3f46cf+':'+_0x3539a2['id'],_0x3539a2);ChatInternalMessageEvents['emit'](_0x3f46cf,_0x3539a2);_0x18373c(null);};}for(var e in events){if(events[_0x3214('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3214('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x2082=['update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x327e47,_0x1f69a3){var _0xd2b5cd=function(_0x53feec){while(--_0x53feec){_0x327e47['push'](_0x327e47['shift']());}};_0xd2b5cd(++_0x1f69a3);}(_0x2082,0x8e));var _0x2208=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x2082[_0x40b3f2];return _0x4ce90c;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x2208('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2208('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2208('0x2'),'afterDestroy':_0x2208('0x3')};function emitEvent(_0x4d0193){return function(_0x1e0f4f,_0x58604f,_0x12cebf){ChatInternalMessageEvents[_0x2208('0x4')](_0x4d0193+':'+_0x1e0f4f['id'],_0x1e0f4f);ChatInternalMessageEvents[_0x2208('0x4')](_0x4d0193,_0x1e0f4f);_0x12cebf(null);};}for(var e in events){if(events[_0x2208('0x5')](e)){var event=events[e];ChatInternalMessage[_0x2208('0x6')](e,emitEvent(event));}}module[_0x2208('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index ed3cd96..1d285e7 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 _0x64b5=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0x64b5,0x15a));var _0x564b=function(_0x220c72,_0xa3b034){_0x220c72=_0x220c72-0x0;var _0x178cae=_0x64b5[_0x220c72];return _0x178cae;};'use strict';var _=require(_0x564b('0x0'));var util=require(_0x564b('0x1'));var logger=require('../../config/logger')(_0x564b('0x2'));var moment=require('moment');var BPromise=require(_0x564b('0x3'));var rp=require(_0x564b('0x4'));var fs=require('fs');var path=require(_0x564b('0x5'));var rimraf=require(_0x564b('0x6'));var config=require(_0x564b('0x7'));var attributes=require(_0x564b('0x8'));module[_0x564b('0x9')]=function(_0x529f1b,_0x1bb61a){return _0x529f1b[_0x564b('0xa')](_0x564b('0xb'),attributes,{'tableName':_0x564b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x564b('0xd')});}; \ No newline at end of file +var _0x9a0e=['rimraf','../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x21b293,_0x352a44){var _0xd73e84=function(_0x16916b){while(--_0x16916b){_0x21b293['push'](_0x21b293['shift']());}};_0xd73e84(++_0x352a44);}(_0x9a0e,0x1b4));var _0xe9a0=function(_0x326cd0,_0x3f1b4b){_0x326cd0=_0x326cd0-0x0;var _0x5494cc=_0x9a0e[_0x326cd0];return _0x5494cc;};'use strict';var _=require(_0xe9a0('0x0'));var util=require('util');var logger=require(_0xe9a0('0x1'))('api');var moment=require(_0xe9a0('0x2'));var BPromise=require(_0xe9a0('0x3'));var rp=require(_0xe9a0('0x4'));var fs=require('fs');var path=require(_0xe9a0('0x5'));var rimraf=require(_0xe9a0('0x6'));var config=require(_0xe9a0('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xe9a0('0x8')]=function(_0x1ea0ae,_0x3f74a2){return _0x1ea0ae['define'](_0xe9a0('0x9'),attributes,{'tableName':_0xe9a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9a0('0xb'),'collate':_0xe9a0('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 76cc7a0..806645b 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 _0xf3c6=['socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x40c76b,_0x4d33ae){var _0x393722=function(_0x18d8d1){while(--_0x18d8d1){_0x40c76b['push'](_0x40c76b['shift']());}};_0x393722(++_0x4d33ae);}(_0xf3c6,0xc3));var _0x6f3c=function(_0x81a333,_0x120401){_0x81a333=_0x81a333-0x0;var _0x5068cb=_0xf3c6[_0x81a333];return _0x5068cb;};'use strict';var _=require(_0x6f3c('0x0'));var util=require(_0x6f3c('0x1'));var moment=require(_0x6f3c('0x2'));var BPromise=require(_0x6f3c('0x3'));var rs=require(_0x6f3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f3c('0x5'))['db'];var utils=require(_0x6f3c('0x6'));var logger=require(_0x6f3c('0x7'))(_0x6f3c('0x8'));var config=require(_0x6f3c('0x9'));var jayson=require(_0x6f3c('0xa'));var client=jayson[_0x6f3c('0xb')]['http']({'port':0x232a});config[_0x6f3c('0xc')]=_[_0x6f3c('0xd')](config[_0x6f3c('0xc')],{'host':_0x6f3c('0xe'),'port':0x18eb});var socket=require(_0x6f3c('0xf'))(new Redis(config[_0x6f3c('0xc')]));require('./chatInternalMessage.socket')[_0x6f3c('0x10')](socket);function respondWithRpcPromise(_0x4999f9,_0x1b6a19,_0x43c5b0){return new BPromise(function(_0x56787e,_0x6daf26){return client[_0x6f3c('0x11')](_0x4999f9,_0x43c5b0)[_0x6f3c('0x12')](function(_0x29b7e6){logger[_0x6f3c('0x13')](_0x6f3c('0x14'),_0x1b6a19,_0x6f3c('0x15'));logger[_0x6f3c('0x16')](_0x6f3c('0x17'),_0x1b6a19,'request\x20sent',JSON[_0x6f3c('0x18')](_0x29b7e6));if(_0x29b7e6['error']){if(_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1a')]===0x1f4){logger[_0x6f3c('0x19')](_0x6f3c('0x14'),_0x1b6a19,_0x29b7e6['error'][_0x6f3c('0x1b')]);return _0x6daf26(_0x29b7e6['error'][_0x6f3c('0x1b')]);}logger[_0x6f3c('0x19')](_0x6f3c('0x14'),_0x1b6a19,_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1b')]);return _0x56787e(_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1b')]);}else{logger[_0x6f3c('0x13')](_0x6f3c('0x14'),_0x1b6a19,_0x6f3c('0x15'));_0x56787e(_0x29b7e6[_0x6f3c('0x1c')]['message']);}})[_0x6f3c('0x1d')](function(_0x57941e){logger['error'](_0x6f3c('0x14'),_0x1b6a19,_0x57941e);_0x6daf26(_0x57941e);});});} \ No newline at end of file +var _0x8927=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x55200b,_0x2b04bd){var _0x3a68b5=function(_0x5a15e8){while(--_0x5a15e8){_0x55200b['push'](_0x55200b['shift']());}};_0x3a68b5(++_0x2b04bd);}(_0x8927,0x1a8));var _0x7892=function(_0x5e7718,_0x54c123){_0x5e7718=_0x5e7718-0x0;var _0x10b8d3=_0x8927[_0x5e7718];return _0x10b8d3;};'use strict';var _=require(_0x7892('0x0'));var util=require('util');var moment=require(_0x7892('0x1'));var BPromise=require(_0x7892('0x2'));var rs=require(_0x7892('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7892('0x4'))['db'];var utils=require(_0x7892('0x5'));var logger=require(_0x7892('0x6'))('rpc');var config=require(_0x7892('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7892('0x8')][_0x7892('0x9')]({'port':0x232a});config[_0x7892('0xa')]=_['defaults'](config[_0x7892('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7892('0xb'))(new Redis(config['redis']));require(_0x7892('0xc'))[_0x7892('0xd')](socket);function respondWithRpcPromise(_0x533236,_0x500301,_0xa55d04){return new BPromise(function(_0x5497de,_0x1c0943){return client['request'](_0x533236,_0xa55d04)[_0x7892('0xe')](function(_0x388f13){logger['info'](_0x7892('0xf'),_0x500301,_0x7892('0x10'));logger[_0x7892('0x11')](_0x7892('0x12'),_0x500301,_0x7892('0x10'),JSON[_0x7892('0x13')](_0x388f13));if(_0x388f13[_0x7892('0x14')]){if(_0x388f13['error'][_0x7892('0x15')]===0x1f4){logger[_0x7892('0x14')](_0x7892('0xf'),_0x500301,_0x388f13['error']['message']);return _0x1c0943(_0x388f13[_0x7892('0x14')][_0x7892('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x500301,_0x388f13[_0x7892('0x14')][_0x7892('0x16')]);return _0x5497de(_0x388f13[_0x7892('0x14')][_0x7892('0x16')]);}else{logger[_0x7892('0x17')](_0x7892('0xf'),_0x500301,'request\x20sent');_0x5497de(_0x388f13[_0x7892('0x18')][_0x7892('0x16')]);}})['catch'](function(_0x3ee8e1){logger[_0x7892('0x14')](_0x7892('0xf'),_0x500301,_0x3ee8e1);_0x1c0943(_0x3ee8e1);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index fa94ccd..f111afa 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 _0x20cf=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20cf,0x14e));var _0xf20c=function(_0xa13f71,_0x3fd65e){_0xa13f71=_0xa13f71-0x0;var _0x369283=_0x20cf[_0xa13f71];return _0x369283;};'use strict';var ChatInternalMessageEvents=require(_0xf20c('0x0'));var events=['save',_0xf20c('0x1'),_0xf20c('0x2')];function createListener(_0x13be4f,_0x3fbc24){return function(_0x52a235){_0x3fbc24[_0xf20c('0x3')](_0x13be4f,_0x52a235);};}function removeListener(_0x1fbb89,_0x2648a9){return function(){ChatInternalMessageEvents[_0xf20c('0x4')](_0x1fbb89,_0x2648a9);};}exports[_0xf20c('0x5')]=function(_0x3f6315){for(var _0x27833b=0x0,_0x529f77=events['length'];_0x27833b<_0x529f77;_0x27833b++){var _0x2bb24d=events[_0x27833b];var _0x5e34f6=createListener(_0xf20c('0x6')+_0x2bb24d,_0x3f6315);ChatInternalMessageEvents['on'](_0x2bb24d,_0x5e34f6);}}; \ No newline at end of file +var _0x208a=['remove','emit','register','length','./chatInternalMessage.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x208a,0x190));var _0xa208=function(_0xc0c92f,_0x153fc5){_0xc0c92f=_0xc0c92f-0x0;var _0x3fd886=_0x208a[_0xc0c92f];return _0x3fd886;};'use strict';var ChatInternalMessageEvents=require(_0xa208('0x0'));var events=[_0xa208('0x1'),_0xa208('0x2'),'update'];function createListener(_0x162563,_0x311e6e){return function(_0x439cbf){_0x311e6e[_0xa208('0x3')](_0x162563,_0x439cbf);};}function removeListener(_0x411974,_0x49ca8a){return function(){ChatInternalMessageEvents['removeListener'](_0x411974,_0x49ca8a);};}exports[_0xa208('0x4')]=function(_0x5ac9b4){for(var _0x579390=0x0,_0x344f8f=events[_0xa208('0x5')];_0x579390<_0x344f8f;_0x579390++){var _0x4bb167=events[_0x579390];var _0x52b6f0=createListener('chatInternalMessage:'+_0x4bb167,_0x5ac9b4);ChatInternalMessageEvents['on'](_0x4bb167,_0x52b6f0);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2317901..cfd90f2 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 _0xbc7c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','put','update','delete'];(function(_0x206adf,_0x2ba1a3){var _0x171caa=function(_0x43abe7){while(--_0x43abe7){_0x206adf['push'](_0x206adf['shift']());}};_0x171caa(++_0x2ba1a3);}(_0xbc7c,0x1a4));var _0xcbc7=function(_0x3f9d5d,_0x4ee8dd){_0x3f9d5d=_0x3f9d5d-0x0;var _0x1b2cd7=_0xbc7c[_0x3f9d5d];return _0x1b2cd7;};'use strict';var multer=require('multer');var util=require(_0xcbc7('0x0'));var path=require('path');var timeout=require(_0xcbc7('0x1'));var express=require(_0xcbc7('0x2'));var router=express[_0xcbc7('0x3')]();var fs_extra=require(_0xcbc7('0x4'));var auth=require(_0xcbc7('0x5'));var interaction=require(_0xcbc7('0x6'));var config=require(_0xcbc7('0x7'));var controller=require(_0xcbc7('0x8'));router[_0xcbc7('0x9')]('/',auth[_0xcbc7('0xa')](),controller[_0xcbc7('0xb')]);router[_0xcbc7('0x9')](_0xcbc7('0xc'),auth[_0xcbc7('0xa')](),controller['describe']);router[_0xcbc7('0x9')](_0xcbc7('0xd'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0xe')]);router[_0xcbc7('0x9')](_0xcbc7('0xf'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0x10')]);router['post']('/',auth[_0xcbc7('0xa')](),controller['create']);router[_0xcbc7('0x11')]('/:id',controller[_0xcbc7('0x12')]);router[_0xcbc7('0x13')](_0xcbc7('0xf'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0x14')]);module[_0xcbc7('0x15')]=router; \ No newline at end of file +var _0x55c6=['get','index','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x18ceb6,_0x138482){var _0x2282b3=function(_0x134a9b){while(--_0x134a9b){_0x18ceb6['push'](_0x18ceb6['shift']());}};_0x2282b3(++_0x138482);}(_0x55c6,0x1c2));var _0x655c=function(_0x5ea4a6,_0x21779c){_0x5ea4a6=_0x5ea4a6-0x0;var _0x31bb8c=_0x55c6[_0x5ea4a6];return _0x31bb8c;};'use strict';var multer=require(_0x655c('0x0'));var util=require(_0x655c('0x1'));var path=require(_0x655c('0x2'));var timeout=require(_0x655c('0x3'));var express=require(_0x655c('0x4'));var router=express['Router']();var fs_extra=require(_0x655c('0x5'));var auth=require(_0x655c('0x6'));var interaction=require(_0x655c('0x7'));var config=require(_0x655c('0x8'));var controller=require(_0x655c('0x9'));router[_0x655c('0xa')]('/',auth['isAuthenticated'](),controller[_0x655c('0xb')]);router[_0x655c('0xa')]('/describe',auth[_0x655c('0xc')](),controller[_0x655c('0xd')]);router[_0x655c('0xa')](_0x655c('0xe'),auth['isAuthenticated'](),controller[_0x655c('0xf')]);router['get'](_0x655c('0x10'),auth[_0x655c('0xc')](),controller[_0x655c('0x11')]);router[_0x655c('0x12')]('/',auth[_0x655c('0xc')](),controller[_0x655c('0x13')]);router[_0x655c('0x14')]('/:id',controller[_0x655c('0x15')]);router['delete'](_0x655c('0x10'),auth[_0x655c('0xc')](),controller[_0x655c('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b66f46e..86891ae 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 _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x4081a5,_0x27e9e2){_0x4081a5=_0x4081a5-0x0;var _0x59f5d9=_0xe2ab[_0x4081a5];return _0x59f5d9;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x38c9=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x32e28d,_0x385a93){var _0x4459f1=function(_0x5603ea){while(--_0x5603ea){_0x32e28d['push'](_0x32e28d['shift']());}};_0x4459f1(++_0x385a93);}(_0x38c9,0x199));var _0x938c=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x38c9[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'body':{'type':Sequelize[_0x938c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x938c('0x4')]('in',_0x938c('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x938c('0x6')]},'providerName':{'type':Sequelize[_0x938c('0x7')]},'providerResponse':{'type':Sequelize[_0x938c('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0b874b8..36a680a 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 _0x7dc4=['pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','filters','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','Sequelize','QueryTypes','User','rejectmessage','formData','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x17ea4a,_0x4ed55f){var _0x4bddd1=function(_0x3d8366){while(--_0x3d8366){_0x17ea4a['push'](_0x17ea4a['shift']());}};_0x4bddd1(++_0x4ed55f);}(_0x7dc4,0xc6));var _0x47dc=function(_0x5a36a4,_0x2458ee){_0x5a36a4=_0x5a36a4-0x0;var _0x42c736=_0x7dc4[_0x5a36a4];return _0x42c736;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x47dc('0x1'));var moment=require(_0x47dc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x47dc('0x3'));var util=require(_0x47dc('0x4'));var path=require(_0x47dc('0x5'));var sox=require(_0x47dc('0x6'));var csv=require(_0x47dc('0x7'));var ejs=require(_0x47dc('0x8'));var fs=require('fs');var fs_extra=require(_0x47dc('0x9'));var _=require(_0x47dc('0xa'));var squel=require(_0x47dc('0xb'));var crypto=require(_0x47dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47dc('0xd'));var toCsv=require(_0x47dc('0x7'));var querystring=require(_0x47dc('0xe'));var Papa=require(_0x47dc('0xf'));var Redis=require(_0x47dc('0x10'));var authService=require(_0x47dc('0x11'));var qs=require(_0x47dc('0x12'));var as=require(_0x47dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x47dc('0x14'))(_0x47dc('0x15'));var utils=require('../../config/utils');var config=require(_0x47dc('0x16'));var licenseUtil=require(_0x47dc('0x17'));var db=require(_0x47dc('0x18'))['db'];config[_0x47dc('0x19')]=_[_0x47dc('0x1a')](config['redis'],{'host':_0x47dc('0x1b'),'port':0x18eb});var socket=require(_0x47dc('0x1c'))(new Redis(config[_0x47dc('0x19')]));require(_0x47dc('0x1d'))['register'](socket);var jayson=require(_0x47dc('0x1e'));var client=jayson[_0x47dc('0x1f')][_0x47dc('0x20')]({'port':0x232c});var client9002=jayson[_0x47dc('0x1f')][_0x47dc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3fa03f,_0x269920,_0x3a7eb5,_0x4a8bfa){return new BPromise(function(_0x5349bc,_0x4a4461){var _0x684eb1=_0x4a8bfa||client;return _0x684eb1[_0x47dc('0x21')](_0x3fa03f,_0x3a7eb5)['then'](function(_0x44502e){logger[_0x47dc('0x22')](_0x47dc('0x23'),_0x269920,_0x47dc('0x24'));logger['debug'](_0x47dc('0x25'),_0x269920,_0x47dc('0x24'),JSON[_0x47dc('0x26')](_0x44502e));if(_0x44502e['error']){if(_0x44502e[_0x47dc('0x27')][_0x47dc('0x28')]===0x1f4){logger[_0x47dc('0x27')]('ChatMessage,\x20%s,\x20%s',_0x269920,_0x44502e[_0x47dc('0x27')][_0x47dc('0x29')]);return _0x4a4461(_0x44502e[_0x47dc('0x27')][_0x47dc('0x29')]);}logger['error'](_0x47dc('0x23'),_0x269920,_0x44502e[_0x47dc('0x27')]['message']);return _0x5349bc(_0x44502e[_0x47dc('0x27')]['message']);}else{logger[_0x47dc('0x22')](_0x47dc('0x23'),_0x269920,_0x47dc('0x24'));_0x5349bc(_0x44502e[_0x47dc('0x2a')][_0x47dc('0x29')]);}})[_0x47dc('0x2b')](function(_0x3084bf){logger[_0x47dc('0x27')](_0x47dc('0x23'),_0x269920,_0x3084bf);_0x4a4461(_0x3084bf);});});}function respondWithStatusCode(_0x264fd2,_0x522fa1){_0x522fa1=_0x522fa1||0xcc;return function(_0x38a25e){if(_0x38a25e){return _0x264fd2[_0x47dc('0x2c')](_0x522fa1);}return _0x264fd2[_0x47dc('0x2d')](_0x522fa1)[_0x47dc('0x2e')]();};}function respondWithResult(_0x1ba81a,_0x4f156a){_0x4f156a=_0x4f156a||0xc8;return function(_0x4d4b11){if(_0x4d4b11){return _0x1ba81a[_0x47dc('0x2d')](_0x4f156a)[_0x47dc('0x2f')](_0x4d4b11);}};}function respondWithFilteredResult(_0x271125,_0x5a2755){return function(_0x280fa4){if(_0x280fa4){var _0x2ecbcb=typeof _0x5a2755[_0x47dc('0x30')]===_0x47dc('0x31')&&typeof _0x5a2755[_0x47dc('0x32')]===_0x47dc('0x31');var _0x2eaf64=_0x280fa4[_0x47dc('0x33')];var _0x50fdab=_0x2ecbcb?0x0:_0x5a2755[_0x47dc('0x30')];var _0x1c2db2=_0x2ecbcb?_0x280fa4[_0x47dc('0x33')]:_0x5a2755[_0x47dc('0x30')]+_0x5a2755['limit'];var _0x4ab4ac;if(_0x1c2db2>=_0x2eaf64){_0x1c2db2=_0x2eaf64;_0x4ab4ac=0xc8;}else{_0x4ab4ac=0xce;}_0x271125[_0x47dc('0x2d')](_0x4ab4ac);return _0x271125[_0x47dc('0x34')]('Content-Range',_0x50fdab+'-'+_0x1c2db2+'/'+_0x2eaf64)[_0x47dc('0x2f')](_0x280fa4);}return null;};}function patchUpdates(_0x7b99a4){return function(_0x24518b){try{jsonpatch[_0x47dc('0x35')](_0x24518b,_0x7b99a4,!![]);}catch(_0x5d42b2){return BPromise[_0x47dc('0x36')](_0x5d42b2);}return _0x24518b[_0x47dc('0x37')]();};}function saveUpdates(_0xb18998,_0x4ab2f0){return function(_0x2098e2){if(_0x2098e2){return _0x2098e2['update'](_0xb18998)['then'](function(_0x957aac){return _0x957aac;});}return null;};}function removeEntity(_0x147183,_0xccf155){return function(_0x458987){if(_0x458987){return _0x458987[_0x47dc('0x38')]()[_0x47dc('0x39')](function(){_0x147183[_0x47dc('0x2d')](0xcc)[_0x47dc('0x2e')]();});}};}function handleEntityNotFound(_0x18cd39,_0x5724fb){return function(_0x215181){if(!_0x215181){_0x18cd39[_0x47dc('0x2c')](0x194);}return _0x215181;};}function handleError(_0x490925,_0x1fb21d){_0x1fb21d=_0x1fb21d||0x1f4;return function(_0x4176bb){logger[_0x47dc('0x27')](_0x4176bb[_0x47dc('0x3a')]);if(_0x4176bb[_0x47dc('0x3b')]){delete _0x4176bb[_0x47dc('0x3b')];}_0x490925[_0x47dc('0x2d')](_0x1fb21d)[_0x47dc('0x3c')](_0x4176bb);};}exports[_0x47dc('0x3d')]=function(_0x6383fe,_0x41fe35){var _0x4e7ad7={},_0x5f0409={},_0x52206e={'count':0x0,'rows':[]};var _0x2949e2=_[_0x47dc('0x3e')](db[_0x47dc('0x3f')][_0x47dc('0x40')],function(_0x31fec8){return{'name':_0x31fec8[_0x47dc('0x41')],'type':_0x31fec8[_0x47dc('0x42')][_0x47dc('0x43')]};});_0x5f0409[_0x47dc('0x44')]=_[_0x47dc('0x3e')](_0x2949e2,_0x47dc('0x3b'));_0x5f0409['query']=_[_0x47dc('0x45')](_0x6383fe['query']);_0x5f0409['filters']=_['intersection'](_0x5f0409[_0x47dc('0x44')],_0x5f0409[_0x47dc('0x46')]);_0x4e7ad7[_0x47dc('0x47')]=_[_0x47dc('0x48')](_0x5f0409['model'],qs[_0x47dc('0x49')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x49')]));_0x4e7ad7[_0x47dc('0x47')]=_0x4e7ad7[_0x47dc('0x47')][_0x47dc('0x4a')]?_0x4e7ad7[_0x47dc('0x47')]:_0x5f0409['model'];if(!_0x6383fe[_0x47dc('0x46')][_0x47dc('0x4b')](_0x47dc('0x4c'))){_0x4e7ad7[_0x47dc('0x32')]=qs[_0x47dc('0x32')](_0x6383fe['query'][_0x47dc('0x32')]);_0x4e7ad7[_0x47dc('0x30')]=qs[_0x47dc('0x30')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x30')]);}_0x4e7ad7[_0x47dc('0x4d')]=qs[_0x47dc('0x4e')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x4e')]);_0x4e7ad7[_0x47dc('0x4f')]=qs['filters'](_[_0x47dc('0x50')](_0x6383fe[_0x47dc('0x46')],_0x5f0409['filters']),_0x2949e2);if(_0x6383fe[_0x47dc('0x46')]['filter']){_0x4e7ad7[_0x47dc('0x4f')]=_[_0x47dc('0x51')](_0x4e7ad7[_0x47dc('0x4f')],{'$or':_[_0x47dc('0x3e')](_0x2949e2,function(_0x58a6aa){if(_0x58a6aa[_0x47dc('0x42')]!==_0x47dc('0x52')){var _0x441c56={};_0x441c56[_0x58a6aa[_0x47dc('0x3b')]]={'$like':'%'+_0x6383fe[_0x47dc('0x46')][_0x47dc('0x53')]+'%'};return _0x441c56;}})});}_0x4e7ad7=_[_0x47dc('0x51')]({},_0x4e7ad7,_0x6383fe['options']);var _0x2c6d45={'where':_0x4e7ad7[_0x47dc('0x4f')]};return db[_0x47dc('0x3f')][_0x47dc('0x33')](_0x2c6d45)['then'](function(_0x5e193c){_0x52206e[_0x47dc('0x33')]=_0x5e193c;if(_0x6383fe[_0x47dc('0x46')][_0x47dc('0x54')]){_0x4e7ad7[_0x47dc('0x55')]=[{'all':!![]}];}return db[_0x47dc('0x3f')][_0x47dc('0x56')](_0x4e7ad7);})[_0x47dc('0x39')](function(_0x16b542){_0x52206e[_0x47dc('0x57')]=_0x16b542;return _0x52206e;})[_0x47dc('0x39')](respondWithFilteredResult(_0x41fe35,_0x4e7ad7))[_0x47dc('0x2b')](handleError(_0x41fe35,null));};exports['show']=function(_0x41a2a8,_0x1764c5){var _0x149097={'raw':!![],'where':{'id':_0x41a2a8[_0x47dc('0x58')]['id']}},_0x1e9be4={};_0x1e9be4[_0x47dc('0x44')]=_[_0x47dc('0x45')](db['ChatMessage'][_0x47dc('0x40')]);_0x1e9be4['query']=_['keys'](_0x41a2a8[_0x47dc('0x46')]);_0x1e9be4[_0x47dc('0x59')]=_[_0x47dc('0x48')](_0x1e9be4[_0x47dc('0x44')],_0x1e9be4['query']);_0x149097[_0x47dc('0x47')]=_[_0x47dc('0x48')](_0x1e9be4[_0x47dc('0x44')],qs[_0x47dc('0x49')](_0x41a2a8[_0x47dc('0x46')][_0x47dc('0x49')]));_0x149097['attributes']=_0x149097[_0x47dc('0x47')]['length']?_0x149097[_0x47dc('0x47')]:_0x1e9be4['model'];if(_0x41a2a8[_0x47dc('0x46')][_0x47dc('0x54')]){_0x149097['include']=[{'all':!![]}];}_0x149097=_[_0x47dc('0x51')]({},_0x149097,_0x41a2a8[_0x47dc('0x5a')]);return db[_0x47dc('0x3f')][_0x47dc('0x5b')](_0x149097)[_0x47dc('0x39')](handleEntityNotFound(_0x1764c5,null))[_0x47dc('0x39')](respondWithResult(_0x1764c5,null))[_0x47dc('0x2b')](handleError(_0x1764c5,null));};exports[_0x47dc('0x5c')]=function(_0x20cae8,_0x4fbfba){return db[_0x47dc('0x3f')][_0x47dc('0x5c')](_0x20cae8[_0x47dc('0x5d')],{})['then'](respondWithResult(_0x4fbfba,0xc9))[_0x47dc('0x2b')](handleError(_0x4fbfba,null));};exports['update']=function(_0x47ad5f,_0x442e5b){if(_0x47ad5f[_0x47dc('0x5d')]['id']){delete _0x47ad5f[_0x47dc('0x5d')]['id'];}return db[_0x47dc('0x3f')][_0x47dc('0x5b')]({'where':{'id':_0x47ad5f[_0x47dc('0x58')]['id']}})[_0x47dc('0x39')](handleEntityNotFound(_0x442e5b,null))[_0x47dc('0x39')](saveUpdates(_0x47ad5f['body'],null))[_0x47dc('0x39')](respondWithResult(_0x442e5b,null))[_0x47dc('0x2b')](handleError(_0x442e5b,null));};exports['destroy']=function(_0x1b3e5f,_0x392859){return db['ChatMessage']['find']({'where':{'id':_0x1b3e5f[_0x47dc('0x58')]['id']}})['then'](handleEntityNotFound(_0x392859,null))[_0x47dc('0x39')](removeEntity(_0x392859,null))[_0x47dc('0x2b')](handleError(_0x392859,null));};exports[_0x47dc('0x5e')]=function(_0x132539,_0x16ee97){return db['ChatMessage'][_0x47dc('0x5e')]()[_0x47dc('0x39')](respondWithResult(_0x16ee97,null))[_0x47dc('0x2b')](handleError(_0x16ee97,null));};var interaction_log=require('../../config/logger')(_0x47dc('0x5f'));exports[_0x47dc('0x60')]=function(_0x38c8e1,_0x181337,_0x57fa75){var _0x118f8a={'agent':{},'channel':_0x47dc('0x61')};if(_0x38c8e1[_0x47dc('0x5d')]['id']){delete _0x38c8e1[_0x47dc('0x5d')]['id'];}_0x38c8e1['body'][_0x47dc('0x62')]=!![];_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x63')]=moment()[_0x47dc('0x64')](_0x47dc('0x65'));_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')]=_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')]||_0x38c8e1[_0x47dc('0x67')]['id'];_0x118f8a[_0x47dc('0x68')]['id']=_0x38c8e1['body'][_0x47dc('0x66')];return db['ChatMessage'][_0x47dc('0x5b')]({'where':{'id':_0x38c8e1[_0x47dc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x181337,null))['then'](saveUpdates(_0x38c8e1[_0x47dc('0x5d')],null))[_0x47dc('0x39')](function(_0x5e5613){if(_0x5e5613){_0x118f8a[_0x47dc('0x29')]=_0x5e5613[_0x47dc('0x69')]({'plain':!![]});return db[_0x47dc('0x6a')][_0x47dc('0x5b')]({'where':{'id':_0x5e5613[_0x47dc('0x6b')]}});}return null;})[_0x47dc('0x39')](handleEntityNotFound(_0x181337,null))[_0x47dc('0x39')](function(_0x593b42){if(_0x593b42){return _0x593b42[_0x47dc('0x6c')]({'UserId':_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')],'read1stAt':_[_0x47dc('0x6d')](_0x593b42[_0x47dc('0x6e')])?moment()[_0x47dc('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x47dc('0x39')](function(_0x40d1b5){if(_0x40d1b5){_0x118f8a[_0x47dc('0x6f')]=_0x40d1b5[_0x47dc('0x69')]({'plain':!![]});interaction_log[_0x47dc('0x22')](_0x47dc('0x70'),_0x38c8e1['user']['id'],_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x3b')],_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x71')],_0x118f8a[_0x47dc('0x6f')]['id'],_0x38c8e1['body']?JSON['stringify'](_0x38c8e1['body']):_0x47dc('0x72'));return respondWithRpcPromise(_0x47dc('0x73'),'acceptMessage',_0x118f8a);}return null;})[_0x47dc('0x39')](function(_0x24971a){var _0x3b0e4a=_0x47dc('0x74')+_0x24971a[_0x47dc('0x29')][_0x47dc('0x75')];return db[_0x47dc('0x76')]['query'](_0x3b0e4a,{'type':db['Sequelize']['QueryTypes'][_0x47dc('0x77')],'raw':!![]})[_0x47dc('0x39')](function(_0x5c06c7){return _0x5c06c7;});})[_0x47dc('0x39')](function(_0x2a05a4){if(_0x2a05a4){_0x118f8a[_0x47dc('0x29')][_0x47dc('0x78')]=_0x2a05a4[0x0];if(!_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')])return;return db['User']['find']({'where':{'id':_0x38c8e1['body']['UserId'],'role':_0x47dc('0x68')},'attributes':['id','name',_0x47dc('0x79'),_0x47dc('0x7a'),_0x47dc('0x7b')],'raw':!![]});}return null;})['then'](function(_0x9cfb91){if(!_0x9cfb91)return null;_0x118f8a['message'][_0x47dc('0x68')]=_0x9cfb91;return _0x118f8a;})['then'](function(_0x4209d8){if(_0x4209d8){if(_0x38c8e1[_0x47dc('0x5d')]['manual']){_0x118f8a['message'][_0x47dc('0x7c')]=util[_0x47dc('0x64')](_0x47dc('0x7d'),_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x3b')]);_0x118f8a['message']['channel']=_0x118f8a[_0x47dc('0x7e')];_0x118f8a[_0x47dc('0x29')][_0x47dc('0x7f')]=_0x118f8a[_0x47dc('0x7e')];_0x118f8a[_0x47dc('0x29')][_0x47dc('0x80')]=_0x47dc('0x60');return respondWithRpcPromise(_0x47dc('0x81'),'EventManager',{'event':_0x47dc('0x82'),'message':_[_0x47dc('0x51')](_0x118f8a[_0x47dc('0x29')],JSON[_0x47dc('0x83')](_0x118f8a[_0x47dc('0x6f')]['formData']))},client9002)[_0x47dc('0x39')](function(){return _0x118f8a;});}return _0x118f8a;}return null;})[_0x47dc('0x39')](respondWithResult(_0x181337,null))[_0x47dc('0x2b')](handleError(_0x181337,null));};var interaction_log=require(_0x47dc('0x14'))(_0x47dc('0x5f'));exports[_0x47dc('0x36')]=function(_0x3f7143,_0x21fddf,_0x1cc529){var _0x1a1a6e={'agent':{},'channel':_0x47dc('0x61')};if(_0x3f7143[_0x47dc('0x5d')]['id']){delete _0x3f7143[_0x47dc('0x5d')]['id'];}_0x3f7143[_0x47dc('0x5d')][_0x47dc('0x66')]=_0x3f7143['body'][_0x47dc('0x66')]||_0x3f7143[_0x47dc('0x67')]['id'];_0x1a1a6e[_0x47dc('0x68')]['id']=_0x3f7143['body'][_0x47dc('0x66')];return db[_0x47dc('0x3f')]['find']({'where':{'id':_0x3f7143[_0x47dc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21fddf,null))[_0x47dc('0x39')](function(_0x38cb0f){if(_0x38cb0f){_0x1a1a6e['message']=_0x38cb0f[_0x47dc('0x69')]({'plain':!![]});return db[_0x47dc('0x6a')]['find']({'where':{'id':_0x38cb0f[_0x47dc('0x6b')]}});}return null;})[_0x47dc('0x39')](handleEntityNotFound(_0x21fddf,null))[_0x47dc('0x39')](function(_0x2d2d86){if(_0x2d2d86){_0x1a1a6e[_0x47dc('0x6f')]=_0x2d2d86[_0x47dc('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3f7143[_0x47dc('0x67')]['id'],_0x3f7143[_0x47dc('0x67')][_0x47dc('0x3b')],_0x3f7143[_0x47dc('0x67')][_0x47dc('0x71')],_0x1a1a6e[_0x47dc('0x6f')]['id'],_0x3f7143[_0x47dc('0x5d')]?JSON[_0x47dc('0x26')](_0x3f7143[_0x47dc('0x5d')]):_0x47dc('0x72'));return respondWithRpcPromise(_0x47dc('0x84'),_0x47dc('0x85'),_0x1a1a6e);}return null;})[_0x47dc('0x39')](function(_0x2f5bab){var _0x1dd4db=_0x47dc('0x74')+_0x2f5bab['message'][_0x47dc('0x75')];return db[_0x47dc('0x76')][_0x47dc('0x46')](_0x1dd4db,{'type':db[_0x47dc('0x86')][_0x47dc('0x87')]['SELECT'],'raw':!![]})['then'](function(_0x1db391){return _0x1db391;});})[_0x47dc('0x39')](function(_0x414d64){if(_0x414d64){_0x1a1a6e[_0x47dc('0x29')][_0x47dc('0x78')]=_0x414d64[0x0];if(!_0x3f7143[_0x47dc('0x5d')]['UserId'])return;return db[_0x47dc('0x88')][_0x47dc('0x5b')]({'where':{'id':_0x3f7143[_0x47dc('0x5d')][_0x47dc('0x66')],'role':_0x47dc('0x68')},'attributes':['id','name','fullname','email',_0x47dc('0x7b')],'raw':!![]});}return null;})[_0x47dc('0x39')](function(_0x20c37e){if(!_0x20c37e)return null;_0x1a1a6e[_0x47dc('0x29')]['agent']=_0x20c37e;return _0x1a1a6e;})['then'](function(_0x15f739){if(_0x15f739){_0x15f739['message'][_0x47dc('0x7c')]=util[_0x47dc('0x64')](_0x47dc('0x7d'),_0x3f7143['user'][_0x47dc('0x3b')]);_0x15f739[_0x47dc('0x29')][_0x47dc('0x7e')]=_0x1a1a6e['channel'];_0x15f739[_0x47dc('0x29')][_0x47dc('0x7f')]=_0x1a1a6e[_0x47dc('0x7e')];_0x15f739[_0x47dc('0x29')][_0x47dc('0x80')]=_0x47dc('0x36');respondWithRpcPromise(_0x47dc('0x81'),_0x47dc('0x81'),{'event':_0x47dc('0x89'),'message':_[_0x47dc('0x51')](_0x1a1a6e[_0x47dc('0x29')],JSON['parse'](_0x1a1a6e[_0x47dc('0x6f')][_0x47dc('0x8a')]))},client9002);return _0x1a1a6e;}return null;})[_0x47dc('0x39')](respondWithResult(_0x21fddf,null))[_0x47dc('0x2b')](handleError(_0x21fddf,null));}; \ No newline at end of file +var _0x47b6=['ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','acceptMessage','sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','rejectmessage','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','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','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','findAll','rows','show','length','include','find','create','body','params','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x47b6,0xa8));var _0x647b=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x47b6[_0x2389bc];return _0x170548;};'use strict';var emlformat=require(_0x647b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x647b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x647b('0x2'));var moment=require(_0x647b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x647b('0x4'));var util=require(_0x647b('0x5'));var path=require('path');var sox=require(_0x647b('0x6'));var csv=require(_0x647b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x647b('0x8'));var _=require(_0x647b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x647b('0xa'));var deskjs=require(_0x647b('0xb'));var toCsv=require(_0x647b('0x7'));var querystring=require('querystring');var Papa=require(_0x647b('0xc'));var Redis=require(_0x647b('0xd'));var authService=require(_0x647b('0xe'));var qs=require(_0x647b('0xf'));var as=require(_0x647b('0x10'));var hardwareService=require(_0x647b('0x11'));var logger=require(_0x647b('0x12'))(_0x647b('0x13'));var utils=require('../../config/utils');var config=require(_0x647b('0x14'));var licenseUtil=require(_0x647b('0x15'));var db=require(_0x647b('0x16'))['db'];config[_0x647b('0x17')]=_['defaults'](config[_0x647b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x647b('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x647b('0x19')](socket);var jayson=require(_0x647b('0x1a'));var client=jayson[_0x647b('0x1b')][_0x647b('0x1c')]({'port':0x232c});var client9002=jayson[_0x647b('0x1b')][_0x647b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2c69fa,_0x519d53,_0x2f030e,_0x105cff){return new BPromise(function(_0x5e0948,_0x3913b4){var _0x384c74=_0x105cff||client;return _0x384c74[_0x647b('0x1d')](_0x2c69fa,_0x2f030e)[_0x647b('0x1e')](function(_0x2b1c5a){logger['info'](_0x647b('0x1f'),_0x519d53,'request\x20sent');logger['debug'](_0x647b('0x20'),_0x519d53,'request\x20sent',JSON[_0x647b('0x21')](_0x2b1c5a));if(_0x2b1c5a[_0x647b('0x22')]){if(_0x2b1c5a[_0x647b('0x22')][_0x647b('0x23')]===0x1f4){logger[_0x647b('0x22')](_0x647b('0x1f'),_0x519d53,_0x2b1c5a[_0x647b('0x22')]['message']);return _0x3913b4(_0x2b1c5a['error'][_0x647b('0x24')]);}logger[_0x647b('0x22')]('ChatMessage,\x20%s,\x20%s',_0x519d53,_0x2b1c5a[_0x647b('0x22')][_0x647b('0x24')]);return _0x5e0948(_0x2b1c5a['error'][_0x647b('0x24')]);}else{logger[_0x647b('0x25')]('ChatMessage,\x20%s,\x20%s',_0x519d53,_0x647b('0x26'));_0x5e0948(_0x2b1c5a[_0x647b('0x27')][_0x647b('0x24')]);}})[_0x647b('0x28')](function(_0x126d0e){logger[_0x647b('0x22')](_0x647b('0x1f'),_0x519d53,_0x126d0e);_0x3913b4(_0x126d0e);});});}function respondWithStatusCode(_0x569dfb,_0xa3e96b){_0xa3e96b=_0xa3e96b||0xcc;return function(_0x2828af){if(_0x2828af){return _0x569dfb[_0x647b('0x29')](_0xa3e96b);}return _0x569dfb[_0x647b('0x2a')](_0xa3e96b)[_0x647b('0x2b')]();};}function respondWithResult(_0x389472,_0x164f55){_0x164f55=_0x164f55||0xc8;return function(_0x56e5a8){if(_0x56e5a8){return _0x389472[_0x647b('0x2a')](_0x164f55)[_0x647b('0x2c')](_0x56e5a8);}};}function respondWithFilteredResult(_0x562583,_0x4f6f85){return function(_0x294c16){if(_0x294c16){var _0x4e9536=typeof _0x4f6f85[_0x647b('0x2d')]===_0x647b('0x2e')&&typeof _0x4f6f85[_0x647b('0x2f')]===_0x647b('0x2e');var _0x20b0b4=_0x294c16[_0x647b('0x30')];var _0x1a9dcf=_0x4e9536?0x0:_0x4f6f85[_0x647b('0x2d')];var _0x3eabd5=_0x4e9536?_0x294c16[_0x647b('0x30')]:_0x4f6f85[_0x647b('0x2d')]+_0x4f6f85[_0x647b('0x2f')];var _0x15bb11;if(_0x3eabd5>=_0x20b0b4){_0x3eabd5=_0x20b0b4;_0x15bb11=0xc8;}else{_0x15bb11=0xce;}_0x562583[_0x647b('0x2a')](_0x15bb11);return _0x562583[_0x647b('0x31')](_0x647b('0x32'),_0x1a9dcf+'-'+_0x3eabd5+'/'+_0x20b0b4)['json'](_0x294c16);}return null;};}function patchUpdates(_0xfd598f){return function(_0x2139ac){try{jsonpatch['apply'](_0x2139ac,_0xfd598f,!![]);}catch(_0x10763c){return BPromise[_0x647b('0x33')](_0x10763c);}return _0x2139ac['save']();};}function saveUpdates(_0x4e3f7e,_0x1e30f5){return function(_0x5ef5a9){if(_0x5ef5a9){return _0x5ef5a9[_0x647b('0x34')](_0x4e3f7e)[_0x647b('0x1e')](function(_0x282359){return _0x282359;});}return null;};}function removeEntity(_0x413ecf,_0x4d7c64){return function(_0x187bba){if(_0x187bba){return _0x187bba[_0x647b('0x35')]()[_0x647b('0x1e')](function(){_0x413ecf[_0x647b('0x2a')](0xcc)[_0x647b('0x2b')]();});}};}function handleEntityNotFound(_0x306e8d,_0x5e5f57){return function(_0x25f01e){if(!_0x25f01e){_0x306e8d[_0x647b('0x29')](0x194);}return _0x25f01e;};}function handleError(_0x41cbb6,_0x5eacc7){_0x5eacc7=_0x5eacc7||0x1f4;return function(_0x429df8){logger['error'](_0x429df8[_0x647b('0x36')]);if(_0x429df8[_0x647b('0x37')]){delete _0x429df8[_0x647b('0x37')];}_0x41cbb6[_0x647b('0x2a')](_0x5eacc7)[_0x647b('0x38')](_0x429df8);};}exports[_0x647b('0x39')]=function(_0x20e154,_0x1a1e6e){var _0x2879c9={},_0x172783={},_0x29260a={'count':0x0,'rows':[]};var _0x422d1c=_['map'](db['ChatMessage'][_0x647b('0x3a')],function(_0x8c1f27){return{'name':_0x8c1f27[_0x647b('0x3b')],'type':_0x8c1f27['type'][_0x647b('0x3c')]};});_0x172783[_0x647b('0x3d')]=_[_0x647b('0x3e')](_0x422d1c,_0x647b('0x37'));_0x172783[_0x647b('0x3f')]=_[_0x647b('0x40')](_0x20e154[_0x647b('0x3f')]);_0x172783[_0x647b('0x41')]=_[_0x647b('0x42')](_0x172783[_0x647b('0x3d')],_0x172783[_0x647b('0x3f')]);_0x2879c9[_0x647b('0x43')]=_[_0x647b('0x42')](_0x172783['model'],qs[_0x647b('0x44')](_0x20e154[_0x647b('0x3f')][_0x647b('0x44')]));_0x2879c9[_0x647b('0x43')]=_0x2879c9[_0x647b('0x43')]['length']?_0x2879c9[_0x647b('0x43')]:_0x172783[_0x647b('0x3d')];if(!_0x20e154[_0x647b('0x3f')]['hasOwnProperty'](_0x647b('0x45'))){_0x2879c9[_0x647b('0x2f')]=qs[_0x647b('0x2f')](_0x20e154['query'][_0x647b('0x2f')]);_0x2879c9['offset']=qs[_0x647b('0x2d')](_0x20e154[_0x647b('0x3f')][_0x647b('0x2d')]);}_0x2879c9[_0x647b('0x46')]=qs[_0x647b('0x47')](_0x20e154[_0x647b('0x3f')][_0x647b('0x47')]);_0x2879c9[_0x647b('0x48')]=qs[_0x647b('0x41')](_[_0x647b('0x49')](_0x20e154[_0x647b('0x3f')],_0x172783['filters']),_0x422d1c);if(_0x20e154[_0x647b('0x3f')][_0x647b('0x4a')]){_0x2879c9[_0x647b('0x48')]=_[_0x647b('0x4b')](_0x2879c9['where'],{'$or':_['map'](_0x422d1c,function(_0x177181){if(_0x177181['type']!==_0x647b('0x4c')){var _0x2a9553={};_0x2a9553[_0x177181[_0x647b('0x37')]]={'$like':'%'+_0x20e154[_0x647b('0x3f')][_0x647b('0x4a')]+'%'};return _0x2a9553;}})});}_0x2879c9=_[_0x647b('0x4b')]({},_0x2879c9,_0x20e154[_0x647b('0x4d')]);var _0x2687de={'where':_0x2879c9['where']};return db[_0x647b('0x4e')][_0x647b('0x30')](_0x2687de)[_0x647b('0x1e')](function(_0x28e874){_0x29260a['count']=_0x28e874;if(_0x20e154['query'][_0x647b('0x4f')]){_0x2879c9['include']=[{'all':!![]}];}return db['ChatMessage'][_0x647b('0x50')](_0x2879c9);})[_0x647b('0x1e')](function(_0x212cb3){_0x29260a[_0x647b('0x51')]=_0x212cb3;return _0x29260a;})['then'](respondWithFilteredResult(_0x1a1e6e,_0x2879c9))[_0x647b('0x28')](handleError(_0x1a1e6e,null));};exports[_0x647b('0x52')]=function(_0x1c66e,_0x4c6f3a){var _0x3f5a7d={'raw':!![],'where':{'id':_0x1c66e['params']['id']}},_0x5a3cb9={};_0x5a3cb9[_0x647b('0x3d')]=_[_0x647b('0x40')](db[_0x647b('0x4e')][_0x647b('0x3a')]);_0x5a3cb9[_0x647b('0x3f')]=_['keys'](_0x1c66e[_0x647b('0x3f')]);_0x5a3cb9[_0x647b('0x41')]=_['intersection'](_0x5a3cb9['model'],_0x5a3cb9[_0x647b('0x3f')]);_0x3f5a7d[_0x647b('0x43')]=_['intersection'](_0x5a3cb9[_0x647b('0x3d')],qs['fields'](_0x1c66e[_0x647b('0x3f')][_0x647b('0x44')]));_0x3f5a7d[_0x647b('0x43')]=_0x3f5a7d['attributes'][_0x647b('0x53')]?_0x3f5a7d[_0x647b('0x43')]:_0x5a3cb9[_0x647b('0x3d')];if(_0x1c66e['query'][_0x647b('0x4f')]){_0x3f5a7d[_0x647b('0x54')]=[{'all':!![]}];}_0x3f5a7d=_['merge']({},_0x3f5a7d,_0x1c66e['options']);return db[_0x647b('0x4e')][_0x647b('0x55')](_0x3f5a7d)[_0x647b('0x1e')](handleEntityNotFound(_0x4c6f3a,null))[_0x647b('0x1e')](respondWithResult(_0x4c6f3a,null))[_0x647b('0x28')](handleError(_0x4c6f3a,null));};exports[_0x647b('0x56')]=function(_0x5e4521,_0x49128a){return db[_0x647b('0x4e')][_0x647b('0x56')](_0x5e4521[_0x647b('0x57')],{})[_0x647b('0x1e')](respondWithResult(_0x49128a,0xc9))['catch'](handleError(_0x49128a,null));};exports['update']=function(_0x2f1cd8,_0x2b9904){if(_0x2f1cd8[_0x647b('0x57')]['id']){delete _0x2f1cd8['body']['id'];}return db['ChatMessage']['find']({'where':{'id':_0x2f1cd8[_0x647b('0x58')]['id']}})[_0x647b('0x1e')](handleEntityNotFound(_0x2b9904,null))[_0x647b('0x1e')](saveUpdates(_0x2f1cd8['body'],null))[_0x647b('0x1e')](respondWithResult(_0x2b9904,null))[_0x647b('0x28')](handleError(_0x2b9904,null));};exports[_0x647b('0x35')]=function(_0x44a995,_0x5d1970){return db[_0x647b('0x4e')][_0x647b('0x55')]({'where':{'id':_0x44a995[_0x647b('0x58')]['id']}})[_0x647b('0x1e')](handleEntityNotFound(_0x5d1970,null))[_0x647b('0x1e')](removeEntity(_0x5d1970,null))[_0x647b('0x28')](handleError(_0x5d1970,null));};exports[_0x647b('0x59')]=function(_0x37c817,_0x402d5d){return db[_0x647b('0x4e')][_0x647b('0x59')]()[_0x647b('0x1e')](respondWithResult(_0x402d5d,null))[_0x647b('0x28')](handleError(_0x402d5d,null));};var interaction_log=require(_0x647b('0x12'))('chat-interactions');exports[_0x647b('0x5a')]=function(_0x5331ec,_0x761e92,_0x4db536){var _0xe942b3={'agent':{},'channel':'chat'};if(_0x5331ec[_0x647b('0x57')]['id']){delete _0x5331ec[_0x647b('0x57')]['id'];}_0x5331ec[_0x647b('0x57')][_0x647b('0x5b')]=!![];_0x5331ec[_0x647b('0x57')][_0x647b('0x5c')]=moment()[_0x647b('0x5d')](_0x647b('0x5e'));_0x5331ec[_0x647b('0x57')]['UserId']=_0x5331ec[_0x647b('0x57')]['UserId']||_0x5331ec['user']['id'];_0xe942b3['agent']['id']=_0x5331ec['body'][_0x647b('0x5f')];return db['ChatMessage'][_0x647b('0x55')]({'where':{'id':_0x5331ec[_0x647b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x761e92,null))[_0x647b('0x1e')](saveUpdates(_0x5331ec[_0x647b('0x57')],null))[_0x647b('0x1e')](function(_0x49f265){if(_0x49f265){_0xe942b3[_0x647b('0x24')]=_0x49f265['get']({'plain':!![]});return db[_0x647b('0x60')][_0x647b('0x55')]({'where':{'id':_0x49f265[_0x647b('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x761e92,null))[_0x647b('0x1e')](function(_0x4b0927){if(_0x4b0927){return _0x4b0927[_0x647b('0x34')]({'UserId':_0x5331ec[_0x647b('0x57')][_0x647b('0x5f')],'read1stAt':_['isNil'](_0x4b0927[_0x647b('0x62')])?moment()[_0x647b('0x5d')](_0x647b('0x5e')):undefined});}return null;})['then'](function(_0x1ca21b){if(_0x1ca21b){_0xe942b3['interaction']=_0x1ca21b['get']({'plain':!![]});interaction_log[_0x647b('0x25')](_0x647b('0x63'),_0x5331ec['user']['id'],_0x5331ec[_0x647b('0x64')][_0x647b('0x37')],_0x5331ec[_0x647b('0x64')][_0x647b('0x65')],_0xe942b3[_0x647b('0x66')]['id'],_0x5331ec[_0x647b('0x57')]?JSON[_0x647b('0x21')](_0x5331ec[_0x647b('0x57')]):_0x647b('0x67'));return respondWithRpcPromise('AcceptMessage',_0x647b('0x68'),_0xe942b3);}return null;})[_0x647b('0x1e')](function(_0x5e8c18){var _0x11e275='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e8c18[_0x647b('0x24')]['ContactId'];return db[_0x647b('0x69')][_0x647b('0x3f')](_0x11e275,{'type':db['Sequelize'][_0x647b('0x6a')][_0x647b('0x6b')],'raw':!![]})[_0x647b('0x1e')](function(_0x1fd3e2){return _0x1fd3e2;});})[_0x647b('0x1e')](function(_0x508722){if(_0x508722){_0xe942b3[_0x647b('0x24')]['contact']=_0x508722[0x0];if(!_0x5331ec[_0x647b('0x57')][_0x647b('0x5f')])return;return db[_0x647b('0x6c')]['find']({'where':{'id':_0x5331ec[_0x647b('0x57')][_0x647b('0x5f')],'role':_0x647b('0x6d')},'attributes':['id',_0x647b('0x37'),_0x647b('0x6e'),_0x647b('0x6f'),_0x647b('0x70')],'raw':!![]});}return null;})[_0x647b('0x1e')](function(_0x483387){if(!_0x483387)return null;_0xe942b3['message'][_0x647b('0x6d')]=_0x483387;return _0xe942b3;})[_0x647b('0x1e')](function(_0x117d30){if(_0x117d30){if(_0x5331ec['body']['manual']){_0xe942b3[_0x647b('0x24')][_0x647b('0x71')]=util['format'](_0x647b('0x72'),_0x5331ec[_0x647b('0x64')][_0x647b('0x37')]);_0xe942b3[_0x647b('0x24')]['channel']=_0xe942b3[_0x647b('0x73')];_0xe942b3[_0x647b('0x24')][_0x647b('0x74')]=_0xe942b3[_0x647b('0x73')];_0xe942b3['message'][_0x647b('0x75')]='accept';return respondWithRpcPromise(_0x647b('0x76'),_0x647b('0x76'),{'event':_0x647b('0x77'),'message':_[_0x647b('0x4b')](_0xe942b3[_0x647b('0x24')],JSON[_0x647b('0x78')](_0xe942b3['interaction'][_0x647b('0x79')]))},client9002)[_0x647b('0x1e')](function(){return _0xe942b3;});}return _0xe942b3;}return null;})[_0x647b('0x1e')](respondWithResult(_0x761e92,null))[_0x647b('0x28')](handleError(_0x761e92,null));};var interaction_log=require('../../config/logger')(_0x647b('0x7a'));exports[_0x647b('0x33')]=function(_0x331812,_0x442556,_0x5aea61){var _0x5a59c0={'agent':{},'channel':_0x647b('0x7b')};if(_0x331812['body']['id']){delete _0x331812[_0x647b('0x57')]['id'];}_0x331812[_0x647b('0x57')][_0x647b('0x5f')]=_0x331812[_0x647b('0x57')][_0x647b('0x5f')]||_0x331812[_0x647b('0x64')]['id'];_0x5a59c0[_0x647b('0x6d')]['id']=_0x331812[_0x647b('0x57')][_0x647b('0x5f')];return db[_0x647b('0x4e')][_0x647b('0x55')]({'where':{'id':_0x331812[_0x647b('0x58')]['id'],'UserId':null}})[_0x647b('0x1e')](handleEntityNotFound(_0x442556,null))[_0x647b('0x1e')](function(_0x40fe5c){if(_0x40fe5c){_0x5a59c0[_0x647b('0x24')]=_0x40fe5c[_0x647b('0x7c')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x40fe5c[_0x647b('0x61')]}});}return null;})[_0x647b('0x1e')](handleEntityNotFound(_0x442556,null))['then'](function(_0x24b851){if(_0x24b851){_0x5a59c0[_0x647b('0x66')]=_0x24b851[_0x647b('0x7c')]({'plain':!![]});interaction_log[_0x647b('0x25')](_0x647b('0x7d'),_0x331812[_0x647b('0x64')]['id'],_0x331812['user']['name'],_0x331812[_0x647b('0x64')]['role'],_0x5a59c0[_0x647b('0x66')]['id'],_0x331812[_0x647b('0x57')]?JSON[_0x647b('0x21')](_0x331812['body']):_0x647b('0x67'));return respondWithRpcPromise(_0x647b('0x7e'),_0x647b('0x7f'),_0x5a59c0);}return null;})[_0x647b('0x1e')](function(_0x245e65){var _0x3c3c4c=_0x647b('0x80')+_0x245e65[_0x647b('0x24')][_0x647b('0x81')];return db[_0x647b('0x69')]['query'](_0x3c3c4c,{'type':db['Sequelize'][_0x647b('0x6a')]['SELECT'],'raw':!![]})[_0x647b('0x1e')](function(_0x1dc0e9){return _0x1dc0e9;});})['then'](function(_0x42a57b){if(_0x42a57b){_0x5a59c0[_0x647b('0x24')][_0x647b('0x82')]=_0x42a57b[0x0];if(!_0x331812[_0x647b('0x57')]['UserId'])return;return db[_0x647b('0x6c')][_0x647b('0x55')]({'where':{'id':_0x331812[_0x647b('0x57')]['UserId'],'role':_0x647b('0x6d')},'attributes':['id','name',_0x647b('0x6e'),_0x647b('0x6f'),_0x647b('0x70')],'raw':!![]});}return null;})[_0x647b('0x1e')](function(_0x58d3d4){if(!_0x58d3d4)return null;_0x5a59c0[_0x647b('0x24')][_0x647b('0x6d')]=_0x58d3d4;return _0x5a59c0;})['then'](function(_0x5ada05){if(_0x5ada05){_0x5ada05[_0x647b('0x24')][_0x647b('0x71')]=util['format'](_0x647b('0x72'),_0x331812[_0x647b('0x64')][_0x647b('0x37')]);_0x5ada05['message'][_0x647b('0x73')]=_0x5a59c0[_0x647b('0x73')];_0x5ada05[_0x647b('0x24')]['motionChannel']=_0x5a59c0['channel'];_0x5ada05[_0x647b('0x24')][_0x647b('0x75')]=_0x647b('0x33');respondWithRpcPromise('EventManager',_0x647b('0x76'),{'event':_0x647b('0x83'),'message':_[_0x647b('0x4b')](_0x5a59c0[_0x647b('0x24')],JSON['parse'](_0x5a59c0[_0x647b('0x66')][_0x647b('0x79')]))},client9002);return _0x5a59c0;}return null;})[_0x647b('0x1e')](respondWithResult(_0x442556,null))['catch'](handleError(_0x442556,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 74ccdfc..6ecc940 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 _0x3229=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x2c7341,_0x293a18){var _0x23f3fc=function(_0x5ca3f1){while(--_0x5ca3f1){_0x2c7341['push'](_0x2c7341['shift']());}};_0x23f3fc(++_0x293a18);}(_0x3229,0x1d8));var _0x9322=function(_0x3c6882,_0x29c499){_0x3c6882=_0x3c6882-0x0;var _0x153e94=_0x3229[_0x3c6882];return _0x153e94;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x9322('0x0'))['db'][_0x9322('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9322('0x2')](0x0);var events={'afterCreate':_0x9322('0x3'),'afterUpdate':_0x9322('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1245d8){return function(_0x7ec496,_0x2ca41e,_0x40ed8e){ChatMessageEvents['emit'](_0x1245d8+':'+_0x7ec496['id'],_0x7ec496);ChatMessageEvents[_0x9322('0x5')](_0x1245d8,_0x7ec496);_0x40ed8e(null);};}for(var e in events){if(events[_0x9322('0x6')](e)){var event=events[e];ChatMessage[_0x9322('0x7')](e,emitEvent(event));}}module[_0x9322('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xa760=['../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x125106,_0x1a5f5d){var _0xc1ffd5=function(_0x338ca5){while(--_0x338ca5){_0x125106['push'](_0x125106['shift']());}};_0xc1ffd5(++_0x1a5f5d);}(_0xa760,0x180));var _0x0a76=function(_0x3cc751,_0x38b8ff){_0x3cc751=_0x3cc751-0x0;var _0x3956a2=_0xa760[_0x3cc751];return _0x3956a2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0a76('0x0'))['db'][_0x0a76('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0a76('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a76('0x3'),'afterDestroy':_0x0a76('0x4')};function emitEvent(_0x36a2ac){return function(_0x57cff1,_0x2f6d2c,_0x49be67){ChatMessageEvents[_0x0a76('0x5')](_0x36a2ac+':'+_0x57cff1['id'],_0x57cff1);ChatMessageEvents[_0x0a76('0x5')](_0x36a2ac,_0x57cff1);_0x49be67(null);};}for(var e in events){if(events[_0x0a76('0x6')](e)){var event=events[e];ChatMessage[_0x0a76('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 2305c40..6bfae95 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 _0x8ff5=['findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','toLowerCase','direction','out','secret','isNil'];(function(_0x193615,_0x270fc5){var _0x27f1ee=function(_0x1c4b99){while(--_0x1c4b99){_0x193615['push'](_0x193615['shift']());}};_0x27f1ee(++_0x270fc5);}(_0x8ff5,0x78));var _0x58ff=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8ff5[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x58ff('0x0'));var util=require(_0x58ff('0x1'));var logger=require(_0x58ff('0x2'))(_0x58ff('0x3'));var moment=require(_0x58ff('0x4'));var BPromise=require(_0x58ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ff('0x6'));var rimraf=require(_0x58ff('0x7'));var config=require('../../config/environment');var attributes=require(_0x58ff('0x8'));module[_0x58ff('0x9')]=function(_0x52ff98,_0x425959){return _0x52ff98[_0x58ff('0xa')](_0x58ff('0xb'),attributes,{'tableName':_0x58ff('0xc'),'paranoid':![],'indexes':[{'name':_0x58ff('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd5ad15,_0xe0c97e,_0x3fa63d){var _0x59ecbd=_0x52ff98[_0x58ff('0xe')];var _0x5945eb=_0xd5ad15['get']({'plain':!![]});if(_0x5945eb['direction'][_0x58ff('0xf')]()==='in'||_0x5945eb[_0x58ff('0x10')][_0x58ff('0xf')]()===_0x58ff('0x11')&&!_0x5945eb[_0x58ff('0x12')]&&!_[_0x58ff('0x13')](_0x5945eb['UserId'])){_0x59ecbd['ChatInteraction'][_0x58ff('0x14')]({'where':{'id':_0x5945eb[_0x58ff('0x15')]}})[_0x58ff('0x16')](function(_0x5c0d4f){if(_0x5c0d4f){_0x5c0d4f[_0x58ff('0x17')]({'lastMsgAt':_0x5945eb[_0x58ff('0x18')],'lastMsgDirection':_0x5945eb[_0x58ff('0x10')][_0x58ff('0xf')]()});}})[_0x58ff('0x19')](function(_0x1e4c13){console['error'](_0x1e4c13);});}_0x3fa63d();}},'charset':_0x58ff('0x1a'),'collate':_0x58ff('0x1b')});}; \ No newline at end of file +var _0x8ff4=['exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','./chatMessage.attributes'];(function(_0x561432,_0x21ec65){var _0x3485b6=function(_0x3e022f){while(--_0x3e022f){_0x561432['push'](_0x561432['shift']());}};_0x3485b6(++_0x21ec65);}(_0x8ff4,0x111));var _0x48ff=function(_0xa5a920,_0x2d8772){_0xa5a920=_0xa5a920-0x0;var _0x596618=_0x8ff4[_0xa5a920];return _0x596618;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x48ff('0x0'))(_0x48ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x48ff('0x2'));module[_0x48ff('0x3')]=function(_0x1eca59,_0x40e89a){return _0x1eca59[_0x48ff('0x4')](_0x48ff('0x5'),attributes,{'tableName':_0x48ff('0x6'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x48ff('0x7')],'type':_0x48ff('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22c558,_0x31360b,_0x1d6982){var _0x22317c=_0x1eca59[_0x48ff('0x9')];var _0x220a76=_0x22c558['get']({'plain':!![]});if(_0x220a76[_0x48ff('0xa')][_0x48ff('0xb')]()==='in'||_0x220a76['direction'][_0x48ff('0xb')]()===_0x48ff('0xc')&&!_0x220a76['secret']&&!_['isNil'](_0x220a76['UserId'])){_0x22317c[_0x48ff('0xd')][_0x48ff('0xe')]({'where':{'id':_0x220a76[_0x48ff('0xf')]}})[_0x48ff('0x10')](function(_0x370dd4){if(_0x370dd4){_0x370dd4[_0x48ff('0x11')]({'lastMsgAt':_0x220a76[_0x48ff('0x12')],'lastMsgDirection':_0x220a76[_0x48ff('0xa')][_0x48ff('0xb')]()});}})[_0x48ff('0x13')](function(_0x413630){console[_0x48ff('0x14')](_0x413630);});}_0x1d6982();}},'charset':_0x48ff('0x15'),'collate':_0x48ff('0x16')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 035a1ee..38171a5 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 _0x2f9b=['defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4456c9,_0x29aff0){var _0x3a9e5d=function(_0x316ae8){while(--_0x316ae8){_0x4456c9['push'](_0x4456c9['shift']());}};_0x3a9e5d(++_0x29aff0);}(_0x2f9b,0x1b8));var _0xb2f9=function(_0x104e85,_0x5c9b9e){_0x104e85=_0x104e85-0x0;var _0x9e137b=_0x2f9b[_0x104e85];return _0x9e137b;};'use strict';var _=require(_0xb2f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb2f9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2f9('0x2'))['db'];var utils=require(_0xb2f9('0x3'));var logger=require(_0xb2f9('0x4'))(_0xb2f9('0x5'));var config=require(_0xb2f9('0x6'));var jayson=require(_0xb2f9('0x7'));var client=jayson[_0xb2f9('0x8')]['http']({'port':0x232a});config[_0xb2f9('0x9')]=_[_0xb2f9('0xa')](config[_0xb2f9('0x9')],{'host':_0xb2f9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb2f9('0xc'))[_0xb2f9('0xd')](socket);function respondWithRpcPromise(_0x42eaff,_0x5a2604,_0x11af68){return new BPromise(function(_0x589b2c,_0x9bad5a){return client[_0xb2f9('0xe')](_0x42eaff,_0x11af68)[_0xb2f9('0xf')](function(_0x454206){logger[_0xb2f9('0x10')](_0xb2f9('0x11'),_0x5a2604,_0xb2f9('0x12'));logger[_0xb2f9('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5a2604,'request\x20sent',JSON[_0xb2f9('0x14')](_0x454206));if(_0x454206[_0xb2f9('0x15')]){if(_0x454206[_0xb2f9('0x15')]['code']===0x1f4){logger[_0xb2f9('0x15')](_0xb2f9('0x11'),_0x5a2604,_0x454206[_0xb2f9('0x15')][_0xb2f9('0x16')]);return _0x9bad5a(_0x454206[_0xb2f9('0x15')]['message']);}logger[_0xb2f9('0x15')](_0xb2f9('0x11'),_0x5a2604,_0x454206['error'][_0xb2f9('0x16')]);return _0x589b2c(_0x454206[_0xb2f9('0x15')][_0xb2f9('0x16')]);}else{logger['info'](_0xb2f9('0x11'),_0x5a2604,_0xb2f9('0x12'));_0x589b2c(_0x454206[_0xb2f9('0x17')][_0xb2f9('0x16')]);}})[_0xb2f9('0x18')](function(_0x14c46e){logger[_0xb2f9('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5a2604,_0x14c46e);_0x9bad5a(_0x14c46e);});});}exports[_0xb2f9('0x19')]=function(_0x25630a){var _0x52084f=this;return new Promise(function(_0x42cd7c,_0x112853){return db['ChatMessage'][_0xb2f9('0x1a')](_0x25630a[_0xb2f9('0x1b')],{'raw':_0x25630a[_0xb2f9('0x1c')]?_0x25630a['options'][_0xb2f9('0x1d')]===undefined?!![]:![]:!![]})[_0xb2f9('0xf')](function(_0x28de41){logger[_0xb2f9('0x10')](_0xb2f9('0x19'),_0x25630a);logger['debug']('CreateChatMessage',_0x25630a,JSON[_0xb2f9('0x14')](_0x28de41));_0x42cd7c(_0x28de41);})['catch'](function(_0x1808e3){logger[_0xb2f9('0x15')](_0xb2f9('0x19'),_0x1808e3[_0xb2f9('0x16')],_0x25630a);_0x112853(_0x52084f[_0xb2f9('0x15')](0x1f4,_0x1808e3[_0xb2f9('0x16')]));});});}; \ No newline at end of file +var _0x5b4c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','catch','CreateChatMessage','body','options','raw','debug','stringify','lodash','moment'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x5b4c,0x17e));var _0xc5b4=function(_0x5cd0db,_0x524fe4){_0x5cd0db=_0x5cd0db-0x0;var _0x193a95=_0x5b4c[_0x5cd0db];return _0x193a95;};'use strict';var _=require(_0xc5b4('0x0'));var util=require('util');var moment=require(_0xc5b4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5b4('0x2'));var fs=require('fs');var Redis=require(_0xc5b4('0x3'));var db=require(_0xc5b4('0x4'))['db'];var utils=require(_0xc5b4('0x5'));var logger=require(_0xc5b4('0x6'))(_0xc5b4('0x7'));var config=require(_0xc5b4('0x8'));var jayson=require(_0xc5b4('0x9'));var client=jayson[_0xc5b4('0xa')][_0xc5b4('0xb')]({'port':0x232a});config[_0xc5b4('0xc')]=_[_0xc5b4('0xd')](config[_0xc5b4('0xc')],{'host':_0xc5b4('0xe'),'port':0x18eb});var socket=require(_0xc5b4('0xf'))(new Redis(config['redis']));require(_0xc5b4('0x10'))[_0xc5b4('0x11')](socket);function respondWithRpcPromise(_0x286d94,_0x58b900,_0x13dc12){return new BPromise(function(_0xcad4b2,_0xa92337){return client['request'](_0x286d94,_0x13dc12)[_0xc5b4('0x12')](function(_0x1dfee3){logger['info'](_0xc5b4('0x13'),_0x58b900,_0xc5b4('0x14'));logger['debug'](_0xc5b4('0x15'),_0x58b900,'request\x20sent',JSON['stringify'](_0x1dfee3));if(_0x1dfee3[_0xc5b4('0x16')]){if(_0x1dfee3[_0xc5b4('0x16')]['code']===0x1f4){logger[_0xc5b4('0x16')](_0xc5b4('0x13'),_0x58b900,_0x1dfee3['error'][_0xc5b4('0x17')]);return _0xa92337(_0x1dfee3[_0xc5b4('0x16')]['message']);}logger[_0xc5b4('0x16')]('ChatMessage,\x20%s,\x20%s',_0x58b900,_0x1dfee3[_0xc5b4('0x16')]['message']);return _0xcad4b2(_0x1dfee3[_0xc5b4('0x16')]['message']);}else{logger[_0xc5b4('0x18')]('ChatMessage,\x20%s,\x20%s',_0x58b900,_0xc5b4('0x14'));_0xcad4b2(_0x1dfee3['result'][_0xc5b4('0x17')]);}})[_0xc5b4('0x19')](function(_0xe2a94){logger[_0xc5b4('0x16')](_0xc5b4('0x13'),_0x58b900,_0xe2a94);_0xa92337(_0xe2a94);});});}exports[_0xc5b4('0x1a')]=function(_0x37543){var _0x28b07e=this;return new Promise(function(_0x4b0535,_0x530d1a){return db['ChatMessage']['create'](_0x37543[_0xc5b4('0x1b')],{'raw':_0x37543[_0xc5b4('0x1c')]?_0x37543[_0xc5b4('0x1c')][_0xc5b4('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4a6396){logger[_0xc5b4('0x18')]('CreateChatMessage',_0x37543);logger[_0xc5b4('0x1e')](_0xc5b4('0x1a'),_0x37543,JSON[_0xc5b4('0x1f')](_0x4a6396));_0x4b0535(_0x4a6396);})['catch'](function(_0x51af23){logger['error'](_0xc5b4('0x1a'),_0x51af23[_0xc5b4('0x17')],_0x37543);_0x530d1a(_0x28b07e[_0xc5b4('0x16')](0x1f4,_0x51af23[_0xc5b4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index dc1d7fc..b2526ce 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 _0x425d=['./chatMessage.events','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x425d,0x1e0));var _0xd425=function(_0x25f26c,_0x16a416){_0x25f26c=_0x25f26c-0x0;var _0x5db63d=_0x425d[_0x25f26c];return _0x5db63d;};'use strict';var ChatMessageEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatMessageEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatMessageEvents['on'](_0x50b061,_0xb6ba8e);}}; \ No newline at end of file +var _0x56a4=['removeListener','register','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x277f16,_0x124582){var _0x31d595=function(_0x5b9dd6){while(--_0x5b9dd6){_0x277f16['push'](_0x277f16['shift']());}};_0x31d595(++_0x124582);}(_0x56a4,0x11b));var _0x456a=function(_0x54784f,_0x2a24d8){_0x54784f=_0x54784f-0x0;var _0x241e1b=_0x56a4[_0x54784f];return _0x241e1b;};'use strict';var ChatMessageEvents=require(_0x456a('0x0'));var events=[_0x456a('0x1'),'remove',_0x456a('0x2')];function createListener(_0x93d98f,_0x5f3fe1){return function(_0x478cac){_0x5f3fe1[_0x456a('0x3')](_0x93d98f,_0x478cac);};}function removeListener(_0x3a11ee,_0x143999){return function(){ChatMessageEvents[_0x456a('0x4')](_0x3a11ee,_0x143999);};}exports[_0x456a('0x5')]=function(_0x4b8eec){for(var _0x3b0145=0x0,_0x52b38d=events['length'];_0x3b0145<_0x52b38d;_0x3b0145++){var _0x2b6329=events[_0x3b0145];var _0x20c8e0=createListener(_0x456a('0x6')+_0x2b6329,_0x4b8eec);ChatMessageEvents['on'](_0x2b6329,_0x20c8e0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 54b17d8..c5ac4cc 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 _0x04bd=['../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x17d8a1,_0x54e6be){var _0x3ceab1=function(_0x479187){while(--_0x479187){_0x17d8a1['push'](_0x17d8a1['shift']());}};_0x3ceab1(++_0x54e6be);}(_0x04bd,0x15a));var _0xd04b=function(_0x398958,_0x27152c){_0x398958=_0x398958-0x0;var _0xdc7c70=_0x04bd[_0x398958];return _0xdc7c70;};'use strict';var multer=require(_0xd04b('0x0'));var util=require(_0xd04b('0x1'));var path=require('path');var timeout=require(_0xd04b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd04b('0x3'));var auth=require(_0xd04b('0x4'));var interaction=require(_0xd04b('0x5'));var config=require('../../config/environment');var controller=require(_0xd04b('0x6'));router[_0xd04b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd04b('0x7')](_0xd04b('0x8'),auth[_0xd04b('0x9')](),controller[_0xd04b('0xa')]);router[_0xd04b('0x7')](_0xd04b('0xb'),auth[_0xd04b('0x9')](),controller[_0xd04b('0xc')]);router[_0xd04b('0xd')]('/',auth[_0xd04b('0x9')](),interaction[_0xd04b('0xe')](_0xd04b('0xf'),'chatmessage:create'),controller[_0xd04b('0x10')]);router[_0xd04b('0x11')]('/:id',controller[_0xd04b('0x12')]);router['put'](_0xd04b('0x13'),auth[_0xd04b('0x9')](),controller[_0xd04b('0x14')]);router[_0xd04b('0x11')](_0xd04b('0x15'),auth[_0xd04b('0x9')](),controller[_0xd04b('0x16')]);router[_0xd04b('0x17')](_0xd04b('0xb'),auth['isAuthenticated'](),controller[_0xd04b('0x18')]);module['exports']=router; \ No newline at end of file +var _0xd06a=['/describe','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0xd06a,0xf1));var _0xad06=function(_0x154941,_0x1adba3){_0x154941=_0x154941-0x0;var _0x37263e=_0xd06a[_0x154941];return _0x37263e;};'use strict';var multer=require(_0xad06('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad06('0x1'));var router=express[_0xad06('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad06('0x3'));var config=require(_0xad06('0x4'));var controller=require(_0xad06('0x5'));router[_0xad06('0x6')]('/',auth[_0xad06('0x7')](),controller[_0xad06('0x8')]);router[_0xad06('0x6')](_0xad06('0x9'),auth[_0xad06('0x7')](),controller[_0xad06('0xa')]);router[_0xad06('0x6')](_0xad06('0xb'),auth['isAuthenticated'](),controller[_0xad06('0xc')]);router[_0xad06('0xd')]('/',auth[_0xad06('0x7')](),interaction[_0xad06('0xe')](_0xad06('0xf'),'chatmessage:create'),controller[_0xad06('0x10')]);router[_0xad06('0x11')]('/:id',controller[_0xad06('0x12')]);router[_0xad06('0x11')](_0xad06('0x13'),auth['isAuthenticated'](),controller[_0xad06('0x14')]);router['put'](_0xad06('0x15'),auth[_0xad06('0x7')](),controller[_0xad06('0x16')]);router[_0xad06('0x17')](_0xad06('0xb'),auth[_0xad06('0x7')](),controller['destroy']);module[_0xad06('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index efbd8f8..52683a4 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 _0xbf3f=['sequelize'];(function(_0x36db79,_0xcae976){var _0x2da19a=function(_0x761b07){while(--_0x761b07){_0x36db79['push'](_0x36db79['shift']());}};_0x2da19a(++_0xcae976);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfbf3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x12b7=['medium','sequelize'];(function(_0x2c3254,_0x4a3c6c){var _0x3fd4c3=function(_0x5104b1){while(--_0x5104b1){_0x2c3254['push'](_0x2c3254['shift']());}};_0x3fd4c3(++_0x4a3c6c);}(_0x12b7,0x81));var _0x712b=function(_0x5a3834,_0x576a43){_0x5a3834=_0x5a3834-0x0;var _0x5cb9cf=_0x12b7[_0x5a3834];return _0x5cb9cf;};'use strict';var Sequelize=require(_0x712b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x712b('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 81bac30..9e1bd3e 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x87e2dc,_0xf40092){_0x87e2dc=_0x87e2dc-0x0;var _0x1d8350=_0x7a54[_0x87e2dc];return _0x1d8350;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7a54,0x106));var _0x47a5=function(_0x5bc939,_0x4b1c1e){_0x5bc939=_0x5bc939-0x0;var _0x285dbf=_0x7a54[_0x5bc939];return _0x285dbf;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 694cdfc..9e006fd 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 _0x4e5d=['utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x4e5d,0x195));var _0xd4e5=function(_0x55e4e1,_0x352a79){_0x55e4e1=_0x55e4e1-0x0;var _0x1644e8=_0x4e5d[_0x55e4e1];return _0x1644e8;};'use strict';var _=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd4e5('0x2'));var BPromise=require('bluebird');var rp=require(_0xd4e5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4e5('0x4'));var config=require(_0xd4e5('0x5'));var attributes=require(_0xd4e5('0x6'));module[_0xd4e5('0x7')]=function(_0x3d8502,_0x318199){return _0x3d8502[_0xd4e5('0x8')](_0xd4e5('0x9'),attributes,{'tableName':_0xd4e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4e5('0xb'),'collate':_0xd4e5('0xc')});}; \ No newline at end of file +var _0x0de7=['rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x50e67a,_0x229f13){var _0x4f9963=function(_0x5c4e0b){while(--_0x5c4e0b){_0x50e67a['push'](_0x50e67a['shift']());}};_0x4f9963(++_0x229f13);}(_0x0de7,0x96));var _0x70de=function(_0xd52bb2,_0x444c1e){_0xd52bb2=_0xd52bb2-0x0;var _0x371f7b=_0x0de7[_0xd52bb2];return _0x371f7b;};'use strict';var _=require('lodash');var util=require(_0x70de('0x0'));var logger=require(_0x70de('0x1'))('api');var moment=require(_0x70de('0x2'));var BPromise=require(_0x70de('0x3'));var rp=require(_0x70de('0x4'));var fs=require('fs');var path=require(_0x70de('0x5'));var rimraf=require(_0x70de('0x6'));var config=require(_0x70de('0x7'));var attributes=require(_0x70de('0x8'));module['exports']=function(_0x498b73,_0x1e29c8){return _0x498b73[_0x70de('0x9')](_0x70de('0xa'),attributes,{'tableName':_0x70de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f93cc55..a600038 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 _0xc123=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info'];(function(_0x51065c,_0x12e389){var _0x3575d7=function(_0x3858b2){while(--_0x3858b2){_0x51065c['push'](_0x51065c['shift']());}};_0x3575d7(++_0x12e389);}(_0xc123,0x193));var _0x3c12=function(_0x2a8862,_0x1ce5bb){_0x2a8862=_0x2a8862-0x0;var _0x56fc9d=_0xc123[_0x2a8862];return _0x56fc9d;};'use strict';var _=require('lodash');var util=require(_0x3c12('0x0'));var moment=require(_0x3c12('0x1'));var BPromise=require(_0x3c12('0x2'));var rs=require(_0x3c12('0x3'));var fs=require('fs');var Redis=require(_0x3c12('0x4'));var db=require(_0x3c12('0x5'))['db'];var utils=require(_0x3c12('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c12('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b1e8,_0x361fb5,_0x5b8e3f){return new BPromise(function(_0x585ac5,_0x527053){return client[_0x3c12('0x8')](_0x10b1e8,_0x5b8e3f)[_0x3c12('0x9')](function(_0x11f3a4){logger[_0x3c12('0xa')](_0x3c12('0xb'),_0x361fb5,_0x3c12('0xc'));logger[_0x3c12('0xd')](_0x3c12('0xe'),_0x361fb5,_0x3c12('0xc'),JSON['stringify'](_0x11f3a4));if(_0x11f3a4['error']){if(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x10')]===0x1f4){logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x11f3a4[_0x3c12('0xf')]['message']);return _0x527053(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x11')]);}logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x11f3a4[_0x3c12('0xf')]['message']);return _0x585ac5(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x11')]);}else{logger[_0x3c12('0xa')](_0x3c12('0xb'),_0x361fb5,'request\x20sent');_0x585ac5(_0x11f3a4['result'][_0x3c12('0x11')]);}})['catch'](function(_0x4c5234){logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x4c5234);_0x527053(_0x4c5234);});});} \ No newline at end of file +var _0x0999=['request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x586cfa,_0x4c84c9){var _0x460cd8=function(_0x20588a){while(--_0x20588a){_0x586cfa['push'](_0x586cfa['shift']());}};_0x460cd8(++_0x4c84c9);}(_0x0999,0xa5));var _0x9099=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x0999[_0x5517c0];return _0x33803b;};'use strict';var _=require(_0x9099('0x0'));var util=require('util');var moment=require(_0x9099('0x1'));var BPromise=require('bluebird');var rs=require(_0x9099('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9099('0x3'))['db'];var utils=require(_0x9099('0x4'));var logger=require(_0x9099('0x5'))(_0x9099('0x6'));var config=require(_0x9099('0x7'));var jayson=require(_0x9099('0x8'));var client=jayson[_0x9099('0x9')][_0x9099('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbbc20e,_0x753d25,_0x5b6cb0){return new BPromise(function(_0x480708,_0x441c99){return client[_0x9099('0xb')](_0xbbc20e,_0x5b6cb0)['then'](function(_0x2db8ec){logger[_0x9099('0xc')](_0x9099('0xd'),_0x753d25,_0x9099('0xe'));logger['debug'](_0x9099('0xf'),_0x753d25,_0x9099('0xe'),JSON[_0x9099('0x10')](_0x2db8ec));if(_0x2db8ec[_0x9099('0x11')]){if(_0x2db8ec[_0x9099('0x11')][_0x9099('0x12')]===0x1f4){logger[_0x9099('0x11')](_0x9099('0xd'),_0x753d25,_0x2db8ec[_0x9099('0x11')]['message']);return _0x441c99(_0x2db8ec[_0x9099('0x11')][_0x9099('0x13')]);}logger['error'](_0x9099('0xd'),_0x753d25,_0x2db8ec[_0x9099('0x11')]['message']);return _0x480708(_0x2db8ec[_0x9099('0x11')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x753d25,_0x9099('0xe'));_0x480708(_0x2db8ec[_0x9099('0x14')][_0x9099('0x13')]);}})[_0x9099('0x15')](function(_0x5f1316){logger[_0x9099('0x11')](_0x9099('0xd'),_0x753d25,_0x5f1316);_0x441c99(_0x5f1316);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 8c994a6..9ee07cf 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 _0x61ed=['get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0xa3f42f,_0x1fe568){var _0x403be2=function(_0x3737d3){while(--_0x3737d3){_0xa3f42f['push'](_0xa3f42f['shift']());}};_0x403be2(++_0x1fe568);}(_0x61ed,0x1df));var _0xd61e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61ed[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd61e('0x0'));var util=require(_0xd61e('0x1'));var path=require('path');var timeout=require(_0xd61e('0x2'));var express=require(_0xd61e('0x3'));var router=express[_0xd61e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd61e('0x5'));var config=require(_0xd61e('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xd61e('0x7')]('/',auth[_0xd61e('0x8')](),controller[_0xd61e('0x9')]);router[_0xd61e('0x7')](_0xd61e('0xa'),auth[_0xd61e('0x8')](),controller['describe']);router[_0xd61e('0x7')](_0xd61e('0xb'),auth[_0xd61e('0x8')](),controller[_0xd61e('0xc')]);router['post']('/',auth[_0xd61e('0x8')](),controller[_0xd61e('0xd')]);router['put'](_0xd61e('0xb'),auth['isAuthenticated'](),controller[_0xd61e('0xe')]);router[_0xd61e('0xf')](_0xd61e('0xb'),auth[_0xd61e('0x8')](),controller[_0xd61e('0x10')]);module[_0xd61e('0x11')]=router; \ No newline at end of file +var _0xeee8=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','update','delete','destroy','exports','multer','util'];(function(_0x332735,_0x3ca166){var _0x549d77=function(_0x529b58){while(--_0x529b58){_0x332735['push'](_0x332735['shift']());}};_0x549d77(++_0x3ca166);}(_0xeee8,0x18d));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8eee('0x0'));var util=require(_0x8eee('0x1'));var path=require(_0x8eee('0x2'));var timeout=require('connect-timeout');var express=require(_0x8eee('0x3'));var router=express[_0x8eee('0x4')]();var fs_extra=require(_0x8eee('0x5'));var auth=require(_0x8eee('0x6'));var interaction=require(_0x8eee('0x7'));var config=require(_0x8eee('0x8'));var controller=require(_0x8eee('0x9'));router[_0x8eee('0xa')]('/',auth[_0x8eee('0xb')](),controller[_0x8eee('0xc')]);router[_0x8eee('0xa')](_0x8eee('0xd'),auth[_0x8eee('0xb')](),controller['describe']);router[_0x8eee('0xa')](_0x8eee('0xe'),auth[_0x8eee('0xb')](),controller[_0x8eee('0xf')]);router[_0x8eee('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8eee('0xe'),auth['isAuthenticated'](),controller[_0x8eee('0x11')]);router[_0x8eee('0x12')](_0x8eee('0xe'),auth[_0x8eee('0xb')](),controller[_0x8eee('0x13')]);module[_0x8eee('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 12d8a15..9167df2 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 _0xa0bd=['mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x1d4f6d,_0x7cca5a){var _0x106756=function(_0x5186b0){while(--_0x5186b0){_0x1d4f6d['push'](_0x1d4f6d['shift']());}};_0x106756(++_0x7cca5a);}(_0xa0bd,0xd0));var _0xda0b=function(_0xba7f9a,_0xbee956){_0xba7f9a=_0xba7f9a-0x0;var _0x3c598a=_0xa0bd[_0xba7f9a];return _0x3c598a;};'use strict';var Sequelize=require(_0xda0b('0x0'));module['exports']={'name':{'type':Sequelize[_0xda0b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xda0b('0x2'),_0xda0b('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xda0b('0x1')]},'timeout':{'type':Sequelize[_0xda0b('0x4')]}}; \ No newline at end of file +var _0x470a=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x582d5a,_0x3b57c0){var _0x5625ef=function(_0x509d83){while(--_0x509d83){_0x582d5a['push'](_0x582d5a['shift']());}};_0x5625ef(++_0x3b57c0);}(_0x470a,0x121));var _0xa470=function(_0x13fa80,_0x13d7d9){_0x13fa80=_0x13fa80-0x0;var _0x2b5c7e=_0x470a[_0x13fa80];return _0x2b5c7e;};'use strict';var Sequelize=require(_0xa470('0x0'));module[_0xa470('0x1')]={'name':{'type':Sequelize[_0xa470('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa470('0x3')](_0xa470('0x4'),'timeout'),'defaultValue':_0xa470('0x4')},'selector':{'type':Sequelize[_0xa470('0x2')]},'timeout':{'type':Sequelize[_0xa470('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 23e51f2..5981f41 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 _0xe5e0=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','update','destroy','then','error','stack','name','send','show','model','keys','rawAttributes','query','intersection','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto'];(function(_0x38f350,_0x55f3bd){var _0x270724=function(_0xc7e184){while(--_0xc7e184){_0x38f350['push'](_0x38f350['shift']());}};_0x270724(++_0x55f3bd);}(_0xe5e0,0x123));var _0x0e5e=function(_0x273055,_0x159846){_0x273055=_0x273055-0x0;var _0x7256d1=_0xe5e0[_0x273055];return _0x7256d1;};'use strict';var emlformat=require(_0x0e5e('0x0'));var rimraf=require(_0x0e5e('0x1'));var zipdir=require(_0x0e5e('0x2'));var jsonpatch=require(_0x0e5e('0x3'));var rp=require(_0x0e5e('0x4'));var moment=require(_0x0e5e('0x5'));var BPromise=require(_0x0e5e('0x6'));var Mustache=require(_0x0e5e('0x7'));var util=require(_0x0e5e('0x8'));var path=require(_0x0e5e('0x9'));var sox=require('sox');var csv=require(_0x0e5e('0xa'));var ejs=require(_0x0e5e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e5e('0xc'));var squel=require('squel');var crypto=require(_0x0e5e('0xd'));var jsforce=require(_0x0e5e('0xe'));var deskjs=require(_0x0e5e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0e5e('0x10'));var Papa=require(_0x0e5e('0x11'));var Redis=require(_0x0e5e('0x12'));var authService=require(_0x0e5e('0x13'));var qs=require(_0x0e5e('0x14'));var as=require(_0x0e5e('0x15'));var hardwareService=require(_0x0e5e('0x16'));var logger=require(_0x0e5e('0x17'))(_0x0e5e('0x18'));var utils=require('../../config/utils');var config=require(_0x0e5e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e5e('0x1a'))['db'];function respondWithStatusCode(_0x57f4c6,_0x78ae6b){_0x78ae6b=_0x78ae6b||0xcc;return function(_0x3fb885){if(_0x3fb885){return _0x57f4c6[_0x0e5e('0x1b')](_0x78ae6b);}return _0x57f4c6[_0x0e5e('0x1c')](_0x78ae6b)[_0x0e5e('0x1d')]();};}function respondWithResult(_0x39abe5,_0x3a3b25){_0x3a3b25=_0x3a3b25||0xc8;return function(_0x4a9b48){if(_0x4a9b48){return _0x39abe5[_0x0e5e('0x1c')](_0x3a3b25)[_0x0e5e('0x1e')](_0x4a9b48);}};}function respondWithFilteredResult(_0x58fbd0,_0xa59fa4){return function(_0x26a904){if(_0x26a904){var _0x4dfd37=typeof _0xa59fa4[_0x0e5e('0x1f')]===_0x0e5e('0x20')&&typeof _0xa59fa4['limit']==='undefined';var _0x52a685=_0x26a904['count'];var _0x2467ea=_0x4dfd37?0x0:_0xa59fa4[_0x0e5e('0x1f')];var _0xb851a3=_0x4dfd37?_0x26a904[_0x0e5e('0x21')]:_0xa59fa4[_0x0e5e('0x1f')]+_0xa59fa4['limit'];var _0x134d7b;if(_0xb851a3>=_0x52a685){_0xb851a3=_0x52a685;_0x134d7b=0xc8;}else{_0x134d7b=0xce;}_0x58fbd0[_0x0e5e('0x1c')](_0x134d7b);return _0x58fbd0[_0x0e5e('0x22')]('Content-Range',_0x2467ea+'-'+_0xb851a3+'/'+_0x52a685)['json'](_0x26a904);}return null;};}function patchUpdates(_0x1237de){return function(_0x194dac){try{jsonpatch['apply'](_0x194dac,_0x1237de,!![]);}catch(_0x133356){return BPromise['reject'](_0x133356);}return _0x194dac[_0x0e5e('0x23')]();};}function saveUpdates(_0x15836e,_0x8163bc){return function(_0x365820){if(_0x365820){return _0x365820[_0x0e5e('0x24')](_0x15836e)['then'](function(_0x5533d9){return _0x5533d9;});}return null;};}function removeEntity(_0x1aabd1,_0x4759d9){return function(_0x4a9505){if(_0x4a9505){return _0x4a9505[_0x0e5e('0x25')]()[_0x0e5e('0x26')](function(){_0x1aabd1[_0x0e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d516b,_0x699304){return function(_0x2b3afc){if(!_0x2b3afc){_0x1d516b['sendStatus'](0x194);}return _0x2b3afc;};}function handleError(_0x3e91b5,_0x34dbf5){_0x34dbf5=_0x34dbf5||0x1f4;return function(_0x5e5349){logger[_0x0e5e('0x27')](_0x5e5349[_0x0e5e('0x28')]);if(_0x5e5349[_0x0e5e('0x29')]){delete _0x5e5349['name'];}_0x3e91b5[_0x0e5e('0x1c')](_0x34dbf5)[_0x0e5e('0x2a')](_0x5e5349);};}exports[_0x0e5e('0x2b')]=function(_0x106dc3,_0x49a401){var _0x58b734={'raw':!![],'where':{'id':_0x106dc3['params']['id']}},_0x2803c3={};_0x2803c3[_0x0e5e('0x2c')]=_[_0x0e5e('0x2d')](db['ChatProactiveAction'][_0x0e5e('0x2e')]);_0x2803c3[_0x0e5e('0x2f')]=_['keys'](_0x106dc3[_0x0e5e('0x2f')]);_0x2803c3['filters']=_[_0x0e5e('0x30')](_0x2803c3[_0x0e5e('0x2c')],_0x2803c3[_0x0e5e('0x2f')]);_0x58b734[_0x0e5e('0x31')]=_[_0x0e5e('0x30')](_0x2803c3[_0x0e5e('0x2c')],qs['fields'](_0x106dc3[_0x0e5e('0x2f')]['fields']));_0x58b734['attributes']=_0x58b734['attributes'][_0x0e5e('0x32')]?_0x58b734[_0x0e5e('0x31')]:_0x2803c3[_0x0e5e('0x2c')];if(_0x106dc3[_0x0e5e('0x2f')][_0x0e5e('0x33')]){_0x58b734[_0x0e5e('0x34')]=[{'all':!![]}];}_0x58b734=_[_0x0e5e('0x35')]({},_0x58b734,_0x106dc3[_0x0e5e('0x36')]);return db[_0x0e5e('0x37')][_0x0e5e('0x38')](_0x58b734)[_0x0e5e('0x26')](handleEntityNotFound(_0x49a401,null))[_0x0e5e('0x26')](respondWithResult(_0x49a401,null))[_0x0e5e('0x39')](handleError(_0x49a401,null));};exports[_0x0e5e('0x3a')]=function(_0x4562a5,_0x1f9876){return db['ChatProactiveAction'][_0x0e5e('0x3a')](_0x4562a5[_0x0e5e('0x3b')],{})[_0x0e5e('0x26')](respondWithResult(_0x1f9876,0xc9))[_0x0e5e('0x39')](handleError(_0x1f9876,null));};exports[_0x0e5e('0x24')]=function(_0x2237a4,_0x490075){if(_0x2237a4[_0x0e5e('0x3b')]['id']){delete _0x2237a4['body']['id'];}return db[_0x0e5e('0x37')][_0x0e5e('0x38')]({'where':{'id':_0x2237a4[_0x0e5e('0x3c')]['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x490075,null))[_0x0e5e('0x26')](saveUpdates(_0x2237a4[_0x0e5e('0x3b')],null))[_0x0e5e('0x26')](respondWithResult(_0x490075,null))['catch'](handleError(_0x490075,null));};exports['destroy']=function(_0x4732c3,_0x47e6a7){return db[_0x0e5e('0x37')][_0x0e5e('0x38')]({'where':{'id':_0x4732c3['params']['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x47e6a7,null))['then'](removeEntity(_0x47e6a7,null))['catch'](handleError(_0x47e6a7,null));}; \ No newline at end of file +var _0x4f5a=['keys','rawAttributes','filters','intersection','query','fields','attributes','length','include','merge','options','ChatProactiveAction','find','create','body','catch','update','eml-format','rimraf','fast-json-patch','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','save','then','destroy','stack','name','send','params','model'];(function(_0xd37755,_0x29c1b0){var _0x520200=function(_0x2d52ef){while(--_0x2d52ef){_0xd37755['push'](_0xd37755['shift']());}};_0x520200(++_0x29c1b0);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x2e90d2,_0x33ea32){_0x2e90d2=_0x2e90d2-0x0;var _0x56a926=_0x4f5a[_0x2e90d2];return _0x56a926;};'use strict';var emlformat=require(_0xa4f5('0x0'));var rimraf=require(_0xa4f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4f5('0x3'));var path=require(_0xa4f5('0x4'));var sox=require('sox');var csv=require(_0xa4f5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa4f5('0x6'));var crypto=require(_0xa4f5('0x7'));var jsforce=require(_0xa4f5('0x8'));var deskjs=require(_0xa4f5('0x9'));var toCsv=require(_0xa4f5('0x5'));var querystring=require('querystring');var Papa=require(_0xa4f5('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa4f5('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4f5('0xc'));var logger=require(_0xa4f5('0xd'))(_0xa4f5('0xe'));var utils=require(_0xa4f5('0xf'));var config=require(_0xa4f5('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x123c89,_0x5bc533){_0x5bc533=_0x5bc533||0xcc;return function(_0x46d594){if(_0x46d594){return _0x123c89[_0xa4f5('0x11')](_0x5bc533);}return _0x123c89[_0xa4f5('0x12')](_0x5bc533)[_0xa4f5('0x13')]();};}function respondWithResult(_0xffa3ab,_0x493baa){_0x493baa=_0x493baa||0xc8;return function(_0x37c19a){if(_0x37c19a){return _0xffa3ab[_0xa4f5('0x12')](_0x493baa)[_0xa4f5('0x14')](_0x37c19a);}};}function respondWithFilteredResult(_0x5378d7,_0x4052a1){return function(_0x4f1c30){if(_0x4f1c30){var _0x1a9b46=typeof _0x4052a1[_0xa4f5('0x15')]==='undefined'&&typeof _0x4052a1[_0xa4f5('0x16')]===_0xa4f5('0x17');var _0x1c98be=_0x4f1c30['count'];var _0x27fba0=_0x1a9b46?0x0:_0x4052a1[_0xa4f5('0x15')];var _0x392fd2=_0x1a9b46?_0x4f1c30['count']:_0x4052a1[_0xa4f5('0x15')]+_0x4052a1[_0xa4f5('0x16')];var _0x2e10be;if(_0x392fd2>=_0x1c98be){_0x392fd2=_0x1c98be;_0x2e10be=0xc8;}else{_0x2e10be=0xce;}_0x5378d7['status'](_0x2e10be);return _0x5378d7[_0xa4f5('0x18')](_0xa4f5('0x19'),_0x27fba0+'-'+_0x392fd2+'/'+_0x1c98be)[_0xa4f5('0x14')](_0x4f1c30);}return null;};}function patchUpdates(_0x2b3f57){return function(_0x33b18b){try{jsonpatch['apply'](_0x33b18b,_0x2b3f57,!![]);}catch(_0x14c2e7){return BPromise['reject'](_0x14c2e7);}return _0x33b18b[_0xa4f5('0x1a')]();};}function saveUpdates(_0x1ffb57,_0x243998){return function(_0x69d34c){if(_0x69d34c){return _0x69d34c['update'](_0x1ffb57)[_0xa4f5('0x1b')](function(_0x2dfc82){return _0x2dfc82;});}return null;};}function removeEntity(_0x107214,_0x1d51d9){return function(_0x1fed24){if(_0x1fed24){return _0x1fed24[_0xa4f5('0x1c')]()['then'](function(){_0x107214[_0xa4f5('0x12')](0xcc)[_0xa4f5('0x13')]();});}};}function handleEntityNotFound(_0x188041,_0x56a8a6){return function(_0x3cebfd){if(!_0x3cebfd){_0x188041[_0xa4f5('0x11')](0x194);}return _0x3cebfd;};}function handleError(_0x14e27e,_0xe6ff84){_0xe6ff84=_0xe6ff84||0x1f4;return function(_0x260773){logger['error'](_0x260773[_0xa4f5('0x1d')]);if(_0x260773['name']){delete _0x260773[_0xa4f5('0x1e')];}_0x14e27e[_0xa4f5('0x12')](_0xe6ff84)[_0xa4f5('0x1f')](_0x260773);};}exports['show']=function(_0x115869,_0x17669a){var _0x467940={'raw':!![],'where':{'id':_0x115869[_0xa4f5('0x20')]['id']}},_0x4db529={};_0x4db529[_0xa4f5('0x21')]=_[_0xa4f5('0x22')](db['ChatProactiveAction'][_0xa4f5('0x23')]);_0x4db529['query']=_[_0xa4f5('0x22')](_0x115869['query']);_0x4db529[_0xa4f5('0x24')]=_[_0xa4f5('0x25')](_0x4db529['model'],_0x4db529[_0xa4f5('0x26')]);_0x467940['attributes']=_['intersection'](_0x4db529['model'],qs[_0xa4f5('0x27')](_0x115869[_0xa4f5('0x26')][_0xa4f5('0x27')]));_0x467940[_0xa4f5('0x28')]=_0x467940['attributes'][_0xa4f5('0x29')]?_0x467940['attributes']:_0x4db529[_0xa4f5('0x21')];if(_0x115869[_0xa4f5('0x26')]['includeAll']){_0x467940[_0xa4f5('0x2a')]=[{'all':!![]}];}_0x467940=_[_0xa4f5('0x2b')]({},_0x467940,_0x115869[_0xa4f5('0x2c')]);return db[_0xa4f5('0x2d')][_0xa4f5('0x2e')](_0x467940)['then'](handleEntityNotFound(_0x17669a,null))[_0xa4f5('0x1b')](respondWithResult(_0x17669a,null))['catch'](handleError(_0x17669a,null));};exports['create']=function(_0x460f0d,_0x7eb306){return db[_0xa4f5('0x2d')][_0xa4f5('0x2f')](_0x460f0d[_0xa4f5('0x30')],{})[_0xa4f5('0x1b')](respondWithResult(_0x7eb306,0xc9))[_0xa4f5('0x31')](handleError(_0x7eb306,null));};exports[_0xa4f5('0x32')]=function(_0x5e74f5,_0x3cebdc){if(_0x5e74f5['body']['id']){delete _0x5e74f5[_0xa4f5('0x30')]['id'];}return db[_0xa4f5('0x2d')][_0xa4f5('0x2e')]({'where':{'id':_0x5e74f5['params']['id']}})[_0xa4f5('0x1b')](handleEntityNotFound(_0x3cebdc,null))['then'](saveUpdates(_0x5e74f5[_0xa4f5('0x30')],null))[_0xa4f5('0x1b')](respondWithResult(_0x3cebdc,null))[_0xa4f5('0x31')](handleError(_0x3cebdc,null));};exports['destroy']=function(_0x3643a8,_0x3e5d75){return db[_0xa4f5('0x2d')][_0xa4f5('0x2e')]({'where':{'id':_0x3643a8[_0xa4f5('0x20')]['id']}})[_0xa4f5('0x1b')](handleEntityNotFound(_0x3e5d75,null))['then'](removeEntity(_0x3e5d75,null))[_0xa4f5('0x31')](handleError(_0x3e5d75,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index fc19d49..ef67ef5 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 _0xb504=['../../config/environment','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x17224a,_0x561257){var _0x43fb11=function(_0x53e807){while(--_0x53e807){_0x17224a['push'](_0x17224a['shift']());}};_0x43fb11(++_0x561257);}(_0xb504,0x16a));var _0x4b50=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb504[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4b50('0x0'));var util=require(_0x4b50('0x1'));var logger=require(_0x4b50('0x2'))(_0x4b50('0x3'));var moment=require(_0x4b50('0x4'));var BPromise=require(_0x4b50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b50('0x6'));var rimraf=require(_0x4b50('0x7'));var config=require(_0x4b50('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x2dda72,_0x428fc6){return _0x2dda72['define']('ChatProactiveAction',attributes,{'tableName':_0x4b50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8921=['exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes'];(function(_0x2b6aac,_0x4b35e8){var _0xc2e677=function(_0x164d63){while(--_0x164d63){_0x2b6aac['push'](_0x2b6aac['shift']());}};_0xc2e677(++_0x4b35e8);}(_0x8921,0x183));var _0x1892=function(_0x12650e,_0x227235){_0x12650e=_0x12650e-0x0;var _0x5e96b9=_0x8921[_0x12650e];return _0x5e96b9;};'use strict';var _=require(_0x1892('0x0'));var util=require('util');var logger=require(_0x1892('0x1'))(_0x1892('0x2'));var moment=require(_0x1892('0x3'));var BPromise=require(_0x1892('0x4'));var rp=require(_0x1892('0x5'));var fs=require('fs');var path=require(_0x1892('0x6'));var rimraf=require('rimraf');var config=require(_0x1892('0x7'));var attributes=require(_0x1892('0x8'));module[_0x1892('0x9')]=function(_0x1e897c,_0x52a8ca){return _0x1e897c[_0x1892('0xa')]('ChatProactiveAction',attributes,{'tableName':_0x1892('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index ebbf623..149cfcf 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 _0x6f75=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x38918c,_0x246fd1){var _0x5a5831=function(_0x1dfa83){while(--_0x1dfa83){_0x38918c['push'](_0x38918c['shift']());}};_0x5a5831(++_0x246fd1);}(_0x6f75,0x103));var _0x56f7=function(_0x4641d5,_0x4770e8){_0x4641d5=_0x4641d5-0x0;var _0x59e631=_0x6f75[_0x4641d5];return _0x59e631;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x56f7('0x0'));var BPromise=require(_0x56f7('0x1'));var rs=require(_0x56f7('0x2'));var fs=require('fs');var Redis=require(_0x56f7('0x3'));var db=require(_0x56f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x5'))('rpc');var config=require(_0x56f7('0x6'));var jayson=require(_0x56f7('0x7'));var client=jayson[_0x56f7('0x8')][_0x56f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x928e30,_0x2cce21,_0x44edea){return new BPromise(function(_0x9ac1be,_0x1eafb4){return client[_0x56f7('0xa')](_0x928e30,_0x44edea)['then'](function(_0x35abbb){logger['info'](_0x56f7('0xb'),_0x2cce21,_0x56f7('0xc'));logger[_0x56f7('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2cce21,'request\x20sent',JSON['stringify'](_0x35abbb));if(_0x35abbb[_0x56f7('0xe')]){if(_0x35abbb[_0x56f7('0xe')]['code']===0x1f4){logger['error'](_0x56f7('0xb'),_0x2cce21,_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);return _0x1eafb4(_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);}logger[_0x56f7('0xe')](_0x56f7('0xb'),_0x2cce21,_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);return _0x9ac1be(_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);}else{logger[_0x56f7('0x10')](_0x56f7('0xb'),_0x2cce21,_0x56f7('0xc'));_0x9ac1be(_0x35abbb['result']['message']);}})[_0x56f7('0x11')](function(_0x34b306){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2cce21,_0x34b306);_0x1eafb4(_0x34b306);});});} \ No newline at end of file +var _0x0b1e=['request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5679e4,_0x27e96d){var _0x44d830=function(_0x4a96a7){while(--_0x4a96a7){_0x5679e4['push'](_0x5679e4['shift']());}};_0x44d830(++_0x27e96d);}(_0x0b1e,0x1ef));var _0xe0b1=function(_0x268916,_0x1c27e1){_0x268916=_0x268916-0x0;var _0x38f8a4=_0x0b1e[_0x268916];return _0x38f8a4;};'use strict';var _=require(_0xe0b1('0x0'));var util=require(_0xe0b1('0x1'));var moment=require(_0xe0b1('0x2'));var BPromise=require(_0xe0b1('0x3'));var rs=require(_0xe0b1('0x4'));var fs=require('fs');var Redis=require(_0xe0b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0b1('0x6'));var logger=require(_0xe0b1('0x7'))(_0xe0b1('0x8'));var config=require('../../config/environment');var jayson=require(_0xe0b1('0x9'));var client=jayson['client'][_0xe0b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x141cc4,_0x4e4275,_0x5c466f){return new BPromise(function(_0x5a592f,_0x4d91b2){return client[_0xe0b1('0xb')](_0x141cc4,_0x5c466f)['then'](function(_0x218248){logger[_0xe0b1('0xc')](_0xe0b1('0xd'),_0x4e4275,_0xe0b1('0xe'));logger[_0xe0b1('0xf')](_0xe0b1('0x10'),_0x4e4275,'request\x20sent',JSON[_0xe0b1('0x11')](_0x218248));if(_0x218248[_0xe0b1('0x12')]){if(_0x218248[_0xe0b1('0x12')]['code']===0x1f4){logger[_0xe0b1('0x12')](_0xe0b1('0xd'),_0x4e4275,_0x218248[_0xe0b1('0x12')][_0xe0b1('0x13')]);return _0x4d91b2(_0x218248['error']['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4e4275,_0x218248[_0xe0b1('0x12')][_0xe0b1('0x13')]);return _0x5a592f(_0x218248[_0xe0b1('0x12')][_0xe0b1('0x13')]);}else{logger[_0xe0b1('0xc')](_0xe0b1('0xd'),_0x4e4275,_0xe0b1('0xe'));_0x5a592f(_0x218248[_0xe0b1('0x14')]['message']);}})[_0xe0b1('0x15')](function(_0x483241){logger[_0xe0b1('0x12')](_0xe0b1('0xd'),_0x4e4275,_0x483241);_0x4d91b2(_0x483241);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 02e42c5..dc04295 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 _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0x42e726,_0xf42a58){var _0x4c9629=function(_0x3b2703){while(--_0x3b2703){_0x42e726['push'](_0x42e726['shift']());}};_0x4c9629(++_0xf42a58);}(_0x5075,0x73));var _0x5507=function(_0x3fd750,_0x120661){_0x3fd750=_0x3fd750-0x0;var _0x4f15d9=_0x5075[_0x3fd750];return _0x4f15d9;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router; \ No newline at end of file +var _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x337d21,_0x32c30f){var _0x5bb57b=function(_0x5dd9cf){while(--_0x5dd9cf){_0x337d21['push'](_0x337d21['shift']());}};_0x5bb57b(++_0x32c30f);}(_0x2d17,0x17e));var _0x72d1=function(_0x7de713,_0x3a70a2){_0x7de713=_0x7de713-0x0;var _0x388ec7=_0x2d17[_0x7de713];return _0x388ec7;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 125f723..580c21d 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 _0xe2f9=['STRING','name','ENUM','rrmemory','roundrobin','exports'];(function(_0x78ca37,_0x3f9cb4){var _0x41f231=function(_0x4221ea){while(--_0x4221ea){_0x78ca37['push'](_0x78ca37['shift']());}};_0x41f231(++_0x3f9cb4);}(_0xe2f9,0x167));var _0x9e2f=function(_0x8860ef,_0x3bff8c){_0x8860ef=_0x8860ef-0x0;var _0x293f72=_0xe2f9[_0x8860ef];return _0x293f72;};'use strict';var Sequelize=require('sequelize');module[_0x9e2f('0x0')]={'name':{'type':Sequelize[_0x9e2f('0x1')],'unique':_0x9e2f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9e2f('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9e2f('0x3')](_0x9e2f('0x4'),'beepall',_0x9e2f('0x5'))}}; \ No newline at end of file +var _0x349b=['roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x268e09,_0x1f90ed){var _0x4c6a3a=function(_0x1dffc8){while(--_0x1dffc8){_0x268e09['push'](_0x268e09['shift']());}};_0x4c6a3a(++_0x1f90ed);}(_0x349b,0xd3));var _0xb349=function(_0x3b418a,_0xe9d4b3){_0x3b418a=_0x3b418a-0x0;var _0x2793b6=_0x349b[_0x3b418a];return _0x2793b6;};'use strict';var Sequelize=require(_0xb349('0x0'));module['exports']={'name':{'type':Sequelize[_0xb349('0x1')],'unique':_0xb349('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb349('0x1')]},'timeout':{'type':Sequelize[_0xb349('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xb349('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 55d91d7..8239feb 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 _0x86ab=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','update','destroy','get','UserProfileResource','name','send','index','ChatQueue','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','chatPause','getTeams','Team','Agents','voicePause','sequelize','transaction','addTeams','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','removeAgents','userChatQueue:remove','addAgents','spread'];(function(_0x41bd72,_0x447a5f){var _0x194925=function(_0x3261b2){while(--_0x3261b2){_0x41bd72['push'](_0x41bd72['shift']());}};_0x194925(++_0x447a5f);}(_0x86ab,0x1b4));var _0xb86a=function(_0x5b6807,_0x5b28af){_0x5b6807=_0x5b6807-0x0;var _0x2e5cdb=_0x86ab[_0x5b6807];return _0x2e5cdb;};'use strict';var emlformat=require(_0xb86a('0x0'));var rimraf=require(_0xb86a('0x1'));var zipdir=require(_0xb86a('0x2'));var jsonpatch=require(_0xb86a('0x3'));var rp=require(_0xb86a('0x4'));var moment=require(_0xb86a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb86a('0x6'));var util=require('util');var path=require(_0xb86a('0x7'));var sox=require(_0xb86a('0x8'));var csv=require(_0xb86a('0x9'));var ejs=require(_0xb86a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb86a('0xb'));var squel=require(_0xb86a('0xc'));var crypto=require(_0xb86a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb86a('0xe'));var toCsv=require(_0xb86a('0x9'));var querystring=require('querystring');var Papa=require(_0xb86a('0xf'));var Redis=require(_0xb86a('0x10'));var authService=require(_0xb86a('0x11'));var qs=require(_0xb86a('0x12'));var as=require(_0xb86a('0x13'));var hardwareService=require(_0xb86a('0x14'));var logger=require('../../config/logger')(_0xb86a('0x15'));var utils=require(_0xb86a('0x16'));var config=require(_0xb86a('0x17'));var licenseUtil=require(_0xb86a('0x18'));var db=require('../../mysqldb')['db'];config[_0xb86a('0x19')]=_[_0xb86a('0x1a')](config['redis'],{'host':_0xb86a('0x1b'),'port':0x18eb});var socket=require(_0xb86a('0x1c'))(new Redis(config[_0xb86a('0x19')]));require(_0xb86a('0x1d'))['register'](socket);var jayson=require(_0xb86a('0x1e'));var client=jayson[_0xb86a('0x1f')][_0xb86a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d3369,_0x247bcd,_0x41cf1e,_0x583233){return new BPromise(function(_0x3bbc07,_0x1e3506){var _0x49a27a=_0x583233||client;return _0x49a27a[_0xb86a('0x21')](_0x5d3369,_0x41cf1e)[_0xb86a('0x22')](function(_0x275f89){logger[_0xb86a('0x23')](_0xb86a('0x24'),_0x247bcd,_0xb86a('0x25'));logger[_0xb86a('0x26')](_0xb86a('0x27'),_0x247bcd,_0xb86a('0x25'),JSON[_0xb86a('0x28')](_0x275f89));if(_0x275f89[_0xb86a('0x29')]){if(_0x275f89['error']['code']===0x1f4){logger['error'](_0xb86a('0x24'),_0x247bcd,_0x275f89['error'][_0xb86a('0x2a')]);return _0x1e3506(_0x275f89[_0xb86a('0x29')][_0xb86a('0x2a')]);}logger[_0xb86a('0x29')](_0xb86a('0x24'),_0x247bcd,_0x275f89[_0xb86a('0x29')][_0xb86a('0x2a')]);return _0x3bbc07(_0x275f89['error'][_0xb86a('0x2a')]);}else{logger[_0xb86a('0x23')](_0xb86a('0x24'),_0x247bcd,'request\x20sent');_0x3bbc07(_0x275f89[_0xb86a('0x2b')]['message']);}})['catch'](function(_0x805bd8){logger['error'](_0xb86a('0x24'),_0x247bcd,_0x805bd8);_0x1e3506(_0x805bd8);});});}function respondWithStatusCode(_0x173f52,_0x5bd31c){_0x5bd31c=_0x5bd31c||0xcc;return function(_0x136a59){if(_0x136a59){return _0x173f52[_0xb86a('0x2c')](_0x5bd31c);}return _0x173f52[_0xb86a('0x2d')](_0x5bd31c)[_0xb86a('0x2e')]();};}function respondWithResult(_0x3fb7ad,_0x223f3b){_0x223f3b=_0x223f3b||0xc8;return function(_0x4c313c){if(_0x4c313c){return _0x3fb7ad[_0xb86a('0x2d')](_0x223f3b)['json'](_0x4c313c);}};}function respondWithFilteredResult(_0x2c3bf7,_0x43a63f){return function(_0x2694e4){if(_0x2694e4){var _0x2960f6=typeof _0x43a63f['offset']===_0xb86a('0x2f')&&typeof _0x43a63f[_0xb86a('0x30')]===_0xb86a('0x2f');var _0x2b564a=_0x2694e4[_0xb86a('0x31')];var _0x4f3851=_0x2960f6?0x0:_0x43a63f['offset'];var _0x71272b=_0x2960f6?_0x2694e4['count']:_0x43a63f[_0xb86a('0x32')]+_0x43a63f[_0xb86a('0x30')];var _0x2b9496;if(_0x71272b>=_0x2b564a){_0x71272b=_0x2b564a;_0x2b9496=0xc8;}else{_0x2b9496=0xce;}_0x2c3bf7[_0xb86a('0x2d')](_0x2b9496);return _0x2c3bf7[_0xb86a('0x33')]('Content-Range',_0x4f3851+'-'+_0x71272b+'/'+_0x2b564a)[_0xb86a('0x34')](_0x2694e4);}return null;};}function patchUpdates(_0x4999ff){return function(_0x26efd3){try{jsonpatch[_0xb86a('0x35')](_0x26efd3,_0x4999ff,!![]);}catch(_0x549881){return BPromise['reject'](_0x549881);}return _0x26efd3['save']();};}function saveUpdates(_0x2e7fb0,_0x452b6b){return function(_0x1d17a9){if(_0x1d17a9){return _0x1d17a9[_0xb86a('0x36')](_0x2e7fb0)[_0xb86a('0x22')](function(_0x50103c){return _0x50103c;});}return null;};}function removeEntity(_0x590446,_0x2591b4){return function(_0x1e07b2){if(_0x1e07b2){return _0x1e07b2[_0xb86a('0x37')]()[_0xb86a('0x22')](function(){var _0x231516=_0x1e07b2[_0xb86a('0x38')]({'plain':!![]});var _0x69be3='ChatQueues';return db[_0xb86a('0x39')][_0xb86a('0x37')]({'where':{'type':_0x69be3,'resourceId':_0x231516['id']}})[_0xb86a('0x22')](function(){return _0x1e07b2;});})[_0xb86a('0x22')](function(){_0x590446['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb0b3,_0x474c59){return function(_0x1d80f6){if(!_0x1d80f6){_0x4eb0b3[_0xb86a('0x2c')](0x194);}return _0x1d80f6;};}function handleError(_0x55e2fd,_0x3c5784){_0x3c5784=_0x3c5784||0x1f4;return function(_0x4bbf90){logger['error'](_0x4bbf90['stack']);if(_0x4bbf90['name']){delete _0x4bbf90[_0xb86a('0x3a')];}_0x55e2fd[_0xb86a('0x2d')](_0x3c5784)[_0xb86a('0x3b')](_0x4bbf90);};}exports[_0xb86a('0x3c')]=function(_0x33ed98,_0x171013){var _0x57bb92={},_0x490569={},_0x2f81bd={'count':0x0,'rows':[]};var _0x19cd88=_['map'](db[_0xb86a('0x3d')][_0xb86a('0x3e')],function(_0x11edf6){return{'name':_0x11edf6['fieldName'],'type':_0x11edf6[_0xb86a('0x3f')]['key']};});_0x490569[_0xb86a('0x40')]=_['map'](_0x19cd88,_0xb86a('0x3a'));_0x490569[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x33ed98[_0xb86a('0x41')]);_0x490569[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x490569[_0xb86a('0x40')],_0x490569[_0xb86a('0x41')]);_0x57bb92['attributes']=_[_0xb86a('0x44')](_0x490569[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x33ed98['query']['fields']));_0x57bb92[_0xb86a('0x46')]=_0x57bb92[_0xb86a('0x46')][_0xb86a('0x47')]?_0x57bb92[_0xb86a('0x46')]:_0x490569['model'];if(!_0x33ed98[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x57bb92[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x33ed98[_0xb86a('0x41')]['limit']);_0x57bb92[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x33ed98[_0xb86a('0x41')][_0xb86a('0x32')]);}_0x57bb92[_0xb86a('0x4a')]=qs[_0xb86a('0x4b')](_0x33ed98['query']['sort']);_0x57bb92['where']=qs[_0xb86a('0x43')](_[_0xb86a('0x4c')](_0x33ed98[_0xb86a('0x41')],_0x490569['filters']),_0x19cd88);if(_0x33ed98[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x57bb92[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x57bb92[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x19cd88,function(_0xa4369b){if(_0xa4369b[_0xb86a('0x3f')]!=='VIRTUAL'){var _0xc5839a={};_0xc5839a[_0xa4369b[_0xb86a('0x3a')]]={'$like':'%'+_0x33ed98[_0xb86a('0x41')]['filter']+'%'};return _0xc5839a;}})});}_0x57bb92=_[_0xb86a('0x4f')]({},_0x57bb92,_0x33ed98[_0xb86a('0x51')]);var _0x225590={'where':_0x57bb92['where']};return db[_0xb86a('0x3d')][_0xb86a('0x31')](_0x225590)[_0xb86a('0x22')](function(_0x3f6502){_0x2f81bd[_0xb86a('0x31')]=_0x3f6502;if(_0x33ed98[_0xb86a('0x41')][_0xb86a('0x52')]){_0x57bb92[_0xb86a('0x53')]=[{'all':!![]}];}return db[_0xb86a('0x3d')][_0xb86a('0x54')](_0x57bb92);})[_0xb86a('0x22')](function(_0x1ca41b){_0x2f81bd['rows']=_0x1ca41b;return _0x2f81bd;})[_0xb86a('0x22')](respondWithFilteredResult(_0x171013,_0x57bb92))[_0xb86a('0x55')](handleError(_0x171013,null));};exports[_0xb86a('0x56')]=function(_0x59984d,_0x5e659e){var _0x3a40f2={'raw':!![],'where':{'id':_0x59984d[_0xb86a('0x57')]['id']}},_0x2bc98e={};_0x2bc98e[_0xb86a('0x40')]=_['keys'](db[_0xb86a('0x3d')][_0xb86a('0x3e')]);_0x2bc98e[_0xb86a('0x41')]=_['keys'](_0x59984d[_0xb86a('0x41')]);_0x2bc98e['filters']=_[_0xb86a('0x44')](_0x2bc98e['model'],_0x2bc98e[_0xb86a('0x41')]);_0x3a40f2['attributes']=_[_0xb86a('0x44')](_0x2bc98e[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x59984d[_0xb86a('0x41')][_0xb86a('0x45')]));_0x3a40f2[_0xb86a('0x46')]=_0x3a40f2[_0xb86a('0x46')][_0xb86a('0x47')]?_0x3a40f2['attributes']:_0x2bc98e[_0xb86a('0x40')];if(_0x59984d[_0xb86a('0x41')]['includeAll']){_0x3a40f2['include']=[{'all':!![]}];}_0x3a40f2=_['merge']({},_0x3a40f2,_0x59984d[_0xb86a('0x51')]);return db[_0xb86a('0x3d')][_0xb86a('0x58')](_0x3a40f2)[_0xb86a('0x22')](handleEntityNotFound(_0x5e659e,null))[_0xb86a('0x22')](respondWithResult(_0x5e659e,null))[_0xb86a('0x55')](handleError(_0x5e659e,null));};exports[_0xb86a('0x59')]=function(_0x4c67b1,_0x2a764e){return db[_0xb86a('0x3d')]['create'](_0x4c67b1['body'],{})[_0xb86a('0x22')](function(_0x5a4416){var _0x2da0f2=_0x4c67b1['user'][_0xb86a('0x38')]({'plain':!![]});if(!_0x2da0f2)throw new Error(_0xb86a('0x5a'));if(_0x2da0f2['role']===_0xb86a('0x5b')){var _0x48997c=_0x5a4416[_0xb86a('0x38')]({'plain':!![]});var _0x4644cc=_0xb86a('0x5c');return db[_0xb86a('0x5d')]['find']({'where':{'name':_0x4644cc,'userProfileId':_0x2da0f2[_0xb86a('0x5e')]},'raw':!![]})[_0xb86a('0x22')](function(_0x172e27){if(_0x172e27&&_0x172e27[_0xb86a('0x5f')]===0x0){return db['UserProfileResource'][_0xb86a('0x59')]({'name':_0x48997c['name'],'resourceId':_0x48997c['id'],'type':_0x172e27[_0xb86a('0x3a')],'sectionId':_0x172e27['id']},{})[_0xb86a('0x22')](function(){return _0x5a4416;});}else{return _0x5a4416;}})['catch'](function(_0x134311){logger[_0xb86a('0x29')](_0xb86a('0x60'),_0x134311);throw _0x134311;});}return _0x5a4416;})['then'](respondWithResult(_0x2a764e,0xc9))[_0xb86a('0x55')](handleError(_0x2a764e,null));};exports[_0xb86a('0x36')]=function(_0x193e63,_0x19e60e){if(_0x193e63[_0xb86a('0x61')]['id']){delete _0x193e63[_0xb86a('0x61')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x193e63[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x19e60e,null))['then'](saveUpdates(_0x193e63['body'],null))[_0xb86a('0x22')](respondWithResult(_0x19e60e,null))[_0xb86a('0x55')](handleError(_0x19e60e,null));};exports[_0xb86a('0x37')]=function(_0x257166,_0x358abe){return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x257166[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x358abe,null))[_0xb86a('0x22')](removeEntity(_0x358abe,null))[_0xb86a('0x55')](handleError(_0x358abe,null));};exports[_0xb86a('0x62')]=function(_0x4b3e75,_0x3b9242){return db['ChatQueue'][_0xb86a('0x62')]()[_0xb86a('0x22')](respondWithResult(_0x3b9242,null))[_0xb86a('0x55')](handleError(_0x3b9242,null));};exports['getMembers']=function(_0x16597d,_0x372cae,_0x4296b0){var _0x5b7fa9={'raw':!![],'where':{}},_0x456c0f={},_0x4286a8;return db[_0xb86a('0x3d')][_0xb86a('0x63')]({'where':{'id':_0x16597d[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x372cae,null))[_0xb86a('0x22')](function(_0x4b82a6){if(_0x4b82a6){_0x4286a8=_0x4b82a6[_0xb86a('0x38')]({'plain':!![]});_0x456c0f[_0xb86a('0x40')]=_[_0xb86a('0x42')](db[_0xb86a('0x64')][_0xb86a('0x3e')]);_0x456c0f[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x16597d['query']);_0x456c0f[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x456c0f[_0xb86a('0x40')],_0x456c0f[_0xb86a('0x41')]);_0x5b7fa9[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0x456c0f['model'],qs[_0xb86a('0x45')](_0x16597d[_0xb86a('0x41')]['fields']));_0x5b7fa9[_0xb86a('0x46')]=_0x5b7fa9[_0xb86a('0x46')][_0xb86a('0x47')]?_0x5b7fa9[_0xb86a('0x46')]:_0x456c0f['model'];if(!_0x16597d[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x5b7fa9[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x16597d[_0xb86a('0x41')][_0xb86a('0x30')]);_0x5b7fa9[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x16597d['query']['offset']);}_0x5b7fa9['order']=qs[_0xb86a('0x4b')](_0x16597d[_0xb86a('0x41')]['sort']);_0x5b7fa9[_0xb86a('0x4e')]=qs['filters'](_['pick'](_0x16597d[_0xb86a('0x41')],_0x456c0f[_0xb86a('0x43')]));_0x5b7fa9[_0xb86a('0x4e')][_0xb86a('0x65')]=_0x4b82a6['id'];if(_0x16597d[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x5b7fa9[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x5b7fa9[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x5b7fa9[_0xb86a('0x46')],function(_0xd00415){var _0x2458aa={};_0x2458aa[_0xd00415]={'$like':'%'+_0x16597d[_0xb86a('0x41')][_0xb86a('0x4d')]+'%'};return _0x2458aa;})});}_0x5b7fa9=_[_0xb86a('0x4f')]({},_0x5b7fa9,_0x16597d['options']);return db[_0xb86a('0x64')][_0xb86a('0x54')](_0x5b7fa9);}})[_0xb86a('0x22')](function(_0x293e19){if(_0x293e19){return db[_0xb86a('0x66')][_0xb86a('0x67')]({'where':{'id':_[_0xb86a('0x50')](_0x293e19,_0xb86a('0x68')),'role':_0xb86a('0x69')},'attributes':['id','name','chatPause',_0xb86a('0x6a'),_0xb86a('0x6b')]});}})['then'](function(_0xca09){if(_0xca09){return{'count':_0xca09[_0xb86a('0x31')],'rows':_['map'](_0xca09[_0xb86a('0x6c')],function(_0x1ea582){return{'membername':_0x1ea582[_0xb86a('0x3a')],'UserId':_0x1ea582['id'],'queue_name':_0x4286a8[_0xb86a('0x3a')],'ChatQueueId':_0x4286a8['id'],'interface':util[_0xb86a('0x6d')](_0xb86a('0x6e'),_0xb86a('0x6f'),_0x1ea582[_0xb86a('0x3a')]),'penalty':0x0,'paused':_0x1ea582[_0xb86a('0x70')],'createdAt':_0x1ea582['createdAt'],'updatedAt':_0x1ea582['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb86a('0x22')](respondWithFilteredResult(_0x372cae,_0x5b7fa9))[_0xb86a('0x55')](handleError(_0x372cae,null));};exports['getTeams']=function(_0x18464a,_0x126010,_0x3e2108){var _0x5422d4={};var _0x54017a={};var _0x4b6ed6;var _0x1f680b;return db[_0xb86a('0x3d')][_0xb86a('0x63')]({'where':{'id':_0x18464a['params']['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x126010,null))['then'](function(_0x4ee031){if(_0x4ee031){_0x4b6ed6=_0x4ee031;_0x54017a[_0xb86a('0x40')]=_[_0xb86a('0x42')](db['Team'][_0xb86a('0x3e')]);_0x54017a[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x18464a[_0xb86a('0x41')]);_0x54017a[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x54017a['model'],_0x54017a['query']);_0x5422d4[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0x54017a[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x45')]));_0x5422d4[_0xb86a('0x46')]=_0x5422d4['attributes'][_0xb86a('0x47')]?_0x5422d4[_0xb86a('0x46')]:_0x54017a[_0xb86a('0x40')];_0x5422d4[_0xb86a('0x4a')]=qs[_0xb86a('0x4b')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x4b')]);_0x5422d4[_0xb86a('0x4e')]=qs[_0xb86a('0x43')](_['pick'](_0x18464a[_0xb86a('0x41')],_0x54017a[_0xb86a('0x43')]));if(_0x18464a['query'][_0xb86a('0x4d')]){_0x5422d4['where']=_[_0xb86a('0x4f')](_0x5422d4[_0xb86a('0x4e')],{'$or':_['map'](_0x5422d4['attributes'],function(_0x194d3c){var _0x38419d={};_0x38419d[_0x194d3c]={'$like':'%'+_0x18464a[_0xb86a('0x41')]['filter']+'%'};return _0x38419d;})});}_0x5422d4=_[_0xb86a('0x4f')]({},_0x5422d4,_0x18464a[_0xb86a('0x51')]);return _0x4b6ed6[_0xb86a('0x71')](_0x5422d4);}})[_0xb86a('0x22')](function(_0x3acc79){if(_0x3acc79){_0x1f680b=_0x3acc79[_0xb86a('0x47')];if(!_0x18464a[_0xb86a('0x41')][_0xb86a('0x48')]('nolimit')){_0x5422d4[_0xb86a('0x30')]=qs['limit'](_0x18464a[_0xb86a('0x41')]['limit']);_0x5422d4[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x32')]);}return _0x4b6ed6['getTeams'](_0x5422d4);}})[_0xb86a('0x22')](function(_0x1931f5){if(_0x1931f5){return _0x1931f5?{'count':_0x1f680b,'rows':_0x1931f5}:null;}})[_0xb86a('0x22')](respondWithResult(_0x126010,null))[_0xb86a('0x55')](handleError(_0x126010,null));};exports['addTeams']=function(_0x465758,_0x154a21,_0x94ddae){var _0x3c5066=_0x465758[_0xb86a('0x61')]['ids'];return db[_0xb86a('0x72')]['findAll']({'where':{'id':_0x3c5066},'attributes':['id'],'include':[{'model':db[_0xb86a('0x66')],'as':_0xb86a('0x73'),'attributes':['id',_0xb86a('0x3a'),'online',_0xb86a('0x74'),'interface'],'raw':!![]}]})[_0xb86a('0x22')](function(_0x13aa1e){if(_0x13aa1e){var _0xe6e606=_['flatMap'](_0x13aa1e,function(_0x26e8dd){var _0x3b35d1=_0x26e8dd['get']({'plain':!![]});return _0x3b35d1['Agents'];});return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x465758[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](function(_0x1ceedc){return db[_0xb86a('0x75')][_0xb86a('0x76')](function(_0x13bd04){return _0x1ceedc[_0xb86a('0x77')](_0x3c5066,{'transaction':_0x13bd04})[_0xb86a('0x22')](function(){return BPromise['each'](_0xe6e606,function(_0x48e0a4){return db[_0xb86a('0x64')]['findOrCreate']({'where':{'UserId':_0x48e0a4['id'],'ChatQueueId':_0x465758['params']['id']},'transaction':_0x13bd04});});})[_0xb86a('0x22')](function(){_0xe6e606[_0xb86a('0x78')](function(_0x29c52c){socket[_0xb86a('0x79')](_0xb86a('0x7a'),{'UserId':_0x29c52c['id'],'ChatQueueId':_0x1ceedc['id']});});});});});}})[_0xb86a('0x22')](respondWithStatusCode(_0x154a21,null))[_0xb86a('0x55')](handleError(_0x154a21,null));};exports[_0xb86a('0x7b')]=function(_0x26c487,_0x1f2a86,_0x49563e){return db[_0xb86a('0x72')]['findAll']({'where':{'id':_0x26c487[_0xb86a('0x41')][_0xb86a('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb86a('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb86a('0x22')](handleEntityNotFound(_0x1f2a86,null))[_0xb86a('0x22')](function(_0x525223){var _0x1feb35=_['map'](_0x525223,'id');var _0x3a4468=[];var _0x288231=[];var _0x4985c0=squel[_0xb86a('0x7d')]();_0x4985c0[_0xb86a('0x7e')](_0xb86a('0x7f'))['from']('team_has_chat_queues','tq')[_0xb86a('0x80')](_0xb86a('0x81'),'ut',_0xb86a('0x82'))[_0xb86a('0x4e')](_0xb86a('0x83'),_0x26c487[_0xb86a('0x57')]['id']);for(var _0x4d16ef=0x0;_0x4d16ef<_0x525223[_0xb86a('0x47')];_0x4d16ef+=0x1){let _0xb13aa4=_0x525223[_0x4d16ef];for(var _0x234e93=0x0;_0x234e93<_0xb13aa4[_0xb86a('0x73')][_0xb86a('0x47')];_0x234e93+=0x1){let _0x5d3066=_0xb13aa4['Agents'][_0x234e93];var _0x23d464=_0x4985c0['clone']();_0x23d464[_0xb86a('0x4e')](_0xb86a('0x84'),_0x5d3066['id']);_0x288231[_0xb86a('0x85')](db[_0xb86a('0x75')][_0xb86a('0x41')](_0x23d464[_0xb86a('0x86')](),{'type':db[_0xb86a('0x75')][_0xb86a('0x87')][_0xb86a('0x88')]})['then'](function(_0xf06191){if(_0xf06191[_0xb86a('0x47')]===0x1){return _0x5d3066['id'];}else{var _0x271d3e=_[_0xb86a('0x89')](_[_0xb86a('0x50')](_0xf06191,_0xb86a('0x8a')),function(_0x3b3754){return _['includes'](_0x1feb35,_0x3b3754);});if(_0x271d3e){return _0x5d3066['id'];}}}));}}return BPromise[_0xb86a('0x8b')](_0x288231)[_0xb86a('0x22')](function(_0x375ede){_0x3a4468=_(_0x3a4468)['union'](_0x375ede)['compact']()['value']();return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x26c487['params']['id']}})[_0xb86a('0x22')](function(_0x27a173){return db['sequelize'][_0xb86a('0x76')](function(_0x17bcee){return _0x27a173[_0xb86a('0x7b')](_0x26c487[_0xb86a('0x41')]['ids'],{'transaction':_0x17bcee})[_0xb86a('0x22')](function(){if(!_['isEmpty'](_0x3a4468)){return _0x27a173[_0xb86a('0x8c')](_0x3a4468,{'transaction':_0x17bcee});}})[_0xb86a('0x22')](function(){_0x3a4468[_0xb86a('0x78')](function(_0x3467e6){socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':_0x3467e6,'ChatQueueId':_0x27a173['id']});});});});});});})['then'](respondWithStatusCode(_0x1f2a86,null))[_0xb86a('0x55')](handleError(_0x1f2a86,null));};exports['addAgents']=function(_0x1af456,_0x4fca8a,_0x3c7b3d){return db[_0xb86a('0x3d')]['find']({'where':{'id':_0x1af456[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x4fca8a,null))[_0xb86a('0x22')](function(_0x17e9e8){if(_0x17e9e8){return _0x17e9e8[_0xb86a('0x8e')](_0x1af456[_0xb86a('0x61')]['ids'],_['omit'](_0x1af456[_0xb86a('0x61')],['ids','id'])||{})[_0xb86a('0x8f')](function(_0x569b76){for(var _0x51e78d=0x0;_0x51e78d<_0x1af456['body'][_0xb86a('0x7c')][_0xb86a('0x47')];_0x51e78d+=0x1){socket[_0xb86a('0x79')](_0xb86a('0x7a'),{'UserId':Number(_0x1af456[_0xb86a('0x61')][_0xb86a('0x7c')][_0x51e78d]),'ChatQueueId':Number(_0x1af456[_0xb86a('0x57')]['id'])});}return _0x569b76;});}})[_0xb86a('0x22')](respondWithResult(_0x4fca8a,null))[_0xb86a('0x55')](handleError(_0x4fca8a,null));};exports[_0xb86a('0x8c')]=function(_0x2a7be9,_0x42ee25,_0x376f45){return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x2a7be9[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x42ee25,null))[_0xb86a('0x22')](function(_0x17fc1a){if(_0x17fc1a){return _0x17fc1a['removeAgents'](_0x2a7be9[_0xb86a('0x41')][_0xb86a('0x7c')])[_0xb86a('0x22')](function(){if(_['isArray'](_0x2a7be9[_0xb86a('0x41')]['ids'])){for(var _0x502f0d=0x0;_0x502f0d<_0x2a7be9['query'][_0xb86a('0x7c')][_0xb86a('0x47')];_0x502f0d+=0x1){socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':Number(_0x2a7be9[_0xb86a('0x41')]['ids'][_0x502f0d]),'ChatQueueId':Number(_0x2a7be9[_0xb86a('0x57')]['id'])});}}else{socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':Number(_0x2a7be9[_0xb86a('0x41')][_0xb86a('0x7c')]),'ChatQueueId':Number(_0x2a7be9[_0xb86a('0x57')]['id'])});}});}})[_0xb86a('0x22')](respondWithStatusCode(_0x42ee25,null))[_0xb86a('0x55')](handleError(_0x42ee25,null));};exports[_0xb86a('0x90')]=function(_0x15f156,_0x463517,_0x3aaac7){var _0x3b7338={};var _0xdc36d9={};var _0x2bf7d0;var _0x36399e;return db['ChatQueue'][_0xb86a('0x63')]({'where':{'id':_0x15f156[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x463517,null))[_0xb86a('0x22')](function(_0xbd6f29){if(_0xbd6f29){_0x2bf7d0=_0xbd6f29;_0xdc36d9[_0xb86a('0x40')]=_['keys'](db[_0xb86a('0x66')][_0xb86a('0x3e')]);_0xdc36d9[_0xb86a('0x41')]=_['keys'](_0x15f156['query']);_0xdc36d9[_0xb86a('0x43')]=_['intersection'](_0xdc36d9[_0xb86a('0x40')],_0xdc36d9[_0xb86a('0x41')]);_0x3b7338[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0xdc36d9[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x15f156[_0xb86a('0x41')]['fields']));_0x3b7338[_0xb86a('0x46')]=_0x3b7338[_0xb86a('0x46')][_0xb86a('0x47')]?_0x3b7338[_0xb86a('0x46')]:_0xdc36d9['model'];_0x3b7338['order']=qs['sort'](_0x15f156[_0xb86a('0x41')][_0xb86a('0x4b')]);_0x3b7338[_0xb86a('0x4e')]=qs[_0xb86a('0x43')](_[_0xb86a('0x4c')](_0x15f156['query'],_0xdc36d9[_0xb86a('0x43')]));if(_0x15f156[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x3b7338[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x3b7338[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x3b7338[_0xb86a('0x46')],function(_0x107cb9){var _0x3ca438={};_0x3ca438[_0x107cb9]={'$like':'%'+_0x15f156[_0xb86a('0x41')]['filter']+'%'};return _0x3ca438;})});}_0x3b7338=_['merge']({},_0x3b7338,_0x15f156['options']);return _0x2bf7d0[_0xb86a('0x90')](_0x3b7338);}})[_0xb86a('0x22')](function(_0xf1807f){if(_0xf1807f){_0x36399e=_0xf1807f[_0xb86a('0x47')];if(!_0x15f156[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x3b7338[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x15f156['query']['limit']);_0x3b7338['offset']=qs['offset'](_0x15f156[_0xb86a('0x41')][_0xb86a('0x32')]);}return _0x2bf7d0[_0xb86a('0x90')](_0x3b7338);}})[_0xb86a('0x22')](function(_0x3bd713){if(_0x3bd713){return _0x3bd713?{'count':_0x36399e,'rows':_0x3bd713}:null;}})[_0xb86a('0x22')](respondWithResult(_0x463517,null))[_0xb86a('0x55')](handleError(_0x463517,null));}; \ No newline at end of file +var _0xcade=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','destroy','then','ChatQueues','stack','send','index','map','ChatQueue','fieldName','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','order','addTeams','ids','findAll','Agents','online','voicePause','flatMap','sequelize','transaction','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','length','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3049c4,_0x56b72f){var _0x291396=function(_0x3fb990){while(--_0x3fb990){_0x3049c4['push'](_0x3049c4['shift']());}};_0x291396(++_0x56b72f);}(_0xcade,0x6e));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xecad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecad('0x1'));var jsonpatch=require(_0xecad('0x2'));var rp=require(_0xecad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xecad('0x4'));var util=require(_0xecad('0x5'));var path=require(_0xecad('0x6'));var sox=require(_0xecad('0x7'));var csv=require('to-csv');var ejs=require(_0xecad('0x8'));var fs=require('fs');var fs_extra=require(_0xecad('0x9'));var _=require(_0xecad('0xa'));var squel=require(_0xecad('0xb'));var crypto=require(_0xecad('0xc'));var jsforce=require(_0xecad('0xd'));var deskjs=require(_0xecad('0xe'));var toCsv=require(_0xecad('0xf'));var querystring=require('querystring');var Papa=require(_0xecad('0x10'));var Redis=require('ioredis');var authService=require(_0xecad('0x11'));var qs=require(_0xecad('0x12'));var as=require(_0xecad('0x13'));var hardwareService=require(_0xecad('0x14'));var logger=require('../../config/logger')(_0xecad('0x15'));var utils=require(_0xecad('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xecad('0x17')]=_['defaults'](config[_0xecad('0x17')],{'host':_0xecad('0x18'),'port':0x18eb});var socket=require(_0xecad('0x19'))(new Redis(config[_0xecad('0x17')]));require(_0xecad('0x1a'))[_0xecad('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xecad('0x1c')][_0xecad('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29fb4c,_0x330a75,_0x467bcf,_0x163dea){return new BPromise(function(_0x5e760f,_0x42d175){var _0x4a5e09=_0x163dea||client;return _0x4a5e09[_0xecad('0x1e')](_0x29fb4c,_0x467bcf)['then'](function(_0x1cbe2d){logger[_0xecad('0x1f')](_0xecad('0x20'),_0x330a75,_0xecad('0x21'));logger[_0xecad('0x22')](_0xecad('0x23'),_0x330a75,_0xecad('0x21'),JSON[_0xecad('0x24')](_0x1cbe2d));if(_0x1cbe2d['error']){if(_0x1cbe2d[_0xecad('0x25')]['code']===0x1f4){logger[_0xecad('0x25')](_0xecad('0x20'),_0x330a75,_0x1cbe2d[_0xecad('0x25')][_0xecad('0x26')]);return _0x42d175(_0x1cbe2d[_0xecad('0x25')][_0xecad('0x26')]);}logger['error'](_0xecad('0x20'),_0x330a75,_0x1cbe2d[_0xecad('0x25')][_0xecad('0x26')]);return _0x5e760f(_0x1cbe2d[_0xecad('0x25')][_0xecad('0x26')]);}else{logger[_0xecad('0x1f')](_0xecad('0x20'),_0x330a75,_0xecad('0x21'));_0x5e760f(_0x1cbe2d[_0xecad('0x27')]['message']);}})[_0xecad('0x28')](function(_0x505ac8){logger[_0xecad('0x25')](_0xecad('0x20'),_0x330a75,_0x505ac8);_0x42d175(_0x505ac8);});});}function respondWithStatusCode(_0x1498e3,_0x4961aa){_0x4961aa=_0x4961aa||0xcc;return function(_0xb223cc){if(_0xb223cc){return _0x1498e3[_0xecad('0x29')](_0x4961aa);}return _0x1498e3['status'](_0x4961aa)[_0xecad('0x2a')]();};}function respondWithResult(_0x5e71eb,_0x48ba23){_0x48ba23=_0x48ba23||0xc8;return function(_0x3d474a){if(_0x3d474a){return _0x5e71eb[_0xecad('0x2b')](_0x48ba23)[_0xecad('0x2c')](_0x3d474a);}};}function respondWithFilteredResult(_0x3039d1,_0x52e189){return function(_0x46c4d2){if(_0x46c4d2){var _0x2c3b62=typeof _0x52e189[_0xecad('0x2d')]==='undefined'&&typeof _0x52e189[_0xecad('0x2e')]==='undefined';var _0x21ded8=_0x46c4d2[_0xecad('0x2f')];var _0x71132e=_0x2c3b62?0x0:_0x52e189['offset'];var _0x1e3c31=_0x2c3b62?_0x46c4d2[_0xecad('0x2f')]:_0x52e189[_0xecad('0x2d')]+_0x52e189[_0xecad('0x2e')];var _0x36eae3;if(_0x1e3c31>=_0x21ded8){_0x1e3c31=_0x21ded8;_0x36eae3=0xc8;}else{_0x36eae3=0xce;}_0x3039d1[_0xecad('0x2b')](_0x36eae3);return _0x3039d1[_0xecad('0x30')](_0xecad('0x31'),_0x71132e+'-'+_0x1e3c31+'/'+_0x21ded8)[_0xecad('0x2c')](_0x46c4d2);}return null;};}function patchUpdates(_0x39be91){return function(_0x32a58b){try{jsonpatch['apply'](_0x32a58b,_0x39be91,!![]);}catch(_0xf5eff1){return BPromise[_0xecad('0x32')](_0xf5eff1);}return _0x32a58b[_0xecad('0x33')]();};}function saveUpdates(_0x309607,_0x476048){return function(_0x50e571){if(_0x50e571){return _0x50e571['update'](_0x309607)['then'](function(_0x474d4f){return _0x474d4f;});}return null;};}function removeEntity(_0x5f1ecd,_0x285f1b){return function(_0x1cb584){if(_0x1cb584){return _0x1cb584[_0xecad('0x34')]()[_0xecad('0x35')](function(){var _0xca1f1e=_0x1cb584['get']({'plain':!![]});var _0x863276=_0xecad('0x36');return db['UserProfileResource'][_0xecad('0x34')]({'where':{'type':_0x863276,'resourceId':_0xca1f1e['id']}})[_0xecad('0x35')](function(){return _0x1cb584;});})[_0xecad('0x35')](function(){_0x5f1ecd[_0xecad('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a45f7,_0x31c994){return function(_0x1b9208){if(!_0x1b9208){_0x1a45f7['sendStatus'](0x194);}return _0x1b9208;};}function handleError(_0x4698ba,_0x27f698){_0x27f698=_0x27f698||0x1f4;return function(_0x4dfc4d){logger[_0xecad('0x25')](_0x4dfc4d[_0xecad('0x37')]);if(_0x4dfc4d['name']){delete _0x4dfc4d['name'];}_0x4698ba['status'](_0x27f698)[_0xecad('0x38')](_0x4dfc4d);};}exports[_0xecad('0x39')]=function(_0x4aa742,_0x285d0f){var _0x334330={},_0x5b1593={},_0x18cac7={'count':0x0,'rows':[]};var _0x17ee93=_[_0xecad('0x3a')](db[_0xecad('0x3b')]['rawAttributes'],function(_0x443f56){return{'name':_0x443f56[_0xecad('0x3c')],'type':_0x443f56['type'][_0xecad('0x3d')]};});_0x5b1593[_0xecad('0x3e')]=_[_0xecad('0x3a')](_0x17ee93,_0xecad('0x3f'));_0x5b1593[_0xecad('0x40')]=_[_0xecad('0x41')](_0x4aa742[_0xecad('0x40')]);_0x5b1593['filters']=_[_0xecad('0x42')](_0x5b1593[_0xecad('0x3e')],_0x5b1593[_0xecad('0x40')]);_0x334330[_0xecad('0x43')]=_['intersection'](_0x5b1593['model'],qs[_0xecad('0x44')](_0x4aa742[_0xecad('0x40')]['fields']));_0x334330[_0xecad('0x43')]=_0x334330[_0xecad('0x43')]['length']?_0x334330['attributes']:_0x5b1593[_0xecad('0x3e')];if(!_0x4aa742[_0xecad('0x40')][_0xecad('0x45')](_0xecad('0x46'))){_0x334330[_0xecad('0x2e')]=qs['limit'](_0x4aa742[_0xecad('0x40')]['limit']);_0x334330['offset']=qs[_0xecad('0x2d')](_0x4aa742[_0xecad('0x40')]['offset']);}_0x334330['order']=qs[_0xecad('0x47')](_0x4aa742[_0xecad('0x40')][_0xecad('0x47')]);_0x334330[_0xecad('0x48')]=qs[_0xecad('0x49')](_[_0xecad('0x4a')](_0x4aa742[_0xecad('0x40')],_0x5b1593[_0xecad('0x49')]),_0x17ee93);if(_0x4aa742[_0xecad('0x40')][_0xecad('0x4b')]){_0x334330['where']=_['merge'](_0x334330[_0xecad('0x48')],{'$or':_[_0xecad('0x3a')](_0x17ee93,function(_0x38c1d3){if(_0x38c1d3[_0xecad('0x4c')]!=='VIRTUAL'){var _0x5e87c0={};_0x5e87c0[_0x38c1d3['name']]={'$like':'%'+_0x4aa742['query'][_0xecad('0x4b')]+'%'};return _0x5e87c0;}})});}_0x334330=_[_0xecad('0x4d')]({},_0x334330,_0x4aa742[_0xecad('0x4e')]);var _0x4ea9a4={'where':_0x334330[_0xecad('0x48')]};return db[_0xecad('0x3b')][_0xecad('0x2f')](_0x4ea9a4)['then'](function(_0x293bf5){_0x18cac7[_0xecad('0x2f')]=_0x293bf5;if(_0x4aa742['query'][_0xecad('0x4f')]){_0x334330[_0xecad('0x50')]=[{'all':!![]}];}return db[_0xecad('0x3b')]['findAll'](_0x334330);})['then'](function(_0xeed169){_0x18cac7[_0xecad('0x51')]=_0xeed169;return _0x18cac7;})[_0xecad('0x35')](respondWithFilteredResult(_0x285d0f,_0x334330))[_0xecad('0x28')](handleError(_0x285d0f,null));};exports[_0xecad('0x52')]=function(_0x36aa3d,_0x3395af){var _0x396761={'raw':!![],'where':{'id':_0x36aa3d[_0xecad('0x53')]['id']}},_0x231c9d={};_0x231c9d[_0xecad('0x3e')]=_[_0xecad('0x41')](db[_0xecad('0x3b')][_0xecad('0x54')]);_0x231c9d[_0xecad('0x40')]=_['keys'](_0x36aa3d[_0xecad('0x40')]);_0x231c9d['filters']=_[_0xecad('0x42')](_0x231c9d['model'],_0x231c9d[_0xecad('0x40')]);_0x396761[_0xecad('0x43')]=_[_0xecad('0x42')](_0x231c9d[_0xecad('0x3e')],qs['fields'](_0x36aa3d['query'][_0xecad('0x44')]));_0x396761[_0xecad('0x43')]=_0x396761[_0xecad('0x43')]['length']?_0x396761[_0xecad('0x43')]:_0x231c9d[_0xecad('0x3e')];if(_0x36aa3d[_0xecad('0x40')][_0xecad('0x4f')]){_0x396761['include']=[{'all':!![]}];}_0x396761=_[_0xecad('0x4d')]({},_0x396761,_0x36aa3d[_0xecad('0x4e')]);return db[_0xecad('0x3b')][_0xecad('0x55')](_0x396761)[_0xecad('0x35')](handleEntityNotFound(_0x3395af,null))[_0xecad('0x35')](respondWithResult(_0x3395af,null))[_0xecad('0x28')](handleError(_0x3395af,null));};exports[_0xecad('0x56')]=function(_0x3b8791,_0x15905d){return db[_0xecad('0x3b')][_0xecad('0x56')](_0x3b8791[_0xecad('0x57')],{})[_0xecad('0x35')](function(_0x28be19){var _0x337973=_0x3b8791[_0xecad('0x58')]['get']({'plain':!![]});if(!_0x337973)throw new Error(_0xecad('0x59'));if(_0x337973[_0xecad('0x5a')]===_0xecad('0x58')){var _0x2cf649=_0x28be19[_0xecad('0x5b')]({'plain':!![]});var _0x3e04e4=_0xecad('0x36');return db['UserProfileSection'][_0xecad('0x55')]({'where':{'name':_0x3e04e4,'userProfileId':_0x337973['userProfileId']},'raw':!![]})[_0xecad('0x35')](function(_0x15a896){if(_0x15a896&&_0x15a896[_0xecad('0x5c')]===0x0){return db[_0xecad('0x5d')][_0xecad('0x56')]({'name':_0x2cf649[_0xecad('0x3f')],'resourceId':_0x2cf649['id'],'type':_0x15a896['name'],'sectionId':_0x15a896['id']},{})[_0xecad('0x35')](function(){return _0x28be19;});}else{return _0x28be19;}})[_0xecad('0x28')](function(_0x2fd04d){logger[_0xecad('0x25')](_0xecad('0x5e'),_0x2fd04d);throw _0x2fd04d;});}return _0x28be19;})[_0xecad('0x35')](respondWithResult(_0x15905d,0xc9))[_0xecad('0x28')](handleError(_0x15905d,null));};exports[_0xecad('0x5f')]=function(_0x5eca0a,_0xb0994b){if(_0x5eca0a[_0xecad('0x57')]['id']){delete _0x5eca0a[_0xecad('0x57')]['id'];}return db[_0xecad('0x3b')][_0xecad('0x55')]({'where':{'id':_0x5eca0a[_0xecad('0x53')]['id']}})[_0xecad('0x35')](handleEntityNotFound(_0xb0994b,null))['then'](saveUpdates(_0x5eca0a[_0xecad('0x57')],null))[_0xecad('0x35')](respondWithResult(_0xb0994b,null))['catch'](handleError(_0xb0994b,null));};exports[_0xecad('0x34')]=function(_0x2dca1,_0x5c8a0e){return db[_0xecad('0x3b')][_0xecad('0x55')]({'where':{'id':_0x2dca1['params']['id']}})['then'](handleEntityNotFound(_0x5c8a0e,null))[_0xecad('0x35')](removeEntity(_0x5c8a0e,null))[_0xecad('0x28')](handleError(_0x5c8a0e,null));};exports['describe']=function(_0x556126,_0x2a2ec0){return db[_0xecad('0x3b')]['describe']()[_0xecad('0x35')](respondWithResult(_0x2a2ec0,null))[_0xecad('0x28')](handleError(_0x2a2ec0,null));};exports['getMembers']=function(_0x522c84,_0x238258,_0x293558){var _0x3269c3={'raw':!![],'where':{}},_0x1e2bcf={},_0x1fa7e6;return db['ChatQueue'][_0xecad('0x60')]({'where':{'id':_0x522c84['params']['id']}})[_0xecad('0x35')](handleEntityNotFound(_0x238258,null))[_0xecad('0x35')](function(_0x1e6e2d){if(_0x1e6e2d){_0x1fa7e6=_0x1e6e2d[_0xecad('0x5b')]({'plain':!![]});_0x1e2bcf[_0xecad('0x3e')]=_['keys'](db['UserChatQueue']['rawAttributes']);_0x1e2bcf[_0xecad('0x40')]=_[_0xecad('0x41')](_0x522c84[_0xecad('0x40')]);_0x1e2bcf[_0xecad('0x49')]=_[_0xecad('0x42')](_0x1e2bcf[_0xecad('0x3e')],_0x1e2bcf[_0xecad('0x40')]);_0x3269c3[_0xecad('0x43')]=_[_0xecad('0x42')](_0x1e2bcf[_0xecad('0x3e')],qs['fields'](_0x522c84[_0xecad('0x40')][_0xecad('0x44')]));_0x3269c3['attributes']=_0x3269c3[_0xecad('0x43')]['length']?_0x3269c3[_0xecad('0x43')]:_0x1e2bcf[_0xecad('0x3e')];if(!_0x522c84[_0xecad('0x40')][_0xecad('0x45')](_0xecad('0x46'))){_0x3269c3['limit']=qs[_0xecad('0x2e')](_0x522c84[_0xecad('0x40')]['limit']);_0x3269c3['offset']=qs[_0xecad('0x2d')](_0x522c84[_0xecad('0x40')][_0xecad('0x2d')]);}_0x3269c3['order']=qs['sort'](_0x522c84[_0xecad('0x40')][_0xecad('0x47')]);_0x3269c3['where']=qs[_0xecad('0x49')](_['pick'](_0x522c84[_0xecad('0x40')],_0x1e2bcf[_0xecad('0x49')]));_0x3269c3[_0xecad('0x48')]['ChatQueueId']=_0x1e6e2d['id'];if(_0x522c84[_0xecad('0x40')]['filter']){_0x3269c3[_0xecad('0x48')]=_[_0xecad('0x4d')](_0x3269c3[_0xecad('0x48')],{'$or':_[_0xecad('0x3a')](_0x3269c3[_0xecad('0x43')],function(_0x287561){var _0x28adf4={};_0x28adf4[_0x287561]={'$like':'%'+_0x522c84[_0xecad('0x40')][_0xecad('0x4b')]+'%'};return _0x28adf4;})});}_0x3269c3=_[_0xecad('0x4d')]({},_0x3269c3,_0x522c84[_0xecad('0x4e')]);return db['UserChatQueue']['findAll'](_0x3269c3);}})[_0xecad('0x35')](function(_0xe4ae0){if(_0xe4ae0){return db[_0xecad('0x61')][_0xecad('0x62')]({'where':{'id':_[_0xecad('0x3a')](_0xe4ae0,'UserId'),'role':_0xecad('0x63')},'attributes':['id',_0xecad('0x3f'),'chatPause',_0xecad('0x64'),_0xecad('0x65')]});}})[_0xecad('0x35')](function(_0x1b5e98){if(_0x1b5e98){return{'count':_0x1b5e98['count'],'rows':_['map'](_0x1b5e98['rows'],function(_0x2ea6d4){return{'membername':_0x2ea6d4[_0xecad('0x3f')],'UserId':_0x2ea6d4['id'],'queue_name':_0x1fa7e6[_0xecad('0x3f')],'ChatQueueId':_0x1fa7e6['id'],'interface':util[_0xecad('0x66')](_0xecad('0x67'),'SIP',_0x2ea6d4[_0xecad('0x3f')]),'penalty':0x0,'paused':_0x2ea6d4[_0xecad('0x68')],'createdAt':_0x2ea6d4[_0xecad('0x65')],'updatedAt':_0x2ea6d4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x238258,_0x3269c3))[_0xecad('0x28')](handleError(_0x238258,null));};exports[_0xecad('0x69')]=function(_0x1dcd1f,_0x5a1254,_0x42af68){var _0x51101a={};var _0x4653c9={};var _0x3fae29;var _0x24d557;return db[_0xecad('0x3b')][_0xecad('0x60')]({'where':{'id':_0x1dcd1f[_0xecad('0x53')]['id']}})[_0xecad('0x35')](handleEntityNotFound(_0x5a1254,null))[_0xecad('0x35')](function(_0x71924){if(_0x71924){_0x3fae29=_0x71924;_0x4653c9['model']=_['keys'](db['Team'][_0xecad('0x54')]);_0x4653c9[_0xecad('0x40')]=_['keys'](_0x1dcd1f['query']);_0x4653c9['filters']=_[_0xecad('0x42')](_0x4653c9[_0xecad('0x3e')],_0x4653c9[_0xecad('0x40')]);_0x51101a[_0xecad('0x43')]=_[_0xecad('0x42')](_0x4653c9[_0xecad('0x3e')],qs['fields'](_0x1dcd1f['query']['fields']));_0x51101a[_0xecad('0x43')]=_0x51101a[_0xecad('0x43')]['length']?_0x51101a[_0xecad('0x43')]:_0x4653c9['model'];_0x51101a[_0xecad('0x6a')]=qs[_0xecad('0x47')](_0x1dcd1f[_0xecad('0x40')]['sort']);_0x51101a['where']=qs[_0xecad('0x49')](_['pick'](_0x1dcd1f[_0xecad('0x40')],_0x4653c9[_0xecad('0x49')]));if(_0x1dcd1f[_0xecad('0x40')][_0xecad('0x4b')]){_0x51101a[_0xecad('0x48')]=_[_0xecad('0x4d')](_0x51101a[_0xecad('0x48')],{'$or':_[_0xecad('0x3a')](_0x51101a[_0xecad('0x43')],function(_0x27bd0a){var _0x2dd297={};_0x2dd297[_0x27bd0a]={'$like':'%'+_0x1dcd1f[_0xecad('0x40')][_0xecad('0x4b')]+'%'};return _0x2dd297;})});}_0x51101a=_['merge']({},_0x51101a,_0x1dcd1f[_0xecad('0x4e')]);return _0x3fae29[_0xecad('0x69')](_0x51101a);}})[_0xecad('0x35')](function(_0x3bb398){if(_0x3bb398){_0x24d557=_0x3bb398['length'];if(!_0x1dcd1f['query'][_0xecad('0x45')](_0xecad('0x46'))){_0x51101a['limit']=qs['limit'](_0x1dcd1f[_0xecad('0x40')]['limit']);_0x51101a[_0xecad('0x2d')]=qs['offset'](_0x1dcd1f['query']['offset']);}return _0x3fae29[_0xecad('0x69')](_0x51101a);}})[_0xecad('0x35')](function(_0x1c96a4){if(_0x1c96a4){return _0x1c96a4?{'count':_0x24d557,'rows':_0x1c96a4}:null;}})[_0xecad('0x35')](respondWithResult(_0x5a1254,null))[_0xecad('0x28')](handleError(_0x5a1254,null));};exports[_0xecad('0x6b')]=function(_0x3d9d61,_0x49c38a,_0x5ddfa0){var _0x1fd837=_0x3d9d61[_0xecad('0x57')][_0xecad('0x6c')];return db['Team'][_0xecad('0x6d')]({'where':{'id':_0x1fd837},'attributes':['id'],'include':[{'model':db['User'],'as':_0xecad('0x6e'),'attributes':['id',_0xecad('0x3f'),_0xecad('0x6f'),_0xecad('0x70'),'interface'],'raw':!![]}]})[_0xecad('0x35')](function(_0x3347e3){if(_0x3347e3){var _0x3a1908=_[_0xecad('0x71')](_0x3347e3,function(_0x3d4d7a){var _0x2dd6d6=_0x3d4d7a[_0xecad('0x5b')]({'plain':!![]});return _0x2dd6d6['Agents'];});return db[_0xecad('0x3b')]['find']({'where':{'id':_0x3d9d61[_0xecad('0x53')]['id']}})[_0xecad('0x35')](function(_0x9256a4){return db[_0xecad('0x72')][_0xecad('0x73')](function(_0x2e282d){return _0x9256a4[_0xecad('0x6b')](_0x1fd837,{'transaction':_0x2e282d})[_0xecad('0x35')](function(){return BPromise['each'](_0x3a1908,function(_0x1fb28b){return db[_0xecad('0x74')][_0xecad('0x75')]({'where':{'UserId':_0x1fb28b['id'],'ChatQueueId':_0x3d9d61[_0xecad('0x53')]['id']},'transaction':_0x2e282d});});})[_0xecad('0x35')](function(){_0x3a1908[_0xecad('0x76')](function(_0x317f4d){socket[_0xecad('0x77')](_0xecad('0x78'),{'UserId':_0x317f4d['id'],'ChatQueueId':_0x9256a4['id']});});});});});}})['then'](respondWithStatusCode(_0x49c38a,null))[_0xecad('0x28')](handleError(_0x49c38a,null));};exports[_0xecad('0x79')]=function(_0x56bdf6,_0x5d0845,_0x1e348a){return db['Team'][_0xecad('0x6d')]({'where':{'id':_0x56bdf6[_0xecad('0x40')][_0xecad('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xecad('0x61')],'as':_0xecad('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xecad('0x35')](handleEntityNotFound(_0x5d0845,null))[_0xecad('0x35')](function(_0x1e8252){var _0xe2c526=_[_0xecad('0x3a')](_0x1e8252,'id');var _0x2f70c5=[];var _0x3949ff=[];var _0x4a392b=squel[_0xecad('0x7a')]();_0x4a392b['field'](_0xecad('0x7b'))[_0xecad('0x7c')](_0xecad('0x7d'),'tq')['join']('user_has_teams','ut',_0xecad('0x7e'))[_0xecad('0x48')]('ChatQueueId\x20=\x20?',_0x56bdf6[_0xecad('0x53')]['id']);for(var _0x46bbd0=0x0;_0x46bbd0<_0x1e8252[_0xecad('0x7f')];_0x46bbd0+=0x1){let _0x368990=_0x1e8252[_0x46bbd0];for(var _0x42a2e5=0x0;_0x42a2e5<_0x368990[_0xecad('0x6e')][_0xecad('0x7f')];_0x42a2e5+=0x1){let _0x190d9c=_0x368990[_0xecad('0x6e')][_0x42a2e5];var _0x22e021=_0x4a392b[_0xecad('0x80')]();_0x22e021[_0xecad('0x48')](_0xecad('0x81'),_0x190d9c['id']);_0x3949ff[_0xecad('0x82')](db[_0xecad('0x72')][_0xecad('0x40')](_0x22e021[_0xecad('0x83')](),{'type':db[_0xecad('0x72')][_0xecad('0x84')][_0xecad('0x85')]})[_0xecad('0x35')](function(_0x421136){if(_0x421136['length']===0x1){return _0x190d9c['id'];}else{var _0xeb9427=_[_0xecad('0x86')](_[_0xecad('0x3a')](_0x421136,_0xecad('0x87')),function(_0x42b1a4){return _[_0xecad('0x88')](_0xe2c526,_0x42b1a4);});if(_0xeb9427){return _0x190d9c['id'];}}}));}}return BPromise[_0xecad('0x89')](_0x3949ff)['then'](function(_0x37e26e){_0x2f70c5=_(_0x2f70c5)[_0xecad('0x8a')](_0x37e26e)[_0xecad('0x8b')]()['value']();return db[_0xecad('0x3b')][_0xecad('0x55')]({'where':{'id':_0x56bdf6[_0xecad('0x53')]['id']}})[_0xecad('0x35')](function(_0x259c43){return db[_0xecad('0x72')][_0xecad('0x73')](function(_0x5d92cb){return _0x259c43[_0xecad('0x79')](_0x56bdf6[_0xecad('0x40')]['ids'],{'transaction':_0x5d92cb})[_0xecad('0x35')](function(){if(!_['isEmpty'](_0x2f70c5)){return _0x259c43[_0xecad('0x8c')](_0x2f70c5,{'transaction':_0x5d92cb});}})['then'](function(){_0x2f70c5[_0xecad('0x76')](function(_0x5db505){socket[_0xecad('0x77')](_0xecad('0x8d'),{'UserId':_0x5db505,'ChatQueueId':_0x259c43['id']});});});});});});})['then'](respondWithStatusCode(_0x5d0845,null))[_0xecad('0x28')](handleError(_0x5d0845,null));};exports[_0xecad('0x8e')]=function(_0x13af74,_0x29d5a4,_0x4a4dbf){return db[_0xecad('0x3b')][_0xecad('0x55')]({'where':{'id':_0x13af74[_0xecad('0x53')]['id']}})[_0xecad('0x35')](handleEntityNotFound(_0x29d5a4,null))[_0xecad('0x35')](function(_0x534577){if(_0x534577){return _0x534577[_0xecad('0x8e')](_0x13af74[_0xecad('0x57')][_0xecad('0x6c')],_['omit'](_0x13af74[_0xecad('0x57')],[_0xecad('0x6c'),'id'])||{})[_0xecad('0x8f')](function(_0x214271){for(var _0x4c15f4=0x0;_0x4c15f4<_0x13af74['body']['ids'][_0xecad('0x7f')];_0x4c15f4+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x13af74[_0xecad('0x57')][_0xecad('0x6c')][_0x4c15f4]),'ChatQueueId':Number(_0x13af74[_0xecad('0x53')]['id'])});}return _0x214271;});}})[_0xecad('0x35')](respondWithResult(_0x29d5a4,null))['catch'](handleError(_0x29d5a4,null));};exports[_0xecad('0x8c')]=function(_0x26edf9,_0x11affd,_0x19ccf4){return db['ChatQueue'][_0xecad('0x55')]({'where':{'id':_0x26edf9['params']['id']}})[_0xecad('0x35')](handleEntityNotFound(_0x11affd,null))['then'](function(_0x4445d8){if(_0x4445d8){return _0x4445d8[_0xecad('0x8c')](_0x26edf9['query'][_0xecad('0x6c')])['then'](function(){if(_['isArray'](_0x26edf9[_0xecad('0x40')][_0xecad('0x6c')])){for(var _0x1b417f=0x0;_0x1b417f<_0x26edf9['query'][_0xecad('0x6c')]['length'];_0x1b417f+=0x1){socket[_0xecad('0x77')](_0xecad('0x8d'),{'UserId':Number(_0x26edf9[_0xecad('0x40')][_0xecad('0x6c')][_0x1b417f]),'ChatQueueId':Number(_0x26edf9[_0xecad('0x53')]['id'])});}}else{socket[_0xecad('0x77')]('userChatQueue:remove',{'UserId':Number(_0x26edf9[_0xecad('0x40')][_0xecad('0x6c')]),'ChatQueueId':Number(_0x26edf9['params']['id'])});}});}})[_0xecad('0x35')](respondWithStatusCode(_0x11affd,null))[_0xecad('0x28')](handleError(_0x11affd,null));};exports[_0xecad('0x90')]=function(_0xb77552,_0x1d9a43,_0x335cbc){var _0x2cf153={};var _0x15be05={};var _0x55cd99;var _0x400d44;return db[_0xecad('0x3b')][_0xecad('0x60')]({'where':{'id':_0xb77552[_0xecad('0x53')]['id']}})[_0xecad('0x35')](handleEntityNotFound(_0x1d9a43,null))[_0xecad('0x35')](function(_0x540580){if(_0x540580){_0x55cd99=_0x540580;_0x15be05['model']=_[_0xecad('0x41')](db[_0xecad('0x61')][_0xecad('0x54')]);_0x15be05['query']=_[_0xecad('0x41')](_0xb77552[_0xecad('0x40')]);_0x15be05['filters']=_[_0xecad('0x42')](_0x15be05[_0xecad('0x3e')],_0x15be05[_0xecad('0x40')]);_0x2cf153[_0xecad('0x43')]=_[_0xecad('0x42')](_0x15be05[_0xecad('0x3e')],qs[_0xecad('0x44')](_0xb77552[_0xecad('0x40')][_0xecad('0x44')]));_0x2cf153['attributes']=_0x2cf153['attributes'][_0xecad('0x7f')]?_0x2cf153[_0xecad('0x43')]:_0x15be05[_0xecad('0x3e')];_0x2cf153[_0xecad('0x6a')]=qs[_0xecad('0x47')](_0xb77552[_0xecad('0x40')][_0xecad('0x47')]);_0x2cf153[_0xecad('0x48')]=qs[_0xecad('0x49')](_['pick'](_0xb77552[_0xecad('0x40')],_0x15be05[_0xecad('0x49')]));if(_0xb77552[_0xecad('0x40')][_0xecad('0x4b')]){_0x2cf153[_0xecad('0x48')]=_[_0xecad('0x4d')](_0x2cf153[_0xecad('0x48')],{'$or':_[_0xecad('0x3a')](_0x2cf153[_0xecad('0x43')],function(_0x5c2897){var _0x20f97d={};_0x20f97d[_0x5c2897]={'$like':'%'+_0xb77552[_0xecad('0x40')][_0xecad('0x4b')]+'%'};return _0x20f97d;})});}_0x2cf153=_[_0xecad('0x4d')]({},_0x2cf153,_0xb77552[_0xecad('0x4e')]);return _0x55cd99['getAgents'](_0x2cf153);}})[_0xecad('0x35')](function(_0x2fcf6c){if(_0x2fcf6c){_0x400d44=_0x2fcf6c[_0xecad('0x7f')];if(!_0xb77552[_0xecad('0x40')][_0xecad('0x45')]('nolimit')){_0x2cf153[_0xecad('0x2e')]=qs[_0xecad('0x2e')](_0xb77552[_0xecad('0x40')][_0xecad('0x2e')]);_0x2cf153[_0xecad('0x2d')]=qs[_0xecad('0x2d')](_0xb77552[_0xecad('0x40')][_0xecad('0x2d')]);}return _0x55cd99[_0xecad('0x90')](_0x2cf153);}})[_0xecad('0x35')](function(_0x503c39){if(_0x503c39){return _0x503c39?{'count':_0x400d44,'rows':_0x503c39}:null;}})[_0xecad('0x35')](respondWithResult(_0x1d9a43,null))['catch'](handleError(_0x1d9a43,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index b76b8ab..0c2934d 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 _0x92bc=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x185ecf,_0x32c66c){var _0x541319=function(_0x126bd2){while(--_0x126bd2){_0x185ecf['push'](_0x185ecf['shift']());}};_0x541319(++_0x32c66c);}(_0x92bc,0x128));var _0xc92b=function(_0x1b6cf4,_0x4df4b7){_0x1b6cf4=_0x1b6cf4-0x0;var _0x438fa5=_0x92bc[_0x1b6cf4];return _0x438fa5;};'use strict';var EventEmitter=require(_0xc92b('0x0'));var ChatQueue=require(_0xc92b('0x1'))['db'][_0xc92b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc92b('0x3')](0x0);var events={'afterCreate':_0xc92b('0x4'),'afterUpdate':_0xc92b('0x5'),'afterDestroy':_0xc92b('0x6')};function emitEvent(_0x1193a4){return function(_0x16f9e9,_0x36df59,_0x3be06a){ChatQueueEvents[_0xc92b('0x7')](_0x1193a4+':'+_0x16f9e9['id'],_0x16f9e9);ChatQueueEvents[_0xc92b('0x7')](_0x1193a4,_0x16f9e9);_0x3be06a(null);};}for(var e in events){if(events[_0xc92b('0x8')](e)){var event=events[e];ChatQueue[_0xc92b('0x9')](e,emitEvent(event));}}module[_0xc92b('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x76a3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0xd84e1d,_0x3cd288){var _0xf1723f=function(_0x3eb591){while(--_0x3eb591){_0xd84e1d['push'](_0xd84e1d['shift']());}};_0xf1723f(++_0x3cd288);}(_0x76a3,0xf8));var _0x376a=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x76a3[_0x30a31e];return _0x170879;};'use strict';var EventEmitter=require(_0x376a('0x0'));var ChatQueue=require(_0x376a('0x1'))['db'][_0x376a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x376a('0x3')](0x0);var events={'afterCreate':_0x376a('0x4'),'afterUpdate':_0x376a('0x5'),'afterDestroy':_0x376a('0x6')};function emitEvent(_0x433678){return function(_0x8bdd7f,_0x17f183,_0x5b2249){ChatQueueEvents['emit'](_0x433678+':'+_0x8bdd7f['id'],_0x8bdd7f);ChatQueueEvents[_0x376a('0x7')](_0x433678,_0x8bdd7f);_0x5b2249(null);};}for(var e in events){if(events[_0x376a('0x8')](e)){var event=events[e];ChatQueue[_0x376a('0x9')](e,emitEvent(event));}}module[_0x376a('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 07fbd39..de4d9d0 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 _0x3166=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3166,0x109));var _0x6316=function(_0x232d51,_0x4a3cb3){_0x232d51=_0x232d51-0x0;var _0x71a7=_0x3166[_0x232d51];return _0x71a7;};'use strict';var _=require(_0x6316('0x0'));var util=require(_0x6316('0x1'));var logger=require('../../config/logger')(_0x6316('0x2'));var moment=require(_0x6316('0x3'));var BPromise=require(_0x6316('0x4'));var rp=require(_0x6316('0x5'));var fs=require('fs');var path=require(_0x6316('0x6'));var rimraf=require(_0x6316('0x7'));var config=require(_0x6316('0x8'));var attributes=require(_0x6316('0x9'));module[_0x6316('0xa')]=function(_0x28debe,_0x22a42c){return _0x28debe[_0x6316('0xb')](_0x6316('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b14=['chat_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x3b14,0xe5));var _0x43b1=function(_0x86d173,_0x2673b2){_0x86d173=_0x86d173-0x0;var _0x4856c5=_0x3b14[_0x86d173];return _0x4856c5;};'use strict';var _=require('lodash');var util=require(_0x43b1('0x0'));var logger=require(_0x43b1('0x1'))(_0x43b1('0x2'));var moment=require(_0x43b1('0x3'));var BPromise=require(_0x43b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43b1('0x5'));var rimraf=require(_0x43b1('0x6'));var config=require(_0x43b1('0x7'));var attributes=require(_0x43b1('0x8'));module[_0x43b1('0x9')]=function(_0x8fbff7,_0x12f743){return _0x8fbff7['define'](_0x43b1('0xa'),attributes,{'tableName':_0x43b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 5a63ea4..ba68dfd 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 _0x80ed=['request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x57235c,_0x53e379){var _0x3b6d0b=function(_0x5f12c1){while(--_0x5f12c1){_0x57235c['push'](_0x57235c['shift']());}};_0x3b6d0b(++_0x53e379);}(_0x80ed,0x11c));var _0xd80e=function(_0x4c24da,_0x4b0451){_0x4c24da=_0x4c24da-0x0;var _0x15225e=_0x80ed[_0x4c24da];return _0x15225e;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('ChatQueue,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')]({'raw':_0x527237['options']?_0x527237['options'][_0xd80e('0x20')]===undefined?!![]:![]:!![],'where':_0x527237[_0xd80e('0x21')]?_0x527237[_0xd80e('0x21')][_0xd80e('0x22')]||null:null,'attributes':_0x527237[_0xd80e('0x21')]?_0x527237[_0xd80e('0x21')][_0xd80e('0x23')]||null:null,'limit':_0x527237['options']?_0x527237[_0xd80e('0x21')][_0xd80e('0x24')]||null:null,'include':_0x527237[_0xd80e('0x21')]?_0x527237['options'][_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x527237[_0xd80e('0x21')]['include'],function(_0x521aa4){return{'model':db[_0x521aa4['model']],'as':_0x521aa4['as'],'attributes':_0x521aa4[_0xd80e('0x23')],'include':_0x521aa4['include']?_[_0xd80e('0x26')](_0x521aa4[_0xd80e('0x25')],function(_0x4e8ed9){return{'model':db[_0x4e8ed9[_0xd80e('0x27')]],'as':_0x4e8ed9['as'],'attributes':_0x4e8ed9[_0xd80e('0x23')],'include':_0x4e8ed9[_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x4e8ed9['include'],function(_0x15f317){return{'model':db[_0x15f317[_0xd80e('0x27')]],'as':_0x15f317['as'],'attributes':_0x15f317[_0xd80e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd80e('0x12')](function(_0x2b1aaf){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('GetChatQueue',_0x527237,JSON['stringify'](_0x2b1aaf));_0x2ef8a1(_0x2b1aaf);})[_0xd80e('0x1c')](function(_0x1303eb){logger[_0xd80e('0x19')](_0xd80e('0x1d'),_0x1303eb[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x1303eb['message']));});});};exports['ShowChatQueue']=function(_0x39c124){var _0x2d6ae5=this;return new Promise(function(_0x380f4f,_0x122a72){return db[_0xd80e('0x1e')][_0xd80e('0x28')]({'raw':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x39c124['options']?_0x39c124[_0xd80e('0x21')][_0xd80e('0x22')]||null:null,'attributes':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')][_0xd80e('0x23')]||null:null,'include':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')][_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x39c124[_0xd80e('0x21')]['include'],function(_0x36efc2){return{'model':db[_0x36efc2['model']],'as':_0x36efc2['as'],'attributes':_0x36efc2[_0xd80e('0x23')],'include':_0x36efc2[_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x36efc2[_0xd80e('0x25')],function(_0x5a1fda){return{'model':db[_0x5a1fda[_0xd80e('0x27')]],'as':_0x5a1fda['as'],'attributes':_0x5a1fda['attributes'],'include':_0x5a1fda[_0xd80e('0x25')]?_['map'](_0x5a1fda[_0xd80e('0x25')],function(_0x3da220){return{'model':db[_0x3da220['model']],'as':_0x3da220['as'],'attributes':_0x3da220[_0xd80e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd80e('0x12')](function(_0x2fbb7a){logger['info'](_0xd80e('0x29'),_0x39c124);logger[_0xd80e('0x16')](_0xd80e('0x29'),_0x39c124,JSON[_0xd80e('0x2a')](_0x2fbb7a));_0x380f4f(_0x2fbb7a);})[_0xd80e('0x1c')](function(_0x34b8e9){logger[_0xd80e('0x19')](_0xd80e('0x29'),_0x34b8e9[_0xd80e('0x1a')],_0x39c124);_0x122a72(_0x2d6ae5['error'](0x1f4,_0x34b8e9['message']));});});}; \ No newline at end of file +var _0xa5d7=['map','model','GetChatQueue','stringify','ShowChatQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','catch','findAll','options','where','attributes','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x4f9edb,_0x239f0b){_0x4f9edb=_0x4f9edb-0x0;var _0x4bfd9c=_0xa5d7[_0x4f9edb];return _0x4bfd9c;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var moment=require(_0x7a5d('0x2'));var BPromise=require(_0x7a5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a5d('0x5'));var logger=require('../../config/logger')(_0x7a5d('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a5d('0x7'));var client=jayson[_0x7a5d('0x8')][_0x7a5d('0x9')]({'port':0x232a});config['redis']=_[_0x7a5d('0xa')](config[_0x7a5d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a5d('0xc'))(new Redis(config['redis']));require(_0x7a5d('0xd'))[_0x7a5d('0xe')](socket);function respondWithRpcPromise(_0x28b554,_0x58cb5d,_0x130ec4){return new BPromise(function(_0x8f88a8,_0x25da61){return client[_0x7a5d('0xf')](_0x28b554,_0x130ec4)[_0x7a5d('0x10')](function(_0x1b6a3f){logger[_0x7a5d('0x11')](_0x7a5d('0x12'),_0x58cb5d,_0x7a5d('0x13'));logger[_0x7a5d('0x14')](_0x7a5d('0x15'),_0x58cb5d,_0x7a5d('0x13'),JSON['stringify'](_0x1b6a3f));if(_0x1b6a3f['error']){if(_0x1b6a3f[_0x7a5d('0x16')]['code']===0x1f4){logger[_0x7a5d('0x16')](_0x7a5d('0x12'),_0x58cb5d,_0x1b6a3f[_0x7a5d('0x16')][_0x7a5d('0x17')]);return _0x25da61(_0x1b6a3f[_0x7a5d('0x16')][_0x7a5d('0x17')]);}logger['error'](_0x7a5d('0x12'),_0x58cb5d,_0x1b6a3f[_0x7a5d('0x16')][_0x7a5d('0x17')]);return _0x8f88a8(_0x1b6a3f[_0x7a5d('0x16')][_0x7a5d('0x17')]);}else{logger['info'](_0x7a5d('0x12'),_0x58cb5d,_0x7a5d('0x13'));_0x8f88a8(_0x1b6a3f['result']['message']);}})[_0x7a5d('0x18')](function(_0x4229f6){logger['error'](_0x7a5d('0x12'),_0x58cb5d,_0x4229f6);_0x25da61(_0x4229f6);});});}exports['GetChatQueue']=function(_0x1fd82e){var _0x4a0d27=this;return new Promise(function(_0x436bef,_0x334d3d){return db['ChatQueue'][_0x7a5d('0x19')]({'raw':_0x1fd82e['options']?_0x1fd82e[_0x7a5d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1fd82e['options']?_0x1fd82e[_0x7a5d('0x1a')][_0x7a5d('0x1b')]||null:null,'attributes':_0x1fd82e[_0x7a5d('0x1a')]?_0x1fd82e['options'][_0x7a5d('0x1c')]||null:null,'limit':_0x1fd82e[_0x7a5d('0x1a')]?_0x1fd82e[_0x7a5d('0x1a')]['limit']||null:null,'include':_0x1fd82e[_0x7a5d('0x1a')]?_0x1fd82e['options'][_0x7a5d('0x1d')]?_[_0x7a5d('0x1e')](_0x1fd82e[_0x7a5d('0x1a')][_0x7a5d('0x1d')],function(_0x7383c0){return{'model':db[_0x7383c0[_0x7a5d('0x1f')]],'as':_0x7383c0['as'],'attributes':_0x7383c0['attributes'],'include':_0x7383c0[_0x7a5d('0x1d')]?_[_0x7a5d('0x1e')](_0x7383c0['include'],function(_0x1c33f5){return{'model':db[_0x1c33f5[_0x7a5d('0x1f')]],'as':_0x1c33f5['as'],'attributes':_0x1c33f5[_0x7a5d('0x1c')],'include':_0x1c33f5[_0x7a5d('0x1d')]?_['map'](_0x1c33f5[_0x7a5d('0x1d')],function(_0x2f922d){return{'model':db[_0x2f922d[_0x7a5d('0x1f')]],'as':_0x2f922d['as'],'attributes':_0x2f922d[_0x7a5d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7a5d('0x10')](function(_0x260255){logger[_0x7a5d('0x11')](_0x7a5d('0x20'),_0x1fd82e);logger['debug'](_0x7a5d('0x20'),_0x1fd82e,JSON[_0x7a5d('0x21')](_0x260255));_0x436bef(_0x260255);})[_0x7a5d('0x18')](function(_0x1be64c){logger[_0x7a5d('0x16')](_0x7a5d('0x20'),_0x1be64c[_0x7a5d('0x17')],_0x1fd82e);_0x334d3d(_0x4a0d27[_0x7a5d('0x16')](0x1f4,_0x1be64c[_0x7a5d('0x17')]));});});};exports[_0x7a5d('0x22')]=function(_0x353dbd){var _0x253104=this;return new Promise(function(_0x76b29c,_0x6a9295){return db['ChatQueue'][_0x7a5d('0x23')]({'raw':_0x353dbd['options']?_0x353dbd[_0x7a5d('0x1a')][_0x7a5d('0x24')]===undefined?!![]:![]:!![],'where':_0x353dbd[_0x7a5d('0x1a')]?_0x353dbd['options'][_0x7a5d('0x1b')]||null:null,'attributes':_0x353dbd[_0x7a5d('0x1a')]?_0x353dbd[_0x7a5d('0x1a')][_0x7a5d('0x1c')]||null:null,'include':_0x353dbd['options']?_0x353dbd[_0x7a5d('0x1a')][_0x7a5d('0x1d')]?_[_0x7a5d('0x1e')](_0x353dbd[_0x7a5d('0x1a')][_0x7a5d('0x1d')],function(_0x261251){return{'model':db[_0x261251['model']],'as':_0x261251['as'],'attributes':_0x261251[_0x7a5d('0x1c')],'include':_0x261251[_0x7a5d('0x1d')]?_[_0x7a5d('0x1e')](_0x261251['include'],function(_0x47e7c0){return{'model':db[_0x47e7c0[_0x7a5d('0x1f')]],'as':_0x47e7c0['as'],'attributes':_0x47e7c0[_0x7a5d('0x1c')],'include':_0x47e7c0[_0x7a5d('0x1d')]?_[_0x7a5d('0x1e')](_0x47e7c0[_0x7a5d('0x1d')],function(_0x2db2c7){return{'model':db[_0x2db2c7[_0x7a5d('0x1f')]],'as':_0x2db2c7['as'],'attributes':_0x2db2c7[_0x7a5d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7a5d('0x10')](function(_0x1fae23){logger[_0x7a5d('0x11')](_0x7a5d('0x22'),_0x353dbd);logger[_0x7a5d('0x14')]('ShowChatQueue',_0x353dbd,JSON[_0x7a5d('0x21')](_0x1fae23));_0x76b29c(_0x1fae23);})[_0x7a5d('0x18')](function(_0x24c8e1){logger[_0x7a5d('0x16')](_0x7a5d('0x22'),_0x24c8e1[_0x7a5d('0x17')],_0x353dbd);_0x6a9295(_0x253104[_0x7a5d('0x16')](0x1f4,_0x24c8e1[_0x7a5d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d64af46..f4cff15 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 _0xc978=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4446ac,_0x5d261c){var _0x1ba7a1=function(_0x7c5aad){while(--_0x7c5aad){_0x4446ac['push'](_0x4446ac['shift']());}};_0x1ba7a1(++_0x5d261c);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatQueueEvents['on'](_0x1b5864,_0x332cd1);}}; \ No newline at end of file +var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28d843,_0x254cc){_0x28d843=_0x28d843-0x0;var _0x2ffd24=_0x6f0d[_0x28d843];return _0x2ffd24;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index aab9cc9..11d5477 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2962fa,_0x28ca02){var _0x127c56=function(_0x36bde4){while(--_0x36bde4){_0x2962fa['push'](_0x2962fa['shift']());}};_0x127c56(++_0x28ca02);}(_0x008c,0x188));var _0xc008=function(_0x173f79,_0x3b2224){_0x173f79=_0x173f79-0x0;var _0x59ce8c=_0x008c[_0x173f79];return _0x59ce8c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x126770,_0x4f7bb1){var _0x4f8762=function(_0x185326){while(--_0x185326){_0x126770['push'](_0x126770['shift']());}};_0x4f8762(++_0x4f7bb1);}(_0x7217,0x19e));var _0x7721=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7217[_0x102e37];return _0x35a07c;};'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['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 96963ad..1067273 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 _0x2630=['STRING','DATE','sequelize','exports'];(function(_0xf7ccca,_0x1a5b80){var _0x2f6b9a=function(_0x3d9b52){while(--_0x3d9b52){_0xf7ccca['push'](_0xf7ccca['shift']());}};_0x2f6b9a(++_0x1a5b80);}(_0x2630,0xca));var _0x0263=function(_0x1b458b,_0x7ed77d){_0x1b458b=_0x1b458b-0x0;var _0x1918ce=_0x2630[_0x1b458b];return _0x1918ce;};'use strict';var moment=require('moment');var Sequelize=require(_0x0263('0x0'));module[_0x0263('0x1')]={'uniqueid':{'type':Sequelize[_0x0263('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0263('0x2')]},'joinAt':{'type':Sequelize[_0x0263('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0263('0x3')]},'exitAt':{'type':Sequelize[_0x0263('0x3')]},'reason':{'type':Sequelize[_0x0263('0x2')]}}; \ No newline at end of file +var _0x4cd7=['STRING','DATE','sequelize','exports'];(function(_0x91b644,_0x5b411f){var _0x4167b4=function(_0x3568ed){while(--_0x3568ed){_0x91b644['push'](_0x91b644['shift']());}};_0x4167b4(++_0x5b411f);}(_0x4cd7,0x1de));var _0x74cd=function(_0x13815d,_0x370aa4){_0x13815d=_0x13815d-0x0;var _0x3a8bdc=_0x4cd7[_0x13815d];return _0x3a8bdc;};'use strict';var moment=require('moment');var Sequelize=require(_0x74cd('0x0'));module[_0x74cd('0x1')]={'uniqueid':{'type':Sequelize[_0x74cd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x74cd('0x2')]},'joinAt':{'type':Sequelize[_0x74cd('0x3')]},'leaveAt':{'type':Sequelize[_0x74cd('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x74cd('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index a99585a..079ed18 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 _0x853e=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','includeAll','create','body','catch','find','describe','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x853e,0x1ea));var _0xe853=function(_0x292bd3,_0x4070ae){_0x292bd3=_0x292bd3-0x0;var _0x33150d=_0x853e[_0x292bd3];return _0x33150d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe853('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe853('0x1'));var rp=require('request-promise');var moment=require(_0xe853('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe853('0x3'));var util=require(_0xe853('0x4'));var path=require(_0xe853('0x5'));var sox=require(_0xe853('0x6'));var csv=require(_0xe853('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0x8'));var _=require(_0xe853('0x9'));var squel=require(_0xe853('0xa'));var crypto=require(_0xe853('0xb'));var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require(_0xe853('0x7'));var querystring=require(_0xe853('0xe'));var Papa=require(_0xe853('0xf'));var Redis=require(_0xe853('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe853('0x12'));var config=require(_0xe853('0x13'));var licenseUtil=require(_0xe853('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88883f,_0x476f20){_0x476f20=_0x476f20||0xcc;return function(_0x43c64b){if(_0x43c64b){return _0x88883f[_0xe853('0x15')](_0x476f20);}return _0x88883f[_0xe853('0x16')](_0x476f20)[_0xe853('0x17')]();};}function respondWithResult(_0x1ebf13,_0x4c92c6){_0x4c92c6=_0x4c92c6||0xc8;return function(_0x4b8e2c){if(_0x4b8e2c){return _0x1ebf13['status'](_0x4c92c6)['json'](_0x4b8e2c);}};}function respondWithFilteredResult(_0x156940,_0x3840b5){return function(_0x41c489){if(_0x41c489){var _0x11e4a0=typeof _0x3840b5[_0xe853('0x18')]===_0xe853('0x19')&&typeof _0x3840b5[_0xe853('0x1a')]===_0xe853('0x19');var _0x2a98fa=_0x41c489[_0xe853('0x1b')];var _0x30d868=_0x11e4a0?0x0:_0x3840b5[_0xe853('0x18')];var _0x459007=_0x11e4a0?_0x41c489[_0xe853('0x1b')]:_0x3840b5[_0xe853('0x18')]+_0x3840b5[_0xe853('0x1a')];var _0x5f45cf;if(_0x459007>=_0x2a98fa){_0x459007=_0x2a98fa;_0x5f45cf=0xc8;}else{_0x5f45cf=0xce;}_0x156940[_0xe853('0x16')](_0x5f45cf);return _0x156940[_0xe853('0x1c')](_0xe853('0x1d'),_0x30d868+'-'+_0x459007+'/'+_0x2a98fa)[_0xe853('0x1e')](_0x41c489);}return null;};}function patchUpdates(_0x3cd77f){return function(_0x1ade8a){try{jsonpatch[_0xe853('0x1f')](_0x1ade8a,_0x3cd77f,!![]);}catch(_0x3d9e77){return BPromise[_0xe853('0x20')](_0x3d9e77);}return _0x1ade8a[_0xe853('0x21')]();};}function saveUpdates(_0x163b62,_0x4d895e){return function(_0x110362){if(_0x110362){return _0x110362[_0xe853('0x22')](_0x163b62)[_0xe853('0x23')](function(_0x209049){return _0x209049;});}return null;};}function removeEntity(_0x1af209,_0xc875b2){return function(_0x3fa0e3){if(_0x3fa0e3){return _0x3fa0e3[_0xe853('0x24')]()['then'](function(){_0x1af209[_0xe853('0x16')](0xcc)[_0xe853('0x17')]();});}};}function handleEntityNotFound(_0x198895,_0x2cb2f1){return function(_0x105ce2){if(!_0x105ce2){_0x198895['sendStatus'](0x194);}return _0x105ce2;};}function handleError(_0x1fdaaf,_0x33e0b0){_0x33e0b0=_0x33e0b0||0x1f4;return function(_0x49d8ed){logger[_0xe853('0x25')](_0x49d8ed['stack']);if(_0x49d8ed[_0xe853('0x26')]){delete _0x49d8ed['name'];}_0x1fdaaf['status'](_0x33e0b0)[_0xe853('0x27')](_0x49d8ed);};}exports[_0xe853('0x28')]=function(_0x438b5b,_0x5d268f){var _0x397301={},_0x1e99c8={},_0x15db55={'count':0x0,'rows':[]};var _0x7f858c=_[_0xe853('0x29')](db[_0xe853('0x2a')][_0xe853('0x2b')],function(_0x5d4876){return{'name':_0x5d4876[_0xe853('0x2c')],'type':_0x5d4876[_0xe853('0x2d')]['key']};});_0x1e99c8[_0xe853('0x2e')]=_['map'](_0x7f858c,_0xe853('0x26'));_0x1e99c8[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x438b5b['query']);_0x1e99c8[_0xe853('0x31')]=_[_0xe853('0x32')](_0x1e99c8[_0xe853('0x2e')],_0x1e99c8[_0xe853('0x2f')]);_0x397301[_0xe853('0x33')]=_[_0xe853('0x32')](_0x1e99c8[_0xe853('0x2e')],qs[_0xe853('0x34')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x34')]));_0x397301[_0xe853('0x33')]=_0x397301['attributes'][_0xe853('0x35')]?_0x397301['attributes']:_0x1e99c8[_0xe853('0x2e')];if(!_0x438b5b[_0xe853('0x2f')][_0xe853('0x36')](_0xe853('0x37'))){_0x397301['limit']=qs[_0xe853('0x1a')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x1a')]);_0x397301[_0xe853('0x18')]=qs[_0xe853('0x18')](_0x438b5b[_0xe853('0x2f')]['offset']);}_0x397301[_0xe853('0x38')]=qs[_0xe853('0x39')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x39')]);_0x397301[_0xe853('0x3a')]=qs[_0xe853('0x31')](_[_0xe853('0x3b')](_0x438b5b[_0xe853('0x2f')],_0x1e99c8[_0xe853('0x31')]),_0x7f858c);if(_0x438b5b['query']['filter']){_0x397301[_0xe853('0x3a')]=_[_0xe853('0x3c')](_0x397301[_0xe853('0x3a')],{'$or':_['map'](_0x7f858c,function(_0x1ed61e){if(_0x1ed61e['type']!=='VIRTUAL'){var _0x4af4fc={};_0x4af4fc[_0x1ed61e[_0xe853('0x26')]]={'$like':'%'+_0x438b5b[_0xe853('0x2f')][_0xe853('0x3d')]+'%'};return _0x4af4fc;}})});}_0x397301=_['merge']({},_0x397301,_0x438b5b[_0xe853('0x3e')]);var _0x1c0696={'where':_0x397301[_0xe853('0x3a')]};return db[_0xe853('0x2a')][_0xe853('0x1b')](_0x1c0696)[_0xe853('0x23')](function(_0x54884d){_0x15db55['count']=_0x54884d;if(_0x438b5b[_0xe853('0x2f')]['includeAll']){_0x397301[_0xe853('0x3f')]=[{'all':!![]}];}return db[_0xe853('0x2a')][_0xe853('0x40')](_0x397301);})[_0xe853('0x23')](function(_0x1c6cc2){_0x15db55[_0xe853('0x41')]=_0x1c6cc2;return _0x15db55;})[_0xe853('0x23')](respondWithFilteredResult(_0x5d268f,_0x397301))['catch'](handleError(_0x5d268f,null));};exports[_0xe853('0x42')]=function(_0x2f97fe,_0x17662e){var _0x4c50d5={'raw':!![],'where':{'id':_0x2f97fe[_0xe853('0x43')]['id']}},_0x14fa6a={};_0x14fa6a['model']=_[_0xe853('0x30')](db[_0xe853('0x2a')]['rawAttributes']);_0x14fa6a[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x2f97fe[_0xe853('0x2f')]);_0x14fa6a[_0xe853('0x31')]=_['intersection'](_0x14fa6a[_0xe853('0x2e')],_0x14fa6a['query']);_0x4c50d5[_0xe853('0x33')]=_[_0xe853('0x32')](_0x14fa6a[_0xe853('0x2e')],qs['fields'](_0x2f97fe[_0xe853('0x2f')][_0xe853('0x34')]));_0x4c50d5['attributes']=_0x4c50d5[_0xe853('0x33')]['length']?_0x4c50d5[_0xe853('0x33')]:_0x14fa6a[_0xe853('0x2e')];if(_0x2f97fe[_0xe853('0x2f')][_0xe853('0x44')]){_0x4c50d5['include']=[{'all':!![]}];}_0x4c50d5=_['merge']({},_0x4c50d5,_0x2f97fe[_0xe853('0x3e')]);return db[_0xe853('0x2a')]['find'](_0x4c50d5)[_0xe853('0x23')](handleEntityNotFound(_0x17662e,null))[_0xe853('0x23')](respondWithResult(_0x17662e,null))['catch'](handleError(_0x17662e,null));};exports['create']=function(_0x230d53,_0x21f5e4){return db[_0xe853('0x2a')][_0xe853('0x45')](_0x230d53[_0xe853('0x46')],{})[_0xe853('0x23')](respondWithResult(_0x21f5e4,0xc9))[_0xe853('0x47')](handleError(_0x21f5e4,null));};exports[_0xe853('0x22')]=function(_0x1f07f6,_0x276c62){if(_0x1f07f6['body']['id']){delete _0x1f07f6['body']['id'];}return db[_0xe853('0x2a')][_0xe853('0x48')]({'where':{'id':_0x1f07f6['params']['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x276c62,null))[_0xe853('0x23')](saveUpdates(_0x1f07f6['body'],null))[_0xe853('0x23')](respondWithResult(_0x276c62,null))[_0xe853('0x47')](handleError(_0x276c62,null));};exports[_0xe853('0x24')]=function(_0x5eeb43,_0x42f38a){return db[_0xe853('0x2a')]['find']({'where':{'id':_0x5eeb43[_0xe853('0x43')]['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x42f38a,null))[_0xe853('0x23')](removeEntity(_0x42f38a,null))[_0xe853('0x47')](handleError(_0x42f38a,null));};exports[_0xe853('0x49')]=function(_0x29933f,_0x6a23ad){return db[_0xe853('0x2a')]['describe']()[_0xe853('0x23')](respondWithResult(_0x6a23ad,null))[_0xe853('0x47')](handleError(_0x6a23ad,null));}; \ No newline at end of file +var _0xa7ee=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','ChatQueueReport','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x127874,_0x10cd5c){var _0xd4b443=function(_0x4602a2){while(--_0x4602a2){_0x127874['push'](_0x127874['shift']());}};_0xd4b443(++_0x10cd5c);}(_0xa7ee,0x159));var _0xea7e=function(_0x4a310d,_0x33322d){_0x4a310d=_0x4a310d-0x0;var _0x5eaf36=_0xa7ee[_0x4a310d];return _0x5eaf36;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];function respondWithStatusCode(_0x138555,_0x1d2702){_0x1d2702=_0x1d2702||0xcc;return function(_0x97ec09){if(_0x97ec09){return _0x138555[_0xea7e('0x16')](_0x1d2702);}return _0x138555[_0xea7e('0x17')](_0x1d2702)[_0xea7e('0x18')]();};}function respondWithResult(_0x4c5137,_0x25317c){_0x25317c=_0x25317c||0xc8;return function(_0x3ef916){if(_0x3ef916){return _0x4c5137[_0xea7e('0x17')](_0x25317c)[_0xea7e('0x19')](_0x3ef916);}};}function respondWithFilteredResult(_0x57d27e,_0x18f7f0){return function(_0x4d3796){if(_0x4d3796){var _0x5c7466=typeof _0x18f7f0[_0xea7e('0x1a')]===_0xea7e('0x1b')&&typeof _0x18f7f0[_0xea7e('0x1c')]==='undefined';var _0x5c3b15=_0x4d3796[_0xea7e('0x1d')];var _0x5becf4=_0x5c7466?0x0:_0x18f7f0[_0xea7e('0x1a')];var _0x125aec=_0x5c7466?_0x4d3796['count']:_0x18f7f0['offset']+_0x18f7f0[_0xea7e('0x1c')];var _0x59e8d8;if(_0x125aec>=_0x5c3b15){_0x125aec=_0x5c3b15;_0x59e8d8=0xc8;}else{_0x59e8d8=0xce;}_0x57d27e['status'](_0x59e8d8);return _0x57d27e[_0xea7e('0x1e')]('Content-Range',_0x5becf4+'-'+_0x125aec+'/'+_0x5c3b15)[_0xea7e('0x19')](_0x4d3796);}return null;};}function patchUpdates(_0x1def2a){return function(_0x5c8d42){try{jsonpatch[_0xea7e('0x1f')](_0x5c8d42,_0x1def2a,!![]);}catch(_0x52dfb0){return BPromise[_0xea7e('0x20')](_0x52dfb0);}return _0x5c8d42[_0xea7e('0x21')]();};}function saveUpdates(_0xf779ad,_0xd441f8){return function(_0x372b9d){if(_0x372b9d){return _0x372b9d[_0xea7e('0x22')](_0xf779ad)['then'](function(_0xd41599){return _0xd41599;});}return null;};}function removeEntity(_0x1ddcc7,_0x4e8b96){return function(_0xb8149f){if(_0xb8149f){return _0xb8149f[_0xea7e('0x23')]()[_0xea7e('0x24')](function(){_0x1ddcc7['status'](0xcc)[_0xea7e('0x18')]();});}};}function handleEntityNotFound(_0x400125,_0x41b995){return function(_0x49ce51){if(!_0x49ce51){_0x400125[_0xea7e('0x16')](0x194);}return _0x49ce51;};}function handleError(_0x2a6623,_0x41d40c){_0x41d40c=_0x41d40c||0x1f4;return function(_0x7a75a6){logger[_0xea7e('0x25')](_0x7a75a6[_0xea7e('0x26')]);if(_0x7a75a6[_0xea7e('0x27')]){delete _0x7a75a6[_0xea7e('0x27')];}_0x2a6623[_0xea7e('0x17')](_0x41d40c)[_0xea7e('0x28')](_0x7a75a6);};}exports['index']=function(_0x1744f3,_0xd856de){var _0x4d3c38={},_0x2a1753={},_0x3a9465={'count':0x0,'rows':[]};var _0x1951c0=_[_0xea7e('0x29')](db[_0xea7e('0x2a')]['rawAttributes'],function(_0x38d8a7){return{'name':_0x38d8a7[_0xea7e('0x2b')],'type':_0x38d8a7['type'][_0xea7e('0x2c')]};});_0x2a1753[_0xea7e('0x2d')]=_['map'](_0x1951c0,_0xea7e('0x27'));_0x2a1753['query']=_[_0xea7e('0x2e')](_0x1744f3[_0xea7e('0x2f')]);_0x2a1753[_0xea7e('0x30')]=_[_0xea7e('0x31')](_0x2a1753[_0xea7e('0x2d')],_0x2a1753[_0xea7e('0x2f')]);_0x4d3c38['attributes']=_[_0xea7e('0x31')](_0x2a1753[_0xea7e('0x2d')],qs[_0xea7e('0x32')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x32')]));_0x4d3c38[_0xea7e('0x33')]=_0x4d3c38['attributes']['length']?_0x4d3c38[_0xea7e('0x33')]:_0x2a1753[_0xea7e('0x2d')];if(!_0x1744f3[_0xea7e('0x2f')]['hasOwnProperty'](_0xea7e('0x34'))){_0x4d3c38[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x1c')]);_0x4d3c38[_0xea7e('0x1a')]=qs[_0xea7e('0x1a')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x1a')]);}_0x4d3c38[_0xea7e('0x35')]=qs[_0xea7e('0x36')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x36')]);_0x4d3c38[_0xea7e('0x37')]=qs[_0xea7e('0x30')](_['pick'](_0x1744f3[_0xea7e('0x2f')],_0x2a1753[_0xea7e('0x30')]),_0x1951c0);if(_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x38')]){_0x4d3c38['where']=_[_0xea7e('0x39')](_0x4d3c38['where'],{'$or':_[_0xea7e('0x29')](_0x1951c0,function(_0x51ceb2){if(_0x51ceb2[_0xea7e('0x3a')]!==_0xea7e('0x3b')){var _0x468606={};_0x468606[_0x51ceb2[_0xea7e('0x27')]]={'$like':'%'+_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x38')]+'%'};return _0x468606;}})});}_0x4d3c38=_['merge']({},_0x4d3c38,_0x1744f3[_0xea7e('0x3c')]);var _0x369cad={'where':_0x4d3c38['where']};return db[_0xea7e('0x2a')]['count'](_0x369cad)[_0xea7e('0x24')](function(_0x233824){_0x3a9465['count']=_0x233824;if(_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x3d')]){_0x4d3c38[_0xea7e('0x3e')]=[{'all':!![]}];}return db[_0xea7e('0x2a')][_0xea7e('0x3f')](_0x4d3c38);})[_0xea7e('0x24')](function(_0x2db099){_0x3a9465[_0xea7e('0x40')]=_0x2db099;return _0x3a9465;})[_0xea7e('0x24')](respondWithFilteredResult(_0xd856de,_0x4d3c38))[_0xea7e('0x41')](handleError(_0xd856de,null));};exports[_0xea7e('0x42')]=function(_0x40093a,_0x44a501){var _0x18fd0f={'raw':!![],'where':{'id':_0x40093a['params']['id']}},_0x507d92={};_0x507d92['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x507d92[_0xea7e('0x2f')]=_['keys'](_0x40093a[_0xea7e('0x2f')]);_0x507d92[_0xea7e('0x30')]=_['intersection'](_0x507d92['model'],_0x507d92[_0xea7e('0x2f')]);_0x18fd0f[_0xea7e('0x33')]=_[_0xea7e('0x31')](_0x507d92[_0xea7e('0x2d')],qs['fields'](_0x40093a['query'][_0xea7e('0x32')]));_0x18fd0f['attributes']=_0x18fd0f[_0xea7e('0x33')][_0xea7e('0x43')]?_0x18fd0f['attributes']:_0x507d92[_0xea7e('0x2d')];if(_0x40093a[_0xea7e('0x2f')]['includeAll']){_0x18fd0f[_0xea7e('0x3e')]=[{'all':!![]}];}_0x18fd0f=_[_0xea7e('0x39')]({},_0x18fd0f,_0x40093a['options']);return db['ChatQueueReport'][_0xea7e('0x44')](_0x18fd0f)[_0xea7e('0x24')](handleEntityNotFound(_0x44a501,null))['then'](respondWithResult(_0x44a501,null))[_0xea7e('0x41')](handleError(_0x44a501,null));};exports[_0xea7e('0x45')]=function(_0x4dd73b,_0x45901a){return db[_0xea7e('0x2a')][_0xea7e('0x45')](_0x4dd73b[_0xea7e('0x46')],{})[_0xea7e('0x24')](respondWithResult(_0x45901a,0xc9))[_0xea7e('0x41')](handleError(_0x45901a,null));};exports[_0xea7e('0x22')]=function(_0x593d13,_0x351a61){if(_0x593d13[_0xea7e('0x46')]['id']){delete _0x593d13[_0xea7e('0x46')]['id'];}return db[_0xea7e('0x2a')][_0xea7e('0x44')]({'where':{'id':_0x593d13[_0xea7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x351a61,null))[_0xea7e('0x24')](saveUpdates(_0x593d13[_0xea7e('0x46')],null))[_0xea7e('0x24')](respondWithResult(_0x351a61,null))[_0xea7e('0x41')](handleError(_0x351a61,null));};exports[_0xea7e('0x23')]=function(_0x365b39,_0x5318b4){return db[_0xea7e('0x2a')][_0xea7e('0x44')]({'where':{'id':_0x365b39[_0xea7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5318b4,null))[_0xea7e('0x24')](removeEntity(_0x5318b4,null))[_0xea7e('0x41')](handleError(_0x5318b4,null));};exports['describe']=function(_0x1e9a90,_0x377fb9){return db[_0xea7e('0x2a')][_0xea7e('0x48')]()[_0xea7e('0x24')](respondWithResult(_0x377fb9,null))[_0xea7e('0x41')](handleError(_0x377fb9,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 131c0be..4bf6aaa 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x58e582,_0x41b688){var _0x27f1cd=function(_0x530c74){while(--_0x530c74){_0x58e582['push'](_0x58e582['shift']());}};_0x27f1cd(++_0x41b688);}(_0xe706,0xa3));var _0x6e70=function(_0x487cb0,_0x339d3e){_0x487cb0=_0x487cb0-0x0;var _0x5a8047=_0xe706[_0x487cb0];return _0x5a8047;};'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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0xb10b,0x12a));var _0xbb10=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xb10b[_0x2df724];return _0x1b2504;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 20e5488..2a9ed2e 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 _0x27d6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','then','info','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x354aa2,_0x31b042){var _0x66c5d=function(_0x5d6d9f){while(--_0x5d6d9f){_0x354aa2['push'](_0x354aa2['shift']());}};_0x66c5d(++_0x31b042);}(_0x27d6,0x11b));var _0x627d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x27d6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x627d('0x0'));var util=require(_0x627d('0x1'));var moment=require(_0x627d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x627d('0x3'));var db=require(_0x627d('0x4'))['db'];var utils=require(_0x627d('0x5'));var logger=require(_0x627d('0x6'))(_0x627d('0x7'));var config=require(_0x627d('0x8'));var jayson=require(_0x627d('0x9'));var client=jayson[_0x627d('0xa')][_0x627d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x69bb15,_0x69f035,_0x1a366a){return new BPromise(function(_0x487d21,_0x917a5f){return client[_0x627d('0xc')](_0x69bb15,_0x1a366a)['then'](function(_0x3e818f){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x627d('0xd'));logger['debug'](_0x627d('0xe'),_0x69f035,_0x627d('0xd'),JSON[_0x627d('0xf')](_0x3e818f));if(_0x3e818f['error']){if(_0x3e818f[_0x627d('0x10')][_0x627d('0x11')]===0x1f4){logger[_0x627d('0x10')](_0x627d('0x12'),_0x69f035,_0x3e818f['error'][_0x627d('0x13')]);return _0x917a5f(_0x3e818f[_0x627d('0x10')]['message']);}logger[_0x627d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x3e818f[_0x627d('0x10')]['message']);return _0x487d21(_0x3e818f['error'][_0x627d('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x69f035,'request\x20sent');_0x487d21(_0x3e818f[_0x627d('0x14')][_0x627d('0x13')]);}})[_0x627d('0x15')](function(_0x20bbe8){logger[_0x627d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x20bbe8);_0x917a5f(_0x20bbe8);});});}exports['CreateChatQueueReport']=function(_0x4695c8){var _0x5b3594=this;return new Promise(function(_0x36fd7f,_0x37f43d){return db[_0x627d('0x16')][_0x627d('0x17')](_0x4695c8[_0x627d('0x18')],{'raw':_0x4695c8[_0x627d('0x19')]?_0x4695c8[_0x627d('0x19')][_0x627d('0x1a')]===undefined?!![]:![]:!![]})[_0x627d('0x1b')](function(_0x531bfa){logger[_0x627d('0x1c')](_0x627d('0x1d'),_0x4695c8);logger[_0x627d('0x1e')]('CreateChatQueueReport',_0x4695c8,JSON['stringify'](_0x531bfa));_0x36fd7f(_0x531bfa);})[_0x627d('0x15')](function(_0x59bcd1){logger[_0x627d('0x10')](_0x627d('0x1d'),_0x59bcd1[_0x627d('0x13')],_0x4695c8);_0x37f43d(_0x5b3594[_0x627d('0x10')](0x1f4,_0x59bcd1['message']));});});};exports[_0x627d('0x1f')]=function(_0x66a133){var _0x4ad564=this;return new Promise(function(_0x385c1f,_0x107fab){return db[_0x627d('0x16')][_0x627d('0x20')](_0x66a133[_0x627d('0x18')],{'raw':_0x66a133[_0x627d('0x19')]?_0x66a133[_0x627d('0x19')][_0x627d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66a133['options']?_0x66a133['options'][_0x627d('0x21')]||null:null,'attributes':_0x66a133[_0x627d('0x19')]?_0x66a133['options'][_0x627d('0x22')]||null:null,'limit':_0x66a133[_0x627d('0x19')]?_0x66a133[_0x627d('0x19')][_0x627d('0x23')]||null:null})['then'](function(_0x524be5){logger[_0x627d('0x1c')](_0x627d('0x1f'),_0x66a133);logger['debug'](_0x627d('0x1f'),_0x66a133,JSON['stringify'](_0x524be5));_0x385c1f(_0x524be5);})[_0x627d('0x15')](function(_0x452336){logger[_0x627d('0x10')](_0x627d('0x1f'),_0x452336[_0x627d('0x13')],_0x66a133);_0x107fab(_0x4ad564[_0x627d('0x10')](0x1f4,_0x452336['message']));});});}; \ No newline at end of file +var _0x65f5=['update','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','info','UpdateChatQueueReport'];(function(_0x169a8a,_0x3526b1){var _0x2e8502=function(_0x4c37f3){while(--_0x4c37f3){_0x169a8a['push'](_0x169a8a['shift']());}};_0x2e8502(++_0x3526b1);}(_0x65f5,0x107));var _0x565f=function(_0x9f7988,_0x22acc6){_0x9f7988=_0x9f7988-0x0;var _0x27ec65=_0x65f5[_0x9f7988];return _0x27ec65;};'use strict';var _=require('lodash');var util=require(_0x565f('0x0'));var moment=require(_0x565f('0x1'));var BPromise=require(_0x565f('0x2'));var rs=require(_0x565f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x565f('0x4'))['db'];var utils=require(_0x565f('0x5'));var logger=require(_0x565f('0x6'))('rpc');var config=require(_0x565f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x565f('0x8')][_0x565f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ecff,_0x7ef231,_0x58f8d9){return new BPromise(function(_0x3ec049,_0x5146d0){return client[_0x565f('0xa')](_0x27ecff,_0x58f8d9)[_0x565f('0xb')](function(_0x606d6a){logger['info'](_0x565f('0xc'),_0x7ef231,_0x565f('0xd'));logger[_0x565f('0xe')](_0x565f('0xf'),_0x7ef231,_0x565f('0xd'),JSON[_0x565f('0x10')](_0x606d6a));if(_0x606d6a[_0x565f('0x11')]){if(_0x606d6a[_0x565f('0x11')]['code']===0x1f4){logger['error'](_0x565f('0xc'),_0x7ef231,_0x606d6a[_0x565f('0x11')][_0x565f('0x12')]);return _0x5146d0(_0x606d6a['error'][_0x565f('0x12')]);}logger[_0x565f('0x11')](_0x565f('0xc'),_0x7ef231,_0x606d6a[_0x565f('0x11')][_0x565f('0x12')]);return _0x3ec049(_0x606d6a[_0x565f('0x11')]['message']);}else{logger['info'](_0x565f('0xc'),_0x7ef231,_0x565f('0xd'));_0x3ec049(_0x606d6a[_0x565f('0x13')][_0x565f('0x12')]);}})[_0x565f('0x14')](function(_0xdcb374){logger[_0x565f('0x11')](_0x565f('0xc'),_0x7ef231,_0xdcb374);_0x5146d0(_0xdcb374);});});}exports[_0x565f('0x15')]=function(_0x2b38a){var _0x4b2889=this;return new Promise(function(_0x4708c3,_0x5c4143){return db[_0x565f('0x16')]['create'](_0x2b38a[_0x565f('0x17')],{'raw':_0x2b38a['options']?_0x2b38a[_0x565f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x565f('0xb')](function(_0x10cbe2){logger[_0x565f('0x19')](_0x565f('0x15'),_0x2b38a);logger[_0x565f('0xe')](_0x565f('0x15'),_0x2b38a,JSON[_0x565f('0x10')](_0x10cbe2));_0x4708c3(_0x10cbe2);})[_0x565f('0x14')](function(_0x3cf0cf){logger[_0x565f('0x11')](_0x565f('0x15'),_0x3cf0cf[_0x565f('0x12')],_0x2b38a);_0x5c4143(_0x4b2889[_0x565f('0x11')](0x1f4,_0x3cf0cf[_0x565f('0x12')]));});});};exports[_0x565f('0x1a')]=function(_0x1f642e){var _0x2c8ea5=this;return new Promise(function(_0x31295e,_0x11a532){return db[_0x565f('0x16')][_0x565f('0x1b')](_0x1f642e[_0x565f('0x17')],{'raw':_0x1f642e[_0x565f('0x18')]?_0x1f642e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f642e[_0x565f('0x18')]?_0x1f642e[_0x565f('0x18')]['where']||null:null,'attributes':_0x1f642e[_0x565f('0x18')]?_0x1f642e['options']['attributes']||null:null,'limit':_0x1f642e['options']?_0x1f642e[_0x565f('0x18')][_0x565f('0x1c')]||null:null})[_0x565f('0xb')](function(_0x14963e){logger[_0x565f('0x19')](_0x565f('0x1a'),_0x1f642e);logger['debug'](_0x565f('0x1a'),_0x1f642e,JSON[_0x565f('0x10')](_0x14963e));_0x31295e(_0x14963e);})[_0x565f('0x14')](function(_0xdc7977){logger[_0x565f('0x11')](_0x565f('0x1a'),_0xdc7977[_0x565f('0x12')],_0x1f642e);_0x11a532(_0x2c8ea5[_0x565f('0x11')](0x1f4,_0xdc7977[_0x565f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index acab003..67a2301 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 _0x837c=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','show','post','create','update','delete','destroy','exports','multer'];(function(_0x2a9584,_0x15ead9){var _0x2e6ed6=function(_0x493e62){while(--_0x493e62){_0x2a9584['push'](_0x2a9584['shift']());}};_0x2e6ed6(++_0x15ead9);}(_0x837c,0x12f));var _0xc837=function(_0x39cb2d,_0x1b4cd0){_0x39cb2d=_0x39cb2d-0x0;var _0x257c98=_0x837c[_0x39cb2d];return _0x257c98;};'use strict';var multer=require(_0xc837('0x0'));var util=require(_0xc837('0x1'));var path=require(_0xc837('0x2'));var timeout=require(_0xc837('0x3'));var express=require(_0xc837('0x4'));var router=express['Router']();var fs_extra=require(_0xc837('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc837('0x6'));var config=require(_0xc837('0x7'));var controller=require(_0xc837('0x8'));router[_0xc837('0x9')]('/',auth[_0xc837('0xa')](),controller['index']);router[_0xc837('0x9')]('/describe',auth[_0xc837('0xa')](),controller[_0xc837('0xb')]);router[_0xc837('0x9')]('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0xc')]);router[_0xc837('0xd')]('/',auth['isAuthenticated'](),controller[_0xc837('0xe')]);router['put']('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0xf')]);router[_0xc837('0x10')]('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0x11')]);module[_0xc837('0x12')]=router; \ No newline at end of file +var _0x17e6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1b788e,_0x4e29c2){var _0x32b186=function(_0x2a9190){while(--_0x2a9190){_0x1b788e['push'](_0x1b788e['shift']());}};_0x32b186(++_0x4e29c2);}(_0x17e6,0x1f3));var _0x617e=function(_0x35ad1d,_0x139af2){_0x35ad1d=_0x35ad1d-0x0;var _0x178bde=_0x17e6[_0x35ad1d];return _0x178bde;};'use strict';var multer=require(_0x617e('0x0'));var util=require(_0x617e('0x1'));var path=require(_0x617e('0x2'));var timeout=require(_0x617e('0x3'));var express=require(_0x617e('0x4'));var router=express[_0x617e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x617e('0x6'));var interaction=require(_0x617e('0x7'));var config=require(_0x617e('0x8'));var controller=require('./chatQueueReport.controller');router[_0x617e('0x9')]('/',auth['isAuthenticated'](),controller[_0x617e('0xa')]);router[_0x617e('0x9')]('/describe',auth[_0x617e('0xb')](),controller[_0x617e('0xc')]);router[_0x617e('0x9')](_0x617e('0xd'),auth[_0x617e('0xb')](),controller['show']);router[_0x617e('0xe')]('/',auth[_0x617e('0xb')](),controller['create']);router['put'](_0x617e('0xd'),auth[_0x617e('0xb')](),controller[_0x617e('0xf')]);router[_0x617e('0x10')]('/:id',auth[_0x617e('0xb')](),controller[_0x617e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 24435ef..d6bef29 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4fe67e,_0x1c69df){var _0x4581d6=function(_0xf1d9cc){while(--_0xf1d9cc){_0x4fe67e['push'](_0x4fe67e['shift']());}};_0x4581d6(++_0x1c69df);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xcb91[_0x36436d];return _0x34615d;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x9bde,0xe1));var _0xe9bd=function(_0xc91e2,_0x50bd13){_0xc91e2=_0xc91e2-0x0;var _0x4ea220=_0x9bde[_0xc91e2];return _0x4ea220;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index bc37e57..ed9e8fc 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 _0xba3f=['update','then','destroy','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','ChatTransferReport','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0xc578c,_0x38811e){var _0x5d5138=function(_0x293452){while(--_0x293452){_0xc578c['push'](_0xc578c['shift']());}};_0x5d5138(++_0x38811e);}(_0xba3f,0x1b1));var _0xfba3=function(_0x2a9b7a,_0x4ef939){_0x2a9b7a=_0x2a9b7a-0x0;var _0x6284d8=_0xba3f[_0x2a9b7a];return _0x6284d8;};'use strict';var emlformat=require(_0xfba3('0x0'));var rimraf=require(_0xfba3('0x1'));var zipdir=require(_0xfba3('0x2'));var jsonpatch=require(_0xfba3('0x3'));var rp=require(_0xfba3('0x4'));var moment=require(_0xfba3('0x5'));var BPromise=require(_0xfba3('0x6'));var Mustache=require(_0xfba3('0x7'));var util=require(_0xfba3('0x8'));var path=require(_0xfba3('0x9'));var sox=require(_0xfba3('0xa'));var csv=require(_0xfba3('0xb'));var ejs=require(_0xfba3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfba3('0xd'));var crypto=require(_0xfba3('0xe'));var jsforce=require(_0xfba3('0xf'));var deskjs=require(_0xfba3('0x10'));var toCsv=require(_0xfba3('0xb'));var querystring=require(_0xfba3('0x11'));var Papa=require('papaparse');var Redis=require(_0xfba3('0x12'));var authService=require(_0xfba3('0x13'));var qs=require(_0xfba3('0x14'));var as=require(_0xfba3('0x15'));var hardwareService=require(_0xfba3('0x16'));var logger=require(_0xfba3('0x17'))(_0xfba3('0x18'));var utils=require('../../config/utils');var config=require(_0xfba3('0x19'));var licenseUtil=require(_0xfba3('0x1a'));var db=require(_0xfba3('0x1b'))['db'];function respondWithStatusCode(_0x39341e,_0x378ee8){_0x378ee8=_0x378ee8||0xcc;return function(_0x1ded02){if(_0x1ded02){return _0x39341e[_0xfba3('0x1c')](_0x378ee8);}return _0x39341e[_0xfba3('0x1d')](_0x378ee8)[_0xfba3('0x1e')]();};}function respondWithResult(_0x189193,_0x4bf699){_0x4bf699=_0x4bf699||0xc8;return function(_0x52d9be){if(_0x52d9be){return _0x189193[_0xfba3('0x1d')](_0x4bf699)['json'](_0x52d9be);}};}function respondWithFilteredResult(_0x6db07a,_0x5962aa){return function(_0x230027){if(_0x230027){var _0x243351=typeof _0x5962aa['offset']===_0xfba3('0x1f')&&typeof _0x5962aa[_0xfba3('0x20')]===_0xfba3('0x1f');var _0x34e76d=_0x230027[_0xfba3('0x21')];var _0x6edfba=_0x243351?0x0:_0x5962aa[_0xfba3('0x22')];var _0x49aa44=_0x243351?_0x230027[_0xfba3('0x21')]:_0x5962aa['offset']+_0x5962aa['limit'];var _0x273c14;if(_0x49aa44>=_0x34e76d){_0x49aa44=_0x34e76d;_0x273c14=0xc8;}else{_0x273c14=0xce;}_0x6db07a[_0xfba3('0x1d')](_0x273c14);return _0x6db07a[_0xfba3('0x23')](_0xfba3('0x24'),_0x6edfba+'-'+_0x49aa44+'/'+_0x34e76d)[_0xfba3('0x25')](_0x230027);}return null;};}function patchUpdates(_0x46a926){return function(_0x4939be){try{jsonpatch[_0xfba3('0x26')](_0x4939be,_0x46a926,!![]);}catch(_0x32895f){return BPromise[_0xfba3('0x27')](_0x32895f);}return _0x4939be[_0xfba3('0x28')]();};}function saveUpdates(_0x6816e4,_0xee5bdc){return function(_0x571367){if(_0x571367){return _0x571367[_0xfba3('0x29')](_0x6816e4)[_0xfba3('0x2a')](function(_0x14e400){return _0x14e400;});}return null;};}function removeEntity(_0x1cdc7a,_0x2f698c){return function(_0xd53651){if(_0xd53651){return _0xd53651[_0xfba3('0x2b')]()['then'](function(){_0x1cdc7a[_0xfba3('0x1d')](0xcc)[_0xfba3('0x1e')]();});}};}function handleEntityNotFound(_0x4c258f,_0x1402ef){return function(_0x49a13e){if(!_0x49a13e){_0x4c258f[_0xfba3('0x1c')](0x194);}return _0x49a13e;};}function handleError(_0x3cc79d,_0x547b2c){_0x547b2c=_0x547b2c||0x1f4;return function(_0x4034aa){logger['error'](_0x4034aa[_0xfba3('0x2c')]);if(_0x4034aa[_0xfba3('0x2d')]){delete _0x4034aa[_0xfba3('0x2d')];}_0x3cc79d['status'](_0x547b2c)[_0xfba3('0x2e')](_0x4034aa);};}exports['index']=function(_0x226815,_0x5d227d){var _0x2c616d={},_0x50fe36={},_0x1d5cc7={'count':0x0,'rows':[]};var _0x5ddb22=_[_0xfba3('0x2f')](db['ChatTransferReport'][_0xfba3('0x30')],function(_0x1e210f){return{'name':_0x1e210f['fieldName'],'type':_0x1e210f[_0xfba3('0x31')][_0xfba3('0x32')]};});_0x50fe36['model']=_[_0xfba3('0x2f')](_0x5ddb22,_0xfba3('0x2d'));_0x50fe36[_0xfba3('0x33')]=_[_0xfba3('0x34')](_0x226815[_0xfba3('0x33')]);_0x50fe36[_0xfba3('0x35')]=_[_0xfba3('0x36')](_0x50fe36[_0xfba3('0x37')],_0x50fe36[_0xfba3('0x33')]);_0x2c616d[_0xfba3('0x38')]=_['intersection'](_0x50fe36[_0xfba3('0x37')],qs[_0xfba3('0x39')](_0x226815[_0xfba3('0x33')]['fields']));_0x2c616d[_0xfba3('0x38')]=_0x2c616d[_0xfba3('0x38')][_0xfba3('0x3a')]?_0x2c616d[_0xfba3('0x38')]:_0x50fe36['model'];if(!_0x226815[_0xfba3('0x33')][_0xfba3('0x3b')](_0xfba3('0x3c'))){_0x2c616d[_0xfba3('0x20')]=qs['limit'](_0x226815[_0xfba3('0x33')][_0xfba3('0x20')]);_0x2c616d['offset']=qs[_0xfba3('0x22')](_0x226815[_0xfba3('0x33')][_0xfba3('0x22')]);}_0x2c616d[_0xfba3('0x3d')]=qs['sort'](_0x226815['query'][_0xfba3('0x3e')]);_0x2c616d['where']=qs[_0xfba3('0x35')](_['pick'](_0x226815[_0xfba3('0x33')],_0x50fe36[_0xfba3('0x35')]),_0x5ddb22);if(_0x226815[_0xfba3('0x33')][_0xfba3('0x3f')]){_0x2c616d[_0xfba3('0x40')]=_[_0xfba3('0x41')](_0x2c616d[_0xfba3('0x40')],{'$or':_['map'](_0x5ddb22,function(_0x194004){if(_0x194004[_0xfba3('0x31')]!==_0xfba3('0x42')){var _0x2338a9={};_0x2338a9[_0x194004[_0xfba3('0x2d')]]={'$like':'%'+_0x226815['query']['filter']+'%'};return _0x2338a9;}})});}_0x2c616d=_[_0xfba3('0x41')]({},_0x2c616d,_0x226815['options']);var _0x58ba35={'where':_0x2c616d[_0xfba3('0x40')]};return db[_0xfba3('0x43')][_0xfba3('0x21')](_0x58ba35)['then'](function(_0x1dc6a9){_0x1d5cc7['count']=_0x1dc6a9;if(_0x226815['query'][_0xfba3('0x44')]){_0x2c616d['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2c616d);})[_0xfba3('0x2a')](function(_0x1b57cc){_0x1d5cc7[_0xfba3('0x45')]=_0x1b57cc;return _0x1d5cc7;})['then'](respondWithFilteredResult(_0x5d227d,_0x2c616d))[_0xfba3('0x46')](handleError(_0x5d227d,null));};exports[_0xfba3('0x47')]=function(_0x3f8729,_0x1d37cb){var _0x371026={'raw':!![],'where':{'id':_0x3f8729[_0xfba3('0x48')]['id']}},_0x3fcea8={};_0x3fcea8[_0xfba3('0x37')]=_[_0xfba3('0x34')](db[_0xfba3('0x43')][_0xfba3('0x30')]);_0x3fcea8['query']=_[_0xfba3('0x34')](_0x3f8729['query']);_0x3fcea8['filters']=_[_0xfba3('0x36')](_0x3fcea8[_0xfba3('0x37')],_0x3fcea8['query']);_0x371026['attributes']=_[_0xfba3('0x36')](_0x3fcea8[_0xfba3('0x37')],qs[_0xfba3('0x39')](_0x3f8729[_0xfba3('0x33')][_0xfba3('0x39')]));_0x371026[_0xfba3('0x38')]=_0x371026[_0xfba3('0x38')][_0xfba3('0x3a')]?_0x371026[_0xfba3('0x38')]:_0x3fcea8['model'];if(_0x3f8729['query']['includeAll']){_0x371026[_0xfba3('0x49')]=[{'all':!![]}];}_0x371026=_[_0xfba3('0x41')]({},_0x371026,_0x3f8729[_0xfba3('0x4a')]);return db[_0xfba3('0x43')][_0xfba3('0x4b')](_0x371026)[_0xfba3('0x2a')](handleEntityNotFound(_0x1d37cb,null))[_0xfba3('0x2a')](respondWithResult(_0x1d37cb,null))[_0xfba3('0x46')](handleError(_0x1d37cb,null));};exports[_0xfba3('0x4c')]=function(_0xda8e97,_0x72798d){return db['ChatTransferReport'][_0xfba3('0x4c')](_0xda8e97[_0xfba3('0x4d')],{})[_0xfba3('0x2a')](respondWithResult(_0x72798d,0xc9))[_0xfba3('0x46')](handleError(_0x72798d,null));};exports[_0xfba3('0x29')]=function(_0x3da874,_0x3eaf29){if(_0x3da874[_0xfba3('0x4d')]['id']){delete _0x3da874['body']['id'];}return db[_0xfba3('0x43')][_0xfba3('0x4b')]({'where':{'id':_0x3da874[_0xfba3('0x48')]['id']}})[_0xfba3('0x2a')](handleEntityNotFound(_0x3eaf29,null))[_0xfba3('0x2a')](saveUpdates(_0x3da874[_0xfba3('0x4d')],null))['then'](respondWithResult(_0x3eaf29,null))[_0xfba3('0x46')](handleError(_0x3eaf29,null));};exports[_0xfba3('0x2b')]=function(_0x36cb65,_0xad9269){return db['ChatTransferReport'][_0xfba3('0x4b')]({'where':{'id':_0x36cb65['params']['id']}})[_0xfba3('0x2a')](handleEntityNotFound(_0xad9269,null))[_0xfba3('0x2a')](removeEntity(_0xad9269,null))[_0xfba3('0x46')](handleError(_0xad9269,null));};exports['describe']=function(_0x1c1272,_0xf57125){return db[_0xfba3('0x43')][_0xfba3('0x4e')]()[_0xfba3('0x2a')](respondWithResult(_0xf57125,null))[_0xfba3('0x46')](handleError(_0xf57125,null));}; \ No newline at end of file +var _0x98b6=['sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ChatTransferReport','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','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'];(function(_0xe9dfa7,_0x2c93e9){var _0x284330=function(_0x18db87){while(--_0x18db87){_0xe9dfa7['push'](_0xe9dfa7['shift']());}};_0x284330(++_0x2c93e9);}(_0x98b6,0x11a));var _0x698b=function(_0x28c8c6,_0x2d3eff){_0x28c8c6=_0x28c8c6-0x0;var _0x489589=_0x98b6[_0x28c8c6];return _0x489589;};'use strict';var emlformat=require(_0x698b('0x0'));var rimraf=require(_0x698b('0x1'));var zipdir=require(_0x698b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x698b('0x3'));var moment=require('moment');var BPromise=require(_0x698b('0x4'));var Mustache=require(_0x698b('0x5'));var util=require(_0x698b('0x6'));var path=require(_0x698b('0x7'));var sox=require(_0x698b('0x8'));var csv=require(_0x698b('0x9'));var ejs=require(_0x698b('0xa'));var fs=require('fs');var fs_extra=require(_0x698b('0xb'));var _=require(_0x698b('0xc'));var squel=require('squel');var crypto=require(_0x698b('0xd'));var jsforce=require(_0x698b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x698b('0x9'));var querystring=require(_0x698b('0xf'));var Papa=require(_0x698b('0x10'));var Redis=require(_0x698b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x698b('0x12'));var as=require(_0x698b('0x13'));var hardwareService=require(_0x698b('0x14'));var logger=require(_0x698b('0x15'))(_0x698b('0x16'));var utils=require('../../config/utils');var config=require(_0x698b('0x17'));var licenseUtil=require(_0x698b('0x18'));var db=require(_0x698b('0x19'))['db'];function respondWithStatusCode(_0x3ba769,_0xc820a4){_0xc820a4=_0xc820a4||0xcc;return function(_0x53970d){if(_0x53970d){return _0x3ba769[_0x698b('0x1a')](_0xc820a4);}return _0x3ba769[_0x698b('0x1b')](_0xc820a4)[_0x698b('0x1c')]();};}function respondWithResult(_0x58b3d9,_0x2af970){_0x2af970=_0x2af970||0xc8;return function(_0x3fc216){if(_0x3fc216){return _0x58b3d9[_0x698b('0x1b')](_0x2af970)[_0x698b('0x1d')](_0x3fc216);}};}function respondWithFilteredResult(_0x28a9eb,_0x2ed095){return function(_0x1504c2){if(_0x1504c2){var _0x4249ae=typeof _0x2ed095['offset']===_0x698b('0x1e')&&typeof _0x2ed095[_0x698b('0x1f')]==='undefined';var _0x54ca94=_0x1504c2[_0x698b('0x20')];var _0x787ee6=_0x4249ae?0x0:_0x2ed095[_0x698b('0x21')];var _0x591e95=_0x4249ae?_0x1504c2[_0x698b('0x20')]:_0x2ed095['offset']+_0x2ed095[_0x698b('0x1f')];var _0x3cdfe9;if(_0x591e95>=_0x54ca94){_0x591e95=_0x54ca94;_0x3cdfe9=0xc8;}else{_0x3cdfe9=0xce;}_0x28a9eb['status'](_0x3cdfe9);return _0x28a9eb['set']('Content-Range',_0x787ee6+'-'+_0x591e95+'/'+_0x54ca94)['json'](_0x1504c2);}return null;};}function patchUpdates(_0xd41f97){return function(_0x1cca46){try{jsonpatch[_0x698b('0x22')](_0x1cca46,_0xd41f97,!![]);}catch(_0xd94d90){return BPromise[_0x698b('0x23')](_0xd94d90);}return _0x1cca46[_0x698b('0x24')]();};}function saveUpdates(_0x1732b7,_0x24d811){return function(_0x308a23){if(_0x308a23){return _0x308a23[_0x698b('0x25')](_0x1732b7)[_0x698b('0x26')](function(_0x199039){return _0x199039;});}return null;};}function removeEntity(_0x3671ef,_0x327fd5){return function(_0x987fe1){if(_0x987fe1){return _0x987fe1[_0x698b('0x27')]()[_0x698b('0x26')](function(){_0x3671ef['status'](0xcc)[_0x698b('0x1c')]();});}};}function handleEntityNotFound(_0x225892,_0x4e9a30){return function(_0x1842fd){if(!_0x1842fd){_0x225892[_0x698b('0x1a')](0x194);}return _0x1842fd;};}function handleError(_0x5f1a4a,_0x41534f){_0x41534f=_0x41534f||0x1f4;return function(_0x2acb9b){logger[_0x698b('0x28')](_0x2acb9b[_0x698b('0x29')]);if(_0x2acb9b[_0x698b('0x2a')]){delete _0x2acb9b['name'];}_0x5f1a4a[_0x698b('0x1b')](_0x41534f)[_0x698b('0x2b')](_0x2acb9b);};}exports[_0x698b('0x2c')]=function(_0x417a12,_0x46fec9){var _0x3fa539={},_0x4dedf6={},_0x597ee4={'count':0x0,'rows':[]};var _0x585879=_[_0x698b('0x2d')](db['ChatTransferReport']['rawAttributes'],function(_0x55804f){return{'name':_0x55804f['fieldName'],'type':_0x55804f[_0x698b('0x2e')]['key']};});_0x4dedf6[_0x698b('0x2f')]=_[_0x698b('0x2d')](_0x585879,_0x698b('0x2a'));_0x4dedf6[_0x698b('0x30')]=_[_0x698b('0x31')](_0x417a12[_0x698b('0x30')]);_0x4dedf6[_0x698b('0x32')]=_[_0x698b('0x33')](_0x4dedf6[_0x698b('0x2f')],_0x4dedf6[_0x698b('0x30')]);_0x3fa539[_0x698b('0x34')]=_[_0x698b('0x33')](_0x4dedf6[_0x698b('0x2f')],qs[_0x698b('0x35')](_0x417a12[_0x698b('0x30')][_0x698b('0x35')]));_0x3fa539[_0x698b('0x34')]=_0x3fa539['attributes']['length']?_0x3fa539[_0x698b('0x34')]:_0x4dedf6[_0x698b('0x2f')];if(!_0x417a12[_0x698b('0x30')]['hasOwnProperty'](_0x698b('0x36'))){_0x3fa539[_0x698b('0x1f')]=qs['limit'](_0x417a12[_0x698b('0x30')][_0x698b('0x1f')]);_0x3fa539[_0x698b('0x21')]=qs[_0x698b('0x21')](_0x417a12[_0x698b('0x30')]['offset']);}_0x3fa539[_0x698b('0x37')]=qs[_0x698b('0x38')](_0x417a12['query'][_0x698b('0x38')]);_0x3fa539[_0x698b('0x39')]=qs[_0x698b('0x32')](_[_0x698b('0x3a')](_0x417a12[_0x698b('0x30')],_0x4dedf6['filters']),_0x585879);if(_0x417a12['query'][_0x698b('0x3b')]){_0x3fa539[_0x698b('0x39')]=_[_0x698b('0x3c')](_0x3fa539['where'],{'$or':_[_0x698b('0x2d')](_0x585879,function(_0xb1da57){if(_0xb1da57['type']!==_0x698b('0x3d')){var _0x550d81={};_0x550d81[_0xb1da57['name']]={'$like':'%'+_0x417a12['query'][_0x698b('0x3b')]+'%'};return _0x550d81;}})});}_0x3fa539=_[_0x698b('0x3c')]({},_0x3fa539,_0x417a12['options']);var _0x5728db={'where':_0x3fa539[_0x698b('0x39')]};return db['ChatTransferReport'][_0x698b('0x20')](_0x5728db)[_0x698b('0x26')](function(_0x597d88){_0x597ee4[_0x698b('0x20')]=_0x597d88;if(_0x417a12[_0x698b('0x30')][_0x698b('0x3e')]){_0x3fa539[_0x698b('0x3f')]=[{'all':!![]}];}return db[_0x698b('0x40')][_0x698b('0x41')](_0x3fa539);})[_0x698b('0x26')](function(_0x3b129c){_0x597ee4[_0x698b('0x42')]=_0x3b129c;return _0x597ee4;})[_0x698b('0x26')](respondWithFilteredResult(_0x46fec9,_0x3fa539))[_0x698b('0x43')](handleError(_0x46fec9,null));};exports[_0x698b('0x44')]=function(_0x44cc74,_0x4b6e7b){var _0x26beb4={'raw':!![],'where':{'id':_0x44cc74[_0x698b('0x45')]['id']}},_0x5801b5={};_0x5801b5[_0x698b('0x2f')]=_['keys'](db[_0x698b('0x40')][_0x698b('0x46')]);_0x5801b5['query']=_[_0x698b('0x31')](_0x44cc74[_0x698b('0x30')]);_0x5801b5['filters']=_[_0x698b('0x33')](_0x5801b5[_0x698b('0x2f')],_0x5801b5['query']);_0x26beb4[_0x698b('0x34')]=_[_0x698b('0x33')](_0x5801b5[_0x698b('0x2f')],qs[_0x698b('0x35')](_0x44cc74['query'][_0x698b('0x35')]));_0x26beb4['attributes']=_0x26beb4['attributes'][_0x698b('0x47')]?_0x26beb4[_0x698b('0x34')]:_0x5801b5['model'];if(_0x44cc74[_0x698b('0x30')]['includeAll']){_0x26beb4[_0x698b('0x3f')]=[{'all':!![]}];}_0x26beb4=_[_0x698b('0x3c')]({},_0x26beb4,_0x44cc74[_0x698b('0x48')]);return db['ChatTransferReport'][_0x698b('0x49')](_0x26beb4)['then'](handleEntityNotFound(_0x4b6e7b,null))[_0x698b('0x26')](respondWithResult(_0x4b6e7b,null))['catch'](handleError(_0x4b6e7b,null));};exports[_0x698b('0x4a')]=function(_0x10dcc6,_0x52afcf){return db[_0x698b('0x40')][_0x698b('0x4a')](_0x10dcc6[_0x698b('0x4b')],{})['then'](respondWithResult(_0x52afcf,0xc9))[_0x698b('0x43')](handleError(_0x52afcf,null));};exports[_0x698b('0x25')]=function(_0x511669,_0x24b421){if(_0x511669[_0x698b('0x4b')]['id']){delete _0x511669[_0x698b('0x4b')]['id'];}return db[_0x698b('0x40')][_0x698b('0x49')]({'where':{'id':_0x511669[_0x698b('0x45')]['id']}})['then'](handleEntityNotFound(_0x24b421,null))['then'](saveUpdates(_0x511669[_0x698b('0x4b')],null))[_0x698b('0x26')](respondWithResult(_0x24b421,null))[_0x698b('0x43')](handleError(_0x24b421,null));};exports[_0x698b('0x27')]=function(_0x47f6c8,_0x10c09f){return db['ChatTransferReport'][_0x698b('0x49')]({'where':{'id':_0x47f6c8[_0x698b('0x45')]['id']}})['then'](handleEntityNotFound(_0x10c09f,null))['then'](removeEntity(_0x10c09f,null))[_0x698b('0x43')](handleError(_0x10c09f,null));};exports[_0x698b('0x4c')]=function(_0x14ef8f,_0x4bc921){return db[_0x698b('0x40')][_0x698b('0x4c')]()[_0x698b('0x26')](respondWithResult(_0x4bc921,null))[_0x698b('0x43')](handleError(_0x4bc921,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b65ef8f..fcad8ca 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 _0xf94e=['path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x230b70,_0x5b3c8c){var _0x36164e=function(_0x28a4b2){while(--_0x28a4b2){_0x230b70['push'](_0x230b70['shift']());}};_0x36164e(++_0x5b3c8c);}(_0xf94e,0x1dc));var _0xef94=function(_0x28b034,_0x5ca737){_0x28b034=_0x28b034-0x0;var _0x146c73=_0xf94e[_0x28b034];return _0x146c73;};'use strict';var _=require(_0xef94('0x0'));var util=require(_0xef94('0x1'));var logger=require(_0xef94('0x2'))(_0xef94('0x3'));var moment=require('moment');var BPromise=require(_0xef94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef94('0x5'));var rimraf=require(_0xef94('0x6'));var config=require(_0xef94('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xef94('0x8')]=function(_0x557ea2,_0x4b7d5){return _0x557ea2[_0xef94('0x9')](_0xef94('0xa'),attributes,{'tableName':_0xef94('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xef94('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf8a=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ab487,_0x555214){var _0x46610d=function(_0x47272b){while(--_0x47272b){_0x1ab487['push'](_0x1ab487['shift']());}};_0x46610d(++_0x555214);}(_0xdf8a,0xfe));var _0xadf8=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0xdf8a[_0x2442b9];return _0x31b571;};'use strict';var _=require('lodash');var util=require(_0xadf8('0x0'));var logger=require(_0xadf8('0x1'))(_0xadf8('0x2'));var moment=require(_0xadf8('0x3'));var BPromise=require(_0xadf8('0x4'));var rp=require(_0xadf8('0x5'));var fs=require('fs');var path=require(_0xadf8('0x6'));var rimraf=require(_0xadf8('0x7'));var config=require(_0xadf8('0x8'));var attributes=require(_0xadf8('0x9'));module[_0xadf8('0xa')]=function(_0x4c1eb9,_0x5b90b9){return _0x4c1eb9['define']('ChatTransferReport',attributes,{'tableName':_0xadf8('0xb'),'paranoid':![],'indexes':[{'name':_0xadf8('0xc'),'fields':[_0xadf8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f6b5f75..01859fa 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 _0x469f=['request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5b62df,_0x235c6f){var _0x5692f2=function(_0x10bf6c){while(--_0x10bf6c){_0x5b62df['push'](_0x5b62df['shift']());}};_0x5692f2(++_0x235c6f);}(_0x469f,0x1ae));var _0xf469=function(_0x34b14d,_0x3064aa){_0x34b14d=_0x34b14d-0x0;var _0x1593ea=_0x469f[_0x34b14d];return _0x1593ea;};'use strict';var _=require(_0xf469('0x0'));var util=require(_0xf469('0x1'));var moment=require(_0xf469('0x2'));var BPromise=require('bluebird');var rs=require(_0xf469('0x3'));var fs=require('fs');var Redis=require(_0xf469('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf469('0x5'));var logger=require(_0xf469('0x6'))(_0xf469('0x7'));var config=require(_0xf469('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf469('0x9')][_0xf469('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd73aba,_0x34de56,_0x1b6fb5){return new BPromise(function(_0x1a94a3,_0xfacadf){return client[_0xf469('0xb')](_0xd73aba,_0x1b6fb5)['then'](function(_0x19d4aa){logger['info'](_0xf469('0xc'),_0x34de56,_0xf469('0xd'));logger[_0xf469('0xe')](_0xf469('0xf'),_0x34de56,_0xf469('0xd'),JSON[_0xf469('0x10')](_0x19d4aa));if(_0x19d4aa[_0xf469('0x11')]){if(_0x19d4aa['error']['code']===0x1f4){logger[_0xf469('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x34de56,_0x19d4aa['error'][_0xf469('0x12')]);return _0xfacadf(_0x19d4aa[_0xf469('0x11')][_0xf469('0x12')]);}logger[_0xf469('0x11')](_0xf469('0xc'),_0x34de56,_0x19d4aa['error'][_0xf469('0x12')]);return _0x1a94a3(_0x19d4aa['error'][_0xf469('0x12')]);}else{logger[_0xf469('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x34de56,_0xf469('0xd'));_0x1a94a3(_0x19d4aa[_0xf469('0x14')]['message']);}})['catch'](function(_0x20bab0){logger['error'](_0xf469('0xc'),_0x34de56,_0x20bab0);_0xfacadf(_0x20bab0);});});} \ No newline at end of file +var _0xea7c=['code','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x138162,_0x4e7612){var _0x1f7778=function(_0x2317a6){while(--_0x2317a6){_0x138162['push'](_0x138162['shift']());}};_0x1f7778(++_0x4e7612);}(_0xea7c,0x17c));var _0xcea7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xea7c[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xcea7('0x0'));var util=require(_0xcea7('0x1'));var moment=require(_0xcea7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcea7('0x3'));var db=require(_0xcea7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcea7('0x5'))(_0xcea7('0x6'));var config=require(_0xcea7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcea7('0x8')][_0xcea7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58af06,_0x1c20a5,_0x2da08e){return new BPromise(function(_0x5c149b,_0x30f563){return client['request'](_0x58af06,_0x2da08e)[_0xcea7('0xa')](function(_0x49b3c6){logger[_0xcea7('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x1c20a5,_0xcea7('0xc'));logger[_0xcea7('0xd')](_0xcea7('0xe'),_0x1c20a5,'request\x20sent',JSON[_0xcea7('0xf')](_0x49b3c6));if(_0x49b3c6['error']){if(_0x49b3c6['error'][_0xcea7('0x10')]===0x1f4){logger[_0xcea7('0x11')](_0xcea7('0x12'),_0x1c20a5,_0x49b3c6[_0xcea7('0x11')]['message']);return _0x30f563(_0x49b3c6[_0xcea7('0x11')][_0xcea7('0x13')]);}logger[_0xcea7('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1c20a5,_0x49b3c6[_0xcea7('0x11')][_0xcea7('0x13')]);return _0x5c149b(_0x49b3c6[_0xcea7('0x11')]['message']);}else{logger[_0xcea7('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x1c20a5,'request\x20sent');_0x5c149b(_0x49b3c6[_0xcea7('0x14')][_0xcea7('0x13')]);}})[_0xcea7('0x15')](function(_0x4544ea){logger[_0xcea7('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1c20a5,_0x4544ea);_0x30f563(_0x4544ea);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 54d93d8..85e0a58 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 _0xc407=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc407,0x17e));var _0x7c40=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0xc407[_0x1db481];return _0x3db95b;};'use strict';var multer=require(_0x7c40('0x0'));var util=require('util');var path=require(_0x7c40('0x1'));var timeout=require(_0x7c40('0x2'));var express=require(_0x7c40('0x3'));var router=express[_0x7c40('0x4')]();var fs_extra=require(_0x7c40('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c40('0x6'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7c40('0x7'),auth[_0x7c40('0x8')](),controller[_0x7c40('0x9')]);router[_0x7c40('0xa')](_0x7c40('0xb'),auth[_0x7c40('0x8')](),controller[_0x7c40('0xc')]);router[_0x7c40('0xd')]('/',auth[_0x7c40('0x8')](),controller[_0x7c40('0xe')]);router[_0x7c40('0xf')](_0x7c40('0xb'),auth[_0x7c40('0x8')](),controller[_0x7c40('0x10')]);router[_0x7c40('0x11')]('/:id',auth[_0x7c40('0x8')](),controller[_0x7c40('0x12')]);module[_0x7c40('0x13')]=router; \ No newline at end of file +var _0x9b77=['show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x37002,_0x5f0ded){var _0x31812a=function(_0x10dcf1){while(--_0x10dcf1){_0x37002['push'](_0x37002['shift']());}};_0x31812a(++_0x5f0ded);}(_0x9b77,0x12d));var _0x79b7=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x9b77[_0xd02bb];return _0x1cdf23;};'use strict';var multer=require('multer');var util=require(_0x79b7('0x0'));var path=require(_0x79b7('0x1'));var timeout=require(_0x79b7('0x2'));var express=require(_0x79b7('0x3'));var router=express[_0x79b7('0x4')]();var fs_extra=require(_0x79b7('0x5'));var auth=require(_0x79b7('0x6'));var interaction=require(_0x79b7('0x7'));var config=require(_0x79b7('0x8'));var controller=require('./chatTransferReport.controller');router[_0x79b7('0x9')]('/',auth[_0x79b7('0xa')](),controller['index']);router[_0x79b7('0x9')](_0x79b7('0xb'),auth[_0x79b7('0xa')](),controller[_0x79b7('0xc')]);router[_0x79b7('0x9')](_0x79b7('0xd'),auth[_0x79b7('0xa')](),controller[_0x79b7('0xe')]);router[_0x79b7('0xf')]('/',auth[_0x79b7('0xa')](),controller['create']);router[_0x79b7('0x10')]('/:id',auth[_0x79b7('0xa')](),controller[_0x79b7('0x11')]);router[_0x79b7('0x12')](_0x79b7('0xd'),auth[_0x79b7('0xa')](),controller[_0x79b7('0x13')]);module[_0x79b7('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3756e57..90d8ac7 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 _0xd108=['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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','BOOLEAN','Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName'];(function(_0x4e71df,_0x33c491){var _0x300c14=function(_0x426530){while(--_0x426530){_0x4e71df['push'](_0x4e71df['shift']());}};_0x300c14(++_0x33c491);}(_0xd108,0x71));var _0x8d10=function(_0x2f48e9,_0x1bd1b4){_0x2f48e9=_0x2f48e9-0x0;var _0x34d5bb=_0xd108[_0x2f48e9];return _0x34d5bb;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8d10('0x0')]={'name':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'unique':_0x8d10('0x2')},'description':{'type':Sequelize[_0x8d10('0x1')]},'mapKey':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x3')},'key':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x4')},'customerAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'defaultValue':_0x8d10('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8d10('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8d10('0x6')](_0x8d10('0x7'),_0x8d10('0x8')),'defaultValue':_0x8d10('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x9')},'start_chat_button':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0xb')},'header_offline':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8d10('0xf')]},'closingQuestion':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x13')},'closingMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x14')},'conditionAgreement':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x16')},'ratingType':{'type':Sequelize[_0x8d10('0x6')](_0x8d10('0x17'),_0x8d10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return JSON[_0x8d10('0x19')]({'items':[{'type':_0x8d10('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x8d10('0x1b'),'required':!![]},'props':{'title':_0x8d10('0x1c'),'helpText':''}},{'type':_0x8d10('0x1a'),'props':{'title':_0x8d10('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x8d10('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8d10('0x1d')](_0x8d10('0x1e'))?JSON[_0x8d10('0x1f')](this[_0x8d10('0x1d')](_0x8d10('0x1e'))):{};},'set':function(_0x49c188){return this[_0x8d10('0x20')]('onlineForm',JSON[_0x8d10('0x19')](_0x49c188));}},'offlineForm':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return JSON[_0x8d10('0x19')]({'items':[{'type':_0x8d10('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8d10('0x3'),'type':_0x8d10('0x3')},'variable':null},{'type':_0x8d10('0x21'),'config':{'placeholder':_0x8d10('0x22')},'props':{'title':_0x8d10('0x22'),'helpText':_0x8d10('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x8d10('0x1f')](this[_0x8d10('0x1d')](_0x8d10('0x24'))):{};},'set':function(_0x431bdf){return this['setDataValue'](_0x8d10('0x24'),JSON['stringify'](_0x431bdf));}},'token':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8d10('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8d10('0x1')]},'waitingTitle':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x25')},'waitingMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x27')},'offlineMessageBody':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x28')},'skipUnmanaged':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8d10('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return _0x8d10('0x29');}},'notificationSound':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8d10('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2b')},'verticalAlignment':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x8d10('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'defaultValue':_0x8d10('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d10('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x8d10('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d10('0xd')],'comment':_0x8d10('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![],'comment':_0x8d10('0x2f'),'set':function(_0x377f9f){if(!_0x377f9f)this[_0x8d10('0x20')](_0x8d10('0x30'),null);this[_0x8d10('0x20')](_0x8d10('0x31'),_0x377f9f);}},'vidaooEscalation':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8d10('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':function(){return _0x8d10('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7e00=['email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','text','getDataValue','onlineForm','setDataValue','stringify','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','alternate','#fafafa','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}}','sequelize','exports','STRING','address'];(function(_0x4c1a92,_0x54a78c){var _0x134a0c=function(_0x4615a0){while(--_0x4615a0){_0x4c1a92['push'](_0x4c1a92['shift']());}};_0x134a0c(++_0x54a78c);}(_0x7e00,0x15a));var _0x07e0=function(_0x24bfae,_0x45af14){_0x24bfae=_0x24bfae-0x0;var _0x56d23a=_0x7e00[_0x24bfae];return _0x56d23a;};'use strict';var Sequelize=require(_0x07e0('0x0'));var rs=require('randomstring');module[_0x07e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![],'unique':_0x07e0('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x07e0('0x4')},'key':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x07e0('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![],'defaultValue':_0x07e0('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x07e0('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x07e0('0x2')]},'animation':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x07e0('0x9')](_0x07e0('0xa'),_0x07e0('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xc')},'offline_chat_button':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xd')},'header_offline':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xe')},'download_transcript':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x07e0('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x07e0('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x07e0('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x07e0('0x13')},'closingMessage':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x14')},'closingMessageButton':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xd')},'skipMessageButton':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x16')},'ratingType':{'type':Sequelize[_0x07e0('0x9')](_0x07e0('0x17'),_0x07e0('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x07e0('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x07e0('0x19'),'type':_0x07e0('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x07e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x07e0('0x4'),'type':_0x07e0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x07e0('0x1b')]('onlineForm')?JSON['parse'](this[_0x07e0('0x1b')](_0x07e0('0x1c'))):{};},'set':function(_0x33aaae){return this[_0x07e0('0x1d')](_0x07e0('0x1c'),JSON[_0x07e0('0x1e')](_0x33aaae));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x07e0('0x1f'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x07e0('0x4'),'type':_0x07e0('0x4')},'variable':null},{'type':_0x07e0('0x20'),'config':{'placeholder':_0x07e0('0x21')},'props':{'title':_0x07e0('0x21'),'helpText':_0x07e0('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x07e0('0x1b')](_0x07e0('0x23'))?JSON[_0x07e0('0x24')](this[_0x07e0('0x1b')]('offlineForm')):{};},'set':function(_0x3584cf){return this['setDataValue'](_0x07e0('0x23'),JSON[_0x07e0('0x1e')](_0x3584cf));}},'token':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':function(){return rs[_0x07e0('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x07e0('0x2')]},'forwardOffline':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x07e0('0x2')]},'notificationTemplate':{'type':Sequelize[_0x07e0('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x07e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':_0x07e0('0x29')},'verticalAlignment':{'type':Sequelize[_0x07e0('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x07e0('0x2a')},'defaultTitle':{'type':Sequelize[_0x07e0('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x07e0('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![],'defaultValue':_0x07e0('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x07e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x07e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x07e0('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![],'comment':_0x07e0('0x2d'),'set':function(_0x5bb7a2){if(!_0x5bb7a2)this[_0x07e0('0x1d')](_0x07e0('0x2e'),null);this[_0x07e0('0x1d')](_0x07e0('0x2f'),_0x5bb7a2);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x07e0('0x2')]},'vidaooTopic':{'type':Sequelize[_0x07e0('0x2')],'allowNull':![],'defaultValue':_0x07e0('0x30')},'vidaooNote':{'type':Sequelize[_0x07e0('0x2')],'defaultValue':function(){return _0x07e0('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x07e0('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x07e0('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x07e0('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 593f11e..302392b 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 _0x5bc7=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','interaction','ChatInteraction','spread','messageId','created','unmanaged','*,*,*,*','ChatMessage','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','push','all','some','remote','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','sequelize','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','order','sort','options','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','server/files/images/logos/','root','download','getAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x5bc7,0x95));var _0x75bc=function(_0x3cc5fd,_0x569445){_0x3cc5fd=_0x3cc5fd-0x0;var _0x31c92e=_0x5bc7[_0x3cc5fd];return _0x31c92e;};'use strict';var emlformat=require(_0x75bc('0x0'));var rimraf=require(_0x75bc('0x1'));var zipdir=require(_0x75bc('0x2'));var jsonpatch=require(_0x75bc('0x3'));var rp=require('request-promise');var moment=require(_0x75bc('0x4'));var BPromise=require(_0x75bc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x75bc('0x6'));var sox=require(_0x75bc('0x7'));var csv=require(_0x75bc('0x8'));var ejs=require(_0x75bc('0x9'));var fs=require('fs');var fs_extra=require(_0x75bc('0xa'));var _=require(_0x75bc('0xb'));var squel=require(_0x75bc('0xc'));var crypto=require(_0x75bc('0xd'));var jsforce=require(_0x75bc('0xe'));var deskjs=require(_0x75bc('0xf'));var toCsv=require(_0x75bc('0x8'));var querystring=require('querystring');var Papa=require(_0x75bc('0x10'));var Redis=require('ioredis');var authService=require(_0x75bc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x75bc('0x12'))(_0x75bc('0x13'));var utils=require(_0x75bc('0x14'));var config=require(_0x75bc('0x15'));var licenseUtil=require(_0x75bc('0x16'));var db=require(_0x75bc('0x17'))['db'];config['redis']=_[_0x75bc('0x18')](config[_0x75bc('0x19')],{'host':_0x75bc('0x1a'),'port':0x18eb});var socket=require(_0x75bc('0x1b'))(new Redis(config[_0x75bc('0x19')]));require(_0x75bc('0x1c'))[_0x75bc('0x1d')](socket);var jayson=require(_0x75bc('0x1e'));var client=jayson[_0x75bc('0x1f')][_0x75bc('0x20')]({'port':0x232c});var client9002=jayson[_0x75bc('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x75bc('0x1f')][_0x75bc('0x20')]({'port':0x232b});var client9001=jayson[_0x75bc('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4dbbcf,_0xe14dea,_0x1f1afd,_0x1e4391){return new BPromise(function(_0x3e9e5e,_0x4a6e7a){var _0x3dfe28=_0x1e4391||client;return _0x3dfe28[_0x75bc('0x21')](_0x4dbbcf,_0x1f1afd)['then'](function(_0x49a2e0){logger[_0x75bc('0x22')](_0x75bc('0x23'),_0xe14dea,_0x75bc('0x24'));logger[_0x75bc('0x25')](_0x75bc('0x26'),_0xe14dea,'request\x20sent',JSON[_0x75bc('0x27')](_0x49a2e0));if(_0x49a2e0[_0x75bc('0x28')]){if(_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x29')]===0x1f4){logger[_0x75bc('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe14dea,_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);return _0x4a6e7a(_0x49a2e0[_0x75bc('0x28')]['message']);}logger['error'](_0x75bc('0x23'),_0xe14dea,_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);return _0x3e9e5e(_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);}else{logger[_0x75bc('0x22')](_0x75bc('0x23'),_0xe14dea,_0x75bc('0x24'));_0x3e9e5e(_0x49a2e0[_0x75bc('0x2b')][_0x75bc('0x2a')]);}})[_0x75bc('0x2c')](function(_0x25fba2){logger['error'](_0x75bc('0x23'),_0xe14dea,_0x25fba2);_0x4a6e7a(_0x25fba2);});});}function respondWithStatusCode(_0x57474e,_0x2e9470){_0x2e9470=_0x2e9470||0xcc;return function(_0x1ba9d5){if(_0x1ba9d5){return _0x57474e[_0x75bc('0x2d')](_0x2e9470);}return _0x57474e[_0x75bc('0x2e')](_0x2e9470)['end']();};}function respondWithResult(_0x4b8987,_0x4deecd){_0x4deecd=_0x4deecd||0xc8;return function(_0x2dc23a){if(_0x2dc23a){return _0x4b8987[_0x75bc('0x2e')](_0x4deecd)[_0x75bc('0x2f')](_0x2dc23a);}};}function respondWithFilteredResult(_0x523ab7,_0x246e97){return function(_0x2d1ef7){if(_0x2d1ef7){var _0x3f2cf4=typeof _0x246e97['offset']===_0x75bc('0x30')&&typeof _0x246e97[_0x75bc('0x31')]===_0x75bc('0x30');var _0x48eeed=_0x2d1ef7[_0x75bc('0x32')];var _0x7bc4a5=_0x3f2cf4?0x0:_0x246e97[_0x75bc('0x33')];var _0x49e885=_0x3f2cf4?_0x2d1ef7[_0x75bc('0x32')]:_0x246e97['offset']+_0x246e97[_0x75bc('0x31')];var _0x575a70;if(_0x49e885>=_0x48eeed){_0x49e885=_0x48eeed;_0x575a70=0xc8;}else{_0x575a70=0xce;}_0x523ab7[_0x75bc('0x2e')](_0x575a70);return _0x523ab7[_0x75bc('0x34')](_0x75bc('0x35'),_0x7bc4a5+'-'+_0x49e885+'/'+_0x48eeed)[_0x75bc('0x2f')](_0x2d1ef7);}return null;};}function patchUpdates(_0x438508){return function(_0x1bae9e){try{jsonpatch[_0x75bc('0x36')](_0x1bae9e,_0x438508,!![]);}catch(_0x16c14d){return BPromise[_0x75bc('0x37')](_0x16c14d);}return _0x1bae9e[_0x75bc('0x38')]();};}function saveUpdates(_0xdc5878,_0x57b06e){return function(_0x495e85){if(_0x495e85){return _0x495e85[_0x75bc('0x39')](_0xdc5878)[_0x75bc('0x3a')](function(_0x1f9825){return _0x1f9825;});}return null;};}function removeEntity(_0x4fe482,_0x56d63d){return function(_0x1c1f15){if(_0x1c1f15){return _0x1c1f15[_0x75bc('0x3b')]()[_0x75bc('0x3a')](function(){var _0x3531d8=_0x1c1f15[_0x75bc('0x3c')]({'plain':!![]});var _0x7ed08f=_0x75bc('0x3d');return db[_0x75bc('0x3e')][_0x75bc('0x3b')]({'where':{'type':_0x7ed08f,'resourceId':_0x3531d8['id']}})[_0x75bc('0x3a')](function(){return _0x1c1f15;});})[_0x75bc('0x3a')](function(){_0x4fe482[_0x75bc('0x2e')](0xcc)[_0x75bc('0x3f')]();});}};}function handleEntityNotFound(_0x195c93,_0x2e3433){return function(_0x396a3c){if(!_0x396a3c){_0x195c93[_0x75bc('0x2d')](0x194);}return _0x396a3c;};}function handleError(_0x32354c,_0x385a34){_0x385a34=_0x385a34||0x1f4;return function(_0x25700a){logger[_0x75bc('0x28')](_0x25700a[_0x75bc('0x40')]);if(_0x25700a['name']){delete _0x25700a[_0x75bc('0x41')];}_0x32354c[_0x75bc('0x2e')](_0x385a34)[_0x75bc('0x42')](_0x25700a);};}exports[_0x75bc('0x43')]=function(_0x1e2449,_0x5a6acf){var _0xa2f0fd={'include':[{'model':db[_0x75bc('0x44')],'as':'mandatoryDispositionPause'}]},_0x23260b={},_0x27f22d={'count':0x0,'rows':[]};var _0x4df58c=_[_0x75bc('0x45')](db[_0x75bc('0x46')][_0x75bc('0x47')],function(_0xfcf3a7){return{'name':_0xfcf3a7[_0x75bc('0x48')],'type':_0xfcf3a7[_0x75bc('0x49')][_0x75bc('0x4a')]};});_0x23260b[_0x75bc('0x4b')]=_[_0x75bc('0x45')](_0x4df58c,'name');_0x23260b[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x1e2449['query']);_0x23260b['filters']=_[_0x75bc('0x4e')](_0x23260b[_0x75bc('0x4b')],_0x23260b['query']);_0xa2f0fd[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x23260b[_0x75bc('0x4b')],qs['fields'](_0x1e2449['query']['fields']));_0xa2f0fd['attributes']=_0xa2f0fd[_0x75bc('0x4f')][_0x75bc('0x50')]?_0xa2f0fd[_0x75bc('0x4f')]:_0x23260b['model'];if(!_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x51')](_0x75bc('0x52'))){_0xa2f0fd[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x31')]);_0xa2f0fd[_0x75bc('0x33')]=qs['offset'](_0x1e2449[_0x75bc('0x4c')]['offset']);}_0xa2f0fd['order']=qs['sort'](_0x1e2449[_0x75bc('0x4c')]['sort']);_0xa2f0fd[_0x75bc('0x53')]=qs['filters'](_[_0x75bc('0x54')](_0x1e2449[_0x75bc('0x4c')],_0x23260b[_0x75bc('0x55')]),_0x4df58c);if(_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x56')]){_0xa2f0fd['where']=_[_0x75bc('0x57')](_0xa2f0fd[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x4df58c,function(_0x588aae){if(_0x588aae[_0x75bc('0x49')]!=='VIRTUAL'){var _0x505402={};_0x505402[_0x588aae[_0x75bc('0x41')]]={'$like':'%'+_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x505402;}})});}_0xa2f0fd=_[_0x75bc('0x57')]({},_0xa2f0fd,_0x1e2449['options']);var _0x56da52={'where':_0xa2f0fd['where']};return db[_0x75bc('0x46')]['count'](_0x56da52)['then'](function(_0x2c15e7){_0x27f22d[_0x75bc('0x32')]=_0x2c15e7;if(_0x1e2449['query'][_0x75bc('0x58')]){_0xa2f0fd[_0x75bc('0x59')]=[{'all':!![]}];}return db[_0x75bc('0x46')][_0x75bc('0x5a')](_0xa2f0fd);})[_0x75bc('0x3a')](function(_0x5a69d2){_0x27f22d[_0x75bc('0x5b')]=_0x5a69d2;return _0x27f22d;})[_0x75bc('0x3a')](respondWithFilteredResult(_0x5a6acf,_0xa2f0fd))[_0x75bc('0x2c')](handleError(_0x5a6acf,null));};exports[_0x75bc('0x5c')]=function(_0x468954,_0x152ba3){var _0x5169b0={'raw':![],'where':{'id':_0x468954[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0x44')],'as':_0x75bc('0x5e')}]},_0x205d62={};_0x205d62[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0x46')]['rawAttributes']);_0x205d62[_0x75bc('0x4c')]=_['keys'](_0x468954[_0x75bc('0x4c')]);_0x205d62[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x205d62[_0x75bc('0x4b')],_0x205d62[_0x75bc('0x4c')]);_0x5169b0[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x205d62['model'],qs['fields'](_0x468954[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x5169b0[_0x75bc('0x4f')]=_0x5169b0[_0x75bc('0x4f')]['length']?_0x5169b0[_0x75bc('0x4f')]:_0x205d62[_0x75bc('0x4b')];if(_0x468954['query']['includeAll']){_0x5169b0['include']=[{'all':!![]}];}_0x5169b0=_[_0x75bc('0x57')]({},_0x5169b0,_0x468954['options']);return db['ChatWebsite']['find'](_0x5169b0)[_0x75bc('0x3a')](handleEntityNotFound(_0x152ba3,null))[_0x75bc('0x3a')](respondWithResult(_0x152ba3,null))['catch'](handleError(_0x152ba3,null));};exports[_0x75bc('0x60')]=function(_0x49332a,_0x41731a){return db['ChatWebsite'][_0x75bc('0x60')](_0x49332a[_0x75bc('0x61')],{})['then'](function(_0x424964){var _0x11ee50=_0x49332a[_0x75bc('0x62')][_0x75bc('0x3c')]({'plain':!![]});if(!_0x11ee50)throw new Error(_0x75bc('0x63'));if(_0x11ee50[_0x75bc('0x64')]==='user'){var _0x59b701=_0x424964[_0x75bc('0x3c')]({'plain':!![]});var _0x136b5e=_0x75bc('0x3d');return db[_0x75bc('0x65')]['find']({'where':{'name':_0x136b5e,'userProfileId':_0x11ee50[_0x75bc('0x66')]},'raw':!![]})['then'](function(_0x4395a2){if(_0x4395a2&&_0x4395a2['autoAssociation']===0x0){return db[_0x75bc('0x3e')][_0x75bc('0x60')]({'name':_0x59b701[_0x75bc('0x41')],'resourceId':_0x59b701['id'],'type':_0x4395a2[_0x75bc('0x41')],'sectionId':_0x4395a2['id']},{})[_0x75bc('0x3a')](function(){return _0x424964;});}else{return _0x424964;}})[_0x75bc('0x2c')](function(_0x592dce){logger[_0x75bc('0x28')](_0x75bc('0x67'),_0x592dce);throw _0x592dce;});}return _0x424964;})[_0x75bc('0x3a')](respondWithResult(_0x41731a,0xc9))[_0x75bc('0x2c')](handleError(_0x41731a,null));};exports[_0x75bc('0x39')]=function(_0x32ddba,_0x2ed005){if(_0x32ddba[_0x75bc('0x61')]['id']){delete _0x32ddba[_0x75bc('0x61')]['id'];}return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x32ddba[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0x44')],'as':_0x75bc('0x5e')}]})['then'](handleEntityNotFound(_0x2ed005,null))['then'](saveUpdates(_0x32ddba[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x2ed005,null))['catch'](handleError(_0x2ed005,null));};exports[_0x75bc('0x3b')]=function(_0xf2db6f,_0x46ecd4){return db['ChatWebsite']['find']({'where':{'id':_0xf2db6f[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x46ecd4,null))['then'](removeEntity(_0x46ecd4,null))[_0x75bc('0x2c')](handleError(_0x46ecd4,null));};exports['describe']=function(_0x15c6e6,_0x506c82){return db['ChatWebsite'][_0x75bc('0x69')]()['then'](respondWithResult(_0x506c82,null))['catch'](handleError(_0x506c82,null));};exports[_0x75bc('0x6a')]=function(_0x35cd74,_0x43846b,_0x51b401){if(_0x35cd74[_0x75bc('0x61')]['id']){delete _0x35cd74[_0x75bc('0x61')]['id'];}return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x35cd74[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x43846b,null))[_0x75bc('0x3a')](function(_0x16fd3f){if(_0x16fd3f){_0x35cd74[_0x75bc('0x61')][_0x75bc('0x6b')]=_0x16fd3f['id'];return db['Disposition'][_0x75bc('0x60')](_0x35cd74['body']);}})[_0x75bc('0x3a')](respondWithResult(_0x43846b,null))[_0x75bc('0x2c')](handleError(_0x43846b,null));};exports[_0x75bc('0x6c')]=function(_0x33e44f,_0x5046a6,_0x380317){var _0x25815d={'raw':![],'where':{}};var _0x3564c6={};var _0x43abee={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x33e44f[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x5046a6,null))['then'](function(_0x236af0){if(_0x236af0){_0x3564c6[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0x6e')][_0x75bc('0x47')]);_0x3564c6[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x33e44f['query']);_0x3564c6['filters']=_[_0x75bc('0x4e')](_0x3564c6[_0x75bc('0x4b')],_0x3564c6[_0x75bc('0x4c')]);_0x25815d[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x3564c6['model'],qs['fields'](_0x33e44f['query'][_0x75bc('0x5f')]));_0x25815d[_0x75bc('0x4f')]=_0x25815d[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x25815d[_0x75bc('0x4f')]:_0x3564c6[_0x75bc('0x4b')];if(!_0x33e44f[_0x75bc('0x4c')]['hasOwnProperty'](_0x75bc('0x52'))){_0x25815d[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x25815d['offset']=qs[_0x75bc('0x33')](_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x25815d[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x33e44f['query'][_0x75bc('0x70')]);_0x25815d['where']=qs['filters'](_['pick'](_0x33e44f[_0x75bc('0x4c')],_0x3564c6[_0x75bc('0x55')]));_0x25815d[_0x75bc('0x53')][_0x75bc('0x6b')]=_0x236af0['id'];if(_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x25815d[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x25815d[_0x75bc('0x53')],{'$or':_['map'](_0x25815d[_0x75bc('0x4f')],function(_0x487df5){var _0xbd7259={};_0xbd7259[_0x487df5]={'$like':'%'+_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0xbd7259;})});}_0x25815d=_[_0x75bc('0x57')]({},_0x25815d,_0x33e44f[_0x75bc('0x71')]);return db[_0x75bc('0x6e')][_0x75bc('0x32')]({'where':_0x25815d[_0x75bc('0x53')]})['then'](function(_0x5788da){_0x43abee[_0x75bc('0x32')]=_0x5788da;if(_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x25815d[_0x75bc('0x59')]=[{'all':!![]}];}return db[_0x75bc('0x6e')][_0x75bc('0x5a')](_0x25815d);})[_0x75bc('0x3a')](function(_0x1f2844){_0x43abee[_0x75bc('0x5b')]=_0x1f2844;return _0x43abee;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x5046a6,_0x25815d))['catch'](handleError(_0x5046a6,null));};exports[_0x75bc('0x72')]=function(_0x2831b,_0x5461a5,_0x128e69){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x2831b[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x5461a5,null))[_0x75bc('0x3a')](function(_0x89e881){if(_0x89e881){return _0x89e881[_0x75bc('0x72')](_0x2831b[_0x75bc('0x4c')]['ids']);}})[_0x75bc('0x3a')](respondWithStatusCode(_0x5461a5,null))[_0x75bc('0x2c')](handleError(_0x5461a5,null));};exports[_0x75bc('0x73')]=function(_0x65c0a0,_0x440473,_0xe681fc){if(_0x65c0a0[_0x75bc('0x61')]['id']){delete _0x65c0a0['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x65c0a0[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x440473,null))[_0x75bc('0x3a')](function(_0x1efda4){if(_0x1efda4){_0x65c0a0[_0x75bc('0x61')][_0x75bc('0x6b')]=_0x1efda4['id'];return db['CannedAnswer'][_0x75bc('0x60')](_0x65c0a0[_0x75bc('0x61')]);}})[_0x75bc('0x3a')](respondWithResult(_0x440473,null))[_0x75bc('0x2c')](handleError(_0x440473,null));};exports['getAnswers']=function(_0x2c35b6,_0x581d4d,_0x5ac697){var _0x567452={'raw':![],'where':{}};var _0x45545b={};var _0x30135b={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x2c35b6['params']['id']}})['then'](handleEntityNotFound(_0x581d4d,null))[_0x75bc('0x3a')](function(_0xd7cc8d){if(_0xd7cc8d){_0x45545b[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db['CannedAnswer'][_0x75bc('0x47')]);_0x45545b[_0x75bc('0x4c')]=_['keys'](_0x2c35b6['query']);_0x45545b[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x45545b[_0x75bc('0x4b')],_0x45545b['query']);_0x567452[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x45545b[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x567452['attributes']=_0x567452[_0x75bc('0x4f')]['length']?_0x567452[_0x75bc('0x4f')]:_0x45545b['model'];if(!_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x51')](_0x75bc('0x52'))){_0x567452['limit']=qs[_0x75bc('0x31')](_0x2c35b6[_0x75bc('0x4c')]['limit']);_0x567452[_0x75bc('0x33')]=qs['offset'](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x567452[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x567452[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0x2c35b6[_0x75bc('0x4c')],_0x45545b[_0x75bc('0x55')]));_0x567452['where'][_0x75bc('0x6b')]=_0xd7cc8d['id'];if(_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x567452[_0x75bc('0x53')]=_['merge'](_0x567452[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x567452[_0x75bc('0x4f')],function(_0xfc1108){var _0x4f2de5={};_0x4f2de5[_0xfc1108]={'$like':'%'+_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x4f2de5;})});}_0x567452=_[_0x75bc('0x57')]({},_0x567452,_0x2c35b6['options']);return db[_0x75bc('0x74')][_0x75bc('0x32')]({'where':_0x567452[_0x75bc('0x53')]})['then'](function(_0x3732e1){_0x30135b[_0x75bc('0x32')]=_0x3732e1;if(_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x567452[_0x75bc('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x75bc('0x5a')](_0x567452);})[_0x75bc('0x3a')](function(_0x2e1f74){_0x30135b[_0x75bc('0x5b')]=_0x2e1f74;return _0x30135b;});}})['then'](respondWithFilteredResult(_0x581d4d,_0x567452))[_0x75bc('0x2c')](handleError(_0x581d4d,null));};exports[_0x75bc('0x75')]=function(_0x5c2bf1,_0x18cff0,_0x531548){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x5c2bf1['params']['id']}})['then'](handleEntityNotFound(_0x18cff0,null))[_0x75bc('0x3a')](function(_0x3c2e4a){if(_0x3c2e4a){return _0x3c2e4a[_0x75bc('0x75')](_0x5c2bf1['query'][_0x75bc('0x76')]);}})[_0x75bc('0x3a')](respondWithStatusCode(_0x18cff0,null))[_0x75bc('0x2c')](handleError(_0x18cff0,null));};exports['addLogo']=function(_0x2aed68,_0x3b2488,_0x1a8fe3){_0x2aed68[_0x75bc('0x61')]['sitepic']=_0x2aed68[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x2aed68[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3b2488,null))[_0x75bc('0x3a')](saveUpdates(_0x2aed68[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x3b2488,null))[_0x75bc('0x2c')](handleError(_0x3b2488,null));};exports[_0x75bc('0x79')]=function(_0x4b2927,_0x56b174,_0x564424){_0x4b2927['body'][_0x75bc('0x7a')]=_0x4b2927[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x4b2927['params']['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x56b174,null))[_0x75bc('0x3a')](saveUpdates(_0x4b2927[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x56b174,null))[_0x75bc('0x2c')](handleError(_0x56b174,null));};exports[_0x75bc('0x7b')]=function(_0x574d8e,_0x38fa0c,_0x5dd5fa){_0x574d8e[_0x75bc('0x61')][_0x75bc('0x7c')]=_0x574d8e[_0x75bc('0x77')]['filename'];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x574d8e['params']['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x38fa0c,null))[_0x75bc('0x3a')](saveUpdates(_0x574d8e[_0x75bc('0x61')],null))['then'](respondWithResult(_0x38fa0c,null))[_0x75bc('0x2c')](handleError(_0x38fa0c,null));};exports[_0x75bc('0x7d')]=function(_0x39e626,_0x3cbd96,_0x213101){_0x39e626['body'][_0x75bc('0x7e')]=_0x39e626[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')]['find']({'where':{'id':_0x39e626[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3cbd96,null))[_0x75bc('0x3a')](saveUpdates(_0x39e626[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x3cbd96,null))[_0x75bc('0x2c')](handleError(_0x3cbd96,null));};exports[_0x75bc('0x7f')]=function(_0x23932c,_0x5ef05a,_0x59b2d6){var _0x354f2e=path[_0x75bc('0x80')](config['root'],_0x75bc('0x81'));var _0x273652={'where':{'id':_0x23932c[_0x75bc('0x5d')]['id']},'attributes':['id',_0x75bc('0x82')],'raw':!![]};var _0x14db7c=![];return require(_0x75bc('0x16'))[_0x75bc('0x83')]()[_0x75bc('0x3a')](function(_0xe1fc91){if(_0xe1fc91){_0x14db7c=_0xe1fc91['custom'];}})[_0x75bc('0x3a')](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')](_0x273652);})[_0x75bc('0x3a')](handleEntityNotFound(_0x5ef05a,null))[_0x75bc('0x3a')](function(_0x2e3b84){if(_0x2e3b84){if(!_[_0x75bc('0x84')](_0x2e3b84[_0x75bc('0x82')])){if(fs['existsSync'](path[_0x75bc('0x80')](config['root'],_0x75bc('0x85'),_0x2e3b84['sitepic']))&&_0x14db7c){_0x354f2e=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x85'),_0x2e3b84[_0x75bc('0x82')]);}}return _0x5ef05a[_0x75bc('0x87')](_0x354f2e);}})[_0x75bc('0x2c')](handleError(_0x5ef05a,null));};exports[_0x75bc('0x88')]=function(_0x2c6fea,_0x193fa8,_0x133b7f){var _0x3b519b=path[_0x75bc('0x80')](config[_0x75bc('0x86')],'server/files/images/avatars/default_avatar.png');var _0xa55ab5={'where':{'id':_0x2c6fea[_0x75bc('0x5d')]['id']},'attributes':['id',_0x75bc('0x7a')],'raw':!![]};return db[_0x75bc('0x46')][_0x75bc('0x68')](_0xa55ab5)['then'](handleEntityNotFound(_0x193fa8,null))['then'](function(_0x173d89){if(_0x173d89){if(!_[_0x75bc('0x84')](_0x173d89[_0x75bc('0x7a')])){if(fs['existsSync'](path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x173d89['agentAvatar']))){_0x3b519b=path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x173d89[_0x75bc('0x7a')]);}}return _0x193fa8[_0x75bc('0x87')](_0x3b519b);}})['catch'](handleError(_0x193fa8,null));};exports['getCustomerAvatar']=function(_0xb51e6c,_0x250722,_0x514bec){var _0x53c269=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x8a'));var _0x5cb0f0={'where':{'id':_0xb51e6c['params']['id']},'attributes':['id','customerAvatar',_0x75bc('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x75bc('0x68')](_0x5cb0f0)[_0x75bc('0x3a')](handleEntityNotFound(_0x250722,null))[_0x75bc('0x3a')](function(_0x182b3f){if(_0x182b3f){if(!_[_0x75bc('0x84')](_0x182b3f[_0x75bc('0x7c')])){if(fs[_0x75bc('0x8c')](path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x89'),_0x182b3f[_0x75bc('0x7c')]))&&_0x182b3f[_0x75bc('0x8b')]){_0x53c269=path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x182b3f[_0x75bc('0x7c')]);}}return _0x250722[_0x75bc('0x87')](_0x53c269);}})[_0x75bc('0x2c')](handleError(_0x250722,null));};exports['getSystemAvatar']=function(_0x3a05d9,_0x55e8f8,_0x212f7a){var _0x2f0fd4=path[_0x75bc('0x80')](config[_0x75bc('0x86')],'server/files/images/avatars/system_avatar.png');var _0x544041={'where':{'id':_0x3a05d9['params']['id']},'attributes':['id',_0x75bc('0x7e')],'raw':!![]};return db[_0x75bc('0x46')][_0x75bc('0x68')](_0x544041)['then'](handleEntityNotFound(_0x55e8f8,null))[_0x75bc('0x3a')](function(_0x4a3275){if(_0x4a3275){if(!_[_0x75bc('0x84')](_0x4a3275[_0x75bc('0x7e')])){if(fs[_0x75bc('0x8c')](path['join'](config['root'],_0x75bc('0x89'),_0x4a3275[_0x75bc('0x7e')]))){_0x2f0fd4=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x89'),_0x4a3275['systemAvatar']);}}return _0x55e8f8[_0x75bc('0x87')](_0x2f0fd4);}})[_0x75bc('0x2c')](handleError(_0x55e8f8,null));};exports['notify']=function(_0x11ae6b,_0x3e7e9f,_0x4e5c1b){var _0x15d737=require(_0x75bc('0x8d'));var _0x9e1c9b=new _0x15d737();var _0x55a58e=_0x9e1c9b[_0x75bc('0x8e')](_0x11ae6b[_0x75bc('0x8f')]['user-agent'])[_0x75bc('0x90')]();var _0x58ce32={'body':_0x11ae6b[_0x75bc('0x61')],'channel':'chat'};var _0x55c409=[];var _0x2db6a8=[];var _0x23bfee={};var _0x813b96=![];return db[_0x75bc('0x91')][_0x75bc('0x69')]()[_0x75bc('0x3a')](function(_0x4c8a06){if(!_0x4c8a06){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x94'));}_0x55c409=_[_0x75bc('0x95')](_[_0x75bc('0x4d')](_0x4c8a06),['createdAt',_0x75bc('0x96')]);_0x2db6a8=_[_0x75bc('0x95')](_['keys'](_0x4c8a06),[_0x75bc('0x97'),_0x75bc('0x96'),_0x75bc('0x98'),_0x75bc('0x99')]);if(_0x11ae6b['body']['id']){delete _0x11ae6b[_0x75bc('0x61')]['id'];}if(_['isNil'](_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')])){throw new db['Sequelize'][(_0x75bc('0x93'))](_0x75bc('0x9b'));}if(_['isNil'](_0x11ae6b['body'][_0x75bc('0x61')])||_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x61')]===''){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9c'));}if(_[_0x75bc('0x84')](_0x11ae6b['body'][_0x75bc('0x9d')])){throw new db['Sequelize'][(_0x75bc('0x93'))](_0x75bc('0x9e')+_0x2db6a8);}if(!_[_0x75bc('0x9f')](_0x2db6a8,_0x11ae6b['body'][_0x75bc('0x9d')])){throw new db[(_0x75bc('0x92'))]['ValidationError'](_0x75bc('0xa0')+_0x2db6a8);}_0x23bfee[_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9d')]]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')];})[_0x75bc('0x3a')](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x11ae6b['params']['id']},'include':[{'model':db[_0x75bc('0xa1')],'as':_0x75bc('0xa2'),'include':[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xa3'),'where':_0x23bfee,'limit':0x1,'order':[[_0x75bc('0x96'),'DESC']]}]},{'model':db[_0x75bc('0xa4')],'as':_0x75bc('0xa5')}]});})[_0x75bc('0x3a')](handleEntityNotFound(_0x3e7e9f,null))[_0x75bc('0x3a')](function(_0x2c5176){if(_0x2c5176&&_0x2c5176[_0x75bc('0xa2')]){_0x58ce32[_0x75bc('0xa6')]=_0x2c5176;_0x58ce32[_0x75bc('0xa7')]=_0x2c5176['Applications'];_0x58ce32[_0x75bc('0xa8')]=_0x2c5176[_0x75bc('0xa2')];_0x58ce32[_0x75bc('0xa7')]=_[_0x75bc('0xa9')](_0x58ce32[_0x75bc('0xa7')],[_0x75bc('0xaa')],[_0x75bc('0xab')]);if(_0x58ce32['account']['Applications']){delete _0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa5')];}if(_0x58ce32['account'][_0x75bc('0xa2')]&&_0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa2')][_0x75bc('0xa3')]['length']){return _0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa2')]['Contacts'][0x0];}var _0x4f56bb=_[_0x75bc('0x18')](_0x11ae6b['body'],{'firstName':_0x11ae6b[_0x75bc('0x61')]['from'],'ListId':_0x2c5176[_0x75bc('0x99')]});_0x4f56bb[_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9d')]]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')];return db[_0x75bc('0x91')][_0x75bc('0x60')](_0x4f56bb,{'fields':_0x55c409,'raw':!![]});}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3e7e9f,null))['then'](function(_0x1f5c66){_0x58ce32[_0x75bc('0xac')]=_0x1f5c66;var _0x3939f5=_0x11ae6b['body'][_0x75bc('0xad')];if(_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xae')]){_0x3939f5=_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xae')];}else if(_0x11ae6b['headers']['x-forwarded-for']){_0x3939f5=_['first'](_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xaf')][_0x75bc('0xb0')](','));}if(_0x1f5c66){var _0xdd01c5={'ContactId':_0x1f5c66['id'],'ChatWebsiteId':_0x11ae6b['params']['id'],'from':(_0x1f5c66[_0x75bc('0xb1')]||'')+'\x20'+(_0x1f5c66[_0x75bc('0xb2')]||''),'customerIp':_0x3939f5,'customerPort':_0x11ae6b['headers'][_0x75bc('0xb3')]?_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xb3')]:null,'referer':_0x11ae6b['body'][_0x75bc('0xb4')],'browserName':_0x55a58e[_0x75bc('0xb5')]['name']&&_0x55a58e['browser'][_0x75bc('0xb6')]?util[_0x75bc('0xb7')](_0x75bc('0xb8'),_0x55a58e['browser'][_0x75bc('0x41')],_0x55a58e[_0x75bc('0xb5')][_0x75bc('0xb6')]):_0x75bc('0xb9'),'browserVersion':_0x55a58e[_0x75bc('0xb5')][_0x75bc('0xb6')]||'unknown','osName':util[_0x75bc('0xb7')](_0x75bc('0xb8'),_0x55a58e['os'][_0x75bc('0x41')],_0x55a58e['os'][_0x75bc('0xb6')]),'osVersion':_0x55a58e['os'][_0x75bc('0xb6')],'deviceModel':_0x55a58e['device'][_0x75bc('0x4b')]&&_0x55a58e[_0x75bc('0xba')][_0x75bc('0xbb')]?util[_0x75bc('0xb7')]('%s\x20%s\x20%s',_0x55a58e[_0x75bc('0xba')][_0x75bc('0x4b')],_0x55a58e[_0x75bc('0xba')][_0x75bc('0xbb')],_0x55a58e[_0x75bc('0xba')][_0x75bc('0x49')]):null,'deviceVendor':_0x55a58e['device'][_0x75bc('0xbb')],'deviceType':_0x55a58e[_0x75bc('0xba')]['type'],'formData':JSON[_0x75bc('0x27')](_0x11ae6b[_0x75bc('0x61')])};var _0x1d7cb4={'ChatWebsiteId':_0x11ae6b[_0x75bc('0x5d')]['id'],'closed':![]};if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]){_0x1d7cb4[_0x75bc('0xbc')]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')];return db['ChatInteraction'][_0x75bc('0x68')]({'where':_0x1d7cb4})[_0x75bc('0x3a')](function(_0x14c515){if(_0x14c515){return[_0x14c515,![]];}_0xdd01c5[_0x75bc('0xbc')]=_0x11ae6b[_0x75bc('0x61')]['threadId'];_0xdd01c5['externalUrl']=_0x11ae6b['body'][_0x75bc('0xbd')];return db['ChatInteraction'][_0x75bc('0x60')](_0xdd01c5)['then'](function(_0x294e77){return[_0x294e77,!![]];});});}_0x1d7cb4['ContactId']=_0x1f5c66['id'];if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbe')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbe')]['id']){_0x1d7cb4['id']=_0x11ae6b[_0x75bc('0x61')]['interaction']['id'];return db['ChatInteraction'][_0x75bc('0x68')]({'where':_0x1d7cb4})[_0x75bc('0x3a')](function(_0x24638a){if(_0x24638a){return[_0x24638a,![]];}return db[_0x75bc('0xbf')][_0x75bc('0x60')](_0xdd01c5)[_0x75bc('0x3a')](function(_0x3f393f){return[_0x3f393f,!![]];});});}return db[_0x75bc('0xbf')]['create'](_0xdd01c5)['then'](function(_0x1666a0){return[_0x1666a0,!![]];});}})[_0x75bc('0xc0')](function(_0x40ad4d,_0x4926c3){if(_0x40ad4d){_0x813b96=_0x4926c3;if(!_0x4926c3){var _0x3655a3={'from':(_0x58ce32[_0x75bc('0xac')][_0x75bc('0xb1')]||'')+'\x20'+(_0x58ce32['contact']['lastName']||'')};if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xc1')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]!=_0x11ae6b[_0x75bc('0x61')]['messageId']){_0x3655a3[_0x75bc('0xbc')]=_0x11ae6b['body'][_0x75bc('0xc1')];}return _0x40ad4d['update'](_0x3655a3);}else{return _0x40ad4d;}}})['then'](function(_0x703dc2){_0x58ce32[_0x75bc('0xbe')]=_0x703dc2[_0x75bc('0x3c')]({'plain':!![]});_0x58ce32[_0x75bc('0xbe')]['created']=_0x813b96;if(_0x58ce32[_0x75bc('0xbe')][_0x75bc('0xc2')]){if(_0x58ce32[_0x75bc('0xa6')]['autoclose']){_0x58ce32[_0x75bc('0xa7')]['push']({'id':0x0,'priority':_0x58ce32['applications']['length']+0x1,'app':'close','appdata':_0x75bc('0xc3'),'interval':_0x75bc('0xc4')});}}return db[_0x75bc('0xc5')][_0x75bc('0x60')]({'body':_0x11ae6b['body'][_0x75bc('0x61')],'ChatWebsiteId':_0x11ae6b['params']['id'],'ChatInteractionId':_0x703dc2['id'],'direction':'in','ContactId':_0x58ce32[_0x75bc('0xac')]['id'],'AttachmentId':_0x11ae6b[_0x75bc('0x61')]['AttachmentId']});})[_0x75bc('0x3a')](function(_0x44310f){_0x58ce32['message']=_0x44310f;if(_0x58ce32[_0x75bc('0xbe')]['UserId']){return db[_0x75bc('0xc6')][_0x75bc('0x68')]({'attributes':['id',_0x75bc('0x41')],'where':{'id':_0x58ce32[_0x75bc('0xbe')]['UserId']}})[_0x75bc('0x3a')](function(_0x2097e4){if(_0x2097e4){_0x58ce32[_0x75bc('0xa7')][_0x75bc('0xc7')]({'id':0x0,'priority':0x0,'app':_0x75bc('0xc8'),'appdata':_0x2097e4[_0x75bc('0x41')]+','+(_0x58ce32[_0x75bc('0xa6')][_0x75bc('0xc9')]||0xa),'interval':_0x75bc('0xc4')});_0x58ce32[_0x75bc('0xca')]=!![];}return respondWithRpcPromise(_0x75bc('0xcb'),_0x75bc('0xcc'),_0x58ce32);});}return respondWithRpcPromise(_0x75bc('0xcb'),_0x75bc('0xcc'),_0x58ce32);})[_0x75bc('0x3a')](function(_0x158cac){respondWithRpcPromise(_0x75bc('0xcd'),_0x75bc('0xcd'),{'event':_0x75bc('0xce'),'message':_0x158cac},client9002);return _0x158cac;})[_0x75bc('0x3a')](respondWithResult(_0x3e7e9f,null))[_0x75bc('0x2c')](handleError(_0x3e7e9f,null));};exports[_0x75bc('0xcf')]=function(_0x1c8f15,_0x30de25,_0x184bdd){var _0x248f48,_0x4f62d9,_0x331d26;var _0xb1429c=[];var _0x381646=[];var _0x11295e={};var _0x8827ef=_0x1c8f15[_0x75bc('0xd0')]||[];var _0x1e1989=[];var _0x3eec48;return db[_0x75bc('0x91')][_0x75bc('0x69')]()[_0x75bc('0x3a')](function(_0xd89b55){if(!_0xd89b55){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x94'));}_0x381646=_['difference'](_[_0x75bc('0x4d')](_0xd89b55),[_0x75bc('0x97'),_0x75bc('0x96')]);_0xb1429c=_[_0x75bc('0x95')](_[_0x75bc('0x4d')](_0xd89b55),[_0x75bc('0x97'),'updatedAt',_0x75bc('0x98'),_0x75bc('0x99')]);if(_0x1c8f15[_0x75bc('0x61')]['id']){delete _0x1c8f15['body']['id'];}if(_['isNil'](_0x1c8f15['body']['from'])){throw _0x30de25[_0x75bc('0x2e')](0x1f4)['send'](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9b')));}if(_[_0x75bc('0x84')](_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x61')])||_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x61')]===''){throw _0x30de25['status'](0x1f4)[_0x75bc('0x42')](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9c')));}if(_[_0x75bc('0x84')](_0x1c8f15['body'][_0x75bc('0xd1')])){throw _0x30de25[_0x75bc('0x2e')](0x1f4)[_0x75bc('0x42')](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0xd2')+_0xb1429c));}if(!_[_0x75bc('0x9f')](_0xb1429c,_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')])){throw _0x30de25['status'](0x1f4)['send'](new db[(_0x75bc('0x92'))]['ValidationError'](_0x75bc('0xd3')+_0xb1429c));}_0x11295e[_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')]]=_0x1c8f15['body'][_0x75bc('0x9a')];})['then'](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x1c8f15[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0xa1')],'as':'List'},{'model':db[_0x75bc('0xd4')],'as':_0x75bc('0xd4')}]});})[_0x75bc('0x3a')](handleEntityNotFound(_0x30de25,null))[_0x75bc('0x3a')](function(_0xe5d059){if(_0xe5d059&&_0xe5d059[_0x75bc('0xa2')]){_0x4f62d9=_0xe5d059;var _0x1a1da3=_['defaults'](_0x1c8f15['body'],{'firstName':_0x1c8f15[_0x75bc('0x61')]['from'],'phone':_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x9a')],'ListId':_0xe5d059[_0x75bc('0x99')]});_0x1a1da3[_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')]]=_0x1c8f15['body'][_0x75bc('0x9a')];return db[_0x75bc('0x91')][_0x75bc('0xd5')]({'where':_0x11295e,'defaults':_0x1a1da3});}})[_0x75bc('0xc0')](function(_0x201ba1){if(_0x201ba1){_0x331d26=_0x201ba1;var _0x3a4fa7=fs[_0x75bc('0xd6')](path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0xd7')),_0x75bc('0xd8'));var _0x1fd704=ejs['render'](_0x3a4fa7,{'body':_['toPairs'](_0x1c8f15['body'][_0x75bc('0x61')]),'bodyTitle':_0x4f62d9[_0x75bc('0xd9')]});return db[_0x75bc('0xda')][_0x75bc('0x60')]({'body':_0x1fd704,'ContactId':_0x201ba1['id'],'ChatWebsiteId':_0x4f62d9['id']});}})[_0x75bc('0x3a')](function(_0x4282f0){_0x3eec48=_0x4282f0;if(_0x8827ef[_0x75bc('0x50')]){var _0x273c51=_0x8827ef[_0x75bc('0x45')](function(_0x4749b0){return{'name':_0x4749b0[_0x75bc('0xdb')],'basename':_0x4749b0['filename'],'type':_0x4749b0[_0x75bc('0xdc')],'ChatOfflineMessageId':_0x4282f0['id']};});_0x1e1989=_0x273c51['map'](_0x522a43=>{var _0x18e08c={'filename':_0x522a43[_0x75bc('0x41')],'path':path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0xdd'),'files',_0x75bc('0xde'),'offline-chat',_0x522a43[_0x75bc('0xdf')])};return _0x18e08c;});if(!_0x4f62d9[_0x75bc('0xe0')]){return db['sequelize'][_0x75bc('0xe1')](function(_0x30e61a){return db[_0x75bc('0xe2')][_0x75bc('0xe3')](_0x273c51,{'transaction':_0x30e61a});});}}})[_0x75bc('0x3a')](function(){if(_0x3eec48){_0x248f48=_0x3eec48;return db[_0x75bc('0xd4')][_0x75bc('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x75bc('0xe4')],'as':_0x75bc('0xe5'),'raw':!![]}]});}})['then'](function(_0x2f8eb9){if(_0x2f8eb9&&_0x2f8eb9['Smtp']&&_0x4f62d9['forwardOffline']&&_0x4f62d9[_0x75bc('0xe6')]){var _0x37cff2={'tls':{'rejectUnauthorized':![]}};if(_0x2f8eb9[_0x75bc('0xe5')]['service']){_0x37cff2[_0x75bc('0xe7')]=_0x2f8eb9[_0x75bc('0xe5')]['service'];}else{_0x37cff2['host']=_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xe8')];_0x37cff2[_0x75bc('0xe9')]=_0x2f8eb9['Smtp'][_0x75bc('0xe9')];_0x37cff2[_0x75bc('0xea')]=_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xea')];}if(_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xeb')]){_0x37cff2[_0x75bc('0xec')]={'user':_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0x62')],'pass':_0x2f8eb9['Smtp'][_0x75bc('0xed')]};}return respondWithRpcPromise(_0x75bc('0xee'),_0x75bc('0xef'),{'account':_0x37cff2,'message':{'from':util[_0x75bc('0xb7')](_0x75bc('0xf0'),_0x2f8eb9['name'],_0x2f8eb9[_0x75bc('0xf1')]||_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0x62')]),'to':_0x4f62d9[_0x75bc('0xe6')],'subject':_0x4f62d9[_0x75bc('0xf2')],'html':_0x248f48[_0x75bc('0x61')],'attachments':_0x1e1989}},client9003)[_0x75bc('0x3a')](function(){return _0x248f48;})[_0x75bc('0x2c')](function(_0x5c4eb9){console[_0x75bc('0x28')](_0x5c4eb9);});}})[_0x75bc('0x3a')](function(){if(_0x4f62d9&&_0x4f62d9[_0x75bc('0xe0')]&&_0x4f62d9[_0x75bc('0xf3')]){var _0x132f04=[];if(_0x8827ef[_0x75bc('0x50')]){_0x132f04=_0x8827ef['map'](function(_0x251788){return{'name':_0x251788[_0x75bc('0xdb')],'basename':_0x251788[_0x75bc('0x78')],'type':_0x251788[_0x75bc('0xdc')],'ChatOfflineMessageId':_0x3eec48['id']};});}var _0x351598;if(!_[_0x75bc('0x84')](_0x4f62d9['subjectOffline'])){var _0x2eb455=_[_0x75bc('0x45')](_0x1c8f15[_0x75bc('0x61')],function(_0x16dbbf){return _0x16dbbf;});var _0x36cc1d=_[_0x75bc('0xf4')](_0x2eb455)[0x0];var _0x4077f4=_[_0x75bc('0xf5')](_0x36cc1d,function(_0x4cfd32){return _0x4cfd32;});_0x351598=_0x4077f4[0x1][_0x4f62d9[_0x75bc('0xf6')]];}var _0x45356c={'from':_0x331d26[_0x75bc('0xf1')],'firstName':_0x331d26['firstName'],'lastName':_0x331d26[_0x75bc('0xb2')],'mapKey':'email','message':{'from':_0x331d26[_0x75bc('0xf1')],'to':_0x4f62d9[_0x75bc('0xd4')][_0x75bc('0xf1')],'cc':'','subject':_['isNil'](_0x351598)?_0x4f62d9[_0x75bc('0xf2')]:_0x351598,'messageId':'','sentAt':new Date(),'attach':_0x132f04[_0x75bc('0x50')],'attachments':_0x132f04,'originChannel':_0x75bc('0xf7'),'ChatWebsiteId':_0x4f62d9['id'],'ChatOfflineMessageId':_0x248f48['id'],'originTo':_0x4f62d9[_0x75bc('0xd4')][_0x75bc('0xf1')]},'body':_0x248f48[_0x75bc('0x61')]};var _0x5295a5={'account':{'id':_0x4f62d9['MailAccountId']},'body':_0x45356c,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x75bc('0xf8'),_0x5295a5,client9001)['then'](function(){return _0x248f48;})[_0x75bc('0x2c')](function(_0x5ba8df){console[_0x75bc('0x28')](_0x5ba8df);});}return;})[_0x75bc('0x3a')](function(){if(_0x248f48){return _0x248f48;}})['then'](respondWithResult(_0x30de25,null))[_0x75bc('0x2c')](function(_0x2b1440){console[_0x75bc('0x28')](_0x75bc('0x2c'),_0x2b1440);for(var _0xacea54 of _0x8827ef){var _0x4b6e75=path[_0x75bc('0x80')](config['root'],'server',_0x75bc('0xd0'),_0x75bc('0xde'),'offline-chat',_0xacea54[_0x75bc('0x78')]);fs_extra['remove'](_0x4b6e75)[_0x75bc('0x2c')](function(_0x496eb6){console[_0x75bc('0x28')](_0x75bc('0xf9'),_0x4b6e75,_0x496eb6);});}});};exports[_0x75bc('0xfa')]=function(_0x665540,_0x19d03e,_0x3ae1c6){return db[_0x75bc('0xbf')][_0x75bc('0x68')]({'where':{'id':_0x665540[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19d03e,null))[_0x75bc('0x3a')](function(_0x3a9a04){if(_0x3a9a04){return _0x3a9a04[_0x75bc('0xfa')](_0x665540['body'][_0x75bc('0x76')],_['omit'](_0x665540['body'],[_0x75bc('0x76'),'id'])||{});}})[_0x75bc('0x3a')](respondWithResult(_0x19d03e,null))[_0x75bc('0x2c')](handleError(_0x19d03e,null));};exports[_0x75bc('0xfb')]=function(_0x351f15,_0x18a86b,_0x3517fe){var _0x3bbde4={'raw':![],'where':{}};var _0x3bdeb7={};var _0x5acb09={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x351f15[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x18a86b,null))['then'](function(_0x2c2c51){if(_0x2c2c51){_0x3bdeb7[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0xbf')][_0x75bc('0x47')]);_0x3bdeb7[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x351f15[_0x75bc('0x4c')]);_0x3bdeb7[_0x75bc('0x55')]=_['intersection'](_0x3bdeb7[_0x75bc('0x4b')],_0x3bdeb7['query']);_0x3bbde4[_0x75bc('0x4f')]=_['intersection'](_0x3bdeb7[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x351f15[_0x75bc('0x4c')]['fields']));_0x3bbde4[_0x75bc('0x4f')]=_0x3bbde4[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x3bbde4[_0x75bc('0x4f')]:_0x3bdeb7[_0x75bc('0x4b')];if(!_0x351f15[_0x75bc('0x4c')]['hasOwnProperty'](_0x75bc('0x52'))){_0x3bbde4[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x351f15[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x3bbde4[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0x351f15[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x3bbde4[_0x75bc('0x6f')]=qs['sort'](_0x351f15['query']['sort']);_0x3bbde4[_0x75bc('0x53')]=qs['filters'](_[_0x75bc('0x54')](_0x351f15[_0x75bc('0x4c')],_0x3bdeb7['filters']));_0x3bbde4[_0x75bc('0x53')][_0x75bc('0x6b')]=_0x2c2c51['id'];if(_0x351f15[_0x75bc('0x4c')]['filter']){_0x3bbde4[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x3bbde4[_0x75bc('0x53')],{'$or':_['map'](_0x3bbde4[_0x75bc('0x4f')],function(_0x5606b2){var _0x537344={};_0x537344[_0x5606b2]={'$like':'%'+_0x351f15[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x537344;})});}_0x3bbde4=_[_0x75bc('0x57')]({},_0x3bbde4,_0x351f15[_0x75bc('0x71')]);return db[_0x75bc('0xbf')]['count']({'where':_0x3bbde4['where']})[_0x75bc('0x3a')](function(_0x396a77){_0x5acb09['count']=_0x396a77;if(_0x351f15[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x3bbde4[_0x75bc('0x59')]=[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xfc'),'required':![]},{'model':db[_0x75bc('0xc6')],'as':_0x75bc('0xfd'),'attributes':[_0x75bc('0x41'),'fullname',_0x75bc('0xfe')],'required':![]},{'model':db[_0x75bc('0xff')],'as':'Tags','attributes':['id',_0x75bc('0x41'),_0x75bc('0x100')],'where':_0x351f15[_0x75bc('0x4c')]['tag']?{'id':_0x351f15[_0x75bc('0x4c')][_0x75bc('0x101')]}:undefined,'required':_0x351f15['query'][_0x75bc('0x101')]?!![]:![]}];}return db['ChatInteraction'][_0x75bc('0x5a')](_0x3bbde4);})[_0x75bc('0x3a')](function(_0x48e6f5){_0x5acb09[_0x75bc('0x5b')]=_0x48e6f5;return _0x5acb09;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x18a86b,_0x3bbde4))['catch'](handleError(_0x18a86b,null));};function iftimePromise(_0x7425c5,_0xe78805){return respondWithRpcPromise('Command',_0x75bc('0x102'),{'command':_0xe78805[_0x75bc('0x103')]?util[_0x75bc('0xb7')](_0x75bc('0x104'),_0x7425c5[_0x75bc('0x105')],_0xe78805[_0x75bc('0x103')]):util[_0x75bc('0xb7')]('iftime\x20%s',_0x7425c5[_0x75bc('0x105')])},client9002)[_0x75bc('0x3a')](function(_0x54eb8c){var _0x230b8f=_0x54eb8c&&_0x54eb8c['indexOf'](_0x75bc('0x106'))>=0x0?!![]:![];logger[_0x75bc('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xe78805['id'],_0x7425c5['id'],_0x7425c5[_0x75bc('0x105')],_0x230b8f?_0x75bc('0x107'):_0x75bc('0x108'),_0xe78805[_0x75bc('0x103')]?_0xe78805['timezone']:_0x75bc('0x109'));return _0x230b8f;})[_0x75bc('0x2c')](function(_0x306c87){logger[_0x75bc('0x28')](_0x75bc('0x10a'),_0xe78805['id'],_0x7425c5['id'],_0x7425c5[_0x75bc('0x105')],util[_0x75bc('0x10b')](_0x306c87,{'showHidden':![],'depth':null}),_0xe78805[_0x75bc('0x103')]?_0xe78805[_0x75bc('0x103')]:_0x75bc('0x109'));return![];});}exports[_0x75bc('0x102')]=function(_0x380096,_0x252384,_0xeb484d){var _0x534bf6=0x0;var _0x2e836e=0x0;var _0x546eb7=![];var _0x5cc784;var _0x2ebef8;return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x380096[_0x75bc('0x5d')]['id']},'include':[{'model':db['Interval'],'as':_0x75bc('0x10c'),'include':[{'model':db[_0x75bc('0x10c')],'as':_0x75bc('0x10d'),'attributes':['id',_0x75bc('0x105')],'raw':!![]}]}]})[_0x75bc('0x3a')](handleEntityNotFound(_0x252384,null))[_0x75bc('0x3a')](function(_0x51181b){if(_0x51181b){_0x5cc784=_0x51181b;return _0x51181b[_0x75bc('0x10e')]({'raw':!![]});}})[_0x75bc('0x3a')](function(_0xfeb939){if(_0x5cc784){if(_0xfeb939){_0x2ebef8=_0xfeb939;}}return require(_0x75bc('0x16'))[_0x75bc('0x83')]();})['then'](function(_0x200bb2){if(_0x200bb2){_0x2e836e=_0x200bb2[_0x75bc('0x10f')];_0x546eb7=_0x200bb2[_0x75bc('0x110')];}})[_0x75bc('0x3a')](function(){return db[_0x75bc('0xbf')][_0x75bc('0x32')]({'where':{'closed':![]}});})['then'](function(_0x12717c){_0x534bf6=_0x12717c;if(_0x2e836e&&_0x12717c>_0x2e836e){return db[_0x75bc('0x111')][_0x75bc('0x6d')]({'where':{'id':0x1}})[_0x75bc('0x3a')](function(_0x5a05ec){if(_0x5a05ec){_0x5a05ec[_0x75bc('0x112')](_0x75bc('0x113'));}});}})[_0x75bc('0x3a')](function(){if(_0x5cc784[_0x75bc('0x10c')]&&_0x5cc784[_0x75bc('0x10c')][_0x75bc('0x10d')]){var _0x2b2297=[];for(var _0x2f7e86=0x0;_0x2f7e86<_0x5cc784[_0x75bc('0x10c')]['Intervals'][_0x75bc('0x50')];_0x2f7e86++){var _0xb9eca2=_0x5cc784[_0x75bc('0x10c')][_0x75bc('0x10d')][_0x2f7e86][_0x75bc('0x3c')]({'plain':!![]});_0x2b2297[_0x75bc('0x114')](iftimePromise(_0xb9eca2,_0x5cc784));}return BPromise[_0x75bc('0x115')](_0x2b2297)[_0x75bc('0x3a')](function(_0x364a78){return _[_0x75bc('0x116')](_0x364a78);});}else{return!![];}})[_0x75bc('0x3a')](function(_0xf0d289){var _0x323c4b=fs[_0x75bc('0xd6')](path[_0x75bc('0x80')](config['root'],'server/files/chat/iframe.ejs'),_0x75bc('0xd8'));var _0x3c259c={'remote':_0x5cc784[_0x75bc('0x117')],'query':querystring[_0x75bc('0x27')](_[_0x75bc('0x57')](_0x5cc784[_0x75bc('0x3c')]({'plain':!![]}),{'customerIp':_0x380096[_0x75bc('0x8f')][_0x75bc('0xaf')]||_0x380096[_0x75bc('0x8f')]['x-real-ip']||_0x380096[_0x75bc('0x118')][_0x75bc('0x119')]||_0x380096['ip'],'referer':_0x380096[_0x75bc('0x8f')]['referer'],'openedInteractions':_0x534bf6,'maxInteractions':_0x2e836e,'virtual':_0x546eb7['virtual'],'online':_0xf0d289,'custom':_0x546eb7}))[_0x75bc('0x11a')](/'/g,'\x5c\x27')};_0x252384[_0x75bc('0x42')](ejs[_0x75bc('0x11b')](Mustache[_0x75bc('0x11b')](_0x323c4b,_0x3c259c),{'proactiveActions':_0x2ebef8,'alignment':_0x5cc784[_0x75bc('0x11c')],'verticalAlignment':_0x5cc784[_0x75bc('0x11d')],'div_color':_0x5cc784[_0x75bc('0x100')],'text_color':_0x5cc784[_0x75bc('0x11e')],'button_color':_0x5cc784[_0x75bc('0x11f')],'background_color':_0x5cc784[_0x75bc('0x120')]}));})[_0x75bc('0x2c')](handleError(_0x252384,null));};exports['addApplications']=function(_0x4a9368,_0x7e7be0,_0x1c8ff1){return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x4a9368[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x7e7be0,null))[_0x75bc('0x3a')](function(_0x16e4d0){if(_0x16e4d0){return db[_0x75bc('0x121')][_0x75bc('0xe1')](function(_0x3cf754){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4a9368[_0x75bc('0x5d')]['id']},'transaction':_0x3cf754})[_0x75bc('0x3a')](function(_0x4bc3e2){var _0x5740c2=_[_0x75bc('0x45')](_0x4a9368[_0x75bc('0x61')],function(_0x354521){_0x354521['ChatWebsiteId']=_0x4a9368[_0x75bc('0x5d')]['id'];return _0x354521;});return db[_0x75bc('0xa4')][_0x75bc('0xe3')](_0x5740c2,{'transaction':_0x3cf754});});})[_0x75bc('0x3a')](function(){return db[_0x75bc('0xa4')][_0x75bc('0x122')]({'where':{'ChatWebsiteId':_0x4a9368[_0x75bc('0x5d')]['id']},'order':_0x75bc('0xaa')});});}})[_0x75bc('0x3a')](respondWithResult(_0x7e7be0,null))['catch'](handleError(_0x7e7be0,null));};exports[_0x75bc('0x123')]=function(_0xaa70ef,_0x31ae89,_0x107c3b){var _0x191fcb={};var _0x21b835={};var _0x20f365;var _0x149d6d;return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0xaa70ef[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x31ae89,null))[_0x75bc('0x3a')](function(_0x1b4383){if(_0x1b4383){_0x20f365=_0x1b4383;_0x21b835[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0xa4')][_0x75bc('0x47')]);_0x21b835['query']=_[_0x75bc('0x4d')](_0xaa70ef[_0x75bc('0x4c')]);_0x21b835[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x21b835['model'],_0x21b835[_0x75bc('0x4c')]);_0x191fcb[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x21b835[_0x75bc('0x4b')],qs['fields'](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x191fcb[_0x75bc('0x4f')]=_0x191fcb['attributes']['length']?_0x191fcb[_0x75bc('0x4f')]:_0x21b835[_0x75bc('0x4b')];_0x191fcb[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x191fcb[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0xaa70ef[_0x75bc('0x4c')],_0x21b835[_0x75bc('0x55')]));if(_0xaa70ef['query'][_0x75bc('0x56')]){_0x191fcb[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x191fcb[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x191fcb['attributes'],function(_0xcf42e0){var _0x12707c={};_0x12707c[_0xcf42e0]={'$like':'%'+_0xaa70ef['query'][_0x75bc('0x56')]+'%'};return _0x12707c;})});}_0x191fcb=_[_0x75bc('0x57')]({},_0x191fcb,_0xaa70ef[_0x75bc('0x71')]);return _0x20f365[_0x75bc('0x123')](_0x191fcb);}})['then'](function(_0x2e86db){if(_0x2e86db){_0x149d6d=_0x2e86db['length'];if(!_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x51')]('nolimit')){_0x191fcb[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x191fcb[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0xaa70ef[_0x75bc('0x4c')]['offset']);}return _0x20f365['getApplications'](_0x191fcb);}})[_0x75bc('0x3a')](function(_0x494e8a){if(_0x494e8a){return _0x494e8a?{'count':_0x149d6d,'rows':_0x494e8a}:null;}})[_0x75bc('0x3a')](respondWithResult(_0x31ae89,null))[_0x75bc('0x2c')](handleError(_0x31ae89,null));};exports[_0x75bc('0x124')]=function(_0x2e5e0d,_0x4cfe33,_0x2800fc){return db[_0x75bc('0x125')][_0x75bc('0x68')]({'where':{'id':_0x2e5e0d[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4cfe33,null))[_0x75bc('0x3a')](function(_0x8e3685){if(_0x8e3685){return _0x8e3685['addProactiveActions'](_0x2e5e0d['body']['ids'],_['omit'](_0x2e5e0d['body'],[_0x75bc('0x76'),'id'])||{});}})[_0x75bc('0x3a')](respondWithResult(_0x4cfe33,null))[_0x75bc('0x2c')](handleError(_0x4cfe33,null));};exports[_0x75bc('0x10e')]=function(_0x5543ce,_0x44d5d4,_0x525e06){var _0x138cb6={};var _0xb20305={};var _0x4b5bbb;var _0x4ed7f1;return db[_0x75bc('0x46')]['findOne']({'where':{'id':_0x5543ce[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x44d5d4,null))[_0x75bc('0x3a')](function(_0x35c076){if(_0x35c076){_0x4b5bbb=_0x35c076;_0xb20305['model']=_[_0x75bc('0x4d')](db[_0x75bc('0x126')][_0x75bc('0x47')]);_0xb20305[_0x75bc('0x4c')]=_['keys'](_0x5543ce[_0x75bc('0x4c')]);_0xb20305['filters']=_[_0x75bc('0x4e')](_0xb20305[_0x75bc('0x4b')],_0xb20305[_0x75bc('0x4c')]);_0x138cb6[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0xb20305['model'],qs[_0x75bc('0x5f')](_0x5543ce[_0x75bc('0x4c')]['fields']));_0x138cb6['attributes']=_0x138cb6['attributes'][_0x75bc('0x50')]?_0x138cb6[_0x75bc('0x4f')]:_0xb20305['model'];_0x138cb6['order']=qs[_0x75bc('0x70')](_0x5543ce[_0x75bc('0x4c')]['sort']);_0x138cb6['where']=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0x5543ce[_0x75bc('0x4c')],_0xb20305[_0x75bc('0x55')]));if(_0x5543ce[_0x75bc('0x4c')]['filter']){_0x138cb6['where']=_[_0x75bc('0x57')](_0x138cb6[_0x75bc('0x53')],{'$or':_['map'](_0x138cb6[_0x75bc('0x4f')],function(_0x207fdc){var _0x2a4666={};_0x2a4666[_0x207fdc]={'$like':'%'+_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x2a4666;})});}_0x138cb6=_[_0x75bc('0x57')]({},_0x138cb6,_0x5543ce['options']);return _0x4b5bbb[_0x75bc('0x10e')](_0x138cb6);}})[_0x75bc('0x3a')](function(_0x5f1931){if(_0x5f1931){_0x4ed7f1=_0x5f1931[_0x75bc('0x50')];if(!_0x5543ce[_0x75bc('0x4c')]['hasOwnProperty']('nolimit')){_0x138cb6['limit']=qs[_0x75bc('0x31')](_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x138cb6[_0x75bc('0x33')]=qs['offset'](_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x33')]);}return _0x4b5bbb[_0x75bc('0x10e')](_0x138cb6);}})[_0x75bc('0x3a')](function(_0xe88e02){if(_0xe88e02){return _0xe88e02?{'count':_0x4ed7f1,'rows':_0xe88e02}:null;}})['then'](respondWithResult(_0x44d5d4,null))[_0x75bc('0x2c')](handleError(_0x44d5d4,null));};exports[_0x75bc('0x127')]=function(_0x362cbb,_0x4ffcb2,_0x41aed7){var _0x2e292c=_0x362cbb[_0x75bc('0x4c')][_0x75bc('0x128')]===_0x75bc('0x129')?_0x75bc('0x12a'):'onlineForm';return db[_0x75bc('0x46')][_0x75bc('0x68')]({'attributes':['id',_0x2e292c],'where':{'id':_0x362cbb['params']['id']}})['then'](handleEntityNotFound(_0x4ffcb2,null))[_0x75bc('0x3a')](function(_0x44e02d){if(_0x44e02d){var _0x2fc4ad=_0x44e02d[_0x2e292c];var _0x8ccba0=_0x2fc4ad&&_0x2fc4ad[_0x75bc('0x12b')]?_0x2fc4ad[_0x75bc('0x12b')]:[];_0x4ffcb2[_0x75bc('0x42')]({'fromKey':_['isNil'](_0x2fc4ad[_0x75bc('0x12c')])?undefined:_0x2fc4ad[_0x75bc('0x12c')],'count':_0x8ccba0['length'],'rows':_0x8ccba0});}})['catch'](handleError(_0x4ffcb2,null));};exports[_0x75bc('0x12d')]=function(_0x4e7347,_0x126f49,_0x1f827e){var _0x53a449={'raw':![],'where':{}};var _0x50ed3e={};var _0x3c9675={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x4e7347[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x126f49,null))[_0x75bc('0x3a')](function(_0x5b66cc){if(_0x5b66cc){_0x50ed3e['model']=_[_0x75bc('0x4d')](db[_0x75bc('0xda')]['rawAttributes']);_0x50ed3e[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x4e7347[_0x75bc('0x4c')]);_0x50ed3e[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x50ed3e['model'],_0x50ed3e[_0x75bc('0x4c')]);_0x53a449[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x50ed3e[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x4e7347['query'][_0x75bc('0x5f')]));_0x53a449[_0x75bc('0x4f')]=_0x53a449['attributes']['length']?_0x53a449[_0x75bc('0x4f')]:_0x50ed3e[_0x75bc('0x4b')];if(!_0x4e7347[_0x75bc('0x4c')]['hasOwnProperty']('nolimit')){_0x53a449[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x53a449[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0x4e7347['query'][_0x75bc('0x33')]);}_0x53a449[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x53a449['where']=qs['filters'](_[_0x75bc('0x54')](_0x4e7347[_0x75bc('0x4c')],_0x50ed3e['filters']));_0x53a449[_0x75bc('0x53')]['ChatWebsiteId']=_0x5b66cc['id'];if(_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x53a449[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x53a449['where'],{'$or':_[_0x75bc('0x45')](_0x53a449[_0x75bc('0x4f')],function(_0x185887){var _0x4a90ff={};_0x4a90ff[_0x185887]={'$like':'%'+_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x4a90ff;})});}_0x53a449=_[_0x75bc('0x57')]({},_0x53a449,_0x4e7347['options']);return db[_0x75bc('0xda')][_0x75bc('0x32')]({'where':_0x53a449[_0x75bc('0x53')]})[_0x75bc('0x3a')](function(_0x2a1f2c){_0x3c9675[_0x75bc('0x32')]=_0x2a1f2c;if(_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x53a449[_0x75bc('0x59')]=[{'all':!![]}];}else{_0x53a449[_0x75bc('0x59')]=[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xfc'),'required':![]},{'model':db[_0x75bc('0xe2')],'as':_0x75bc('0x12e'),'required':![]}];}return db[_0x75bc('0xda')][_0x75bc('0x5a')](_0x53a449);})[_0x75bc('0x3a')](function(_0x4aa1cf){_0x3c9675[_0x75bc('0x5b')]=_0x4aa1cf;return _0x3c9675;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x126f49,_0x53a449))[_0x75bc('0x2c')](handleError(_0x126f49,null));};exports[_0x75bc('0x12f')]=function(_0x1e2302,_0x30747f,_0x17abb9){return db['ChatWebsite'][_0x75bc('0x68')]({'where':{'id':_0x1e2302[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x30747f,null))[_0x75bc('0x3a')](function(_0x2562d4){if(_0x2562d4){return _0x2562d4[_0x75bc('0x12f')](_0x1e2302[_0x75bc('0x61')]['ids'],_['omit'](_0x1e2302[_0x75bc('0x61')],['ids','id'])||{})[_0x75bc('0xc0')](function(_0x20daad){for(var _0x4ac0f6=0x0;_0x4ac0f6<_0x1e2302[_0x75bc('0x61')]['ids'][_0x75bc('0x50')];_0x4ac0f6+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1e2302['body'][_0x75bc('0x76')][_0x4ac0f6]),'ChatWebsiteId':Number(_0x1e2302[_0x75bc('0x5d')]['id'])});}return _0x20daad;});}})[_0x75bc('0x3a')](respondWithResult(_0x30747f,null))[_0x75bc('0x2c')](handleError(_0x30747f,null));};exports[_0x75bc('0x130')]=function(_0x4d2986,_0x2a764a,_0x59b043){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x4d2986[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2a764a,null))[_0x75bc('0x3a')](function(_0x333207){if(_0x333207){return _0x333207[_0x75bc('0x130')](_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')])[_0x75bc('0x3a')](function(){if(_[_0x75bc('0x131')](_0x4d2986['query'][_0x75bc('0x76')])){for(var _0x37fede=0x0;_0x37fede<_0x4d2986[_0x75bc('0x4c')]['ids'][_0x75bc('0x50')];_0x37fede+=0x1){socket[_0x75bc('0x132')](_0x75bc('0x133'),{'UserId':Number(_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')][_0x37fede]),'ChatWebsiteId':Number(_0x4d2986[_0x75bc('0x5d')]['id'])});}}else{socket[_0x75bc('0x132')]('userChatWebsite:remove',{'UserId':Number(_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')]),'ChatWebsiteId':Number(_0x4d2986[_0x75bc('0x5d')]['id'])});}});}})[_0x75bc('0x3a')](respondWithStatusCode(_0x2a764a,null))[_0x75bc('0x2c')](handleError(_0x2a764a,null));};exports[_0x75bc('0x134')]=function(_0xfc03e4,_0x932134,_0xed3019){var _0x3ff4a1={};var _0x53a2c3={};var _0x33495e;var _0x119b4d;return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0xfc03e4[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x932134,null))[_0x75bc('0x3a')](function(_0x4e2497){if(_0x4e2497){_0x33495e=_0x4e2497;_0x53a2c3['model']=_[_0x75bc('0x4d')](db['User'][_0x75bc('0x47')]);_0x53a2c3[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0xfc03e4[_0x75bc('0x4c')]);_0x53a2c3['filters']=_[_0x75bc('0x4e')](_0x53a2c3[_0x75bc('0x4b')],_0x53a2c3[_0x75bc('0x4c')]);_0x3ff4a1['attributes']=_[_0x75bc('0x4e')](_0x53a2c3[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0xfc03e4['query']['fields']));_0x3ff4a1[_0x75bc('0x4f')]=_0x3ff4a1[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x3ff4a1[_0x75bc('0x4f')]:_0x53a2c3[_0x75bc('0x4b')];_0x3ff4a1[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x3ff4a1[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_['pick'](_0xfc03e4[_0x75bc('0x4c')],_0x53a2c3[_0x75bc('0x55')]));if(_0xfc03e4[_0x75bc('0x4c')]['filter']){_0x3ff4a1[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x3ff4a1[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x3ff4a1[_0x75bc('0x4f')],function(_0x583a92){var _0x32ebc8={};_0x32ebc8[_0x583a92]={'$like':'%'+_0xfc03e4[_0x75bc('0x4c')]['filter']+'%'};return _0x32ebc8;})});}_0x3ff4a1=_['merge']({},_0x3ff4a1,_0xfc03e4[_0x75bc('0x71')]);return _0x33495e['getAgents'](_0x3ff4a1);}})[_0x75bc('0x3a')](function(_0x496660){if(_0x496660){_0x119b4d=_0x496660[_0x75bc('0x50')];if(!_0xfc03e4['query'][_0x75bc('0x51')](_0x75bc('0x52'))){_0x3ff4a1[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x3ff4a1[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x33')]);}return _0x33495e[_0x75bc('0x134')](_0x3ff4a1);}})[_0x75bc('0x3a')](function(_0x1b7eff){if(_0x1b7eff){return _0x1b7eff?{'count':_0x119b4d,'rows':_0x1b7eff}:null;}})[_0x75bc('0x3a')](respondWithResult(_0x932134,null))[_0x75bc('0x2c')](handleError(_0x932134,null));}; \ No newline at end of file +var _0x4df1=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','map','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','mandatoryDispositionPause','ChatWebsite','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','rawAttributes','nolimit','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','root','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Applications','account','applications','list','orderBy','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','files','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','internal','Tag','Tags','tag','Command','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','License','all','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','color','textColor','backgroundColor','addApplications','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4df1,0x121));var _0x14df=function(_0x52ebc3,_0x18d0e0){_0x52ebc3=_0x52ebc3-0x0;var _0x267086=_0x4df1[_0x52ebc3];return _0x267086;};'use strict';var emlformat=require(_0x14df('0x0'));var rimraf=require(_0x14df('0x1'));var zipdir=require(_0x14df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14df('0x3'));var moment=require(_0x14df('0x4'));var BPromise=require(_0x14df('0x5'));var Mustache=require(_0x14df('0x6'));var util=require(_0x14df('0x7'));var path=require(_0x14df('0x8'));var sox=require(_0x14df('0x9'));var csv=require(_0x14df('0xa'));var ejs=require(_0x14df('0xb'));var fs=require('fs');var fs_extra=require(_0x14df('0xc'));var _=require(_0x14df('0xd'));var squel=require(_0x14df('0xe'));var crypto=require(_0x14df('0xf'));var jsforce=require(_0x14df('0x10'));var deskjs=require(_0x14df('0x11'));var toCsv=require(_0x14df('0xa'));var querystring=require(_0x14df('0x12'));var Papa=require(_0x14df('0x13'));var Redis=require(_0x14df('0x14'));var authService=require(_0x14df('0x15'));var qs=require(_0x14df('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14df('0x17'));var logger=require(_0x14df('0x18'))('api');var utils=require(_0x14df('0x19'));var config=require(_0x14df('0x1a'));var licenseUtil=require(_0x14df('0x1b'));var db=require('../../mysqldb')['db'];config[_0x14df('0x1c')]=_[_0x14df('0x1d')](config[_0x14df('0x1c')],{'host':_0x14df('0x1e'),'port':0x18eb});var socket=require(_0x14df('0x1f'))(new Redis(config[_0x14df('0x1c')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x14df('0x20'));var client=jayson[_0x14df('0x21')][_0x14df('0x22')]({'port':0x232c});var client9002=jayson[_0x14df('0x21')][_0x14df('0x22')]({'port':0x232a});var client9003=jayson[_0x14df('0x21')][_0x14df('0x22')]({'port':0x232b});var client9001=jayson[_0x14df('0x21')][_0x14df('0x22')]({'port':0x2329});function respondWithRpcPromise(_0x194c35,_0x2d5878,_0x1a17a2,_0x56ea70){return new BPromise(function(_0x2228b9,_0x30dbc0){var _0x57583a=_0x56ea70||client;return _0x57583a[_0x14df('0x23')](_0x194c35,_0x1a17a2)['then'](function(_0x39f56c){logger[_0x14df('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2d5878,_0x14df('0x25'));logger[_0x14df('0x26')](_0x14df('0x27'),_0x2d5878,_0x14df('0x25'),JSON[_0x14df('0x28')](_0x39f56c));if(_0x39f56c[_0x14df('0x29')]){if(_0x39f56c[_0x14df('0x29')][_0x14df('0x2a')]===0x1f4){logger[_0x14df('0x29')](_0x14df('0x2b'),_0x2d5878,_0x39f56c[_0x14df('0x29')]['message']);return _0x30dbc0(_0x39f56c[_0x14df('0x29')][_0x14df('0x2c')]);}logger[_0x14df('0x29')](_0x14df('0x2b'),_0x2d5878,_0x39f56c[_0x14df('0x29')][_0x14df('0x2c')]);return _0x2228b9(_0x39f56c['error'][_0x14df('0x2c')]);}else{logger[_0x14df('0x24')](_0x14df('0x2b'),_0x2d5878,_0x14df('0x25'));_0x2228b9(_0x39f56c[_0x14df('0x2d')][_0x14df('0x2c')]);}})[_0x14df('0x2e')](function(_0x4cf6a9){logger['error'](_0x14df('0x2b'),_0x2d5878,_0x4cf6a9);_0x30dbc0(_0x4cf6a9);});});}function respondWithStatusCode(_0x5793b1,_0x39d7df){_0x39d7df=_0x39d7df||0xcc;return function(_0x2c4bdc){if(_0x2c4bdc){return _0x5793b1['sendStatus'](_0x39d7df);}return _0x5793b1[_0x14df('0x2f')](_0x39d7df)[_0x14df('0x30')]();};}function respondWithResult(_0x8ed510,_0x32050f){_0x32050f=_0x32050f||0xc8;return function(_0x3ff717){if(_0x3ff717){return _0x8ed510[_0x14df('0x2f')](_0x32050f)[_0x14df('0x31')](_0x3ff717);}};}function respondWithFilteredResult(_0x3c4d8d,_0x2758be){return function(_0x5b9ee1){if(_0x5b9ee1){var _0x4acc47=typeof _0x2758be[_0x14df('0x32')]==='undefined'&&typeof _0x2758be[_0x14df('0x33')]===_0x14df('0x34');var _0x34ef92=_0x5b9ee1[_0x14df('0x35')];var _0x2df1a9=_0x4acc47?0x0:_0x2758be['offset'];var _0x78fd87=_0x4acc47?_0x5b9ee1['count']:_0x2758be['offset']+_0x2758be[_0x14df('0x33')];var _0x46cccd;if(_0x78fd87>=_0x34ef92){_0x78fd87=_0x34ef92;_0x46cccd=0xc8;}else{_0x46cccd=0xce;}_0x3c4d8d[_0x14df('0x2f')](_0x46cccd);return _0x3c4d8d['set'](_0x14df('0x36'),_0x2df1a9+'-'+_0x78fd87+'/'+_0x34ef92)[_0x14df('0x31')](_0x5b9ee1);}return null;};}function patchUpdates(_0xc8eebc){return function(_0x43daec){try{jsonpatch[_0x14df('0x37')](_0x43daec,_0xc8eebc,!![]);}catch(_0x4bca33){return BPromise[_0x14df('0x38')](_0x4bca33);}return _0x43daec['save']();};}function saveUpdates(_0x3e7312,_0x1b873a){return function(_0x1c0747){if(_0x1c0747){return _0x1c0747['update'](_0x3e7312)[_0x14df('0x39')](function(_0x232f9d){return _0x232f9d;});}return null;};}function removeEntity(_0x55a743,_0x5bfcf7){return function(_0x1c1830){if(_0x1c1830){return _0x1c1830[_0x14df('0x3a')]()[_0x14df('0x39')](function(){var _0x4bcd80=_0x1c1830[_0x14df('0x3b')]({'plain':!![]});var _0x44628e=_0x14df('0x3c');return db[_0x14df('0x3d')]['destroy']({'where':{'type':_0x44628e,'resourceId':_0x4bcd80['id']}})['then'](function(){return _0x1c1830;});})[_0x14df('0x39')](function(){_0x55a743['status'](0xcc)[_0x14df('0x30')]();});}};}function handleEntityNotFound(_0x18b133,_0x27a4d1){return function(_0x52ddec){if(!_0x52ddec){_0x18b133['sendStatus'](0x194);}return _0x52ddec;};}function handleError(_0x134f7e,_0x52aa45){_0x52aa45=_0x52aa45||0x1f4;return function(_0x50b10e){logger['error'](_0x50b10e[_0x14df('0x3e')]);if(_0x50b10e[_0x14df('0x3f')]){delete _0x50b10e[_0x14df('0x3f')];}_0x134f7e['status'](_0x52aa45)['send'](_0x50b10e);};}exports[_0x14df('0x40')]=function(_0x39a7fa,_0x22b9fa){var _0x13e82b={'include':[{'model':db[_0x14df('0x41')],'as':'mandatoryDispositionPause'}]},_0x24b082={},_0x23d235={'count':0x0,'rows':[]};var _0x597377=_[_0x14df('0x42')](db['ChatWebsite']['rawAttributes'],function(_0x395784){return{'name':_0x395784['fieldName'],'type':_0x395784[_0x14df('0x43')]['key']};});_0x24b082[_0x14df('0x44')]=_['map'](_0x597377,_0x14df('0x3f'));_0x24b082[_0x14df('0x45')]=_[_0x14df('0x46')](_0x39a7fa['query']);_0x24b082[_0x14df('0x47')]=_[_0x14df('0x48')](_0x24b082['model'],_0x24b082[_0x14df('0x45')]);_0x13e82b[_0x14df('0x49')]=_['intersection'](_0x24b082[_0x14df('0x44')],qs[_0x14df('0x4a')](_0x39a7fa[_0x14df('0x45')][_0x14df('0x4a')]));_0x13e82b['attributes']=_0x13e82b[_0x14df('0x49')]['length']?_0x13e82b[_0x14df('0x49')]:_0x24b082[_0x14df('0x44')];if(!_0x39a7fa[_0x14df('0x45')][_0x14df('0x4b')]('nolimit')){_0x13e82b[_0x14df('0x33')]=qs[_0x14df('0x33')](_0x39a7fa[_0x14df('0x45')][_0x14df('0x33')]);_0x13e82b['offset']=qs[_0x14df('0x32')](_0x39a7fa[_0x14df('0x45')][_0x14df('0x32')]);}_0x13e82b[_0x14df('0x4c')]=qs[_0x14df('0x4d')](_0x39a7fa['query'][_0x14df('0x4d')]);_0x13e82b['where']=qs[_0x14df('0x47')](_['pick'](_0x39a7fa[_0x14df('0x45')],_0x24b082[_0x14df('0x47')]),_0x597377);if(_0x39a7fa['query']['filter']){_0x13e82b[_0x14df('0x4e')]=_[_0x14df('0x4f')](_0x13e82b[_0x14df('0x4e')],{'$or':_['map'](_0x597377,function(_0x25ab06){if(_0x25ab06[_0x14df('0x43')]!==_0x14df('0x50')){var _0x3cf4e6={};_0x3cf4e6[_0x25ab06['name']]={'$like':'%'+_0x39a7fa['query'][_0x14df('0x51')]+'%'};return _0x3cf4e6;}})});}_0x13e82b=_[_0x14df('0x4f')]({},_0x13e82b,_0x39a7fa[_0x14df('0x52')]);var _0x2935b9={'where':_0x13e82b['where']};return db['ChatWebsite'][_0x14df('0x35')](_0x2935b9)[_0x14df('0x39')](function(_0x49f015){_0x23d235[_0x14df('0x35')]=_0x49f015;if(_0x39a7fa[_0x14df('0x45')][_0x14df('0x53')]){_0x13e82b[_0x14df('0x54')]=[{'all':!![]}];}return db['ChatWebsite'][_0x14df('0x55')](_0x13e82b);})[_0x14df('0x39')](function(_0x479888){_0x23d235[_0x14df('0x56')]=_0x479888;return _0x23d235;})['then'](respondWithFilteredResult(_0x22b9fa,_0x13e82b))['catch'](handleError(_0x22b9fa,null));};exports['show']=function(_0x3c796c,_0xf7bc1f){var _0x408372={'raw':![],'where':{'id':_0x3c796c[_0x14df('0x57')]['id']},'include':[{'model':db[_0x14df('0x41')],'as':_0x14df('0x58')}]},_0xf30251={};_0xf30251[_0x14df('0x44')]=_['keys'](db[_0x14df('0x59')]['rawAttributes']);_0xf30251['query']=_[_0x14df('0x46')](_0x3c796c[_0x14df('0x45')]);_0xf30251[_0x14df('0x47')]=_[_0x14df('0x48')](_0xf30251[_0x14df('0x44')],_0xf30251[_0x14df('0x45')]);_0x408372[_0x14df('0x49')]=_[_0x14df('0x48')](_0xf30251[_0x14df('0x44')],qs[_0x14df('0x4a')](_0x3c796c[_0x14df('0x45')][_0x14df('0x4a')]));_0x408372[_0x14df('0x49')]=_0x408372['attributes'][_0x14df('0x5a')]?_0x408372[_0x14df('0x49')]:_0xf30251[_0x14df('0x44')];if(_0x3c796c[_0x14df('0x45')][_0x14df('0x53')]){_0x408372[_0x14df('0x54')]=[{'all':!![]}];}_0x408372=_[_0x14df('0x4f')]({},_0x408372,_0x3c796c[_0x14df('0x52')]);return db[_0x14df('0x59')][_0x14df('0x5b')](_0x408372)['then'](handleEntityNotFound(_0xf7bc1f,null))[_0x14df('0x39')](respondWithResult(_0xf7bc1f,null))[_0x14df('0x2e')](handleError(_0xf7bc1f,null));};exports['create']=function(_0x425974,_0x528fcd){return db['ChatWebsite']['create'](_0x425974[_0x14df('0x5c')],{})[_0x14df('0x39')](function(_0x2714c5){var _0x159cde=_0x425974['user']['get']({'plain':!![]});if(!_0x159cde)throw new Error(_0x14df('0x5d'));if(_0x159cde[_0x14df('0x5e')]===_0x14df('0x5f')){var _0xd581b0=_0x2714c5[_0x14df('0x3b')]({'plain':!![]});var _0x3b4d74=_0x14df('0x3c');return db['UserProfileSection'][_0x14df('0x5b')]({'where':{'name':_0x3b4d74,'userProfileId':_0x159cde[_0x14df('0x60')]},'raw':!![]})[_0x14df('0x39')](function(_0x1fe058){if(_0x1fe058&&_0x1fe058[_0x14df('0x61')]===0x0){return db[_0x14df('0x3d')][_0x14df('0x62')]({'name':_0xd581b0[_0x14df('0x3f')],'resourceId':_0xd581b0['id'],'type':_0x1fe058[_0x14df('0x3f')],'sectionId':_0x1fe058['id']},{})[_0x14df('0x39')](function(){return _0x2714c5;});}else{return _0x2714c5;}})[_0x14df('0x2e')](function(_0x25b029){logger[_0x14df('0x29')](_0x14df('0x63'),_0x25b029);throw _0x25b029;});}return _0x2714c5;})['then'](respondWithResult(_0x528fcd,0xc9))[_0x14df('0x2e')](handleError(_0x528fcd,null));};exports[_0x14df('0x64')]=function(_0x52b621,_0x760d99){if(_0x52b621[_0x14df('0x5c')]['id']){delete _0x52b621[_0x14df('0x5c')]['id'];}return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x52b621['params']['id']},'include':[{'model':db['Pause'],'as':_0x14df('0x58')}]})[_0x14df('0x39')](handleEntityNotFound(_0x760d99,null))[_0x14df('0x39')](saveUpdates(_0x52b621[_0x14df('0x5c')],null))[_0x14df('0x39')](respondWithResult(_0x760d99,null))[_0x14df('0x2e')](handleError(_0x760d99,null));};exports[_0x14df('0x3a')]=function(_0x3133ac,_0x40819e){return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x3133ac[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x40819e,null))['then'](removeEntity(_0x40819e,null))[_0x14df('0x2e')](handleError(_0x40819e,null));};exports[_0x14df('0x65')]=function(_0x1e07b7,_0x547450){return db[_0x14df('0x59')]['describe']()[_0x14df('0x39')](respondWithResult(_0x547450,null))[_0x14df('0x2e')](handleError(_0x547450,null));};exports[_0x14df('0x66')]=function(_0x596b8c,_0x41304f,_0x5da0b3){if(_0x596b8c[_0x14df('0x5c')]['id']){delete _0x596b8c[_0x14df('0x5c')]['id'];}return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x596b8c[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x41304f,null))[_0x14df('0x39')](function(_0xbbd4cd){if(_0xbbd4cd){_0x596b8c['body'][_0x14df('0x67')]=_0xbbd4cd['id'];return db['Disposition'][_0x14df('0x62')](_0x596b8c[_0x14df('0x5c')]);}})[_0x14df('0x39')](respondWithResult(_0x41304f,null))[_0x14df('0x2e')](handleError(_0x41304f,null));};exports['getDispositions']=function(_0x7aea32,_0x4b7d2a,_0x3764f9){var _0xbaf40a={'raw':![],'where':{}};var _0x29db74={};var _0x51897c={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x7aea32[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x4b7d2a,null))[_0x14df('0x39')](function(_0x55acf1){if(_0x55acf1){_0x29db74[_0x14df('0x44')]=_[_0x14df('0x46')](db[_0x14df('0x68')][_0x14df('0x69')]);_0x29db74[_0x14df('0x45')]=_['keys'](_0x7aea32[_0x14df('0x45')]);_0x29db74['filters']=_[_0x14df('0x48')](_0x29db74[_0x14df('0x44')],_0x29db74[_0x14df('0x45')]);_0xbaf40a['attributes']=_[_0x14df('0x48')](_0x29db74[_0x14df('0x44')],qs['fields'](_0x7aea32[_0x14df('0x45')][_0x14df('0x4a')]));_0xbaf40a[_0x14df('0x49')]=_0xbaf40a[_0x14df('0x49')]['length']?_0xbaf40a[_0x14df('0x49')]:_0x29db74[_0x14df('0x44')];if(!_0x7aea32[_0x14df('0x45')]['hasOwnProperty'](_0x14df('0x6a'))){_0xbaf40a[_0x14df('0x33')]=qs[_0x14df('0x33')](_0x7aea32[_0x14df('0x45')]['limit']);_0xbaf40a['offset']=qs[_0x14df('0x32')](_0x7aea32['query']['offset']);}_0xbaf40a[_0x14df('0x4c')]=qs['sort'](_0x7aea32[_0x14df('0x45')]['sort']);_0xbaf40a[_0x14df('0x4e')]=qs[_0x14df('0x47')](_[_0x14df('0x6b')](_0x7aea32[_0x14df('0x45')],_0x29db74['filters']));_0xbaf40a[_0x14df('0x4e')][_0x14df('0x67')]=_0x55acf1['id'];if(_0x7aea32[_0x14df('0x45')]['filter']){_0xbaf40a[_0x14df('0x4e')]=_[_0x14df('0x4f')](_0xbaf40a[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0xbaf40a[_0x14df('0x49')],function(_0x34cf7c){var _0x446f53={};_0x446f53[_0x34cf7c]={'$like':'%'+_0x7aea32[_0x14df('0x45')]['filter']+'%'};return _0x446f53;})});}_0xbaf40a=_[_0x14df('0x4f')]({},_0xbaf40a,_0x7aea32[_0x14df('0x52')]);return db[_0x14df('0x68')]['count']({'where':_0xbaf40a[_0x14df('0x4e')]})[_0x14df('0x39')](function(_0x2e2bef){_0x51897c['count']=_0x2e2bef;if(_0x7aea32[_0x14df('0x45')][_0x14df('0x53')]){_0xbaf40a[_0x14df('0x54')]=[{'all':!![]}];}return db[_0x14df('0x68')]['findAll'](_0xbaf40a);})['then'](function(_0x3ba5fb){_0x51897c[_0x14df('0x56')]=_0x3ba5fb;return _0x51897c;});}})[_0x14df('0x39')](respondWithFilteredResult(_0x4b7d2a,_0xbaf40a))['catch'](handleError(_0x4b7d2a,null));};exports[_0x14df('0x6c')]=function(_0xad5a69,_0x3114c3,_0x6427f1){return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0xad5a69['params']['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x3114c3,null))['then'](function(_0x1eb0c5){if(_0x1eb0c5){return _0x1eb0c5['removeDispositions'](_0xad5a69[_0x14df('0x45')][_0x14df('0x6d')]);}})['then'](respondWithStatusCode(_0x3114c3,null))['catch'](handleError(_0x3114c3,null));};exports[_0x14df('0x6e')]=function(_0xf6ffbb,_0x419e7c,_0x9bfa2e){if(_0xf6ffbb[_0x14df('0x5c')]['id']){delete _0xf6ffbb[_0x14df('0x5c')]['id'];}return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0xf6ffbb[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x419e7c,null))[_0x14df('0x39')](function(_0x3bb400){if(_0x3bb400){_0xf6ffbb[_0x14df('0x5c')][_0x14df('0x67')]=_0x3bb400['id'];return db['CannedAnswer']['create'](_0xf6ffbb[_0x14df('0x5c')]);}})[_0x14df('0x39')](respondWithResult(_0x419e7c,null))[_0x14df('0x2e')](handleError(_0x419e7c,null));};exports[_0x14df('0x6f')]=function(_0x544ae1,_0x3e4549,_0x11fcec){var _0x5e3769={'raw':![],'where':{}};var _0x449a7b={};var _0x8dce={'count':0x0,'rows':[]};return db[_0x14df('0x59')]['findOne']({'where':{'id':_0x544ae1['params']['id']}})['then'](handleEntityNotFound(_0x3e4549,null))[_0x14df('0x39')](function(_0x321e78){if(_0x321e78){_0x449a7b[_0x14df('0x44')]=_[_0x14df('0x46')](db[_0x14df('0x70')]['rawAttributes']);_0x449a7b[_0x14df('0x45')]=_['keys'](_0x544ae1[_0x14df('0x45')]);_0x449a7b[_0x14df('0x47')]=_[_0x14df('0x48')](_0x449a7b[_0x14df('0x44')],_0x449a7b[_0x14df('0x45')]);_0x5e3769[_0x14df('0x49')]=_[_0x14df('0x48')](_0x449a7b[_0x14df('0x44')],qs['fields'](_0x544ae1[_0x14df('0x45')]['fields']));_0x5e3769['attributes']=_0x5e3769[_0x14df('0x49')][_0x14df('0x5a')]?_0x5e3769[_0x14df('0x49')]:_0x449a7b['model'];if(!_0x544ae1['query'][_0x14df('0x4b')]('nolimit')){_0x5e3769[_0x14df('0x33')]=qs[_0x14df('0x33')](_0x544ae1[_0x14df('0x45')][_0x14df('0x33')]);_0x5e3769[_0x14df('0x32')]=qs[_0x14df('0x32')](_0x544ae1[_0x14df('0x45')]['offset']);}_0x5e3769[_0x14df('0x4c')]=qs[_0x14df('0x4d')](_0x544ae1[_0x14df('0x45')][_0x14df('0x4d')]);_0x5e3769[_0x14df('0x4e')]=qs[_0x14df('0x47')](_['pick'](_0x544ae1[_0x14df('0x45')],_0x449a7b[_0x14df('0x47')]));_0x5e3769[_0x14df('0x4e')][_0x14df('0x67')]=_0x321e78['id'];if(_0x544ae1[_0x14df('0x45')][_0x14df('0x51')]){_0x5e3769['where']=_[_0x14df('0x4f')](_0x5e3769[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0x5e3769[_0x14df('0x49')],function(_0x355248){var _0x216224={};_0x216224[_0x355248]={'$like':'%'+_0x544ae1[_0x14df('0x45')][_0x14df('0x51')]+'%'};return _0x216224;})});}_0x5e3769=_['merge']({},_0x5e3769,_0x544ae1[_0x14df('0x52')]);return db['CannedAnswer'][_0x14df('0x35')]({'where':_0x5e3769[_0x14df('0x4e')]})[_0x14df('0x39')](function(_0x5c028b){_0x8dce[_0x14df('0x35')]=_0x5c028b;if(_0x544ae1[_0x14df('0x45')][_0x14df('0x53')]){_0x5e3769[_0x14df('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x14df('0x55')](_0x5e3769);})[_0x14df('0x39')](function(_0x4d05e7){_0x8dce[_0x14df('0x56')]=_0x4d05e7;return _0x8dce;});}})[_0x14df('0x39')](respondWithFilteredResult(_0x3e4549,_0x5e3769))[_0x14df('0x2e')](handleError(_0x3e4549,null));};exports[_0x14df('0x71')]=function(_0x5c1dfb,_0x2562d3,_0x4933c3){return db['ChatWebsite'][_0x14df('0x5b')]({'where':{'id':_0x5c1dfb[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x2562d3,null))['then'](function(_0x500c34){if(_0x500c34){return _0x500c34[_0x14df('0x71')](_0x5c1dfb[_0x14df('0x45')][_0x14df('0x6d')]);}})[_0x14df('0x39')](respondWithStatusCode(_0x2562d3,null))['catch'](handleError(_0x2562d3,null));};exports[_0x14df('0x72')]=function(_0x2226d6,_0x1fe1fe,_0x58fc97){_0x2226d6[_0x14df('0x5c')]['sitepic']=_0x2226d6[_0x14df('0x73')][_0x14df('0x74')];return db[_0x14df('0x59')]['find']({'where':{'id':_0x2226d6['params']['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x1fe1fe,null))[_0x14df('0x39')](saveUpdates(_0x2226d6[_0x14df('0x5c')],null))['then'](respondWithResult(_0x1fe1fe,null))[_0x14df('0x2e')](handleError(_0x1fe1fe,null));};exports[_0x14df('0x75')]=function(_0x321416,_0x124c05,_0xff46c7){_0x321416[_0x14df('0x5c')]['agentAvatar']=_0x321416[_0x14df('0x73')][_0x14df('0x74')];return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x321416[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x124c05,null))[_0x14df('0x39')](saveUpdates(_0x321416[_0x14df('0x5c')],null))[_0x14df('0x39')](respondWithResult(_0x124c05,null))[_0x14df('0x2e')](handleError(_0x124c05,null));};exports[_0x14df('0x76')]=function(_0x6f0d34,_0x78134f,_0x20f64c){_0x6f0d34['body'][_0x14df('0x77')]=_0x6f0d34[_0x14df('0x73')][_0x14df('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x6f0d34[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x78134f,null))[_0x14df('0x39')](saveUpdates(_0x6f0d34[_0x14df('0x5c')],null))[_0x14df('0x39')](respondWithResult(_0x78134f,null))[_0x14df('0x2e')](handleError(_0x78134f,null));};exports[_0x14df('0x78')]=function(_0x110620,_0xc0ef75,_0x4fce1d){_0x110620['body'][_0x14df('0x79')]=_0x110620[_0x14df('0x73')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x110620['params']['id']}})[_0x14df('0x39')](handleEntityNotFound(_0xc0ef75,null))[_0x14df('0x39')](saveUpdates(_0x110620[_0x14df('0x5c')],null))[_0x14df('0x39')](respondWithResult(_0xc0ef75,null))[_0x14df('0x2e')](handleError(_0xc0ef75,null));};exports[_0x14df('0x7a')]=function(_0x3c92b0,_0x1b0fdb,_0x26d87a){var _0x463294=path[_0x14df('0x7b')](config['root'],'server/files/images/logos/default_logo.svg');var _0x44c3ca={'where':{'id':_0x3c92b0[_0x14df('0x57')]['id']},'attributes':['id',_0x14df('0x7c')],'raw':!![]};var _0x587da3=![];return require(_0x14df('0x1b'))[_0x14df('0x7d')]()['then'](function(_0x519f4c){if(_0x519f4c){_0x587da3=_0x519f4c[_0x14df('0x7e')];}})['then'](function(){return db['ChatWebsite'][_0x14df('0x5b')](_0x44c3ca);})[_0x14df('0x39')](handleEntityNotFound(_0x1b0fdb,null))['then'](function(_0x4772da){if(_0x4772da){if(!_[_0x14df('0x7f')](_0x4772da[_0x14df('0x7c')])){if(fs[_0x14df('0x80')](path[_0x14df('0x7b')](config['root'],'server/files/images/logos/',_0x4772da[_0x14df('0x7c')]))&&_0x587da3){_0x463294=path[_0x14df('0x7b')](config['root'],_0x14df('0x81'),_0x4772da[_0x14df('0x7c')]);}}return _0x1b0fdb[_0x14df('0x82')](_0x463294);}})[_0x14df('0x2e')](handleError(_0x1b0fdb,null));};exports[_0x14df('0x83')]=function(_0x1f5bff,_0x43bc76,_0xede63d){var _0x28ae6b=path[_0x14df('0x7b')](config['root'],_0x14df('0x84'));var _0xc47a87={'where':{'id':_0x1f5bff[_0x14df('0x57')]['id']},'attributes':['id',_0x14df('0x85')],'raw':!![]};return db[_0x14df('0x59')][_0x14df('0x5b')](_0xc47a87)[_0x14df('0x39')](handleEntityNotFound(_0x43bc76,null))[_0x14df('0x39')](function(_0x493238){if(_0x493238){if(!_[_0x14df('0x7f')](_0x493238[_0x14df('0x85')])){if(fs[_0x14df('0x80')](path[_0x14df('0x7b')](config[_0x14df('0x86')],_0x14df('0x87'),_0x493238['agentAvatar']))){_0x28ae6b=path[_0x14df('0x7b')](config[_0x14df('0x86')],_0x14df('0x87'),_0x493238[_0x14df('0x85')]);}}return _0x43bc76['download'](_0x28ae6b);}})[_0x14df('0x2e')](handleError(_0x43bc76,null));};exports[_0x14df('0x88')]=function(_0x45300d,_0x543b89,_0x47ff2a){var _0x3e0756=path[_0x14df('0x7b')](config[_0x14df('0x86')],'server/files/images/avatars/customer_avatar.png');var _0x39cb22={'where':{'id':_0x45300d['params']['id']},'attributes':['id',_0x14df('0x77'),_0x14df('0x89')],'raw':!![]};return db[_0x14df('0x59')][_0x14df('0x5b')](_0x39cb22)[_0x14df('0x39')](handleEntityNotFound(_0x543b89,null))[_0x14df('0x39')](function(_0x190a19){if(_0x190a19){if(!_['isNil'](_0x190a19[_0x14df('0x77')])){if(fs[_0x14df('0x80')](path[_0x14df('0x7b')](config[_0x14df('0x86')],_0x14df('0x87'),_0x190a19[_0x14df('0x77')]))&&_0x190a19[_0x14df('0x89')]){_0x3e0756=path['join'](config[_0x14df('0x86')],_0x14df('0x87'),_0x190a19['customerAvatar']);}}return _0x543b89[_0x14df('0x82')](_0x3e0756);}})[_0x14df('0x2e')](handleError(_0x543b89,null));};exports[_0x14df('0x8a')]=function(_0x3514e3,_0x472842,_0x5380f7){var _0x4b140a=path[_0x14df('0x7b')](config[_0x14df('0x86')],_0x14df('0x8b'));var _0x379612={'where':{'id':_0x3514e3[_0x14df('0x57')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x14df('0x5b')](_0x379612)['then'](handleEntityNotFound(_0x472842,null))[_0x14df('0x39')](function(_0x2eb27b){if(_0x2eb27b){if(!_['isNil'](_0x2eb27b[_0x14df('0x79')])){if(fs['existsSync'](path['join'](config[_0x14df('0x86')],_0x14df('0x87'),_0x2eb27b[_0x14df('0x79')]))){_0x4b140a=path['join'](config[_0x14df('0x86')],_0x14df('0x87'),_0x2eb27b[_0x14df('0x79')]);}}return _0x472842[_0x14df('0x82')](_0x4b140a);}})[_0x14df('0x2e')](handleError(_0x472842,null));};exports[_0x14df('0x8c')]=function(_0x1c041b,_0x291d58,_0x3a0b6b){var _0x3fd2e2=require('user-agent-parser');var _0x589782=new _0x3fd2e2();var _0x31732e=_0x589782[_0x14df('0x8d')](_0x1c041b[_0x14df('0x8e')]['user-agent'])[_0x14df('0x8f')]();var _0x54919b={'body':_0x1c041b[_0x14df('0x5c')],'channel':_0x14df('0x90')};var _0x250234=[];var _0x4a2b75=[];var _0x1d9196={};var _0x45ee9a=![];return db[_0x14df('0x91')][_0x14df('0x65')]()[_0x14df('0x39')](function(_0x4343a8){if(!_0x4343a8){throw new db[(_0x14df('0x92'))][(_0x14df('0x93'))]('no\x20available\x20attributes');}_0x250234=_[_0x14df('0x94')](_[_0x14df('0x46')](_0x4343a8),[_0x14df('0x95'),_0x14df('0x96')]);_0x4a2b75=_[_0x14df('0x94')](_[_0x14df('0x46')](_0x4343a8),[_0x14df('0x95'),_0x14df('0x96'),_0x14df('0x97'),_0x14df('0x98')]);if(_0x1c041b[_0x14df('0x5c')]['id']){delete _0x1c041b[_0x14df('0x5c')]['id'];}if(_[_0x14df('0x7f')](_0x1c041b['body'][_0x14df('0x99')])){throw new db[(_0x14df('0x92'))][(_0x14df('0x93'))](_0x14df('0x9a'));}if(_[_0x14df('0x7f')](_0x1c041b[_0x14df('0x5c')][_0x14df('0x5c')])||_0x1c041b['body']['body']===''){throw new db[(_0x14df('0x92'))]['ValidationError'](_0x14df('0x9b'));}if(_[_0x14df('0x7f')](_0x1c041b[_0x14df('0x5c')][_0x14df('0x9c')])){throw new db[(_0x14df('0x92'))][(_0x14df('0x93'))](_0x14df('0x9d')+_0x4a2b75);}if(!_[_0x14df('0x9e')](_0x4a2b75,_0x1c041b[_0x14df('0x5c')][_0x14df('0x9c')])){throw new db['Sequelize'][(_0x14df('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a2b75);}_0x1d9196[_0x1c041b[_0x14df('0x5c')][_0x14df('0x9c')]]=_0x1c041b[_0x14df('0x5c')][_0x14df('0x99')];})[_0x14df('0x39')](function(){return db[_0x14df('0x59')]['find']({'where':{'id':_0x1c041b[_0x14df('0x57')]['id']},'include':[{'model':db[_0x14df('0x9f')],'as':_0x14df('0xa0'),'include':[{'model':db[_0x14df('0x91')],'as':'Contacts','where':_0x1d9196,'limit':0x1,'order':[[_0x14df('0x96'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x14df('0xa1')}]});})[_0x14df('0x39')](handleEntityNotFound(_0x291d58,null))[_0x14df('0x39')](function(_0x5ebf36){if(_0x5ebf36&&_0x5ebf36[_0x14df('0xa0')]){_0x54919b[_0x14df('0xa2')]=_0x5ebf36;_0x54919b[_0x14df('0xa3')]=_0x5ebf36[_0x14df('0xa1')];_0x54919b[_0x14df('0xa4')]=_0x5ebf36[_0x14df('0xa0')];_0x54919b['applications']=_[_0x14df('0xa5')](_0x54919b['applications'],['priority'],['asc']);if(_0x54919b[_0x14df('0xa2')][_0x14df('0xa1')]){delete _0x54919b[_0x14df('0xa2')][_0x14df('0xa1')];}if(_0x54919b['account'][_0x14df('0xa0')]&&_0x54919b['account']['List'][_0x14df('0xa6')]['length']){return _0x54919b[_0x14df('0xa2')][_0x14df('0xa0')][_0x14df('0xa6')][0x0];}var _0x515873=_[_0x14df('0x1d')](_0x1c041b['body'],{'firstName':_0x1c041b[_0x14df('0x5c')]['from'],'ListId':_0x5ebf36['ListId']});_0x515873[_0x1c041b[_0x14df('0x5c')]['mapKey']]=_0x1c041b['body'][_0x14df('0x99')];return db['CmContact'][_0x14df('0x62')](_0x515873,{'fields':_0x250234,'raw':!![]});}})[_0x14df('0x39')](handleEntityNotFound(_0x291d58,null))['then'](function(_0x11377c){_0x54919b[_0x14df('0xa7')]=_0x11377c;var _0x3dd5ca=_0x1c041b[_0x14df('0x5c')][_0x14df('0xa8')];if(_0x1c041b['headers'][_0x14df('0xa9')]){_0x3dd5ca=_0x1c041b[_0x14df('0x8e')]['cf-connecting-ip'];}else if(_0x1c041b[_0x14df('0x8e')][_0x14df('0xaa')]){_0x3dd5ca=_['first'](_0x1c041b[_0x14df('0x8e')][_0x14df('0xaa')][_0x14df('0xab')](','));}if(_0x11377c){var _0x694d59={'ContactId':_0x11377c['id'],'ChatWebsiteId':_0x1c041b[_0x14df('0x57')]['id'],'from':(_0x11377c[_0x14df('0xac')]||'')+'\x20'+(_0x11377c[_0x14df('0xad')]||''),'customerIp':_0x3dd5ca,'customerPort':_0x1c041b[_0x14df('0x8e')][_0x14df('0xae')]?_0x1c041b[_0x14df('0x8e')][_0x14df('0xae')]:null,'referer':_0x1c041b['body'][_0x14df('0xaf')],'browserName':_0x31732e['browser'][_0x14df('0x3f')]&&_0x31732e[_0x14df('0xb0')][_0x14df('0xb1')]?util[_0x14df('0xb2')](_0x14df('0xb3'),_0x31732e['browser'][_0x14df('0x3f')],_0x31732e[_0x14df('0xb0')]['version']):_0x14df('0xb4'),'browserVersion':_0x31732e['browser'][_0x14df('0xb1')]||_0x14df('0xb4'),'osName':util[_0x14df('0xb2')](_0x14df('0xb3'),_0x31732e['os'][_0x14df('0x3f')],_0x31732e['os'][_0x14df('0xb1')]),'osVersion':_0x31732e['os'][_0x14df('0xb1')],'deviceModel':_0x31732e[_0x14df('0xb5')][_0x14df('0x44')]&&_0x31732e[_0x14df('0xb5')][_0x14df('0xb6')]?util['format'](_0x14df('0xb7'),_0x31732e[_0x14df('0xb5')]['model'],_0x31732e[_0x14df('0xb5')]['vendor'],_0x31732e['device'][_0x14df('0x43')]):null,'deviceVendor':_0x31732e[_0x14df('0xb5')][_0x14df('0xb6')],'deviceType':_0x31732e['device'][_0x14df('0x43')],'formData':JSON[_0x14df('0x28')](_0x1c041b[_0x14df('0x5c')])};var _0x52cb30={'ChatWebsiteId':_0x1c041b[_0x14df('0x57')]['id'],'closed':![]};if(_0x1c041b[_0x14df('0x5c')][_0x14df('0xb8')]){_0x52cb30[_0x14df('0xb8')]=_0x1c041b[_0x14df('0x5c')][_0x14df('0xb8')];return db[_0x14df('0xb9')][_0x14df('0x5b')]({'where':_0x52cb30})[_0x14df('0x39')](function(_0x217013){if(_0x217013){return[_0x217013,![]];}_0x694d59[_0x14df('0xb8')]=_0x1c041b['body']['threadId'];_0x694d59['externalUrl']=_0x1c041b[_0x14df('0x5c')][_0x14df('0xba')];return db[_0x14df('0xb9')][_0x14df('0x62')](_0x694d59)[_0x14df('0x39')](function(_0x27990d){return[_0x27990d,!![]];});});}_0x52cb30[_0x14df('0xbb')]=_0x11377c['id'];if(_0x1c041b[_0x14df('0x5c')][_0x14df('0xbc')]&&_0x1c041b[_0x14df('0x5c')]['interaction']['id']){_0x52cb30['id']=_0x1c041b[_0x14df('0x5c')][_0x14df('0xbc')]['id'];return db[_0x14df('0xb9')][_0x14df('0x5b')]({'where':_0x52cb30})[_0x14df('0x39')](function(_0x5eb127){if(_0x5eb127){return[_0x5eb127,![]];}return db[_0x14df('0xb9')]['create'](_0x694d59)[_0x14df('0x39')](function(_0x1aa0fa){return[_0x1aa0fa,!![]];});});}return db[_0x14df('0xb9')]['create'](_0x694d59)[_0x14df('0x39')](function(_0x2bf005){return[_0x2bf005,!![]];});}})[_0x14df('0xbd')](function(_0x8dacca,_0x2871b1){if(_0x8dacca){_0x45ee9a=_0x2871b1;if(!_0x2871b1){var _0x2a796e={'from':(_0x54919b['contact'][_0x14df('0xac')]||'')+'\x20'+(_0x54919b['contact']['lastName']||'')};if(_0x1c041b[_0x14df('0x5c')][_0x14df('0xb8')]&&_0x1c041b[_0x14df('0x5c')][_0x14df('0xbe')]&&_0x1c041b[_0x14df('0x5c')][_0x14df('0xb8')]!=_0x1c041b[_0x14df('0x5c')][_0x14df('0xbe')]){_0x2a796e[_0x14df('0xb8')]=_0x1c041b[_0x14df('0x5c')][_0x14df('0xbe')];}return _0x8dacca[_0x14df('0x64')](_0x2a796e);}else{return _0x8dacca;}}})['then'](function(_0x1a6a51){_0x54919b[_0x14df('0xbc')]=_0x1a6a51['get']({'plain':!![]});_0x54919b[_0x14df('0xbc')][_0x14df('0xbf')]=_0x45ee9a;if(_0x54919b[_0x14df('0xbc')][_0x14df('0xbf')]){if(_0x54919b['account'][_0x14df('0xc0')]){_0x54919b['applications']['push']({'id':0x0,'priority':_0x54919b['applications'][_0x14df('0x5a')]+0x1,'app':_0x14df('0xc1'),'appdata':_0x14df('0xc2'),'interval':'*,*,*,*'});}}return db[_0x14df('0xc3')][_0x14df('0x62')]({'body':_0x1c041b['body'][_0x14df('0x5c')],'ChatWebsiteId':_0x1c041b[_0x14df('0x57')]['id'],'ChatInteractionId':_0x1a6a51['id'],'direction':'in','ContactId':_0x54919b[_0x14df('0xa7')]['id'],'AttachmentId':_0x1c041b[_0x14df('0x5c')][_0x14df('0xc4')]});})[_0x14df('0x39')](function(_0x3e44c1){_0x54919b[_0x14df('0x2c')]=_0x3e44c1;if(_0x54919b['interaction'][_0x14df('0xc5')]){return db[_0x14df('0xc6')][_0x14df('0x5b')]({'attributes':['id','name'],'where':{'id':_0x54919b[_0x14df('0xbc')][_0x14df('0xc5')]}})[_0x14df('0x39')](function(_0x37a277){if(_0x37a277){_0x54919b[_0x14df('0xa3')][_0x14df('0xc7')]({'id':0x0,'priority':0x0,'app':_0x14df('0xc8'),'appdata':_0x37a277['name']+','+(_0x54919b[_0x14df('0xa2')][_0x14df('0xc9')]||0xa),'interval':'*,*,*,*'});_0x54919b[_0x14df('0xca')]=!![];}return respondWithRpcPromise('Start',_0x14df('0xcb'),_0x54919b);});}return respondWithRpcPromise(_0x14df('0xcc'),_0x14df('0xcb'),_0x54919b);})[_0x14df('0x39')](function(_0x51e676){respondWithRpcPromise(_0x14df('0xcd'),_0x14df('0xcd'),{'event':'notify','message':_0x51e676},client9002);return _0x51e676;})[_0x14df('0x39')](respondWithResult(_0x291d58,null))[_0x14df('0x2e')](handleError(_0x291d58,null));};exports[_0x14df('0xce')]=function(_0x3d57ff,_0x49264c,_0x58f8e8){var _0x572120,_0x334b38,_0x3b5084;var _0x513774=[];var _0x10113c=[];var _0x4f3a0b={};var _0x3fafdc=_0x3d57ff['files']||[];var _0x5bfe0a=[];var _0x359991;return db[_0x14df('0x91')][_0x14df('0x65')]()['then'](function(_0x434560){if(!_0x434560){throw new db[(_0x14df('0x92'))]['ValidationError'](_0x14df('0xcf'));}_0x10113c=_[_0x14df('0x94')](_['keys'](_0x434560),[_0x14df('0x95'),_0x14df('0x96')]);_0x513774=_['difference'](_['keys'](_0x434560),[_0x14df('0x95'),_0x14df('0x96'),_0x14df('0x97'),'ListId']);if(_0x3d57ff[_0x14df('0x5c')]['id']){delete _0x3d57ff['body']['id'];}if(_[_0x14df('0x7f')](_0x3d57ff[_0x14df('0x5c')][_0x14df('0x99')])){throw _0x49264c['status'](0x1f4)[_0x14df('0xd0')](new db[(_0x14df('0x92'))][(_0x14df('0x93'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x3d57ff[_0x14df('0x5c')][_0x14df('0x5c')])||_0x3d57ff[_0x14df('0x5c')][_0x14df('0x5c')]===''){throw _0x49264c['status'](0x1f4)[_0x14df('0xd0')](new db[(_0x14df('0x92'))][(_0x14df('0x93'))](_0x14df('0x9b')));}if(_['isNil'](_0x3d57ff[_0x14df('0x5c')][_0x14df('0xd1')])){throw _0x49264c[_0x14df('0x2f')](0x1f4)[_0x14df('0xd0')](new db[(_0x14df('0x92'))][(_0x14df('0x93'))](_0x14df('0xd2')+_0x513774));}if(!_['includes'](_0x513774,_0x3d57ff[_0x14df('0x5c')][_0x14df('0xd1')])){throw _0x49264c[_0x14df('0x2f')](0x1f4)[_0x14df('0xd0')](new db[(_0x14df('0x92'))][(_0x14df('0x93'))](_0x14df('0xd3')+_0x513774));}_0x4f3a0b[_0x3d57ff['body'][_0x14df('0xd1')]]=_0x3d57ff[_0x14df('0x5c')]['from'];})['then'](function(){return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x3d57ff['params']['id']},'include':[{'model':db['CmList'],'as':_0x14df('0xa0')},{'model':db[_0x14df('0xd4')],'as':_0x14df('0xd4')}]});})[_0x14df('0x39')](handleEntityNotFound(_0x49264c,null))['then'](function(_0x67061f){if(_0x67061f&&_0x67061f['List']){_0x334b38=_0x67061f;var _0x4ced57=_[_0x14df('0x1d')](_0x3d57ff[_0x14df('0x5c')],{'firstName':_0x3d57ff['body'][_0x14df('0x99')],'phone':_0x3d57ff[_0x14df('0x5c')][_0x14df('0x99')],'ListId':_0x67061f[_0x14df('0x98')]});_0x4ced57[_0x3d57ff[_0x14df('0x5c')]['mapKeyOffline']]=_0x3d57ff[_0x14df('0x5c')][_0x14df('0x99')];return db[_0x14df('0x91')][_0x14df('0xd5')]({'where':_0x4f3a0b,'defaults':_0x4ced57});}})[_0x14df('0xbd')](function(_0x26737a){if(_0x26737a){_0x3b5084=_0x26737a;var _0x3ac082=fs[_0x14df('0xd6')](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x14df('0xd7'));var _0x3ed4a6=ejs[_0x14df('0xd8')](_0x3ac082,{'body':_[_0x14df('0xd9')](_0x3d57ff[_0x14df('0x5c')][_0x14df('0x5c')]),'bodyTitle':_0x334b38[_0x14df('0xda')]});return db[_0x14df('0xdb')]['create']({'body':_0x3ed4a6,'ContactId':_0x26737a['id'],'ChatWebsiteId':_0x334b38['id']});}})[_0x14df('0x39')](function(_0x26957e){_0x359991=_0x26957e;if(_0x3fafdc[_0x14df('0x5a')]){var _0x1d3a72=_0x3fafdc[_0x14df('0x42')](function(_0x1289b1){return{'name':_0x1289b1['originalname'],'basename':_0x1289b1[_0x14df('0x74')],'type':_0x1289b1[_0x14df('0xdc')],'ChatOfflineMessageId':_0x26957e['id']};});_0x5bfe0a=_0x1d3a72[_0x14df('0x42')](_0x5af2df=>{var _0x46bacc={'filename':_0x5af2df['name'],'path':path['join'](config[_0x14df('0x86')],_0x14df('0xdd'),_0x14df('0xde'),'attachments',_0x14df('0xdf'),_0x5af2df[_0x14df('0xe0')])};return _0x46bacc;});if(!_0x334b38[_0x14df('0xe1')]){return db['sequelize'][_0x14df('0xe2')](function(_0x787901){return db[_0x14df('0xe3')][_0x14df('0xe4')](_0x1d3a72,{'transaction':_0x787901});});}}})['then'](function(){if(_0x359991){_0x572120=_0x359991;return db['MailAccount'][_0x14df('0xe5')]({'where':{'active':!![]},'include':[{'model':db[_0x14df('0xe6')],'as':'Smtp','raw':!![]}]});}})[_0x14df('0x39')](function(_0x69e78c){if(_0x69e78c&&_0x69e78c[_0x14df('0xe7')]&&_0x334b38['forwardOffline']&&_0x334b38[_0x14df('0xe8')]){var _0x250bde={'tls':{'rejectUnauthorized':![]}};if(_0x69e78c[_0x14df('0xe7')][_0x14df('0xe9')]){_0x250bde[_0x14df('0xe9')]=_0x69e78c[_0x14df('0xe7')][_0x14df('0xe9')];}else{_0x250bde[_0x14df('0xea')]=_0x69e78c[_0x14df('0xe7')][_0x14df('0xea')];_0x250bde['port']=_0x69e78c[_0x14df('0xe7')][_0x14df('0xeb')];_0x250bde[_0x14df('0xec')]=_0x69e78c[_0x14df('0xe7')][_0x14df('0xec')];}if(_0x69e78c[_0x14df('0xe7')]['authentication']){_0x250bde['auth']={'user':_0x69e78c[_0x14df('0xe7')]['user'],'pass':_0x69e78c[_0x14df('0xe7')]['pass']};}return respondWithRpcPromise('SendMail',_0x14df('0xed'),{'account':_0x250bde,'message':{'from':util[_0x14df('0xb2')](_0x14df('0xee'),_0x69e78c[_0x14df('0x3f')],_0x69e78c[_0x14df('0xef')]||_0x69e78c['Smtp'][_0x14df('0x5f')]),'to':_0x334b38[_0x14df('0xe8')],'subject':_0x334b38['offlineMessageSubject'],'html':_0x572120['body'],'attachments':_0x5bfe0a}},client9003)[_0x14df('0x39')](function(){return _0x572120;})['catch'](function(_0x3134f4){console[_0x14df('0x29')](_0x3134f4);});}})[_0x14df('0x39')](function(){if(_0x334b38&&_0x334b38[_0x14df('0xe1')]&&_0x334b38[_0x14df('0xf0')]){var _0x4a1faf=[];if(_0x3fafdc['length']){_0x4a1faf=_0x3fafdc[_0x14df('0x42')](function(_0x5fe528){return{'name':_0x5fe528[_0x14df('0xf1')],'basename':_0x5fe528[_0x14df('0x74')],'type':_0x5fe528[_0x14df('0xdc')],'ChatOfflineMessageId':_0x359991['id']};});}var _0x82de1c;if(!_['isNil'](_0x334b38[_0x14df('0xf2')])){var _0x5d321d=_[_0x14df('0x42')](_0x3d57ff[_0x14df('0x5c')],function(_0x2fc2c8){return _0x2fc2c8;});var _0x37da7c=_[_0x14df('0xf3')](_0x5d321d)[0x0];var _0x55cec0=_[_0x14df('0xf4')](_0x37da7c,function(_0xb19316){return _0xb19316;});_0x82de1c=_0x55cec0[0x1][_0x334b38[_0x14df('0xf2')]];}var _0x13294d={'from':_0x3b5084[_0x14df('0xef')],'firstName':_0x3b5084['firstName'],'lastName':_0x3b5084[_0x14df('0xad')],'mapKey':_0x14df('0xef'),'message':{'from':_0x3b5084['email'],'to':_0x334b38[_0x14df('0xd4')][_0x14df('0xef')],'cc':'','subject':_[_0x14df('0x7f')](_0x82de1c)?_0x334b38[_0x14df('0xf5')]:_0x82de1c,'messageId':'','sentAt':new Date(),'attach':_0x4a1faf[_0x14df('0x5a')],'attachments':_0x4a1faf,'originChannel':_0x14df('0xf6'),'ChatWebsiteId':_0x334b38['id'],'ChatOfflineMessageId':_0x572120['id'],'originTo':_0x334b38['MailAccount'][_0x14df('0xef')]},'body':_0x572120[_0x14df('0x5c')]};var _0x233323={'account':{'id':_0x334b38[_0x14df('0xf0')]},'body':_0x13294d,'log':_0x14df('0xf7')};return respondWithRpcPromise(_0x14df('0xf7'),_0x14df('0xf8'),_0x233323,client9001)[_0x14df('0x39')](function(){return _0x572120;})[_0x14df('0x2e')](function(_0x141b57){console[_0x14df('0x29')](_0x141b57);});}return;})[_0x14df('0x39')](function(){if(_0x572120){return _0x572120;}})[_0x14df('0x39')](respondWithResult(_0x49264c,null))[_0x14df('0x2e')](function(_0x5db858){console[_0x14df('0x29')](_0x14df('0x2e'),_0x5db858);for(var _0x111285 of _0x3fafdc){var _0x469934=path[_0x14df('0x7b')](config[_0x14df('0x86')],_0x14df('0xdd'),'files','attachments',_0x14df('0xdf'),_0x111285[_0x14df('0x74')]);fs_extra[_0x14df('0xf9')](_0x469934)[_0x14df('0x2e')](function(_0x5a84f6){console[_0x14df('0x29')](_0x14df('0xfa'),_0x469934,_0x5a84f6);});}});};exports[_0x14df('0xfb')]=function(_0x3ba3cf,_0x570203,_0x224f2b){return db[_0x14df('0xb9')][_0x14df('0x5b')]({'where':{'id':_0x3ba3cf[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x570203,null))[_0x14df('0x39')](function(_0x3f680b){if(_0x3f680b){return _0x3f680b['addInteraction'](_0x3ba3cf[_0x14df('0x5c')]['ids'],_[_0x14df('0xfc')](_0x3ba3cf[_0x14df('0x5c')],[_0x14df('0x6d'),'id'])||{});}})[_0x14df('0x39')](respondWithResult(_0x570203,null))[_0x14df('0x2e')](handleError(_0x570203,null));};exports['getInteractions']=function(_0x3af179,_0x5d00a3,_0x14bf99){var _0xff175c={'raw':![],'where':{}};var _0x1adfa8={};var _0x27c88b={'count':0x0,'rows':[]};return db[_0x14df('0x59')]['findOne']({'where':{'id':_0x3af179[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x5d00a3,null))[_0x14df('0x39')](function(_0x38648b){if(_0x38648b){_0x1adfa8[_0x14df('0x44')]=_[_0x14df('0x46')](db[_0x14df('0xb9')][_0x14df('0x69')]);_0x1adfa8[_0x14df('0x45')]=_[_0x14df('0x46')](_0x3af179[_0x14df('0x45')]);_0x1adfa8['filters']=_['intersection'](_0x1adfa8['model'],_0x1adfa8[_0x14df('0x45')]);_0xff175c[_0x14df('0x49')]=_[_0x14df('0x48')](_0x1adfa8[_0x14df('0x44')],qs[_0x14df('0x4a')](_0x3af179[_0x14df('0x45')][_0x14df('0x4a')]));_0xff175c['attributes']=_0xff175c[_0x14df('0x49')][_0x14df('0x5a')]?_0xff175c['attributes']:_0x1adfa8['model'];if(!_0x3af179['query']['hasOwnProperty']('nolimit')){_0xff175c['limit']=qs[_0x14df('0x33')](_0x3af179[_0x14df('0x45')]['limit']);_0xff175c[_0x14df('0x32')]=qs[_0x14df('0x32')](_0x3af179[_0x14df('0x45')]['offset']);}_0xff175c[_0x14df('0x4c')]=qs['sort'](_0x3af179[_0x14df('0x45')][_0x14df('0x4d')]);_0xff175c[_0x14df('0x4e')]=qs[_0x14df('0x47')](_[_0x14df('0x6b')](_0x3af179[_0x14df('0x45')],_0x1adfa8[_0x14df('0x47')]));_0xff175c[_0x14df('0x4e')]['ChatWebsiteId']=_0x38648b['id'];if(_0x3af179[_0x14df('0x45')][_0x14df('0x51')]){_0xff175c[_0x14df('0x4e')]=_['merge'](_0xff175c[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0xff175c[_0x14df('0x49')],function(_0x41c10e){var _0x10b186={};_0x10b186[_0x41c10e]={'$like':'%'+_0x3af179['query'][_0x14df('0x51')]+'%'};return _0x10b186;})});}_0xff175c=_[_0x14df('0x4f')]({},_0xff175c,_0x3af179['options']);return db[_0x14df('0xb9')][_0x14df('0x35')]({'where':_0xff175c[_0x14df('0x4e')]})['then'](function(_0x1bd659){_0x27c88b[_0x14df('0x35')]=_0x1bd659;if(_0x3af179['query'][_0x14df('0x53')]){_0xff175c[_0x14df('0x54')]=[{'model':db[_0x14df('0x91')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x14df('0x3f'),'fullname',_0x14df('0xfd')],'required':![]},{'model':db[_0x14df('0xfe')],'as':_0x14df('0xff'),'attributes':['id','name','color'],'where':_0x3af179[_0x14df('0x45')][_0x14df('0x100')]?{'id':_0x3af179[_0x14df('0x45')]['tag']}:undefined,'required':_0x3af179[_0x14df('0x45')]['tag']?!![]:![]}];}return db[_0x14df('0xb9')]['findAll'](_0xff175c);})[_0x14df('0x39')](function(_0x5ddb21){_0x27c88b[_0x14df('0x56')]=_0x5ddb21;return _0x27c88b;});}})['then'](respondWithFilteredResult(_0x5d00a3,_0xff175c))[_0x14df('0x2e')](handleError(_0x5d00a3,null));};function iftimePromise(_0x2a3a99,_0x3eb78f){return respondWithRpcPromise(_0x14df('0x101'),'getSnippet',{'command':_0x3eb78f[_0x14df('0x102')]?util[_0x14df('0xb2')]('iftime\x20%s,%s',_0x2a3a99[_0x14df('0x103')],_0x3eb78f[_0x14df('0x102')]):util['format'](_0x14df('0x104'),_0x2a3a99['interval'])},client9002)[_0x14df('0x39')](function(_0x47ade1){var _0x183b2f=_0x47ade1&&_0x47ade1[_0x14df('0x105')]('true')>=0x0?!![]:![];logger[_0x14df('0x24')](_0x14df('0x106'),_0x3eb78f['id'],_0x2a3a99['id'],_0x2a3a99[_0x14df('0x103')],_0x183b2f?_0x14df('0x107'):_0x14df('0x108'),_0x3eb78f[_0x14df('0x102')]?_0x3eb78f['timezone']:_0x14df('0x109'));return _0x183b2f;})[_0x14df('0x2e')](function(_0x112481){logger[_0x14df('0x29')](_0x14df('0x106'),_0x3eb78f['id'],_0x2a3a99['id'],_0x2a3a99[_0x14df('0x103')],util['inspect'](_0x112481,{'showHidden':![],'depth':null}),_0x3eb78f[_0x14df('0x102')]?_0x3eb78f[_0x14df('0x102')]:_0x14df('0x109'));return![];});}exports[_0x14df('0x10a')]=function(_0x2e846d,_0x4f0f9c,_0x2aa76e){var _0x40ab78=0x0;var _0x31b7c3=0x0;var _0x1b695a=![];var _0x48efec;var _0x2790d7;return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x2e846d[_0x14df('0x57')]['id']},'include':[{'model':db[_0x14df('0x10b')],'as':_0x14df('0x10b'),'include':[{'model':db['Interval'],'as':_0x14df('0x10c'),'attributes':['id',_0x14df('0x103')],'raw':!![]}]}]})[_0x14df('0x39')](handleEntityNotFound(_0x4f0f9c,null))['then'](function(_0x368286){if(_0x368286){_0x48efec=_0x368286;return _0x368286[_0x14df('0x10d')]({'raw':!![]});}})[_0x14df('0x39')](function(_0x172b45){if(_0x48efec){if(_0x172b45){_0x2790d7=_0x172b45;}}return require(_0x14df('0x1b'))[_0x14df('0x7d')]();})['then'](function(_0x424ee1){if(_0x424ee1){_0x31b7c3=_0x424ee1['virtual'];_0x1b695a=_0x424ee1[_0x14df('0x7e')];}})[_0x14df('0x39')](function(){return db[_0x14df('0xb9')][_0x14df('0x35')]({'where':{'closed':![]}});})[_0x14df('0x39')](function(_0x2615ee){_0x40ab78=_0x2615ee;if(_0x31b7c3&&_0x2615ee>_0x31b7c3){return db[_0x14df('0x10e')][_0x14df('0xe5')]({'where':{'id':0x1}})[_0x14df('0x39')](function(_0x31ef7c){if(_0x31ef7c){_0x31ef7c['increment']('chatLicenseExceeded');}});}})[_0x14df('0x39')](function(){if(_0x48efec[_0x14df('0x10b')]&&_0x48efec[_0x14df('0x10b')][_0x14df('0x10c')]){var _0x13339e=[];for(var _0x3b7e28=0x0;_0x3b7e28<_0x48efec[_0x14df('0x10b')][_0x14df('0x10c')][_0x14df('0x5a')];_0x3b7e28++){var _0x2d09de=_0x48efec[_0x14df('0x10b')][_0x14df('0x10c')][_0x3b7e28][_0x14df('0x3b')]({'plain':!![]});_0x13339e['push'](iftimePromise(_0x2d09de,_0x48efec));}return BPromise[_0x14df('0x10f')](_0x13339e)[_0x14df('0x39')](function(_0x524431){return _['some'](_0x524431);});}else{return!![];}})[_0x14df('0x39')](function(_0x23f484){var _0x187fcd=fs['readFileSync'](path[_0x14df('0x7b')](config[_0x14df('0x86')],'server/files/chat/iframe.ejs'),_0x14df('0xd7'));var _0x1f1b60={'remote':_0x48efec[_0x14df('0x110')],'query':querystring['stringify'](_[_0x14df('0x4f')](_0x48efec[_0x14df('0x3b')]({'plain':!![]}),{'customerIp':_0x2e846d[_0x14df('0x8e')][_0x14df('0xaa')]||_0x2e846d[_0x14df('0x8e')][_0x14df('0x111')]||_0x2e846d[_0x14df('0x112')][_0x14df('0x113')]||_0x2e846d['ip'],'referer':_0x2e846d[_0x14df('0x8e')][_0x14df('0xaf')],'openedInteractions':_0x40ab78,'maxInteractions':_0x31b7c3,'virtual':_0x1b695a[_0x14df('0x114')],'online':_0x23f484,'custom':_0x1b695a}))[_0x14df('0x115')](/'/g,'\x5c\x27')};_0x4f0f9c['send'](ejs['render'](Mustache[_0x14df('0xd8')](_0x187fcd,_0x1f1b60),{'proactiveActions':_0x2790d7,'alignment':_0x48efec[_0x14df('0x116')],'verticalAlignment':_0x48efec[_0x14df('0x117')],'div_color':_0x48efec[_0x14df('0x118')],'text_color':_0x48efec[_0x14df('0x119')],'button_color':_0x48efec['color_button'],'background_color':_0x48efec[_0x14df('0x11a')]}));})[_0x14df('0x2e')](handleError(_0x4f0f9c,null));};exports[_0x14df('0x11b')]=function(_0x150456,_0x142d8e,_0x59f540){return db[_0x14df('0x59')]['findOne']({'where':{'id':_0x150456['params']['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x142d8e,null))['then'](function(_0x2b4bd7){if(_0x2b4bd7){return db[_0x14df('0x11c')][_0x14df('0xe2')](function(_0x284025){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x150456[_0x14df('0x57')]['id']},'transaction':_0x284025})[_0x14df('0x39')](function(_0x2ae6c1){var _0xf8048e=_[_0x14df('0x42')](_0x150456[_0x14df('0x5c')],function(_0x3afc99){_0x3afc99['ChatWebsiteId']=_0x150456[_0x14df('0x57')]['id'];return _0x3afc99;});return db[_0x14df('0x11d')]['bulkCreate'](_0xf8048e,{'transaction':_0x284025});});})[_0x14df('0x39')](function(){return db[_0x14df('0x11d')][_0x14df('0x11e')]({'where':{'ChatWebsiteId':_0x150456['params']['id']},'order':_0x14df('0x11f')});});}})[_0x14df('0x39')](respondWithResult(_0x142d8e,null))['catch'](handleError(_0x142d8e,null));};exports['getApplications']=function(_0x2d2f60,_0x323edc,_0xa1f7ff){var _0x2f8c7e={};var _0x3c0814={};var _0x180a2d;var _0x401960;return db[_0x14df('0x59')][_0x14df('0xe5')]({'where':{'id':_0x2d2f60['params']['id']}})['then'](handleEntityNotFound(_0x323edc,null))[_0x14df('0x39')](function(_0x2c9acf){if(_0x2c9acf){_0x180a2d=_0x2c9acf;_0x3c0814[_0x14df('0x44')]=_[_0x14df('0x46')](db[_0x14df('0x11d')][_0x14df('0x69')]);_0x3c0814[_0x14df('0x45')]=_[_0x14df('0x46')](_0x2d2f60[_0x14df('0x45')]);_0x3c0814[_0x14df('0x47')]=_[_0x14df('0x48')](_0x3c0814['model'],_0x3c0814[_0x14df('0x45')]);_0x2f8c7e[_0x14df('0x49')]=_[_0x14df('0x48')](_0x3c0814[_0x14df('0x44')],qs[_0x14df('0x4a')](_0x2d2f60[_0x14df('0x45')][_0x14df('0x4a')]));_0x2f8c7e[_0x14df('0x49')]=_0x2f8c7e[_0x14df('0x49')][_0x14df('0x5a')]?_0x2f8c7e[_0x14df('0x49')]:_0x3c0814['model'];_0x2f8c7e['order']=qs[_0x14df('0x4d')](_0x2d2f60[_0x14df('0x45')]['sort']);_0x2f8c7e[_0x14df('0x4e')]=qs[_0x14df('0x47')](_[_0x14df('0x6b')](_0x2d2f60['query'],_0x3c0814[_0x14df('0x47')]));if(_0x2d2f60[_0x14df('0x45')][_0x14df('0x51')]){_0x2f8c7e[_0x14df('0x4e')]=_[_0x14df('0x4f')](_0x2f8c7e[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0x2f8c7e[_0x14df('0x49')],function(_0x45e983){var _0x3f0457={};_0x3f0457[_0x45e983]={'$like':'%'+_0x2d2f60[_0x14df('0x45')][_0x14df('0x51')]+'%'};return _0x3f0457;})});}_0x2f8c7e=_[_0x14df('0x4f')]({},_0x2f8c7e,_0x2d2f60[_0x14df('0x52')]);return _0x180a2d[_0x14df('0x120')](_0x2f8c7e);}})['then'](function(_0x48a6b5){if(_0x48a6b5){_0x401960=_0x48a6b5[_0x14df('0x5a')];if(!_0x2d2f60[_0x14df('0x45')]['hasOwnProperty'](_0x14df('0x6a'))){_0x2f8c7e[_0x14df('0x33')]=qs[_0x14df('0x33')](_0x2d2f60[_0x14df('0x45')][_0x14df('0x33')]);_0x2f8c7e[_0x14df('0x32')]=qs['offset'](_0x2d2f60['query']['offset']);}return _0x180a2d['getApplications'](_0x2f8c7e);}})[_0x14df('0x39')](function(_0x3aa358){if(_0x3aa358){return _0x3aa358?{'count':_0x401960,'rows':_0x3aa358}:null;}})[_0x14df('0x39')](respondWithResult(_0x323edc,null))[_0x14df('0x2e')](handleError(_0x323edc,null));};exports[_0x14df('0x121')]=function(_0x56c0d2,_0x3ab4f9,_0x4e5cc4){return db[_0x14df('0x122')][_0x14df('0x5b')]({'where':{'id':_0x56c0d2[_0x14df('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ab4f9,null))[_0x14df('0x39')](function(_0x5dda00){if(_0x5dda00){return _0x5dda00[_0x14df('0x121')](_0x56c0d2[_0x14df('0x5c')][_0x14df('0x6d')],_[_0x14df('0xfc')](_0x56c0d2['body'],[_0x14df('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x3ab4f9,null))[_0x14df('0x2e')](handleError(_0x3ab4f9,null));};exports['getProactiveActions']=function(_0x293fb4,_0x94bb05,_0x1729c9){var _0xad9eb9={};var _0x2b539a={};var _0x22d9fd;var _0x4e8921;return db[_0x14df('0x59')][_0x14df('0xe5')]({'where':{'id':_0x293fb4['params']['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x94bb05,null))[_0x14df('0x39')](function(_0x5d2f30){if(_0x5d2f30){_0x22d9fd=_0x5d2f30;_0x2b539a[_0x14df('0x44')]=_['keys'](db[_0x14df('0x123')][_0x14df('0x69')]);_0x2b539a[_0x14df('0x45')]=_['keys'](_0x293fb4[_0x14df('0x45')]);_0x2b539a[_0x14df('0x47')]=_[_0x14df('0x48')](_0x2b539a[_0x14df('0x44')],_0x2b539a[_0x14df('0x45')]);_0xad9eb9[_0x14df('0x49')]=_[_0x14df('0x48')](_0x2b539a[_0x14df('0x44')],qs['fields'](_0x293fb4['query'][_0x14df('0x4a')]));_0xad9eb9[_0x14df('0x49')]=_0xad9eb9[_0x14df('0x49')][_0x14df('0x5a')]?_0xad9eb9[_0x14df('0x49')]:_0x2b539a[_0x14df('0x44')];_0xad9eb9[_0x14df('0x4c')]=qs[_0x14df('0x4d')](_0x293fb4[_0x14df('0x45')][_0x14df('0x4d')]);_0xad9eb9['where']=qs[_0x14df('0x47')](_[_0x14df('0x6b')](_0x293fb4[_0x14df('0x45')],_0x2b539a[_0x14df('0x47')]));if(_0x293fb4[_0x14df('0x45')][_0x14df('0x51')]){_0xad9eb9[_0x14df('0x4e')]=_['merge'](_0xad9eb9[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0xad9eb9[_0x14df('0x49')],function(_0x29a518){var _0x4f6251={};_0x4f6251[_0x29a518]={'$like':'%'+_0x293fb4[_0x14df('0x45')][_0x14df('0x51')]+'%'};return _0x4f6251;})});}_0xad9eb9=_[_0x14df('0x4f')]({},_0xad9eb9,_0x293fb4[_0x14df('0x52')]);return _0x22d9fd['getProactiveActions'](_0xad9eb9);}})[_0x14df('0x39')](function(_0x294a03){if(_0x294a03){_0x4e8921=_0x294a03['length'];if(!_0x293fb4[_0x14df('0x45')]['hasOwnProperty'](_0x14df('0x6a'))){_0xad9eb9[_0x14df('0x33')]=qs['limit'](_0x293fb4[_0x14df('0x45')][_0x14df('0x33')]);_0xad9eb9['offset']=qs[_0x14df('0x32')](_0x293fb4[_0x14df('0x45')][_0x14df('0x32')]);}return _0x22d9fd[_0x14df('0x10d')](_0xad9eb9);}})[_0x14df('0x39')](function(_0x420d22){if(_0x420d22){return _0x420d22?{'count':_0x4e8921,'rows':_0x420d22}:null;}})[_0x14df('0x39')](respondWithResult(_0x94bb05,null))[_0x14df('0x2e')](handleError(_0x94bb05,null));};exports[_0x14df('0x124')]=function(_0x47ffe9,_0x4cc325,_0x412d37){var _0x3f5e8b=_0x47ffe9[_0x14df('0x45')][_0x14df('0x125')]===_0x14df('0x126')?'offlineForm':_0x14df('0x127');return db[_0x14df('0x59')][_0x14df('0x5b')]({'attributes':['id',_0x3f5e8b],'where':{'id':_0x47ffe9[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x4cc325,null))['then'](function(_0x19e207){if(_0x19e207){var _0x540b2f=_0x19e207[_0x3f5e8b];var _0x585300=_0x540b2f&&_0x540b2f['items']?_0x540b2f[_0x14df('0x128')]:[];_0x4cc325[_0x14df('0xd0')]({'fromKey':_[_0x14df('0x7f')](_0x540b2f['fromKey'])?undefined:_0x540b2f[_0x14df('0x129')],'count':_0x585300[_0x14df('0x5a')],'rows':_0x585300});}})['catch'](handleError(_0x4cc325,null));};exports[_0x14df('0x12a')]=function(_0x7263c,_0x5485fc,_0x18b23d){var _0xce4053={'raw':![],'where':{}};var _0x329e19={};var _0x4c95e0={'count':0x0,'rows':[]};return db[_0x14df('0x59')][_0x14df('0xe5')]({'where':{'id':_0x7263c[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x5485fc,null))[_0x14df('0x39')](function(_0x1b82aa){if(_0x1b82aa){_0x329e19['model']=_['keys'](db[_0x14df('0xdb')][_0x14df('0x69')]);_0x329e19[_0x14df('0x45')]=_[_0x14df('0x46')](_0x7263c[_0x14df('0x45')]);_0x329e19[_0x14df('0x47')]=_[_0x14df('0x48')](_0x329e19[_0x14df('0x44')],_0x329e19[_0x14df('0x45')]);_0xce4053[_0x14df('0x49')]=_[_0x14df('0x48')](_0x329e19['model'],qs[_0x14df('0x4a')](_0x7263c[_0x14df('0x45')][_0x14df('0x4a')]));_0xce4053[_0x14df('0x49')]=_0xce4053[_0x14df('0x49')]['length']?_0xce4053['attributes']:_0x329e19[_0x14df('0x44')];if(!_0x7263c[_0x14df('0x45')]['hasOwnProperty'](_0x14df('0x6a'))){_0xce4053['limit']=qs['limit'](_0x7263c[_0x14df('0x45')][_0x14df('0x33')]);_0xce4053[_0x14df('0x32')]=qs[_0x14df('0x32')](_0x7263c['query'][_0x14df('0x32')]);}_0xce4053[_0x14df('0x4c')]=qs[_0x14df('0x4d')](_0x7263c['query']['sort']);_0xce4053['where']=qs[_0x14df('0x47')](_['pick'](_0x7263c[_0x14df('0x45')],_0x329e19[_0x14df('0x47')]));_0xce4053[_0x14df('0x4e')][_0x14df('0x67')]=_0x1b82aa['id'];if(_0x7263c[_0x14df('0x45')][_0x14df('0x51')]){_0xce4053[_0x14df('0x4e')]=_[_0x14df('0x4f')](_0xce4053['where'],{'$or':_[_0x14df('0x42')](_0xce4053[_0x14df('0x49')],function(_0x3027c8){var _0x427e5e={};_0x427e5e[_0x3027c8]={'$like':'%'+_0x7263c[_0x14df('0x45')][_0x14df('0x51')]+'%'};return _0x427e5e;})});}_0xce4053=_[_0x14df('0x4f')]({},_0xce4053,_0x7263c['options']);return db[_0x14df('0xdb')][_0x14df('0x35')]({'where':_0xce4053[_0x14df('0x4e')]})[_0x14df('0x39')](function(_0xf0db96){_0x4c95e0[_0x14df('0x35')]=_0xf0db96;if(_0x7263c[_0x14df('0x45')][_0x14df('0x53')]){_0xce4053[_0x14df('0x54')]=[{'all':!![]}];}else{_0xce4053[_0x14df('0x54')]=[{'model':db[_0x14df('0x91')],'as':'Contact','required':![]},{'model':db[_0x14df('0xe3')],'as':_0x14df('0x12b'),'required':![]}];}return db[_0x14df('0xdb')]['findAll'](_0xce4053);})[_0x14df('0x39')](function(_0xb8a7ed){_0x4c95e0[_0x14df('0x56')]=_0xb8a7ed;return _0x4c95e0;});}})[_0x14df('0x39')](respondWithFilteredResult(_0x5485fc,_0xce4053))[_0x14df('0x2e')](handleError(_0x5485fc,null));};exports[_0x14df('0x12c')]=function(_0x3d5912,_0x5c8958,_0x36cad4){return db[_0x14df('0x59')][_0x14df('0x5b')]({'where':{'id':_0x3d5912[_0x14df('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c8958,null))[_0x14df('0x39')](function(_0x1cee9d){if(_0x1cee9d){return _0x1cee9d['addAgents'](_0x3d5912['body'][_0x14df('0x6d')],_['omit'](_0x3d5912[_0x14df('0x5c')],[_0x14df('0x6d'),'id'])||{})[_0x14df('0xbd')](function(_0x436203){for(var _0x15c6e2=0x0;_0x15c6e2<_0x3d5912['body'][_0x14df('0x6d')]['length'];_0x15c6e2+=0x1){socket['emit'](_0x14df('0x12d'),{'UserId':Number(_0x3d5912[_0x14df('0x5c')][_0x14df('0x6d')][_0x15c6e2]),'ChatWebsiteId':Number(_0x3d5912[_0x14df('0x57')]['id'])});}return _0x436203;});}})[_0x14df('0x39')](respondWithResult(_0x5c8958,null))['catch'](handleError(_0x5c8958,null));};exports['removeAgents']=function(_0x1da824,_0x2b48ef,_0x278315){return db['ChatWebsite']['find']({'where':{'id':_0x1da824[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x2b48ef,null))[_0x14df('0x39')](function(_0x99de5a){if(_0x99de5a){return _0x99de5a[_0x14df('0x12e')](_0x1da824[_0x14df('0x45')][_0x14df('0x6d')])[_0x14df('0x39')](function(){if(_[_0x14df('0x12f')](_0x1da824[_0x14df('0x45')][_0x14df('0x6d')])){for(var _0x3a15a7=0x0;_0x3a15a7<_0x1da824[_0x14df('0x45')][_0x14df('0x6d')][_0x14df('0x5a')];_0x3a15a7+=0x1){socket[_0x14df('0x130')](_0x14df('0x131'),{'UserId':Number(_0x1da824[_0x14df('0x45')]['ids'][_0x3a15a7]),'ChatWebsiteId':Number(_0x1da824[_0x14df('0x57')]['id'])});}}else{socket[_0x14df('0x130')](_0x14df('0x131'),{'UserId':Number(_0x1da824[_0x14df('0x45')][_0x14df('0x6d')]),'ChatWebsiteId':Number(_0x1da824[_0x14df('0x57')]['id'])});}});}})[_0x14df('0x39')](respondWithStatusCode(_0x2b48ef,null))['catch'](handleError(_0x2b48ef,null));};exports[_0x14df('0x132')]=function(_0x24d5d5,_0x20e462,_0x13ed94){var _0x3a5779={};var _0x3851b5={};var _0x3756f5;var _0x51ad5d;return db[_0x14df('0x59')]['findOne']({'where':{'id':_0x24d5d5[_0x14df('0x57')]['id']}})[_0x14df('0x39')](handleEntityNotFound(_0x20e462,null))[_0x14df('0x39')](function(_0x7f9dcc){if(_0x7f9dcc){_0x3756f5=_0x7f9dcc;_0x3851b5[_0x14df('0x44')]=_[_0x14df('0x46')](db[_0x14df('0xc6')][_0x14df('0x69')]);_0x3851b5[_0x14df('0x45')]=_[_0x14df('0x46')](_0x24d5d5[_0x14df('0x45')]);_0x3851b5[_0x14df('0x47')]=_[_0x14df('0x48')](_0x3851b5[_0x14df('0x44')],_0x3851b5[_0x14df('0x45')]);_0x3a5779[_0x14df('0x49')]=_[_0x14df('0x48')](_0x3851b5[_0x14df('0x44')],qs[_0x14df('0x4a')](_0x24d5d5[_0x14df('0x45')]['fields']));_0x3a5779[_0x14df('0x49')]=_0x3a5779[_0x14df('0x49')][_0x14df('0x5a')]?_0x3a5779[_0x14df('0x49')]:_0x3851b5['model'];_0x3a5779[_0x14df('0x4c')]=qs[_0x14df('0x4d')](_0x24d5d5[_0x14df('0x45')][_0x14df('0x4d')]);_0x3a5779['where']=qs['filters'](_[_0x14df('0x6b')](_0x24d5d5['query'],_0x3851b5[_0x14df('0x47')]));if(_0x24d5d5[_0x14df('0x45')]['filter']){_0x3a5779[_0x14df('0x4e')]=_[_0x14df('0x4f')](_0x3a5779[_0x14df('0x4e')],{'$or':_[_0x14df('0x42')](_0x3a5779[_0x14df('0x49')],function(_0x5cfdd1){var _0x1bd704={};_0x1bd704[_0x5cfdd1]={'$like':'%'+_0x24d5d5[_0x14df('0x45')][_0x14df('0x51')]+'%'};return _0x1bd704;})});}_0x3a5779=_[_0x14df('0x4f')]({},_0x3a5779,_0x24d5d5[_0x14df('0x52')]);return _0x3756f5['getAgents'](_0x3a5779);}})[_0x14df('0x39')](function(_0xa42707){if(_0xa42707){_0x51ad5d=_0xa42707[_0x14df('0x5a')];if(!_0x24d5d5['query'][_0x14df('0x4b')](_0x14df('0x6a'))){_0x3a5779[_0x14df('0x33')]=qs[_0x14df('0x33')](_0x24d5d5[_0x14df('0x45')]['limit']);_0x3a5779[_0x14df('0x32')]=qs['offset'](_0x24d5d5['query'][_0x14df('0x32')]);}return _0x3756f5['getAgents'](_0x3a5779);}})[_0x14df('0x39')](function(_0x5a5fa7){if(_0x5a5fa7){return _0x5a5fa7?{'count':_0x51ad5d,'rows':_0x5a5fa7}:null;}})[_0x14df('0x39')](respondWithResult(_0x20e462,null))[_0x14df('0x2e')](handleError(_0x20e462,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 9c565d4..3832bf3 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 _0x9ef8=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x28a8d0,_0x257510){var _0x87bd45=function(_0x2eecc0){while(--_0x2eecc0){_0x28a8d0['push'](_0x28a8d0['shift']());}};_0x87bd45(++_0x257510);}(_0x9ef8,0x17f));var _0x89ef=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x9ef8[_0x35885a];return _0xe86249;};'use strict';var EventEmitter=require(_0x89ef('0x0'));var ChatWebsite=require(_0x89ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x89ef('0x2')](0x0);var events={'afterCreate':_0x89ef('0x3'),'afterUpdate':_0x89ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c43bc){return function(_0x3797b4,_0x552626,_0x51dada){ChatWebsiteEvents['emit'](_0x1c43bc+':'+_0x3797b4['id'],_0x3797b4);ChatWebsiteEvents[_0x89ef('0x5')](_0x1c43bc,_0x3797b4);_0x51dada(null);};}for(var e in events){if(events[_0x89ef('0x6')](e)){var event=events[e];ChatWebsite[_0x89ef('0x7')](e,emitEvent(event));}}module[_0x89ef('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x615a=['exports','events','ChatWebsite','save','update','remove','emit','hook'];(function(_0x247d83,_0x3d9584){var _0x17bab4=function(_0x34fd5e){while(--_0x34fd5e){_0x247d83['push'](_0x247d83['shift']());}};_0x17bab4(++_0x3d9584);}(_0x615a,0x119));var _0xa615=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x615a[_0x18a81a];return _0x114027;};'use strict';var EventEmitter=require(_0xa615('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa615('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa615('0x2'),'afterUpdate':_0xa615('0x3'),'afterDestroy':_0xa615('0x4')};function emitEvent(_0x11fd6e){return function(_0x52ae35,_0x1d9a38,_0x1463be){ChatWebsiteEvents['emit'](_0x11fd6e+':'+_0x52ae35['id'],_0x52ae35);ChatWebsiteEvents[_0xa615('0x5')](_0x11fd6e,_0x52ae35);_0x1463be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xa615('0x6')](e,emitEvent(event));}}module[_0xa615('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 159481e..061747b 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 _0x39f2=['util','../../config/logger','moment','request-promise','path','../../config/environment','define','ChatWebsite','chat_websites','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39f2,0x15d));var _0x239f=function(_0x235fae,_0xea3869){_0x235fae=_0x235fae-0x0;var _0x221dc8=_0x39f2[_0x235fae];return _0x221dc8;};'use strict';var _=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var logger=require(_0x239f('0x2'))('api');var moment=require(_0x239f('0x3'));var BPromise=require('bluebird');var rp=require(_0x239f('0x4'));var fs=require('fs');var path=require(_0x239f('0x5'));var rimraf=require('rimraf');var config=require(_0x239f('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x39f0aa,_0x362c9a){return _0x39f0aa[_0x239f('0x7')](_0x239f('0x8'),attributes,{'tableName':_0x239f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e00=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatWebsite','chat_websites'];(function(_0x41c347,_0x2e1955){var _0x593ac1=function(_0x38b03e){while(--_0x38b03e){_0x41c347['push'](_0x41c347['shift']());}};_0x593ac1(++_0x2e1955);}(_0x5e00,0x152));var _0x05e0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5e00[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x05e0('0x0'));var util=require(_0x05e0('0x1'));var logger=require(_0x05e0('0x2'))(_0x05e0('0x3'));var moment=require(_0x05e0('0x4'));var BPromise=require(_0x05e0('0x5'));var rp=require(_0x05e0('0x6'));var fs=require('fs');var path=require(_0x05e0('0x7'));var rimraf=require(_0x05e0('0x8'));var config=require(_0x05e0('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x56caac,_0xd1f4b6){return _0x56caac[_0x05e0('0xa')](_0x05e0('0xb'),attributes,{'tableName':_0x05e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index d387646..b5c61c1 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 _0x5584=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5584,0x1c7));var _0x4558=function(_0x57f0a9,_0xcd6730){_0x57f0a9=_0x57f0a9-0x0;var _0x1f229a=_0x5584[_0x57f0a9];return _0x1f229a;};'use strict';var _=require(_0x4558('0x0'));var util=require(_0x4558('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4558('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4558('0x3'))['db'];var utils=require(_0x4558('0x4'));var logger=require(_0x4558('0x5'))(_0x4558('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4558('0x7')]['http']({'port':0x232a});config[_0x4558('0x8')]=_[_0x4558('0x9')](config[_0x4558('0x8')],{'host':_0x4558('0xa'),'port':0x18eb});var socket=require(_0x4558('0xb'))(new Redis(config['redis']));require(_0x4558('0xc'))['register'](socket);function respondWithRpcPromise(_0x28e455,_0x5b5c3c,_0x275aad){return new BPromise(function(_0x559d2e,_0x4c53e2){return client[_0x4558('0xd')](_0x28e455,_0x275aad)[_0x4558('0xe')](function(_0x364887){logger[_0x4558('0xf')](_0x4558('0x10'),_0x5b5c3c,_0x4558('0x11'));logger[_0x4558('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5b5c3c,_0x4558('0x11'),JSON[_0x4558('0x13')](_0x364887));if(_0x364887['error']){if(_0x364887[_0x4558('0x14')][_0x4558('0x15')]===0x1f4){logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x364887[_0x4558('0x14')][_0x4558('0x16')]);return _0x4c53e2(_0x364887[_0x4558('0x14')][_0x4558('0x16')]);}logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x364887[_0x4558('0x14')]['message']);return _0x559d2e(_0x364887[_0x4558('0x14')][_0x4558('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5b5c3c,_0x4558('0x11'));_0x559d2e(_0x364887[_0x4558('0x17')][_0x4558('0x16')]);}})[_0x4558('0x18')](function(_0x3cbd6b){logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x3cbd6b);_0x4c53e2(_0x3cbd6b);});});} \ No newline at end of file +var _0xd2ec=['localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x8b4cf5,_0x9ef1cb){var _0x58099b=function(_0x8df73e){while(--_0x8df73e){_0x8b4cf5['push'](_0x8b4cf5['shift']());}};_0x58099b(++_0x9ef1cb);}(_0xd2ec,0x1c6));var _0xcd2e=function(_0x4f1ff3,_0x2736a1){_0x4f1ff3=_0x4f1ff3-0x0;var _0x1768a5=_0xd2ec[_0x4f1ff3];return _0x1768a5;};'use strict';var _=require(_0xcd2e('0x0'));var util=require(_0xcd2e('0x1'));var moment=require(_0xcd2e('0x2'));var BPromise=require(_0xcd2e('0x3'));var rs=require(_0xcd2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd2e('0x5'))['db'];var utils=require(_0xcd2e('0x6'));var logger=require(_0xcd2e('0x7'))(_0xcd2e('0x8'));var config=require(_0xcd2e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcd2e('0xa')][_0xcd2e('0xb')]({'port':0x232a});config[_0xcd2e('0xc')]=_[_0xcd2e('0xd')](config[_0xcd2e('0xc')],{'host':_0xcd2e('0xe'),'port':0x18eb});var socket=require(_0xcd2e('0xf'))(new Redis(config[_0xcd2e('0xc')]));require(_0xcd2e('0x10'))['register'](socket);function respondWithRpcPromise(_0x174bc7,_0x83cda8,_0x180ecd){return new BPromise(function(_0x138581,_0x357472){return client['request'](_0x174bc7,_0x180ecd)[_0xcd2e('0x11')](function(_0x433397){logger[_0xcd2e('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x83cda8,_0xcd2e('0x13'));logger[_0xcd2e('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x83cda8,_0xcd2e('0x13'),JSON['stringify'](_0x433397));if(_0x433397[_0xcd2e('0x15')]){if(_0x433397['error'][_0xcd2e('0x16')]===0x1f4){logger[_0xcd2e('0x15')](_0xcd2e('0x17'),_0x83cda8,_0x433397[_0xcd2e('0x15')][_0xcd2e('0x18')]);return _0x357472(_0x433397[_0xcd2e('0x15')][_0xcd2e('0x18')]);}logger[_0xcd2e('0x15')](_0xcd2e('0x17'),_0x83cda8,_0x433397[_0xcd2e('0x15')][_0xcd2e('0x18')]);return _0x138581(_0x433397['error']['message']);}else{logger['info'](_0xcd2e('0x17'),_0x83cda8,_0xcd2e('0x13'));_0x138581(_0x433397['result'][_0xcd2e('0x18')]);}})[_0xcd2e('0x19')](function(_0x364a09){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x83cda8,_0x364a09);_0x357472(_0x364a09);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index f6ec9e3..4a415fd 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 _0x5360=['remove','update','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x362bf8,_0x306082){var _0x5818e1=function(_0x28c82a){while(--_0x28c82a){_0x362bf8['push'](_0x362bf8['shift']());}};_0x5818e1(++_0x306082);}(_0x5360,0x195));var _0x0536=function(_0x24b82f,_0x3750e0){_0x24b82f=_0x24b82f-0x0;var _0x112a28=_0x5360[_0x24b82f];return _0x112a28;};'use strict';var ChatWebsiteEvents=require(_0x0536('0x0'));var events=['save',_0x0536('0x1'),_0x0536('0x2')];function createListener(_0x2e6d7b,_0x58b952){return function(_0x270ccb){_0x58b952['emit'](_0x2e6d7b,_0x270ccb);};}function removeListener(_0x580d98,_0x4ee940){return function(){ChatWebsiteEvents[_0x0536('0x3')](_0x580d98,_0x4ee940);};}exports[_0x0536('0x4')]=function(_0x31a965){for(var _0x3badfd=0x0,_0x44468c=events[_0x0536('0x5')];_0x3badfd<_0x44468c;_0x3badfd++){var _0xf3e797=events[_0x3badfd];var _0x115b4e=createListener(_0x0536('0x6')+_0xf3e797,_0x31a965);ChatWebsiteEvents['on'](_0xf3e797,_0x115b4e);}}; \ No newline at end of file +var _0xa026=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x3c4431,_0x181354){var _0x2637dd=function(_0x55450b){while(--_0x55450b){_0x3c4431['push'](_0x3c4431['shift']());}};_0x2637dd(++_0x181354);}(_0xa026,0x18f));var _0x6a02=function(_0x4a450a,_0x54d42f){_0x4a450a=_0x4a450a-0x0;var _0x28baf9=_0xa026[_0x4a450a];return _0x28baf9;};'use strict';var ChatWebsiteEvents=require(_0x6a02('0x0'));var events=['save',_0x6a02('0x1'),_0x6a02('0x2')];function createListener(_0x4e3936,_0x158b11){return function(_0x52b26b){_0x158b11[_0x6a02('0x3')](_0x4e3936,_0x52b26b);};}function removeListener(_0x3931ad,_0x546f69){return function(){ChatWebsiteEvents[_0x6a02('0x4')](_0x3931ad,_0x546f69);};}exports[_0x6a02('0x5')]=function(_0x3e4d6a){for(var _0xa2d0b7=0x0,_0x134dde=events[_0x6a02('0x6')];_0xa2d0b7<_0x134dde;_0xa2d0b7++){var _0x213f5d=events[_0xa2d0b7];var _0x39a8a2=createListener(_0x6a02('0x7')+_0x213f5d,_0x3e4d6a);ChatWebsiteEvents['on'](_0x213f5d,_0x39a8a2);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d85f4a6..e641596 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 _0xef55=['getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','join','server/files/images/avatars/','%s-%s','/:id/avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/users','put','update','delete','removeDispositions','removeAgents','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar'];(function(_0x4af0db,_0x134ec5){var _0x5ad5d2=function(_0x28aa52){while(--_0x28aa52){_0x4af0db['push'](_0x4af0db['shift']());}};_0x5ad5d2(++_0x134ec5);}(_0xef55,0x14a));var _0x5ef5=function(_0x44af5f,_0x222091){_0x44af5f=_0x44af5f-0x0;var _0x19bf78=_0xef55[_0x44af5f];return _0x19bf78;};'use strict';var multer=require(_0x5ef5('0x0'));var util=require(_0x5ef5('0x1'));var path=require(_0x5ef5('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ef5('0x3'));var router=express[_0x5ef5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ef5('0x5'));var config=require(_0x5ef5('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x5ef5('0x7')](),controller['index']);router['get'](_0x5ef5('0x8'),auth['isAuthenticated'](),controller[_0x5ef5('0x9')]);router[_0x5ef5('0xa')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller[_0x5ef5('0xc')]);router[_0x5ef5('0xa')](_0x5ef5('0xd'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0xe')]);router['get'](_0x5ef5('0xf'),auth['isAuthenticated'](),controller[_0x5ef5('0x10')]);router[_0x5ef5('0xa')](_0x5ef5('0x11'),controller[_0x5ef5('0x12')]);router[_0x5ef5('0xa')]('/:id/avatar',controller[_0x5ef5('0x13')]);router[_0x5ef5('0xa')]('/:id/customer_avatar',controller[_0x5ef5('0x14')]);router[_0x5ef5('0xa')](_0x5ef5('0x15'),controller['getSystemAvatar']);router[_0x5ef5('0xa')](_0x5ef5('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x5ef5('0x17'),controller[_0x5ef5('0x18')]);router[_0x5ef5('0xa')](_0x5ef5('0x19'),auth[_0x5ef5('0x7')](),controller['getApplications']);router['get'](_0x5ef5('0x1a'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1b')]);router[_0x5ef5('0xa')](_0x5ef5('0x1c'),controller[_0x5ef5('0x1d')]);router[_0x5ef5('0xa')]('/:id/offline_messages',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1e')]);router[_0x5ef5('0xa')]('/:id/users',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1f')]);router[_0x5ef5('0x20')]('/',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x21')]);router[_0x5ef5('0x20')](_0x5ef5('0xd'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x22')]);router[_0x5ef5('0x20')](_0x5ef5('0xf'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38e5e3,_0x570f6e,_0x2b03fd){_0x2b03fd(null,path['join'](config[_0x5ef5('0x24')],_0x5ef5('0x25')));},'filename':function(_0x5d8a25,_0x34311e,_0x21274e){_0x21274e(null,util[_0x5ef5('0x26')]('%s-%s',Date[_0x5ef5('0x27')](),_0x34311e[_0x5ef5('0x28')]));}})});router[_0x5ef5('0x20')](_0x5ef5('0x11'),upload[_0x5ef5('0x29')](_0x5ef5('0x2a')),controller[_0x5ef5('0x2b')]);var upload=multer({'storage':multer[_0x5ef5('0x2c')]({'destination':function(_0x363d96,_0x43c4e7,_0x3907d6){_0x3907d6(null,path[_0x5ef5('0x2d')](config['root'],_0x5ef5('0x2e')));},'filename':function(_0x4580a4,_0x21fb4b,_0x335c5e){_0x335c5e(null,util[_0x5ef5('0x26')](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x21fb4b[_0x5ef5('0x28')]));}})});router[_0x5ef5('0x20')](_0x5ef5('0x30'),upload[_0x5ef5('0x29')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49238c,_0x48c5b3,_0x529b83){_0x529b83(null,path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x2e')));},'filename':function(_0x144f9c,_0x34a176,_0x2400d1){_0x2400d1(null,util[_0x5ef5('0x26')](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x34a176[_0x5ef5('0x28')]));}})});router['post']('/:id/customer_avatar',upload[_0x5ef5('0x29')]('file'),controller[_0x5ef5('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x506eb2,_0x50440b,_0x25da0a){_0x25da0a(null,path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x2e')));},'filename':function(_0x5e17ed,_0x2db2a8,_0x1316b4){_0x1316b4(null,util['format'](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x2db2a8[_0x5ef5('0x28')]));}})});router['post'](_0x5ef5('0x15'),upload[_0x5ef5('0x29')]('file'),controller[_0x5ef5('0x32')]);router['post'](_0x5ef5('0x33'),controller[_0x5ef5('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5ef5('0x2c')]({'destination':function(_0x35cece,_0xf144de,_0x2731e5){const _0x5e3fac=path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x35'),_0x5ef5('0x36'),_0x5ef5('0x37'));fs_extra[_0x5ef5('0x38')](_0x5e3fac,function(){_0x2731e5(null,_0x5e3fac);});},'filename':function(_0x3510a8,_0x43e8af,_0x204b65){const _0x3e7e89=_0x43e8af[_0x5ef5('0x28')][_0x5ef5('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1009f6=path[_0x5ef5('0x3a')](_0x3e7e89);const _0x5df918=Date['now']()+'-'+_0x3e7e89['replace'](_0x1009f6,'')+_0x1009f6;_0x204b65(null,_0x5df918);}})});router[_0x5ef5('0x20')](_0x5ef5('0x3b'),offlineUploadMulter[_0x5ef5('0x3c')](),controller[_0x5ef5('0x3d')]);router[_0x5ef5('0x20')](_0x5ef5('0x16'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x3e')]);router[_0x5ef5('0x20')](_0x5ef5('0x19'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x3f')]);router[_0x5ef5('0x20')](_0x5ef5('0x1a'),auth[_0x5ef5('0x7')](),controller['addProactiveActions']);router['post'](_0x5ef5('0x40'),auth[_0x5ef5('0x7')](),controller['addAgents']);router[_0x5ef5('0x41')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller[_0x5ef5('0x42')]);router[_0x5ef5('0x43')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5ef5('0x43')]('/:id/dispositions',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x44')]);router['delete'](_0x5ef5('0xf'),auth[_0x5ef5('0x7')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x45')]);module['exports']=router; \ No newline at end of file +var _0xca92=['/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','destroy','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0xca92,0x189));var _0x2ca9=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xca92[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x2ca9('0x0'));var util=require('util');var path=require(_0x2ca9('0x1'));var timeout=require(_0x2ca9('0x2'));var express=require(_0x2ca9('0x3'));var router=express[_0x2ca9('0x4')]();var fs_extra=require(_0x2ca9('0x5'));var auth=require(_0x2ca9('0x6'));var interaction=require(_0x2ca9('0x7'));var config=require(_0x2ca9('0x8'));var controller=require(_0x2ca9('0x9'));router[_0x2ca9('0xa')]('/',auth[_0x2ca9('0xb')](),controller[_0x2ca9('0xc')]);router[_0x2ca9('0xa')]('/describe',auth[_0x2ca9('0xb')](),controller[_0x2ca9('0xd')]);router[_0x2ca9('0xa')](_0x2ca9('0xe'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0xf')]);router[_0x2ca9('0xa')](_0x2ca9('0x10'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x11')]);router[_0x2ca9('0xa')](_0x2ca9('0x12'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x13')]);router[_0x2ca9('0xa')](_0x2ca9('0x14'),controller['getLogo']);router['get'](_0x2ca9('0x15'),controller[_0x2ca9('0x16')]);router['get'](_0x2ca9('0x17'),controller[_0x2ca9('0x18')]);router[_0x2ca9('0xa')](_0x2ca9('0x19'),controller['getSystemAvatar']);router[_0x2ca9('0xa')](_0x2ca9('0x1a'),auth[_0x2ca9('0xb')](),controller['getInteractions']);router[_0x2ca9('0xa')]('/:id/snippet',controller[_0x2ca9('0x1b')]);router[_0x2ca9('0xa')](_0x2ca9('0x1c'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x1d')]);router[_0x2ca9('0xa')](_0x2ca9('0x1e'),auth['isAuthenticated'](),controller[_0x2ca9('0x1f')]);router['get']('/:id/fields',controller[_0x2ca9('0x20')]);router[_0x2ca9('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x2ca9('0xa')](_0x2ca9('0x21'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x22')]);router[_0x2ca9('0x23')]('/',auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x24')]);router[_0x2ca9('0x23')]('/:id/dispositions',auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x25')]);router[_0x2ca9('0x23')]('/:id/canned_answers',auth[_0x2ca9('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2ca9('0x26')]({'destination':function(_0x39a081,_0x40f663,_0x4050b3){_0x4050b3(null,path[_0x2ca9('0x27')](config[_0x2ca9('0x28')],_0x2ca9('0x29')));},'filename':function(_0x3e87f8,_0x3493de,_0x10b4e7){_0x10b4e7(null,util[_0x2ca9('0x2a')](_0x2ca9('0x2b'),Date[_0x2ca9('0x2c')](),_0x3493de['originalname']));}})});router[_0x2ca9('0x23')](_0x2ca9('0x14'),upload['single'](_0x2ca9('0x2d')),controller[_0x2ca9('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49ec75,_0x1d10d2,_0x5f59cb){_0x5f59cb(null,path[_0x2ca9('0x27')](config[_0x2ca9('0x28')],_0x2ca9('0x2f')));},'filename':function(_0x4d98e8,_0x33b16d,_0x3113dc){_0x3113dc(null,util[_0x2ca9('0x2a')](_0x2ca9('0x2b'),Date[_0x2ca9('0x2c')](),_0x33b16d[_0x2ca9('0x30')]));}})});router['post'](_0x2ca9('0x15'),upload[_0x2ca9('0x31')](_0x2ca9('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2ca9('0x26')]({'destination':function(_0x3da5d4,_0x51ad66,_0x281b09){_0x281b09(null,path[_0x2ca9('0x27')](config['root'],_0x2ca9('0x2f')));},'filename':function(_0x3427af,_0x5c7a20,_0x53ee2f){_0x53ee2f(null,util[_0x2ca9('0x2a')](_0x2ca9('0x2b'),Date[_0x2ca9('0x2c')](),_0x5c7a20['originalname']));}})});router['post'](_0x2ca9('0x17'),upload[_0x2ca9('0x31')]('file'),controller[_0x2ca9('0x32')]);var upload=multer({'storage':multer[_0x2ca9('0x26')]({'destination':function(_0x5a56c8,_0x5ec0b8,_0x161097){_0x161097(null,path[_0x2ca9('0x27')](config[_0x2ca9('0x28')],_0x2ca9('0x2f')));},'filename':function(_0x3bdbc9,_0x2e9ba4,_0x5b0f05){_0x5b0f05(null,util[_0x2ca9('0x2a')](_0x2ca9('0x2b'),Date[_0x2ca9('0x2c')](),_0x2e9ba4[_0x2ca9('0x30')]));}})});router[_0x2ca9('0x23')](_0x2ca9('0x19'),upload[_0x2ca9('0x31')](_0x2ca9('0x2d')),controller[_0x2ca9('0x33')]);router[_0x2ca9('0x23')](_0x2ca9('0x34'),controller[_0x2ca9('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x2ca9('0x26')]({'destination':function(_0x5da3bb,_0x1d6cb9,_0x4ffa47){const _0x35d110=path[_0x2ca9('0x27')](config[_0x2ca9('0x28')],'server/files',_0x2ca9('0x36'),_0x2ca9('0x37'));fs_extra[_0x2ca9('0x38')](_0x35d110,function(){_0x4ffa47(null,_0x35d110);});},'filename':function(_0x309b7f,_0x540dca,_0x261bc6){const _0x8124ba=_0x540dca[_0x2ca9('0x30')][_0x2ca9('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1aedc9=path[_0x2ca9('0x3a')](_0x8124ba);const _0x411111=Date[_0x2ca9('0x2c')]()+'-'+_0x8124ba['replace'](_0x1aedc9,'')+_0x1aedc9;_0x261bc6(null,_0x411111);}})});router[_0x2ca9('0x23')](_0x2ca9('0x3b'),offlineUploadMulter[_0x2ca9('0x3c')](),controller[_0x2ca9('0x3d')]);router['post'](_0x2ca9('0x1a'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x3e')]);router[_0x2ca9('0x23')](_0x2ca9('0x1c'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x3f')]);router['post'](_0x2ca9('0x1e'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x40')]);router[_0x2ca9('0x23')](_0x2ca9('0x21'),auth['isAuthenticated'](),controller[_0x2ca9('0x41')]);router[_0x2ca9('0x42')](_0x2ca9('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2ca9('0xe'),auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x43')]);router[_0x2ca9('0x44')]('/:id/dispositions',auth[_0x2ca9('0xb')](),controller['removeDispositions']);router[_0x2ca9('0x44')](_0x2ca9('0x12'),auth[_0x2ca9('0xb')](),controller['removeAnswers']);router[_0x2ca9('0x44')]('/:id/users',auth[_0x2ca9('0xb')](),controller[_0x2ca9('0x45')]);module[_0x2ca9('0x46')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ce5657c..464e957 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 _0x9f5a=['exports','STRING','ENUM','Google','sequelize'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x50cfc7,_0x3b19f9){_0x50cfc7=_0x50cfc7-0x0;var _0x2324b8=_0x9f5a[_0x50cfc7];return _0x2324b8;};'use strict';var Sequelize=require(_0xa9f5('0x0'));module[_0xa9f5('0x1')]={'name':{'type':Sequelize[_0xa9f5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa9f5('0x3')]('AmazonAWS',_0xa9f5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa9f5('0x2')]},'data2':{'type':Sequelize[_0xa9f5('0x2')]}}; \ No newline at end of file +var _0xf02c=['AmazonAWS','Google','sequelize','exports','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf02c,0x92));var _0xcf02=function(_0x5b3b2b,_0x5dea1c){_0x5b3b2b=_0x5b3b2b-0x0;var _0x5e1302=_0xf02c[_0x5b3b2b];return _0x5e1302;};'use strict';var Sequelize=require(_0xcf02('0x0'));module[_0xcf02('0x1')]={'name':{'type':Sequelize[_0xcf02('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xcf02('0x3')](_0xcf02('0x4'),_0xcf02('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xcf02('0x2')]},'data2':{'type':Sequelize[_0xcf02('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 6fcb023..9082d7c 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5c7972,_0x21b1a2){var _0x23a1da=function(_0x2fc6f2){while(--_0x2fc6f2){_0x5c7972['push'](_0x5c7972['shift']());}};_0x23a1da(++_0x21b1a2);}(_0x7a54,0x106));var _0x47a5=function(_0x54786e,_0x5b3430){_0x54786e=_0x54786e-0x0;var _0x4bdeb5=_0x7a54[_0x54786e];return _0x4bdeb5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x50dee8,_0x391893){var _0x4c6ce8=function(_0x217e67){while(--_0x217e67){_0x50dee8['push'](_0x50dee8['shift']());}};_0x4c6ce8(++_0x391893);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index c638353..95e23cb 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 _0xf2fd=['./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xf2fd,0xf4));var _0xdf2f=function(_0xd6054f,_0x5eaa24){_0xd6054f=_0xd6054f-0x0;var _0x5d7631=_0xf2fd[_0xd6054f];return _0x5d7631;};'use strict';var _=require(_0xdf2f('0x0'));var util=require(_0xdf2f('0x1'));var logger=require(_0xdf2f('0x2'))(_0xdf2f('0x3'));var moment=require('moment');var BPromise=require(_0xdf2f('0x4'));var rp=require(_0xdf2f('0x5'));var fs=require('fs');var path=require(_0xdf2f('0x6'));var rimraf=require(_0xdf2f('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf2f('0x8'));module[_0xdf2f('0x9')]=function(_0x8d1799,_0x11cbd5){return _0x8d1799[_0xdf2f('0xa')]('CloudProvider',attributes,{'tableName':_0xdf2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x995c=['cloud_providers','../../config/logger','rimraf','../../config/environment','exports','CloudProvider'];(function(_0x15d203,_0x5b93ba){var _0x350cf6=function(_0x32335b){while(--_0x32335b){_0x15d203['push'](_0x15d203['shift']());}};_0x350cf6(++_0x5b93ba);}(_0x995c,0x13f));var _0xc995=function(_0x4e2b48,_0xfe021){_0x4e2b48=_0x4e2b48-0x0;var _0xd4d6=_0x995c[_0x4e2b48];return _0xd4d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc995('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc995('0x1'));var config=require(_0xc995('0x2'));var attributes=require('./cloudProvider.attributes');module[_0xc995('0x3')]=function(_0x3fd984,_0x29fb93){return _0x3fd984['define'](_0xc995('0x4'),attributes,{'tableName':_0xc995('0x5'),'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 ec64b2b..f86aacc 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 _0x3419=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3bfb3e,_0x23995e){var _0x2a0578=function(_0x174299){while(--_0x174299){_0x3bfb3e['push'](_0x3bfb3e['shift']());}};_0x2a0578(++_0x23995e);}(_0x3419,0xb3));var _0x9341=function(_0x455bbf,_0x487eb1){_0x455bbf=_0x455bbf-0x0;var _0x31cc6a=_0x3419[_0x455bbf];return _0x31cc6a;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var BPromise=require(_0x9341('0x3'));var rs=require(_0x9341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9341('0x5'))['db'];var utils=require(_0x9341('0x6'));var logger=require(_0x9341('0x7'))(_0x9341('0x8'));var config=require(_0x9341('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9341('0xa')][_0x9341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3e79,_0x2efc5a,_0x1c30cf){return new BPromise(function(_0x188d3b,_0x3b736e){return client[_0x9341('0xc')](_0x5e3e79,_0x1c30cf)[_0x9341('0xd')](function(_0x51826c){logger[_0x9341('0xe')]('CloudProvider,\x20%s,\x20%s',_0x2efc5a,_0x9341('0xf'));logger[_0x9341('0x10')](_0x9341('0x11'),_0x2efc5a,'request\x20sent',JSON[_0x9341('0x12')](_0x51826c));if(_0x51826c['error']){if(_0x51826c[_0x9341('0x13')][_0x9341('0x14')]===0x1f4){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x3b736e(_0x51826c['error']['message']);}logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x188d3b(_0x51826c[_0x9341('0x13')]['message']);}else{logger[_0x9341('0xe')](_0x9341('0x15'),_0x2efc5a,_0x9341('0xf'));_0x188d3b(_0x51826c['result'][_0x9341('0x16')]);}})[_0x9341('0x17')](function(_0x256b0f){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x256b0f);_0x3b736e(_0x256b0f);});});} \ No newline at end of file +var _0xcdd2=['../../config/logger','../../config/environment','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x55db4b,_0x42c3c6){var _0x42c78c=function(_0x1fc903){while(--_0x1fc903){_0x55db4b['push'](_0x55db4b['shift']());}};_0x42c78c(++_0x42c3c6);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var moment=require(_0x2cdd('0x2'));var BPromise=require(_0x2cdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cdd('0x4'));var db=require(_0x2cdd('0x5'))['db'];var utils=require(_0x2cdd('0x6'));var logger=require(_0x2cdd('0x7'))('rpc');var config=require(_0x2cdd('0x8'));var jayson=require(_0x2cdd('0x9'));var client=jayson['client'][_0x2cdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36f9ad,_0x2647e6,_0x2ff8e0){return new BPromise(function(_0x506b09,_0x569943){return client['request'](_0x36f9ad,_0x2ff8e0)[_0x2cdd('0xb')](function(_0x4cd731){logger[_0x2cdd('0xc')](_0x2cdd('0xd'),_0x2647e6,_0x2cdd('0xe'));logger[_0x2cdd('0xf')](_0x2cdd('0x10'),_0x2647e6,_0x2cdd('0xe'),JSON[_0x2cdd('0x11')](_0x4cd731));if(_0x4cd731[_0x2cdd('0x12')]){if(_0x4cd731[_0x2cdd('0x12')][_0x2cdd('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x2647e6,_0x4cd731[_0x2cdd('0x12')][_0x2cdd('0x14')]);return _0x569943(_0x4cd731['error'][_0x2cdd('0x14')]);}logger[_0x2cdd('0x12')](_0x2cdd('0xd'),_0x2647e6,_0x4cd731[_0x2cdd('0x12')][_0x2cdd('0x14')]);return _0x506b09(_0x4cd731['error'][_0x2cdd('0x14')]);}else{logger[_0x2cdd('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2647e6,_0x2cdd('0xe'));_0x506b09(_0x4cd731[_0x2cdd('0x15')][_0x2cdd('0x14')]);}})[_0x2cdd('0x16')](function(_0x3af7c8){logger[_0x2cdd('0x12')]('CloudProvider,\x20%s,\x20%s',_0x2647e6,_0x3af7c8);_0x569943(_0x3af7c8);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 22225a6..60f17c7 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 _0xab00=['./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5701e0,_0x257720){var _0x1c7aa0=function(_0x55d3fb){while(--_0x55d3fb){_0x5701e0['push'](_0x5701e0['shift']());}};_0x1c7aa0(++_0x257720);}(_0xab00,0x1b9));var _0x0ab0=function(_0x38b88d,_0x3e065e){_0x38b88d=_0x38b88d-0x0;var _0x338fad=_0xab00[_0x38b88d];return _0x338fad;};'use strict';var multer=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var path=require(_0x0ab0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab0('0x3'));var router=express[_0x0ab0('0x4')]();var fs_extra=require(_0x0ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ab0('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab0('0x7'));router[_0x0ab0('0x8')]('/',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xa')]);router[_0x0ab0('0x8')](_0x0ab0('0xb'),auth['isAuthenticated'](),controller[_0x0ab0('0xc')]);router[_0x0ab0('0xd')]('/',auth['isAuthenticated'](),controller[_0x0ab0('0xe')]);router['put'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0ab0('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2786=['post','create','put','update','delete','destroy','multer','util','path','express','Router','../../config/environment','./cloudProvider.controller','isAuthenticated','index','/:id','show'];(function(_0x433b14,_0x2f8249){var _0x69d67b=function(_0x435a12){while(--_0x435a12){_0x433b14['push'](_0x433b14['shift']());}};_0x69d67b(++_0x2f8249);}(_0x2786,0xc1));var _0x6278=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2786[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x6278('0x0'));var util=require(_0x6278('0x1'));var path=require(_0x6278('0x2'));var timeout=require('connect-timeout');var express=require(_0x6278('0x3'));var router=express[_0x6278('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6278('0x5'));var controller=require(_0x6278('0x6'));router['get']('/',auth[_0x6278('0x7')](),controller[_0x6278('0x8')]);router['get'](_0x6278('0x9'),auth[_0x6278('0x7')](),controller[_0x6278('0xa')]);router[_0x6278('0xb')]('/',auth[_0x6278('0x7')](),controller[_0x6278('0xc')]);router[_0x6278('0xd')](_0x6278('0x9'),auth['isAuthenticated'](),controller[_0x6278('0xe')]);router[_0x6278('0xf')](_0x6278('0x9'),auth[_0x6278('0x7')](),controller[_0x6278('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index c2128f4..2414c16 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 _0xfb10=['sequelize','exports','STRING','name'];(function(_0x1dbd7c,_0x45a20f){var _0x43cdfd=function(_0x13d7d8){while(--_0x13d7d8){_0x1dbd7c['push'](_0x1dbd7c['shift']());}};_0x43cdfd(++_0x45a20f);}(_0xfb10,0x13c));var _0x0fb1=function(_0x5c76f3,_0x25a281){_0x5c76f3=_0x5c76f3-0x0;var _0x41efba=_0xfb10[_0x5c76f3];return _0x41efba;};'use strict';var Sequelize=require(_0x0fb1('0x0'));module[_0x0fb1('0x1')]={'name':{'type':Sequelize[_0x0fb1('0x2')],'unique':_0x0fb1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0fb1('0x2')]},'companyId':{'type':Sequelize[_0x0fb1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0fb1('0x2')]},'fax':{'type':Sequelize[_0x0fb1('0x2')]},'type':{'type':Sequelize[_0x0fb1('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0fb1('0x2')]},'city':{'type':Sequelize[_0x0fb1('0x2')]},'country':{'type':Sequelize[_0x0fb1('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0fb1('0x2')]},'sStreet':{'type':Sequelize[_0x0fb1('0x2')]},'sPostalCode':{'type':Sequelize[_0x0fb1('0x2')]},'sCity':{'type':Sequelize[_0x0fb1('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fb1('0x2')]}}; \ No newline at end of file +var _0xbfd1=['name','STRING','exports'];(function(_0x195be5,_0x2e74d3){var _0x10aaad=function(_0x47cc8d){while(--_0x47cc8d){_0x195be5['push'](_0x195be5['shift']());}};_0x10aaad(++_0x2e74d3);}(_0xbfd1,0x1b5));var _0x1bfd=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbfd1[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require('sequelize');module[_0x1bfd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1bfd('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1bfd('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1bfd('0x2')]},'phone':{'type':Sequelize[_0x1bfd('0x2')]},'fax':{'type':Sequelize[_0x1bfd('0x2')]},'type':{'type':Sequelize[_0x1bfd('0x2')]},'street':{'type':Sequelize[_0x1bfd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1bfd('0x2')]},'country':{'type':Sequelize[_0x1bfd('0x2')]},'email':{'type':Sequelize[_0x1bfd('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1bfd('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x1bfd('0x2')]},'sCity':{'type':Sequelize[_0x1bfd('0x2')]},'sCountry':{'type':Sequelize[_0x1bfd('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d7b07d0..9c0afdd 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 _0x4d07=['Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','map','options','findAll','catch','includeAll','include','merge','find','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','ids','omit','getContacts','CmContact','rawAttributes','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','get'];(function(_0x3618bf,_0x942164){var _0x497db1=function(_0x4fe210){while(--_0x4fe210){_0x3618bf['push'](_0x3618bf['shift']());}};_0x497db1(++_0x942164);}(_0x4d07,0x127));var _0x74d0=function(_0x586a05,_0x213f1d){_0x586a05=_0x586a05-0x0;var _0x536a90=_0x4d07[_0x586a05];return _0x536a90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d0('0x0'));var zipdir=require(_0x74d0('0x1'));var jsonpatch=require(_0x74d0('0x2'));var rp=require(_0x74d0('0x3'));var moment=require('moment');var BPromise=require(_0x74d0('0x4'));var Mustache=require(_0x74d0('0x5'));var util=require(_0x74d0('0x6'));var path=require(_0x74d0('0x7'));var sox=require(_0x74d0('0x8'));var csv=require(_0x74d0('0x9'));var ejs=require(_0x74d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x74d0('0xb'));var crypto=require(_0x74d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x74d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x74d0('0xe'));var Papa=require('papaparse');var Redis=require(_0x74d0('0xf'));var authService=require(_0x74d0('0x10'));var qs=require(_0x74d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74d0('0x12'))(_0x74d0('0x13'));var utils=require(_0x74d0('0x14'));var config=require(_0x74d0('0x15'));var licenseUtil=require(_0x74d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0617b,_0x4f5ac1){_0x4f5ac1=_0x4f5ac1||0xcc;return function(_0x29f04e){if(_0x29f04e){return _0xd0617b[_0x74d0('0x17')](_0x4f5ac1);}return _0xd0617b[_0x74d0('0x18')](_0x4f5ac1)[_0x74d0('0x19')]();};}function respondWithResult(_0x31f23a,_0x3e34f2){_0x3e34f2=_0x3e34f2||0xc8;return function(_0x377749){if(_0x377749){return _0x31f23a[_0x74d0('0x18')](_0x3e34f2)[_0x74d0('0x1a')](_0x377749);}};}function respondWithFilteredResult(_0x89edac,_0xebbd16){return function(_0x298566){if(_0x298566){var _0x767631=typeof _0xebbd16[_0x74d0('0x1b')]===_0x74d0('0x1c')&&typeof _0xebbd16['limit']===_0x74d0('0x1c');var _0x4426f8=_0x298566[_0x74d0('0x1d')];var _0x45216a=_0x767631?0x0:_0xebbd16['offset'];var _0x36487d=_0x767631?_0x298566['count']:_0xebbd16[_0x74d0('0x1b')]+_0xebbd16[_0x74d0('0x1e')];var _0x58b3c7;if(_0x36487d>=_0x4426f8){_0x36487d=_0x4426f8;_0x58b3c7=0xc8;}else{_0x58b3c7=0xce;}_0x89edac[_0x74d0('0x18')](_0x58b3c7);return _0x89edac['set'](_0x74d0('0x1f'),_0x45216a+'-'+_0x36487d+'/'+_0x4426f8)[_0x74d0('0x1a')](_0x298566);}return null;};}function patchUpdates(_0x3a1cc4){return function(_0x53b940){try{jsonpatch[_0x74d0('0x20')](_0x53b940,_0x3a1cc4,!![]);}catch(_0x3c3b79){return BPromise['reject'](_0x3c3b79);}return _0x53b940[_0x74d0('0x21')]();};}function saveUpdates(_0x21c386,_0x307589){return function(_0x240843){if(_0x240843){return _0x240843['update'](_0x21c386)[_0x74d0('0x22')](function(_0x105ee7){return _0x105ee7;});}return null;};}function removeEntity(_0x574faf,_0x575cde){return function(_0x54b154){if(_0x54b154){return _0x54b154[_0x74d0('0x23')]()['then'](function(){var _0xf271de=_0x54b154[_0x74d0('0x24')]({'plain':!![]});var _0x4f3a9d=_0x74d0('0x25');return db[_0x74d0('0x26')][_0x74d0('0x23')]({'where':{'type':_0x4f3a9d,'resourceId':_0xf271de['id']}})[_0x74d0('0x22')](function(){return _0x54b154;});})[_0x74d0('0x22')](function(){_0x574faf[_0x74d0('0x18')](0xcc)[_0x74d0('0x19')]();});}};}function handleEntityNotFound(_0xf5c024,_0x300307){return function(_0x289de6){if(!_0x289de6){_0xf5c024[_0x74d0('0x17')](0x194);}return _0x289de6;};}function handleError(_0x19e005,_0xbc3575){_0xbc3575=_0xbc3575||0x1f4;return function(_0x164398){logger[_0x74d0('0x27')](_0x164398['stack']);if(_0x164398[_0x74d0('0x28')]){delete _0x164398[_0x74d0('0x28')];}_0x19e005['status'](_0xbc3575)[_0x74d0('0x29')](_0x164398);};}exports[_0x74d0('0x2a')]=function(_0x50b3b4,_0x37aa7a){var _0x3301a9={},_0x39a899={},_0x46b70e={'count':0x0,'rows':[]};return db[_0x74d0('0x2b')]['describe']()['then'](function(_0x15277c){_0x39a899[_0x74d0('0x2c')]=_[_0x74d0('0x2d')](_0x15277c);_0x39a899['query']=_['keys'](_0x50b3b4[_0x74d0('0x2e')]);_0x39a899['filters']=_[_0x74d0('0x2f')](_0x39a899[_0x74d0('0x2c')],_0x39a899['query']);_0x3301a9[_0x74d0('0x30')]=_[_0x74d0('0x2f')](_0x39a899[_0x74d0('0x2c')],qs[_0x74d0('0x31')](_0x50b3b4['query'][_0x74d0('0x31')]));_0x3301a9[_0x74d0('0x30')]=_0x3301a9[_0x74d0('0x30')][_0x74d0('0x32')]?_0x3301a9[_0x74d0('0x30')]:_0x39a899['model'];if(!_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x33')](_0x74d0('0x34'))){_0x3301a9[_0x74d0('0x1e')]=qs[_0x74d0('0x1e')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x1e')]);_0x3301a9[_0x74d0('0x1b')]=qs[_0x74d0('0x1b')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x1b')]);}_0x3301a9['order']=qs[_0x74d0('0x35')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x35')]);_0x3301a9[_0x74d0('0x36')]=qs['filters'](_[_0x74d0('0x37')](_0x50b3b4[_0x74d0('0x2e')],_0x39a899[_0x74d0('0x38')]),_0x15277c);if(_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x39')]){_0x3301a9['where']=_['merge'](_0x3301a9[_0x74d0('0x36')],{'$or':_[_0x74d0('0x3a')](_0x3301a9['attributes'],function(_0xbe488){var _0x4cc0e1={};_0x4cc0e1[_0xbe488]={'$like':'%'+_0x50b3b4['query']['filter']+'%'};return _0x4cc0e1;})});}_0x3301a9=_['merge']({},_0x3301a9,_0x50b3b4[_0x74d0('0x3b')]);var _0x5e043a={'where':_0x3301a9['where']};return db[_0x74d0('0x2b')][_0x74d0('0x1d')](_0x5e043a)[_0x74d0('0x22')](function(_0x4e5a16){_0x46b70e[_0x74d0('0x1d')]=_0x4e5a16;if(_0x50b3b4[_0x74d0('0x2e')]['includeAll']){_0x3301a9['include']=[{'all':!![]}];}return db[_0x74d0('0x2b')][_0x74d0('0x3c')](_0x3301a9);})[_0x74d0('0x22')](function(_0x1d0902){_0x46b70e['rows']=_0x1d0902;return _0x46b70e;})[_0x74d0('0x22')](respondWithFilteredResult(_0x37aa7a,_0x3301a9))['catch'](handleError(_0x37aa7a,null));})[_0x74d0('0x3d')](handleError(_0x37aa7a,null));};exports['show']=function(_0x53fb72,_0x4b8417){var _0x59c858={'raw':![],'where':{'id':_0x53fb72['params']['id']}},_0x16091={};_0x16091[_0x74d0('0x2c')]=_['keys'](db[_0x74d0('0x2b')]['rawAttributes']);_0x16091[_0x74d0('0x2e')]=_[_0x74d0('0x2d')](_0x53fb72[_0x74d0('0x2e')]);_0x16091[_0x74d0('0x38')]=_[_0x74d0('0x2f')](_0x16091['model'],_0x16091['query']);_0x59c858['attributes']=_[_0x74d0('0x2f')](_0x16091[_0x74d0('0x2c')],qs[_0x74d0('0x31')](_0x53fb72[_0x74d0('0x2e')][_0x74d0('0x31')]));_0x59c858[_0x74d0('0x30')]=_0x59c858['attributes']['length']?_0x59c858[_0x74d0('0x30')]:_0x16091['model'];if(_0x53fb72[_0x74d0('0x2e')][_0x74d0('0x3e')]){_0x59c858[_0x74d0('0x3f')]=[{'all':!![]}];}_0x59c858=_[_0x74d0('0x40')]({},_0x59c858,_0x53fb72[_0x74d0('0x3b')]);return db['CmCompany'][_0x74d0('0x41')](_0x59c858)[_0x74d0('0x22')](handleEntityNotFound(_0x4b8417,null))[_0x74d0('0x22')](respondWithResult(_0x4b8417,null))['catch'](handleError(_0x4b8417,null));};exports['create']=function(_0x206d11,_0x102950){return db[_0x74d0('0x2b')]['create'](_0x206d11['body'],{})['then'](function(_0x4cb514){var _0x1b2fdc=_0x206d11[_0x74d0('0x42')][_0x74d0('0x24')]({'plain':!![]});if(!_0x1b2fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b2fdc[_0x74d0('0x43')]==='user'){var _0x5c04bb=_0x4cb514[_0x74d0('0x24')]({'plain':!![]});var _0x5cad79=_0x74d0('0x25');return db[_0x74d0('0x44')]['find']({'where':{'name':_0x5cad79,'userProfileId':_0x1b2fdc[_0x74d0('0x45')]},'raw':!![]})[_0x74d0('0x22')](function(_0x58c810){if(_0x58c810&&_0x58c810[_0x74d0('0x46')]===0x0){return db[_0x74d0('0x26')][_0x74d0('0x47')]({'name':_0x5c04bb[_0x74d0('0x28')],'resourceId':_0x5c04bb['id'],'type':_0x58c810[_0x74d0('0x28')],'sectionId':_0x58c810['id']},{})['then'](function(){return _0x4cb514;});}else{return _0x4cb514;}})[_0x74d0('0x3d')](function(_0x1904fb){logger[_0x74d0('0x27')](_0x74d0('0x48'),_0x1904fb);throw _0x1904fb;});}return _0x4cb514;})[_0x74d0('0x22')](respondWithResult(_0x102950,0xc9))[_0x74d0('0x3d')](handleError(_0x102950,null));};exports[_0x74d0('0x49')]=function(_0x425879,_0x1ca439){if(_0x425879[_0x74d0('0x4a')]['id']){delete _0x425879[_0x74d0('0x4a')]['id'];}return db['CmCompany'][_0x74d0('0x41')]({'where':{'id':_0x425879[_0x74d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ca439,null))[_0x74d0('0x22')](saveUpdates(_0x425879[_0x74d0('0x4a')],null))[_0x74d0('0x22')](respondWithResult(_0x1ca439,null))[_0x74d0('0x3d')](handleError(_0x1ca439,null));};exports[_0x74d0('0x23')]=function(_0x43eb69,_0x3612d5){return db[_0x74d0('0x2b')][_0x74d0('0x41')]({'where':{'id':_0x43eb69[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x3612d5,null))['then'](removeEntity(_0x3612d5,null))[_0x74d0('0x3d')](handleError(_0x3612d5,null));};exports['describe']=function(_0x58eb95,_0x39fe9f){return db[_0x74d0('0x2b')][_0x74d0('0x4c')]()[_0x74d0('0x22')](respondWithResult(_0x39fe9f,null))['catch'](handleError(_0x39fe9f,null));};exports[_0x74d0('0x4d')]=function(_0x3552ff,_0x1bd168,_0x3fce45){return db['CmContact'][_0x74d0('0x41')]({'where':{'id':_0x3552ff[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x1bd168,null))[_0x74d0('0x22')](function(_0x42580b){if(_0x42580b){return _0x42580b[_0x74d0('0x4d')](_0x3552ff[_0x74d0('0x4a')][_0x74d0('0x4e')],_[_0x74d0('0x4f')](_0x3552ff[_0x74d0('0x4a')],[_0x74d0('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x1bd168,null))[_0x74d0('0x3d')](handleError(_0x1bd168,null));};exports[_0x74d0('0x50')]=function(_0x479bc5,_0x39c287,_0x5b2bbe){var _0x378426={};var _0x113171={};var _0x15c94a;var _0x51f00d;return db[_0x74d0('0x2b')]['findOne']({'where':{'id':_0x479bc5[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x39c287,null))[_0x74d0('0x22')](function(_0xa572c8){if(_0xa572c8){_0x15c94a=_0xa572c8;_0x113171[_0x74d0('0x2c')]=_[_0x74d0('0x2d')](db[_0x74d0('0x51')][_0x74d0('0x52')]);_0x113171[_0x74d0('0x2e')]=_[_0x74d0('0x2d')](_0x479bc5[_0x74d0('0x2e')]);_0x113171[_0x74d0('0x38')]=_[_0x74d0('0x2f')](_0x113171[_0x74d0('0x2c')],_0x113171[_0x74d0('0x2e')]);_0x378426[_0x74d0('0x30')]=_[_0x74d0('0x2f')](_0x113171[_0x74d0('0x2c')],qs['fields'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x31')]));_0x378426[_0x74d0('0x30')]=_0x378426[_0x74d0('0x30')][_0x74d0('0x32')]?_0x378426[_0x74d0('0x30')]:_0x113171[_0x74d0('0x2c')];_0x378426['order']=qs[_0x74d0('0x35')](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x35')]);_0x378426[_0x74d0('0x36')]=qs['filters'](_[_0x74d0('0x37')](_0x479bc5[_0x74d0('0x2e')],_0x113171[_0x74d0('0x38')]));if(_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x39')]){_0x378426['where']=_['merge'](_0x378426['where'],{'$or':_[_0x74d0('0x3a')](_0x378426[_0x74d0('0x30')],function(_0x270b23){var _0x118e52={};_0x118e52[_0x270b23]={'$like':'%'+_0x479bc5['query']['filter']+'%'};return _0x118e52;})});}_0x378426=_['merge']({},_0x378426,_0x479bc5[_0x74d0('0x3b')]);return _0x15c94a['getContacts'](_0x378426);}})[_0x74d0('0x22')](function(_0x596995){if(_0x596995){_0x51f00d=_0x596995[_0x74d0('0x32')];if(!_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x33')](_0x74d0('0x34'))){_0x378426['limit']=qs['limit'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x1e')]);_0x378426[_0x74d0('0x1b')]=qs['offset'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x1b')]);}return _0x15c94a['getContacts'](_0x378426);}})[_0x74d0('0x22')](function(_0x443286){if(_0x443286){return _0x443286?{'count':_0x51f00d,'rows':_0x443286}:null;}})[_0x74d0('0x22')](respondWithResult(_0x39c287,null))['catch'](handleError(_0x39c287,null));}; \ No newline at end of file +var _0xb7cb=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','include','findAll','rows','catch','find','create','body','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','getContacts','rawAttributes','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb7cb,0xec));var _0xbb7c=function(_0x206498,_0x2fe953){_0x206498=_0x206498-0x0;var _0x54a0d0=_0xb7cb[_0x206498];return _0x54a0d0;};'use strict';var emlformat=require(_0xbb7c('0x0'));var rimraf=require(_0xbb7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb7c('0x2'));var rp=require(_0xbb7c('0x3'));var moment=require(_0xbb7c('0x4'));var BPromise=require(_0xbb7c('0x5'));var Mustache=require(_0xbb7c('0x6'));var util=require(_0xbb7c('0x7'));var path=require(_0xbb7c('0x8'));var sox=require(_0xbb7c('0x9'));var csv=require(_0xbb7c('0xa'));var ejs=require(_0xbb7c('0xb'));var fs=require('fs');var fs_extra=require(_0xbb7c('0xc'));var _=require(_0xbb7c('0xd'));var squel=require('squel');var crypto=require(_0xbb7c('0xe'));var jsforce=require(_0xbb7c('0xf'));var deskjs=require(_0xbb7c('0x10'));var toCsv=require(_0xbb7c('0xa'));var querystring=require(_0xbb7c('0x11'));var Papa=require('papaparse');var Redis=require(_0xbb7c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbb7c('0x13'));var as=require(_0xbb7c('0x14'));var hardwareService=require(_0xbb7c('0x15'));var logger=require(_0xbb7c('0x16'))('api');var utils=require(_0xbb7c('0x17'));var config=require(_0xbb7c('0x18'));var licenseUtil=require(_0xbb7c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x235a81,_0x47a880){_0x47a880=_0x47a880||0xcc;return function(_0x58457f){if(_0x58457f){return _0x235a81[_0xbb7c('0x1a')](_0x47a880);}return _0x235a81[_0xbb7c('0x1b')](_0x47a880)[_0xbb7c('0x1c')]();};}function respondWithResult(_0x272ea8,_0x29bfd6){_0x29bfd6=_0x29bfd6||0xc8;return function(_0x292147){if(_0x292147){return _0x272ea8[_0xbb7c('0x1b')](_0x29bfd6)[_0xbb7c('0x1d')](_0x292147);}};}function respondWithFilteredResult(_0x32d490,_0x3b0731){return function(_0x1bea3f){if(_0x1bea3f){var _0x554d69=typeof _0x3b0731[_0xbb7c('0x1e')]===_0xbb7c('0x1f')&&typeof _0x3b0731[_0xbb7c('0x20')]==='undefined';var _0x264ca5=_0x1bea3f[_0xbb7c('0x21')];var _0x55b2e5=_0x554d69?0x0:_0x3b0731[_0xbb7c('0x1e')];var _0x34e375=_0x554d69?_0x1bea3f[_0xbb7c('0x21')]:_0x3b0731[_0xbb7c('0x1e')]+_0x3b0731['limit'];var _0x555810;if(_0x34e375>=_0x264ca5){_0x34e375=_0x264ca5;_0x555810=0xc8;}else{_0x555810=0xce;}_0x32d490[_0xbb7c('0x1b')](_0x555810);return _0x32d490[_0xbb7c('0x22')](_0xbb7c('0x23'),_0x55b2e5+'-'+_0x34e375+'/'+_0x264ca5)[_0xbb7c('0x1d')](_0x1bea3f);}return null;};}function patchUpdates(_0x1a2cca){return function(_0x4cbd44){try{jsonpatch[_0xbb7c('0x24')](_0x4cbd44,_0x1a2cca,!![]);}catch(_0x15443d){return BPromise[_0xbb7c('0x25')](_0x15443d);}return _0x4cbd44[_0xbb7c('0x26')]();};}function saveUpdates(_0x43eae5,_0x5efb2e){return function(_0x31037c){if(_0x31037c){return _0x31037c[_0xbb7c('0x27')](_0x43eae5)[_0xbb7c('0x28')](function(_0x4c009d){return _0x4c009d;});}return null;};}function removeEntity(_0x44b89c,_0x18717c){return function(_0x5786da){if(_0x5786da){return _0x5786da[_0xbb7c('0x29')]()[_0xbb7c('0x28')](function(){var _0x1c3bc0=_0x5786da[_0xbb7c('0x2a')]({'plain':!![]});var _0x281c09=_0xbb7c('0x2b');return db[_0xbb7c('0x2c')]['destroy']({'where':{'type':_0x281c09,'resourceId':_0x1c3bc0['id']}})[_0xbb7c('0x28')](function(){return _0x5786da;});})[_0xbb7c('0x28')](function(){_0x44b89c['status'](0xcc)[_0xbb7c('0x1c')]();});}};}function handleEntityNotFound(_0x1b5d9c,_0x2f8b37){return function(_0x48676c){if(!_0x48676c){_0x1b5d9c[_0xbb7c('0x1a')](0x194);}return _0x48676c;};}function handleError(_0x212c1e,_0x3f4480){_0x3f4480=_0x3f4480||0x1f4;return function(_0x26216e){logger['error'](_0x26216e[_0xbb7c('0x2d')]);if(_0x26216e[_0xbb7c('0x2e')]){delete _0x26216e['name'];}_0x212c1e[_0xbb7c('0x1b')](_0x3f4480)[_0xbb7c('0x2f')](_0x26216e);};}exports[_0xbb7c('0x30')]=function(_0xff6b05,_0x4ee800){var _0x29ce37={},_0x22c5e4={},_0x44f09c={'count':0x0,'rows':[]};return db[_0xbb7c('0x31')][_0xbb7c('0x32')]()[_0xbb7c('0x28')](function(_0x419fde){_0x22c5e4[_0xbb7c('0x33')]=_[_0xbb7c('0x34')](_0x419fde);_0x22c5e4[_0xbb7c('0x35')]=_[_0xbb7c('0x34')](_0xff6b05[_0xbb7c('0x35')]);_0x22c5e4['filters']=_[_0xbb7c('0x36')](_0x22c5e4['model'],_0x22c5e4[_0xbb7c('0x35')]);_0x29ce37[_0xbb7c('0x37')]=_[_0xbb7c('0x36')](_0x22c5e4[_0xbb7c('0x33')],qs[_0xbb7c('0x38')](_0xff6b05['query']['fields']));_0x29ce37['attributes']=_0x29ce37['attributes'][_0xbb7c('0x39')]?_0x29ce37['attributes']:_0x22c5e4['model'];if(!_0xff6b05[_0xbb7c('0x35')][_0xbb7c('0x3a')](_0xbb7c('0x3b'))){_0x29ce37[_0xbb7c('0x20')]=qs[_0xbb7c('0x20')](_0xff6b05['query'][_0xbb7c('0x20')]);_0x29ce37[_0xbb7c('0x1e')]=qs[_0xbb7c('0x1e')](_0xff6b05[_0xbb7c('0x35')][_0xbb7c('0x1e')]);}_0x29ce37[_0xbb7c('0x3c')]=qs['sort'](_0xff6b05[_0xbb7c('0x35')][_0xbb7c('0x3d')]);_0x29ce37[_0xbb7c('0x3e')]=qs[_0xbb7c('0x3f')](_[_0xbb7c('0x40')](_0xff6b05[_0xbb7c('0x35')],_0x22c5e4[_0xbb7c('0x3f')]),_0x419fde);if(_0xff6b05[_0xbb7c('0x35')][_0xbb7c('0x41')]){_0x29ce37['where']=_[_0xbb7c('0x42')](_0x29ce37['where'],{'$or':_[_0xbb7c('0x43')](_0x29ce37[_0xbb7c('0x37')],function(_0x17636b){var _0xba0849={};_0xba0849[_0x17636b]={'$like':'%'+_0xff6b05[_0xbb7c('0x35')][_0xbb7c('0x41')]+'%'};return _0xba0849;})});}_0x29ce37=_[_0xbb7c('0x42')]({},_0x29ce37,_0xff6b05[_0xbb7c('0x44')]);var _0x3e8c51={'where':_0x29ce37[_0xbb7c('0x3e')]};return db[_0xbb7c('0x31')]['count'](_0x3e8c51)[_0xbb7c('0x28')](function(_0x8e74f6){_0x44f09c[_0xbb7c('0x21')]=_0x8e74f6;if(_0xff6b05[_0xbb7c('0x35')]['includeAll']){_0x29ce37[_0xbb7c('0x45')]=[{'all':!![]}];}return db[_0xbb7c('0x31')][_0xbb7c('0x46')](_0x29ce37);})[_0xbb7c('0x28')](function(_0x362203){_0x44f09c[_0xbb7c('0x47')]=_0x362203;return _0x44f09c;})[_0xbb7c('0x28')](respondWithFilteredResult(_0x4ee800,_0x29ce37))[_0xbb7c('0x48')](handleError(_0x4ee800,null));})['catch'](handleError(_0x4ee800,null));};exports['show']=function(_0x5d15f6,_0x4fd300){var _0x27d061={'raw':![],'where':{'id':_0x5d15f6['params']['id']}},_0x4cdee0={};_0x4cdee0[_0xbb7c('0x33')]=_[_0xbb7c('0x34')](db[_0xbb7c('0x31')]['rawAttributes']);_0x4cdee0[_0xbb7c('0x35')]=_[_0xbb7c('0x34')](_0x5d15f6['query']);_0x4cdee0[_0xbb7c('0x3f')]=_[_0xbb7c('0x36')](_0x4cdee0[_0xbb7c('0x33')],_0x4cdee0[_0xbb7c('0x35')]);_0x27d061[_0xbb7c('0x37')]=_[_0xbb7c('0x36')](_0x4cdee0[_0xbb7c('0x33')],qs[_0xbb7c('0x38')](_0x5d15f6['query']['fields']));_0x27d061[_0xbb7c('0x37')]=_0x27d061[_0xbb7c('0x37')][_0xbb7c('0x39')]?_0x27d061[_0xbb7c('0x37')]:_0x4cdee0[_0xbb7c('0x33')];if(_0x5d15f6[_0xbb7c('0x35')]['includeAll']){_0x27d061['include']=[{'all':!![]}];}_0x27d061=_['merge']({},_0x27d061,_0x5d15f6[_0xbb7c('0x44')]);return db['CmCompany'][_0xbb7c('0x49')](_0x27d061)[_0xbb7c('0x28')](handleEntityNotFound(_0x4fd300,null))[_0xbb7c('0x28')](respondWithResult(_0x4fd300,null))[_0xbb7c('0x48')](handleError(_0x4fd300,null));};exports[_0xbb7c('0x4a')]=function(_0x519761,_0x34571a){return db[_0xbb7c('0x31')][_0xbb7c('0x4a')](_0x519761[_0xbb7c('0x4b')],{})[_0xbb7c('0x28')](function(_0x831d4a){var _0x221efd=_0x519761['user'][_0xbb7c('0x2a')]({'plain':!![]});if(!_0x221efd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x221efd['role']==='user'){var _0x5ec345=_0x831d4a[_0xbb7c('0x2a')]({'plain':!![]});var _0x186d3d=_0xbb7c('0x2b');return db['UserProfileSection'][_0xbb7c('0x49')]({'where':{'name':_0x186d3d,'userProfileId':_0x221efd[_0xbb7c('0x4c')]},'raw':!![]})['then'](function(_0x2a50a7){if(_0x2a50a7&&_0x2a50a7[_0xbb7c('0x4d')]===0x0){return db['UserProfileResource'][_0xbb7c('0x4a')]({'name':_0x5ec345[_0xbb7c('0x2e')],'resourceId':_0x5ec345['id'],'type':_0x2a50a7[_0xbb7c('0x2e')],'sectionId':_0x2a50a7['id']},{})[_0xbb7c('0x28')](function(){return _0x831d4a;});}else{return _0x831d4a;}})[_0xbb7c('0x48')](function(_0x472eec){logger['error'](_0xbb7c('0x4e'),_0x472eec);throw _0x472eec;});}return _0x831d4a;})[_0xbb7c('0x28')](respondWithResult(_0x34571a,0xc9))[_0xbb7c('0x48')](handleError(_0x34571a,null));};exports['update']=function(_0x3b0b12,_0x18f333){if(_0x3b0b12['body']['id']){delete _0x3b0b12['body']['id'];}return db['CmCompany'][_0xbb7c('0x49')]({'where':{'id':_0x3b0b12[_0xbb7c('0x4f')]['id']}})[_0xbb7c('0x28')](handleEntityNotFound(_0x18f333,null))[_0xbb7c('0x28')](saveUpdates(_0x3b0b12[_0xbb7c('0x4b')],null))[_0xbb7c('0x28')](respondWithResult(_0x18f333,null))['catch'](handleError(_0x18f333,null));};exports[_0xbb7c('0x29')]=function(_0x5da239,_0xee7d6){return db['CmCompany'][_0xbb7c('0x49')]({'where':{'id':_0x5da239[_0xbb7c('0x4f')]['id']}})[_0xbb7c('0x28')](handleEntityNotFound(_0xee7d6,null))['then'](removeEntity(_0xee7d6,null))[_0xbb7c('0x48')](handleError(_0xee7d6,null));};exports['describe']=function(_0x21552d,_0x10b3bb){return db[_0xbb7c('0x31')][_0xbb7c('0x32')]()[_0xbb7c('0x28')](respondWithResult(_0x10b3bb,null))[_0xbb7c('0x48')](handleError(_0x10b3bb,null));};exports['addContacts']=function(_0x4b3a9d,_0x10225a,_0x171e89){return db[_0xbb7c('0x50')]['find']({'where':{'id':_0x4b3a9d['params']['id']}})[_0xbb7c('0x28')](handleEntityNotFound(_0x10225a,null))[_0xbb7c('0x28')](function(_0x103a3d){if(_0x103a3d){return _0x103a3d[_0xbb7c('0x51')](_0x4b3a9d[_0xbb7c('0x4b')][_0xbb7c('0x52')],_[_0xbb7c('0x53')](_0x4b3a9d[_0xbb7c('0x4b')],[_0xbb7c('0x52'),'id'])||{});}})[_0xbb7c('0x28')](respondWithResult(_0x10225a,null))[_0xbb7c('0x48')](handleError(_0x10225a,null));};exports[_0xbb7c('0x54')]=function(_0x302818,_0x22c4c2,_0x3d0e6f){var _0x479b0d={};var _0x1e2a99={};var _0x376571;var _0x54e3c7;return db[_0xbb7c('0x31')]['findOne']({'where':{'id':_0x302818[_0xbb7c('0x4f')]['id']}})[_0xbb7c('0x28')](handleEntityNotFound(_0x22c4c2,null))[_0xbb7c('0x28')](function(_0x59ac5e){if(_0x59ac5e){_0x376571=_0x59ac5e;_0x1e2a99[_0xbb7c('0x33')]=_[_0xbb7c('0x34')](db[_0xbb7c('0x50')][_0xbb7c('0x55')]);_0x1e2a99[_0xbb7c('0x35')]=_[_0xbb7c('0x34')](_0x302818[_0xbb7c('0x35')]);_0x1e2a99['filters']=_[_0xbb7c('0x36')](_0x1e2a99['model'],_0x1e2a99['query']);_0x479b0d[_0xbb7c('0x37')]=_[_0xbb7c('0x36')](_0x1e2a99[_0xbb7c('0x33')],qs[_0xbb7c('0x38')](_0x302818[_0xbb7c('0x35')]['fields']));_0x479b0d[_0xbb7c('0x37')]=_0x479b0d[_0xbb7c('0x37')]['length']?_0x479b0d[_0xbb7c('0x37')]:_0x1e2a99['model'];_0x479b0d[_0xbb7c('0x3c')]=qs[_0xbb7c('0x3d')](_0x302818[_0xbb7c('0x35')][_0xbb7c('0x3d')]);_0x479b0d[_0xbb7c('0x3e')]=qs['filters'](_[_0xbb7c('0x40')](_0x302818[_0xbb7c('0x35')],_0x1e2a99[_0xbb7c('0x3f')]));if(_0x302818[_0xbb7c('0x35')]['filter']){_0x479b0d['where']=_['merge'](_0x479b0d[_0xbb7c('0x3e')],{'$or':_[_0xbb7c('0x43')](_0x479b0d[_0xbb7c('0x37')],function(_0x3b3f20){var _0x500f38={};_0x500f38[_0x3b3f20]={'$like':'%'+_0x302818[_0xbb7c('0x35')][_0xbb7c('0x41')]+'%'};return _0x500f38;})});}_0x479b0d=_['merge']({},_0x479b0d,_0x302818['options']);return _0x376571['getContacts'](_0x479b0d);}})[_0xbb7c('0x28')](function(_0x43da0f){if(_0x43da0f){_0x54e3c7=_0x43da0f[_0xbb7c('0x39')];if(!_0x302818['query'][_0xbb7c('0x3a')](_0xbb7c('0x3b'))){_0x479b0d[_0xbb7c('0x20')]=qs['limit'](_0x302818[_0xbb7c('0x35')][_0xbb7c('0x20')]);_0x479b0d[_0xbb7c('0x1e')]=qs[_0xbb7c('0x1e')](_0x302818[_0xbb7c('0x35')][_0xbb7c('0x1e')]);}return _0x376571[_0xbb7c('0x54')](_0x479b0d);}})[_0xbb7c('0x28')](function(_0x163d6b){if(_0x163d6b){return _0x163d6b?{'count':_0x54e3c7,'rows':_0x163d6b}:null;}})[_0xbb7c('0x28')](respondWithResult(_0x22c4c2,null))['catch'](handleError(_0x22c4c2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index cbc6cb4..db86101 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 _0x7e8d=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x30b94b,_0x5c8835){var _0x18e929=function(_0x3789ca){while(--_0x3789ca){_0x30b94b['push'](_0x30b94b['shift']());}};_0x18e929(++_0x5c8835);}(_0x7e8d,0x17a));var _0xd7e8=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x7e8d[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0xd7e8('0x0'));var util=require(_0xd7e8('0x1'));var logger=require(_0xd7e8('0x2'))(_0xd7e8('0x3'));var moment=require(_0xd7e8('0x4'));var BPromise=require(_0xd7e8('0x5'));var rp=require(_0xd7e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7e8('0x7'));var config=require(_0xd7e8('0x8'));var attributes=require('./cmCompany.attributes');module[_0xd7e8('0x9')]=function(_0x1dd36d,_0x3c8a04){return _0x1dd36d[_0xd7e8('0xa')](_0xd7e8('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabaf=['exports','define','CmCompany','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x57e76d,_0x227ae3){var _0xfcb1be=function(_0x47cef5){while(--_0x47cef5){_0x57e76d['push'](_0x57e76d['shift']());}};_0xfcb1be(++_0x227ae3);}(_0xabaf,0x19d));var _0xfaba=function(_0x468403,_0x503cea){_0x468403=_0x468403-0x0;var _0x231ccb=_0xabaf[_0x468403];return _0x231ccb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xfaba('0x0'));var moment=require('moment');var BPromise=require(_0xfaba('0x1'));var rp=require(_0xfaba('0x2'));var fs=require('fs');var path=require(_0xfaba('0x3'));var rimraf=require(_0xfaba('0x4'));var config=require(_0xfaba('0x5'));var attributes=require(_0xfaba('0x6'));module[_0xfaba('0x7')]=function(_0x3d0d0d,_0x7ac439){return _0x3d0d0d[_0xfaba('0x8')](_0xfaba('0x9'),attributes,{'tableName':'cm_companies','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 05eb7c5..2e600a5 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 _0x84e0=['client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x84e0,0x19b));var _0x084e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x084e('0x0'));var util=require('util');var moment=require(_0x084e('0x1'));var BPromise=require('bluebird');var rs=require(_0x084e('0x2'));var fs=require('fs');var Redis=require(_0x084e('0x3'));var db=require(_0x084e('0x4'))['db'];var utils=require(_0x084e('0x5'));var logger=require(_0x084e('0x6'))('rpc');var config=require(_0x084e('0x7'));var jayson=require(_0x084e('0x8'));var client=jayson[_0x084e('0x9')][_0x084e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28b80c,_0x16e229,_0x4d9f96){return new BPromise(function(_0x451b21,_0x165764){return client['request'](_0x28b80c,_0x4d9f96)[_0x084e('0xb')](function(_0x52929f){logger['info'](_0x084e('0xc'),_0x16e229,_0x084e('0xd'));logger['debug'](_0x084e('0xe'),_0x16e229,_0x084e('0xd'),JSON[_0x084e('0xf')](_0x52929f));if(_0x52929f['error']){if(_0x52929f[_0x084e('0x10')]['code']===0x1f4){logger['error'](_0x084e('0xc'),_0x16e229,_0x52929f['error'][_0x084e('0x11')]);return _0x165764(_0x52929f[_0x084e('0x10')]['message']);}logger[_0x084e('0x10')](_0x084e('0xc'),_0x16e229,_0x52929f['error'][_0x084e('0x11')]);return _0x451b21(_0x52929f['error']['message']);}else{logger[_0x084e('0x12')]('CmCompany,\x20%s,\x20%s',_0x16e229,_0x084e('0xd'));_0x451b21(_0x52929f[_0x084e('0x13')]['message']);}})['catch'](function(_0x579e2f){logger['error'](_0x084e('0xc'),_0x16e229,_0x579e2f);_0x165764(_0x579e2f);});});} \ No newline at end of file +var _0x5988=['../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5cb201,_0x576dc7){var _0x567d69=function(_0x245d06){while(--_0x245d06){_0x5cb201['push'](_0x5cb201['shift']());}};_0x567d69(++_0x576dc7);}(_0x5988,0x176));var _0x8598=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x5988[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x8598('0x0'));var util=require('util');var moment=require(_0x8598('0x1'));var BPromise=require(_0x8598('0x2'));var rs=require(_0x8598('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8598('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8598('0x5'))('rpc');var config=require(_0x8598('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8598('0x7')][_0x8598('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54e02d,_0x2db8dd,_0x13c5ff){return new BPromise(function(_0x22f168,_0x151dbd){return client[_0x8598('0x9')](_0x54e02d,_0x13c5ff)[_0x8598('0xa')](function(_0x3fba22){logger[_0x8598('0xb')](_0x8598('0xc'),_0x2db8dd,_0x8598('0xd'));logger['debug'](_0x8598('0xe'),_0x2db8dd,'request\x20sent',JSON['stringify'](_0x3fba22));if(_0x3fba22[_0x8598('0xf')]){if(_0x3fba22[_0x8598('0xf')][_0x8598('0x10')]===0x1f4){logger['error'](_0x8598('0xc'),_0x2db8dd,_0x3fba22['error'][_0x8598('0x11')]);return _0x151dbd(_0x3fba22['error'][_0x8598('0x11')]);}logger[_0x8598('0xf')](_0x8598('0xc'),_0x2db8dd,_0x3fba22[_0x8598('0xf')][_0x8598('0x11')]);return _0x22f168(_0x3fba22[_0x8598('0xf')]['message']);}else{logger[_0x8598('0xb')](_0x8598('0xc'),_0x2db8dd,_0x8598('0xd'));_0x22f168(_0x3fba22['result'][_0x8598('0x11')]);}})[_0x8598('0x12')](function(_0x3dc89a){logger[_0x8598('0xf')](_0x8598('0xc'),_0x2db8dd,_0x3dc89a);_0x151dbd(_0x3dc89a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 75b52ba..8c28902 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 _0xebd7=['get','/describe','/:id','/:id/contacts','getContacts','post','addContacts','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x562531,_0x199718){var _0x557f79=function(_0x5e5cb7){while(--_0x5e5cb7){_0x562531['push'](_0x562531['shift']());}};_0x557f79(++_0x199718);}(_0xebd7,0x108));var _0x7ebd=function(_0x4d6311,_0x1134be){_0x4d6311=_0x4d6311-0x0;var _0x465d14=_0xebd7[_0x4d6311];return _0x465d14;};'use strict';var multer=require(_0x7ebd('0x0'));var util=require(_0x7ebd('0x1'));var path=require(_0x7ebd('0x2'));var timeout=require(_0x7ebd('0x3'));var express=require(_0x7ebd('0x4'));var router=express[_0x7ebd('0x5')]();var fs_extra=require(_0x7ebd('0x6'));var auth=require(_0x7ebd('0x7'));var interaction=require(_0x7ebd('0x8'));var config=require(_0x7ebd('0x9'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x7ebd('0xa')](),controller[_0x7ebd('0xb')]);router[_0x7ebd('0xc')](_0x7ebd('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x7ebd('0xc')](_0x7ebd('0xe'),auth[_0x7ebd('0xa')](),controller['show']);router[_0x7ebd('0xc')](_0x7ebd('0xf'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x10')]);router[_0x7ebd('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ebd('0x11')](_0x7ebd('0xf'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x12')]);router['put'](_0x7ebd('0xe'),auth['isAuthenticated'](),controller[_0x7ebd('0x13')]);router[_0x7ebd('0x14')](_0x7ebd('0xe'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x15')]);module[_0x7ebd('0x16')]=router; \ No newline at end of file +var _0xeba2=['isAuthenticated','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeba2,0x70));var _0x2eba=function(_0x16bd44,_0x3c91ba){_0x16bd44=_0x16bd44-0x0;var _0x368a61=_0xeba2[_0x16bd44];return _0x368a61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2eba('0x0'));var timeout=require(_0x2eba('0x1'));var express=require(_0x2eba('0x2'));var router=express[_0x2eba('0x3')]();var fs_extra=require(_0x2eba('0x4'));var auth=require(_0x2eba('0x5'));var interaction=require(_0x2eba('0x6'));var config=require(_0x2eba('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2eba('0x8')]);router[_0x2eba('0x9')](_0x2eba('0xa'),auth['isAuthenticated'](),controller[_0x2eba('0xb')]);router[_0x2eba('0x9')](_0x2eba('0xc'),auth[_0x2eba('0xd')](),controller[_0x2eba('0xe')]);router[_0x2eba('0x9')](_0x2eba('0xf'),auth[_0x2eba('0xd')](),controller[_0x2eba('0x10')]);router[_0x2eba('0x11')]('/',auth['isAuthenticated'](),controller[_0x2eba('0x12')]);router[_0x2eba('0x11')]('/:id/contacts',auth[_0x2eba('0xd')](),controller[_0x2eba('0x13')]);router[_0x2eba('0x14')](_0x2eba('0xc'),auth[_0x2eba('0xd')](),controller[_0x2eba('0x15')]);router[_0x2eba('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x2eba('0x17')]);module[_0x2eba('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 2d9d11f..907546b 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 _0x1ddc=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0xe81227,_0x3f6100){var _0x1461b1=function(_0x27f643){while(--_0x27f643){_0xe81227['push'](_0xe81227['shift']());}};_0x1461b1(++_0x3f6100);}(_0x1ddc,0x1eb));var _0xc1dd=function(_0x452ad6,_0x29f44a){_0x452ad6=_0x452ad6-0x0;var _0x4592e8=_0x1ddc[_0x452ad6];return _0x4592e8;};'use strict';var _=require(_0xc1dd('0x0'));var Sequelize=require(_0xc1dd('0x1'));module[_0xc1dd('0x2')]={'firstName':{'type':Sequelize[_0xc1dd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc1dd('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc1dd('0x3')]},'city':{'type':Sequelize[_0xc1dd('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xc1dd('0x3')]},'description':{'type':Sequelize[_0xc1dd('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xc1dd('0x3')]},'fax':{'type':Sequelize[_0xc1dd('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xc1dd('0x3')]},'facebook':{'type':Sequelize[_0xc1dd('0x3')]},'fb_data':{'type':Sequelize[_0xc1dd('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc1dd('0x3')]},'viber':{'type':Sequelize[_0xc1dd('0x3')]},'line':{'type':Sequelize[_0xc1dd('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xc1dd('0x5')](0x2)[_0xc1dd('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc1dd('0x7')],'defaultValue':Sequelize[_0xc1dd('0x8')]}}; \ No newline at end of file +var _0xee1c=['UNSIGNED','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x803e21,_0x53b8cf){var _0x501773=function(_0x6f5552){while(--_0x6f5552){_0x803e21['push'](_0x803e21['shift']());}};_0x501773(++_0x53b8cf);}(_0xee1c,0x6d));var _0xcee1=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xee1c[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xcee1('0x0'));var Sequelize=require(_0xcee1('0x1'));module[_0xcee1('0x2')]={'firstName':{'type':Sequelize[_0xcee1('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcee1('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xcee1('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xcee1('0x3')]},'dateOfBirth':{'type':Sequelize[_0xcee1('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xcee1('0x3')]},'mobile':{'type':Sequelize[_0xcee1('0x3')]},'fax':{'type':Sequelize[_0xcee1('0x3')]},'email':{'type':Sequelize[_0xcee1('0x3')]},'url':{'type':Sequelize[_0xcee1('0x3')]},'facebook':{'type':Sequelize[_0xcee1('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xcee1('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xcee1('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xcee1('0x3')]},'telegram':{'type':Sequelize[_0xcee1('0x3')]},'UserId':{'type':Sequelize[_0xcee1('0x4')]},'priority':{'type':Sequelize[_0xcee1('0x4')](0x2)[_0xcee1('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d7395b5..84aeb2a 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 _0x2722=['No\x20ListId\x20specified','binding_keys','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','server/files/tmp','filename','chmodSync','child_process','fork','../../components/import/cm/csv','binding_values','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','meta','import','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','starttime','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','createdAt','DESC','findAndCountAll','fullname','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','deviceModel','osName','referer','subject','substatus','externalUrl','startCase','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','status','limit','undefined','count','offset','json','update','then','end','sendStatus','error','stack','name','send','index','CmContact','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','type','model','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','select','field','color','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','DATE','text','start','hasOwnProperty','filter','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','QueryTypes','order','having','t.id\x20IN\x20?','role','agent','some','user','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','describe','tags','displayName','findAll','columnName','alias','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','destroy','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxMessage','OpenchannelInteraction','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','find','isNil','omit','format','cf_%d','$and','pickBy','table','setFields','phone','getTags','Tag','rawAttributes','merge','setTags','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv'];(function(_0x3a4b6c,_0x3b8490){var _0x59b956=function(_0x4c2d88){while(--_0x4c2d88){_0x3a4b6c['push'](_0x3a4b6c['shift']());}};_0x59b956(++_0x3b8490);}(_0x2722,0x15b));var _0x2272=function(_0x4ac5e8,_0x33597e){_0x4ac5e8=_0x4ac5e8-0x0;var _0x4ce27e=_0x2722[_0x4ac5e8];return _0x4ce27e;};'use strict';var moment=require(_0x2272('0x0'));var BPromise=require(_0x2272('0x1'));var util=require(_0x2272('0x2'));var path=require(_0x2272('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2272('0x4'));var Papa=require(_0x2272('0x5'));var Redis=require(_0x2272('0x6'));var qs=require(_0x2272('0x7'));var as=require(_0x2272('0x8'));var logger=require(_0x2272('0x9'))(_0x2272('0xa'));var config=require('../../config/environment');var db=require(_0x2272('0xb'))['db'];config['redis']=_['defaults'](config[_0x2272('0xc')],{'host':_0x2272('0xd'),'port':0x18eb});var socket=require(_0x2272('0xe'))(new Redis(config[_0x2272('0xc')]));require(_0x2272('0xf'))['register'](socket);function respondWithResult(_0x424fe7,_0x5d4642){_0x5d4642=_0x5d4642||0xc8;return function(_0x10ab73){if(_0x10ab73){return _0x424fe7[_0x2272('0x10')](_0x5d4642)['json'](_0x10ab73);}};}function respondWithFilteredResult(_0x227dd7,_0x81379b){return function(_0x4586a5){if(_0x4586a5){var _0x31207d=typeof _0x81379b['offset']==='undefined'&&typeof _0x81379b[_0x2272('0x11')]===_0x2272('0x12');var _0x930dd8=_0x4586a5[_0x2272('0x13')];var _0x106ad2=_0x31207d?0x0:_0x81379b['offset'];var _0xe5002c=_0x31207d?_0x4586a5['count']:_0x81379b[_0x2272('0x14')]+_0x81379b['limit'];var _0x446bff;if(_0xe5002c>=_0x930dd8){_0xe5002c=_0x930dd8;_0x446bff=0xc8;}else{_0x446bff=0xce;}_0x227dd7['status'](_0x446bff);return _0x227dd7['set']('Content-Range',_0x106ad2+'-'+_0xe5002c+'/'+_0x930dd8)[_0x2272('0x15')](_0x4586a5);}return null;};}function saveUpdates(_0x197c8e){return function(_0x546dea){if(_0x546dea){return _0x546dea[_0x2272('0x16')](_0x197c8e)[_0x2272('0x17')](function(_0x46c6f1){return _0x46c6f1;});}return null;};}function removeEntity(_0x362519){return function(_0x31621d){if(_0x31621d){return _0x31621d['destroy']()[_0x2272('0x17')](function(){_0x362519[_0x2272('0x10')](0xcc)[_0x2272('0x18')]();});}};}function handleEntityNotFound(_0x13c797){return function(_0x381ddc){if(!_0x381ddc){_0x13c797[_0x2272('0x19')](0x194);}return _0x381ddc;};}function handleError(_0x17dc3d,_0x3ea4c3){_0x3ea4c3=_0x3ea4c3||0x1f4;return function(_0x159b40){logger[_0x2272('0x1a')](_0x159b40[_0x2272('0x1b')]);if(_0x159b40[_0x2272('0x1c')]){delete _0x159b40[_0x2272('0x1c')];}_0x17dc3d[_0x2272('0x10')](_0x3ea4c3)[_0x2272('0x1d')](_0x159b40);};}exports[_0x2272('0x1e')]=function(_0x56186e,_0x30747d){var _0x1ca231={},_0x3b1454={},_0x4042cd={'count':0x0,'rows':[]};return db[_0x2272('0x1f')]['describe']()[_0x2272('0x17')](function(_0x155c88){var _0x5d17d2=[];for(var _0x2b6c76=0x0;_0x2b6c760x1){_0x207172['or'](_0x2272('0x5c'),qs[_0x2272('0x5d')](_0x3329dc),null);}else{if(qs[_0x2272('0x5e')](_0x3329dc)){_0x207172['or'](_0x2272('0x5f'),_0x3329dc+'%');_0x207172['or'](_0x2272('0x60'),_0x3329dc+'%');_0x207172['or'](_0x2272('0x61'),_0x3329dc+'%');_0x207172['or'](_0x2272('0x62'),_0x3329dc+'%');}else if(qs[_0x2272('0x63')](_0x3329dc)){_0x207172['or'](_0x2272('0x64'),_0x3329dc+'%');}else{_0x207172['or'](_0x2272('0x65'),'%'+_0x3329dc+'%');_0x207172['or']('c.lastName\x20LIKE\x20?','%'+_0x3329dc+'%');_0x207172['or'](_0x2272('0x64'),'%'+_0x3329dc+'%');}}}}_0x22c3d2['where'](_0x207172);_0x22c3d2[_0x2272('0x66')](_0x2272('0x67'));var _0x3dea5c={'type':db['Sequelize'][_0x2272('0x68')]['SELECT'],'raw':!![]};var _0x35071e=_0x22c3d2['clone']()[_0x2272('0x35')](_0x2272('0x67'));if(_0x1ca231[_0x2272('0x69')]){_0x1ca231[_0x2272('0x69')][_0x2272('0x54')](function(_0x331525){_0x22c3d2[_0x2272('0x69')]('c.'+_0x331525[0x0],_0x331525[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2272('0x53')](_0x44eb08)){_0x22c3d2[_0x2272('0x6a')](_0x157fa2);_0x35071e[_0x2272('0x31')](_0x2272('0x6b'),_0x44eb08);}BPromise['resolve']()[_0x2272('0x17')](function(){if(!_0x518b74)return;if(_0x56186e['user'][_0x2272('0x6c')]!==_0x2272('0x6d'))return;if(!_[_0x2272('0x6e')](_0x518b74[_0x2272('0x44')],[_0x2272('0x35'),_0x2272('0x4a')])){return _0x56186e[_0x2272('0x6f')]['getLists']({'attributes':['id'],'raw':!![]})[_0x2272('0x17')](function(_0x33ad70){if(_['isEmpty'](_0x33ad70)){_0x35071e[_0x2272('0x31')]('c.ListId\x20IS\x20NULL');_0x22c3d2[_0x2272('0x31')](_0x2272('0x70'));}else{_0x35071e[_0x2272('0x31')](_0x2272('0x56'),_[_0x2272('0x47')](_0x33ad70,'id'));_0x22c3d2[_0x2272('0x31')](_0x2272('0x56'),_['map'](_0x33ad70,'id'));}});}})[_0x2272('0x17')](function(){if(_0x56186e[_0x2272('0x6f')][_0x2272('0x6c')]==='agent'&&!_0x518b74&&!_0x56186e[_0x2272('0x2b')]['ListId'])return[];return db[_0x2272('0x71')]['query'](_0x35071e[_0x2272('0x72')](),_0x3dea5c);})[_0x2272('0x17')](function(_0x164cd4){_0x4042cd[_0x2272('0x13')]=_0x164cd4[_0x2272('0x21')];if(_0x4042cd[_0x2272('0x13')]===0x0)return[];return db['sequelize']['query'](_0xf8cd72['toString'](),_0x3dea5c)[_0x2272('0x17')](function(_0x5c6951){_0x5d6aaf=_[_0x2272('0x73')](_0x5c6951,'id');_0x3dea5c=_['merge'](_0x3dea5c,{'model':db[_0x2272('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x56186e[_0x2272('0x2b')][_0x2272('0x2e')]){_0x1ca231['attributes']['forEach'](function(_0x10f5a6){_0x22c3d2[_0x2272('0x35')]('c.'+_0x10f5a6);});}else{_0x22c3d2[_0x2272('0x35')](_0x2272('0x67'));_0x22c3d2[_0x2272('0x35')]('c.firstName');_0x22c3d2[_0x2272('0x35')](_0x2272('0x74'));_0x22c3d2['field'](_0x2272('0x75'));_0x22c3d2[_0x2272('0x35')]('c.mobile');_0x22c3d2[_0x2272('0x35')](_0x2272('0x76'));_0x22c3d2[_0x2272('0x35')](_0x2272('0x77'));_0x22c3d2[_0x2272('0x35')](_0x2272('0x78'));_0x22c3d2[_0x2272('0x35')](_0x2272('0x79'));_0x22c3d2[_0x2272('0x35')]('c.deletedAt');_0x22c3d2['field']('c.CompanyId');_0x22c3d2[_0x2272('0x35')](_0x2272('0x7a'),_0x2272('0x7b'));}if(_0x1ca231[_0x2272('0x11')])_0x22c3d2[_0x2272('0x11')](_0x1ca231[_0x2272('0x11')]);if(_0x1ca231[_0x2272('0x14')])_0x22c3d2[_0x2272('0x14')](_0x1ca231['offset']);return db['sequelize'][_0x2272('0x2b')](_0x22c3d2[_0x2272('0x72')](),_0x3dea5c);});})[_0x2272('0x17')](function(_0x298b70){_0x298b70[_0x2272('0x54')](function(_0x24f56c){if(_0x24f56c[_0x2272('0x7b')]){_0x24f56c[_0x2272('0x7c')]=[];_0x24f56c[_0x2272('0x7b')][_0x2272('0x46')](',')[_0x2272('0x54')](function(_0x3e7be3){_0x24f56c[_0x2272('0x7c')][_0x2272('0x24')](_0x5d6aaf[_0x3e7be3]);});}delete _0x24f56c[_0x2272('0x7b')];});_0x4042cd[_0x2272('0x7d')]=_0x298b70;return _0x4042cd;})[_0x2272('0x17')](respondWithFilteredResult(_0x30747d,_0x1ca231));})['catch'](handleError(_0x30747d,null));};exports['destroy']=function(_0x48ec13,_0xdc79ee){return db[_0x2272('0x1f')]['find']({'where':{'id':_0x48ec13[_0x2272('0x7e')]['id']}})[_0x2272('0x17')](handleEntityNotFound(_0xdc79ee,null))[_0x2272('0x17')](removeEntity(_0xdc79ee,null))[_0x2272('0x7f')](handleError(_0xdc79ee,null));};exports[_0x2272('0x80')]=function(_0x1157d4,_0x28c9b5){return db[_0x2272('0x1f')][_0x2272('0x80')]()['then'](function(_0x192e8d){delete _0x192e8d[_0x2272('0x81')];for(var _0xb99b22=0x0;_0xb99b22=_0x93bbbc){_0x583664=_0x93bbbc;_0x5d5e6a=0xc8;}else{_0x5d5e6a=0xce;}_0x351d14[_0x3272('0x13')](_0x5d5e6a);return _0x351d14['set'](_0x3272('0x19'),_0x4ab563+'-'+_0x583664+'/'+_0x93bbbc)['json'](_0x142f06);}return null;};}function saveUpdates(_0x59f456){return function(_0x520957){if(_0x520957){return _0x520957[_0x3272('0x1a')](_0x59f456)['then'](function(_0x9f52a5){return _0x9f52a5;});}return null;};}function removeEntity(_0x1268ff){return function(_0x121e51){if(_0x121e51){return _0x121e51[_0x3272('0x1b')]()[_0x3272('0x1c')](function(){_0x1268ff[_0x3272('0x13')](0xcc)[_0x3272('0x1d')]();});}};}function handleEntityNotFound(_0x53c18d){return function(_0x30bf07){if(!_0x30bf07){_0x53c18d[_0x3272('0x1e')](0x194);}return _0x30bf07;};}function handleError(_0x139526,_0x427010){_0x427010=_0x427010||0x1f4;return function(_0x4a839b){logger['error'](_0x4a839b[_0x3272('0x1f')]);if(_0x4a839b[_0x3272('0x20')]){delete _0x4a839b[_0x3272('0x20')];}_0x139526[_0x3272('0x13')](_0x427010)[_0x3272('0x21')](_0x4a839b);};}exports[_0x3272('0x22')]=function(_0x9a8f0c,_0x318ec7){var _0x41e703={},_0x334251={},_0x2bbf70={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x3272('0x1c')](function(_0x2e7ac4){var _0x2e4f81=[];for(var _0x57741a=0x0;_0x57741a0x1){_0xfc09e6['or'](_0x3272('0x61'),qs[_0x3272('0x62')](_0x3086f1),null);}else{if(qs['isNumeric'](_0x3086f1)){_0xfc09e6['or'](_0x3272('0x63'),_0x3086f1+'%');_0xfc09e6['or']('c.phone\x20LIKE\x20?',_0x3086f1+'%');_0xfc09e6['or'](_0x3272('0x64'),_0x3086f1+'%');_0xfc09e6['or']('c.fax\x20LIKE\x20?',_0x3086f1+'%');}else if(qs[_0x3272('0x65')](_0x3086f1)){_0xfc09e6['or']('c.email\x20LIKE\x20?',_0x3086f1+'%');}else{_0xfc09e6['or'](_0x3272('0x66'),'%'+_0x3086f1+'%');_0xfc09e6['or'](_0x3272('0x67'),'%'+_0x3086f1+'%');_0xfc09e6['or'](_0x3272('0x68'),'%'+_0x3086f1+'%');}}}}_0x4383cd[_0x3272('0x35')](_0xfc09e6);_0x4383cd['group']('c.id');var _0x46da50={'type':db['Sequelize'][_0x3272('0x69')]['SELECT'],'raw':!![]};var _0x152ff9=_0x4383cd[_0x3272('0x6a')]()[_0x3272('0x39')](_0x3272('0x6b'));if(_0x41e703[_0x3272('0x33')]){_0x41e703[_0x3272('0x33')][_0x3272('0x4c')](function(_0x18c859){_0x4383cd[_0x3272('0x33')]('c.'+_0x18c859[0x0],_0x18c859[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3272('0x6c')](_0x13f32b)){_0x4383cd[_0x3272('0x6d')](_0x3e4d74);_0x152ff9[_0x3272('0x35')]('t.id\x20IN\x20?',_0x13f32b);}BPromise[_0x3272('0x6e')]()['then'](function(){if(!_0x4a6400)return;if(_0x9a8f0c[_0x3272('0x6f')][_0x3272('0x70')]!=='agent')return;if(!_['some'](_0x4a6400[_0x3272('0x47')],[_0x3272('0x39'),_0x3272('0x4f')])){return _0x9a8f0c[_0x3272('0x6f')][_0x3272('0x71')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b0449){if(_[_0x3272('0x6c')](_0x3b0449)){_0x152ff9[_0x3272('0x35')]('c.ListId\x20IS\x20NULL');_0x4383cd[_0x3272('0x35')](_0x3272('0x72'));}else{_0x152ff9[_0x3272('0x35')](_0x3272('0x5c'),_['map'](_0x3b0449,'id'));_0x4383cd[_0x3272('0x35')](_0x3272('0x5c'),_['map'](_0x3b0449,'id'));}});}})[_0x3272('0x1c')](function(){if(_0x9a8f0c[_0x3272('0x6f')][_0x3272('0x70')]===_0x3272('0x73')&&!_0x4a6400&&!_0x9a8f0c['query'][_0x3272('0x5b')])return[];return db[_0x3272('0x74')][_0x3272('0x2d')](_0x152ff9[_0x3272('0x75')](),_0x46da50);})[_0x3272('0x1c')](function(_0x43eb12){_0x2bbf70['count']=_0x43eb12[_0x3272('0x24')];if(_0x2bbf70[_0x3272('0x17')]===0x0)return[];return db[_0x3272('0x74')][_0x3272('0x2d')](_0x22b39f[_0x3272('0x75')](),_0x46da50)[_0x3272('0x1c')](function(_0x31098a){_0x3a952b=_['keyBy'](_0x31098a,'id');_0x46da50=_[_0x3272('0x76')](_0x46da50,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9a8f0c[_0x3272('0x2d')][_0x3272('0x30')]){_0x41e703[_0x3272('0x2f')][_0x3272('0x4c')](function(_0x3f3fb4){_0x4383cd[_0x3272('0x39')]('c.'+_0x3f3fb4);});}else{_0x4383cd[_0x3272('0x39')]('c.id');_0x4383cd[_0x3272('0x39')]('c.firstName');_0x4383cd[_0x3272('0x39')]('c.lastName');_0x4383cd[_0x3272('0x39')](_0x3272('0x77'));_0x4383cd[_0x3272('0x39')](_0x3272('0x78'));_0x4383cd[_0x3272('0x39')](_0x3272('0x79'));_0x4383cd[_0x3272('0x39')]('c.email');_0x4383cd[_0x3272('0x39')](_0x3272('0x7a'));_0x4383cd[_0x3272('0x39')]('c.createdAt');_0x4383cd[_0x3272('0x39')](_0x3272('0x7b'));_0x4383cd[_0x3272('0x39')](_0x3272('0x7c'));_0x4383cd[_0x3272('0x39')](_0x3272('0x7d'),_0x3272('0x7e'));}if(_0x41e703[_0x3272('0x18')])_0x4383cd[_0x3272('0x18')](_0x41e703[_0x3272('0x18')]);if(_0x41e703[_0x3272('0x15')])_0x4383cd[_0x3272('0x15')](_0x41e703[_0x3272('0x15')]);return db[_0x3272('0x74')][_0x3272('0x2d')](_0x4383cd[_0x3272('0x75')](),_0x46da50);});})['then'](function(_0xcbbb0e){_0xcbbb0e[_0x3272('0x4c')](function(_0x42d7c1){if(_0x42d7c1['TagIds']){_0x42d7c1[_0x3272('0x7f')]=[];_0x42d7c1[_0x3272('0x7e')][_0x3272('0x60')](',')['forEach'](function(_0x4992fc){_0x42d7c1[_0x3272('0x7f')]['push'](_0x3a952b[_0x4992fc]);});}delete _0x42d7c1[_0x3272('0x7e')];});_0x2bbf70[_0x3272('0x80')]=_0xcbbb0e;return _0x2bbf70;})[_0x3272('0x1c')](respondWithFilteredResult(_0x318ec7,_0x41e703));})['catch'](handleError(_0x318ec7,null));};exports[_0x3272('0x1b')]=function(_0x3d33ab,_0x78845){return db['CmContact'][_0x3272('0x48')]({'where':{'id':_0x3d33ab[_0x3272('0x81')]['id']}})[_0x3272('0x1c')](handleEntityNotFound(_0x78845,null))[_0x3272('0x1c')](removeEntity(_0x78845,null))[_0x3272('0x82')](handleError(_0x78845,null));};exports[_0x3272('0x83')]=function(_0x3a749f,_0x190e3c){return db[_0x3272('0x84')][_0x3272('0x83')]()[_0x3272('0x1c')](function(_0x5c4418){delete _0x5c4418['tags'];for(var _0x2465c0=0x0;_0x2465c0{}\s\\|]/g,'-');_0x187d93(null,util[_0x7311('0x22')](_0x7311('0x23'),path['basename'](_0x45dbd1[_0x7311('0x20')],path[_0x7311('0x24')](_0x45dbd1[_0x7311('0x20')])),Date['now'](),path[_0x7311('0x24')](_0x45dbd1[_0x7311('0x20')])));}})});router['post'](_0x7311('0x25'),upload['single'](_0x7311('0x26')),controller[_0x7311('0x27')]);var upload=multer({'storage':multer[_0x7311('0x1c')]({'destination':function(_0x289ca4,_0x1daad0,_0x3979e9){_0x3979e9(null,path[_0x7311('0x1d')](config['root'],_0x7311('0x1f')));},'filename':function(_0x22210b,_0x4ac28c,_0x528ba8){_0x4ac28c[_0x7311('0x20')]=_0x4ac28c[_0x7311('0x20')][_0x7311('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x528ba8(null,util[_0x7311('0x22')]('%s-%s%s',path[_0x7311('0x28')](_0x4ac28c['originalname'],path['extname'](_0x4ac28c['originalname'])),Date[_0x7311('0x29')](),path['extname'](_0x4ac28c['originalname'])));}})});router['post'](_0x7311('0x2a'),upload['single'](_0x7311('0x26')),controller[_0x7311('0x2b')]);router['post'](_0x7311('0x2c'),auth['isAuthenticated'](),controller[_0x7311('0x2d')]);router[_0x7311('0x2e')](_0x7311('0xc'),auth[_0x7311('0x8')](),controller[_0x7311('0x2f')]);router[_0x7311('0x30')](_0x7311('0xc'),auth[_0x7311('0x8')](),controller[_0x7311('0x31')]);module[_0x7311('0x32')]=router; \ No newline at end of file +var _0xd94b=['./cmContact.controller','isAuthenticated','get','/describe','describe','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','single','/upload','file','upload','/upload/:id','import','put','/:id','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2ab890,_0x34bd7b){var _0x495aa8=function(_0x1fbf62){while(--_0x1fbf62){_0x2ab890['push'](_0x2ab890['shift']());}};_0x495aa8(++_0x34bd7b);}(_0xd94b,0xe4));var _0xbd94=function(_0x5e8763,_0x558211){_0x5e8763=_0x5e8763-0x0;var _0x286b08=_0xd94b[_0x5e8763];return _0x286b08;};'use strict';var multer=require(_0xbd94('0x0'));var util=require('util');var path=require(_0xbd94('0x1'));var timeout=require(_0xbd94('0x2'));var express=require(_0xbd94('0x3'));var router=express[_0xbd94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd94('0x5'));var interaction=require(_0xbd94('0x6'));var config=require('../../config/environment');var controller=require(_0xbd94('0x7'));router['get']('/',auth[_0xbd94('0x8')](),controller['index']);router[_0xbd94('0x9')](_0xbd94('0xa'),auth[_0xbd94('0x8')](),controller[_0xbd94('0xb')]);router[_0xbd94('0x9')]('/:id',auth[_0xbd94('0x8')](),controller[_0xbd94('0xc')]);router[_0xbd94('0x9')](_0xbd94('0xd'),auth[_0xbd94('0x8')](),controller['getTags']);router[_0xbd94('0x9')](_0xbd94('0xe'),auth[_0xbd94('0x8')](),controller[_0xbd94('0xf')]);router[_0xbd94('0x9')](_0xbd94('0x10'),auth[_0xbd94('0x8')](),controller['getHopperHistories']);router[_0xbd94('0x9')](_0xbd94('0x11'),auth[_0xbd94('0x8')](),controller['getHopperFinals']);router[_0xbd94('0x9')](_0xbd94('0x12'),auth['isAuthenticated'](),controller[_0xbd94('0x13')]);router[_0xbd94('0x9')]('/:id/journey',auth[_0xbd94('0x8')](),controller[_0xbd94('0x14')]);router[_0xbd94('0x15')](_0xbd94('0x16'),auth[_0xbd94('0x8')](),controller[_0xbd94('0x17')]);router['post']('/',auth[_0xbd94('0x8')](),controller[_0xbd94('0x18')]);router[_0xbd94('0x15')](_0xbd94('0x19'),auth[_0xbd94('0x8')](),controller[_0xbd94('0x1a')]);router[_0xbd94('0x15')](_0xbd94('0xd'),auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer[_0xbd94('0x1b')]({'destination':function(_0x3e2302,_0x1912da,_0x4cb0cc){_0x4cb0cc(null,path[_0xbd94('0x1c')](config[_0xbd94('0x1d')],_0xbd94('0x1e')));},'filename':function(_0x3b6f79,_0x724536,_0x2f5ff9){_0x724536[_0xbd94('0x1f')]=_0x724536[_0xbd94('0x1f')][_0xbd94('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f5ff9(null,util[_0xbd94('0x21')](_0xbd94('0x22'),path[_0xbd94('0x23')](_0x724536['originalname'],path[_0xbd94('0x24')](_0x724536[_0xbd94('0x1f')])),Date[_0xbd94('0x25')](),path[_0xbd94('0x24')](_0x724536[_0xbd94('0x1f')])));}})});router[_0xbd94('0x15')]('/csv',upload[_0xbd94('0x26')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xbd94('0x1b')]({'destination':function(_0x5632a2,_0x2d4e24,_0x14854c){_0x14854c(null,path[_0xbd94('0x1c')](config[_0xbd94('0x1d')],_0xbd94('0x1e')));},'filename':function(_0xd813de,_0x2aa116,_0x37e772){_0x2aa116[_0xbd94('0x1f')]=_0x2aa116[_0xbd94('0x1f')][_0xbd94('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37e772(null,util[_0xbd94('0x21')](_0xbd94('0x22'),path[_0xbd94('0x23')](_0x2aa116[_0xbd94('0x1f')],path[_0xbd94('0x24')](_0x2aa116[_0xbd94('0x1f')])),Date[_0xbd94('0x25')](),path[_0xbd94('0x24')](_0x2aa116[_0xbd94('0x1f')])));}})});router[_0xbd94('0x15')](_0xbd94('0x27'),upload[_0xbd94('0x26')](_0xbd94('0x28')),controller[_0xbd94('0x29')]);router[_0xbd94('0x15')](_0xbd94('0x2a'),auth[_0xbd94('0x8')](),controller[_0xbd94('0x2b')]);router[_0xbd94('0x2c')](_0xbd94('0x2d'),auth['isAuthenticated'](),controller[_0xbd94('0x2e')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);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 97559de..ba780fb 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 _0x46d8=['setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select','values','isArray'];(function(_0x5e046d,_0x4f33e7){var _0x179d55=function(_0x3a3d7f){while(--_0x3a3d7f){_0x5e046d['push'](_0x5e046d['shift']());}};_0x179d55(++_0x4f33e7);}(_0x46d8,0x135));var _0x846d=function(_0x127c7e,_0x470192){_0x127c7e=_0x127c7e-0x0;var _0x45f955=_0x46d8[_0x127c7e];return _0x45f955;};'use strict';var Sequelize=require(_0x846d('0x0'));var _=require(_0x846d('0x1'));module[_0x846d('0x2')]={'name':{'type':Sequelize[_0x846d('0x3')],'get':function(_0x324a9b){return this[_0x846d('0x4')](_0x846d('0x5'));}},'alias':{'type':Sequelize[_0x846d('0x6')],'allowNull':![],'set':function(_0x4f14b7){this['setDataValue'](_0x846d('0x5'),_0x4f14b7?_0x4f14b7:this['getDataValue'](_0x846d('0x7')));}},'type':{'type':Sequelize[_0x846d('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x846d('0x8')](_0x846d('0x9')),'get':function(){if(this['getDataValue'](_0x846d('0xa'))===_0x846d('0xb')){return JSON['parse'](this['getDataValue'](_0x846d('0xc')));}else{return this[_0x846d('0x4')](_0x846d('0xc'));}},'set':function(_0x21f3e0){if(Array[_0x846d('0xd')](_0x21f3e0)){this[_0x846d('0xe')](_0x846d('0xc'),JSON[_0x846d('0xf')](_0x21f3e0));}else{this['setDataValue'](_0x846d('0xc'),_0x21f3e0);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x846d('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x846d('0x11')](_0x846d('0x12'))}}; \ No newline at end of file +var _0x2134=['type','select','parse','values','isArray','stringify','BOOLEAN','voice','sequelize','alias','setDataValue','name','STRING','TEXT','long','getDataValue'];(function(_0x3d740d,_0x373d2a){var _0x3e32be=function(_0x5438e5){while(--_0x5438e5){_0x3d740d['push'](_0x3d740d['shift']());}};_0x3e32be(++_0x373d2a);}(_0x2134,0x68));var _0x4213=function(_0x14a91c,_0x3c6a5e){_0x14a91c=_0x14a91c-0x0;var _0x47667f=_0x2134[_0x14a91c];return _0x47667f;};'use strict';var Sequelize=require(_0x4213('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x33f4e0){return this['getDataValue'](_0x4213('0x1'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xce754a){this[_0x4213('0x2')](_0x4213('0x1'),_0xce754a?_0xce754a:this['getDataValue'](_0x4213('0x3')));}},'type':{'type':Sequelize[_0x4213('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x4213('0x5')](_0x4213('0x6')),'get':function(){if(this[_0x4213('0x7')](_0x4213('0x8'))===_0x4213('0x9')){return JSON[_0x4213('0xa')](this[_0x4213('0x7')](_0x4213('0xb')));}else{return this[_0x4213('0x7')](_0x4213('0xb'));}},'set':function(_0x7b8cf7){if(Array[_0x4213('0xc')](_0x7b8cf7)){this[_0x4213('0x2')]('values',JSON[_0x4213('0xd')](_0x7b8cf7));}else{this[_0x4213('0x2')](_0x4213('0xb'),_0x7b8cf7);}}},'required':{'type':Sequelize[_0x4213('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4213('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x4213('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4239cf2..ecaf2c1 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 _0x7e8a=['type','key','model','differenceBy','map','query','keys','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','intersection','fields','include','find','catch','update','body','params','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','json','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName'];(function(_0xa9af46,_0x32ab25){var _0x24822d=function(_0xece2df){while(--_0xece2df){_0xa9af46['push'](_0xa9af46['shift']());}};_0x24822d(++_0x32ab25);}(_0x7e8a,0x8a));var _0xa7e8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x7e8a[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xa7e8('0x0'));var rimraf=require(_0xa7e8('0x1'));var zipdir=require(_0xa7e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7e8('0x3'));var moment=require(_0xa7e8('0x4'));var BPromise=require(_0xa7e8('0x5'));var Mustache=require(_0xa7e8('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa7e8('0x7'));var csv=require(_0xa7e8('0x8'));var ejs=require(_0xa7e8('0x9'));var fs=require('fs');var fs_extra=require(_0xa7e8('0xa'));var _=require('lodash');var squel=require(_0xa7e8('0xb'));var crypto=require(_0xa7e8('0xc'));var jsforce=require(_0xa7e8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa7e8('0x8'));var querystring=require(_0xa7e8('0xe'));var Papa=require(_0xa7e8('0xf'));var Redis=require(_0xa7e8('0x10'));var authService=require(_0xa7e8('0x11'));var qs=require(_0xa7e8('0x12'));var as=require(_0xa7e8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7e8('0x14'))(_0xa7e8('0x15'));var utils=require(_0xa7e8('0x16'));var config=require(_0xa7e8('0x17'));var licenseUtil=require(_0xa7e8('0x18'));var db=require(_0xa7e8('0x19'))['db'];function respondWithStatusCode(_0x4ccd02,_0x303663){_0x303663=_0x303663||0xcc;return function(_0x76990c){if(_0x76990c){return _0x4ccd02['sendStatus'](_0x303663);}return _0x4ccd02[_0xa7e8('0x1a')](_0x303663)['end']();};}function respondWithResult(_0x5f0b7a,_0xe1fbe0){_0xe1fbe0=_0xe1fbe0||0xc8;return function(_0xd2152f){if(_0xd2152f){return _0x5f0b7a[_0xa7e8('0x1a')](_0xe1fbe0)['json'](_0xd2152f);}};}function respondWithFilteredResult(_0x519f84,_0x23d65d){return function(_0x59a9e1){if(_0x59a9e1){var _0x3b073d=typeof _0x23d65d[_0xa7e8('0x1b')]==='undefined'&&typeof _0x23d65d[_0xa7e8('0x1c')]===_0xa7e8('0x1d');var _0xb2fb61=_0x59a9e1[_0xa7e8('0x1e')];var _0x3710c4=_0x3b073d?0x0:_0x23d65d[_0xa7e8('0x1b')];var _0x2bc41b=_0x3b073d?_0x59a9e1[_0xa7e8('0x1e')]:_0x23d65d['offset']+_0x23d65d[_0xa7e8('0x1c')];var _0x2b2508;if(_0x2bc41b>=_0xb2fb61){_0x2bc41b=_0xb2fb61;_0x2b2508=0xc8;}else{_0x2b2508=0xce;}_0x519f84[_0xa7e8('0x1a')](_0x2b2508);return _0x519f84[_0xa7e8('0x1f')]('Content-Range',_0x3710c4+'-'+_0x2bc41b+'/'+_0xb2fb61)[_0xa7e8('0x20')](_0x59a9e1);}return null;};}function patchUpdates(_0x2d4aef){return function(_0x5909a0){try{jsonpatch[_0xa7e8('0x21')](_0x5909a0,_0x2d4aef,!![]);}catch(_0x1257f1){return BPromise[_0xa7e8('0x22')](_0x1257f1);}return _0x5909a0[_0xa7e8('0x23')]();};}function saveUpdates(_0x449cb2,_0x44d90c){return function(_0x4b2749){if(_0x4b2749){return _0x4b2749['update'](_0x449cb2)['then'](function(_0x47d85c){return _0x47d85c;});}return null;};}function removeEntity(_0x3e3355,_0x5bfc4c){return function(_0x38dd8e){if(_0x38dd8e){return _0x38dd8e[_0xa7e8('0x24')]()[_0xa7e8('0x25')](function(){_0x3e3355['status'](0xcc)[_0xa7e8('0x26')]();});}};}function handleEntityNotFound(_0x3d0818,_0x2cf426){return function(_0x1a9fe5){if(!_0x1a9fe5){_0x3d0818[_0xa7e8('0x27')](0x194);}return _0x1a9fe5;};}function handleError(_0x36942d,_0x3db533){_0x3db533=_0x3db533||0x1f4;return function(_0x1c3065){logger[_0xa7e8('0x28')](_0x1c3065[_0xa7e8('0x29')]);if(_0x1c3065[_0xa7e8('0x2a')]){delete _0x1c3065[_0xa7e8('0x2a')];}_0x36942d[_0xa7e8('0x1a')](_0x3db533)[_0xa7e8('0x2b')](_0x1c3065);};}exports[_0xa7e8('0x2c')]=function(_0x47991a,_0xbb9bb0){var _0x5adfd7={},_0x219ead={},_0x9e170d={'count':0x0,'rows':[]};var _0x5c69c9=_['map'](db[_0xa7e8('0x2d')][_0xa7e8('0x2e')],function(_0x9e451d){return{'name':_0x9e451d[_0xa7e8('0x2f')],'type':_0x9e451d[_0xa7e8('0x30')][_0xa7e8('0x31')]};});_0x219ead[_0xa7e8('0x32')]=_[_0xa7e8('0x33')](_[_0xa7e8('0x34')](_0x5c69c9,_0xa7e8('0x2a')),[_0xa7e8('0x2a')]);_0x219ead[_0xa7e8('0x35')]=_[_0xa7e8('0x36')](_0x47991a['query']);_0x219ead['filters']=_['intersection'](_0x219ead[_0xa7e8('0x32')],_0x219ead[_0xa7e8('0x35')]);_0x5adfd7[_0xa7e8('0x37')]=_['intersection'](_0x219ead[_0xa7e8('0x32')],qs['fields'](_0x47991a[_0xa7e8('0x35')]['fields']));_0x5adfd7[_0xa7e8('0x37')]=_0x5adfd7[_0xa7e8('0x37')][_0xa7e8('0x38')]?_0x5adfd7[_0xa7e8('0x37')]:_0x219ead['model'];if(!_0x47991a['query'][_0xa7e8('0x39')](_0xa7e8('0x3a'))){_0x5adfd7[_0xa7e8('0x1c')]=qs[_0xa7e8('0x1c')](_0x47991a[_0xa7e8('0x35')][_0xa7e8('0x1c')]);_0x5adfd7[_0xa7e8('0x1b')]=qs[_0xa7e8('0x1b')](_0x47991a[_0xa7e8('0x35')][_0xa7e8('0x1b')]);}_0x5adfd7['order']=qs[_0xa7e8('0x3b')](_0x47991a['query'][_0xa7e8('0x3b')]);_0x5adfd7[_0xa7e8('0x3c')]=qs[_0xa7e8('0x3d')](_[_0xa7e8('0x3e')](_0x47991a[_0xa7e8('0x35')],_0x219ead[_0xa7e8('0x3d')]),_0x5c69c9);if(_0x47991a[_0xa7e8('0x35')][_0xa7e8('0x3f')]){_0x5adfd7[_0xa7e8('0x3c')]=_[_0xa7e8('0x40')](_0x5adfd7['where'],{'$or':_[_0xa7e8('0x34')](_0x5c69c9,function(_0x432ccb){if(_0x432ccb[_0xa7e8('0x30')]!==_0xa7e8('0x41')){var _0xee0ff5={};_0xee0ff5[_0x432ccb['name']]={'$like':'%'+_0x47991a['query'][_0xa7e8('0x3f')]+'%'};return _0xee0ff5;}})});}_0x5adfd7=_[_0xa7e8('0x40')]({},_0x5adfd7,_0x47991a[_0xa7e8('0x42')]);var _0x30b2e6={'where':_0x5adfd7['where']};return db[_0xa7e8('0x2d')][_0xa7e8('0x1e')](_0x30b2e6)[_0xa7e8('0x25')](function(_0x427958){_0x9e170d['count']=_0x427958;if(_0x47991a[_0xa7e8('0x35')][_0xa7e8('0x43')]){_0x5adfd7['include']=[{'all':!![]}];}return db[_0xa7e8('0x2d')][_0xa7e8('0x44')](_0x5adfd7);})['then'](function(_0x1a8f44){_0x9e170d[_0xa7e8('0x45')]=_0x1a8f44;return _0x9e170d;})[_0xa7e8('0x25')](respondWithFilteredResult(_0xbb9bb0,_0x5adfd7))['catch'](handleError(_0xbb9bb0,null));};exports[_0xa7e8('0x46')]=function(_0x2e4c64,_0x1e376d){var _0x7ef649={'raw':!![],'where':{'id':_0x2e4c64['params']['id']}},_0x414c2b={};_0x414c2b[_0xa7e8('0x32')]=_['keys'](db[_0xa7e8('0x2d')][_0xa7e8('0x2e')]);_0x414c2b['query']=_[_0xa7e8('0x36')](_0x2e4c64[_0xa7e8('0x35')]);_0x414c2b[_0xa7e8('0x3d')]=_[_0xa7e8('0x47')](_0x414c2b['model'],_0x414c2b[_0xa7e8('0x35')]);_0x7ef649[_0xa7e8('0x37')]=_[_0xa7e8('0x47')](_0x414c2b['model'],qs[_0xa7e8('0x48')](_0x2e4c64[_0xa7e8('0x35')]['fields']));_0x7ef649[_0xa7e8('0x37')]=_0x7ef649[_0xa7e8('0x37')][_0xa7e8('0x38')]?_0x7ef649[_0xa7e8('0x37')]:_0x414c2b[_0xa7e8('0x32')];if(_0x2e4c64[_0xa7e8('0x35')][_0xa7e8('0x43')]){_0x7ef649[_0xa7e8('0x49')]=[{'all':!![]}];}_0x7ef649=_[_0xa7e8('0x40')]({},_0x7ef649,_0x2e4c64[_0xa7e8('0x42')]);return db[_0xa7e8('0x2d')][_0xa7e8('0x4a')](_0x7ef649)[_0xa7e8('0x25')](handleEntityNotFound(_0x1e376d,null))['then'](respondWithResult(_0x1e376d,null))[_0xa7e8('0x4b')](handleError(_0x1e376d,null));};exports[_0xa7e8('0x4c')]=function(_0x2743bb,_0x4118c2){if(_0x2743bb[_0xa7e8('0x4d')]['id']){delete _0x2743bb[_0xa7e8('0x4d')]['id'];}return db[_0xa7e8('0x2d')][_0xa7e8('0x4a')]({'where':{'id':_0x2743bb[_0xa7e8('0x4e')]['id']}})[_0xa7e8('0x25')](handleEntityNotFound(_0x4118c2,null))[_0xa7e8('0x25')](saveUpdates(_0x2743bb['body'],null))[_0xa7e8('0x25')](respondWithResult(_0x4118c2,null))[_0xa7e8('0x4b')](handleError(_0x4118c2,null));};exports[_0xa7e8('0x24')]=function(_0x535941,_0x431c0e){return db[_0xa7e8('0x2d')]['find']({'where':{'id':_0x535941[_0xa7e8('0x4e')]['id']}})[_0xa7e8('0x25')](handleEntityNotFound(_0x431c0e,null))[_0xa7e8('0x25')](removeEntity(_0x431c0e,null))['catch'](handleError(_0x431c0e,null));};exports['create']=function(_0x44d669,_0x3596ab){var _0x20cb7e;return db[_0xa7e8('0x4f')][_0xa7e8('0x50')](function(_0x1419ee){return db[_0xa7e8('0x2d')][_0xa7e8('0x51')](_0x44d669[_0xa7e8('0x4d')],{'transaction':_0x1419ee})['then'](function(_0x244af9){_0x20cb7e=_0x244af9;var _0x3c5a6e={'type':db[_0xa7e8('0x52')][_0xa7e8('0x53')],'transaction':_0x1419ee};switch(_0x44d669['body'][_0xa7e8('0x30')]){case _0xa7e8('0x54'):_0x3c5a6e[_0xa7e8('0x30')]=db[_0xa7e8('0x52')][_0xa7e8('0x53')];break;case _0xa7e8('0x55'):_0x3c5a6e['type']=db[_0xa7e8('0x52')][_0xa7e8('0x56')];break;case _0xa7e8('0x57'):_0x3c5a6e[_0xa7e8('0x30')]=db[_0xa7e8('0x52')]['BOOLEAN'];_0x3c5a6e[_0xa7e8('0x58')]=![];break;default:}return db[_0xa7e8('0x4f')][_0xa7e8('0x59')][_0xa7e8('0x5a')](_0xa7e8('0x5b'),util['format'](_0xa7e8('0x5c'),_0x20cb7e['id']),_0x3c5a6e);})['then'](function(){return _0x20cb7e;});})[_0xa7e8('0x25')](respondWithResult(_0x3596ab,0xc9))[_0xa7e8('0x4b')](handleError(_0x3596ab,null));}; \ No newline at end of file +var _0xf550=['nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','options','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','name','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2e1d3d,_0x719bf0){var _0x3d81df=function(_0x3ddfa3){while(--_0x3ddfa3){_0x2e1d3d['push'](_0x2e1d3d['shift']());}};_0x3d81df(++_0x719bf0);}(_0xf550,0xd5));var _0x0f55=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xf550[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x0f55('0x0'));var rimraf=require(_0x0f55('0x1'));var zipdir=require(_0x0f55('0x2'));var jsonpatch=require(_0x0f55('0x3'));var rp=require(_0x0f55('0x4'));var moment=require('moment');var BPromise=require(_0x0f55('0x5'));var Mustache=require(_0x0f55('0x6'));var util=require(_0x0f55('0x7'));var path=require(_0x0f55('0x8'));var sox=require(_0x0f55('0x9'));var csv=require(_0x0f55('0xa'));var ejs=require(_0x0f55('0xb'));var fs=require('fs');var fs_extra=require(_0x0f55('0xc'));var _=require(_0x0f55('0xd'));var squel=require('squel');var crypto=require(_0x0f55('0xe'));var jsforce=require(_0x0f55('0xf'));var deskjs=require(_0x0f55('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0f55('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f55('0x12'));var qs=require(_0x0f55('0x13'));var as=require(_0x0f55('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f55('0x15'))(_0x0f55('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f55('0x17'));var db=require(_0x0f55('0x18'))['db'];function respondWithStatusCode(_0x1ac347,_0x3a8f01){_0x3a8f01=_0x3a8f01||0xcc;return function(_0x5e0294){if(_0x5e0294){return _0x1ac347[_0x0f55('0x19')](_0x3a8f01);}return _0x1ac347[_0x0f55('0x1a')](_0x3a8f01)[_0x0f55('0x1b')]();};}function respondWithResult(_0x100a0d,_0x1caf23){_0x1caf23=_0x1caf23||0xc8;return function(_0x57e05){if(_0x57e05){return _0x100a0d[_0x0f55('0x1a')](_0x1caf23)[_0x0f55('0x1c')](_0x57e05);}};}function respondWithFilteredResult(_0x1c9b51,_0x4a5c2d){return function(_0x3f2a07){if(_0x3f2a07){var _0x143aa8=typeof _0x4a5c2d[_0x0f55('0x1d')]==='undefined'&&typeof _0x4a5c2d[_0x0f55('0x1e')]===_0x0f55('0x1f');var _0x375091=_0x3f2a07[_0x0f55('0x20')];var _0x3b1554=_0x143aa8?0x0:_0x4a5c2d['offset'];var _0x5d2cd2=_0x143aa8?_0x3f2a07[_0x0f55('0x20')]:_0x4a5c2d[_0x0f55('0x1d')]+_0x4a5c2d[_0x0f55('0x1e')];var _0x1e9c8c;if(_0x5d2cd2>=_0x375091){_0x5d2cd2=_0x375091;_0x1e9c8c=0xc8;}else{_0x1e9c8c=0xce;}_0x1c9b51[_0x0f55('0x1a')](_0x1e9c8c);return _0x1c9b51[_0x0f55('0x21')](_0x0f55('0x22'),_0x3b1554+'-'+_0x5d2cd2+'/'+_0x375091)[_0x0f55('0x1c')](_0x3f2a07);}return null;};}function patchUpdates(_0xc967d2){return function(_0x75f435){try{jsonpatch[_0x0f55('0x23')](_0x75f435,_0xc967d2,!![]);}catch(_0x446b45){return BPromise[_0x0f55('0x24')](_0x446b45);}return _0x75f435[_0x0f55('0x25')]();};}function saveUpdates(_0x41d359,_0x46434a){return function(_0x533efa){if(_0x533efa){return _0x533efa[_0x0f55('0x26')](_0x41d359)['then'](function(_0x316e13){return _0x316e13;});}return null;};}function removeEntity(_0x482620,_0x1d8197){return function(_0x253eb4){if(_0x253eb4){return _0x253eb4[_0x0f55('0x27')]()['then'](function(){_0x482620[_0x0f55('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270123,_0x1b03e4){return function(_0x1c06de){if(!_0x1c06de){_0x270123[_0x0f55('0x19')](0x194);}return _0x1c06de;};}function handleError(_0x2ab7a3,_0x1f96a6){_0x1f96a6=_0x1f96a6||0x1f4;return function(_0x2e9f72){logger[_0x0f55('0x28')](_0x2e9f72['stack']);if(_0x2e9f72[_0x0f55('0x29')]){delete _0x2e9f72[_0x0f55('0x29')];}_0x2ab7a3[_0x0f55('0x1a')](_0x1f96a6)['send'](_0x2e9f72);};}exports[_0x0f55('0x2a')]=function(_0x5db5a4,_0x5cbef2){var _0x268a24={},_0x3c1ab7={},_0x17e4d8={'count':0x0,'rows':[]};var _0x482d5b=_['map'](db[_0x0f55('0x2b')][_0x0f55('0x2c')],function(_0x23f16d){return{'name':_0x23f16d[_0x0f55('0x2d')],'type':_0x23f16d[_0x0f55('0x2e')][_0x0f55('0x2f')]};});_0x3c1ab7[_0x0f55('0x30')]=_[_0x0f55('0x31')](_['map'](_0x482d5b,_0x0f55('0x29')),[_0x0f55('0x29')]);_0x3c1ab7[_0x0f55('0x32')]=_[_0x0f55('0x33')](_0x5db5a4['query']);_0x3c1ab7['filters']=_[_0x0f55('0x34')](_0x3c1ab7[_0x0f55('0x30')],_0x3c1ab7[_0x0f55('0x32')]);_0x268a24[_0x0f55('0x35')]=_['intersection'](_0x3c1ab7['model'],qs[_0x0f55('0x36')](_0x5db5a4['query'][_0x0f55('0x36')]));_0x268a24['attributes']=_0x268a24['attributes'][_0x0f55('0x37')]?_0x268a24[_0x0f55('0x35')]:_0x3c1ab7['model'];if(!_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x38')](_0x0f55('0x39'))){_0x268a24[_0x0f55('0x1e')]=qs[_0x0f55('0x1e')](_0x5db5a4['query'][_0x0f55('0x1e')]);_0x268a24[_0x0f55('0x1d')]=qs['offset'](_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x1d')]);}_0x268a24[_0x0f55('0x3a')]=qs[_0x0f55('0x3b')](_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x3b')]);_0x268a24[_0x0f55('0x3c')]=qs['filters'](_[_0x0f55('0x3d')](_0x5db5a4['query'],_0x3c1ab7[_0x0f55('0x3e')]),_0x482d5b);if(_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x3f')]){_0x268a24[_0x0f55('0x3c')]=_['merge'](_0x268a24[_0x0f55('0x3c')],{'$or':_[_0x0f55('0x40')](_0x482d5b,function(_0x3be55c){if(_0x3be55c['type']!==_0x0f55('0x41')){var _0x2bd99c={};_0x2bd99c[_0x3be55c[_0x0f55('0x29')]]={'$like':'%'+_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x3f')]+'%'};return _0x2bd99c;}})});}_0x268a24=_['merge']({},_0x268a24,_0x5db5a4['options']);var _0x2f03a0={'where':_0x268a24[_0x0f55('0x3c')]};return db[_0x0f55('0x2b')][_0x0f55('0x20')](_0x2f03a0)[_0x0f55('0x42')](function(_0x1bf1c0){_0x17e4d8['count']=_0x1bf1c0;if(_0x5db5a4[_0x0f55('0x32')][_0x0f55('0x43')]){_0x268a24[_0x0f55('0x44')]=[{'all':!![]}];}return db[_0x0f55('0x2b')][_0x0f55('0x45')](_0x268a24);})[_0x0f55('0x42')](function(_0xca7fab){_0x17e4d8[_0x0f55('0x46')]=_0xca7fab;return _0x17e4d8;})[_0x0f55('0x42')](respondWithFilteredResult(_0x5cbef2,_0x268a24))[_0x0f55('0x47')](handleError(_0x5cbef2,null));};exports[_0x0f55('0x48')]=function(_0x2c5f92,_0x32278b){var _0x173ed3={'raw':!![],'where':{'id':_0x2c5f92['params']['id']}},_0x39a346={};_0x39a346[_0x0f55('0x30')]=_[_0x0f55('0x33')](db[_0x0f55('0x2b')][_0x0f55('0x2c')]);_0x39a346[_0x0f55('0x32')]=_[_0x0f55('0x33')](_0x2c5f92[_0x0f55('0x32')]);_0x39a346['filters']=_[_0x0f55('0x34')](_0x39a346[_0x0f55('0x30')],_0x39a346['query']);_0x173ed3[_0x0f55('0x35')]=_[_0x0f55('0x34')](_0x39a346[_0x0f55('0x30')],qs[_0x0f55('0x36')](_0x2c5f92[_0x0f55('0x32')][_0x0f55('0x36')]));_0x173ed3['attributes']=_0x173ed3[_0x0f55('0x35')][_0x0f55('0x37')]?_0x173ed3[_0x0f55('0x35')]:_0x39a346[_0x0f55('0x30')];if(_0x2c5f92['query']['includeAll']){_0x173ed3[_0x0f55('0x44')]=[{'all':!![]}];}_0x173ed3=_['merge']({},_0x173ed3,_0x2c5f92[_0x0f55('0x49')]);return db['CmCustomField']['find'](_0x173ed3)[_0x0f55('0x42')](handleEntityNotFound(_0x32278b,null))[_0x0f55('0x42')](respondWithResult(_0x32278b,null))[_0x0f55('0x47')](handleError(_0x32278b,null));};exports[_0x0f55('0x26')]=function(_0x234236,_0xb46a56){if(_0x234236[_0x0f55('0x4a')]['id']){delete _0x234236[_0x0f55('0x4a')]['id'];}return db[_0x0f55('0x2b')]['find']({'where':{'id':_0x234236[_0x0f55('0x4b')]['id']}})[_0x0f55('0x42')](handleEntityNotFound(_0xb46a56,null))[_0x0f55('0x42')](saveUpdates(_0x234236[_0x0f55('0x4a')],null))[_0x0f55('0x42')](respondWithResult(_0xb46a56,null))['catch'](handleError(_0xb46a56,null));};exports[_0x0f55('0x27')]=function(_0x53eed4,_0x3be723){return db[_0x0f55('0x2b')]['find']({'where':{'id':_0x53eed4[_0x0f55('0x4b')]['id']}})[_0x0f55('0x42')](handleEntityNotFound(_0x3be723,null))[_0x0f55('0x42')](removeEntity(_0x3be723,null))['catch'](handleError(_0x3be723,null));};exports[_0x0f55('0x4c')]=function(_0x3afdee,_0xa4c482){var _0x5ca4cf;return db[_0x0f55('0x4d')][_0x0f55('0x4e')](function(_0x5f52fd){return db[_0x0f55('0x2b')][_0x0f55('0x4c')](_0x3afdee[_0x0f55('0x4a')],{'transaction':_0x5f52fd})['then'](function(_0x5eee44){_0x5ca4cf=_0x5eee44;var _0x48dd45={'type':db[_0x0f55('0x4f')][_0x0f55('0x50')],'transaction':_0x5f52fd};switch(_0x3afdee[_0x0f55('0x4a')]['type']){case _0x0f55('0x51'):_0x48dd45[_0x0f55('0x2e')]=db[_0x0f55('0x4f')][_0x0f55('0x50')];break;case _0x0f55('0x52'):_0x48dd45[_0x0f55('0x2e')]=db['Sequelize'][_0x0f55('0x53')];break;case _0x0f55('0x54'):_0x48dd45[_0x0f55('0x2e')]=db[_0x0f55('0x4f')][_0x0f55('0x55')];_0x48dd45['defaultValue']=![];break;default:}return db['sequelize'][_0x0f55('0x56')][_0x0f55('0x57')]('cm_contacts',util[_0x0f55('0x58')](_0x0f55('0x59'),_0x5ca4cf['id']),_0x48dd45);})[_0x0f55('0x42')](function(){return _0x5ca4cf;});})[_0x0f55('0x42')](respondWithResult(_0xa4c482,0xc9))[_0x0f55('0x47')](handleError(_0xa4c482,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 7b3a2db..236e7cd 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 _0x7dfb=['cm_custom_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','./cmCustomField.attributes','CmCustomField'];(function(_0x24434b,_0x490b4d){var _0x5135e4=function(_0x2d34db){while(--_0x2d34db){_0x24434b['push'](_0x24434b['shift']());}};_0x5135e4(++_0x490b4d);}(_0x7dfb,0x14b));var _0xb7df=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x7dfb[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xb7df('0x0'));var util=require(_0xb7df('0x1'));var logger=require(_0xb7df('0x2'))(_0xb7df('0x3'));var moment=require('moment');var BPromise=require(_0xb7df('0x4'));var rp=require(_0xb7df('0x5'));var fs=require('fs');var path=require(_0xb7df('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7df('0x7'));module['exports']=function(_0x437c3d,_0x5bbe84){return _0x437c3d['define'](_0xb7df('0x8'),attributes,{'tableName':_0xb7df('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf19=['moment','bluebird','request-promise','./cmCustomField.attributes','CmCustomField','lodash','../../config/logger','api'];(function(_0x90d794,_0xf3931b){var _0x1b05a5=function(_0x169299){while(--_0x169299){_0x90d794['push'](_0x90d794['shift']());}};_0x1b05a5(++_0xf3931b);}(_0xbf19,0x1b5));var _0x9bf1=function(_0x4d0bb6,_0x2039dd){_0x4d0bb6=_0x4d0bb6-0x0;var _0x225e06=_0xbf19[_0x4d0bb6];return _0x225e06;};'use strict';var _=require(_0x9bf1('0x0'));var util=require('util');var logger=require(_0x9bf1('0x1'))(_0x9bf1('0x2'));var moment=require(_0x9bf1('0x3'));var BPromise=require(_0x9bf1('0x4'));var rp=require(_0x9bf1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9bf1('0x6'));module['exports']=function(_0x20d89f,_0x300702){return _0x20d89f['define'](_0x9bf1('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index bd2dda3..915642d 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 _0x34c3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','debug','request\x20sent','stringify','error','code','message','CmCustomField,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring'];(function(_0x1eaa69,_0x149f56){var _0x10edcf=function(_0x3b0f3e){while(--_0x3b0f3e){_0x1eaa69['push'](_0x1eaa69['shift']());}};_0x10edcf(++_0x149f56);}(_0x34c3,0x104));var _0x334c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x34c3[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x334c('0x0'));var moment=require(_0x334c('0x1'));var BPromise=require(_0x334c('0x2'));var rs=require(_0x334c('0x3'));var fs=require('fs');var Redis=require(_0x334c('0x4'));var db=require(_0x334c('0x5'))['db'];var utils=require(_0x334c('0x6'));var logger=require(_0x334c('0x7'))('rpc');var config=require(_0x334c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x334c('0x9')][_0x334c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x373a1d,_0x55c1a8,_0x43c425){return new BPromise(function(_0x32bafe,_0x28e414){return client[_0x334c('0xb')](_0x373a1d,_0x43c425)['then'](function(_0x25279f){logger[_0x334c('0xc')]('CmCustomField,\x20%s,\x20%s',_0x55c1a8,'request\x20sent');logger[_0x334c('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x55c1a8,_0x334c('0xe'),JSON[_0x334c('0xf')](_0x25279f));if(_0x25279f[_0x334c('0x10')]){if(_0x25279f[_0x334c('0x10')][_0x334c('0x11')]===0x1f4){logger[_0x334c('0x10')]('CmCustomField,\x20%s,\x20%s',_0x55c1a8,_0x25279f['error'][_0x334c('0x12')]);return _0x28e414(_0x25279f['error'][_0x334c('0x12')]);}logger[_0x334c('0x10')](_0x334c('0x13'),_0x55c1a8,_0x25279f[_0x334c('0x10')][_0x334c('0x12')]);return _0x32bafe(_0x25279f['error']['message']);}else{logger[_0x334c('0xc')](_0x334c('0x13'),_0x55c1a8,_0x334c('0xe'));_0x32bafe(_0x25279f[_0x334c('0x14')][_0x334c('0x12')]);}})[_0x334c('0x15')](function(_0x101978){logger[_0x334c('0x10')](_0x334c('0x13'),_0x55c1a8,_0x101978);_0x28e414(_0x101978);});});} \ No newline at end of file +var _0x559f=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x5089bd,_0x3e54bc){var _0x5631f3=function(_0x5c7bce){while(--_0x5c7bce){_0x5089bd['push'](_0x5089bd['shift']());}};_0x5631f3(++_0x3e54bc);}(_0x559f,0xff));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf559('0x0'));var util=require('util');var moment=require(_0xf559('0x1'));var BPromise=require(_0xf559('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf559('0x3'));var db=require(_0xf559('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf559('0x5'))(_0xf559('0x6'));var config=require('../../config/environment');var jayson=require(_0xf559('0x7'));var client=jayson[_0xf559('0x8')][_0xf559('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8470,_0x2c3f60,_0x4f1ca9){return new BPromise(function(_0x3550b9,_0x38572d){return client['request'](_0x5c8470,_0x4f1ca9)[_0xf559('0xa')](function(_0x105e4e){logger['info'](_0xf559('0xb'),_0x2c3f60,_0xf559('0xc'));logger[_0xf559('0xd')](_0xf559('0xe'),_0x2c3f60,_0xf559('0xc'),JSON['stringify'](_0x105e4e));if(_0x105e4e[_0xf559('0xf')]){if(_0x105e4e['error']['code']===0x1f4){logger[_0xf559('0xf')](_0xf559('0xb'),_0x2c3f60,_0x105e4e[_0xf559('0xf')][_0xf559('0x10')]);return _0x38572d(_0x105e4e['error'][_0xf559('0x10')]);}logger[_0xf559('0xf')]('CmCustomField,\x20%s,\x20%s',_0x2c3f60,_0x105e4e[_0xf559('0xf')][_0xf559('0x10')]);return _0x3550b9(_0x105e4e[_0xf559('0xf')][_0xf559('0x10')]);}else{logger[_0xf559('0x11')](_0xf559('0xb'),_0x2c3f60,_0xf559('0xc'));_0x3550b9(_0x105e4e[_0xf559('0x12')]['message']);}})['catch'](function(_0x4b18c0){logger['error'](_0xf559('0xb'),_0x2c3f60,_0x4b18c0);_0x38572d(_0x4b18c0);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d0cab9c..a26d3cc 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 _0xf8af=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf8af,0x8b));var _0xff8a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf8af[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xff8a('0x0'));var util=require('util');var path=require(_0xff8a('0x1'));var timeout=require(_0xff8a('0x2'));var express=require(_0xff8a('0x3'));var router=express[_0xff8a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff8a('0x5'));var interaction=require(_0xff8a('0x6'));var config=require(_0xff8a('0x7'));var controller=require(_0xff8a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xff8a('0x9')]);router['get'](_0xff8a('0xa'),auth[_0xff8a('0xb')](),controller[_0xff8a('0xc')]);router[_0xff8a('0xd')]('/',auth[_0xff8a('0xb')](),controller[_0xff8a('0xe')]);router[_0xff8a('0xf')](_0xff8a('0xa'),auth[_0xff8a('0xb')](),controller[_0xff8a('0x10')]);router[_0xff8a('0x11')]('/:id',auth[_0xff8a('0xb')](),controller[_0xff8a('0x12')]);module[_0xff8a('0x13')]=router; \ No newline at end of file +var _0x6ec2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x353b0e,_0x2a91f9){var _0x26cdf0=function(_0x3a8e63){while(--_0x3a8e63){_0x353b0e['push'](_0x353b0e['shift']());}};_0x26cdf0(++_0x2a91f9);}(_0x6ec2,0x78));var _0x26ec=function(_0x2a27d9,_0x478fef){_0x2a27d9=_0x2a27d9-0x0;var _0xa4b646=_0x6ec2[_0x2a27d9];return _0xa4b646;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require(_0x26ec('0x3'));var express=require(_0x26ec('0x4'));var router=express[_0x26ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x6'));var interaction=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var controller=require(_0x26ec('0x9'));router[_0x26ec('0xa')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xb')]);router['get']('/:id',auth[_0x26ec('0xc')](),controller[_0x26ec('0xd')]);router[_0x26ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xf')]);router['put'](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x11')]);router[_0x26ec('0x12')](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x13')]);module[_0x26ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8a66dbe..4ff06dd 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 _0xfca3=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x4e7bca,_0xe89cc){var _0x4e65c8=function(_0x3232d6){while(--_0x3232d6){_0x4e7bca['push'](_0x4e7bca['shift']());}};_0x4e65c8(++_0xe89cc);}(_0xfca3,0x69));var _0x3fca=function(_0x205143,_0x422d1f){_0x205143=_0x205143-0x0;var _0x2fc24b=_0xfca3[_0x205143];return _0x2fc24b;};'use strict';var moment=require(_0x3fca('0x0'));var Sequelize=require(_0x3fca('0x1'));module[_0x3fca('0x2')]={'phone':{'type':Sequelize[_0x3fca('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x3fca('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3fca('0x5')],'defaultValue':moment()[_0x3fca('0x6')](_0x3fca('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3fca('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3fca('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3fca('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3fca('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3fca('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3fca('0x8')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3fca('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3fca('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x3fca('0x8')],'unique':_0x3fca('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x3fca('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3fca('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3fca('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3fca('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1a69=['moment','sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x1a69,0x1cc));var _0x91a6=function(_0x300e03,_0x35bf0a){_0x300e03=_0x300e03-0x0;var _0xf4711b=_0x1a69[_0x300e03];return _0xf4711b;};'use strict';var moment=require(_0x91a6('0x0'));var Sequelize=require(_0x91a6('0x1'));module[_0x91a6('0x2')]={'phone':{'type':Sequelize[_0x91a6('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x91a6('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x91a6('0x5')],'defaultValue':moment()['format'](_0x91a6('0x6'))},'countbusyretry':{'type':Sequelize[_0x91a6('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x91a6('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x91a6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x91a6('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x91a6('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x91a6('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x91a6('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x91a6('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x91a6('0x7')],'unique':_0x91a6('0x9')},'UserId':{'type':Sequelize[_0x91a6('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x91a6('0x7')],'unique':_0x91a6('0x9')},'CampaignId':{'type':Sequelize[_0x91a6('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x91a6('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x91a6('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x91a6('0x7')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 230cf72..17fdfd9 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 _0x31ee=['$between','$notBetween','$in','$like','$notLike','$iLike','$contains','$contained','$any','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','CmHopper','findAll','rows','catch','params','rawAttributes','length','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','type','query','keys','filters','model','$lt','$lte','$ne','$eq','$not'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x31ee,0xf4));var _0xe31e=function(_0x2d7f58,_0x4d5c28){_0x2d7f58=_0x2d7f58-0x0;var _0x174c16=_0x31ee[_0x2d7f58];return _0x174c16;};'use strict';var emlformat=require(_0xe31e('0x0'));var rimraf=require(_0xe31e('0x1'));var zipdir=require(_0xe31e('0x2'));var jsonpatch=require(_0xe31e('0x3'));var rp=require(_0xe31e('0x4'));var moment=require('moment');var BPromise=require(_0xe31e('0x5'));var Mustache=require(_0xe31e('0x6'));var util=require('util');var path=require(_0xe31e('0x7'));var sox=require(_0xe31e('0x8'));var csv=require(_0xe31e('0x9'));var ejs=require(_0xe31e('0xa'));var fs=require('fs');var fs_extra=require(_0xe31e('0xb'));var _=require(_0xe31e('0xc'));var squel=require('squel');var crypto=require(_0xe31e('0xd'));var jsforce=require(_0xe31e('0xe'));var deskjs=require(_0xe31e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe31e('0x10'));var Papa=require(_0xe31e('0x11'));var Redis=require(_0xe31e('0x12'));var authService=require(_0xe31e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe31e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe31e('0x15'))('api');var utils=require(_0xe31e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe31e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x392e9c,_0x5f51c6){_0x5f51c6=_0x5f51c6||0xcc;return function(_0x368efa){if(_0x368efa){return _0x392e9c[_0xe31e('0x18')](_0x5f51c6);}return _0x392e9c['status'](_0x5f51c6)[_0xe31e('0x19')]();};}function respondWithResult(_0x3b0549,_0x3357cd){_0x3357cd=_0x3357cd||0xc8;return function(_0x4e2b94){if(_0x4e2b94){return _0x3b0549[_0xe31e('0x1a')](_0x3357cd)[_0xe31e('0x1b')](_0x4e2b94);}};}function respondWithFilteredResult(_0x3c3748,_0x9d6bd){return function(_0x37b2e5){if(_0x37b2e5){var _0x239b6a=typeof _0x9d6bd[_0xe31e('0x1c')]==='undefined'&&typeof _0x9d6bd['limit']===_0xe31e('0x1d');var _0x12890e=_0x37b2e5[_0xe31e('0x1e')];var _0x13b6d7=_0x239b6a?0x0:_0x9d6bd[_0xe31e('0x1c')];var _0x4ba651=_0x239b6a?_0x37b2e5[_0xe31e('0x1e')]:_0x9d6bd['offset']+_0x9d6bd[_0xe31e('0x1f')];var _0x2cb16e;if(_0x4ba651>=_0x12890e){_0x4ba651=_0x12890e;_0x2cb16e=0xc8;}else{_0x2cb16e=0xce;}_0x3c3748['status'](_0x2cb16e);return _0x3c3748[_0xe31e('0x20')](_0xe31e('0x21'),_0x13b6d7+'-'+_0x4ba651+'/'+_0x12890e)[_0xe31e('0x1b')](_0x37b2e5);}return null;};}function patchUpdates(_0x5f2764){return function(_0x5c3caa){try{jsonpatch[_0xe31e('0x22')](_0x5c3caa,_0x5f2764,!![]);}catch(_0x43cccd){return BPromise[_0xe31e('0x23')](_0x43cccd);}return _0x5c3caa[_0xe31e('0x24')]();};}function saveUpdates(_0x773eec,_0x2b69e0){return function(_0x419dd8){if(_0x419dd8){return _0x419dd8[_0xe31e('0x25')](_0x773eec)[_0xe31e('0x26')](function(_0x5d986d){return _0x5d986d;});}return null;};}function removeEntity(_0x47d870,_0x212aac){return function(_0x11e8da){if(_0x11e8da){return _0x11e8da['destroy']()[_0xe31e('0x26')](function(){_0x47d870[_0xe31e('0x1a')](0xcc)[_0xe31e('0x19')]();});}};}function handleEntityNotFound(_0x1dde19,_0x78c889){return function(_0xeaac0c){if(!_0xeaac0c){_0x1dde19[_0xe31e('0x18')](0x194);}return _0xeaac0c;};}function handleError(_0x1ecaf8,_0x2c33d4){_0x2c33d4=_0x2c33d4||0x1f4;return function(_0x4c9069){logger[_0xe31e('0x27')](_0x4c9069['stack']);if(_0x4c9069[_0xe31e('0x28')]){delete _0x4c9069[_0xe31e('0x28')];}_0x1ecaf8[_0xe31e('0x1a')](_0x2c33d4)[_0xe31e('0x29')](_0x4c9069);};}exports['index']=function(_0x26f6cc,_0x398b6c){var _0x11e228={},_0x335b87={},_0x4460df={'count':0x0,'rows':[]};var _0x56c814=_[_0xe31e('0x2a')](db['CmHopper']['rawAttributes'],function(_0x437a57){return{'name':_0x437a57[_0xe31e('0x2b')],'type':_0x437a57[_0xe31e('0x2c')]['key']};});_0x335b87['model']=_[_0xe31e('0x2a')](_0x56c814,_0xe31e('0x28'));_0x335b87[_0xe31e('0x2d')]=_[_0xe31e('0x2e')](_0x26f6cc[_0xe31e('0x2d')]);_0x335b87[_0xe31e('0x2f')]=_['intersection'](_0x335b87[_0xe31e('0x30')],_0x335b87['query']);_0x335b87[_0xe31e('0x2f')]=_['concat'](_0x335b87[_0xe31e('0x2f')],['$and','$or','$gt','$gte',_0xe31e('0x31'),_0xe31e('0x32'),_0xe31e('0x33'),_0xe31e('0x34'),_0xe31e('0x35'),_0xe31e('0x36'),_0xe31e('0x37'),_0xe31e('0x38'),'$notIn',_0xe31e('0x39'),_0xe31e('0x3a'),_0xe31e('0x3b'),'$notILike',_0xe31e('0x39'),'$overlap',_0xe31e('0x3c'),_0xe31e('0x3d'),_0xe31e('0x3e')]);_0x11e228[_0xe31e('0x3f')]=_[_0xe31e('0x40')](_0x335b87[_0xe31e('0x30')],qs['fields'](_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x41')]));_0x11e228[_0xe31e('0x3f')]=_0x11e228['attributes']['length']?_0x11e228[_0xe31e('0x3f')]:_0x335b87[_0xe31e('0x30')];if(!_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x42')](_0xe31e('0x43'))){_0x11e228['limit']=qs[_0xe31e('0x1f')](_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x1f')]);_0x11e228[_0xe31e('0x1c')]=qs['offset'](_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x1c')]);}_0x11e228[_0xe31e('0x44')]=qs[_0xe31e('0x45')](_0x26f6cc[_0xe31e('0x2d')]['sort']);_0x11e228[_0xe31e('0x46')]=qs[_0xe31e('0x2f')](_['pick'](_0x26f6cc[_0xe31e('0x2d')],_0x335b87[_0xe31e('0x2f')]),_0x56c814);if(_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x47')]){_0x11e228[_0xe31e('0x46')]=_[_0xe31e('0x48')](_0x11e228[_0xe31e('0x46')],{'$or':_[_0xe31e('0x2a')](_0x56c814,function(_0x5f1034){if(_0x5f1034[_0xe31e('0x2c')]!==_0xe31e('0x49')){var _0x530e2c={};_0x530e2c[_0x5f1034['name']]={'$like':'%'+_0x26f6cc[_0xe31e('0x2d')][_0xe31e('0x47')]+'%'};return _0x530e2c;}})});}_0x11e228=_[_0xe31e('0x48')]({},_0x11e228,_0x26f6cc[_0xe31e('0x4a')]);var _0x1c0ba0={'where':_0x11e228[_0xe31e('0x46')]};return db['CmHopper'][_0xe31e('0x1e')](_0x1c0ba0)[_0xe31e('0x26')](function(_0x420c45){_0x4460df[_0xe31e('0x1e')]=_0x420c45;if(_0x26f6cc['query'][_0xe31e('0x4b')]){_0x11e228[_0xe31e('0x4c')]=[{'all':!![]}];}return db[_0xe31e('0x4d')][_0xe31e('0x4e')](_0x11e228);})[_0xe31e('0x26')](function(_0x560c06){_0x4460df[_0xe31e('0x4f')]=_0x560c06;return _0x4460df;})[_0xe31e('0x26')](respondWithFilteredResult(_0x398b6c,_0x11e228))[_0xe31e('0x50')](handleError(_0x398b6c,null));};exports['show']=function(_0x1d2579,_0x81f26){var _0x5ab3dc={'raw':!![],'where':{'id':_0x1d2579[_0xe31e('0x51')]['id']}},_0x3f3356={};_0x3f3356[_0xe31e('0x30')]=_['keys'](db[_0xe31e('0x4d')][_0xe31e('0x52')]);_0x3f3356[_0xe31e('0x2d')]=_[_0xe31e('0x2e')](_0x1d2579[_0xe31e('0x2d')]);_0x3f3356[_0xe31e('0x2f')]=_['intersection'](_0x3f3356[_0xe31e('0x30')],_0x3f3356['query']);_0x5ab3dc[_0xe31e('0x3f')]=_['intersection'](_0x3f3356[_0xe31e('0x30')],qs['fields'](_0x1d2579[_0xe31e('0x2d')][_0xe31e('0x41')]));_0x5ab3dc[_0xe31e('0x3f')]=_0x5ab3dc[_0xe31e('0x3f')][_0xe31e('0x53')]?_0x5ab3dc['attributes']:_0x3f3356[_0xe31e('0x30')];if(_0x1d2579['query'][_0xe31e('0x4b')]){_0x5ab3dc[_0xe31e('0x4c')]=[{'all':!![]}];}_0x5ab3dc=_['merge']({},_0x5ab3dc,_0x1d2579[_0xe31e('0x4a')]);return db[_0xe31e('0x4d')][_0xe31e('0x54')](_0x5ab3dc)['then'](handleEntityNotFound(_0x81f26,null))[_0xe31e('0x26')](respondWithResult(_0x81f26,null))['catch'](handleError(_0x81f26,null));};exports[_0xe31e('0x55')]=function(_0x332fa3,_0x45cd7d){return db[_0xe31e('0x4d')][_0xe31e('0x55')](_0x332fa3[_0xe31e('0x56')],{})[_0xe31e('0x26')](respondWithResult(_0x45cd7d,0xc9))[_0xe31e('0x50')](handleError(_0x45cd7d,null));};exports[_0xe31e('0x25')]=function(_0x20d6a2,_0x559e9f){if(_0x20d6a2[_0xe31e('0x56')]['id']){delete _0x20d6a2[_0xe31e('0x56')]['id'];}return db['CmHopper'][_0xe31e('0x54')]({'where':{'id':_0x20d6a2[_0xe31e('0x51')]['id']}})[_0xe31e('0x26')](handleEntityNotFound(_0x559e9f,null))[_0xe31e('0x26')](saveUpdates(_0x20d6a2[_0xe31e('0x56')],null))['then'](respondWithResult(_0x559e9f,null))[_0xe31e('0x50')](handleError(_0x559e9f,null));};exports['describe']=function(_0x442cab,_0x340631){return db[_0xe31e('0x4d')][_0xe31e('0x57')]()['then'](respondWithResult(_0x340631,null))[_0xe31e('0x50')](handleError(_0x340631,null));};exports[_0xe31e('0x58')]=function(_0x11f8a3,_0x530cfd){var _0x30d01d;return db['CmHopper']['find']({'where':{'id':_0x11f8a3[_0xe31e('0x51')]['id']}})[_0xe31e('0x26')](handleEntityNotFound(_0x530cfd,null))['then'](function(_0x46897d){if(_0x46897d){return _0x46897d[_0xe31e('0x58')]()['then'](function(_0x14756b){return _0x14756b;});}})[_0xe31e('0x26')](function(_0x4ce7bf){_0x30d01d=_0x4ce7bf;if(_0x4ce7bf){if(_0x4ce7bf[_0xe31e('0x59')]||_0x4ce7bf[_0xe31e('0x5a')]){return db[_0x4ce7bf[_0xe31e('0x59')]?_0xe31e('0x5b'):_0xe31e('0x5c')][_0xe31e('0x54')]({'where':{'id':_0x4ce7bf[_0xe31e('0x59')]?_0x4ce7bf[_0xe31e('0x59')]:_0x4ce7bf[_0xe31e('0x5a')]},'attributes':['id',_0xe31e('0x28')],'raw':!![]});}}})[_0xe31e('0x26')](function(_0x190556){var _0x1c9c22={};if(_0x190556){_[_0xe31e('0x48')](_0x1c9c22,_['omit'](_0x30d01d[_0xe31e('0x5d')],['createdAt','updatedAt','id']));_0x1c9c22[_0xe31e('0x5e')]=0x15;_0x1c9c22[_0xe31e('0x5f')]=_0xe31e('0x60');_0x1c9c22[_0xe31e('0x61')]=_0x190556['name'];_0x1c9c22[_0xe31e('0x62')]=_0x11f8a3[_0xe31e('0x63')][_0xe31e('0x28')];_0x1c9c22[_0xe31e('0x64')]=_0x11f8a3[_0xe31e('0x63')]['id'];_0x1c9c22[_0xe31e('0x60')]=!![];_0x1c9c22[_0xe31e('0x65')]=moment()['format'](_0xe31e('0x66'));_0x1c9c22[_0xe31e('0x67')]=_0x30d01d[_0xe31e('0x68')];_0x1c9c22[_0xe31e('0x69')]=_0x30d01d['VoiceQueueId']?_0xe31e('0x6a'):_0xe31e('0x6b');return db['CmContact']['find']({'where':{'id':_0x1c9c22['ContactId']},'attributes':['firstName',_0xe31e('0x6c')]})[_0xe31e('0x26')](function(_0x2a6a93){if(!_['isNil'](_0x530cfd)&&!_[_0xe31e('0x6d')](_0x2a6a93[_0xe31e('0x6e')])){_0x1c9c22[_0xe31e('0x6f')]=_0x2a6a93['firstName'];if(!_[_0xe31e('0x6d')](_0x2a6a93[_0xe31e('0x6c')])){_0x1c9c22[_0xe31e('0x6f')]+='\x20'+_0x2a6a93['lastName'];}}})[_0xe31e('0x70')](function(){return db[_0xe31e('0x71')][_0xe31e('0x55')](_0x1c9c22);});}})[_0xe31e('0x26')](function(){return _0x530cfd['status'](0xcc)[_0xe31e('0x19')]();})[_0xe31e('0x50')](handleError(_0x530cfd,null));};exports[_0xe31e('0x72')]=function(_0x464350,_0x563467,_0x426373){var _0x2e18bb=[];return db[_0xe31e('0x73')]['describe']()[_0xe31e('0x26')](function(_0x342649){_0x2e18bb=_['keys'](_0x342649);return _0x464350[_0xe31e('0x63')][_0xe31e('0x74')]({'where':{'type':_0xe31e('0x75'),'dialActive':!![],'dialMethod':_0xe31e('0x76')},'attributes':['id','dialOrderByScheduledAt',_0xe31e('0x77')],'raw':!![]});})[_0xe31e('0x26')](function(_0x413181){if(_0x413181&&_0x413181[_0xe31e('0x53')]){return db[_0xe31e('0x78')][_0xe31e('0x79')](function(_0x5889f7){var _0x126d43={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe31e('0x2a')](_0x413181,'id')},'$or':[{'UserId':null},{'UserId':_0x464350[_0xe31e('0x63')]['id']}]};var _0x38a932={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x413181)[_0xe31e('0x47')]([_0xe31e('0x77'),0x0])[_0xe31e('0x2a')]('id')[_0xe31e('0x7a')]()},'$or':[{'UserId':null},{'UserId':_0x464350[_0xe31e('0x63')]['id']}]};var _0x585abc={'$or':[_0x126d43,_0x38a932]};var _0x4125ad=[];if(_0x464350[_0xe31e('0x56')][_0xe31e('0x7b')]&&_0x464350['body'][_0xe31e('0x7b')]===_0xe31e('0x7c')){if(!_[_0xe31e('0x7d')](_0x464350[_0xe31e('0x56')][_0xe31e('0x7e')])){_0x585abc['id']={'$in':_0x464350[_0xe31e('0x56')]['hopperIds']};}_0x4125ad=[[_0xe31e('0x7f'),_0xe31e('0x80')],[_0xe31e('0x81'),_0x413181[0x0][_0xe31e('0x82')]==='ASC'?_0xe31e('0x83'):_0xe31e('0x80')],db[_0xe31e('0x78')][_0xe31e('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe31e('0x83')]];}else{if(!_[_0xe31e('0x7d')](_0x464350[_0xe31e('0x56')][_0xe31e('0x7e')])){_0x585abc['id']={'$notIn':_0x464350[_0xe31e('0x56')][_0xe31e('0x7e')]};}_0x4125ad=[[_0xe31e('0x7f'),_0xe31e('0x83')],[_0xe31e('0x81'),_0x413181[0x0][_0xe31e('0x82')]],db['sequelize']['literal'](_0xe31e('0x85')),['id',_0xe31e('0x80')]];}return db['CmHopper'][_0xe31e('0x86')]({'attributes':['id','scheduledat',_0xe31e('0x87')],'where':_0x585abc,'order':_0x4125ad,'transaction':_0x5889f7,'lock':_0x5889f7[_0xe31e('0x88')][_0xe31e('0x89')],'include':[{'model':db[_0xe31e('0x73')],'as':'Contact','attributes':_0x2e18bb,'include':[{'model':db[_0xe31e('0x8a')],'as':_0xe31e('0x8b'),'attributes':['id',_0xe31e('0x28')]}]},{'model':db[_0xe31e('0x8c')],'as':_0xe31e('0x8d'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xe31e('0x8e'),'attributes':['id',_0xe31e('0x28'),_0xe31e('0x8f')]}]})['then'](function(_0x51dd79){if(_0x51dd79){return _0x51dd79[_0xe31e('0x25')]({'UserId':_0x464350[_0xe31e('0x63')]['id']},{'transaction':_0x5889f7});}});});}})['then'](handleEntityNotFound(_0x563467,null))[_0xe31e('0x26')](respondWithResult(_0x563467,null))[_0xe31e('0x50')](handleError(_0x563467,null));};exports[_0xe31e('0x90')]=function(_0x226dd8,_0x304c6f,_0x3841e2){return _0x226dd8[_0xe31e('0x63')][_0xe31e('0x74')]({'where':{'type':_0xe31e('0x75'),'dialActive':!![],'dialMethod':_0xe31e('0x76')},'attributes':['id'],'raw':!![]})[_0xe31e('0x26')](function(_0x1cf5b5){if(_0x1cf5b5&&_0x1cf5b5[_0xe31e('0x53')]){return db[_0xe31e('0x4d')][_0xe31e('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe31e('0x91')](_0xe31e('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x1cf5b5,'id')},'$or':[{'UserId':null},{'UserId':_0x226dd8[_0xe31e('0x63')]['id']}]}});}return 0x0;})[_0xe31e('0x26')](function(_0x56fb7a){if(!_['isNil'](_0x56fb7a)&&_[_0xe31e('0x92')](_0x56fb7a)){return _0x304c6f[_0xe31e('0x1a')](0xc8)[_0xe31e('0x1b')]({'contacts':_0x56fb7a});}else{logger[_0xe31e('0x27')](_0xe31e('0x93'),'getOpenContacts',0x194,_0xe31e('0x94'));_0x304c6f[_0xe31e('0x18')](0x194);}})[_0xe31e('0x50')](handleError(_0x304c6f,null));}; \ No newline at end of file +var _0xf998=['then','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','intersection','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','keys','includeAll','find','create','body','catch','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','CmList','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x38665a,_0x414e59){var _0x500370=function(_0x119215){while(--_0x119215){_0x38665a['push'](_0x38665a['shift']());}};_0x500370(++_0x414e59);}(_0xf998,0x6c));var _0x8f99=function(_0x290ef5,_0x32cfa7){_0x290ef5=_0x290ef5-0x0;var _0x450d92=_0xf998[_0x290ef5];return _0x450d92;};'use strict';var emlformat=require(_0x8f99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f99('0x1'));var jsonpatch=require(_0x8f99('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f99('0x3'));var Mustache=require(_0x8f99('0x4'));var util=require(_0x8f99('0x5'));var path=require('path');var sox=require(_0x8f99('0x6'));var csv=require(_0x8f99('0x7'));var ejs=require(_0x8f99('0x8'));var fs=require('fs');var fs_extra=require(_0x8f99('0x9'));var _=require(_0x8f99('0xa'));var squel=require('squel');var crypto=require(_0x8f99('0xb'));var jsforce=require(_0x8f99('0xc'));var deskjs=require(_0x8f99('0xd'));var toCsv=require(_0x8f99('0x7'));var querystring=require(_0x8f99('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f99('0xf'));var hardwareService=require(_0x8f99('0x10'));var logger=require(_0x8f99('0x11'))(_0x8f99('0x12'));var utils=require('../../config/utils');var config=require(_0x8f99('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21e713,_0xdd8f0c){_0xdd8f0c=_0xdd8f0c||0xcc;return function(_0x309b18){if(_0x309b18){return _0x21e713['sendStatus'](_0xdd8f0c);}return _0x21e713[_0x8f99('0x14')](_0xdd8f0c)[_0x8f99('0x15')]();};}function respondWithResult(_0x4b7bf8,_0x37a348){_0x37a348=_0x37a348||0xc8;return function(_0x1889b7){if(_0x1889b7){return _0x4b7bf8[_0x8f99('0x14')](_0x37a348)[_0x8f99('0x16')](_0x1889b7);}};}function respondWithFilteredResult(_0x37da80,_0x4508c2){return function(_0x456b6f){if(_0x456b6f){var _0xcebbda=typeof _0x4508c2[_0x8f99('0x17')]===_0x8f99('0x18')&&typeof _0x4508c2[_0x8f99('0x19')]===_0x8f99('0x18');var _0x5847c0=_0x456b6f[_0x8f99('0x1a')];var _0x563a7c=_0xcebbda?0x0:_0x4508c2[_0x8f99('0x17')];var _0x3d9efb=_0xcebbda?_0x456b6f[_0x8f99('0x1a')]:_0x4508c2[_0x8f99('0x17')]+_0x4508c2[_0x8f99('0x19')];var _0xe70604;if(_0x3d9efb>=_0x5847c0){_0x3d9efb=_0x5847c0;_0xe70604=0xc8;}else{_0xe70604=0xce;}_0x37da80['status'](_0xe70604);return _0x37da80[_0x8f99('0x1b')]('Content-Range',_0x563a7c+'-'+_0x3d9efb+'/'+_0x5847c0)[_0x8f99('0x16')](_0x456b6f);}return null;};}function patchUpdates(_0x30e40f){return function(_0x4f450e){try{jsonpatch['apply'](_0x4f450e,_0x30e40f,!![]);}catch(_0x3b6631){return BPromise[_0x8f99('0x1c')](_0x3b6631);}return _0x4f450e[_0x8f99('0x1d')]();};}function saveUpdates(_0x56292b,_0x272840){return function(_0x1fafcf){if(_0x1fafcf){return _0x1fafcf[_0x8f99('0x1e')](_0x56292b)[_0x8f99('0x1f')](function(_0x5ba13e){return _0x5ba13e;});}return null;};}function removeEntity(_0x41a70b,_0x2e3e60){return function(_0xd516eb){if(_0xd516eb){return _0xd516eb['destroy']()[_0x8f99('0x1f')](function(){_0x41a70b[_0x8f99('0x14')](0xcc)[_0x8f99('0x15')]();});}};}function handleEntityNotFound(_0x123783,_0xdbb289){return function(_0x38629a){if(!_0x38629a){_0x123783['sendStatus'](0x194);}return _0x38629a;};}function handleError(_0x123805,_0x515308){_0x515308=_0x515308||0x1f4;return function(_0x4122fe){logger[_0x8f99('0x20')](_0x4122fe[_0x8f99('0x21')]);if(_0x4122fe[_0x8f99('0x22')]){delete _0x4122fe[_0x8f99('0x22')];}_0x123805[_0x8f99('0x14')](_0x515308)['send'](_0x4122fe);};}exports[_0x8f99('0x23')]=function(_0x441ead,_0x2634ab){var _0x27e1f4={},_0x512ad9={},_0x3c168f={'count':0x0,'rows':[]};var _0x510e34=_[_0x8f99('0x24')](db[_0x8f99('0x25')][_0x8f99('0x26')],function(_0x5151c6){return{'name':_0x5151c6[_0x8f99('0x27')],'type':_0x5151c6[_0x8f99('0x28')][_0x8f99('0x29')]};});_0x512ad9[_0x8f99('0x2a')]=_[_0x8f99('0x24')](_0x510e34,'name');_0x512ad9[_0x8f99('0x2b')]=_['keys'](_0x441ead[_0x8f99('0x2b')]);_0x512ad9[_0x8f99('0x2c')]=_[_0x8f99('0x2d')](_0x512ad9[_0x8f99('0x2a')],_0x512ad9['query']);_0x512ad9[_0x8f99('0x2c')]=_[_0x8f99('0x2e')](_0x512ad9['filters'],[_0x8f99('0x2f'),'$or',_0x8f99('0x30'),_0x8f99('0x31'),'$lt',_0x8f99('0x32'),_0x8f99('0x33'),_0x8f99('0x34'),_0x8f99('0x35'),_0x8f99('0x36'),'$notBetween','$in',_0x8f99('0x37'),_0x8f99('0x38'),_0x8f99('0x39'),_0x8f99('0x3a'),'$notILike',_0x8f99('0x38'),_0x8f99('0x3b'),'$contains',_0x8f99('0x3c'),_0x8f99('0x3d')]);_0x27e1f4[_0x8f99('0x3e')]=_[_0x8f99('0x2d')](_0x512ad9[_0x8f99('0x2a')],qs[_0x8f99('0x3f')](_0x441ead[_0x8f99('0x2b')][_0x8f99('0x3f')]));_0x27e1f4[_0x8f99('0x3e')]=_0x27e1f4[_0x8f99('0x3e')][_0x8f99('0x40')]?_0x27e1f4[_0x8f99('0x3e')]:_0x512ad9[_0x8f99('0x2a')];if(!_0x441ead[_0x8f99('0x2b')][_0x8f99('0x41')](_0x8f99('0x42'))){_0x27e1f4[_0x8f99('0x19')]=qs['limit'](_0x441ead[_0x8f99('0x2b')][_0x8f99('0x19')]);_0x27e1f4['offset']=qs[_0x8f99('0x17')](_0x441ead[_0x8f99('0x2b')][_0x8f99('0x17')]);}_0x27e1f4[_0x8f99('0x43')]=qs[_0x8f99('0x44')](_0x441ead[_0x8f99('0x2b')][_0x8f99('0x44')]);_0x27e1f4[_0x8f99('0x45')]=qs['filters'](_[_0x8f99('0x46')](_0x441ead['query'],_0x512ad9[_0x8f99('0x2c')]),_0x510e34);if(_0x441ead['query'][_0x8f99('0x47')]){_0x27e1f4[_0x8f99('0x45')]=_[_0x8f99('0x48')](_0x27e1f4[_0x8f99('0x45')],{'$or':_[_0x8f99('0x24')](_0x510e34,function(_0x29bc4e){if(_0x29bc4e[_0x8f99('0x28')]!==_0x8f99('0x49')){var _0x4c3de7={};_0x4c3de7[_0x29bc4e[_0x8f99('0x22')]]={'$like':'%'+_0x441ead[_0x8f99('0x2b')][_0x8f99('0x47')]+'%'};return _0x4c3de7;}})});}_0x27e1f4=_[_0x8f99('0x48')]({},_0x27e1f4,_0x441ead[_0x8f99('0x4a')]);var _0x428dda={'where':_0x27e1f4[_0x8f99('0x45')]};return db['CmHopper'][_0x8f99('0x1a')](_0x428dda)[_0x8f99('0x1f')](function(_0x4d1020){_0x3c168f[_0x8f99('0x1a')]=_0x4d1020;if(_0x441ead[_0x8f99('0x2b')]['includeAll']){_0x27e1f4[_0x8f99('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0x8f99('0x4c')](_0x27e1f4);})[_0x8f99('0x1f')](function(_0x5e2a0c){_0x3c168f['rows']=_0x5e2a0c;return _0x3c168f;})[_0x8f99('0x1f')](respondWithFilteredResult(_0x2634ab,_0x27e1f4))['catch'](handleError(_0x2634ab,null));};exports[_0x8f99('0x4d')]=function(_0x1386ef,_0x507f51){var _0xf48676={'raw':!![],'where':{'id':_0x1386ef[_0x8f99('0x4e')]['id']}},_0x47bef1={};_0x47bef1['model']=_[_0x8f99('0x4f')](db[_0x8f99('0x25')][_0x8f99('0x26')]);_0x47bef1['query']=_[_0x8f99('0x4f')](_0x1386ef[_0x8f99('0x2b')]);_0x47bef1[_0x8f99('0x2c')]=_[_0x8f99('0x2d')](_0x47bef1[_0x8f99('0x2a')],_0x47bef1[_0x8f99('0x2b')]);_0xf48676['attributes']=_[_0x8f99('0x2d')](_0x47bef1['model'],qs['fields'](_0x1386ef[_0x8f99('0x2b')][_0x8f99('0x3f')]));_0xf48676['attributes']=_0xf48676['attributes']['length']?_0xf48676[_0x8f99('0x3e')]:_0x47bef1['model'];if(_0x1386ef['query'][_0x8f99('0x50')]){_0xf48676[_0x8f99('0x4b')]=[{'all':!![]}];}_0xf48676=_[_0x8f99('0x48')]({},_0xf48676,_0x1386ef[_0x8f99('0x4a')]);return db[_0x8f99('0x25')][_0x8f99('0x51')](_0xf48676)[_0x8f99('0x1f')](handleEntityNotFound(_0x507f51,null))[_0x8f99('0x1f')](respondWithResult(_0x507f51,null))['catch'](handleError(_0x507f51,null));};exports['create']=function(_0x31a2e5,_0x5176a0){return db['CmHopper'][_0x8f99('0x52')](_0x31a2e5[_0x8f99('0x53')],{})[_0x8f99('0x1f')](respondWithResult(_0x5176a0,0xc9))['catch'](handleError(_0x5176a0,null));};exports['update']=function(_0x7dcbd5,_0xd15783){if(_0x7dcbd5[_0x8f99('0x53')]['id']){delete _0x7dcbd5['body']['id'];}return db[_0x8f99('0x25')][_0x8f99('0x51')]({'where':{'id':_0x7dcbd5['params']['id']}})[_0x8f99('0x1f')](handleEntityNotFound(_0xd15783,null))[_0x8f99('0x1f')](saveUpdates(_0x7dcbd5[_0x8f99('0x53')],null))[_0x8f99('0x1f')](respondWithResult(_0xd15783,null))[_0x8f99('0x54')](handleError(_0xd15783,null));};exports[_0x8f99('0x55')]=function(_0x3935e5,_0x234591){return db[_0x8f99('0x25')][_0x8f99('0x55')]()[_0x8f99('0x1f')](respondWithResult(_0x234591,null))[_0x8f99('0x54')](handleError(_0x234591,null));};exports[_0x8f99('0x56')]=function(_0x323959,_0x19bf30){var _0x332480;return db[_0x8f99('0x25')][_0x8f99('0x51')]({'where':{'id':_0x323959['params']['id']}})[_0x8f99('0x1f')](handleEntityNotFound(_0x19bf30,null))[_0x8f99('0x1f')](function(_0x1f0995){if(_0x1f0995){return _0x1f0995[_0x8f99('0x56')]()[_0x8f99('0x1f')](function(_0x203a70){return _0x203a70;});}})['then'](function(_0x7587e6){_0x332480=_0x7587e6;if(_0x7587e6){if(_0x7587e6['VoiceQueueId']||_0x7587e6[_0x8f99('0x57')]){return db[_0x7587e6['VoiceQueueId']?_0x8f99('0x58'):_0x8f99('0x59')][_0x8f99('0x51')]({'where':{'id':_0x7587e6[_0x8f99('0x5a')]?_0x7587e6['VoiceQueueId']:_0x7587e6['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x8f99('0x1f')](function(_0x5aa022){var _0x45c2b1={};if(_0x5aa022){_['merge'](_0x45c2b1,_[_0x8f99('0x5b')](_0x332480['dataValues'],['createdAt',_0x8f99('0x5c'),'id']));_0x45c2b1[_0x8f99('0x5d')]=0x15;_0x45c2b1[_0x8f99('0x5e')]=_0x8f99('0x5f');_0x45c2b1['campaign']=_0x5aa022['name'];_0x45c2b1[_0x8f99('0x60')]=_0x323959[_0x8f99('0x61')]['name'];_0x45c2b1[_0x8f99('0x62')]=_0x323959['user']['id'];_0x45c2b1[_0x8f99('0x5f')]=!![];_0x45c2b1[_0x8f99('0x63')]=moment()[_0x8f99('0x64')](_0x8f99('0x65'));_0x45c2b1[_0x8f99('0x66')]=_0x332480[_0x8f99('0x67')];_0x45c2b1['campaigntype']=_0x332480[_0x8f99('0x5a')]?'queue':_0x8f99('0x68');return db[_0x8f99('0x69')][_0x8f99('0x51')]({'where':{'id':_0x45c2b1[_0x8f99('0x6a')]},'attributes':[_0x8f99('0x6b'),_0x8f99('0x6c')]})[_0x8f99('0x1f')](function(_0x5c2de8){if(!_[_0x8f99('0x6d')](_0x19bf30)&&!_[_0x8f99('0x6d')](_0x5c2de8['firstName'])){_0x45c2b1[_0x8f99('0x6e')]=_0x5c2de8[_0x8f99('0x6b')];if(!_[_0x8f99('0x6d')](_0x5c2de8[_0x8f99('0x6c')])){_0x45c2b1['calleridname']+='\x20'+_0x5c2de8[_0x8f99('0x6c')];}}})['finally'](function(){return db['CmHopperFinal'][_0x8f99('0x52')](_0x45c2b1);});}})['then'](function(){return _0x19bf30[_0x8f99('0x14')](0xcc)['end']();})[_0x8f99('0x54')](handleError(_0x19bf30,null));};exports['getPreview']=function(_0x2b03aa,_0x2346d5,_0x1acfca){var _0x288cc1=[];return db[_0x8f99('0x69')]['describe']()[_0x8f99('0x1f')](function(_0x285100){_0x288cc1=_['keys'](_0x285100);return _0x2b03aa['user'][_0x8f99('0x6f')]({'where':{'type':_0x8f99('0x70'),'dialActive':!![],'dialMethod':_0x8f99('0x71')},'attributes':['id',_0x8f99('0x72'),_0x8f99('0x73')],'raw':!![]});})[_0x8f99('0x1f')](function(_0x3f8ecf){if(_0x3f8ecf&&_0x3f8ecf[_0x8f99('0x40')]){return db[_0x8f99('0x74')][_0x8f99('0x75')](function(_0x2f16fe){var _0x344b86={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f99('0x64')](_0x8f99('0x65'))},'VoiceQueueId':{'$in':_[_0x8f99('0x24')](_0x3f8ecf,'id')},'$or':[{'UserId':null},{'UserId':_0x2b03aa['user']['id']}]};var _0x39a6a8={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3f8ecf)[_0x8f99('0x47')](['dialPreviewAutoRecallMe',0x0])[_0x8f99('0x24')]('id')[_0x8f99('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x2b03aa[_0x8f99('0x61')]['id']}]};var _0x1c0e0c={'$or':[_0x344b86,_0x39a6a8]};var _0x8b0f53=[];if(_0x2b03aa['body']['direction']&&_0x2b03aa['body'][_0x8f99('0x77')]==='prev'){if(!_['isEmpty'](_0x2b03aa['body']['hopperIds'])){_0x1c0e0c['id']={'$in':_0x2b03aa['body'][_0x8f99('0x78')]};}_0x8b0f53=[[_0x8f99('0x79'),_0x8f99('0x7a')],[_0x8f99('0x7b'),_0x3f8ecf[0x0][_0x8f99('0x72')]==='ASC'?_0x8f99('0x7c'):_0x8f99('0x7a')],db[_0x8f99('0x74')][_0x8f99('0x7d')](_0x8f99('0x7e')),['id',_0x8f99('0x7c')]];}else{if(!_[_0x8f99('0x7f')](_0x2b03aa[_0x8f99('0x53')][_0x8f99('0x78')])){_0x1c0e0c['id']={'$notIn':_0x2b03aa[_0x8f99('0x53')]['hopperIds']};}_0x8b0f53=[[_0x8f99('0x79'),_0x8f99('0x7c')],[_0x8f99('0x7b'),_0x3f8ecf[0x0][_0x8f99('0x72')]],db['sequelize'][_0x8f99('0x7d')](_0x8f99('0x80')),['id',_0x8f99('0x7a')]];}return db[_0x8f99('0x25')]['findOne']({'attributes':['id',_0x8f99('0x81'),_0x8f99('0x82')],'where':_0x1c0e0c,'order':_0x8b0f53,'transaction':_0x2f16fe,'lock':_0x2f16fe[_0x8f99('0x83')][_0x8f99('0x84')],'include':[{'model':db['CmContact'],'as':_0x8f99('0x85'),'attributes':_0x288cc1,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x8f99('0x22')]}]},{'model':db[_0x8f99('0x86')],'as':'List','attributes':['id',_0x8f99('0x22')]},{'model':db[_0x8f99('0x58')],'as':'Queue','attributes':['id',_0x8f99('0x22'),_0x8f99('0x87')]}]})['then'](function(_0xb62c83){if(_0xb62c83){return _0xb62c83['update']({'UserId':_0x2b03aa[_0x8f99('0x61')]['id']},{'transaction':_0x2f16fe});}});});}})['then'](handleEntityNotFound(_0x2346d5,null))[_0x8f99('0x1f')](respondWithResult(_0x2346d5,null))[_0x8f99('0x54')](handleError(_0x2346d5,null));};exports['getOpenContacts']=function(_0x331993,_0x338b45,_0x8b0b8d){return _0x331993[_0x8f99('0x61')]['getVoiceQueues']({'where':{'type':_0x8f99('0x70'),'dialActive':!![],'dialMethod':_0x8f99('0x71')},'attributes':['id'],'raw':!![]})[_0x8f99('0x1f')](function(_0x2c9367){if(_0x2c9367&&_0x2c9367['length']){return db[_0x8f99('0x25')][_0x8f99('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8f99('0x64')](_0x8f99('0x65'))},'VoiceQueueId':{'$in':_[_0x8f99('0x24')](_0x2c9367,'id')},'$or':[{'UserId':null},{'UserId':_0x331993[_0x8f99('0x61')]['id']}]}});}return 0x0;})[_0x8f99('0x1f')](function(_0x27eac7){if(!_['isNil'](_0x27eac7)&&_['isNumber'](_0x27eac7)){return _0x338b45[_0x8f99('0x14')](0xc8)[_0x8f99('0x16')]({'contacts':_0x27eac7});}else{logger[_0x8f99('0x20')](_0x8f99('0x88'),'getOpenContacts',0x194,_0x8f99('0x89'));_0x338b45[_0x8f99('0x8a')](0x194);}})[_0x8f99('0x54')](handleError(_0x338b45,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 43172b2..66abb7a 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 _0x6f47=['CmHopper','scheduledat','phone','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x6f47,0xc7));var _0x76f4=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x6f47[_0x75f869];return _0x10af8b;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x76f4('0xa'),'fields':[_0x76f4('0xa')]},{'name':_0x76f4('0xb'),'fields':[_0x76f4('0xb')]},{'name':_0x76f4('0xc'),'fields':['priority']}],'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(_0x41bee3,_0x2315fb){var _0x2596ac=function(_0x82ba4c){while(--_0x82ba4c){_0x41bee3['push'](_0x41bee3['shift']());}};_0x2596ac(++_0x2315fb);}(_0xeda8,0x104));var _0x8eda=function(_0x422aa9,_0x5f1e7d){_0x422aa9=_0x422aa9-0x0;var _0x5efb75=_0xeda8[_0x422aa9];return _0x5efb75;};'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 9c4727f..6b0fe6c 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 _0xab82=['jayson/promise','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','UPDATE','keys','User','name','voicePause','UserId','push','update','includes','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','length','all','GetCmHopperPreview','describe','Contact','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x45fbb7,_0x399405){var _0x4f4769=function(_0x43836f){while(--_0x43836f){_0x45fbb7['push'](_0x45fbb7['shift']());}};_0x4f4769(++_0x399405);}(_0xab82,0x104));var _0x2ab8=function(_0x3e292a,_0x46b1d0){_0x3e292a=_0x3e292a-0x0;var _0x5be4dc=_0xab82[_0x3e292a];return _0x5be4dc;};'use strict';var _=require(_0x2ab8('0x0'));var util=require(_0x2ab8('0x1'));var moment=require('moment');var BPromise=require(_0x2ab8('0x2'));var rs=require(_0x2ab8('0x3'));var fs=require('fs');var Redis=require(_0x2ab8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ab8('0x5'));var logger=require(_0x2ab8('0x6'))(_0x2ab8('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ab8('0x8'));var client=jayson['client'][_0x2ab8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x487fbc,_0x45b19b,_0x182d4e){return new BPromise(function(_0x5ac8ab,_0xe2f18f){return client['request'](_0x487fbc,_0x182d4e)[_0x2ab8('0xa')](function(_0x29a30d){logger[_0x2ab8('0xb')](_0x2ab8('0xc'),_0x45b19b,_0x2ab8('0xd'));logger[_0x2ab8('0xe')](_0x2ab8('0xf'),_0x45b19b,_0x2ab8('0xd'),JSON[_0x2ab8('0x10')](_0x29a30d));if(_0x29a30d[_0x2ab8('0x11')]){if(_0x29a30d['error'][_0x2ab8('0x12')]===0x1f4){logger[_0x2ab8('0x11')]('CmHopper,\x20%s,\x20%s',_0x45b19b,_0x29a30d[_0x2ab8('0x11')][_0x2ab8('0x13')]);return _0xe2f18f(_0x29a30d[_0x2ab8('0x11')][_0x2ab8('0x13')]);}logger[_0x2ab8('0x11')](_0x2ab8('0xc'),_0x45b19b,_0x29a30d[_0x2ab8('0x11')]['message']);return _0x5ac8ab(_0x29a30d[_0x2ab8('0x11')][_0x2ab8('0x13')]);}else{logger[_0x2ab8('0xb')]('CmHopper,\x20%s,\x20%s',_0x45b19b,_0x2ab8('0xd'));_0x5ac8ab(_0x29a30d[_0x2ab8('0x14')][_0x2ab8('0x13')]);}})[_0x2ab8('0x15')](function(_0x7136b){logger[_0x2ab8('0x11')](_0x2ab8('0xc'),_0x45b19b,_0x7136b);_0xe2f18f(_0x7136b);});});}exports[_0x2ab8('0x16')]=function(_0x475e7b){var _0x18dfa5=this;return new Promise(function(_0x34e88e,_0x4a84f9){return db[_0x2ab8('0x17')][_0x2ab8('0x18')]({'raw':_0x475e7b[_0x2ab8('0x19')]?_0x475e7b[_0x2ab8('0x19')][_0x2ab8('0x1a')]===undefined?!![]:![]:!![],'where':_0x475e7b[_0x2ab8('0x19')]?_0x475e7b[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null,'attributes':_0x475e7b['options']?_0x475e7b[_0x2ab8('0x19')][_0x2ab8('0x1c')]||null:null,'limit':_0x475e7b[_0x2ab8('0x19')]?_0x475e7b[_0x2ab8('0x19')][_0x2ab8('0x1d')]||null:null,'include':_0x475e7b[_0x2ab8('0x19')]?_0x475e7b[_0x2ab8('0x19')]['include']?_['map'](_0x475e7b[_0x2ab8('0x19')][_0x2ab8('0x1e')],function(_0x131dbf){return{'model':db[_0x131dbf['model']],'as':_0x131dbf['as'],'attributes':_0x131dbf[_0x2ab8('0x1c')],'include':_0x131dbf[_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x131dbf['include'],function(_0x566b09){return{'model':db[_0x566b09[_0x2ab8('0x20')]],'as':_0x566b09['as'],'attributes':_0x566b09[_0x2ab8('0x1c')],'include':_0x566b09[_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x566b09[_0x2ab8('0x1e')],function(_0x3f21fc){return{'model':db[_0x3f21fc[_0x2ab8('0x20')]],'as':_0x3f21fc['as'],'attributes':_0x3f21fc[_0x2ab8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab8('0xa')](function(_0x3d69e0){logger[_0x2ab8('0xb')](_0x2ab8('0x16'),_0x475e7b);logger['debug']('GetCmHopper',_0x475e7b,JSON[_0x2ab8('0x10')](_0x3d69e0));_0x34e88e(_0x3d69e0);})['catch'](function(_0x365635){logger[_0x2ab8('0x11')]('GetCmHopper',_0x365635[_0x2ab8('0x13')],_0x475e7b);_0x4a84f9(_0x18dfa5[_0x2ab8('0x11')](0x1f4,_0x365635[_0x2ab8('0x13')]));});});};exports['ShowCmHopper']=function(_0x506d4d){var _0x49ad02=this;return new Promise(function(_0x2aff63,_0x1ea39f){return db['CmHopper'][_0x2ab8('0x21')]({'raw':_0x506d4d['options']?_0x506d4d[_0x2ab8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x506d4d[_0x2ab8('0x19')]?_0x506d4d[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null,'attributes':_0x506d4d['options']?_0x506d4d[_0x2ab8('0x19')][_0x2ab8('0x1c')]||null:null,'include':_0x506d4d[_0x2ab8('0x19')]?_0x506d4d[_0x2ab8('0x19')][_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x506d4d['options']['include'],function(_0x44db25){return{'model':db[_0x44db25[_0x2ab8('0x20')]],'as':_0x44db25['as'],'attributes':_0x44db25['attributes'],'include':_0x44db25[_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x44db25[_0x2ab8('0x1e')],function(_0x5a33e4){return{'model':db[_0x5a33e4[_0x2ab8('0x20')]],'as':_0x5a33e4['as'],'attributes':_0x5a33e4[_0x2ab8('0x1c')],'include':_0x5a33e4[_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x5a33e4[_0x2ab8('0x1e')],function(_0x40e608){return{'model':db[_0x40e608[_0x2ab8('0x20')]],'as':_0x40e608['as'],'attributes':_0x40e608[_0x2ab8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab8('0xa')](function(_0x5f29fb){logger[_0x2ab8('0xb')](_0x2ab8('0x22'),_0x506d4d);logger[_0x2ab8('0xe')](_0x2ab8('0x22'),_0x506d4d,JSON[_0x2ab8('0x10')](_0x5f29fb));_0x2aff63(_0x5f29fb);})[_0x2ab8('0x15')](function(_0x539e4f){logger['error'](_0x2ab8('0x22'),_0x539e4f[_0x2ab8('0x13')],_0x506d4d);_0x1ea39f(_0x49ad02[_0x2ab8('0x11')](0x1f4,_0x539e4f[_0x2ab8('0x13')]));});});};exports[_0x2ab8('0x23')]=function(_0x24cb55){var _0x4c3288=this;return new Promise(function(_0x523f89,_0x3b0ee8){return db[_0x2ab8('0x17')]['create'](_0x24cb55[_0x2ab8('0x24')],{'raw':_0x24cb55[_0x2ab8('0x19')]?_0x24cb55[_0x2ab8('0x19')][_0x2ab8('0x1a')]===undefined?!![]:![]:!![]})[_0x2ab8('0xa')](function(_0x4bf0e5){logger[_0x2ab8('0xb')](_0x2ab8('0x23'),_0x24cb55);logger['debug'](_0x2ab8('0x23'),_0x24cb55,JSON['stringify'](_0x4bf0e5));_0x523f89(_0x4bf0e5);})[_0x2ab8('0x15')](function(_0x250eac){logger[_0x2ab8('0x11')](_0x2ab8('0x23'),_0x250eac['message'],_0x24cb55);_0x3b0ee8(_0x4c3288[_0x2ab8('0x11')](0x1f4,_0x250eac[_0x2ab8('0x13')]));});});};exports[_0x2ab8('0x25')]=function(_0x499652){var _0x525268=this;return new Promise(function(_0x883a51,_0x1eebdb){return db[_0x2ab8('0x17')]['update'](_0x499652[_0x2ab8('0x24')],{'raw':_0x499652[_0x2ab8('0x19')]?_0x499652['options'][_0x2ab8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x499652['options']?_0x499652['options']['where']||null:null,'attributes':_0x499652[_0x2ab8('0x19')]?_0x499652['options']['attributes']||null:null,'limit':_0x499652['options']?_0x499652[_0x2ab8('0x19')][_0x2ab8('0x1d')]||null:null})[_0x2ab8('0xa')](function(_0xa88dcf){logger[_0x2ab8('0xb')]('UpdateCmHopper',_0x499652);logger[_0x2ab8('0xe')](_0x2ab8('0x25'),_0x499652,JSON['stringify'](_0xa88dcf));_0x883a51(_0xa88dcf);})[_0x2ab8('0x15')](function(_0x2889a8){logger[_0x2ab8('0x11')](_0x2ab8('0x25'),_0x2889a8[_0x2ab8('0x13')],_0x499652);_0x1eebdb(_0x525268[_0x2ab8('0x11')](0x1f4,_0x2889a8['message']));});});};exports['DestroyCmHopper']=function(_0x57feb0){var _0x2599fc=this;return new Promise(function(_0x2910e8,_0x1f1638){return db[_0x2ab8('0x17')][_0x2ab8('0x26')]({'where':_0x57feb0[_0x2ab8('0x19')]?_0x57feb0[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null})[_0x2ab8('0xa')](function(_0x2dfd47){logger[_0x2ab8('0xb')](_0x2ab8('0x27'),_0x57feb0);logger[_0x2ab8('0xe')](_0x2ab8('0x27'),_0x57feb0,JSON[_0x2ab8('0x10')](_0x2dfd47));_0x2910e8(_0x2dfd47);})[_0x2ab8('0x15')](function(_0x485492){logger[_0x2ab8('0x11')](_0x2ab8('0x27'),_0x485492[_0x2ab8('0x13')],_0x57feb0);_0x1f1638(_0x2599fc[_0x2ab8('0x11')](0x1f4,_0x485492[_0x2ab8('0x13')]));});});};exports[_0x2ab8('0x28')]=function(_0x22f719){var _0xc8c3c4=this;return new Promise(function(_0xaad1ef,_0x5e6bf9){return db[_0x2ab8('0x29')]['describe']()['then'](function(_0x454fcf){return db[_0x2ab8('0x2a')][_0x2ab8('0x2b')](function(_0x506ca6){return db[_0x2ab8('0x17')]['findAll']({'where':_0x22f719[_0x2ab8('0x19')]?_0x22f719['options'][_0x2ab8('0x1b')]||null:null,'attributes':_0x22f719[_0x2ab8('0x19')]?_0x22f719[_0x2ab8('0x19')][_0x2ab8('0x1c')]||null:null,'limit':_0x22f719[_0x2ab8('0x19')]?_0x22f719['options'][_0x2ab8('0x1d')]||null:null,'order':_0x22f719[_0x2ab8('0x19')]?_0x22f719[_0x2ab8('0x19')]['order']||null:null,'transaction':_0x506ca6,'lock':_0x506ca6['LOCK'][_0x2ab8('0x2c')],'include':[{'model':db[_0x2ab8('0x29')],'as':'Contact','attributes':_[_0x2ab8('0x2d')](_0x454fcf)},{'model':db[_0x2ab8('0x2e')],'as':'Agent','attributes':['id',_0x2ab8('0x2f'),_0x2ab8('0x30')]}]})[_0x2ab8('0xa')](function(_0x585b6b){var _0x4d5006=[];var _0x276f0c=[];for(var _0x1b03a5=0x0;_0x1b03a5<_0x585b6b['length'];_0x1b03a5+=0x1){var _0x3ff55f=_0x585b6b[_0x1b03a5][_0x2ab8('0x31')];if(_0x3ff55f===null){_0x4d5006[_0x2ab8('0x32')](_0x585b6b[_0x1b03a5][_0x2ab8('0x33')](_0x22f719[_0x2ab8('0x24')],{'transaction':_0x506ca6}));}else if(!_0x276f0c[_0x2ab8('0x34')](_0x3ff55f)){_0x276f0c[_0x2ab8('0x32')](_0x3ff55f);_0x4d5006[_0x2ab8('0x32')](_0x585b6b[_0x1b03a5][_0x2ab8('0x33')](_0x22f719[_0x2ab8('0x24')],{'transaction':_0x506ca6}));}}return BPromise['all'](_0x4d5006);});})[_0x2ab8('0xa')](function(_0x1175cd){logger[_0x2ab8('0xb')](_0x2ab8('0x28'),_0x22f719);logger['debug'](_0x2ab8('0x28'),_0x22f719,JSON[_0x2ab8('0x10')](_0x1175cd));_0xaad1ef(_0x1175cd);})[_0x2ab8('0x15')](function(_0x57f7b9){logger['error']('GetContactDialer',_0x57f7b9[_0x2ab8('0x13')],_0x22f719);_0x5e6bf9(_0xc8c3c4[_0x2ab8('0x11')](0x1f4,_0x57f7b9[_0x2ab8('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x3a569c){var _0x1bc977=this;return new Promise(function(_0x3c0659,_0x475c0f){return db[_0x2ab8('0x2a')][_0x2ab8('0x2b')](function(_0xcee575){return db['CmHopperFinal']['create'](_0x3a569c['body'],{'raw':_0x3a569c['options']?_0x3a569c[_0x2ab8('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0xcee575})[_0x2ab8('0xa')](function(){return db['CmHopper']['destroy']({'where':_0x3a569c[_0x2ab8('0x19')]?_0x3a569c[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null,'transaction':_0xcee575});});})[_0x2ab8('0xa')](function(_0x2ddbbd){logger[_0x2ab8('0xb')](_0x2ab8('0x35'),_0x3a569c);logger[_0x2ab8('0xe')](_0x2ab8('0x35'),_0x3a569c,JSON['stringify'](_0x2ddbbd));_0x3c0659(_0x2ddbbd);})[_0x2ab8('0x15')](function(_0x401d1c){logger[_0x2ab8('0x11')]('MoveContactManagedDialer',_0x401d1c[_0x2ab8('0x13')],_0x3a569c);_0x475c0f(_0x1bc977['error'](0x1f4,_0x401d1c[_0x2ab8('0x13')]));});});};exports['CountReScheduled']=function(_0x2a1b49){var _0x2f94d9=this;return new Promise(function(_0x54f4fc,_0x26bbc7){return db['CmHopper'][_0x2ab8('0x18')]({'raw':_0x2a1b49[_0x2ab8('0x19')]?_0x2a1b49[_0x2ab8('0x19')][_0x2ab8('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a1b49[_0x2ab8('0x19')]?_0x2a1b49[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null,'attributes':[[db[_0x2ab8('0x2a')]['fn'](_0x2ab8('0x36'),db[_0x2ab8('0x2a')]['fn']('IF',db[_0x2ab8('0x2a')]['literal'](_0x2ab8('0x37')+util['format']('\x22%s\x22',moment()['format'](_0x2ab8('0x38')))+_0x2ab8('0x39')))),_0x2ab8('0x3a')]]})['then'](function(_0x1393ec){logger[_0x2ab8('0xb')](_0x2ab8('0x3b'),_0x2a1b49);logger[_0x2ab8('0xe')](_0x2ab8('0x3b'),_0x2a1b49,JSON[_0x2ab8('0x10')](_0x1393ec));_0x54f4fc(_0x1393ec);})[_0x2ab8('0x15')](function(_0x36e509){logger[_0x2ab8('0x11')](_0x2ab8('0x3b'),_0x36e509[_0x2ab8('0x13')],_0x2a1b49);_0x26bbc7(_0x2f94d9['error'](0x1f4,_0x36e509[_0x2ab8('0x13')]));});});};exports[_0x2ab8('0x3c')]=function(_0x12e78c){var _0x1bd7d7=this;return new Promise(function(_0x42f0e0,_0x13ee32){return db['CmContact']['describe']()[_0x2ab8('0xa')](function(_0x17ab8c){return db[_0x2ab8('0x2a')][_0x2ab8('0x2b')](function(_0x1afcab){return db[_0x2ab8('0x17')][_0x2ab8('0x18')]({'where':_0x12e78c[_0x2ab8('0x19')]?_0x12e78c[_0x2ab8('0x19')][_0x2ab8('0x1b')]||null:null,'attributes':_0x12e78c[_0x2ab8('0x19')]?_0x12e78c[_0x2ab8('0x19')][_0x2ab8('0x1c')]||null:null,'limit':0x1,'order':_0x12e78c['options']?_0x12e78c['options'][_0x2ab8('0x3d')]||null:null,'group':db[_0x2ab8('0x17')][_0x2ab8('0x31')],'transaction':_0x1afcab,'lock':_0x1afcab['LOCK'][_0x2ab8('0x2c')],'include':_0x12e78c[_0x2ab8('0x19')]?_0x12e78c['options'][_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x12e78c[_0x2ab8('0x19')][_0x2ab8('0x1e')],function(_0x391957){return{'model':db[_0x391957[_0x2ab8('0x20')]],'as':_0x391957['as'],'attributes':_0x391957[_0x2ab8('0x1c')],'include':_0x391957['include']?_[_0x2ab8('0x1f')](_0x391957[_0x2ab8('0x1e')],function(_0x8b212f){return{'model':db[_0x8b212f[_0x2ab8('0x20')]],'as':_0x8b212f['as'],'attributes':_0x8b212f[_0x2ab8('0x1c')],'include':_0x8b212f[_0x2ab8('0x1e')]?_['map'](_0x8b212f[_0x2ab8('0x1e')],function(_0xea9091){return{'model':db[_0xea9091[_0x2ab8('0x20')]],'as':_0xea9091['as'],'attributes':_0xea9091[_0x2ab8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab8('0xa')](function(_0x8bb746){var _0x496c88=[];for(var _0x583065=0x0;_0x583065<_0x8bb746[_0x2ab8('0x3e')];_0x583065+=0x1){_0x496c88[_0x2ab8('0x32')](_0x8bb746[_0x583065][_0x2ab8('0x33')](_0x12e78c[_0x2ab8('0x24')],{'transaction':_0x1afcab}));}return BPromise[_0x2ab8('0x3f')](_0x496c88);});})[_0x2ab8('0xa')](function(_0xde1858){logger[_0x2ab8('0xb')](_0x2ab8('0x3c'),_0x12e78c);logger[_0x2ab8('0xe')]('GetContactRecallMe',_0x12e78c,JSON[_0x2ab8('0x10')](_0xde1858));_0x42f0e0(_0xde1858);})['catch'](function(_0x2f2b04){logger[_0x2ab8('0x11')](_0x2ab8('0x3c'),_0x2f2b04['message'],_0x12e78c);_0x13ee32(_0x1bd7d7[_0x2ab8('0x11')](0x1f4,_0x2f2b04['message']));});});});};exports[_0x2ab8('0x40')]=function(_0xcb2f7f){var _0x165ef8=this;return new Promise(function(_0x561c41,_0x377ad1){db[_0x2ab8('0x29')][_0x2ab8('0x41')]()[_0x2ab8('0xa')](function(_0x3c4bc0){return db['CmHopper'][_0x2ab8('0x18')]({'raw':_0xcb2f7f[_0x2ab8('0x19')]?_0xcb2f7f[_0x2ab8('0x19')][_0x2ab8('0x1a')]===undefined?!![]:![]:!![],'where':_0xcb2f7f[_0x2ab8('0x19')]?_0xcb2f7f['options'][_0x2ab8('0x1b')]||null:null,'attributes':_0xcb2f7f['options']?_0xcb2f7f[_0x2ab8('0x19')][_0x2ab8('0x1c')]||null:null,'limit':_0xcb2f7f[_0x2ab8('0x19')]?_0xcb2f7f[_0x2ab8('0x19')][_0x2ab8('0x1d')]||null:null,'include':_0xcb2f7f[_0x2ab8('0x19')]?_0xcb2f7f['options'][_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0xcb2f7f[_0x2ab8('0x19')][_0x2ab8('0x1e')],function(_0x3f48c2){return{'model':db[_0x3f48c2[_0x2ab8('0x20')]],'as':_0x3f48c2['as'],'attributes':_0x3f48c2['as']===_0x2ab8('0x42')?_[_0x2ab8('0x2d')](_0x3c4bc0):_0x3f48c2[_0x2ab8('0x1c')],'include':_0x3f48c2[_0x2ab8('0x1e')]?_['map'](_0x3f48c2[_0x2ab8('0x1e')],function(_0x48773b){return{'model':db[_0x48773b[_0x2ab8('0x20')]],'as':_0x48773b['as'],'attributes':_0x48773b[_0x2ab8('0x1c')],'include':_0x48773b[_0x2ab8('0x1e')]?_[_0x2ab8('0x1f')](_0x48773b[_0x2ab8('0x1e')],function(_0x5984be){return{'model':db[_0x5984be[_0x2ab8('0x20')]],'as':_0x5984be['as'],'attributes':_0x5984be[_0x2ab8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab8('0xa')](function(_0x12bf69){logger[_0x2ab8('0xb')]('GetCmHopper',_0xcb2f7f);logger[_0x2ab8('0xe')](_0x2ab8('0x16'),_0xcb2f7f,JSON['stringify'](_0x12bf69));_0x561c41(_0x12bf69);})['catch'](function(_0x557e91){logger['error'](_0x2ab8('0x16'),_0x557e91[_0x2ab8('0x13')],_0xcb2f7f);_0x377ad1(_0x165ef8['error'](0x1f4,_0x557e91[_0x2ab8('0x13')]));});});});}; \ No newline at end of file +var _0xb0c0=['error','message','request\x20sent','result','CmHopper','findAll','options','raw','attributes','limit','include','map','model','GetCmHopper','catch','ShowCmHopper','find','where','create','body','CreateCmHopper','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','voicePause','length','push','includes','all','CmHopperFinal','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','UserId','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8cca7b,_0x469c05){var _0x27ccfb=function(_0x5da912){while(--_0x5da912){_0x8cca7b['push'](_0x8cca7b['shift']());}};_0x27ccfb(++_0x469c05);}(_0xb0c0,0x1ed));var _0x0b0c=function(_0x5db290,_0x3f4338){_0x5db290=_0x5db290-0x0;var _0x4a7f08=_0xb0c0[_0x5db290];return _0x4a7f08;};'use strict';var _=require(_0x0b0c('0x0'));var util=require(_0x0b0c('0x1'));var moment=require(_0x0b0c('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b0c('0x4'))['db'];var utils=require(_0x0b0c('0x5'));var logger=require(_0x0b0c('0x6'))(_0x0b0c('0x7'));var config=require(_0x0b0c('0x8'));var jayson=require(_0x0b0c('0x9'));var client=jayson[_0x0b0c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365c31,_0x535b11,_0x28ec12){return new BPromise(function(_0x3df688,_0x49bc49){return client[_0x0b0c('0xb')](_0x365c31,_0x28ec12)[_0x0b0c('0xc')](function(_0x51b4c2){logger[_0x0b0c('0xd')](_0x0b0c('0xe'),_0x535b11,'request\x20sent');logger[_0x0b0c('0xf')](_0x0b0c('0x10'),_0x535b11,'request\x20sent',JSON[_0x0b0c('0x11')](_0x51b4c2));if(_0x51b4c2['error']){if(_0x51b4c2['error']['code']===0x1f4){logger[_0x0b0c('0x12')](_0x0b0c('0xe'),_0x535b11,_0x51b4c2['error'][_0x0b0c('0x13')]);return _0x49bc49(_0x51b4c2[_0x0b0c('0x12')][_0x0b0c('0x13')]);}logger['error'](_0x0b0c('0xe'),_0x535b11,_0x51b4c2[_0x0b0c('0x12')][_0x0b0c('0x13')]);return _0x3df688(_0x51b4c2[_0x0b0c('0x12')]['message']);}else{logger[_0x0b0c('0xd')](_0x0b0c('0xe'),_0x535b11,_0x0b0c('0x14'));_0x3df688(_0x51b4c2[_0x0b0c('0x15')][_0x0b0c('0x13')]);}})['catch'](function(_0x306c47){logger[_0x0b0c('0x12')](_0x0b0c('0xe'),_0x535b11,_0x306c47);_0x49bc49(_0x306c47);});});}exports['GetCmHopper']=function(_0x9b95c){var _0x80c4d6=this;return new Promise(function(_0x35d3f4,_0x430c47){return db[_0x0b0c('0x16')][_0x0b0c('0x17')]({'raw':_0x9b95c[_0x0b0c('0x18')]?_0x9b95c[_0x0b0c('0x18')][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'where':_0x9b95c[_0x0b0c('0x18')]?_0x9b95c[_0x0b0c('0x18')]['where']||null:null,'attributes':_0x9b95c['options']?_0x9b95c[_0x0b0c('0x18')][_0x0b0c('0x1a')]||null:null,'limit':_0x9b95c[_0x0b0c('0x18')]?_0x9b95c[_0x0b0c('0x18')][_0x0b0c('0x1b')]||null:null,'include':_0x9b95c['options']?_0x9b95c[_0x0b0c('0x18')][_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x9b95c[_0x0b0c('0x18')][_0x0b0c('0x1c')],function(_0x1aa5ed){return{'model':db[_0x1aa5ed[_0x0b0c('0x1e')]],'as':_0x1aa5ed['as'],'attributes':_0x1aa5ed[_0x0b0c('0x1a')],'include':_0x1aa5ed[_0x0b0c('0x1c')]?_['map'](_0x1aa5ed[_0x0b0c('0x1c')],function(_0x22d645){return{'model':db[_0x22d645[_0x0b0c('0x1e')]],'as':_0x22d645['as'],'attributes':_0x22d645[_0x0b0c('0x1a')],'include':_0x22d645[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x22d645[_0x0b0c('0x1c')],function(_0x5852e5){return{'model':db[_0x5852e5[_0x0b0c('0x1e')]],'as':_0x5852e5['as'],'attributes':_0x5852e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b0c('0xc')](function(_0x334db6){logger[_0x0b0c('0xd')]('GetCmHopper',_0x9b95c);logger[_0x0b0c('0xf')](_0x0b0c('0x1f'),_0x9b95c,JSON[_0x0b0c('0x11')](_0x334db6));_0x35d3f4(_0x334db6);})[_0x0b0c('0x20')](function(_0x385e48){logger['error']('GetCmHopper',_0x385e48[_0x0b0c('0x13')],_0x9b95c);_0x430c47(_0x80c4d6[_0x0b0c('0x12')](0x1f4,_0x385e48[_0x0b0c('0x13')]));});});};exports[_0x0b0c('0x21')]=function(_0xd5539c){var _0x1c6e3e=this;return new Promise(function(_0x25d9e9,_0x4d605b){return db[_0x0b0c('0x16')][_0x0b0c('0x22')]({'raw':_0xd5539c['options']?_0xd5539c['options'][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'where':_0xd5539c[_0x0b0c('0x18')]?_0xd5539c[_0x0b0c('0x18')][_0x0b0c('0x23')]||null:null,'attributes':_0xd5539c['options']?_0xd5539c[_0x0b0c('0x18')][_0x0b0c('0x1a')]||null:null,'include':_0xd5539c[_0x0b0c('0x18')]?_0xd5539c[_0x0b0c('0x18')][_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0xd5539c[_0x0b0c('0x18')][_0x0b0c('0x1c')],function(_0x3c24e6){return{'model':db[_0x3c24e6[_0x0b0c('0x1e')]],'as':_0x3c24e6['as'],'attributes':_0x3c24e6['attributes'],'include':_0x3c24e6[_0x0b0c('0x1c')]?_['map'](_0x3c24e6[_0x0b0c('0x1c')],function(_0x57c833){return{'model':db[_0x57c833['model']],'as':_0x57c833['as'],'attributes':_0x57c833['attributes'],'include':_0x57c833[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x57c833[_0x0b0c('0x1c')],function(_0xf6bade){return{'model':db[_0xf6bade[_0x0b0c('0x1e')]],'as':_0xf6bade['as'],'attributes':_0xf6bade[_0x0b0c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b0c('0xc')](function(_0x1d4f18){logger[_0x0b0c('0xd')]('ShowCmHopper',_0xd5539c);logger[_0x0b0c('0xf')](_0x0b0c('0x21'),_0xd5539c,JSON['stringify'](_0x1d4f18));_0x25d9e9(_0x1d4f18);})[_0x0b0c('0x20')](function(_0x2a2bd7){logger['error'](_0x0b0c('0x21'),_0x2a2bd7[_0x0b0c('0x13')],_0xd5539c);_0x4d605b(_0x1c6e3e[_0x0b0c('0x12')](0x1f4,_0x2a2bd7['message']));});});};exports['CreateCmHopper']=function(_0x465eeb){var _0x21d3e4=this;return new Promise(function(_0x5f720,_0x563b1d){return db[_0x0b0c('0x16')][_0x0b0c('0x24')](_0x465eeb[_0x0b0c('0x25')],{'raw':_0x465eeb[_0x0b0c('0x18')]?_0x465eeb['options'][_0x0b0c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x34c932){logger[_0x0b0c('0xd')](_0x0b0c('0x26'),_0x465eeb);logger[_0x0b0c('0xf')](_0x0b0c('0x26'),_0x465eeb,JSON['stringify'](_0x34c932));_0x5f720(_0x34c932);})[_0x0b0c('0x20')](function(_0x15b4e9){logger['error']('CreateCmHopper',_0x15b4e9[_0x0b0c('0x13')],_0x465eeb);_0x563b1d(_0x21d3e4['error'](0x1f4,_0x15b4e9['message']));});});};exports[_0x0b0c('0x27')]=function(_0x40298e){var _0x53663b=this;return new Promise(function(_0x408f3d,_0x16d049){return db[_0x0b0c('0x16')][_0x0b0c('0x28')](_0x40298e[_0x0b0c('0x25')],{'raw':_0x40298e['options']?_0x40298e[_0x0b0c('0x18')][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40298e[_0x0b0c('0x18')]?_0x40298e[_0x0b0c('0x18')]['where']||null:null,'attributes':_0x40298e[_0x0b0c('0x18')]?_0x40298e[_0x0b0c('0x18')][_0x0b0c('0x1a')]||null:null,'limit':_0x40298e[_0x0b0c('0x18')]?_0x40298e[_0x0b0c('0x18')][_0x0b0c('0x1b')]||null:null})[_0x0b0c('0xc')](function(_0x5df97c){logger['info']('UpdateCmHopper',_0x40298e);logger[_0x0b0c('0xf')](_0x0b0c('0x27'),_0x40298e,JSON[_0x0b0c('0x11')](_0x5df97c));_0x408f3d(_0x5df97c);})['catch'](function(_0x42a580){logger[_0x0b0c('0x12')](_0x0b0c('0x27'),_0x42a580[_0x0b0c('0x13')],_0x40298e);_0x16d049(_0x53663b[_0x0b0c('0x12')](0x1f4,_0x42a580['message']));});});};exports['DestroyCmHopper']=function(_0x58af8d){var _0x5898d7=this;return new Promise(function(_0x374a34,_0x47c36f){return db[_0x0b0c('0x16')][_0x0b0c('0x29')]({'where':_0x58af8d[_0x0b0c('0x18')]?_0x58af8d[_0x0b0c('0x18')][_0x0b0c('0x23')]||null:null})[_0x0b0c('0xc')](function(_0x5b6ad8){logger[_0x0b0c('0xd')]('DestroyCmHopper',_0x58af8d);logger['debug'](_0x0b0c('0x2a'),_0x58af8d,JSON[_0x0b0c('0x11')](_0x5b6ad8));_0x374a34(_0x5b6ad8);})['catch'](function(_0xb7b3b){logger[_0x0b0c('0x12')](_0x0b0c('0x2a'),_0xb7b3b[_0x0b0c('0x13')],_0x58af8d);_0x47c36f(_0x5898d7[_0x0b0c('0x12')](0x1f4,_0xb7b3b[_0x0b0c('0x13')]));});});};exports[_0x0b0c('0x2b')]=function(_0x413a99){var _0x85e1c8=this;return new Promise(function(_0x1058c7,_0x56ecf0){return db[_0x0b0c('0x2c')][_0x0b0c('0x2d')]()[_0x0b0c('0xc')](function(_0x3b26e8){return db[_0x0b0c('0x2e')][_0x0b0c('0x2f')](function(_0x5d1fc7){return db[_0x0b0c('0x16')][_0x0b0c('0x17')]({'where':_0x413a99[_0x0b0c('0x18')]?_0x413a99[_0x0b0c('0x18')]['where']||null:null,'attributes':_0x413a99['options']?_0x413a99[_0x0b0c('0x18')]['attributes']||null:null,'limit':_0x413a99[_0x0b0c('0x18')]?_0x413a99['options'][_0x0b0c('0x1b')]||null:null,'order':_0x413a99[_0x0b0c('0x18')]?_0x413a99[_0x0b0c('0x18')][_0x0b0c('0x30')]||null:null,'transaction':_0x5d1fc7,'lock':_0x5d1fc7[_0x0b0c('0x31')][_0x0b0c('0x32')],'include':[{'model':db[_0x0b0c('0x2c')],'as':'Contact','attributes':_[_0x0b0c('0x33')](_0x3b26e8)},{'model':db[_0x0b0c('0x34')],'as':_0x0b0c('0x35'),'attributes':['id','name',_0x0b0c('0x36')]}]})[_0x0b0c('0xc')](function(_0x31056b){var _0x44e952=[];var _0x9220c2=[];for(var _0x56fe98=0x0;_0x56fe98<_0x31056b[_0x0b0c('0x37')];_0x56fe98+=0x1){var _0x24e770=_0x31056b[_0x56fe98]['UserId'];if(_0x24e770===null){_0x44e952[_0x0b0c('0x38')](_0x31056b[_0x56fe98][_0x0b0c('0x28')](_0x413a99['body'],{'transaction':_0x5d1fc7}));}else if(!_0x9220c2[_0x0b0c('0x39')](_0x24e770)){_0x9220c2[_0x0b0c('0x38')](_0x24e770);_0x44e952[_0x0b0c('0x38')](_0x31056b[_0x56fe98]['update'](_0x413a99[_0x0b0c('0x25')],{'transaction':_0x5d1fc7}));}}return BPromise[_0x0b0c('0x3a')](_0x44e952);});})[_0x0b0c('0xc')](function(_0x3f65ea){logger[_0x0b0c('0xd')](_0x0b0c('0x2b'),_0x413a99);logger[_0x0b0c('0xf')](_0x0b0c('0x2b'),_0x413a99,JSON[_0x0b0c('0x11')](_0x3f65ea));_0x1058c7(_0x3f65ea);})[_0x0b0c('0x20')](function(_0x16599a){logger[_0x0b0c('0x12')]('GetContactDialer',_0x16599a[_0x0b0c('0x13')],_0x413a99);_0x56ecf0(_0x85e1c8[_0x0b0c('0x12')](0x1f4,_0x16599a[_0x0b0c('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x462b05){var _0x382453=this;return new Promise(function(_0x22810a,_0x1d8a74){return db['sequelize']['transaction'](function(_0x91fc71){return db[_0x0b0c('0x3b')][_0x0b0c('0x24')](_0x462b05['body'],{'raw':_0x462b05[_0x0b0c('0x18')]?_0x462b05['options'][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'transaction':_0x91fc71})[_0x0b0c('0xc')](function(){return db[_0x0b0c('0x16')]['destroy']({'where':_0x462b05[_0x0b0c('0x18')]?_0x462b05['options'][_0x0b0c('0x23')]||null:null,'transaction':_0x91fc71});});})['then'](function(_0x18ebd6){logger[_0x0b0c('0xd')]('MoveContactManagedDialer',_0x462b05);logger[_0x0b0c('0xf')](_0x0b0c('0x3c'),_0x462b05,JSON[_0x0b0c('0x11')](_0x18ebd6));_0x22810a(_0x18ebd6);})[_0x0b0c('0x20')](function(_0x4c9ac8){logger['error'](_0x0b0c('0x3c'),_0x4c9ac8[_0x0b0c('0x13')],_0x462b05);_0x1d8a74(_0x382453['error'](0x1f4,_0x4c9ac8[_0x0b0c('0x13')]));});});};exports['CountReScheduled']=function(_0x3c5c5a){var _0x306cdd=this;return new Promise(function(_0x44574c,_0x5a6995){return db['CmHopper'][_0x0b0c('0x17')]({'raw':_0x3c5c5a['options']?_0x3c5c5a['options'][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'where':_0x3c5c5a[_0x0b0c('0x18')]?_0x3c5c5a[_0x0b0c('0x18')][_0x0b0c('0x23')]||null:null,'attributes':[[db[_0x0b0c('0x2e')]['fn'](_0x0b0c('0x3d'),db[_0x0b0c('0x2e')]['fn']('IF',db[_0x0b0c('0x2e')][_0x0b0c('0x3e')](_0x0b0c('0x3f')+util[_0x0b0c('0x40')](_0x0b0c('0x41'),moment()[_0x0b0c('0x40')](_0x0b0c('0x42')))+_0x0b0c('0x43')))),'contactsRescheduled']]})[_0x0b0c('0xc')](function(_0x25504e){logger[_0x0b0c('0xd')]('CountReScheduled',_0x3c5c5a);logger[_0x0b0c('0xf')](_0x0b0c('0x44'),_0x3c5c5a,JSON['stringify'](_0x25504e));_0x44574c(_0x25504e);})[_0x0b0c('0x20')](function(_0x1da58a){logger[_0x0b0c('0x12')]('CountReScheduled',_0x1da58a[_0x0b0c('0x13')],_0x3c5c5a);_0x5a6995(_0x306cdd['error'](0x1f4,_0x1da58a['message']));});});};exports['GetContactRecallMe']=function(_0x565ada){var _0x41a225=this;return new Promise(function(_0x292d08,_0x2cc160){return db['CmContact'][_0x0b0c('0x2d')]()[_0x0b0c('0xc')](function(_0x303b34){return db[_0x0b0c('0x2e')]['transaction'](function(_0x15fbcf){return db['CmHopper'][_0x0b0c('0x17')]({'where':_0x565ada[_0x0b0c('0x18')]?_0x565ada[_0x0b0c('0x18')][_0x0b0c('0x23')]||null:null,'attributes':_0x565ada['options']?_0x565ada[_0x0b0c('0x18')][_0x0b0c('0x1a')]||null:null,'limit':0x1,'order':_0x565ada[_0x0b0c('0x18')]?_0x565ada[_0x0b0c('0x18')][_0x0b0c('0x30')]||null:null,'group':db['CmHopper'][_0x0b0c('0x45')],'transaction':_0x15fbcf,'lock':_0x15fbcf['LOCK']['UPDATE'],'include':_0x565ada[_0x0b0c('0x18')]?_0x565ada[_0x0b0c('0x18')][_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x565ada[_0x0b0c('0x18')][_0x0b0c('0x1c')],function(_0x50571d){return{'model':db[_0x50571d[_0x0b0c('0x1e')]],'as':_0x50571d['as'],'attributes':_0x50571d[_0x0b0c('0x1a')],'include':_0x50571d[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x50571d[_0x0b0c('0x1c')],function(_0x47f375){return{'model':db[_0x47f375['model']],'as':_0x47f375['as'],'attributes':_0x47f375[_0x0b0c('0x1a')],'include':_0x47f375[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x47f375['include'],function(_0xd94087){return{'model':db[_0xd94087[_0x0b0c('0x1e')]],'as':_0xd94087['as'],'attributes':_0xd94087[_0x0b0c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b0c('0xc')](function(_0x15e080){var _0x3a880a=[];for(var _0x2b35d4=0x0;_0x2b35d4<_0x15e080[_0x0b0c('0x37')];_0x2b35d4+=0x1){_0x3a880a[_0x0b0c('0x38')](_0x15e080[_0x2b35d4][_0x0b0c('0x28')](_0x565ada[_0x0b0c('0x25')],{'transaction':_0x15fbcf}));}return BPromise['all'](_0x3a880a);});})[_0x0b0c('0xc')](function(_0x1778d0){logger[_0x0b0c('0xd')]('GetContactRecallMe',_0x565ada);logger['debug'](_0x0b0c('0x46'),_0x565ada,JSON[_0x0b0c('0x11')](_0x1778d0));_0x292d08(_0x1778d0);})[_0x0b0c('0x20')](function(_0x1aedaa){logger[_0x0b0c('0x12')](_0x0b0c('0x46'),_0x1aedaa['message'],_0x565ada);_0x2cc160(_0x41a225[_0x0b0c('0x12')](0x1f4,_0x1aedaa['message']));});});});};exports[_0x0b0c('0x47')]=function(_0xce6713){var _0x460d81=this;return new Promise(function(_0x6aebb6,_0xcb7806){db[_0x0b0c('0x2c')][_0x0b0c('0x2d')]()[_0x0b0c('0xc')](function(_0x5e738f){return db['CmHopper'][_0x0b0c('0x17')]({'raw':_0xce6713['options']?_0xce6713['options'][_0x0b0c('0x19')]===undefined?!![]:![]:!![],'where':_0xce6713['options']?_0xce6713[_0x0b0c('0x18')][_0x0b0c('0x23')]||null:null,'attributes':_0xce6713['options']?_0xce6713['options']['attributes']||null:null,'limit':_0xce6713[_0x0b0c('0x18')]?_0xce6713['options'][_0x0b0c('0x1b')]||null:null,'include':_0xce6713[_0x0b0c('0x18')]?_0xce6713[_0x0b0c('0x18')][_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0xce6713[_0x0b0c('0x18')]['include'],function(_0x483693){return{'model':db[_0x483693['model']],'as':_0x483693['as'],'attributes':_0x483693['as']===_0x0b0c('0x48')?_[_0x0b0c('0x33')](_0x5e738f):_0x483693[_0x0b0c('0x1a')],'include':_0x483693[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x483693[_0x0b0c('0x1c')],function(_0x7326b3){return{'model':db[_0x7326b3[_0x0b0c('0x1e')]],'as':_0x7326b3['as'],'attributes':_0x7326b3[_0x0b0c('0x1a')],'include':_0x7326b3[_0x0b0c('0x1c')]?_[_0x0b0c('0x1d')](_0x7326b3[_0x0b0c('0x1c')],function(_0x492d99){return{'model':db[_0x492d99[_0x0b0c('0x1e')]],'as':_0x492d99['as'],'attributes':_0x492d99[_0x0b0c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b0c('0xc')](function(_0x3082f1){logger[_0x0b0c('0xd')]('GetCmHopper',_0xce6713);logger[_0x0b0c('0xf')]('GetCmHopper',_0xce6713,JSON[_0x0b0c('0x11')](_0x3082f1));_0x6aebb6(_0x3082f1);})[_0x0b0c('0x20')](function(_0x55a460){logger[_0x0b0c('0x12')]('GetCmHopper',_0x55a460[_0x0b0c('0x13')],_0xce6713);_0xcb7806(_0x460d81[_0x0b0c('0x12')](0x1f4,_0x55a460[_0x0b0c('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 675f1c6..0c1e768 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 _0xabd8=['./cmHopper.controller','index','/describe','describe','/opencontacts','isAuthenticated','getOpenContacts','get','/:id','show','post','create','/preview','getPreview','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x180644,_0x574c3d){var _0x4ab6a7=function(_0x4c103d){while(--_0x4c103d){_0x180644['push'](_0x180644['shift']());}};_0x4ab6a7(++_0x574c3d);}(_0xabd8,0xa8));var _0x8abd=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xabd8[_0x3902c1];return _0x1266cc;};'use strict';var multer=require(_0x8abd('0x0'));var util=require(_0x8abd('0x1'));var path=require('path');var timeout=require(_0x8abd('0x2'));var express=require(_0x8abd('0x3'));var router=express[_0x8abd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8abd('0x5'));var interaction=require(_0x8abd('0x6'));var config=require('../../config/environment');var controller=require(_0x8abd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8abd('0x8')]);router['get'](_0x8abd('0x9'),auth['isAuthenticated'](),controller[_0x8abd('0xa')]);router['get'](_0x8abd('0xb'),auth[_0x8abd('0xc')](),controller[_0x8abd('0xd')]);router[_0x8abd('0xe')](_0x8abd('0xf'),auth[_0x8abd('0xc')](),controller[_0x8abd('0x10')]);router[_0x8abd('0x11')]('/',auth[_0x8abd('0xc')](),controller[_0x8abd('0x12')]);router[_0x8abd('0x11')](_0x8abd('0x13'),auth['isAuthenticated'](),controller[_0x8abd('0x14')]);router['put'](_0x8abd('0xf'),auth[_0x8abd('0xc')](),controller[_0x8abd('0x15')]);router[_0x8abd('0x16')](_0x8abd('0xf'),auth[_0x8abd('0xc')](),controller[_0x8abd('0x17')]);module[_0x8abd('0x18')]=router; \ No newline at end of file +var _0xa366=['show','post','create','/preview','getPreview','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xa366,0x8b));var _0x6a36=function(_0x382563,_0x4fef09){_0x382563=_0x382563-0x0;var _0x99501e=_0xa366[_0x382563];return _0x99501e;};'use strict';var multer=require(_0x6a36('0x0'));var util=require(_0x6a36('0x1'));var path=require(_0x6a36('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a36('0x3'));var router=express[_0x6a36('0x4')]();var fs_extra=require(_0x6a36('0x5'));var auth=require(_0x6a36('0x6'));var interaction=require(_0x6a36('0x7'));var config=require('../../config/environment');var controller=require(_0x6a36('0x8'));router[_0x6a36('0x9')]('/',auth[_0x6a36('0xa')](),controller[_0x6a36('0xb')]);router[_0x6a36('0x9')](_0x6a36('0xc'),auth[_0x6a36('0xa')](),controller[_0x6a36('0xd')]);router[_0x6a36('0x9')](_0x6a36('0xe'),auth[_0x6a36('0xa')](),controller[_0x6a36('0xf')]);router[_0x6a36('0x9')](_0x6a36('0x10'),auth[_0x6a36('0xa')](),controller[_0x6a36('0x11')]);router[_0x6a36('0x12')]('/',auth[_0x6a36('0xa')](),controller[_0x6a36('0x13')]);router[_0x6a36('0x12')](_0x6a36('0x14'),auth['isAuthenticated'](),controller[_0x6a36('0x15')]);router[_0x6a36('0x16')](_0x6a36('0x10'),auth[_0x6a36('0xa')](),controller['update']);router[_0x6a36('0x17')](_0x6a36('0x10'),auth[_0x6a36('0xa')](),controller[_0x6a36('0x18')]);module[_0x6a36('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 7c9785a..3452533 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 _0x9f02=['INTEGER','contactListQueue','moment'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x9f02,0x68));var _0x29f0=function(_0x3c8d13,_0x44c143){_0x3c8d13=_0x3c8d13-0x0;var _0x3906fd=_0x9f02[_0x3c8d13];return _0x3906fd;};'use strict';var moment=require(_0x29f0('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x29f0('0x1')],'unique':_0x29f0('0x2')},'ListId':{'type':Sequelize[_0x29f0('0x1')],'unique':_0x29f0('0x2')},'VoiceQueueId':{'type':Sequelize[_0x29f0('0x1')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0xf32f=['sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf32f,0x140));var _0xff32=function(_0x5e8d22,_0xcb31f7){_0x5e8d22=_0x5e8d22-0x0;var _0x5bf1c9=_0xf32f[_0x5e8d22];return _0x5bf1c9;};'use strict';var moment=require('moment');var Sequelize=require(_0xff32('0x0'));module[_0xff32('0x1')]={'phone':{'type':Sequelize[_0xff32('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xff32('0x3')},'VoiceQueueId':{'type':Sequelize[_0xff32('0x4')],'unique':_0xff32('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index fe043ba..d6efa58 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 _0xae41=['stack','name','send','index','map','CmHopperBlack','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','error'];(function(_0x507597,_0x412525){var _0x110a0f=function(_0x57935a){while(--_0x57935a){_0x507597['push'](_0x507597['shift']());}};_0x110a0f(++_0x412525);}(_0xae41,0xaf));var _0x1ae4=function(_0x16d96c,_0x4fe5fd){_0x16d96c=_0x16d96c-0x0;var _0x27cd5e=_0xae41[_0x16d96c];return _0x27cd5e;};'use strict';var emlformat=require(_0x1ae4('0x0'));var rimraf=require(_0x1ae4('0x1'));var zipdir=require(_0x1ae4('0x2'));var jsonpatch=require(_0x1ae4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1ae4('0x4'));var util=require('util');var path=require(_0x1ae4('0x5'));var sox=require(_0x1ae4('0x6'));var csv=require('to-csv');var ejs=require(_0x1ae4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ae4('0x8'));var squel=require(_0x1ae4('0x9'));var crypto=require(_0x1ae4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ae4('0xb'));var toCsv=require(_0x1ae4('0xc'));var querystring=require(_0x1ae4('0xd'));var Papa=require(_0x1ae4('0xe'));var Redis=require(_0x1ae4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ae4('0x10'))('api');var utils=require(_0x1ae4('0x11'));var config=require(_0x1ae4('0x12'));var licenseUtil=require(_0x1ae4('0x13'));var db=require(_0x1ae4('0x14'))['db'];function respondWithStatusCode(_0x52382b,_0x7d375c){_0x7d375c=_0x7d375c||0xcc;return function(_0x365b77){if(_0x365b77){return _0x52382b[_0x1ae4('0x15')](_0x7d375c);}return _0x52382b[_0x1ae4('0x16')](_0x7d375c)[_0x1ae4('0x17')]();};}function respondWithResult(_0x358b1a,_0x52a29d){_0x52a29d=_0x52a29d||0xc8;return function(_0x4ce84e){if(_0x4ce84e){return _0x358b1a[_0x1ae4('0x16')](_0x52a29d)[_0x1ae4('0x18')](_0x4ce84e);}};}function respondWithFilteredResult(_0x656f08,_0x44a9da){return function(_0x3990c0){if(_0x3990c0){var _0x3507ca=typeof _0x44a9da[_0x1ae4('0x19')]==='undefined'&&typeof _0x44a9da[_0x1ae4('0x1a')]==='undefined';var _0x1bf542=_0x3990c0[_0x1ae4('0x1b')];var _0x2a1335=_0x3507ca?0x0:_0x44a9da[_0x1ae4('0x19')];var _0x581a55=_0x3507ca?_0x3990c0['count']:_0x44a9da[_0x1ae4('0x19')]+_0x44a9da['limit'];var _0x128681;if(_0x581a55>=_0x1bf542){_0x581a55=_0x1bf542;_0x128681=0xc8;}else{_0x128681=0xce;}_0x656f08[_0x1ae4('0x16')](_0x128681);return _0x656f08['set']('Content-Range',_0x2a1335+'-'+_0x581a55+'/'+_0x1bf542)[_0x1ae4('0x18')](_0x3990c0);}return null;};}function patchUpdates(_0x15948d){return function(_0x42e45b){try{jsonpatch[_0x1ae4('0x1c')](_0x42e45b,_0x15948d,!![]);}catch(_0x43d3ad){return BPromise[_0x1ae4('0x1d')](_0x43d3ad);}return _0x42e45b[_0x1ae4('0x1e')]();};}function saveUpdates(_0x56a966,_0x104503){return function(_0x3aeca6){if(_0x3aeca6){return _0x3aeca6[_0x1ae4('0x1f')](_0x56a966)[_0x1ae4('0x20')](function(_0x5cfcb8){return _0x5cfcb8;});}return null;};}function removeEntity(_0x17e6de,_0x2fc731){return function(_0x119a54){if(_0x119a54){return _0x119a54[_0x1ae4('0x21')]()[_0x1ae4('0x20')](function(){_0x17e6de[_0x1ae4('0x16')](0xcc)[_0x1ae4('0x17')]();});}};}function handleEntityNotFound(_0x3f7eb4,_0x25b134){return function(_0x5e192b){if(!_0x5e192b){_0x3f7eb4[_0x1ae4('0x15')](0x194);}return _0x5e192b;};}function handleError(_0x2932ec,_0x30fdd3){_0x30fdd3=_0x30fdd3||0x1f4;return function(_0x39669e){logger[_0x1ae4('0x22')](_0x39669e[_0x1ae4('0x23')]);if(_0x39669e[_0x1ae4('0x24')]){delete _0x39669e['name'];}_0x2932ec[_0x1ae4('0x16')](_0x30fdd3)[_0x1ae4('0x25')](_0x39669e);};}exports[_0x1ae4('0x26')]=function(_0x4d65a7,_0x1bac7d){var _0x3b2e9d={},_0x1e448={},_0x1d22bd={'count':0x0,'rows':[]};var _0x4c7851=_[_0x1ae4('0x27')](db[_0x1ae4('0x28')]['rawAttributes'],function(_0x1b7cac){return{'name':_0x1b7cac['fieldName'],'type':_0x1b7cac[_0x1ae4('0x29')]['key']};});_0x1e448[_0x1ae4('0x2a')]=_[_0x1ae4('0x27')](_0x4c7851,_0x1ae4('0x24'));_0x1e448[_0x1ae4('0x2b')]=_[_0x1ae4('0x2c')](_0x4d65a7[_0x1ae4('0x2b')]);_0x1e448[_0x1ae4('0x2d')]=_[_0x1ae4('0x2e')](_0x1e448[_0x1ae4('0x2a')],_0x1e448[_0x1ae4('0x2b')]);_0x3b2e9d[_0x1ae4('0x2f')]=_[_0x1ae4('0x2e')](_0x1e448[_0x1ae4('0x2a')],qs['fields'](_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x30')]));_0x3b2e9d[_0x1ae4('0x2f')]=_0x3b2e9d[_0x1ae4('0x2f')][_0x1ae4('0x31')]?_0x3b2e9d['attributes']:_0x1e448[_0x1ae4('0x2a')];if(!_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x32')]('nolimit')){_0x3b2e9d[_0x1ae4('0x1a')]=qs[_0x1ae4('0x1a')](_0x4d65a7[_0x1ae4('0x2b')]['limit']);_0x3b2e9d[_0x1ae4('0x19')]=qs[_0x1ae4('0x19')](_0x4d65a7['query'][_0x1ae4('0x19')]);}_0x3b2e9d[_0x1ae4('0x33')]=qs[_0x1ae4('0x34')](_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x34')]);_0x3b2e9d['where']=qs[_0x1ae4('0x2d')](_[_0x1ae4('0x35')](_0x4d65a7['query'],_0x1e448['filters']),_0x4c7851);if(_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x36')]){_0x3b2e9d[_0x1ae4('0x37')]=_[_0x1ae4('0x38')](_0x3b2e9d[_0x1ae4('0x37')],{'$or':_['map'](_0x4c7851,function(_0x2237f2){if(_0x2237f2[_0x1ae4('0x29')]!==_0x1ae4('0x39')){var _0x539623={};_0x539623[_0x2237f2[_0x1ae4('0x24')]]={'$like':'%'+_0x4d65a7['query']['filter']+'%'};return _0x539623;}})});}_0x3b2e9d=_[_0x1ae4('0x38')]({},_0x3b2e9d,_0x4d65a7[_0x1ae4('0x3a')]);var _0x573ce1={'where':_0x3b2e9d[_0x1ae4('0x37')]};return db[_0x1ae4('0x28')]['count'](_0x573ce1)[_0x1ae4('0x20')](function(_0x448b60){_0x1d22bd['count']=_0x448b60;if(_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x3b')]){_0x3b2e9d[_0x1ae4('0x3c')]=[{'all':!![]}];}return db[_0x1ae4('0x28')][_0x1ae4('0x3d')](_0x3b2e9d);})[_0x1ae4('0x20')](function(_0x42d614){_0x1d22bd[_0x1ae4('0x3e')]=_0x42d614;return _0x1d22bd;})[_0x1ae4('0x20')](respondWithFilteredResult(_0x1bac7d,_0x3b2e9d))['catch'](handleError(_0x1bac7d,null));};exports[_0x1ae4('0x3f')]=function(_0x13dffa,_0x283f31){var _0x3ccfc0={'raw':!![],'where':{'id':_0x13dffa[_0x1ae4('0x40')]['id']}},_0x3e9b27={};_0x3e9b27[_0x1ae4('0x2a')]=_[_0x1ae4('0x2c')](db[_0x1ae4('0x28')][_0x1ae4('0x41')]);_0x3e9b27['query']=_[_0x1ae4('0x2c')](_0x13dffa[_0x1ae4('0x2b')]);_0x3e9b27[_0x1ae4('0x2d')]=_[_0x1ae4('0x2e')](_0x3e9b27['model'],_0x3e9b27[_0x1ae4('0x2b')]);_0x3ccfc0[_0x1ae4('0x2f')]=_[_0x1ae4('0x2e')](_0x3e9b27['model'],qs['fields'](_0x13dffa['query']['fields']));_0x3ccfc0['attributes']=_0x3ccfc0[_0x1ae4('0x2f')][_0x1ae4('0x31')]?_0x3ccfc0['attributes']:_0x3e9b27[_0x1ae4('0x2a')];if(_0x13dffa[_0x1ae4('0x2b')]['includeAll']){_0x3ccfc0[_0x1ae4('0x3c')]=[{'all':!![]}];}_0x3ccfc0=_[_0x1ae4('0x38')]({},_0x3ccfc0,_0x13dffa[_0x1ae4('0x3a')]);return db[_0x1ae4('0x28')][_0x1ae4('0x42')](_0x3ccfc0)[_0x1ae4('0x20')](handleEntityNotFound(_0x283f31,null))[_0x1ae4('0x20')](respondWithResult(_0x283f31,null))[_0x1ae4('0x43')](handleError(_0x283f31,null));};exports[_0x1ae4('0x1f')]=function(_0x5399ae,_0x25044d){if(_0x5399ae[_0x1ae4('0x44')]['id']){delete _0x5399ae[_0x1ae4('0x44')]['id'];}return db[_0x1ae4('0x28')][_0x1ae4('0x42')]({'where':{'id':_0x5399ae['params']['id']}})[_0x1ae4('0x20')](handleEntityNotFound(_0x25044d,null))[_0x1ae4('0x20')](saveUpdates(_0x5399ae['body'],null))[_0x1ae4('0x20')](respondWithResult(_0x25044d,null))[_0x1ae4('0x43')](handleError(_0x25044d,null));};exports[_0x1ae4('0x21')]=function(_0x1fa2b6,_0x20ef25){return db['CmHopperBlack'][_0x1ae4('0x42')]({'where':{'id':_0x1fa2b6['params']['id']}})[_0x1ae4('0x20')](handleEntityNotFound(_0x20ef25,null))[_0x1ae4('0x20')](removeEntity(_0x20ef25,null))['catch'](handleError(_0x20ef25,null));};exports[_0x1ae4('0x45')]=function(_0x15a38d,_0x1e069a){return db['CmHopperBlack'][_0x1ae4('0x45')]()[_0x1ae4('0x20')](respondWithResult(_0x1e069a,null))[_0x1ae4('0x43')](handleError(_0x1e069a,null));}; \ No newline at end of file +var _0x5e17=['attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','CmHopperBlack','count','includeAll','include','findAll','rows','show','params','length','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x5e17,0x1a0));var _0x75e1=function(_0xf05698,_0x3891fe){_0xf05698=_0xf05698-0x0;var _0xbcbd58=_0x5e17[_0xf05698];return _0xbcbd58;};'use strict';var emlformat=require(_0x75e1('0x0'));var rimraf=require(_0x75e1('0x1'));var zipdir=require(_0x75e1('0x2'));var jsonpatch=require(_0x75e1('0x3'));var rp=require(_0x75e1('0x4'));var moment=require('moment');var BPromise=require(_0x75e1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x75e1('0x6'));var sox=require('sox');var csv=require(_0x75e1('0x7'));var ejs=require(_0x75e1('0x8'));var fs=require('fs');var fs_extra=require(_0x75e1('0x9'));var _=require(_0x75e1('0xa'));var squel=require(_0x75e1('0xb'));var crypto=require('crypto');var jsforce=require(_0x75e1('0xc'));var deskjs=require(_0x75e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x75e1('0xe'));var Papa=require(_0x75e1('0xf'));var Redis=require(_0x75e1('0x10'));var authService=require(_0x75e1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x75e1('0x12'));var hardwareService=require(_0x75e1('0x13'));var logger=require(_0x75e1('0x14'))(_0x75e1('0x15'));var utils=require(_0x75e1('0x16'));var config=require(_0x75e1('0x17'));var licenseUtil=require(_0x75e1('0x18'));var db=require(_0x75e1('0x19'))['db'];function respondWithStatusCode(_0x330cfb,_0x223301){_0x223301=_0x223301||0xcc;return function(_0x56de10){if(_0x56de10){return _0x330cfb['sendStatus'](_0x223301);}return _0x330cfb[_0x75e1('0x1a')](_0x223301)[_0x75e1('0x1b')]();};}function respondWithResult(_0x2235ad,_0x30d3eb){_0x30d3eb=_0x30d3eb||0xc8;return function(_0x5c9fa3){if(_0x5c9fa3){return _0x2235ad[_0x75e1('0x1a')](_0x30d3eb)['json'](_0x5c9fa3);}};}function respondWithFilteredResult(_0x7e83a4,_0x5d2e41){return function(_0x1e2ab0){if(_0x1e2ab0){var _0x4959dc=typeof _0x5d2e41[_0x75e1('0x1c')]===_0x75e1('0x1d')&&typeof _0x5d2e41[_0x75e1('0x1e')]===_0x75e1('0x1d');var _0x42c535=_0x1e2ab0['count'];var _0x3bf368=_0x4959dc?0x0:_0x5d2e41[_0x75e1('0x1c')];var _0x490ad1=_0x4959dc?_0x1e2ab0['count']:_0x5d2e41[_0x75e1('0x1c')]+_0x5d2e41[_0x75e1('0x1e')];var _0x47160b;if(_0x490ad1>=_0x42c535){_0x490ad1=_0x42c535;_0x47160b=0xc8;}else{_0x47160b=0xce;}_0x7e83a4[_0x75e1('0x1a')](_0x47160b);return _0x7e83a4[_0x75e1('0x1f')]('Content-Range',_0x3bf368+'-'+_0x490ad1+'/'+_0x42c535)[_0x75e1('0x20')](_0x1e2ab0);}return null;};}function patchUpdates(_0x468d04){return function(_0x41225c){try{jsonpatch[_0x75e1('0x21')](_0x41225c,_0x468d04,!![]);}catch(_0x3b7b14){return BPromise[_0x75e1('0x22')](_0x3b7b14);}return _0x41225c[_0x75e1('0x23')]();};}function saveUpdates(_0x1a5eb7,_0x311a54){return function(_0x4c2217){if(_0x4c2217){return _0x4c2217[_0x75e1('0x24')](_0x1a5eb7)[_0x75e1('0x25')](function(_0x2e1dd3){return _0x2e1dd3;});}return null;};}function removeEntity(_0x4edb58,_0x3c0bce){return function(_0x4fdf94){if(_0x4fdf94){return _0x4fdf94[_0x75e1('0x26')]()['then'](function(){_0x4edb58[_0x75e1('0x1a')](0xcc)[_0x75e1('0x1b')]();});}};}function handleEntityNotFound(_0x337610,_0x4d3937){return function(_0x40ae8a){if(!_0x40ae8a){_0x337610[_0x75e1('0x27')](0x194);}return _0x40ae8a;};}function handleError(_0x1c4d8f,_0x20e5ed){_0x20e5ed=_0x20e5ed||0x1f4;return function(_0x187d57){logger[_0x75e1('0x28')](_0x187d57[_0x75e1('0x29')]);if(_0x187d57['name']){delete _0x187d57[_0x75e1('0x2a')];}_0x1c4d8f[_0x75e1('0x1a')](_0x20e5ed)['send'](_0x187d57);};}exports[_0x75e1('0x2b')]=function(_0x5375d7,_0x16d836){var _0x17fc9c={},_0x18cd97={},_0x36ef69={'count':0x0,'rows':[]};var _0x2b5f99=_['map'](db['CmHopperBlack'][_0x75e1('0x2c')],function(_0x3a980d){return{'name':_0x3a980d[_0x75e1('0x2d')],'type':_0x3a980d['type']['key']};});_0x18cd97[_0x75e1('0x2e')]=_[_0x75e1('0x2f')](_0x2b5f99,_0x75e1('0x2a'));_0x18cd97['query']=_[_0x75e1('0x30')](_0x5375d7[_0x75e1('0x31')]);_0x18cd97[_0x75e1('0x32')]=_[_0x75e1('0x33')](_0x18cd97[_0x75e1('0x2e')],_0x18cd97[_0x75e1('0x31')]);_0x17fc9c[_0x75e1('0x34')]=_[_0x75e1('0x33')](_0x18cd97['model'],qs[_0x75e1('0x35')](_0x5375d7['query']['fields']));_0x17fc9c[_0x75e1('0x34')]=_0x17fc9c['attributes']['length']?_0x17fc9c['attributes']:_0x18cd97['model'];if(!_0x5375d7[_0x75e1('0x31')][_0x75e1('0x36')](_0x75e1('0x37'))){_0x17fc9c[_0x75e1('0x1e')]=qs['limit'](_0x5375d7[_0x75e1('0x31')][_0x75e1('0x1e')]);_0x17fc9c['offset']=qs['offset'](_0x5375d7['query'][_0x75e1('0x1c')]);}_0x17fc9c[_0x75e1('0x38')]=qs[_0x75e1('0x39')](_0x5375d7[_0x75e1('0x31')][_0x75e1('0x39')]);_0x17fc9c['where']=qs[_0x75e1('0x32')](_[_0x75e1('0x3a')](_0x5375d7[_0x75e1('0x31')],_0x18cd97['filters']),_0x2b5f99);if(_0x5375d7[_0x75e1('0x31')][_0x75e1('0x3b')]){_0x17fc9c[_0x75e1('0x3c')]=_[_0x75e1('0x3d')](_0x17fc9c[_0x75e1('0x3c')],{'$or':_['map'](_0x2b5f99,function(_0x32b705){if(_0x32b705[_0x75e1('0x3e')]!==_0x75e1('0x3f')){var _0x27b92d={};_0x27b92d[_0x32b705[_0x75e1('0x2a')]]={'$like':'%'+_0x5375d7[_0x75e1('0x31')][_0x75e1('0x3b')]+'%'};return _0x27b92d;}})});}_0x17fc9c=_['merge']({},_0x17fc9c,_0x5375d7[_0x75e1('0x40')]);var _0x2f6d93={'where':_0x17fc9c[_0x75e1('0x3c')]};return db[_0x75e1('0x41')][_0x75e1('0x42')](_0x2f6d93)['then'](function(_0x21c79b){_0x36ef69[_0x75e1('0x42')]=_0x21c79b;if(_0x5375d7['query'][_0x75e1('0x43')]){_0x17fc9c[_0x75e1('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x75e1('0x45')](_0x17fc9c);})[_0x75e1('0x25')](function(_0x2bde33){_0x36ef69[_0x75e1('0x46')]=_0x2bde33;return _0x36ef69;})[_0x75e1('0x25')](respondWithFilteredResult(_0x16d836,_0x17fc9c))['catch'](handleError(_0x16d836,null));};exports[_0x75e1('0x47')]=function(_0x5afe9e,_0x1771c8){var _0x39cf2f={'raw':!![],'where':{'id':_0x5afe9e[_0x75e1('0x48')]['id']}},_0xd5c4c7={};_0xd5c4c7[_0x75e1('0x2e')]=_[_0x75e1('0x30')](db['CmHopperBlack'][_0x75e1('0x2c')]);_0xd5c4c7[_0x75e1('0x31')]=_['keys'](_0x5afe9e[_0x75e1('0x31')]);_0xd5c4c7[_0x75e1('0x32')]=_[_0x75e1('0x33')](_0xd5c4c7[_0x75e1('0x2e')],_0xd5c4c7[_0x75e1('0x31')]);_0x39cf2f[_0x75e1('0x34')]=_[_0x75e1('0x33')](_0xd5c4c7[_0x75e1('0x2e')],qs[_0x75e1('0x35')](_0x5afe9e[_0x75e1('0x31')][_0x75e1('0x35')]));_0x39cf2f[_0x75e1('0x34')]=_0x39cf2f[_0x75e1('0x34')][_0x75e1('0x49')]?_0x39cf2f['attributes']:_0xd5c4c7[_0x75e1('0x2e')];if(_0x5afe9e[_0x75e1('0x31')][_0x75e1('0x43')]){_0x39cf2f['include']=[{'all':!![]}];}_0x39cf2f=_['merge']({},_0x39cf2f,_0x5afe9e[_0x75e1('0x40')]);return db[_0x75e1('0x41')][_0x75e1('0x4a')](_0x39cf2f)[_0x75e1('0x25')](handleEntityNotFound(_0x1771c8,null))['then'](respondWithResult(_0x1771c8,null))[_0x75e1('0x4b')](handleError(_0x1771c8,null));};exports[_0x75e1('0x24')]=function(_0x40d672,_0x576712){if(_0x40d672[_0x75e1('0x4c')]['id']){delete _0x40d672['body']['id'];}return db[_0x75e1('0x41')][_0x75e1('0x4a')]({'where':{'id':_0x40d672[_0x75e1('0x48')]['id']}})[_0x75e1('0x25')](handleEntityNotFound(_0x576712,null))[_0x75e1('0x25')](saveUpdates(_0x40d672[_0x75e1('0x4c')],null))[_0x75e1('0x25')](respondWithResult(_0x576712,null))[_0x75e1('0x4b')](handleError(_0x576712,null));};exports['destroy']=function(_0xb103f5,_0x5973ed){return db[_0x75e1('0x41')][_0x75e1('0x4a')]({'where':{'id':_0xb103f5[_0x75e1('0x48')]['id']}})[_0x75e1('0x25')](handleEntityNotFound(_0x5973ed,null))[_0x75e1('0x25')](removeEntity(_0x5973ed,null))['catch'](handleError(_0x5973ed,null));};exports[_0x75e1('0x4d')]=function(_0x47510e,_0x40685b){return db['CmHopperBlack'][_0x75e1('0x4d')]()[_0x75e1('0x25')](respondWithResult(_0x40685b,null))[_0x75e1('0x4b')](handleError(_0x40685b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7832506..e7cbe8d 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 _0x1545=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment'];(function(_0x2298c1,_0x5af6f0){var _0x19c636=function(_0x122dcf){while(--_0x122dcf){_0x2298c1['push'](_0x2298c1['shift']());}};_0x19c636(++_0x5af6f0);}(_0x1545,0x7a));var _0x5154=function(_0x2dbb49,_0x4955d6){_0x2dbb49=_0x2dbb49-0x0;var _0x59083b=_0x1545[_0x2dbb49];return _0x59083b;};'use strict';var _=require(_0x5154('0x0'));var util=require(_0x5154('0x1'));var logger=require(_0x5154('0x2'))('api');var moment=require(_0x5154('0x3'));var BPromise=require(_0x5154('0x4'));var rp=require(_0x5154('0x5'));var fs=require('fs');var path=require(_0x5154('0x6'));var rimraf=require(_0x5154('0x7'));var config=require(_0x5154('0x8'));var attributes=require(_0x5154('0x9'));module[_0x5154('0xa')]=function(_0x341390,_0x31e9a1){return _0x341390[_0x5154('0xb')](_0x5154('0xc'),attributes,{'tableName':_0x5154('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1af3=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x1af3,0x175));var _0x31af=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x1af3[_0x52a857];return _0x4e2aae;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var moment=require('moment');var BPromise=require(_0x31af('0x4'));var rp=require(_0x31af('0x5'));var fs=require('fs');var path=require(_0x31af('0x6'));var rimraf=require(_0x31af('0x7'));var config=require(_0x31af('0x8'));var attributes=require(_0x31af('0x9'));module[_0x31af('0xa')]=function(_0x4d6945,_0x28f316){return _0x4d6945[_0x31af('0xb')](_0x31af('0xc'),attributes,{'tableName':_0x31af('0xd'),'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 23bdd1d..cf0e7e9 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 _0x8778=['request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','include','map','model','update','body','raw','limit','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x8778,0xeb));var _0x8877=function(_0x3e35ff,_0x13c4cc){_0x3e35ff=_0x3e35ff-0x0;var _0x689012=_0x8778[_0x3e35ff];return _0x689012;};'use strict';var _=require(_0x8877('0x0'));var util=require(_0x8877('0x1'));var moment=require(_0x8877('0x2'));var BPromise=require(_0x8877('0x3'));var rs=require(_0x8877('0x4'));var fs=require('fs');var Redis=require(_0x8877('0x5'));var db=require(_0x8877('0x6'))['db'];var utils=require(_0x8877('0x7'));var logger=require(_0x8877('0x8'))('rpc');var config=require(_0x8877('0x9'));var jayson=require(_0x8877('0xa'));var client=jayson[_0x8877('0xb')][_0x8877('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x397668,_0x12ce6c,_0x30d0c9){return new BPromise(function(_0x1ff9ca,_0x2d023c){return client[_0x8877('0xd')](_0x397668,_0x30d0c9)[_0x8877('0xe')](function(_0x4ce43e){logger[_0x8877('0xf')](_0x8877('0x10'),_0x12ce6c,_0x8877('0x11'));logger[_0x8877('0x12')](_0x8877('0x13'),_0x12ce6c,_0x8877('0x11'),JSON['stringify'](_0x4ce43e));if(_0x4ce43e['error']){if(_0x4ce43e['error'][_0x8877('0x14')]===0x1f4){logger[_0x8877('0x15')](_0x8877('0x10'),_0x12ce6c,_0x4ce43e[_0x8877('0x15')]['message']);return _0x2d023c(_0x4ce43e['error']['message']);}logger[_0x8877('0x15')](_0x8877('0x10'),_0x12ce6c,_0x4ce43e[_0x8877('0x15')][_0x8877('0x16')]);return _0x1ff9ca(_0x4ce43e[_0x8877('0x15')][_0x8877('0x16')]);}else{logger['info'](_0x8877('0x10'),_0x12ce6c,'request\x20sent');_0x1ff9ca(_0x4ce43e[_0x8877('0x17')][_0x8877('0x16')]);}})[_0x8877('0x18')](function(_0x57d9ce){logger[_0x8877('0x15')](_0x8877('0x10'),_0x12ce6c,_0x57d9ce);_0x2d023c(_0x57d9ce);});});}exports[_0x8877('0x19')]=function(_0x5e9a5f){var _0x3d87b2=this;return new Promise(function(_0x383430,_0x20570e){return db[_0x8877('0x1a')][_0x8877('0x1b')]({'raw':_0x5e9a5f[_0x8877('0x1c')]?_0x5e9a5f['options']['raw']===undefined?!![]:![]:!![],'where':_0x5e9a5f[_0x8877('0x1c')]?_0x5e9a5f[_0x8877('0x1c')][_0x8877('0x1d')]||null:null,'attributes':_0x5e9a5f[_0x8877('0x1c')]?_0x5e9a5f[_0x8877('0x1c')][_0x8877('0x1e')]||null:null,'limit':_0x5e9a5f[_0x8877('0x1c')]?_0x5e9a5f['options']['limit']||null:null,'include':_0x5e9a5f['options']?_0x5e9a5f['options'][_0x8877('0x1f')]?_[_0x8877('0x20')](_0x5e9a5f[_0x8877('0x1c')][_0x8877('0x1f')],function(_0x5d2ea3){return{'model':db[_0x5d2ea3[_0x8877('0x21')]],'as':_0x5d2ea3['as'],'attributes':_0x5d2ea3[_0x8877('0x1e')],'include':_0x5d2ea3['include']?_['map'](_0x5d2ea3[_0x8877('0x1f')],function(_0x46cef0){return{'model':db[_0x46cef0[_0x8877('0x21')]],'as':_0x46cef0['as'],'attributes':_0x46cef0[_0x8877('0x1e')],'include':_0x46cef0['include']?_['map'](_0x46cef0[_0x8877('0x1f')],function(_0x417bf2){return{'model':db[_0x417bf2[_0x8877('0x21')]],'as':_0x417bf2['as'],'attributes':_0x417bf2['attributes']};}):[]};}):[]};}):[]:[]})[_0x8877('0xe')](function(_0x31c42e){logger[_0x8877('0xf')](_0x8877('0x19'),_0x5e9a5f);logger[_0x8877('0x12')](_0x8877('0x19'),_0x5e9a5f,JSON['stringify'](_0x31c42e));_0x383430(_0x31c42e);})[_0x8877('0x18')](function(_0x1eaada){logger[_0x8877('0x15')](_0x8877('0x19'),_0x1eaada[_0x8877('0x16')],_0x5e9a5f);_0x20570e(_0x3d87b2[_0x8877('0x15')](0x1f4,_0x1eaada[_0x8877('0x16')]));});});};exports['UpdateCmHopperBlack']=function(_0x96663e){var _0x1b81a9=this;return new Promise(function(_0x37d16e,_0x53dc51){return db[_0x8877('0x1a')][_0x8877('0x22')](_0x96663e[_0x8877('0x23')],{'raw':_0x96663e['options']?_0x96663e[_0x8877('0x1c')][_0x8877('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96663e[_0x8877('0x1c')]?_0x96663e[_0x8877('0x1c')]['where']||null:null,'attributes':_0x96663e[_0x8877('0x1c')]?_0x96663e[_0x8877('0x1c')]['attributes']||null:null,'limit':_0x96663e['options']?_0x96663e[_0x8877('0x1c')][_0x8877('0x25')]||null:null})['then'](function(_0x16b22a){logger[_0x8877('0xf')](_0x8877('0x26'),_0x96663e);logger[_0x8877('0x12')]('UpdateCmHopperBlack',_0x96663e,JSON[_0x8877('0x27')](_0x16b22a));_0x37d16e(_0x16b22a);})[_0x8877('0x18')](function(_0x51c3eb){logger['error']('UpdateCmHopperBlack',_0x51c3eb[_0x8877('0x16')],_0x96663e);_0x53dc51(_0x1b81a9['error'](0x1f4,_0x51c3eb[_0x8877('0x16')]));});});};exports[_0x8877('0x28')]=function(_0x1291f4){var _0x469761=this;return new Promise(function(_0x1c7b5d,_0x3ce012){return db[_0x8877('0x1a')][_0x8877('0x29')]({'where':_0x1291f4[_0x8877('0x1c')]?_0x1291f4['options']['where']||null:null})[_0x8877('0xe')](function(_0x498f62){logger[_0x8877('0xf')](_0x8877('0x28'),_0x1291f4);logger[_0x8877('0x12')](_0x8877('0x28'),_0x1291f4,JSON[_0x8877('0x27')](_0x498f62));_0x1c7b5d(_0x498f62);})['catch'](function(_0xbfd0e2){logger[_0x8877('0x15')](_0x8877('0x28'),_0xbfd0e2[_0x8877('0x16')],_0x1291f4);_0x3ce012(_0x469761['error'](0x1f4,_0xbfd0e2[_0x8877('0x16')]));});});}; \ No newline at end of file +var _0x68a3=['map','model','catch','UpdateCmHopperBlack','CmHopperBlack','body','raw','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCmHopperBlack','findAll','options','where','attributes','limit','include'];(function(_0x5b1389,_0x3f0664){var _0x559a88=function(_0x12ad09){while(--_0x12ad09){_0x5b1389['push'](_0x5b1389['shift']());}};_0x559a88(++_0x3f0664);}(_0x68a3,0x156));var _0x368a=function(_0x369929,_0xc6f4b4){_0x369929=_0x369929-0x0;var _0x28a389=_0x68a3[_0x369929];return _0x28a389;};'use strict';var _=require('lodash');var util=require(_0x368a('0x0'));var moment=require(_0x368a('0x1'));var BPromise=require(_0x368a('0x2'));var rs=require(_0x368a('0x3'));var fs=require('fs');var Redis=require(_0x368a('0x4'));var db=require(_0x368a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x368a('0x6'));var config=require(_0x368a('0x7'));var jayson=require(_0x368a('0x8'));var client=jayson[_0x368a('0x9')][_0x368a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29f3aa,_0x2cc1e7,_0x4ef437){return new BPromise(function(_0x281e3e,_0x97ea54){return client[_0x368a('0xb')](_0x29f3aa,_0x4ef437)[_0x368a('0xc')](function(_0xdd2240){logger[_0x368a('0xd')](_0x368a('0xe'),_0x2cc1e7,_0x368a('0xf'));logger[_0x368a('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2cc1e7,_0x368a('0xf'),JSON[_0x368a('0x11')](_0xdd2240));if(_0xdd2240[_0x368a('0x12')]){if(_0xdd2240[_0x368a('0x12')][_0x368a('0x13')]===0x1f4){logger[_0x368a('0x12')](_0x368a('0xe'),_0x2cc1e7,_0xdd2240[_0x368a('0x12')][_0x368a('0x14')]);return _0x97ea54(_0xdd2240['error'][_0x368a('0x14')]);}logger[_0x368a('0x12')](_0x368a('0xe'),_0x2cc1e7,_0xdd2240[_0x368a('0x12')]['message']);return _0x281e3e(_0xdd2240[_0x368a('0x12')][_0x368a('0x14')]);}else{logger[_0x368a('0xd')](_0x368a('0xe'),_0x2cc1e7,'request\x20sent');_0x281e3e(_0xdd2240['result'][_0x368a('0x14')]);}})['catch'](function(_0x2c097b){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x2cc1e7,_0x2c097b);_0x97ea54(_0x2c097b);});});}exports[_0x368a('0x15')]=function(_0x1f8547){var _0x24a89c=this;return new Promise(function(_0x1fd550,_0x30da99){return db['CmHopperBlack'][_0x368a('0x16')]({'raw':_0x1f8547['options']?_0x1f8547[_0x368a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f8547[_0x368a('0x17')]?_0x1f8547[_0x368a('0x17')][_0x368a('0x18')]||null:null,'attributes':_0x1f8547['options']?_0x1f8547[_0x368a('0x17')][_0x368a('0x19')]||null:null,'limit':_0x1f8547[_0x368a('0x17')]?_0x1f8547[_0x368a('0x17')][_0x368a('0x1a')]||null:null,'include':_0x1f8547[_0x368a('0x17')]?_0x1f8547['options'][_0x368a('0x1b')]?_[_0x368a('0x1c')](_0x1f8547[_0x368a('0x17')][_0x368a('0x1b')],function(_0x254044){return{'model':db[_0x254044[_0x368a('0x1d')]],'as':_0x254044['as'],'attributes':_0x254044[_0x368a('0x19')],'include':_0x254044[_0x368a('0x1b')]?_[_0x368a('0x1c')](_0x254044['include'],function(_0x1d3c07){return{'model':db[_0x1d3c07['model']],'as':_0x1d3c07['as'],'attributes':_0x1d3c07[_0x368a('0x19')],'include':_0x1d3c07[_0x368a('0x1b')]?_['map'](_0x1d3c07['include'],function(_0x161d26){return{'model':db[_0x161d26['model']],'as':_0x161d26['as'],'attributes':_0x161d26[_0x368a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x368a('0xc')](function(_0x37c307){logger[_0x368a('0xd')](_0x368a('0x15'),_0x1f8547);logger['debug']('GetCmHopperBlack',_0x1f8547,JSON[_0x368a('0x11')](_0x37c307));_0x1fd550(_0x37c307);})[_0x368a('0x1e')](function(_0x291693){logger['error'](_0x368a('0x15'),_0x291693[_0x368a('0x14')],_0x1f8547);_0x30da99(_0x24a89c[_0x368a('0x12')](0x1f4,_0x291693[_0x368a('0x14')]));});});};exports[_0x368a('0x1f')]=function(_0x4ac609){var _0x3b6347=this;return new Promise(function(_0x12e186,_0x38ed25){return db[_0x368a('0x20')]['update'](_0x4ac609[_0x368a('0x21')],{'raw':_0x4ac609['options']?_0x4ac609[_0x368a('0x17')][_0x368a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac609[_0x368a('0x17')]?_0x4ac609['options'][_0x368a('0x18')]||null:null,'attributes':_0x4ac609['options']?_0x4ac609[_0x368a('0x17')]['attributes']||null:null,'limit':_0x4ac609[_0x368a('0x17')]?_0x4ac609[_0x368a('0x17')][_0x368a('0x1a')]||null:null})[_0x368a('0xc')](function(_0x2de222){logger['info'](_0x368a('0x1f'),_0x4ac609);logger[_0x368a('0x10')]('UpdateCmHopperBlack',_0x4ac609,JSON['stringify'](_0x2de222));_0x12e186(_0x2de222);})[_0x368a('0x1e')](function(_0x378b09){logger[_0x368a('0x12')](_0x368a('0x1f'),_0x378b09[_0x368a('0x14')],_0x4ac609);_0x38ed25(_0x3b6347[_0x368a('0x12')](0x1f4,_0x378b09[_0x368a('0x14')]));});});};exports[_0x368a('0x23')]=function(_0x5ea97b){var _0x561cb6=this;return new Promise(function(_0x489473,_0x46af49){return db['CmHopperBlack'][_0x368a('0x24')]({'where':_0x5ea97b[_0x368a('0x17')]?_0x5ea97b[_0x368a('0x17')]['where']||null:null})['then'](function(_0x350c92){logger[_0x368a('0xd')](_0x368a('0x23'),_0x5ea97b);logger[_0x368a('0x10')](_0x368a('0x23'),_0x5ea97b,JSON[_0x368a('0x11')](_0x350c92));_0x489473(_0x350c92);})[_0x368a('0x1e')](function(_0x2dfaf4){logger['error'](_0x368a('0x23'),_0x2dfaf4[_0x368a('0x14')],_0x5ea97b);_0x46af49(_0x561cb6[_0x368a('0x12')](0x1f4,_0x2dfaf4[_0x368a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1c768b2..3a15d57 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 _0x326f=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x326f,0xd1));var _0xf326=function(_0x207c0e,_0x198f7f){_0x207c0e=_0x207c0e-0x0;var _0x314c0d=_0x326f[_0x207c0e];return _0x314c0d;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')](_0xf326('0xf'),auth[_0xf326('0xa')](),controller[_0xf326('0x10')]);router['delete'](_0xf326('0xf'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);module['exports']=router; \ No newline at end of file +var _0xeff8=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','update','exports','multer'];(function(_0x45bed9,_0x4c171d){var _0x14a7c1=function(_0x10d50b){while(--_0x10d50b){_0x45bed9['push'](_0x45bed9['shift']());}};_0x14a7c1(++_0x4c171d);}(_0xeff8,0x186));var _0x8eff=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xeff8[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get']('/',auth[_0x8eff('0x9')](),controller[_0x8eff('0xa')]);router[_0x8eff('0xb')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xb')](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['show']);router['put'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller[_0x8eff('0xf')]);router['delete'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['destroy']);module[_0x8eff('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7fb7ef7..7cfa79d 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 _0x2482=['BOOLEAN','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2482,0x194));var _0x2248=function(_0x2f66fe,_0x46be8b){_0x2f66fe=_0x2f66fe-0x0;var _0x1a1d22=_0x2482[_0x2f66fe];return _0x1a1d22;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2248('0x0'));module[_0x2248('0x1')]={'state':{'type':Sequelize[_0x2248('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2248('0x3')]},'countbusyretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2248('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2248('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2248('0x4')]},'calleridnum':{'type':Sequelize[_0x2248('0x4')]},'calleridname':{'type':Sequelize[_0x2248('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2248('0x3')]},'answertime':{'type':Sequelize[_0x2248('0x3')]},'droptime':{'type':Sequelize[_0x2248('0x3')]},'endtime':{'type':Sequelize[_0x2248('0x3')]},'ringtime':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2248('0x4')]},'campaign':{'type':Sequelize[_0x2248('0x4')]},'campaigntype':{'type':Sequelize[_0x2248('0x4')]},'membername':{'type':Sequelize[_0x2248('0x4')]},'reason':{'type':Sequelize[_0x2248('0x4')]},'disposition':{'type':Sequelize[_0x2248('0x4')]},'secondDisposition':{'type':Sequelize[_0x2248('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x2248('0x3')],'set':function(_0x330978){var _0x3ef6fc=this[_0x2248('0x5')](_0x2248('0x6'));if(_0x3ef6fc&&_0x330978){this[_0x2248('0x7')](_0x2248('0x8'),moment(_0x330978)[_0x2248('0x9')](moment(_0x3ef6fc),_0x2248('0xa')));}return this[_0x2248('0x7')](_0x2248('0xb'),_0x330978);}},'amd':{'type':Sequelize[_0x2248('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2248('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2248('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2248('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2248('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2248('0x3')]},'deleted':{'type':Sequelize[_0x2248('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2248('0x3')]},'recallme':{'type':Sequelize[_0x2248('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2248('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2248('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1545=['followuptime','diff','dispositionat','BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x1545,0xc1));var _0x5154=function(_0x22bff1,_0x1d964a){_0x22bff1=_0x22bff1-0x0;var _0x279396=_0x1545[_0x22bff1];return _0x279396;};'use strict';var Sequelize=require(_0x5154('0x0'));var moment=require('moment');module[_0x5154('0x1')]={'state':{'type':Sequelize[_0x5154('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5154('0x3')]},'countbusyretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5154('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x5154('0x4')]},'originatecalleridname':{'type':Sequelize[_0x5154('0x4')]},'calleridnum':{'type':Sequelize[_0x5154('0x4')]},'calleridname':{'type':Sequelize[_0x5154('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5154('0x3')]},'droptime':{'type':Sequelize[_0x5154('0x3')]},'endtime':{'type':Sequelize[_0x5154('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5154('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5154('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5154('0x4')]},'secondDisposition':{'type':Sequelize[_0x5154('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x5154('0x3')],'set':function(_0x2fce60){var _0x24ef15=this['getDataValue']('endtime');if(_0x24ef15&&_0x2fce60){this['setDataValue'](_0x5154('0x5'),moment(_0x2fce60)[_0x5154('0x6')](moment(_0x24ef15),'seconds'));}return this['setDataValue'](_0x5154('0x7'),_0x2fce60);}},'amd':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5154('0x3')]},'callback':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5154('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x5154('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5154('0x3')]},'recallme':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5154('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5154('0x2')],'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 86f3af4..7c9237b 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 _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x1abdba,_0x442f96){var _0xb618d4=function(_0x2a2ffa){while(--_0x2a2ffa){_0x1abdba['push'](_0x1abdba['shift']());}};_0xb618d4(++_0x442f96);}(_0x90b1,0x1bb));var _0x190b=function(_0x220131,_0x48de07){_0x220131=_0x220131-0x0;var _0x1744dd=_0x90b1[_0x220131];return _0x1744dd;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));}; \ No newline at end of file +var _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x326f,0xd1));var _0xf326=function(_0x3d231a,_0x407dc6){_0x3d231a=_0x3d231a-0x0;var _0x2ca6e4=_0x326f[_0x3d231a];return _0x2ca6e4;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 3bf4cc1..0fb473a 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 _0x1970=['api','moment','bluebird','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x55c0d6,_0x2eb8c0){var _0x248bb0=function(_0xff8cfb){while(--_0xff8cfb){_0x55c0d6['push'](_0x55c0d6['shift']());}};_0x248bb0(++_0x2eb8c0);}(_0x1970,0x9a));var _0x0197=function(_0x3e916a,_0x12a5db){_0x3e916a=_0x3e916a-0x0;var _0x22dcad=_0x1970[_0x3e916a];return _0x22dcad;};'use strict';var _=require(_0x0197('0x0'));var util=require(_0x0197('0x1'));var logger=require('../../config/logger')(_0x0197('0x2'));var moment=require(_0x0197('0x3'));var BPromise=require(_0x0197('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0197('0x5'));var rimraf=require(_0x0197('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x0197('0x7')]=function(_0x86ec4d,_0x3948be){return _0x86ec4d[_0x0197('0x8')](_0x0197('0x9'),attributes,{'tableName':_0x0197('0xa'),'paranoid':![],'indexes':[{'name':_0x0197('0xb'),'fields':['calleridnum']},{'name':_0x0197('0xc'),'fields':[_0x0197('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdde=['uniqueid','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum'];(function(_0x4cbb8e,_0x1047c8){var _0x17846f=function(_0x29e1e0){while(--_0x29e1e0){_0x4cbb8e['push'](_0x4cbb8e['shift']());}};_0x17846f(++_0x1047c8);}(_0xfdde,0x145));var _0xefdd=function(_0x166740,_0x27abae){_0x166740=_0x166740-0x0;var _0x22cd33=_0xfdde[_0x166740];return _0x22cd33;};'use strict';var _=require('lodash');var util=require(_0xefdd('0x0'));var logger=require(_0xefdd('0x1'))(_0xefdd('0x2'));var moment=require(_0xefdd('0x3'));var BPromise=require(_0xefdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xefdd('0x5'));var attributes=require(_0xefdd('0x6'));module[_0xefdd('0x7')]=function(_0x2dd13b,_0x929ba8){return _0x2dd13b[_0xefdd('0x8')]('CmHopperFinal',attributes,{'tableName':_0xefdd('0x9'),'paranoid':![],'indexes':[{'name':_0xefdd('0xa'),'fields':[_0xefdd('0xa')]},{'name':_0xefdd('0xb'),'fields':[_0xefdd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 000ba39..ca74007 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(_0x478a65,_0x4a67f6){var _0x682329=function(_0x3d9b82){while(--_0x3d9b82){_0x478a65['push'](_0x478a65['shift']());}};_0x682329(++_0x4a67f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xb10b[_0x44a64f];return _0x52024b;};'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(_0x44965c,_0x8c5f41){var _0x385c87=function(_0x4a813b){while(--_0x4a813b){_0x44965c['push'](_0x44965c['shift']());}};_0x385c87(++_0x8c5f41);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a0527,_0x2fc13f){_0x2a0527=_0x2a0527-0x0;var _0x1f4163=_0xb10b[_0x2a0527];return _0x1f4163;};'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 0bf2efa..e55ec49 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 _0x5276=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/:id'];(function(_0x3950d8,_0x5077c3){var _0x5eeeb5=function(_0x237935){while(--_0x237935){_0x3950d8['push'](_0x3950d8['shift']());}};_0x5eeeb5(++_0x5077c3);}(_0x5276,0x163));var _0x6527=function(_0xeb1068,_0x37dd25){_0xeb1068=_0xeb1068-0x0;var _0x21bcb3=_0x5276[_0xeb1068];return _0x21bcb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6527('0x0'));var timeout=require(_0x6527('0x1'));var express=require(_0x6527('0x2'));var router=express[_0x6527('0x3')]();var fs_extra=require(_0x6527('0x4'));var auth=require(_0x6527('0x5'));var interaction=require(_0x6527('0x6'));var config=require(_0x6527('0x7'));var controller=require(_0x6527('0x8'));router[_0x6527('0x9')]('/',auth[_0x6527('0xa')](),controller[_0x6527('0xb')]);router[_0x6527('0x9')]('/describe',auth[_0x6527('0xa')](),controller['describe']);router[_0x6527('0x9')](_0x6527('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/voice/queue/countAttributes/:id',auth[_0x6527('0xa')](),controller[_0x6527('0xd')]);router[_0x6527('0x9')](_0x6527('0xe'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x6527('0xf')](_0x6527('0x10'),auth[_0x6527('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0x6527('0xa')](),controller[_0x6527('0x11')]);router['post'](_0x6527('0x12'),auth['isAuthenticated'](),controller[_0x6527('0x13')]);router[_0x6527('0x14')](_0x6527('0xc'),auth[_0x6527('0xa')](),controller[_0x6527('0x15')]);module[_0x6527('0x16')]=router; \ No newline at end of file +var _0x8ebd=['describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','checkContactHopper','put','update','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0x8ebd,0x16d));var _0xd8eb=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x8ebd[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xd8eb('0x0'));var util=require(_0xd8eb('0x1'));var path=require(_0xd8eb('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8eb('0x3'));var router=express['Router']();var fs_extra=require(_0xd8eb('0x4'));var auth=require(_0xd8eb('0x5'));var interaction=require(_0xd8eb('0x6'));var config=require(_0xd8eb('0x7'));var controller=require(_0xd8eb('0x8'));router[_0xd8eb('0x9')]('/',auth[_0xd8eb('0xa')](),controller[_0xd8eb('0xb')]);router[_0xd8eb('0x9')](_0xd8eb('0xc'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0xd')]);router[_0xd8eb('0x9')](_0xd8eb('0xe'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0xf')]);router[_0xd8eb('0x9')](_0xd8eb('0x10'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0x11')]);router[_0xd8eb('0x9')](_0xd8eb('0x12'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0x13')]);router['post'](_0xd8eb('0x14'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0x15')]);router[_0xd8eb('0x16')](_0xd8eb('0x17'),auth[_0xd8eb('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xd8eb('0x16')]('/checkContactHopper',auth[_0xd8eb('0xa')](),controller[_0xd8eb('0x18')]);router[_0xd8eb('0x19')](_0xd8eb('0xe'),auth[_0xd8eb('0xa')](),controller[_0xd8eb('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 12cad4f..12a85df 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 _0xb85d=['sequelize','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x2cc6bf,_0x4849a3){var _0x320f3c=function(_0x4fbe91){while(--_0x4fbe91){_0x2cc6bf['push'](_0x2cc6bf['shift']());}};_0x320f3c(++_0x4849a3);}(_0xb85d,0x104));var _0xdb85=function(_0x1b5cb4,_0x394086){_0x1b5cb4=_0x1b5cb4-0x0;var _0x50206c=_0xb85d[_0x1b5cb4];return _0x50206c;};'use strict';var Sequelize=require(_0xdb85('0x0'));module['exports']={'state':{'type':Sequelize[_0xdb85('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xdb85('0x2')]},'countbusyretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdb85('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xdb85('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdb85('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdb85('0x2')]},'responsetime':{'type':Sequelize[_0xdb85('0x2')]},'answertime':{'type':Sequelize[_0xdb85('0x2')]},'droptime':{'type':Sequelize[_0xdb85('0x2')]},'endtime':{'type':Sequelize[_0xdb85('0x2')]},'ringtime':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdb85('0x3')]},'campaign':{'type':Sequelize[_0xdb85('0x3')]},'campaigntype':{'type':Sequelize[_0xdb85('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xdb85('0x3')]},'amd':{'type':Sequelize[_0xdb85('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdb85('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdb85('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xdb85('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdb85('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdb85('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a9c=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0xa7d678,_0x3dfdff){var _0x5cc539=function(_0x4393d7){while(--_0x4393d7){_0xa7d678['push'](_0xa7d678['shift']());}};_0x5cc539(++_0x3dfdff);}(_0x8a9c,0x1de));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xc8a9('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xc8a9('0x1')]},'scheduledat':{'type':Sequelize[_0xc8a9('0x2')]},'countbusyretry':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc8a9('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc8a9('0x2')]},'responsetime':{'type':Sequelize[_0xc8a9('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xc8a9('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc8a9('0x1')]},'campaign':{'type':Sequelize[_0xc8a9('0x1')]},'campaigntype':{'type':Sequelize[_0xc8a9('0x1')]},'membername':{'type':Sequelize[_0xc8a9('0x1')]},'reason':{'type':Sequelize[_0xc8a9('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc8a9('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc8a9('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc8a9('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc8a9('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc8a9('0x2')]},'edited':{'type':Sequelize[_0xc8a9('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc8a9('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 d0b3452..57bb880 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 _0x9f93=['fast-json-patch','request-promise','moment','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','uniqueid','rimraf','zip-dir'];(function(_0x29fc70,_0xf5383a){var _0x5cd54c=function(_0x486ab0){while(--_0x486ab0){_0x29fc70['push'](_0x29fc70['shift']());}};_0x5cd54c(++_0xf5383a);}(_0x9f93,0x1e8));var _0x39f9=function(_0x2e1cb1,_0x5da205){_0x2e1cb1=_0x2e1cb1-0x0;var _0xfab182=_0x9f93[_0x2e1cb1];return _0xfab182;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39f9('0x0'));var zipdir=require(_0x39f9('0x1'));var jsonpatch=require(_0x39f9('0x2'));var rp=require(_0x39f9('0x3'));var moment=require(_0x39f9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x39f9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x39f9('0x6'));var crypto=require('crypto');var jsforce=require(_0x39f9('0x7'));var deskjs=require(_0x39f9('0x8'));var toCsv=require(_0x39f9('0x5'));var querystring=require('querystring');var Papa=require(_0x39f9('0x9'));var Redis=require(_0x39f9('0xa'));var authService=require(_0x39f9('0xb'));var qs=require(_0x39f9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39f9('0xd'));var logger=require(_0x39f9('0xe'))(_0x39f9('0xf'));var utils=require('../../config/utils');var config=require(_0x39f9('0x10'));var licenseUtil=require(_0x39f9('0x11'));var db=require(_0x39f9('0x12'))['db'];function respondWithStatusCode(_0x542bfd,_0x30c8c8){_0x30c8c8=_0x30c8c8||0xcc;return function(_0x3ed298){if(_0x3ed298){return _0x542bfd[_0x39f9('0x13')](_0x30c8c8);}return _0x542bfd['status'](_0x30c8c8)[_0x39f9('0x14')]();};}function respondWithResult(_0x56fc9f,_0x50a746){_0x50a746=_0x50a746||0xc8;return function(_0x2d86c6){if(_0x2d86c6){return _0x56fc9f['status'](_0x50a746)[_0x39f9('0x15')](_0x2d86c6);}};}function respondWithFilteredResult(_0x441feb,_0x1e0af3){return function(_0x4c8a28){if(_0x4c8a28){var _0x195d7f=typeof _0x1e0af3[_0x39f9('0x16')]===_0x39f9('0x17')&&typeof _0x1e0af3[_0x39f9('0x18')]===_0x39f9('0x17');var _0x406e99=_0x4c8a28[_0x39f9('0x19')];var _0x5f1b21=_0x195d7f?0x0:_0x1e0af3[_0x39f9('0x16')];var _0xa7bb42=_0x195d7f?_0x4c8a28[_0x39f9('0x19')]:_0x1e0af3[_0x39f9('0x16')]+_0x1e0af3[_0x39f9('0x18')];var _0x7e3918;if(_0xa7bb42>=_0x406e99){_0xa7bb42=_0x406e99;_0x7e3918=0xc8;}else{_0x7e3918=0xce;}_0x441feb[_0x39f9('0x1a')](_0x7e3918);return _0x441feb['set'](_0x39f9('0x1b'),_0x5f1b21+'-'+_0xa7bb42+'/'+_0x406e99)[_0x39f9('0x15')](_0x4c8a28);}return null;};}function patchUpdates(_0x169c0f){return function(_0x1b2dec){try{jsonpatch[_0x39f9('0x1c')](_0x1b2dec,_0x169c0f,!![]);}catch(_0x459ea4){return BPromise[_0x39f9('0x1d')](_0x459ea4);}return _0x1b2dec[_0x39f9('0x1e')]();};}function saveUpdates(_0x284e9b,_0x341c23){return function(_0x38a575){if(_0x38a575){return _0x38a575[_0x39f9('0x1f')](_0x284e9b)[_0x39f9('0x20')](function(_0xe581c8){return _0xe581c8;});}return null;};}function removeEntity(_0x1b2fd4,_0x91f00e){return function(_0x5813eb){if(_0x5813eb){return _0x5813eb[_0x39f9('0x21')]()[_0x39f9('0x20')](function(){_0x1b2fd4[_0x39f9('0x1a')](0xcc)[_0x39f9('0x14')]();});}};}function handleEntityNotFound(_0x4606a2,_0x18fa5c){return function(_0x233c0c){if(!_0x233c0c){_0x4606a2[_0x39f9('0x13')](0x194);}return _0x233c0c;};}function handleError(_0x46219f,_0x1fb5c5){_0x1fb5c5=_0x1fb5c5||0x1f4;return function(_0x2db5f9){logger[_0x39f9('0x22')](_0x2db5f9[_0x39f9('0x23')]);if(_0x2db5f9['name']){delete _0x2db5f9['name'];}_0x46219f['status'](_0x1fb5c5)['send'](_0x2db5f9);};}exports[_0x39f9('0x24')]=function(_0x269e9c,_0x9de683){var _0x331af6={},_0x2465bc={},_0x3de83b={'count':0x0,'rows':[]};var _0x510f88=_[_0x39f9('0x25')](db[_0x39f9('0x26')][_0x39f9('0x27')],function(_0xd9b530){return{'name':_0xd9b530[_0x39f9('0x28')],'type':_0xd9b530[_0x39f9('0x29')][_0x39f9('0x2a')]};});_0x2465bc[_0x39f9('0x2b')]=_['map'](_0x510f88,_0x39f9('0x2c'));_0x2465bc[_0x39f9('0x2d')]=_[_0x39f9('0x2e')](_0x269e9c['query']);_0x2465bc[_0x39f9('0x2f')]=_[_0x39f9('0x30')](_0x2465bc['model'],_0x2465bc[_0x39f9('0x2d')]);_0x331af6['attributes']=_[_0x39f9('0x30')](_0x2465bc['model'],qs[_0x39f9('0x31')](_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x31')]));_0x331af6[_0x39f9('0x32')]=_0x331af6['attributes'][_0x39f9('0x33')]?_0x331af6['attributes']:_0x2465bc['model'];if(!_0x269e9c['query'][_0x39f9('0x34')]('nolimit')){_0x331af6[_0x39f9('0x18')]=qs['limit'](_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x18')]);_0x331af6[_0x39f9('0x16')]=qs[_0x39f9('0x16')](_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x16')]);}_0x331af6['order']=qs[_0x39f9('0x35')](_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x35')]);_0x331af6[_0x39f9('0x36')]=qs[_0x39f9('0x2f')](_[_0x39f9('0x37')](_0x269e9c[_0x39f9('0x2d')],_0x2465bc['filters']),_0x510f88);if(_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x38')]){_0x331af6[_0x39f9('0x36')]=_[_0x39f9('0x39')](_0x331af6['where'],{'$or':_[_0x39f9('0x25')](_0x510f88,function(_0x326ca8){if(_0x326ca8[_0x39f9('0x29')]!==_0x39f9('0x3a')){var _0x521430={};_0x521430[_0x326ca8[_0x39f9('0x2c')]]={'$like':'%'+_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x38')]+'%'};return _0x521430;}})});}_0x331af6=_[_0x39f9('0x39')]({},_0x331af6,_0x269e9c[_0x39f9('0x3b')]);var _0x41890f={'where':_0x331af6['where']};return db[_0x39f9('0x26')][_0x39f9('0x19')](_0x41890f)['then'](function(_0x244d37){_0x3de83b['count']=_0x244d37;if(_0x269e9c[_0x39f9('0x2d')][_0x39f9('0x3c')]){_0x331af6[_0x39f9('0x3d')]=[{'all':!![]}];}return db[_0x39f9('0x26')]['findAll'](_0x331af6);})['then'](function(_0x2fdccf){_0x3de83b['rows']=_0x2fdccf;return _0x3de83b;})['then'](respondWithFilteredResult(_0x9de683,_0x331af6))[_0x39f9('0x3e')](handleError(_0x9de683,null));};exports[_0x39f9('0x3f')]=function(_0x5234f9,_0x48d12a){var _0x394c93={'raw':!![],'where':{'id':_0x5234f9[_0x39f9('0x40')]['id']}},_0x1db540={};_0x1db540[_0x39f9('0x2b')]=_[_0x39f9('0x2e')](db[_0x39f9('0x26')][_0x39f9('0x27')]);_0x1db540[_0x39f9('0x2d')]=_[_0x39f9('0x2e')](_0x5234f9[_0x39f9('0x2d')]);_0x1db540[_0x39f9('0x2f')]=_[_0x39f9('0x30')](_0x1db540[_0x39f9('0x2b')],_0x1db540[_0x39f9('0x2d')]);_0x394c93[_0x39f9('0x32')]=_[_0x39f9('0x30')](_0x1db540[_0x39f9('0x2b')],qs[_0x39f9('0x31')](_0x5234f9[_0x39f9('0x2d')]['fields']));_0x394c93[_0x39f9('0x32')]=_0x394c93[_0x39f9('0x32')]['length']?_0x394c93['attributes']:_0x1db540[_0x39f9('0x2b')];if(_0x5234f9['query'][_0x39f9('0x3c')]){_0x394c93[_0x39f9('0x3d')]=[{'all':!![]}];}_0x394c93=_[_0x39f9('0x39')]({},_0x394c93,_0x5234f9[_0x39f9('0x3b')]);return db[_0x39f9('0x26')][_0x39f9('0x41')](_0x394c93)[_0x39f9('0x20')](handleEntityNotFound(_0x48d12a,null))[_0x39f9('0x20')](respondWithResult(_0x48d12a,null))[_0x39f9('0x3e')](handleError(_0x48d12a,null));};exports[_0x39f9('0x42')]=function(_0x558d84,_0x3fddc1){return db['CmHopperHistory']['create'](_0x558d84[_0x39f9('0x43')],{})[_0x39f9('0x20')](respondWithResult(_0x3fddc1,0xc9))['catch'](handleError(_0x3fddc1,null));};exports['describe']=function(_0x3aa6be,_0x21adf5){return db['CmHopperHistory'][_0x39f9('0x44')]()[_0x39f9('0x20')](respondWithResult(_0x21adf5,null))[_0x39f9('0x3e')](handleError(_0x21adf5,null));};exports[_0x39f9('0x1f')]=function(_0x2405b5,_0x195c59){if(_0x2405b5[_0x39f9('0x43')][_0x39f9('0x45')]){delete _0x2405b5[_0x39f9('0x43')][_0x39f9('0x45')];}return db[_0x39f9('0x26')][_0x39f9('0x41')]({'where':{'uniqueid':_0x2405b5[_0x39f9('0x40')]['id']}})[_0x39f9('0x20')](handleEntityNotFound(_0x195c59,null))[_0x39f9('0x20')](saveUpdates(_0x2405b5[_0x39f9('0x43')],null))[_0x39f9('0x20')](respondWithResult(_0x195c59,null))['catch'](handleError(_0x195c59,null));}; \ No newline at end of file +var _0x55d3=['show','params','rawAttributes','length','options','find','catch','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x55d3,0x1d3));var _0x355d=function(_0x1e4377,_0x223fee){_0x1e4377=_0x1e4377-0x0;var _0x4f45cc=_0x55d3[_0x1e4377];return _0x4f45cc;};'use strict';var emlformat=require(_0x355d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x355d('0x1'));var jsonpatch=require(_0x355d('0x2'));var rp=require(_0x355d('0x3'));var moment=require(_0x355d('0x4'));var BPromise=require(_0x355d('0x5'));var Mustache=require(_0x355d('0x6'));var util=require(_0x355d('0x7'));var path=require(_0x355d('0x8'));var sox=require(_0x355d('0x9'));var csv=require(_0x355d('0xa'));var ejs=require(_0x355d('0xb'));var fs=require('fs');var fs_extra=require(_0x355d('0xc'));var _=require('lodash');var squel=require(_0x355d('0xd'));var crypto=require('crypto');var jsforce=require(_0x355d('0xe'));var deskjs=require(_0x355d('0xf'));var toCsv=require(_0x355d('0xa'));var querystring=require('querystring');var Papa=require(_0x355d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x355d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x355d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x355d('0x13'));var config=require(_0x355d('0x14'));var licenseUtil=require(_0x355d('0x15'));var db=require(_0x355d('0x16'))['db'];function respondWithStatusCode(_0x4b4c15,_0x18c59c){_0x18c59c=_0x18c59c||0xcc;return function(_0xef52af){if(_0xef52af){return _0x4b4c15[_0x355d('0x17')](_0x18c59c);}return _0x4b4c15[_0x355d('0x18')](_0x18c59c)[_0x355d('0x19')]();};}function respondWithResult(_0x4b510c,_0x2ac194){_0x2ac194=_0x2ac194||0xc8;return function(_0x10f505){if(_0x10f505){return _0x4b510c['status'](_0x2ac194)[_0x355d('0x1a')](_0x10f505);}};}function respondWithFilteredResult(_0x3e52f9,_0x45ec86){return function(_0x3a90c0){if(_0x3a90c0){var _0xd4a3c3=typeof _0x45ec86['offset']===_0x355d('0x1b')&&typeof _0x45ec86[_0x355d('0x1c')]===_0x355d('0x1b');var _0x2d9246=_0x3a90c0[_0x355d('0x1d')];var _0x1ab6a8=_0xd4a3c3?0x0:_0x45ec86[_0x355d('0x1e')];var _0x93679=_0xd4a3c3?_0x3a90c0[_0x355d('0x1d')]:_0x45ec86[_0x355d('0x1e')]+_0x45ec86[_0x355d('0x1c')];var _0x1d6566;if(_0x93679>=_0x2d9246){_0x93679=_0x2d9246;_0x1d6566=0xc8;}else{_0x1d6566=0xce;}_0x3e52f9[_0x355d('0x18')](_0x1d6566);return _0x3e52f9['set'](_0x355d('0x1f'),_0x1ab6a8+'-'+_0x93679+'/'+_0x2d9246)[_0x355d('0x1a')](_0x3a90c0);}return null;};}function patchUpdates(_0x3aba3a){return function(_0x5581ab){try{jsonpatch[_0x355d('0x20')](_0x5581ab,_0x3aba3a,!![]);}catch(_0x279c04){return BPromise[_0x355d('0x21')](_0x279c04);}return _0x5581ab[_0x355d('0x22')]();};}function saveUpdates(_0x51c639,_0x6f3252){return function(_0x249acf){if(_0x249acf){return _0x249acf[_0x355d('0x23')](_0x51c639)[_0x355d('0x24')](function(_0x1e388f){return _0x1e388f;});}return null;};}function removeEntity(_0x1b8e23,_0x522cea){return function(_0x36e246){if(_0x36e246){return _0x36e246[_0x355d('0x25')]()['then'](function(){_0x1b8e23[_0x355d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa13dce,_0x335cd1){return function(_0x412569){if(!_0x412569){_0xa13dce[_0x355d('0x17')](0x194);}return _0x412569;};}function handleError(_0x5b172d,_0xf17aa2){_0xf17aa2=_0xf17aa2||0x1f4;return function(_0x2cfcb7){logger[_0x355d('0x26')](_0x2cfcb7[_0x355d('0x27')]);if(_0x2cfcb7[_0x355d('0x28')]){delete _0x2cfcb7[_0x355d('0x28')];}_0x5b172d['status'](_0xf17aa2)[_0x355d('0x29')](_0x2cfcb7);};}exports[_0x355d('0x2a')]=function(_0x3a9441,_0x552781){var _0x40189f={},_0x168d5c={},_0x5303e8={'count':0x0,'rows':[]};var _0x23df93=_[_0x355d('0x2b')](db[_0x355d('0x2c')]['rawAttributes'],function(_0x4dcf34){return{'name':_0x4dcf34['fieldName'],'type':_0x4dcf34[_0x355d('0x2d')]['key']};});_0x168d5c[_0x355d('0x2e')]=_[_0x355d('0x2b')](_0x23df93,_0x355d('0x28'));_0x168d5c[_0x355d('0x2f')]=_[_0x355d('0x30')](_0x3a9441['query']);_0x168d5c[_0x355d('0x31')]=_[_0x355d('0x32')](_0x168d5c[_0x355d('0x2e')],_0x168d5c['query']);_0x40189f['attributes']=_[_0x355d('0x32')](_0x168d5c[_0x355d('0x2e')],qs[_0x355d('0x33')](_0x3a9441['query']['fields']));_0x40189f['attributes']=_0x40189f['attributes']['length']?_0x40189f[_0x355d('0x34')]:_0x168d5c[_0x355d('0x2e')];if(!_0x3a9441[_0x355d('0x2f')][_0x355d('0x35')](_0x355d('0x36'))){_0x40189f[_0x355d('0x1c')]=qs[_0x355d('0x1c')](_0x3a9441[_0x355d('0x2f')][_0x355d('0x1c')]);_0x40189f['offset']=qs[_0x355d('0x1e')](_0x3a9441[_0x355d('0x2f')][_0x355d('0x1e')]);}_0x40189f[_0x355d('0x37')]=qs[_0x355d('0x38')](_0x3a9441[_0x355d('0x2f')]['sort']);_0x40189f[_0x355d('0x39')]=qs[_0x355d('0x31')](_[_0x355d('0x3a')](_0x3a9441[_0x355d('0x2f')],_0x168d5c[_0x355d('0x31')]),_0x23df93);if(_0x3a9441[_0x355d('0x2f')][_0x355d('0x3b')]){_0x40189f[_0x355d('0x39')]=_[_0x355d('0x3c')](_0x40189f[_0x355d('0x39')],{'$or':_[_0x355d('0x2b')](_0x23df93,function(_0x223abd){if(_0x223abd[_0x355d('0x2d')]!=='VIRTUAL'){var _0xf09c4e={};_0xf09c4e[_0x223abd[_0x355d('0x28')]]={'$like':'%'+_0x3a9441[_0x355d('0x2f')][_0x355d('0x3b')]+'%'};return _0xf09c4e;}})});}_0x40189f=_['merge']({},_0x40189f,_0x3a9441['options']);var _0x4ed024={'where':_0x40189f[_0x355d('0x39')]};return db[_0x355d('0x2c')][_0x355d('0x1d')](_0x4ed024)[_0x355d('0x24')](function(_0x533d77){_0x5303e8[_0x355d('0x1d')]=_0x533d77;if(_0x3a9441[_0x355d('0x2f')][_0x355d('0x3d')]){_0x40189f[_0x355d('0x3e')]=[{'all':!![]}];}return db[_0x355d('0x2c')][_0x355d('0x3f')](_0x40189f);})['then'](function(_0x1c0353){_0x5303e8[_0x355d('0x40')]=_0x1c0353;return _0x5303e8;})[_0x355d('0x24')](respondWithFilteredResult(_0x552781,_0x40189f))['catch'](handleError(_0x552781,null));};exports[_0x355d('0x41')]=function(_0x507c7f,_0x2bb25c){var _0xa90b98={'raw':!![],'where':{'id':_0x507c7f[_0x355d('0x42')]['id']}},_0x4009d9={};_0x4009d9[_0x355d('0x2e')]=_[_0x355d('0x30')](db['CmHopperHistory'][_0x355d('0x43')]);_0x4009d9['query']=_[_0x355d('0x30')](_0x507c7f['query']);_0x4009d9[_0x355d('0x31')]=_[_0x355d('0x32')](_0x4009d9[_0x355d('0x2e')],_0x4009d9['query']);_0xa90b98[_0x355d('0x34')]=_[_0x355d('0x32')](_0x4009d9[_0x355d('0x2e')],qs['fields'](_0x507c7f[_0x355d('0x2f')][_0x355d('0x33')]));_0xa90b98['attributes']=_0xa90b98[_0x355d('0x34')][_0x355d('0x44')]?_0xa90b98['attributes']:_0x4009d9[_0x355d('0x2e')];if(_0x507c7f['query']['includeAll']){_0xa90b98['include']=[{'all':!![]}];}_0xa90b98=_[_0x355d('0x3c')]({},_0xa90b98,_0x507c7f[_0x355d('0x45')]);return db[_0x355d('0x2c')][_0x355d('0x46')](_0xa90b98)[_0x355d('0x24')](handleEntityNotFound(_0x2bb25c,null))[_0x355d('0x24')](respondWithResult(_0x2bb25c,null))[_0x355d('0x47')](handleError(_0x2bb25c,null));};exports[_0x355d('0x48')]=function(_0x45e205,_0x17c9a5){return db['CmHopperHistory'][_0x355d('0x48')](_0x45e205[_0x355d('0x49')],{})[_0x355d('0x24')](respondWithResult(_0x17c9a5,0xc9))['catch'](handleError(_0x17c9a5,null));};exports[_0x355d('0x4a')]=function(_0x3da336,_0x27c7e3){return db['CmHopperHistory'][_0x355d('0x4a')]()[_0x355d('0x24')](respondWithResult(_0x27c7e3,null))[_0x355d('0x47')](handleError(_0x27c7e3,null));};exports['update']=function(_0x4bcca8,_0x3f4346){if(_0x4bcca8[_0x355d('0x49')][_0x355d('0x4b')]){delete _0x4bcca8[_0x355d('0x49')][_0x355d('0x4b')];}return db[_0x355d('0x2c')][_0x355d('0x46')]({'where':{'uniqueid':_0x4bcca8[_0x355d('0x42')]['id']}})[_0x355d('0x24')](handleEntityNotFound(_0x3f4346,null))['then'](saveUpdates(_0x4bcca8[_0x355d('0x49')],null))[_0x355d('0x24')](respondWithResult(_0x3f4346,null))['catch'](handleError(_0x3f4346,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index d13b419..0244dde 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 _0xcf2f=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4c5397,_0x187338){var _0x1ec993=function(_0x424d9a){while(--_0x424d9a){_0x4c5397['push'](_0x4c5397['shift']());}};_0x1ec993(++_0x187338);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2e7377,_0x1839bf){_0x2e7377=_0x2e7377-0x0;var _0x2ca621=_0xcf2f[_0x2e7377];return _0x2ca621;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[{'name':_0xfcf2('0xe'),'fields':[_0xfcf2('0xe')]},{'name':_0xfcf2('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9a=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b29f2,_0x281f71){var _0x266f0a=function(_0xaaba1d){while(--_0xaaba1d){_0x5b29f2['push'](_0x5b29f2['shift']());}};_0x266f0a(++_0x281f71);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8a9a[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var logger=require(_0xa8a9('0x1'))(_0xa8a9('0x2'));var moment=require(_0xa8a9('0x3'));var BPromise=require(_0xa8a9('0x4'));var rp=require(_0xa8a9('0x5'));var fs=require('fs');var path=require(_0xa8a9('0x6'));var rimraf=require(_0xa8a9('0x7'));var config=require(_0xa8a9('0x8'));var attributes=require(_0xa8a9('0x9'));module[_0xa8a9('0xa')]=function(_0x1de1c6,_0x4ac303){return _0x1de1c6[_0xa8a9('0xb')]('CmHopperHistory',attributes,{'tableName':_0xa8a9('0xc'),'paranoid':![],'indexes':[{'name':_0xa8a9('0xd'),'fields':[_0xa8a9('0xd')]},{'name':_0xa8a9('0xe'),'fields':[_0xa8a9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d978a2a..8aa647c 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 _0xa2ab=['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','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','then','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null'];(function(_0x508f9a,_0x4d8e7e){var _0x170eb9=function(_0x224e8f){while(--_0x224e8f){_0x508f9a['push'](_0x508f9a['shift']());}};_0x170eb9(++_0x4d8e7e);}(_0xa2ab,0xa7));var _0xba2a=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0xa2ab[_0x208d75];return _0x382d27;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var BPromise=require('bluebird');var rs=require(_0xba2a('0x3'));var fs=require('fs');var Redis=require(_0xba2a('0x4'));var db=require(_0xba2a('0x5'))['db'];var utils=require(_0xba2a('0x6'));var logger=require(_0xba2a('0x7'))(_0xba2a('0x8'));var config=require(_0xba2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xba2a('0xa')][_0xba2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb9f9,_0x4c8719,_0xd09a60){return new BPromise(function(_0xf818d1,_0x2a40c6){return client[_0xba2a('0xc')](_0x3eb9f9,_0xd09a60)['then'](function(_0xb2ff17){logger[_0xba2a('0xd')](_0xba2a('0xe'),_0x4c8719,_0xba2a('0xf'));logger[_0xba2a('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4c8719,_0xba2a('0xf'),JSON[_0xba2a('0x11')](_0xb2ff17));if(_0xb2ff17[_0xba2a('0x12')]){if(_0xb2ff17[_0xba2a('0x12')]['code']===0x1f4){logger[_0xba2a('0x12')](_0xba2a('0xe'),_0x4c8719,_0xb2ff17[_0xba2a('0x12')][_0xba2a('0x13')]);return _0x2a40c6(_0xb2ff17[_0xba2a('0x12')]['message']);}logger[_0xba2a('0x12')](_0xba2a('0xe'),_0x4c8719,_0xb2ff17[_0xba2a('0x12')][_0xba2a('0x13')]);return _0xf818d1(_0xb2ff17['error'][_0xba2a('0x13')]);}else{logger[_0xba2a('0xd')](_0xba2a('0xe'),_0x4c8719,_0xba2a('0xf'));_0xf818d1(_0xb2ff17['result'][_0xba2a('0x13')]);}})[_0xba2a('0x14')](function(_0x4b37e4){logger[_0xba2a('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x4c8719,_0x4b37e4);_0x2a40c6(_0x4b37e4);});});}exports['CreateCmHopperHistory']=function(_0x559c6e){var _0x283846=this;return new Promise(function(_0xa56be8,_0x20225e){return db[_0xba2a('0x15')]['create'](_0x559c6e[_0xba2a('0x16')],{'raw':_0x559c6e[_0xba2a('0x17')]?_0x559c6e['options'][_0xba2a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3b3924){logger[_0xba2a('0xd')](_0xba2a('0x19'),_0x559c6e);logger[_0xba2a('0x10')](_0xba2a('0x19'),_0x559c6e,JSON[_0xba2a('0x11')](_0x3b3924));_0xa56be8(_0x3b3924);})['catch'](function(_0x2e0712){logger[_0xba2a('0x12')](_0xba2a('0x19'),_0x2e0712[_0xba2a('0x13')],_0x559c6e);_0x20225e(_0x283846[_0xba2a('0x12')](0x1f4,_0x2e0712['message']));});});};exports[_0xba2a('0x1a')]=function(_0x4458cb){var _0x3da13c=this;return new Promise(function(_0x3475e3,_0x46af1f){return db[_0xba2a('0x15')][_0xba2a('0x1b')]({'raw':_0x4458cb[_0xba2a('0x17')]?_0x4458cb['options'][_0xba2a('0x18')]===undefined?!![]:![]:!![],'where':_0x4458cb[_0xba2a('0x17')]?_0x4458cb[_0xba2a('0x17')][_0xba2a('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')][_0xba2a('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x21')))),_0xba2a('0x22')],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')]['literal'](_0xba2a('0x23')))),_0xba2a('0x24')],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db['sequelize']['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x26'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x27')))),_0xba2a('0x28')],[db[_0xba2a('0x1e')]['fn']('AVG',db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x29')))),_0xba2a('0x2a')]]})['then'](function(_0x44404c){logger[_0xba2a('0xd')](_0xba2a('0x1a'),_0x4458cb);logger[_0xba2a('0x10')]('AvgHandleTime',_0x4458cb,JSON[_0xba2a('0x11')](_0x44404c));_0x3475e3(_0x44404c);})[_0xba2a('0x14')](function(_0x183a1a){logger['error'](_0xba2a('0x1a'),_0x183a1a[_0xba2a('0x13')],_0x4458cb);_0x46af1f(_0x3da13c[_0xba2a('0x12')](0x1f4,_0x183a1a['message']));});});};exports[_0xba2a('0x2b')]=function(_0x3abdc6){var _0x3af5eb=this;return new Promise(function(_0x1f9e7b,_0x64c4a4){return db[_0xba2a('0x15')][_0xba2a('0x1b')]({'raw':_0x3abdc6['options']?_0x3abdc6[_0xba2a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3abdc6[_0xba2a('0x17')]?_0x3abdc6[_0xba2a('0x17')]['where']||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0xba2a('0x1d'),db['sequelize']['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0xba2a('0x2c')],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db['sequelize']['fn']('IF',db[_0xba2a('0x1e')]['literal'](_0xba2a('0x2d')))),_0xba2a('0x2e')],[db[_0xba2a('0x1e')]['fn']('COUNT',db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xba2a('0x2f')],[db[_0xba2a('0x1e')]['fn']('COUNT',db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x30')))),_0xba2a('0x31')],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')]['literal'](_0xba2a('0x32')))),_0xba2a('0x33')],[db['sequelize']['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xba2a('0x20')](_0xba2a('0x34')))),'outboundUnknownCallsDay'],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db['sequelize'][_0xba2a('0x20')]('`state`\x20=\x2013,\x201,\x20null'))),_0xba2a('0x35')],[db['sequelize']['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x36')))),_0xba2a('0x37')],[db['sequelize']['fn'](_0xba2a('0x1d'),db['sequelize']['fn']('IF',db[_0xba2a('0x1e')]['literal'](_0xba2a('0x38')))),_0xba2a('0x39')],[db[_0xba2a('0x1e')]['fn']('COUNT',db[_0xba2a('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xba2a('0x3a')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db['sequelize'][_0xba2a('0x20')](_0xba2a('0x3b')))),_0xba2a('0x39')],[db['sequelize']['fn']('COUNT',db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')][_0xba2a('0x20')](_0xba2a('0x3c')))),_0xba2a('0x3d')]],'group':[_0xba2a('0x3e')]})[_0xba2a('0x3f')](function(_0x8c9dca){logger[_0xba2a('0xd')](_0xba2a('0x2b'),_0x3abdc6);logger['debug'](_0xba2a('0x2b'),_0x3abdc6,JSON['stringify'](_0x8c9dca));_0x1f9e7b(_0x8c9dca);})[_0xba2a('0x14')](function(_0x2f6f70){logger['error'](_0xba2a('0x2b'),_0x2f6f70[_0xba2a('0x13')],_0x3abdc6);_0x64c4a4(_0x3af5eb[_0xba2a('0x12')](0x1f4,_0x2f6f70[_0xba2a('0x13')]));});});};exports[_0xba2a('0x40')]=function(_0x1ac2fa){var _0x58a823=this;return new Promise(function(_0x367c38,_0x50afed){return db[_0xba2a('0x15')][_0xba2a('0x1b')]({'raw':_0x1ac2fa[_0xba2a('0x17')]?_0x1ac2fa['options'][_0xba2a('0x18')]===undefined?!![]:![]:!![],'where':_0x1ac2fa[_0xba2a('0x17')]?_0x1ac2fa[_0xba2a('0x17')]['where']||null:null,'attributes':[['campaign',_0xba2a('0x41')],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')][_0xba2a('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0xba2a('0x1e')]['fn'](_0xba2a('0x1d'),db[_0xba2a('0x1e')]['fn']('IF',db[_0xba2a('0x1e')]['literal'](_0xba2a('0x21')))),_0xba2a('0x42')]],'group':[_0xba2a('0x3e')]})[_0xba2a('0x3f')](function(_0x545bc7){logger[_0xba2a('0xd')](_0xba2a('0x40'),_0x1ac2fa);logger[_0xba2a('0x10')]('GetCampaignHopperHistory',_0x1ac2fa,JSON[_0xba2a('0x11')](_0x545bc7));_0x367c38(_0x545bc7);})[_0xba2a('0x14')](function(_0x4367fb){logger['error']('GetCampaignHopperHistory',_0x4367fb[_0xba2a('0x13')],_0x1ac2fa);_0x50afed(_0x58a823[_0xba2a('0x12')](0x1f4,_0x4367fb['message']));});});}; \ No newline at end of file +var _0x5530=['predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','sequelize','COUNT','col','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2011,\x201,\x20null'];(function(_0x1c8cf0,_0x3ccc33){var _0xba87f=function(_0x30e319){while(--_0x30e319){_0x1c8cf0['push'](_0x1c8cf0['shift']());}};_0xba87f(++_0x3ccc33);}(_0x5530,0xa7));var _0x0553=function(_0x5e0b52,_0xc6037d){_0x5e0b52=_0x5e0b52-0x0;var _0x4b9ed7=_0x5530[_0x5e0b52];return _0x4b9ed7;};'use strict';var _=require(_0x0553('0x0'));var util=require('util');var moment=require(_0x0553('0x1'));var BPromise=require(_0x0553('0x2'));var rs=require(_0x0553('0x3'));var fs=require('fs');var Redis=require(_0x0553('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0553('0x5'));var logger=require('../../config/logger')(_0x0553('0x6'));var config=require('../../config/environment');var jayson=require(_0x0553('0x7'));var client=jayson['client'][_0x0553('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29ee3,_0x2ea8a7,_0x3d8b58){return new BPromise(function(_0x555a35,_0x56728d){return client[_0x0553('0x9')](_0x29ee3,_0x3d8b58)[_0x0553('0xa')](function(_0x3c41e2){logger[_0x0553('0xb')](_0x0553('0xc'),_0x2ea8a7,_0x0553('0xd'));logger[_0x0553('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2ea8a7,'request\x20sent',JSON[_0x0553('0xf')](_0x3c41e2));if(_0x3c41e2[_0x0553('0x10')]){if(_0x3c41e2[_0x0553('0x10')][_0x0553('0x11')]===0x1f4){logger[_0x0553('0x10')](_0x0553('0xc'),_0x2ea8a7,_0x3c41e2[_0x0553('0x10')][_0x0553('0x12')]);return _0x56728d(_0x3c41e2[_0x0553('0x10')][_0x0553('0x12')]);}logger['error'](_0x0553('0xc'),_0x2ea8a7,_0x3c41e2['error'][_0x0553('0x12')]);return _0x555a35(_0x3c41e2[_0x0553('0x10')][_0x0553('0x12')]);}else{logger['info'](_0x0553('0xc'),_0x2ea8a7,'request\x20sent');_0x555a35(_0x3c41e2['result'][_0x0553('0x12')]);}})[_0x0553('0x13')](function(_0xce8d83){logger[_0x0553('0x10')](_0x0553('0xc'),_0x2ea8a7,_0xce8d83);_0x56728d(_0xce8d83);});});}exports[_0x0553('0x14')]=function(_0x15eac3){var _0x554b8b=this;return new Promise(function(_0x192022,_0x57f949){return db[_0x0553('0x15')][_0x0553('0x16')](_0x15eac3[_0x0553('0x17')],{'raw':_0x15eac3[_0x0553('0x18')]?_0x15eac3['options']['raw']===undefined?!![]:![]:!![]})[_0x0553('0xa')](function(_0x1ef5d7){logger[_0x0553('0xb')](_0x0553('0x14'),_0x15eac3);logger['debug'](_0x0553('0x14'),_0x15eac3,JSON['stringify'](_0x1ef5d7));_0x192022(_0x1ef5d7);})[_0x0553('0x13')](function(_0x3a7b43){logger['error'](_0x0553('0x14'),_0x3a7b43[_0x0553('0x12')],_0x15eac3);_0x57f949(_0x554b8b[_0x0553('0x10')](0x1f4,_0x3a7b43['message']));});});};exports[_0x0553('0x19')]=function(_0xc83913){var _0x3bc9fd=this;return new Promise(function(_0x3fd6ae,_0x1e9fc2){return db[_0x0553('0x15')][_0x0553('0x1a')]({'raw':_0xc83913[_0x0553('0x18')]?_0xc83913[_0x0553('0x18')][_0x0553('0x1b')]===undefined?!![]:![]:!![],'where':_0xc83913[_0x0553('0x18')]?_0xc83913[_0x0553('0x18')]['where']||null:null,'attributes':[[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')][_0x0553('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0x0553('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x0553('0x1f')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x21')))),_0x0553('0x22')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x23'),db['sequelize']['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x24')))),'predictiveIntervalAvgHoldtime'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x23'),db[_0x0553('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x0553('0x25')))),_0x0553('0x26')]]})[_0x0553('0xa')](function(_0x2867b5){logger[_0x0553('0xb')](_0x0553('0x19'),_0xc83913);logger['debug'](_0x0553('0x19'),_0xc83913,JSON[_0x0553('0xf')](_0x2867b5));_0x3fd6ae(_0x2867b5);})[_0x0553('0x13')](function(_0x5b6a2d){logger[_0x0553('0x10')](_0x0553('0x19'),_0x5b6a2d[_0x0553('0x12')],_0xc83913);_0x1e9fc2(_0x3bc9fd[_0x0553('0x10')](0x1f4,_0x5b6a2d['message']));});});};exports[_0x0553('0x27')]=function(_0x563a40){var _0x19a055=this;return new Promise(function(_0x4b2c40,_0x12ff03){return db['CmHopperHistory'][_0x0553('0x1a')]({'raw':_0x563a40[_0x0553('0x18')]?_0x563a40[_0x0553('0x18')][_0x0553('0x1b')]===undefined?!![]:![]:!![],'where':_0x563a40[_0x0553('0x18')]?_0x563a40['options'][_0x0553('0x28')]||null:null,'attributes':[['campaign',_0x0553('0x29')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x0553('0x2a')))),'outboundNoSuchCallsDay'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x2b')))),_0x0553('0x2c')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x2d')))),_0x0553('0x2e')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x2f')))),_0x0553('0x30')],[db[_0x0553('0x1c')]['fn']('COUNT',db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x31')))),_0x0553('0x32')],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')]['literal'](_0x0553('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db['sequelize']['fn']('IF',db[_0x0553('0x1c')]['literal'](_0x0553('0x34')))),'outboundDropCallsDayCallersExit'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')]['literal'](_0x0553('0x35')))),'outboundUnknownCallsDay'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x36')))),_0x0553('0x37')],[db[_0x0553('0x1c')]['fn']('COUNT',db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db['sequelize']['fn']('IF',db[_0x0553('0x1c')]['literal'](_0x0553('0x39')))),_0x0553('0x3a')],[db['sequelize']['fn'](_0x0553('0x1d'),db['sequelize']['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x3b')))),_0x0553('0x3c')],[db['sequelize']['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x3d')))),'outboundRejectCallsDay'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x3e')))),'outboundReCallsDay']],'group':[_0x0553('0x3f')]})['then'](function(_0x46a1bc){logger['info'](_0x0553('0x27'),_0x563a40);logger['debug'](_0x0553('0x27'),_0x563a40,JSON[_0x0553('0xf')](_0x46a1bc));_0x4b2c40(_0x46a1bc);})[_0x0553('0x13')](function(_0xc3058f){logger[_0x0553('0x10')]('GetVoiceQueueHopperHistory',_0xc3058f['message'],_0x563a40);_0x12ff03(_0x19a055[_0x0553('0x10')](0x1f4,_0xc3058f[_0x0553('0x12')]));});});};exports[_0x0553('0x40')]=function(_0x2bb396){var _0x193f1b=this;return new Promise(function(_0x5f2a4d,_0x345101){return db[_0x0553('0x15')]['findAll']({'raw':_0x2bb396[_0x0553('0x18')]?_0x2bb396[_0x0553('0x18')][_0x0553('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bb396['options']?_0x2bb396['options'][_0x0553('0x28')]||null:null,'attributes':[[_0x0553('0x3f'),'name'],[db[_0x0553('0x1c')]['fn'](_0x0553('0x1d'),db['sequelize']['col']('id')),_0x0553('0x41')],[db[_0x0553('0x1c')]['fn']('COUNT',db[_0x0553('0x1c')]['fn']('IF',db[_0x0553('0x1c')][_0x0553('0x20')](_0x0553('0x2d')))),_0x0553('0x42')]],'group':[_0x0553('0x3f')]})[_0x0553('0xa')](function(_0x4e9f3d){logger[_0x0553('0xb')](_0x0553('0x40'),_0x2bb396);logger[_0x0553('0xe')](_0x0553('0x40'),_0x2bb396,JSON['stringify'](_0x4e9f3d));_0x5f2a4d(_0x4e9f3d);})[_0x0553('0x13')](function(_0x519c9c){logger[_0x0553('0x10')](_0x0553('0x40'),_0x519c9c[_0x0553('0x12')],_0x2bb396);_0x345101(_0x193f1b[_0x0553('0x10')](0x1f4,_0x519c9c[_0x0553('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fc01698..764beaa 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 _0x68ba=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','exports','util','path','connect-timeout'];(function(_0x5f5d9f,_0x5d3160){var _0x56f584=function(_0xd38bae){while(--_0xd38bae){_0x5f5d9f['push'](_0x5f5d9f['shift']());}};_0x56f584(++_0x5d3160);}(_0x68ba,0xce));var _0xa68b=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x68ba[_0x2d8d69];return _0x39ae22;};'use strict';var multer=require('multer');var util=require(_0xa68b('0x0'));var path=require(_0xa68b('0x1'));var timeout=require(_0xa68b('0x2'));var express=require(_0xa68b('0x3'));var router=express[_0xa68b('0x4')]();var fs_extra=require(_0xa68b('0x5'));var auth=require(_0xa68b('0x6'));var interaction=require(_0xa68b('0x7'));var config=require('../../config/environment');var controller=require(_0xa68b('0x8'));router[_0xa68b('0x9')]('/',auth[_0xa68b('0xa')](),controller[_0xa68b('0xb')]);router[_0xa68b('0x9')](_0xa68b('0xc'),auth[_0xa68b('0xa')](),controller[_0xa68b('0xd')]);router[_0xa68b('0x9')](_0xa68b('0xe'),auth[_0xa68b('0xa')](),controller[_0xa68b('0xf')]);router[_0xa68b('0x10')]('/',auth[_0xa68b('0xa')](),controller['create']);router[_0xa68b('0x11')](_0xa68b('0xe'),auth[_0xa68b('0xa')](),controller['update']);module[_0xa68b('0x12')]=router; \ No newline at end of file +var _0x7196=['get','/describe','/:id','show','post','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','isAuthenticated'];(function(_0x357bb3,_0x1ea29a){var _0x2cb29=function(_0x1575a3){while(--_0x1575a3){_0x357bb3['push'](_0x357bb3['shift']());}};_0x2cb29(++_0x1ea29a);}(_0x7196,0x78));var _0x6719=function(_0x4dd43e,_0x135d9c){_0x4dd43e=_0x4dd43e-0x0;var _0x381efa=_0x7196[_0x4dd43e];return _0x381efa;};'use strict';var multer=require(_0x6719('0x0'));var util=require(_0x6719('0x1'));var path=require('path');var timeout=require(_0x6719('0x2'));var express=require('express');var router=express[_0x6719('0x3')]();var fs_extra=require(_0x6719('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6719('0x5'));var controller=require(_0x6719('0x6'));router['get']('/',auth[_0x6719('0x7')](),controller['index']);router[_0x6719('0x8')](_0x6719('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6719('0xa'),auth[_0x6719('0x7')](),controller[_0x6719('0xb')]);router[_0x6719('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6719('0xd')]('/:id',auth[_0x6719('0x7')](),controller[_0x6719('0xe')]);module[_0x6719('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3c301bd..c2b3aed 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 _0x121d=['STRING','name','sequelize','exports'];(function(_0x43f6bf,_0x20b7a2){var _0x1acca7=function(_0x261a38){while(--_0x261a38){_0x43f6bf['push'](_0x43f6bf['shift']());}};_0x1acca7(++_0x20b7a2);}(_0x121d,0xea));var _0xd121=function(_0x4da9de,_0x3205d4){_0x4da9de=_0x4da9de-0x0;var _0x4b4417=_0x121d[_0x4da9de];return _0x4b4417;};'use strict';var Sequelize=require(_0xd121('0x0'));module[_0xd121('0x1')]={'name':{'type':Sequelize[_0xd121('0x2')],'unique':_0xd121('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd121('0x2')]},'dialPrefix':{'type':Sequelize[_0xd121('0x2')]}}; \ No newline at end of file +var _0x82f5=['name','sequelize','exports','STRING'];(function(_0x361554,_0x4649ff){var _0x1495b8=function(_0x28f597){while(--_0x28f597){_0x361554['push'](_0x361554['shift']());}};_0x1495b8(++_0x4649ff);}(_0x82f5,0x15d));var _0x582f=function(_0x2dece0,_0x32a38e){_0x2dece0=_0x2dece0-0x0;var _0x312af1=_0x82f5[_0x2dece0];return _0x312af1;};'use strict';var Sequelize=require(_0x582f('0x0'));module[_0x582f('0x1')]={'name':{'type':Sequelize[_0x582f('0x2')],'unique':_0x582f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x582f('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ac24249..ed76e30 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 _0x7edc=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','send','index','map','fieldName','keys','filters','model','query','attributes','length','order','sort','where','pick','merge','type','filter','options','CmList','rows','catch','show','rawAttributes','intersection','include','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','params','Disposition','findOne','fields','hasOwnProperty','ListId','includeAll','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','nolimit','getContactsCsv','format','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','sequelize','addCustomFields','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x7edc,0x7e));var _0xc7ed=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x7edc[_0x55821d];return _0x58ea8a;};'use strict';var emlformat=require(_0xc7ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc7ed('0x1'));var rp=require(_0xc7ed('0x2'));var moment=require(_0xc7ed('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7ed('0x4'));var path=require(_0xc7ed('0x5'));var sox=require(_0xc7ed('0x6'));var csv=require(_0xc7ed('0x7'));var ejs=require(_0xc7ed('0x8'));var fs=require('fs');var fs_extra=require(_0xc7ed('0x9'));var _=require(_0xc7ed('0xa'));var squel=require(_0xc7ed('0xb'));var crypto=require(_0xc7ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc7ed('0xd'));var toCsv=require(_0xc7ed('0x7'));var querystring=require(_0xc7ed('0xe'));var Papa=require(_0xc7ed('0xf'));var Redis=require(_0xc7ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc7ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7ed('0x12'));var logger=require('../../config/logger')(_0xc7ed('0x13'));var utils=require(_0xc7ed('0x14'));var config=require(_0xc7ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ed('0x16'))['db'];config['redis']=_[_0xc7ed('0x17')](config['redis'],{'host':_0xc7ed('0x18'),'port':0x18eb});var socket=require(_0xc7ed('0x19'))(new Redis(config[_0xc7ed('0x1a')]));require('./cmList.socket')[_0xc7ed('0x1b')](socket);function respondWithStatusCode(_0x43474b,_0x101f49){_0x101f49=_0x101f49||0xcc;return function(_0x54bf58){if(_0x54bf58){return _0x43474b[_0xc7ed('0x1c')](_0x101f49);}return _0x43474b[_0xc7ed('0x1d')](_0x101f49)[_0xc7ed('0x1e')]();};}function respondWithResult(_0x1734c2,_0x4819b0){_0x4819b0=_0x4819b0||0xc8;return function(_0x3fe713){if(_0x3fe713){return _0x1734c2['status'](_0x4819b0)[_0xc7ed('0x1f')](_0x3fe713);}};}function respondWithFilteredResult(_0x463059,_0x1aa89a){return function(_0x402cec){if(_0x402cec){var _0x13d52e=typeof _0x1aa89a[_0xc7ed('0x20')]===_0xc7ed('0x21')&&typeof _0x1aa89a[_0xc7ed('0x22')]===_0xc7ed('0x21');var _0x5bd358=_0x402cec[_0xc7ed('0x23')];var _0x558c06=_0x13d52e?0x0:_0x1aa89a[_0xc7ed('0x20')];var _0x36cf0c=_0x13d52e?_0x402cec[_0xc7ed('0x23')]:_0x1aa89a[_0xc7ed('0x20')]+_0x1aa89a['limit'];var _0xce6fba;if(_0x36cf0c>=_0x5bd358){_0x36cf0c=_0x5bd358;_0xce6fba=0xc8;}else{_0xce6fba=0xce;}_0x463059['status'](_0xce6fba);return _0x463059['set'](_0xc7ed('0x24'),_0x558c06+'-'+_0x36cf0c+'/'+_0x5bd358)[_0xc7ed('0x1f')](_0x402cec);}return null;};}function patchUpdates(_0x1c1121){return function(_0xacca6){try{jsonpatch[_0xc7ed('0x25')](_0xacca6,_0x1c1121,!![]);}catch(_0x2a6919){return BPromise['reject'](_0x2a6919);}return _0xacca6['save']();};}function saveUpdates(_0x3fccb2,_0x38aabd){return function(_0x2e1abb){if(_0x2e1abb){return _0x2e1abb[_0xc7ed('0x26')](_0x3fccb2)[_0xc7ed('0x27')](function(_0x4214cc){return _0x4214cc;});}return null;};}function removeEntity(_0x43082,_0xd96f1c){return function(_0x346dc0){if(_0x346dc0){return _0x346dc0['destroy']()['then'](function(){var _0x435218=_0x346dc0[_0xc7ed('0x28')]({'plain':!![]});var _0x1e2437=_0xc7ed('0x29');return db[_0xc7ed('0x2a')][_0xc7ed('0x2b')]({'where':{'type':_0x1e2437,'resourceId':_0x435218['id']}})[_0xc7ed('0x27')](function(){return _0x346dc0;});})[_0xc7ed('0x27')](function(){_0x43082[_0xc7ed('0x1d')](0xcc)[_0xc7ed('0x1e')]();});}};}function handleEntityNotFound(_0x92ce4e,_0x1ba7a1){return function(_0x1ada66){if(!_0x1ada66){_0x92ce4e[_0xc7ed('0x1c')](0x194);}return _0x1ada66;};}function handleError(_0x1ff54,_0x2eb194){_0x2eb194=_0x2eb194||0x1f4;return function(_0x5b9ed3){logger[_0xc7ed('0x2c')](_0x5b9ed3[_0xc7ed('0x2d')]);if(_0x5b9ed3[_0xc7ed('0x2e')]){delete _0x5b9ed3[_0xc7ed('0x2e')];}_0x1ff54['status'](_0x2eb194)[_0xc7ed('0x2f')](_0x5b9ed3);};}exports[_0xc7ed('0x30')]=function(_0x38f76b,_0x3e2a31){var _0x55c797={},_0x3133b2={},_0x5bd7a8={'count':0x0,'rows':[]};var _0x3df081=_[_0xc7ed('0x31')](db['CmList']['rawAttributes'],function(_0x24df25){return{'name':_0x24df25[_0xc7ed('0x32')],'type':_0x24df25['type']['key']};});_0x3133b2['model']=_[_0xc7ed('0x31')](_0x3df081,_0xc7ed('0x2e'));_0x3133b2['query']=_[_0xc7ed('0x33')](_0x38f76b['query']);_0x3133b2[_0xc7ed('0x34')]=_['intersection'](_0x3133b2[_0xc7ed('0x35')],_0x3133b2[_0xc7ed('0x36')]);_0x55c797[_0xc7ed('0x37')]=_['intersection'](_0x3133b2[_0xc7ed('0x35')],qs['fields'](_0x38f76b[_0xc7ed('0x36')]['fields']));_0x55c797[_0xc7ed('0x37')]=_0x55c797[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x55c797[_0xc7ed('0x37')]:_0x3133b2[_0xc7ed('0x35')];if(!_0x38f76b[_0xc7ed('0x36')]['hasOwnProperty']('nolimit')){_0x55c797['limit']=qs['limit'](_0x38f76b['query'][_0xc7ed('0x22')]);_0x55c797[_0xc7ed('0x20')]=qs[_0xc7ed('0x20')](_0x38f76b[_0xc7ed('0x36')][_0xc7ed('0x20')]);}_0x55c797[_0xc7ed('0x39')]=qs['sort'](_0x38f76b[_0xc7ed('0x36')][_0xc7ed('0x3a')]);_0x55c797[_0xc7ed('0x3b')]=qs[_0xc7ed('0x34')](_[_0xc7ed('0x3c')](_0x38f76b['query'],_0x3133b2[_0xc7ed('0x34')]),_0x3df081);if(_0x38f76b['query']['filter']){_0x55c797[_0xc7ed('0x3b')]=_[_0xc7ed('0x3d')](_0x55c797[_0xc7ed('0x3b')],{'$or':_[_0xc7ed('0x31')](_0x3df081,function(_0x5ace1d){if(_0x5ace1d[_0xc7ed('0x3e')]!=='VIRTUAL'){var _0x521675={};_0x521675[_0x5ace1d[_0xc7ed('0x2e')]]={'$like':'%'+_0x38f76b[_0xc7ed('0x36')][_0xc7ed('0x3f')]+'%'};return _0x521675;}})});}_0x55c797=_[_0xc7ed('0x3d')]({},_0x55c797,_0x38f76b[_0xc7ed('0x40')]);var _0x4c2736={'where':_0x55c797['where']};return db[_0xc7ed('0x41')][_0xc7ed('0x23')](_0x4c2736)[_0xc7ed('0x27')](function(_0x109453){_0x5bd7a8['count']=_0x109453;if(_0x38f76b[_0xc7ed('0x36')]['includeAll']){_0x55c797['include']=[{'all':!![]}];}return db['CmList']['findAll'](_0x55c797);})['then'](function(_0x13b862){_0x5bd7a8[_0xc7ed('0x42')]=_0x13b862;return _0x5bd7a8;})[_0xc7ed('0x27')](respondWithFilteredResult(_0x3e2a31,_0x55c797))[_0xc7ed('0x43')](handleError(_0x3e2a31,null));};exports[_0xc7ed('0x44')]=function(_0x23f4b9,_0x28e335){var _0x16f074={'raw':![],'where':{'id':_0x23f4b9['params']['id']}},_0x5aed30={};_0x5aed30[_0xc7ed('0x35')]=_[_0xc7ed('0x33')](db[_0xc7ed('0x41')][_0xc7ed('0x45')]);_0x5aed30[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x23f4b9[_0xc7ed('0x36')]);_0x5aed30[_0xc7ed('0x34')]=_[_0xc7ed('0x46')](_0x5aed30[_0xc7ed('0x35')],_0x5aed30[_0xc7ed('0x36')]);_0x16f074[_0xc7ed('0x37')]=_['intersection'](_0x5aed30['model'],qs['fields'](_0x23f4b9['query']['fields']));_0x16f074['attributes']=_0x16f074[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x16f074['attributes']:_0x5aed30[_0xc7ed('0x35')];if(_0x23f4b9['query']['includeAll']){_0x16f074[_0xc7ed('0x47')]=[{'all':!![]}];}_0x16f074=_[_0xc7ed('0x3d')]({},_0x16f074,_0x23f4b9[_0xc7ed('0x40')]);return db[_0xc7ed('0x41')][_0xc7ed('0x48')](_0x16f074)[_0xc7ed('0x27')](handleEntityNotFound(_0x28e335,null))[_0xc7ed('0x27')](respondWithResult(_0x28e335,null))[_0xc7ed('0x43')](handleError(_0x28e335,null));};exports[_0xc7ed('0x49')]=function(_0x15ee1d,_0x574d44){return db[_0xc7ed('0x41')]['create'](_0x15ee1d[_0xc7ed('0x4a')],{})[_0xc7ed('0x27')](function(_0x185a29){var _0x5b8204=_0x15ee1d['user']['get']({'plain':!![]});if(!_0x5b8204)throw new Error(_0xc7ed('0x4b'));if(_0x5b8204[_0xc7ed('0x4c')]===_0xc7ed('0x4d')){var _0x122bb6=_0x185a29['get']({'plain':!![]});var _0x1c06e5=_0xc7ed('0x29');return db[_0xc7ed('0x4e')]['find']({'where':{'name':_0x1c06e5,'userProfileId':_0x5b8204[_0xc7ed('0x4f')]},'raw':!![]})[_0xc7ed('0x27')](function(_0x337cdd){if(_0x337cdd&&_0x337cdd[_0xc7ed('0x50')]===0x0){return db['UserProfileResource'][_0xc7ed('0x49')]({'name':_0x122bb6[_0xc7ed('0x2e')],'resourceId':_0x122bb6['id'],'type':_0x337cdd[_0xc7ed('0x2e')],'sectionId':_0x337cdd['id']},{})['then'](function(){return _0x185a29;});}else{return _0x185a29;}})['catch'](function(_0x3f17ea){logger[_0xc7ed('0x2c')](_0xc7ed('0x51'),_0x3f17ea);throw _0x3f17ea;});}return _0x185a29;})[_0xc7ed('0x27')](respondWithResult(_0x574d44,0xc9))[_0xc7ed('0x43')](handleError(_0x574d44,null));};exports['update']=function(_0x569bf6,_0x83ddbe){if(_0x569bf6[_0xc7ed('0x4a')]['id']){delete _0x569bf6['body']['id'];}return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x569bf6['params']['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0x83ddbe,null))['then'](saveUpdates(_0x569bf6['body'],null))[_0xc7ed('0x27')](respondWithResult(_0x83ddbe,null))[_0xc7ed('0x43')](handleError(_0x83ddbe,null));};exports[_0xc7ed('0x2b')]=function(_0x170f83,_0x25286b){return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x170f83[_0xc7ed('0x52')]['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0x25286b,null))[_0xc7ed('0x27')](removeEntity(_0x25286b,null))['catch'](handleError(_0x25286b,null));};exports['describe']=function(_0x1d92b4,_0x4c8dea){return db[_0xc7ed('0x41')]['describe']()['then'](respondWithResult(_0x4c8dea,null))['catch'](handleError(_0x4c8dea,null));};exports['addDisposition']=function(_0x749bd,_0x2f3396,_0x20803f){if(_0x749bd[_0xc7ed('0x4a')]['id']){delete _0x749bd[_0xc7ed('0x4a')]['id'];}return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x749bd[_0xc7ed('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f3396,null))[_0xc7ed('0x27')](function(_0x43f712){if(_0x43f712){_0x749bd['body']['ListId']=_0x43f712['id'];return db[_0xc7ed('0x53')][_0xc7ed('0x49')](_0x749bd['body']);}})['then'](respondWithResult(_0x2f3396,null))[_0xc7ed('0x43')](handleError(_0x2f3396,null));};exports['getDispositions']=function(_0x4dfb94,_0xf3af69,_0x4832af){var _0x4a4736={'raw':![],'where':{}};var _0x4d5cd6={};var _0x33feec={'count':0x0,'rows':[]};return db['CmList'][_0xc7ed('0x54')]({'where':{'id':_0x4dfb94[_0xc7ed('0x52')]['id']}})['then'](handleEntityNotFound(_0xf3af69,null))[_0xc7ed('0x27')](function(_0x2d49b8){if(_0x2d49b8){_0x4d5cd6[_0xc7ed('0x35')]=_[_0xc7ed('0x33')](db[_0xc7ed('0x53')][_0xc7ed('0x45')]);_0x4d5cd6[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x4dfb94[_0xc7ed('0x36')]);_0x4d5cd6[_0xc7ed('0x34')]=_['intersection'](_0x4d5cd6[_0xc7ed('0x35')],_0x4d5cd6[_0xc7ed('0x36')]);_0x4a4736[_0xc7ed('0x37')]=_[_0xc7ed('0x46')](_0x4d5cd6[_0xc7ed('0x35')],qs[_0xc7ed('0x55')](_0x4dfb94[_0xc7ed('0x36')][_0xc7ed('0x55')]));_0x4a4736[_0xc7ed('0x37')]=_0x4a4736[_0xc7ed('0x37')]['length']?_0x4a4736[_0xc7ed('0x37')]:_0x4d5cd6[_0xc7ed('0x35')];if(!_0x4dfb94['query'][_0xc7ed('0x56')]('nolimit')){_0x4a4736[_0xc7ed('0x22')]=qs['limit'](_0x4dfb94[_0xc7ed('0x36')][_0xc7ed('0x22')]);_0x4a4736['offset']=qs[_0xc7ed('0x20')](_0x4dfb94['query']['offset']);}_0x4a4736[_0xc7ed('0x39')]=qs[_0xc7ed('0x3a')](_0x4dfb94[_0xc7ed('0x36')][_0xc7ed('0x3a')]);_0x4a4736[_0xc7ed('0x3b')]=qs['filters'](_[_0xc7ed('0x3c')](_0x4dfb94['query'],_0x4d5cd6[_0xc7ed('0x34')]));_0x4a4736[_0xc7ed('0x3b')][_0xc7ed('0x57')]=_0x2d49b8['id'];if(_0x4dfb94['query'][_0xc7ed('0x3f')]){_0x4a4736[_0xc7ed('0x3b')]=_[_0xc7ed('0x3d')](_0x4a4736[_0xc7ed('0x3b')],{'$or':_[_0xc7ed('0x31')](_0x4a4736[_0xc7ed('0x37')],function(_0x448e0a){var _0x319b25={};_0x319b25[_0x448e0a]={'$like':'%'+_0x4dfb94['query'][_0xc7ed('0x3f')]+'%'};return _0x319b25;})});}_0x4a4736=_['merge']({},_0x4a4736,_0x4dfb94[_0xc7ed('0x40')]);return db[_0xc7ed('0x53')][_0xc7ed('0x23')]({'where':_0x4a4736['where']})[_0xc7ed('0x27')](function(_0x4da7b0){_0x33feec[_0xc7ed('0x23')]=_0x4da7b0;if(_0x4dfb94['query'][_0xc7ed('0x58')]){_0x4a4736[_0xc7ed('0x47')]=[{'all':!![]}];}return db['Disposition'][_0xc7ed('0x59')](_0x4a4736);})[_0xc7ed('0x27')](function(_0x14732d){_0x33feec[_0xc7ed('0x42')]=_0x14732d;return _0x33feec;});}})[_0xc7ed('0x27')](respondWithFilteredResult(_0xf3af69,_0x4a4736))['catch'](handleError(_0xf3af69,null));};exports[_0xc7ed('0x5a')]=function(_0x53ec6c,_0x3b1ccb,_0x429cb3){return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x53ec6c['params']['id']}})['then'](handleEntityNotFound(_0x3b1ccb,null))[_0xc7ed('0x27')](function(_0x2f2284){if(_0x2f2284){return _0x2f2284[_0xc7ed('0x5a')](_0x53ec6c[_0xc7ed('0x36')][_0xc7ed('0x5b')]);}})['then'](respondWithStatusCode(_0x3b1ccb,null))['catch'](handleError(_0x3b1ccb,null));};exports[_0xc7ed('0x5c')]=function(_0xef0370,_0x154c48,_0x44d843){return db[_0xc7ed('0x41')]['find']({'where':{'id':_0xef0370['params']['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0x154c48,null))[_0xc7ed('0x27')](function(_0x4a9cf0){if(_0x4a9cf0){var _0x25825e=[];var _0x133e67={'success':[],'errors':[]};return db[_0xc7ed('0x5d')]['describe']()[_0xc7ed('0x27')](function(_0x2767ef){if(_0xef0370['body'][_0xc7ed('0x5e')]&&_[_0xc7ed('0x5f')](_0xef0370[_0xc7ed('0x4a')][_0xc7ed('0x5e')])){if(_0xef0370['body'][_0xc7ed('0x5e')][_0xc7ed('0x38')]){_0xef0370['body'][_0xc7ed('0x5e')]=_0xef0370[_0xc7ed('0x4a')][_0xc7ed('0x5e')][_0xc7ed('0x60')](';')+';';}else{_0xef0370[_0xc7ed('0x4a')][_0xc7ed('0x5e')]=null;}}else{_0xef0370['body'][_0xc7ed('0x5e')]=null;}if(_0xef0370[_0xc7ed('0x4a')]&&_[_0xc7ed('0x5f')](_0xef0370[_0xc7ed('0x4a')])){for(var _0x57b805=0x0;_0x57b805<_0xef0370[_0xc7ed('0x4a')][_0xc7ed('0x38')];_0x57b805+=0x1){_0xef0370[_0xc7ed('0x4a')][_0x57b805][_0xc7ed('0x57')]=_0xef0370[_0xc7ed('0x52')]['id'];_0x25825e[_0xc7ed('0x61')](_0xef0370[_0xc7ed('0x4a')][_0x57b805]);}return BPromise[_0xc7ed('0x62')](_0x25825e,function(_0x1b8e6b){return db[_0xc7ed('0x5d')][_0xc7ed('0x49')](_[_0xc7ed('0x63')](_0x1b8e6b,[_0xc7ed('0x5b'),'id'])||{},{'fields':_[_0xc7ed('0x33')](_0x2767ef),'raw':!![]})[_0xc7ed('0x27')](function(_0x2d1e08){_0x133e67[_0xc7ed('0x64')][_0xc7ed('0x61')](_0x2d1e08[_0xc7ed('0x65')]);})[_0xc7ed('0x43')](function(_0x1597c6){_0x133e67[_0xc7ed('0x66')]['push']({'data':_0x1b8e6b,'error':_0x1597c6['message']});});})['then'](function(_0x5af547){return _0x133e67;})[_0xc7ed('0x43')](function(_0x3e00aa){return _0x3e00aa;});}else{_0x154c48[_0xc7ed('0x1d')](0x190)[_0xc7ed('0x1f')]({'message':_0xc7ed('0x67')});}});}})[_0xc7ed('0x27')](respondWithResult(_0x154c48,null))[_0xc7ed('0x43')](handleError(_0x154c48,null));};exports[_0xc7ed('0x68')]=function(_0x1be8fe,_0x563812,_0x7e3e79){var _0x187910;return db['CmList']['find']({'where':{'id':_0x1be8fe[_0xc7ed('0x52')]['id']},'include':[{'model':db[_0xc7ed('0x69')],'as':'CustomFields'}]})[_0xc7ed('0x27')](handleEntityNotFound(_0x563812,null))[_0xc7ed('0x27')](function(_0x1a615e){if(_0x1a615e){_0x187910=_0x1a615e;return db[_0xc7ed('0x5d')][_0xc7ed('0x45')];}})[_0xc7ed('0x27')](function(_0x4c1594){if(_0x4c1594){var _0x478129={};var _0x3a1fc6={};_0x3a1fc6['model']=_[_0xc7ed('0x6a')](_[_0xc7ed('0x33')](_0x4c1594),_[_0xc7ed('0x31')](_0x187910[_0xc7ed('0x6b')],function(_0x27594f){return util['format']('cf_%d',_0x27594f['id']);}));_0x3a1fc6[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x1be8fe[_0xc7ed('0x36')]);_0x3a1fc6[_0xc7ed('0x34')]=_[_0xc7ed('0x46')](_0x3a1fc6[_0xc7ed('0x35')],_0x3a1fc6['query']);_0x478129[_0xc7ed('0x37')]=_[_0xc7ed('0x46')](_0x3a1fc6[_0xc7ed('0x35')],qs[_0xc7ed('0x55')](_0x1be8fe[_0xc7ed('0x36')][_0xc7ed('0x55')]));_0x478129[_0xc7ed('0x37')]=_0x478129[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x478129[_0xc7ed('0x37')]:_0x3a1fc6[_0xc7ed('0x35')];if(!_0x1be8fe[_0xc7ed('0x36')][_0xc7ed('0x56')](_0xc7ed('0x6c'))){_0x478129[_0xc7ed('0x22')]=qs[_0xc7ed('0x22')](_0x1be8fe[_0xc7ed('0x36')]['limit']);_0x478129[_0xc7ed('0x20')]=qs[_0xc7ed('0x20')](_0x1be8fe[_0xc7ed('0x36')][_0xc7ed('0x20')]);}_0x478129['order']=qs['sort'](_0x1be8fe[_0xc7ed('0x36')][_0xc7ed('0x3a')]);_0x478129[_0xc7ed('0x3b')]=qs[_0xc7ed('0x34')](_[_0xc7ed('0x3c')](_0x1be8fe[_0xc7ed('0x36')],_0x3a1fc6[_0xc7ed('0x34')]));_0x478129['raw']=!![];if(_0x1be8fe[_0xc7ed('0x36')][_0xc7ed('0x3f')]){_0x478129['where']=_[_0xc7ed('0x3d')](_0x478129[_0xc7ed('0x3b')],{'$or':_[_0xc7ed('0x31')](_0x478129['attributes'],function(_0x5c5a29){var _0x68115={};_0x68115[_0x5c5a29]={'$like':'%'+_0x1be8fe['query']['filter']+'%'};return _0x68115;})});}_0x478129=_['merge']({},_0x478129,_0x1be8fe['options']);return _0x187910[_0xc7ed('0x68')](_0x478129);}})[_0xc7ed('0x27')](respondWithResult(_0x563812,null))[_0xc7ed('0x43')](handleError(_0x563812,null));};exports[_0xc7ed('0x6d')]=function(_0x893743,_0x16003c,_0xc58344){var _0x3ec8cf;return db['CmList'][_0xc7ed('0x48')]({'where':{'id':_0x893743[_0xc7ed('0x52')]['id']},'include':[{'model':db[_0xc7ed('0x69')],'as':_0xc7ed('0x6b')}]})[_0xc7ed('0x27')](handleEntityNotFound(_0x16003c,null))[_0xc7ed('0x27')](function(_0x926488){if(_0x926488){_0x3ec8cf=_0x926488;return db[_0xc7ed('0x5d')][_0xc7ed('0x45')];}})[_0xc7ed('0x27')](function(_0x229d8f){if(_0x229d8f){var _0x1a8da9={};var _0x434f3f={};_0x434f3f[_0xc7ed('0x35')]=_[_0xc7ed('0x6a')](_[_0xc7ed('0x33')](_0x229d8f),_[_0xc7ed('0x31')](_0x3ec8cf[_0xc7ed('0x6b')],function(_0x399d04){return util[_0xc7ed('0x6e')]('cf_%d',_0x399d04['id']);}));_0x434f3f[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x893743[_0xc7ed('0x36')]);_0x434f3f[_0xc7ed('0x34')]=_[_0xc7ed('0x46')](_0x434f3f['model'],_0x434f3f[_0xc7ed('0x36')]);_0x1a8da9[_0xc7ed('0x37')]=_[_0xc7ed('0x46')](_0x434f3f[_0xc7ed('0x35')],qs[_0xc7ed('0x55')](_0x893743[_0xc7ed('0x36')][_0xc7ed('0x55')]));_0x1a8da9[_0xc7ed('0x37')]=_0x1a8da9[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x1a8da9[_0xc7ed('0x37')]:_0x434f3f[_0xc7ed('0x35')];if(!_0x893743[_0xc7ed('0x36')]['hasOwnProperty']('nolimit')){_0x1a8da9[_0xc7ed('0x22')]=qs[_0xc7ed('0x22')](_0x893743[_0xc7ed('0x36')]['limit']);_0x1a8da9['offset']=qs[_0xc7ed('0x20')](_0x893743[_0xc7ed('0x36')]['offset']);}_0x1a8da9['order']=qs[_0xc7ed('0x3a')](_0x893743[_0xc7ed('0x36')][_0xc7ed('0x3a')]);_0x1a8da9['where']=qs[_0xc7ed('0x34')](_[_0xc7ed('0x3c')](_0x893743[_0xc7ed('0x36')],_0x434f3f[_0xc7ed('0x34')]));_0x1a8da9['raw']=!![];if(_0x893743['query']['filter']){_0x1a8da9[_0xc7ed('0x3b')]=_[_0xc7ed('0x3d')](_0x1a8da9[_0xc7ed('0x3b')],{'$or':_[_0xc7ed('0x31')](_0x1a8da9[_0xc7ed('0x37')],function(_0x2eb441){var _0x543338={};_0x543338[_0x2eb441]={'$like':'%'+_0x893743[_0xc7ed('0x36')][_0xc7ed('0x3f')]+'%'};return _0x543338;})});}_0x1a8da9=_[_0xc7ed('0x3d')]({},_0x1a8da9,_0x893743[_0xc7ed('0x40')]);return _0x3ec8cf[_0xc7ed('0x68')](_0x1a8da9);}})[_0xc7ed('0x27')](function(_0x298ba1){if(!_['isEmpty'](_0x298ba1)){var _0x1220c0=toCsv(_0x298ba1);var _0x29f615=Date['now']();fs[_0xc7ed('0x6f')](util[_0xc7ed('0x6e')](_0xc7ed('0x70'),_0x3ec8cf['id'],_0x29f615),_0x1220c0);_0x16003c[_0xc7ed('0x71')](_0xc7ed('0x72'),_0xc7ed('0x73')+util[_0xc7ed('0x6e')](_0xc7ed('0x74'),_0x3ec8cf['id'],_0x29f615));_0x16003c[_0xc7ed('0x71')]('Content-type',_0xc7ed('0x75'));return _0x16003c[_0xc7ed('0x76')](util[_0xc7ed('0x6e')]('/tmp/list_%d_%s.csv',_0x3ec8cf['id'],_0x29f615));}else{return _0x16003c[_0xc7ed('0x1c')](0xcc);}})[_0xc7ed('0x43')](handleError(_0x16003c,null));};exports[_0xc7ed('0x77')]=function(_0x99e578,_0x36809c,_0x445ecf){var _0x446df8;delete _0x99e578[_0xc7ed('0x4a')]['id'];return db[_0xc7ed('0x41')][_0xc7ed('0x54')]({'where':{'id':_0x99e578[_0xc7ed('0x52')]['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0x36809c,null))['then'](function(_0x1d8837){if(_0x1d8837){return db[_0xc7ed('0x78')]['transaction'](function(_0x42de38){return db[_0xc7ed('0x69')][_0xc7ed('0x49')](_0x99e578['body'],{'transaction':_0x42de38})[_0xc7ed('0x27')](function(_0x427fe3){_0x446df8=_0x427fe3;return _0x1d8837[_0xc7ed('0x79')](_0x427fe3,{'transaction':_0x42de38});})['then'](function(){var _0xf29db2={'type':db['Sequelize']['TEXT'],'transaction':_0x42de38};switch(_0x99e578['body']['type']){case _0xc7ed('0x7a'):_0xf29db2[_0xc7ed('0x3e')]=db[_0xc7ed('0x7b')]['TEXT'];break;case'number':_0xf29db2[_0xc7ed('0x3e')]=db[_0xc7ed('0x7b')][_0xc7ed('0x7c')];break;case _0xc7ed('0x7d'):_0xf29db2[_0xc7ed('0x3e')]=db[_0xc7ed('0x7b')][_0xc7ed('0x7e')];_0xf29db2[_0xc7ed('0x7f')]=![];break;default:}return db['sequelize'][_0xc7ed('0x80')][_0xc7ed('0x81')](_0xc7ed('0x82'),util[_0xc7ed('0x6e')](_0xc7ed('0x83'),_0x446df8['id']),_0xf29db2);})['then'](function(){return _0x446df8;});});}})[_0xc7ed('0x27')](respondWithResult(_0x36809c,null))[_0xc7ed('0x43')](handleError(_0x36809c,null));};exports[_0xc7ed('0x84')]=function(_0x30a549,_0x149ae2,_0x3b6eb7){var _0x3bd6a7={};var _0x40d495={};var _0x4e564d;var _0xb76fec;return db[_0xc7ed('0x41')][_0xc7ed('0x54')]({'where':{'id':_0x30a549['params']['id']}})['then'](handleEntityNotFound(_0x149ae2,null))[_0xc7ed('0x27')](function(_0x2fa865){if(_0x2fa865){_0x4e564d=_0x2fa865;_0x40d495[_0xc7ed('0x35')]=_[_0xc7ed('0x33')](db['CmCustomField']['rawAttributes']);_0x40d495[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x30a549[_0xc7ed('0x36')]);_0x40d495['filters']=_[_0xc7ed('0x46')](_0x40d495['model'],_0x40d495[_0xc7ed('0x36')]);_0x3bd6a7[_0xc7ed('0x37')]=_[_0xc7ed('0x46')](_0x40d495['model'],qs[_0xc7ed('0x55')](_0x30a549[_0xc7ed('0x36')][_0xc7ed('0x55')]));_0x3bd6a7[_0xc7ed('0x37')]=_0x3bd6a7[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x3bd6a7[_0xc7ed('0x37')]:_0x40d495[_0xc7ed('0x35')];_0x3bd6a7[_0xc7ed('0x39')]=qs[_0xc7ed('0x3a')](_0x30a549[_0xc7ed('0x36')]['sort']);_0x3bd6a7['where']=qs[_0xc7ed('0x34')](_[_0xc7ed('0x3c')](_0x30a549['query'],_0x40d495[_0xc7ed('0x34')]));_0x3bd6a7['where']=_[_0xc7ed('0x3d')](_0x3bd6a7[_0xc7ed('0x3b')],{'$or':[{'ListId':_0x2fa865['id']},{'ListId':null}]});if(_0x30a549[_0xc7ed('0x36')][_0xc7ed('0x3f')]){_0x3bd6a7[_0xc7ed('0x3b')]=_[_0xc7ed('0x3d')](_0x3bd6a7[_0xc7ed('0x3b')],{'$or':_[_0xc7ed('0x31')](_0x3bd6a7[_0xc7ed('0x37')],function(_0x3ed861){var _0x3962aa={};_0x3962aa[_0x3ed861]={'$like':'%'+_0x30a549[_0xc7ed('0x36')]['filter']+'%'};return _0x3962aa;})});}_0x3bd6a7=_[_0xc7ed('0x3d')]({},_0x3bd6a7,_0x30a549[_0xc7ed('0x40')]);return db['CmCustomField'][_0xc7ed('0x85')](_0x3bd6a7);}})[_0xc7ed('0x27')](respondWithResult(_0x149ae2,null))[_0xc7ed('0x43')](handleError(_0x149ae2,null));};exports[_0xc7ed('0x86')]=function(_0x2281aa,_0x54a967,_0x3d2217){return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x2281aa['params']['id']}})['then'](handleEntityNotFound(_0x54a967,null))['then'](function(_0x463a90){if(_0x463a90){return _0x463a90[_0xc7ed('0x86')](_0x2281aa[_0xc7ed('0x4a')][_0xc7ed('0x5b')],_['omit'](_0x2281aa['body'],[_0xc7ed('0x5b'),'id'])||{})['spread'](function(_0x55210a){for(var _0x1a6cd3=0x0;_0x1a6cd3<_0x2281aa[_0xc7ed('0x4a')]['ids']['length'];_0x1a6cd3+=0x1){socket[_0xc7ed('0x87')](_0xc7ed('0x88'),{'UserId':Number(_0x2281aa[_0xc7ed('0x4a')][_0xc7ed('0x5b')][_0x1a6cd3]),'CmListId':Number(_0x2281aa[_0xc7ed('0x52')]['id'])});}return _0x55210a;});}})['then'](respondWithResult(_0x54a967,null))[_0xc7ed('0x43')](handleError(_0x54a967,null));};exports['removeAgents']=function(_0x269a0f,_0xb14c58,_0x2ce706){return db[_0xc7ed('0x41')][_0xc7ed('0x48')]({'where':{'id':_0x269a0f[_0xc7ed('0x52')]['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0xb14c58,null))[_0xc7ed('0x27')](function(_0x563938){if(_0x563938){return _0x563938[_0xc7ed('0x89')](_0x269a0f[_0xc7ed('0x36')][_0xc7ed('0x5b')])[_0xc7ed('0x27')](function(){if(_['isArray'](_0x269a0f[_0xc7ed('0x36')]['ids'])){for(var _0x420c65=0x0;_0x420c65<_0x269a0f['query']['ids'][_0xc7ed('0x38')];_0x420c65+=0x1){socket[_0xc7ed('0x87')](_0xc7ed('0x8a'),{'UserId':Number(_0x269a0f['query'][_0xc7ed('0x5b')][_0x420c65]),'CmListId':Number(_0x269a0f[_0xc7ed('0x52')]['id'])});}}else{socket[_0xc7ed('0x87')](_0xc7ed('0x8a'),{'UserId':Number(_0x269a0f['query']['ids']),'CmListId':Number(_0x269a0f[_0xc7ed('0x52')]['id'])});}});}})[_0xc7ed('0x27')](respondWithStatusCode(_0xb14c58,null))['catch'](handleError(_0xb14c58,null));};exports[_0xc7ed('0x8b')]=function(_0x43f202,_0xca2db5,_0x1f7401){var _0x8d593e={};var _0x493ffe={};var _0x44bd34;var _0x55a727;return db[_0xc7ed('0x41')]['findOne']({'where':{'id':_0x43f202['params']['id']}})[_0xc7ed('0x27')](handleEntityNotFound(_0xca2db5,null))[_0xc7ed('0x27')](function(_0x1722e9){if(_0x1722e9){_0x44bd34=_0x1722e9;_0x493ffe[_0xc7ed('0x35')]=_[_0xc7ed('0x33')](db[_0xc7ed('0x8c')][_0xc7ed('0x45')]);_0x493ffe[_0xc7ed('0x36')]=_[_0xc7ed('0x33')](_0x43f202[_0xc7ed('0x36')]);_0x493ffe['filters']=_[_0xc7ed('0x46')](_0x493ffe[_0xc7ed('0x35')],_0x493ffe['query']);_0x8d593e[_0xc7ed('0x37')]=_[_0xc7ed('0x46')](_0x493ffe[_0xc7ed('0x35')],qs[_0xc7ed('0x55')](_0x43f202['query']['fields']));_0x8d593e[_0xc7ed('0x37')]=_0x8d593e[_0xc7ed('0x37')][_0xc7ed('0x38')]?_0x8d593e[_0xc7ed('0x37')]:_0x493ffe[_0xc7ed('0x35')];_0x8d593e['order']=qs[_0xc7ed('0x3a')](_0x43f202[_0xc7ed('0x36')][_0xc7ed('0x3a')]);_0x8d593e[_0xc7ed('0x3b')]=qs['filters'](_[_0xc7ed('0x3c')](_0x43f202[_0xc7ed('0x36')],_0x493ffe[_0xc7ed('0x34')]));if(_0x43f202['query'][_0xc7ed('0x3f')]){_0x8d593e[_0xc7ed('0x3b')]=_['merge'](_0x8d593e['where'],{'$or':_[_0xc7ed('0x31')](_0x8d593e[_0xc7ed('0x37')],function(_0x5f5cce){var _0x401319={};_0x401319[_0x5f5cce]={'$like':'%'+_0x43f202['query'][_0xc7ed('0x3f')]+'%'};return _0x401319;})});}_0x8d593e=_[_0xc7ed('0x3d')]({},_0x8d593e,_0x43f202[_0xc7ed('0x40')]);return _0x44bd34[_0xc7ed('0x8b')](_0x8d593e);}})[_0xc7ed('0x27')](function(_0x1e7b03){if(_0x1e7b03){_0x55a727=_0x1e7b03['length'];if(!_0x43f202[_0xc7ed('0x36')][_0xc7ed('0x56')](_0xc7ed('0x6c'))){_0x8d593e['limit']=qs[_0xc7ed('0x22')](_0x43f202[_0xc7ed('0x36')]['limit']);_0x8d593e['offset']=qs[_0xc7ed('0x20')](_0x43f202[_0xc7ed('0x36')]['offset']);}return _0x44bd34['getAgents'](_0x8d593e);}})[_0xc7ed('0x27')](function(_0x3b3899){if(_0x3b3899){return _0x3b3899?{'count':_0x55a727,'rows':_0x3b3899}:null;}})[_0xc7ed('0x27')](respondWithResult(_0xca2db5,null))[_0xc7ed('0x43')](handleError(_0xca2db5,null));}; \ No newline at end of file +var _0x3352=['query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','ListId','Disposition','findOne','nolimit','pick','removeDispositions','ids','addContacts','CmContact','describe','tags','isArray','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomFields','Sequelize','TEXT','text','number','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model'];(function(_0x381e4e,_0x4d46c6){var _0x52fc95=function(_0x435846){while(--_0x435846){_0x381e4e['push'](_0x381e4e['shift']());}};_0x52fc95(++_0x4d46c6);}(_0x3352,0x185));var _0x2335=function(_0x27c011,_0x234899){_0x27c011=_0x27c011-0x0;var _0x4b210c=_0x3352[_0x27c011];return _0x4b210c;};'use strict';var emlformat=require(_0x2335('0x0'));var rimraf=require(_0x2335('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2335('0x2'));var rp=require(_0x2335('0x3'));var moment=require(_0x2335('0x4'));var BPromise=require(_0x2335('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2335('0x6'));var sox=require('sox');var csv=require(_0x2335('0x7'));var ejs=require(_0x2335('0x8'));var fs=require('fs');var fs_extra=require(_0x2335('0x9'));var _=require(_0x2335('0xa'));var squel=require('squel');var crypto=require(_0x2335('0xb'));var jsforce=require(_0x2335('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2335('0xd'));var Papa=require(_0x2335('0xe'));var Redis=require(_0x2335('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2335('0x10'));var hardwareService=require(_0x2335('0x11'));var logger=require(_0x2335('0x12'))(_0x2335('0x13'));var utils=require(_0x2335('0x14'));var config=require(_0x2335('0x15'));var licenseUtil=require(_0x2335('0x16'));var db=require('../../mysqldb')['db'];config[_0x2335('0x17')]=_[_0x2335('0x18')](config[_0x2335('0x17')],{'host':_0x2335('0x19'),'port':0x18eb});var socket=require(_0x2335('0x1a'))(new Redis(config[_0x2335('0x17')]));require('./cmList.socket')[_0x2335('0x1b')](socket);function respondWithStatusCode(_0x32e079,_0x280d22){_0x280d22=_0x280d22||0xcc;return function(_0x1ed897){if(_0x1ed897){return _0x32e079['sendStatus'](_0x280d22);}return _0x32e079[_0x2335('0x1c')](_0x280d22)[_0x2335('0x1d')]();};}function respondWithResult(_0x5d7f10,_0x300f68){_0x300f68=_0x300f68||0xc8;return function(_0x191162){if(_0x191162){return _0x5d7f10[_0x2335('0x1c')](_0x300f68)[_0x2335('0x1e')](_0x191162);}};}function respondWithFilteredResult(_0x51e450,_0x3f8acd){return function(_0x308e6c){if(_0x308e6c){var _0x1f183e=typeof _0x3f8acd[_0x2335('0x1f')]===_0x2335('0x20')&&typeof _0x3f8acd[_0x2335('0x21')]===_0x2335('0x20');var _0x47ac69=_0x308e6c['count'];var _0x398382=_0x1f183e?0x0:_0x3f8acd[_0x2335('0x1f')];var _0x4d38d1=_0x1f183e?_0x308e6c[_0x2335('0x22')]:_0x3f8acd[_0x2335('0x1f')]+_0x3f8acd[_0x2335('0x21')];var _0x3d4a4e;if(_0x4d38d1>=_0x47ac69){_0x4d38d1=_0x47ac69;_0x3d4a4e=0xc8;}else{_0x3d4a4e=0xce;}_0x51e450[_0x2335('0x1c')](_0x3d4a4e);return _0x51e450[_0x2335('0x23')]('Content-Range',_0x398382+'-'+_0x4d38d1+'/'+_0x47ac69)[_0x2335('0x1e')](_0x308e6c);}return null;};}function patchUpdates(_0x4f7294){return function(_0x438001){try{jsonpatch[_0x2335('0x24')](_0x438001,_0x4f7294,!![]);}catch(_0x32da22){return BPromise[_0x2335('0x25')](_0x32da22);}return _0x438001[_0x2335('0x26')]();};}function saveUpdates(_0x3bd1ff,_0xe4b264){return function(_0x553e34){if(_0x553e34){return _0x553e34[_0x2335('0x27')](_0x3bd1ff)[_0x2335('0x28')](function(_0x43f9ec){return _0x43f9ec;});}return null;};}function removeEntity(_0x5ceba6,_0x463a3a){return function(_0x41dc7e){if(_0x41dc7e){return _0x41dc7e['destroy']()[_0x2335('0x28')](function(){var _0x211018=_0x41dc7e[_0x2335('0x29')]({'plain':!![]});var _0x5e60b6=_0x2335('0x2a');return db[_0x2335('0x2b')][_0x2335('0x2c')]({'where':{'type':_0x5e60b6,'resourceId':_0x211018['id']}})[_0x2335('0x28')](function(){return _0x41dc7e;});})[_0x2335('0x28')](function(){_0x5ceba6['status'](0xcc)[_0x2335('0x1d')]();});}};}function handleEntityNotFound(_0x233ed6,_0x46a917){return function(_0x8dfe0){if(!_0x8dfe0){_0x233ed6[_0x2335('0x2d')](0x194);}return _0x8dfe0;};}function handleError(_0x14a6f6,_0x44c4c2){_0x44c4c2=_0x44c4c2||0x1f4;return function(_0x493097){logger[_0x2335('0x2e')](_0x493097[_0x2335('0x2f')]);if(_0x493097[_0x2335('0x30')]){delete _0x493097['name'];}_0x14a6f6[_0x2335('0x1c')](_0x44c4c2)[_0x2335('0x31')](_0x493097);};}exports[_0x2335('0x32')]=function(_0x33ecc9,_0x4fb1f6){var _0x3d3cd2={},_0x2d3111={},_0x67520f={'count':0x0,'rows':[]};var _0x244d22=_[_0x2335('0x33')](db[_0x2335('0x34')][_0x2335('0x35')],function(_0x121ee1){return{'name':_0x121ee1[_0x2335('0x36')],'type':_0x121ee1[_0x2335('0x37')][_0x2335('0x38')]};});_0x2d3111[_0x2335('0x39')]=_[_0x2335('0x33')](_0x244d22,'name');_0x2d3111[_0x2335('0x3a')]=_['keys'](_0x33ecc9[_0x2335('0x3a')]);_0x2d3111['filters']=_[_0x2335('0x3b')](_0x2d3111[_0x2335('0x39')],_0x2d3111[_0x2335('0x3a')]);_0x3d3cd2[_0x2335('0x3c')]=_[_0x2335('0x3b')](_0x2d3111[_0x2335('0x39')],qs[_0x2335('0x3d')](_0x33ecc9[_0x2335('0x3a')][_0x2335('0x3d')]));_0x3d3cd2[_0x2335('0x3c')]=_0x3d3cd2[_0x2335('0x3c')][_0x2335('0x3e')]?_0x3d3cd2[_0x2335('0x3c')]:_0x2d3111[_0x2335('0x39')];if(!_0x33ecc9[_0x2335('0x3a')][_0x2335('0x3f')]('nolimit')){_0x3d3cd2[_0x2335('0x21')]=qs[_0x2335('0x21')](_0x33ecc9[_0x2335('0x3a')]['limit']);_0x3d3cd2[_0x2335('0x1f')]=qs[_0x2335('0x1f')](_0x33ecc9[_0x2335('0x3a')][_0x2335('0x1f')]);}_0x3d3cd2[_0x2335('0x40')]=qs['sort'](_0x33ecc9[_0x2335('0x3a')][_0x2335('0x41')]);_0x3d3cd2[_0x2335('0x42')]=qs[_0x2335('0x43')](_['pick'](_0x33ecc9[_0x2335('0x3a')],_0x2d3111[_0x2335('0x43')]),_0x244d22);if(_0x33ecc9['query'][_0x2335('0x44')]){_0x3d3cd2[_0x2335('0x42')]=_[_0x2335('0x45')](_0x3d3cd2[_0x2335('0x42')],{'$or':_['map'](_0x244d22,function(_0x273df6){if(_0x273df6['type']!==_0x2335('0x46')){var _0x4177ae={};_0x4177ae[_0x273df6['name']]={'$like':'%'+_0x33ecc9[_0x2335('0x3a')][_0x2335('0x44')]+'%'};return _0x4177ae;}})});}_0x3d3cd2=_['merge']({},_0x3d3cd2,_0x33ecc9[_0x2335('0x47')]);var _0x1cabcf={'where':_0x3d3cd2[_0x2335('0x42')]};return db[_0x2335('0x34')][_0x2335('0x22')](_0x1cabcf)[_0x2335('0x28')](function(_0x24d122){_0x67520f[_0x2335('0x22')]=_0x24d122;if(_0x33ecc9['query']['includeAll']){_0x3d3cd2[_0x2335('0x48')]=[{'all':!![]}];}return db[_0x2335('0x34')][_0x2335('0x49')](_0x3d3cd2);})['then'](function(_0xe18e29){_0x67520f[_0x2335('0x4a')]=_0xe18e29;return _0x67520f;})[_0x2335('0x28')](respondWithFilteredResult(_0x4fb1f6,_0x3d3cd2))['catch'](handleError(_0x4fb1f6,null));};exports['show']=function(_0x300e22,_0x5c2bbb){var _0x59cac4={'raw':![],'where':{'id':_0x300e22['params']['id']}},_0x561820={};_0x561820['model']=_[_0x2335('0x4b')](db['CmList'][_0x2335('0x35')]);_0x561820[_0x2335('0x3a')]=_['keys'](_0x300e22[_0x2335('0x3a')]);_0x561820[_0x2335('0x43')]=_[_0x2335('0x3b')](_0x561820[_0x2335('0x39')],_0x561820['query']);_0x59cac4['attributes']=_[_0x2335('0x3b')](_0x561820[_0x2335('0x39')],qs[_0x2335('0x3d')](_0x300e22[_0x2335('0x3a')][_0x2335('0x3d')]));_0x59cac4['attributes']=_0x59cac4[_0x2335('0x3c')][_0x2335('0x3e')]?_0x59cac4[_0x2335('0x3c')]:_0x561820[_0x2335('0x39')];if(_0x300e22[_0x2335('0x3a')][_0x2335('0x4c')]){_0x59cac4[_0x2335('0x48')]=[{'all':!![]}];}_0x59cac4=_[_0x2335('0x45')]({},_0x59cac4,_0x300e22[_0x2335('0x47')]);return db['CmList'][_0x2335('0x4d')](_0x59cac4)[_0x2335('0x28')](handleEntityNotFound(_0x5c2bbb,null))[_0x2335('0x28')](respondWithResult(_0x5c2bbb,null))[_0x2335('0x4e')](handleError(_0x5c2bbb,null));};exports[_0x2335('0x4f')]=function(_0xeb2f98,_0x3cf614){return db[_0x2335('0x34')]['create'](_0xeb2f98[_0x2335('0x50')],{})[_0x2335('0x28')](function(_0x18ed8e){var _0x49838f=_0xeb2f98[_0x2335('0x51')][_0x2335('0x29')]({'plain':!![]});if(!_0x49838f)throw new Error(_0x2335('0x52'));if(_0x49838f[_0x2335('0x53')]===_0x2335('0x51')){var _0x29b68f=_0x18ed8e[_0x2335('0x29')]({'plain':!![]});var _0xb852b9=_0x2335('0x2a');return db[_0x2335('0x54')]['find']({'where':{'name':_0xb852b9,'userProfileId':_0x49838f[_0x2335('0x55')]},'raw':!![]})[_0x2335('0x28')](function(_0x4c8755){if(_0x4c8755&&_0x4c8755['autoAssociation']===0x0){return db['UserProfileResource'][_0x2335('0x4f')]({'name':_0x29b68f[_0x2335('0x30')],'resourceId':_0x29b68f['id'],'type':_0x4c8755[_0x2335('0x30')],'sectionId':_0x4c8755['id']},{})[_0x2335('0x28')](function(){return _0x18ed8e;});}else{return _0x18ed8e;}})[_0x2335('0x4e')](function(_0x3197e2){logger[_0x2335('0x2e')](_0x2335('0x56'),_0x3197e2);throw _0x3197e2;});}return _0x18ed8e;})[_0x2335('0x28')](respondWithResult(_0x3cf614,0xc9))[_0x2335('0x4e')](handleError(_0x3cf614,null));};exports[_0x2335('0x27')]=function(_0x39587e,_0x3f5b36){if(_0x39587e[_0x2335('0x50')]['id']){delete _0x39587e['body']['id'];}return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x39587e[_0x2335('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f5b36,null))['then'](saveUpdates(_0x39587e[_0x2335('0x50')],null))['then'](respondWithResult(_0x3f5b36,null))[_0x2335('0x4e')](handleError(_0x3f5b36,null));};exports[_0x2335('0x2c')]=function(_0x51c6ed,_0x33a25f){return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x51c6ed[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x33a25f,null))[_0x2335('0x28')](removeEntity(_0x33a25f,null))[_0x2335('0x4e')](handleError(_0x33a25f,null));};exports['describe']=function(_0x221e1f,_0x27e9b3){return db['CmList']['describe']()[_0x2335('0x28')](respondWithResult(_0x27e9b3,null))[_0x2335('0x4e')](handleError(_0x27e9b3,null));};exports[_0x2335('0x58')]=function(_0xa540b7,_0x123284,_0xcc39b0){if(_0xa540b7[_0x2335('0x50')]['id']){delete _0xa540b7[_0x2335('0x50')]['id'];}return db[_0x2335('0x34')]['find']({'where':{'id':_0xa540b7[_0x2335('0x57')]['id']}})['then'](handleEntityNotFound(_0x123284,null))[_0x2335('0x28')](function(_0x4ce0d9){if(_0x4ce0d9){_0xa540b7[_0x2335('0x50')][_0x2335('0x59')]=_0x4ce0d9['id'];return db[_0x2335('0x5a')][_0x2335('0x4f')](_0xa540b7[_0x2335('0x50')]);}})[_0x2335('0x28')](respondWithResult(_0x123284,null))[_0x2335('0x4e')](handleError(_0x123284,null));};exports['getDispositions']=function(_0x3dfa0b,_0x420842,_0x1e7554){var _0x392860={'raw':![],'where':{}};var _0x243a1d={};var _0x38061f={'count':0x0,'rows':[]};return db[_0x2335('0x34')][_0x2335('0x5b')]({'where':{'id':_0x3dfa0b[_0x2335('0x57')]['id']}})['then'](handleEntityNotFound(_0x420842,null))[_0x2335('0x28')](function(_0x3982ef){if(_0x3982ef){_0x243a1d[_0x2335('0x39')]=_[_0x2335('0x4b')](db[_0x2335('0x5a')][_0x2335('0x35')]);_0x243a1d[_0x2335('0x3a')]=_['keys'](_0x3dfa0b[_0x2335('0x3a')]);_0x243a1d['filters']=_[_0x2335('0x3b')](_0x243a1d[_0x2335('0x39')],_0x243a1d['query']);_0x392860['attributes']=_[_0x2335('0x3b')](_0x243a1d[_0x2335('0x39')],qs['fields'](_0x3dfa0b['query'][_0x2335('0x3d')]));_0x392860['attributes']=_0x392860[_0x2335('0x3c')][_0x2335('0x3e')]?_0x392860[_0x2335('0x3c')]:_0x243a1d['model'];if(!_0x3dfa0b[_0x2335('0x3a')][_0x2335('0x3f')](_0x2335('0x5c'))){_0x392860[_0x2335('0x21')]=qs[_0x2335('0x21')](_0x3dfa0b[_0x2335('0x3a')]['limit']);_0x392860['offset']=qs[_0x2335('0x1f')](_0x3dfa0b[_0x2335('0x3a')]['offset']);}_0x392860[_0x2335('0x40')]=qs[_0x2335('0x41')](_0x3dfa0b[_0x2335('0x3a')][_0x2335('0x41')]);_0x392860[_0x2335('0x42')]=qs[_0x2335('0x43')](_[_0x2335('0x5d')](_0x3dfa0b['query'],_0x243a1d['filters']));_0x392860[_0x2335('0x42')]['ListId']=_0x3982ef['id'];if(_0x3dfa0b[_0x2335('0x3a')]['filter']){_0x392860[_0x2335('0x42')]=_[_0x2335('0x45')](_0x392860[_0x2335('0x42')],{'$or':_[_0x2335('0x33')](_0x392860[_0x2335('0x3c')],function(_0x4695e5){var _0x42bcb6={};_0x42bcb6[_0x4695e5]={'$like':'%'+_0x3dfa0b[_0x2335('0x3a')][_0x2335('0x44')]+'%'};return _0x42bcb6;})});}_0x392860=_[_0x2335('0x45')]({},_0x392860,_0x3dfa0b[_0x2335('0x47')]);return db[_0x2335('0x5a')][_0x2335('0x22')]({'where':_0x392860[_0x2335('0x42')]})[_0x2335('0x28')](function(_0x52b51e){_0x38061f[_0x2335('0x22')]=_0x52b51e;if(_0x3dfa0b[_0x2335('0x3a')][_0x2335('0x4c')]){_0x392860[_0x2335('0x48')]=[{'all':!![]}];}return db[_0x2335('0x5a')][_0x2335('0x49')](_0x392860);})[_0x2335('0x28')](function(_0x25254d){_0x38061f['rows']=_0x25254d;return _0x38061f;});}})['then'](respondWithFilteredResult(_0x420842,_0x392860))[_0x2335('0x4e')](handleError(_0x420842,null));};exports[_0x2335('0x5e')]=function(_0x3e0a3c,_0x2fd5e5,_0x30bcd5){return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x3e0a3c[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x2fd5e5,null))[_0x2335('0x28')](function(_0x56a06d){if(_0x56a06d){return _0x56a06d[_0x2335('0x5e')](_0x3e0a3c[_0x2335('0x3a')][_0x2335('0x5f')]);}})[_0x2335('0x28')](respondWithStatusCode(_0x2fd5e5,null))['catch'](handleError(_0x2fd5e5,null));};exports[_0x2335('0x60')]=function(_0x42380d,_0x5b8704,_0x44b9c7){return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x42380d['params']['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x5b8704,null))[_0x2335('0x28')](function(_0x4fc378){if(_0x4fc378){var _0x53df8c=[];var _0x31e544={'success':[],'errors':[]};return db[_0x2335('0x61')][_0x2335('0x62')]()[_0x2335('0x28')](function(_0x583f4a){if(_0x42380d[_0x2335('0x50')][_0x2335('0x63')]&&_[_0x2335('0x64')](_0x42380d[_0x2335('0x50')][_0x2335('0x63')])){if(_0x42380d['body'][_0x2335('0x63')]['length']){_0x42380d['body'][_0x2335('0x63')]=_0x42380d[_0x2335('0x50')][_0x2335('0x63')][_0x2335('0x65')](';')+';';}else{_0x42380d[_0x2335('0x50')][_0x2335('0x63')]=null;}}else{_0x42380d[_0x2335('0x50')][_0x2335('0x63')]=null;}if(_0x42380d[_0x2335('0x50')]&&_[_0x2335('0x64')](_0x42380d[_0x2335('0x50')])){for(var _0x2f9b20=0x0;_0x2f9b20<_0x42380d[_0x2335('0x50')][_0x2335('0x3e')];_0x2f9b20+=0x1){_0x42380d[_0x2335('0x50')][_0x2f9b20][_0x2335('0x59')]=_0x42380d[_0x2335('0x57')]['id'];_0x53df8c['push'](_0x42380d['body'][_0x2f9b20]);}return BPromise[_0x2335('0x66')](_0x53df8c,function(_0x2dcf41){return db['CmContact'][_0x2335('0x4f')](_[_0x2335('0x67')](_0x2dcf41,[_0x2335('0x5f'),'id'])||{},{'fields':_[_0x2335('0x4b')](_0x583f4a),'raw':!![]})[_0x2335('0x28')](function(_0x288eeb){_0x31e544[_0x2335('0x68')][_0x2335('0x69')](_0x288eeb[_0x2335('0x6a')]);})['catch'](function(_0x196e37){_0x31e544[_0x2335('0x6b')][_0x2335('0x69')]({'data':_0x2dcf41,'error':_0x196e37[_0x2335('0x6c')]});});})['then'](function(_0x7948fc){return _0x31e544;})['catch'](function(_0xcfb283){return _0xcfb283;});}else{_0x5b8704['status'](0x190)[_0x2335('0x1e')]({'message':_0x2335('0x6d')});}});}})[_0x2335('0x28')](respondWithResult(_0x5b8704,null))['catch'](handleError(_0x5b8704,null));};exports[_0x2335('0x6e')]=function(_0x1ee6ec,_0x4263e9,_0x103315){var _0x5cd8f9;return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x1ee6ec['params']['id']},'include':[{'model':db[_0x2335('0x6f')],'as':_0x2335('0x70')}]})[_0x2335('0x28')](handleEntityNotFound(_0x4263e9,null))[_0x2335('0x28')](function(_0x10d68c){if(_0x10d68c){_0x5cd8f9=_0x10d68c;return db[_0x2335('0x61')]['rawAttributes'];}})['then'](function(_0x487fda){if(_0x487fda){var _0x497aa4={};var _0x28e71d={};_0x28e71d[_0x2335('0x39')]=_[_0x2335('0x71')](_[_0x2335('0x4b')](_0x487fda),_[_0x2335('0x33')](_0x5cd8f9[_0x2335('0x70')],function(_0x5b6b04){return util[_0x2335('0x72')](_0x2335('0x73'),_0x5b6b04['id']);}));_0x28e71d[_0x2335('0x3a')]=_[_0x2335('0x4b')](_0x1ee6ec[_0x2335('0x3a')]);_0x28e71d['filters']=_[_0x2335('0x3b')](_0x28e71d[_0x2335('0x39')],_0x28e71d[_0x2335('0x3a')]);_0x497aa4[_0x2335('0x3c')]=_[_0x2335('0x3b')](_0x28e71d[_0x2335('0x39')],qs[_0x2335('0x3d')](_0x1ee6ec[_0x2335('0x3a')][_0x2335('0x3d')]));_0x497aa4['attributes']=_0x497aa4[_0x2335('0x3c')][_0x2335('0x3e')]?_0x497aa4[_0x2335('0x3c')]:_0x28e71d['model'];if(!_0x1ee6ec['query']['hasOwnProperty']('nolimit')){_0x497aa4[_0x2335('0x21')]=qs[_0x2335('0x21')](_0x1ee6ec[_0x2335('0x3a')]['limit']);_0x497aa4[_0x2335('0x1f')]=qs[_0x2335('0x1f')](_0x1ee6ec['query'][_0x2335('0x1f')]);}_0x497aa4['order']=qs[_0x2335('0x41')](_0x1ee6ec[_0x2335('0x3a')]['sort']);_0x497aa4['where']=qs[_0x2335('0x43')](_[_0x2335('0x5d')](_0x1ee6ec[_0x2335('0x3a')],_0x28e71d[_0x2335('0x43')]));_0x497aa4[_0x2335('0x74')]=!![];if(_0x1ee6ec[_0x2335('0x3a')][_0x2335('0x44')]){_0x497aa4[_0x2335('0x42')]=_[_0x2335('0x45')](_0x497aa4[_0x2335('0x42')],{'$or':_[_0x2335('0x33')](_0x497aa4[_0x2335('0x3c')],function(_0x3c4a3e){var _0x17fe77={};_0x17fe77[_0x3c4a3e]={'$like':'%'+_0x1ee6ec[_0x2335('0x3a')][_0x2335('0x44')]+'%'};return _0x17fe77;})});}_0x497aa4=_[_0x2335('0x45')]({},_0x497aa4,_0x1ee6ec[_0x2335('0x47')]);return _0x5cd8f9[_0x2335('0x6e')](_0x497aa4);}})[_0x2335('0x28')](respondWithResult(_0x4263e9,null))[_0x2335('0x4e')](handleError(_0x4263e9,null));};exports[_0x2335('0x75')]=function(_0x244ee7,_0x2df094,_0x2b394f){var _0x5e221f;return db[_0x2335('0x34')]['find']({'where':{'id':_0x244ee7[_0x2335('0x57')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x2335('0x70')}]})['then'](handleEntityNotFound(_0x2df094,null))[_0x2335('0x28')](function(_0x420821){if(_0x420821){_0x5e221f=_0x420821;return db['CmContact'][_0x2335('0x35')];}})[_0x2335('0x28')](function(_0x959d6e){if(_0x959d6e){var _0x5362d5={};var _0x384e1d={};_0x384e1d['model']=_['concat'](_['keys'](_0x959d6e),_[_0x2335('0x33')](_0x5e221f['CustomFields'],function(_0xd37bcb){return util['format'](_0x2335('0x73'),_0xd37bcb['id']);}));_0x384e1d['query']=_[_0x2335('0x4b')](_0x244ee7[_0x2335('0x3a')]);_0x384e1d[_0x2335('0x43')]=_[_0x2335('0x3b')](_0x384e1d[_0x2335('0x39')],_0x384e1d[_0x2335('0x3a')]);_0x5362d5[_0x2335('0x3c')]=_[_0x2335('0x3b')](_0x384e1d['model'],qs[_0x2335('0x3d')](_0x244ee7['query']['fields']));_0x5362d5[_0x2335('0x3c')]=_0x5362d5[_0x2335('0x3c')][_0x2335('0x3e')]?_0x5362d5[_0x2335('0x3c')]:_0x384e1d[_0x2335('0x39')];if(!_0x244ee7[_0x2335('0x3a')]['hasOwnProperty'](_0x2335('0x5c'))){_0x5362d5[_0x2335('0x21')]=qs[_0x2335('0x21')](_0x244ee7[_0x2335('0x3a')][_0x2335('0x21')]);_0x5362d5[_0x2335('0x1f')]=qs[_0x2335('0x1f')](_0x244ee7[_0x2335('0x3a')]['offset']);}_0x5362d5[_0x2335('0x40')]=qs['sort'](_0x244ee7['query'][_0x2335('0x41')]);_0x5362d5['where']=qs[_0x2335('0x43')](_[_0x2335('0x5d')](_0x244ee7[_0x2335('0x3a')],_0x384e1d[_0x2335('0x43')]));_0x5362d5[_0x2335('0x74')]=!![];if(_0x244ee7[_0x2335('0x3a')][_0x2335('0x44')]){_0x5362d5[_0x2335('0x42')]=_[_0x2335('0x45')](_0x5362d5[_0x2335('0x42')],{'$or':_[_0x2335('0x33')](_0x5362d5[_0x2335('0x3c')],function(_0x17bf7b){var _0xb00e0a={};_0xb00e0a[_0x17bf7b]={'$like':'%'+_0x244ee7[_0x2335('0x3a')][_0x2335('0x44')]+'%'};return _0xb00e0a;})});}_0x5362d5=_[_0x2335('0x45')]({},_0x5362d5,_0x244ee7[_0x2335('0x47')]);return _0x5e221f['getContacts'](_0x5362d5);}})[_0x2335('0x28')](function(_0x1000c4){if(!_[_0x2335('0x76')](_0x1000c4)){var _0x5d3db7=toCsv(_0x1000c4);var _0x409211=Date[_0x2335('0x77')]();fs[_0x2335('0x78')](util[_0x2335('0x72')](_0x2335('0x79'),_0x5e221f['id'],_0x409211),_0x5d3db7);_0x2df094[_0x2335('0x7a')]('Content-disposition',_0x2335('0x7b')+util[_0x2335('0x72')](_0x2335('0x7c'),_0x5e221f['id'],_0x409211));_0x2df094[_0x2335('0x7a')](_0x2335('0x7d'),_0x2335('0x7e'));return _0x2df094[_0x2335('0x7f')](util['format'](_0x2335('0x79'),_0x5e221f['id'],_0x409211));}else{return _0x2df094[_0x2335('0x2d')](0xcc);}})[_0x2335('0x4e')](handleError(_0x2df094,null));};exports['addCustomField']=function(_0xda69e9,_0xa8336f,_0x301ff0){var _0x3ebde4;delete _0xda69e9[_0x2335('0x50')]['id'];return db['CmList']['findOne']({'where':{'id':_0xda69e9[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0xa8336f,null))['then'](function(_0x4da6ed){if(_0x4da6ed){return db['sequelize']['transaction'](function(_0x3875af){return db[_0x2335('0x6f')][_0x2335('0x4f')](_0xda69e9[_0x2335('0x50')],{'transaction':_0x3875af})[_0x2335('0x28')](function(_0x378426){_0x3ebde4=_0x378426;return _0x4da6ed[_0x2335('0x80')](_0x378426,{'transaction':_0x3875af});})[_0x2335('0x28')](function(){var _0x4a7268={'type':db[_0x2335('0x81')][_0x2335('0x82')],'transaction':_0x3875af};switch(_0xda69e9[_0x2335('0x50')][_0x2335('0x37')]){case _0x2335('0x83'):_0x4a7268[_0x2335('0x37')]=db['Sequelize'][_0x2335('0x82')];break;case _0x2335('0x84'):_0x4a7268['type']=db[_0x2335('0x81')]['INTEGER'];break;case _0x2335('0x85'):_0x4a7268[_0x2335('0x37')]=db[_0x2335('0x81')][_0x2335('0x86')];_0x4a7268['defaultValue']=![];break;default:}return db[_0x2335('0x87')][_0x2335('0x88')][_0x2335('0x89')](_0x2335('0x8a'),util[_0x2335('0x72')](_0x2335('0x8b'),_0x3ebde4['id']),_0x4a7268);})[_0x2335('0x28')](function(){return _0x3ebde4;});});}})[_0x2335('0x28')](respondWithResult(_0xa8336f,null))['catch'](handleError(_0xa8336f,null));};exports[_0x2335('0x8c')]=function(_0x1857b6,_0x19a6a9,_0x1e52b1){var _0x210a0e={};var _0x27d581={};var _0x181c30;var _0x137dda;return db[_0x2335('0x34')][_0x2335('0x5b')]({'where':{'id':_0x1857b6[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x19a6a9,null))[_0x2335('0x28')](function(_0x345a20){if(_0x345a20){_0x181c30=_0x345a20;_0x27d581['model']=_[_0x2335('0x4b')](db['CmCustomField'][_0x2335('0x35')]);_0x27d581[_0x2335('0x3a')]=_[_0x2335('0x4b')](_0x1857b6[_0x2335('0x3a')]);_0x27d581[_0x2335('0x43')]=_['intersection'](_0x27d581[_0x2335('0x39')],_0x27d581[_0x2335('0x3a')]);_0x210a0e['attributes']=_[_0x2335('0x3b')](_0x27d581[_0x2335('0x39')],qs[_0x2335('0x3d')](_0x1857b6[_0x2335('0x3a')][_0x2335('0x3d')]));_0x210a0e[_0x2335('0x3c')]=_0x210a0e['attributes'][_0x2335('0x3e')]?_0x210a0e[_0x2335('0x3c')]:_0x27d581[_0x2335('0x39')];_0x210a0e[_0x2335('0x40')]=qs[_0x2335('0x41')](_0x1857b6[_0x2335('0x3a')]['sort']);_0x210a0e[_0x2335('0x42')]=qs[_0x2335('0x43')](_[_0x2335('0x5d')](_0x1857b6['query'],_0x27d581['filters']));_0x210a0e[_0x2335('0x42')]=_[_0x2335('0x45')](_0x210a0e[_0x2335('0x42')],{'$or':[{'ListId':_0x345a20['id']},{'ListId':null}]});if(_0x1857b6[_0x2335('0x3a')][_0x2335('0x44')]){_0x210a0e['where']=_[_0x2335('0x45')](_0x210a0e[_0x2335('0x42')],{'$or':_['map'](_0x210a0e[_0x2335('0x3c')],function(_0x12ab36){var _0x32da32={};_0x32da32[_0x12ab36]={'$like':'%'+_0x1857b6['query']['filter']+'%'};return _0x32da32;})});}_0x210a0e=_['merge']({},_0x210a0e,_0x1857b6['options']);return db[_0x2335('0x6f')]['findAndCountAll'](_0x210a0e);}})[_0x2335('0x28')](respondWithResult(_0x19a6a9,null))[_0x2335('0x4e')](handleError(_0x19a6a9,null));};exports['addAgents']=function(_0x410e35,_0x476790,_0x57f6aa){return db[_0x2335('0x34')]['find']({'where':{'id':_0x410e35[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x476790,null))[_0x2335('0x28')](function(_0x47db90){if(_0x47db90){return _0x47db90[_0x2335('0x8d')](_0x410e35[_0x2335('0x50')][_0x2335('0x5f')],_[_0x2335('0x67')](_0x410e35['body'],[_0x2335('0x5f'),'id'])||{})[_0x2335('0x8e')](function(_0x41531d){for(var _0x594512=0x0;_0x594512<_0x410e35[_0x2335('0x50')]['ids'][_0x2335('0x3e')];_0x594512+=0x1){socket[_0x2335('0x8f')](_0x2335('0x90'),{'UserId':Number(_0x410e35[_0x2335('0x50')][_0x2335('0x5f')][_0x594512]),'CmListId':Number(_0x410e35[_0x2335('0x57')]['id'])});}return _0x41531d;});}})[_0x2335('0x28')](respondWithResult(_0x476790,null))[_0x2335('0x4e')](handleError(_0x476790,null));};exports[_0x2335('0x91')]=function(_0x5d8b76,_0x3d20b5,_0x168c79){return db[_0x2335('0x34')][_0x2335('0x4d')]({'where':{'id':_0x5d8b76[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x3d20b5,null))[_0x2335('0x28')](function(_0x1a4319){if(_0x1a4319){return _0x1a4319[_0x2335('0x91')](_0x5d8b76[_0x2335('0x3a')][_0x2335('0x5f')])[_0x2335('0x28')](function(){if(_[_0x2335('0x64')](_0x5d8b76[_0x2335('0x3a')][_0x2335('0x5f')])){for(var _0x25ccd7=0x0;_0x25ccd7<_0x5d8b76[_0x2335('0x3a')][_0x2335('0x5f')][_0x2335('0x3e')];_0x25ccd7+=0x1){socket[_0x2335('0x8f')](_0x2335('0x92'),{'UserId':Number(_0x5d8b76[_0x2335('0x3a')]['ids'][_0x25ccd7]),'CmListId':Number(_0x5d8b76[_0x2335('0x57')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x5d8b76[_0x2335('0x3a')][_0x2335('0x5f')]),'CmListId':Number(_0x5d8b76[_0x2335('0x57')]['id'])});}});}})[_0x2335('0x28')](respondWithStatusCode(_0x3d20b5,null))[_0x2335('0x4e')](handleError(_0x3d20b5,null));};exports[_0x2335('0x93')]=function(_0x5c3ba5,_0x5a9360,_0x12da1a){var _0x3bd438={};var _0x3c4f21={};var _0x5ae4b0;var _0x2c2afa;return db[_0x2335('0x34')][_0x2335('0x5b')]({'where':{'id':_0x5c3ba5[_0x2335('0x57')]['id']}})[_0x2335('0x28')](handleEntityNotFound(_0x5a9360,null))[_0x2335('0x28')](function(_0x3ecdbd){if(_0x3ecdbd){_0x5ae4b0=_0x3ecdbd;_0x3c4f21[_0x2335('0x39')]=_['keys'](db[_0x2335('0x94')]['rawAttributes']);_0x3c4f21[_0x2335('0x3a')]=_[_0x2335('0x4b')](_0x5c3ba5[_0x2335('0x3a')]);_0x3c4f21[_0x2335('0x43')]=_[_0x2335('0x3b')](_0x3c4f21['model'],_0x3c4f21[_0x2335('0x3a')]);_0x3bd438[_0x2335('0x3c')]=_[_0x2335('0x3b')](_0x3c4f21[_0x2335('0x39')],qs[_0x2335('0x3d')](_0x5c3ba5[_0x2335('0x3a')][_0x2335('0x3d')]));_0x3bd438['attributes']=_0x3bd438[_0x2335('0x3c')]['length']?_0x3bd438[_0x2335('0x3c')]:_0x3c4f21['model'];_0x3bd438[_0x2335('0x40')]=qs[_0x2335('0x41')](_0x5c3ba5['query'][_0x2335('0x41')]);_0x3bd438[_0x2335('0x42')]=qs[_0x2335('0x43')](_['pick'](_0x5c3ba5[_0x2335('0x3a')],_0x3c4f21[_0x2335('0x43')]));if(_0x5c3ba5[_0x2335('0x3a')][_0x2335('0x44')]){_0x3bd438[_0x2335('0x42')]=_[_0x2335('0x45')](_0x3bd438[_0x2335('0x42')],{'$or':_[_0x2335('0x33')](_0x3bd438['attributes'],function(_0x1e79b2){var _0x27464d={};_0x27464d[_0x1e79b2]={'$like':'%'+_0x5c3ba5[_0x2335('0x3a')][_0x2335('0x44')]+'%'};return _0x27464d;})});}_0x3bd438=_[_0x2335('0x45')]({},_0x3bd438,_0x5c3ba5[_0x2335('0x47')]);return _0x5ae4b0[_0x2335('0x93')](_0x3bd438);}})[_0x2335('0x28')](function(_0x14c837){if(_0x14c837){_0x2c2afa=_0x14c837[_0x2335('0x3e')];if(!_0x5c3ba5['query'][_0x2335('0x3f')](_0x2335('0x5c'))){_0x3bd438[_0x2335('0x21')]=qs['limit'](_0x5c3ba5[_0x2335('0x3a')][_0x2335('0x21')]);_0x3bd438[_0x2335('0x1f')]=qs[_0x2335('0x1f')](_0x5c3ba5[_0x2335('0x3a')][_0x2335('0x1f')]);}return _0x5ae4b0[_0x2335('0x93')](_0x3bd438);}})[_0x2335('0x28')](function(_0x4bf416){if(_0x4bf416){return _0x4bf416?{'count':_0x2c2afa,'rows':_0x4bf416}:null;}})[_0x2335('0x28')](respondWithResult(_0x5a9360,null))[_0x2335('0x4e')](handleError(_0x5a9360,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 05751aa..e74f478 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x5d01e3,_0x580578){var _0x4671b9=function(_0x233638){while(--_0x233638){_0x5d01e3['push'](_0x5d01e3['shift']());}};_0x4671b9(++_0x580578);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x268d75,_0x4ea6c2){var _0x2d302c=function(_0x343fa6){while(--_0x343fa6){_0x268d75['push'](_0x268d75['shift']());}};_0x2d302c(++_0x4ea6c2);}(_0x814b,0x1a2));var _0xb814=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x814b[_0x80544e];return _0x4f9b90;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 8f9b618..a827ce1 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 _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0x50278a,_0x2a68e0){var _0xda665c=function(_0x1844c6){while(--_0x1844c6){_0x50278a['push'](_0x50278a['shift']());}};_0xda665c(++_0x2a68e0);}(_0x70e0,0x17b));var _0x070e=function(_0x302a96,_0x48822f){_0x302a96=_0x302a96-0x0;var _0x3893aa=_0x70e0[_0x302a96];return _0x3893aa;};'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']('CmList',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x38e870,_0x3d2e6a){var _0x2dabbe=function(_0x3ddea3){while(--_0x3ddea3){_0x38e870['push'](_0x38e870['shift']());}};_0x2dabbe(++_0x3d2e6a);}(_0x1be1,0x192));var _0x11be=function(_0x51d8c6,_0x299865){_0x51d8c6=_0x51d8c6-0x0;var _0x532b76=_0x1be1[_0x51d8c6];return _0x532b76;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4b774a5..ebb2024 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 _0x9b03=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x9b03,0xf3));var _0x39b0=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x9b03[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x39b0('0x0'));var util=require(_0x39b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39b0('0x2'));var fs=require('fs');var Redis=require(_0x39b0('0x3'));var db=require(_0x39b0('0x4'))['db'];var utils=require(_0x39b0('0x5'));var logger=require(_0x39b0('0x6'))(_0x39b0('0x7'));var config=require(_0x39b0('0x8'));var jayson=require(_0x39b0('0x9'));var client=jayson[_0x39b0('0xa')][_0x39b0('0xb')]({'port':0x232a});config[_0x39b0('0xc')]=_[_0x39b0('0xd')](config[_0x39b0('0xc')],{'host':_0x39b0('0xe'),'port':0x18eb});var socket=require(_0x39b0('0xf'))(new Redis(config[_0x39b0('0xc')]));require('./cmList.socket')[_0x39b0('0x10')](socket);function respondWithRpcPromise(_0x4bbd91,_0x47af68,_0x2f2435){return new BPromise(function(_0x57db65,_0x4b1a9e){return client[_0x39b0('0x11')](_0x4bbd91,_0x2f2435)[_0x39b0('0x12')](function(_0x56e6d7){logger[_0x39b0('0x13')](_0x39b0('0x14'),_0x47af68,_0x39b0('0x15'));logger[_0x39b0('0x16')](_0x39b0('0x17'),_0x47af68,_0x39b0('0x15'),JSON['stringify'](_0x56e6d7));if(_0x56e6d7[_0x39b0('0x18')]){if(_0x56e6d7[_0x39b0('0x18')][_0x39b0('0x19')]===0x1f4){logger[_0x39b0('0x18')]('CmList,\x20%s,\x20%s',_0x47af68,_0x56e6d7[_0x39b0('0x18')][_0x39b0('0x1a')]);return _0x4b1a9e(_0x56e6d7[_0x39b0('0x18')][_0x39b0('0x1a')]);}logger['error'](_0x39b0('0x14'),_0x47af68,_0x56e6d7[_0x39b0('0x18')][_0x39b0('0x1a')]);return _0x57db65(_0x56e6d7[_0x39b0('0x18')][_0x39b0('0x1a')]);}else{logger[_0x39b0('0x13')](_0x39b0('0x14'),_0x47af68,'request\x20sent');_0x57db65(_0x56e6d7['result']['message']);}})[_0x39b0('0x1b')](function(_0xd90146){logger[_0x39b0('0x18')](_0x39b0('0x14'),_0x47af68,_0xd90146);_0x4b1a9e(_0xd90146);});});} \ No newline at end of file +var _0xda92=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CmList,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x3a1601,_0x74490c){var _0xb5893c=function(_0xbf4fbc){while(--_0xbf4fbc){_0x3a1601['push'](_0x3a1601['shift']());}};_0xb5893c(++_0x74490c);}(_0xda92,0xeb));var _0x2da9=function(_0x1af69b,_0x5578e4){_0x1af69b=_0x1af69b-0x0;var _0x3b37b4=_0xda92[_0x1af69b];return _0x3b37b4;};'use strict';var _=require(_0x2da9('0x0'));var util=require('util');var moment=require(_0x2da9('0x1'));var BPromise=require(_0x2da9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2da9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2da9('0x4'))(_0x2da9('0x5'));var config=require(_0x2da9('0x6'));var jayson=require(_0x2da9('0x7'));var client=jayson[_0x2da9('0x8')][_0x2da9('0x9')]({'port':0x232a});config[_0x2da9('0xa')]=_['defaults'](config[_0x2da9('0xa')],{'host':_0x2da9('0xb'),'port':0x18eb});var socket=require(_0x2da9('0xc'))(new Redis(config[_0x2da9('0xa')]));require('./cmList.socket')[_0x2da9('0xd')](socket);function respondWithRpcPromise(_0x5520cc,_0x56e444,_0x6eafd3){return new BPromise(function(_0x11f24c,_0x15786d){return client[_0x2da9('0xe')](_0x5520cc,_0x6eafd3)['then'](function(_0x520377){logger['info']('CmList,\x20%s,\x20%s',_0x56e444,_0x2da9('0xf'));logger[_0x2da9('0x10')](_0x2da9('0x11'),_0x56e444,_0x2da9('0xf'),JSON[_0x2da9('0x12')](_0x520377));if(_0x520377['error']){if(_0x520377['error'][_0x2da9('0x13')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x56e444,_0x520377[_0x2da9('0x14')][_0x2da9('0x15')]);return _0x15786d(_0x520377[_0x2da9('0x14')][_0x2da9('0x15')]);}logger[_0x2da9('0x14')](_0x2da9('0x16'),_0x56e444,_0x520377[_0x2da9('0x14')][_0x2da9('0x15')]);return _0x11f24c(_0x520377[_0x2da9('0x14')][_0x2da9('0x15')]);}else{logger['info'](_0x2da9('0x16'),_0x56e444,'request\x20sent');_0x11f24c(_0x520377[_0x2da9('0x17')]['message']);}})[_0x2da9('0x18')](function(_0x27d3de){logger[_0x2da9('0x14')](_0x2da9('0x16'),_0x56e444,_0x27d3de);_0x15786d(_0x27d3de);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3f208a1..184a71b 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 _0xca89=['length','./cmList.events','save','remove','emit','removeListener'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xca89,0xaf));var _0x9ca8=function(_0x338508,_0x19c060){_0x338508=_0x338508-0x0;var _0x1f569c=_0xca89[_0x338508];return _0x1f569c;};'use strict';var CmListEvents=require(_0x9ca8('0x0'));var events=[_0x9ca8('0x1'),_0x9ca8('0x2'),'update'];function createListener(_0x548f16,_0x100050){return function(_0x5cf01b){_0x100050[_0x9ca8('0x3')](_0x548f16,_0x5cf01b);};}function removeListener(_0x2b5c4b,_0x4ecff5){return function(){CmListEvents[_0x9ca8('0x4')](_0x2b5c4b,_0x4ecff5);};}exports['register']=function(_0x5bc924){for(var _0x1f15e7=0x0,_0x7416d2=events[_0x9ca8('0x5')];_0x1f15e7<_0x7416d2;_0x1f15e7++){var _0x4c67cf=events[_0x1f15e7];var _0x21ab42=createListener('cmList:'+_0x4c67cf,_0x5bc924);CmListEvents['on'](_0x4c67cf,_0x21ab42);}}; \ No newline at end of file +var _0xbc60=['register','length','cmList:','save','remove','update','emit','removeListener'];(function(_0x1ac0dd,_0x5a1e5f){var _0x31fc81=function(_0x5a6f8f){while(--_0x5a6f8f){_0x1ac0dd['push'](_0x1ac0dd['shift']());}};_0x31fc81(++_0x5a1e5f);}(_0xbc60,0xc3));var _0x0bc6=function(_0x1ea3be,_0x1ad09d){_0x1ea3be=_0x1ea3be-0x0;var _0x284005=_0xbc60[_0x1ea3be];return _0x284005;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x0bc6('0x0'),_0x0bc6('0x1'),_0x0bc6('0x2')];function createListener(_0x4e918a,_0x275a32){return function(_0x55cd4c){_0x275a32[_0x0bc6('0x3')](_0x4e918a,_0x55cd4c);};}function removeListener(_0x541893,_0x4f2b34){return function(){CmListEvents[_0x0bc6('0x4')](_0x541893,_0x4f2b34);};}exports[_0x0bc6('0x5')]=function(_0x2b12b7){for(var _0xd95b7e=0x0,_0x2f88ab=events[_0x0bc6('0x6')];_0xd95b7e<_0x2f88ab;_0xd95b7e++){var _0x9dc601=events[_0xd95b7e];var _0x52ace6=createListener(_0x0bc6('0x7')+_0x9dc601,_0x2b12b7);CmListEvents['on'](_0x9dc601,_0x52ace6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0fd80aa..05d28a9 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 _0xc563=['addContacts','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','create','post','addDisposition'];(function(_0x3cd0a5,_0x31cf06){var _0x55f702=function(_0x4009ca){while(--_0x4009ca){_0x3cd0a5['push'](_0x3cd0a5['shift']());}};_0x55f702(++_0x31cf06);}(_0xc563,0x7c));var _0x3c56=function(_0x1a62f8,_0xbb6aa2){_0x1a62f8=_0x1a62f8-0x0;var _0x4a561c=_0xc563[_0x1a62f8];return _0x4a561c;};'use strict';var multer=require(_0x3c56('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3c56('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3c56('0x2'));var auth=require(_0x3c56('0x3'));var interaction=require(_0x3c56('0x4'));var config=require(_0x3c56('0x5'));var controller=require('./cmList.controller');router['get']('/',auth[_0x3c56('0x6')](),controller[_0x3c56('0x7')]);router[_0x3c56('0x8')]('/describe',auth[_0x3c56('0x6')](),controller[_0x3c56('0x9')]);router['get'](_0x3c56('0xa'),auth[_0x3c56('0x6')](),controller['show']);router[_0x3c56('0x8')](_0x3c56('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x3c56('0xc'),auth[_0x3c56('0x6')](),controller[_0x3c56('0xd')]);router['get'](_0x3c56('0xe'),auth[_0x3c56('0x6')](),controller['getContactsCsv']);router[_0x3c56('0x8')](_0x3c56('0xf'),auth[_0x3c56('0x6')](),controller[_0x3c56('0x10')]);router[_0x3c56('0x8')](_0x3c56('0x11'),auth[_0x3c56('0x6')](),controller['getAgents']);router['post']('/',auth[_0x3c56('0x6')](),controller[_0x3c56('0x12')]);router[_0x3c56('0x13')]('/:id/dispositions',auth[_0x3c56('0x6')](),controller[_0x3c56('0x14')]);router['post'](_0x3c56('0xc'),auth[_0x3c56('0x6')](),controller[_0x3c56('0x15')]);router[_0x3c56('0x13')](_0x3c56('0xf'),auth[_0x3c56('0x6')](),controller['addCustomField']);router[_0x3c56('0x13')](_0x3c56('0x11'),auth['isAuthenticated'](),controller[_0x3c56('0x16')]);router[_0x3c56('0x17')](_0x3c56('0xa'),auth[_0x3c56('0x6')](),controller['update']);router['delete'](_0x3c56('0xa'),auth[_0x3c56('0x6')](),controller[_0x3c56('0x18')]);router[_0x3c56('0x19')](_0x3c56('0xb'),auth[_0x3c56('0x6')](),controller[_0x3c56('0x1a')]);router[_0x3c56('0x19')](_0x3c56('0x11'),auth['isAuthenticated'](),controller[_0x3c56('0x1b')]);module[_0x3c56('0x1c')]=router; \ No newline at end of file +var _0x737d=['show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','getCustomFields','/:id/users','getAgents','create','addDisposition','post','addContacts','/:id/fields','put','/:id','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0x737d,0x101));var _0xd737=function(_0x3272fa,_0x2559c7){_0x3272fa=_0x3272fa-0x0;var _0x1bbd03=_0x737d[_0x3272fa];return _0x1bbd03;};'use strict';var multer=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var path=require(_0xd737('0x2'));var timeout=require(_0xd737('0x3'));var express=require('express');var router=express[_0xd737('0x4')]();var fs_extra=require(_0xd737('0x5'));var auth=require(_0xd737('0x6'));var interaction=require(_0xd737('0x7'));var config=require(_0xd737('0x8'));var controller=require(_0xd737('0x9'));router[_0xd737('0xa')]('/',auth['isAuthenticated'](),controller[_0xd737('0xb')]);router[_0xd737('0xa')](_0xd737('0xc'),auth[_0xd737('0xd')](),controller[_0xd737('0xe')]);router[_0xd737('0xa')]('/:id',auth[_0xd737('0xd')](),controller[_0xd737('0xf')]);router[_0xd737('0xa')](_0xd737('0x10'),auth[_0xd737('0xd')](),controller['getDispositions']);router['get'](_0xd737('0x11'),auth['isAuthenticated'](),controller['getContacts']);router[_0xd737('0xa')](_0xd737('0x12'),auth[_0xd737('0xd')](),controller['getContactsCsv']);router[_0xd737('0xa')]('/:id/fields',auth[_0xd737('0xd')](),controller[_0xd737('0x13')]);router[_0xd737('0xa')](_0xd737('0x14'),auth[_0xd737('0xd')](),controller[_0xd737('0x15')]);router['post']('/',auth[_0xd737('0xd')](),controller[_0xd737('0x16')]);router['post']('/:id/dispositions',auth[_0xd737('0xd')](),controller[_0xd737('0x17')]);router[_0xd737('0x18')](_0xd737('0x11'),auth[_0xd737('0xd')](),controller[_0xd737('0x19')]);router[_0xd737('0x18')](_0xd737('0x1a'),auth[_0xd737('0xd')](),controller['addCustomField']);router[_0xd737('0x18')](_0xd737('0x14'),auth[_0xd737('0xd')](),controller['addAgents']);router[_0xd737('0x1b')](_0xd737('0x1c'),auth[_0xd737('0xd')](),controller['update']);router['delete'](_0xd737('0x1c'),auth[_0xd737('0xd')](),controller[_0xd737('0x1d')]);router[_0xd737('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd737('0x1f')]);router['delete'](_0xd737('0x14'),auth[_0xd737('0xd')](),controller[_0xd737('0x20')]);module[_0xd737('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 09261cc..9003751 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 _0xa08f=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x322fd6,_0x1aca9e){var _0x3dab2f=function(_0x4e2a1c){while(--_0x4e2a1c){_0x322fd6['push'](_0x322fd6['shift']());}};_0x3dab2f(++_0x1aca9e);}(_0xa08f,0x16b));var _0xfa08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa08f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xfa08('0x0')]={'name':{'type':Sequelize[_0xfa08('0x1')],'get':function(_0x1d0a5b){return this[_0xfa08('0x2')](_0xfa08('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xfa08('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xfa08('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xac49=['exports','field','STRING','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xac49,0x11f));var _0x9ac4=function(_0x1a02d0,_0x422e63){_0x1a02d0=_0x1a02d0-0x0;var _0x880968=_0xac49[_0x1a02d0];return _0x880968;};'use strict';var Sequelize=require(_0x9ac4('0x0'));module[_0x9ac4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1b1abc){return this['getDataValue'](_0x9ac4('0x2'));}},'field':{'type':Sequelize[_0x9ac4('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x9ac4('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x9ac4('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index aff423e..6668c5e 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x8b688d,_0x1e39dd){var _0x127a34=function(_0x1df0bd){while(--_0x1df0bd){_0x8b688d['push'](_0x8b688d['shift']());}};_0x127a34(++_0x1e39dd);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _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(_0x3419a3,_0x46e48d){var _0x3002e2=function(_0x39fe66){while(--_0x39fe66){_0x3419a3['push'](_0x3419a3['shift']());}};_0x3002e2(++_0x46e48d);}(_0x7a54,0x106));var _0x47a5=function(_0x56681f,_0x922c8e){_0x56681f=_0x56681f-0x0;var _0x15522f=_0x7a54[_0x56681f];return _0x15522f;};'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 4cdc716..359190b 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 _0x99a9=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','define','Condition','lodash','util','../../config/logger'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x99a9,0xf9));var _0x999a=function(_0x3d4664,_0x3a2547){_0x3d4664=_0x3d4664-0x0;var _0x2cf144=_0x99a9[_0x3d4664];return _0x2cf144;};'use strict';var _=require(_0x999a('0x0'));var util=require(_0x999a('0x1'));var logger=require(_0x999a('0x2'))(_0x999a('0x3'));var moment=require(_0x999a('0x4'));var BPromise=require(_0x999a('0x5'));var rp=require(_0x999a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999a('0x7'));var config=require(_0x999a('0x8'));var attributes=require(_0x999a('0x9'));module['exports']=function(_0x2903f4,_0x137a6f){return _0x2903f4[_0x999a('0xa')](_0x999a('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bba=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x447f89,_0x57c7d6){var _0x53fee4=function(_0x54ea91){while(--_0x54ea91){_0x447f89['push'](_0x447f89['shift']());}};_0x53fee4(++_0x57c7d6);}(_0x2bba,0x168));var _0xa2bb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2bba[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xa2bb('0x0'));var util=require(_0xa2bb('0x1'));var logger=require(_0xa2bb('0x2'))('api');var moment=require(_0xa2bb('0x3'));var BPromise=require(_0xa2bb('0x4'));var rp=require(_0xa2bb('0x5'));var fs=require('fs');var path=require(_0xa2bb('0x6'));var rimraf=require('rimraf');var config=require(_0xa2bb('0x7'));var attributes=require(_0xa2bb('0x8'));module[_0xa2bb('0x9')]=function(_0xa44144,_0x529bdb){return _0xa44144[_0xa2bb('0xa')](_0xa2bb('0xb'),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 a45a149..92d8c5d 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 _0xdf7a=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0xdf7a,0x69));var _0xadf7=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0xdf7a[_0x3299d1];return _0x44356e;};'use strict';var _=require(_0xadf7('0x0'));var util=require(_0xadf7('0x1'));var moment=require(_0xadf7('0x2'));var BPromise=require(_0xadf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadf7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xadf7('0x5'));var logger=require('../../config/logger')(_0xadf7('0x6'));var config=require(_0xadf7('0x7'));var jayson=require(_0xadf7('0x8'));var client=jayson[_0xadf7('0x9')][_0xadf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f091a,_0x552f2e,_0x2fc263){return new BPromise(function(_0x2a9c2c,_0x37d217){return client[_0xadf7('0xb')](_0x4f091a,_0x2fc263)[_0xadf7('0xc')](function(_0x28ad70){logger[_0xadf7('0xd')](_0xadf7('0xe'),_0x552f2e,_0xadf7('0xf'));logger[_0xadf7('0x10')](_0xadf7('0x11'),_0x552f2e,_0xadf7('0xf'),JSON[_0xadf7('0x12')](_0x28ad70));if(_0x28ad70[_0xadf7('0x13')]){if(_0x28ad70[_0xadf7('0x13')][_0xadf7('0x14')]===0x1f4){logger[_0xadf7('0x13')](_0xadf7('0xe'),_0x552f2e,_0x28ad70['error'][_0xadf7('0x15')]);return _0x37d217(_0x28ad70[_0xadf7('0x13')][_0xadf7('0x15')]);}logger['error'](_0xadf7('0xe'),_0x552f2e,_0x28ad70[_0xadf7('0x13')][_0xadf7('0x15')]);return _0x2a9c2c(_0x28ad70[_0xadf7('0x13')][_0xadf7('0x15')]);}else{logger[_0xadf7('0xd')](_0xadf7('0xe'),_0x552f2e,_0xadf7('0xf'));_0x2a9c2c(_0x28ad70[_0xadf7('0x16')][_0xadf7('0x15')]);}})[_0xadf7('0x17')](function(_0x1cdaa5){logger[_0xadf7('0x13')](_0xadf7('0xe'),_0x552f2e,_0x1cdaa5);_0x37d217(_0x1cdaa5);});});} \ No newline at end of file +var _0x906b=['error','code','Condition,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0x906b,0x1d3));var _0xb906=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x906b[_0x44b7d6];return _0x5346f0;};'use strict';var _=require(_0xb906('0x0'));var util=require('util');var moment=require(_0xb906('0x1'));var BPromise=require(_0xb906('0x2'));var rs=require(_0xb906('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb906('0x4'))['db'];var utils=require(_0xb906('0x5'));var logger=require('../../config/logger')(_0xb906('0x6'));var config=require(_0xb906('0x7'));var jayson=require(_0xb906('0x8'));var client=jayson[_0xb906('0x9')][_0xb906('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x385025,_0xdbbcf0,_0x55212e){return new BPromise(function(_0x19ff21,_0x14ece3){return client['request'](_0x385025,_0x55212e)[_0xb906('0xb')](function(_0x302e20){logger[_0xb906('0xc')]('Condition,\x20%s,\x20%s',_0xdbbcf0,'request\x20sent');logger[_0xb906('0xd')](_0xb906('0xe'),_0xdbbcf0,'request\x20sent',JSON[_0xb906('0xf')](_0x302e20));if(_0x302e20['error']){if(_0x302e20[_0xb906('0x10')][_0xb906('0x11')]===0x1f4){logger[_0xb906('0x10')](_0xb906('0x12'),_0xdbbcf0,_0x302e20[_0xb906('0x10')][_0xb906('0x13')]);return _0x14ece3(_0x302e20[_0xb906('0x10')][_0xb906('0x13')]);}logger['error'](_0xb906('0x12'),_0xdbbcf0,_0x302e20[_0xb906('0x10')][_0xb906('0x13')]);return _0x19ff21(_0x302e20[_0xb906('0x10')][_0xb906('0x13')]);}else{logger[_0xb906('0xc')](_0xb906('0x12'),_0xdbbcf0,_0xb906('0x14'));_0x19ff21(_0x302e20[_0xb906('0x15')][_0xb906('0x13')]);}})[_0xb906('0x16')](function(_0xc9cd01){logger[_0xb906('0x10')](_0xb906('0x12'),_0xdbbcf0,_0xc9cd01);_0x14ece3(_0xc9cd01);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e13fdd1..a715e7f 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 _0x79bb=['util','express','Router','fs-extra','../../config/environment','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x19ea94,_0x3ff858){var _0x377cdf=function(_0x5ecd81){while(--_0x5ecd81){_0x19ea94['push'](_0x19ea94['shift']());}};_0x377cdf(++_0x3ff858);}(_0x79bb,0x9b));var _0xb79b=function(_0x38ee11,_0x3e776c){_0x38ee11=_0x38ee11-0x0;var _0x50364e=_0x79bb[_0x38ee11];return _0x50364e;};'use strict';var multer=require(_0xb79b('0x0'));var util=require(_0xb79b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb79b('0x2'));var router=express[_0xb79b('0x3')]();var fs_extra=require(_0xb79b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb79b('0x5'));var controller=require('./condition.controller');router['put'](_0xb79b('0x6'),auth[_0xb79b('0x7')](),controller[_0xb79b('0x8')]);router[_0xb79b('0x9')](_0xb79b('0x6'),auth['isAuthenticated'](),controller[_0xb79b('0xa')]);module[_0xb79b('0xb')]=router; \ No newline at end of file +var _0xb525=['./condition.controller','put','/:id','isAuthenticated','destroy','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27df4c,_0x2715f4){var _0x71f61f=function(_0x44e228){while(--_0x44e228){_0x27df4c['push'](_0x27df4c['shift']());}};_0x71f61f(++_0x2715f4);}(_0xb525,0x73));var _0x5b52=function(_0x5e2920,_0x52f76d){_0x5e2920=_0x5e2920-0x0;var _0x745b17=_0xb525[_0x5e2920];return _0x745b17;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5b52('0x0'));var express=require(_0x5b52('0x1'));var router=express['Router']();var fs_extra=require(_0x5b52('0x2'));var auth=require(_0x5b52('0x3'));var interaction=require(_0x5b52('0x4'));var config=require(_0x5b52('0x5'));var controller=require(_0x5b52('0x6'));router[_0x5b52('0x7')](_0x5b52('0x8'),auth[_0x5b52('0x9')](),controller['update']);router['delete'](_0x5b52('0x8'),auth[_0x5b52('0x9')](),controller[_0x5b52('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a90e1ed..1833e08 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 626fdaa..796b36b 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 _0x4108=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','options','include','findAll','rows','catch','show','params','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','UserProfileSection','create','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','pick','getItems','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','CustomDashboards','UserProfileResource','then','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','model','keys'];(function(_0x3ba66a,_0xbbfb2){var _0x49c64f=function(_0x5bdf78){while(--_0x5bdf78){_0x3ba66a['push'](_0x3ba66a['shift']());}};_0x49c64f(++_0xbbfb2);}(_0x4108,0xbb));var _0x8410=function(_0x380370,_0x131d01){_0x380370=_0x380370-0x0;var _0x4f9df6=_0x4108[_0x380370];return _0x4f9df6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8410('0x0'));var zipdir=require(_0x8410('0x1'));var jsonpatch=require(_0x8410('0x2'));var rp=require(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require(_0x8410('0x5'));var Mustache=require(_0x8410('0x6'));var util=require(_0x8410('0x7'));var path=require(_0x8410('0x8'));var sox=require(_0x8410('0x9'));var csv=require(_0x8410('0xa'));var ejs=require(_0x8410('0xb'));var fs=require('fs');var fs_extra=require(_0x8410('0xc'));var _=require(_0x8410('0xd'));var squel=require(_0x8410('0xe'));var crypto=require(_0x8410('0xf'));var jsforce=require(_0x8410('0x10'));var deskjs=require(_0x8410('0x11'));var toCsv=require(_0x8410('0xa'));var querystring=require(_0x8410('0x12'));var Papa=require(_0x8410('0x13'));var Redis=require(_0x8410('0x14'));var authService=require(_0x8410('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8410('0x16'));var logger=require(_0x8410('0x17'))(_0x8410('0x18'));var utils=require(_0x8410('0x19'));var config=require(_0x8410('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8410('0x1b')]=_[_0x8410('0x1c')](config[_0x8410('0x1b')],{'host':_0x8410('0x1d'),'port':0x18eb});var socket=require(_0x8410('0x1e'))(new Redis(config[_0x8410('0x1b')]));require('./dashboard.socket')[_0x8410('0x1f')](socket);function respondWithStatusCode(_0x1c8825,_0x388d33){_0x388d33=_0x388d33||0xcc;return function(_0x118340){if(_0x118340){return _0x1c8825[_0x8410('0x20')](_0x388d33);}return _0x1c8825['status'](_0x388d33)[_0x8410('0x21')]();};}function respondWithResult(_0x4daff6,_0x3348d4){_0x3348d4=_0x3348d4||0xc8;return function(_0x3bf4b5){if(_0x3bf4b5){return _0x4daff6[_0x8410('0x22')](_0x3348d4)[_0x8410('0x23')](_0x3bf4b5);}};}function respondWithFilteredResult(_0x3ee2b4,_0x54dd27){return function(_0x513f87){if(_0x513f87){var _0x1c2e63=typeof _0x54dd27['offset']===_0x8410('0x24')&&typeof _0x54dd27[_0x8410('0x25')]==='undefined';var _0x3ac560=_0x513f87[_0x8410('0x26')];var _0x31c62f=_0x1c2e63?0x0:_0x54dd27['offset'];var _0xf9a651=_0x1c2e63?_0x513f87['count']:_0x54dd27[_0x8410('0x27')]+_0x54dd27[_0x8410('0x25')];var _0x510f8d;if(_0xf9a651>=_0x3ac560){_0xf9a651=_0x3ac560;_0x510f8d=0xc8;}else{_0x510f8d=0xce;}_0x3ee2b4[_0x8410('0x22')](_0x510f8d);return _0x3ee2b4['set'](_0x8410('0x28'),_0x31c62f+'-'+_0xf9a651+'/'+_0x3ac560)[_0x8410('0x23')](_0x513f87);}return null;};}function patchUpdates(_0x5753bd){return function(_0x5815d8){try{jsonpatch[_0x8410('0x29')](_0x5815d8,_0x5753bd,!![]);}catch(_0x40ab0d){return BPromise[_0x8410('0x2a')](_0x40ab0d);}return _0x5815d8[_0x8410('0x2b')]();};}function saveUpdates(_0x4eb789,_0x2eba4f){return function(_0x166845){if(_0x166845){return _0x166845[_0x8410('0x2c')](_0x4eb789)['then'](function(_0x2200a7){return _0x2200a7;});}return null;};}function removeEntity(_0x52ce5a,_0x3eef16){return function(_0x1af375){if(_0x1af375){return _0x1af375[_0x8410('0x2d')]()['then'](function(){var _0x26d2f6=_0x1af375[_0x8410('0x2e')]({'plain':!![]});var _0x17c5dc=_0x8410('0x2f');return db[_0x8410('0x30')][_0x8410('0x2d')]({'where':{'type':_0x17c5dc,'resourceId':_0x26d2f6['id']}})[_0x8410('0x31')](function(){return _0x1af375;});})['then'](function(){_0x52ce5a[_0x8410('0x22')](0xcc)[_0x8410('0x21')]();});}};}function handleEntityNotFound(_0x5a5b13,_0x4bada4){return function(_0x42fb7e){if(!_0x42fb7e){_0x5a5b13[_0x8410('0x20')](0x194);}return _0x42fb7e;};}function handleError(_0x4bd889,_0x5e8a94){_0x5e8a94=_0x5e8a94||0x1f4;return function(_0x1ea675){logger[_0x8410('0x32')](_0x1ea675[_0x8410('0x33')]);if(_0x1ea675[_0x8410('0x34')]){delete _0x1ea675[_0x8410('0x34')];}_0x4bd889['status'](_0x5e8a94)[_0x8410('0x35')](_0x1ea675);};}exports['index']=function(_0x34798b,_0x5a2bf6){var _0x23c6f7={},_0x27b877={},_0xdd364a={'count':0x0,'rows':[]};var _0x26fff3=_[_0x8410('0x36')](db[_0x8410('0x37')][_0x8410('0x38')],function(_0x30c5b5){return{'name':_0x30c5b5[_0x8410('0x39')],'type':_0x30c5b5[_0x8410('0x3a')]['key']};});_0x27b877[_0x8410('0x3b')]=_[_0x8410('0x36')](_0x26fff3,'name');_0x27b877['query']=_[_0x8410('0x3c')](_0x34798b[_0x8410('0x3d')]);_0x27b877[_0x8410('0x3e')]=_[_0x8410('0x3f')](_0x27b877[_0x8410('0x3b')],_0x27b877[_0x8410('0x3d')]);_0x23c6f7[_0x8410('0x40')]=_['intersection'](_0x27b877['model'],qs[_0x8410('0x41')](_0x34798b[_0x8410('0x3d')][_0x8410('0x41')]));_0x23c6f7[_0x8410('0x40')]=_0x23c6f7[_0x8410('0x40')][_0x8410('0x42')]?_0x23c6f7[_0x8410('0x40')]:_0x27b877[_0x8410('0x3b')];if(!_0x34798b[_0x8410('0x3d')]['hasOwnProperty'](_0x8410('0x43'))){_0x23c6f7[_0x8410('0x25')]=qs['limit'](_0x34798b['query']['limit']);_0x23c6f7['offset']=qs[_0x8410('0x27')](_0x34798b[_0x8410('0x3d')][_0x8410('0x27')]);}_0x23c6f7['order']=qs[_0x8410('0x44')](_0x34798b['query']['sort']);_0x23c6f7[_0x8410('0x45')]=qs[_0x8410('0x3e')](_['pick'](_0x34798b['query'],_0x27b877[_0x8410('0x3e')]),_0x26fff3);if(_0x34798b[_0x8410('0x3d')][_0x8410('0x46')]){_0x23c6f7[_0x8410('0x45')]=_['merge'](_0x23c6f7['where'],{'$or':_['map'](_0x26fff3,function(_0x29b484){if(_0x29b484[_0x8410('0x3a')]!=='VIRTUAL'){var _0xe1ce08={};_0xe1ce08[_0x29b484[_0x8410('0x34')]]={'$like':'%'+_0x34798b['query'][_0x8410('0x46')]+'%'};return _0xe1ce08;}})});}_0x23c6f7=_['merge']({},_0x23c6f7,_0x34798b[_0x8410('0x47')]);var _0x387b77={'where':_0x23c6f7[_0x8410('0x45')]};return db[_0x8410('0x37')][_0x8410('0x26')](_0x387b77)[_0x8410('0x31')](function(_0xc9bbf1){_0xdd364a[_0x8410('0x26')]=_0xc9bbf1;if(_0x34798b[_0x8410('0x3d')]['includeAll']){_0x23c6f7[_0x8410('0x48')]=[{'all':!![]}];}return db[_0x8410('0x37')][_0x8410('0x49')](_0x23c6f7);})[_0x8410('0x31')](function(_0x314af0){_0xdd364a[_0x8410('0x4a')]=_0x314af0;return _0xdd364a;})[_0x8410('0x31')](respondWithFilteredResult(_0x5a2bf6,_0x23c6f7))[_0x8410('0x4b')](handleError(_0x5a2bf6,null));};exports[_0x8410('0x4c')]=function(_0x2a7e83,_0x356572){var _0x595351={'raw':![],'where':{'id':_0x2a7e83[_0x8410('0x4d')]['id']}},_0x38414f={};_0x38414f['model']=_['keys'](db['Dashboard']['rawAttributes']);_0x38414f[_0x8410('0x3d')]=_[_0x8410('0x3c')](_0x2a7e83[_0x8410('0x3d')]);_0x38414f['filters']=_[_0x8410('0x3f')](_0x38414f[_0x8410('0x3b')],_0x38414f[_0x8410('0x3d')]);_0x595351[_0x8410('0x40')]=_[_0x8410('0x3f')](_0x38414f[_0x8410('0x3b')],qs[_0x8410('0x41')](_0x2a7e83['query']['fields']));_0x595351[_0x8410('0x40')]=_0x595351['attributes'][_0x8410('0x42')]?_0x595351[_0x8410('0x40')]:_0x38414f[_0x8410('0x3b')];if(_0x2a7e83[_0x8410('0x3d')][_0x8410('0x4e')]){_0x595351[_0x8410('0x48')]=[{'all':!![]}];}_0x595351=_[_0x8410('0x4f')]({},_0x595351,_0x2a7e83[_0x8410('0x47')]);return db[_0x8410('0x37')][_0x8410('0x50')](_0x595351)[_0x8410('0x31')](handleEntityNotFound(_0x356572,null))['then'](respondWithResult(_0x356572,null))['catch'](handleError(_0x356572,null));};exports['create']=function(_0x10f8e9,_0x22e26e){return db[_0x8410('0x37')]['create'](_0x10f8e9[_0x8410('0x51')],{})['then'](function(_0x176d57){var _0x5a68da=_0x10f8e9[_0x8410('0x52')]['get']({'plain':!![]});if(!_0x5a68da)throw new Error(_0x8410('0x53'));if(_0x5a68da[_0x8410('0x54')]==='user'){var _0x93bd88=_0x176d57[_0x8410('0x2e')]({'plain':!![]});var _0x1c5e08=_0x8410('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x1c5e08,'userProfileId':_0x5a68da[_0x8410('0x55')]},'raw':!![]})['then'](function(_0x4d9c63){if(_0x4d9c63&&_0x4d9c63[_0x8410('0x56')]===0x0){return db[_0x8410('0x30')]['create']({'name':_0x93bd88[_0x8410('0x34')],'resourceId':_0x93bd88['id'],'type':_0x4d9c63[_0x8410('0x34')],'sectionId':_0x4d9c63['id']},{})['then'](function(){return _0x176d57;});}else{return _0x176d57;}})[_0x8410('0x4b')](function(_0x4ca216){logger[_0x8410('0x32')](_0x8410('0x57'),_0x4ca216);throw _0x4ca216;});}return _0x176d57;})[_0x8410('0x31')](respondWithResult(_0x22e26e,0xc9))[_0x8410('0x4b')](handleError(_0x22e26e,null));};exports[_0x8410('0x58')]=function(_0x41e334,_0x4dbf76){var _0x52b2eb={'where':{'id':_0x41e334[_0x8410('0x4d')]['id']}},_0x4b0ce8={};_0x4b0ce8[_0x8410('0x3b')]=_[_0x8410('0x3c')](db[_0x8410('0x37')]['rawAttributes']);_0x52b2eb[_0x8410('0x40')]=_[_0x8410('0x3f')](_0x4b0ce8['model'],qs[_0x8410('0x41')](_0x41e334[_0x8410('0x3d')][_0x8410('0x41')]));_0x52b2eb[_0x8410('0x40')]=_0x52b2eb['attributes']['length']?_0x52b2eb['attributes']:_0x4b0ce8[_0x8410('0x3b')];if(_0x41e334[_0x8410('0x3d')][_0x8410('0x4e')]){_0x52b2eb['include']=[{'all':!![]}];}_0x52b2eb=_[_0x8410('0x4f')]({},_0x52b2eb,_0x41e334[_0x8410('0x47')]);return db['Dashboard'][_0x8410('0x50')](_0x52b2eb)[_0x8410('0x31')](handleEntityNotFound(_0x4dbf76,null))[_0x8410('0x31')](function(_0x306f25){if(_0x306f25){var _0x3f26bd=_0x306f25[_0x8410('0x2e')]({'plain':!![]});_0x3f26bd=qs[_0x8410('0x59')](_0x3f26bd,['id',_0x8410('0x5a'),'updatedAt']);_0x41e334['body']=_[_0x8410('0x59')](_0x41e334['body'],['id','createdAt','updatedAt']);return db['Dashboard']['create'](_['merge'](_0x3f26bd,_0x41e334[_0x8410('0x51')]),{'include':_0x41e334[_0x8410('0x3d')][_0x8410('0x4e')]?[{'all':!![]}]:undefined})[_0x8410('0x31')](function(_0x28c813){var _0x429123=_0x41e334[_0x8410('0x52')][_0x8410('0x2e')]({'plain':!![]});if(!_0x429123)throw new Error(_0x8410('0x53'));if(_0x429123['role']===_0x8410('0x52')){var _0x4c7ac2=_0x28c813['get']({'plain':!![]});var _0x4996a4=_0x8410('0x2f');return db[_0x8410('0x5b')][_0x8410('0x50')]({'where':{'name':_0x4996a4,'userProfileId':_0x429123[_0x8410('0x55')]},'raw':!![]})[_0x8410('0x31')](function(_0x2f8373){if(_0x2f8373&&_0x2f8373[_0x8410('0x56')]===0x0){return db[_0x8410('0x30')][_0x8410('0x5c')]({'name':_0x4c7ac2[_0x8410('0x34')],'resourceId':_0x4c7ac2['id'],'type':_0x2f8373[_0x8410('0x34')],'sectionId':_0x2f8373['id']},{})[_0x8410('0x31')](function(){return _0x28c813;});}else{return _0x28c813;}})[_0x8410('0x4b')](function(_0x1b2a14){logger['error'](_0x8410('0x57'),_0x1b2a14);throw _0x1b2a14;});}return _0x28c813;});}})[_0x8410('0x31')](respondWithResult(_0x4dbf76,0xc9))['catch'](handleError(_0x4dbf76,null));};exports[_0x8410('0x2c')]=function(_0x5b81dd,_0x1cd2c0){if(_0x5b81dd[_0x8410('0x51')]['id']){delete _0x5b81dd[_0x8410('0x51')]['id'];}return db[_0x8410('0x37')]['find']({'where':{'id':_0x5b81dd[_0x8410('0x4d')]['id']}})[_0x8410('0x31')](handleEntityNotFound(_0x1cd2c0,null))[_0x8410('0x31')](saveUpdates(_0x5b81dd[_0x8410('0x51')],null))[_0x8410('0x31')](respondWithResult(_0x1cd2c0,null))[_0x8410('0x4b')](handleError(_0x1cd2c0,null));};exports[_0x8410('0x2d')]=function(_0x50042e,_0x4aa79f){return db[_0x8410('0x37')]['find']({'where':{'id':_0x50042e[_0x8410('0x4d')]['id']}})[_0x8410('0x31')](handleEntityNotFound(_0x4aa79f,null))['then'](removeEntity(_0x4aa79f,null))[_0x8410('0x4b')](handleError(_0x4aa79f,null));};function widgetAttributes(_0x101a6e){try{switch(_0x101a6e[_0x8410('0x3a')]){case _0x8410('0x5d'):return[{'name':_0x8410('0x5e'),'value':_0x101a6e['attrUrl']||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x0]?_0x101a6e[_0x8410('0x5f')][0x0][_0x8410('0x60')]:undefined)||_0x8410('0x61')}];case _0x8410('0x62'):return[{'name':_0x8410('0x63'),'value':_0x101a6e[_0x8410('0x63')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x0]?_0x101a6e[_0x8410('0x5f')][0x0][_0x8410('0x60')]:undefined)||''}];case _0x8410('0x64'):return[{'name':_0x8410('0x65'),'value':_0x101a6e[_0x8410('0x65')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e['attrs'][0x0]?_0x101a6e[_0x8410('0x5f')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x8410('0x66'),'value':_0x101a6e[_0x8410('0x66')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x1]?_0x101a6e['attrs'][0x1][_0x8410('0x60')]:undefined)||_0x8410('0x67')},{'name':_0x8410('0x68'),'value':_0x101a6e[_0x8410('0x68')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e['attrs'][0x2]?_0x101a6e[_0x8410('0x5f')][0x2][_0x8410('0x60')]:undefined)||0xc}];case _0x8410('0x69'):return[{'name':_0x8410('0x6a'),'value':_0x101a6e[_0x8410('0x6a')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e['attrs'][0x0]?_0x101a6e[_0x8410('0x5f')][0x0][_0x8410('0x60')]:undefined)||'total'},{'name':_0x8410('0x6b'),'value':_0x101a6e['attrVoiceQueues']||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x1]?_0x101a6e['attrs'][0x1][_0x8410('0x60')]:undefined)||[]},{'name':_0x8410('0x68'),'value':_0x101a6e[_0x8410('0x68')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e['attrs'][0x2]?_0x101a6e[_0x8410('0x5f')][0x2][_0x8410('0x60')]:undefined)||0x14}];case _0x8410('0x6c'):case _0x8410('0x6d'):return[{'name':'attrSerie1','value':_0x101a6e[_0x8410('0x6e')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x0]?_0x101a6e[_0x8410('0x5f')][0x0][_0x8410('0x60')]:undefined)||_0x8410('0x6f')},{'name':'attrSerie2','value':_0x101a6e[_0x8410('0x70')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x1]?_0x101a6e[_0x8410('0x5f')][0x1]['value']:undefined)||null},{'name':_0x8410('0x71'),'value':_0x101a6e[_0x8410('0x71')]||(_0x101a6e['attrs']&&_0x101a6e['attrs'][0x2]?_0x101a6e[_0x8410('0x5f')][0x2][_0x8410('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x101a6e[_0x8410('0x6b')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e['attrs'][0x3]?_0x101a6e[_0x8410('0x5f')][0x3][_0x8410('0x60')]:undefined)||[]}];case'web-report':return[{'name':_0x8410('0x72'),'type':_0x101a6e[_0x8410('0x73')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x0]?_0x101a6e['attrs'][0x0][_0x8410('0x3a')]:undefined)||null,'value':_0x101a6e[_0x8410('0x72')]||(_0x101a6e[_0x8410('0x5f')]&&_0x101a6e[_0x8410('0x5f')][0x0]?_0x101a6e[_0x8410('0x5f')][0x0]['value']:undefined)||null},{'name':_0x8410('0x74'),'value':_0x101a6e[_0x8410('0x74')]||(_0x101a6e['attrs']&&_0x101a6e[_0x8410('0x5f')][0x1]?_0x101a6e['attrs'][0x1][_0x8410('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x91b370){logger[_0x8410('0x32')](_0x8410('0x75'),JSON[_0x8410('0x76')](_0x91b370));return[];}}exports[_0x8410('0x77')]=function(_0x4443d8,_0x35529e,_0x946ef9){if(_0x4443d8[_0x8410('0x51')]['id']){delete _0x4443d8['body']['id'];}return db[_0x8410('0x37')]['find']({'where':{'id':_0x4443d8[_0x8410('0x4d')]['id']}})[_0x8410('0x31')](handleEntityNotFound(_0x35529e,null))[_0x8410('0x31')](function(_0x3db688){if(_0x3db688){_0x4443d8[_0x8410('0x51')]['DashboardId']=_0x3db688['id'];_0x4443d8[_0x8410('0x51')]['attrs']=widgetAttributes(_0x4443d8[_0x8410('0x51')]);return db[_0x8410('0x78')][_0x8410('0x5c')](_0x4443d8[_0x8410('0x51')]);}})[_0x8410('0x31')](respondWithResult(_0x35529e,null))[_0x8410('0x4b')](handleError(_0x35529e,null));};exports['getItems']=function(_0x41e690,_0x37a8ca,_0x128954){var _0x424c8f={};var _0x3b7791={};var _0xf48f04;var _0x1bf033;return db[_0x8410('0x37')]['findOne']({'where':{'id':_0x41e690['params']['id']}})[_0x8410('0x31')](handleEntityNotFound(_0x37a8ca,null))[_0x8410('0x31')](function(_0x10c713){if(_0x10c713){_0xf48f04=_0x10c713;_0x3b7791[_0x8410('0x3b')]=_[_0x8410('0x3c')](db[_0x8410('0x78')][_0x8410('0x38')]);_0x3b7791[_0x8410('0x3d')]=_[_0x8410('0x3c')](_0x41e690['query']);_0x3b7791['filters']=_['intersection'](_0x3b7791[_0x8410('0x3b')],_0x3b7791['query']);_0x424c8f[_0x8410('0x40')]=_['intersection'](_0x3b7791['model'],qs['fields'](_0x41e690[_0x8410('0x3d')][_0x8410('0x41')]));_0x424c8f[_0x8410('0x40')]=_0x424c8f[_0x8410('0x40')][_0x8410('0x42')]?_0x424c8f['attributes']:_0x3b7791[_0x8410('0x3b')];_0x424c8f['order']=qs[_0x8410('0x44')](_0x41e690[_0x8410('0x3d')]['sort']);_0x424c8f[_0x8410('0x45')]=qs[_0x8410('0x3e')](_[_0x8410('0x79')](_0x41e690[_0x8410('0x3d')],_0x3b7791[_0x8410('0x3e')]));if(_0x41e690[_0x8410('0x3d')][_0x8410('0x46')]){_0x424c8f[_0x8410('0x45')]=_[_0x8410('0x4f')](_0x424c8f[_0x8410('0x45')],{'$or':_['map'](_0x424c8f['attributes'],function(_0xead594){var _0x4d2280={};_0x4d2280[_0xead594]={'$like':'%'+_0x41e690[_0x8410('0x3d')][_0x8410('0x46')]+'%'};return _0x4d2280;})});}_0x424c8f=_[_0x8410('0x4f')]({},_0x424c8f,_0x41e690[_0x8410('0x47')]);return _0xf48f04[_0x8410('0x7a')](_0x424c8f);}})[_0x8410('0x31')](function(_0x5c5791){if(_0x5c5791){_0x1bf033=_0x5c5791['length'];if(!_0x41e690[_0x8410('0x3d')][_0x8410('0x7b')](_0x8410('0x43'))){_0x424c8f[_0x8410('0x25')]=qs[_0x8410('0x25')](_0x41e690[_0x8410('0x3d')]['limit']);_0x424c8f['offset']=qs['offset'](_0x41e690[_0x8410('0x3d')][_0x8410('0x27')]);}return _0xf48f04['getItems'](_0x424c8f);}})['then'](function(_0x146b39){if(_0x146b39){return _0x146b39?{'count':_0x1bf033,'rows':_0x146b39}:null;}})[_0x8410('0x31')](respondWithResult(_0x37a8ca,null))[_0x8410('0x4b')](handleError(_0x37a8ca,null));}; \ No newline at end of file +var _0x9303=['intersection','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','fields','length','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','createdAt','CustomDashboards','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','keys','query','filters'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9303,0x131));var _0x3930=function(_0xe1770a,_0x4fc5d6){_0xe1770a=_0xe1770a-0x0;var _0x3e6274=_0x9303[_0xe1770a];return _0x3e6274;};'use strict';var emlformat=require(_0x3930('0x0'));var rimraf=require(_0x3930('0x1'));var zipdir=require(_0x3930('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3930('0x3'));var moment=require(_0x3930('0x4'));var BPromise=require(_0x3930('0x5'));var Mustache=require(_0x3930('0x6'));var util=require(_0x3930('0x7'));var path=require(_0x3930('0x8'));var sox=require('sox');var csv=require(_0x3930('0x9'));var ejs=require(_0x3930('0xa'));var fs=require('fs');var fs_extra=require(_0x3930('0xb'));var _=require(_0x3930('0xc'));var squel=require('squel');var crypto=require(_0x3930('0xd'));var jsforce=require(_0x3930('0xe'));var deskjs=require(_0x3930('0xf'));var toCsv=require(_0x3930('0x9'));var querystring=require(_0x3930('0x10'));var Papa=require(_0x3930('0x11'));var Redis=require(_0x3930('0x12'));var authService=require(_0x3930('0x13'));var qs=require(_0x3930('0x14'));var as=require(_0x3930('0x15'));var hardwareService=require(_0x3930('0x16'));var logger=require(_0x3930('0x17'))(_0x3930('0x18'));var utils=require(_0x3930('0x19'));var config=require(_0x3930('0x1a'));var licenseUtil=require(_0x3930('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3930('0x1c')]=_[_0x3930('0x1d')](config['redis'],{'host':_0x3930('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3930('0x1c')]));require(_0x3930('0x1f'))['register'](socket);function respondWithStatusCode(_0xdcb76d,_0x8183ef){_0x8183ef=_0x8183ef||0xcc;return function(_0x500ec6){if(_0x500ec6){return _0xdcb76d[_0x3930('0x20')](_0x8183ef);}return _0xdcb76d[_0x3930('0x21')](_0x8183ef)[_0x3930('0x22')]();};}function respondWithResult(_0x280050,_0x58aed9){_0x58aed9=_0x58aed9||0xc8;return function(_0x364662){if(_0x364662){return _0x280050['status'](_0x58aed9)['json'](_0x364662);}};}function respondWithFilteredResult(_0x6d6490,_0x2636ff){return function(_0x26f412){if(_0x26f412){var _0x521efe=typeof _0x2636ff[_0x3930('0x23')]===_0x3930('0x24')&&typeof _0x2636ff[_0x3930('0x25')]===_0x3930('0x24');var _0x20eaa2=_0x26f412['count'];var _0x3e34dd=_0x521efe?0x0:_0x2636ff[_0x3930('0x23')];var _0x37b668=_0x521efe?_0x26f412['count']:_0x2636ff[_0x3930('0x23')]+_0x2636ff[_0x3930('0x25')];var _0x26abb3;if(_0x37b668>=_0x20eaa2){_0x37b668=_0x20eaa2;_0x26abb3=0xc8;}else{_0x26abb3=0xce;}_0x6d6490['status'](_0x26abb3);return _0x6d6490[_0x3930('0x26')](_0x3930('0x27'),_0x3e34dd+'-'+_0x37b668+'/'+_0x20eaa2)[_0x3930('0x28')](_0x26f412);}return null;};}function patchUpdates(_0x4ed5b8){return function(_0x531af6){try{jsonpatch[_0x3930('0x29')](_0x531af6,_0x4ed5b8,!![]);}catch(_0x182a54){return BPromise['reject'](_0x182a54);}return _0x531af6['save']();};}function saveUpdates(_0x2b933d,_0x3519fd){return function(_0x3ad0d3){if(_0x3ad0d3){return _0x3ad0d3[_0x3930('0x2a')](_0x2b933d)['then'](function(_0x37cc81){return _0x37cc81;});}return null;};}function removeEntity(_0x2ca253,_0x2635e7){return function(_0x25dd7b){if(_0x25dd7b){return _0x25dd7b[_0x3930('0x2b')]()[_0x3930('0x2c')](function(){var _0x22bc05=_0x25dd7b[_0x3930('0x2d')]({'plain':!![]});var _0x3b4d2d='CustomDashboards';return db[_0x3930('0x2e')][_0x3930('0x2b')]({'where':{'type':_0x3b4d2d,'resourceId':_0x22bc05['id']}})[_0x3930('0x2c')](function(){return _0x25dd7b;});})[_0x3930('0x2c')](function(){_0x2ca253[_0x3930('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x435443,_0x1ddf26){return function(_0x436a03){if(!_0x436a03){_0x435443['sendStatus'](0x194);}return _0x436a03;};}function handleError(_0x204135,_0x1ee636){_0x1ee636=_0x1ee636||0x1f4;return function(_0x5c99a5){logger[_0x3930('0x2f')](_0x5c99a5[_0x3930('0x30')]);if(_0x5c99a5[_0x3930('0x31')]){delete _0x5c99a5[_0x3930('0x31')];}_0x204135[_0x3930('0x21')](_0x1ee636)[_0x3930('0x32')](_0x5c99a5);};}exports[_0x3930('0x33')]=function(_0x444e1d,_0x377ab0){var _0x3e270a={},_0x354e0a={},_0x3c19be={'count':0x0,'rows':[]};var _0x10a794=_[_0x3930('0x34')](db[_0x3930('0x35')]['rawAttributes'],function(_0x12a9bc){return{'name':_0x12a9bc[_0x3930('0x36')],'type':_0x12a9bc[_0x3930('0x37')][_0x3930('0x38')]};});_0x354e0a[_0x3930('0x39')]=_[_0x3930('0x34')](_0x10a794,'name');_0x354e0a['query']=_[_0x3930('0x3a')](_0x444e1d[_0x3930('0x3b')]);_0x354e0a[_0x3930('0x3c')]=_[_0x3930('0x3d')](_0x354e0a[_0x3930('0x39')],_0x354e0a['query']);_0x3e270a['attributes']=_['intersection'](_0x354e0a[_0x3930('0x39')],qs['fields'](_0x444e1d[_0x3930('0x3b')]['fields']));_0x3e270a['attributes']=_0x3e270a[_0x3930('0x3e')]['length']?_0x3e270a[_0x3930('0x3e')]:_0x354e0a['model'];if(!_0x444e1d[_0x3930('0x3b')][_0x3930('0x3f')]('nolimit')){_0x3e270a[_0x3930('0x25')]=qs[_0x3930('0x25')](_0x444e1d[_0x3930('0x3b')][_0x3930('0x25')]);_0x3e270a[_0x3930('0x23')]=qs[_0x3930('0x23')](_0x444e1d[_0x3930('0x3b')][_0x3930('0x23')]);}_0x3e270a[_0x3930('0x40')]=qs[_0x3930('0x41')](_0x444e1d[_0x3930('0x3b')][_0x3930('0x41')]);_0x3e270a['where']=qs[_0x3930('0x3c')](_[_0x3930('0x42')](_0x444e1d[_0x3930('0x3b')],_0x354e0a[_0x3930('0x3c')]),_0x10a794);if(_0x444e1d[_0x3930('0x3b')][_0x3930('0x43')]){_0x3e270a[_0x3930('0x44')]=_[_0x3930('0x45')](_0x3e270a[_0x3930('0x44')],{'$or':_[_0x3930('0x34')](_0x10a794,function(_0x22e8d8){if(_0x22e8d8['type']!==_0x3930('0x46')){var _0x4d062c={};_0x4d062c[_0x22e8d8[_0x3930('0x31')]]={'$like':'%'+_0x444e1d[_0x3930('0x3b')][_0x3930('0x43')]+'%'};return _0x4d062c;}})});}_0x3e270a=_[_0x3930('0x45')]({},_0x3e270a,_0x444e1d[_0x3930('0x47')]);var _0xeedc9f={'where':_0x3e270a['where']};return db[_0x3930('0x35')][_0x3930('0x48')](_0xeedc9f)[_0x3930('0x2c')](function(_0x7bde9e){_0x3c19be[_0x3930('0x48')]=_0x7bde9e;if(_0x444e1d[_0x3930('0x3b')][_0x3930('0x49')]){_0x3e270a['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3e270a);})[_0x3930('0x2c')](function(_0x1974fd){_0x3c19be[_0x3930('0x4a')]=_0x1974fd;return _0x3c19be;})[_0x3930('0x2c')](respondWithFilteredResult(_0x377ab0,_0x3e270a))[_0x3930('0x4b')](handleError(_0x377ab0,null));};exports[_0x3930('0x4c')]=function(_0x34daa0,_0x19b9a7){var _0x49057d={'raw':![],'where':{'id':_0x34daa0[_0x3930('0x4d')]['id']}},_0x484fb2={};_0x484fb2[_0x3930('0x39')]=_['keys'](db['Dashboard'][_0x3930('0x4e')]);_0x484fb2['query']=_[_0x3930('0x3a')](_0x34daa0[_0x3930('0x3b')]);_0x484fb2[_0x3930('0x3c')]=_[_0x3930('0x3d')](_0x484fb2[_0x3930('0x39')],_0x484fb2[_0x3930('0x3b')]);_0x49057d[_0x3930('0x3e')]=_[_0x3930('0x3d')](_0x484fb2[_0x3930('0x39')],qs[_0x3930('0x4f')](_0x34daa0[_0x3930('0x3b')]['fields']));_0x49057d[_0x3930('0x3e')]=_0x49057d[_0x3930('0x3e')][_0x3930('0x50')]?_0x49057d[_0x3930('0x3e')]:_0x484fb2[_0x3930('0x39')];if(_0x34daa0['query']['includeAll']){_0x49057d[_0x3930('0x51')]=[{'all':!![]}];}_0x49057d=_[_0x3930('0x45')]({},_0x49057d,_0x34daa0['options']);return db[_0x3930('0x35')][_0x3930('0x52')](_0x49057d)[_0x3930('0x2c')](handleEntityNotFound(_0x19b9a7,null))['then'](respondWithResult(_0x19b9a7,null))[_0x3930('0x4b')](handleError(_0x19b9a7,null));};exports[_0x3930('0x53')]=function(_0x3169f4,_0x2f2405){return db['Dashboard'][_0x3930('0x53')](_0x3169f4['body'],{})[_0x3930('0x2c')](function(_0x48c733){var _0x2d005f=_0x3169f4[_0x3930('0x54')][_0x3930('0x2d')]({'plain':!![]});if(!_0x2d005f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d005f[_0x3930('0x55')]===_0x3930('0x54')){var _0x4969c3=_0x48c733[_0x3930('0x2d')]({'plain':!![]});var _0x429b0e='CustomDashboards';return db[_0x3930('0x56')]['find']({'where':{'name':_0x429b0e,'userProfileId':_0x2d005f[_0x3930('0x57')]},'raw':!![]})['then'](function(_0x41f08c){if(_0x41f08c&&_0x41f08c[_0x3930('0x58')]===0x0){return db[_0x3930('0x2e')]['create']({'name':_0x4969c3['name'],'resourceId':_0x4969c3['id'],'type':_0x41f08c['name'],'sectionId':_0x41f08c['id']},{})['then'](function(){return _0x48c733;});}else{return _0x48c733;}})[_0x3930('0x4b')](function(_0x2f4c63){logger[_0x3930('0x2f')](_0x3930('0x59'),_0x2f4c63);throw _0x2f4c63;});}return _0x48c733;})[_0x3930('0x2c')](respondWithResult(_0x2f2405,0xc9))[_0x3930('0x4b')](handleError(_0x2f2405,null));};exports['clone']=function(_0x35221d,_0x280acf){var _0x4b2836={'where':{'id':_0x35221d[_0x3930('0x4d')]['id']}},_0x11b14a={};_0x11b14a[_0x3930('0x39')]=_[_0x3930('0x3a')](db[_0x3930('0x35')]['rawAttributes']);_0x4b2836['attributes']=_['intersection'](_0x11b14a[_0x3930('0x39')],qs[_0x3930('0x4f')](_0x35221d[_0x3930('0x3b')][_0x3930('0x4f')]));_0x4b2836[_0x3930('0x3e')]=_0x4b2836[_0x3930('0x3e')]['length']?_0x4b2836['attributes']:_0x11b14a['model'];if(_0x35221d[_0x3930('0x3b')][_0x3930('0x49')]){_0x4b2836['include']=[{'all':!![]}];}_0x4b2836=_[_0x3930('0x45')]({},_0x4b2836,_0x35221d[_0x3930('0x47')]);return db['Dashboard'][_0x3930('0x52')](_0x4b2836)[_0x3930('0x2c')](handleEntityNotFound(_0x280acf,null))[_0x3930('0x2c')](function(_0x40165d){if(_0x40165d){var _0x357433=_0x40165d['get']({'plain':!![]});_0x357433=qs[_0x3930('0x5a')](_0x357433,['id','createdAt',_0x3930('0x5b')]);_0x35221d[_0x3930('0x5c')]=_[_0x3930('0x5a')](_0x35221d[_0x3930('0x5c')],['id',_0x3930('0x5d'),_0x3930('0x5b')]);return db[_0x3930('0x35')][_0x3930('0x53')](_[_0x3930('0x45')](_0x357433,_0x35221d[_0x3930('0x5c')]),{'include':_0x35221d[_0x3930('0x3b')][_0x3930('0x49')]?[{'all':!![]}]:undefined})[_0x3930('0x2c')](function(_0x11ac3a){var _0x2a6c9e=_0x35221d['user']['get']({'plain':!![]});if(!_0x2a6c9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a6c9e[_0x3930('0x55')]==='user'){var _0x4f94cb=_0x11ac3a[_0x3930('0x2d')]({'plain':!![]});var _0xbc5199=_0x3930('0x5e');return db[_0x3930('0x56')][_0x3930('0x52')]({'where':{'name':_0xbc5199,'userProfileId':_0x2a6c9e[_0x3930('0x57')]},'raw':!![]})['then'](function(_0x755b2c){if(_0x755b2c&&_0x755b2c[_0x3930('0x58')]===0x0){return db[_0x3930('0x2e')][_0x3930('0x53')]({'name':_0x4f94cb[_0x3930('0x31')],'resourceId':_0x4f94cb['id'],'type':_0x755b2c[_0x3930('0x31')],'sectionId':_0x755b2c['id']},{})[_0x3930('0x2c')](function(){return _0x11ac3a;});}else{return _0x11ac3a;}})[_0x3930('0x4b')](function(_0xcac16c){logger[_0x3930('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcac16c);throw _0xcac16c;});}return _0x11ac3a;});}})[_0x3930('0x2c')](respondWithResult(_0x280acf,0xc9))['catch'](handleError(_0x280acf,null));};exports[_0x3930('0x2a')]=function(_0x266660,_0x3ada33){if(_0x266660[_0x3930('0x5c')]['id']){delete _0x266660[_0x3930('0x5c')]['id'];}return db[_0x3930('0x35')][_0x3930('0x52')]({'where':{'id':_0x266660['params']['id']}})[_0x3930('0x2c')](handleEntityNotFound(_0x3ada33,null))[_0x3930('0x2c')](saveUpdates(_0x266660['body'],null))[_0x3930('0x2c')](respondWithResult(_0x3ada33,null))[_0x3930('0x4b')](handleError(_0x3ada33,null));};exports[_0x3930('0x2b')]=function(_0x24e1d3,_0x2db255){return db[_0x3930('0x35')][_0x3930('0x52')]({'where':{'id':_0x24e1d3[_0x3930('0x4d')]['id']}})[_0x3930('0x2c')](handleEntityNotFound(_0x2db255,null))[_0x3930('0x2c')](removeEntity(_0x2db255,null))[_0x3930('0x4b')](handleError(_0x2db255,null));};function widgetAttributes(_0x38ceef){try{switch(_0x38ceef['type']){case'iframe':return[{'name':_0x3930('0x5f'),'value':_0x38ceef['attrUrl']||(_0x38ceef['attrs']&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef[_0x3930('0x60')][0x0][_0x3930('0x61')]:undefined)||_0x3930('0x62')}];case'custom':return[{'name':_0x3930('0x63'),'value':_0x38ceef[_0x3930('0x63')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef['attrs'][0x0]['value']:undefined)||''}];case _0x3930('0x64'):return[{'name':_0x3930('0x65'),'value':_0x38ceef[_0x3930('0x65')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef[_0x3930('0x60')][0x0][_0x3930('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x3930('0x66'),'value':_0x38ceef[_0x3930('0x66')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x1]?_0x38ceef['attrs'][0x1][_0x3930('0x61')]:undefined)||_0x3930('0x67')},{'name':_0x3930('0x68'),'value':_0x38ceef[_0x3930('0x68')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x2]?_0x38ceef[_0x3930('0x60')][0x2][_0x3930('0x61')]:undefined)||0xc}];case _0x3930('0x69'):return[{'name':_0x3930('0x6a'),'value':_0x38ceef[_0x3930('0x6a')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef[_0x3930('0x60')][0x0][_0x3930('0x61')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x38ceef[_0x3930('0x6b')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef['attrs'][0x1]?_0x38ceef[_0x3930('0x60')][0x1][_0x3930('0x61')]:undefined)||[]},{'name':_0x3930('0x68'),'value':_0x38ceef[_0x3930('0x68')]||(_0x38ceef['attrs']&&_0x38ceef[_0x3930('0x60')][0x2]?_0x38ceef[_0x3930('0x60')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x3930('0x6c'):return[{'name':_0x3930('0x6d'),'value':_0x38ceef[_0x3930('0x6d')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef[_0x3930('0x60')][0x0][_0x3930('0x61')]:undefined)||_0x3930('0x6e')},{'name':_0x3930('0x6f'),'value':_0x38ceef[_0x3930('0x6f')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x1]?_0x38ceef['attrs'][0x1][_0x3930('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x38ceef[_0x3930('0x70')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x2]?_0x38ceef[_0x3930('0x60')][0x2][_0x3930('0x61')]:undefined)||null},{'name':_0x3930('0x6b'),'value':_0x38ceef['attrVoiceQueues']||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef['attrs'][0x3]?_0x38ceef[_0x3930('0x60')][0x3][_0x3930('0x61')]:undefined)||[]}];case _0x3930('0x71'):return[{'name':_0x3930('0x72'),'type':_0x38ceef['reportType']||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef['attrs'][0x0]?_0x38ceef['attrs'][0x0][_0x3930('0x37')]:undefined)||null,'value':_0x38ceef[_0x3930('0x72')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x0]?_0x38ceef[_0x3930('0x60')][0x0][_0x3930('0x61')]:undefined)||null},{'name':_0x3930('0x73'),'value':_0x38ceef[_0x3930('0x73')]||(_0x38ceef[_0x3930('0x60')]&&_0x38ceef[_0x3930('0x60')][0x1]?_0x38ceef[_0x3930('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x38351d){logger[_0x3930('0x2f')]('widgetAttributes:\x20%s',JSON[_0x3930('0x74')](_0x38351d));return[];}}exports[_0x3930('0x75')]=function(_0x1d1020,_0x68b82a,_0xfec3d6){if(_0x1d1020[_0x3930('0x5c')]['id']){delete _0x1d1020[_0x3930('0x5c')]['id'];}return db[_0x3930('0x35')][_0x3930('0x52')]({'where':{'id':_0x1d1020[_0x3930('0x4d')]['id']}})[_0x3930('0x2c')](handleEntityNotFound(_0x68b82a,null))['then'](function(_0x346e0d){if(_0x346e0d){_0x1d1020[_0x3930('0x5c')][_0x3930('0x76')]=_0x346e0d['id'];_0x1d1020[_0x3930('0x5c')][_0x3930('0x60')]=widgetAttributes(_0x1d1020[_0x3930('0x5c')]);return db[_0x3930('0x77')][_0x3930('0x53')](_0x1d1020['body']);}})[_0x3930('0x2c')](respondWithResult(_0x68b82a,null))[_0x3930('0x4b')](handleError(_0x68b82a,null));};exports[_0x3930('0x78')]=function(_0x3f9c4c,_0x3d9ae7,_0x400fc9){var _0x14c651={};var _0xaedfe1={};var _0x5874e8;var _0x2ab8d0;return db[_0x3930('0x35')][_0x3930('0x79')]({'where':{'id':_0x3f9c4c[_0x3930('0x4d')]['id']}})[_0x3930('0x2c')](handleEntityNotFound(_0x3d9ae7,null))['then'](function(_0x4b0592){if(_0x4b0592){_0x5874e8=_0x4b0592;_0xaedfe1[_0x3930('0x39')]=_[_0x3930('0x3a')](db[_0x3930('0x77')][_0x3930('0x4e')]);_0xaedfe1['query']=_[_0x3930('0x3a')](_0x3f9c4c[_0x3930('0x3b')]);_0xaedfe1[_0x3930('0x3c')]=_[_0x3930('0x3d')](_0xaedfe1[_0x3930('0x39')],_0xaedfe1[_0x3930('0x3b')]);_0x14c651[_0x3930('0x3e')]=_[_0x3930('0x3d')](_0xaedfe1[_0x3930('0x39')],qs[_0x3930('0x4f')](_0x3f9c4c[_0x3930('0x3b')][_0x3930('0x4f')]));_0x14c651[_0x3930('0x3e')]=_0x14c651['attributes'][_0x3930('0x50')]?_0x14c651['attributes']:_0xaedfe1[_0x3930('0x39')];_0x14c651[_0x3930('0x40')]=qs['sort'](_0x3f9c4c[_0x3930('0x3b')][_0x3930('0x41')]);_0x14c651[_0x3930('0x44')]=qs[_0x3930('0x3c')](_[_0x3930('0x42')](_0x3f9c4c[_0x3930('0x3b')],_0xaedfe1[_0x3930('0x3c')]));if(_0x3f9c4c[_0x3930('0x3b')][_0x3930('0x43')]){_0x14c651['where']=_[_0x3930('0x45')](_0x14c651[_0x3930('0x44')],{'$or':_[_0x3930('0x34')](_0x14c651['attributes'],function(_0x278706){var _0x520329={};_0x520329[_0x278706]={'$like':'%'+_0x3f9c4c[_0x3930('0x3b')][_0x3930('0x43')]+'%'};return _0x520329;})});}_0x14c651=_[_0x3930('0x45')]({},_0x14c651,_0x3f9c4c[_0x3930('0x47')]);return _0x5874e8[_0x3930('0x78')](_0x14c651);}})[_0x3930('0x2c')](function(_0x29181b){if(_0x29181b){_0x2ab8d0=_0x29181b[_0x3930('0x50')];if(!_0x3f9c4c[_0x3930('0x3b')]['hasOwnProperty']('nolimit')){_0x14c651[_0x3930('0x25')]=qs[_0x3930('0x25')](_0x3f9c4c[_0x3930('0x3b')][_0x3930('0x25')]);_0x14c651['offset']=qs['offset'](_0x3f9c4c['query'][_0x3930('0x23')]);}return _0x5874e8[_0x3930('0x78')](_0x14c651);}})[_0x3930('0x2c')](function(_0x2397d8){if(_0x2397d8){return _0x2397d8?{'count':_0x2ab8d0,'rows':_0x2397d8}:null;}})[_0x3930('0x2c')](respondWithResult(_0x3d9ae7,null))[_0x3930('0x4b')](handleError(_0x3d9ae7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 247b47e..5dd5ab8 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 _0xdf89=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x404303,_0xcf6dee){var _0x2bb9e5=function(_0x3a2e12){while(--_0x3a2e12){_0x404303['push'](_0x404303['shift']());}};_0x2bb9e5(++_0xcf6dee);}(_0xdf89,0x19c));var _0x9df8=function(_0x1513e4,_0x4f8791){_0x1513e4=_0x1513e4-0x0;var _0x515d22=_0xdf89[_0x1513e4];return _0x515d22;};'use strict';var EventEmitter=require(_0x9df8('0x0'));var Dashboard=require(_0x9df8('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9df8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9df8('0x3'),'afterDestroy':_0x9df8('0x4')};function emitEvent(_0x5198a5){return function(_0x3b3f83,_0x633520,_0x454725){DashboardEvents[_0x9df8('0x5')](_0x5198a5+':'+_0x3b3f83['id'],_0x3b3f83);DashboardEvents['emit'](_0x5198a5,_0x3b3f83);_0x454725(null);};}for(var e in events){if(events[_0x9df8('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x9df8('0x7')]=DashboardEvents; \ No newline at end of file +var _0x016c=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x4dd2b1,_0x56fb2d){var _0x5102d6=function(_0x161927){while(--_0x161927){_0x4dd2b1['push'](_0x4dd2b1['shift']());}};_0x5102d6(++_0x56fb2d);}(_0x016c,0x1da));var _0xc016=function(_0x289488,_0x131729){_0x289488=_0x289488-0x0;var _0x24e7e0=_0x016c[_0x289488];return _0x24e7e0;};'use strict';var EventEmitter=require(_0xc016('0x0'));var Dashboard=require(_0xc016('0x1'))['db'][_0xc016('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc016('0x3'),'afterDestroy':_0xc016('0x4')};function emitEvent(_0x3f1487){return function(_0xe96341,_0x2b697e,_0x9be815){DashboardEvents['emit'](_0x3f1487+':'+_0xe96341['id'],_0xe96341);DashboardEvents[_0xc016('0x5')](_0x3f1487,_0xe96341);_0x9be815(null);};}for(var e in events){if(events[_0xc016('0x6')](e)){var event=events[e];Dashboard[_0xc016('0x7')](e,emitEvent(event));}}module[_0xc016('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index bd6e961..3401c32 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 _0xe8f5=['Dashboard','dashboards','lodash','api','moment','rimraf','../../config/environment'];(function(_0x4da4ac,_0x16767f){var _0x2e757d=function(_0x1c8449){while(--_0x1c8449){_0x4da4ac['push'](_0x4da4ac['shift']());}};_0x2e757d(++_0x16767f);}(_0xe8f5,0x159));var _0x5e8f=function(_0xed8b7d,_0x4af066){_0xed8b7d=_0xed8b7d-0x0;var _0x2ab10d=_0xe8f5[_0xed8b7d];return _0x2ab10d;};'use strict';var _=require(_0x5e8f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e8f('0x1'));var moment=require(_0x5e8f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8f('0x3'));var config=require(_0x5e8f('0x4'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x1011b6,_0x24323b){return _0x1011b6['define'](_0x5e8f('0x5'),attributes,{'tableName':_0x5e8f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66d=['dashboards','lodash','../../config/logger','bluebird','path','rimraf','./dashboard.attributes','exports','define','Dashboard'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xd66d,0x12d));var _0xdd66=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd66d[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xdd66('0x0'));var util=require('util');var logger=require(_0xdd66('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdd66('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd66('0x3'));var rimraf=require(_0xdd66('0x4'));var config=require('../../config/environment');var attributes=require(_0xdd66('0x5'));module[_0xdd66('0x6')]=function(_0x1a5091,_0x1f9143){return _0x1a5091[_0xdd66('0x7')](_0xdd66('0x8'),attributes,{'tableName':_0xdd66('0x9'),'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 1d786e3..6cbe74e 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 _0x81cb=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ec7ba,_0x310e90){var _0x20649d=function(_0x4d2113){while(--_0x4d2113){_0x4ec7ba['push'](_0x4ec7ba['shift']());}};_0x20649d(++_0x310e90);}(_0x81cb,0x124));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb81c('0x0'));var util=require(_0xb81c('0x1'));var moment=require(_0xb81c('0x2'));var BPromise=require(_0xb81c('0x3'));var rs=require(_0xb81c('0x4'));var fs=require('fs');var Redis=require(_0xb81c('0x5'));var db=require(_0xb81c('0x6'))['db'];var utils=require(_0xb81c('0x7'));var logger=require('../../config/logger')(_0xb81c('0x8'));var config=require(_0xb81c('0x9'));var jayson=require(_0xb81c('0xa'));var client=jayson[_0xb81c('0xb')][_0xb81c('0xc')]({'port':0x232a});config[_0xb81c('0xd')]=_[_0xb81c('0xe')](config[_0xb81c('0xd')],{'host':_0xb81c('0xf'),'port':0x18eb});var socket=require(_0xb81c('0x10'))(new Redis(config[_0xb81c('0xd')]));require('./dashboard.socket')[_0xb81c('0x11')](socket);function respondWithRpcPromise(_0x103a7c,_0x1b68fd,_0x152567){return new BPromise(function(_0x25dc31,_0x9fa50){return client[_0xb81c('0x12')](_0x103a7c,_0x152567)[_0xb81c('0x13')](function(_0x36d94a){logger[_0xb81c('0x14')](_0xb81c('0x15'),_0x1b68fd,_0xb81c('0x16'));logger[_0xb81c('0x17')](_0xb81c('0x18'),_0x1b68fd,_0xb81c('0x16'),JSON[_0xb81c('0x19')](_0x36d94a));if(_0x36d94a[_0xb81c('0x1a')]){if(_0x36d94a[_0xb81c('0x1a')]['code']===0x1f4){logger[_0xb81c('0x1a')]('Dashboard,\x20%s,\x20%s',_0x1b68fd,_0x36d94a[_0xb81c('0x1a')]['message']);return _0x9fa50(_0x36d94a[_0xb81c('0x1a')][_0xb81c('0x1b')]);}logger['error'](_0xb81c('0x15'),_0x1b68fd,_0x36d94a[_0xb81c('0x1a')][_0xb81c('0x1b')]);return _0x25dc31(_0x36d94a['error'][_0xb81c('0x1b')]);}else{logger[_0xb81c('0x14')](_0xb81c('0x15'),_0x1b68fd,_0xb81c('0x16'));_0x25dc31(_0x36d94a['result'][_0xb81c('0x1b')]);}})[_0xb81c('0x1c')](function(_0x39bc54){logger[_0xb81c('0x1a')]('Dashboard,\x20%s,\x20%s',_0x1b68fd,_0x39bc54);_0x9fa50(_0x39bc54);});});} \ No newline at end of file +var _0x2630=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x11db78,_0xe15788){var _0x4953fd=function(_0x1a12b4){while(--_0x1a12b4){_0x11db78['push'](_0x11db78['shift']());}};_0x4953fd(++_0xe15788);}(_0x2630,0x12d));var _0x0263=function(_0x5f5b92,_0x168d8f){_0x5f5b92=_0x5f5b92-0x0;var _0x872c86=_0x2630[_0x5f5b92];return _0x872c86;};'use strict';var _=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var moment=require(_0x0263('0x2'));var BPromise=require(_0x0263('0x3'));var rs=require(_0x0263('0x4'));var fs=require('fs');var Redis=require(_0x0263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0263('0x6'));var logger=require(_0x0263('0x7'))(_0x0263('0x8'));var config=require(_0x0263('0x9'));var jayson=require(_0x0263('0xa'));var client=jayson[_0x0263('0xb')]['http']({'port':0x232a});config[_0x0263('0xc')]=_['defaults'](config['redis'],{'host':_0x0263('0xd'),'port':0x18eb});var socket=require(_0x0263('0xe'))(new Redis(config[_0x0263('0xc')]));require(_0x0263('0xf'))['register'](socket);function respondWithRpcPromise(_0x3da824,_0x57b3a7,_0x1123c5){return new BPromise(function(_0x4c2e1,_0x4ac516){return client[_0x0263('0x10')](_0x3da824,_0x1123c5)['then'](function(_0x2d72b1){logger[_0x0263('0x11')](_0x0263('0x12'),_0x57b3a7,_0x0263('0x13'));logger[_0x0263('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x57b3a7,_0x0263('0x13'),JSON[_0x0263('0x15')](_0x2d72b1));if(_0x2d72b1['error']){if(_0x2d72b1['error'][_0x0263('0x16')]===0x1f4){logger[_0x0263('0x17')](_0x0263('0x12'),_0x57b3a7,_0x2d72b1[_0x0263('0x17')][_0x0263('0x18')]);return _0x4ac516(_0x2d72b1[_0x0263('0x17')][_0x0263('0x18')]);}logger[_0x0263('0x17')](_0x0263('0x12'),_0x57b3a7,_0x2d72b1['error'][_0x0263('0x18')]);return _0x4c2e1(_0x2d72b1['error'][_0x0263('0x18')]);}else{logger[_0x0263('0x11')](_0x0263('0x12'),_0x57b3a7,_0x0263('0x13'));_0x4c2e1(_0x2d72b1[_0x0263('0x19')]['message']);}})[_0x0263('0x1a')](function(_0x206b9a){logger['error'](_0x0263('0x12'),_0x57b3a7,_0x206b9a);_0x4ac516(_0x206b9a);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index a048524..337dbb5 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 _0xca6c=['update','emit','removeListener','length','./dashboard.events','save','remove'];(function(_0xbdad09,_0x1512ee){var _0x1b15e2=function(_0x106fbe){while(--_0x106fbe){_0xbdad09['push'](_0xbdad09['shift']());}};_0x1b15e2(++_0x1512ee);}(_0xca6c,0x138));var _0xcca6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca6c[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0xcca6('0x0'));var events=[_0xcca6('0x1'),_0xcca6('0x2'),_0xcca6('0x3')];function createListener(_0x42f7fa,_0x182e01){return function(_0x1ca017){_0x182e01[_0xcca6('0x4')](_0x42f7fa,_0x1ca017);};}function removeListener(_0x203b04,_0x98a662){return function(){DashboardEvents[_0xcca6('0x5')](_0x203b04,_0x98a662);};}exports['register']=function(_0x4cea83){for(var _0x4ffd06=0x0,_0x52549a=events[_0xcca6('0x6')];_0x4ffd06<_0x52549a;_0x4ffd06++){var _0x470f66=events[_0x4ffd06];var _0x15eee1=createListener('dashboard:'+_0x470f66,_0x4cea83);DashboardEvents['on'](_0x470f66,_0x15eee1);}}; \ No newline at end of file +var _0x635c=['save','update','emit','register','length','dashboard:','./dashboard.events'];(function(_0x4cf2bb,_0xc26020){var _0x44e779=function(_0x371446){while(--_0x371446){_0x4cf2bb['push'](_0x4cf2bb['shift']());}};_0x44e779(++_0xc26020);}(_0x635c,0x11e));var _0xc635=function(_0x1e4b51,_0x197df4){_0x1e4b51=_0x1e4b51-0x0;var _0x67594e=_0x635c[_0x1e4b51];return _0x67594e;};'use strict';var DashboardEvents=require(_0xc635('0x0'));var events=[_0xc635('0x1'),'remove',_0xc635('0x2')];function createListener(_0x222ad0,_0x3ae0fa){return function(_0x2ec458){_0x3ae0fa[_0xc635('0x3')](_0x222ad0,_0x2ec458);};}function removeListener(_0x35f276,_0x14b7e5){return function(){DashboardEvents['removeListener'](_0x35f276,_0x14b7e5);};}exports[_0xc635('0x4')]=function(_0x22ef8a){for(var _0x1c5f7a=0x0,_0xc16d16=events[_0xc635('0x5')];_0x1c5f7a<_0xc16d16;_0x1c5f7a++){var _0x153962=events[_0x1c5f7a];var _0x2c520a=createListener(_0xc635('0x6')+_0x153962,_0x22ef8a);DashboardEvents['on'](_0x153962,_0x2c520a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d373bf0..0d57d2a 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 _0xb979=['isAuthenticated','index','/:id','show','/:id/items','post','/:id/clone','addItem','put','update','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x21dda3,_0x58d8bf){var _0x12295f=function(_0x1f4c63){while(--_0x1f4c63){_0x21dda3['push'](_0x21dda3['shift']());}};_0x12295f(++_0x58d8bf);}(_0xb979,0xc0));var _0x9b97=function(_0x130fd0,_0x331cd0){_0x130fd0=_0x130fd0-0x0;var _0xa2c9fa=_0xb979[_0x130fd0];return _0xa2c9fa;};'use strict';var multer=require(_0x9b97('0x0'));var util=require(_0x9b97('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b97('0x2'));var router=express[_0x9b97('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9b97('0x4'));var config=require(_0x9b97('0x5'));var controller=require(_0x9b97('0x6'));router[_0x9b97('0x7')]('/',auth[_0x9b97('0x8')](),controller[_0x9b97('0x9')]);router[_0x9b97('0x7')](_0x9b97('0xa'),auth[_0x9b97('0x8')](),controller[_0x9b97('0xb')]);router['get'](_0x9b97('0xc'),auth['isAuthenticated'](),controller['getItems']);router[_0x9b97('0xd')]('/',auth[_0x9b97('0x8')](),controller['create']);router[_0x9b97('0xd')](_0x9b97('0xe'),auth[_0x9b97('0x8')](),controller['clone']);router[_0x9b97('0xd')](_0x9b97('0xc'),auth[_0x9b97('0x8')](),controller[_0x9b97('0xf')]);router[_0x9b97('0x10')](_0x9b97('0xa'),auth[_0x9b97('0x8')](),controller[_0x9b97('0x11')]);router['delete'](_0x9b97('0xa'),auth['isAuthenticated'](),controller[_0x9b97('0x12')]);module[_0x9b97('0x13')]=router; \ No newline at end of file +var _0x014a=['create','/:id/clone','clone','addItem','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x014a,0x127));var _0xa014=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x014a[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xa014('0x0'));var util=require(_0xa014('0x1'));var path=require(_0xa014('0x2'));var timeout=require(_0xa014('0x3'));var express=require(_0xa014('0x4'));var router=express[_0xa014('0x5')]();var fs_extra=require(_0xa014('0x6'));var auth=require(_0xa014('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa014('0x8'));var controller=require(_0xa014('0x9'));router[_0xa014('0xa')]('/',auth[_0xa014('0xb')](),controller[_0xa014('0xc')]);router[_0xa014('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa014('0xd')]);router[_0xa014('0xa')](_0xa014('0xe'),auth['isAuthenticated'](),controller[_0xa014('0xf')]);router[_0xa014('0x10')]('/',auth[_0xa014('0xb')](),controller[_0xa014('0x11')]);router[_0xa014('0x10')](_0xa014('0x12'),auth[_0xa014('0xb')](),controller[_0xa014('0x13')]);router['post'](_0xa014('0xe'),auth[_0xa014('0xb')](),controller[_0xa014('0x14')]);router[_0xa014('0x15')]('/:id',auth[_0xa014('0xb')](),controller[_0xa014('0x16')]);router[_0xa014('0x17')](_0xa014('0x18'),auth[_0xa014('0xb')](),controller[_0xa014('0x19')]);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 9d8d91d..2a7adfa 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 _0xadb5=['long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','exports','STRING'];(function(_0x234609,_0x5006ef){var _0x126663=function(_0x15ffd1){while(--_0x15ffd1){_0x234609['push'](_0x234609['shift']());}};_0x126663(++_0x5006ef);}(_0xadb5,0xad));var _0x5adb=function(_0x38d317,_0x4cb317){_0x38d317=_0x38d317-0x0;var _0x1cc200=_0xadb5[_0x38d317];return _0x1cc200;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5adb('0x0'));var _=require('lodash');module[_0x5adb('0x1')]={'title':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5adb('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5adb('0x3')),'get':function(){try{return JSON[_0x5adb('0x4')](this[_0x5adb('0x5')]('attrs'));}catch(_0x35a5d3){return[];}},'set':function(_0x168d89){try{this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')](_0x168d89));}catch(_0x353885){this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5adb('0x9')]},'col':{'type':Sequelize[_0x5adb('0x9')]},'background':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5adb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5adb('0x2')]},'titleFontSize':{'type':Sequelize[_0x5adb('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x37605c,_0x55a489){var _0x422da6=function(_0x2dbf42){while(--_0x2dbf42){_0x37605c['push'](_0x37605c['shift']());}};_0x422da6(++_0x55a489);}(_0x687b,0x14a));var _0xb687=function(_0xe1b12b,_0x241bd1){_0xe1b12b=_0xe1b12b-0x0;var _0x1b697a=_0x687b[_0xe1b12b];return _0x1b697a;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'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 d6d7e49..c3b4dd8 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 _0x463d=['attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','keys','DashboardItem','rawAttributes','query','filters','intersection','model','length','attributes','includeAll','options','find','params','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00'];(function(_0x2ab639,_0x2deb8f){var _0x4c3d3c=function(_0x38fc14){while(--_0x38fc14){_0x2ab639['push'](_0x2ab639['shift']());}};_0x4c3d3c(++_0x2deb8f);}(_0x463d,0xc6));var _0xd463=function(_0x1abf9a,_0x387303){_0x1abf9a=_0x1abf9a-0x0;var _0x310361=_0x463d[_0x1abf9a];return _0x310361;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd463('0x0'));var zipdir=require(_0xd463('0x1'));var jsonpatch=require(_0xd463('0x2'));var rp=require(_0xd463('0x3'));var moment=require('moment');var BPromise=require(_0xd463('0x4'));var Mustache=require(_0xd463('0x5'));var util=require(_0xd463('0x6'));var path=require(_0xd463('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd463('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd463('0x9'));var squel=require(_0xd463('0xa'));var crypto=require(_0xd463('0xb'));var jsforce=require(_0xd463('0xc'));var deskjs=require(_0xd463('0xd'));var toCsv=require(_0xd463('0xe'));var querystring=require(_0xd463('0xf'));var Papa=require(_0xd463('0x10'));var Redis=require(_0xd463('0x11'));var authService=require(_0xd463('0x12'));var qs=require(_0xd463('0x13'));var as=require(_0xd463('0x14'));var hardwareService=require(_0xd463('0x15'));var logger=require(_0xd463('0x16'))(_0xd463('0x17'));var utils=require(_0xd463('0x18'));var config=require(_0xd463('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd463('0x1a'))['db'];config[_0xd463('0x1b')]=_[_0xd463('0x1c')](config[_0xd463('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd463('0x1d'))(new Redis(config[_0xd463('0x1b')]));require(_0xd463('0x1e'))[_0xd463('0x1f')](socket);function respondWithStatusCode(_0x39e143,_0x4d206c){_0x4d206c=_0x4d206c||0xcc;return function(_0x2c3e46){if(_0x2c3e46){return _0x39e143['sendStatus'](_0x4d206c);}return _0x39e143['status'](_0x4d206c)[_0xd463('0x20')]();};}function respondWithResult(_0x3f2fcd,_0x2e5fde){_0x2e5fde=_0x2e5fde||0xc8;return function(_0x3b0b9a){if(_0x3b0b9a){return _0x3f2fcd[_0xd463('0x21')](_0x2e5fde)[_0xd463('0x22')](_0x3b0b9a);}};}function respondWithFilteredResult(_0x19d00d,_0x3f5586){return function(_0x12c472){if(_0x12c472){var _0x3f1d94=typeof _0x3f5586[_0xd463('0x23')]===_0xd463('0x24')&&typeof _0x3f5586['limit']===_0xd463('0x24');var _0x4a77b7=_0x12c472[_0xd463('0x25')];var _0x3a87d1=_0x3f1d94?0x0:_0x3f5586['offset'];var _0x2c5c81=_0x3f1d94?_0x12c472[_0xd463('0x25')]:_0x3f5586['offset']+_0x3f5586[_0xd463('0x26')];var _0x5d8e56;if(_0x2c5c81>=_0x4a77b7){_0x2c5c81=_0x4a77b7;_0x5d8e56=0xc8;}else{_0x5d8e56=0xce;}_0x19d00d[_0xd463('0x21')](_0x5d8e56);return _0x19d00d[_0xd463('0x27')](_0xd463('0x28'),_0x3a87d1+'-'+_0x2c5c81+'/'+_0x4a77b7)[_0xd463('0x22')](_0x12c472);}return null;};}function patchUpdates(_0x2b1450){return function(_0x3b06e5){try{jsonpatch[_0xd463('0x29')](_0x3b06e5,_0x2b1450,!![]);}catch(_0x2a79d7){return BPromise['reject'](_0x2a79d7);}return _0x3b06e5[_0xd463('0x2a')]();};}function saveUpdates(_0x2906b3,_0x2375f4){return function(_0x35a614){if(_0x35a614){return _0x35a614['update'](_0x2906b3)['then'](function(_0x2e0819){return _0x2e0819;});}return null;};}function removeEntity(_0x58d5ea,_0x5cb0b3){return function(_0x25a696){if(_0x25a696){return _0x25a696[_0xd463('0x2b')]()[_0xd463('0x2c')](function(){_0x58d5ea[_0xd463('0x21')](0xcc)[_0xd463('0x20')]();});}};}function handleEntityNotFound(_0x2ee811,_0x2fbb47){return function(_0x328265){if(!_0x328265){_0x2ee811['sendStatus'](0x194);}return _0x328265;};}function handleError(_0x1407d0,_0x3bbdf4){_0x3bbdf4=_0x3bbdf4||0x1f4;return function(_0x1a5e1d){logger[_0xd463('0x2d')](_0x1a5e1d[_0xd463('0x2e')]);if(_0x1a5e1d[_0xd463('0x2f')]){delete _0x1a5e1d[_0xd463('0x2f')];}_0x1407d0[_0xd463('0x21')](_0x3bbdf4)[_0xd463('0x30')](_0x1a5e1d);};}exports['show']=function(_0x40d548,_0x46d968){var _0x31b461={'raw':![],'where':{'id':_0x40d548['params']['id']}},_0x351877={};_0x351877['model']=_[_0xd463('0x31')](db[_0xd463('0x32')][_0xd463('0x33')]);_0x351877[_0xd463('0x34')]=_['keys'](_0x40d548[_0xd463('0x34')]);_0x351877[_0xd463('0x35')]=_[_0xd463('0x36')](_0x351877[_0xd463('0x37')],_0x351877[_0xd463('0x34')]);_0x31b461['attributes']=_[_0xd463('0x36')](_0x351877[_0xd463('0x37')],qs['fields'](_0x40d548[_0xd463('0x34')]['fields']));_0x31b461['attributes']=_0x31b461['attributes'][_0xd463('0x38')]?_0x31b461[_0xd463('0x39')]:_0x351877['model'];if(_0x40d548[_0xd463('0x34')][_0xd463('0x3a')]){_0x31b461['include']=[{'all':!![]}];}_0x31b461=_['merge']({},_0x31b461,_0x40d548[_0xd463('0x3b')]);return db[_0xd463('0x32')][_0xd463('0x3c')](_0x31b461)['then'](handleEntityNotFound(_0x46d968,null))[_0xd463('0x2c')](respondWithResult(_0x46d968,null))['catch'](handleError(_0x46d968,null));};exports[_0xd463('0x2b')]=function(_0x13f49f,_0x208eaa){return db[_0xd463('0x32')]['find']({'where':{'id':_0x13f49f[_0xd463('0x3d')]['id']}})[_0xd463('0x2c')](handleEntityNotFound(_0x208eaa,null))[_0xd463('0x2c')](removeEntity(_0x208eaa,null))['catch'](handleError(_0x208eaa,null));};function widgetAttributes(_0x4cfbf1){try{switch(_0x4cfbf1['type']){case'iframe':return[{'name':'attrUrl','value':_0x4cfbf1[_0xd463('0x3e')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0]['value']:undefined)||_0xd463('0x40')}];case _0xd463('0x41'):return[{'name':_0xd463('0x42'),'value':_0x4cfbf1[_0xd463('0x42')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x0]?_0x4cfbf1['attrs'][0x0][_0xd463('0x43')]:undefined)||''}];case _0xd463('0x44'):return[{'name':_0xd463('0x45'),'value':_0x4cfbf1[_0xd463('0x45')]||(_0x4cfbf1['attrs']&&_0x4cfbf1[_0xd463('0x3f')][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0][_0xd463('0x43')]:undefined)||'HH:mm:ss'},{'name':_0xd463('0x46'),'value':_0x4cfbf1['attrTimezone']||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x1]?_0x4cfbf1[_0xd463('0x3f')][0x1][_0xd463('0x43')]:undefined)||_0xd463('0x47')},{'name':_0xd463('0x48'),'value':_0x4cfbf1[_0xd463('0x48')]||(_0x4cfbf1['attrs']&&_0x4cfbf1[_0xd463('0x3f')][0x2]?_0x4cfbf1[_0xd463('0x3f')][0x2][_0xd463('0x43')]:undefined)||0xc}];case _0xd463('0x49'):return[{'name':_0xd463('0x4a'),'value':_0x4cfbf1[_0xd463('0x4a')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0]['value']:undefined)||_0xd463('0x4b')},{'name':_0xd463('0x4c'),'value':_0x4cfbf1[_0xd463('0x4c')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x1]?_0x4cfbf1['attrs'][0x1][_0xd463('0x43')]:undefined)||[]},{'name':'attrFontSize','value':_0x4cfbf1['attrFontSize']||(_0x4cfbf1['attrs']&&_0x4cfbf1[_0xd463('0x3f')][0x2]?_0x4cfbf1['attrs'][0x2][_0xd463('0x43')]:undefined)||0x14}];case _0xd463('0x4d'):case _0xd463('0x4e'):return[{'name':'attrSerie1','value':_0x4cfbf1['attrSerie1']||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0][_0xd463('0x43')]:undefined)||_0xd463('0x4b')},{'name':'attrSerie2','value':_0x4cfbf1['attrSerie2']||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x1]?_0x4cfbf1[_0xd463('0x3f')][0x1]['value']:undefined)||null},{'name':_0xd463('0x4f'),'value':_0x4cfbf1[_0xd463('0x4f')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x2]?_0x4cfbf1[_0xd463('0x3f')][0x2][_0xd463('0x43')]:undefined)||null},{'name':_0xd463('0x4c'),'value':_0x4cfbf1[_0xd463('0x4c')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x3]?_0x4cfbf1['attrs'][0x3][_0xd463('0x43')]:undefined)||[]}];case _0xd463('0x50'):return[{'name':_0xd463('0x51'),'type':_0x4cfbf1[_0xd463('0x52')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1[_0xd463('0x3f')][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0][_0xd463('0x53')]:undefined)||null,'value':_0x4cfbf1[_0xd463('0x51')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x0]?_0x4cfbf1[_0xd463('0x3f')][0x0][_0xd463('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x4cfbf1[_0xd463('0x54')]||(_0x4cfbf1[_0xd463('0x3f')]&&_0x4cfbf1['attrs'][0x1]?_0x4cfbf1['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3f705d){logger[_0xd463('0x2d')](_0xd463('0x55'),JSON[_0xd463('0x56')](_0x3f705d));return[];}}exports[_0xd463('0x57')]=function(_0x48c1af,_0xaab221){if(_0x48c1af['body']){_0x48c1af['body'][_0xd463('0x3f')]=widgetAttributes(_0x48c1af[_0xd463('0x58')]);}return db[_0xd463('0x32')]['create'](_0x48c1af[_0xd463('0x58')],{})['then'](respondWithResult(_0xaab221,0xc9))[_0xd463('0x59')](handleError(_0xaab221,null));};exports['update']=function(_0x19c6e5,_0x293afc){if(_0x19c6e5[_0xd463('0x58')]['id']){delete _0x19c6e5['body']['id'];}_0x19c6e5[_0xd463('0x58')]['attrs']=widgetAttributes(_0x19c6e5[_0xd463('0x58')]);return db[_0xd463('0x32')]['find']({'where':{'id':_0x19c6e5['params']['id']}})[_0xd463('0x2c')](handleEntityNotFound(_0x293afc,null))[_0xd463('0x2c')](saveUpdates(_0x19c6e5[_0xd463('0x58')],null))[_0xd463('0x2c')](respondWithResult(_0x293afc,null))[_0xd463('0x59')](handleError(_0x293afc,null));}; \ No newline at end of file +var _0x742c=['catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','options','DashboardItem','find'];(function(_0x4950f3,_0x34f738){var _0x3d99fc=function(_0x233ecf){while(--_0x233ecf){_0x4950f3['push'](_0x4950f3['shift']());}};_0x3d99fc(++_0x34f738);}(_0x742c,0x1c6));var _0xc742=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x742c[_0x3bcf9e];return _0x1bb37c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc742('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc742('0x1'));var rp=require(_0xc742('0x2'));var moment=require('moment');var BPromise=require(_0xc742('0x3'));var Mustache=require(_0xc742('0x4'));var util=require('util');var path=require(_0xc742('0x5'));var sox=require('sox');var csv=require(_0xc742('0x6'));var ejs=require(_0xc742('0x7'));var fs=require('fs');var fs_extra=require(_0xc742('0x8'));var _=require(_0xc742('0x9'));var squel=require(_0xc742('0xa'));var crypto=require(_0xc742('0xb'));var jsforce=require(_0xc742('0xc'));var deskjs=require(_0xc742('0xd'));var toCsv=require(_0xc742('0x6'));var querystring=require(_0xc742('0xe'));var Papa=require(_0xc742('0xf'));var Redis=require(_0xc742('0x10'));var authService=require(_0xc742('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc742('0x12'));var logger=require('../../config/logger')(_0xc742('0x13'));var utils=require('../../config/utils');var config=require(_0xc742('0x14'));var licenseUtil=require(_0xc742('0x15'));var db=require(_0xc742('0x16'))['db'];config[_0xc742('0x17')]=_[_0xc742('0x18')](config[_0xc742('0x17')],{'host':_0xc742('0x19'),'port':0x18eb});var socket=require(_0xc742('0x1a'))(new Redis(config['redis']));require(_0xc742('0x1b'))[_0xc742('0x1c')](socket);function respondWithStatusCode(_0x201695,_0xaf3140){_0xaf3140=_0xaf3140||0xcc;return function(_0x55a547){if(_0x55a547){return _0x201695[_0xc742('0x1d')](_0xaf3140);}return _0x201695[_0xc742('0x1e')](_0xaf3140)[_0xc742('0x1f')]();};}function respondWithResult(_0x3565a1,_0x1e6d80){_0x1e6d80=_0x1e6d80||0xc8;return function(_0x138f06){if(_0x138f06){return _0x3565a1[_0xc742('0x1e')](_0x1e6d80)['json'](_0x138f06);}};}function respondWithFilteredResult(_0x29c04e,_0x2e7e5a){return function(_0x8d3c6b){if(_0x8d3c6b){var _0x4942c1=typeof _0x2e7e5a[_0xc742('0x20')]===_0xc742('0x21')&&typeof _0x2e7e5a[_0xc742('0x22')]===_0xc742('0x21');var _0x18356b=_0x8d3c6b[_0xc742('0x23')];var _0x581a32=_0x4942c1?0x0:_0x2e7e5a['offset'];var _0x87cfc4=_0x4942c1?_0x8d3c6b['count']:_0x2e7e5a[_0xc742('0x20')]+_0x2e7e5a[_0xc742('0x22')];var _0xb7f9cd;if(_0x87cfc4>=_0x18356b){_0x87cfc4=_0x18356b;_0xb7f9cd=0xc8;}else{_0xb7f9cd=0xce;}_0x29c04e[_0xc742('0x1e')](_0xb7f9cd);return _0x29c04e['set'](_0xc742('0x24'),_0x581a32+'-'+_0x87cfc4+'/'+_0x18356b)[_0xc742('0x25')](_0x8d3c6b);}return null;};}function patchUpdates(_0x3b1f61){return function(_0xc43014){try{jsonpatch[_0xc742('0x26')](_0xc43014,_0x3b1f61,!![]);}catch(_0x2f524e){return BPromise[_0xc742('0x27')](_0x2f524e);}return _0xc43014[_0xc742('0x28')]();};}function saveUpdates(_0x5cfc6c,_0xc4eae4){return function(_0x412e5b){if(_0x412e5b){return _0x412e5b[_0xc742('0x29')](_0x5cfc6c)['then'](function(_0x2a2258){return _0x2a2258;});}return null;};}function removeEntity(_0x2cf154,_0x114bfb){return function(_0x54d990){if(_0x54d990){return _0x54d990[_0xc742('0x2a')]()[_0xc742('0x2b')](function(){_0x2cf154['status'](0xcc)[_0xc742('0x1f')]();});}};}function handleEntityNotFound(_0x37496e,_0x2d9f6f){return function(_0x5255da){if(!_0x5255da){_0x37496e['sendStatus'](0x194);}return _0x5255da;};}function handleError(_0x23644e,_0x2ccc03){_0x2ccc03=_0x2ccc03||0x1f4;return function(_0x1e7f41){logger[_0xc742('0x2c')](_0x1e7f41[_0xc742('0x2d')]);if(_0x1e7f41[_0xc742('0x2e')]){delete _0x1e7f41['name'];}_0x23644e[_0xc742('0x1e')](_0x2ccc03)[_0xc742('0x2f')](_0x1e7f41);};}exports['show']=function(_0x1867cc,_0x57fc41){var _0x5d24d8={'raw':![],'where':{'id':_0x1867cc[_0xc742('0x30')]['id']}},_0x4ff7f6={};_0x4ff7f6[_0xc742('0x31')]=_[_0xc742('0x32')](db['DashboardItem'][_0xc742('0x33')]);_0x4ff7f6[_0xc742('0x34')]=_[_0xc742('0x32')](_0x1867cc[_0xc742('0x34')]);_0x4ff7f6[_0xc742('0x35')]=_[_0xc742('0x36')](_0x4ff7f6['model'],_0x4ff7f6[_0xc742('0x34')]);_0x5d24d8[_0xc742('0x37')]=_[_0xc742('0x36')](_0x4ff7f6['model'],qs[_0xc742('0x38')](_0x1867cc[_0xc742('0x34')][_0xc742('0x38')]));_0x5d24d8['attributes']=_0x5d24d8[_0xc742('0x37')]['length']?_0x5d24d8['attributes']:_0x4ff7f6[_0xc742('0x31')];if(_0x1867cc[_0xc742('0x34')][_0xc742('0x39')]){_0x5d24d8['include']=[{'all':!![]}];}_0x5d24d8=_[_0xc742('0x3a')]({},_0x5d24d8,_0x1867cc[_0xc742('0x3b')]);return db[_0xc742('0x3c')][_0xc742('0x3d')](_0x5d24d8)[_0xc742('0x2b')](handleEntityNotFound(_0x57fc41,null))[_0xc742('0x2b')](respondWithResult(_0x57fc41,null))[_0xc742('0x3e')](handleError(_0x57fc41,null));};exports[_0xc742('0x2a')]=function(_0x663373,_0x1909d6){return db[_0xc742('0x3c')]['find']({'where':{'id':_0x663373[_0xc742('0x30')]['id']}})['then'](handleEntityNotFound(_0x1909d6,null))[_0xc742('0x2b')](removeEntity(_0x1909d6,null))[_0xc742('0x3e')](handleError(_0x1909d6,null));};function widgetAttributes(_0x1e1b92){try{switch(_0x1e1b92[_0xc742('0x3f')]){case'iframe':return[{'name':_0xc742('0x40'),'value':_0x1e1b92[_0xc742('0x40')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x0]?_0x1e1b92[_0xc742('0x41')][0x0][_0xc742('0x42')]:undefined)||_0xc742('0x43')}];case _0xc742('0x44'):return[{'name':_0xc742('0x45'),'value':_0x1e1b92[_0xc742('0x45')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x0]?_0x1e1b92['attrs'][0x0][_0xc742('0x42')]:undefined)||''}];case _0xc742('0x46'):return[{'name':_0xc742('0x47'),'value':_0x1e1b92[_0xc742('0x47')]||(_0x1e1b92['attrs']&&_0x1e1b92['attrs'][0x0]?_0x1e1b92[_0xc742('0x41')][0x0][_0xc742('0x42')]:undefined)||_0xc742('0x48')},{'name':_0xc742('0x49'),'value':_0x1e1b92[_0xc742('0x49')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92['attrs'][0x1]?_0x1e1b92[_0xc742('0x41')][0x1][_0xc742('0x42')]:undefined)||_0xc742('0x4a')},{'name':_0xc742('0x4b'),'value':_0x1e1b92['attrFontSize']||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92['attrs'][0x2]?_0x1e1b92['attrs'][0x2][_0xc742('0x42')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1e1b92['attrMetric']||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92['attrs'][0x0]?_0x1e1b92['attrs'][0x0][_0xc742('0x42')]:undefined)||_0xc742('0x4c')},{'name':_0xc742('0x4d'),'value':_0x1e1b92[_0xc742('0x4d')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92['attrs'][0x1]?_0x1e1b92[_0xc742('0x41')][0x1][_0xc742('0x42')]:undefined)||[]},{'name':_0xc742('0x4b'),'value':_0x1e1b92[_0xc742('0x4b')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92['attrs'][0x2]?_0x1e1b92[_0xc742('0x41')][0x2][_0xc742('0x42')]:undefined)||0x14}];case _0xc742('0x4e'):case'pie-chart':return[{'name':_0xc742('0x4f'),'value':_0x1e1b92[_0xc742('0x4f')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x0]?_0x1e1b92[_0xc742('0x41')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x1e1b92['attrSerie2']||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x1]?_0x1e1b92['attrs'][0x1]['value']:undefined)||null},{'name':_0xc742('0x50'),'value':_0x1e1b92['attrSerie3']||(_0x1e1b92['attrs']&&_0x1e1b92[_0xc742('0x41')][0x2]?_0x1e1b92['attrs'][0x2][_0xc742('0x42')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1e1b92['attrVoiceQueues']||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x3]?_0x1e1b92[_0xc742('0x41')][0x3][_0xc742('0x42')]:undefined)||[]}];case _0xc742('0x51'):return[{'name':_0xc742('0x52'),'type':_0x1e1b92[_0xc742('0x53')]||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x0]?_0x1e1b92[_0xc742('0x41')][0x0][_0xc742('0x3f')]:undefined)||null,'value':_0x1e1b92['attrReport']||(_0x1e1b92['attrs']&&_0x1e1b92[_0xc742('0x41')][0x0]?_0x1e1b92[_0xc742('0x41')][0x0][_0xc742('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x1e1b92['attrRefresh']||(_0x1e1b92[_0xc742('0x41')]&&_0x1e1b92[_0xc742('0x41')][0x1]?_0x1e1b92[_0xc742('0x41')][0x1][_0xc742('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x2400f7){logger[_0xc742('0x2c')]('widgetAttributes:\x20%s',JSON['stringify'](_0x2400f7));return[];}}exports[_0xc742('0x54')]=function(_0x55b487,_0xf00979){if(_0x55b487[_0xc742('0x55')]){_0x55b487[_0xc742('0x55')]['attrs']=widgetAttributes(_0x55b487[_0xc742('0x55')]);}return db['DashboardItem']['create'](_0x55b487[_0xc742('0x55')],{})[_0xc742('0x2b')](respondWithResult(_0xf00979,0xc9))[_0xc742('0x3e')](handleError(_0xf00979,null));};exports['update']=function(_0x58da7e,_0x1f33d4){if(_0x58da7e['body']['id']){delete _0x58da7e[_0xc742('0x55')]['id'];}_0x58da7e['body'][_0xc742('0x41')]=widgetAttributes(_0x58da7e[_0xc742('0x55')]);return db[_0xc742('0x3c')]['find']({'where':{'id':_0x58da7e[_0xc742('0x30')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x1f33d4,null))[_0xc742('0x2b')](saveUpdates(_0x58da7e[_0xc742('0x55')],null))[_0xc742('0x2b')](respondWithResult(_0x1f33d4,null))[_0xc742('0x3e')](handleError(_0x1f33d4,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e010970..aaa622a 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 _0xacc6=['emit','hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','remove'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xacc6,0x150));var _0x6acc=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xacc6[_0x33c9f8];return _0x2d7004;};'use strict';var EventEmitter=require(_0x6acc('0x0'));var DashboardItem=require(_0x6acc('0x1'))['db'][_0x6acc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6acc('0x3')](0x0);var events={'afterCreate':_0x6acc('0x4'),'afterUpdate':'update','afterDestroy':_0x6acc('0x5')};function emitEvent(_0x14a0d1){return function(_0x2ff2ff,_0x53dcdb,_0x148455){DashboardItemEvents['emit'](_0x14a0d1+':'+_0x2ff2ff['id'],_0x2ff2ff);DashboardItemEvents[_0x6acc('0x6')](_0x14a0d1,_0x2ff2ff);_0x148455(null);};}for(var e in events){if(events[_0x6acc('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x6acc('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x44ec=['DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2d5b7f,_0x2b968c){var _0x144e83=function(_0x4bbd21){while(--_0x4bbd21){_0x2d5b7f['push'](_0x2d5b7f['shift']());}};_0x144e83(++_0x2b968c);}(_0x44ec,0x73));var _0xc44e=function(_0x4dbda8,_0xbce830){_0x4dbda8=_0x4dbda8-0x0;var _0x1149ed=_0x44ec[_0x4dbda8];return _0x1149ed;};'use strict';var EventEmitter=require(_0xc44e('0x0'));var DashboardItem=require(_0xc44e('0x1'))['db'][_0xc44e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc44e('0x3')](0x0);var events={'afterCreate':_0xc44e('0x4'),'afterUpdate':'update','afterDestroy':_0xc44e('0x5')};function emitEvent(_0x1f270e){return function(_0x43396a,_0x324274,_0x5548d0){DashboardItemEvents[_0xc44e('0x6')](_0x1f270e+':'+_0x43396a['id'],_0x43396a);DashboardItemEvents['emit'](_0x1f270e,_0x43396a);_0x5548d0(null);};}for(var e in events){if(events[_0xc44e('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xc44e('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index eb0bebb..c3fee63 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 _0x8f7e=['DashboardItem','dashboard_items','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x8f7e,0x12e));var _0xe8f7=function(_0x1fefa,_0x294d6f){_0x1fefa=_0x1fefa-0x0;var _0x51ab8c=_0x8f7e[_0x1fefa];return _0x51ab8c;};'use strict';var _=require('lodash');var util=require(_0xe8f7('0x0'));var logger=require(_0xe8f7('0x1'))(_0xe8f7('0x2'));var moment=require('moment');var BPromise=require(_0xe8f7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8f7('0x4'));var rimraf=require(_0xe8f7('0x5'));var config=require(_0xe8f7('0x6'));var attributes=require(_0xe8f7('0x7'));module[_0xe8f7('0x8')]=function(_0x10817e,_0x4a91a4){return _0x10817e[_0xe8f7('0x9')](_0xe8f7('0xa'),attributes,{'tableName':_0xe8f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76e0=['request-promise','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','api','bluebird'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x76e0,0x18e));var _0x076e=function(_0x39581a,_0x184e97){_0x39581a=_0x39581a-0x0;var _0x231b21=_0x76e0[_0x39581a];return _0x231b21;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x076e('0x0'));var moment=require('moment');var BPromise=require(_0x076e('0x1'));var rp=require(_0x076e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x076e('0x3'));var config=require('../../config/environment');var attributes=require(_0x076e('0x4'));module[_0x076e('0x5')]=function(_0x51699f,_0x4c7016){return _0x51699f['define'](_0x076e('0x6'),attributes,{'tableName':_0x076e('0x7'),'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 bd4cc9c..511e75d 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 _0xca18=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x4ecee4,_0x423442){var _0x3ac693=function(_0x34028a){while(--_0x34028a){_0x4ecee4['push'](_0x4ecee4['shift']());}};_0x3ac693(++_0x423442);}(_0xca18,0x95));var _0x8ca1=function(_0x39551a,_0x116007){_0x39551a=_0x39551a-0x0;var _0x4b0b62=_0xca18[_0x39551a];return _0x4b0b62;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8ca1('0x0'));var rs=require(_0x8ca1('0x1'));var fs=require('fs');var Redis=require(_0x8ca1('0x2'));var db=require(_0x8ca1('0x3'))['db'];var utils=require(_0x8ca1('0x4'));var logger=require(_0x8ca1('0x5'))(_0x8ca1('0x6'));var config=require(_0x8ca1('0x7'));var jayson=require(_0x8ca1('0x8'));var client=jayson[_0x8ca1('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8ca1('0xa')](config[_0x8ca1('0xb')],{'host':_0x8ca1('0xc'),'port':0x18eb});var socket=require(_0x8ca1('0xd'))(new Redis(config['redis']));require(_0x8ca1('0xe'))['register'](socket);function respondWithRpcPromise(_0x4d875e,_0x27c696,_0x1a1c57){return new BPromise(function(_0x2ca787,_0x42614c){return client[_0x8ca1('0xf')](_0x4d875e,_0x1a1c57)[_0x8ca1('0x10')](function(_0x26b923){logger[_0x8ca1('0x11')](_0x8ca1('0x12'),_0x27c696,'request\x20sent');logger[_0x8ca1('0x13')](_0x8ca1('0x14'),_0x27c696,_0x8ca1('0x15'),JSON[_0x8ca1('0x16')](_0x26b923));if(_0x26b923[_0x8ca1('0x17')]){if(_0x26b923['error'][_0x8ca1('0x18')]===0x1f4){logger[_0x8ca1('0x17')]('DashboardItem,\x20%s,\x20%s',_0x27c696,_0x26b923[_0x8ca1('0x17')][_0x8ca1('0x19')]);return _0x42614c(_0x26b923['error']['message']);}logger[_0x8ca1('0x17')]('DashboardItem,\x20%s,\x20%s',_0x27c696,_0x26b923[_0x8ca1('0x17')][_0x8ca1('0x19')]);return _0x2ca787(_0x26b923[_0x8ca1('0x17')][_0x8ca1('0x19')]);}else{logger[_0x8ca1('0x11')]('DashboardItem,\x20%s,\x20%s',_0x27c696,_0x8ca1('0x15'));_0x2ca787(_0x26b923[_0x8ca1('0x1a')]['message']);}})[_0x8ca1('0x1b')](function(_0xa3575a){logger[_0x8ca1('0x17')]('DashboardItem,\x20%s,\x20%s',_0x27c696,_0xa3575a);_0x42614c(_0xa3575a);});});} \ No newline at end of file +var _0xf023=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','redis','socket.io-emitter','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf023,0x113));var _0x3f02=function(_0x4e198f,_0x54e189){_0x4e198f=_0x4e198f-0x0;var _0x27e6c5=_0xf023[_0x4e198f];return _0x27e6c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f02('0x0'));var BPromise=require(_0x3f02('0x1'));var rs=require(_0x3f02('0x2'));var fs=require('fs');var Redis=require(_0x3f02('0x3'));var db=require(_0x3f02('0x4'))['db'];var utils=require(_0x3f02('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3f02('0x6')]({'port':0x232a});config[_0x3f02('0x7')]=_['defaults'](config[_0x3f02('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f02('0x8'))(new Redis(config[_0x3f02('0x7')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x419028,_0x2b2322,_0xa06868){return new BPromise(function(_0x2af409,_0x2a0b80){return client[_0x3f02('0x9')](_0x419028,_0xa06868)['then'](function(_0x33c368){logger['info'](_0x3f02('0xa'),_0x2b2322,_0x3f02('0xb'));logger[_0x3f02('0xc')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2b2322,'request\x20sent',JSON[_0x3f02('0xd')](_0x33c368));if(_0x33c368[_0x3f02('0xe')]){if(_0x33c368[_0x3f02('0xe')][_0x3f02('0xf')]===0x1f4){logger[_0x3f02('0xe')](_0x3f02('0xa'),_0x2b2322,_0x33c368[_0x3f02('0xe')][_0x3f02('0x10')]);return _0x2a0b80(_0x33c368[_0x3f02('0xe')][_0x3f02('0x10')]);}logger[_0x3f02('0xe')](_0x3f02('0xa'),_0x2b2322,_0x33c368[_0x3f02('0xe')][_0x3f02('0x10')]);return _0x2af409(_0x33c368[_0x3f02('0xe')][_0x3f02('0x10')]);}else{logger[_0x3f02('0x11')](_0x3f02('0xa'),_0x2b2322,_0x3f02('0xb'));_0x2af409(_0x33c368[_0x3f02('0x12')]['message']);}})['catch'](function(_0x152d4a){logger[_0x3f02('0xe')]('DashboardItem,\x20%s,\x20%s',_0x2b2322,_0x152d4a);_0x2a0b80(_0x152d4a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 34deceb..5fb5cfa 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 _0xb651=['save','remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb651,0x116));var _0x1b65=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xb651[_0x5c2e3e];return _0x53f64a;};'use strict';var DashboardItemEvents=require(_0x1b65('0x0'));var events=[_0x1b65('0x1'),_0x1b65('0x2'),_0x1b65('0x3')];function createListener(_0x30bc95,_0x5487a2){return function(_0x4d4098){_0x5487a2[_0x1b65('0x4')](_0x30bc95,_0x4d4098);};}function removeListener(_0x209e26,_0x5c8c49){return function(){DashboardItemEvents[_0x1b65('0x5')](_0x209e26,_0x5c8c49);};}exports[_0x1b65('0x6')]=function(_0x9e7d2b){for(var _0x1969a4=0x0,_0x52af8a=events[_0x1b65('0x7')];_0x1969a4<_0x52af8a;_0x1969a4++){var _0x46c8e3=events[_0x1969a4];var _0x315156=createListener(_0x1b65('0x8')+_0x46c8e3,_0x9e7d2b);DashboardItemEvents['on'](_0x46c8e3,_0x315156);}}; \ No newline at end of file +var _0xefe7=['./dashboardItem.events','remove','update','emit','removeListener','register','length'];(function(_0x46c792,_0x35d66a){var _0xc266d9=function(_0x53be0c){while(--_0x53be0c){_0x46c792['push'](_0x46c792['shift']());}};_0xc266d9(++_0x35d66a);}(_0xefe7,0x7e));var _0x7efe=function(_0x4c48c4,_0x189dc6){_0x4c48c4=_0x4c48c4-0x0;var _0x2b1262=_0xefe7[_0x4c48c4];return _0x2b1262;};'use strict';var DashboardItemEvents=require(_0x7efe('0x0'));var events=['save',_0x7efe('0x1'),_0x7efe('0x2')];function createListener(_0x319e21,_0x547a0c){return function(_0x3f2446){_0x547a0c[_0x7efe('0x3')](_0x319e21,_0x3f2446);};}function removeListener(_0x4fb559,_0x4cf2f2){return function(){DashboardItemEvents[_0x7efe('0x4')](_0x4fb559,_0x4cf2f2);};}exports[_0x7efe('0x5')]=function(_0x296acb){for(var _0x36b4f6=0x0,_0x1a07a2=events[_0x7efe('0x6')];_0x36b4f6<_0x1a07a2;_0x36b4f6++){var _0x5d53d0=events[_0x36b4f6];var _0xf90dcd=createListener('dashboardItem:'+_0x5d53d0,_0x296acb);DashboardItemEvents['on'](_0x5d53d0,_0xf90dcd);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 628f8d2..14af802 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 _0x936a=['update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x243810,_0x6bbe08){var _0x4444d2=function(_0x42b400){while(--_0x42b400){_0x243810['push'](_0x243810['shift']());}};_0x4444d2(++_0x6bbe08);}(_0x936a,0x113));var _0xa936=function(_0x10cb28,_0x2d2364){_0x10cb28=_0x10cb28-0x0;var _0x593e06=_0x936a[_0x10cb28];return _0x593e06;};'use strict';var multer=require('multer');var util=require(_0xa936('0x0'));var path=require(_0xa936('0x1'));var timeout=require('connect-timeout');var express=require(_0xa936('0x2'));var router=express[_0xa936('0x3')]();var fs_extra=require(_0xa936('0x4'));var auth=require(_0xa936('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa936('0x6'));var controller=require('./dashboardItem.controller');router[_0xa936('0x7')](_0xa936('0x8'),auth[_0xa936('0x9')](),controller[_0xa936('0xa')]);router[_0xa936('0xb')]('/',auth['isAuthenticated'](),controller[_0xa936('0xc')]);router[_0xa936('0xd')](_0xa936('0x8'),auth[_0xa936('0x9')](),controller[_0xa936('0xe')]);router[_0xa936('0xf')](_0xa936('0x8'),auth['isAuthenticated'](),controller[_0xa936('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3d9e=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','update','delete'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x3d9e,0x1c9));var _0xe3d9=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x3d9e[_0x1fa841];return _0x384b67;};'use strict';var multer=require(_0xe3d9('0x0'));var util=require(_0xe3d9('0x1'));var path=require('path');var timeout=require(_0xe3d9('0x2'));var express=require(_0xe3d9('0x3'));var router=express[_0xe3d9('0x4')]();var fs_extra=require(_0xe3d9('0x5'));var auth=require(_0xe3d9('0x6'));var interaction=require(_0xe3d9('0x7'));var config=require(_0xe3d9('0x8'));var controller=require(_0xe3d9('0x9'));router[_0xe3d9('0xa')](_0xe3d9('0xb'),auth['isAuthenticated'](),controller[_0xe3d9('0xc')]);router[_0xe3d9('0xd')]('/',auth[_0xe3d9('0xe')](),controller[_0xe3d9('0xf')]);router['put'](_0xe3d9('0xb'),auth['isAuthenticated'](),controller[_0xe3d9('0x10')]);router[_0xe3d9('0x11')](_0xe3d9('0xb'),auth[_0xe3d9('0xe')](),controller['destroy']);module[_0xe3d9('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 00f9bab..5954b3f 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 _0xdb39=['second','STRING','ENUM','first'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0xdb39,0x195));var _0x9db3=function(_0x3c86dc,_0x5d22fc){_0x3c86dc=_0x3c86dc-0x0;var _0x4aeb79=_0xdb39[_0x3c86dc];return _0x4aeb79;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9db3('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x9db3('0x1')](_0x9db3('0x2'),_0x9db3('0x3'),'third'),'allowNull':![],'defaultValue':_0x9db3('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1197=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x1197,0xae));var _0x7119=function(_0x16de74,_0x57b6ee){_0x16de74=_0x16de74-0x0;var _0x5a6667=_0x1197[_0x16de74];return _0x5a6667;};'use strict';var Sequelize=require(_0x7119('0x0'));module[_0x7119('0x1')]={'name':{'type':Sequelize[_0x7119('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7119('0x3')](_0x7119('0x4'),_0x7119('0x5'),_0x7119('0x6')),'allowNull':![],'defaultValue':_0x7119('0x4')},'description':{'type':Sequelize[_0x7119('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 6cec87b..6c36e0c 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 _0xde7f=['order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','find','params','fast-json-patch','request-promise','bluebird','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','save','then','destroy','sendStatus','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xde7f,0x1f0));var _0xfde7=function(_0x1d282b,_0x44d861){_0x1d282b=_0x1d282b-0x0;var _0x39aaf1=_0xde7f[_0x1d282b];return _0x39aaf1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfde7('0x0'));var rp=require(_0xfde7('0x1'));var moment=require('moment');var BPromise=require(_0xfde7('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfde7('0x3'));var fs=require('fs');var fs_extra=require(_0xfde7('0x4'));var _=require(_0xfde7('0x5'));var squel=require('squel');var crypto=require(_0xfde7('0x6'));var jsforce=require(_0xfde7('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xfde7('0x8'));var querystring=require(_0xfde7('0x9'));var Papa=require(_0xfde7('0xa'));var Redis=require('ioredis');var authService=require(_0xfde7('0xb'));var qs=require(_0xfde7('0xc'));var as=require(_0xfde7('0xd'));var hardwareService=require(_0xfde7('0xe'));var logger=require('../../config/logger')(_0xfde7('0xf'));var utils=require(_0xfde7('0x10'));var config=require(_0xfde7('0x11'));var licenseUtil=require(_0xfde7('0x12'));var db=require(_0xfde7('0x13'))['db'];function respondWithStatusCode(_0xcbf0ff,_0x45c2fe){_0x45c2fe=_0x45c2fe||0xcc;return function(_0x579e03){if(_0x579e03){return _0xcbf0ff['sendStatus'](_0x45c2fe);}return _0xcbf0ff[_0xfde7('0x14')](_0x45c2fe)[_0xfde7('0x15')]();};}function respondWithResult(_0x33a664,_0x352ded){_0x352ded=_0x352ded||0xc8;return function(_0xe7097c){if(_0xe7097c){return _0x33a664[_0xfde7('0x14')](_0x352ded)['json'](_0xe7097c);}};}function respondWithFilteredResult(_0xb19ec2,_0x3edbfc){return function(_0x168cd3){if(_0x168cd3){var _0x5652a2=typeof _0x3edbfc[_0xfde7('0x16')]===_0xfde7('0x17')&&typeof _0x3edbfc[_0xfde7('0x18')]===_0xfde7('0x17');var _0x4e0ab5=_0x168cd3[_0xfde7('0x19')];var _0x10d007=_0x5652a2?0x0:_0x3edbfc['offset'];var _0x444807=_0x5652a2?_0x168cd3['count']:_0x3edbfc[_0xfde7('0x16')]+_0x3edbfc[_0xfde7('0x18')];var _0x39a735;if(_0x444807>=_0x4e0ab5){_0x444807=_0x4e0ab5;_0x39a735=0xc8;}else{_0x39a735=0xce;}_0xb19ec2[_0xfde7('0x14')](_0x39a735);return _0xb19ec2[_0xfde7('0x1a')]('Content-Range',_0x10d007+'-'+_0x444807+'/'+_0x4e0ab5)[_0xfde7('0x1b')](_0x168cd3);}return null;};}function patchUpdates(_0xae80ea){return function(_0xabc5c3){try{jsonpatch[_0xfde7('0x1c')](_0xabc5c3,_0xae80ea,!![]);}catch(_0x531c1a){return BPromise['reject'](_0x531c1a);}return _0xabc5c3[_0xfde7('0x1d')]();};}function saveUpdates(_0x52e63b,_0x727546){return function(_0x32db2b){if(_0x32db2b){return _0x32db2b['update'](_0x52e63b)[_0xfde7('0x1e')](function(_0x4699cb){return _0x4699cb;});}return null;};}function removeEntity(_0x16961f,_0x5e7881){return function(_0x4cebfc){if(_0x4cebfc){return _0x4cebfc[_0xfde7('0x1f')]()[_0xfde7('0x1e')](function(){var _0xc35d83=_0x4cebfc['get']({'plain':!![]});var _0x1cf2d4='Dispositions';return db['UserProfileResource'][_0xfde7('0x1f')]({'where':{'type':_0x1cf2d4,'resourceId':_0xc35d83['id']}})[_0xfde7('0x1e')](function(){return _0x4cebfc;});})['then'](function(){_0x16961f[_0xfde7('0x14')](0xcc)[_0xfde7('0x15')]();});}};}function handleEntityNotFound(_0xf512f4,_0x472a15){return function(_0x1d2f91){if(!_0x1d2f91){_0xf512f4[_0xfde7('0x20')](0x194);}return _0x1d2f91;};}function handleError(_0x57feb1,_0x36dc28){_0x36dc28=_0x36dc28||0x1f4;return function(_0x152ec3){logger['error'](_0x152ec3['stack']);if(_0x152ec3[_0xfde7('0x21')]){delete _0x152ec3[_0xfde7('0x21')];}_0x57feb1[_0xfde7('0x14')](_0x36dc28)[_0xfde7('0x22')](_0x152ec3);};}exports[_0xfde7('0x23')]=function(_0x1d7249,_0x5d0c35){var _0x494ab5={},_0x1190e4={},_0x2a9ea8={'count':0x0,'rows':[]};var _0x295abe=_[_0xfde7('0x24')](db[_0xfde7('0x25')][_0xfde7('0x26')],function(_0x219008){return{'name':_0x219008[_0xfde7('0x27')],'type':_0x219008[_0xfde7('0x28')][_0xfde7('0x29')]};});_0x1190e4[_0xfde7('0x2a')]=_['map'](_0x295abe,_0xfde7('0x21'));_0x1190e4[_0xfde7('0x2b')]=_['keys'](_0x1d7249['query']);_0x1190e4[_0xfde7('0x2c')]=_['intersection'](_0x1190e4['model'],_0x1190e4['query']);_0x494ab5['attributes']=_[_0xfde7('0x2d')](_0x1190e4[_0xfde7('0x2a')],qs['fields'](_0x1d7249[_0xfde7('0x2b')][_0xfde7('0x2e')]));_0x494ab5[_0xfde7('0x2f')]=_0x494ab5[_0xfde7('0x2f')]['length']?_0x494ab5[_0xfde7('0x2f')]:_0x1190e4['model'];if(!_0x1d7249['query'][_0xfde7('0x30')](_0xfde7('0x31'))){_0x494ab5[_0xfde7('0x18')]=qs['limit'](_0x1d7249[_0xfde7('0x2b')][_0xfde7('0x18')]);_0x494ab5['offset']=qs[_0xfde7('0x16')](_0x1d7249[_0xfde7('0x2b')]['offset']);}_0x494ab5[_0xfde7('0x32')]=qs[_0xfde7('0x33')](_0x1d7249[_0xfde7('0x2b')][_0xfde7('0x33')]);_0x494ab5[_0xfde7('0x34')]=qs[_0xfde7('0x2c')](_['pick'](_0x1d7249[_0xfde7('0x2b')],_0x1190e4[_0xfde7('0x2c')]),_0x295abe);if(_0x1d7249[_0xfde7('0x2b')][_0xfde7('0x35')]){_0x494ab5[_0xfde7('0x34')]=_[_0xfde7('0x36')](_0x494ab5['where'],{'$or':_[_0xfde7('0x24')](_0x295abe,function(_0x39da14){if(_0x39da14[_0xfde7('0x28')]!==_0xfde7('0x37')){var _0x1514e3={};_0x1514e3[_0x39da14[_0xfde7('0x21')]]={'$like':'%'+_0x1d7249[_0xfde7('0x2b')][_0xfde7('0x35')]+'%'};return _0x1514e3;}})});}_0x494ab5=_[_0xfde7('0x36')]({},_0x494ab5,_0x1d7249[_0xfde7('0x38')]);var _0x308670={'where':_0x494ab5[_0xfde7('0x34')]};return db[_0xfde7('0x25')][_0xfde7('0x19')](_0x308670)['then'](function(_0x1865c5){_0x2a9ea8[_0xfde7('0x19')]=_0x1865c5;if(_0x1d7249[_0xfde7('0x2b')]['includeAll']){_0x494ab5[_0xfde7('0x39')]=[{'all':!![]}];}return db[_0xfde7('0x25')][_0xfde7('0x3a')](_0x494ab5);})[_0xfde7('0x1e')](function(_0x25fee3){_0x2a9ea8[_0xfde7('0x3b')]=_0x25fee3;return _0x2a9ea8;})[_0xfde7('0x1e')](respondWithFilteredResult(_0x5d0c35,_0x494ab5))[_0xfde7('0x3c')](handleError(_0x5d0c35,null));};exports[_0xfde7('0x3d')]=function(_0x1e169f,_0xc4f9fc){var _0x222739={'raw':!![],'where':{'id':_0x1e169f['params']['id']}},_0x5b1e39={};_0x5b1e39[_0xfde7('0x2a')]=_[_0xfde7('0x3e')](db[_0xfde7('0x25')]['rawAttributes']);_0x5b1e39[_0xfde7('0x2b')]=_['keys'](_0x1e169f[_0xfde7('0x2b')]);_0x5b1e39[_0xfde7('0x2c')]=_['intersection'](_0x5b1e39['model'],_0x5b1e39['query']);_0x222739[_0xfde7('0x2f')]=_[_0xfde7('0x2d')](_0x5b1e39[_0xfde7('0x2a')],qs[_0xfde7('0x2e')](_0x1e169f[_0xfde7('0x2b')][_0xfde7('0x2e')]));_0x222739[_0xfde7('0x2f')]=_0x222739[_0xfde7('0x2f')]['length']?_0x222739[_0xfde7('0x2f')]:_0x5b1e39[_0xfde7('0x2a')];if(_0x1e169f[_0xfde7('0x2b')][_0xfde7('0x3f')]){_0x222739[_0xfde7('0x39')]=[{'all':!![]}];}_0x222739=_[_0xfde7('0x36')]({},_0x222739,_0x1e169f[_0xfde7('0x38')]);return db[_0xfde7('0x25')]['find'](_0x222739)[_0xfde7('0x1e')](handleEntityNotFound(_0xc4f9fc,null))[_0xfde7('0x1e')](respondWithResult(_0xc4f9fc,null))[_0xfde7('0x3c')](handleError(_0xc4f9fc,null));};exports[_0xfde7('0x40')]=function(_0x56d9b9,_0x4d13b8){return db[_0xfde7('0x25')][_0xfde7('0x40')](_0x56d9b9[_0xfde7('0x41')],{})[_0xfde7('0x1e')](function(_0x51a893){var _0x4370c6=_0x56d9b9[_0xfde7('0x42')][_0xfde7('0x43')]({'plain':!![]});if(!_0x4370c6)throw new Error(_0xfde7('0x44'));if(_0x4370c6[_0xfde7('0x45')]===_0xfde7('0x42')){var _0x8bdfe6=_0x51a893[_0xfde7('0x43')]({'plain':!![]});var _0x1233f1='Dispositions';return db[_0xfde7('0x46')]['find']({'where':{'name':_0x1233f1,'userProfileId':_0x4370c6[_0xfde7('0x47')]},'raw':!![]})[_0xfde7('0x1e')](function(_0x5e3a76){if(_0x5e3a76&&_0x5e3a76[_0xfde7('0x48')]===0x0){return db[_0xfde7('0x49')][_0xfde7('0x40')]({'name':_0x8bdfe6[_0xfde7('0x21')],'resourceId':_0x8bdfe6['id'],'type':_0x5e3a76['name'],'sectionId':_0x5e3a76['id']},{})[_0xfde7('0x1e')](function(){return _0x51a893;});}else{return _0x51a893;}})[_0xfde7('0x3c')](function(_0x50ea68){logger[_0xfde7('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ea68);throw _0x50ea68;});}return _0x51a893;})[_0xfde7('0x1e')](respondWithResult(_0x4d13b8,0xc9))[_0xfde7('0x3c')](handleError(_0x4d13b8,null));};exports[_0xfde7('0x4b')]=function(_0x4e0bcc,_0x4761c4){if(_0x4e0bcc[_0xfde7('0x41')]['id']){delete _0x4e0bcc[_0xfde7('0x41')]['id'];}return db[_0xfde7('0x25')][_0xfde7('0x4c')]({'where':{'id':_0x4e0bcc[_0xfde7('0x4d')]['id']}})[_0xfde7('0x1e')](handleEntityNotFound(_0x4761c4,null))[_0xfde7('0x1e')](saveUpdates(_0x4e0bcc[_0xfde7('0x41')],null))[_0xfde7('0x1e')](respondWithResult(_0x4761c4,null))['catch'](handleError(_0x4761c4,null));};exports[_0xfde7('0x1f')]=function(_0x80e8c5,_0x230702){return db[_0xfde7('0x25')][_0xfde7('0x4c')]({'where':{'id':_0x80e8c5[_0xfde7('0x4d')]['id']}})[_0xfde7('0x1e')](handleEntityNotFound(_0x230702,null))['then'](removeEntity(_0x230702,null))[_0xfde7('0x3c')](handleError(_0x230702,null));}; \ No newline at end of file +var _0x9fc3=['pick','where','merge','VIRTUAL','filter','Disposition','include','findAll','catch','params','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','update','then','destroy','get','Dispositions','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x587b31,_0x5f80e0){var _0x5f10c7=function(_0x205c63){while(--_0x205c63){_0x587b31['push'](_0x587b31['shift']());}};_0x5f10c7(++_0x5f80e0);}(_0x9fc3,0x199));var _0x39fc=function(_0x3168da,_0x5422d8){_0x3168da=_0x3168da-0x0;var _0x3810d1=_0x9fc3[_0x3168da];return _0x3810d1;};'use strict';var emlformat=require(_0x39fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39fc('0x1'));var jsonpatch=require(_0x39fc('0x2'));var rp=require(_0x39fc('0x3'));var moment=require(_0x39fc('0x4'));var BPromise=require(_0x39fc('0x5'));var Mustache=require(_0x39fc('0x6'));var util=require(_0x39fc('0x7'));var path=require('path');var sox=require(_0x39fc('0x8'));var csv=require(_0x39fc('0x9'));var ejs=require(_0x39fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x39fc('0xb'));var crypto=require(_0x39fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x39fc('0xd'));var toCsv=require(_0x39fc('0x9'));var querystring=require(_0x39fc('0xe'));var Papa=require(_0x39fc('0xf'));var Redis=require('ioredis');var authService=require(_0x39fc('0x10'));var qs=require(_0x39fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39fc('0x12'));var logger=require('../../config/logger')(_0x39fc('0x13'));var utils=require('../../config/utils');var config=require(_0x39fc('0x14'));var licenseUtil=require(_0x39fc('0x15'));var db=require(_0x39fc('0x16'))['db'];function respondWithStatusCode(_0x1dc625,_0x28755c){_0x28755c=_0x28755c||0xcc;return function(_0x536ab1){if(_0x536ab1){return _0x1dc625[_0x39fc('0x17')](_0x28755c);}return _0x1dc625['status'](_0x28755c)[_0x39fc('0x18')]();};}function respondWithResult(_0x71d116,_0x473467){_0x473467=_0x473467||0xc8;return function(_0x4dc44f){if(_0x4dc44f){return _0x71d116['status'](_0x473467)[_0x39fc('0x19')](_0x4dc44f);}};}function respondWithFilteredResult(_0x50b09e,_0x5299fe){return function(_0x41745e){if(_0x41745e){var _0x10dfe5=typeof _0x5299fe[_0x39fc('0x1a')]==='undefined'&&typeof _0x5299fe[_0x39fc('0x1b')]===_0x39fc('0x1c');var _0x214b34=_0x41745e['count'];var _0xa46a2b=_0x10dfe5?0x0:_0x5299fe[_0x39fc('0x1a')];var _0xea64c2=_0x10dfe5?_0x41745e[_0x39fc('0x1d')]:_0x5299fe[_0x39fc('0x1a')]+_0x5299fe['limit'];var _0x4a2352;if(_0xea64c2>=_0x214b34){_0xea64c2=_0x214b34;_0x4a2352=0xc8;}else{_0x4a2352=0xce;}_0x50b09e[_0x39fc('0x1e')](_0x4a2352);return _0x50b09e[_0x39fc('0x1f')](_0x39fc('0x20'),_0xa46a2b+'-'+_0xea64c2+'/'+_0x214b34)['json'](_0x41745e);}return null;};}function patchUpdates(_0x3ee10b){return function(_0x2331ba){try{jsonpatch[_0x39fc('0x21')](_0x2331ba,_0x3ee10b,!![]);}catch(_0x1b6543){return BPromise['reject'](_0x1b6543);}return _0x2331ba['save']();};}function saveUpdates(_0x2a5fd3,_0x347c14){return function(_0xd6c418){if(_0xd6c418){return _0xd6c418[_0x39fc('0x22')](_0x2a5fd3)[_0x39fc('0x23')](function(_0x3441b2){return _0x3441b2;});}return null;};}function removeEntity(_0x50c6b2,_0xda5d17){return function(_0x1cc639){if(_0x1cc639){return _0x1cc639[_0x39fc('0x24')]()[_0x39fc('0x23')](function(){var _0x54e278=_0x1cc639[_0x39fc('0x25')]({'plain':!![]});var _0x203398=_0x39fc('0x26');return db['UserProfileResource'][_0x39fc('0x24')]({'where':{'type':_0x203398,'resourceId':_0x54e278['id']}})[_0x39fc('0x23')](function(){return _0x1cc639;});})[_0x39fc('0x23')](function(){_0x50c6b2['status'](0xcc)[_0x39fc('0x18')]();});}};}function handleEntityNotFound(_0x351d14,_0x6ec52e){return function(_0x3e208f){if(!_0x3e208f){_0x351d14['sendStatus'](0x194);}return _0x3e208f;};}function handleError(_0x129d7b,_0x36b3f1){_0x36b3f1=_0x36b3f1||0x1f4;return function(_0x26fdfd){logger[_0x39fc('0x27')](_0x26fdfd[_0x39fc('0x28')]);if(_0x26fdfd[_0x39fc('0x29')]){delete _0x26fdfd[_0x39fc('0x29')];}_0x129d7b[_0x39fc('0x1e')](_0x36b3f1)[_0x39fc('0x2a')](_0x26fdfd);};}exports['index']=function(_0x5532f3,_0x18e7c2){var _0x4c7918={},_0x4ae656={},_0x121dac={'count':0x0,'rows':[]};var _0x10d8f8=_['map'](db['Disposition'][_0x39fc('0x2b')],function(_0x1b38d0){return{'name':_0x1b38d0['fieldName'],'type':_0x1b38d0[_0x39fc('0x2c')][_0x39fc('0x2d')]};});_0x4ae656[_0x39fc('0x2e')]=_[_0x39fc('0x2f')](_0x10d8f8,_0x39fc('0x29'));_0x4ae656[_0x39fc('0x30')]=_[_0x39fc('0x31')](_0x5532f3[_0x39fc('0x30')]);_0x4ae656[_0x39fc('0x32')]=_[_0x39fc('0x33')](_0x4ae656[_0x39fc('0x2e')],_0x4ae656[_0x39fc('0x30')]);_0x4c7918[_0x39fc('0x34')]=_[_0x39fc('0x33')](_0x4ae656['model'],qs[_0x39fc('0x35')](_0x5532f3['query']['fields']));_0x4c7918[_0x39fc('0x34')]=_0x4c7918['attributes'][_0x39fc('0x36')]?_0x4c7918[_0x39fc('0x34')]:_0x4ae656[_0x39fc('0x2e')];if(!_0x5532f3[_0x39fc('0x30')][_0x39fc('0x37')](_0x39fc('0x38'))){_0x4c7918[_0x39fc('0x1b')]=qs[_0x39fc('0x1b')](_0x5532f3[_0x39fc('0x30')][_0x39fc('0x1b')]);_0x4c7918[_0x39fc('0x1a')]=qs[_0x39fc('0x1a')](_0x5532f3[_0x39fc('0x30')]['offset']);}_0x4c7918[_0x39fc('0x39')]=qs[_0x39fc('0x3a')](_0x5532f3['query'][_0x39fc('0x3a')]);_0x4c7918['where']=qs[_0x39fc('0x32')](_[_0x39fc('0x3b')](_0x5532f3[_0x39fc('0x30')],_0x4ae656['filters']),_0x10d8f8);if(_0x5532f3[_0x39fc('0x30')]['filter']){_0x4c7918[_0x39fc('0x3c')]=_[_0x39fc('0x3d')](_0x4c7918['where'],{'$or':_[_0x39fc('0x2f')](_0x10d8f8,function(_0x58915b){if(_0x58915b[_0x39fc('0x2c')]!==_0x39fc('0x3e')){var _0x29279c={};_0x29279c[_0x58915b[_0x39fc('0x29')]]={'$like':'%'+_0x5532f3[_0x39fc('0x30')][_0x39fc('0x3f')]+'%'};return _0x29279c;}})});}_0x4c7918=_[_0x39fc('0x3d')]({},_0x4c7918,_0x5532f3['options']);var _0x5bff66={'where':_0x4c7918[_0x39fc('0x3c')]};return db[_0x39fc('0x40')][_0x39fc('0x1d')](_0x5bff66)['then'](function(_0x4ae16e){_0x121dac[_0x39fc('0x1d')]=_0x4ae16e;if(_0x5532f3['query']['includeAll']){_0x4c7918[_0x39fc('0x41')]=[{'all':!![]}];}return db[_0x39fc('0x40')][_0x39fc('0x42')](_0x4c7918);})[_0x39fc('0x23')](function(_0x154b11){_0x121dac['rows']=_0x154b11;return _0x121dac;})['then'](respondWithFilteredResult(_0x18e7c2,_0x4c7918))[_0x39fc('0x43')](handleError(_0x18e7c2,null));};exports['show']=function(_0x183363,_0xd70e1f){var _0x586da3={'raw':!![],'where':{'id':_0x183363[_0x39fc('0x44')]['id']}},_0x368702={};_0x368702[_0x39fc('0x2e')]=_['keys'](db[_0x39fc('0x40')][_0x39fc('0x2b')]);_0x368702[_0x39fc('0x30')]=_['keys'](_0x183363[_0x39fc('0x30')]);_0x368702[_0x39fc('0x32')]=_[_0x39fc('0x33')](_0x368702['model'],_0x368702['query']);_0x586da3['attributes']=_[_0x39fc('0x33')](_0x368702['model'],qs[_0x39fc('0x35')](_0x183363['query']['fields']));_0x586da3[_0x39fc('0x34')]=_0x586da3[_0x39fc('0x34')][_0x39fc('0x36')]?_0x586da3[_0x39fc('0x34')]:_0x368702[_0x39fc('0x2e')];if(_0x183363[_0x39fc('0x30')][_0x39fc('0x45')]){_0x586da3[_0x39fc('0x41')]=[{'all':!![]}];}_0x586da3=_['merge']({},_0x586da3,_0x183363[_0x39fc('0x46')]);return db[_0x39fc('0x40')][_0x39fc('0x47')](_0x586da3)[_0x39fc('0x23')](handleEntityNotFound(_0xd70e1f,null))[_0x39fc('0x23')](respondWithResult(_0xd70e1f,null))['catch'](handleError(_0xd70e1f,null));};exports['create']=function(_0x38b871,_0x4e186e){return db[_0x39fc('0x40')][_0x39fc('0x48')](_0x38b871['body'],{})[_0x39fc('0x23')](function(_0x53ef49){var _0x49e3df=_0x38b871['user'][_0x39fc('0x25')]({'plain':!![]});if(!_0x49e3df)throw new Error(_0x39fc('0x49'));if(_0x49e3df[_0x39fc('0x4a')]==='user'){var _0x4b54c0=_0x53ef49[_0x39fc('0x25')]({'plain':!![]});var _0x56de72=_0x39fc('0x26');return db[_0x39fc('0x4b')][_0x39fc('0x47')]({'where':{'name':_0x56de72,'userProfileId':_0x49e3df['userProfileId']},'raw':!![]})[_0x39fc('0x23')](function(_0x2be135){if(_0x2be135&&_0x2be135['autoAssociation']===0x0){return db[_0x39fc('0x4c')]['create']({'name':_0x4b54c0[_0x39fc('0x29')],'resourceId':_0x4b54c0['id'],'type':_0x2be135[_0x39fc('0x29')],'sectionId':_0x2be135['id']},{})[_0x39fc('0x23')](function(){return _0x53ef49;});}else{return _0x53ef49;}})['catch'](function(_0xe8c3ab){logger[_0x39fc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe8c3ab);throw _0xe8c3ab;});}return _0x53ef49;})[_0x39fc('0x23')](respondWithResult(_0x4e186e,0xc9))[_0x39fc('0x43')](handleError(_0x4e186e,null));};exports[_0x39fc('0x22')]=function(_0x44dcd6,_0x5becd5){if(_0x44dcd6[_0x39fc('0x4d')]['id']){delete _0x44dcd6['body']['id'];}return db['Disposition'][_0x39fc('0x47')]({'where':{'id':_0x44dcd6['params']['id']}})[_0x39fc('0x23')](handleEntityNotFound(_0x5becd5,null))[_0x39fc('0x23')](saveUpdates(_0x44dcd6['body'],null))[_0x39fc('0x23')](respondWithResult(_0x5becd5,null))['catch'](handleError(_0x5becd5,null));};exports[_0x39fc('0x24')]=function(_0x53b6a4,_0x25ce3e){return db[_0x39fc('0x40')][_0x39fc('0x47')]({'where':{'id':_0x53b6a4[_0x39fc('0x44')]['id']}})[_0x39fc('0x23')](handleEntityNotFound(_0x25ce3e,null))[_0x39fc('0x23')](removeEntity(_0x25ce3e,null))[_0x39fc('0x43')](handleError(_0x25ce3e,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c7e5ee9..66b518e 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 _0x7226=['../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x256220,_0x3c2cce){var _0xfde995=function(_0x731ebe){while(--_0x731ebe){_0x256220['push'](_0x256220['shift']());}};_0xfde995(++_0x3c2cce);}(_0x7226,0xc7));var _0x6722=function(_0x3d6f9a,_0x2255c9){_0x3d6f9a=_0x3d6f9a-0x0;var _0x51e3b6=_0x7226[_0x3d6f9a];return _0x51e3b6;};'use strict';var _=require(_0x6722('0x0'));var util=require(_0x6722('0x1'));var logger=require(_0x6722('0x2'))(_0x6722('0x3'));var moment=require('moment');var BPromise=require(_0x6722('0x4'));var rp=require(_0x6722('0x5'));var fs=require('fs');var path=require(_0x6722('0x6'));var rimraf=require(_0x6722('0x7'));var config=require(_0x6722('0x8'));var attributes=require(_0x6722('0x9'));module[_0x6722('0xa')]=function(_0x53baac,_0x2a35d0){return _0x53baac[_0x6722('0xb')]('Disposition',attributes,{'tableName':_0x6722('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6722('0xd'),'fields':[_0x6722('0xe'),_0x6722('0xf')]},{'unique':!![],'name':_0x6722('0x10'),'fields':[_0x6722('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x6722('0x11'),'fields':[_0x6722('0xe'),'MailAccountId']},{'unique':!![],'name':_0x6722('0x12'),'fields':[_0x6722('0xe'),_0x6722('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0x6722('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x6722('0x14'),'fields':[_0x6722('0xe'),_0x6722('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x6722('0xe'),_0x6722('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ff9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x1ff9,0x17e));var _0x91ff=function(_0x34b23b,_0x42fb8b){_0x34b23b=_0x34b23b-0x0;var _0x3207a1=_0x1ff9[_0x34b23b];return _0x3207a1;};'use strict';var _=require(_0x91ff('0x0'));var util=require('util');var logger=require(_0x91ff('0x1'))(_0x91ff('0x2'));var moment=require(_0x91ff('0x3'));var BPromise=require(_0x91ff('0x4'));var rp=require(_0x91ff('0x5'));var fs=require('fs');var path=require(_0x91ff('0x6'));var rimraf=require(_0x91ff('0x7'));var config=require(_0x91ff('0x8'));var attributes=require('./disposition.attributes');module[_0x91ff('0x9')]=function(_0x4805dc,_0x1d6451){return _0x4805dc['define'](_0x91ff('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x91ff('0xb'),_0x91ff('0xc')]},{'unique':!![],'name':_0x91ff('0xd'),'fields':[_0x91ff('0xb'),_0x91ff('0xe')]},{'unique':!![],'name':_0x91ff('0xf'),'fields':[_0x91ff('0xb'),_0x91ff('0x10')]},{'unique':!![],'name':_0x91ff('0x11'),'fields':[_0x91ff('0xb'),_0x91ff('0x12')]},{'unique':!![],'name':_0x91ff('0x13'),'fields':[_0x91ff('0xb'),'FaxAccountId']},{'unique':!![],'name':_0x91ff('0x14'),'fields':[_0x91ff('0xb'),_0x91ff('0x15')]},{'unique':!![],'name':_0x91ff('0x16'),'fields':[_0x91ff('0xb'),_0x91ff('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5ca445e..a649c2b 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(_0x4d17c2,_0x29de2c){var _0x29b8f4=function(_0x11b4a3){while(--_0x11b4a3){_0x4d17c2['push'](_0x4d17c2['shift']());}};_0x29b8f4(++_0x29de2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3bd622,_0x5e5804){var _0x460c59=function(_0x1c742d){while(--_0x1c742d){_0x3bd622['push'](_0x3bd622['shift']());}};_0x460c59(++_0x5e5804);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 6213318..85d979e 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 _0x5713=['../../config/environment','get','isAuthenticated','index','/:id','create','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5713,0x1c9));var _0x3571=function(_0x7045e,_0x234629){_0x7045e=_0x7045e-0x0;var _0x13f7e9=_0x5713[_0x7045e];return _0x13f7e9;};'use strict';var multer=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var path=require(_0x3571('0x2'));var timeout=require(_0x3571('0x3'));var express=require('express');var router=express[_0x3571('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3571('0x5'));var interaction=require(_0x3571('0x6'));var config=require(_0x3571('0x7'));var controller=require('./disposition.controller');router[_0x3571('0x8')]('/',auth[_0x3571('0x9')](),controller[_0x3571('0xa')]);router[_0x3571('0x8')](_0x3571('0xb'),auth[_0x3571('0x9')](),controller['show']);router['post']('/',auth[_0x3571('0x9')](),controller[_0x3571('0xc')]);router['put'](_0x3571('0xb'),auth[_0x3571('0x9')](),controller[_0x3571('0xd')]);router[_0x3571('0xe')]('/:id',auth[_0x3571('0x9')](),controller[_0x3571('0xf')]);module['exports']=router; \ No newline at end of file +var _0x883a=['../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1aa956,_0x2ef8c7){var _0x10e100=function(_0x4f1a45){while(--_0x4f1a45){_0x1aa956['push'](_0x1aa956['shift']());}};_0x10e100(++_0x2ef8c7);}(_0x883a,0x13e));var _0xa883=function(_0x3d1981,_0x5e14c8){_0x3d1981=_0x3d1981-0x0;var _0x51235b=_0x883a[_0x3d1981];return _0x51235b;};'use strict';var multer=require(_0xa883('0x0'));var util=require(_0xa883('0x1'));var path=require(_0xa883('0x2'));var timeout=require('connect-timeout');var express=require(_0xa883('0x3'));var router=express[_0xa883('0x4')]();var fs_extra=require(_0xa883('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa883('0x6'));var config=require(_0xa883('0x7'));var controller=require(_0xa883('0x8'));router['get']('/',auth[_0xa883('0x9')](),controller['index']);router[_0xa883('0xa')](_0xa883('0xb'),auth[_0xa883('0x9')](),controller['show']);router[_0xa883('0xc')]('/',auth[_0xa883('0x9')](),controller['create']);router[_0xa883('0xd')](_0xa883('0xb'),auth[_0xa883('0x9')](),controller[_0xa883('0xe')]);router[_0xa883('0xf')](_0xa883('0xb'),auth[_0xa883('0x9')](),controller[_0xa883('0x10')]);module[_0xa883('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index d976ee7..7777aba 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 _0xc534=['KHOMP','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','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI'];(function(_0x13b3f0,_0x5444a5){var _0x4beb99=function(_0x281774){while(--_0x281774){_0x13b3f0['push'](_0x13b3f0['shift']());}};_0x4beb99(++_0x5444a5);}(_0xc534,0x1ca));var _0x4c53=function(_0x5e8bfa,_0x1e83d1){_0x5e8bfa=_0x5e8bfa-0x0;var _0x10b312=_0xc534[_0x5e8bfa];return _0x10b312;};'use strict';var Sequelize=require('sequelize');module[_0x4c53('0x0')]={'name':{'type':Sequelize[_0x4c53('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4c53('0x2')](_0x4c53('0x3'),'no'),'defaultValue':_0x4c53('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x4c53('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x4c53('0x5')},'minrate':{'type':Sequelize[_0x4c53('0x2')](_0x4c53('0x6'),_0x4c53('0x7'),_0x4c53('0x8'),_0x4c53('0x9'),_0x4c53('0xa'),_0x4c53('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x4c53('0x2')](_0x4c53('0x6'),'4800',_0x4c53('0x8'),_0x4c53('0x9'),_0x4c53('0xa'),_0x4c53('0xb')),'defaultValue':_0x4c53('0xb')},'modem':{'type':Sequelize[_0x4c53('0x1')],'defaultValue':_0x4c53('0xc')},'gateway':{'type':Sequelize[_0x4c53('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4c53('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4c53('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4c53('0x2')](_0x4c53('0xe'),_0x4c53('0xf'),_0x4c53('0x10'),_0x4c53('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x4c53('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4c53('0x12');}},'notificationSound':{'type':Sequelize[_0x4c53('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4c53('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4c53('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4c53('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4c53('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4c53('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4c53('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x4c53('0x13')],'defaultValue':![],'comment':_0x4c53('0x15'),'set':function(_0x42f4b6){if(!_0x42f4b6)this[_0x4c53('0x16')](_0x4c53('0x17'),null);this[_0x4c53('0x16')](_0x4c53('0x18'),_0x42f4b6);}}}; \ No newline at end of file +var _0xc1f9=['INTEGER','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','9600','12000','14400','7200','v17,v27,v29'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1f9,0x153));var _0x9c1f=function(_0x25ebbb,_0x1b37d7){_0x25ebbb=_0x25ebbb-0x0;var _0x59e287=_0xc1f9[_0x25ebbb];return _0x59e287;};'use strict';var Sequelize=require(_0x9c1f('0x0'));module[_0x9c1f('0x1')]={'name':{'type':Sequelize[_0x9c1f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c1f('0x2')]},'ecm':{'type':Sequelize[_0x9c1f('0x3')](_0x9c1f('0x4'),'no'),'defaultValue':_0x9c1f('0x4')},'headerinfo':{'type':Sequelize[_0x9c1f('0x2')],'defaultValue':_0x9c1f('0x5')},'localstationid':{'type':Sequelize[_0x9c1f('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x9c1f('0x3')](_0x9c1f('0x6'),_0x9c1f('0x7'),'7200',_0x9c1f('0x8'),_0x9c1f('0x9'),_0x9c1f('0xa')),'defaultValue':_0x9c1f('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x9c1f('0x6'),'4800',_0x9c1f('0xb'),_0x9c1f('0x8'),_0x9c1f('0x9'),_0x9c1f('0xa')),'defaultValue':_0x9c1f('0xa')},'modem':{'type':Sequelize[_0x9c1f('0x2')],'defaultValue':_0x9c1f('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9c1f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9c1f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9c1f('0x3')]('SIP',_0x9c1f('0xe'),_0x9c1f('0xf'),_0x9c1f('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9c1f('0x11')],'defaultValue':function(){return _0x9c1f('0x12');}},'notificationSound':{'type':Sequelize[_0x9c1f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9c1f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c1f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c1f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c1f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9c1f('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x9c1f('0x13')],'defaultValue':![],'comment':_0x9c1f('0x15'),'set':function(_0x520d1f){if(!_0x520d1f)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x520d1f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6bf035d..126d1de 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 _0x8bdf=['findAll','rows','show','params','length','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','body','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','exten','system','description','appdata','Answer','push','CDR(type)=inbound-fax','ecm','localstationid','gateway','faxdetect','maxrate','modem','FAXOPT(','Set','Wait','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','omit','tech','createdAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','then','info','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FaxAccount,\x20%s,\x20%s','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','FaxAccount','includeAll','include'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x8bdf,0x1dd));var _0xf8bd=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x8bdf[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf8bd('0x0'));var zipdir=require(_0xf8bd('0x1'));var jsonpatch=require(_0xf8bd('0x2'));var rp=require(_0xf8bd('0x3'));var moment=require('moment');var BPromise=require(_0xf8bd('0x4'));var Mustache=require(_0xf8bd('0x5'));var util=require(_0xf8bd('0x6'));var path=require(_0xf8bd('0x7'));var sox=require(_0xf8bd('0x8'));var csv=require(_0xf8bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8bd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf8bd('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf8bd('0x9'));var querystring=require(_0xf8bd('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf8bd('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf8bd('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8bd('0xf'))('api');var utils=require(_0xf8bd('0x10'));var config=require(_0xf8bd('0x11'));var licenseUtil=require(_0xf8bd('0x12'));var db=require(_0xf8bd('0x13'))['db'];config[_0xf8bd('0x14')]=_[_0xf8bd('0x15')](config[_0xf8bd('0x14')],{'host':_0xf8bd('0x16'),'port':0x18eb});var socket=require(_0xf8bd('0x17'))(new Redis(config[_0xf8bd('0x14')]));require(_0xf8bd('0x18'))[_0xf8bd('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf8bd('0x1a')]({'port':0x232c});var client9002=jayson[_0xf8bd('0x1b')][_0xf8bd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12101a,_0xd1047c,_0x354eb0,_0x4d615c){return new BPromise(function(_0x3e867d,_0x16aabf){var _0x4849bd=_0x4d615c||client;return _0x4849bd['request'](_0x12101a,_0x354eb0)[_0xf8bd('0x1c')](function(_0x3449f7){logger[_0xf8bd('0x1d')]('FaxAccount,\x20%s,\x20%s',_0xd1047c,'request\x20sent');logger['debug'](_0xf8bd('0x1e'),_0xd1047c,_0xf8bd('0x1f'),JSON[_0xf8bd('0x20')](_0x3449f7));if(_0x3449f7[_0xf8bd('0x21')]){if(_0x3449f7[_0xf8bd('0x21')]['code']===0x1f4){logger[_0xf8bd('0x21')]('FaxAccount,\x20%s,\x20%s',_0xd1047c,_0x3449f7[_0xf8bd('0x21')][_0xf8bd('0x22')]);return _0x16aabf(_0x3449f7[_0xf8bd('0x21')][_0xf8bd('0x22')]);}logger[_0xf8bd('0x21')]('FaxAccount,\x20%s,\x20%s',_0xd1047c,_0x3449f7[_0xf8bd('0x21')][_0xf8bd('0x22')]);return _0x3e867d(_0x3449f7[_0xf8bd('0x21')][_0xf8bd('0x22')]);}else{logger[_0xf8bd('0x1d')](_0xf8bd('0x23'),_0xd1047c,'request\x20sent');_0x3e867d(_0x3449f7['result'][_0xf8bd('0x22')]);}})['catch'](function(_0xa679eb){logger[_0xf8bd('0x21')]('FaxAccount,\x20%s,\x20%s',_0xd1047c,_0xa679eb);_0x16aabf(_0xa679eb);});});}function respondWithStatusCode(_0x3a9f8f,_0x589898){_0x589898=_0x589898||0xcc;return function(_0xd20514){if(_0xd20514){return _0x3a9f8f[_0xf8bd('0x24')](_0x589898);}return _0x3a9f8f[_0xf8bd('0x25')](_0x589898)[_0xf8bd('0x26')]();};}function respondWithResult(_0x1a71dc,_0x388d63){_0x388d63=_0x388d63||0xc8;return function(_0x245194){if(_0x245194){return _0x1a71dc['status'](_0x388d63)['json'](_0x245194);}};}function respondWithFilteredResult(_0x246597,_0x2d3d8f){return function(_0xda7d33){if(_0xda7d33){var _0xf189dc=typeof _0x2d3d8f[_0xf8bd('0x27')]==='undefined'&&typeof _0x2d3d8f['limit']==='undefined';var _0x597d58=_0xda7d33[_0xf8bd('0x28')];var _0x50418f=_0xf189dc?0x0:_0x2d3d8f['offset'];var _0x4cf283=_0xf189dc?_0xda7d33[_0xf8bd('0x28')]:_0x2d3d8f[_0xf8bd('0x27')]+_0x2d3d8f[_0xf8bd('0x29')];var _0x3439b1;if(_0x4cf283>=_0x597d58){_0x4cf283=_0x597d58;_0x3439b1=0xc8;}else{_0x3439b1=0xce;}_0x246597['status'](_0x3439b1);return _0x246597[_0xf8bd('0x2a')](_0xf8bd('0x2b'),_0x50418f+'-'+_0x4cf283+'/'+_0x597d58)[_0xf8bd('0x2c')](_0xda7d33);}return null;};}function patchUpdates(_0x6c257a){return function(_0x44ad40){try{jsonpatch[_0xf8bd('0x2d')](_0x44ad40,_0x6c257a,!![]);}catch(_0x4e9698){return BPromise[_0xf8bd('0x2e')](_0x4e9698);}return _0x44ad40['save']();};}function saveUpdates(_0x5ce25b,_0x108cad){return function(_0x325632){if(_0x325632){return _0x325632[_0xf8bd('0x2f')](_0x5ce25b)[_0xf8bd('0x1c')](function(_0x58fb61){return _0x58fb61;});}return null;};}function removeEntity(_0x414038,_0xc253e7){return function(_0xf48492){if(_0xf48492){return _0xf48492[_0xf8bd('0x30')]()[_0xf8bd('0x1c')](function(){var _0x411dae=_0xf48492[_0xf8bd('0x31')]({'plain':!![]});var _0x4388a0=_0xf8bd('0x32');return db[_0xf8bd('0x33')][_0xf8bd('0x30')]({'where':{'type':_0x4388a0,'resourceId':_0x411dae['id']}})[_0xf8bd('0x1c')](function(){return _0xf48492;});})[_0xf8bd('0x1c')](function(){_0x414038[_0xf8bd('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x588a43,_0x1e209a){return function(_0x3ae034){if(!_0x3ae034){_0x588a43['sendStatus'](0x194);}return _0x3ae034;};}function handleError(_0xd5cca1,_0x19660f){_0x19660f=_0x19660f||0x1f4;return function(_0x13d635){logger[_0xf8bd('0x21')](_0x13d635[_0xf8bd('0x34')]);if(_0x13d635[_0xf8bd('0x35')]){delete _0x13d635['name'];}_0xd5cca1[_0xf8bd('0x25')](_0x19660f)[_0xf8bd('0x36')](_0x13d635);};}exports[_0xf8bd('0x37')]=function(_0x58df64,_0x47d009){var _0x23b43e={'include':[{'model':db[_0xf8bd('0x38')],'as':_0xf8bd('0x39')}]},_0x31aae5={},_0x22b309={'count':0x0,'rows':[]};var _0x1c2f90=_[_0xf8bd('0x3a')](db['FaxAccount'][_0xf8bd('0x3b')],function(_0x39aa3b){return{'name':_0x39aa3b[_0xf8bd('0x3c')],'type':_0x39aa3b['type'][_0xf8bd('0x3d')]};});_0x31aae5[_0xf8bd('0x3e')]=_[_0xf8bd('0x3a')](_0x1c2f90,_0xf8bd('0x35'));_0x31aae5[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x58df64[_0xf8bd('0x3f')]);_0x31aae5['filters']=_[_0xf8bd('0x41')](_0x31aae5[_0xf8bd('0x3e')],_0x31aae5['query']);_0x23b43e[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x31aae5[_0xf8bd('0x3e')],qs[_0xf8bd('0x43')](_0x58df64[_0xf8bd('0x3f')][_0xf8bd('0x43')]));_0x23b43e[_0xf8bd('0x42')]=_0x23b43e[_0xf8bd('0x42')]['length']?_0x23b43e['attributes']:_0x31aae5[_0xf8bd('0x3e')];if(!_0x58df64[_0xf8bd('0x3f')][_0xf8bd('0x44')]('nolimit')){_0x23b43e[_0xf8bd('0x29')]=qs[_0xf8bd('0x29')](_0x58df64[_0xf8bd('0x3f')][_0xf8bd('0x29')]);_0x23b43e[_0xf8bd('0x27')]=qs['offset'](_0x58df64[_0xf8bd('0x3f')]['offset']);}_0x23b43e[_0xf8bd('0x45')]=qs['sort'](_0x58df64[_0xf8bd('0x3f')][_0xf8bd('0x46')]);_0x23b43e[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_[_0xf8bd('0x49')](_0x58df64[_0xf8bd('0x3f')],_0x31aae5['filters']),_0x1c2f90);if(_0x58df64[_0xf8bd('0x3f')]['filter']){_0x23b43e[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x23b43e[_0xf8bd('0x47')],{'$or':_[_0xf8bd('0x3a')](_0x1c2f90,function(_0x107c3d){if(_0x107c3d[_0xf8bd('0x4b')]!==_0xf8bd('0x4c')){var _0x1122b8={};_0x1122b8[_0x107c3d['name']]={'$like':'%'+_0x58df64['query'][_0xf8bd('0x4d')]+'%'};return _0x1122b8;}})});}_0x23b43e=_['merge']({},_0x23b43e,_0x58df64['options']);var _0x14cb98={'where':_0x23b43e[_0xf8bd('0x47')]};return db[_0xf8bd('0x4e')][_0xf8bd('0x28')](_0x14cb98)['then'](function(_0x24a101){_0x22b309['count']=_0x24a101;if(_0x58df64[_0xf8bd('0x3f')][_0xf8bd('0x4f')]){_0x23b43e[_0xf8bd('0x50')]=[{'all':!![]}];}return db[_0xf8bd('0x4e')][_0xf8bd('0x51')](_0x23b43e);})[_0xf8bd('0x1c')](function(_0x442c62){_0x22b309[_0xf8bd('0x52')]=_0x442c62;return _0x22b309;})['then'](respondWithFilteredResult(_0x47d009,_0x23b43e))['catch'](handleError(_0x47d009,null));};exports[_0xf8bd('0x53')]=function(_0x642996,_0xc1d021){var _0x55a3ea={'raw':![],'where':{'id':_0x642996[_0xf8bd('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xf8bd('0x39')}]},_0xd7afb3={};_0xd7afb3['model']=_[_0xf8bd('0x40')](db['FaxAccount']['rawAttributes']);_0xd7afb3[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x642996['query']);_0xd7afb3[_0xf8bd('0x48')]=_[_0xf8bd('0x41')](_0xd7afb3[_0xf8bd('0x3e')],_0xd7afb3[_0xf8bd('0x3f')]);_0x55a3ea[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0xd7afb3[_0xf8bd('0x3e')],qs[_0xf8bd('0x43')](_0x642996['query'][_0xf8bd('0x43')]));_0x55a3ea[_0xf8bd('0x42')]=_0x55a3ea['attributes'][_0xf8bd('0x55')]?_0x55a3ea[_0xf8bd('0x42')]:_0xd7afb3[_0xf8bd('0x3e')];if(_0x642996[_0xf8bd('0x3f')][_0xf8bd('0x4f')]){_0x55a3ea[_0xf8bd('0x50')]=[{'all':!![]}];}_0x55a3ea=_[_0xf8bd('0x4a')]({},_0x55a3ea,_0x642996[_0xf8bd('0x56')]);return db['FaxAccount']['find'](_0x55a3ea)['then'](handleEntityNotFound(_0xc1d021,null))['then'](respondWithResult(_0xc1d021,null))[_0xf8bd('0x57')](handleError(_0xc1d021,null));};exports['create']=function(_0x1b392d,_0x1fce58){return db[_0xf8bd('0x4e')][_0xf8bd('0x58')](_0x1b392d['body'],{})[_0xf8bd('0x1c')](function(_0x4a1eec){var _0x1282a7=_0x1b392d[_0xf8bd('0x59')]['get']({'plain':!![]});if(!_0x1282a7)throw new Error(_0xf8bd('0x5a'));if(_0x1282a7[_0xf8bd('0x5b')]==='user'){var _0x24ac7b=_0x4a1eec[_0xf8bd('0x31')]({'plain':!![]});var _0x582b59='FaxAccounts';return db['UserProfileSection'][_0xf8bd('0x5c')]({'where':{'name':_0x582b59,'userProfileId':_0x1282a7[_0xf8bd('0x5d')]},'raw':!![]})[_0xf8bd('0x1c')](function(_0x5778cf){if(_0x5778cf&&_0x5778cf[_0xf8bd('0x5e')]===0x0){return db[_0xf8bd('0x33')][_0xf8bd('0x58')]({'name':_0x24ac7b[_0xf8bd('0x35')],'resourceId':_0x24ac7b['id'],'type':_0x5778cf[_0xf8bd('0x35')],'sectionId':_0x5778cf['id']},{})[_0xf8bd('0x1c')](function(){return _0x4a1eec;});}else{return _0x4a1eec;}})[_0xf8bd('0x57')](function(_0x34c6d0){logger[_0xf8bd('0x21')](_0xf8bd('0x5f'),_0x34c6d0);throw _0x34c6d0;});}return _0x4a1eec;})[_0xf8bd('0x1c')](respondWithResult(_0x1fce58,0xc9))[_0xf8bd('0x57')](handleError(_0x1fce58,null));};exports[_0xf8bd('0x2f')]=function(_0x529e34,_0x5d6802){if(_0x529e34['body']['id']){delete _0x529e34['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x529e34[_0xf8bd('0x54')]['id']},'include':[{'model':db[_0xf8bd('0x38')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5d6802,null))[_0xf8bd('0x1c')](saveUpdates(_0x529e34['body'],null))[_0xf8bd('0x1c')](respondWithResult(_0x5d6802,null))['catch'](handleError(_0x5d6802,null));};exports[_0xf8bd('0x30')]=function(_0x32298b,_0x1d3d00){return db[_0xf8bd('0x4e')][_0xf8bd('0x5c')]({'where':{'id':_0x32298b[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x1d3d00,null))[_0xf8bd('0x1c')](removeEntity(_0x1d3d00,null))[_0xf8bd('0x57')](handleError(_0x1d3d00,null));};exports[_0xf8bd('0x60')]=function(_0x4bcf7,_0x3940b5){return db[_0xf8bd('0x4e')][_0xf8bd('0x60')]()[_0xf8bd('0x1c')](respondWithResult(_0x3940b5,null))[_0xf8bd('0x57')](handleError(_0x3940b5,null));};exports[_0xf8bd('0x61')]=function(_0x77506e,_0x3b0a9b,_0x375086){if(_0x77506e[_0xf8bd('0x62')]['id']){delete _0x77506e[_0xf8bd('0x62')]['id'];}return db[_0xf8bd('0x4e')][_0xf8bd('0x5c')]({'where':{'id':_0x77506e[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x3b0a9b,null))['then'](function(_0x6dd4a2){if(_0x6dd4a2){_0x77506e['body'][_0xf8bd('0x63')]=_0x6dd4a2['id'];return db[_0xf8bd('0x64')]['create'](_0x77506e[_0xf8bd('0x62')]);}})[_0xf8bd('0x1c')](respondWithResult(_0x3b0a9b,null))[_0xf8bd('0x57')](handleError(_0x3b0a9b,null));};exports[_0xf8bd('0x65')]=function(_0x39450d,_0x470dfb,_0x52f088){var _0x16526e={'raw':![],'where':{}};var _0x2a07ef={};var _0x295ffe={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf8bd('0x66')]({'where':{'id':_0x39450d[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x470dfb,null))[_0xf8bd('0x1c')](function(_0x110761){if(_0x110761){_0x2a07ef['model']=_['keys'](db['Disposition']['rawAttributes']);_0x2a07ef[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x39450d[_0xf8bd('0x3f')]);_0x2a07ef['filters']=_['intersection'](_0x2a07ef[_0xf8bd('0x3e')],_0x2a07ef[_0xf8bd('0x3f')]);_0x16526e['attributes']=_[_0xf8bd('0x41')](_0x2a07ef[_0xf8bd('0x3e')],qs['fields'](_0x39450d[_0xf8bd('0x3f')]['fields']));_0x16526e[_0xf8bd('0x42')]=_0x16526e['attributes']['length']?_0x16526e[_0xf8bd('0x42')]:_0x2a07ef[_0xf8bd('0x3e')];if(!_0x39450d[_0xf8bd('0x3f')][_0xf8bd('0x44')](_0xf8bd('0x67'))){_0x16526e[_0xf8bd('0x29')]=qs['limit'](_0x39450d[_0xf8bd('0x3f')]['limit']);_0x16526e[_0xf8bd('0x27')]=qs[_0xf8bd('0x27')](_0x39450d[_0xf8bd('0x3f')][_0xf8bd('0x27')]);}_0x16526e[_0xf8bd('0x45')]=qs['sort'](_0x39450d[_0xf8bd('0x3f')][_0xf8bd('0x46')]);_0x16526e[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_['pick'](_0x39450d[_0xf8bd('0x3f')],_0x2a07ef['filters']));_0x16526e[_0xf8bd('0x47')][_0xf8bd('0x63')]=_0x110761['id'];if(_0x39450d[_0xf8bd('0x3f')]['filter']){_0x16526e[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x16526e[_0xf8bd('0x47')],{'$or':_['map'](_0x16526e['attributes'],function(_0x5b839a){var _0x56c1bb={};_0x56c1bb[_0x5b839a]={'$like':'%'+_0x39450d[_0xf8bd('0x3f')][_0xf8bd('0x4d')]+'%'};return _0x56c1bb;})});}_0x16526e=_['merge']({},_0x16526e,_0x39450d[_0xf8bd('0x56')]);return db['Disposition'][_0xf8bd('0x28')]({'where':_0x16526e[_0xf8bd('0x47')]})[_0xf8bd('0x1c')](function(_0x480dcc){_0x295ffe[_0xf8bd('0x28')]=_0x480dcc;if(_0x39450d[_0xf8bd('0x3f')][_0xf8bd('0x4f')]){_0x16526e[_0xf8bd('0x50')]=[{'all':!![]}];}return db[_0xf8bd('0x64')][_0xf8bd('0x51')](_0x16526e);})['then'](function(_0x21e9e7){_0x295ffe[_0xf8bd('0x52')]=_0x21e9e7;return _0x295ffe;});}})[_0xf8bd('0x1c')](respondWithFilteredResult(_0x470dfb,_0x16526e))[_0xf8bd('0x57')](handleError(_0x470dfb,null));};exports[_0xf8bd('0x68')]=function(_0x55568d,_0xba5c27,_0x277373){return db[_0xf8bd('0x4e')]['find']({'where':{'id':_0x55568d[_0xf8bd('0x54')]['id']}})['then'](handleEntityNotFound(_0xba5c27,null))[_0xf8bd('0x1c')](function(_0x3e47d2){if(_0x3e47d2){return _0x3e47d2['removeDispositions'](_0x55568d[_0xf8bd('0x3f')][_0xf8bd('0x69')]);}})[_0xf8bd('0x1c')](respondWithStatusCode(_0xba5c27,null))[_0xf8bd('0x57')](handleError(_0xba5c27,null));};exports[_0xf8bd('0x6a')]=function(_0x330e17,_0x237ed4,_0x10e4e9){if(_0x330e17['body']['id']){delete _0x330e17[_0xf8bd('0x62')]['id'];}return db[_0xf8bd('0x4e')][_0xf8bd('0x5c')]({'where':{'id':_0x330e17[_0xf8bd('0x54')]['id']}})['then'](handleEntityNotFound(_0x237ed4,null))[_0xf8bd('0x1c')](function(_0x4b03ba){if(_0x4b03ba){_0x330e17[_0xf8bd('0x62')][_0xf8bd('0x63')]=_0x4b03ba['id'];return db['CannedAnswer'][_0xf8bd('0x58')](_0x330e17[_0xf8bd('0x62')]);}})[_0xf8bd('0x1c')](respondWithResult(_0x237ed4,null))[_0xf8bd('0x57')](handleError(_0x237ed4,null));};exports['getAnswers']=function(_0x4ceb7c,_0x156e14,_0x591fdf){var _0x53b340={'raw':![],'where':{}};var _0x5e98bd={};var _0x8ad51f={'count':0x0,'rows':[]};return db[_0xf8bd('0x4e')]['findOne']({'where':{'id':_0x4ceb7c[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x156e14,null))[_0xf8bd('0x1c')](function(_0x5e00d5){if(_0x5e00d5){_0x5e98bd[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](db[_0xf8bd('0x6b')][_0xf8bd('0x3b')]);_0x5e98bd[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x4ceb7c[_0xf8bd('0x3f')]);_0x5e98bd[_0xf8bd('0x48')]=_[_0xf8bd('0x41')](_0x5e98bd['model'],_0x5e98bd['query']);_0x53b340[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x5e98bd[_0xf8bd('0x3e')],qs['fields'](_0x4ceb7c['query'][_0xf8bd('0x43')]));_0x53b340[_0xf8bd('0x42')]=_0x53b340[_0xf8bd('0x42')]['length']?_0x53b340[_0xf8bd('0x42')]:_0x5e98bd[_0xf8bd('0x3e')];if(!_0x4ceb7c[_0xf8bd('0x3f')][_0xf8bd('0x44')](_0xf8bd('0x67'))){_0x53b340[_0xf8bd('0x29')]=qs['limit'](_0x4ceb7c['query'][_0xf8bd('0x29')]);_0x53b340['offset']=qs[_0xf8bd('0x27')](_0x4ceb7c['query']['offset']);}_0x53b340['order']=qs[_0xf8bd('0x46')](_0x4ceb7c['query'][_0xf8bd('0x46')]);_0x53b340[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_['pick'](_0x4ceb7c[_0xf8bd('0x3f')],_0x5e98bd[_0xf8bd('0x48')]));_0x53b340[_0xf8bd('0x47')][_0xf8bd('0x63')]=_0x5e00d5['id'];if(_0x4ceb7c['query'][_0xf8bd('0x4d')]){_0x53b340[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x53b340[_0xf8bd('0x47')],{'$or':_['map'](_0x53b340[_0xf8bd('0x42')],function(_0x1fcc94){var _0x51e857={};_0x51e857[_0x1fcc94]={'$like':'%'+_0x4ceb7c[_0xf8bd('0x3f')][_0xf8bd('0x4d')]+'%'};return _0x51e857;})});}_0x53b340=_[_0xf8bd('0x4a')]({},_0x53b340,_0x4ceb7c[_0xf8bd('0x56')]);return db[_0xf8bd('0x6b')]['count']({'where':_0x53b340[_0xf8bd('0x47')]})[_0xf8bd('0x1c')](function(_0x16fef7){_0x8ad51f['count']=_0x16fef7;if(_0x4ceb7c['query'][_0xf8bd('0x4f')]){_0x53b340[_0xf8bd('0x50')]=[{'all':!![]}];}return db[_0xf8bd('0x6b')]['findAll'](_0x53b340);})[_0xf8bd('0x1c')](function(_0x55b09a){_0x8ad51f[_0xf8bd('0x52')]=_0x55b09a;return _0x8ad51f;});}})['then'](respondWithFilteredResult(_0x156e14,_0x53b340))[_0xf8bd('0x57')](handleError(_0x156e14,null));};exports[_0xf8bd('0x6c')]=function(_0x4231a7,_0x159c3f,_0x410a62){return db[_0xf8bd('0x4e')][_0xf8bd('0x5c')]({'where':{'id':_0x4231a7[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x159c3f,null))[_0xf8bd('0x1c')](function(_0x40c3c5){if(_0x40c3c5){return _0x40c3c5[_0xf8bd('0x6c')](_0x4231a7['query'][_0xf8bd('0x69')]);}})[_0xf8bd('0x1c')](respondWithStatusCode(_0x159c3f,null))[_0xf8bd('0x57')](handleError(_0x159c3f,null));};exports[_0xf8bd('0x6d')]=function(_0x177d48,_0x282593,_0x5d1f0f){return db['FaxInteraction']['find']({'where':{'id':_0x177d48[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x282593,null))[_0xf8bd('0x1c')](function(_0x4715d2){if(_0x4715d2){return _0x4715d2[_0xf8bd('0x6d')](_0x177d48[_0xf8bd('0x62')][_0xf8bd('0x69')],_['omit'](_0x177d48[_0xf8bd('0x62')],[_0xf8bd('0x69'),'id'])||{});}})[_0xf8bd('0x1c')](respondWithResult(_0x282593,null))[_0xf8bd('0x57')](handleError(_0x282593,null));};exports['getInteractions']=function(_0x1772c4,_0x381361,_0x47cab2){var _0x5855fd={'raw':![],'where':{}};var _0x399f3a={};var _0x36bac3={'count':0x0,'rows':[]};return db[_0xf8bd('0x4e')][_0xf8bd('0x66')]({'where':{'id':_0x1772c4[_0xf8bd('0x54')]['id']}})['then'](handleEntityNotFound(_0x381361,null))['then'](function(_0x4ef0bb){if(_0x4ef0bb){_0x399f3a['model']=_[_0xf8bd('0x40')](db['FaxInteraction'][_0xf8bd('0x3b')]);_0x399f3a['query']=_['keys'](_0x1772c4[_0xf8bd('0x3f')]);_0x399f3a['filters']=_[_0xf8bd('0x41')](_0x399f3a[_0xf8bd('0x3e')],_0x399f3a[_0xf8bd('0x3f')]);_0x5855fd[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x399f3a[_0xf8bd('0x3e')],qs[_0xf8bd('0x43')](_0x1772c4['query'][_0xf8bd('0x43')]));_0x5855fd[_0xf8bd('0x42')]=_0x5855fd[_0xf8bd('0x42')][_0xf8bd('0x55')]?_0x5855fd[_0xf8bd('0x42')]:_0x399f3a[_0xf8bd('0x3e')];if(!_0x1772c4[_0xf8bd('0x3f')]['hasOwnProperty'](_0xf8bd('0x67'))){_0x5855fd[_0xf8bd('0x29')]=qs[_0xf8bd('0x29')](_0x1772c4['query']['limit']);_0x5855fd[_0xf8bd('0x27')]=qs['offset'](_0x1772c4[_0xf8bd('0x3f')][_0xf8bd('0x27')]);}_0x5855fd[_0xf8bd('0x45')]=qs[_0xf8bd('0x46')](_0x1772c4[_0xf8bd('0x3f')]['sort']);_0x5855fd[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_[_0xf8bd('0x49')](_0x1772c4['query'],_0x399f3a[_0xf8bd('0x48')]));_0x5855fd[_0xf8bd('0x47')][_0xf8bd('0x63')]=_0x4ef0bb['id'];if(_0x1772c4[_0xf8bd('0x3f')][_0xf8bd('0x4d')]){_0x5855fd[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x5855fd[_0xf8bd('0x47')],{'$or':_[_0xf8bd('0x3a')](_0x5855fd['attributes'],function(_0x4319da){var _0x2a6fa1={};_0x2a6fa1[_0x4319da]={'$like':'%'+_0x1772c4[_0xf8bd('0x3f')]['filter']+'%'};return _0x2a6fa1;})});}_0x5855fd=_[_0xf8bd('0x4a')]({},_0x5855fd,_0x1772c4[_0xf8bd('0x56')]);return db[_0xf8bd('0x6e')][_0xf8bd('0x28')]({'where':_0x5855fd['where']})[_0xf8bd('0x1c')](function(_0x1fd17e){_0x36bac3[_0xf8bd('0x28')]=_0x1fd17e;if(_0x1772c4[_0xf8bd('0x3f')][_0xf8bd('0x4f')]){_0x5855fd[_0xf8bd('0x50')]=[{'model':db[_0xf8bd('0x6f')],'as':_0xf8bd('0x70'),'required':![]},{'model':db[_0xf8bd('0x71')],'as':'Owner','attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xf8bd('0x72')],'as':_0xf8bd('0x73'),'attributes':['id',_0xf8bd('0x35'),'color'],'where':_0x1772c4[_0xf8bd('0x3f')]['tag']?{'id':_0x1772c4[_0xf8bd('0x3f')][_0xf8bd('0x74')]}:undefined,'required':_0x1772c4[_0xf8bd('0x3f')][_0xf8bd('0x74')]?!![]:![]}];}return db[_0xf8bd('0x6e')][_0xf8bd('0x51')](_0x5855fd);})[_0xf8bd('0x1c')](function(_0x286c13){_0x36bac3['rows']=_0x286c13;return _0x36bac3;});}})[_0xf8bd('0x1c')](respondWithFilteredResult(_0x381361,_0x5855fd))[_0xf8bd('0x57')](handleError(_0x381361,null));};exports[_0xf8bd('0x75')]=function(_0x4594ca,_0x506f27,_0x3c1181){return db[_0xf8bd('0x4e')][_0xf8bd('0x66')]({'where':{'id':_0x4594ca['params']['id']}})['then'](handleEntityNotFound(_0x506f27,null))[_0xf8bd('0x1c')](function(_0x108649){if(_0x108649){return db[_0xf8bd('0x76')][_0xf8bd('0x77')](function(_0x234e61){return db[_0xf8bd('0x78')][_0xf8bd('0x30')]({'where':{'FaxAccountId':_0x4594ca[_0xf8bd('0x54')]['id']},'transaction':_0x234e61})['then'](function(_0x20ba5f){var _0x4b6250=_['map'](_0x4594ca['body'],function(_0x657c29){_0x657c29['FaxAccountId']=_0x4594ca[_0xf8bd('0x54')]['id'];return _0x657c29;});return db[_0xf8bd('0x78')]['bulkCreate'](_0x4b6250,{'transaction':_0x234e61});});})['then'](function(){return db[_0xf8bd('0x78')]['findAndCountAll']({'where':{'FaxAccountId':_0x4594ca[_0xf8bd('0x54')]['id']},'order':_0xf8bd('0x79')});});}})[_0xf8bd('0x1c')](respondWithResult(_0x506f27,null))[_0xf8bd('0x57')](handleError(_0x506f27,null));};exports[_0xf8bd('0x7a')]=function(_0x1dd19a,_0x3845ac,_0x13db2e){var _0x39cd7d={};var _0x240682={};var _0xfa608f;var _0x364e2d;return db[_0xf8bd('0x4e')][_0xf8bd('0x66')]({'where':{'id':_0x1dd19a[_0xf8bd('0x54')]['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x3845ac,null))[_0xf8bd('0x1c')](function(_0x5433b3){if(_0x5433b3){_0xfa608f=_0x5433b3;_0x240682['model']=_[_0xf8bd('0x40')](db[_0xf8bd('0x78')][_0xf8bd('0x3b')]);_0x240682[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x1dd19a[_0xf8bd('0x3f')]);_0x240682[_0xf8bd('0x48')]=_[_0xf8bd('0x41')](_0x240682[_0xf8bd('0x3e')],_0x240682['query']);_0x39cd7d[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x240682['model'],qs[_0xf8bd('0x43')](_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x43')]));_0x39cd7d[_0xf8bd('0x42')]=_0x39cd7d[_0xf8bd('0x42')][_0xf8bd('0x55')]?_0x39cd7d['attributes']:_0x240682[_0xf8bd('0x3e')];_0x39cd7d[_0xf8bd('0x45')]=qs[_0xf8bd('0x46')](_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x46')]);_0x39cd7d[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_['pick'](_0x1dd19a[_0xf8bd('0x3f')],_0x240682[_0xf8bd('0x48')]));if(_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x4d')]){_0x39cd7d[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x39cd7d[_0xf8bd('0x47')],{'$or':_[_0xf8bd('0x3a')](_0x39cd7d[_0xf8bd('0x42')],function(_0x404176){var _0x4d7933={};_0x4d7933[_0x404176]={'$like':'%'+_0x1dd19a[_0xf8bd('0x3f')]['filter']+'%'};return _0x4d7933;})});}_0x39cd7d=_[_0xf8bd('0x4a')]({},_0x39cd7d,_0x1dd19a[_0xf8bd('0x56')]);return _0xfa608f[_0xf8bd('0x7a')](_0x39cd7d);}})['then'](function(_0x402515){if(_0x402515){_0x364e2d=_0x402515[_0xf8bd('0x55')];if(!_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x44')](_0xf8bd('0x67'))){_0x39cd7d[_0xf8bd('0x29')]=qs[_0xf8bd('0x29')](_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x29')]);_0x39cd7d[_0xf8bd('0x27')]=qs[_0xf8bd('0x27')](_0x1dd19a[_0xf8bd('0x3f')][_0xf8bd('0x27')]);}return _0xfa608f[_0xf8bd('0x7a')](_0x39cd7d);}})[_0xf8bd('0x1c')](function(_0x32c813){if(_0x32c813){return _0x32c813?{'count':_0x364e2d,'rows':_0x32c813}:null;}})[_0xf8bd('0x1c')](respondWithResult(_0x3845ac,null))['catch'](handleError(_0x3845ac,null));};function Extension(_0x46e652,_0xe6fd25,_0x4bbd74,_0x3ef181){this[_0xf8bd('0x7b')]=_0xf8bd('0x7c');this[_0xf8bd('0x7d')]=_0x46e652['localstationid'];this['app']=_0x3ef181;this[_0xf8bd('0x4b')]=_0xf8bd('0x7e');this[_0xf8bd('0x7f')]='Fax\x20Extension';this['FaxAccountId']=_0x46e652['id'];this[_0xf8bd('0x79')]=_0xe6fd25;this[_0xf8bd('0x80')]=_0x4bbd74;}function createExtensionsReciveFax(_0x3b971d){var _0x3f77dd=0x1;var _0x81a575=[];_0x81a575['push'](new Extension(_0x3b971d,_0x3f77dd,'',_0xf8bd('0x81')));_0x3f77dd+=0x1;_0x81a575[_0xf8bd('0x82')](new Extension(_0x3b971d,_0x3f77dd,_0xf8bd('0x83'),'Set'));_0x3f77dd+=0x1;for(var _0x3207ec in _0x3b971d){if(_0x3b971d[_0xf8bd('0x44')](_0x3207ec)&&(_0x3207ec===_0xf8bd('0x84')||_0x3207ec===_0xf8bd('0x85')||_0x3207ec===_0xf8bd('0x86')||_0x3207ec===_0xf8bd('0x87')||_0x3207ec==='headerinfo'||_0x3207ec===_0xf8bd('0x88')||_0x3207ec==='minrate'||_0x3207ec===_0xf8bd('0x89')||_0x3207ec==='t38timeout')){_0x81a575[_0xf8bd('0x82')](new Extension(_0x3b971d,_0x3f77dd,_0xf8bd('0x8a')+_0x3207ec+')='+_0x3b971d[_0x3207ec],_0xf8bd('0x8b')));_0x3f77dd+=0x1;}}_0x81a575[_0xf8bd('0x82')](new Extension(_0x3b971d,_0x3f77dd,'6',_0xf8bd('0x8c')));_0x3f77dd+=0x1;_0x81a575[_0xf8bd('0x82')](new Extension(_0x3b971d,_0x3f77dd,'/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'));_0x3f77dd=0x0;return _0x81a575;}exports[_0xf8bd('0x8d')]=function(_0xaec67e,_0x114c77,_0x34c9c3){var _0x23fb43;return db[_0xf8bd('0x76')][_0xf8bd('0x77')](function(_0x591aeb){return db['FaxAccount'][_0xf8bd('0x58')](_0xaec67e[_0xf8bd('0x62')],{'transaction':_0x591aeb})[_0xf8bd('0x1c')](function(_0x3c4294){_0x23fb43=_0x3c4294['get']({'plain':!![]});return db['VoiceExtension'][_0xf8bd('0x8e')](createExtensionsReciveFax(_0x23fb43),{'transaction':_0x591aeb});});})[_0xf8bd('0x1c')](function(){return _0x23fb43;})['then'](respondWithResult(_0x114c77,null))[_0xf8bd('0x57')](handleError(_0x114c77,null));};exports[_0xf8bd('0x8f')]=function(_0x48c402,_0x2121ff,_0x5ae3cd){var _0x381624;return db['sequelize']['transaction'](function(_0x135530){return db['FaxAccount'][_0xf8bd('0x2f')](_0x48c402[_0xf8bd('0x62')],{'where':{'id':_0x48c402['body']['id']},'transaction':_0x135530})[_0xf8bd('0x1c')](function(_0x2edb86){return db[_0xf8bd('0x90')][_0xf8bd('0x30')]({'where':{'FaxAccountId':_0x48c402[_0xf8bd('0x62')]['id']},'transaction':_0x135530})[_0xf8bd('0x1c')](function(_0x595399){return db[_0xf8bd('0x90')]['bulkCreate'](createExtensionsReciveFax(_[_0xf8bd('0x91')](_0x48c402[_0xf8bd('0x62')],[_0xf8bd('0x92'),_0xf8bd('0x3d'),_0xf8bd('0x93'),'updatedAt',_0xf8bd('0x94'),_0xf8bd('0x95')])),{'transaction':_0x135530});});});})[_0xf8bd('0x1c')](function(){return db[_0xf8bd('0x4e')]['findById'](_0x48c402[_0xf8bd('0x62')]['id']);})[_0xf8bd('0x1c')](respondWithResult(_0x2121ff,null))[_0xf8bd('0x57')](handleError(_0x2121ff,null));};exports[_0xf8bd('0x96')]=function(_0x573328,_0x58a6ea,_0x1946fa){var _0x14fdb7={'raw':!![],'where':{}};var _0x153eec={};var _0x597c44={'count':0x0,'rows':[]};return db[_0xf8bd('0x4e')]['findOne']({'where':{'id':_0x573328[_0xf8bd('0x54')]['id']}})['then'](handleEntityNotFound(_0x58a6ea,null))[_0xf8bd('0x1c')](function(_0x5e3f2b){if(_0x5e3f2b){_0x153eec[_0xf8bd('0x3e')]=_[_0xf8bd('0x40')](db[_0xf8bd('0x97')][_0xf8bd('0x3b')]);_0x153eec[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x573328[_0xf8bd('0x3f')]);_0x153eec['filters']=_[_0xf8bd('0x41')](_0x153eec['model'],_0x153eec[_0xf8bd('0x3f')]);_0x14fdb7[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x153eec['model'],qs[_0xf8bd('0x43')](_0x573328[_0xf8bd('0x3f')][_0xf8bd('0x43')]));_0x14fdb7[_0xf8bd('0x42')]=_0x14fdb7['attributes'][_0xf8bd('0x55')]?_0x14fdb7[_0xf8bd('0x42')]:_0x153eec[_0xf8bd('0x3e')];if(!_0x573328['query']['hasOwnProperty']('nolimit')){_0x14fdb7[_0xf8bd('0x29')]=qs[_0xf8bd('0x29')](_0x573328['query']['limit']);_0x14fdb7[_0xf8bd('0x27')]=qs[_0xf8bd('0x27')](_0x573328['query'][_0xf8bd('0x27')]);}_0x14fdb7['order']=qs[_0xf8bd('0x46')](_0x573328[_0xf8bd('0x3f')][_0xf8bd('0x46')]);_0x14fdb7[_0xf8bd('0x47')]=qs[_0xf8bd('0x48')](_[_0xf8bd('0x49')](_0x573328[_0xf8bd('0x3f')],_0x153eec[_0xf8bd('0x48')]));_0x14fdb7[_0xf8bd('0x47')][_0xf8bd('0x63')]=_0x5e3f2b['id'];if(_0x573328[_0xf8bd('0x3f')][_0xf8bd('0x4d')]){_0x14fdb7[_0xf8bd('0x47')]=_['merge'](_0x14fdb7[_0xf8bd('0x47')],{'$or':_[_0xf8bd('0x3a')](_0x14fdb7[_0xf8bd('0x42')],function(_0x5e50df){var _0x2c7463={};_0x2c7463[_0x5e50df]={'$like':'%'+_0x573328['query'][_0xf8bd('0x4d')]+'%'};return _0x2c7463;})});}if(_0x573328[_0xf8bd('0x3f')][_0xf8bd('0x98')]){var _0x25c97b=_0x573328[_0xf8bd('0x3f')][_0xf8bd('0x98')][_0xf8bd('0x99')](',');var _0x5d55cc={};_0x5d55cc[_0x25c97b[0x0]]={'$gte':moment(_0x25c97b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x14fdb7[_0xf8bd('0x47')]=_[_0xf8bd('0x4a')](_0x14fdb7[_0xf8bd('0x47')],_0x5d55cc);}_0x14fdb7=_['merge']({},_0x14fdb7,_0x573328[_0xf8bd('0x56')]);return db[_0xf8bd('0x97')][_0xf8bd('0x28')]({'where':_0x14fdb7[_0xf8bd('0x47')]})[_0xf8bd('0x1c')](function(_0x2bbb23){_0x597c44[_0xf8bd('0x28')]=_0x2bbb23;if(_0x573328[_0xf8bd('0x3f')]['includeAll']){_0x14fdb7[_0xf8bd('0x50')]=[{'all':!![]}];}return db[_0xf8bd('0x97')][_0xf8bd('0x51')](_0x14fdb7);})['then'](function(_0x2c438d){_0x597c44[_0xf8bd('0x52')]=_0x2c438d;return _0x597c44;});}})[_0xf8bd('0x1c')](respondWithFilteredResult(_0x58a6ea,_0x14fdb7))['catch'](handleError(_0x58a6ea,null));};exports[_0xf8bd('0x36')]=function(_0x4f15f4,_0x3ac78c,_0xe3b4c){var _0xe317c6,_0x405fd8={},_0x44fda2;if(_0x4f15f4[_0xf8bd('0x62')]['to']){_0x44fda2=_0x4f15f4[_0xf8bd('0x62')]['to'][0x0];}return db['FaxAccount'][_0xf8bd('0x5c')]({'where':{'id':_0x4f15f4[_0xf8bd('0x54')]['id']},'include':[{'model':db[_0xf8bd('0x9a')],'as':_0xf8bd('0x9b'),'include':[{'model':db[_0xf8bd('0x6f')],'as':_0xf8bd('0x9c'),'where':{'fax':_0x44fda2},'limit':0x1,'order':[[_0xf8bd('0x9d'),_0xf8bd('0x9e')]]}]}]})[_0xf8bd('0x1c')](handleEntityNotFound(_0x3ac78c,null))[_0xf8bd('0x1c')](function(_0x3fb82b){_0xe317c6=_0x3fb82b;if(_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')]&&_0x4f15f4['body'][_0xf8bd('0x9f')][_0xf8bd('0x55')]){for(var _0x2db1d6=0x0;_0x2db1d6<_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][_0xf8bd('0x55')];_0x2db1d6+=0x1){_0x4f15f4['body'][_0xf8bd('0x9f')][_0x2db1d6]={'filename':_0x4f15f4['body']['attachments'][_0x2db1d6][_0xf8bd('0x35')],'id':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][_0x2db1d6]['id'],'path':path[_0xf8bd('0xa0')](config[_0xf8bd('0xa1')],_0xf8bd('0xa2'),_0x4f15f4[_0xf8bd('0x62')]['attachments'][_0x2db1d6][_0xf8bd('0xa3')])};}}return respondWithRpcPromise(_0xf8bd('0xa4'),_0xf8bd('0xa4'),{'FaxAccountId':_['isNil'](_0x4f15f4['params']['id'])?undefined:_0x4f15f4[_0xf8bd('0x54')]['id'],'path':_[_0xf8bd('0xa5')](_0x4f15f4['body']['attachments'][0x0]['path'])?undefined:_0x4f15f4['body'][_0xf8bd('0x9f')][0x0]['path'],'fax':_[_0xf8bd('0xa5')](_0x4f15f4[_0xf8bd('0x62')]['to'][0x0])?undefined:_0x4f15f4[_0xf8bd('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0xe317c6){if(_[_0xf8bd('0xa5')](_0x4f15f4[_0xf8bd('0x62')]['from'])){_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0xa6')]=util['format'](_0xf8bd('0xa7'),_0xe317c6[_0xf8bd('0x35')],_0xe317c6[_0xf8bd('0xa8')]);}if(_0xe317c6[_0xf8bd('0x9b')]){if(_0xe317c6[_0xf8bd('0x9b')]['Contacts'][_0xf8bd('0x55')]){return _0xe317c6[_0xf8bd('0x9b')]['Contacts'][0x0];}else{return db[_0xf8bd('0x6f')][_0xf8bd('0x58')](_[_0xf8bd('0x15')](_0x4f15f4[_0xf8bd('0x62')],{'firstName':_0x4f15f4[_0xf8bd('0x62')]['to'][0x0],'phone':_0x4f15f4[_0xf8bd('0x62')]['to'][0x0],'fax':_0x4f15f4[_0xf8bd('0x62')]['to'][0x0],'ListId':_0xe317c6[_0xf8bd('0x95')]}));}}else{throw new Error(_0xf8bd('0xa9'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x454787){if(_0x454787){return db[_0xf8bd('0x6e')][_0xf8bd('0x5c')]({'where':{'ContactId':_0x454787['id'],'closed':![],'FaxAccountId':_0xe317c6['id']}})[_0xf8bd('0x1c')](function(_0x2bcb23){if(_0x2bcb23){return[_0x2bcb23,![]];}return db[_0xf8bd('0x6e')]['create']({'UserId':_0x4f15f4[_0xf8bd('0x59')]['id'],'ContactId':_0x454787['id'],'FaxAccountId':_0xe317c6['id'],'fax':_0x4f15f4[_0xf8bd('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf8bd('0x4a')](_0x4f15f4[_0xf8bd('0x62')],{'read':![],'body':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][0x0][_0xf8bd('0xaa')],'FaxAccountId':_0xe317c6['id'],'UserId':_0x4f15f4[_0xf8bd('0x59')]['id'],'ContactId':_0x454787['id'],'AttachmentId':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][0x0]['id']})]},{'include':[{'model':db[_0xf8bd('0x97')],'as':_0xf8bd('0xab')}]})[_0xf8bd('0x1c')](function(_0x4fe11f){return[_0x4fe11f,!![]];});});}else{throw new Error(_0xf8bd('0xac'));}})[_0xf8bd('0xad')](function(_0x3b580f,_0xb13ad7){if(_0xb13ad7){return _0x3b580f;}return db[_0xf8bd('0x97')]['create']({'direction':_0xf8bd('0xae'),'read':![],'body':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][0x0][_0xf8bd('0xaa')],'FaxAccountId':_0xe317c6['id'],'FaxInteractionId':_0x3b580f['id'],'UserId':_0x4f15f4[_0xf8bd('0x59')]['id'],'ContactId':_0x3b580f[_0xf8bd('0xaf')],'AttachmentId':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][0x0]['id']})['then'](function(_0x40894e){_0x3b580f[_0xf8bd('0xb0')][_0xf8bd('0xab')]=[];_0x3b580f[_0xf8bd('0xb0')][_0xf8bd('0xab')]['push'](_0x40894e['dataValues']);return _0x3b580f;});})[_0xf8bd('0x1c')](function(_0x22b7a1){respondWithRpcPromise(_0xf8bd('0xb1'),_0xf8bd('0xb1'),{'FaxAccountId':_[_0xf8bd('0xa5')](_0x4f15f4[_0xf8bd('0x54')]['id'])?undefined:_0x4f15f4['params']['id'],'path':_[_0xf8bd('0xa5')](_0x4f15f4['body'][_0xf8bd('0x9f')][0x0][_0xf8bd('0x7')])?undefined:_0x4f15f4['body'][_0xf8bd('0x9f')][0x0][_0xf8bd('0x7')],'fax':_[_0xf8bd('0xa5')](_0x4f15f4[_0xf8bd('0x62')]['to'][0x0])?undefined:_0x4f15f4['body']['to'][0x0],'AttachmentId':_0x4f15f4[_0xf8bd('0x62')][_0xf8bd('0x9f')][0x0]['id']},client9002)[_0xf8bd('0x1c')](function(_0x26862a){logger[_0xf8bd('0x1d')]('SendFaxRpc,\x20%s',_0x26862a);})['catch'](function(_0x4924bd){logger[_0xf8bd('0x1d')](_0xf8bd('0xb2'),_0x4924bd);});return _0x22b7a1;})[_0xf8bd('0x1c')](respondWithResult(_0x3ac78c,null))['catch'](handleError(_0x3ac78c,null));};exports[_0xf8bd('0xb3')]=function(_0x3fa74a,_0x2d5777,_0x268dbc){return db[_0xf8bd('0x4e')][_0xf8bd('0x5c')]({'where':{'id':_0x3fa74a['params']['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x2d5777,null))[_0xf8bd('0x1c')](function(_0x3ab15e){if(_0x3ab15e){return _0x3ab15e[_0xf8bd('0xb3')](_0x3fa74a[_0xf8bd('0x62')][_0xf8bd('0x69')],_[_0xf8bd('0x91')](_0x3fa74a[_0xf8bd('0x62')],[_0xf8bd('0x69'),'id'])||{})[_0xf8bd('0xad')](function(_0x10148a){for(var _0x1c1201=0x0;_0x1c1201<_0x3fa74a[_0xf8bd('0x62')][_0xf8bd('0x69')]['length'];_0x1c1201+=0x1){socket[_0xf8bd('0xb4')](_0xf8bd('0xb5'),{'UserId':Number(_0x3fa74a[_0xf8bd('0x62')][_0xf8bd('0x69')][_0x1c1201]),'FaxAccountId':Number(_0x3fa74a[_0xf8bd('0x54')]['id'])});}return _0x10148a;});}})[_0xf8bd('0x1c')](respondWithResult(_0x2d5777,null))[_0xf8bd('0x57')](handleError(_0x2d5777,null));};exports[_0xf8bd('0xb6')]=function(_0x899c27,_0x2336fc,_0x48e6aa){return db['FaxAccount'][_0xf8bd('0x5c')]({'where':{'id':_0x899c27['params']['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x2336fc,null))[_0xf8bd('0x1c')](function(_0x19639f){if(_0x19639f){return _0x19639f[_0xf8bd('0xb6')](_0x899c27[_0xf8bd('0x3f')][_0xf8bd('0x69')])[_0xf8bd('0x1c')](function(){if(_[_0xf8bd('0xb7')](_0x899c27['query'][_0xf8bd('0x69')])){for(var _0xdc44f5=0x0;_0xdc44f5<_0x899c27[_0xf8bd('0x3f')]['ids'][_0xf8bd('0x55')];_0xdc44f5+=0x1){socket[_0xf8bd('0xb4')](_0xf8bd('0xb8'),{'UserId':Number(_0x899c27[_0xf8bd('0x3f')]['ids'][_0xdc44f5]),'FaxAccountId':Number(_0x899c27[_0xf8bd('0x54')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x899c27[_0xf8bd('0x3f')]['ids']),'FaxAccountId':Number(_0x899c27[_0xf8bd('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x2336fc,null))[_0xf8bd('0x57')](handleError(_0x2336fc,null));};exports[_0xf8bd('0xb9')]=function(_0x1004c8,_0x52b33c,_0xfb1a56){var _0x54f393={};var _0x388b47={};var _0x237e73;var _0x1d435f;return db[_0xf8bd('0x4e')][_0xf8bd('0x66')]({'where':{'id':_0x1004c8['params']['id']}})[_0xf8bd('0x1c')](handleEntityNotFound(_0x52b33c,null))['then'](function(_0x1bac97){if(_0x1bac97){_0x237e73=_0x1bac97;_0x388b47[_0xf8bd('0x3e')]=_['keys'](db[_0xf8bd('0x71')][_0xf8bd('0x3b')]);_0x388b47[_0xf8bd('0x3f')]=_[_0xf8bd('0x40')](_0x1004c8[_0xf8bd('0x3f')]);_0x388b47[_0xf8bd('0x48')]=_['intersection'](_0x388b47[_0xf8bd('0x3e')],_0x388b47[_0xf8bd('0x3f')]);_0x54f393[_0xf8bd('0x42')]=_[_0xf8bd('0x41')](_0x388b47['model'],qs[_0xf8bd('0x43')](_0x1004c8['query'][_0xf8bd('0x43')]));_0x54f393[_0xf8bd('0x42')]=_0x54f393[_0xf8bd('0x42')][_0xf8bd('0x55')]?_0x54f393['attributes']:_0x388b47[_0xf8bd('0x3e')];_0x54f393[_0xf8bd('0x45')]=qs['sort'](_0x1004c8[_0xf8bd('0x3f')][_0xf8bd('0x46')]);_0x54f393['where']=qs[_0xf8bd('0x48')](_[_0xf8bd('0x49')](_0x1004c8[_0xf8bd('0x3f')],_0x388b47['filters']));if(_0x1004c8['query'][_0xf8bd('0x4d')]){_0x54f393[_0xf8bd('0x47')]=_['merge'](_0x54f393[_0xf8bd('0x47')],{'$or':_[_0xf8bd('0x3a')](_0x54f393[_0xf8bd('0x42')],function(_0x204664){var _0x416113={};_0x416113[_0x204664]={'$like':'%'+_0x1004c8['query'][_0xf8bd('0x4d')]+'%'};return _0x416113;})});}_0x54f393=_[_0xf8bd('0x4a')]({},_0x54f393,_0x1004c8[_0xf8bd('0x56')]);return _0x237e73[_0xf8bd('0xb9')](_0x54f393);}})[_0xf8bd('0x1c')](function(_0x112970){if(_0x112970){_0x1d435f=_0x112970[_0xf8bd('0x55')];if(!_0x1004c8['query']['hasOwnProperty']('nolimit')){_0x54f393[_0xf8bd('0x29')]=qs['limit'](_0x1004c8['query'][_0xf8bd('0x29')]);_0x54f393[_0xf8bd('0x27')]=qs['offset'](_0x1004c8['query'][_0xf8bd('0x27')]);}return _0x237e73[_0xf8bd('0xb9')](_0x54f393);}})[_0xf8bd('0x1c')](function(_0x3f363d){if(_0x3f363d){return _0x3f363d?{'count':_0x1d435f,'rows':_0x3f363d}:null;}})['then'](respondWithResult(_0x52b33c,null))[_0xf8bd('0x57')](handleError(_0x52b33c,null));}; \ No newline at end of file +var _0x36ea=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','length','hasOwnProperty','nolimit','rows','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','minrate','modem','t38timeout','/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','tech','createdAt','ListId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','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','redis','defaults','http','client','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','FaxAccount','find','create','user'];(function(_0x589251,_0x348e31){var _0x4e077d=function(_0x5eecd2){while(--_0x5eecd2){_0x589251['push'](_0x589251['shift']());}};_0x4e077d(++_0x348e31);}(_0x36ea,0x125));var _0xa36e=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0x36ea[_0x254d9f];return _0x1eedb9;};'use strict';var emlformat=require(_0xa36e('0x0'));var rimraf=require(_0xa36e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa36e('0x2'));var rp=require(_0xa36e('0x3'));var moment=require(_0xa36e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa36e('0x5'));var path=require(_0xa36e('0x6'));var sox=require('sox');var csv=require(_0xa36e('0x7'));var ejs=require(_0xa36e('0x8'));var fs=require('fs');var fs_extra=require(_0xa36e('0x9'));var _=require(_0xa36e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa36e('0xb'));var deskjs=require(_0xa36e('0xc'));var toCsv=require(_0xa36e('0x7'));var querystring=require(_0xa36e('0xd'));var Papa=require('papaparse');var Redis=require(_0xa36e('0xe'));var authService=require(_0xa36e('0xf'));var qs=require(_0xa36e('0x10'));var as=require(_0xa36e('0x11'));var hardwareService=require(_0xa36e('0x12'));var logger=require(_0xa36e('0x13'))(_0xa36e('0x14'));var utils=require(_0xa36e('0x15'));var config=require(_0xa36e('0x16'));var licenseUtil=require(_0xa36e('0x17'));var db=require(_0xa36e('0x18'))['db'];config[_0xa36e('0x19')]=_[_0xa36e('0x1a')](config[_0xa36e('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa36e('0x19')]));require('./faxAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa36e('0x1b')]({'port':0x232c});var client9002=jayson[_0xa36e('0x1c')][_0xa36e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x8b29f1,_0x35fe18,_0x561afa,_0x29d27d){return new BPromise(function(_0xe341ca,_0x386ee7){var _0xd0e51b=_0x29d27d||client;return _0xd0e51b[_0xa36e('0x1d')](_0x8b29f1,_0x561afa)['then'](function(_0x49b49d){logger['info'](_0xa36e('0x1e'),_0x35fe18,_0xa36e('0x1f'));logger[_0xa36e('0x20')](_0xa36e('0x21'),_0x35fe18,'request\x20sent',JSON['stringify'](_0x49b49d));if(_0x49b49d[_0xa36e('0x22')]){if(_0x49b49d[_0xa36e('0x22')][_0xa36e('0x23')]===0x1f4){logger[_0xa36e('0x22')](_0xa36e('0x1e'),_0x35fe18,_0x49b49d['error']['message']);return _0x386ee7(_0x49b49d[_0xa36e('0x22')][_0xa36e('0x24')]);}logger[_0xa36e('0x22')](_0xa36e('0x1e'),_0x35fe18,_0x49b49d[_0xa36e('0x22')][_0xa36e('0x24')]);return _0xe341ca(_0x49b49d[_0xa36e('0x22')][_0xa36e('0x24')]);}else{logger[_0xa36e('0x25')](_0xa36e('0x1e'),_0x35fe18,'request\x20sent');_0xe341ca(_0x49b49d['result']['message']);}})['catch'](function(_0x580f6f){logger['error']('FaxAccount,\x20%s,\x20%s',_0x35fe18,_0x580f6f);_0x386ee7(_0x580f6f);});});}function respondWithStatusCode(_0x22c1e0,_0x4ab2f8){_0x4ab2f8=_0x4ab2f8||0xcc;return function(_0x1b07ed){if(_0x1b07ed){return _0x22c1e0[_0xa36e('0x26')](_0x4ab2f8);}return _0x22c1e0[_0xa36e('0x27')](_0x4ab2f8)[_0xa36e('0x28')]();};}function respondWithResult(_0x4fb13a,_0x562419){_0x562419=_0x562419||0xc8;return function(_0x3be975){if(_0x3be975){return _0x4fb13a[_0xa36e('0x27')](_0x562419)[_0xa36e('0x29')](_0x3be975);}};}function respondWithFilteredResult(_0x4efead,_0x10b23c){return function(_0x5424b1){if(_0x5424b1){var _0x4a4f3b=typeof _0x10b23c[_0xa36e('0x2a')]==='undefined'&&typeof _0x10b23c['limit']===_0xa36e('0x2b');var _0x4f5ee8=_0x5424b1[_0xa36e('0x2c')];var _0x3f5c71=_0x4a4f3b?0x0:_0x10b23c[_0xa36e('0x2a')];var _0x59b4b4=_0x4a4f3b?_0x5424b1[_0xa36e('0x2c')]:_0x10b23c[_0xa36e('0x2a')]+_0x10b23c[_0xa36e('0x2d')];var _0x318e95;if(_0x59b4b4>=_0x4f5ee8){_0x59b4b4=_0x4f5ee8;_0x318e95=0xc8;}else{_0x318e95=0xce;}_0x4efead[_0xa36e('0x27')](_0x318e95);return _0x4efead[_0xa36e('0x2e')](_0xa36e('0x2f'),_0x3f5c71+'-'+_0x59b4b4+'/'+_0x4f5ee8)['json'](_0x5424b1);}return null;};}function patchUpdates(_0x317200){return function(_0x444049){try{jsonpatch[_0xa36e('0x30')](_0x444049,_0x317200,!![]);}catch(_0x4f6552){return BPromise[_0xa36e('0x31')](_0x4f6552);}return _0x444049[_0xa36e('0x32')]();};}function saveUpdates(_0x2026d3,_0x890d82){return function(_0x476a3f){if(_0x476a3f){return _0x476a3f[_0xa36e('0x33')](_0x2026d3)[_0xa36e('0x34')](function(_0x539432){return _0x539432;});}return null;};}function removeEntity(_0xeb45e3,_0xf3a0db){return function(_0x35bb5b){if(_0x35bb5b){return _0x35bb5b[_0xa36e('0x35')]()[_0xa36e('0x34')](function(){var _0x547464=_0x35bb5b[_0xa36e('0x36')]({'plain':!![]});var _0x4093b6=_0xa36e('0x37');return db[_0xa36e('0x38')][_0xa36e('0x35')]({'where':{'type':_0x4093b6,'resourceId':_0x547464['id']}})[_0xa36e('0x34')](function(){return _0x35bb5b;});})[_0xa36e('0x34')](function(){_0xeb45e3['status'](0xcc)[_0xa36e('0x28')]();});}};}function handleEntityNotFound(_0x52eaaa,_0x4bf092){return function(_0x292b14){if(!_0x292b14){_0x52eaaa[_0xa36e('0x26')](0x194);}return _0x292b14;};}function handleError(_0x1d9353,_0x1a52ea){_0x1a52ea=_0x1a52ea||0x1f4;return function(_0x56b01a){logger['error'](_0x56b01a['stack']);if(_0x56b01a['name']){delete _0x56b01a[_0xa36e('0x39')];}_0x1d9353[_0xa36e('0x27')](_0x1a52ea)[_0xa36e('0x3a')](_0x56b01a);};}exports[_0xa36e('0x3b')]=function(_0x16691f,_0xa6ec6b){var _0x354be7={'include':[{'model':db[_0xa36e('0x3c')],'as':_0xa36e('0x3d')}]},_0x48efa4={},_0xe4f547={'count':0x0,'rows':[]};var _0xc728a0=_[_0xa36e('0x3e')](db['FaxAccount'][_0xa36e('0x3f')],function(_0x58cb04){return{'name':_0x58cb04['fieldName'],'type':_0x58cb04[_0xa36e('0x40')][_0xa36e('0x41')]};});_0x48efa4['model']=_['map'](_0xc728a0,_0xa36e('0x39'));_0x48efa4['query']=_[_0xa36e('0x42')](_0x16691f[_0xa36e('0x43')]);_0x48efa4[_0xa36e('0x44')]=_[_0xa36e('0x45')](_0x48efa4[_0xa36e('0x46')],_0x48efa4['query']);_0x354be7['attributes']=_[_0xa36e('0x45')](_0x48efa4[_0xa36e('0x46')],qs[_0xa36e('0x47')](_0x16691f[_0xa36e('0x43')][_0xa36e('0x47')]));_0x354be7[_0xa36e('0x48')]=_0x354be7[_0xa36e('0x48')]['length']?_0x354be7[_0xa36e('0x48')]:_0x48efa4[_0xa36e('0x46')];if(!_0x16691f[_0xa36e('0x43')]['hasOwnProperty']('nolimit')){_0x354be7['limit']=qs[_0xa36e('0x2d')](_0x16691f[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x354be7[_0xa36e('0x2a')]=qs[_0xa36e('0x2a')](_0x16691f['query'][_0xa36e('0x2a')]);}_0x354be7[_0xa36e('0x49')]=qs[_0xa36e('0x4a')](_0x16691f[_0xa36e('0x43')][_0xa36e('0x4a')]);_0x354be7[_0xa36e('0x4b')]=qs[_0xa36e('0x44')](_[_0xa36e('0x4c')](_0x16691f[_0xa36e('0x43')],_0x48efa4[_0xa36e('0x44')]),_0xc728a0);if(_0x16691f[_0xa36e('0x43')][_0xa36e('0x4d')]){_0x354be7[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x354be7[_0xa36e('0x4b')],{'$or':_[_0xa36e('0x3e')](_0xc728a0,function(_0x3eaa48){if(_0x3eaa48[_0xa36e('0x40')]!==_0xa36e('0x4f')){var _0x5ba482={};_0x5ba482[_0x3eaa48[_0xa36e('0x39')]]={'$like':'%'+_0x16691f['query'][_0xa36e('0x4d')]+'%'};return _0x5ba482;}})});}_0x354be7=_['merge']({},_0x354be7,_0x16691f[_0xa36e('0x50')]);var _0xf37235={'where':_0x354be7[_0xa36e('0x4b')]};return db['FaxAccount'][_0xa36e('0x2c')](_0xf37235)[_0xa36e('0x34')](function(_0xcdb2f1){_0xe4f547[_0xa36e('0x2c')]=_0xcdb2f1;if(_0x16691f[_0xa36e('0x43')][_0xa36e('0x51')]){_0x354be7[_0xa36e('0x52')]=[{'all':!![]}];}return db['FaxAccount'][_0xa36e('0x53')](_0x354be7);})[_0xa36e('0x34')](function(_0x1e7559){_0xe4f547['rows']=_0x1e7559;return _0xe4f547;})[_0xa36e('0x34')](respondWithFilteredResult(_0xa6ec6b,_0x354be7))[_0xa36e('0x54')](handleError(_0xa6ec6b,null));};exports['show']=function(_0x5290fd,_0x1d2189){var _0x1242c7={'raw':![],'where':{'id':_0x5290fd['params']['id']},'include':[{'model':db[_0xa36e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3e275e={};_0x3e275e[_0xa36e('0x46')]=_[_0xa36e('0x42')](db[_0xa36e('0x55')][_0xa36e('0x3f')]);_0x3e275e[_0xa36e('0x43')]=_[_0xa36e('0x42')](_0x5290fd[_0xa36e('0x43')]);_0x3e275e[_0xa36e('0x44')]=_[_0xa36e('0x45')](_0x3e275e[_0xa36e('0x46')],_0x3e275e['query']);_0x1242c7[_0xa36e('0x48')]=_[_0xa36e('0x45')](_0x3e275e[_0xa36e('0x46')],qs[_0xa36e('0x47')](_0x5290fd[_0xa36e('0x43')][_0xa36e('0x47')]));_0x1242c7[_0xa36e('0x48')]=_0x1242c7[_0xa36e('0x48')]['length']?_0x1242c7[_0xa36e('0x48')]:_0x3e275e[_0xa36e('0x46')];if(_0x5290fd['query'][_0xa36e('0x51')]){_0x1242c7[_0xa36e('0x52')]=[{'all':!![]}];}_0x1242c7=_[_0xa36e('0x4e')]({},_0x1242c7,_0x5290fd[_0xa36e('0x50')]);return db[_0xa36e('0x55')][_0xa36e('0x56')](_0x1242c7)[_0xa36e('0x34')](handleEntityNotFound(_0x1d2189,null))['then'](respondWithResult(_0x1d2189,null))[_0xa36e('0x54')](handleError(_0x1d2189,null));};exports['create']=function(_0x24a2f3,_0x5ec573){return db[_0xa36e('0x55')][_0xa36e('0x57')](_0x24a2f3['body'],{})[_0xa36e('0x34')](function(_0xfd7f2f){var _0x4aa5da=_0x24a2f3[_0xa36e('0x58')][_0xa36e('0x36')]({'plain':!![]});if(!_0x4aa5da)throw new Error(_0xa36e('0x59'));if(_0x4aa5da[_0xa36e('0x5a')]==='user'){var _0x1e0d93=_0xfd7f2f['get']({'plain':!![]});var _0xd5e730='FaxAccounts';return db[_0xa36e('0x5b')][_0xa36e('0x56')]({'where':{'name':_0xd5e730,'userProfileId':_0x4aa5da[_0xa36e('0x5c')]},'raw':!![]})[_0xa36e('0x34')](function(_0x1aa72f){if(_0x1aa72f&&_0x1aa72f[_0xa36e('0x5d')]===0x0){return db[_0xa36e('0x38')][_0xa36e('0x57')]({'name':_0x1e0d93['name'],'resourceId':_0x1e0d93['id'],'type':_0x1aa72f[_0xa36e('0x39')],'sectionId':_0x1aa72f['id']},{})[_0xa36e('0x34')](function(){return _0xfd7f2f;});}else{return _0xfd7f2f;}})[_0xa36e('0x54')](function(_0x56de09){logger[_0xa36e('0x22')](_0xa36e('0x5e'),_0x56de09);throw _0x56de09;});}return _0xfd7f2f;})[_0xa36e('0x34')](respondWithResult(_0x5ec573,0xc9))[_0xa36e('0x54')](handleError(_0x5ec573,null));};exports[_0xa36e('0x33')]=function(_0xead91e,_0x10f339){if(_0xead91e['body']['id']){delete _0xead91e[_0xa36e('0x5f')]['id'];}return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0xead91e[_0xa36e('0x60')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xa36e('0x34')](handleEntityNotFound(_0x10f339,null))[_0xa36e('0x34')](saveUpdates(_0xead91e[_0xa36e('0x5f')],null))[_0xa36e('0x34')](respondWithResult(_0x10f339,null))[_0xa36e('0x54')](handleError(_0x10f339,null));};exports['destroy']=function(_0x25ae51,_0x4f9fab){return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0x25ae51[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x4f9fab,null))[_0xa36e('0x34')](removeEntity(_0x4f9fab,null))[_0xa36e('0x54')](handleError(_0x4f9fab,null));};exports[_0xa36e('0x61')]=function(_0x252370,_0x502f5f){return db[_0xa36e('0x55')]['describe']()[_0xa36e('0x34')](respondWithResult(_0x502f5f,null))[_0xa36e('0x54')](handleError(_0x502f5f,null));};exports[_0xa36e('0x62')]=function(_0x12654f,_0x284745,_0x466c34){if(_0x12654f['body']['id']){delete _0x12654f[_0xa36e('0x5f')]['id'];}return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0x12654f[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x284745,null))['then'](function(_0x2d34dc){if(_0x2d34dc){_0x12654f[_0xa36e('0x5f')][_0xa36e('0x63')]=_0x2d34dc['id'];return db[_0xa36e('0x64')]['create'](_0x12654f['body']);}})[_0xa36e('0x34')](respondWithResult(_0x284745,null))[_0xa36e('0x54')](handleError(_0x284745,null));};exports[_0xa36e('0x65')]=function(_0x41a838,_0x5b52a8,_0x37a930){var _0x288e80={'raw':![],'where':{}};var _0x3dbf7b={};var _0x324ca2={'count':0x0,'rows':[]};return db[_0xa36e('0x55')]['findOne']({'where':{'id':_0x41a838[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x5b52a8,null))['then'](function(_0x53b58b){if(_0x53b58b){_0x3dbf7b['model']=_[_0xa36e('0x42')](db[_0xa36e('0x64')]['rawAttributes']);_0x3dbf7b[_0xa36e('0x43')]=_[_0xa36e('0x42')](_0x41a838[_0xa36e('0x43')]);_0x3dbf7b[_0xa36e('0x44')]=_[_0xa36e('0x45')](_0x3dbf7b[_0xa36e('0x46')],_0x3dbf7b[_0xa36e('0x43')]);_0x288e80[_0xa36e('0x48')]=_[_0xa36e('0x45')](_0x3dbf7b[_0xa36e('0x46')],qs[_0xa36e('0x47')](_0x41a838['query'][_0xa36e('0x47')]));_0x288e80[_0xa36e('0x48')]=_0x288e80[_0xa36e('0x48')][_0xa36e('0x66')]?_0x288e80[_0xa36e('0x48')]:_0x3dbf7b[_0xa36e('0x46')];if(!_0x41a838['query'][_0xa36e('0x67')](_0xa36e('0x68'))){_0x288e80[_0xa36e('0x2d')]=qs[_0xa36e('0x2d')](_0x41a838[_0xa36e('0x43')]['limit']);_0x288e80[_0xa36e('0x2a')]=qs['offset'](_0x41a838['query'][_0xa36e('0x2a')]);}_0x288e80[_0xa36e('0x49')]=qs[_0xa36e('0x4a')](_0x41a838[_0xa36e('0x43')][_0xa36e('0x4a')]);_0x288e80[_0xa36e('0x4b')]=qs['filters'](_[_0xa36e('0x4c')](_0x41a838['query'],_0x3dbf7b['filters']));_0x288e80[_0xa36e('0x4b')][_0xa36e('0x63')]=_0x53b58b['id'];if(_0x41a838['query'][_0xa36e('0x4d')]){_0x288e80[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x288e80[_0xa36e('0x4b')],{'$or':_['map'](_0x288e80[_0xa36e('0x48')],function(_0x48f4cf){var _0xd99fe8={};_0xd99fe8[_0x48f4cf]={'$like':'%'+_0x41a838['query'][_0xa36e('0x4d')]+'%'};return _0xd99fe8;})});}_0x288e80=_[_0xa36e('0x4e')]({},_0x288e80,_0x41a838[_0xa36e('0x50')]);return db['Disposition'][_0xa36e('0x2c')]({'where':_0x288e80[_0xa36e('0x4b')]})[_0xa36e('0x34')](function(_0x376db3){_0x324ca2[_0xa36e('0x2c')]=_0x376db3;if(_0x41a838[_0xa36e('0x43')]['includeAll']){_0x288e80[_0xa36e('0x52')]=[{'all':!![]}];}return db[_0xa36e('0x64')][_0xa36e('0x53')](_0x288e80);})[_0xa36e('0x34')](function(_0x2c989b){_0x324ca2[_0xa36e('0x69')]=_0x2c989b;return _0x324ca2;});}})[_0xa36e('0x34')](respondWithFilteredResult(_0x5b52a8,_0x288e80))[_0xa36e('0x54')](handleError(_0x5b52a8,null));};exports[_0xa36e('0x6a')]=function(_0x5d0fdd,_0xdddc48,_0x563216){return db['FaxAccount'][_0xa36e('0x56')]({'where':{'id':_0x5d0fdd[_0xa36e('0x60')]['id']}})['then'](handleEntityNotFound(_0xdddc48,null))[_0xa36e('0x34')](function(_0x218e66){if(_0x218e66){return _0x218e66[_0xa36e('0x6a')](_0x5d0fdd[_0xa36e('0x43')]['ids']);}})[_0xa36e('0x34')](respondWithStatusCode(_0xdddc48,null))['catch'](handleError(_0xdddc48,null));};exports[_0xa36e('0x6b')]=function(_0x1491f4,_0x4486ef,_0x2284a0){if(_0x1491f4[_0xa36e('0x5f')]['id']){delete _0x1491f4[_0xa36e('0x5f')]['id'];}return db[_0xa36e('0x55')]['find']({'where':{'id':_0x1491f4[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x4486ef,null))[_0xa36e('0x34')](function(_0x34232e){if(_0x34232e){_0x1491f4[_0xa36e('0x5f')][_0xa36e('0x63')]=_0x34232e['id'];return db[_0xa36e('0x6c')][_0xa36e('0x57')](_0x1491f4[_0xa36e('0x5f')]);}})[_0xa36e('0x34')](respondWithResult(_0x4486ef,null))[_0xa36e('0x54')](handleError(_0x4486ef,null));};exports['getAnswers']=function(_0x4bb9ca,_0x1f4b73,_0x20718a){var _0x4c250c={'raw':![],'where':{}};var _0x1251a0={};var _0x21b3d4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa36e('0x6d')]({'where':{'id':_0x4bb9ca[_0xa36e('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f4b73,null))[_0xa36e('0x34')](function(_0xa22d0){if(_0xa22d0){_0x1251a0[_0xa36e('0x46')]=_[_0xa36e('0x42')](db[_0xa36e('0x6c')]['rawAttributes']);_0x1251a0[_0xa36e('0x43')]=_[_0xa36e('0x42')](_0x4bb9ca['query']);_0x1251a0[_0xa36e('0x44')]=_[_0xa36e('0x45')](_0x1251a0[_0xa36e('0x46')],_0x1251a0[_0xa36e('0x43')]);_0x4c250c[_0xa36e('0x48')]=_[_0xa36e('0x45')](_0x1251a0[_0xa36e('0x46')],qs['fields'](_0x4bb9ca[_0xa36e('0x43')]['fields']));_0x4c250c[_0xa36e('0x48')]=_0x4c250c['attributes'][_0xa36e('0x66')]?_0x4c250c[_0xa36e('0x48')]:_0x1251a0['model'];if(!_0x4bb9ca['query']['hasOwnProperty'](_0xa36e('0x68'))){_0x4c250c[_0xa36e('0x2d')]=qs['limit'](_0x4bb9ca[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x4c250c['offset']=qs['offset'](_0x4bb9ca[_0xa36e('0x43')][_0xa36e('0x2a')]);}_0x4c250c[_0xa36e('0x49')]=qs[_0xa36e('0x4a')](_0x4bb9ca[_0xa36e('0x43')][_0xa36e('0x4a')]);_0x4c250c['where']=qs[_0xa36e('0x44')](_[_0xa36e('0x4c')](_0x4bb9ca[_0xa36e('0x43')],_0x1251a0[_0xa36e('0x44')]));_0x4c250c[_0xa36e('0x4b')][_0xa36e('0x63')]=_0xa22d0['id'];if(_0x4bb9ca[_0xa36e('0x43')][_0xa36e('0x4d')]){_0x4c250c[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x4c250c[_0xa36e('0x4b')],{'$or':_[_0xa36e('0x3e')](_0x4c250c[_0xa36e('0x48')],function(_0x491df6){var _0x1af9a3={};_0x1af9a3[_0x491df6]={'$like':'%'+_0x4bb9ca[_0xa36e('0x43')]['filter']+'%'};return _0x1af9a3;})});}_0x4c250c=_['merge']({},_0x4c250c,_0x4bb9ca['options']);return db[_0xa36e('0x6c')][_0xa36e('0x2c')]({'where':_0x4c250c['where']})[_0xa36e('0x34')](function(_0x348de7){_0x21b3d4[_0xa36e('0x2c')]=_0x348de7;if(_0x4bb9ca['query'][_0xa36e('0x51')]){_0x4c250c[_0xa36e('0x52')]=[{'all':!![]}];}return db[_0xa36e('0x6c')][_0xa36e('0x53')](_0x4c250c);})[_0xa36e('0x34')](function(_0x58792a){_0x21b3d4[_0xa36e('0x69')]=_0x58792a;return _0x21b3d4;});}})[_0xa36e('0x34')](respondWithFilteredResult(_0x1f4b73,_0x4c250c))[_0xa36e('0x54')](handleError(_0x1f4b73,null));};exports[_0xa36e('0x6e')]=function(_0xe43e71,_0x1989da,_0x5078e3){return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0xe43e71[_0xa36e('0x60')]['id']}})['then'](handleEntityNotFound(_0x1989da,null))[_0xa36e('0x34')](function(_0x9bc1c0){if(_0x9bc1c0){return _0x9bc1c0[_0xa36e('0x6e')](_0xe43e71[_0xa36e('0x43')][_0xa36e('0x6f')]);}})[_0xa36e('0x34')](respondWithStatusCode(_0x1989da,null))['catch'](handleError(_0x1989da,null));};exports['addInteraction']=function(_0x4cef20,_0x53c02d,_0x34b070){return db[_0xa36e('0x70')][_0xa36e('0x56')]({'where':{'id':_0x4cef20[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x53c02d,null))[_0xa36e('0x34')](function(_0x41a2e9){if(_0x41a2e9){return _0x41a2e9[_0xa36e('0x71')](_0x4cef20[_0xa36e('0x5f')][_0xa36e('0x6f')],_[_0xa36e('0x72')](_0x4cef20[_0xa36e('0x5f')],[_0xa36e('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x53c02d,null))[_0xa36e('0x54')](handleError(_0x53c02d,null));};exports[_0xa36e('0x73')]=function(_0x22631c,_0x20c2d5,_0x52330c){var _0x1f8771={'raw':![],'where':{}};var _0x46c449={};var _0xc8d8c3={'count':0x0,'rows':[]};return db[_0xa36e('0x55')]['findOne']({'where':{'id':_0x22631c[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x20c2d5,null))['then'](function(_0x424e6d){if(_0x424e6d){_0x46c449[_0xa36e('0x46')]=_['keys'](db[_0xa36e('0x70')][_0xa36e('0x3f')]);_0x46c449['query']=_['keys'](_0x22631c[_0xa36e('0x43')]);_0x46c449[_0xa36e('0x44')]=_[_0xa36e('0x45')](_0x46c449[_0xa36e('0x46')],_0x46c449[_0xa36e('0x43')]);_0x1f8771['attributes']=_['intersection'](_0x46c449['model'],qs[_0xa36e('0x47')](_0x22631c['query'][_0xa36e('0x47')]));_0x1f8771[_0xa36e('0x48')]=_0x1f8771[_0xa36e('0x48')]['length']?_0x1f8771['attributes']:_0x46c449[_0xa36e('0x46')];if(!_0x22631c[_0xa36e('0x43')][_0xa36e('0x67')](_0xa36e('0x68'))){_0x1f8771[_0xa36e('0x2d')]=qs['limit'](_0x22631c[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x1f8771[_0xa36e('0x2a')]=qs[_0xa36e('0x2a')](_0x22631c[_0xa36e('0x43')][_0xa36e('0x2a')]);}_0x1f8771['order']=qs['sort'](_0x22631c['query']['sort']);_0x1f8771['where']=qs[_0xa36e('0x44')](_[_0xa36e('0x4c')](_0x22631c[_0xa36e('0x43')],_0x46c449['filters']));_0x1f8771[_0xa36e('0x4b')][_0xa36e('0x63')]=_0x424e6d['id'];if(_0x22631c[_0xa36e('0x43')][_0xa36e('0x4d')]){_0x1f8771[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x1f8771['where'],{'$or':_[_0xa36e('0x3e')](_0x1f8771['attributes'],function(_0x19cee3){var _0x3879c6={};_0x3879c6[_0x19cee3]={'$like':'%'+_0x22631c[_0xa36e('0x43')]['filter']+'%'};return _0x3879c6;})});}_0x1f8771=_['merge']({},_0x1f8771,_0x22631c[_0xa36e('0x50')]);return db[_0xa36e('0x70')]['count']({'where':_0x1f8771[_0xa36e('0x4b')]})[_0xa36e('0x34')](function(_0x5e943f){_0xc8d8c3[_0xa36e('0x2c')]=_0x5e943f;if(_0x22631c['query']['includeAll']){_0x1f8771['include']=[{'model':db[_0xa36e('0x74')],'as':'Contact','required':![]},{'model':db[_0xa36e('0x75')],'as':_0xa36e('0x76'),'attributes':['name',_0xa36e('0x77'),_0xa36e('0x78')],'required':![]},{'model':db['Tag'],'as':_0xa36e('0x79'),'attributes':['id','name',_0xa36e('0x7a')],'where':_0x22631c['query']['tag']?{'id':_0x22631c['query'][_0xa36e('0x7b')]}:undefined,'required':_0x22631c[_0xa36e('0x43')][_0xa36e('0x7b')]?!![]:![]}];}return db[_0xa36e('0x70')]['findAll'](_0x1f8771);})['then'](function(_0x2a9835){_0xc8d8c3[_0xa36e('0x69')]=_0x2a9835;return _0xc8d8c3;});}})[_0xa36e('0x34')](respondWithFilteredResult(_0x20c2d5,_0x1f8771))[_0xa36e('0x54')](handleError(_0x20c2d5,null));};exports[_0xa36e('0x7c')]=function(_0x28f33f,_0xc18a80,_0x224c07){return db[_0xa36e('0x55')][_0xa36e('0x6d')]({'where':{'id':_0x28f33f['params']['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0xc18a80,null))['then'](function(_0x17aa44){if(_0x17aa44){return db[_0xa36e('0x7d')][_0xa36e('0x7e')](function(_0x2b7516){return db['FaxApplication'][_0xa36e('0x35')]({'where':{'FaxAccountId':_0x28f33f[_0xa36e('0x60')]['id']},'transaction':_0x2b7516})[_0xa36e('0x34')](function(_0x3d6191){var _0x30fcda=_[_0xa36e('0x3e')](_0x28f33f[_0xa36e('0x5f')],function(_0x5e9752){_0x5e9752[_0xa36e('0x63')]=_0x28f33f[_0xa36e('0x60')]['id'];return _0x5e9752;});return db[_0xa36e('0x7f')][_0xa36e('0x80')](_0x30fcda,{'transaction':_0x2b7516});});})[_0xa36e('0x34')](function(){return db[_0xa36e('0x7f')][_0xa36e('0x81')]({'where':{'FaxAccountId':_0x28f33f[_0xa36e('0x60')]['id']},'order':_0xa36e('0x82')});});}})['then'](respondWithResult(_0xc18a80,null))[_0xa36e('0x54')](handleError(_0xc18a80,null));};exports[_0xa36e('0x83')]=function(_0x39438d,_0x1caf95,_0x3e2fb2){var _0x42496d={};var _0x10a41d={};var _0x2c7d6a;var _0x26b3d;return db[_0xa36e('0x55')][_0xa36e('0x6d')]({'where':{'id':_0x39438d[_0xa36e('0x60')]['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x1caf95,null))['then'](function(_0x1ef312){if(_0x1ef312){_0x2c7d6a=_0x1ef312;_0x10a41d['model']=_[_0xa36e('0x42')](db['FaxApplication'][_0xa36e('0x3f')]);_0x10a41d['query']=_[_0xa36e('0x42')](_0x39438d[_0xa36e('0x43')]);_0x10a41d['filters']=_['intersection'](_0x10a41d[_0xa36e('0x46')],_0x10a41d[_0xa36e('0x43')]);_0x42496d[_0xa36e('0x48')]=_[_0xa36e('0x45')](_0x10a41d['model'],qs[_0xa36e('0x47')](_0x39438d['query']['fields']));_0x42496d[_0xa36e('0x48')]=_0x42496d[_0xa36e('0x48')][_0xa36e('0x66')]?_0x42496d[_0xa36e('0x48')]:_0x10a41d[_0xa36e('0x46')];_0x42496d[_0xa36e('0x49')]=qs['sort'](_0x39438d['query'][_0xa36e('0x4a')]);_0x42496d[_0xa36e('0x4b')]=qs[_0xa36e('0x44')](_[_0xa36e('0x4c')](_0x39438d[_0xa36e('0x43')],_0x10a41d['filters']));if(_0x39438d[_0xa36e('0x43')][_0xa36e('0x4d')]){_0x42496d[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x42496d[_0xa36e('0x4b')],{'$or':_[_0xa36e('0x3e')](_0x42496d['attributes'],function(_0x567a89){var _0x1ce8b4={};_0x1ce8b4[_0x567a89]={'$like':'%'+_0x39438d[_0xa36e('0x43')][_0xa36e('0x4d')]+'%'};return _0x1ce8b4;})});}_0x42496d=_['merge']({},_0x42496d,_0x39438d['options']);return _0x2c7d6a[_0xa36e('0x83')](_0x42496d);}})[_0xa36e('0x34')](function(_0x20a011){if(_0x20a011){_0x26b3d=_0x20a011[_0xa36e('0x66')];if(!_0x39438d[_0xa36e('0x43')][_0xa36e('0x67')]('nolimit')){_0x42496d[_0xa36e('0x2d')]=qs[_0xa36e('0x2d')](_0x39438d[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x42496d['offset']=qs[_0xa36e('0x2a')](_0x39438d[_0xa36e('0x43')]['offset']);}return _0x2c7d6a['getApplications'](_0x42496d);}})['then'](function(_0x21583a){if(_0x21583a){return _0x21583a?{'count':_0x26b3d,'rows':_0x21583a}:null;}})[_0xa36e('0x34')](respondWithResult(_0x1caf95,null))[_0xa36e('0x54')](handleError(_0x1caf95,null));};function Extension(_0x31bb80,_0x2cf0d5,_0x4198a3,_0x535a5b){this['context']=_0xa36e('0x84');this[_0xa36e('0x85')]=_0x31bb80[_0xa36e('0x86')];this[_0xa36e('0x87')]=_0x535a5b;this[_0xa36e('0x40')]=_0xa36e('0x88');this[_0xa36e('0x89')]='Fax\x20Extension';this[_0xa36e('0x63')]=_0x31bb80['id'];this[_0xa36e('0x82')]=_0x2cf0d5;this[_0xa36e('0x8a')]=_0x4198a3;}function createExtensionsReciveFax(_0x3a4ea0){var _0x3625ff=0x1;var _0x3214bb=[];_0x3214bb['push'](new Extension(_0x3a4ea0,_0x3625ff,'',_0xa36e('0x8b')));_0x3625ff+=0x1;_0x3214bb[_0xa36e('0x8c')](new Extension(_0x3a4ea0,_0x3625ff,_0xa36e('0x8d'),_0xa36e('0x8e')));_0x3625ff+=0x1;for(var _0x465a2c in _0x3a4ea0){if(_0x3a4ea0[_0xa36e('0x67')](_0x465a2c)&&(_0x465a2c===_0xa36e('0x8f')||_0x465a2c===_0xa36e('0x86')||_0x465a2c===_0xa36e('0x90')||_0x465a2c==='faxdetect'||_0x465a2c===_0xa36e('0x91')||_0x465a2c==='maxrate'||_0x465a2c===_0xa36e('0x92')||_0x465a2c===_0xa36e('0x93')||_0x465a2c===_0xa36e('0x94'))){_0x3214bb[_0xa36e('0x8c')](new Extension(_0x3a4ea0,_0x3625ff,'FAXOPT('+_0x465a2c+')='+_0x3a4ea0[_0x465a2c],_0xa36e('0x8e')));_0x3625ff+=0x1;}}_0x3214bb[_0xa36e('0x8c')](new Extension(_0x3a4ea0,_0x3625ff,'6','Wait'));_0x3625ff+=0x1;_0x3214bb['push'](new Extension(_0x3a4ea0,_0x3625ff,_0xa36e('0x95'),_0xa36e('0x96')));_0x3625ff=0x0;return _0x3214bb;}exports[_0xa36e('0x97')]=function(_0x3d901c,_0x3d61c2,_0x44ee90){var _0x2bfdc7;return db['sequelize'][_0xa36e('0x7e')](function(_0x320365){return db[_0xa36e('0x55')][_0xa36e('0x57')](_0x3d901c[_0xa36e('0x5f')],{'transaction':_0x320365})[_0xa36e('0x34')](function(_0x226376){_0x2bfdc7=_0x226376[_0xa36e('0x36')]({'plain':!![]});return db[_0xa36e('0x98')][_0xa36e('0x80')](createExtensionsReciveFax(_0x2bfdc7),{'transaction':_0x320365});});})[_0xa36e('0x34')](function(){return _0x2bfdc7;})[_0xa36e('0x34')](respondWithResult(_0x3d61c2,null))['catch'](handleError(_0x3d61c2,null));};exports['updateAccountApplications']=function(_0x9368cb,_0x16d500,_0x2ab00e){var _0xdd08f0;return db['sequelize'][_0xa36e('0x7e')](function(_0xeb5afc){return db['FaxAccount'][_0xa36e('0x33')](_0x9368cb[_0xa36e('0x5f')],{'where':{'id':_0x9368cb[_0xa36e('0x5f')]['id']},'transaction':_0xeb5afc})['then'](function(_0x3e8999){return db[_0xa36e('0x98')][_0xa36e('0x35')]({'where':{'FaxAccountId':_0x9368cb['body']['id']},'transaction':_0xeb5afc})[_0xa36e('0x34')](function(_0x1d7947){return db[_0xa36e('0x98')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x9368cb[_0xa36e('0x5f')],[_0xa36e('0x99'),'key',_0xa36e('0x9a'),'updatedAt','TrunkId',_0xa36e('0x9b')])),{'transaction':_0xeb5afc});});});})[_0xa36e('0x34')](function(){return db[_0xa36e('0x55')]['findById'](_0x9368cb[_0xa36e('0x5f')]['id']);})[_0xa36e('0x34')](respondWithResult(_0x16d500,null))['catch'](handleError(_0x16d500,null));};exports['getMessages']=function(_0x18fef6,_0x31bd88,_0x586890){var _0x42b33c={'raw':!![],'where':{}};var _0x694892={};var _0x6f7d0f={'count':0x0,'rows':[]};return db[_0xa36e('0x55')][_0xa36e('0x6d')]({'where':{'id':_0x18fef6[_0xa36e('0x60')]['id']}})['then'](handleEntityNotFound(_0x31bd88,null))[_0xa36e('0x34')](function(_0x1f9dc8){if(_0x1f9dc8){_0x694892[_0xa36e('0x46')]=_[_0xa36e('0x42')](db['FaxMessage'][_0xa36e('0x3f')]);_0x694892[_0xa36e('0x43')]=_['keys'](_0x18fef6[_0xa36e('0x43')]);_0x694892['filters']=_[_0xa36e('0x45')](_0x694892['model'],_0x694892['query']);_0x42b33c['attributes']=_[_0xa36e('0x45')](_0x694892['model'],qs[_0xa36e('0x47')](_0x18fef6[_0xa36e('0x43')][_0xa36e('0x47')]));_0x42b33c['attributes']=_0x42b33c[_0xa36e('0x48')]['length']?_0x42b33c[_0xa36e('0x48')]:_0x694892['model'];if(!_0x18fef6[_0xa36e('0x43')][_0xa36e('0x67')](_0xa36e('0x68'))){_0x42b33c[_0xa36e('0x2d')]=qs[_0xa36e('0x2d')](_0x18fef6[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x42b33c[_0xa36e('0x2a')]=qs[_0xa36e('0x2a')](_0x18fef6[_0xa36e('0x43')][_0xa36e('0x2a')]);}_0x42b33c[_0xa36e('0x49')]=qs[_0xa36e('0x4a')](_0x18fef6['query'][_0xa36e('0x4a')]);_0x42b33c[_0xa36e('0x4b')]=qs['filters'](_['pick'](_0x18fef6[_0xa36e('0x43')],_0x694892['filters']));_0x42b33c[_0xa36e('0x4b')]['FaxAccountId']=_0x1f9dc8['id'];if(_0x18fef6[_0xa36e('0x43')][_0xa36e('0x4d')]){_0x42b33c[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x42b33c[_0xa36e('0x4b')],{'$or':_[_0xa36e('0x3e')](_0x42b33c[_0xa36e('0x48')],function(_0x2c166f){var _0x21f6ca={};_0x21f6ca[_0x2c166f]={'$like':'%'+_0x18fef6[_0xa36e('0x43')][_0xa36e('0x4d')]+'%'};return _0x21f6ca;})});}if(_0x18fef6[_0xa36e('0x43')][_0xa36e('0x9c')]){var _0x11a72c=_0x18fef6['query'][_0xa36e('0x9c')][_0xa36e('0x9d')](',');var _0x5d18af={};_0x5d18af[_0x11a72c[0x0]]={'$gte':moment(_0x11a72c[0x1])['format'](_0xa36e('0x9e'))};_0x42b33c[_0xa36e('0x4b')]=_[_0xa36e('0x4e')](_0x42b33c[_0xa36e('0x4b')],_0x5d18af);}_0x42b33c=_[_0xa36e('0x4e')]({},_0x42b33c,_0x18fef6[_0xa36e('0x50')]);return db[_0xa36e('0x9f')][_0xa36e('0x2c')]({'where':_0x42b33c['where']})[_0xa36e('0x34')](function(_0x467e32){_0x6f7d0f[_0xa36e('0x2c')]=_0x467e32;if(_0x18fef6[_0xa36e('0x43')][_0xa36e('0x51')]){_0x42b33c[_0xa36e('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x42b33c);})[_0xa36e('0x34')](function(_0x496be7){_0x6f7d0f[_0xa36e('0x69')]=_0x496be7;return _0x6f7d0f;});}})['then'](respondWithFilteredResult(_0x31bd88,_0x42b33c))[_0xa36e('0x54')](handleError(_0x31bd88,null));};exports[_0xa36e('0x3a')]=function(_0x300052,_0x101e9d,_0x10909a){var _0x3795c7,_0x19fa89={},_0x2c32d5;if(_0x300052[_0xa36e('0x5f')]['to']){_0x2c32d5=_0x300052[_0xa36e('0x5f')]['to'][0x0];}return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0x300052[_0xa36e('0x60')]['id']},'include':[{'model':db[_0xa36e('0xa0')],'as':_0xa36e('0xa1'),'include':[{'model':db[_0xa36e('0x74')],'as':_0xa36e('0xa2'),'where':{'fax':_0x2c32d5},'limit':0x1,'order':[[_0xa36e('0xa3'),_0xa36e('0xa4')]]}]}]})[_0xa36e('0x34')](handleEntityNotFound(_0x101e9d,null))[_0xa36e('0x34')](function(_0x325758){_0x3795c7=_0x325758;if(_0x300052[_0xa36e('0x5f')]['attachments']&&_0x300052['body']['attachments'][_0xa36e('0x66')]){for(var _0x3828a2=0x0;_0x3828a2<_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][_0xa36e('0x66')];_0x3828a2+=0x1){_0x300052['body'][_0xa36e('0xa5')][_0x3828a2]={'filename':_0x300052[_0xa36e('0x5f')]['attachments'][_0x3828a2][_0xa36e('0x39')],'id':_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][_0x3828a2]['id'],'path':path[_0xa36e('0xa6')](config[_0xa36e('0xa7')],'server/files/attachments',_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][_0x3828a2]['basename'])};}}return respondWithRpcPromise(_0xa36e('0xa8'),_0xa36e('0xa8'),{'FaxAccountId':_['isNil'](_0x300052[_0xa36e('0x60')]['id'])?undefined:_0x300052[_0xa36e('0x60')]['id'],'path':_[_0xa36e('0xa9')](_0x300052['body'][_0xa36e('0xa5')][0x0][_0xa36e('0x6')])?undefined:_0x300052['body'][_0xa36e('0xa5')][0x0]['path'],'fax':_[_0xa36e('0xa9')](_0x300052['body']['to'][0x0])?undefined:_0x300052[_0xa36e('0x5f')]['to'][0x0]},client9002);})[_0xa36e('0x34')](function(){if(_0x3795c7){if(_[_0xa36e('0xa9')](_0x300052['body'][_0xa36e('0xaa')])){_0x300052[_0xa36e('0x5f')][_0xa36e('0xaa')]=util[_0xa36e('0xab')](_0xa36e('0xac'),_0x3795c7[_0xa36e('0x39')],_0x3795c7[_0xa36e('0xad')]);}if(_0x3795c7['List']){if(_0x3795c7[_0xa36e('0xa1')]['Contacts'][_0xa36e('0x66')]){return _0x3795c7['List'][_0xa36e('0xa2')][0x0];}else{return db[_0xa36e('0x74')]['create'](_['defaults'](_0x300052[_0xa36e('0x5f')],{'firstName':_0x300052[_0xa36e('0x5f')]['to'][0x0],'phone':_0x300052['body']['to'][0x0],'fax':_0x300052[_0xa36e('0x5f')]['to'][0x0],'ListId':_0x3795c7[_0xa36e('0x9b')]}));}}else{throw new Error(_0xa36e('0xae'));}}else{throw new Error(_0xa36e('0xaf'));}})[_0xa36e('0x34')](function(_0x2a2e72){if(_0x2a2e72){return db['FaxInteraction'][_0xa36e('0x56')]({'where':{'ContactId':_0x2a2e72['id'],'closed':![],'FaxAccountId':_0x3795c7['id']}})[_0xa36e('0x34')](function(_0x30221e){if(_0x30221e){return[_0x30221e,![]];}return db['FaxInteraction'][_0xa36e('0x57')]({'UserId':_0x300052[_0xa36e('0x58')]['id'],'ContactId':_0x2a2e72['id'],'FaxAccountId':_0x3795c7['id'],'fax':_0x300052[_0xa36e('0x5f')]['to'][0x0],'firstMsgDirection':_0xa36e('0xb0'),'Messages':[_['merge'](_0x300052[_0xa36e('0x5f')],{'read':![],'body':_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][0x0][_0xa36e('0xb1')],'FaxAccountId':_0x3795c7['id'],'UserId':_0x300052[_0xa36e('0x58')]['id'],'ContactId':_0x2a2e72['id'],'AttachmentId':_0x300052[_0xa36e('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xa36e('0x9f')],'as':'Messages'}]})[_0xa36e('0x34')](function(_0x124f84){return[_0x124f84,!![]];});});}else{throw new Error(_0xa36e('0xb2'));}})[_0xa36e('0xb3')](function(_0x16204e,_0x30eeac){if(_0x30eeac){return _0x16204e;}return db[_0xa36e('0x9f')]['create']({'direction':'out','read':![],'body':_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][0x0]['filename'],'FaxAccountId':_0x3795c7['id'],'FaxInteractionId':_0x16204e['id'],'UserId':_0x300052[_0xa36e('0x58')]['id'],'ContactId':_0x16204e[_0xa36e('0xb4')],'AttachmentId':_0x300052[_0xa36e('0x5f')]['attachments'][0x0]['id']})[_0xa36e('0x34')](function(_0x25cf76){_0x16204e['dataValues'][_0xa36e('0xb5')]=[];_0x16204e[_0xa36e('0xb6')][_0xa36e('0xb5')][_0xa36e('0x8c')](_0x25cf76[_0xa36e('0xb6')]);return _0x16204e;});})['then'](function(_0x32d380){respondWithRpcPromise('SendFax',_0xa36e('0xb7'),{'FaxAccountId':_[_0xa36e('0xa9')](_0x300052[_0xa36e('0x60')]['id'])?undefined:_0x300052['params']['id'],'path':_[_0xa36e('0xa9')](_0x300052[_0xa36e('0x5f')]['attachments'][0x0][_0xa36e('0x6')])?undefined:_0x300052['body'][_0xa36e('0xa5')][0x0][_0xa36e('0x6')],'fax':_[_0xa36e('0xa9')](_0x300052[_0xa36e('0x5f')]['to'][0x0])?undefined:_0x300052[_0xa36e('0x5f')]['to'][0x0],'AttachmentId':_0x300052[_0xa36e('0x5f')][_0xa36e('0xa5')][0x0]['id']},client9002)['then'](function(_0x499e4b){logger[_0xa36e('0x25')](_0xa36e('0xb8'),_0x499e4b);})[_0xa36e('0x54')](function(_0xf94d0d){logger['info'](_0xa36e('0xb8'),_0xf94d0d);});return _0x32d380;})[_0xa36e('0x34')](respondWithResult(_0x101e9d,null))[_0xa36e('0x54')](handleError(_0x101e9d,null));};exports['addAgents']=function(_0x15af6b,_0x4ca2c9,_0x186b72){return db[_0xa36e('0x55')]['find']({'where':{'id':_0x15af6b['params']['id']}})['then'](handleEntityNotFound(_0x4ca2c9,null))['then'](function(_0x103660){if(_0x103660){return _0x103660['addAgents'](_0x15af6b[_0xa36e('0x5f')][_0xa36e('0x6f')],_[_0xa36e('0x72')](_0x15af6b[_0xa36e('0x5f')],['ids','id'])||{})[_0xa36e('0xb3')](function(_0x30e1b){for(var _0x1baf18=0x0;_0x1baf18<_0x15af6b[_0xa36e('0x5f')][_0xa36e('0x6f')][_0xa36e('0x66')];_0x1baf18+=0x1){socket[_0xa36e('0xb9')](_0xa36e('0xba'),{'UserId':Number(_0x15af6b[_0xa36e('0x5f')][_0xa36e('0x6f')][_0x1baf18]),'FaxAccountId':Number(_0x15af6b['params']['id'])});}return _0x30e1b;});}})['then'](respondWithResult(_0x4ca2c9,null))[_0xa36e('0x54')](handleError(_0x4ca2c9,null));};exports[_0xa36e('0xbb')]=function(_0x1590ad,_0x201ba4,_0x59e971){return db[_0xa36e('0x55')][_0xa36e('0x56')]({'where':{'id':_0x1590ad['params']['id']}})[_0xa36e('0x34')](handleEntityNotFound(_0x201ba4,null))[_0xa36e('0x34')](function(_0x25cf67){if(_0x25cf67){return _0x25cf67[_0xa36e('0xbb')](_0x1590ad[_0xa36e('0x43')]['ids'])['then'](function(){if(_[_0xa36e('0xbc')](_0x1590ad[_0xa36e('0x43')]['ids'])){for(var _0x2738e0=0x0;_0x2738e0<_0x1590ad[_0xa36e('0x43')][_0xa36e('0x6f')]['length'];_0x2738e0+=0x1){socket['emit'](_0xa36e('0xbd'),{'UserId':Number(_0x1590ad[_0xa36e('0x43')][_0xa36e('0x6f')][_0x2738e0]),'FaxAccountId':Number(_0x1590ad[_0xa36e('0x60')]['id'])});}}else{socket['emit'](_0xa36e('0xbd'),{'UserId':Number(_0x1590ad[_0xa36e('0x43')][_0xa36e('0x6f')]),'FaxAccountId':Number(_0x1590ad[_0xa36e('0x60')]['id'])});}});}})[_0xa36e('0x34')](respondWithStatusCode(_0x201ba4,null))['catch'](handleError(_0x201ba4,null));};exports[_0xa36e('0xbe')]=function(_0x5f51f7,_0x4b930c,_0x2207a8){var _0x4eb684={};var _0x39e0d7={};var _0x1e8e68;var _0x5ec0ac;return db[_0xa36e('0x55')][_0xa36e('0x6d')]({'where':{'id':_0x5f51f7[_0xa36e('0x60')]['id']}})['then'](handleEntityNotFound(_0x4b930c,null))['then'](function(_0x5da77c){if(_0x5da77c){_0x1e8e68=_0x5da77c;_0x39e0d7[_0xa36e('0x46')]=_[_0xa36e('0x42')](db[_0xa36e('0x75')][_0xa36e('0x3f')]);_0x39e0d7[_0xa36e('0x43')]=_[_0xa36e('0x42')](_0x5f51f7[_0xa36e('0x43')]);_0x39e0d7['filters']=_[_0xa36e('0x45')](_0x39e0d7[_0xa36e('0x46')],_0x39e0d7['query']);_0x4eb684[_0xa36e('0x48')]=_[_0xa36e('0x45')](_0x39e0d7[_0xa36e('0x46')],qs['fields'](_0x5f51f7[_0xa36e('0x43')][_0xa36e('0x47')]));_0x4eb684[_0xa36e('0x48')]=_0x4eb684[_0xa36e('0x48')]['length']?_0x4eb684[_0xa36e('0x48')]:_0x39e0d7[_0xa36e('0x46')];_0x4eb684['order']=qs[_0xa36e('0x4a')](_0x5f51f7[_0xa36e('0x43')]['sort']);_0x4eb684[_0xa36e('0x4b')]=qs[_0xa36e('0x44')](_['pick'](_0x5f51f7[_0xa36e('0x43')],_0x39e0d7['filters']));if(_0x5f51f7['query'][_0xa36e('0x4d')]){_0x4eb684[_0xa36e('0x4b')]=_['merge'](_0x4eb684['where'],{'$or':_['map'](_0x4eb684[_0xa36e('0x48')],function(_0x3f4619){var _0xa4c92b={};_0xa4c92b[_0x3f4619]={'$like':'%'+_0x5f51f7['query'][_0xa36e('0x4d')]+'%'};return _0xa4c92b;})});}_0x4eb684=_[_0xa36e('0x4e')]({},_0x4eb684,_0x5f51f7[_0xa36e('0x50')]);return _0x1e8e68[_0xa36e('0xbe')](_0x4eb684);}})[_0xa36e('0x34')](function(_0x83573d){if(_0x83573d){_0x5ec0ac=_0x83573d['length'];if(!_0x5f51f7[_0xa36e('0x43')]['hasOwnProperty']('nolimit')){_0x4eb684[_0xa36e('0x2d')]=qs[_0xa36e('0x2d')](_0x5f51f7[_0xa36e('0x43')][_0xa36e('0x2d')]);_0x4eb684[_0xa36e('0x2a')]=qs[_0xa36e('0x2a')](_0x5f51f7[_0xa36e('0x43')][_0xa36e('0x2a')]);}return _0x1e8e68[_0xa36e('0xbe')](_0x4eb684);}})[_0xa36e('0x34')](function(_0x1a6c6d){if(_0x1a6c6d){return _0x1a6c6d?{'count':_0x5ec0ac,'rows':_0x1a6c6d}:null;}})[_0xa36e('0x34')](respondWithResult(_0x4b930c,null))['catch'](handleError(_0x4b930c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d1b351e..cb0add4 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 _0xc001=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4f011e,_0x17fccf){var _0x3e717e=function(_0xaeaf46){while(--_0xaeaf46){_0x4f011e['push'](_0x4f011e['shift']());}};_0x3e717e(++_0x17fccf);}(_0xc001,0xde));var _0x1c00=function(_0x4cd888,_0x4d082a){_0x4cd888=_0x4cd888-0x0;var _0x451d4b=_0xc001[_0x4cd888];return _0x451d4b;};'use strict';var EventEmitter=require(_0x1c00('0x0'));var FaxAccount=require(_0x1c00('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c00('0x2'),'afterUpdate':_0x1c00('0x3'),'afterDestroy':'remove'};function emitEvent(_0x592ebe){return function(_0x58c93f,_0x590148,_0x49d520){FaxAccountEvents[_0x1c00('0x4')](_0x592ebe+':'+_0x58c93f['id'],_0x58c93f);FaxAccountEvents[_0x1c00('0x4')](_0x592ebe,_0x58c93f);_0x49d520(null);};}for(var e in events){if(events[_0x1c00('0x5')](e)){var event=events[e];FaxAccount[_0x1c00('0x6')](e,emitEvent(event));}}module[_0x1c00('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xbcf8=['exports','events','FaxAccount','save','update','hook'];(function(_0x3a15cb,_0x598441){var _0x2447b0=function(_0x2364f1){while(--_0x2364f1){_0x3a15cb['push'](_0x3a15cb['shift']());}};_0x2447b0(++_0x598441);}(_0xbcf8,0x15d));var _0x8bcf=function(_0x46c8e0,_0x122286){_0x46c8e0=_0x46c8e0-0x0;var _0x573e9c=_0xbcf8[_0x46c8e0];return _0x573e9c;};'use strict';var EventEmitter=require(_0x8bcf('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x8bcf('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8bcf('0x2'),'afterUpdate':_0x8bcf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3287d3){return function(_0x1d9695,_0x1bfbde,_0x657cf){FaxAccountEvents['emit'](_0x3287d3+':'+_0x1d9695['id'],_0x1d9695);FaxAccountEvents['emit'](_0x3287d3,_0x1d9695);_0x657cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x8bcf('0x4')](e,emitEvent(event));}}module[_0x8bcf('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index eb4bf6a..db19139 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 _0x1fd4=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','bluebird','request-promise','path'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x1fd4,0x1b3));var _0x41fd=function(_0x19688b,_0x203425){_0x19688b=_0x19688b-0x0;var _0x29df75=_0x1fd4[_0x19688b];return _0x29df75;};'use strict';var _=require('lodash');var util=require(_0x41fd('0x0'));var logger=require('../../config/logger')(_0x41fd('0x1'));var moment=require('moment');var BPromise=require(_0x41fd('0x2'));var rp=require(_0x41fd('0x3'));var fs=require('fs');var path=require(_0x41fd('0x4'));var rimraf=require('rimraf');var config=require(_0x41fd('0x5'));var attributes=require(_0x41fd('0x6'));module[_0x41fd('0x7')]=function(_0x55c60e,_0x597b43){return _0x55c60e[_0x41fd('0x8')](_0x41fd('0x9'),attributes,{'tableName':_0x41fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2b2=['FaxAccount','util','../../config/logger','api','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x45bc77,_0x4cee76){var _0x252212=function(_0x58b138){while(--_0x58b138){_0x45bc77['push'](_0x45bc77['shift']());}};_0x252212(++_0x4cee76);}(_0xb2b2,0x1b9));var _0x2b2b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xb2b2[_0x42bdad];return _0x122626;};'use strict';var _=require('lodash');var util=require(_0x2b2b('0x0'));var logger=require(_0x2b2b('0x1'))(_0x2b2b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2b2b('0x3'));var fs=require('fs');var path=require(_0x2b2b('0x4'));var rimraf=require(_0x2b2b('0x5'));var config=require('../../config/environment');var attributes=require(_0x2b2b('0x6'));module['exports']=function(_0x6eef5c,_0x532f87){return _0x6eef5c['define'](_0x2b2b('0x7'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 73d872c..92bd85c 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 _0xbfb0=['length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','find','unshift','agent','name','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','model','map','debug','NotifyFaxAccount','body','fax','describe','difference','keys','createdAt','updatedAt','ListId','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','from','account','CmList','List','CmContact','DESC','FaxApplication','Applications','get','applications','priority','asc','Contacts'];(function(_0x231500,_0x2b28d0){var _0x4796ec=function(_0x23946c){while(--_0x23946c){_0x231500['push'](_0x231500['shift']());}};_0x4796ec(++_0x2b28d0);}(_0xbfb0,0x6f));var _0x0bfb=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xbfb0[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0x0bfb('0x0'));var util=require(_0x0bfb('0x1'));var moment=require('moment');var BPromise=require(_0x0bfb('0x2'));var rs=require(_0x0bfb('0x3'));var fs=require('fs');var Redis=require(_0x0bfb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bfb('0x5'));var logger=require(_0x0bfb('0x6'))(_0x0bfb('0x7'));var config=require(_0x0bfb('0x8'));var jayson=require(_0x0bfb('0x9'));var client=jayson[_0x0bfb('0xa')][_0x0bfb('0xb')]({'port':0x232c});config[_0x0bfb('0xc')]=_[_0x0bfb('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0bfb('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x168228,_0x1706d7,_0x490bfb){return new BPromise(function(_0x1e7bbd,_0xf5351e){return client['request'](_0x168228,_0x490bfb)[_0x0bfb('0xf')](function(_0x39192e){logger[_0x0bfb('0x10')](_0x0bfb('0x11'),_0x1706d7,_0x0bfb('0x12'));logger['debug'](_0x0bfb('0x13'),_0x1706d7,_0x0bfb('0x12'),JSON[_0x0bfb('0x14')](_0x39192e));if(_0x39192e[_0x0bfb('0x15')]){if(_0x39192e[_0x0bfb('0x15')][_0x0bfb('0x16')]===0x1f4){logger[_0x0bfb('0x15')](_0x0bfb('0x11'),_0x1706d7,_0x39192e[_0x0bfb('0x15')][_0x0bfb('0x17')]);return _0xf5351e(_0x39192e[_0x0bfb('0x15')][_0x0bfb('0x17')]);}logger[_0x0bfb('0x15')](_0x0bfb('0x11'),_0x1706d7,_0x39192e[_0x0bfb('0x15')][_0x0bfb('0x17')]);return _0x1e7bbd(_0x39192e[_0x0bfb('0x15')]['message']);}else{logger[_0x0bfb('0x10')](_0x0bfb('0x11'),_0x1706d7,'request\x20sent');_0x1e7bbd(_0x39192e['result'][_0x0bfb('0x17')]);}})['catch'](function(_0x22b3f7){logger[_0x0bfb('0x15')](_0x0bfb('0x11'),_0x1706d7,_0x22b3f7);_0xf5351e(_0x22b3f7);});});}exports[_0x0bfb('0x18')]=function(_0x8119b5){var _0x4e9698=this;return new Promise(function(_0x43ff9a,_0x579539){return db[_0x0bfb('0x19')]['findAll']({'raw':_0x8119b5[_0x0bfb('0x1a')]?_0x8119b5['options'][_0x0bfb('0x1b')]===undefined?!![]:![]:!![],'where':_0x8119b5[_0x0bfb('0x1a')]?_0x8119b5[_0x0bfb('0x1a')][_0x0bfb('0x1c')]||null:null,'attributes':_0x8119b5[_0x0bfb('0x1a')]?_0x8119b5[_0x0bfb('0x1a')][_0x0bfb('0x1d')]||null:null,'limit':_0x8119b5[_0x0bfb('0x1a')]?_0x8119b5[_0x0bfb('0x1a')][_0x0bfb('0x1e')]||null:null,'include':_0x8119b5[_0x0bfb('0x1a')]?_0x8119b5[_0x0bfb('0x1a')][_0x0bfb('0x1f')]?_['map'](_0x8119b5['options'][_0x0bfb('0x1f')],function(_0x191741){return{'model':db[_0x191741[_0x0bfb('0x20')]],'as':_0x191741['as'],'attributes':_0x191741['attributes'],'include':_0x191741[_0x0bfb('0x1f')]?_[_0x0bfb('0x21')](_0x191741[_0x0bfb('0x1f')],function(_0x478c7a){return{'model':db[_0x478c7a[_0x0bfb('0x20')]],'as':_0x478c7a['as'],'attributes':_0x478c7a[_0x0bfb('0x1d')],'include':_0x478c7a[_0x0bfb('0x1f')]?_[_0x0bfb('0x21')](_0x478c7a['include'],function(_0x5bbbbe){return{'model':db[_0x5bbbbe[_0x0bfb('0x20')]],'as':_0x5bbbbe['as'],'attributes':_0x5bbbbe['attributes']};}):[]};}):[]};}):[]:[]})[_0x0bfb('0xf')](function(_0x1d4661){logger[_0x0bfb('0x10')](_0x0bfb('0x18'),_0x8119b5);logger[_0x0bfb('0x22')]('GetFaxAccount',_0x8119b5,JSON['stringify'](_0x1d4661));_0x43ff9a(_0x1d4661);})['catch'](function(_0x472ee5){logger[_0x0bfb('0x15')](_0x0bfb('0x18'),_0x472ee5['message'],_0x8119b5);_0x579539(_0x4e9698[_0x0bfb('0x15')](0x1f4,_0x472ee5[_0x0bfb('0x17')]));});});};exports[_0x0bfb('0x23')]=function(_0x42cee1,_0x45f64f,_0x956b68){var _0x4586f3=this;return new Promise(function(_0x325941,_0x4c24df){var _0x4f9a93={'body':_0x42cee1[_0x0bfb('0x24')],'channel':_0x0bfb('0x25')};var _0x2cd3d8=[];var _0x179867=[];var _0x54f3b8={};return db['CmContact'][_0x0bfb('0x26')]()['then'](function(_0x3d7b1f){if(!_0x3d7b1f){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2cd3d8=_[_0x0bfb('0x27')](_[_0x0bfb('0x28')](_0x3d7b1f),[_0x0bfb('0x29'),'updatedAt']);_0x179867=_[_0x0bfb('0x27')](_[_0x0bfb('0x28')](_0x3d7b1f),[_0x0bfb('0x29'),_0x0bfb('0x2a'),'CompanyId',_0x0bfb('0x2b')]);if(_0x42cee1[_0x0bfb('0x24')]['id']){delete _0x42cee1['body']['id'];}if(_[_0x0bfb('0x2c')](_0x42cee1[_0x0bfb('0x24')]['from'])){throw new db[(_0x0bfb('0x2d'))][(_0x0bfb('0x2e'))]('from\x20is\x20mandatory');}if(_[_0x0bfb('0x2c')](_0x42cee1['body'][_0x0bfb('0x24')])||_0x42cee1[_0x0bfb('0x24')]['body']===''){throw new db[(_0x0bfb('0x2d'))][(_0x0bfb('0x2e'))](_0x0bfb('0x2f'));}if(_[_0x0bfb('0x2c')](_0x42cee1[_0x0bfb('0x24')][_0x0bfb('0x30')])){throw new db[(_0x0bfb('0x2d'))][(_0x0bfb('0x2e'))](_0x0bfb('0x31')+_0x179867);}if(!_[_0x0bfb('0x32')](_0x179867,_0x42cee1['body'][_0x0bfb('0x30')])){throw new db[(_0x0bfb('0x2d'))][(_0x0bfb('0x2e'))](_0x0bfb('0x33')+_0x179867);}_0x54f3b8[_0x42cee1[_0x0bfb('0x24')][_0x0bfb('0x30')]]=_0x42cee1[_0x0bfb('0x24')][_0x0bfb('0x34')];})[_0x0bfb('0xf')](function(){return db[_0x0bfb('0x19')]['find']({'where':{'id':_0x42cee1[_0x0bfb('0x35')]['id']},'include':[{'model':db[_0x0bfb('0x36')],'as':_0x0bfb('0x37'),'include':[{'model':db[_0x0bfb('0x38')],'as':'Contacts','where':_0x54f3b8,'limit':0x1,'order':[[_0x0bfb('0x2a'),_0x0bfb('0x39')]]}]},{'model':db[_0x0bfb('0x3a')],'as':_0x0bfb('0x3b')}]});})[_0x0bfb('0xf')](function(_0x9a03ad){if(_0x9a03ad&&_0x9a03ad[_0x0bfb('0x37')]){var _0x2f7370=_0x9a03ad[_0x0bfb('0x3c')]({'plain':!![]});_0x4f9a93[_0x0bfb('0x35')]=_0x2f7370;_0x4f9a93[_0x0bfb('0x3d')]=_0x2f7370[_0x0bfb('0x3b')];_0x4f9a93['list']=_0x2f7370['List'];_0x4f9a93['applications']=_['orderBy'](_0x4f9a93['applications'],[_0x0bfb('0x3e')],[_0x0bfb('0x3f')]);if(_0x4f9a93[_0x0bfb('0x35')][_0x0bfb('0x3b')]){delete _0x4f9a93[_0x0bfb('0x35')][_0x0bfb('0x3b')];}if(_0x4f9a93[_0x0bfb('0x35')][_0x0bfb('0x37')]&&_0x4f9a93[_0x0bfb('0x35')]['List'][_0x0bfb('0x40')][_0x0bfb('0x41')]){return _0x4f9a93[_0x0bfb('0x35')][_0x0bfb('0x37')][_0x0bfb('0x40')][0x0];}var _0xc65c0e=_[_0x0bfb('0xd')](_0x42cee1[_0x0bfb('0x24')],{'firstName':_0x42cee1[_0x0bfb('0x24')]['from'],'ListId':_0x2f7370[_0x0bfb('0x2b')]});_0xc65c0e[_0x42cee1[_0x0bfb('0x24')][_0x0bfb('0x30')]]=_0x42cee1['body'][_0x0bfb('0x34')];return db[_0x0bfb('0x38')][_0x0bfb('0x42')](_0xc65c0e,{'fields':_0x2cd3d8,'raw':!![]});}})['then'](function(_0x2b5b75){_0x4f9a93[_0x0bfb('0x43')]=_0x2b5b75;if(_0x2b5b75){var _0x2f0a1c={'ContactId':_0x2b5b75['id'],'FaxAccountId':_0x42cee1[_0x0bfb('0x35')]['id'],'fax':_0x2b5b75[_0x0bfb('0x25')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x2b5b75['id'],'closed':![],'FaxAccountId':_0x42cee1[_0x0bfb('0x35')]['id']}})[_0x0bfb('0xf')](function(_0x40ddc1){if(_0x40ddc1){return[_0x40ddc1,![]];}return db[_0x0bfb('0x44')][_0x0bfb('0x42')](_0x2f0a1c)['then'](function(_0x544c49){return[_0x544c49,!![]];});});}else{throw new Error(_0x0bfb('0x45'));}})[_0x0bfb('0x46')](function(_0x46b144,_0xf912ac){var _0x5163d5=_0x46b144[_0x0bfb('0x3c')]({'plain':!![]});if(_0xf912ac){if(_0x4f9a93[_0x0bfb('0x35')][_0x0bfb('0x47')]){_0x4f9a93['applications'][_0x0bfb('0x48')]({'id':0x0,'priority':_0x4f9a93['applications']['length']+0x1,'app':_0x0bfb('0x49'),'appdata':_0x0bfb('0x4a'),'interval':_0x0bfb('0x4b')});}_0x5163d5[_0x0bfb('0x4c')]=!![];}else{_0x5163d5['created']=![];}_0x4f9a93[_0x0bfb('0x4d')]=_0x5163d5;return db[_0x0bfb('0x4e')]['create']({'body':_0x42cee1[_0x0bfb('0x24')][_0x0bfb('0x24')],'FaxAccountId':_0x42cee1[_0x0bfb('0x35')]['id'],'FaxInteractionId':_0x46b144['id'],'direction':'in','ContactId':_0x46b144[_0x0bfb('0x4f')],'AttachmentId':_0x42cee1['body']['AttachmentId']});})['then'](function(_0x2c3f3e){_0x4f9a93[_0x0bfb('0x17')]=_0x2c3f3e;if(_0x4f9a93[_0x0bfb('0x4d')][_0x0bfb('0x50')]){return db[_0x0bfb('0x51')][_0x0bfb('0x52')]({'attributes':['id','name'],'where':{'id':_0x4f9a93['interaction']['UserId']}})[_0x0bfb('0xf')](function(_0x5bf80b){if(_0x5bf80b){_0x4f9a93['applications'][_0x0bfb('0x53')]({'id':0x0,'priority':0x0,'app':_0x0bfb('0x54'),'appdata':_0x5bf80b[_0x0bfb('0x55')]+','+(_0x4f9a93[_0x0bfb('0x35')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0bfb('0x56'),_0x0bfb('0x57'),_0x4f9a93);});}return respondWithRpcPromise(_0x0bfb('0x56'),_0x0bfb('0x57'),_0x4f9a93);})['then'](function(_0x3af055){_0x325941(_0x3af055);})['catch'](function(_0x25dc55){_0x4c24df(_0x4586f3[_0x0bfb('0x15')](0x1f4,_0x25dc55[_0x0bfb('0x17')]));});});}; \ No newline at end of file +var _0xc228=['createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','CmContact','Contacts','DESC','Applications','get','applications','list','orderBy','priority','length','create','fax','FaxInteraction','Contact\x20not\x20found','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','User','unshift','name','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','include','model','map','then','debug','stringify','NotifyFaxAccount','body','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','difference'];(function(_0x2052ae,_0x2fd87e){var _0x238ce8=function(_0x28754e){while(--_0x28754e){_0x2052ae['push'](_0x2052ae['shift']());}};_0x238ce8(++_0x2fd87e);}(_0xc228,0x133));var _0x8c22=function(_0x1433bc,_0x198516){_0x1433bc=_0x1433bc-0x0;var _0x520740=_0xc228[_0x1433bc];return _0x520740;};'use strict';var _=require('lodash');var util=require(_0x8c22('0x0'));var moment=require(_0x8c22('0x1'));var BPromise=require(_0x8c22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c22('0x3'));var db=require(_0x8c22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c22('0x5'))(_0x8c22('0x6'));var config=require(_0x8c22('0x7'));var jayson=require(_0x8c22('0x8'));var client=jayson['client'][_0x8c22('0x9')]({'port':0x232c});config[_0x8c22('0xa')]=_['defaults'](config['redis'],{'host':_0x8c22('0xb'),'port':0x18eb});var socket=require(_0x8c22('0xc'))(new Redis(config[_0x8c22('0xa')]));require(_0x8c22('0xd'))[_0x8c22('0xe')](socket);function respondWithRpcPromise(_0x1b08b5,_0x134697,_0x23b910){return new BPromise(function(_0x53d8d6,_0x1b7a9b){return client[_0x8c22('0xf')](_0x1b08b5,_0x23b910)['then'](function(_0x274693){logger['info'](_0x8c22('0x10'),_0x134697,_0x8c22('0x11'));logger['debug'](_0x8c22('0x12'),_0x134697,_0x8c22('0x11'),JSON['stringify'](_0x274693));if(_0x274693['error']){if(_0x274693[_0x8c22('0x13')][_0x8c22('0x14')]===0x1f4){logger[_0x8c22('0x13')]('FaxAccount,\x20%s,\x20%s',_0x134697,_0x274693[_0x8c22('0x13')][_0x8c22('0x15')]);return _0x1b7a9b(_0x274693['error'][_0x8c22('0x15')]);}logger[_0x8c22('0x13')](_0x8c22('0x10'),_0x134697,_0x274693[_0x8c22('0x13')][_0x8c22('0x15')]);return _0x53d8d6(_0x274693[_0x8c22('0x13')][_0x8c22('0x15')]);}else{logger[_0x8c22('0x16')](_0x8c22('0x10'),_0x134697,_0x8c22('0x11'));_0x53d8d6(_0x274693[_0x8c22('0x17')][_0x8c22('0x15')]);}})[_0x8c22('0x18')](function(_0x5d86d3){logger[_0x8c22('0x13')](_0x8c22('0x10'),_0x134697,_0x5d86d3);_0x1b7a9b(_0x5d86d3);});});}exports[_0x8c22('0x19')]=function(_0x48dfa3){var _0x4cad0d=this;return new Promise(function(_0x545fb3,_0x3ad987){return db['FaxAccount'][_0x8c22('0x1a')]({'raw':_0x48dfa3[_0x8c22('0x1b')]?_0x48dfa3[_0x8c22('0x1b')][_0x8c22('0x1c')]===undefined?!![]:![]:!![],'where':_0x48dfa3['options']?_0x48dfa3[_0x8c22('0x1b')][_0x8c22('0x1d')]||null:null,'attributes':_0x48dfa3[_0x8c22('0x1b')]?_0x48dfa3[_0x8c22('0x1b')][_0x8c22('0x1e')]||null:null,'limit':_0x48dfa3['options']?_0x48dfa3[_0x8c22('0x1b')]['limit']||null:null,'include':_0x48dfa3[_0x8c22('0x1b')]?_0x48dfa3[_0x8c22('0x1b')]['include']?_['map'](_0x48dfa3[_0x8c22('0x1b')][_0x8c22('0x1f')],function(_0xc8fac7){return{'model':db[_0xc8fac7[_0x8c22('0x20')]],'as':_0xc8fac7['as'],'attributes':_0xc8fac7[_0x8c22('0x1e')],'include':_0xc8fac7[_0x8c22('0x1f')]?_[_0x8c22('0x21')](_0xc8fac7[_0x8c22('0x1f')],function(_0x2f2dfd){return{'model':db[_0x2f2dfd[_0x8c22('0x20')]],'as':_0x2f2dfd['as'],'attributes':_0x2f2dfd[_0x8c22('0x1e')],'include':_0x2f2dfd[_0x8c22('0x1f')]?_[_0x8c22('0x21')](_0x2f2dfd[_0x8c22('0x1f')],function(_0x44081b){return{'model':db[_0x44081b[_0x8c22('0x20')]],'as':_0x44081b['as'],'attributes':_0x44081b[_0x8c22('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8c22('0x22')](function(_0x58103e){logger[_0x8c22('0x16')]('GetFaxAccount',_0x48dfa3);logger[_0x8c22('0x23')]('GetFaxAccount',_0x48dfa3,JSON[_0x8c22('0x24')](_0x58103e));_0x545fb3(_0x58103e);})[_0x8c22('0x18')](function(_0x40d8ce){logger[_0x8c22('0x13')]('GetFaxAccount',_0x40d8ce['message'],_0x48dfa3);_0x3ad987(_0x4cad0d[_0x8c22('0x13')](0x1f4,_0x40d8ce[_0x8c22('0x15')]));});});};exports[_0x8c22('0x25')]=function(_0x4e6d17,_0x310585,_0x16b5f7){var _0x22fda9=this;return new Promise(function(_0x59455a,_0x8d6bfd){var _0x56485a={'body':_0x4e6d17[_0x8c22('0x26')],'channel':'fax'};var _0x125cf3=[];var _0x5b091a=[];var _0x28705c={};return db['CmContact'][_0x8c22('0x27')]()[_0x8c22('0x22')](function(_0x249d5e){if(!_0x249d5e){throw new db[(_0x8c22('0x28'))][(_0x8c22('0x29'))](_0x8c22('0x2a'));}_0x125cf3=_['difference'](_[_0x8c22('0x2b')](_0x249d5e),['createdAt','updatedAt']);_0x5b091a=_[_0x8c22('0x2c')](_[_0x8c22('0x2b')](_0x249d5e),[_0x8c22('0x2d'),'updatedAt','CompanyId',_0x8c22('0x2e')]);if(_0x4e6d17[_0x8c22('0x26')]['id']){delete _0x4e6d17[_0x8c22('0x26')]['id'];}if(_[_0x8c22('0x2f')](_0x4e6d17['body'][_0x8c22('0x30')])){throw new db[(_0x8c22('0x28'))]['ValidationError'](_0x8c22('0x31'));}if(_[_0x8c22('0x2f')](_0x4e6d17[_0x8c22('0x26')][_0x8c22('0x26')])||_0x4e6d17[_0x8c22('0x26')]['body']===''){throw new db[(_0x8c22('0x28'))][(_0x8c22('0x29'))](_0x8c22('0x32'));}if(_[_0x8c22('0x2f')](_0x4e6d17[_0x8c22('0x26')]['mapKey'])){throw new db['Sequelize'][(_0x8c22('0x29'))](_0x8c22('0x33')+_0x5b091a);}if(!_[_0x8c22('0x34')](_0x5b091a,_0x4e6d17[_0x8c22('0x26')][_0x8c22('0x35')])){throw new db[(_0x8c22('0x28'))][(_0x8c22('0x29'))](_0x8c22('0x36')+_0x5b091a);}_0x28705c[_0x4e6d17[_0x8c22('0x26')][_0x8c22('0x35')]]=_0x4e6d17['body'][_0x8c22('0x30')];})[_0x8c22('0x22')](function(){return db[_0x8c22('0x37')][_0x8c22('0x38')]({'where':{'id':_0x4e6d17[_0x8c22('0x39')]['id']},'include':[{'model':db[_0x8c22('0x3a')],'as':_0x8c22('0x3b'),'include':[{'model':db[_0x8c22('0x3c')],'as':_0x8c22('0x3d'),'where':_0x28705c,'limit':0x1,'order':[['updatedAt',_0x8c22('0x3e')]]}]},{'model':db['FaxApplication'],'as':_0x8c22('0x3f')}]});})['then'](function(_0x522c02){if(_0x522c02&&_0x522c02[_0x8c22('0x3b')]){var _0x2ab3ad=_0x522c02[_0x8c22('0x40')]({'plain':!![]});_0x56485a[_0x8c22('0x39')]=_0x2ab3ad;_0x56485a[_0x8c22('0x41')]=_0x2ab3ad['Applications'];_0x56485a[_0x8c22('0x42')]=_0x2ab3ad[_0x8c22('0x3b')];_0x56485a[_0x8c22('0x41')]=_[_0x8c22('0x43')](_0x56485a['applications'],[_0x8c22('0x44')],['asc']);if(_0x56485a['account'][_0x8c22('0x3f')]){delete _0x56485a['account'][_0x8c22('0x3f')];}if(_0x56485a[_0x8c22('0x39')][_0x8c22('0x3b')]&&_0x56485a[_0x8c22('0x39')]['List']['Contacts'][_0x8c22('0x45')]){return _0x56485a['account']['List'][_0x8c22('0x3d')][0x0];}var _0x26d3c9=_['defaults'](_0x4e6d17[_0x8c22('0x26')],{'firstName':_0x4e6d17['body']['from'],'ListId':_0x2ab3ad[_0x8c22('0x2e')]});_0x26d3c9[_0x4e6d17['body']['mapKey']]=_0x4e6d17[_0x8c22('0x26')][_0x8c22('0x30')];return db[_0x8c22('0x3c')][_0x8c22('0x46')](_0x26d3c9,{'fields':_0x125cf3,'raw':!![]});}})[_0x8c22('0x22')](function(_0x4da435){_0x56485a['contact']=_0x4da435;if(_0x4da435){var _0x46a401={'ContactId':_0x4da435['id'],'FaxAccountId':_0x4e6d17[_0x8c22('0x39')]['id'],'fax':_0x4da435[_0x8c22('0x47')]};return db[_0x8c22('0x48')][_0x8c22('0x38')]({'where':{'ContactId':_0x4da435['id'],'closed':![],'FaxAccountId':_0x4e6d17[_0x8c22('0x39')]['id']}})['then'](function(_0x57f3fb){if(_0x57f3fb){return[_0x57f3fb,![]];}return db['FaxInteraction'][_0x8c22('0x46')](_0x46a401)[_0x8c22('0x22')](function(_0x38fb53){return[_0x38fb53,!![]];});});}else{throw new Error(_0x8c22('0x49'));}})['spread'](function(_0x5b3cfd,_0x1d4a49){var _0x3ac6b0=_0x5b3cfd[_0x8c22('0x40')]({'plain':!![]});if(_0x1d4a49){if(_0x56485a[_0x8c22('0x39')]['autoclose']){_0x56485a['applications'][_0x8c22('0x4a')]({'id':0x0,'priority':_0x56485a[_0x8c22('0x41')][_0x8c22('0x45')]+0x1,'app':_0x8c22('0x4b'),'appdata':_0x8c22('0x4c'),'interval':_0x8c22('0x4d')});}_0x3ac6b0[_0x8c22('0x4e')]=!![];}else{_0x3ac6b0[_0x8c22('0x4e')]=![];}_0x56485a['interaction']=_0x3ac6b0;return db[_0x8c22('0x4f')][_0x8c22('0x46')]({'body':_0x4e6d17['body']['body'],'FaxAccountId':_0x4e6d17[_0x8c22('0x39')]['id'],'FaxInteractionId':_0x5b3cfd['id'],'direction':'in','ContactId':_0x5b3cfd['ContactId'],'AttachmentId':_0x4e6d17[_0x8c22('0x26')][_0x8c22('0x50')]});})[_0x8c22('0x22')](function(_0x5845a6){_0x56485a['message']=_0x5845a6;if(_0x56485a[_0x8c22('0x51')][_0x8c22('0x52')]){return db[_0x8c22('0x53')][_0x8c22('0x38')]({'attributes':['id','name'],'where':{'id':_0x56485a[_0x8c22('0x51')][_0x8c22('0x52')]}})['then'](function(_0x999e5d){if(_0x999e5d){_0x56485a['applications'][_0x8c22('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x999e5d[_0x8c22('0x55')]+','+(_0x56485a[_0x8c22('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x8c22('0x4d')});}return respondWithRpcPromise(_0x8c22('0x56'),_0x8c22('0x57'),_0x56485a);});}return respondWithRpcPromise(_0x8c22('0x56'),_0x8c22('0x57'),_0x56485a);})[_0x8c22('0x22')](function(_0x3f3a83){_0x59455a(_0x3f3a83);})[_0x8c22('0x18')](function(_0x40cbdc){_0x8d6bfd(_0x22fda9[_0x8c22('0x13')](0x1f4,_0x40cbdc['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c724b5b..c6e10f4 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 _0x462d=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update','emit'];(function(_0x3e7e4f,_0x5d53e4){var _0x4c2a04=function(_0x181538){while(--_0x181538){_0x3e7e4f['push'](_0x3e7e4f['shift']());}};_0x4c2a04(++_0x5d53e4);}(_0x462d,0x9d));var _0xd462=function(_0x52d228,_0x1e8d4e){_0x52d228=_0x52d228-0x0;var _0x2b1efe=_0x462d[_0x52d228];return _0x2b1efe;};'use strict';var FaxAccountEvents=require(_0xd462('0x0'));var events=[_0xd462('0x1'),_0xd462('0x2'),_0xd462('0x3')];function createListener(_0x246218,_0x4be324){return function(_0x1c6f7e){_0x4be324[_0xd462('0x4')](_0x246218,_0x1c6f7e);};}function removeListener(_0x2a4a6e,_0x18177b){return function(){FaxAccountEvents[_0xd462('0x5')](_0x2a4a6e,_0x18177b);};}exports[_0xd462('0x6')]=function(_0x1559d5){for(var _0x14b2c8=0x0,_0x558fb8=events[_0xd462('0x7')];_0x14b2c8<_0x558fb8;_0x14b2c8++){var _0x1e7896=events[_0x14b2c8];var _0x4506a3=createListener(_0xd462('0x8')+_0x1e7896,_0x1559d5);FaxAccountEvents['on'](_0x1e7896,_0x4506a3);}}; \ No newline at end of file +var _0xa746=['faxAccount:','./faxAccount.events','save','remove','update','removeListener','register','length'];(function(_0x171dec,_0xb0c744){var _0x202cc7=function(_0x41d293){while(--_0x41d293){_0x171dec['push'](_0x171dec['shift']());}};_0x202cc7(++_0xb0c744);}(_0xa746,0x1e1));var _0x6a74=function(_0xeb8567,_0x2e17cb){_0xeb8567=_0xeb8567-0x0;var _0x2c61fa=_0xa746[_0xeb8567];return _0x2c61fa;};'use strict';var FaxAccountEvents=require(_0x6a74('0x0'));var events=[_0x6a74('0x1'),_0x6a74('0x2'),_0x6a74('0x3')];function createListener(_0x440e26,_0x41c67d){return function(_0x11f8ed){_0x41c67d['emit'](_0x440e26,_0x11f8ed);};}function removeListener(_0x280266,_0x36e32b){return function(){FaxAccountEvents[_0x6a74('0x4')](_0x280266,_0x36e32b);};}exports[_0x6a74('0x5')]=function(_0x38d712){for(var _0x5b6e9e=0x0,_0x1a927b=events[_0x6a74('0x6')];_0x5b6e9e<_0x1a927b;_0x5b6e9e++){var _0x3299c5=events[_0x5b6e9e];var _0x3e8c09=createListener(_0x6a74('0x7')+_0x3299c5,_0x38d712);FaxAccountEvents['on'](_0x3299c5,_0x3e8c09);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 797c0be..16b0b64 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(_0x4fa15f,_0x21f6aa){var _0x1560c7=function(_0x4a1de8){while(--_0x4a1de8){_0x4fa15f['push'](_0x4fa15f['shift']());}};_0x1560c7(++_0x21f6aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x45e36d,_0x496607){var _0x39a56f=function(_0xf5e37){while(--_0xf5e37){_0x45e36d['push'](_0x45e36d['shift']());}};_0x39a56f(++_0x496607);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7e1a943..cce8797 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 _0xe453=['exports','STRING','noop','TEXT','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe453,0x1bc));var _0x3e45=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe453[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x3e45('0x0'));module[_0x3e45('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3e45('0x2')],'allowNull':![],'defaultValue':_0x3e45('0x3')},'appdata':{'type':Sequelize[_0x3e45('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x032d=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5b6129,_0x41cdb7){var _0x5285c2=function(_0x5639ad){while(--_0x5639ad){_0x5b6129['push'](_0x5b6129['shift']());}};_0x5285c2(++_0x41cdb7);}(_0x032d,0x145));var _0xd032=function(_0x55f8ef,_0x2d77cf){_0x55f8ef=_0x55f8ef-0x0;var _0x2b9d56=_0x032d[_0x55f8ef];return _0x2b9d56;};'use strict';var Sequelize=require(_0xd032('0x0'));module[_0xd032('0x1')]={'priority':{'type':Sequelize[_0xd032('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd032('0x3')],'allowNull':![],'defaultValue':_0xd032('0x4')},'appdata':{'type':Sequelize[_0xd032('0x5')]()},'description':{'type':Sequelize[_0xd032('0x3')]},'interval':{'type':Sequelize[_0xd032('0x3')],'defaultValue':_0xd032('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8193cd9..3b2b127 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 _0x11d3=['merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x448313,_0x2b5e0f){var _0x3740be=function(_0x130a0d){while(--_0x130a0d){_0x448313['push'](_0x448313['shift']());}};_0x3740be(++_0x2b5e0f);}(_0x11d3,0x9c));var _0x311d=function(_0x736eb,_0x345088){_0x736eb=_0x736eb-0x0;var _0x30ea13=_0x11d3[_0x736eb];return _0x30ea13;};'use strict';var emlformat=require(_0x311d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x311d('0x1'));var rp=require(_0x311d('0x2'));var moment=require(_0x311d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x311d('0x4'));var util=require(_0x311d('0x5'));var path=require(_0x311d('0x6'));var sox=require(_0x311d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x311d('0x8'));var jsforce=require(_0x311d('0x9'));var deskjs=require(_0x311d('0xa'));var toCsv=require(_0x311d('0xb'));var querystring=require('querystring');var Papa=require(_0x311d('0xc'));var Redis=require(_0x311d('0xd'));var authService=require(_0x311d('0xe'));var qs=require(_0x311d('0xf'));var as=require(_0x311d('0x10'));var hardwareService=require(_0x311d('0x11'));var logger=require(_0x311d('0x12'))(_0x311d('0x13'));var utils=require(_0x311d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xab46d5,_0x2c7ecf){_0x2c7ecf=_0x2c7ecf||0xcc;return function(_0x820af8){if(_0x820af8){return _0xab46d5[_0x311d('0x15')](_0x2c7ecf);}return _0xab46d5[_0x311d('0x16')](_0x2c7ecf)[_0x311d('0x17')]();};}function respondWithResult(_0xa16f1a,_0xe528d3){_0xe528d3=_0xe528d3||0xc8;return function(_0x209bd3){if(_0x209bd3){return _0xa16f1a['status'](_0xe528d3)[_0x311d('0x18')](_0x209bd3);}};}function respondWithFilteredResult(_0x2727fe,_0x221681){return function(_0x581393){if(_0x581393){var _0x28ac09=typeof _0x221681['offset']===_0x311d('0x19')&&typeof _0x221681['limit']===_0x311d('0x19');var _0x318474=_0x581393[_0x311d('0x1a')];var _0x135ae8=_0x28ac09?0x0:_0x221681[_0x311d('0x1b')];var _0xac51bc=_0x28ac09?_0x581393[_0x311d('0x1a')]:_0x221681[_0x311d('0x1b')]+_0x221681[_0x311d('0x1c')];var _0x323c9d;if(_0xac51bc>=_0x318474){_0xac51bc=_0x318474;_0x323c9d=0xc8;}else{_0x323c9d=0xce;}_0x2727fe[_0x311d('0x16')](_0x323c9d);return _0x2727fe['set']('Content-Range',_0x135ae8+'-'+_0xac51bc+'/'+_0x318474)['json'](_0x581393);}return null;};}function patchUpdates(_0x64cfda){return function(_0x5029e7){try{jsonpatch[_0x311d('0x1d')](_0x5029e7,_0x64cfda,!![]);}catch(_0x27f5c1){return BPromise[_0x311d('0x1e')](_0x27f5c1);}return _0x5029e7[_0x311d('0x1f')]();};}function saveUpdates(_0x3d7e8d,_0xadaf55){return function(_0x15c10b){if(_0x15c10b){return _0x15c10b[_0x311d('0x20')](_0x3d7e8d)[_0x311d('0x21')](function(_0x47e6a4){return _0x47e6a4;});}return null;};}function removeEntity(_0x13af8d,_0x29744d){return function(_0x9505ae){if(_0x9505ae){return _0x9505ae[_0x311d('0x22')]()[_0x311d('0x21')](function(){_0x13af8d[_0x311d('0x16')](0xcc)[_0x311d('0x17')]();});}};}function handleEntityNotFound(_0x1d6e3f,_0x235c8e){return function(_0x43a841){if(!_0x43a841){_0x1d6e3f['sendStatus'](0x194);}return _0x43a841;};}function handleError(_0x108919,_0x2b07c2){_0x2b07c2=_0x2b07c2||0x1f4;return function(_0x2daf9e){logger[_0x311d('0x23')](_0x2daf9e[_0x311d('0x24')]);if(_0x2daf9e['name']){delete _0x2daf9e[_0x311d('0x25')];}_0x108919[_0x311d('0x16')](_0x2b07c2)[_0x311d('0x26')](_0x2daf9e);};}exports['index']=function(_0x156ba6,_0x52822d){var _0x41115a={},_0x13d082={},_0x2cfa30={'count':0x0,'rows':[]};var _0x58b384=_[_0x311d('0x27')](db[_0x311d('0x28')][_0x311d('0x29')],function(_0x2c1d7c){return{'name':_0x2c1d7c[_0x311d('0x2a')],'type':_0x2c1d7c[_0x311d('0x2b')][_0x311d('0x2c')]};});_0x13d082[_0x311d('0x2d')]=_[_0x311d('0x27')](_0x58b384,'name');_0x13d082['query']=_[_0x311d('0x2e')](_0x156ba6[_0x311d('0x2f')]);_0x13d082[_0x311d('0x30')]=_[_0x311d('0x31')](_0x13d082['model'],_0x13d082[_0x311d('0x2f')]);_0x41115a[_0x311d('0x32')]=_['intersection'](_0x13d082[_0x311d('0x2d')],qs['fields'](_0x156ba6['query'][_0x311d('0x33')]));_0x41115a[_0x311d('0x32')]=_0x41115a['attributes'][_0x311d('0x34')]?_0x41115a['attributes']:_0x13d082[_0x311d('0x2d')];if(!_0x156ba6[_0x311d('0x2f')][_0x311d('0x35')](_0x311d('0x36'))){_0x41115a[_0x311d('0x1c')]=qs[_0x311d('0x1c')](_0x156ba6[_0x311d('0x2f')][_0x311d('0x1c')]);_0x41115a[_0x311d('0x1b')]=qs[_0x311d('0x1b')](_0x156ba6[_0x311d('0x2f')][_0x311d('0x1b')]);}_0x41115a[_0x311d('0x37')]=qs[_0x311d('0x38')](_0x156ba6[_0x311d('0x2f')][_0x311d('0x38')]);_0x41115a[_0x311d('0x39')]=qs[_0x311d('0x30')](_[_0x311d('0x3a')](_0x156ba6[_0x311d('0x2f')],_0x13d082[_0x311d('0x30')]),_0x58b384);if(_0x156ba6[_0x311d('0x2f')][_0x311d('0x3b')]){_0x41115a['where']=_[_0x311d('0x3c')](_0x41115a['where'],{'$or':_[_0x311d('0x27')](_0x58b384,function(_0x30013b){if(_0x30013b[_0x311d('0x2b')]!==_0x311d('0x3d')){var _0x2ad07e={};_0x2ad07e[_0x30013b[_0x311d('0x25')]]={'$like':'%'+_0x156ba6['query'][_0x311d('0x3b')]+'%'};return _0x2ad07e;}})});}_0x41115a=_[_0x311d('0x3c')]({},_0x41115a,_0x156ba6[_0x311d('0x3e')]);var _0x370504={'where':_0x41115a['where']};return db['FaxApplication'][_0x311d('0x1a')](_0x370504)[_0x311d('0x21')](function(_0x20bffe){_0x2cfa30['count']=_0x20bffe;if(_0x156ba6['query'][_0x311d('0x3f')]){_0x41115a[_0x311d('0x40')]=[{'all':!![]}];}return db[_0x311d('0x28')][_0x311d('0x41')](_0x41115a);})[_0x311d('0x21')](function(_0x46753e){_0x2cfa30['rows']=_0x46753e;return _0x2cfa30;})['then'](respondWithFilteredResult(_0x52822d,_0x41115a))['catch'](handleError(_0x52822d,null));};exports[_0x311d('0x42')]=function(_0x50ca66,_0x2d363a){var _0x54a956={'raw':!![],'where':{'id':_0x50ca66[_0x311d('0x43')]['id']}},_0x421e29={};_0x421e29[_0x311d('0x2d')]=_[_0x311d('0x2e')](db[_0x311d('0x28')][_0x311d('0x29')]);_0x421e29['query']=_['keys'](_0x50ca66[_0x311d('0x2f')]);_0x421e29['filters']=_['intersection'](_0x421e29['model'],_0x421e29[_0x311d('0x2f')]);_0x54a956[_0x311d('0x32')]=_[_0x311d('0x31')](_0x421e29[_0x311d('0x2d')],qs['fields'](_0x50ca66[_0x311d('0x2f')][_0x311d('0x33')]));_0x54a956[_0x311d('0x32')]=_0x54a956[_0x311d('0x32')][_0x311d('0x34')]?_0x54a956[_0x311d('0x32')]:_0x421e29['model'];if(_0x50ca66['query'][_0x311d('0x3f')]){_0x54a956[_0x311d('0x40')]=[{'all':!![]}];}_0x54a956=_[_0x311d('0x3c')]({},_0x54a956,_0x50ca66['options']);return db[_0x311d('0x28')]['find'](_0x54a956)[_0x311d('0x21')](handleEntityNotFound(_0x2d363a,null))[_0x311d('0x21')](respondWithResult(_0x2d363a,null))[_0x311d('0x44')](handleError(_0x2d363a,null));};exports['create']=function(_0x93d122,_0x34223f){return db['FaxApplication'][_0x311d('0x45')](_0x93d122[_0x311d('0x46')],{})[_0x311d('0x21')](respondWithResult(_0x34223f,0xc9))[_0x311d('0x44')](handleError(_0x34223f,null));};exports[_0x311d('0x20')]=function(_0x567f2b,_0x19beca){if(_0x567f2b['body']['id']){delete _0x567f2b['body']['id'];}return db[_0x311d('0x28')][_0x311d('0x47')]({'where':{'id':_0x567f2b['params']['id']}})[_0x311d('0x21')](handleEntityNotFound(_0x19beca,null))[_0x311d('0x21')](saveUpdates(_0x567f2b[_0x311d('0x46')],null))[_0x311d('0x21')](respondWithResult(_0x19beca,null))[_0x311d('0x44')](handleError(_0x19beca,null));};exports['destroy']=function(_0x9daf84,_0x4a35b6){return db['FaxApplication']['find']({'where':{'id':_0x9daf84[_0x311d('0x43')]['id']}})[_0x311d('0x21')](handleEntityNotFound(_0x4a35b6,null))[_0x311d('0x21')](removeEntity(_0x4a35b6,null))[_0x311d('0x44')](handleError(_0x4a35b6,null));}; \ No newline at end of file +var _0x1011=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','sendStatus','error','stack','name','send','FaxApplication','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5bcbeb,_0x4e2fe9){var _0x404f90=function(_0x54a450){while(--_0x54a450){_0x5bcbeb['push'](_0x5bcbeb['shift']());}};_0x404f90(++_0x4e2fe9);}(_0x1011,0x87));var _0x1101=function(_0xa8f24a,_0x48d7d3){_0xa8f24a=_0xa8f24a-0x0;var _0x3a1471=_0x1011[_0xa8f24a];return _0x3a1471;};'use strict';var emlformat=require(_0x1101('0x0'));var rimraf=require(_0x1101('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1101('0x2'));var moment=require(_0x1101('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1101('0x4'));var util=require(_0x1101('0x5'));var path=require(_0x1101('0x6'));var sox=require(_0x1101('0x7'));var csv=require(_0x1101('0x8'));var ejs=require(_0x1101('0x9'));var fs=require('fs');var fs_extra=require(_0x1101('0xa'));var _=require(_0x1101('0xb'));var squel=require(_0x1101('0xc'));var crypto=require(_0x1101('0xd'));var jsforce=require(_0x1101('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1101('0x8'));var querystring=require(_0x1101('0xf'));var Papa=require(_0x1101('0x10'));var Redis=require(_0x1101('0x11'));var authService=require(_0x1101('0x12'));var qs=require(_0x1101('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1101('0x14'));var logger=require(_0x1101('0x15'))('api');var utils=require(_0x1101('0x16'));var config=require(_0x1101('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b64d,_0x1ef4ca){_0x1ef4ca=_0x1ef4ca||0xcc;return function(_0x4c5ee0){if(_0x4c5ee0){return _0x30b64d['sendStatus'](_0x1ef4ca);}return _0x30b64d[_0x1101('0x18')](_0x1ef4ca)[_0x1101('0x19')]();};}function respondWithResult(_0xa38e65,_0x4f3a11){_0x4f3a11=_0x4f3a11||0xc8;return function(_0x16ac6a){if(_0x16ac6a){return _0xa38e65[_0x1101('0x18')](_0x4f3a11)[_0x1101('0x1a')](_0x16ac6a);}};}function respondWithFilteredResult(_0x3925d7,_0x12ebfe){return function(_0x4836b5){if(_0x4836b5){var _0x25586a=typeof _0x12ebfe[_0x1101('0x1b')]===_0x1101('0x1c')&&typeof _0x12ebfe[_0x1101('0x1d')]===_0x1101('0x1c');var _0x301f31=_0x4836b5[_0x1101('0x1e')];var _0x3c4351=_0x25586a?0x0:_0x12ebfe[_0x1101('0x1b')];var _0xb4dfa9=_0x25586a?_0x4836b5[_0x1101('0x1e')]:_0x12ebfe[_0x1101('0x1b')]+_0x12ebfe[_0x1101('0x1d')];var _0x3628c7;if(_0xb4dfa9>=_0x301f31){_0xb4dfa9=_0x301f31;_0x3628c7=0xc8;}else{_0x3628c7=0xce;}_0x3925d7['status'](_0x3628c7);return _0x3925d7['set']('Content-Range',_0x3c4351+'-'+_0xb4dfa9+'/'+_0x301f31)[_0x1101('0x1a')](_0x4836b5);}return null;};}function patchUpdates(_0x568b11){return function(_0x3bac07){try{jsonpatch[_0x1101('0x1f')](_0x3bac07,_0x568b11,!![]);}catch(_0x2d9dcd){return BPromise[_0x1101('0x20')](_0x2d9dcd);}return _0x3bac07[_0x1101('0x21')]();};}function saveUpdates(_0x575a7c,_0x23f01b){return function(_0x21ab79){if(_0x21ab79){return _0x21ab79[_0x1101('0x22')](_0x575a7c)[_0x1101('0x23')](function(_0x113135){return _0x113135;});}return null;};}function removeEntity(_0x4e3e93,_0x2af96e){return function(_0x320e5d){if(_0x320e5d){return _0x320e5d['destroy']()[_0x1101('0x23')](function(){_0x4e3e93[_0x1101('0x18')](0xcc)[_0x1101('0x19')]();});}};}function handleEntityNotFound(_0x34de87,_0x338545){return function(_0x248e22){if(!_0x248e22){_0x34de87[_0x1101('0x24')](0x194);}return _0x248e22;};}function handleError(_0x4f73b4,_0x2c4155){_0x2c4155=_0x2c4155||0x1f4;return function(_0x1a0ea6){logger[_0x1101('0x25')](_0x1a0ea6[_0x1101('0x26')]);if(_0x1a0ea6[_0x1101('0x27')]){delete _0x1a0ea6[_0x1101('0x27')];}_0x4f73b4[_0x1101('0x18')](_0x2c4155)[_0x1101('0x28')](_0x1a0ea6);};}exports['index']=function(_0x472169,_0x17caff){var _0x597457={},_0x5b3327={},_0x3e3ef9={'count':0x0,'rows':[]};var _0x5c74b3=_['map'](db[_0x1101('0x29')]['rawAttributes'],function(_0x1a8736){return{'name':_0x1a8736[_0x1101('0x2a')],'type':_0x1a8736['type'][_0x1101('0x2b')]};});_0x5b3327[_0x1101('0x2c')]=_['map'](_0x5c74b3,_0x1101('0x27'));_0x5b3327[_0x1101('0x2d')]=_[_0x1101('0x2e')](_0x472169['query']);_0x5b3327[_0x1101('0x2f')]=_[_0x1101('0x30')](_0x5b3327[_0x1101('0x2c')],_0x5b3327[_0x1101('0x2d')]);_0x597457['attributes']=_[_0x1101('0x30')](_0x5b3327['model'],qs['fields'](_0x472169[_0x1101('0x2d')][_0x1101('0x31')]));_0x597457['attributes']=_0x597457[_0x1101('0x32')][_0x1101('0x33')]?_0x597457[_0x1101('0x32')]:_0x5b3327[_0x1101('0x2c')];if(!_0x472169['query'][_0x1101('0x34')](_0x1101('0x35'))){_0x597457['limit']=qs['limit'](_0x472169[_0x1101('0x2d')][_0x1101('0x1d')]);_0x597457[_0x1101('0x1b')]=qs[_0x1101('0x1b')](_0x472169[_0x1101('0x2d')][_0x1101('0x1b')]);}_0x597457[_0x1101('0x36')]=qs[_0x1101('0x37')](_0x472169[_0x1101('0x2d')][_0x1101('0x37')]);_0x597457['where']=qs[_0x1101('0x2f')](_[_0x1101('0x38')](_0x472169['query'],_0x5b3327[_0x1101('0x2f')]),_0x5c74b3);if(_0x472169['query']['filter']){_0x597457[_0x1101('0x39')]=_[_0x1101('0x3a')](_0x597457['where'],{'$or':_[_0x1101('0x3b')](_0x5c74b3,function(_0x1aa35f){if(_0x1aa35f['type']!==_0x1101('0x3c')){var _0x5c6490={};_0x5c6490[_0x1aa35f[_0x1101('0x27')]]={'$like':'%'+_0x472169[_0x1101('0x2d')][_0x1101('0x3d')]+'%'};return _0x5c6490;}})});}_0x597457=_[_0x1101('0x3a')]({},_0x597457,_0x472169[_0x1101('0x3e')]);var _0x59025b={'where':_0x597457['where']};return db[_0x1101('0x29')][_0x1101('0x1e')](_0x59025b)['then'](function(_0x151124){_0x3e3ef9['count']=_0x151124;if(_0x472169[_0x1101('0x2d')]['includeAll']){_0x597457[_0x1101('0x3f')]=[{'all':!![]}];}return db[_0x1101('0x29')]['findAll'](_0x597457);})[_0x1101('0x23')](function(_0x4d99bb){_0x3e3ef9[_0x1101('0x40')]=_0x4d99bb;return _0x3e3ef9;})['then'](respondWithFilteredResult(_0x17caff,_0x597457))[_0x1101('0x41')](handleError(_0x17caff,null));};exports[_0x1101('0x42')]=function(_0x396f2c,_0x233849){var _0x30edd0={'raw':!![],'where':{'id':_0x396f2c['params']['id']}},_0xb3477d={};_0xb3477d[_0x1101('0x2c')]=_[_0x1101('0x2e')](db[_0x1101('0x29')][_0x1101('0x43')]);_0xb3477d['query']=_[_0x1101('0x2e')](_0x396f2c[_0x1101('0x2d')]);_0xb3477d[_0x1101('0x2f')]=_[_0x1101('0x30')](_0xb3477d['model'],_0xb3477d[_0x1101('0x2d')]);_0x30edd0[_0x1101('0x32')]=_[_0x1101('0x30')](_0xb3477d[_0x1101('0x2c')],qs[_0x1101('0x31')](_0x396f2c[_0x1101('0x2d')][_0x1101('0x31')]));_0x30edd0[_0x1101('0x32')]=_0x30edd0[_0x1101('0x32')][_0x1101('0x33')]?_0x30edd0[_0x1101('0x32')]:_0xb3477d[_0x1101('0x2c')];if(_0x396f2c[_0x1101('0x2d')]['includeAll']){_0x30edd0[_0x1101('0x3f')]=[{'all':!![]}];}_0x30edd0=_[_0x1101('0x3a')]({},_0x30edd0,_0x396f2c[_0x1101('0x3e')]);return db[_0x1101('0x29')][_0x1101('0x44')](_0x30edd0)[_0x1101('0x23')](handleEntityNotFound(_0x233849,null))['then'](respondWithResult(_0x233849,null))[_0x1101('0x41')](handleError(_0x233849,null));};exports[_0x1101('0x45')]=function(_0xc3f9c6,_0x1f04f9){return db[_0x1101('0x29')][_0x1101('0x45')](_0xc3f9c6[_0x1101('0x46')],{})[_0x1101('0x23')](respondWithResult(_0x1f04f9,0xc9))[_0x1101('0x41')](handleError(_0x1f04f9,null));};exports[_0x1101('0x22')]=function(_0x4b246a,_0x1d616f){if(_0x4b246a[_0x1101('0x46')]['id']){delete _0x4b246a[_0x1101('0x46')]['id'];}return db[_0x1101('0x29')][_0x1101('0x44')]({'where':{'id':_0x4b246a[_0x1101('0x47')]['id']}})[_0x1101('0x23')](handleEntityNotFound(_0x1d616f,null))['then'](saveUpdates(_0x4b246a[_0x1101('0x46')],null))[_0x1101('0x23')](respondWithResult(_0x1d616f,null))[_0x1101('0x41')](handleError(_0x1d616f,null));};exports[_0x1101('0x48')]=function(_0x1ad9f4,_0x1249c9){return db['FaxApplication'][_0x1101('0x44')]({'where':{'id':_0x1ad9f4[_0x1101('0x47')]['id']}})[_0x1101('0x23')](handleEntityNotFound(_0x1249c9,null))[_0x1101('0x23')](removeEntity(_0x1249c9,null))['catch'](handleError(_0x1249c9,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ddff28f..a603ca7 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 _0x73fc=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','fax_applications'];(function(_0x1268f4,_0x147117){var _0x2f1b05=function(_0x4d634d){while(--_0x4d634d){_0x1268f4['push'](_0x1268f4['shift']());}};_0x2f1b05(++_0x147117);}(_0x73fc,0x115));var _0xc73f=function(_0x39d132,_0x41fbc5){_0x39d132=_0x39d132-0x0;var _0x4aab56=_0x73fc[_0x39d132];return _0x4aab56;};'use strict';var _=require(_0xc73f('0x0'));var util=require('util');var logger=require(_0xc73f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc73f('0x2'));var rp=require(_0xc73f('0x3'));var fs=require('fs');var path=require(_0xc73f('0x4'));var rimraf=require(_0xc73f('0x5'));var config=require(_0xc73f('0x6'));var attributes=require(_0xc73f('0x7'));module['exports']=function(_0x397878,_0x50baa5){return _0x397878['define']('FaxApplication',attributes,{'tableName':_0xc73f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc73f('0x9'),'collate':_0xc73f('0xa')});}; \ No newline at end of file +var _0x2209=['rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path'];(function(_0x24b8ea,_0x25e8ec){var _0x47ee8a=function(_0x5d4272){while(--_0x5d4272){_0x24b8ea['push'](_0x24b8ea['shift']());}};_0x47ee8a(++_0x25e8ec);}(_0x2209,0x163));var _0x9220=function(_0x2afdc0,_0x5b8c77){_0x2afdc0=_0x2afdc0-0x0;var _0x52d8fb=_0x2209[_0x2afdc0];return _0x52d8fb;};'use strict';var _=require('lodash');var util=require(_0x9220('0x0'));var logger=require(_0x9220('0x1'))(_0x9220('0x2'));var moment=require('moment');var BPromise=require(_0x9220('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9220('0x4'));var rimraf=require(_0x9220('0x5'));var config=require(_0x9220('0x6'));var attributes=require(_0x9220('0x7'));module['exports']=function(_0x5636bf,_0x5633d4){return _0x5636bf[_0x9220('0x8')](_0x9220('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9220('0xa'),'collate':_0x9220('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 1c14bb3..e830ace 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 _0xbe3b=['../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','body','options','raw','where','attributes','util','moment','randomstring','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x51ece4,_0x39165c){_0x51ece4=_0x51ece4-0x0;var _0x2b7e27=_0xbe3b[_0x51ece4];return _0x2b7e27;};'use strict';var _=require('lodash');var util=require(_0xbbe3('0x0'));var moment=require(_0xbbe3('0x1'));var BPromise=require('bluebird');var rs=require(_0xbbe3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbe3('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbe3('0x4'));var jayson=require(_0xbbe3('0x5'));var client=jayson[_0xbbe3('0x6')][_0xbbe3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c6976,_0x9bd4a9,_0x748756){return new BPromise(function(_0x40199b,_0x3c0c43){return client[_0xbbe3('0x8')](_0x4c6976,_0x748756)['then'](function(_0x1ff205){logger[_0xbbe3('0x9')](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));logger[_0xbbe3('0xc')](_0xbbe3('0xd'),_0x9bd4a9,_0xbbe3('0xb'),JSON[_0xbbe3('0xe')](_0x1ff205));if(_0x1ff205['error']){if(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x10')]===0x1f4){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205['error']['message']);return _0x3c0c43(_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);}logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x1ff205[_0xbbe3('0xf')][_0xbbe3('0x11')]);return _0x40199b(_0x1ff205['error'][_0xbbe3('0x11')]);}else{logger['info'](_0xbbe3('0xa'),_0x9bd4a9,_0xbbe3('0xb'));_0x40199b(_0x1ff205[_0xbbe3('0x12')][_0xbbe3('0x11')]);}})[_0xbbe3('0x13')](function(_0x2af60d){logger[_0xbbe3('0xf')](_0xbbe3('0xa'),_0x9bd4a9,_0x2af60d);_0x3c0c43(_0x2af60d);});});}exports[_0xbbe3('0x14')]=function(_0x2ad70e){var _0x445b23=this;return new Promise(function(_0x3de02e,_0x48b701){return db['FaxApplication']['update'](_0x2ad70e[_0xbbe3('0x15')],{'raw':_0x2ad70e[_0xbbe3('0x16')]?_0x2ad70e[_0xbbe3('0x16')][_0xbbe3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ad70e[_0xbbe3('0x16')]?_0x2ad70e['options'][_0xbbe3('0x18')]||null:null,'attributes':_0x2ad70e[_0xbbe3('0x16')]?_0x2ad70e[_0xbbe3('0x16')][_0xbbe3('0x19')]||null:null,'limit':_0x2ad70e['options']?_0x2ad70e['options']['limit']||null:null})['then'](function(_0x247f7d){logger[_0xbbe3('0x9')](_0xbbe3('0x14'),_0x2ad70e);logger['debug'](_0xbbe3('0x14'),_0x2ad70e,JSON[_0xbbe3('0xe')](_0x247f7d));_0x3de02e(_0x247f7d);})['catch'](function(_0x4799c7){logger[_0xbbe3('0xf')](_0xbbe3('0x14'),_0x4799c7[_0xbbe3('0x11')],_0x2ad70e);_0x48b701(_0x445b23[_0xbbe3('0xf')](0x1f4,_0x4799c7[_0xbbe3('0x11')]));});});}; \ No newline at end of file +var _0x3b70=['info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','catch','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x20e59a,_0x3cfa98){var _0x40b7c5=function(_0x5be74f){while(--_0x5be74f){_0x20e59a['push'](_0x20e59a['shift']());}};_0x40b7c5(++_0x3cfa98);}(_0x3b70,0x13c));var _0x03b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b70[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03b7('0x0'));var util=require(_0x03b7('0x1'));var moment=require(_0x03b7('0x2'));var BPromise=require(_0x03b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03b7('0x5'));var logger=require(_0x03b7('0x6'))(_0x03b7('0x7'));var config=require(_0x03b7('0x8'));var jayson=require(_0x03b7('0x9'));var client=jayson[_0x03b7('0xa')][_0x03b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfaec4d,_0x57edea,_0x44c2c1){return new BPromise(function(_0x2b423a,_0x335a1c){return client[_0x03b7('0xc')](_0xfaec4d,_0x44c2c1)[_0x03b7('0xd')](function(_0x5acb4e){logger[_0x03b7('0xe')]('FaxApplication,\x20%s,\x20%s',_0x57edea,_0x03b7('0xf'));logger[_0x03b7('0x10')](_0x03b7('0x11'),_0x57edea,_0x03b7('0xf'),JSON[_0x03b7('0x12')](_0x5acb4e));if(_0x5acb4e[_0x03b7('0x13')]){if(_0x5acb4e[_0x03b7('0x13')][_0x03b7('0x14')]===0x1f4){logger[_0x03b7('0x13')](_0x03b7('0x15'),_0x57edea,_0x5acb4e['error']['message']);return _0x335a1c(_0x5acb4e['error']['message']);}logger['error'](_0x03b7('0x15'),_0x57edea,_0x5acb4e['error']['message']);return _0x2b423a(_0x5acb4e[_0x03b7('0x13')][_0x03b7('0x16')]);}else{logger[_0x03b7('0xe')](_0x03b7('0x15'),_0x57edea,_0x03b7('0xf'));_0x2b423a(_0x5acb4e['result']['message']);}})[_0x03b7('0x17')](function(_0x3de96f){logger['error'](_0x03b7('0x15'),_0x57edea,_0x3de96f);_0x335a1c(_0x3de96f);});});}exports['UpdateFaxApplication']=function(_0x18b56f){var _0x2c5031=this;return new Promise(function(_0xbadb2a,_0x12f644){return db[_0x03b7('0x18')][_0x03b7('0x19')](_0x18b56f[_0x03b7('0x1a')],{'raw':_0x18b56f[_0x03b7('0x1b')]?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b56f['options']?_0x18b56f['options'][_0x03b7('0x1d')]||null:null,'attributes':_0x18b56f[_0x03b7('0x1b')]?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1e')]||null:null,'limit':_0x18b56f['options']?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1f')]||null:null})[_0x03b7('0xd')](function(_0x575474){logger[_0x03b7('0xe')]('UpdateFaxApplication',_0x18b56f);logger[_0x03b7('0x10')](_0x03b7('0x20'),_0x18b56f,JSON[_0x03b7('0x12')](_0x575474));_0xbadb2a(_0x575474);})[_0x03b7('0x17')](function(_0x3dd6d4){logger[_0x03b7('0x13')]('UpdateFaxApplication',_0x3dd6d4[_0x03b7('0x16')],_0x18b56f);_0x12f644(_0x2c5031[_0x03b7('0x13')](0x1f4,_0x3dd6d4[_0x03b7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 3aaa9ca..56b41b1 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 _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x1d71a0,_0x19d887){var _0x35f931=function(_0x1a17d4){while(--_0x1a17d4){_0x1d71a0['push'](_0x1d71a0['shift']());}};_0x35f931(++_0x19d887);}(_0x7708,0x188));var _0x8770=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x7708[_0x2de020];return _0x182b7c;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router; \ No newline at end of file +var _0x087b=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1a896c,_0x3a27c8){var _0x187c06=function(_0x47987a){while(--_0x47987a){_0x1a896c['push'](_0x1a896c['shift']());}};_0x187c06(++_0x3a27c8);}(_0x087b,0x11a));var _0xb087=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x087b[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0xd')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);module[_0xb087('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7773cc5..f2be391 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 _0x82ae=['BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x1ea034,_0x2aad56){var _0x192159=function(_0x572aa6){while(--_0x572aa6){_0x1ea034['push'](_0x1ea034['shift']());}};_0x192159(++_0x2aad56);}(_0x82ae,0x1d6));var _0xe82a=function(_0x56524c,_0xef792b){_0x56524c=_0x56524c-0x0;var _0x15ea6a=_0x82ae[_0x56524c];return _0x15ea6a;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xe82a('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe82a('0x1')]},'secondDisposition':{'type':Sequelize[_0xe82a('0x1')]},'thirdDisposition':{'type':Sequelize[_0xe82a('0x1')]},'note':{'type':Sequelize[_0xe82a('0x1')]},'read1stAt':{'type':Sequelize[_0xe82a('0x2')]},'fax':{'type':Sequelize[_0xe82a('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xe82a('0x3')]('in',_0xe82a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe82a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe82a('0x3')]('in',_0xe82a('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0591=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x0591,0x1d6));var _0x1059=function(_0x3f7861,_0x13619b){_0x3f7861=_0x3f7861-0x0;var _0x36fdae=_0x0591[_0x3f7861];return _0x36fdae;};'use strict';var Sequelize=require(_0x1059('0x0'));module[_0x1059('0x1')]={'closed':{'type':Sequelize[_0x1059('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1059('0x3')]},'secondDisposition':{'type':Sequelize[_0x1059('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1059('0x3')]},'read1stAt':{'type':Sequelize[_0x1059('0x4')]},'fax':{'type':Sequelize[_0x1059('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1059('0x5')]('in',_0x1059('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1059('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1059('0x5')]('in',_0x1059('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index bf4c365..f972189 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 _0x8442=['create','body','params','describe','FaxMessage','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','join','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./faxInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','sendStatus','name','Users','fullname','Tags','TagIds','split','forEach','push','index','map','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','from','users','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','isEmpty','FaxAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`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','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','catch','show','options'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0x8442,0x1d7));var _0x2844=function(_0x465c76,_0x15a80b){_0x465c76=_0x465c76-0x0;var _0x5c4556=_0x8442[_0x465c76];return _0x5c4556;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2844('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2844('0x1'));var rp=require(_0x2844('0x2'));var moment=require(_0x2844('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2844('0x4'));var path=require(_0x2844('0x5'));var sox=require(_0x2844('0x6'));var csv=require('to-csv');var ejs=require(_0x2844('0x7'));var fs=require('fs');var fs_extra=require(_0x2844('0x8'));var _=require(_0x2844('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2844('0xa'));var deskjs=require(_0x2844('0xb'));var toCsv=require(_0x2844('0xc'));var querystring=require(_0x2844('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2844('0xe'));var qs=require(_0x2844('0xf'));var as=require(_0x2844('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2844('0x11'))(_0x2844('0x12'));var utils=require(_0x2844('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2844('0x14'));var db=require(_0x2844('0x15'))['db'];config['redis']=_[_0x2844('0x16')](config[_0x2844('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2844('0x17')]));require(_0x2844('0x18'))[_0x2844('0x19')](socket);function respondWithStatusCode(_0x49380f,_0x57f8c3){_0x57f8c3=_0x57f8c3||0xcc;return function(_0x2ddf71){if(_0x2ddf71){return _0x49380f['sendStatus'](_0x57f8c3);}return _0x49380f[_0x2844('0x1a')](_0x57f8c3)[_0x2844('0x1b')]();};}function respondWithResult(_0x27c540,_0x33b77){_0x33b77=_0x33b77||0xc8;return function(_0x4b858c){if(_0x4b858c){return _0x27c540[_0x2844('0x1a')](_0x33b77)['json'](_0x4b858c);}};}function respondWithFilteredResult(_0x50d8d0,_0x4cd1d5){return function(_0x39b643){if(_0x39b643){var _0x4e4c65=typeof _0x4cd1d5[_0x2844('0x1c')]===_0x2844('0x1d')&&typeof _0x4cd1d5[_0x2844('0x1e')]===_0x2844('0x1d');var _0x34a3c3=_0x39b643['count'];var _0x449694=_0x4e4c65?0x0:_0x4cd1d5[_0x2844('0x1c')];var _0x480442=_0x4e4c65?_0x39b643[_0x2844('0x1f')]:_0x4cd1d5['offset']+_0x4cd1d5[_0x2844('0x1e')];var _0x41c06;if(_0x480442>=_0x34a3c3){_0x480442=_0x34a3c3;_0x41c06=0xc8;}else{_0x41c06=0xce;}_0x50d8d0[_0x2844('0x1a')](_0x41c06);return _0x50d8d0[_0x2844('0x20')](_0x2844('0x21'),_0x449694+'-'+_0x480442+'/'+_0x34a3c3)[_0x2844('0x22')](_0x39b643);}return null;};}function patchUpdates(_0x56ab60){return function(_0x10106a){try{jsonpatch[_0x2844('0x23')](_0x10106a,_0x56ab60,!![]);}catch(_0x55b14f){return BPromise['reject'](_0x55b14f);}return _0x10106a[_0x2844('0x24')]();};}function saveUpdates(_0x2dc483,_0x13b7ee){return function(_0x566f30){if(_0x566f30){return _0x566f30['update'](_0x2dc483)['then'](function(_0x2c5db0){return _0x2c5db0;});}return null;};}function removeEntity(_0x54be79,_0x3e5744){return function(_0x280d89){if(_0x280d89){return _0x280d89[_0x2844('0x25')]()[_0x2844('0x26')](function(){_0x54be79[_0x2844('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd851,_0x155cef){return function(_0x53820f){if(!_0x53820f){_0x1bd851[_0x2844('0x27')](0x194);}return _0x53820f;};}function handleError(_0xedadee,_0x24f231){_0x24f231=_0x24f231||0x1f4;return function(_0x47318a){logger['error'](_0x47318a['stack']);if(_0x47318a[_0x2844('0x28')]){delete _0x47318a[_0x2844('0x28')];}_0xedadee['status'](_0x24f231)['send'](_0x47318a);};}function getInteractionUsers(_0x4ba4a5,_0x22f712){return new BPromise(function(_0x5b99ee,_0x39f6f9){try{if(_0x22f712[_0x4ba4a5['id']]){_0x4ba4a5[_0x2844('0x29')]=_['map'](_0x22f712[_0x4ba4a5['id']],function(_0x579ebc){return{'id':_0x579ebc['id'],'fullname':_0x579ebc[_0x2844('0x2a')]};});}}catch(_0x573e9d){_0x39f6f9(_0x573e9d);}_0x5b99ee(_0x4ba4a5);});}function getInteractionTags(_0x529c3d,_0x345d2a){return new BPromise(function(_0x28ceeb,_0x4be4d8){try{if(_0x529c3d['TagIds']){_0x529c3d[_0x2844('0x2b')]=[];_0x529c3d[_0x2844('0x2c')][_0x2844('0x2d')](',')[_0x2844('0x2e')](function(_0x612b11){_0x529c3d['Tags'][_0x2844('0x2f')](_0x345d2a[_0x612b11]);});}delete _0x529c3d[_0x2844('0x2c')];}catch(_0x516645){_0x4be4d8(_0x516645);}_0x28ceeb(_0x529c3d);});}function updateFaxInteraction(_0x355c60,_0x4e52ae,_0x128afb){return new BPromise(function(_0x253586,_0x14339e){return getInteractionUsers(_0x355c60,_0x128afb)[_0x2844('0x26')](function(_0x43dac6){return getInteractionTags(_0x43dac6,_0x4e52ae);})['then'](function(_0x1347c3){_0x253586(_0x1347c3);})['catch'](function(_0x57a83e){_0x14339e(_0x57a83e);});});}exports[_0x2844('0x30')]=function(_0x46a989,_0x3fa653){var _0x536673={},_0x1a912d={},_0x53b983={'count':0x0,'rows':[]};var _0x521e0e=_[_0x2844('0x31')](db[_0x2844('0x32')][_0x2844('0x33')],function(_0x478a97){return{'name':_0x478a97[_0x2844('0x34')],'type':_0x478a97['type'][_0x2844('0x35')]};});_0x1a912d[_0x2844('0x36')]=_[_0x2844('0x31')](_0x521e0e,_0x2844('0x28'));_0x1a912d[_0x2844('0x37')]=_[_0x2844('0x38')](_0x46a989[_0x2844('0x37')]);_0x1a912d[_0x2844('0x39')]=_[_0x2844('0x3a')](_0x1a912d[_0x2844('0x36')],_0x1a912d[_0x2844('0x37')]);_0x536673[_0x2844('0x3b')]=_['intersection'](_0x1a912d[_0x2844('0x36')],qs[_0x2844('0x3c')](_0x46a989[_0x2844('0x37')][_0x2844('0x3c')]));_0x536673[_0x2844('0x3b')]=_0x536673[_0x2844('0x3b')][_0x2844('0x3d')]?_0x536673['attributes']:_0x1a912d[_0x2844('0x36')];if(!_0x46a989[_0x2844('0x37')]['hasOwnProperty'](_0x2844('0x3e'))){_0x536673[_0x2844('0x1e')]=qs[_0x2844('0x1e')](_0x46a989['query'][_0x2844('0x1e')]);_0x536673[_0x2844('0x1c')]=qs[_0x2844('0x1c')](_0x46a989[_0x2844('0x37')][_0x2844('0x1c')]);}_0x536673[_0x2844('0x3f')]=qs[_0x2844('0x40')](_0x46a989[_0x2844('0x37')][_0x2844('0x40')]);_0x536673[_0x2844('0x41')]=qs[_0x2844('0x39')](_[_0x2844('0x42')](_0x46a989[_0x2844('0x37')],_0x1a912d[_0x2844('0x39')]),_0x521e0e);var _0x595ee6=[];var _0x31622=squel[_0x2844('0x43')]()[_0x2844('0x44')]('id')[_0x2844('0x44')](_0x2844('0x28'))[_0x2844('0x44')](_0x2844('0x45'))['from'](_0x2844('0x46'));var _0x261580=squel['select']()[_0x2844('0x44')](_0x2844('0x47'))[_0x2844('0x44')]('u.fullname')[_0x2844('0x44')]('ui.FaxInteractionId')[_0x2844('0x48')]('user_has_fax_interactions','ui')['left_join'](_0x2844('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x4510ae=squel[_0x2844('0x43')]()[_0x2844('0x48')]('fax_interactions','i')[_0x2844('0x4a')](_0x2844('0x4b'),'c',_0x2844('0x4c'))[_0x2844('0x4a')](_0x2844('0x49'),'o',_0x2844('0x4d'))[_0x2844('0x4a')](_0x2844('0x4e'),'a',_0x2844('0x4f'))[_0x2844('0x4a')](_0x2844('0x50'),'me',_0x2844('0x51'))[_0x2844('0x4a')](_0x2844('0x52'),'it',_0x2844('0x53'))[_0x2844('0x4a')]('tools_tags','t',_0x2844('0x54'));var _0x3c7dfb=squel[_0x2844('0x55')]();var _0x5d5746=[];var _0x1ff92e=squel[_0x2844('0x55')]();var _0x283b3a;if(_0x46a989[_0x2844('0x37')]['search']){_0x283b3a=as[_0x2844('0x56')](_0x46a989[_0x2844('0x37')][_0x2844('0x57')]);var _0xffe74f=_0x283b3a['sqlOperator'];for(var _0x107dcd=0x0;_0x107dcd<_0x283b3a[_0x2844('0x58')][_0x2844('0x3d')];_0x107dcd++){var _0x3657b7=_0x283b3a[_0x2844('0x58')][_0x107dcd];var _0x2e7ec3='i';var _0xe1c207=_[_0x2844('0x59')](_0x521e0e,[_0x2844('0x28'),_0x3657b7['field']]);if(!_0xe1c207){switch(_0x3657b7['field']){case _0x2844('0x5a'):if(_0x3657b7[_0x2844('0x5b')]==0x1){_0x4510ae['having']('`'+_0x3657b7[_0x2844('0x44')]+_0x2844('0x5c'));}else{_0x4510ae[_0x2844('0x5d')]('`'+_0x3657b7['field']+_0x2844('0x5e'));}break;case _0x2844('0x5f'):if(_0x3657b7[_0x2844('0x60')]===_0x2844('0x61')){if(_0x3657b7[_0x2844('0x5b')][_0x2844('0x2d')]('\x20')['length']>0x1){_0x3c7dfb[_0xffe74f](_0x2844('0x62'),qs['getFullTextValue'](_0x3657b7[_0x2844('0x5b')]),null);}else{var _0x3a76bd='%'+_0x3657b7[_0x2844('0x5b')]+'%';_0x3c7dfb[_0xffe74f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3a76bd,_0x3a76bd,_0x3a76bd);}}else{_0xe1c207=_[_0x2844('0x59')](_0x521e0e,[_0x2844('0x28'),_0x2844('0x63')]);_0x3657b7[_0x2844('0x44')]=_0x2844('0x63');_0x28aa29=as['buildExpression'](_0x2e7ec3,_0xe1c207[_0x2844('0x64')],_0x3657b7);_0x3c7dfb[_0xffe74f](_0x28aa29[_0x2844('0x65')],_0x28aa29['value'][_0x2844('0x66')],_0x28aa29[_0x2844('0x5b')][_0x2844('0x1b')]);}break;case'Tag':var _0x16463a=_0x3657b7['value'][_0x2844('0x2d')](',')[_0x2844('0x31')](function(_0x5b0424){return Number(_0x5b0424);});_0x16463a[_0x2844('0x2e')](function(_0x26f499){_0x1ff92e['or'](_0x2844('0x67'),'%,'+_0x26f499+',%');});_0x5d5746=_[_0x2844('0x68')](_0x5d5746,_0x16463a);break;case'User':if(_0x3657b7[_0x2844('0x60')]===_0x2844('0x61')){_0x3c7dfb[_0xffe74f](_0x2844('0x69'),'%'+_0x3657b7[_0x2844('0x5b')]+'%',null);}else{_0xe1c207=_[_0x2844('0x59')](_0x521e0e,[_0x2844('0x28'),_0x2844('0x6a')]);_0x3657b7['field']=_0x2844('0x6a');_0x28aa29=as[_0x2844('0x6b')](_0x2e7ec3,_0xe1c207[_0x2844('0x64')],_0x3657b7);_0x3c7dfb[_0xffe74f](_0x28aa29[_0x2844('0x65')],_0x28aa29[_0x2844('0x5b')][_0x2844('0x66')],_0x28aa29['value'][_0x2844('0x1b')]);}break;case'body':_0x28aa29=as['buildExpression']('me',null,_0x3657b7);_0x3c7dfb[_0xffe74f](_0x28aa29[_0x2844('0x65')],_0x28aa29['value'][_0x2844('0x66')],_0x28aa29[_0x2844('0x5b')][_0x2844('0x1b')]);break;}}else{var _0x28aa29=as[_0x2844('0x6b')](_0x2e7ec3,_0xe1c207[_0x2844('0x64')],_0x3657b7);_0x3c7dfb[_0xffe74f](_0x28aa29[_0x2844('0x65')],_0x28aa29['value'][_0x2844('0x66')],_0x28aa29[_0x2844('0x5b')]['end']);}}}else{var _0x2c5dcc=_(_0x46a989[_0x2844('0x37')])[_0x2844('0x38')]()[_0x2844('0x31')](function(_0x19da96){return _[_0x2844('0x6c')](_0x521e0e,[_0x2844('0x28'),_0x19da96])?_0x19da96:undefined;})['compact']()[_0x2844('0x5b')]();if(!_[_0x2844('0x6d')](_0x2c5dcc)){_0x2c5dcc[_0x2844('0x2e')](function(_0xd5193){if(_0xd5193===_0x2844('0x6e')){_0x4510ae['where']('i.FaxAccountId\x20IN\x20?',[][_0x2844('0x6f')](_0x46a989['query'][_0xd5193]));}else if(_0xd5193===_0x2844('0x70')){var _0x1a3079=JSON[_0x2844('0x71')](_0x46a989[_0x2844('0x37')][_0xd5193])['$gte'];var _0x54ca4f=JSON[_0x2844('0x71')](_0x46a989['query'][_0xd5193])[_0x2844('0x72')];_0x4510ae['where'](_0x2844('0x73'),_0x1a3079,_0x54ca4f);}else{if(_0x46a989[_0x2844('0x37')][_0xd5193]===_0x2844('0x74')){_0x4510ae[_0x2844('0x41')]('i.'+_0xd5193+_0x2844('0x75'));}else{_0x4510ae[_0x2844('0x41')]('i.'+_0xd5193+'\x20=\x20?',_0x46a989[_0x2844('0x37')][_0xd5193]);}}});}if(_0x46a989[_0x2844('0x37')][_0x2844('0x76')]){if(_0x46a989['query']['read']==0x1){_0x4510ae['having']('`unreadMessages`\x20=\x200');}else{_0x4510ae[_0x2844('0x5d')](_0x2844('0x77'));}}if(_0x46a989[_0x2844('0x37')]['tag']){_0x5d5746=_[_0x2844('0x78')](_0x46a989[_0x2844('0x37')][_0x2844('0x79')])?_0x46a989[_0x2844('0x37')]['tag']:new Array(_0x46a989[_0x2844('0x37')][_0x2844('0x79')]);_0x5d5746[_0x2844('0x2e')](function(_0x40aed5){_0x1ff92e['or'](_0x2844('0x67'),'%,'+_0x40aed5+',%');});}if(_0x46a989[_0x2844('0x37')][_0x2844('0x7a')]){var _0x3c0a34=_0x46a989[_0x2844('0x37')][_0x2844('0x7a')]['replace']('\x5c','\x5c\x5c')[_0x2844('0x7b')](/'/g,'\x27\x27');if(qs[_0x2844('0x7c')](_0x3c0a34)){_0x3c7dfb['or'](_0x2844('0x7d'),_0x3c0a34+'%')['or'](_0x2844('0x7e'),_0x3c0a34+'%');}_0x3c7dfb['or'](_0x2844('0x7f'),_0x3c0a34+'%');}}_0x4510ae['where'](_0x3c7dfb);_0x4510ae[_0x2844('0x80')](_0x2844('0x81'));var _0x1dc204={'type':db[_0x2844('0x82')][_0x2844('0x83')][_0x2844('0x84')],'raw':!![]};var _0x565f17=_0x4510ae[_0x2844('0x85')]();_0x565f17['field'](_0x2844('0x81'));_0x565f17['field'](_0x2844('0x86'),_0x2844('0x5a'));if(_0x536673[_0x2844('0x3f')]){_0x536673[_0x2844('0x3f')][_0x2844('0x2e')](function(_0x6e808d){var _0x26fc12=_0x6e808d[0x0]===_0x2844('0x87')?_0x6e808d[0x0]:'i.'+_0x6e808d[0x0];_0x4510ae[_0x2844('0x3f')](_0x26fc12,_0x6e808d[0x1]===_0x2844('0x88')?![]:!![]);});}if(!_[_0x2844('0x6d')](_0x5d5746)){_0x4510ae[_0x2844('0x5d')](_0x1ff92e);_0x565f17[_0x2844('0x41')](_0x2844('0x89'),_0x5d5746);}BPromise['resolve']()['then'](function(){if(!_0x283b3a){if(_0x46a989['query'][_0x2844('0x6e')])return;_0x565f17[_0x2844('0x41')](_0x2844('0x8a'));_0x4510ae['where'](_0x2844('0x8a'));return;}if(_0x46a989[_0x2844('0x8b')][_0x2844('0x8c')]!==_0x2844('0x8d'))return;return _0x46a989[_0x2844('0x8b')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x2844('0x26')](function(_0x52df7b){if(_[_0x2844('0x6d')](_0x52df7b)){_0x565f17['where'](_0x2844('0x8e'));_0x4510ae[_0x2844('0x41')](_0x2844('0x8e'));}else{_0x565f17[_0x2844('0x41')](_0x2844('0x8f'),_['map'](_0x52df7b,'id'));_0x4510ae[_0x2844('0x41')](_0x2844('0x8f'),_[_0x2844('0x31')](_0x52df7b,'id'));}});})[_0x2844('0x26')](function(){if(_0x46a989[_0x2844('0x8b')][_0x2844('0x8c')]===_0x2844('0x8d')&&!_0x283b3a&&!_0x46a989[_0x2844('0x37')][_0x2844('0x6e')])return[];return db[_0x2844('0x90')][_0x2844('0x37')](_0x565f17[_0x2844('0x91')](),_0x1dc204);})['then'](function(_0x50c195){_0x53b983[_0x2844('0x1f')]=_0x50c195[_0x2844('0x3d')];if(_0x53b983['count']===0x0)return[];return db[_0x2844('0x90')][_0x2844('0x37')](_0x31622[_0x2844('0x91')](),_0x1dc204)[_0x2844('0x26')](function(_0x295512){_0x595ee6=_[_0x2844('0x92')](_0x295512,'id');_0x1dc204=_[_0x2844('0x93')](_0x1dc204,{'model':db[_0x2844('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46a989[_0x2844('0x37')][_0x2844('0x3c')]){_0x536673[_0x2844('0x3b')][_0x2844('0x2e')](function(_0x398109){_0x4510ae[_0x2844('0x44')]('i.'+_0x398109);});}else{_0x4510ae[_0x2844('0x44')](_0x2844('0x86'),_0x2844('0x5a'));_0x4510ae[_0x2844('0x44')](_0x2844('0x94'),'Account.key');_0x4510ae[_0x2844('0x44')](_0x2844('0x95'),_0x2844('0x96'));_0x4510ae[_0x2844('0x44')](_0x2844('0x97'),_0x2844('0x87'));_0x4510ae['field'](_0x2844('0x98'));_0x4510ae[_0x2844('0x44')](_0x2844('0x99'),_0x2844('0x9a'));_0x4510ae['field']('c.lastName',_0x2844('0x9b'));_0x4510ae[_0x2844('0x44')](_0x2844('0x9c'),_0x2844('0x9d'));_0x4510ae[_0x2844('0x44')]('c.phone',_0x2844('0x9e'));_0x4510ae[_0x2844('0x44')](_0x2844('0x9f'),_0x2844('0xa0'));_0x4510ae['field'](_0x2844('0xa1'),'Contact.fax');_0x4510ae[_0x2844('0x44')](_0x2844('0xa2'),_0x2844('0xa3'));_0x4510ae[_0x2844('0x44')](_0x2844('0xa4'),_0x2844('0xa5'));_0x4510ae[_0x2844('0x44')](_0x2844('0xa6'),_0x2844('0x2c'));}if(_0x536673['limit'])_0x4510ae['limit'](_0x536673[_0x2844('0x1e')]);if(_0x536673[_0x2844('0x1c')])_0x4510ae[_0x2844('0x1c')](_0x536673['offset']);return db[_0x2844('0x90')][_0x2844('0x37')](_0x4510ae['toString'](),_0x1dc204);})[_0x2844('0x26')](function(_0x12ea4d){if(_0x12ea4d[_0x2844('0x3d')]>0x0)_0x261580[_0x2844('0x41')]('ui.FaxInteractionId\x20IN\x20?',_[_0x2844('0x31')](_0x12ea4d,'id'));return db[_0x2844('0x90')][_0x2844('0x37')](_0x261580[_0x2844('0x91')](),_0x1dc204)[_0x2844('0x26')](function(_0x457781){var _0x5ee378=_[_0x2844('0xa7')](_0x457781,_0x2844('0xa8'));var _0x42d8ea=[];_0x12ea4d[_0x2844('0x2e')](function(_0x4e585e){_0x42d8ea[_0x2844('0x2f')](updateFaxInteraction(_0x4e585e,_0x595ee6,_0x5ee378));});return BPromise[_0x2844('0xa9')](_0x42d8ea);});});})[_0x2844('0x26')](function(_0x151d2d){_0x53b983[_0x2844('0xaa')]=_0x151d2d;return _0x53b983;})[_0x2844('0x26')](respondWithFilteredResult(_0x3fa653,_0x536673))[_0x2844('0xab')](handleError(_0x3fa653,null));};exports[_0x2844('0xac')]=function(_0x2f0f11,_0x1a5987){var _0x2b1456={'raw':![],'where':{'id':_0x2f0f11['params']['id']}},_0x58018f={};_0x58018f[_0x2844('0x36')]=_[_0x2844('0x38')](db[_0x2844('0x32')][_0x2844('0x33')]);_0x58018f['query']=_[_0x2844('0x38')](_0x2f0f11[_0x2844('0x37')]);_0x58018f[_0x2844('0x39')]=_['intersection'](_0x58018f[_0x2844('0x36')],_0x58018f['query']);_0x2b1456['attributes']=_['intersection'](_0x58018f[_0x2844('0x36')],qs[_0x2844('0x3c')](_0x2f0f11['query'][_0x2844('0x3c')]));_0x2b1456['attributes']=_0x2b1456[_0x2844('0x3b')][_0x2844('0x3d')]?_0x2b1456[_0x2844('0x3b')]:_0x58018f['model'];if(_0x2f0f11['query']['includeAll']){_0x2b1456['include']=[{'all':!![]}];}_0x2b1456=_[_0x2844('0x93')]({},_0x2b1456,_0x2f0f11[_0x2844('0xad')]);return db[_0x2844('0x32')][_0x2844('0x59')](_0x2b1456)[_0x2844('0x26')](handleEntityNotFound(_0x1a5987,null))['then'](respondWithResult(_0x1a5987,null))[_0x2844('0xab')](handleError(_0x1a5987,null));};exports[_0x2844('0xae')]=function(_0x9d11d7,_0x524787){return db[_0x2844('0x32')]['create'](_0x9d11d7[_0x2844('0xaf')],{})[_0x2844('0x26')](respondWithResult(_0x524787,0xc9))[_0x2844('0xab')](handleError(_0x524787,null));};exports['update']=function(_0x3cf13d,_0x373e7d){if(_0x3cf13d[_0x2844('0xaf')]['id']){delete _0x3cf13d[_0x2844('0xaf')]['id'];}return db['FaxInteraction'][_0x2844('0x59')]({'where':{'id':_0x3cf13d[_0x2844('0xb0')]['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x373e7d,null))[_0x2844('0x26')](saveUpdates(_0x3cf13d[_0x2844('0xaf')],null))[_0x2844('0x26')](respondWithResult(_0x373e7d,null))[_0x2844('0xab')](handleError(_0x373e7d,null));};exports[_0x2844('0x25')]=function(_0x420d35,_0x3c1fa0){return db['FaxInteraction'][_0x2844('0x59')]({'where':{'id':_0x420d35[_0x2844('0xb0')]['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x3c1fa0,null))[_0x2844('0x26')](removeEntity(_0x3c1fa0,null))[_0x2844('0xab')](handleError(_0x3c1fa0,null));};exports[_0x2844('0xb1')]=function(_0x7c4db4,_0x121bd6){return db['FaxInteraction']['describe']()[_0x2844('0x26')](respondWithResult(_0x121bd6,null))[_0x2844('0xab')](handleError(_0x121bd6,null));};exports['addMessage']=function(_0xb435d3,_0x4d40de,_0x61e1a1){return db[_0x2844('0xb2')][_0x2844('0x59')]({'where':{'id':_0xb435d3['params']['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x4d40de,null))[_0x2844('0x26')](function(_0x4cbd2b){if(_0x4cbd2b){return _0x4cbd2b[_0x2844('0xb3')](_0xb435d3['body']['ids'],_[_0x2844('0xb4')](_0xb435d3[_0x2844('0xaf')],[_0x2844('0xb5'),'id'])||{});}})[_0x2844('0x26')](respondWithResult(_0x4d40de,null))[_0x2844('0xab')](handleError(_0x4d40de,null));};exports[_0x2844('0xb6')]=function(_0x139c8e,_0x34eccb,_0x16a782){var _0x123642={'raw':![],'where':{}};var _0x5c835e={};var _0x1fdd3d={'count':0x0,'rows':[]};return db[_0x2844('0x32')][_0x2844('0xb7')]({'where':{'id':_0x139c8e[_0x2844('0xb0')]['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x34eccb,null))[_0x2844('0x26')](function(_0x461a32){if(_0x461a32){_0x5c835e['model']=_['keys'](db[_0x2844('0xb2')]['rawAttributes']);_0x5c835e[_0x2844('0x37')]=_['keys'](_0x139c8e[_0x2844('0x37')]);_0x5c835e[_0x2844('0x39')]=_[_0x2844('0x3a')](_0x5c835e[_0x2844('0x36')],_0x5c835e[_0x2844('0x37')]);_0x123642['attributes']=_[_0x2844('0x3a')](_0x5c835e[_0x2844('0x36')],qs[_0x2844('0x3c')](_0x139c8e[_0x2844('0x37')]['fields']));_0x123642[_0x2844('0x3b')]=_0x123642[_0x2844('0x3b')]['length']?_0x123642[_0x2844('0x3b')]:_0x5c835e[_0x2844('0x36')];if(!_0x139c8e[_0x2844('0x37')][_0x2844('0xb8')](_0x2844('0x3e'))){_0x123642[_0x2844('0x1e')]=qs['limit'](_0x139c8e[_0x2844('0x37')]['limit']);_0x123642[_0x2844('0x1c')]=qs[_0x2844('0x1c')](_0x139c8e[_0x2844('0x37')]['offset']);}_0x123642['order']=qs[_0x2844('0x40')](_0x139c8e[_0x2844('0x37')][_0x2844('0x40')]);_0x123642[_0x2844('0x41')]=qs[_0x2844('0x39')](_[_0x2844('0x42')](_0x139c8e[_0x2844('0x37')],_0x5c835e[_0x2844('0x39')]));_0x123642['where'][_0x2844('0xa8')]=_0x461a32['id'];if(_0x139c8e['query'][_0x2844('0x7a')]){_0x123642['where']=_[_0x2844('0x93')](_0x123642['where'],{'$or':_[_0x2844('0x31')](_0x123642[_0x2844('0x3b')],function(_0x185ca2){var _0x3c9164={};_0x3c9164[_0x185ca2]={'$like':'%'+_0x139c8e[_0x2844('0x37')]['filter']+'%'};return _0x3c9164;})});}if(_0x139c8e['query'][_0x2844('0xb9')]){var _0x58e612=_0x139c8e['query']['$gte'][_0x2844('0x2d')](',');var _0x1dc000={};_0x1dc000[_0x58e612[0x0]]={'$gte':moment(_0x58e612[0x1])['format'](_0x2844('0xba'))};_0x123642['where']=_['merge'](_0x123642[_0x2844('0x41')],_0x1dc000);}_0x123642=_['merge']({},_0x123642,_0x139c8e['options']);return db[_0x2844('0xb2')][_0x2844('0x1f')]({'where':_0x123642[_0x2844('0x41')]})['then'](function(_0x3fd685){_0x1fdd3d['count']=_0x3fd685;if(_0x139c8e['query']['includeAll']){_0x123642[_0x2844('0xbb')]=[{'all':!![]}];}return db[_0x2844('0xb2')][_0x2844('0xbc')](_0x123642);})['then'](function(_0x1a2284){_0x1fdd3d['rows']=_0x1a2284;return _0x1fdd3d;});}})[_0x2844('0x26')](respondWithFilteredResult(_0x34eccb,_0x123642))[_0x2844('0xab')](handleError(_0x34eccb,null));};exports[_0x2844('0xbd')]=function(_0x281f33,_0x2b1b16,_0x29073c){return db[_0x2844('0x32')][_0x2844('0x59')]({'where':{'id':_0x281f33['params']['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x2b1b16,null))['then'](function(_0x5d4f5c){if(_0x5d4f5c){return _0x5d4f5c[_0x2844('0xbe')](_0x281f33[_0x2844('0xaf')]['ids'],_[_0x2844('0xb4')](_0x281f33['body'],[_0x2844('0xb5'),'id'])||{})[_0x2844('0xbf')](function(){return db[_0x2844('0xc0')][_0x2844('0xbc')]({'attributes':['id',_0x2844('0x28'),_0x2844('0x45')],'where':{'id':_0x281f33[_0x2844('0xaf')][_0x2844('0xb5')]}});})['then'](function(_0x3aebe0){socket[_0x2844('0xc1')](_0x2844('0xc2'),{'id':Number(_0x281f33[_0x2844('0xb0')]['id']),'tags':_0x3aebe0||[]});return{'id':Number(_0x281f33[_0x2844('0xb0')]['id']),'tags':_0x3aebe0||[]};});}})[_0x2844('0x26')](respondWithResult(_0x2b1b16,null))[_0x2844('0xab')](handleError(_0x2b1b16,null));};exports[_0x2844('0xc3')]=function(_0x17e1dd,_0x4bfe83,_0x18dc4c){return db['FaxInteraction'][_0x2844('0x59')]({'where':{'id':_0x17e1dd[_0x2844('0xb0')]['id']}})[_0x2844('0x26')](handleEntityNotFound(_0x4bfe83,null))[_0x2844('0x26')](function(_0x397187){if(_0x397187){return _0x397187[_0x2844('0xc3')](_0x17e1dd[_0x2844('0x37')][_0x2844('0xb5')]);}})[_0x2844('0x26')](respondWithStatusCode(_0x4bfe83,null))[_0x2844('0xab')](handleError(_0x4bfe83,null));};exports[_0x2844('0xc4')]=function(_0x1620cf,_0x37ecb6){var _0x5c92f4=moment()[_0x2844('0xc5')]()[_0x2844('0x91')]();var _0x32a63d=path['join'](config['root'],_0x2844('0xc6'),_0x2844('0xc7'),_0x2844('0xc8'));var _0x983c7b=path['join'](config['root'],_0x2844('0xc6'),_0x2844('0xc7'),_0x2844('0xc9'));var _0x1d8d96=path['join'](_0x32a63d,_0x5c92f4);var _0x387966=util['format'](_0x2844('0xca'),_0x1620cf[_0x2844('0xb0')]['id'],_0x5c92f4);var _0x5ddef7=path[_0x2844('0xcb')](_0x32a63d,_0x387966);var _0x230447=[];_0x230447['push']({'model':db['Attachment'],'as':_0x2844('0xcc'),'raw':!![]});var _0x4fd23f=[{'model':db[_0x2844('0xb2')],'as':_0x2844('0xcd'),'attributes':['id','body',_0x2844('0x70')],'include':_0x230447}];return db[_0x2844('0x32')][_0x2844('0x59')]({'where':{'id':_0x1620cf[_0x2844('0xb0')]['id']},'include':_0x4fd23f})[_0x2844('0x26')](handleEntityNotFound(_0x37ecb6,null))[_0x2844('0x26')](function(_0x1b548b){if(_0x1b548b&&_0x1b548b[_0x2844('0xcd')]){var _0x3068c2=_0x1b548b[_0x2844('0xce')]({'plain':!![]});fs[_0x2844('0xcf')](_0x1d8d96);for(var _0x30ba5e=0x0;_0x30ba5e<_0x3068c2[_0x2844('0xcd')]['length'];_0x30ba5e++){var _0xd2087f=_0x3068c2[_0x2844('0xcd')][_0x30ba5e]['Attachment'];if(_0xd2087f){var _0x275a3e=path[_0x2844('0xcb')](_0x983c7b,_0xd2087f[_0x2844('0xd0')]);if(fs[_0x2844('0xd1')](_0x275a3e)){fs[_0x2844('0xd2')](_0x275a3e)[_0x2844('0xd3')](fs['createWriteStream'](path[_0x2844('0xcb')](_0x1d8d96,_0xd2087f[_0x2844('0xd0')])));}}}return BPromise['resolve']()[_0x2844('0x26')](function(){return new BPromise(function(_0x387de9,_0x6677a){zipdir(_0x1d8d96,{'saveTo':_0x5ddef7},function(_0x103e3e,_0x4646a1){if(_0x103e3e)return _0x6677a(_0x103e3e);return _0x387de9(_0x4646a1);});})[_0x2844('0x26')](function(){return new BPromise(function(_0x3c3c67,_0x11e85c){rimraf(_0x1d8d96,function(_0x43117a){if(_0x43117a)_0x11e85c(_0x43117a);return _0x3c3c67();});});})[_0x2844('0x26')](function(){return _0x37ecb6[_0x2844('0xc4')](_0x5ddef7,_0x387966,function(_0xd96ea7){if(_0xd96ea7){console[_0x2844('0xd4')](_0x2844('0xd5'),_0xd96ea7);}else{fs[_0x2844('0xd6')](_0x5ddef7);}});});});}else{return _0x37ecb6['sendStatus'](0xc8);}})[_0x2844('0xab')](handleError(_0x37ecb6,null));}; \ No newline at end of file +var _0xcb60=['intersection','fields','hasOwnProperty','order','sort','where','filters','select','field','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','forEach','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','FaxInteraction','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','params','includeAll','include','options','create','body','describe','FaxMessage','omit','ids','getMessages','findOne','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','Tag','color','faxInteractionTags:save','removeTags','download','unix','root','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','Users','map','TagIds','split','Tags','push','catch','index','rawAttributes','fieldName','type','model','keys','query','attributes'];(function(_0x327c31,_0xab313d){var _0x1a3547=function(_0x47558b){while(--_0x47558b){_0x327c31['push'](_0x327c31['shift']());}};_0x1a3547(++_0xab313d);}(_0xcb60,0x9d));var _0x0cb6=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xcb60[_0x4e5552];return _0x60a338;};'use strict';var emlformat=require(_0x0cb6('0x0'));var rimraf=require(_0x0cb6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cb6('0x2'));var rp=require('request-promise');var moment=require(_0x0cb6('0x3'));var BPromise=require(_0x0cb6('0x4'));var Mustache=require('mustache');var util=require(_0x0cb6('0x5'));var path=require(_0x0cb6('0x6'));var sox=require(_0x0cb6('0x7'));var csv=require(_0x0cb6('0x8'));var ejs=require(_0x0cb6('0x9'));var fs=require('fs');var fs_extra=require(_0x0cb6('0xa'));var _=require(_0x0cb6('0xb'));var squel=require(_0x0cb6('0xc'));var crypto=require('crypto');var jsforce=require(_0x0cb6('0xd'));var deskjs=require(_0x0cb6('0xe'));var toCsv=require(_0x0cb6('0x8'));var querystring=require(_0x0cb6('0xf'));var Papa=require(_0x0cb6('0x10'));var Redis=require('ioredis');var authService=require(_0x0cb6('0x11'));var qs=require(_0x0cb6('0x12'));var as=require(_0x0cb6('0x13'));var hardwareService=require(_0x0cb6('0x14'));var logger=require(_0x0cb6('0x15'))(_0x0cb6('0x16'));var utils=require(_0x0cb6('0x17'));var config=require(_0x0cb6('0x18'));var licenseUtil=require(_0x0cb6('0x19'));var db=require('../../mysqldb')['db'];config[_0x0cb6('0x1a')]=_[_0x0cb6('0x1b')](config['redis'],{'host':_0x0cb6('0x1c'),'port':0x18eb});var socket=require(_0x0cb6('0x1d'))(new Redis(config[_0x0cb6('0x1a')]));require('./faxInteraction.socket')[_0x0cb6('0x1e')](socket);function respondWithStatusCode(_0x548b54,_0x472460){_0x472460=_0x472460||0xcc;return function(_0x2f232a){if(_0x2f232a){return _0x548b54['sendStatus'](_0x472460);}return _0x548b54[_0x0cb6('0x1f')](_0x472460)[_0x0cb6('0x20')]();};}function respondWithResult(_0x29e05f,_0x4bfea3){_0x4bfea3=_0x4bfea3||0xc8;return function(_0x590d6b){if(_0x590d6b){return _0x29e05f['status'](_0x4bfea3)[_0x0cb6('0x21')](_0x590d6b);}};}function respondWithFilteredResult(_0x351d7a,_0x28b0e0){return function(_0x990cf2){if(_0x990cf2){var _0x92d8df=typeof _0x28b0e0[_0x0cb6('0x22')]===_0x0cb6('0x23')&&typeof _0x28b0e0['limit']===_0x0cb6('0x23');var _0x1a3c67=_0x990cf2['count'];var _0x443bb2=_0x92d8df?0x0:_0x28b0e0[_0x0cb6('0x22')];var _0xca6cd6=_0x92d8df?_0x990cf2[_0x0cb6('0x24')]:_0x28b0e0[_0x0cb6('0x22')]+_0x28b0e0[_0x0cb6('0x25')];var _0x2a0707;if(_0xca6cd6>=_0x1a3c67){_0xca6cd6=_0x1a3c67;_0x2a0707=0xc8;}else{_0x2a0707=0xce;}_0x351d7a['status'](_0x2a0707);return _0x351d7a[_0x0cb6('0x26')](_0x0cb6('0x27'),_0x443bb2+'-'+_0xca6cd6+'/'+_0x1a3c67)[_0x0cb6('0x21')](_0x990cf2);}return null;};}function patchUpdates(_0xb732d0){return function(_0x34a65a){try{jsonpatch[_0x0cb6('0x28')](_0x34a65a,_0xb732d0,!![]);}catch(_0x3ae634){return BPromise[_0x0cb6('0x29')](_0x3ae634);}return _0x34a65a['save']();};}function saveUpdates(_0x298fae,_0xb5c0a0){return function(_0x116d97){if(_0x116d97){return _0x116d97[_0x0cb6('0x2a')](_0x298fae)[_0x0cb6('0x2b')](function(_0x3ab2e4){return _0x3ab2e4;});}return null;};}function removeEntity(_0x3df03a,_0x34cf35){return function(_0x30f624){if(_0x30f624){return _0x30f624['destroy']()[_0x0cb6('0x2b')](function(){_0x3df03a[_0x0cb6('0x1f')](0xcc)[_0x0cb6('0x20')]();});}};}function handleEntityNotFound(_0x50c125,_0xd51b5){return function(_0x4931cf){if(!_0x4931cf){_0x50c125[_0x0cb6('0x2c')](0x194);}return _0x4931cf;};}function handleError(_0x2ef97a,_0x9ea8c1){_0x9ea8c1=_0x9ea8c1||0x1f4;return function(_0x26482b){logger[_0x0cb6('0x2d')](_0x26482b[_0x0cb6('0x2e')]);if(_0x26482b[_0x0cb6('0x2f')]){delete _0x26482b[_0x0cb6('0x2f')];}_0x2ef97a[_0x0cb6('0x1f')](_0x9ea8c1)[_0x0cb6('0x30')](_0x26482b);};}function getInteractionUsers(_0x12d410,_0x464b81){return new BPromise(function(_0x3ee2c9,_0x1e5190){try{if(_0x464b81[_0x12d410['id']]){_0x12d410[_0x0cb6('0x31')]=_[_0x0cb6('0x32')](_0x464b81[_0x12d410['id']],function(_0x4f4ffe){return{'id':_0x4f4ffe['id'],'fullname':_0x4f4ffe['fullname']};});}}catch(_0x39130f){_0x1e5190(_0x39130f);}_0x3ee2c9(_0x12d410);});}function getInteractionTags(_0x156bf5,_0x31b9a1){return new BPromise(function(_0x2d7da2,_0x5124c8){try{if(_0x156bf5[_0x0cb6('0x33')]){_0x156bf5['Tags']=[];_0x156bf5['TagIds'][_0x0cb6('0x34')](',')['forEach'](function(_0x3f59fe){_0x156bf5[_0x0cb6('0x35')][_0x0cb6('0x36')](_0x31b9a1[_0x3f59fe]);});}delete _0x156bf5[_0x0cb6('0x33')];}catch(_0x177baa){_0x5124c8(_0x177baa);}_0x2d7da2(_0x156bf5);});}function updateFaxInteraction(_0x6afbda,_0x1c935f,_0x1abd74){return new BPromise(function(_0x32eb7c,_0x1887f4){return getInteractionUsers(_0x6afbda,_0x1abd74)[_0x0cb6('0x2b')](function(_0x4fe65d){return getInteractionTags(_0x4fe65d,_0x1c935f);})[_0x0cb6('0x2b')](function(_0x11e0a4){_0x32eb7c(_0x11e0a4);})[_0x0cb6('0x37')](function(_0x44b0fe){_0x1887f4(_0x44b0fe);});});}exports[_0x0cb6('0x38')]=function(_0x578202,_0x4b1d7f){var _0x15601d={},_0x2cc4ca={},_0x55ad={'count':0x0,'rows':[]};var _0x3e0ca7=_[_0x0cb6('0x32')](db['FaxInteraction'][_0x0cb6('0x39')],function(_0x53744a){return{'name':_0x53744a[_0x0cb6('0x3a')],'type':_0x53744a[_0x0cb6('0x3b')]['key']};});_0x2cc4ca[_0x0cb6('0x3c')]=_[_0x0cb6('0x32')](_0x3e0ca7,_0x0cb6('0x2f'));_0x2cc4ca['query']=_[_0x0cb6('0x3d')](_0x578202[_0x0cb6('0x3e')]);_0x2cc4ca['filters']=_['intersection'](_0x2cc4ca['model'],_0x2cc4ca[_0x0cb6('0x3e')]);_0x15601d[_0x0cb6('0x3f')]=_[_0x0cb6('0x40')](_0x2cc4ca['model'],qs[_0x0cb6('0x41')](_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x41')]));_0x15601d[_0x0cb6('0x3f')]=_0x15601d[_0x0cb6('0x3f')]['length']?_0x15601d[_0x0cb6('0x3f')]:_0x2cc4ca[_0x0cb6('0x3c')];if(!_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x42')]('nolimit')){_0x15601d[_0x0cb6('0x25')]=qs[_0x0cb6('0x25')](_0x578202['query'][_0x0cb6('0x25')]);_0x15601d[_0x0cb6('0x22')]=qs[_0x0cb6('0x22')](_0x578202['query'][_0x0cb6('0x22')]);}_0x15601d[_0x0cb6('0x43')]=qs[_0x0cb6('0x44')](_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x44')]);_0x15601d[_0x0cb6('0x45')]=qs['filters'](_['pick'](_0x578202['query'],_0x2cc4ca[_0x0cb6('0x46')]),_0x3e0ca7);var _0x3b275d=[];var _0x5b1130=squel[_0x0cb6('0x47')]()[_0x0cb6('0x48')]('id')['field']('name')['field']('color')[_0x0cb6('0x49')](_0x0cb6('0x4a'));var _0x2436c1=squel['select']()['field'](_0x0cb6('0x4b'))[_0x0cb6('0x48')](_0x0cb6('0x4c'))[_0x0cb6('0x48')]('ui.FaxInteractionId')[_0x0cb6('0x49')]('user_has_fax_interactions','ui')[_0x0cb6('0x4d')](_0x0cb6('0x4e'),'u',_0x0cb6('0x4f'));var _0x5d2ab9=squel[_0x0cb6('0x47')]()[_0x0cb6('0x49')](_0x0cb6('0x50'),'i')[_0x0cb6('0x4d')](_0x0cb6('0x51'),'c',_0x0cb6('0x52'))[_0x0cb6('0x4d')](_0x0cb6('0x4e'),'o',_0x0cb6('0x53'))[_0x0cb6('0x4d')](_0x0cb6('0x54'),'a',_0x0cb6('0x55'))[_0x0cb6('0x4d')](_0x0cb6('0x56'),'me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x0cb6('0x57'),'it',_0x0cb6('0x58'))[_0x0cb6('0x4d')](_0x0cb6('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x12fc6a=squel[_0x0cb6('0x59')]();var _0x4e07bb=[];var _0x5cd64a=squel[_0x0cb6('0x59')]();var _0x14f3f7;if(_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x5a')]){_0x14f3f7=as[_0x0cb6('0x5b')](_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x5a')]);var _0x2a760c=_0x14f3f7['sqlOperator'];for(var _0x358440=0x0;_0x358440<_0x14f3f7[_0x0cb6('0x5c')]['length'];_0x358440++){var _0x333317=_0x14f3f7[_0x0cb6('0x5c')][_0x358440];var _0x2c0ea4='i';var _0x2586a7=_[_0x0cb6('0x5d')](_0x3e0ca7,[_0x0cb6('0x2f'),_0x333317[_0x0cb6('0x48')]]);if(!_0x2586a7){switch(_0x333317['field']){case _0x0cb6('0x5e'):if(_0x333317[_0x0cb6('0x5f')]==0x1){_0x5d2ab9['having']('`'+_0x333317[_0x0cb6('0x48')]+_0x0cb6('0x60'));}else{_0x5d2ab9[_0x0cb6('0x61')]('`'+_0x333317['field']+_0x0cb6('0x62'));}break;case _0x0cb6('0x63'):if(_0x333317['operator']==='$substring'){if(_0x333317[_0x0cb6('0x5f')][_0x0cb6('0x34')]('\x20')[_0x0cb6('0x64')]>0x1){_0x12fc6a[_0x2a760c](_0x0cb6('0x65'),qs[_0x0cb6('0x66')](_0x333317[_0x0cb6('0x5f')]),null);}else{var _0x21f34e='%'+_0x333317[_0x0cb6('0x5f')]+'%';_0x12fc6a[_0x2a760c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x21f34e,_0x21f34e,_0x21f34e);}}else{_0x2586a7=_[_0x0cb6('0x5d')](_0x3e0ca7,[_0x0cb6('0x2f'),_0x0cb6('0x67')]);_0x333317[_0x0cb6('0x48')]=_0x0cb6('0x67');_0x35aa1f=as[_0x0cb6('0x68')](_0x2c0ea4,_0x2586a7['type'],_0x333317);_0x12fc6a[_0x2a760c](_0x35aa1f['text'],_0x35aa1f['value'][_0x0cb6('0x69')],_0x35aa1f[_0x0cb6('0x5f')][_0x0cb6('0x20')]);}break;case'Tag':var _0x1a4c43=_0x333317[_0x0cb6('0x5f')][_0x0cb6('0x34')](',')[_0x0cb6('0x32')](function(_0x3e4821){return Number(_0x3e4821);});_0x1a4c43[_0x0cb6('0x6a')](function(_0x4ecfd8){_0x5cd64a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4ecfd8+',%');});_0x4e07bb=_[_0x0cb6('0x6b')](_0x4e07bb,_0x1a4c43);break;case _0x0cb6('0x6c'):if(_0x333317[_0x0cb6('0x6d')]===_0x0cb6('0x6e')){_0x12fc6a[_0x2a760c](_0x0cb6('0x6f'),'%'+_0x333317[_0x0cb6('0x5f')]+'%',null);}else{_0x2586a7=_[_0x0cb6('0x5d')](_0x3e0ca7,[_0x0cb6('0x2f'),_0x0cb6('0x70')]);_0x333317[_0x0cb6('0x48')]=_0x0cb6('0x70');_0x35aa1f=as[_0x0cb6('0x68')](_0x2c0ea4,_0x2586a7[_0x0cb6('0x3b')],_0x333317);_0x12fc6a[_0x2a760c](_0x35aa1f['text'],_0x35aa1f[_0x0cb6('0x5f')][_0x0cb6('0x69')],_0x35aa1f['value'][_0x0cb6('0x20')]);}break;case'body':_0x35aa1f=as[_0x0cb6('0x68')]('me',null,_0x333317);_0x12fc6a[_0x2a760c](_0x35aa1f[_0x0cb6('0x71')],_0x35aa1f[_0x0cb6('0x5f')][_0x0cb6('0x69')],_0x35aa1f[_0x0cb6('0x5f')][_0x0cb6('0x20')]);break;}}else{var _0x35aa1f=as[_0x0cb6('0x68')](_0x2c0ea4,_0x2586a7[_0x0cb6('0x3b')],_0x333317);_0x12fc6a[_0x2a760c](_0x35aa1f[_0x0cb6('0x71')],_0x35aa1f[_0x0cb6('0x5f')][_0x0cb6('0x69')],_0x35aa1f['value'][_0x0cb6('0x20')]);}}}else{var _0x509927=_(_0x578202[_0x0cb6('0x3e')])[_0x0cb6('0x3d')]()[_0x0cb6('0x32')](function(_0x509221){return _[_0x0cb6('0x72')](_0x3e0ca7,['name',_0x509221])?_0x509221:undefined;})[_0x0cb6('0x73')]()['value']();if(!_[_0x0cb6('0x74')](_0x509927)){_0x509927[_0x0cb6('0x6a')](function(_0x5f3e11){if(_0x5f3e11===_0x0cb6('0x75')){_0x5d2ab9[_0x0cb6('0x45')]('i.FaxAccountId\x20IN\x20?',[][_0x0cb6('0x76')](_0x578202[_0x0cb6('0x3e')][_0x5f3e11]));}else if(_0x5f3e11===_0x0cb6('0x77')){var _0x377cb3=JSON[_0x0cb6('0x78')](_0x578202['query'][_0x5f3e11])[_0x0cb6('0x79')];var _0x4fc21b=JSON['parse'](_0x578202[_0x0cb6('0x3e')][_0x5f3e11])[_0x0cb6('0x7a')];_0x5d2ab9[_0x0cb6('0x45')](_0x0cb6('0x7b'),_0x377cb3,_0x4fc21b);}else{if(_0x578202['query'][_0x5f3e11]===_0x0cb6('0x7c')){_0x5d2ab9[_0x0cb6('0x45')]('i.'+_0x5f3e11+'\x20IS\x20NULL');}else{_0x5d2ab9['where']('i.'+_0x5f3e11+_0x0cb6('0x7d'),_0x578202['query'][_0x5f3e11]);}}});}if(_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x7e')]){if(_0x578202[_0x0cb6('0x3e')]['read']==0x1){_0x5d2ab9[_0x0cb6('0x61')]('`unreadMessages`\x20=\x200');}else{_0x5d2ab9[_0x0cb6('0x61')](_0x0cb6('0x7f'));}}if(_0x578202['query']['tag']){_0x4e07bb=_[_0x0cb6('0x80')](_0x578202['query'][_0x0cb6('0x81')])?_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x81')]:new Array(_0x578202['query'][_0x0cb6('0x81')]);_0x4e07bb['forEach'](function(_0x152f23){_0x5cd64a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x152f23+',%');});}if(_0x578202[_0x0cb6('0x3e')]['filter']){var _0x4240a9=_0x578202['query']['filter'][_0x0cb6('0x82')]('\x5c','\x5c\x5c')[_0x0cb6('0x82')](/'/g,'\x27\x27');if(qs[_0x0cb6('0x83')](_0x4240a9)){_0x12fc6a['or'](_0x0cb6('0x84'),_0x4240a9+'%')['or'](_0x0cb6('0x85'),_0x4240a9+'%');}_0x12fc6a['or'](_0x0cb6('0x86'),_0x4240a9+'%');}}_0x5d2ab9[_0x0cb6('0x45')](_0x12fc6a);_0x5d2ab9[_0x0cb6('0x87')](_0x0cb6('0x88'));var _0x2964ea={'type':db[_0x0cb6('0x89')][_0x0cb6('0x8a')][_0x0cb6('0x8b')],'raw':!![]};var _0x3442ab=_0x5d2ab9['clone']();_0x3442ab[_0x0cb6('0x48')](_0x0cb6('0x88'));_0x3442ab[_0x0cb6('0x48')](_0x0cb6('0x8c'),'unreadMessages');if(_0x15601d['order']){_0x15601d[_0x0cb6('0x43')][_0x0cb6('0x6a')](function(_0x25c365){var _0x23fa42=_0x25c365[0x0]===_0x0cb6('0x8d')?_0x25c365[0x0]:'i.'+_0x25c365[0x0];_0x5d2ab9[_0x0cb6('0x43')](_0x23fa42,_0x25c365[0x1]===_0x0cb6('0x8e')?![]:!![]);});}if(!_[_0x0cb6('0x74')](_0x4e07bb)){_0x5d2ab9[_0x0cb6('0x61')](_0x5cd64a);_0x3442ab[_0x0cb6('0x45')](_0x0cb6('0x8f'),_0x4e07bb);}BPromise['resolve']()[_0x0cb6('0x2b')](function(){if(!_0x14f3f7){if(_0x578202['query'][_0x0cb6('0x75')])return;_0x3442ab[_0x0cb6('0x45')](_0x0cb6('0x90'));_0x5d2ab9['where'](_0x0cb6('0x90'));return;}if(_0x578202['user']['role']!==_0x0cb6('0x91'))return;return _0x578202[_0x0cb6('0x92')][_0x0cb6('0x93')]({'attributes':['id'],'raw':!![]})[_0x0cb6('0x2b')](function(_0x58037d){if(_['isEmpty'](_0x58037d)){_0x3442ab['where'](_0x0cb6('0x94'));_0x5d2ab9['where'](_0x0cb6('0x94'));}else{_0x3442ab[_0x0cb6('0x45')](_0x0cb6('0x95'),_['map'](_0x58037d,'id'));_0x5d2ab9[_0x0cb6('0x45')](_0x0cb6('0x95'),_[_0x0cb6('0x32')](_0x58037d,'id'));}});})[_0x0cb6('0x2b')](function(){if(_0x578202[_0x0cb6('0x92')][_0x0cb6('0x96')]===_0x0cb6('0x91')&&!_0x14f3f7&&!_0x578202[_0x0cb6('0x3e')][_0x0cb6('0x75')])return[];return db[_0x0cb6('0x97')]['query'](_0x3442ab[_0x0cb6('0x98')](),_0x2964ea);})[_0x0cb6('0x2b')](function(_0x50a5db){_0x55ad[_0x0cb6('0x24')]=_0x50a5db[_0x0cb6('0x64')];if(_0x55ad[_0x0cb6('0x24')]===0x0)return[];return db['sequelize'][_0x0cb6('0x3e')](_0x5b1130[_0x0cb6('0x98')](),_0x2964ea)[_0x0cb6('0x2b')](function(_0x46663d){_0x3b275d=_[_0x0cb6('0x99')](_0x46663d,'id');_0x2964ea=_[_0x0cb6('0x9a')](_0x2964ea,{'model':db[_0x0cb6('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x578202[_0x0cb6('0x3e')]['fields']){_0x15601d[_0x0cb6('0x3f')][_0x0cb6('0x6a')](function(_0x253a7){_0x5d2ab9[_0x0cb6('0x48')]('i.'+_0x253a7);});}else{_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0x8c'),'unreadMessages');_0x5d2ab9[_0x0cb6('0x48')]('a.key',_0x0cb6('0x9c'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0x9d'),_0x0cb6('0x9e'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0x9f'),_0x0cb6('0x8d'));_0x5d2ab9['field'](_0x0cb6('0xa0'));_0x5d2ab9[_0x0cb6('0x48')]('c.firstName',_0x0cb6('0xa1'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xa2'),_0x0cb6('0xa3'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xa4'),_0x0cb6('0xa5'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xa6'),_0x0cb6('0xa7'));_0x5d2ab9['field'](_0x0cb6('0xa8'),'Contact.mobile');_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xa9'),_0x0cb6('0xaa'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xab'),'Owner.fullname');_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xac'),_0x0cb6('0xad'));_0x5d2ab9[_0x0cb6('0x48')](_0x0cb6('0xae'),_0x0cb6('0x33'));}if(_0x15601d[_0x0cb6('0x25')])_0x5d2ab9[_0x0cb6('0x25')](_0x15601d[_0x0cb6('0x25')]);if(_0x15601d['offset'])_0x5d2ab9[_0x0cb6('0x22')](_0x15601d['offset']);return db[_0x0cb6('0x97')]['query'](_0x5d2ab9[_0x0cb6('0x98')](),_0x2964ea);})[_0x0cb6('0x2b')](function(_0x2e13bf){if(_0x2e13bf[_0x0cb6('0x64')]>0x0)_0x2436c1['where'](_0x0cb6('0xaf'),_[_0x0cb6('0x32')](_0x2e13bf,'id'));return db[_0x0cb6('0x97')]['query'](_0x2436c1[_0x0cb6('0x98')](),_0x2964ea)[_0x0cb6('0x2b')](function(_0x2b349a){var _0x3c27af=_['groupBy'](_0x2b349a,_0x0cb6('0xb0'));var _0x1bac18=[];_0x2e13bf[_0x0cb6('0x6a')](function(_0x92af36){_0x1bac18['push'](updateFaxInteraction(_0x92af36,_0x3b275d,_0x3c27af));});return BPromise[_0x0cb6('0xb1')](_0x1bac18);});});})['then'](function(_0x29f33d){_0x55ad['rows']=_0x29f33d;return _0x55ad;})[_0x0cb6('0x2b')](respondWithFilteredResult(_0x4b1d7f,_0x15601d))[_0x0cb6('0x37')](handleError(_0x4b1d7f,null));};exports[_0x0cb6('0xb2')]=function(_0x563aa6,_0x4b3aef){var _0x76194a={'raw':![],'where':{'id':_0x563aa6[_0x0cb6('0xb3')]['id']}},_0x5d7835={};_0x5d7835[_0x0cb6('0x3c')]=_[_0x0cb6('0x3d')](db[_0x0cb6('0x9b')]['rawAttributes']);_0x5d7835['query']=_['keys'](_0x563aa6['query']);_0x5d7835['filters']=_[_0x0cb6('0x40')](_0x5d7835[_0x0cb6('0x3c')],_0x5d7835[_0x0cb6('0x3e')]);_0x76194a['attributes']=_['intersection'](_0x5d7835[_0x0cb6('0x3c')],qs[_0x0cb6('0x41')](_0x563aa6[_0x0cb6('0x3e')][_0x0cb6('0x41')]));_0x76194a[_0x0cb6('0x3f')]=_0x76194a[_0x0cb6('0x3f')][_0x0cb6('0x64')]?_0x76194a[_0x0cb6('0x3f')]:_0x5d7835['model'];if(_0x563aa6[_0x0cb6('0x3e')][_0x0cb6('0xb4')]){_0x76194a[_0x0cb6('0xb5')]=[{'all':!![]}];}_0x76194a=_['merge']({},_0x76194a,_0x563aa6[_0x0cb6('0xb6')]);return db[_0x0cb6('0x9b')]['find'](_0x76194a)['then'](handleEntityNotFound(_0x4b3aef,null))[_0x0cb6('0x2b')](respondWithResult(_0x4b3aef,null))[_0x0cb6('0x37')](handleError(_0x4b3aef,null));};exports[_0x0cb6('0xb7')]=function(_0x22b59a,_0xa257cc){return db[_0x0cb6('0x9b')][_0x0cb6('0xb7')](_0x22b59a[_0x0cb6('0xb8')],{})[_0x0cb6('0x2b')](respondWithResult(_0xa257cc,0xc9))[_0x0cb6('0x37')](handleError(_0xa257cc,null));};exports['update']=function(_0x5c17b2,_0x5d15e7){if(_0x5c17b2[_0x0cb6('0xb8')]['id']){delete _0x5c17b2[_0x0cb6('0xb8')]['id'];}return db['FaxInteraction'][_0x0cb6('0x5d')]({'where':{'id':_0x5c17b2[_0x0cb6('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5d15e7,null))[_0x0cb6('0x2b')](saveUpdates(_0x5c17b2[_0x0cb6('0xb8')],null))[_0x0cb6('0x2b')](respondWithResult(_0x5d15e7,null))[_0x0cb6('0x37')](handleError(_0x5d15e7,null));};exports['destroy']=function(_0xa06108,_0xaa8f86){return db[_0x0cb6('0x9b')][_0x0cb6('0x5d')]({'where':{'id':_0xa06108[_0x0cb6('0xb3')]['id']}})['then'](handleEntityNotFound(_0xaa8f86,null))[_0x0cb6('0x2b')](removeEntity(_0xaa8f86,null))[_0x0cb6('0x37')](handleError(_0xaa8f86,null));};exports['describe']=function(_0x5a677e,_0x20bb3c){return db[_0x0cb6('0x9b')][_0x0cb6('0xb9')]()[_0x0cb6('0x2b')](respondWithResult(_0x20bb3c,null))[_0x0cb6('0x37')](handleError(_0x20bb3c,null));};exports['addMessage']=function(_0x19b8a5,_0x408da7,_0x44ea24){return db[_0x0cb6('0xba')][_0x0cb6('0x5d')]({'where':{'id':_0x19b8a5['params']['id']}})[_0x0cb6('0x2b')](handleEntityNotFound(_0x408da7,null))[_0x0cb6('0x2b')](function(_0x5b1a12){if(_0x5b1a12){return _0x5b1a12['addMessage'](_0x19b8a5[_0x0cb6('0xb8')]['ids'],_[_0x0cb6('0xbb')](_0x19b8a5[_0x0cb6('0xb8')],[_0x0cb6('0xbc'),'id'])||{});}})[_0x0cb6('0x2b')](respondWithResult(_0x408da7,null))[_0x0cb6('0x37')](handleError(_0x408da7,null));};exports[_0x0cb6('0xbd')]=function(_0xb1c709,_0x280549,_0x1e16bf){var _0x131580={'raw':![],'where':{}};var _0x3e841a={};var _0x4aaca8={'count':0x0,'rows':[]};return db[_0x0cb6('0x9b')][_0x0cb6('0xbe')]({'where':{'id':_0xb1c709[_0x0cb6('0xb3')]['id']}})[_0x0cb6('0x2b')](handleEntityNotFound(_0x280549,null))[_0x0cb6('0x2b')](function(_0x568c8a){if(_0x568c8a){_0x3e841a['model']=_[_0x0cb6('0x3d')](db[_0x0cb6('0xba')][_0x0cb6('0x39')]);_0x3e841a['query']=_[_0x0cb6('0x3d')](_0xb1c709[_0x0cb6('0x3e')]);_0x3e841a[_0x0cb6('0x46')]=_[_0x0cb6('0x40')](_0x3e841a[_0x0cb6('0x3c')],_0x3e841a[_0x0cb6('0x3e')]);_0x131580[_0x0cb6('0x3f')]=_[_0x0cb6('0x40')](_0x3e841a[_0x0cb6('0x3c')],qs[_0x0cb6('0x41')](_0xb1c709['query'][_0x0cb6('0x41')]));_0x131580[_0x0cb6('0x3f')]=_0x131580['attributes'][_0x0cb6('0x64')]?_0x131580[_0x0cb6('0x3f')]:_0x3e841a['model'];if(!_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0x42')]('nolimit')){_0x131580[_0x0cb6('0x25')]=qs['limit'](_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0x25')]);_0x131580[_0x0cb6('0x22')]=qs[_0x0cb6('0x22')](_0xb1c709['query']['offset']);}_0x131580['order']=qs[_0x0cb6('0x44')](_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0x44')]);_0x131580[_0x0cb6('0x45')]=qs['filters'](_[_0x0cb6('0xbf')](_0xb1c709[_0x0cb6('0x3e')],_0x3e841a['filters']));_0x131580[_0x0cb6('0x45')][_0x0cb6('0xb0')]=_0x568c8a['id'];if(_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0xc0')]){_0x131580[_0x0cb6('0x45')]=_[_0x0cb6('0x9a')](_0x131580[_0x0cb6('0x45')],{'$or':_[_0x0cb6('0x32')](_0x131580[_0x0cb6('0x3f')],function(_0x33a4a8){var _0x3accbb={};_0x3accbb[_0x33a4a8]={'$like':'%'+_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0xc0')]+'%'};return _0x3accbb;})});}if(_0xb1c709[_0x0cb6('0x3e')][_0x0cb6('0x79')]){var _0x29fd75=_0xb1c709[_0x0cb6('0x3e')]['$gte']['split'](',');var _0xa9f215={};_0xa9f215[_0x29fd75[0x0]]={'$gte':moment(_0x29fd75[0x1])[_0x0cb6('0xc1')](_0x0cb6('0xc2'))};_0x131580[_0x0cb6('0x45')]=_[_0x0cb6('0x9a')](_0x131580['where'],_0xa9f215);}_0x131580=_[_0x0cb6('0x9a')]({},_0x131580,_0xb1c709['options']);return db[_0x0cb6('0xba')][_0x0cb6('0x24')]({'where':_0x131580[_0x0cb6('0x45')]})[_0x0cb6('0x2b')](function(_0x37622e){_0x4aaca8[_0x0cb6('0x24')]=_0x37622e;if(_0xb1c709['query'][_0x0cb6('0xb4')]){_0x131580['include']=[{'all':!![]}];}return db['FaxMessage'][_0x0cb6('0xc3')](_0x131580);})['then'](function(_0x1d76af){_0x4aaca8[_0x0cb6('0xc4')]=_0x1d76af;return _0x4aaca8;});}})[_0x0cb6('0x2b')](respondWithFilteredResult(_0x280549,_0x131580))['catch'](handleError(_0x280549,null));};exports[_0x0cb6('0xc5')]=function(_0x282611,_0x5c6782,_0xbeb90b){return db[_0x0cb6('0x9b')][_0x0cb6('0x5d')]({'where':{'id':_0x282611['params']['id']}})['then'](handleEntityNotFound(_0x5c6782,null))['then'](function(_0x45212d){if(_0x45212d){return _0x45212d[_0x0cb6('0xc6')](_0x282611['body']['ids'],_[_0x0cb6('0xbb')](_0x282611['body'],['ids','id'])||{})['spread'](function(){return db[_0x0cb6('0xc7')][_0x0cb6('0xc3')]({'attributes':['id',_0x0cb6('0x2f'),_0x0cb6('0xc8')],'where':{'id':_0x282611[_0x0cb6('0xb8')][_0x0cb6('0xbc')]}});})[_0x0cb6('0x2b')](function(_0x42efa7){socket['emit'](_0x0cb6('0xc9'),{'id':Number(_0x282611[_0x0cb6('0xb3')]['id']),'tags':_0x42efa7||[]});return{'id':Number(_0x282611['params']['id']),'tags':_0x42efa7||[]};});}})[_0x0cb6('0x2b')](respondWithResult(_0x5c6782,null))['catch'](handleError(_0x5c6782,null));};exports['removeTags']=function(_0x17a414,_0x2e5bd4,_0x3e1e5f){return db[_0x0cb6('0x9b')][_0x0cb6('0x5d')]({'where':{'id':_0x17a414[_0x0cb6('0xb3')]['id']}})[_0x0cb6('0x2b')](handleEntityNotFound(_0x2e5bd4,null))['then'](function(_0x3a7f6a){if(_0x3a7f6a){return _0x3a7f6a[_0x0cb6('0xca')](_0x17a414[_0x0cb6('0x3e')][_0x0cb6('0xbc')]);}})[_0x0cb6('0x2b')](respondWithStatusCode(_0x2e5bd4,null))[_0x0cb6('0x37')](handleError(_0x2e5bd4,null));};exports[_0x0cb6('0xcb')]=function(_0x39f400,_0x16a5bc){var _0x3549bf=moment()[_0x0cb6('0xcc')]()['toString']();var _0x2b7f45=path['join'](config[_0x0cb6('0xcd')],'server',_0x0cb6('0xce'),_0x0cb6('0xcf'));var _0x1c461c=path[_0x0cb6('0xd0')](config['root'],'server',_0x0cb6('0xce'),_0x0cb6('0xd1'));var _0x339eff=path[_0x0cb6('0xd0')](_0x2b7f45,_0x3549bf);var _0x32ce73=util[_0x0cb6('0xc1')](_0x0cb6('0xd2'),_0x39f400[_0x0cb6('0xb3')]['id'],_0x3549bf);var _0x4e2ede=path[_0x0cb6('0xd0')](_0x2b7f45,_0x32ce73);var _0x3b5c6c=[];_0x3b5c6c[_0x0cb6('0x36')]({'model':db[_0x0cb6('0xd3')],'as':_0x0cb6('0xd3'),'raw':!![]});var _0x584322=[{'model':db[_0x0cb6('0xba')],'as':_0x0cb6('0xd4'),'attributes':['id',_0x0cb6('0xb8'),'createdAt'],'include':_0x3b5c6c}];return db[_0x0cb6('0x9b')][_0x0cb6('0x5d')]({'where':{'id':_0x39f400['params']['id']},'include':_0x584322})[_0x0cb6('0x2b')](handleEntityNotFound(_0x16a5bc,null))['then'](function(_0x525c1c){if(_0x525c1c&&_0x525c1c[_0x0cb6('0xd4')]){var _0x47570d=_0x525c1c['get']({'plain':!![]});fs[_0x0cb6('0xd5')](_0x339eff);for(var _0x180802=0x0;_0x180802<_0x47570d[_0x0cb6('0xd4')]['length'];_0x180802++){var _0x29c2e4=_0x47570d[_0x0cb6('0xd4')][_0x180802][_0x0cb6('0xd3')];if(_0x29c2e4){var _0x5d70e6=path[_0x0cb6('0xd0')](_0x1c461c,_0x29c2e4[_0x0cb6('0xd6')]);if(fs[_0x0cb6('0xd7')](_0x5d70e6)){fs[_0x0cb6('0xd8')](_0x5d70e6)[_0x0cb6('0xd9')](fs['createWriteStream'](path[_0x0cb6('0xd0')](_0x339eff,_0x29c2e4[_0x0cb6('0xd6')])));}}}return BPromise[_0x0cb6('0xda')]()[_0x0cb6('0x2b')](function(){return new BPromise(function(_0x5cec38,_0x501624){zipdir(_0x339eff,{'saveTo':_0x4e2ede},function(_0x378b27,_0x425849){if(_0x378b27)return _0x501624(_0x378b27);return _0x5cec38(_0x425849);});})['then'](function(){return new BPromise(function(_0x3c052a,_0x31aeed){rimraf(_0x339eff,function(_0x571db0){if(_0x571db0)_0x31aeed(_0x571db0);return _0x3c052a();});});})[_0x0cb6('0x2b')](function(){return _0x16a5bc['download'](_0x4e2ede,_0x32ce73,function(_0x5bd96c){if(_0x5bd96c){console['log'](_0x0cb6('0xdb'),_0x5bd96c);}else{fs[_0x0cb6('0xdc')](_0x4e2ede);}});});});}else{return _0x16a5bc[_0x0cb6('0x2c')](0xc8);}})[_0x0cb6('0x37')](handleError(_0x16a5bc,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 55b441f..f98b89b 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 _0xa104=['then','unreadMessages','emit','catch','hasOwnProperty','exports','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','remove','setDataValue','findAll'];(function(_0x25450d,_0x1f9ffe){var _0x1e7c06=function(_0x5a208f){while(--_0x5a208f){_0x25450d['push'](_0x25450d['shift']());}};_0x1e7c06(++_0x1f9ffe);}(_0xa104,0x1e2));var _0x4a10=function(_0x41698d,_0x430142){_0x41698d=_0x41698d-0x0;var _0x50f4c0=_0xa104[_0x41698d];return _0x50f4c0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x4a10('0x0')];var FaxMessage=require(_0x4a10('0x1'))['db'][_0x4a10('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4a10('0x3')](0x0);var events={'afterCreate':_0x4a10('0x4'),'afterUpdate':'update','afterDestroy':_0x4a10('0x5')};function emitEvent(_0x19e9fd){return function(_0x317115,_0x33a36e,_0x4be77c){_0x317115['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2fe3e4){_0x317115[_0x4a10('0x6')]('Users',_0x2fe3e4['map'](function(_0x546757){return{'id':_0x546757['id']};}));return FaxMessage[_0x4a10('0x7')]({'where':{'FaxInteractionId':_0x317115['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4a10('0x8')](function(_0x527457){_0x317115[_0x4a10('0x6')](_0x4a10('0x9'),_0x527457['length']);FaxInteractionEvents[_0x4a10('0xa')](_0x19e9fd+':'+_0x317115['id'],_0x317115);FaxInteractionEvents[_0x4a10('0xa')](_0x19e9fd,_0x317115);_0x4be77c(null);})[_0x4a10('0xb')](_0x4be77c(null));};}for(var e in events){if(events[_0x4a10('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x4a10('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x1d05=['save','update','remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners'];(function(_0x8d2067,_0x566b6b){var _0x5f5d9f=function(_0x19039e){while(--_0x19039e){_0x8d2067['push'](_0x8d2067['shift']());}};_0x5f5d9f(++_0x566b6b);}(_0x1d05,0xdd));var _0x51d0=function(_0x248635,_0x30086d){_0x248635=_0x248635-0x0;var _0x1d8ac2=_0x1d05[_0x248635];return _0x1d8ac2;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x51d0('0x0'))['db'][_0x51d0('0x1')];var FaxMessage=require(_0x51d0('0x0'))['db'][_0x51d0('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x51d0('0x3')](0x0);var events={'afterCreate':_0x51d0('0x4'),'afterUpdate':_0x51d0('0x5'),'afterDestroy':_0x51d0('0x6')};function emitEvent(_0x28b3de){return function(_0x5db846,_0xbff711,_0x59bdc7){_0x5db846['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x213c78){_0x5db846[_0x51d0('0x7')]('Users',_0x213c78[_0x51d0('0x8')](function(_0x166b6b){return{'id':_0x166b6b['id']};}));return FaxMessage[_0x51d0('0x9')]({'where':{'FaxInteractionId':_0x5db846['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51d0('0xa')](function(_0x7835e9){_0x5db846[_0x51d0('0x7')](_0x51d0('0xb'),_0x7835e9['length']);FaxInteractionEvents[_0x51d0('0xc')](_0x28b3de+':'+_0x5db846['id'],_0x5db846);FaxInteractionEvents[_0x51d0('0xc')](_0x28b3de,_0x5db846);_0x59bdc7(null);})[_0x51d0('0xd')](_0x59bdc7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x51d0('0xe')](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 f5e243d..389bdfa 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 _0x5774=['request-promise','path','define','FaxInteraction','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment'];(function(_0x51786e,_0x5ee24e){var _0x25b5e2=function(_0x3ce85f){while(--_0x3ce85f){_0x51786e['push'](_0x51786e['shift']());}};_0x25b5e2(++_0x5ee24e);}(_0x5774,0x15d));var _0x4577=function(_0x7d55c5,_0x2056c2){_0x7d55c5=_0x7d55c5-0x0;var _0x1b666a=_0x5774[_0x7d55c5];return _0x1b666a;};'use strict';var _=require(_0x4577('0x0'));var util=require('util');var logger=require(_0x4577('0x1'))('api');var moment=require(_0x4577('0x2'));var BPromise=require('bluebird');var rp=require(_0x4577('0x3'));var fs=require('fs');var path=require(_0x4577('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x2c0e0b,_0xf39a9c){return _0x2c0e0b[_0x4577('0x5')](_0x4577('0x6'),attributes,{'tableName':_0x4577('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b6ffe,_0x52e502,_0x3e4543){if(_0x1b6ffe[_0x4577('0x8')](_0x4577('0x9'))){_0x1b6ffe['closedAt']=moment()['format'](_0x4577('0xa'));}_0x3e4543(null,_0x1b6ffe);}}});}; \ No newline at end of file +var _0x6c4b=['closed','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','../../config/environment','define','FaxInteraction','fax_interactions','changed'];(function(_0x2c2066,_0x1a1d4c){var _0x44afb0=function(_0xc79b8b){while(--_0xc79b8b){_0x2c2066['push'](_0x2c2066['shift']());}};_0x44afb0(++_0x1a1d4c);}(_0x6c4b,0x9e));var _0xb6c4=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x6c4b[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0xb6c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6c4('0x1'));var moment=require(_0xb6c4('0x2'));var BPromise=require(_0xb6c4('0x3'));var rp=require(_0xb6c4('0x4'));var fs=require('fs');var path=require(_0xb6c4('0x5'));var rimraf=require('rimraf');var config=require(_0xb6c4('0x6'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x152e43,_0x3eb1cd){return _0x152e43[_0xb6c4('0x7')](_0xb6c4('0x8'),attributes,{'tableName':_0xb6c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x172d78,_0x17ce58,_0xfc9c53){if(_0x172d78[_0xb6c4('0xa')](_0xb6c4('0xb'))){_0x172d78['closedAt']=moment()['format'](_0xb6c4('0xc'));}_0xfc9c53(null,_0x172d78);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ef1df2c..198836b 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 _0xce01=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','body','options','raw','where','debug','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','spread','AddTags','util'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xce01,0x15e));var _0x1ce0=function(_0x2089d2,_0x507dc3){_0x2089d2=_0x2089d2-0x0;var _0x197b15=_0xce01[_0x2089d2];return _0x197b15;};'use strict';var _=require('lodash');var util=require(_0x1ce0('0x0'));var moment=require(_0x1ce0('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ce0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ce0('0x3'))['db'];var utils=require(_0x1ce0('0x4'));var logger=require(_0x1ce0('0x5'))(_0x1ce0('0x6'));var config=require(_0x1ce0('0x7'));var jayson=require(_0x1ce0('0x8'));var client=jayson[_0x1ce0('0x9')][_0x1ce0('0xa')]({'port':0x232a});config[_0x1ce0('0xb')]=_[_0x1ce0('0xc')](config[_0x1ce0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ce0('0xd'))(new Redis(config[_0x1ce0('0xb')]));require('./faxInteraction.socket')[_0x1ce0('0xe')](socket);function respondWithRpcPromise(_0x247f04,_0x3e1663,_0x3a5298){return new BPromise(function(_0x4d5214,_0x3ab75e){return client[_0x1ce0('0xf')](_0x247f04,_0x3a5298)[_0x1ce0('0x10')](function(_0x744b07){logger['info'](_0x1ce0('0x11'),_0x3e1663,_0x1ce0('0x12'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3e1663,_0x1ce0('0x12'),JSON[_0x1ce0('0x13')](_0x744b07));if(_0x744b07['error']){if(_0x744b07[_0x1ce0('0x14')][_0x1ce0('0x15')]===0x1f4){logger['error'](_0x1ce0('0x11'),_0x3e1663,_0x744b07['error'][_0x1ce0('0x16')]);return _0x3ab75e(_0x744b07[_0x1ce0('0x14')][_0x1ce0('0x16')]);}logger[_0x1ce0('0x14')](_0x1ce0('0x11'),_0x3e1663,_0x744b07[_0x1ce0('0x14')][_0x1ce0('0x16')]);return _0x4d5214(_0x744b07[_0x1ce0('0x14')][_0x1ce0('0x16')]);}else{logger[_0x1ce0('0x17')](_0x1ce0('0x11'),_0x3e1663,_0x1ce0('0x12'));_0x4d5214(_0x744b07[_0x1ce0('0x18')][_0x1ce0('0x16')]);}})[_0x1ce0('0x19')](function(_0x2308a2){logger[_0x1ce0('0x14')](_0x1ce0('0x11'),_0x3e1663,_0x2308a2);_0x3ab75e(_0x2308a2);});});}exports[_0x1ce0('0x1a')]=function(_0x179789){var _0x2744b0=this;return new Promise(function(_0x15fc89,_0x594538){return db['FaxInteraction']['update'](_0x179789[_0x1ce0('0x1b')],{'raw':_0x179789[_0x1ce0('0x1c')]?_0x179789['options'][_0x1ce0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x179789[_0x1ce0('0x1c')]?_0x179789[_0x1ce0('0x1c')][_0x1ce0('0x1e')]||null:null,'attributes':_0x179789[_0x1ce0('0x1c')]?_0x179789['options']['attributes']||null:null,'limit':_0x179789[_0x1ce0('0x1c')]?_0x179789['options']['limit']||null:null})[_0x1ce0('0x10')](function(_0x1badc8){logger[_0x1ce0('0x17')](_0x1ce0('0x1a'),_0x179789);logger[_0x1ce0('0x1f')]('UpdateFaxInteraction',_0x179789,JSON[_0x1ce0('0x13')](_0x1badc8));_0x15fc89(_0x1badc8);})[_0x1ce0('0x19')](function(_0x28d715){logger[_0x1ce0('0x14')](_0x1ce0('0x1a'),_0x28d715[_0x1ce0('0x16')],_0x179789);_0x594538(_0x2744b0[_0x1ce0('0x14')](0x1f4,_0x28d715[_0x1ce0('0x16')]));});});};exports[_0x1ce0('0x20')]=function(_0x26d309){return new Promise(function(_0x4fb966,_0x530a1d){return db[_0x1ce0('0x21')][_0x1ce0('0x22')]({'where':_0x26d309[_0x1ce0('0x1c')]?_0x26d309[_0x1ce0('0x1c')][_0x1ce0('0x1e')]||null:null})[_0x1ce0('0x10')](function(_0x36b437){if(_0x36b437){return _0x36b437[_0x1ce0('0x23')](_0x26d309[_0x1ce0('0x1b')]['ids'],_[_0x1ce0('0x24')](_0x26d309['body'],['ids','id'])||{});}})[_0x1ce0('0x25')](function(_0x334f6f){logger[_0x1ce0('0x17')](_0x1ce0('0x26'),_0x26d309);logger[_0x1ce0('0x1f')](_0x1ce0('0x26'),_0x26d309,JSON['stringify'](_0x334f6f));_0x4fb966(_0x334f6f);})[_0x1ce0('0x19')](function(_0x433299){logger['error']('AddTags',_0x433299[_0x1ce0('0x16')],_0x26d309);_0x530a1d(_this[_0x1ce0('0x14')](0x1f4,_0x433299[_0x1ce0('0x16')]));});});}; \ No newline at end of file +var _0x3cb6=['catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','then','AddTagsToFaxInteraction','addTags','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x48b66e,_0x461edb){var _0x151723=function(_0x1f1421){while(--_0x1f1421){_0x48b66e['push'](_0x48b66e['shift']());}};_0x151723(++_0x461edb);}(_0x3cb6,0x82));var _0x63cb=function(_0x208b8a,_0x3a5793){_0x208b8a=_0x208b8a-0x0;var _0x21a5fc=_0x3cb6[_0x208b8a];return _0x21a5fc;};'use strict';var _=require(_0x63cb('0x0'));var util=require(_0x63cb('0x1'));var moment=require('moment');var BPromise=require(_0x63cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63cb('0x3'));var db=require(_0x63cb('0x4'))['db'];var utils=require(_0x63cb('0x5'));var logger=require(_0x63cb('0x6'))(_0x63cb('0x7'));var config=require(_0x63cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x63cb('0x9')][_0x63cb('0xa')]({'port':0x232a});config[_0x63cb('0xb')]=_[_0x63cb('0xc')](config[_0x63cb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x63cb('0xd'))(new Redis(config[_0x63cb('0xb')]));require(_0x63cb('0xe'))['register'](socket);function respondWithRpcPromise(_0x917e7b,_0x1dcf00,_0x5f8d45){return new BPromise(function(_0x280a6c,_0x500941){return client[_0x63cb('0xf')](_0x917e7b,_0x5f8d45)['then'](function(_0x24f3b7){logger['info'](_0x63cb('0x10'),_0x1dcf00,_0x63cb('0x11'));logger[_0x63cb('0x12')](_0x63cb('0x13'),_0x1dcf00,'request\x20sent',JSON[_0x63cb('0x14')](_0x24f3b7));if(_0x24f3b7[_0x63cb('0x15')]){if(_0x24f3b7[_0x63cb('0x15')][_0x63cb('0x16')]===0x1f4){logger['error'](_0x63cb('0x10'),_0x1dcf00,_0x24f3b7[_0x63cb('0x15')]['message']);return _0x500941(_0x24f3b7[_0x63cb('0x15')][_0x63cb('0x17')]);}logger['error'](_0x63cb('0x10'),_0x1dcf00,_0x24f3b7[_0x63cb('0x15')][_0x63cb('0x17')]);return _0x280a6c(_0x24f3b7[_0x63cb('0x15')][_0x63cb('0x17')]);}else{logger[_0x63cb('0x18')](_0x63cb('0x10'),_0x1dcf00,_0x63cb('0x11'));_0x280a6c(_0x24f3b7[_0x63cb('0x19')][_0x63cb('0x17')]);}})[_0x63cb('0x1a')](function(_0x284734){logger[_0x63cb('0x15')](_0x63cb('0x10'),_0x1dcf00,_0x284734);_0x500941(_0x284734);});});}exports[_0x63cb('0x1b')]=function(_0x5c98de){var _0x18f5b3=this;return new Promise(function(_0x265cf1,_0x4a278e){return db[_0x63cb('0x1c')][_0x63cb('0x1d')](_0x5c98de[_0x63cb('0x1e')],{'raw':_0x5c98de[_0x63cb('0x1f')]?_0x5c98de[_0x63cb('0x1f')][_0x63cb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c98de[_0x63cb('0x1f')]?_0x5c98de[_0x63cb('0x1f')][_0x63cb('0x21')]||null:null,'attributes':_0x5c98de['options']?_0x5c98de['options']['attributes']||null:null,'limit':_0x5c98de['options']?_0x5c98de[_0x63cb('0x1f')]['limit']||null:null})[_0x63cb('0x22')](function(_0x227c0f){logger[_0x63cb('0x18')](_0x63cb('0x1b'),_0x5c98de);logger[_0x63cb('0x12')](_0x63cb('0x1b'),_0x5c98de,JSON[_0x63cb('0x14')](_0x227c0f));_0x265cf1(_0x227c0f);})[_0x63cb('0x1a')](function(_0x19703a){logger['error'](_0x63cb('0x1b'),_0x19703a[_0x63cb('0x17')],_0x5c98de);_0x4a278e(_0x18f5b3[_0x63cb('0x15')](0x1f4,_0x19703a['message']));});});};exports[_0x63cb('0x23')]=function(_0x157714){return new Promise(function(_0xaf1775,_0x44bb97){return db['FaxInteraction']['find']({'where':_0x157714['options']?_0x157714[_0x63cb('0x1f')][_0x63cb('0x21')]||null:null})[_0x63cb('0x22')](function(_0x5d4742){if(_0x5d4742){return _0x5d4742[_0x63cb('0x24')](_0x157714['body']['ids'],_['omit'](_0x157714[_0x63cb('0x1e')],['ids','id'])||{});}})[_0x63cb('0x25')](function(_0xa716a){logger[_0x63cb('0x18')](_0x63cb('0x26'),_0x157714);logger['debug']('AddTags',_0x157714,JSON[_0x63cb('0x14')](_0xa716a));_0xaf1775(_0xa716a);})[_0x63cb('0x1a')](function(_0x4c6827){logger['error'](_0x63cb('0x26'),_0x4c6827['message'],_0x157714);_0x44bb97(_this['error'](0x1f4,_0x4c6827[_0x63cb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ca8ecef..aa54cbb 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 _0x5418=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x53c739,_0x34dd56){var _0x1cf22e=function(_0x176909){while(--_0x176909){_0x53c739['push'](_0x53c739['shift']());}};_0x1cf22e(++_0x34dd56);}(_0x5418,0xa8));var _0x8541=function(_0x2b6ca9,_0x2d7d55){_0x2b6ca9=_0x2b6ca9-0x0;var _0x6fd54c=_0x5418[_0x2b6ca9];return _0x6fd54c;};'use strict';var FaxInteractionEvents=require(_0x8541('0x0'));var events=[_0x8541('0x1'),_0x8541('0x2'),_0x8541('0x3')];function createListener(_0x46ac59,_0x1b1561){return function(_0x2ed77e){_0x1b1561[_0x8541('0x4')](_0x46ac59,_0x2ed77e);};}function removeListener(_0x4c09ec,_0x1bd762){return function(){FaxInteractionEvents[_0x8541('0x5')](_0x4c09ec,_0x1bd762);};}exports[_0x8541('0x6')]=function(_0x41de8e){for(var _0x4600dd=0x0,_0x344cdd=events[_0x8541('0x7')];_0x4600dd<_0x344cdd;_0x4600dd++){var _0x151d9d=events[_0x4600dd];var _0x12cb45=createListener(_0x8541('0x8')+_0x151d9d,_0x41de8e);FaxInteractionEvents['on'](_0x151d9d,_0x12cb45);}}; \ No newline at end of file +var _0xfab0=['update','emit','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x4ec091,_0xf12cc3){var _0x521d8a=function(_0x3e9e36){while(--_0x3e9e36){_0x4ec091['push'](_0x4ec091['shift']());}};_0x521d8a(++_0xf12cc3);}(_0xfab0,0x18a));var _0x0fab=function(_0x5a0681,_0x5cbc10){_0x5a0681=_0x5a0681-0x0;var _0x2d3a74=_0xfab0[_0x5a0681];return _0x2d3a74;};'use strict';var FaxInteractionEvents=require(_0x0fab('0x0'));var events=['save',_0x0fab('0x1'),_0x0fab('0x2')];function createListener(_0x3b8d15,_0x2bdd58){return function(_0x3527c3){_0x2bdd58[_0x0fab('0x3')](_0x3b8d15,_0x3527c3);};}function removeListener(_0x24cf20,_0x43699f){return function(){FaxInteractionEvents['removeListener'](_0x24cf20,_0x43699f);};}exports['register']=function(_0x118ccf){for(var _0xf8e116=0x0,_0x31e3b0=events[_0x0fab('0x4')];_0xf8e116<_0x31e3b0;_0xf8e116++){var _0x33b0c7=events[_0xf8e116];var _0x2eac5b=createListener(_0x0fab('0x5')+_0x33b0c7,_0x118ccf);FaxInteractionEvents['on'](_0x33b0c7,_0x2eac5b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 81ec485..9746942 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 _0x7a7c=['download','post','addMessage','/:id/tags','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x4e2921,_0x5f0e66){var _0x5d0569=function(_0x439f51){while(--_0x439f51){_0x4e2921['push'](_0x4e2921['shift']());}};_0x5d0569(++_0x5f0e66);}(_0x7a7c,0x170));var _0xc7a7=function(_0x3e865d,_0x1c3303){_0x3e865d=_0x3e865d-0x0;var _0xc5789b=_0x7a7c[_0x3e865d];return _0xc5789b;};'use strict';var multer=require(_0xc7a7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7a7('0x1'));var router=express['Router']();var fs_extra=require(_0xc7a7('0x2'));var auth=require(_0xc7a7('0x3'));var interaction=require(_0xc7a7('0x4'));var config=require(_0xc7a7('0x5'));var controller=require(_0xc7a7('0x6'));router['get']('/',auth[_0xc7a7('0x7')](),controller[_0xc7a7('0x8')]);router[_0xc7a7('0x9')](_0xc7a7('0xa'),auth[_0xc7a7('0x7')](),controller['describe']);router[_0xc7a7('0x9')](_0xc7a7('0xb'),auth['isAuthenticated'](),controller[_0xc7a7('0xc')]);router[_0xc7a7('0x9')](_0xc7a7('0xd'),auth[_0xc7a7('0x7')](),controller[_0xc7a7('0xe')]);router['get'](_0xc7a7('0xf'),auth[_0xc7a7('0x7')](),controller[_0xc7a7('0x10')]);router[_0xc7a7('0x11')]('/',auth[_0xc7a7('0x7')](),controller['create']);router['post'](_0xc7a7('0xd'),auth['isAuthenticated'](),controller[_0xc7a7('0x12')]);router[_0xc7a7('0x11')](_0xc7a7('0x13'),auth[_0xc7a7('0x7')](),interaction['tracked']('fax',_0xc7a7('0x14')),controller[_0xc7a7('0x15')]);router[_0xc7a7('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0xc7a7('0x17')](_0xc7a7('0x18'),_0xc7a7('0x19')),controller[_0xc7a7('0x1a')]);router[_0xc7a7('0x1b')](_0xc7a7('0xb'),auth[_0xc7a7('0x7')](),interaction[_0xc7a7('0x17')](_0xc7a7('0x18'),_0xc7a7('0x1c')),controller[_0xc7a7('0x1d')]);router[_0xc7a7('0x1b')](_0xc7a7('0x13'),auth[_0xc7a7('0x7')](),controller[_0xc7a7('0x1e')]);module[_0xc7a7('0x1f')]=router; \ No newline at end of file +var _0xadd2=['faxinteraction:update','update','delete','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id'];(function(_0x248120,_0x536a1f){var _0xccf027=function(_0x1751fd){while(--_0x1751fd){_0x248120['push'](_0x248120['shift']());}};_0xccf027(++_0x536a1f);}(_0xadd2,0xa5));var _0x2add=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xadd2[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2add('0x0'));var timeout=require('connect-timeout');var express=require(_0x2add('0x1'));var router=express[_0x2add('0x2')]();var fs_extra=require(_0x2add('0x3'));var auth=require(_0x2add('0x4'));var interaction=require(_0x2add('0x5'));var config=require(_0x2add('0x6'));var controller=require(_0x2add('0x7'));router[_0x2add('0x8')]('/',auth[_0x2add('0x9')](),controller['index']);router['get'](_0x2add('0xa'),auth[_0x2add('0x9')](),controller[_0x2add('0xb')]);router[_0x2add('0x8')]('/:id',auth[_0x2add('0x9')](),controller[_0x2add('0xc')]);router[_0x2add('0x8')](_0x2add('0xd'),auth[_0x2add('0x9')](),controller[_0x2add('0xe')]);router[_0x2add('0x8')](_0x2add('0xf'),auth['isAuthenticated'](),controller[_0x2add('0x10')]);router[_0x2add('0x11')]('/',auth[_0x2add('0x9')](),controller[_0x2add('0x12')]);router[_0x2add('0x11')](_0x2add('0xd'),auth[_0x2add('0x9')](),controller[_0x2add('0x13')]);router['post'](_0x2add('0x14'),auth[_0x2add('0x9')](),interaction[_0x2add('0x15')](_0x2add('0x16'),_0x2add('0x17')),controller[_0x2add('0x18')]);router[_0x2add('0x19')](_0x2add('0x1a'),auth['isAuthenticated'](),interaction[_0x2add('0x15')](_0x2add('0x16'),_0x2add('0x1b')),controller[_0x2add('0x1c')]);router[_0x2add('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0x2add('0x15')]('fax','faxinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x2add('0x9')](),controller[_0x2add('0x1e')]);module[_0x2add('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index fb23f58..78a22af 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 _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3aeecb,_0x5e9209){var _0x442640=function(_0x100b7f){while(--_0x100b7f){_0x3aeecb['push'](_0x3aeecb['shift']());}};_0x442640(++_0x5e9209);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0xf3cd[_0x205e5a];return _0x10da58;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}}; \ No newline at end of file +var _0x99c9=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x4e5af1,_0x1dfc1f){var _0x357f9d=function(_0x645f3b){while(--_0x645f3b){_0x4e5af1['push'](_0x4e5af1['shift']());}};_0x357f9d(++_0x1dfc1f);}(_0x99c9,0x13c));var _0x999c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x99c9[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x999c('0x0'));module[_0x999c('0x1')]={'body':{'type':Sequelize[_0x999c('0x2')](_0x999c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x999c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x999c('0x5')]('in',_0x999c('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x999c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x999c('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index dd9c375..21d48ce 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 _0xf3b0=['includeAll','options','find','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','QueryTypes','contact','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','interface','event','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','include','FaxMessage','findAll','rows','show','params','length'];(function(_0x35df8f,_0x593861){var _0x272223=function(_0x1c683f){while(--_0x1c683f){_0x35df8f['push'](_0x35df8f['shift']());}};_0x272223(++_0x593861);}(_0xf3b0,0x15a));var _0x0f3b=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xf3b0[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x0f3b('0x0'));var rimraf=require(_0x0f3b('0x1'));var zipdir=require(_0x0f3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0f3b('0x3'));var Mustache=require(_0x0f3b('0x4'));var util=require('util');var path=require(_0x0f3b('0x5'));var sox=require(_0x0f3b('0x6'));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(_0x0f3b('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f3b('0x8'));var toCsv=require('to-csv');var querystring=require(_0x0f3b('0x9'));var Papa=require(_0x0f3b('0xa'));var Redis=require(_0x0f3b('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x0f3b('0xc'));var as=require(_0x0f3b('0xd'));var hardwareService=require(_0x0f3b('0xe'));var logger=require(_0x0f3b('0xf'))(_0x0f3b('0x10'));var utils=require(_0x0f3b('0x11'));var config=require(_0x0f3b('0x12'));var licenseUtil=require(_0x0f3b('0x13'));var db=require(_0x0f3b('0x14'))['db'];config[_0x0f3b('0x15')]=_[_0x0f3b('0x16')](config['redis'],{'host':_0x0f3b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f3b('0x15')]));require('./faxMessage.socket')[_0x0f3b('0x18')](socket);var jayson=require(_0x0f3b('0x19'));var client=jayson['client'][_0x0f3b('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x0f3b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4c2c40,_0x1f0f4c,_0x1353ae,_0x248fc8){return new BPromise(function(_0x1bf87f,_0x2f5294){var _0x3fbe99=_0x248fc8||client;return _0x3fbe99[_0x0f3b('0x1b')](_0x4c2c40,_0x1353ae)['then'](function(_0x206806){logger['info'](_0x0f3b('0x1c'),_0x1f0f4c,_0x0f3b('0x1d'));logger[_0x0f3b('0x1e')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1f0f4c,_0x0f3b('0x1d'),JSON[_0x0f3b('0x1f')](_0x206806));if(_0x206806[_0x0f3b('0x20')]){if(_0x206806['error'][_0x0f3b('0x21')]===0x1f4){logger[_0x0f3b('0x20')](_0x0f3b('0x1c'),_0x1f0f4c,_0x206806[_0x0f3b('0x20')][_0x0f3b('0x22')]);return _0x2f5294(_0x206806[_0x0f3b('0x20')][_0x0f3b('0x22')]);}logger[_0x0f3b('0x20')](_0x0f3b('0x1c'),_0x1f0f4c,_0x206806['error'][_0x0f3b('0x22')]);return _0x1bf87f(_0x206806[_0x0f3b('0x20')][_0x0f3b('0x22')]);}else{logger[_0x0f3b('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1f0f4c,_0x0f3b('0x1d'));_0x1bf87f(_0x206806[_0x0f3b('0x24')]['message']);}})[_0x0f3b('0x25')](function(_0x5838d6){logger['error'](_0x0f3b('0x1c'),_0x1f0f4c,_0x5838d6);_0x2f5294(_0x5838d6);});});}function respondWithStatusCode(_0x1947eb,_0x4f215c){_0x4f215c=_0x4f215c||0xcc;return function(_0x2d0cb5){if(_0x2d0cb5){return _0x1947eb[_0x0f3b('0x26')](_0x4f215c);}return _0x1947eb[_0x0f3b('0x27')](_0x4f215c)['end']();};}function respondWithResult(_0xaae6ff,_0x487a60){_0x487a60=_0x487a60||0xc8;return function(_0x5862d4){if(_0x5862d4){return _0xaae6ff[_0x0f3b('0x27')](_0x487a60)[_0x0f3b('0x28')](_0x5862d4);}};}function respondWithFilteredResult(_0xff23a4,_0x50b1f4){return function(_0x494552){if(_0x494552){var _0x5b26b5=typeof _0x50b1f4[_0x0f3b('0x29')]===_0x0f3b('0x2a')&&typeof _0x50b1f4[_0x0f3b('0x2b')]===_0x0f3b('0x2a');var _0x1988db=_0x494552[_0x0f3b('0x2c')];var _0x5e3b6b=_0x5b26b5?0x0:_0x50b1f4[_0x0f3b('0x29')];var _0x1dcd4f=_0x5b26b5?_0x494552[_0x0f3b('0x2c')]:_0x50b1f4[_0x0f3b('0x29')]+_0x50b1f4[_0x0f3b('0x2b')];var _0x33400d;if(_0x1dcd4f>=_0x1988db){_0x1dcd4f=_0x1988db;_0x33400d=0xc8;}else{_0x33400d=0xce;}_0xff23a4['status'](_0x33400d);return _0xff23a4[_0x0f3b('0x2d')](_0x0f3b('0x2e'),_0x5e3b6b+'-'+_0x1dcd4f+'/'+_0x1988db)[_0x0f3b('0x28')](_0x494552);}return null;};}function patchUpdates(_0x53479b){return function(_0x1d6c38){try{jsonpatch['apply'](_0x1d6c38,_0x53479b,!![]);}catch(_0x3b905c){return BPromise[_0x0f3b('0x2f')](_0x3b905c);}return _0x1d6c38[_0x0f3b('0x30')]();};}function saveUpdates(_0x99e12,_0x37a9b3){return function(_0x2c435d){if(_0x2c435d){return _0x2c435d[_0x0f3b('0x31')](_0x99e12)[_0x0f3b('0x32')](function(_0x3dcd39){return _0x3dcd39;});}return null;};}function removeEntity(_0x147ac6,_0xd828b4){return function(_0x20a4b8){if(_0x20a4b8){return _0x20a4b8['destroy']()[_0x0f3b('0x32')](function(){_0x147ac6[_0x0f3b('0x27')](0xcc)[_0x0f3b('0x33')]();});}};}function handleEntityNotFound(_0x36a182,_0x418d12){return function(_0x4675af){if(!_0x4675af){_0x36a182[_0x0f3b('0x26')](0x194);}return _0x4675af;};}function handleError(_0x39b509,_0x3376a0){_0x3376a0=_0x3376a0||0x1f4;return function(_0x3b0048){logger['error'](_0x3b0048[_0x0f3b('0x34')]);if(_0x3b0048['name']){delete _0x3b0048[_0x0f3b('0x35')];}_0x39b509[_0x0f3b('0x27')](_0x3376a0)[_0x0f3b('0x36')](_0x3b0048);};}exports[_0x0f3b('0x37')]=function(_0x50f9e3,_0x5d792f){var _0x1a40cd={},_0x54b444={},_0x176dbc={'count':0x0,'rows':[]};var _0x3986a8=_['map'](db['FaxMessage'][_0x0f3b('0x38')],function(_0x49b41b){return{'name':_0x49b41b['fieldName'],'type':_0x49b41b['type'][_0x0f3b('0x39')]};});_0x54b444[_0x0f3b('0x3a')]=_['map'](_0x3986a8,_0x0f3b('0x35'));_0x54b444[_0x0f3b('0x3b')]=_[_0x0f3b('0x3c')](_0x50f9e3[_0x0f3b('0x3b')]);_0x54b444[_0x0f3b('0x3d')]=_[_0x0f3b('0x3e')](_0x54b444[_0x0f3b('0x3a')],_0x54b444[_0x0f3b('0x3b')]);_0x1a40cd[_0x0f3b('0x3f')]=_[_0x0f3b('0x3e')](_0x54b444[_0x0f3b('0x3a')],qs['fields'](_0x50f9e3[_0x0f3b('0x3b')][_0x0f3b('0x40')]));_0x1a40cd[_0x0f3b('0x3f')]=_0x1a40cd[_0x0f3b('0x3f')]['length']?_0x1a40cd[_0x0f3b('0x3f')]:_0x54b444[_0x0f3b('0x3a')];if(!_0x50f9e3[_0x0f3b('0x3b')][_0x0f3b('0x41')](_0x0f3b('0x42'))){_0x1a40cd[_0x0f3b('0x2b')]=qs['limit'](_0x50f9e3['query'][_0x0f3b('0x2b')]);_0x1a40cd['offset']=qs[_0x0f3b('0x29')](_0x50f9e3[_0x0f3b('0x3b')]['offset']);}_0x1a40cd[_0x0f3b('0x43')]=qs[_0x0f3b('0x44')](_0x50f9e3[_0x0f3b('0x3b')]['sort']);_0x1a40cd[_0x0f3b('0x45')]=qs[_0x0f3b('0x3d')](_[_0x0f3b('0x46')](_0x50f9e3[_0x0f3b('0x3b')],_0x54b444['filters']),_0x3986a8);if(_0x50f9e3[_0x0f3b('0x3b')][_0x0f3b('0x47')]){_0x1a40cd[_0x0f3b('0x45')]=_['merge'](_0x1a40cd[_0x0f3b('0x45')],{'$or':_[_0x0f3b('0x48')](_0x3986a8,function(_0x3b9638){if(_0x3b9638[_0x0f3b('0x49')]!==_0x0f3b('0x4a')){var _0xd0082a={};_0xd0082a[_0x3b9638[_0x0f3b('0x35')]]={'$like':'%'+_0x50f9e3[_0x0f3b('0x3b')][_0x0f3b('0x47')]+'%'};return _0xd0082a;}})});}_0x1a40cd=_[_0x0f3b('0x4b')]({},_0x1a40cd,_0x50f9e3['options']);var _0x3b8acb={'where':_0x1a40cd[_0x0f3b('0x45')]};return db['FaxMessage']['count'](_0x3b8acb)['then'](function(_0x170fb9){_0x176dbc[_0x0f3b('0x2c')]=_0x170fb9;if(_0x50f9e3[_0x0f3b('0x3b')]['includeAll']){_0x1a40cd[_0x0f3b('0x4c')]=[{'all':!![]}];}return db[_0x0f3b('0x4d')][_0x0f3b('0x4e')](_0x1a40cd);})[_0x0f3b('0x32')](function(_0x3268cb){_0x176dbc[_0x0f3b('0x4f')]=_0x3268cb;return _0x176dbc;})[_0x0f3b('0x32')](respondWithFilteredResult(_0x5d792f,_0x1a40cd))[_0x0f3b('0x25')](handleError(_0x5d792f,null));};exports[_0x0f3b('0x50')]=function(_0xd92814,_0x1b27bf){var _0x4fc935={'raw':!![],'where':{'id':_0xd92814[_0x0f3b('0x51')]['id']}},_0x24570b={};_0x24570b[_0x0f3b('0x3a')]=_['keys'](db[_0x0f3b('0x4d')]['rawAttributes']);_0x24570b[_0x0f3b('0x3b')]=_[_0x0f3b('0x3c')](_0xd92814[_0x0f3b('0x3b')]);_0x24570b['filters']=_[_0x0f3b('0x3e')](_0x24570b[_0x0f3b('0x3a')],_0x24570b[_0x0f3b('0x3b')]);_0x4fc935[_0x0f3b('0x3f')]=_[_0x0f3b('0x3e')](_0x24570b[_0x0f3b('0x3a')],qs[_0x0f3b('0x40')](_0xd92814[_0x0f3b('0x3b')][_0x0f3b('0x40')]));_0x4fc935[_0x0f3b('0x3f')]=_0x4fc935[_0x0f3b('0x3f')][_0x0f3b('0x52')]?_0x4fc935[_0x0f3b('0x3f')]:_0x24570b['model'];if(_0xd92814[_0x0f3b('0x3b')][_0x0f3b('0x53')]){_0x4fc935[_0x0f3b('0x4c')]=[{'all':!![]}];}_0x4fc935=_[_0x0f3b('0x4b')]({},_0x4fc935,_0xd92814[_0x0f3b('0x54')]);return db[_0x0f3b('0x4d')][_0x0f3b('0x55')](_0x4fc935)[_0x0f3b('0x32')](handleEntityNotFound(_0x1b27bf,null))[_0x0f3b('0x32')](respondWithResult(_0x1b27bf,null))[_0x0f3b('0x25')](handleError(_0x1b27bf,null));};exports['update']=function(_0x489332,_0x42f2db){if(_0x489332[_0x0f3b('0x56')]['id']){delete _0x489332[_0x0f3b('0x56')]['id'];}return db['FaxMessage'][_0x0f3b('0x55')]({'where':{'id':_0x489332[_0x0f3b('0x51')]['id']}})[_0x0f3b('0x32')](handleEntityNotFound(_0x42f2db,null))[_0x0f3b('0x32')](saveUpdates(_0x489332[_0x0f3b('0x56')],null))['then'](respondWithResult(_0x42f2db,null))[_0x0f3b('0x25')](handleError(_0x42f2db,null));};exports['destroy']=function(_0x42ab2e,_0x1b20d9){return db[_0x0f3b('0x4d')]['find']({'where':{'id':_0x42ab2e['params']['id']}})[_0x0f3b('0x32')](handleEntityNotFound(_0x1b20d9,null))[_0x0f3b('0x32')](removeEntity(_0x1b20d9,null))[_0x0f3b('0x25')](handleError(_0x1b20d9,null));};exports['describe']=function(_0x473b1f,_0x3cbcb1){return db['FaxMessage'][_0x0f3b('0x57')]()['then'](respondWithResult(_0x3cbcb1,null))[_0x0f3b('0x25')](handleError(_0x3cbcb1,null));};var interaction_log=require(_0x0f3b('0xf'))(_0x0f3b('0x58'));exports[_0x0f3b('0x59')]=function(_0x1f0923,_0x1f4e25,_0x563f10){var _0x2f2ba5={'agent':{},'channel':_0x0f3b('0x5a')};if(_0x1f0923[_0x0f3b('0x56')]['id']){delete _0x1f0923['body']['id'];}_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x5b')]=!![];_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x5c')]=moment()[_0x0f3b('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x5e')]=_0x1f0923[_0x0f3b('0x56')]['UserId']||_0x1f0923['user']['id'];_0x2f2ba5[_0x0f3b('0x5f')]['id']=_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x5e')];return db[_0x0f3b('0x4d')]['find']({'where':{'id':_0x1f0923[_0x0f3b('0x51')]['id'],'UserId':null}})[_0x0f3b('0x32')](handleEntityNotFound(_0x1f4e25,null))[_0x0f3b('0x32')](saveUpdates(_0x1f0923['body'],null))[_0x0f3b('0x32')](function(_0x5033d5){if(_0x5033d5){_0x2f2ba5['message']=_0x5033d5[_0x0f3b('0x60')]({'plain':!![]});return db[_0x0f3b('0x61')]['find']({'where':{'id':_0x5033d5[_0x0f3b('0x62')]}});}return null;})[_0x0f3b('0x32')](handleEntityNotFound(_0x1f4e25,null))[_0x0f3b('0x32')](function(_0x20fc57){if(_0x20fc57){return _0x20fc57[_0x0f3b('0x31')]({'UserId':_0x1f0923['body']['UserId'],'read1stAt':_[_0x0f3b('0x63')](_0x20fc57[_0x0f3b('0x64')])?moment()[_0x0f3b('0x5d')](_0x0f3b('0x65')):undefined});}return null;})[_0x0f3b('0x32')](function(_0x315f4f){if(_0x315f4f){_0x2f2ba5['interaction']=_0x315f4f['get']({'plain':!![]});interaction_log[_0x0f3b('0x23')](_0x0f3b('0x66'),_0x1f0923[_0x0f3b('0x67')]['id'],_0x1f0923[_0x0f3b('0x67')]['name'],_0x1f0923[_0x0f3b('0x67')][_0x0f3b('0x68')],_0x2f2ba5[_0x0f3b('0x69')]['id'],_0x1f0923['body']?JSON[_0x0f3b('0x1f')](_0x1f0923[_0x0f3b('0x56')]):'null');return respondWithRpcPromise(_0x0f3b('0x6a'),_0x0f3b('0x6b'),_0x2f2ba5);}return null;})[_0x0f3b('0x32')](function(_0x2d7fe4){var _0x56b5e0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d7fe4[_0x0f3b('0x22')]['ContactId'];return db['sequelize']['query'](_0x56b5e0,{'type':db['Sequelize'][_0x0f3b('0x6c')]['SELECT'],'raw':!![]})[_0x0f3b('0x32')](function(_0x38e873){return _0x38e873;});})['then'](function(_0x3de4e6){if(_0x3de4e6){_0x2f2ba5[_0x0f3b('0x22')][_0x0f3b('0x6d')]=_0x3de4e6[0x0];if(!_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x5e')])return;return db['User'][_0x0f3b('0x55')]({'where':{'id':_0x1f0923[_0x0f3b('0x56')]['UserId'],'role':_0x0f3b('0x5f')},'attributes':['id',_0x0f3b('0x35'),'fullname',_0x0f3b('0x6e'),_0x0f3b('0x6f')],'raw':!![]});}return null;})[_0x0f3b('0x32')](function(_0x34c81e){if(!_0x34c81e)return null;_0x2f2ba5[_0x0f3b('0x22')][_0x0f3b('0x5f')]=_0x34c81e;return _0x2f2ba5;})[_0x0f3b('0x32')](function(_0x13f5d4){if(_0x13f5d4){if(_0x1f0923[_0x0f3b('0x56')][_0x0f3b('0x70')]){_0x2f2ba5[_0x0f3b('0x22')]['interface']=util[_0x0f3b('0x5d')](_0x0f3b('0x71'),_0x1f0923['user']['name']);_0x2f2ba5[_0x0f3b('0x22')][_0x0f3b('0x72')]=_0x2f2ba5[_0x0f3b('0x72')];_0x2f2ba5[_0x0f3b('0x22')][_0x0f3b('0x73')]=_0x2f2ba5[_0x0f3b('0x72')];_0x2f2ba5[_0x0f3b('0x22')]['event']=_0x0f3b('0x59');return respondWithRpcPromise('EventManager',_0x0f3b('0x74'),{'event':'acceptmessage','message':_0x2f2ba5[_0x0f3b('0x22')]},client9002)[_0x0f3b('0x32')](function(){return _0x2f2ba5;});}return _0x2f2ba5;}return null;})['then'](respondWithResult(_0x1f4e25,null))[_0x0f3b('0x25')](handleError(_0x1f4e25,null));};var interaction_log=require(_0x0f3b('0xf'))(_0x0f3b('0x58'));exports[_0x0f3b('0x2f')]=function(_0x142be0,_0xb7103a,_0x24bc40){var _0x525769={'agent':{},'channel':_0x0f3b('0x5a')};if(_0x142be0[_0x0f3b('0x56')]['id']){delete _0x142be0['body']['id'];}_0x142be0['body'][_0x0f3b('0x5e')]=_0x142be0[_0x0f3b('0x56')][_0x0f3b('0x5e')]||_0x142be0[_0x0f3b('0x67')]['id'];_0x525769[_0x0f3b('0x5f')]['id']=_0x142be0['body']['UserId'];return db[_0x0f3b('0x4d')]['find']({'where':{'id':_0x142be0[_0x0f3b('0x51')]['id'],'UserId':null}})[_0x0f3b('0x32')](handleEntityNotFound(_0xb7103a,null))[_0x0f3b('0x32')](function(_0x26fc40){if(_0x26fc40){_0x525769[_0x0f3b('0x22')]=_0x26fc40['get']({'plain':!![]});return db[_0x0f3b('0x61')][_0x0f3b('0x55')]({'where':{'id':_0x26fc40['FaxInteractionId']}});}return null;})[_0x0f3b('0x32')](handleEntityNotFound(_0xb7103a,null))[_0x0f3b('0x32')](function(_0x65e4a3){if(_0x65e4a3){_0x525769[_0x0f3b('0x69')]=_0x65e4a3['get']({'plain':!![]});interaction_log[_0x0f3b('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x142be0['user']['id'],_0x142be0[_0x0f3b('0x67')][_0x0f3b('0x35')],_0x142be0[_0x0f3b('0x67')]['role'],_0x525769[_0x0f3b('0x69')]['id'],_0x142be0['body']?JSON[_0x0f3b('0x1f')](_0x142be0[_0x0f3b('0x56')]):_0x0f3b('0x75'));return respondWithRpcPromise(_0x0f3b('0x76'),_0x0f3b('0x77'),_0x525769);}return null;})[_0x0f3b('0x32')](function(_0xf0cf2c){var _0x1f5a1e=_0x0f3b('0x78')+_0xf0cf2c[_0x0f3b('0x22')][_0x0f3b('0x79')];return db[_0x0f3b('0x7a')]['query'](_0x1f5a1e,{'type':db[_0x0f3b('0x7b')][_0x0f3b('0x6c')][_0x0f3b('0x7c')],'raw':!![]})[_0x0f3b('0x32')](function(_0x348bb6){return _0x348bb6;});})[_0x0f3b('0x32')](function(_0x469783){if(_0x469783){_0x525769[_0x0f3b('0x22')][_0x0f3b('0x6d')]=_0x469783[0x0];if(!_0x142be0[_0x0f3b('0x56')][_0x0f3b('0x5e')])return;return db['User'][_0x0f3b('0x55')]({'where':{'id':_0x142be0[_0x0f3b('0x56')][_0x0f3b('0x5e')],'role':_0x0f3b('0x5f')},'attributes':['id','name',_0x0f3b('0x7d'),_0x0f3b('0x6e'),_0x0f3b('0x6f')],'raw':!![]});}return null;})['then'](function(_0x523183){if(!_0x523183)return null;_0x525769[_0x0f3b('0x22')][_0x0f3b('0x5f')]=_0x523183;return _0x525769;})[_0x0f3b('0x32')](function(_0x460980){if(_0x460980){_0x460980[_0x0f3b('0x22')][_0x0f3b('0x7e')]=util[_0x0f3b('0x5d')]('SIP/%s',_0x142be0['user'][_0x0f3b('0x35')]);_0x460980['message']['channel']=_0x525769[_0x0f3b('0x72')];_0x460980['message'][_0x0f3b('0x73')]=_0x525769[_0x0f3b('0x72')];_0x460980[_0x0f3b('0x22')][_0x0f3b('0x7f')]=_0x0f3b('0x2f');respondWithRpcPromise('EventManager',_0x0f3b('0x74'),{'event':_0x0f3b('0x80'),'message':_0x460980[_0x0f3b('0x22')]},client9002);return _0x525769;}return null;})[_0x0f3b('0x32')](respondWithResult(_0xb7103a,null))[_0x0f3b('0x25')](handleError(_0xb7103a,null));};exports['create']=function(_0x2b3cf6,_0x66b9f2){var _0x184538;return db[_0x0f3b('0x4d')][_0x0f3b('0x81')](_0x2b3cf6[_0x0f3b('0x56')],{})[_0x0f3b('0x32')](function(_0x169d74){_0x184538=_0x169d74;return db['CmContact'][_0x0f3b('0x82')]({'where':{'id':_0x184538['ContactId']}});})['then'](function(_0x52332e){if(_[_0x0f3b('0x63')](_0x52332e)){return;}else{_0x184538['fax']=_0x52332e[_0x0f3b('0x5a')];return db[_0x0f3b('0x83')]['findOne']({'where':{'id':_0x184538[_0x0f3b('0x84')]}});}})[_0x0f3b('0x32')](function(_0x5281cd){return respondWithRpcPromise(_0x0f3b('0x85'),'SendFax',{'FaxAccountId':_[_0x0f3b('0x63')](_0x2b3cf6[_0x0f3b('0x56')])?undefined:_0x2b3cf6[_0x0f3b('0x56')][_0x0f3b('0x86')],'path':_[_0x0f3b('0x63')](_0x5281cd)?undefined:util[_0x0f3b('0x5d')](_0x0f3b('0x87'),_0x5281cd[_0x0f3b('0x88')]),'fax':_[_0x0f3b('0x63')](_0x184538[_0x0f3b('0x5a')])?undefined:_0x184538[_0x0f3b('0x5a')],'AttachmentId':_0x184538[_0x0f3b('0x84')]},client9002);})[_0x0f3b('0x32')](respondWithResult(_0x66b9f2,0xc9))[_0x0f3b('0x25')](handleError(_0x66b9f2,null));};exports[_0x0f3b('0x89')]=function(_0xff32b2,_0xc8fdee){var _0x1afd8a=path[_0x0f3b('0x8a')](config[_0x0f3b('0x8b')],_0x0f3b('0x8c'),_0x0f3b('0x8d'),_0x0f3b('0x8e'));return db['FaxMessage']['find']({'where':{'id':_0xff32b2[_0x0f3b('0x51')]['id']},'include':[{'model':db[_0x0f3b('0x83')],'as':_0x0f3b('0x83')}]})[_0x0f3b('0x32')](handleEntityNotFound(_0xc8fdee,null))[_0x0f3b('0x32')](function(_0x1b0260){if(_0x1b0260){return _0xc8fdee[_0x0f3b('0x89')](path[_0x0f3b('0x8a')](_0x1afd8a,_0x1b0260['Attachment'][_0x0f3b('0x88')]));}})[_0x0f3b('0x25')](handleError(_0xc8fdee,null));}; \ No newline at end of file +var _0x5463=['sequelize','User','interface','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','files','attachments','Attachment','download','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','FaxMessage,\x20%s,\x20%s','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','FaxMessage','type','key','model','map','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','describe','fax-interactions','fax','body','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','RejectMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5463,0x1b6));var _0x3546=function(_0x7c66cb,_0x38e89b){_0x7c66cb=_0x7c66cb-0x0;var _0x35a1f6=_0x5463[_0x7c66cb];return _0x35a1f6;};'use strict';var emlformat=require(_0x3546('0x0'));var rimraf=require(_0x3546('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3546('0x2'));var rp=require(_0x3546('0x3'));var moment=require(_0x3546('0x4'));var BPromise=require(_0x3546('0x5'));var Mustache=require(_0x3546('0x6'));var util=require(_0x3546('0x7'));var path=require(_0x3546('0x8'));var sox=require(_0x3546('0x9'));var csv=require(_0x3546('0xa'));var ejs=require(_0x3546('0xb'));var fs=require('fs');var fs_extra=require(_0x3546('0xc'));var _=require(_0x3546('0xd'));var squel=require('squel');var crypto=require(_0x3546('0xe'));var jsforce=require(_0x3546('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3546('0x10'));var Papa=require(_0x3546('0x11'));var Redis=require(_0x3546('0x12'));var authService=require(_0x3546('0x13'));var qs=require(_0x3546('0x14'));var as=require(_0x3546('0x15'));var hardwareService=require(_0x3546('0x16'));var logger=require('../../config/logger')(_0x3546('0x17'));var utils=require(_0x3546('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3546('0x19')]=_[_0x3546('0x1a')](config[_0x3546('0x19')],{'host':_0x3546('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3546('0x19')]));require(_0x3546('0x1c'))[_0x3546('0x1d')](socket);var jayson=require(_0x3546('0x1e'));var client=jayson['client'][_0x3546('0x1f')]({'port':0x232c});var client9002=jayson[_0x3546('0x20')][_0x3546('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x444fd9,_0x561ea1,_0x162358,_0xf471f){return new BPromise(function(_0x3d2365,_0x5d7452){var _0x4cf7d4=_0xf471f||client;return _0x4cf7d4[_0x3546('0x21')](_0x444fd9,_0x162358)[_0x3546('0x22')](function(_0x42f6fd){logger[_0x3546('0x23')]('FaxMessage,\x20%s,\x20%s',_0x561ea1,_0x3546('0x24'));logger['debug'](_0x3546('0x25'),_0x561ea1,_0x3546('0x24'),JSON['stringify'](_0x42f6fd));if(_0x42f6fd[_0x3546('0x26')]){if(_0x42f6fd['error'][_0x3546('0x27')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x561ea1,_0x42f6fd[_0x3546('0x26')][_0x3546('0x28')]);return _0x5d7452(_0x42f6fd['error'][_0x3546('0x28')]);}logger[_0x3546('0x26')](_0x3546('0x29'),_0x561ea1,_0x42f6fd[_0x3546('0x26')][_0x3546('0x28')]);return _0x3d2365(_0x42f6fd[_0x3546('0x26')][_0x3546('0x28')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x561ea1,_0x3546('0x24'));_0x3d2365(_0x42f6fd['result']['message']);}})['catch'](function(_0x177fc5){logger['error'](_0x3546('0x29'),_0x561ea1,_0x177fc5);_0x5d7452(_0x177fc5);});});}function respondWithStatusCode(_0x174db3,_0x1e17e5){_0x1e17e5=_0x1e17e5||0xcc;return function(_0x49b293){if(_0x49b293){return _0x174db3[_0x3546('0x2a')](_0x1e17e5);}return _0x174db3['status'](_0x1e17e5)[_0x3546('0x2b')]();};}function respondWithResult(_0x275a85,_0x56a705){_0x56a705=_0x56a705||0xc8;return function(_0x5e5aca){if(_0x5e5aca){return _0x275a85[_0x3546('0x2c')](_0x56a705)['json'](_0x5e5aca);}};}function respondWithFilteredResult(_0x3f274c,_0x544416){return function(_0x48c8d9){if(_0x48c8d9){var _0x429d84=typeof _0x544416[_0x3546('0x2d')]===_0x3546('0x2e')&&typeof _0x544416['limit']===_0x3546('0x2e');var _0xc75ecb=_0x48c8d9[_0x3546('0x2f')];var _0x2d915d=_0x429d84?0x0:_0x544416[_0x3546('0x2d')];var _0x487ae0=_0x429d84?_0x48c8d9[_0x3546('0x2f')]:_0x544416[_0x3546('0x2d')]+_0x544416[_0x3546('0x30')];var _0x3646d4;if(_0x487ae0>=_0xc75ecb){_0x487ae0=_0xc75ecb;_0x3646d4=0xc8;}else{_0x3646d4=0xce;}_0x3f274c[_0x3546('0x2c')](_0x3646d4);return _0x3f274c[_0x3546('0x31')](_0x3546('0x32'),_0x2d915d+'-'+_0x487ae0+'/'+_0xc75ecb)[_0x3546('0x33')](_0x48c8d9);}return null;};}function patchUpdates(_0x53ae91){return function(_0x56642f){try{jsonpatch[_0x3546('0x34')](_0x56642f,_0x53ae91,!![]);}catch(_0x1a13bf){return BPromise[_0x3546('0x35')](_0x1a13bf);}return _0x56642f['save']();};}function saveUpdates(_0x4a2ecd,_0x3e6fcb){return function(_0x1f8a40){if(_0x1f8a40){return _0x1f8a40[_0x3546('0x36')](_0x4a2ecd)['then'](function(_0x2a833c){return _0x2a833c;});}return null;};}function removeEntity(_0x44d37b,_0x4c3afc){return function(_0x593972){if(_0x593972){return _0x593972[_0x3546('0x37')]()[_0x3546('0x22')](function(){_0x44d37b['status'](0xcc)[_0x3546('0x2b')]();});}};}function handleEntityNotFound(_0x56cdfc,_0x4d6c39){return function(_0x5c4fd0){if(!_0x5c4fd0){_0x56cdfc['sendStatus'](0x194);}return _0x5c4fd0;};}function handleError(_0x634b63,_0x41e6e8){_0x41e6e8=_0x41e6e8||0x1f4;return function(_0x346800){logger[_0x3546('0x26')](_0x346800[_0x3546('0x38')]);if(_0x346800[_0x3546('0x39')]){delete _0x346800[_0x3546('0x39')];}_0x634b63[_0x3546('0x2c')](_0x41e6e8)[_0x3546('0x3a')](_0x346800);};}exports['index']=function(_0x2f3546,_0x449286){var _0x73b6fb={},_0x4a8968={},_0x446cb0={'count':0x0,'rows':[]};var _0x1a4533=_['map'](db[_0x3546('0x3b')]['rawAttributes'],function(_0x541d88){return{'name':_0x541d88['fieldName'],'type':_0x541d88[_0x3546('0x3c')][_0x3546('0x3d')]};});_0x4a8968[_0x3546('0x3e')]=_[_0x3546('0x3f')](_0x1a4533,'name');_0x4a8968[_0x3546('0x40')]=_['keys'](_0x2f3546[_0x3546('0x40')]);_0x4a8968['filters']=_[_0x3546('0x41')](_0x4a8968[_0x3546('0x3e')],_0x4a8968[_0x3546('0x40')]);_0x73b6fb[_0x3546('0x42')]=_[_0x3546('0x41')](_0x4a8968[_0x3546('0x3e')],qs[_0x3546('0x43')](_0x2f3546[_0x3546('0x40')]['fields']));_0x73b6fb[_0x3546('0x42')]=_0x73b6fb[_0x3546('0x42')][_0x3546('0x44')]?_0x73b6fb[_0x3546('0x42')]:_0x4a8968[_0x3546('0x3e')];if(!_0x2f3546[_0x3546('0x40')]['hasOwnProperty']('nolimit')){_0x73b6fb[_0x3546('0x30')]=qs['limit'](_0x2f3546['query']['limit']);_0x73b6fb[_0x3546('0x2d')]=qs[_0x3546('0x2d')](_0x2f3546[_0x3546('0x40')][_0x3546('0x2d')]);}_0x73b6fb['order']=qs[_0x3546('0x45')](_0x2f3546[_0x3546('0x40')]['sort']);_0x73b6fb[_0x3546('0x46')]=qs[_0x3546('0x47')](_[_0x3546('0x48')](_0x2f3546['query'],_0x4a8968[_0x3546('0x47')]),_0x1a4533);if(_0x2f3546['query'][_0x3546('0x49')]){_0x73b6fb[_0x3546('0x46')]=_['merge'](_0x73b6fb[_0x3546('0x46')],{'$or':_['map'](_0x1a4533,function(_0x20bf38){if(_0x20bf38[_0x3546('0x3c')]!==_0x3546('0x4a')){var _0x379cc0={};_0x379cc0[_0x20bf38[_0x3546('0x39')]]={'$like':'%'+_0x2f3546[_0x3546('0x40')][_0x3546('0x49')]+'%'};return _0x379cc0;}})});}_0x73b6fb=_['merge']({},_0x73b6fb,_0x2f3546[_0x3546('0x4b')]);var _0x1c5299={'where':_0x73b6fb[_0x3546('0x46')]};return db[_0x3546('0x3b')][_0x3546('0x2f')](_0x1c5299)[_0x3546('0x22')](function(_0x15fd74){_0x446cb0['count']=_0x15fd74;if(_0x2f3546[_0x3546('0x40')][_0x3546('0x4c')]){_0x73b6fb[_0x3546('0x4d')]=[{'all':!![]}];}return db[_0x3546('0x3b')][_0x3546('0x4e')](_0x73b6fb);})[_0x3546('0x22')](function(_0x4be3a8){_0x446cb0[_0x3546('0x4f')]=_0x4be3a8;return _0x446cb0;})['then'](respondWithFilteredResult(_0x449286,_0x73b6fb))[_0x3546('0x50')](handleError(_0x449286,null));};exports[_0x3546('0x51')]=function(_0x322467,_0x837baf){var _0x40ecda={'raw':!![],'where':{'id':_0x322467[_0x3546('0x52')]['id']}},_0x1014dc={};_0x1014dc[_0x3546('0x3e')]=_['keys'](db[_0x3546('0x3b')][_0x3546('0x53')]);_0x1014dc[_0x3546('0x40')]=_[_0x3546('0x54')](_0x322467[_0x3546('0x40')]);_0x1014dc[_0x3546('0x47')]=_[_0x3546('0x41')](_0x1014dc[_0x3546('0x3e')],_0x1014dc[_0x3546('0x40')]);_0x40ecda[_0x3546('0x42')]=_[_0x3546('0x41')](_0x1014dc[_0x3546('0x3e')],qs['fields'](_0x322467[_0x3546('0x40')][_0x3546('0x43')]));_0x40ecda[_0x3546('0x42')]=_0x40ecda[_0x3546('0x42')][_0x3546('0x44')]?_0x40ecda[_0x3546('0x42')]:_0x1014dc[_0x3546('0x3e')];if(_0x322467['query'][_0x3546('0x4c')]){_0x40ecda[_0x3546('0x4d')]=[{'all':!![]}];}_0x40ecda=_['merge']({},_0x40ecda,_0x322467[_0x3546('0x4b')]);return db[_0x3546('0x3b')][_0x3546('0x55')](_0x40ecda)['then'](handleEntityNotFound(_0x837baf,null))[_0x3546('0x22')](respondWithResult(_0x837baf,null))[_0x3546('0x50')](handleError(_0x837baf,null));};exports[_0x3546('0x36')]=function(_0xa677bc,_0xb1531e){if(_0xa677bc['body']['id']){delete _0xa677bc['body']['id'];}return db[_0x3546('0x3b')]['find']({'where':{'id':_0xa677bc[_0x3546('0x52')]['id']}})[_0x3546('0x22')](handleEntityNotFound(_0xb1531e,null))['then'](saveUpdates(_0xa677bc['body'],null))['then'](respondWithResult(_0xb1531e,null))[_0x3546('0x50')](handleError(_0xb1531e,null));};exports[_0x3546('0x37')]=function(_0x53f49f,_0x2f54fc){return db[_0x3546('0x3b')]['find']({'where':{'id':_0x53f49f[_0x3546('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f54fc,null))[_0x3546('0x22')](removeEntity(_0x2f54fc,null))['catch'](handleError(_0x2f54fc,null));};exports[_0x3546('0x56')]=function(_0x49ea60,_0x203309){return db[_0x3546('0x3b')][_0x3546('0x56')]()['then'](respondWithResult(_0x203309,null))['catch'](handleError(_0x203309,null));};var interaction_log=require('../../config/logger')(_0x3546('0x57'));exports['accept']=function(_0x28838c,_0x5cdfa4,_0x21d5ab){var _0x3b0afd={'agent':{},'channel':_0x3546('0x58')};if(_0x28838c['body']['id']){delete _0x28838c['body']['id'];}_0x28838c[_0x3546('0x59')][_0x3546('0x5a')]=!![];_0x28838c[_0x3546('0x59')][_0x3546('0x5b')]=moment()[_0x3546('0x5c')](_0x3546('0x5d'));_0x28838c[_0x3546('0x59')]['UserId']=_0x28838c[_0x3546('0x59')][_0x3546('0x5e')]||_0x28838c[_0x3546('0x5f')]['id'];_0x3b0afd[_0x3546('0x60')]['id']=_0x28838c[_0x3546('0x59')][_0x3546('0x5e')];return db[_0x3546('0x3b')][_0x3546('0x55')]({'where':{'id':_0x28838c[_0x3546('0x52')]['id'],'UserId':null}})[_0x3546('0x22')](handleEntityNotFound(_0x5cdfa4,null))[_0x3546('0x22')](saveUpdates(_0x28838c[_0x3546('0x59')],null))[_0x3546('0x22')](function(_0x5807f3){if(_0x5807f3){_0x3b0afd[_0x3546('0x28')]=_0x5807f3[_0x3546('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x3546('0x55')]({'where':{'id':_0x5807f3[_0x3546('0x62')]}});}return null;})[_0x3546('0x22')](handleEntityNotFound(_0x5cdfa4,null))[_0x3546('0x22')](function(_0xaa901b){if(_0xaa901b){return _0xaa901b[_0x3546('0x36')]({'UserId':_0x28838c[_0x3546('0x59')][_0x3546('0x5e')],'read1stAt':_[_0x3546('0x63')](_0xaa901b[_0x3546('0x64')])?moment()[_0x3546('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3546('0x22')](function(_0x452f90){if(_0x452f90){_0x3b0afd[_0x3546('0x65')]=_0x452f90[_0x3546('0x61')]({'plain':!![]});interaction_log['info'](_0x3546('0x66'),_0x28838c[_0x3546('0x5f')]['id'],_0x28838c[_0x3546('0x5f')][_0x3546('0x39')],_0x28838c['user'][_0x3546('0x67')],_0x3b0afd[_0x3546('0x65')]['id'],_0x28838c[_0x3546('0x59')]?JSON[_0x3546('0x68')](_0x28838c[_0x3546('0x59')]):_0x3546('0x69'));return respondWithRpcPromise(_0x3546('0x6a'),'acceptMessage',_0x3b0afd);}return null;})['then'](function(_0x2aa177){var _0x532046=_0x3546('0x6b')+_0x2aa177[_0x3546('0x28')][_0x3546('0x6c')];return db['sequelize'][_0x3546('0x40')](_0x532046,{'type':db[_0x3546('0x6d')][_0x3546('0x6e')][_0x3546('0x6f')],'raw':!![]})['then'](function(_0xf1e9bc){return _0xf1e9bc;});})[_0x3546('0x22')](function(_0x47b02a){if(_0x47b02a){_0x3b0afd[_0x3546('0x28')]['contact']=_0x47b02a[0x0];if(!_0x28838c[_0x3546('0x59')][_0x3546('0x5e')])return;return db['User']['find']({'where':{'id':_0x28838c[_0x3546('0x59')][_0x3546('0x5e')],'role':_0x3546('0x60')},'attributes':['id',_0x3546('0x39'),_0x3546('0x70'),'email',_0x3546('0x71')],'raw':!![]});}return null;})[_0x3546('0x22')](function(_0x336f75){if(!_0x336f75)return null;_0x3b0afd[_0x3546('0x28')][_0x3546('0x60')]=_0x336f75;return _0x3b0afd;})[_0x3546('0x22')](function(_0x1d40b6){if(_0x1d40b6){if(_0x28838c[_0x3546('0x59')]['manual']){_0x3b0afd[_0x3546('0x28')]['interface']=util[_0x3546('0x5c')](_0x3546('0x72'),_0x28838c[_0x3546('0x5f')][_0x3546('0x39')]);_0x3b0afd[_0x3546('0x28')]['channel']=_0x3b0afd[_0x3546('0x73')];_0x3b0afd[_0x3546('0x28')][_0x3546('0x74')]=_0x3b0afd[_0x3546('0x73')];_0x3b0afd[_0x3546('0x28')][_0x3546('0x75')]='accept';return respondWithRpcPromise(_0x3546('0x76'),_0x3546('0x76'),{'event':_0x3546('0x77'),'message':_0x3b0afd['message']},client9002)[_0x3546('0x22')](function(){return _0x3b0afd;});}return _0x3b0afd;}return null;})[_0x3546('0x22')](respondWithResult(_0x5cdfa4,null))[_0x3546('0x50')](handleError(_0x5cdfa4,null));};var interaction_log=require(_0x3546('0x78'))(_0x3546('0x57'));exports[_0x3546('0x35')]=function(_0xdf39ba,_0x4ab227,_0x30c409){var _0xc690e3={'agent':{},'channel':_0x3546('0x58')};if(_0xdf39ba[_0x3546('0x59')]['id']){delete _0xdf39ba['body']['id'];}_0xdf39ba[_0x3546('0x59')]['UserId']=_0xdf39ba[_0x3546('0x59')][_0x3546('0x5e')]||_0xdf39ba['user']['id'];_0xc690e3['agent']['id']=_0xdf39ba[_0x3546('0x59')][_0x3546('0x5e')];return db[_0x3546('0x3b')]['find']({'where':{'id':_0xdf39ba['params']['id'],'UserId':null}})[_0x3546('0x22')](handleEntityNotFound(_0x4ab227,null))[_0x3546('0x22')](function(_0x23fb83){if(_0x23fb83){_0xc690e3[_0x3546('0x28')]=_0x23fb83['get']({'plain':!![]});return db['FaxInteraction'][_0x3546('0x55')]({'where':{'id':_0x23fb83[_0x3546('0x62')]}});}return null;})[_0x3546('0x22')](handleEntityNotFound(_0x4ab227,null))['then'](function(_0x41963b){if(_0x41963b){_0xc690e3[_0x3546('0x65')]=_0x41963b[_0x3546('0x61')]({'plain':!![]});interaction_log[_0x3546('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xdf39ba[_0x3546('0x5f')]['id'],_0xdf39ba[_0x3546('0x5f')][_0x3546('0x39')],_0xdf39ba['user'][_0x3546('0x67')],_0xc690e3[_0x3546('0x65')]['id'],_0xdf39ba['body']?JSON[_0x3546('0x68')](_0xdf39ba['body']):_0x3546('0x69'));return respondWithRpcPromise(_0x3546('0x79'),'rejectMessage',_0xc690e3);}return null;})[_0x3546('0x22')](function(_0x3556d3){var _0x12cec9=_0x3546('0x6b')+_0x3556d3['message'][_0x3546('0x6c')];return db[_0x3546('0x7a')][_0x3546('0x40')](_0x12cec9,{'type':db[_0x3546('0x6d')][_0x3546('0x6e')]['SELECT'],'raw':!![]})[_0x3546('0x22')](function(_0x2a5bee){return _0x2a5bee;});})[_0x3546('0x22')](function(_0x2b92fa){if(_0x2b92fa){_0xc690e3[_0x3546('0x28')]['contact']=_0x2b92fa[0x0];if(!_0xdf39ba[_0x3546('0x59')][_0x3546('0x5e')])return;return db[_0x3546('0x7b')]['find']({'where':{'id':_0xdf39ba[_0x3546('0x59')][_0x3546('0x5e')],'role':_0x3546('0x60')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x50bf29){if(!_0x50bf29)return null;_0xc690e3['message'][_0x3546('0x60')]=_0x50bf29;return _0xc690e3;})[_0x3546('0x22')](function(_0x548afe){if(_0x548afe){_0x548afe[_0x3546('0x28')][_0x3546('0x7c')]=util[_0x3546('0x5c')](_0x3546('0x72'),_0xdf39ba[_0x3546('0x5f')]['name']);_0x548afe[_0x3546('0x28')]['channel']=_0xc690e3[_0x3546('0x73')];_0x548afe[_0x3546('0x28')][_0x3546('0x74')]=_0xc690e3['channel'];_0x548afe[_0x3546('0x28')][_0x3546('0x75')]=_0x3546('0x35');respondWithRpcPromise(_0x3546('0x76'),'EventManager',{'event':_0x3546('0x7d'),'message':_0x548afe[_0x3546('0x28')]},client9002);return _0xc690e3;}return null;})[_0x3546('0x22')](respondWithResult(_0x4ab227,null))['catch'](handleError(_0x4ab227,null));};exports['create']=function(_0x540893,_0x58abc1){var _0x5bdfc1;return db[_0x3546('0x3b')][_0x3546('0x7e')](_0x540893[_0x3546('0x59')],{})[_0x3546('0x22')](function(_0x1b6744){_0x5bdfc1=_0x1b6744;return db[_0x3546('0x7f')][_0x3546('0x80')]({'where':{'id':_0x5bdfc1[_0x3546('0x6c')]}});})[_0x3546('0x22')](function(_0x4f1402){if(_[_0x3546('0x63')](_0x4f1402)){return;}else{_0x5bdfc1[_0x3546('0x58')]=_0x4f1402[_0x3546('0x58')];return db['Attachment'][_0x3546('0x80')]({'where':{'id':_0x5bdfc1[_0x3546('0x81')]}});}})['then'](function(_0x5a048e){return respondWithRpcPromise(_0x3546('0x82'),_0x3546('0x82'),{'FaxAccountId':_['isNil'](_0x540893['body'])?undefined:_0x540893[_0x3546('0x59')][_0x3546('0x83')],'path':_[_0x3546('0x63')](_0x5a048e)?undefined:util[_0x3546('0x5c')]('/var/opt/motion2/server/files/attachments/%s',_0x5a048e[_0x3546('0x84')]),'fax':_['isNil'](_0x5bdfc1[_0x3546('0x58')])?undefined:_0x5bdfc1[_0x3546('0x58')],'AttachmentId':_0x5bdfc1[_0x3546('0x81')]},client9002);})['then'](respondWithResult(_0x58abc1,0xc9))[_0x3546('0x50')](handleError(_0x58abc1,null));};exports['download']=function(_0xa9cf2b,_0x3a5832){var _0x1b4ffe=path[_0x3546('0x85')](config[_0x3546('0x86')],_0x3546('0x87'),_0x3546('0x88'),_0x3546('0x89'));return db[_0x3546('0x3b')][_0x3546('0x55')]({'where':{'id':_0xa9cf2b[_0x3546('0x52')]['id']},'include':[{'model':db[_0x3546('0x8a')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x3a5832,null))['then'](function(_0x31b465){if(_0x31b465){return _0x3a5832[_0x3546('0x8b')](path['join'](_0x1b4ffe,_0x31b465[_0x3546('0x8a')][_0x3546('0x84')]));}})[_0x3546('0x50')](handleError(_0x3a5832,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d1e30cc..df85a3f 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 _0x078a=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x078a,0x12d));var _0xa078=function(_0x1fb0b1,_0xf3b3a){_0x1fb0b1=_0x1fb0b1-0x0;var _0x4f59f1=_0x078a[_0x1fb0b1];return _0x4f59f1;};'use strict';var EventEmitter=require(_0xa078('0x0'));var FaxMessage=require(_0xa078('0x1'))['db'][_0xa078('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa078('0x3')](0x0);var events={'afterCreate':_0xa078('0x4'),'afterUpdate':_0xa078('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267649){return function(_0x44af33,_0x2f4616,_0x51963f){FaxMessageEvents[_0xa078('0x6')](_0x267649+':'+_0x44af33['id'],_0x44af33);FaxMessageEvents['emit'](_0x267649,_0x44af33);_0x51963f(null);};}for(var e in events){if(events[_0xa078('0x7')](e)){var event=events[e];FaxMessage[_0xa078('0x8')](e,emitEvent(event));}}module[_0xa078('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xcac3=['hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1e61aa,_0x44781c){var _0x98818b=function(_0x32493e){while(--_0x32493e){_0x1e61aa['push'](_0x1e61aa['shift']());}};_0x98818b(++_0x44781c);}(_0xcac3,0x193));var _0x3cac=function(_0x1cb931,_0x41493d){_0x1cb931=_0x1cb931-0x0;var _0x1ef86b=_0xcac3[_0x1cb931];return _0x1ef86b;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3cac('0x2')](0x0);var events={'afterCreate':_0x3cac('0x3'),'afterUpdate':_0x3cac('0x4'),'afterDestroy':_0x3cac('0x5')};function emitEvent(_0x40033c){return function(_0xce6bcd,_0x2d7790,_0x346c24){FaxMessageEvents[_0x3cac('0x6')](_0x40033c+':'+_0xce6bcd['id'],_0xce6bcd);FaxMessageEvents[_0x3cac('0x6')](_0x40033c,_0xce6bcd);_0x346c24(null);};}for(var e in events){if(events[_0x3cac('0x7')](e)){var event=events[e];FaxMessage[_0x3cac('0x8')](e,emitEvent(event));}}module[_0x3cac('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index ffff34b..b3c5e3a 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 _0x7606=['FULLTEXT','models','get','direction','toLowerCase','isNil','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body'];(function(_0x4e8190,_0x3ea199){var _0x5685db=function(_0xd37b88){while(--_0xd37b88){_0x4e8190['push'](_0x4e8190['shift']());}};_0x5685db(++_0x3ea199);}(_0x7606,0x1cf));var _0x6760=function(_0x4fddd9,_0x34a2d5){_0x4fddd9=_0x4fddd9-0x0;var _0x9273=_0x7606[_0x4fddd9];return _0x9273;};'use strict';var _=require(_0x6760('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6760('0x1'));var moment=require(_0x6760('0x2'));var BPromise=require(_0x6760('0x3'));var rp=require(_0x6760('0x4'));var fs=require('fs');var path=require(_0x6760('0x5'));var rimraf=require('rimraf');var config=require(_0x6760('0x6'));var attributes=require(_0x6760('0x7'));module[_0x6760('0x8')]=function(_0x4a0a66,_0x968ee1){return _0x4a0a66['define'](_0x6760('0x9'),attributes,{'tableName':_0x6760('0xa'),'paranoid':![],'indexes':[{'name':_0x6760('0xb'),'fields':[_0x6760('0xc')],'type':_0x6760('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54afde,_0x5c78a0,_0x52be4f){var _0x1adc84=_0x4a0a66[_0x6760('0xe')];var _0x264918=_0x54afde[_0x6760('0xf')]({'plain':!![]});if(_0x264918[_0x6760('0x10')][_0x6760('0x11')]()==='in'||_0x264918[_0x6760('0x10')][_0x6760('0x11')]()==='out'&&!_0x264918['secret']&&!_[_0x6760('0x12')](_0x264918['UserId'])){_0x1adc84['FaxInteraction'][_0x6760('0x13')]({'where':{'id':_0x264918[_0x6760('0x14')]}})[_0x6760('0x15')](function(_0x112aa5){if(_0x112aa5){_0x112aa5[_0x6760('0x16')]({'lastMsgAt':_0x264918[_0x6760('0x17')],'lastMsgDirection':_0x264918[_0x6760('0x10')][_0x6760('0x11')]()});}})[_0x6760('0x18')](function(_0x1a7918){console[_0x6760('0x19')](_0x1a7918);});}_0x52be4f();}},'charset':_0x6760('0x1a'),'collate':_0x6760('0x1b')});}; \ No newline at end of file +var _0xb0a2=['fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','FaxInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0a2,0x1db));var _0x2b0a=function(_0x4e85d6,_0x51728f){_0x4e85d6=_0x4e85d6-0x0;var _0x2cf891=_0xb0a2[_0x4e85d6];return _0x2cf891;};'use strict';var _=require(_0x2b0a('0x0'));var util=require('util');var logger=require(_0x2b0a('0x1'))(_0x2b0a('0x2'));var moment=require(_0x2b0a('0x3'));var BPromise=require(_0x2b0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b0a('0x5'));var config=require(_0x2b0a('0x6'));var attributes=require(_0x2b0a('0x7'));module[_0x2b0a('0x8')]=function(_0x52b3e0,_0x143555){return _0x52b3e0[_0x2b0a('0x9')](_0x2b0a('0xa'),attributes,{'tableName':_0x2b0a('0xb'),'paranoid':![],'indexes':[{'name':_0x2b0a('0xc'),'fields':[_0x2b0a('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d92d7,_0x2b6dc4,_0x3ae7b1){var _0xead73=_0x52b3e0[_0x2b0a('0xe')];var _0x47ee73=_0x2d92d7[_0x2b0a('0xf')]({'plain':!![]});if(_0x47ee73[_0x2b0a('0x10')][_0x2b0a('0x11')]()==='in'||_0x47ee73[_0x2b0a('0x10')]['toLowerCase']()===_0x2b0a('0x12')&&!_0x47ee73['secret']&&!_[_0x2b0a('0x13')](_0x47ee73[_0x2b0a('0x14')])){_0xead73[_0x2b0a('0x15')]['findOne']({'where':{'id':_0x47ee73[_0x2b0a('0x16')]}})['then'](function(_0x1af45d){if(_0x1af45d){_0x1af45d['update']({'lastMsgAt':_0x47ee73[_0x2b0a('0x17')],'lastMsgDirection':_0x47ee73[_0x2b0a('0x10')][_0x2b0a('0x11')]()});}})['catch'](function(_0x488780){console[_0x2b0a('0x18')](_0x488780);});}_0x3ae7b1();}},'charset':_0x2b0a('0x19'),'collate':_0x2b0a('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7a29535..9e5e077 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 _0x99e9=['register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x99e9,0xb4));var _0x999e=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x99e9[_0x532d78];return _0x5990c4;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});config[_0x999e('0xa')]=_[_0x999e('0xb')](config['redis'],{'host':_0x999e('0xc'),'port':0x18eb});var socket=require(_0x999e('0xd'))(new Redis(config[_0x999e('0xa')]));require(_0x999e('0xe'))[_0x999e('0xf')](socket);function respondWithRpcPromise(_0x175042,_0x3f2c24,_0x180846){return new BPromise(function(_0x3cb1c2,_0xf40130){return client[_0x999e('0x10')](_0x175042,_0x180846)[_0x999e('0x11')](function(_0x4246b1){logger[_0x999e('0x12')](_0x999e('0x13'),_0x3f2c24,_0x999e('0x14'));logger[_0x999e('0x15')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3f2c24,_0x999e('0x14'),JSON['stringify'](_0x4246b1));if(_0x4246b1[_0x999e('0x16')]){if(_0x4246b1[_0x999e('0x16')][_0x999e('0x17')]===0x1f4){logger['error'](_0x999e('0x13'),_0x3f2c24,_0x4246b1['error'][_0x999e('0x18')]);return _0xf40130(_0x4246b1['error']['message']);}logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);return _0x3cb1c2(_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3f2c24,'request\x20sent');_0x3cb1c2(_0x4246b1[_0x999e('0x19')][_0x999e('0x18')]);}})[_0x999e('0x1a')](function(_0x302f52){logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x302f52);_0xf40130(_0x302f52);});});}exports['CreateFaxMessage']=function(_0x5d86d4){var _0xc20d3e=this;return new Promise(function(_0x3f4d7c,_0x3b3642){return db['FaxMessage'][_0x999e('0x1b')](_0x5d86d4[_0x999e('0x1c')],{'raw':_0x5d86d4[_0x999e('0x1d')]?_0x5d86d4[_0x999e('0x1d')][_0x999e('0x1e')]===undefined?!![]:![]:!![]})[_0x999e('0x11')](function(_0x427bcf){logger['info']('CreateFaxMessage',_0x5d86d4);logger[_0x999e('0x15')](_0x999e('0x1f'),_0x5d86d4,JSON['stringify'](_0x427bcf));_0x3f4d7c(_0x427bcf);})[_0x999e('0x1a')](function(_0xe324d8){logger[_0x999e('0x16')](_0x999e('0x1f'),_0xe324d8[_0x999e('0x18')],_0x5d86d4);_0x3b3642(_0xc20d3e[_0x999e('0x16')](0x1f4,_0xe324d8['message']));});});};exports[_0x999e('0x20')]=function(_0x4199ff){var _0x11068e=this;return new Promise(function(_0x12b9ad,_0x1b7adb){return db[_0x999e('0x21')][_0x999e('0x22')](_0x4199ff['body'],{'raw':_0x4199ff[_0x999e('0x1d')]?_0x4199ff['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x23')]||null:null,'attributes':_0x4199ff['options']?_0x4199ff[_0x999e('0x1d')][_0x999e('0x24')]||null:null,'limit':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x25')]||null:null})[_0x999e('0x11')](function(_0x82e067){logger[_0x999e('0x12')](_0x999e('0x20'),_0x4199ff);logger[_0x999e('0x15')]('UpdateFaxMessage',_0x4199ff,JSON[_0x999e('0x26')](_0x82e067));_0x12b9ad(_0x82e067);})[_0x999e('0x1a')](function(_0x371613){logger['error'](_0x999e('0x20'),_0x371613['message'],_0x4199ff);_0x1b7adb(_0x11068e['error'](0x1f4,_0x371613[_0x999e('0x18')]));});});}; \ No newline at end of file +var _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x52b9cc,_0x574655){var _0x391f68=function(_0xea710c){while(--_0xea710c){_0x52b9cc['push'](_0x52b9cc['shift']());}};_0x391f68(++_0x574655);}(_0x84ab,0x12f));var _0xb84a=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x84ab[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index a31f57d..52caff8 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 _0xdc35=['save','remove','update','emit','removeListener','faxMessage:'];(function(_0xd15c9f,_0x5569d5){var _0x110767=function(_0x5864e2){while(--_0x5864e2){_0xd15c9f['push'](_0xd15c9f['shift']());}};_0x110767(++_0x5569d5);}(_0xdc35,0x120));var _0x5dc3=function(_0x5141cd,_0x2c1297){_0x5141cd=_0x5141cd-0x0;var _0x83a774=_0xdc35[_0x5141cd];return _0x83a774;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x5dc3('0x0'),_0x5dc3('0x1'),_0x5dc3('0x2')];function createListener(_0x1d6ad3,_0x1b93ce){return function(_0x1757a4){_0x1b93ce[_0x5dc3('0x3')](_0x1d6ad3,_0x1757a4);};}function removeListener(_0x32d3d2,_0x2d8755){return function(){FaxMessageEvents[_0x5dc3('0x4')](_0x32d3d2,_0x2d8755);};}exports['register']=function(_0x97712b){for(var _0x37e4f9=0x0,_0x257bc9=events['length'];_0x37e4f9<_0x257bc9;_0x37e4f9++){var _0x5204b3=events[_0x37e4f9];var _0x5d2276=createListener(_0x5dc3('0x5')+_0x5204b3,_0x97712b);FaxMessageEvents['on'](_0x5204b3,_0x5d2276);}}; \ No newline at end of file +var _0xda42=['emit','removeListener','register','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x1c3fee,_0x26b5ac){var _0x112788=function(_0x2e9b23){while(--_0x2e9b23){_0x1c3fee['push'](_0x1c3fee['shift']());}};_0x112788(++_0x26b5ac);}(_0xda42,0x74));var _0x2da4=function(_0xcb2f27,_0x48b1ed){_0xcb2f27=_0xcb2f27-0x0;var _0x1a638a=_0xda42[_0xcb2f27];return _0x1a638a;};'use strict';var FaxMessageEvents=require(_0x2da4('0x0'));var events=[_0x2da4('0x1'),_0x2da4('0x2'),_0x2da4('0x3')];function createListener(_0x4c56e7,_0x4d0b83){return function(_0x2e99f8){_0x4d0b83[_0x2da4('0x4')](_0x4c56e7,_0x2e99f8);};}function removeListener(_0x34edba,_0x1b6871){return function(){FaxMessageEvents[_0x2da4('0x5')](_0x34edba,_0x1b6871);};}exports[_0x2da4('0x6')]=function(_0x2e4263){for(var _0x3834dd=0x0,_0xa68cc0=events['length'];_0x3834dd<_0xa68cc0;_0x3834dd++){var _0x24a445=events[_0x3834dd];var _0x796357=createListener(_0x2da4('0x7')+_0x24a445,_0x2e4263);FaxMessageEvents['on'](_0x24a445,_0x796357);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2b6b1b7..a841534 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 _0x4ded=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','download','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x7afa1d,_0x28e7a2){var _0x379df8=function(_0x3b8727){while(--_0x3b8727){_0x7afa1d['push'](_0x7afa1d['shift']());}};_0x379df8(++_0x28e7a2);}(_0x4ded,0x116));var _0xd4de=function(_0x3399a3,_0x4eb5dc){_0x3399a3=_0x3399a3-0x0;var _0xb855e2=_0x4ded[_0x3399a3];return _0xb855e2;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id',auth[_0xd4de('0xe')](),controller['show']);router['get']('/:id/download',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xd4de('0x11'),'faxmessage:create'),controller[_0xd4de('0x12')]);router[_0xd4de('0x13')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x15')]);router[_0xd4de('0x13')](_0xd4de('0x16'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x17')]);router[_0xd4de('0x13')](_0xd4de('0x18'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x19')]);router[_0xd4de('0x1a')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x27c1a3,_0x5b1619){var _0x581fd3=function(_0x23e6bf){while(--_0x23e6bf){_0x27c1a3['push'](_0x27c1a3['shift']());}};_0x581fd3(++_0x5b1619);}(_0xca66,0x8b));var _0x6ca6=function(_0x5514e9,_0x580300){_0x5514e9=_0x5514e9-0x0;var _0x255c58=_0xca66[_0x5514e9];return _0x255c58;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2d3e631..d88b6b0 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 _0xd82c=['sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xd82c,0x66));var _0xcd82=function(_0xf26c17,_0x37c9da){_0xf26c17=_0xf26c17-0x0;var _0x112d94=_0xd82c[_0xf26c17];return _0x112d94;};'use strict';var Sequelize=require(_0xcd82('0x0'));module[_0xcd82('0x1')]={'name':{'type':Sequelize[_0xcd82('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcd82('0x2')]},'timeout':{'type':Sequelize[_0xcd82('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xcd82('0x4'),_0xcd82('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xcd82('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x909a=['exports','STRING','name','INTEGER','rrmemory','roundrobin','sequelize'];(function(_0x764d93,_0x271c17){var _0x5894e4=function(_0x45c8e5){while(--_0x45c8e5){_0x764d93['push'](_0x764d93['shift']());}};_0x5894e4(++_0x271c17);}(_0x909a,0xbc));var _0xa909=function(_0x1738ee,_0x32e204){_0x1738ee=_0x1738ee-0x0;var _0x4b1b60=_0x909a[_0x1738ee];return _0x4b1b60;};'use strict';var Sequelize=require(_0xa909('0x0'));module[_0xa909('0x1')]={'name':{'type':Sequelize[_0xa909('0x2')],'unique':_0xa909('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa909('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa909('0x5'),'beepall',_0xa909('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa909('0x4')],'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 a965695..f5745d8 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 _0xeaff=['ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams'];(function(_0x2bf001,_0x4ed442){var _0x3980fb=function(_0x28de93){while(--_0x28de93){_0x2bf001['push'](_0x2bf001['shift']());}};_0x3980fb(++_0x4ed442);}(_0xeaff,0x1ca));var _0xfeaf=function(_0x1b0731,_0x34f67e){_0x1b0731=_0x1b0731-0x0;var _0x539901=_0xeaff[_0x1b0731];return _0x539901;};'use strict';var emlformat=require(_0xfeaf('0x0'));var rimraf=require(_0xfeaf('0x1'));var zipdir=require(_0xfeaf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfeaf('0x3'));var moment=require('moment');var BPromise=require(_0xfeaf('0x4'));var Mustache=require('mustache');var util=require(_0xfeaf('0x5'));var path=require('path');var sox=require(_0xfeaf('0x6'));var csv=require(_0xfeaf('0x7'));var ejs=require(_0xfeaf('0x8'));var fs=require('fs');var fs_extra=require(_0xfeaf('0x9'));var _=require(_0xfeaf('0xa'));var squel=require(_0xfeaf('0xb'));var crypto=require(_0xfeaf('0xc'));var jsforce=require(_0xfeaf('0xd'));var deskjs=require(_0xfeaf('0xe'));var toCsv=require(_0xfeaf('0x7'));var querystring=require(_0xfeaf('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfeaf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfeaf('0x11'));var logger=require('../../config/logger')(_0xfeaf('0x12'));var utils=require(_0xfeaf('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfeaf('0x14'));var db=require(_0xfeaf('0x15'))['db'];config[_0xfeaf('0x16')]=_[_0xfeaf('0x17')](config[_0xfeaf('0x16')],{'host':_0xfeaf('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeaf('0x16')]));require(_0xfeaf('0x19'))[_0xfeaf('0x1a')](socket);function respondWithStatusCode(_0x1ebcfe,_0x4d4827){_0x4d4827=_0x4d4827||0xcc;return function(_0x51c14a){if(_0x51c14a){return _0x1ebcfe[_0xfeaf('0x1b')](_0x4d4827);}return _0x1ebcfe[_0xfeaf('0x1c')](_0x4d4827)['end']();};}function respondWithResult(_0x23a097,_0xc04797){_0xc04797=_0xc04797||0xc8;return function(_0x1b925f){if(_0x1b925f){return _0x23a097[_0xfeaf('0x1c')](_0xc04797)[_0xfeaf('0x1d')](_0x1b925f);}};}function respondWithFilteredResult(_0x32730f,_0x4164fd){return function(_0x1b505e){if(_0x1b505e){var _0x12e74b=typeof _0x4164fd['offset']===_0xfeaf('0x1e')&&typeof _0x4164fd[_0xfeaf('0x1f')]===_0xfeaf('0x1e');var _0x3a1b70=_0x1b505e[_0xfeaf('0x20')];var _0x2a06b2=_0x12e74b?0x0:_0x4164fd['offset'];var _0x4614ef=_0x12e74b?_0x1b505e[_0xfeaf('0x20')]:_0x4164fd[_0xfeaf('0x21')]+_0x4164fd[_0xfeaf('0x1f')];var _0x405de0;if(_0x4614ef>=_0x3a1b70){_0x4614ef=_0x3a1b70;_0x405de0=0xc8;}else{_0x405de0=0xce;}_0x32730f[_0xfeaf('0x1c')](_0x405de0);return _0x32730f[_0xfeaf('0x22')](_0xfeaf('0x23'),_0x2a06b2+'-'+_0x4614ef+'/'+_0x3a1b70)[_0xfeaf('0x1d')](_0x1b505e);}return null;};}function patchUpdates(_0x2eeedf){return function(_0x2a89f3){try{jsonpatch[_0xfeaf('0x24')](_0x2a89f3,_0x2eeedf,!![]);}catch(_0x3ef2ee){return BPromise[_0xfeaf('0x25')](_0x3ef2ee);}return _0x2a89f3[_0xfeaf('0x26')]();};}function saveUpdates(_0x1e8409,_0x1e8213){return function(_0x219603){if(_0x219603){return _0x219603[_0xfeaf('0x27')](_0x1e8409)['then'](function(_0x2fae51){return _0x2fae51;});}return null;};}function removeEntity(_0xb58410,_0x3185c2){return function(_0x1f871b){if(_0x1f871b){return _0x1f871b[_0xfeaf('0x28')]()[_0xfeaf('0x29')](function(){var _0x1077fd=_0x1f871b['get']({'plain':!![]});var _0x2856fb=_0xfeaf('0x2a');return db[_0xfeaf('0x2b')][_0xfeaf('0x28')]({'where':{'type':_0x2856fb,'resourceId':_0x1077fd['id']}})['then'](function(){return _0x1f871b;});})[_0xfeaf('0x29')](function(){_0xb58410[_0xfeaf('0x1c')](0xcc)[_0xfeaf('0x2c')]();});}};}function handleEntityNotFound(_0x2ae459,_0x11626c){return function(_0x3c7bb2){if(!_0x3c7bb2){_0x2ae459['sendStatus'](0x194);}return _0x3c7bb2;};}function handleError(_0x36d5a1,_0x3bc8eb){_0x3bc8eb=_0x3bc8eb||0x1f4;return function(_0x16f1c9){logger[_0xfeaf('0x2d')](_0x16f1c9[_0xfeaf('0x2e')]);if(_0x16f1c9[_0xfeaf('0x2f')]){delete _0x16f1c9[_0xfeaf('0x2f')];}_0x36d5a1[_0xfeaf('0x1c')](_0x3bc8eb)[_0xfeaf('0x30')](_0x16f1c9);};}exports[_0xfeaf('0x31')]=function(_0x4c4d76,_0xc5a950){var _0x3a6203={},_0x5f1a0e={},_0x4a92a4={'count':0x0,'rows':[]};var _0x2dba0c=_[_0xfeaf('0x32')](db[_0xfeaf('0x33')][_0xfeaf('0x34')],function(_0x51df3f){return{'name':_0x51df3f['fieldName'],'type':_0x51df3f[_0xfeaf('0x35')][_0xfeaf('0x36')]};});_0x5f1a0e[_0xfeaf('0x37')]=_['map'](_0x2dba0c,_0xfeaf('0x2f'));_0x5f1a0e['query']=_[_0xfeaf('0x38')](_0x4c4d76[_0xfeaf('0x39')]);_0x5f1a0e[_0xfeaf('0x3a')]=_[_0xfeaf('0x3b')](_0x5f1a0e[_0xfeaf('0x37')],_0x5f1a0e[_0xfeaf('0x39')]);_0x3a6203[_0xfeaf('0x3c')]=_[_0xfeaf('0x3b')](_0x5f1a0e[_0xfeaf('0x37')],qs['fields'](_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x3d')]));_0x3a6203['attributes']=_0x3a6203[_0xfeaf('0x3c')][_0xfeaf('0x3e')]?_0x3a6203[_0xfeaf('0x3c')]:_0x5f1a0e[_0xfeaf('0x37')];if(!_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x3f')]('nolimit')){_0x3a6203[_0xfeaf('0x1f')]=qs[_0xfeaf('0x1f')](_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x1f')]);_0x3a6203[_0xfeaf('0x21')]=qs[_0xfeaf('0x21')](_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x21')]);}_0x3a6203[_0xfeaf('0x40')]=qs['sort'](_0x4c4d76['query'][_0xfeaf('0x41')]);_0x3a6203['where']=qs[_0xfeaf('0x3a')](_[_0xfeaf('0x42')](_0x4c4d76[_0xfeaf('0x39')],_0x5f1a0e[_0xfeaf('0x3a')]),_0x2dba0c);if(_0x4c4d76[_0xfeaf('0x39')]['filter']){_0x3a6203[_0xfeaf('0x43')]=_['merge'](_0x3a6203[_0xfeaf('0x43')],{'$or':_[_0xfeaf('0x32')](_0x2dba0c,function(_0x532f96){if(_0x532f96[_0xfeaf('0x35')]!==_0xfeaf('0x44')){var _0x26615e={};_0x26615e[_0x532f96[_0xfeaf('0x2f')]]={'$like':'%'+_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x45')]+'%'};return _0x26615e;}})});}_0x3a6203=_[_0xfeaf('0x46')]({},_0x3a6203,_0x4c4d76[_0xfeaf('0x47')]);var _0x940488={'where':_0x3a6203[_0xfeaf('0x43')]};return db[_0xfeaf('0x33')]['count'](_0x940488)['then'](function(_0x4679d2){_0x4a92a4[_0xfeaf('0x20')]=_0x4679d2;if(_0x4c4d76[_0xfeaf('0x39')][_0xfeaf('0x48')]){_0x3a6203[_0xfeaf('0x49')]=[{'all':!![]}];}return db[_0xfeaf('0x33')]['findAll'](_0x3a6203);})[_0xfeaf('0x29')](function(_0x44e632){_0x4a92a4['rows']=_0x44e632;return _0x4a92a4;})['then'](respondWithFilteredResult(_0xc5a950,_0x3a6203))[_0xfeaf('0x4a')](handleError(_0xc5a950,null));};exports['show']=function(_0x3d203c,_0x1da1ce){var _0x360c50={'raw':!![],'where':{'id':_0x3d203c[_0xfeaf('0x4b')]['id']}},_0x32a2d2={};_0x32a2d2[_0xfeaf('0x37')]=_['keys'](db[_0xfeaf('0x33')][_0xfeaf('0x34')]);_0x32a2d2[_0xfeaf('0x39')]=_[_0xfeaf('0x38')](_0x3d203c[_0xfeaf('0x39')]);_0x32a2d2['filters']=_[_0xfeaf('0x3b')](_0x32a2d2[_0xfeaf('0x37')],_0x32a2d2[_0xfeaf('0x39')]);_0x360c50[_0xfeaf('0x3c')]=_[_0xfeaf('0x3b')](_0x32a2d2[_0xfeaf('0x37')],qs[_0xfeaf('0x3d')](_0x3d203c[_0xfeaf('0x39')][_0xfeaf('0x3d')]));_0x360c50['attributes']=_0x360c50[_0xfeaf('0x3c')][_0xfeaf('0x3e')]?_0x360c50[_0xfeaf('0x3c')]:_0x32a2d2[_0xfeaf('0x37')];if(_0x3d203c[_0xfeaf('0x39')][_0xfeaf('0x48')]){_0x360c50[_0xfeaf('0x49')]=[{'all':!![]}];}_0x360c50=_[_0xfeaf('0x46')]({},_0x360c50,_0x3d203c[_0xfeaf('0x47')]);return db['FaxQueue'][_0xfeaf('0x4c')](_0x360c50)['then'](handleEntityNotFound(_0x1da1ce,null))[_0xfeaf('0x29')](respondWithResult(_0x1da1ce,null))[_0xfeaf('0x4a')](handleError(_0x1da1ce,null));};exports[_0xfeaf('0x4d')]=function(_0x1b2755,_0x516750){return db['FaxQueue'][_0xfeaf('0x4d')](_0x1b2755[_0xfeaf('0x4e')],{})[_0xfeaf('0x29')](function(_0x2ad57e){var _0x2ca545=_0x1b2755[_0xfeaf('0x4f')][_0xfeaf('0x50')]({'plain':!![]});if(!_0x2ca545)throw new Error(_0xfeaf('0x51'));if(_0x2ca545['role']===_0xfeaf('0x4f')){var _0xf9ae94=_0x2ad57e[_0xfeaf('0x50')]({'plain':!![]});var _0x31b0ce=_0xfeaf('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x31b0ce,'userProfileId':_0x2ca545['userProfileId']},'raw':!![]})[_0xfeaf('0x29')](function(_0x377b14){if(_0x377b14&&_0x377b14['autoAssociation']===0x0){return db[_0xfeaf('0x2b')][_0xfeaf('0x4d')]({'name':_0xf9ae94[_0xfeaf('0x2f')],'resourceId':_0xf9ae94['id'],'type':_0x377b14[_0xfeaf('0x2f')],'sectionId':_0x377b14['id']},{})[_0xfeaf('0x29')](function(){return _0x2ad57e;});}else{return _0x2ad57e;}})[_0xfeaf('0x4a')](function(_0x2dd9b8){logger[_0xfeaf('0x2d')](_0xfeaf('0x52'),_0x2dd9b8);throw _0x2dd9b8;});}return _0x2ad57e;})['then'](respondWithResult(_0x516750,0xc9))[_0xfeaf('0x4a')](handleError(_0x516750,null));};exports[_0xfeaf('0x27')]=function(_0x6c0eb9,_0x374899){if(_0x6c0eb9[_0xfeaf('0x4e')]['id']){delete _0x6c0eb9[_0xfeaf('0x4e')]['id'];}return db[_0xfeaf('0x33')][_0xfeaf('0x4c')]({'where':{'id':_0x6c0eb9[_0xfeaf('0x4b')]['id']}})[_0xfeaf('0x29')](handleEntityNotFound(_0x374899,null))[_0xfeaf('0x29')](saveUpdates(_0x6c0eb9[_0xfeaf('0x4e')],null))['then'](respondWithResult(_0x374899,null))['catch'](handleError(_0x374899,null));};exports[_0xfeaf('0x28')]=function(_0x32585f,_0x33e27b){return db[_0xfeaf('0x33')][_0xfeaf('0x4c')]({'where':{'id':_0x32585f[_0xfeaf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33e27b,null))[_0xfeaf('0x29')](removeEntity(_0x33e27b,null))[_0xfeaf('0x4a')](handleError(_0x33e27b,null));};exports[_0xfeaf('0x53')]=function(_0x3deb1a,_0x572271){return db[_0xfeaf('0x33')][_0xfeaf('0x53')]()['then'](respondWithResult(_0x572271,null))['catch'](handleError(_0x572271,null));};exports[_0xfeaf('0x54')]=function(_0x2829a3,_0x3825d1,_0x4481b7){var _0x19e360={'raw':!![],'where':{}},_0x423909={},_0x3c0afe;return db[_0xfeaf('0x33')][_0xfeaf('0x55')]({'where':{'id':_0x2829a3[_0xfeaf('0x4b')]['id']}})[_0xfeaf('0x29')](handleEntityNotFound(_0x3825d1,null))[_0xfeaf('0x29')](function(_0x34e5c4){if(_0x34e5c4){_0x3c0afe=_0x34e5c4[_0xfeaf('0x50')]({'plain':!![]});_0x423909[_0xfeaf('0x37')]=_[_0xfeaf('0x38')](db['UserFaxQueue'][_0xfeaf('0x34')]);_0x423909[_0xfeaf('0x39')]=_[_0xfeaf('0x38')](_0x2829a3['query']);_0x423909[_0xfeaf('0x3a')]=_[_0xfeaf('0x3b')](_0x423909[_0xfeaf('0x37')],_0x423909[_0xfeaf('0x39')]);_0x19e360['attributes']=_[_0xfeaf('0x3b')](_0x423909['model'],qs[_0xfeaf('0x3d')](_0x2829a3[_0xfeaf('0x39')][_0xfeaf('0x3d')]));_0x19e360[_0xfeaf('0x3c')]=_0x19e360[_0xfeaf('0x3c')][_0xfeaf('0x3e')]?_0x19e360[_0xfeaf('0x3c')]:_0x423909[_0xfeaf('0x37')];if(!_0x2829a3[_0xfeaf('0x39')]['hasOwnProperty'](_0xfeaf('0x56'))){_0x19e360[_0xfeaf('0x1f')]=qs['limit'](_0x2829a3[_0xfeaf('0x39')][_0xfeaf('0x1f')]);_0x19e360[_0xfeaf('0x21')]=qs[_0xfeaf('0x21')](_0x2829a3[_0xfeaf('0x39')][_0xfeaf('0x21')]);}_0x19e360[_0xfeaf('0x40')]=qs['sort'](_0x2829a3[_0xfeaf('0x39')]['sort']);_0x19e360[_0xfeaf('0x43')]=qs[_0xfeaf('0x3a')](_[_0xfeaf('0x42')](_0x2829a3['query'],_0x423909[_0xfeaf('0x3a')]));_0x19e360['where'][_0xfeaf('0x57')]=_0x34e5c4['id'];if(_0x2829a3[_0xfeaf('0x39')][_0xfeaf('0x45')]){_0x19e360['where']=_['merge'](_0x19e360[_0xfeaf('0x43')],{'$or':_['map'](_0x19e360['attributes'],function(_0x39b23c){var _0x21f5b1={};_0x21f5b1[_0x39b23c]={'$like':'%'+_0x2829a3[_0xfeaf('0x39')][_0xfeaf('0x45')]+'%'};return _0x21f5b1;})});}_0x19e360=_[_0xfeaf('0x46')]({},_0x19e360,_0x2829a3[_0xfeaf('0x47')]);return db[_0xfeaf('0x58')]['findAll'](_0x19e360);}})[_0xfeaf('0x29')](function(_0x239845){if(_0x239845){return db[_0xfeaf('0x59')][_0xfeaf('0x5a')]({'where':{'id':_[_0xfeaf('0x32')](_0x239845,_0xfeaf('0x5b')),'role':'agent'},'attributes':['id','name',_0xfeaf('0x5c'),_0xfeaf('0x5d'),'createdAt']});}})[_0xfeaf('0x29')](function(_0x256df6){if(_0x256df6){return{'count':_0x256df6['count'],'rows':_[_0xfeaf('0x32')](_0x256df6[_0xfeaf('0x5e')],function(_0x155055){return{'membername':_0x155055[_0xfeaf('0x2f')],'UserId':_0x155055['id'],'queue_name':_0x3c0afe['name'],'FaxQueueId':_0x3c0afe['id'],'interface':util[_0xfeaf('0x5f')](_0xfeaf('0x60'),_0xfeaf('0x61'),_0x155055[_0xfeaf('0x2f')]),'penalty':0x0,'paused':_0x155055['faxPause'],'createdAt':_0x155055[_0xfeaf('0x62')],'updatedAt':_0x155055[_0xfeaf('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfeaf('0x29')](respondWithFilteredResult(_0x3825d1,_0x19e360))[_0xfeaf('0x4a')](handleError(_0x3825d1,null));};exports[_0xfeaf('0x63')]=function(_0x39bd85,_0x1a48db,_0x5b0b88){var _0x519494={};var _0x39e202={};var _0x500d74;var _0x3e3e16;return db['FaxQueue']['findOne']({'where':{'id':_0x39bd85['params']['id']}})[_0xfeaf('0x29')](handleEntityNotFound(_0x1a48db,null))['then'](function(_0x3091a5){if(_0x3091a5){_0x500d74=_0x3091a5;_0x39e202[_0xfeaf('0x37')]=_[_0xfeaf('0x38')](db[_0xfeaf('0x64')][_0xfeaf('0x34')]);_0x39e202[_0xfeaf('0x39')]=_[_0xfeaf('0x38')](_0x39bd85['query']);_0x39e202[_0xfeaf('0x3a')]=_[_0xfeaf('0x3b')](_0x39e202[_0xfeaf('0x37')],_0x39e202['query']);_0x519494[_0xfeaf('0x3c')]=_[_0xfeaf('0x3b')](_0x39e202[_0xfeaf('0x37')],qs[_0xfeaf('0x3d')](_0x39bd85['query'][_0xfeaf('0x3d')]));_0x519494[_0xfeaf('0x3c')]=_0x519494[_0xfeaf('0x3c')]['length']?_0x519494[_0xfeaf('0x3c')]:_0x39e202[_0xfeaf('0x37')];_0x519494[_0xfeaf('0x40')]=qs[_0xfeaf('0x41')](_0x39bd85[_0xfeaf('0x39')][_0xfeaf('0x41')]);_0x519494[_0xfeaf('0x43')]=qs[_0xfeaf('0x3a')](_[_0xfeaf('0x42')](_0x39bd85['query'],_0x39e202['filters']));if(_0x39bd85[_0xfeaf('0x39')]['filter']){_0x519494[_0xfeaf('0x43')]=_['merge'](_0x519494[_0xfeaf('0x43')],{'$or':_[_0xfeaf('0x32')](_0x519494['attributes'],function(_0x183e44){var _0x261333={};_0x261333[_0x183e44]={'$like':'%'+_0x39bd85['query'][_0xfeaf('0x45')]+'%'};return _0x261333;})});}_0x519494=_[_0xfeaf('0x46')]({},_0x519494,_0x39bd85[_0xfeaf('0x47')]);return _0x500d74[_0xfeaf('0x63')](_0x519494);}})['then'](function(_0x3a62ce){if(_0x3a62ce){_0x3e3e16=_0x3a62ce['length'];if(!_0x39bd85[_0xfeaf('0x39')][_0xfeaf('0x3f')]('nolimit')){_0x519494[_0xfeaf('0x1f')]=qs[_0xfeaf('0x1f')](_0x39bd85[_0xfeaf('0x39')][_0xfeaf('0x1f')]);_0x519494[_0xfeaf('0x21')]=qs[_0xfeaf('0x21')](_0x39bd85[_0xfeaf('0x39')][_0xfeaf('0x21')]);}return _0x500d74[_0xfeaf('0x63')](_0x519494);}})[_0xfeaf('0x29')](function(_0x3daa2d){if(_0x3daa2d){return _0x3daa2d?{'count':_0x3e3e16,'rows':_0x3daa2d}:null;}})[_0xfeaf('0x29')](respondWithResult(_0x1a48db,null))['catch'](handleError(_0x1a48db,null));};exports[_0xfeaf('0x65')]=function(_0x8747c7,_0x2d1a70,_0x598cfb){var _0x5d7681=_0x8747c7['body'][_0xfeaf('0x66')];return db[_0xfeaf('0x64')]['findAll']({'where':{'id':_0x5d7681},'attributes':['id'],'include':[{'model':db[_0xfeaf('0x59')],'as':_0xfeaf('0x67'),'attributes':['id','name','online',_0xfeaf('0x68'),_0xfeaf('0x69')],'raw':!![]}]})[_0xfeaf('0x29')](function(_0x1e3e91){if(_0x1e3e91){var _0x537c3d=_[_0xfeaf('0x6a')](_0x1e3e91,function(_0x468dc0){var _0x4b8685=_0x468dc0['get']({'plain':!![]});return _0x4b8685['Agents'];});return db[_0xfeaf('0x33')][_0xfeaf('0x4c')]({'where':{'id':_0x8747c7[_0xfeaf('0x4b')]['id']}})[_0xfeaf('0x29')](function(_0x2982c7){return db[_0xfeaf('0x6b')][_0xfeaf('0x6c')](function(_0xb175f){return _0x2982c7[_0xfeaf('0x65')](_0x5d7681,{'transaction':_0xb175f})[_0xfeaf('0x29')](function(){return BPromise[_0xfeaf('0x6d')](_0x537c3d,function(_0x212f6a){return db[_0xfeaf('0x58')][_0xfeaf('0x6e')]({'where':{'UserId':_0x212f6a['id'],'FaxQueueId':_0x8747c7['params']['id']},'transaction':_0xb175f});});})['then'](function(){_0x537c3d[_0xfeaf('0x6f')](function(_0x1018ac){socket[_0xfeaf('0x70')](_0xfeaf('0x71'),{'UserId':_0x1018ac['id'],'FaxQueueId':_0x2982c7['id']});});});});});}})[_0xfeaf('0x29')](respondWithStatusCode(_0x2d1a70,null))[_0xfeaf('0x4a')](handleError(_0x2d1a70,null));};exports[_0xfeaf('0x72')]=function(_0x79c0fe,_0x4bc32f,_0x41d07f){return db['Team']['findAll']({'where':{'id':_0x79c0fe['query'][_0xfeaf('0x66')]},'attributes':['id'],'include':[{'model':db[_0xfeaf('0x59')],'as':_0xfeaf('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4bc32f,null))[_0xfeaf('0x29')](function(_0x1bcfa5){var _0xf34788=_[_0xfeaf('0x32')](_0x1bcfa5,'id');var _0x43983d=[];var _0x17435a=[];var _0x235ce0=squel[_0xfeaf('0x73')]();_0x235ce0[_0xfeaf('0x74')](_0xfeaf('0x75'))[_0xfeaf('0x76')](_0xfeaf('0x77'),'tq')[_0xfeaf('0x78')](_0xfeaf('0x79'),'ut',_0xfeaf('0x7a'))[_0xfeaf('0x43')](_0xfeaf('0x7b'),_0x79c0fe[_0xfeaf('0x4b')]['id']);for(var _0x1be92e=0x0;_0x1be92e<_0x1bcfa5[_0xfeaf('0x3e')];_0x1be92e+=0x1){let _0x37b5fb=_0x1bcfa5[_0x1be92e];for(var _0x35afe8=0x0;_0x35afe8<_0x37b5fb['Agents'][_0xfeaf('0x3e')];_0x35afe8+=0x1){let _0x5c5f88=_0x37b5fb['Agents'][_0x35afe8];var _0x396676=_0x235ce0['clone']();_0x396676[_0xfeaf('0x43')](_0xfeaf('0x7c'),_0x5c5f88['id']);_0x17435a[_0xfeaf('0x7d')](db[_0xfeaf('0x6b')][_0xfeaf('0x39')](_0x396676['toString'](),{'type':db['sequelize'][_0xfeaf('0x7e')][_0xfeaf('0x7f')]})['then'](function(_0x2d824b){if(_0x2d824b[_0xfeaf('0x3e')]===0x1){return _0x5c5f88['id'];}else{var _0x117be3=_[_0xfeaf('0x80')](_['map'](_0x2d824b,'TeamId'),function(_0x3b80c8){return _[_0xfeaf('0x81')](_0xf34788,_0x3b80c8);});if(_0x117be3){return _0x5c5f88['id'];}}}));}}return BPromise[_0xfeaf('0x82')](_0x17435a)[_0xfeaf('0x29')](function(_0x20c33c){_0x43983d=_(_0x43983d)[_0xfeaf('0x83')](_0x20c33c)[_0xfeaf('0x84')]()[_0xfeaf('0x85')]();return db[_0xfeaf('0x33')][_0xfeaf('0x4c')]({'where':{'id':_0x79c0fe[_0xfeaf('0x4b')]['id']}})[_0xfeaf('0x29')](function(_0x3f0db1){return db['sequelize'][_0xfeaf('0x6c')](function(_0x14efcb){return _0x3f0db1[_0xfeaf('0x72')](_0x79c0fe[_0xfeaf('0x39')]['ids'],{'transaction':_0x14efcb})['then'](function(){if(!_[_0xfeaf('0x86')](_0x43983d)){return _0x3f0db1[_0xfeaf('0x87')](_0x43983d,{'transaction':_0x14efcb});}})[_0xfeaf('0x29')](function(){_0x43983d['forEach'](function(_0x5b3d45){socket[_0xfeaf('0x70')](_0xfeaf('0x88'),{'UserId':_0x5b3d45,'FaxQueueId':_0x3f0db1['id']});});});});});});})[_0xfeaf('0x29')](respondWithStatusCode(_0x4bc32f,null))[_0xfeaf('0x4a')](handleError(_0x4bc32f,null));};exports[_0xfeaf('0x89')]=function(_0x195982,_0x2c437a,_0x2221a4){return db['FaxQueue'][_0xfeaf('0x4c')]({'where':{'id':_0x195982[_0xfeaf('0x4b')]['id']}})[_0xfeaf('0x29')](handleEntityNotFound(_0x2c437a,null))[_0xfeaf('0x29')](function(_0x399fe1){if(_0x399fe1){return _0x399fe1[_0xfeaf('0x89')](_0x195982[_0xfeaf('0x4e')][_0xfeaf('0x66')],_[_0xfeaf('0x8a')](_0x195982['body'],[_0xfeaf('0x66'),'id'])||{})['spread'](function(_0x675ea9){for(var _0x53503c=0x0;_0x53503c<_0x195982[_0xfeaf('0x4e')][_0xfeaf('0x66')][_0xfeaf('0x3e')];_0x53503c+=0x1){socket[_0xfeaf('0x70')](_0xfeaf('0x71'),{'UserId':Number(_0x195982[_0xfeaf('0x4e')]['ids'][_0x53503c]),'FaxQueueId':Number(_0x195982['params']['id'])});}return _0x675ea9;});}})[_0xfeaf('0x29')](respondWithResult(_0x2c437a,null))[_0xfeaf('0x4a')](handleError(_0x2c437a,null));};exports[_0xfeaf('0x87')]=function(_0x521596,_0x534c68,_0x326a78){return db[_0xfeaf('0x33')][_0xfeaf('0x4c')]({'where':{'id':_0x521596['params']['id']}})['then'](handleEntityNotFound(_0x534c68,null))['then'](function(_0x58188e){if(_0x58188e){return _0x58188e[_0xfeaf('0x87')](_0x521596[_0xfeaf('0x39')][_0xfeaf('0x66')])[_0xfeaf('0x29')](function(){if(_['isArray'](_0x521596[_0xfeaf('0x39')][_0xfeaf('0x66')])){for(var _0x2aeb83=0x0;_0x2aeb83<_0x521596['query'][_0xfeaf('0x66')][_0xfeaf('0x3e')];_0x2aeb83+=0x1){socket['emit'](_0xfeaf('0x88'),{'UserId':Number(_0x521596[_0xfeaf('0x39')][_0xfeaf('0x66')][_0x2aeb83]),'FaxQueueId':Number(_0x521596[_0xfeaf('0x4b')]['id'])});}}else{socket[_0xfeaf('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x521596[_0xfeaf('0x39')][_0xfeaf('0x66')]),'FaxQueueId':Number(_0x521596[_0xfeaf('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x534c68,null))[_0xfeaf('0x4a')](handleError(_0x534c68,null));};exports[_0xfeaf('0x8b')]=function(_0x27ebd8,_0x2c90ce,_0x5ea1a2){var _0x31463a={};var _0x3289fa={};var _0x34c9c3;var _0x58b70f;return db[_0xfeaf('0x33')][_0xfeaf('0x55')]({'where':{'id':_0x27ebd8[_0xfeaf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c90ce,null))[_0xfeaf('0x29')](function(_0x5b5ff1){if(_0x5b5ff1){_0x34c9c3=_0x5b5ff1;_0x3289fa[_0xfeaf('0x37')]=_[_0xfeaf('0x38')](db[_0xfeaf('0x59')][_0xfeaf('0x34')]);_0x3289fa[_0xfeaf('0x39')]=_['keys'](_0x27ebd8['query']);_0x3289fa[_0xfeaf('0x3a')]=_[_0xfeaf('0x3b')](_0x3289fa[_0xfeaf('0x37')],_0x3289fa[_0xfeaf('0x39')]);_0x31463a[_0xfeaf('0x3c')]=_[_0xfeaf('0x3b')](_0x3289fa[_0xfeaf('0x37')],qs[_0xfeaf('0x3d')](_0x27ebd8[_0xfeaf('0x39')][_0xfeaf('0x3d')]));_0x31463a['attributes']=_0x31463a[_0xfeaf('0x3c')]['length']?_0x31463a[_0xfeaf('0x3c')]:_0x3289fa[_0xfeaf('0x37')];_0x31463a['order']=qs[_0xfeaf('0x41')](_0x27ebd8[_0xfeaf('0x39')]['sort']);_0x31463a[_0xfeaf('0x43')]=qs['filters'](_['pick'](_0x27ebd8[_0xfeaf('0x39')],_0x3289fa['filters']));if(_0x27ebd8['query'][_0xfeaf('0x45')]){_0x31463a[_0xfeaf('0x43')]=_[_0xfeaf('0x46')](_0x31463a['where'],{'$or':_['map'](_0x31463a[_0xfeaf('0x3c')],function(_0x2568df){var _0x3cb2ff={};_0x3cb2ff[_0x2568df]={'$like':'%'+_0x27ebd8[_0xfeaf('0x39')][_0xfeaf('0x45')]+'%'};return _0x3cb2ff;})});}_0x31463a=_[_0xfeaf('0x46')]({},_0x31463a,_0x27ebd8[_0xfeaf('0x47')]);return _0x34c9c3[_0xfeaf('0x8b')](_0x31463a);}})[_0xfeaf('0x29')](function(_0x1a7dfa){if(_0x1a7dfa){_0x58b70f=_0x1a7dfa[_0xfeaf('0x3e')];if(!_0x27ebd8[_0xfeaf('0x39')][_0xfeaf('0x3f')](_0xfeaf('0x56'))){_0x31463a['limit']=qs['limit'](_0x27ebd8[_0xfeaf('0x39')][_0xfeaf('0x1f')]);_0x31463a[_0xfeaf('0x21')]=qs[_0xfeaf('0x21')](_0x27ebd8[_0xfeaf('0x39')][_0xfeaf('0x21')]);}return _0x34c9c3[_0xfeaf('0x8b')](_0x31463a);}})['then'](function(_0x4f0b3c){if(_0x4f0b3c){return _0x4f0b3c?{'count':_0x58b70f,'rows':_0x4f0b3c}:null;}})[_0xfeaf('0x29')](respondWithResult(_0x2c90ce,null))[_0xfeaf('0x4a')](handleError(_0x2c90ce,null));}; \ No newline at end of file +var _0xfedc=['SIP','faxPause','Team','getTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','userFaxQueue:save','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','emit','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','FaxQueues','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','order','FaxQueueId','User','UserId','agent','updatedAt','format','%s/%s'];(function(_0x550133,_0x46acb8){var _0x466271=function(_0x304eea){while(--_0x304eea){_0x550133['push'](_0x550133['shift']());}};_0x466271(++_0x46acb8);}(_0xfedc,0xb5));var _0xcfed=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xfedc[_0x43b08];return _0x5e05f4;};'use strict';var emlformat=require(_0xcfed('0x0'));var rimraf=require(_0xcfed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfed('0x2'));var rp=require(_0xcfed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcfed('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcfed('0x5'));var fs=require('fs');var fs_extra=require(_0xcfed('0x6'));var _=require('lodash');var squel=require(_0xcfed('0x7'));var crypto=require(_0xcfed('0x8'));var jsforce=require(_0xcfed('0x9'));var deskjs=require(_0xcfed('0xa'));var toCsv=require(_0xcfed('0xb'));var querystring=require(_0xcfed('0xc'));var Papa=require(_0xcfed('0xd'));var Redis=require(_0xcfed('0xe'));var authService=require(_0xcfed('0xf'));var qs=require(_0xcfed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfed('0x11'))('api');var utils=require(_0xcfed('0x12'));var config=require(_0xcfed('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfed('0x14'))['db'];config[_0xcfed('0x15')]=_[_0xcfed('0x16')](config[_0xcfed('0x15')],{'host':_0xcfed('0x17'),'port':0x18eb});var socket=require(_0xcfed('0x18'))(new Redis(config[_0xcfed('0x15')]));require(_0xcfed('0x19'))[_0xcfed('0x1a')](socket);function respondWithStatusCode(_0x2a8460,_0x3110e3){_0x3110e3=_0x3110e3||0xcc;return function(_0x40f5a8){if(_0x40f5a8){return _0x2a8460[_0xcfed('0x1b')](_0x3110e3);}return _0x2a8460[_0xcfed('0x1c')](_0x3110e3)[_0xcfed('0x1d')]();};}function respondWithResult(_0x11d01e,_0x27ffb5){_0x27ffb5=_0x27ffb5||0xc8;return function(_0xb944bd){if(_0xb944bd){return _0x11d01e[_0xcfed('0x1c')](_0x27ffb5)[_0xcfed('0x1e')](_0xb944bd);}};}function respondWithFilteredResult(_0x260f2c,_0x44e8ab){return function(_0x19188f){if(_0x19188f){var _0x3c4b7b=typeof _0x44e8ab[_0xcfed('0x1f')]==='undefined'&&typeof _0x44e8ab[_0xcfed('0x20')]===_0xcfed('0x21');var _0x3fba78=_0x19188f['count'];var _0x56ce43=_0x3c4b7b?0x0:_0x44e8ab['offset'];var _0x132f2a=_0x3c4b7b?_0x19188f[_0xcfed('0x22')]:_0x44e8ab[_0xcfed('0x1f')]+_0x44e8ab['limit'];var _0x25ee45;if(_0x132f2a>=_0x3fba78){_0x132f2a=_0x3fba78;_0x25ee45=0xc8;}else{_0x25ee45=0xce;}_0x260f2c[_0xcfed('0x1c')](_0x25ee45);return _0x260f2c[_0xcfed('0x23')]('Content-Range',_0x56ce43+'-'+_0x132f2a+'/'+_0x3fba78)[_0xcfed('0x1e')](_0x19188f);}return null;};}function patchUpdates(_0x334c4b){return function(_0x3a743a){try{jsonpatch[_0xcfed('0x24')](_0x3a743a,_0x334c4b,!![]);}catch(_0x193632){return BPromise[_0xcfed('0x25')](_0x193632);}return _0x3a743a[_0xcfed('0x26')]();};}function saveUpdates(_0x13b880,_0x2f83a6){return function(_0x23ccc4){if(_0x23ccc4){return _0x23ccc4[_0xcfed('0x27')](_0x13b880)[_0xcfed('0x28')](function(_0x4935db){return _0x4935db;});}return null;};}function removeEntity(_0x2665e3,_0x2b8301){return function(_0x1cd749){if(_0x1cd749){return _0x1cd749[_0xcfed('0x29')]()[_0xcfed('0x28')](function(){var _0x1a37c3=_0x1cd749['get']({'plain':!![]});var _0x118595='FaxQueues';return db['UserProfileResource'][_0xcfed('0x29')]({'where':{'type':_0x118595,'resourceId':_0x1a37c3['id']}})[_0xcfed('0x28')](function(){return _0x1cd749;});})[_0xcfed('0x28')](function(){_0x2665e3[_0xcfed('0x1c')](0xcc)[_0xcfed('0x1d')]();});}};}function handleEntityNotFound(_0x3cde06,_0x245e1c){return function(_0x386b79){if(!_0x386b79){_0x3cde06[_0xcfed('0x1b')](0x194);}return _0x386b79;};}function handleError(_0x170b02,_0x441a1f){_0x441a1f=_0x441a1f||0x1f4;return function(_0x3b1cd7){logger['error'](_0x3b1cd7[_0xcfed('0x2a')]);if(_0x3b1cd7[_0xcfed('0x2b')]){delete _0x3b1cd7[_0xcfed('0x2b')];}_0x170b02[_0xcfed('0x1c')](_0x441a1f)[_0xcfed('0x2c')](_0x3b1cd7);};}exports[_0xcfed('0x2d')]=function(_0xa31498,_0x22ac47){var _0x1adff3={},_0x5e1722={},_0x51a96c={'count':0x0,'rows':[]};var _0x19888f=_[_0xcfed('0x2e')](db[_0xcfed('0x2f')][_0xcfed('0x30')],function(_0x5b89f9){return{'name':_0x5b89f9[_0xcfed('0x31')],'type':_0x5b89f9['type'][_0xcfed('0x32')]};});_0x5e1722[_0xcfed('0x33')]=_[_0xcfed('0x2e')](_0x19888f,_0xcfed('0x2b'));_0x5e1722[_0xcfed('0x34')]=_[_0xcfed('0x35')](_0xa31498[_0xcfed('0x34')]);_0x5e1722[_0xcfed('0x36')]=_[_0xcfed('0x37')](_0x5e1722[_0xcfed('0x33')],_0x5e1722[_0xcfed('0x34')]);_0x1adff3[_0xcfed('0x38')]=_[_0xcfed('0x37')](_0x5e1722['model'],qs['fields'](_0xa31498[_0xcfed('0x34')][_0xcfed('0x39')]));_0x1adff3[_0xcfed('0x38')]=_0x1adff3[_0xcfed('0x38')][_0xcfed('0x3a')]?_0x1adff3[_0xcfed('0x38')]:_0x5e1722['model'];if(!_0xa31498['query']['hasOwnProperty'](_0xcfed('0x3b'))){_0x1adff3[_0xcfed('0x20')]=qs['limit'](_0xa31498['query'][_0xcfed('0x20')]);_0x1adff3['offset']=qs['offset'](_0xa31498[_0xcfed('0x34')][_0xcfed('0x1f')]);}_0x1adff3['order']=qs[_0xcfed('0x3c')](_0xa31498[_0xcfed('0x34')][_0xcfed('0x3c')]);_0x1adff3[_0xcfed('0x3d')]=qs[_0xcfed('0x36')](_[_0xcfed('0x3e')](_0xa31498[_0xcfed('0x34')],_0x5e1722[_0xcfed('0x36')]),_0x19888f);if(_0xa31498[_0xcfed('0x34')][_0xcfed('0x3f')]){_0x1adff3[_0xcfed('0x3d')]=_[_0xcfed('0x40')](_0x1adff3[_0xcfed('0x3d')],{'$or':_['map'](_0x19888f,function(_0x5d9965){if(_0x5d9965[_0xcfed('0x41')]!==_0xcfed('0x42')){var _0x1c16d8={};_0x1c16d8[_0x5d9965[_0xcfed('0x2b')]]={'$like':'%'+_0xa31498['query'][_0xcfed('0x3f')]+'%'};return _0x1c16d8;}})});}_0x1adff3=_[_0xcfed('0x40')]({},_0x1adff3,_0xa31498[_0xcfed('0x43')]);var _0x434da0={'where':_0x1adff3['where']};return db[_0xcfed('0x2f')][_0xcfed('0x22')](_0x434da0)[_0xcfed('0x28')](function(_0x22fd59){_0x51a96c[_0xcfed('0x22')]=_0x22fd59;if(_0xa31498[_0xcfed('0x34')]['includeAll']){_0x1adff3['include']=[{'all':!![]}];}return db[_0xcfed('0x2f')][_0xcfed('0x44')](_0x1adff3);})[_0xcfed('0x28')](function(_0x449664){_0x51a96c[_0xcfed('0x45')]=_0x449664;return _0x51a96c;})[_0xcfed('0x28')](respondWithFilteredResult(_0x22ac47,_0x1adff3))['catch'](handleError(_0x22ac47,null));};exports[_0xcfed('0x46')]=function(_0x17d1c7,_0x589782){var _0x5405d8={'raw':!![],'where':{'id':_0x17d1c7[_0xcfed('0x47')]['id']}},_0x4c09db={};_0x4c09db[_0xcfed('0x33')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x4c09db[_0xcfed('0x34')]=_[_0xcfed('0x35')](_0x17d1c7[_0xcfed('0x34')]);_0x4c09db[_0xcfed('0x36')]=_[_0xcfed('0x37')](_0x4c09db[_0xcfed('0x33')],_0x4c09db[_0xcfed('0x34')]);_0x5405d8[_0xcfed('0x38')]=_[_0xcfed('0x37')](_0x4c09db[_0xcfed('0x33')],qs[_0xcfed('0x39')](_0x17d1c7[_0xcfed('0x34')][_0xcfed('0x39')]));_0x5405d8[_0xcfed('0x38')]=_0x5405d8['attributes'][_0xcfed('0x3a')]?_0x5405d8['attributes']:_0x4c09db['model'];if(_0x17d1c7[_0xcfed('0x34')][_0xcfed('0x48')]){_0x5405d8[_0xcfed('0x49')]=[{'all':!![]}];}_0x5405d8=_[_0xcfed('0x40')]({},_0x5405d8,_0x17d1c7[_0xcfed('0x43')]);return db[_0xcfed('0x2f')][_0xcfed('0x4a')](_0x5405d8)['then'](handleEntityNotFound(_0x589782,null))['then'](respondWithResult(_0x589782,null))[_0xcfed('0x4b')](handleError(_0x589782,null));};exports[_0xcfed('0x4c')]=function(_0x2b89c9,_0x1fd5fa){return db['FaxQueue']['create'](_0x2b89c9[_0xcfed('0x4d')],{})[_0xcfed('0x28')](function(_0x59bc08){var _0x103fe4=_0x2b89c9[_0xcfed('0x4e')]['get']({'plain':!![]});if(!_0x103fe4)throw new Error(_0xcfed('0x4f'));if(_0x103fe4[_0xcfed('0x50')]===_0xcfed('0x4e')){var _0x44153e=_0x59bc08[_0xcfed('0x51')]({'plain':!![]});var _0x48f2df=_0xcfed('0x52');return db['UserProfileSection'][_0xcfed('0x4a')]({'where':{'name':_0x48f2df,'userProfileId':_0x103fe4[_0xcfed('0x53')]},'raw':!![]})[_0xcfed('0x28')](function(_0x1e5eed){if(_0x1e5eed&&_0x1e5eed[_0xcfed('0x54')]===0x0){return db[_0xcfed('0x55')][_0xcfed('0x4c')]({'name':_0x44153e[_0xcfed('0x2b')],'resourceId':_0x44153e['id'],'type':_0x1e5eed['name'],'sectionId':_0x1e5eed['id']},{})['then'](function(){return _0x59bc08;});}else{return _0x59bc08;}})['catch'](function(_0x586e82){logger[_0xcfed('0x56')](_0xcfed('0x57'),_0x586e82);throw _0x586e82;});}return _0x59bc08;})[_0xcfed('0x28')](respondWithResult(_0x1fd5fa,0xc9))[_0xcfed('0x4b')](handleError(_0x1fd5fa,null));};exports[_0xcfed('0x27')]=function(_0x2fd268,_0x1b6c43){if(_0x2fd268[_0xcfed('0x4d')]['id']){delete _0x2fd268[_0xcfed('0x4d')]['id'];}return db[_0xcfed('0x2f')][_0xcfed('0x4a')]({'where':{'id':_0x2fd268[_0xcfed('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b6c43,null))[_0xcfed('0x28')](saveUpdates(_0x2fd268[_0xcfed('0x4d')],null))[_0xcfed('0x28')](respondWithResult(_0x1b6c43,null))['catch'](handleError(_0x1b6c43,null));};exports[_0xcfed('0x29')]=function(_0x40a53d,_0x4185b4){return db[_0xcfed('0x2f')][_0xcfed('0x4a')]({'where':{'id':_0x40a53d[_0xcfed('0x47')]['id']}})[_0xcfed('0x28')](handleEntityNotFound(_0x4185b4,null))[_0xcfed('0x28')](removeEntity(_0x4185b4,null))[_0xcfed('0x4b')](handleError(_0x4185b4,null));};exports[_0xcfed('0x58')]=function(_0x293490,_0x297092){return db[_0xcfed('0x2f')][_0xcfed('0x58')]()['then'](respondWithResult(_0x297092,null))[_0xcfed('0x4b')](handleError(_0x297092,null));};exports[_0xcfed('0x59')]=function(_0x184ae0,_0x1fe4b6,_0x143163){var _0x2f6e2b={'raw':!![],'where':{}},_0x4efeff={},_0x2839bf;return db[_0xcfed('0x2f')][_0xcfed('0x5a')]({'where':{'id':_0x184ae0['params']['id']}})['then'](handleEntityNotFound(_0x1fe4b6,null))['then'](function(_0x488453){if(_0x488453){_0x2839bf=_0x488453[_0xcfed('0x51')]({'plain':!![]});_0x4efeff[_0xcfed('0x33')]=_[_0xcfed('0x35')](db[_0xcfed('0x5b')][_0xcfed('0x30')]);_0x4efeff[_0xcfed('0x34')]=_[_0xcfed('0x35')](_0x184ae0['query']);_0x4efeff[_0xcfed('0x36')]=_[_0xcfed('0x37')](_0x4efeff[_0xcfed('0x33')],_0x4efeff[_0xcfed('0x34')]);_0x2f6e2b[_0xcfed('0x38')]=_[_0xcfed('0x37')](_0x4efeff[_0xcfed('0x33')],qs['fields'](_0x184ae0[_0xcfed('0x34')]['fields']));_0x2f6e2b[_0xcfed('0x38')]=_0x2f6e2b['attributes']['length']?_0x2f6e2b[_0xcfed('0x38')]:_0x4efeff[_0xcfed('0x33')];if(!_0x184ae0[_0xcfed('0x34')][_0xcfed('0x5c')]('nolimit')){_0x2f6e2b['limit']=qs[_0xcfed('0x20')](_0x184ae0['query'][_0xcfed('0x20')]);_0x2f6e2b['offset']=qs[_0xcfed('0x1f')](_0x184ae0[_0xcfed('0x34')][_0xcfed('0x1f')]);}_0x2f6e2b[_0xcfed('0x5d')]=qs[_0xcfed('0x3c')](_0x184ae0['query']['sort']);_0x2f6e2b[_0xcfed('0x3d')]=qs[_0xcfed('0x36')](_[_0xcfed('0x3e')](_0x184ae0[_0xcfed('0x34')],_0x4efeff[_0xcfed('0x36')]));_0x2f6e2b[_0xcfed('0x3d')][_0xcfed('0x5e')]=_0x488453['id'];if(_0x184ae0[_0xcfed('0x34')][_0xcfed('0x3f')]){_0x2f6e2b[_0xcfed('0x3d')]=_[_0xcfed('0x40')](_0x2f6e2b['where'],{'$or':_['map'](_0x2f6e2b['attributes'],function(_0x94addf){var _0x1b56ad={};_0x1b56ad[_0x94addf]={'$like':'%'+_0x184ae0[_0xcfed('0x34')][_0xcfed('0x3f')]+'%'};return _0x1b56ad;})});}_0x2f6e2b=_[_0xcfed('0x40')]({},_0x2f6e2b,_0x184ae0[_0xcfed('0x43')]);return db[_0xcfed('0x5b')][_0xcfed('0x44')](_0x2f6e2b);}})[_0xcfed('0x28')](function(_0x5bc7c0){if(_0x5bc7c0){return db[_0xcfed('0x5f')]['findAndCountAll']({'where':{'id':_[_0xcfed('0x2e')](_0x5bc7c0,_0xcfed('0x60')),'role':_0xcfed('0x61')},'attributes':['id',_0xcfed('0x2b'),'faxPause',_0xcfed('0x62'),'createdAt']});}})[_0xcfed('0x28')](function(_0x1d6ea3){if(_0x1d6ea3){return{'count':_0x1d6ea3['count'],'rows':_[_0xcfed('0x2e')](_0x1d6ea3[_0xcfed('0x45')],function(_0x107277){return{'membername':_0x107277[_0xcfed('0x2b')],'UserId':_0x107277['id'],'queue_name':_0x2839bf['name'],'FaxQueueId':_0x2839bf['id'],'interface':util[_0xcfed('0x63')](_0xcfed('0x64'),_0xcfed('0x65'),_0x107277[_0xcfed('0x2b')]),'penalty':0x0,'paused':_0x107277[_0xcfed('0x66')],'createdAt':_0x107277['createdAt'],'updatedAt':_0x107277['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcfed('0x28')](respondWithFilteredResult(_0x1fe4b6,_0x2f6e2b))[_0xcfed('0x4b')](handleError(_0x1fe4b6,null));};exports['getTeams']=function(_0x55d093,_0x303383,_0xc38635){var _0x3ba721={};var _0x2a1ef7={};var _0x29ae90;var _0x4f054d;return db[_0xcfed('0x2f')][_0xcfed('0x5a')]({'where':{'id':_0x55d093['params']['id']}})['then'](handleEntityNotFound(_0x303383,null))[_0xcfed('0x28')](function(_0x265f94){if(_0x265f94){_0x29ae90=_0x265f94;_0x2a1ef7['model']=_[_0xcfed('0x35')](db[_0xcfed('0x67')][_0xcfed('0x30')]);_0x2a1ef7[_0xcfed('0x34')]=_[_0xcfed('0x35')](_0x55d093['query']);_0x2a1ef7[_0xcfed('0x36')]=_[_0xcfed('0x37')](_0x2a1ef7[_0xcfed('0x33')],_0x2a1ef7[_0xcfed('0x34')]);_0x3ba721[_0xcfed('0x38')]=_[_0xcfed('0x37')](_0x2a1ef7[_0xcfed('0x33')],qs[_0xcfed('0x39')](_0x55d093[_0xcfed('0x34')][_0xcfed('0x39')]));_0x3ba721['attributes']=_0x3ba721[_0xcfed('0x38')][_0xcfed('0x3a')]?_0x3ba721[_0xcfed('0x38')]:_0x2a1ef7['model'];_0x3ba721[_0xcfed('0x5d')]=qs[_0xcfed('0x3c')](_0x55d093[_0xcfed('0x34')][_0xcfed('0x3c')]);_0x3ba721[_0xcfed('0x3d')]=qs[_0xcfed('0x36')](_[_0xcfed('0x3e')](_0x55d093[_0xcfed('0x34')],_0x2a1ef7['filters']));if(_0x55d093[_0xcfed('0x34')]['filter']){_0x3ba721[_0xcfed('0x3d')]=_[_0xcfed('0x40')](_0x3ba721[_0xcfed('0x3d')],{'$or':_[_0xcfed('0x2e')](_0x3ba721[_0xcfed('0x38')],function(_0x5cc9b7){var _0x32868b={};_0x32868b[_0x5cc9b7]={'$like':'%'+_0x55d093[_0xcfed('0x34')][_0xcfed('0x3f')]+'%'};return _0x32868b;})});}_0x3ba721=_[_0xcfed('0x40')]({},_0x3ba721,_0x55d093[_0xcfed('0x43')]);return _0x29ae90['getTeams'](_0x3ba721);}})[_0xcfed('0x28')](function(_0x110458){if(_0x110458){_0x4f054d=_0x110458[_0xcfed('0x3a')];if(!_0x55d093[_0xcfed('0x34')][_0xcfed('0x5c')](_0xcfed('0x3b'))){_0x3ba721[_0xcfed('0x20')]=qs[_0xcfed('0x20')](_0x55d093[_0xcfed('0x34')][_0xcfed('0x20')]);_0x3ba721[_0xcfed('0x1f')]=qs['offset'](_0x55d093[_0xcfed('0x34')]['offset']);}return _0x29ae90[_0xcfed('0x68')](_0x3ba721);}})[_0xcfed('0x28')](function(_0x151726){if(_0x151726){return _0x151726?{'count':_0x4f054d,'rows':_0x151726}:null;}})[_0xcfed('0x28')](respondWithResult(_0x303383,null))[_0xcfed('0x4b')](handleError(_0x303383,null));};exports['addTeams']=function(_0x7640b0,_0x2fd5ce,_0xc16114){var _0x2b5fab=_0x7640b0[_0xcfed('0x4d')][_0xcfed('0x69')];return db[_0xcfed('0x67')][_0xcfed('0x44')]({'where':{'id':_0x2b5fab},'attributes':['id'],'include':[{'model':db[_0xcfed('0x5f')],'as':_0xcfed('0x6a'),'attributes':['id',_0xcfed('0x2b'),_0xcfed('0x6b'),'voicePause',_0xcfed('0x6c')],'raw':!![]}]})[_0xcfed('0x28')](function(_0x3fa6f5){if(_0x3fa6f5){var _0x4c806c=_[_0xcfed('0x6d')](_0x3fa6f5,function(_0x38aa3c){var _0x80c7e1=_0x38aa3c[_0xcfed('0x51')]({'plain':!![]});return _0x80c7e1[_0xcfed('0x6a')];});return db['FaxQueue'][_0xcfed('0x4a')]({'where':{'id':_0x7640b0['params']['id']}})[_0xcfed('0x28')](function(_0x2f1a54){return db['sequelize'][_0xcfed('0x6e')](function(_0x5b1fd4){return _0x2f1a54['addTeams'](_0x2b5fab,{'transaction':_0x5b1fd4})[_0xcfed('0x28')](function(){return BPromise[_0xcfed('0x6f')](_0x4c806c,function(_0x1aefe5){return db['UserFaxQueue'][_0xcfed('0x70')]({'where':{'UserId':_0x1aefe5['id'],'FaxQueueId':_0x7640b0[_0xcfed('0x47')]['id']},'transaction':_0x5b1fd4});});})[_0xcfed('0x28')](function(){_0x4c806c[_0xcfed('0x71')](function(_0x42618e){socket['emit'](_0xcfed('0x72'),{'UserId':_0x42618e['id'],'FaxQueueId':_0x2f1a54['id']});});});});});}})['then'](respondWithStatusCode(_0x2fd5ce,null))[_0xcfed('0x4b')](handleError(_0x2fd5ce,null));};exports['removeTeams']=function(_0x10ed23,_0x19177a,_0x5ef4ea){return db[_0xcfed('0x67')][_0xcfed('0x44')]({'where':{'id':_0x10ed23[_0xcfed('0x34')][_0xcfed('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcfed('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x19177a,null))['then'](function(_0x2a5c52){var _0x235681=_[_0xcfed('0x2e')](_0x2a5c52,'id');var _0x496f7c=[];var _0x1c6dc9=[];var _0x385fe5=squel[_0xcfed('0x73')]();_0x385fe5['field'](_0xcfed('0x74'))[_0xcfed('0x75')]('team_has_fax_queues','tq')[_0xcfed('0x76')](_0xcfed('0x77'),'ut',_0xcfed('0x78'))[_0xcfed('0x3d')]('FaxQueueId\x20=\x20?',_0x10ed23['params']['id']);for(var _0x55736e=0x0;_0x55736e<_0x2a5c52[_0xcfed('0x3a')];_0x55736e+=0x1){let _0x26103c=_0x2a5c52[_0x55736e];for(var _0x49e1c8=0x0;_0x49e1c8<_0x26103c['Agents']['length'];_0x49e1c8+=0x1){let _0x4a921b=_0x26103c[_0xcfed('0x6a')][_0x49e1c8];var _0x1dd75c=_0x385fe5[_0xcfed('0x79')]();_0x1dd75c[_0xcfed('0x3d')](_0xcfed('0x7a'),_0x4a921b['id']);_0x1c6dc9[_0xcfed('0x7b')](db[_0xcfed('0x7c')][_0xcfed('0x34')](_0x1dd75c[_0xcfed('0x7d')](),{'type':db['sequelize'][_0xcfed('0x7e')][_0xcfed('0x7f')]})['then'](function(_0x3efed6){if(_0x3efed6[_0xcfed('0x3a')]===0x1){return _0x4a921b['id'];}else{var _0x3f8c78=_[_0xcfed('0x80')](_[_0xcfed('0x2e')](_0x3efed6,'TeamId'),function(_0x11b357){return _[_0xcfed('0x81')](_0x235681,_0x11b357);});if(_0x3f8c78){return _0x4a921b['id'];}}}));}}return BPromise[_0xcfed('0x82')](_0x1c6dc9)['then'](function(_0x4a2209){_0x496f7c=_(_0x496f7c)[_0xcfed('0x83')](_0x4a2209)[_0xcfed('0x84')]()[_0xcfed('0x85')]();return db[_0xcfed('0x2f')][_0xcfed('0x4a')]({'where':{'id':_0x10ed23[_0xcfed('0x47')]['id']}})[_0xcfed('0x28')](function(_0x20f3ca){return db[_0xcfed('0x7c')][_0xcfed('0x6e')](function(_0x17d342){return _0x20f3ca[_0xcfed('0x86')](_0x10ed23[_0xcfed('0x34')][_0xcfed('0x69')],{'transaction':_0x17d342})[_0xcfed('0x28')](function(){if(!_['isEmpty'](_0x496f7c)){return _0x20f3ca['removeAgents'](_0x496f7c,{'transaction':_0x17d342});}})[_0xcfed('0x28')](function(){_0x496f7c['forEach'](function(_0x39f713){socket[_0xcfed('0x87')]('userFaxQueue:remove',{'UserId':_0x39f713,'FaxQueueId':_0x20f3ca['id']});});});});});});})['then'](respondWithStatusCode(_0x19177a,null))[_0xcfed('0x4b')](handleError(_0x19177a,null));};exports['addAgents']=function(_0x3a4403,_0x4e1540,_0x341215){return db['FaxQueue'][_0xcfed('0x4a')]({'where':{'id':_0x3a4403['params']['id']}})[_0xcfed('0x28')](handleEntityNotFound(_0x4e1540,null))[_0xcfed('0x28')](function(_0x247379){if(_0x247379){return _0x247379[_0xcfed('0x88')](_0x3a4403[_0xcfed('0x4d')][_0xcfed('0x69')],_['omit'](_0x3a4403['body'],['ids','id'])||{})[_0xcfed('0x89')](function(_0x5d369f){for(var _0x505940=0x0;_0x505940<_0x3a4403[_0xcfed('0x4d')]['ids'][_0xcfed('0x3a')];_0x505940+=0x1){socket[_0xcfed('0x87')](_0xcfed('0x72'),{'UserId':Number(_0x3a4403[_0xcfed('0x4d')][_0xcfed('0x69')][_0x505940]),'FaxQueueId':Number(_0x3a4403[_0xcfed('0x47')]['id'])});}return _0x5d369f;});}})[_0xcfed('0x28')](respondWithResult(_0x4e1540,null))[_0xcfed('0x4b')](handleError(_0x4e1540,null));};exports['removeAgents']=function(_0x1be17b,_0x5dfbc8,_0x5b6c36){return db[_0xcfed('0x2f')][_0xcfed('0x4a')]({'where':{'id':_0x1be17b[_0xcfed('0x47')]['id']}})[_0xcfed('0x28')](handleEntityNotFound(_0x5dfbc8,null))[_0xcfed('0x28')](function(_0x113c70){if(_0x113c70){return _0x113c70['removeAgents'](_0x1be17b[_0xcfed('0x34')][_0xcfed('0x69')])[_0xcfed('0x28')](function(){if(_[_0xcfed('0x8a')](_0x1be17b[_0xcfed('0x34')]['ids'])){for(var _0x40e9d6=0x0;_0x40e9d6<_0x1be17b['query'][_0xcfed('0x69')][_0xcfed('0x3a')];_0x40e9d6+=0x1){socket['emit'](_0xcfed('0x8b'),{'UserId':Number(_0x1be17b[_0xcfed('0x34')][_0xcfed('0x69')][_0x40e9d6]),'FaxQueueId':Number(_0x1be17b[_0xcfed('0x47')]['id'])});}}else{socket['emit'](_0xcfed('0x8b'),{'UserId':Number(_0x1be17b[_0xcfed('0x34')][_0xcfed('0x69')]),'FaxQueueId':Number(_0x1be17b[_0xcfed('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dfbc8,null))[_0xcfed('0x4b')](handleError(_0x5dfbc8,null));};exports[_0xcfed('0x8c')]=function(_0x3445d2,_0x239c35,_0xa80735){var _0x2bbc99={};var _0x32f545={};var _0x2de398;var _0xe66bd3;return db['FaxQueue'][_0xcfed('0x5a')]({'where':{'id':_0x3445d2[_0xcfed('0x47')]['id']}})['then'](handleEntityNotFound(_0x239c35,null))[_0xcfed('0x28')](function(_0x22c6f2){if(_0x22c6f2){_0x2de398=_0x22c6f2;_0x32f545[_0xcfed('0x33')]=_['keys'](db['User'][_0xcfed('0x30')]);_0x32f545[_0xcfed('0x34')]=_['keys'](_0x3445d2[_0xcfed('0x34')]);_0x32f545[_0xcfed('0x36')]=_['intersection'](_0x32f545['model'],_0x32f545[_0xcfed('0x34')]);_0x2bbc99[_0xcfed('0x38')]=_[_0xcfed('0x37')](_0x32f545[_0xcfed('0x33')],qs[_0xcfed('0x39')](_0x3445d2['query'][_0xcfed('0x39')]));_0x2bbc99[_0xcfed('0x38')]=_0x2bbc99['attributes'][_0xcfed('0x3a')]?_0x2bbc99[_0xcfed('0x38')]:_0x32f545[_0xcfed('0x33')];_0x2bbc99[_0xcfed('0x5d')]=qs[_0xcfed('0x3c')](_0x3445d2[_0xcfed('0x34')][_0xcfed('0x3c')]);_0x2bbc99[_0xcfed('0x3d')]=qs['filters'](_[_0xcfed('0x3e')](_0x3445d2[_0xcfed('0x34')],_0x32f545['filters']));if(_0x3445d2[_0xcfed('0x34')][_0xcfed('0x3f')]){_0x2bbc99['where']=_[_0xcfed('0x40')](_0x2bbc99[_0xcfed('0x3d')],{'$or':_[_0xcfed('0x2e')](_0x2bbc99[_0xcfed('0x38')],function(_0x55baa4){var _0x3f3318={};_0x3f3318[_0x55baa4]={'$like':'%'+_0x3445d2['query']['filter']+'%'};return _0x3f3318;})});}_0x2bbc99=_[_0xcfed('0x40')]({},_0x2bbc99,_0x3445d2[_0xcfed('0x43')]);return _0x2de398[_0xcfed('0x8c')](_0x2bbc99);}})['then'](function(_0x5e795b){if(_0x5e795b){_0xe66bd3=_0x5e795b[_0xcfed('0x3a')];if(!_0x3445d2[_0xcfed('0x34')][_0xcfed('0x5c')](_0xcfed('0x3b'))){_0x2bbc99[_0xcfed('0x20')]=qs[_0xcfed('0x20')](_0x3445d2[_0xcfed('0x34')][_0xcfed('0x20')]);_0x2bbc99[_0xcfed('0x1f')]=qs[_0xcfed('0x1f')](_0x3445d2[_0xcfed('0x34')][_0xcfed('0x1f')]);}return _0x2de398[_0xcfed('0x8c')](_0x2bbc99);}})['then'](function(_0x45e379){if(_0x45e379){return _0x45e379?{'count':_0xe66bd3,'rows':_0x45e379}:null;}})['then'](respondWithResult(_0x239c35,null))['catch'](handleError(_0x239c35,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4a74b9f..82b3c7f 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 _0xd2aa=['FaxQueue','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x25a0ca,_0x2241ed){var _0x54da39=function(_0x22738f){while(--_0x22738f){_0x25a0ca['push'](_0x25a0ca['shift']());}};_0x54da39(++_0x2241ed);}(_0xd2aa,0xe6));var _0xad2a=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0xd2aa[_0x49aa7d];return _0xdd0d26;};'use strict';var EventEmitter=require(_0xad2a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xad2a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xad2a('0x2'),'afterDestroy':_0xad2a('0x3')};function emitEvent(_0x565ec7){return function(_0x5743e1,_0x3f1104,_0x56309b){FaxQueueEvents[_0xad2a('0x4')](_0x565ec7+':'+_0x5743e1['id'],_0x5743e1);FaxQueueEvents[_0xad2a('0x4')](_0x565ec7,_0x5743e1);_0x56309b(null);};}for(var e in events){if(events[_0xad2a('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xad2a('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xe1b5=['save','update','remove','events','FaxQueue','setMaxListeners'];(function(_0x3fc041,_0x466439){var _0x582751=function(_0x517d4f){while(--_0x517d4f){_0x3fc041['push'](_0x3fc041['shift']());}};_0x582751(++_0x466439);}(_0xe1b5,0x93));var _0x5e1b=function(_0x564fa1,_0x4eea1c){_0x564fa1=_0x564fa1-0x0;var _0x3206bc=_0xe1b5[_0x564fa1];return _0x3206bc;};'use strict';var EventEmitter=require(_0x5e1b('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x5e1b('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5e1b('0x2')](0x0);var events={'afterCreate':_0x5e1b('0x3'),'afterUpdate':_0x5e1b('0x4'),'afterDestroy':_0x5e1b('0x5')};function emitEvent(_0x53297f){return function(_0x19140f,_0x503914,_0x254d49){FaxQueueEvents['emit'](_0x53297f+':'+_0x19140f['id'],_0x19140f);FaxQueueEvents['emit'](_0x53297f,_0x19140f);_0x254d49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](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 ca9a3c2..d544e12 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 _0x212a=['define','FaxQueue','lodash','util','api','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes'];(function(_0x4bd630,_0x2b01fe){var _0x47d843=function(_0x407d47){while(--_0x407d47){_0x4bd630['push'](_0x4bd630['shift']());}};_0x47d843(++_0x2b01fe);}(_0x212a,0x156));var _0xa212=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x212a[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xa212('0x0'));var util=require(_0xa212('0x1'));var logger=require('../../config/logger')(_0xa212('0x2'));var moment=require('moment');var BPromise=require(_0xa212('0x3'));var rp=require(_0xa212('0x4'));var fs=require('fs');var path=require(_0xa212('0x5'));var rimraf=require('rimraf');var config=require(_0xa212('0x6'));var attributes=require(_0xa212('0x7'));module['exports']=function(_0x2a238b,_0x10719b){return _0x2a238b[_0xa212('0x8')](_0xa212('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dcb=['bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','util','../../config/logger','moment'];(function(_0x25c6d7,_0x3e4816){var _0x12e8c8=function(_0x564ebe){while(--_0x564ebe){_0x25c6d7['push'](_0x25c6d7['shift']());}};_0x12e8c8(++_0x3e4816);}(_0x4dcb,0x17d));var _0xb4dc=function(_0x2a951f,_0x26e28b){_0x2a951f=_0x2a951f-0x0;var _0x6bcfc7=_0x4dcb[_0x2a951f];return _0x6bcfc7;};'use strict';var _=require(_0xb4dc('0x0'));var util=require(_0xb4dc('0x1'));var logger=require(_0xb4dc('0x2'))('api');var moment=require(_0xb4dc('0x3'));var BPromise=require(_0xb4dc('0x4'));var rp=require(_0xb4dc('0x5'));var fs=require('fs');var path=require(_0xb4dc('0x6'));var rimraf=require('rimraf');var config=require(_0xb4dc('0x7'));var attributes=require(_0xb4dc('0x8'));module['exports']=function(_0x7b34b3,_0x5b6549){return _0x7b34b3[_0xb4dc('0x9')]('FaxQueue',attributes,{'tableName':_0xb4dc('0xa'),'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 db14cbc..f8b9ec6 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 _0x2aa4=['error','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','model','attributes','map','ShowFaxQueue','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x1c39ca,_0x9af798){var _0x343bd9=function(_0x3722e2){while(--_0x3722e2){_0x1c39ca['push'](_0x1c39ca['shift']());}};_0x343bd9(++_0x9af798);}(_0x2aa4,0x1a6));var _0x42aa=function(_0x4662dd,_0x2fe64a){_0x4662dd=_0x4662dd-0x0;var _0x113d2b=_0x2aa4[_0x4662dd];return _0x113d2b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x42aa('0x0'));var BPromise=require(_0x42aa('0x1'));var rs=require(_0x42aa('0x2'));var fs=require('fs');var Redis=require(_0x42aa('0x3'));var db=require(_0x42aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x42aa('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x42aa('0x6')]['http']({'port':0x232a});config[_0x42aa('0x7')]=_['defaults'](config[_0x42aa('0x7')],{'host':_0x42aa('0x8'),'port':0x18eb});var socket=require(_0x42aa('0x9'))(new Redis(config['redis']));require(_0x42aa('0xa'))[_0x42aa('0xb')](socket);function respondWithRpcPromise(_0x35fcb7,_0x3dd38c,_0x64baf4){return new BPromise(function(_0x3976cf,_0x3a3164){return client[_0x42aa('0xc')](_0x35fcb7,_0x64baf4)[_0x42aa('0xd')](function(_0x139081){logger[_0x42aa('0xe')](_0x42aa('0xf'),_0x3dd38c,_0x42aa('0x10'));logger[_0x42aa('0x11')](_0x42aa('0x12'),_0x3dd38c,_0x42aa('0x10'),JSON[_0x42aa('0x13')](_0x139081));if(_0x139081['error']){if(_0x139081['error'][_0x42aa('0x14')]===0x1f4){logger['error'](_0x42aa('0xf'),_0x3dd38c,_0x139081['error'][_0x42aa('0x15')]);return _0x3a3164(_0x139081['error'][_0x42aa('0x15')]);}logger[_0x42aa('0x16')](_0x42aa('0xf'),_0x3dd38c,_0x139081[_0x42aa('0x16')][_0x42aa('0x15')]);return _0x3976cf(_0x139081['error'][_0x42aa('0x15')]);}else{logger[_0x42aa('0xe')]('FaxQueue,\x20%s,\x20%s',_0x3dd38c,_0x42aa('0x10'));_0x3976cf(_0x139081[_0x42aa('0x17')][_0x42aa('0x15')]);}})[_0x42aa('0x18')](function(_0x1067a2){logger[_0x42aa('0x16')](_0x42aa('0xf'),_0x3dd38c,_0x1067a2);_0x3a3164(_0x1067a2);});});}exports[_0x42aa('0x19')]=function(_0xb4ac15){var _0x330025=this;return new Promise(function(_0x2170ed,_0xcf1d7a){return db[_0x42aa('0x1a')][_0x42aa('0x1b')]({'raw':_0xb4ac15[_0x42aa('0x1c')]?_0xb4ac15[_0x42aa('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xb4ac15[_0x42aa('0x1c')]?_0xb4ac15[_0x42aa('0x1c')][_0x42aa('0x1d')]||null:null,'attributes':_0xb4ac15[_0x42aa('0x1c')]?_0xb4ac15[_0x42aa('0x1c')]['attributes']||null:null,'limit':_0xb4ac15[_0x42aa('0x1c')]?_0xb4ac15['options'][_0x42aa('0x1e')]||null:null,'include':_0xb4ac15['options']?_0xb4ac15[_0x42aa('0x1c')]['include']?_['map'](_0xb4ac15[_0x42aa('0x1c')][_0x42aa('0x1f')],function(_0xfab83b){return{'model':db[_0xfab83b[_0x42aa('0x20')]],'as':_0xfab83b['as'],'attributes':_0xfab83b['attributes'],'include':_0xfab83b[_0x42aa('0x1f')]?_['map'](_0xfab83b[_0x42aa('0x1f')],function(_0x5a0f02){return{'model':db[_0x5a0f02['model']],'as':_0x5a0f02['as'],'attributes':_0x5a0f02[_0x42aa('0x21')],'include':_0x5a0f02[_0x42aa('0x1f')]?_[_0x42aa('0x22')](_0x5a0f02[_0x42aa('0x1f')],function(_0x4406b4){return{'model':db[_0x4406b4[_0x42aa('0x20')]],'as':_0x4406b4['as'],'attributes':_0x4406b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x42aa('0xd')](function(_0x5ec5bb){logger[_0x42aa('0xe')]('GetFaxQueue',_0xb4ac15);logger['debug'](_0x42aa('0x19'),_0xb4ac15,JSON[_0x42aa('0x13')](_0x5ec5bb));_0x2170ed(_0x5ec5bb);})[_0x42aa('0x18')](function(_0x104158){logger[_0x42aa('0x16')]('GetFaxQueue',_0x104158[_0x42aa('0x15')],_0xb4ac15);_0xcf1d7a(_0x330025[_0x42aa('0x16')](0x1f4,_0x104158['message']));});});};exports[_0x42aa('0x23')]=function(_0x374b18){var _0x1acad0=this;return new Promise(function(_0x40616b,_0x19fba0){return db[_0x42aa('0x1a')]['find']({'raw':_0x374b18['options']?_0x374b18[_0x42aa('0x1c')][_0x42aa('0x24')]===undefined?!![]:![]:!![],'where':_0x374b18[_0x42aa('0x1c')]?_0x374b18[_0x42aa('0x1c')]['where']||null:null,'attributes':_0x374b18['options']?_0x374b18['options']['attributes']||null:null,'include':_0x374b18[_0x42aa('0x1c')]?_0x374b18[_0x42aa('0x1c')][_0x42aa('0x1f')]?_[_0x42aa('0x22')](_0x374b18[_0x42aa('0x1c')]['include'],function(_0x354a94){return{'model':db[_0x354a94[_0x42aa('0x20')]],'as':_0x354a94['as'],'attributes':_0x354a94[_0x42aa('0x21')],'include':_0x354a94[_0x42aa('0x1f')]?_[_0x42aa('0x22')](_0x354a94[_0x42aa('0x1f')],function(_0x2ce4f7){return{'model':db[_0x2ce4f7[_0x42aa('0x20')]],'as':_0x2ce4f7['as'],'attributes':_0x2ce4f7[_0x42aa('0x21')],'include':_0x2ce4f7[_0x42aa('0x1f')]?_[_0x42aa('0x22')](_0x2ce4f7[_0x42aa('0x1f')],function(_0x45b0d7){return{'model':db[_0x45b0d7[_0x42aa('0x20')]],'as':_0x45b0d7['as'],'attributes':_0x45b0d7[_0x42aa('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35b211){logger[_0x42aa('0xe')](_0x42aa('0x23'),_0x374b18);logger['debug']('ShowFaxQueue',_0x374b18,JSON[_0x42aa('0x13')](_0x35b211));_0x40616b(_0x35b211);})[_0x42aa('0x18')](function(_0x2ef02a){logger[_0x42aa('0x16')](_0x42aa('0x23'),_0x2ef02a[_0x42aa('0x15')],_0x374b18);_0x19fba0(_0x1acad0[_0x42aa('0x16')](0x1f4,_0x2ef02a[_0x42aa('0x15')]));});});}; \ No newline at end of file +var _0x050d=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','include','map','model','then','GetFaxQueue','ShowFaxQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x270230,_0x2902fb){var _0x56affa=function(_0x528a31){while(--_0x528a31){_0x270230['push'](_0x270230['shift']());}};_0x56affa(++_0x2902fb);}(_0x050d,0x1da));var _0xd050=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x050d[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xd050('0x0'));var util=require(_0xd050('0x1'));var moment=require(_0xd050('0x2'));var BPromise=require('bluebird');var rs=require(_0xd050('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd050('0x4'))['db'];var utils=require(_0xd050('0x5'));var logger=require('../../config/logger')(_0xd050('0x6'));var config=require(_0xd050('0x7'));var jayson=require(_0xd050('0x8'));var client=jayson[_0xd050('0x9')][_0xd050('0xa')]({'port':0x232a});config[_0xd050('0xb')]=_[_0xd050('0xc')](config[_0xd050('0xb')],{'host':_0xd050('0xd'),'port':0x18eb});var socket=require(_0xd050('0xe'))(new Redis(config['redis']));require(_0xd050('0xf'))[_0xd050('0x10')](socket);function respondWithRpcPromise(_0x4e5fae,_0x1bb414,_0x14b762){return new BPromise(function(_0x1c3b7e,_0x32604d){return client['request'](_0x4e5fae,_0x14b762)['then'](function(_0x1b67c5){logger[_0xd050('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1bb414,_0xd050('0x12'));logger[_0xd050('0x13')](_0xd050('0x14'),_0x1bb414,'request\x20sent',JSON[_0xd050('0x15')](_0x1b67c5));if(_0x1b67c5[_0xd050('0x16')]){if(_0x1b67c5[_0xd050('0x16')]['code']===0x1f4){logger['error'](_0xd050('0x17'),_0x1bb414,_0x1b67c5['error'][_0xd050('0x18')]);return _0x32604d(_0x1b67c5[_0xd050('0x16')][_0xd050('0x18')]);}logger[_0xd050('0x16')](_0xd050('0x17'),_0x1bb414,_0x1b67c5[_0xd050('0x16')]['message']);return _0x1c3b7e(_0x1b67c5['error']['message']);}else{logger[_0xd050('0x11')](_0xd050('0x17'),_0x1bb414,_0xd050('0x12'));_0x1c3b7e(_0x1b67c5[_0xd050('0x19')][_0xd050('0x18')]);}})[_0xd050('0x1a')](function(_0x13a613){logger[_0xd050('0x16')](_0xd050('0x17'),_0x1bb414,_0x13a613);_0x32604d(_0x13a613);});});}exports['GetFaxQueue']=function(_0xa58cfb){var _0x1c03ca=this;return new Promise(function(_0x442b1f,_0x5e0104){return db[_0xd050('0x1b')][_0xd050('0x1c')]({'raw':_0xa58cfb[_0xd050('0x1d')]?_0xa58cfb[_0xd050('0x1d')][_0xd050('0x1e')]===undefined?!![]:![]:!![],'where':_0xa58cfb['options']?_0xa58cfb[_0xd050('0x1d')][_0xd050('0x1f')]||null:null,'attributes':_0xa58cfb['options']?_0xa58cfb[_0xd050('0x1d')][_0xd050('0x20')]||null:null,'limit':_0xa58cfb['options']?_0xa58cfb[_0xd050('0x1d')]['limit']||null:null,'include':_0xa58cfb['options']?_0xa58cfb['options'][_0xd050('0x21')]?_[_0xd050('0x22')](_0xa58cfb[_0xd050('0x1d')][_0xd050('0x21')],function(_0x59e6d0){return{'model':db[_0x59e6d0[_0xd050('0x23')]],'as':_0x59e6d0['as'],'attributes':_0x59e6d0[_0xd050('0x20')],'include':_0x59e6d0[_0xd050('0x21')]?_['map'](_0x59e6d0[_0xd050('0x21')],function(_0x19032a){return{'model':db[_0x19032a[_0xd050('0x23')]],'as':_0x19032a['as'],'attributes':_0x19032a[_0xd050('0x20')],'include':_0x19032a[_0xd050('0x21')]?_['map'](_0x19032a['include'],function(_0xeb0d80){return{'model':db[_0xeb0d80[_0xd050('0x23')]],'as':_0xeb0d80['as'],'attributes':_0xeb0d80[_0xd050('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd050('0x24')](function(_0x5f4a18){logger[_0xd050('0x11')](_0xd050('0x25'),_0xa58cfb);logger[_0xd050('0x13')]('GetFaxQueue',_0xa58cfb,JSON[_0xd050('0x15')](_0x5f4a18));_0x442b1f(_0x5f4a18);})[_0xd050('0x1a')](function(_0x78369a){logger[_0xd050('0x16')](_0xd050('0x25'),_0x78369a[_0xd050('0x18')],_0xa58cfb);_0x5e0104(_0x1c03ca[_0xd050('0x16')](0x1f4,_0x78369a['message']));});});};exports[_0xd050('0x26')]=function(_0x35b28e){var _0x3cf1fd=this;return new Promise(function(_0xeeb3da,_0x28c7bc){return db[_0xd050('0x1b')][_0xd050('0x27')]({'raw':_0x35b28e['options']?_0x35b28e[_0xd050('0x1d')][_0xd050('0x1e')]===undefined?!![]:![]:!![],'where':_0x35b28e[_0xd050('0x1d')]?_0x35b28e[_0xd050('0x1d')][_0xd050('0x1f')]||null:null,'attributes':_0x35b28e[_0xd050('0x1d')]?_0x35b28e[_0xd050('0x1d')][_0xd050('0x20')]||null:null,'include':_0x35b28e[_0xd050('0x1d')]?_0x35b28e['options'][_0xd050('0x21')]?_[_0xd050('0x22')](_0x35b28e[_0xd050('0x1d')][_0xd050('0x21')],function(_0x214602){return{'model':db[_0x214602[_0xd050('0x23')]],'as':_0x214602['as'],'attributes':_0x214602['attributes'],'include':_0x214602['include']?_[_0xd050('0x22')](_0x214602[_0xd050('0x21')],function(_0x376ebe){return{'model':db[_0x376ebe[_0xd050('0x23')]],'as':_0x376ebe['as'],'attributes':_0x376ebe[_0xd050('0x20')],'include':_0x376ebe[_0xd050('0x21')]?_[_0xd050('0x22')](_0x376ebe[_0xd050('0x21')],function(_0x2745d7){return{'model':db[_0x2745d7[_0xd050('0x23')]],'as':_0x2745d7['as'],'attributes':_0x2745d7['attributes']};}):[]};}):[]};}):[]:[]})[_0xd050('0x24')](function(_0x9447){logger['info'](_0xd050('0x26'),_0x35b28e);logger['debug']('ShowFaxQueue',_0x35b28e,JSON['stringify'](_0x9447));_0xeeb3da(_0x9447);})[_0xd050('0x1a')](function(_0xa9d537){logger[_0xd050('0x16')](_0xd050('0x26'),_0xa9d537[_0xd050('0x18')],_0x35b28e);_0x28c7bc(_0x3cf1fd[_0xd050('0x16')](0x1f4,_0xa9d537[_0xd050('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c622123..a1d328b 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 _0xe3d7=['faxQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x44fce0,_0x92278a){var _0x5c1498=function(_0x2a42b6){while(--_0x2a42b6){_0x44fce0['push'](_0x44fce0['shift']());}};_0x5c1498(++_0x92278a);}(_0xe3d7,0x109));var _0x7e3d=function(_0x588e7c,_0x112f11){_0x588e7c=_0x588e7c-0x0;var _0x97e0ce=_0xe3d7[_0x588e7c];return _0x97e0ce;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x7e3d('0x0'),_0x7e3d('0x1'),_0x7e3d('0x2')];function createListener(_0x20836a,_0x3b8e29){return function(_0x2bf69b){_0x3b8e29[_0x7e3d('0x3')](_0x20836a,_0x2bf69b);};}function removeListener(_0x487a11,_0x17d2f7){return function(){FaxQueueEvents[_0x7e3d('0x4')](_0x487a11,_0x17d2f7);};}exports[_0x7e3d('0x5')]=function(_0x3445a1){for(var _0x4433c5=0x0,_0x351a6c=events[_0x7e3d('0x6')];_0x4433c5<_0x351a6c;_0x4433c5++){var _0x688b93=events[_0x4433c5];var _0x200ce0=createListener(_0x7e3d('0x7')+_0x688b93,_0x3445a1);FaxQueueEvents['on'](_0x688b93,_0x200ce0);}}; \ No newline at end of file +var _0xb4b1=['save','remove','removeListener','register','length','./faxQueue.events'];(function(_0x4089af,_0x2ab7a5){var _0x2e28ab=function(_0x33b4a7){while(--_0x33b4a7){_0x4089af['push'](_0x4089af['shift']());}};_0x2e28ab(++_0x2ab7a5);}(_0xb4b1,0x1d3));var _0x1b4b=function(_0x3c356c,_0xdac291){_0x3c356c=_0x3c356c-0x0;var _0x238da4=_0xb4b1[_0x3c356c];return _0x238da4;};'use strict';var FaxQueueEvents=require(_0x1b4b('0x0'));var events=[_0x1b4b('0x1'),_0x1b4b('0x2'),'update'];function createListener(_0xaceff9,_0x37d391){return function(_0x4ad424){_0x37d391['emit'](_0xaceff9,_0x4ad424);};}function removeListener(_0x53df28,_0x526a3a){return function(){FaxQueueEvents[_0x1b4b('0x3')](_0x53df28,_0x526a3a);};}exports[_0x1b4b('0x4')]=function(_0x33f835){for(var _0x3b7f53=0x0,_0x256bab=events[_0x1b4b('0x5')];_0x3b7f53<_0x256bab;_0x3b7f53++){var _0x3d1be4=events[_0x3b7f53];var _0x37b601=createListener('faxQueue:'+_0x3d1be4,_0x33f835);FaxQueueEvents['on'](_0x3d1be4,_0x37b601);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e5f2426..78f98c8 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x497ea6,_0x449c63){var _0x4c5735=function(_0x188e2d){while(--_0x188e2d){_0x497ea6['push'](_0x497ea6['shift']());}};_0x4c5735(++_0x449c63);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x29159e,_0x4b0225){_0x29159e=_0x29159e-0x0;var _0x3bfd94=_0xaf1b[_0x29159e];return _0x3bfd94;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMembers']);router[_0xbaf1('0xb')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0xb')](_0xbaf1('0x14'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x17')](_0xbaf1('0x18'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x19')]);router[_0xbaf1('0x17')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1a')]);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1c')]);router[_0xbaf1('0x1d')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller['destroy']);router[_0xbaf1('0x1d')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1e')]);router[_0xbaf1('0x1d')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x32f4=['/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','show','/:id/members','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32f4,0x154));var _0x432f=function(_0x2ee907,_0x7c8139){_0x2ee907=_0x2ee907-0x0;var _0x3111f4=_0x32f4[_0x2ee907];return _0x3111f4;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0x9')](_0x432f('0xd'),auth[_0x432f('0xa')](),controller['getMembers']);router[_0x432f('0x9')]('/:id/teams',auth[_0x432f('0xa')](),controller['getTeams']);router[_0x432f('0x9')](_0x432f('0xe'),auth['isAuthenticated'](),controller[_0x432f('0xf')]);router[_0x432f('0x10')]('/',auth['isAuthenticated'](),controller[_0x432f('0x11')]);router[_0x432f('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0x432f('0x12')]);router[_0x432f('0x10')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller[_0x432f('0x13')]);router['put'](_0x432f('0x14'),auth[_0x432f('0xa')](),controller[_0x432f('0x15')]);router[_0x432f('0x16')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0x17')]);router[_0x432f('0x16')](_0x432f('0x18'),auth[_0x432f('0xa')](),controller[_0x432f('0x19')]);router['delete'](_0x432f('0xe'),auth['isAuthenticated'](),controller[_0x432f('0x1a')]);module[_0x432f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b8f1664..8831cb8 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 _0x2c42=['exports','STRING','DATE','moment'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x2c42,0x18b));var _0x22c4=function(_0x26ef53,_0x26088e){_0x26ef53=_0x26ef53-0x0;var _0x20479e=_0x2c42[_0x26ef53];return _0x20479e;};'use strict';var moment=require(_0x22c4('0x0'));var Sequelize=require('sequelize');module[_0x22c4('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x22c4('0x2')]},'joinAt':{'type':Sequelize[_0x22c4('0x3')]},'leaveAt':{'type':Sequelize[_0x22c4('0x3')]},'acceptAt':{'type':Sequelize[_0x22c4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x22c4('0x2')]}}; \ No newline at end of file +var _0xeb24=['STRING','DATE','moment','sequelize','exports'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xeb24,0x12e));var _0x4eb2=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xeb24[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require(_0x4eb2('0x0'));var Sequelize=require(_0x4eb2('0x1'));module[_0x4eb2('0x2')]={'uniqueid':{'type':Sequelize[_0x4eb2('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4eb2('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4eb2('0x4')]},'reason':{'type':Sequelize[_0x4eb2('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e3ab9a1..8de0452 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 _0x3dd5=['end','offset','undefined','limit','count','json','apply','reject','save','then','error','stack','name','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','FaxQueueReport','includeAll','include','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x4bdb2e,_0x53ae98){var _0x372646=function(_0x23b355){while(--_0x23b355){_0x4bdb2e['push'](_0x4bdb2e['shift']());}};_0x372646(++_0x53ae98);}(_0x3dd5,0x73));var _0x53dd=function(_0x5a8adb,_0x3636cf){_0x5a8adb=_0x5a8adb-0x0;var _0x1891ce=_0x3dd5[_0x5a8adb];return _0x1891ce;};'use strict';var emlformat=require(_0x53dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53dd('0x1'));var jsonpatch=require(_0x53dd('0x2'));var rp=require(_0x53dd('0x3'));var moment=require(_0x53dd('0x4'));var BPromise=require(_0x53dd('0x5'));var Mustache=require(_0x53dd('0x6'));var util=require(_0x53dd('0x7'));var path=require(_0x53dd('0x8'));var sox=require(_0x53dd('0x9'));var csv=require('to-csv');var ejs=require(_0x53dd('0xa'));var fs=require('fs');var fs_extra=require(_0x53dd('0xb'));var _=require(_0x53dd('0xc'));var squel=require(_0x53dd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x53dd('0xf'));var Papa=require(_0x53dd('0x10'));var Redis=require(_0x53dd('0x11'));var authService=require(_0x53dd('0x12'));var qs=require(_0x53dd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53dd('0x14'));var logger=require(_0x53dd('0x15'))(_0x53dd('0x16'));var utils=require(_0x53dd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x53dd('0x18'))['db'];function respondWithStatusCode(_0x263838,_0xdddaa8){_0xdddaa8=_0xdddaa8||0xcc;return function(_0x5117a6){if(_0x5117a6){return _0x263838[_0x53dd('0x19')](_0xdddaa8);}return _0x263838[_0x53dd('0x1a')](_0xdddaa8)[_0x53dd('0x1b')]();};}function respondWithResult(_0x5aef74,_0x130671){_0x130671=_0x130671||0xc8;return function(_0x345f36){if(_0x345f36){return _0x5aef74[_0x53dd('0x1a')](_0x130671)['json'](_0x345f36);}};}function respondWithFilteredResult(_0x593a36,_0x5364be){return function(_0x595f18){if(_0x595f18){var _0x1d8ecf=typeof _0x5364be[_0x53dd('0x1c')]===_0x53dd('0x1d')&&typeof _0x5364be[_0x53dd('0x1e')]===_0x53dd('0x1d');var _0x4a7637=_0x595f18['count'];var _0x45765e=_0x1d8ecf?0x0:_0x5364be[_0x53dd('0x1c')];var _0x350d03=_0x1d8ecf?_0x595f18[_0x53dd('0x1f')]:_0x5364be[_0x53dd('0x1c')]+_0x5364be['limit'];var _0x5d0e96;if(_0x350d03>=_0x4a7637){_0x350d03=_0x4a7637;_0x5d0e96=0xc8;}else{_0x5d0e96=0xce;}_0x593a36['status'](_0x5d0e96);return _0x593a36['set']('Content-Range',_0x45765e+'-'+_0x350d03+'/'+_0x4a7637)[_0x53dd('0x20')](_0x595f18);}return null;};}function patchUpdates(_0x54abbc){return function(_0x5365a7){try{jsonpatch[_0x53dd('0x21')](_0x5365a7,_0x54abbc,!![]);}catch(_0x1dcc36){return BPromise[_0x53dd('0x22')](_0x1dcc36);}return _0x5365a7[_0x53dd('0x23')]();};}function saveUpdates(_0x17ac0a,_0x4a4b3b){return function(_0x340da7){if(_0x340da7){return _0x340da7['update'](_0x17ac0a)[_0x53dd('0x24')](function(_0x2a3520){return _0x2a3520;});}return null;};}function removeEntity(_0x534ce0,_0x42e72e){return function(_0x13e087){if(_0x13e087){return _0x13e087['destroy']()[_0x53dd('0x24')](function(){_0x534ce0['status'](0xcc)[_0x53dd('0x1b')]();});}};}function handleEntityNotFound(_0x3506cc,_0x2a7508){return function(_0x42a644){if(!_0x42a644){_0x3506cc[_0x53dd('0x19')](0x194);}return _0x42a644;};}function handleError(_0x234bf6,_0x1c0b0d){_0x1c0b0d=_0x1c0b0d||0x1f4;return function(_0x1c6d36){logger[_0x53dd('0x25')](_0x1c6d36[_0x53dd('0x26')]);if(_0x1c6d36[_0x53dd('0x27')]){delete _0x1c6d36['name'];}_0x234bf6[_0x53dd('0x1a')](_0x1c0b0d)['send'](_0x1c6d36);};}exports['index']=function(_0xdf4e69,_0x374aab){var _0x586f01={},_0x24403d={},_0x55443d={'count':0x0,'rows':[]};var _0x3b2f31=_[_0x53dd('0x28')](db['FaxQueueReport'][_0x53dd('0x29')],function(_0x3d037b){return{'name':_0x3d037b['fieldName'],'type':_0x3d037b[_0x53dd('0x2a')]['key']};});_0x24403d[_0x53dd('0x2b')]=_[_0x53dd('0x28')](_0x3b2f31,'name');_0x24403d[_0x53dd('0x2c')]=_[_0x53dd('0x2d')](_0xdf4e69[_0x53dd('0x2c')]);_0x24403d[_0x53dd('0x2e')]=_[_0x53dd('0x2f')](_0x24403d[_0x53dd('0x2b')],_0x24403d['query']);_0x586f01['attributes']=_[_0x53dd('0x2f')](_0x24403d[_0x53dd('0x2b')],qs[_0x53dd('0x30')](_0xdf4e69[_0x53dd('0x2c')]['fields']));_0x586f01[_0x53dd('0x31')]=_0x586f01[_0x53dd('0x31')][_0x53dd('0x32')]?_0x586f01[_0x53dd('0x31')]:_0x24403d[_0x53dd('0x2b')];if(!_0xdf4e69[_0x53dd('0x2c')][_0x53dd('0x33')]('nolimit')){_0x586f01[_0x53dd('0x1e')]=qs['limit'](_0xdf4e69[_0x53dd('0x2c')][_0x53dd('0x1e')]);_0x586f01[_0x53dd('0x1c')]=qs['offset'](_0xdf4e69[_0x53dd('0x2c')]['offset']);}_0x586f01[_0x53dd('0x34')]=qs[_0x53dd('0x35')](_0xdf4e69[_0x53dd('0x2c')][_0x53dd('0x35')]);_0x586f01[_0x53dd('0x36')]=qs[_0x53dd('0x2e')](_[_0x53dd('0x37')](_0xdf4e69[_0x53dd('0x2c')],_0x24403d[_0x53dd('0x2e')]),_0x3b2f31);if(_0xdf4e69[_0x53dd('0x2c')]['filter']){_0x586f01[_0x53dd('0x36')]=_['merge'](_0x586f01[_0x53dd('0x36')],{'$or':_[_0x53dd('0x28')](_0x3b2f31,function(_0xa687fb){if(_0xa687fb[_0x53dd('0x2a')]!=='VIRTUAL'){var _0x13f789={};_0x13f789[_0xa687fb[_0x53dd('0x27')]]={'$like':'%'+_0xdf4e69[_0x53dd('0x2c')][_0x53dd('0x38')]+'%'};return _0x13f789;}})});}_0x586f01=_[_0x53dd('0x39')]({},_0x586f01,_0xdf4e69[_0x53dd('0x3a')]);var _0x1a4dd7={'where':_0x586f01[_0x53dd('0x36')]};return db[_0x53dd('0x3b')]['count'](_0x1a4dd7)[_0x53dd('0x24')](function(_0x5f1336){_0x55443d[_0x53dd('0x1f')]=_0x5f1336;if(_0xdf4e69[_0x53dd('0x2c')][_0x53dd('0x3c')]){_0x586f01[_0x53dd('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x586f01);})[_0x53dd('0x24')](function(_0x3ad649){_0x55443d[_0x53dd('0x3e')]=_0x3ad649;return _0x55443d;})[_0x53dd('0x24')](respondWithFilteredResult(_0x374aab,_0x586f01))[_0x53dd('0x3f')](handleError(_0x374aab,null));};exports[_0x53dd('0x40')]=function(_0x7d706d,_0x2de08e){var _0x19ceb8={'raw':!![],'where':{'id':_0x7d706d[_0x53dd('0x41')]['id']}},_0x8b9797={};_0x8b9797[_0x53dd('0x2b')]=_[_0x53dd('0x2d')](db[_0x53dd('0x3b')][_0x53dd('0x29')]);_0x8b9797[_0x53dd('0x2c')]=_[_0x53dd('0x2d')](_0x7d706d[_0x53dd('0x2c')]);_0x8b9797[_0x53dd('0x2e')]=_[_0x53dd('0x2f')](_0x8b9797[_0x53dd('0x2b')],_0x8b9797[_0x53dd('0x2c')]);_0x19ceb8['attributes']=_[_0x53dd('0x2f')](_0x8b9797[_0x53dd('0x2b')],qs[_0x53dd('0x30')](_0x7d706d[_0x53dd('0x2c')][_0x53dd('0x30')]));_0x19ceb8[_0x53dd('0x31')]=_0x19ceb8[_0x53dd('0x31')]['length']?_0x19ceb8[_0x53dd('0x31')]:_0x8b9797[_0x53dd('0x2b')];if(_0x7d706d['query'][_0x53dd('0x3c')]){_0x19ceb8[_0x53dd('0x3d')]=[{'all':!![]}];}_0x19ceb8=_['merge']({},_0x19ceb8,_0x7d706d['options']);return db[_0x53dd('0x3b')][_0x53dd('0x42')](_0x19ceb8)[_0x53dd('0x24')](handleEntityNotFound(_0x2de08e,null))[_0x53dd('0x24')](respondWithResult(_0x2de08e,null))[_0x53dd('0x3f')](handleError(_0x2de08e,null));};exports[_0x53dd('0x43')]=function(_0x2cff5f,_0x56dc8b){return db[_0x53dd('0x3b')][_0x53dd('0x43')](_0x2cff5f[_0x53dd('0x44')],{})['then'](respondWithResult(_0x56dc8b,0xc9))[_0x53dd('0x3f')](handleError(_0x56dc8b,null));};exports[_0x53dd('0x45')]=function(_0x45e124,_0x5c0775){if(_0x45e124[_0x53dd('0x44')]['id']){delete _0x45e124['body']['id'];}return db[_0x53dd('0x3b')][_0x53dd('0x42')]({'where':{'id':_0x45e124['params']['id']}})[_0x53dd('0x24')](handleEntityNotFound(_0x5c0775,null))[_0x53dd('0x24')](saveUpdates(_0x45e124['body'],null))[_0x53dd('0x24')](respondWithResult(_0x5c0775,null))[_0x53dd('0x3f')](handleError(_0x5c0775,null));};exports['destroy']=function(_0x57fa60,_0x1965b2){return db['FaxQueueReport'][_0x53dd('0x42')]({'where':{'id':_0x57fa60['params']['id']}})[_0x53dd('0x24')](handleEntityNotFound(_0x1965b2,null))[_0x53dd('0x24')](removeEntity(_0x1965b2,null))[_0x53dd('0x3f')](handleError(_0x1965b2,null));};exports[_0x53dd('0x46')]=function(_0x489c15,_0x20c176){return db[_0x53dd('0x3b')][_0x53dd('0x46')]()[_0x53dd('0x24')](respondWithResult(_0x20c176,null))[_0x53dd('0x3f')](handleError(_0x20c176,null));}; \ No newline at end of file +var _0x2137=['show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','rows','catch'];(function(_0x32f440,_0x4e129a){var _0x31023f=function(_0x14ffb6){while(--_0x14ffb6){_0x32f440['push'](_0x32f440['shift']());}};_0x31023f(++_0x4e129a);}(_0x2137,0x134));var _0x7213=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0x2137[_0x305c8f];return _0x5ddc30;};'use strict';var emlformat=require(_0x7213('0x0'));var rimraf=require(_0x7213('0x1'));var zipdir=require(_0x7213('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7213('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7213('0x4'));var util=require(_0x7213('0x5'));var path=require(_0x7213('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7213('0x7'));var _=require(_0x7213('0x8'));var squel=require('squel');var crypto=require(_0x7213('0x9'));var jsforce=require(_0x7213('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7213('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7213('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7213('0xd'));var as=require(_0x7213('0xe'));var hardwareService=require(_0x7213('0xf'));var logger=require(_0x7213('0x10'))(_0x7213('0x11'));var utils=require(_0x7213('0x12'));var config=require(_0x7213('0x13'));var licenseUtil=require(_0x7213('0x14'));var db=require(_0x7213('0x15'))['db'];function respondWithStatusCode(_0x30583e,_0x58e74a){_0x58e74a=_0x58e74a||0xcc;return function(_0x3d0115){if(_0x3d0115){return _0x30583e[_0x7213('0x16')](_0x58e74a);}return _0x30583e[_0x7213('0x17')](_0x58e74a)[_0x7213('0x18')]();};}function respondWithResult(_0xa71eea,_0x9764e1){_0x9764e1=_0x9764e1||0xc8;return function(_0x121036){if(_0x121036){return _0xa71eea[_0x7213('0x17')](_0x9764e1)[_0x7213('0x19')](_0x121036);}};}function respondWithFilteredResult(_0x1f5a7c,_0xe91a2f){return function(_0x277455){if(_0x277455){var _0x4809fb=typeof _0xe91a2f[_0x7213('0x1a')]===_0x7213('0x1b')&&typeof _0xe91a2f[_0x7213('0x1c')]===_0x7213('0x1b');var _0x2ab127=_0x277455[_0x7213('0x1d')];var _0x6c6c85=_0x4809fb?0x0:_0xe91a2f[_0x7213('0x1a')];var _0x2cb068=_0x4809fb?_0x277455[_0x7213('0x1d')]:_0xe91a2f[_0x7213('0x1a')]+_0xe91a2f[_0x7213('0x1c')];var _0x1ebb2b;if(_0x2cb068>=_0x2ab127){_0x2cb068=_0x2ab127;_0x1ebb2b=0xc8;}else{_0x1ebb2b=0xce;}_0x1f5a7c['status'](_0x1ebb2b);return _0x1f5a7c[_0x7213('0x1e')](_0x7213('0x1f'),_0x6c6c85+'-'+_0x2cb068+'/'+_0x2ab127)[_0x7213('0x19')](_0x277455);}return null;};}function patchUpdates(_0x3bd9cc){return function(_0x1b17d0){try{jsonpatch['apply'](_0x1b17d0,_0x3bd9cc,!![]);}catch(_0x136bd6){return BPromise[_0x7213('0x20')](_0x136bd6);}return _0x1b17d0[_0x7213('0x21')]();};}function saveUpdates(_0x2a9787,_0x43c17c){return function(_0x2e49d8){if(_0x2e49d8){return _0x2e49d8[_0x7213('0x22')](_0x2a9787)[_0x7213('0x23')](function(_0x13afcc){return _0x13afcc;});}return null;};}function removeEntity(_0x4f3756,_0x5ddb6b){return function(_0x40d1a6){if(_0x40d1a6){return _0x40d1a6['destroy']()[_0x7213('0x23')](function(){_0x4f3756['status'](0xcc)[_0x7213('0x18')]();});}};}function handleEntityNotFound(_0xb08e37,_0x4eedf1){return function(_0x5ecadd){if(!_0x5ecadd){_0xb08e37['sendStatus'](0x194);}return _0x5ecadd;};}function handleError(_0x363ad9,_0x139f2f){_0x139f2f=_0x139f2f||0x1f4;return function(_0x1e443d){logger[_0x7213('0x24')](_0x1e443d[_0x7213('0x25')]);if(_0x1e443d[_0x7213('0x26')]){delete _0x1e443d['name'];}_0x363ad9['status'](_0x139f2f)[_0x7213('0x27')](_0x1e443d);};}exports[_0x7213('0x28')]=function(_0x7d59dc,_0x59139e){var _0x562783={},_0x59a540={},_0x11ed63={'count':0x0,'rows':[]};var _0x100766=_[_0x7213('0x29')](db[_0x7213('0x2a')][_0x7213('0x2b')],function(_0x5784ab){return{'name':_0x5784ab[_0x7213('0x2c')],'type':_0x5784ab[_0x7213('0x2d')][_0x7213('0x2e')]};});_0x59a540[_0x7213('0x2f')]=_[_0x7213('0x29')](_0x100766,_0x7213('0x26'));_0x59a540[_0x7213('0x30')]=_[_0x7213('0x31')](_0x7d59dc[_0x7213('0x30')]);_0x59a540['filters']=_['intersection'](_0x59a540[_0x7213('0x2f')],_0x59a540[_0x7213('0x30')]);_0x562783[_0x7213('0x32')]=_[_0x7213('0x33')](_0x59a540['model'],qs[_0x7213('0x34')](_0x7d59dc[_0x7213('0x30')][_0x7213('0x34')]));_0x562783['attributes']=_0x562783['attributes'][_0x7213('0x35')]?_0x562783[_0x7213('0x32')]:_0x59a540[_0x7213('0x2f')];if(!_0x7d59dc[_0x7213('0x30')][_0x7213('0x36')]('nolimit')){_0x562783[_0x7213('0x1c')]=qs[_0x7213('0x1c')](_0x7d59dc['query'][_0x7213('0x1c')]);_0x562783[_0x7213('0x1a')]=qs['offset'](_0x7d59dc['query']['offset']);}_0x562783[_0x7213('0x37')]=qs['sort'](_0x7d59dc[_0x7213('0x30')][_0x7213('0x38')]);_0x562783[_0x7213('0x39')]=qs['filters'](_[_0x7213('0x3a')](_0x7d59dc['query'],_0x59a540[_0x7213('0x3b')]),_0x100766);if(_0x7d59dc['query']['filter']){_0x562783[_0x7213('0x39')]=_[_0x7213('0x3c')](_0x562783['where'],{'$or':_[_0x7213('0x29')](_0x100766,function(_0x91b92b){if(_0x91b92b[_0x7213('0x2d')]!==_0x7213('0x3d')){var _0x2bc359={};_0x2bc359[_0x91b92b[_0x7213('0x26')]]={'$like':'%'+_0x7d59dc[_0x7213('0x30')][_0x7213('0x3e')]+'%'};return _0x2bc359;}})});}_0x562783=_[_0x7213('0x3c')]({},_0x562783,_0x7d59dc[_0x7213('0x3f')]);var _0x2b4f75={'where':_0x562783[_0x7213('0x39')]};return db[_0x7213('0x2a')][_0x7213('0x1d')](_0x2b4f75)[_0x7213('0x23')](function(_0x4682bc){_0x11ed63[_0x7213('0x1d')]=_0x4682bc;if(_0x7d59dc[_0x7213('0x30')][_0x7213('0x40')]){_0x562783['include']=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x562783);})['then'](function(_0x484719){_0x11ed63[_0x7213('0x41')]=_0x484719;return _0x11ed63;})[_0x7213('0x23')](respondWithFilteredResult(_0x59139e,_0x562783))[_0x7213('0x42')](handleError(_0x59139e,null));};exports[_0x7213('0x43')]=function(_0x26b66a,_0x11faa8){var _0x154ce9={'raw':!![],'where':{'id':_0x26b66a[_0x7213('0x44')]['id']}},_0x2174d3={};_0x2174d3[_0x7213('0x2f')]=_[_0x7213('0x31')](db[_0x7213('0x2a')][_0x7213('0x2b')]);_0x2174d3['query']=_['keys'](_0x26b66a['query']);_0x2174d3['filters']=_['intersection'](_0x2174d3[_0x7213('0x2f')],_0x2174d3['query']);_0x154ce9[_0x7213('0x32')]=_[_0x7213('0x33')](_0x2174d3[_0x7213('0x2f')],qs['fields'](_0x26b66a[_0x7213('0x30')][_0x7213('0x34')]));_0x154ce9[_0x7213('0x32')]=_0x154ce9['attributes'][_0x7213('0x35')]?_0x154ce9[_0x7213('0x32')]:_0x2174d3[_0x7213('0x2f')];if(_0x26b66a['query'][_0x7213('0x40')]){_0x154ce9[_0x7213('0x45')]=[{'all':!![]}];}_0x154ce9=_[_0x7213('0x3c')]({},_0x154ce9,_0x26b66a[_0x7213('0x3f')]);return db[_0x7213('0x2a')][_0x7213('0x46')](_0x154ce9)[_0x7213('0x23')](handleEntityNotFound(_0x11faa8,null))[_0x7213('0x23')](respondWithResult(_0x11faa8,null))[_0x7213('0x42')](handleError(_0x11faa8,null));};exports['create']=function(_0x5b42f5,_0x2d276b){return db[_0x7213('0x2a')][_0x7213('0x47')](_0x5b42f5['body'],{})[_0x7213('0x23')](respondWithResult(_0x2d276b,0xc9))[_0x7213('0x42')](handleError(_0x2d276b,null));};exports['update']=function(_0x4c502d,_0x517162){if(_0x4c502d[_0x7213('0x48')]['id']){delete _0x4c502d[_0x7213('0x48')]['id'];}return db['FaxQueueReport'][_0x7213('0x46')]({'where':{'id':_0x4c502d[_0x7213('0x44')]['id']}})[_0x7213('0x23')](handleEntityNotFound(_0x517162,null))[_0x7213('0x23')](saveUpdates(_0x4c502d['body'],null))['then'](respondWithResult(_0x517162,null))['catch'](handleError(_0x517162,null));};exports[_0x7213('0x49')]=function(_0x49c9fd,_0x245795){return db[_0x7213('0x2a')][_0x7213('0x46')]({'where':{'id':_0x49c9fd[_0x7213('0x44')]['id']}})[_0x7213('0x23')](handleEntityNotFound(_0x245795,null))[_0x7213('0x23')](removeEntity(_0x245795,null))[_0x7213('0x42')](handleError(_0x245795,null));};exports[_0x7213('0x4a')]=function(_0x345d1d,_0xc50ec1){return db[_0x7213('0x2a')][_0x7213('0x4a')]()['then'](respondWithResult(_0xc50ec1,null))[_0x7213('0x42')](handleError(_0xc50ec1,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 17f4022..c89b172 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x6e68e,_0x1393cf){var _0x9fb3e7=function(_0x395ca7){while(--_0x395ca7){_0x6e68e['push'](_0x6e68e['shift']());}};_0x9fb3e7(++_0x1393cf);}(_0xabce,0x103));var _0xeabc=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xabce[_0x139a3c];return _0x2b375b;};'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('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'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(_0x134019,_0x3a1963){var _0x1807e7=function(_0x2efe5c){while(--_0x2efe5c){_0x134019['push'](_0x134019['shift']());}};_0x1807e7(++_0x3a1963);}(_0x5fab,0x177));var _0xb5fa=function(_0x4cedbe,_0x17c16d){_0x4cedbe=_0x4cedbe-0x0;var _0x47aee5=_0x5fab[_0x4cedbe];return _0x47aee5;};'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 e9b6679..d6894ea 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 _0xd944=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','debug','catch','UpdateFaxQueueReport','update','body','where','attributes','lodash'];(function(_0x5a2731,_0x1c9c18){var _0x38b3f8=function(_0x1f1894){while(--_0x1f1894){_0x5a2731['push'](_0x5a2731['shift']());}};_0x38b3f8(++_0x1c9c18);}(_0xd944,0xb9));var _0x4d94=function(_0x52e774,_0x57a2b5){_0x52e774=_0x52e774-0x0;var _0x505359=_0xd944[_0x52e774];return _0x505359;};'use strict';var _=require(_0x4d94('0x0'));var util=require('util');var moment=require(_0x4d94('0x1'));var BPromise=require(_0x4d94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d94('0x3'));var db=require(_0x4d94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d94('0x5'))('rpc');var config=require(_0x4d94('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4d94('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeab080,_0x5bb0d5,_0x5a3d21){return new BPromise(function(_0x37875d,_0x43eb27){return client[_0x4d94('0x8')](_0xeab080,_0x5a3d21)[_0x4d94('0x9')](function(_0x1994ab){logger[_0x4d94('0xa')](_0x4d94('0xb'),_0x5bb0d5,_0x4d94('0xc'));logger['debug'](_0x4d94('0xd'),_0x5bb0d5,_0x4d94('0xc'),JSON[_0x4d94('0xe')](_0x1994ab));if(_0x1994ab[_0x4d94('0xf')]){if(_0x1994ab['error'][_0x4d94('0x10')]===0x1f4){logger['error'](_0x4d94('0xb'),_0x5bb0d5,_0x1994ab[_0x4d94('0xf')][_0x4d94('0x11')]);return _0x43eb27(_0x1994ab[_0x4d94('0xf')][_0x4d94('0x11')]);}logger[_0x4d94('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x5bb0d5,_0x1994ab[_0x4d94('0xf')][_0x4d94('0x11')]);return _0x37875d(_0x1994ab[_0x4d94('0xf')][_0x4d94('0x11')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5bb0d5,_0x4d94('0xc'));_0x37875d(_0x1994ab[_0x4d94('0x12')]['message']);}})['catch'](function(_0x5c225b){logger[_0x4d94('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x5bb0d5,_0x5c225b);_0x43eb27(_0x5c225b);});});}exports[_0x4d94('0x13')]=function(_0x55b07e){var _0x3dabfd=this;return new Promise(function(_0x67b9ac,_0x59002c){return db[_0x4d94('0x14')][_0x4d94('0x15')](_0x55b07e['body'],{'raw':_0x55b07e[_0x4d94('0x16')]?_0x55b07e[_0x4d94('0x16')][_0x4d94('0x17')]===undefined?!![]:![]:!![]})[_0x4d94('0x9')](function(_0x2b3ea2){logger['info'](_0x4d94('0x13'),_0x55b07e);logger[_0x4d94('0x18')]('CreateFaxQueueReport',_0x55b07e,JSON[_0x4d94('0xe')](_0x2b3ea2));_0x67b9ac(_0x2b3ea2);})[_0x4d94('0x19')](function(_0x462814){logger[_0x4d94('0xf')](_0x4d94('0x13'),_0x462814[_0x4d94('0x11')],_0x55b07e);_0x59002c(_0x3dabfd[_0x4d94('0xf')](0x1f4,_0x462814[_0x4d94('0x11')]));});});};exports[_0x4d94('0x1a')]=function(_0xcda95){var _0xab5d0=this;return new Promise(function(_0x54def8,_0x255194){return db[_0x4d94('0x14')][_0x4d94('0x1b')](_0xcda95[_0x4d94('0x1c')],{'raw':_0xcda95[_0x4d94('0x16')]?_0xcda95[_0x4d94('0x16')][_0x4d94('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcda95[_0x4d94('0x16')]?_0xcda95[_0x4d94('0x16')][_0x4d94('0x1d')]||null:null,'attributes':_0xcda95[_0x4d94('0x16')]?_0xcda95[_0x4d94('0x16')][_0x4d94('0x1e')]||null:null,'limit':_0xcda95[_0x4d94('0x16')]?_0xcda95['options']['limit']||null:null})[_0x4d94('0x9')](function(_0x3cdb73){logger['info'](_0x4d94('0x1a'),_0xcda95);logger['debug'](_0x4d94('0x1a'),_0xcda95,JSON['stringify'](_0x3cdb73));_0x54def8(_0x3cdb73);})['catch'](function(_0x215da4){logger[_0x4d94('0xf')](_0x4d94('0x1a'),_0x215da4[_0x4d94('0x11')],_0xcda95);_0x255194(_0xab5d0[_0x4d94('0xf')](0x1f4,_0x215da4[_0x4d94('0x11')]));});});}; \ No newline at end of file +var _0x56ed=['attributes','limit','UpdateFaxQueueReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','then','info','update','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56ed,0x12f));var _0xd56e=function(_0xf67a90,_0x2eb2f3){_0xf67a90=_0xf67a90-0x0;var _0x648b2=_0x56ed[_0xf67a90];return _0x648b2;};'use strict';var _=require(_0xd56e('0x0'));var util=require('util');var moment=require(_0xd56e('0x1'));var BPromise=require(_0xd56e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd56e('0x3'));var db=require(_0xd56e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd56e('0x5'));var jayson=require(_0xd56e('0x6'));var client=jayson[_0xd56e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ece07,_0x5d1704,_0x2fac1e){return new BPromise(function(_0x3c4172,_0x2632a6){return client['request'](_0x2ece07,_0x2fac1e)['then'](function(_0x3a9b36){logger['info'](_0xd56e('0x8'),_0x5d1704,_0xd56e('0x9'));logger[_0xd56e('0xa')](_0xd56e('0xb'),_0x5d1704,_0xd56e('0x9'),JSON[_0xd56e('0xc')](_0x3a9b36));if(_0x3a9b36[_0xd56e('0xd')]){if(_0x3a9b36['error'][_0xd56e('0xe')]===0x1f4){logger['error'](_0xd56e('0x8'),_0x5d1704,_0x3a9b36[_0xd56e('0xd')]['message']);return _0x2632a6(_0x3a9b36['error']['message']);}logger[_0xd56e('0xd')](_0xd56e('0x8'),_0x5d1704,_0x3a9b36[_0xd56e('0xd')][_0xd56e('0xf')]);return _0x3c4172(_0x3a9b36[_0xd56e('0xd')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5d1704,_0xd56e('0x9'));_0x3c4172(_0x3a9b36[_0xd56e('0x10')][_0xd56e('0xf')]);}})[_0xd56e('0x11')](function(_0x10ec58){logger[_0xd56e('0xd')](_0xd56e('0x8'),_0x5d1704,_0x10ec58);_0x2632a6(_0x10ec58);});});}exports[_0xd56e('0x12')]=function(_0x541791){var _0x2a863f=this;return new Promise(function(_0x367d2d,_0x2fd343){return db[_0xd56e('0x13')]['create'](_0x541791[_0xd56e('0x14')],{'raw':_0x541791['options']?_0x541791[_0xd56e('0x15')][_0xd56e('0x16')]===undefined?!![]:![]:!![]})[_0xd56e('0x17')](function(_0x439af){logger[_0xd56e('0x18')]('CreateFaxQueueReport',_0x541791);logger[_0xd56e('0xa')]('CreateFaxQueueReport',_0x541791,JSON[_0xd56e('0xc')](_0x439af));_0x367d2d(_0x439af);})['catch'](function(_0x4aa9aa){logger['error'](_0xd56e('0x12'),_0x4aa9aa[_0xd56e('0xf')],_0x541791);_0x2fd343(_0x2a863f[_0xd56e('0xd')](0x1f4,_0x4aa9aa[_0xd56e('0xf')]));});});};exports['UpdateFaxQueueReport']=function(_0x537e57){var _0x1e3ff8=this;return new Promise(function(_0x1a4f91,_0x53856b){return db[_0xd56e('0x13')][_0xd56e('0x19')](_0x537e57[_0xd56e('0x14')],{'raw':_0x537e57[_0xd56e('0x15')]?_0x537e57[_0xd56e('0x15')][_0xd56e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537e57[_0xd56e('0x15')]?_0x537e57['options'][_0xd56e('0x1a')]||null:null,'attributes':_0x537e57['options']?_0x537e57[_0xd56e('0x15')][_0xd56e('0x1b')]||null:null,'limit':_0x537e57[_0xd56e('0x15')]?_0x537e57['options'][_0xd56e('0x1c')]||null:null})[_0xd56e('0x17')](function(_0x3d96a0){logger['info']('UpdateFaxQueueReport',_0x537e57);logger[_0xd56e('0xa')]('UpdateFaxQueueReport',_0x537e57,JSON['stringify'](_0x3d96a0));_0x1a4f91(_0x3d96a0);})[_0xd56e('0x11')](function(_0x2ed4dd){logger[_0xd56e('0xd')](_0xd56e('0x1d'),_0x2ed4dd[_0xd56e('0xf')],_0x537e57);_0x53856b(_0x1e3ff8[_0xd56e('0xd')](0x1f4,_0x2ed4dd[_0xd56e('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0b2af42..ea15ea5 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 _0x4cd0=['express','Router','../../config/environment','./faxQueueReport.controller','get','index','/describe','describe','show','post','create','put','/:id','isAuthenticated','delete','multer','path','connect-timeout'];(function(_0x146c57,_0x42b094){var _0x23cf23=function(_0x3286bd){while(--_0x3286bd){_0x146c57['push'](_0x146c57['shift']());}};_0x23cf23(++_0x42b094);}(_0x4cd0,0x12f));var _0x04cd=function(_0x24afb8,_0x5648a5){_0x24afb8=_0x24afb8-0x0;var _0x3859f3=_0x4cd0[_0x24afb8];return _0x3859f3;};'use strict';var multer=require(_0x04cd('0x0'));var util=require('util');var path=require(_0x04cd('0x1'));var timeout=require(_0x04cd('0x2'));var express=require(_0x04cd('0x3'));var router=express[_0x04cd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x04cd('0x5'));var controller=require(_0x04cd('0x6'));router[_0x04cd('0x7')]('/',auth['isAuthenticated'](),controller[_0x04cd('0x8')]);router[_0x04cd('0x7')](_0x04cd('0x9'),auth['isAuthenticated'](),controller[_0x04cd('0xa')]);router[_0x04cd('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x04cd('0xb')]);router[_0x04cd('0xc')]('/',auth['isAuthenticated'](),controller[_0x04cd('0xd')]);router[_0x04cd('0xe')](_0x04cd('0xf'),auth[_0x04cd('0x10')](),controller['update']);router[_0x04cd('0x11')](_0x04cd('0xf'),auth[_0x04cd('0x10')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0613=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x44ac43,_0x529451){var _0x3755d3=function(_0x264037){while(--_0x264037){_0x44ac43['push'](_0x44ac43['shift']());}};_0x3755d3(++_0x529451);}(_0x0613,0x93));var _0x3061=function(_0x85047b,_0x5aef26){_0x85047b=_0x85047b-0x0;var _0x56b415=_0x0613[_0x85047b];return _0x56b415;};'use strict';var multer=require(_0x3061('0x0'));var util=require(_0x3061('0x1'));var path=require(_0x3061('0x2'));var timeout=require(_0x3061('0x3'));var express=require(_0x3061('0x4'));var router=express[_0x3061('0x5')]();var fs_extra=require(_0x3061('0x6'));var auth=require(_0x3061('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3061('0x8'));var controller=require(_0x3061('0x9'));router[_0x3061('0xa')]('/',auth[_0x3061('0xb')](),controller[_0x3061('0xc')]);router['get'](_0x3061('0xd'),auth[_0x3061('0xb')](),controller[_0x3061('0xe')]);router['get'](_0x3061('0xf'),auth[_0x3061('0xb')](),controller['show']);router[_0x3061('0x10')]('/',auth[_0x3061('0xb')](),controller[_0x3061('0x11')]);router[_0x3061('0x12')](_0x3061('0xf'),auth[_0x3061('0xb')](),controller[_0x3061('0x13')]);router[_0x3061('0x14')](_0x3061('0xf'),auth[_0x3061('0xb')](),controller[_0x3061('0x15')]);module[_0x3061('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index eb3766a..4152a61 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1c39ec,_0x4daefb){var _0x49db25=function(_0x13e261){while(--_0x13e261){_0x1c39ec['push'](_0x1c39ec['shift']());}};_0x49db25(++_0x4daefb);}(_0xaa88,0x137));var _0x8aa8=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xaa88[_0x149083];return _0x4dc74e;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4868c7,_0x3f9353){var _0x23cee4=function(_0x32c0fb){while(--_0x32c0fb){_0x4868c7['push'](_0x4868c7['shift']());}};_0x23cee4(++_0x3f9353);}(_0xaa88,0x137));var _0x8aa8=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0xaa88[_0x3efe87];return _0x56a4cc;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 8c0b753..a9a59a8 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 _0x7066=['util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','FaxTransferReport','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x222688,_0x46c5eb){var _0x437433=function(_0x29958c){while(--_0x29958c){_0x222688['push'](_0x222688['shift']());}};_0x437433(++_0x46c5eb);}(_0x7066,0x170));var _0x6706=function(_0x3b125a,_0x1f377e){_0x3b125a=_0x3b125a-0x0;var _0xe3ed89=_0x7066[_0x3b125a];return _0xe3ed89;};'use strict';var emlformat=require(_0x6706('0x0'));var rimraf=require(_0x6706('0x1'));var zipdir=require(_0x6706('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6706('0x3'));var moment=require(_0x6706('0x4'));var BPromise=require(_0x6706('0x5'));var Mustache=require(_0x6706('0x6'));var util=require(_0x6706('0x7'));var path=require(_0x6706('0x8'));var sox=require(_0x6706('0x9'));var csv=require('to-csv');var ejs=require(_0x6706('0xa'));var fs=require('fs');var fs_extra=require(_0x6706('0xb'));var _=require(_0x6706('0xc'));var squel=require('squel');var crypto=require(_0x6706('0xd'));var jsforce=require(_0x6706('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6706('0xf'));var Redis=require(_0x6706('0x10'));var authService=require(_0x6706('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6706('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6706('0x13'))(_0x6706('0x14'));var utils=require(_0x6706('0x15'));var config=require(_0x6706('0x16'));var licenseUtil=require(_0x6706('0x17'));var db=require(_0x6706('0x18'))['db'];function respondWithStatusCode(_0x17c450,_0xcbad97){_0xcbad97=_0xcbad97||0xcc;return function(_0x481e63){if(_0x481e63){return _0x17c450[_0x6706('0x19')](_0xcbad97);}return _0x17c450[_0x6706('0x1a')](_0xcbad97)['end']();};}function respondWithResult(_0x236eeb,_0x205bd6){_0x205bd6=_0x205bd6||0xc8;return function(_0x5bf303){if(_0x5bf303){return _0x236eeb[_0x6706('0x1a')](_0x205bd6)[_0x6706('0x1b')](_0x5bf303);}};}function respondWithFilteredResult(_0x2ef89f,_0x3dab62){return function(_0x5c3edd){if(_0x5c3edd){var _0x1eb42c=typeof _0x3dab62[_0x6706('0x1c')]===_0x6706('0x1d')&&typeof _0x3dab62[_0x6706('0x1e')]===_0x6706('0x1d');var _0x1eba89=_0x5c3edd['count'];var _0x30f6e5=_0x1eb42c?0x0:_0x3dab62['offset'];var _0x491b7c=_0x1eb42c?_0x5c3edd[_0x6706('0x1f')]:_0x3dab62['offset']+_0x3dab62[_0x6706('0x1e')];var _0x24c615;if(_0x491b7c>=_0x1eba89){_0x491b7c=_0x1eba89;_0x24c615=0xc8;}else{_0x24c615=0xce;}_0x2ef89f[_0x6706('0x1a')](_0x24c615);return _0x2ef89f[_0x6706('0x20')](_0x6706('0x21'),_0x30f6e5+'-'+_0x491b7c+'/'+_0x1eba89)[_0x6706('0x1b')](_0x5c3edd);}return null;};}function patchUpdates(_0x94ac04){return function(_0xc6b3b5){try{jsonpatch[_0x6706('0x22')](_0xc6b3b5,_0x94ac04,!![]);}catch(_0x3566eb){return BPromise[_0x6706('0x23')](_0x3566eb);}return _0xc6b3b5[_0x6706('0x24')]();};}function saveUpdates(_0x367974,_0x171b56){return function(_0x44fa4f){if(_0x44fa4f){return _0x44fa4f[_0x6706('0x25')](_0x367974)[_0x6706('0x26')](function(_0x3ce058){return _0x3ce058;});}return null;};}function removeEntity(_0x307911,_0x161bf8){return function(_0x54f420){if(_0x54f420){return _0x54f420[_0x6706('0x27')]()[_0x6706('0x26')](function(){_0x307911[_0x6706('0x1a')](0xcc)[_0x6706('0x28')]();});}};}function handleEntityNotFound(_0x21a673,_0x50a33d){return function(_0x90114f){if(!_0x90114f){_0x21a673['sendStatus'](0x194);}return _0x90114f;};}function handleError(_0x203cfa,_0x4e027d){_0x4e027d=_0x4e027d||0x1f4;return function(_0x5d99f3){logger[_0x6706('0x29')](_0x5d99f3[_0x6706('0x2a')]);if(_0x5d99f3[_0x6706('0x2b')]){delete _0x5d99f3[_0x6706('0x2b')];}_0x203cfa['status'](_0x4e027d)['send'](_0x5d99f3);};}exports[_0x6706('0x2c')]=function(_0x55f7f7,_0x3c702f){var _0x755e3f={},_0x30dfbd={},_0x111c74={'count':0x0,'rows':[]};var _0x3de7b2=_['map'](db[_0x6706('0x2d')][_0x6706('0x2e')],function(_0x375d56){return{'name':_0x375d56['fieldName'],'type':_0x375d56['type'][_0x6706('0x2f')]};});_0x30dfbd['model']=_['map'](_0x3de7b2,'name');_0x30dfbd[_0x6706('0x30')]=_[_0x6706('0x31')](_0x55f7f7[_0x6706('0x30')]);_0x30dfbd[_0x6706('0x32')]=_[_0x6706('0x33')](_0x30dfbd['model'],_0x30dfbd[_0x6706('0x30')]);_0x755e3f[_0x6706('0x34')]=_['intersection'](_0x30dfbd[_0x6706('0x35')],qs[_0x6706('0x36')](_0x55f7f7[_0x6706('0x30')][_0x6706('0x36')]));_0x755e3f[_0x6706('0x34')]=_0x755e3f[_0x6706('0x34')]['length']?_0x755e3f['attributes']:_0x30dfbd['model'];if(!_0x55f7f7[_0x6706('0x30')][_0x6706('0x37')](_0x6706('0x38'))){_0x755e3f[_0x6706('0x1e')]=qs[_0x6706('0x1e')](_0x55f7f7['query'][_0x6706('0x1e')]);_0x755e3f[_0x6706('0x1c')]=qs[_0x6706('0x1c')](_0x55f7f7[_0x6706('0x30')]['offset']);}_0x755e3f[_0x6706('0x39')]=qs['sort'](_0x55f7f7['query'][_0x6706('0x3a')]);_0x755e3f[_0x6706('0x3b')]=qs['filters'](_[_0x6706('0x3c')](_0x55f7f7['query'],_0x30dfbd[_0x6706('0x32')]),_0x3de7b2);if(_0x55f7f7[_0x6706('0x30')][_0x6706('0x3d')]){_0x755e3f[_0x6706('0x3b')]=_[_0x6706('0x3e')](_0x755e3f[_0x6706('0x3b')],{'$or':_[_0x6706('0x3f')](_0x3de7b2,function(_0x89968c){if(_0x89968c['type']!=='VIRTUAL'){var _0x1bf2d3={};_0x1bf2d3[_0x89968c[_0x6706('0x2b')]]={'$like':'%'+_0x55f7f7[_0x6706('0x30')]['filter']+'%'};return _0x1bf2d3;}})});}_0x755e3f=_[_0x6706('0x3e')]({},_0x755e3f,_0x55f7f7[_0x6706('0x40')]);var _0xc9e647={'where':_0x755e3f['where']};return db[_0x6706('0x2d')]['count'](_0xc9e647)[_0x6706('0x26')](function(_0xd13f98){_0x111c74[_0x6706('0x1f')]=_0xd13f98;if(_0x55f7f7['query']['includeAll']){_0x755e3f[_0x6706('0x41')]=[{'all':!![]}];}return db[_0x6706('0x2d')]['findAll'](_0x755e3f);})[_0x6706('0x26')](function(_0x18cffc){_0x111c74[_0x6706('0x42')]=_0x18cffc;return _0x111c74;})['then'](respondWithFilteredResult(_0x3c702f,_0x755e3f))[_0x6706('0x43')](handleError(_0x3c702f,null));};exports[_0x6706('0x44')]=function(_0x141671,_0x1f69d1){var _0xb3b957={'raw':!![],'where':{'id':_0x141671[_0x6706('0x45')]['id']}},_0x43e771={};_0x43e771[_0x6706('0x35')]=_[_0x6706('0x31')](db[_0x6706('0x2d')][_0x6706('0x2e')]);_0x43e771[_0x6706('0x30')]=_['keys'](_0x141671[_0x6706('0x30')]);_0x43e771['filters']=_[_0x6706('0x33')](_0x43e771[_0x6706('0x35')],_0x43e771[_0x6706('0x30')]);_0xb3b957[_0x6706('0x34')]=_[_0x6706('0x33')](_0x43e771[_0x6706('0x35')],qs[_0x6706('0x36')](_0x141671['query'][_0x6706('0x36')]));_0xb3b957['attributes']=_0xb3b957[_0x6706('0x34')]['length']?_0xb3b957[_0x6706('0x34')]:_0x43e771[_0x6706('0x35')];if(_0x141671[_0x6706('0x30')][_0x6706('0x46')]){_0xb3b957[_0x6706('0x41')]=[{'all':!![]}];}_0xb3b957=_[_0x6706('0x3e')]({},_0xb3b957,_0x141671['options']);return db['FaxTransferReport'][_0x6706('0x47')](_0xb3b957)[_0x6706('0x26')](handleEntityNotFound(_0x1f69d1,null))[_0x6706('0x26')](respondWithResult(_0x1f69d1,null))[_0x6706('0x43')](handleError(_0x1f69d1,null));};exports[_0x6706('0x48')]=function(_0x5d517d,_0x5d3b5a){return db[_0x6706('0x2d')][_0x6706('0x48')](_0x5d517d[_0x6706('0x49')],{})['then'](respondWithResult(_0x5d3b5a,0xc9))[_0x6706('0x43')](handleError(_0x5d3b5a,null));};exports[_0x6706('0x25')]=function(_0x4d1853,_0x466327){if(_0x4d1853[_0x6706('0x49')]['id']){delete _0x4d1853[_0x6706('0x49')]['id'];}return db[_0x6706('0x2d')][_0x6706('0x47')]({'where':{'id':_0x4d1853[_0x6706('0x45')]['id']}})[_0x6706('0x26')](handleEntityNotFound(_0x466327,null))[_0x6706('0x26')](saveUpdates(_0x4d1853[_0x6706('0x49')],null))['then'](respondWithResult(_0x466327,null))[_0x6706('0x43')](handleError(_0x466327,null));};exports[_0x6706('0x27')]=function(_0x4db739,_0x597bde){return db['FaxTransferReport'][_0x6706('0x47')]({'where':{'id':_0x4db739['params']['id']}})[_0x6706('0x26')](handleEntityNotFound(_0x597bde,null))[_0x6706('0x26')](removeEntity(_0x597bde,null))[_0x6706('0x43')](handleError(_0x597bde,null));};exports[_0x6706('0x4a')]=function(_0x3e9200,_0x18c111){return db[_0x6706('0x2d')][_0x6706('0x4a')]()['then'](respondWithResult(_0x18c111,null))[_0x6706('0x43')](handleError(_0x18c111,null));}; \ No newline at end of file +var _0xda26=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','then','include','findAll','rows','catch','show','includeAll','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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'];(function(_0x1e965f,_0x9f91ac){var _0x1d2307=function(_0x1ee006){while(--_0x1ee006){_0x1e965f['push'](_0x1e965f['shift']());}};_0x1d2307(++_0x9f91ac);}(_0xda26,0xdb));var _0x6da2=function(_0x4fd39f,_0x40cfe3){_0x4fd39f=_0x4fd39f-0x0;var _0x50d2eb=_0xda26[_0x4fd39f];return _0x50d2eb;};'use strict';var emlformat=require(_0x6da2('0x0'));var rimraf=require(_0x6da2('0x1'));var zipdir=require(_0x6da2('0x2'));var jsonpatch=require(_0x6da2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6da2('0x4'));var Mustache=require('mustache');var util=require(_0x6da2('0x5'));var path=require(_0x6da2('0x6'));var sox=require(_0x6da2('0x7'));var csv=require(_0x6da2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6da2('0x9'));var _=require(_0x6da2('0xa'));var squel=require(_0x6da2('0xb'));var crypto=require(_0x6da2('0xc'));var jsforce=require(_0x6da2('0xd'));var deskjs=require(_0x6da2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6da2('0xf'));var Papa=require(_0x6da2('0x10'));var Redis=require(_0x6da2('0x11'));var authService=require(_0x6da2('0x12'));var qs=require(_0x6da2('0x13'));var as=require(_0x6da2('0x14'));var hardwareService=require(_0x6da2('0x15'));var logger=require(_0x6da2('0x16'))(_0x6da2('0x17'));var utils=require(_0x6da2('0x18'));var config=require(_0x6da2('0x19'));var licenseUtil=require(_0x6da2('0x1a'));var db=require(_0x6da2('0x1b'))['db'];function respondWithStatusCode(_0x430bde,_0x38633c){_0x38633c=_0x38633c||0xcc;return function(_0x204e90){if(_0x204e90){return _0x430bde[_0x6da2('0x1c')](_0x38633c);}return _0x430bde[_0x6da2('0x1d')](_0x38633c)[_0x6da2('0x1e')]();};}function respondWithResult(_0x418868,_0x5d3cb8){_0x5d3cb8=_0x5d3cb8||0xc8;return function(_0x24a55a){if(_0x24a55a){return _0x418868[_0x6da2('0x1d')](_0x5d3cb8)[_0x6da2('0x1f')](_0x24a55a);}};}function respondWithFilteredResult(_0x22fc0f,_0x1ac0cf){return function(_0x2c777f){if(_0x2c777f){var _0x1e5434=typeof _0x1ac0cf[_0x6da2('0x20')]===_0x6da2('0x21')&&typeof _0x1ac0cf[_0x6da2('0x22')]===_0x6da2('0x21');var _0x5e999a=_0x2c777f['count'];var _0x32fee5=_0x1e5434?0x0:_0x1ac0cf['offset'];var _0x3ed34b=_0x1e5434?_0x2c777f['count']:_0x1ac0cf[_0x6da2('0x20')]+_0x1ac0cf[_0x6da2('0x22')];var _0x440e26;if(_0x3ed34b>=_0x5e999a){_0x3ed34b=_0x5e999a;_0x440e26=0xc8;}else{_0x440e26=0xce;}_0x22fc0f['status'](_0x440e26);return _0x22fc0f[_0x6da2('0x23')](_0x6da2('0x24'),_0x32fee5+'-'+_0x3ed34b+'/'+_0x5e999a)['json'](_0x2c777f);}return null;};}function patchUpdates(_0x22ab89){return function(_0x39819a){try{jsonpatch[_0x6da2('0x25')](_0x39819a,_0x22ab89,!![]);}catch(_0x168770){return BPromise[_0x6da2('0x26')](_0x168770);}return _0x39819a['save']();};}function saveUpdates(_0x313203,_0x4e05ee){return function(_0x1d7e59){if(_0x1d7e59){return _0x1d7e59[_0x6da2('0x27')](_0x313203)['then'](function(_0x1a484b){return _0x1a484b;});}return null;};}function removeEntity(_0x181680,_0x2716b4){return function(_0x3bc3eb){if(_0x3bc3eb){return _0x3bc3eb['destroy']()['then'](function(){_0x181680['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x186784,_0x5a0fa9){return function(_0x38847a){if(!_0x38847a){_0x186784[_0x6da2('0x1c')](0x194);}return _0x38847a;};}function handleError(_0x1b323a,_0x5eae77){_0x5eae77=_0x5eae77||0x1f4;return function(_0x171832){logger[_0x6da2('0x28')](_0x171832['stack']);if(_0x171832[_0x6da2('0x29')]){delete _0x171832[_0x6da2('0x29')];}_0x1b323a[_0x6da2('0x1d')](_0x5eae77)['send'](_0x171832);};}exports[_0x6da2('0x2a')]=function(_0x5d789e,_0x12fe05){var _0x5a2cbf={},_0x474b53={},_0x4e6c79={'count':0x0,'rows':[]};var _0x3a0926=_[_0x6da2('0x2b')](db[_0x6da2('0x2c')][_0x6da2('0x2d')],function(_0x4e816b){return{'name':_0x4e816b[_0x6da2('0x2e')],'type':_0x4e816b[_0x6da2('0x2f')][_0x6da2('0x30')]};});_0x474b53[_0x6da2('0x31')]=_['map'](_0x3a0926,_0x6da2('0x29'));_0x474b53['query']=_[_0x6da2('0x32')](_0x5d789e[_0x6da2('0x33')]);_0x474b53['filters']=_[_0x6da2('0x34')](_0x474b53[_0x6da2('0x31')],_0x474b53[_0x6da2('0x33')]);_0x5a2cbf['attributes']=_[_0x6da2('0x34')](_0x474b53['model'],qs[_0x6da2('0x35')](_0x5d789e[_0x6da2('0x33')][_0x6da2('0x35')]));_0x5a2cbf[_0x6da2('0x36')]=_0x5a2cbf[_0x6da2('0x36')][_0x6da2('0x37')]?_0x5a2cbf['attributes']:_0x474b53[_0x6da2('0x31')];if(!_0x5d789e['query'][_0x6da2('0x38')](_0x6da2('0x39'))){_0x5a2cbf[_0x6da2('0x22')]=qs[_0x6da2('0x22')](_0x5d789e['query'][_0x6da2('0x22')]);_0x5a2cbf[_0x6da2('0x20')]=qs[_0x6da2('0x20')](_0x5d789e['query'][_0x6da2('0x20')]);}_0x5a2cbf['order']=qs[_0x6da2('0x3a')](_0x5d789e[_0x6da2('0x33')][_0x6da2('0x3a')]);_0x5a2cbf[_0x6da2('0x3b')]=qs[_0x6da2('0x3c')](_[_0x6da2('0x3d')](_0x5d789e[_0x6da2('0x33')],_0x474b53[_0x6da2('0x3c')]),_0x3a0926);if(_0x5d789e[_0x6da2('0x33')][_0x6da2('0x3e')]){_0x5a2cbf[_0x6da2('0x3b')]=_[_0x6da2('0x3f')](_0x5a2cbf[_0x6da2('0x3b')],{'$or':_[_0x6da2('0x2b')](_0x3a0926,function(_0x260ff3){if(_0x260ff3[_0x6da2('0x2f')]!==_0x6da2('0x40')){var _0x4a809d={};_0x4a809d[_0x260ff3['name']]={'$like':'%'+_0x5d789e[_0x6da2('0x33')]['filter']+'%'};return _0x4a809d;}})});}_0x5a2cbf=_['merge']({},_0x5a2cbf,_0x5d789e[_0x6da2('0x41')]);var _0x25bc2f={'where':_0x5a2cbf[_0x6da2('0x3b')]};return db[_0x6da2('0x2c')][_0x6da2('0x42')](_0x25bc2f)[_0x6da2('0x43')](function(_0x5d4891){_0x4e6c79[_0x6da2('0x42')]=_0x5d4891;if(_0x5d789e[_0x6da2('0x33')]['includeAll']){_0x5a2cbf[_0x6da2('0x44')]=[{'all':!![]}];}return db[_0x6da2('0x2c')][_0x6da2('0x45')](_0x5a2cbf);})['then'](function(_0x36f2e8){_0x4e6c79[_0x6da2('0x46')]=_0x36f2e8;return _0x4e6c79;})['then'](respondWithFilteredResult(_0x12fe05,_0x5a2cbf))[_0x6da2('0x47')](handleError(_0x12fe05,null));};exports[_0x6da2('0x48')]=function(_0x392b81,_0x1639c3){var _0x24a785={'raw':!![],'where':{'id':_0x392b81['params']['id']}},_0x211c0b={};_0x211c0b[_0x6da2('0x31')]=_[_0x6da2('0x32')](db[_0x6da2('0x2c')][_0x6da2('0x2d')]);_0x211c0b[_0x6da2('0x33')]=_[_0x6da2('0x32')](_0x392b81[_0x6da2('0x33')]);_0x211c0b['filters']=_['intersection'](_0x211c0b[_0x6da2('0x31')],_0x211c0b[_0x6da2('0x33')]);_0x24a785['attributes']=_[_0x6da2('0x34')](_0x211c0b[_0x6da2('0x31')],qs[_0x6da2('0x35')](_0x392b81[_0x6da2('0x33')][_0x6da2('0x35')]));_0x24a785[_0x6da2('0x36')]=_0x24a785['attributes'][_0x6da2('0x37')]?_0x24a785[_0x6da2('0x36')]:_0x211c0b['model'];if(_0x392b81[_0x6da2('0x33')][_0x6da2('0x49')]){_0x24a785[_0x6da2('0x44')]=[{'all':!![]}];}_0x24a785=_[_0x6da2('0x3f')]({},_0x24a785,_0x392b81[_0x6da2('0x41')]);return db[_0x6da2('0x2c')]['find'](_0x24a785)['then'](handleEntityNotFound(_0x1639c3,null))[_0x6da2('0x43')](respondWithResult(_0x1639c3,null))[_0x6da2('0x47')](handleError(_0x1639c3,null));};exports[_0x6da2('0x4a')]=function(_0x25289a,_0x4fef5e){return db[_0x6da2('0x2c')]['create'](_0x25289a['body'],{})[_0x6da2('0x43')](respondWithResult(_0x4fef5e,0xc9))[_0x6da2('0x47')](handleError(_0x4fef5e,null));};exports[_0x6da2('0x27')]=function(_0x2151f5,_0x56d0ea){if(_0x2151f5[_0x6da2('0x4b')]['id']){delete _0x2151f5[_0x6da2('0x4b')]['id'];}return db[_0x6da2('0x2c')][_0x6da2('0x4c')]({'where':{'id':_0x2151f5[_0x6da2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56d0ea,null))[_0x6da2('0x43')](saveUpdates(_0x2151f5[_0x6da2('0x4b')],null))[_0x6da2('0x43')](respondWithResult(_0x56d0ea,null))[_0x6da2('0x47')](handleError(_0x56d0ea,null));};exports[_0x6da2('0x4e')]=function(_0x2b4cb0,_0x488854){return db[_0x6da2('0x2c')][_0x6da2('0x4c')]({'where':{'id':_0x2b4cb0[_0x6da2('0x4d')]['id']}})[_0x6da2('0x43')](handleEntityNotFound(_0x488854,null))[_0x6da2('0x43')](removeEntity(_0x488854,null))['catch'](handleError(_0x488854,null));};exports[_0x6da2('0x4f')]=function(_0x541bd9,_0x3de42d){return db[_0x6da2('0x2c')]['describe']()[_0x6da2('0x43')](respondWithResult(_0x3de42d,null))[_0x6da2('0x47')](handleError(_0x3de42d,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b5aa758..7df9c6e 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 _0xaf69=['define','FaxTransferReport','report_fax_transfer','uniqueid','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x44cd52,_0x32d3fa){var _0x524413=function(_0x4d2875){while(--_0x4d2875){_0x44cd52['push'](_0x44cd52['shift']());}};_0x524413(++_0x32d3fa);}(_0xaf69,0x13c));var _0x9af6=function(_0x274208,_0x3182ff){_0x274208=_0x274208-0x0;var _0x209164=_0xaf69[_0x274208];return _0x209164;};'use strict';var _=require('lodash');var util=require(_0x9af6('0x0'));var logger=require('../../config/logger')(_0x9af6('0x1'));var moment=require(_0x9af6('0x2'));var BPromise=require('bluebird');var rp=require(_0x9af6('0x3'));var fs=require('fs');var path=require(_0x9af6('0x4'));var rimraf=require(_0x9af6('0x5'));var config=require(_0x9af6('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x9af6('0x7')]=function(_0x5982ed,_0xf7ef2d){return _0x5982ed[_0x9af6('0x8')](_0x9af6('0x9'),attributes,{'tableName':_0x9af6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9af6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e25=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x5888a7,_0x266681){var _0x2631da=function(_0x547c3d){while(--_0x547c3d){_0x5888a7['push'](_0x5888a7['shift']());}};_0x2631da(++_0x266681);}(_0x4e25,0x175));var _0x54e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e25[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x54e2('0x0'));var logger=require(_0x54e2('0x1'))('api');var moment=require(_0x54e2('0x2'));var BPromise=require(_0x54e2('0x3'));var rp=require(_0x54e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54e2('0x5'));var config=require(_0x54e2('0x6'));var attributes=require(_0x54e2('0x7'));module[_0x54e2('0x8')]=function(_0x3d4c01,_0x698986){return _0x3d4c01[_0x54e2('0x9')](_0x54e2('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x54e2('0xb'),'fields':[_0x54e2('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 6dfe48c..ce6d478 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 _0x5fb7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x2b2ac9,_0x50839d){var _0x5a0d21=function(_0x14cd50){while(--_0x14cd50){_0x2b2ac9['push'](_0x2b2ac9['shift']());}};_0x5a0d21(++_0x50839d);}(_0x5fb7,0xef));var _0x75fb=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x5fb7[_0x264b9b];return _0x4c7a0e;};'use strict';var _=require(_0x75fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x75fb('0x1'));var rs=require(_0x75fb('0x2'));var fs=require('fs');var Redis=require(_0x75fb('0x3'));var db=require(_0x75fb('0x4'))['db'];var utils=require(_0x75fb('0x5'));var logger=require(_0x75fb('0x6'))(_0x75fb('0x7'));var config=require(_0x75fb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x75fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e5079,_0x62774b,_0x317c23){return new BPromise(function(_0x488086,_0x3a7180){return client[_0x75fb('0xa')](_0x4e5079,_0x317c23)[_0x75fb('0xb')](function(_0x2587e2){logger[_0x75fb('0xc')](_0x75fb('0xd'),_0x62774b,'request\x20sent');logger[_0x75fb('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x62774b,_0x75fb('0xf'),JSON[_0x75fb('0x10')](_0x2587e2));if(_0x2587e2['error']){if(_0x2587e2[_0x75fb('0x11')][_0x75fb('0x12')]===0x1f4){logger[_0x75fb('0x11')](_0x75fb('0xd'),_0x62774b,_0x2587e2[_0x75fb('0x11')][_0x75fb('0x13')]);return _0x3a7180(_0x2587e2[_0x75fb('0x11')]['message']);}logger['error'](_0x75fb('0xd'),_0x62774b,_0x2587e2['error'][_0x75fb('0x13')]);return _0x488086(_0x2587e2[_0x75fb('0x11')][_0x75fb('0x13')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x62774b,_0x75fb('0xf'));_0x488086(_0x2587e2[_0x75fb('0x14')][_0x75fb('0x13')]);}})[_0x75fb('0x15')](function(_0xc5922c){logger[_0x75fb('0x11')](_0x75fb('0xd'),_0x62774b,_0xc5922c);_0x3a7180(_0xc5922c);});});} \ No newline at end of file +var _0x4919=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x246b34,_0x154442){var _0x2c4201=function(_0x35bc85){while(--_0x35bc85){_0x246b34['push'](_0x246b34['shift']());}};_0x2c4201(++_0x154442);}(_0x4919,0x127));var _0x9491=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x4919[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x9491('0x0'));var util=require(_0x9491('0x1'));var moment=require(_0x9491('0x2'));var BPromise=require(_0x9491('0x3'));var rs=require(_0x9491('0x4'));var fs=require('fs');var Redis=require(_0x9491('0x5'));var db=require(_0x9491('0x6'))['db'];var utils=require(_0x9491('0x7'));var logger=require(_0x9491('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc955b,_0x35e3e9,_0x1c9e52){return new BPromise(function(_0x306282,_0x2de4c4){return client[_0x9491('0x9')](_0xc955b,_0x1c9e52)[_0x9491('0xa')](function(_0x54173a){logger['info'](_0x9491('0xb'),_0x35e3e9,_0x9491('0xc'));logger[_0x9491('0xd')](_0x9491('0xe'),_0x35e3e9,_0x9491('0xc'),JSON[_0x9491('0xf')](_0x54173a));if(_0x54173a[_0x9491('0x10')]){if(_0x54173a['error'][_0x9491('0x11')]===0x1f4){logger[_0x9491('0x10')](_0x9491('0xb'),_0x35e3e9,_0x54173a[_0x9491('0x10')][_0x9491('0x12')]);return _0x2de4c4(_0x54173a['error'][_0x9491('0x12')]);}logger['error'](_0x9491('0xb'),_0x35e3e9,_0x54173a['error']['message']);return _0x306282(_0x54173a[_0x9491('0x10')][_0x9491('0x12')]);}else{logger[_0x9491('0x13')](_0x9491('0xb'),_0x35e3e9,_0x9491('0xc'));_0x306282(_0x54173a[_0x9491('0x14')][_0x9491('0x12')]);}})[_0x9491('0x15')](function(_0x434a82){logger['error'](_0x9491('0xb'),_0x35e3e9,_0x434a82);_0x2de4c4(_0x434a82);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7e3f856..8569c74 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 _0xe4ef=['isAuthenticated','describe','/:id','show','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4ef,0x1e8));var _0xfe4e=function(_0x33bebe,_0x2a92a8){_0x33bebe=_0x33bebe-0x0;var _0x25ac74=_0xe4ef[_0x33bebe];return _0x25ac74;};'use strict';var multer=require('multer');var util=require(_0xfe4e('0x0'));var path=require(_0xfe4e('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe4e('0x2'));var router=express['Router']();var fs_extra=require(_0xfe4e('0x3'));var auth=require(_0xfe4e('0x4'));var interaction=require(_0xfe4e('0x5'));var config=require(_0xfe4e('0x6'));var controller=require('./faxTransferReport.controller');router[_0xfe4e('0x7')]('/',auth[_0xfe4e('0x8')](),controller['index']);router[_0xfe4e('0x7')]('/describe',auth[_0xfe4e('0x8')](),controller[_0xfe4e('0x9')]);router[_0xfe4e('0x7')](_0xfe4e('0xa'),auth[_0xfe4e('0x8')](),controller[_0xfe4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfe4e('0xc')](_0xfe4e('0xa'),auth[_0xfe4e('0x8')](),controller[_0xfe4e('0xd')]);router['delete'](_0xfe4e('0xa'),auth['isAuthenticated'](),controller[_0xfe4e('0xe')]);module[_0xfe4e('0xf')]=router; \ No newline at end of file +var _0x7b22=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x4f6458,_0x3ea4bb){var _0x40c255=function(_0x157e9a){while(--_0x157e9a){_0x4f6458['push'](_0x4f6458['shift']());}};_0x40c255(++_0x3ea4bb);}(_0x7b22,0x15a));var _0x27b2=function(_0x2c10fb,_0x380e1b){_0x2c10fb=_0x2c10fb-0x0;var _0x23e4c0=_0x7b22[_0x2c10fb];return _0x23e4c0;};'use strict';var multer=require(_0x27b2('0x0'));var util=require(_0x27b2('0x1'));var path=require(_0x27b2('0x2'));var timeout=require(_0x27b2('0x3'));var express=require(_0x27b2('0x4'));var router=express[_0x27b2('0x5')]();var fs_extra=require(_0x27b2('0x6'));var auth=require(_0x27b2('0x7'));var interaction=require(_0x27b2('0x8'));var config=require(_0x27b2('0x9'));var controller=require(_0x27b2('0xa'));router[_0x27b2('0xb')]('/',auth['isAuthenticated'](),controller[_0x27b2('0xc')]);router[_0x27b2('0xb')](_0x27b2('0xd'),auth[_0x27b2('0xe')](),controller['describe']);router[_0x27b2('0xb')](_0x27b2('0xf'),auth[_0x27b2('0xe')](),controller[_0x27b2('0x10')]);router[_0x27b2('0x11')]('/',auth[_0x27b2('0xe')](),controller['create']);router[_0x27b2('0x12')]('/:id',auth[_0x27b2('0xe')](),controller[_0x27b2('0x13')]);router[_0x27b2('0x14')]('/:id',auth[_0x27b2('0xe')](),controller[_0x27b2('0x15')]);module[_0x27b2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 49ed39f..85e0417 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 _0xc053=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete'];(function(_0x18211c,_0x5da85f){var _0x519e10=function(_0x832252){while(--_0x832252){_0x18211c['push'](_0x18211c['shift']());}};_0x519e10(++_0x5da85f);}(_0xc053,0xdd));var _0x3c05=function(_0xf1da90,_0x17a4f0){_0xf1da90=_0xf1da90-0x0;var _0x24fae3=_0xc053[_0xf1da90];return _0x24fae3;};'use strict';var multer=require(_0x3c05('0x0'));var util=require(_0x3c05('0x1'));var path=require(_0x3c05('0x2'));var timeout=require(_0x3c05('0x3'));var express=require(_0x3c05('0x4'));var router=express[_0x3c05('0x5')]();var fs_extra=require(_0x3c05('0x6'));var auth=require(_0x3c05('0x7'));var interaction=require(_0x3c05('0x8'));var config=require(_0x3c05('0x9'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x3c05('0xa')](),controller['index']);router[_0x3c05('0xb')](_0x3c05('0xc'),auth[_0x3c05('0xa')](),controller[_0x3c05('0xd')]);router[_0x3c05('0xb')](_0x3c05('0xe'),auth[_0x3c05('0xa')](),controller[_0x3c05('0xf')]);router[_0x3c05('0xb')]('/:id/fields',auth[_0x3c05('0xa')](),controller[_0x3c05('0x10')]);router[_0x3c05('0x11')]('/',auth[_0x3c05('0xa')](),controller['create']);router[_0x3c05('0x11')](_0x3c05('0xe'),auth[_0x3c05('0xa')](),controller[_0x3c05('0x12')]);router[_0x3c05('0x13')]('/:id',auth[_0x3c05('0xa')](),controller['update']);router[_0x3c05('0x14')](_0x3c05('0xc'),auth[_0x3c05('0xa')](),controller[_0x3c05('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb571=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id'];(function(_0x56679a,_0x1a6841){var _0x2844f0=function(_0x16bf1a){while(--_0x16bf1a){_0x56679a['push'](_0x56679a['shift']());}};_0x2844f0(++_0x1a6841);}(_0xb571,0x140));var _0x1b57=function(_0x32d93b,_0x477fc3){_0x32d93b=_0x32d93b-0x0;var _0xe23ee1=_0xb571[_0x32d93b];return _0xe23ee1;};'use strict';var multer=require(_0x1b57('0x0'));var util=require(_0x1b57('0x1'));var path=require(_0x1b57('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b57('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b57('0x4'));var config=require(_0x1b57('0x5'));var controller=require(_0x1b57('0x6'));router[_0x1b57('0x7')]('/',auth[_0x1b57('0x8')](),controller['index']);router['get'](_0x1b57('0x9'),auth[_0x1b57('0x8')](),controller[_0x1b57('0xa')]);router[_0x1b57('0x7')]('/:id/configurations',auth[_0x1b57('0x8')](),controller[_0x1b57('0xb')]);router['get'](_0x1b57('0xc'),auth['isAuthenticated'](),controller[_0x1b57('0xd')]);router[_0x1b57('0xe')]('/',auth[_0x1b57('0x8')](),controller[_0x1b57('0xf')]);router[_0x1b57('0xe')](_0x1b57('0x10'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x11')]);router[_0x1b57('0x12')]('/:id',auth[_0x1b57('0x8')](),controller[_0x1b57('0x13')]);router[_0x1b57('0x14')](_0x1b57('0x9'),auth[_0x1b57('0x8')](),controller[_0x1b57('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 014276a..33140cd 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 _0xae4d=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x328ced,_0x9ed0af){var _0x26118e=function(_0x8e2660){while(--_0x8e2660){_0x328ced['push'](_0x328ced['shift']());}};_0x26118e(++_0x9ed0af);}(_0xae4d,0xd5));var _0xdae4=function(_0x1099fc,_0x502e42){_0x1099fc=_0x1099fc-0x0;var _0x26c101=_0xae4d[_0x1099fc];return _0x26c101;};'use strict';var Sequelize=require(_0xdae4('0x0'));module[_0xdae4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdae4('0x2')]},'remoteUri':{'type':Sequelize[_0xdae4('0x2')]},'authType':{'type':Sequelize[_0xdae4('0x3')](_0xdae4('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xdae4('0x2')]},'consumerKey':{'type':Sequelize[_0xdae4('0x2')]},'consumerSecret':{'type':Sequelize[_0xdae4('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdae4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdae4('0x3')](_0xdae4('0x5'),_0xdae4('0x6')),'defaultValue':_0xdae4('0x5')}}; \ No newline at end of file +var _0x6039=['integrationTab','newTab','STRING','basic','ENUM'];(function(_0x1b38f3,_0x33b756){var _0x52a1f2=function(_0xd0742a){while(--_0xd0742a){_0x1b38f3['push'](_0x1b38f3['shift']());}};_0x52a1f2(++_0x33b756);}(_0x6039,0x1b0));var _0x9603=function(_0x404d4b,_0x3a8060){_0x404d4b=_0x404d4b-0x0;var _0x3ee787=_0x6039[_0x404d4b];return _0x3ee787;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9603('0x0')]},'description':{'type':Sequelize[_0x9603('0x0')]},'username':{'type':Sequelize[_0x9603('0x0')]},'remoteUri':{'type':Sequelize[_0x9603('0x0')]},'authType':{'type':Sequelize['ENUM'](_0x9603('0x1')),'defaultValue':_0x9603('0x1')},'password':{'type':Sequelize[_0x9603('0x0')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x9603('0x0')]},'token':{'type':Sequelize[_0x9603('0x0')]},'tokenSecret':{'type':Sequelize[_0x9603('0x0')]},'serverUrl':{'type':Sequelize[_0x9603('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x9603('0x2')](_0x9603('0x3'),_0x9603('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index dced825..1fda870 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 _0x3819=['index','DeskAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','rows','catch','params','rawAttributes','includeAll','include','find','create','body','findOne','DeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','label','test','statusCode','stringify','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x4acf20,_0x3f4636){var _0x50eabc=function(_0x20c518){while(--_0x20c518){_0x4acf20['push'](_0x4acf20['shift']());}};_0x50eabc(++_0x3f4636);}(_0x3819,0x11f));var _0x9381=function(_0xc468e3,_0x58c625){_0xc468e3=_0xc468e3-0x0;var _0x49e1ba=_0x3819[_0xc468e3];return _0x49e1ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9381('0x0'));var rp=require(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var Mustache=require(_0x9381('0x4'));var util=require(_0x9381('0x5'));var path=require(_0x9381('0x6'));var sox=require('sox');var csv=require(_0x9381('0x7'));var ejs=require(_0x9381('0x8'));var fs=require('fs');var fs_extra=require(_0x9381('0x9'));var _=require('lodash');var squel=require(_0x9381('0xa'));var crypto=require(_0x9381('0xb'));var jsforce=require(_0x9381('0xc'));var deskjs=require(_0x9381('0xd'));var toCsv=require(_0x9381('0x7'));var querystring=require('querystring');var Papa=require(_0x9381('0xe'));var Redis=require(_0x9381('0xf'));var authService=require(_0x9381('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9381('0x11'));var hardwareService=require(_0x9381('0x12'));var logger=require('../../config/logger')(_0x9381('0x13'));var utils=require(_0x9381('0x14'));var config=require(_0x9381('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x9381('0x16'));function respondWithStatusCode(_0x2834ef,_0x14010a){_0x14010a=_0x14010a||0xcc;return function(_0x205076){if(_0x205076){return _0x2834ef[_0x9381('0x17')](_0x14010a);}return _0x2834ef['status'](_0x14010a)[_0x9381('0x18')]();};}function respondWithResult(_0x53b1ec,_0x4379c6){_0x4379c6=_0x4379c6||0xc8;return function(_0x3c62a6){if(_0x3c62a6){return _0x53b1ec[_0x9381('0x19')](_0x4379c6)['json'](_0x3c62a6);}};}function respondWithFilteredResult(_0x1fc041,_0x359dee){return function(_0x31aa03){if(_0x31aa03){var _0x20744f=typeof _0x359dee[_0x9381('0x1a')]===_0x9381('0x1b')&&typeof _0x359dee[_0x9381('0x1c')]===_0x9381('0x1b');var _0x24b1df=_0x31aa03['count'];var _0x5f2c88=_0x20744f?0x0:_0x359dee[_0x9381('0x1a')];var _0x2d2b8e=_0x20744f?_0x31aa03[_0x9381('0x1d')]:_0x359dee[_0x9381('0x1a')]+_0x359dee[_0x9381('0x1c')];var _0x1e65fa;if(_0x2d2b8e>=_0x24b1df){_0x2d2b8e=_0x24b1df;_0x1e65fa=0xc8;}else{_0x1e65fa=0xce;}_0x1fc041[_0x9381('0x19')](_0x1e65fa);return _0x1fc041[_0x9381('0x1e')](_0x9381('0x1f'),_0x5f2c88+'-'+_0x2d2b8e+'/'+_0x24b1df)['json'](_0x31aa03);}return null;};}function patchUpdates(_0x21c778){return function(_0x470ba3){try{jsonpatch[_0x9381('0x20')](_0x470ba3,_0x21c778,!![]);}catch(_0x366d78){return BPromise[_0x9381('0x21')](_0x366d78);}return _0x470ba3[_0x9381('0x22')]();};}function saveUpdates(_0xa50f3,_0xb48e5a){return function(_0x24075c){if(_0x24075c){return _0x24075c[_0x9381('0x23')](_0xa50f3)[_0x9381('0x24')](function(_0x5aeb5f){return _0x5aeb5f;});}return null;};}function removeEntity(_0x2005d1,_0x1f45b9){return function(_0x3ea331){if(_0x3ea331){return _0x3ea331['destroy']()[_0x9381('0x24')](function(){_0x2005d1[_0x9381('0x19')](0xcc)[_0x9381('0x18')]();});}};}function handleEntityNotFound(_0x29cdb5,_0x1e255f){return function(_0x2b97cb){if(!_0x2b97cb){_0x29cdb5[_0x9381('0x17')](0x194);}return _0x2b97cb;};}function handleError(_0x320107,_0x2af082){_0x2af082=_0x2af082||0x1f4;return function(_0x58a21f){logger[_0x9381('0x25')](_0x58a21f['stack']);if(_0x58a21f[_0x9381('0x26')]){delete _0x58a21f[_0x9381('0x26')];}_0x320107['status'](_0x2af082)[_0x9381('0x27')](_0x58a21f);};}exports[_0x9381('0x28')]=function(_0x2c205d,_0x523917){var _0x5bdd91={},_0x2d65ce={},_0xc1a522={'count':0x0,'rows':[]};var _0x64a162=_['map'](db[_0x9381('0x29')]['rawAttributes'],function(_0x7addf3){return{'name':_0x7addf3[_0x9381('0x2a')],'type':_0x7addf3['type'][_0x9381('0x2b')]};});_0x2d65ce[_0x9381('0x2c')]=_[_0x9381('0x2d')](_0x64a162,_0x9381('0x26'));_0x2d65ce[_0x9381('0x2e')]=_[_0x9381('0x2f')](_0x2c205d[_0x9381('0x2e')]);_0x2d65ce[_0x9381('0x30')]=_[_0x9381('0x31')](_0x2d65ce[_0x9381('0x2c')],_0x2d65ce[_0x9381('0x2e')]);_0x5bdd91[_0x9381('0x32')]=_[_0x9381('0x31')](_0x2d65ce[_0x9381('0x2c')],qs[_0x9381('0x33')](_0x2c205d[_0x9381('0x2e')][_0x9381('0x33')]));_0x5bdd91['attributes']=_0x5bdd91[_0x9381('0x32')][_0x9381('0x34')]?_0x5bdd91['attributes']:_0x2d65ce[_0x9381('0x2c')];if(!_0x2c205d['query'][_0x9381('0x35')](_0x9381('0x36'))){_0x5bdd91['limit']=qs[_0x9381('0x1c')](_0x2c205d[_0x9381('0x2e')][_0x9381('0x1c')]);_0x5bdd91[_0x9381('0x1a')]=qs[_0x9381('0x1a')](_0x2c205d[_0x9381('0x2e')][_0x9381('0x1a')]);}_0x5bdd91[_0x9381('0x37')]=qs[_0x9381('0x38')](_0x2c205d[_0x9381('0x2e')][_0x9381('0x38')]);_0x5bdd91[_0x9381('0x39')]=qs['filters'](_['pick'](_0x2c205d[_0x9381('0x2e')],_0x2d65ce[_0x9381('0x30')]),_0x64a162);if(_0x2c205d[_0x9381('0x2e')][_0x9381('0x3a')]){_0x5bdd91['where']=_[_0x9381('0x3b')](_0x5bdd91[_0x9381('0x39')],{'$or':_[_0x9381('0x2d')](_0x64a162,function(_0x5bda75){if(_0x5bda75[_0x9381('0x3c')]!==_0x9381('0x3d')){var _0x2682dd={};_0x2682dd[_0x5bda75[_0x9381('0x26')]]={'$like':'%'+_0x2c205d['query'][_0x9381('0x3a')]+'%'};return _0x2682dd;}})});}_0x5bdd91=_[_0x9381('0x3b')]({},_0x5bdd91,_0x2c205d[_0x9381('0x3e')]);var _0x55c11d={'where':_0x5bdd91['where']};return db[_0x9381('0x29')][_0x9381('0x1d')](_0x55c11d)['then'](function(_0x81da62){_0xc1a522[_0x9381('0x1d')]=_0x81da62;if(_0x2c205d[_0x9381('0x2e')]['includeAll']){_0x5bdd91['include']=[{'all':!![]}];}return db[_0x9381('0x29')]['findAll'](_0x5bdd91);})[_0x9381('0x24')](function(_0x44eb87){_0xc1a522[_0x9381('0x3f')]=_0x44eb87;return _0xc1a522;})[_0x9381('0x24')](respondWithFilteredResult(_0x523917,_0x5bdd91))[_0x9381('0x40')](handleError(_0x523917,null));};exports['show']=function(_0x2aa3fc,_0x15f442){var _0x10ece6={'raw':![],'where':{'id':_0x2aa3fc[_0x9381('0x41')]['id']}},_0x14fe75={};_0x14fe75[_0x9381('0x2c')]=_[_0x9381('0x2f')](db[_0x9381('0x29')][_0x9381('0x42')]);_0x14fe75[_0x9381('0x2e')]=_[_0x9381('0x2f')](_0x2aa3fc[_0x9381('0x2e')]);_0x14fe75[_0x9381('0x30')]=_['intersection'](_0x14fe75['model'],_0x14fe75[_0x9381('0x2e')]);_0x10ece6[_0x9381('0x32')]=_['intersection'](_0x14fe75['model'],qs['fields'](_0x2aa3fc[_0x9381('0x2e')]['fields']));_0x10ece6[_0x9381('0x32')]=_0x10ece6[_0x9381('0x32')]['length']?_0x10ece6[_0x9381('0x32')]:_0x14fe75[_0x9381('0x2c')];if(_0x2aa3fc[_0x9381('0x2e')][_0x9381('0x43')]){_0x10ece6[_0x9381('0x44')]=[{'all':!![]}];}_0x10ece6=_['merge']({},_0x10ece6,_0x2aa3fc[_0x9381('0x3e')]);return db['DeskAccount'][_0x9381('0x45')](_0x10ece6)[_0x9381('0x24')](handleEntityNotFound(_0x15f442,null))[_0x9381('0x24')](respondWithResult(_0x15f442,null))[_0x9381('0x40')](handleError(_0x15f442,null));};exports[_0x9381('0x46')]=function(_0x1c5fa1,_0x55c098){return db[_0x9381('0x29')][_0x9381('0x46')](_0x1c5fa1[_0x9381('0x47')],{})['then'](respondWithResult(_0x55c098,0xc9))[_0x9381('0x40')](handleError(_0x55c098,null));};exports['update']=function(_0x4cff3a,_0x2ca3c1){if(_0x4cff3a['body']['id']){delete _0x4cff3a[_0x9381('0x47')]['id'];}return db[_0x9381('0x29')][_0x9381('0x45')]({'where':{'id':_0x4cff3a['params']['id']}})[_0x9381('0x24')](handleEntityNotFound(_0x2ca3c1,null))[_0x9381('0x24')](saveUpdates(_0x4cff3a[_0x9381('0x47')],null))[_0x9381('0x24')](respondWithResult(_0x2ca3c1,null))['catch'](handleError(_0x2ca3c1,null));};exports['destroy']=function(_0x20fb5d,_0x53d8a6){return db[_0x9381('0x29')][_0x9381('0x45')]({'where':{'id':_0x20fb5d['params']['id']}})['then'](handleEntityNotFound(_0x53d8a6,null))[_0x9381('0x24')](removeEntity(_0x53d8a6,null))[_0x9381('0x40')](handleError(_0x53d8a6,null));};exports['getConfigurations']=function(_0x35657c,_0x217434,_0xc348a2){var _0x5b6b06={};var _0x2f9e70={};var _0x1d6f5c;var _0x319330;return db['DeskAccount'][_0x9381('0x48')]({'where':{'id':_0x35657c[_0x9381('0x41')]['id']}})[_0x9381('0x24')](handleEntityNotFound(_0x217434,null))[_0x9381('0x24')](function(_0x3d124f){if(_0x3d124f){_0x1d6f5c=_0x3d124f;_0x2f9e70[_0x9381('0x2c')]=_['keys'](db[_0x9381('0x49')][_0x9381('0x42')]);_0x2f9e70[_0x9381('0x2e')]=_['keys'](_0x35657c[_0x9381('0x2e')]);_0x2f9e70['filters']=_[_0x9381('0x31')](_0x2f9e70[_0x9381('0x2c')],_0x2f9e70[_0x9381('0x2e')]);_0x5b6b06[_0x9381('0x32')]=_[_0x9381('0x31')](_0x2f9e70[_0x9381('0x2c')],qs[_0x9381('0x33')](_0x35657c['query'][_0x9381('0x33')]));_0x5b6b06[_0x9381('0x32')]=_0x5b6b06[_0x9381('0x32')][_0x9381('0x34')]?_0x5b6b06[_0x9381('0x32')]:_0x2f9e70[_0x9381('0x2c')];_0x5b6b06['order']=qs[_0x9381('0x38')](_0x35657c[_0x9381('0x2e')][_0x9381('0x38')]);_0x5b6b06['where']=qs[_0x9381('0x30')](_[_0x9381('0x4a')](_0x35657c[_0x9381('0x2e')],_0x2f9e70[_0x9381('0x30')]));if(_0x35657c[_0x9381('0x2e')][_0x9381('0x3a')]){_0x5b6b06[_0x9381('0x39')]=_[_0x9381('0x3b')](_0x5b6b06[_0x9381('0x39')],{'$or':_[_0x9381('0x2d')](_0x5b6b06[_0x9381('0x32')],function(_0x264e0e){var _0x59ed66={};_0x59ed66[_0x264e0e]={'$like':'%'+_0x35657c['query']['filter']+'%'};return _0x59ed66;})});}_0x5b6b06=_[_0x9381('0x3b')]({},_0x5b6b06,_0x35657c['options']);return _0x1d6f5c['getConfigurations'](_0x5b6b06);}})[_0x9381('0x24')](function(_0x411ec8){if(_0x411ec8){_0x319330=_0x411ec8[_0x9381('0x34')];if(!_0x35657c[_0x9381('0x2e')]['hasOwnProperty'](_0x9381('0x36'))){_0x5b6b06[_0x9381('0x1c')]=qs['limit'](_0x35657c[_0x9381('0x2e')][_0x9381('0x1c')]);_0x5b6b06[_0x9381('0x1a')]=qs[_0x9381('0x1a')](_0x35657c['query'][_0x9381('0x1a')]);}return _0x1d6f5c['getConfigurations'](_0x5b6b06);}})[_0x9381('0x24')](function(_0x5f0a01){if(_0x5f0a01){return _0x5f0a01?{'count':_0x319330,'rows':_0x5f0a01}:null;}})[_0x9381('0x24')](respondWithResult(_0x217434,null))[_0x9381('0x40')](handleError(_0x217434,null));};exports[_0x9381('0x4b')]=function(_0x50ee58,_0x43cb08,_0x21e653){if(_0x50ee58['body']['id']){delete _0x50ee58['body']['id'];}return db['DeskAccount'][_0x9381('0x48')]({'where':{'id':_0x50ee58[_0x9381('0x41')]['id']}})[_0x9381('0x24')](handleEntityNotFound(_0x43cb08,null))[_0x9381('0x24')](function(_0x315f66){if(_0x315f66){_0x50ee58[_0x9381('0x47')][_0x9381('0x4c')]=_0x315f66['id'];_0x50ee58['body'][_0x9381('0x4d')]=integrations[_0x9381('0x4e')](_0x50ee58[_0x9381('0x47')][_0x9381('0x4f')],_0x50ee58['body']['type']);_0x50ee58[_0x9381('0x47')][_0x9381('0x50')]=integrations[_0x9381('0x51')](_0x50ee58[_0x9381('0x47')]['channel'],_0x50ee58[_0x9381('0x47')]['type']);return db['DeskConfiguration'][_0x9381('0x46')](_0x50ee58[_0x9381('0x47')],{'include':[{'model':db[_0x9381('0x52')],'as':'Subjects'},{'model':db[_0x9381('0x52')],'as':_0x9381('0x50')}]});}return null;})[_0x9381('0x24')](respondWithResult(_0x43cb08,null))[_0x9381('0x40')](handleError(_0x43cb08,null));};exports['getFields']=function(_0x48526f,_0x38c488,_0x598f89){var _0x281578=[{'name':_0x9381('0x53'),'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 _0x2e8dc0='';return db['DeskAccount'][_0x9381('0x48')]({'where':{'id':_0x48526f[_0x9381('0x41')]['id']},'attributes':['id',_0x9381('0x54'),_0x9381('0x55'),'username',_0x9381('0x56'),_0x9381('0x57'),_0x9381('0x58'),_0x9381('0x59'),'tokenSecret']})[_0x9381('0x24')](handleEntityNotFound(_0x38c488,null))[_0x9381('0x24')](function(_0x23f97a){if(_0x23f97a){_0x2e8dc0=_0x23f97a[_0x9381('0x54')];var _0x148a4f=_0x2e8dc0[_0x9381('0x5a')](-0x1);if(_0x148a4f==='/'){_0x2e8dc0=_0x2e8dc0['substring'](0x0,_0x2e8dc0[_0x9381('0x5b')](_0x148a4f));}var _0x113a98={'method':_0x9381('0x5c'),'uri':util[_0x9381('0x5d')]('%s/custom_fields',_0x2e8dc0),'headers':{'Content-Type':_0x9381('0x5e'),'Accept':_0x9381('0x5e')},'json':!![]};if(_0x23f97a[_0x9381('0x55')]===_0x9381('0x5f')){_0x113a98[_0x9381('0x60')][_0x9381('0x61')]=util[_0x9381('0x5d')](_0x9381('0x62'),new Buffer(util['format'](_0x9381('0x63'),_0x23f97a[_0x9381('0x64')],_0x23f97a[_0x9381('0x56')]))[_0x9381('0x65')](_0x9381('0x66')));}return rp(_0x113a98)[_0x9381('0x24')](function(_0x532162){return _0x281578[_0x9381('0x67')](_[_0x9381('0x2d')](_0x532162[_0x9381('0x68')]['entries'],function(_0x3138d5){return{'id':_0x3138d5['name'],'name':_0x3138d5['name'],'type':_0x3138d5['type'],'active':_0x3138d5['active'],'label':_0x3138d5[_0x9381('0x69')],'custom':!![]};}));});}})[_0x9381('0x24')](function(_0x2a1cd9){return{'count':_0x2a1cd9['length'],'rows':_0x2a1cd9};})[_0x9381('0x24')](respondWithResult(_0x38c488,null))[_0x9381('0x40')](function(_0x58eb97){var _0xf01ebc=_0x48526f[_0x9381('0x2e')][_0x9381('0x6a')]?0x1f4:_0x58eb97[_0x9381('0x6b')]||0x1f4;logger[_0x9381('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xf01ebc,JSON[_0x9381('0x6c')](_0x58eb97));delete _0x58eb97[_0x9381('0x26')];if(_0xf01ebc===0x191){_0xf01ebc=0x190;}_0x38c488['status'](_0xf01ebc)[_0x9381('0x27')](_0x48526f[_0x9381('0x2e')][_0x9381('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x58eb97[_0x9381('0x6b')]}:_0x58eb97);});}; \ No newline at end of file +var _0x59f8=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','substring','GET','format','%s/custom_fields','application/json','basic','Authorization','%s:%s','toString','base64','concat','_embedded','entries','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x59f8,0x1c5));var _0x859f=function(_0xa661d5,_0x15f163){_0xa661d5=_0xa661d5-0x0;var _0x30c37f=_0x59f8[_0xa661d5];return _0x30c37f;};'use strict';var emlformat=require(_0x859f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x859f('0x1'));var jsonpatch=require(_0x859f('0x2'));var rp=require(_0x859f('0x3'));var moment=require(_0x859f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x859f('0x5'));var util=require('util');var path=require(_0x859f('0x6'));var sox=require('sox');var csv=require(_0x859f('0x7'));var ejs=require(_0x859f('0x8'));var fs=require('fs');var fs_extra=require(_0x859f('0x9'));var _=require(_0x859f('0xa'));var squel=require(_0x859f('0xb'));var crypto=require(_0x859f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x859f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x859f('0xe'));var Papa=require('papaparse');var Redis=require(_0x859f('0xf'));var authService=require(_0x859f('0x10'));var qs=require(_0x859f('0x11'));var as=require(_0x859f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x859f('0x13'))(_0x859f('0x14'));var utils=require(_0x859f('0x15'));var config=require(_0x859f('0x16'));var licenseUtil=require(_0x859f('0x17'));var db=require(_0x859f('0x18'))['db'];var integrations=require(_0x859f('0x19'));function respondWithStatusCode(_0x3795ee,_0x5cca8b){_0x5cca8b=_0x5cca8b||0xcc;return function(_0x48d2d4){if(_0x48d2d4){return _0x3795ee[_0x859f('0x1a')](_0x5cca8b);}return _0x3795ee[_0x859f('0x1b')](_0x5cca8b)[_0x859f('0x1c')]();};}function respondWithResult(_0x275ce3,_0x5708ba){_0x5708ba=_0x5708ba||0xc8;return function(_0x1e3fc1){if(_0x1e3fc1){return _0x275ce3['status'](_0x5708ba)[_0x859f('0x1d')](_0x1e3fc1);}};}function respondWithFilteredResult(_0x575499,_0x4fc3bd){return function(_0x16c603){if(_0x16c603){var _0x2ee42e=typeof _0x4fc3bd[_0x859f('0x1e')]==='undefined'&&typeof _0x4fc3bd[_0x859f('0x1f')]===_0x859f('0x20');var _0x1ec1bc=_0x16c603[_0x859f('0x21')];var _0x44def6=_0x2ee42e?0x0:_0x4fc3bd[_0x859f('0x1e')];var _0x3a81e3=_0x2ee42e?_0x16c603['count']:_0x4fc3bd[_0x859f('0x1e')]+_0x4fc3bd['limit'];var _0x16cb60;if(_0x3a81e3>=_0x1ec1bc){_0x3a81e3=_0x1ec1bc;_0x16cb60=0xc8;}else{_0x16cb60=0xce;}_0x575499[_0x859f('0x1b')](_0x16cb60);return _0x575499[_0x859f('0x22')](_0x859f('0x23'),_0x44def6+'-'+_0x3a81e3+'/'+_0x1ec1bc)[_0x859f('0x1d')](_0x16c603);}return null;};}function patchUpdates(_0x403b7d){return function(_0x38f1c6){try{jsonpatch[_0x859f('0x24')](_0x38f1c6,_0x403b7d,!![]);}catch(_0x4215ae){return BPromise['reject'](_0x4215ae);}return _0x38f1c6[_0x859f('0x25')]();};}function saveUpdates(_0x2fc2cb,_0x3b743f){return function(_0x429291){if(_0x429291){return _0x429291[_0x859f('0x26')](_0x2fc2cb)['then'](function(_0x50b690){return _0x50b690;});}return null;};}function removeEntity(_0x274cf2,_0x31adb5){return function(_0x1edcf8){if(_0x1edcf8){return _0x1edcf8[_0x859f('0x27')]()[_0x859f('0x28')](function(){_0x274cf2[_0x859f('0x1b')](0xcc)[_0x859f('0x1c')]();});}};}function handleEntityNotFound(_0x19efad,_0x1dbf98){return function(_0x19e4fe){if(!_0x19e4fe){_0x19efad[_0x859f('0x1a')](0x194);}return _0x19e4fe;};}function handleError(_0x28eedb,_0x1b650d){_0x1b650d=_0x1b650d||0x1f4;return function(_0x35c8ca){logger[_0x859f('0x29')](_0x35c8ca[_0x859f('0x2a')]);if(_0x35c8ca[_0x859f('0x2b')]){delete _0x35c8ca[_0x859f('0x2b')];}_0x28eedb[_0x859f('0x1b')](_0x1b650d)['send'](_0x35c8ca);};}exports[_0x859f('0x2c')]=function(_0x491a6b,_0x53e88f){var _0x1f25e3={},_0x5811c4={},_0xb8b202={'count':0x0,'rows':[]};var _0x13c0dc=_[_0x859f('0x2d')](db[_0x859f('0x2e')][_0x859f('0x2f')],function(_0x5e6358){return{'name':_0x5e6358[_0x859f('0x30')],'type':_0x5e6358['type']['key']};});_0x5811c4['model']=_[_0x859f('0x2d')](_0x13c0dc,_0x859f('0x2b'));_0x5811c4[_0x859f('0x31')]=_['keys'](_0x491a6b[_0x859f('0x31')]);_0x5811c4[_0x859f('0x32')]=_[_0x859f('0x33')](_0x5811c4['model'],_0x5811c4[_0x859f('0x31')]);_0x1f25e3[_0x859f('0x34')]=_[_0x859f('0x33')](_0x5811c4['model'],qs['fields'](_0x491a6b[_0x859f('0x31')][_0x859f('0x35')]));_0x1f25e3['attributes']=_0x1f25e3['attributes'][_0x859f('0x36')]?_0x1f25e3[_0x859f('0x34')]:_0x5811c4[_0x859f('0x37')];if(!_0x491a6b[_0x859f('0x31')][_0x859f('0x38')](_0x859f('0x39'))){_0x1f25e3[_0x859f('0x1f')]=qs['limit'](_0x491a6b[_0x859f('0x31')][_0x859f('0x1f')]);_0x1f25e3[_0x859f('0x1e')]=qs[_0x859f('0x1e')](_0x491a6b[_0x859f('0x31')][_0x859f('0x1e')]);}_0x1f25e3[_0x859f('0x3a')]=qs[_0x859f('0x3b')](_0x491a6b['query']['sort']);_0x1f25e3[_0x859f('0x3c')]=qs[_0x859f('0x32')](_[_0x859f('0x3d')](_0x491a6b[_0x859f('0x31')],_0x5811c4[_0x859f('0x32')]),_0x13c0dc);if(_0x491a6b[_0x859f('0x31')][_0x859f('0x3e')]){_0x1f25e3[_0x859f('0x3c')]=_['merge'](_0x1f25e3[_0x859f('0x3c')],{'$or':_[_0x859f('0x2d')](_0x13c0dc,function(_0xf6f23c){if(_0xf6f23c[_0x859f('0x3f')]!==_0x859f('0x40')){var _0x66ead5={};_0x66ead5[_0xf6f23c[_0x859f('0x2b')]]={'$like':'%'+_0x491a6b[_0x859f('0x31')][_0x859f('0x3e')]+'%'};return _0x66ead5;}})});}_0x1f25e3=_[_0x859f('0x41')]({},_0x1f25e3,_0x491a6b[_0x859f('0x42')]);var _0x21c631={'where':_0x1f25e3[_0x859f('0x3c')]};return db['DeskAccount'][_0x859f('0x21')](_0x21c631)[_0x859f('0x28')](function(_0x5678d4){_0xb8b202['count']=_0x5678d4;if(_0x491a6b[_0x859f('0x31')][_0x859f('0x43')]){_0x1f25e3[_0x859f('0x44')]=[{'all':!![]}];}return db['DeskAccount'][_0x859f('0x45')](_0x1f25e3);})['then'](function(_0x480481){_0xb8b202[_0x859f('0x46')]=_0x480481;return _0xb8b202;})[_0x859f('0x28')](respondWithFilteredResult(_0x53e88f,_0x1f25e3))[_0x859f('0x47')](handleError(_0x53e88f,null));};exports[_0x859f('0x48')]=function(_0x126f8d,_0x40931d){var _0x4863d4={'raw':![],'where':{'id':_0x126f8d[_0x859f('0x49')]['id']}},_0x569fdd={};_0x569fdd[_0x859f('0x37')]=_[_0x859f('0x4a')](db[_0x859f('0x2e')][_0x859f('0x2f')]);_0x569fdd[_0x859f('0x31')]=_[_0x859f('0x4a')](_0x126f8d[_0x859f('0x31')]);_0x569fdd[_0x859f('0x32')]=_['intersection'](_0x569fdd[_0x859f('0x37')],_0x569fdd[_0x859f('0x31')]);_0x4863d4[_0x859f('0x34')]=_['intersection'](_0x569fdd[_0x859f('0x37')],qs['fields'](_0x126f8d[_0x859f('0x31')][_0x859f('0x35')]));_0x4863d4[_0x859f('0x34')]=_0x4863d4[_0x859f('0x34')][_0x859f('0x36')]?_0x4863d4[_0x859f('0x34')]:_0x569fdd[_0x859f('0x37')];if(_0x126f8d['query'][_0x859f('0x43')]){_0x4863d4['include']=[{'all':!![]}];}_0x4863d4=_[_0x859f('0x41')]({},_0x4863d4,_0x126f8d[_0x859f('0x42')]);return db[_0x859f('0x2e')][_0x859f('0x4b')](_0x4863d4)[_0x859f('0x28')](handleEntityNotFound(_0x40931d,null))[_0x859f('0x28')](respondWithResult(_0x40931d,null))[_0x859f('0x47')](handleError(_0x40931d,null));};exports[_0x859f('0x4c')]=function(_0x2a3987,_0x2407e8){return db[_0x859f('0x2e')][_0x859f('0x4c')](_0x2a3987[_0x859f('0x4d')],{})[_0x859f('0x28')](respondWithResult(_0x2407e8,0xc9))[_0x859f('0x47')](handleError(_0x2407e8,null));};exports['update']=function(_0xd58b89,_0x19704c){if(_0xd58b89[_0x859f('0x4d')]['id']){delete _0xd58b89[_0x859f('0x4d')]['id'];}return db['DeskAccount'][_0x859f('0x4b')]({'where':{'id':_0xd58b89[_0x859f('0x49')]['id']}})['then'](handleEntityNotFound(_0x19704c,null))[_0x859f('0x28')](saveUpdates(_0xd58b89['body'],null))[_0x859f('0x28')](respondWithResult(_0x19704c,null))[_0x859f('0x47')](handleError(_0x19704c,null));};exports[_0x859f('0x27')]=function(_0x1e32fe,_0x1ba7c7){return db['DeskAccount'][_0x859f('0x4b')]({'where':{'id':_0x1e32fe[_0x859f('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ba7c7,null))['then'](removeEntity(_0x1ba7c7,null))[_0x859f('0x47')](handleError(_0x1ba7c7,null));};exports[_0x859f('0x4e')]=function(_0x9ae466,_0x5033ca,_0x5e03d8){var _0x97eb89={};var _0x24ef98={};var _0x16d4c0;var _0x55a5ce;return db['DeskAccount'][_0x859f('0x4f')]({'where':{'id':_0x9ae466[_0x859f('0x49')]['id']}})['then'](handleEntityNotFound(_0x5033ca,null))[_0x859f('0x28')](function(_0x3ba6d0){if(_0x3ba6d0){_0x16d4c0=_0x3ba6d0;_0x24ef98[_0x859f('0x37')]=_['keys'](db[_0x859f('0x50')][_0x859f('0x2f')]);_0x24ef98['query']=_[_0x859f('0x4a')](_0x9ae466[_0x859f('0x31')]);_0x24ef98['filters']=_[_0x859f('0x33')](_0x24ef98[_0x859f('0x37')],_0x24ef98['query']);_0x97eb89[_0x859f('0x34')]=_[_0x859f('0x33')](_0x24ef98[_0x859f('0x37')],qs[_0x859f('0x35')](_0x9ae466[_0x859f('0x31')][_0x859f('0x35')]));_0x97eb89['attributes']=_0x97eb89['attributes'][_0x859f('0x36')]?_0x97eb89[_0x859f('0x34')]:_0x24ef98[_0x859f('0x37')];_0x97eb89['order']=qs[_0x859f('0x3b')](_0x9ae466['query']['sort']);_0x97eb89[_0x859f('0x3c')]=qs[_0x859f('0x32')](_['pick'](_0x9ae466[_0x859f('0x31')],_0x24ef98[_0x859f('0x32')]));if(_0x9ae466[_0x859f('0x31')]['filter']){_0x97eb89[_0x859f('0x3c')]=_[_0x859f('0x41')](_0x97eb89['where'],{'$or':_[_0x859f('0x2d')](_0x97eb89['attributes'],function(_0x58693){var _0x4b0eb0={};_0x4b0eb0[_0x58693]={'$like':'%'+_0x9ae466['query'][_0x859f('0x3e')]+'%'};return _0x4b0eb0;})});}_0x97eb89=_[_0x859f('0x41')]({},_0x97eb89,_0x9ae466[_0x859f('0x42')]);return _0x16d4c0[_0x859f('0x4e')](_0x97eb89);}})['then'](function(_0x244e8a){if(_0x244e8a){_0x55a5ce=_0x244e8a[_0x859f('0x36')];if(!_0x9ae466[_0x859f('0x31')][_0x859f('0x38')](_0x859f('0x39'))){_0x97eb89[_0x859f('0x1f')]=qs[_0x859f('0x1f')](_0x9ae466[_0x859f('0x31')]['limit']);_0x97eb89[_0x859f('0x1e')]=qs['offset'](_0x9ae466[_0x859f('0x31')]['offset']);}return _0x16d4c0['getConfigurations'](_0x97eb89);}})[_0x859f('0x28')](function(_0x45815c){if(_0x45815c){return _0x45815c?{'count':_0x55a5ce,'rows':_0x45815c}:null;}})[_0x859f('0x28')](respondWithResult(_0x5033ca,null))[_0x859f('0x47')](handleError(_0x5033ca,null));};exports['addConfiguration']=function(_0x33dc8b,_0x125ace,_0x5852f1){if(_0x33dc8b[_0x859f('0x4d')]['id']){delete _0x33dc8b[_0x859f('0x4d')]['id'];}return db[_0x859f('0x2e')][_0x859f('0x4f')]({'where':{'id':_0x33dc8b[_0x859f('0x49')]['id']}})['then'](handleEntityNotFound(_0x125ace,null))[_0x859f('0x28')](function(_0x2c3428){if(_0x2c3428){_0x33dc8b[_0x859f('0x4d')][_0x859f('0x51')]=_0x2c3428['id'];_0x33dc8b[_0x859f('0x4d')][_0x859f('0x52')]=integrations[_0x859f('0x53')](_0x33dc8b['body'][_0x859f('0x54')],_0x33dc8b[_0x859f('0x4d')][_0x859f('0x3f')]);_0x33dc8b[_0x859f('0x4d')]['Descriptions']=integrations[_0x859f('0x55')](_0x33dc8b[_0x859f('0x4d')]['channel'],_0x33dc8b['body']['type']);return db['DeskConfiguration'][_0x859f('0x4c')](_0x33dc8b[_0x859f('0x4d')],{'include':[{'model':db[_0x859f('0x56')],'as':'Subjects'},{'model':db[_0x859f('0x56')],'as':_0x859f('0x57')}]});}return null;})[_0x859f('0x28')](respondWithResult(_0x125ace,null))[_0x859f('0x47')](handleError(_0x125ace,null));};exports[_0x859f('0x58')]=function(_0x329764,_0x215af2,_0x156a42){var _0x3b144c=[{'name':'priority','label':_0x859f('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3cbe36='';return db['DeskAccount']['findOne']({'where':{'id':_0x329764[_0x859f('0x49')]['id']},'attributes':['id','remoteUri',_0x859f('0x5a'),_0x859f('0x5b'),_0x859f('0x5c'),_0x859f('0x5d'),_0x859f('0x5e'),_0x859f('0x5f'),_0x859f('0x60')]})[_0x859f('0x28')](handleEntityNotFound(_0x215af2,null))[_0x859f('0x28')](function(_0x2dc6ef){if(_0x2dc6ef){_0x3cbe36=_0x2dc6ef[_0x859f('0x61')];var _0x3881b3=_0x3cbe36['slice'](-0x1);if(_0x3881b3==='/'){_0x3cbe36=_0x3cbe36[_0x859f('0x62')](0x0,_0x3cbe36['lastIndexOf'](_0x3881b3));}var _0xf5f044={'method':_0x859f('0x63'),'uri':util[_0x859f('0x64')](_0x859f('0x65'),_0x3cbe36),'headers':{'Content-Type':_0x859f('0x66'),'Accept':_0x859f('0x66')},'json':!![]};if(_0x2dc6ef[_0x859f('0x5a')]===_0x859f('0x67')){_0xf5f044['headers'][_0x859f('0x68')]=util['format']('Basic\x20%s',new Buffer(util[_0x859f('0x64')](_0x859f('0x69'),_0x2dc6ef[_0x859f('0x5b')],_0x2dc6ef[_0x859f('0x5c')]))[_0x859f('0x6a')](_0x859f('0x6b')));}return rp(_0xf5f044)['then'](function(_0x4e61d8){return _0x3b144c[_0x859f('0x6c')](_[_0x859f('0x2d')](_0x4e61d8[_0x859f('0x6d')][_0x859f('0x6e')],function(_0x2e6384){return{'id':_0x2e6384[_0x859f('0x2b')],'name':_0x2e6384[_0x859f('0x2b')],'type':_0x2e6384[_0x859f('0x3f')],'active':_0x2e6384['active'],'label':_0x2e6384['label'],'custom':!![]};}));});}})[_0x859f('0x28')](function(_0x59c8c6){return{'count':_0x59c8c6[_0x859f('0x36')],'rows':_0x59c8c6};})['then'](respondWithResult(_0x215af2,null))[_0x859f('0x47')](function(_0x1ab8a1){var _0x3a5eb8=_0x329764[_0x859f('0x31')][_0x859f('0x6f')]?0x1f4:_0x1ab8a1['statusCode']||0x1f4;logger[_0x859f('0x29')](_0x859f('0x70'),_0x859f('0x58'),_0x3a5eb8,JSON[_0x859f('0x71')](_0x1ab8a1));delete _0x1ab8a1[_0x859f('0x2b')];if(_0x3a5eb8===0x191){_0x3a5eb8=0x190;}_0x215af2['status'](_0x3a5eb8)[_0x859f('0x72')](_0x329764[_0x859f('0x31')][_0x859f('0x6f')]?{'message':_0x859f('0x73'),'statusCode':_0x1ab8a1[_0x859f('0x74')]}:_0x1ab8a1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 0bc6ab1..92e04da 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 _0xb08c=['../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x22e4cd,_0x25529e){var _0x76b601=function(_0x4cc06f){while(--_0x4cc06f){_0x22e4cd['push'](_0x22e4cd['shift']());}};_0x76b601(++_0x25529e);}(_0xb08c,0x85));var _0xcb08=function(_0x53d2a0,_0x35a3a7){_0x53d2a0=_0x53d2a0-0x0;var _0x579a56=_0xb08c[_0x53d2a0];return _0x579a56;};'use strict';var _=require(_0xcb08('0x0'));var util=require(_0xcb08('0x1'));var logger=require(_0xcb08('0x2'))(_0xcb08('0x3'));var moment=require(_0xcb08('0x4'));var BPromise=require(_0xcb08('0x5'));var rp=require(_0xcb08('0x6'));var fs=require('fs');var path=require(_0xcb08('0x7'));var rimraf=require(_0xcb08('0x8'));var config=require(_0xcb08('0x9'));var attributes=require(_0xcb08('0xa'));var integrations=require(_0xcb08('0xb'));module[_0xcb08('0xc')]=function(_0x461e4c,_0x7de122){return _0x461e4c[_0xcb08('0xd')](_0xcb08('0xe'),attributes,{'tableName':_0xcb08('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfda2=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xfda2,0x1b8));var _0x2fda=function(_0x378e8a,_0x48d471){_0x378e8a=_0x378e8a-0x0;var _0x4aa669=_0xfda2[_0x378e8a];return _0x4aa669;};'use strict';var _=require('lodash');var util=require(_0x2fda('0x0'));var logger=require(_0x2fda('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2fda('0x2'));var rp=require(_0x2fda('0x3'));var fs=require('fs');var path=require(_0x2fda('0x4'));var rimraf=require(_0x2fda('0x5'));var config=require(_0x2fda('0x6'));var attributes=require(_0x2fda('0x7'));var integrations=require(_0x2fda('0x8'));module[_0x2fda('0x9')]=function(_0x5ead3a,_0x410610){return _0x5ead3a[_0x2fda('0xa')](_0x2fda('0xb'),attributes,{'tableName':_0x2fda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index e59b146..a6153d1 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 _0x9207=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowDeskAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2cb67b,_0x33f98f){var _0x27915e=function(_0x62b986){while(--_0x62b986){_0x2cb67b['push'](_0x2cb67b['shift']());}};_0x27915e(++_0x33f98f);}(_0x9207,0x186));var _0x7920=function(_0x11722b,_0x247eb2){_0x11722b=_0x11722b-0x0;var _0x2065f0=_0x9207[_0x11722b];return _0x2065f0;};'use strict';var _=require(_0x7920('0x0'));var util=require(_0x7920('0x1'));var moment=require('moment');var BPromise=require(_0x7920('0x2'));var rs=require(_0x7920('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7920('0x4'))['db'];var utils=require(_0x7920('0x5'));var logger=require(_0x7920('0x6'))(_0x7920('0x7'));var config=require(_0x7920('0x8'));var jayson=require(_0x7920('0x9'));var client=jayson[_0x7920('0xa')][_0x7920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe410bd,_0x5e5988,_0x280ae9){return new BPromise(function(_0x196713,_0x52324c){return client[_0x7920('0xc')](_0xe410bd,_0x280ae9)[_0x7920('0xd')](function(_0x52a9b0){logger['info'](_0x7920('0xe'),_0x5e5988,_0x7920('0xf'));logger[_0x7920('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5e5988,_0x7920('0xf'),JSON[_0x7920('0x11')](_0x52a9b0));if(_0x52a9b0[_0x7920('0x12')]){if(_0x52a9b0[_0x7920('0x12')][_0x7920('0x13')]===0x1f4){logger[_0x7920('0x12')](_0x7920('0xe'),_0x5e5988,_0x52a9b0[_0x7920('0x12')][_0x7920('0x14')]);return _0x52324c(_0x52a9b0[_0x7920('0x12')][_0x7920('0x14')]);}logger['error'](_0x7920('0xe'),_0x5e5988,_0x52a9b0['error']['message']);return _0x196713(_0x52a9b0[_0x7920('0x12')][_0x7920('0x14')]);}else{logger[_0x7920('0x15')](_0x7920('0xe'),_0x5e5988,'request\x20sent');_0x196713(_0x52a9b0[_0x7920('0x16')][_0x7920('0x14')]);}})[_0x7920('0x17')](function(_0x570830){logger['error'](_0x7920('0xe'),_0x5e5988,_0x570830);_0x52324c(_0x570830);});});}exports[_0x7920('0x18')]=function(_0xa71765){var _0x12536f=this;return new Promise(function(_0x37de31,_0x5247b7){return db['DeskAccount'][_0x7920('0x19')]({'raw':_0xa71765[_0x7920('0x1a')]?_0xa71765[_0x7920('0x1a')][_0x7920('0x1b')]===undefined?!![]:![]:!![],'where':_0xa71765[_0x7920('0x1a')]?_0xa71765[_0x7920('0x1a')][_0x7920('0x1c')]||null:null,'attributes':_0xa71765['options']?_0xa71765[_0x7920('0x1a')][_0x7920('0x1d')]||null:null,'limit':_0xa71765['options']?_0xa71765[_0x7920('0x1a')][_0x7920('0x1e')]||null:null,'include':_0xa71765[_0x7920('0x1a')]?_0xa71765[_0x7920('0x1a')][_0x7920('0x1f')]?_['map'](_0xa71765[_0x7920('0x1a')]['include'],function(_0x6f7a90){return{'model':db[_0x6f7a90[_0x7920('0x20')]],'as':_0x6f7a90['as'],'attributes':_0x6f7a90[_0x7920('0x1d')],'include':_0x6f7a90[_0x7920('0x1f')]?_['map'](_0x6f7a90[_0x7920('0x1f')],function(_0x2c6da2){return{'model':db[_0x2c6da2[_0x7920('0x20')]],'as':_0x2c6da2['as'],'attributes':_0x2c6da2[_0x7920('0x1d')],'include':_0x2c6da2['include']?_[_0x7920('0x21')](_0x2c6da2['include'],function(_0x428787){return{'model':db[_0x428787['model']],'as':_0x428787['as'],'attributes':_0x428787[_0x7920('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7920('0xd')](function(_0x53f697){logger['info']('GetDeskAccount',_0xa71765);logger['debug'](_0x7920('0x18'),_0xa71765,JSON['stringify'](_0x53f697));_0x37de31(_0x53f697);})[_0x7920('0x17')](function(_0x1db1a9){logger[_0x7920('0x12')]('GetDeskAccount',_0x1db1a9[_0x7920('0x14')],_0xa71765);_0x5247b7(_0x12536f[_0x7920('0x12')](0x1f4,_0x1db1a9[_0x7920('0x14')]));});});};exports['ShowDeskAccount']=function(_0x4378d6){var _0x4b8da3=this;return new Promise(function(_0x565bfa,_0x1ebefb){return db['DeskAccount'][_0x7920('0x22')]({'raw':_0x4378d6[_0x7920('0x1a')]?_0x4378d6[_0x7920('0x1a')][_0x7920('0x1b')]===undefined?!![]:![]:!![],'where':_0x4378d6[_0x7920('0x1a')]?_0x4378d6['options'][_0x7920('0x1c')]||null:null,'attributes':_0x4378d6[_0x7920('0x1a')]?_0x4378d6[_0x7920('0x1a')][_0x7920('0x1d')]||null:null,'include':_0x4378d6[_0x7920('0x1a')]?_0x4378d6[_0x7920('0x1a')][_0x7920('0x1f')]?_['map'](_0x4378d6[_0x7920('0x1a')]['include'],function(_0x46873d){return{'model':db[_0x46873d[_0x7920('0x20')]],'as':_0x46873d['as'],'attributes':_0x46873d['attributes'],'include':_0x46873d[_0x7920('0x1f')]?_[_0x7920('0x21')](_0x46873d['include'],function(_0x314fe6){return{'model':db[_0x314fe6[_0x7920('0x20')]],'as':_0x314fe6['as'],'attributes':_0x314fe6[_0x7920('0x1d')],'include':_0x314fe6[_0x7920('0x1f')]?_[_0x7920('0x21')](_0x314fe6['include'],function(_0x183ab0){return{'model':db[_0x183ab0[_0x7920('0x20')]],'as':_0x183ab0['as'],'attributes':_0x183ab0[_0x7920('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a114f){logger[_0x7920('0x15')](_0x7920('0x23'),_0x4378d6);logger['debug'](_0x7920('0x23'),_0x4378d6,JSON['stringify'](_0x1a114f));_0x565bfa(_0x1a114f);})[_0x7920('0x17')](function(_0x5907f4){logger[_0x7920('0x12')]('ShowDeskAccount',_0x5907f4[_0x7920('0x14')],_0x4378d6);_0x1ebefb(_0x4b8da3[_0x7920('0x12')](0x1f4,_0x5907f4[_0x7920('0x14')]));});});}; \ No newline at end of file +var _0x5d3b=['map','model','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include'];(function(_0x1bce4a,_0x4e33a9){var _0x5d414d=function(_0x389889){while(--_0x389889){_0x1bce4a['push'](_0x1bce4a['shift']());}};_0x5d414d(++_0x4e33a9);}(_0x5d3b,0x191));var _0xb5d3=function(_0x48b8ad,_0xe28403){_0x48b8ad=_0x48b8ad-0x0;var _0x4d1bae=_0x5d3b[_0x48b8ad];return _0x4d1bae;};'use strict';var _=require(_0xb5d3('0x0'));var util=require(_0xb5d3('0x1'));var moment=require(_0xb5d3('0x2'));var BPromise=require(_0xb5d3('0x3'));var rs=require(_0xb5d3('0x4'));var fs=require('fs');var Redis=require(_0xb5d3('0x5'));var db=require(_0xb5d3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb5d3('0x7'));var client=jayson[_0xb5d3('0x8')][_0xb5d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x568f23,_0x1ba375,_0x3b0da3){return new BPromise(function(_0x168d91,_0x458e17){return client['request'](_0x568f23,_0x3b0da3)[_0xb5d3('0xa')](function(_0x3a529f){logger['info'](_0xb5d3('0xb'),_0x1ba375,_0xb5d3('0xc'));logger[_0xb5d3('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1ba375,'request\x20sent',JSON[_0xb5d3('0xe')](_0x3a529f));if(_0x3a529f[_0xb5d3('0xf')]){if(_0x3a529f[_0xb5d3('0xf')][_0xb5d3('0x10')]===0x1f4){logger[_0xb5d3('0xf')](_0xb5d3('0xb'),_0x1ba375,_0x3a529f[_0xb5d3('0xf')][_0xb5d3('0x11')]);return _0x458e17(_0x3a529f[_0xb5d3('0xf')][_0xb5d3('0x11')]);}logger['error'](_0xb5d3('0xb'),_0x1ba375,_0x3a529f[_0xb5d3('0xf')][_0xb5d3('0x11')]);return _0x168d91(_0x3a529f[_0xb5d3('0xf')][_0xb5d3('0x11')]);}else{logger[_0xb5d3('0x12')](_0xb5d3('0xb'),_0x1ba375,_0xb5d3('0xc'));_0x168d91(_0x3a529f[_0xb5d3('0x13')][_0xb5d3('0x11')]);}})[_0xb5d3('0x14')](function(_0x1bb391){logger['error']('DeskAccount,\x20%s,\x20%s',_0x1ba375,_0x1bb391);_0x458e17(_0x1bb391);});});}exports[_0xb5d3('0x15')]=function(_0x363c4b){var _0x5a82f4=this;return new Promise(function(_0x37c2f3,_0x585200){return db[_0xb5d3('0x16')]['findAll']({'raw':_0x363c4b[_0xb5d3('0x17')]?_0x363c4b[_0xb5d3('0x17')][_0xb5d3('0x18')]===undefined?!![]:![]:!![],'where':_0x363c4b[_0xb5d3('0x17')]?_0x363c4b[_0xb5d3('0x17')]['where']||null:null,'attributes':_0x363c4b[_0xb5d3('0x17')]?_0x363c4b[_0xb5d3('0x17')][_0xb5d3('0x19')]||null:null,'limit':_0x363c4b[_0xb5d3('0x17')]?_0x363c4b[_0xb5d3('0x17')][_0xb5d3('0x1a')]||null:null,'include':_0x363c4b[_0xb5d3('0x17')]?_0x363c4b[_0xb5d3('0x17')][_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x363c4b[_0xb5d3('0x17')]['include'],function(_0x3aa237){return{'model':db[_0x3aa237['model']],'as':_0x3aa237['as'],'attributes':_0x3aa237[_0xb5d3('0x19')],'include':_0x3aa237[_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x3aa237[_0xb5d3('0x1b')],function(_0x5a1067){return{'model':db[_0x5a1067[_0xb5d3('0x1d')]],'as':_0x5a1067['as'],'attributes':_0x5a1067[_0xb5d3('0x19')],'include':_0x5a1067[_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x5a1067[_0xb5d3('0x1b')],function(_0x3ce8a9){return{'model':db[_0x3ce8a9[_0xb5d3('0x1d')]],'as':_0x3ce8a9['as'],'attributes':_0x3ce8a9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5d3('0xa')](function(_0x2e12c1){logger[_0xb5d3('0x12')]('GetDeskAccount',_0x363c4b);logger['debug'](_0xb5d3('0x15'),_0x363c4b,JSON[_0xb5d3('0xe')](_0x2e12c1));_0x37c2f3(_0x2e12c1);})[_0xb5d3('0x14')](function(_0x2865d9){logger[_0xb5d3('0xf')](_0xb5d3('0x15'),_0x2865d9[_0xb5d3('0x11')],_0x363c4b);_0x585200(_0x5a82f4[_0xb5d3('0xf')](0x1f4,_0x2865d9[_0xb5d3('0x11')]));});});};exports[_0xb5d3('0x1e')]=function(_0x54b6d7){var _0x682fb4=this;return new Promise(function(_0x4c0994,_0x28eba6){return db[_0xb5d3('0x16')][_0xb5d3('0x1f')]({'raw':_0x54b6d7[_0xb5d3('0x17')]?_0x54b6d7['options']['raw']===undefined?!![]:![]:!![],'where':_0x54b6d7['options']?_0x54b6d7[_0xb5d3('0x17')][_0xb5d3('0x20')]||null:null,'attributes':_0x54b6d7[_0xb5d3('0x17')]?_0x54b6d7[_0xb5d3('0x17')][_0xb5d3('0x19')]||null:null,'include':_0x54b6d7['options']?_0x54b6d7[_0xb5d3('0x17')][_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x54b6d7[_0xb5d3('0x17')][_0xb5d3('0x1b')],function(_0x24f319){return{'model':db[_0x24f319[_0xb5d3('0x1d')]],'as':_0x24f319['as'],'attributes':_0x24f319[_0xb5d3('0x19')],'include':_0x24f319[_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x24f319[_0xb5d3('0x1b')],function(_0x412030){return{'model':db[_0x412030[_0xb5d3('0x1d')]],'as':_0x412030['as'],'attributes':_0x412030['attributes'],'include':_0x412030[_0xb5d3('0x1b')]?_[_0xb5d3('0x1c')](_0x412030[_0xb5d3('0x1b')],function(_0x19b5bf){return{'model':db[_0x19b5bf[_0xb5d3('0x1d')]],'as':_0x19b5bf['as'],'attributes':_0x19b5bf[_0xb5d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb5d3('0xa')](function(_0x537876){logger[_0xb5d3('0x12')]('ShowDeskAccount',_0x54b6d7);logger[_0xb5d3('0xd')](_0xb5d3('0x1e'),_0x54b6d7,JSON[_0xb5d3('0xe')](_0x537876));_0x4c0994(_0x537876);})[_0xb5d3('0x14')](function(_0x553a6d){logger[_0xb5d3('0xf')](_0xb5d3('0x1e'),_0x553a6d['message'],_0x54b6d7);_0x28eba6(_0x682fb4['error'](0x1f4,_0x553a6d['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 2b871a5..18553f6 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x597065,_0x453bfd){var _0xb8e1fb=function(_0x315563){while(--_0x315563){_0x597065['push'](_0x597065['shift']());}};_0xb8e1fb(++_0x453bfd);}(_0xedd9,0xfc));var _0x9edd=function(_0x2161da,_0x5c6f44){_0x2161da=_0x2161da-0x0;var _0x147c54=_0xedd9[_0x2161da];return _0x147c54;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x2d59da,_0x437edb){var _0x382d8c=function(_0x335e83){while(--_0x335e83){_0x2d59da['push'](_0x2d59da['shift']());}};_0x382d8c(++_0x437edb);}(_0xedd9,0xfc));var _0x9edd=function(_0x3210b2,_0x3f2800){_0x3210b2=_0x3210b2-0x0;var _0x585773=_0xedd9[_0x3210b2];return _0x585773;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 64d58db..1039487 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 _0x2ac0=['STRING','sequelize','exports'];(function(_0x38767a,_0x530907){var _0x377de8=function(_0x4ab6f0){while(--_0x4ab6f0){_0x38767a['push'](_0x38767a['shift']());}};_0x377de8(++_0x530907);}(_0x2ac0,0x91));var _0x02ac=function(_0x20ff40,_0x52384d){_0x20ff40=_0x20ff40-0x0;var _0x978c1e=_0x2ac0[_0x20ff40];return _0x978c1e;};'use strict';var Sequelize=require(_0x02ac('0x0'));module[_0x02ac('0x1')]={'name':{'type':Sequelize[_0x02ac('0x2')]},'description':{'type':Sequelize[_0x02ac('0x2')]}}; \ No newline at end of file +var _0xe4c5=['sequelize','exports','STRING'];(function(_0x18296d,_0x455fa4){var _0x485403=function(_0x597858){while(--_0x597858){_0x18296d['push'](_0x18296d['shift']());}};_0x485403(++_0x455fa4);}(_0xe4c5,0xc6));var _0x5e4c=function(_0x7cf50f,_0x27935e){_0x7cf50f=_0x7cf50f-0x0;var _0x359759=_0xe4c5[_0x7cf50f];return _0x359759;};'use strict';var Sequelize=require(_0x5e4c('0x0'));module[_0x5e4c('0x1')]={'name':{'type':Sequelize[_0x5e4c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index a26ddd9..dfe3fa2 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 _0x8470=['catch','show','params','rawAttributes','includeAll','find','create','body','findOne','DeskField','nolimit','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','error','name','send','map','DeskConfiguration','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll'];(function(_0x118d34,_0x223131){var _0x3cc67a=function(_0x1a0a81){while(--_0x1a0a81){_0x118d34['push'](_0x118d34['shift']());}};_0x3cc67a(++_0x223131);}(_0x8470,0x1b1));var _0x0847=function(_0x48f1d8,_0xeb93f0){_0x48f1d8=_0x48f1d8-0x0;var _0x1ca69d=_0x8470[_0x48f1d8];return _0x1ca69d;};'use strict';var emlformat=require(_0x0847('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0847('0x1'));var jsonpatch=require(_0x0847('0x2'));var rp=require(_0x0847('0x3'));var moment=require(_0x0847('0x4'));var BPromise=require(_0x0847('0x5'));var Mustache=require(_0x0847('0x6'));var util=require(_0x0847('0x7'));var path=require(_0x0847('0x8'));var sox=require(_0x0847('0x9'));var csv=require(_0x0847('0xa'));var ejs=require(_0x0847('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0847('0xc'));var squel=require(_0x0847('0xd'));var crypto=require('crypto');var jsforce=require(_0x0847('0xe'));var deskjs=require(_0x0847('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0847('0x10'));var Papa=require(_0x0847('0x11'));var Redis=require(_0x0847('0x12'));var authService=require(_0x0847('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0847('0x14'));var hardwareService=require(_0x0847('0x15'));var logger=require(_0x0847('0x16'))('api');var utils=require(_0x0847('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0847('0x18'));var db=require(_0x0847('0x19'))['db'];function respondWithStatusCode(_0x1b5ec0,_0x1791e4){_0x1791e4=_0x1791e4||0xcc;return function(_0x4cde68){if(_0x4cde68){return _0x1b5ec0[_0x0847('0x1a')](_0x1791e4);}return _0x1b5ec0[_0x0847('0x1b')](_0x1791e4)[_0x0847('0x1c')]();};}function respondWithResult(_0x1b8158,_0x68a9b3){_0x68a9b3=_0x68a9b3||0xc8;return function(_0x504486){if(_0x504486){return _0x1b8158[_0x0847('0x1b')](_0x68a9b3)['json'](_0x504486);}};}function respondWithFilteredResult(_0x231108,_0x44fb6b){return function(_0x5e19fc){if(_0x5e19fc){var _0x251533=typeof _0x44fb6b['offset']===_0x0847('0x1d')&&typeof _0x44fb6b[_0x0847('0x1e')]==='undefined';var _0x3898d8=_0x5e19fc[_0x0847('0x1f')];var _0x1af6ee=_0x251533?0x0:_0x44fb6b[_0x0847('0x20')];var _0x1cc4f6=_0x251533?_0x5e19fc[_0x0847('0x1f')]:_0x44fb6b[_0x0847('0x20')]+_0x44fb6b[_0x0847('0x1e')];var _0x38676e;if(_0x1cc4f6>=_0x3898d8){_0x1cc4f6=_0x3898d8;_0x38676e=0xc8;}else{_0x38676e=0xce;}_0x231108[_0x0847('0x1b')](_0x38676e);return _0x231108[_0x0847('0x21')]('Content-Range',_0x1af6ee+'-'+_0x1cc4f6+'/'+_0x3898d8)[_0x0847('0x22')](_0x5e19fc);}return null;};}function patchUpdates(_0x42241c){return function(_0x1198e2){try{jsonpatch[_0x0847('0x23')](_0x1198e2,_0x42241c,!![]);}catch(_0x52b8d9){return BPromise['reject'](_0x52b8d9);}return _0x1198e2[_0x0847('0x24')]();};}function saveUpdates(_0x2012f5,_0x3d9908){return function(_0x159ba8){if(_0x159ba8){return _0x159ba8[_0x0847('0x25')](_0x2012f5)[_0x0847('0x26')](function(_0x287986){return _0x287986;});}return null;};}function removeEntity(_0x4d3168,_0x2a9493){return function(_0x50f762){if(_0x50f762){return _0x50f762[_0x0847('0x27')]()['then'](function(){_0x4d3168['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x270991,_0x3e8e28){return function(_0x40ec1b){if(!_0x40ec1b){_0x270991[_0x0847('0x1a')](0x194);}return _0x40ec1b;};}function handleError(_0x36c531,_0xb8f773){_0xb8f773=_0xb8f773||0x1f4;return function(_0x201c31){logger[_0x0847('0x28')](_0x201c31['stack']);if(_0x201c31[_0x0847('0x29')]){delete _0x201c31[_0x0847('0x29')];}_0x36c531['status'](_0xb8f773)[_0x0847('0x2a')](_0x201c31);};}exports['index']=function(_0x14a929,_0x13baf1){var _0x1d5951={},_0x17487c={},_0x3ee335={'count':0x0,'rows':[]};var _0x4d290c=_[_0x0847('0x2b')](db[_0x0847('0x2c')]['rawAttributes'],function(_0x28cb19){return{'name':_0x28cb19[_0x0847('0x2d')],'type':_0x28cb19[_0x0847('0x2e')]['key']};});_0x17487c[_0x0847('0x2f')]=_['map'](_0x4d290c,_0x0847('0x29'));_0x17487c['query']=_[_0x0847('0x30')](_0x14a929[_0x0847('0x31')]);_0x17487c[_0x0847('0x32')]=_[_0x0847('0x33')](_0x17487c[_0x0847('0x2f')],_0x17487c[_0x0847('0x31')]);_0x1d5951['attributes']=_['intersection'](_0x17487c['model'],qs[_0x0847('0x34')](_0x14a929[_0x0847('0x31')][_0x0847('0x34')]));_0x1d5951[_0x0847('0x35')]=_0x1d5951['attributes'][_0x0847('0x36')]?_0x1d5951[_0x0847('0x35')]:_0x17487c[_0x0847('0x2f')];if(!_0x14a929['query'][_0x0847('0x37')]('nolimit')){_0x1d5951[_0x0847('0x1e')]=qs['limit'](_0x14a929[_0x0847('0x31')][_0x0847('0x1e')]);_0x1d5951[_0x0847('0x20')]=qs[_0x0847('0x20')](_0x14a929['query']['offset']);}_0x1d5951[_0x0847('0x38')]=qs[_0x0847('0x39')](_0x14a929[_0x0847('0x31')][_0x0847('0x39')]);_0x1d5951['where']=qs[_0x0847('0x32')](_[_0x0847('0x3a')](_0x14a929[_0x0847('0x31')],_0x17487c['filters']),_0x4d290c);if(_0x14a929[_0x0847('0x31')][_0x0847('0x3b')]){_0x1d5951[_0x0847('0x3c')]=_['merge'](_0x1d5951[_0x0847('0x3c')],{'$or':_[_0x0847('0x2b')](_0x4d290c,function(_0x457821){if(_0x457821[_0x0847('0x2e')]!=='VIRTUAL'){var _0x3d0cc7={};_0x3d0cc7[_0x457821['name']]={'$like':'%'+_0x14a929[_0x0847('0x31')][_0x0847('0x3b')]+'%'};return _0x3d0cc7;}})});}_0x1d5951=_[_0x0847('0x3d')]({},_0x1d5951,_0x14a929[_0x0847('0x3e')]);var _0x5f4ae2={'where':_0x1d5951['where']};return db[_0x0847('0x2c')]['count'](_0x5f4ae2)[_0x0847('0x26')](function(_0x41a707){_0x3ee335['count']=_0x41a707;if(_0x14a929[_0x0847('0x31')]['includeAll']){_0x1d5951[_0x0847('0x3f')]=[{'all':!![]}];}return db[_0x0847('0x2c')][_0x0847('0x40')](_0x1d5951);})[_0x0847('0x26')](function(_0x36b393){_0x3ee335['rows']=_0x36b393;return _0x3ee335;})['then'](respondWithFilteredResult(_0x13baf1,_0x1d5951))[_0x0847('0x41')](handleError(_0x13baf1,null));};exports[_0x0847('0x42')]=function(_0x2b325d,_0x45e85f){var _0x215f69={'raw':![],'where':{'id':_0x2b325d[_0x0847('0x43')]['id']}},_0x27f760={};_0x27f760[_0x0847('0x2f')]=_[_0x0847('0x30')](db[_0x0847('0x2c')][_0x0847('0x44')]);_0x27f760['query']=_[_0x0847('0x30')](_0x2b325d[_0x0847('0x31')]);_0x27f760[_0x0847('0x32')]=_[_0x0847('0x33')](_0x27f760['model'],_0x27f760[_0x0847('0x31')]);_0x215f69[_0x0847('0x35')]=_[_0x0847('0x33')](_0x27f760[_0x0847('0x2f')],qs[_0x0847('0x34')](_0x2b325d[_0x0847('0x31')][_0x0847('0x34')]));_0x215f69['attributes']=_0x215f69[_0x0847('0x35')][_0x0847('0x36')]?_0x215f69[_0x0847('0x35')]:_0x27f760[_0x0847('0x2f')];if(_0x2b325d[_0x0847('0x31')][_0x0847('0x45')]){_0x215f69['include']=[{'all':!![]}];}_0x215f69=_[_0x0847('0x3d')]({},_0x215f69,_0x2b325d[_0x0847('0x3e')]);return db[_0x0847('0x2c')][_0x0847('0x46')](_0x215f69)['then'](handleEntityNotFound(_0x45e85f,null))['then'](respondWithResult(_0x45e85f,null))[_0x0847('0x41')](handleError(_0x45e85f,null));};exports[_0x0847('0x47')]=function(_0x74caea,_0x44c9d3){return db[_0x0847('0x2c')]['create'](_0x74caea[_0x0847('0x48')],{})[_0x0847('0x26')](respondWithResult(_0x44c9d3,0xc9))[_0x0847('0x41')](handleError(_0x44c9d3,null));};exports['update']=function(_0x254f06,_0x1cb574){if(_0x254f06[_0x0847('0x48')]['id']){delete _0x254f06[_0x0847('0x48')]['id'];}return db[_0x0847('0x2c')][_0x0847('0x46')]({'where':{'id':_0x254f06['params']['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x1cb574,null))['then'](saveUpdates(_0x254f06[_0x0847('0x48')],null))[_0x0847('0x26')](respondWithResult(_0x1cb574,null))['catch'](handleError(_0x1cb574,null));};exports['destroy']=function(_0x54948a,_0x5c0fc1){return db[_0x0847('0x2c')][_0x0847('0x46')]({'where':{'id':_0x54948a['params']['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x5c0fc1,null))[_0x0847('0x26')](removeEntity(_0x5c0fc1,null))[_0x0847('0x41')](handleError(_0x5c0fc1,null));};exports['getFields']=function(_0x4eb1ee,_0x5ba042,_0x160506){var _0x2288f9={};var _0x1c93ca={};var _0x156c81;var _0x499faf;return db['DeskConfiguration'][_0x0847('0x49')]({'where':{'id':_0x4eb1ee[_0x0847('0x43')]['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x5ba042,null))['then'](function(_0xbb1bd3){if(_0xbb1bd3){_0x156c81=_0xbb1bd3;_0x1c93ca['model']=_[_0x0847('0x30')](db[_0x0847('0x4a')][_0x0847('0x44')]);_0x1c93ca['query']=_[_0x0847('0x30')](_0x4eb1ee[_0x0847('0x31')]);_0x1c93ca['filters']=_['intersection'](_0x1c93ca[_0x0847('0x2f')],_0x1c93ca['query']);_0x2288f9[_0x0847('0x35')]=_[_0x0847('0x33')](_0x1c93ca[_0x0847('0x2f')],qs[_0x0847('0x34')](_0x4eb1ee[_0x0847('0x31')][_0x0847('0x34')]));_0x2288f9[_0x0847('0x35')]=_0x2288f9[_0x0847('0x35')][_0x0847('0x36')]?_0x2288f9[_0x0847('0x35')]:_0x1c93ca[_0x0847('0x2f')];_0x2288f9[_0x0847('0x38')]=qs[_0x0847('0x39')](_0x4eb1ee[_0x0847('0x31')][_0x0847('0x39')]);_0x2288f9[_0x0847('0x3c')]=qs[_0x0847('0x32')](_[_0x0847('0x3a')](_0x4eb1ee[_0x0847('0x31')],_0x1c93ca[_0x0847('0x32')]));if(_0x4eb1ee[_0x0847('0x31')][_0x0847('0x3b')]){_0x2288f9[_0x0847('0x3c')]=_[_0x0847('0x3d')](_0x2288f9[_0x0847('0x3c')],{'$or':_[_0x0847('0x2b')](_0x2288f9['attributes'],function(_0x5ca964){var _0x552006={};_0x552006[_0x5ca964]={'$like':'%'+_0x4eb1ee[_0x0847('0x31')]['filter']+'%'};return _0x552006;})});}_0x2288f9=_[_0x0847('0x3d')]({},_0x2288f9,_0x4eb1ee[_0x0847('0x3e')]);return _0x156c81['getFields'](_0x2288f9);}})['then'](function(_0x43504b){if(_0x43504b){_0x499faf=_0x43504b[_0x0847('0x36')];if(!_0x4eb1ee[_0x0847('0x31')]['hasOwnProperty'](_0x0847('0x4b'))){_0x2288f9[_0x0847('0x1e')]=qs[_0x0847('0x1e')](_0x4eb1ee[_0x0847('0x31')][_0x0847('0x1e')]);_0x2288f9[_0x0847('0x20')]=qs[_0x0847('0x20')](_0x4eb1ee[_0x0847('0x31')][_0x0847('0x20')]);}return _0x156c81[_0x0847('0x4c')](_0x2288f9);}})[_0x0847('0x26')](function(_0x5ec25e){if(_0x5ec25e){return _0x5ec25e?{'count':_0x499faf,'rows':_0x5ec25e}:null;}})[_0x0847('0x26')](respondWithResult(_0x5ba042,null))[_0x0847('0x41')](handleError(_0x5ba042,null));};exports['getSubjects']=function(_0x3918b1,_0x3e2b37,_0x34d817){var _0x1a27f7={};var _0x4c085e={};var _0x20534d;var _0xd709de;return db[_0x0847('0x2c')][_0x0847('0x49')]({'where':{'id':_0x3918b1[_0x0847('0x43')]['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x3e2b37,null))['then'](function(_0x3e319b){if(_0x3e319b){_0x20534d=_0x3e319b;_0x4c085e[_0x0847('0x2f')]=_[_0x0847('0x30')](db[_0x0847('0x4a')][_0x0847('0x44')]);_0x4c085e[_0x0847('0x31')]=_[_0x0847('0x30')](_0x3918b1[_0x0847('0x31')]);_0x4c085e['filters']=_['intersection'](_0x4c085e[_0x0847('0x2f')],_0x4c085e[_0x0847('0x31')]);_0x1a27f7[_0x0847('0x35')]=_[_0x0847('0x33')](_0x4c085e[_0x0847('0x2f')],qs['fields'](_0x3918b1['query']['fields']));_0x1a27f7[_0x0847('0x35')]=_0x1a27f7[_0x0847('0x35')]['length']?_0x1a27f7[_0x0847('0x35')]:_0x4c085e[_0x0847('0x2f')];_0x1a27f7[_0x0847('0x38')]=qs[_0x0847('0x39')](_0x3918b1[_0x0847('0x31')][_0x0847('0x39')]);_0x1a27f7[_0x0847('0x3c')]=qs['filters'](_['pick'](_0x3918b1[_0x0847('0x31')],_0x4c085e[_0x0847('0x32')]));if(_0x3918b1['query'][_0x0847('0x3b')]){_0x1a27f7[_0x0847('0x3c')]=_[_0x0847('0x3d')](_0x1a27f7[_0x0847('0x3c')],{'$or':_[_0x0847('0x2b')](_0x1a27f7[_0x0847('0x35')],function(_0x1f2ca4){var _0x1b04bf={};_0x1b04bf[_0x1f2ca4]={'$like':'%'+_0x3918b1['query'][_0x0847('0x3b')]+'%'};return _0x1b04bf;})});}_0x1a27f7=_['merge']({},_0x1a27f7,_0x3918b1[_0x0847('0x3e')]);return _0x20534d[_0x0847('0x4d')](_0x1a27f7);}})[_0x0847('0x26')](function(_0x1839d3){if(_0x1839d3){_0xd709de=_0x1839d3[_0x0847('0x36')];if(!_0x3918b1[_0x0847('0x31')][_0x0847('0x37')](_0x0847('0x4b'))){_0x1a27f7[_0x0847('0x1e')]=qs['limit'](_0x3918b1[_0x0847('0x31')][_0x0847('0x1e')]);_0x1a27f7[_0x0847('0x20')]=qs['offset'](_0x3918b1[_0x0847('0x31')]['offset']);}return _0x20534d['getSubjects'](_0x1a27f7);}})['then'](function(_0x142649){if(_0x142649){return _0x142649?{'count':_0xd709de,'rows':_0x142649}:null;}})[_0x0847('0x26')](respondWithResult(_0x3e2b37,null))[_0x0847('0x41')](handleError(_0x3e2b37,null));};exports[_0x0847('0x4e')]=function(_0x5ad68c,_0x4c1efc,_0x3337a3){var _0x471d75={};var _0x16dcc7={};var _0x18bd7b;var _0x55efa9;return db[_0x0847('0x2c')][_0x0847('0x49')]({'where':{'id':_0x5ad68c['params']['id']}})['then'](handleEntityNotFound(_0x4c1efc,null))[_0x0847('0x26')](function(_0x4bccc5){if(_0x4bccc5){_0x18bd7b=_0x4bccc5;_0x16dcc7['model']=_[_0x0847('0x30')](db['DeskField']['rawAttributes']);_0x16dcc7[_0x0847('0x31')]=_['keys'](_0x5ad68c['query']);_0x16dcc7[_0x0847('0x32')]=_[_0x0847('0x33')](_0x16dcc7['model'],_0x16dcc7[_0x0847('0x31')]);_0x471d75[_0x0847('0x35')]=_['intersection'](_0x16dcc7['model'],qs['fields'](_0x5ad68c['query'][_0x0847('0x34')]));_0x471d75[_0x0847('0x35')]=_0x471d75[_0x0847('0x35')]['length']?_0x471d75[_0x0847('0x35')]:_0x16dcc7[_0x0847('0x2f')];_0x471d75[_0x0847('0x38')]=qs[_0x0847('0x39')](_0x5ad68c[_0x0847('0x31')][_0x0847('0x39')]);_0x471d75['where']=qs[_0x0847('0x32')](_[_0x0847('0x3a')](_0x5ad68c[_0x0847('0x31')],_0x16dcc7['filters']));if(_0x5ad68c[_0x0847('0x31')][_0x0847('0x3b')]){_0x471d75[_0x0847('0x3c')]=_[_0x0847('0x3d')](_0x471d75[_0x0847('0x3c')],{'$or':_[_0x0847('0x2b')](_0x471d75[_0x0847('0x35')],function(_0x36ed03){var _0x561687={};_0x561687[_0x36ed03]={'$like':'%'+_0x5ad68c[_0x0847('0x31')][_0x0847('0x3b')]+'%'};return _0x561687;})});}_0x471d75=_['merge']({},_0x471d75,_0x5ad68c['options']);return _0x18bd7b[_0x0847('0x4e')](_0x471d75);}})[_0x0847('0x26')](function(_0x1a7941){if(_0x1a7941){_0x55efa9=_0x1a7941[_0x0847('0x36')];if(!_0x5ad68c[_0x0847('0x31')]['hasOwnProperty']('nolimit')){_0x471d75[_0x0847('0x1e')]=qs['limit'](_0x5ad68c[_0x0847('0x31')][_0x0847('0x1e')]);_0x471d75[_0x0847('0x20')]=qs['offset'](_0x5ad68c[_0x0847('0x31')]['offset']);}return _0x18bd7b[_0x0847('0x4e')](_0x471d75);}})[_0x0847('0x26')](function(_0x479b1c){if(_0x479b1c){return _0x479b1c?{'count':_0x55efa9,'rows':_0x479b1c}:null;}})['then'](respondWithResult(_0x4c1efc,null))[_0x0847('0x41')](handleError(_0x4c1efc,null));};exports[_0x0847('0x4f')]=function(_0x2e6d93,_0x5ec9e9,_0x33c72b){var _0x22f30a={};var _0x3f0a86={};var _0x18debc;var _0x256c11;return db[_0x0847('0x2c')][_0x0847('0x49')]({'where':{'id':_0x2e6d93['params']['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x5ec9e9,null))[_0x0847('0x26')](function(_0x7e1949){if(_0x7e1949){_0x18debc=_0x7e1949;_0x3f0a86[_0x0847('0x2f')]=_[_0x0847('0x30')](db[_0x0847('0x50')][_0x0847('0x44')]);_0x3f0a86[_0x0847('0x31')]=_[_0x0847('0x30')](_0x2e6d93['query']);_0x3f0a86[_0x0847('0x32')]=_[_0x0847('0x33')](_0x3f0a86[_0x0847('0x2f')],_0x3f0a86[_0x0847('0x31')]);_0x22f30a[_0x0847('0x35')]=_[_0x0847('0x33')](_0x3f0a86['model'],qs[_0x0847('0x34')](_0x2e6d93[_0x0847('0x31')][_0x0847('0x34')]));_0x22f30a[_0x0847('0x35')]=_0x22f30a[_0x0847('0x35')]['length']?_0x22f30a[_0x0847('0x35')]:_0x3f0a86[_0x0847('0x2f')];_0x22f30a[_0x0847('0x38')]=qs['sort'](_0x2e6d93[_0x0847('0x31')][_0x0847('0x39')]);_0x22f30a[_0x0847('0x3c')]=qs[_0x0847('0x32')](_[_0x0847('0x3a')](_0x2e6d93[_0x0847('0x31')],_0x3f0a86[_0x0847('0x32')]));if(_0x2e6d93[_0x0847('0x31')][_0x0847('0x3b')]){_0x22f30a['where']=_[_0x0847('0x3d')](_0x22f30a[_0x0847('0x3c')],{'$or':_[_0x0847('0x2b')](_0x22f30a[_0x0847('0x35')],function(_0x4feb65){var _0x32ad17={};_0x32ad17[_0x4feb65]={'$like':'%'+_0x2e6d93[_0x0847('0x31')][_0x0847('0x3b')]+'%'};return _0x32ad17;})});}_0x22f30a=_[_0x0847('0x3d')]({},_0x22f30a,_0x2e6d93[_0x0847('0x3e')]);return _0x18debc['getTags'](_0x22f30a);}})[_0x0847('0x26')](function(_0x16d412){if(_0x16d412){_0x256c11=_0x16d412[_0x0847('0x36')];if(!_0x2e6d93['query'][_0x0847('0x37')](_0x0847('0x4b'))){_0x22f30a[_0x0847('0x1e')]=qs[_0x0847('0x1e')](_0x2e6d93[_0x0847('0x31')][_0x0847('0x1e')]);_0x22f30a[_0x0847('0x20')]=qs[_0x0847('0x20')](_0x2e6d93[_0x0847('0x31')][_0x0847('0x20')]);}return _0x18debc[_0x0847('0x4f')](_0x22f30a);}})[_0x0847('0x26')](function(_0x17a77a){if(_0x17a77a){return _0x17a77a?{'count':_0x256c11,'rows':_0x17a77a}:null;}})['then'](respondWithResult(_0x5ec9e9,null))[_0x0847('0x41')](handleError(_0x5ec9e9,null));};exports[_0x0847('0x51')]=function(_0x147698,_0x5e2836,_0x595e79){if(_0x147698['body']['id']){delete _0x147698[_0x0847('0x48')]['id'];}return db['DeskConfiguration'][_0x0847('0x49')]({'where':{'id':_0x147698[_0x0847('0x43')]['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x5e2836,null))['then'](function(_0x43ce4e){if(_0x43ce4e){return _0x43ce4e[_0x0847('0x51')](_0x147698[_0x0847('0x48')][_0x0847('0x52')]||[]);}return null;})['then'](respondWithResult(_0x5e2836,null))['catch'](handleError(_0x5e2836,null));}; \ No newline at end of file +var _0x4b18=['bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','error','stack','name','send','map','DeskConfiguration','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','rawAttributes','include','options','find','create','body','params','destroy','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x3aed03,_0x539c59){var _0xf0ce2a=function(_0x50366f){while(--_0x50366f){_0x3aed03['push'](_0x3aed03['shift']());}};_0xf0ce2a(++_0x539c59);}(_0x4b18,0x1e2));var _0x84b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x84b1('0x0'));var zipdir=require(_0x84b1('0x1'));var jsonpatch=require(_0x84b1('0x2'));var rp=require('request-promise');var moment=require(_0x84b1('0x3'));var BPromise=require(_0x84b1('0x4'));var Mustache=require(_0x84b1('0x5'));var util=require(_0x84b1('0x6'));var path=require(_0x84b1('0x7'));var sox=require(_0x84b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84b1('0x9'));var _=require(_0x84b1('0xa'));var squel=require(_0x84b1('0xb'));var crypto=require(_0x84b1('0xc'));var jsforce=require(_0x84b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x84b1('0xe'));var querystring=require(_0x84b1('0xf'));var Papa=require('papaparse');var Redis=require(_0x84b1('0x10'));var authService=require(_0x84b1('0x11'));var qs=require(_0x84b1('0x12'));var as=require(_0x84b1('0x13'));var hardwareService=require(_0x84b1('0x14'));var logger=require(_0x84b1('0x15'))(_0x84b1('0x16'));var utils=require(_0x84b1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x84b1('0x18'))['db'];function respondWithStatusCode(_0x585daf,_0x3b4a70){_0x3b4a70=_0x3b4a70||0xcc;return function(_0x253950){if(_0x253950){return _0x585daf[_0x84b1('0x19')](_0x3b4a70);}return _0x585daf[_0x84b1('0x1a')](_0x3b4a70)[_0x84b1('0x1b')]();};}function respondWithResult(_0x48e38c,_0x59fe50){_0x59fe50=_0x59fe50||0xc8;return function(_0x475765){if(_0x475765){return _0x48e38c[_0x84b1('0x1a')](_0x59fe50)[_0x84b1('0x1c')](_0x475765);}};}function respondWithFilteredResult(_0x134c1f,_0x5b3531){return function(_0xc240df){if(_0xc240df){var _0xc7994c=typeof _0x5b3531[_0x84b1('0x1d')]===_0x84b1('0x1e')&&typeof _0x5b3531['limit']===_0x84b1('0x1e');var _0x591c3b=_0xc240df['count'];var _0x382931=_0xc7994c?0x0:_0x5b3531['offset'];var _0x5cd7b0=_0xc7994c?_0xc240df[_0x84b1('0x1f')]:_0x5b3531[_0x84b1('0x1d')]+_0x5b3531[_0x84b1('0x20')];var _0x3f8887;if(_0x5cd7b0>=_0x591c3b){_0x5cd7b0=_0x591c3b;_0x3f8887=0xc8;}else{_0x3f8887=0xce;}_0x134c1f[_0x84b1('0x1a')](_0x3f8887);return _0x134c1f['set'](_0x84b1('0x21'),_0x382931+'-'+_0x5cd7b0+'/'+_0x591c3b)['json'](_0xc240df);}return null;};}function patchUpdates(_0x1001a3){return function(_0x227bfa){try{jsonpatch[_0x84b1('0x22')](_0x227bfa,_0x1001a3,!![]);}catch(_0x4e2aed){return BPromise['reject'](_0x4e2aed);}return _0x227bfa['save']();};}function saveUpdates(_0x193400,_0x3acaf5){return function(_0x292fb3){if(_0x292fb3){return _0x292fb3[_0x84b1('0x23')](_0x193400)[_0x84b1('0x24')](function(_0x5b0de1){return _0x5b0de1;});}return null;};}function removeEntity(_0x431080,_0x229b13){return function(_0x45b5d7){if(_0x45b5d7){return _0x45b5d7['destroy']()[_0x84b1('0x24')](function(){_0x431080['status'](0xcc)[_0x84b1('0x1b')]();});}};}function handleEntityNotFound(_0x40bc71,_0x5202f8){return function(_0x2f49b8){if(!_0x2f49b8){_0x40bc71[_0x84b1('0x19')](0x194);}return _0x2f49b8;};}function handleError(_0x1d5134,_0x51679a){_0x51679a=_0x51679a||0x1f4;return function(_0x598157){logger[_0x84b1('0x25')](_0x598157[_0x84b1('0x26')]);if(_0x598157[_0x84b1('0x27')]){delete _0x598157['name'];}_0x1d5134[_0x84b1('0x1a')](_0x51679a)[_0x84b1('0x28')](_0x598157);};}exports['index']=function(_0x4f0bc2,_0x59e9b3){var _0x53e0cb={},_0x1d049b={},_0x380bca={'count':0x0,'rows':[]};var _0x4f9f21=_[_0x84b1('0x29')](db[_0x84b1('0x2a')]['rawAttributes'],function(_0x252a03){return{'name':_0x252a03[_0x84b1('0x2b')],'type':_0x252a03[_0x84b1('0x2c')]['key']};});_0x1d049b[_0x84b1('0x2d')]=_[_0x84b1('0x29')](_0x4f9f21,_0x84b1('0x27'));_0x1d049b[_0x84b1('0x2e')]=_[_0x84b1('0x2f')](_0x4f0bc2[_0x84b1('0x2e')]);_0x1d049b[_0x84b1('0x30')]=_['intersection'](_0x1d049b[_0x84b1('0x2d')],_0x1d049b[_0x84b1('0x2e')]);_0x53e0cb[_0x84b1('0x31')]=_[_0x84b1('0x32')](_0x1d049b[_0x84b1('0x2d')],qs[_0x84b1('0x33')](_0x4f0bc2[_0x84b1('0x2e')][_0x84b1('0x33')]));_0x53e0cb[_0x84b1('0x31')]=_0x53e0cb['attributes'][_0x84b1('0x34')]?_0x53e0cb[_0x84b1('0x31')]:_0x1d049b['model'];if(!_0x4f0bc2[_0x84b1('0x2e')][_0x84b1('0x35')]('nolimit')){_0x53e0cb[_0x84b1('0x20')]=qs[_0x84b1('0x20')](_0x4f0bc2[_0x84b1('0x2e')][_0x84b1('0x20')]);_0x53e0cb[_0x84b1('0x1d')]=qs[_0x84b1('0x1d')](_0x4f0bc2['query'][_0x84b1('0x1d')]);}_0x53e0cb[_0x84b1('0x36')]=qs[_0x84b1('0x37')](_0x4f0bc2[_0x84b1('0x2e')][_0x84b1('0x37')]);_0x53e0cb[_0x84b1('0x38')]=qs[_0x84b1('0x30')](_[_0x84b1('0x39')](_0x4f0bc2[_0x84b1('0x2e')],_0x1d049b[_0x84b1('0x30')]),_0x4f9f21);if(_0x4f0bc2['query'][_0x84b1('0x3a')]){_0x53e0cb[_0x84b1('0x38')]=_[_0x84b1('0x3b')](_0x53e0cb[_0x84b1('0x38')],{'$or':_['map'](_0x4f9f21,function(_0x5a7e21){if(_0x5a7e21[_0x84b1('0x2c')]!==_0x84b1('0x3c')){var _0x35415b={};_0x35415b[_0x5a7e21[_0x84b1('0x27')]]={'$like':'%'+_0x4f0bc2[_0x84b1('0x2e')]['filter']+'%'};return _0x35415b;}})});}_0x53e0cb=_['merge']({},_0x53e0cb,_0x4f0bc2['options']);var _0x57b515={'where':_0x53e0cb['where']};return db[_0x84b1('0x2a')]['count'](_0x57b515)[_0x84b1('0x24')](function(_0x28ca40){_0x380bca[_0x84b1('0x1f')]=_0x28ca40;if(_0x4f0bc2[_0x84b1('0x2e')][_0x84b1('0x3d')]){_0x53e0cb['include']=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x53e0cb);})[_0x84b1('0x24')](function(_0x42327c){_0x380bca['rows']=_0x42327c;return _0x380bca;})[_0x84b1('0x24')](respondWithFilteredResult(_0x59e9b3,_0x53e0cb))[_0x84b1('0x3e')](handleError(_0x59e9b3,null));};exports[_0x84b1('0x3f')]=function(_0x3b55b4,_0x415ff5){var _0x3085bc={'raw':![],'where':{'id':_0x3b55b4['params']['id']}},_0x3adcfc={};_0x3adcfc[_0x84b1('0x2d')]=_[_0x84b1('0x2f')](db[_0x84b1('0x2a')][_0x84b1('0x40')]);_0x3adcfc[_0x84b1('0x2e')]=_[_0x84b1('0x2f')](_0x3b55b4['query']);_0x3adcfc[_0x84b1('0x30')]=_['intersection'](_0x3adcfc[_0x84b1('0x2d')],_0x3adcfc[_0x84b1('0x2e')]);_0x3085bc[_0x84b1('0x31')]=_[_0x84b1('0x32')](_0x3adcfc[_0x84b1('0x2d')],qs[_0x84b1('0x33')](_0x3b55b4['query'][_0x84b1('0x33')]));_0x3085bc[_0x84b1('0x31')]=_0x3085bc['attributes']['length']?_0x3085bc[_0x84b1('0x31')]:_0x3adcfc[_0x84b1('0x2d')];if(_0x3b55b4['query']['includeAll']){_0x3085bc[_0x84b1('0x41')]=[{'all':!![]}];}_0x3085bc=_[_0x84b1('0x3b')]({},_0x3085bc,_0x3b55b4[_0x84b1('0x42')]);return db[_0x84b1('0x2a')][_0x84b1('0x43')](_0x3085bc)[_0x84b1('0x24')](handleEntityNotFound(_0x415ff5,null))[_0x84b1('0x24')](respondWithResult(_0x415ff5,null))[_0x84b1('0x3e')](handleError(_0x415ff5,null));};exports[_0x84b1('0x44')]=function(_0x571bbf,_0x1ca52b){return db[_0x84b1('0x2a')]['create'](_0x571bbf[_0x84b1('0x45')],{})[_0x84b1('0x24')](respondWithResult(_0x1ca52b,0xc9))[_0x84b1('0x3e')](handleError(_0x1ca52b,null));};exports[_0x84b1('0x23')]=function(_0x1a2d4f,_0x3f8661){if(_0x1a2d4f['body']['id']){delete _0x1a2d4f['body']['id'];}return db[_0x84b1('0x2a')]['find']({'where':{'id':_0x1a2d4f[_0x84b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f8661,null))[_0x84b1('0x24')](saveUpdates(_0x1a2d4f[_0x84b1('0x45')],null))[_0x84b1('0x24')](respondWithResult(_0x3f8661,null))[_0x84b1('0x3e')](handleError(_0x3f8661,null));};exports[_0x84b1('0x47')]=function(_0x50a16a,_0x2b54c5){return db[_0x84b1('0x2a')][_0x84b1('0x43')]({'where':{'id':_0x50a16a[_0x84b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b54c5,null))['then'](removeEntity(_0x2b54c5,null))[_0x84b1('0x3e')](handleError(_0x2b54c5,null));};exports[_0x84b1('0x48')]=function(_0x409afb,_0x2079a6,_0x401164){var _0x332fea={};var _0xafb141={};var _0x2bc54e;var _0x5f44f6;return db[_0x84b1('0x2a')][_0x84b1('0x49')]({'where':{'id':_0x409afb[_0x84b1('0x46')]['id']}})[_0x84b1('0x24')](handleEntityNotFound(_0x2079a6,null))['then'](function(_0xe9366a){if(_0xe9366a){_0x2bc54e=_0xe9366a;_0xafb141['model']=_[_0x84b1('0x2f')](db[_0x84b1('0x4a')]['rawAttributes']);_0xafb141['query']=_[_0x84b1('0x2f')](_0x409afb[_0x84b1('0x2e')]);_0xafb141['filters']=_[_0x84b1('0x32')](_0xafb141[_0x84b1('0x2d')],_0xafb141[_0x84b1('0x2e')]);_0x332fea[_0x84b1('0x31')]=_['intersection'](_0xafb141[_0x84b1('0x2d')],qs['fields'](_0x409afb[_0x84b1('0x2e')][_0x84b1('0x33')]));_0x332fea['attributes']=_0x332fea[_0x84b1('0x31')][_0x84b1('0x34')]?_0x332fea[_0x84b1('0x31')]:_0xafb141[_0x84b1('0x2d')];_0x332fea['order']=qs[_0x84b1('0x37')](_0x409afb[_0x84b1('0x2e')][_0x84b1('0x37')]);_0x332fea['where']=qs[_0x84b1('0x30')](_[_0x84b1('0x39')](_0x409afb[_0x84b1('0x2e')],_0xafb141[_0x84b1('0x30')]));if(_0x409afb[_0x84b1('0x2e')][_0x84b1('0x3a')]){_0x332fea['where']=_[_0x84b1('0x3b')](_0x332fea[_0x84b1('0x38')],{'$or':_[_0x84b1('0x29')](_0x332fea['attributes'],function(_0x27e190){var _0xad7d28={};_0xad7d28[_0x27e190]={'$like':'%'+_0x409afb[_0x84b1('0x2e')][_0x84b1('0x3a')]+'%'};return _0xad7d28;})});}_0x332fea=_[_0x84b1('0x3b')]({},_0x332fea,_0x409afb['options']);return _0x2bc54e['getFields'](_0x332fea);}})[_0x84b1('0x24')](function(_0x3894ab){if(_0x3894ab){_0x5f44f6=_0x3894ab[_0x84b1('0x34')];if(!_0x409afb['query'][_0x84b1('0x35')](_0x84b1('0x4b'))){_0x332fea[_0x84b1('0x20')]=qs[_0x84b1('0x20')](_0x409afb[_0x84b1('0x2e')][_0x84b1('0x20')]);_0x332fea['offset']=qs['offset'](_0x409afb[_0x84b1('0x2e')][_0x84b1('0x1d')]);}return _0x2bc54e['getFields'](_0x332fea);}})[_0x84b1('0x24')](function(_0x7535b9){if(_0x7535b9){return _0x7535b9?{'count':_0x5f44f6,'rows':_0x7535b9}:null;}})[_0x84b1('0x24')](respondWithResult(_0x2079a6,null))[_0x84b1('0x3e')](handleError(_0x2079a6,null));};exports[_0x84b1('0x4c')]=function(_0x115af1,_0x49247e,_0x592d15){var _0x3561e1={};var _0x2d6fb1={};var _0x3597b9;var _0x3fae16;return db[_0x84b1('0x2a')][_0x84b1('0x49')]({'where':{'id':_0x115af1[_0x84b1('0x46')]['id']}})[_0x84b1('0x24')](handleEntityNotFound(_0x49247e,null))[_0x84b1('0x24')](function(_0x3d6520){if(_0x3d6520){_0x3597b9=_0x3d6520;_0x2d6fb1[_0x84b1('0x2d')]=_[_0x84b1('0x2f')](db[_0x84b1('0x4a')][_0x84b1('0x40')]);_0x2d6fb1[_0x84b1('0x2e')]=_['keys'](_0x115af1['query']);_0x2d6fb1[_0x84b1('0x30')]=_[_0x84b1('0x32')](_0x2d6fb1[_0x84b1('0x2d')],_0x2d6fb1[_0x84b1('0x2e')]);_0x3561e1[_0x84b1('0x31')]=_['intersection'](_0x2d6fb1[_0x84b1('0x2d')],qs['fields'](_0x115af1[_0x84b1('0x2e')]['fields']));_0x3561e1[_0x84b1('0x31')]=_0x3561e1[_0x84b1('0x31')][_0x84b1('0x34')]?_0x3561e1[_0x84b1('0x31')]:_0x2d6fb1[_0x84b1('0x2d')];_0x3561e1[_0x84b1('0x36')]=qs['sort'](_0x115af1[_0x84b1('0x2e')][_0x84b1('0x37')]);_0x3561e1[_0x84b1('0x38')]=qs[_0x84b1('0x30')](_[_0x84b1('0x39')](_0x115af1[_0x84b1('0x2e')],_0x2d6fb1['filters']));if(_0x115af1['query']['filter']){_0x3561e1[_0x84b1('0x38')]=_[_0x84b1('0x3b')](_0x3561e1[_0x84b1('0x38')],{'$or':_['map'](_0x3561e1['attributes'],function(_0xcf316d){var _0x48f071={};_0x48f071[_0xcf316d]={'$like':'%'+_0x115af1[_0x84b1('0x2e')][_0x84b1('0x3a')]+'%'};return _0x48f071;})});}_0x3561e1=_[_0x84b1('0x3b')]({},_0x3561e1,_0x115af1[_0x84b1('0x42')]);return _0x3597b9[_0x84b1('0x4c')](_0x3561e1);}})[_0x84b1('0x24')](function(_0x38dd58){if(_0x38dd58){_0x3fae16=_0x38dd58['length'];if(!_0x115af1['query'][_0x84b1('0x35')](_0x84b1('0x4b'))){_0x3561e1['limit']=qs[_0x84b1('0x20')](_0x115af1[_0x84b1('0x2e')][_0x84b1('0x20')]);_0x3561e1[_0x84b1('0x1d')]=qs[_0x84b1('0x1d')](_0x115af1['query'][_0x84b1('0x1d')]);}return _0x3597b9['getSubjects'](_0x3561e1);}})[_0x84b1('0x24')](function(_0x6b0dd6){if(_0x6b0dd6){return _0x6b0dd6?{'count':_0x3fae16,'rows':_0x6b0dd6}:null;}})[_0x84b1('0x24')](respondWithResult(_0x49247e,null))[_0x84b1('0x3e')](handleError(_0x49247e,null));};exports[_0x84b1('0x4d')]=function(_0x44daa7,_0x10f6c9,_0x208060){var _0x24af5d={};var _0x523263={};var _0x26b7af;var _0x2f542d;return db[_0x84b1('0x2a')][_0x84b1('0x49')]({'where':{'id':_0x44daa7[_0x84b1('0x46')]['id']}})[_0x84b1('0x24')](handleEntityNotFound(_0x10f6c9,null))[_0x84b1('0x24')](function(_0x2cd6e8){if(_0x2cd6e8){_0x26b7af=_0x2cd6e8;_0x523263['model']=_[_0x84b1('0x2f')](db[_0x84b1('0x4a')][_0x84b1('0x40')]);_0x523263[_0x84b1('0x2e')]=_[_0x84b1('0x2f')](_0x44daa7['query']);_0x523263[_0x84b1('0x30')]=_[_0x84b1('0x32')](_0x523263[_0x84b1('0x2d')],_0x523263[_0x84b1('0x2e')]);_0x24af5d[_0x84b1('0x31')]=_[_0x84b1('0x32')](_0x523263['model'],qs[_0x84b1('0x33')](_0x44daa7['query']['fields']));_0x24af5d['attributes']=_0x24af5d[_0x84b1('0x31')][_0x84b1('0x34')]?_0x24af5d['attributes']:_0x523263[_0x84b1('0x2d')];_0x24af5d['order']=qs[_0x84b1('0x37')](_0x44daa7[_0x84b1('0x2e')][_0x84b1('0x37')]);_0x24af5d[_0x84b1('0x38')]=qs['filters'](_[_0x84b1('0x39')](_0x44daa7[_0x84b1('0x2e')],_0x523263[_0x84b1('0x30')]));if(_0x44daa7[_0x84b1('0x2e')]['filter']){_0x24af5d['where']=_['merge'](_0x24af5d[_0x84b1('0x38')],{'$or':_[_0x84b1('0x29')](_0x24af5d[_0x84b1('0x31')],function(_0x446299){var _0x48cb97={};_0x48cb97[_0x446299]={'$like':'%'+_0x44daa7[_0x84b1('0x2e')][_0x84b1('0x3a')]+'%'};return _0x48cb97;})});}_0x24af5d=_[_0x84b1('0x3b')]({},_0x24af5d,_0x44daa7[_0x84b1('0x42')]);return _0x26b7af[_0x84b1('0x4d')](_0x24af5d);}})[_0x84b1('0x24')](function(_0x5de5b4){if(_0x5de5b4){_0x2f542d=_0x5de5b4[_0x84b1('0x34')];if(!_0x44daa7[_0x84b1('0x2e')][_0x84b1('0x35')]('nolimit')){_0x24af5d[_0x84b1('0x20')]=qs[_0x84b1('0x20')](_0x44daa7[_0x84b1('0x2e')][_0x84b1('0x20')]);_0x24af5d[_0x84b1('0x1d')]=qs['offset'](_0x44daa7[_0x84b1('0x2e')][_0x84b1('0x1d')]);}return _0x26b7af['getDescriptions'](_0x24af5d);}})[_0x84b1('0x24')](function(_0x11e1bd){if(_0x11e1bd){return _0x11e1bd?{'count':_0x2f542d,'rows':_0x11e1bd}:null;}})[_0x84b1('0x24')](respondWithResult(_0x10f6c9,null))[_0x84b1('0x3e')](handleError(_0x10f6c9,null));};exports[_0x84b1('0x4e')]=function(_0x723549,_0x16d439,_0x125ee6){var _0x5a85b1={};var _0x4abedb={};var _0x2e72d7;var _0x4038f6;return db[_0x84b1('0x2a')]['findOne']({'where':{'id':_0x723549[_0x84b1('0x46')]['id']}})[_0x84b1('0x24')](handleEntityNotFound(_0x16d439,null))[_0x84b1('0x24')](function(_0x5a8430){if(_0x5a8430){_0x2e72d7=_0x5a8430;_0x4abedb[_0x84b1('0x2d')]=_[_0x84b1('0x2f')](db['Tag'][_0x84b1('0x40')]);_0x4abedb[_0x84b1('0x2e')]=_[_0x84b1('0x2f')](_0x723549[_0x84b1('0x2e')]);_0x4abedb[_0x84b1('0x30')]=_[_0x84b1('0x32')](_0x4abedb[_0x84b1('0x2d')],_0x4abedb[_0x84b1('0x2e')]);_0x5a85b1[_0x84b1('0x31')]=_['intersection'](_0x4abedb[_0x84b1('0x2d')],qs[_0x84b1('0x33')](_0x723549[_0x84b1('0x2e')][_0x84b1('0x33')]));_0x5a85b1['attributes']=_0x5a85b1['attributes']['length']?_0x5a85b1[_0x84b1('0x31')]:_0x4abedb[_0x84b1('0x2d')];_0x5a85b1[_0x84b1('0x36')]=qs['sort'](_0x723549['query'][_0x84b1('0x37')]);_0x5a85b1['where']=qs['filters'](_['pick'](_0x723549['query'],_0x4abedb[_0x84b1('0x30')]));if(_0x723549[_0x84b1('0x2e')]['filter']){_0x5a85b1[_0x84b1('0x38')]=_[_0x84b1('0x3b')](_0x5a85b1[_0x84b1('0x38')],{'$or':_[_0x84b1('0x29')](_0x5a85b1['attributes'],function(_0x25cfa7){var _0x284cd3={};_0x284cd3[_0x25cfa7]={'$like':'%'+_0x723549[_0x84b1('0x2e')][_0x84b1('0x3a')]+'%'};return _0x284cd3;})});}_0x5a85b1=_[_0x84b1('0x3b')]({},_0x5a85b1,_0x723549[_0x84b1('0x42')]);return _0x2e72d7['getTags'](_0x5a85b1);}})['then'](function(_0xbdb20){if(_0xbdb20){_0x4038f6=_0xbdb20['length'];if(!_0x723549[_0x84b1('0x2e')]['hasOwnProperty'](_0x84b1('0x4b'))){_0x5a85b1[_0x84b1('0x20')]=qs[_0x84b1('0x20')](_0x723549[_0x84b1('0x2e')][_0x84b1('0x20')]);_0x5a85b1['offset']=qs[_0x84b1('0x1d')](_0x723549[_0x84b1('0x2e')][_0x84b1('0x1d')]);}return _0x2e72d7[_0x84b1('0x4e')](_0x5a85b1);}})[_0x84b1('0x24')](function(_0x5ded0e){if(_0x5ded0e){return _0x5ded0e?{'count':_0x4038f6,'rows':_0x5ded0e}:null;}})[_0x84b1('0x24')](respondWithResult(_0x16d439,null))[_0x84b1('0x3e')](handleError(_0x16d439,null));};exports[_0x84b1('0x4f')]=function(_0x55803c,_0x5cec43,_0x35993d){if(_0x55803c[_0x84b1('0x45')]['id']){delete _0x55803c[_0x84b1('0x45')]['id'];}return db[_0x84b1('0x2a')][_0x84b1('0x49')]({'where':{'id':_0x55803c[_0x84b1('0x46')]['id']}})[_0x84b1('0x24')](handleEntityNotFound(_0x5cec43,null))['then'](function(_0x5075d3){if(_0x5075d3){return _0x5075d3[_0x84b1('0x4f')](_0x55803c[_0x84b1('0x45')][_0x84b1('0x50')]||[]);}return null;})[_0x84b1('0x24')](respondWithResult(_0x5cec43,null))[_0x84b1('0x3e')](handleError(_0x5cec43,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 54b611f..265636a 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 _0xb73b=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xb27e2e,_0x58ee4f){var _0x2d485c=function(_0x5baec5){while(--_0x5baec5){_0xb27e2e['push'](_0xb27e2e['shift']());}};_0x2d485c(++_0x58ee4f);}(_0xb73b,0xfe));var _0xbb73=function(_0x396248,_0x5b7ff2){_0x396248=_0x396248-0x0;var _0x568f77=_0xb73b[_0x396248];return _0x568f77;};'use strict';var _=require(_0xbb73('0x0'));var util=require(_0xbb73('0x1'));var logger=require(_0xbb73('0x2'))(_0xbb73('0x3'));var moment=require(_0xbb73('0x4'));var BPromise=require(_0xbb73('0x5'));var rp=require(_0xbb73('0x6'));var fs=require('fs');var path=require(_0xbb73('0x7'));var rimraf=require(_0xbb73('0x8'));var config=require(_0xbb73('0x9'));var attributes=require(_0xbb73('0xa'));module['exports']=function(_0x36f7de,_0x1c72b8){return _0x36f7de['define'](_0xbb73('0xb'),attributes,{'tableName':_0xbb73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ed7=['request-promise','path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','lodash','util','../../config/logger','moment','bluebird'];(function(_0x410cd9,_0xc5d240){var _0x2242ae=function(_0xbf5271){while(--_0xbf5271){_0x410cd9['push'](_0x410cd9['shift']());}};_0x2242ae(++_0xc5d240);}(_0x5ed7,0x119));var _0x75ed=function(_0xbc3f15,_0x173104){_0xbc3f15=_0xbc3f15-0x0;var _0x28ad0b=_0x5ed7[_0xbc3f15];return _0x28ad0b;};'use strict';var _=require(_0x75ed('0x0'));var util=require(_0x75ed('0x1'));var logger=require(_0x75ed('0x2'))('api');var moment=require(_0x75ed('0x3'));var BPromise=require(_0x75ed('0x4'));var rp=require(_0x75ed('0x5'));var fs=require('fs');var path=require(_0x75ed('0x6'));var rimraf=require(_0x75ed('0x7'));var config=require('../../config/environment');var attributes=require(_0x75ed('0x8'));module['exports']=function(_0x3bbb6c,_0x38c4e9){return _0x3bbb6c[_0x75ed('0x9')](_0x75ed('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 29efe48..a955d62 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 _0x866a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0xa15443,_0x5e0ccc){var _0xa77ee8=function(_0x35d1d6){while(--_0x35d1d6){_0xa15443['push'](_0xa15443['shift']());}};_0xa77ee8(++_0x5e0ccc);}(_0x866a,0x156));var _0xa866=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0x866a[_0x517c2e];return _0x5d4029;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var moment=require(_0xa866('0x1'));var BPromise=require(_0xa866('0x2'));var rs=require(_0xa866('0x3'));var fs=require('fs');var Redis=require(_0xa866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa866('0x5'));var logger=require(_0xa866('0x6'))(_0xa866('0x7'));var config=require('../../config/environment');var jayson=require(_0xa866('0x8'));var client=jayson[_0xa866('0x9')][_0xa866('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288582,_0x3d1380,_0x2c7278){return new BPromise(function(_0x41a92a,_0x208625){return client[_0xa866('0xb')](_0x288582,_0x2c7278)[_0xa866('0xc')](function(_0x525ce6){logger[_0xa866('0xd')](_0xa866('0xe'),_0x3d1380,_0xa866('0xf'));logger['debug'](_0xa866('0x10'),_0x3d1380,_0xa866('0xf'),JSON[_0xa866('0x11')](_0x525ce6));if(_0x525ce6[_0xa866('0x12')]){if(_0x525ce6[_0xa866('0x12')][_0xa866('0x13')]===0x1f4){logger['error'](_0xa866('0xe'),_0x3d1380,_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);return _0x208625(_0x525ce6[_0xa866('0x12')]['message']);}logger[_0xa866('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3d1380,_0x525ce6[_0xa866('0x12')]['message']);return _0x41a92a(_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);}else{logger[_0xa866('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3d1380,_0xa866('0xf'));_0x41a92a(_0x525ce6[_0xa866('0x15')][_0xa866('0x14')]);}})[_0xa866('0x16')](function(_0x1e2211){logger[_0xa866('0x12')](_0xa866('0xe'),_0x3d1380,_0x1e2211);_0x208625(_0x1e2211);});});} \ No newline at end of file +var _0x6478=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x54f978,_0x3a6b7e){var _0x5d40b3=function(_0x44b545){while(--_0x44b545){_0x54f978['push'](_0x54f978['shift']());}};_0x5d40b3(++_0x3a6b7e);}(_0x6478,0x1e7));var _0x8647=function(_0x2e8cb9,_0x1c9469){_0x2e8cb9=_0x2e8cb9-0x0;var _0x152762=_0x6478[_0x2e8cb9];return _0x152762;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var moment=require(_0x8647('0x2'));var BPromise=require(_0x8647('0x3'));var rs=require(_0x8647('0x4'));var fs=require('fs');var Redis=require(_0x8647('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8647('0x6'));var logger=require(_0x8647('0x7'))(_0x8647('0x8'));var config=require(_0x8647('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8647('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef3f8,_0x172a25,_0x41aaea){return new BPromise(function(_0x3abf85,_0x8768d6){return client[_0x8647('0xb')](_0x5ef3f8,_0x41aaea)[_0x8647('0xc')](function(_0x430976){logger[_0x8647('0xd')](_0x8647('0xe'),_0x172a25,_0x8647('0xf'));logger[_0x8647('0x10')](_0x8647('0x11'),_0x172a25,_0x8647('0xf'),JSON[_0x8647('0x12')](_0x430976));if(_0x430976[_0x8647('0x13')]){if(_0x430976[_0x8647('0x13')][_0x8647('0x14')]===0x1f4){logger['error'](_0x8647('0xe'),_0x172a25,_0x430976['error'][_0x8647('0x15')]);return _0x8768d6(_0x430976[_0x8647('0x13')][_0x8647('0x15')]);}logger[_0x8647('0x13')](_0x8647('0xe'),_0x172a25,_0x430976['error'][_0x8647('0x15')]);return _0x3abf85(_0x430976[_0x8647('0x13')][_0x8647('0x15')]);}else{logger[_0x8647('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x172a25,'request\x20sent');_0x3abf85(_0x430976[_0x8647('0x16')][_0x8647('0x15')]);}})[_0x8647('0x17')](function(_0x390d4d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x172a25,_0x390d4d);_0x8768d6(_0x390d4d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 3d8915d..3917b84 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 _0xf524=['post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated'];(function(_0x38f5dd,_0x14d7ed){var _0x322f3a=function(_0x457f4d){while(--_0x457f4d){_0x38f5dd['push'](_0x38f5dd['shift']());}};_0x322f3a(++_0x14d7ed);}(_0xf524,0x16b));var _0x4f52=function(_0x4e3ffc,_0x570704){_0x4e3ffc=_0x4e3ffc-0x0;var _0x543119=_0xf524[_0x4e3ffc];return _0x543119;};'use strict';var multer=require('multer');var util=require(_0x4f52('0x0'));var path=require(_0x4f52('0x1'));var timeout=require(_0x4f52('0x2'));var express=require('express');var router=express[_0x4f52('0x3')]();var fs_extra=require(_0x4f52('0x4'));var auth=require(_0x4f52('0x5'));var interaction=require(_0x4f52('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4f52('0x7')]);router[_0x4f52('0x8')](_0x4f52('0x9'),auth[_0x4f52('0xa')](),controller['show']);router[_0x4f52('0xb')]('/',auth[_0x4f52('0xa')](),controller[_0x4f52('0xc')]);router[_0x4f52('0xd')]('/:id',auth[_0x4f52('0xa')](),controller[_0x4f52('0xe')]);router['delete'](_0x4f52('0x9'),auth[_0x4f52('0xa')](),controller[_0x4f52('0xf')]);module[_0x4f52('0x10')]=router; \ No newline at end of file +var _0x2439=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','update','delete'];(function(_0x4af687,_0x1e8ffc){var _0x37e4af=function(_0x564d5a){while(--_0x564d5a){_0x4af687['push'](_0x4af687['shift']());}};_0x37e4af(++_0x1e8ffc);}(_0x2439,0x155));var _0x9243=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x2439[_0x241424];return _0x3da798;};'use strict';var multer=require(_0x9243('0x0'));var util=require(_0x9243('0x1'));var path=require(_0x9243('0x2'));var timeout=require(_0x9243('0x3'));var express=require(_0x9243('0x4'));var router=express[_0x9243('0x5')]();var fs_extra=require(_0x9243('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9243('0x7'));var config=require('../../config/environment');var controller=require(_0x9243('0x8'));router[_0x9243('0x9')]('/',auth[_0x9243('0xa')](),controller[_0x9243('0xb')]);router[_0x9243('0x9')](_0x9243('0xc'),auth[_0x9243('0xa')](),controller[_0x9243('0xd')]);router['post']('/',auth[_0x9243('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9243('0xe')]);router[_0x9243('0xf')](_0x9243('0xc'),auth[_0x9243('0xa')](),controller['destroy']);module[_0x9243('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 540472d..0a995db 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 _0x890a=['picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x326bdd,_0x4c47b9){var _0x5ecae0=function(_0x2bb0a1){while(--_0x2bb0a1){_0x326bdd['push'](_0x326bdd['shift']());}};_0x5ecae0(++_0x4c47b9);}(_0x890a,0x140));var _0xa890=function(_0x437e3f,_0x267c39){_0x437e3f=_0x437e3f-0x0;var _0xc00df7=_0x890a[_0x437e3f];return _0xc00df7;};'use strict';var Sequelize=require(_0xa890('0x0'));module[_0xa890('0x1')]={'type':{'type':Sequelize[_0xa890('0x2')](_0xa890('0x3'),'variable','customVariable','keyValue',_0xa890('0x4')),'defaultValue':_0xa890('0x3')},'content':{'type':Sequelize[_0xa890('0x5')]},'key':{'type':Sequelize[_0xa890('0x5')]},'keyType':{'type':Sequelize[_0xa890('0x2')](_0xa890('0x3'),_0xa890('0x6'),_0xa890('0x7'))},'keyContent':{'type':Sequelize[_0xa890('0x5')]},'idField':{'type':Sequelize[_0xa890('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa890('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdeeb=['string','picklist','STRING','variable','sequelize','ENUM'];(function(_0x6a31b3,_0x42bea0){var _0x1278fb=function(_0x3a4d84){while(--_0x3a4d84){_0x6a31b3['push'](_0x6a31b3['shift']());}};_0x1278fb(++_0x42bea0);}(_0xdeeb,0x14e));var _0xbdee=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xdeeb[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0xbdee('0x0'));module['exports']={'type':{'type':Sequelize[_0xbdee('0x1')](_0xbdee('0x2'),'variable','customVariable','keyValue',_0xbdee('0x3')),'defaultValue':_0xbdee('0x2')},'content':{'type':Sequelize[_0xbdee('0x4')]},'key':{'type':Sequelize[_0xbdee('0x4')]},'keyType':{'type':Sequelize[_0xbdee('0x1')](_0xbdee('0x2'),_0xbdee('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0xbdee('0x4')]},'idField':{'type':Sequelize[_0xbdee('0x4')]},'nameField':{'type':Sequelize[_0xbdee('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbdee('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index fa92402..2eb8dfe 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 _0x0909=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','index','map','DeskField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','update','find','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0909,0x1e6));var _0x9090=function(_0x4073fd,_0x504478){_0x4073fd=_0x4073fd-0x0;var _0x4c59f8=_0x0909[_0x4073fd];return _0x4c59f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9090('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9090('0x1'));var moment=require(_0x9090('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9090('0x3'));var util=require(_0x9090('0x4'));var path=require(_0x9090('0x5'));var sox=require('sox');var csv=require(_0x9090('0x6'));var ejs=require(_0x9090('0x7'));var fs=require('fs');var fs_extra=require(_0x9090('0x8'));var _=require(_0x9090('0x9'));var squel=require(_0x9090('0xa'));var crypto=require('crypto');var jsforce=require(_0x9090('0xb'));var deskjs=require(_0x9090('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9090('0xd'));var Redis=require(_0x9090('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9090('0xf'));var as=require(_0x9090('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9090('0x11'))(_0x9090('0x12'));var utils=require(_0x9090('0x13'));var config=require(_0x9090('0x14'));var licenseUtil=require(_0x9090('0x15'));var db=require(_0x9090('0x16'))['db'];function respondWithStatusCode(_0x13a0f7,_0x344ece){_0x344ece=_0x344ece||0xcc;return function(_0x388e95){if(_0x388e95){return _0x13a0f7[_0x9090('0x17')](_0x344ece);}return _0x13a0f7[_0x9090('0x18')](_0x344ece)[_0x9090('0x19')]();};}function respondWithResult(_0x17ce4b,_0x54e660){_0x54e660=_0x54e660||0xc8;return function(_0x38ebd6){if(_0x38ebd6){return _0x17ce4b['status'](_0x54e660)[_0x9090('0x1a')](_0x38ebd6);}};}function respondWithFilteredResult(_0x23988a,_0x1ffee1){return function(_0x29bc4c){if(_0x29bc4c){var _0x3baf1c=typeof _0x1ffee1[_0x9090('0x1b')]===_0x9090('0x1c')&&typeof _0x1ffee1[_0x9090('0x1d')]==='undefined';var _0x1c17f2=_0x29bc4c['count'];var _0x238954=_0x3baf1c?0x0:_0x1ffee1[_0x9090('0x1b')];var _0x173af4=_0x3baf1c?_0x29bc4c[_0x9090('0x1e')]:_0x1ffee1[_0x9090('0x1b')]+_0x1ffee1['limit'];var _0x86110a;if(_0x173af4>=_0x1c17f2){_0x173af4=_0x1c17f2;_0x86110a=0xc8;}else{_0x86110a=0xce;}_0x23988a[_0x9090('0x18')](_0x86110a);return _0x23988a[_0x9090('0x1f')](_0x9090('0x20'),_0x238954+'-'+_0x173af4+'/'+_0x1c17f2)[_0x9090('0x1a')](_0x29bc4c);}return null;};}function patchUpdates(_0x576d9b){return function(_0x1c272b){try{jsonpatch[_0x9090('0x21')](_0x1c272b,_0x576d9b,!![]);}catch(_0x8e92ba){return BPromise[_0x9090('0x22')](_0x8e92ba);}return _0x1c272b['save']();};}function saveUpdates(_0x4636f4,_0x517292){return function(_0x3b8f41){if(_0x3b8f41){return _0x3b8f41['update'](_0x4636f4)[_0x9090('0x23')](function(_0x2ae395){return _0x2ae395;});}return null;};}function removeEntity(_0xb2e55c,_0x54a3cf){return function(_0x44bbab){if(_0x44bbab){return _0x44bbab[_0x9090('0x24')]()['then'](function(){_0xb2e55c[_0x9090('0x18')](0xcc)[_0x9090('0x19')]();});}};}function handleEntityNotFound(_0x3ae049,_0x4eb56b){return function(_0x1f2596){if(!_0x1f2596){_0x3ae049['sendStatus'](0x194);}return _0x1f2596;};}function handleError(_0x3f3dd1,_0x164f95){_0x164f95=_0x164f95||0x1f4;return function(_0x891d29){logger[_0x9090('0x25')](_0x891d29['stack']);if(_0x891d29['name']){delete _0x891d29[_0x9090('0x26')];}_0x3f3dd1[_0x9090('0x18')](_0x164f95)['send'](_0x891d29);};}exports[_0x9090('0x27')]=function(_0x128086,_0x1ee541){var _0x3ad1d3={},_0x54e41e={},_0x17c926={'count':0x0,'rows':[]};var _0xf35cac=_[_0x9090('0x28')](db[_0x9090('0x29')][_0x9090('0x2a')],function(_0x2188ae){return{'name':_0x2188ae['fieldName'],'type':_0x2188ae[_0x9090('0x2b')][_0x9090('0x2c')]};});_0x54e41e[_0x9090('0x2d')]=_[_0x9090('0x28')](_0xf35cac,_0x9090('0x26'));_0x54e41e[_0x9090('0x2e')]=_[_0x9090('0x2f')](_0x128086[_0x9090('0x2e')]);_0x54e41e[_0x9090('0x30')]=_['intersection'](_0x54e41e[_0x9090('0x2d')],_0x54e41e[_0x9090('0x2e')]);_0x3ad1d3[_0x9090('0x31')]=_[_0x9090('0x32')](_0x54e41e[_0x9090('0x2d')],qs[_0x9090('0x33')](_0x128086[_0x9090('0x2e')]['fields']));_0x3ad1d3['attributes']=_0x3ad1d3[_0x9090('0x31')]['length']?_0x3ad1d3[_0x9090('0x31')]:_0x54e41e[_0x9090('0x2d')];if(!_0x128086[_0x9090('0x2e')][_0x9090('0x34')](_0x9090('0x35'))){_0x3ad1d3[_0x9090('0x1d')]=qs[_0x9090('0x1d')](_0x128086['query']['limit']);_0x3ad1d3[_0x9090('0x1b')]=qs[_0x9090('0x1b')](_0x128086['query']['offset']);}_0x3ad1d3[_0x9090('0x36')]=qs[_0x9090('0x37')](_0x128086[_0x9090('0x2e')][_0x9090('0x37')]);_0x3ad1d3[_0x9090('0x38')]=qs[_0x9090('0x30')](_[_0x9090('0x39')](_0x128086[_0x9090('0x2e')],_0x54e41e[_0x9090('0x30')]),_0xf35cac);if(_0x128086[_0x9090('0x2e')][_0x9090('0x3a')]){_0x3ad1d3[_0x9090('0x38')]=_[_0x9090('0x3b')](_0x3ad1d3[_0x9090('0x38')],{'$or':_[_0x9090('0x28')](_0xf35cac,function(_0x2fa549){if(_0x2fa549[_0x9090('0x2b')]!==_0x9090('0x3c')){var _0x106649={};_0x106649[_0x2fa549[_0x9090('0x26')]]={'$like':'%'+_0x128086[_0x9090('0x2e')][_0x9090('0x3a')]+'%'};return _0x106649;}})});}_0x3ad1d3=_[_0x9090('0x3b')]({},_0x3ad1d3,_0x128086[_0x9090('0x3d')]);var _0x319136={'where':_0x3ad1d3[_0x9090('0x38')]};return db['DeskField'][_0x9090('0x1e')](_0x319136)[_0x9090('0x23')](function(_0x134213){_0x17c926[_0x9090('0x1e')]=_0x134213;if(_0x128086['query']['includeAll']){_0x3ad1d3[_0x9090('0x3e')]=[{'all':!![]}];}return db[_0x9090('0x29')]['findAll'](_0x3ad1d3);})[_0x9090('0x23')](function(_0x3e44b0){_0x17c926[_0x9090('0x3f')]=_0x3e44b0;return _0x17c926;})['then'](respondWithFilteredResult(_0x1ee541,_0x3ad1d3))[_0x9090('0x40')](handleError(_0x1ee541,null));};exports[_0x9090('0x41')]=function(_0x31bb6d,_0x37f957){var _0x5b0228={'raw':!![],'where':{'id':_0x31bb6d[_0x9090('0x42')]['id']}},_0x15dd5f={};_0x15dd5f[_0x9090('0x2d')]=_[_0x9090('0x2f')](db['DeskField'][_0x9090('0x2a')]);_0x15dd5f[_0x9090('0x2e')]=_[_0x9090('0x2f')](_0x31bb6d['query']);_0x15dd5f['filters']=_[_0x9090('0x32')](_0x15dd5f[_0x9090('0x2d')],_0x15dd5f[_0x9090('0x2e')]);_0x5b0228[_0x9090('0x31')]=_[_0x9090('0x32')](_0x15dd5f[_0x9090('0x2d')],qs[_0x9090('0x33')](_0x31bb6d['query'][_0x9090('0x33')]));_0x5b0228[_0x9090('0x31')]=_0x5b0228[_0x9090('0x31')]['length']?_0x5b0228[_0x9090('0x31')]:_0x15dd5f[_0x9090('0x2d')];if(_0x31bb6d[_0x9090('0x2e')][_0x9090('0x43')]){_0x5b0228[_0x9090('0x3e')]=[{'all':!![]}];}_0x5b0228=_[_0x9090('0x3b')]({},_0x5b0228,_0x31bb6d[_0x9090('0x3d')]);return db[_0x9090('0x29')]['find'](_0x5b0228)[_0x9090('0x23')](handleEntityNotFound(_0x37f957,null))[_0x9090('0x23')](respondWithResult(_0x37f957,null))[_0x9090('0x40')](handleError(_0x37f957,null));};exports[_0x9090('0x44')]=function(_0x505f68,_0x390ab5){return db[_0x9090('0x29')][_0x9090('0x44')](_0x505f68[_0x9090('0x45')],{})[_0x9090('0x23')](respondWithResult(_0x390ab5,0xc9))['catch'](handleError(_0x390ab5,null));};exports[_0x9090('0x46')]=function(_0x111ee9,_0x1c843b){if(_0x111ee9['body']['id']){delete _0x111ee9[_0x9090('0x45')]['id'];}return db[_0x9090('0x29')][_0x9090('0x47')]({'where':{'id':_0x111ee9[_0x9090('0x42')]['id']}})[_0x9090('0x23')](handleEntityNotFound(_0x1c843b,null))['then'](saveUpdates(_0x111ee9[_0x9090('0x45')],null))['then'](respondWithResult(_0x1c843b,null))[_0x9090('0x40')](handleError(_0x1c843b,null));};exports[_0x9090('0x24')]=function(_0x580a73,_0x573aac){return db[_0x9090('0x29')][_0x9090('0x47')]({'where':{'id':_0x580a73[_0x9090('0x42')]['id']}})[_0x9090('0x23')](handleEntityNotFound(_0x573aac,null))[_0x9090('0x23')](removeEntity(_0x573aac,null))[_0x9090('0x40')](handleError(_0x573aac,null));}; \ No newline at end of file +var _0x0ec6=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','index','rawAttributes','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','options','DeskField','then','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x2e6dfb,_0x319a2b){var _0x54dece=function(_0x1399f1){while(--_0x1399f1){_0x2e6dfb['push'](_0x2e6dfb['shift']());}};_0x54dece(++_0x319a2b);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x2a797a,_0x11420f){_0x2a797a=_0x2a797a-0x0;var _0x3954d8=_0x0ec6[_0x2a797a];return _0x3954d8;};'use strict';var emlformat=require(_0x60ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ec('0x1'));var rp=require(_0x60ec('0x2'));var moment=require(_0x60ec('0x3'));var BPromise=require(_0x60ec('0x4'));var Mustache=require(_0x60ec('0x5'));var util=require(_0x60ec('0x6'));var path=require(_0x60ec('0x7'));var sox=require('sox');var csv=require(_0x60ec('0x8'));var ejs=require(_0x60ec('0x9'));var fs=require('fs');var fs_extra=require(_0x60ec('0xa'));var _=require(_0x60ec('0xb'));var squel=require('squel');var crypto=require(_0x60ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60ec('0xd'));var toCsv=require(_0x60ec('0x8'));var querystring=require(_0x60ec('0xe'));var Papa=require(_0x60ec('0xf'));var Redis=require(_0x60ec('0x10'));var authService=require(_0x60ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60ec('0x12'));var logger=require(_0x60ec('0x13'))(_0x60ec('0x14'));var utils=require(_0x60ec('0x15'));var config=require(_0x60ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28cabb,_0x41621a){_0x41621a=_0x41621a||0xcc;return function(_0x103a72){if(_0x103a72){return _0x28cabb[_0x60ec('0x17')](_0x41621a);}return _0x28cabb[_0x60ec('0x18')](_0x41621a)['end']();};}function respondWithResult(_0x21af57,_0x456fb5){_0x456fb5=_0x456fb5||0xc8;return function(_0x22fdb1){if(_0x22fdb1){return _0x21af57[_0x60ec('0x18')](_0x456fb5)[_0x60ec('0x19')](_0x22fdb1);}};}function respondWithFilteredResult(_0x23298f,_0x1f7c76){return function(_0x19dd55){if(_0x19dd55){var _0x448553=typeof _0x1f7c76['offset']===_0x60ec('0x1a')&&typeof _0x1f7c76[_0x60ec('0x1b')]===_0x60ec('0x1a');var _0x155bdc=_0x19dd55[_0x60ec('0x1c')];var _0x222c38=_0x448553?0x0:_0x1f7c76[_0x60ec('0x1d')];var _0x13052c=_0x448553?_0x19dd55[_0x60ec('0x1c')]:_0x1f7c76[_0x60ec('0x1d')]+_0x1f7c76[_0x60ec('0x1b')];var _0x1bdc45;if(_0x13052c>=_0x155bdc){_0x13052c=_0x155bdc;_0x1bdc45=0xc8;}else{_0x1bdc45=0xce;}_0x23298f['status'](_0x1bdc45);return _0x23298f[_0x60ec('0x1e')](_0x60ec('0x1f'),_0x222c38+'-'+_0x13052c+'/'+_0x155bdc)[_0x60ec('0x19')](_0x19dd55);}return null;};}function patchUpdates(_0x278ae3){return function(_0x5cace8){try{jsonpatch[_0x60ec('0x20')](_0x5cace8,_0x278ae3,!![]);}catch(_0x3e152c){return BPromise[_0x60ec('0x21')](_0x3e152c);}return _0x5cace8[_0x60ec('0x22')]();};}function saveUpdates(_0x3ab7ef,_0x354f08){return function(_0x492dfa){if(_0x492dfa){return _0x492dfa['update'](_0x3ab7ef)['then'](function(_0x1476c6){return _0x1476c6;});}return null;};}function removeEntity(_0x1080c0,_0x1f0ce7){return function(_0x1fd96e){if(_0x1fd96e){return _0x1fd96e['destroy']()['then'](function(){_0x1080c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x317b9a,_0x474374){return function(_0x42d1c2){if(!_0x42d1c2){_0x317b9a[_0x60ec('0x17')](0x194);}return _0x42d1c2;};}function handleError(_0xd4ac40,_0x3d31b7){_0x3d31b7=_0x3d31b7||0x1f4;return function(_0x155c82){logger[_0x60ec('0x23')](_0x155c82[_0x60ec('0x24')]);if(_0x155c82['name']){delete _0x155c82[_0x60ec('0x25')];}_0xd4ac40[_0x60ec('0x18')](_0x3d31b7)[_0x60ec('0x26')](_0x155c82);};}exports[_0x60ec('0x27')]=function(_0xf3817d,_0x3423fb){var _0x1b912c={},_0x4440c7={},_0x24153c={'count':0x0,'rows':[]};var _0x42a5f2=_['map'](db['DeskField'][_0x60ec('0x28')],function(_0x2df6ba){return{'name':_0x2df6ba['fieldName'],'type':_0x2df6ba['type'][_0x60ec('0x29')]};});_0x4440c7['model']=_[_0x60ec('0x2a')](_0x42a5f2,_0x60ec('0x25'));_0x4440c7[_0x60ec('0x2b')]=_[_0x60ec('0x2c')](_0xf3817d[_0x60ec('0x2b')]);_0x4440c7['filters']=_[_0x60ec('0x2d')](_0x4440c7[_0x60ec('0x2e')],_0x4440c7[_0x60ec('0x2b')]);_0x1b912c[_0x60ec('0x2f')]=_[_0x60ec('0x2d')](_0x4440c7[_0x60ec('0x2e')],qs['fields'](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x30')]));_0x1b912c['attributes']=_0x1b912c[_0x60ec('0x2f')][_0x60ec('0x31')]?_0x1b912c[_0x60ec('0x2f')]:_0x4440c7[_0x60ec('0x2e')];if(!_0xf3817d['query'][_0x60ec('0x32')](_0x60ec('0x33'))){_0x1b912c[_0x60ec('0x1b')]=qs[_0x60ec('0x1b')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x1b')]);_0x1b912c[_0x60ec('0x1d')]=qs[_0x60ec('0x1d')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x1d')]);}_0x1b912c[_0x60ec('0x34')]=qs[_0x60ec('0x35')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x35')]);_0x1b912c[_0x60ec('0x36')]=qs[_0x60ec('0x37')](_[_0x60ec('0x38')](_0xf3817d['query'],_0x4440c7[_0x60ec('0x37')]),_0x42a5f2);if(_0xf3817d[_0x60ec('0x2b')]['filter']){_0x1b912c[_0x60ec('0x36')]=_['merge'](_0x1b912c[_0x60ec('0x36')],{'$or':_[_0x60ec('0x2a')](_0x42a5f2,function(_0x1b11fd){if(_0x1b11fd[_0x60ec('0x39')]!==_0x60ec('0x3a')){var _0x1bc7f8={};_0x1bc7f8[_0x1b11fd[_0x60ec('0x25')]]={'$like':'%'+_0xf3817d['query']['filter']+'%'};return _0x1bc7f8;}})});}_0x1b912c=_['merge']({},_0x1b912c,_0xf3817d[_0x60ec('0x3b')]);var _0x569b81={'where':_0x1b912c[_0x60ec('0x36')]};return db[_0x60ec('0x3c')]['count'](_0x569b81)[_0x60ec('0x3d')](function(_0x4fa000){_0x24153c['count']=_0x4fa000;if(_0xf3817d['query'][_0x60ec('0x3e')]){_0x1b912c[_0x60ec('0x3f')]=[{'all':!![]}];}return db[_0x60ec('0x3c')][_0x60ec('0x40')](_0x1b912c);})['then'](function(_0x3bb831){_0x24153c[_0x60ec('0x41')]=_0x3bb831;return _0x24153c;})[_0x60ec('0x3d')](respondWithFilteredResult(_0x3423fb,_0x1b912c))[_0x60ec('0x42')](handleError(_0x3423fb,null));};exports[_0x60ec('0x43')]=function(_0x3d3923,_0x355fe8){var _0x1e6662={'raw':!![],'where':{'id':_0x3d3923[_0x60ec('0x44')]['id']}},_0xf76d37={};_0xf76d37[_0x60ec('0x2e')]=_[_0x60ec('0x2c')](db[_0x60ec('0x3c')][_0x60ec('0x28')]);_0xf76d37['query']=_[_0x60ec('0x2c')](_0x3d3923[_0x60ec('0x2b')]);_0xf76d37['filters']=_[_0x60ec('0x2d')](_0xf76d37['model'],_0xf76d37[_0x60ec('0x2b')]);_0x1e6662[_0x60ec('0x2f')]=_[_0x60ec('0x2d')](_0xf76d37[_0x60ec('0x2e')],qs[_0x60ec('0x30')](_0x3d3923['query'][_0x60ec('0x30')]));_0x1e6662['attributes']=_0x1e6662[_0x60ec('0x2f')][_0x60ec('0x31')]?_0x1e6662[_0x60ec('0x2f')]:_0xf76d37[_0x60ec('0x2e')];if(_0x3d3923[_0x60ec('0x2b')]['includeAll']){_0x1e6662[_0x60ec('0x3f')]=[{'all':!![]}];}_0x1e6662=_['merge']({},_0x1e6662,_0x3d3923[_0x60ec('0x3b')]);return db[_0x60ec('0x3c')]['find'](_0x1e6662)['then'](handleEntityNotFound(_0x355fe8,null))[_0x60ec('0x3d')](respondWithResult(_0x355fe8,null))[_0x60ec('0x42')](handleError(_0x355fe8,null));};exports[_0x60ec('0x45')]=function(_0xc7face,_0x39bec5){return db[_0x60ec('0x3c')][_0x60ec('0x45')](_0xc7face[_0x60ec('0x46')],{})[_0x60ec('0x3d')](respondWithResult(_0x39bec5,0xc9))[_0x60ec('0x42')](handleError(_0x39bec5,null));};exports[_0x60ec('0x47')]=function(_0x3c10af,_0x43bfcf){if(_0x3c10af[_0x60ec('0x46')]['id']){delete _0x3c10af[_0x60ec('0x46')]['id'];}return db['DeskField'][_0x60ec('0x48')]({'where':{'id':_0x3c10af[_0x60ec('0x44')]['id']}})[_0x60ec('0x3d')](handleEntityNotFound(_0x43bfcf,null))[_0x60ec('0x3d')](saveUpdates(_0x3c10af[_0x60ec('0x46')],null))['then'](respondWithResult(_0x43bfcf,null))[_0x60ec('0x42')](handleError(_0x43bfcf,null));};exports['destroy']=function(_0x3ce66e,_0x1265fa){return db['DeskField'][_0x60ec('0x48')]({'where':{'id':_0x3ce66e[_0x60ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x1265fa,null))['then'](removeEntity(_0x1265fa,null))[_0x60ec('0x42')](handleError(_0x1265fa,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c013ad5..a2f1127 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 _0x506f=['../../config/logger','api','bluebird','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util'];(function(_0x1280f8,_0x40e8c7){var _0x51cea5=function(_0xca66ee){while(--_0xca66ee){_0x1280f8['push'](_0x1280f8['shift']());}};_0x51cea5(++_0x40e8c7);}(_0x506f,0x17f));var _0xf506=function(_0x548338,_0x29ad91){_0x548338=_0x548338-0x0;var _0x13d080=_0x506f[_0x548338];return _0x13d080;};'use strict';var _=require(_0xf506('0x0'));var util=require(_0xf506('0x1'));var logger=require(_0xf506('0x2'))(_0xf506('0x3'));var moment=require('moment');var BPromise=require(_0xf506('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(_0xf506('0x5'));module['exports']=function(_0x16f825,_0x15c4bd){return _0x16f825[_0xf506('0x6')](_0xf506('0x7'),attributes,{'tableName':_0xf506('0x8'),'paranoid':![],'indexes':[{'name':_0xf506('0x9'),'fields':['idField',_0xf506('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf409=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','idField'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0xf409,0x189));var _0x9f40=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf409[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x9f40('0x0'));var util=require(_0x9f40('0x1'));var logger=require(_0x9f40('0x2'))('api');var moment=require(_0x9f40('0x3'));var BPromise=require(_0x9f40('0x4'));var rp=require(_0x9f40('0x5'));var fs=require('fs');var path=require(_0x9f40('0x6'));var rimraf=require(_0x9f40('0x7'));var config=require(_0x9f40('0x8'));var attributes=require(_0x9f40('0x9'));module['exports']=function(_0x1ef2ec,_0x3e6f3c){return _0x1ef2ec[_0x9f40('0xa')](_0x9f40('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x9f40('0xc'),_0x9f40('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 ed49730..3391552 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 _0x1d63=['../../config/utils','rpc','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis'];(function(_0x66e2cf,_0x58eae6){var _0x2c7c91=function(_0x998579){while(--_0x998579){_0x66e2cf['push'](_0x66e2cf['shift']());}};_0x2c7c91(++_0x58eae6);}(_0x1d63,0x19e));var _0x31d6=function(_0xf65b52,_0x327ab2){_0xf65b52=_0xf65b52-0x0;var _0x5a5d17=_0x1d63[_0xf65b52];return _0x5a5d17;};'use strict';var _=require('lodash');var util=require(_0x31d6('0x0'));var moment=require('moment');var BPromise=require(_0x31d6('0x1'));var rs=require(_0x31d6('0x2'));var fs=require('fs');var Redis=require(_0x31d6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x31d6('0x4'));var logger=require('../../config/logger')(_0x31d6('0x5'));var config=require('../../config/environment');var jayson=require(_0x31d6('0x6'));var client=jayson[_0x31d6('0x7')][_0x31d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x497801,_0x4ab21f,_0x2bb018){return new BPromise(function(_0x7c89bf,_0x5da53d){return client[_0x31d6('0x9')](_0x497801,_0x2bb018)['then'](function(_0x44fbf7){logger[_0x31d6('0xa')](_0x31d6('0xb'),_0x4ab21f,_0x31d6('0xc'));logger[_0x31d6('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4ab21f,_0x31d6('0xc'),JSON[_0x31d6('0xe')](_0x44fbf7));if(_0x44fbf7[_0x31d6('0xf')]){if(_0x44fbf7[_0x31d6('0xf')][_0x31d6('0x10')]===0x1f4){logger[_0x31d6('0xf')]('DeskField,\x20%s,\x20%s',_0x4ab21f,_0x44fbf7[_0x31d6('0xf')][_0x31d6('0x11')]);return _0x5da53d(_0x44fbf7['error'][_0x31d6('0x11')]);}logger['error'](_0x31d6('0xb'),_0x4ab21f,_0x44fbf7[_0x31d6('0xf')][_0x31d6('0x11')]);return _0x7c89bf(_0x44fbf7['error'][_0x31d6('0x11')]);}else{logger['info'](_0x31d6('0xb'),_0x4ab21f,_0x31d6('0xc'));_0x7c89bf(_0x44fbf7['result']['message']);}})[_0x31d6('0x12')](function(_0x5344fb){logger[_0x31d6('0xf')](_0x31d6('0xb'),_0x4ab21f,_0x5344fb);_0x5da53d(_0x5344fb);});});} \ No newline at end of file +var _0x1992=['request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1586b6,_0x477d2e){var _0x2ce821=function(_0x413172){while(--_0x413172){_0x1586b6['push'](_0x1586b6['shift']());}};_0x2ce821(++_0x477d2e);}(_0x1992,0x1c0));var _0x2199=function(_0x40e2b1,_0x1fc9ab){_0x40e2b1=_0x40e2b1-0x0;var _0x34ad12=_0x1992[_0x40e2b1];return _0x34ad12;};'use strict';var _=require(_0x2199('0x0'));var util=require('util');var moment=require(_0x2199('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2199('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2199('0x3'))(_0x2199('0x4'));var config=require(_0x2199('0x5'));var jayson=require(_0x2199('0x6'));var client=jayson['client'][_0x2199('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8c8ed,_0x3a93f3,_0x30f938){return new BPromise(function(_0x2adad7,_0x55aff1){return client[_0x2199('0x8')](_0x8c8ed,_0x30f938)[_0x2199('0x9')](function(_0x2bed1b){logger['info']('DeskField,\x20%s,\x20%s',_0x3a93f3,_0x2199('0xa'));logger[_0x2199('0xb')](_0x2199('0xc'),_0x3a93f3,_0x2199('0xa'),JSON[_0x2199('0xd')](_0x2bed1b));if(_0x2bed1b['error']){if(_0x2bed1b[_0x2199('0xe')][_0x2199('0xf')]===0x1f4){logger[_0x2199('0xe')](_0x2199('0x10'),_0x3a93f3,_0x2bed1b['error'][_0x2199('0x11')]);return _0x55aff1(_0x2bed1b[_0x2199('0xe')][_0x2199('0x11')]);}logger[_0x2199('0xe')](_0x2199('0x10'),_0x3a93f3,_0x2bed1b[_0x2199('0xe')][_0x2199('0x11')]);return _0x2adad7(_0x2bed1b[_0x2199('0xe')][_0x2199('0x11')]);}else{logger['info'](_0x2199('0x10'),_0x3a93f3,_0x2199('0xa'));_0x2adad7(_0x2bed1b['result'][_0x2199('0x11')]);}})[_0x2199('0x12')](function(_0x28c610){logger[_0x2199('0xe')](_0x2199('0x10'),_0x3a93f3,_0x28c610);_0x55aff1(_0x28c610);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 99f9b96..8a5c04d 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 _0x3c67=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','multer','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3c67,0x106));var _0x73c6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3c67[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x73c6('0x0'));var util=require(_0x73c6('0x1'));var path=require(_0x73c6('0x2'));var timeout=require(_0x73c6('0x3'));var express=require(_0x73c6('0x4'));var router=express[_0x73c6('0x5')]();var fs_extra=require(_0x73c6('0x6'));var auth=require(_0x73c6('0x7'));var interaction=require(_0x73c6('0x8'));var config=require(_0x73c6('0x9'));var controller=require(_0x73c6('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x73c6('0xb')](_0x73c6('0xc'),auth['isAuthenticated'](),controller[_0x73c6('0xd')]);router['get'](_0x73c6('0xe'),auth[_0x73c6('0xf')](),controller[_0x73c6('0x10')]);router['get'](_0x73c6('0x11'),auth[_0x73c6('0xf')](),controller[_0x73c6('0x12')]);router[_0x73c6('0x13')]('/',auth['isAuthenticated'](),controller[_0x73c6('0x14')]);router[_0x73c6('0x13')](_0x73c6('0xe'),auth[_0x73c6('0xf')](),controller[_0x73c6('0x15')]);router[_0x73c6('0x16')](_0x73c6('0xc'),auth[_0x73c6('0xf')](),controller['update']);router[_0x73c6('0x17')](_0x73c6('0xc'),auth[_0x73c6('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x401c=['/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2f6e07,_0x4450de){var _0x1f04d8=function(_0x36face){while(--_0x36face){_0x2f6e07['push'](_0x2f6e07['shift']());}};_0x1f04d8(++_0x4450de);}(_0x401c,0x17e));var _0xc401=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x401c[_0x46a38b];return _0x346e75;};'use strict';var multer=require(_0xc401('0x0'));var util=require(_0xc401('0x1'));var path=require('path');var timeout=require(_0xc401('0x2'));var express=require(_0xc401('0x3'));var router=express[_0xc401('0x4')]();var fs_extra=require(_0xc401('0x5'));var auth=require(_0xc401('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc401('0x7'));var controller=require(_0xc401('0x8'));router[_0xc401('0x9')]('/',auth[_0xc401('0xa')](),controller[_0xc401('0xb')]);router[_0xc401('0x9')](_0xc401('0xc'),auth['isAuthenticated'](),controller[_0xc401('0xd')]);router['get'](_0xc401('0xe'),auth[_0xc401('0xa')](),controller['getConfigurations']);router['get'](_0xc401('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xc401('0x10')]('/',auth[_0xc401('0xa')](),controller[_0xc401('0x11')]);router[_0xc401('0x10')]('/:id/configurations',auth[_0xc401('0xa')](),controller[_0xc401('0x12')]);router[_0xc401('0x13')](_0xc401('0xc'),auth[_0xc401('0xa')](),controller[_0xc401('0x14')]);router['delete'](_0xc401('0xc'),auth[_0xc401('0xa')](),controller['destroy']);module[_0xc401('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e85908e..d7472da 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 _0x2051=['STRING'];(function(_0x102a36,_0x50cdee){var _0x5b5838=function(_0x5f39e0){while(--_0x5f39e0){_0x102a36['push'](_0x102a36['shift']());}};_0x5b5838(++_0x50cdee);}(_0x2051,0x14c));var _0x1205=function(_0x2b17dd,_0x457ac7){_0x2b17dd=_0x2b17dd-0x0;var _0x15c3e0=_0x2051[_0x2b17dd];return _0x15c3e0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1205('0x0')]},'username':{'type':Sequelize[_0x1205('0x0')]},'password':{'type':Sequelize[_0x1205('0x0')]},'remoteUri':{'type':Sequelize[_0x1205('0x0')]},'tenantId':{'type':Sequelize[_0x1205('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1205('0x0')]},'serverUrl':{'type':Sequelize[_0x1205('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x1205('0x0')]}}; \ No newline at end of file +var _0x4af2=['sequelize','exports','STRING'];(function(_0x3439d6,_0x322d7b){var _0x24f9db=function(_0x147adb){while(--_0x147adb){_0x3439d6['push'](_0x3439d6['shift']());}};_0x24f9db(++_0x322d7b);}(_0x4af2,0x1d7));var _0x24af=function(_0x2dee43,_0x272c70){_0x2dee43=_0x2dee43-0x0;var _0x2982b1=_0x4af2[_0x2dee43];return _0x2982b1;};'use strict';var Sequelize=require(_0x24af('0x0'));module[_0x24af('0x1')]={'name':{'type':Sequelize[_0x24af('0x2')]},'username':{'type':Sequelize[_0x24af('0x2')]},'password':{'type':Sequelize[_0x24af('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x24af('0x2')]},'clientId':{'type':Sequelize[_0x24af('0x2')]},'clientSecret':{'type':Sequelize[_0x24af('0x2')]},'serverUrl':{'type':Sequelize[_0x24af('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x24af('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index d5dd01d..720278a 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 _0xb079=['MetadataId','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','slice','substring','format','%s/api/data/v9.0/','POST','clientSecret','access_token','GET','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xb079,0x1c9));var _0x9b07=function(_0x41aa0b,_0x28b3bf){_0x41aa0b=_0x41aa0b-0x0;var _0x5de9d1=_0xb079[_0x41aa0b];return _0x5de9d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b07('0x0'));var zipdir=require(_0x9b07('0x1'));var jsonpatch=require(_0x9b07('0x2'));var rp=require(_0x9b07('0x3'));var moment=require(_0x9b07('0x4'));var BPromise=require(_0x9b07('0x5'));var Mustache=require(_0x9b07('0x6'));var util=require(_0x9b07('0x7'));var path=require(_0x9b07('0x8'));var sox=require(_0x9b07('0x9'));var csv=require(_0x9b07('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b07('0xb'));var _=require(_0x9b07('0xc'));var squel=require('squel');var crypto=require(_0x9b07('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b07('0xa'));var querystring=require(_0x9b07('0xe'));var Papa=require(_0x9b07('0xf'));var Redis=require(_0x9b07('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b07('0x11'));var as=require(_0x9b07('0x12'));var hardwareService=require(_0x9b07('0x13'));var logger=require(_0x9b07('0x14'))(_0x9b07('0x15'));var utils=require(_0x9b07('0x16'));var config=require(_0x9b07('0x17'));var licenseUtil=require(_0x9b07('0x18'));var db=require(_0x9b07('0x19'))['db'];var integrations=require(_0x9b07('0x1a'));function respondWithStatusCode(_0x75d173,_0x28af25){_0x28af25=_0x28af25||0xcc;return function(_0x177cdd){if(_0x177cdd){return _0x75d173['sendStatus'](_0x28af25);}return _0x75d173['status'](_0x28af25)[_0x9b07('0x1b')]();};}function respondWithResult(_0x39883c,_0x2c359f){_0x2c359f=_0x2c359f||0xc8;return function(_0xda58fa){if(_0xda58fa){return _0x39883c[_0x9b07('0x1c')](_0x2c359f)['json'](_0xda58fa);}};}function respondWithFilteredResult(_0x398a54,_0x43d4a7){return function(_0x18eda4){if(_0x18eda4){var _0x50cb56=typeof _0x43d4a7[_0x9b07('0x1d')]===_0x9b07('0x1e')&&typeof _0x43d4a7[_0x9b07('0x1f')]===_0x9b07('0x1e');var _0x38f77c=_0x18eda4[_0x9b07('0x20')];var _0x1dfbf1=_0x50cb56?0x0:_0x43d4a7[_0x9b07('0x1d')];var _0x4cae3d=_0x50cb56?_0x18eda4['count']:_0x43d4a7[_0x9b07('0x1d')]+_0x43d4a7['limit'];var _0x4550d7;if(_0x4cae3d>=_0x38f77c){_0x4cae3d=_0x38f77c;_0x4550d7=0xc8;}else{_0x4550d7=0xce;}_0x398a54['status'](_0x4550d7);return _0x398a54[_0x9b07('0x21')](_0x9b07('0x22'),_0x1dfbf1+'-'+_0x4cae3d+'/'+_0x38f77c)[_0x9b07('0x23')](_0x18eda4);}return null;};}function patchUpdates(_0x49bab7){return function(_0xec6512){try{jsonpatch[_0x9b07('0x24')](_0xec6512,_0x49bab7,!![]);}catch(_0xc5aebf){return BPromise[_0x9b07('0x25')](_0xc5aebf);}return _0xec6512['save']();};}function saveUpdates(_0x1254fd,_0x5d1196){return function(_0x322b5e){if(_0x322b5e){return _0x322b5e[_0x9b07('0x26')](_0x1254fd)[_0x9b07('0x27')](function(_0x39ac29){return _0x39ac29;});}return null;};}function removeEntity(_0x1ebd07,_0x48144d){return function(_0x18658e){if(_0x18658e){return _0x18658e['destroy']()[_0x9b07('0x27')](function(){_0x1ebd07[_0x9b07('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x373cdc,_0x56dbe1){return function(_0x44e47d){if(!_0x44e47d){_0x373cdc[_0x9b07('0x28')](0x194);}return _0x44e47d;};}function handleError(_0x2553d9,_0x25d44a){_0x25d44a=_0x25d44a||0x1f4;return function(_0x469a87){logger[_0x9b07('0x29')](_0x469a87[_0x9b07('0x2a')]);if(_0x469a87[_0x9b07('0x2b')]){delete _0x469a87[_0x9b07('0x2b')];}_0x2553d9[_0x9b07('0x1c')](_0x25d44a)[_0x9b07('0x2c')](_0x469a87);};}exports[_0x9b07('0x2d')]=function(_0x758425,_0x1d4040){var _0x57a197={},_0x3fd016={},_0x355104={'count':0x0,'rows':[]};var _0x16fce3=_[_0x9b07('0x2e')](db[_0x9b07('0x2f')][_0x9b07('0x30')],function(_0x7fd82){return{'name':_0x7fd82[_0x9b07('0x31')],'type':_0x7fd82[_0x9b07('0x32')][_0x9b07('0x33')]};});_0x3fd016[_0x9b07('0x34')]=_[_0x9b07('0x2e')](_0x16fce3,_0x9b07('0x2b'));_0x3fd016['query']=_[_0x9b07('0x35')](_0x758425[_0x9b07('0x36')]);_0x3fd016[_0x9b07('0x37')]=_[_0x9b07('0x38')](_0x3fd016[_0x9b07('0x34')],_0x3fd016[_0x9b07('0x36')]);_0x57a197[_0x9b07('0x39')]=_[_0x9b07('0x38')](_0x3fd016['model'],qs[_0x9b07('0x3a')](_0x758425[_0x9b07('0x36')][_0x9b07('0x3a')]));_0x57a197['attributes']=_0x57a197['attributes'][_0x9b07('0x3b')]?_0x57a197[_0x9b07('0x39')]:_0x3fd016['model'];if(!_0x758425[_0x9b07('0x36')]['hasOwnProperty'](_0x9b07('0x3c'))){_0x57a197[_0x9b07('0x1f')]=qs[_0x9b07('0x1f')](_0x758425[_0x9b07('0x36')][_0x9b07('0x1f')]);_0x57a197['offset']=qs[_0x9b07('0x1d')](_0x758425[_0x9b07('0x36')][_0x9b07('0x1d')]);}_0x57a197[_0x9b07('0x3d')]=qs[_0x9b07('0x3e')](_0x758425[_0x9b07('0x36')][_0x9b07('0x3e')]);_0x57a197[_0x9b07('0x3f')]=qs[_0x9b07('0x37')](_[_0x9b07('0x40')](_0x758425['query'],_0x3fd016[_0x9b07('0x37')]),_0x16fce3);if(_0x758425[_0x9b07('0x36')][_0x9b07('0x41')]){_0x57a197[_0x9b07('0x3f')]=_['merge'](_0x57a197[_0x9b07('0x3f')],{'$or':_[_0x9b07('0x2e')](_0x16fce3,function(_0x42c9fc){if(_0x42c9fc[_0x9b07('0x32')]!=='VIRTUAL'){var _0x3adcc1={};_0x3adcc1[_0x42c9fc[_0x9b07('0x2b')]]={'$like':'%'+_0x758425[_0x9b07('0x36')][_0x9b07('0x41')]+'%'};return _0x3adcc1;}})});}_0x57a197=_[_0x9b07('0x42')]({},_0x57a197,_0x758425[_0x9b07('0x43')]);var _0x52c6e2={'where':_0x57a197[_0x9b07('0x3f')]};return db[_0x9b07('0x2f')][_0x9b07('0x20')](_0x52c6e2)[_0x9b07('0x27')](function(_0x421966){_0x355104[_0x9b07('0x20')]=_0x421966;if(_0x758425[_0x9b07('0x36')][_0x9b07('0x44')]){_0x57a197[_0x9b07('0x45')]=[{'all':!![]}];}return db[_0x9b07('0x2f')][_0x9b07('0x46')](_0x57a197);})['then'](function(_0x34999c){_0x355104[_0x9b07('0x47')]=_0x34999c;return _0x355104;})[_0x9b07('0x27')](respondWithFilteredResult(_0x1d4040,_0x57a197))[_0x9b07('0x48')](handleError(_0x1d4040,null));};exports[_0x9b07('0x49')]=function(_0x13fedb,_0x20f21a){var _0x367f28={'raw':![],'where':{'id':_0x13fedb[_0x9b07('0x4a')]['id']}},_0x1b4d4a={};_0x1b4d4a[_0x9b07('0x34')]=_[_0x9b07('0x35')](db[_0x9b07('0x2f')][_0x9b07('0x30')]);_0x1b4d4a[_0x9b07('0x36')]=_[_0x9b07('0x35')](_0x13fedb[_0x9b07('0x36')]);_0x1b4d4a[_0x9b07('0x37')]=_['intersection'](_0x1b4d4a[_0x9b07('0x34')],_0x1b4d4a[_0x9b07('0x36')]);_0x367f28[_0x9b07('0x39')]=_[_0x9b07('0x38')](_0x1b4d4a[_0x9b07('0x34')],qs[_0x9b07('0x3a')](_0x13fedb[_0x9b07('0x36')][_0x9b07('0x3a')]));_0x367f28[_0x9b07('0x39')]=_0x367f28['attributes']['length']?_0x367f28[_0x9b07('0x39')]:_0x1b4d4a[_0x9b07('0x34')];if(_0x13fedb[_0x9b07('0x36')][_0x9b07('0x44')]){_0x367f28[_0x9b07('0x45')]=[{'all':!![]}];}_0x367f28=_[_0x9b07('0x42')]({},_0x367f28,_0x13fedb[_0x9b07('0x43')]);return db[_0x9b07('0x2f')][_0x9b07('0x4b')](_0x367f28)[_0x9b07('0x27')](handleEntityNotFound(_0x20f21a,null))[_0x9b07('0x27')](respondWithResult(_0x20f21a,null))[_0x9b07('0x48')](handleError(_0x20f21a,null));};exports['create']=function(_0x261407,_0xbd465){return db[_0x9b07('0x2f')]['create'](_0x261407[_0x9b07('0x4c')],{})['then'](respondWithResult(_0xbd465,0xc9))['catch'](handleError(_0xbd465,null));};exports[_0x9b07('0x26')]=function(_0x39bcb5,_0x4d91ff){if(_0x39bcb5[_0x9b07('0x4c')]['id']){delete _0x39bcb5['body']['id'];}return db[_0x9b07('0x2f')][_0x9b07('0x4b')]({'where':{'id':_0x39bcb5['params']['id']}})[_0x9b07('0x27')](handleEntityNotFound(_0x4d91ff,null))[_0x9b07('0x27')](saveUpdates(_0x39bcb5[_0x9b07('0x4c')],null))[_0x9b07('0x27')](respondWithResult(_0x4d91ff,null))[_0x9b07('0x48')](handleError(_0x4d91ff,null));};exports[_0x9b07('0x4d')]=function(_0x1e57cd,_0x5f656a){return db[_0x9b07('0x2f')][_0x9b07('0x4b')]({'where':{'id':_0x1e57cd[_0x9b07('0x4a')]['id']}})[_0x9b07('0x27')](handleEntityNotFound(_0x5f656a,null))[_0x9b07('0x27')](removeEntity(_0x5f656a,null))[_0x9b07('0x48')](handleError(_0x5f656a,null));};exports[_0x9b07('0x4e')]=function(_0xee32a,_0x41812d,_0xd0bfe6){var _0x221cce={};var _0x3fe75c={};var _0x46912f;var _0x3ba050;return db[_0x9b07('0x2f')][_0x9b07('0x4f')]({'where':{'id':_0xee32a[_0x9b07('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41812d,null))[_0x9b07('0x27')](function(_0x22cb20){if(_0x22cb20){_0x46912f=_0x22cb20;_0x3fe75c[_0x9b07('0x34')]=_[_0x9b07('0x35')](db[_0x9b07('0x50')][_0x9b07('0x30')]);_0x3fe75c[_0x9b07('0x36')]=_['keys'](_0xee32a[_0x9b07('0x36')]);_0x3fe75c[_0x9b07('0x37')]=_[_0x9b07('0x38')](_0x3fe75c[_0x9b07('0x34')],_0x3fe75c[_0x9b07('0x36')]);_0x221cce[_0x9b07('0x39')]=_[_0x9b07('0x38')](_0x3fe75c[_0x9b07('0x34')],qs[_0x9b07('0x3a')](_0xee32a[_0x9b07('0x36')]['fields']));_0x221cce[_0x9b07('0x39')]=_0x221cce[_0x9b07('0x39')][_0x9b07('0x3b')]?_0x221cce[_0x9b07('0x39')]:_0x3fe75c[_0x9b07('0x34')];_0x221cce[_0x9b07('0x3d')]=qs[_0x9b07('0x3e')](_0xee32a[_0x9b07('0x36')][_0x9b07('0x3e')]);_0x221cce['where']=qs[_0x9b07('0x37')](_[_0x9b07('0x40')](_0xee32a['query'],_0x3fe75c[_0x9b07('0x37')]));if(_0xee32a[_0x9b07('0x36')][_0x9b07('0x41')]){_0x221cce[_0x9b07('0x3f')]=_[_0x9b07('0x42')](_0x221cce[_0x9b07('0x3f')],{'$or':_[_0x9b07('0x2e')](_0x221cce[_0x9b07('0x39')],function(_0x338300){var _0x21f9db={};_0x21f9db[_0x338300]={'$like':'%'+_0xee32a['query']['filter']+'%'};return _0x21f9db;})});}_0x221cce=_[_0x9b07('0x42')]({},_0x221cce,_0xee32a[_0x9b07('0x43')]);return _0x46912f[_0x9b07('0x4e')](_0x221cce);}})['then'](function(_0x4afb36){if(_0x4afb36){_0x3ba050=_0x4afb36[_0x9b07('0x3b')];if(!_0xee32a[_0x9b07('0x36')]['hasOwnProperty'](_0x9b07('0x3c'))){_0x221cce[_0x9b07('0x1f')]=qs[_0x9b07('0x1f')](_0xee32a['query'][_0x9b07('0x1f')]);_0x221cce[_0x9b07('0x1d')]=qs[_0x9b07('0x1d')](_0xee32a[_0x9b07('0x36')]['offset']);}return _0x46912f[_0x9b07('0x4e')](_0x221cce);}})['then'](function(_0x4be7a0){if(_0x4be7a0){return _0x4be7a0?{'count':_0x3ba050,'rows':_0x4be7a0}:null;}})[_0x9b07('0x27')](respondWithResult(_0x41812d,null))[_0x9b07('0x48')](handleError(_0x41812d,null));};exports['addConfiguration']=function(_0x2d233b,_0x33c216,_0x22c2e6){if(_0x2d233b[_0x9b07('0x4c')]['id']){delete _0x2d233b[_0x9b07('0x4c')]['id'];}return db[_0x9b07('0x2f')][_0x9b07('0x4f')]({'where':{'id':_0x2d233b[_0x9b07('0x4a')]['id']}})[_0x9b07('0x27')](handleEntityNotFound(_0x33c216,null))['then'](function(_0x1f9b10){if(_0x1f9b10){_0x2d233b[_0x9b07('0x4c')][_0x9b07('0x51')]=_0x1f9b10['id'];_0x2d233b[_0x9b07('0x4c')][_0x9b07('0x52')]=integrations[_0x9b07('0x53')](_0x2d233b['body']['channel'],_0x2d233b['body']['type']);_0x2d233b['body'][_0x9b07('0x54')]=integrations[_0x9b07('0x55')](_0x2d233b[_0x9b07('0x4c')][_0x9b07('0x56')],_0x2d233b[_0x9b07('0x4c')][_0x9b07('0x32')]);return db['Dynamics365Configuration'][_0x9b07('0x57')](_0x2d233b[_0x9b07('0x4c')],{'include':[{'model':db[_0x9b07('0x58')],'as':_0x9b07('0x52')},{'model':db[_0x9b07('0x58')],'as':_0x9b07('0x54')}]});}return null;})[_0x9b07('0x27')](respondWithResult(_0x33c216,null))['catch'](handleError(_0x33c216,null));};exports[_0x9b07('0x59')]=function(_0x3426b0,_0x20333f,_0x1f52cd){var _0x420272=_0x3426b0[_0x9b07('0x36')][_0x9b07('0x5a')];var _0x1a60e6=_0x420272===_0x9b07('0x5b')?_0x9b07('0x5c'):_0x9b07('0x5d');var _0x3ffbbe='';var _0x402f39='';var _0x574244='';var _0x378728='';var _0x2d2c33='';var _0x4df35f='';var _0x2d5170='';var _0x435056='';var _0x445257=['title','description',_0x9b07('0x5e'),_0x9b07('0x5f'),_0x9b07('0x60'),_0x9b07('0x61'),_0x9b07('0x62'),'regardingobjectid',_0x9b07('0x63'),_0x9b07('0x64')];var _0x5e1fdb=[_0x9b07('0x65'),_0x9b07('0x66'),_0x9b07('0x67'),_0x9b07('0x68'),_0x9b07('0x69'),_0x9b07('0x6a'),_0x9b07('0x6b'),_0x9b07('0x6c'),_0x9b07('0x6d'),'createdbyexternalpartyyominame','createdbyname',_0x9b07('0x6e'),'createdon','createdonbehalfbyname',_0x9b07('0x6f'),_0x9b07('0x70'),_0x9b07('0x71'),_0x9b07('0x72'),_0x9b07('0x73'),_0x9b07('0x74'),_0x9b07('0x75'),_0x9b07('0x76'),_0x9b07('0x77'),_0x9b07('0x78'),_0x9b07('0x79'),_0x9b07('0x7a'),_0x9b07('0x7b'),_0x9b07('0x7c'),_0x9b07('0x7d'),_0x9b07('0x7e'),_0x9b07('0x7f'),_0x9b07('0x80'),_0x9b07('0x81'),_0x9b07('0x82'),_0x9b07('0x83'),_0x9b07('0x84'),_0x9b07('0x85'),'modifiedonbehalfbyyominame',_0x9b07('0x86'),_0x9b07('0x87'),'numberofchildincidents',_0x9b07('0x88'),_0x9b07('0x89'),_0x9b07('0x8a'),_0x9b07('0x8b'),_0x9b07('0x8c'),_0x9b07('0x8d'),_0x9b07('0x8e'),'primarycontactidyominame',_0x9b07('0x8f'),_0x9b07('0x90'),'productserialnumber',_0x9b07('0x91'),'resolvebykpiidname',_0x9b07('0x92'),_0x9b07('0x93'),'responsiblecontactidyominame',_0x9b07('0x94'),'slainvokedidname',_0x9b07('0x95'),_0x9b07('0x96'),'statecode',_0x9b07('0x97'),'subjectidname',_0x9b07('0x98'),_0x9b07('0x99'),_0x9b07('0x9a'),_0x9b07('0x9b'),_0x9b07('0x9c'),'versionnumber'];var _0x4d33fc=_0x445257[_0x9b07('0x9d')](_0x5e1fdb);return db[_0x9b07('0x2f')][_0x9b07('0x4f')]({'where':{'id':_0x3426b0[_0x9b07('0x4a')]['id']},'attributes':['id',_0x9b07('0x9e'),_0x9b07('0x9f'),_0x9b07('0xa0'),_0x9b07('0xa1'),_0x9b07('0xa2'),'clientSecret']})['then'](handleEntityNotFound(_0x20333f,null))[_0x9b07('0x27')](function(_0x3160d4){if(_0x3160d4){_0x435056=_0x3160d4[_0x9b07('0xa0')];var _0x1d30a7=_0x435056[_0x9b07('0xa3')](-0x1);if(_0x1d30a7==='/'){_0x435056=_0x435056[_0x9b07('0xa4')](0x0,_0x435056['lastIndexOf'](_0x1d30a7));}_0x2d5170=util[_0x9b07('0xa5')](_0x9b07('0xa6'),_0x435056);var _0x34651a={'method':_0x9b07('0xa7'),'uri':'https://login.microsoftonline.com/'+_0x3160d4[_0x9b07('0xa1')]+'/oauth2/token','form':{'client_id':_0x3160d4[_0x9b07('0xa2')],'resource':_0x435056,'username':_0x3160d4['username'],'password':_0x3160d4['password'],'grant_type':_0x9b07('0x9f'),'client_secret':_0x3160d4[_0x9b07('0xa8')]},'json':!![]};return rp(_0x34651a);}})[_0x9b07('0x27')](function(_0x1bd7a6){_0x4df35f=_0x1bd7a6[_0x9b07('0xa9')];var _0x2e8e20={'method':_0x9b07('0xaa'),'uri':encodeURI(_0x2d5170+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x1a60e6+'\x27'),'headers':{'Authorization':_0x9b07('0xab')+_0x4df35f,'If-None-Match':null,'OData-Version':_0x9b07('0xac')},'json':!![]};return rp(_0x2e8e20);})[_0x9b07('0x27')](function(_0x5005b1){var _0x45b260=_0x5005b1['value'][0x0];var _0x124af9=_0x45b260['MetadataId'];var _0x9aed4c={'method':_0x9b07('0xaa'),'uri':_0x2d5170+_0x9b07('0xad')+_0x124af9+_0x9b07('0xae'),'headers':{'Authorization':'Bearer\x20'+_0x4df35f,'If-None-Match':null,'OData-Version':_0x9b07('0xac')},'json':!![]};return rp(_0x9aed4c);})['then'](function(_0x545774){_0x3ffbbe=_0x545774;_0x402f39=_0x3ffbbe[_0x9b07('0xaf')];_0x402f39=_[_0x9b07('0xb0')](_0x402f39,function(_0xd041bf){return!_0x4d33fc['includes'](_0xd041bf[_0x9b07('0xb1')]);});var _0x24f3fb=[];var _0x591836=[];_0x402f39[_0x9b07('0xb2')](function(_0x25374c){if(_0x25374c[_0x9b07('0xb3')]){var _0x3c0029=_0x25374c['@odata.type'][_0x9b07('0xa4')](_0x25374c[_0x9b07('0xb3')][_0x9b07('0xb4')]('.')+0x1);if(_0x3c0029===_0x9b07('0xb5')){_0x24f3fb['push'](getSelectList(_0x2d5170,_0x420272,_0x591836,_0x3ffbbe[_0x9b07('0xb6')],_0x25374c[_0x9b07('0xb6')],_0x4df35f));}}});return Promise[_0x9b07('0xb7')](_0x24f3fb);})[_0x9b07('0x27')](function(_0x9ac194){_0x574244=_0x9ac194[0x0];var _0x29b9f6=[];var _0x5cd0fa=[];_0x402f39[_0x9b07('0xb2')](function(_0x36416c){if(!_[_0x9b07('0xb8')](_0x36416c[_0x9b07('0xb3')])){var _0x1685b2=_0x36416c[_0x9b07('0xb3')][_0x9b07('0xa4')](_0x36416c['@odata.type'][_0x9b07('0xb4')]('.')+0x1);if(_0x1685b2===_0x9b07('0xb9')){_0x29b9f6[_0x9b07('0xba')](getBooleanList(_0x2d5170,_0x420272,_0x5cd0fa,_0x3ffbbe['MetadataId'],_0x36416c['MetadataId'],_0x4df35f));}}});return Promise[_0x9b07('0xb7')](_0x29b9f6);})['then'](function(_0x547785){_0x378728=_0x547785[0x0];var _0x23b7ae=[];var _0x1a9642=[];_0x402f39[_0x9b07('0xb2')](function(_0x377c7a){if(_0x377c7a[_0x9b07('0xb3')]){var _0x41e058=_0x377c7a[_0x9b07('0xb3')][_0x9b07('0xa4')](_0x377c7a[_0x9b07('0xb3')]['lastIndexOf']('.')+0x1);if(_0x41e058===_0x9b07('0xbb')||_0x41e058===_0x9b07('0xbc')||_0x41e058===_0x9b07('0xbd')||_0x41e058===_0x9b07('0xbe')||_0x41e058===_0x9b07('0xbf')||_0x41e058===_0x9b07('0xc0')||_0x41e058===_0x9b07('0xc1')||_0x41e058===_0x9b07('0xc2')||_0x41e058===_0x9b07('0xc3')||_0x41e058===_0x9b07('0xc4')){_0x23b7ae[_0x9b07('0xba')](getInputList(_0x2d5170,_0x420272,_0x41e058,_0x1a9642,_0x3ffbbe[_0x9b07('0xb6')],_0x377c7a['MetadataId'],_0x4df35f));}}});return Promise[_0x9b07('0xb7')](_0x23b7ae);})[_0x9b07('0x27')](function(_0x2b493e){_0x2d2c33=_0x2b493e[0x0];var _0x2c68a6=_0x574244[_0x9b07('0x9d')](_0x378728)[_0x9b07('0x9d')](_0x2d2c33);var _0x528125={'count':_0x2c68a6[_0x9b07('0x3b')],'rows':_0x2c68a6};return _0x528125;})['then'](respondWithResult(_0x20333f,null))[_0x9b07('0x48')](function(_0x49c34a){var _0x14561b=_0x3426b0[_0x9b07('0x36')][_0x9b07('0xc5')]?0x1f4:_0x49c34a[_0x9b07('0xc6')]||0x1f4;logger['error'](_0x49c34a[_0x9b07('0x2a')]);delete _0x49c34a[_0x9b07('0x2b')];if(_0x14561b===0x191){_0x14561b=0x190;}_0x20333f[_0x9b07('0x1c')](_0x14561b)[_0x9b07('0x2c')](_0x3426b0[_0x9b07('0x36')][_0x9b07('0xc5')]?{'message':_0x9b07('0xc7'),'statusCode':_0x49c34a[_0x9b07('0xc6')]}:_0x49c34a);});};function getSelectList(_0x42a458,_0x420a96,_0xa4e551,_0x365439,_0x53be0c,_0x1e6864){var _0x1607c1={'method':_0x9b07('0xaa'),'uri':_0x42a458+_0x9b07('0xad')+_0x365439+_0x9b07('0xc8')+_0x53be0c+_0x9b07('0xc9')+_0x9b07('0xca'),'headers':{'Authorization':_0x9b07('0xab')+_0x1e6864,'If-None-Match':null,'OData-Version':_0x9b07('0xac')},'json':!![]};return rp(_0x1607c1)['then'](function(_0x30cc2c){var _0x1b8eda=[];var _0x5c9bad=_0x30cc2c[_0x9b07('0xcb')][_0x9b07('0xcc')];_0x5c9bad[_0x9b07('0xb2')](function(_0xba0c03){_0x1b8eda[_0x9b07('0xba')]({'name':_0xba0c03[_0x9b07('0xcd')][_0x9b07('0xce')]['Label'],'value':String(_0xba0c03[_0x9b07('0xcf')])});});var _0x175ba8={'id':_0x420a96+'_'+_0x30cc2c[_0x9b07('0xb1')],'name':_0x30cc2c[_0x9b07('0xd0')][_0x9b07('0xce')][_0x9b07('0xcd')],'custom':![],'options':_0x1b8eda};_0xa4e551['push'](_0x175ba8);return _0xa4e551;});}function getBooleanList(_0x3144e8,_0x187e37,_0x268818,_0x24791e,_0x2da68e,_0x3e742){var _0x247702={'method':'GET','uri':_0x3144e8+_0x9b07('0xad')+_0x24791e+_0x9b07('0xc8')+_0x2da68e+_0x9b07('0xd1'),'headers':{'Authorization':'Bearer\x20'+_0x3e742,'If-None-Match':null,'OData-Version':_0x9b07('0xac')},'json':!![]};return rp(_0x247702)[_0x9b07('0x27')](function(_0x938401){var _0x55470c=[];_0x55470c[_0x9b07('0xba')]({'name':_0x938401[_0x9b07('0xcb')][_0x9b07('0xd2')][_0x9b07('0xcd')][_0x9b07('0xce')]['Label'],'value':'true'},{'name':_0x938401[_0x9b07('0xcb')][_0x9b07('0xd3')][_0x9b07('0xcd')][_0x9b07('0xce')]['Label'],'value':_0x9b07('0xd4')});var _0x517f5e={'id':_0x187e37+'_'+_0x938401[_0x9b07('0xb1')],'name':_0x938401['DisplayName'][_0x9b07('0xce')][_0x9b07('0xcd')],'custom':![],'options':_0x55470c};_0x268818[_0x9b07('0xba')](_0x517f5e);return _0x268818;});}function getInputList(_0x2cc9aa,_0x1e6e04,_0x5670f9,_0x1eb0d7,_0x517218,_0x49af87,_0x197132){var _0x5c0fba={'method':_0x9b07('0xaa'),'uri':_0x2cc9aa+_0x9b07('0xad')+_0x517218+_0x9b07('0xc8')+_0x49af87+')/Microsoft.Dynamics.CRM.'+_0x5670f9+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x9b07('0xab')+_0x197132,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c0fba)['then'](function(_0x166b89){var _0x403f02={'id':_0x1e6e04+'_'+_0x166b89[_0x9b07('0xb1')],'name':_0x166b89[_0x9b07('0xd0')][_0x9b07('0xce')]?_0x166b89[_0x9b07('0xd0')][_0x9b07('0xce')][_0x9b07('0xcd')]:_0x166b89[_0x9b07('0xb1')],'custom':![],'options':[]};_0x1eb0d7[_0x9b07('0xba')](_0x403f02);return _0x1eb0d7;});} \ No newline at end of file +var _0xe062=['Options','Label',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','includeAll','include','findAll','rows','show','params','keys','intersection','options','find','catch','create','body','Dynamics365Configuration','order','merge','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet'];(function(_0x4cce8,_0x22d1fe){var _0x458440=function(_0x3d15e4){while(--_0x3d15e4){_0x4cce8['push'](_0x4cce8['shift']());}};_0x458440(++_0x22d1fe);}(_0xe062,0xd5));var _0x2e06=function(_0x329a5a,_0x35547b){_0x329a5a=_0x329a5a-0x0;var _0x4e7f12=_0xe062[_0x329a5a];return _0x4e7f12;};'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'];var integrations=require(_0x2e06('0x16'));function respondWithStatusCode(_0x11520b,_0x542f63){_0x542f63=_0x542f63||0xcc;return function(_0xd781db){if(_0xd781db){return _0x11520b[_0x2e06('0x17')](_0x542f63);}return _0x11520b['status'](_0x542f63)[_0x2e06('0x18')]();};}function respondWithResult(_0x2a3a2a,_0x9a3ab4){_0x9a3ab4=_0x9a3ab4||0xc8;return function(_0x25909a){if(_0x25909a){return _0x2a3a2a[_0x2e06('0x19')](_0x9a3ab4)[_0x2e06('0x1a')](_0x25909a);}};}function respondWithFilteredResult(_0x5e4795,_0x3b307d){return function(_0x330e5e){if(_0x330e5e){var _0x210e11=typeof _0x3b307d[_0x2e06('0x1b')]===_0x2e06('0x1c')&&typeof _0x3b307d[_0x2e06('0x1d')]===_0x2e06('0x1c');var _0xb67ba8=_0x330e5e[_0x2e06('0x1e')];var _0x4fd048=_0x210e11?0x0:_0x3b307d[_0x2e06('0x1b')];var _0x45052c=_0x210e11?_0x330e5e['count']:_0x3b307d[_0x2e06('0x1b')]+_0x3b307d[_0x2e06('0x1d')];var _0x2c2320;if(_0x45052c>=_0xb67ba8){_0x45052c=_0xb67ba8;_0x2c2320=0xc8;}else{_0x2c2320=0xce;}_0x5e4795[_0x2e06('0x19')](_0x2c2320);return _0x5e4795[_0x2e06('0x1f')](_0x2e06('0x20'),_0x4fd048+'-'+_0x45052c+'/'+_0xb67ba8)[_0x2e06('0x1a')](_0x330e5e);}return null;};}function patchUpdates(_0x38ec0f){return function(_0xf95487){try{jsonpatch[_0x2e06('0x21')](_0xf95487,_0x38ec0f,!![]);}catch(_0x358cf6){return BPromise[_0x2e06('0x22')](_0x358cf6);}return _0xf95487[_0x2e06('0x23')]();};}function saveUpdates(_0x2a31d7,_0x27d028){return function(_0x38b5db){if(_0x38b5db){return _0x38b5db[_0x2e06('0x24')](_0x2a31d7)[_0x2e06('0x25')](function(_0x4963eb){return _0x4963eb;});}return null;};}function removeEntity(_0x21eea1,_0x1c1e6f){return function(_0x74e8e6){if(_0x74e8e6){return _0x74e8e6[_0x2e06('0x26')]()[_0x2e06('0x25')](function(){_0x21eea1[_0x2e06('0x19')](0xcc)[_0x2e06('0x18')]();});}};}function handleEntityNotFound(_0x1ed50e,_0x202338){return function(_0x4a0dbc){if(!_0x4a0dbc){_0x1ed50e[_0x2e06('0x17')](0x194);}return _0x4a0dbc;};}function handleError(_0x123daf,_0xdcb6f8){_0xdcb6f8=_0xdcb6f8||0x1f4;return function(_0x3d1011){logger[_0x2e06('0x27')](_0x3d1011['stack']);if(_0x3d1011[_0x2e06('0x28')]){delete _0x3d1011['name'];}_0x123daf[_0x2e06('0x19')](_0xdcb6f8)[_0x2e06('0x29')](_0x3d1011);};}exports['index']=function(_0x149901,_0x18f703){var _0x3ff289={},_0x5116f1={},_0x5a48f6={'count':0x0,'rows':[]};var _0x2cb75f=_[_0x2e06('0x2a')](db[_0x2e06('0x2b')][_0x2e06('0x2c')],function(_0x394619){return{'name':_0x394619[_0x2e06('0x2d')],'type':_0x394619[_0x2e06('0x2e')][_0x2e06('0x2f')]};});_0x5116f1[_0x2e06('0x30')]=_['map'](_0x2cb75f,'name');_0x5116f1['query']=_['keys'](_0x149901[_0x2e06('0x31')]);_0x5116f1[_0x2e06('0x32')]=_['intersection'](_0x5116f1[_0x2e06('0x30')],_0x5116f1[_0x2e06('0x31')]);_0x3ff289[_0x2e06('0x33')]=_['intersection'](_0x5116f1[_0x2e06('0x30')],qs[_0x2e06('0x34')](_0x149901['query'][_0x2e06('0x34')]));_0x3ff289[_0x2e06('0x33')]=_0x3ff289[_0x2e06('0x33')][_0x2e06('0x35')]?_0x3ff289['attributes']:_0x5116f1[_0x2e06('0x30')];if(!_0x149901[_0x2e06('0x31')][_0x2e06('0x36')](_0x2e06('0x37'))){_0x3ff289['limit']=qs[_0x2e06('0x1d')](_0x149901[_0x2e06('0x31')]['limit']);_0x3ff289['offset']=qs['offset'](_0x149901[_0x2e06('0x31')]['offset']);}_0x3ff289['order']=qs[_0x2e06('0x38')](_0x149901[_0x2e06('0x31')][_0x2e06('0x38')]);_0x3ff289['where']=qs[_0x2e06('0x32')](_['pick'](_0x149901[_0x2e06('0x31')],_0x5116f1['filters']),_0x2cb75f);if(_0x149901[_0x2e06('0x31')][_0x2e06('0x39')]){_0x3ff289['where']=_['merge'](_0x3ff289[_0x2e06('0x3a')],{'$or':_[_0x2e06('0x2a')](_0x2cb75f,function(_0x1eb25a){if(_0x1eb25a[_0x2e06('0x2e')]!=='VIRTUAL'){var _0x453bc={};_0x453bc[_0x1eb25a['name']]={'$like':'%'+_0x149901['query'][_0x2e06('0x39')]+'%'};return _0x453bc;}})});}_0x3ff289=_['merge']({},_0x3ff289,_0x149901['options']);var _0x253b32={'where':_0x3ff289[_0x2e06('0x3a')]};return db[_0x2e06('0x2b')][_0x2e06('0x1e')](_0x253b32)[_0x2e06('0x25')](function(_0x1d9895){_0x5a48f6[_0x2e06('0x1e')]=_0x1d9895;if(_0x149901[_0x2e06('0x31')][_0x2e06('0x3b')]){_0x3ff289[_0x2e06('0x3c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x2e06('0x3d')](_0x3ff289);})[_0x2e06('0x25')](function(_0x403741){_0x5a48f6[_0x2e06('0x3e')]=_0x403741;return _0x5a48f6;})[_0x2e06('0x25')](respondWithFilteredResult(_0x18f703,_0x3ff289))['catch'](handleError(_0x18f703,null));};exports[_0x2e06('0x3f')]=function(_0x3ca31c,_0x4a4c20){var _0x4fbc3b={'raw':![],'where':{'id':_0x3ca31c[_0x2e06('0x40')]['id']}},_0x9206ab={};_0x9206ab[_0x2e06('0x30')]=_[_0x2e06('0x41')](db['Dynamics365Account'][_0x2e06('0x2c')]);_0x9206ab['query']=_[_0x2e06('0x41')](_0x3ca31c['query']);_0x9206ab[_0x2e06('0x32')]=_[_0x2e06('0x42')](_0x9206ab[_0x2e06('0x30')],_0x9206ab['query']);_0x4fbc3b[_0x2e06('0x33')]=_[_0x2e06('0x42')](_0x9206ab['model'],qs[_0x2e06('0x34')](_0x3ca31c[_0x2e06('0x31')][_0x2e06('0x34')]));_0x4fbc3b[_0x2e06('0x33')]=_0x4fbc3b[_0x2e06('0x33')]['length']?_0x4fbc3b[_0x2e06('0x33')]:_0x9206ab[_0x2e06('0x30')];if(_0x3ca31c[_0x2e06('0x31')]['includeAll']){_0x4fbc3b[_0x2e06('0x3c')]=[{'all':!![]}];}_0x4fbc3b=_['merge']({},_0x4fbc3b,_0x3ca31c[_0x2e06('0x43')]);return db['Dynamics365Account'][_0x2e06('0x44')](_0x4fbc3b)['then'](handleEntityNotFound(_0x4a4c20,null))[_0x2e06('0x25')](respondWithResult(_0x4a4c20,null))[_0x2e06('0x45')](handleError(_0x4a4c20,null));};exports['create']=function(_0x111509,_0x50a7a1){return db[_0x2e06('0x2b')][_0x2e06('0x46')](_0x111509[_0x2e06('0x47')],{})['then'](respondWithResult(_0x50a7a1,0xc9))[_0x2e06('0x45')](handleError(_0x50a7a1,null));};exports['update']=function(_0x1de5dd,_0x5975e5){if(_0x1de5dd[_0x2e06('0x47')]['id']){delete _0x1de5dd[_0x2e06('0x47')]['id'];}return db[_0x2e06('0x2b')][_0x2e06('0x44')]({'where':{'id':_0x1de5dd['params']['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x5975e5,null))[_0x2e06('0x25')](saveUpdates(_0x1de5dd['body'],null))['then'](respondWithResult(_0x5975e5,null))[_0x2e06('0x45')](handleError(_0x5975e5,null));};exports['destroy']=function(_0x132a78,_0x11a5be){return db['Dynamics365Account'][_0x2e06('0x44')]({'where':{'id':_0x132a78[_0x2e06('0x40')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x11a5be,null))[_0x2e06('0x25')](removeEntity(_0x11a5be,null))[_0x2e06('0x45')](handleError(_0x11a5be,null));};exports['getConfigurations']=function(_0x55fa1a,_0x222452,_0x139d97){var _0x25ceff={};var _0x2c55e5={};var _0x4dc278;var _0x1d8bb8;return db[_0x2e06('0x2b')]['findOne']({'where':{'id':_0x55fa1a[_0x2e06('0x40')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x222452,null))['then'](function(_0x5ba6ec){if(_0x5ba6ec){_0x4dc278=_0x5ba6ec;_0x2c55e5[_0x2e06('0x30')]=_[_0x2e06('0x41')](db[_0x2e06('0x48')][_0x2e06('0x2c')]);_0x2c55e5[_0x2e06('0x31')]=_['keys'](_0x55fa1a['query']);_0x2c55e5['filters']=_[_0x2e06('0x42')](_0x2c55e5[_0x2e06('0x30')],_0x2c55e5[_0x2e06('0x31')]);_0x25ceff[_0x2e06('0x33')]=_['intersection'](_0x2c55e5['model'],qs['fields'](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x34')]));_0x25ceff['attributes']=_0x25ceff[_0x2e06('0x33')]['length']?_0x25ceff[_0x2e06('0x33')]:_0x2c55e5[_0x2e06('0x30')];_0x25ceff[_0x2e06('0x49')]=qs[_0x2e06('0x38')](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x38')]);_0x25ceff[_0x2e06('0x3a')]=qs[_0x2e06('0x32')](_['pick'](_0x55fa1a[_0x2e06('0x31')],_0x2c55e5[_0x2e06('0x32')]));if(_0x55fa1a['query'][_0x2e06('0x39')]){_0x25ceff['where']=_[_0x2e06('0x4a')](_0x25ceff[_0x2e06('0x3a')],{'$or':_[_0x2e06('0x2a')](_0x25ceff[_0x2e06('0x33')],function(_0x4385fd){var _0x4dbbd4={};_0x4dbbd4[_0x4385fd]={'$like':'%'+_0x55fa1a['query'][_0x2e06('0x39')]+'%'};return _0x4dbbd4;})});}_0x25ceff=_['merge']({},_0x25ceff,_0x55fa1a[_0x2e06('0x43')]);return _0x4dc278[_0x2e06('0x4b')](_0x25ceff);}})[_0x2e06('0x25')](function(_0x5ada47){if(_0x5ada47){_0x1d8bb8=_0x5ada47['length'];if(!_0x55fa1a['query']['hasOwnProperty'](_0x2e06('0x37'))){_0x25ceff[_0x2e06('0x1d')]=qs[_0x2e06('0x1d')](_0x55fa1a['query'][_0x2e06('0x1d')]);_0x25ceff['offset']=qs[_0x2e06('0x1b')](_0x55fa1a[_0x2e06('0x31')][_0x2e06('0x1b')]);}return _0x4dc278[_0x2e06('0x4b')](_0x25ceff);}})['then'](function(_0xe785ca){if(_0xe785ca){return _0xe785ca?{'count':_0x1d8bb8,'rows':_0xe785ca}:null;}})[_0x2e06('0x25')](respondWithResult(_0x222452,null))[_0x2e06('0x45')](handleError(_0x222452,null));};exports[_0x2e06('0x4c')]=function(_0x309a5f,_0x136876,_0x4e8366){if(_0x309a5f[_0x2e06('0x47')]['id']){delete _0x309a5f[_0x2e06('0x47')]['id'];}return db['Dynamics365Account'][_0x2e06('0x4d')]({'where':{'id':_0x309a5f[_0x2e06('0x40')]['id']}})['then'](handleEntityNotFound(_0x136876,null))[_0x2e06('0x25')](function(_0x2cac99){if(_0x2cac99){_0x309a5f[_0x2e06('0x47')][_0x2e06('0x4e')]=_0x2cac99['id'];_0x309a5f['body'][_0x2e06('0x4f')]=integrations['getSubjects'](_0x309a5f[_0x2e06('0x47')][_0x2e06('0x50')],_0x309a5f['body'][_0x2e06('0x2e')]);_0x309a5f[_0x2e06('0x47')][_0x2e06('0x51')]=integrations[_0x2e06('0x52')](_0x309a5f['body']['channel'],_0x309a5f[_0x2e06('0x47')]['type']);return db[_0x2e06('0x48')][_0x2e06('0x46')](_0x309a5f['body'],{'include':[{'model':db[_0x2e06('0x53')],'as':_0x2e06('0x4f')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x2e06('0x25')](respondWithResult(_0x136876,null))['catch'](handleError(_0x136876,null));};exports[_0x2e06('0x54')]=function(_0x11453d,_0x17e4bd,_0x1369e6){var _0xe5e2d8=_0x11453d[_0x2e06('0x31')][_0x2e06('0x55')];var _0x193205=_0xe5e2d8===_0x2e06('0x56')?_0x2e06('0x57'):_0x2e06('0x58');var _0x1d7e5c='';var _0x3bc2b1='';var _0x58acbc='';var _0x13c83c='';var _0x457354='';var _0x28304a='';var _0x1cfe10='';var _0x1ab6b0='';var _0x14c20f=['title','description','customerid','ownerid',_0x2e06('0x59'),_0x2e06('0x5a'),_0x2e06('0x5b'),_0x2e06('0x5c'),_0x2e06('0x5d'),_0x2e06('0x5e')];var _0x198a86=[_0x2e06('0x5f'),_0x2e06('0x60'),_0x2e06('0x61'),_0x2e06('0x62'),_0x2e06('0x63'),'contactidyominame',_0x2e06('0x64'),_0x2e06('0x65'),_0x2e06('0x66'),_0x2e06('0x67'),_0x2e06('0x68'),_0x2e06('0x69'),_0x2e06('0x6a'),_0x2e06('0x6b'),_0x2e06('0x6c'),_0x2e06('0x6d'),_0x2e06('0x6e'),_0x2e06('0x6f'),_0x2e06('0x70'),'entitlementidname',_0x2e06('0x71'),_0x2e06('0x72'),_0x2e06('0x73'),_0x2e06('0x74'),_0x2e06('0x75'),_0x2e06('0x76'),_0x2e06('0x77'),_0x2e06('0x78'),_0x2e06('0x79'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x2e06('0x7a'),_0x2e06('0x7b'),_0x2e06('0x7c'),_0x2e06('0x7d'),_0x2e06('0x7e'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x2e06('0x7f'),'numberofchildincidents','onholdtime',_0x2e06('0x80'),_0x2e06('0x81'),'owneridtype',_0x2e06('0x82'),'parentcaseidname',_0x2e06('0x83'),_0x2e06('0x84'),_0x2e06('0x85'),_0x2e06('0x86'),'productserialnumber',_0x2e06('0x87'),_0x2e06('0x88'),_0x2e06('0x89'),_0x2e06('0x8a'),'responsiblecontactidyominame',_0x2e06('0x8b'),'slainvokedidname','slaname',_0x2e06('0x8c'),'statecode','statuscode',_0x2e06('0x8d'),_0x2e06('0x8e'),_0x2e06('0x8f'),_0x2e06('0x90'),'traversedpath',_0x2e06('0x91'),_0x2e06('0x92')];var _0x346cda=_0x14c20f[_0x2e06('0x93')](_0x198a86);return db[_0x2e06('0x2b')][_0x2e06('0x4d')]({'where':{'id':_0x11453d[_0x2e06('0x40')]['id']},'attributes':['id',_0x2e06('0x94'),_0x2e06('0x95'),_0x2e06('0x96'),_0x2e06('0x97'),_0x2e06('0x98'),_0x2e06('0x99')]})[_0x2e06('0x25')](handleEntityNotFound(_0x17e4bd,null))[_0x2e06('0x25')](function(_0x2a7218){if(_0x2a7218){_0x1ab6b0=_0x2a7218[_0x2e06('0x96')];var _0x41d705=_0x1ab6b0[_0x2e06('0x9a')](-0x1);if(_0x41d705==='/'){_0x1ab6b0=_0x1ab6b0[_0x2e06('0x9b')](0x0,_0x1ab6b0[_0x2e06('0x9c')](_0x41d705));}_0x1cfe10=util[_0x2e06('0x9d')]('%s/api/data/v9.0/',_0x1ab6b0);var _0x1ec792={'method':_0x2e06('0x9e'),'uri':_0x2e06('0x9f')+_0x2a7218['tenantId']+_0x2e06('0xa0'),'form':{'client_id':_0x2a7218['clientId'],'resource':_0x1ab6b0,'username':_0x2a7218['username'],'password':_0x2a7218[_0x2e06('0x95')],'grant_type':_0x2e06('0x95'),'client_secret':_0x2a7218['clientSecret']},'json':!![]};return rp(_0x1ec792);}})[_0x2e06('0x25')](function(_0x3685d5){_0x28304a=_0x3685d5[_0x2e06('0xa1')];var _0xf211b={'method':'GET','uri':encodeURI(_0x1cfe10+_0x2e06('0xa2')+_0x193205+'\x27'),'headers':{'Authorization':_0x2e06('0xa3')+_0x28304a,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0xf211b);})[_0x2e06('0x25')](function(_0x297dd8){var _0x4dc4aa=_0x297dd8[_0x2e06('0xa5')][0x0];var _0x28b892=_0x4dc4aa[_0x2e06('0xa6')];var _0x16c0f6={'method':_0x2e06('0xa7'),'uri':_0x1cfe10+_0x2e06('0xa8')+_0x28b892+_0x2e06('0xa9'),'headers':{'Authorization':_0x2e06('0xa3')+_0x28304a,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x16c0f6);})[_0x2e06('0x25')](function(_0x52c774){_0x1d7e5c=_0x52c774;_0x3bc2b1=_0x1d7e5c[_0x2e06('0xaa')];_0x3bc2b1=_[_0x2e06('0xab')](_0x3bc2b1,function(_0x17e6ff){return!_0x346cda[_0x2e06('0xac')](_0x17e6ff[_0x2e06('0xad')]);});var _0x4cd833=[];var _0x34094a=[];_0x3bc2b1[_0x2e06('0xae')](function(_0x50a366){if(_0x50a366[_0x2e06('0xaf')]){var _0x46fcb8=_0x50a366[_0x2e06('0xaf')]['substring'](_0x50a366[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0x46fcb8==='PicklistAttributeMetadata'){_0x4cd833[_0x2e06('0xb0')](getSelectList(_0x1cfe10,_0xe5e2d8,_0x34094a,_0x1d7e5c[_0x2e06('0xa6')],_0x50a366[_0x2e06('0xa6')],_0x28304a));}}});return Promise['all'](_0x4cd833);})[_0x2e06('0x25')](function(_0x15f0b5){_0x58acbc=_0x15f0b5[0x0];var _0xdeb315=[];var _0x2c74da=[];_0x3bc2b1['forEach'](function(_0xf02b8d){if(!_[_0x2e06('0xb1')](_0xf02b8d[_0x2e06('0xaf')])){var _0xeae7b6=_0xf02b8d[_0x2e06('0xaf')][_0x2e06('0x9b')](_0xf02b8d[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0xeae7b6===_0x2e06('0xb2')){_0xdeb315[_0x2e06('0xb0')](getBooleanList(_0x1cfe10,_0xe5e2d8,_0x2c74da,_0x1d7e5c[_0x2e06('0xa6')],_0xf02b8d[_0x2e06('0xa6')],_0x28304a));}}});return Promise[_0x2e06('0xb3')](_0xdeb315);})['then'](function(_0x2b513e){_0x13c83c=_0x2b513e[0x0];var _0x5ba3e0=[];var _0x4fc406=[];_0x3bc2b1[_0x2e06('0xae')](function(_0x32eeb3){if(_0x32eeb3[_0x2e06('0xaf')]){var _0x3dc893=_0x32eeb3[_0x2e06('0xaf')][_0x2e06('0x9b')](_0x32eeb3[_0x2e06('0xaf')][_0x2e06('0x9c')]('.')+0x1);if(_0x3dc893===_0x2e06('0xb4')||_0x3dc893===_0x2e06('0xb5')||_0x3dc893===_0x2e06('0xb6')||_0x3dc893==='IntegerAttributeMetadata'||_0x3dc893===_0x2e06('0xb7')||_0x3dc893===_0x2e06('0xb8')||_0x3dc893===_0x2e06('0xb9')||_0x3dc893===_0x2e06('0xba')||_0x3dc893==='StateAttributeMetadata'||_0x3dc893===_0x2e06('0xbb')){_0x5ba3e0[_0x2e06('0xb0')](getInputList(_0x1cfe10,_0xe5e2d8,_0x3dc893,_0x4fc406,_0x1d7e5c['MetadataId'],_0x32eeb3[_0x2e06('0xa6')],_0x28304a));}}});return Promise[_0x2e06('0xb3')](_0x5ba3e0);})['then'](function(_0x1f0571){_0x457354=_0x1f0571[0x0];var _0x3e5f2c=_0x58acbc[_0x2e06('0x93')](_0x13c83c)[_0x2e06('0x93')](_0x457354);var _0x2cd9e1={'count':_0x3e5f2c['length'],'rows':_0x3e5f2c};return _0x2cd9e1;})[_0x2e06('0x25')](respondWithResult(_0x17e4bd,null))[_0x2e06('0x45')](function(_0x90ce4){var _0xb7ba5=_0x11453d['query'][_0x2e06('0xbc')]?0x1f4:_0x90ce4[_0x2e06('0xbd')]||0x1f4;logger[_0x2e06('0x27')](_0x90ce4['stack']);delete _0x90ce4['name'];if(_0xb7ba5===0x191){_0xb7ba5=0x190;}_0x17e4bd[_0x2e06('0x19')](_0xb7ba5)[_0x2e06('0x29')](_0x11453d[_0x2e06('0x31')][_0x2e06('0xbc')]?{'message':'Wrong\x20credentials','statusCode':_0x90ce4[_0x2e06('0xbd')]}:_0x90ce4);});};function getSelectList(_0x78815,_0x11bb7a,_0x5ced86,_0x4a570b,_0x34f02d,_0x307660){var _0x2d03c4={'method':'GET','uri':_0x78815+_0x2e06('0xa8')+_0x4a570b+')/Attributes('+_0x34f02d+_0x2e06('0xbe')+_0x2e06('0xbf'),'headers':{'Authorization':_0x2e06('0xa3')+_0x307660,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x2d03c4)[_0x2e06('0x25')](function(_0x49553d){var _0x5b9e4f=[];var _0x2b1f75=_0x49553d[_0x2e06('0xc0')][_0x2e06('0xc1')];_0x2b1f75[_0x2e06('0xae')](function(_0x386d84){_0x5b9e4f[_0x2e06('0xb0')]({'name':_0x386d84[_0x2e06('0xc2')]['UserLocalizedLabel'][_0x2e06('0xc2')],'value':String(_0x386d84['Value'])});});var _0x492a36={'id':_0x11bb7a+'_'+_0x49553d[_0x2e06('0xad')],'name':_0x49553d['DisplayName']['UserLocalizedLabel'][_0x2e06('0xc2')],'custom':![],'options':_0x5b9e4f};_0x5ced86[_0x2e06('0xb0')](_0x492a36);return _0x5ced86;});}function getBooleanList(_0x331c6,_0x1039b1,_0x48f6be,_0x4f9944,_0x69cd94,_0xf2d164){var _0x13bfb1={'method':_0x2e06('0xa7'),'uri':_0x331c6+'EntityDefinitions('+_0x4f9944+_0x2e06('0xc3')+_0x69cd94+_0x2e06('0xc4'),'headers':{'Authorization':_0x2e06('0xa3')+_0xf2d164,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x13bfb1)['then'](function(_0x3fd245){var _0x44b9e4=[];_0x44b9e4[_0x2e06('0xb0')]({'name':_0x3fd245[_0x2e06('0xc0')][_0x2e06('0xc5')][_0x2e06('0xc2')][_0x2e06('0xc6')][_0x2e06('0xc2')],'value':_0x2e06('0xc7')},{'name':_0x3fd245['OptionSet']['FalseOption'][_0x2e06('0xc2')][_0x2e06('0xc6')]['Label'],'value':'false'});var _0x109172={'id':_0x1039b1+'_'+_0x3fd245['LogicalName'],'name':_0x3fd245[_0x2e06('0xc8')][_0x2e06('0xc6')][_0x2e06('0xc2')],'custom':![],'options':_0x44b9e4};_0x48f6be[_0x2e06('0xb0')](_0x109172);return _0x48f6be;});}function getInputList(_0x39cbce,_0x202e1d,_0x3593bf,_0x389d7a,_0x4abaa9,_0x4035c3,_0x3c0bcd){var _0x4f44b9={'method':_0x2e06('0xa7'),'uri':_0x39cbce+_0x2e06('0xa8')+_0x4abaa9+')/Attributes('+_0x4035c3+_0x2e06('0xc9')+_0x3593bf+_0x2e06('0xca'),'headers':{'Authorization':_0x2e06('0xa3')+_0x3c0bcd,'If-None-Match':null,'OData-Version':_0x2e06('0xa4')},'json':!![]};return rp(_0x4f44b9)[_0x2e06('0x25')](function(_0x59215a){var _0x4ec97b={'id':_0x202e1d+'_'+_0x59215a[_0x2e06('0xad')],'name':_0x59215a['DisplayName']['UserLocalizedLabel']?_0x59215a['DisplayName'][_0x2e06('0xc6')][_0x2e06('0xc2')]:_0x59215a[_0x2e06('0xad')],'custom':![],'options':[]};_0x389d7a[_0x2e06('0xb0')](_0x4ec97b);return _0x389d7a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 84bbf34..a0b10a4 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x1bd594,_0x2ed859){var _0x16ea2c=function(_0x1e3475){while(--_0x1e3475){_0x1bd594['push'](_0x1bd594['shift']());}};_0x16ea2c(++_0x2ed859);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xcb91[_0x47adb8];return _0x4689a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x4b25af,_0x31f809){var _0x17a698=function(_0x229bbf){while(--_0x229bbf){_0x4b25af['push'](_0x4b25af['shift']());}};_0x17a698(++_0x31f809);}(_0x757a,0xde));var _0xa757=function(_0x59c272,_0x3ce74a){_0x59c272=_0x59c272-0x0;var _0x339f6e=_0x757a[_0x59c272];return _0x339f6e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e82d12f..1b72cb0 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 _0xf09b=['attributes','include','map','model','then','ShowDynamics365Account','find','raw','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where'];(function(_0x8fd2ed,_0x4b99b9){var _0x2809c8=function(_0x599d80){while(--_0x599d80){_0x8fd2ed['push'](_0x8fd2ed['shift']());}};_0x2809c8(++_0x4b99b9);}(_0xf09b,0xae));var _0xbf09=function(_0x530674,_0x32e392){_0x530674=_0x530674-0x0;var _0x35df9c=_0xf09b[_0x530674];return _0x35df9c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf09('0x0'));var BPromise=require(_0xbf09('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf09('0x2'));var db=require(_0xbf09('0x3'))['db'];var utils=require(_0xbf09('0x4'));var logger=require(_0xbf09('0x5'))('rpc');var config=require(_0xbf09('0x6'));var jayson=require(_0xbf09('0x7'));var client=jayson[_0xbf09('0x8')][_0xbf09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373b59,_0x43a952,_0x4cc9f7){return new BPromise(function(_0x26a083,_0x441931){return client[_0xbf09('0xa')](_0x373b59,_0x4cc9f7)['then'](function(_0x191024){logger['info'](_0xbf09('0xb'),_0x43a952,_0xbf09('0xc'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x43a952,_0xbf09('0xc'),JSON[_0xbf09('0xd')](_0x191024));if(_0x191024['error']){if(_0x191024['error']['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x43a952,_0x191024[_0xbf09('0xe')][_0xbf09('0xf')]);return _0x441931(_0x191024[_0xbf09('0xe')][_0xbf09('0xf')]);}logger['error'](_0xbf09('0xb'),_0x43a952,_0x191024['error']['message']);return _0x26a083(_0x191024[_0xbf09('0xe')][_0xbf09('0xf')]);}else{logger[_0xbf09('0x10')](_0xbf09('0xb'),_0x43a952,_0xbf09('0xc'));_0x26a083(_0x191024[_0xbf09('0x11')][_0xbf09('0xf')]);}})[_0xbf09('0x12')](function(_0x1acce7){logger[_0xbf09('0xe')](_0xbf09('0xb'),_0x43a952,_0x1acce7);_0x441931(_0x1acce7);});});}exports[_0xbf09('0x13')]=function(_0x5002d1){var _0x531088=this;return new Promise(function(_0x298a97,_0x43fe20){return db[_0xbf09('0x14')][_0xbf09('0x15')]({'raw':_0x5002d1[_0xbf09('0x16')]?_0x5002d1[_0xbf09('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5002d1[_0xbf09('0x16')]?_0x5002d1[_0xbf09('0x16')][_0xbf09('0x17')]||null:null,'attributes':_0x5002d1[_0xbf09('0x16')]?_0x5002d1[_0xbf09('0x16')][_0xbf09('0x18')]||null:null,'limit':_0x5002d1['options']?_0x5002d1[_0xbf09('0x16')]['limit']||null:null,'include':_0x5002d1['options']?_0x5002d1['options'][_0xbf09('0x19')]?_[_0xbf09('0x1a')](_0x5002d1[_0xbf09('0x16')][_0xbf09('0x19')],function(_0x14d046){return{'model':db[_0x14d046[_0xbf09('0x1b')]],'as':_0x14d046['as'],'attributes':_0x14d046['attributes'],'include':_0x14d046[_0xbf09('0x19')]?_[_0xbf09('0x1a')](_0x14d046[_0xbf09('0x19')],function(_0x4c04a1){return{'model':db[_0x4c04a1[_0xbf09('0x1b')]],'as':_0x4c04a1['as'],'attributes':_0x4c04a1['attributes'],'include':_0x4c04a1['include']?_[_0xbf09('0x1a')](_0x4c04a1[_0xbf09('0x19')],function(_0x1d8384){return{'model':db[_0x1d8384[_0xbf09('0x1b')]],'as':_0x1d8384['as'],'attributes':_0x1d8384[_0xbf09('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbf09('0x1c')](function(_0x5264e9){logger[_0xbf09('0x10')](_0xbf09('0x13'),_0x5002d1);logger['debug'](_0xbf09('0x13'),_0x5002d1,JSON[_0xbf09('0xd')](_0x5264e9));_0x298a97(_0x5264e9);})[_0xbf09('0x12')](function(_0xfe5a8f){logger['error'](_0xbf09('0x13'),_0xfe5a8f[_0xbf09('0xf')],_0x5002d1);_0x43fe20(_0x531088[_0xbf09('0xe')](0x1f4,_0xfe5a8f[_0xbf09('0xf')]));});});};exports[_0xbf09('0x1d')]=function(_0xbd56c1){var _0x57ec8d=this;return new Promise(function(_0x2cbc97,_0x1c6f68){return db[_0xbf09('0x14')][_0xbf09('0x1e')]({'raw':_0xbd56c1['options']?_0xbd56c1[_0xbf09('0x16')][_0xbf09('0x1f')]===undefined?!![]:![]:!![],'where':_0xbd56c1[_0xbf09('0x16')]?_0xbd56c1['options'][_0xbf09('0x17')]||null:null,'attributes':_0xbd56c1[_0xbf09('0x16')]?_0xbd56c1[_0xbf09('0x16')][_0xbf09('0x18')]||null:null,'include':_0xbd56c1[_0xbf09('0x16')]?_0xbd56c1['options'][_0xbf09('0x19')]?_['map'](_0xbd56c1[_0xbf09('0x16')][_0xbf09('0x19')],function(_0x2bc309){return{'model':db[_0x2bc309['model']],'as':_0x2bc309['as'],'attributes':_0x2bc309[_0xbf09('0x18')],'include':_0x2bc309[_0xbf09('0x19')]?_[_0xbf09('0x1a')](_0x2bc309['include'],function(_0x5b8732){return{'model':db[_0x5b8732[_0xbf09('0x1b')]],'as':_0x5b8732['as'],'attributes':_0x5b8732[_0xbf09('0x18')],'include':_0x5b8732[_0xbf09('0x19')]?_[_0xbf09('0x1a')](_0x5b8732[_0xbf09('0x19')],function(_0x2ca4f2){return{'model':db[_0x2ca4f2[_0xbf09('0x1b')]],'as':_0x2ca4f2['as'],'attributes':_0x2ca4f2[_0xbf09('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbf09('0x1c')](function(_0x378374){logger[_0xbf09('0x10')](_0xbf09('0x1d'),_0xbd56c1);logger[_0xbf09('0x20')](_0xbf09('0x1d'),_0xbd56c1,JSON[_0xbf09('0xd')](_0x378374));_0x2cbc97(_0x378374);})[_0xbf09('0x12')](function(_0x5e71a7){logger['error'](_0xbf09('0x1d'),_0x5e71a7[_0xbf09('0xf')],_0xbd56c1);_0x1c6f68(_0x57ec8d['error'](0x1f4,_0x5e71a7[_0xbf09('0xf')]));});});}; \ No newline at end of file +var _0x8095=['model','then','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8095,0x77));var _0x5809=function(_0x3a15aa,_0x5d4987){_0x3a15aa=_0x3a15aa-0x0;var _0x26c2bb=_0x8095[_0x3a15aa];return _0x26c2bb;};'use strict';var _=require(_0x5809('0x0'));var util=require(_0x5809('0x1'));var moment=require(_0x5809('0x2'));var BPromise=require(_0x5809('0x3'));var rs=require(_0x5809('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5809('0x5'))['db'];var utils=require(_0x5809('0x6'));var logger=require(_0x5809('0x7'))(_0x5809('0x8'));var config=require(_0x5809('0x9'));var jayson=require(_0x5809('0xa'));var client=jayson['client'][_0x5809('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe24f98,_0x2933cf,_0x403f64){return new BPromise(function(_0x48bd8a,_0x38415e){return client[_0x5809('0xc')](_0xe24f98,_0x403f64)['then'](function(_0x1a1018){logger[_0x5809('0xd')](_0x5809('0xe'),_0x2933cf,_0x5809('0xf'));logger[_0x5809('0x10')](_0x5809('0x11'),_0x2933cf,_0x5809('0xf'),JSON[_0x5809('0x12')](_0x1a1018));if(_0x1a1018[_0x5809('0x13')]){if(_0x1a1018[_0x5809('0x13')][_0x5809('0x14')]===0x1f4){logger[_0x5809('0x13')](_0x5809('0xe'),_0x2933cf,_0x1a1018[_0x5809('0x13')][_0x5809('0x15')]);return _0x38415e(_0x1a1018[_0x5809('0x13')]['message']);}logger[_0x5809('0x13')](_0x5809('0xe'),_0x2933cf,_0x1a1018[_0x5809('0x13')][_0x5809('0x15')]);return _0x48bd8a(_0x1a1018[_0x5809('0x13')]['message']);}else{logger[_0x5809('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x2933cf,'request\x20sent');_0x48bd8a(_0x1a1018[_0x5809('0x16')][_0x5809('0x15')]);}})[_0x5809('0x17')](function(_0x3c77f4){logger[_0x5809('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x2933cf,_0x3c77f4);_0x38415e(_0x3c77f4);});});}exports[_0x5809('0x18')]=function(_0x4bf688){var _0x1daee4=this;return new Promise(function(_0x429b25,_0x2b7011){return db[_0x5809('0x19')][_0x5809('0x1a')]({'raw':_0x4bf688[_0x5809('0x1b')]?_0x4bf688[_0x5809('0x1b')][_0x5809('0x1c')]===undefined?!![]:![]:!![],'where':_0x4bf688[_0x5809('0x1b')]?_0x4bf688[_0x5809('0x1b')]['where']||null:null,'attributes':_0x4bf688['options']?_0x4bf688[_0x5809('0x1b')][_0x5809('0x1d')]||null:null,'limit':_0x4bf688[_0x5809('0x1b')]?_0x4bf688[_0x5809('0x1b')][_0x5809('0x1e')]||null:null,'include':_0x4bf688[_0x5809('0x1b')]?_0x4bf688[_0x5809('0x1b')][_0x5809('0x1f')]?_[_0x5809('0x20')](_0x4bf688[_0x5809('0x1b')][_0x5809('0x1f')],function(_0x26ec1b){return{'model':db[_0x26ec1b['model']],'as':_0x26ec1b['as'],'attributes':_0x26ec1b[_0x5809('0x1d')],'include':_0x26ec1b['include']?_[_0x5809('0x20')](_0x26ec1b[_0x5809('0x1f')],function(_0x5e6f32){return{'model':db[_0x5e6f32[_0x5809('0x21')]],'as':_0x5e6f32['as'],'attributes':_0x5e6f32[_0x5809('0x1d')],'include':_0x5e6f32[_0x5809('0x1f')]?_[_0x5809('0x20')](_0x5e6f32['include'],function(_0x475c42){return{'model':db[_0x475c42[_0x5809('0x21')]],'as':_0x475c42['as'],'attributes':_0x475c42['attributes']};}):[]};}):[]};}):[]:[]})[_0x5809('0x22')](function(_0x2de912){logger[_0x5809('0xd')](_0x5809('0x18'),_0x4bf688);logger[_0x5809('0x10')](_0x5809('0x18'),_0x4bf688,JSON[_0x5809('0x12')](_0x2de912));_0x429b25(_0x2de912);})[_0x5809('0x17')](function(_0xe01c69){logger[_0x5809('0x13')](_0x5809('0x18'),_0xe01c69[_0x5809('0x15')],_0x4bf688);_0x2b7011(_0x1daee4[_0x5809('0x13')](0x1f4,_0xe01c69[_0x5809('0x15')]));});});};exports[_0x5809('0x23')]=function(_0x2e0765){var _0x4995bb=this;return new Promise(function(_0x459f68,_0x36521b){return db[_0x5809('0x19')][_0x5809('0x24')]({'raw':_0x2e0765[_0x5809('0x1b')]?_0x2e0765['options'][_0x5809('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e0765['options']?_0x2e0765[_0x5809('0x1b')][_0x5809('0x25')]||null:null,'attributes':_0x2e0765['options']?_0x2e0765['options'][_0x5809('0x1d')]||null:null,'include':_0x2e0765[_0x5809('0x1b')]?_0x2e0765[_0x5809('0x1b')]['include']?_[_0x5809('0x20')](_0x2e0765[_0x5809('0x1b')][_0x5809('0x1f')],function(_0x4721ba){return{'model':db[_0x4721ba[_0x5809('0x21')]],'as':_0x4721ba['as'],'attributes':_0x4721ba['attributes'],'include':_0x4721ba[_0x5809('0x1f')]?_['map'](_0x4721ba[_0x5809('0x1f')],function(_0x41ecb9){return{'model':db[_0x41ecb9['model']],'as':_0x41ecb9['as'],'attributes':_0x41ecb9[_0x5809('0x1d')],'include':_0x41ecb9[_0x5809('0x1f')]?_[_0x5809('0x20')](_0x41ecb9[_0x5809('0x1f')],function(_0x4abcef){return{'model':db[_0x4abcef[_0x5809('0x21')]],'as':_0x4abcef['as'],'attributes':_0x4abcef[_0x5809('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5809('0x22')](function(_0x374d96){logger[_0x5809('0xd')](_0x5809('0x23'),_0x2e0765);logger[_0x5809('0x10')](_0x5809('0x23'),_0x2e0765,JSON[_0x5809('0x12')](_0x374d96));_0x459f68(_0x374d96);})[_0x5809('0x17')](function(_0x23b6a){logger[_0x5809('0x13')](_0x5809('0x23'),_0x23b6a[_0x5809('0x15')],_0x2e0765);_0x36521b(_0x4995bb[_0x5809('0x13')](0x1f4,_0x23b6a[_0x5809('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1640973..592b810 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 _0x1635=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1635,0x1ae));var _0x5163=function(_0x168e15,_0x9d8542){_0x168e15=_0x168e15-0x0;var _0x10ed7f=_0x1635[_0x168e15];return _0x10ed7f;};'use strict';var multer=require(_0x5163('0x0'));var util=require(_0x5163('0x1'));var path=require(_0x5163('0x2'));var timeout=require(_0x5163('0x3'));var express=require(_0x5163('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5163('0x5'));var controller=require(_0x5163('0x6'));router[_0x5163('0x7')]('/',auth[_0x5163('0x8')](),controller[_0x5163('0x9')]);router[_0x5163('0x7')](_0x5163('0xa'),auth[_0x5163('0x8')](),controller[_0x5163('0xb')]);router[_0x5163('0x7')](_0x5163('0xc'),auth['isAuthenticated'](),controller[_0x5163('0xd')]);router['get'](_0x5163('0xe'),auth[_0x5163('0x8')](),controller[_0x5163('0xf')]);router[_0x5163('0x7')](_0x5163('0x10'),auth[_0x5163('0x8')](),controller[_0x5163('0x11')]);router[_0x5163('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5163('0x13')](_0x5163('0xa'),auth[_0x5163('0x8')](),controller[_0x5163('0x14')]);router['delete'](_0x5163('0xa'),auth[_0x5163('0x8')](),controller[_0x5163('0x15')]);module[_0x5163('0x16')]=router; \ No newline at end of file +var _0xf9ae=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','post','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5dc73b,_0x643993){var _0x5f4532=function(_0x1338a7){while(--_0x1338a7){_0x5dc73b['push'](_0x5dc73b['shift']());}};_0x5f4532(++_0x643993);}(_0xf9ae,0x85));var _0xef9a=function(_0x160b52,_0x38e693){_0x160b52=_0x160b52-0x0;var _0x5de72d=_0xf9ae[_0x160b52];return _0x5de72d;};'use strict';var multer=require(_0xef9a('0x0'));var util=require(_0xef9a('0x1'));var path=require('path');var timeout=require(_0xef9a('0x2'));var express=require(_0xef9a('0x3'));var router=express[_0xef9a('0x4')]();var fs_extra=require(_0xef9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xef9a('0x6'));var config=require(_0xef9a('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0xef9a('0x8')]('/',auth[_0xef9a('0x9')](),controller[_0xef9a('0xa')]);router['get'](_0xef9a('0xb'),auth[_0xef9a('0x9')](),controller[_0xef9a('0xc')]);router['get'](_0xef9a('0xd'),auth[_0xef9a('0x9')](),controller['getFields']);router[_0xef9a('0x8')](_0xef9a('0xe'),auth[_0xef9a('0x9')](),controller['getSubjects']);router[_0xef9a('0x8')]('/:id/descriptions',auth[_0xef9a('0x9')](),controller[_0xef9a('0xf')]);router[_0xef9a('0x10')]('/',auth[_0xef9a('0x9')](),controller['create']);router[_0xef9a('0x11')]('/:id',auth[_0xef9a('0x9')](),controller['update']);router[_0xef9a('0x12')](_0xef9a('0xb'),auth[_0xef9a('0x9')](),controller[_0xef9a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3af68dc..8c6da03 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 _0xdbac=['exports','STRING','ENUM','incident'];(function(_0x2a3a1e,_0x391126){var _0x417a1c=function(_0x466fc6){while(--_0x466fc6){_0x2a3a1e['push'](_0x2a3a1e['shift']());}};_0x417a1c(++_0x391126);}(_0xdbac,0xcc));var _0xcdba=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xdbac[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0xcdba('0x0')]={'name':{'type':Sequelize[_0xcdba('0x1')]},'description':{'type':Sequelize[_0xcdba('0x1')]},'ticketType':{'type':Sequelize[_0xcdba('0x2')](_0xcdba('0x3'),'phonecall'),'defaultValue':'incident'}}; \ No newline at end of file +var _0x6d6b=['ENUM','incident','phonecall','STRING'];(function(_0x285c7d,_0x49d3b4){var _0x3bd648=function(_0x4b101b){while(--_0x4b101b){_0x285c7d['push'](_0x285c7d['shift']());}};_0x3bd648(++_0x49d3b4);}(_0x6d6b,0x1bf));var _0xb6d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d6b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb6d6('0x0')]},'ticketType':{'type':Sequelize[_0xb6d6('0x1')](_0xb6d6('0x2'),_0xb6d6('0x3')),'defaultValue':_0xb6d6('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9f4cc0c..73e6251 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 _0xef9c=['limit','count','offset','apply','save','update','then','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','Dynamics365Configuration','includeAll','include','catch','params','find','create','body','destroy','getFields','Dynamics365Field','rawAttributes','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined'];(function(_0x178ca1,_0xba37c8){var _0x5f2668=function(_0x5e41f5){while(--_0x5e41f5){_0x178ca1['push'](_0x178ca1['shift']());}};_0x5f2668(++_0xba37c8);}(_0xef9c,0x1a8));var _0xcef9=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0xef9c[_0x381379];return _0x3e1063;};'use strict';var emlformat=require(_0xcef9('0x0'));var rimraf=require(_0xcef9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcef9('0x2'));var rp=require(_0xcef9('0x3'));var moment=require('moment');var BPromise=require(_0xcef9('0x4'));var Mustache=require(_0xcef9('0x5'));var util=require('util');var path=require(_0xcef9('0x6'));var sox=require(_0xcef9('0x7'));var csv=require(_0xcef9('0x8'));var ejs=require(_0xcef9('0x9'));var fs=require('fs');var fs_extra=require(_0xcef9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcef9('0xb'));var jsforce=require(_0xcef9('0xc'));var deskjs=require(_0xcef9('0xd'));var toCsv=require(_0xcef9('0x8'));var querystring=require(_0xcef9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcef9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcef9('0x10'));var hardwareService=require(_0xcef9('0x11'));var logger=require('../../config/logger')(_0xcef9('0x12'));var utils=require(_0xcef9('0x13'));var config=require(_0xcef9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcef9('0x15'))['db'];function respondWithStatusCode(_0x47d83a,_0x59f6ef){_0x59f6ef=_0x59f6ef||0xcc;return function(_0x5dcf2b){if(_0x5dcf2b){return _0x47d83a['sendStatus'](_0x59f6ef);}return _0x47d83a[_0xcef9('0x16')](_0x59f6ef)[_0xcef9('0x17')]();};}function respondWithResult(_0xd64c00,_0x6000be){_0x6000be=_0x6000be||0xc8;return function(_0x53e703){if(_0x53e703){return _0xd64c00['status'](_0x6000be)[_0xcef9('0x18')](_0x53e703);}};}function respondWithFilteredResult(_0x4cba59,_0x36d7a4){return function(_0x1aaedd){if(_0x1aaedd){var _0x186687=typeof _0x36d7a4['offset']===_0xcef9('0x19')&&typeof _0x36d7a4[_0xcef9('0x1a')]==='undefined';var _0x6e2a69=_0x1aaedd[_0xcef9('0x1b')];var _0x20bfbb=_0x186687?0x0:_0x36d7a4[_0xcef9('0x1c')];var _0x22b2e4=_0x186687?_0x1aaedd['count']:_0x36d7a4[_0xcef9('0x1c')]+_0x36d7a4[_0xcef9('0x1a')];var _0x2a3198;if(_0x22b2e4>=_0x6e2a69){_0x22b2e4=_0x6e2a69;_0x2a3198=0xc8;}else{_0x2a3198=0xce;}_0x4cba59['status'](_0x2a3198);return _0x4cba59['set']('Content-Range',_0x20bfbb+'-'+_0x22b2e4+'/'+_0x6e2a69)[_0xcef9('0x18')](_0x1aaedd);}return null;};}function patchUpdates(_0x5d2e70){return function(_0x57b9b2){try{jsonpatch[_0xcef9('0x1d')](_0x57b9b2,_0x5d2e70,!![]);}catch(_0x453d2f){return BPromise['reject'](_0x453d2f);}return _0x57b9b2[_0xcef9('0x1e')]();};}function saveUpdates(_0x5552cc,_0x14a131){return function(_0x251751){if(_0x251751){return _0x251751[_0xcef9('0x1f')](_0x5552cc)['then'](function(_0x2ee066){return _0x2ee066;});}return null;};}function removeEntity(_0x40e02f,_0x28ae31){return function(_0x3c364b){if(_0x3c364b){return _0x3c364b['destroy']()[_0xcef9('0x20')](function(){_0x40e02f['status'](0xcc)[_0xcef9('0x17')]();});}};}function handleEntityNotFound(_0x50b607,_0x659c8d){return function(_0x24da19){if(!_0x24da19){_0x50b607[_0xcef9('0x21')](0x194);}return _0x24da19;};}function handleError(_0x4e131d,_0x4f9607){_0x4f9607=_0x4f9607||0x1f4;return function(_0x44bf99){logger[_0xcef9('0x22')](_0x44bf99[_0xcef9('0x23')]);if(_0x44bf99[_0xcef9('0x24')]){delete _0x44bf99[_0xcef9('0x24')];}_0x4e131d[_0xcef9('0x16')](_0x4f9607)[_0xcef9('0x25')](_0x44bf99);};}exports[_0xcef9('0x26')]=function(_0x9e9249,_0x47d254){var _0x9caa3a={},_0xbc1827={},_0x1feca4={'count':0x0,'rows':[]};var _0x5eb015=_[_0xcef9('0x27')](db['Dynamics365Configuration']['rawAttributes'],function(_0x38d1cd){return{'name':_0x38d1cd[_0xcef9('0x28')],'type':_0x38d1cd['type'][_0xcef9('0x29')]};});_0xbc1827[_0xcef9('0x2a')]=_['map'](_0x5eb015,_0xcef9('0x24'));_0xbc1827[_0xcef9('0x2b')]=_[_0xcef9('0x2c')](_0x9e9249[_0xcef9('0x2b')]);_0xbc1827['filters']=_[_0xcef9('0x2d')](_0xbc1827[_0xcef9('0x2a')],_0xbc1827['query']);_0x9caa3a['attributes']=_['intersection'](_0xbc1827[_0xcef9('0x2a')],qs[_0xcef9('0x2e')](_0x9e9249[_0xcef9('0x2b')][_0xcef9('0x2e')]));_0x9caa3a[_0xcef9('0x2f')]=_0x9caa3a['attributes'][_0xcef9('0x30')]?_0x9caa3a[_0xcef9('0x2f')]:_0xbc1827[_0xcef9('0x2a')];if(!_0x9e9249[_0xcef9('0x2b')][_0xcef9('0x31')]('nolimit')){_0x9caa3a['limit']=qs['limit'](_0x9e9249['query'][_0xcef9('0x1a')]);_0x9caa3a[_0xcef9('0x1c')]=qs[_0xcef9('0x1c')](_0x9e9249['query'][_0xcef9('0x1c')]);}_0x9caa3a[_0xcef9('0x32')]=qs[_0xcef9('0x33')](_0x9e9249[_0xcef9('0x2b')][_0xcef9('0x33')]);_0x9caa3a['where']=qs[_0xcef9('0x34')](_[_0xcef9('0x35')](_0x9e9249[_0xcef9('0x2b')],_0xbc1827['filters']),_0x5eb015);if(_0x9e9249[_0xcef9('0x2b')][_0xcef9('0x36')]){_0x9caa3a['where']=_[_0xcef9('0x37')](_0x9caa3a[_0xcef9('0x38')],{'$or':_[_0xcef9('0x27')](_0x5eb015,function(_0x36365d){if(_0x36365d['type']!==_0xcef9('0x39')){var _0x446b0a={};_0x446b0a[_0x36365d[_0xcef9('0x24')]]={'$like':'%'+_0x9e9249['query'][_0xcef9('0x36')]+'%'};return _0x446b0a;}})});}_0x9caa3a=_[_0xcef9('0x37')]({},_0x9caa3a,_0x9e9249[_0xcef9('0x3a')]);var _0x3e3fbe={'where':_0x9caa3a['where']};return db[_0xcef9('0x3b')][_0xcef9('0x1b')](_0x3e3fbe)[_0xcef9('0x20')](function(_0x869d83){_0x1feca4[_0xcef9('0x1b')]=_0x869d83;if(_0x9e9249['query'][_0xcef9('0x3c')]){_0x9caa3a[_0xcef9('0x3d')]=[{'all':!![]}];}return db[_0xcef9('0x3b')]['findAll'](_0x9caa3a);})[_0xcef9('0x20')](function(_0x1a9fe3){_0x1feca4['rows']=_0x1a9fe3;return _0x1feca4;})[_0xcef9('0x20')](respondWithFilteredResult(_0x47d254,_0x9caa3a))[_0xcef9('0x3e')](handleError(_0x47d254,null));};exports['show']=function(_0x4d09e6,_0x2d3941){var _0x305491={'raw':![],'where':{'id':_0x4d09e6[_0xcef9('0x3f')]['id']}},_0x441b65={};_0x441b65[_0xcef9('0x2a')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x441b65['query']=_[_0xcef9('0x2c')](_0x4d09e6[_0xcef9('0x2b')]);_0x441b65['filters']=_[_0xcef9('0x2d')](_0x441b65[_0xcef9('0x2a')],_0x441b65[_0xcef9('0x2b')]);_0x305491[_0xcef9('0x2f')]=_['intersection'](_0x441b65[_0xcef9('0x2a')],qs[_0xcef9('0x2e')](_0x4d09e6[_0xcef9('0x2b')][_0xcef9('0x2e')]));_0x305491[_0xcef9('0x2f')]=_0x305491[_0xcef9('0x2f')]['length']?_0x305491[_0xcef9('0x2f')]:_0x441b65[_0xcef9('0x2a')];if(_0x4d09e6[_0xcef9('0x2b')][_0xcef9('0x3c')]){_0x305491[_0xcef9('0x3d')]=[{'all':!![]}];}_0x305491=_['merge']({},_0x305491,_0x4d09e6[_0xcef9('0x3a')]);return db['Dynamics365Configuration'][_0xcef9('0x40')](_0x305491)[_0xcef9('0x20')](handleEntityNotFound(_0x2d3941,null))[_0xcef9('0x20')](respondWithResult(_0x2d3941,null))[_0xcef9('0x3e')](handleError(_0x2d3941,null));};exports[_0xcef9('0x41')]=function(_0x4e6cb2,_0x371705){return db['Dynamics365Configuration'][_0xcef9('0x41')](_0x4e6cb2[_0xcef9('0x42')],{})[_0xcef9('0x20')](respondWithResult(_0x371705,0xc9))[_0xcef9('0x3e')](handleError(_0x371705,null));};exports[_0xcef9('0x1f')]=function(_0xbcfc1c,_0x353625){if(_0xbcfc1c['body']['id']){delete _0xbcfc1c[_0xcef9('0x42')]['id'];}return db[_0xcef9('0x3b')][_0xcef9('0x40')]({'where':{'id':_0xbcfc1c['params']['id']}})['then'](handleEntityNotFound(_0x353625,null))[_0xcef9('0x20')](saveUpdates(_0xbcfc1c[_0xcef9('0x42')],null))['then'](respondWithResult(_0x353625,null))[_0xcef9('0x3e')](handleError(_0x353625,null));};exports[_0xcef9('0x43')]=function(_0x52014d,_0x4037e1){return db[_0xcef9('0x3b')][_0xcef9('0x40')]({'where':{'id':_0x52014d[_0xcef9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4037e1,null))['then'](removeEntity(_0x4037e1,null))['catch'](handleError(_0x4037e1,null));};exports[_0xcef9('0x44')]=function(_0x2bfed6,_0x5f572e,_0x2c7f7a){var _0x40b729={};var _0xcb8357={};var _0x5be72d;var _0x10ab1c;return db[_0xcef9('0x3b')]['findOne']({'where':{'id':_0x2bfed6['params']['id']}})['then'](handleEntityNotFound(_0x5f572e,null))[_0xcef9('0x20')](function(_0x1521e4){if(_0x1521e4){_0x5be72d=_0x1521e4;_0xcb8357[_0xcef9('0x2a')]=_['keys'](db[_0xcef9('0x45')][_0xcef9('0x46')]);_0xcb8357[_0xcef9('0x2b')]=_[_0xcef9('0x2c')](_0x2bfed6[_0xcef9('0x2b')]);_0xcb8357[_0xcef9('0x34')]=_['intersection'](_0xcb8357[_0xcef9('0x2a')],_0xcb8357[_0xcef9('0x2b')]);_0x40b729['attributes']=_[_0xcef9('0x2d')](_0xcb8357[_0xcef9('0x2a')],qs[_0xcef9('0x2e')](_0x2bfed6[_0xcef9('0x2b')]['fields']));_0x40b729[_0xcef9('0x2f')]=_0x40b729[_0xcef9('0x2f')][_0xcef9('0x30')]?_0x40b729[_0xcef9('0x2f')]:_0xcb8357[_0xcef9('0x2a')];_0x40b729[_0xcef9('0x32')]=qs['sort'](_0x2bfed6[_0xcef9('0x2b')][_0xcef9('0x33')]);_0x40b729[_0xcef9('0x38')]=qs[_0xcef9('0x34')](_[_0xcef9('0x35')](_0x2bfed6['query'],_0xcb8357[_0xcef9('0x34')]));if(_0x2bfed6[_0xcef9('0x2b')]['filter']){_0x40b729['where']=_[_0xcef9('0x37')](_0x40b729[_0xcef9('0x38')],{'$or':_[_0xcef9('0x27')](_0x40b729[_0xcef9('0x2f')],function(_0x24a92d){var _0x5138ff={};_0x5138ff[_0x24a92d]={'$like':'%'+_0x2bfed6['query'][_0xcef9('0x36')]+'%'};return _0x5138ff;})});}_0x40b729=_[_0xcef9('0x37')]({},_0x40b729,_0x2bfed6[_0xcef9('0x3a')]);return _0x5be72d['getFields'](_0x40b729);}})[_0xcef9('0x20')](function(_0x3e5868){if(_0x3e5868){_0x10ab1c=_0x3e5868[_0xcef9('0x30')];if(!_0x2bfed6[_0xcef9('0x2b')][_0xcef9('0x31')](_0xcef9('0x47'))){_0x40b729['limit']=qs[_0xcef9('0x1a')](_0x2bfed6[_0xcef9('0x2b')][_0xcef9('0x1a')]);_0x40b729[_0xcef9('0x1c')]=qs[_0xcef9('0x1c')](_0x2bfed6['query'][_0xcef9('0x1c')]);}return _0x5be72d[_0xcef9('0x44')](_0x40b729);}})['then'](function(_0x181a63){if(_0x181a63){return _0x181a63?{'count':_0x10ab1c,'rows':_0x181a63}:null;}})[_0xcef9('0x20')](respondWithResult(_0x5f572e,null))[_0xcef9('0x3e')](handleError(_0x5f572e,null));};exports[_0xcef9('0x48')]=function(_0x13ea15,_0x4f3b7e,_0x46e309){var _0xc922eb={};var _0x21aef7={};var _0x1d90e5;var _0x48fd58;return db[_0xcef9('0x3b')][_0xcef9('0x49')]({'where':{'id':_0x13ea15['params']['id']}})[_0xcef9('0x20')](handleEntityNotFound(_0x4f3b7e,null))[_0xcef9('0x20')](function(_0xd63641){if(_0xd63641){_0x1d90e5=_0xd63641;_0x21aef7[_0xcef9('0x2a')]=_[_0xcef9('0x2c')](db[_0xcef9('0x45')][_0xcef9('0x46')]);_0x21aef7[_0xcef9('0x2b')]=_[_0xcef9('0x2c')](_0x13ea15[_0xcef9('0x2b')]);_0x21aef7[_0xcef9('0x34')]=_[_0xcef9('0x2d')](_0x21aef7[_0xcef9('0x2a')],_0x21aef7[_0xcef9('0x2b')]);_0xc922eb[_0xcef9('0x2f')]=_['intersection'](_0x21aef7[_0xcef9('0x2a')],qs[_0xcef9('0x2e')](_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x2e')]));_0xc922eb[_0xcef9('0x2f')]=_0xc922eb['attributes'][_0xcef9('0x30')]?_0xc922eb['attributes']:_0x21aef7[_0xcef9('0x2a')];_0xc922eb[_0xcef9('0x32')]=qs[_0xcef9('0x33')](_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x33')]);_0xc922eb[_0xcef9('0x38')]=qs['filters'](_['pick'](_0x13ea15[_0xcef9('0x2b')],_0x21aef7[_0xcef9('0x34')]));if(_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x36')]){_0xc922eb[_0xcef9('0x38')]=_[_0xcef9('0x37')](_0xc922eb['where'],{'$or':_[_0xcef9('0x27')](_0xc922eb[_0xcef9('0x2f')],function(_0x46fb2f){var _0x39cdd0={};_0x39cdd0[_0x46fb2f]={'$like':'%'+_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x36')]+'%'};return _0x39cdd0;})});}_0xc922eb=_['merge']({},_0xc922eb,_0x13ea15['options']);return _0x1d90e5['getSubjects'](_0xc922eb);}})['then'](function(_0x35715a){if(_0x35715a){_0x48fd58=_0x35715a[_0xcef9('0x30')];if(!_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x31')](_0xcef9('0x47'))){_0xc922eb['limit']=qs[_0xcef9('0x1a')](_0x13ea15[_0xcef9('0x2b')][_0xcef9('0x1a')]);_0xc922eb['offset']=qs[_0xcef9('0x1c')](_0x13ea15['query'][_0xcef9('0x1c')]);}return _0x1d90e5[_0xcef9('0x48')](_0xc922eb);}})['then'](function(_0x30f48b){if(_0x30f48b){return _0x30f48b?{'count':_0x48fd58,'rows':_0x30f48b}:null;}})[_0xcef9('0x20')](respondWithResult(_0x4f3b7e,null))[_0xcef9('0x3e')](handleError(_0x4f3b7e,null));};exports[_0xcef9('0x4a')]=function(_0x2234ad,_0x1e0b05,_0x2368e4){var _0x3e60ce={};var _0x11a1d0={};var _0x5b1500;var _0x10d676;return db[_0xcef9('0x3b')][_0xcef9('0x49')]({'where':{'id':_0x2234ad[_0xcef9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e0b05,null))['then'](function(_0x1e2d44){if(_0x1e2d44){_0x5b1500=_0x1e2d44;_0x11a1d0[_0xcef9('0x2a')]=_[_0xcef9('0x2c')](db['Dynamics365Field']['rawAttributes']);_0x11a1d0[_0xcef9('0x2b')]=_[_0xcef9('0x2c')](_0x2234ad[_0xcef9('0x2b')]);_0x11a1d0[_0xcef9('0x34')]=_[_0xcef9('0x2d')](_0x11a1d0[_0xcef9('0x2a')],_0x11a1d0[_0xcef9('0x2b')]);_0x3e60ce[_0xcef9('0x2f')]=_[_0xcef9('0x2d')](_0x11a1d0['model'],qs[_0xcef9('0x2e')](_0x2234ad['query'][_0xcef9('0x2e')]));_0x3e60ce[_0xcef9('0x2f')]=_0x3e60ce[_0xcef9('0x2f')]['length']?_0x3e60ce[_0xcef9('0x2f')]:_0x11a1d0[_0xcef9('0x2a')];_0x3e60ce[_0xcef9('0x32')]=qs[_0xcef9('0x33')](_0x2234ad['query'][_0xcef9('0x33')]);_0x3e60ce[_0xcef9('0x38')]=qs[_0xcef9('0x34')](_[_0xcef9('0x35')](_0x2234ad['query'],_0x11a1d0[_0xcef9('0x34')]));if(_0x2234ad[_0xcef9('0x2b')][_0xcef9('0x36')]){_0x3e60ce['where']=_[_0xcef9('0x37')](_0x3e60ce[_0xcef9('0x38')],{'$or':_[_0xcef9('0x27')](_0x3e60ce[_0xcef9('0x2f')],function(_0x4d0075){var _0x1df84e={};_0x1df84e[_0x4d0075]={'$like':'%'+_0x2234ad[_0xcef9('0x2b')][_0xcef9('0x36')]+'%'};return _0x1df84e;})});}_0x3e60ce=_[_0xcef9('0x37')]({},_0x3e60ce,_0x2234ad[_0xcef9('0x3a')]);return _0x5b1500[_0xcef9('0x4a')](_0x3e60ce);}})[_0xcef9('0x20')](function(_0x57f508){if(_0x57f508){_0x10d676=_0x57f508[_0xcef9('0x30')];if(!_0x2234ad[_0xcef9('0x2b')][_0xcef9('0x31')](_0xcef9('0x47'))){_0x3e60ce[_0xcef9('0x1a')]=qs['limit'](_0x2234ad['query'][_0xcef9('0x1a')]);_0x3e60ce[_0xcef9('0x1c')]=qs[_0xcef9('0x1c')](_0x2234ad[_0xcef9('0x2b')][_0xcef9('0x1c')]);}return _0x5b1500['getDescriptions'](_0x3e60ce);}})[_0xcef9('0x20')](function(_0x47dc64){if(_0x47dc64){return _0x47dc64?{'count':_0x10d676,'rows':_0x47dc64}:null;}})['then'](respondWithResult(_0x1e0b05,null))[_0xcef9('0x3e')](handleError(_0x1e0b05,null));}; \ No newline at end of file +var _0xbab6=['type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','findOne','Dynamics365Field','hasOwnProperty','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','Dynamics365Configuration','rawAttributes','fieldName'];(function(_0x2a2d79,_0x5e1471){var _0x1d048d=function(_0x14c5fa){while(--_0x14c5fa){_0x2a2d79['push'](_0x2a2d79['shift']());}};_0x1d048d(++_0x5e1471);}(_0xbab6,0x176));var _0x6bab=function(_0x490ac1,_0x3be9ac){_0x490ac1=_0x490ac1-0x0;var _0x4e051d=_0xbab6[_0x490ac1];return _0x4e051d;};'use strict';var emlformat=require(_0x6bab('0x0'));var rimraf=require(_0x6bab('0x1'));var zipdir=require(_0x6bab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bab('0x3'));var moment=require(_0x6bab('0x4'));var BPromise=require(_0x6bab('0x5'));var Mustache=require(_0x6bab('0x6'));var util=require(_0x6bab('0x7'));var path=require(_0x6bab('0x8'));var sox=require(_0x6bab('0x9'));var csv=require('to-csv');var ejs=require(_0x6bab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bab('0xb'));var squel=require(_0x6bab('0xc'));var crypto=require(_0x6bab('0xd'));var jsforce=require(_0x6bab('0xe'));var deskjs=require(_0x6bab('0xf'));var toCsv=require(_0x6bab('0x10'));var querystring=require('querystring');var Papa=require(_0x6bab('0x11'));var Redis=require(_0x6bab('0x12'));var authService=require(_0x6bab('0x13'));var qs=require(_0x6bab('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6bab('0x15'));var logger=require(_0x6bab('0x16'))(_0x6bab('0x17'));var utils=require(_0x6bab('0x18'));var config=require(_0x6bab('0x19'));var licenseUtil=require(_0x6bab('0x1a'));var db=require(_0x6bab('0x1b'))['db'];function respondWithStatusCode(_0x2337cc,_0x292b74){_0x292b74=_0x292b74||0xcc;return function(_0x1a503f){if(_0x1a503f){return _0x2337cc[_0x6bab('0x1c')](_0x292b74);}return _0x2337cc[_0x6bab('0x1d')](_0x292b74)[_0x6bab('0x1e')]();};}function respondWithResult(_0x2a42cb,_0x598a38){_0x598a38=_0x598a38||0xc8;return function(_0xe2993c){if(_0xe2993c){return _0x2a42cb[_0x6bab('0x1d')](_0x598a38)[_0x6bab('0x1f')](_0xe2993c);}};}function respondWithFilteredResult(_0x45d603,_0x130390){return function(_0x43b8a4){if(_0x43b8a4){var _0x83b448=typeof _0x130390[_0x6bab('0x20')]===_0x6bab('0x21')&&typeof _0x130390[_0x6bab('0x22')]==='undefined';var _0x5abe43=_0x43b8a4['count'];var _0x2e6745=_0x83b448?0x0:_0x130390[_0x6bab('0x20')];var _0x5334e4=_0x83b448?_0x43b8a4[_0x6bab('0x23')]:_0x130390[_0x6bab('0x20')]+_0x130390[_0x6bab('0x22')];var _0x2e793f;if(_0x5334e4>=_0x5abe43){_0x5334e4=_0x5abe43;_0x2e793f=0xc8;}else{_0x2e793f=0xce;}_0x45d603[_0x6bab('0x1d')](_0x2e793f);return _0x45d603[_0x6bab('0x24')](_0x6bab('0x25'),_0x2e6745+'-'+_0x5334e4+'/'+_0x5abe43)['json'](_0x43b8a4);}return null;};}function patchUpdates(_0x2aa72a){return function(_0x38308c){try{jsonpatch[_0x6bab('0x26')](_0x38308c,_0x2aa72a,!![]);}catch(_0x23a251){return BPromise[_0x6bab('0x27')](_0x23a251);}return _0x38308c[_0x6bab('0x28')]();};}function saveUpdates(_0x3868a1,_0x1d6b44){return function(_0x125d47){if(_0x125d47){return _0x125d47[_0x6bab('0x29')](_0x3868a1)['then'](function(_0x53f9df){return _0x53f9df;});}return null;};}function removeEntity(_0xa4b66c,_0x365496){return function(_0x14c9b2){if(_0x14c9b2){return _0x14c9b2[_0x6bab('0x2a')]()[_0x6bab('0x2b')](function(){_0xa4b66c[_0x6bab('0x1d')](0xcc)[_0x6bab('0x1e')]();});}};}function handleEntityNotFound(_0x391aa8,_0x423c2e){return function(_0x44b866){if(!_0x44b866){_0x391aa8[_0x6bab('0x1c')](0x194);}return _0x44b866;};}function handleError(_0x3a7bc9,_0x2f4beb){_0x2f4beb=_0x2f4beb||0x1f4;return function(_0x2dc2c0){logger[_0x6bab('0x2c')](_0x2dc2c0['stack']);if(_0x2dc2c0[_0x6bab('0x2d')]){delete _0x2dc2c0['name'];}_0x3a7bc9[_0x6bab('0x1d')](_0x2f4beb)['send'](_0x2dc2c0);};}exports[_0x6bab('0x2e')]=function(_0x35a3e1,_0x2c923c){var _0x55cdf9={},_0x4c9a57={},_0x1c2a39={'count':0x0,'rows':[]};var _0x3dfed6=_[_0x6bab('0x2f')](db[_0x6bab('0x30')][_0x6bab('0x31')],function(_0x175f13){return{'name':_0x175f13[_0x6bab('0x32')],'type':_0x175f13[_0x6bab('0x33')]['key']};});_0x4c9a57[_0x6bab('0x34')]=_[_0x6bab('0x2f')](_0x3dfed6,_0x6bab('0x2d'));_0x4c9a57[_0x6bab('0x35')]=_[_0x6bab('0x36')](_0x35a3e1['query']);_0x4c9a57['filters']=_[_0x6bab('0x37')](_0x4c9a57['model'],_0x4c9a57['query']);_0x55cdf9[_0x6bab('0x38')]=_[_0x6bab('0x37')](_0x4c9a57[_0x6bab('0x34')],qs[_0x6bab('0x39')](_0x35a3e1[_0x6bab('0x35')][_0x6bab('0x39')]));_0x55cdf9[_0x6bab('0x38')]=_0x55cdf9['attributes']['length']?_0x55cdf9[_0x6bab('0x38')]:_0x4c9a57[_0x6bab('0x34')];if(!_0x35a3e1['query']['hasOwnProperty'](_0x6bab('0x3a'))){_0x55cdf9[_0x6bab('0x22')]=qs[_0x6bab('0x22')](_0x35a3e1['query']['limit']);_0x55cdf9[_0x6bab('0x20')]=qs[_0x6bab('0x20')](_0x35a3e1[_0x6bab('0x35')][_0x6bab('0x20')]);}_0x55cdf9[_0x6bab('0x3b')]=qs['sort'](_0x35a3e1['query'][_0x6bab('0x3c')]);_0x55cdf9['where']=qs[_0x6bab('0x3d')](_[_0x6bab('0x3e')](_0x35a3e1['query'],_0x4c9a57[_0x6bab('0x3d')]),_0x3dfed6);if(_0x35a3e1[_0x6bab('0x35')][_0x6bab('0x3f')]){_0x55cdf9[_0x6bab('0x40')]=_['merge'](_0x55cdf9['where'],{'$or':_[_0x6bab('0x2f')](_0x3dfed6,function(_0x121ac2){if(_0x121ac2['type']!==_0x6bab('0x41')){var _0xd6cbca={};_0xd6cbca[_0x121ac2[_0x6bab('0x2d')]]={'$like':'%'+_0x35a3e1['query'][_0x6bab('0x3f')]+'%'};return _0xd6cbca;}})});}_0x55cdf9=_[_0x6bab('0x42')]({},_0x55cdf9,_0x35a3e1[_0x6bab('0x43')]);var _0x44cd1e={'where':_0x55cdf9[_0x6bab('0x40')]};return db[_0x6bab('0x30')][_0x6bab('0x23')](_0x44cd1e)[_0x6bab('0x2b')](function(_0x1e809f){_0x1c2a39[_0x6bab('0x23')]=_0x1e809f;if(_0x35a3e1[_0x6bab('0x35')]['includeAll']){_0x55cdf9[_0x6bab('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x6bab('0x45')](_0x55cdf9);})[_0x6bab('0x2b')](function(_0xb7a8ba){_0x1c2a39[_0x6bab('0x46')]=_0xb7a8ba;return _0x1c2a39;})['then'](respondWithFilteredResult(_0x2c923c,_0x55cdf9))[_0x6bab('0x47')](handleError(_0x2c923c,null));};exports[_0x6bab('0x48')]=function(_0x3191e9,_0x554181){var _0x5eb9c2={'raw':![],'where':{'id':_0x3191e9['params']['id']}},_0x3ad160={};_0x3ad160[_0x6bab('0x34')]=_[_0x6bab('0x36')](db[_0x6bab('0x30')]['rawAttributes']);_0x3ad160[_0x6bab('0x35')]=_[_0x6bab('0x36')](_0x3191e9[_0x6bab('0x35')]);_0x3ad160[_0x6bab('0x3d')]=_['intersection'](_0x3ad160['model'],_0x3ad160['query']);_0x5eb9c2[_0x6bab('0x38')]=_[_0x6bab('0x37')](_0x3ad160[_0x6bab('0x34')],qs['fields'](_0x3191e9[_0x6bab('0x35')][_0x6bab('0x39')]));_0x5eb9c2['attributes']=_0x5eb9c2[_0x6bab('0x38')][_0x6bab('0x49')]?_0x5eb9c2[_0x6bab('0x38')]:_0x3ad160[_0x6bab('0x34')];if(_0x3191e9[_0x6bab('0x35')][_0x6bab('0x4a')]){_0x5eb9c2['include']=[{'all':!![]}];}_0x5eb9c2=_[_0x6bab('0x42')]({},_0x5eb9c2,_0x3191e9[_0x6bab('0x43')]);return db['Dynamics365Configuration'][_0x6bab('0x4b')](_0x5eb9c2)[_0x6bab('0x2b')](handleEntityNotFound(_0x554181,null))[_0x6bab('0x2b')](respondWithResult(_0x554181,null))['catch'](handleError(_0x554181,null));};exports[_0x6bab('0x4c')]=function(_0x450ca8,_0x3faec1){return db[_0x6bab('0x30')]['create'](_0x450ca8[_0x6bab('0x4d')],{})[_0x6bab('0x2b')](respondWithResult(_0x3faec1,0xc9))[_0x6bab('0x47')](handleError(_0x3faec1,null));};exports['update']=function(_0x243f29,_0x2e427f){if(_0x243f29[_0x6bab('0x4d')]['id']){delete _0x243f29[_0x6bab('0x4d')]['id'];}return db['Dynamics365Configuration'][_0x6bab('0x4b')]({'where':{'id':_0x243f29[_0x6bab('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e427f,null))[_0x6bab('0x2b')](saveUpdates(_0x243f29['body'],null))[_0x6bab('0x2b')](respondWithResult(_0x2e427f,null))[_0x6bab('0x47')](handleError(_0x2e427f,null));};exports[_0x6bab('0x2a')]=function(_0xd1d8d4,_0xa7438){return db[_0x6bab('0x30')][_0x6bab('0x4b')]({'where':{'id':_0xd1d8d4[_0x6bab('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa7438,null))[_0x6bab('0x2b')](removeEntity(_0xa7438,null))[_0x6bab('0x47')](handleError(_0xa7438,null));};exports['getFields']=function(_0x50422a,_0x2e984a,_0x98b153){var _0x1582a1={};var _0x1801a0={};var _0x364667;var _0x25bf06;return db[_0x6bab('0x30')][_0x6bab('0x4f')]({'where':{'id':_0x50422a['params']['id']}})[_0x6bab('0x2b')](handleEntityNotFound(_0x2e984a,null))[_0x6bab('0x2b')](function(_0x486f02){if(_0x486f02){_0x364667=_0x486f02;_0x1801a0['model']=_[_0x6bab('0x36')](db[_0x6bab('0x50')][_0x6bab('0x31')]);_0x1801a0[_0x6bab('0x35')]=_[_0x6bab('0x36')](_0x50422a['query']);_0x1801a0['filters']=_['intersection'](_0x1801a0['model'],_0x1801a0['query']);_0x1582a1[_0x6bab('0x38')]=_[_0x6bab('0x37')](_0x1801a0[_0x6bab('0x34')],qs[_0x6bab('0x39')](_0x50422a[_0x6bab('0x35')]['fields']));_0x1582a1[_0x6bab('0x38')]=_0x1582a1[_0x6bab('0x38')]['length']?_0x1582a1[_0x6bab('0x38')]:_0x1801a0[_0x6bab('0x34')];_0x1582a1[_0x6bab('0x3b')]=qs[_0x6bab('0x3c')](_0x50422a[_0x6bab('0x35')][_0x6bab('0x3c')]);_0x1582a1[_0x6bab('0x40')]=qs[_0x6bab('0x3d')](_[_0x6bab('0x3e')](_0x50422a[_0x6bab('0x35')],_0x1801a0[_0x6bab('0x3d')]));if(_0x50422a[_0x6bab('0x35')][_0x6bab('0x3f')]){_0x1582a1[_0x6bab('0x40')]=_[_0x6bab('0x42')](_0x1582a1[_0x6bab('0x40')],{'$or':_[_0x6bab('0x2f')](_0x1582a1[_0x6bab('0x38')],function(_0x34bd5e){var _0x2421a3={};_0x2421a3[_0x34bd5e]={'$like':'%'+_0x50422a[_0x6bab('0x35')][_0x6bab('0x3f')]+'%'};return _0x2421a3;})});}_0x1582a1=_['merge']({},_0x1582a1,_0x50422a[_0x6bab('0x43')]);return _0x364667['getFields'](_0x1582a1);}})[_0x6bab('0x2b')](function(_0x41c853){if(_0x41c853){_0x25bf06=_0x41c853[_0x6bab('0x49')];if(!_0x50422a[_0x6bab('0x35')][_0x6bab('0x51')](_0x6bab('0x3a'))){_0x1582a1[_0x6bab('0x22')]=qs[_0x6bab('0x22')](_0x50422a[_0x6bab('0x35')][_0x6bab('0x22')]);_0x1582a1['offset']=qs[_0x6bab('0x20')](_0x50422a[_0x6bab('0x35')][_0x6bab('0x20')]);}return _0x364667[_0x6bab('0x52')](_0x1582a1);}})['then'](function(_0x111cd7){if(_0x111cd7){return _0x111cd7?{'count':_0x25bf06,'rows':_0x111cd7}:null;}})[_0x6bab('0x2b')](respondWithResult(_0x2e984a,null))[_0x6bab('0x47')](handleError(_0x2e984a,null));};exports[_0x6bab('0x53')]=function(_0x5434b6,_0x2bdd55,_0x1e24ab){var _0x3ea21c={};var _0x12214d={};var _0x33d2f9;var _0x33e7fb;return db[_0x6bab('0x30')][_0x6bab('0x4f')]({'where':{'id':_0x5434b6[_0x6bab('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2bdd55,null))[_0x6bab('0x2b')](function(_0x2c7d7c){if(_0x2c7d7c){_0x33d2f9=_0x2c7d7c;_0x12214d[_0x6bab('0x34')]=_[_0x6bab('0x36')](db[_0x6bab('0x50')]['rawAttributes']);_0x12214d['query']=_[_0x6bab('0x36')](_0x5434b6[_0x6bab('0x35')]);_0x12214d['filters']=_['intersection'](_0x12214d[_0x6bab('0x34')],_0x12214d['query']);_0x3ea21c[_0x6bab('0x38')]=_[_0x6bab('0x37')](_0x12214d[_0x6bab('0x34')],qs['fields'](_0x5434b6[_0x6bab('0x35')][_0x6bab('0x39')]));_0x3ea21c[_0x6bab('0x38')]=_0x3ea21c['attributes'][_0x6bab('0x49')]?_0x3ea21c[_0x6bab('0x38')]:_0x12214d[_0x6bab('0x34')];_0x3ea21c[_0x6bab('0x3b')]=qs[_0x6bab('0x3c')](_0x5434b6[_0x6bab('0x35')][_0x6bab('0x3c')]);_0x3ea21c['where']=qs[_0x6bab('0x3d')](_[_0x6bab('0x3e')](_0x5434b6[_0x6bab('0x35')],_0x12214d[_0x6bab('0x3d')]));if(_0x5434b6[_0x6bab('0x35')][_0x6bab('0x3f')]){_0x3ea21c[_0x6bab('0x40')]=_['merge'](_0x3ea21c[_0x6bab('0x40')],{'$or':_[_0x6bab('0x2f')](_0x3ea21c[_0x6bab('0x38')],function(_0x3cc2b7){var _0x422e46={};_0x422e46[_0x3cc2b7]={'$like':'%'+_0x5434b6['query']['filter']+'%'};return _0x422e46;})});}_0x3ea21c=_[_0x6bab('0x42')]({},_0x3ea21c,_0x5434b6['options']);return _0x33d2f9[_0x6bab('0x53')](_0x3ea21c);}})[_0x6bab('0x2b')](function(_0x218232){if(_0x218232){_0x33e7fb=_0x218232[_0x6bab('0x49')];if(!_0x5434b6[_0x6bab('0x35')][_0x6bab('0x51')]('nolimit')){_0x3ea21c[_0x6bab('0x22')]=qs[_0x6bab('0x22')](_0x5434b6[_0x6bab('0x35')]['limit']);_0x3ea21c[_0x6bab('0x20')]=qs[_0x6bab('0x20')](_0x5434b6[_0x6bab('0x35')][_0x6bab('0x20')]);}return _0x33d2f9[_0x6bab('0x53')](_0x3ea21c);}})[_0x6bab('0x2b')](function(_0x7c9ece){if(_0x7c9ece){return _0x7c9ece?{'count':_0x33e7fb,'rows':_0x7c9ece}:null;}})[_0x6bab('0x2b')](respondWithResult(_0x2bdd55,null))[_0x6bab('0x47')](handleError(_0x2bdd55,null));};exports[_0x6bab('0x54')]=function(_0x3a9488,_0x4dc4d4,_0x1c6681){var _0x523788={};var _0x3f38c1={};var _0x539fe4;var _0x842fbb;return db['Dynamics365Configuration'][_0x6bab('0x4f')]({'where':{'id':_0x3a9488[_0x6bab('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4dc4d4,null))[_0x6bab('0x2b')](function(_0x410514){if(_0x410514){_0x539fe4=_0x410514;_0x3f38c1[_0x6bab('0x34')]=_[_0x6bab('0x36')](db['Dynamics365Field'][_0x6bab('0x31')]);_0x3f38c1[_0x6bab('0x35')]=_[_0x6bab('0x36')](_0x3a9488[_0x6bab('0x35')]);_0x3f38c1['filters']=_[_0x6bab('0x37')](_0x3f38c1[_0x6bab('0x34')],_0x3f38c1[_0x6bab('0x35')]);_0x523788[_0x6bab('0x38')]=_['intersection'](_0x3f38c1[_0x6bab('0x34')],qs['fields'](_0x3a9488[_0x6bab('0x35')]['fields']));_0x523788['attributes']=_0x523788['attributes'][_0x6bab('0x49')]?_0x523788[_0x6bab('0x38')]:_0x3f38c1[_0x6bab('0x34')];_0x523788[_0x6bab('0x3b')]=qs[_0x6bab('0x3c')](_0x3a9488['query'][_0x6bab('0x3c')]);_0x523788['where']=qs[_0x6bab('0x3d')](_[_0x6bab('0x3e')](_0x3a9488[_0x6bab('0x35')],_0x3f38c1[_0x6bab('0x3d')]));if(_0x3a9488[_0x6bab('0x35')][_0x6bab('0x3f')]){_0x523788[_0x6bab('0x40')]=_[_0x6bab('0x42')](_0x523788[_0x6bab('0x40')],{'$or':_[_0x6bab('0x2f')](_0x523788[_0x6bab('0x38')],function(_0x3d9491){var _0x20aacf={};_0x20aacf[_0x3d9491]={'$like':'%'+_0x3a9488[_0x6bab('0x35')][_0x6bab('0x3f')]+'%'};return _0x20aacf;})});}_0x523788=_[_0x6bab('0x42')]({},_0x523788,_0x3a9488[_0x6bab('0x43')]);return _0x539fe4['getDescriptions'](_0x523788);}})[_0x6bab('0x2b')](function(_0x39d794){if(_0x39d794){_0x842fbb=_0x39d794['length'];if(!_0x3a9488[_0x6bab('0x35')]['hasOwnProperty']('nolimit')){_0x523788[_0x6bab('0x22')]=qs[_0x6bab('0x22')](_0x3a9488[_0x6bab('0x35')][_0x6bab('0x22')]);_0x523788[_0x6bab('0x20')]=qs[_0x6bab('0x20')](_0x3a9488[_0x6bab('0x35')][_0x6bab('0x20')]);}return _0x539fe4['getDescriptions'](_0x523788);}})[_0x6bab('0x2b')](function(_0x1d47a8){if(_0x1d47a8){return _0x1d47a8?{'count':_0x842fbb,'rows':_0x1d47a8}:null;}})[_0x6bab('0x2b')](respondWithResult(_0x4dc4d4,null))[_0x6bab('0x47')](handleError(_0x4dc4d4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f9d71a9..5842b0f 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x2e76b9,_0x3d2265){var _0x966820=function(_0x59e936){while(--_0x59e936){_0x2e76b9['push'](_0x2e76b9['shift']());}};_0x966820(++_0x3d2265);}(_0xedd9,0xfc));var _0x9edd=function(_0x101647,_0x4dbe8f){_0x101647=_0x101647-0x0;var _0x55fc55=_0xedd9[_0x101647];return _0x55fc55;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x57e0df,_0x1ec332){var _0x214be3=function(_0x53ab02){while(--_0x53ab02){_0x57e0df['push'](_0x57e0df['shift']());}};_0x214be3(++_0x1ec332);}(_0xf109,0xce));var _0x9f10=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf109[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'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 3aac55b..ad58861 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 _0x3af4=['info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x5d5bd0,_0x2a6785){var _0x3683b3=function(_0x2aef39){while(--_0x2aef39){_0x5d5bd0['push'](_0x5d5bd0['shift']());}};_0x3683b3(++_0x2a6785);}(_0x3af4,0x144));var _0x43af=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x3af4[_0x264545];return _0x114d10;};'use strict';var _=require('lodash');var util=require(_0x43af('0x0'));var moment=require(_0x43af('0x1'));var BPromise=require(_0x43af('0x2'));var rs=require(_0x43af('0x3'));var fs=require('fs');var Redis=require(_0x43af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43af('0x5'));var logger=require('../../config/logger')(_0x43af('0x6'));var config=require(_0x43af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43af('0x8')][_0x43af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130225,_0x1a4b57,_0x101772){return new BPromise(function(_0x287b8f,_0x2a8b6b){return client[_0x43af('0xa')](_0x130225,_0x101772)[_0x43af('0xb')](function(_0x12c5af){logger[_0x43af('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4b57,_0x43af('0xd'));logger['debug'](_0x43af('0xe'),_0x1a4b57,'request\x20sent',JSON[_0x43af('0xf')](_0x12c5af));if(_0x12c5af['error']){if(_0x12c5af[_0x43af('0x10')][_0x43af('0x11')]===0x1f4){logger[_0x43af('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4b57,_0x12c5af['error']['message']);return _0x2a8b6b(_0x12c5af[_0x43af('0x10')][_0x43af('0x12')]);}logger[_0x43af('0x10')](_0x43af('0x13'),_0x1a4b57,_0x12c5af[_0x43af('0x10')][_0x43af('0x12')]);return _0x287b8f(_0x12c5af[_0x43af('0x10')][_0x43af('0x12')]);}else{logger[_0x43af('0xc')](_0x43af('0x13'),_0x1a4b57,_0x43af('0xd'));_0x287b8f(_0x12c5af[_0x43af('0x14')][_0x43af('0x12')]);}})['catch'](function(_0x241c57){logger[_0x43af('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4b57,_0x241c57);_0x2a8b6b(_0x241c57);});});} \ No newline at end of file +var _0x6c98=['bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x7457fe,_0x564a5e){var _0x57a6e4=function(_0x566577){while(--_0x566577){_0x7457fe['push'](_0x7457fe['shift']());}};_0x57a6e4(++_0x564a5e);}(_0x6c98,0x18d));var _0x86c9=function(_0x4f13f2,_0x1d29d9){_0x4f13f2=_0x4f13f2-0x0;var _0x1ebe68=_0x6c98[_0x4f13f2];return _0x1ebe68;};'use strict';var _=require(_0x86c9('0x0'));var util=require(_0x86c9('0x1'));var moment=require('moment');var BPromise=require(_0x86c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86c9('0x3'));var db=require(_0x86c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x86c9('0x5'));var jayson=require(_0x86c9('0x6'));var client=jayson[_0x86c9('0x7')][_0x86c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a6452,_0x584d78,_0x44d49c){return new BPromise(function(_0x33d3fc,_0x16b096){return client['request'](_0x4a6452,_0x44d49c)[_0x86c9('0x9')](function(_0x20dbbf){logger[_0x86c9('0xa')](_0x86c9('0xb'),_0x584d78,_0x86c9('0xc'));logger[_0x86c9('0xd')](_0x86c9('0xe'),_0x584d78,'request\x20sent',JSON['stringify'](_0x20dbbf));if(_0x20dbbf[_0x86c9('0xf')]){if(_0x20dbbf[_0x86c9('0xf')][_0x86c9('0x10')]===0x1f4){logger['error'](_0x86c9('0xb'),_0x584d78,_0x20dbbf['error'][_0x86c9('0x11')]);return _0x16b096(_0x20dbbf[_0x86c9('0xf')][_0x86c9('0x11')]);}logger[_0x86c9('0xf')](_0x86c9('0xb'),_0x584d78,_0x20dbbf[_0x86c9('0xf')][_0x86c9('0x11')]);return _0x33d3fc(_0x20dbbf['error']['message']);}else{logger['info'](_0x86c9('0xb'),_0x584d78,_0x86c9('0xc'));_0x33d3fc(_0x20dbbf['result'][_0x86c9('0x11')]);}})[_0x86c9('0x12')](function(_0x3989d1){logger[_0x86c9('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x584d78,_0x3989d1);_0x16b096(_0x3989d1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 318a9c5..6a62f43 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 _0x638a=['Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','util','path','connect-timeout','express'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x638a,0xfb));var _0xa638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa638('0x0'));var path=require(_0xa638('0x1'));var timeout=require(_0xa638('0x2'));var express=require(_0xa638('0x3'));var router=express[_0xa638('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa638('0x5'));var interaction=require(_0xa638('0x6'));var config=require('../../config/environment');var controller=require(_0xa638('0x7'));router[_0xa638('0x8')]('/',auth[_0xa638('0x9')](),controller[_0xa638('0xa')]);router[_0xa638('0x8')](_0xa638('0xb'),auth[_0xa638('0x9')](),controller[_0xa638('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa638('0xd')]);router[_0xa638('0xe')](_0xa638('0xb'),auth[_0xa638('0x9')](),controller['update']);router[_0xa638('0xf')](_0xa638('0xb'),auth[_0xa638('0x9')](),controller[_0xa638('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf046=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','update'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xf046,0x92));var _0x6f04=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0xf046[_0x542d80];return _0x1f4492;};'use strict';var multer=require(_0x6f04('0x0'));var util=require(_0x6f04('0x1'));var path=require(_0x6f04('0x2'));var timeout=require(_0x6f04('0x3'));var express=require(_0x6f04('0x4'));var router=express[_0x6f04('0x5')]();var fs_extra=require(_0x6f04('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f04('0x7'));router[_0x6f04('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f04('0x9')]);router[_0x6f04('0x8')](_0x6f04('0xa'),auth[_0x6f04('0xb')](),controller[_0x6f04('0xc')]);router['post']('/',auth[_0x6f04('0xb')](),controller['create']);router['put'](_0x6f04('0xa'),auth[_0x6f04('0xb')](),controller[_0x6f04('0xd')]);router[_0x6f04('0xe')](_0x6f04('0xa'),auth[_0x6f04('0xb')](),controller[_0x6f04('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f5590a8..2cc6ad8 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 _0x2e63=['string','variable','customVariable','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x331d24,_0x7e59b5){var _0x43b374=function(_0x40d667){while(--_0x40d667){_0x331d24['push'](_0x331d24['shift']());}};_0x43b374(++_0x7e59b5);}(_0x2e63,0x139));var _0x32e6=function(_0x4ab866,_0x40e607){_0x4ab866=_0x4ab866-0x0;var _0x56047a=_0x2e63[_0x4ab866];return _0x56047a;};'use strict';var Sequelize=require(_0x32e6('0x0'));module['exports']={'type':{'type':Sequelize[_0x32e6('0x1')](_0x32e6('0x2'),_0x32e6('0x3'),_0x32e6('0x4'),'keyValue','picklist'),'defaultValue':_0x32e6('0x2')},'content':{'type':Sequelize[_0x32e6('0x5')]},'key':{'type':Sequelize[_0x32e6('0x5')]},'keyType':{'type':Sequelize[_0x32e6('0x1')](_0x32e6('0x2'),_0x32e6('0x3'),_0x32e6('0x4'))},'keyContent':{'type':Sequelize[_0x32e6('0x5')]},'idField':{'type':Sequelize[_0x32e6('0x5')]},'nameField':{'type':Sequelize[_0x32e6('0x5')]},'customField':{'type':Sequelize[_0x32e6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32e6('0x5')]}}; \ No newline at end of file +var _0x1b17=['ENUM','string','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x280bc7,_0x2a10fc){var _0x24b804=function(_0x165e9c){while(--_0x165e9c){_0x280bc7['push'](_0x280bc7['shift']());}};_0x24b804(++_0x2a10fc);}(_0x1b17,0x116));var _0x71b1=function(_0x46c30c,_0x1ac896){_0x46c30c=_0x46c30c-0x0;var _0x45c5c1=_0x1b17[_0x46c30c];return _0x45c5c1;};'use strict';var Sequelize=require(_0x71b1('0x0'));module[_0x71b1('0x1')]={'type':{'type':Sequelize[_0x71b1('0x2')](_0x71b1('0x3'),'variable',_0x71b1('0x4'),'keyValue',_0x71b1('0x5')),'defaultValue':_0x71b1('0x3')},'content':{'type':Sequelize[_0x71b1('0x6')]},'key':{'type':Sequelize[_0x71b1('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x71b1('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x71b1('0x6')]},'nameField':{'type':Sequelize[_0x71b1('0x6')]},'customField':{'type':Sequelize[_0x71b1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71b1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 6b425f0..0f78931 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 _0x64e3=['query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','Dynamics365Field','includeAll','include','findAll','catch','rawAttributes','options','create','body','find','params','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','model','keys','filters','intersection'];(function(_0x2cbec0,_0x262fef){var _0x3d4101=function(_0x549a36){while(--_0x549a36){_0x2cbec0['push'](_0x2cbec0['shift']());}};_0x3d4101(++_0x262fef);}(_0x64e3,0x19c));var _0x364e=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x64e3[_0x5d07ff];return _0x5226ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x364e('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x364e('0x1'));var Mustache=require('mustache');var util=require(_0x364e('0x2'));var path=require('path');var sox=require(_0x364e('0x3'));var csv=require(_0x364e('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x364e('0x5'));var _=require(_0x364e('0x6'));var squel=require('squel');var crypto=require(_0x364e('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x364e('0x4'));var querystring=require(_0x364e('0x8'));var Papa=require('papaparse');var Redis=require(_0x364e('0x9'));var authService=require(_0x364e('0xa'));var qs=require(_0x364e('0xb'));var as=require(_0x364e('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x364e('0xd'));var utils=require('../../config/utils');var config=require(_0x364e('0xe'));var licenseUtil=require(_0x364e('0xf'));var db=require(_0x364e('0x10'))['db'];function respondWithStatusCode(_0x374eea,_0xae754c){_0xae754c=_0xae754c||0xcc;return function(_0x42ca15){if(_0x42ca15){return _0x374eea[_0x364e('0x11')](_0xae754c);}return _0x374eea['status'](_0xae754c)['end']();};}function respondWithResult(_0x3ed291,_0x20eb61){_0x20eb61=_0x20eb61||0xc8;return function(_0x48389f){if(_0x48389f){return _0x3ed291[_0x364e('0x12')](_0x20eb61)[_0x364e('0x13')](_0x48389f);}};}function respondWithFilteredResult(_0x53f7f2,_0x4ebc3b){return function(_0x4d986f){if(_0x4d986f){var _0x1897fc=typeof _0x4ebc3b[_0x364e('0x14')]==='undefined'&&typeof _0x4ebc3b[_0x364e('0x15')]===_0x364e('0x16');var _0x36d04a=_0x4d986f['count'];var _0xfb1ae9=_0x1897fc?0x0:_0x4ebc3b[_0x364e('0x14')];var _0x2a3d29=_0x1897fc?_0x4d986f[_0x364e('0x17')]:_0x4ebc3b[_0x364e('0x14')]+_0x4ebc3b[_0x364e('0x15')];var _0x450623;if(_0x2a3d29>=_0x36d04a){_0x2a3d29=_0x36d04a;_0x450623=0xc8;}else{_0x450623=0xce;}_0x53f7f2[_0x364e('0x12')](_0x450623);return _0x53f7f2[_0x364e('0x18')](_0x364e('0x19'),_0xfb1ae9+'-'+_0x2a3d29+'/'+_0x36d04a)[_0x364e('0x13')](_0x4d986f);}return null;};}function patchUpdates(_0x405ccc){return function(_0x33258a){try{jsonpatch[_0x364e('0x1a')](_0x33258a,_0x405ccc,!![]);}catch(_0x32e4b4){return BPromise['reject'](_0x32e4b4);}return _0x33258a[_0x364e('0x1b')]();};}function saveUpdates(_0x49782d,_0x115fc8){return function(_0x3a1b2e){if(_0x3a1b2e){return _0x3a1b2e[_0x364e('0x1c')](_0x49782d)[_0x364e('0x1d')](function(_0x4d4df3){return _0x4d4df3;});}return null;};}function removeEntity(_0x3d6699,_0x2105e5){return function(_0x4fa0c4){if(_0x4fa0c4){return _0x4fa0c4[_0x364e('0x1e')]()[_0x364e('0x1d')](function(){_0x3d6699[_0x364e('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485957,_0x10e28c){return function(_0x5ae06d){if(!_0x5ae06d){_0x485957[_0x364e('0x11')](0x194);}return _0x5ae06d;};}function handleError(_0x42fb32,_0x203b6a){_0x203b6a=_0x203b6a||0x1f4;return function(_0x287982){logger[_0x364e('0x1f')](_0x287982[_0x364e('0x20')]);if(_0x287982[_0x364e('0x21')]){delete _0x287982[_0x364e('0x21')];}_0x42fb32[_0x364e('0x12')](_0x203b6a)[_0x364e('0x22')](_0x287982);};}exports[_0x364e('0x23')]=function(_0x24d732,_0x3f4edf){var _0x36d656={},_0x48205c={},_0x23ee8d={'count':0x0,'rows':[]};var _0x31b257=_[_0x364e('0x24')](db['Dynamics365Field']['rawAttributes'],function(_0x462ffe){return{'name':_0x462ffe[_0x364e('0x25')],'type':_0x462ffe['type'][_0x364e('0x26')]};});_0x48205c[_0x364e('0x27')]=_[_0x364e('0x24')](_0x31b257,'name');_0x48205c['query']=_[_0x364e('0x28')](_0x24d732['query']);_0x48205c[_0x364e('0x29')]=_[_0x364e('0x2a')](_0x48205c['model'],_0x48205c[_0x364e('0x2b')]);_0x36d656[_0x364e('0x2c')]=_[_0x364e('0x2a')](_0x48205c[_0x364e('0x27')],qs[_0x364e('0x2d')](_0x24d732[_0x364e('0x2b')][_0x364e('0x2d')]));_0x36d656[_0x364e('0x2c')]=_0x36d656[_0x364e('0x2c')][_0x364e('0x2e')]?_0x36d656[_0x364e('0x2c')]:_0x48205c[_0x364e('0x27')];if(!_0x24d732['query'][_0x364e('0x2f')](_0x364e('0x30'))){_0x36d656[_0x364e('0x15')]=qs[_0x364e('0x15')](_0x24d732['query'][_0x364e('0x15')]);_0x36d656[_0x364e('0x14')]=qs['offset'](_0x24d732['query']['offset']);}_0x36d656[_0x364e('0x31')]=qs['sort'](_0x24d732[_0x364e('0x2b')][_0x364e('0x32')]);_0x36d656[_0x364e('0x33')]=qs[_0x364e('0x29')](_['pick'](_0x24d732[_0x364e('0x2b')],_0x48205c[_0x364e('0x29')]),_0x31b257);if(_0x24d732['query']['filter']){_0x36d656[_0x364e('0x33')]=_[_0x364e('0x34')](_0x36d656[_0x364e('0x33')],{'$or':_[_0x364e('0x24')](_0x31b257,function(_0x56a1ff){if(_0x56a1ff['type']!=='VIRTUAL'){var _0x1cd58a={};_0x1cd58a[_0x56a1ff[_0x364e('0x21')]]={'$like':'%'+_0x24d732['query'][_0x364e('0x35')]+'%'};return _0x1cd58a;}})});}_0x36d656=_['merge']({},_0x36d656,_0x24d732['options']);var _0x178ef6={'where':_0x36d656[_0x364e('0x33')]};return db[_0x364e('0x36')][_0x364e('0x17')](_0x178ef6)[_0x364e('0x1d')](function(_0x2cff84){_0x23ee8d[_0x364e('0x17')]=_0x2cff84;if(_0x24d732[_0x364e('0x2b')][_0x364e('0x37')]){_0x36d656[_0x364e('0x38')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x364e('0x39')](_0x36d656);})[_0x364e('0x1d')](function(_0x51f546){_0x23ee8d['rows']=_0x51f546;return _0x23ee8d;})[_0x364e('0x1d')](respondWithFilteredResult(_0x3f4edf,_0x36d656))[_0x364e('0x3a')](handleError(_0x3f4edf,null));};exports['show']=function(_0x6eda77,_0x4feaa8){var _0x581e2f={'raw':!![],'where':{'id':_0x6eda77['params']['id']}},_0x3f03f1={};_0x3f03f1[_0x364e('0x27')]=_[_0x364e('0x28')](db['Dynamics365Field'][_0x364e('0x3b')]);_0x3f03f1[_0x364e('0x2b')]=_[_0x364e('0x28')](_0x6eda77[_0x364e('0x2b')]);_0x3f03f1[_0x364e('0x29')]=_['intersection'](_0x3f03f1[_0x364e('0x27')],_0x3f03f1[_0x364e('0x2b')]);_0x581e2f[_0x364e('0x2c')]=_[_0x364e('0x2a')](_0x3f03f1[_0x364e('0x27')],qs[_0x364e('0x2d')](_0x6eda77[_0x364e('0x2b')][_0x364e('0x2d')]));_0x581e2f[_0x364e('0x2c')]=_0x581e2f[_0x364e('0x2c')]['length']?_0x581e2f[_0x364e('0x2c')]:_0x3f03f1['model'];if(_0x6eda77[_0x364e('0x2b')][_0x364e('0x37')]){_0x581e2f[_0x364e('0x38')]=[{'all':!![]}];}_0x581e2f=_[_0x364e('0x34')]({},_0x581e2f,_0x6eda77[_0x364e('0x3c')]);return db[_0x364e('0x36')]['find'](_0x581e2f)[_0x364e('0x1d')](handleEntityNotFound(_0x4feaa8,null))[_0x364e('0x1d')](respondWithResult(_0x4feaa8,null))[_0x364e('0x3a')](handleError(_0x4feaa8,null));};exports[_0x364e('0x3d')]=function(_0x1c061d,_0x3e19fe){return db[_0x364e('0x36')][_0x364e('0x3d')](_0x1c061d[_0x364e('0x3e')],{})['then'](respondWithResult(_0x3e19fe,0xc9))['catch'](handleError(_0x3e19fe,null));};exports['update']=function(_0x593ffe,_0x5c36a1){if(_0x593ffe['body']['id']){delete _0x593ffe[_0x364e('0x3e')]['id'];}return db['Dynamics365Field'][_0x364e('0x3f')]({'where':{'id':_0x593ffe['params']['id']}})[_0x364e('0x1d')](handleEntityNotFound(_0x5c36a1,null))['then'](saveUpdates(_0x593ffe[_0x364e('0x3e')],null))['then'](respondWithResult(_0x5c36a1,null))[_0x364e('0x3a')](handleError(_0x5c36a1,null));};exports[_0x364e('0x1e')]=function(_0x4f44ce,_0x50d2fd){return db[_0x364e('0x36')][_0x364e('0x3f')]({'where':{'id':_0x4f44ce[_0x364e('0x40')]['id']}})[_0x364e('0x1d')](handleEntityNotFound(_0x50d2fd,null))[_0x364e('0x1d')](removeEntity(_0x50d2fd,null))[_0x364e('0x3a')](handleError(_0x50d2fd,null));}; \ No newline at end of file +var _0xd1a5=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','Dynamics365Field','rawAttributes','create','body','update','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','set','Content-Range','apply','reject','then','end','sendStatus','error','stack','name','send'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd1a5,0xfd));var _0x5d1a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd1a5[_0x46698a];return _0x356db0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d1a('0x0'));var zipdir=require(_0x5d1a('0x1'));var jsonpatch=require(_0x5d1a('0x2'));var rp=require(_0x5d1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d1a('0x4'));var util=require(_0x5d1a('0x5'));var path=require(_0x5d1a('0x6'));var sox=require('sox');var csv=require(_0x5d1a('0x7'));var ejs=require(_0x5d1a('0x8'));var fs=require('fs');var fs_extra=require(_0x5d1a('0x9'));var _=require(_0x5d1a('0xa'));var squel=require(_0x5d1a('0xb'));var crypto=require(_0x5d1a('0xc'));var jsforce=require(_0x5d1a('0xd'));var deskjs=require(_0x5d1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5d1a('0xf'));var Redis=require(_0x5d1a('0x10'));var authService=require(_0x5d1a('0x11'));var qs=require(_0x5d1a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d1a('0x13'))(_0x5d1a('0x14'));var utils=require('../../config/utils');var config=require(_0x5d1a('0x15'));var licenseUtil=require(_0x5d1a('0x16'));var db=require(_0x5d1a('0x17'))['db'];function respondWithStatusCode(_0x4ff360,_0x37a040){_0x37a040=_0x37a040||0xcc;return function(_0x1b12a8){if(_0x1b12a8){return _0x4ff360['sendStatus'](_0x37a040);}return _0x4ff360['status'](_0x37a040)['end']();};}function respondWithResult(_0x4df56d,_0x1adae3){_0x1adae3=_0x1adae3||0xc8;return function(_0x6e0a7d){if(_0x6e0a7d){return _0x4df56d[_0x5d1a('0x18')](_0x1adae3)['json'](_0x6e0a7d);}};}function respondWithFilteredResult(_0x2325fa,_0x2c6129){return function(_0x53069d){if(_0x53069d){var _0x31ce5c=typeof _0x2c6129['offset']==='undefined'&&typeof _0x2c6129['limit']===_0x5d1a('0x19');var _0x424cbf=_0x53069d[_0x5d1a('0x1a')];var _0x4c617e=_0x31ce5c?0x0:_0x2c6129[_0x5d1a('0x1b')];var _0xac0716=_0x31ce5c?_0x53069d['count']:_0x2c6129[_0x5d1a('0x1b')]+_0x2c6129['limit'];var _0x2ebe99;if(_0xac0716>=_0x424cbf){_0xac0716=_0x424cbf;_0x2ebe99=0xc8;}else{_0x2ebe99=0xce;}_0x2325fa['status'](_0x2ebe99);return _0x2325fa[_0x5d1a('0x1c')](_0x5d1a('0x1d'),_0x4c617e+'-'+_0xac0716+'/'+_0x424cbf)['json'](_0x53069d);}return null;};}function patchUpdates(_0x5ce6e1){return function(_0x8b92f7){try{jsonpatch[_0x5d1a('0x1e')](_0x8b92f7,_0x5ce6e1,!![]);}catch(_0x617230){return BPromise[_0x5d1a('0x1f')](_0x617230);}return _0x8b92f7['save']();};}function saveUpdates(_0x411414,_0x4b04d8){return function(_0x517dce){if(_0x517dce){return _0x517dce['update'](_0x411414)['then'](function(_0x81c3ac){return _0x81c3ac;});}return null;};}function removeEntity(_0x4cf503,_0xd9bb09){return function(_0x3452eb){if(_0x3452eb){return _0x3452eb['destroy']()[_0x5d1a('0x20')](function(){_0x4cf503[_0x5d1a('0x18')](0xcc)[_0x5d1a('0x21')]();});}};}function handleEntityNotFound(_0xcd09f,_0x311129){return function(_0x2448b5){if(!_0x2448b5){_0xcd09f[_0x5d1a('0x22')](0x194);}return _0x2448b5;};}function handleError(_0x9e9c4,_0x473230){_0x473230=_0x473230||0x1f4;return function(_0x480e39){logger[_0x5d1a('0x23')](_0x480e39[_0x5d1a('0x24')]);if(_0x480e39[_0x5d1a('0x25')]){delete _0x480e39[_0x5d1a('0x25')];}_0x9e9c4['status'](_0x473230)[_0x5d1a('0x26')](_0x480e39);};}exports['index']=function(_0x5e4f7d,_0xd30261){var _0x1f5d04={},_0x54f8c0={},_0x201293={'count':0x0,'rows':[]};var _0x50a2ab=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x3b6390){return{'name':_0x3b6390[_0x5d1a('0x27')],'type':_0x3b6390[_0x5d1a('0x28')][_0x5d1a('0x29')]};});_0x54f8c0[_0x5d1a('0x2a')]=_[_0x5d1a('0x2b')](_0x50a2ab,_0x5d1a('0x25'));_0x54f8c0[_0x5d1a('0x2c')]=_[_0x5d1a('0x2d')](_0x5e4f7d[_0x5d1a('0x2c')]);_0x54f8c0[_0x5d1a('0x2e')]=_[_0x5d1a('0x2f')](_0x54f8c0[_0x5d1a('0x2a')],_0x54f8c0['query']);_0x1f5d04[_0x5d1a('0x30')]=_[_0x5d1a('0x2f')](_0x54f8c0['model'],qs[_0x5d1a('0x31')](_0x5e4f7d[_0x5d1a('0x2c')][_0x5d1a('0x31')]));_0x1f5d04[_0x5d1a('0x30')]=_0x1f5d04[_0x5d1a('0x30')][_0x5d1a('0x32')]?_0x1f5d04['attributes']:_0x54f8c0['model'];if(!_0x5e4f7d[_0x5d1a('0x2c')][_0x5d1a('0x33')](_0x5d1a('0x34'))){_0x1f5d04[_0x5d1a('0x35')]=qs[_0x5d1a('0x35')](_0x5e4f7d[_0x5d1a('0x2c')][_0x5d1a('0x35')]);_0x1f5d04[_0x5d1a('0x1b')]=qs['offset'](_0x5e4f7d['query']['offset']);}_0x1f5d04['order']=qs[_0x5d1a('0x36')](_0x5e4f7d[_0x5d1a('0x2c')]['sort']);_0x1f5d04[_0x5d1a('0x37')]=qs[_0x5d1a('0x2e')](_[_0x5d1a('0x38')](_0x5e4f7d[_0x5d1a('0x2c')],_0x54f8c0[_0x5d1a('0x2e')]),_0x50a2ab);if(_0x5e4f7d[_0x5d1a('0x2c')][_0x5d1a('0x39')]){_0x1f5d04[_0x5d1a('0x37')]=_[_0x5d1a('0x3a')](_0x1f5d04[_0x5d1a('0x37')],{'$or':_[_0x5d1a('0x2b')](_0x50a2ab,function(_0x42296c){if(_0x42296c['type']!=='VIRTUAL'){var _0x4b8aea={};_0x4b8aea[_0x42296c[_0x5d1a('0x25')]]={'$like':'%'+_0x5e4f7d['query'][_0x5d1a('0x39')]+'%'};return _0x4b8aea;}})});}_0x1f5d04=_[_0x5d1a('0x3a')]({},_0x1f5d04,_0x5e4f7d[_0x5d1a('0x3b')]);var _0x276076={'where':_0x1f5d04[_0x5d1a('0x37')]};return db['Dynamics365Field'][_0x5d1a('0x1a')](_0x276076)['then'](function(_0x20bab8){_0x201293['count']=_0x20bab8;if(_0x5e4f7d[_0x5d1a('0x2c')][_0x5d1a('0x3c')]){_0x1f5d04[_0x5d1a('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x1f5d04);})[_0x5d1a('0x20')](function(_0xe3af42){_0x201293[_0x5d1a('0x3e')]=_0xe3af42;return _0x201293;})[_0x5d1a('0x20')](respondWithFilteredResult(_0xd30261,_0x1f5d04))[_0x5d1a('0x3f')](handleError(_0xd30261,null));};exports[_0x5d1a('0x40')]=function(_0x10be5e,_0x9bb536){var _0x21ff7d={'raw':!![],'where':{'id':_0x10be5e['params']['id']}},_0x387784={};_0x387784['model']=_[_0x5d1a('0x2d')](db[_0x5d1a('0x41')][_0x5d1a('0x42')]);_0x387784['query']=_[_0x5d1a('0x2d')](_0x10be5e[_0x5d1a('0x2c')]);_0x387784[_0x5d1a('0x2e')]=_[_0x5d1a('0x2f')](_0x387784[_0x5d1a('0x2a')],_0x387784['query']);_0x21ff7d[_0x5d1a('0x30')]=_[_0x5d1a('0x2f')](_0x387784['model'],qs[_0x5d1a('0x31')](_0x10be5e[_0x5d1a('0x2c')][_0x5d1a('0x31')]));_0x21ff7d[_0x5d1a('0x30')]=_0x21ff7d[_0x5d1a('0x30')]['length']?_0x21ff7d[_0x5d1a('0x30')]:_0x387784[_0x5d1a('0x2a')];if(_0x10be5e[_0x5d1a('0x2c')][_0x5d1a('0x3c')]){_0x21ff7d['include']=[{'all':!![]}];}_0x21ff7d=_[_0x5d1a('0x3a')]({},_0x21ff7d,_0x10be5e[_0x5d1a('0x3b')]);return db[_0x5d1a('0x41')]['find'](_0x21ff7d)[_0x5d1a('0x20')](handleEntityNotFound(_0x9bb536,null))[_0x5d1a('0x20')](respondWithResult(_0x9bb536,null))[_0x5d1a('0x3f')](handleError(_0x9bb536,null));};exports[_0x5d1a('0x43')]=function(_0x2a412c,_0x5974b8){return db['Dynamics365Field'][_0x5d1a('0x43')](_0x2a412c[_0x5d1a('0x44')],{})[_0x5d1a('0x20')](respondWithResult(_0x5974b8,0xc9))[_0x5d1a('0x3f')](handleError(_0x5974b8,null));};exports[_0x5d1a('0x45')]=function(_0x183b3e,_0x518289){if(_0x183b3e['body']['id']){delete _0x183b3e['body']['id'];}return db['Dynamics365Field'][_0x5d1a('0x46')]({'where':{'id':_0x183b3e[_0x5d1a('0x47')]['id']}})['then'](handleEntityNotFound(_0x518289,null))[_0x5d1a('0x20')](saveUpdates(_0x183b3e[_0x5d1a('0x44')],null))[_0x5d1a('0x20')](respondWithResult(_0x518289,null))[_0x5d1a('0x3f')](handleError(_0x518289,null));};exports[_0x5d1a('0x48')]=function(_0xe2a6e6,_0x383180){return db['Dynamics365Field'][_0x5d1a('0x46')]({'where':{'id':_0xe2a6e6['params']['id']}})[_0x5d1a('0x20')](handleEntityNotFound(_0x383180,null))[_0x5d1a('0x20')](removeEntity(_0x383180,null))['catch'](handleError(_0x383180,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 5d6b972..4ac1041 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 _0xf9a8=['request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x5d91d3,_0x1c03a9){var _0x48d4c6=function(_0x7a8a7c){while(--_0x7a8a7c){_0x5d91d3['push'](_0x5d91d3['shift']());}};_0x48d4c6(++_0x1c03a9);}(_0xf9a8,0x10c));var _0x8f9a=function(_0x196a83,_0x47574a){_0x196a83=_0x196a83-0x0;var _0x1a478e=_0xf9a8[_0x196a83];return _0x1a478e;};'use strict';var _=require(_0x8f9a('0x0'));var util=require(_0x8f9a('0x1'));var logger=require(_0x8f9a('0x2'))(_0x8f9a('0x3'));var moment=require(_0x8f9a('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f9a('0x5'));var fs=require('fs');var path=require(_0x8f9a('0x6'));var rimraf=require(_0x8f9a('0x7'));var config=require(_0x8f9a('0x8'));var attributes=require(_0x8f9a('0x9'));module['exports']=function(_0x42097d,_0x48c2ce){return _0x42097d['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x8f9a('0xa'),'fields':[_0x8f9a('0xb'),_0x8f9a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe6b1=['exports','define','Dynamics365Field','int_dynamics365_fields','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x5c32aa,_0x2011c5){var _0x2e155e=function(_0x1a733f){while(--_0x1a733f){_0x5c32aa['push'](_0x5c32aa['shift']());}};_0x2e155e(++_0x2011c5);}(_0xe6b1,0x10f));var _0x1e6b=function(_0x2d7fcc,_0x7a5df){_0x2d7fcc=_0x2d7fcc-0x0;var _0xfcfecf=_0xe6b1[_0x2d7fcc];return _0xfcfecf;};'use strict';var _=require(_0x1e6b('0x0'));var util=require('util');var logger=require(_0x1e6b('0x1'))(_0x1e6b('0x2'));var moment=require(_0x1e6b('0x3'));var BPromise=require(_0x1e6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e6b('0x5'));var rimraf=require(_0x1e6b('0x6'));var config=require(_0x1e6b('0x7'));var attributes=require(_0x1e6b('0x8'));module[_0x1e6b('0x9')]=function(_0x59c695,_0x54da6e){return _0x59c695[_0x1e6b('0xa')](_0x1e6b('0xb'),attributes,{'tableName':_0x1e6b('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x1e6b('0xd')],'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 8fb83d7..7c3e616 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 _0xaa57=['Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4762d3,_0x1aa67d){var _0x490558=function(_0x1dbfd4){while(--_0x1dbfd4){_0x4762d3['push'](_0x4762d3['shift']());}};_0x490558(++_0x1aa67d);}(_0xaa57,0xb1));var _0x7aa5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaa57[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7aa5('0x0'));var util=require(_0x7aa5('0x1'));var moment=require(_0x7aa5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7aa5('0x3'))['db'];var utils=require(_0x7aa5('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7aa5('0x5'));var client=jayson['client'][_0x7aa5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d30,_0x3cf677,_0x5d9768){return new BPromise(function(_0x1baa6f,_0x3ceda0){return client[_0x7aa5('0x7')](_0x5e2d30,_0x5d9768)[_0x7aa5('0x8')](function(_0x175bca){logger[_0x7aa5('0x9')](_0x7aa5('0xa'),_0x3cf677,_0x7aa5('0xb'));logger[_0x7aa5('0xc')](_0x7aa5('0xd'),_0x3cf677,_0x7aa5('0xb'),JSON['stringify'](_0x175bca));if(_0x175bca['error']){if(_0x175bca[_0x7aa5('0xe')][_0x7aa5('0xf')]===0x1f4){logger[_0x7aa5('0xe')](_0x7aa5('0xa'),_0x3cf677,_0x175bca[_0x7aa5('0xe')][_0x7aa5('0x10')]);return _0x3ceda0(_0x175bca[_0x7aa5('0xe')]['message']);}logger['error'](_0x7aa5('0xa'),_0x3cf677,_0x175bca[_0x7aa5('0xe')]['message']);return _0x1baa6f(_0x175bca[_0x7aa5('0xe')][_0x7aa5('0x10')]);}else{logger['info'](_0x7aa5('0xa'),_0x3cf677,_0x7aa5('0xb'));_0x1baa6f(_0x175bca[_0x7aa5('0x11')][_0x7aa5('0x10')]);}})[_0x7aa5('0x12')](function(_0x384be6){logger[_0x7aa5('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x3cf677,_0x384be6);_0x3ceda0(_0x384be6);});});} \ No newline at end of file +var _0x25b3=['Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x2ab0,_0x4884f8){var _0x5561b5=function(_0x3dea1b){while(--_0x3dea1b){_0x2ab0['push'](_0x2ab0['shift']());}};_0x5561b5(++_0x4884f8);}(_0x25b3,0x108));var _0x325b=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x25b3[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x325b('0x0'));var util=require(_0x325b('0x1'));var moment=require(_0x325b('0x2'));var BPromise=require(_0x325b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x325b('0x4'));var db=require(_0x325b('0x5'))['db'];var utils=require(_0x325b('0x6'));var logger=require('../../config/logger')(_0x325b('0x7'));var config=require(_0x325b('0x8'));var jayson=require(_0x325b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4cfcc5,_0x253a91,_0x1e02b1){return new BPromise(function(_0x49d1a4,_0x4df124){return client[_0x325b('0xa')](_0x4cfcc5,_0x1e02b1)[_0x325b('0xb')](function(_0x2593ed){logger['info'](_0x325b('0xc'),_0x253a91,'request\x20sent');logger[_0x325b('0xd')](_0x325b('0xe'),_0x253a91,_0x325b('0xf'),JSON[_0x325b('0x10')](_0x2593ed));if(_0x2593ed[_0x325b('0x11')]){if(_0x2593ed['error'][_0x325b('0x12')]===0x1f4){logger[_0x325b('0x11')](_0x325b('0xc'),_0x253a91,_0x2593ed[_0x325b('0x11')][_0x325b('0x13')]);return _0x4df124(_0x2593ed['error']['message']);}logger[_0x325b('0x11')](_0x325b('0xc'),_0x253a91,_0x2593ed[_0x325b('0x11')][_0x325b('0x13')]);return _0x49d1a4(_0x2593ed[_0x325b('0x11')][_0x325b('0x13')]);}else{logger[_0x325b('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x253a91,_0x325b('0xf'));_0x49d1a4(_0x2593ed[_0x325b('0x15')][_0x325b('0x13')]);}})[_0x325b('0x16')](function(_0x344e47){logger[_0x325b('0x11')](_0x325b('0xc'),_0x253a91,_0x344e47);_0x4df124(_0x344e47);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 849836b..2db30c7 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 _0x375d=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post'];(function(_0x12efd2,_0x50c07c){var _0x31621f=function(_0x2c639a){while(--_0x2c639a){_0x12efd2['push'](_0x12efd2['shift']());}};_0x31621f(++_0x50c07c);}(_0x375d,0x88));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xd375('0x0'));var util=require(_0xd375('0x1'));var path=require(_0xd375('0x2'));var timeout=require(_0xd375('0x3'));var express=require(_0xd375('0x4'));var router=express['Router']();var fs_extra=require(_0xd375('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd375('0x6'));var config=require(_0xd375('0x7'));var controller=require(_0xd375('0x8'));router[_0xd375('0x9')]('/',auth[_0xd375('0xa')](),controller['index']);router[_0xd375('0x9')](_0xd375('0xb'),auth[_0xd375('0xa')](),controller[_0xd375('0xc')]);router['get'](_0xd375('0xd'),auth['isAuthenticated'](),controller[_0xd375('0xe')]);router[_0xd375('0x9')]('/:id/fields',auth[_0xd375('0xa')](),controller['getFields']);router[_0xd375('0xf')]('/',auth[_0xd375('0xa')](),controller['create']);router['post'](_0xd375('0xd'),auth[_0xd375('0xa')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd375('0x10')]);router['delete'](_0xd375('0xb'),auth[_0xd375('0xa')](),controller[_0xd375('0x11')]);module[_0xd375('0x12')]=router; \ No newline at end of file +var _0x94af=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','./intFreshdeskAccount.controller','get','/:id'];(function(_0x2c28fb,_0x527fc8){var _0x141b8c=function(_0x5dd501){while(--_0x5dd501){_0x2c28fb['push'](_0x2c28fb['shift']());}};_0x141b8c(++_0x527fc8);}(_0x94af,0xde));var _0xf94a=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x94af[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xf94a('0x0'));var util=require(_0xf94a('0x1'));var path=require(_0xf94a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf94a('0x3'));var router=express[_0xf94a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf94a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf94a('0x6'));router[_0xf94a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf94a('0x7')](_0xf94a('0x8'),auth[_0xf94a('0x9')](),controller[_0xf94a('0xa')]);router[_0xf94a('0x7')](_0xf94a('0xb'),auth[_0xf94a('0x9')](),controller[_0xf94a('0xc')]);router[_0xf94a('0x7')](_0xf94a('0xd'),auth['isAuthenticated'](),controller[_0xf94a('0xe')]);router[_0xf94a('0xf')]('/',auth['isAuthenticated'](),controller[_0xf94a('0x10')]);router[_0xf94a('0xf')](_0xf94a('0xb'),auth[_0xf94a('0x9')](),controller['addConfiguration']);router[_0xf94a('0x11')](_0xf94a('0x8'),auth[_0xf94a('0x9')](),controller[_0xf94a('0x12')]);router[_0xf94a('0x13')](_0xf94a('0x8'),auth[_0xf94a('0x9')](),controller[_0xf94a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c55af25..256f86c 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 _0xb145=['STRING','username','remoteUri','exports'];(function(_0x5d0207,_0x4000c4){var _0xf3e249=function(_0x1a1fd9){while(--_0x1a1fd9){_0x5d0207['push'](_0x5d0207['shift']());}};_0xf3e249(++_0x4000c4);}(_0xb145,0xa3));var _0x5b14=function(_0x42b117,_0x3ccf29){_0x42b117=_0x42b117-0x0;var _0x4acd05=_0xb145[_0x42b117];return _0x4acd05;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9536,0x179));var _0x6953=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x9536[_0x2c0ded];return _0x4473e5;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index bc8fd95..00a6df3 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 _0xa149=['merge','options','FreshdeskAccount','findAll','rows','catch','show','includeAll','include','find','create','body','params','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','requester','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter'];(function(_0x4126ab,_0x31afe1){var _0x26bea1=function(_0x440754){while(--_0x440754){_0x4126ab['push'](_0x4126ab['shift']());}};_0x26bea1(++_0x31afe1);}(_0xa149,0x18c));var _0x9a14=function(_0xcb2f0b,_0x311972){_0xcb2f0b=_0xcb2f0b-0x0;var _0xb4d026=_0xa149[_0xcb2f0b];return _0xb4d026;};'use strict';var emlformat=require(_0x9a14('0x0'));var rimraf=require(_0x9a14('0x1'));var zipdir=require(_0x9a14('0x2'));var jsonpatch=require(_0x9a14('0x3'));var rp=require(_0x9a14('0x4'));var moment=require(_0x9a14('0x5'));var BPromise=require(_0x9a14('0x6'));var Mustache=require(_0x9a14('0x7'));var util=require(_0x9a14('0x8'));var path=require('path');var sox=require(_0x9a14('0x9'));var csv=require(_0x9a14('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a14('0xb'));var _=require(_0x9a14('0xc'));var squel=require(_0x9a14('0xd'));var crypto=require(_0x9a14('0xe'));var jsforce=require(_0x9a14('0xf'));var deskjs=require(_0x9a14('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9a14('0x11'));var Papa=require('papaparse');var Redis=require(_0x9a14('0x12'));var authService=require(_0x9a14('0x13'));var qs=require(_0x9a14('0x14'));var as=require(_0x9a14('0x15'));var hardwareService=require(_0x9a14('0x16'));var logger=require(_0x9a14('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a14('0x18'))['db'];var integrations=require(_0x9a14('0x19'));function respondWithStatusCode(_0x4f358b,_0x231f1a){_0x231f1a=_0x231f1a||0xcc;return function(_0x5204ba){if(_0x5204ba){return _0x4f358b[_0x9a14('0x1a')](_0x231f1a);}return _0x4f358b['status'](_0x231f1a)['end']();};}function respondWithResult(_0x257e32,_0x34699e){_0x34699e=_0x34699e||0xc8;return function(_0xe18f92){if(_0xe18f92){return _0x257e32[_0x9a14('0x1b')](_0x34699e)['json'](_0xe18f92);}};}function respondWithFilteredResult(_0x205677,_0x491136){return function(_0x172d72){if(_0x172d72){var _0x8a0666=typeof _0x491136[_0x9a14('0x1c')]===_0x9a14('0x1d')&&typeof _0x491136[_0x9a14('0x1e')]===_0x9a14('0x1d');var _0x25f850=_0x172d72[_0x9a14('0x1f')];var _0x38be44=_0x8a0666?0x0:_0x491136['offset'];var _0x5287e6=_0x8a0666?_0x172d72['count']:_0x491136[_0x9a14('0x1c')]+_0x491136['limit'];var _0x1c0ac3;if(_0x5287e6>=_0x25f850){_0x5287e6=_0x25f850;_0x1c0ac3=0xc8;}else{_0x1c0ac3=0xce;}_0x205677[_0x9a14('0x1b')](_0x1c0ac3);return _0x205677['set']('Content-Range',_0x38be44+'-'+_0x5287e6+'/'+_0x25f850)['json'](_0x172d72);}return null;};}function patchUpdates(_0x5761b8){return function(_0x31dd92){try{jsonpatch[_0x9a14('0x20')](_0x31dd92,_0x5761b8,!![]);}catch(_0x255c41){return BPromise[_0x9a14('0x21')](_0x255c41);}return _0x31dd92[_0x9a14('0x22')]();};}function saveUpdates(_0xc78dd7,_0x2efe09){return function(_0x58caf7){if(_0x58caf7){return _0x58caf7['update'](_0xc78dd7)[_0x9a14('0x23')](function(_0x2d2cf6){return _0x2d2cf6;});}return null;};}function removeEntity(_0x2ce539,_0x53aab4){return function(_0x3be9da){if(_0x3be9da){return _0x3be9da[_0x9a14('0x24')]()[_0x9a14('0x23')](function(){_0x2ce539[_0x9a14('0x1b')](0xcc)[_0x9a14('0x25')]();});}};}function handleEntityNotFound(_0x3ea003,_0x1ba34f){return function(_0x1545c7){if(!_0x1545c7){_0x3ea003['sendStatus'](0x194);}return _0x1545c7;};}function handleError(_0x48c0d1,_0x3089e6){_0x3089e6=_0x3089e6||0x1f4;return function(_0x25a2aa){logger[_0x9a14('0x26')](_0x25a2aa['stack']);if(_0x25a2aa['name']){delete _0x25a2aa[_0x9a14('0x27')];}_0x48c0d1[_0x9a14('0x1b')](_0x3089e6)[_0x9a14('0x28')](_0x25a2aa);};}exports[_0x9a14('0x29')]=function(_0x47755e,_0x5142d8){var _0x7b53f3={},_0x4e171b={},_0x5cc507={'count':0x0,'rows':[]};var _0x7a787=_[_0x9a14('0x2a')](db['FreshdeskAccount'][_0x9a14('0x2b')],function(_0x4c9238){return{'name':_0x4c9238[_0x9a14('0x2c')],'type':_0x4c9238[_0x9a14('0x2d')][_0x9a14('0x2e')]};});_0x4e171b[_0x9a14('0x2f')]=_[_0x9a14('0x2a')](_0x7a787,_0x9a14('0x27'));_0x4e171b[_0x9a14('0x30')]=_[_0x9a14('0x31')](_0x47755e[_0x9a14('0x30')]);_0x4e171b['filters']=_['intersection'](_0x4e171b['model'],_0x4e171b[_0x9a14('0x30')]);_0x7b53f3[_0x9a14('0x32')]=_[_0x9a14('0x33')](_0x4e171b[_0x9a14('0x2f')],qs[_0x9a14('0x34')](_0x47755e[_0x9a14('0x30')][_0x9a14('0x34')]));_0x7b53f3['attributes']=_0x7b53f3[_0x9a14('0x32')][_0x9a14('0x35')]?_0x7b53f3[_0x9a14('0x32')]:_0x4e171b[_0x9a14('0x2f')];if(!_0x47755e[_0x9a14('0x30')]['hasOwnProperty'](_0x9a14('0x36'))){_0x7b53f3[_0x9a14('0x1e')]=qs['limit'](_0x47755e[_0x9a14('0x30')]['limit']);_0x7b53f3[_0x9a14('0x1c')]=qs[_0x9a14('0x1c')](_0x47755e[_0x9a14('0x30')][_0x9a14('0x1c')]);}_0x7b53f3[_0x9a14('0x37')]=qs[_0x9a14('0x38')](_0x47755e[_0x9a14('0x30')][_0x9a14('0x38')]);_0x7b53f3[_0x9a14('0x39')]=qs['filters'](_['pick'](_0x47755e[_0x9a14('0x30')],_0x4e171b[_0x9a14('0x3a')]),_0x7a787);if(_0x47755e['query'][_0x9a14('0x3b')]){_0x7b53f3[_0x9a14('0x39')]=_['merge'](_0x7b53f3[_0x9a14('0x39')],{'$or':_['map'](_0x7a787,function(_0x191e00){if(_0x191e00[_0x9a14('0x2d')]!=='VIRTUAL'){var _0x2dcfe8={};_0x2dcfe8[_0x191e00[_0x9a14('0x27')]]={'$like':'%'+_0x47755e[_0x9a14('0x30')][_0x9a14('0x3b')]+'%'};return _0x2dcfe8;}})});}_0x7b53f3=_[_0x9a14('0x3c')]({},_0x7b53f3,_0x47755e[_0x9a14('0x3d')]);var _0x28a331={'where':_0x7b53f3['where']};return db['FreshdeskAccount'][_0x9a14('0x1f')](_0x28a331)[_0x9a14('0x23')](function(_0x28a5f1){_0x5cc507['count']=_0x28a5f1;if(_0x47755e[_0x9a14('0x30')]['includeAll']){_0x7b53f3['include']=[{'all':!![]}];}return db[_0x9a14('0x3e')][_0x9a14('0x3f')](_0x7b53f3);})[_0x9a14('0x23')](function(_0x2319bc){_0x5cc507[_0x9a14('0x40')]=_0x2319bc;return _0x5cc507;})['then'](respondWithFilteredResult(_0x5142d8,_0x7b53f3))[_0x9a14('0x41')](handleError(_0x5142d8,null));};exports[_0x9a14('0x42')]=function(_0x5a7b5d,_0x2236ca){var _0xd6f431={'raw':![],'where':{'id':_0x5a7b5d['params']['id']}},_0x469d98={};_0x469d98[_0x9a14('0x2f')]=_['keys'](db['FreshdeskAccount'][_0x9a14('0x2b')]);_0x469d98[_0x9a14('0x30')]=_['keys'](_0x5a7b5d[_0x9a14('0x30')]);_0x469d98[_0x9a14('0x3a')]=_[_0x9a14('0x33')](_0x469d98[_0x9a14('0x2f')],_0x469d98['query']);_0xd6f431[_0x9a14('0x32')]=_[_0x9a14('0x33')](_0x469d98['model'],qs[_0x9a14('0x34')](_0x5a7b5d['query'][_0x9a14('0x34')]));_0xd6f431[_0x9a14('0x32')]=_0xd6f431['attributes'][_0x9a14('0x35')]?_0xd6f431[_0x9a14('0x32')]:_0x469d98[_0x9a14('0x2f')];if(_0x5a7b5d[_0x9a14('0x30')][_0x9a14('0x43')]){_0xd6f431[_0x9a14('0x44')]=[{'all':!![]}];}_0xd6f431=_[_0x9a14('0x3c')]({},_0xd6f431,_0x5a7b5d['options']);return db[_0x9a14('0x3e')][_0x9a14('0x45')](_0xd6f431)[_0x9a14('0x23')](handleEntityNotFound(_0x2236ca,null))['then'](respondWithResult(_0x2236ca,null))[_0x9a14('0x41')](handleError(_0x2236ca,null));};exports[_0x9a14('0x46')]=function(_0x13f6c5,_0x49aee8){return db['FreshdeskAccount'][_0x9a14('0x46')](_0x13f6c5[_0x9a14('0x47')],{})[_0x9a14('0x23')](respondWithResult(_0x49aee8,0xc9))[_0x9a14('0x41')](handleError(_0x49aee8,null));};exports['update']=function(_0x11950a,_0x414977){if(_0x11950a[_0x9a14('0x47')]['id']){delete _0x11950a['body']['id'];}return db['FreshdeskAccount'][_0x9a14('0x45')]({'where':{'id':_0x11950a[_0x9a14('0x48')]['id']}})[_0x9a14('0x23')](handleEntityNotFound(_0x414977,null))[_0x9a14('0x23')](saveUpdates(_0x11950a[_0x9a14('0x47')],null))[_0x9a14('0x23')](respondWithResult(_0x414977,null))['catch'](handleError(_0x414977,null));};exports[_0x9a14('0x24')]=function(_0x5f23da,_0x46344b){return db[_0x9a14('0x3e')][_0x9a14('0x45')]({'where':{'id':_0x5f23da[_0x9a14('0x48')]['id']}})[_0x9a14('0x23')](handleEntityNotFound(_0x46344b,null))[_0x9a14('0x23')](removeEntity(_0x46344b,null))[_0x9a14('0x41')](handleError(_0x46344b,null));};exports[_0x9a14('0x49')]=function(_0x29a6e5,_0x3815d9,_0x916ace){var _0x486d48={};var _0x671797={};var _0x1f7fdf;var _0x1f0e4f;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x29a6e5[_0x9a14('0x48')]['id']}})['then'](handleEntityNotFound(_0x3815d9,null))[_0x9a14('0x23')](function(_0x3397a8){if(_0x3397a8){_0x1f7fdf=_0x3397a8;_0x671797['model']=_[_0x9a14('0x31')](db[_0x9a14('0x4a')][_0x9a14('0x2b')]);_0x671797[_0x9a14('0x30')]=_[_0x9a14('0x31')](_0x29a6e5['query']);_0x671797['filters']=_[_0x9a14('0x33')](_0x671797['model'],_0x671797[_0x9a14('0x30')]);_0x486d48['attributes']=_[_0x9a14('0x33')](_0x671797[_0x9a14('0x2f')],qs['fields'](_0x29a6e5[_0x9a14('0x30')][_0x9a14('0x34')]));_0x486d48[_0x9a14('0x32')]=_0x486d48[_0x9a14('0x32')][_0x9a14('0x35')]?_0x486d48[_0x9a14('0x32')]:_0x671797['model'];_0x486d48['order']=qs[_0x9a14('0x38')](_0x29a6e5[_0x9a14('0x30')][_0x9a14('0x38')]);_0x486d48[_0x9a14('0x39')]=qs['filters'](_['pick'](_0x29a6e5['query'],_0x671797['filters']));if(_0x29a6e5['query'][_0x9a14('0x3b')]){_0x486d48['where']=_[_0x9a14('0x3c')](_0x486d48['where'],{'$or':_[_0x9a14('0x2a')](_0x486d48['attributes'],function(_0x292de7){var _0x2fd62d={};_0x2fd62d[_0x292de7]={'$like':'%'+_0x29a6e5[_0x9a14('0x30')][_0x9a14('0x3b')]+'%'};return _0x2fd62d;})});}_0x486d48=_[_0x9a14('0x3c')]({},_0x486d48,_0x29a6e5['options']);return _0x1f7fdf[_0x9a14('0x49')](_0x486d48);}})['then'](function(_0x296509){if(_0x296509){_0x1f0e4f=_0x296509[_0x9a14('0x35')];if(!_0x29a6e5[_0x9a14('0x30')][_0x9a14('0x4b')](_0x9a14('0x36'))){_0x486d48['limit']=qs[_0x9a14('0x1e')](_0x29a6e5[_0x9a14('0x30')][_0x9a14('0x1e')]);_0x486d48[_0x9a14('0x1c')]=qs[_0x9a14('0x1c')](_0x29a6e5[_0x9a14('0x30')]['offset']);}return _0x1f7fdf[_0x9a14('0x49')](_0x486d48);}})[_0x9a14('0x23')](function(_0x52e0c3){if(_0x52e0c3){return _0x52e0c3?{'count':_0x1f0e4f,'rows':_0x52e0c3}:null;}})[_0x9a14('0x23')](respondWithResult(_0x3815d9,null))[_0x9a14('0x41')](handleError(_0x3815d9,null));};exports[_0x9a14('0x4c')]=function(_0x136e33,_0x542961,_0x5a74e2){if(_0x136e33['body']['id']){delete _0x136e33[_0x9a14('0x47')]['id'];}return db[_0x9a14('0x3e')][_0x9a14('0x4d')]({'where':{'id':_0x136e33[_0x9a14('0x48')]['id']}})[_0x9a14('0x23')](handleEntityNotFound(_0x542961,null))['then'](function(_0x375fff){if(_0x375fff){_0x136e33[_0x9a14('0x47')][_0x9a14('0x4e')]=_0x375fff['id'];_0x136e33['body']['Subjects']=integrations[_0x9a14('0x4f')](_0x136e33['body'][_0x9a14('0x50')],_0x136e33[_0x9a14('0x47')][_0x9a14('0x2d')]);_0x136e33['body']['Descriptions']=integrations['getDescriptions'](_0x136e33['body'][_0x9a14('0x50')],_0x136e33[_0x9a14('0x47')][_0x9a14('0x2d')]);return db[_0x9a14('0x4a')]['create'](_0x136e33['body'],{'include':[{'model':db[_0x9a14('0x51')],'as':_0x9a14('0x52')},{'model':db[_0x9a14('0x51')],'as':_0x9a14('0x53')}]});}return null;})[_0x9a14('0x23')](respondWithResult(_0x542961,null))['catch'](handleError(_0x542961,null));};exports[_0x9a14('0x54')]=function(_0x38715f,_0x19191b,_0x3445de){var _0x5b1ede='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x38715f[_0x9a14('0x48')]['id']},'attributes':['id',_0x9a14('0x55'),'apiKey']})['then'](handleEntityNotFound(_0x19191b,null))[_0x9a14('0x23')](function(_0x5406ad){if(_0x5406ad){_0x5b1ede=_0x5406ad[_0x9a14('0x55')];var _0xc08280=_0x5b1ede['slice'](-0x1);if(_0xc08280==='/'){_0x5b1ede=_0x5b1ede[_0x9a14('0x56')](0x0,_0x5b1ede['lastIndexOf'](_0xc08280));}return rp({'method':_0x9a14('0x57'),'uri':util[_0x9a14('0x58')](_0x9a14('0x59'),_0x5b1ede,_0x9a14('0x5a')),'headers':{'Authorization':util[_0x9a14('0x58')](_0x9a14('0x5b'),new Buffer(util[_0x9a14('0x58')](_0x9a14('0x5c'),_0x5406ad[_0x9a14('0x5d')]))[_0x9a14('0x5e')]('base64'))},'json':!![]});}})[_0x9a14('0x23')](function(_0x1f5698){if(_0x1f5698){var _0x183ef2=[_0x9a14('0x5f'),_0x9a14('0x60'),_0x9a14('0x61'),'description',_0x9a14('0x1b'),_0x9a14('0x62'),_0x9a14('0x63'),'source',_0x9a14('0x64'),'group',_0x9a14('0x65')];_[_0x9a14('0x66')](_0x1f5698,function(_0x449fb5){return _0x183ef2[_0x9a14('0x67')](_0x449fb5[_0x9a14('0x27')])||!_0x449fb5[_0x9a14('0x68')]&&_0x449fb5['type']!==_0x9a14('0x69')&&_0x449fb5[_0x9a14('0x2d')]!==_0x9a14('0x6a');});return{'count':_0x1f5698[_0x9a14('0x35')],'rows':_['map'](_0x1f5698,function(_0x4d78be){return{'id':_0x4d78be['name'],'name':_0x4d78be[_0x9a14('0x6b')],'custom':!_0x4d78be[_0x9a14('0x68')],'options':_0x4d78be[_0x9a14('0x6c')]?_['map'](_0x4d78be[_0x9a14('0x6c')],function(_0x5cfcdd){return{'name':_[_0x9a14('0x6d')](_0x5cfcdd),'value':_0x5cfcdd};}):[]};})};}})[_0x9a14('0x23')](respondWithResult(_0x19191b,null))[_0x9a14('0x41')](function(_0x25c89d){var _0x3b8f22=_0x38715f['query'][_0x9a14('0x6e')]?0x1f4:_0x25c89d[_0x9a14('0x6f')]||0x1f4;logger[_0x9a14('0x26')](_0x9a14('0x70'),_0x9a14('0x54'),_0x3b8f22,JSON[_0x9a14('0x71')](_0x25c89d));delete _0x25c89d[_0x9a14('0x27')];if(_0x3b8f22===0x191){_0x3b8f22=0x190;}_0x19191b[_0x9a14('0x1b')](_0x3b8f22)[_0x9a14('0x28')](_0x38715f[_0x9a14('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x25c89d[_0x9a14('0x6f')]}:_0x25c89d);});}; \ No newline at end of file +var _0x43fd=['getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','end','status','offset','count','limit','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','pick','options','nolimit','addConfiguration','Subjects','getSubjects','channel','FreshdeskField','getFields','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','description','source','company','remove','includes','custom_text','custom_dropdown','label','choices','capitalize','statusCode'];(function(_0x453774,_0x4329d){var _0x11b9f1=function(_0x586678){while(--_0x586678){_0x453774['push'](_0x453774['shift']());}};_0x11b9f1(++_0x4329d);}(_0x43fd,0x150));var _0xd43f=function(_0x3da7eb,_0x3b08db){_0x3da7eb=_0x3da7eb-0x0;var _0x3cd42f=_0x43fd[_0x3da7eb];return _0x3cd42f;};'use strict';var emlformat=require(_0xd43f('0x0'));var rimraf=require(_0xd43f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd43f('0x2'));var rp=require('request-promise');var moment=require(_0xd43f('0x3'));var BPromise=require(_0xd43f('0x4'));var Mustache=require(_0xd43f('0x5'));var util=require(_0xd43f('0x6'));var path=require(_0xd43f('0x7'));var sox=require(_0xd43f('0x8'));var csv=require(_0xd43f('0x9'));var ejs=require(_0xd43f('0xa'));var fs=require('fs');var fs_extra=require(_0xd43f('0xb'));var _=require(_0xd43f('0xc'));var squel=require(_0xd43f('0xd'));var crypto=require(_0xd43f('0xe'));var jsforce=require(_0xd43f('0xf'));var deskjs=require(_0xd43f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd43f('0x11'));var Papa=require(_0xd43f('0x12'));var Redis=require(_0xd43f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd43f('0x14'));var as=require(_0xd43f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd43f('0x16'))(_0xd43f('0x17'));var utils=require(_0xd43f('0x18'));var config=require(_0xd43f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd43f('0x1a'));function respondWithStatusCode(_0xed42ff,_0x5b90a7){_0x5b90a7=_0x5b90a7||0xcc;return function(_0x42d81c){if(_0x42d81c){return _0xed42ff['sendStatus'](_0x5b90a7);}return _0xed42ff['status'](_0x5b90a7)[_0xd43f('0x1b')]();};}function respondWithResult(_0x12bd82,_0x568087){_0x568087=_0x568087||0xc8;return function(_0x2ba98e){if(_0x2ba98e){return _0x12bd82[_0xd43f('0x1c')](_0x568087)['json'](_0x2ba98e);}};}function respondWithFilteredResult(_0x229f81,_0x351c9c){return function(_0x10f584){if(_0x10f584){var _0x182ed6=typeof _0x351c9c[_0xd43f('0x1d')]==='undefined'&&typeof _0x351c9c['limit']==='undefined';var _0x2b0dd9=_0x10f584[_0xd43f('0x1e')];var _0xda0dcc=_0x182ed6?0x0:_0x351c9c[_0xd43f('0x1d')];var _0x57931d=_0x182ed6?_0x10f584[_0xd43f('0x1e')]:_0x351c9c[_0xd43f('0x1d')]+_0x351c9c[_0xd43f('0x1f')];var _0x2702cf;if(_0x57931d>=_0x2b0dd9){_0x57931d=_0x2b0dd9;_0x2702cf=0xc8;}else{_0x2702cf=0xce;}_0x229f81[_0xd43f('0x1c')](_0x2702cf);return _0x229f81['set'](_0xd43f('0x20'),_0xda0dcc+'-'+_0x57931d+'/'+_0x2b0dd9)['json'](_0x10f584);}return null;};}function patchUpdates(_0x1ad9d3){return function(_0x5d93f4){try{jsonpatch[_0xd43f('0x21')](_0x5d93f4,_0x1ad9d3,!![]);}catch(_0x370e19){return BPromise['reject'](_0x370e19);}return _0x5d93f4[_0xd43f('0x22')]();};}function saveUpdates(_0x1c79b8,_0x15a7d9){return function(_0x58bd30){if(_0x58bd30){return _0x58bd30[_0xd43f('0x23')](_0x1c79b8)['then'](function(_0x3ff3dc){return _0x3ff3dc;});}return null;};}function removeEntity(_0x4646c2,_0x1bf18d){return function(_0xa7858f){if(_0xa7858f){return _0xa7858f[_0xd43f('0x24')]()[_0xd43f('0x25')](function(){_0x4646c2['status'](0xcc)[_0xd43f('0x1b')]();});}};}function handleEntityNotFound(_0x4750c3,_0x30d7a3){return function(_0x32df4f){if(!_0x32df4f){_0x4750c3[_0xd43f('0x26')](0x194);}return _0x32df4f;};}function handleError(_0x2f7769,_0x2df5b4){_0x2df5b4=_0x2df5b4||0x1f4;return function(_0x281bb5){logger[_0xd43f('0x27')](_0x281bb5[_0xd43f('0x28')]);if(_0x281bb5['name']){delete _0x281bb5[_0xd43f('0x29')];}_0x2f7769[_0xd43f('0x1c')](_0x2df5b4)[_0xd43f('0x2a')](_0x281bb5);};}exports[_0xd43f('0x2b')]=function(_0x82103b,_0x30d1dc){var _0x4efdb5={},_0x23293d={},_0x2442ea={'count':0x0,'rows':[]};var _0x1db45c=_[_0xd43f('0x2c')](db[_0xd43f('0x2d')][_0xd43f('0x2e')],function(_0xe680a3){return{'name':_0xe680a3[_0xd43f('0x2f')],'type':_0xe680a3[_0xd43f('0x30')]['key']};});_0x23293d[_0xd43f('0x31')]=_[_0xd43f('0x2c')](_0x1db45c,'name');_0x23293d[_0xd43f('0x32')]=_['keys'](_0x82103b[_0xd43f('0x32')]);_0x23293d['filters']=_[_0xd43f('0x33')](_0x23293d['model'],_0x23293d[_0xd43f('0x32')]);_0x4efdb5['attributes']=_[_0xd43f('0x33')](_0x23293d[_0xd43f('0x31')],qs['fields'](_0x82103b[_0xd43f('0x32')][_0xd43f('0x34')]));_0x4efdb5[_0xd43f('0x35')]=_0x4efdb5[_0xd43f('0x35')][_0xd43f('0x36')]?_0x4efdb5[_0xd43f('0x35')]:_0x23293d['model'];if(!_0x82103b[_0xd43f('0x32')][_0xd43f('0x37')]('nolimit')){_0x4efdb5[_0xd43f('0x1f')]=qs[_0xd43f('0x1f')](_0x82103b[_0xd43f('0x32')][_0xd43f('0x1f')]);_0x4efdb5[_0xd43f('0x1d')]=qs['offset'](_0x82103b[_0xd43f('0x32')]['offset']);}_0x4efdb5[_0xd43f('0x38')]=qs[_0xd43f('0x39')](_0x82103b[_0xd43f('0x32')][_0xd43f('0x39')]);_0x4efdb5[_0xd43f('0x3a')]=qs[_0xd43f('0x3b')](_['pick'](_0x82103b[_0xd43f('0x32')],_0x23293d[_0xd43f('0x3b')]),_0x1db45c);if(_0x82103b['query'][_0xd43f('0x3c')]){_0x4efdb5[_0xd43f('0x3a')]=_[_0xd43f('0x3d')](_0x4efdb5['where'],{'$or':_[_0xd43f('0x2c')](_0x1db45c,function(_0x4f0a86){if(_0x4f0a86[_0xd43f('0x30')]!==_0xd43f('0x3e')){var _0x5f31ef={};_0x5f31ef[_0x4f0a86[_0xd43f('0x29')]]={'$like':'%'+_0x82103b['query'][_0xd43f('0x3c')]+'%'};return _0x5f31ef;}})});}_0x4efdb5=_[_0xd43f('0x3d')]({},_0x4efdb5,_0x82103b['options']);var _0x4c8f8e={'where':_0x4efdb5['where']};return db['FreshdeskAccount'][_0xd43f('0x1e')](_0x4c8f8e)[_0xd43f('0x25')](function(_0x338635){_0x2442ea[_0xd43f('0x1e')]=_0x338635;if(_0x82103b[_0xd43f('0x32')][_0xd43f('0x3f')]){_0x4efdb5[_0xd43f('0x40')]=[{'all':!![]}];}return db[_0xd43f('0x2d')]['findAll'](_0x4efdb5);})['then'](function(_0x1952d5){_0x2442ea[_0xd43f('0x41')]=_0x1952d5;return _0x2442ea;})[_0xd43f('0x25')](respondWithFilteredResult(_0x30d1dc,_0x4efdb5))[_0xd43f('0x42')](handleError(_0x30d1dc,null));};exports[_0xd43f('0x43')]=function(_0xe676e5,_0x239339){var _0x335315={'raw':![],'where':{'id':_0xe676e5['params']['id']}},_0x41bf12={};_0x41bf12[_0xd43f('0x31')]=_[_0xd43f('0x44')](db[_0xd43f('0x2d')][_0xd43f('0x2e')]);_0x41bf12[_0xd43f('0x32')]=_[_0xd43f('0x44')](_0xe676e5[_0xd43f('0x32')]);_0x41bf12[_0xd43f('0x3b')]=_['intersection'](_0x41bf12[_0xd43f('0x31')],_0x41bf12['query']);_0x335315[_0xd43f('0x35')]=_[_0xd43f('0x33')](_0x41bf12[_0xd43f('0x31')],qs['fields'](_0xe676e5['query'][_0xd43f('0x34')]));_0x335315['attributes']=_0x335315[_0xd43f('0x35')][_0xd43f('0x36')]?_0x335315['attributes']:_0x41bf12[_0xd43f('0x31')];if(_0xe676e5[_0xd43f('0x32')][_0xd43f('0x3f')]){_0x335315[_0xd43f('0x40')]=[{'all':!![]}];}_0x335315=_[_0xd43f('0x3d')]({},_0x335315,_0xe676e5['options']);return db[_0xd43f('0x2d')][_0xd43f('0x45')](_0x335315)[_0xd43f('0x25')](handleEntityNotFound(_0x239339,null))['then'](respondWithResult(_0x239339,null))[_0xd43f('0x42')](handleError(_0x239339,null));};exports[_0xd43f('0x46')]=function(_0x58aa4a,_0x1e64a2){return db[_0xd43f('0x2d')][_0xd43f('0x46')](_0x58aa4a[_0xd43f('0x47')],{})[_0xd43f('0x25')](respondWithResult(_0x1e64a2,0xc9))['catch'](handleError(_0x1e64a2,null));};exports['update']=function(_0x13f856,_0x1d15bb){if(_0x13f856['body']['id']){delete _0x13f856[_0xd43f('0x47')]['id'];}return db[_0xd43f('0x2d')][_0xd43f('0x45')]({'where':{'id':_0x13f856[_0xd43f('0x48')]['id']}})[_0xd43f('0x25')](handleEntityNotFound(_0x1d15bb,null))[_0xd43f('0x25')](saveUpdates(_0x13f856['body'],null))['then'](respondWithResult(_0x1d15bb,null))[_0xd43f('0x42')](handleError(_0x1d15bb,null));};exports[_0xd43f('0x24')]=function(_0xa5f195,_0x4cd5a0){return db[_0xd43f('0x2d')]['find']({'where':{'id':_0xa5f195[_0xd43f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cd5a0,null))[_0xd43f('0x25')](removeEntity(_0x4cd5a0,null))['catch'](handleError(_0x4cd5a0,null));};exports[_0xd43f('0x49')]=function(_0x5041a6,_0x1ba071,_0x620665){var _0x4c3036={};var _0x3ad9c4={};var _0x4972aa;var _0x453e45;return db[_0xd43f('0x2d')][_0xd43f('0x4a')]({'where':{'id':_0x5041a6['params']['id']}})[_0xd43f('0x25')](handleEntityNotFound(_0x1ba071,null))[_0xd43f('0x25')](function(_0x4986bd){if(_0x4986bd){_0x4972aa=_0x4986bd;_0x3ad9c4[_0xd43f('0x31')]=_[_0xd43f('0x44')](db[_0xd43f('0x4b')][_0xd43f('0x2e')]);_0x3ad9c4[_0xd43f('0x32')]=_[_0xd43f('0x44')](_0x5041a6[_0xd43f('0x32')]);_0x3ad9c4['filters']=_['intersection'](_0x3ad9c4[_0xd43f('0x31')],_0x3ad9c4['query']);_0x4c3036[_0xd43f('0x35')]=_[_0xd43f('0x33')](_0x3ad9c4['model'],qs[_0xd43f('0x34')](_0x5041a6[_0xd43f('0x32')][_0xd43f('0x34')]));_0x4c3036[_0xd43f('0x35')]=_0x4c3036[_0xd43f('0x35')][_0xd43f('0x36')]?_0x4c3036[_0xd43f('0x35')]:_0x3ad9c4[_0xd43f('0x31')];_0x4c3036[_0xd43f('0x38')]=qs['sort'](_0x5041a6['query'][_0xd43f('0x39')]);_0x4c3036[_0xd43f('0x3a')]=qs[_0xd43f('0x3b')](_[_0xd43f('0x4c')](_0x5041a6['query'],_0x3ad9c4[_0xd43f('0x3b')]));if(_0x5041a6[_0xd43f('0x32')][_0xd43f('0x3c')]){_0x4c3036['where']=_['merge'](_0x4c3036[_0xd43f('0x3a')],{'$or':_[_0xd43f('0x2c')](_0x4c3036['attributes'],function(_0x2b3832){var _0x30ef2c={};_0x30ef2c[_0x2b3832]={'$like':'%'+_0x5041a6['query']['filter']+'%'};return _0x30ef2c;})});}_0x4c3036=_['merge']({},_0x4c3036,_0x5041a6[_0xd43f('0x4d')]);return _0x4972aa[_0xd43f('0x49')](_0x4c3036);}})[_0xd43f('0x25')](function(_0x544bba){if(_0x544bba){_0x453e45=_0x544bba[_0xd43f('0x36')];if(!_0x5041a6[_0xd43f('0x32')][_0xd43f('0x37')](_0xd43f('0x4e'))){_0x4c3036[_0xd43f('0x1f')]=qs['limit'](_0x5041a6[_0xd43f('0x32')][_0xd43f('0x1f')]);_0x4c3036['offset']=qs[_0xd43f('0x1d')](_0x5041a6[_0xd43f('0x32')][_0xd43f('0x1d')]);}return _0x4972aa['getConfigurations'](_0x4c3036);}})[_0xd43f('0x25')](function(_0x4b0add){if(_0x4b0add){return _0x4b0add?{'count':_0x453e45,'rows':_0x4b0add}:null;}})[_0xd43f('0x25')](respondWithResult(_0x1ba071,null))['catch'](handleError(_0x1ba071,null));};exports[_0xd43f('0x4f')]=function(_0x48e537,_0x9fe401,_0x1b8351){if(_0x48e537['body']['id']){delete _0x48e537[_0xd43f('0x47')]['id'];}return db[_0xd43f('0x2d')]['findOne']({'where':{'id':_0x48e537[_0xd43f('0x48')]['id']}})[_0xd43f('0x25')](handleEntityNotFound(_0x9fe401,null))[_0xd43f('0x25')](function(_0x3581bd){if(_0x3581bd){_0x48e537['body']['AccountId']=_0x3581bd['id'];_0x48e537[_0xd43f('0x47')][_0xd43f('0x50')]=integrations[_0xd43f('0x51')](_0x48e537[_0xd43f('0x47')][_0xd43f('0x52')],_0x48e537[_0xd43f('0x47')][_0xd43f('0x30')]);_0x48e537[_0xd43f('0x47')]['Descriptions']=integrations['getDescriptions'](_0x48e537['body']['channel'],_0x48e537[_0xd43f('0x47')][_0xd43f('0x30')]);return db['FreshdeskConfiguration'][_0xd43f('0x46')](_0x48e537['body'],{'include':[{'model':db[_0xd43f('0x53')],'as':_0xd43f('0x50')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xd43f('0x25')](respondWithResult(_0x9fe401,null))[_0xd43f('0x42')](handleError(_0x9fe401,null));};exports[_0xd43f('0x54')]=function(_0x2a06dd,_0x3c4313,_0x471723){var _0x27e07b='';return db[_0xd43f('0x2d')][_0xd43f('0x4a')]({'where':{'id':_0x2a06dd[_0xd43f('0x48')]['id']},'attributes':['id','remoteUri',_0xd43f('0x55')]})[_0xd43f('0x25')](handleEntityNotFound(_0x3c4313,null))[_0xd43f('0x25')](function(_0x105344){if(_0x105344){_0x27e07b=_0x105344['remoteUri'];var _0x5f42e4=_0x27e07b[_0xd43f('0x56')](-0x1);if(_0x5f42e4==='/'){_0x27e07b=_0x27e07b['substring'](0x0,_0x27e07b[_0xd43f('0x57')](_0x5f42e4));}return rp({'method':_0xd43f('0x58'),'uri':util[_0xd43f('0x59')](_0xd43f('0x5a'),_0x27e07b,_0xd43f('0x5b')),'headers':{'Authorization':util[_0xd43f('0x59')]('Basic\x20%s',new Buffer(util[_0xd43f('0x59')](_0xd43f('0x5c'),_0x105344[_0xd43f('0x55')]))[_0xd43f('0x5d')](_0xd43f('0x5e')))},'json':!![]});}})[_0xd43f('0x25')](function(_0x2d1f47){if(_0x2d1f47){var _0x5f04f0=['requester',_0xd43f('0x5f'),_0xd43f('0x60'),_0xd43f('0x61'),_0xd43f('0x1c'),'priority','group',_0xd43f('0x62'),'ticket_type','group',_0xd43f('0x63')];_[_0xd43f('0x64')](_0x2d1f47,function(_0x452cf2){return _0x5f04f0[_0xd43f('0x65')](_0x452cf2[_0xd43f('0x29')])||!_0x452cf2['default']&&_0x452cf2[_0xd43f('0x30')]!==_0xd43f('0x66')&&_0x452cf2[_0xd43f('0x30')]!==_0xd43f('0x67');});return{'count':_0x2d1f47[_0xd43f('0x36')],'rows':_['map'](_0x2d1f47,function(_0x50aecc){return{'id':_0x50aecc[_0xd43f('0x29')],'name':_0x50aecc[_0xd43f('0x68')],'custom':!_0x50aecc['default'],'options':_0x50aecc[_0xd43f('0x69')]?_['map'](_0x50aecc['choices'],function(_0x504246){return{'name':_[_0xd43f('0x6a')](_0x504246),'value':_0x504246};}):[]};})};}})[_0xd43f('0x25')](respondWithResult(_0x3c4313,null))[_0xd43f('0x42')](function(_0x4f5bb1){var _0x90abae=_0x2a06dd[_0xd43f('0x32')]['test']?0x1f4:_0x4f5bb1[_0xd43f('0x6b')]||0x1f4;logger[_0xd43f('0x27')](_0xd43f('0x6c'),_0xd43f('0x54'),_0x90abae,JSON[_0xd43f('0x6d')](_0x4f5bb1));delete _0x4f5bb1[_0xd43f('0x29')];if(_0x90abae===0x191){_0x90abae=0x190;}_0x3c4313['status'](_0x90abae)[_0xd43f('0x2a')](_0x2a06dd[_0xd43f('0x32')]['test']?{'message':_0xd43f('0x6e'),'statusCode':_0x4f5bb1['statusCode']}:_0x4f5bb1);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9a24410..24f3baa 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 _0x6f1c=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports'];(function(_0x4d043e,_0x30e278){var _0x4714eb=function(_0x3d8ad8){while(--_0x3d8ad8){_0x4d043e['push'](_0x4d043e['shift']());}};_0x4714eb(++_0x30e278);}(_0x6f1c,0x16a));var _0xc6f1=function(_0x54b122,_0x398258){_0x54b122=_0x54b122-0x0;var _0x6a359f=_0x6f1c[_0x54b122];return _0x6a359f;};'use strict';var _=require('lodash');var util=require(_0xc6f1('0x0'));var logger=require(_0xc6f1('0x1'))(_0xc6f1('0x2'));var moment=require(_0xc6f1('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6f1('0x4'));var fs=require('fs');var path=require(_0xc6f1('0x5'));var rimraf=require(_0xc6f1('0x6'));var config=require(_0xc6f1('0x7'));var attributes=require(_0xc6f1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc6f1('0x9')]=function(_0x63a65f,_0x501789){return _0x63a65f['define'](_0xc6f1('0xa'),attributes,{'tableName':_0xc6f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd714=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','path','../../config/environment'];(function(_0x7b2187,_0x2399ed){var _0x20e43b=function(_0x262471){while(--_0x262471){_0x7b2187['push'](_0x7b2187['shift']());}};_0x20e43b(++_0x2399ed);}(_0xd714,0x7e));var _0x4d71=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0xd714[_0x3c6125];return _0x2f47b8;};'use strict';var _=require(_0x4d71('0x0'));var util=require(_0x4d71('0x1'));var logger=require(_0x4d71('0x2'))('api');var moment=require(_0x4d71('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d71('0x4'));var rimraf=require('rimraf');var config=require(_0x4d71('0x5'));var attributes=require(_0x4d71('0x6'));var integrations=require(_0x4d71('0x7'));module['exports']=function(_0x49afec,_0x579e99){return _0x49afec[_0x4d71('0x8')](_0x4d71('0x9'),attributes,{'tableName':_0x4d71('0xa'),'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 24055a6..c2e350b 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 _0xcff8=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','where','attributes','limit','map','include','model','ShowFreshdeskAccount','FreshdeskAccount','find','raw','info','lodash','util','moment','bluebird','ioredis'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xcff8,0x1ab));var _0x8cff=function(_0x3fea00,_0x95c208){_0x3fea00=_0x3fea00-0x0;var _0x5c4dec=_0xcff8[_0x3fea00];return _0x5c4dec;};'use strict';var _=require(_0x8cff('0x0'));var util=require(_0x8cff('0x1'));var moment=require(_0x8cff('0x2'));var BPromise=require(_0x8cff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8cff('0x4'));var db=require(_0x8cff('0x5'))['db'];var utils=require(_0x8cff('0x6'));var logger=require('../../config/logger')(_0x8cff('0x7'));var config=require(_0x8cff('0x8'));var jayson=require(_0x8cff('0x9'));var client=jayson[_0x8cff('0xa')][_0x8cff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288b0f,_0xedeab3,_0x5389b9){return new BPromise(function(_0x1834fc,_0x1ddd4a){return client['request'](_0x288b0f,_0x5389b9)[_0x8cff('0xc')](function(_0x2559c7){logger['info'](_0x8cff('0xd'),_0xedeab3,'request\x20sent');logger[_0x8cff('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xedeab3,_0x8cff('0xf'),JSON[_0x8cff('0x10')](_0x2559c7));if(_0x2559c7[_0x8cff('0x11')]){if(_0x2559c7[_0x8cff('0x11')][_0x8cff('0x12')]===0x1f4){logger['error'](_0x8cff('0xd'),_0xedeab3,_0x2559c7[_0x8cff('0x11')][_0x8cff('0x13')]);return _0x1ddd4a(_0x2559c7['error'][_0x8cff('0x13')]);}logger['error'](_0x8cff('0xd'),_0xedeab3,_0x2559c7[_0x8cff('0x11')][_0x8cff('0x13')]);return _0x1834fc(_0x2559c7[_0x8cff('0x11')]['message']);}else{logger['info'](_0x8cff('0xd'),_0xedeab3,'request\x20sent');_0x1834fc(_0x2559c7[_0x8cff('0x14')][_0x8cff('0x13')]);}})[_0x8cff('0x15')](function(_0x2d6e79){logger[_0x8cff('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0xedeab3,_0x2d6e79);_0x1ddd4a(_0x2d6e79);});});}exports[_0x8cff('0x16')]=function(_0x2f1add){var _0x197220=this;return new Promise(function(_0x32612c,_0x81d073){return db['FreshdeskAccount'][_0x8cff('0x17')]({'raw':_0x2f1add['options']?_0x2f1add[_0x8cff('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2f1add[_0x8cff('0x18')]?_0x2f1add[_0x8cff('0x18')][_0x8cff('0x19')]||null:null,'attributes':_0x2f1add[_0x8cff('0x18')]?_0x2f1add['options'][_0x8cff('0x1a')]||null:null,'limit':_0x2f1add[_0x8cff('0x18')]?_0x2f1add[_0x8cff('0x18')][_0x8cff('0x1b')]||null:null,'include':_0x2f1add[_0x8cff('0x18')]?_0x2f1add[_0x8cff('0x18')]['include']?_[_0x8cff('0x1c')](_0x2f1add[_0x8cff('0x18')][_0x8cff('0x1d')],function(_0x300dbc){return{'model':db[_0x300dbc['model']],'as':_0x300dbc['as'],'attributes':_0x300dbc[_0x8cff('0x1a')],'include':_0x300dbc[_0x8cff('0x1d')]?_[_0x8cff('0x1c')](_0x300dbc[_0x8cff('0x1d')],function(_0x16826a){return{'model':db[_0x16826a[_0x8cff('0x1e')]],'as':_0x16826a['as'],'attributes':_0x16826a[_0x8cff('0x1a')],'include':_0x16826a[_0x8cff('0x1d')]?_['map'](_0x16826a[_0x8cff('0x1d')],function(_0x1ac2eb){return{'model':db[_0x1ac2eb['model']],'as':_0x1ac2eb['as'],'attributes':_0x1ac2eb[_0x8cff('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8cff('0xc')](function(_0x256816){logger['info'](_0x8cff('0x16'),_0x2f1add);logger[_0x8cff('0xe')](_0x8cff('0x16'),_0x2f1add,JSON[_0x8cff('0x10')](_0x256816));_0x32612c(_0x256816);})['catch'](function(_0x3eb53a){logger[_0x8cff('0x11')](_0x8cff('0x16'),_0x3eb53a[_0x8cff('0x13')],_0x2f1add);_0x81d073(_0x197220[_0x8cff('0x11')](0x1f4,_0x3eb53a[_0x8cff('0x13')]));});});};exports[_0x8cff('0x1f')]=function(_0x5c886e){var _0x5b25dd=this;return new Promise(function(_0x5f0993,_0x5c9fcc){return db[_0x8cff('0x20')][_0x8cff('0x21')]({'raw':_0x5c886e[_0x8cff('0x18')]?_0x5c886e[_0x8cff('0x18')][_0x8cff('0x22')]===undefined?!![]:![]:!![],'where':_0x5c886e[_0x8cff('0x18')]?_0x5c886e[_0x8cff('0x18')][_0x8cff('0x19')]||null:null,'attributes':_0x5c886e[_0x8cff('0x18')]?_0x5c886e[_0x8cff('0x18')][_0x8cff('0x1a')]||null:null,'include':_0x5c886e[_0x8cff('0x18')]?_0x5c886e['options'][_0x8cff('0x1d')]?_[_0x8cff('0x1c')](_0x5c886e['options'][_0x8cff('0x1d')],function(_0x47c0a2){return{'model':db[_0x47c0a2[_0x8cff('0x1e')]],'as':_0x47c0a2['as'],'attributes':_0x47c0a2['attributes'],'include':_0x47c0a2[_0x8cff('0x1d')]?_[_0x8cff('0x1c')](_0x47c0a2[_0x8cff('0x1d')],function(_0xd5db22){return{'model':db[_0xd5db22[_0x8cff('0x1e')]],'as':_0xd5db22['as'],'attributes':_0xd5db22[_0x8cff('0x1a')],'include':_0xd5db22[_0x8cff('0x1d')]?_[_0x8cff('0x1c')](_0xd5db22['include'],function(_0x261626){return{'model':db[_0x261626['model']],'as':_0x261626['as'],'attributes':_0x261626['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd53d9f){logger[_0x8cff('0x23')](_0x8cff('0x1f'),_0x5c886e);logger[_0x8cff('0xe')]('ShowFreshdeskAccount',_0x5c886e,JSON[_0x8cff('0x10')](_0xd53d9f));_0x5f0993(_0xd53d9f);})['catch'](function(_0x3b3c94){logger[_0x8cff('0x11')](_0x8cff('0x1f'),_0x3b3c94[_0x8cff('0x13')],_0x5c886e);_0x5c9fcc(_0x5b25dd[_0x8cff('0x11')](0x1f4,_0x3b3c94[_0x8cff('0x13')]));});});}; \ No newline at end of file +var _0xd4d9=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','FreshdeskAccount,\x20%s,\x20%s','GetFreshdeskAccount','findAll','options','where','attributes','include','map','model','then','ShowFreshdeskAccount','FreshdeskAccount','find','raw'];(function(_0x550e5b,_0x3330d7){var _0x5b82e5=function(_0x51b126){while(--_0x51b126){_0x550e5b['push'](_0x550e5b['shift']());}};_0x5b82e5(++_0x3330d7);}(_0xd4d9,0xfd));var _0x9d4d=function(_0x3e4a34,_0x452723){_0x3e4a34=_0x3e4a34-0x0;var _0x2d2d2e=_0xd4d9[_0x3e4a34];return _0x2d2d2e;};'use strict';var _=require('lodash');var util=require(_0x9d4d('0x0'));var moment=require(_0x9d4d('0x1'));var BPromise=require(_0x9d4d('0x2'));var rs=require(_0x9d4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d4d('0x4'))['db'];var utils=require(_0x9d4d('0x5'));var logger=require(_0x9d4d('0x6'))(_0x9d4d('0x7'));var config=require(_0x9d4d('0x8'));var jayson=require(_0x9d4d('0x9'));var client=jayson[_0x9d4d('0xa')][_0x9d4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39ac97,_0x21c642,_0x1dbb09){return new BPromise(function(_0x461c70,_0x46cd9d){return client[_0x9d4d('0xc')](_0x39ac97,_0x1dbb09)['then'](function(_0x30885b){logger[_0x9d4d('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x21c642,_0x9d4d('0xe'));logger[_0x9d4d('0xf')](_0x9d4d('0x10'),_0x21c642,_0x9d4d('0xe'),JSON[_0x9d4d('0x11')](_0x30885b));if(_0x30885b['error']){if(_0x30885b['error'][_0x9d4d('0x12')]===0x1f4){logger[_0x9d4d('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x21c642,_0x30885b[_0x9d4d('0x13')]['message']);return _0x46cd9d(_0x30885b[_0x9d4d('0x13')][_0x9d4d('0x14')]);}logger[_0x9d4d('0x13')](_0x9d4d('0x15'),_0x21c642,_0x30885b[_0x9d4d('0x13')]['message']);return _0x461c70(_0x30885b['error']['message']);}else{logger[_0x9d4d('0xd')](_0x9d4d('0x15'),_0x21c642,_0x9d4d('0xe'));_0x461c70(_0x30885b['result'][_0x9d4d('0x14')]);}})['catch'](function(_0x3b8901){logger[_0x9d4d('0x13')](_0x9d4d('0x15'),_0x21c642,_0x3b8901);_0x46cd9d(_0x3b8901);});});}exports[_0x9d4d('0x16')]=function(_0x1abe8e){var _0x126dc1=this;return new Promise(function(_0x2390e4,_0xbf8b96){return db['FreshdeskAccount'][_0x9d4d('0x17')]({'raw':_0x1abe8e[_0x9d4d('0x18')]?_0x1abe8e['options']['raw']===undefined?!![]:![]:!![],'where':_0x1abe8e[_0x9d4d('0x18')]?_0x1abe8e[_0x9d4d('0x18')][_0x9d4d('0x19')]||null:null,'attributes':_0x1abe8e[_0x9d4d('0x18')]?_0x1abe8e[_0x9d4d('0x18')][_0x9d4d('0x1a')]||null:null,'limit':_0x1abe8e[_0x9d4d('0x18')]?_0x1abe8e[_0x9d4d('0x18')]['limit']||null:null,'include':_0x1abe8e[_0x9d4d('0x18')]?_0x1abe8e[_0x9d4d('0x18')][_0x9d4d('0x1b')]?_[_0x9d4d('0x1c')](_0x1abe8e[_0x9d4d('0x18')][_0x9d4d('0x1b')],function(_0x1836f3){return{'model':db[_0x1836f3[_0x9d4d('0x1d')]],'as':_0x1836f3['as'],'attributes':_0x1836f3[_0x9d4d('0x1a')],'include':_0x1836f3['include']?_[_0x9d4d('0x1c')](_0x1836f3[_0x9d4d('0x1b')],function(_0xf1c855){return{'model':db[_0xf1c855[_0x9d4d('0x1d')]],'as':_0xf1c855['as'],'attributes':_0xf1c855[_0x9d4d('0x1a')],'include':_0xf1c855['include']?_[_0x9d4d('0x1c')](_0xf1c855[_0x9d4d('0x1b')],function(_0x13d3a0){return{'model':db[_0x13d3a0[_0x9d4d('0x1d')]],'as':_0x13d3a0['as'],'attributes':_0x13d3a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d4d('0x1e')](function(_0x3808f4){logger[_0x9d4d('0xd')](_0x9d4d('0x16'),_0x1abe8e);logger[_0x9d4d('0xf')](_0x9d4d('0x16'),_0x1abe8e,JSON[_0x9d4d('0x11')](_0x3808f4));_0x2390e4(_0x3808f4);})['catch'](function(_0x3c5352){logger['error'](_0x9d4d('0x16'),_0x3c5352[_0x9d4d('0x14')],_0x1abe8e);_0xbf8b96(_0x126dc1[_0x9d4d('0x13')](0x1f4,_0x3c5352[_0x9d4d('0x14')]));});});};exports[_0x9d4d('0x1f')]=function(_0x5f5580){var _0x3ab586=this;return new Promise(function(_0x11e5e5,_0x179005){return db[_0x9d4d('0x20')][_0x9d4d('0x21')]({'raw':_0x5f5580[_0x9d4d('0x18')]?_0x5f5580[_0x9d4d('0x18')][_0x9d4d('0x22')]===undefined?!![]:![]:!![],'where':_0x5f5580[_0x9d4d('0x18')]?_0x5f5580[_0x9d4d('0x18')]['where']||null:null,'attributes':_0x5f5580[_0x9d4d('0x18')]?_0x5f5580[_0x9d4d('0x18')][_0x9d4d('0x1a')]||null:null,'include':_0x5f5580['options']?_0x5f5580[_0x9d4d('0x18')]['include']?_[_0x9d4d('0x1c')](_0x5f5580['options'][_0x9d4d('0x1b')],function(_0x41d5bc){return{'model':db[_0x41d5bc['model']],'as':_0x41d5bc['as'],'attributes':_0x41d5bc[_0x9d4d('0x1a')],'include':_0x41d5bc[_0x9d4d('0x1b')]?_['map'](_0x41d5bc[_0x9d4d('0x1b')],function(_0x196029){return{'model':db[_0x196029['model']],'as':_0x196029['as'],'attributes':_0x196029['attributes'],'include':_0x196029[_0x9d4d('0x1b')]?_['map'](_0x196029[_0x9d4d('0x1b')],function(_0x5aaa08){return{'model':db[_0x5aaa08['model']],'as':_0x5aaa08['as'],'attributes':_0x5aaa08[_0x9d4d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9d4d('0x1e')](function(_0xc80d3e){logger[_0x9d4d('0xd')]('ShowFreshdeskAccount',_0x5f5580);logger[_0x9d4d('0xf')](_0x9d4d('0x1f'),_0x5f5580,JSON[_0x9d4d('0x11')](_0xc80d3e));_0x11e5e5(_0xc80d3e);})[_0x9d4d('0x23')](function(_0x2fdef8){logger[_0x9d4d('0x13')](_0x9d4d('0x1f'),_0x2fdef8[_0x9d4d('0x14')],_0x5f5580);_0x179005(_0x3ab586[_0x9d4d('0x13')](0x1f4,_0x2fdef8[_0x9d4d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6bc53b3..c542ef6 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 _0x4bbf=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getDescriptions','/:id/tags','getTags','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x5bb331,_0x469ea0){var _0x209174=function(_0x3a8083){while(--_0x3a8083){_0x5bb331['push'](_0x5bb331['shift']());}};_0x209174(++_0x469ea0);}(_0x4bbf,0x196));var _0xf4bb=function(_0x2157b8,_0x11bfbd){_0x2157b8=_0x2157b8-0x0;var _0xf6d0e7=_0x4bbf[_0x2157b8];return _0xf6d0e7;};'use strict';var multer=require(_0xf4bb('0x0'));var util=require(_0xf4bb('0x1'));var path=require(_0xf4bb('0x2'));var timeout=require(_0xf4bb('0x3'));var express=require(_0xf4bb('0x4'));var router=express[_0xf4bb('0x5')]();var fs_extra=require(_0xf4bb('0x6'));var auth=require(_0xf4bb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf4bb('0x8'));var controller=require(_0xf4bb('0x9'));router[_0xf4bb('0xa')]('/',auth[_0xf4bb('0xb')](),controller[_0xf4bb('0xc')]);router['get'](_0xf4bb('0xd'),auth['isAuthenticated'](),controller[_0xf4bb('0xe')]);router[_0xf4bb('0xa')](_0xf4bb('0xf'),auth[_0xf4bb('0xb')](),controller[_0xf4bb('0x10')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf4bb('0x11')]);router['get'](_0xf4bb('0x12'),auth[_0xf4bb('0xb')](),controller[_0xf4bb('0x13')]);router[_0xf4bb('0x14')]('/',auth[_0xf4bb('0xb')](),controller[_0xf4bb('0x15')]);router[_0xf4bb('0x14')](_0xf4bb('0x12'),auth['isAuthenticated'](),controller['setTags']);router['put'](_0xf4bb('0xd'),auth[_0xf4bb('0xb')](),controller[_0xf4bb('0x16')]);router[_0xf4bb('0x17')](_0xf4bb('0xd'),auth[_0xf4bb('0xb')](),controller[_0xf4bb('0x18')]);module[_0xf4bb('0x19')]=router; \ No newline at end of file +var _0x598f=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','setTags','put','delete','destroy'];(function(_0x41f5ba,_0xd0ffa8){var _0x535e03=function(_0x7b8c37){while(--_0x7b8c37){_0x41f5ba['push'](_0x41f5ba['shift']());}};_0x535e03(++_0xd0ffa8);}(_0x598f,0x11f));var _0xf598=function(_0x2fff27,_0x5e1b40){_0x2fff27=_0x2fff27-0x0;var _0x14484c=_0x598f[_0x2fff27];return _0x14484c;};'use strict';var multer=require(_0xf598('0x0'));var util=require(_0xf598('0x1'));var path=require('path');var timeout=require(_0xf598('0x2'));var express=require(_0xf598('0x3'));var router=express['Router']();var fs_extra=require(_0xf598('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf598('0x5'));var config=require(_0xf598('0x6'));var controller=require(_0xf598('0x7'));router[_0xf598('0x8')]('/',auth['isAuthenticated'](),controller[_0xf598('0x9')]);router[_0xf598('0x8')](_0xf598('0xa'),auth[_0xf598('0xb')](),controller[_0xf598('0xc')]);router[_0xf598('0x8')](_0xf598('0xd'),auth[_0xf598('0xb')](),controller[_0xf598('0xe')]);router[_0xf598('0x8')]('/:id/subjects',auth[_0xf598('0xb')](),controller[_0xf598('0xf')]);router['get'](_0xf598('0x10'),auth[_0xf598('0xb')](),controller[_0xf598('0x11')]);router[_0xf598('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf598('0x12')]);router['post']('/',auth[_0xf598('0xb')](),controller[_0xf598('0x13')]);router[_0xf598('0x14')]('/:id/tags',auth[_0xf598('0xb')](),controller[_0xf598('0x15')]);router[_0xf598('0x16')]('/:id',auth[_0xf598('0xb')](),controller['update']);router[_0xf598('0x17')](_0xf598('0xa'),auth[_0xf598('0xb')](),controller[_0xf598('0x18')]);module[_0xf598('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index dddb1ae..60f87aa 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 _0x39e8=['STRING','exports'];(function(_0x52e11f,_0x1242fe){var _0x230e3f=function(_0x62c32e){while(--_0x62c32e){_0x52e11f['push'](_0x52e11f['shift']());}};_0x230e3f(++_0x1242fe);}(_0x39e8,0x139));var _0x839e=function(_0x22314c,_0x1e9e23){_0x22314c=_0x22314c-0x0;var _0x7339de=_0x39e8[_0x22314c];return _0x7339de;};'use strict';var Sequelize=require('sequelize');module[_0x839e('0x0')]={'name':{'type':Sequelize[_0x839e('0x1')]},'description':{'type':Sequelize[_0x839e('0x1')]}}; \ No newline at end of file +var _0x91c0=['exports','STRING','sequelize'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x91c0,0x137));var _0x091c=function(_0x13b026,_0x3d21c5){_0x13b026=_0x13b026-0x0;var _0x46c4e1=_0x91c0[_0x13b026];return _0x46c4e1;};'use strict';var Sequelize=require(_0x091c('0x0'));module[_0x091c('0x1')]={'name':{'type':Sequelize[_0x091c('0x2')]},'description':{'type':Sequelize[_0x091c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index dea9758..e5b0c40 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 _0xe840=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x51fbcb,_0x16d9e7){var _0x493f08=function(_0x413208){while(--_0x413208){_0x51fbcb['push'](_0x51fbcb['shift']());}};_0x493f08(++_0x16d9e7);}(_0xe840,0x1ee));var _0x0e84=function(_0xf07f51,_0x45e603){_0xf07f51=_0xf07f51-0x0;var _0x49829a=_0xe840[_0xf07f51];return _0x49829a;};'use strict';var emlformat=require(_0x0e84('0x0'));var rimraf=require(_0x0e84('0x1'));var zipdir=require(_0x0e84('0x2'));var jsonpatch=require(_0x0e84('0x3'));var rp=require(_0x0e84('0x4'));var moment=require(_0x0e84('0x5'));var BPromise=require(_0x0e84('0x6'));var Mustache=require('mustache');var util=require(_0x0e84('0x7'));var path=require('path');var sox=require(_0x0e84('0x8'));var csv=require(_0x0e84('0x9'));var ejs=require(_0x0e84('0xa'));var fs=require('fs');var fs_extra=require(_0x0e84('0xb'));var _=require(_0x0e84('0xc'));var squel=require('squel');var crypto=require(_0x0e84('0xd'));var jsforce=require(_0x0e84('0xe'));var deskjs=require(_0x0e84('0xf'));var toCsv=require(_0x0e84('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e84('0x10'));var as=require(_0x0e84('0x11'));var hardwareService=require(_0x0e84('0x12'));var logger=require(_0x0e84('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0e84('0x14'));var licenseUtil=require(_0x0e84('0x15'));var db=require(_0x0e84('0x16'))['db'];function respondWithStatusCode(_0x32d6d7,_0x596853){_0x596853=_0x596853||0xcc;return function(_0x4d863a){if(_0x4d863a){return _0x32d6d7[_0x0e84('0x17')](_0x596853);}return _0x32d6d7[_0x0e84('0x18')](_0x596853)[_0x0e84('0x19')]();};}function respondWithResult(_0x4fd251,_0x5a5c87){_0x5a5c87=_0x5a5c87||0xc8;return function(_0x5ce28d){if(_0x5ce28d){return _0x4fd251[_0x0e84('0x18')](_0x5a5c87)['json'](_0x5ce28d);}};}function respondWithFilteredResult(_0x19a64c,_0x1f3b48){return function(_0x49e79f){if(_0x49e79f){var _0x8a323f=typeof _0x1f3b48['offset']===_0x0e84('0x1a')&&typeof _0x1f3b48[_0x0e84('0x1b')]===_0x0e84('0x1a');var _0x4cba34=_0x49e79f['count'];var _0x410368=_0x8a323f?0x0:_0x1f3b48[_0x0e84('0x1c')];var _0xd2bb7c=_0x8a323f?_0x49e79f[_0x0e84('0x1d')]:_0x1f3b48['offset']+_0x1f3b48[_0x0e84('0x1b')];var _0x38379b;if(_0xd2bb7c>=_0x4cba34){_0xd2bb7c=_0x4cba34;_0x38379b=0xc8;}else{_0x38379b=0xce;}_0x19a64c['status'](_0x38379b);return _0x19a64c[_0x0e84('0x1e')](_0x0e84('0x1f'),_0x410368+'-'+_0xd2bb7c+'/'+_0x4cba34)[_0x0e84('0x20')](_0x49e79f);}return null;};}function patchUpdates(_0x30f9b2){return function(_0x5935fa){try{jsonpatch[_0x0e84('0x21')](_0x5935fa,_0x30f9b2,!![]);}catch(_0x20ba27){return BPromise[_0x0e84('0x22')](_0x20ba27);}return _0x5935fa[_0x0e84('0x23')]();};}function saveUpdates(_0x5473ed,_0x33494d){return function(_0x20d151){if(_0x20d151){return _0x20d151['update'](_0x5473ed)[_0x0e84('0x24')](function(_0x3cea3e){return _0x3cea3e;});}return null;};}function removeEntity(_0x102080,_0x39025c){return function(_0x88271f){if(_0x88271f){return _0x88271f['destroy']()[_0x0e84('0x24')](function(){_0x102080[_0x0e84('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf395,_0x515d98){return function(_0x42a258){if(!_0x42a258){_0x5bf395[_0x0e84('0x17')](0x194);}return _0x42a258;};}function handleError(_0x4d8e77,_0xccd7a4){_0xccd7a4=_0xccd7a4||0x1f4;return function(_0x57cf1a){logger['error'](_0x57cf1a[_0x0e84('0x25')]);if(_0x57cf1a[_0x0e84('0x26')]){delete _0x57cf1a[_0x0e84('0x26')];}_0x4d8e77[_0x0e84('0x18')](_0xccd7a4)[_0x0e84('0x27')](_0x57cf1a);};}exports[_0x0e84('0x28')]=function(_0x47e755,_0x2bad12){var _0x4ea691={},_0x2d9da6={},_0x3500dc={'count':0x0,'rows':[]};var _0x299b7d=_['map'](db[_0x0e84('0x29')][_0x0e84('0x2a')],function(_0x84283b){return{'name':_0x84283b[_0x0e84('0x2b')],'type':_0x84283b['type'][_0x0e84('0x2c')]};});_0x2d9da6['model']=_['map'](_0x299b7d,_0x0e84('0x26'));_0x2d9da6[_0x0e84('0x2d')]=_['keys'](_0x47e755[_0x0e84('0x2d')]);_0x2d9da6[_0x0e84('0x2e')]=_[_0x0e84('0x2f')](_0x2d9da6[_0x0e84('0x30')],_0x2d9da6['query']);_0x4ea691['attributes']=_[_0x0e84('0x2f')](_0x2d9da6[_0x0e84('0x30')],qs['fields'](_0x47e755[_0x0e84('0x2d')][_0x0e84('0x31')]));_0x4ea691[_0x0e84('0x32')]=_0x4ea691[_0x0e84('0x32')][_0x0e84('0x33')]?_0x4ea691[_0x0e84('0x32')]:_0x2d9da6[_0x0e84('0x30')];if(!_0x47e755['query']['hasOwnProperty'](_0x0e84('0x34'))){_0x4ea691[_0x0e84('0x1b')]=qs[_0x0e84('0x1b')](_0x47e755['query'][_0x0e84('0x1b')]);_0x4ea691[_0x0e84('0x1c')]=qs[_0x0e84('0x1c')](_0x47e755[_0x0e84('0x2d')][_0x0e84('0x1c')]);}_0x4ea691[_0x0e84('0x35')]=qs['sort'](_0x47e755[_0x0e84('0x2d')][_0x0e84('0x36')]);_0x4ea691[_0x0e84('0x37')]=qs[_0x0e84('0x2e')](_[_0x0e84('0x38')](_0x47e755['query'],_0x2d9da6[_0x0e84('0x2e')]),_0x299b7d);if(_0x47e755[_0x0e84('0x2d')]['filter']){_0x4ea691[_0x0e84('0x37')]=_[_0x0e84('0x39')](_0x4ea691[_0x0e84('0x37')],{'$or':_[_0x0e84('0x3a')](_0x299b7d,function(_0x58f5c0){if(_0x58f5c0[_0x0e84('0x3b')]!==_0x0e84('0x3c')){var _0x3bfb00={};_0x3bfb00[_0x58f5c0[_0x0e84('0x26')]]={'$like':'%'+_0x47e755[_0x0e84('0x2d')][_0x0e84('0x3d')]+'%'};return _0x3bfb00;}})});}_0x4ea691=_[_0x0e84('0x39')]({},_0x4ea691,_0x47e755['options']);var _0x34b453={'where':_0x4ea691[_0x0e84('0x37')]};return db['FreshdeskConfiguration'][_0x0e84('0x1d')](_0x34b453)[_0x0e84('0x24')](function(_0x1251b6){_0x3500dc[_0x0e84('0x1d')]=_0x1251b6;if(_0x47e755[_0x0e84('0x2d')][_0x0e84('0x3e')]){_0x4ea691[_0x0e84('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x0e84('0x40')](_0x4ea691);})[_0x0e84('0x24')](function(_0x2caa6f){_0x3500dc['rows']=_0x2caa6f;return _0x3500dc;})[_0x0e84('0x24')](respondWithFilteredResult(_0x2bad12,_0x4ea691))[_0x0e84('0x41')](handleError(_0x2bad12,null));};exports[_0x0e84('0x42')]=function(_0x243c47,_0x470d29){var _0xed8f43={'raw':![],'where':{'id':_0x243c47[_0x0e84('0x43')]['id']}},_0x48c6c9={};_0x48c6c9['model']=_[_0x0e84('0x44')](db[_0x0e84('0x29')][_0x0e84('0x2a')]);_0x48c6c9[_0x0e84('0x2d')]=_['keys'](_0x243c47['query']);_0x48c6c9['filters']=_[_0x0e84('0x2f')](_0x48c6c9[_0x0e84('0x30')],_0x48c6c9[_0x0e84('0x2d')]);_0xed8f43[_0x0e84('0x32')]=_[_0x0e84('0x2f')](_0x48c6c9[_0x0e84('0x30')],qs[_0x0e84('0x31')](_0x243c47[_0x0e84('0x2d')][_0x0e84('0x31')]));_0xed8f43[_0x0e84('0x32')]=_0xed8f43['attributes']['length']?_0xed8f43[_0x0e84('0x32')]:_0x48c6c9[_0x0e84('0x30')];if(_0x243c47['query'][_0x0e84('0x3e')]){_0xed8f43[_0x0e84('0x3f')]=[{'all':!![]}];}_0xed8f43=_[_0x0e84('0x39')]({},_0xed8f43,_0x243c47[_0x0e84('0x45')]);return db[_0x0e84('0x29')][_0x0e84('0x46')](_0xed8f43)[_0x0e84('0x24')](handleEntityNotFound(_0x470d29,null))[_0x0e84('0x24')](respondWithResult(_0x470d29,null))[_0x0e84('0x41')](handleError(_0x470d29,null));};exports[_0x0e84('0x47')]=function(_0x4125af,_0x561738){return db['FreshdeskConfiguration'][_0x0e84('0x47')](_0x4125af[_0x0e84('0x48')],{})[_0x0e84('0x24')](respondWithResult(_0x561738,0xc9))[_0x0e84('0x41')](handleError(_0x561738,null));};exports['update']=function(_0x3d6e55,_0x1e1035){if(_0x3d6e55['body']['id']){delete _0x3d6e55[_0x0e84('0x48')]['id'];}return db[_0x0e84('0x29')][_0x0e84('0x46')]({'where':{'id':_0x3d6e55[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x1e1035,null))['then'](saveUpdates(_0x3d6e55[_0x0e84('0x48')],null))[_0x0e84('0x24')](respondWithResult(_0x1e1035,null))[_0x0e84('0x41')](handleError(_0x1e1035,null));};exports[_0x0e84('0x49')]=function(_0x357bc9,_0x3775d8){return db[_0x0e84('0x29')]['find']({'where':{'id':_0x357bc9[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x3775d8,null))[_0x0e84('0x24')](removeEntity(_0x3775d8,null))['catch'](handleError(_0x3775d8,null));};exports[_0x0e84('0x4a')]=function(_0x1f4ca4,_0x3c8ca9,_0x1e1456){var _0x14c48b={};var _0x47b78f={};var _0x4054f1;var _0x234e7e;return db[_0x0e84('0x29')][_0x0e84('0x4b')]({'where':{'id':_0x1f4ca4[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x3c8ca9,null))[_0x0e84('0x24')](function(_0x387eef){if(_0x387eef){_0x4054f1=_0x387eef;_0x47b78f['model']=_[_0x0e84('0x44')](db[_0x0e84('0x4c')][_0x0e84('0x2a')]);_0x47b78f[_0x0e84('0x2d')]=_['keys'](_0x1f4ca4[_0x0e84('0x2d')]);_0x47b78f[_0x0e84('0x2e')]=_[_0x0e84('0x2f')](_0x47b78f[_0x0e84('0x30')],_0x47b78f[_0x0e84('0x2d')]);_0x14c48b[_0x0e84('0x32')]=_[_0x0e84('0x2f')](_0x47b78f[_0x0e84('0x30')],qs[_0x0e84('0x31')](_0x1f4ca4['query'][_0x0e84('0x31')]));_0x14c48b[_0x0e84('0x32')]=_0x14c48b[_0x0e84('0x32')][_0x0e84('0x33')]?_0x14c48b[_0x0e84('0x32')]:_0x47b78f[_0x0e84('0x30')];_0x14c48b[_0x0e84('0x35')]=qs[_0x0e84('0x36')](_0x1f4ca4[_0x0e84('0x2d')][_0x0e84('0x36')]);_0x14c48b[_0x0e84('0x37')]=qs['filters'](_[_0x0e84('0x38')](_0x1f4ca4[_0x0e84('0x2d')],_0x47b78f['filters']));if(_0x1f4ca4[_0x0e84('0x2d')][_0x0e84('0x3d')]){_0x14c48b['where']=_[_0x0e84('0x39')](_0x14c48b[_0x0e84('0x37')],{'$or':_[_0x0e84('0x3a')](_0x14c48b[_0x0e84('0x32')],function(_0x23eb10){var _0x4544da={};_0x4544da[_0x23eb10]={'$like':'%'+_0x1f4ca4['query']['filter']+'%'};return _0x4544da;})});}_0x14c48b=_[_0x0e84('0x39')]({},_0x14c48b,_0x1f4ca4[_0x0e84('0x45')]);return _0x4054f1[_0x0e84('0x4a')](_0x14c48b);}})['then'](function(_0x3457ec){if(_0x3457ec){_0x234e7e=_0x3457ec[_0x0e84('0x33')];if(!_0x1f4ca4[_0x0e84('0x2d')][_0x0e84('0x4d')](_0x0e84('0x34'))){_0x14c48b['limit']=qs[_0x0e84('0x1b')](_0x1f4ca4[_0x0e84('0x2d')][_0x0e84('0x1b')]);_0x14c48b[_0x0e84('0x1c')]=qs[_0x0e84('0x1c')](_0x1f4ca4[_0x0e84('0x2d')]['offset']);}return _0x4054f1[_0x0e84('0x4a')](_0x14c48b);}})[_0x0e84('0x24')](function(_0x17600e){if(_0x17600e){return _0x17600e?{'count':_0x234e7e,'rows':_0x17600e}:null;}})[_0x0e84('0x24')](respondWithResult(_0x3c8ca9,null))['catch'](handleError(_0x3c8ca9,null));};exports[_0x0e84('0x4e')]=function(_0x45922a,_0x4df740,_0x3b85da){var _0x2bee2b={};var _0x15375b={};var _0x3a6223;var _0x12a341;return db[_0x0e84('0x29')][_0x0e84('0x4b')]({'where':{'id':_0x45922a[_0x0e84('0x43')]['id']}})['then'](handleEntityNotFound(_0x4df740,null))[_0x0e84('0x24')](function(_0x2ac3d9){if(_0x2ac3d9){_0x3a6223=_0x2ac3d9;_0x15375b[_0x0e84('0x30')]=_[_0x0e84('0x44')](db['FreshdeskField']['rawAttributes']);_0x15375b[_0x0e84('0x2d')]=_[_0x0e84('0x44')](_0x45922a['query']);_0x15375b[_0x0e84('0x2e')]=_[_0x0e84('0x2f')](_0x15375b['model'],_0x15375b['query']);_0x2bee2b[_0x0e84('0x32')]=_[_0x0e84('0x2f')](_0x15375b[_0x0e84('0x30')],qs[_0x0e84('0x31')](_0x45922a['query'][_0x0e84('0x31')]));_0x2bee2b['attributes']=_0x2bee2b['attributes'][_0x0e84('0x33')]?_0x2bee2b[_0x0e84('0x32')]:_0x15375b[_0x0e84('0x30')];_0x2bee2b[_0x0e84('0x35')]=qs[_0x0e84('0x36')](_0x45922a[_0x0e84('0x2d')][_0x0e84('0x36')]);_0x2bee2b[_0x0e84('0x37')]=qs[_0x0e84('0x2e')](_['pick'](_0x45922a['query'],_0x15375b[_0x0e84('0x2e')]));if(_0x45922a[_0x0e84('0x2d')][_0x0e84('0x3d')]){_0x2bee2b[_0x0e84('0x37')]=_[_0x0e84('0x39')](_0x2bee2b['where'],{'$or':_[_0x0e84('0x3a')](_0x2bee2b[_0x0e84('0x32')],function(_0x158160){var _0xdb7f17={};_0xdb7f17[_0x158160]={'$like':'%'+_0x45922a[_0x0e84('0x2d')][_0x0e84('0x3d')]+'%'};return _0xdb7f17;})});}_0x2bee2b=_[_0x0e84('0x39')]({},_0x2bee2b,_0x45922a[_0x0e84('0x45')]);return _0x3a6223[_0x0e84('0x4e')](_0x2bee2b);}})['then'](function(_0x432ed7){if(_0x432ed7){_0x12a341=_0x432ed7[_0x0e84('0x33')];if(!_0x45922a['query'][_0x0e84('0x4d')](_0x0e84('0x34'))){_0x2bee2b[_0x0e84('0x1b')]=qs[_0x0e84('0x1b')](_0x45922a[_0x0e84('0x2d')][_0x0e84('0x1b')]);_0x2bee2b['offset']=qs[_0x0e84('0x1c')](_0x45922a[_0x0e84('0x2d')][_0x0e84('0x1c')]);}return _0x3a6223[_0x0e84('0x4e')](_0x2bee2b);}})[_0x0e84('0x24')](function(_0x1d4d5f){if(_0x1d4d5f){return _0x1d4d5f?{'count':_0x12a341,'rows':_0x1d4d5f}:null;}})[_0x0e84('0x24')](respondWithResult(_0x4df740,null))[_0x0e84('0x41')](handleError(_0x4df740,null));};exports[_0x0e84('0x4f')]=function(_0x551b3f,_0x84cf8a,_0x405b2d){var _0x552d18={};var _0x5ef272={};var _0x41ad90;var _0x9f18b3;return db['FreshdeskConfiguration'][_0x0e84('0x4b')]({'where':{'id':_0x551b3f[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x84cf8a,null))[_0x0e84('0x24')](function(_0x2e4ff0){if(_0x2e4ff0){_0x41ad90=_0x2e4ff0;_0x5ef272['model']=_[_0x0e84('0x44')](db[_0x0e84('0x4c')][_0x0e84('0x2a')]);_0x5ef272[_0x0e84('0x2d')]=_[_0x0e84('0x44')](_0x551b3f[_0x0e84('0x2d')]);_0x5ef272[_0x0e84('0x2e')]=_[_0x0e84('0x2f')](_0x5ef272[_0x0e84('0x30')],_0x5ef272[_0x0e84('0x2d')]);_0x552d18[_0x0e84('0x32')]=_[_0x0e84('0x2f')](_0x5ef272[_0x0e84('0x30')],qs[_0x0e84('0x31')](_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x31')]));_0x552d18['attributes']=_0x552d18[_0x0e84('0x32')][_0x0e84('0x33')]?_0x552d18[_0x0e84('0x32')]:_0x5ef272[_0x0e84('0x30')];_0x552d18['order']=qs[_0x0e84('0x36')](_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x36')]);_0x552d18[_0x0e84('0x37')]=qs[_0x0e84('0x2e')](_[_0x0e84('0x38')](_0x551b3f[_0x0e84('0x2d')],_0x5ef272[_0x0e84('0x2e')]));if(_0x551b3f['query'][_0x0e84('0x3d')]){_0x552d18['where']=_[_0x0e84('0x39')](_0x552d18[_0x0e84('0x37')],{'$or':_[_0x0e84('0x3a')](_0x552d18[_0x0e84('0x32')],function(_0x549559){var _0x23391b={};_0x23391b[_0x549559]={'$like':'%'+_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x3d')]+'%'};return _0x23391b;})});}_0x552d18=_[_0x0e84('0x39')]({},_0x552d18,_0x551b3f[_0x0e84('0x45')]);return _0x41ad90[_0x0e84('0x4f')](_0x552d18);}})[_0x0e84('0x24')](function(_0x1cdb57){if(_0x1cdb57){_0x9f18b3=_0x1cdb57[_0x0e84('0x33')];if(!_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x4d')](_0x0e84('0x34'))){_0x552d18[_0x0e84('0x1b')]=qs[_0x0e84('0x1b')](_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x1b')]);_0x552d18[_0x0e84('0x1c')]=qs['offset'](_0x551b3f[_0x0e84('0x2d')][_0x0e84('0x1c')]);}return _0x41ad90['getDescriptions'](_0x552d18);}})[_0x0e84('0x24')](function(_0x50ae2b){if(_0x50ae2b){return _0x50ae2b?{'count':_0x9f18b3,'rows':_0x50ae2b}:null;}})[_0x0e84('0x24')](respondWithResult(_0x84cf8a,null))[_0x0e84('0x41')](handleError(_0x84cf8a,null));};exports[_0x0e84('0x50')]=function(_0x2579a5,_0x29a6e8,_0x2ea00a){var _0x66ec4f={};var _0x5677d7={};var _0x16ebe;var _0x136d1d;return db['FreshdeskConfiguration'][_0x0e84('0x4b')]({'where':{'id':_0x2579a5[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x29a6e8,null))['then'](function(_0x1b4169){if(_0x1b4169){_0x16ebe=_0x1b4169;_0x5677d7[_0x0e84('0x30')]=_[_0x0e84('0x44')](db[_0x0e84('0x51')][_0x0e84('0x2a')]);_0x5677d7['query']=_[_0x0e84('0x44')](_0x2579a5[_0x0e84('0x2d')]);_0x5677d7[_0x0e84('0x2e')]=_['intersection'](_0x5677d7[_0x0e84('0x30')],_0x5677d7['query']);_0x66ec4f[_0x0e84('0x32')]=_[_0x0e84('0x2f')](_0x5677d7[_0x0e84('0x30')],qs[_0x0e84('0x31')](_0x2579a5[_0x0e84('0x2d')]['fields']));_0x66ec4f[_0x0e84('0x32')]=_0x66ec4f['attributes'][_0x0e84('0x33')]?_0x66ec4f['attributes']:_0x5677d7['model'];_0x66ec4f['order']=qs['sort'](_0x2579a5['query'][_0x0e84('0x36')]);_0x66ec4f[_0x0e84('0x37')]=qs[_0x0e84('0x2e')](_[_0x0e84('0x38')](_0x2579a5[_0x0e84('0x2d')],_0x5677d7[_0x0e84('0x2e')]));if(_0x2579a5[_0x0e84('0x2d')][_0x0e84('0x3d')]){_0x66ec4f[_0x0e84('0x37')]=_['merge'](_0x66ec4f[_0x0e84('0x37')],{'$or':_[_0x0e84('0x3a')](_0x66ec4f[_0x0e84('0x32')],function(_0x4c05ae){var _0x17a1f4={};_0x17a1f4[_0x4c05ae]={'$like':'%'+_0x2579a5[_0x0e84('0x2d')][_0x0e84('0x3d')]+'%'};return _0x17a1f4;})});}_0x66ec4f=_[_0x0e84('0x39')]({},_0x66ec4f,_0x2579a5[_0x0e84('0x45')]);return _0x16ebe[_0x0e84('0x50')](_0x66ec4f);}})[_0x0e84('0x24')](function(_0x16e895){if(_0x16e895){_0x136d1d=_0x16e895[_0x0e84('0x33')];if(!_0x2579a5[_0x0e84('0x2d')][_0x0e84('0x4d')](_0x0e84('0x34'))){_0x66ec4f[_0x0e84('0x1b')]=qs['limit'](_0x2579a5[_0x0e84('0x2d')][_0x0e84('0x1b')]);_0x66ec4f[_0x0e84('0x1c')]=qs[_0x0e84('0x1c')](_0x2579a5['query'][_0x0e84('0x1c')]);}return _0x16ebe[_0x0e84('0x50')](_0x66ec4f);}})[_0x0e84('0x24')](function(_0x29781f){if(_0x29781f){return _0x29781f?{'count':_0x136d1d,'rows':_0x29781f}:null;}})[_0x0e84('0x24')](respondWithResult(_0x29a6e8,null))[_0x0e84('0x41')](handleError(_0x29a6e8,null));};exports['setTags']=function(_0x30660a,_0x4d7c26,_0xcd2751){if(_0x30660a[_0x0e84('0x48')]['id']){delete _0x30660a[_0x0e84('0x48')]['id'];}return db[_0x0e84('0x29')]['findOne']({'where':{'id':_0x30660a[_0x0e84('0x43')]['id']}})[_0x0e84('0x24')](handleEntityNotFound(_0x4d7c26,null))[_0x0e84('0x24')](function(_0xfe912c){if(_0xfe912c){return _0xfe912c[_0x0e84('0x52')](_0x30660a[_0x0e84('0x48')][_0x0e84('0x53')]||[]);}return null;})['then'](respondWithResult(_0x4d7c26,null))['catch'](handleError(_0x4d7c26,null));}; \ No newline at end of file +var _0xb9b3=['reject','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','find','body','catch','params','FreshdeskField','order','filter','getFields','findOne','getSubjects','options','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x274775,_0x123a4f){var _0x4e9c26=function(_0x5bca15){while(--_0x5bca15){_0x274775['push'](_0x274775['shift']());}};_0x4e9c26(++_0x123a4f);}(_0xb9b3,0xd5));var _0x3b9b=function(_0x312650,_0x2d24b4){_0x312650=_0x312650-0x0;var _0x5f19c6=_0xb9b3[_0x312650];return _0x5f19c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b9b('0x0'));var zipdir=require(_0x3b9b('0x1'));var jsonpatch=require(_0x3b9b('0x2'));var rp=require(_0x3b9b('0x3'));var moment=require(_0x3b9b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b9b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3b9b('0x6'));var csv=require(_0x3b9b('0x7'));var ejs=require(_0x3b9b('0x8'));var fs=require('fs');var fs_extra=require(_0x3b9b('0x9'));var _=require('lodash');var squel=require(_0x3b9b('0xa'));var crypto=require(_0x3b9b('0xb'));var jsforce=require(_0x3b9b('0xc'));var deskjs=require(_0x3b9b('0xd'));var toCsv=require(_0x3b9b('0x7'));var querystring=require('querystring');var Papa=require(_0x3b9b('0xe'));var Redis=require(_0x3b9b('0xf'));var authService=require(_0x3b9b('0x10'));var qs=require(_0x3b9b('0x11'));var as=require(_0x3b9b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b9b('0x13'))('api');var utils=require(_0x3b9b('0x14'));var config=require(_0x3b9b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b9b('0x16'))['db'];function respondWithStatusCode(_0x2ea0ee,_0x3d559a){_0x3d559a=_0x3d559a||0xcc;return function(_0x331955){if(_0x331955){return _0x2ea0ee[_0x3b9b('0x17')](_0x3d559a);}return _0x2ea0ee[_0x3b9b('0x18')](_0x3d559a)['end']();};}function respondWithResult(_0x43ce52,_0x14a147){_0x14a147=_0x14a147||0xc8;return function(_0x345554){if(_0x345554){return _0x43ce52[_0x3b9b('0x18')](_0x14a147)[_0x3b9b('0x19')](_0x345554);}};}function respondWithFilteredResult(_0x159600,_0x31409a){return function(_0x9944bc){if(_0x9944bc){var _0x1f5011=typeof _0x31409a[_0x3b9b('0x1a')]===_0x3b9b('0x1b')&&typeof _0x31409a['limit']==='undefined';var _0xc741d3=_0x9944bc[_0x3b9b('0x1c')];var _0x2e1739=_0x1f5011?0x0:_0x31409a['offset'];var _0x51e734=_0x1f5011?_0x9944bc[_0x3b9b('0x1c')]:_0x31409a[_0x3b9b('0x1a')]+_0x31409a[_0x3b9b('0x1d')];var _0x3757f3;if(_0x51e734>=_0xc741d3){_0x51e734=_0xc741d3;_0x3757f3=0xc8;}else{_0x3757f3=0xce;}_0x159600[_0x3b9b('0x18')](_0x3757f3);return _0x159600['set']('Content-Range',_0x2e1739+'-'+_0x51e734+'/'+_0xc741d3)[_0x3b9b('0x19')](_0x9944bc);}return null;};}function patchUpdates(_0x2984c7){return function(_0x357b3d){try{jsonpatch['apply'](_0x357b3d,_0x2984c7,!![]);}catch(_0x46d345){return BPromise[_0x3b9b('0x1e')](_0x46d345);}return _0x357b3d[_0x3b9b('0x1f')]();};}function saveUpdates(_0x2695f9,_0x1bb27f){return function(_0x440610){if(_0x440610){return _0x440610[_0x3b9b('0x20')](_0x2695f9)[_0x3b9b('0x21')](function(_0x229edb){return _0x229edb;});}return null;};}function removeEntity(_0x37a81b,_0xa9b0e7){return function(_0xa9bd8f){if(_0xa9bd8f){return _0xa9bd8f[_0x3b9b('0x22')]()[_0x3b9b('0x21')](function(){_0x37a81b[_0x3b9b('0x18')](0xcc)[_0x3b9b('0x23')]();});}};}function handleEntityNotFound(_0x38f909,_0x2ea407){return function(_0x3d403a){if(!_0x3d403a){_0x38f909[_0x3b9b('0x17')](0x194);}return _0x3d403a;};}function handleError(_0x35caec,_0x2e3151){_0x2e3151=_0x2e3151||0x1f4;return function(_0x35618d){logger[_0x3b9b('0x24')](_0x35618d[_0x3b9b('0x25')]);if(_0x35618d[_0x3b9b('0x26')]){delete _0x35618d[_0x3b9b('0x26')];}_0x35caec['status'](_0x2e3151)['send'](_0x35618d);};}exports[_0x3b9b('0x27')]=function(_0x50261e,_0x24d9bf){var _0x2b37ca={},_0x392400={},_0x69a9d7={'count':0x0,'rows':[]};var _0x45cdb7=_[_0x3b9b('0x28')](db[_0x3b9b('0x29')][_0x3b9b('0x2a')],function(_0x22c02d){return{'name':_0x22c02d[_0x3b9b('0x2b')],'type':_0x22c02d[_0x3b9b('0x2c')][_0x3b9b('0x2d')]};});_0x392400[_0x3b9b('0x2e')]=_[_0x3b9b('0x28')](_0x45cdb7,'name');_0x392400['query']=_[_0x3b9b('0x2f')](_0x50261e[_0x3b9b('0x30')]);_0x392400[_0x3b9b('0x31')]=_[_0x3b9b('0x32')](_0x392400[_0x3b9b('0x2e')],_0x392400[_0x3b9b('0x30')]);_0x2b37ca[_0x3b9b('0x33')]=_[_0x3b9b('0x32')](_0x392400[_0x3b9b('0x2e')],qs[_0x3b9b('0x34')](_0x50261e[_0x3b9b('0x30')][_0x3b9b('0x34')]));_0x2b37ca[_0x3b9b('0x33')]=_0x2b37ca[_0x3b9b('0x33')][_0x3b9b('0x35')]?_0x2b37ca[_0x3b9b('0x33')]:_0x392400[_0x3b9b('0x2e')];if(!_0x50261e[_0x3b9b('0x30')][_0x3b9b('0x36')](_0x3b9b('0x37'))){_0x2b37ca[_0x3b9b('0x1d')]=qs[_0x3b9b('0x1d')](_0x50261e['query'][_0x3b9b('0x1d')]);_0x2b37ca[_0x3b9b('0x1a')]=qs['offset'](_0x50261e['query']['offset']);}_0x2b37ca['order']=qs[_0x3b9b('0x38')](_0x50261e[_0x3b9b('0x30')]['sort']);_0x2b37ca['where']=qs[_0x3b9b('0x31')](_[_0x3b9b('0x39')](_0x50261e[_0x3b9b('0x30')],_0x392400[_0x3b9b('0x31')]),_0x45cdb7);if(_0x50261e[_0x3b9b('0x30')]['filter']){_0x2b37ca[_0x3b9b('0x3a')]=_[_0x3b9b('0x3b')](_0x2b37ca['where'],{'$or':_['map'](_0x45cdb7,function(_0x1bebe7){if(_0x1bebe7[_0x3b9b('0x2c')]!==_0x3b9b('0x3c')){var _0x55e13f={};_0x55e13f[_0x1bebe7[_0x3b9b('0x26')]]={'$like':'%'+_0x50261e['query']['filter']+'%'};return _0x55e13f;}})});}_0x2b37ca=_['merge']({},_0x2b37ca,_0x50261e['options']);var _0x406e63={'where':_0x2b37ca[_0x3b9b('0x3a')]};return db[_0x3b9b('0x29')][_0x3b9b('0x1c')](_0x406e63)[_0x3b9b('0x21')](function(_0x207d5b){_0x69a9d7[_0x3b9b('0x1c')]=_0x207d5b;if(_0x50261e[_0x3b9b('0x30')][_0x3b9b('0x3d')]){_0x2b37ca[_0x3b9b('0x3e')]=[{'all':!![]}];}return db[_0x3b9b('0x29')][_0x3b9b('0x3f')](_0x2b37ca);})[_0x3b9b('0x21')](function(_0x11f2b8){_0x69a9d7[_0x3b9b('0x40')]=_0x11f2b8;return _0x69a9d7;})[_0x3b9b('0x21')](respondWithFilteredResult(_0x24d9bf,_0x2b37ca))['catch'](handleError(_0x24d9bf,null));};exports['show']=function(_0x45df74,_0x19bacd){var _0xf030e3={'raw':![],'where':{'id':_0x45df74['params']['id']}},_0x3c8908={};_0x3c8908['model']=_[_0x3b9b('0x2f')](db[_0x3b9b('0x29')][_0x3b9b('0x2a')]);_0x3c8908[_0x3b9b('0x30')]=_['keys'](_0x45df74[_0x3b9b('0x30')]);_0x3c8908[_0x3b9b('0x31')]=_['intersection'](_0x3c8908[_0x3b9b('0x2e')],_0x3c8908['query']);_0xf030e3[_0x3b9b('0x33')]=_[_0x3b9b('0x32')](_0x3c8908[_0x3b9b('0x2e')],qs[_0x3b9b('0x34')](_0x45df74[_0x3b9b('0x30')][_0x3b9b('0x34')]));_0xf030e3[_0x3b9b('0x33')]=_0xf030e3['attributes'][_0x3b9b('0x35')]?_0xf030e3[_0x3b9b('0x33')]:_0x3c8908[_0x3b9b('0x2e')];if(_0x45df74[_0x3b9b('0x30')][_0x3b9b('0x3d')]){_0xf030e3[_0x3b9b('0x3e')]=[{'all':!![]}];}_0xf030e3=_[_0x3b9b('0x3b')]({},_0xf030e3,_0x45df74['options']);return db[_0x3b9b('0x29')][_0x3b9b('0x41')](_0xf030e3)[_0x3b9b('0x21')](handleEntityNotFound(_0x19bacd,null))[_0x3b9b('0x21')](respondWithResult(_0x19bacd,null))['catch'](handleError(_0x19bacd,null));};exports['create']=function(_0x24f7ff,_0x5b3f8b){return db['FreshdeskConfiguration']['create'](_0x24f7ff[_0x3b9b('0x42')],{})[_0x3b9b('0x21')](respondWithResult(_0x5b3f8b,0xc9))[_0x3b9b('0x43')](handleError(_0x5b3f8b,null));};exports['update']=function(_0x7625fa,_0x338b4b){if(_0x7625fa[_0x3b9b('0x42')]['id']){delete _0x7625fa[_0x3b9b('0x42')]['id'];}return db['FreshdeskConfiguration'][_0x3b9b('0x41')]({'where':{'id':_0x7625fa['params']['id']}})[_0x3b9b('0x21')](handleEntityNotFound(_0x338b4b,null))[_0x3b9b('0x21')](saveUpdates(_0x7625fa[_0x3b9b('0x42')],null))['then'](respondWithResult(_0x338b4b,null))[_0x3b9b('0x43')](handleError(_0x338b4b,null));};exports[_0x3b9b('0x22')]=function(_0xbcbc09,_0x55c1c1){return db['FreshdeskConfiguration']['find']({'where':{'id':_0xbcbc09[_0x3b9b('0x44')]['id']}})[_0x3b9b('0x21')](handleEntityNotFound(_0x55c1c1,null))[_0x3b9b('0x21')](removeEntity(_0x55c1c1,null))[_0x3b9b('0x43')](handleError(_0x55c1c1,null));};exports['getFields']=function(_0x5e7119,_0x1e18bf,_0x1ab8b8){var _0x4975b7={};var _0x14271a={};var _0x3bdbd2;var _0x4132dc;return db[_0x3b9b('0x29')]['findOne']({'where':{'id':_0x5e7119[_0x3b9b('0x44')]['id']}})[_0x3b9b('0x21')](handleEntityNotFound(_0x1e18bf,null))[_0x3b9b('0x21')](function(_0x46deba){if(_0x46deba){_0x3bdbd2=_0x46deba;_0x14271a[_0x3b9b('0x2e')]=_['keys'](db[_0x3b9b('0x45')][_0x3b9b('0x2a')]);_0x14271a[_0x3b9b('0x30')]=_[_0x3b9b('0x2f')](_0x5e7119[_0x3b9b('0x30')]);_0x14271a[_0x3b9b('0x31')]=_[_0x3b9b('0x32')](_0x14271a[_0x3b9b('0x2e')],_0x14271a['query']);_0x4975b7['attributes']=_[_0x3b9b('0x32')](_0x14271a['model'],qs['fields'](_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x34')]));_0x4975b7[_0x3b9b('0x33')]=_0x4975b7[_0x3b9b('0x33')][_0x3b9b('0x35')]?_0x4975b7['attributes']:_0x14271a['model'];_0x4975b7[_0x3b9b('0x46')]=qs[_0x3b9b('0x38')](_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x38')]);_0x4975b7[_0x3b9b('0x3a')]=qs[_0x3b9b('0x31')](_['pick'](_0x5e7119[_0x3b9b('0x30')],_0x14271a[_0x3b9b('0x31')]));if(_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x47')]){_0x4975b7['where']=_[_0x3b9b('0x3b')](_0x4975b7[_0x3b9b('0x3a')],{'$or':_[_0x3b9b('0x28')](_0x4975b7[_0x3b9b('0x33')],function(_0x264f43){var _0x1bcc5e={};_0x1bcc5e[_0x264f43]={'$like':'%'+_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x47')]+'%'};return _0x1bcc5e;})});}_0x4975b7=_[_0x3b9b('0x3b')]({},_0x4975b7,_0x5e7119['options']);return _0x3bdbd2[_0x3b9b('0x48')](_0x4975b7);}})[_0x3b9b('0x21')](function(_0x48a370){if(_0x48a370){_0x4132dc=_0x48a370[_0x3b9b('0x35')];if(!_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x36')]('nolimit')){_0x4975b7['limit']=qs[_0x3b9b('0x1d')](_0x5e7119[_0x3b9b('0x30')]['limit']);_0x4975b7['offset']=qs[_0x3b9b('0x1a')](_0x5e7119[_0x3b9b('0x30')][_0x3b9b('0x1a')]);}return _0x3bdbd2[_0x3b9b('0x48')](_0x4975b7);}})['then'](function(_0xbc221){if(_0xbc221){return _0xbc221?{'count':_0x4132dc,'rows':_0xbc221}:null;}})[_0x3b9b('0x21')](respondWithResult(_0x1e18bf,null))['catch'](handleError(_0x1e18bf,null));};exports['getSubjects']=function(_0x53519d,_0x2d81c6,_0x565a82){var _0x3ef7c6={};var _0x438f7a={};var _0x2b843d;var _0x179ae3;return db['FreshdeskConfiguration'][_0x3b9b('0x49')]({'where':{'id':_0x53519d[_0x3b9b('0x44')]['id']}})[_0x3b9b('0x21')](handleEntityNotFound(_0x2d81c6,null))[_0x3b9b('0x21')](function(_0x157310){if(_0x157310){_0x2b843d=_0x157310;_0x438f7a[_0x3b9b('0x2e')]=_[_0x3b9b('0x2f')](db[_0x3b9b('0x45')][_0x3b9b('0x2a')]);_0x438f7a[_0x3b9b('0x30')]=_[_0x3b9b('0x2f')](_0x53519d['query']);_0x438f7a[_0x3b9b('0x31')]=_[_0x3b9b('0x32')](_0x438f7a[_0x3b9b('0x2e')],_0x438f7a['query']);_0x3ef7c6['attributes']=_[_0x3b9b('0x32')](_0x438f7a[_0x3b9b('0x2e')],qs[_0x3b9b('0x34')](_0x53519d[_0x3b9b('0x30')]['fields']));_0x3ef7c6[_0x3b9b('0x33')]=_0x3ef7c6[_0x3b9b('0x33')][_0x3b9b('0x35')]?_0x3ef7c6['attributes']:_0x438f7a[_0x3b9b('0x2e')];_0x3ef7c6['order']=qs[_0x3b9b('0x38')](_0x53519d[_0x3b9b('0x30')][_0x3b9b('0x38')]);_0x3ef7c6[_0x3b9b('0x3a')]=qs[_0x3b9b('0x31')](_['pick'](_0x53519d['query'],_0x438f7a[_0x3b9b('0x31')]));if(_0x53519d['query'][_0x3b9b('0x47')]){_0x3ef7c6[_0x3b9b('0x3a')]=_[_0x3b9b('0x3b')](_0x3ef7c6[_0x3b9b('0x3a')],{'$or':_[_0x3b9b('0x28')](_0x3ef7c6[_0x3b9b('0x33')],function(_0x2b0c4f){var _0x297b20={};_0x297b20[_0x2b0c4f]={'$like':'%'+_0x53519d[_0x3b9b('0x30')][_0x3b9b('0x47')]+'%'};return _0x297b20;})});}_0x3ef7c6=_['merge']({},_0x3ef7c6,_0x53519d['options']);return _0x2b843d[_0x3b9b('0x4a')](_0x3ef7c6);}})['then'](function(_0x4515f4){if(_0x4515f4){_0x179ae3=_0x4515f4[_0x3b9b('0x35')];if(!_0x53519d[_0x3b9b('0x30')][_0x3b9b('0x36')](_0x3b9b('0x37'))){_0x3ef7c6['limit']=qs[_0x3b9b('0x1d')](_0x53519d['query'][_0x3b9b('0x1d')]);_0x3ef7c6[_0x3b9b('0x1a')]=qs[_0x3b9b('0x1a')](_0x53519d[_0x3b9b('0x30')]['offset']);}return _0x2b843d['getSubjects'](_0x3ef7c6);}})['then'](function(_0x3e5f39){if(_0x3e5f39){return _0x3e5f39?{'count':_0x179ae3,'rows':_0x3e5f39}:null;}})[_0x3b9b('0x21')](respondWithResult(_0x2d81c6,null))[_0x3b9b('0x43')](handleError(_0x2d81c6,null));};exports['getDescriptions']=function(_0x567866,_0x18084b,_0x55cd9a){var _0x186507={};var _0x30da47={};var _0x13f44c;var _0x1f45b4;return db[_0x3b9b('0x29')][_0x3b9b('0x49')]({'where':{'id':_0x567866[_0x3b9b('0x44')]['id']}})['then'](handleEntityNotFound(_0x18084b,null))[_0x3b9b('0x21')](function(_0x2aac79){if(_0x2aac79){_0x13f44c=_0x2aac79;_0x30da47[_0x3b9b('0x2e')]=_[_0x3b9b('0x2f')](db['FreshdeskField'][_0x3b9b('0x2a')]);_0x30da47[_0x3b9b('0x30')]=_[_0x3b9b('0x2f')](_0x567866['query']);_0x30da47['filters']=_[_0x3b9b('0x32')](_0x30da47[_0x3b9b('0x2e')],_0x30da47['query']);_0x186507[_0x3b9b('0x33')]=_[_0x3b9b('0x32')](_0x30da47[_0x3b9b('0x2e')],qs['fields'](_0x567866[_0x3b9b('0x30')][_0x3b9b('0x34')]));_0x186507['attributes']=_0x186507['attributes'][_0x3b9b('0x35')]?_0x186507['attributes']:_0x30da47['model'];_0x186507[_0x3b9b('0x46')]=qs[_0x3b9b('0x38')](_0x567866[_0x3b9b('0x30')][_0x3b9b('0x38')]);_0x186507[_0x3b9b('0x3a')]=qs['filters'](_[_0x3b9b('0x39')](_0x567866[_0x3b9b('0x30')],_0x30da47['filters']));if(_0x567866[_0x3b9b('0x30')]['filter']){_0x186507[_0x3b9b('0x3a')]=_[_0x3b9b('0x3b')](_0x186507[_0x3b9b('0x3a')],{'$or':_[_0x3b9b('0x28')](_0x186507[_0x3b9b('0x33')],function(_0x57cd14){var _0x138e9d={};_0x138e9d[_0x57cd14]={'$like':'%'+_0x567866[_0x3b9b('0x30')][_0x3b9b('0x47')]+'%'};return _0x138e9d;})});}_0x186507=_['merge']({},_0x186507,_0x567866[_0x3b9b('0x4b')]);return _0x13f44c['getDescriptions'](_0x186507);}})[_0x3b9b('0x21')](function(_0x481279){if(_0x481279){_0x1f45b4=_0x481279[_0x3b9b('0x35')];if(!_0x567866[_0x3b9b('0x30')][_0x3b9b('0x36')]('nolimit')){_0x186507[_0x3b9b('0x1d')]=qs['limit'](_0x567866[_0x3b9b('0x30')][_0x3b9b('0x1d')]);_0x186507[_0x3b9b('0x1a')]=qs[_0x3b9b('0x1a')](_0x567866[_0x3b9b('0x30')][_0x3b9b('0x1a')]);}return _0x13f44c[_0x3b9b('0x4c')](_0x186507);}})['then'](function(_0x1535ee){if(_0x1535ee){return _0x1535ee?{'count':_0x1f45b4,'rows':_0x1535ee}:null;}})[_0x3b9b('0x21')](respondWithResult(_0x18084b,null))['catch'](handleError(_0x18084b,null));};exports[_0x3b9b('0x4d')]=function(_0x2b5dab,_0x25348c,_0xc2f6f6){var _0x17cc7b={};var _0x53ca38={};var _0xd738a9;var _0xe8d4df;return db['FreshdeskConfiguration'][_0x3b9b('0x49')]({'where':{'id':_0x2b5dab[_0x3b9b('0x44')]['id']}})['then'](handleEntityNotFound(_0x25348c,null))[_0x3b9b('0x21')](function(_0x181c12){if(_0x181c12){_0xd738a9=_0x181c12;_0x53ca38[_0x3b9b('0x2e')]=_[_0x3b9b('0x2f')](db[_0x3b9b('0x4e')][_0x3b9b('0x2a')]);_0x53ca38['query']=_[_0x3b9b('0x2f')](_0x2b5dab[_0x3b9b('0x30')]);_0x53ca38[_0x3b9b('0x31')]=_[_0x3b9b('0x32')](_0x53ca38[_0x3b9b('0x2e')],_0x53ca38['query']);_0x17cc7b['attributes']=_[_0x3b9b('0x32')](_0x53ca38[_0x3b9b('0x2e')],qs[_0x3b9b('0x34')](_0x2b5dab['query'][_0x3b9b('0x34')]));_0x17cc7b[_0x3b9b('0x33')]=_0x17cc7b['attributes'][_0x3b9b('0x35')]?_0x17cc7b[_0x3b9b('0x33')]:_0x53ca38[_0x3b9b('0x2e')];_0x17cc7b[_0x3b9b('0x46')]=qs['sort'](_0x2b5dab[_0x3b9b('0x30')][_0x3b9b('0x38')]);_0x17cc7b[_0x3b9b('0x3a')]=qs[_0x3b9b('0x31')](_[_0x3b9b('0x39')](_0x2b5dab[_0x3b9b('0x30')],_0x53ca38[_0x3b9b('0x31')]));if(_0x2b5dab[_0x3b9b('0x30')][_0x3b9b('0x47')]){_0x17cc7b[_0x3b9b('0x3a')]=_[_0x3b9b('0x3b')](_0x17cc7b[_0x3b9b('0x3a')],{'$or':_['map'](_0x17cc7b[_0x3b9b('0x33')],function(_0x4de5dd){var _0x465385={};_0x465385[_0x4de5dd]={'$like':'%'+_0x2b5dab[_0x3b9b('0x30')]['filter']+'%'};return _0x465385;})});}_0x17cc7b=_['merge']({},_0x17cc7b,_0x2b5dab['options']);return _0xd738a9['getTags'](_0x17cc7b);}})[_0x3b9b('0x21')](function(_0x131074){if(_0x131074){_0xe8d4df=_0x131074[_0x3b9b('0x35')];if(!_0x2b5dab[_0x3b9b('0x30')][_0x3b9b('0x36')](_0x3b9b('0x37'))){_0x17cc7b['limit']=qs[_0x3b9b('0x1d')](_0x2b5dab[_0x3b9b('0x30')]['limit']);_0x17cc7b[_0x3b9b('0x1a')]=qs[_0x3b9b('0x1a')](_0x2b5dab[_0x3b9b('0x30')][_0x3b9b('0x1a')]);}return _0xd738a9[_0x3b9b('0x4d')](_0x17cc7b);}})[_0x3b9b('0x21')](function(_0x214f2c){if(_0x214f2c){return _0x214f2c?{'count':_0xe8d4df,'rows':_0x214f2c}:null;}})[_0x3b9b('0x21')](respondWithResult(_0x25348c,null))[_0x3b9b('0x43')](handleError(_0x25348c,null));};exports[_0x3b9b('0x4f')]=function(_0x49ce72,_0x1e3f86,_0x18ca5c){if(_0x49ce72[_0x3b9b('0x42')]['id']){delete _0x49ce72[_0x3b9b('0x42')]['id'];}return db[_0x3b9b('0x29')][_0x3b9b('0x49')]({'where':{'id':_0x49ce72[_0x3b9b('0x44')]['id']}})[_0x3b9b('0x21')](handleEntityNotFound(_0x1e3f86,null))['then'](function(_0x40126e){if(_0x40126e){return _0x40126e[_0x3b9b('0x4f')](_0x49ce72[_0x3b9b('0x42')][_0x3b9b('0x50')]||[]);}return null;})[_0x3b9b('0x21')](respondWithResult(_0x1e3f86,null))['catch'](handleError(_0x1e3f86,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5e07c72..7601728 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 _0xbdbd=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash'];(function(_0x531fc7,_0x3da64e){var _0x515e20=function(_0x60c603){while(--_0x60c603){_0x531fc7['push'](_0x531fc7['shift']());}};_0x515e20(++_0x3da64e);}(_0xbdbd,0x112));var _0xdbdb=function(_0x48c4e5,_0xe3daff){_0x48c4e5=_0x48c4e5-0x0;var _0x161c42=_0xbdbd[_0x48c4e5];return _0x161c42;};'use strict';var _=require(_0xdbdb('0x0'));var util=require(_0xdbdb('0x1'));var logger=require(_0xdbdb('0x2'))('api');var moment=require(_0xdbdb('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbdb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbdb('0x5'));var config=require(_0xdbdb('0x6'));var attributes=require(_0xdbdb('0x7'));module[_0xdbdb('0x8')]=function(_0x2e0790,_0x4fcbeb){return _0x2e0790[_0xdbdb('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0xdbdb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7762=['request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x556b03,_0x47301a){var _0xb09e61=function(_0x4328fe){while(--_0x4328fe){_0x556b03['push'](_0x556b03['shift']());}};_0xb09e61(++_0x47301a);}(_0x7762,0x10f));var _0x2776=function(_0x5700af,_0xf3f00d){_0x5700af=_0x5700af-0x0;var _0x4dffee=_0x7762[_0x5700af];return _0x4dffee;};'use strict';var _=require(_0x2776('0x0'));var util=require('util');var logger=require(_0x2776('0x1'))(_0x2776('0x2'));var moment=require(_0x2776('0x3'));var BPromise=require(_0x2776('0x4'));var rp=require(_0x2776('0x5'));var fs=require('fs');var path=require(_0x2776('0x6'));var rimraf=require('rimraf');var config=require(_0x2776('0x7'));var attributes=require(_0x2776('0x8'));module[_0x2776('0x9')]=function(_0x153eaa,_0x1d601b){return _0x153eaa['define'](_0x2776('0xa'),attributes,{'tableName':_0x2776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 096d170..f63bb00 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 _0x906c=['rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd80b,_0x26b5f4){var _0x4dbefa=function(_0x167362){while(--_0x167362){_0x3dd80b['push'](_0x3dd80b['shift']());}};_0x4dbefa(++_0x26b5f4);}(_0x906c,0x162));var _0xc906=function(_0xaaf69c,_0x2209fb){_0xaaf69c=_0xaaf69c-0x0;var _0x54968c=_0x906c[_0xaaf69c];return _0x54968c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc906('0x0'));var BPromise=require('bluebird');var rs=require(_0xc906('0x1'));var fs=require('fs');var Redis=require(_0xc906('0x2'));var db=require(_0xc906('0x3'))['db'];var utils=require(_0xc906('0x4'));var logger=require(_0xc906('0x5'))(_0xc906('0x6'));var config=require(_0xc906('0x7'));var jayson=require(_0xc906('0x8'));var client=jayson[_0xc906('0x9')][_0xc906('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59d94e,_0x2b3f84,_0x573184){return new BPromise(function(_0x4c06fb,_0x31a80f){return client['request'](_0x59d94e,_0x573184)['then'](function(_0x47f616){logger[_0xc906('0xb')](_0xc906('0xc'),_0x2b3f84,_0xc906('0xd'));logger[_0xc906('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b3f84,'request\x20sent',JSON[_0xc906('0xf')](_0x47f616));if(_0x47f616[_0xc906('0x10')]){if(_0x47f616[_0xc906('0x10')][_0xc906('0x11')]===0x1f4){logger[_0xc906('0x10')](_0xc906('0xc'),_0x2b3f84,_0x47f616['error'][_0xc906('0x12')]);return _0x31a80f(_0x47f616['error'][_0xc906('0x12')]);}logger[_0xc906('0x10')](_0xc906('0xc'),_0x2b3f84,_0x47f616[_0xc906('0x10')]['message']);return _0x4c06fb(_0x47f616[_0xc906('0x10')][_0xc906('0x12')]);}else{logger['info'](_0xc906('0xc'),_0x2b3f84,'request\x20sent');_0x4c06fb(_0x47f616[_0xc906('0x13')][_0xc906('0x12')]);}})['catch'](function(_0x3c86ff){logger[_0xc906('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b3f84,_0x3c86ff);_0x31a80f(_0x3c86ff);});});} \ No newline at end of file +var _0x89e0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x34e3ea,_0x3862a2){var _0x295887=function(_0x5309d9){while(--_0x5309d9){_0x34e3ea['push'](_0x34e3ea['shift']());}};_0x295887(++_0x3862a2);}(_0x89e0,0x7a));var _0x089e=function(_0x4060b4,_0x82eb25){_0x4060b4=_0x4060b4-0x0;var _0x32aaa1=_0x89e0[_0x4060b4];return _0x32aaa1;};'use strict';var _=require(_0x089e('0x0'));var util=require(_0x089e('0x1'));var moment=require(_0x089e('0x2'));var BPromise=require(_0x089e('0x3'));var rs=require(_0x089e('0x4'));var fs=require('fs');var Redis=require(_0x089e('0x5'));var db=require(_0x089e('0x6'))['db'];var utils=require(_0x089e('0x7'));var logger=require(_0x089e('0x8'))(_0x089e('0x9'));var config=require(_0x089e('0xa'));var jayson=require(_0x089e('0xb'));var client=jayson['client'][_0x089e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47dd03,_0x3f6fc0,_0x537aa2){return new BPromise(function(_0x38fdb4,_0x4f464a){return client['request'](_0x47dd03,_0x537aa2)[_0x089e('0xd')](function(_0x862dd6){logger['info'](_0x089e('0xe'),_0x3f6fc0,_0x089e('0xf'));logger[_0x089e('0x10')](_0x089e('0x11'),_0x3f6fc0,_0x089e('0xf'),JSON[_0x089e('0x12')](_0x862dd6));if(_0x862dd6[_0x089e('0x13')]){if(_0x862dd6['error'][_0x089e('0x14')]===0x1f4){logger['error'](_0x089e('0xe'),_0x3f6fc0,_0x862dd6[_0x089e('0x13')][_0x089e('0x15')]);return _0x4f464a(_0x862dd6[_0x089e('0x13')]['message']);}logger[_0x089e('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f6fc0,_0x862dd6['error']['message']);return _0x38fdb4(_0x862dd6[_0x089e('0x13')][_0x089e('0x15')]);}else{logger[_0x089e('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f6fc0,'request\x20sent');_0x38fdb4(_0x862dd6[_0x089e('0x17')][_0x089e('0x15')]);}})[_0x089e('0x18')](function(_0x4e88f6){logger[_0x089e('0x13')](_0x089e('0xe'),_0x3f6fc0,_0x4e88f6);_0x4f464a(_0x4e88f6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index fc462c1..db9b190 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 _0x9bd4=['express','Router','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x286842,_0x279129){var _0x1ced5c=function(_0x185ef4){while(--_0x185ef4){_0x286842['push'](_0x286842['shift']());}};_0x1ced5c(++_0x279129);}(_0x9bd4,0x119));var _0x49bd=function(_0x3a9b96,_0x2d0b27){_0x3a9b96=_0x3a9b96-0x0;var _0xefbc5=_0x9bd4[_0x3a9b96];return _0xefbc5;};'use strict';var multer=require(_0x49bd('0x0'));var util=require(_0x49bd('0x1'));var path=require(_0x49bd('0x2'));var timeout=require(_0x49bd('0x3'));var express=require(_0x49bd('0x4'));var router=express[_0x49bd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x49bd('0x6'));var config=require(_0x49bd('0x7'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x49bd('0x8')]);router[_0x49bd('0x9')]('/:id',auth[_0x49bd('0xa')](),controller[_0x49bd('0xb')]);router[_0x49bd('0xc')]('/',auth[_0x49bd('0xa')](),controller[_0x49bd('0xd')]);router[_0x49bd('0xe')](_0x49bd('0xf'),auth[_0x49bd('0xa')](),controller[_0x49bd('0x10')]);router[_0x49bd('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x49bd('0x12')]=router; \ No newline at end of file +var _0x649c=['post','create','update','exports','util','path','Router','fs-extra','./intFreshdeskField.controller','get','isAuthenticated','/:id','show'];(function(_0x8f2226,_0x4b6d60){var _0x498812=function(_0x49e1a2){while(--_0x49e1a2){_0x8f2226['push'](_0x8f2226['shift']());}};_0x498812(++_0x4b6d60);}(_0x649c,0x79));var _0xc649=function(_0x2bf4be,_0x4d445b){_0x2bf4be=_0x2bf4be-0x0;var _0x1b8ba3=_0x649c[_0x2bf4be];return _0x1b8ba3;};'use strict';var multer=require('multer');var util=require(_0xc649('0x0'));var path=require(_0xc649('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc649('0x2')]();var fs_extra=require(_0xc649('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc649('0x4'));router[_0xc649('0x5')]('/',auth[_0xc649('0x6')](),controller['index']);router[_0xc649('0x5')](_0xc649('0x7'),auth[_0xc649('0x6')](),controller[_0xc649('0x8')]);router[_0xc649('0x9')]('/',auth['isAuthenticated'](),controller[_0xc649('0xa')]);router['put'](_0xc649('0x7'),auth['isAuthenticated'](),controller[_0xc649('0xb')]);router['delete'](_0xc649('0x7'),auth[_0xc649('0x6')](),controller['destroy']);module[_0xc649('0xc')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 40c1b9b..289d367 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 _0x7ed3=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0xa3ac44,_0x128f88){var _0x1932ff=function(_0x494f7d){while(--_0x494f7d){_0xa3ac44['push'](_0xa3ac44['shift']());}};_0x1932ff(++_0x128f88);}(_0x7ed3,0xc1));var _0x37ed=function(_0x29b36d,_0x1cf1e7){_0x29b36d=_0x29b36d-0x0;var _0x3623b3=_0x7ed3[_0x29b36d];return _0x3623b3;};'use strict';var Sequelize=require(_0x37ed('0x0'));module[_0x37ed('0x1')]={'type':{'type':Sequelize[_0x37ed('0x2')](_0x37ed('0x3'),_0x37ed('0x4'),_0x37ed('0x5'),'keyValue',_0x37ed('0x6')),'defaultValue':_0x37ed('0x3')},'content':{'type':Sequelize[_0x37ed('0x7')]},'key':{'type':Sequelize[_0x37ed('0x7')]},'keyType':{'type':Sequelize[_0x37ed('0x2')](_0x37ed('0x3'),'variable',_0x37ed('0x5'))},'keyContent':{'type':Sequelize[_0x37ed('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x37ed('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa26f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x1f4375,_0x3a895a){var _0xaca331=function(_0x8fff6e){while(--_0x8fff6e){_0x1f4375['push'](_0x1f4375['shift']());}};_0xaca331(++_0x3a895a);}(_0xa26f,0x1ec));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfa26('0x0'));module[_0xfa26('0x1')]={'type':{'type':Sequelize[_0xfa26('0x2')](_0xfa26('0x3'),_0xfa26('0x4'),_0xfa26('0x5'),_0xfa26('0x6'),_0xfa26('0x7')),'defaultValue':_0xfa26('0x3')},'content':{'type':Sequelize[_0xfa26('0x8')]},'key':{'type':Sequelize[_0xfa26('0x8')]},'keyType':{'type':Sequelize[_0xfa26('0x2')](_0xfa26('0x3'),_0xfa26('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfa26('0x8')]},'nameField':{'type':Sequelize[_0xfa26('0x8')]},'customField':{'type':Sequelize[_0xfa26('0x9')],'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 247c356..f30fb3b 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 _0xe13a=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','order','sort','where','pick','filters','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','show','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe13a,0x178));var _0xae13=function(_0x1c674c,_0x17cf57){_0x1c674c=_0x1c674c-0x0;var _0x56ad90=_0xe13a[_0x1c674c];return _0x56ad90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae13('0x0'));var zipdir=require(_0xae13('0x1'));var jsonpatch=require(_0xae13('0x2'));var rp=require(_0xae13('0x3'));var moment=require('moment');var BPromise=require(_0xae13('0x4'));var Mustache=require(_0xae13('0x5'));var util=require(_0xae13('0x6'));var path=require(_0xae13('0x7'));var sox=require(_0xae13('0x8'));var csv=require(_0xae13('0x9'));var ejs=require(_0xae13('0xa'));var fs=require('fs');var fs_extra=require(_0xae13('0xb'));var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0x9'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae13('0x15'));var logger=require(_0xae13('0x16'))(_0xae13('0x17'));var utils=require(_0xae13('0x18'));var config=require(_0xae13('0x19'));var licenseUtil=require(_0xae13('0x1a'));var db=require(_0xae13('0x1b'))['db'];function respondWithStatusCode(_0x4dd599,_0x42d869){_0x42d869=_0x42d869||0xcc;return function(_0x159632){if(_0x159632){return _0x4dd599['sendStatus'](_0x42d869);}return _0x4dd599['status'](_0x42d869)['end']();};}function respondWithResult(_0x50f7c4,_0x52484b){_0x52484b=_0x52484b||0xc8;return function(_0x26ff3e){if(_0x26ff3e){return _0x50f7c4[_0xae13('0x1c')](_0x52484b)[_0xae13('0x1d')](_0x26ff3e);}};}function respondWithFilteredResult(_0x90cdc1,_0x537889){return function(_0x2912a2){if(_0x2912a2){var _0x5c25a4=typeof _0x537889[_0xae13('0x1e')]==='undefined'&&typeof _0x537889[_0xae13('0x1f')]===_0xae13('0x20');var _0x207363=_0x2912a2[_0xae13('0x21')];var _0x1a9c07=_0x5c25a4?0x0:_0x537889[_0xae13('0x1e')];var _0x32dcbe=_0x5c25a4?_0x2912a2[_0xae13('0x21')]:_0x537889[_0xae13('0x1e')]+_0x537889['limit'];var _0x4462a5;if(_0x32dcbe>=_0x207363){_0x32dcbe=_0x207363;_0x4462a5=0xc8;}else{_0x4462a5=0xce;}_0x90cdc1['status'](_0x4462a5);return _0x90cdc1[_0xae13('0x22')](_0xae13('0x23'),_0x1a9c07+'-'+_0x32dcbe+'/'+_0x207363)['json'](_0x2912a2);}return null;};}function patchUpdates(_0x25a195){return function(_0x39d41c){try{jsonpatch[_0xae13('0x24')](_0x39d41c,_0x25a195,!![]);}catch(_0x240802){return BPromise[_0xae13('0x25')](_0x240802);}return _0x39d41c[_0xae13('0x26')]();};}function saveUpdates(_0x54b3b4,_0x520692){return function(_0x149eda){if(_0x149eda){return _0x149eda[_0xae13('0x27')](_0x54b3b4)['then'](function(_0x168b92){return _0x168b92;});}return null;};}function removeEntity(_0x519a37,_0x13c2de){return function(_0x194437){if(_0x194437){return _0x194437[_0xae13('0x28')]()['then'](function(){_0x519a37['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edb8c,_0xc5e6a7){return function(_0x17ce58){if(!_0x17ce58){_0x4edb8c['sendStatus'](0x194);}return _0x17ce58;};}function handleError(_0x370874,_0x517e71){_0x517e71=_0x517e71||0x1f4;return function(_0x3d0d60){logger['error'](_0x3d0d60[_0xae13('0x29')]);if(_0x3d0d60[_0xae13('0x2a')]){delete _0x3d0d60['name'];}_0x370874[_0xae13('0x1c')](_0x517e71)[_0xae13('0x2b')](_0x3d0d60);};}exports[_0xae13('0x2c')]=function(_0x306dfb,_0x578e99){var _0x41ceb7={},_0x27b737={},_0x1d7152={'count':0x0,'rows':[]};var _0x68ce70=_[_0xae13('0x2d')](db[_0xae13('0x2e')][_0xae13('0x2f')],function(_0x5bd0ee){return{'name':_0x5bd0ee[_0xae13('0x30')],'type':_0x5bd0ee['type'][_0xae13('0x31')]};});_0x27b737[_0xae13('0x32')]=_[_0xae13('0x2d')](_0x68ce70,_0xae13('0x2a'));_0x27b737[_0xae13('0x33')]=_[_0xae13('0x34')](_0x306dfb[_0xae13('0x33')]);_0x27b737['filters']=_['intersection'](_0x27b737[_0xae13('0x32')],_0x27b737[_0xae13('0x33')]);_0x41ceb7[_0xae13('0x35')]=_[_0xae13('0x36')](_0x27b737[_0xae13('0x32')],qs[_0xae13('0x37')](_0x306dfb[_0xae13('0x33')][_0xae13('0x37')]));_0x41ceb7[_0xae13('0x35')]=_0x41ceb7[_0xae13('0x35')]['length']?_0x41ceb7[_0xae13('0x35')]:_0x27b737[_0xae13('0x32')];if(!_0x306dfb[_0xae13('0x33')]['hasOwnProperty']('nolimit')){_0x41ceb7['limit']=qs['limit'](_0x306dfb['query']['limit']);_0x41ceb7[_0xae13('0x1e')]=qs[_0xae13('0x1e')](_0x306dfb[_0xae13('0x33')]['offset']);}_0x41ceb7[_0xae13('0x38')]=qs[_0xae13('0x39')](_0x306dfb[_0xae13('0x33')][_0xae13('0x39')]);_0x41ceb7[_0xae13('0x3a')]=qs['filters'](_[_0xae13('0x3b')](_0x306dfb[_0xae13('0x33')],_0x27b737[_0xae13('0x3c')]),_0x68ce70);if(_0x306dfb['query']['filter']){_0x41ceb7[_0xae13('0x3a')]=_[_0xae13('0x3d')](_0x41ceb7[_0xae13('0x3a')],{'$or':_[_0xae13('0x2d')](_0x68ce70,function(_0x4a17bb){if(_0x4a17bb[_0xae13('0x3e')]!==_0xae13('0x3f')){var _0x538283={};_0x538283[_0x4a17bb[_0xae13('0x2a')]]={'$like':'%'+_0x306dfb[_0xae13('0x33')]['filter']+'%'};return _0x538283;}})});}_0x41ceb7=_[_0xae13('0x3d')]({},_0x41ceb7,_0x306dfb[_0xae13('0x40')]);var _0x3d3569={'where':_0x41ceb7[_0xae13('0x3a')]};return db['FreshdeskField'][_0xae13('0x21')](_0x3d3569)[_0xae13('0x41')](function(_0x166091){_0x1d7152[_0xae13('0x21')]=_0x166091;if(_0x306dfb['query'][_0xae13('0x42')]){_0x41ceb7[_0xae13('0x43')]=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x44')](_0x41ceb7);})['then'](function(_0x49428a){_0x1d7152[_0xae13('0x45')]=_0x49428a;return _0x1d7152;})[_0xae13('0x41')](respondWithFilteredResult(_0x578e99,_0x41ceb7))['catch'](handleError(_0x578e99,null));};exports[_0xae13('0x46')]=function(_0x4a3a43,_0x2b589f){var _0x230ba6={'raw':!![],'where':{'id':_0x4a3a43['params']['id']}},_0x3fca0a={};_0x3fca0a[_0xae13('0x32')]=_[_0xae13('0x34')](db[_0xae13('0x2e')][_0xae13('0x2f')]);_0x3fca0a['query']=_[_0xae13('0x34')](_0x4a3a43[_0xae13('0x33')]);_0x3fca0a[_0xae13('0x3c')]=_[_0xae13('0x36')](_0x3fca0a[_0xae13('0x32')],_0x3fca0a[_0xae13('0x33')]);_0x230ba6[_0xae13('0x35')]=_[_0xae13('0x36')](_0x3fca0a['model'],qs[_0xae13('0x37')](_0x4a3a43['query'][_0xae13('0x37')]));_0x230ba6[_0xae13('0x35')]=_0x230ba6[_0xae13('0x35')][_0xae13('0x47')]?_0x230ba6['attributes']:_0x3fca0a[_0xae13('0x32')];if(_0x4a3a43['query'][_0xae13('0x42')]){_0x230ba6[_0xae13('0x43')]=[{'all':!![]}];}_0x230ba6=_['merge']({},_0x230ba6,_0x4a3a43[_0xae13('0x40')]);return db[_0xae13('0x2e')][_0xae13('0x48')](_0x230ba6)[_0xae13('0x41')](handleEntityNotFound(_0x2b589f,null))[_0xae13('0x41')](respondWithResult(_0x2b589f,null))[_0xae13('0x49')](handleError(_0x2b589f,null));};exports['create']=function(_0x417ef2,_0x26dcbb){return db[_0xae13('0x2e')][_0xae13('0x4a')](_0x417ef2[_0xae13('0x4b')],{})['then'](respondWithResult(_0x26dcbb,0xc9))[_0xae13('0x49')](handleError(_0x26dcbb,null));};exports[_0xae13('0x27')]=function(_0x8e6f1e,_0x551ed6){if(_0x8e6f1e['body']['id']){delete _0x8e6f1e['body']['id'];}return db['FreshdeskField'][_0xae13('0x48')]({'where':{'id':_0x8e6f1e['params']['id']}})[_0xae13('0x41')](handleEntityNotFound(_0x551ed6,null))['then'](saveUpdates(_0x8e6f1e[_0xae13('0x4b')],null))[_0xae13('0x41')](respondWithResult(_0x551ed6,null))[_0xae13('0x49')](handleError(_0x551ed6,null));};exports[_0xae13('0x28')]=function(_0x4509ea,_0x53d341){return db[_0xae13('0x2e')][_0xae13('0x48')]({'where':{'id':_0x4509ea['params']['id']}})[_0xae13('0x41')](handleEntityNotFound(_0x53d341,null))[_0xae13('0x41')](removeEntity(_0x53d341,null))['catch'](handleError(_0x53d341,null));}; \ No newline at end of file +var _0xe739=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','params','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe739,0x105));var _0x9e73=function(_0x2b946e,_0x21e1e7){_0x2b946e=_0x2b946e-0x0;var _0x4d8fb7=_0xe739[_0x2b946e];return _0x4d8fb7;};'use strict';var emlformat=require(_0x9e73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e73('0x1'));var jsonpatch=require(_0x9e73('0x2'));var rp=require(_0x9e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e73('0x4'));var path=require(_0x9e73('0x5'));var sox=require(_0x9e73('0x6'));var csv=require(_0x9e73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e73('0x8'));var _=require(_0x9e73('0x9'));var squel=require(_0x9e73('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e73('0xb'));var deskjs=require(_0x9e73('0xc'));var toCsv=require(_0x9e73('0x7'));var querystring=require(_0x9e73('0xd'));var Papa=require(_0x9e73('0xe'));var Redis=require(_0x9e73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e73('0x11'))('api');var utils=require(_0x9e73('0x12'));var config=require(_0x9e73('0x13'));var licenseUtil=require(_0x9e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102bb9,_0x4696e2){_0x4696e2=_0x4696e2||0xcc;return function(_0x45c2d0){if(_0x45c2d0){return _0x102bb9[_0x9e73('0x15')](_0x4696e2);}return _0x102bb9['status'](_0x4696e2)[_0x9e73('0x16')]();};}function respondWithResult(_0x607981,_0x3a7bd5){_0x3a7bd5=_0x3a7bd5||0xc8;return function(_0x5be2fa){if(_0x5be2fa){return _0x607981[_0x9e73('0x17')](_0x3a7bd5)[_0x9e73('0x18')](_0x5be2fa);}};}function respondWithFilteredResult(_0x597492,_0x367857){return function(_0x327305){if(_0x327305){var _0x21bd3a=typeof _0x367857['offset']===_0x9e73('0x19')&&typeof _0x367857['limit']===_0x9e73('0x19');var _0x58bbaa=_0x327305[_0x9e73('0x1a')];var _0x48b1db=_0x21bd3a?0x0:_0x367857['offset'];var _0x419c5b=_0x21bd3a?_0x327305[_0x9e73('0x1a')]:_0x367857[_0x9e73('0x1b')]+_0x367857[_0x9e73('0x1c')];var _0x3e56d8;if(_0x419c5b>=_0x58bbaa){_0x419c5b=_0x58bbaa;_0x3e56d8=0xc8;}else{_0x3e56d8=0xce;}_0x597492[_0x9e73('0x17')](_0x3e56d8);return _0x597492[_0x9e73('0x1d')](_0x9e73('0x1e'),_0x48b1db+'-'+_0x419c5b+'/'+_0x58bbaa)[_0x9e73('0x18')](_0x327305);}return null;};}function patchUpdates(_0x3f56bf){return function(_0x4a5cd1){try{jsonpatch[_0x9e73('0x1f')](_0x4a5cd1,_0x3f56bf,!![]);}catch(_0x5c6bae){return BPromise[_0x9e73('0x20')](_0x5c6bae);}return _0x4a5cd1['save']();};}function saveUpdates(_0x31d354,_0x589a5d){return function(_0x2c2b32){if(_0x2c2b32){return _0x2c2b32[_0x9e73('0x21')](_0x31d354)['then'](function(_0x55704a){return _0x55704a;});}return null;};}function removeEntity(_0x127afd,_0x5c6322){return function(_0x256ea1){if(_0x256ea1){return _0x256ea1[_0x9e73('0x22')]()[_0x9e73('0x23')](function(){_0x127afd['status'](0xcc)[_0x9e73('0x16')]();});}};}function handleEntityNotFound(_0x3a845c,_0x566cd8){return function(_0x539560){if(!_0x539560){_0x3a845c[_0x9e73('0x15')](0x194);}return _0x539560;};}function handleError(_0x5031eb,_0x5356ce){_0x5356ce=_0x5356ce||0x1f4;return function(_0x23b2cd){logger[_0x9e73('0x24')](_0x23b2cd[_0x9e73('0x25')]);if(_0x23b2cd['name']){delete _0x23b2cd[_0x9e73('0x26')];}_0x5031eb[_0x9e73('0x17')](_0x5356ce)['send'](_0x23b2cd);};}exports[_0x9e73('0x27')]=function(_0x24532d,_0x3fd13d){var _0x397bd6={},_0x2363f6={},_0x511e35={'count':0x0,'rows':[]};var _0x312e08=_['map'](db[_0x9e73('0x28')][_0x9e73('0x29')],function(_0xb3ef4f){return{'name':_0xb3ef4f[_0x9e73('0x2a')],'type':_0xb3ef4f[_0x9e73('0x2b')]['key']};});_0x2363f6[_0x9e73('0x2c')]=_[_0x9e73('0x2d')](_0x312e08,'name');_0x2363f6['query']=_[_0x9e73('0x2e')](_0x24532d[_0x9e73('0x2f')]);_0x2363f6[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x2363f6[_0x9e73('0x2c')],_0x2363f6[_0x9e73('0x2f')]);_0x397bd6['attributes']=_[_0x9e73('0x31')](_0x2363f6[_0x9e73('0x2c')],qs[_0x9e73('0x32')](_0x24532d[_0x9e73('0x2f')][_0x9e73('0x32')]));_0x397bd6[_0x9e73('0x33')]=_0x397bd6[_0x9e73('0x33')][_0x9e73('0x34')]?_0x397bd6[_0x9e73('0x33')]:_0x2363f6[_0x9e73('0x2c')];if(!_0x24532d['query'][_0x9e73('0x35')](_0x9e73('0x36'))){_0x397bd6[_0x9e73('0x1c')]=qs[_0x9e73('0x1c')](_0x24532d['query'][_0x9e73('0x1c')]);_0x397bd6[_0x9e73('0x1b')]=qs['offset'](_0x24532d['query'][_0x9e73('0x1b')]);}_0x397bd6[_0x9e73('0x37')]=qs[_0x9e73('0x38')](_0x24532d[_0x9e73('0x2f')][_0x9e73('0x38')]);_0x397bd6[_0x9e73('0x39')]=qs['filters'](_['pick'](_0x24532d['query'],_0x2363f6[_0x9e73('0x30')]),_0x312e08);if(_0x24532d[_0x9e73('0x2f')][_0x9e73('0x3a')]){_0x397bd6['where']=_['merge'](_0x397bd6['where'],{'$or':_[_0x9e73('0x2d')](_0x312e08,function(_0xb5bb10){if(_0xb5bb10[_0x9e73('0x2b')]!==_0x9e73('0x3b')){var _0x541171={};_0x541171[_0xb5bb10[_0x9e73('0x26')]]={'$like':'%'+_0x24532d[_0x9e73('0x2f')][_0x9e73('0x3a')]+'%'};return _0x541171;}})});}_0x397bd6=_[_0x9e73('0x3c')]({},_0x397bd6,_0x24532d[_0x9e73('0x3d')]);var _0x40bbda={'where':_0x397bd6[_0x9e73('0x39')]};return db[_0x9e73('0x28')][_0x9e73('0x1a')](_0x40bbda)[_0x9e73('0x23')](function(_0x5d8e77){_0x511e35['count']=_0x5d8e77;if(_0x24532d['query']['includeAll']){_0x397bd6[_0x9e73('0x3e')]=[{'all':!![]}];}return db[_0x9e73('0x28')]['findAll'](_0x397bd6);})[_0x9e73('0x23')](function(_0x2038fb){_0x511e35['rows']=_0x2038fb;return _0x511e35;})['then'](respondWithFilteredResult(_0x3fd13d,_0x397bd6))['catch'](handleError(_0x3fd13d,null));};exports['show']=function(_0x51036a,_0x1e3a56){var _0x2a0166={'raw':!![],'where':{'id':_0x51036a[_0x9e73('0x3f')]['id']}},_0xee1f5={};_0xee1f5['model']=_['keys'](db[_0x9e73('0x28')][_0x9e73('0x29')]);_0xee1f5[_0x9e73('0x2f')]=_[_0x9e73('0x2e')](_0x51036a[_0x9e73('0x2f')]);_0xee1f5[_0x9e73('0x30')]=_['intersection'](_0xee1f5[_0x9e73('0x2c')],_0xee1f5[_0x9e73('0x2f')]);_0x2a0166['attributes']=_[_0x9e73('0x31')](_0xee1f5[_0x9e73('0x2c')],qs['fields'](_0x51036a[_0x9e73('0x2f')][_0x9e73('0x32')]));_0x2a0166['attributes']=_0x2a0166[_0x9e73('0x33')][_0x9e73('0x34')]?_0x2a0166[_0x9e73('0x33')]:_0xee1f5[_0x9e73('0x2c')];if(_0x51036a[_0x9e73('0x2f')][_0x9e73('0x40')]){_0x2a0166[_0x9e73('0x3e')]=[{'all':!![]}];}_0x2a0166=_[_0x9e73('0x3c')]({},_0x2a0166,_0x51036a[_0x9e73('0x3d')]);return db[_0x9e73('0x28')][_0x9e73('0x41')](_0x2a0166)[_0x9e73('0x23')](handleEntityNotFound(_0x1e3a56,null))[_0x9e73('0x23')](respondWithResult(_0x1e3a56,null))[_0x9e73('0x42')](handleError(_0x1e3a56,null));};exports[_0x9e73('0x43')]=function(_0x2d6ed4,_0x4e7891){return db[_0x9e73('0x28')]['create'](_0x2d6ed4['body'],{})[_0x9e73('0x23')](respondWithResult(_0x4e7891,0xc9))[_0x9e73('0x42')](handleError(_0x4e7891,null));};exports['update']=function(_0x4baaf7,_0x308e86){if(_0x4baaf7[_0x9e73('0x44')]['id']){delete _0x4baaf7[_0x9e73('0x44')]['id'];}return db[_0x9e73('0x28')][_0x9e73('0x41')]({'where':{'id':_0x4baaf7[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0x308e86,null))[_0x9e73('0x23')](saveUpdates(_0x4baaf7[_0x9e73('0x44')],null))[_0x9e73('0x23')](respondWithResult(_0x308e86,null))[_0x9e73('0x42')](handleError(_0x308e86,null));};exports[_0x9e73('0x22')]=function(_0x230249,_0xe70028){return db['FreshdeskField'][_0x9e73('0x41')]({'where':{'id':_0x230249[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0xe70028,null))[_0x9e73('0x23')](removeEntity(_0xe70028,null))[_0x9e73('0x42')](handleError(_0xe70028,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 0567d40..4997e7e 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 _0xf2c9=['FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf2c9,0x187));var _0x9f2c=function(_0x53437b,_0x33a52a){_0x53437b=_0x53437b-0x0;var _0x60e84b=_0xf2c9[_0x53437b];return _0x60e84b;};'use strict';var _=require(_0x9f2c('0x0'));var util=require(_0x9f2c('0x1'));var logger=require(_0x9f2c('0x2'))(_0x9f2c('0x3'));var moment=require(_0x9f2c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f2c('0x5'));var rimraf=require(_0x9f2c('0x6'));var config=require(_0x9f2c('0x7'));var attributes=require(_0x9f2c('0x8'));module['exports']=function(_0x49faa9,_0x118d31){return _0x49faa9['define'](_0x9f2c('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x9f2c('0xa'),'fields':[_0x9f2c('0xb'),_0x9f2c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca74=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xca74,0x170));var _0x4ca7=function(_0x1b3463,_0x43e1f5){_0x1b3463=_0x1b3463-0x0;var _0x29d544=_0xca74[_0x1b3463];return _0x29d544;};'use strict';var _=require(_0x4ca7('0x0'));var util=require('util');var logger=require(_0x4ca7('0x1'))(_0x4ca7('0x2'));var moment=require(_0x4ca7('0x3'));var BPromise=require(_0x4ca7('0x4'));var rp=require(_0x4ca7('0x5'));var fs=require('fs');var path=require(_0x4ca7('0x6'));var rimraf=require(_0x4ca7('0x7'));var config=require(_0x4ca7('0x8'));var attributes=require(_0x4ca7('0x9'));module[_0x4ca7('0xa')]=function(_0x2e950a,_0xab134){return _0x2e950a[_0x4ca7('0xb')](_0x4ca7('0xc'),attributes,{'tableName':_0x4ca7('0xd'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x4ca7('0xe')],'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 b46b38a..fd12e01 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 _0x0330=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1f0547,_0x24fa8c){var _0x181c16=function(_0x388cba){while(--_0x388cba){_0x1f0547['push'](_0x1f0547['shift']());}};_0x181c16(++_0x24fa8c);}(_0x0330,0xd7));var _0x0033=function(_0x3bfc0f,_0x52ec83){_0x3bfc0f=_0x3bfc0f-0x0;var _0xc70934=_0x0330[_0x3bfc0f];return _0xc70934;};'use strict';var _=require(_0x0033('0x0'));var util=require(_0x0033('0x1'));var moment=require('moment');var BPromise=require(_0x0033('0x2'));var rs=require(_0x0033('0x3'));var fs=require('fs');var Redis=require(_0x0033('0x4'));var db=require(_0x0033('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0033('0x6'));var config=require(_0x0033('0x7'));var jayson=require(_0x0033('0x8'));var client=jayson[_0x0033('0x9')][_0x0033('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2341,_0x22e6ef,_0x230e39){return new BPromise(function(_0x4889f3,_0x23a275){return client[_0x0033('0xb')](_0x4a2341,_0x230e39)[_0x0033('0xc')](function(_0x3b62bb){logger[_0x0033('0xd')](_0x0033('0xe'),_0x22e6ef,'request\x20sent');logger[_0x0033('0xf')](_0x0033('0x10'),_0x22e6ef,_0x0033('0x11'),JSON[_0x0033('0x12')](_0x3b62bb));if(_0x3b62bb[_0x0033('0x13')]){if(_0x3b62bb['error']['code']===0x1f4){logger['error'](_0x0033('0xe'),_0x22e6ef,_0x3b62bb[_0x0033('0x13')][_0x0033('0x14')]);return _0x23a275(_0x3b62bb['error'][_0x0033('0x14')]);}logger[_0x0033('0x13')](_0x0033('0xe'),_0x22e6ef,_0x3b62bb[_0x0033('0x13')]['message']);return _0x4889f3(_0x3b62bb[_0x0033('0x13')][_0x0033('0x14')]);}else{logger[_0x0033('0xd')](_0x0033('0xe'),_0x22e6ef,'request\x20sent');_0x4889f3(_0x3b62bb['result'][_0x0033('0x14')]);}})[_0x0033('0x15')](function(_0x4a5b8b){logger[_0x0033('0x13')](_0x0033('0xe'),_0x22e6ef,_0x4a5b8b);_0x23a275(_0x4a5b8b);});});} \ No newline at end of file +var _0x3a78=['rpc','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','error','message','catch','moment','randomstring','ioredis','../../config/logger'];(function(_0x39c275,_0x2340ad){var _0x336aee=function(_0xcf2506){while(--_0xcf2506){_0x39c275['push'](_0x39c275['shift']());}};_0x336aee(++_0x2340ad);}(_0x3a78,0x1be));var _0x83a7=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x3a78[_0x237546];return _0x233e29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83a7('0x0'));var BPromise=require('bluebird');var rs=require(_0x83a7('0x1'));var fs=require('fs');var Redis=require(_0x83a7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x83a7('0x3'))(_0x83a7('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x83a7('0x5')][_0x83a7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x20b770,_0x4de551,_0x1ff4ae){return new BPromise(function(_0x50ab77,_0x14dc5d){return client[_0x83a7('0x7')](_0x20b770,_0x1ff4ae)[_0x83a7('0x8')](function(_0x840d4){logger[_0x83a7('0x9')](_0x83a7('0xa'),_0x4de551,_0x83a7('0xb'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4de551,_0x83a7('0xb'),JSON['stringify'](_0x840d4));if(_0x840d4[_0x83a7('0xc')]){if(_0x840d4[_0x83a7('0xc')]['code']===0x1f4){logger[_0x83a7('0xc')](_0x83a7('0xa'),_0x4de551,_0x840d4['error'][_0x83a7('0xd')]);return _0x14dc5d(_0x840d4['error'][_0x83a7('0xd')]);}logger[_0x83a7('0xc')](_0x83a7('0xa'),_0x4de551,_0x840d4['error'][_0x83a7('0xd')]);return _0x50ab77(_0x840d4[_0x83a7('0xc')]['message']);}else{logger['info'](_0x83a7('0xa'),_0x4de551,_0x83a7('0xb'));_0x50ab77(_0x840d4['result'][_0x83a7('0xd')]);}})[_0x83a7('0xe')](function(_0x587b98){logger[_0x83a7('0xc')](_0x83a7('0xa'),_0x4de551,_0x587b98);_0x14dc5d(_0x587b98);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3b7c86f..ca13d3c 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 _0x2f68=['create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x184ea6,_0x433cec){var _0x4191e2=function(_0x2bc745){while(--_0x2bc745){_0x184ea6['push'](_0x184ea6['shift']());}};_0x4191e2(++_0x433cec);}(_0x2f68,0x9a));var _0x82f6=function(_0x55f992,_0x5cbbea){_0x55f992=_0x55f992-0x0;var _0x365442=_0x2f68[_0x55f992];return _0x365442;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['getConfigurations']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),controller[_0x82f6('0xe')]);router[_0x82f6('0xd')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0x8')](),controller[_0x82f6('0x11')]);router[_0x82f6('0x12')](_0x82f6('0x9'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x13')]);module[_0x82f6('0x14')]=router; \ No newline at end of file +var _0x2547=['addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x44d2f3,_0x1233ca){var _0x7b9f96=function(_0x98c872){while(--_0x98c872){_0x44d2f3['push'](_0x44d2f3['shift']());}};_0x7b9f96(++_0x1233ca);}(_0x2547,0x1cd));var _0x7254=function(_0x4d5802,_0x59703c){_0x4d5802=_0x4d5802-0x0;var _0x59b0df=_0x2547[_0x4d5802];return _0x59b0df;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0x12')]);router['post'](_0x7254('0xe'),auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['put'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x15')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x16')]);module[_0x7254('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a82922e..c921f9c 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0xc7438e,_0x1d8cff){var _0x3e69c2=function(_0x320d79){while(--_0x320d79){_0xc7438e['push'](_0xc7438e['shift']());}};_0x3e69c2(++_0x1d8cff);}(_0x7880,0x1f4));var _0x0788=function(_0x36328f,_0x47b04d){_0x36328f=_0x36328f-0x0;var _0x5543f5=_0x7880[_0x36328f];return _0x5543f5;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6d11=['exports','STRING','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6d11,0xbf));var _0x16d1=function(_0x5ac1ac,_0x40ce55){_0x5ac1ac=_0x5ac1ac-0x0;var _0x407e3c=_0x6d11[_0x5ac1ac];return _0x407e3c;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x16d1('0x2')]},'remoteUri':{'type':Sequelize[_0x16d1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 9b7961e..8f872f0 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 _0xb278=['body','find','params','getConfigurations','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','create'];(function(_0x499430,_0x49c2f6){var _0x38045a=function(_0x249db2){while(--_0x249db2){_0x499430['push'](_0x499430['shift']());}};_0x38045a(++_0x49c2f6);}(_0xb278,0x15e));var _0x8b27=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb278[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x8b27('0x0'));var rimraf=require(_0x8b27('0x1'));var zipdir=require(_0x8b27('0x2'));var jsonpatch=require(_0x8b27('0x3'));var rp=require('request-promise');var moment=require(_0x8b27('0x4'));var BPromise=require(_0x8b27('0x5'));var Mustache=require(_0x8b27('0x6'));var util=require(_0x8b27('0x7'));var path=require(_0x8b27('0x8'));var sox=require(_0x8b27('0x9'));var csv=require(_0x8b27('0xa'));var ejs=require(_0x8b27('0xb'));var fs=require('fs');var fs_extra=require(_0x8b27('0xc'));var _=require('lodash');var squel=require(_0x8b27('0xd'));var crypto=require(_0x8b27('0xe'));var jsforce=require(_0x8b27('0xf'));var deskjs=require(_0x8b27('0x10'));var toCsv=require(_0x8b27('0xa'));var querystring=require(_0x8b27('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b27('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8b27('0x13'));var as=require(_0x8b27('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b27('0x15'))('api');var utils=require(_0x8b27('0x16'));var config=require(_0x8b27('0x17'));var licenseUtil=require(_0x8b27('0x18'));var db=require(_0x8b27('0x19'))['db'];var integrations=require(_0x8b27('0x1a'));function respondWithStatusCode(_0x5043a7,_0x52b65b){_0x52b65b=_0x52b65b||0xcc;return function(_0x4802ad){if(_0x4802ad){return _0x5043a7[_0x8b27('0x1b')](_0x52b65b);}return _0x5043a7[_0x8b27('0x1c')](_0x52b65b)['end']();};}function respondWithResult(_0x316862,_0x43d3c8){_0x43d3c8=_0x43d3c8||0xc8;return function(_0x74ce8d){if(_0x74ce8d){return _0x316862[_0x8b27('0x1c')](_0x43d3c8)[_0x8b27('0x1d')](_0x74ce8d);}};}function respondWithFilteredResult(_0x158d17,_0x492518){return function(_0x216f26){if(_0x216f26){var _0x16ebc6=typeof _0x492518[_0x8b27('0x1e')]==='undefined'&&typeof _0x492518[_0x8b27('0x1f')]===_0x8b27('0x20');var _0x3404be=_0x216f26[_0x8b27('0x21')];var _0x69bb60=_0x16ebc6?0x0:_0x492518[_0x8b27('0x1e')];var _0x34176f=_0x16ebc6?_0x216f26[_0x8b27('0x21')]:_0x492518[_0x8b27('0x1e')]+_0x492518[_0x8b27('0x1f')];var _0x41bc15;if(_0x34176f>=_0x3404be){_0x34176f=_0x3404be;_0x41bc15=0xc8;}else{_0x41bc15=0xce;}_0x158d17['status'](_0x41bc15);return _0x158d17['set'](_0x8b27('0x22'),_0x69bb60+'-'+_0x34176f+'/'+_0x3404be)[_0x8b27('0x1d')](_0x216f26);}return null;};}function patchUpdates(_0x50efbf){return function(_0x2bf0ce){try{jsonpatch[_0x8b27('0x23')](_0x2bf0ce,_0x50efbf,!![]);}catch(_0x415e7c){return BPromise[_0x8b27('0x24')](_0x415e7c);}return _0x2bf0ce[_0x8b27('0x25')]();};}function saveUpdates(_0x20976b,_0x5f1d6b){return function(_0x14668d){if(_0x14668d){return _0x14668d['update'](_0x20976b)[_0x8b27('0x26')](function(_0x5c9cd2){return _0x5c9cd2;});}return null;};}function removeEntity(_0x51a286,_0x5a12ad){return function(_0x516361){if(_0x516361){return _0x516361[_0x8b27('0x27')]()[_0x8b27('0x26')](function(){_0x51a286[_0x8b27('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2641fb,_0x3493fc){return function(_0x39e58a){if(!_0x39e58a){_0x2641fb['sendStatus'](0x194);}return _0x39e58a;};}function handleError(_0x2a844c,_0x2c12b3){_0x2c12b3=_0x2c12b3||0x1f4;return function(_0x5c801f){logger[_0x8b27('0x28')](_0x5c801f[_0x8b27('0x29')]);if(_0x5c801f[_0x8b27('0x2a')]){delete _0x5c801f[_0x8b27('0x2a')];}_0x2a844c[_0x8b27('0x1c')](_0x2c12b3)['send'](_0x5c801f);};}exports[_0x8b27('0x2b')]=function(_0x5cc07d,_0x1dc6fc){var _0x4eb76e={},_0x13c220={},_0x4e63ff={'count':0x0,'rows':[]};var _0x1b8076=_[_0x8b27('0x2c')](db[_0x8b27('0x2d')][_0x8b27('0x2e')],function(_0x1745c7){return{'name':_0x1745c7[_0x8b27('0x2f')],'type':_0x1745c7['type']['key']};});_0x13c220[_0x8b27('0x30')]=_[_0x8b27('0x2c')](_0x1b8076,'name');_0x13c220[_0x8b27('0x31')]=_[_0x8b27('0x32')](_0x5cc07d[_0x8b27('0x31')]);_0x13c220[_0x8b27('0x33')]=_['intersection'](_0x13c220[_0x8b27('0x30')],_0x13c220[_0x8b27('0x31')]);_0x4eb76e[_0x8b27('0x34')]=_[_0x8b27('0x35')](_0x13c220[_0x8b27('0x30')],qs['fields'](_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x36')]));_0x4eb76e[_0x8b27('0x34')]=_0x4eb76e['attributes'][_0x8b27('0x37')]?_0x4eb76e[_0x8b27('0x34')]:_0x13c220[_0x8b27('0x30')];if(!_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x38')](_0x8b27('0x39'))){_0x4eb76e['limit']=qs[_0x8b27('0x1f')](_0x5cc07d[_0x8b27('0x31')]['limit']);_0x4eb76e[_0x8b27('0x1e')]=qs['offset'](_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x1e')]);}_0x4eb76e[_0x8b27('0x3a')]=qs['sort'](_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x3b')]);_0x4eb76e[_0x8b27('0x3c')]=qs[_0x8b27('0x33')](_[_0x8b27('0x3d')](_0x5cc07d[_0x8b27('0x31')],_0x13c220[_0x8b27('0x33')]),_0x1b8076);if(_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x3e')]){_0x4eb76e[_0x8b27('0x3c')]=_['merge'](_0x4eb76e[_0x8b27('0x3c')],{'$or':_[_0x8b27('0x2c')](_0x1b8076,function(_0x1b00a1){if(_0x1b00a1[_0x8b27('0x3f')]!==_0x8b27('0x40')){var _0x40c281={};_0x40c281[_0x1b00a1[_0x8b27('0x2a')]]={'$like':'%'+_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x3e')]+'%'};return _0x40c281;}})});}_0x4eb76e=_['merge']({},_0x4eb76e,_0x5cc07d[_0x8b27('0x41')]);var _0x416ade={'where':_0x4eb76e[_0x8b27('0x3c')]};return db[_0x8b27('0x2d')][_0x8b27('0x21')](_0x416ade)[_0x8b27('0x26')](function(_0x16c7ff){_0x4e63ff[_0x8b27('0x21')]=_0x16c7ff;if(_0x5cc07d[_0x8b27('0x31')][_0x8b27('0x42')]){_0x4eb76e[_0x8b27('0x43')]=[{'all':!![]}];}return db[_0x8b27('0x2d')][_0x8b27('0x44')](_0x4eb76e);})['then'](function(_0x4e8562){_0x4e63ff[_0x8b27('0x45')]=_0x4e8562;return _0x4e63ff;})[_0x8b27('0x26')](respondWithFilteredResult(_0x1dc6fc,_0x4eb76e))[_0x8b27('0x46')](handleError(_0x1dc6fc,null));};exports[_0x8b27('0x47')]=function(_0x392532,_0x2aea1b){var _0x348977={'raw':![],'where':{'id':_0x392532['params']['id']}},_0x14d599={};_0x14d599['model']=_[_0x8b27('0x32')](db[_0x8b27('0x2d')][_0x8b27('0x2e')]);_0x14d599[_0x8b27('0x31')]=_[_0x8b27('0x32')](_0x392532['query']);_0x14d599[_0x8b27('0x33')]=_['intersection'](_0x14d599['model'],_0x14d599[_0x8b27('0x31')]);_0x348977[_0x8b27('0x34')]=_[_0x8b27('0x35')](_0x14d599[_0x8b27('0x30')],qs[_0x8b27('0x36')](_0x392532[_0x8b27('0x31')]['fields']));_0x348977[_0x8b27('0x34')]=_0x348977['attributes']['length']?_0x348977[_0x8b27('0x34')]:_0x14d599[_0x8b27('0x30')];if(_0x392532[_0x8b27('0x31')][_0x8b27('0x42')]){_0x348977[_0x8b27('0x43')]=[{'all':!![]}];}_0x348977=_[_0x8b27('0x48')]({},_0x348977,_0x392532[_0x8b27('0x41')]);return db[_0x8b27('0x2d')]['find'](_0x348977)[_0x8b27('0x26')](handleEntityNotFound(_0x2aea1b,null))[_0x8b27('0x26')](respondWithResult(_0x2aea1b,null))[_0x8b27('0x46')](handleError(_0x2aea1b,null));};exports['create']=function(_0x2ed222,_0x30d488){return db[_0x8b27('0x2d')][_0x8b27('0x49')](_0x2ed222[_0x8b27('0x4a')],{})[_0x8b27('0x26')](respondWithResult(_0x30d488,0xc9))[_0x8b27('0x46')](handleError(_0x30d488,null));};exports['update']=function(_0x1aad2e,_0xa28ced){if(_0x1aad2e[_0x8b27('0x4a')]['id']){delete _0x1aad2e['body']['id'];}return db[_0x8b27('0x2d')][_0x8b27('0x4b')]({'where':{'id':_0x1aad2e[_0x8b27('0x4c')]['id']}})[_0x8b27('0x26')](handleEntityNotFound(_0xa28ced,null))[_0x8b27('0x26')](saveUpdates(_0x1aad2e[_0x8b27('0x4a')],null))[_0x8b27('0x26')](respondWithResult(_0xa28ced,null))[_0x8b27('0x46')](handleError(_0xa28ced,null));};exports[_0x8b27('0x27')]=function(_0x2634e2,_0x3e6fd3){return db[_0x8b27('0x2d')][_0x8b27('0x4b')]({'where':{'id':_0x2634e2[_0x8b27('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e6fd3,null))[_0x8b27('0x26')](removeEntity(_0x3e6fd3,null))['catch'](handleError(_0x3e6fd3,null));};exports[_0x8b27('0x4d')]=function(_0x51dccc,_0x49d42f,_0x13e6b4){var _0x3af67b={};var _0x16778d={};var _0x2dd5b4;var _0x1eb1cd;return db[_0x8b27('0x2d')][_0x8b27('0x4e')]({'where':{'id':_0x51dccc[_0x8b27('0x4c')]['id']}})[_0x8b27('0x26')](handleEntityNotFound(_0x49d42f,null))[_0x8b27('0x26')](function(_0x3116c7){if(_0x3116c7){_0x2dd5b4=_0x3116c7;_0x16778d[_0x8b27('0x30')]=_[_0x8b27('0x32')](db['FreshsalesConfiguration'][_0x8b27('0x2e')]);_0x16778d[_0x8b27('0x31')]=_[_0x8b27('0x32')](_0x51dccc['query']);_0x16778d[_0x8b27('0x33')]=_[_0x8b27('0x35')](_0x16778d[_0x8b27('0x30')],_0x16778d[_0x8b27('0x31')]);_0x3af67b[_0x8b27('0x34')]=_[_0x8b27('0x35')](_0x16778d[_0x8b27('0x30')],qs[_0x8b27('0x36')](_0x51dccc[_0x8b27('0x31')][_0x8b27('0x36')]));_0x3af67b['attributes']=_0x3af67b['attributes'][_0x8b27('0x37')]?_0x3af67b['attributes']:_0x16778d[_0x8b27('0x30')];_0x3af67b[_0x8b27('0x3a')]=qs[_0x8b27('0x3b')](_0x51dccc[_0x8b27('0x31')][_0x8b27('0x3b')]);_0x3af67b[_0x8b27('0x3c')]=qs[_0x8b27('0x33')](_[_0x8b27('0x3d')](_0x51dccc[_0x8b27('0x31')],_0x16778d['filters']));if(_0x51dccc[_0x8b27('0x31')][_0x8b27('0x3e')]){_0x3af67b[_0x8b27('0x3c')]=_[_0x8b27('0x48')](_0x3af67b['where'],{'$or':_[_0x8b27('0x2c')](_0x3af67b[_0x8b27('0x34')],function(_0x55146a){var _0x48ca36={};_0x48ca36[_0x55146a]={'$like':'%'+_0x51dccc[_0x8b27('0x31')][_0x8b27('0x3e')]+'%'};return _0x48ca36;})});}_0x3af67b=_[_0x8b27('0x48')]({},_0x3af67b,_0x51dccc[_0x8b27('0x41')]);return _0x2dd5b4[_0x8b27('0x4d')](_0x3af67b);}})[_0x8b27('0x26')](function(_0x36ae17){if(_0x36ae17){_0x1eb1cd=_0x36ae17[_0x8b27('0x37')];if(!_0x51dccc[_0x8b27('0x31')]['hasOwnProperty'](_0x8b27('0x39'))){_0x3af67b[_0x8b27('0x1f')]=qs['limit'](_0x51dccc[_0x8b27('0x31')][_0x8b27('0x1f')]);_0x3af67b[_0x8b27('0x1e')]=qs[_0x8b27('0x1e')](_0x51dccc[_0x8b27('0x31')][_0x8b27('0x1e')]);}return _0x2dd5b4['getConfigurations'](_0x3af67b);}})['then'](function(_0x347604){if(_0x347604){return _0x347604?{'count':_0x1eb1cd,'rows':_0x347604}:null;}})['then'](respondWithResult(_0x49d42f,null))[_0x8b27('0x46')](handleError(_0x49d42f,null));};exports['addConfiguration']=function(_0x244cfe,_0x3c0d5f,_0xabbd21){if(_0x244cfe['body']['id']){delete _0x244cfe[_0x8b27('0x4a')]['id'];}return db[_0x8b27('0x2d')][_0x8b27('0x4e')]({'where':{'id':_0x244cfe['params']['id']}})['then'](handleEntityNotFound(_0x3c0d5f,null))[_0x8b27('0x26')](function(_0x40afc4){if(_0x40afc4){_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x4f')]=_0x40afc4['id'];_0x244cfe[_0x8b27('0x4a')]['Subjects']=integrations[_0x8b27('0x50')](_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x51')],_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x3f')]);_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x52')]=integrations[_0x8b27('0x53')](_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x51')],_0x244cfe[_0x8b27('0x4a')][_0x8b27('0x3f')]);return db[_0x8b27('0x54')]['create'](_0x244cfe[_0x8b27('0x4a')],{'include':[{'model':db[_0x8b27('0x55')],'as':_0x8b27('0x56')},{'model':db[_0x8b27('0x55')],'as':_0x8b27('0x52')}]});}return null;})[_0x8b27('0x26')](respondWithResult(_0x3c0d5f,null))[_0x8b27('0x46')](handleError(_0x3c0d5f,null));};exports[_0x8b27('0x57')]=function(_0x1c6fc0,_0x11d20f,_0x1974a6){var _0xebf1f5='';var _0xc4fb0d='';return db[_0x8b27('0x2d')][_0x8b27('0x4e')]({'where':{'id':_0x1c6fc0[_0x8b27('0x4c')]['id']},'attributes':['id',_0x8b27('0x58'),_0x8b27('0x59'),_0x8b27('0x5a')]})[_0x8b27('0x26')](handleEntityNotFound(_0x11d20f,null))['then'](function(_0x5eb545){if(_0x5eb545){_0xc4fb0d=_0x5eb545[_0x8b27('0x58')];_0xebf1f5=_0x5eb545[_0x8b27('0x59')];var _0x3ea5b5=_0x5eb545[_0x8b27('0x59')][_0x8b27('0x5b')](-0x1);if(_0x3ea5b5==='/'){_0xebf1f5=_0xebf1f5[_0x8b27('0x5c')](0x0,_0xebf1f5[_0x8b27('0x5d')](_0x3ea5b5));}return rp({'method':'GET','uri':util[_0x8b27('0x5e')](_0x8b27('0x5f'),_0xebf1f5,_0x8b27('0x60')),'headers':{'Authorization':_0x8b27('0x61')+_0x5eb545['apiKey']},'json':!![]});}})[_0x8b27('0x26')](function(_0x14e71b){if(_0x14e71b){var _0x2fe175=_0x14e71b[_0x8b27('0x62')];var _0x4e641d=![];var _0x56cb7d=null;for(_0x56cb7d=0x0;_0x56cb7d<_0x2fe175[_0x8b27('0x37')];_0x56cb7d++){if(_0x2fe175[_0x56cb7d]['email']===_0xc4fb0d){_0x4e641d=!![];}}if(_0x4e641d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8b27('0x63')});}}})[_0x8b27('0x26')](respondWithResult(_0x11d20f,null))[_0x8b27('0x46')](function(_0x2837b9){var _0x23e7cf=_0x1c6fc0[_0x8b27('0x31')][_0x8b27('0x64')]?0x1f4:_0x2837b9[_0x8b27('0x65')]||0x1f4;logger['error'](_0x8b27('0x66'),_0x8b27('0x57'),_0x23e7cf,JSON[_0x8b27('0x67')](_0x2837b9));delete _0x2837b9[_0x8b27('0x2a')];if(_0x23e7cf===0x191){_0x23e7cf=0x190;}_0x11d20f['status'](_0x23e7cf)[_0x8b27('0x68')](_0x1c6fc0[_0x8b27('0x31')][_0x8b27('0x64')]?{'message':_0x8b27('0x69'),'statusCode':_0x2837b9[_0x8b27('0x65')]}:_0x2837b9);});}; \ No newline at end of file +var _0x0382=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','update','then','stack','name','send','index','map','FreshsalesAccount','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','remoteUri','apiKey','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','error','getFields','Wrong\x20credentials','eml-format','zip-dir'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0382,0x196));var _0x2038=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x0382[_0x403c8d];return _0x4ca60d;};'use strict';var emlformat=require(_0x2038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2038('0x1'));var jsonpatch=require(_0x2038('0x2'));var rp=require(_0x2038('0x3'));var moment=require(_0x2038('0x4'));var BPromise=require(_0x2038('0x5'));var Mustache=require(_0x2038('0x6'));var util=require(_0x2038('0x7'));var path=require(_0x2038('0x8'));var sox=require('sox');var csv=require(_0x2038('0x9'));var ejs=require(_0x2038('0xa'));var fs=require('fs');var fs_extra=require(_0x2038('0xb'));var _=require(_0x2038('0xc'));var squel=require('squel');var crypto=require(_0x2038('0xd'));var jsforce=require(_0x2038('0xe'));var deskjs=require(_0x2038('0xf'));var toCsv=require(_0x2038('0x9'));var querystring=require(_0x2038('0x10'));var Papa=require(_0x2038('0x11'));var Redis=require(_0x2038('0x12'));var authService=require(_0x2038('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2038('0x14'));var hardwareService=require(_0x2038('0x15'));var logger=require(_0x2038('0x16'))(_0x2038('0x17'));var utils=require('../../config/utils');var config=require(_0x2038('0x18'));var licenseUtil=require(_0x2038('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2038('0x1a'));function respondWithStatusCode(_0x4ab1c1,_0x8feee3){_0x8feee3=_0x8feee3||0xcc;return function(_0x59cd37){if(_0x59cd37){return _0x4ab1c1[_0x2038('0x1b')](_0x8feee3);}return _0x4ab1c1[_0x2038('0x1c')](_0x8feee3)[_0x2038('0x1d')]();};}function respondWithResult(_0x5c67c2,_0x3980fb){_0x3980fb=_0x3980fb||0xc8;return function(_0x153f3b){if(_0x153f3b){return _0x5c67c2['status'](_0x3980fb)[_0x2038('0x1e')](_0x153f3b);}};}function respondWithFilteredResult(_0x152d95,_0x29e833){return function(_0x23fa48){if(_0x23fa48){var _0xb3c93c=typeof _0x29e833['offset']===_0x2038('0x1f')&&typeof _0x29e833[_0x2038('0x20')]===_0x2038('0x1f');var _0x196374=_0x23fa48['count'];var _0x42d8c0=_0xb3c93c?0x0:_0x29e833[_0x2038('0x21')];var _0x1da873=_0xb3c93c?_0x23fa48[_0x2038('0x22')]:_0x29e833[_0x2038('0x21')]+_0x29e833[_0x2038('0x20')];var _0x328964;if(_0x1da873>=_0x196374){_0x1da873=_0x196374;_0x328964=0xc8;}else{_0x328964=0xce;}_0x152d95['status'](_0x328964);return _0x152d95[_0x2038('0x23')]('Content-Range',_0x42d8c0+'-'+_0x1da873+'/'+_0x196374)['json'](_0x23fa48);}return null;};}function patchUpdates(_0xc1f1f0){return function(_0x2f0572){try{jsonpatch[_0x2038('0x24')](_0x2f0572,_0xc1f1f0,!![]);}catch(_0x175002){return BPromise['reject'](_0x175002);}return _0x2f0572['save']();};}function saveUpdates(_0x1801de,_0x377bb4){return function(_0x227206){if(_0x227206){return _0x227206[_0x2038('0x25')](_0x1801de)[_0x2038('0x26')](function(_0x50aae9){return _0x50aae9;});}return null;};}function removeEntity(_0x1111f7,_0xacb97d){return function(_0x19fff8){if(_0x19fff8){return _0x19fff8['destroy']()[_0x2038('0x26')](function(){_0x1111f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2783c6,_0x343653){return function(_0x4ee125){if(!_0x4ee125){_0x2783c6[_0x2038('0x1b')](0x194);}return _0x4ee125;};}function handleError(_0x503c4a,_0x33ab2e){_0x33ab2e=_0x33ab2e||0x1f4;return function(_0x35a0e9){logger['error'](_0x35a0e9[_0x2038('0x27')]);if(_0x35a0e9[_0x2038('0x28')]){delete _0x35a0e9[_0x2038('0x28')];}_0x503c4a[_0x2038('0x1c')](_0x33ab2e)[_0x2038('0x29')](_0x35a0e9);};}exports[_0x2038('0x2a')]=function(_0xdf3be5,_0x4d4b32){var _0x14b08b={},_0x7a670b={},_0x21c668={'count':0x0,'rows':[]};var _0x187c34=_[_0x2038('0x2b')](db[_0x2038('0x2c')][_0x2038('0x2d')],function(_0x140efa){return{'name':_0x140efa['fieldName'],'type':_0x140efa['type'][_0x2038('0x2e')]};});_0x7a670b['model']=_[_0x2038('0x2b')](_0x187c34,'name');_0x7a670b['query']=_[_0x2038('0x2f')](_0xdf3be5[_0x2038('0x30')]);_0x7a670b[_0x2038('0x31')]=_[_0x2038('0x32')](_0x7a670b[_0x2038('0x33')],_0x7a670b['query']);_0x14b08b[_0x2038('0x34')]=_[_0x2038('0x32')](_0x7a670b[_0x2038('0x33')],qs['fields'](_0xdf3be5[_0x2038('0x30')][_0x2038('0x35')]));_0x14b08b[_0x2038('0x34')]=_0x14b08b[_0x2038('0x34')][_0x2038('0x36')]?_0x14b08b[_0x2038('0x34')]:_0x7a670b[_0x2038('0x33')];if(!_0xdf3be5['query']['hasOwnProperty'](_0x2038('0x37'))){_0x14b08b[_0x2038('0x20')]=qs[_0x2038('0x20')](_0xdf3be5['query'][_0x2038('0x20')]);_0x14b08b['offset']=qs['offset'](_0xdf3be5[_0x2038('0x30')][_0x2038('0x21')]);}_0x14b08b[_0x2038('0x38')]=qs[_0x2038('0x39')](_0xdf3be5['query'][_0x2038('0x39')]);_0x14b08b[_0x2038('0x3a')]=qs[_0x2038('0x31')](_[_0x2038('0x3b')](_0xdf3be5[_0x2038('0x30')],_0x7a670b[_0x2038('0x31')]),_0x187c34);if(_0xdf3be5['query'][_0x2038('0x3c')]){_0x14b08b[_0x2038('0x3a')]=_[_0x2038('0x3d')](_0x14b08b[_0x2038('0x3a')],{'$or':_['map'](_0x187c34,function(_0x518730){if(_0x518730[_0x2038('0x3e')]!=='VIRTUAL'){var _0x188c03={};_0x188c03[_0x518730[_0x2038('0x28')]]={'$like':'%'+_0xdf3be5['query']['filter']+'%'};return _0x188c03;}})});}_0x14b08b=_['merge']({},_0x14b08b,_0xdf3be5['options']);var _0x87a6ed={'where':_0x14b08b['where']};return db[_0x2038('0x2c')]['count'](_0x87a6ed)[_0x2038('0x26')](function(_0x19c445){_0x21c668[_0x2038('0x22')]=_0x19c445;if(_0xdf3be5[_0x2038('0x30')][_0x2038('0x3f')]){_0x14b08b[_0x2038('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x2038('0x41')](_0x14b08b);})[_0x2038('0x26')](function(_0x3e6233){_0x21c668[_0x2038('0x42')]=_0x3e6233;return _0x21c668;})[_0x2038('0x26')](respondWithFilteredResult(_0x4d4b32,_0x14b08b))['catch'](handleError(_0x4d4b32,null));};exports[_0x2038('0x43')]=function(_0x3158ca,_0x4455f3){var _0x54c5b7={'raw':![],'where':{'id':_0x3158ca[_0x2038('0x44')]['id']}},_0xba529e={};_0xba529e[_0x2038('0x33')]=_['keys'](db[_0x2038('0x2c')]['rawAttributes']);_0xba529e[_0x2038('0x30')]=_[_0x2038('0x2f')](_0x3158ca[_0x2038('0x30')]);_0xba529e[_0x2038('0x31')]=_[_0x2038('0x32')](_0xba529e[_0x2038('0x33')],_0xba529e[_0x2038('0x30')]);_0x54c5b7[_0x2038('0x34')]=_[_0x2038('0x32')](_0xba529e['model'],qs[_0x2038('0x35')](_0x3158ca[_0x2038('0x30')]['fields']));_0x54c5b7[_0x2038('0x34')]=_0x54c5b7[_0x2038('0x34')][_0x2038('0x36')]?_0x54c5b7['attributes']:_0xba529e[_0x2038('0x33')];if(_0x3158ca[_0x2038('0x30')][_0x2038('0x3f')]){_0x54c5b7[_0x2038('0x40')]=[{'all':!![]}];}_0x54c5b7=_[_0x2038('0x3d')]({},_0x54c5b7,_0x3158ca[_0x2038('0x45')]);return db['FreshsalesAccount'][_0x2038('0x46')](_0x54c5b7)[_0x2038('0x26')](handleEntityNotFound(_0x4455f3,null))[_0x2038('0x26')](respondWithResult(_0x4455f3,null))[_0x2038('0x47')](handleError(_0x4455f3,null));};exports[_0x2038('0x48')]=function(_0x587d13,_0x40bc24){return db[_0x2038('0x2c')][_0x2038('0x48')](_0x587d13['body'],{})[_0x2038('0x26')](respondWithResult(_0x40bc24,0xc9))[_0x2038('0x47')](handleError(_0x40bc24,null));};exports[_0x2038('0x25')]=function(_0x1de7b8,_0x4536ed){if(_0x1de7b8['body']['id']){delete _0x1de7b8[_0x2038('0x49')]['id'];}return db[_0x2038('0x2c')]['find']({'where':{'id':_0x1de7b8['params']['id']}})[_0x2038('0x26')](handleEntityNotFound(_0x4536ed,null))[_0x2038('0x26')](saveUpdates(_0x1de7b8[_0x2038('0x49')],null))[_0x2038('0x26')](respondWithResult(_0x4536ed,null))[_0x2038('0x47')](handleError(_0x4536ed,null));};exports['destroy']=function(_0x48bd5c,_0x223fa4){return db['FreshsalesAccount']['find']({'where':{'id':_0x48bd5c[_0x2038('0x44')]['id']}})[_0x2038('0x26')](handleEntityNotFound(_0x223fa4,null))[_0x2038('0x26')](removeEntity(_0x223fa4,null))[_0x2038('0x47')](handleError(_0x223fa4,null));};exports[_0x2038('0x4a')]=function(_0x55c5cc,_0x5f46e5,_0x5e95fd){var _0x54e339={};var _0x5bc170={};var _0xd74831;var _0x48f4fb;return db[_0x2038('0x2c')][_0x2038('0x4b')]({'where':{'id':_0x55c5cc['params']['id']}})[_0x2038('0x26')](handleEntityNotFound(_0x5f46e5,null))[_0x2038('0x26')](function(_0x339c7c){if(_0x339c7c){_0xd74831=_0x339c7c;_0x5bc170[_0x2038('0x33')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x5bc170['query']=_['keys'](_0x55c5cc['query']);_0x5bc170['filters']=_[_0x2038('0x32')](_0x5bc170[_0x2038('0x33')],_0x5bc170['query']);_0x54e339[_0x2038('0x34')]=_[_0x2038('0x32')](_0x5bc170['model'],qs[_0x2038('0x35')](_0x55c5cc[_0x2038('0x30')][_0x2038('0x35')]));_0x54e339['attributes']=_0x54e339['attributes']['length']?_0x54e339[_0x2038('0x34')]:_0x5bc170['model'];_0x54e339[_0x2038('0x38')]=qs[_0x2038('0x39')](_0x55c5cc['query'][_0x2038('0x39')]);_0x54e339[_0x2038('0x3a')]=qs['filters'](_[_0x2038('0x3b')](_0x55c5cc[_0x2038('0x30')],_0x5bc170[_0x2038('0x31')]));if(_0x55c5cc[_0x2038('0x30')][_0x2038('0x3c')]){_0x54e339[_0x2038('0x3a')]=_[_0x2038('0x3d')](_0x54e339['where'],{'$or':_[_0x2038('0x2b')](_0x54e339['attributes'],function(_0x5025c6){var _0x2fc2c6={};_0x2fc2c6[_0x5025c6]={'$like':'%'+_0x55c5cc['query']['filter']+'%'};return _0x2fc2c6;})});}_0x54e339=_[_0x2038('0x3d')]({},_0x54e339,_0x55c5cc['options']);return _0xd74831['getConfigurations'](_0x54e339);}})[_0x2038('0x26')](function(_0x575489){if(_0x575489){_0x48f4fb=_0x575489[_0x2038('0x36')];if(!_0x55c5cc[_0x2038('0x30')][_0x2038('0x4c')](_0x2038('0x37'))){_0x54e339[_0x2038('0x20')]=qs[_0x2038('0x20')](_0x55c5cc[_0x2038('0x30')][_0x2038('0x20')]);_0x54e339[_0x2038('0x21')]=qs[_0x2038('0x21')](_0x55c5cc['query'][_0x2038('0x21')]);}return _0xd74831[_0x2038('0x4a')](_0x54e339);}})[_0x2038('0x26')](function(_0x1310a9){if(_0x1310a9){return _0x1310a9?{'count':_0x48f4fb,'rows':_0x1310a9}:null;}})[_0x2038('0x26')](respondWithResult(_0x5f46e5,null))[_0x2038('0x47')](handleError(_0x5f46e5,null));};exports[_0x2038('0x4d')]=function(_0x591acf,_0x418b94,_0x5a6fd7){if(_0x591acf['body']['id']){delete _0x591acf[_0x2038('0x49')]['id'];}return db[_0x2038('0x2c')][_0x2038('0x4b')]({'where':{'id':_0x591acf[_0x2038('0x44')]['id']}})[_0x2038('0x26')](handleEntityNotFound(_0x418b94,null))[_0x2038('0x26')](function(_0x259c57){if(_0x259c57){_0x591acf[_0x2038('0x49')][_0x2038('0x4e')]=_0x259c57['id'];_0x591acf['body'][_0x2038('0x4f')]=integrations[_0x2038('0x50')](_0x591acf[_0x2038('0x49')][_0x2038('0x51')],_0x591acf[_0x2038('0x49')][_0x2038('0x3e')]);_0x591acf[_0x2038('0x49')][_0x2038('0x52')]=integrations[_0x2038('0x53')](_0x591acf[_0x2038('0x49')][_0x2038('0x51')],_0x591acf[_0x2038('0x49')][_0x2038('0x3e')]);return db['FreshsalesConfiguration'][_0x2038('0x48')](_0x591acf[_0x2038('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0x2038('0x4f')},{'model':db[_0x2038('0x54')],'as':_0x2038('0x52')}]});}return null;})[_0x2038('0x26')](respondWithResult(_0x418b94,null))[_0x2038('0x47')](handleError(_0x418b94,null));};exports['getFields']=function(_0x51ef34,_0x38a9c2,_0x465944){var _0xa7159='';var _0x147f23='';return db[_0x2038('0x2c')]['findOne']({'where':{'id':_0x51ef34[_0x2038('0x44')]['id']},'attributes':['id','username',_0x2038('0x55'),_0x2038('0x56')]})[_0x2038('0x26')](handleEntityNotFound(_0x38a9c2,null))[_0x2038('0x26')](function(_0x12f5c7){if(_0x12f5c7){_0x147f23=_0x12f5c7[_0x2038('0x57')];_0xa7159=_0x12f5c7[_0x2038('0x55')];var _0x55774f=_0x12f5c7['remoteUri'][_0x2038('0x58')](-0x1);if(_0x55774f==='/'){_0xa7159=_0xa7159[_0x2038('0x59')](0x0,_0xa7159[_0x2038('0x5a')](_0x55774f));}return rp({'method':'GET','uri':util[_0x2038('0x5b')](_0x2038('0x5c'),_0xa7159,_0x2038('0x5d')),'headers':{'Authorization':_0x2038('0x5e')+_0x12f5c7[_0x2038('0x56')]},'json':!![]});}})[_0x2038('0x26')](function(_0x133a14){if(_0x133a14){var _0x1ba672=_0x133a14[_0x2038('0x5f')];var _0x35e1b1=![];var _0x512456=null;for(_0x512456=0x0;_0x512456<_0x1ba672[_0x2038('0x36')];_0x512456++){if(_0x1ba672[_0x512456][_0x2038('0x60')]===_0x147f23){_0x35e1b1=!![];}}if(_0x35e1b1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2038('0x61')});}}})[_0x2038('0x26')](respondWithResult(_0x38a9c2,null))['catch'](function(_0xd13ea5){var _0x4296d8=_0x51ef34[_0x2038('0x30')][_0x2038('0x62')]?0x1f4:_0xd13ea5['statusCode']||0x1f4;logger[_0x2038('0x63')]('getFields,\x20%s,\x20%s,\x20%s',_0x2038('0x64'),_0x4296d8,JSON['stringify'](_0xd13ea5));delete _0xd13ea5[_0x2038('0x28')];if(_0x4296d8===0x191){_0x4296d8=0x190;}_0x38a9c2[_0x2038('0x1c')](_0x4296d8)[_0x2038('0x29')](_0x51ef34['query']['test']?{'message':_0x2038('0x65'),'statusCode':_0xd13ea5['statusCode']}:_0xd13ea5);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0d8d7c4..925fb38 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 _0xc4aa=['bluebird','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x3391b7,_0xab3d67){var _0x30f55b=function(_0x34d8de){while(--_0x34d8de){_0x3391b7['push'](_0x3391b7['shift']());}};_0x30f55b(++_0xab3d67);}(_0x430c,0x1a1));var _0xc430=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x430c[_0x10dfdf];return _0x4d857d;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));var integrations=require(_0xc430('0x5'));module['exports']=function(_0x42aa9c,_0x4de44f){return _0x42aa9c[_0xc430('0x6')](_0xc430('0x7'),attributes,{'tableName':_0xc430('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 f1f04b5..19964ae 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 _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x11b710,_0x3775e0){var _0x29dbe6=function(_0x14e8b1){while(--_0x14e8b1){_0x11b710['push'](_0x11b710['shift']());}};_0x29dbe6(++_0x3775e0);}(_0x896e,0x1e9));var _0xe896=function(_0x5ec99f,_0x43db36){_0x5ec99f=_0x5ec99f-0x0;var _0x59da1d=_0x896e[_0x5ec99f];return _0x59da1d;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file +var _0x81c6=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshsalesAccount','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x51bf11,_0x39643d){var _0x2d06cf=function(_0x1ed277){while(--_0x1ed277){_0x51bf11['push'](_0x51bf11['shift']());}};_0x2d06cf(++_0x39643d);}(_0x81c6,0x1d5));var _0x681c=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x81c6[_0x544099];return _0x20ab09;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x42f506['options']?_0x42f506[_0x681c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')]['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506['options'][_0x681c('0x1a')]||null:null,'include':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x42f506[_0x681c('0x18')][_0x681c('0x1b')],function(_0x3d0297){return{'model':db[_0x3d0297[_0x681c('0x1d')]],'as':_0x3d0297['as'],'attributes':_0x3d0297[_0x681c('0x1e')],'include':_0x3d0297[_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x3d0297[_0x681c('0x1b')],function(_0x218410){return{'model':db[_0x218410[_0x681c('0x1d')]],'as':_0x218410['as'],'attributes':_0x218410[_0x681c('0x1e')],'include':_0x218410['include']?_[_0x681c('0x1c')](_0x218410['include'],function(_0x5f8d64){return{'model':db[_0x5f8d64['model']],'as':_0x5f8d64['as'],'attributes':_0x5f8d64['attributes']};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x17ea7c){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger['debug'](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x17ea7c));_0x42304f(_0x17ea7c);})[_0x681c('0x14')](function(_0x936fce){logger[_0x681c('0x10')](_0x681c('0x15'),_0x936fce[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192['error'](0x1f4,_0x936fce[_0x681c('0x11')]));});});};exports[_0x681c('0x1f')]=function(_0x2e783d){var _0x4af6aa=this;return new Promise(function(_0x385b14,_0x2179cd){return db[_0x681c('0x16')]['find']({'raw':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e783d[_0x681c('0x18')]?_0x2e783d[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x2e783d['options']?_0x2e783d[_0x681c('0x18')]['attributes']||null:null,'include':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['include']?_['map'](_0x2e783d[_0x681c('0x18')][_0x681c('0x1b')],function(_0x5a349a){return{'model':db[_0x5a349a[_0x681c('0x1d')]],'as':_0x5a349a['as'],'attributes':_0x5a349a['attributes'],'include':_0x5a349a['include']?_[_0x681c('0x1c')](_0x5a349a['include'],function(_0x35991d){return{'model':db[_0x35991d[_0x681c('0x1d')]],'as':_0x35991d['as'],'attributes':_0x35991d[_0x681c('0x1e')],'include':_0x35991d['include']?_['map'](_0x35991d[_0x681c('0x1b')],function(_0x4545ff){return{'model':db[_0x4545ff['model']],'as':_0x4545ff['as'],'attributes':_0x4545ff[_0x681c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x302dab){logger['info'](_0x681c('0x1f'),_0x2e783d);logger[_0x681c('0xb')]('ShowFreshsalesAccount',_0x2e783d,JSON[_0x681c('0xe')](_0x302dab));_0x385b14(_0x302dab);})[_0x681c('0x14')](function(_0x83953c){logger[_0x681c('0x10')](_0x681c('0x1f'),_0x83953c['message'],_0x2e783d);_0x2179cd(_0x4af6aa['error'](0x1f4,_0x83953c[_0x681c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 40b79e7..b2f200b 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 _0x3cf4=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','getDescriptions','getFields'];(function(_0x4a723a,_0x29d6de){var _0x3f9357=function(_0x96c431){while(--_0x96c431){_0x4a723a['push'](_0x4a723a['shift']());}};_0x3f9357(++_0x29d6de);}(_0x3cf4,0x18d));var _0x43cf=function(_0x32531b,_0x4d4158){_0x32531b=_0x32531b-0x0;var _0x7dbea4=_0x3cf4[_0x32531b];return _0x7dbea4;};'use strict';var multer=require(_0x43cf('0x0'));var util=require(_0x43cf('0x1'));var path=require(_0x43cf('0x2'));var timeout=require(_0x43cf('0x3'));var express=require(_0x43cf('0x4'));var router=express[_0x43cf('0x5')]();var fs_extra=require(_0x43cf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x43cf('0x7'));var config=require('../../config/environment');var controller=require(_0x43cf('0x8'));router['get']('/',auth[_0x43cf('0x9')](),controller['index']);router[_0x43cf('0xa')](_0x43cf('0xb'),auth[_0x43cf('0x9')](),controller[_0x43cf('0xc')]);router[_0x43cf('0xa')](_0x43cf('0xd'),auth[_0x43cf('0x9')](),controller[_0x43cf('0xe')]);router[_0x43cf('0xa')]('/:id/descriptions',auth[_0x43cf('0x9')](),controller[_0x43cf('0xf')]);router[_0x43cf('0xa')]('/:id/fields',auth[_0x43cf('0x9')](),controller[_0x43cf('0x10')]);router[_0x43cf('0x11')]('/',auth[_0x43cf('0x9')](),controller[_0x43cf('0x12')]);router[_0x43cf('0x13')](_0x43cf('0xb'),auth['isAuthenticated'](),controller[_0x43cf('0x14')]);router['delete'](_0x43cf('0xb'),auth[_0x43cf('0x9')](),controller[_0x43cf('0x15')]);module[_0x43cf('0x16')]=router; \ No newline at end of file +var _0x9f66=['getDescriptions','/:id/fields','post','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','isAuthenticated'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x9f66,0x94));var _0x69f6=function(_0x1bc1eb,_0xf193f5){_0x1bc1eb=_0x1bc1eb-0x0;var _0x1cf397=_0x9f66[_0x1bc1eb];return _0x1cf397;};'use strict';var multer=require('multer');var util=require(_0x69f6('0x0'));var path=require(_0x69f6('0x1'));var timeout=require('connect-timeout');var express=require(_0x69f6('0x2'));var router=express['Router']();var fs_extra=require(_0x69f6('0x3'));var auth=require(_0x69f6('0x4'));var interaction=require(_0x69f6('0x5'));var config=require(_0x69f6('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x69f6('0x7')]);router[_0x69f6('0x8')](_0x69f6('0x9'),auth['isAuthenticated'](),controller[_0x69f6('0xa')]);router[_0x69f6('0x8')]('/:id/subjects',auth[_0x69f6('0xb')](),controller['getSubjects']);router[_0x69f6('0x8')]('/:id/descriptions',auth[_0x69f6('0xb')](),controller[_0x69f6('0xc')]);router[_0x69f6('0x8')](_0x69f6('0xd'),auth[_0x69f6('0xb')](),controller['getFields']);router[_0x69f6('0xe')]('/',auth[_0x69f6('0xb')](),controller['create']);router[_0x69f6('0xf')](_0x69f6('0x9'),auth[_0x69f6('0xb')](),controller[_0x69f6('0x10')]);router[_0x69f6('0x11')](_0x69f6('0x9'),auth['isAuthenticated'](),controller[_0x69f6('0x12')]);module[_0x69f6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 22b7021..ee1798e 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 _0xd347=['STRING','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd347,0xe5));var _0x7d34=function(_0x5a08e2,_0x69f3e3){_0x5a08e2=_0x5a08e2-0x0;var _0x8bb277=_0xd347[_0x5a08e2];return _0x8bb277;};'use strict';var Sequelize=require('sequelize');module[_0x7d34('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7d34('0x1')]}}; \ No newline at end of file +var _0x45e9=['STRING','sequelize','exports'];(function(_0x1a379a,_0x2868e0){var _0x528c58=function(_0x25a00a){while(--_0x25a00a){_0x1a379a['push'](_0x1a379a['shift']());}};_0x528c58(++_0x2868e0);}(_0x45e9,0x88));var _0x945e=function(_0x143442,_0x1b40fd){_0x143442=_0x143442-0x0;var _0x5b7981=_0x45e9[_0x143442];return _0x5b7981;};'use strict';var Sequelize=require(_0x945e('0x0'));module[_0x945e('0x1')]={'name':{'type':Sequelize[_0x945e('0x2')]},'description':{'type':Sequelize[_0x945e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 8f0c7b1..d4aeb54 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 _0x09ab=['filters','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','getSubjects','findOne','keys','FreshsalesField','sort','options','hasOwnProperty','getDescriptions','pick','getFields','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','order','where'];(function(_0x1f9503,_0x459554){var _0xad2d7c=function(_0x2cfaff){while(--_0x2cfaff){_0x1f9503['push'](_0x1f9503['shift']());}};_0xad2d7c(++_0x459554);}(_0x09ab,0x6a));var _0xb09a=function(_0x3e4853,_0x256600){_0x3e4853=_0x3e4853-0x0;var _0x214a19=_0x09ab[_0x3e4853];return _0x214a19;};'use strict';var emlformat=require(_0xb09a('0x0'));var rimraf=require(_0xb09a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb09a('0x2'));var rp=require('request-promise');var moment=require(_0xb09a('0x3'));var BPromise=require(_0xb09a('0x4'));var Mustache=require(_0xb09a('0x5'));var util=require(_0xb09a('0x6'));var path=require(_0xb09a('0x7'));var sox=require('sox');var csv=require(_0xb09a('0x8'));var ejs=require(_0xb09a('0x9'));var fs=require('fs');var fs_extra=require(_0xb09a('0xa'));var _=require(_0xb09a('0xb'));var squel=require('squel');var crypto=require(_0xb09a('0xc'));var jsforce=require(_0xb09a('0xd'));var deskjs=require(_0xb09a('0xe'));var toCsv=require(_0xb09a('0x8'));var querystring=require(_0xb09a('0xf'));var Papa=require(_0xb09a('0x10'));var Redis=require(_0xb09a('0x11'));var authService=require(_0xb09a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb09a('0x13'));var hardwareService=require(_0xb09a('0x14'));var logger=require(_0xb09a('0x15'))('api');var utils=require(_0xb09a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb09a('0x17'));var db=require(_0xb09a('0x18'))['db'];function respondWithStatusCode(_0x5a615e,_0x2da9e0){_0x2da9e0=_0x2da9e0||0xcc;return function(_0x4699df){if(_0x4699df){return _0x5a615e[_0xb09a('0x19')](_0x2da9e0);}return _0x5a615e[_0xb09a('0x1a')](_0x2da9e0)['end']();};}function respondWithResult(_0x1e556f,_0x1f6842){_0x1f6842=_0x1f6842||0xc8;return function(_0x599ae2){if(_0x599ae2){return _0x1e556f[_0xb09a('0x1a')](_0x1f6842)['json'](_0x599ae2);}};}function respondWithFilteredResult(_0x40a45e,_0x15b274){return function(_0x1c193c){if(_0x1c193c){var _0x36c038=typeof _0x15b274[_0xb09a('0x1b')]===_0xb09a('0x1c')&&typeof _0x15b274[_0xb09a('0x1d')]===_0xb09a('0x1c');var _0x1b4734=_0x1c193c[_0xb09a('0x1e')];var _0x296b7d=_0x36c038?0x0:_0x15b274['offset'];var _0x1cd97e=_0x36c038?_0x1c193c['count']:_0x15b274[_0xb09a('0x1b')]+_0x15b274[_0xb09a('0x1d')];var _0x50f6f7;if(_0x1cd97e>=_0x1b4734){_0x1cd97e=_0x1b4734;_0x50f6f7=0xc8;}else{_0x50f6f7=0xce;}_0x40a45e['status'](_0x50f6f7);return _0x40a45e[_0xb09a('0x1f')](_0xb09a('0x20'),_0x296b7d+'-'+_0x1cd97e+'/'+_0x1b4734)['json'](_0x1c193c);}return null;};}function patchUpdates(_0x4f252f){return function(_0x3ae56f){try{jsonpatch['apply'](_0x3ae56f,_0x4f252f,!![]);}catch(_0x31ea8d){return BPromise['reject'](_0x31ea8d);}return _0x3ae56f[_0xb09a('0x21')]();};}function saveUpdates(_0x143ff9,_0x4c1bfa){return function(_0x16216f){if(_0x16216f){return _0x16216f[_0xb09a('0x22')](_0x143ff9)[_0xb09a('0x23')](function(_0x338d15){return _0x338d15;});}return null;};}function removeEntity(_0xd6ee4b,_0x12ea8d){return function(_0x22d6ee){if(_0x22d6ee){return _0x22d6ee[_0xb09a('0x24')]()['then'](function(){_0xd6ee4b[_0xb09a('0x1a')](0xcc)[_0xb09a('0x25')]();});}};}function handleEntityNotFound(_0x1c254f,_0x1edf5b){return function(_0x3140e6){if(!_0x3140e6){_0x1c254f[_0xb09a('0x19')](0x194);}return _0x3140e6;};}function handleError(_0x39f9d4,_0x5b01b8){_0x5b01b8=_0x5b01b8||0x1f4;return function(_0x8814c0){logger[_0xb09a('0x26')](_0x8814c0[_0xb09a('0x27')]);if(_0x8814c0[_0xb09a('0x28')]){delete _0x8814c0[_0xb09a('0x28')];}_0x39f9d4[_0xb09a('0x1a')](_0x5b01b8)[_0xb09a('0x29')](_0x8814c0);};}exports[_0xb09a('0x2a')]=function(_0x44ac44,_0x2e4c4c){var _0x3c7fcf={},_0x3c90b0={},_0x194b61={'count':0x0,'rows':[]};var _0x56d942=_[_0xb09a('0x2b')](db[_0xb09a('0x2c')]['rawAttributes'],function(_0x1eed08){return{'name':_0x1eed08[_0xb09a('0x2d')],'type':_0x1eed08['type'][_0xb09a('0x2e')]};});_0x3c90b0[_0xb09a('0x2f')]=_[_0xb09a('0x2b')](_0x56d942,_0xb09a('0x28'));_0x3c90b0[_0xb09a('0x30')]=_['keys'](_0x44ac44[_0xb09a('0x30')]);_0x3c90b0['filters']=_[_0xb09a('0x31')](_0x3c90b0[_0xb09a('0x2f')],_0x3c90b0['query']);_0x3c7fcf['attributes']=_['intersection'](_0x3c90b0[_0xb09a('0x2f')],qs[_0xb09a('0x32')](_0x44ac44[_0xb09a('0x30')][_0xb09a('0x32')]));_0x3c7fcf['attributes']=_0x3c7fcf[_0xb09a('0x33')][_0xb09a('0x34')]?_0x3c7fcf[_0xb09a('0x33')]:_0x3c90b0['model'];if(!_0x44ac44[_0xb09a('0x30')]['hasOwnProperty'](_0xb09a('0x35'))){_0x3c7fcf[_0xb09a('0x1d')]=qs[_0xb09a('0x1d')](_0x44ac44[_0xb09a('0x30')][_0xb09a('0x1d')]);_0x3c7fcf[_0xb09a('0x1b')]=qs[_0xb09a('0x1b')](_0x44ac44[_0xb09a('0x30')][_0xb09a('0x1b')]);}_0x3c7fcf[_0xb09a('0x36')]=qs['sort'](_0x44ac44[_0xb09a('0x30')]['sort']);_0x3c7fcf[_0xb09a('0x37')]=qs[_0xb09a('0x38')](_['pick'](_0x44ac44['query'],_0x3c90b0['filters']),_0x56d942);if(_0x44ac44[_0xb09a('0x30')]['filter']){_0x3c7fcf['where']=_[_0xb09a('0x39')](_0x3c7fcf[_0xb09a('0x37')],{'$or':_[_0xb09a('0x2b')](_0x56d942,function(_0x171418){if(_0x171418[_0xb09a('0x3a')]!==_0xb09a('0x3b')){var _0x35b4da={};_0x35b4da[_0x171418[_0xb09a('0x28')]]={'$like':'%'+_0x44ac44[_0xb09a('0x30')][_0xb09a('0x3c')]+'%'};return _0x35b4da;}})});}_0x3c7fcf=_[_0xb09a('0x39')]({},_0x3c7fcf,_0x44ac44['options']);var _0xcb34df={'where':_0x3c7fcf[_0xb09a('0x37')]};return db[_0xb09a('0x2c')][_0xb09a('0x1e')](_0xcb34df)['then'](function(_0x503cb4){_0x194b61[_0xb09a('0x1e')]=_0x503cb4;if(_0x44ac44[_0xb09a('0x30')][_0xb09a('0x3d')]){_0x3c7fcf[_0xb09a('0x3e')]=[{'all':!![]}];}return db[_0xb09a('0x2c')]['findAll'](_0x3c7fcf);})[_0xb09a('0x23')](function(_0xf2ce9e){_0x194b61[_0xb09a('0x3f')]=_0xf2ce9e;return _0x194b61;})[_0xb09a('0x23')](respondWithFilteredResult(_0x2e4c4c,_0x3c7fcf))[_0xb09a('0x40')](handleError(_0x2e4c4c,null));};exports[_0xb09a('0x41')]=function(_0x2916b7,_0x3f501c){var _0x303920={'raw':![],'where':{'id':_0x2916b7['params']['id']}},_0x3c7f26={};_0x3c7f26[_0xb09a('0x2f')]=_['keys'](db[_0xb09a('0x2c')][_0xb09a('0x42')]);_0x3c7f26[_0xb09a('0x30')]=_['keys'](_0x2916b7[_0xb09a('0x30')]);_0x3c7f26['filters']=_[_0xb09a('0x31')](_0x3c7f26[_0xb09a('0x2f')],_0x3c7f26[_0xb09a('0x30')]);_0x303920[_0xb09a('0x33')]=_[_0xb09a('0x31')](_0x3c7f26[_0xb09a('0x2f')],qs['fields'](_0x2916b7[_0xb09a('0x30')]['fields']));_0x303920[_0xb09a('0x33')]=_0x303920['attributes'][_0xb09a('0x34')]?_0x303920[_0xb09a('0x33')]:_0x3c7f26['model'];if(_0x2916b7[_0xb09a('0x30')][_0xb09a('0x3d')]){_0x303920[_0xb09a('0x3e')]=[{'all':!![]}];}_0x303920=_[_0xb09a('0x39')]({},_0x303920,_0x2916b7['options']);return db[_0xb09a('0x2c')][_0xb09a('0x43')](_0x303920)[_0xb09a('0x23')](handleEntityNotFound(_0x3f501c,null))['then'](respondWithResult(_0x3f501c,null))[_0xb09a('0x40')](handleError(_0x3f501c,null));};exports[_0xb09a('0x44')]=function(_0x327f3a,_0x11b25f){return db[_0xb09a('0x2c')][_0xb09a('0x44')](_0x327f3a[_0xb09a('0x45')],{})['then'](respondWithResult(_0x11b25f,0xc9))[_0xb09a('0x40')](handleError(_0x11b25f,null));};exports[_0xb09a('0x22')]=function(_0x30eec4,_0x23e5f6){if(_0x30eec4[_0xb09a('0x45')]['id']){delete _0x30eec4['body']['id'];}return db[_0xb09a('0x2c')][_0xb09a('0x43')]({'where':{'id':_0x30eec4['params']['id']}})[_0xb09a('0x23')](handleEntityNotFound(_0x23e5f6,null))[_0xb09a('0x23')](saveUpdates(_0x30eec4[_0xb09a('0x45')],null))[_0xb09a('0x23')](respondWithResult(_0x23e5f6,null))['catch'](handleError(_0x23e5f6,null));};exports[_0xb09a('0x24')]=function(_0x3fa57c,_0x2bcfe3){return db[_0xb09a('0x2c')][_0xb09a('0x43')]({'where':{'id':_0x3fa57c[_0xb09a('0x46')]['id']}})[_0xb09a('0x23')](handleEntityNotFound(_0x2bcfe3,null))['then'](removeEntity(_0x2bcfe3,null))['catch'](handleError(_0x2bcfe3,null));};exports[_0xb09a('0x47')]=function(_0x1212cd,_0x2e3554,_0x387f59){var _0x185ef9={};var _0x43011a={};var _0x35c33f;var _0x2b2f90;return db[_0xb09a('0x2c')][_0xb09a('0x48')]({'where':{'id':_0x1212cd['params']['id']}})[_0xb09a('0x23')](handleEntityNotFound(_0x2e3554,null))[_0xb09a('0x23')](function(_0x10ff4b){if(_0x10ff4b){_0x35c33f=_0x10ff4b;_0x43011a[_0xb09a('0x2f')]=_[_0xb09a('0x49')](db[_0xb09a('0x4a')][_0xb09a('0x42')]);_0x43011a['query']=_[_0xb09a('0x49')](_0x1212cd[_0xb09a('0x30')]);_0x43011a[_0xb09a('0x38')]=_[_0xb09a('0x31')](_0x43011a[_0xb09a('0x2f')],_0x43011a['query']);_0x185ef9[_0xb09a('0x33')]=_[_0xb09a('0x31')](_0x43011a['model'],qs[_0xb09a('0x32')](_0x1212cd[_0xb09a('0x30')][_0xb09a('0x32')]));_0x185ef9[_0xb09a('0x33')]=_0x185ef9[_0xb09a('0x33')][_0xb09a('0x34')]?_0x185ef9[_0xb09a('0x33')]:_0x43011a[_0xb09a('0x2f')];_0x185ef9['order']=qs[_0xb09a('0x4b')](_0x1212cd[_0xb09a('0x30')]['sort']);_0x185ef9[_0xb09a('0x37')]=qs['filters'](_['pick'](_0x1212cd['query'],_0x43011a['filters']));if(_0x1212cd['query'][_0xb09a('0x3c')]){_0x185ef9[_0xb09a('0x37')]=_[_0xb09a('0x39')](_0x185ef9[_0xb09a('0x37')],{'$or':_[_0xb09a('0x2b')](_0x185ef9[_0xb09a('0x33')],function(_0x380f82){var _0x16a74a={};_0x16a74a[_0x380f82]={'$like':'%'+_0x1212cd[_0xb09a('0x30')][_0xb09a('0x3c')]+'%'};return _0x16a74a;})});}_0x185ef9=_['merge']({},_0x185ef9,_0x1212cd[_0xb09a('0x4c')]);return _0x35c33f['getSubjects'](_0x185ef9);}})[_0xb09a('0x23')](function(_0x2977a0){if(_0x2977a0){_0x2b2f90=_0x2977a0[_0xb09a('0x34')];if(!_0x1212cd[_0xb09a('0x30')][_0xb09a('0x4d')](_0xb09a('0x35'))){_0x185ef9[_0xb09a('0x1d')]=qs[_0xb09a('0x1d')](_0x1212cd[_0xb09a('0x30')][_0xb09a('0x1d')]);_0x185ef9['offset']=qs[_0xb09a('0x1b')](_0x1212cd[_0xb09a('0x30')]['offset']);}return _0x35c33f[_0xb09a('0x47')](_0x185ef9);}})[_0xb09a('0x23')](function(_0x385f13){if(_0x385f13){return _0x385f13?{'count':_0x2b2f90,'rows':_0x385f13}:null;}})[_0xb09a('0x23')](respondWithResult(_0x2e3554,null))[_0xb09a('0x40')](handleError(_0x2e3554,null));};exports[_0xb09a('0x4e')]=function(_0x51e6fc,_0x5518c7,_0x26960f){var _0x3f0ac0={};var _0x1364ed={};var _0x2e5c56;var _0x197402;return db[_0xb09a('0x2c')][_0xb09a('0x48')]({'where':{'id':_0x51e6fc[_0xb09a('0x46')]['id']}})[_0xb09a('0x23')](handleEntityNotFound(_0x5518c7,null))[_0xb09a('0x23')](function(_0x7c754b){if(_0x7c754b){_0x2e5c56=_0x7c754b;_0x1364ed[_0xb09a('0x2f')]=_[_0xb09a('0x49')](db[_0xb09a('0x4a')][_0xb09a('0x42')]);_0x1364ed['query']=_[_0xb09a('0x49')](_0x51e6fc[_0xb09a('0x30')]);_0x1364ed[_0xb09a('0x38')]=_['intersection'](_0x1364ed[_0xb09a('0x2f')],_0x1364ed[_0xb09a('0x30')]);_0x3f0ac0['attributes']=_['intersection'](_0x1364ed[_0xb09a('0x2f')],qs[_0xb09a('0x32')](_0x51e6fc[_0xb09a('0x30')][_0xb09a('0x32')]));_0x3f0ac0['attributes']=_0x3f0ac0[_0xb09a('0x33')][_0xb09a('0x34')]?_0x3f0ac0[_0xb09a('0x33')]:_0x1364ed[_0xb09a('0x2f')];_0x3f0ac0[_0xb09a('0x36')]=qs['sort'](_0x51e6fc[_0xb09a('0x30')][_0xb09a('0x4b')]);_0x3f0ac0[_0xb09a('0x37')]=qs[_0xb09a('0x38')](_[_0xb09a('0x4f')](_0x51e6fc[_0xb09a('0x30')],_0x1364ed[_0xb09a('0x38')]));if(_0x51e6fc['query']['filter']){_0x3f0ac0[_0xb09a('0x37')]=_['merge'](_0x3f0ac0[_0xb09a('0x37')],{'$or':_['map'](_0x3f0ac0[_0xb09a('0x33')],function(_0x44b92e){var _0x143330={};_0x143330[_0x44b92e]={'$like':'%'+_0x51e6fc[_0xb09a('0x30')]['filter']+'%'};return _0x143330;})});}_0x3f0ac0=_[_0xb09a('0x39')]({},_0x3f0ac0,_0x51e6fc[_0xb09a('0x4c')]);return _0x2e5c56['getDescriptions'](_0x3f0ac0);}})[_0xb09a('0x23')](function(_0x129c05){if(_0x129c05){_0x197402=_0x129c05[_0xb09a('0x34')];if(!_0x51e6fc['query'][_0xb09a('0x4d')](_0xb09a('0x35'))){_0x3f0ac0[_0xb09a('0x1d')]=qs['limit'](_0x51e6fc[_0xb09a('0x30')][_0xb09a('0x1d')]);_0x3f0ac0[_0xb09a('0x1b')]=qs[_0xb09a('0x1b')](_0x51e6fc[_0xb09a('0x30')][_0xb09a('0x1b')]);}return _0x2e5c56[_0xb09a('0x4e')](_0x3f0ac0);}})[_0xb09a('0x23')](function(_0x1febac){if(_0x1febac){return _0x1febac?{'count':_0x197402,'rows':_0x1febac}:null;}})[_0xb09a('0x23')](respondWithResult(_0x5518c7,null))[_0xb09a('0x40')](handleError(_0x5518c7,null));};exports[_0xb09a('0x50')]=function(_0x323ea6,_0x3e15e1,_0x2800fd){var _0x161003={};var _0x5b358f={};var _0x5f55f9;var _0x318d43;return db[_0xb09a('0x2c')][_0xb09a('0x48')]({'where':{'id':_0x323ea6[_0xb09a('0x46')]['id']}})[_0xb09a('0x23')](handleEntityNotFound(_0x3e15e1,null))[_0xb09a('0x23')](function(_0x18de4c){if(_0x18de4c){_0x5f55f9=_0x18de4c;_0x5b358f[_0xb09a('0x2f')]=_[_0xb09a('0x49')](db[_0xb09a('0x4a')][_0xb09a('0x42')]);_0x5b358f[_0xb09a('0x30')]=_[_0xb09a('0x49')](_0x323ea6[_0xb09a('0x30')]);_0x5b358f[_0xb09a('0x38')]=_[_0xb09a('0x31')](_0x5b358f['model'],_0x5b358f[_0xb09a('0x30')]);_0x161003[_0xb09a('0x33')]=_['intersection'](_0x5b358f[_0xb09a('0x2f')],qs['fields'](_0x323ea6[_0xb09a('0x30')][_0xb09a('0x32')]));_0x161003[_0xb09a('0x33')]=_0x161003[_0xb09a('0x33')]['length']?_0x161003[_0xb09a('0x33')]:_0x5b358f['model'];_0x161003[_0xb09a('0x36')]=qs[_0xb09a('0x4b')](_0x323ea6[_0xb09a('0x30')]['sort']);_0x161003[_0xb09a('0x37')]=qs[_0xb09a('0x38')](_[_0xb09a('0x4f')](_0x323ea6[_0xb09a('0x30')],_0x5b358f[_0xb09a('0x38')]));if(_0x323ea6['query'][_0xb09a('0x3c')]){_0x161003[_0xb09a('0x37')]=_[_0xb09a('0x39')](_0x161003[_0xb09a('0x37')],{'$or':_[_0xb09a('0x2b')](_0x161003[_0xb09a('0x33')],function(_0x57005f){var _0x370955={};_0x370955[_0x57005f]={'$like':'%'+_0x323ea6[_0xb09a('0x30')][_0xb09a('0x3c')]+'%'};return _0x370955;})});}_0x161003=_[_0xb09a('0x39')]({},_0x161003,_0x323ea6['options']);return _0x5f55f9['getFields'](_0x161003);}})[_0xb09a('0x23')](function(_0x5decb3){if(_0x5decb3){_0x318d43=_0x5decb3[_0xb09a('0x34')];if(!_0x323ea6[_0xb09a('0x30')]['hasOwnProperty'](_0xb09a('0x35'))){_0x161003[_0xb09a('0x1d')]=qs[_0xb09a('0x1d')](_0x323ea6['query']['limit']);_0x161003[_0xb09a('0x1b')]=qs[_0xb09a('0x1b')](_0x323ea6['query'][_0xb09a('0x1b')]);}return _0x5f55f9['getFields'](_0x161003);}})['then'](function(_0x1aab69){if(_0x1aab69){return _0x1aab69?{'count':_0x318d43,'rows':_0x1aab69}:null;}})[_0xb09a('0x23')](respondWithResult(_0x3e15e1,null))['catch'](handleError(_0x3e15e1,null));}; \ No newline at end of file +var _0x1704=['destroy','findOne','FreshsalesField','filter','getSubjects','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','rows','params','keys','include','find','catch','create','body'];(function(_0x30e2eb,_0x38085c){var _0x42cab7=function(_0x1eed8e){while(--_0x1eed8e){_0x30e2eb['push'](_0x30e2eb['shift']());}};_0x42cab7(++_0x38085c);}(_0x1704,0x14b));var _0x4170=function(_0x4f6330,_0x4a8363){_0x4f6330=_0x4f6330-0x0;var _0x2e4f74=_0x1704[_0x4f6330];return _0x2e4f74;};'use strict';var emlformat=require(_0x4170('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4170('0x1'));var rp=require(_0x4170('0x2'));var moment=require(_0x4170('0x3'));var BPromise=require(_0x4170('0x4'));var Mustache=require('mustache');var util=require(_0x4170('0x5'));var path=require(_0x4170('0x6'));var sox=require(_0x4170('0x7'));var csv=require(_0x4170('0x8'));var ejs=require(_0x4170('0x9'));var fs=require('fs');var fs_extra=require(_0x4170('0xa'));var _=require(_0x4170('0xb'));var squel=require(_0x4170('0xc'));var crypto=require(_0x4170('0xd'));var jsforce=require(_0x4170('0xe'));var deskjs=require(_0x4170('0xf'));var toCsv=require(_0x4170('0x8'));var querystring=require(_0x4170('0x10'));var Papa=require(_0x4170('0x11'));var Redis=require(_0x4170('0x12'));var authService=require(_0x4170('0x13'));var qs=require(_0x4170('0x14'));var as=require(_0x4170('0x15'));var hardwareService=require(_0x4170('0x16'));var logger=require(_0x4170('0x17'))(_0x4170('0x18'));var utils=require('../../config/utils');var config=require(_0x4170('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4170('0x1a'))['db'];function respondWithStatusCode(_0xdebb48,_0x45b497){_0x45b497=_0x45b497||0xcc;return function(_0x11b74a){if(_0x11b74a){return _0xdebb48[_0x4170('0x1b')](_0x45b497);}return _0xdebb48[_0x4170('0x1c')](_0x45b497)[_0x4170('0x1d')]();};}function respondWithResult(_0x291e1e,_0x4f25ab){_0x4f25ab=_0x4f25ab||0xc8;return function(_0x5d9eb5){if(_0x5d9eb5){return _0x291e1e['status'](_0x4f25ab)[_0x4170('0x1e')](_0x5d9eb5);}};}function respondWithFilteredResult(_0x3f299d,_0x29e03b){return function(_0x2755d1){if(_0x2755d1){var _0x34a416=typeof _0x29e03b[_0x4170('0x1f')]===_0x4170('0x20')&&typeof _0x29e03b['limit']===_0x4170('0x20');var _0x3e3e91=_0x2755d1[_0x4170('0x21')];var _0x45a3fb=_0x34a416?0x0:_0x29e03b[_0x4170('0x1f')];var _0x3932ec=_0x34a416?_0x2755d1['count']:_0x29e03b[_0x4170('0x1f')]+_0x29e03b[_0x4170('0x22')];var _0x57402d;if(_0x3932ec>=_0x3e3e91){_0x3932ec=_0x3e3e91;_0x57402d=0xc8;}else{_0x57402d=0xce;}_0x3f299d[_0x4170('0x1c')](_0x57402d);return _0x3f299d['set']('Content-Range',_0x45a3fb+'-'+_0x3932ec+'/'+_0x3e3e91)[_0x4170('0x1e')](_0x2755d1);}return null;};}function patchUpdates(_0x39e0c9){return function(_0x135330){try{jsonpatch['apply'](_0x135330,_0x39e0c9,!![]);}catch(_0x126a27){return BPromise[_0x4170('0x23')](_0x126a27);}return _0x135330['save']();};}function saveUpdates(_0x428832,_0x4e7fe7){return function(_0x55698c){if(_0x55698c){return _0x55698c[_0x4170('0x24')](_0x428832)[_0x4170('0x25')](function(_0x40bf55){return _0x40bf55;});}return null;};}function removeEntity(_0x18931a,_0x2d4a06){return function(_0x4c379c){if(_0x4c379c){return _0x4c379c['destroy']()['then'](function(){_0x18931a[_0x4170('0x1c')](0xcc)[_0x4170('0x1d')]();});}};}function handleEntityNotFound(_0x3dba7d,_0x1746f5){return function(_0x19d6db){if(!_0x19d6db){_0x3dba7d['sendStatus'](0x194);}return _0x19d6db;};}function handleError(_0x5eaddb,_0x29ac30){_0x29ac30=_0x29ac30||0x1f4;return function(_0x1bf2f2){logger[_0x4170('0x26')](_0x1bf2f2[_0x4170('0x27')]);if(_0x1bf2f2[_0x4170('0x28')]){delete _0x1bf2f2[_0x4170('0x28')];}_0x5eaddb[_0x4170('0x1c')](_0x29ac30)[_0x4170('0x29')](_0x1bf2f2);};}exports[_0x4170('0x2a')]=function(_0x1ffef1,_0x3c65ed){var _0xc1bd66={},_0x4d8669={},_0x2b2278={'count':0x0,'rows':[]};var _0xd28c71=_[_0x4170('0x2b')](db[_0x4170('0x2c')][_0x4170('0x2d')],function(_0x3fab79){return{'name':_0x3fab79[_0x4170('0x2e')],'type':_0x3fab79[_0x4170('0x2f')][_0x4170('0x30')]};});_0x4d8669[_0x4170('0x31')]=_['map'](_0xd28c71,'name');_0x4d8669['query']=_['keys'](_0x1ffef1[_0x4170('0x32')]);_0x4d8669[_0x4170('0x33')]=_[_0x4170('0x34')](_0x4d8669[_0x4170('0x31')],_0x4d8669[_0x4170('0x32')]);_0xc1bd66['attributes']=_[_0x4170('0x34')](_0x4d8669[_0x4170('0x31')],qs[_0x4170('0x35')](_0x1ffef1[_0x4170('0x32')][_0x4170('0x35')]));_0xc1bd66[_0x4170('0x36')]=_0xc1bd66[_0x4170('0x36')][_0x4170('0x37')]?_0xc1bd66['attributes']:_0x4d8669[_0x4170('0x31')];if(!_0x1ffef1['query'][_0x4170('0x38')](_0x4170('0x39'))){_0xc1bd66[_0x4170('0x22')]=qs[_0x4170('0x22')](_0x1ffef1['query'][_0x4170('0x22')]);_0xc1bd66[_0x4170('0x1f')]=qs[_0x4170('0x1f')](_0x1ffef1[_0x4170('0x32')][_0x4170('0x1f')]);}_0xc1bd66[_0x4170('0x3a')]=qs[_0x4170('0x3b')](_0x1ffef1[_0x4170('0x32')][_0x4170('0x3b')]);_0xc1bd66['where']=qs[_0x4170('0x33')](_[_0x4170('0x3c')](_0x1ffef1['query'],_0x4d8669['filters']),_0xd28c71);if(_0x1ffef1[_0x4170('0x32')]['filter']){_0xc1bd66[_0x4170('0x3d')]=_[_0x4170('0x3e')](_0xc1bd66['where'],{'$or':_[_0x4170('0x2b')](_0xd28c71,function(_0x490dc6){if(_0x490dc6[_0x4170('0x2f')]!==_0x4170('0x3f')){var _0x37fc8c={};_0x37fc8c[_0x490dc6['name']]={'$like':'%'+_0x1ffef1['query']['filter']+'%'};return _0x37fc8c;}})});}_0xc1bd66=_[_0x4170('0x3e')]({},_0xc1bd66,_0x1ffef1[_0x4170('0x40')]);var _0xd9cde={'where':_0xc1bd66[_0x4170('0x3d')]};return db[_0x4170('0x2c')][_0x4170('0x21')](_0xd9cde)[_0x4170('0x25')](function(_0x508511){_0x2b2278[_0x4170('0x21')]=_0x508511;if(_0x1ffef1[_0x4170('0x32')][_0x4170('0x41')]){_0xc1bd66['include']=[{'all':!![]}];}return db[_0x4170('0x2c')]['findAll'](_0xc1bd66);})[_0x4170('0x25')](function(_0x11bcbf){_0x2b2278[_0x4170('0x42')]=_0x11bcbf;return _0x2b2278;})['then'](respondWithFilteredResult(_0x3c65ed,_0xc1bd66))['catch'](handleError(_0x3c65ed,null));};exports['show']=function(_0x26131d,_0x46d320){var _0xf3e6b={'raw':![],'where':{'id':_0x26131d[_0x4170('0x43')]['id']}},_0x3c95a2={};_0x3c95a2[_0x4170('0x31')]=_['keys'](db['FreshsalesConfiguration'][_0x4170('0x2d')]);_0x3c95a2[_0x4170('0x32')]=_[_0x4170('0x44')](_0x26131d[_0x4170('0x32')]);_0x3c95a2['filters']=_[_0x4170('0x34')](_0x3c95a2['model'],_0x3c95a2[_0x4170('0x32')]);_0xf3e6b[_0x4170('0x36')]=_[_0x4170('0x34')](_0x3c95a2['model'],qs[_0x4170('0x35')](_0x26131d['query'][_0x4170('0x35')]));_0xf3e6b[_0x4170('0x36')]=_0xf3e6b[_0x4170('0x36')][_0x4170('0x37')]?_0xf3e6b[_0x4170('0x36')]:_0x3c95a2['model'];if(_0x26131d[_0x4170('0x32')][_0x4170('0x41')]){_0xf3e6b[_0x4170('0x45')]=[{'all':!![]}];}_0xf3e6b=_['merge']({},_0xf3e6b,_0x26131d['options']);return db[_0x4170('0x2c')][_0x4170('0x46')](_0xf3e6b)['then'](handleEntityNotFound(_0x46d320,null))[_0x4170('0x25')](respondWithResult(_0x46d320,null))[_0x4170('0x47')](handleError(_0x46d320,null));};exports[_0x4170('0x48')]=function(_0xac45d2,_0x331f8f){return db['FreshsalesConfiguration'][_0x4170('0x48')](_0xac45d2[_0x4170('0x49')],{})[_0x4170('0x25')](respondWithResult(_0x331f8f,0xc9))[_0x4170('0x47')](handleError(_0x331f8f,null));};exports[_0x4170('0x24')]=function(_0x3286e6,_0x5ccc4e){if(_0x3286e6[_0x4170('0x49')]['id']){delete _0x3286e6[_0x4170('0x49')]['id'];}return db[_0x4170('0x2c')][_0x4170('0x46')]({'where':{'id':_0x3286e6[_0x4170('0x43')]['id']}})[_0x4170('0x25')](handleEntityNotFound(_0x5ccc4e,null))[_0x4170('0x25')](saveUpdates(_0x3286e6[_0x4170('0x49')],null))['then'](respondWithResult(_0x5ccc4e,null))[_0x4170('0x47')](handleError(_0x5ccc4e,null));};exports[_0x4170('0x4a')]=function(_0x4661fc,_0x173f02){return db[_0x4170('0x2c')][_0x4170('0x46')]({'where':{'id':_0x4661fc[_0x4170('0x43')]['id']}})[_0x4170('0x25')](handleEntityNotFound(_0x173f02,null))[_0x4170('0x25')](removeEntity(_0x173f02,null))[_0x4170('0x47')](handleError(_0x173f02,null));};exports['getSubjects']=function(_0x104091,_0x10cd52,_0x101195){var _0x608f39={};var _0x53a18e={};var _0x20e5ea;var _0x5afc1e;return db[_0x4170('0x2c')][_0x4170('0x4b')]({'where':{'id':_0x104091['params']['id']}})[_0x4170('0x25')](handleEntityNotFound(_0x10cd52,null))['then'](function(_0x492d46){if(_0x492d46){_0x20e5ea=_0x492d46;_0x53a18e['model']=_[_0x4170('0x44')](db[_0x4170('0x4c')][_0x4170('0x2d')]);_0x53a18e[_0x4170('0x32')]=_[_0x4170('0x44')](_0x104091[_0x4170('0x32')]);_0x53a18e[_0x4170('0x33')]=_[_0x4170('0x34')](_0x53a18e[_0x4170('0x31')],_0x53a18e['query']);_0x608f39[_0x4170('0x36')]=_[_0x4170('0x34')](_0x53a18e['model'],qs[_0x4170('0x35')](_0x104091[_0x4170('0x32')][_0x4170('0x35')]));_0x608f39[_0x4170('0x36')]=_0x608f39[_0x4170('0x36')]['length']?_0x608f39[_0x4170('0x36')]:_0x53a18e[_0x4170('0x31')];_0x608f39[_0x4170('0x3a')]=qs[_0x4170('0x3b')](_0x104091[_0x4170('0x32')][_0x4170('0x3b')]);_0x608f39[_0x4170('0x3d')]=qs['filters'](_[_0x4170('0x3c')](_0x104091[_0x4170('0x32')],_0x53a18e['filters']));if(_0x104091[_0x4170('0x32')][_0x4170('0x4d')]){_0x608f39[_0x4170('0x3d')]=_[_0x4170('0x3e')](_0x608f39[_0x4170('0x3d')],{'$or':_['map'](_0x608f39[_0x4170('0x36')],function(_0xd1b46f){var _0x42229e={};_0x42229e[_0xd1b46f]={'$like':'%'+_0x104091[_0x4170('0x32')][_0x4170('0x4d')]+'%'};return _0x42229e;})});}_0x608f39=_[_0x4170('0x3e')]({},_0x608f39,_0x104091[_0x4170('0x40')]);return _0x20e5ea[_0x4170('0x4e')](_0x608f39);}})['then'](function(_0x740121){if(_0x740121){_0x5afc1e=_0x740121[_0x4170('0x37')];if(!_0x104091[_0x4170('0x32')][_0x4170('0x38')](_0x4170('0x39'))){_0x608f39[_0x4170('0x22')]=qs['limit'](_0x104091[_0x4170('0x32')][_0x4170('0x22')]);_0x608f39[_0x4170('0x1f')]=qs['offset'](_0x104091[_0x4170('0x32')][_0x4170('0x1f')]);}return _0x20e5ea[_0x4170('0x4e')](_0x608f39);}})['then'](function(_0x46204f){if(_0x46204f){return _0x46204f?{'count':_0x5afc1e,'rows':_0x46204f}:null;}})['then'](respondWithResult(_0x10cd52,null))[_0x4170('0x47')](handleError(_0x10cd52,null));};exports[_0x4170('0x4f')]=function(_0xd424cf,_0x1a4578,_0x72cb17){var _0x4bee7d={};var _0xb7572f={};var _0x2050b0;var _0x4858d9;return db[_0x4170('0x2c')][_0x4170('0x4b')]({'where':{'id':_0xd424cf[_0x4170('0x43')]['id']}})[_0x4170('0x25')](handleEntityNotFound(_0x1a4578,null))[_0x4170('0x25')](function(_0x1933b1){if(_0x1933b1){_0x2050b0=_0x1933b1;_0xb7572f[_0x4170('0x31')]=_[_0x4170('0x44')](db[_0x4170('0x4c')][_0x4170('0x2d')]);_0xb7572f[_0x4170('0x32')]=_['keys'](_0xd424cf[_0x4170('0x32')]);_0xb7572f[_0x4170('0x33')]=_[_0x4170('0x34')](_0xb7572f[_0x4170('0x31')],_0xb7572f[_0x4170('0x32')]);_0x4bee7d[_0x4170('0x36')]=_['intersection'](_0xb7572f['model'],qs[_0x4170('0x35')](_0xd424cf[_0x4170('0x32')][_0x4170('0x35')]));_0x4bee7d[_0x4170('0x36')]=_0x4bee7d[_0x4170('0x36')][_0x4170('0x37')]?_0x4bee7d[_0x4170('0x36')]:_0xb7572f[_0x4170('0x31')];_0x4bee7d[_0x4170('0x3a')]=qs[_0x4170('0x3b')](_0xd424cf[_0x4170('0x32')][_0x4170('0x3b')]);_0x4bee7d[_0x4170('0x3d')]=qs[_0x4170('0x33')](_[_0x4170('0x3c')](_0xd424cf[_0x4170('0x32')],_0xb7572f['filters']));if(_0xd424cf[_0x4170('0x32')]['filter']){_0x4bee7d[_0x4170('0x3d')]=_[_0x4170('0x3e')](_0x4bee7d[_0x4170('0x3d')],{'$or':_[_0x4170('0x2b')](_0x4bee7d['attributes'],function(_0x46b903){var _0x29aca4={};_0x29aca4[_0x46b903]={'$like':'%'+_0xd424cf[_0x4170('0x32')]['filter']+'%'};return _0x29aca4;})});}_0x4bee7d=_[_0x4170('0x3e')]({},_0x4bee7d,_0xd424cf[_0x4170('0x40')]);return _0x2050b0[_0x4170('0x4f')](_0x4bee7d);}})[_0x4170('0x25')](function(_0x29eb97){if(_0x29eb97){_0x4858d9=_0x29eb97[_0x4170('0x37')];if(!_0xd424cf['query']['hasOwnProperty']('nolimit')){_0x4bee7d['limit']=qs[_0x4170('0x22')](_0xd424cf[_0x4170('0x32')][_0x4170('0x22')]);_0x4bee7d[_0x4170('0x1f')]=qs[_0x4170('0x1f')](_0xd424cf['query'][_0x4170('0x1f')]);}return _0x2050b0[_0x4170('0x4f')](_0x4bee7d);}})['then'](function(_0x5f8e72){if(_0x5f8e72){return _0x5f8e72?{'count':_0x4858d9,'rows':_0x5f8e72}:null;}})[_0x4170('0x25')](respondWithResult(_0x1a4578,null))[_0x4170('0x47')](handleError(_0x1a4578,null));};exports[_0x4170('0x50')]=function(_0x16ed4e,_0x2c6e75,_0x5e5dd3){var _0x599ce1={};var _0x3e5403={};var _0x4d69f7;var _0x5e853e;return db['FreshsalesConfiguration'][_0x4170('0x4b')]({'where':{'id':_0x16ed4e[_0x4170('0x43')]['id']}})[_0x4170('0x25')](handleEntityNotFound(_0x2c6e75,null))['then'](function(_0x37449c){if(_0x37449c){_0x4d69f7=_0x37449c;_0x3e5403[_0x4170('0x31')]=_[_0x4170('0x44')](db[_0x4170('0x4c')]['rawAttributes']);_0x3e5403[_0x4170('0x32')]=_['keys'](_0x16ed4e[_0x4170('0x32')]);_0x3e5403['filters']=_[_0x4170('0x34')](_0x3e5403[_0x4170('0x31')],_0x3e5403[_0x4170('0x32')]);_0x599ce1[_0x4170('0x36')]=_[_0x4170('0x34')](_0x3e5403['model'],qs[_0x4170('0x35')](_0x16ed4e['query'][_0x4170('0x35')]));_0x599ce1['attributes']=_0x599ce1[_0x4170('0x36')][_0x4170('0x37')]?_0x599ce1['attributes']:_0x3e5403[_0x4170('0x31')];_0x599ce1[_0x4170('0x3a')]=qs[_0x4170('0x3b')](_0x16ed4e[_0x4170('0x32')]['sort']);_0x599ce1[_0x4170('0x3d')]=qs['filters'](_[_0x4170('0x3c')](_0x16ed4e[_0x4170('0x32')],_0x3e5403['filters']));if(_0x16ed4e[_0x4170('0x32')]['filter']){_0x599ce1[_0x4170('0x3d')]=_[_0x4170('0x3e')](_0x599ce1[_0x4170('0x3d')],{'$or':_[_0x4170('0x2b')](_0x599ce1[_0x4170('0x36')],function(_0x406f91){var _0xf3ff0a={};_0xf3ff0a[_0x406f91]={'$like':'%'+_0x16ed4e[_0x4170('0x32')][_0x4170('0x4d')]+'%'};return _0xf3ff0a;})});}_0x599ce1=_[_0x4170('0x3e')]({},_0x599ce1,_0x16ed4e[_0x4170('0x40')]);return _0x4d69f7['getFields'](_0x599ce1);}})[_0x4170('0x25')](function(_0x362771){if(_0x362771){_0x5e853e=_0x362771[_0x4170('0x37')];if(!_0x16ed4e[_0x4170('0x32')][_0x4170('0x38')](_0x4170('0x39'))){_0x599ce1[_0x4170('0x22')]=qs[_0x4170('0x22')](_0x16ed4e[_0x4170('0x32')][_0x4170('0x22')]);_0x599ce1['offset']=qs[_0x4170('0x1f')](_0x16ed4e[_0x4170('0x32')][_0x4170('0x1f')]);}return _0x4d69f7['getFields'](_0x599ce1);}})[_0x4170('0x25')](function(_0xb82bce){if(_0xb82bce){return _0xb82bce?{'count':_0x5e853e,'rows':_0xb82bce}:null;}})[_0x4170('0x25')](respondWithResult(_0x2c6e75,null))[_0x4170('0x47')](handleError(_0x2c6e75,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d54b26f..be98f9d 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 _0x08b6=['int_freshsales_configurations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x3cfc6c,_0x5d1fcb){var _0x3e5066=function(_0x4436aa){while(--_0x4436aa){_0x3cfc6c['push'](_0x3cfc6c['shift']());}};_0x3e5066(++_0x5d1fcb);}(_0x08b6,0x6f));var _0x608b=function(_0x5b131c,_0x46be64){_0x5b131c=_0x5b131c-0x0;var _0x30d555=_0x08b6[_0x5b131c];return _0x30d555;};'use strict';var _=require('lodash');var util=require(_0x608b('0x0'));var logger=require(_0x608b('0x1'))(_0x608b('0x2'));var moment=require(_0x608b('0x3'));var BPromise=require('bluebird');var rp=require(_0x608b('0x4'));var fs=require('fs');var path=require(_0x608b('0x5'));var rimraf=require('rimraf');var config=require(_0x608b('0x6'));var attributes=require(_0x608b('0x7'));module[_0x608b('0x8')]=function(_0xf0f29c,_0x499e84){return _0xf0f29c[_0x608b('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x608b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a4b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x9a4b,0x1ec));var _0xb9a4=function(_0x583761,_0x119f81){_0x583761=_0x583761-0x0;var _0x4b72f0=_0x9a4b[_0x583761];return _0x4b72f0;};'use strict';var _=require('lodash');var util=require(_0xb9a4('0x0'));var logger=require(_0xb9a4('0x1'))(_0xb9a4('0x2'));var moment=require(_0xb9a4('0x3'));var BPromise=require(_0xb9a4('0x4'));var rp=require(_0xb9a4('0x5'));var fs=require('fs');var path=require(_0xb9a4('0x6'));var rimraf=require(_0xb9a4('0x7'));var config=require(_0xb9a4('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb9a4('0x9')]=function(_0x424533,_0x4d58d8){return _0x424533[_0xb9a4('0xa')](_0xb9a4('0xb'),attributes,{'tableName':_0xb9a4('0xc'),'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 9d3dd71..e33dadd 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 _0xa22f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0xe3efab,_0xabc2e8){var _0xb88319=function(_0x5133ff){while(--_0x5133ff){_0xe3efab['push'](_0xe3efab['shift']());}};_0xb88319(++_0xabc2e8);}(_0xa22f,0x151));var _0xfa22=function(_0x480856,_0x3b1b79){_0x480856=_0x480856-0x0;var _0x4ffc81=_0xa22f[_0x480856];return _0x4ffc81;};'use strict';var _=require(_0xfa22('0x0'));var util=require(_0xfa22('0x1'));var moment=require(_0xfa22('0x2'));var BPromise=require(_0xfa22('0x3'));var rs=require(_0xfa22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa22('0x5'))['db'];var utils=require(_0xfa22('0x6'));var logger=require(_0xfa22('0x7'))(_0xfa22('0x8'));var config=require(_0xfa22('0x9'));var jayson=require(_0xfa22('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44b7b2,_0x3d04b8,_0x22bd01){return new BPromise(function(_0x2f0026,_0xfd5a52){return client['request'](_0x44b7b2,_0x22bd01)[_0xfa22('0xb')](function(_0x1eef18){logger['info'](_0xfa22('0xc'),_0x3d04b8,_0xfa22('0xd'));logger[_0xfa22('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3d04b8,'request\x20sent',JSON['stringify'](_0x1eef18));if(_0x1eef18[_0xfa22('0xf')]){if(_0x1eef18['error'][_0xfa22('0x10')]===0x1f4){logger['error'](_0xfa22('0xc'),_0x3d04b8,_0x1eef18['error'][_0xfa22('0x11')]);return _0xfd5a52(_0x1eef18[_0xfa22('0xf')][_0xfa22('0x11')]);}logger[_0xfa22('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3d04b8,_0x1eef18['error'][_0xfa22('0x11')]);return _0x2f0026(_0x1eef18['error']['message']);}else{logger[_0xfa22('0x12')](_0xfa22('0xc'),_0x3d04b8,_0xfa22('0xd'));_0x2f0026(_0x1eef18[_0xfa22('0x13')]['message']);}})[_0xfa22('0x14')](function(_0x14504a){logger['error'](_0xfa22('0xc'),_0x3d04b8,_0x14504a);_0xfd5a52(_0x14504a);});});} \ No newline at end of file +var _0x7aaf=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x547d76,_0x4b8f4b){var _0x28e411=function(_0x495747){while(--_0x495747){_0x547d76['push'](_0x547d76['shift']());}};_0x28e411(++_0x4b8f4b);}(_0x7aaf,0x122));var _0xf7aa=function(_0x57a130,_0x1c4f82){_0x57a130=_0x57a130-0x0;var _0x57b267=_0x7aaf[_0x57a130];return _0x57b267;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf7aa('0x0'));var BPromise=require(_0xf7aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7aa('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf7aa('0x3'));var config=require(_0xf7aa('0x4'));var jayson=require(_0xf7aa('0x5'));var client=jayson[_0xf7aa('0x6')][_0xf7aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d343c,_0xac9fa9,_0x5ae941){return new BPromise(function(_0x29b7b3,_0x37f8cf){return client[_0xf7aa('0x8')](_0x2d343c,_0x5ae941)[_0xf7aa('0x9')](function(_0x235177){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xac9fa9,_0xf7aa('0xa'));logger[_0xf7aa('0xb')](_0xf7aa('0xc'),_0xac9fa9,'request\x20sent',JSON[_0xf7aa('0xd')](_0x235177));if(_0x235177[_0xf7aa('0xe')]){if(_0x235177[_0xf7aa('0xe')][_0xf7aa('0xf')]===0x1f4){logger[_0xf7aa('0xe')](_0xf7aa('0x10'),_0xac9fa9,_0x235177[_0xf7aa('0xe')][_0xf7aa('0x11')]);return _0x37f8cf(_0x235177[_0xf7aa('0xe')]['message']);}logger[_0xf7aa('0xe')](_0xf7aa('0x10'),_0xac9fa9,_0x235177['error'][_0xf7aa('0x11')]);return _0x29b7b3(_0x235177[_0xf7aa('0xe')][_0xf7aa('0x11')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xac9fa9,'request\x20sent');_0x29b7b3(_0x235177[_0xf7aa('0x12')][_0xf7aa('0x11')]);}})[_0xf7aa('0x13')](function(_0x2e3d96){logger['error'](_0xf7aa('0x10'),_0xac9fa9,_0x2e3d96);_0x37f8cf(_0x2e3d96);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 6a9c8aa..e95463e 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 _0x89c3=['Router','fs-extra','../../components/auth/service','../../config/environment','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x44f91a,_0x329c75){var _0x473d4c=function(_0x4852d4){while(--_0x4852d4){_0x44f91a['push'](_0x44f91a['shift']());}};_0x473d4c(++_0x329c75);}(_0x89c3,0xff));var _0x389c=function(_0x59b89d,_0x3f6de8){_0x59b89d=_0x59b89d-0x0;var _0x1850ef=_0x89c3[_0x59b89d];return _0x1850ef;};'use strict';var multer=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var path=require(_0x389c('0x2'));var timeout=require(_0x389c('0x3'));var express=require(_0x389c('0x4'));var router=express[_0x389c('0x5')]();var fs_extra=require(_0x389c('0x6'));var auth=require(_0x389c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x389c('0x8'));var controller=require('./intFreshsalesField.controller');router[_0x389c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x389c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x389c('0xa')]);router[_0x389c('0xb')]('/',auth[_0x389c('0xc')](),controller[_0x389c('0xd')]);router[_0x389c('0xe')](_0x389c('0xf'),auth[_0x389c('0xc')](),controller[_0x389c('0x10')]);router[_0x389c('0x11')]('/:id',auth[_0x389c('0xc')](),controller[_0x389c('0x12')]);module[_0x389c('0x13')]=router; \ No newline at end of file +var _0x80fb=['post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x80fb,0x11e));var _0xb80f=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x80fb[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require('multer');var util=require(_0xb80f('0x0'));var path=require(_0xb80f('0x1'));var timeout=require('connect-timeout');var express=require(_0xb80f('0x2'));var router=express[_0xb80f('0x3')]();var fs_extra=require(_0xb80f('0x4'));var auth=require(_0xb80f('0x5'));var interaction=require(_0xb80f('0x6'));var config=require(_0xb80f('0x7'));var controller=require(_0xb80f('0x8'));router[_0xb80f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb80f('0xa')]);router[_0xb80f('0x9')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0xd')]);router[_0xb80f('0xe')]('/',auth[_0xb80f('0xc')](),controller[_0xb80f('0xf')]);router[_0xb80f('0x10')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0x11')]);router[_0xb80f('0x12')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 137a4fa..2b42785 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 _0x2b16=['string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x19190c,_0x28ffa5){var _0x5e97fd=function(_0x2dadd7){while(--_0x2dadd7){_0x19190c['push'](_0x19190c['shift']());}};_0x5e97fd(++_0x28ffa5);}(_0x2b16,0x10b));var _0x62b1=function(_0x1d45e3,_0x17acd4){_0x1d45e3=_0x1d45e3-0x0;var _0x191ebd=_0x2b16[_0x1d45e3];return _0x191ebd;};'use strict';var Sequelize=require(_0x62b1('0x0'));module[_0x62b1('0x1')]={'type':{'type':Sequelize[_0x62b1('0x2')](_0x62b1('0x3'),_0x62b1('0x4'),'customVariable',_0x62b1('0x5'),_0x62b1('0x6')),'defaultValue':_0x62b1('0x3')},'content':{'type':Sequelize[_0x62b1('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x62b1('0x2')](_0x62b1('0x3'),_0x62b1('0x4'),_0x62b1('0x8'))},'keyContent':{'type':Sequelize[_0x62b1('0x7')]},'idField':{'type':Sequelize[_0x62b1('0x7')]},'nameField':{'type':Sequelize[_0x62b1('0x7')]},'customField':{'type':Sequelize[_0x62b1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x62b1('0x7')]}}; \ No newline at end of file +var _0x7c40=['ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x2ed150,_0x397057){var _0x4a3fc4=function(_0x5259bb){while(--_0x5259bb){_0x2ed150['push'](_0x2ed150['shift']());}};_0x4a3fc4(++_0x397057);}(_0x7c40,0x1ee));var _0x07c4=function(_0x3f8ec5,_0xec54f7){_0x3f8ec5=_0x3f8ec5-0x0;var _0x3024ea=_0x7c40[_0x3f8ec5];return _0x3024ea;};'use strict';var Sequelize=require(_0x07c4('0x0'));module[_0x07c4('0x1')]={'type':{'type':Sequelize[_0x07c4('0x2')](_0x07c4('0x3'),'variable',_0x07c4('0x4'),'keyValue','picklist'),'defaultValue':_0x07c4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x07c4('0x5')]},'keyType':{'type':Sequelize[_0x07c4('0x2')](_0x07c4('0x3'),_0x07c4('0x6'),_0x07c4('0x4'))},'keyContent':{'type':Sequelize[_0x07c4('0x5')]},'idField':{'type':Sequelize[_0x07c4('0x5')]},'nameField':{'type':Sequelize[_0x07c4('0x5')]},'customField':{'type':Sequelize[_0x07c4('0x7')],'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 0800a01..08ad4bf 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 _0xf6c2=['body','find','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','intersection','options','create'];(function(_0xd77407,_0x432098){var _0x1e1105=function(_0x3d6684){while(--_0x3d6684){_0xd77407['push'](_0xd77407['shift']());}};_0x1e1105(++_0x432098);}(_0xf6c2,0x11a));var _0x2f6c=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xf6c2[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0x2f6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f6c('0x2'));var moment=require(_0x2f6c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2f6c('0x4'));var util=require('util');var path=require(_0x2f6c('0x5'));var sox=require(_0x2f6c('0x6'));var csv=require(_0x2f6c('0x7'));var ejs=require(_0x2f6c('0x8'));var fs=require('fs');var fs_extra=require(_0x2f6c('0x9'));var _=require(_0x2f6c('0xa'));var squel=require(_0x2f6c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f6c('0xc'));var toCsv=require(_0x2f6c('0x7'));var querystring=require(_0x2f6c('0xd'));var Papa=require(_0x2f6c('0xe'));var Redis=require('ioredis');var authService=require(_0x2f6c('0xf'));var qs=require(_0x2f6c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f6c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2f6c('0x12'));var config=require(_0x2f6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f6c('0x14'))['db'];function respondWithStatusCode(_0x2a5a13,_0x1b713d){_0x1b713d=_0x1b713d||0xcc;return function(_0x3db06e){if(_0x3db06e){return _0x2a5a13[_0x2f6c('0x15')](_0x1b713d);}return _0x2a5a13['status'](_0x1b713d)[_0x2f6c('0x16')]();};}function respondWithResult(_0x133253,_0x82c777){_0x82c777=_0x82c777||0xc8;return function(_0x101cfa){if(_0x101cfa){return _0x133253[_0x2f6c('0x17')](_0x82c777)[_0x2f6c('0x18')](_0x101cfa);}};}function respondWithFilteredResult(_0x121172,_0x2113bd){return function(_0x471ef0){if(_0x471ef0){var _0x179597=typeof _0x2113bd[_0x2f6c('0x19')]===_0x2f6c('0x1a')&&typeof _0x2113bd[_0x2f6c('0x1b')]==='undefined';var _0x5b8b32=_0x471ef0[_0x2f6c('0x1c')];var _0x5b8871=_0x179597?0x0:_0x2113bd[_0x2f6c('0x19')];var _0x4972f7=_0x179597?_0x471ef0[_0x2f6c('0x1c')]:_0x2113bd[_0x2f6c('0x19')]+_0x2113bd[_0x2f6c('0x1b')];var _0x51ed51;if(_0x4972f7>=_0x5b8b32){_0x4972f7=_0x5b8b32;_0x51ed51=0xc8;}else{_0x51ed51=0xce;}_0x121172[_0x2f6c('0x17')](_0x51ed51);return _0x121172[_0x2f6c('0x1d')](_0x2f6c('0x1e'),_0x5b8871+'-'+_0x4972f7+'/'+_0x5b8b32)[_0x2f6c('0x18')](_0x471ef0);}return null;};}function patchUpdates(_0x8c08c7){return function(_0x5b4c59){try{jsonpatch[_0x2f6c('0x1f')](_0x5b4c59,_0x8c08c7,!![]);}catch(_0x23da38){return BPromise['reject'](_0x23da38);}return _0x5b4c59['save']();};}function saveUpdates(_0x8ea75,_0x4b6ab4){return function(_0x4140e4){if(_0x4140e4){return _0x4140e4[_0x2f6c('0x20')](_0x8ea75)[_0x2f6c('0x21')](function(_0x15749f){return _0x15749f;});}return null;};}function removeEntity(_0x47092d,_0x3b6c6e){return function(_0x544d2b){if(_0x544d2b){return _0x544d2b[_0x2f6c('0x22')]()[_0x2f6c('0x21')](function(){_0x47092d['status'](0xcc)[_0x2f6c('0x16')]();});}};}function handleEntityNotFound(_0x1343c4,_0x110779){return function(_0x557a46){if(!_0x557a46){_0x1343c4[_0x2f6c('0x15')](0x194);}return _0x557a46;};}function handleError(_0x26daa0,_0x4602d2){_0x4602d2=_0x4602d2||0x1f4;return function(_0x510050){logger['error'](_0x510050['stack']);if(_0x510050[_0x2f6c('0x23')]){delete _0x510050[_0x2f6c('0x23')];}_0x26daa0[_0x2f6c('0x17')](_0x4602d2)[_0x2f6c('0x24')](_0x510050);};}exports[_0x2f6c('0x25')]=function(_0x5ea626,_0x5e2714){var _0x56cfc9={},_0x96b367={},_0x5573a9={'count':0x0,'rows':[]};var _0x55e96b=_[_0x2f6c('0x26')](db[_0x2f6c('0x27')][_0x2f6c('0x28')],function(_0xb4f961){return{'name':_0xb4f961[_0x2f6c('0x29')],'type':_0xb4f961[_0x2f6c('0x2a')][_0x2f6c('0x2b')]};});_0x96b367['model']=_['map'](_0x55e96b,'name');_0x96b367[_0x2f6c('0x2c')]=_[_0x2f6c('0x2d')](_0x5ea626[_0x2f6c('0x2c')]);_0x96b367[_0x2f6c('0x2e')]=_['intersection'](_0x96b367[_0x2f6c('0x2f')],_0x96b367[_0x2f6c('0x2c')]);_0x56cfc9['attributes']=_['intersection'](_0x96b367[_0x2f6c('0x2f')],qs[_0x2f6c('0x30')](_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x30')]));_0x56cfc9[_0x2f6c('0x31')]=_0x56cfc9[_0x2f6c('0x31')][_0x2f6c('0x32')]?_0x56cfc9[_0x2f6c('0x31')]:_0x96b367[_0x2f6c('0x2f')];if(!_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x33')](_0x2f6c('0x34'))){_0x56cfc9['limit']=qs[_0x2f6c('0x1b')](_0x5ea626['query'][_0x2f6c('0x1b')]);_0x56cfc9[_0x2f6c('0x19')]=qs['offset'](_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x19')]);}_0x56cfc9[_0x2f6c('0x35')]=qs['sort'](_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x36')]);_0x56cfc9[_0x2f6c('0x37')]=qs[_0x2f6c('0x2e')](_[_0x2f6c('0x38')](_0x5ea626['query'],_0x96b367[_0x2f6c('0x2e')]),_0x55e96b);if(_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x39')]){_0x56cfc9['where']=_[_0x2f6c('0x3a')](_0x56cfc9[_0x2f6c('0x37')],{'$or':_[_0x2f6c('0x26')](_0x55e96b,function(_0x4f4bac){if(_0x4f4bac[_0x2f6c('0x2a')]!=='VIRTUAL'){var _0x1bac8d={};_0x1bac8d[_0x4f4bac[_0x2f6c('0x23')]]={'$like':'%'+_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x39')]+'%'};return _0x1bac8d;}})});}_0x56cfc9=_[_0x2f6c('0x3a')]({},_0x56cfc9,_0x5ea626['options']);var _0x30d7e7={'where':_0x56cfc9[_0x2f6c('0x37')]};return db['FreshsalesField'][_0x2f6c('0x1c')](_0x30d7e7)['then'](function(_0x3c1ac7){_0x5573a9['count']=_0x3c1ac7;if(_0x5ea626[_0x2f6c('0x2c')][_0x2f6c('0x3b')]){_0x56cfc9[_0x2f6c('0x3c')]=[{'all':!![]}];}return db[_0x2f6c('0x27')]['findAll'](_0x56cfc9);})['then'](function(_0x188396){_0x5573a9[_0x2f6c('0x3d')]=_0x188396;return _0x5573a9;})[_0x2f6c('0x21')](respondWithFilteredResult(_0x5e2714,_0x56cfc9))[_0x2f6c('0x3e')](handleError(_0x5e2714,null));};exports[_0x2f6c('0x3f')]=function(_0xf0a11,_0x514a0c){var _0x2bc6c3={'raw':!![],'where':{'id':_0xf0a11[_0x2f6c('0x40')]['id']}},_0x639414={};_0x639414[_0x2f6c('0x2f')]=_[_0x2f6c('0x2d')](db['FreshsalesField'][_0x2f6c('0x28')]);_0x639414[_0x2f6c('0x2c')]=_[_0x2f6c('0x2d')](_0xf0a11[_0x2f6c('0x2c')]);_0x639414['filters']=_[_0x2f6c('0x41')](_0x639414['model'],_0x639414[_0x2f6c('0x2c')]);_0x2bc6c3[_0x2f6c('0x31')]=_[_0x2f6c('0x41')](_0x639414[_0x2f6c('0x2f')],qs[_0x2f6c('0x30')](_0xf0a11[_0x2f6c('0x2c')][_0x2f6c('0x30')]));_0x2bc6c3['attributes']=_0x2bc6c3['attributes'][_0x2f6c('0x32')]?_0x2bc6c3[_0x2f6c('0x31')]:_0x639414[_0x2f6c('0x2f')];if(_0xf0a11[_0x2f6c('0x2c')][_0x2f6c('0x3b')]){_0x2bc6c3[_0x2f6c('0x3c')]=[{'all':!![]}];}_0x2bc6c3=_[_0x2f6c('0x3a')]({},_0x2bc6c3,_0xf0a11[_0x2f6c('0x42')]);return db[_0x2f6c('0x27')]['find'](_0x2bc6c3)[_0x2f6c('0x21')](handleEntityNotFound(_0x514a0c,null))[_0x2f6c('0x21')](respondWithResult(_0x514a0c,null))['catch'](handleError(_0x514a0c,null));};exports[_0x2f6c('0x43')]=function(_0x18d8c7,_0x2603ee){return db[_0x2f6c('0x27')]['create'](_0x18d8c7['body'],{})['then'](respondWithResult(_0x2603ee,0xc9))['catch'](handleError(_0x2603ee,null));};exports['update']=function(_0xd7d840,_0x1b0faf){if(_0xd7d840[_0x2f6c('0x44')]['id']){delete _0xd7d840[_0x2f6c('0x44')]['id'];}return db[_0x2f6c('0x27')][_0x2f6c('0x45')]({'where':{'id':_0xd7d840[_0x2f6c('0x40')]['id']}})['then'](handleEntityNotFound(_0x1b0faf,null))[_0x2f6c('0x21')](saveUpdates(_0xd7d840[_0x2f6c('0x44')],null))[_0x2f6c('0x21')](respondWithResult(_0x1b0faf,null))[_0x2f6c('0x3e')](handleError(_0x1b0faf,null));};exports[_0x2f6c('0x22')]=function(_0x164f7c,_0x494eba){return db[_0x2f6c('0x27')][_0x2f6c('0x45')]({'where':{'id':_0x164f7c[_0x2f6c('0x40')]['id']}})[_0x2f6c('0x21')](handleEntityNotFound(_0x494eba,null))[_0x2f6c('0x21')](removeEntity(_0x494eba,null))['catch'](handleError(_0x494eba,null));}; \ No newline at end of file +var _0x0024=['name','send','map','FreshsalesField','type','key','model','query','keys','intersection','attributes','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x592fe4,_0xa3d75d){var _0x48b30c=function(_0x4a29da){while(--_0x4a29da){_0x592fe4['push'](_0x592fe4['shift']());}};_0x48b30c(++_0xa3d75d);}(_0x0024,0xb1));var _0x4002=function(_0x5742d0,_0x2c36e8){_0x5742d0=_0x5742d0-0x0;var _0x15c0be=_0x0024[_0x5742d0];return _0x15c0be;};'use strict';var emlformat=require(_0x4002('0x0'));var rimraf=require(_0x4002('0x1'));var zipdir=require(_0x4002('0x2'));var jsonpatch=require(_0x4002('0x3'));var rp=require(_0x4002('0x4'));var moment=require(_0x4002('0x5'));var BPromise=require(_0x4002('0x6'));var Mustache=require(_0x4002('0x7'));var util=require(_0x4002('0x8'));var path=require(_0x4002('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4002('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4002('0xc'));var querystring=require(_0x4002('0xd'));var Papa=require(_0x4002('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4002('0xf'));var as=require(_0x4002('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4002('0x11'))(_0x4002('0x12'));var utils=require('../../config/utils');var config=require(_0x4002('0x13'));var licenseUtil=require(_0x4002('0x14'));var db=require(_0x4002('0x15'))['db'];function respondWithStatusCode(_0x20c851,_0x445529){_0x445529=_0x445529||0xcc;return function(_0xd976ab){if(_0xd976ab){return _0x20c851[_0x4002('0x16')](_0x445529);}return _0x20c851[_0x4002('0x17')](_0x445529)[_0x4002('0x18')]();};}function respondWithResult(_0x4a3394,_0x4e8abb){_0x4e8abb=_0x4e8abb||0xc8;return function(_0x4700d1){if(_0x4700d1){return _0x4a3394[_0x4002('0x17')](_0x4e8abb)[_0x4002('0x19')](_0x4700d1);}};}function respondWithFilteredResult(_0x3d9c28,_0x3dc12a){return function(_0x31116d){if(_0x31116d){var _0x248b69=typeof _0x3dc12a[_0x4002('0x1a')]===_0x4002('0x1b')&&typeof _0x3dc12a[_0x4002('0x1c')]==='undefined';var _0x2c93f7=_0x31116d[_0x4002('0x1d')];var _0x55528f=_0x248b69?0x0:_0x3dc12a[_0x4002('0x1a')];var _0x3c64bf=_0x248b69?_0x31116d[_0x4002('0x1d')]:_0x3dc12a[_0x4002('0x1a')]+_0x3dc12a[_0x4002('0x1c')];var _0x1c9326;if(_0x3c64bf>=_0x2c93f7){_0x3c64bf=_0x2c93f7;_0x1c9326=0xc8;}else{_0x1c9326=0xce;}_0x3d9c28['status'](_0x1c9326);return _0x3d9c28[_0x4002('0x1e')](_0x4002('0x1f'),_0x55528f+'-'+_0x3c64bf+'/'+_0x2c93f7)[_0x4002('0x19')](_0x31116d);}return null;};}function patchUpdates(_0x634a2a){return function(_0x42478c){try{jsonpatch[_0x4002('0x20')](_0x42478c,_0x634a2a,!![]);}catch(_0x108686){return BPromise[_0x4002('0x21')](_0x108686);}return _0x42478c[_0x4002('0x22')]();};}function saveUpdates(_0x312580,_0x47a00f){return function(_0x586bd7){if(_0x586bd7){return _0x586bd7[_0x4002('0x23')](_0x312580)[_0x4002('0x24')](function(_0x513033){return _0x513033;});}return null;};}function removeEntity(_0x396f25,_0x517051){return function(_0x42c7e3){if(_0x42c7e3){return _0x42c7e3['destroy']()[_0x4002('0x24')](function(){_0x396f25[_0x4002('0x17')](0xcc)[_0x4002('0x18')]();});}};}function handleEntityNotFound(_0x4c2b67,_0x3e824e){return function(_0x3fe362){if(!_0x3fe362){_0x4c2b67[_0x4002('0x16')](0x194);}return _0x3fe362;};}function handleError(_0x2969e5,_0x253391){_0x253391=_0x253391||0x1f4;return function(_0x3ae84b){logger[_0x4002('0x25')](_0x3ae84b[_0x4002('0x26')]);if(_0x3ae84b[_0x4002('0x27')]){delete _0x3ae84b[_0x4002('0x27')];}_0x2969e5['status'](_0x253391)[_0x4002('0x28')](_0x3ae84b);};}exports['index']=function(_0x4cedfa,_0x2d1dda){var _0x3dac01={},_0x5b53c6={},_0x1ff863={'count':0x0,'rows':[]};var _0x486a22=_[_0x4002('0x29')](db[_0x4002('0x2a')]['rawAttributes'],function(_0x5655db){return{'name':_0x5655db['fieldName'],'type':_0x5655db[_0x4002('0x2b')][_0x4002('0x2c')]};});_0x5b53c6[_0x4002('0x2d')]=_['map'](_0x486a22,_0x4002('0x27'));_0x5b53c6[_0x4002('0x2e')]=_[_0x4002('0x2f')](_0x4cedfa[_0x4002('0x2e')]);_0x5b53c6['filters']=_[_0x4002('0x30')](_0x5b53c6[_0x4002('0x2d')],_0x5b53c6['query']);_0x3dac01[_0x4002('0x31')]=_[_0x4002('0x30')](_0x5b53c6[_0x4002('0x2d')],qs['fields'](_0x4cedfa[_0x4002('0x2e')]['fields']));_0x3dac01[_0x4002('0x31')]=_0x3dac01[_0x4002('0x31')]['length']?_0x3dac01[_0x4002('0x31')]:_0x5b53c6[_0x4002('0x2d')];if(!_0x4cedfa[_0x4002('0x2e')][_0x4002('0x32')]('nolimit')){_0x3dac01[_0x4002('0x1c')]=qs[_0x4002('0x1c')](_0x4cedfa[_0x4002('0x2e')][_0x4002('0x1c')]);_0x3dac01[_0x4002('0x1a')]=qs[_0x4002('0x1a')](_0x4cedfa[_0x4002('0x2e')][_0x4002('0x1a')]);}_0x3dac01['order']=qs[_0x4002('0x33')](_0x4cedfa[_0x4002('0x2e')][_0x4002('0x33')]);_0x3dac01[_0x4002('0x34')]=qs['filters'](_[_0x4002('0x35')](_0x4cedfa['query'],_0x5b53c6[_0x4002('0x36')]),_0x486a22);if(_0x4cedfa[_0x4002('0x2e')][_0x4002('0x37')]){_0x3dac01[_0x4002('0x34')]=_[_0x4002('0x38')](_0x3dac01[_0x4002('0x34')],{'$or':_[_0x4002('0x29')](_0x486a22,function(_0x2138b9){if(_0x2138b9[_0x4002('0x2b')]!==_0x4002('0x39')){var _0x5d197a={};_0x5d197a[_0x2138b9[_0x4002('0x27')]]={'$like':'%'+_0x4cedfa[_0x4002('0x2e')][_0x4002('0x37')]+'%'};return _0x5d197a;}})});}_0x3dac01=_['merge']({},_0x3dac01,_0x4cedfa['options']);var _0x17e379={'where':_0x3dac01[_0x4002('0x34')]};return db[_0x4002('0x2a')]['count'](_0x17e379)[_0x4002('0x24')](function(_0x249eaf){_0x1ff863[_0x4002('0x1d')]=_0x249eaf;if(_0x4cedfa['query'][_0x4002('0x3a')]){_0x3dac01[_0x4002('0x3b')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4002('0x3c')](_0x3dac01);})[_0x4002('0x24')](function(_0x432f90){_0x1ff863[_0x4002('0x3d')]=_0x432f90;return _0x1ff863;})['then'](respondWithFilteredResult(_0x2d1dda,_0x3dac01))[_0x4002('0x3e')](handleError(_0x2d1dda,null));};exports[_0x4002('0x3f')]=function(_0x5ab976,_0x2251de){var _0x12f113={'raw':!![],'where':{'id':_0x5ab976[_0x4002('0x40')]['id']}},_0x3124b0={};_0x3124b0[_0x4002('0x2d')]=_[_0x4002('0x2f')](db[_0x4002('0x2a')][_0x4002('0x41')]);_0x3124b0[_0x4002('0x2e')]=_[_0x4002('0x2f')](_0x5ab976['query']);_0x3124b0[_0x4002('0x36')]=_[_0x4002('0x30')](_0x3124b0[_0x4002('0x2d')],_0x3124b0['query']);_0x12f113[_0x4002('0x31')]=_[_0x4002('0x30')](_0x3124b0[_0x4002('0x2d')],qs[_0x4002('0x42')](_0x5ab976[_0x4002('0x2e')][_0x4002('0x42')]));_0x12f113[_0x4002('0x31')]=_0x12f113[_0x4002('0x31')]['length']?_0x12f113[_0x4002('0x31')]:_0x3124b0[_0x4002('0x2d')];if(_0x5ab976['query'][_0x4002('0x3a')]){_0x12f113[_0x4002('0x3b')]=[{'all':!![]}];}_0x12f113=_[_0x4002('0x38')]({},_0x12f113,_0x5ab976[_0x4002('0x43')]);return db[_0x4002('0x2a')][_0x4002('0x44')](_0x12f113)[_0x4002('0x24')](handleEntityNotFound(_0x2251de,null))[_0x4002('0x24')](respondWithResult(_0x2251de,null))[_0x4002('0x3e')](handleError(_0x2251de,null));};exports[_0x4002('0x45')]=function(_0x4d05e4,_0x21ccf0){return db[_0x4002('0x2a')][_0x4002('0x45')](_0x4d05e4[_0x4002('0x46')],{})[_0x4002('0x24')](respondWithResult(_0x21ccf0,0xc9))[_0x4002('0x3e')](handleError(_0x21ccf0,null));};exports[_0x4002('0x23')]=function(_0x1784fb,_0x5e9fce){if(_0x1784fb[_0x4002('0x46')]['id']){delete _0x1784fb[_0x4002('0x46')]['id'];}return db[_0x4002('0x2a')][_0x4002('0x44')]({'where':{'id':_0x1784fb['params']['id']}})['then'](handleEntityNotFound(_0x5e9fce,null))['then'](saveUpdates(_0x1784fb[_0x4002('0x46')],null))[_0x4002('0x24')](respondWithResult(_0x5e9fce,null))[_0x4002('0x3e')](handleError(_0x5e9fce,null));};exports[_0x4002('0x47')]=function(_0x5f2577,_0x34cce5){return db[_0x4002('0x2a')][_0x4002('0x44')]({'where':{'id':_0x5f2577['params']['id']}})['then'](handleEntityNotFound(_0x34cce5,null))[_0x4002('0x24')](removeEntity(_0x34cce5,null))[_0x4002('0x3e')](handleError(_0x34cce5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6d664f0..c1aacd0 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 _0x05e3=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3c8eb3,_0x71f0cf){var _0x4221cd=function(_0x35b07a){while(--_0x35b07a){_0x3c8eb3['push'](_0x3c8eb3['shift']());}};_0x4221cd(++_0x71f0cf);}(_0x05e3,0x86));var _0x305e=function(_0x5e8c98,_0xf42c9c){_0x5e8c98=_0x5e8c98-0x0;var _0x487a2a=_0x05e3[_0x5e8c98];return _0x487a2a;};'use strict';var _=require(_0x305e('0x0'));var util=require(_0x305e('0x1'));var logger=require(_0x305e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x305e('0x3'));var rp=require(_0x305e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x305e('0x5'));var config=require(_0x305e('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x305e('0x7')]=function(_0x404744,_0xfadd27){return _0x404744[_0x305e('0x8')](_0x305e('0x9'),attributes,{'tableName':_0x305e('0xa'),'paranoid':![],'indexes':[{'name':_0x305e('0xb'),'fields':[_0x305e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6efe=['define','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x1af79d,_0x33eaeb){var _0x18292b=function(_0x15e3af){while(--_0x15e3af){_0x1af79d['push'](_0x1af79d['shift']());}};_0x18292b(++_0x33eaeb);}(_0x6efe,0xc6));var _0xe6ef=function(_0x40331e,_0xb11990){_0x40331e=_0x40331e-0x0;var _0x4cd8f4=_0x6efe[_0x40331e];return _0x4cd8f4;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ef('0x5'));var rimraf=require(_0xe6ef('0x6'));var config=require(_0xe6ef('0x7'));var attributes=require(_0xe6ef('0x8'));module[_0xe6ef('0x9')]=function(_0x573395,_0x17fc74){return _0x573395[_0xe6ef('0xa')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe6ef('0xb'),_0xe6ef('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 5a66323..c13a7b3 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 _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4600da,_0x45cf25){var _0x36e87f=function(_0x3f989a){while(--_0x3f989a){_0x4600da['push'](_0x4600da['shift']());}};_0x36e87f(++_0x45cf25);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3d68c0,_0x2c4b32){_0x3d68c0=_0x3d68c0-0x0;var _0x34e1b8=_0xb4c7[_0x3d68c0];return _0x34e1b8;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file +var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x41e91b,_0x36f4bb){_0x41e91b=_0x41e91b-0x0;var _0x129af5=_0x3f8a[_0x41e91b];return _0x129af5;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 73e2ef2..009b567 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(_0x38e9c7,_0x37c439){var _0xe72d3a=function(_0x353490){while(--_0x353490){_0x38e9c7['push'](_0x38e9c7['shift']());}};_0xe72d3a(++_0x37c439);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x203258,_0x38952d){var _0xe961a2=function(_0x32ea9e){while(--_0x32ea9e){_0x203258['push'](_0x203258['shift']());}};_0xe961a2(++_0x38952d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 8e81e6d..1316feb 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 _0x6ee9=['exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x6ee9,0x9c));var _0x96ee=function(_0x12e76e,_0x1bb62a){_0x12e76e=_0x12e76e-0x0;var _0x21fa7b=_0x6ee9[_0x12e76e];return _0x21fa7b;};'use strict';var Sequelize=require('sequelize');module[_0x96ee('0x0')]={'name':{'type':Sequelize[_0x96ee('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x96ee('0x1')],'unique':_0x96ee('0x2')},'remoteUri':{'type':Sequelize[_0x96ee('0x1')]},'password':{'type':Sequelize[_0x96ee('0x1')]},'clientId':{'type':Sequelize[_0x96ee('0x1')]},'clientSecret':{'type':Sequelize[_0x96ee('0x1')]},'securityToken':{'type':Sequelize[_0x96ee('0x1')]},'serverUrl':{'type':Sequelize[_0x96ee('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x96ee('0x3')](_0x96ee('0x4'),_0x96ee('0x5')),'defaultValue':_0x96ee('0x4')}}; \ No newline at end of file +var _0x3c8b=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x47eba1,_0x5663e9){var _0x8bccd4=function(_0x2df706){while(--_0x2df706){_0x47eba1['push'](_0x47eba1['shift']());}};_0x8bccd4(++_0x5663e9);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x36f01d,_0x311917){_0x36f01d=_0x36f01d-0x0;var _0x2dc955=_0x3c8b[_0x36f01d];return _0x2dc955;};'use strict';var Sequelize=require('sequelize');module[_0xb3c8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb3c8('0x1')]},'username':{'type':Sequelize[_0xb3c8('0x1')],'unique':_0xb3c8('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb3c8('0x1')]},'clientId':{'type':Sequelize[_0xb3c8('0x1')]},'clientSecret':{'type':Sequelize[_0xb3c8('0x1')]},'securityToken':{'type':Sequelize[_0xb3c8('0x1')]},'serverUrl':{'type':Sequelize[_0xb3c8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb3c8('0x3')](_0xb3c8('0x4'),_0xb3c8('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 10c2b99..e6cfc84 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 _0xb4d4=['merge','VIRTUAL','options','then','includeAll','findAll','catch','show','params','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientSecret','username','securityToken','slice','substring','Connection','clientId','login','concat','isNil','ticketType','sobject','describe','ActivityDate','Subject','Description','string','int','picklist','boolean','textarea','label','custom','picklistValues','value','True','true','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','name','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter'];(function(_0x107118,_0x417eff){var _0x178295=function(_0x5bd305){while(--_0x5bd305){_0x107118['push'](_0x107118['shift']());}};_0x178295(++_0x417eff);}(_0xb4d4,0x11e));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b4d('0x0'));var rimraf=require(_0x4b4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4b4d('0x2'));var moment=require(_0x4b4d('0x3'));var BPromise=require(_0x4b4d('0x4'));var Mustache=require(_0x4b4d('0x5'));var util=require(_0x4b4d('0x6'));var path=require(_0x4b4d('0x7'));var sox=require(_0x4b4d('0x8'));var csv=require(_0x4b4d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b4d('0xa'));var squel=require('squel');var crypto=require(_0x4b4d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b4d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b4d('0xd'));var Redis=require('ioredis');var authService=require(_0x4b4d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4b4d('0xf'));var hardwareService=require(_0x4b4d('0x10'));var logger=require('../../config/logger')(_0x4b4d('0x11'));var utils=require(_0x4b4d('0x12'));var config=require(_0x4b4d('0x13'));var licenseUtil=require(_0x4b4d('0x14'));var db=require(_0x4b4d('0x15'))['db'];var integrations=require(_0x4b4d('0x16'));function respondWithStatusCode(_0x55f495,_0x43c4b4){_0x43c4b4=_0x43c4b4||0xcc;return function(_0x2921b7){if(_0x2921b7){return _0x55f495[_0x4b4d('0x17')](_0x43c4b4);}return _0x55f495[_0x4b4d('0x18')](_0x43c4b4)[_0x4b4d('0x19')]();};}function respondWithResult(_0xfa1000,_0x373941){_0x373941=_0x373941||0xc8;return function(_0x14d8bc){if(_0x14d8bc){return _0xfa1000[_0x4b4d('0x18')](_0x373941)[_0x4b4d('0x1a')](_0x14d8bc);}};}function respondWithFilteredResult(_0x3507b7,_0x54e90f){return function(_0x2444f7){if(_0x2444f7){var _0x3fd882=typeof _0x54e90f[_0x4b4d('0x1b')]==='undefined'&&typeof _0x54e90f[_0x4b4d('0x1c')]===_0x4b4d('0x1d');var _0x290d1c=_0x2444f7[_0x4b4d('0x1e')];var _0x2d1c13=_0x3fd882?0x0:_0x54e90f[_0x4b4d('0x1b')];var _0x44703a=_0x3fd882?_0x2444f7[_0x4b4d('0x1e')]:_0x54e90f['offset']+_0x54e90f[_0x4b4d('0x1c')];var _0x5dbf84;if(_0x44703a>=_0x290d1c){_0x44703a=_0x290d1c;_0x5dbf84=0xc8;}else{_0x5dbf84=0xce;}_0x3507b7[_0x4b4d('0x18')](_0x5dbf84);return _0x3507b7['set'](_0x4b4d('0x1f'),_0x2d1c13+'-'+_0x44703a+'/'+_0x290d1c)[_0x4b4d('0x1a')](_0x2444f7);}return null;};}function patchUpdates(_0x18d1ae){return function(_0xb9f705){try{jsonpatch[_0x4b4d('0x20')](_0xb9f705,_0x18d1ae,!![]);}catch(_0x54dd0f){return BPromise['reject'](_0x54dd0f);}return _0xb9f705['save']();};}function saveUpdates(_0x436e60,_0x10985d){return function(_0x8fff61){if(_0x8fff61){return _0x8fff61[_0x4b4d('0x21')](_0x436e60)['then'](function(_0x270d84){return _0x270d84;});}return null;};}function removeEntity(_0x2f7771,_0x2b3a6d){return function(_0x574248){if(_0x574248){return _0x574248['destroy']()['then'](function(){_0x2f7771['status'](0xcc)[_0x4b4d('0x19')]();});}};}function handleEntityNotFound(_0x2cced2,_0x5078a0){return function(_0x1632a5){if(!_0x1632a5){_0x2cced2[_0x4b4d('0x17')](0x194);}return _0x1632a5;};}function handleError(_0x2bf8ec,_0x12f9ab){_0x12f9ab=_0x12f9ab||0x1f4;return function(_0x233721){logger['error'](_0x233721['stack']);if(_0x233721[_0x4b4d('0x22')]){delete _0x233721[_0x4b4d('0x22')];}_0x2bf8ec['status'](_0x12f9ab)['send'](_0x233721);};}exports['index']=function(_0x2b6e82,_0x32b3af){var _0x46d91c={},_0x11f5f3={},_0x356737={'count':0x0,'rows':[]};var _0x3c7eee=_[_0x4b4d('0x23')](db[_0x4b4d('0x24')][_0x4b4d('0x25')],function(_0x44e217){return{'name':_0x44e217[_0x4b4d('0x26')],'type':_0x44e217[_0x4b4d('0x27')]['key']};});_0x11f5f3[_0x4b4d('0x28')]=_[_0x4b4d('0x23')](_0x3c7eee,'name');_0x11f5f3[_0x4b4d('0x29')]=_[_0x4b4d('0x2a')](_0x2b6e82['query']);_0x11f5f3[_0x4b4d('0x2b')]=_[_0x4b4d('0x2c')](_0x11f5f3[_0x4b4d('0x28')],_0x11f5f3[_0x4b4d('0x29')]);_0x46d91c[_0x4b4d('0x2d')]=_[_0x4b4d('0x2c')](_0x11f5f3['model'],qs[_0x4b4d('0x2e')](_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x2e')]));_0x46d91c[_0x4b4d('0x2d')]=_0x46d91c[_0x4b4d('0x2d')][_0x4b4d('0x2f')]?_0x46d91c[_0x4b4d('0x2d')]:_0x11f5f3[_0x4b4d('0x28')];if(!_0x2b6e82[_0x4b4d('0x29')]['hasOwnProperty'](_0x4b4d('0x30'))){_0x46d91c['limit']=qs[_0x4b4d('0x1c')](_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x1c')]);_0x46d91c['offset']=qs[_0x4b4d('0x1b')](_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x1b')]);}_0x46d91c['order']=qs[_0x4b4d('0x31')](_0x2b6e82[_0x4b4d('0x29')]['sort']);_0x46d91c[_0x4b4d('0x32')]=qs[_0x4b4d('0x2b')](_[_0x4b4d('0x33')](_0x2b6e82[_0x4b4d('0x29')],_0x11f5f3[_0x4b4d('0x2b')]),_0x3c7eee);if(_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x34')]){_0x46d91c[_0x4b4d('0x32')]=_[_0x4b4d('0x35')](_0x46d91c[_0x4b4d('0x32')],{'$or':_['map'](_0x3c7eee,function(_0x4e868f){if(_0x4e868f['type']!==_0x4b4d('0x36')){var _0x2a07ac={};_0x2a07ac[_0x4e868f[_0x4b4d('0x22')]]={'$like':'%'+_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x34')]+'%'};return _0x2a07ac;}})});}_0x46d91c=_['merge']({},_0x46d91c,_0x2b6e82[_0x4b4d('0x37')]);var _0x29b961={'where':_0x46d91c[_0x4b4d('0x32')]};return db[_0x4b4d('0x24')]['count'](_0x29b961)[_0x4b4d('0x38')](function(_0x47609f){_0x356737['count']=_0x47609f;if(_0x2b6e82[_0x4b4d('0x29')][_0x4b4d('0x39')]){_0x46d91c['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x4b4d('0x3a')](_0x46d91c);})[_0x4b4d('0x38')](function(_0xf4aa24){_0x356737['rows']=_0xf4aa24;return _0x356737;})[_0x4b4d('0x38')](respondWithFilteredResult(_0x32b3af,_0x46d91c))[_0x4b4d('0x3b')](handleError(_0x32b3af,null));};exports[_0x4b4d('0x3c')]=function(_0x4e7d2c,_0x3374fb){var _0x3d7a49={'raw':![],'where':{'id':_0x4e7d2c[_0x4b4d('0x3d')]['id']}},_0x4638b2={};_0x4638b2['model']=_[_0x4b4d('0x2a')](db['SalesforceAccount'][_0x4b4d('0x25')]);_0x4638b2[_0x4b4d('0x29')]=_[_0x4b4d('0x2a')](_0x4e7d2c[_0x4b4d('0x29')]);_0x4638b2[_0x4b4d('0x2b')]=_[_0x4b4d('0x2c')](_0x4638b2[_0x4b4d('0x28')],_0x4638b2[_0x4b4d('0x29')]);_0x3d7a49['attributes']=_[_0x4b4d('0x2c')](_0x4638b2[_0x4b4d('0x28')],qs[_0x4b4d('0x2e')](_0x4e7d2c['query']['fields']));_0x3d7a49[_0x4b4d('0x2d')]=_0x3d7a49[_0x4b4d('0x2d')][_0x4b4d('0x2f')]?_0x3d7a49[_0x4b4d('0x2d')]:_0x4638b2['model'];if(_0x4e7d2c[_0x4b4d('0x29')][_0x4b4d('0x39')]){_0x3d7a49['include']=[{'all':!![]}];}_0x3d7a49=_[_0x4b4d('0x35')]({},_0x3d7a49,_0x4e7d2c[_0x4b4d('0x37')]);return db[_0x4b4d('0x24')][_0x4b4d('0x3e')](_0x3d7a49)['then'](handleEntityNotFound(_0x3374fb,null))[_0x4b4d('0x38')](respondWithResult(_0x3374fb,null))['catch'](handleError(_0x3374fb,null));};exports['create']=function(_0x31a217,_0x56f6f6){return db['SalesforceAccount'][_0x4b4d('0x3f')](_0x31a217['body'],{})[_0x4b4d('0x38')](respondWithResult(_0x56f6f6,0xc9))[_0x4b4d('0x3b')](handleError(_0x56f6f6,null));};exports['update']=function(_0x40bb5d,_0x1d8346){if(_0x40bb5d['body']['id']){delete _0x40bb5d[_0x4b4d('0x40')]['id'];}return db[_0x4b4d('0x24')]['find']({'where':{'id':_0x40bb5d[_0x4b4d('0x3d')]['id']}})[_0x4b4d('0x38')](handleEntityNotFound(_0x1d8346,null))[_0x4b4d('0x38')](saveUpdates(_0x40bb5d['body'],null))[_0x4b4d('0x38')](respondWithResult(_0x1d8346,null))[_0x4b4d('0x3b')](handleError(_0x1d8346,null));};exports[_0x4b4d('0x41')]=function(_0x53ac19,_0x3cfab8){return db[_0x4b4d('0x24')][_0x4b4d('0x3e')]({'where':{'id':_0x53ac19[_0x4b4d('0x3d')]['id']}})[_0x4b4d('0x38')](handleEntityNotFound(_0x3cfab8,null))[_0x4b4d('0x38')](removeEntity(_0x3cfab8,null))[_0x4b4d('0x3b')](handleError(_0x3cfab8,null));};exports[_0x4b4d('0x42')]=function(_0x5d6e18,_0x547a6f,_0x4c3f86){var _0x151e30={};var _0x1804f8={};var _0x67f34a;var _0x478f54;return db['SalesforceAccount'][_0x4b4d('0x43')]({'where':{'id':_0x5d6e18[_0x4b4d('0x3d')]['id']}})[_0x4b4d('0x38')](handleEntityNotFound(_0x547a6f,null))[_0x4b4d('0x38')](function(_0x310739){if(_0x310739){_0x67f34a=_0x310739;_0x1804f8[_0x4b4d('0x28')]=_[_0x4b4d('0x2a')](db[_0x4b4d('0x44')][_0x4b4d('0x25')]);_0x1804f8[_0x4b4d('0x29')]=_[_0x4b4d('0x2a')](_0x5d6e18[_0x4b4d('0x29')]);_0x1804f8[_0x4b4d('0x2b')]=_[_0x4b4d('0x2c')](_0x1804f8[_0x4b4d('0x28')],_0x1804f8['query']);_0x151e30['attributes']=_['intersection'](_0x1804f8[_0x4b4d('0x28')],qs[_0x4b4d('0x2e')](_0x5d6e18['query'][_0x4b4d('0x2e')]));_0x151e30[_0x4b4d('0x2d')]=_0x151e30['attributes'][_0x4b4d('0x2f')]?_0x151e30[_0x4b4d('0x2d')]:_0x1804f8[_0x4b4d('0x28')];_0x151e30['order']=qs['sort'](_0x5d6e18['query'][_0x4b4d('0x31')]);_0x151e30['where']=qs[_0x4b4d('0x2b')](_[_0x4b4d('0x33')](_0x5d6e18[_0x4b4d('0x29')],_0x1804f8[_0x4b4d('0x2b')]));if(_0x5d6e18['query'][_0x4b4d('0x34')]){_0x151e30[_0x4b4d('0x32')]=_['merge'](_0x151e30[_0x4b4d('0x32')],{'$or':_['map'](_0x151e30[_0x4b4d('0x2d')],function(_0x391b89){var _0x27862e={};_0x27862e[_0x391b89]={'$like':'%'+_0x5d6e18[_0x4b4d('0x29')][_0x4b4d('0x34')]+'%'};return _0x27862e;})});}_0x151e30=_[_0x4b4d('0x35')]({},_0x151e30,_0x5d6e18[_0x4b4d('0x37')]);return _0x67f34a[_0x4b4d('0x42')](_0x151e30);}})['then'](function(_0x53904c){if(_0x53904c){_0x478f54=_0x53904c[_0x4b4d('0x2f')];if(!_0x5d6e18[_0x4b4d('0x29')][_0x4b4d('0x45')](_0x4b4d('0x30'))){_0x151e30[_0x4b4d('0x1c')]=qs['limit'](_0x5d6e18['query'][_0x4b4d('0x1c')]);_0x151e30[_0x4b4d('0x1b')]=qs[_0x4b4d('0x1b')](_0x5d6e18['query']['offset']);}return _0x67f34a[_0x4b4d('0x42')](_0x151e30);}})[_0x4b4d('0x38')](function(_0x3d3f52){if(_0x3d3f52){return _0x3d3f52?{'count':_0x478f54,'rows':_0x3d3f52}:null;}})[_0x4b4d('0x38')](respondWithResult(_0x547a6f,null))[_0x4b4d('0x3b')](handleError(_0x547a6f,null));};exports['addConfiguration']=function(_0x4d1ca1,_0x58dfc7,_0x10791f){if(_0x4d1ca1['body']['id']){delete _0x4d1ca1[_0x4b4d('0x40')]['id'];}return db[_0x4b4d('0x24')]['findOne']({'where':{'id':_0x4d1ca1[_0x4b4d('0x3d')]['id']}})[_0x4b4d('0x38')](handleEntityNotFound(_0x58dfc7,null))[_0x4b4d('0x38')](function(_0x36d8bb){if(_0x36d8bb){_0x4d1ca1[_0x4b4d('0x40')][_0x4b4d('0x46')]=_0x36d8bb['id'];_0x4d1ca1['body'][_0x4b4d('0x47')]=integrations[_0x4b4d('0x48')](_0x4d1ca1['body']['channel'],_0x4d1ca1[_0x4b4d('0x40')]['type']);_0x4d1ca1[_0x4b4d('0x40')][_0x4b4d('0x49')]=integrations[_0x4b4d('0x4a')](_0x4d1ca1[_0x4b4d('0x40')][_0x4b4d('0x4b')],_0x4d1ca1[_0x4b4d('0x40')]['type']);return db['SalesforceConfiguration'][_0x4b4d('0x3f')](_0x4d1ca1[_0x4b4d('0x40')],{'include':[{'model':db[_0x4b4d('0x4c')],'as':'Subjects'},{'model':db[_0x4b4d('0x4c')],'as':_0x4b4d('0x49')}]});}return null;})[_0x4b4d('0x38')](respondWithResult(_0x58dfc7,null))[_0x4b4d('0x3b')](handleError(_0x58dfc7,null));};exports[_0x4b4d('0x4d')]=function(_0x366f08,_0xd6f755,_0x192425){var _0x1977cb;var _0x30be36='';var _0x2cc548=_0x4b4d('0x4e');return db[_0x4b4d('0x24')][_0x4b4d('0x43')]({'where':{'id':_0x366f08[_0x4b4d('0x3d')]['id']},'attributes':['id',_0x4b4d('0x4f'),'clientId',_0x4b4d('0x50'),_0x4b4d('0x51'),'password',_0x4b4d('0x52')]})[_0x4b4d('0x38')](handleEntityNotFound(_0xd6f755,null))[_0x4b4d('0x38')](function(_0x2963ab){if(_0x2963ab){_0x30be36=_0x2963ab[_0x4b4d('0x4f')];var _0x2a1563=_0x30be36[_0x4b4d('0x53')](-0x1);if(_0x2a1563==='/'){_0x30be36=_0x30be36[_0x4b4d('0x54')](0x0,_0x30be36['lastIndexOf'](_0x2a1563));}_0x1977cb=new jsforce[(_0x4b4d('0x55'))]({'oauth2':{'loginUrl':_0x30be36,'clientId':_0x2963ab[_0x4b4d('0x56')],'clientSecret':_0x2963ab[_0x4b4d('0x50')]}});return _0x1977cb[_0x4b4d('0x57')](_0x2963ab[_0x4b4d('0x51')],_0x2963ab['password'][_0x4b4d('0x58')](_0x2963ab[_0x4b4d('0x52')]));}})['then'](function(_0x2831fa){if(_0x2831fa){if(!_[_0x4b4d('0x59')](_0x366f08[_0x4b4d('0x29')][_0x4b4d('0x5a')])){_0x2cc548=_0x366f08[_0x4b4d('0x29')][_0x4b4d('0x5a')];}return _0x1977cb[_0x4b4d('0x5b')](_0x2cc548)[_0x4b4d('0x5c')]();}})[_0x4b4d('0x38')](function(_0x1a78bd){var _0x38c17b=['OwnerId',_0x4b4d('0x5d'),'IsReminderSet','IsRecurrence',_0x4b4d('0x5e'),_0x4b4d('0x5f')];var _0x58985b=[_0x4b4d('0x60'),_0x4b4d('0x61'),_0x4b4d('0x62'),_0x4b4d('0x63'),'email',_0x4b4d('0x64'),'phone'];if(_0x1a78bd){_['remove'](_0x1a78bd[_0x4b4d('0x2e')],function(_0x536aeb){return _0x38c17b['includes'](_0x536aeb[_0x4b4d('0x22')])||!_0x58985b['includes'](_0x536aeb['type']);});return{'count':_0x1a78bd[_0x4b4d('0x2e')][_0x4b4d('0x2f')],'rows':_['map'](_0x1a78bd[_0x4b4d('0x2e')],function(_0x31c797){return{'id':_0x31c797['name'],'name':_0x31c797[_0x4b4d('0x65')],'custom':_0x31c797[_0x4b4d('0x66')],'options':_0x31c797[_0x4b4d('0x67')][_0x4b4d('0x2f')]>0x0?_[_0x4b4d('0x23')](_0x31c797[_0x4b4d('0x67')],function(_0x58d3d1){return{'name':_0x58d3d1['label'],'value':_0x58d3d1[_0x4b4d('0x68')]};}):_0x31c797[_0x4b4d('0x27')]=='boolean'?[{'name':_0x4b4d('0x69'),'value':_0x4b4d('0x6a')},{'name':_0x4b4d('0x6b'),'value':'false'}]:[]};})};}})[_0x4b4d('0x38')](respondWithResult(_0xd6f755,null))[_0x4b4d('0x3b')](function(_0x3d2be6){var _0x18997f=_0x366f08[_0x4b4d('0x29')][_0x4b4d('0x6c')]?0x1f4:_0x3d2be6[_0x4b4d('0x6d')]||0x1f4;logger[_0x4b4d('0x6e')](_0x4b4d('0x6f'),_0x4b4d('0x4d'),_0x18997f,JSON['stringify'](_0x3d2be6));delete _0x3d2be6[_0x4b4d('0x22')];if(_0x18997f===0x191){_0x18997f=0x190;}_0xd6f755['status'](_0x18997f)[_0x4b4d('0x70')](_0x366f08['query'][_0x4b4d('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3d2be6[_0x4b4d('0x6d')]}:_0x3d2be6);});}; \ No newline at end of file +var _0x4d63=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','getConfigurations','SalesforceConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','substring','Connection','concat','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','includes','label','custom','picklistValues','value','True','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d63,0x1ce));var _0x34d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d63[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34d6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34d6('0x1'));var rp=require(_0x34d6('0x2'));var moment=require(_0x34d6('0x3'));var BPromise=require(_0x34d6('0x4'));var Mustache=require(_0x34d6('0x5'));var util=require(_0x34d6('0x6'));var path=require(_0x34d6('0x7'));var sox=require(_0x34d6('0x8'));var csv=require(_0x34d6('0x9'));var ejs=require(_0x34d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34d6('0xb'));var squel=require(_0x34d6('0xc'));var crypto=require(_0x34d6('0xd'));var jsforce=require(_0x34d6('0xe'));var deskjs=require(_0x34d6('0xf'));var toCsv=require(_0x34d6('0x9'));var querystring=require(_0x34d6('0x10'));var Papa=require(_0x34d6('0x11'));var Redis=require('ioredis');var authService=require(_0x34d6('0x12'));var qs=require(_0x34d6('0x13'));var as=require(_0x34d6('0x14'));var hardwareService=require(_0x34d6('0x15'));var logger=require(_0x34d6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x34d6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x34d6('0x18'))['db'];var integrations=require(_0x34d6('0x19'));function respondWithStatusCode(_0xef1940,_0x457bea){_0x457bea=_0x457bea||0xcc;return function(_0x136453){if(_0x136453){return _0xef1940['sendStatus'](_0x457bea);}return _0xef1940['status'](_0x457bea)[_0x34d6('0x1a')]();};}function respondWithResult(_0x2472e1,_0x22e7c5){_0x22e7c5=_0x22e7c5||0xc8;return function(_0x468f3f){if(_0x468f3f){return _0x2472e1[_0x34d6('0x1b')](_0x22e7c5)[_0x34d6('0x1c')](_0x468f3f);}};}function respondWithFilteredResult(_0x19d3d9,_0x12b613){return function(_0x80c730){if(_0x80c730){var _0x2754c7=typeof _0x12b613[_0x34d6('0x1d')]===_0x34d6('0x1e')&&typeof _0x12b613['limit']===_0x34d6('0x1e');var _0x1cbb51=_0x80c730[_0x34d6('0x1f')];var _0x2bed26=_0x2754c7?0x0:_0x12b613['offset'];var _0x2b94f0=_0x2754c7?_0x80c730[_0x34d6('0x1f')]:_0x12b613[_0x34d6('0x1d')]+_0x12b613[_0x34d6('0x20')];var _0x502390;if(_0x2b94f0>=_0x1cbb51){_0x2b94f0=_0x1cbb51;_0x502390=0xc8;}else{_0x502390=0xce;}_0x19d3d9[_0x34d6('0x1b')](_0x502390);return _0x19d3d9[_0x34d6('0x21')](_0x34d6('0x22'),_0x2bed26+'-'+_0x2b94f0+'/'+_0x1cbb51)[_0x34d6('0x1c')](_0x80c730);}return null;};}function patchUpdates(_0x674a4e){return function(_0x570876){try{jsonpatch[_0x34d6('0x23')](_0x570876,_0x674a4e,!![]);}catch(_0x57579b){return BPromise[_0x34d6('0x24')](_0x57579b);}return _0x570876[_0x34d6('0x25')]();};}function saveUpdates(_0x56c7c5,_0x580f1d){return function(_0x148c6b){if(_0x148c6b){return _0x148c6b[_0x34d6('0x26')](_0x56c7c5)[_0x34d6('0x27')](function(_0x2e4fea){return _0x2e4fea;});}return null;};}function removeEntity(_0x163451,_0x2ca071){return function(_0x3b6c41){if(_0x3b6c41){return _0x3b6c41[_0x34d6('0x28')]()[_0x34d6('0x27')](function(){_0x163451[_0x34d6('0x1b')](0xcc)[_0x34d6('0x1a')]();});}};}function handleEntityNotFound(_0x480964,_0x10622d){return function(_0x29a92a){if(!_0x29a92a){_0x480964[_0x34d6('0x29')](0x194);}return _0x29a92a;};}function handleError(_0x5cf1b2,_0x32c150){_0x32c150=_0x32c150||0x1f4;return function(_0x2eced4){logger[_0x34d6('0x2a')](_0x2eced4[_0x34d6('0x2b')]);if(_0x2eced4[_0x34d6('0x2c')]){delete _0x2eced4[_0x34d6('0x2c')];}_0x5cf1b2[_0x34d6('0x1b')](_0x32c150)[_0x34d6('0x2d')](_0x2eced4);};}exports['index']=function(_0x56e10b,_0x504048){var _0x1084ac={},_0x43d421={},_0x366582={'count':0x0,'rows':[]};var _0x208e29=_[_0x34d6('0x2e')](db[_0x34d6('0x2f')]['rawAttributes'],function(_0x1200c5){return{'name':_0x1200c5[_0x34d6('0x30')],'type':_0x1200c5[_0x34d6('0x31')][_0x34d6('0x32')]};});_0x43d421[_0x34d6('0x33')]=_[_0x34d6('0x2e')](_0x208e29,_0x34d6('0x2c'));_0x43d421[_0x34d6('0x34')]=_[_0x34d6('0x35')](_0x56e10b[_0x34d6('0x34')]);_0x43d421[_0x34d6('0x36')]=_[_0x34d6('0x37')](_0x43d421['model'],_0x43d421['query']);_0x1084ac['attributes']=_[_0x34d6('0x37')](_0x43d421[_0x34d6('0x33')],qs['fields'](_0x56e10b['query'][_0x34d6('0x38')]));_0x1084ac[_0x34d6('0x39')]=_0x1084ac[_0x34d6('0x39')][_0x34d6('0x3a')]?_0x1084ac[_0x34d6('0x39')]:_0x43d421[_0x34d6('0x33')];if(!_0x56e10b[_0x34d6('0x34')][_0x34d6('0x3b')]('nolimit')){_0x1084ac[_0x34d6('0x20')]=qs[_0x34d6('0x20')](_0x56e10b[_0x34d6('0x34')][_0x34d6('0x20')]);_0x1084ac[_0x34d6('0x1d')]=qs['offset'](_0x56e10b['query'][_0x34d6('0x1d')]);}_0x1084ac[_0x34d6('0x3c')]=qs['sort'](_0x56e10b[_0x34d6('0x34')][_0x34d6('0x3d')]);_0x1084ac['where']=qs['filters'](_[_0x34d6('0x3e')](_0x56e10b[_0x34d6('0x34')],_0x43d421[_0x34d6('0x36')]),_0x208e29);if(_0x56e10b['query'][_0x34d6('0x3f')]){_0x1084ac[_0x34d6('0x40')]=_[_0x34d6('0x41')](_0x1084ac[_0x34d6('0x40')],{'$or':_[_0x34d6('0x2e')](_0x208e29,function(_0x599a59){if(_0x599a59[_0x34d6('0x31')]!==_0x34d6('0x42')){var _0x134ccb={};_0x134ccb[_0x599a59['name']]={'$like':'%'+_0x56e10b[_0x34d6('0x34')][_0x34d6('0x3f')]+'%'};return _0x134ccb;}})});}_0x1084ac=_['merge']({},_0x1084ac,_0x56e10b[_0x34d6('0x43')]);var _0xf223af={'where':_0x1084ac[_0x34d6('0x40')]};return db[_0x34d6('0x2f')][_0x34d6('0x1f')](_0xf223af)['then'](function(_0x961096){_0x366582['count']=_0x961096;if(_0x56e10b[_0x34d6('0x34')][_0x34d6('0x44')]){_0x1084ac[_0x34d6('0x45')]=[{'all':!![]}];}return db[_0x34d6('0x2f')][_0x34d6('0x46')](_0x1084ac);})[_0x34d6('0x27')](function(_0x4faed9){_0x366582['rows']=_0x4faed9;return _0x366582;})['then'](respondWithFilteredResult(_0x504048,_0x1084ac))[_0x34d6('0x47')](handleError(_0x504048,null));};exports[_0x34d6('0x48')]=function(_0x385538,_0x246bd3){var _0x537e09={'raw':![],'where':{'id':_0x385538[_0x34d6('0x49')]['id']}},_0x30afe9={};_0x30afe9[_0x34d6('0x33')]=_[_0x34d6('0x35')](db[_0x34d6('0x2f')][_0x34d6('0x4a')]);_0x30afe9['query']=_[_0x34d6('0x35')](_0x385538[_0x34d6('0x34')]);_0x30afe9[_0x34d6('0x36')]=_[_0x34d6('0x37')](_0x30afe9[_0x34d6('0x33')],_0x30afe9['query']);_0x537e09[_0x34d6('0x39')]=_[_0x34d6('0x37')](_0x30afe9[_0x34d6('0x33')],qs[_0x34d6('0x38')](_0x385538[_0x34d6('0x34')][_0x34d6('0x38')]));_0x537e09[_0x34d6('0x39')]=_0x537e09[_0x34d6('0x39')]['length']?_0x537e09[_0x34d6('0x39')]:_0x30afe9[_0x34d6('0x33')];if(_0x385538[_0x34d6('0x34')]['includeAll']){_0x537e09[_0x34d6('0x45')]=[{'all':!![]}];}_0x537e09=_['merge']({},_0x537e09,_0x385538['options']);return db[_0x34d6('0x2f')][_0x34d6('0x4b')](_0x537e09)['then'](handleEntityNotFound(_0x246bd3,null))['then'](respondWithResult(_0x246bd3,null))[_0x34d6('0x47')](handleError(_0x246bd3,null));};exports['create']=function(_0x192992,_0xc0a33e){return db[_0x34d6('0x2f')]['create'](_0x192992[_0x34d6('0x4c')],{})[_0x34d6('0x27')](respondWithResult(_0xc0a33e,0xc9))['catch'](handleError(_0xc0a33e,null));};exports[_0x34d6('0x26')]=function(_0x278b39,_0x159ba2){if(_0x278b39[_0x34d6('0x4c')]['id']){delete _0x278b39[_0x34d6('0x4c')]['id'];}return db[_0x34d6('0x2f')][_0x34d6('0x4b')]({'where':{'id':_0x278b39[_0x34d6('0x49')]['id']}})[_0x34d6('0x27')](handleEntityNotFound(_0x159ba2,null))[_0x34d6('0x27')](saveUpdates(_0x278b39[_0x34d6('0x4c')],null))[_0x34d6('0x27')](respondWithResult(_0x159ba2,null))[_0x34d6('0x47')](handleError(_0x159ba2,null));};exports[_0x34d6('0x28')]=function(_0x306765,_0xdc6205){return db[_0x34d6('0x2f')][_0x34d6('0x4b')]({'where':{'id':_0x306765[_0x34d6('0x49')]['id']}})[_0x34d6('0x27')](handleEntityNotFound(_0xdc6205,null))[_0x34d6('0x27')](removeEntity(_0xdc6205,null))[_0x34d6('0x47')](handleError(_0xdc6205,null));};exports[_0x34d6('0x4d')]=function(_0x2b2d29,_0x30672d,_0xa42b74){var _0x476053={};var _0x16b450={};var _0x5c02bc;var _0x4518cc;return db[_0x34d6('0x2f')]['findOne']({'where':{'id':_0x2b2d29[_0x34d6('0x49')]['id']}})[_0x34d6('0x27')](handleEntityNotFound(_0x30672d,null))[_0x34d6('0x27')](function(_0x4ebf8a){if(_0x4ebf8a){_0x5c02bc=_0x4ebf8a;_0x16b450['model']=_[_0x34d6('0x35')](db[_0x34d6('0x4e')][_0x34d6('0x4a')]);_0x16b450[_0x34d6('0x34')]=_[_0x34d6('0x35')](_0x2b2d29[_0x34d6('0x34')]);_0x16b450[_0x34d6('0x36')]=_['intersection'](_0x16b450['model'],_0x16b450[_0x34d6('0x34')]);_0x476053[_0x34d6('0x39')]=_[_0x34d6('0x37')](_0x16b450[_0x34d6('0x33')],qs[_0x34d6('0x38')](_0x2b2d29[_0x34d6('0x34')][_0x34d6('0x38')]));_0x476053[_0x34d6('0x39')]=_0x476053[_0x34d6('0x39')][_0x34d6('0x3a')]?_0x476053[_0x34d6('0x39')]:_0x16b450['model'];_0x476053[_0x34d6('0x3c')]=qs[_0x34d6('0x3d')](_0x2b2d29[_0x34d6('0x34')]['sort']);_0x476053[_0x34d6('0x40')]=qs['filters'](_['pick'](_0x2b2d29[_0x34d6('0x34')],_0x16b450[_0x34d6('0x36')]));if(_0x2b2d29[_0x34d6('0x34')]['filter']){_0x476053[_0x34d6('0x40')]=_[_0x34d6('0x41')](_0x476053[_0x34d6('0x40')],{'$or':_[_0x34d6('0x2e')](_0x476053[_0x34d6('0x39')],function(_0x377d09){var _0x4ddfec={};_0x4ddfec[_0x377d09]={'$like':'%'+_0x2b2d29[_0x34d6('0x34')][_0x34d6('0x3f')]+'%'};return _0x4ddfec;})});}_0x476053=_[_0x34d6('0x41')]({},_0x476053,_0x2b2d29[_0x34d6('0x43')]);return _0x5c02bc[_0x34d6('0x4d')](_0x476053);}})[_0x34d6('0x27')](function(_0x3ef5ea){if(_0x3ef5ea){_0x4518cc=_0x3ef5ea[_0x34d6('0x3a')];if(!_0x2b2d29[_0x34d6('0x34')][_0x34d6('0x3b')]('nolimit')){_0x476053['limit']=qs[_0x34d6('0x20')](_0x2b2d29['query'][_0x34d6('0x20')]);_0x476053[_0x34d6('0x1d')]=qs[_0x34d6('0x1d')](_0x2b2d29[_0x34d6('0x34')]['offset']);}return _0x5c02bc['getConfigurations'](_0x476053);}})[_0x34d6('0x27')](function(_0x22663c){if(_0x22663c){return _0x22663c?{'count':_0x4518cc,'rows':_0x22663c}:null;}})['then'](respondWithResult(_0x30672d,null))['catch'](handleError(_0x30672d,null));};exports['addConfiguration']=function(_0x41b2a5,_0x275fdc,_0x474097){if(_0x41b2a5[_0x34d6('0x4c')]['id']){delete _0x41b2a5[_0x34d6('0x4c')]['id'];}return db[_0x34d6('0x2f')][_0x34d6('0x4f')]({'where':{'id':_0x41b2a5[_0x34d6('0x49')]['id']}})[_0x34d6('0x27')](handleEntityNotFound(_0x275fdc,null))[_0x34d6('0x27')](function(_0x2d3029){if(_0x2d3029){_0x41b2a5[_0x34d6('0x4c')]['AccountId']=_0x2d3029['id'];_0x41b2a5[_0x34d6('0x4c')][_0x34d6('0x50')]=integrations[_0x34d6('0x51')](_0x41b2a5[_0x34d6('0x4c')][_0x34d6('0x52')],_0x41b2a5[_0x34d6('0x4c')][_0x34d6('0x31')]);_0x41b2a5[_0x34d6('0x4c')][_0x34d6('0x53')]=integrations['getDescriptions'](_0x41b2a5['body'][_0x34d6('0x52')],_0x41b2a5[_0x34d6('0x4c')][_0x34d6('0x31')]);return db[_0x34d6('0x4e')]['create'](_0x41b2a5[_0x34d6('0x4c')],{'include':[{'model':db['SalesforceField'],'as':_0x34d6('0x50')},{'model':db[_0x34d6('0x54')],'as':_0x34d6('0x53')}]});}return null;})[_0x34d6('0x27')](respondWithResult(_0x275fdc,null))[_0x34d6('0x47')](handleError(_0x275fdc,null));};exports[_0x34d6('0x55')]=function(_0x519bc1,_0x4f593b,_0x4a3e74){var _0x48a482;var _0x340c23='';var _0x23e7b0=_0x34d6('0x56');return db[_0x34d6('0x2f')]['findOne']({'where':{'id':_0x519bc1['params']['id']},'attributes':['id',_0x34d6('0x57'),_0x34d6('0x58'),'clientSecret',_0x34d6('0x59'),_0x34d6('0x5a'),_0x34d6('0x5b')]})[_0x34d6('0x27')](handleEntityNotFound(_0x4f593b,null))[_0x34d6('0x27')](function(_0x419e8e){if(_0x419e8e){_0x340c23=_0x419e8e[_0x34d6('0x57')];var _0xa9db1f=_0x340c23['slice'](-0x1);if(_0xa9db1f==='/'){_0x340c23=_0x340c23[_0x34d6('0x5c')](0x0,_0x340c23['lastIndexOf'](_0xa9db1f));}_0x48a482=new jsforce[(_0x34d6('0x5d'))]({'oauth2':{'loginUrl':_0x340c23,'clientId':_0x419e8e[_0x34d6('0x58')],'clientSecret':_0x419e8e['clientSecret']}});return _0x48a482['login'](_0x419e8e[_0x34d6('0x59')],_0x419e8e[_0x34d6('0x5a')][_0x34d6('0x5e')](_0x419e8e[_0x34d6('0x5b')]));}})[_0x34d6('0x27')](function(_0x3e6156){if(_0x3e6156){if(!_[_0x34d6('0x5f')](_0x519bc1['query'][_0x34d6('0x60')])){_0x23e7b0=_0x519bc1[_0x34d6('0x34')][_0x34d6('0x60')];}return _0x48a482[_0x34d6('0x61')](_0x23e7b0)[_0x34d6('0x62')]();}})[_0x34d6('0x27')](function(_0x25ac47){var _0x29b56e=['OwnerId','ActivityDate',_0x34d6('0x63'),_0x34d6('0x64'),'Subject',_0x34d6('0x65')];var _0x59990e=[_0x34d6('0x66'),_0x34d6('0x67'),_0x34d6('0x68'),_0x34d6('0x69'),'email','textarea','phone'];if(_0x25ac47){_['remove'](_0x25ac47[_0x34d6('0x38')],function(_0x300f21){return _0x29b56e[_0x34d6('0x6a')](_0x300f21[_0x34d6('0x2c')])||!_0x59990e['includes'](_0x300f21[_0x34d6('0x31')]);});return{'count':_0x25ac47[_0x34d6('0x38')][_0x34d6('0x3a')],'rows':_[_0x34d6('0x2e')](_0x25ac47['fields'],function(_0x5d84fb){return{'id':_0x5d84fb[_0x34d6('0x2c')],'name':_0x5d84fb[_0x34d6('0x6b')],'custom':_0x5d84fb[_0x34d6('0x6c')],'options':_0x5d84fb['picklistValues'][_0x34d6('0x3a')]>0x0?_[_0x34d6('0x2e')](_0x5d84fb[_0x34d6('0x6d')],function(_0x10aa7f){return{'name':_0x10aa7f[_0x34d6('0x6b')],'value':_0x10aa7f[_0x34d6('0x6e')]};}):_0x5d84fb['type']==_0x34d6('0x69')?[{'name':_0x34d6('0x6f'),'value':'true'},{'name':_0x34d6('0x70'),'value':_0x34d6('0x71')}]:[]};})};}})[_0x34d6('0x27')](respondWithResult(_0x4f593b,null))[_0x34d6('0x47')](function(_0x3611a3){var _0x5c0167=_0x519bc1[_0x34d6('0x34')][_0x34d6('0x72')]?0x1f4:_0x3611a3['statusCode']||0x1f4;logger[_0x34d6('0x2a')](_0x34d6('0x73'),_0x34d6('0x55'),_0x5c0167,JSON[_0x34d6('0x74')](_0x3611a3));delete _0x3611a3[_0x34d6('0x2c')];if(_0x5c0167===0x191){_0x5c0167=0x190;}_0x4f593b[_0x34d6('0x1b')](_0x5c0167)[_0x34d6('0x2d')](_0x519bc1['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3611a3[_0x34d6('0x75')]}:_0x3611a3);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a2481b5..3e0e90e 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 _0x393e=['int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount'];(function(_0x41c2f4,_0x5732c9){var _0x16a4bd=function(_0x4d83ce){while(--_0x4d83ce){_0x41c2f4['push'](_0x41c2f4['shift']());}};_0x16a4bd(++_0x5732c9);}(_0x393e,0x105));var _0xe393=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x393e[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xe393('0x0'));var util=require(_0xe393('0x1'));var logger=require(_0xe393('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe393('0x3'));var rp=require(_0xe393('0x4'));var fs=require('fs');var path=require(_0xe393('0x5'));var rimraf=require(_0xe393('0x6'));var config=require(_0xe393('0x7'));var attributes=require(_0xe393('0x8'));var integrations=require(_0xe393('0x9'));module['exports']=function(_0xb59a16,_0x4529c1){return _0xb59a16[_0xe393('0xa')](_0xe393('0xb'),attributes,{'tableName':_0xe393('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x928a=['define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x928a,0x19b));var _0xa928=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x928a[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0xa928('0x0'));var logger=require(_0xa928('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa928('0x2'));var rp=require(_0xa928('0x3'));var fs=require('fs');var path=require(_0xa928('0x4'));var rimraf=require(_0xa928('0x5'));var config=require(_0xa928('0x6'));var attributes=require(_0xa928('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xa928('0x8')]=function(_0x15a0ce,_0x49a47d){return _0x15a0ce[_0xa928('0x9')](_0xa928('0xa'),attributes,{'tableName':_0xa928('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 94c06a7..c41f1bf 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 _0x71c4=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','SalesforceAccount','options','raw','attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','where','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x776466,_0x55877f){var _0x4053a1=function(_0x5a2f90){while(--_0x5a2f90){_0x776466['push'](_0x776466['shift']());}};_0x4053a1(++_0x55877f);}(_0x71c4,0xa0));var _0x471c=function(_0x5b9e68,_0x438bd7){_0x5b9e68=_0x5b9e68-0x0;var _0x2b3c7f=_0x71c4[_0x5b9e68];return _0x2b3c7f;};'use strict';var _=require(_0x471c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x471c('0x1'));var rs=require(_0x471c('0x2'));var fs=require('fs');var Redis=require(_0x471c('0x3'));var db=require(_0x471c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x471c('0x5'))(_0x471c('0x6'));var config=require('../../config/environment');var jayson=require(_0x471c('0x7'));var client=jayson[_0x471c('0x8')][_0x471c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x281cd5,_0x1d7ced,_0x372321){return new BPromise(function(_0xfe491c,_0x55bf44){return client[_0x471c('0xa')](_0x281cd5,_0x372321)[_0x471c('0xb')](function(_0x212edd){logger[_0x471c('0xc')](_0x471c('0xd'),_0x1d7ced,_0x471c('0xe'));logger[_0x471c('0xf')](_0x471c('0x10'),_0x1d7ced,_0x471c('0xe'),JSON[_0x471c('0x11')](_0x212edd));if(_0x212edd['error']){if(_0x212edd['error'][_0x471c('0x12')]===0x1f4){logger['error'](_0x471c('0xd'),_0x1d7ced,_0x212edd[_0x471c('0x13')][_0x471c('0x14')]);return _0x55bf44(_0x212edd['error'][_0x471c('0x14')]);}logger[_0x471c('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1d7ced,_0x212edd['error'][_0x471c('0x14')]);return _0xfe491c(_0x212edd[_0x471c('0x13')][_0x471c('0x14')]);}else{logger[_0x471c('0xc')](_0x471c('0xd'),_0x1d7ced,_0x471c('0xe'));_0xfe491c(_0x212edd['result']['message']);}})[_0x471c('0x15')](function(_0x44bc6c){logger[_0x471c('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x1d7ced,_0x44bc6c);_0x55bf44(_0x44bc6c);});});}exports['GetSalesforceAccount']=function(_0x3f4861){var _0x59af85=this;return new Promise(function(_0x1b95e0,_0x210c40){return db[_0x471c('0x16')]['findAll']({'raw':_0x3f4861[_0x471c('0x17')]?_0x3f4861[_0x471c('0x17')][_0x471c('0x18')]===undefined?!![]:![]:!![],'where':_0x3f4861[_0x471c('0x17')]?_0x3f4861[_0x471c('0x17')]['where']||null:null,'attributes':_0x3f4861[_0x471c('0x17')]?_0x3f4861[_0x471c('0x17')][_0x471c('0x19')]||null:null,'limit':_0x3f4861[_0x471c('0x17')]?_0x3f4861[_0x471c('0x17')][_0x471c('0x1a')]||null:null,'include':_0x3f4861[_0x471c('0x17')]?_0x3f4861[_0x471c('0x17')][_0x471c('0x1b')]?_[_0x471c('0x1c')](_0x3f4861[_0x471c('0x17')]['include'],function(_0x994ee9){return{'model':db[_0x994ee9[_0x471c('0x1d')]],'as':_0x994ee9['as'],'attributes':_0x994ee9['attributes'],'include':_0x994ee9[_0x471c('0x1b')]?_[_0x471c('0x1c')](_0x994ee9[_0x471c('0x1b')],function(_0x4d0f9c){return{'model':db[_0x4d0f9c[_0x471c('0x1d')]],'as':_0x4d0f9c['as'],'attributes':_0x4d0f9c['attributes'],'include':_0x4d0f9c[_0x471c('0x1b')]?_[_0x471c('0x1c')](_0x4d0f9c['include'],function(_0x1423d0){return{'model':db[_0x1423d0['model']],'as':_0x1423d0['as'],'attributes':_0x1423d0[_0x471c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x471c('0xb')](function(_0x99bfe5){logger[_0x471c('0xc')](_0x471c('0x1e'),_0x3f4861);logger[_0x471c('0xf')](_0x471c('0x1e'),_0x3f4861,JSON[_0x471c('0x11')](_0x99bfe5));_0x1b95e0(_0x99bfe5);})['catch'](function(_0x523f36){logger[_0x471c('0x13')](_0x471c('0x1e'),_0x523f36[_0x471c('0x14')],_0x3f4861);_0x210c40(_0x59af85[_0x471c('0x13')](0x1f4,_0x523f36[_0x471c('0x14')]));});});};exports[_0x471c('0x1f')]=function(_0xe3f3e7){var _0x31a100=this;return new Promise(function(_0x3f5e3c,_0x16860d){return db[_0x471c('0x16')]['find']({'raw':_0xe3f3e7[_0x471c('0x17')]?_0xe3f3e7[_0x471c('0x17')][_0x471c('0x18')]===undefined?!![]:![]:!![],'where':_0xe3f3e7['options']?_0xe3f3e7[_0x471c('0x17')][_0x471c('0x20')]||null:null,'attributes':_0xe3f3e7[_0x471c('0x17')]?_0xe3f3e7['options'][_0x471c('0x19')]||null:null,'include':_0xe3f3e7[_0x471c('0x17')]?_0xe3f3e7[_0x471c('0x17')][_0x471c('0x1b')]?_[_0x471c('0x1c')](_0xe3f3e7['options'][_0x471c('0x1b')],function(_0x48573c){return{'model':db[_0x48573c[_0x471c('0x1d')]],'as':_0x48573c['as'],'attributes':_0x48573c['attributes'],'include':_0x48573c[_0x471c('0x1b')]?_[_0x471c('0x1c')](_0x48573c['include'],function(_0x3d6e3c){return{'model':db[_0x3d6e3c[_0x471c('0x1d')]],'as':_0x3d6e3c['as'],'attributes':_0x3d6e3c['attributes'],'include':_0x3d6e3c[_0x471c('0x1b')]?_[_0x471c('0x1c')](_0x3d6e3c[_0x471c('0x1b')],function(_0x4401d4){return{'model':db[_0x4401d4['model']],'as':_0x4401d4['as'],'attributes':_0x4401d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x471c('0xb')](function(_0x5e3475){logger[_0x471c('0xc')]('ShowSalesforceAccount',_0xe3f3e7);logger[_0x471c('0xf')](_0x471c('0x1f'),_0xe3f3e7,JSON[_0x471c('0x11')](_0x5e3475));_0x3f5e3c(_0x5e3475);})['catch'](function(_0x13d9d5){logger[_0x471c('0x13')](_0x471c('0x1f'),_0x13d9d5['message'],_0xe3f3e7);_0x16860d(_0x31a100[_0x471c('0x13')](0x1f4,_0x13d9d5['message']));});});}; \ No newline at end of file +var _0xd5f8=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowSalesforceAccount','find','lodash','util','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd5f8,0x1d1));var _0x8d5f=function(_0x37d6e5,_0x58b98e){_0x37d6e5=_0x37d6e5-0x0;var _0x5db94d=_0xd5f8[_0x37d6e5];return _0x5db94d;};'use strict';var _=require(_0x8d5f('0x0'));var util=require(_0x8d5f('0x1'));var moment=require(_0x8d5f('0x2'));var BPromise=require(_0x8d5f('0x3'));var rs=require(_0x8d5f('0x4'));var fs=require('fs');var Redis=require(_0x8d5f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d5f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8d5f('0x7'));var jayson=require(_0x8d5f('0x8'));var client=jayson[_0x8d5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8ac6,_0x19088e,_0x2c297b){return new BPromise(function(_0x3b1dd4,_0xaef3){return client[_0x8d5f('0xa')](_0x2b8ac6,_0x2c297b)[_0x8d5f('0xb')](function(_0x1b2999){logger[_0x8d5f('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x19088e,'request\x20sent');logger['debug'](_0x8d5f('0xd'),_0x19088e,_0x8d5f('0xe'),JSON[_0x8d5f('0xf')](_0x1b2999));if(_0x1b2999[_0x8d5f('0x10')]){if(_0x1b2999[_0x8d5f('0x10')][_0x8d5f('0x11')]===0x1f4){logger['error'](_0x8d5f('0x12'),_0x19088e,_0x1b2999[_0x8d5f('0x10')][_0x8d5f('0x13')]);return _0xaef3(_0x1b2999[_0x8d5f('0x10')]['message']);}logger[_0x8d5f('0x10')](_0x8d5f('0x12'),_0x19088e,_0x1b2999[_0x8d5f('0x10')][_0x8d5f('0x13')]);return _0x3b1dd4(_0x1b2999[_0x8d5f('0x10')][_0x8d5f('0x13')]);}else{logger[_0x8d5f('0xc')](_0x8d5f('0x12'),_0x19088e,_0x8d5f('0xe'));_0x3b1dd4(_0x1b2999[_0x8d5f('0x14')][_0x8d5f('0x13')]);}})[_0x8d5f('0x15')](function(_0x1a1e75){logger[_0x8d5f('0x10')](_0x8d5f('0x12'),_0x19088e,_0x1a1e75);_0xaef3(_0x1a1e75);});});}exports[_0x8d5f('0x16')]=function(_0x8b463){var _0x31445b=this;return new Promise(function(_0x527e06,_0xd91181){return db[_0x8d5f('0x17')][_0x8d5f('0x18')]({'raw':_0x8b463['options']?_0x8b463[_0x8d5f('0x19')][_0x8d5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x8b463[_0x8d5f('0x19')]?_0x8b463[_0x8d5f('0x19')][_0x8d5f('0x1b')]||null:null,'attributes':_0x8b463[_0x8d5f('0x19')]?_0x8b463[_0x8d5f('0x19')]['attributes']||null:null,'limit':_0x8b463[_0x8d5f('0x19')]?_0x8b463[_0x8d5f('0x19')][_0x8d5f('0x1c')]||null:null,'include':_0x8b463[_0x8d5f('0x19')]?_0x8b463[_0x8d5f('0x19')][_0x8d5f('0x1d')]?_[_0x8d5f('0x1e')](_0x8b463[_0x8d5f('0x19')][_0x8d5f('0x1d')],function(_0x5b8832){return{'model':db[_0x5b8832[_0x8d5f('0x1f')]],'as':_0x5b8832['as'],'attributes':_0x5b8832[_0x8d5f('0x20')],'include':_0x5b8832[_0x8d5f('0x1d')]?_[_0x8d5f('0x1e')](_0x5b8832[_0x8d5f('0x1d')],function(_0x30b5d0){return{'model':db[_0x30b5d0[_0x8d5f('0x1f')]],'as':_0x30b5d0['as'],'attributes':_0x30b5d0['attributes'],'include':_0x30b5d0['include']?_['map'](_0x30b5d0[_0x8d5f('0x1d')],function(_0x4764f9){return{'model':db[_0x4764f9[_0x8d5f('0x1f')]],'as':_0x4764f9['as'],'attributes':_0x4764f9[_0x8d5f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8d5f('0xb')](function(_0x4748f0){logger[_0x8d5f('0xc')](_0x8d5f('0x16'),_0x8b463);logger[_0x8d5f('0x21')](_0x8d5f('0x16'),_0x8b463,JSON[_0x8d5f('0xf')](_0x4748f0));_0x527e06(_0x4748f0);})[_0x8d5f('0x15')](function(_0x34cc30){logger['error'](_0x8d5f('0x16'),_0x34cc30[_0x8d5f('0x13')],_0x8b463);_0xd91181(_0x31445b[_0x8d5f('0x10')](0x1f4,_0x34cc30[_0x8d5f('0x13')]));});});};exports[_0x8d5f('0x22')]=function(_0x9739ad){var _0x2b877b=this;return new Promise(function(_0x5cea56,_0x4e893c){return db[_0x8d5f('0x17')][_0x8d5f('0x23')]({'raw':_0x9739ad[_0x8d5f('0x19')]?_0x9739ad[_0x8d5f('0x19')][_0x8d5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9739ad[_0x8d5f('0x19')]?_0x9739ad[_0x8d5f('0x19')][_0x8d5f('0x1b')]||null:null,'attributes':_0x9739ad[_0x8d5f('0x19')]?_0x9739ad[_0x8d5f('0x19')][_0x8d5f('0x20')]||null:null,'include':_0x9739ad[_0x8d5f('0x19')]?_0x9739ad[_0x8d5f('0x19')][_0x8d5f('0x1d')]?_[_0x8d5f('0x1e')](_0x9739ad['options'][_0x8d5f('0x1d')],function(_0x42429d){return{'model':db[_0x42429d[_0x8d5f('0x1f')]],'as':_0x42429d['as'],'attributes':_0x42429d[_0x8d5f('0x20')],'include':_0x42429d[_0x8d5f('0x1d')]?_[_0x8d5f('0x1e')](_0x42429d[_0x8d5f('0x1d')],function(_0x42db7b){return{'model':db[_0x42db7b[_0x8d5f('0x1f')]],'as':_0x42db7b['as'],'attributes':_0x42db7b[_0x8d5f('0x20')],'include':_0x42db7b[_0x8d5f('0x1d')]?_['map'](_0x42db7b[_0x8d5f('0x1d')],function(_0x5b3471){return{'model':db[_0x5b3471['model']],'as':_0x5b3471['as'],'attributes':_0x5b3471['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cd9d5){logger['info'](_0x8d5f('0x22'),_0x9739ad);logger[_0x8d5f('0x21')]('ShowSalesforceAccount',_0x9739ad,JSON[_0x8d5f('0xf')](_0x4cd9d5));_0x5cea56(_0x4cd9d5);})[_0x8d5f('0x15')](function(_0x127591){logger[_0x8d5f('0x10')](_0x8d5f('0x22'),_0x127591[_0x8d5f('0x13')],_0x9739ad);_0x4e893c(_0x2b877b[_0x8d5f('0x10')](0x1f4,_0x127591[_0x8d5f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 311f68c..d927ef7 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x2fbb2c,_0x18d977){var _0x155a4f=function(_0x2c5fad){while(--_0x2c5fad){_0x2fbb2c['push'](_0x2fbb2c['shift']());}};_0x155a4f(++_0x18d977);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f0e71,_0x1ea0cf){_0x1f0e71=_0x1f0e71-0x0;var _0x388162=_0x2ef3[_0x1f0e71];return _0x388162;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x5c68ca,_0x2ef59c){var _0x53e2cf=function(_0x11bb3c){while(--_0x11bb3c){_0x5c68ca['push'](_0x5c68ca['shift']());}};_0x53e2cf(++_0x2ef59c);}(_0xadb5,0xad));var _0x5adb=function(_0xec5d2b,_0x364ca3){_0xec5d2b=_0xec5d2b-0x0;var _0x36b698=_0xadb5[_0xec5d2b];return _0x36b698;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 484c863..f749cfd 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 _0xbe03=['ENUM','Task','contact_lead','contact','lead','account','sequelize','exports','STRING'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xbe03,0x1b6));var _0x3be0=function(_0x509d51,_0x280fcf){_0x509d51=_0x509d51-0x0;var _0x671314=_0xbe03[_0x509d51];return _0x671314;};'use strict';var Sequelize=require(_0x3be0('0x0'));module[_0x3be0('0x1')]={'name':{'type':Sequelize[_0x3be0('0x2')]},'description':{'type':Sequelize[_0x3be0('0x2')]},'ticketType':{'type':Sequelize[_0x3be0('0x3')](_0x3be0('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x3be0('0x3')](_0x3be0('0x5'),_0x3be0('0x6'),_0x3be0('0x7'),'account_contact_lead',_0x3be0('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x3be0('0x6'),_0x3be0('0x7'),'account'),'defaultValue':_0x3be0('0x7')},'leadId':{'type':Sequelize[_0x3be0('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x3be0('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3dd4=['sequelize','STRING','ENUM','Task','Case','contact','lead','account','nothing'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3dd4,0xfc));var _0x43dd=function(_0x2614c4,_0x19c3bd){_0x2614c4=_0x2614c4-0x0;var _0x15e358=_0x3dd4[_0x2614c4];return _0x15e358;};'use strict';var Sequelize=require(_0x43dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x43dd('0x1')]},'description':{'type':Sequelize[_0x43dd('0x1')]},'ticketType':{'type':Sequelize[_0x43dd('0x2')](_0x43dd('0x3'),_0x43dd('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x43dd('0x2')]('contact_lead',_0x43dd('0x5'),_0x43dd('0x6'),'account_contact_lead',_0x43dd('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x43dd('0x2')](_0x43dd('0x8'),_0x43dd('0x5'),_0x43dd('0x6'),_0x43dd('0x7')),'defaultValue':_0x43dd('0x6')},'leadId':{'type':Sequelize[_0x43dd('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x43dd('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x43dd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index eb3a1b8..d657aff 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 _0x8987=['limit','count','set','Content-Range','then','destroy','error','stack','name','send','map','SalesforceConfiguration','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','includeAll','include','rows','catch','show','rawAttributes','find','create','body','update','params','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0xcb537a,_0x15ca9b){var _0x5dcba0=function(_0x155cfb){while(--_0x155cfb){_0xcb537a['push'](_0xcb537a['shift']());}};_0x5dcba0(++_0x15ca9b);}(_0x8987,0xc9));var _0x7898=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x8987[_0x257b0e];return _0x27ac2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7898('0x0'));var zipdir=require(_0x7898('0x1'));var jsonpatch=require(_0x7898('0x2'));var rp=require(_0x7898('0x3'));var moment=require(_0x7898('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7898('0x5'));var util=require(_0x7898('0x6'));var path=require(_0x7898('0x7'));var sox=require(_0x7898('0x8'));var csv=require(_0x7898('0x9'));var ejs=require(_0x7898('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7898('0xb'));var squel=require(_0x7898('0xc'));var crypto=require(_0x7898('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7898('0xe'));var toCsv=require(_0x7898('0x9'));var querystring=require('querystring');var Papa=require(_0x7898('0xf'));var Redis=require(_0x7898('0x10'));var authService=require(_0x7898('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7898('0x12'));var hardwareService=require(_0x7898('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7898('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7898('0x15'))['db'];function respondWithStatusCode(_0x788d93,_0x13608c){_0x13608c=_0x13608c||0xcc;return function(_0x2a101a){if(_0x2a101a){return _0x788d93[_0x7898('0x16')](_0x13608c);}return _0x788d93['status'](_0x13608c)[_0x7898('0x17')]();};}function respondWithResult(_0x54eb3a,_0x16d220){_0x16d220=_0x16d220||0xc8;return function(_0x3bef77){if(_0x3bef77){return _0x54eb3a[_0x7898('0x18')](_0x16d220)[_0x7898('0x19')](_0x3bef77);}};}function respondWithFilteredResult(_0x1a0865,_0x4acb88){return function(_0x4063bf){if(_0x4063bf){var _0x46689f=typeof _0x4acb88[_0x7898('0x1a')]==='undefined'&&typeof _0x4acb88[_0x7898('0x1b')]==='undefined';var _0x99711c=_0x4063bf[_0x7898('0x1c')];var _0x5a18ae=_0x46689f?0x0:_0x4acb88[_0x7898('0x1a')];var _0x2826da=_0x46689f?_0x4063bf[_0x7898('0x1c')]:_0x4acb88[_0x7898('0x1a')]+_0x4acb88[_0x7898('0x1b')];var _0x478c46;if(_0x2826da>=_0x99711c){_0x2826da=_0x99711c;_0x478c46=0xc8;}else{_0x478c46=0xce;}_0x1a0865[_0x7898('0x18')](_0x478c46);return _0x1a0865[_0x7898('0x1d')](_0x7898('0x1e'),_0x5a18ae+'-'+_0x2826da+'/'+_0x99711c)[_0x7898('0x19')](_0x4063bf);}return null;};}function patchUpdates(_0x3a2899){return function(_0x273773){try{jsonpatch['apply'](_0x273773,_0x3a2899,!![]);}catch(_0x2c22b6){return BPromise['reject'](_0x2c22b6);}return _0x273773['save']();};}function saveUpdates(_0x3f1b36,_0x41b4e0){return function(_0x3c9154){if(_0x3c9154){return _0x3c9154['update'](_0x3f1b36)[_0x7898('0x1f')](function(_0x2d52f4){return _0x2d52f4;});}return null;};}function removeEntity(_0x11213b,_0x1ac372){return function(_0x3a3e4e){if(_0x3a3e4e){return _0x3a3e4e[_0x7898('0x20')]()['then'](function(){_0x11213b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2186ad,_0x558bfe){return function(_0x11024c){if(!_0x11024c){_0x2186ad['sendStatus'](0x194);}return _0x11024c;};}function handleError(_0x3f2964,_0x3a3655){_0x3a3655=_0x3a3655||0x1f4;return function(_0x1f40db){logger[_0x7898('0x21')](_0x1f40db[_0x7898('0x22')]);if(_0x1f40db['name']){delete _0x1f40db[_0x7898('0x23')];}_0x3f2964['status'](_0x3a3655)[_0x7898('0x24')](_0x1f40db);};}exports['index']=function(_0x580fd9,_0x9514c2){var _0x465f06={},_0x14cebe={},_0x55c0c4={'count':0x0,'rows':[]};var _0xe2c8dd=_[_0x7898('0x25')](db[_0x7898('0x26')]['rawAttributes'],function(_0x2dbeb5){return{'name':_0x2dbeb5[_0x7898('0x27')],'type':_0x2dbeb5[_0x7898('0x28')][_0x7898('0x29')]};});_0x14cebe[_0x7898('0x2a')]=_[_0x7898('0x25')](_0xe2c8dd,_0x7898('0x23'));_0x14cebe['query']=_[_0x7898('0x2b')](_0x580fd9['query']);_0x14cebe[_0x7898('0x2c')]=_[_0x7898('0x2d')](_0x14cebe['model'],_0x14cebe[_0x7898('0x2e')]);_0x465f06[_0x7898('0x2f')]=_[_0x7898('0x2d')](_0x14cebe[_0x7898('0x2a')],qs[_0x7898('0x30')](_0x580fd9[_0x7898('0x2e')]['fields']));_0x465f06[_0x7898('0x2f')]=_0x465f06['attributes'][_0x7898('0x31')]?_0x465f06[_0x7898('0x2f')]:_0x14cebe['model'];if(!_0x580fd9['query']['hasOwnProperty'](_0x7898('0x32'))){_0x465f06[_0x7898('0x1b')]=qs[_0x7898('0x1b')](_0x580fd9['query'][_0x7898('0x1b')]);_0x465f06[_0x7898('0x1a')]=qs[_0x7898('0x1a')](_0x580fd9['query'][_0x7898('0x1a')]);}_0x465f06[_0x7898('0x33')]=qs[_0x7898('0x34')](_0x580fd9[_0x7898('0x2e')][_0x7898('0x34')]);_0x465f06['where']=qs[_0x7898('0x2c')](_[_0x7898('0x35')](_0x580fd9[_0x7898('0x2e')],_0x14cebe[_0x7898('0x2c')]),_0xe2c8dd);if(_0x580fd9['query']['filter']){_0x465f06['where']=_['merge'](_0x465f06['where'],{'$or':_[_0x7898('0x25')](_0xe2c8dd,function(_0x3424e0){if(_0x3424e0[_0x7898('0x28')]!==_0x7898('0x36')){var _0x58fb0b={};_0x58fb0b[_0x3424e0[_0x7898('0x23')]]={'$like':'%'+_0x580fd9[_0x7898('0x2e')][_0x7898('0x37')]+'%'};return _0x58fb0b;}})});}_0x465f06=_[_0x7898('0x38')]({},_0x465f06,_0x580fd9[_0x7898('0x39')]);var _0x490bc0={'where':_0x465f06[_0x7898('0x3a')]};return db[_0x7898('0x26')]['count'](_0x490bc0)[_0x7898('0x1f')](function(_0x5d09e4){_0x55c0c4['count']=_0x5d09e4;if(_0x580fd9[_0x7898('0x2e')][_0x7898('0x3b')]){_0x465f06[_0x7898('0x3c')]=[{'all':!![]}];}return db[_0x7898('0x26')]['findAll'](_0x465f06);})[_0x7898('0x1f')](function(_0x2bcaf3){_0x55c0c4[_0x7898('0x3d')]=_0x2bcaf3;return _0x55c0c4;})[_0x7898('0x1f')](respondWithFilteredResult(_0x9514c2,_0x465f06))[_0x7898('0x3e')](handleError(_0x9514c2,null));};exports[_0x7898('0x3f')]=function(_0x51eb3a,_0x138c72){var _0x517d41={'raw':![],'where':{'id':_0x51eb3a['params']['id']}},_0x115059={};_0x115059[_0x7898('0x2a')]=_['keys'](db['SalesforceConfiguration'][_0x7898('0x40')]);_0x115059[_0x7898('0x2e')]=_[_0x7898('0x2b')](_0x51eb3a[_0x7898('0x2e')]);_0x115059[_0x7898('0x2c')]=_['intersection'](_0x115059[_0x7898('0x2a')],_0x115059[_0x7898('0x2e')]);_0x517d41[_0x7898('0x2f')]=_[_0x7898('0x2d')](_0x115059[_0x7898('0x2a')],qs[_0x7898('0x30')](_0x51eb3a[_0x7898('0x2e')]['fields']));_0x517d41[_0x7898('0x2f')]=_0x517d41[_0x7898('0x2f')][_0x7898('0x31')]?_0x517d41[_0x7898('0x2f')]:_0x115059[_0x7898('0x2a')];if(_0x51eb3a[_0x7898('0x2e')][_0x7898('0x3b')]){_0x517d41['include']=[{'all':!![]}];}_0x517d41=_[_0x7898('0x38')]({},_0x517d41,_0x51eb3a[_0x7898('0x39')]);return db['SalesforceConfiguration'][_0x7898('0x41')](_0x517d41)['then'](handleEntityNotFound(_0x138c72,null))['then'](respondWithResult(_0x138c72,null))[_0x7898('0x3e')](handleError(_0x138c72,null));};exports[_0x7898('0x42')]=function(_0x126f74,_0x3fc7fe){return db[_0x7898('0x26')]['create'](_0x126f74[_0x7898('0x43')],{})['then'](respondWithResult(_0x3fc7fe,0xc9))[_0x7898('0x3e')](handleError(_0x3fc7fe,null));};exports[_0x7898('0x44')]=function(_0x2194ad,_0x168b9e){if(_0x2194ad[_0x7898('0x43')]['id']){delete _0x2194ad[_0x7898('0x43')]['id'];}return db[_0x7898('0x26')][_0x7898('0x41')]({'where':{'id':_0x2194ad[_0x7898('0x45')]['id']}})[_0x7898('0x1f')](handleEntityNotFound(_0x168b9e,null))['then'](saveUpdates(_0x2194ad[_0x7898('0x43')],null))[_0x7898('0x1f')](respondWithResult(_0x168b9e,null))[_0x7898('0x3e')](handleError(_0x168b9e,null));};exports['destroy']=function(_0x196830,_0x134248){return db[_0x7898('0x26')][_0x7898('0x41')]({'where':{'id':_0x196830['params']['id']}})[_0x7898('0x1f')](handleEntityNotFound(_0x134248,null))['then'](removeEntity(_0x134248,null))[_0x7898('0x3e')](handleError(_0x134248,null));};exports[_0x7898('0x46')]=function(_0x349cfa,_0x39e02e,_0x273f59){var _0x1483fe={};var _0x5c0833={};var _0x5a5e2f;var _0x31e499;return db[_0x7898('0x26')][_0x7898('0x47')]({'where':{'id':_0x349cfa[_0x7898('0x45')]['id']}})[_0x7898('0x1f')](handleEntityNotFound(_0x39e02e,null))[_0x7898('0x1f')](function(_0x5cf69c){if(_0x5cf69c){_0x5a5e2f=_0x5cf69c;_0x5c0833['model']=_[_0x7898('0x2b')](db[_0x7898('0x48')][_0x7898('0x40')]);_0x5c0833['query']=_['keys'](_0x349cfa[_0x7898('0x2e')]);_0x5c0833[_0x7898('0x2c')]=_[_0x7898('0x2d')](_0x5c0833[_0x7898('0x2a')],_0x5c0833['query']);_0x1483fe[_0x7898('0x2f')]=_['intersection'](_0x5c0833[_0x7898('0x2a')],qs[_0x7898('0x30')](_0x349cfa[_0x7898('0x2e')]['fields']));_0x1483fe[_0x7898('0x2f')]=_0x1483fe['attributes']['length']?_0x1483fe[_0x7898('0x2f')]:_0x5c0833[_0x7898('0x2a')];_0x1483fe[_0x7898('0x33')]=qs[_0x7898('0x34')](_0x349cfa['query'][_0x7898('0x34')]);_0x1483fe['where']=qs['filters'](_[_0x7898('0x35')](_0x349cfa[_0x7898('0x2e')],_0x5c0833['filters']));if(_0x349cfa['query'][_0x7898('0x37')]){_0x1483fe['where']=_['merge'](_0x1483fe['where'],{'$or':_[_0x7898('0x25')](_0x1483fe[_0x7898('0x2f')],function(_0x32f86c){var _0x1de782={};_0x1de782[_0x32f86c]={'$like':'%'+_0x349cfa[_0x7898('0x2e')][_0x7898('0x37')]+'%'};return _0x1de782;})});}_0x1483fe=_['merge']({},_0x1483fe,_0x349cfa[_0x7898('0x39')]);return _0x5a5e2f[_0x7898('0x46')](_0x1483fe);}})[_0x7898('0x1f')](function(_0x2d10a7){if(_0x2d10a7){_0x31e499=_0x2d10a7[_0x7898('0x31')];if(!_0x349cfa['query'][_0x7898('0x49')](_0x7898('0x32'))){_0x1483fe[_0x7898('0x1b')]=qs[_0x7898('0x1b')](_0x349cfa['query'][_0x7898('0x1b')]);_0x1483fe['offset']=qs[_0x7898('0x1a')](_0x349cfa[_0x7898('0x2e')]['offset']);}return _0x5a5e2f['getFields'](_0x1483fe);}})[_0x7898('0x1f')](function(_0x2f0872){if(_0x2f0872){return _0x2f0872?{'count':_0x31e499,'rows':_0x2f0872}:null;}})[_0x7898('0x1f')](respondWithResult(_0x39e02e,null))[_0x7898('0x3e')](handleError(_0x39e02e,null));};exports['getSubjects']=function(_0x306f5c,_0x3537ec,_0x5653d0){var _0x1dba13={};var _0x5e4208={};var _0x4a4d9c;var _0x5d0ed6;return db[_0x7898('0x26')][_0x7898('0x47')]({'where':{'id':_0x306f5c[_0x7898('0x45')]['id']}})[_0x7898('0x1f')](handleEntityNotFound(_0x3537ec,null))[_0x7898('0x1f')](function(_0xac5f3a){if(_0xac5f3a){_0x4a4d9c=_0xac5f3a;_0x5e4208[_0x7898('0x2a')]=_[_0x7898('0x2b')](db['SalesforceField']['rawAttributes']);_0x5e4208[_0x7898('0x2e')]=_[_0x7898('0x2b')](_0x306f5c[_0x7898('0x2e')]);_0x5e4208[_0x7898('0x2c')]=_[_0x7898('0x2d')](_0x5e4208['model'],_0x5e4208['query']);_0x1dba13[_0x7898('0x2f')]=_[_0x7898('0x2d')](_0x5e4208[_0x7898('0x2a')],qs[_0x7898('0x30')](_0x306f5c['query'][_0x7898('0x30')]));_0x1dba13[_0x7898('0x2f')]=_0x1dba13[_0x7898('0x2f')][_0x7898('0x31')]?_0x1dba13['attributes']:_0x5e4208[_0x7898('0x2a')];_0x1dba13[_0x7898('0x33')]=qs[_0x7898('0x34')](_0x306f5c['query'][_0x7898('0x34')]);_0x1dba13[_0x7898('0x3a')]=qs[_0x7898('0x2c')](_[_0x7898('0x35')](_0x306f5c[_0x7898('0x2e')],_0x5e4208[_0x7898('0x2c')]));if(_0x306f5c[_0x7898('0x2e')][_0x7898('0x37')]){_0x1dba13['where']=_[_0x7898('0x38')](_0x1dba13[_0x7898('0x3a')],{'$or':_['map'](_0x1dba13['attributes'],function(_0x495f2c){var _0x1713c2={};_0x1713c2[_0x495f2c]={'$like':'%'+_0x306f5c['query'][_0x7898('0x37')]+'%'};return _0x1713c2;})});}_0x1dba13=_['merge']({},_0x1dba13,_0x306f5c[_0x7898('0x39')]);return _0x4a4d9c[_0x7898('0x4a')](_0x1dba13);}})[_0x7898('0x1f')](function(_0x306db8){if(_0x306db8){_0x5d0ed6=_0x306db8['length'];if(!_0x306f5c[_0x7898('0x2e')][_0x7898('0x49')](_0x7898('0x32'))){_0x1dba13['limit']=qs[_0x7898('0x1b')](_0x306f5c['query'][_0x7898('0x1b')]);_0x1dba13[_0x7898('0x1a')]=qs['offset'](_0x306f5c['query'][_0x7898('0x1a')]);}return _0x4a4d9c[_0x7898('0x4a')](_0x1dba13);}})[_0x7898('0x1f')](function(_0x19043e){if(_0x19043e){return _0x19043e?{'count':_0x5d0ed6,'rows':_0x19043e}:null;}})[_0x7898('0x1f')](respondWithResult(_0x3537ec,null))['catch'](handleError(_0x3537ec,null));};exports[_0x7898('0x4b')]=function(_0x11a0d6,_0x1ad6c7,_0x3f449e){var _0x2afec6={};var _0x3f8deb={};var _0x1cd2d7;var _0x5e0ace;return db[_0x7898('0x26')][_0x7898('0x47')]({'where':{'id':_0x11a0d6[_0x7898('0x45')]['id']}})[_0x7898('0x1f')](handleEntityNotFound(_0x1ad6c7,null))[_0x7898('0x1f')](function(_0x48e1b3){if(_0x48e1b3){_0x1cd2d7=_0x48e1b3;_0x3f8deb['model']=_[_0x7898('0x2b')](db[_0x7898('0x48')][_0x7898('0x40')]);_0x3f8deb[_0x7898('0x2e')]=_[_0x7898('0x2b')](_0x11a0d6[_0x7898('0x2e')]);_0x3f8deb[_0x7898('0x2c')]=_[_0x7898('0x2d')](_0x3f8deb[_0x7898('0x2a')],_0x3f8deb['query']);_0x2afec6[_0x7898('0x2f')]=_[_0x7898('0x2d')](_0x3f8deb['model'],qs[_0x7898('0x30')](_0x11a0d6['query'][_0x7898('0x30')]));_0x2afec6[_0x7898('0x2f')]=_0x2afec6['attributes'][_0x7898('0x31')]?_0x2afec6[_0x7898('0x2f')]:_0x3f8deb[_0x7898('0x2a')];_0x2afec6[_0x7898('0x33')]=qs['sort'](_0x11a0d6['query'][_0x7898('0x34')]);_0x2afec6[_0x7898('0x3a')]=qs['filters'](_[_0x7898('0x35')](_0x11a0d6[_0x7898('0x2e')],_0x3f8deb[_0x7898('0x2c')]));if(_0x11a0d6[_0x7898('0x2e')][_0x7898('0x37')]){_0x2afec6[_0x7898('0x3a')]=_[_0x7898('0x38')](_0x2afec6[_0x7898('0x3a')],{'$or':_[_0x7898('0x25')](_0x2afec6['attributes'],function(_0x4985b8){var _0x245493={};_0x245493[_0x4985b8]={'$like':'%'+_0x11a0d6[_0x7898('0x2e')]['filter']+'%'};return _0x245493;})});}_0x2afec6=_[_0x7898('0x38')]({},_0x2afec6,_0x11a0d6[_0x7898('0x39')]);return _0x1cd2d7['getDescriptions'](_0x2afec6);}})['then'](function(_0x43192e){if(_0x43192e){_0x5e0ace=_0x43192e[_0x7898('0x31')];if(!_0x11a0d6[_0x7898('0x2e')][_0x7898('0x49')]('nolimit')){_0x2afec6['limit']=qs[_0x7898('0x1b')](_0x11a0d6['query'][_0x7898('0x1b')]);_0x2afec6[_0x7898('0x1a')]=qs['offset'](_0x11a0d6[_0x7898('0x2e')][_0x7898('0x1a')]);}return _0x1cd2d7['getDescriptions'](_0x2afec6);}})[_0x7898('0x1f')](function(_0x4db6b5){if(_0x4db6b5){return _0x4db6b5?{'count':_0x5e0ace,'rows':_0x4db6b5}:null;}})['then'](respondWithResult(_0x1ad6c7,null))[_0x7898('0x3e')](handleError(_0x1ad6c7,null));}; \ No newline at end of file +var _0xd449=['reject','update','then','error','stack','name','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','SalesforceField','hasOwnProperty','nolimit','getSubjects','order','getDescriptions','eml-format','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply'];(function(_0x2ccde2,_0x4139a2){var _0x55fb01=function(_0x57c340){while(--_0x57c340){_0x2ccde2['push'](_0x2ccde2['shift']());}};_0x55fb01(++_0x4139a2);}(_0xd449,0x153));var _0x9d44=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xd449[_0x609988];return _0x159984;};'use strict';var emlformat=require(_0x9d44('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d44('0x1'));var util=require(_0x9d44('0x2'));var path=require(_0x9d44('0x3'));var sox=require(_0x9d44('0x4'));var csv=require('to-csv');var ejs=require(_0x9d44('0x5'));var fs=require('fs');var fs_extra=require(_0x9d44('0x6'));var _=require(_0x9d44('0x7'));var squel=require(_0x9d44('0x8'));var crypto=require(_0x9d44('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9d44('0xa'));var toCsv=require(_0x9d44('0xb'));var querystring=require(_0x9d44('0xc'));var Papa=require(_0x9d44('0xd'));var Redis=require(_0x9d44('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9d44('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d44('0x10'));var logger=require('../../config/logger')(_0x9d44('0x11'));var utils=require(_0x9d44('0x12'));var config=require(_0x9d44('0x13'));var licenseUtil=require(_0x9d44('0x14'));var db=require(_0x9d44('0x15'))['db'];function respondWithStatusCode(_0x344c17,_0x34cc6e){_0x34cc6e=_0x34cc6e||0xcc;return function(_0x19c3bb){if(_0x19c3bb){return _0x344c17[_0x9d44('0x16')](_0x34cc6e);}return _0x344c17['status'](_0x34cc6e)[_0x9d44('0x17')]();};}function respondWithResult(_0x295240,_0x46d567){_0x46d567=_0x46d567||0xc8;return function(_0x484555){if(_0x484555){return _0x295240[_0x9d44('0x18')](_0x46d567)[_0x9d44('0x19')](_0x484555);}};}function respondWithFilteredResult(_0x561771,_0x42d0d9){return function(_0x40e551){if(_0x40e551){var _0x5953c3=typeof _0x42d0d9[_0x9d44('0x1a')]===_0x9d44('0x1b')&&typeof _0x42d0d9[_0x9d44('0x1c')]===_0x9d44('0x1b');var _0x419430=_0x40e551[_0x9d44('0x1d')];var _0x4076bd=_0x5953c3?0x0:_0x42d0d9[_0x9d44('0x1a')];var _0x5228f1=_0x5953c3?_0x40e551['count']:_0x42d0d9[_0x9d44('0x1a')]+_0x42d0d9[_0x9d44('0x1c')];var _0x24cfb9;if(_0x5228f1>=_0x419430){_0x5228f1=_0x419430;_0x24cfb9=0xc8;}else{_0x24cfb9=0xce;}_0x561771['status'](_0x24cfb9);return _0x561771['set']('Content-Range',_0x4076bd+'-'+_0x5228f1+'/'+_0x419430)[_0x9d44('0x19')](_0x40e551);}return null;};}function patchUpdates(_0x4c6cf8){return function(_0x500012){try{jsonpatch[_0x9d44('0x1e')](_0x500012,_0x4c6cf8,!![]);}catch(_0xe2359){return BPromise[_0x9d44('0x1f')](_0xe2359);}return _0x500012['save']();};}function saveUpdates(_0x1da114,_0x4e6d03){return function(_0x3f4ee5){if(_0x3f4ee5){return _0x3f4ee5[_0x9d44('0x20')](_0x1da114)[_0x9d44('0x21')](function(_0x845975){return _0x845975;});}return null;};}function removeEntity(_0x359731,_0x48081d){return function(_0x5b24a2){if(_0x5b24a2){return _0x5b24a2['destroy']()['then'](function(){_0x359731[_0x9d44('0x18')](0xcc)[_0x9d44('0x17')]();});}};}function handleEntityNotFound(_0x4aac70,_0x4f1d81){return function(_0x13b99f){if(!_0x13b99f){_0x4aac70[_0x9d44('0x16')](0x194);}return _0x13b99f;};}function handleError(_0x2c733f,_0x2b9c71){_0x2b9c71=_0x2b9c71||0x1f4;return function(_0x566b82){logger[_0x9d44('0x22')](_0x566b82[_0x9d44('0x23')]);if(_0x566b82['name']){delete _0x566b82[_0x9d44('0x24')];}_0x2c733f[_0x9d44('0x18')](_0x2b9c71)['send'](_0x566b82);};}exports['index']=function(_0x323e70,_0x58dbf6){var _0x3bebd9={},_0x18bc3c={},_0x32ffdd={'count':0x0,'rows':[]};var _0x5170f2=_['map'](db['SalesforceConfiguration'][_0x9d44('0x25')],function(_0x50046b){return{'name':_0x50046b['fieldName'],'type':_0x50046b['type'][_0x9d44('0x26')]};});_0x18bc3c[_0x9d44('0x27')]=_['map'](_0x5170f2,'name');_0x18bc3c[_0x9d44('0x28')]=_[_0x9d44('0x29')](_0x323e70['query']);_0x18bc3c['filters']=_[_0x9d44('0x2a')](_0x18bc3c[_0x9d44('0x27')],_0x18bc3c['query']);_0x3bebd9['attributes']=_[_0x9d44('0x2a')](_0x18bc3c[_0x9d44('0x27')],qs[_0x9d44('0x2b')](_0x323e70['query'][_0x9d44('0x2b')]));_0x3bebd9[_0x9d44('0x2c')]=_0x3bebd9[_0x9d44('0x2c')][_0x9d44('0x2d')]?_0x3bebd9[_0x9d44('0x2c')]:_0x18bc3c[_0x9d44('0x27')];if(!_0x323e70[_0x9d44('0x28')]['hasOwnProperty']('nolimit')){_0x3bebd9[_0x9d44('0x1c')]=qs[_0x9d44('0x1c')](_0x323e70[_0x9d44('0x28')][_0x9d44('0x1c')]);_0x3bebd9[_0x9d44('0x1a')]=qs[_0x9d44('0x1a')](_0x323e70[_0x9d44('0x28')][_0x9d44('0x1a')]);}_0x3bebd9['order']=qs['sort'](_0x323e70['query'][_0x9d44('0x2e')]);_0x3bebd9['where']=qs[_0x9d44('0x2f')](_[_0x9d44('0x30')](_0x323e70['query'],_0x18bc3c[_0x9d44('0x2f')]),_0x5170f2);if(_0x323e70[_0x9d44('0x28')][_0x9d44('0x31')]){_0x3bebd9[_0x9d44('0x32')]=_[_0x9d44('0x33')](_0x3bebd9[_0x9d44('0x32')],{'$or':_[_0x9d44('0x34')](_0x5170f2,function(_0x3896a1){if(_0x3896a1[_0x9d44('0x35')]!==_0x9d44('0x36')){var _0x5e76d7={};_0x5e76d7[_0x3896a1[_0x9d44('0x24')]]={'$like':'%'+_0x323e70[_0x9d44('0x28')][_0x9d44('0x31')]+'%'};return _0x5e76d7;}})});}_0x3bebd9=_[_0x9d44('0x33')]({},_0x3bebd9,_0x323e70[_0x9d44('0x37')]);var _0x23bb25={'where':_0x3bebd9['where']};return db[_0x9d44('0x38')][_0x9d44('0x1d')](_0x23bb25)['then'](function(_0x1d5292){_0x32ffdd[_0x9d44('0x1d')]=_0x1d5292;if(_0x323e70['query'][_0x9d44('0x39')]){_0x3bebd9[_0x9d44('0x3a')]=[{'all':!![]}];}return db[_0x9d44('0x38')][_0x9d44('0x3b')](_0x3bebd9);})[_0x9d44('0x21')](function(_0x36a8e3){_0x32ffdd[_0x9d44('0x3c')]=_0x36a8e3;return _0x32ffdd;})[_0x9d44('0x21')](respondWithFilteredResult(_0x58dbf6,_0x3bebd9))[_0x9d44('0x3d')](handleError(_0x58dbf6,null));};exports[_0x9d44('0x3e')]=function(_0x3b1689,_0x20d6df){var _0x32fd0e={'raw':![],'where':{'id':_0x3b1689[_0x9d44('0x3f')]['id']}},_0x814b89={};_0x814b89[_0x9d44('0x27')]=_[_0x9d44('0x29')](db['SalesforceConfiguration'][_0x9d44('0x25')]);_0x814b89[_0x9d44('0x28')]=_['keys'](_0x3b1689['query']);_0x814b89[_0x9d44('0x2f')]=_[_0x9d44('0x2a')](_0x814b89[_0x9d44('0x27')],_0x814b89[_0x9d44('0x28')]);_0x32fd0e[_0x9d44('0x2c')]=_['intersection'](_0x814b89[_0x9d44('0x27')],qs['fields'](_0x3b1689[_0x9d44('0x28')][_0x9d44('0x2b')]));_0x32fd0e[_0x9d44('0x2c')]=_0x32fd0e['attributes'][_0x9d44('0x2d')]?_0x32fd0e[_0x9d44('0x2c')]:_0x814b89[_0x9d44('0x27')];if(_0x3b1689[_0x9d44('0x28')][_0x9d44('0x39')]){_0x32fd0e['include']=[{'all':!![]}];}_0x32fd0e=_['merge']({},_0x32fd0e,_0x3b1689[_0x9d44('0x37')]);return db[_0x9d44('0x38')][_0x9d44('0x40')](_0x32fd0e)[_0x9d44('0x21')](handleEntityNotFound(_0x20d6df,null))[_0x9d44('0x21')](respondWithResult(_0x20d6df,null))[_0x9d44('0x3d')](handleError(_0x20d6df,null));};exports[_0x9d44('0x41')]=function(_0xd52234,_0x4cc94a){return db[_0x9d44('0x38')][_0x9d44('0x41')](_0xd52234['body'],{})['then'](respondWithResult(_0x4cc94a,0xc9))['catch'](handleError(_0x4cc94a,null));};exports[_0x9d44('0x20')]=function(_0x4c1a6c,_0x308614){if(_0x4c1a6c['body']['id']){delete _0x4c1a6c[_0x9d44('0x42')]['id'];}return db[_0x9d44('0x38')]['find']({'where':{'id':_0x4c1a6c[_0x9d44('0x3f')]['id']}})[_0x9d44('0x21')](handleEntityNotFound(_0x308614,null))[_0x9d44('0x21')](saveUpdates(_0x4c1a6c[_0x9d44('0x42')],null))[_0x9d44('0x21')](respondWithResult(_0x308614,null))['catch'](handleError(_0x308614,null));};exports['destroy']=function(_0x360332,_0x54dda7){return db['SalesforceConfiguration'][_0x9d44('0x40')]({'where':{'id':_0x360332['params']['id']}})[_0x9d44('0x21')](handleEntityNotFound(_0x54dda7,null))[_0x9d44('0x21')](removeEntity(_0x54dda7,null))[_0x9d44('0x3d')](handleError(_0x54dda7,null));};exports['getFields']=function(_0x17517c,_0x28d44c,_0x54e95c){var _0x19ce14={};var _0x532548={};var _0x3016b2;var _0x567302;return db[_0x9d44('0x38')][_0x9d44('0x43')]({'where':{'id':_0x17517c['params']['id']}})['then'](handleEntityNotFound(_0x28d44c,null))['then'](function(_0xfaee76){if(_0xfaee76){_0x3016b2=_0xfaee76;_0x532548[_0x9d44('0x27')]=_['keys'](db[_0x9d44('0x44')][_0x9d44('0x25')]);_0x532548[_0x9d44('0x28')]=_[_0x9d44('0x29')](_0x17517c[_0x9d44('0x28')]);_0x532548[_0x9d44('0x2f')]=_[_0x9d44('0x2a')](_0x532548[_0x9d44('0x27')],_0x532548[_0x9d44('0x28')]);_0x19ce14[_0x9d44('0x2c')]=_[_0x9d44('0x2a')](_0x532548[_0x9d44('0x27')],qs['fields'](_0x17517c['query'][_0x9d44('0x2b')]));_0x19ce14[_0x9d44('0x2c')]=_0x19ce14[_0x9d44('0x2c')][_0x9d44('0x2d')]?_0x19ce14[_0x9d44('0x2c')]:_0x532548[_0x9d44('0x27')];_0x19ce14['order']=qs[_0x9d44('0x2e')](_0x17517c[_0x9d44('0x28')]['sort']);_0x19ce14[_0x9d44('0x32')]=qs[_0x9d44('0x2f')](_[_0x9d44('0x30')](_0x17517c[_0x9d44('0x28')],_0x532548[_0x9d44('0x2f')]));if(_0x17517c['query'][_0x9d44('0x31')]){_0x19ce14['where']=_['merge'](_0x19ce14['where'],{'$or':_['map'](_0x19ce14[_0x9d44('0x2c')],function(_0x2499c0){var _0x2961a5={};_0x2961a5[_0x2499c0]={'$like':'%'+_0x17517c[_0x9d44('0x28')]['filter']+'%'};return _0x2961a5;})});}_0x19ce14=_[_0x9d44('0x33')]({},_0x19ce14,_0x17517c[_0x9d44('0x37')]);return _0x3016b2['getFields'](_0x19ce14);}})[_0x9d44('0x21')](function(_0x56cfdd){if(_0x56cfdd){_0x567302=_0x56cfdd[_0x9d44('0x2d')];if(!_0x17517c['query'][_0x9d44('0x45')](_0x9d44('0x46'))){_0x19ce14[_0x9d44('0x1c')]=qs[_0x9d44('0x1c')](_0x17517c[_0x9d44('0x28')]['limit']);_0x19ce14[_0x9d44('0x1a')]=qs['offset'](_0x17517c['query'][_0x9d44('0x1a')]);}return _0x3016b2['getFields'](_0x19ce14);}})['then'](function(_0x5daac5){if(_0x5daac5){return _0x5daac5?{'count':_0x567302,'rows':_0x5daac5}:null;}})[_0x9d44('0x21')](respondWithResult(_0x28d44c,null))[_0x9d44('0x3d')](handleError(_0x28d44c,null));};exports[_0x9d44('0x47')]=function(_0x1b881f,_0x5e86d6,_0xcbabf2){var _0x25b4a4={};var _0x32ccd2={};var _0x133047;var _0x57dc2a;return db[_0x9d44('0x38')]['findOne']({'where':{'id':_0x1b881f[_0x9d44('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e86d6,null))['then'](function(_0x5c414e){if(_0x5c414e){_0x133047=_0x5c414e;_0x32ccd2[_0x9d44('0x27')]=_['keys'](db['SalesforceField'][_0x9d44('0x25')]);_0x32ccd2[_0x9d44('0x28')]=_[_0x9d44('0x29')](_0x1b881f[_0x9d44('0x28')]);_0x32ccd2[_0x9d44('0x2f')]=_['intersection'](_0x32ccd2[_0x9d44('0x27')],_0x32ccd2[_0x9d44('0x28')]);_0x25b4a4['attributes']=_['intersection'](_0x32ccd2[_0x9d44('0x27')],qs['fields'](_0x1b881f[_0x9d44('0x28')][_0x9d44('0x2b')]));_0x25b4a4[_0x9d44('0x2c')]=_0x25b4a4[_0x9d44('0x2c')][_0x9d44('0x2d')]?_0x25b4a4[_0x9d44('0x2c')]:_0x32ccd2['model'];_0x25b4a4['order']=qs['sort'](_0x1b881f['query'][_0x9d44('0x2e')]);_0x25b4a4['where']=qs[_0x9d44('0x2f')](_[_0x9d44('0x30')](_0x1b881f[_0x9d44('0x28')],_0x32ccd2[_0x9d44('0x2f')]));if(_0x1b881f[_0x9d44('0x28')][_0x9d44('0x31')]){_0x25b4a4[_0x9d44('0x32')]=_[_0x9d44('0x33')](_0x25b4a4[_0x9d44('0x32')],{'$or':_[_0x9d44('0x34')](_0x25b4a4['attributes'],function(_0x5911d6){var _0x4e6da7={};_0x4e6da7[_0x5911d6]={'$like':'%'+_0x1b881f[_0x9d44('0x28')]['filter']+'%'};return _0x4e6da7;})});}_0x25b4a4=_[_0x9d44('0x33')]({},_0x25b4a4,_0x1b881f[_0x9d44('0x37')]);return _0x133047[_0x9d44('0x47')](_0x25b4a4);}})[_0x9d44('0x21')](function(_0x585b23){if(_0x585b23){_0x57dc2a=_0x585b23[_0x9d44('0x2d')];if(!_0x1b881f[_0x9d44('0x28')][_0x9d44('0x45')](_0x9d44('0x46'))){_0x25b4a4['limit']=qs[_0x9d44('0x1c')](_0x1b881f[_0x9d44('0x28')][_0x9d44('0x1c')]);_0x25b4a4[_0x9d44('0x1a')]=qs[_0x9d44('0x1a')](_0x1b881f['query'][_0x9d44('0x1a')]);}return _0x133047['getSubjects'](_0x25b4a4);}})[_0x9d44('0x21')](function(_0x33498d){if(_0x33498d){return _0x33498d?{'count':_0x57dc2a,'rows':_0x33498d}:null;}})[_0x9d44('0x21')](respondWithResult(_0x5e86d6,null))[_0x9d44('0x3d')](handleError(_0x5e86d6,null));};exports['getDescriptions']=function(_0x5be9c5,_0xb3571c,_0x2850f8){var _0xb7ecf1={};var _0x573984={};var _0x340468;var _0x186a24;return db['SalesforceConfiguration'][_0x9d44('0x43')]({'where':{'id':_0x5be9c5[_0x9d44('0x3f')]['id']}})[_0x9d44('0x21')](handleEntityNotFound(_0xb3571c,null))[_0x9d44('0x21')](function(_0x52e1b8){if(_0x52e1b8){_0x340468=_0x52e1b8;_0x573984['model']=_['keys'](db['SalesforceField'][_0x9d44('0x25')]);_0x573984['query']=_[_0x9d44('0x29')](_0x5be9c5['query']);_0x573984[_0x9d44('0x2f')]=_[_0x9d44('0x2a')](_0x573984[_0x9d44('0x27')],_0x573984['query']);_0xb7ecf1['attributes']=_[_0x9d44('0x2a')](_0x573984[_0x9d44('0x27')],qs['fields'](_0x5be9c5[_0x9d44('0x28')][_0x9d44('0x2b')]));_0xb7ecf1[_0x9d44('0x2c')]=_0xb7ecf1[_0x9d44('0x2c')][_0x9d44('0x2d')]?_0xb7ecf1[_0x9d44('0x2c')]:_0x573984[_0x9d44('0x27')];_0xb7ecf1[_0x9d44('0x48')]=qs['sort'](_0x5be9c5[_0x9d44('0x28')]['sort']);_0xb7ecf1[_0x9d44('0x32')]=qs[_0x9d44('0x2f')](_['pick'](_0x5be9c5['query'],_0x573984[_0x9d44('0x2f')]));if(_0x5be9c5[_0x9d44('0x28')]['filter']){_0xb7ecf1['where']=_[_0x9d44('0x33')](_0xb7ecf1[_0x9d44('0x32')],{'$or':_[_0x9d44('0x34')](_0xb7ecf1[_0x9d44('0x2c')],function(_0x11ffd2){var _0x465b36={};_0x465b36[_0x11ffd2]={'$like':'%'+_0x5be9c5[_0x9d44('0x28')][_0x9d44('0x31')]+'%'};return _0x465b36;})});}_0xb7ecf1=_[_0x9d44('0x33')]({},_0xb7ecf1,_0x5be9c5[_0x9d44('0x37')]);return _0x340468[_0x9d44('0x49')](_0xb7ecf1);}})[_0x9d44('0x21')](function(_0x205988){if(_0x205988){_0x186a24=_0x205988['length'];if(!_0x5be9c5[_0x9d44('0x28')][_0x9d44('0x45')]('nolimit')){_0xb7ecf1[_0x9d44('0x1c')]=qs[_0x9d44('0x1c')](_0x5be9c5[_0x9d44('0x28')][_0x9d44('0x1c')]);_0xb7ecf1[_0x9d44('0x1a')]=qs[_0x9d44('0x1a')](_0x5be9c5['query']['offset']);}return _0x340468[_0x9d44('0x49')](_0xb7ecf1);}})[_0x9d44('0x21')](function(_0xaa33a1){if(_0xaa33a1){return _0xaa33a1?{'count':_0x186a24,'rows':_0xaa33a1}:null;}})[_0x9d44('0x21')](respondWithResult(_0xb3571c,null))[_0x9d44('0x3d')](handleError(_0xb3571c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ab59779..f1d8d36 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 _0x90a7=['api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x90a7,0x167));var _0x790a=function(_0x6cbb56,_0x4438ce){_0x6cbb56=_0x6cbb56-0x0;var _0x3e5d3d=_0x90a7[_0x6cbb56];return _0x3e5d3d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x790a('0x0'))(_0x790a('0x1'));var moment=require(_0x790a('0x2'));var BPromise=require(_0x790a('0x3'));var rp=require(_0x790a('0x4'));var fs=require('fs');var path=require(_0x790a('0x5'));var rimraf=require(_0x790a('0x6'));var config=require('../../config/environment');var attributes=require(_0x790a('0x7'));module[_0x790a('0x8')]=function(_0xf99e9,_0x54a863){return _0xf99e9[_0x790a('0x9')](_0x790a('0xa'),attributes,{'tableName':_0x790a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f80=['util','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x387c65,_0x2fd251){var _0x4d24b7=function(_0x58e055){while(--_0x58e055){_0x387c65['push'](_0x387c65['shift']());}};_0x4d24b7(++_0x2fd251);}(_0x2f80,0x84));var _0x02f8=function(_0x208275,_0x4e951f){_0x208275=_0x208275-0x0;var _0x5cb57c=_0x2f80[_0x208275];return _0x5cb57c;};'use strict';var _=require('lodash');var util=require(_0x02f8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x02f8('0x1'));var BPromise=require(_0x02f8('0x2'));var rp=require(_0x02f8('0x3'));var fs=require('fs');var path=require(_0x02f8('0x4'));var rimraf=require(_0x02f8('0x5'));var config=require('../../config/environment');var attributes=require(_0x02f8('0x6'));module[_0x02f8('0x7')]=function(_0x2f765b,_0x1dc0ef){return _0x2f765b[_0x02f8('0x8')](_0x02f8('0x9'),attributes,{'tableName':_0x02f8('0xa'),'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 c8cf386..a79ac75 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 _0x7da6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4be1e3,_0x2b60d6){var _0x333ad0=function(_0x59dded){while(--_0x59dded){_0x4be1e3['push'](_0x4be1e3['shift']());}};_0x333ad0(++_0x2b60d6);}(_0x7da6,0xa2));var _0x67da=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x7da6[_0x3932eb];return _0x5316e5;};'use strict';var _=require(_0x67da('0x0'));var util=require(_0x67da('0x1'));var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rs=require(_0x67da('0x4'));var fs=require('fs');var Redis=require(_0x67da('0x5'));var db=require(_0x67da('0x6'))['db'];var utils=require(_0x67da('0x7'));var logger=require(_0x67da('0x8'))(_0x67da('0x9'));var config=require(_0x67da('0xa'));var jayson=require(_0x67da('0xb'));var client=jayson['client'][_0x67da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35e114,_0x827ae8,_0x1a2a04){return new BPromise(function(_0x21940a,_0x237014){return client[_0x67da('0xd')](_0x35e114,_0x1a2a04)[_0x67da('0xe')](function(_0x6fe2d4){logger[_0x67da('0xf')](_0x67da('0x10'),_0x827ae8,_0x67da('0x11'));logger[_0x67da('0x12')](_0x67da('0x13'),_0x827ae8,'request\x20sent',JSON['stringify'](_0x6fe2d4));if(_0x6fe2d4[_0x67da('0x14')]){if(_0x6fe2d4[_0x67da('0x14')]['code']===0x1f4){logger[_0x67da('0x14')](_0x67da('0x10'),_0x827ae8,_0x6fe2d4[_0x67da('0x14')][_0x67da('0x15')]);return _0x237014(_0x6fe2d4[_0x67da('0x14')][_0x67da('0x15')]);}logger[_0x67da('0x14')](_0x67da('0x10'),_0x827ae8,_0x6fe2d4[_0x67da('0x14')][_0x67da('0x15')]);return _0x21940a(_0x6fe2d4[_0x67da('0x14')]['message']);}else{logger[_0x67da('0xf')](_0x67da('0x10'),_0x827ae8,_0x67da('0x11'));_0x21940a(_0x6fe2d4[_0x67da('0x16')][_0x67da('0x15')]);}})[_0x67da('0x17')](function(_0x24b446){logger[_0x67da('0x14')](_0x67da('0x10'),_0x827ae8,_0x24b446);_0x237014(_0x24b446);});});} \ No newline at end of file +var _0x44db=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x44db,0x18f));var _0xb44d=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x44db[_0x136619];return _0x38c4a5;};'use strict';var _=require('lodash');var util=require(_0xb44d('0x0'));var moment=require(_0xb44d('0x1'));var BPromise=require('bluebird');var rs=require(_0xb44d('0x2'));var fs=require('fs');var Redis=require(_0xb44d('0x3'));var db=require(_0xb44d('0x4'))['db'];var utils=require(_0xb44d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb44d('0x6'));var jayson=require(_0xb44d('0x7'));var client=jayson[_0xb44d('0x8')][_0xb44d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61c944,_0x20dbf3,_0x1f5277){return new BPromise(function(_0x3c1392,_0x49444a){return client[_0xb44d('0xa')](_0x61c944,_0x1f5277)[_0xb44d('0xb')](function(_0x4e3416){logger[_0xb44d('0xc')](_0xb44d('0xd'),_0x20dbf3,_0xb44d('0xe'));logger[_0xb44d('0xf')](_0xb44d('0x10'),_0x20dbf3,_0xb44d('0xe'),JSON[_0xb44d('0x11')](_0x4e3416));if(_0x4e3416[_0xb44d('0x12')]){if(_0x4e3416[_0xb44d('0x12')]['code']===0x1f4){logger[_0xb44d('0x12')](_0xb44d('0xd'),_0x20dbf3,_0x4e3416[_0xb44d('0x12')][_0xb44d('0x13')]);return _0x49444a(_0x4e3416['error'][_0xb44d('0x13')]);}logger[_0xb44d('0x12')](_0xb44d('0xd'),_0x20dbf3,_0x4e3416[_0xb44d('0x12')][_0xb44d('0x13')]);return _0x3c1392(_0x4e3416[_0xb44d('0x12')]['message']);}else{logger[_0xb44d('0xc')](_0xb44d('0xd'),_0x20dbf3,_0xb44d('0xe'));_0x3c1392(_0x4e3416[_0xb44d('0x14')]['message']);}})[_0xb44d('0x15')](function(_0x1294c8){logger[_0xb44d('0x12')](_0xb44d('0xd'),_0x20dbf3,_0x1294c8);_0x49444a(_0x1294c8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f7b58d7..39dabd5 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 _0x1367=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x574f8c,_0x129642){var _0x32846c=function(_0x26c166){while(--_0x26c166){_0x574f8c['push'](_0x574f8c['shift']());}};_0x32846c(++_0x129642);}(_0x1367,0xe7));var _0x7136=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x1367[_0x38c699];return _0x3b1ded;};'use strict';var multer=require('multer');var util=require(_0x7136('0x0'));var path=require(_0x7136('0x1'));var timeout=require(_0x7136('0x2'));var express=require(_0x7136('0x3'));var router=express[_0x7136('0x4')]();var fs_extra=require(_0x7136('0x5'));var auth=require(_0x7136('0x6'));var interaction=require(_0x7136('0x7'));var config=require(_0x7136('0x8'));var controller=require(_0x7136('0x9'));router[_0x7136('0xa')]('/',auth[_0x7136('0xb')](),controller[_0x7136('0xc')]);router[_0x7136('0xa')](_0x7136('0xd'),auth[_0x7136('0xb')](),controller[_0x7136('0xe')]);router['post']('/',auth[_0x7136('0xb')](),controller['create']);router['put'](_0x7136('0xd'),auth[_0x7136('0xb')](),controller['update']);router[_0x7136('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7136('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3b82=['/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get'];(function(_0x5278f4,_0x340d15){var _0x5a95a6=function(_0x32787e){while(--_0x32787e){_0x5278f4['push'](_0x5278f4['shift']());}};_0x5a95a6(++_0x340d15);}(_0x3b82,0x123));var _0x23b8=function(_0x1b68ba,_0x23687a){_0x1b68ba=_0x1b68ba-0x0;var _0xf49b11=_0x3b82[_0x1b68ba];return _0xf49b11;};'use strict';var multer=require(_0x23b8('0x0'));var util=require(_0x23b8('0x1'));var path=require(_0x23b8('0x2'));var timeout=require(_0x23b8('0x3'));var express=require(_0x23b8('0x4'));var router=express[_0x23b8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23b8('0x6'));var interaction=require(_0x23b8('0x7'));var config=require(_0x23b8('0x8'));var controller=require(_0x23b8('0x9'));router['get']('/',auth[_0x23b8('0xa')](),controller[_0x23b8('0xb')]);router[_0x23b8('0xc')](_0x23b8('0xd'),auth[_0x23b8('0xa')](),controller[_0x23b8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x23b8('0xf')]);router[_0x23b8('0x10')](_0x23b8('0xd'),auth[_0x23b8('0xa')](),controller['update']);router[_0x23b8('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x23b8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c6b8de7..2d2323e 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 _0x5f55=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xd55fa0,_0x4132ec){var _0xb428ea=function(_0x44ab55){while(--_0x44ab55){_0xd55fa0['push'](_0xd55fa0['shift']());}};_0xb428ea(++_0x4132ec);}(_0x5f55,0x150));var _0x55f5=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x5f55[_0x316b13];return _0x29ab59;};'use strict';var Sequelize=require(_0x55f5('0x0'));module[_0x55f5('0x1')]={'type':{'type':Sequelize[_0x55f5('0x2')](_0x55f5('0x3'),_0x55f5('0x4'),_0x55f5('0x5'),_0x55f5('0x6'),'picklist'),'defaultValue':_0x55f5('0x3')},'content':{'type':Sequelize[_0x55f5('0x7')]},'key':{'type':Sequelize[_0x55f5('0x7')]},'keyType':{'type':Sequelize[_0x55f5('0x2')]('string',_0x55f5('0x4'),_0x55f5('0x5'))},'keyContent':{'type':Sequelize[_0x55f5('0x7')]},'idField':{'type':Sequelize[_0x55f5('0x7')]},'variableName':{'type':Sequelize[_0x55f5('0x7')]}}; \ No newline at end of file +var _0xf952=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4d129b,_0x41aa44){var _0x35c389=function(_0x495038){while(--_0x495038){_0x4d129b['push'](_0x4d129b['shift']());}};_0x35c389(++_0x41aa44);}(_0xf952,0x1ea));var _0x2f95=function(_0x3b3bca,_0x53aa91){_0x3b3bca=_0x3b3bca-0x0;var _0x470491=_0xf952[_0x3b3bca];return _0x470491;};'use strict';var Sequelize=require('sequelize');module[_0x2f95('0x0')]={'type':{'type':Sequelize[_0x2f95('0x1')](_0x2f95('0x2'),_0x2f95('0x3'),_0x2f95('0x4'),_0x2f95('0x5'),_0x2f95('0x6')),'defaultValue':_0x2f95('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2f95('0x7')]},'keyType':{'type':Sequelize[_0x2f95('0x1')]('string','variable',_0x2f95('0x4'))},'keyContent':{'type':Sequelize[_0x2f95('0x7')]},'idField':{'type':Sequelize[_0x2f95('0x7')]},'variableName':{'type':Sequelize[_0x2f95('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 75b012d..e2d1f5c 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 _0x1438=['save','update','then','sendStatus','map','rawAttributes','fieldName','type','key','name','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceField','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','set','apply','reject'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x1438,0x19a));var _0x8143=function(_0x180bd3,_0x240488){_0x180bd3=_0x180bd3-0x0;var _0x2c7250=_0x1438[_0x180bd3];return _0x2c7250;};'use strict';var emlformat=require(_0x8143('0x0'));var rimraf=require(_0x8143('0x1'));var zipdir=require(_0x8143('0x2'));var jsonpatch=require(_0x8143('0x3'));var rp=require(_0x8143('0x4'));var moment=require(_0x8143('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8143('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8143('0x7'));var csv=require(_0x8143('0x8'));var ejs=require(_0x8143('0x9'));var fs=require('fs');var fs_extra=require(_0x8143('0xa'));var _=require(_0x8143('0xb'));var squel=require('squel');var crypto=require(_0x8143('0xc'));var jsforce=require(_0x8143('0xd'));var deskjs=require(_0x8143('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8143('0xf'));var Papa=require(_0x8143('0x10'));var Redis=require(_0x8143('0x11'));var authService=require(_0x8143('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8143('0x13'));var hardwareService=require(_0x8143('0x14'));var logger=require('../../config/logger')(_0x8143('0x15'));var utils=require(_0x8143('0x16'));var config=require(_0x8143('0x17'));var licenseUtil=require(_0x8143('0x18'));var db=require(_0x8143('0x19'))['db'];function respondWithStatusCode(_0x2ea9fc,_0x1b922b){_0x1b922b=_0x1b922b||0xcc;return function(_0x3c7c9e){if(_0x3c7c9e){return _0x2ea9fc['sendStatus'](_0x1b922b);}return _0x2ea9fc['status'](_0x1b922b)[_0x8143('0x1a')]();};}function respondWithResult(_0x2d28e8,_0x2d880e){_0x2d880e=_0x2d880e||0xc8;return function(_0x1c0560){if(_0x1c0560){return _0x2d28e8[_0x8143('0x1b')](_0x2d880e)[_0x8143('0x1c')](_0x1c0560);}};}function respondWithFilteredResult(_0x3be09b,_0x2d1c67){return function(_0x467346){if(_0x467346){var _0x353c22=typeof _0x2d1c67[_0x8143('0x1d')]===_0x8143('0x1e')&&typeof _0x2d1c67['limit']===_0x8143('0x1e');var _0x573b24=_0x467346['count'];var _0x4eb21d=_0x353c22?0x0:_0x2d1c67[_0x8143('0x1d')];var _0x2a808d=_0x353c22?_0x467346['count']:_0x2d1c67[_0x8143('0x1d')]+_0x2d1c67['limit'];var _0x2a5c58;if(_0x2a808d>=_0x573b24){_0x2a808d=_0x573b24;_0x2a5c58=0xc8;}else{_0x2a5c58=0xce;}_0x3be09b[_0x8143('0x1b')](_0x2a5c58);return _0x3be09b[_0x8143('0x1f')]('Content-Range',_0x4eb21d+'-'+_0x2a808d+'/'+_0x573b24)[_0x8143('0x1c')](_0x467346);}return null;};}function patchUpdates(_0x1cc776){return function(_0x3893c9){try{jsonpatch[_0x8143('0x20')](_0x3893c9,_0x1cc776,!![]);}catch(_0x556d2e){return BPromise[_0x8143('0x21')](_0x556d2e);}return _0x3893c9[_0x8143('0x22')]();};}function saveUpdates(_0x575e7b,_0x2b18c5){return function(_0x7efe35){if(_0x7efe35){return _0x7efe35[_0x8143('0x23')](_0x575e7b)[_0x8143('0x24')](function(_0x5e535f){return _0x5e535f;});}return null;};}function removeEntity(_0x35a5f9,_0x52037d){return function(_0x29d124){if(_0x29d124){return _0x29d124['destroy']()[_0x8143('0x24')](function(){_0x35a5f9[_0x8143('0x1b')](0xcc)[_0x8143('0x1a')]();});}};}function handleEntityNotFound(_0xb0e5a1,_0x5e7fd3){return function(_0x2e352b){if(!_0x2e352b){_0xb0e5a1[_0x8143('0x25')](0x194);}return _0x2e352b;};}function handleError(_0x4fe774,_0x101690){_0x101690=_0x101690||0x1f4;return function(_0x5ef5a5){logger['error'](_0x5ef5a5['stack']);if(_0x5ef5a5['name']){delete _0x5ef5a5['name'];}_0x4fe774['status'](_0x101690)['send'](_0x5ef5a5);};}exports['index']=function(_0x638580,_0x151031){var _0x437b5e={},_0x232116={},_0x51f200={'count':0x0,'rows':[]};var _0x30a2bb=_[_0x8143('0x26')](db['SalesforceField'][_0x8143('0x27')],function(_0x4f2e97){return{'name':_0x4f2e97[_0x8143('0x28')],'type':_0x4f2e97[_0x8143('0x29')][_0x8143('0x2a')]};});_0x232116['model']=_[_0x8143('0x26')](_0x30a2bb,_0x8143('0x2b'));_0x232116['query']=_[_0x8143('0x2c')](_0x638580[_0x8143('0x2d')]);_0x232116['filters']=_[_0x8143('0x2e')](_0x232116[_0x8143('0x2f')],_0x232116[_0x8143('0x2d')]);_0x437b5e[_0x8143('0x30')]=_[_0x8143('0x2e')](_0x232116[_0x8143('0x2f')],qs[_0x8143('0x31')](_0x638580[_0x8143('0x2d')][_0x8143('0x31')]));_0x437b5e[_0x8143('0x30')]=_0x437b5e[_0x8143('0x30')][_0x8143('0x32')]?_0x437b5e[_0x8143('0x30')]:_0x232116[_0x8143('0x2f')];if(!_0x638580[_0x8143('0x2d')][_0x8143('0x33')](_0x8143('0x34'))){_0x437b5e[_0x8143('0x35')]=qs[_0x8143('0x35')](_0x638580[_0x8143('0x2d')][_0x8143('0x35')]);_0x437b5e[_0x8143('0x1d')]=qs[_0x8143('0x1d')](_0x638580[_0x8143('0x2d')][_0x8143('0x1d')]);}_0x437b5e[_0x8143('0x36')]=qs[_0x8143('0x37')](_0x638580[_0x8143('0x2d')]['sort']);_0x437b5e[_0x8143('0x38')]=qs[_0x8143('0x39')](_[_0x8143('0x3a')](_0x638580[_0x8143('0x2d')],_0x232116[_0x8143('0x39')]),_0x30a2bb);if(_0x638580[_0x8143('0x2d')][_0x8143('0x3b')]){_0x437b5e[_0x8143('0x38')]=_[_0x8143('0x3c')](_0x437b5e[_0x8143('0x38')],{'$or':_[_0x8143('0x26')](_0x30a2bb,function(_0x12d7d7){if(_0x12d7d7[_0x8143('0x29')]!==_0x8143('0x3d')){var _0x568f09={};_0x568f09[_0x12d7d7[_0x8143('0x2b')]]={'$like':'%'+_0x638580[_0x8143('0x2d')][_0x8143('0x3b')]+'%'};return _0x568f09;}})});}_0x437b5e=_[_0x8143('0x3c')]({},_0x437b5e,_0x638580[_0x8143('0x3e')]);var _0x5ba8b5={'where':_0x437b5e[_0x8143('0x38')]};return db[_0x8143('0x3f')][_0x8143('0x40')](_0x5ba8b5)['then'](function(_0x12997e){_0x51f200[_0x8143('0x40')]=_0x12997e;if(_0x638580[_0x8143('0x2d')][_0x8143('0x41')]){_0x437b5e[_0x8143('0x42')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x437b5e);})[_0x8143('0x24')](function(_0x5ce5a5){_0x51f200[_0x8143('0x43')]=_0x5ce5a5;return _0x51f200;})[_0x8143('0x24')](respondWithFilteredResult(_0x151031,_0x437b5e))[_0x8143('0x44')](handleError(_0x151031,null));};exports[_0x8143('0x45')]=function(_0x4dafde,_0x149c62){var _0x4b3476={'raw':!![],'where':{'id':_0x4dafde[_0x8143('0x46')]['id']}},_0x14e5d4={};_0x14e5d4['model']=_['keys'](db[_0x8143('0x3f')][_0x8143('0x27')]);_0x14e5d4[_0x8143('0x2d')]=_[_0x8143('0x2c')](_0x4dafde[_0x8143('0x2d')]);_0x14e5d4['filters']=_['intersection'](_0x14e5d4['model'],_0x14e5d4['query']);_0x4b3476[_0x8143('0x30')]=_[_0x8143('0x2e')](_0x14e5d4['model'],qs[_0x8143('0x31')](_0x4dafde[_0x8143('0x2d')][_0x8143('0x31')]));_0x4b3476[_0x8143('0x30')]=_0x4b3476['attributes']['length']?_0x4b3476[_0x8143('0x30')]:_0x14e5d4[_0x8143('0x2f')];if(_0x4dafde[_0x8143('0x2d')][_0x8143('0x41')]){_0x4b3476[_0x8143('0x42')]=[{'all':!![]}];}_0x4b3476=_[_0x8143('0x3c')]({},_0x4b3476,_0x4dafde['options']);return db[_0x8143('0x3f')][_0x8143('0x47')](_0x4b3476)[_0x8143('0x24')](handleEntityNotFound(_0x149c62,null))[_0x8143('0x24')](respondWithResult(_0x149c62,null))['catch'](handleError(_0x149c62,null));};exports[_0x8143('0x48')]=function(_0x18483b,_0x56c91c){return db['SalesforceField']['create'](_0x18483b[_0x8143('0x49')],{})[_0x8143('0x24')](respondWithResult(_0x56c91c,0xc9))[_0x8143('0x44')](handleError(_0x56c91c,null));};exports[_0x8143('0x23')]=function(_0x1f4e3d,_0x22009b){if(_0x1f4e3d[_0x8143('0x49')]['id']){delete _0x1f4e3d[_0x8143('0x49')]['id'];}return db[_0x8143('0x3f')]['find']({'where':{'id':_0x1f4e3d[_0x8143('0x46')]['id']}})[_0x8143('0x24')](handleEntityNotFound(_0x22009b,null))[_0x8143('0x24')](saveUpdates(_0x1f4e3d['body'],null))[_0x8143('0x24')](respondWithResult(_0x22009b,null))['catch'](handleError(_0x22009b,null));};exports['destroy']=function(_0x3a0f76,_0x2230d5){return db[_0x8143('0x3f')][_0x8143('0x47')]({'where':{'id':_0x3a0f76[_0x8143('0x46')]['id']}})[_0x8143('0x24')](handleEntityNotFound(_0x2230d5,null))[_0x8143('0x24')](removeEntity(_0x2230d5,null))['catch'](handleError(_0x2230d5,null));}; \ No newline at end of file +var _0x01cb=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','limit','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x01cb,0x169));var _0xb01c=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x01cb[_0x5a19fc];return _0x34b413;};'use strict';var emlformat=require(_0xb01c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb01c('0x1'));var jsonpatch=require(_0xb01c('0x2'));var rp=require(_0xb01c('0x3'));var moment=require(_0xb01c('0x4'));var BPromise=require(_0xb01c('0x5'));var Mustache=require(_0xb01c('0x6'));var util=require(_0xb01c('0x7'));var path=require(_0xb01c('0x8'));var sox=require(_0xb01c('0x9'));var csv=require(_0xb01c('0xa'));var ejs=require(_0xb01c('0xb'));var fs=require('fs');var fs_extra=require(_0xb01c('0xc'));var _=require(_0xb01c('0xd'));var squel=require(_0xb01c('0xe'));var crypto=require('crypto');var jsforce=require(_0xb01c('0xf'));var deskjs=require(_0xb01c('0x10'));var toCsv=require(_0xb01c('0xa'));var querystring=require(_0xb01c('0x11'));var Papa=require(_0xb01c('0x12'));var Redis=require(_0xb01c('0x13'));var authService=require(_0xb01c('0x14'));var qs=require(_0xb01c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb01c('0x16'));var logger=require(_0xb01c('0x17'))('api');var utils=require(_0xb01c('0x18'));var config=require(_0xb01c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb01c('0x1a'))['db'];function respondWithStatusCode(_0x580763,_0x50fbd2){_0x50fbd2=_0x50fbd2||0xcc;return function(_0x28834a){if(_0x28834a){return _0x580763['sendStatus'](_0x50fbd2);}return _0x580763[_0xb01c('0x1b')](_0x50fbd2)['end']();};}function respondWithResult(_0x336fc7,_0x2699e2){_0x2699e2=_0x2699e2||0xc8;return function(_0xa30f9e){if(_0xa30f9e){return _0x336fc7['status'](_0x2699e2)[_0xb01c('0x1c')](_0xa30f9e);}};}function respondWithFilteredResult(_0x13cda8,_0x18222d){return function(_0x1c122e){if(_0x1c122e){var _0x89e5cb=typeof _0x18222d['offset']==='undefined'&&typeof _0x18222d['limit']===_0xb01c('0x1d');var _0x4dde93=_0x1c122e['count'];var _0x5b0e6f=_0x89e5cb?0x0:_0x18222d['offset'];var _0x36632d=_0x89e5cb?_0x1c122e[_0xb01c('0x1e')]:_0x18222d[_0xb01c('0x1f')]+_0x18222d['limit'];var _0x4abc07;if(_0x36632d>=_0x4dde93){_0x36632d=_0x4dde93;_0x4abc07=0xc8;}else{_0x4abc07=0xce;}_0x13cda8[_0xb01c('0x1b')](_0x4abc07);return _0x13cda8[_0xb01c('0x20')]('Content-Range',_0x5b0e6f+'-'+_0x36632d+'/'+_0x4dde93)[_0xb01c('0x1c')](_0x1c122e);}return null;};}function patchUpdates(_0x4e15c2){return function(_0x2f431a){try{jsonpatch['apply'](_0x2f431a,_0x4e15c2,!![]);}catch(_0x298fca){return BPromise['reject'](_0x298fca);}return _0x2f431a['save']();};}function saveUpdates(_0x377be8,_0xc5b66b){return function(_0x494e02){if(_0x494e02){return _0x494e02[_0xb01c('0x21')](_0x377be8)[_0xb01c('0x22')](function(_0x19b7c5){return _0x19b7c5;});}return null;};}function removeEntity(_0x405f15,_0x318cdf){return function(_0x11b8b0){if(_0x11b8b0){return _0x11b8b0[_0xb01c('0x23')]()[_0xb01c('0x22')](function(){_0x405f15[_0xb01c('0x1b')](0xcc)[_0xb01c('0x24')]();});}};}function handleEntityNotFound(_0x2fe884,_0x2e4cca){return function(_0x41a0e6){if(!_0x41a0e6){_0x2fe884[_0xb01c('0x25')](0x194);}return _0x41a0e6;};}function handleError(_0x39ab94,_0x7094e3){_0x7094e3=_0x7094e3||0x1f4;return function(_0x165b32){logger[_0xb01c('0x26')](_0x165b32[_0xb01c('0x27')]);if(_0x165b32[_0xb01c('0x28')]){delete _0x165b32[_0xb01c('0x28')];}_0x39ab94[_0xb01c('0x1b')](_0x7094e3)[_0xb01c('0x29')](_0x165b32);};}exports[_0xb01c('0x2a')]=function(_0x10b73f,_0x27d513){var _0x2bcf4f={},_0x1c55c6={},_0x44a9aa={'count':0x0,'rows':[]};var _0x4900c8=_['map'](db[_0xb01c('0x2b')][_0xb01c('0x2c')],function(_0x481565){return{'name':_0x481565[_0xb01c('0x2d')],'type':_0x481565[_0xb01c('0x2e')][_0xb01c('0x2f')]};});_0x1c55c6[_0xb01c('0x30')]=_[_0xb01c('0x31')](_0x4900c8,'name');_0x1c55c6[_0xb01c('0x32')]=_[_0xb01c('0x33')](_0x10b73f['query']);_0x1c55c6['filters']=_[_0xb01c('0x34')](_0x1c55c6[_0xb01c('0x30')],_0x1c55c6[_0xb01c('0x32')]);_0x2bcf4f['attributes']=_[_0xb01c('0x34')](_0x1c55c6[_0xb01c('0x30')],qs[_0xb01c('0x35')](_0x10b73f['query'][_0xb01c('0x35')]));_0x2bcf4f['attributes']=_0x2bcf4f[_0xb01c('0x36')][_0xb01c('0x37')]?_0x2bcf4f[_0xb01c('0x36')]:_0x1c55c6[_0xb01c('0x30')];if(!_0x10b73f['query']['hasOwnProperty'](_0xb01c('0x38'))){_0x2bcf4f['limit']=qs[_0xb01c('0x39')](_0x10b73f[_0xb01c('0x32')][_0xb01c('0x39')]);_0x2bcf4f['offset']=qs[_0xb01c('0x1f')](_0x10b73f[_0xb01c('0x32')]['offset']);}_0x2bcf4f['order']=qs[_0xb01c('0x3a')](_0x10b73f['query']['sort']);_0x2bcf4f[_0xb01c('0x3b')]=qs[_0xb01c('0x3c')](_[_0xb01c('0x3d')](_0x10b73f[_0xb01c('0x32')],_0x1c55c6[_0xb01c('0x3c')]),_0x4900c8);if(_0x10b73f['query'][_0xb01c('0x3e')]){_0x2bcf4f[_0xb01c('0x3b')]=_[_0xb01c('0x3f')](_0x2bcf4f['where'],{'$or':_[_0xb01c('0x31')](_0x4900c8,function(_0x46d6db){if(_0x46d6db[_0xb01c('0x2e')]!=='VIRTUAL'){var _0x33909d={};_0x33909d[_0x46d6db[_0xb01c('0x28')]]={'$like':'%'+_0x10b73f['query'][_0xb01c('0x3e')]+'%'};return _0x33909d;}})});}_0x2bcf4f=_['merge']({},_0x2bcf4f,_0x10b73f['options']);var _0x3956ad={'where':_0x2bcf4f[_0xb01c('0x3b')]};return db[_0xb01c('0x2b')][_0xb01c('0x1e')](_0x3956ad)[_0xb01c('0x22')](function(_0x265705){_0x44a9aa[_0xb01c('0x1e')]=_0x265705;if(_0x10b73f['query']['includeAll']){_0x2bcf4f[_0xb01c('0x40')]=[{'all':!![]}];}return db[_0xb01c('0x2b')][_0xb01c('0x41')](_0x2bcf4f);})[_0xb01c('0x22')](function(_0x143ad8){_0x44a9aa[_0xb01c('0x42')]=_0x143ad8;return _0x44a9aa;})['then'](respondWithFilteredResult(_0x27d513,_0x2bcf4f))[_0xb01c('0x43')](handleError(_0x27d513,null));};exports[_0xb01c('0x44')]=function(_0x8949c7,_0x1a5f2e){var _0x330984={'raw':!![],'where':{'id':_0x8949c7[_0xb01c('0x45')]['id']}},_0xbf2871={};_0xbf2871[_0xb01c('0x30')]=_['keys'](db[_0xb01c('0x2b')][_0xb01c('0x2c')]);_0xbf2871['query']=_[_0xb01c('0x33')](_0x8949c7[_0xb01c('0x32')]);_0xbf2871['filters']=_['intersection'](_0xbf2871[_0xb01c('0x30')],_0xbf2871[_0xb01c('0x32')]);_0x330984[_0xb01c('0x36')]=_[_0xb01c('0x34')](_0xbf2871['model'],qs['fields'](_0x8949c7[_0xb01c('0x32')][_0xb01c('0x35')]));_0x330984['attributes']=_0x330984[_0xb01c('0x36')]['length']?_0x330984[_0xb01c('0x36')]:_0xbf2871['model'];if(_0x8949c7[_0xb01c('0x32')][_0xb01c('0x46')]){_0x330984['include']=[{'all':!![]}];}_0x330984=_[_0xb01c('0x3f')]({},_0x330984,_0x8949c7[_0xb01c('0x47')]);return db[_0xb01c('0x2b')][_0xb01c('0x48')](_0x330984)[_0xb01c('0x22')](handleEntityNotFound(_0x1a5f2e,null))[_0xb01c('0x22')](respondWithResult(_0x1a5f2e,null))['catch'](handleError(_0x1a5f2e,null));};exports[_0xb01c('0x49')]=function(_0x3cfdf9,_0x4b3b37){return db['SalesforceField']['create'](_0x3cfdf9[_0xb01c('0x4a')],{})[_0xb01c('0x22')](respondWithResult(_0x4b3b37,0xc9))[_0xb01c('0x43')](handleError(_0x4b3b37,null));};exports[_0xb01c('0x21')]=function(_0xce5226,_0x3b6752){if(_0xce5226['body']['id']){delete _0xce5226[_0xb01c('0x4a')]['id'];}return db[_0xb01c('0x2b')][_0xb01c('0x48')]({'where':{'id':_0xce5226[_0xb01c('0x45')]['id']}})[_0xb01c('0x22')](handleEntityNotFound(_0x3b6752,null))[_0xb01c('0x22')](saveUpdates(_0xce5226[_0xb01c('0x4a')],null))['then'](respondWithResult(_0x3b6752,null))[_0xb01c('0x43')](handleError(_0x3b6752,null));};exports[_0xb01c('0x23')]=function(_0x44ef0e,_0x2b96c6){return db[_0xb01c('0x2b')][_0xb01c('0x48')]({'where':{'id':_0x44ef0e[_0xb01c('0x45')]['id']}})[_0xb01c('0x22')](handleEntityNotFound(_0x2b96c6,null))[_0xb01c('0x22')](removeEntity(_0x2b96c6,null))[_0xb01c('0x43')](handleError(_0x2b96c6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e3628a8..c08716f 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 _0x0656=['../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46f19f,_0x431e5c){var _0x408afb=function(_0x59f1bc){while(--_0x59f1bc){_0x46f19f['push'](_0x46f19f['shift']());}};_0x408afb(++_0x431e5c);}(_0x0656,0x1d8));var _0x6065=function(_0x5b0215,_0x20b40f){_0x5b0215=_0x5b0215-0x0;var _0x30a47b=_0x0656[_0x5b0215];return _0x30a47b;};'use strict';var _=require(_0x6065('0x0'));var util=require(_0x6065('0x1'));var logger=require('../../config/logger')(_0x6065('0x2'));var moment=require(_0x6065('0x3'));var BPromise=require(_0x6065('0x4'));var rp=require(_0x6065('0x5'));var fs=require('fs');var path=require(_0x6065('0x6'));var rimraf=require(_0x6065('0x7'));var config=require(_0x6065('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x6065('0x9')]=function(_0x39fa21,_0x523d59){return _0x39fa21[_0x6065('0xa')](_0x6065('0xb'),attributes,{'tableName':_0x6065('0xc'),'paranoid':![],'indexes':[{'name':_0x6065('0xd'),'fields':[_0x6065('0xe'),_0x6065('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x700a=['../../config/environment','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x700a,0x95));var _0xa700=function(_0x3044fd,_0x3691b0){_0x3044fd=_0x3044fd-0x0;var _0x786083=_0x700a[_0x3044fd];return _0x786083;};'use strict';var _=require('lodash');var util=require(_0xa700('0x0'));var logger=require(_0xa700('0x1'))(_0xa700('0x2'));var moment=require('moment');var BPromise=require(_0xa700('0x3'));var rp=require(_0xa700('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa700('0x5'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x28a574,_0xf39b3c){return _0x28a574[_0xa700('0x6')]('SalesforceField',attributes,{'tableName':_0xa700('0x7'),'paranoid':![],'indexes':[{'name':_0xa700('0x8'),'fields':[_0xa700('0x9'),_0xa700('0xa')],'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 61951de..82a6cb4 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 _0xe2ba=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xe2ba,0x191));var _0xae2b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xe2ba[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0xae2b('0x0'));var moment=require(_0xae2b('0x1'));var BPromise=require(_0xae2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae2b('0x3'))['db'];var utils=require(_0xae2b('0x4'));var logger=require(_0xae2b('0x5'))(_0xae2b('0x6'));var config=require(_0xae2b('0x7'));var jayson=require(_0xae2b('0x8'));var client=jayson[_0xae2b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a029,_0x501cc6,_0x149789){return new BPromise(function(_0x7ed0f5,_0x152c0c){return client['request'](_0x52a029,_0x149789)['then'](function(_0x35269e){logger['info'](_0xae2b('0xa'),_0x501cc6,_0xae2b('0xb'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x501cc6,_0xae2b('0xb'),JSON[_0xae2b('0xc')](_0x35269e));if(_0x35269e[_0xae2b('0xd')]){if(_0x35269e[_0xae2b('0xd')][_0xae2b('0xe')]===0x1f4){logger[_0xae2b('0xd')](_0xae2b('0xa'),_0x501cc6,_0x35269e['error']['message']);return _0x152c0c(_0x35269e[_0xae2b('0xd')]['message']);}logger[_0xae2b('0xd')](_0xae2b('0xa'),_0x501cc6,_0x35269e[_0xae2b('0xd')][_0xae2b('0xf')]);return _0x7ed0f5(_0x35269e[_0xae2b('0xd')][_0xae2b('0xf')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x501cc6,'request\x20sent');_0x7ed0f5(_0x35269e[_0xae2b('0x10')][_0xae2b('0xf')]);}})[_0xae2b('0x11')](function(_0xd113e){logger[_0xae2b('0xd')](_0xae2b('0xa'),_0x501cc6,_0xd113e);_0x152c0c(_0xd113e);});});} \ No newline at end of file +var _0x0a09=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x56ff8c,_0x30098a){var _0x21ffec=function(_0x7267d7){while(--_0x7267d7){_0x56ff8c['push'](_0x56ff8c['shift']());}};_0x21ffec(++_0x30098a);}(_0x0a09,0xdd));var _0x90a0=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0a09[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0x90a0('0x0'));var util=require('util');var moment=require(_0x90a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x90a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90a0('0x3'));var logger=require(_0x90a0('0x4'))(_0x90a0('0x5'));var config=require('../../config/environment');var jayson=require(_0x90a0('0x6'));var client=jayson[_0x90a0('0x7')][_0x90a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42cd12,_0x169300,_0x59742a){return new BPromise(function(_0x1650f6,_0x58cd33){return client[_0x90a0('0x9')](_0x42cd12,_0x59742a)[_0x90a0('0xa')](function(_0x3c6dd3){logger[_0x90a0('0xb')](_0x90a0('0xc'),_0x169300,_0x90a0('0xd'));logger[_0x90a0('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x169300,_0x90a0('0xd'),JSON[_0x90a0('0xf')](_0x3c6dd3));if(_0x3c6dd3['error']){if(_0x3c6dd3[_0x90a0('0x10')][_0x90a0('0x11')]===0x1f4){logger[_0x90a0('0x10')](_0x90a0('0xc'),_0x169300,_0x3c6dd3['error'][_0x90a0('0x12')]);return _0x58cd33(_0x3c6dd3[_0x90a0('0x10')][_0x90a0('0x12')]);}logger[_0x90a0('0x10')](_0x90a0('0xc'),_0x169300,_0x3c6dd3[_0x90a0('0x10')][_0x90a0('0x12')]);return _0x1650f6(_0x3c6dd3['error'][_0x90a0('0x12')]);}else{logger[_0x90a0('0xb')]('SalesforceField,\x20%s,\x20%s',_0x169300,_0x90a0('0xd'));_0x1650f6(_0x3c6dd3[_0x90a0('0x13')][_0x90a0('0x12')]);}})[_0x90a0('0x14')](function(_0x3f7600){logger[_0x90a0('0x10')]('SalesforceField,\x20%s,\x20%s',_0x169300,_0x3f7600);_0x58cd33(_0x3f7600);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 829e2f2..fd54483 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 _0xeffd=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xeffd,0x6b));var _0xdeff=function(_0x28f0b8,_0x1b62fc){_0x28f0b8=_0x28f0b8-0x0;var _0x3d7f3c=_0xeffd[_0x28f0b8];return _0x3d7f3c;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id/configurations',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/fields',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0x12')]);router[_0xdeff('0x11')](_0xdeff('0x13'),auth[_0xdeff('0xb')](),controller['addConfiguration']);router[_0xdeff('0x14')](_0xdeff('0xd'),auth['isAuthenticated'](),controller[_0xdeff('0x15')]);router['delete']('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0x16')]);module[_0xdeff('0x17')]=router; \ No newline at end of file +var _0x8bc9=['Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','util','connect-timeout','express'];(function(_0x1ca84e,_0x1ab2d0){var _0x479458=function(_0x2a9f5f){while(--_0x2a9f5f){_0x1ca84e['push'](_0x1ca84e['shift']());}};_0x479458(++_0x1ab2d0);}(_0x8bc9,0x89));var _0x98bc=function(_0x40c7b6,_0x8f2ee3){_0x40c7b6=_0x40c7b6-0x0;var _0xa38a9c=_0x8bc9[_0x40c7b6];return _0xa38a9c;};'use strict';var multer=require('multer');var util=require(_0x98bc('0x0'));var path=require('path');var timeout=require(_0x98bc('0x1'));var express=require(_0x98bc('0x2'));var router=express[_0x98bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x98bc('0x4'));var interaction=require(_0x98bc('0x5'));var config=require('../../config/environment');var controller=require(_0x98bc('0x6'));router[_0x98bc('0x7')]('/',auth[_0x98bc('0x8')](),controller[_0x98bc('0x9')]);router[_0x98bc('0x7')](_0x98bc('0xa'),auth[_0x98bc('0x8')](),controller['show']);router[_0x98bc('0x7')](_0x98bc('0xb'),auth['isAuthenticated'](),controller[_0x98bc('0xc')]);router['get'](_0x98bc('0xd'),auth['isAuthenticated'](),controller[_0x98bc('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x98bc('0xf')]);router[_0x98bc('0x10')](_0x98bc('0xb'),auth[_0x98bc('0x8')](),controller[_0x98bc('0x11')]);router[_0x98bc('0x12')](_0x98bc('0xa'),auth[_0x98bc('0x8')](),controller[_0x98bc('0x13')]);router['delete'](_0x98bc('0xa'),auth[_0x98bc('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 72d0707..3b93065 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 _0xe044=['sequelize','STRING','username','remoteUri'];(function(_0x5add4b,_0x571cbe){var _0x105372=function(_0xae370c){while(--_0xae370c){_0x5add4b['push'](_0x5add4b['shift']());}};_0x105372(++_0x571cbe);}(_0xe044,0x154));var _0x4e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe044[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e04('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e04('0x1')]},'description':{'type':Sequelize[_0x4e04('0x1')]},'username':{'type':Sequelize[_0x4e04('0x1')],'unique':_0x4e04('0x2')},'password':{'type':Sequelize[_0x4e04('0x1')]},'email':{'type':Sequelize[_0x4e04('0x1')]},'remoteUri':{'type':Sequelize[_0x4e04('0x1')],'unique':_0x4e04('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf56f=['STRING','username','sequelize','exports'];(function(_0x4ef6f4,_0x3fbb07){var _0x28b103=function(_0x58ddaa){while(--_0x58ddaa){_0x4ef6f4['push'](_0x4ef6f4['shift']());}};_0x28b103(++_0x3fbb07);}(_0xf56f,0xbe));var _0xff56=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xf56f[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0xff56('0x0'));module[_0xff56('0x1')]={'name':{'type':Sequelize[_0xff56('0x2')]},'description':{'type':Sequelize[_0xff56('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xff56('0x3')},'password':{'type':Sequelize[_0xff56('0x2')]},'email':{'type':Sequelize[_0xff56('0x2')]},'remoteUri':{'type':Sequelize[_0xff56('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xff56('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 178d5c9..43b3eca 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 _0x45f8=['request-promise','moment','bluebird','util','path','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','include','rows','catch','show','params','find','create','body','getConfigurations','ServicenowConfiguration','order','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','ServicenowField','hold_reason','knowledge','subcategory','close_code','severity','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','caller_id','work_notes','correlation_display','delivery_task','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','closed_by','follow_up','sys_id','contact_type','incident_state','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','True','true','false','GET','inactive','value','eml-format','fast-json-patch'];(function(_0x1b944d,_0x14ac0f){var _0x1caddc=function(_0x3290b3){while(--_0x3290b3){_0x1b944d['push'](_0x1b944d['shift']());}};_0x1caddc(++_0x14ac0f);}(_0x45f8,0xb3));var _0x845f=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x45f8[_0x44cb92];return _0x56b9e6;};'use strict';var emlformat=require(_0x845f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x845f('0x1'));var rp=require(_0x845f('0x2'));var moment=require(_0x845f('0x3'));var BPromise=require(_0x845f('0x4'));var Mustache=require('mustache');var util=require(_0x845f('0x5'));var path=require(_0x845f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x845f('0x7'));var fs=require('fs');var fs_extra=require(_0x845f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x845f('0x9'));var jsforce=require(_0x845f('0xa'));var deskjs=require(_0x845f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x845f('0xc'));var Papa=require(_0x845f('0xd'));var Redis=require(_0x845f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x845f('0xf'));var as=require(_0x845f('0x10'));var hardwareService=require(_0x845f('0x11'));var logger=require(_0x845f('0x12'))(_0x845f('0x13'));var utils=require(_0x845f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x845f('0x15'));var db=require(_0x845f('0x16'))['db'];var integrations=require(_0x845f('0x17'));function respondWithStatusCode(_0x54d9d4,_0x2d5ae0){_0x2d5ae0=_0x2d5ae0||0xcc;return function(_0x55c98f){if(_0x55c98f){return _0x54d9d4[_0x845f('0x18')](_0x2d5ae0);}return _0x54d9d4[_0x845f('0x19')](_0x2d5ae0)[_0x845f('0x1a')]();};}function respondWithResult(_0x7d09de,_0x154ef7){_0x154ef7=_0x154ef7||0xc8;return function(_0x4c3906){if(_0x4c3906){return _0x7d09de[_0x845f('0x19')](_0x154ef7)[_0x845f('0x1b')](_0x4c3906);}};}function respondWithFilteredResult(_0x880331,_0x210372){return function(_0x3846a4){if(_0x3846a4){var _0x4e0bc9=typeof _0x210372['offset']===_0x845f('0x1c')&&typeof _0x210372[_0x845f('0x1d')]===_0x845f('0x1c');var _0x7bb2b9=_0x3846a4[_0x845f('0x1e')];var _0x4c81db=_0x4e0bc9?0x0:_0x210372[_0x845f('0x1f')];var _0x39ac43=_0x4e0bc9?_0x3846a4['count']:_0x210372[_0x845f('0x1f')]+_0x210372[_0x845f('0x1d')];var _0x586698;if(_0x39ac43>=_0x7bb2b9){_0x39ac43=_0x7bb2b9;_0x586698=0xc8;}else{_0x586698=0xce;}_0x880331[_0x845f('0x19')](_0x586698);return _0x880331[_0x845f('0x20')]('Content-Range',_0x4c81db+'-'+_0x39ac43+'/'+_0x7bb2b9)[_0x845f('0x1b')](_0x3846a4);}return null;};}function patchUpdates(_0x1d4635){return function(_0x2d5dee){try{jsonpatch[_0x845f('0x21')](_0x2d5dee,_0x1d4635,!![]);}catch(_0x12c8c1){return BPromise[_0x845f('0x22')](_0x12c8c1);}return _0x2d5dee[_0x845f('0x23')]();};}function saveUpdates(_0x41a838,_0x6b770f){return function(_0x1bb45e){if(_0x1bb45e){return _0x1bb45e['update'](_0x41a838)['then'](function(_0x3c9d83){return _0x3c9d83;});}return null;};}function removeEntity(_0x48162d,_0x406d9b){return function(_0x1016dd){if(_0x1016dd){return _0x1016dd[_0x845f('0x24')]()[_0x845f('0x25')](function(){_0x48162d[_0x845f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cff40,_0x2a437b){return function(_0x1330fd){if(!_0x1330fd){_0x4cff40[_0x845f('0x18')](0x194);}return _0x1330fd;};}function handleError(_0x6627a5,_0x4bcae0){_0x4bcae0=_0x4bcae0||0x1f4;return function(_0x33f838){logger[_0x845f('0x26')](_0x33f838[_0x845f('0x27')]);if(_0x33f838['name']){delete _0x33f838[_0x845f('0x28')];}_0x6627a5[_0x845f('0x19')](_0x4bcae0)[_0x845f('0x29')](_0x33f838);};}exports[_0x845f('0x2a')]=function(_0x487ad8,_0x33e6d4){var _0x121eea={},_0x29b75e={},_0x513c4b={'count':0x0,'rows':[]};var _0x1c4517=_[_0x845f('0x2b')](db['ServicenowAccount'][_0x845f('0x2c')],function(_0x33eb37){return{'name':_0x33eb37[_0x845f('0x2d')],'type':_0x33eb37[_0x845f('0x2e')]['key']};});_0x29b75e[_0x845f('0x2f')]=_['map'](_0x1c4517,_0x845f('0x28'));_0x29b75e['query']=_[_0x845f('0x30')](_0x487ad8[_0x845f('0x31')]);_0x29b75e[_0x845f('0x32')]=_[_0x845f('0x33')](_0x29b75e['model'],_0x29b75e[_0x845f('0x31')]);_0x121eea[_0x845f('0x34')]=_[_0x845f('0x33')](_0x29b75e[_0x845f('0x2f')],qs[_0x845f('0x35')](_0x487ad8[_0x845f('0x31')][_0x845f('0x35')]));_0x121eea[_0x845f('0x34')]=_0x121eea[_0x845f('0x34')][_0x845f('0x36')]?_0x121eea[_0x845f('0x34')]:_0x29b75e[_0x845f('0x2f')];if(!_0x487ad8[_0x845f('0x31')]['hasOwnProperty'](_0x845f('0x37'))){_0x121eea['limit']=qs[_0x845f('0x1d')](_0x487ad8[_0x845f('0x31')][_0x845f('0x1d')]);_0x121eea[_0x845f('0x1f')]=qs[_0x845f('0x1f')](_0x487ad8[_0x845f('0x31')][_0x845f('0x1f')]);}_0x121eea['order']=qs[_0x845f('0x38')](_0x487ad8['query'][_0x845f('0x38')]);_0x121eea[_0x845f('0x39')]=qs[_0x845f('0x32')](_['pick'](_0x487ad8[_0x845f('0x31')],_0x29b75e[_0x845f('0x32')]),_0x1c4517);if(_0x487ad8[_0x845f('0x31')][_0x845f('0x3a')]){_0x121eea[_0x845f('0x39')]=_[_0x845f('0x3b')](_0x121eea[_0x845f('0x39')],{'$or':_[_0x845f('0x2b')](_0x1c4517,function(_0x48bd26){if(_0x48bd26[_0x845f('0x2e')]!==_0x845f('0x3c')){var _0x10c7c1={};_0x10c7c1[_0x48bd26[_0x845f('0x28')]]={'$like':'%'+_0x487ad8['query'][_0x845f('0x3a')]+'%'};return _0x10c7c1;}})});}_0x121eea=_[_0x845f('0x3b')]({},_0x121eea,_0x487ad8[_0x845f('0x3d')]);var _0x1d1af0={'where':_0x121eea['where']};return db[_0x845f('0x3e')][_0x845f('0x1e')](_0x1d1af0)['then'](function(_0x39d1e9){_0x513c4b[_0x845f('0x1e')]=_0x39d1e9;if(_0x487ad8['query']['includeAll']){_0x121eea[_0x845f('0x3f')]=[{'all':!![]}];}return db[_0x845f('0x3e')]['findAll'](_0x121eea);})[_0x845f('0x25')](function(_0x4fc3c2){_0x513c4b[_0x845f('0x40')]=_0x4fc3c2;return _0x513c4b;})['then'](respondWithFilteredResult(_0x33e6d4,_0x121eea))[_0x845f('0x41')](handleError(_0x33e6d4,null));};exports[_0x845f('0x42')]=function(_0x412c80,_0xcf85d){var _0x26b823={'raw':![],'where':{'id':_0x412c80[_0x845f('0x43')]['id']}},_0x29b2d1={};_0x29b2d1[_0x845f('0x2f')]=_[_0x845f('0x30')](db['ServicenowAccount'][_0x845f('0x2c')]);_0x29b2d1['query']=_[_0x845f('0x30')](_0x412c80[_0x845f('0x31')]);_0x29b2d1[_0x845f('0x32')]=_[_0x845f('0x33')](_0x29b2d1['model'],_0x29b2d1[_0x845f('0x31')]);_0x26b823[_0x845f('0x34')]=_[_0x845f('0x33')](_0x29b2d1['model'],qs[_0x845f('0x35')](_0x412c80[_0x845f('0x31')][_0x845f('0x35')]));_0x26b823[_0x845f('0x34')]=_0x26b823[_0x845f('0x34')]['length']?_0x26b823[_0x845f('0x34')]:_0x29b2d1[_0x845f('0x2f')];if(_0x412c80[_0x845f('0x31')]['includeAll']){_0x26b823['include']=[{'all':!![]}];}_0x26b823=_['merge']({},_0x26b823,_0x412c80['options']);return db[_0x845f('0x3e')][_0x845f('0x44')](_0x26b823)[_0x845f('0x25')](handleEntityNotFound(_0xcf85d,null))[_0x845f('0x25')](respondWithResult(_0xcf85d,null))[_0x845f('0x41')](handleError(_0xcf85d,null));};exports[_0x845f('0x45')]=function(_0x1b48c8,_0x2fc35f){return db[_0x845f('0x3e')][_0x845f('0x45')](_0x1b48c8[_0x845f('0x46')],{})[_0x845f('0x25')](respondWithResult(_0x2fc35f,0xc9))[_0x845f('0x41')](handleError(_0x2fc35f,null));};exports['update']=function(_0x1e0660,_0x281108){if(_0x1e0660[_0x845f('0x46')]['id']){delete _0x1e0660[_0x845f('0x46')]['id'];}return db[_0x845f('0x3e')]['find']({'where':{'id':_0x1e0660[_0x845f('0x43')]['id']}})[_0x845f('0x25')](handleEntityNotFound(_0x281108,null))[_0x845f('0x25')](saveUpdates(_0x1e0660['body'],null))[_0x845f('0x25')](respondWithResult(_0x281108,null))['catch'](handleError(_0x281108,null));};exports[_0x845f('0x24')]=function(_0x3cfbce,_0xdb191f){return db[_0x845f('0x3e')][_0x845f('0x44')]({'where':{'id':_0x3cfbce[_0x845f('0x43')]['id']}})[_0x845f('0x25')](handleEntityNotFound(_0xdb191f,null))['then'](removeEntity(_0xdb191f,null))[_0x845f('0x41')](handleError(_0xdb191f,null));};exports[_0x845f('0x47')]=function(_0xc25ea3,_0x273bad,_0x59e208){var _0x3c518f={};var _0x79ff42={};var _0x182735;var _0x205e8d;return db[_0x845f('0x3e')]['findOne']({'where':{'id':_0xc25ea3[_0x845f('0x43')]['id']}})[_0x845f('0x25')](handleEntityNotFound(_0x273bad,null))[_0x845f('0x25')](function(_0x3bedc4){if(_0x3bedc4){_0x182735=_0x3bedc4;_0x79ff42[_0x845f('0x2f')]=_[_0x845f('0x30')](db[_0x845f('0x48')]['rawAttributes']);_0x79ff42[_0x845f('0x31')]=_[_0x845f('0x30')](_0xc25ea3[_0x845f('0x31')]);_0x79ff42[_0x845f('0x32')]=_[_0x845f('0x33')](_0x79ff42[_0x845f('0x2f')],_0x79ff42[_0x845f('0x31')]);_0x3c518f[_0x845f('0x34')]=_[_0x845f('0x33')](_0x79ff42['model'],qs['fields'](_0xc25ea3['query']['fields']));_0x3c518f[_0x845f('0x34')]=_0x3c518f['attributes'][_0x845f('0x36')]?_0x3c518f[_0x845f('0x34')]:_0x79ff42[_0x845f('0x2f')];_0x3c518f[_0x845f('0x49')]=qs[_0x845f('0x38')](_0xc25ea3[_0x845f('0x31')][_0x845f('0x38')]);_0x3c518f[_0x845f('0x39')]=qs[_0x845f('0x32')](_[_0x845f('0x4a')](_0xc25ea3[_0x845f('0x31')],_0x79ff42[_0x845f('0x32')]));if(_0xc25ea3['query'][_0x845f('0x3a')]){_0x3c518f[_0x845f('0x39')]=_[_0x845f('0x3b')](_0x3c518f[_0x845f('0x39')],{'$or':_['map'](_0x3c518f[_0x845f('0x34')],function(_0x203028){var _0x53dda7={};_0x53dda7[_0x203028]={'$like':'%'+_0xc25ea3['query'][_0x845f('0x3a')]+'%'};return _0x53dda7;})});}_0x3c518f=_[_0x845f('0x3b')]({},_0x3c518f,_0xc25ea3[_0x845f('0x3d')]);return _0x182735[_0x845f('0x47')](_0x3c518f);}})[_0x845f('0x25')](function(_0x12e7cc){if(_0x12e7cc){_0x205e8d=_0x12e7cc['length'];if(!_0xc25ea3['query']['hasOwnProperty']('nolimit')){_0x3c518f['limit']=qs[_0x845f('0x1d')](_0xc25ea3['query'][_0x845f('0x1d')]);_0x3c518f[_0x845f('0x1f')]=qs[_0x845f('0x1f')](_0xc25ea3[_0x845f('0x31')][_0x845f('0x1f')]);}return _0x182735[_0x845f('0x47')](_0x3c518f);}})[_0x845f('0x25')](function(_0x389b03){if(_0x389b03){return _0x389b03?{'count':_0x205e8d,'rows':_0x389b03}:null;}})[_0x845f('0x25')](respondWithResult(_0x273bad,null))[_0x845f('0x41')](handleError(_0x273bad,null));};exports[_0x845f('0x4b')]=function(_0x2dd56c,_0x2ac6cd,_0x1a6252){if(_0x2dd56c[_0x845f('0x46')]['id']){delete _0x2dd56c[_0x845f('0x46')]['id'];}return db[_0x845f('0x3e')][_0x845f('0x4c')]({'where':{'id':_0x2dd56c[_0x845f('0x43')]['id']}})[_0x845f('0x25')](handleEntityNotFound(_0x2ac6cd,null))['then'](function(_0x2bef61){if(_0x2bef61){_0x2dd56c[_0x845f('0x46')][_0x845f('0x4d')]=_0x2bef61['id'];_0x2dd56c[_0x845f('0x46')]['Subjects']=integrations[_0x845f('0x4e')](_0x2dd56c['body'][_0x845f('0x4f')],_0x2dd56c['body'][_0x845f('0x2e')]);_0x2dd56c[_0x845f('0x46')][_0x845f('0x50')]=integrations[_0x845f('0x51')](_0x2dd56c[_0x845f('0x46')][_0x845f('0x4f')],_0x2dd56c[_0x845f('0x46')][_0x845f('0x2e')]);return db[_0x845f('0x48')][_0x845f('0x45')](_0x2dd56c[_0x845f('0x46')],{'include':[{'model':db['ServicenowField'],'as':_0x845f('0x52')},{'model':db[_0x845f('0x53')],'as':_0x845f('0x50')}]});}return null;})[_0x845f('0x25')](respondWithResult(_0x2ac6cd,null))['catch'](handleError(_0x2ac6cd,null));};exports['getFields']=function(_0x152349,_0x2232a3,_0x48e8ee){var _0x5b0c85=['made_sla',_0x845f('0x54'),_0x845f('0x55'),_0x845f('0x56'),_0x845f('0x57'),'notify','incident_state',_0x845f('0x58'),'category'];var _0x53968e=[_0x845f('0x59'),_0x845f('0x5a'),_0x845f('0x5b'),_0x845f('0x5c'),_0x845f('0x5d'),_0x845f('0x5e'),_0x845f('0x5f'),_0x845f('0x54'),_0x845f('0x60'),_0x845f('0x61'),_0x845f('0x62'),_0x845f('0x63'),_0x845f('0x64'),'user_input',_0x845f('0x65'),_0x845f('0x66'),'state',_0x845f('0x67'),_0x845f('0x55'),_0x845f('0x49'),'calendar_stc','closed_at',_0x845f('0x68'),_0x845f('0x69'),_0x845f('0x6a'),_0x845f('0x6b'),_0x845f('0x6c'),_0x845f('0x6d'),'priority',_0x845f('0x6e'),_0x845f('0x6f'),_0x845f('0x70'),_0x845f('0x71'),_0x845f('0x72'),_0x845f('0x73'),_0x845f('0x74'),_0x845f('0x75'),'reopened_time','resolved_at',_0x845f('0x76'),'approval_set',_0x845f('0x56'),_0x845f('0x77'),'short_description',_0x845f('0x57'),_0x845f('0x78'),_0x845f('0x79'),'work_start','assignment_group',_0x845f('0x7a'),_0x845f('0x7b'),'description',_0x845f('0x7c'),_0x845f('0x7d'),_0x845f('0x7e'),'close_notes',_0x845f('0x7f'),_0x845f('0x80'),'parent_incident',_0x845f('0x81'),_0x845f('0x82'),'reopened_by',_0x845f('0x83'),'urgency','problem_id',_0x845f('0x84'),'reassignment_count',_0x845f('0x85'),_0x845f('0x86'),'severity',_0x845f('0x87'),_0x845f('0x88'),_0x845f('0x89'),_0x845f('0x8a'),'due_date',_0x845f('0x8b'),_0x845f('0x8c'),_0x845f('0x8d'),_0x845f('0x8e'),_0x845f('0x8f'),_0x845f('0x90'),'location',_0x845f('0x91')];var _0x3fc8d8='';var _0x12a735='';var _0x512717=[];var _0x116f18='';var _0x1a5360='';var _0x145cd9=[];var _0x206484='';var _0x3b2c57='';var _0x1eaa96={};var _0x13ea64='';return db[_0x845f('0x3e')]['findOne']({'where':{'id':_0x152349[_0x845f('0x43')]['id']},'attributes':['id',_0x845f('0x92'),_0x845f('0x93'),_0x845f('0x94'),_0x845f('0x95'),_0x845f('0x96')]})[_0x845f('0x25')](handleEntityNotFound(_0x2232a3,null))[_0x845f('0x25')](function(_0x12e122){if(_0x12e122){_0x13ea64=_0x12e122[_0x845f('0x95')];var _0x25e053=_0x13ea64[_0x845f('0x97')](-0x1);if(_0x25e053==='/'){_0x13ea64=_0x13ea64[_0x845f('0x98')](0x0,_0x13ea64[_0x845f('0x99')](_0x25e053));}_0x3b2c57=util['format'](_0x845f('0x9a'),_0x13ea64);_0x206484=util['format'](_0x845f('0x9b'),_0x13ea64);_0x1eaa96={'user':_0x12e122['username'],'pass':_0x12e122[_0x845f('0x93')]};var _0x36f010={'method':'GET','uri':_0x3b2c57+_0x845f('0x9c'),'auth':_0x1eaa96,'json':!![]};return rp(_0x36f010);}})[_0x845f('0x25')](function(_0xcd0c15){if(_0xcd0c15['result']['length']>0x0){_0x3fc8d8=_0xcd0c15[_0x845f('0x9d')];}console['log'](_0x845f('0x9e'),_0x3fc8d8);_0x145cd9=[];_0x12a735=Object[_0x845f('0x9f')]([],_0x3fc8d8);_[_0x845f('0xa0')](_0x12a735,function(_0x163d4a){return!_0x5b0c85[_0x845f('0xa1')](_0x163d4a[_0x845f('0x28')]);});_0x12a735[_0x845f('0xa2')](function(_0xf0b4d3){var _0xb06436=createFieldObject(_0x206484,_0x1eaa96,_0xf0b4d3[_0x845f('0xa3')],_0xf0b4d3['name'],_0xf0b4d3[_0x845f('0xa4')],![]);_0x145cd9[_0x845f('0xa5')](_0xb06436);});return Promise[_0x845f('0xa6')](_0x145cd9);})['then'](function(_0x7eed15){_0x512717=_0x7eed15;_0x116f18=Object['assign']([],_0x3fc8d8);console['log'](_0x845f('0xa7'),_0x3fc8d8);_[_0x845f('0xa0')](_0x116f18,function(_0x2ae6d2){return _0x53968e[_0x845f('0xa1')](_0x2ae6d2[_0x845f('0x28')]);});console[_0x845f('0xa8')](_0x845f('0xa9'),_0x116f18);_0x145cd9=[];_0x116f18[_0x845f('0xa2')](function(_0x3d0224){var _0x5d39b6=createFieldObject(_0x206484,_0x1eaa96,_0x3d0224['internalType'],_0x3d0224[_0x845f('0x28')],_0x3d0224[_0x845f('0xa4')],!![]);_0x145cd9['push'](_0x5d39b6);});return Promise['all'](_0x145cd9);})[_0x845f('0x25')](function(_0x46f1bb){_0x1a5360=_0x46f1bb;var _0x138b58=_0x512717[_0x845f('0xaa')](_0x1a5360);return{'count':_0x138b58[_0x845f('0x36')],'rows':_0x138b58};})[_0x845f('0x25')](respondWithResult(_0x2232a3,null))['catch'](function(_0x57b1d9){console[_0x845f('0xa8')](_0x845f('0xab')+_0x57b1d9);var _0x3f737e=_0x152349[_0x845f('0x31')][_0x845f('0xac')]?0x1f4:_0x57b1d9['statusCode']||0x1f4;logger['error'](_0x57b1d9['stack']);delete _0x57b1d9[_0x845f('0x28')];if(_0x3f737e===0x191){_0x3f737e=0x190;}_0x2232a3[_0x845f('0x19')](_0x3f737e)['send'](_0x152349[_0x845f('0x31')][_0x845f('0xac')]?{'message':_0x845f('0xad'),'statusCode':_0x57b1d9[_0x845f('0xae')]}:_0x57b1d9);});};function createFieldObject(_0x4dc970,_0x24f8e0,_0x3c6792,_0x41fd12,_0x2e4ffe,_0x2a25b1){return new Promise(function(_0x63833d,_0x4c00d4){var _0xb0ef15={'id':_0x41fd12,'name':_0x2e4ffe,'custom':_0x2a25b1};if(_0x3c6792==='boolean'){_0xb0ef15['options']=[{'name':_0x845f('0xaf'),'value':_0x845f('0xb0')},{'name':'False','value':_0x845f('0xb1')}];_0x63833d(_0xb0ef15);}else{var _0x321e9f={'method':_0x845f('0xb2'),'uri':_0x4dc970+'sys_choice?sysparm_query=name=incident^element='+_0x41fd12,'auth':_0x24f8e0,'json':!![]};return rp(_0x321e9f)[_0x845f('0x25')](function(_0xed5095){var _0x104a36=[];if(_0xed5095[_0x845f('0x9d')]['length']>0x0){_0xed5095['result'][_0x845f('0xa2')](function(_0x242629){if(_0x242629[_0x845f('0xb3')]===_0x845f('0xb1')){var _0x3150cd={'name':_0x242629[_0x845f('0xa4')],'value':_0x242629[_0x845f('0xb4')]};_0x104a36[_0x845f('0xa5')](_0x3150cd);}});}_0xb0ef15[_0x845f('0x3d')]=_0x104a36;if(_0xb0ef15[_0x845f('0x3d')][_0x845f('0x36')]>0x0){_0x63833d(_0xb0ef15);}else{if(_0x2a25b1==![]){_0x63833d();}else{_0x63833d(_0xb0ef15);}}});}});} \ No newline at end of file +var _0x0ecb=['query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','fields','length','create','body','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','caused_by','watch_list','upon_reject','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_domain','state','sys_created_by','cmdb_ci','impact','active','work_notes_list','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','escalation','correlation_id','location','category','username','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','password','GET','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','false','sys_choice?sysparm_query=name=incident^element=','push','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x0ecb,0x1e2));var _0xb0ec=function(_0x5746a1,_0x11eab1){_0x5746a1=_0x5746a1-0x0;var _0x551a43=_0x0ecb[_0x5746a1];return _0x551a43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0ec('0x0'));var zipdir=require(_0xb0ec('0x1'));var jsonpatch=require(_0xb0ec('0x2'));var rp=require(_0xb0ec('0x3'));var moment=require('moment');var BPromise=require(_0xb0ec('0x4'));var Mustache=require(_0xb0ec('0x5'));var util=require('util');var path=require(_0xb0ec('0x6'));var sox=require(_0xb0ec('0x7'));var csv=require(_0xb0ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0ec('0x9'));var _=require(_0xb0ec('0xa'));var squel=require(_0xb0ec('0xb'));var crypto=require(_0xb0ec('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0ec('0x8'));var querystring=require('querystring');var Papa=require(_0xb0ec('0xd'));var Redis=require('ioredis');var authService=require(_0xb0ec('0xe'));var qs=require(_0xb0ec('0xf'));var as=require(_0xb0ec('0x10'));var hardwareService=require(_0xb0ec('0x11'));var logger=require(_0xb0ec('0x12'))(_0xb0ec('0x13'));var utils=require(_0xb0ec('0x14'));var config=require(_0xb0ec('0x15'));var licenseUtil=require(_0xb0ec('0x16'));var db=require(_0xb0ec('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x562bf0,_0x412282){_0x412282=_0x412282||0xcc;return function(_0x1641bd){if(_0x1641bd){return _0x562bf0[_0xb0ec('0x18')](_0x412282);}return _0x562bf0[_0xb0ec('0x19')](_0x412282)[_0xb0ec('0x1a')]();};}function respondWithResult(_0x1d4479,_0x5a965b){_0x5a965b=_0x5a965b||0xc8;return function(_0x424688){if(_0x424688){return _0x1d4479[_0xb0ec('0x19')](_0x5a965b)[_0xb0ec('0x1b')](_0x424688);}};}function respondWithFilteredResult(_0x31c750,_0x51ebd9){return function(_0x132f3a){if(_0x132f3a){var _0x444720=typeof _0x51ebd9[_0xb0ec('0x1c')]===_0xb0ec('0x1d')&&typeof _0x51ebd9['limit']===_0xb0ec('0x1d');var _0x4123ca=_0x132f3a[_0xb0ec('0x1e')];var _0x101263=_0x444720?0x0:_0x51ebd9[_0xb0ec('0x1c')];var _0x9d11cf=_0x444720?_0x132f3a['count']:_0x51ebd9[_0xb0ec('0x1c')]+_0x51ebd9[_0xb0ec('0x1f')];var _0x37c0ad;if(_0x9d11cf>=_0x4123ca){_0x9d11cf=_0x4123ca;_0x37c0ad=0xc8;}else{_0x37c0ad=0xce;}_0x31c750[_0xb0ec('0x19')](_0x37c0ad);return _0x31c750[_0xb0ec('0x20')](_0xb0ec('0x21'),_0x101263+'-'+_0x9d11cf+'/'+_0x4123ca)[_0xb0ec('0x1b')](_0x132f3a);}return null;};}function patchUpdates(_0x891f1e){return function(_0x340c65){try{jsonpatch[_0xb0ec('0x22')](_0x340c65,_0x891f1e,!![]);}catch(_0x1899be){return BPromise[_0xb0ec('0x23')](_0x1899be);}return _0x340c65[_0xb0ec('0x24')]();};}function saveUpdates(_0x16b3a5,_0x4dd33c){return function(_0x43032d){if(_0x43032d){return _0x43032d[_0xb0ec('0x25')](_0x16b3a5)[_0xb0ec('0x26')](function(_0x549715){return _0x549715;});}return null;};}function removeEntity(_0x5d94a1,_0x4b7067){return function(_0x55095a){if(_0x55095a){return _0x55095a[_0xb0ec('0x27')]()[_0xb0ec('0x26')](function(){_0x5d94a1[_0xb0ec('0x19')](0xcc)[_0xb0ec('0x1a')]();});}};}function handleEntityNotFound(_0x38ab2e,_0x459aca){return function(_0x1092ae){if(!_0x1092ae){_0x38ab2e[_0xb0ec('0x18')](0x194);}return _0x1092ae;};}function handleError(_0x3db35b,_0x445336){_0x445336=_0x445336||0x1f4;return function(_0x3a016a){logger[_0xb0ec('0x28')](_0x3a016a[_0xb0ec('0x29')]);if(_0x3a016a['name']){delete _0x3a016a['name'];}_0x3db35b[_0xb0ec('0x19')](_0x445336)[_0xb0ec('0x2a')](_0x3a016a);};}exports[_0xb0ec('0x2b')]=function(_0x53085a,_0x36e728){var _0x30033f={},_0x1b45fe={},_0x5440d0={'count':0x0,'rows':[]};var _0x5cff39=_[_0xb0ec('0x2c')](db[_0xb0ec('0x2d')][_0xb0ec('0x2e')],function(_0x1f2427){return{'name':_0x1f2427[_0xb0ec('0x2f')],'type':_0x1f2427[_0xb0ec('0x30')][_0xb0ec('0x31')]};});_0x1b45fe[_0xb0ec('0x32')]=_[_0xb0ec('0x2c')](_0x5cff39,_0xb0ec('0x33'));_0x1b45fe['query']=_[_0xb0ec('0x34')](_0x53085a['query']);_0x1b45fe[_0xb0ec('0x35')]=_[_0xb0ec('0x36')](_0x1b45fe[_0xb0ec('0x32')],_0x1b45fe[_0xb0ec('0x37')]);_0x30033f[_0xb0ec('0x38')]=_['intersection'](_0x1b45fe['model'],qs['fields'](_0x53085a[_0xb0ec('0x37')]['fields']));_0x30033f[_0xb0ec('0x38')]=_0x30033f[_0xb0ec('0x38')]['length']?_0x30033f['attributes']:_0x1b45fe[_0xb0ec('0x32')];if(!_0x53085a[_0xb0ec('0x37')][_0xb0ec('0x39')](_0xb0ec('0x3a'))){_0x30033f[_0xb0ec('0x1f')]=qs[_0xb0ec('0x1f')](_0x53085a[_0xb0ec('0x37')][_0xb0ec('0x1f')]);_0x30033f[_0xb0ec('0x1c')]=qs[_0xb0ec('0x1c')](_0x53085a['query'][_0xb0ec('0x1c')]);}_0x30033f[_0xb0ec('0x3b')]=qs[_0xb0ec('0x3c')](_0x53085a[_0xb0ec('0x37')]['sort']);_0x30033f[_0xb0ec('0x3d')]=qs[_0xb0ec('0x35')](_[_0xb0ec('0x3e')](_0x53085a[_0xb0ec('0x37')],_0x1b45fe[_0xb0ec('0x35')]),_0x5cff39);if(_0x53085a[_0xb0ec('0x37')][_0xb0ec('0x3f')]){_0x30033f[_0xb0ec('0x3d')]=_[_0xb0ec('0x40')](_0x30033f[_0xb0ec('0x3d')],{'$or':_['map'](_0x5cff39,function(_0x232ffa){if(_0x232ffa['type']!==_0xb0ec('0x41')){var _0x28cc9b={};_0x28cc9b[_0x232ffa['name']]={'$like':'%'+_0x53085a['query'][_0xb0ec('0x3f')]+'%'};return _0x28cc9b;}})});}_0x30033f=_[_0xb0ec('0x40')]({},_0x30033f,_0x53085a[_0xb0ec('0x42')]);var _0x3e2ac6={'where':_0x30033f[_0xb0ec('0x3d')]};return db['ServicenowAccount'][_0xb0ec('0x1e')](_0x3e2ac6)[_0xb0ec('0x26')](function(_0x4615c2){_0x5440d0[_0xb0ec('0x1e')]=_0x4615c2;if(_0x53085a[_0xb0ec('0x37')]['includeAll']){_0x30033f[_0xb0ec('0x43')]=[{'all':!![]}];}return db[_0xb0ec('0x2d')][_0xb0ec('0x44')](_0x30033f);})['then'](function(_0x42578f){_0x5440d0[_0xb0ec('0x45')]=_0x42578f;return _0x5440d0;})['then'](respondWithFilteredResult(_0x36e728,_0x30033f))[_0xb0ec('0x46')](handleError(_0x36e728,null));};exports['show']=function(_0x280c6f,_0x5e092b){var _0x50d324={'raw':![],'where':{'id':_0x280c6f[_0xb0ec('0x47')]['id']}},_0x3db7ae={};_0x3db7ae[_0xb0ec('0x32')]=_[_0xb0ec('0x34')](db[_0xb0ec('0x2d')][_0xb0ec('0x2e')]);_0x3db7ae[_0xb0ec('0x37')]=_[_0xb0ec('0x34')](_0x280c6f[_0xb0ec('0x37')]);_0x3db7ae[_0xb0ec('0x35')]=_[_0xb0ec('0x36')](_0x3db7ae[_0xb0ec('0x32')],_0x3db7ae[_0xb0ec('0x37')]);_0x50d324['attributes']=_[_0xb0ec('0x36')](_0x3db7ae[_0xb0ec('0x32')],qs[_0xb0ec('0x48')](_0x280c6f[_0xb0ec('0x37')][_0xb0ec('0x48')]));_0x50d324[_0xb0ec('0x38')]=_0x50d324[_0xb0ec('0x38')][_0xb0ec('0x49')]?_0x50d324[_0xb0ec('0x38')]:_0x3db7ae[_0xb0ec('0x32')];if(_0x280c6f['query']['includeAll']){_0x50d324['include']=[{'all':!![]}];}_0x50d324=_[_0xb0ec('0x40')]({},_0x50d324,_0x280c6f[_0xb0ec('0x42')]);return db['ServicenowAccount']['find'](_0x50d324)[_0xb0ec('0x26')](handleEntityNotFound(_0x5e092b,null))[_0xb0ec('0x26')](respondWithResult(_0x5e092b,null))[_0xb0ec('0x46')](handleError(_0x5e092b,null));};exports[_0xb0ec('0x4a')]=function(_0xa73ad5,_0x291c82){return db['ServicenowAccount']['create'](_0xa73ad5[_0xb0ec('0x4b')],{})[_0xb0ec('0x26')](respondWithResult(_0x291c82,0xc9))[_0xb0ec('0x46')](handleError(_0x291c82,null));};exports[_0xb0ec('0x25')]=function(_0x59d7b2,_0x49a92c){if(_0x59d7b2[_0xb0ec('0x4b')]['id']){delete _0x59d7b2['body']['id'];}return db[_0xb0ec('0x2d')]['find']({'where':{'id':_0x59d7b2[_0xb0ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x49a92c,null))['then'](saveUpdates(_0x59d7b2[_0xb0ec('0x4b')],null))[_0xb0ec('0x26')](respondWithResult(_0x49a92c,null))[_0xb0ec('0x46')](handleError(_0x49a92c,null));};exports['destroy']=function(_0x44c637,_0x3f547d){return db['ServicenowAccount'][_0xb0ec('0x4c')]({'where':{'id':_0x44c637['params']['id']}})[_0xb0ec('0x26')](handleEntityNotFound(_0x3f547d,null))['then'](removeEntity(_0x3f547d,null))['catch'](handleError(_0x3f547d,null));};exports[_0xb0ec('0x4d')]=function(_0xea51b1,_0x2bfd22,_0x152377){var _0x238cb8={};var _0xada2ee={};var _0x29dbf7;var _0x257b5b;return db[_0xb0ec('0x2d')][_0xb0ec('0x4e')]({'where':{'id':_0xea51b1[_0xb0ec('0x47')]['id']}})[_0xb0ec('0x26')](handleEntityNotFound(_0x2bfd22,null))[_0xb0ec('0x26')](function(_0x56d4a5){if(_0x56d4a5){_0x29dbf7=_0x56d4a5;_0xada2ee[_0xb0ec('0x32')]=_[_0xb0ec('0x34')](db[_0xb0ec('0x4f')][_0xb0ec('0x2e')]);_0xada2ee[_0xb0ec('0x37')]=_[_0xb0ec('0x34')](_0xea51b1['query']);_0xada2ee[_0xb0ec('0x35')]=_['intersection'](_0xada2ee[_0xb0ec('0x32')],_0xada2ee[_0xb0ec('0x37')]);_0x238cb8['attributes']=_[_0xb0ec('0x36')](_0xada2ee[_0xb0ec('0x32')],qs[_0xb0ec('0x48')](_0xea51b1['query'][_0xb0ec('0x48')]));_0x238cb8[_0xb0ec('0x38')]=_0x238cb8[_0xb0ec('0x38')][_0xb0ec('0x49')]?_0x238cb8[_0xb0ec('0x38')]:_0xada2ee['model'];_0x238cb8[_0xb0ec('0x3b')]=qs['sort'](_0xea51b1[_0xb0ec('0x37')]['sort']);_0x238cb8[_0xb0ec('0x3d')]=qs[_0xb0ec('0x35')](_[_0xb0ec('0x3e')](_0xea51b1[_0xb0ec('0x37')],_0xada2ee[_0xb0ec('0x35')]));if(_0xea51b1['query']['filter']){_0x238cb8[_0xb0ec('0x3d')]=_[_0xb0ec('0x40')](_0x238cb8['where'],{'$or':_[_0xb0ec('0x2c')](_0x238cb8['attributes'],function(_0x430011){var _0x432dce={};_0x432dce[_0x430011]={'$like':'%'+_0xea51b1[_0xb0ec('0x37')][_0xb0ec('0x3f')]+'%'};return _0x432dce;})});}_0x238cb8=_[_0xb0ec('0x40')]({},_0x238cb8,_0xea51b1[_0xb0ec('0x42')]);return _0x29dbf7[_0xb0ec('0x4d')](_0x238cb8);}})[_0xb0ec('0x26')](function(_0x12b646){if(_0x12b646){_0x257b5b=_0x12b646[_0xb0ec('0x49')];if(!_0xea51b1['query']['hasOwnProperty'](_0xb0ec('0x3a'))){_0x238cb8['limit']=qs[_0xb0ec('0x1f')](_0xea51b1['query']['limit']);_0x238cb8[_0xb0ec('0x1c')]=qs[_0xb0ec('0x1c')](_0xea51b1[_0xb0ec('0x37')][_0xb0ec('0x1c')]);}return _0x29dbf7['getConfigurations'](_0x238cb8);}})['then'](function(_0x261ac3){if(_0x261ac3){return _0x261ac3?{'count':_0x257b5b,'rows':_0x261ac3}:null;}})[_0xb0ec('0x26')](respondWithResult(_0x2bfd22,null))[_0xb0ec('0x46')](handleError(_0x2bfd22,null));};exports[_0xb0ec('0x50')]=function(_0x4c155c,_0x1a334d,_0x14068a){if(_0x4c155c[_0xb0ec('0x4b')]['id']){delete _0x4c155c[_0xb0ec('0x4b')]['id'];}return db[_0xb0ec('0x2d')]['findOne']({'where':{'id':_0x4c155c[_0xb0ec('0x47')]['id']}})[_0xb0ec('0x26')](handleEntityNotFound(_0x1a334d,null))[_0xb0ec('0x26')](function(_0xacd5d4){if(_0xacd5d4){_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x51')]=_0xacd5d4['id'];_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x52')]=integrations[_0xb0ec('0x53')](_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x54')],_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x30')]);_0x4c155c[_0xb0ec('0x4b')]['Descriptions']=integrations[_0xb0ec('0x55')](_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x54')],_0x4c155c[_0xb0ec('0x4b')][_0xb0ec('0x30')]);return db[_0xb0ec('0x4f')][_0xb0ec('0x4a')](_0x4c155c[_0xb0ec('0x4b')],{'include':[{'model':db['ServicenowField'],'as':_0xb0ec('0x52')},{'model':db[_0xb0ec('0x56')],'as':_0xb0ec('0x57')}]});}return null;})[_0xb0ec('0x26')](respondWithResult(_0x1a334d,null))[_0xb0ec('0x46')](handleError(_0x1a334d,null));};exports[_0xb0ec('0x58')]=function(_0x4456b5,_0x2f8fa0,_0x592146){var _0x531416=[_0xb0ec('0x59'),_0xb0ec('0x5a'),_0xb0ec('0x5b'),'subcategory',_0xb0ec('0x5c'),_0xb0ec('0x5d'),_0xb0ec('0x5e'),_0xb0ec('0x5f'),'category'];var _0x5a7691=['parent',_0xb0ec('0x59'),_0xb0ec('0x60'),_0xb0ec('0x61'),_0xb0ec('0x62'),'sys_updated_on',_0xb0ec('0x63'),_0xb0ec('0x5a'),'approval_history',_0xb0ec('0x64'),_0xb0ec('0x65'),_0xb0ec('0x66'),'opened_by',_0xb0ec('0x67'),'sys_created_on',_0xb0ec('0x68'),_0xb0ec('0x69'),_0xb0ec('0x6a'),_0xb0ec('0x5b'),_0xb0ec('0x3b'),'calendar_stc','closed_at',_0xb0ec('0x6b'),'delivery_plan',_0xb0ec('0x6c'),_0xb0ec('0x6d'),_0xb0ec('0x6e'),'business_service','priority',_0xb0ec('0x6f'),_0xb0ec('0x70'),_0xb0ec('0x71'),_0xb0ec('0x72'),'opened_at',_0xb0ec('0x73'),_0xb0ec('0x74'),_0xb0ec('0x75'),_0xb0ec('0x76'),_0xb0ec('0x77'),'caller_id','approval_set','subcategory',_0xb0ec('0x78'),'short_description','close_code',_0xb0ec('0x79'),_0xb0ec('0x7a'),_0xb0ec('0x7b'),_0xb0ec('0x7c'),_0xb0ec('0x7d'),_0xb0ec('0x7e'),'description',_0xb0ec('0x7f'),_0xb0ec('0x5d'),_0xb0ec('0x80'),_0xb0ec('0x81'),_0xb0ec('0x82'),_0xb0ec('0x83'),_0xb0ec('0x84'),_0xb0ec('0x85'),_0xb0ec('0x86'),_0xb0ec('0x87'),_0xb0ec('0x5e'),'urgency',_0xb0ec('0x88'),_0xb0ec('0x89'),_0xb0ec('0x8a'),_0xb0ec('0x8b'),'assigned_to',_0xb0ec('0x5f'),_0xb0ec('0x8c'),_0xb0ec('0x8d'),_0xb0ec('0x8e'),'comments_and_work_notes',_0xb0ec('0x8f'),_0xb0ec('0x90'),_0xb0ec('0x91'),'sys_tags',_0xb0ec('0x92'),'upon_approval',_0xb0ec('0x93'),_0xb0ec('0x94'),_0xb0ec('0x95')];var _0x5ae325='';var _0x90a5c7='';var _0x1ee70c=[];var _0x1db06d='';var _0x2bc76e='';var _0x44f669=[];var _0xd2abcc='';var _0x25f2a5='';var _0xb3b77a={};var _0x428562='';return db[_0xb0ec('0x2d')][_0xb0ec('0x4e')]({'where':{'id':_0x4456b5['params']['id']},'attributes':['id',_0xb0ec('0x96'),'password','email',_0xb0ec('0x97'),_0xb0ec('0x98')]})[_0xb0ec('0x26')](handleEntityNotFound(_0x2f8fa0,null))[_0xb0ec('0x26')](function(_0x117805){if(_0x117805){_0x428562=_0x117805[_0xb0ec('0x97')];var _0x2efade=_0x428562[_0xb0ec('0x99')](-0x1);if(_0x2efade==='/'){_0x428562=_0x428562[_0xb0ec('0x9a')](0x0,_0x428562['lastIndexOf'](_0x2efade));}_0x25f2a5=util[_0xb0ec('0x9b')](_0xb0ec('0x9c'),_0x428562);_0xd2abcc=util[_0xb0ec('0x9b')]('%s/api/now/table/',_0x428562);_0xb3b77a={'user':_0x117805[_0xb0ec('0x96')],'pass':_0x117805[_0xb0ec('0x9d')]};var _0x15ac5a={'method':_0xb0ec('0x9e'),'uri':_0x25f2a5+'incident?sysparm_display_value=all','auth':_0xb3b77a,'json':!![]};return rp(_0x15ac5a);}})[_0xb0ec('0x26')](function(_0x469506){if(_0x469506[_0xb0ec('0x9f')][_0xb0ec('0x49')]>0x0){_0x5ae325=_0x469506[_0xb0ec('0x9f')];}console[_0xb0ec('0xa0')](_0xb0ec('0xa1'),_0x5ae325);_0x44f669=[];_0x90a5c7=Object['assign']([],_0x5ae325);_[_0xb0ec('0xa2')](_0x90a5c7,function(_0x1aece2){return!_0x531416[_0xb0ec('0xa3')](_0x1aece2[_0xb0ec('0x33')]);});_0x90a5c7[_0xb0ec('0xa4')](function(_0x3d2339){var _0x2e9e33=createFieldObject(_0xd2abcc,_0xb3b77a,_0x3d2339[_0xb0ec('0xa5')],_0x3d2339[_0xb0ec('0x33')],_0x3d2339[_0xb0ec('0xa6')],![]);_0x44f669['push'](_0x2e9e33);});return Promise[_0xb0ec('0xa7')](_0x44f669);})[_0xb0ec('0x26')](function(_0x4d4529){_0x1ee70c=_0x4d4529;_0x1db06d=Object[_0xb0ec('0xa8')]([],_0x5ae325);console[_0xb0ec('0xa0')]('TCL:\x20_object',_0x5ae325);_[_0xb0ec('0xa2')](_0x1db06d,function(_0x10487d){return _0x5a7691[_0xb0ec('0xa3')](_0x10487d[_0xb0ec('0x33')]);});console[_0xb0ec('0xa0')](_0xb0ec('0xa9'),_0x1db06d);_0x44f669=[];_0x1db06d[_0xb0ec('0xa4')](function(_0xefda16){var _0x339d7c=createFieldObject(_0xd2abcc,_0xb3b77a,_0xefda16[_0xb0ec('0xa5')],_0xefda16[_0xb0ec('0x33')],_0xefda16['label'],!![]);_0x44f669['push'](_0x339d7c);});return Promise[_0xb0ec('0xa7')](_0x44f669);})['then'](function(_0x175190){_0x2bc76e=_0x175190;var _0x12963e=_0x1ee70c[_0xb0ec('0xaa')](_0x2bc76e);return{'count':_0x12963e[_0xb0ec('0x49')],'rows':_0x12963e};})[_0xb0ec('0x26')](respondWithResult(_0x2f8fa0,null))[_0xb0ec('0x46')](function(_0x29bb26){console[_0xb0ec('0xa0')](_0xb0ec('0xab')+_0x29bb26);var _0x2d3a48=_0x4456b5[_0xb0ec('0x37')][_0xb0ec('0xac')]?0x1f4:_0x29bb26[_0xb0ec('0xad')]||0x1f4;logger['error'](_0x29bb26[_0xb0ec('0x29')]);delete _0x29bb26[_0xb0ec('0x33')];if(_0x2d3a48===0x191){_0x2d3a48=0x190;}_0x2f8fa0[_0xb0ec('0x19')](_0x2d3a48)[_0xb0ec('0x2a')](_0x4456b5[_0xb0ec('0x37')][_0xb0ec('0xac')]?{'message':_0xb0ec('0xae'),'statusCode':_0x29bb26[_0xb0ec('0xad')]}:_0x29bb26);});};function createFieldObject(_0x30c6c8,_0x3bf785,_0x3e710e,_0x365d1f,_0x25f353,_0x35e66e){return new Promise(function(_0x37d501,_0x52d70b){var _0x4af571={'id':_0x365d1f,'name':_0x25f353,'custom':_0x35e66e};if(_0x3e710e==='boolean'){_0x4af571[_0xb0ec('0x42')]=[{'name':_0xb0ec('0xaf'),'value':'true'},{'name':'False','value':_0xb0ec('0xb0')}];_0x37d501(_0x4af571);}else{var _0x28928b={'method':'GET','uri':_0x30c6c8+_0xb0ec('0xb1')+_0x365d1f,'auth':_0x3bf785,'json':!![]};return rp(_0x28928b)[_0xb0ec('0x26')](function(_0x135c2e){var _0x3681e8=[];if(_0x135c2e['result'][_0xb0ec('0x49')]>0x0){_0x135c2e[_0xb0ec('0x9f')][_0xb0ec('0xa4')](function(_0x55459e){if(_0x55459e['inactive']==='false'){var _0x77b710={'name':_0x55459e[_0xb0ec('0xa6')],'value':_0x55459e['value']};_0x3681e8[_0xb0ec('0xb2')](_0x77b710);}});}_0x4af571['options']=_0x3681e8;if(_0x4af571[_0xb0ec('0x42')]['length']>0x0){_0x37d501(_0x4af571);}else{if(_0x35e66e==![]){_0x37d501();}else{_0x37d501(_0x4af571);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d353e05..5f64ca4 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 _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0x1883,0xab));var _0x3188=function(_0x2cba8d,_0x1fdc8c){_0x2cba8d=_0x2cba8d-0x0;var _0x38bdd3=_0x1883[_0x2cba8d];return _0x38bdd3;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5896d5,_0x1f4855){var _0x3d290d=function(_0x5b5146){while(--_0x5b5146){_0x5896d5['push'](_0x5896d5['shift']());}};_0x3d290d(++_0x1f4855);}(_0x4975,0x86));var _0x5497=function(_0x3c31e7,_0x2bd2c7){_0x3c31e7=_0x3c31e7-0x0;var _0x9c0f05=_0x4975[_0x3c31e7];return _0x9c0f05;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 99624e3..52eba06 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 _0xd928=['include','model','map','ShowServicenowAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes'];(function(_0x4653d2,_0x16d946){var _0x10d4f8=function(_0x2b3ac8){while(--_0x2b3ac8){_0x4653d2['push'](_0x4653d2['shift']());}};_0x10d4f8(++_0x16d946);}(_0xd928,0x170));var _0x8d92=function(_0x1a3d9d,_0x550c17){_0x1a3d9d=_0x1a3d9d-0x0;var _0x2c3611=_0xd928[_0x1a3d9d];return _0x2c3611;};'use strict';var _=require(_0x8d92('0x0'));var util=require(_0x8d92('0x1'));var moment=require(_0x8d92('0x2'));var BPromise=require('bluebird');var rs=require(_0x8d92('0x3'));var fs=require('fs');var Redis=require(_0x8d92('0x4'));var db=require(_0x8d92('0x5'))['db'];var utils=require(_0x8d92('0x6'));var logger=require(_0x8d92('0x7'))('rpc');var config=require(_0x8d92('0x8'));var jayson=require(_0x8d92('0x9'));var client=jayson[_0x8d92('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb85118,_0x41485f,_0x327608){return new BPromise(function(_0x5001ae,_0x578ae3){return client['request'](_0xb85118,_0x327608)[_0x8d92('0xb')](function(_0x52a35f){logger[_0x8d92('0xc')](_0x8d92('0xd'),_0x41485f,_0x8d92('0xe'));logger[_0x8d92('0xf')](_0x8d92('0x10'),_0x41485f,_0x8d92('0xe'),JSON[_0x8d92('0x11')](_0x52a35f));if(_0x52a35f[_0x8d92('0x12')]){if(_0x52a35f['error']['code']===0x1f4){logger[_0x8d92('0x12')](_0x8d92('0xd'),_0x41485f,_0x52a35f[_0x8d92('0x12')][_0x8d92('0x13')]);return _0x578ae3(_0x52a35f[_0x8d92('0x12')][_0x8d92('0x13')]);}logger[_0x8d92('0x12')](_0x8d92('0xd'),_0x41485f,_0x52a35f[_0x8d92('0x12')]['message']);return _0x5001ae(_0x52a35f[_0x8d92('0x12')][_0x8d92('0x13')]);}else{logger[_0x8d92('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x41485f,'request\x20sent');_0x5001ae(_0x52a35f['result'][_0x8d92('0x13')]);}})[_0x8d92('0x14')](function(_0x1c1476){logger[_0x8d92('0x12')](_0x8d92('0xd'),_0x41485f,_0x1c1476);_0x578ae3(_0x1c1476);});});}exports[_0x8d92('0x15')]=function(_0x5f5c15){var _0x57e2a6=this;return new Promise(function(_0x306e62,_0x4dea99){return db[_0x8d92('0x16')][_0x8d92('0x17')]({'raw':_0x5f5c15[_0x8d92('0x18')]?_0x5f5c15[_0x8d92('0x18')][_0x8d92('0x19')]===undefined?!![]:![]:!![],'where':_0x5f5c15[_0x8d92('0x18')]?_0x5f5c15[_0x8d92('0x18')][_0x8d92('0x1a')]||null:null,'attributes':_0x5f5c15['options']?_0x5f5c15['options'][_0x8d92('0x1b')]||null:null,'limit':_0x5f5c15[_0x8d92('0x18')]?_0x5f5c15['options']['limit']||null:null,'include':_0x5f5c15[_0x8d92('0x18')]?_0x5f5c15[_0x8d92('0x18')][_0x8d92('0x1c')]?_['map'](_0x5f5c15[_0x8d92('0x18')][_0x8d92('0x1c')],function(_0x190ea2){return{'model':db[_0x190ea2[_0x8d92('0x1d')]],'as':_0x190ea2['as'],'attributes':_0x190ea2[_0x8d92('0x1b')],'include':_0x190ea2[_0x8d92('0x1c')]?_[_0x8d92('0x1e')](_0x190ea2[_0x8d92('0x1c')],function(_0x369ad3){return{'model':db[_0x369ad3[_0x8d92('0x1d')]],'as':_0x369ad3['as'],'attributes':_0x369ad3[_0x8d92('0x1b')],'include':_0x369ad3[_0x8d92('0x1c')]?_[_0x8d92('0x1e')](_0x369ad3[_0x8d92('0x1c')],function(_0xfc8c46){return{'model':db[_0xfc8c46[_0x8d92('0x1d')]],'as':_0xfc8c46['as'],'attributes':_0xfc8c46[_0x8d92('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8d92('0xb')](function(_0x412d10){logger[_0x8d92('0xc')]('GetServicenowAccount',_0x5f5c15);logger['debug'](_0x8d92('0x15'),_0x5f5c15,JSON['stringify'](_0x412d10));_0x306e62(_0x412d10);})[_0x8d92('0x14')](function(_0x5c9186){logger[_0x8d92('0x12')](_0x8d92('0x15'),_0x5c9186[_0x8d92('0x13')],_0x5f5c15);_0x4dea99(_0x57e2a6[_0x8d92('0x12')](0x1f4,_0x5c9186[_0x8d92('0x13')]));});});};exports[_0x8d92('0x1f')]=function(_0x39b2a1){var _0x571520=this;return new Promise(function(_0x19940a,_0x2d3a21){return db[_0x8d92('0x16')][_0x8d92('0x20')]({'raw':_0x39b2a1['options']?_0x39b2a1['options']['raw']===undefined?!![]:![]:!![],'where':_0x39b2a1['options']?_0x39b2a1[_0x8d92('0x18')][_0x8d92('0x1a')]||null:null,'attributes':_0x39b2a1[_0x8d92('0x18')]?_0x39b2a1['options'][_0x8d92('0x1b')]||null:null,'include':_0x39b2a1[_0x8d92('0x18')]?_0x39b2a1[_0x8d92('0x18')][_0x8d92('0x1c')]?_['map'](_0x39b2a1[_0x8d92('0x18')][_0x8d92('0x1c')],function(_0x18860a){return{'model':db[_0x18860a[_0x8d92('0x1d')]],'as':_0x18860a['as'],'attributes':_0x18860a[_0x8d92('0x1b')],'include':_0x18860a[_0x8d92('0x1c')]?_[_0x8d92('0x1e')](_0x18860a[_0x8d92('0x1c')],function(_0x14af33){return{'model':db[_0x14af33[_0x8d92('0x1d')]],'as':_0x14af33['as'],'attributes':_0x14af33[_0x8d92('0x1b')],'include':_0x14af33[_0x8d92('0x1c')]?_[_0x8d92('0x1e')](_0x14af33[_0x8d92('0x1c')],function(_0x225eb3){return{'model':db[_0x225eb3['model']],'as':_0x225eb3['as'],'attributes':_0x225eb3[_0x8d92('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8d92('0xb')](function(_0x5bc59e){logger[_0x8d92('0xc')]('ShowServicenowAccount',_0x39b2a1);logger[_0x8d92('0xf')](_0x8d92('0x1f'),_0x39b2a1,JSON[_0x8d92('0x11')](_0x5bc59e));_0x19940a(_0x5bc59e);})[_0x8d92('0x14')](function(_0x269f7f){logger[_0x8d92('0x12')]('ShowServicenowAccount',_0x269f7f[_0x8d92('0x13')],_0x39b2a1);_0x2d3a21(_0x571520['error'](0x1f4,_0x269f7f['message']));});});}; \ No newline at end of file +var _0xe16f=['map','model','stringify','ShowServicenowAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetServicenowAccount','options','raw','where','attributes','limit','include'];(function(_0x2380f5,_0x4efb14){var _0x29a9c0=function(_0x33b472){while(--_0x33b472){_0x2380f5['push'](_0x2380f5['shift']());}};_0x29a9c0(++_0x4efb14);}(_0xe16f,0x9f));var _0xfe16=function(_0x2eca73,_0x3ab4b0){_0x2eca73=_0x2eca73-0x0;var _0x186349=_0xe16f[_0x2eca73];return _0x186349;};'use strict';var _=require('lodash');var util=require(_0xfe16('0x0'));var moment=require(_0xfe16('0x1'));var BPromise=require(_0xfe16('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe16('0x3'));var db=require(_0xfe16('0x4'))['db'];var utils=require(_0xfe16('0x5'));var logger=require('../../config/logger')(_0xfe16('0x6'));var config=require(_0xfe16('0x7'));var jayson=require(_0xfe16('0x8'));var client=jayson[_0xfe16('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f88d,_0x28d121,_0x5b503c){return new BPromise(function(_0x8109a2,_0x1ba1b0){return client[_0xfe16('0xa')](_0x35f88d,_0x5b503c)[_0xfe16('0xb')](function(_0x5f09a5){logger[_0xfe16('0xc')](_0xfe16('0xd'),_0x28d121,'request\x20sent');logger[_0xfe16('0xe')](_0xfe16('0xf'),_0x28d121,_0xfe16('0x10'),JSON['stringify'](_0x5f09a5));if(_0x5f09a5['error']){if(_0x5f09a5[_0xfe16('0x11')]['code']===0x1f4){logger[_0xfe16('0x11')](_0xfe16('0xd'),_0x28d121,_0x5f09a5[_0xfe16('0x11')]['message']);return _0x1ba1b0(_0x5f09a5['error']['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x28d121,_0x5f09a5[_0xfe16('0x11')][_0xfe16('0x12')]);return _0x8109a2(_0x5f09a5[_0xfe16('0x11')][_0xfe16('0x12')]);}else{logger[_0xfe16('0xc')](_0xfe16('0xd'),_0x28d121,_0xfe16('0x10'));_0x8109a2(_0x5f09a5['result'][_0xfe16('0x12')]);}})[_0xfe16('0x13')](function(_0x41d52b){logger[_0xfe16('0x11')](_0xfe16('0xd'),_0x28d121,_0x41d52b);_0x1ba1b0(_0x41d52b);});});}exports[_0xfe16('0x14')]=function(_0x692303){var _0x5bfeb7=this;return new Promise(function(_0xc5ff40,_0x4590d1){return db['ServicenowAccount']['findAll']({'raw':_0x692303[_0xfe16('0x15')]?_0x692303[_0xfe16('0x15')][_0xfe16('0x16')]===undefined?!![]:![]:!![],'where':_0x692303['options']?_0x692303[_0xfe16('0x15')][_0xfe16('0x17')]||null:null,'attributes':_0x692303['options']?_0x692303[_0xfe16('0x15')][_0xfe16('0x18')]||null:null,'limit':_0x692303[_0xfe16('0x15')]?_0x692303[_0xfe16('0x15')][_0xfe16('0x19')]||null:null,'include':_0x692303[_0xfe16('0x15')]?_0x692303[_0xfe16('0x15')][_0xfe16('0x1a')]?_[_0xfe16('0x1b')](_0x692303[_0xfe16('0x15')]['include'],function(_0x12e69d){return{'model':db[_0x12e69d['model']],'as':_0x12e69d['as'],'attributes':_0x12e69d[_0xfe16('0x18')],'include':_0x12e69d[_0xfe16('0x1a')]?_[_0xfe16('0x1b')](_0x12e69d[_0xfe16('0x1a')],function(_0x1f9316){return{'model':db[_0x1f9316[_0xfe16('0x1c')]],'as':_0x1f9316['as'],'attributes':_0x1f9316[_0xfe16('0x18')],'include':_0x1f9316[_0xfe16('0x1a')]?_[_0xfe16('0x1b')](_0x1f9316[_0xfe16('0x1a')],function(_0x319654){return{'model':db[_0x319654[_0xfe16('0x1c')]],'as':_0x319654['as'],'attributes':_0x319654[_0xfe16('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfe16('0xb')](function(_0x441d3a){logger['info'](_0xfe16('0x14'),_0x692303);logger[_0xfe16('0xe')](_0xfe16('0x14'),_0x692303,JSON[_0xfe16('0x1d')](_0x441d3a));_0xc5ff40(_0x441d3a);})[_0xfe16('0x13')](function(_0x36aa39){logger[_0xfe16('0x11')](_0xfe16('0x14'),_0x36aa39['message'],_0x692303);_0x4590d1(_0x5bfeb7[_0xfe16('0x11')](0x1f4,_0x36aa39['message']));});});};exports[_0xfe16('0x1e')]=function(_0x39d66f){var _0x4c915e=this;return new Promise(function(_0x13497b,_0x662df9){return db['ServicenowAccount']['find']({'raw':_0x39d66f[_0xfe16('0x15')]?_0x39d66f[_0xfe16('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x39d66f[_0xfe16('0x15')]?_0x39d66f[_0xfe16('0x15')][_0xfe16('0x17')]||null:null,'attributes':_0x39d66f[_0xfe16('0x15')]?_0x39d66f[_0xfe16('0x15')]['attributes']||null:null,'include':_0x39d66f[_0xfe16('0x15')]?_0x39d66f[_0xfe16('0x15')][_0xfe16('0x1a')]?_[_0xfe16('0x1b')](_0x39d66f[_0xfe16('0x15')][_0xfe16('0x1a')],function(_0x5de257){return{'model':db[_0x5de257[_0xfe16('0x1c')]],'as':_0x5de257['as'],'attributes':_0x5de257[_0xfe16('0x18')],'include':_0x5de257[_0xfe16('0x1a')]?_['map'](_0x5de257[_0xfe16('0x1a')],function(_0x338e2f){return{'model':db[_0x338e2f['model']],'as':_0x338e2f['as'],'attributes':_0x338e2f[_0xfe16('0x18')],'include':_0x338e2f[_0xfe16('0x1a')]?_[_0xfe16('0x1b')](_0x338e2f['include'],function(_0xe7186c){return{'model':db[_0xe7186c['model']],'as':_0xe7186c['as'],'attributes':_0xe7186c[_0xfe16('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfe16('0xb')](function(_0x1dc263){logger[_0xfe16('0xc')]('ShowServicenowAccount',_0x39d66f);logger[_0xfe16('0xe')](_0xfe16('0x1e'),_0x39d66f,JSON[_0xfe16('0x1d')](_0x1dc263));_0x13497b(_0x1dc263);})[_0xfe16('0x13')](function(_0xe79db4){logger[_0xfe16('0x11')](_0xfe16('0x1e'),_0xe79db4[_0xfe16('0x12')],_0x39d66f);_0x662df9(_0x4c915e[_0xfe16('0x11')](0x1f4,_0xe79db4['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 6e86c6a..d7aed8a 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 _0x4083=['getSubjects','getDescriptions','post','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x5ed3c3,_0x2e4ab7){var _0x4a9723=function(_0x15e9b7){while(--_0x15e9b7){_0x5ed3c3['push'](_0x5ed3c3['shift']());}};_0x4a9723(++_0x2e4ab7);}(_0x4083,0x1d3));var _0x3408=function(_0x3a3de4,_0x3c5e94){_0x3a3de4=_0x3a3de4-0x0;var _0x43df82=_0x4083[_0x3a3de4];return _0x43df82;};'use strict';var multer=require(_0x3408('0x0'));var util=require(_0x3408('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3408('0x2'));var router=express[_0x3408('0x3')]();var fs_extra=require(_0x3408('0x4'));var auth=require(_0x3408('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3408('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x3408('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3408('0x7')](_0x3408('0x8'),auth[_0x3408('0x9')](),controller[_0x3408('0xa')]);router[_0x3408('0x7')]('/:id/fields',auth[_0x3408('0x9')](),controller[_0x3408('0xb')]);router['get'](_0x3408('0xc'),auth[_0x3408('0x9')](),controller[_0x3408('0xd')]);router[_0x3408('0x7')]('/:id/descriptions',auth[_0x3408('0x9')](),controller[_0x3408('0xe')]);router[_0x3408('0xf')]('/',auth[_0x3408('0x9')](),controller['create']);router[_0x3408('0x10')](_0x3408('0x8'),auth[_0x3408('0x9')](),controller[_0x3408('0x11')]);router['delete'](_0x3408('0x8'),auth[_0x3408('0x9')](),controller[_0x3408('0x12')]);module[_0x3408('0x13')]=router; \ No newline at end of file +var _0x386d=['getSubjects','/:id/descriptions','create','put','/:id','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','isAuthenticated','show','/:id/fields','getFields'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x386d,0x134));var _0xd386=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x386d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd386('0x0'));var timeout=require(_0xd386('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd386('0x2'));var interaction=require(_0xd386('0x3'));var config=require(_0xd386('0x4'));var controller=require(_0xd386('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd386('0x6')]);router[_0xd386('0x7')]('/:id',auth[_0xd386('0x8')](),controller[_0xd386('0x9')]);router[_0xd386('0x7')](_0xd386('0xa'),auth[_0xd386('0x8')](),controller[_0xd386('0xb')]);router[_0xd386('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd386('0xc')]);router['get'](_0xd386('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xd386('0x8')](),controller[_0xd386('0xe')]);router[_0xd386('0xf')](_0xd386('0x10'),auth[_0xd386('0x8')](),controller[_0xd386('0x11')]);router['delete']('/:id',auth[_0xd386('0x8')](),controller[_0xd386('0x12')]);module[_0xd386('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index feaed48..5291a31 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 _0xe803=['sequelize','STRING'];(function(_0x2b07a1,_0x40a926){var _0x43a5e3=function(_0x193d23){while(--_0x193d23){_0x2b07a1['push'](_0x2b07a1['shift']());}};_0x43a5e3(++_0x40a926);}(_0xe803,0xfe));var _0x3e80=function(_0x111bb3,_0x39214c){_0x111bb3=_0x111bb3-0x0;var _0x2e5004=_0xe803[_0x111bb3];return _0x2e5004;};'use strict';var Sequelize=require(_0x3e80('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e80('0x1')]},'description':{'type':Sequelize[_0x3e80('0x1')]}}; \ No newline at end of file +var _0x870a=['STRING'];(function(_0x348f89,_0x1a5481){var _0x81b09e=function(_0x376566){while(--_0x376566){_0x348f89['push'](_0x348f89['shift']());}};_0x81b09e(++_0x1a5481);}(_0x870a,0x1a2));var _0xa870=function(_0x46c598,_0x80f32){_0x46c598=_0x46c598-0x0;var _0x35db2d=_0x870a[_0x46c598];return _0x35db2d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa870('0x0')]},'description':{'type':Sequelize[_0xa870('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f8197a6..d924b15 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 _0x9501=['count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','find','create','body','params','getFields','ServicenowField','rawAttributes','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset'];(function(_0x551b15,_0x34f4ff){var _0x5cff35=function(_0x31829e){while(--_0x31829e){_0x551b15['push'](_0x551b15['shift']());}};_0x5cff35(++_0x34f4ff);}(_0x9501,0x1bb));var _0x1950=function(_0x28264e,_0x12b7ff){_0x28264e=_0x28264e-0x0;var _0x13ade3=_0x9501[_0x28264e];return _0x13ade3;};'use strict';var emlformat=require(_0x1950('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1950('0x1'));var jsonpatch=require(_0x1950('0x2'));var rp=require('request-promise');var moment=require(_0x1950('0x3'));var BPromise=require(_0x1950('0x4'));var Mustache=require(_0x1950('0x5'));var util=require(_0x1950('0x6'));var path=require('path');var sox=require(_0x1950('0x7'));var csv=require(_0x1950('0x8'));var ejs=require(_0x1950('0x9'));var fs=require('fs');var fs_extra=require(_0x1950('0xa'));var _=require(_0x1950('0xb'));var squel=require(_0x1950('0xc'));var crypto=require(_0x1950('0xd'));var jsforce=require(_0x1950('0xe'));var deskjs=require(_0x1950('0xf'));var toCsv=require(_0x1950('0x8'));var querystring=require(_0x1950('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1950('0x11'));var logger=require(_0x1950('0x12'))(_0x1950('0x13'));var utils=require(_0x1950('0x14'));var config=require(_0x1950('0x15'));var licenseUtil=require(_0x1950('0x16'));var db=require(_0x1950('0x17'))['db'];function respondWithStatusCode(_0x57fbd8,_0x300d86){_0x300d86=_0x300d86||0xcc;return function(_0x33b22c){if(_0x33b22c){return _0x57fbd8[_0x1950('0x18')](_0x300d86);}return _0x57fbd8[_0x1950('0x19')](_0x300d86)[_0x1950('0x1a')]();};}function respondWithResult(_0x20f1b5,_0x1191e8){_0x1191e8=_0x1191e8||0xc8;return function(_0x51bd65){if(_0x51bd65){return _0x20f1b5[_0x1950('0x19')](_0x1191e8)[_0x1950('0x1b')](_0x51bd65);}};}function respondWithFilteredResult(_0x56df75,_0x26f7d1){return function(_0x3972ef){if(_0x3972ef){var _0x43bc47=typeof _0x26f7d1['offset']===_0x1950('0x1c')&&typeof _0x26f7d1[_0x1950('0x1d')]==='undefined';var _0x4820cb=_0x3972ef['count'];var _0xbb38f=_0x43bc47?0x0:_0x26f7d1[_0x1950('0x1e')];var _0x50e13d=_0x43bc47?_0x3972ef[_0x1950('0x1f')]:_0x26f7d1['offset']+_0x26f7d1[_0x1950('0x1d')];var _0x4b19b2;if(_0x50e13d>=_0x4820cb){_0x50e13d=_0x4820cb;_0x4b19b2=0xc8;}else{_0x4b19b2=0xce;}_0x56df75['status'](_0x4b19b2);return _0x56df75[_0x1950('0x20')](_0x1950('0x21'),_0xbb38f+'-'+_0x50e13d+'/'+_0x4820cb)[_0x1950('0x1b')](_0x3972ef);}return null;};}function patchUpdates(_0x4e1324){return function(_0x42c443){try{jsonpatch['apply'](_0x42c443,_0x4e1324,!![]);}catch(_0x2ef830){return BPromise[_0x1950('0x22')](_0x2ef830);}return _0x42c443[_0x1950('0x23')]();};}function saveUpdates(_0x16d64c,_0x595d6b){return function(_0x4d4c05){if(_0x4d4c05){return _0x4d4c05[_0x1950('0x24')](_0x16d64c)[_0x1950('0x25')](function(_0x14295c){return _0x14295c;});}return null;};}function removeEntity(_0x217fff,_0x3d39da){return function(_0x298935){if(_0x298935){return _0x298935[_0x1950('0x26')]()[_0x1950('0x25')](function(){_0x217fff[_0x1950('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2398b3,_0x4aa1b5){return function(_0xc8795f){if(!_0xc8795f){_0x2398b3[_0x1950('0x18')](0x194);}return _0xc8795f;};}function handleError(_0x2298a4,_0x5152cb){_0x5152cb=_0x5152cb||0x1f4;return function(_0x1e0cc2){logger[_0x1950('0x27')](_0x1e0cc2['stack']);if(_0x1e0cc2[_0x1950('0x28')]){delete _0x1e0cc2[_0x1950('0x28')];}_0x2298a4[_0x1950('0x19')](_0x5152cb)['send'](_0x1e0cc2);};}exports[_0x1950('0x29')]=function(_0x8f53fa,_0xe9bde3){var _0x2e2104={},_0x199c2f={},_0x33216b={'count':0x0,'rows':[]};var _0x693659=_[_0x1950('0x2a')](db[_0x1950('0x2b')]['rawAttributes'],function(_0x2666a7){return{'name':_0x2666a7[_0x1950('0x2c')],'type':_0x2666a7[_0x1950('0x2d')][_0x1950('0x2e')]};});_0x199c2f[_0x1950('0x2f')]=_[_0x1950('0x2a')](_0x693659,_0x1950('0x28'));_0x199c2f[_0x1950('0x30')]=_[_0x1950('0x31')](_0x8f53fa['query']);_0x199c2f[_0x1950('0x32')]=_[_0x1950('0x33')](_0x199c2f[_0x1950('0x2f')],_0x199c2f[_0x1950('0x30')]);_0x2e2104['attributes']=_[_0x1950('0x33')](_0x199c2f[_0x1950('0x2f')],qs[_0x1950('0x34')](_0x8f53fa[_0x1950('0x30')][_0x1950('0x34')]));_0x2e2104[_0x1950('0x35')]=_0x2e2104[_0x1950('0x35')][_0x1950('0x36')]?_0x2e2104['attributes']:_0x199c2f[_0x1950('0x2f')];if(!_0x8f53fa['query'][_0x1950('0x37')](_0x1950('0x38'))){_0x2e2104[_0x1950('0x1d')]=qs[_0x1950('0x1d')](_0x8f53fa[_0x1950('0x30')][_0x1950('0x1d')]);_0x2e2104[_0x1950('0x1e')]=qs['offset'](_0x8f53fa['query'][_0x1950('0x1e')]);}_0x2e2104[_0x1950('0x39')]=qs[_0x1950('0x3a')](_0x8f53fa[_0x1950('0x30')][_0x1950('0x3a')]);_0x2e2104[_0x1950('0x3b')]=qs[_0x1950('0x32')](_[_0x1950('0x3c')](_0x8f53fa['query'],_0x199c2f[_0x1950('0x32')]),_0x693659);if(_0x8f53fa[_0x1950('0x30')]['filter']){_0x2e2104['where']=_[_0x1950('0x3d')](_0x2e2104[_0x1950('0x3b')],{'$or':_[_0x1950('0x2a')](_0x693659,function(_0x40ee4a){if(_0x40ee4a[_0x1950('0x2d')]!==_0x1950('0x3e')){var _0x3bc4f5={};_0x3bc4f5[_0x40ee4a[_0x1950('0x28')]]={'$like':'%'+_0x8f53fa[_0x1950('0x30')][_0x1950('0x3f')]+'%'};return _0x3bc4f5;}})});}_0x2e2104=_[_0x1950('0x3d')]({},_0x2e2104,_0x8f53fa[_0x1950('0x40')]);var _0x55e425={'where':_0x2e2104[_0x1950('0x3b')]};return db[_0x1950('0x2b')][_0x1950('0x1f')](_0x55e425)[_0x1950('0x25')](function(_0x210ee5){_0x33216b['count']=_0x210ee5;if(_0x8f53fa[_0x1950('0x30')][_0x1950('0x41')]){_0x2e2104[_0x1950('0x42')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x2e2104);})[_0x1950('0x25')](function(_0x46718f){_0x33216b[_0x1950('0x43')]=_0x46718f;return _0x33216b;})[_0x1950('0x25')](respondWithFilteredResult(_0xe9bde3,_0x2e2104))[_0x1950('0x44')](handleError(_0xe9bde3,null));};exports['show']=function(_0x444ec0,_0x2a42c4){var _0x519883={'raw':![],'where':{'id':_0x444ec0['params']['id']}},_0x1a0533={};_0x1a0533[_0x1950('0x2f')]=_[_0x1950('0x31')](db[_0x1950('0x2b')]['rawAttributes']);_0x1a0533[_0x1950('0x30')]=_['keys'](_0x444ec0['query']);_0x1a0533[_0x1950('0x32')]=_[_0x1950('0x33')](_0x1a0533['model'],_0x1a0533['query']);_0x519883[_0x1950('0x35')]=_[_0x1950('0x33')](_0x1a0533[_0x1950('0x2f')],qs[_0x1950('0x34')](_0x444ec0[_0x1950('0x30')]['fields']));_0x519883[_0x1950('0x35')]=_0x519883[_0x1950('0x35')][_0x1950('0x36')]?_0x519883['attributes']:_0x1a0533['model'];if(_0x444ec0[_0x1950('0x30')]['includeAll']){_0x519883[_0x1950('0x42')]=[{'all':!![]}];}_0x519883=_['merge']({},_0x519883,_0x444ec0[_0x1950('0x40')]);return db[_0x1950('0x2b')][_0x1950('0x45')](_0x519883)[_0x1950('0x25')](handleEntityNotFound(_0x2a42c4,null))[_0x1950('0x25')](respondWithResult(_0x2a42c4,null))[_0x1950('0x44')](handleError(_0x2a42c4,null));};exports[_0x1950('0x46')]=function(_0x2c284e,_0x4f4681){return db['ServicenowConfiguration'][_0x1950('0x46')](_0x2c284e[_0x1950('0x47')],{})['then'](respondWithResult(_0x4f4681,0xc9))[_0x1950('0x44')](handleError(_0x4f4681,null));};exports[_0x1950('0x24')]=function(_0x4cacaf,_0xe0bdf6){if(_0x4cacaf[_0x1950('0x47')]['id']){delete _0x4cacaf['body']['id'];}return db[_0x1950('0x2b')][_0x1950('0x45')]({'where':{'id':_0x4cacaf[_0x1950('0x48')]['id']}})[_0x1950('0x25')](handleEntityNotFound(_0xe0bdf6,null))[_0x1950('0x25')](saveUpdates(_0x4cacaf[_0x1950('0x47')],null))['then'](respondWithResult(_0xe0bdf6,null))[_0x1950('0x44')](handleError(_0xe0bdf6,null));};exports['destroy']=function(_0x3bc31b,_0x328b40){return db[_0x1950('0x2b')]['find']({'where':{'id':_0x3bc31b[_0x1950('0x48')]['id']}})['then'](handleEntityNotFound(_0x328b40,null))[_0x1950('0x25')](removeEntity(_0x328b40,null))[_0x1950('0x44')](handleError(_0x328b40,null));};exports[_0x1950('0x49')]=function(_0x1c5bea,_0xce5712,_0x17c03b){var _0x24a3fa={};var _0x2eb879={};var _0x42cdfe;var _0xe4fb06;return db[_0x1950('0x2b')]['findOne']({'where':{'id':_0x1c5bea[_0x1950('0x48')]['id']}})['then'](handleEntityNotFound(_0xce5712,null))[_0x1950('0x25')](function(_0x1367d6){if(_0x1367d6){_0x42cdfe=_0x1367d6;_0x2eb879[_0x1950('0x2f')]=_[_0x1950('0x31')](db[_0x1950('0x4a')][_0x1950('0x4b')]);_0x2eb879[_0x1950('0x30')]=_['keys'](_0x1c5bea[_0x1950('0x30')]);_0x2eb879['filters']=_[_0x1950('0x33')](_0x2eb879[_0x1950('0x2f')],_0x2eb879[_0x1950('0x30')]);_0x24a3fa['attributes']=_['intersection'](_0x2eb879[_0x1950('0x2f')],qs[_0x1950('0x34')](_0x1c5bea[_0x1950('0x30')][_0x1950('0x34')]));_0x24a3fa['attributes']=_0x24a3fa[_0x1950('0x35')][_0x1950('0x36')]?_0x24a3fa[_0x1950('0x35')]:_0x2eb879[_0x1950('0x2f')];_0x24a3fa[_0x1950('0x39')]=qs['sort'](_0x1c5bea[_0x1950('0x30')]['sort']);_0x24a3fa[_0x1950('0x3b')]=qs[_0x1950('0x32')](_[_0x1950('0x3c')](_0x1c5bea[_0x1950('0x30')],_0x2eb879[_0x1950('0x32')]));if(_0x1c5bea[_0x1950('0x30')]['filter']){_0x24a3fa[_0x1950('0x3b')]=_[_0x1950('0x3d')](_0x24a3fa[_0x1950('0x3b')],{'$or':_[_0x1950('0x2a')](_0x24a3fa[_0x1950('0x35')],function(_0x4f97c5){var _0x53292f={};_0x53292f[_0x4f97c5]={'$like':'%'+_0x1c5bea[_0x1950('0x30')][_0x1950('0x3f')]+'%'};return _0x53292f;})});}_0x24a3fa=_['merge']({},_0x24a3fa,_0x1c5bea[_0x1950('0x40')]);return _0x42cdfe[_0x1950('0x49')](_0x24a3fa);}})[_0x1950('0x25')](function(_0x5671fc){if(_0x5671fc){_0xe4fb06=_0x5671fc[_0x1950('0x36')];if(!_0x1c5bea[_0x1950('0x30')]['hasOwnProperty']('nolimit')){_0x24a3fa[_0x1950('0x1d')]=qs[_0x1950('0x1d')](_0x1c5bea[_0x1950('0x30')][_0x1950('0x1d')]);_0x24a3fa[_0x1950('0x1e')]=qs['offset'](_0x1c5bea[_0x1950('0x30')][_0x1950('0x1e')]);}return _0x42cdfe[_0x1950('0x49')](_0x24a3fa);}})[_0x1950('0x25')](function(_0x5cd297){if(_0x5cd297){return _0x5cd297?{'count':_0xe4fb06,'rows':_0x5cd297}:null;}})[_0x1950('0x25')](respondWithResult(_0xce5712,null))['catch'](handleError(_0xce5712,null));};exports[_0x1950('0x4c')]=function(_0x229600,_0x3d0f07,_0x1948c3){var _0x2941e8={};var _0x338930={};var _0x15c960;var _0x39ac64;return db['ServicenowConfiguration'][_0x1950('0x4d')]({'where':{'id':_0x229600['params']['id']}})[_0x1950('0x25')](handleEntityNotFound(_0x3d0f07,null))['then'](function(_0x2e1a5e){if(_0x2e1a5e){_0x15c960=_0x2e1a5e;_0x338930[_0x1950('0x2f')]=_['keys'](db['ServicenowField'][_0x1950('0x4b')]);_0x338930['query']=_[_0x1950('0x31')](_0x229600[_0x1950('0x30')]);_0x338930[_0x1950('0x32')]=_[_0x1950('0x33')](_0x338930[_0x1950('0x2f')],_0x338930[_0x1950('0x30')]);_0x2941e8[_0x1950('0x35')]=_[_0x1950('0x33')](_0x338930['model'],qs['fields'](_0x229600[_0x1950('0x30')][_0x1950('0x34')]));_0x2941e8[_0x1950('0x35')]=_0x2941e8['attributes']['length']?_0x2941e8[_0x1950('0x35')]:_0x338930['model'];_0x2941e8['order']=qs[_0x1950('0x3a')](_0x229600[_0x1950('0x30')][_0x1950('0x3a')]);_0x2941e8['where']=qs[_0x1950('0x32')](_[_0x1950('0x3c')](_0x229600['query'],_0x338930[_0x1950('0x32')]));if(_0x229600[_0x1950('0x30')]['filter']){_0x2941e8[_0x1950('0x3b')]=_[_0x1950('0x3d')](_0x2941e8['where'],{'$or':_[_0x1950('0x2a')](_0x2941e8[_0x1950('0x35')],function(_0x2cf544){var _0x25f08a={};_0x25f08a[_0x2cf544]={'$like':'%'+_0x229600[_0x1950('0x30')][_0x1950('0x3f')]+'%'};return _0x25f08a;})});}_0x2941e8=_[_0x1950('0x3d')]({},_0x2941e8,_0x229600[_0x1950('0x40')]);return _0x15c960[_0x1950('0x4c')](_0x2941e8);}})['then'](function(_0x2d3f18){if(_0x2d3f18){_0x39ac64=_0x2d3f18[_0x1950('0x36')];if(!_0x229600[_0x1950('0x30')][_0x1950('0x37')](_0x1950('0x38'))){_0x2941e8[_0x1950('0x1d')]=qs[_0x1950('0x1d')](_0x229600[_0x1950('0x30')][_0x1950('0x1d')]);_0x2941e8['offset']=qs[_0x1950('0x1e')](_0x229600[_0x1950('0x30')]['offset']);}return _0x15c960['getSubjects'](_0x2941e8);}})[_0x1950('0x25')](function(_0x4aa586){if(_0x4aa586){return _0x4aa586?{'count':_0x39ac64,'rows':_0x4aa586}:null;}})['then'](respondWithResult(_0x3d0f07,null))['catch'](handleError(_0x3d0f07,null));};exports[_0x1950('0x4e')]=function(_0x421542,_0x5f3447,_0x29d9a0){var _0x2519d2={};var _0x485e4f={};var _0x4379c9;var _0x596d62;return db[_0x1950('0x2b')][_0x1950('0x4d')]({'where':{'id':_0x421542[_0x1950('0x48')]['id']}})[_0x1950('0x25')](handleEntityNotFound(_0x5f3447,null))[_0x1950('0x25')](function(_0x412f59){if(_0x412f59){_0x4379c9=_0x412f59;_0x485e4f[_0x1950('0x2f')]=_[_0x1950('0x31')](db['ServicenowField'][_0x1950('0x4b')]);_0x485e4f[_0x1950('0x30')]=_['keys'](_0x421542['query']);_0x485e4f[_0x1950('0x32')]=_['intersection'](_0x485e4f[_0x1950('0x2f')],_0x485e4f['query']);_0x2519d2[_0x1950('0x35')]=_[_0x1950('0x33')](_0x485e4f['model'],qs[_0x1950('0x34')](_0x421542[_0x1950('0x30')][_0x1950('0x34')]));_0x2519d2[_0x1950('0x35')]=_0x2519d2[_0x1950('0x35')][_0x1950('0x36')]?_0x2519d2[_0x1950('0x35')]:_0x485e4f['model'];_0x2519d2[_0x1950('0x39')]=qs[_0x1950('0x3a')](_0x421542[_0x1950('0x30')][_0x1950('0x3a')]);_0x2519d2['where']=qs['filters'](_[_0x1950('0x3c')](_0x421542[_0x1950('0x30')],_0x485e4f['filters']));if(_0x421542[_0x1950('0x30')][_0x1950('0x3f')]){_0x2519d2[_0x1950('0x3b')]=_[_0x1950('0x3d')](_0x2519d2[_0x1950('0x3b')],{'$or':_['map'](_0x2519d2[_0x1950('0x35')],function(_0x1a01ac){var _0x322a53={};_0x322a53[_0x1a01ac]={'$like':'%'+_0x421542[_0x1950('0x30')]['filter']+'%'};return _0x322a53;})});}_0x2519d2=_['merge']({},_0x2519d2,_0x421542['options']);return _0x4379c9[_0x1950('0x4e')](_0x2519d2);}})[_0x1950('0x25')](function(_0x27f29e){if(_0x27f29e){_0x596d62=_0x27f29e[_0x1950('0x36')];if(!_0x421542[_0x1950('0x30')][_0x1950('0x37')](_0x1950('0x38'))){_0x2519d2[_0x1950('0x1d')]=qs[_0x1950('0x1d')](_0x421542[_0x1950('0x30')][_0x1950('0x1d')]);_0x2519d2[_0x1950('0x1e')]=qs[_0x1950('0x1e')](_0x421542[_0x1950('0x30')][_0x1950('0x1e')]);}return _0x4379c9[_0x1950('0x4e')](_0x2519d2);}})[_0x1950('0x25')](function(_0x1ef587){if(_0x1ef587){return _0x1ef587?{'count':_0x596d62,'rows':_0x1ef587}:null;}})[_0x1950('0x25')](respondWithResult(_0x5f3447,null))[_0x1950('0x44')](handleError(_0x5f3447,null));}; \ No newline at end of file +var _0xc88d=['keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query'];(function(_0x67d4ca,_0x455f15){var _0xc53c24=function(_0x3645e4){while(--_0x3645e4){_0x67d4ca['push'](_0x67d4ca['shift']());}};_0xc53c24(++_0x455f15);}(_0xc88d,0x16a));var _0xdc88=function(_0x3db5f4,_0x34eef5){_0x3db5f4=_0x3db5f4-0x0;var _0x34c0d8=_0xc88d[_0x3db5f4];return _0x34c0d8;};'use strict';var emlformat=require(_0xdc88('0x0'));var rimraf=require(_0xdc88('0x1'));var zipdir=require(_0xdc88('0x2'));var jsonpatch=require(_0xdc88('0x3'));var rp=require(_0xdc88('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdc88('0x5'));var sox=require(_0xdc88('0x6'));var csv=require('to-csv');var ejs=require(_0xdc88('0x7'));var fs=require('fs');var fs_extra=require(_0xdc88('0x8'));var _=require(_0xdc88('0x9'));var squel=require(_0xdc88('0xa'));var crypto=require(_0xdc88('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc88('0xc'));var toCsv=require(_0xdc88('0xd'));var querystring=require(_0xdc88('0xe'));var Papa=require(_0xdc88('0xf'));var Redis=require(_0xdc88('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdc88('0x11'));var as=require(_0xdc88('0x12'));var hardwareService=require(_0xdc88('0x13'));var logger=require(_0xdc88('0x14'))(_0xdc88('0x15'));var utils=require(_0xdc88('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdc88('0x17'));var db=require(_0xdc88('0x18'))['db'];function respondWithStatusCode(_0x234cb0,_0x25ea28){_0x25ea28=_0x25ea28||0xcc;return function(_0x3c2acb){if(_0x3c2acb){return _0x234cb0[_0xdc88('0x19')](_0x25ea28);}return _0x234cb0[_0xdc88('0x1a')](_0x25ea28)[_0xdc88('0x1b')]();};}function respondWithResult(_0x992c3a,_0x5ee461){_0x5ee461=_0x5ee461||0xc8;return function(_0x263910){if(_0x263910){return _0x992c3a[_0xdc88('0x1a')](_0x5ee461)[_0xdc88('0x1c')](_0x263910);}};}function respondWithFilteredResult(_0x366bee,_0x514d62){return function(_0x485516){if(_0x485516){var _0x23a036=typeof _0x514d62['offset']===_0xdc88('0x1d')&&typeof _0x514d62['limit']===_0xdc88('0x1d');var _0x36caa4=_0x485516['count'];var _0x35e1cf=_0x23a036?0x0:_0x514d62[_0xdc88('0x1e')];var _0x472d06=_0x23a036?_0x485516[_0xdc88('0x1f')]:_0x514d62['offset']+_0x514d62[_0xdc88('0x20')];var _0x258304;if(_0x472d06>=_0x36caa4){_0x472d06=_0x36caa4;_0x258304=0xc8;}else{_0x258304=0xce;}_0x366bee[_0xdc88('0x1a')](_0x258304);return _0x366bee['set'](_0xdc88('0x21'),_0x35e1cf+'-'+_0x472d06+'/'+_0x36caa4)[_0xdc88('0x1c')](_0x485516);}return null;};}function patchUpdates(_0x283157){return function(_0x1fddcf){try{jsonpatch[_0xdc88('0x22')](_0x1fddcf,_0x283157,!![]);}catch(_0x43172c){return BPromise[_0xdc88('0x23')](_0x43172c);}return _0x1fddcf[_0xdc88('0x24')]();};}function saveUpdates(_0x33bd12,_0x5cce74){return function(_0x415db5){if(_0x415db5){return _0x415db5[_0xdc88('0x25')](_0x33bd12)[_0xdc88('0x26')](function(_0x4a59e7){return _0x4a59e7;});}return null;};}function removeEntity(_0x3ef532,_0x31c55b){return function(_0x310dde){if(_0x310dde){return _0x310dde[_0xdc88('0x27')]()[_0xdc88('0x26')](function(){_0x3ef532[_0xdc88('0x1a')](0xcc)[_0xdc88('0x1b')]();});}};}function handleEntityNotFound(_0x305f34,_0x52514a){return function(_0x6c3122){if(!_0x6c3122){_0x305f34['sendStatus'](0x194);}return _0x6c3122;};}function handleError(_0x11c7ba,_0x43aadc){_0x43aadc=_0x43aadc||0x1f4;return function(_0xd52785){logger[_0xdc88('0x28')](_0xd52785[_0xdc88('0x29')]);if(_0xd52785['name']){delete _0xd52785[_0xdc88('0x2a')];}_0x11c7ba['status'](_0x43aadc)[_0xdc88('0x2b')](_0xd52785);};}exports[_0xdc88('0x2c')]=function(_0x37b8ff,_0x4be7d1){var _0x1f2000={},_0x210774={},_0x5b7521={'count':0x0,'rows':[]};var _0x1a1c6c=_[_0xdc88('0x2d')](db[_0xdc88('0x2e')][_0xdc88('0x2f')],function(_0x4eff9c){return{'name':_0x4eff9c[_0xdc88('0x30')],'type':_0x4eff9c[_0xdc88('0x31')][_0xdc88('0x32')]};});_0x210774[_0xdc88('0x33')]=_[_0xdc88('0x2d')](_0x1a1c6c,_0xdc88('0x2a'));_0x210774[_0xdc88('0x34')]=_[_0xdc88('0x35')](_0x37b8ff[_0xdc88('0x34')]);_0x210774[_0xdc88('0x36')]=_['intersection'](_0x210774[_0xdc88('0x33')],_0x210774[_0xdc88('0x34')]);_0x1f2000['attributes']=_['intersection'](_0x210774[_0xdc88('0x33')],qs[_0xdc88('0x37')](_0x37b8ff['query'][_0xdc88('0x37')]));_0x1f2000[_0xdc88('0x38')]=_0x1f2000['attributes'][_0xdc88('0x39')]?_0x1f2000['attributes']:_0x210774['model'];if(!_0x37b8ff['query'][_0xdc88('0x3a')](_0xdc88('0x3b'))){_0x1f2000['limit']=qs[_0xdc88('0x20')](_0x37b8ff[_0xdc88('0x34')][_0xdc88('0x20')]);_0x1f2000['offset']=qs[_0xdc88('0x1e')](_0x37b8ff[_0xdc88('0x34')][_0xdc88('0x1e')]);}_0x1f2000[_0xdc88('0x3c')]=qs['sort'](_0x37b8ff['query'][_0xdc88('0x3d')]);_0x1f2000[_0xdc88('0x3e')]=qs[_0xdc88('0x36')](_['pick'](_0x37b8ff[_0xdc88('0x34')],_0x210774['filters']),_0x1a1c6c);if(_0x37b8ff[_0xdc88('0x34')][_0xdc88('0x3f')]){_0x1f2000[_0xdc88('0x3e')]=_[_0xdc88('0x40')](_0x1f2000[_0xdc88('0x3e')],{'$or':_['map'](_0x1a1c6c,function(_0x3d572e){if(_0x3d572e[_0xdc88('0x31')]!=='VIRTUAL'){var _0x5a5591={};_0x5a5591[_0x3d572e[_0xdc88('0x2a')]]={'$like':'%'+_0x37b8ff['query'][_0xdc88('0x3f')]+'%'};return _0x5a5591;}})});}_0x1f2000=_[_0xdc88('0x40')]({},_0x1f2000,_0x37b8ff[_0xdc88('0x41')]);var _0x564d07={'where':_0x1f2000[_0xdc88('0x3e')]};return db['ServicenowConfiguration']['count'](_0x564d07)[_0xdc88('0x26')](function(_0x37fe88){_0x5b7521['count']=_0x37fe88;if(_0x37b8ff[_0xdc88('0x34')]['includeAll']){_0x1f2000[_0xdc88('0x42')]=[{'all':!![]}];}return db[_0xdc88('0x2e')][_0xdc88('0x43')](_0x1f2000);})[_0xdc88('0x26')](function(_0x1a9976){_0x5b7521[_0xdc88('0x44')]=_0x1a9976;return _0x5b7521;})['then'](respondWithFilteredResult(_0x4be7d1,_0x1f2000))[_0xdc88('0x45')](handleError(_0x4be7d1,null));};exports[_0xdc88('0x46')]=function(_0x59739a,_0x443134){var _0x395e6a={'raw':![],'where':{'id':_0x59739a[_0xdc88('0x47')]['id']}},_0x281675={};_0x281675[_0xdc88('0x33')]=_[_0xdc88('0x35')](db[_0xdc88('0x2e')][_0xdc88('0x2f')]);_0x281675['query']=_['keys'](_0x59739a[_0xdc88('0x34')]);_0x281675[_0xdc88('0x36')]=_[_0xdc88('0x48')](_0x281675[_0xdc88('0x33')],_0x281675['query']);_0x395e6a['attributes']=_[_0xdc88('0x48')](_0x281675[_0xdc88('0x33')],qs[_0xdc88('0x37')](_0x59739a[_0xdc88('0x34')]['fields']));_0x395e6a['attributes']=_0x395e6a['attributes']['length']?_0x395e6a['attributes']:_0x281675[_0xdc88('0x33')];if(_0x59739a[_0xdc88('0x34')][_0xdc88('0x49')]){_0x395e6a['include']=[{'all':!![]}];}_0x395e6a=_['merge']({},_0x395e6a,_0x59739a[_0xdc88('0x41')]);return db[_0xdc88('0x2e')][_0xdc88('0x4a')](_0x395e6a)['then'](handleEntityNotFound(_0x443134,null))[_0xdc88('0x26')](respondWithResult(_0x443134,null))[_0xdc88('0x45')](handleError(_0x443134,null));};exports[_0xdc88('0x4b')]=function(_0x12f0c8,_0xf5be10){return db[_0xdc88('0x2e')][_0xdc88('0x4b')](_0x12f0c8[_0xdc88('0x4c')],{})['then'](respondWithResult(_0xf5be10,0xc9))[_0xdc88('0x45')](handleError(_0xf5be10,null));};exports[_0xdc88('0x25')]=function(_0x488d92,_0x1fdcc2){if(_0x488d92['body']['id']){delete _0x488d92[_0xdc88('0x4c')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x488d92[_0xdc88('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fdcc2,null))[_0xdc88('0x26')](saveUpdates(_0x488d92[_0xdc88('0x4c')],null))[_0xdc88('0x26')](respondWithResult(_0x1fdcc2,null))['catch'](handleError(_0x1fdcc2,null));};exports['destroy']=function(_0x599630,_0x377221){return db[_0xdc88('0x2e')][_0xdc88('0x4a')]({'where':{'id':_0x599630['params']['id']}})['then'](handleEntityNotFound(_0x377221,null))[_0xdc88('0x26')](removeEntity(_0x377221,null))['catch'](handleError(_0x377221,null));};exports['getFields']=function(_0x33b3f7,_0x5c906f,_0x161f41){var _0x4f6f8b={};var _0x5211eb={};var _0x24cb55;var _0x54292c;return db[_0xdc88('0x2e')][_0xdc88('0x4d')]({'where':{'id':_0x33b3f7[_0xdc88('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c906f,null))[_0xdc88('0x26')](function(_0xca372d){if(_0xca372d){_0x24cb55=_0xca372d;_0x5211eb[_0xdc88('0x33')]=_[_0xdc88('0x35')](db[_0xdc88('0x4e')]['rawAttributes']);_0x5211eb[_0xdc88('0x34')]=_[_0xdc88('0x35')](_0x33b3f7[_0xdc88('0x34')]);_0x5211eb[_0xdc88('0x36')]=_[_0xdc88('0x48')](_0x5211eb[_0xdc88('0x33')],_0x5211eb[_0xdc88('0x34')]);_0x4f6f8b[_0xdc88('0x38')]=_[_0xdc88('0x48')](_0x5211eb[_0xdc88('0x33')],qs[_0xdc88('0x37')](_0x33b3f7[_0xdc88('0x34')][_0xdc88('0x37')]));_0x4f6f8b[_0xdc88('0x38')]=_0x4f6f8b[_0xdc88('0x38')]['length']?_0x4f6f8b['attributes']:_0x5211eb['model'];_0x4f6f8b[_0xdc88('0x3c')]=qs['sort'](_0x33b3f7[_0xdc88('0x34')][_0xdc88('0x3d')]);_0x4f6f8b['where']=qs[_0xdc88('0x36')](_[_0xdc88('0x4f')](_0x33b3f7[_0xdc88('0x34')],_0x5211eb[_0xdc88('0x36')]));if(_0x33b3f7[_0xdc88('0x34')][_0xdc88('0x3f')]){_0x4f6f8b['where']=_[_0xdc88('0x40')](_0x4f6f8b[_0xdc88('0x3e')],{'$or':_[_0xdc88('0x2d')](_0x4f6f8b[_0xdc88('0x38')],function(_0x374e34){var _0x437618={};_0x437618[_0x374e34]={'$like':'%'+_0x33b3f7[_0xdc88('0x34')][_0xdc88('0x3f')]+'%'};return _0x437618;})});}_0x4f6f8b=_[_0xdc88('0x40')]({},_0x4f6f8b,_0x33b3f7[_0xdc88('0x41')]);return _0x24cb55[_0xdc88('0x50')](_0x4f6f8b);}})[_0xdc88('0x26')](function(_0x32c27e){if(_0x32c27e){_0x54292c=_0x32c27e[_0xdc88('0x39')];if(!_0x33b3f7['query'][_0xdc88('0x3a')](_0xdc88('0x3b'))){_0x4f6f8b[_0xdc88('0x20')]=qs[_0xdc88('0x20')](_0x33b3f7['query']['limit']);_0x4f6f8b['offset']=qs['offset'](_0x33b3f7[_0xdc88('0x34')][_0xdc88('0x1e')]);}return _0x24cb55[_0xdc88('0x50')](_0x4f6f8b);}})[_0xdc88('0x26')](function(_0x43fa73){if(_0x43fa73){return _0x43fa73?{'count':_0x54292c,'rows':_0x43fa73}:null;}})[_0xdc88('0x26')](respondWithResult(_0x5c906f,null))['catch'](handleError(_0x5c906f,null));};exports['getSubjects']=function(_0x1d8144,_0x2a7488,_0x26c8fb){var _0x5ee944={};var _0x168928={};var _0x5e49f5;var _0x169db0;return db['ServicenowConfiguration'][_0xdc88('0x4d')]({'where':{'id':_0x1d8144[_0xdc88('0x47')]['id']}})[_0xdc88('0x26')](handleEntityNotFound(_0x2a7488,null))[_0xdc88('0x26')](function(_0x127c1f){if(_0x127c1f){_0x5e49f5=_0x127c1f;_0x168928[_0xdc88('0x33')]=_[_0xdc88('0x35')](db[_0xdc88('0x4e')]['rawAttributes']);_0x168928['query']=_[_0xdc88('0x35')](_0x1d8144[_0xdc88('0x34')]);_0x168928['filters']=_[_0xdc88('0x48')](_0x168928[_0xdc88('0x33')],_0x168928[_0xdc88('0x34')]);_0x5ee944[_0xdc88('0x38')]=_[_0xdc88('0x48')](_0x168928[_0xdc88('0x33')],qs[_0xdc88('0x37')](_0x1d8144[_0xdc88('0x34')][_0xdc88('0x37')]));_0x5ee944[_0xdc88('0x38')]=_0x5ee944[_0xdc88('0x38')][_0xdc88('0x39')]?_0x5ee944[_0xdc88('0x38')]:_0x168928[_0xdc88('0x33')];_0x5ee944[_0xdc88('0x3c')]=qs[_0xdc88('0x3d')](_0x1d8144[_0xdc88('0x34')][_0xdc88('0x3d')]);_0x5ee944[_0xdc88('0x3e')]=qs[_0xdc88('0x36')](_[_0xdc88('0x4f')](_0x1d8144['query'],_0x168928[_0xdc88('0x36')]));if(_0x1d8144[_0xdc88('0x34')][_0xdc88('0x3f')]){_0x5ee944[_0xdc88('0x3e')]=_[_0xdc88('0x40')](_0x5ee944[_0xdc88('0x3e')],{'$or':_[_0xdc88('0x2d')](_0x5ee944[_0xdc88('0x38')],function(_0x82314f){var _0x2d2dff={};_0x2d2dff[_0x82314f]={'$like':'%'+_0x1d8144[_0xdc88('0x34')][_0xdc88('0x3f')]+'%'};return _0x2d2dff;})});}_0x5ee944=_[_0xdc88('0x40')]({},_0x5ee944,_0x1d8144[_0xdc88('0x41')]);return _0x5e49f5['getSubjects'](_0x5ee944);}})[_0xdc88('0x26')](function(_0x31abe0){if(_0x31abe0){_0x169db0=_0x31abe0['length'];if(!_0x1d8144[_0xdc88('0x34')][_0xdc88('0x3a')]('nolimit')){_0x5ee944[_0xdc88('0x20')]=qs[_0xdc88('0x20')](_0x1d8144['query']['limit']);_0x5ee944[_0xdc88('0x1e')]=qs[_0xdc88('0x1e')](_0x1d8144[_0xdc88('0x34')][_0xdc88('0x1e')]);}return _0x5e49f5[_0xdc88('0x51')](_0x5ee944);}})['then'](function(_0xe812a1){if(_0xe812a1){return _0xe812a1?{'count':_0x169db0,'rows':_0xe812a1}:null;}})[_0xdc88('0x26')](respondWithResult(_0x2a7488,null))[_0xdc88('0x45')](handleError(_0x2a7488,null));};exports[_0xdc88('0x52')]=function(_0x54d993,_0x5d87b8,_0x56bbc1){var _0x5d4417={};var _0x194e8a={};var _0x5614ab;var _0x321019;return db[_0xdc88('0x2e')][_0xdc88('0x4d')]({'where':{'id':_0x54d993[_0xdc88('0x47')]['id']}})[_0xdc88('0x26')](handleEntityNotFound(_0x5d87b8,null))[_0xdc88('0x26')](function(_0x3cfafc){if(_0x3cfafc){_0x5614ab=_0x3cfafc;_0x194e8a[_0xdc88('0x33')]=_[_0xdc88('0x35')](db[_0xdc88('0x4e')][_0xdc88('0x2f')]);_0x194e8a[_0xdc88('0x34')]=_['keys'](_0x54d993['query']);_0x194e8a[_0xdc88('0x36')]=_[_0xdc88('0x48')](_0x194e8a['model'],_0x194e8a['query']);_0x5d4417['attributes']=_['intersection'](_0x194e8a['model'],qs[_0xdc88('0x37')](_0x54d993[_0xdc88('0x34')][_0xdc88('0x37')]));_0x5d4417[_0xdc88('0x38')]=_0x5d4417[_0xdc88('0x38')][_0xdc88('0x39')]?_0x5d4417['attributes']:_0x194e8a[_0xdc88('0x33')];_0x5d4417[_0xdc88('0x3c')]=qs['sort'](_0x54d993[_0xdc88('0x34')][_0xdc88('0x3d')]);_0x5d4417[_0xdc88('0x3e')]=qs[_0xdc88('0x36')](_[_0xdc88('0x4f')](_0x54d993[_0xdc88('0x34')],_0x194e8a[_0xdc88('0x36')]));if(_0x54d993[_0xdc88('0x34')][_0xdc88('0x3f')]){_0x5d4417[_0xdc88('0x3e')]=_[_0xdc88('0x40')](_0x5d4417['where'],{'$or':_['map'](_0x5d4417[_0xdc88('0x38')],function(_0x53efac){var _0x116059={};_0x116059[_0x53efac]={'$like':'%'+_0x54d993[_0xdc88('0x34')][_0xdc88('0x3f')]+'%'};return _0x116059;})});}_0x5d4417=_['merge']({},_0x5d4417,_0x54d993['options']);return _0x5614ab[_0xdc88('0x52')](_0x5d4417);}})[_0xdc88('0x26')](function(_0x45adcf){if(_0x45adcf){_0x321019=_0x45adcf['length'];if(!_0x54d993['query']['hasOwnProperty'](_0xdc88('0x3b'))){_0x5d4417[_0xdc88('0x20')]=qs[_0xdc88('0x20')](_0x54d993['query'][_0xdc88('0x20')]);_0x5d4417['offset']=qs[_0xdc88('0x1e')](_0x54d993[_0xdc88('0x34')]['offset']);}return _0x5614ab[_0xdc88('0x52')](_0x5d4417);}})[_0xdc88('0x26')](function(_0x6552ec){if(_0x6552ec){return _0x6552ec?{'count':_0x321019,'rows':_0x6552ec}:null;}})[_0xdc88('0x26')](respondWithResult(_0x5d87b8,null))[_0xdc88('0x45')](handleError(_0x5d87b8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6ee5e32..e27af45 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 _0xa1aa=['moment','bluebird','rimraf','../../config/environment','exports','ServicenowConfiguration','util','../../config/logger','api'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x570b3c,_0x1b1da7){_0x570b3c=_0x570b3c-0x0;var _0x26cba9=_0xa1aa[_0x570b3c];return _0x26cba9;};'use strict';var _=require('lodash');var util=require(_0xaa1a('0x0'));var logger=require(_0xaa1a('0x1'))(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xaa1a('0x7')]=function(_0x370a4e,_0x243c15){return _0x370a4e['define'](_0xaa1a('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd6e=['request-promise','path','rimraf','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x1d77cf,_0x31d9cb){var _0x20edd9=function(_0x3a185b){while(--_0x3a185b){_0x1d77cf['push'](_0x1d77cf['shift']());}};_0x20edd9(++_0x31d9cb);}(_0xdd6e,0xa5));var _0xedd6=function(_0x3fcc5a,_0x2803e5){_0x3fcc5a=_0x3fcc5a-0x0;var _0xfa3902=_0xdd6e[_0x3fcc5a];return _0xfa3902;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var logger=require(_0xedd6('0x2'))(_0xedd6('0x3'));var moment=require('moment');var BPromise=require(_0xedd6('0x4'));var rp=require(_0xedd6('0x5'));var fs=require('fs');var path=require(_0xedd6('0x6'));var rimraf=require(_0xedd6('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x3430b2,_0x27b159){return _0x3430b2['define'](_0xedd6('0x8'),attributes,{'tableName':_0xedd6('0x9'),'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 6d5f4c1..c870251 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 _0x3021=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x31f5ed,_0x564728){var _0x1e11ca=function(_0x19ac55){while(--_0x19ac55){_0x31f5ed['push'](_0x31f5ed['shift']());}};_0x1e11ca(++_0x564728);}(_0x3021,0xfd));var _0x1302=function(_0x280ee8,_0x100fc4){_0x280ee8=_0x280ee8-0x0;var _0x1269d4=_0x3021[_0x280ee8];return _0x1269d4;};'use strict';var _=require(_0x1302('0x0'));var util=require('util');var moment=require(_0x1302('0x1'));var BPromise=require('bluebird');var rs=require(_0x1302('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1302('0x3'))['db'];var utils=require(_0x1302('0x4'));var logger=require(_0x1302('0x5'))(_0x1302('0x6'));var config=require(_0x1302('0x7'));var jayson=require(_0x1302('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50900a,_0x23eb82,_0x2e56bc){return new BPromise(function(_0x42f23b,_0x1c5752){return client['request'](_0x50900a,_0x2e56bc)[_0x1302('0x9')](function(_0x4e9956){logger[_0x1302('0xa')](_0x1302('0xb'),_0x23eb82,_0x1302('0xc'));logger[_0x1302('0xd')](_0x1302('0xe'),_0x23eb82,_0x1302('0xc'),JSON[_0x1302('0xf')](_0x4e9956));if(_0x4e9956[_0x1302('0x10')]){if(_0x4e9956[_0x1302('0x10')]['code']===0x1f4){logger[_0x1302('0x10')](_0x1302('0xb'),_0x23eb82,_0x4e9956[_0x1302('0x10')]['message']);return _0x1c5752(_0x4e9956[_0x1302('0x10')]['message']);}logger[_0x1302('0x10')](_0x1302('0xb'),_0x23eb82,_0x4e9956[_0x1302('0x10')]['message']);return _0x42f23b(_0x4e9956[_0x1302('0x10')][_0x1302('0x11')]);}else{logger['info'](_0x1302('0xb'),_0x23eb82,_0x1302('0xc'));_0x42f23b(_0x4e9956[_0x1302('0x12')]['message']);}})['catch'](function(_0x347058){logger['error'](_0x1302('0xb'),_0x23eb82,_0x347058);_0x1c5752(_0x347058);});});} \ No newline at end of file +var _0x2bbc=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x41397b,_0x481d0e){var _0x5f4677=function(_0x4a0b5b){while(--_0x4a0b5b){_0x41397b['push'](_0x41397b['shift']());}};_0x5f4677(++_0x481d0e);}(_0x2bbc,0x1ea));var _0xc2bb=function(_0x4e9b07,_0x39d3eb){_0x4e9b07=_0x4e9b07-0x0;var _0x370ad9=_0x2bbc[_0x4e9b07];return _0x370ad9;};'use strict';var _=require(_0xc2bb('0x0'));var util=require(_0xc2bb('0x1'));var moment=require(_0xc2bb('0x2'));var BPromise=require(_0xc2bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2bb('0x4'));var db=require(_0xc2bb('0x5'))['db'];var utils=require(_0xc2bb('0x6'));var logger=require(_0xc2bb('0x7'))(_0xc2bb('0x8'));var config=require(_0xc2bb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc2bb('0xa')][_0xc2bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ed363,_0x5b9ad1,_0x481e3f){return new BPromise(function(_0x536ddf,_0x4d9da4){return client[_0xc2bb('0xc')](_0x2ed363,_0x481e3f)[_0xc2bb('0xd')](function(_0x3e1166){logger['info'](_0xc2bb('0xe'),_0x5b9ad1,_0xc2bb('0xf'));logger[_0xc2bb('0x10')](_0xc2bb('0x11'),_0x5b9ad1,'request\x20sent',JSON['stringify'](_0x3e1166));if(_0x3e1166[_0xc2bb('0x12')]){if(_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x13')]===0x1f4){logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x14')]);return _0x4d9da4(_0x3e1166[_0xc2bb('0x12')][_0xc2bb('0x14')]);}logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x3e1166[_0xc2bb('0x12')]['message']);return _0x536ddf(_0x3e1166['error'][_0xc2bb('0x14')]);}else{logger[_0xc2bb('0x15')](_0xc2bb('0xe'),_0x5b9ad1,'request\x20sent');_0x536ddf(_0x3e1166[_0xc2bb('0x16')]['message']);}})['catch'](function(_0x49ff3a){logger['error'](_0xc2bb('0xe'),_0x5b9ad1,_0x49ff3a);_0x4d9da4(_0x49ff3a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 3f2e423..daf0eb8 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 _0xadda=['/:id','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','show','post','create','put'];(function(_0x481a26,_0x13d43e){var _0x4653c7=function(_0x1fb5ae){while(--_0x1fb5ae){_0x481a26['push'](_0x481a26['shift']());}};_0x4653c7(++_0x13d43e);}(_0xadda,0xd4));var _0xaadd=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xadda[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0xaadd('0x0'));var path=require(_0xaadd('0x1'));var timeout=require(_0xaadd('0x2'));var express=require(_0xaadd('0x3'));var router=express['Router']();var fs_extra=require(_0xaadd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaadd('0x5'));var controller=require('./intServicenowField.controller');router[_0xaadd('0x6')]('/',auth[_0xaadd('0x7')](),controller['index']);router[_0xaadd('0x6')]('/:id',auth[_0xaadd('0x7')](),controller[_0xaadd('0x8')]);router[_0xaadd('0x9')]('/',auth[_0xaadd('0x7')](),controller[_0xaadd('0xa')]);router[_0xaadd('0xb')](_0xaadd('0xc'),auth[_0xaadd('0x7')](),controller['update']);router[_0xaadd('0xd')](_0xaadd('0xc'),auth[_0xaadd('0x7')](),controller[_0xaadd('0xe')]);module[_0xaadd('0xf')]=router; \ No newline at end of file +var _0x7944=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d18bd,_0xf09dbd){var _0x5d1045=function(_0x23231b){while(--_0x23231b){_0x4d18bd['push'](_0x4d18bd['shift']());}};_0x5d1045(++_0xf09dbd);}(_0x7944,0x102));var _0x4794=function(_0x23182f,_0x3e60d5){_0x23182f=_0x23182f-0x0;var _0x4db43c=_0x7944[_0x23182f];return _0x4db43c;};'use strict';var multer=require(_0x4794('0x0'));var util=require(_0x4794('0x1'));var path=require(_0x4794('0x2'));var timeout=require('connect-timeout');var express=require(_0x4794('0x3'));var router=express[_0x4794('0x4')]();var fs_extra=require(_0x4794('0x5'));var auth=require(_0x4794('0x6'));var interaction=require(_0x4794('0x7'));var config=require(_0x4794('0x8'));var controller=require(_0x4794('0x9'));router[_0x4794('0xa')]('/',auth[_0x4794('0xb')](),controller['index']);router[_0x4794('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4794('0xc')]('/',auth[_0x4794('0xb')](),controller[_0x4794('0xd')]);router[_0x4794('0xe')](_0x4794('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x4794('0x10')](_0x4794('0xf'),auth['isAuthenticated'](),controller[_0x4794('0x11')]);module[_0x4794('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 51fe6b4..280225d 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 _0x2516=['string','keyValue','picklist','STRING','variable'];(function(_0x29840d,_0x4bef48){var _0x4917cd=function(_0x5499b9){while(--_0x5499b9){_0x29840d['push'](_0x29840d['shift']());}};_0x4917cd(++_0x4bef48);}(_0x2516,0x140));var _0x6251=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x2516[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x6251('0x0'),'variable','customVariable',_0x6251('0x1'),_0x6251('0x2')),'defaultValue':_0x6251('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6251('0x3')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6251('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6251('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6251('0x3')]}}; \ No newline at end of file +var _0x6def=['STRING','BOOLEAN','exports','string','variable','customVariable','picklist'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6def,0x9c));var _0xf6de=function(_0x4f079f,_0x1949ff){_0x4f079f=_0x4f079f-0x0;var _0x40049d=_0x6def[_0x4f079f];return _0x40049d;};'use strict';var Sequelize=require('sequelize');module[_0xf6de('0x0')]={'type':{'type':Sequelize['ENUM'](_0xf6de('0x1'),_0xf6de('0x2'),_0xf6de('0x3'),'keyValue',_0xf6de('0x4')),'defaultValue':_0xf6de('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf6de('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xf6de('0x1'),_0xf6de('0x2'),_0xf6de('0x3'))},'keyContent':{'type':Sequelize[_0xf6de('0x5')]},'idField':{'type':Sequelize[_0xf6de('0x5')]},'nameField':{'type':Sequelize[_0xf6de('0x5')]},'customField':{'type':Sequelize[_0xf6de('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index d050423..785d20b 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 _0x50d1=['Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','params','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x165a54,_0x4a9821){var _0x19eaae=function(_0x457027){while(--_0x457027){_0x165a54['push'](_0x165a54['shift']());}};_0x19eaae(++_0x4a9821);}(_0x50d1,0x113));var _0x150d=function(_0x424c23,_0x40cb95){_0x424c23=_0x424c23-0x0;var _0x348780=_0x50d1[_0x424c23];return _0x348780;};'use strict';var emlformat=require(_0x150d('0x0'));var rimraf=require(_0x150d('0x1'));var zipdir=require(_0x150d('0x2'));var jsonpatch=require(_0x150d('0x3'));var rp=require(_0x150d('0x4'));var moment=require(_0x150d('0x5'));var BPromise=require(_0x150d('0x6'));var Mustache=require(_0x150d('0x7'));var util=require(_0x150d('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x150d('0x9'));var fs=require('fs');var fs_extra=require(_0x150d('0xa'));var _=require(_0x150d('0xb'));var squel=require(_0x150d('0xc'));var crypto=require(_0x150d('0xd'));var jsforce=require(_0x150d('0xe'));var deskjs=require(_0x150d('0xf'));var toCsv=require(_0x150d('0x10'));var querystring=require(_0x150d('0x11'));var Papa=require(_0x150d('0x12'));var Redis=require(_0x150d('0x13'));var authService=require(_0x150d('0x14'));var qs=require(_0x150d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x150d('0x16'));var logger=require(_0x150d('0x17'))('api');var utils=require(_0x150d('0x18'));var config=require(_0x150d('0x19'));var licenseUtil=require(_0x150d('0x1a'));var db=require(_0x150d('0x1b'))['db'];function respondWithStatusCode(_0x5952be,_0xef0c38){_0xef0c38=_0xef0c38||0xcc;return function(_0x491519){if(_0x491519){return _0x5952be[_0x150d('0x1c')](_0xef0c38);}return _0x5952be['status'](_0xef0c38)[_0x150d('0x1d')]();};}function respondWithResult(_0x17a4b1,_0xd2952e){_0xd2952e=_0xd2952e||0xc8;return function(_0x5d90ba){if(_0x5d90ba){return _0x17a4b1[_0x150d('0x1e')](_0xd2952e)[_0x150d('0x1f')](_0x5d90ba);}};}function respondWithFilteredResult(_0x2b0bdf,_0x3bf9b2){return function(_0x8567fa){if(_0x8567fa){var _0x20f0a9=typeof _0x3bf9b2[_0x150d('0x20')]===_0x150d('0x21')&&typeof _0x3bf9b2[_0x150d('0x22')]===_0x150d('0x21');var _0x1da3ef=_0x8567fa[_0x150d('0x23')];var _0x336fa7=_0x20f0a9?0x0:_0x3bf9b2[_0x150d('0x20')];var _0x12a66d=_0x20f0a9?_0x8567fa[_0x150d('0x23')]:_0x3bf9b2[_0x150d('0x20')]+_0x3bf9b2['limit'];var _0x24c06a;if(_0x12a66d>=_0x1da3ef){_0x12a66d=_0x1da3ef;_0x24c06a=0xc8;}else{_0x24c06a=0xce;}_0x2b0bdf[_0x150d('0x1e')](_0x24c06a);return _0x2b0bdf[_0x150d('0x24')](_0x150d('0x25'),_0x336fa7+'-'+_0x12a66d+'/'+_0x1da3ef)[_0x150d('0x1f')](_0x8567fa);}return null;};}function patchUpdates(_0x10f4c8){return function(_0x9e9445){try{jsonpatch[_0x150d('0x26')](_0x9e9445,_0x10f4c8,!![]);}catch(_0x36017c){return BPromise['reject'](_0x36017c);}return _0x9e9445[_0x150d('0x27')]();};}function saveUpdates(_0x1e7a27,_0x309e93){return function(_0x3d9f37){if(_0x3d9f37){return _0x3d9f37[_0x150d('0x28')](_0x1e7a27)[_0x150d('0x29')](function(_0x558a44){return _0x558a44;});}return null;};}function removeEntity(_0x593369,_0x180a50){return function(_0x4d7509){if(_0x4d7509){return _0x4d7509[_0x150d('0x2a')]()['then'](function(){_0x593369[_0x150d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41909f,_0x2e8dcb){return function(_0x18eacb){if(!_0x18eacb){_0x41909f[_0x150d('0x1c')](0x194);}return _0x18eacb;};}function handleError(_0x10ad09,_0xafbc5){_0xafbc5=_0xafbc5||0x1f4;return function(_0x43f1b9){logger[_0x150d('0x2b')](_0x43f1b9[_0x150d('0x2c')]);if(_0x43f1b9['name']){delete _0x43f1b9[_0x150d('0x2d')];}_0x10ad09[_0x150d('0x1e')](_0xafbc5)[_0x150d('0x2e')](_0x43f1b9);};}exports[_0x150d('0x2f')]=function(_0x384ccc,_0x127e69){var _0x523344={},_0x1ce9d1={},_0x5e28af={'count':0x0,'rows':[]};var _0x5e2735=_[_0x150d('0x30')](db[_0x150d('0x31')][_0x150d('0x32')],function(_0xf6019d){return{'name':_0xf6019d['fieldName'],'type':_0xf6019d['type'][_0x150d('0x33')]};});_0x1ce9d1[_0x150d('0x34')]=_[_0x150d('0x30')](_0x5e2735,_0x150d('0x2d'));_0x1ce9d1['query']=_[_0x150d('0x35')](_0x384ccc[_0x150d('0x36')]);_0x1ce9d1['filters']=_['intersection'](_0x1ce9d1[_0x150d('0x34')],_0x1ce9d1[_0x150d('0x36')]);_0x523344[_0x150d('0x37')]=_[_0x150d('0x38')](_0x1ce9d1[_0x150d('0x34')],qs['fields'](_0x384ccc[_0x150d('0x36')][_0x150d('0x39')]));_0x523344[_0x150d('0x37')]=_0x523344[_0x150d('0x37')][_0x150d('0x3a')]?_0x523344[_0x150d('0x37')]:_0x1ce9d1[_0x150d('0x34')];if(!_0x384ccc['query'][_0x150d('0x3b')](_0x150d('0x3c'))){_0x523344[_0x150d('0x22')]=qs[_0x150d('0x22')](_0x384ccc[_0x150d('0x36')][_0x150d('0x22')]);_0x523344['offset']=qs['offset'](_0x384ccc[_0x150d('0x36')][_0x150d('0x20')]);}_0x523344[_0x150d('0x3d')]=qs['sort'](_0x384ccc[_0x150d('0x36')]['sort']);_0x523344[_0x150d('0x3e')]=qs[_0x150d('0x3f')](_[_0x150d('0x40')](_0x384ccc[_0x150d('0x36')],_0x1ce9d1['filters']),_0x5e2735);if(_0x384ccc[_0x150d('0x36')][_0x150d('0x41')]){_0x523344['where']=_['merge'](_0x523344[_0x150d('0x3e')],{'$or':_[_0x150d('0x30')](_0x5e2735,function(_0xbd2651){if(_0xbd2651[_0x150d('0x42')]!==_0x150d('0x43')){var _0x29b889={};_0x29b889[_0xbd2651[_0x150d('0x2d')]]={'$like':'%'+_0x384ccc['query'][_0x150d('0x41')]+'%'};return _0x29b889;}})});}_0x523344=_['merge']({},_0x523344,_0x384ccc[_0x150d('0x44')]);var _0x326bb4={'where':_0x523344[_0x150d('0x3e')]};return db[_0x150d('0x31')]['count'](_0x326bb4)[_0x150d('0x29')](function(_0x34e9b2){_0x5e28af[_0x150d('0x23')]=_0x34e9b2;if(_0x384ccc[_0x150d('0x36')][_0x150d('0x45')]){_0x523344[_0x150d('0x46')]=[{'all':!![]}];}return db[_0x150d('0x31')]['findAll'](_0x523344);})[_0x150d('0x29')](function(_0x23c9cb){_0x5e28af[_0x150d('0x47')]=_0x23c9cb;return _0x5e28af;})[_0x150d('0x29')](respondWithFilteredResult(_0x127e69,_0x523344))[_0x150d('0x48')](handleError(_0x127e69,null));};exports['show']=function(_0x3014f0,_0x53a18f){var _0x39a069={'raw':!![],'where':{'id':_0x3014f0[_0x150d('0x49')]['id']}},_0x13c9b3={};_0x13c9b3['model']=_[_0x150d('0x35')](db[_0x150d('0x31')]['rawAttributes']);_0x13c9b3['query']=_[_0x150d('0x35')](_0x3014f0[_0x150d('0x36')]);_0x13c9b3[_0x150d('0x3f')]=_[_0x150d('0x38')](_0x13c9b3[_0x150d('0x34')],_0x13c9b3[_0x150d('0x36')]);_0x39a069[_0x150d('0x37')]=_['intersection'](_0x13c9b3[_0x150d('0x34')],qs[_0x150d('0x39')](_0x3014f0[_0x150d('0x36')]['fields']));_0x39a069[_0x150d('0x37')]=_0x39a069[_0x150d('0x37')][_0x150d('0x3a')]?_0x39a069[_0x150d('0x37')]:_0x13c9b3[_0x150d('0x34')];if(_0x3014f0[_0x150d('0x36')][_0x150d('0x45')]){_0x39a069[_0x150d('0x46')]=[{'all':!![]}];}_0x39a069=_[_0x150d('0x4a')]({},_0x39a069,_0x3014f0[_0x150d('0x44')]);return db[_0x150d('0x31')][_0x150d('0x4b')](_0x39a069)[_0x150d('0x29')](handleEntityNotFound(_0x53a18f,null))[_0x150d('0x29')](respondWithResult(_0x53a18f,null))[_0x150d('0x48')](handleError(_0x53a18f,null));};exports['create']=function(_0x56a114,_0x5b4726){return db['ServicenowField'][_0x150d('0x4c')](_0x56a114[_0x150d('0x4d')],{})[_0x150d('0x29')](respondWithResult(_0x5b4726,0xc9))[_0x150d('0x48')](handleError(_0x5b4726,null));};exports[_0x150d('0x28')]=function(_0x159e24,_0x4436e5){if(_0x159e24['body']['id']){delete _0x159e24[_0x150d('0x4d')]['id'];}return db[_0x150d('0x31')][_0x150d('0x4b')]({'where':{'id':_0x159e24[_0x150d('0x49')]['id']}})[_0x150d('0x29')](handleEntityNotFound(_0x4436e5,null))[_0x150d('0x29')](saveUpdates(_0x159e24[_0x150d('0x4d')],null))[_0x150d('0x29')](respondWithResult(_0x4436e5,null))['catch'](handleError(_0x4436e5,null));};exports['destroy']=function(_0x3ca0d0,_0x26b2ba){return db[_0x150d('0x31')]['find']({'where':{'id':_0x3ca0d0['params']['id']}})[_0x150d('0x29')](handleEntityNotFound(_0x26b2ba,null))[_0x150d('0x29')](removeEntity(_0x26b2ba,null))[_0x150d('0x48')](handleError(_0x26b2ba,null));}; \ No newline at end of file +var _0x0170=['options','includeAll','include','findAll','show','params','find','create','body','catch','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','name','send','index','ServicenowField','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type'];(function(_0x2e4809,_0x365e2a){var _0x4e9161=function(_0x19d951){while(--_0x19d951){_0x2e4809['push'](_0x2e4809['shift']());}};_0x4e9161(++_0x365e2a);}(_0x0170,0x17c));var _0x0017=function(_0x41ada5,_0x11033f){_0x41ada5=_0x41ada5-0x0;var _0x1c7fcb=_0x0170[_0x41ada5];return _0x1c7fcb;};'use strict';var emlformat=require(_0x0017('0x0'));var rimraf=require(_0x0017('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0017('0x2'));var moment=require(_0x0017('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0017('0x4'));var util=require('util');var path=require(_0x0017('0x5'));var sox=require(_0x0017('0x6'));var csv=require(_0x0017('0x7'));var ejs=require(_0x0017('0x8'));var fs=require('fs');var fs_extra=require(_0x0017('0x9'));var _=require(_0x0017('0xa'));var squel=require(_0x0017('0xb'));var crypto=require(_0x0017('0xc'));var jsforce=require(_0x0017('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0017('0x7'));var querystring=require(_0x0017('0xe'));var Papa=require(_0x0017('0xf'));var Redis=require(_0x0017('0x10'));var authService=require(_0x0017('0x11'));var qs=require(_0x0017('0x12'));var as=require(_0x0017('0x13'));var hardwareService=require(_0x0017('0x14'));var logger=require(_0x0017('0x15'))('api');var utils=require(_0x0017('0x16'));var config=require(_0x0017('0x17'));var licenseUtil=require(_0x0017('0x18'));var db=require(_0x0017('0x19'))['db'];function respondWithStatusCode(_0x1c1dff,_0x540df9){_0x540df9=_0x540df9||0xcc;return function(_0x2abbcd){if(_0x2abbcd){return _0x1c1dff[_0x0017('0x1a')](_0x540df9);}return _0x1c1dff['status'](_0x540df9)['end']();};}function respondWithResult(_0xb9649b,_0x386974){_0x386974=_0x386974||0xc8;return function(_0x2fe905){if(_0x2fe905){return _0xb9649b['status'](_0x386974)[_0x0017('0x1b')](_0x2fe905);}};}function respondWithFilteredResult(_0x2993bc,_0x5c10c7){return function(_0x233fdb){if(_0x233fdb){var _0x18f023=typeof _0x5c10c7[_0x0017('0x1c')]===_0x0017('0x1d')&&typeof _0x5c10c7[_0x0017('0x1e')]===_0x0017('0x1d');var _0x2e400c=_0x233fdb[_0x0017('0x1f')];var _0x489d35=_0x18f023?0x0:_0x5c10c7[_0x0017('0x1c')];var _0x4e8209=_0x18f023?_0x233fdb[_0x0017('0x1f')]:_0x5c10c7[_0x0017('0x1c')]+_0x5c10c7[_0x0017('0x1e')];var _0x24fd80;if(_0x4e8209>=_0x2e400c){_0x4e8209=_0x2e400c;_0x24fd80=0xc8;}else{_0x24fd80=0xce;}_0x2993bc['status'](_0x24fd80);return _0x2993bc[_0x0017('0x20')](_0x0017('0x21'),_0x489d35+'-'+_0x4e8209+'/'+_0x2e400c)['json'](_0x233fdb);}return null;};}function patchUpdates(_0x497bee){return function(_0x5c724e){try{jsonpatch['apply'](_0x5c724e,_0x497bee,!![]);}catch(_0x2d87bc){return BPromise[_0x0017('0x22')](_0x2d87bc);}return _0x5c724e[_0x0017('0x23')]();};}function saveUpdates(_0x4828e4,_0x4d4a46){return function(_0x3cbe4f){if(_0x3cbe4f){return _0x3cbe4f[_0x0017('0x24')](_0x4828e4)[_0x0017('0x25')](function(_0x2a29b2){return _0x2a29b2;});}return null;};}function removeEntity(_0x40e7f6,_0x19ad15){return function(_0x3fe17a){if(_0x3fe17a){return _0x3fe17a[_0x0017('0x26')]()[_0x0017('0x25')](function(){_0x40e7f6['status'](0xcc)[_0x0017('0x27')]();});}};}function handleEntityNotFound(_0x221990,_0x243201){return function(_0x525066){if(!_0x525066){_0x221990[_0x0017('0x1a')](0x194);}return _0x525066;};}function handleError(_0x413857,_0x1ab24b){_0x1ab24b=_0x1ab24b||0x1f4;return function(_0x5e955c){logger['error'](_0x5e955c['stack']);if(_0x5e955c[_0x0017('0x28')]){delete _0x5e955c[_0x0017('0x28')];}_0x413857['status'](_0x1ab24b)[_0x0017('0x29')](_0x5e955c);};}exports[_0x0017('0x2a')]=function(_0x476e21,_0x34711f){var _0x513cf3={},_0x591c6c={},_0x24eeea={'count':0x0,'rows':[]};var _0x48b743=_['map'](db[_0x0017('0x2b')][_0x0017('0x2c')],function(_0x19f02){return{'name':_0x19f02[_0x0017('0x2d')],'type':_0x19f02['type'][_0x0017('0x2e')]};});_0x591c6c['model']=_[_0x0017('0x2f')](_0x48b743,_0x0017('0x28'));_0x591c6c[_0x0017('0x30')]=_[_0x0017('0x31')](_0x476e21[_0x0017('0x30')]);_0x591c6c[_0x0017('0x32')]=_[_0x0017('0x33')](_0x591c6c[_0x0017('0x34')],_0x591c6c['query']);_0x513cf3[_0x0017('0x35')]=_[_0x0017('0x33')](_0x591c6c[_0x0017('0x34')],qs[_0x0017('0x36')](_0x476e21[_0x0017('0x30')][_0x0017('0x36')]));_0x513cf3[_0x0017('0x35')]=_0x513cf3[_0x0017('0x35')][_0x0017('0x37')]?_0x513cf3[_0x0017('0x35')]:_0x591c6c[_0x0017('0x34')];if(!_0x476e21[_0x0017('0x30')][_0x0017('0x38')](_0x0017('0x39'))){_0x513cf3[_0x0017('0x1e')]=qs[_0x0017('0x1e')](_0x476e21[_0x0017('0x30')]['limit']);_0x513cf3[_0x0017('0x1c')]=qs[_0x0017('0x1c')](_0x476e21[_0x0017('0x30')][_0x0017('0x1c')]);}_0x513cf3[_0x0017('0x3a')]=qs[_0x0017('0x3b')](_0x476e21[_0x0017('0x30')][_0x0017('0x3b')]);_0x513cf3[_0x0017('0x3c')]=qs['filters'](_['pick'](_0x476e21['query'],_0x591c6c[_0x0017('0x32')]),_0x48b743);if(_0x476e21[_0x0017('0x30')][_0x0017('0x3d')]){_0x513cf3[_0x0017('0x3c')]=_[_0x0017('0x3e')](_0x513cf3[_0x0017('0x3c')],{'$or':_[_0x0017('0x2f')](_0x48b743,function(_0x2fdcf6){if(_0x2fdcf6[_0x0017('0x3f')]!=='VIRTUAL'){var _0x313d18={};_0x313d18[_0x2fdcf6[_0x0017('0x28')]]={'$like':'%'+_0x476e21[_0x0017('0x30')][_0x0017('0x3d')]+'%'};return _0x313d18;}})});}_0x513cf3=_[_0x0017('0x3e')]({},_0x513cf3,_0x476e21[_0x0017('0x40')]);var _0x4d5eee={'where':_0x513cf3[_0x0017('0x3c')]};return db[_0x0017('0x2b')][_0x0017('0x1f')](_0x4d5eee)['then'](function(_0x3853f0){_0x24eeea[_0x0017('0x1f')]=_0x3853f0;if(_0x476e21['query'][_0x0017('0x41')]){_0x513cf3[_0x0017('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0x0017('0x43')](_0x513cf3);})[_0x0017('0x25')](function(_0x332480){_0x24eeea['rows']=_0x332480;return _0x24eeea;})[_0x0017('0x25')](respondWithFilteredResult(_0x34711f,_0x513cf3))['catch'](handleError(_0x34711f,null));};exports[_0x0017('0x44')]=function(_0x4bff6e,_0x4953d8){var _0xadcd64={'raw':!![],'where':{'id':_0x4bff6e[_0x0017('0x45')]['id']}},_0x5e5547={};_0x5e5547[_0x0017('0x34')]=_['keys'](db[_0x0017('0x2b')][_0x0017('0x2c')]);_0x5e5547[_0x0017('0x30')]=_[_0x0017('0x31')](_0x4bff6e['query']);_0x5e5547[_0x0017('0x32')]=_['intersection'](_0x5e5547[_0x0017('0x34')],_0x5e5547[_0x0017('0x30')]);_0xadcd64[_0x0017('0x35')]=_[_0x0017('0x33')](_0x5e5547['model'],qs[_0x0017('0x36')](_0x4bff6e[_0x0017('0x30')][_0x0017('0x36')]));_0xadcd64[_0x0017('0x35')]=_0xadcd64['attributes']['length']?_0xadcd64[_0x0017('0x35')]:_0x5e5547[_0x0017('0x34')];if(_0x4bff6e[_0x0017('0x30')][_0x0017('0x41')]){_0xadcd64[_0x0017('0x42')]=[{'all':!![]}];}_0xadcd64=_[_0x0017('0x3e')]({},_0xadcd64,_0x4bff6e[_0x0017('0x40')]);return db[_0x0017('0x2b')][_0x0017('0x46')](_0xadcd64)[_0x0017('0x25')](handleEntityNotFound(_0x4953d8,null))['then'](respondWithResult(_0x4953d8,null))['catch'](handleError(_0x4953d8,null));};exports[_0x0017('0x47')]=function(_0x38885e,_0x3fd418){return db[_0x0017('0x2b')]['create'](_0x38885e[_0x0017('0x48')],{})[_0x0017('0x25')](respondWithResult(_0x3fd418,0xc9))[_0x0017('0x49')](handleError(_0x3fd418,null));};exports['update']=function(_0x3c8831,_0x2eaf91){if(_0x3c8831[_0x0017('0x48')]['id']){delete _0x3c8831[_0x0017('0x48')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x3c8831['params']['id']}})[_0x0017('0x25')](handleEntityNotFound(_0x2eaf91,null))['then'](saveUpdates(_0x3c8831['body'],null))[_0x0017('0x25')](respondWithResult(_0x2eaf91,null))[_0x0017('0x49')](handleError(_0x2eaf91,null));};exports['destroy']=function(_0x45186e,_0x39f5db){return db[_0x0017('0x2b')][_0x0017('0x46')]({'where':{'id':_0x45186e[_0x0017('0x45')]['id']}})[_0x0017('0x25')](handleEntityNotFound(_0x39f5db,null))[_0x0017('0x25')](removeEntity(_0x39f5db,null))[_0x0017('0x49')](handleError(_0x39f5db,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 1cc99ea..efa9cee 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 _0x2936=['../../config/logger','api','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x1e7b62,_0x203ef6){var _0x54b038=function(_0x46d2c){while(--_0x46d2c){_0x1e7b62['push'](_0x1e7b62['shift']());}};_0x54b038(++_0x203ef6);}(_0x2936,0x8e));var _0x6293=function(_0x15211d,_0x6125e1){_0x15211d=_0x15211d-0x0;var _0x18cbd0=_0x2936[_0x15211d];return _0x18cbd0;};'use strict';var _=require(_0x6293('0x0'));var util=require('util');var logger=require(_0x6293('0x1'))(_0x6293('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6293('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6293('0x4'));var config=require(_0x6293('0x5'));var attributes=require(_0x6293('0x6'));module[_0x6293('0x7')]=function(_0x1057b8,_0x52e02a){return _0x1057b8[_0x6293('0x8')](_0x6293('0x9'),attributes,{'tableName':_0x6293('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x6293('0xb'),_0x6293('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53e8=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53e8,0x7d));var _0x853e=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x53e8[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x853e('0x0'));var util=require(_0x853e('0x1'));var logger=require(_0x853e('0x2'))(_0x853e('0x3'));var moment=require('moment');var BPromise=require(_0x853e('0x4'));var rp=require(_0x853e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x853e('0x6'));var config=require(_0x853e('0x7'));var attributes=require(_0x853e('0x8'));module['exports']=function(_0x25fa52,_0x29867e){return _0x25fa52[_0x853e('0x9')](_0x853e('0xa'),attributes,{'tableName':_0x853e('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x853e('0xc'),_0x853e('0xd')],'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 57c23cc..ed05a41 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x56bc56,_0x57e2d0){var _0x40ec0b=function(_0x367e2b){while(--_0x367e2b){_0x56bc56['push'](_0x56bc56['shift']());}};_0x40ec0b(++_0x57e2d0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1e36df,_0x4f2c47){_0x1e36df=_0x1e36df-0x0;var _0x4ebd6=_0xb43b[_0x1e36df];return _0x4ebd6;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5afe55,_0x325cb0){var _0x327a7f=function(_0x3e6424){while(--_0x3e6424){_0x5afe55['push'](_0x5afe55['shift']());}};_0x327a7f(++_0x325cb0);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5d4433,_0x487cce){_0x5d4433=_0x5d4433-0x0;var _0x3c0cc0=_0x9bde[_0x5d4433];return _0x3c0cc0;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 73dc726..cafc350 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x315250,_0x47ea02){var _0x3bf38d=function(_0x4b469c){while(--_0x4b469c){_0x315250['push'](_0x315250['shift']());}};_0x3bf38d(++_0x47ea02);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x8c6e4b,_0x2e1648){var _0x136598=function(_0x3454f9){while(--_0x3454f9){_0x8c6e4b['push'](_0x8c6e4b['shift']());}};_0x136598(++_0x2e1648);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 6ce015c..11df3bc 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(_0x434bf6,_0x4a56a0){var _0x4030e9=function(_0x3b0a94){while(--_0x3b0a94){_0x434bf6['push'](_0x434bf6['shift']());}};_0x4030e9(++_0x4a56a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x9722aa,_0x3d5b01){var _0x1667cd=function(_0x534466){while(--_0x534466){_0x9722aa['push'](_0x9722aa['shift']());}};_0x1667cd(++_0x3d5b01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 d651e4b..1fc501b 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 _0x96d1=['/service/v4_1/rest.php','login','JSON','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s'];(function(_0x4d66d4,_0x24a527){var _0x53d24e=function(_0x1b84a1){while(--_0x1b84a1){_0x4d66d4['push'](_0x4d66d4['shift']());}};_0x53d24e(++_0x24a527);}(_0x96d1,0x8a));var _0x196d=function(_0x174db7,_0x481ef7){_0x174db7=_0x174db7-0x0;var _0x1ee6a0=_0x96d1[_0x174db7];return _0x1ee6a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x196d('0x0'));var zipdir=require(_0x196d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x196d('0x2'));var moment=require(_0x196d('0x3'));var BPromise=require(_0x196d('0x4'));var Mustache=require('mustache');var util=require(_0x196d('0x5'));var path=require(_0x196d('0x6'));var sox=require(_0x196d('0x7'));var csv=require(_0x196d('0x8'));var ejs=require(_0x196d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x196d('0xa'));var squel=require(_0x196d('0xb'));var crypto=require('crypto');var jsforce=require(_0x196d('0xc'));var deskjs=require(_0x196d('0xd'));var toCsv=require(_0x196d('0x8'));var querystring=require('querystring');var Papa=require(_0x196d('0xe'));var Redis=require(_0x196d('0xf'));var authService=require(_0x196d('0x10'));var qs=require(_0x196d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x196d('0x12'))(_0x196d('0x13'));var utils=require(_0x196d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x196d('0x15'));var db=require(_0x196d('0x16'))['db'];var integrations=require(_0x196d('0x17'));function respondWithStatusCode(_0x3dceec,_0x2d2f14){_0x2d2f14=_0x2d2f14||0xcc;return function(_0x511e6d){if(_0x511e6d){return _0x3dceec[_0x196d('0x18')](_0x2d2f14);}return _0x3dceec['status'](_0x2d2f14)[_0x196d('0x19')]();};}function respondWithResult(_0x37a6aa,_0x44e1fc){_0x44e1fc=_0x44e1fc||0xc8;return function(_0x582b7c){if(_0x582b7c){return _0x37a6aa[_0x196d('0x1a')](_0x44e1fc)[_0x196d('0x1b')](_0x582b7c);}};}function respondWithFilteredResult(_0x3d4999,_0x59734d){return function(_0x1948f4){if(_0x1948f4){var _0x5bdebf=typeof _0x59734d[_0x196d('0x1c')]===_0x196d('0x1d')&&typeof _0x59734d['limit']===_0x196d('0x1d');var _0x340a43=_0x1948f4[_0x196d('0x1e')];var _0x5ee4e5=_0x5bdebf?0x0:_0x59734d[_0x196d('0x1c')];var _0x92b8da=_0x5bdebf?_0x1948f4['count']:_0x59734d[_0x196d('0x1c')]+_0x59734d['limit'];var _0x2e7cff;if(_0x92b8da>=_0x340a43){_0x92b8da=_0x340a43;_0x2e7cff=0xc8;}else{_0x2e7cff=0xce;}_0x3d4999[_0x196d('0x1a')](_0x2e7cff);return _0x3d4999[_0x196d('0x1f')](_0x196d('0x20'),_0x5ee4e5+'-'+_0x92b8da+'/'+_0x340a43)[_0x196d('0x1b')](_0x1948f4);}return null;};}function patchUpdates(_0x53e91a){return function(_0x252eff){try{jsonpatch['apply'](_0x252eff,_0x53e91a,!![]);}catch(_0x804bbc){return BPromise[_0x196d('0x21')](_0x804bbc);}return _0x252eff[_0x196d('0x22')]();};}function saveUpdates(_0x3e39c7,_0x5e0da9){return function(_0x591716){if(_0x591716){return _0x591716[_0x196d('0x23')](_0x3e39c7)[_0x196d('0x24')](function(_0x263805){return _0x263805;});}return null;};}function removeEntity(_0x13d20e,_0x6ac31c){return function(_0x3c6e75){if(_0x3c6e75){return _0x3c6e75['destroy']()[_0x196d('0x24')](function(){_0x13d20e[_0x196d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xad9262,_0x271dc3){return function(_0x3a768b){if(!_0x3a768b){_0xad9262[_0x196d('0x18')](0x194);}return _0x3a768b;};}function handleError(_0x1304cb,_0x25f063){_0x25f063=_0x25f063||0x1f4;return function(_0x5e1ffe){logger[_0x196d('0x25')](_0x5e1ffe['stack']);if(_0x5e1ffe['name']){delete _0x5e1ffe[_0x196d('0x26')];}_0x1304cb['status'](_0x25f063)[_0x196d('0x27')](_0x5e1ffe);};}exports[_0x196d('0x28')]=function(_0x14dcd7,_0x4b48de){var _0x193c38={},_0x15e679={},_0x11d269={'count':0x0,'rows':[]};var _0x2a7f62=_[_0x196d('0x29')](db[_0x196d('0x2a')][_0x196d('0x2b')],function(_0x4b7f7a){return{'name':_0x4b7f7a['fieldName'],'type':_0x4b7f7a[_0x196d('0x2c')][_0x196d('0x2d')]};});_0x15e679[_0x196d('0x2e')]=_['map'](_0x2a7f62,_0x196d('0x26'));_0x15e679[_0x196d('0x2f')]=_['keys'](_0x14dcd7[_0x196d('0x2f')]);_0x15e679['filters']=_[_0x196d('0x30')](_0x15e679['model'],_0x15e679['query']);_0x193c38[_0x196d('0x31')]=_[_0x196d('0x30')](_0x15e679[_0x196d('0x2e')],qs['fields'](_0x14dcd7['query'][_0x196d('0x32')]));_0x193c38[_0x196d('0x31')]=_0x193c38[_0x196d('0x31')][_0x196d('0x33')]?_0x193c38['attributes']:_0x15e679['model'];if(!_0x14dcd7[_0x196d('0x2f')][_0x196d('0x34')](_0x196d('0x35'))){_0x193c38['limit']=qs[_0x196d('0x36')](_0x14dcd7[_0x196d('0x2f')]['limit']);_0x193c38[_0x196d('0x1c')]=qs[_0x196d('0x1c')](_0x14dcd7[_0x196d('0x2f')][_0x196d('0x1c')]);}_0x193c38[_0x196d('0x37')]=qs[_0x196d('0x38')](_0x14dcd7[_0x196d('0x2f')][_0x196d('0x38')]);_0x193c38['where']=qs[_0x196d('0x39')](_[_0x196d('0x3a')](_0x14dcd7[_0x196d('0x2f')],_0x15e679[_0x196d('0x39')]),_0x2a7f62);if(_0x14dcd7[_0x196d('0x2f')]['filter']){_0x193c38[_0x196d('0x3b')]=_['merge'](_0x193c38['where'],{'$or':_['map'](_0x2a7f62,function(_0x226c98){if(_0x226c98['type']!==_0x196d('0x3c')){var _0x299f28={};_0x299f28[_0x226c98[_0x196d('0x26')]]={'$like':'%'+_0x14dcd7[_0x196d('0x2f')][_0x196d('0x3d')]+'%'};return _0x299f28;}})});}_0x193c38=_[_0x196d('0x3e')]({},_0x193c38,_0x14dcd7[_0x196d('0x3f')]);var _0x31c2ae={'where':_0x193c38[_0x196d('0x3b')]};return db[_0x196d('0x2a')][_0x196d('0x1e')](_0x31c2ae)[_0x196d('0x24')](function(_0x30428b){_0x11d269[_0x196d('0x1e')]=_0x30428b;if(_0x14dcd7[_0x196d('0x2f')][_0x196d('0x40')]){_0x193c38[_0x196d('0x41')]=[{'all':!![]}];}return db[_0x196d('0x2a')][_0x196d('0x42')](_0x193c38);})[_0x196d('0x24')](function(_0xe861f5){_0x11d269[_0x196d('0x43')]=_0xe861f5;return _0x11d269;})[_0x196d('0x24')](respondWithFilteredResult(_0x4b48de,_0x193c38))[_0x196d('0x44')](handleError(_0x4b48de,null));};exports[_0x196d('0x45')]=function(_0x385b79,_0x167f03){var _0x33748b={'raw':![],'where':{'id':_0x385b79[_0x196d('0x46')]['id']}},_0x46b08c={};_0x46b08c[_0x196d('0x2e')]=_[_0x196d('0x47')](db[_0x196d('0x2a')][_0x196d('0x2b')]);_0x46b08c[_0x196d('0x2f')]=_[_0x196d('0x47')](_0x385b79[_0x196d('0x2f')]);_0x46b08c['filters']=_[_0x196d('0x30')](_0x46b08c[_0x196d('0x2e')],_0x46b08c[_0x196d('0x2f')]);_0x33748b[_0x196d('0x31')]=_['intersection'](_0x46b08c[_0x196d('0x2e')],qs[_0x196d('0x32')](_0x385b79[_0x196d('0x2f')][_0x196d('0x32')]));_0x33748b[_0x196d('0x31')]=_0x33748b[_0x196d('0x31')]['length']?_0x33748b['attributes']:_0x46b08c[_0x196d('0x2e')];if(_0x385b79[_0x196d('0x2f')][_0x196d('0x40')]){_0x33748b[_0x196d('0x41')]=[{'all':!![]}];}_0x33748b=_[_0x196d('0x3e')]({},_0x33748b,_0x385b79[_0x196d('0x3f')]);return db['SugarcrmAccount'][_0x196d('0x48')](_0x33748b)[_0x196d('0x24')](handleEntityNotFound(_0x167f03,null))[_0x196d('0x24')](respondWithResult(_0x167f03,null))[_0x196d('0x44')](handleError(_0x167f03,null));};exports[_0x196d('0x49')]=function(_0x44a0fa,_0x6d67b0){return db[_0x196d('0x2a')]['create'](_0x44a0fa['body'],{})['then'](respondWithResult(_0x6d67b0,0xc9))['catch'](handleError(_0x6d67b0,null));};exports['update']=function(_0x5634fe,_0x5cfd3b){if(_0x5634fe[_0x196d('0x4a')]['id']){delete _0x5634fe[_0x196d('0x4a')]['id'];}return db['SugarcrmAccount'][_0x196d('0x48')]({'where':{'id':_0x5634fe['params']['id']}})[_0x196d('0x24')](handleEntityNotFound(_0x5cfd3b,null))['then'](saveUpdates(_0x5634fe[_0x196d('0x4a')],null))['then'](respondWithResult(_0x5cfd3b,null))[_0x196d('0x44')](handleError(_0x5cfd3b,null));};exports[_0x196d('0x4b')]=function(_0x2fa0e0,_0x14dd0e){return db[_0x196d('0x2a')][_0x196d('0x48')]({'where':{'id':_0x2fa0e0['params']['id']}})[_0x196d('0x24')](handleEntityNotFound(_0x14dd0e,null))[_0x196d('0x24')](removeEntity(_0x14dd0e,null))['catch'](handleError(_0x14dd0e,null));};exports[_0x196d('0x4c')]=function(_0x13d1e9,_0x1d0203,_0x6efae9){var _0x591a7e={};var _0x26705e={};var _0xc47749;var _0x1a78a5;return db[_0x196d('0x2a')][_0x196d('0x4d')]({'where':{'id':_0x13d1e9[_0x196d('0x46')]['id']}})[_0x196d('0x24')](handleEntityNotFound(_0x1d0203,null))[_0x196d('0x24')](function(_0x531cf1){if(_0x531cf1){_0xc47749=_0x531cf1;_0x26705e[_0x196d('0x2e')]=_[_0x196d('0x47')](db[_0x196d('0x4e')]['rawAttributes']);_0x26705e[_0x196d('0x2f')]=_[_0x196d('0x47')](_0x13d1e9['query']);_0x26705e[_0x196d('0x39')]=_['intersection'](_0x26705e[_0x196d('0x2e')],_0x26705e['query']);_0x591a7e[_0x196d('0x31')]=_[_0x196d('0x30')](_0x26705e[_0x196d('0x2e')],qs['fields'](_0x13d1e9['query'][_0x196d('0x32')]));_0x591a7e[_0x196d('0x31')]=_0x591a7e[_0x196d('0x31')]['length']?_0x591a7e[_0x196d('0x31')]:_0x26705e[_0x196d('0x2e')];_0x591a7e[_0x196d('0x37')]=qs['sort'](_0x13d1e9['query'][_0x196d('0x38')]);_0x591a7e['where']=qs[_0x196d('0x39')](_[_0x196d('0x3a')](_0x13d1e9[_0x196d('0x2f')],_0x26705e['filters']));if(_0x13d1e9[_0x196d('0x2f')][_0x196d('0x3d')]){_0x591a7e[_0x196d('0x3b')]=_[_0x196d('0x3e')](_0x591a7e[_0x196d('0x3b')],{'$or':_[_0x196d('0x29')](_0x591a7e[_0x196d('0x31')],function(_0x5bb525){var _0x1384e5={};_0x1384e5[_0x5bb525]={'$like':'%'+_0x13d1e9[_0x196d('0x2f')]['filter']+'%'};return _0x1384e5;})});}_0x591a7e=_[_0x196d('0x3e')]({},_0x591a7e,_0x13d1e9[_0x196d('0x3f')]);return _0xc47749[_0x196d('0x4c')](_0x591a7e);}})[_0x196d('0x24')](function(_0x2422af){if(_0x2422af){_0x1a78a5=_0x2422af[_0x196d('0x33')];if(!_0x13d1e9['query'][_0x196d('0x34')]('nolimit')){_0x591a7e[_0x196d('0x36')]=qs[_0x196d('0x36')](_0x13d1e9['query'][_0x196d('0x36')]);_0x591a7e[_0x196d('0x1c')]=qs[_0x196d('0x1c')](_0x13d1e9[_0x196d('0x2f')][_0x196d('0x1c')]);}return _0xc47749[_0x196d('0x4c')](_0x591a7e);}})[_0x196d('0x24')](function(_0x13418f){if(_0x13418f){return _0x13418f?{'count':_0x1a78a5,'rows':_0x13418f}:null;}})[_0x196d('0x24')](respondWithResult(_0x1d0203,null))[_0x196d('0x44')](handleError(_0x1d0203,null));};exports['addConfiguration']=function(_0x2b79d4,_0x58dac1,_0x499ceb){if(_0x2b79d4[_0x196d('0x4a')]['id']){delete _0x2b79d4[_0x196d('0x4a')]['id'];}return db[_0x196d('0x2a')][_0x196d('0x4d')]({'where':{'id':_0x2b79d4['params']['id']}})[_0x196d('0x24')](handleEntityNotFound(_0x58dac1,null))['then'](function(_0x596db5){if(_0x596db5){_0x2b79d4[_0x196d('0x4a')][_0x196d('0x4f')]=_0x596db5['id'];_0x2b79d4[_0x196d('0x4a')]['Subjects']=integrations[_0x196d('0x50')](_0x2b79d4['body']['channel'],_0x2b79d4[_0x196d('0x4a')][_0x196d('0x2c')]);_0x2b79d4['body'][_0x196d('0x51')]=integrations[_0x196d('0x52')](_0x2b79d4[_0x196d('0x4a')][_0x196d('0x53')],_0x2b79d4[_0x196d('0x4a')][_0x196d('0x2c')]);return db[_0x196d('0x4e')][_0x196d('0x49')](_0x2b79d4[_0x196d('0x4a')],{'include':[{'model':db[_0x196d('0x54')],'as':_0x196d('0x55')},{'model':db[_0x196d('0x54')],'as':'Descriptions'}]});}return null;})[_0x196d('0x24')](respondWithResult(_0x58dac1,null))[_0x196d('0x44')](handleError(_0x58dac1,null));};exports[_0x196d('0x56')]=function(_0x3c2abd,_0x2705e4,_0x2cbb52){var _0x5341cc='';var _0x5c1bfc=['id',_0x196d('0x26'),_0x196d('0x57'),_0x196d('0x58'),_0x196d('0x59'),'date_start','duration_hours','duration_minutes','parent_id','parent_type',_0x196d('0x5a'),_0x196d('0x5b')];return db[_0x196d('0x2a')][_0x196d('0x4d')]({'where':{'id':_0x3c2abd[_0x196d('0x46')]['id']},'attributes':['id',_0x196d('0x5c'),'password',_0x196d('0x5d')]})[_0x196d('0x24')](handleEntityNotFound(_0x2705e4,null))[_0x196d('0x24')](function(_0xdb7fdd){if(_0xdb7fdd){_0x5341cc=_0xdb7fdd['remoteUri'];var _0x4f6d09=_0x5341cc[_0x196d('0x5e')](-0x1);if(_0x4f6d09==='/'){_0x5341cc=_0x5341cc[_0x196d('0x5f')](0x0,_0x5341cc[_0x196d('0x60')](_0x4f6d09));}return rp({'method':_0x196d('0x61'),'uri':util[_0x196d('0x62')](_0x196d('0x63'),_0x5341cc,_0x196d('0x64')),'json':!![],'form':{'method':_0x196d('0x65'),'input_type':_0x196d('0x66'),'response_type':_0x196d('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xdb7fdd[_0x196d('0x5c')],'password':_0xdb7fdd[_0x196d('0x67')],'encryption':'PLAIN'},'application':_0x196d('0x68')})}});}})[_0x196d('0x24')](function(_0x1bee8d){if(_0x1bee8d&&_0x1bee8d[_0x196d('0x26')]!==_0x196d('0x69')&&_0x1bee8d['name']!==_0x196d('0x6a')){return rp({'method':_0x196d('0x61'),'uri':util[_0x196d('0x62')](_0x196d('0x63'),_0x5341cc,_0x196d('0x64')),'json':!![],'form':{'method':_0x196d('0x6b'),'input_type':_0x196d('0x66'),'response_type':_0x196d('0x66'),'rest_data':JSON[_0x196d('0x6c')]({'session':_0x1bee8d['id'],'module_name':_0x196d('0x6d')})}})['then'](function(_0x4c3729){if(_0x4c3729){var _0x3b7cab=_['values'](_0x4c3729['module_fields']);_['remove'](_0x3b7cab,function(_0x1cb43b){return _0x5c1bfc[_0x196d('0x6e')](_0x1cb43b[_0x196d('0x26')]);});return{'count':_0x3b7cab[_0x196d('0x33')],'rows':_['map'](_0x3b7cab,function(_0x30c90d){return{'id':_0x30c90d[_0x196d('0x26')],'name':_0x30c90d[_0x196d('0x6f')],'custom':_[_0x196d('0x70')](_0x30c90d['name'],'_c')?!![]:![],'options':_0x30c90d['options']?_[_0x196d('0x29')](_[_0x196d('0x71')](_0x30c90d[_0x196d('0x3f')]),function(_0x1e7243){return{'name':_0x1e7243[_0x196d('0x72')],'value':_0x1e7243[_0x196d('0x26')]};}):[]};})};}})[_0x196d('0x24')](respondWithResult(_0x2705e4,null))[_0x196d('0x44')](function(_0x4a20d3){var _0x59752e=_0x3c2abd[_0x196d('0x2f')][_0x196d('0x73')]?0x1f4:_0x4a20d3[_0x196d('0x74')]||0x1f4;logger['error'](_0x196d('0x75'),_0x196d('0x56'),_0x59752e,JSON[_0x196d('0x6c')](_0x4a20d3));delete _0x4a20d3[_0x196d('0x26')];if(_0x59752e===0x191){_0x59752e=0x190;}_0x2705e4[_0x196d('0x1a')](_0x59752e)[_0x196d('0x27')](_0x3c2abd['query'][_0x196d('0x73')]?{'message':_0x196d('0x76'),'statusCode':_0x4a20d3[_0x196d('0x74')]}:_0x4a20d3);});}else{var _0xf955f1=0x1f4;_0x2705e4[_0x196d('0x1a')](_0xf955f1)['send']({'message':_0x196d('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x89fe=['JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','stringify','Calls','module_fields','remove','includes','endsWith','values','value','test','eml-format','rimraf','zip-dir','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','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_type','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x89fe,0x83));var _0xe89f=function(_0x4c1b0b,_0x437acf){_0x4c1b0b=_0x4c1b0b-0x0;var _0x2c1d3b=_0x89fe[_0x4c1b0b];return _0x2c1d3b;};'use strict';var emlformat=require(_0xe89f('0x0'));var rimraf=require(_0xe89f('0x1'));var zipdir=require(_0xe89f('0x2'));var jsonpatch=require(_0xe89f('0x3'));var rp=require('request-promise');var moment=require(_0xe89f('0x4'));var BPromise=require(_0xe89f('0x5'));var Mustache=require('mustache');var util=require(_0xe89f('0x6'));var path=require(_0xe89f('0x7'));var sox=require(_0xe89f('0x8'));var csv=require(_0xe89f('0x9'));var ejs=require(_0xe89f('0xa'));var fs=require('fs');var fs_extra=require(_0xe89f('0xb'));var _=require(_0xe89f('0xc'));var squel=require('squel');var crypto=require(_0xe89f('0xd'));var jsforce=require(_0xe89f('0xe'));var deskjs=require(_0xe89f('0xf'));var toCsv=require(_0xe89f('0x9'));var querystring=require(_0xe89f('0x10'));var Papa=require('papaparse');var Redis=require(_0xe89f('0x11'));var authService=require(_0xe89f('0x12'));var qs=require(_0xe89f('0x13'));var as=require(_0xe89f('0x14'));var hardwareService=require(_0xe89f('0x15'));var logger=require(_0xe89f('0x16'))(_0xe89f('0x17'));var utils=require(_0xe89f('0x18'));var config=require(_0xe89f('0x19'));var licenseUtil=require(_0xe89f('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x548a3b,_0x4976a1){_0x4976a1=_0x4976a1||0xcc;return function(_0x4bbdb6){if(_0x4bbdb6){return _0x548a3b[_0xe89f('0x1b')](_0x4976a1);}return _0x548a3b[_0xe89f('0x1c')](_0x4976a1)['end']();};}function respondWithResult(_0x489ef2,_0x4617e7){_0x4617e7=_0x4617e7||0xc8;return function(_0x1a1ce7){if(_0x1a1ce7){return _0x489ef2[_0xe89f('0x1c')](_0x4617e7)[_0xe89f('0x1d')](_0x1a1ce7);}};}function respondWithFilteredResult(_0xf1d0bf,_0x2c82c3){return function(_0x38050e){if(_0x38050e){var _0x3de8a1=typeof _0x2c82c3[_0xe89f('0x1e')]===_0xe89f('0x1f')&&typeof _0x2c82c3['limit']===_0xe89f('0x1f');var _0x4683af=_0x38050e['count'];var _0x5106e4=_0x3de8a1?0x0:_0x2c82c3[_0xe89f('0x1e')];var _0x127517=_0x3de8a1?_0x38050e[_0xe89f('0x20')]:_0x2c82c3[_0xe89f('0x1e')]+_0x2c82c3[_0xe89f('0x21')];var _0x518a4a;if(_0x127517>=_0x4683af){_0x127517=_0x4683af;_0x518a4a=0xc8;}else{_0x518a4a=0xce;}_0xf1d0bf['status'](_0x518a4a);return _0xf1d0bf[_0xe89f('0x22')]('Content-Range',_0x5106e4+'-'+_0x127517+'/'+_0x4683af)[_0xe89f('0x1d')](_0x38050e);}return null;};}function patchUpdates(_0x33c584){return function(_0x43f2c6){try{jsonpatch[_0xe89f('0x23')](_0x43f2c6,_0x33c584,!![]);}catch(_0x1958a2){return BPromise[_0xe89f('0x24')](_0x1958a2);}return _0x43f2c6[_0xe89f('0x25')]();};}function saveUpdates(_0x559d84,_0x415505){return function(_0x5c97db){if(_0x5c97db){return _0x5c97db['update'](_0x559d84)['then'](function(_0x18b52e){return _0x18b52e;});}return null;};}function removeEntity(_0x5b548d,_0x24878d){return function(_0xe9e162){if(_0xe9e162){return _0xe9e162['destroy']()[_0xe89f('0x26')](function(){_0x5b548d[_0xe89f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7bff,_0x2bd661){return function(_0x38e552){if(!_0x38e552){_0x5d7bff[_0xe89f('0x1b')](0x194);}return _0x38e552;};}function handleError(_0x29b9ff,_0x288d8f){_0x288d8f=_0x288d8f||0x1f4;return function(_0x269b57){logger[_0xe89f('0x27')](_0x269b57['stack']);if(_0x269b57['name']){delete _0x269b57[_0xe89f('0x28')];}_0x29b9ff[_0xe89f('0x1c')](_0x288d8f)[_0xe89f('0x29')](_0x269b57);};}exports[_0xe89f('0x2a')]=function(_0x26604a,_0x5cf085){var _0x3c773c={},_0x31f4ec={},_0x29f7c2={'count':0x0,'rows':[]};var _0x2d5218=_[_0xe89f('0x2b')](db[_0xe89f('0x2c')][_0xe89f('0x2d')],function(_0x4e15dc){return{'name':_0x4e15dc[_0xe89f('0x2e')],'type':_0x4e15dc[_0xe89f('0x2f')]['key']};});_0x31f4ec[_0xe89f('0x30')]=_[_0xe89f('0x2b')](_0x2d5218,_0xe89f('0x28'));_0x31f4ec[_0xe89f('0x31')]=_[_0xe89f('0x32')](_0x26604a[_0xe89f('0x31')]);_0x31f4ec['filters']=_[_0xe89f('0x33')](_0x31f4ec[_0xe89f('0x30')],_0x31f4ec['query']);_0x3c773c[_0xe89f('0x34')]=_[_0xe89f('0x33')](_0x31f4ec[_0xe89f('0x30')],qs[_0xe89f('0x35')](_0x26604a[_0xe89f('0x31')][_0xe89f('0x35')]));_0x3c773c[_0xe89f('0x34')]=_0x3c773c[_0xe89f('0x34')][_0xe89f('0x36')]?_0x3c773c[_0xe89f('0x34')]:_0x31f4ec[_0xe89f('0x30')];if(!_0x26604a[_0xe89f('0x31')][_0xe89f('0x37')](_0xe89f('0x38'))){_0x3c773c['limit']=qs[_0xe89f('0x21')](_0x26604a['query'][_0xe89f('0x21')]);_0x3c773c[_0xe89f('0x1e')]=qs['offset'](_0x26604a[_0xe89f('0x31')]['offset']);}_0x3c773c[_0xe89f('0x39')]=qs[_0xe89f('0x3a')](_0x26604a[_0xe89f('0x31')][_0xe89f('0x3a')]);_0x3c773c[_0xe89f('0x3b')]=qs[_0xe89f('0x3c')](_[_0xe89f('0x3d')](_0x26604a['query'],_0x31f4ec[_0xe89f('0x3c')]),_0x2d5218);if(_0x26604a[_0xe89f('0x31')]['filter']){_0x3c773c[_0xe89f('0x3b')]=_[_0xe89f('0x3e')](_0x3c773c['where'],{'$or':_[_0xe89f('0x2b')](_0x2d5218,function(_0x29dcd7){if(_0x29dcd7[_0xe89f('0x2f')]!==_0xe89f('0x3f')){var _0x1ff534={};_0x1ff534[_0x29dcd7[_0xe89f('0x28')]]={'$like':'%'+_0x26604a[_0xe89f('0x31')][_0xe89f('0x40')]+'%'};return _0x1ff534;}})});}_0x3c773c=_[_0xe89f('0x3e')]({},_0x3c773c,_0x26604a[_0xe89f('0x41')]);var _0x9f1422={'where':_0x3c773c[_0xe89f('0x3b')]};return db[_0xe89f('0x2c')]['count'](_0x9f1422)[_0xe89f('0x26')](function(_0xe03c26){_0x29f7c2['count']=_0xe03c26;if(_0x26604a[_0xe89f('0x31')][_0xe89f('0x42')]){_0x3c773c[_0xe89f('0x43')]=[{'all':!![]}];}return db[_0xe89f('0x2c')][_0xe89f('0x44')](_0x3c773c);})[_0xe89f('0x26')](function(_0x1ff8d1){_0x29f7c2[_0xe89f('0x45')]=_0x1ff8d1;return _0x29f7c2;})[_0xe89f('0x26')](respondWithFilteredResult(_0x5cf085,_0x3c773c))[_0xe89f('0x46')](handleError(_0x5cf085,null));};exports[_0xe89f('0x47')]=function(_0x2a0567,_0x2b4229){var _0x1926f2={'raw':![],'where':{'id':_0x2a0567[_0xe89f('0x48')]['id']}},_0x15778c={};_0x15778c[_0xe89f('0x30')]=_[_0xe89f('0x32')](db[_0xe89f('0x2c')]['rawAttributes']);_0x15778c[_0xe89f('0x31')]=_[_0xe89f('0x32')](_0x2a0567[_0xe89f('0x31')]);_0x15778c['filters']=_[_0xe89f('0x33')](_0x15778c[_0xe89f('0x30')],_0x15778c[_0xe89f('0x31')]);_0x1926f2[_0xe89f('0x34')]=_[_0xe89f('0x33')](_0x15778c[_0xe89f('0x30')],qs[_0xe89f('0x35')](_0x2a0567[_0xe89f('0x31')][_0xe89f('0x35')]));_0x1926f2[_0xe89f('0x34')]=_0x1926f2[_0xe89f('0x34')][_0xe89f('0x36')]?_0x1926f2[_0xe89f('0x34')]:_0x15778c[_0xe89f('0x30')];if(_0x2a0567[_0xe89f('0x31')][_0xe89f('0x42')]){_0x1926f2[_0xe89f('0x43')]=[{'all':!![]}];}_0x1926f2=_[_0xe89f('0x3e')]({},_0x1926f2,_0x2a0567[_0xe89f('0x41')]);return db[_0xe89f('0x2c')][_0xe89f('0x49')](_0x1926f2)[_0xe89f('0x26')](handleEntityNotFound(_0x2b4229,null))[_0xe89f('0x26')](respondWithResult(_0x2b4229,null))[_0xe89f('0x46')](handleError(_0x2b4229,null));};exports[_0xe89f('0x4a')]=function(_0x2d19a7,_0x210995){return db[_0xe89f('0x2c')][_0xe89f('0x4a')](_0x2d19a7['body'],{})[_0xe89f('0x26')](respondWithResult(_0x210995,0xc9))[_0xe89f('0x46')](handleError(_0x210995,null));};exports[_0xe89f('0x4b')]=function(_0x2143ef,_0x5cee9e){if(_0x2143ef[_0xe89f('0x4c')]['id']){delete _0x2143ef[_0xe89f('0x4c')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x2143ef[_0xe89f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cee9e,null))[_0xe89f('0x26')](saveUpdates(_0x2143ef[_0xe89f('0x4c')],null))[_0xe89f('0x26')](respondWithResult(_0x5cee9e,null))['catch'](handleError(_0x5cee9e,null));};exports[_0xe89f('0x4d')]=function(_0x362855,_0x20128e){return db[_0xe89f('0x2c')][_0xe89f('0x49')]({'where':{'id':_0x362855[_0xe89f('0x48')]['id']}})[_0xe89f('0x26')](handleEntityNotFound(_0x20128e,null))[_0xe89f('0x26')](removeEntity(_0x20128e,null))[_0xe89f('0x46')](handleError(_0x20128e,null));};exports[_0xe89f('0x4e')]=function(_0x864d13,_0xbac93c,_0x43a5b9){var _0x33aee6={};var _0x37b7cc={};var _0x28076c;var _0x58cf10;return db['SugarcrmAccount'][_0xe89f('0x4f')]({'where':{'id':_0x864d13[_0xe89f('0x48')]['id']}})[_0xe89f('0x26')](handleEntityNotFound(_0xbac93c,null))[_0xe89f('0x26')](function(_0x2001ab){if(_0x2001ab){_0x28076c=_0x2001ab;_0x37b7cc['model']=_['keys'](db[_0xe89f('0x50')][_0xe89f('0x2d')]);_0x37b7cc[_0xe89f('0x31')]=_[_0xe89f('0x32')](_0x864d13['query']);_0x37b7cc['filters']=_[_0xe89f('0x33')](_0x37b7cc['model'],_0x37b7cc['query']);_0x33aee6[_0xe89f('0x34')]=_['intersection'](_0x37b7cc[_0xe89f('0x30')],qs[_0xe89f('0x35')](_0x864d13[_0xe89f('0x31')][_0xe89f('0x35')]));_0x33aee6[_0xe89f('0x34')]=_0x33aee6[_0xe89f('0x34')][_0xe89f('0x36')]?_0x33aee6[_0xe89f('0x34')]:_0x37b7cc['model'];_0x33aee6[_0xe89f('0x39')]=qs[_0xe89f('0x3a')](_0x864d13[_0xe89f('0x31')][_0xe89f('0x3a')]);_0x33aee6['where']=qs[_0xe89f('0x3c')](_[_0xe89f('0x3d')](_0x864d13[_0xe89f('0x31')],_0x37b7cc[_0xe89f('0x3c')]));if(_0x864d13[_0xe89f('0x31')][_0xe89f('0x40')]){_0x33aee6[_0xe89f('0x3b')]=_[_0xe89f('0x3e')](_0x33aee6[_0xe89f('0x3b')],{'$or':_[_0xe89f('0x2b')](_0x33aee6[_0xe89f('0x34')],function(_0x20c1e2){var _0xedf722={};_0xedf722[_0x20c1e2]={'$like':'%'+_0x864d13[_0xe89f('0x31')][_0xe89f('0x40')]+'%'};return _0xedf722;})});}_0x33aee6=_[_0xe89f('0x3e')]({},_0x33aee6,_0x864d13[_0xe89f('0x41')]);return _0x28076c['getConfigurations'](_0x33aee6);}})['then'](function(_0x59712a){if(_0x59712a){_0x58cf10=_0x59712a[_0xe89f('0x36')];if(!_0x864d13[_0xe89f('0x31')]['hasOwnProperty'](_0xe89f('0x38'))){_0x33aee6[_0xe89f('0x21')]=qs[_0xe89f('0x21')](_0x864d13['query'][_0xe89f('0x21')]);_0x33aee6[_0xe89f('0x1e')]=qs[_0xe89f('0x1e')](_0x864d13[_0xe89f('0x31')]['offset']);}return _0x28076c[_0xe89f('0x4e')](_0x33aee6);}})[_0xe89f('0x26')](function(_0x4ffbd2){if(_0x4ffbd2){return _0x4ffbd2?{'count':_0x58cf10,'rows':_0x4ffbd2}:null;}})[_0xe89f('0x26')](respondWithResult(_0xbac93c,null))[_0xe89f('0x46')](handleError(_0xbac93c,null));};exports[_0xe89f('0x51')]=function(_0x489f58,_0x3d82af,_0x569386){if(_0x489f58[_0xe89f('0x4c')]['id']){delete _0x489f58[_0xe89f('0x4c')]['id'];}return db[_0xe89f('0x2c')]['findOne']({'where':{'id':_0x489f58[_0xe89f('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d82af,null))[_0xe89f('0x26')](function(_0x4a2a00){if(_0x4a2a00){_0x489f58[_0xe89f('0x4c')][_0xe89f('0x52')]=_0x4a2a00['id'];_0x489f58[_0xe89f('0x4c')][_0xe89f('0x53')]=integrations['getSubjects'](_0x489f58[_0xe89f('0x4c')][_0xe89f('0x54')],_0x489f58[_0xe89f('0x4c')]['type']);_0x489f58['body'][_0xe89f('0x55')]=integrations[_0xe89f('0x56')](_0x489f58[_0xe89f('0x4c')]['channel'],_0x489f58[_0xe89f('0x4c')]['type']);return db[_0xe89f('0x50')][_0xe89f('0x4a')](_0x489f58[_0xe89f('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':_0xe89f('0x53')},{'model':db[_0xe89f('0x57')],'as':_0xe89f('0x55')}]});}return null;})[_0xe89f('0x26')](respondWithResult(_0x3d82af,null))[_0xe89f('0x46')](handleError(_0x3d82af,null));};exports[_0xe89f('0x58')]=function(_0x459d65,_0x2766b5,_0x1182b5){var _0xcc4143='';var _0x4cff37=['id',_0xe89f('0x28'),_0xe89f('0x59'),_0xe89f('0x5a'),'description',_0xe89f('0x5b'),'duration_hours',_0xe89f('0x5c'),'parent_id',_0xe89f('0x5d'),'parent_name','direction'];return db[_0xe89f('0x2c')][_0xe89f('0x4f')]({'where':{'id':_0x459d65[_0xe89f('0x48')]['id']},'attributes':['id',_0xe89f('0x5e'),_0xe89f('0x5f'),_0xe89f('0x60')]})[_0xe89f('0x26')](handleEntityNotFound(_0x2766b5,null))[_0xe89f('0x26')](function(_0x1a4589){if(_0x1a4589){_0xcc4143=_0x1a4589['remoteUri'];var _0x5e1f3e=_0xcc4143[_0xe89f('0x61')](-0x1);if(_0x5e1f3e==='/'){_0xcc4143=_0xcc4143[_0xe89f('0x62')](0x0,_0xcc4143['lastIndexOf'](_0x5e1f3e));}return rp({'method':_0xe89f('0x63'),'uri':util[_0xe89f('0x64')](_0xe89f('0x65'),_0xcc4143,_0xe89f('0x66')),'json':!![],'form':{'method':'login','input_type':_0xe89f('0x67'),'response_type':_0xe89f('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1a4589[_0xe89f('0x5e')],'password':_0x1a4589[_0xe89f('0x5f')],'encryption':_0xe89f('0x68')},'application':_0xe89f('0x69')})}});}})['then'](function(_0x666f16){if(_0x666f16&&_0x666f16[_0xe89f('0x28')]!=='Invalid\x20Login'&&_0x666f16['name']!==_0xe89f('0x6a')){return rp({'method':_0xe89f('0x63'),'uri':util[_0xe89f('0x64')]('%s%s',_0xcc4143,_0xe89f('0x66')),'json':!![],'form':{'method':_0xe89f('0x6b'),'input_type':_0xe89f('0x67'),'response_type':'JSON','rest_data':JSON[_0xe89f('0x6c')]({'session':_0x666f16['id'],'module_name':_0xe89f('0x6d')})}})[_0xe89f('0x26')](function(_0x47e4d4){if(_0x47e4d4){var _0x560ea4=_['values'](_0x47e4d4[_0xe89f('0x6e')]);_[_0xe89f('0x6f')](_0x560ea4,function(_0x501b76){return _0x4cff37[_0xe89f('0x70')](_0x501b76['name']);});return{'count':_0x560ea4[_0xe89f('0x36')],'rows':_[_0xe89f('0x2b')](_0x560ea4,function(_0x496bd3){return{'id':_0x496bd3[_0xe89f('0x28')],'name':_0x496bd3['label'],'custom':_[_0xe89f('0x71')](_0x496bd3[_0xe89f('0x28')],'_c')?!![]:![],'options':_0x496bd3[_0xe89f('0x41')]?_[_0xe89f('0x2b')](_[_0xe89f('0x72')](_0x496bd3['options']),function(_0x5529ab){return{'name':_0x5529ab[_0xe89f('0x73')],'value':_0x5529ab[_0xe89f('0x28')]};}):[]};})};}})[_0xe89f('0x26')](respondWithResult(_0x2766b5,null))[_0xe89f('0x46')](function(_0x41d22b){var _0x471731=_0x459d65[_0xe89f('0x31')][_0xe89f('0x74')]?0x1f4:_0x41d22b['statusCode']||0x1f4;logger[_0xe89f('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xe89f('0x58'),_0x471731,JSON[_0xe89f('0x6c')](_0x41d22b));delete _0x41d22b[_0xe89f('0x28')];if(_0x471731===0x191){_0x471731=0x190;}_0x2766b5[_0xe89f('0x1c')](_0x471731)[_0xe89f('0x29')](_0x459d65[_0xe89f('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x41d22b['statusCode']}:_0x41d22b);});}else{var _0x1e1fc5=0x1f4;_0x2766b5[_0xe89f('0x1c')](_0x1e1fc5)[_0xe89f('0x29')]({'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 d4e9001..68a150e 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 _0xa8e4=['api','moment','path','rimraf','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','../../config/logger'];(function(_0x2edfb3,_0x1267bd){var _0x3df862=function(_0x5f5bd7){while(--_0x5f5bd7){_0x2edfb3['push'](_0x2edfb3['shift']());}};_0x3df862(++_0x1267bd);}(_0xa8e4,0x148));var _0x4a8e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xa8e4[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x4a8e('0x0'));var util=require('util');var logger=require(_0x4a8e('0x1'))(_0x4a8e('0x2'));var moment=require(_0x4a8e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a8e('0x4'));var rimraf=require(_0x4a8e('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x4a8e('0x6'));module[_0x4a8e('0x7')]=function(_0x9cc874,_0x1906ce){return _0x9cc874[_0x4a8e('0x8')](_0x4a8e('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa25=['rimraf','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x547f01,_0x53ed31){var _0x36ad2e=function(_0x2c702f){while(--_0x2c702f){_0x547f01['push'](_0x547f01['shift']());}};_0x36ad2e(++_0x53ed31);}(_0xfa25,0xd1));var _0x5fa2=function(_0x15fbb3,_0x1ba639){_0x15fbb3=_0x15fbb3-0x0;var _0x31614e=_0xfa25[_0x15fbb3];return _0x31614e;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var logger=require(_0x5fa2('0x1'))(_0x5fa2('0x2'));var moment=require(_0x5fa2('0x3'));var BPromise=require(_0x5fa2('0x4'));var rp=require(_0x5fa2('0x5'));var fs=require('fs');var path=require(_0x5fa2('0x6'));var rimraf=require(_0x5fa2('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5fa2('0x8'));module[_0x5fa2('0x9')]=function(_0x479b86,_0x53a560){return _0x479b86[_0x5fa2('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x5fa2('0xb'),'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 df7b4ea..6e06c9d 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 _0xc359=['error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','model','include','stringify','ShowSugarcrmAccount','find','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x419070,_0x2b567f){var _0x13ac75=function(_0x130fcb){while(--_0x130fcb){_0x419070['push'](_0x419070['shift']());}};_0x13ac75(++_0x2b567f);}(_0xc359,0x1cd));var _0x9c35=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xc359[_0x284a61];return _0x220e3c;};'use strict';var _=require(_0x9c35('0x0'));var util=require(_0x9c35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9c35('0x2'));var fs=require('fs');var Redis=require(_0x9c35('0x3'));var db=require(_0x9c35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c35('0x5'))('rpc');var config=require(_0x9c35('0x6'));var jayson=require(_0x9c35('0x7'));var client=jayson['client'][_0x9c35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f376a,_0x535e6c,_0x4c5c9e){return new BPromise(function(_0x5b2841,_0x4a84e7){return client[_0x9c35('0x9')](_0x3f376a,_0x4c5c9e)['then'](function(_0x547c65){logger[_0x9c35('0xa')](_0x9c35('0xb'),_0x535e6c,_0x9c35('0xc'));logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x535e6c,_0x9c35('0xc'),JSON['stringify'](_0x547c65));if(_0x547c65[_0x9c35('0xf')]){if(_0x547c65[_0x9c35('0xf')][_0x9c35('0x10')]===0x1f4){logger[_0x9c35('0xf')](_0x9c35('0xb'),_0x535e6c,_0x547c65[_0x9c35('0xf')][_0x9c35('0x11')]);return _0x4a84e7(_0x547c65[_0x9c35('0xf')][_0x9c35('0x11')]);}logger[_0x9c35('0xf')](_0x9c35('0xb'),_0x535e6c,_0x547c65[_0x9c35('0xf')][_0x9c35('0x11')]);return _0x5b2841(_0x547c65['error'][_0x9c35('0x11')]);}else{logger[_0x9c35('0xa')](_0x9c35('0xb'),_0x535e6c,_0x9c35('0xc'));_0x5b2841(_0x547c65['result'][_0x9c35('0x11')]);}})[_0x9c35('0x12')](function(_0x1e1001){logger[_0x9c35('0xf')](_0x9c35('0xb'),_0x535e6c,_0x1e1001);_0x4a84e7(_0x1e1001);});});}exports[_0x9c35('0x13')]=function(_0xedd939){var _0xb0839=this;return new Promise(function(_0x5aa269,_0x325656){return db[_0x9c35('0x14')][_0x9c35('0x15')]({'raw':_0xedd939[_0x9c35('0x16')]?_0xedd939[_0x9c35('0x16')][_0x9c35('0x17')]===undefined?!![]:![]:!![],'where':_0xedd939['options']?_0xedd939['options'][_0x9c35('0x18')]||null:null,'attributes':_0xedd939[_0x9c35('0x16')]?_0xedd939[_0x9c35('0x16')][_0x9c35('0x19')]||null:null,'limit':_0xedd939['options']?_0xedd939[_0x9c35('0x16')][_0x9c35('0x1a')]||null:null,'include':_0xedd939[_0x9c35('0x16')]?_0xedd939[_0x9c35('0x16')]['include']?_[_0x9c35('0x1b')](_0xedd939[_0x9c35('0x16')]['include'],function(_0x5cf0ce){return{'model':db[_0x5cf0ce[_0x9c35('0x1c')]],'as':_0x5cf0ce['as'],'attributes':_0x5cf0ce['attributes'],'include':_0x5cf0ce[_0x9c35('0x1d')]?_[_0x9c35('0x1b')](_0x5cf0ce[_0x9c35('0x1d')],function(_0x343134){return{'model':db[_0x343134['model']],'as':_0x343134['as'],'attributes':_0x343134[_0x9c35('0x19')],'include':_0x343134[_0x9c35('0x1d')]?_[_0x9c35('0x1b')](_0x343134['include'],function(_0x52ca71){return{'model':db[_0x52ca71['model']],'as':_0x52ca71['as'],'attributes':_0x52ca71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x263301){logger[_0x9c35('0xa')](_0x9c35('0x13'),_0xedd939);logger['debug'](_0x9c35('0x13'),_0xedd939,JSON[_0x9c35('0x1e')](_0x263301));_0x5aa269(_0x263301);})[_0x9c35('0x12')](function(_0x3bcf86){logger['error'](_0x9c35('0x13'),_0x3bcf86[_0x9c35('0x11')],_0xedd939);_0x325656(_0xb0839[_0x9c35('0xf')](0x1f4,_0x3bcf86['message']));});});};exports[_0x9c35('0x1f')]=function(_0x2ab95e){var _0x2d4464=this;return new Promise(function(_0x8edbd8,_0x1bda33){return db[_0x9c35('0x14')][_0x9c35('0x20')]({'raw':_0x2ab95e[_0x9c35('0x16')]?_0x2ab95e[_0x9c35('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2ab95e[_0x9c35('0x16')]?_0x2ab95e[_0x9c35('0x16')]['where']||null:null,'attributes':_0x2ab95e[_0x9c35('0x16')]?_0x2ab95e[_0x9c35('0x16')][_0x9c35('0x19')]||null:null,'include':_0x2ab95e[_0x9c35('0x16')]?_0x2ab95e[_0x9c35('0x16')][_0x9c35('0x1d')]?_[_0x9c35('0x1b')](_0x2ab95e[_0x9c35('0x16')][_0x9c35('0x1d')],function(_0x6501c8){return{'model':db[_0x6501c8[_0x9c35('0x1c')]],'as':_0x6501c8['as'],'attributes':_0x6501c8[_0x9c35('0x19')],'include':_0x6501c8[_0x9c35('0x1d')]?_[_0x9c35('0x1b')](_0x6501c8[_0x9c35('0x1d')],function(_0x1449eb){return{'model':db[_0x1449eb['model']],'as':_0x1449eb['as'],'attributes':_0x1449eb[_0x9c35('0x19')],'include':_0x1449eb[_0x9c35('0x1d')]?_[_0x9c35('0x1b')](_0x1449eb['include'],function(_0x22d331){return{'model':db[_0x22d331['model']],'as':_0x22d331['as'],'attributes':_0x22d331['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c35('0x21')](function(_0x664467){logger[_0x9c35('0xa')](_0x9c35('0x1f'),_0x2ab95e);logger[_0x9c35('0xd')](_0x9c35('0x1f'),_0x2ab95e,JSON[_0x9c35('0x1e')](_0x664467));_0x8edbd8(_0x664467);})[_0x9c35('0x12')](function(_0x2ebf03){logger[_0x9c35('0xf')](_0x9c35('0x1f'),_0x2ebf03['message'],_0x2ab95e);_0x1bda33(_0x2d4464['error'](0x1f4,_0x2ebf03[_0x9c35('0x11')]));});});}; \ No newline at end of file +var _0x18f9=['raw','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','include','model','map','then','find'];(function(_0x13b1ff,_0x4d5d86){var _0x1366c0=function(_0x4ec7c5){while(--_0x4ec7c5){_0x13b1ff['push'](_0x13b1ff['shift']());}};_0x1366c0(++_0x4d5d86);}(_0x18f9,0x134));var _0x918f=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x18f9[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x918f('0x0'));var util=require(_0x918f('0x1'));var moment=require('moment');var BPromise=require(_0x918f('0x2'));var rs=require(_0x918f('0x3'));var fs=require('fs');var Redis=require(_0x918f('0x4'));var db=require(_0x918f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x918f('0x6'))('rpc');var config=require(_0x918f('0x7'));var jayson=require(_0x918f('0x8'));var client=jayson[_0x918f('0x9')][_0x918f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42dcf9,_0x2051db,_0xa24004){return new BPromise(function(_0x4ba9af,_0x5589f5){return client[_0x918f('0xb')](_0x42dcf9,_0xa24004)['then'](function(_0x21534b){logger[_0x918f('0xc')](_0x918f('0xd'),_0x2051db,_0x918f('0xe'));logger[_0x918f('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2051db,'request\x20sent',JSON[_0x918f('0x10')](_0x21534b));if(_0x21534b[_0x918f('0x11')]){if(_0x21534b[_0x918f('0x11')][_0x918f('0x12')]===0x1f4){logger[_0x918f('0x11')](_0x918f('0xd'),_0x2051db,_0x21534b[_0x918f('0x11')]['message']);return _0x5589f5(_0x21534b[_0x918f('0x11')][_0x918f('0x13')]);}logger[_0x918f('0x11')](_0x918f('0xd'),_0x2051db,_0x21534b[_0x918f('0x11')]['message']);return _0x4ba9af(_0x21534b[_0x918f('0x11')][_0x918f('0x13')]);}else{logger[_0x918f('0xc')](_0x918f('0xd'),_0x2051db,_0x918f('0xe'));_0x4ba9af(_0x21534b[_0x918f('0x14')][_0x918f('0x13')]);}})[_0x918f('0x15')](function(_0x572ad0){logger[_0x918f('0x11')](_0x918f('0xd'),_0x2051db,_0x572ad0);_0x5589f5(_0x572ad0);});});}exports[_0x918f('0x16')]=function(_0x406c08){var _0x292927=this;return new Promise(function(_0x54d77c,_0x3cbf3e){return db[_0x918f('0x17')]['findAll']({'raw':_0x406c08[_0x918f('0x18')]?_0x406c08[_0x918f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x406c08[_0x918f('0x18')]?_0x406c08['options'][_0x918f('0x19')]||null:null,'attributes':_0x406c08[_0x918f('0x18')]?_0x406c08[_0x918f('0x18')][_0x918f('0x1a')]||null:null,'limit':_0x406c08['options']?_0x406c08['options']['limit']||null:null,'include':_0x406c08[_0x918f('0x18')]?_0x406c08[_0x918f('0x18')][_0x918f('0x1b')]?_['map'](_0x406c08[_0x918f('0x18')][_0x918f('0x1b')],function(_0x59157e){return{'model':db[_0x59157e[_0x918f('0x1c')]],'as':_0x59157e['as'],'attributes':_0x59157e[_0x918f('0x1a')],'include':_0x59157e['include']?_['map'](_0x59157e[_0x918f('0x1b')],function(_0x2984cf){return{'model':db[_0x2984cf['model']],'as':_0x2984cf['as'],'attributes':_0x2984cf[_0x918f('0x1a')],'include':_0x2984cf[_0x918f('0x1b')]?_[_0x918f('0x1d')](_0x2984cf[_0x918f('0x1b')],function(_0x5111a8){return{'model':db[_0x5111a8[_0x918f('0x1c')]],'as':_0x5111a8['as'],'attributes':_0x5111a8[_0x918f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x918f('0x1e')](function(_0x45971b){logger['info'](_0x918f('0x16'),_0x406c08);logger[_0x918f('0xf')](_0x918f('0x16'),_0x406c08,JSON[_0x918f('0x10')](_0x45971b));_0x54d77c(_0x45971b);})[_0x918f('0x15')](function(_0x5dcc25){logger['error']('GetSugarcrmAccount',_0x5dcc25['message'],_0x406c08);_0x3cbf3e(_0x292927[_0x918f('0x11')](0x1f4,_0x5dcc25[_0x918f('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x57f492){var _0x57eb0a=this;return new Promise(function(_0x163c5a,_0x24f06e){return db['SugarcrmAccount'][_0x918f('0x1f')]({'raw':_0x57f492[_0x918f('0x18')]?_0x57f492[_0x918f('0x18')][_0x918f('0x20')]===undefined?!![]:![]:!![],'where':_0x57f492['options']?_0x57f492[_0x918f('0x18')]['where']||null:null,'attributes':_0x57f492[_0x918f('0x18')]?_0x57f492['options']['attributes']||null:null,'include':_0x57f492[_0x918f('0x18')]?_0x57f492[_0x918f('0x18')]['include']?_[_0x918f('0x1d')](_0x57f492[_0x918f('0x18')]['include'],function(_0x16f25e){return{'model':db[_0x16f25e['model']],'as':_0x16f25e['as'],'attributes':_0x16f25e[_0x918f('0x1a')],'include':_0x16f25e[_0x918f('0x1b')]?_[_0x918f('0x1d')](_0x16f25e[_0x918f('0x1b')],function(_0x2e9097){return{'model':db[_0x2e9097[_0x918f('0x1c')]],'as':_0x2e9097['as'],'attributes':_0x2e9097[_0x918f('0x1a')],'include':_0x2e9097[_0x918f('0x1b')]?_[_0x918f('0x1d')](_0x2e9097[_0x918f('0x1b')],function(_0x40081d){return{'model':db[_0x40081d['model']],'as':_0x40081d['as'],'attributes':_0x40081d[_0x918f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x918f('0x1e')](function(_0x59117c){logger[_0x918f('0xc')](_0x918f('0x21'),_0x57f492);logger[_0x918f('0xf')](_0x918f('0x21'),_0x57f492,JSON[_0x918f('0x10')](_0x59117c));_0x163c5a(_0x59117c);})['catch'](function(_0x5ba404){logger[_0x918f('0x11')](_0x918f('0x21'),_0x5ba404[_0x918f('0x13')],_0x57f492);_0x24f06e(_0x57eb0a['error'](0x1f4,_0x5ba404[_0x918f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 20e69ec..c188fe7 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 _0x9559=['exports','util','path','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','put','update','destroy'];(function(_0x57f1f5,_0x3c9a1d){var _0x1239c1=function(_0x9b724d){while(--_0x9b724d){_0x57f1f5['push'](_0x57f1f5['shift']());}};_0x1239c1(++_0x3c9a1d);}(_0x9559,0x91));var _0x9955=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x9559[_0x810025];return _0x4dbc81;};'use strict';var multer=require('multer');var util=require(_0x9955('0x0'));var path=require(_0x9955('0x1'));var timeout=require('connect-timeout');var express=require(_0x9955('0x2'));var router=express[_0x9955('0x3')]();var fs_extra=require(_0x9955('0x4'));var auth=require(_0x9955('0x5'));var interaction=require(_0x9955('0x6'));var config=require(_0x9955('0x7'));var controller=require(_0x9955('0x8'));router[_0x9955('0x9')]('/',auth[_0x9955('0xa')](),controller[_0x9955('0xb')]);router[_0x9955('0x9')](_0x9955('0xc'),auth['isAuthenticated'](),controller[_0x9955('0xd')]);router[_0x9955('0x9')](_0x9955('0xe'),auth[_0x9955('0xa')](),controller[_0x9955('0xf')]);router['get']('/:id/subjects',auth[_0x9955('0xa')](),controller[_0x9955('0x10')]);router[_0x9955('0x9')](_0x9955('0x11'),auth[_0x9955('0xa')](),controller[_0x9955('0x12')]);router[_0x9955('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9955('0x14')]('/:id',auth[_0x9955('0xa')](),controller[_0x9955('0x15')]);router['delete'](_0x9955('0xc'),auth['isAuthenticated'](),controller[_0x9955('0x16')]);module[_0x9955('0x17')]=router; \ No newline at end of file +var _0xbfca=['put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x32dd30,_0x341081){var _0x2eceb8=function(_0x216937){while(--_0x216937){_0x32dd30['push'](_0x32dd30['shift']());}};_0x2eceb8(++_0x341081);}(_0xbfca,0x169));var _0xabfc=function(_0x270416,_0x4e9e3e){_0x270416=_0x270416-0x0;var _0x24799b=_0xbfca[_0x270416];return _0x24799b;};'use strict';var multer=require(_0xabfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xabfc('0x1'));var express=require('express');var router=express[_0xabfc('0x2')]();var fs_extra=require(_0xabfc('0x3'));var auth=require(_0xabfc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xabfc('0x5'));var controller=require(_0xabfc('0x6'));router[_0xabfc('0x7')]('/',auth[_0xabfc('0x8')](),controller['index']);router[_0xabfc('0x7')](_0xabfc('0x9'),auth[_0xabfc('0x8')](),controller['show']);router[_0xabfc('0x7')](_0xabfc('0xa'),auth['isAuthenticated'](),controller[_0xabfc('0xb')]);router[_0xabfc('0x7')](_0xabfc('0xc'),auth[_0xabfc('0x8')](),controller[_0xabfc('0xd')]);router[_0xabfc('0x7')]('/:id/descriptions',auth[_0xabfc('0x8')](),controller[_0xabfc('0xe')]);router[_0xabfc('0xf')]('/',auth[_0xabfc('0x8')](),controller[_0xabfc('0x10')]);router[_0xabfc('0x11')]('/:id',auth[_0xabfc('0x8')](),controller[_0xabfc('0x12')]);router[_0xabfc('0x13')](_0xabfc('0x9'),auth[_0xabfc('0x8')](),controller[_0xabfc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 822388a..30a0aa3 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 _0xf2ab=['STRING','sequelize','exports'];(function(_0x17efa3,_0x39ef4b){var _0x5caced=function(_0x29e599){while(--_0x29e599){_0x17efa3['push'](_0x17efa3['shift']());}};_0x5caced(++_0x39ef4b);}(_0xf2ab,0x1de));var _0xbf2a=function(_0x28b295,_0x30dda3){_0x28b295=_0x28b295-0x0;var _0x4b070f=_0xf2ab[_0x28b295];return _0x4b070f;};'use strict';var Sequelize=require(_0xbf2a('0x0'));module[_0xbf2a('0x1')]={'name':{'type':Sequelize[_0xbf2a('0x2')]},'description':{'type':Sequelize[_0xbf2a('0x2')]}}; \ No newline at end of file +var _0x8e09=['exports','STRING','sequelize'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8e09,0x8c));var _0x98e0=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x8e09[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x98e0('0x0'));module[_0x98e0('0x1')]={'name':{'type':Sequelize[_0x98e0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d1c5f3e..3245bcb 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 _0x8ae0=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','map','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','SugarcrmField','order','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x8ae0,0xc8));var _0x08ae=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8ae0[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x08ae('0x0'));var rimraf=require(_0x08ae('0x1'));var zipdir=require(_0x08ae('0x2'));var jsonpatch=require(_0x08ae('0x3'));var rp=require(_0x08ae('0x4'));var moment=require(_0x08ae('0x5'));var BPromise=require(_0x08ae('0x6'));var Mustache=require(_0x08ae('0x7'));var util=require(_0x08ae('0x8'));var path=require(_0x08ae('0x9'));var sox=require(_0x08ae('0xa'));var csv=require(_0x08ae('0xb'));var ejs=require(_0x08ae('0xc'));var fs=require('fs');var fs_extra=require(_0x08ae('0xd'));var _=require(_0x08ae('0xe'));var squel=require(_0x08ae('0xf'));var crypto=require(_0x08ae('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x08ae('0x11'));var toCsv=require(_0x08ae('0xb'));var querystring=require(_0x08ae('0x12'));var Papa=require(_0x08ae('0x13'));var Redis=require(_0x08ae('0x14'));var authService=require(_0x08ae('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x08ae('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08ae('0x17'))('api');var utils=require(_0x08ae('0x18'));var config=require(_0x08ae('0x19'));var licenseUtil=require(_0x08ae('0x1a'));var db=require(_0x08ae('0x1b'))['db'];function respondWithStatusCode(_0x57ca9e,_0x1f9de4){_0x1f9de4=_0x1f9de4||0xcc;return function(_0x850d97){if(_0x850d97){return _0x57ca9e[_0x08ae('0x1c')](_0x1f9de4);}return _0x57ca9e['status'](_0x1f9de4)[_0x08ae('0x1d')]();};}function respondWithResult(_0x30ff62,_0x5edfb1){_0x5edfb1=_0x5edfb1||0xc8;return function(_0x435750){if(_0x435750){return _0x30ff62[_0x08ae('0x1e')](_0x5edfb1)[_0x08ae('0x1f')](_0x435750);}};}function respondWithFilteredResult(_0x422315,_0x986a15){return function(_0x1c590f){if(_0x1c590f){var _0x15d787=typeof _0x986a15[_0x08ae('0x20')]===_0x08ae('0x21')&&typeof _0x986a15['limit']==='undefined';var _0x3d90a8=_0x1c590f[_0x08ae('0x22')];var _0x9c195f=_0x15d787?0x0:_0x986a15[_0x08ae('0x20')];var _0x2da95f=_0x15d787?_0x1c590f[_0x08ae('0x22')]:_0x986a15[_0x08ae('0x20')]+_0x986a15['limit'];var _0x1ca53a;if(_0x2da95f>=_0x3d90a8){_0x2da95f=_0x3d90a8;_0x1ca53a=0xc8;}else{_0x1ca53a=0xce;}_0x422315[_0x08ae('0x1e')](_0x1ca53a);return _0x422315['set'](_0x08ae('0x23'),_0x9c195f+'-'+_0x2da95f+'/'+_0x3d90a8)[_0x08ae('0x1f')](_0x1c590f);}return null;};}function patchUpdates(_0x3589b0){return function(_0x303b26){try{jsonpatch[_0x08ae('0x24')](_0x303b26,_0x3589b0,!![]);}catch(_0x1c3c1e){return BPromise[_0x08ae('0x25')](_0x1c3c1e);}return _0x303b26['save']();};}function saveUpdates(_0x5c641a,_0x16f1c3){return function(_0x2700a3){if(_0x2700a3){return _0x2700a3[_0x08ae('0x26')](_0x5c641a)[_0x08ae('0x27')](function(_0x12d54d){return _0x12d54d;});}return null;};}function removeEntity(_0x4198c2,_0x3e2845){return function(_0x332078){if(_0x332078){return _0x332078[_0x08ae('0x28')]()[_0x08ae('0x27')](function(){_0x4198c2[_0x08ae('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3cba,_0x27ff99){return function(_0x1a9ae8){if(!_0x1a9ae8){_0x4d3cba[_0x08ae('0x1c')](0x194);}return _0x1a9ae8;};}function handleError(_0x34caec,_0x131c64){_0x131c64=_0x131c64||0x1f4;return function(_0x120c66){logger[_0x08ae('0x29')](_0x120c66[_0x08ae('0x2a')]);if(_0x120c66[_0x08ae('0x2b')]){delete _0x120c66[_0x08ae('0x2b')];}_0x34caec[_0x08ae('0x1e')](_0x131c64)[_0x08ae('0x2c')](_0x120c66);};}exports[_0x08ae('0x2d')]=function(_0x15bf8d,_0x40ec18){var _0x2a7222={},_0x5146f6={},_0x12c9d2={'count':0x0,'rows':[]};var _0x371e1b=_['map'](db[_0x08ae('0x2e')][_0x08ae('0x2f')],function(_0x30e578){return{'name':_0x30e578[_0x08ae('0x30')],'type':_0x30e578[_0x08ae('0x31')][_0x08ae('0x32')]};});_0x5146f6['model']=_['map'](_0x371e1b,_0x08ae('0x2b'));_0x5146f6[_0x08ae('0x33')]=_[_0x08ae('0x34')](_0x15bf8d['query']);_0x5146f6[_0x08ae('0x35')]=_[_0x08ae('0x36')](_0x5146f6[_0x08ae('0x37')],_0x5146f6[_0x08ae('0x33')]);_0x2a7222[_0x08ae('0x38')]=_['intersection'](_0x5146f6[_0x08ae('0x37')],qs['fields'](_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x39')]));_0x2a7222[_0x08ae('0x38')]=_0x2a7222[_0x08ae('0x38')][_0x08ae('0x3a')]?_0x2a7222[_0x08ae('0x38')]:_0x5146f6[_0x08ae('0x37')];if(!_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x3b')](_0x08ae('0x3c'))){_0x2a7222[_0x08ae('0x3d')]=qs[_0x08ae('0x3d')](_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x3d')]);_0x2a7222[_0x08ae('0x20')]=qs['offset'](_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x20')]);}_0x2a7222['order']=qs[_0x08ae('0x3e')](_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x3e')]);_0x2a7222['where']=qs['filters'](_[_0x08ae('0x3f')](_0x15bf8d['query'],_0x5146f6[_0x08ae('0x35')]),_0x371e1b);if(_0x15bf8d['query']['filter']){_0x2a7222[_0x08ae('0x40')]=_['merge'](_0x2a7222[_0x08ae('0x40')],{'$or':_[_0x08ae('0x41')](_0x371e1b,function(_0x116428){if(_0x116428[_0x08ae('0x31')]!==_0x08ae('0x42')){var _0x4bde06={};_0x4bde06[_0x116428['name']]={'$like':'%'+_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x43')]+'%'};return _0x4bde06;}})});}_0x2a7222=_[_0x08ae('0x44')]({},_0x2a7222,_0x15bf8d['options']);var _0x4130fc={'where':_0x2a7222[_0x08ae('0x40')]};return db[_0x08ae('0x2e')]['count'](_0x4130fc)[_0x08ae('0x27')](function(_0x1b8074){_0x12c9d2[_0x08ae('0x22')]=_0x1b8074;if(_0x15bf8d[_0x08ae('0x33')][_0x08ae('0x45')]){_0x2a7222[_0x08ae('0x46')]=[{'all':!![]}];}return db[_0x08ae('0x2e')][_0x08ae('0x47')](_0x2a7222);})[_0x08ae('0x27')](function(_0x4eb93a){_0x12c9d2[_0x08ae('0x48')]=_0x4eb93a;return _0x12c9d2;})['then'](respondWithFilteredResult(_0x40ec18,_0x2a7222))[_0x08ae('0x49')](handleError(_0x40ec18,null));};exports[_0x08ae('0x4a')]=function(_0x5b1f69,_0x33b6ce){var _0x1704d3={'raw':![],'where':{'id':_0x5b1f69[_0x08ae('0x4b')]['id']}},_0x5f265b={};_0x5f265b[_0x08ae('0x37')]=_[_0x08ae('0x34')](db[_0x08ae('0x2e')]['rawAttributes']);_0x5f265b[_0x08ae('0x33')]=_[_0x08ae('0x34')](_0x5b1f69['query']);_0x5f265b['filters']=_[_0x08ae('0x36')](_0x5f265b[_0x08ae('0x37')],_0x5f265b['query']);_0x1704d3[_0x08ae('0x38')]=_[_0x08ae('0x36')](_0x5f265b[_0x08ae('0x37')],qs[_0x08ae('0x39')](_0x5b1f69[_0x08ae('0x33')][_0x08ae('0x39')]));_0x1704d3[_0x08ae('0x38')]=_0x1704d3['attributes'][_0x08ae('0x3a')]?_0x1704d3[_0x08ae('0x38')]:_0x5f265b[_0x08ae('0x37')];if(_0x5b1f69[_0x08ae('0x33')][_0x08ae('0x45')]){_0x1704d3[_0x08ae('0x46')]=[{'all':!![]}];}_0x1704d3=_[_0x08ae('0x44')]({},_0x1704d3,_0x5b1f69[_0x08ae('0x4c')]);return db[_0x08ae('0x2e')][_0x08ae('0x4d')](_0x1704d3)[_0x08ae('0x27')](handleEntityNotFound(_0x33b6ce,null))[_0x08ae('0x27')](respondWithResult(_0x33b6ce,null))[_0x08ae('0x49')](handleError(_0x33b6ce,null));};exports[_0x08ae('0x4e')]=function(_0x5b3ca6,_0x5ac8e3){return db[_0x08ae('0x2e')]['create'](_0x5b3ca6[_0x08ae('0x4f')],{})[_0x08ae('0x27')](respondWithResult(_0x5ac8e3,0xc9))['catch'](handleError(_0x5ac8e3,null));};exports['update']=function(_0xcaab9d,_0xa578b4){if(_0xcaab9d[_0x08ae('0x4f')]['id']){delete _0xcaab9d[_0x08ae('0x4f')]['id'];}return db[_0x08ae('0x2e')][_0x08ae('0x4d')]({'where':{'id':_0xcaab9d[_0x08ae('0x4b')]['id']}})[_0x08ae('0x27')](handleEntityNotFound(_0xa578b4,null))[_0x08ae('0x27')](saveUpdates(_0xcaab9d[_0x08ae('0x4f')],null))[_0x08ae('0x27')](respondWithResult(_0xa578b4,null))[_0x08ae('0x49')](handleError(_0xa578b4,null));};exports['destroy']=function(_0x5a3045,_0x757266){return db[_0x08ae('0x2e')][_0x08ae('0x4d')]({'where':{'id':_0x5a3045[_0x08ae('0x4b')]['id']}})[_0x08ae('0x27')](handleEntityNotFound(_0x757266,null))[_0x08ae('0x27')](removeEntity(_0x757266,null))['catch'](handleError(_0x757266,null));};exports[_0x08ae('0x50')]=function(_0xdcad90,_0x26d23b,_0x21c6d7){var _0x25fbdc={};var _0x151cf4={};var _0x5aee08;var _0x19e40c;return db[_0x08ae('0x2e')][_0x08ae('0x51')]({'where':{'id':_0xdcad90[_0x08ae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26d23b,null))['then'](function(_0x3d83d9){if(_0x3d83d9){_0x5aee08=_0x3d83d9;_0x151cf4['model']=_[_0x08ae('0x34')](db[_0x08ae('0x52')]['rawAttributes']);_0x151cf4[_0x08ae('0x33')]=_[_0x08ae('0x34')](_0xdcad90[_0x08ae('0x33')]);_0x151cf4[_0x08ae('0x35')]=_[_0x08ae('0x36')](_0x151cf4[_0x08ae('0x37')],_0x151cf4[_0x08ae('0x33')]);_0x25fbdc[_0x08ae('0x38')]=_[_0x08ae('0x36')](_0x151cf4[_0x08ae('0x37')],qs[_0x08ae('0x39')](_0xdcad90[_0x08ae('0x33')]['fields']));_0x25fbdc[_0x08ae('0x38')]=_0x25fbdc[_0x08ae('0x38')][_0x08ae('0x3a')]?_0x25fbdc[_0x08ae('0x38')]:_0x151cf4[_0x08ae('0x37')];_0x25fbdc[_0x08ae('0x53')]=qs['sort'](_0xdcad90[_0x08ae('0x33')][_0x08ae('0x3e')]);_0x25fbdc[_0x08ae('0x40')]=qs[_0x08ae('0x35')](_['pick'](_0xdcad90[_0x08ae('0x33')],_0x151cf4['filters']));if(_0xdcad90['query'][_0x08ae('0x43')]){_0x25fbdc[_0x08ae('0x40')]=_['merge'](_0x25fbdc[_0x08ae('0x40')],{'$or':_['map'](_0x25fbdc[_0x08ae('0x38')],function(_0x3b362b){var _0x644609={};_0x644609[_0x3b362b]={'$like':'%'+_0xdcad90[_0x08ae('0x33')][_0x08ae('0x43')]+'%'};return _0x644609;})});}_0x25fbdc=_[_0x08ae('0x44')]({},_0x25fbdc,_0xdcad90[_0x08ae('0x4c')]);return _0x5aee08['getFields'](_0x25fbdc);}})['then'](function(_0x9179f9){if(_0x9179f9){_0x19e40c=_0x9179f9['length'];if(!_0xdcad90[_0x08ae('0x33')]['hasOwnProperty'](_0x08ae('0x3c'))){_0x25fbdc['limit']=qs['limit'](_0xdcad90[_0x08ae('0x33')][_0x08ae('0x3d')]);_0x25fbdc['offset']=qs[_0x08ae('0x20')](_0xdcad90[_0x08ae('0x33')][_0x08ae('0x20')]);}return _0x5aee08[_0x08ae('0x50')](_0x25fbdc);}})[_0x08ae('0x27')](function(_0xc7f831){if(_0xc7f831){return _0xc7f831?{'count':_0x19e40c,'rows':_0xc7f831}:null;}})[_0x08ae('0x27')](respondWithResult(_0x26d23b,null))[_0x08ae('0x49')](handleError(_0x26d23b,null));};exports[_0x08ae('0x54')]=function(_0x285524,_0x378861,_0x331a0a){var _0x5de119={};var _0x506437={};var _0x4bc5be;var _0x1ef66b;return db[_0x08ae('0x2e')][_0x08ae('0x51')]({'where':{'id':_0x285524[_0x08ae('0x4b')]['id']}})[_0x08ae('0x27')](handleEntityNotFound(_0x378861,null))[_0x08ae('0x27')](function(_0x3373a7){if(_0x3373a7){_0x4bc5be=_0x3373a7;_0x506437[_0x08ae('0x37')]=_['keys'](db[_0x08ae('0x52')][_0x08ae('0x2f')]);_0x506437['query']=_[_0x08ae('0x34')](_0x285524['query']);_0x506437[_0x08ae('0x35')]=_[_0x08ae('0x36')](_0x506437[_0x08ae('0x37')],_0x506437[_0x08ae('0x33')]);_0x5de119['attributes']=_['intersection'](_0x506437[_0x08ae('0x37')],qs[_0x08ae('0x39')](_0x285524['query'][_0x08ae('0x39')]));_0x5de119[_0x08ae('0x38')]=_0x5de119[_0x08ae('0x38')][_0x08ae('0x3a')]?_0x5de119['attributes']:_0x506437[_0x08ae('0x37')];_0x5de119[_0x08ae('0x53')]=qs[_0x08ae('0x3e')](_0x285524[_0x08ae('0x33')]['sort']);_0x5de119[_0x08ae('0x40')]=qs['filters'](_['pick'](_0x285524[_0x08ae('0x33')],_0x506437['filters']));if(_0x285524['query'][_0x08ae('0x43')]){_0x5de119[_0x08ae('0x40')]=_[_0x08ae('0x44')](_0x5de119['where'],{'$or':_[_0x08ae('0x41')](_0x5de119[_0x08ae('0x38')],function(_0x3af202){var _0x14df6c={};_0x14df6c[_0x3af202]={'$like':'%'+_0x285524['query'][_0x08ae('0x43')]+'%'};return _0x14df6c;})});}_0x5de119=_[_0x08ae('0x44')]({},_0x5de119,_0x285524[_0x08ae('0x4c')]);return _0x4bc5be[_0x08ae('0x54')](_0x5de119);}})[_0x08ae('0x27')](function(_0x5383c8){if(_0x5383c8){_0x1ef66b=_0x5383c8['length'];if(!_0x285524[_0x08ae('0x33')][_0x08ae('0x3b')](_0x08ae('0x3c'))){_0x5de119[_0x08ae('0x3d')]=qs[_0x08ae('0x3d')](_0x285524[_0x08ae('0x33')][_0x08ae('0x3d')]);_0x5de119['offset']=qs['offset'](_0x285524['query'][_0x08ae('0x20')]);}return _0x4bc5be[_0x08ae('0x54')](_0x5de119);}})[_0x08ae('0x27')](function(_0x18365f){if(_0x18365f){return _0x18365f?{'count':_0x1ef66b,'rows':_0x18365f}:null;}})[_0x08ae('0x27')](respondWithResult(_0x378861,null))[_0x08ae('0x49')](handleError(_0x378861,null));};exports['getDescriptions']=function(_0xaf0dfa,_0x3dfaba,_0x2f505d){var _0x55d34a={};var _0x454549={};var _0xe4d920;var _0xec55ad;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0xaf0dfa[_0x08ae('0x4b')]['id']}})[_0x08ae('0x27')](handleEntityNotFound(_0x3dfaba,null))[_0x08ae('0x27')](function(_0x32b021){if(_0x32b021){_0xe4d920=_0x32b021;_0x454549['model']=_[_0x08ae('0x34')](db[_0x08ae('0x52')][_0x08ae('0x2f')]);_0x454549['query']=_[_0x08ae('0x34')](_0xaf0dfa[_0x08ae('0x33')]);_0x454549[_0x08ae('0x35')]=_['intersection'](_0x454549['model'],_0x454549[_0x08ae('0x33')]);_0x55d34a[_0x08ae('0x38')]=_[_0x08ae('0x36')](_0x454549[_0x08ae('0x37')],qs['fields'](_0xaf0dfa['query'][_0x08ae('0x39')]));_0x55d34a['attributes']=_0x55d34a[_0x08ae('0x38')]['length']?_0x55d34a[_0x08ae('0x38')]:_0x454549[_0x08ae('0x37')];_0x55d34a[_0x08ae('0x53')]=qs[_0x08ae('0x3e')](_0xaf0dfa[_0x08ae('0x33')][_0x08ae('0x3e')]);_0x55d34a[_0x08ae('0x40')]=qs['filters'](_[_0x08ae('0x3f')](_0xaf0dfa['query'],_0x454549[_0x08ae('0x35')]));if(_0xaf0dfa[_0x08ae('0x33')][_0x08ae('0x43')]){_0x55d34a[_0x08ae('0x40')]=_['merge'](_0x55d34a[_0x08ae('0x40')],{'$or':_[_0x08ae('0x41')](_0x55d34a[_0x08ae('0x38')],function(_0x154d98){var _0x4baa7a={};_0x4baa7a[_0x154d98]={'$like':'%'+_0xaf0dfa[_0x08ae('0x33')][_0x08ae('0x43')]+'%'};return _0x4baa7a;})});}_0x55d34a=_[_0x08ae('0x44')]({},_0x55d34a,_0xaf0dfa['options']);return _0xe4d920['getDescriptions'](_0x55d34a);}})[_0x08ae('0x27')](function(_0x4e97f6){if(_0x4e97f6){_0xec55ad=_0x4e97f6[_0x08ae('0x3a')];if(!_0xaf0dfa['query'][_0x08ae('0x3b')](_0x08ae('0x3c'))){_0x55d34a[_0x08ae('0x3d')]=qs[_0x08ae('0x3d')](_0xaf0dfa['query'][_0x08ae('0x3d')]);_0x55d34a['offset']=qs[_0x08ae('0x20')](_0xaf0dfa[_0x08ae('0x33')][_0x08ae('0x20')]);}return _0xe4d920['getDescriptions'](_0x55d34a);}})['then'](function(_0x54a601){if(_0x54a601){return _0x54a601?{'count':_0xec55ad,'rows':_0x54a601}:null;}})[_0x08ae('0x27')](respondWithResult(_0x3dfaba,null))[_0x08ae('0x49')](handleError(_0x3dfaba,null));}; \ No newline at end of file +var _0x21ea=['rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SugarcrmConfiguration','include','findAll','rows','catch','params','includeAll','find','body','destroy','getFields','SugarcrmField','pick','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','map'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x21ea,0x169));var _0xa21e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x21ea[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa21e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa21e('0x1'));var jsonpatch=require(_0xa21e('0x2'));var rp=require(_0xa21e('0x3'));var moment=require(_0xa21e('0x4'));var BPromise=require(_0xa21e('0x5'));var Mustache=require(_0xa21e('0x6'));var util=require('util');var path=require(_0xa21e('0x7'));var sox=require(_0xa21e('0x8'));var csv=require('to-csv');var ejs=require(_0xa21e('0x9'));var fs=require('fs');var fs_extra=require(_0xa21e('0xa'));var _=require(_0xa21e('0xb'));var squel=require(_0xa21e('0xc'));var crypto=require('crypto');var jsforce=require(_0xa21e('0xd'));var deskjs=require(_0xa21e('0xe'));var toCsv=require(_0xa21e('0xf'));var querystring=require(_0xa21e('0x10'));var Papa=require(_0xa21e('0x11'));var Redis=require(_0xa21e('0x12'));var authService=require(_0xa21e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa21e('0x14'));var hardwareService=require(_0xa21e('0x15'));var logger=require('../../config/logger')(_0xa21e('0x16'));var utils=require(_0xa21e('0x17'));var config=require(_0xa21e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa21e('0x19'))['db'];function respondWithStatusCode(_0xd126f9,_0x2c89bb){_0x2c89bb=_0x2c89bb||0xcc;return function(_0x27b612){if(_0x27b612){return _0xd126f9[_0xa21e('0x1a')](_0x2c89bb);}return _0xd126f9[_0xa21e('0x1b')](_0x2c89bb)[_0xa21e('0x1c')]();};}function respondWithResult(_0x720e89,_0x2be1d6){_0x2be1d6=_0x2be1d6||0xc8;return function(_0x3b7f55){if(_0x3b7f55){return _0x720e89[_0xa21e('0x1b')](_0x2be1d6)[_0xa21e('0x1d')](_0x3b7f55);}};}function respondWithFilteredResult(_0x4697bd,_0x383f07){return function(_0x14f9d4){if(_0x14f9d4){var _0x53110c=typeof _0x383f07[_0xa21e('0x1e')]===_0xa21e('0x1f')&&typeof _0x383f07[_0xa21e('0x20')]===_0xa21e('0x1f');var _0x1d42d1=_0x14f9d4['count'];var _0x9ecb09=_0x53110c?0x0:_0x383f07[_0xa21e('0x1e')];var _0x115050=_0x53110c?_0x14f9d4[_0xa21e('0x21')]:_0x383f07[_0xa21e('0x1e')]+_0x383f07[_0xa21e('0x20')];var _0x12d450;if(_0x115050>=_0x1d42d1){_0x115050=_0x1d42d1;_0x12d450=0xc8;}else{_0x12d450=0xce;}_0x4697bd['status'](_0x12d450);return _0x4697bd['set']('Content-Range',_0x9ecb09+'-'+_0x115050+'/'+_0x1d42d1)[_0xa21e('0x1d')](_0x14f9d4);}return null;};}function patchUpdates(_0x5636c9){return function(_0x25c913){try{jsonpatch[_0xa21e('0x22')](_0x25c913,_0x5636c9,!![]);}catch(_0x56a973){return BPromise[_0xa21e('0x23')](_0x56a973);}return _0x25c913[_0xa21e('0x24')]();};}function saveUpdates(_0x36ddfd,_0x4d9da1){return function(_0x325234){if(_0x325234){return _0x325234[_0xa21e('0x25')](_0x36ddfd)['then'](function(_0x41a531){return _0x41a531;});}return null;};}function removeEntity(_0x496114,_0xb76107){return function(_0x2311eb){if(_0x2311eb){return _0x2311eb['destroy']()[_0xa21e('0x26')](function(){_0x496114[_0xa21e('0x1b')](0xcc)[_0xa21e('0x1c')]();});}};}function handleEntityNotFound(_0x2312aa,_0x1b7b95){return function(_0x29788a){if(!_0x29788a){_0x2312aa[_0xa21e('0x1a')](0x194);}return _0x29788a;};}function handleError(_0x5c7cf2,_0x5454f7){_0x5454f7=_0x5454f7||0x1f4;return function(_0x6d040b){logger[_0xa21e('0x27')](_0x6d040b['stack']);if(_0x6d040b['name']){delete _0x6d040b[_0xa21e('0x28')];}_0x5c7cf2[_0xa21e('0x1b')](_0x5454f7)[_0xa21e('0x29')](_0x6d040b);};}exports[_0xa21e('0x2a')]=function(_0x5a6480,_0x21ded0){var _0x370062={},_0x47cfb5={},_0x2916a3={'count':0x0,'rows':[]};var _0x232faa=_[_0xa21e('0x2b')](db['SugarcrmConfiguration'][_0xa21e('0x2c')],function(_0x5238b4){return{'name':_0x5238b4[_0xa21e('0x2d')],'type':_0x5238b4[_0xa21e('0x2e')][_0xa21e('0x2f')]};});_0x47cfb5['model']=_['map'](_0x232faa,'name');_0x47cfb5['query']=_[_0xa21e('0x30')](_0x5a6480[_0xa21e('0x31')]);_0x47cfb5[_0xa21e('0x32')]=_['intersection'](_0x47cfb5[_0xa21e('0x33')],_0x47cfb5[_0xa21e('0x31')]);_0x370062['attributes']=_[_0xa21e('0x34')](_0x47cfb5[_0xa21e('0x33')],qs[_0xa21e('0x35')](_0x5a6480[_0xa21e('0x31')][_0xa21e('0x35')]));_0x370062['attributes']=_0x370062[_0xa21e('0x36')][_0xa21e('0x37')]?_0x370062[_0xa21e('0x36')]:_0x47cfb5[_0xa21e('0x33')];if(!_0x5a6480[_0xa21e('0x31')][_0xa21e('0x38')](_0xa21e('0x39'))){_0x370062['limit']=qs['limit'](_0x5a6480['query'][_0xa21e('0x20')]);_0x370062[_0xa21e('0x1e')]=qs[_0xa21e('0x1e')](_0x5a6480['query']['offset']);}_0x370062[_0xa21e('0x3a')]=qs[_0xa21e('0x3b')](_0x5a6480[_0xa21e('0x31')][_0xa21e('0x3b')]);_0x370062[_0xa21e('0x3c')]=qs[_0xa21e('0x32')](_['pick'](_0x5a6480[_0xa21e('0x31')],_0x47cfb5[_0xa21e('0x32')]),_0x232faa);if(_0x5a6480[_0xa21e('0x31')]['filter']){_0x370062[_0xa21e('0x3c')]=_[_0xa21e('0x3d')](_0x370062[_0xa21e('0x3c')],{'$or':_[_0xa21e('0x2b')](_0x232faa,function(_0x259a06){if(_0x259a06['type']!==_0xa21e('0x3e')){var _0x2d3d40={};_0x2d3d40[_0x259a06[_0xa21e('0x28')]]={'$like':'%'+_0x5a6480[_0xa21e('0x31')][_0xa21e('0x3f')]+'%'};return _0x2d3d40;}})});}_0x370062=_['merge']({},_0x370062,_0x5a6480[_0xa21e('0x40')]);var _0x3f0238={'where':_0x370062[_0xa21e('0x3c')]};return db[_0xa21e('0x41')]['count'](_0x3f0238)[_0xa21e('0x26')](function(_0x2a4198){_0x2916a3[_0xa21e('0x21')]=_0x2a4198;if(_0x5a6480['query']['includeAll']){_0x370062[_0xa21e('0x42')]=[{'all':!![]}];}return db[_0xa21e('0x41')][_0xa21e('0x43')](_0x370062);})[_0xa21e('0x26')](function(_0x47d2dd){_0x2916a3[_0xa21e('0x44')]=_0x47d2dd;return _0x2916a3;})[_0xa21e('0x26')](respondWithFilteredResult(_0x21ded0,_0x370062))[_0xa21e('0x45')](handleError(_0x21ded0,null));};exports['show']=function(_0x5718c1,_0x25c62a){var _0x28550c={'raw':![],'where':{'id':_0x5718c1[_0xa21e('0x46')]['id']}},_0x5f1343={};_0x5f1343[_0xa21e('0x33')]=_[_0xa21e('0x30')](db['SugarcrmConfiguration'][_0xa21e('0x2c')]);_0x5f1343[_0xa21e('0x31')]=_['keys'](_0x5718c1['query']);_0x5f1343[_0xa21e('0x32')]=_[_0xa21e('0x34')](_0x5f1343[_0xa21e('0x33')],_0x5f1343[_0xa21e('0x31')]);_0x28550c[_0xa21e('0x36')]=_[_0xa21e('0x34')](_0x5f1343[_0xa21e('0x33')],qs[_0xa21e('0x35')](_0x5718c1[_0xa21e('0x31')]['fields']));_0x28550c[_0xa21e('0x36')]=_0x28550c[_0xa21e('0x36')][_0xa21e('0x37')]?_0x28550c['attributes']:_0x5f1343['model'];if(_0x5718c1[_0xa21e('0x31')][_0xa21e('0x47')]){_0x28550c[_0xa21e('0x42')]=[{'all':!![]}];}_0x28550c=_[_0xa21e('0x3d')]({},_0x28550c,_0x5718c1[_0xa21e('0x40')]);return db[_0xa21e('0x41')][_0xa21e('0x48')](_0x28550c)[_0xa21e('0x26')](handleEntityNotFound(_0x25c62a,null))['then'](respondWithResult(_0x25c62a,null))['catch'](handleError(_0x25c62a,null));};exports['create']=function(_0x44aa9f,_0x96a8ba){return db[_0xa21e('0x41')]['create'](_0x44aa9f['body'],{})[_0xa21e('0x26')](respondWithResult(_0x96a8ba,0xc9))['catch'](handleError(_0x96a8ba,null));};exports[_0xa21e('0x25')]=function(_0x55445e,_0x32a709){if(_0x55445e[_0xa21e('0x49')]['id']){delete _0x55445e[_0xa21e('0x49')]['id'];}return db[_0xa21e('0x41')]['find']({'where':{'id':_0x55445e[_0xa21e('0x46')]['id']}})['then'](handleEntityNotFound(_0x32a709,null))[_0xa21e('0x26')](saveUpdates(_0x55445e['body'],null))[_0xa21e('0x26')](respondWithResult(_0x32a709,null))[_0xa21e('0x45')](handleError(_0x32a709,null));};exports[_0xa21e('0x4a')]=function(_0x4254bb,_0x3da129){return db[_0xa21e('0x41')][_0xa21e('0x48')]({'where':{'id':_0x4254bb['params']['id']}})[_0xa21e('0x26')](handleEntityNotFound(_0x3da129,null))['then'](removeEntity(_0x3da129,null))['catch'](handleError(_0x3da129,null));};exports[_0xa21e('0x4b')]=function(_0x29b566,_0x2a4ccb,_0x56dd84){var _0x37f63b={};var _0x266caa={};var _0x2f1fbd;var _0x2e0c49;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x29b566[_0xa21e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a4ccb,null))[_0xa21e('0x26')](function(_0x40ed2c){if(_0x40ed2c){_0x2f1fbd=_0x40ed2c;_0x266caa[_0xa21e('0x33')]=_[_0xa21e('0x30')](db[_0xa21e('0x4c')][_0xa21e('0x2c')]);_0x266caa['query']=_[_0xa21e('0x30')](_0x29b566[_0xa21e('0x31')]);_0x266caa[_0xa21e('0x32')]=_[_0xa21e('0x34')](_0x266caa[_0xa21e('0x33')],_0x266caa[_0xa21e('0x31')]);_0x37f63b[_0xa21e('0x36')]=_[_0xa21e('0x34')](_0x266caa['model'],qs[_0xa21e('0x35')](_0x29b566['query'][_0xa21e('0x35')]));_0x37f63b[_0xa21e('0x36')]=_0x37f63b['attributes'][_0xa21e('0x37')]?_0x37f63b['attributes']:_0x266caa['model'];_0x37f63b[_0xa21e('0x3a')]=qs['sort'](_0x29b566[_0xa21e('0x31')]['sort']);_0x37f63b[_0xa21e('0x3c')]=qs[_0xa21e('0x32')](_[_0xa21e('0x4d')](_0x29b566['query'],_0x266caa[_0xa21e('0x32')]));if(_0x29b566[_0xa21e('0x31')][_0xa21e('0x3f')]){_0x37f63b[_0xa21e('0x3c')]=_[_0xa21e('0x3d')](_0x37f63b['where'],{'$or':_[_0xa21e('0x2b')](_0x37f63b[_0xa21e('0x36')],function(_0x1caf72){var _0x8a7f97={};_0x8a7f97[_0x1caf72]={'$like':'%'+_0x29b566['query'][_0xa21e('0x3f')]+'%'};return _0x8a7f97;})});}_0x37f63b=_['merge']({},_0x37f63b,_0x29b566[_0xa21e('0x40')]);return _0x2f1fbd[_0xa21e('0x4b')](_0x37f63b);}})['then'](function(_0x31a163){if(_0x31a163){_0x2e0c49=_0x31a163[_0xa21e('0x37')];if(!_0x29b566['query'][_0xa21e('0x38')]('nolimit')){_0x37f63b[_0xa21e('0x20')]=qs['limit'](_0x29b566[_0xa21e('0x31')]['limit']);_0x37f63b[_0xa21e('0x1e')]=qs[_0xa21e('0x1e')](_0x29b566[_0xa21e('0x31')]['offset']);}return _0x2f1fbd['getFields'](_0x37f63b);}})['then'](function(_0x6dc277){if(_0x6dc277){return _0x6dc277?{'count':_0x2e0c49,'rows':_0x6dc277}:null;}})[_0xa21e('0x26')](respondWithResult(_0x2a4ccb,null))[_0xa21e('0x45')](handleError(_0x2a4ccb,null));};exports[_0xa21e('0x4e')]=function(_0x26b031,_0x130578,_0x5e75ee){var _0x51e06a={};var _0x4624e7={};var _0x4b6ecd;var _0x3b2af1;return db['SugarcrmConfiguration'][_0xa21e('0x4f')]({'where':{'id':_0x26b031[_0xa21e('0x46')]['id']}})[_0xa21e('0x26')](handleEntityNotFound(_0x130578,null))['then'](function(_0x3d5c8c){if(_0x3d5c8c){_0x4b6ecd=_0x3d5c8c;_0x4624e7[_0xa21e('0x33')]=_['keys'](db[_0xa21e('0x4c')][_0xa21e('0x2c')]);_0x4624e7[_0xa21e('0x31')]=_[_0xa21e('0x30')](_0x26b031[_0xa21e('0x31')]);_0x4624e7[_0xa21e('0x32')]=_['intersection'](_0x4624e7[_0xa21e('0x33')],_0x4624e7[_0xa21e('0x31')]);_0x51e06a['attributes']=_[_0xa21e('0x34')](_0x4624e7[_0xa21e('0x33')],qs[_0xa21e('0x35')](_0x26b031[_0xa21e('0x31')][_0xa21e('0x35')]));_0x51e06a[_0xa21e('0x36')]=_0x51e06a[_0xa21e('0x36')][_0xa21e('0x37')]?_0x51e06a[_0xa21e('0x36')]:_0x4624e7[_0xa21e('0x33')];_0x51e06a[_0xa21e('0x3a')]=qs[_0xa21e('0x3b')](_0x26b031[_0xa21e('0x31')][_0xa21e('0x3b')]);_0x51e06a[_0xa21e('0x3c')]=qs['filters'](_[_0xa21e('0x4d')](_0x26b031[_0xa21e('0x31')],_0x4624e7[_0xa21e('0x32')]));if(_0x26b031[_0xa21e('0x31')][_0xa21e('0x3f')]){_0x51e06a['where']=_['merge'](_0x51e06a[_0xa21e('0x3c')],{'$or':_[_0xa21e('0x2b')](_0x51e06a['attributes'],function(_0x3c2a36){var _0x4844aa={};_0x4844aa[_0x3c2a36]={'$like':'%'+_0x26b031['query'][_0xa21e('0x3f')]+'%'};return _0x4844aa;})});}_0x51e06a=_[_0xa21e('0x3d')]({},_0x51e06a,_0x26b031[_0xa21e('0x40')]);return _0x4b6ecd[_0xa21e('0x4e')](_0x51e06a);}})[_0xa21e('0x26')](function(_0x1597eb){if(_0x1597eb){_0x3b2af1=_0x1597eb['length'];if(!_0x26b031['query'][_0xa21e('0x38')]('nolimit')){_0x51e06a['limit']=qs['limit'](_0x26b031[_0xa21e('0x31')][_0xa21e('0x20')]);_0x51e06a[_0xa21e('0x1e')]=qs[_0xa21e('0x1e')](_0x26b031[_0xa21e('0x31')][_0xa21e('0x1e')]);}return _0x4b6ecd[_0xa21e('0x4e')](_0x51e06a);}})['then'](function(_0x1ebba1){if(_0x1ebba1){return _0x1ebba1?{'count':_0x3b2af1,'rows':_0x1ebba1}:null;}})[_0xa21e('0x26')](respondWithResult(_0x130578,null))[_0xa21e('0x45')](handleError(_0x130578,null));};exports[_0xa21e('0x50')]=function(_0x215e52,_0x90e968,_0x3a143e){var _0x5631c1={};var _0xe79a18={};var _0x11f4e5;var _0x5c3f44;return db[_0xa21e('0x41')][_0xa21e('0x4f')]({'where':{'id':_0x215e52[_0xa21e('0x46')]['id']}})[_0xa21e('0x26')](handleEntityNotFound(_0x90e968,null))[_0xa21e('0x26')](function(_0x443f8a){if(_0x443f8a){_0x11f4e5=_0x443f8a;_0xe79a18[_0xa21e('0x33')]=_['keys'](db['SugarcrmField'][_0xa21e('0x2c')]);_0xe79a18[_0xa21e('0x31')]=_['keys'](_0x215e52['query']);_0xe79a18[_0xa21e('0x32')]=_[_0xa21e('0x34')](_0xe79a18[_0xa21e('0x33')],_0xe79a18[_0xa21e('0x31')]);_0x5631c1['attributes']=_[_0xa21e('0x34')](_0xe79a18[_0xa21e('0x33')],qs['fields'](_0x215e52['query']['fields']));_0x5631c1[_0xa21e('0x36')]=_0x5631c1[_0xa21e('0x36')]['length']?_0x5631c1['attributes']:_0xe79a18['model'];_0x5631c1[_0xa21e('0x3a')]=qs[_0xa21e('0x3b')](_0x215e52[_0xa21e('0x31')][_0xa21e('0x3b')]);_0x5631c1[_0xa21e('0x3c')]=qs[_0xa21e('0x32')](_[_0xa21e('0x4d')](_0x215e52['query'],_0xe79a18['filters']));if(_0x215e52[_0xa21e('0x31')][_0xa21e('0x3f')]){_0x5631c1[_0xa21e('0x3c')]=_[_0xa21e('0x3d')](_0x5631c1[_0xa21e('0x3c')],{'$or':_[_0xa21e('0x2b')](_0x5631c1[_0xa21e('0x36')],function(_0x3cfc3f){var _0x1dc696={};_0x1dc696[_0x3cfc3f]={'$like':'%'+_0x215e52[_0xa21e('0x31')]['filter']+'%'};return _0x1dc696;})});}_0x5631c1=_[_0xa21e('0x3d')]({},_0x5631c1,_0x215e52[_0xa21e('0x40')]);return _0x11f4e5[_0xa21e('0x50')](_0x5631c1);}})['then'](function(_0x3212cf){if(_0x3212cf){_0x5c3f44=_0x3212cf[_0xa21e('0x37')];if(!_0x215e52[_0xa21e('0x31')][_0xa21e('0x38')](_0xa21e('0x39'))){_0x5631c1[_0xa21e('0x20')]=qs[_0xa21e('0x20')](_0x215e52[_0xa21e('0x31')]['limit']);_0x5631c1[_0xa21e('0x1e')]=qs[_0xa21e('0x1e')](_0x215e52['query'][_0xa21e('0x1e')]);}return _0x11f4e5[_0xa21e('0x50')](_0x5631c1);}})[_0xa21e('0x26')](function(_0xf82416){if(_0xf82416){return _0xf82416?{'count':_0x5c3f44,'rows':_0xf82416}:null;}})[_0xa21e('0x26')](respondWithResult(_0x90e968,null))[_0xa21e('0x45')](handleError(_0x90e968,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 7274843..60c3599 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 _0x7046=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x586490,_0x3b2d9a){var _0x5cade5=function(_0x598364){while(--_0x598364){_0x586490['push'](_0x586490['shift']());}};_0x5cade5(++_0x3b2d9a);}(_0x7046,0x101));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'))('api');var moment=require(_0x6704('0x3'));var BPromise=require(_0x6704('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6704('0x5'));var rimraf=require(_0x6704('0x6'));var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0xbcc0d5,_0x295e99){return _0xbcc0d5[_0x6704('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x6704('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd541=['path','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2df762,_0x38568b){var _0x3c2359=function(_0x36de67){while(--_0x36de67){_0x2df762['push'](_0x2df762['shift']());}};_0x3c2359(++_0x38568b);}(_0xd541,0x1ea));var _0x1d54=function(_0x443bdd,_0x517654){_0x443bdd=_0x443bdd-0x0;var _0x3a1e48=_0xd541[_0x443bdd];return _0x3a1e48;};'use strict';var _=require(_0x1d54('0x0'));var util=require(_0x1d54('0x1'));var logger=require(_0x1d54('0x2'))('api');var moment=require(_0x1d54('0x3'));var BPromise=require('bluebird');var rp=require(_0x1d54('0x4'));var fs=require('fs');var path=require(_0x1d54('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1d54('0x6'));module[_0x1d54('0x7')]=function(_0x4af7e2,_0x1838aa){return _0x4af7e2[_0x1d54('0x8')](_0x1d54('0x9'),attributes,{'tableName':_0x1d54('0xa'),'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 53bda94..f816299 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 _0x68ea=['debug','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0xe1346d,_0x425ee3){var _0x31aac5=function(_0xfcbe67){while(--_0xfcbe67){_0xe1346d['push'](_0xe1346d['shift']());}};_0x31aac5(++_0x425ee3);}(_0x68ea,0x17d));var _0xa68e=function(_0x9f9380,_0x313674){_0x9f9380=_0x9f9380-0x0;var _0x45290e=_0x68ea[_0x9f9380];return _0x45290e;};'use strict';var _=require('lodash');var util=require(_0xa68e('0x0'));var moment=require(_0xa68e('0x1'));var BPromise=require(_0xa68e('0x2'));var rs=require(_0xa68e('0x3'));var fs=require('fs');var Redis=require(_0xa68e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa68e('0x5'));var logger=require(_0xa68e('0x6'))(_0xa68e('0x7'));var config=require(_0xa68e('0x8'));var jayson=require(_0xa68e('0x9'));var client=jayson[_0xa68e('0xa')][_0xa68e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x307af5,_0x543401,_0x5cf6e8){return new BPromise(function(_0xcac548,_0x21f131){return client[_0xa68e('0xc')](_0x307af5,_0x5cf6e8)[_0xa68e('0xd')](function(_0x535190){logger['info'](_0xa68e('0xe'),_0x543401,'request\x20sent');logger[_0xa68e('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x543401,_0xa68e('0x10'),JSON[_0xa68e('0x11')](_0x535190));if(_0x535190['error']){if(_0x535190[_0xa68e('0x12')]['code']===0x1f4){logger[_0xa68e('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x543401,_0x535190[_0xa68e('0x12')][_0xa68e('0x13')]);return _0x21f131(_0x535190[_0xa68e('0x12')][_0xa68e('0x13')]);}logger['error'](_0xa68e('0xe'),_0x543401,_0x535190[_0xa68e('0x12')][_0xa68e('0x13')]);return _0xcac548(_0x535190[_0xa68e('0x12')][_0xa68e('0x13')]);}else{logger[_0xa68e('0x14')](_0xa68e('0xe'),_0x543401,_0xa68e('0x10'));_0xcac548(_0x535190[_0xa68e('0x15')][_0xa68e('0x13')]);}})['catch'](function(_0x37ca22){logger[_0xa68e('0x12')](_0xa68e('0xe'),_0x543401,_0x37ca22);_0x21f131(_0x37ca22);});});} \ No newline at end of file +var _0xd435=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xd435,0x69));var _0x5d43=function(_0x426971,_0x37ed43){_0x426971=_0x426971-0x0;var _0x4427d5=_0xd435[_0x426971];return _0x4427d5;};'use strict';var _=require(_0x5d43('0x0'));var util=require(_0x5d43('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d43('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d43('0x3'));var logger=require(_0x5d43('0x4'))(_0x5d43('0x5'));var config=require('../../config/environment');var jayson=require(_0x5d43('0x6'));var client=jayson[_0x5d43('0x7')][_0x5d43('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f4aa3,_0x11e212,_0x494d71){return new BPromise(function(_0x4fd7cb,_0x837c37){return client[_0x5d43('0x9')](_0x1f4aa3,_0x494d71)[_0x5d43('0xa')](function(_0x3d4ee3){logger['info'](_0x5d43('0xb'),_0x11e212,_0x5d43('0xc'));logger[_0x5d43('0xd')](_0x5d43('0xe'),_0x11e212,_0x5d43('0xc'),JSON[_0x5d43('0xf')](_0x3d4ee3));if(_0x3d4ee3['error']){if(_0x3d4ee3['error']['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x11e212,_0x3d4ee3[_0x5d43('0x10')]['message']);return _0x837c37(_0x3d4ee3[_0x5d43('0x10')][_0x5d43('0x11')]);}logger['error'](_0x5d43('0xb'),_0x11e212,_0x3d4ee3[_0x5d43('0x10')][_0x5d43('0x11')]);return _0x4fd7cb(_0x3d4ee3[_0x5d43('0x10')][_0x5d43('0x11')]);}else{logger['info'](_0x5d43('0xb'),_0x11e212,_0x5d43('0xc'));_0x4fd7cb(_0x3d4ee3[_0x5d43('0x12')][_0x5d43('0x11')]);}})['catch'](function(_0x47237e){logger[_0x5d43('0x10')](_0x5d43('0xb'),_0x11e212,_0x47237e);_0x837c37(_0x47237e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 68b12b0..43cb601 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 _0xb046=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create'];(function(_0x4337e4,_0x1e4ee1){var _0x5eeb01=function(_0x2fc0aa){while(--_0x2fc0aa){_0x4337e4['push'](_0x4337e4['shift']());}};_0x5eeb01(++_0x1e4ee1);}(_0xb046,0x140));var _0x6b04=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0xb046[_0x3f8a03];return _0x147fb2;};'use strict';var multer=require(_0x6b04('0x0'));var util=require(_0x6b04('0x1'));var path=require(_0x6b04('0x2'));var timeout=require(_0x6b04('0x3'));var express=require('express');var router=express[_0x6b04('0x4')]();var fs_extra=require(_0x6b04('0x5'));var auth=require(_0x6b04('0x6'));var interaction=require(_0x6b04('0x7'));var config=require(_0x6b04('0x8'));var controller=require(_0x6b04('0x9'));router[_0x6b04('0xa')]('/',auth[_0x6b04('0xb')](),controller[_0x6b04('0xc')]);router['get']('/:id',auth[_0x6b04('0xb')](),controller[_0x6b04('0xd')]);router[_0x6b04('0xe')]('/',auth[_0x6b04('0xb')](),controller[_0x6b04('0xf')]);router['put'](_0x6b04('0x10'),auth[_0x6b04('0xb')](),controller[_0x6b04('0x11')]);router[_0x6b04('0x12')]('/:id',auth[_0x6b04('0xb')](),controller[_0x6b04('0x13')]);module[_0x6b04('0x14')]=router; \ No newline at end of file +var _0x8423=['get','/:id','show','isAuthenticated','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x466fca,_0x1788d2){var _0x3cf2ba=function(_0x8d223a){while(--_0x8d223a){_0x466fca['push'](_0x466fca['shift']());}};_0x3cf2ba(++_0x1788d2);}(_0x8423,0x15e));var _0x3842=function(_0x979f8a,_0x4e0b55){_0x979f8a=_0x979f8a-0x0;var _0x43f75f=_0x8423[_0x979f8a];return _0x43f75f;};'use strict';var multer=require(_0x3842('0x0'));var util=require(_0x3842('0x1'));var path=require(_0x3842('0x2'));var timeout=require(_0x3842('0x3'));var express=require(_0x3842('0x4'));var router=express[_0x3842('0x5')]();var fs_extra=require(_0x3842('0x6'));var auth=require(_0x3842('0x7'));var interaction=require(_0x3842('0x8'));var config=require(_0x3842('0x9'));var controller=require('./intSugarcrmField.controller');router[_0x3842('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3842('0xa')](_0x3842('0xb'),auth['isAuthenticated'](),controller[_0x3842('0xc')]);router['post']('/',auth[_0x3842('0xd')](),controller['create']);router[_0x3842('0xe')](_0x3842('0xb'),auth['isAuthenticated'](),controller[_0x3842('0xf')]);router[_0x3842('0x10')](_0x3842('0xb'),auth[_0x3842('0xd')](),controller['destroy']);module[_0x3842('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index fd48b29..f631dde 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 _0x3917=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3da4d2,_0x46a670){var _0x2d2e55=function(_0x540d9c){while(--_0x540d9c){_0x3da4d2['push'](_0x3da4d2['shift']());}};_0x2d2e55(++_0x46a670);}(_0x3917,0x1ce));var _0x7391=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x3917[_0x2a4095];return _0x52eeab;};'use strict';var Sequelize=require(_0x7391('0x0'));module[_0x7391('0x1')]={'type':{'type':Sequelize[_0x7391('0x2')](_0x7391('0x3'),_0x7391('0x4'),_0x7391('0x5'),_0x7391('0x6'),'picklist'),'defaultValue':_0x7391('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7391('0x7')]},'keyType':{'type':Sequelize[_0x7391('0x2')](_0x7391('0x3'),_0x7391('0x4'),_0x7391('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7391('0x7')]},'nameField':{'type':Sequelize[_0x7391('0x7')]},'customField':{'type':Sequelize[_0x7391('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7391('0x7')]}}; \ No newline at end of file +var _0x37c0=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x410543,_0x3e1996){var _0x45ef69=function(_0x40a776){while(--_0x40a776){_0x410543['push'](_0x410543['shift']());}};_0x45ef69(++_0x3e1996);}(_0x37c0,0x90));var _0x037c=function(_0x184090,_0x281390){_0x184090=_0x184090-0x0;var _0x34c6d9=_0x37c0[_0x184090];return _0x34c6d9;};'use strict';var Sequelize=require(_0x037c('0x0'));module[_0x037c('0x1')]={'type':{'type':Sequelize[_0x037c('0x2')](_0x037c('0x3'),_0x037c('0x4'),_0x037c('0x5'),_0x037c('0x6'),_0x037c('0x7')),'defaultValue':_0x037c('0x3')},'content':{'type':Sequelize[_0x037c('0x8')]},'key':{'type':Sequelize[_0x037c('0x8')]},'keyType':{'type':Sequelize[_0x037c('0x2')](_0x037c('0x3'),_0x037c('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x037c('0x8')]},'nameField':{'type':Sequelize[_0x037c('0x8')]},'customField':{'type':Sequelize[_0x037c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x037c('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 2c80917..e8433bb 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 _0xc0ee=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','includeAll','include','findAll','rows','find','catch','create','body','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes'];(function(_0x5db4f8,_0x44ca9e){var _0x35393c=function(_0x18eac0){while(--_0x18eac0){_0x5db4f8['push'](_0x5db4f8['shift']());}};_0x35393c(++_0x44ca9e);}(_0xc0ee,0x173));var _0xec0e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xc0ee[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec0e('0x0'));var zipdir=require(_0xec0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec0e('0x2'));var moment=require('moment');var BPromise=require(_0xec0e('0x3'));var Mustache=require(_0xec0e('0x4'));var util=require(_0xec0e('0x5'));var path=require(_0xec0e('0x6'));var sox=require(_0xec0e('0x7'));var csv=require(_0xec0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xec0e('0x9'));var jsforce=require(_0xec0e('0xa'));var deskjs=require(_0xec0e('0xb'));var toCsv=require(_0xec0e('0x8'));var querystring=require(_0xec0e('0xc'));var Papa=require(_0xec0e('0xd'));var Redis=require(_0xec0e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xec0e('0xf'));var as=require(_0xec0e('0x10'));var hardwareService=require(_0xec0e('0x11'));var logger=require('../../config/logger')(_0xec0e('0x12'));var utils=require('../../config/utils');var config=require(_0xec0e('0x13'));var licenseUtil=require(_0xec0e('0x14'));var db=require(_0xec0e('0x15'))['db'];function respondWithStatusCode(_0xddd224,_0x39fb85){_0x39fb85=_0x39fb85||0xcc;return function(_0x14500e){if(_0x14500e){return _0xddd224[_0xec0e('0x16')](_0x39fb85);}return _0xddd224[_0xec0e('0x17')](_0x39fb85)['end']();};}function respondWithResult(_0x114ef6,_0x4c4ab4){_0x4c4ab4=_0x4c4ab4||0xc8;return function(_0x53cc8c){if(_0x53cc8c){return _0x114ef6[_0xec0e('0x17')](_0x4c4ab4)[_0xec0e('0x18')](_0x53cc8c);}};}function respondWithFilteredResult(_0x18524c,_0x38965c){return function(_0x2150e8){if(_0x2150e8){var _0x2cd953=typeof _0x38965c[_0xec0e('0x19')]===_0xec0e('0x1a')&&typeof _0x38965c[_0xec0e('0x1b')]===_0xec0e('0x1a');var _0x39c122=_0x2150e8[_0xec0e('0x1c')];var _0x580008=_0x2cd953?0x0:_0x38965c[_0xec0e('0x19')];var _0x3736d5=_0x2cd953?_0x2150e8[_0xec0e('0x1c')]:_0x38965c[_0xec0e('0x19')]+_0x38965c['limit'];var _0x2eaf19;if(_0x3736d5>=_0x39c122){_0x3736d5=_0x39c122;_0x2eaf19=0xc8;}else{_0x2eaf19=0xce;}_0x18524c['status'](_0x2eaf19);return _0x18524c['set'](_0xec0e('0x1d'),_0x580008+'-'+_0x3736d5+'/'+_0x39c122)[_0xec0e('0x18')](_0x2150e8);}return null;};}function patchUpdates(_0x4b3384){return function(_0x49a761){try{jsonpatch[_0xec0e('0x1e')](_0x49a761,_0x4b3384,!![]);}catch(_0x3931bd){return BPromise['reject'](_0x3931bd);}return _0x49a761['save']();};}function saveUpdates(_0x2c9e5f,_0x861afe){return function(_0x2926ea){if(_0x2926ea){return _0x2926ea[_0xec0e('0x1f')](_0x2c9e5f)[_0xec0e('0x20')](function(_0x4cb06b){return _0x4cb06b;});}return null;};}function removeEntity(_0x489279,_0x560bc5){return function(_0x2ac851){if(_0x2ac851){return _0x2ac851[_0xec0e('0x21')]()[_0xec0e('0x20')](function(){_0x489279[_0xec0e('0x17')](0xcc)[_0xec0e('0x22')]();});}};}function handleEntityNotFound(_0x2a7ef1,_0x2dcf69){return function(_0x3c9174){if(!_0x3c9174){_0x2a7ef1[_0xec0e('0x16')](0x194);}return _0x3c9174;};}function handleError(_0x4840ff,_0x5d32dc){_0x5d32dc=_0x5d32dc||0x1f4;return function(_0x26ba94){logger[_0xec0e('0x23')](_0x26ba94[_0xec0e('0x24')]);if(_0x26ba94[_0xec0e('0x25')]){delete _0x26ba94[_0xec0e('0x25')];}_0x4840ff['status'](_0x5d32dc)[_0xec0e('0x26')](_0x26ba94);};}exports[_0xec0e('0x27')]=function(_0x360ef1,_0x10d8ab){var _0x9ba7a3={},_0x374504={},_0x24bf32={'count':0x0,'rows':[]};var _0x27a837=_[_0xec0e('0x28')](db[_0xec0e('0x29')][_0xec0e('0x2a')],function(_0x2ec067){return{'name':_0x2ec067[_0xec0e('0x2b')],'type':_0x2ec067[_0xec0e('0x2c')][_0xec0e('0x2d')]};});_0x374504[_0xec0e('0x2e')]=_[_0xec0e('0x28')](_0x27a837,_0xec0e('0x25'));_0x374504[_0xec0e('0x2f')]=_[_0xec0e('0x30')](_0x360ef1['query']);_0x374504[_0xec0e('0x31')]=_[_0xec0e('0x32')](_0x374504[_0xec0e('0x2e')],_0x374504[_0xec0e('0x2f')]);_0x9ba7a3[_0xec0e('0x33')]=_[_0xec0e('0x32')](_0x374504['model'],qs[_0xec0e('0x34')](_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x34')]));_0x9ba7a3[_0xec0e('0x33')]=_0x9ba7a3[_0xec0e('0x33')][_0xec0e('0x35')]?_0x9ba7a3['attributes']:_0x374504['model'];if(!_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x36')](_0xec0e('0x37'))){_0x9ba7a3[_0xec0e('0x1b')]=qs['limit'](_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x1b')]);_0x9ba7a3[_0xec0e('0x19')]=qs[_0xec0e('0x19')](_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x19')]);}_0x9ba7a3['order']=qs['sort'](_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x38')]);_0x9ba7a3[_0xec0e('0x39')]=qs[_0xec0e('0x31')](_['pick'](_0x360ef1[_0xec0e('0x2f')],_0x374504['filters']),_0x27a837);if(_0x360ef1[_0xec0e('0x2f')]['filter']){_0x9ba7a3[_0xec0e('0x39')]=_[_0xec0e('0x3a')](_0x9ba7a3[_0xec0e('0x39')],{'$or':_[_0xec0e('0x28')](_0x27a837,function(_0x51fab9){if(_0x51fab9['type']!=='VIRTUAL'){var _0x24843c={};_0x24843c[_0x51fab9[_0xec0e('0x25')]]={'$like':'%'+_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x3b')]+'%'};return _0x24843c;}})});}_0x9ba7a3=_[_0xec0e('0x3a')]({},_0x9ba7a3,_0x360ef1['options']);var _0xc5bc8c={'where':_0x9ba7a3[_0xec0e('0x39')]};return db[_0xec0e('0x29')]['count'](_0xc5bc8c)[_0xec0e('0x20')](function(_0x343d73){_0x24bf32[_0xec0e('0x1c')]=_0x343d73;if(_0x360ef1[_0xec0e('0x2f')][_0xec0e('0x3c')]){_0x9ba7a3[_0xec0e('0x3d')]=[{'all':!![]}];}return db[_0xec0e('0x29')][_0xec0e('0x3e')](_0x9ba7a3);})['then'](function(_0x3a7a67){_0x24bf32[_0xec0e('0x3f')]=_0x3a7a67;return _0x24bf32;})[_0xec0e('0x20')](respondWithFilteredResult(_0x10d8ab,_0x9ba7a3))['catch'](handleError(_0x10d8ab,null));};exports['show']=function(_0x55e3de,_0x373e0e){var _0x507c52={'raw':!![],'where':{'id':_0x55e3de['params']['id']}},_0xef96b6={};_0xef96b6['model']=_[_0xec0e('0x30')](db[_0xec0e('0x29')][_0xec0e('0x2a')]);_0xef96b6[_0xec0e('0x2f')]=_[_0xec0e('0x30')](_0x55e3de[_0xec0e('0x2f')]);_0xef96b6['filters']=_[_0xec0e('0x32')](_0xef96b6['model'],_0xef96b6['query']);_0x507c52[_0xec0e('0x33')]=_['intersection'](_0xef96b6[_0xec0e('0x2e')],qs[_0xec0e('0x34')](_0x55e3de['query']['fields']));_0x507c52['attributes']=_0x507c52[_0xec0e('0x33')][_0xec0e('0x35')]?_0x507c52[_0xec0e('0x33')]:_0xef96b6[_0xec0e('0x2e')];if(_0x55e3de[_0xec0e('0x2f')][_0xec0e('0x3c')]){_0x507c52[_0xec0e('0x3d')]=[{'all':!![]}];}_0x507c52=_['merge']({},_0x507c52,_0x55e3de['options']);return db[_0xec0e('0x29')][_0xec0e('0x40')](_0x507c52)[_0xec0e('0x20')](handleEntityNotFound(_0x373e0e,null))[_0xec0e('0x20')](respondWithResult(_0x373e0e,null))[_0xec0e('0x41')](handleError(_0x373e0e,null));};exports[_0xec0e('0x42')]=function(_0x5b5a92,_0x191d92){return db['SugarcrmField'][_0xec0e('0x42')](_0x5b5a92[_0xec0e('0x43')],{})[_0xec0e('0x20')](respondWithResult(_0x191d92,0xc9))['catch'](handleError(_0x191d92,null));};exports['update']=function(_0x47a221,_0x47ba43){if(_0x47a221[_0xec0e('0x43')]['id']){delete _0x47a221[_0xec0e('0x43')]['id'];}return db[_0xec0e('0x29')]['find']({'where':{'id':_0x47a221[_0xec0e('0x44')]['id']}})[_0xec0e('0x20')](handleEntityNotFound(_0x47ba43,null))['then'](saveUpdates(_0x47a221[_0xec0e('0x43')],null))[_0xec0e('0x20')](respondWithResult(_0x47ba43,null))['catch'](handleError(_0x47ba43,null));};exports[_0xec0e('0x21')]=function(_0x6b390d,_0x150c7a){return db[_0xec0e('0x29')][_0xec0e('0x40')]({'where':{'id':_0x6b390d['params']['id']}})['then'](handleEntityNotFound(_0x150c7a,null))[_0xec0e('0x20')](removeEntity(_0x150c7a,null))[_0xec0e('0x41')](handleError(_0x150c7a,null));}; \ No newline at end of file +var _0xc6bc=['../../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','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x3eadef,_0x4eb7fc){var _0x4db5e2=function(_0x25a430){while(--_0x25a430){_0x3eadef['push'](_0x3eadef['shift']());}};_0x4db5e2(++_0x4eb7fc);}(_0xc6bc,0x128));var _0xcc6b=function(_0xc3050a,_0x3f50b5){_0xc3050a=_0xc3050a-0x0;var _0x433e7a=_0xc6bc[_0xc3050a];return _0x433e7a;};'use strict';var emlformat=require(_0xcc6b('0x0'));var rimraf=require(_0xcc6b('0x1'));var zipdir=require(_0xcc6b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc6b('0x3'));var moment=require('moment');var BPromise=require(_0xcc6b('0x4'));var Mustache=require(_0xcc6b('0x5'));var util=require('util');var path=require(_0xcc6b('0x6'));var sox=require(_0xcc6b('0x7'));var csv=require(_0xcc6b('0x8'));var ejs=require(_0xcc6b('0x9'));var fs=require('fs');var fs_extra=require(_0xcc6b('0xa'));var _=require('lodash');var squel=require(_0xcc6b('0xb'));var crypto=require(_0xcc6b('0xc'));var jsforce=require(_0xcc6b('0xd'));var deskjs=require(_0xcc6b('0xe'));var toCsv=require(_0xcc6b('0x8'));var querystring=require(_0xcc6b('0xf'));var Papa=require(_0xcc6b('0x10'));var Redis=require(_0xcc6b('0x11'));var authService=require(_0xcc6b('0x12'));var qs=require(_0xcc6b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc6b('0x14'));var logger=require('../../config/logger')(_0xcc6b('0x15'));var utils=require(_0xcc6b('0x16'));var config=require(_0xcc6b('0x17'));var licenseUtil=require(_0xcc6b('0x18'));var db=require(_0xcc6b('0x19'))['db'];function respondWithStatusCode(_0xa023a6,_0xe67f50){_0xe67f50=_0xe67f50||0xcc;return function(_0x4c561f){if(_0x4c561f){return _0xa023a6[_0xcc6b('0x1a')](_0xe67f50);}return _0xa023a6[_0xcc6b('0x1b')](_0xe67f50)[_0xcc6b('0x1c')]();};}function respondWithResult(_0x32cdd9,_0x47c396){_0x47c396=_0x47c396||0xc8;return function(_0x347cac){if(_0x347cac){return _0x32cdd9[_0xcc6b('0x1b')](_0x47c396)[_0xcc6b('0x1d')](_0x347cac);}};}function respondWithFilteredResult(_0x469fa7,_0x291982){return function(_0x5cde82){if(_0x5cde82){var _0x47b2ec=typeof _0x291982[_0xcc6b('0x1e')]==='undefined'&&typeof _0x291982['limit']===_0xcc6b('0x1f');var _0x4af6d7=_0x5cde82['count'];var _0x35dc04=_0x47b2ec?0x0:_0x291982['offset'];var _0x5e71c8=_0x47b2ec?_0x5cde82[_0xcc6b('0x20')]:_0x291982['offset']+_0x291982[_0xcc6b('0x21')];var _0x249941;if(_0x5e71c8>=_0x4af6d7){_0x5e71c8=_0x4af6d7;_0x249941=0xc8;}else{_0x249941=0xce;}_0x469fa7['status'](_0x249941);return _0x469fa7[_0xcc6b('0x22')](_0xcc6b('0x23'),_0x35dc04+'-'+_0x5e71c8+'/'+_0x4af6d7)[_0xcc6b('0x1d')](_0x5cde82);}return null;};}function patchUpdates(_0x137250){return function(_0x579de9){try{jsonpatch[_0xcc6b('0x24')](_0x579de9,_0x137250,!![]);}catch(_0x173930){return BPromise[_0xcc6b('0x25')](_0x173930);}return _0x579de9[_0xcc6b('0x26')]();};}function saveUpdates(_0x3a95b8,_0x3d2aa4){return function(_0x49a713){if(_0x49a713){return _0x49a713[_0xcc6b('0x27')](_0x3a95b8)[_0xcc6b('0x28')](function(_0x2a37c5){return _0x2a37c5;});}return null;};}function removeEntity(_0x1df6aa,_0x32d4df){return function(_0x5bb7e6){if(_0x5bb7e6){return _0x5bb7e6[_0xcc6b('0x29')]()[_0xcc6b('0x28')](function(){_0x1df6aa['status'](0xcc)[_0xcc6b('0x1c')]();});}};}function handleEntityNotFound(_0x1ae320,_0x12299c){return function(_0x1703f6){if(!_0x1703f6){_0x1ae320['sendStatus'](0x194);}return _0x1703f6;};}function handleError(_0xec2e05,_0xf77272){_0xf77272=_0xf77272||0x1f4;return function(_0x5e3a0b){logger[_0xcc6b('0x2a')](_0x5e3a0b[_0xcc6b('0x2b')]);if(_0x5e3a0b[_0xcc6b('0x2c')]){delete _0x5e3a0b[_0xcc6b('0x2c')];}_0xec2e05[_0xcc6b('0x1b')](_0xf77272)[_0xcc6b('0x2d')](_0x5e3a0b);};}exports[_0xcc6b('0x2e')]=function(_0x16fbcb,_0x16d647){var _0x3390df={},_0x37eca6={},_0xe5fbd4={'count':0x0,'rows':[]};var _0x3c4c7d=_[_0xcc6b('0x2f')](db[_0xcc6b('0x30')][_0xcc6b('0x31')],function(_0x1377f7){return{'name':_0x1377f7[_0xcc6b('0x32')],'type':_0x1377f7[_0xcc6b('0x33')]['key']};});_0x37eca6[_0xcc6b('0x34')]=_[_0xcc6b('0x2f')](_0x3c4c7d,_0xcc6b('0x2c'));_0x37eca6[_0xcc6b('0x35')]=_[_0xcc6b('0x36')](_0x16fbcb[_0xcc6b('0x35')]);_0x37eca6[_0xcc6b('0x37')]=_[_0xcc6b('0x38')](_0x37eca6[_0xcc6b('0x34')],_0x37eca6['query']);_0x3390df[_0xcc6b('0x39')]=_[_0xcc6b('0x38')](_0x37eca6['model'],qs['fields'](_0x16fbcb[_0xcc6b('0x35')][_0xcc6b('0x3a')]));_0x3390df[_0xcc6b('0x39')]=_0x3390df[_0xcc6b('0x39')][_0xcc6b('0x3b')]?_0x3390df[_0xcc6b('0x39')]:_0x37eca6[_0xcc6b('0x34')];if(!_0x16fbcb[_0xcc6b('0x35')][_0xcc6b('0x3c')](_0xcc6b('0x3d'))){_0x3390df[_0xcc6b('0x21')]=qs['limit'](_0x16fbcb[_0xcc6b('0x35')]['limit']);_0x3390df[_0xcc6b('0x1e')]=qs[_0xcc6b('0x1e')](_0x16fbcb[_0xcc6b('0x35')][_0xcc6b('0x1e')]);}_0x3390df[_0xcc6b('0x3e')]=qs['sort'](_0x16fbcb['query'][_0xcc6b('0x3f')]);_0x3390df[_0xcc6b('0x40')]=qs[_0xcc6b('0x37')](_[_0xcc6b('0x41')](_0x16fbcb['query'],_0x37eca6[_0xcc6b('0x37')]),_0x3c4c7d);if(_0x16fbcb[_0xcc6b('0x35')][_0xcc6b('0x42')]){_0x3390df[_0xcc6b('0x40')]=_['merge'](_0x3390df[_0xcc6b('0x40')],{'$or':_[_0xcc6b('0x2f')](_0x3c4c7d,function(_0x59e2ce){if(_0x59e2ce[_0xcc6b('0x33')]!==_0xcc6b('0x43')){var _0x20f23e={};_0x20f23e[_0x59e2ce[_0xcc6b('0x2c')]]={'$like':'%'+_0x16fbcb[_0xcc6b('0x35')]['filter']+'%'};return _0x20f23e;}})});}_0x3390df=_['merge']({},_0x3390df,_0x16fbcb[_0xcc6b('0x44')]);var _0x5194af={'where':_0x3390df['where']};return db['SugarcrmField'][_0xcc6b('0x20')](_0x5194af)[_0xcc6b('0x28')](function(_0x2f3feb){_0xe5fbd4[_0xcc6b('0x20')]=_0x2f3feb;if(_0x16fbcb[_0xcc6b('0x35')][_0xcc6b('0x45')]){_0x3390df[_0xcc6b('0x46')]=[{'all':!![]}];}return db['SugarcrmField'][_0xcc6b('0x47')](_0x3390df);})[_0xcc6b('0x28')](function(_0x1e04a3){_0xe5fbd4[_0xcc6b('0x48')]=_0x1e04a3;return _0xe5fbd4;})['then'](respondWithFilteredResult(_0x16d647,_0x3390df))[_0xcc6b('0x49')](handleError(_0x16d647,null));};exports[_0xcc6b('0x4a')]=function(_0x2a0075,_0x3107bb){var _0x3fa987={'raw':!![],'where':{'id':_0x2a0075[_0xcc6b('0x4b')]['id']}},_0x3e6604={};_0x3e6604[_0xcc6b('0x34')]=_[_0xcc6b('0x36')](db[_0xcc6b('0x30')]['rawAttributes']);_0x3e6604[_0xcc6b('0x35')]=_['keys'](_0x2a0075['query']);_0x3e6604['filters']=_[_0xcc6b('0x38')](_0x3e6604['model'],_0x3e6604[_0xcc6b('0x35')]);_0x3fa987[_0xcc6b('0x39')]=_['intersection'](_0x3e6604[_0xcc6b('0x34')],qs['fields'](_0x2a0075['query'][_0xcc6b('0x3a')]));_0x3fa987[_0xcc6b('0x39')]=_0x3fa987[_0xcc6b('0x39')]['length']?_0x3fa987[_0xcc6b('0x39')]:_0x3e6604[_0xcc6b('0x34')];if(_0x2a0075[_0xcc6b('0x35')]['includeAll']){_0x3fa987['include']=[{'all':!![]}];}_0x3fa987=_[_0xcc6b('0x4c')]({},_0x3fa987,_0x2a0075['options']);return db['SugarcrmField'][_0xcc6b('0x4d')](_0x3fa987)[_0xcc6b('0x28')](handleEntityNotFound(_0x3107bb,null))[_0xcc6b('0x28')](respondWithResult(_0x3107bb,null))['catch'](handleError(_0x3107bb,null));};exports[_0xcc6b('0x4e')]=function(_0x106db4,_0x211550){return db[_0xcc6b('0x30')][_0xcc6b('0x4e')](_0x106db4[_0xcc6b('0x4f')],{})[_0xcc6b('0x28')](respondWithResult(_0x211550,0xc9))[_0xcc6b('0x49')](handleError(_0x211550,null));};exports[_0xcc6b('0x27')]=function(_0xc5c292,_0x3fc338){if(_0xc5c292['body']['id']){delete _0xc5c292[_0xcc6b('0x4f')]['id'];}return db[_0xcc6b('0x30')]['find']({'where':{'id':_0xc5c292[_0xcc6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3fc338,null))['then'](saveUpdates(_0xc5c292[_0xcc6b('0x4f')],null))[_0xcc6b('0x28')](respondWithResult(_0x3fc338,null))[_0xcc6b('0x49')](handleError(_0x3fc338,null));};exports['destroy']=function(_0x349cb2,_0x1f9c16){return db[_0xcc6b('0x30')][_0xcc6b('0x4d')]({'where':{'id':_0x349cb2[_0xcc6b('0x4b')]['id']}})[_0xcc6b('0x28')](handleEntityNotFound(_0x1f9c16,null))['then'](removeEntity(_0x1f9c16,null))['catch'](handleError(_0x1f9c16,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 78676fc..175799a 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 _0x22fd=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','FieldId'];(function(_0x4efddc,_0x3b6ab4){var _0x54a078=function(_0x179fdf){while(--_0x179fdf){_0x4efddc['push'](_0x4efddc['shift']());}};_0x54a078(++_0x3b6ab4);}(_0x22fd,0x6c));var _0xd22f=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x22fd[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd22f('0x0'))('api');var moment=require(_0xd22f('0x1'));var BPromise=require(_0xd22f('0x2'));var rp=require(_0xd22f('0x3'));var fs=require('fs');var path=require(_0xd22f('0x4'));var rimraf=require(_0xd22f('0x5'));var config=require(_0xd22f('0x6'));var attributes=require(_0xd22f('0x7'));module[_0xd22f('0x8')]=function(_0x1baa81,_0x461d4b){return _0x1baa81[_0xd22f('0x9')]('SugarcrmField',attributes,{'tableName':_0xd22f('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xd22f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd75=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash'];(function(_0x23faff,_0x2ec3e9){var _0x5ce28f=function(_0xf7b942){while(--_0xf7b942){_0x23faff['push'](_0x23faff['shift']());}};_0x5ce28f(++_0x2ec3e9);}(_0xfd75,0x185));var _0x5fd7=function(_0x4ca966,_0x6fdc8){_0x4ca966=_0x4ca966-0x0;var _0x2312b4=_0xfd75[_0x4ca966];return _0x2312b4;};'use strict';var _=require(_0x5fd7('0x0'));var util=require(_0x5fd7('0x1'));var logger=require(_0x5fd7('0x2'))(_0x5fd7('0x3'));var moment=require(_0x5fd7('0x4'));var BPromise=require(_0x5fd7('0x5'));var rp=require(_0x5fd7('0x6'));var fs=require('fs');var path=require(_0x5fd7('0x7'));var rimraf=require('rimraf');var config=require(_0x5fd7('0x8'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x58b146,_0x52b6f2){return _0x58b146[_0x5fd7('0x9')]('SugarcrmField',attributes,{'tableName':_0x5fd7('0xa'),'paranoid':![],'indexes':[{'name':_0x5fd7('0xb'),'fields':[_0x5fd7('0xc'),'FieldId'],'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 8cf66e9..8a66a12 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 _0x5ba1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x150d28,_0x1bca56){var _0x353cfc=function(_0x30d3ec){while(--_0x30d3ec){_0x150d28['push'](_0x150d28['shift']());}};_0x353cfc(++_0x1bca56);}(_0x5ba1,0x86));var _0x15ba=function(_0xeb13d,_0x5e77e5){_0xeb13d=_0xeb13d-0x0;var _0x42aac3=_0x5ba1[_0xeb13d];return _0x42aac3;};'use strict';var _=require(_0x15ba('0x0'));var util=require(_0x15ba('0x1'));var moment=require('moment');var BPromise=require(_0x15ba('0x2'));var rs=require(_0x15ba('0x3'));var fs=require('fs');var Redis=require(_0x15ba('0x4'));var db=require(_0x15ba('0x5'))['db'];var utils=require(_0x15ba('0x6'));var logger=require(_0x15ba('0x7'))('rpc');var config=require(_0x15ba('0x8'));var jayson=require(_0x15ba('0x9'));var client=jayson[_0x15ba('0xa')][_0x15ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54344e,_0x49e906,_0x219952){return new BPromise(function(_0x555803,_0x3bc0d7){return client[_0x15ba('0xc')](_0x54344e,_0x219952)[_0x15ba('0xd')](function(_0x39ab28){logger['info'](_0x15ba('0xe'),_0x49e906,_0x15ba('0xf'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x49e906,_0x15ba('0xf'),JSON[_0x15ba('0x10')](_0x39ab28));if(_0x39ab28[_0x15ba('0x11')]){if(_0x39ab28[_0x15ba('0x11')][_0x15ba('0x12')]===0x1f4){logger['error'](_0x15ba('0xe'),_0x49e906,_0x39ab28[_0x15ba('0x11')][_0x15ba('0x13')]);return _0x3bc0d7(_0x39ab28[_0x15ba('0x11')]['message']);}logger['error'](_0x15ba('0xe'),_0x49e906,_0x39ab28[_0x15ba('0x11')][_0x15ba('0x13')]);return _0x555803(_0x39ab28[_0x15ba('0x11')][_0x15ba('0x13')]);}else{logger[_0x15ba('0x14')](_0x15ba('0xe'),_0x49e906,_0x15ba('0xf'));_0x555803(_0x39ab28[_0x15ba('0x15')][_0x15ba('0x13')]);}})[_0x15ba('0x16')](function(_0x56e684){logger[_0x15ba('0x11')](_0x15ba('0xe'),_0x49e906,_0x56e684);_0x3bc0d7(_0x56e684);});});} \ No newline at end of file +var _0x3e7a=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x3470ab,_0x576570){var _0x4e38f2=function(_0x37fc){while(--_0x37fc){_0x3470ab['push'](_0x3470ab['shift']());}};_0x4e38f2(++_0x576570);}(_0x3e7a,0x1d5));var _0xa3e7=function(_0x4c6388,_0x3f0800){_0x4c6388=_0x4c6388-0x0;var _0xde2375=_0x3e7a[_0x4c6388];return _0xde2375;};'use strict';var _=require(_0xa3e7('0x0'));var util=require(_0xa3e7('0x1'));var moment=require('moment');var BPromise=require(_0xa3e7('0x2'));var rs=require(_0xa3e7('0x3'));var fs=require('fs');var Redis=require(_0xa3e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3e7('0x5'));var logger=require(_0xa3e7('0x6'))('rpc');var config=require(_0xa3e7('0x7'));var jayson=require(_0xa3e7('0x8'));var client=jayson['client'][_0xa3e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1578ca,_0x5edd89,_0x4dc04e){return new BPromise(function(_0x256083,_0x4cd83e){return client[_0xa3e7('0xa')](_0x1578ca,_0x4dc04e)[_0xa3e7('0xb')](function(_0x3beed9){logger[_0xa3e7('0xc')](_0xa3e7('0xd'),_0x5edd89,_0xa3e7('0xe'));logger[_0xa3e7('0xf')](_0xa3e7('0x10'),_0x5edd89,'request\x20sent',JSON[_0xa3e7('0x11')](_0x3beed9));if(_0x3beed9[_0xa3e7('0x12')]){if(_0x3beed9['error'][_0xa3e7('0x13')]===0x1f4){logger[_0xa3e7('0x12')](_0xa3e7('0xd'),_0x5edd89,_0x3beed9['error'][_0xa3e7('0x14')]);return _0x4cd83e(_0x3beed9['error']['message']);}logger[_0xa3e7('0x12')](_0xa3e7('0xd'),_0x5edd89,_0x3beed9[_0xa3e7('0x12')][_0xa3e7('0x14')]);return _0x256083(_0x3beed9['error'][_0xa3e7('0x14')]);}else{logger['info'](_0xa3e7('0xd'),_0x5edd89,_0xa3e7('0xe'));_0x256083(_0x3beed9['result'][_0xa3e7('0x14')]);}})[_0xa3e7('0x15')](function(_0x36dc44){logger[_0xa3e7('0x12')](_0xa3e7('0xd'),_0x5edd89,_0x36dc44);_0x4cd83e(_0x36dc44);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index eebfb64..7acf318 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 _0x6ddd=['create','/:id/configurations','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x3ab195,_0x43281a){var _0x24f0e0=function(_0x451f1c){while(--_0x451f1c){_0x3ab195['push'](_0x3ab195['shift']());}};_0x24f0e0(++_0x43281a);}(_0x6ddd,0xae));var _0xd6dd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6ddd[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd6dd('0x0'));var timeout=require(_0xd6dd('0x1'));var express=require(_0xd6dd('0x2'));var router=express[_0xd6dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd6dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd6dd('0x5'));var controller=require('./intVtigerAccount.controller');router[_0xd6dd('0x6')]('/',auth[_0xd6dd('0x7')](),controller[_0xd6dd('0x8')]);router['get'](_0xd6dd('0x9'),auth[_0xd6dd('0x7')](),controller[_0xd6dd('0xa')]);router[_0xd6dd('0x6')]('/:id/configurations',auth[_0xd6dd('0x7')](),controller[_0xd6dd('0xb')]);router[_0xd6dd('0x6')](_0xd6dd('0xc'),auth[_0xd6dd('0x7')](),controller[_0xd6dd('0xd')]);router[_0xd6dd('0xe')]('/',auth[_0xd6dd('0x7')](),controller[_0xd6dd('0xf')]);router[_0xd6dd('0xe')](_0xd6dd('0x10'),auth[_0xd6dd('0x7')](),controller['addConfiguration']);router[_0xd6dd('0x11')](_0xd6dd('0x9'),auth[_0xd6dd('0x7')](),controller[_0xd6dd('0x12')]);router[_0xd6dd('0x13')](_0xd6dd('0x9'),auth[_0xd6dd('0x7')](),controller['destroy']);module[_0xd6dd('0x14')]=router; \ No newline at end of file +var _0xc288=['show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated'];(function(_0x4e8a59,_0x32bc84){var _0x22ba3e=function(_0x187e2f){while(--_0x187e2f){_0x4e8a59['push'](_0x4e8a59['shift']());}};_0x22ba3e(++_0x32bc84);}(_0xc288,0x18b));var _0x8c28=function(_0x9088d7,_0x4d9757){_0x9088d7=_0x9088d7-0x0;var _0x192f7a=_0xc288[_0x9088d7];return _0x192f7a;};'use strict';var multer=require(_0x8c28('0x0'));var util=require('util');var path=require(_0x8c28('0x1'));var timeout=require(_0x8c28('0x2'));var express=require(_0x8c28('0x3'));var router=express[_0x8c28('0x4')]();var fs_extra=require(_0x8c28('0x5'));var auth=require(_0x8c28('0x6'));var interaction=require(_0x8c28('0x7'));var config=require(_0x8c28('0x8'));var controller=require(_0x8c28('0x9'));router[_0x8c28('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c28('0xb')]);router['get']('/:id',auth[_0x8c28('0xc')](),controller[_0x8c28('0xd')]);router[_0x8c28('0xa')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0xf')]);router['get'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x8c28('0x11')]);router[_0x8c28('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8c28('0x13')]);router['put'](_0x8c28('0x14'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x15')]);router['delete'](_0x8c28('0x14'),auth['isAuthenticated'](),controller[_0x8c28('0x16')]);module[_0x8c28('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 9b0f5df..1dad57a 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 _0x0345=['STRING','HelpDesk','exports'];(function(_0x40e7ca,_0x52a2fd){var _0x209764=function(_0xf4f206){while(--_0xf4f206){_0x40e7ca['push'](_0x40e7ca['shift']());}};_0x209764(++_0x52a2fd);}(_0x0345,0x1ac));var _0x5034=function(_0x55db1c,_0x1251a9){_0x55db1c=_0x55db1c-0x0;var _0x3004e1=_0x0345[_0x55db1c];return _0x3004e1;};'use strict';var Sequelize=require('sequelize');module[_0x5034('0x0')]={'name':{'type':Sequelize[_0x5034('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5034('0x1')]},'username':{'type':Sequelize[_0x5034('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5034('0x1')],'allowNull':![],'defaultValue':_0x5034('0x2')},'remoteUri':{'type':Sequelize[_0x5034('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5034('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5034('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc761=['sequelize','STRING','HelpDesk'];(function(_0x53efa4,_0x1e673b){var _0x276274=function(_0x5a0479){while(--_0x5a0479){_0x53efa4['push'](_0x53efa4['shift']());}};_0x276274(++_0x1e673b);}(_0xc761,0x10b));var _0x1c76=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0xc761[_0x466a1a];return _0x577165;};'use strict';var Sequelize=require(_0x1c76('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1c76('0x1')]},'username':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![],'defaultValue':_0x1c76('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1c76('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 7c50ec5..a2e4721 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 _0x633e=['getSubjects','channel','Descriptions','Subjects','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','describe','sessionName','autogenerated','owner','remove','result','includes','editable','false','startsWith','cf_','picklistValues','label','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../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','offset','limit','undefined','count','Content-Range','reject','save','update','then','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','options','include','rows','catch','show','params','keys','find','create','body','destroy','findOne','VtigerConfiguration','order','nolimit','getConfigurations','AccountId'];(function(_0x5dec83,_0x13f65d){var _0xdcdb16=function(_0x428720){while(--_0x428720){_0x5dec83['push'](_0x5dec83['shift']());}};_0xdcdb16(++_0x13f65d);}(_0x633e,0x112));var _0xe633=function(_0x543410,_0x459093){_0x543410=_0x543410-0x0;var _0x4f26ac=_0x633e[_0x543410];return _0x4f26ac;};'use strict';var emlformat=require(_0xe633('0x0'));var rimraf=require(_0xe633('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe633('0x2'));var moment=require(_0xe633('0x3'));var BPromise=require(_0xe633('0x4'));var Mustache=require(_0xe633('0x5'));var util=require(_0xe633('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe633('0x7'));var _=require(_0xe633('0x8'));var squel=require(_0xe633('0x9'));var crypto=require(_0xe633('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe633('0xb'));var Papa=require(_0xe633('0xc'));var Redis=require('ioredis');var authService=require(_0xe633('0xd'));var qs=require(_0xe633('0xe'));var as=require(_0xe633('0xf'));var hardwareService=require(_0xe633('0x10'));var logger=require(_0xe633('0x11'))('api');var utils=require(_0xe633('0x12'));var config=require(_0xe633('0x13'));var licenseUtil=require(_0xe633('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe633('0x15'));function respondWithStatusCode(_0xa45826,_0x1c3cbd){_0x1c3cbd=_0x1c3cbd||0xcc;return function(_0x5cba71){if(_0x5cba71){return _0xa45826[_0xe633('0x16')](_0x1c3cbd);}return _0xa45826[_0xe633('0x17')](_0x1c3cbd)[_0xe633('0x18')]();};}function respondWithResult(_0x5314dc,_0x294ba7){_0x294ba7=_0x294ba7||0xc8;return function(_0xdca9c1){if(_0xdca9c1){return _0x5314dc[_0xe633('0x17')](_0x294ba7)[_0xe633('0x19')](_0xdca9c1);}};}function respondWithFilteredResult(_0x33aae7,_0x8199ec){return function(_0xcbc2a2){if(_0xcbc2a2){var _0x2c8849=typeof _0x8199ec[_0xe633('0x1a')]==='undefined'&&typeof _0x8199ec[_0xe633('0x1b')]===_0xe633('0x1c');var _0x4c38b1=_0xcbc2a2['count'];var _0x589591=_0x2c8849?0x0:_0x8199ec[_0xe633('0x1a')];var _0x43dd25=_0x2c8849?_0xcbc2a2[_0xe633('0x1d')]:_0x8199ec['offset']+_0x8199ec[_0xe633('0x1b')];var _0x2a796c;if(_0x43dd25>=_0x4c38b1){_0x43dd25=_0x4c38b1;_0x2a796c=0xc8;}else{_0x2a796c=0xce;}_0x33aae7[_0xe633('0x17')](_0x2a796c);return _0x33aae7['set'](_0xe633('0x1e'),_0x589591+'-'+_0x43dd25+'/'+_0x4c38b1)[_0xe633('0x19')](_0xcbc2a2);}return null;};}function patchUpdates(_0x3d715b){return function(_0x59a6ae){try{jsonpatch['apply'](_0x59a6ae,_0x3d715b,!![]);}catch(_0x2114d4){return BPromise[_0xe633('0x1f')](_0x2114d4);}return _0x59a6ae[_0xe633('0x20')]();};}function saveUpdates(_0x3137d9,_0x5a39c2){return function(_0x147b52){if(_0x147b52){return _0x147b52[_0xe633('0x21')](_0x3137d9)[_0xe633('0x22')](function(_0x17d61c){return _0x17d61c;});}return null;};}function removeEntity(_0x29ba3e,_0x2be86a){return function(_0x4c9f6c){if(_0x4c9f6c){return _0x4c9f6c['destroy']()[_0xe633('0x22')](function(){_0x29ba3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d00b,_0x14004b){return function(_0x1d921b){if(!_0x1d921b){_0x21d00b[_0xe633('0x16')](0x194);}return _0x1d921b;};}function handleError(_0x26d94c,_0x337baf){_0x337baf=_0x337baf||0x1f4;return function(_0x1ff6eb){logger[_0xe633('0x23')](_0x1ff6eb['stack']);if(_0x1ff6eb[_0xe633('0x24')]){delete _0x1ff6eb['name'];}_0x26d94c[_0xe633('0x17')](_0x337baf)[_0xe633('0x25')](_0x1ff6eb);};}exports[_0xe633('0x26')]=function(_0x3dcbc2,_0x50146e){var _0xeb33cf={},_0x3db814={},_0x333efa={'count':0x0,'rows':[]};var _0x16b8cc=_[_0xe633('0x27')](db[_0xe633('0x28')][_0xe633('0x29')],function(_0x437dc9){return{'name':_0x437dc9[_0xe633('0x2a')],'type':_0x437dc9[_0xe633('0x2b')]['key']};});_0x3db814[_0xe633('0x2c')]=_[_0xe633('0x27')](_0x16b8cc,_0xe633('0x24'));_0x3db814[_0xe633('0x2d')]=_['keys'](_0x3dcbc2[_0xe633('0x2d')]);_0x3db814['filters']=_[_0xe633('0x2e')](_0x3db814['model'],_0x3db814[_0xe633('0x2d')]);_0xeb33cf[_0xe633('0x2f')]=_[_0xe633('0x2e')](_0x3db814[_0xe633('0x2c')],qs[_0xe633('0x30')](_0x3dcbc2[_0xe633('0x2d')][_0xe633('0x30')]));_0xeb33cf['attributes']=_0xeb33cf[_0xe633('0x2f')][_0xe633('0x31')]?_0xeb33cf['attributes']:_0x3db814[_0xe633('0x2c')];if(!_0x3dcbc2[_0xe633('0x2d')][_0xe633('0x32')]('nolimit')){_0xeb33cf[_0xe633('0x1b')]=qs[_0xe633('0x1b')](_0x3dcbc2[_0xe633('0x2d')][_0xe633('0x1b')]);_0xeb33cf[_0xe633('0x1a')]=qs['offset'](_0x3dcbc2[_0xe633('0x2d')]['offset']);}_0xeb33cf['order']=qs[_0xe633('0x33')](_0x3dcbc2[_0xe633('0x2d')]['sort']);_0xeb33cf['where']=qs[_0xe633('0x34')](_[_0xe633('0x35')](_0x3dcbc2[_0xe633('0x2d')],_0x3db814[_0xe633('0x34')]),_0x16b8cc);if(_0x3dcbc2['query'][_0xe633('0x36')]){_0xeb33cf[_0xe633('0x37')]=_[_0xe633('0x38')](_0xeb33cf[_0xe633('0x37')],{'$or':_[_0xe633('0x27')](_0x16b8cc,function(_0x5d5bce){if(_0x5d5bce['type']!=='VIRTUAL'){var _0x4d2bcb={};_0x4d2bcb[_0x5d5bce[_0xe633('0x24')]]={'$like':'%'+_0x3dcbc2[_0xe633('0x2d')][_0xe633('0x36')]+'%'};return _0x4d2bcb;}})});}_0xeb33cf=_[_0xe633('0x38')]({},_0xeb33cf,_0x3dcbc2[_0xe633('0x39')]);var _0x119e5d={'where':_0xeb33cf[_0xe633('0x37')]};return db[_0xe633('0x28')][_0xe633('0x1d')](_0x119e5d)[_0xe633('0x22')](function(_0x237257){_0x333efa['count']=_0x237257;if(_0x3dcbc2[_0xe633('0x2d')]['includeAll']){_0xeb33cf[_0xe633('0x3a')]=[{'all':!![]}];}return db[_0xe633('0x28')]['findAll'](_0xeb33cf);})[_0xe633('0x22')](function(_0x4092a9){_0x333efa[_0xe633('0x3b')]=_0x4092a9;return _0x333efa;})['then'](respondWithFilteredResult(_0x50146e,_0xeb33cf))[_0xe633('0x3c')](handleError(_0x50146e,null));};exports[_0xe633('0x3d')]=function(_0x2f399e,_0x4da4fc){var _0x48d3df={'raw':![],'where':{'id':_0x2f399e[_0xe633('0x3e')]['id']}},_0x57f6f3={};_0x57f6f3[_0xe633('0x2c')]=_[_0xe633('0x3f')](db[_0xe633('0x28')][_0xe633('0x29')]);_0x57f6f3[_0xe633('0x2d')]=_[_0xe633('0x3f')](_0x2f399e[_0xe633('0x2d')]);_0x57f6f3['filters']=_[_0xe633('0x2e')](_0x57f6f3[_0xe633('0x2c')],_0x57f6f3['query']);_0x48d3df[_0xe633('0x2f')]=_[_0xe633('0x2e')](_0x57f6f3['model'],qs[_0xe633('0x30')](_0x2f399e[_0xe633('0x2d')]['fields']));_0x48d3df[_0xe633('0x2f')]=_0x48d3df[_0xe633('0x2f')]['length']?_0x48d3df[_0xe633('0x2f')]:_0x57f6f3['model'];if(_0x2f399e['query']['includeAll']){_0x48d3df[_0xe633('0x3a')]=[{'all':!![]}];}_0x48d3df=_['merge']({},_0x48d3df,_0x2f399e[_0xe633('0x39')]);return db['VtigerAccount'][_0xe633('0x40')](_0x48d3df)[_0xe633('0x22')](handleEntityNotFound(_0x4da4fc,null))[_0xe633('0x22')](respondWithResult(_0x4da4fc,null))[_0xe633('0x3c')](handleError(_0x4da4fc,null));};exports[_0xe633('0x41')]=function(_0x13362c,_0x504e30){return db['VtigerAccount']['create'](_0x13362c[_0xe633('0x42')],{})[_0xe633('0x22')](respondWithResult(_0x504e30,0xc9))[_0xe633('0x3c')](handleError(_0x504e30,null));};exports[_0xe633('0x21')]=function(_0x2cc423,_0x4a6d6d){if(_0x2cc423['body']['id']){delete _0x2cc423['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x2cc423[_0xe633('0x3e')]['id']}})[_0xe633('0x22')](handleEntityNotFound(_0x4a6d6d,null))['then'](saveUpdates(_0x2cc423[_0xe633('0x42')],null))[_0xe633('0x22')](respondWithResult(_0x4a6d6d,null))[_0xe633('0x3c')](handleError(_0x4a6d6d,null));};exports[_0xe633('0x43')]=function(_0xe7e937,_0x2b013b){return db[_0xe633('0x28')][_0xe633('0x40')]({'where':{'id':_0xe7e937[_0xe633('0x3e')]['id']}})[_0xe633('0x22')](handleEntityNotFound(_0x2b013b,null))[_0xe633('0x22')](removeEntity(_0x2b013b,null))[_0xe633('0x3c')](handleError(_0x2b013b,null));};exports['getConfigurations']=function(_0x18b65d,_0x31acfa,_0x52d805){var _0x4e8ffb={};var _0x58a860={};var _0x3130b5;var _0x4f8fbe;return db[_0xe633('0x28')][_0xe633('0x44')]({'where':{'id':_0x18b65d[_0xe633('0x3e')]['id']}})['then'](handleEntityNotFound(_0x31acfa,null))[_0xe633('0x22')](function(_0x406726){if(_0x406726){_0x3130b5=_0x406726;_0x58a860[_0xe633('0x2c')]=_[_0xe633('0x3f')](db[_0xe633('0x45')][_0xe633('0x29')]);_0x58a860[_0xe633('0x2d')]=_[_0xe633('0x3f')](_0x18b65d[_0xe633('0x2d')]);_0x58a860['filters']=_[_0xe633('0x2e')](_0x58a860[_0xe633('0x2c')],_0x58a860[_0xe633('0x2d')]);_0x4e8ffb[_0xe633('0x2f')]=_[_0xe633('0x2e')](_0x58a860[_0xe633('0x2c')],qs[_0xe633('0x30')](_0x18b65d[_0xe633('0x2d')][_0xe633('0x30')]));_0x4e8ffb['attributes']=_0x4e8ffb[_0xe633('0x2f')][_0xe633('0x31')]?_0x4e8ffb[_0xe633('0x2f')]:_0x58a860[_0xe633('0x2c')];_0x4e8ffb[_0xe633('0x46')]=qs[_0xe633('0x33')](_0x18b65d[_0xe633('0x2d')][_0xe633('0x33')]);_0x4e8ffb['where']=qs[_0xe633('0x34')](_[_0xe633('0x35')](_0x18b65d['query'],_0x58a860[_0xe633('0x34')]));if(_0x18b65d['query'][_0xe633('0x36')]){_0x4e8ffb[_0xe633('0x37')]=_[_0xe633('0x38')](_0x4e8ffb[_0xe633('0x37')],{'$or':_[_0xe633('0x27')](_0x4e8ffb['attributes'],function(_0x3c6449){var _0x59dd20={};_0x59dd20[_0x3c6449]={'$like':'%'+_0x18b65d[_0xe633('0x2d')]['filter']+'%'};return _0x59dd20;})});}_0x4e8ffb=_[_0xe633('0x38')]({},_0x4e8ffb,_0x18b65d[_0xe633('0x39')]);return _0x3130b5['getConfigurations'](_0x4e8ffb);}})[_0xe633('0x22')](function(_0x101dbe){if(_0x101dbe){_0x4f8fbe=_0x101dbe['length'];if(!_0x18b65d[_0xe633('0x2d')][_0xe633('0x32')](_0xe633('0x47'))){_0x4e8ffb[_0xe633('0x1b')]=qs['limit'](_0x18b65d[_0xe633('0x2d')]['limit']);_0x4e8ffb[_0xe633('0x1a')]=qs[_0xe633('0x1a')](_0x18b65d[_0xe633('0x2d')][_0xe633('0x1a')]);}return _0x3130b5[_0xe633('0x48')](_0x4e8ffb);}})[_0xe633('0x22')](function(_0x11fcf9){if(_0x11fcf9){return _0x11fcf9?{'count':_0x4f8fbe,'rows':_0x11fcf9}:null;}})[_0xe633('0x22')](respondWithResult(_0x31acfa,null))[_0xe633('0x3c')](handleError(_0x31acfa,null));};exports['addConfiguration']=function(_0x22c924,_0x138825,_0x5e6f94){if(_0x22c924['body']['id']){delete _0x22c924[_0xe633('0x42')]['id'];}return db[_0xe633('0x28')]['findOne']({'where':{'id':_0x22c924[_0xe633('0x3e')]['id']}})['then'](handleEntityNotFound(_0x138825,null))[_0xe633('0x22')](function(_0x13185b){if(_0x13185b){_0x22c924[_0xe633('0x42')][_0xe633('0x49')]=_0x13185b['id'];_0x22c924[_0xe633('0x42')]['Subjects']=integrations[_0xe633('0x4a')](_0x22c924[_0xe633('0x42')][_0xe633('0x4b')],_0x22c924[_0xe633('0x42')]['type']);_0x22c924[_0xe633('0x42')][_0xe633('0x4c')]=integrations['getDescriptions'](_0x22c924[_0xe633('0x42')][_0xe633('0x4b')],_0x22c924[_0xe633('0x42')]['type']);return db[_0xe633('0x45')][_0xe633('0x41')](_0x22c924['body'],{'include':[{'model':db['VtigerField'],'as':_0xe633('0x4d')},{'model':db[_0xe633('0x4e')],'as':_0xe633('0x4c')}]});}return null;})['then'](respondWithResult(_0x138825,null))['catch'](handleError(_0x138825,null));};var md5=require(_0xe633('0x4f'));exports[_0xe633('0x50')]=function(_0x247d81,_0x4f4f8a,_0x35923f){var _0x4c14f0=null;var _0x1f46b8=null;var _0x48fc43=null;var _0x526fb9=null;var _0x368474='';return db[_0xe633('0x28')]['findOne']({'where':{'id':_0x247d81[_0xe633('0x3e')]['id']},'attributes':['id','name',_0xe633('0x51'),_0xe633('0x52'),_0xe633('0x53'),_0xe633('0x54'),_0xe633('0x55'),_0xe633('0x56')]})['then'](handleEntityNotFound(_0x4f4f8a,null))[_0xe633('0x22')](function(_0x2b6433){if(_0x2b6433){_0x4c14f0=_0x2b6433['username'];_0x1f46b8=_0x2b6433[_0xe633('0x56')];_0x48fc43=_0x2b6433['moduleName'];_0x368474=_0x2b6433['remoteUri'];var _0x28b92a=_0x368474['slice'](-0x1);if(_0x28b92a==='/'){_0x368474=_0x368474[_0xe633('0x57')](0x0,_0x368474[_0xe633('0x58')](_0x28b92a));}_0x526fb9=util[_0xe633('0x59')](_0xe633('0x5a'),_0x368474);var _0x1ea316={'method':_0xe633('0x5b'),'uri':_0x526fb9,'qs':{'operation':_0xe633('0x5c'),'username':_0x2b6433['username']},'json':!![]};return rp(_0x1ea316);}})[_0xe633('0x22')](function(_0x1b5c65){if(_0x1b5c65['success']){var _0x3b3ed2={'method':_0xe633('0x5d'),'uri':_0x526fb9,'form':{'operation':_0xe633('0x5e'),'username':_0x4c14f0,'accessKey':md5(_0x1b5c65['result'][_0xe633('0x5f')]+_0x1f46b8)},'json':!![]};return rp(_0x3b3ed2);}})['then'](function(_0x7203a6){if(_0x7203a6[_0xe633('0x60')]){var _0x58bcb1={'method':_0xe633('0x5b'),'uri':_0x526fb9,'qs':{'operation':_0xe633('0x61'),'username':_0x4c14f0,'sessionName':_0x7203a6['result'][_0xe633('0x62')],'elementType':_0x48fc43},'json':!![]};return rp(_0x58bcb1);}})[_0xe633('0x22')](function(_0x1fbca1){if(_0x1fbca1[_0xe633('0x60')]){var _0x360165=[_0xe633('0x63'),'reference',_0xe633('0x64')];_[_0xe633('0x65')](_0x1fbca1[_0xe633('0x66')][_0xe633('0x30')],function(_0x34b469){return _0x360165[_0xe633('0x67')](_0x34b469[_0xe633('0x2b')][_0xe633('0x24')]);});_[_0xe633('0x65')](_0x1fbca1[_0xe633('0x66')][_0xe633('0x30')],function(_0x45a66f){return _0x45a66f[_0xe633('0x68')]===_0xe633('0x69');});return{'count':_0x1fbca1[_0xe633('0x66')][_0xe633('0x30')][_0xe633('0x31')],'rows':_[_0xe633('0x27')](_0x1fbca1['result'][_0xe633('0x30')],function(_0x2ef224){return{'id':_0x2ef224[_0xe633('0x24')],'name':_0x2ef224['label'],'custom':_[_0xe633('0x6a')](_0x2ef224[_0xe633('0x24')],_0xe633('0x6b'))?!![]:![],'options':_0x2ef224[_0xe633('0x2b')][_0xe633('0x24')]==='picklist'&&_0x2ef224[_0xe633('0x2b')][_0xe633('0x6c')][_0xe633('0x31')]>0x0?_[_0xe633('0x27')](_0x2ef224['type'][_0xe633('0x6c')],function(_0x4f4358){return{'name':_0x4f4358[_0xe633('0x6d')],'value':_0x4f4358[_0xe633('0x6e')]};}):[]};})};}})[_0xe633('0x22')](respondWithResult(_0x4f4f8a,null))[_0xe633('0x3c')](function(_0x99da68){console[_0xe633('0x6f')]('vTiger\x20error:\x20'+_0x99da68);var _0x5df350=_0x247d81[_0xe633('0x2d')]['test']?0x1f4:_0x99da68[_0xe633('0x70')]||0x1f4;logger[_0xe633('0x23')](_0xe633('0x71'),'getFields',_0x5df350,JSON[_0xe633('0x72')](_0x99da68));delete _0x99da68[_0xe633('0x24')];if(_0x5df350===0x191){_0x5df350=0x190;}_0x4f4f8a[_0xe633('0x17')](_0x5df350)['send'](_0x247d81[_0xe633('0x2d')]['test']?{'message':_0xe633('0x73'),'statusCode':_0x99da68[_0xe633('0x70')]}:_0x99da68);});}; \ No newline at end of file +var _0x12e1=['pick','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','autogenerated','remove','includes','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','sendStatus','error','stack','name','index','map','VtigerAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','order'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x12e1,0x180));var _0x112e=function(_0x2d580b,_0x52956e){_0x2d580b=_0x2d580b-0x0;var _0x2aeaa2=_0x12e1[_0x2d580b];return _0x2aeaa2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x112e('0x0'));var jsonpatch=require(_0x112e('0x1'));var rp=require(_0x112e('0x2'));var moment=require('moment');var BPromise=require(_0x112e('0x3'));var Mustache=require(_0x112e('0x4'));var util=require(_0x112e('0x5'));var path=require(_0x112e('0x6'));var sox=require(_0x112e('0x7'));var csv=require(_0x112e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x112e('0x9'));var _=require(_0x112e('0xa'));var squel=require(_0x112e('0xb'));var crypto=require(_0x112e('0xc'));var jsforce=require(_0x112e('0xd'));var deskjs=require(_0x112e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x112e('0xf'));var Redis=require(_0x112e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x112e('0x11'));var as=require(_0x112e('0x12'));var hardwareService=require(_0x112e('0x13'));var logger=require(_0x112e('0x14'))(_0x112e('0x15'));var utils=require(_0x112e('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x102763,_0x5341dd){_0x5341dd=_0x5341dd||0xcc;return function(_0x4f35c4){if(_0x4f35c4){return _0x102763['sendStatus'](_0x5341dd);}return _0x102763[_0x112e('0x17')](_0x5341dd)['end']();};}function respondWithResult(_0xc21d6f,_0x2e1096){_0x2e1096=_0x2e1096||0xc8;return function(_0x106f65){if(_0x106f65){return _0xc21d6f['status'](_0x2e1096)[_0x112e('0x18')](_0x106f65);}};}function respondWithFilteredResult(_0x176d7f,_0x414b6c){return function(_0xcd9bbd){if(_0xcd9bbd){var _0x3fa7ee=typeof _0x414b6c['offset']===_0x112e('0x19')&&typeof _0x414b6c[_0x112e('0x1a')]===_0x112e('0x19');var _0x1134c2=_0xcd9bbd[_0x112e('0x1b')];var _0x356c48=_0x3fa7ee?0x0:_0x414b6c[_0x112e('0x1c')];var _0x14be2a=_0x3fa7ee?_0xcd9bbd[_0x112e('0x1b')]:_0x414b6c[_0x112e('0x1c')]+_0x414b6c['limit'];var _0x1831ad;if(_0x14be2a>=_0x1134c2){_0x14be2a=_0x1134c2;_0x1831ad=0xc8;}else{_0x1831ad=0xce;}_0x176d7f['status'](_0x1831ad);return _0x176d7f[_0x112e('0x1d')](_0x112e('0x1e'),_0x356c48+'-'+_0x14be2a+'/'+_0x1134c2)[_0x112e('0x18')](_0xcd9bbd);}return null;};}function patchUpdates(_0x2ecfd6){return function(_0x3e6af0){try{jsonpatch[_0x112e('0x1f')](_0x3e6af0,_0x2ecfd6,!![]);}catch(_0x43a8f6){return BPromise[_0x112e('0x20')](_0x43a8f6);}return _0x3e6af0['save']();};}function saveUpdates(_0x54c273,_0x535382){return function(_0x3ef0ef){if(_0x3ef0ef){return _0x3ef0ef['update'](_0x54c273)[_0x112e('0x21')](function(_0x1bfb1c){return _0x1bfb1c;});}return null;};}function removeEntity(_0x5ad086,_0x1c2072){return function(_0x26c9d5){if(_0x26c9d5){return _0x26c9d5[_0x112e('0x22')]()[_0x112e('0x21')](function(){_0x5ad086['status'](0xcc)[_0x112e('0x23')]();});}};}function handleEntityNotFound(_0x589f05,_0x34d926){return function(_0x42a2da){if(!_0x42a2da){_0x589f05[_0x112e('0x24')](0x194);}return _0x42a2da;};}function handleError(_0xf05112,_0x4e0780){_0x4e0780=_0x4e0780||0x1f4;return function(_0x1cba17){logger[_0x112e('0x25')](_0x1cba17[_0x112e('0x26')]);if(_0x1cba17[_0x112e('0x27')]){delete _0x1cba17[_0x112e('0x27')];}_0xf05112[_0x112e('0x17')](_0x4e0780)['send'](_0x1cba17);};}exports[_0x112e('0x28')]=function(_0x44ca5b,_0x50d974){var _0x1a792f={},_0x137542={},_0x2c29ac={'count':0x0,'rows':[]};var _0xe25a33=_[_0x112e('0x29')](db[_0x112e('0x2a')]['rawAttributes'],function(_0x48ca67){return{'name':_0x48ca67[_0x112e('0x2b')],'type':_0x48ca67[_0x112e('0x2c')]['key']};});_0x137542[_0x112e('0x2d')]=_[_0x112e('0x29')](_0xe25a33,_0x112e('0x27'));_0x137542[_0x112e('0x2e')]=_[_0x112e('0x2f')](_0x44ca5b[_0x112e('0x2e')]);_0x137542[_0x112e('0x30')]=_[_0x112e('0x31')](_0x137542[_0x112e('0x2d')],_0x137542[_0x112e('0x2e')]);_0x1a792f[_0x112e('0x32')]=_[_0x112e('0x31')](_0x137542[_0x112e('0x2d')],qs[_0x112e('0x33')](_0x44ca5b[_0x112e('0x2e')]['fields']));_0x1a792f[_0x112e('0x32')]=_0x1a792f[_0x112e('0x32')][_0x112e('0x34')]?_0x1a792f[_0x112e('0x32')]:_0x137542[_0x112e('0x2d')];if(!_0x44ca5b['query'][_0x112e('0x35')](_0x112e('0x36'))){_0x1a792f[_0x112e('0x1a')]=qs['limit'](_0x44ca5b['query'][_0x112e('0x1a')]);_0x1a792f[_0x112e('0x1c')]=qs[_0x112e('0x1c')](_0x44ca5b[_0x112e('0x2e')][_0x112e('0x1c')]);}_0x1a792f['order']=qs[_0x112e('0x37')](_0x44ca5b[_0x112e('0x2e')]['sort']);_0x1a792f['where']=qs['filters'](_['pick'](_0x44ca5b[_0x112e('0x2e')],_0x137542[_0x112e('0x30')]),_0xe25a33);if(_0x44ca5b[_0x112e('0x2e')][_0x112e('0x38')]){_0x1a792f[_0x112e('0x39')]=_[_0x112e('0x3a')](_0x1a792f[_0x112e('0x39')],{'$or':_[_0x112e('0x29')](_0xe25a33,function(_0x4c48c4){if(_0x4c48c4[_0x112e('0x2c')]!==_0x112e('0x3b')){var _0x5e7b4b={};_0x5e7b4b[_0x4c48c4[_0x112e('0x27')]]={'$like':'%'+_0x44ca5b[_0x112e('0x2e')][_0x112e('0x38')]+'%'};return _0x5e7b4b;}})});}_0x1a792f=_['merge']({},_0x1a792f,_0x44ca5b[_0x112e('0x3c')]);var _0x5442f0={'where':_0x1a792f[_0x112e('0x39')]};return db['VtigerAccount'][_0x112e('0x1b')](_0x5442f0)[_0x112e('0x21')](function(_0x2c031b){_0x2c29ac[_0x112e('0x1b')]=_0x2c031b;if(_0x44ca5b['query'][_0x112e('0x3d')]){_0x1a792f[_0x112e('0x3e')]=[{'all':!![]}];}return db[_0x112e('0x2a')][_0x112e('0x3f')](_0x1a792f);})['then'](function(_0x10db6c){_0x2c29ac[_0x112e('0x40')]=_0x10db6c;return _0x2c29ac;})[_0x112e('0x21')](respondWithFilteredResult(_0x50d974,_0x1a792f))[_0x112e('0x41')](handleError(_0x50d974,null));};exports['show']=function(_0x2f9493,_0x394ee0){var _0x53f3d7={'raw':![],'where':{'id':_0x2f9493[_0x112e('0x42')]['id']}},_0x5cb8b5={};_0x5cb8b5['model']=_[_0x112e('0x2f')](db[_0x112e('0x2a')][_0x112e('0x43')]);_0x5cb8b5[_0x112e('0x2e')]=_[_0x112e('0x2f')](_0x2f9493[_0x112e('0x2e')]);_0x5cb8b5[_0x112e('0x30')]=_['intersection'](_0x5cb8b5['model'],_0x5cb8b5[_0x112e('0x2e')]);_0x53f3d7[_0x112e('0x32')]=_[_0x112e('0x31')](_0x5cb8b5[_0x112e('0x2d')],qs[_0x112e('0x33')](_0x2f9493[_0x112e('0x2e')][_0x112e('0x33')]));_0x53f3d7[_0x112e('0x32')]=_0x53f3d7[_0x112e('0x32')][_0x112e('0x34')]?_0x53f3d7[_0x112e('0x32')]:_0x5cb8b5['model'];if(_0x2f9493[_0x112e('0x2e')][_0x112e('0x3d')]){_0x53f3d7['include']=[{'all':!![]}];}_0x53f3d7=_['merge']({},_0x53f3d7,_0x2f9493[_0x112e('0x3c')]);return db[_0x112e('0x2a')][_0x112e('0x44')](_0x53f3d7)[_0x112e('0x21')](handleEntityNotFound(_0x394ee0,null))[_0x112e('0x21')](respondWithResult(_0x394ee0,null))[_0x112e('0x41')](handleError(_0x394ee0,null));};exports[_0x112e('0x45')]=function(_0x3958e2,_0x3c8563){return db[_0x112e('0x2a')]['create'](_0x3958e2[_0x112e('0x46')],{})[_0x112e('0x21')](respondWithResult(_0x3c8563,0xc9))['catch'](handleError(_0x3c8563,null));};exports[_0x112e('0x47')]=function(_0x132298,_0x5838d1){if(_0x132298[_0x112e('0x46')]['id']){delete _0x132298[_0x112e('0x46')]['id'];}return db[_0x112e('0x2a')][_0x112e('0x44')]({'where':{'id':_0x132298[_0x112e('0x42')]['id']}})[_0x112e('0x21')](handleEntityNotFound(_0x5838d1,null))[_0x112e('0x21')](saveUpdates(_0x132298[_0x112e('0x46')],null))[_0x112e('0x21')](respondWithResult(_0x5838d1,null))['catch'](handleError(_0x5838d1,null));};exports[_0x112e('0x22')]=function(_0x4dafb3,_0x4ede85){return db[_0x112e('0x2a')][_0x112e('0x44')]({'where':{'id':_0x4dafb3[_0x112e('0x42')]['id']}})[_0x112e('0x21')](handleEntityNotFound(_0x4ede85,null))[_0x112e('0x21')](removeEntity(_0x4ede85,null))['catch'](handleError(_0x4ede85,null));};exports[_0x112e('0x48')]=function(_0x267d04,_0x328146,_0x28cb24){var _0x4da0cc={};var _0x51446d={};var _0x5bb29c;var _0x14d883;return db['VtigerAccount'][_0x112e('0x49')]({'where':{'id':_0x267d04[_0x112e('0x42')]['id']}})[_0x112e('0x21')](handleEntityNotFound(_0x328146,null))['then'](function(_0x7af6e6){if(_0x7af6e6){_0x5bb29c=_0x7af6e6;_0x51446d['model']=_[_0x112e('0x2f')](db[_0x112e('0x4a')][_0x112e('0x43')]);_0x51446d[_0x112e('0x2e')]=_[_0x112e('0x2f')](_0x267d04[_0x112e('0x2e')]);_0x51446d[_0x112e('0x30')]=_['intersection'](_0x51446d[_0x112e('0x2d')],_0x51446d[_0x112e('0x2e')]);_0x4da0cc[_0x112e('0x32')]=_[_0x112e('0x31')](_0x51446d[_0x112e('0x2d')],qs[_0x112e('0x33')](_0x267d04['query']['fields']));_0x4da0cc[_0x112e('0x32')]=_0x4da0cc[_0x112e('0x32')][_0x112e('0x34')]?_0x4da0cc['attributes']:_0x51446d[_0x112e('0x2d')];_0x4da0cc[_0x112e('0x4b')]=qs[_0x112e('0x37')](_0x267d04[_0x112e('0x2e')][_0x112e('0x37')]);_0x4da0cc['where']=qs[_0x112e('0x30')](_[_0x112e('0x4c')](_0x267d04['query'],_0x51446d[_0x112e('0x30')]));if(_0x267d04[_0x112e('0x2e')][_0x112e('0x38')]){_0x4da0cc['where']=_[_0x112e('0x3a')](_0x4da0cc['where'],{'$or':_['map'](_0x4da0cc[_0x112e('0x32')],function(_0x340c69){var _0x2a6674={};_0x2a6674[_0x340c69]={'$like':'%'+_0x267d04[_0x112e('0x2e')]['filter']+'%'};return _0x2a6674;})});}_0x4da0cc=_[_0x112e('0x3a')]({},_0x4da0cc,_0x267d04[_0x112e('0x3c')]);return _0x5bb29c['getConfigurations'](_0x4da0cc);}})[_0x112e('0x21')](function(_0x3fe5dd){if(_0x3fe5dd){_0x14d883=_0x3fe5dd['length'];if(!_0x267d04[_0x112e('0x2e')][_0x112e('0x35')](_0x112e('0x36'))){_0x4da0cc[_0x112e('0x1a')]=qs[_0x112e('0x1a')](_0x267d04[_0x112e('0x2e')][_0x112e('0x1a')]);_0x4da0cc[_0x112e('0x1c')]=qs[_0x112e('0x1c')](_0x267d04['query'][_0x112e('0x1c')]);}return _0x5bb29c[_0x112e('0x48')](_0x4da0cc);}})[_0x112e('0x21')](function(_0x15b56e){if(_0x15b56e){return _0x15b56e?{'count':_0x14d883,'rows':_0x15b56e}:null;}})['then'](respondWithResult(_0x328146,null))[_0x112e('0x41')](handleError(_0x328146,null));};exports['addConfiguration']=function(_0x34f008,_0x556fd0,_0xce227f){if(_0x34f008['body']['id']){delete _0x34f008[_0x112e('0x46')]['id'];}return db[_0x112e('0x2a')][_0x112e('0x49')]({'where':{'id':_0x34f008['params']['id']}})[_0x112e('0x21')](handleEntityNotFound(_0x556fd0,null))['then'](function(_0x58a861){if(_0x58a861){_0x34f008['body'][_0x112e('0x4d')]=_0x58a861['id'];_0x34f008[_0x112e('0x46')][_0x112e('0x4e')]=integrations[_0x112e('0x4f')](_0x34f008[_0x112e('0x46')]['channel'],_0x34f008[_0x112e('0x46')][_0x112e('0x2c')]);_0x34f008[_0x112e('0x46')][_0x112e('0x50')]=integrations['getDescriptions'](_0x34f008[_0x112e('0x46')][_0x112e('0x51')],_0x34f008[_0x112e('0x46')][_0x112e('0x2c')]);return db['VtigerConfiguration'][_0x112e('0x45')](_0x34f008[_0x112e('0x46')],{'include':[{'model':db[_0x112e('0x52')],'as':'Subjects'},{'model':db[_0x112e('0x52')],'as':_0x112e('0x50')}]});}return null;})[_0x112e('0x21')](respondWithResult(_0x556fd0,null))[_0x112e('0x41')](handleError(_0x556fd0,null));};var md5=require(_0x112e('0x53'));exports['getFields']=function(_0x5670ec,_0x13a59b,_0x533fc9){var _0x1709a1=null;var _0x1b4d4a=null;var _0x1a6f8f=null;var _0x693128=null;var _0x3307b5='';return db['VtigerAccount'][_0x112e('0x49')]({'where':{'id':_0x5670ec[_0x112e('0x42')]['id']},'attributes':['id',_0x112e('0x27'),_0x112e('0x54'),_0x112e('0x55'),'moduleName',_0x112e('0x56'),_0x112e('0x57'),_0x112e('0x58')]})['then'](handleEntityNotFound(_0x13a59b,null))['then'](function(_0x289bce){if(_0x289bce){_0x1709a1=_0x289bce[_0x112e('0x54')];_0x1b4d4a=_0x289bce[_0x112e('0x58')];_0x1a6f8f=_0x289bce[_0x112e('0x59')];_0x3307b5=_0x289bce[_0x112e('0x56')];var _0x5bc2bf=_0x3307b5[_0x112e('0x5a')](-0x1);if(_0x5bc2bf==='/'){_0x3307b5=_0x3307b5[_0x112e('0x5b')](0x0,_0x3307b5[_0x112e('0x5c')](_0x5bc2bf));}_0x693128=util[_0x112e('0x5d')](_0x112e('0x5e'),_0x3307b5);var _0x51965c={'method':_0x112e('0x5f'),'uri':_0x693128,'qs':{'operation':_0x112e('0x60'),'username':_0x289bce[_0x112e('0x54')]},'json':!![]};return rp(_0x51965c);}})[_0x112e('0x21')](function(_0xdaeb55){if(_0xdaeb55[_0x112e('0x61')]){var _0x55a5c7={'method':_0x112e('0x62'),'uri':_0x693128,'form':{'operation':_0x112e('0x63'),'username':_0x1709a1,'accessKey':md5(_0xdaeb55[_0x112e('0x64')]['token']+_0x1b4d4a)},'json':!![]};return rp(_0x55a5c7);}})[_0x112e('0x21')](function(_0x488ca4){if(_0x488ca4[_0x112e('0x61')]){var _0x4c5276={'method':_0x112e('0x5f'),'uri':_0x693128,'qs':{'operation':'describe','username':_0x1709a1,'sessionName':_0x488ca4[_0x112e('0x64')]['sessionName'],'elementType':_0x1a6f8f},'json':!![]};return rp(_0x4c5276);}})[_0x112e('0x21')](function(_0x2fcb19){if(_0x2fcb19[_0x112e('0x61')]){var _0x8eb6f4=[_0x112e('0x65'),'reference','owner'];_[_0x112e('0x66')](_0x2fcb19['result'][_0x112e('0x33')],function(_0x5cfed3){return _0x8eb6f4[_0x112e('0x67')](_0x5cfed3[_0x112e('0x2c')][_0x112e('0x27')]);});_[_0x112e('0x66')](_0x2fcb19['result'][_0x112e('0x33')],function(_0x4d5fcf){return _0x4d5fcf['editable']===_0x112e('0x68');});return{'count':_0x2fcb19['result'][_0x112e('0x33')][_0x112e('0x34')],'rows':_[_0x112e('0x29')](_0x2fcb19[_0x112e('0x64')][_0x112e('0x33')],function(_0x30043b){return{'id':_0x30043b[_0x112e('0x27')],'name':_0x30043b[_0x112e('0x69')],'custom':_[_0x112e('0x6a')](_0x30043b['name'],'cf_')?!![]:![],'options':_0x30043b['type'][_0x112e('0x27')]===_0x112e('0x6b')&&_0x30043b['type'][_0x112e('0x6c')][_0x112e('0x34')]>0x0?_[_0x112e('0x29')](_0x30043b[_0x112e('0x2c')][_0x112e('0x6c')],function(_0x8da4ca){return{'name':_0x8da4ca['label'],'value':_0x8da4ca[_0x112e('0x6d')]};}):[]};})};}})[_0x112e('0x21')](respondWithResult(_0x13a59b,null))[_0x112e('0x41')](function(_0x3e9256){console[_0x112e('0x6e')](_0x112e('0x6f')+_0x3e9256);var _0x3af9ed=_0x5670ec[_0x112e('0x2e')]['test']?0x1f4:_0x3e9256[_0x112e('0x70')]||0x1f4;logger['error'](_0x112e('0x71'),'getFields',_0x3af9ed,JSON['stringify'](_0x3e9256));delete _0x3e9256['name'];if(_0x3af9ed===0x191){_0x3af9ed=0x190;}_0x13a59b[_0x112e('0x17')](_0x3af9ed)[_0x112e('0x72')](_0x5670ec['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3e9256[_0x112e('0x70')]}:_0x3e9256);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 19ed860..94007a8 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 _0xac39=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xac39,0x78));var _0x9ac3=function(_0x26c5e6,_0x3731b9){_0x26c5e6=_0x26c5e6-0x0;var _0x614b82=_0xac39[_0x26c5e6];return _0x614b82;};'use strict';var _=require(_0x9ac3('0x0'));var util=require(_0x9ac3('0x1'));var logger=require(_0x9ac3('0x2'))(_0x9ac3('0x3'));var moment=require(_0x9ac3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ac3('0x5'));var rimraf=require('rimraf');var config=require(_0x9ac3('0x6'));var attributes=require(_0x9ac3('0x7'));var integrations=require(_0x9ac3('0x8'));module['exports']=function(_0xfb1619,_0x4e4e64){return _0xfb1619[_0x9ac3('0x9')](_0x9ac3('0xa'),attributes,{'tableName':_0x9ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94d1=['moment','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x94d1,0xb0));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x194d('0x0'));var util=require(_0x194d('0x1'));var logger=require(_0x194d('0x2'))(_0x194d('0x3'));var moment=require(_0x194d('0x4'));var BPromise=require(_0x194d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x194d('0x6'));var rimraf=require(_0x194d('0x7'));var config=require(_0x194d('0x8'));var attributes=require(_0x194d('0x9'));var integrations=require(_0x194d('0xa'));module[_0x194d('0xb')]=function(_0x4e7384,_0x11bf5c){return _0x4e7384[_0x194d('0xc')](_0x194d('0xd'),attributes,{'tableName':_0x194d('0xe'),'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 ef40ac1..79ee441 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 _0x9ffd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','include','map','model','attributes','where','ShowVtigerAccount'];(function(_0x1cc984,_0x5eab53){var _0x4d4c84=function(_0x39634b){while(--_0x39634b){_0x1cc984['push'](_0x1cc984['shift']());}};_0x4d4c84(++_0x5eab53);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4a37d2,_0x1b7b59){_0x4a37d2=_0x4a37d2-0x0;var _0x355a01=_0x9ffd[_0x4a37d2];return _0x355a01;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('VtigerAccount,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')]({'raw':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options']['where']||null:null,'attributes':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')]['attributes']||null:null,'limit':_0x3afd19['options']?_0x3afd19['options']['limit']||null:null,'include':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options'][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x278b66){return{'model':db[_0x278b66[_0xd9ff('0x1e')]],'as':_0x278b66['as'],'attributes':_0x278b66['attributes'],'include':_0x278b66['include']?_[_0xd9ff('0x1d')](_0x278b66['include'],function(_0x3ca906){return{'model':db[_0x3ca906['model']],'as':_0x3ca906['as'],'attributes':_0x3ca906[_0xd9ff('0x1f')],'include':_0x3ca906['include']?_[_0xd9ff('0x1d')](_0x3ca906[_0xd9ff('0x1c')],function(_0x2138b4){return{'model':db[_0x2138b4[_0xd9ff('0x1e')]],'as':_0x2138b4['as'],'attributes':_0x2138b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0xe11f88){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug'](_0xd9ff('0x17'),_0x3afd19,JSON[_0xd9ff('0x10')](_0xe11f88));_0x2d4df1(_0xe11f88);})[_0xd9ff('0x16')](function(_0x45fb63){logger[_0xd9ff('0x11')](_0xd9ff('0x17'),_0x45fb63[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x45fb63[_0xd9ff('0x13')]));});});};exports['ShowVtigerAccount']=function(_0xcea5db){var _0x4ba2be=this;return new Promise(function(_0x1d55fd,_0x29c532){return db[_0xd9ff('0x18')]['find']({'raw':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db['options'][_0xd9ff('0x20')]||null:null,'attributes':_0xcea5db['options']?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1f')]||null:null,'include':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x36749c){return{'model':db[_0x36749c[_0xd9ff('0x1e')]],'as':_0x36749c['as'],'attributes':_0x36749c[_0xd9ff('0x1f')],'include':_0x36749c[_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x36749c[_0xd9ff('0x1c')],function(_0x498025){return{'model':db[_0x498025[_0xd9ff('0x1e')]],'as':_0x498025['as'],'attributes':_0x498025[_0xd9ff('0x1f')],'include':_0x498025[_0xd9ff('0x1c')]?_['map'](_0x498025[_0xd9ff('0x1c')],function(_0x5e3ff9){return{'model':db[_0x5e3ff9[_0xd9ff('0x1e')]],'as':_0x5e3ff9['as'],'attributes':_0x5e3ff9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0x5db498){logger[_0xd9ff('0x15')](_0xd9ff('0x21'),_0xcea5db);logger[_0xd9ff('0xd')]('ShowVtigerAccount',_0xcea5db,JSON['stringify'](_0x5db498));_0x1d55fd(_0x5db498);})['catch'](function(_0x7ac3d1){logger[_0xd9ff('0x11')](_0xd9ff('0x21'),_0x7ac3d1[_0xd9ff('0x13')],_0xcea5db);_0x29c532(_0x4ba2be[_0xd9ff('0x11')](0x1f4,_0x7ac3d1[_0xd9ff('0x13')]));});});}; \ No newline at end of file +var _0xf290=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','map','include','model','attributes','stringify','VtigerAccount','ShowVtigerAccount','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf290,0xde));var _0x0f29=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xf290[_0x21c2c8];return _0x4dd745;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['VtigerAccount'][_0x0f29('0x15')]({'raw':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x17')]===undefined?!![]:![]:!![],'where':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x18')]||null:null,'attributes':_0x5d72a5['options']?_0x5d72a5[_0x0f29('0x16')]['attributes']||null:null,'limit':_0x5d72a5['options']?_0x5d72a5['options']['limit']||null:null,'include':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')]['include']?_[_0x0f29('0x19')](_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x1a')],function(_0x3402dc){return{'model':db[_0x3402dc[_0x0f29('0x1b')]],'as':_0x3402dc['as'],'attributes':_0x3402dc['attributes'],'include':_0x3402dc[_0x0f29('0x1a')]?_['map'](_0x3402dc[_0x0f29('0x1a')],function(_0x26f46f){return{'model':db[_0x26f46f[_0x0f29('0x1b')]],'as':_0x26f46f['as'],'attributes':_0x26f46f[_0x0f29('0x1c')],'include':_0x26f46f['include']?_[_0x0f29('0x19')](_0x26f46f['include'],function(_0x58b201){return{'model':db[_0x58b201[_0x0f29('0x1b')]],'as':_0x58b201['as'],'attributes':_0x58b201['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57dcc7){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger[_0x0f29('0xe')]('GetVtigerAccount',_0x5d72a5,JSON[_0x0f29('0x1d')](_0x57dcc7));_0x4ca5e8(_0x57dcc7);})[_0x0f29('0x13')](function(_0x274c9d){logger['error']('GetVtigerAccount',_0x274c9d[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994['error'](0x1f4,_0x274c9d[_0x0f29('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x526364){var _0x7b10f=this;return new Promise(function(_0x409b19,_0xf59431){return db[_0x0f29('0x1e')]['find']({'raw':_0x526364['options']?_0x526364[_0x0f29('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x526364['options']?_0x526364[_0x0f29('0x16')]['where']||null:null,'attributes':_0x526364[_0x0f29('0x16')]?_0x526364['options']['attributes']||null:null,'include':_0x526364[_0x0f29('0x16')]?_0x526364[_0x0f29('0x16')][_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x526364[_0x0f29('0x16')]['include'],function(_0x426a3e){return{'model':db[_0x426a3e['model']],'as':_0x426a3e['as'],'attributes':_0x426a3e[_0x0f29('0x1c')],'include':_0x426a3e[_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x426a3e[_0x0f29('0x1a')],function(_0x4852a5){return{'model':db[_0x4852a5[_0x0f29('0x1b')]],'as':_0x4852a5['as'],'attributes':_0x4852a5[_0x0f29('0x1c')],'include':_0x4852a5['include']?_[_0x0f29('0x19')](_0x4852a5[_0x0f29('0x1a')],function(_0x5e40ac){return{'model':db[_0x5e40ac['model']],'as':_0x5e40ac['as'],'attributes':_0x5e40ac[_0x0f29('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f29('0xa')](function(_0x3691d4){logger[_0x0f29('0xb')](_0x0f29('0x1f'),_0x526364);logger[_0x0f29('0xe')]('ShowVtigerAccount',_0x526364,JSON[_0x0f29('0x1d')](_0x3691d4));_0x409b19(_0x3691d4);})['catch'](function(_0x331dc7){logger['error'](_0x0f29('0x1f'),_0x331dc7[_0x0f29('0x12')],_0x526364);_0xf59431(_0x7b10f[_0x0f29('0x10')](0x1f4,_0x331dc7['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a84d2f2..0039bcc 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 _0x7961=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','put','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x24cbdf,_0x3a1eeb){var _0x4a61a9=function(_0x214b89){while(--_0x214b89){_0x24cbdf['push'](_0x24cbdf['shift']());}};_0x4a61a9(++_0x3a1eeb);}(_0x7961,0x185));var _0x1796=function(_0x5b73c4,_0xe03124){_0x5b73c4=_0x5b73c4-0x0;var _0x491fd0=_0x7961[_0x5b73c4];return _0x491fd0;};'use strict';var multer=require(_0x1796('0x0'));var util=require(_0x1796('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1796('0x2'));var router=express[_0x1796('0x3')]();var fs_extra=require(_0x1796('0x4'));var auth=require(_0x1796('0x5'));var interaction=require(_0x1796('0x6'));var config=require(_0x1796('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x1796('0x8')]('/',auth[_0x1796('0x9')](),controller[_0x1796('0xa')]);router[_0x1796('0x8')](_0x1796('0xb'),auth['isAuthenticated'](),controller[_0x1796('0xc')]);router[_0x1796('0x8')](_0x1796('0xd'),auth[_0x1796('0x9')](),controller[_0x1796('0xe')]);router[_0x1796('0x8')](_0x1796('0xf'),auth[_0x1796('0x9')](),controller['getSubjects']);router[_0x1796('0x8')]('/:id/descriptions',auth[_0x1796('0x9')](),controller[_0x1796('0x10')]);router[_0x1796('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1796('0x12')](_0x1796('0xb'),auth[_0x1796('0x9')](),controller['update']);router[_0x1796('0x13')](_0x1796('0xb'),auth[_0x1796('0x9')](),controller[_0x1796('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdcb4=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x435432,_0x27fc52){var _0x3171b9=function(_0x38612e){while(--_0x38612e){_0x435432['push'](_0x435432['shift']());}};_0x3171b9(++_0x27fc52);}(_0xdcb4,0x1de));var _0x4dcb=function(_0x2efc68,_0x25f68d){_0x2efc68=_0x2efc68-0x0;var _0x188fba=_0xdcb4[_0x2efc68];return _0x188fba;};'use strict';var multer=require('multer');var util=require(_0x4dcb('0x0'));var path=require('path');var timeout=require(_0x4dcb('0x1'));var express=require(_0x4dcb('0x2'));var router=express['Router']();var fs_extra=require(_0x4dcb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4dcb('0x4'));var config=require('../../config/environment');var controller=require(_0x4dcb('0x5'));router[_0x4dcb('0x6')]('/',auth[_0x4dcb('0x7')](),controller[_0x4dcb('0x8')]);router[_0x4dcb('0x6')](_0x4dcb('0x9'),auth['isAuthenticated'](),controller[_0x4dcb('0xa')]);router['get'](_0x4dcb('0xb'),auth[_0x4dcb('0x7')](),controller[_0x4dcb('0xc')]);router['get'](_0x4dcb('0xd'),auth[_0x4dcb('0x7')](),controller[_0x4dcb('0xe')]);router['get'](_0x4dcb('0xf'),auth[_0x4dcb('0x7')](),controller[_0x4dcb('0x10')]);router[_0x4dcb('0x11')]('/',auth['isAuthenticated'](),controller[_0x4dcb('0x12')]);router[_0x4dcb('0x13')](_0x4dcb('0x9'),auth[_0x4dcb('0x7')](),controller[_0x4dcb('0x14')]);router['delete'](_0x4dcb('0x9'),auth[_0x4dcb('0x7')](),controller[_0x4dcb('0x15')]);module[_0x4dcb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 1bdd1dc..e7c6cce 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 _0xeed4=['STRING','exports'];(function(_0x3d62c9,_0xe10bc1){var _0x296774=function(_0x568f70){while(--_0x568f70){_0x3d62c9['push'](_0x3d62c9['shift']());}};_0x296774(++_0xe10bc1);}(_0xeed4,0x12f));var _0x4eed=function(_0x45a85e,_0x292dd7){_0x45a85e=_0x45a85e-0x0;var _0x4c85b7=_0xeed4[_0x45a85e];return _0x4c85b7;};'use strict';var Sequelize=require('sequelize');module[_0x4eed('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4eed('0x1')]}}; \ No newline at end of file +var _0xbac5=['STRING','sequelize'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xbac5,0xb5));var _0x5bac=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0xbac5[_0x166146];return _0x9c7390;};'use strict';var Sequelize=require(_0x5bac('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bac('0x1')]},'description':{'type':Sequelize[_0x5bac('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0e2f807..8974031 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 _0xf538=['includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getFields','findOne','pick','nolimit','VtigerField','order','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','filter','merge','type','options','VtigerConfiguration'];(function(_0x5dbd4b,_0x2fb8fe){var _0x5d2723=function(_0x373d4a){while(--_0x373d4a){_0x5dbd4b['push'](_0x5dbd4b['shift']());}};_0x5d2723(++_0x2fb8fe);}(_0xf538,0x65));var _0x8f53=function(_0x44aa36,_0x28c783){_0x44aa36=_0x44aa36-0x0;var _0x406a5d=_0xf538[_0x44aa36];return _0x406a5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f53('0x0'));var zipdir=require(_0x8f53('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f53('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8f53('0x3'));var util=require(_0x8f53('0x4'));var path=require(_0x8f53('0x5'));var sox=require(_0x8f53('0x6'));var csv=require('to-csv');var ejs=require(_0x8f53('0x7'));var fs=require('fs');var fs_extra=require(_0x8f53('0x8'));var _=require(_0x8f53('0x9'));var squel=require(_0x8f53('0xa'));var crypto=require(_0x8f53('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8f53('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8f53('0xd'));var Papa=require(_0x8f53('0xe'));var Redis=require(_0x8f53('0xf'));var authService=require(_0x8f53('0x10'));var qs=require(_0x8f53('0x11'));var as=require(_0x8f53('0x12'));var hardwareService=require(_0x8f53('0x13'));var logger=require(_0x8f53('0x14'))('api');var utils=require(_0x8f53('0x15'));var config=require(_0x8f53('0x16'));var licenseUtil=require(_0x8f53('0x17'));var db=require(_0x8f53('0x18'))['db'];function respondWithStatusCode(_0x5cc177,_0x484296){_0x484296=_0x484296||0xcc;return function(_0x1fb558){if(_0x1fb558){return _0x5cc177['sendStatus'](_0x484296);}return _0x5cc177[_0x8f53('0x19')](_0x484296)[_0x8f53('0x1a')]();};}function respondWithResult(_0x32ecce,_0x56f5d3){_0x56f5d3=_0x56f5d3||0xc8;return function(_0xbc0403){if(_0xbc0403){return _0x32ecce[_0x8f53('0x19')](_0x56f5d3)[_0x8f53('0x1b')](_0xbc0403);}};}function respondWithFilteredResult(_0x2dae74,_0x1ac7ac){return function(_0x4fbd04){if(_0x4fbd04){var _0x4873f2=typeof _0x1ac7ac[_0x8f53('0x1c')]===_0x8f53('0x1d')&&typeof _0x1ac7ac[_0x8f53('0x1e')]==='undefined';var _0x405d0a=_0x4fbd04[_0x8f53('0x1f')];var _0x87e193=_0x4873f2?0x0:_0x1ac7ac['offset'];var _0x37689b=_0x4873f2?_0x4fbd04[_0x8f53('0x1f')]:_0x1ac7ac[_0x8f53('0x1c')]+_0x1ac7ac[_0x8f53('0x1e')];var _0x4660ab;if(_0x37689b>=_0x405d0a){_0x37689b=_0x405d0a;_0x4660ab=0xc8;}else{_0x4660ab=0xce;}_0x2dae74[_0x8f53('0x19')](_0x4660ab);return _0x2dae74['set'](_0x8f53('0x20'),_0x87e193+'-'+_0x37689b+'/'+_0x405d0a)[_0x8f53('0x1b')](_0x4fbd04);}return null;};}function patchUpdates(_0x404e45){return function(_0x478b46){try{jsonpatch[_0x8f53('0x21')](_0x478b46,_0x404e45,!![]);}catch(_0x91af7f){return BPromise[_0x8f53('0x22')](_0x91af7f);}return _0x478b46[_0x8f53('0x23')]();};}function saveUpdates(_0x4013e2,_0x39c96e){return function(_0x158dc4){if(_0x158dc4){return _0x158dc4[_0x8f53('0x24')](_0x4013e2)['then'](function(_0x22c67d){return _0x22c67d;});}return null;};}function removeEntity(_0x711aaf,_0x348de1){return function(_0x2bcb7c){if(_0x2bcb7c){return _0x2bcb7c[_0x8f53('0x25')]()[_0x8f53('0x26')](function(){_0x711aaf[_0x8f53('0x19')](0xcc)[_0x8f53('0x1a')]();});}};}function handleEntityNotFound(_0x47a5e4,_0x25986b){return function(_0x33c36a){if(!_0x33c36a){_0x47a5e4[_0x8f53('0x27')](0x194);}return _0x33c36a;};}function handleError(_0x10ca59,_0x19bcf4){_0x19bcf4=_0x19bcf4||0x1f4;return function(_0x27d366){logger[_0x8f53('0x28')](_0x27d366['stack']);if(_0x27d366[_0x8f53('0x29')]){delete _0x27d366['name'];}_0x10ca59[_0x8f53('0x19')](_0x19bcf4)[_0x8f53('0x2a')](_0x27d366);};}exports[_0x8f53('0x2b')]=function(_0x17b731,_0x306cdf){var _0x159e32={},_0x34abf9={},_0x40176e={'count':0x0,'rows':[]};var _0x2decce=_[_0x8f53('0x2c')](db['VtigerConfiguration']['rawAttributes'],function(_0x1e3f26){return{'name':_0x1e3f26['fieldName'],'type':_0x1e3f26['type'][_0x8f53('0x2d')]};});_0x34abf9[_0x8f53('0x2e')]=_[_0x8f53('0x2c')](_0x2decce,_0x8f53('0x29'));_0x34abf9[_0x8f53('0x2f')]=_[_0x8f53('0x30')](_0x17b731[_0x8f53('0x2f')]);_0x34abf9['filters']=_[_0x8f53('0x31')](_0x34abf9[_0x8f53('0x2e')],_0x34abf9['query']);_0x159e32[_0x8f53('0x32')]=_['intersection'](_0x34abf9[_0x8f53('0x2e')],qs[_0x8f53('0x33')](_0x17b731['query']['fields']));_0x159e32['attributes']=_0x159e32[_0x8f53('0x32')][_0x8f53('0x34')]?_0x159e32['attributes']:_0x34abf9[_0x8f53('0x2e')];if(!_0x17b731[_0x8f53('0x2f')]['hasOwnProperty']('nolimit')){_0x159e32[_0x8f53('0x1e')]=qs[_0x8f53('0x1e')](_0x17b731['query'][_0x8f53('0x1e')]);_0x159e32[_0x8f53('0x1c')]=qs[_0x8f53('0x1c')](_0x17b731[_0x8f53('0x2f')]['offset']);}_0x159e32['order']=qs[_0x8f53('0x35')](_0x17b731[_0x8f53('0x2f')]['sort']);_0x159e32[_0x8f53('0x36')]=qs[_0x8f53('0x37')](_['pick'](_0x17b731[_0x8f53('0x2f')],_0x34abf9[_0x8f53('0x37')]),_0x2decce);if(_0x17b731[_0x8f53('0x2f')][_0x8f53('0x38')]){_0x159e32[_0x8f53('0x36')]=_[_0x8f53('0x39')](_0x159e32[_0x8f53('0x36')],{'$or':_[_0x8f53('0x2c')](_0x2decce,function(_0x4d581c){if(_0x4d581c[_0x8f53('0x3a')]!=='VIRTUAL'){var _0x1c6c5a={};_0x1c6c5a[_0x4d581c[_0x8f53('0x29')]]={'$like':'%'+_0x17b731[_0x8f53('0x2f')][_0x8f53('0x38')]+'%'};return _0x1c6c5a;}})});}_0x159e32=_[_0x8f53('0x39')]({},_0x159e32,_0x17b731[_0x8f53('0x3b')]);var _0x3f5e12={'where':_0x159e32[_0x8f53('0x36')]};return db[_0x8f53('0x3c')][_0x8f53('0x1f')](_0x3f5e12)[_0x8f53('0x26')](function(_0x3a7dbc){_0x40176e['count']=_0x3a7dbc;if(_0x17b731[_0x8f53('0x2f')][_0x8f53('0x3d')]){_0x159e32['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x8f53('0x3e')](_0x159e32);})[_0x8f53('0x26')](function(_0x595100){_0x40176e[_0x8f53('0x3f')]=_0x595100;return _0x40176e;})[_0x8f53('0x26')](respondWithFilteredResult(_0x306cdf,_0x159e32))[_0x8f53('0x40')](handleError(_0x306cdf,null));};exports[_0x8f53('0x41')]=function(_0x4b3367,_0x2d186f){var _0x13a02c={'raw':![],'where':{'id':_0x4b3367[_0x8f53('0x42')]['id']}},_0x3aa8d9={};_0x3aa8d9[_0x8f53('0x2e')]=_[_0x8f53('0x30')](db[_0x8f53('0x3c')][_0x8f53('0x43')]);_0x3aa8d9['query']=_[_0x8f53('0x30')](_0x4b3367['query']);_0x3aa8d9['filters']=_[_0x8f53('0x31')](_0x3aa8d9['model'],_0x3aa8d9[_0x8f53('0x2f')]);_0x13a02c[_0x8f53('0x32')]=_['intersection'](_0x3aa8d9[_0x8f53('0x2e')],qs['fields'](_0x4b3367[_0x8f53('0x2f')][_0x8f53('0x33')]));_0x13a02c[_0x8f53('0x32')]=_0x13a02c['attributes'][_0x8f53('0x34')]?_0x13a02c[_0x8f53('0x32')]:_0x3aa8d9['model'];if(_0x4b3367[_0x8f53('0x2f')][_0x8f53('0x3d')]){_0x13a02c[_0x8f53('0x44')]=[{'all':!![]}];}_0x13a02c=_[_0x8f53('0x39')]({},_0x13a02c,_0x4b3367[_0x8f53('0x3b')]);return db[_0x8f53('0x3c')][_0x8f53('0x45')](_0x13a02c)[_0x8f53('0x26')](handleEntityNotFound(_0x2d186f,null))[_0x8f53('0x26')](respondWithResult(_0x2d186f,null))['catch'](handleError(_0x2d186f,null));};exports['create']=function(_0x5efa5d,_0xf89ccd){return db[_0x8f53('0x3c')][_0x8f53('0x46')](_0x5efa5d[_0x8f53('0x47')],{})[_0x8f53('0x26')](respondWithResult(_0xf89ccd,0xc9))[_0x8f53('0x40')](handleError(_0xf89ccd,null));};exports[_0x8f53('0x24')]=function(_0x463bd6,_0x3cd357){if(_0x463bd6['body']['id']){delete _0x463bd6[_0x8f53('0x47')]['id'];}return db[_0x8f53('0x3c')]['find']({'where':{'id':_0x463bd6['params']['id']}})[_0x8f53('0x26')](handleEntityNotFound(_0x3cd357,null))[_0x8f53('0x26')](saveUpdates(_0x463bd6['body'],null))['then'](respondWithResult(_0x3cd357,null))[_0x8f53('0x40')](handleError(_0x3cd357,null));};exports[_0x8f53('0x25')]=function(_0x581888,_0x4c50d6){return db['VtigerConfiguration'][_0x8f53('0x45')]({'where':{'id':_0x581888[_0x8f53('0x42')]['id']}})[_0x8f53('0x26')](handleEntityNotFound(_0x4c50d6,null))['then'](removeEntity(_0x4c50d6,null))[_0x8f53('0x40')](handleError(_0x4c50d6,null));};exports[_0x8f53('0x48')]=function(_0xd1e7cc,_0x2a170f,_0x1136db){var _0x1d99ce={};var _0x477242={};var _0x516698;var _0x219f99;return db[_0x8f53('0x3c')][_0x8f53('0x49')]({'where':{'id':_0xd1e7cc[_0x8f53('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a170f,null))['then'](function(_0x3f5fab){if(_0x3f5fab){_0x516698=_0x3f5fab;_0x477242['model']=_[_0x8f53('0x30')](db['VtigerField'][_0x8f53('0x43')]);_0x477242[_0x8f53('0x2f')]=_[_0x8f53('0x30')](_0xd1e7cc[_0x8f53('0x2f')]);_0x477242[_0x8f53('0x37')]=_[_0x8f53('0x31')](_0x477242[_0x8f53('0x2e')],_0x477242[_0x8f53('0x2f')]);_0x1d99ce[_0x8f53('0x32')]=_[_0x8f53('0x31')](_0x477242['model'],qs[_0x8f53('0x33')](_0xd1e7cc['query'][_0x8f53('0x33')]));_0x1d99ce[_0x8f53('0x32')]=_0x1d99ce[_0x8f53('0x32')][_0x8f53('0x34')]?_0x1d99ce[_0x8f53('0x32')]:_0x477242[_0x8f53('0x2e')];_0x1d99ce['order']=qs['sort'](_0xd1e7cc['query'][_0x8f53('0x35')]);_0x1d99ce[_0x8f53('0x36')]=qs[_0x8f53('0x37')](_[_0x8f53('0x4a')](_0xd1e7cc[_0x8f53('0x2f')],_0x477242[_0x8f53('0x37')]));if(_0xd1e7cc[_0x8f53('0x2f')]['filter']){_0x1d99ce[_0x8f53('0x36')]=_[_0x8f53('0x39')](_0x1d99ce['where'],{'$or':_[_0x8f53('0x2c')](_0x1d99ce['attributes'],function(_0x14c6df){var _0x6354fd={};_0x6354fd[_0x14c6df]={'$like':'%'+_0xd1e7cc[_0x8f53('0x2f')][_0x8f53('0x38')]+'%'};return _0x6354fd;})});}_0x1d99ce=_[_0x8f53('0x39')]({},_0x1d99ce,_0xd1e7cc['options']);return _0x516698['getFields'](_0x1d99ce);}})[_0x8f53('0x26')](function(_0x2710d0){if(_0x2710d0){_0x219f99=_0x2710d0['length'];if(!_0xd1e7cc['query']['hasOwnProperty'](_0x8f53('0x4b'))){_0x1d99ce['limit']=qs[_0x8f53('0x1e')](_0xd1e7cc[_0x8f53('0x2f')][_0x8f53('0x1e')]);_0x1d99ce[_0x8f53('0x1c')]=qs[_0x8f53('0x1c')](_0xd1e7cc[_0x8f53('0x2f')]['offset']);}return _0x516698[_0x8f53('0x48')](_0x1d99ce);}})['then'](function(_0xd30d4d){if(_0xd30d4d){return _0xd30d4d?{'count':_0x219f99,'rows':_0xd30d4d}:null;}})[_0x8f53('0x26')](respondWithResult(_0x2a170f,null))[_0x8f53('0x40')](handleError(_0x2a170f,null));};exports['getSubjects']=function(_0x4e8093,_0xb5df56,_0x189423){var _0x468faa={};var _0x396ab3={};var _0x2128bb;var _0x596030;return db[_0x8f53('0x3c')][_0x8f53('0x49')]({'where':{'id':_0x4e8093[_0x8f53('0x42')]['id']}})['then'](handleEntityNotFound(_0xb5df56,null))['then'](function(_0x290e05){if(_0x290e05){_0x2128bb=_0x290e05;_0x396ab3[_0x8f53('0x2e')]=_[_0x8f53('0x30')](db[_0x8f53('0x4c')][_0x8f53('0x43')]);_0x396ab3[_0x8f53('0x2f')]=_[_0x8f53('0x30')](_0x4e8093[_0x8f53('0x2f')]);_0x396ab3[_0x8f53('0x37')]=_['intersection'](_0x396ab3[_0x8f53('0x2e')],_0x396ab3['query']);_0x468faa[_0x8f53('0x32')]=_[_0x8f53('0x31')](_0x396ab3[_0x8f53('0x2e')],qs[_0x8f53('0x33')](_0x4e8093[_0x8f53('0x2f')][_0x8f53('0x33')]));_0x468faa[_0x8f53('0x32')]=_0x468faa[_0x8f53('0x32')]['length']?_0x468faa[_0x8f53('0x32')]:_0x396ab3['model'];_0x468faa[_0x8f53('0x4d')]=qs[_0x8f53('0x35')](_0x4e8093['query'][_0x8f53('0x35')]);_0x468faa[_0x8f53('0x36')]=qs[_0x8f53('0x37')](_['pick'](_0x4e8093[_0x8f53('0x2f')],_0x396ab3[_0x8f53('0x37')]));if(_0x4e8093['query'][_0x8f53('0x38')]){_0x468faa['where']=_[_0x8f53('0x39')](_0x468faa[_0x8f53('0x36')],{'$or':_[_0x8f53('0x2c')](_0x468faa[_0x8f53('0x32')],function(_0x3370c5){var _0x21952d={};_0x21952d[_0x3370c5]={'$like':'%'+_0x4e8093[_0x8f53('0x2f')][_0x8f53('0x38')]+'%'};return _0x21952d;})});}_0x468faa=_[_0x8f53('0x39')]({},_0x468faa,_0x4e8093[_0x8f53('0x3b')]);return _0x2128bb[_0x8f53('0x4e')](_0x468faa);}})[_0x8f53('0x26')](function(_0x35c8d9){if(_0x35c8d9){_0x596030=_0x35c8d9[_0x8f53('0x34')];if(!_0x4e8093['query'][_0x8f53('0x4f')](_0x8f53('0x4b'))){_0x468faa[_0x8f53('0x1e')]=qs[_0x8f53('0x1e')](_0x4e8093[_0x8f53('0x2f')][_0x8f53('0x1e')]);_0x468faa[_0x8f53('0x1c')]=qs[_0x8f53('0x1c')](_0x4e8093[_0x8f53('0x2f')]['offset']);}return _0x2128bb['getSubjects'](_0x468faa);}})[_0x8f53('0x26')](function(_0x175102){if(_0x175102){return _0x175102?{'count':_0x596030,'rows':_0x175102}:null;}})[_0x8f53('0x26')](respondWithResult(_0xb5df56,null))['catch'](handleError(_0xb5df56,null));};exports['getDescriptions']=function(_0x428f04,_0x9c4e45,_0x477706){var _0x301d9d={};var _0x4c531e={};var _0x5dd644;var _0x40894f;return db['VtigerConfiguration'][_0x8f53('0x49')]({'where':{'id':_0x428f04[_0x8f53('0x42')]['id']}})[_0x8f53('0x26')](handleEntityNotFound(_0x9c4e45,null))[_0x8f53('0x26')](function(_0x382098){if(_0x382098){_0x5dd644=_0x382098;_0x4c531e[_0x8f53('0x2e')]=_[_0x8f53('0x30')](db[_0x8f53('0x4c')]['rawAttributes']);_0x4c531e['query']=_[_0x8f53('0x30')](_0x428f04[_0x8f53('0x2f')]);_0x4c531e['filters']=_['intersection'](_0x4c531e[_0x8f53('0x2e')],_0x4c531e[_0x8f53('0x2f')]);_0x301d9d['attributes']=_[_0x8f53('0x31')](_0x4c531e[_0x8f53('0x2e')],qs[_0x8f53('0x33')](_0x428f04[_0x8f53('0x2f')][_0x8f53('0x33')]));_0x301d9d[_0x8f53('0x32')]=_0x301d9d['attributes'][_0x8f53('0x34')]?_0x301d9d[_0x8f53('0x32')]:_0x4c531e['model'];_0x301d9d[_0x8f53('0x4d')]=qs['sort'](_0x428f04['query']['sort']);_0x301d9d[_0x8f53('0x36')]=qs['filters'](_[_0x8f53('0x4a')](_0x428f04['query'],_0x4c531e[_0x8f53('0x37')]));if(_0x428f04[_0x8f53('0x2f')][_0x8f53('0x38')]){_0x301d9d[_0x8f53('0x36')]=_[_0x8f53('0x39')](_0x301d9d[_0x8f53('0x36')],{'$or':_['map'](_0x301d9d['attributes'],function(_0x332a47){var _0x4d5fff={};_0x4d5fff[_0x332a47]={'$like':'%'+_0x428f04[_0x8f53('0x2f')]['filter']+'%'};return _0x4d5fff;})});}_0x301d9d=_['merge']({},_0x301d9d,_0x428f04[_0x8f53('0x3b')]);return _0x5dd644[_0x8f53('0x50')](_0x301d9d);}})[_0x8f53('0x26')](function(_0x2375db){if(_0x2375db){_0x40894f=_0x2375db[_0x8f53('0x34')];if(!_0x428f04[_0x8f53('0x2f')]['hasOwnProperty'](_0x8f53('0x4b'))){_0x301d9d['limit']=qs[_0x8f53('0x1e')](_0x428f04[_0x8f53('0x2f')][_0x8f53('0x1e')]);_0x301d9d['offset']=qs[_0x8f53('0x1c')](_0x428f04[_0x8f53('0x2f')][_0x8f53('0x1c')]);}return _0x5dd644[_0x8f53('0x50')](_0x301d9d);}})['then'](function(_0x3ef566){if(_0x3ef566){return _0x3ef566?{'count':_0x40894f,'rows':_0x3ef566}:null;}})[_0x8f53('0x26')](respondWithResult(_0x9c4e45,null))[_0x8f53('0x40')](handleError(_0x9c4e45,null));}; \ No newline at end of file +var _0xb5f5=['../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','includeAll','find','create','body','update','getFields','findOne','VtigerField','filters','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x115b95,_0xa1f8b9){var _0x460b3d=function(_0x510c02){while(--_0x510c02){_0x115b95['push'](_0x115b95['shift']());}};_0x460b3d(++_0xa1f8b9);}(_0xb5f5,0x177));var _0x5b5f=function(_0x281475,_0x3e5e21){_0x281475=_0x281475-0x0;var _0x22a384=_0xb5f5[_0x281475];return _0x22a384;};'use strict';var emlformat=require(_0x5b5f('0x0'));var rimraf=require(_0x5b5f('0x1'));var zipdir=require(_0x5b5f('0x2'));var jsonpatch=require(_0x5b5f('0x3'));var rp=require('request-promise');var moment=require(_0x5b5f('0x4'));var BPromise=require(_0x5b5f('0x5'));var Mustache=require(_0x5b5f('0x6'));var util=require(_0x5b5f('0x7'));var path=require('path');var sox=require(_0x5b5f('0x8'));var csv=require(_0x5b5f('0x9'));var ejs=require(_0x5b5f('0xa'));var fs=require('fs');var fs_extra=require(_0x5b5f('0xb'));var _=require(_0x5b5f('0xc'));var squel=require(_0x5b5f('0xd'));var crypto=require(_0x5b5f('0xe'));var jsforce=require(_0x5b5f('0xf'));var deskjs=require(_0x5b5f('0x10'));var toCsv=require(_0x5b5f('0x9'));var querystring=require('querystring');var Papa=require(_0x5b5f('0x11'));var Redis=require(_0x5b5f('0x12'));var authService=require(_0x5b5f('0x13'));var qs=require(_0x5b5f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b5f('0x15'));var logger=require(_0x5b5f('0x16'))(_0x5b5f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b5f('0x18'));var db=require(_0x5b5f('0x19'))['db'];function respondWithStatusCode(_0x8d0aa,_0x418993){_0x418993=_0x418993||0xcc;return function(_0x2db12d){if(_0x2db12d){return _0x8d0aa[_0x5b5f('0x1a')](_0x418993);}return _0x8d0aa[_0x5b5f('0x1b')](_0x418993)['end']();};}function respondWithResult(_0x5daa3a,_0x39fa04){_0x39fa04=_0x39fa04||0xc8;return function(_0x233b2a){if(_0x233b2a){return _0x5daa3a[_0x5b5f('0x1b')](_0x39fa04)[_0x5b5f('0x1c')](_0x233b2a);}};}function respondWithFilteredResult(_0x184600,_0x202923){return function(_0x335a0b){if(_0x335a0b){var _0xd9c01d=typeof _0x202923[_0x5b5f('0x1d')]===_0x5b5f('0x1e')&&typeof _0x202923['limit']==='undefined';var _0x50f268=_0x335a0b['count'];var _0x5e6d73=_0xd9c01d?0x0:_0x202923[_0x5b5f('0x1d')];var _0x4fa29e=_0xd9c01d?_0x335a0b[_0x5b5f('0x1f')]:_0x202923['offset']+_0x202923['limit'];var _0x4c45b2;if(_0x4fa29e>=_0x50f268){_0x4fa29e=_0x50f268;_0x4c45b2=0xc8;}else{_0x4c45b2=0xce;}_0x184600[_0x5b5f('0x1b')](_0x4c45b2);return _0x184600[_0x5b5f('0x20')]('Content-Range',_0x5e6d73+'-'+_0x4fa29e+'/'+_0x50f268)[_0x5b5f('0x1c')](_0x335a0b);}return null;};}function patchUpdates(_0x5478cf){return function(_0x23de7e){try{jsonpatch[_0x5b5f('0x21')](_0x23de7e,_0x5478cf,!![]);}catch(_0x31e48d){return BPromise[_0x5b5f('0x22')](_0x31e48d);}return _0x23de7e['save']();};}function saveUpdates(_0x3171b7,_0x49a5a0){return function(_0xec0f3e){if(_0xec0f3e){return _0xec0f3e['update'](_0x3171b7)[_0x5b5f('0x23')](function(_0x20dfb8){return _0x20dfb8;});}return null;};}function removeEntity(_0x2c2cb9,_0x35b9ce){return function(_0x301083){if(_0x301083){return _0x301083[_0x5b5f('0x24')]()[_0x5b5f('0x23')](function(){_0x2c2cb9[_0x5b5f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bc0b0,_0x50ee06){return function(_0x117def){if(!_0x117def){_0x9bc0b0[_0x5b5f('0x1a')](0x194);}return _0x117def;};}function handleError(_0x130b43,_0x14f38b){_0x14f38b=_0x14f38b||0x1f4;return function(_0x3f7d88){logger[_0x5b5f('0x25')](_0x3f7d88[_0x5b5f('0x26')]);if(_0x3f7d88[_0x5b5f('0x27')]){delete _0x3f7d88[_0x5b5f('0x27')];}_0x130b43[_0x5b5f('0x1b')](_0x14f38b)[_0x5b5f('0x28')](_0x3f7d88);};}exports[_0x5b5f('0x29')]=function(_0x36bce1,_0x1df6cb){var _0x1ab327={},_0x1beb45={},_0x1f1238={'count':0x0,'rows':[]};var _0x264b97=_[_0x5b5f('0x2a')](db[_0x5b5f('0x2b')][_0x5b5f('0x2c')],function(_0x45ce2f){return{'name':_0x45ce2f[_0x5b5f('0x2d')],'type':_0x45ce2f[_0x5b5f('0x2e')][_0x5b5f('0x2f')]};});_0x1beb45['model']=_[_0x5b5f('0x2a')](_0x264b97,_0x5b5f('0x27'));_0x1beb45[_0x5b5f('0x30')]=_[_0x5b5f('0x31')](_0x36bce1[_0x5b5f('0x30')]);_0x1beb45['filters']=_[_0x5b5f('0x32')](_0x1beb45['model'],_0x1beb45['query']);_0x1ab327[_0x5b5f('0x33')]=_[_0x5b5f('0x32')](_0x1beb45[_0x5b5f('0x34')],qs[_0x5b5f('0x35')](_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x35')]));_0x1ab327['attributes']=_0x1ab327[_0x5b5f('0x33')][_0x5b5f('0x36')]?_0x1ab327[_0x5b5f('0x33')]:_0x1beb45[_0x5b5f('0x34')];if(!_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x37')](_0x5b5f('0x38'))){_0x1ab327[_0x5b5f('0x39')]=qs[_0x5b5f('0x39')](_0x36bce1['query'][_0x5b5f('0x39')]);_0x1ab327[_0x5b5f('0x1d')]=qs[_0x5b5f('0x1d')](_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x1d')]);}_0x1ab327[_0x5b5f('0x3a')]=qs['sort'](_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x3b')]);_0x1ab327[_0x5b5f('0x3c')]=qs['filters'](_[_0x5b5f('0x3d')](_0x36bce1[_0x5b5f('0x30')],_0x1beb45['filters']),_0x264b97);if(_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x3e')]){_0x1ab327['where']=_[_0x5b5f('0x3f')](_0x1ab327[_0x5b5f('0x3c')],{'$or':_[_0x5b5f('0x2a')](_0x264b97,function(_0x4783f4){if(_0x4783f4[_0x5b5f('0x2e')]!=='VIRTUAL'){var _0xd6ed1={};_0xd6ed1[_0x4783f4[_0x5b5f('0x27')]]={'$like':'%'+_0x36bce1[_0x5b5f('0x30')][_0x5b5f('0x3e')]+'%'};return _0xd6ed1;}})});}_0x1ab327=_[_0x5b5f('0x3f')]({},_0x1ab327,_0x36bce1[_0x5b5f('0x40')]);var _0x5127cf={'where':_0x1ab327['where']};return db['VtigerConfiguration'][_0x5b5f('0x1f')](_0x5127cf)[_0x5b5f('0x23')](function(_0x176d97){_0x1f1238[_0x5b5f('0x1f')]=_0x176d97;if(_0x36bce1[_0x5b5f('0x30')]['includeAll']){_0x1ab327[_0x5b5f('0x41')]=[{'all':!![]}];}return db[_0x5b5f('0x2b')]['findAll'](_0x1ab327);})[_0x5b5f('0x23')](function(_0x527d61){_0x1f1238[_0x5b5f('0x42')]=_0x527d61;return _0x1f1238;})[_0x5b5f('0x23')](respondWithFilteredResult(_0x1df6cb,_0x1ab327))[_0x5b5f('0x43')](handleError(_0x1df6cb,null));};exports['show']=function(_0x3f28f4,_0x30dc12){var _0x39db63={'raw':![],'where':{'id':_0x3f28f4[_0x5b5f('0x44')]['id']}},_0x58b7e3={};_0x58b7e3['model']=_[_0x5b5f('0x31')](db[_0x5b5f('0x2b')][_0x5b5f('0x2c')]);_0x58b7e3[_0x5b5f('0x30')]=_[_0x5b5f('0x31')](_0x3f28f4['query']);_0x58b7e3['filters']=_[_0x5b5f('0x32')](_0x58b7e3['model'],_0x58b7e3[_0x5b5f('0x30')]);_0x39db63['attributes']=_[_0x5b5f('0x32')](_0x58b7e3[_0x5b5f('0x34')],qs['fields'](_0x3f28f4[_0x5b5f('0x30')][_0x5b5f('0x35')]));_0x39db63[_0x5b5f('0x33')]=_0x39db63[_0x5b5f('0x33')][_0x5b5f('0x36')]?_0x39db63[_0x5b5f('0x33')]:_0x58b7e3[_0x5b5f('0x34')];if(_0x3f28f4[_0x5b5f('0x30')][_0x5b5f('0x45')]){_0x39db63[_0x5b5f('0x41')]=[{'all':!![]}];}_0x39db63=_[_0x5b5f('0x3f')]({},_0x39db63,_0x3f28f4[_0x5b5f('0x40')]);return db['VtigerConfiguration'][_0x5b5f('0x46')](_0x39db63)[_0x5b5f('0x23')](handleEntityNotFound(_0x30dc12,null))[_0x5b5f('0x23')](respondWithResult(_0x30dc12,null))[_0x5b5f('0x43')](handleError(_0x30dc12,null));};exports['create']=function(_0x4db5ac,_0x3b3aac){return db[_0x5b5f('0x2b')][_0x5b5f('0x47')](_0x4db5ac[_0x5b5f('0x48')],{})[_0x5b5f('0x23')](respondWithResult(_0x3b3aac,0xc9))['catch'](handleError(_0x3b3aac,null));};exports[_0x5b5f('0x49')]=function(_0x15c0e8,_0x5715af){if(_0x15c0e8[_0x5b5f('0x48')]['id']){delete _0x15c0e8[_0x5b5f('0x48')]['id'];}return db[_0x5b5f('0x2b')][_0x5b5f('0x46')]({'where':{'id':_0x15c0e8['params']['id']}})[_0x5b5f('0x23')](handleEntityNotFound(_0x5715af,null))[_0x5b5f('0x23')](saveUpdates(_0x15c0e8[_0x5b5f('0x48')],null))[_0x5b5f('0x23')](respondWithResult(_0x5715af,null))[_0x5b5f('0x43')](handleError(_0x5715af,null));};exports['destroy']=function(_0x2491ef,_0x47112f){return db[_0x5b5f('0x2b')][_0x5b5f('0x46')]({'where':{'id':_0x2491ef[_0x5b5f('0x44')]['id']}})[_0x5b5f('0x23')](handleEntityNotFound(_0x47112f,null))['then'](removeEntity(_0x47112f,null))[_0x5b5f('0x43')](handleError(_0x47112f,null));};exports[_0x5b5f('0x4a')]=function(_0x43388a,_0x30635e,_0x4e97f9){var _0x56d31d={};var _0xa08668={};var _0x44449a;var _0x48039;return db[_0x5b5f('0x2b')][_0x5b5f('0x4b')]({'where':{'id':_0x43388a[_0x5b5f('0x44')]['id']}})[_0x5b5f('0x23')](handleEntityNotFound(_0x30635e,null))[_0x5b5f('0x23')](function(_0x4c33e5){if(_0x4c33e5){_0x44449a=_0x4c33e5;_0xa08668['model']=_[_0x5b5f('0x31')](db[_0x5b5f('0x4c')]['rawAttributes']);_0xa08668[_0x5b5f('0x30')]=_[_0x5b5f('0x31')](_0x43388a[_0x5b5f('0x30')]);_0xa08668[_0x5b5f('0x4d')]=_[_0x5b5f('0x32')](_0xa08668['model'],_0xa08668[_0x5b5f('0x30')]);_0x56d31d[_0x5b5f('0x33')]=_[_0x5b5f('0x32')](_0xa08668[_0x5b5f('0x34')],qs[_0x5b5f('0x35')](_0x43388a['query'][_0x5b5f('0x35')]));_0x56d31d[_0x5b5f('0x33')]=_0x56d31d[_0x5b5f('0x33')][_0x5b5f('0x36')]?_0x56d31d['attributes']:_0xa08668[_0x5b5f('0x34')];_0x56d31d['order']=qs[_0x5b5f('0x3b')](_0x43388a[_0x5b5f('0x30')][_0x5b5f('0x3b')]);_0x56d31d[_0x5b5f('0x3c')]=qs['filters'](_['pick'](_0x43388a['query'],_0xa08668[_0x5b5f('0x4d')]));if(_0x43388a[_0x5b5f('0x30')][_0x5b5f('0x3e')]){_0x56d31d[_0x5b5f('0x3c')]=_[_0x5b5f('0x3f')](_0x56d31d[_0x5b5f('0x3c')],{'$or':_['map'](_0x56d31d['attributes'],function(_0x2d3631){var _0xc216c5={};_0xc216c5[_0x2d3631]={'$like':'%'+_0x43388a[_0x5b5f('0x30')]['filter']+'%'};return _0xc216c5;})});}_0x56d31d=_['merge']({},_0x56d31d,_0x43388a[_0x5b5f('0x40')]);return _0x44449a[_0x5b5f('0x4a')](_0x56d31d);}})[_0x5b5f('0x23')](function(_0x2560c5){if(_0x2560c5){_0x48039=_0x2560c5[_0x5b5f('0x36')];if(!_0x43388a[_0x5b5f('0x30')][_0x5b5f('0x37')](_0x5b5f('0x38'))){_0x56d31d[_0x5b5f('0x39')]=qs[_0x5b5f('0x39')](_0x43388a[_0x5b5f('0x30')][_0x5b5f('0x39')]);_0x56d31d[_0x5b5f('0x1d')]=qs[_0x5b5f('0x1d')](_0x43388a[_0x5b5f('0x30')][_0x5b5f('0x1d')]);}return _0x44449a[_0x5b5f('0x4a')](_0x56d31d);}})['then'](function(_0x248f84){if(_0x248f84){return _0x248f84?{'count':_0x48039,'rows':_0x248f84}:null;}})[_0x5b5f('0x23')](respondWithResult(_0x30635e,null))[_0x5b5f('0x43')](handleError(_0x30635e,null));};exports[_0x5b5f('0x4e')]=function(_0x449ac3,_0x47dff7,_0x2b8883){var _0x34c6a4={};var _0x172187={};var _0x46d95a;var _0x46ebc0;return db[_0x5b5f('0x2b')][_0x5b5f('0x4b')]({'where':{'id':_0x449ac3['params']['id']}})[_0x5b5f('0x23')](handleEntityNotFound(_0x47dff7,null))[_0x5b5f('0x23')](function(_0x221a25){if(_0x221a25){_0x46d95a=_0x221a25;_0x172187[_0x5b5f('0x34')]=_[_0x5b5f('0x31')](db[_0x5b5f('0x4c')][_0x5b5f('0x2c')]);_0x172187[_0x5b5f('0x30')]=_[_0x5b5f('0x31')](_0x449ac3[_0x5b5f('0x30')]);_0x172187[_0x5b5f('0x4d')]=_[_0x5b5f('0x32')](_0x172187[_0x5b5f('0x34')],_0x172187[_0x5b5f('0x30')]);_0x34c6a4[_0x5b5f('0x33')]=_['intersection'](_0x172187[_0x5b5f('0x34')],qs[_0x5b5f('0x35')](_0x449ac3[_0x5b5f('0x30')][_0x5b5f('0x35')]));_0x34c6a4[_0x5b5f('0x33')]=_0x34c6a4['attributes'][_0x5b5f('0x36')]?_0x34c6a4['attributes']:_0x172187[_0x5b5f('0x34')];_0x34c6a4[_0x5b5f('0x3a')]=qs[_0x5b5f('0x3b')](_0x449ac3[_0x5b5f('0x30')][_0x5b5f('0x3b')]);_0x34c6a4[_0x5b5f('0x3c')]=qs[_0x5b5f('0x4d')](_[_0x5b5f('0x3d')](_0x449ac3[_0x5b5f('0x30')],_0x172187['filters']));if(_0x449ac3['query'][_0x5b5f('0x3e')]){_0x34c6a4[_0x5b5f('0x3c')]=_['merge'](_0x34c6a4[_0x5b5f('0x3c')],{'$or':_['map'](_0x34c6a4['attributes'],function(_0x4ae947){var _0x1950ba={};_0x1950ba[_0x4ae947]={'$like':'%'+_0x449ac3['query']['filter']+'%'};return _0x1950ba;})});}_0x34c6a4=_[_0x5b5f('0x3f')]({},_0x34c6a4,_0x449ac3[_0x5b5f('0x40')]);return _0x46d95a['getSubjects'](_0x34c6a4);}})[_0x5b5f('0x23')](function(_0x238634){if(_0x238634){_0x46ebc0=_0x238634[_0x5b5f('0x36')];if(!_0x449ac3[_0x5b5f('0x30')][_0x5b5f('0x37')](_0x5b5f('0x38'))){_0x34c6a4['limit']=qs['limit'](_0x449ac3[_0x5b5f('0x30')][_0x5b5f('0x39')]);_0x34c6a4[_0x5b5f('0x1d')]=qs['offset'](_0x449ac3[_0x5b5f('0x30')][_0x5b5f('0x1d')]);}return _0x46d95a['getSubjects'](_0x34c6a4);}})[_0x5b5f('0x23')](function(_0x32b469){if(_0x32b469){return _0x32b469?{'count':_0x46ebc0,'rows':_0x32b469}:null;}})[_0x5b5f('0x23')](respondWithResult(_0x47dff7,null))[_0x5b5f('0x43')](handleError(_0x47dff7,null));};exports['getDescriptions']=function(_0x14e379,_0x1ef91d,_0xddaecd){var _0x43bbb4={};var _0x2d4751={};var _0x5de47e;var _0xe5b8b7;return db[_0x5b5f('0x2b')][_0x5b5f('0x4b')]({'where':{'id':_0x14e379['params']['id']}})[_0x5b5f('0x23')](handleEntityNotFound(_0x1ef91d,null))[_0x5b5f('0x23')](function(_0x2c71c2){if(_0x2c71c2){_0x5de47e=_0x2c71c2;_0x2d4751[_0x5b5f('0x34')]=_[_0x5b5f('0x31')](db[_0x5b5f('0x4c')][_0x5b5f('0x2c')]);_0x2d4751[_0x5b5f('0x30')]=_[_0x5b5f('0x31')](_0x14e379[_0x5b5f('0x30')]);_0x2d4751[_0x5b5f('0x4d')]=_[_0x5b5f('0x32')](_0x2d4751[_0x5b5f('0x34')],_0x2d4751[_0x5b5f('0x30')]);_0x43bbb4[_0x5b5f('0x33')]=_[_0x5b5f('0x32')](_0x2d4751[_0x5b5f('0x34')],qs[_0x5b5f('0x35')](_0x14e379[_0x5b5f('0x30')][_0x5b5f('0x35')]));_0x43bbb4[_0x5b5f('0x33')]=_0x43bbb4[_0x5b5f('0x33')][_0x5b5f('0x36')]?_0x43bbb4[_0x5b5f('0x33')]:_0x2d4751[_0x5b5f('0x34')];_0x43bbb4[_0x5b5f('0x3a')]=qs[_0x5b5f('0x3b')](_0x14e379[_0x5b5f('0x30')][_0x5b5f('0x3b')]);_0x43bbb4[_0x5b5f('0x3c')]=qs[_0x5b5f('0x4d')](_[_0x5b5f('0x3d')](_0x14e379[_0x5b5f('0x30')],_0x2d4751[_0x5b5f('0x4d')]));if(_0x14e379['query'][_0x5b5f('0x3e')]){_0x43bbb4[_0x5b5f('0x3c')]=_[_0x5b5f('0x3f')](_0x43bbb4['where'],{'$or':_['map'](_0x43bbb4[_0x5b5f('0x33')],function(_0x25aeb6){var _0x5aaf5a={};_0x5aaf5a[_0x25aeb6]={'$like':'%'+_0x14e379[_0x5b5f('0x30')][_0x5b5f('0x3e')]+'%'};return _0x5aaf5a;})});}_0x43bbb4=_[_0x5b5f('0x3f')]({},_0x43bbb4,_0x14e379[_0x5b5f('0x40')]);return _0x5de47e[_0x5b5f('0x4f')](_0x43bbb4);}})[_0x5b5f('0x23')](function(_0x2742df){if(_0x2742df){_0xe5b8b7=_0x2742df[_0x5b5f('0x36')];if(!_0x14e379[_0x5b5f('0x30')][_0x5b5f('0x37')](_0x5b5f('0x38'))){_0x43bbb4['limit']=qs[_0x5b5f('0x39')](_0x14e379['query'][_0x5b5f('0x39')]);_0x43bbb4[_0x5b5f('0x1d')]=qs[_0x5b5f('0x1d')](_0x14e379[_0x5b5f('0x30')][_0x5b5f('0x1d')]);}return _0x5de47e[_0x5b5f('0x4f')](_0x43bbb4);}})[_0x5b5f('0x23')](function(_0xa00ac0){if(_0xa00ac0){return _0xa00ac0?{'count':_0xe5b8b7,'rows':_0xa00ac0}:null;}})[_0x5b5f('0x23')](respondWithResult(_0x1ef91d,null))[_0x5b5f('0x43')](handleError(_0x1ef91d,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e5a5f1c..0080f80 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 _0xa598=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x481767,_0x3c7a22){var _0x365533=function(_0x76f4a5){while(--_0x76f4a5){_0x481767['push'](_0x481767['shift']());}};_0x365533(++_0x3c7a22);}(_0xa598,0x165));var _0x8a59=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xa598[_0x455c6c];return _0x488242;};'use strict';var _=require(_0x8a59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a59('0x1'));var moment=require(_0x8a59('0x2'));var BPromise=require(_0x8a59('0x3'));var rp=require(_0x8a59('0x4'));var fs=require('fs');var path=require(_0x8a59('0x5'));var rimraf=require(_0x8a59('0x6'));var config=require(_0x8a59('0x7'));var attributes=require(_0x8a59('0x8'));module[_0x8a59('0x9')]=function(_0x110085,_0x2490e1){return _0x110085[_0x8a59('0xa')](_0x8a59('0xb'),attributes,{'tableName':_0x8a59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x130f=['lodash','util','api','moment','request-promise','path','../../config/environment','VtigerConfiguration','int_vtiger_configurations'];(function(_0x1bf49b,_0x18edcc){var _0x297b4f=function(_0x220142){while(--_0x220142){_0x1bf49b['push'](_0x1bf49b['shift']());}};_0x297b4f(++_0x18edcc);}(_0x130f,0x6c));var _0xf130=function(_0x1bb5b5,_0x6c0116){_0x1bb5b5=_0x1bb5b5-0x0;var _0x5b78a4=_0x130f[_0x1bb5b5];return _0x5b78a4;};'use strict';var _=require(_0xf130('0x0'));var util=require(_0xf130('0x1'));var logger=require('../../config/logger')(_0xf130('0x2'));var moment=require(_0xf130('0x3'));var BPromise=require('bluebird');var rp=require(_0xf130('0x4'));var fs=require('fs');var path=require(_0xf130('0x5'));var rimraf=require('rimraf');var config=require(_0xf130('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x3c1912,_0x1d9ced){return _0x3c1912['define'](_0xf130('0x7'),attributes,{'tableName':_0xf130('0x8'),'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 b608a30..8b9e0d7 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 _0x7ed3=['error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40c120,_0x945e7a){var _0xe9f0d=function(_0x40c637){while(--_0x40c637){_0x40c120['push'](_0x40c120['shift']());}};_0xe9f0d(++_0x945e7a);}(_0x7ed3,0x90));var _0x37ed=function(_0xac972f,_0x4f2ccf){_0xac972f=_0xac972f-0x0;var _0x3ef990=_0x7ed3[_0xac972f];return _0x3ef990;};'use strict';var _=require(_0x37ed('0x0'));var util=require('util');var moment=require(_0x37ed('0x1'));var BPromise=require(_0x37ed('0x2'));var rs=require(_0x37ed('0x3'));var fs=require('fs');var Redis=require(_0x37ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x37ed('0x5'));var logger=require('../../config/logger')(_0x37ed('0x6'));var config=require(_0x37ed('0x7'));var jayson=require(_0x37ed('0x8'));var client=jayson[_0x37ed('0x9')][_0x37ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dc62b,_0xcdf82e,_0x561312){return new BPromise(function(_0x39f819,_0x2c9ea9){return client['request'](_0x4dc62b,_0x561312)[_0x37ed('0xb')](function(_0x1f0cda){logger[_0x37ed('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0xcdf82e,_0x37ed('0xd'));logger[_0x37ed('0xe')](_0x37ed('0xf'),_0xcdf82e,_0x37ed('0xd'),JSON[_0x37ed('0x10')](_0x1f0cda));if(_0x1f0cda[_0x37ed('0x11')]){if(_0x1f0cda[_0x37ed('0x11')][_0x37ed('0x12')]===0x1f4){logger['error'](_0x37ed('0x13'),_0xcdf82e,_0x1f0cda['error']['message']);return _0x2c9ea9(_0x1f0cda[_0x37ed('0x11')]['message']);}logger[_0x37ed('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0xcdf82e,_0x1f0cda[_0x37ed('0x11')][_0x37ed('0x14')]);return _0x39f819(_0x1f0cda[_0x37ed('0x11')][_0x37ed('0x14')]);}else{logger[_0x37ed('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0xcdf82e,_0x37ed('0xd'));_0x39f819(_0x1f0cda[_0x37ed('0x15')][_0x37ed('0x14')]);}})[_0x37ed('0x16')](function(_0x5a6e85){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xcdf82e,_0x5a6e85);_0x2c9ea9(_0x5a6e85);});});} \ No newline at end of file +var _0xcfa6=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0xcfa6,0x100));var _0x6cfa=function(_0x34b357,_0x219e90){_0x34b357=_0x34b357-0x0;var _0x598474=_0xcfa6[_0x34b357];return _0x598474;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cfa('0x0'));var db=require(_0x6cfa('0x1'))['db'];var utils=require(_0x6cfa('0x2'));var logger=require(_0x6cfa('0x3'))(_0x6cfa('0x4'));var config=require(_0x6cfa('0x5'));var jayson=require(_0x6cfa('0x6'));var client=jayson[_0x6cfa('0x7')][_0x6cfa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d5e05,_0x58de9d,_0x49d605){return new BPromise(function(_0x42526e,_0x53c88e){return client[_0x6cfa('0x9')](_0x1d5e05,_0x49d605)[_0x6cfa('0xa')](function(_0x4fc93e){logger[_0x6cfa('0xb')](_0x6cfa('0xc'),_0x58de9d,_0x6cfa('0xd'));logger[_0x6cfa('0xe')](_0x6cfa('0xf'),_0x58de9d,_0x6cfa('0xd'),JSON['stringify'](_0x4fc93e));if(_0x4fc93e[_0x6cfa('0x10')]){if(_0x4fc93e[_0x6cfa('0x10')][_0x6cfa('0x11')]===0x1f4){logger[_0x6cfa('0x10')](_0x6cfa('0xc'),_0x58de9d,_0x4fc93e['error'][_0x6cfa('0x12')]);return _0x53c88e(_0x4fc93e[_0x6cfa('0x10')]['message']);}logger[_0x6cfa('0x10')](_0x6cfa('0xc'),_0x58de9d,_0x4fc93e[_0x6cfa('0x10')]['message']);return _0x42526e(_0x4fc93e['error'][_0x6cfa('0x12')]);}else{logger[_0x6cfa('0xb')](_0x6cfa('0xc'),_0x58de9d,_0x6cfa('0xd'));_0x42526e(_0x4fc93e[_0x6cfa('0x13')][_0x6cfa('0x12')]);}})['catch'](function(_0x1fbcca){logger[_0x6cfa('0x10')](_0x6cfa('0xc'),_0x58de9d,_0x1fbcca);_0x53c88e(_0x1fbcca);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d785981..f5b5de1 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 _0xf92a=['/:id','show','post','put','update','delete','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xf92a,0x1f4));var _0xaf92=function(_0x30adcd,_0x11f0a2){_0x30adcd=_0x30adcd-0x0;var _0x120dd4=_0xf92a[_0x30adcd];return _0x120dd4;};'use strict';var multer=require(_0xaf92('0x0'));var util=require(_0xaf92('0x1'));var path=require(_0xaf92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaf92('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaf92('0x4'));var config=require(_0xaf92('0x5'));var controller=require(_0xaf92('0x6'));router[_0xaf92('0x7')]('/',auth[_0xaf92('0x8')](),controller[_0xaf92('0x9')]);router['get'](_0xaf92('0xa'),auth['isAuthenticated'](),controller[_0xaf92('0xb')]);router[_0xaf92('0xc')]('/',auth[_0xaf92('0x8')](),controller['create']);router[_0xaf92('0xd')]('/:id',auth[_0xaf92('0x8')](),controller[_0xaf92('0xe')]);router[_0xaf92('0xf')](_0xaf92('0xa'),auth[_0xaf92('0x8')](),controller['destroy']);module[_0xaf92('0x10')]=router; \ No newline at end of file +var _0x2a6c=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x2a6c,0x79));var _0xc2a6=function(_0x1e6e3a,_0x1146bb){_0x1e6e3a=_0x1e6e3a-0x0;var _0x530b4f=_0x2a6c[_0x1e6e3a];return _0x530b4f;};'use strict';var multer=require(_0xc2a6('0x0'));var util=require(_0xc2a6('0x1'));var path=require(_0xc2a6('0x2'));var timeout=require(_0xc2a6('0x3'));var express=require(_0xc2a6('0x4'));var router=express[_0xc2a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc2a6('0x6'));var interaction=require(_0xc2a6('0x7'));var config=require(_0xc2a6('0x8'));var controller=require(_0xc2a6('0x9'));router['get']('/',auth[_0xc2a6('0xa')](),controller['index']);router[_0xc2a6('0xb')](_0xc2a6('0xc'),auth[_0xc2a6('0xa')](),controller[_0xc2a6('0xd')]);router[_0xc2a6('0xe')]('/',auth[_0xc2a6('0xa')](),controller[_0xc2a6('0xf')]);router[_0xc2a6('0x10')](_0xc2a6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc2a6('0x11')](_0xc2a6('0xc'),auth[_0xc2a6('0xa')](),controller[_0xc2a6('0x12')]);module[_0xc2a6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index cf6e915..2f22eca 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 _0x69ba=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string'];(function(_0x290fc9,_0x3069fe){var _0x31c8bd=function(_0x4bec21){while(--_0x4bec21){_0x290fc9['push'](_0x290fc9['shift']());}};_0x31c8bd(++_0x3069fe);}(_0x69ba,0x1a9));var _0xa69b=function(_0x546896,_0x26dbb0){_0x546896=_0x546896-0x0;var _0x487ada=_0x69ba[_0x546896];return _0x487ada;};'use strict';var Sequelize=require(_0xa69b('0x0'));module[_0xa69b('0x1')]={'type':{'type':Sequelize[_0xa69b('0x2')]('string',_0xa69b('0x3'),_0xa69b('0x4'),'keyValue',_0xa69b('0x5')),'defaultValue':_0xa69b('0x6')},'content':{'type':Sequelize[_0xa69b('0x7')]},'key':{'type':Sequelize[_0xa69b('0x7')]},'keyType':{'type':Sequelize[_0xa69b('0x2')]('string','variable',_0xa69b('0x4'))},'keyContent':{'type':Sequelize[_0xa69b('0x7')]},'idField':{'type':Sequelize[_0xa69b('0x7')]},'nameField':{'type':Sequelize[_0xa69b('0x7')]},'customField':{'type':Sequelize[_0xa69b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa69b('0x7')]}}; \ No newline at end of file +var _0xfc1d=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x5d484e,_0xcec485){var _0x3a6d8b=function(_0x45586a){while(--_0x45586a){_0x5d484e['push'](_0x5d484e['shift']());}};_0x3a6d8b(++_0xcec485);}(_0xfc1d,0x184));var _0xdfc1=function(_0x6cbff6,_0x3b59f8){_0x6cbff6=_0x6cbff6-0x0;var _0x390e52=_0xfc1d[_0x6cbff6];return _0x390e52;};'use strict';var Sequelize=require(_0xdfc1('0x0'));module[_0xdfc1('0x1')]={'type':{'type':Sequelize[_0xdfc1('0x2')](_0xdfc1('0x3'),_0xdfc1('0x4'),'customVariable',_0xdfc1('0x5'),_0xdfc1('0x6')),'defaultValue':_0xdfc1('0x3')},'content':{'type':Sequelize[_0xdfc1('0x7')]},'key':{'type':Sequelize[_0xdfc1('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdfc1('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xdfc1('0x7')]},'idField':{'type':Sequelize[_0xdfc1('0x7')]},'nameField':{'type':Sequelize[_0xdfc1('0x7')]},'customField':{'type':Sequelize[_0xdfc1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdfc1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ab3f238..e93c280 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 _0xbf24=['desk.js','querystring','papaparse','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','Content-Range','apply','save','then','destroy','stack','name','send','index','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x50c693,_0x7e04e3){var _0x342fbb=function(_0x263f61){while(--_0x263f61){_0x50c693['push'](_0x50c693['shift']());}};_0x342fbb(++_0x7e04e3);}(_0xbf24,0x1b3));var _0x4bf2=function(_0x370732,_0x304cac){_0x370732=_0x370732-0x0;var _0x3226d8=_0xbf24[_0x370732];return _0x3226d8;};'use strict';var emlformat=require(_0x4bf2('0x0'));var rimraf=require(_0x4bf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4bf2('0x2'));var rp=require(_0x4bf2('0x3'));var moment=require(_0x4bf2('0x4'));var BPromise=require(_0x4bf2('0x5'));var Mustache=require(_0x4bf2('0x6'));var util=require(_0x4bf2('0x7'));var path=require('path');var sox=require(_0x4bf2('0x8'));var csv=require(_0x4bf2('0x9'));var ejs=require(_0x4bf2('0xa'));var fs=require('fs');var fs_extra=require(_0x4bf2('0xb'));var _=require(_0x4bf2('0xc'));var squel=require('squel');var crypto=require(_0x4bf2('0xd'));var jsforce=require(_0x4bf2('0xe'));var deskjs=require(_0x4bf2('0xf'));var toCsv=require(_0x4bf2('0x9'));var querystring=require(_0x4bf2('0x10'));var Papa=require(_0x4bf2('0x11'));var Redis=require(_0x4bf2('0x12'));var authService=require(_0x4bf2('0x13'));var qs=require(_0x4bf2('0x14'));var as=require(_0x4bf2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bf2('0x16'))(_0x4bf2('0x17'));var utils=require(_0x4bf2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4bf2('0x19'))['db'];function respondWithStatusCode(_0x23bc1d,_0x21e8bd){_0x21e8bd=_0x21e8bd||0xcc;return function(_0x5ca528){if(_0x5ca528){return _0x23bc1d[_0x4bf2('0x1a')](_0x21e8bd);}return _0x23bc1d[_0x4bf2('0x1b')](_0x21e8bd)[_0x4bf2('0x1c')]();};}function respondWithResult(_0xdb3b66,_0x43b7aa){_0x43b7aa=_0x43b7aa||0xc8;return function(_0x3f6cce){if(_0x3f6cce){return _0xdb3b66['status'](_0x43b7aa)[_0x4bf2('0x1d')](_0x3f6cce);}};}function respondWithFilteredResult(_0x193fa4,_0x179a14){return function(_0x5499af){if(_0x5499af){var _0x200cea=typeof _0x179a14[_0x4bf2('0x1e')]===_0x4bf2('0x1f')&&typeof _0x179a14[_0x4bf2('0x20')]===_0x4bf2('0x1f');var _0x562fc3=_0x5499af[_0x4bf2('0x21')];var _0x59c6fe=_0x200cea?0x0:_0x179a14[_0x4bf2('0x1e')];var _0x171cd5=_0x200cea?_0x5499af[_0x4bf2('0x21')]:_0x179a14[_0x4bf2('0x1e')]+_0x179a14[_0x4bf2('0x20')];var _0x2c33e1;if(_0x171cd5>=_0x562fc3){_0x171cd5=_0x562fc3;_0x2c33e1=0xc8;}else{_0x2c33e1=0xce;}_0x193fa4[_0x4bf2('0x1b')](_0x2c33e1);return _0x193fa4[_0x4bf2('0x22')](_0x4bf2('0x23'),_0x59c6fe+'-'+_0x171cd5+'/'+_0x562fc3)[_0x4bf2('0x1d')](_0x5499af);}return null;};}function patchUpdates(_0x22eaec){return function(_0x1b6e3f){try{jsonpatch[_0x4bf2('0x24')](_0x1b6e3f,_0x22eaec,!![]);}catch(_0x3cf715){return BPromise['reject'](_0x3cf715);}return _0x1b6e3f[_0x4bf2('0x25')]();};}function saveUpdates(_0x110260,_0x2561c5){return function(_0x403c00){if(_0x403c00){return _0x403c00['update'](_0x110260)[_0x4bf2('0x26')](function(_0x3a7df2){return _0x3a7df2;});}return null;};}function removeEntity(_0x3b6338,_0x5665d8){return function(_0x37e9e7){if(_0x37e9e7){return _0x37e9e7[_0x4bf2('0x27')]()['then'](function(){_0x3b6338[_0x4bf2('0x1b')](0xcc)[_0x4bf2('0x1c')]();});}};}function handleEntityNotFound(_0x590102,_0x5e8398){return function(_0x28d50b){if(!_0x28d50b){_0x590102['sendStatus'](0x194);}return _0x28d50b;};}function handleError(_0x10964e,_0x59fc4e){_0x59fc4e=_0x59fc4e||0x1f4;return function(_0x124953){logger['error'](_0x124953[_0x4bf2('0x28')]);if(_0x124953['name']){delete _0x124953[_0x4bf2('0x29')];}_0x10964e[_0x4bf2('0x1b')](_0x59fc4e)[_0x4bf2('0x2a')](_0x124953);};}exports[_0x4bf2('0x2b')]=function(_0x320dae,_0x521019){var _0x241696={},_0x7cfe4b={},_0x449468={'count':0x0,'rows':[]};var _0x38d7bf=_['map'](db[_0x4bf2('0x2c')]['rawAttributes'],function(_0x451250){return{'name':_0x451250[_0x4bf2('0x2d')],'type':_0x451250[_0x4bf2('0x2e')][_0x4bf2('0x2f')]};});_0x7cfe4b[_0x4bf2('0x30')]=_['map'](_0x38d7bf,'name');_0x7cfe4b[_0x4bf2('0x31')]=_[_0x4bf2('0x32')](_0x320dae[_0x4bf2('0x31')]);_0x7cfe4b[_0x4bf2('0x33')]=_[_0x4bf2('0x34')](_0x7cfe4b[_0x4bf2('0x30')],_0x7cfe4b[_0x4bf2('0x31')]);_0x241696['attributes']=_[_0x4bf2('0x34')](_0x7cfe4b[_0x4bf2('0x30')],qs['fields'](_0x320dae['query'][_0x4bf2('0x35')]));_0x241696[_0x4bf2('0x36')]=_0x241696['attributes']['length']?_0x241696[_0x4bf2('0x36')]:_0x7cfe4b[_0x4bf2('0x30')];if(!_0x320dae['query'][_0x4bf2('0x37')]('nolimit')){_0x241696['limit']=qs[_0x4bf2('0x20')](_0x320dae['query']['limit']);_0x241696[_0x4bf2('0x1e')]=qs[_0x4bf2('0x1e')](_0x320dae['query'][_0x4bf2('0x1e')]);}_0x241696[_0x4bf2('0x38')]=qs[_0x4bf2('0x39')](_0x320dae[_0x4bf2('0x31')][_0x4bf2('0x39')]);_0x241696[_0x4bf2('0x3a')]=qs[_0x4bf2('0x33')](_[_0x4bf2('0x3b')](_0x320dae[_0x4bf2('0x31')],_0x7cfe4b[_0x4bf2('0x33')]),_0x38d7bf);if(_0x320dae[_0x4bf2('0x31')][_0x4bf2('0x3c')]){_0x241696['where']=_[_0x4bf2('0x3d')](_0x241696[_0x4bf2('0x3a')],{'$or':_['map'](_0x38d7bf,function(_0x5008bd){if(_0x5008bd[_0x4bf2('0x2e')]!==_0x4bf2('0x3e')){var _0x529f0a={};_0x529f0a[_0x5008bd[_0x4bf2('0x29')]]={'$like':'%'+_0x320dae['query'][_0x4bf2('0x3c')]+'%'};return _0x529f0a;}})});}_0x241696=_[_0x4bf2('0x3d')]({},_0x241696,_0x320dae[_0x4bf2('0x3f')]);var _0x14a9b9={'where':_0x241696['where']};return db['VtigerField']['count'](_0x14a9b9)[_0x4bf2('0x26')](function(_0x58a816){_0x449468[_0x4bf2('0x21')]=_0x58a816;if(_0x320dae[_0x4bf2('0x31')][_0x4bf2('0x40')]){_0x241696[_0x4bf2('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x4bf2('0x42')](_0x241696);})['then'](function(_0x1c9da3){_0x449468['rows']=_0x1c9da3;return _0x449468;})['then'](respondWithFilteredResult(_0x521019,_0x241696))[_0x4bf2('0x43')](handleError(_0x521019,null));};exports[_0x4bf2('0x44')]=function(_0x22c825,_0x4562ac){var _0x4c1613={'raw':!![],'where':{'id':_0x22c825['params']['id']}},_0xc88555={};_0xc88555[_0x4bf2('0x30')]=_[_0x4bf2('0x32')](db[_0x4bf2('0x2c')][_0x4bf2('0x45')]);_0xc88555[_0x4bf2('0x31')]=_[_0x4bf2('0x32')](_0x22c825[_0x4bf2('0x31')]);_0xc88555['filters']=_[_0x4bf2('0x34')](_0xc88555[_0x4bf2('0x30')],_0xc88555['query']);_0x4c1613[_0x4bf2('0x36')]=_[_0x4bf2('0x34')](_0xc88555[_0x4bf2('0x30')],qs[_0x4bf2('0x35')](_0x22c825[_0x4bf2('0x31')]['fields']));_0x4c1613[_0x4bf2('0x36')]=_0x4c1613['attributes'][_0x4bf2('0x46')]?_0x4c1613[_0x4bf2('0x36')]:_0xc88555['model'];if(_0x22c825[_0x4bf2('0x31')][_0x4bf2('0x40')]){_0x4c1613['include']=[{'all':!![]}];}_0x4c1613=_[_0x4bf2('0x3d')]({},_0x4c1613,_0x22c825[_0x4bf2('0x3f')]);return db[_0x4bf2('0x2c')][_0x4bf2('0x47')](_0x4c1613)[_0x4bf2('0x26')](handleEntityNotFound(_0x4562ac,null))[_0x4bf2('0x26')](respondWithResult(_0x4562ac,null))[_0x4bf2('0x43')](handleError(_0x4562ac,null));};exports[_0x4bf2('0x48')]=function(_0x5e7470,_0x4cf583){return db[_0x4bf2('0x2c')]['create'](_0x5e7470[_0x4bf2('0x49')],{})[_0x4bf2('0x26')](respondWithResult(_0x4cf583,0xc9))[_0x4bf2('0x43')](handleError(_0x4cf583,null));};exports['update']=function(_0x508dc1,_0x291ae4){if(_0x508dc1[_0x4bf2('0x49')]['id']){delete _0x508dc1[_0x4bf2('0x49')]['id'];}return db['VtigerField'][_0x4bf2('0x47')]({'where':{'id':_0x508dc1[_0x4bf2('0x4a')]['id']}})[_0x4bf2('0x26')](handleEntityNotFound(_0x291ae4,null))[_0x4bf2('0x26')](saveUpdates(_0x508dc1[_0x4bf2('0x49')],null))[_0x4bf2('0x26')](respondWithResult(_0x291ae4,null))[_0x4bf2('0x43')](handleError(_0x291ae4,null));};exports[_0x4bf2('0x27')]=function(_0x142db1,_0x4bff88){return db['VtigerField'][_0x4bf2('0x47')]({'where':{'id':_0x142db1['params']['id']}})[_0x4bf2('0x26')](handleEntityNotFound(_0x4bff88,null))[_0x4bf2('0x26')](removeEntity(_0x4bff88,null))[_0x4bf2('0x43')](handleError(_0x4bff88,null));}; \ No newline at end of file +var _0xfc25=['show','options','catch','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VtigerField','includeAll','include','findAll','rows'];(function(_0x3d8ddb,_0x22d9e6){var _0x2e246b=function(_0x1345c8){while(--_0x1345c8){_0x3d8ddb['push'](_0x3d8ddb['shift']());}};_0x2e246b(++_0x22d9e6);}(_0xfc25,0x188));var _0x5fc2=function(_0x236ea7,_0x3c1537){_0x236ea7=_0x236ea7-0x0;var _0x59f3da=_0xfc25[_0x236ea7];return _0x59f3da;};'use strict';var emlformat=require(_0x5fc2('0x0'));var rimraf=require(_0x5fc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5fc2('0x2'));var moment=require(_0x5fc2('0x3'));var BPromise=require(_0x5fc2('0x4'));var Mustache=require(_0x5fc2('0x5'));var util=require(_0x5fc2('0x6'));var path=require(_0x5fc2('0x7'));var sox=require(_0x5fc2('0x8'));var csv=require('to-csv');var ejs=require(_0x5fc2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5fc2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fc2('0xb'));var toCsv=require(_0x5fc2('0xc'));var querystring=require('querystring');var Papa=require(_0x5fc2('0xd'));var Redis=require(_0x5fc2('0xe'));var authService=require(_0x5fc2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5fc2('0x10'));var hardwareService=require(_0x5fc2('0x11'));var logger=require(_0x5fc2('0x12'))(_0x5fc2('0x13'));var utils=require(_0x5fc2('0x14'));var config=require(_0x5fc2('0x15'));var licenseUtil=require(_0x5fc2('0x16'));var db=require(_0x5fc2('0x17'))['db'];function respondWithStatusCode(_0x333869,_0x474ca0){_0x474ca0=_0x474ca0||0xcc;return function(_0x4ac00b){if(_0x4ac00b){return _0x333869[_0x5fc2('0x18')](_0x474ca0);}return _0x333869[_0x5fc2('0x19')](_0x474ca0)[_0x5fc2('0x1a')]();};}function respondWithResult(_0x482923,_0x5cfa8a){_0x5cfa8a=_0x5cfa8a||0xc8;return function(_0x4576ca){if(_0x4576ca){return _0x482923[_0x5fc2('0x19')](_0x5cfa8a)[_0x5fc2('0x1b')](_0x4576ca);}};}function respondWithFilteredResult(_0x4ea8d0,_0x4a8ee0){return function(_0x1a2ff5){if(_0x1a2ff5){var _0x22223f=typeof _0x4a8ee0[_0x5fc2('0x1c')]===_0x5fc2('0x1d')&&typeof _0x4a8ee0[_0x5fc2('0x1e')]===_0x5fc2('0x1d');var _0x20596d=_0x1a2ff5[_0x5fc2('0x1f')];var _0x1a151f=_0x22223f?0x0:_0x4a8ee0['offset'];var _0x382ea2=_0x22223f?_0x1a2ff5[_0x5fc2('0x1f')]:_0x4a8ee0['offset']+_0x4a8ee0[_0x5fc2('0x1e')];var _0x27884d;if(_0x382ea2>=_0x20596d){_0x382ea2=_0x20596d;_0x27884d=0xc8;}else{_0x27884d=0xce;}_0x4ea8d0[_0x5fc2('0x19')](_0x27884d);return _0x4ea8d0['set'](_0x5fc2('0x20'),_0x1a151f+'-'+_0x382ea2+'/'+_0x20596d)['json'](_0x1a2ff5);}return null;};}function patchUpdates(_0x1988e0){return function(_0x394e7d){try{jsonpatch[_0x5fc2('0x21')](_0x394e7d,_0x1988e0,!![]);}catch(_0x380bfc){return BPromise[_0x5fc2('0x22')](_0x380bfc);}return _0x394e7d[_0x5fc2('0x23')]();};}function saveUpdates(_0xc4502f,_0x22fdf4){return function(_0x21e7d6){if(_0x21e7d6){return _0x21e7d6[_0x5fc2('0x24')](_0xc4502f)[_0x5fc2('0x25')](function(_0x5e34b5){return _0x5e34b5;});}return null;};}function removeEntity(_0x101f9d,_0x54a25){return function(_0x23651d){if(_0x23651d){return _0x23651d[_0x5fc2('0x26')]()['then'](function(){_0x101f9d['status'](0xcc)[_0x5fc2('0x1a')]();});}};}function handleEntityNotFound(_0x489313,_0x5f406f){return function(_0xf77ff4){if(!_0xf77ff4){_0x489313['sendStatus'](0x194);}return _0xf77ff4;};}function handleError(_0x23af7d,_0x53803a){_0x53803a=_0x53803a||0x1f4;return function(_0x46ff7f){logger[_0x5fc2('0x27')](_0x46ff7f[_0x5fc2('0x28')]);if(_0x46ff7f[_0x5fc2('0x29')]){delete _0x46ff7f[_0x5fc2('0x29')];}_0x23af7d[_0x5fc2('0x19')](_0x53803a)[_0x5fc2('0x2a')](_0x46ff7f);};}exports[_0x5fc2('0x2b')]=function(_0x261c30,_0x26f03c){var _0x3b4091={},_0x26d711={},_0x546b39={'count':0x0,'rows':[]};var _0x57e303=_[_0x5fc2('0x2c')](db['VtigerField'][_0x5fc2('0x2d')],function(_0x18fb1c){return{'name':_0x18fb1c[_0x5fc2('0x2e')],'type':_0x18fb1c['type']['key']};});_0x26d711[_0x5fc2('0x2f')]=_[_0x5fc2('0x2c')](_0x57e303,_0x5fc2('0x29'));_0x26d711['query']=_[_0x5fc2('0x30')](_0x261c30[_0x5fc2('0x31')]);_0x26d711[_0x5fc2('0x32')]=_[_0x5fc2('0x33')](_0x26d711[_0x5fc2('0x2f')],_0x26d711[_0x5fc2('0x31')]);_0x3b4091[_0x5fc2('0x34')]=_[_0x5fc2('0x33')](_0x26d711[_0x5fc2('0x2f')],qs[_0x5fc2('0x35')](_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x35')]));_0x3b4091[_0x5fc2('0x34')]=_0x3b4091[_0x5fc2('0x34')][_0x5fc2('0x36')]?_0x3b4091[_0x5fc2('0x34')]:_0x26d711[_0x5fc2('0x2f')];if(!_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x37')](_0x5fc2('0x38'))){_0x3b4091['limit']=qs[_0x5fc2('0x1e')](_0x261c30[_0x5fc2('0x31')]['limit']);_0x3b4091[_0x5fc2('0x1c')]=qs[_0x5fc2('0x1c')](_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x1c')]);}_0x3b4091[_0x5fc2('0x39')]=qs[_0x5fc2('0x3a')](_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x3a')]);_0x3b4091['where']=qs[_0x5fc2('0x32')](_[_0x5fc2('0x3b')](_0x261c30['query'],_0x26d711[_0x5fc2('0x32')]),_0x57e303);if(_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x3c')]){_0x3b4091[_0x5fc2('0x3d')]=_[_0x5fc2('0x3e')](_0x3b4091['where'],{'$or':_['map'](_0x57e303,function(_0x3238eb){if(_0x3238eb[_0x5fc2('0x3f')]!==_0x5fc2('0x40')){var _0x144fce={};_0x144fce[_0x3238eb[_0x5fc2('0x29')]]={'$like':'%'+_0x261c30['query']['filter']+'%'};return _0x144fce;}})});}_0x3b4091=_[_0x5fc2('0x3e')]({},_0x3b4091,_0x261c30['options']);var _0x100acb={'where':_0x3b4091['where']};return db[_0x5fc2('0x41')][_0x5fc2('0x1f')](_0x100acb)[_0x5fc2('0x25')](function(_0x497f0f){_0x546b39[_0x5fc2('0x1f')]=_0x497f0f;if(_0x261c30[_0x5fc2('0x31')][_0x5fc2('0x42')]){_0x3b4091[_0x5fc2('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0x5fc2('0x44')](_0x3b4091);})[_0x5fc2('0x25')](function(_0x21ffce){_0x546b39[_0x5fc2('0x45')]=_0x21ffce;return _0x546b39;})[_0x5fc2('0x25')](respondWithFilteredResult(_0x26f03c,_0x3b4091))['catch'](handleError(_0x26f03c,null));};exports[_0x5fc2('0x46')]=function(_0x252207,_0x3f63da){var _0x431126={'raw':!![],'where':{'id':_0x252207['params']['id']}},_0x2aa52a={};_0x2aa52a[_0x5fc2('0x2f')]=_[_0x5fc2('0x30')](db[_0x5fc2('0x41')][_0x5fc2('0x2d')]);_0x2aa52a['query']=_['keys'](_0x252207[_0x5fc2('0x31')]);_0x2aa52a[_0x5fc2('0x32')]=_['intersection'](_0x2aa52a['model'],_0x2aa52a[_0x5fc2('0x31')]);_0x431126[_0x5fc2('0x34')]=_[_0x5fc2('0x33')](_0x2aa52a['model'],qs['fields'](_0x252207[_0x5fc2('0x31')][_0x5fc2('0x35')]));_0x431126[_0x5fc2('0x34')]=_0x431126[_0x5fc2('0x34')][_0x5fc2('0x36')]?_0x431126[_0x5fc2('0x34')]:_0x2aa52a['model'];if(_0x252207[_0x5fc2('0x31')][_0x5fc2('0x42')]){_0x431126[_0x5fc2('0x43')]=[{'all':!![]}];}_0x431126=_[_0x5fc2('0x3e')]({},_0x431126,_0x252207[_0x5fc2('0x47')]);return db[_0x5fc2('0x41')]['find'](_0x431126)['then'](handleEntityNotFound(_0x3f63da,null))[_0x5fc2('0x25')](respondWithResult(_0x3f63da,null))[_0x5fc2('0x48')](handleError(_0x3f63da,null));};exports[_0x5fc2('0x49')]=function(_0x38a5ea,_0x2e4e24){return db['VtigerField'][_0x5fc2('0x49')](_0x38a5ea[_0x5fc2('0x4a')],{})['then'](respondWithResult(_0x2e4e24,0xc9))[_0x5fc2('0x48')](handleError(_0x2e4e24,null));};exports[_0x5fc2('0x24')]=function(_0x5f9579,_0x4b48cc){if(_0x5f9579[_0x5fc2('0x4a')]['id']){delete _0x5f9579[_0x5fc2('0x4a')]['id'];}return db[_0x5fc2('0x41')][_0x5fc2('0x4b')]({'where':{'id':_0x5f9579[_0x5fc2('0x4c')]['id']}})[_0x5fc2('0x25')](handleEntityNotFound(_0x4b48cc,null))['then'](saveUpdates(_0x5f9579['body'],null))['then'](respondWithResult(_0x4b48cc,null))[_0x5fc2('0x48')](handleError(_0x4b48cc,null));};exports['destroy']=function(_0x50a6b2,_0x18fdb6){return db[_0x5fc2('0x41')][_0x5fc2('0x4b')]({'where':{'id':_0x50a6b2['params']['id']}})[_0x5fc2('0x25')](handleEntityNotFound(_0x18fdb6,null))[_0x5fc2('0x25')](removeEntity(_0x18fdb6,null))[_0x5fc2('0x48')](handleError(_0x18fdb6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6f384e4..2e697b6 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 _0x7706=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x4bc2e4,_0x108172){var _0x54a813=function(_0x30a74a){while(--_0x30a74a){_0x4bc2e4['push'](_0x4bc2e4['shift']());}};_0x54a813(++_0x108172);}(_0x7706,0x91));var _0x6770=function(_0x59bd96,_0x3337c3){_0x59bd96=_0x59bd96-0x0;var _0x1a4e38=_0x7706[_0x59bd96];return _0x1a4e38;};'use strict';var _=require(_0x6770('0x0'));var util=require('util');var logger=require(_0x6770('0x1'))(_0x6770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6770('0x3'));var rimraf=require(_0x6770('0x4'));var config=require(_0x6770('0x5'));var attributes=require(_0x6770('0x6'));module[_0x6770('0x7')]=function(_0x3de2dc,_0x51dfa6){return _0x3de2dc[_0x6770('0x8')](_0x6770('0x9'),attributes,{'tableName':_0x6770('0xa'),'paranoid':![],'indexes':[{'name':_0x6770('0xb'),'fields':[_0x6770('0xc'),_0x6770('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd9f=['request-promise','path','rimraf','../../config/environment','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x25e1d6,_0x81e035){var _0x41ddd2=function(_0x131cac){while(--_0x131cac){_0x25e1d6['push'](_0x25e1d6['shift']());}};_0x41ddd2(++_0x81e035);}(_0xdd9f,0x1aa));var _0xfdd9=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0xdd9f[_0x11ba46];return _0x1c8c6f;};'use strict';var _=require(_0xfdd9('0x0'));var util=require(_0xfdd9('0x1'));var logger=require(_0xfdd9('0x2'))(_0xfdd9('0x3'));var moment=require(_0xfdd9('0x4'));var BPromise=require(_0xfdd9('0x5'));var rp=require(_0xfdd9('0x6'));var fs=require('fs');var path=require(_0xfdd9('0x7'));var rimraf=require(_0xfdd9('0x8'));var config=require(_0xfdd9('0x9'));var attributes=require('./intVtigerField.attributes');module[_0xfdd9('0xa')]=function(_0x34c964,_0x377654){return _0x34c964[_0xfdd9('0xb')]('VtigerField',attributes,{'tableName':_0xfdd9('0xc'),'paranoid':![],'indexes':[{'name':_0xfdd9('0xd'),'fields':[_0xfdd9('0xe'),_0xfdd9('0xf')],'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 18adf72..aa2a4c5 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 _0xcdde=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x3f7fd5,_0x98ceec){var _0x11cdd3=function(_0x109c6f){while(--_0x109c6f){_0x3f7fd5['push'](_0x3f7fd5['shift']());}};_0x11cdd3(++_0x98ceec);}(_0xcdde,0xd8));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecdd('0x0'));var util=require(_0xecdd('0x1'));var moment=require('moment');var BPromise=require(_0xecdd('0x2'));var rs=require(_0xecdd('0x3'));var fs=require('fs');var Redis=require(_0xecdd('0x4'));var db=require(_0xecdd('0x5'))['db'];var utils=require(_0xecdd('0x6'));var logger=require(_0xecdd('0x7'))('rpc');var config=require(_0xecdd('0x8'));var jayson=require(_0xecdd('0x9'));var client=jayson[_0xecdd('0xa')][_0xecdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137480,_0x22ea12,_0x12d288){return new BPromise(function(_0x2f94fd,_0x46a8c5){return client[_0xecdd('0xc')](_0x137480,_0x12d288)['then'](function(_0x4bbe8a){logger['info']('VtigerField,\x20%s,\x20%s',_0x22ea12,_0xecdd('0xd'));logger[_0xecdd('0xe')](_0xecdd('0xf'),_0x22ea12,_0xecdd('0xd'),JSON[_0xecdd('0x10')](_0x4bbe8a));if(_0x4bbe8a['error']){if(_0x4bbe8a[_0xecdd('0x11')][_0xecdd('0x12')]===0x1f4){logger[_0xecdd('0x11')](_0xecdd('0x13'),_0x22ea12,_0x4bbe8a[_0xecdd('0x11')][_0xecdd('0x14')]);return _0x46a8c5(_0x4bbe8a[_0xecdd('0x11')]['message']);}logger[_0xecdd('0x11')](_0xecdd('0x13'),_0x22ea12,_0x4bbe8a[_0xecdd('0x11')][_0xecdd('0x14')]);return _0x2f94fd(_0x4bbe8a[_0xecdd('0x11')][_0xecdd('0x14')]);}else{logger['info'](_0xecdd('0x13'),_0x22ea12,_0xecdd('0xd'));_0x2f94fd(_0x4bbe8a['result'][_0xecdd('0x14')]);}})[_0xecdd('0x15')](function(_0xc0023d){logger[_0xecdd('0x11')]('VtigerField,\x20%s,\x20%s',_0x22ea12,_0xc0023d);_0x46a8c5(_0xc0023d);});});} \ No newline at end of file +var _0x8d91=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x8d91,0xa0));var _0x18d9=function(_0x43a1fb,_0x153899){_0x43a1fb=_0x43a1fb-0x0;var _0x34991f=_0x8d91[_0x43a1fb];return _0x34991f;};'use strict';var _=require(_0x18d9('0x0'));var util=require('util');var moment=require(_0x18d9('0x1'));var BPromise=require(_0x18d9('0x2'));var rs=require(_0x18d9('0x3'));var fs=require('fs');var Redis=require(_0x18d9('0x4'));var db=require(_0x18d9('0x5'))['db'];var utils=require(_0x18d9('0x6'));var logger=require(_0x18d9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x18d9('0x8'));var client=jayson[_0x18d9('0x9')][_0x18d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x521deb,_0x2b97fb,_0x416304){return new BPromise(function(_0x1cc7af,_0x2b4c3f){return client[_0x18d9('0xb')](_0x521deb,_0x416304)['then'](function(_0x7d5e67){logger[_0x18d9('0xc')](_0x18d9('0xd'),_0x2b97fb,'request\x20sent');logger['debug'](_0x18d9('0xe'),_0x2b97fb,_0x18d9('0xf'),JSON[_0x18d9('0x10')](_0x7d5e67));if(_0x7d5e67['error']){if(_0x7d5e67['error'][_0x18d9('0x11')]===0x1f4){logger[_0x18d9('0x12')](_0x18d9('0xd'),_0x2b97fb,_0x7d5e67[_0x18d9('0x12')][_0x18d9('0x13')]);return _0x2b4c3f(_0x7d5e67['error'][_0x18d9('0x13')]);}logger['error'](_0x18d9('0xd'),_0x2b97fb,_0x7d5e67[_0x18d9('0x12')][_0x18d9('0x13')]);return _0x1cc7af(_0x7d5e67[_0x18d9('0x12')][_0x18d9('0x13')]);}else{logger[_0x18d9('0xc')](_0x18d9('0xd'),_0x2b97fb,_0x18d9('0xf'));_0x1cc7af(_0x7d5e67['result']['message']);}})['catch'](function(_0x2af9ee){logger[_0x18d9('0x12')]('VtigerField,\x20%s,\x20%s',_0x2b97fb,_0x2af9ee);_0x2b4c3f(_0x2af9ee);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 58669e3..269420c 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 _0xff2c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','exports','util','connect-timeout'];(function(_0x9a28d6,_0x5e2125){var _0x438c21=function(_0x434ab8){while(--_0x434ab8){_0x9a28d6['push'](_0x9a28d6['shift']());}};_0x438c21(++_0x5e2125);}(_0xff2c,0x88));var _0xcff2=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xff2c[_0x29d6e6];return _0xc75ff0;};'use strict';var multer=require('multer');var util=require(_0xcff2('0x0'));var path=require('path');var timeout=require(_0xcff2('0x1'));var express=require(_0xcff2('0x2'));var router=express[_0xcff2('0x3')]();var fs_extra=require(_0xcff2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcff2('0x5'));var config=require(_0xcff2('0x6'));var controller=require(_0xcff2('0x7'));router[_0xcff2('0x8')]('/',auth[_0xcff2('0x9')](),controller[_0xcff2('0xa')]);router[_0xcff2('0x8')]('/:id',auth[_0xcff2('0x9')](),controller[_0xcff2('0xb')]);router[_0xcff2('0x8')]('/:id/configurations',auth[_0xcff2('0x9')](),controller[_0xcff2('0xc')]);router[_0xcff2('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xcff2('0xd')]);router[_0xcff2('0xe')]('/',auth[_0xcff2('0x9')](),controller[_0xcff2('0xf')]);router[_0xcff2('0xe')](_0xcff2('0x10'),auth[_0xcff2('0x9')](),controller[_0xcff2('0x11')]);router[_0xcff2('0x12')](_0xcff2('0x13'),auth[_0xcff2('0x9')](),controller[_0xcff2('0x14')]);router[_0xcff2('0x15')](_0xcff2('0x13'),auth[_0xcff2('0x9')](),controller['destroy']);module[_0xcff2('0x16')]=router; \ No newline at end of file +var _0x428b=['/:id/configurations','getConfigurations','/:id/fields','create','post','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show'];(function(_0x596535,_0x48ee62){var _0x2b7e63=function(_0x2bc968){while(--_0x2bc968){_0x596535['push'](_0x596535['shift']());}};_0x2b7e63(++_0x48ee62);}(_0x428b,0xd0));var _0xb428=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x428b[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0xb428('0x0'));var util=require(_0xb428('0x1'));var path=require('path');var timeout=require(_0xb428('0x2'));var express=require('express');var router=express[_0xb428('0x3')]();var fs_extra=require(_0xb428('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb428('0x5'));var controller=require(_0xb428('0x6'));router[_0xb428('0x7')]('/',auth['isAuthenticated'](),controller[_0xb428('0x8')]);router[_0xb428('0x7')](_0xb428('0x9'),auth[_0xb428('0xa')](),controller[_0xb428('0xb')]);router['get'](_0xb428('0xc'),auth[_0xb428('0xa')](),controller[_0xb428('0xd')]);router[_0xb428('0x7')](_0xb428('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xb428('0xa')](),controller[_0xb428('0xf')]);router[_0xb428('0x10')]('/:id/configurations',auth[_0xb428('0xa')](),controller['addConfiguration']);router['put'](_0xb428('0x9'),auth[_0xb428('0xa')](),controller[_0xb428('0x11')]);router[_0xb428('0x12')](_0xb428('0x9'),auth[_0xb428('0xa')](),controller['destroy']);module[_0xb428('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 91f8390..e4a71e6 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 _0x1574=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0x1574,0x148));var _0x4157=function(_0x3b5fcc,_0x15212b){_0x3b5fcc=_0x3b5fcc-0x0;var _0x16f447=_0x1574[_0x3b5fcc];return _0x16f447;};'use strict';var Sequelize=require(_0x4157('0x0'));module[_0x4157('0x1')]={'name':{'type':Sequelize[_0x4157('0x2')]},'description':{'type':Sequelize[_0x4157('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4157('0x3')},'password':{'type':Sequelize[_0x4157('0x2')]},'token':{'type':Sequelize[_0x4157('0x2')]},'remoteUri':{'type':Sequelize[_0x4157('0x2')],'unique':_0x4157('0x4')},'authType':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x6'),_0x4157('0x7')),'defaultValue':_0x4157('0x6')},'serverUrl':{'type':Sequelize[_0x4157('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x8'),_0x4157('0x9')),'defaultValue':_0x4157('0x8')}}; \ No newline at end of file +var _0xa6b0=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x48a79f,_0x1730a4){_0x48a79f=_0x48a79f-0x0;var _0x4f75c5=_0xa6b0[_0x48a79f];return _0x4f75c5;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0a6b('0x2')],'unique':_0x0a6b('0x3')},'password':{'type':Sequelize[_0x0a6b('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a6b('0x2')],'unique':_0x0a6b('0x4')},'authType':{'type':Sequelize[_0x0a6b('0x5')](_0x0a6b('0x6'),_0x0a6b('0x7')),'defaultValue':_0x0a6b('0x6')},'serverUrl':{'type':Sequelize[_0x0a6b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0a6b('0x5')](_0x0a6b('0x8'),_0x0a6b('0x9')),'defaultValue':_0x0a6b('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1f3c763..1c05240 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 _0x4e81=['limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','show','params','find','catch','create','body','findOne','ZendeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','ZendeskField','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','password','headers','Basic\x20%s','toString','base64','format','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined'];(function(_0x273c11,_0x2c1bbb){var _0x51c40a=function(_0x39fad4){while(--_0x39fad4){_0x273c11['push'](_0x273c11['shift']());}};_0x51c40a(++_0x2c1bbb);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4001ad,_0x1e22dd){_0x4001ad=_0x4001ad-0x0;var _0x4c7ec2=_0x4e81[_0x4001ad];return _0x4c7ec2;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x14e8('0x19'));function respondWithStatusCode(_0x59c6c9,_0x2607ef){_0x2607ef=_0x2607ef||0xcc;return function(_0x341d40){if(_0x341d40){return _0x59c6c9[_0x14e8('0x1a')](_0x2607ef);}return _0x59c6c9['status'](_0x2607ef)[_0x14e8('0x1b')]();};}function respondWithResult(_0x4e1064,_0x458e4a){_0x458e4a=_0x458e4a||0xc8;return function(_0x58d26e){if(_0x58d26e){return _0x4e1064[_0x14e8('0x1c')](_0x458e4a)[_0x14e8('0x1d')](_0x58d26e);}};}function respondWithFilteredResult(_0xc6101f,_0x135996){return function(_0x52e64f){if(_0x52e64f){var _0x10c4a9=typeof _0x135996[_0x14e8('0x1e')]===_0x14e8('0x1f')&&typeof _0x135996[_0x14e8('0x20')]===_0x14e8('0x1f');var _0x1f1a0d=_0x52e64f[_0x14e8('0x21')];var _0x462259=_0x10c4a9?0x0:_0x135996['offset'];var _0x328c5a=_0x10c4a9?_0x52e64f[_0x14e8('0x21')]:_0x135996[_0x14e8('0x1e')]+_0x135996[_0x14e8('0x20')];var _0x246c5d;if(_0x328c5a>=_0x1f1a0d){_0x328c5a=_0x1f1a0d;_0x246c5d=0xc8;}else{_0x246c5d=0xce;}_0xc6101f['status'](_0x246c5d);return _0xc6101f[_0x14e8('0x22')](_0x14e8('0x23'),_0x462259+'-'+_0x328c5a+'/'+_0x1f1a0d)[_0x14e8('0x1d')](_0x52e64f);}return null;};}function patchUpdates(_0x48e30a){return function(_0x2c3f45){try{jsonpatch['apply'](_0x2c3f45,_0x48e30a,!![]);}catch(_0x4cca43){return BPromise[_0x14e8('0x24')](_0x4cca43);}return _0x2c3f45[_0x14e8('0x25')]();};}function saveUpdates(_0x117b00,_0xcf673){return function(_0x4ad25d){if(_0x4ad25d){return _0x4ad25d[_0x14e8('0x26')](_0x117b00)['then'](function(_0x31bdd3){return _0x31bdd3;});}return null;};}function removeEntity(_0x185a0e,_0x4ffc8b){return function(_0x58a3a1){if(_0x58a3a1){return _0x58a3a1['destroy']()[_0x14e8('0x27')](function(){_0x185a0e[_0x14e8('0x1c')](0xcc)[_0x14e8('0x1b')]();});}};}function handleEntityNotFound(_0x20bfe8,_0x333d44){return function(_0x57eb46){if(!_0x57eb46){_0x20bfe8[_0x14e8('0x1a')](0x194);}return _0x57eb46;};}function handleError(_0x3fd96d,_0x3c09cb){_0x3c09cb=_0x3c09cb||0x1f4;return function(_0x2f5818){logger[_0x14e8('0x28')](_0x2f5818[_0x14e8('0x29')]);if(_0x2f5818[_0x14e8('0x2a')]){delete _0x2f5818['name'];}_0x3fd96d[_0x14e8('0x1c')](_0x3c09cb)[_0x14e8('0x2b')](_0x2f5818);};}exports[_0x14e8('0x2c')]=function(_0x5f5abb,_0x48eed0){var _0x5cacd7={},_0x8fe0e2={},_0x2a408d={'count':0x0,'rows':[]};var _0x567385=_[_0x14e8('0x2d')](db[_0x14e8('0x2e')][_0x14e8('0x2f')],function(_0xa83433){return{'name':_0xa83433['fieldName'],'type':_0xa83433[_0x14e8('0x30')][_0x14e8('0x31')]};});_0x8fe0e2[_0x14e8('0x32')]=_[_0x14e8('0x2d')](_0x567385,_0x14e8('0x2a'));_0x8fe0e2['query']=_[_0x14e8('0x33')](_0x5f5abb[_0x14e8('0x34')]);_0x8fe0e2[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x8fe0e2['model'],_0x8fe0e2[_0x14e8('0x34')]);_0x5cacd7['attributes']=_[_0x14e8('0x36')](_0x8fe0e2[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x37')]));_0x5cacd7[_0x14e8('0x38')]=_0x5cacd7[_0x14e8('0x38')][_0x14e8('0x39')]?_0x5cacd7[_0x14e8('0x38')]:_0x8fe0e2[_0x14e8('0x32')];if(!_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3a')]('nolimit')){_0x5cacd7['limit']=qs['limit'](_0x5f5abb[_0x14e8('0x34')]['limit']);_0x5cacd7[_0x14e8('0x1e')]=qs['offset'](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x1e')]);}_0x5cacd7[_0x14e8('0x3b')]=qs[_0x14e8('0x3c')](_0x5f5abb['query'][_0x14e8('0x3c')]);_0x5cacd7['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x5f5abb[_0x14e8('0x34')],_0x8fe0e2[_0x14e8('0x35')]),_0x567385);if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x5cacd7['where']=_[_0x14e8('0x3f')](_0x5cacd7['where'],{'$or':_[_0x14e8('0x2d')](_0x567385,function(_0x20f69d){if(_0x20f69d[_0x14e8('0x30')]!=='VIRTUAL'){var _0x27d51b={};_0x27d51b[_0x20f69d[_0x14e8('0x2a')]]={'$like':'%'+_0x5f5abb['query'][_0x14e8('0x3e')]+'%'};return _0x27d51b;}})});}_0x5cacd7=_[_0x14e8('0x3f')]({},_0x5cacd7,_0x5f5abb[_0x14e8('0x40')]);var _0x3a7aa7={'where':_0x5cacd7[_0x14e8('0x41')]};return db[_0x14e8('0x2e')][_0x14e8('0x21')](_0x3a7aa7)[_0x14e8('0x27')](function(_0x33743a){_0x2a408d[_0x14e8('0x21')]=_0x33743a;if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x42')]){_0x5cacd7[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2e')][_0x14e8('0x44')](_0x5cacd7);})['then'](function(_0x24c9e6){_0x2a408d['rows']=_0x24c9e6;return _0x2a408d;})['then'](respondWithFilteredResult(_0x48eed0,_0x5cacd7))['catch'](handleError(_0x48eed0,null));};exports[_0x14e8('0x45')]=function(_0x5ed821,_0x46a3c4){var _0x45bff0={'raw':![],'where':{'id':_0x5ed821[_0x14e8('0x46')]['id']}},_0x7907e8={};_0x7907e8[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x2e')][_0x14e8('0x2f')]);_0x7907e8[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x5ed821[_0x14e8('0x34')]);_0x7907e8['filters']=_[_0x14e8('0x36')](_0x7907e8[_0x14e8('0x32')],_0x7907e8[_0x14e8('0x34')]);_0x45bff0[_0x14e8('0x38')]=_['intersection'](_0x7907e8[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5ed821['query']['fields']));_0x45bff0[_0x14e8('0x38')]=_0x45bff0['attributes']['length']?_0x45bff0[_0x14e8('0x38')]:_0x7907e8[_0x14e8('0x32')];if(_0x5ed821['query'][_0x14e8('0x42')]){_0x45bff0[_0x14e8('0x43')]=[{'all':!![]}];}_0x45bff0=_['merge']({},_0x45bff0,_0x5ed821[_0x14e8('0x40')]);return db[_0x14e8('0x2e')][_0x14e8('0x47')](_0x45bff0)[_0x14e8('0x27')](handleEntityNotFound(_0x46a3c4,null))[_0x14e8('0x27')](respondWithResult(_0x46a3c4,null))[_0x14e8('0x48')](handleError(_0x46a3c4,null));};exports[_0x14e8('0x49')]=function(_0x2541ad,_0x146e2c){return db[_0x14e8('0x2e')][_0x14e8('0x49')](_0x2541ad[_0x14e8('0x4a')],{})[_0x14e8('0x27')](respondWithResult(_0x146e2c,0xc9))[_0x14e8('0x48')](handleError(_0x146e2c,null));};exports[_0x14e8('0x26')]=function(_0x1f50bc,_0x59820f){if(_0x1f50bc[_0x14e8('0x4a')]['id']){delete _0x1f50bc['body']['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x47')]({'where':{'id':_0x1f50bc[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x59820f,null))['then'](saveUpdates(_0x1f50bc['body'],null))['then'](respondWithResult(_0x59820f,null))[_0x14e8('0x48')](handleError(_0x59820f,null));};exports['destroy']=function(_0x55f9b0,_0xd2b281){return db[_0x14e8('0x2e')]['find']({'where':{'id':_0x55f9b0[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0xd2b281,null))[_0x14e8('0x27')](removeEntity(_0xd2b281,null))[_0x14e8('0x48')](handleError(_0xd2b281,null));};exports['getConfigurations']=function(_0x519c9c,_0x1cdcca,_0xc602b1){var _0x15464a={};var _0x3a09b7={};var _0x41b5ab;var _0x2fbac7;return db['ZendeskAccount'][_0x14e8('0x4b')]({'where':{'id':_0x519c9c[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x1cdcca,null))[_0x14e8('0x27')](function(_0x5e6083){if(_0x5e6083){_0x41b5ab=_0x5e6083;_0x3a09b7[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x4c')][_0x14e8('0x2f')]);_0x3a09b7['query']=_[_0x14e8('0x33')](_0x519c9c[_0x14e8('0x34')]);_0x3a09b7[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x3a09b7[_0x14e8('0x32')],_0x3a09b7[_0x14e8('0x34')]);_0x15464a[_0x14e8('0x38')]=_[_0x14e8('0x36')](_0x3a09b7['model'],qs['fields'](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x37')]));_0x15464a[_0x14e8('0x38')]=_0x15464a[_0x14e8('0x38')][_0x14e8('0x39')]?_0x15464a['attributes']:_0x3a09b7['model'];_0x15464a['order']=qs[_0x14e8('0x3c')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3c')]);_0x15464a['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x519c9c[_0x14e8('0x34')],_0x3a09b7['filters']));if(_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x15464a[_0x14e8('0x41')]=_[_0x14e8('0x3f')](_0x15464a[_0x14e8('0x41')],{'$or':_[_0x14e8('0x2d')](_0x15464a[_0x14e8('0x38')],function(_0x12a2b3){var _0x2da07b={};_0x2da07b[_0x12a2b3]={'$like':'%'+_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]+'%'};return _0x2da07b;})});}_0x15464a=_['merge']({},_0x15464a,_0x519c9c[_0x14e8('0x40')]);return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x38e79a){if(_0x38e79a){_0x2fbac7=_0x38e79a[_0x14e8('0x39')];if(!_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3a')](_0x14e8('0x4e'))){_0x15464a[_0x14e8('0x20')]=qs[_0x14e8('0x20')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x20')]);_0x15464a['offset']=qs[_0x14e8('0x1e')](_0x519c9c[_0x14e8('0x34')]['offset']);}return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x31e785){if(_0x31e785){return _0x31e785?{'count':_0x2fbac7,'rows':_0x31e785}:null;}})[_0x14e8('0x27')](respondWithResult(_0x1cdcca,null))[_0x14e8('0x48')](handleError(_0x1cdcca,null));};exports[_0x14e8('0x4f')]=function(_0x139405,_0x5b6e28,_0x4c30dd){if(_0x139405['body']['id']){delete _0x139405[_0x14e8('0x4a')]['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x4b')]({'where':{'id':_0x139405[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x5b6e28,null))[_0x14e8('0x27')](function(_0x402956){if(_0x402956){_0x139405['body'][_0x14e8('0x50')]=_0x402956['id'];_0x139405[_0x14e8('0x4a')]['Subjects']=integrations[_0x14e8('0x51')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405['body']['type']);_0x139405[_0x14e8('0x4a')][_0x14e8('0x52')]=integrations[_0x14e8('0x53')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405[_0x14e8('0x4a')][_0x14e8('0x30')]);return db[_0x14e8('0x4c')][_0x14e8('0x49')](_0x139405[_0x14e8('0x4a')],{'include':[{'model':db[_0x14e8('0x54')],'as':'Subjects'},{'model':db[_0x14e8('0x54')],'as':_0x14e8('0x52')}]});}return null;})[_0x14e8('0x27')](respondWithResult(_0x5b6e28,null))['catch'](handleError(_0x5b6e28,null));};exports['getFields']=function(_0x20a598,_0x53d0c8,_0x25f63c){var _0x5cbce8='';return db[_0x14e8('0x2e')]['findOne']({'where':{'id':_0x20a598[_0x14e8('0x46')]['id']},'attributes':['id',_0x14e8('0x55'),'password',_0x14e8('0x56'),_0x14e8('0x57'),_0x14e8('0x58')]})[_0x14e8('0x27')](handleEntityNotFound(_0x53d0c8,null))[_0x14e8('0x27')](function(_0x6dee32){if(_0x6dee32){_0x5cbce8=_0x6dee32[_0x14e8('0x58')];var _0x2ba695=_0x5cbce8[_0x14e8('0x59')](-0x1);if(_0x2ba695==='/'){_0x5cbce8=_0x5cbce8[_0x14e8('0x5a')](0x0,_0x5cbce8[_0x14e8('0x5b')](_0x2ba695));}var _0x2e0e7d={'method':_0x14e8('0x5c'),'uri':util['format']('%s/%s',_0x5cbce8,'ticket_fields'),'json':!![]};switch(_0x6dee32[_0x14e8('0x57')]){case _0x14e8('0x5d'):_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util['format']('%s:%s',_0x6dee32['username'],_0x6dee32[_0x14e8('0x5d')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;case'token':_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util[_0x14e8('0x62')](_0x14e8('0x63'),_0x6dee32[_0x14e8('0x55')],_0x6dee32[_0x14e8('0x56')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;default:throw new db[(_0x14e8('0x64'))][(_0x14e8('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x2e0e7d);}})[_0x14e8('0x27')](function(_0x4eb2ef){if(_0x4eb2ef){var _0x355395=[_0x14e8('0x66'),_0x14e8('0x67'),_0x14e8('0x68'),_0x14e8('0x69')];_[_0x14e8('0x6a')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x308617){return _0x355395[_0x14e8('0x6c')](_0x308617['type']);});return{'count':_0x4eb2ef[_0x14e8('0x6b')][_0x14e8('0x39')],'rows':_[_0x14e8('0x2d')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x492757){return{'id':_0x492757['id'],'name':_0x492757[_0x14e8('0x6d')]>0x7?_0x492757[_0x14e8('0x6e')]:_0x492757[_0x14e8('0x30')],'custom':_0x492757[_0x14e8('0x6d')]>0x7?!![]:![],'options':_0x492757['system_field_options']?_0x492757[_0x14e8('0x6f')]:_0x492757['custom_field_options']?_0x492757[_0x14e8('0x70')]:[]};})};}})['then'](respondWithResult(_0x53d0c8,null))['catch'](function(_0x3e820f){var _0xb68079=_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?0x1f4:_0x3e820f[_0x14e8('0x72')]||0x1f4;logger[_0x14e8('0x28')](_0x14e8('0x73'),_0x14e8('0x74'),_0xb68079,JSON[_0x14e8('0x75')](_0x3e820f));delete _0x3e820f[_0x14e8('0x2a')];if(_0xb68079===0x191){_0xb68079=0x190;}_0x53d0c8[_0x14e8('0x1c')](_0xb68079)['send'](_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?{'message':_0x14e8('0x76'),'statusCode':_0x3e820f['statusCode']}:_0x3e820f);});}; \ No newline at end of file +var _0xb10b=['sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','Basic\x20%s','%s:%s','password','headers','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','ZendeskAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x58c870,_0x222fc1){var _0x31e782=function(_0x4412ed){while(--_0x4412ed){_0x58c870['push'](_0x58c870['shift']());}};_0x31e782(++_0x222fc1);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f0811,_0x589ce){_0x2f0811=_0x2f0811-0x0;var _0x18ff83=_0xb10b[_0x2f0811];return _0x18ff83;};'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'];var integrations=require(_0xbb10('0x18'));function respondWithStatusCode(_0x285009,_0x193a27){_0x193a27=_0x193a27||0xcc;return function(_0x442548){if(_0x442548){return _0x285009[_0xbb10('0x19')](_0x193a27);}return _0x285009['status'](_0x193a27)[_0xbb10('0x1a')]();};}function respondWithResult(_0x42d7e4,_0x45b9d6){_0x45b9d6=_0x45b9d6||0xc8;return function(_0x17fd46){if(_0x17fd46){return _0x42d7e4[_0xbb10('0x1b')](_0x45b9d6)[_0xbb10('0x1c')](_0x17fd46);}};}function respondWithFilteredResult(_0x24a57b,_0x36b5e8){return function(_0x3e26f4){if(_0x3e26f4){var _0x2b184e=typeof _0x36b5e8['offset']===_0xbb10('0x1d')&&typeof _0x36b5e8[_0xbb10('0x1e')]===_0xbb10('0x1d');var _0x42db98=_0x3e26f4[_0xbb10('0x1f')];var _0x1682a4=_0x2b184e?0x0:_0x36b5e8[_0xbb10('0x20')];var _0x30efc6=_0x2b184e?_0x3e26f4[_0xbb10('0x1f')]:_0x36b5e8[_0xbb10('0x20')]+_0x36b5e8['limit'];var _0x5ff0cf;if(_0x30efc6>=_0x42db98){_0x30efc6=_0x42db98;_0x5ff0cf=0xc8;}else{_0x5ff0cf=0xce;}_0x24a57b[_0xbb10('0x1b')](_0x5ff0cf);return _0x24a57b[_0xbb10('0x21')](_0xbb10('0x22'),_0x1682a4+'-'+_0x30efc6+'/'+_0x42db98)[_0xbb10('0x1c')](_0x3e26f4);}return null;};}function patchUpdates(_0x44e563){return function(_0x4deb49){try{jsonpatch[_0xbb10('0x23')](_0x4deb49,_0x44e563,!![]);}catch(_0x12ef77){return BPromise['reject'](_0x12ef77);}return _0x4deb49['save']();};}function saveUpdates(_0x8e2b97,_0x311abe){return function(_0x2e911d){if(_0x2e911d){return _0x2e911d[_0xbb10('0x24')](_0x8e2b97)[_0xbb10('0x25')](function(_0x1824b7){return _0x1824b7;});}return null;};}function removeEntity(_0x407cb4,_0x436104){return function(_0x7f2377){if(_0x7f2377){return _0x7f2377[_0xbb10('0x26')]()[_0xbb10('0x25')](function(){_0x407cb4[_0xbb10('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x19')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x27')](_0x2fdde9[_0xbb10('0x28')]);if(_0x2fdde9[_0xbb10('0x29')]){delete _0x2fdde9[_0xbb10('0x29')];}_0x2c89b9[_0xbb10('0x1b')](_0x4e25ff)[_0xbb10('0x2a')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2b')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2c')][_0xbb10('0x2d')]};});_0x2e0249[_0xbb10('0x2e')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x2e0249[_0xbb10('0x2e')],_0x2e0249[_0xbb10('0x2f')]);_0xfc3595[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x2e0249[_0xbb10('0x2e')],qs['fields'](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x34')]));_0xfc3595[_0xbb10('0x33')]=_0xfc3595[_0xbb10('0x33')][_0xbb10('0x35')]?_0xfc3595[_0xbb10('0x33')]:_0x2e0249[_0xbb10('0x2e')];if(!_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x36')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x20')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x38')]);_0xfc3595[_0xbb10('0x39')]=qs[_0xbb10('0x31')](_['pick'](_0x3796c7[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x31')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3a')](_0xfc3595[_0xbb10('0x39')],{'$or':_[_0xbb10('0x3b')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2c')]!==_0xbb10('0x3c')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x3d')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3a')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3e')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x39')]};return db[_0xbb10('0x2b')]['count'](_0x4f1cdd)[_0xbb10('0x25')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1f')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x2f')][_0xbb10('0x3f')]){_0xfc3595[_0xbb10('0x40')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xbb10('0x41')](_0xfc3595);})[_0xbb10('0x25')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x42')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x43')](handleError(_0x21ac54,null));};exports[_0xbb10('0x44')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x45')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2b')]['rawAttributes']);_0x351484[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x23dc18['query']);_0x351484[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x351484[_0xbb10('0x2e')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x351484[_0xbb10('0x2e')],qs[_0xbb10('0x34')](_0x23dc18[_0xbb10('0x2f')][_0xbb10('0x34')]));_0x5e2cfa[_0xbb10('0x33')]=_0x5e2cfa[_0xbb10('0x33')][_0xbb10('0x35')]?_0x5e2cfa[_0xbb10('0x33')]:_0x351484[_0xbb10('0x2e')];if(_0x23dc18[_0xbb10('0x2f')]['includeAll']){_0x5e2cfa[_0xbb10('0x40')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3a')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2b')][_0xbb10('0x46')](_0x5e2cfa)[_0xbb10('0x25')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x25')](respondWithResult(_0x403beb,null))[_0xbb10('0x43')](handleError(_0x403beb,null));};exports[_0xbb10('0x47')]=function(_0x3e06b0,_0x5be85e){return db['ZendeskAccount'][_0xbb10('0x47')](_0x3e06b0[_0xbb10('0x48')],{})[_0xbb10('0x25')](respondWithResult(_0x5be85e,0xc9))['catch'](handleError(_0x5be85e,null));};exports['update']=function(_0x3cd6f3,_0x34cf4e){if(_0x3cd6f3[_0xbb10('0x48')]['id']){delete _0x3cd6f3[_0xbb10('0x48')]['id'];}return db[_0xbb10('0x2b')][_0xbb10('0x46')]({'where':{'id':_0x3cd6f3[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x34cf4e,null))[_0xbb10('0x25')](saveUpdates(_0x3cd6f3[_0xbb10('0x48')],null))['then'](respondWithResult(_0x34cf4e,null))['catch'](handleError(_0x34cf4e,null));};exports[_0xbb10('0x26')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x2b')][_0xbb10('0x46')]({'where':{'id':_0x467dba[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x36ab7d,null))[_0xbb10('0x25')](removeEntity(_0x36ab7d,null))[_0xbb10('0x43')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x49')]=function(_0x19ca3e,_0x20e18a,_0x61e689){var _0x2e6fd9={};var _0x1d15f4={};var _0x547a7a;var _0x124052;return db['ZendeskAccount'][_0xbb10('0x4a')]({'where':{'id':_0x19ca3e[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x20e18a,null))[_0xbb10('0x25')](function(_0x26e66e){if(_0x26e66e){_0x547a7a=_0x26e66e;_0x1d15f4[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x4b')][_0xbb10('0x4c')]);_0x1d15f4[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x19ca3e[_0xbb10('0x2f')]);_0x1d15f4[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x1d15f4[_0xbb10('0x2e')],_0x1d15f4['query']);_0x2e6fd9[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x1d15f4[_0xbb10('0x2e')],qs[_0xbb10('0x34')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x34')]));_0x2e6fd9['attributes']=_0x2e6fd9[_0xbb10('0x33')][_0xbb10('0x35')]?_0x2e6fd9[_0xbb10('0x33')]:_0x1d15f4[_0xbb10('0x2e')];_0x2e6fd9[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x38')]);_0x2e6fd9[_0xbb10('0x39')]=qs[_0xbb10('0x31')](_[_0xbb10('0x4d')](_0x19ca3e[_0xbb10('0x2f')],_0x1d15f4[_0xbb10('0x31')]));if(_0x19ca3e['query']['filter']){_0x2e6fd9[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x2e6fd9[_0xbb10('0x39')],{'$or':_[_0xbb10('0x3b')](_0x2e6fd9['attributes'],function(_0x506498){var _0x79411e={};_0x79411e[_0x506498]={'$like':'%'+_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x3d')]+'%'};return _0x79411e;})});}_0x2e6fd9=_[_0xbb10('0x3a')]({},_0x2e6fd9,_0x19ca3e[_0xbb10('0x3e')]);return _0x547a7a[_0xbb10('0x49')](_0x2e6fd9);}})[_0xbb10('0x25')](function(_0x4a5fb9){if(_0x4a5fb9){_0x124052=_0x4a5fb9[_0xbb10('0x35')];if(!_0x19ca3e[_0xbb10('0x2f')]['hasOwnProperty']('nolimit')){_0x2e6fd9['limit']=qs[_0xbb10('0x1e')](_0x19ca3e[_0xbb10('0x2f')][_0xbb10('0x1e')]);_0x2e6fd9['offset']=qs['offset'](_0x19ca3e['query'][_0xbb10('0x20')]);}return _0x547a7a[_0xbb10('0x49')](_0x2e6fd9);}})[_0xbb10('0x25')](function(_0x4e9fbd){if(_0x4e9fbd){return _0x4e9fbd?{'count':_0x124052,'rows':_0x4e9fbd}:null;}})[_0xbb10('0x25')](respondWithResult(_0x20e18a,null))[_0xbb10('0x43')](handleError(_0x20e18a,null));};exports['addConfiguration']=function(_0x4a560c,_0x27d7b9,_0x308896){if(_0x4a560c[_0xbb10('0x48')]['id']){delete _0x4a560c[_0xbb10('0x48')]['id'];}return db['ZendeskAccount'][_0xbb10('0x4a')]({'where':{'id':_0x4a560c[_0xbb10('0x45')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x27d7b9,null))['then'](function(_0x402a01){if(_0x402a01){_0x4a560c[_0xbb10('0x48')][_0xbb10('0x4e')]=_0x402a01['id'];_0x4a560c['body'][_0xbb10('0x4f')]=integrations[_0xbb10('0x50')](_0x4a560c[_0xbb10('0x48')][_0xbb10('0x51')],_0x4a560c['body'][_0xbb10('0x2c')]);_0x4a560c[_0xbb10('0x48')][_0xbb10('0x52')]=integrations[_0xbb10('0x53')](_0x4a560c['body'][_0xbb10('0x51')],_0x4a560c[_0xbb10('0x48')][_0xbb10('0x2c')]);return db[_0xbb10('0x4b')][_0xbb10('0x47')](_0x4a560c[_0xbb10('0x48')],{'include':[{'model':db[_0xbb10('0x54')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xbb10('0x25')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x43')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x55')]=function(_0x5c9afc,_0x5cd089,_0x46f462){var _0x1b11c0='';return db[_0xbb10('0x2b')][_0xbb10('0x4a')]({'where':{'id':_0x5c9afc[_0xbb10('0x45')]['id']},'attributes':['id',_0xbb10('0x56'),'password',_0xbb10('0x57'),_0xbb10('0x58'),_0xbb10('0x59')]})[_0xbb10('0x25')](handleEntityNotFound(_0x5cd089,null))[_0xbb10('0x25')](function(_0x5bfc68){if(_0x5bfc68){_0x1b11c0=_0x5bfc68['remoteUri'];var _0x5ad6ad=_0x1b11c0[_0xbb10('0x5a')](-0x1);if(_0x5ad6ad==='/'){_0x1b11c0=_0x1b11c0[_0xbb10('0x5b')](0x0,_0x1b11c0[_0xbb10('0x5c')](_0x5ad6ad));}var _0x21459e={'method':_0xbb10('0x5d'),'uri':util[_0xbb10('0x5e')]('%s/%s',_0x1b11c0,_0xbb10('0x5f')),'json':!![]};switch(_0x5bfc68['authType']){case'password':_0x21459e['headers']={'Authorization':util[_0xbb10('0x5e')](_0xbb10('0x60'),new Buffer(util[_0xbb10('0x5e')](_0xbb10('0x61'),_0x5bfc68['username'],_0x5bfc68[_0xbb10('0x62')]))['toString']('base64'))};break;case _0xbb10('0x57'):_0x21459e[_0xbb10('0x63')]={'Authorization':util[_0xbb10('0x5e')](_0xbb10('0x60'),new Buffer(util[_0xbb10('0x5e')]('%s/token:%s',_0x5bfc68[_0xbb10('0x56')],_0x5bfc68[_0xbb10('0x57')]))[_0xbb10('0x64')](_0xbb10('0x65')))};break;default:throw new db[(_0xbb10('0x66'))][(_0xbb10('0x67'))](_0xbb10('0x68'));}return rp(_0x21459e);}})['then'](function(_0x387b10){if(_0x387b10){var _0x1f648a=[_0xbb10('0x69'),_0xbb10('0x6a'),_0xbb10('0x6b'),_0xbb10('0x6c')];_[_0xbb10('0x6d')](_0x387b10[_0xbb10('0x5f')],function(_0x5a4429){return _0x1f648a[_0xbb10('0x6e')](_0x5a4429[_0xbb10('0x2c')]);});return{'count':_0x387b10[_0xbb10('0x5f')]['length'],'rows':_['map'](_0x387b10['ticket_fields'],function(_0x23286d){return{'id':_0x23286d['id'],'name':_0x23286d['position']>0x7?_0x23286d['title']:_0x23286d[_0xbb10('0x2c')],'custom':_0x23286d[_0xbb10('0x6f')]>0x7?!![]:![],'options':_0x23286d[_0xbb10('0x70')]?_0x23286d[_0xbb10('0x70')]:_0x23286d[_0xbb10('0x71')]?_0x23286d[_0xbb10('0x71')]:[]};})};}})[_0xbb10('0x25')](respondWithResult(_0x5cd089,null))[_0xbb10('0x43')](function(_0x188b97){var _0x5206e1=_0x5c9afc[_0xbb10('0x2f')][_0xbb10('0x72')]?0x1f4:_0x188b97[_0xbb10('0x73')]||0x1f4;logger[_0xbb10('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5206e1,JSON[_0xbb10('0x74')](_0x188b97));delete _0x188b97[_0xbb10('0x29')];if(_0x5206e1===0x191){_0x5206e1=0x190;}_0x5cd089[_0xbb10('0x1b')](_0x5206e1)[_0xbb10('0x2a')](_0x5c9afc['query'][_0xbb10('0x72')]?{'message':_0xbb10('0x75'),'statusCode':_0x188b97[_0xbb10('0x73')]}:_0x188b97);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0077ec2..a746864 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 _0xab16=['ZendeskAccount','int_zendesk_accounts','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab16,0xde));var _0x6ab1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xab16[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x6ab1('0x0'));var util=require(_0x6ab1('0x1'));var logger=require('../../config/logger')(_0x6ab1('0x2'));var moment=require('moment');var BPromise=require(_0x6ab1('0x3'));var rp=require(_0x6ab1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ab1('0x5'));var config=require(_0x6ab1('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x6ab1('0x7'));module['exports']=function(_0x34b8c5,_0x301d5a){return _0x34b8c5[_0x6ab1('0x8')](_0x6ab1('0x9'),attributes,{'tableName':_0x6ab1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36e5=['ZendeskAccount','int_zendesk_accounts','lodash','moment','bluebird','path','../../components/integrations/configuration','exports','define'];(function(_0x21c56f,_0x3ed56c){var _0x2387bb=function(_0x29845d){while(--_0x29845d){_0x21c56f['push'](_0x21c56f['shift']());}};_0x2387bb(++_0x3ed56c);}(_0x36e5,0x1a0));var _0x536e=function(_0xdd9a5f,_0x3ced93){_0xdd9a5f=_0xdd9a5f-0x0;var _0x3464b7=_0x36e5[_0xdd9a5f];return _0x3464b7;};'use strict';var _=require(_0x536e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x536e('0x1'));var BPromise=require(_0x536e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x536e('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x536e('0x4'));module[_0x536e('0x5')]=function(_0x2b0984,_0x17f636){return _0x2b0984[_0x536e('0x6')](_0x536e('0x7'),attributes,{'tableName':_0x536e('0x8'),'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 cee4bbf..ec3d2c7 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 _0x43b0=['error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','include','map','model','attributes','ShowZendeskAccount','where','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20025c,_0x4c4d14){var _0x1857c3=function(_0x5526a1){while(--_0x5526a1){_0x20025c['push'](_0x20025c['shift']());}};_0x1857c3(++_0x4c4d14);}(_0x43b0,0x19c));var _0x043b=function(_0x4e069f,_0x107364){_0x4e069f=_0x4e069f-0x0;var _0x2c6a2b=_0x43b0[_0x4e069f];return _0x2c6a2b;};'use strict';var _=require(_0x043b('0x0'));var util=require(_0x043b('0x1'));var moment=require('moment');var BPromise=require(_0x043b('0x2'));var rs=require(_0x043b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x043b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x043b('0x5'));var jayson=require(_0x043b('0x6'));var client=jayson[_0x043b('0x7')][_0x043b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fd096,_0x1ca8c6,_0x2600c6){return new BPromise(function(_0x56e0bd,_0x4a6453){return client[_0x043b('0x9')](_0x1fd096,_0x2600c6)[_0x043b('0xa')](function(_0x4c7c8f){logger[_0x043b('0xb')](_0x043b('0xc'),_0x1ca8c6,_0x043b('0xd'));logger[_0x043b('0xe')](_0x043b('0xf'),_0x1ca8c6,_0x043b('0xd'),JSON[_0x043b('0x10')](_0x4c7c8f));if(_0x4c7c8f[_0x043b('0x11')]){if(_0x4c7c8f['error'][_0x043b('0x12')]===0x1f4){logger[_0x043b('0x11')](_0x043b('0xc'),_0x1ca8c6,_0x4c7c8f[_0x043b('0x11')][_0x043b('0x13')]);return _0x4a6453(_0x4c7c8f[_0x043b('0x11')][_0x043b('0x13')]);}logger[_0x043b('0x11')](_0x043b('0xc'),_0x1ca8c6,_0x4c7c8f[_0x043b('0x11')][_0x043b('0x13')]);return _0x56e0bd(_0x4c7c8f[_0x043b('0x11')]['message']);}else{logger[_0x043b('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x1ca8c6,'request\x20sent');_0x56e0bd(_0x4c7c8f[_0x043b('0x14')]['message']);}})[_0x043b('0x15')](function(_0x327ce7){logger['error'](_0x043b('0xc'),_0x1ca8c6,_0x327ce7);_0x4a6453(_0x327ce7);});});}exports[_0x043b('0x16')]=function(_0x7f6359){var _0xf54da8=this;return new Promise(function(_0x31cbce,_0x38bdfd){return db[_0x043b('0x17')][_0x043b('0x18')]({'raw':_0x7f6359[_0x043b('0x19')]?_0x7f6359[_0x043b('0x19')][_0x043b('0x1a')]===undefined?!![]:![]:!![],'where':_0x7f6359[_0x043b('0x19')]?_0x7f6359[_0x043b('0x19')]['where']||null:null,'attributes':_0x7f6359[_0x043b('0x19')]?_0x7f6359[_0x043b('0x19')]['attributes']||null:null,'limit':_0x7f6359['options']?_0x7f6359[_0x043b('0x19')]['limit']||null:null,'include':_0x7f6359[_0x043b('0x19')]?_0x7f6359[_0x043b('0x19')][_0x043b('0x1b')]?_[_0x043b('0x1c')](_0x7f6359[_0x043b('0x19')][_0x043b('0x1b')],function(_0x3406c4){return{'model':db[_0x3406c4[_0x043b('0x1d')]],'as':_0x3406c4['as'],'attributes':_0x3406c4[_0x043b('0x1e')],'include':_0x3406c4[_0x043b('0x1b')]?_[_0x043b('0x1c')](_0x3406c4['include'],function(_0x477ef9){return{'model':db[_0x477ef9[_0x043b('0x1d')]],'as':_0x477ef9['as'],'attributes':_0x477ef9[_0x043b('0x1e')],'include':_0x477ef9[_0x043b('0x1b')]?_[_0x043b('0x1c')](_0x477ef9['include'],function(_0x1d289d){return{'model':db[_0x1d289d[_0x043b('0x1d')]],'as':_0x1d289d['as'],'attributes':_0x1d289d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ed35b){logger[_0x043b('0xb')](_0x043b('0x16'),_0x7f6359);logger[_0x043b('0xe')](_0x043b('0x16'),_0x7f6359,JSON['stringify'](_0x2ed35b));_0x31cbce(_0x2ed35b);})['catch'](function(_0x2271b4){logger[_0x043b('0x11')](_0x043b('0x16'),_0x2271b4['message'],_0x7f6359);_0x38bdfd(_0xf54da8[_0x043b('0x11')](0x1f4,_0x2271b4[_0x043b('0x13')]));});});};exports[_0x043b('0x1f')]=function(_0x118d77){var _0x4a09bd=this;return new Promise(function(_0x2bca8b,_0x9394d1){return db['ZendeskAccount']['find']({'raw':_0x118d77[_0x043b('0x19')]?_0x118d77[_0x043b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x118d77[_0x043b('0x19')]?_0x118d77['options'][_0x043b('0x20')]||null:null,'attributes':_0x118d77[_0x043b('0x19')]?_0x118d77[_0x043b('0x19')][_0x043b('0x1e')]||null:null,'include':_0x118d77[_0x043b('0x19')]?_0x118d77[_0x043b('0x19')]['include']?_[_0x043b('0x1c')](_0x118d77[_0x043b('0x19')][_0x043b('0x1b')],function(_0x19da94){return{'model':db[_0x19da94[_0x043b('0x1d')]],'as':_0x19da94['as'],'attributes':_0x19da94['attributes'],'include':_0x19da94[_0x043b('0x1b')]?_['map'](_0x19da94[_0x043b('0x1b')],function(_0x54f31c){return{'model':db[_0x54f31c[_0x043b('0x1d')]],'as':_0x54f31c['as'],'attributes':_0x54f31c['attributes'],'include':_0x54f31c[_0x043b('0x1b')]?_[_0x043b('0x1c')](_0x54f31c[_0x043b('0x1b')],function(_0x2aab7a){return{'model':db[_0x2aab7a[_0x043b('0x1d')]],'as':_0x2aab7a['as'],'attributes':_0x2aab7a[_0x043b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fe1e5){logger['info']('ShowZendeskAccount',_0x118d77);logger[_0x043b('0xe')]('ShowZendeskAccount',_0x118d77,JSON[_0x043b('0x10')](_0x2fe1e5));_0x2bca8b(_0x2fe1e5);})['catch'](function(_0x38b1bf){logger[_0x043b('0x11')]('ShowZendeskAccount',_0x38b1bf[_0x043b('0x13')],_0x118d77);_0x9394d1(_0x4a09bd[_0x043b('0x11')](0x1f4,_0x38b1bf[_0x043b('0x13')]));});});}; \ No newline at end of file +var _0x482d=['find','raw','then','ShowZendeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x515df1,_0x4fa6cb){var _0x11093=function(_0xc56294){while(--_0xc56294){_0x515df1['push'](_0x515df1['shift']());}};_0x11093(++_0x4fa6cb);}(_0x482d,0x16c));var _0xd482=function(_0x5eb52d,_0x3b6781){_0x5eb52d=_0x5eb52d-0x0;var _0x33d36e=_0x482d[_0x5eb52d];return _0x33d36e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd482('0x0'));var BPromise=require(_0xd482('0x1'));var rs=require(_0xd482('0x2'));var fs=require('fs');var Redis=require(_0xd482('0x3'));var db=require(_0xd482('0x4'))['db'];var utils=require(_0xd482('0x5'));var logger=require('../../config/logger')(_0xd482('0x6'));var config=require(_0xd482('0x7'));var jayson=require(_0xd482('0x8'));var client=jayson['client'][_0xd482('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d6b47,_0x5bfc0f,_0x478af5){return new BPromise(function(_0x144d7d,_0x74f369){return client[_0xd482('0xa')](_0x5d6b47,_0x478af5)['then'](function(_0x144d5b){logger[_0xd482('0xb')](_0xd482('0xc'),_0x5bfc0f,_0xd482('0xd'));logger[_0xd482('0xe')](_0xd482('0xf'),_0x5bfc0f,_0xd482('0xd'),JSON[_0xd482('0x10')](_0x144d5b));if(_0x144d5b['error']){if(_0x144d5b[_0xd482('0x11')][_0xd482('0x12')]===0x1f4){logger[_0xd482('0x11')](_0xd482('0xc'),_0x5bfc0f,_0x144d5b['error'][_0xd482('0x13')]);return _0x74f369(_0x144d5b[_0xd482('0x11')][_0xd482('0x13')]);}logger['error'](_0xd482('0xc'),_0x5bfc0f,_0x144d5b['error']['message']);return _0x144d7d(_0x144d5b[_0xd482('0x11')]['message']);}else{logger[_0xd482('0xb')](_0xd482('0xc'),_0x5bfc0f,'request\x20sent');_0x144d7d(_0x144d5b[_0xd482('0x14')][_0xd482('0x13')]);}})[_0xd482('0x15')](function(_0x2cc6e1){logger[_0xd482('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5bfc0f,_0x2cc6e1);_0x74f369(_0x2cc6e1);});});}exports[_0xd482('0x16')]=function(_0x1816b7){var _0x3914b8=this;return new Promise(function(_0x5dbc03,_0x37b278){return db[_0xd482('0x17')][_0xd482('0x18')]({'raw':_0x1816b7[_0xd482('0x19')]?_0x1816b7[_0xd482('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1816b7['options']?_0x1816b7['options'][_0xd482('0x1a')]||null:null,'attributes':_0x1816b7[_0xd482('0x19')]?_0x1816b7[_0xd482('0x19')]['attributes']||null:null,'limit':_0x1816b7[_0xd482('0x19')]?_0x1816b7[_0xd482('0x19')][_0xd482('0x1b')]||null:null,'include':_0x1816b7[_0xd482('0x19')]?_0x1816b7[_0xd482('0x19')][_0xd482('0x1c')]?_[_0xd482('0x1d')](_0x1816b7[_0xd482('0x19')]['include'],function(_0x3a6bba){return{'model':db[_0x3a6bba[_0xd482('0x1e')]],'as':_0x3a6bba['as'],'attributes':_0x3a6bba[_0xd482('0x1f')],'include':_0x3a6bba[_0xd482('0x1c')]?_[_0xd482('0x1d')](_0x3a6bba[_0xd482('0x1c')],function(_0x1e68c2){return{'model':db[_0x1e68c2[_0xd482('0x1e')]],'as':_0x1e68c2['as'],'attributes':_0x1e68c2['attributes'],'include':_0x1e68c2['include']?_[_0xd482('0x1d')](_0x1e68c2['include'],function(_0x111ebd){return{'model':db[_0x111ebd['model']],'as':_0x111ebd['as'],'attributes':_0x111ebd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11ca6d){logger[_0xd482('0xb')](_0xd482('0x16'),_0x1816b7);logger[_0xd482('0xe')](_0xd482('0x16'),_0x1816b7,JSON[_0xd482('0x10')](_0x11ca6d));_0x5dbc03(_0x11ca6d);})[_0xd482('0x15')](function(_0x53a958){logger['error'](_0xd482('0x16'),_0x53a958[_0xd482('0x13')],_0x1816b7);_0x37b278(_0x3914b8[_0xd482('0x11')](0x1f4,_0x53a958[_0xd482('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x43f952){var _0x39f753=this;return new Promise(function(_0x203869,_0x4eb4ad){return db[_0xd482('0x17')][_0xd482('0x20')]({'raw':_0x43f952[_0xd482('0x19')]?_0x43f952['options'][_0xd482('0x21')]===undefined?!![]:![]:!![],'where':_0x43f952['options']?_0x43f952[_0xd482('0x19')][_0xd482('0x1a')]||null:null,'attributes':_0x43f952[_0xd482('0x19')]?_0x43f952[_0xd482('0x19')]['attributes']||null:null,'include':_0x43f952[_0xd482('0x19')]?_0x43f952[_0xd482('0x19')]['include']?_[_0xd482('0x1d')](_0x43f952['options'][_0xd482('0x1c')],function(_0x48cf16){return{'model':db[_0x48cf16['model']],'as':_0x48cf16['as'],'attributes':_0x48cf16['attributes'],'include':_0x48cf16[_0xd482('0x1c')]?_['map'](_0x48cf16[_0xd482('0x1c')],function(_0x11bab1){return{'model':db[_0x11bab1[_0xd482('0x1e')]],'as':_0x11bab1['as'],'attributes':_0x11bab1[_0xd482('0x1f')],'include':_0x11bab1[_0xd482('0x1c')]?_['map'](_0x11bab1[_0xd482('0x1c')],function(_0x38ccf3){return{'model':db[_0x38ccf3[_0xd482('0x1e')]],'as':_0x38ccf3['as'],'attributes':_0x38ccf3[_0xd482('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd482('0x22')](function(_0x2566a9){logger[_0xd482('0xb')](_0xd482('0x23'),_0x43f952);logger['debug']('ShowZendeskAccount',_0x43f952,JSON[_0xd482('0x10')](_0x2566a9));_0x203869(_0x2566a9);})[_0xd482('0x15')](function(_0x3d4440){logger['error']('ShowZendeskAccount',_0x3d4440[_0xd482('0x13')],_0x43f952);_0x4eb4ad(_0x39f753[_0xd482('0x11')](0x1f4,_0x3d4440['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 4563056..b6d0f5b 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 _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xd8a16a,_0x146ac1){var _0x4e5768=function(_0x36898c){while(--_0x36898c){_0xd8a16a['push'](_0xd8a16a['shift']());}};_0x4e5768(++_0x146ac1);}(_0xea28,0x13a));var _0x8ea2=function(_0xb877df,_0x160cec){_0xb877df=_0xb877df-0x0;var _0x55ead1=_0xea28[_0xb877df];return _0x55ead1;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file +var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x4dbfef,_0x2b6b0a){var _0x45da43=function(_0x36a6e5){while(--_0x36a6e5){_0x4dbfef['push'](_0x4dbfef['shift']());}};_0x45da43(++_0x2b6b0a);}(_0x4fc2,0x111));var _0x24fc=function(_0x447a04,_0xf69663){_0x447a04=_0x447a04-0x0;var _0x42483b=_0x4fc2[_0x447a04];return _0x42483b;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index fb1bcbb..660058e 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 _0x18ee=['sequelize','STRING'];(function(_0x2510c3,_0x49e43c){var _0x3c296a=function(_0x5e98e5){while(--_0x5e98e5){_0x2510c3['push'](_0x2510c3['shift']());}};_0x3c296a(++_0x49e43c);}(_0x18ee,0x196));var _0xe18e=function(_0xc2d893,_0x2503e6){_0xc2d893=_0xc2d893-0x0;var _0x2f37ad=_0x18ee[_0xc2d893];return _0x2f37ad;};'use strict';var Sequelize=require(_0xe18e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe18e('0x1')]}}; \ No newline at end of file +var _0x83df=['sequelize','exports','STRING'];(function(_0x42febf,_0x259b31){var _0x29b5d4=function(_0x517e44){while(--_0x517e44){_0x42febf['push'](_0x42febf['shift']());}};_0x29b5d4(++_0x259b31);}(_0x83df,0x171));var _0xf83d=function(_0x487cbd,_0x342d12){_0x487cbd=_0x487cbd-0x0;var _0x5021f6=_0x83df[_0x487cbd];return _0x5021f6;};'use strict';var Sequelize=require(_0xf83d('0x0'));module[_0xf83d('0x1')]={'name':{'type':Sequelize[_0xf83d('0x2')]},'description':{'type':Sequelize[_0xf83d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f805c78..0ee5758 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 _0x3448=['util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','filter','merge','type','VIRTUAL','ZendeskConfiguration','includeAll','include','rows','catch','params','length','options','find','create','body','findOne','ZendeskField','rawAttributes','pick','hasOwnProperty','nolimit','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2a354d,_0x3f01fd){var _0x445e03=function(_0x1abe74){while(--_0x1abe74){_0x2a354d['push'](_0x2a354d['shift']());}};_0x445e03(++_0x3f01fd);}(_0x3448,0xf9));var _0x8344=function(_0x39fffd,_0x4cfcb9){_0x39fffd=_0x39fffd-0x0;var _0x3a4c31=_0x3448[_0x39fffd];return _0x3a4c31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8344('0x0'));var zipdir=require(_0x8344('0x1'));var jsonpatch=require(_0x8344('0x2'));var rp=require('request-promise');var moment=require(_0x8344('0x3'));var BPromise=require(_0x8344('0x4'));var Mustache=require(_0x8344('0x5'));var util=require(_0x8344('0x6'));var path=require('path');var sox=require(_0x8344('0x7'));var csv=require(_0x8344('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8344('0x9'));var squel=require(_0x8344('0xa'));var crypto=require(_0x8344('0xb'));var jsforce=require(_0x8344('0xc'));var deskjs=require(_0x8344('0xd'));var toCsv=require(_0x8344('0x8'));var querystring=require(_0x8344('0xe'));var Papa=require('papaparse');var Redis=require(_0x8344('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8344('0x10'));var as=require(_0x8344('0x11'));var hardwareService=require(_0x8344('0x12'));var logger=require(_0x8344('0x13'))(_0x8344('0x14'));var utils=require('../../config/utils');var config=require(_0x8344('0x15'));var licenseUtil=require(_0x8344('0x16'));var db=require(_0x8344('0x17'))['db'];function respondWithStatusCode(_0xffcba,_0x2a49dd){_0x2a49dd=_0x2a49dd||0xcc;return function(_0x2602c8){if(_0x2602c8){return _0xffcba[_0x8344('0x18')](_0x2a49dd);}return _0xffcba[_0x8344('0x19')](_0x2a49dd)[_0x8344('0x1a')]();};}function respondWithResult(_0x970ef6,_0x582ea7){_0x582ea7=_0x582ea7||0xc8;return function(_0x2885ef){if(_0x2885ef){return _0x970ef6[_0x8344('0x19')](_0x582ea7)[_0x8344('0x1b')](_0x2885ef);}};}function respondWithFilteredResult(_0xfe7713,_0x32666d){return function(_0x3befb8){if(_0x3befb8){var _0x75abf8=typeof _0x32666d[_0x8344('0x1c')]===_0x8344('0x1d')&&typeof _0x32666d[_0x8344('0x1e')]===_0x8344('0x1d');var _0x59651a=_0x3befb8['count'];var _0x12b8ad=_0x75abf8?0x0:_0x32666d[_0x8344('0x1c')];var _0x4933c9=_0x75abf8?_0x3befb8[_0x8344('0x1f')]:_0x32666d[_0x8344('0x1c')]+_0x32666d[_0x8344('0x1e')];var _0x1a14a5;if(_0x4933c9>=_0x59651a){_0x4933c9=_0x59651a;_0x1a14a5=0xc8;}else{_0x1a14a5=0xce;}_0xfe7713[_0x8344('0x19')](_0x1a14a5);return _0xfe7713[_0x8344('0x20')](_0x8344('0x21'),_0x12b8ad+'-'+_0x4933c9+'/'+_0x59651a)[_0x8344('0x1b')](_0x3befb8);}return null;};}function patchUpdates(_0x127c93){return function(_0x1f331b){try{jsonpatch[_0x8344('0x22')](_0x1f331b,_0x127c93,!![]);}catch(_0x14a931){return BPromise[_0x8344('0x23')](_0x14a931);}return _0x1f331b[_0x8344('0x24')]();};}function saveUpdates(_0x3001bd,_0xaf7a9c){return function(_0x1de27c){if(_0x1de27c){return _0x1de27c[_0x8344('0x25')](_0x3001bd)['then'](function(_0xdee54c){return _0xdee54c;});}return null;};}function removeEntity(_0x16ea6d,_0x43bf97){return function(_0x36785d){if(_0x36785d){return _0x36785d[_0x8344('0x26')]()[_0x8344('0x27')](function(){_0x16ea6d[_0x8344('0x19')](0xcc)[_0x8344('0x1a')]();});}};}function handleEntityNotFound(_0x57c690,_0x3575e7){return function(_0x2a0e82){if(!_0x2a0e82){_0x57c690['sendStatus'](0x194);}return _0x2a0e82;};}function handleError(_0x3f536e,_0x1a354d){_0x1a354d=_0x1a354d||0x1f4;return function(_0x43ff78){logger[_0x8344('0x28')](_0x43ff78['stack']);if(_0x43ff78[_0x8344('0x29')]){delete _0x43ff78[_0x8344('0x29')];}_0x3f536e[_0x8344('0x19')](_0x1a354d)[_0x8344('0x2a')](_0x43ff78);};}exports[_0x8344('0x2b')]=function(_0x1f6bde,_0xe19fc2){var _0x25d7b4={},_0x4a0031={},_0xfb759d={'count':0x0,'rows':[]};var _0x1c36e4=_[_0x8344('0x2c')](db['ZendeskConfiguration']['rawAttributes'],function(_0x4ef927){return{'name':_0x4ef927[_0x8344('0x2d')],'type':_0x4ef927['type'][_0x8344('0x2e')]};});_0x4a0031[_0x8344('0x2f')]=_[_0x8344('0x2c')](_0x1c36e4,_0x8344('0x29'));_0x4a0031[_0x8344('0x30')]=_[_0x8344('0x31')](_0x1f6bde[_0x8344('0x30')]);_0x4a0031['filters']=_[_0x8344('0x32')](_0x4a0031[_0x8344('0x2f')],_0x4a0031[_0x8344('0x30')]);_0x25d7b4[_0x8344('0x33')]=_['intersection'](_0x4a0031[_0x8344('0x2f')],qs[_0x8344('0x34')](_0x1f6bde['query'][_0x8344('0x34')]));_0x25d7b4['attributes']=_0x25d7b4[_0x8344('0x33')]['length']?_0x25d7b4[_0x8344('0x33')]:_0x4a0031['model'];if(!_0x1f6bde[_0x8344('0x30')]['hasOwnProperty']('nolimit')){_0x25d7b4[_0x8344('0x1e')]=qs['limit'](_0x1f6bde['query'][_0x8344('0x1e')]);_0x25d7b4[_0x8344('0x1c')]=qs[_0x8344('0x1c')](_0x1f6bde[_0x8344('0x30')][_0x8344('0x1c')]);}_0x25d7b4[_0x8344('0x35')]=qs['sort'](_0x1f6bde[_0x8344('0x30')][_0x8344('0x36')]);_0x25d7b4[_0x8344('0x37')]=qs[_0x8344('0x38')](_['pick'](_0x1f6bde['query'],_0x4a0031[_0x8344('0x38')]),_0x1c36e4);if(_0x1f6bde['query'][_0x8344('0x39')]){_0x25d7b4[_0x8344('0x37')]=_[_0x8344('0x3a')](_0x25d7b4['where'],{'$or':_[_0x8344('0x2c')](_0x1c36e4,function(_0x1ffb3b){if(_0x1ffb3b[_0x8344('0x3b')]!==_0x8344('0x3c')){var _0x6ae3e2={};_0x6ae3e2[_0x1ffb3b[_0x8344('0x29')]]={'$like':'%'+_0x1f6bde[_0x8344('0x30')][_0x8344('0x39')]+'%'};return _0x6ae3e2;}})});}_0x25d7b4=_['merge']({},_0x25d7b4,_0x1f6bde['options']);var _0xe9b9ab={'where':_0x25d7b4[_0x8344('0x37')]};return db[_0x8344('0x3d')][_0x8344('0x1f')](_0xe9b9ab)[_0x8344('0x27')](function(_0x6b6031){_0xfb759d[_0x8344('0x1f')]=_0x6b6031;if(_0x1f6bde[_0x8344('0x30')][_0x8344('0x3e')]){_0x25d7b4[_0x8344('0x3f')]=[{'all':!![]}];}return db[_0x8344('0x3d')]['findAll'](_0x25d7b4);})[_0x8344('0x27')](function(_0x40e522){_0xfb759d[_0x8344('0x40')]=_0x40e522;return _0xfb759d;})[_0x8344('0x27')](respondWithFilteredResult(_0xe19fc2,_0x25d7b4))[_0x8344('0x41')](handleError(_0xe19fc2,null));};exports['show']=function(_0x29f2d2,_0xae000c){var _0x51d9c0={'raw':![],'where':{'id':_0x29f2d2[_0x8344('0x42')]['id']}},_0x51677c={};_0x51677c[_0x8344('0x2f')]=_[_0x8344('0x31')](db[_0x8344('0x3d')]['rawAttributes']);_0x51677c[_0x8344('0x30')]=_['keys'](_0x29f2d2[_0x8344('0x30')]);_0x51677c[_0x8344('0x38')]=_[_0x8344('0x32')](_0x51677c[_0x8344('0x2f')],_0x51677c[_0x8344('0x30')]);_0x51d9c0[_0x8344('0x33')]=_[_0x8344('0x32')](_0x51677c['model'],qs['fields'](_0x29f2d2[_0x8344('0x30')][_0x8344('0x34')]));_0x51d9c0[_0x8344('0x33')]=_0x51d9c0['attributes'][_0x8344('0x43')]?_0x51d9c0[_0x8344('0x33')]:_0x51677c[_0x8344('0x2f')];if(_0x29f2d2[_0x8344('0x30')][_0x8344('0x3e')]){_0x51d9c0[_0x8344('0x3f')]=[{'all':!![]}];}_0x51d9c0=_[_0x8344('0x3a')]({},_0x51d9c0,_0x29f2d2[_0x8344('0x44')]);return db[_0x8344('0x3d')][_0x8344('0x45')](_0x51d9c0)[_0x8344('0x27')](handleEntityNotFound(_0xae000c,null))['then'](respondWithResult(_0xae000c,null))[_0x8344('0x41')](handleError(_0xae000c,null));};exports[_0x8344('0x46')]=function(_0xc40bff,_0x5a72c5){return db[_0x8344('0x3d')]['create'](_0xc40bff['body'],{})[_0x8344('0x27')](respondWithResult(_0x5a72c5,0xc9))[_0x8344('0x41')](handleError(_0x5a72c5,null));};exports[_0x8344('0x25')]=function(_0xb71c91,_0x3bc9c7){if(_0xb71c91['body']['id']){delete _0xb71c91[_0x8344('0x47')]['id'];}return db[_0x8344('0x3d')]['find']({'where':{'id':_0xb71c91[_0x8344('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bc9c7,null))[_0x8344('0x27')](saveUpdates(_0xb71c91[_0x8344('0x47')],null))['then'](respondWithResult(_0x3bc9c7,null))['catch'](handleError(_0x3bc9c7,null));};exports['destroy']=function(_0x2211f6,_0x3bb221){return db[_0x8344('0x3d')]['find']({'where':{'id':_0x2211f6['params']['id']}})[_0x8344('0x27')](handleEntityNotFound(_0x3bb221,null))[_0x8344('0x27')](removeEntity(_0x3bb221,null))['catch'](handleError(_0x3bb221,null));};exports['getFields']=function(_0xee674f,_0x55caa8,_0x5ade36){var _0x36e06b={};var _0x32c276={};var _0x4ee9b8;var _0x2ac236;return db[_0x8344('0x3d')][_0x8344('0x48')]({'where':{'id':_0xee674f[_0x8344('0x42')]['id']}})[_0x8344('0x27')](handleEntityNotFound(_0x55caa8,null))[_0x8344('0x27')](function(_0x34e2b1){if(_0x34e2b1){_0x4ee9b8=_0x34e2b1;_0x32c276[_0x8344('0x2f')]=_[_0x8344('0x31')](db[_0x8344('0x49')][_0x8344('0x4a')]);_0x32c276[_0x8344('0x30')]=_[_0x8344('0x31')](_0xee674f[_0x8344('0x30')]);_0x32c276[_0x8344('0x38')]=_[_0x8344('0x32')](_0x32c276['model'],_0x32c276[_0x8344('0x30')]);_0x36e06b[_0x8344('0x33')]=_['intersection'](_0x32c276[_0x8344('0x2f')],qs['fields'](_0xee674f[_0x8344('0x30')][_0x8344('0x34')]));_0x36e06b[_0x8344('0x33')]=_0x36e06b[_0x8344('0x33')][_0x8344('0x43')]?_0x36e06b['attributes']:_0x32c276['model'];_0x36e06b['order']=qs[_0x8344('0x36')](_0xee674f[_0x8344('0x30')][_0x8344('0x36')]);_0x36e06b[_0x8344('0x37')]=qs[_0x8344('0x38')](_[_0x8344('0x4b')](_0xee674f['query'],_0x32c276[_0x8344('0x38')]));if(_0xee674f[_0x8344('0x30')][_0x8344('0x39')]){_0x36e06b[_0x8344('0x37')]=_['merge'](_0x36e06b[_0x8344('0x37')],{'$or':_['map'](_0x36e06b[_0x8344('0x33')],function(_0x1aab63){var _0x432efc={};_0x432efc[_0x1aab63]={'$like':'%'+_0xee674f[_0x8344('0x30')][_0x8344('0x39')]+'%'};return _0x432efc;})});}_0x36e06b=_[_0x8344('0x3a')]({},_0x36e06b,_0xee674f[_0x8344('0x44')]);return _0x4ee9b8['getFields'](_0x36e06b);}})['then'](function(_0x4b6d94){if(_0x4b6d94){_0x2ac236=_0x4b6d94[_0x8344('0x43')];if(!_0xee674f[_0x8344('0x30')][_0x8344('0x4c')](_0x8344('0x4d'))){_0x36e06b['limit']=qs[_0x8344('0x1e')](_0xee674f[_0x8344('0x30')][_0x8344('0x1e')]);_0x36e06b['offset']=qs[_0x8344('0x1c')](_0xee674f[_0x8344('0x30')][_0x8344('0x1c')]);}return _0x4ee9b8[_0x8344('0x4e')](_0x36e06b);}})[_0x8344('0x27')](function(_0x1ca59d){if(_0x1ca59d){return _0x1ca59d?{'count':_0x2ac236,'rows':_0x1ca59d}:null;}})['then'](respondWithResult(_0x55caa8,null))[_0x8344('0x41')](handleError(_0x55caa8,null));};exports[_0x8344('0x4f')]=function(_0x4755fb,_0x17ddc6,_0x1a8a01){var _0x2eb099={};var _0x2089ed={};var _0x206a02;var _0x5557cc;return db[_0x8344('0x3d')][_0x8344('0x48')]({'where':{'id':_0x4755fb[_0x8344('0x42')]['id']}})['then'](handleEntityNotFound(_0x17ddc6,null))['then'](function(_0x2f6827){if(_0x2f6827){_0x206a02=_0x2f6827;_0x2089ed[_0x8344('0x2f')]=_[_0x8344('0x31')](db[_0x8344('0x49')][_0x8344('0x4a')]);_0x2089ed[_0x8344('0x30')]=_[_0x8344('0x31')](_0x4755fb['query']);_0x2089ed['filters']=_[_0x8344('0x32')](_0x2089ed[_0x8344('0x2f')],_0x2089ed[_0x8344('0x30')]);_0x2eb099[_0x8344('0x33')]=_[_0x8344('0x32')](_0x2089ed['model'],qs['fields'](_0x4755fb[_0x8344('0x30')][_0x8344('0x34')]));_0x2eb099[_0x8344('0x33')]=_0x2eb099[_0x8344('0x33')][_0x8344('0x43')]?_0x2eb099['attributes']:_0x2089ed['model'];_0x2eb099[_0x8344('0x35')]=qs[_0x8344('0x36')](_0x4755fb[_0x8344('0x30')][_0x8344('0x36')]);_0x2eb099[_0x8344('0x37')]=qs['filters'](_['pick'](_0x4755fb[_0x8344('0x30')],_0x2089ed['filters']));if(_0x4755fb[_0x8344('0x30')][_0x8344('0x39')]){_0x2eb099[_0x8344('0x37')]=_[_0x8344('0x3a')](_0x2eb099['where'],{'$or':_[_0x8344('0x2c')](_0x2eb099['attributes'],function(_0x536dcc){var _0x2904d1={};_0x2904d1[_0x536dcc]={'$like':'%'+_0x4755fb['query'][_0x8344('0x39')]+'%'};return _0x2904d1;})});}_0x2eb099=_[_0x8344('0x3a')]({},_0x2eb099,_0x4755fb['options']);return _0x206a02[_0x8344('0x4f')](_0x2eb099);}})[_0x8344('0x27')](function(_0x29b686){if(_0x29b686){_0x5557cc=_0x29b686['length'];if(!_0x4755fb['query'][_0x8344('0x4c')](_0x8344('0x4d'))){_0x2eb099[_0x8344('0x1e')]=qs[_0x8344('0x1e')](_0x4755fb[_0x8344('0x30')]['limit']);_0x2eb099[_0x8344('0x1c')]=qs[_0x8344('0x1c')](_0x4755fb['query'][_0x8344('0x1c')]);}return _0x206a02[_0x8344('0x4f')](_0x2eb099);}})[_0x8344('0x27')](function(_0x4acf06){if(_0x4acf06){return _0x4acf06?{'count':_0x5557cc,'rows':_0x4acf06}:null;}})['then'](respondWithResult(_0x17ddc6,null))[_0x8344('0x41')](handleError(_0x17ddc6,null));};exports[_0x8344('0x50')]=function(_0x39ee2d,_0x31a391,_0x211c94){var _0x1176d8={};var _0x3549e6={};var _0xff8817;var _0x1608a4;return db[_0x8344('0x3d')][_0x8344('0x48')]({'where':{'id':_0x39ee2d[_0x8344('0x42')]['id']}})[_0x8344('0x27')](handleEntityNotFound(_0x31a391,null))[_0x8344('0x27')](function(_0x147414){if(_0x147414){_0xff8817=_0x147414;_0x3549e6[_0x8344('0x2f')]=_[_0x8344('0x31')](db[_0x8344('0x49')]['rawAttributes']);_0x3549e6['query']=_[_0x8344('0x31')](_0x39ee2d[_0x8344('0x30')]);_0x3549e6[_0x8344('0x38')]=_[_0x8344('0x32')](_0x3549e6['model'],_0x3549e6['query']);_0x1176d8['attributes']=_[_0x8344('0x32')](_0x3549e6[_0x8344('0x2f')],qs[_0x8344('0x34')](_0x39ee2d['query'][_0x8344('0x34')]));_0x1176d8[_0x8344('0x33')]=_0x1176d8[_0x8344('0x33')]['length']?_0x1176d8[_0x8344('0x33')]:_0x3549e6['model'];_0x1176d8[_0x8344('0x35')]=qs['sort'](_0x39ee2d[_0x8344('0x30')]['sort']);_0x1176d8[_0x8344('0x37')]=qs[_0x8344('0x38')](_['pick'](_0x39ee2d[_0x8344('0x30')],_0x3549e6[_0x8344('0x38')]));if(_0x39ee2d[_0x8344('0x30')][_0x8344('0x39')]){_0x1176d8[_0x8344('0x37')]=_['merge'](_0x1176d8['where'],{'$or':_[_0x8344('0x2c')](_0x1176d8[_0x8344('0x33')],function(_0x28e6ea){var _0x4b2b2d={};_0x4b2b2d[_0x28e6ea]={'$like':'%'+_0x39ee2d[_0x8344('0x30')]['filter']+'%'};return _0x4b2b2d;})});}_0x1176d8=_[_0x8344('0x3a')]({},_0x1176d8,_0x39ee2d[_0x8344('0x44')]);return _0xff8817[_0x8344('0x50')](_0x1176d8);}})[_0x8344('0x27')](function(_0x2e7763){if(_0x2e7763){_0x1608a4=_0x2e7763[_0x8344('0x43')];if(!_0x39ee2d['query'][_0x8344('0x4c')](_0x8344('0x4d'))){_0x1176d8['limit']=qs[_0x8344('0x1e')](_0x39ee2d[_0x8344('0x30')][_0x8344('0x1e')]);_0x1176d8[_0x8344('0x1c')]=qs[_0x8344('0x1c')](_0x39ee2d['query'][_0x8344('0x1c')]);}return _0xff8817[_0x8344('0x50')](_0x1176d8);}})[_0x8344('0x27')](function(_0x24aa5a){if(_0x24aa5a){return _0x24aa5a?{'count':_0x1608a4,'rows':_0x24aa5a}:null;}})[_0x8344('0x27')](respondWithResult(_0x31a391,null))[_0x8344('0x41')](handleError(_0x31a391,null));};exports[_0x8344('0x51')]=function(_0x4ef845,_0x4598bd,_0x884da7){var _0x1d1271={};var _0x15fbd6={};var _0x543773;var _0x11887a;return db[_0x8344('0x3d')][_0x8344('0x48')]({'where':{'id':_0x4ef845['params']['id']}})[_0x8344('0x27')](handleEntityNotFound(_0x4598bd,null))[_0x8344('0x27')](function(_0x83d10e){if(_0x83d10e){_0x543773=_0x83d10e;_0x15fbd6[_0x8344('0x2f')]=_[_0x8344('0x31')](db[_0x8344('0x52')][_0x8344('0x4a')]);_0x15fbd6[_0x8344('0x30')]=_['keys'](_0x4ef845[_0x8344('0x30')]);_0x15fbd6[_0x8344('0x38')]=_[_0x8344('0x32')](_0x15fbd6[_0x8344('0x2f')],_0x15fbd6[_0x8344('0x30')]);_0x1d1271['attributes']=_[_0x8344('0x32')](_0x15fbd6[_0x8344('0x2f')],qs[_0x8344('0x34')](_0x4ef845['query']['fields']));_0x1d1271[_0x8344('0x33')]=_0x1d1271[_0x8344('0x33')][_0x8344('0x43')]?_0x1d1271[_0x8344('0x33')]:_0x15fbd6[_0x8344('0x2f')];_0x1d1271[_0x8344('0x35')]=qs[_0x8344('0x36')](_0x4ef845[_0x8344('0x30')][_0x8344('0x36')]);_0x1d1271[_0x8344('0x37')]=qs[_0x8344('0x38')](_[_0x8344('0x4b')](_0x4ef845[_0x8344('0x30')],_0x15fbd6[_0x8344('0x38')]));if(_0x4ef845['query'][_0x8344('0x39')]){_0x1d1271['where']=_[_0x8344('0x3a')](_0x1d1271[_0x8344('0x37')],{'$or':_[_0x8344('0x2c')](_0x1d1271[_0x8344('0x33')],function(_0x1945dd){var _0x50121b={};_0x50121b[_0x1945dd]={'$like':'%'+_0x4ef845[_0x8344('0x30')]['filter']+'%'};return _0x50121b;})});}_0x1d1271=_[_0x8344('0x3a')]({},_0x1d1271,_0x4ef845[_0x8344('0x44')]);return _0x543773[_0x8344('0x51')](_0x1d1271);}})[_0x8344('0x27')](function(_0x16e419){if(_0x16e419){_0x11887a=_0x16e419[_0x8344('0x43')];if(!_0x4ef845['query']['hasOwnProperty'](_0x8344('0x4d'))){_0x1d1271[_0x8344('0x1e')]=qs[_0x8344('0x1e')](_0x4ef845[_0x8344('0x30')]['limit']);_0x1d1271[_0x8344('0x1c')]=qs[_0x8344('0x1c')](_0x4ef845[_0x8344('0x30')]['offset']);}return _0x543773['getTags'](_0x1d1271);}})[_0x8344('0x27')](function(_0x5103f3){if(_0x5103f3){return _0x5103f3?{'count':_0x11887a,'rows':_0x5103f3}:null;}})[_0x8344('0x27')](respondWithResult(_0x4598bd,null))[_0x8344('0x41')](handleError(_0x4598bd,null));};exports[_0x8344('0x53')]=function(_0x5f05e5,_0x3de18a,_0x1e4b55){if(_0x5f05e5['body']['id']){delete _0x5f05e5[_0x8344('0x47')]['id'];}return db[_0x8344('0x3d')][_0x8344('0x48')]({'where':{'id':_0x5f05e5[_0x8344('0x42')]['id']}})[_0x8344('0x27')](handleEntityNotFound(_0x3de18a,null))[_0x8344('0x27')](function(_0x59fecd){if(_0x59fecd){return _0x59fecd[_0x8344('0x53')](_0x5f05e5[_0x8344('0x47')][_0x8344('0x54')]||[]);}return null;})['then'](respondWithResult(_0x3de18a,null))['catch'](handleError(_0x3de18a,null));}; \ No newline at end of file +var _0x95ad=['error','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','then','include','findAll','rows','params','fields','includeAll','find','catch','create','body','update','getFields','ZendeskField','getSubjects','findOne','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95ad,0x1ed));var _0xd95a=function(_0x338c26,_0x31db66){_0x338c26=_0x338c26-0x0;var _0x22e34d=_0x95ad[_0x338c26];return _0x22e34d;};'use strict';var emlformat=require(_0xd95a('0x0'));var rimraf=require(_0xd95a('0x1'));var zipdir=require(_0xd95a('0x2'));var jsonpatch=require(_0xd95a('0x3'));var rp=require('request-promise');var moment=require(_0xd95a('0x4'));var BPromise=require(_0xd95a('0x5'));var Mustache=require(_0xd95a('0x6'));var util=require(_0xd95a('0x7'));var path=require(_0xd95a('0x8'));var sox=require(_0xd95a('0x9'));var csv=require(_0xd95a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd95a('0xb'));var _=require('lodash');var squel=require(_0xd95a('0xc'));var crypto=require(_0xd95a('0xd'));var jsforce=require(_0xd95a('0xe'));var deskjs=require(_0xd95a('0xf'));var toCsv=require(_0xd95a('0xa'));var querystring=require(_0xd95a('0x10'));var Papa=require('papaparse');var Redis=require(_0xd95a('0x11'));var authService=require(_0xd95a('0x12'));var qs=require(_0xd95a('0x13'));var as=require(_0xd95a('0x14'));var hardwareService=require(_0xd95a('0x15'));var logger=require(_0xd95a('0x16'))(_0xd95a('0x17'));var utils=require(_0xd95a('0x18'));var config=require(_0xd95a('0x19'));var licenseUtil=require(_0xd95a('0x1a'));var db=require(_0xd95a('0x1b'))['db'];function respondWithStatusCode(_0x446fde,_0x1a7c0a){_0x1a7c0a=_0x1a7c0a||0xcc;return function(_0x2edab8){if(_0x2edab8){return _0x446fde[_0xd95a('0x1c')](_0x1a7c0a);}return _0x446fde['status'](_0x1a7c0a)[_0xd95a('0x1d')]();};}function respondWithResult(_0x45e7ed,_0xff1ce0){_0xff1ce0=_0xff1ce0||0xc8;return function(_0x4cd08e){if(_0x4cd08e){return _0x45e7ed[_0xd95a('0x1e')](_0xff1ce0)['json'](_0x4cd08e);}};}function respondWithFilteredResult(_0x6632fd,_0x2600a1){return function(_0x20e2af){if(_0x20e2af){var _0x2ed0d4=typeof _0x2600a1[_0xd95a('0x1f')]===_0xd95a('0x20')&&typeof _0x2600a1[_0xd95a('0x21')]===_0xd95a('0x20');var _0x585502=_0x20e2af[_0xd95a('0x22')];var _0x150506=_0x2ed0d4?0x0:_0x2600a1[_0xd95a('0x1f')];var _0x181a8e=_0x2ed0d4?_0x20e2af[_0xd95a('0x22')]:_0x2600a1[_0xd95a('0x1f')]+_0x2600a1[_0xd95a('0x21')];var _0x15d63d;if(_0x181a8e>=_0x585502){_0x181a8e=_0x585502;_0x15d63d=0xc8;}else{_0x15d63d=0xce;}_0x6632fd[_0xd95a('0x1e')](_0x15d63d);return _0x6632fd[_0xd95a('0x23')](_0xd95a('0x24'),_0x150506+'-'+_0x181a8e+'/'+_0x585502)[_0xd95a('0x25')](_0x20e2af);}return null;};}function patchUpdates(_0x3b8cdb){return function(_0xeaf5e4){try{jsonpatch[_0xd95a('0x26')](_0xeaf5e4,_0x3b8cdb,!![]);}catch(_0x2e93bd){return BPromise[_0xd95a('0x27')](_0x2e93bd);}return _0xeaf5e4['save']();};}function saveUpdates(_0x2a83f6,_0x1227cc){return function(_0x27d44d){if(_0x27d44d){return _0x27d44d['update'](_0x2a83f6)['then'](function(_0x5f4e85){return _0x5f4e85;});}return null;};}function removeEntity(_0x4555de,_0x5388b5){return function(_0x5de011){if(_0x5de011){return _0x5de011[_0xd95a('0x28')]()['then'](function(){_0x4555de[_0xd95a('0x1e')](0xcc)[_0xd95a('0x1d')]();});}};}function handleEntityNotFound(_0x3a7da9,_0x3dc679){return function(_0x2e374d){if(!_0x2e374d){_0x3a7da9[_0xd95a('0x1c')](0x194);}return _0x2e374d;};}function handleError(_0x207f04,_0x2cb3dd){_0x2cb3dd=_0x2cb3dd||0x1f4;return function(_0x4ebc89){logger[_0xd95a('0x29')](_0x4ebc89[_0xd95a('0x2a')]);if(_0x4ebc89['name']){delete _0x4ebc89[_0xd95a('0x2b')];}_0x207f04[_0xd95a('0x1e')](_0x2cb3dd)[_0xd95a('0x2c')](_0x4ebc89);};}exports['index']=function(_0x36ca49,_0x4218b0){var _0xf8b4e9={},_0x681ea8={},_0x46a6f0={'count':0x0,'rows':[]};var _0x5f2f32=_[_0xd95a('0x2d')](db[_0xd95a('0x2e')][_0xd95a('0x2f')],function(_0x497107){return{'name':_0x497107[_0xd95a('0x30')],'type':_0x497107[_0xd95a('0x31')][_0xd95a('0x32')]};});_0x681ea8[_0xd95a('0x33')]=_[_0xd95a('0x2d')](_0x5f2f32,_0xd95a('0x2b'));_0x681ea8[_0xd95a('0x34')]=_[_0xd95a('0x35')](_0x36ca49[_0xd95a('0x34')]);_0x681ea8[_0xd95a('0x36')]=_[_0xd95a('0x37')](_0x681ea8[_0xd95a('0x33')],_0x681ea8[_0xd95a('0x34')]);_0xf8b4e9[_0xd95a('0x38')]=_[_0xd95a('0x37')](_0x681ea8[_0xd95a('0x33')],qs['fields'](_0x36ca49[_0xd95a('0x34')]['fields']));_0xf8b4e9['attributes']=_0xf8b4e9['attributes'][_0xd95a('0x39')]?_0xf8b4e9['attributes']:_0x681ea8[_0xd95a('0x33')];if(!_0x36ca49[_0xd95a('0x34')]['hasOwnProperty']('nolimit')){_0xf8b4e9[_0xd95a('0x21')]=qs['limit'](_0x36ca49[_0xd95a('0x34')][_0xd95a('0x21')]);_0xf8b4e9[_0xd95a('0x1f')]=qs['offset'](_0x36ca49[_0xd95a('0x34')]['offset']);}_0xf8b4e9[_0xd95a('0x3a')]=qs[_0xd95a('0x3b')](_0x36ca49[_0xd95a('0x34')][_0xd95a('0x3b')]);_0xf8b4e9[_0xd95a('0x3c')]=qs[_0xd95a('0x36')](_[_0xd95a('0x3d')](_0x36ca49[_0xd95a('0x34')],_0x681ea8[_0xd95a('0x36')]),_0x5f2f32);if(_0x36ca49[_0xd95a('0x34')][_0xd95a('0x3e')]){_0xf8b4e9[_0xd95a('0x3c')]=_['merge'](_0xf8b4e9['where'],{'$or':_[_0xd95a('0x2d')](_0x5f2f32,function(_0x545268){if(_0x545268[_0xd95a('0x31')]!==_0xd95a('0x3f')){var _0x5a1eea={};_0x5a1eea[_0x545268[_0xd95a('0x2b')]]={'$like':'%'+_0x36ca49[_0xd95a('0x34')][_0xd95a('0x3e')]+'%'};return _0x5a1eea;}})});}_0xf8b4e9=_[_0xd95a('0x40')]({},_0xf8b4e9,_0x36ca49[_0xd95a('0x41')]);var _0xa87c62={'where':_0xf8b4e9[_0xd95a('0x3c')]};return db[_0xd95a('0x2e')]['count'](_0xa87c62)[_0xd95a('0x42')](function(_0x543e62){_0x46a6f0['count']=_0x543e62;if(_0x36ca49[_0xd95a('0x34')]['includeAll']){_0xf8b4e9[_0xd95a('0x43')]=[{'all':!![]}];}return db[_0xd95a('0x2e')][_0xd95a('0x44')](_0xf8b4e9);})[_0xd95a('0x42')](function(_0x2c9cb8){_0x46a6f0[_0xd95a('0x45')]=_0x2c9cb8;return _0x46a6f0;})[_0xd95a('0x42')](respondWithFilteredResult(_0x4218b0,_0xf8b4e9))['catch'](handleError(_0x4218b0,null));};exports['show']=function(_0x3ecbd4,_0xfbb0c6){var _0x541a78={'raw':![],'where':{'id':_0x3ecbd4[_0xd95a('0x46')]['id']}},_0x27858a={};_0x27858a[_0xd95a('0x33')]=_[_0xd95a('0x35')](db[_0xd95a('0x2e')][_0xd95a('0x2f')]);_0x27858a[_0xd95a('0x34')]=_[_0xd95a('0x35')](_0x3ecbd4['query']);_0x27858a[_0xd95a('0x36')]=_[_0xd95a('0x37')](_0x27858a[_0xd95a('0x33')],_0x27858a[_0xd95a('0x34')]);_0x541a78[_0xd95a('0x38')]=_[_0xd95a('0x37')](_0x27858a[_0xd95a('0x33')],qs[_0xd95a('0x47')](_0x3ecbd4[_0xd95a('0x34')][_0xd95a('0x47')]));_0x541a78[_0xd95a('0x38')]=_0x541a78[_0xd95a('0x38')][_0xd95a('0x39')]?_0x541a78['attributes']:_0x27858a[_0xd95a('0x33')];if(_0x3ecbd4['query'][_0xd95a('0x48')]){_0x541a78['include']=[{'all':!![]}];}_0x541a78=_['merge']({},_0x541a78,_0x3ecbd4[_0xd95a('0x41')]);return db[_0xd95a('0x2e')][_0xd95a('0x49')](_0x541a78)[_0xd95a('0x42')](handleEntityNotFound(_0xfbb0c6,null))[_0xd95a('0x42')](respondWithResult(_0xfbb0c6,null))[_0xd95a('0x4a')](handleError(_0xfbb0c6,null));};exports[_0xd95a('0x4b')]=function(_0x393ccb,_0x403718){return db[_0xd95a('0x2e')][_0xd95a('0x4b')](_0x393ccb[_0xd95a('0x4c')],{})[_0xd95a('0x42')](respondWithResult(_0x403718,0xc9))[_0xd95a('0x4a')](handleError(_0x403718,null));};exports[_0xd95a('0x4d')]=function(_0x37644d,_0x4aa20f){if(_0x37644d[_0xd95a('0x4c')]['id']){delete _0x37644d[_0xd95a('0x4c')]['id'];}return db[_0xd95a('0x2e')][_0xd95a('0x49')]({'where':{'id':_0x37644d[_0xd95a('0x46')]['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x4aa20f,null))[_0xd95a('0x42')](saveUpdates(_0x37644d[_0xd95a('0x4c')],null))['then'](respondWithResult(_0x4aa20f,null))[_0xd95a('0x4a')](handleError(_0x4aa20f,null));};exports[_0xd95a('0x28')]=function(_0x15128c,_0x72881c){return db[_0xd95a('0x2e')][_0xd95a('0x49')]({'where':{'id':_0x15128c['params']['id']}})['then'](handleEntityNotFound(_0x72881c,null))[_0xd95a('0x42')](removeEntity(_0x72881c,null))[_0xd95a('0x4a')](handleError(_0x72881c,null));};exports[_0xd95a('0x4e')]=function(_0x5e1b6c,_0x167b1e,_0x2f121c){var _0x1a9a61={};var _0x437c06={};var _0x3d81fd;var _0x5c15c0;return db[_0xd95a('0x2e')]['findOne']({'where':{'id':_0x5e1b6c[_0xd95a('0x46')]['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x167b1e,null))[_0xd95a('0x42')](function(_0x278e6c){if(_0x278e6c){_0x3d81fd=_0x278e6c;_0x437c06['model']=_[_0xd95a('0x35')](db[_0xd95a('0x4f')][_0xd95a('0x2f')]);_0x437c06[_0xd95a('0x34')]=_[_0xd95a('0x35')](_0x5e1b6c[_0xd95a('0x34')]);_0x437c06[_0xd95a('0x36')]=_['intersection'](_0x437c06['model'],_0x437c06['query']);_0x1a9a61[_0xd95a('0x38')]=_[_0xd95a('0x37')](_0x437c06[_0xd95a('0x33')],qs[_0xd95a('0x47')](_0x5e1b6c[_0xd95a('0x34')][_0xd95a('0x47')]));_0x1a9a61[_0xd95a('0x38')]=_0x1a9a61['attributes'][_0xd95a('0x39')]?_0x1a9a61[_0xd95a('0x38')]:_0x437c06[_0xd95a('0x33')];_0x1a9a61[_0xd95a('0x3a')]=qs[_0xd95a('0x3b')](_0x5e1b6c[_0xd95a('0x34')][_0xd95a('0x3b')]);_0x1a9a61[_0xd95a('0x3c')]=qs['filters'](_[_0xd95a('0x3d')](_0x5e1b6c[_0xd95a('0x34')],_0x437c06[_0xd95a('0x36')]));if(_0x5e1b6c['query']['filter']){_0x1a9a61[_0xd95a('0x3c')]=_['merge'](_0x1a9a61[_0xd95a('0x3c')],{'$or':_[_0xd95a('0x2d')](_0x1a9a61[_0xd95a('0x38')],function(_0x3eb0db){var _0x18bba8={};_0x18bba8[_0x3eb0db]={'$like':'%'+_0x5e1b6c[_0xd95a('0x34')][_0xd95a('0x3e')]+'%'};return _0x18bba8;})});}_0x1a9a61=_['merge']({},_0x1a9a61,_0x5e1b6c[_0xd95a('0x41')]);return _0x3d81fd[_0xd95a('0x4e')](_0x1a9a61);}})[_0xd95a('0x42')](function(_0x1be9ba){if(_0x1be9ba){_0x5c15c0=_0x1be9ba[_0xd95a('0x39')];if(!_0x5e1b6c[_0xd95a('0x34')]['hasOwnProperty']('nolimit')){_0x1a9a61[_0xd95a('0x21')]=qs[_0xd95a('0x21')](_0x5e1b6c[_0xd95a('0x34')][_0xd95a('0x21')]);_0x1a9a61[_0xd95a('0x1f')]=qs['offset'](_0x5e1b6c[_0xd95a('0x34')]['offset']);}return _0x3d81fd[_0xd95a('0x4e')](_0x1a9a61);}})['then'](function(_0x4d251e){if(_0x4d251e){return _0x4d251e?{'count':_0x5c15c0,'rows':_0x4d251e}:null;}})[_0xd95a('0x42')](respondWithResult(_0x167b1e,null))[_0xd95a('0x4a')](handleError(_0x167b1e,null));};exports[_0xd95a('0x50')]=function(_0x4da4a9,_0x51638e,_0x5e20a1){var _0x1d019a={};var _0xabdde={};var _0x7925cc;var _0x10b2e5;return db[_0xd95a('0x2e')][_0xd95a('0x51')]({'where':{'id':_0x4da4a9[_0xd95a('0x46')]['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x51638e,null))[_0xd95a('0x42')](function(_0x50e318){if(_0x50e318){_0x7925cc=_0x50e318;_0xabdde[_0xd95a('0x33')]=_['keys'](db[_0xd95a('0x4f')][_0xd95a('0x2f')]);_0xabdde['query']=_['keys'](_0x4da4a9[_0xd95a('0x34')]);_0xabdde[_0xd95a('0x36')]=_[_0xd95a('0x37')](_0xabdde['model'],_0xabdde[_0xd95a('0x34')]);_0x1d019a[_0xd95a('0x38')]=_[_0xd95a('0x37')](_0xabdde[_0xd95a('0x33')],qs[_0xd95a('0x47')](_0x4da4a9[_0xd95a('0x34')][_0xd95a('0x47')]));_0x1d019a[_0xd95a('0x38')]=_0x1d019a[_0xd95a('0x38')][_0xd95a('0x39')]?_0x1d019a[_0xd95a('0x38')]:_0xabdde[_0xd95a('0x33')];_0x1d019a['order']=qs[_0xd95a('0x3b')](_0x4da4a9['query'][_0xd95a('0x3b')]);_0x1d019a[_0xd95a('0x3c')]=qs[_0xd95a('0x36')](_[_0xd95a('0x3d')](_0x4da4a9[_0xd95a('0x34')],_0xabdde[_0xd95a('0x36')]));if(_0x4da4a9['query']['filter']){_0x1d019a[_0xd95a('0x3c')]=_['merge'](_0x1d019a[_0xd95a('0x3c')],{'$or':_['map'](_0x1d019a[_0xd95a('0x38')],function(_0x586d15){var _0x50634f={};_0x50634f[_0x586d15]={'$like':'%'+_0x4da4a9['query']['filter']+'%'};return _0x50634f;})});}_0x1d019a=_[_0xd95a('0x40')]({},_0x1d019a,_0x4da4a9[_0xd95a('0x41')]);return _0x7925cc[_0xd95a('0x50')](_0x1d019a);}})[_0xd95a('0x42')](function(_0x3cad23){if(_0x3cad23){_0x10b2e5=_0x3cad23[_0xd95a('0x39')];if(!_0x4da4a9[_0xd95a('0x34')][_0xd95a('0x52')](_0xd95a('0x53'))){_0x1d019a[_0xd95a('0x21')]=qs[_0xd95a('0x21')](_0x4da4a9['query']['limit']);_0x1d019a['offset']=qs['offset'](_0x4da4a9[_0xd95a('0x34')]['offset']);}return _0x7925cc['getSubjects'](_0x1d019a);}})[_0xd95a('0x42')](function(_0x47eda2){if(_0x47eda2){return _0x47eda2?{'count':_0x10b2e5,'rows':_0x47eda2}:null;}})[_0xd95a('0x42')](respondWithResult(_0x51638e,null))[_0xd95a('0x4a')](handleError(_0x51638e,null));};exports[_0xd95a('0x54')]=function(_0x52d77e,_0x334e01,_0x3ab58b){var _0x5a3946={};var _0x247837={};var _0x36c1d1;var _0x5d5884;return db[_0xd95a('0x2e')]['findOne']({'where':{'id':_0x52d77e['params']['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x334e01,null))['then'](function(_0x183826){if(_0x183826){_0x36c1d1=_0x183826;_0x247837[_0xd95a('0x33')]=_[_0xd95a('0x35')](db[_0xd95a('0x4f')]['rawAttributes']);_0x247837[_0xd95a('0x34')]=_[_0xd95a('0x35')](_0x52d77e[_0xd95a('0x34')]);_0x247837['filters']=_[_0xd95a('0x37')](_0x247837[_0xd95a('0x33')],_0x247837[_0xd95a('0x34')]);_0x5a3946['attributes']=_[_0xd95a('0x37')](_0x247837[_0xd95a('0x33')],qs[_0xd95a('0x47')](_0x52d77e['query'][_0xd95a('0x47')]));_0x5a3946[_0xd95a('0x38')]=_0x5a3946[_0xd95a('0x38')][_0xd95a('0x39')]?_0x5a3946[_0xd95a('0x38')]:_0x247837[_0xd95a('0x33')];_0x5a3946['order']=qs[_0xd95a('0x3b')](_0x52d77e[_0xd95a('0x34')][_0xd95a('0x3b')]);_0x5a3946['where']=qs[_0xd95a('0x36')](_[_0xd95a('0x3d')](_0x52d77e[_0xd95a('0x34')],_0x247837['filters']));if(_0x52d77e[_0xd95a('0x34')][_0xd95a('0x3e')]){_0x5a3946[_0xd95a('0x3c')]=_['merge'](_0x5a3946[_0xd95a('0x3c')],{'$or':_[_0xd95a('0x2d')](_0x5a3946[_0xd95a('0x38')],function(_0x383c90){var _0x1782ce={};_0x1782ce[_0x383c90]={'$like':'%'+_0x52d77e['query']['filter']+'%'};return _0x1782ce;})});}_0x5a3946=_[_0xd95a('0x40')]({},_0x5a3946,_0x52d77e[_0xd95a('0x41')]);return _0x36c1d1[_0xd95a('0x54')](_0x5a3946);}})[_0xd95a('0x42')](function(_0x426a2e){if(_0x426a2e){_0x5d5884=_0x426a2e['length'];if(!_0x52d77e[_0xd95a('0x34')][_0xd95a('0x52')](_0xd95a('0x53'))){_0x5a3946[_0xd95a('0x21')]=qs[_0xd95a('0x21')](_0x52d77e[_0xd95a('0x34')][_0xd95a('0x21')]);_0x5a3946[_0xd95a('0x1f')]=qs[_0xd95a('0x1f')](_0x52d77e[_0xd95a('0x34')]['offset']);}return _0x36c1d1[_0xd95a('0x54')](_0x5a3946);}})[_0xd95a('0x42')](function(_0x5d3270){if(_0x5d3270){return _0x5d3270?{'count':_0x5d5884,'rows':_0x5d3270}:null;}})[_0xd95a('0x42')](respondWithResult(_0x334e01,null))['catch'](handleError(_0x334e01,null));};exports[_0xd95a('0x55')]=function(_0x2da90b,_0x3fcb8e,_0x2ec0ba){var _0x1d5c13={};var _0x8f74={};var _0x143b7c;var _0x228f17;return db[_0xd95a('0x2e')][_0xd95a('0x51')]({'where':{'id':_0x2da90b['params']['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x3fcb8e,null))[_0xd95a('0x42')](function(_0x581c86){if(_0x581c86){_0x143b7c=_0x581c86;_0x8f74['model']=_[_0xd95a('0x35')](db[_0xd95a('0x56')]['rawAttributes']);_0x8f74[_0xd95a('0x34')]=_[_0xd95a('0x35')](_0x2da90b['query']);_0x8f74[_0xd95a('0x36')]=_[_0xd95a('0x37')](_0x8f74['model'],_0x8f74['query']);_0x1d5c13[_0xd95a('0x38')]=_[_0xd95a('0x37')](_0x8f74[_0xd95a('0x33')],qs[_0xd95a('0x47')](_0x2da90b[_0xd95a('0x34')][_0xd95a('0x47')]));_0x1d5c13[_0xd95a('0x38')]=_0x1d5c13[_0xd95a('0x38')][_0xd95a('0x39')]?_0x1d5c13[_0xd95a('0x38')]:_0x8f74[_0xd95a('0x33')];_0x1d5c13['order']=qs[_0xd95a('0x3b')](_0x2da90b[_0xd95a('0x34')][_0xd95a('0x3b')]);_0x1d5c13['where']=qs[_0xd95a('0x36')](_['pick'](_0x2da90b[_0xd95a('0x34')],_0x8f74[_0xd95a('0x36')]));if(_0x2da90b[_0xd95a('0x34')][_0xd95a('0x3e')]){_0x1d5c13[_0xd95a('0x3c')]=_[_0xd95a('0x40')](_0x1d5c13['where'],{'$or':_[_0xd95a('0x2d')](_0x1d5c13[_0xd95a('0x38')],function(_0x3fe025){var _0xf4aeb9={};_0xf4aeb9[_0x3fe025]={'$like':'%'+_0x2da90b[_0xd95a('0x34')][_0xd95a('0x3e')]+'%'};return _0xf4aeb9;})});}_0x1d5c13=_[_0xd95a('0x40')]({},_0x1d5c13,_0x2da90b[_0xd95a('0x41')]);return _0x143b7c[_0xd95a('0x55')](_0x1d5c13);}})['then'](function(_0x23743c){if(_0x23743c){_0x228f17=_0x23743c[_0xd95a('0x39')];if(!_0x2da90b['query'][_0xd95a('0x52')](_0xd95a('0x53'))){_0x1d5c13[_0xd95a('0x21')]=qs[_0xd95a('0x21')](_0x2da90b[_0xd95a('0x34')][_0xd95a('0x21')]);_0x1d5c13[_0xd95a('0x1f')]=qs['offset'](_0x2da90b[_0xd95a('0x34')]['offset']);}return _0x143b7c['getTags'](_0x1d5c13);}})[_0xd95a('0x42')](function(_0x395fc9){if(_0x395fc9){return _0x395fc9?{'count':_0x228f17,'rows':_0x395fc9}:null;}})[_0xd95a('0x42')](respondWithResult(_0x3fcb8e,null))[_0xd95a('0x4a')](handleError(_0x3fcb8e,null));};exports[_0xd95a('0x57')]=function(_0x33307c,_0x372ebe,_0x281fcf){if(_0x33307c['body']['id']){delete _0x33307c[_0xd95a('0x4c')]['id'];}return db[_0xd95a('0x2e')][_0xd95a('0x51')]({'where':{'id':_0x33307c[_0xd95a('0x46')]['id']}})[_0xd95a('0x42')](handleEntityNotFound(_0x372ebe,null))[_0xd95a('0x42')](function(_0x53ad32){if(_0x53ad32){return _0x53ad32[_0xd95a('0x57')](_0x33307c['body'][_0xd95a('0x58')]||[]);}return null;})[_0xd95a('0x42')](respondWithResult(_0x372ebe,null))['catch'](handleError(_0x372ebe,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 9a06746..6234906 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 _0x7708=['../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','rimraf'];(function(_0x5ec526,_0x2c879c){var _0x50dad7=function(_0x2f1f7a){while(--_0x2f1f7a){_0x5ec526['push'](_0x5ec526['shift']());}};_0x50dad7(++_0x2c879c);}(_0x7708,0x188));var _0x8770=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x7708[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb574=['./intZendeskConfiguration.attributes','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x30d21e,_0xe210b1){var _0x1d6dce=function(_0x17ed19){while(--_0x17ed19){_0x30d21e['push'](_0x30d21e['shift']());}};_0x1d6dce(++_0xe210b1);}(_0xb574,0x106));var _0x4b57=function(_0x10db5b,_0x26cddb){_0x10db5b=_0x10db5b-0x0;var _0x121f3c=_0xb574[_0x10db5b];return _0x121f3c;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var logger=require('../../config/logger')(_0x4b57('0x2'));var moment=require(_0x4b57('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b57('0x4'));var fs=require('fs');var path=require(_0x4b57('0x5'));var rimraf=require(_0x4b57('0x6'));var config=require(_0x4b57('0x7'));var attributes=require(_0x4b57('0x8'));module['exports']=function(_0x4eb019,_0x1c97e5){return _0x4eb019['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index aa3ac5a..a4e7262 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 _0x3203=['http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x39efa2,_0x3789a8){var _0x4d70e4=function(_0x293c75){while(--_0x293c75){_0x39efa2['push'](_0x39efa2['shift']());}};_0x4d70e4(++_0x3789a8);}(_0x3203,0x97));var _0x3320=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x3203[_0x58175c];return _0x55b88f;};'use strict';var _=require(_0x3320('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3320('0x1'));var rs=require(_0x3320('0x2'));var fs=require('fs');var Redis=require(_0x3320('0x3'));var db=require(_0x3320('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3320('0x5'))(_0x3320('0x6'));var config=require('../../config/environment');var jayson=require(_0x3320('0x7'));var client=jayson[_0x3320('0x8')][_0x3320('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dd038,_0x283df4,_0x3b1c14){return new BPromise(function(_0x39c920,_0x321ec4){return client[_0x3320('0xa')](_0x4dd038,_0x3b1c14)['then'](function(_0x88d75){logger[_0x3320('0xb')](_0x3320('0xc'),_0x283df4,_0x3320('0xd'));logger[_0x3320('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x283df4,'request\x20sent',JSON['stringify'](_0x88d75));if(_0x88d75[_0x3320('0xf')]){if(_0x88d75[_0x3320('0xf')][_0x3320('0x10')]===0x1f4){logger[_0x3320('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x283df4,_0x88d75[_0x3320('0xf')][_0x3320('0x11')]);return _0x321ec4(_0x88d75[_0x3320('0xf')][_0x3320('0x11')]);}logger[_0x3320('0xf')](_0x3320('0xc'),_0x283df4,_0x88d75[_0x3320('0xf')][_0x3320('0x11')]);return _0x39c920(_0x88d75[_0x3320('0xf')][_0x3320('0x11')]);}else{logger[_0x3320('0xb')](_0x3320('0xc'),_0x283df4,'request\x20sent');_0x39c920(_0x88d75[_0x3320('0x12')][_0x3320('0x11')]);}})[_0x3320('0x13')](function(_0x2c30a5){logger[_0x3320('0xf')](_0x3320('0xc'),_0x283df4,_0x2c30a5);_0x321ec4(_0x2c30a5);});});} \ No newline at end of file +var _0xb8f9=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0xb8f9,0xa9));var _0x9b8f=function(_0xf58288,_0x35333c){_0xf58288=_0xf58288-0x0;var _0x196e87=_0xb8f9[_0xf58288];return _0x196e87;};'use strict';var _=require(_0x9b8f('0x0'));var util=require('util');var moment=require(_0x9b8f('0x1'));var BPromise=require(_0x9b8f('0x2'));var rs=require(_0x9b8f('0x3'));var fs=require('fs');var Redis=require(_0x9b8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b8f('0x5'));var logger=require(_0x9b8f('0x6'))(_0x9b8f('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b8f('0x8'));var client=jayson[_0x9b8f('0x9')][_0x9b8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x567a73,_0x3abd8a,_0x3aa53c){return new BPromise(function(_0x15bcca,_0x112462){return client[_0x9b8f('0xb')](_0x567a73,_0x3aa53c)[_0x9b8f('0xc')](function(_0x4048ca){logger[_0x9b8f('0xd')](_0x9b8f('0xe'),_0x3abd8a,_0x9b8f('0xf'));logger[_0x9b8f('0x10')](_0x9b8f('0x11'),_0x3abd8a,_0x9b8f('0xf'),JSON[_0x9b8f('0x12')](_0x4048ca));if(_0x4048ca[_0x9b8f('0x13')]){if(_0x4048ca['error'][_0x9b8f('0x14')]===0x1f4){logger[_0x9b8f('0x13')](_0x9b8f('0xe'),_0x3abd8a,_0x4048ca['error'][_0x9b8f('0x15')]);return _0x112462(_0x4048ca[_0x9b8f('0x13')][_0x9b8f('0x15')]);}logger[_0x9b8f('0x13')](_0x9b8f('0xe'),_0x3abd8a,_0x4048ca[_0x9b8f('0x13')]['message']);return _0x15bcca(_0x4048ca[_0x9b8f('0x13')][_0x9b8f('0x15')]);}else{logger[_0x9b8f('0xd')](_0x9b8f('0xe'),_0x3abd8a,_0x9b8f('0xf'));_0x15bcca(_0x4048ca[_0x9b8f('0x16')][_0x9b8f('0x15')]);}})[_0x9b8f('0x17')](function(_0x5f47b4){logger[_0x9b8f('0x13')](_0x9b8f('0xe'),_0x3abd8a,_0x5f47b4);_0x112462(_0x5f47b4);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index af8d23c..aaff886 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 _0xcb28=['put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0xcb28,0x9d));var _0x8cb2=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xcb28[_0x2842b4];return _0x2b9521;};'use strict';var multer=require('multer');var util=require(_0x8cb2('0x0'));var path=require(_0x8cb2('0x1'));var timeout=require(_0x8cb2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8cb2('0x3'));var interaction=require(_0x8cb2('0x4'));var config=require(_0x8cb2('0x5'));var controller=require(_0x8cb2('0x6'));router[_0x8cb2('0x7')]('/',auth[_0x8cb2('0x8')](),controller[_0x8cb2('0x9')]);router[_0x8cb2('0x7')](_0x8cb2('0xa'),auth[_0x8cb2('0x8')](),controller['show']);router[_0x8cb2('0xb')]('/',auth['isAuthenticated'](),controller[_0x8cb2('0xc')]);router[_0x8cb2('0xd')]('/:id',auth[_0x8cb2('0x8')](),controller[_0x8cb2('0xe')]);router[_0x8cb2('0xf')]('/:id',auth[_0x8cb2('0x8')](),controller[_0x8cb2('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9a0d=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x18b13d,_0x549f57){var _0x2d147b=function(_0x302a63){while(--_0x302a63){_0x18b13d['push'](_0x18b13d['shift']());}};_0x2d147b(++_0x549f57);}(_0x9a0d,0x1cd));var _0xd9a0=function(_0x71185f,_0x371d74){_0x71185f=_0x71185f-0x0;var _0x160ffe=_0x9a0d[_0x71185f];return _0x160ffe;};'use strict';var multer=require(_0xd9a0('0x0'));var util=require(_0xd9a0('0x1'));var path=require('path');var timeout=require(_0xd9a0('0x2'));var express=require(_0xd9a0('0x3'));var router=express[_0xd9a0('0x4')]();var fs_extra=require(_0xd9a0('0x5'));var auth=require(_0xd9a0('0x6'));var interaction=require(_0xd9a0('0x7'));var config=require(_0xd9a0('0x8'));var controller=require(_0xd9a0('0x9'));router[_0xd9a0('0xa')]('/',auth['isAuthenticated'](),controller[_0xd9a0('0xb')]);router[_0xd9a0('0xa')]('/:id',auth[_0xd9a0('0xc')](),controller[_0xd9a0('0xd')]);router[_0xd9a0('0xe')]('/',auth[_0xd9a0('0xc')](),controller[_0xd9a0('0xf')]);router[_0xd9a0('0x10')](_0xd9a0('0x11'),auth['isAuthenticated'](),controller[_0xd9a0('0x12')]);router[_0xd9a0('0x13')](_0xd9a0('0x11'),auth[_0xd9a0('0xc')](),controller[_0xd9a0('0x14')]);module[_0xd9a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 16f28e1..ff63da6 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 _0x43be=['exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize'];(function(_0xd6ddab,_0x3f700e){var _0x81549e=function(_0x405c71){while(--_0x405c71){_0xd6ddab['push'](_0xd6ddab['shift']());}};_0x81549e(++_0x3f700e);}(_0x43be,0xc7));var _0xe43b=function(_0x31038b,_0x3ac1c9){_0x31038b=_0x31038b-0x0;var _0x1c9d3c=_0x43be[_0x31038b];return _0x1c9d3c;};'use strict';var Sequelize=require(_0xe43b('0x0'));module[_0xe43b('0x1')]={'type':{'type':Sequelize[_0xe43b('0x2')]('string','variable',_0xe43b('0x3'),_0xe43b('0x4'),_0xe43b('0x5')),'defaultValue':_0xe43b('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe43b('0x7')]},'keyType':{'type':Sequelize[_0xe43b('0x2')]('string',_0xe43b('0x8'),_0xe43b('0x3'))},'keyContent':{'type':Sequelize[_0xe43b('0x7')]},'idField':{'type':Sequelize[_0xe43b('0x7')]},'nameField':{'type':Sequelize[_0xe43b('0x7')]},'customField':{'type':Sequelize[_0xe43b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe43b('0x7')]}}; \ No newline at end of file +var _0x6fbd=['string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x53e119,_0x35d549){var _0xe97b6f=function(_0x4a3a3f){while(--_0x4a3a3f){_0x53e119['push'](_0x53e119['shift']());}};_0xe97b6f(++_0x35d549);}(_0x6fbd,0x12f));var _0xd6fb=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x6fbd[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0xd6fb('0x0'));module[_0xd6fb('0x1')]={'type':{'type':Sequelize[_0xd6fb('0x2')](_0xd6fb('0x3'),'variable',_0xd6fb('0x4'),_0xd6fb('0x5'),_0xd6fb('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd6fb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd6fb('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd6fb('0x7')]},'idField':{'type':Sequelize[_0xd6fb('0x7')]},'nameField':{'type':Sequelize[_0xd6fb('0x7')]},'customField':{'type':Sequelize[_0xd6fb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6fb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a672038..0d05d85 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 _0x6f33=['json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','error','name','send','index','map','ZendeskField','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','then','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x27af08,_0x192c31){var _0x49eb8e=function(_0x249b6b){while(--_0x249b6b){_0x27af08['push'](_0x27af08['shift']());}};_0x49eb8e(++_0x192c31);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x36f3('0x0'));var rimraf=require(_0x36f3('0x1'));var zipdir=require(_0x36f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x36f3('0x3'));var BPromise=require(_0x36f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f3('0x5'));var sox=require('sox');var csv=require(_0x36f3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36f3('0x7'));var squel=require('squel');var crypto=require(_0x36f3('0x8'));var jsforce=require(_0x36f3('0x9'));var deskjs=require(_0x36f3('0xa'));var toCsv=require(_0x36f3('0x6'));var querystring=require('querystring');var Papa=require(_0x36f3('0xb'));var Redis=require(_0x36f3('0xc'));var authService=require(_0x36f3('0xd'));var qs=require(_0x36f3('0xe'));var as=require(_0x36f3('0xf'));var hardwareService=require(_0x36f3('0x10'));var logger=require(_0x36f3('0x11'))(_0x36f3('0x12'));var utils=require(_0x36f3('0x13'));var config=require(_0x36f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x36f3('0x15'))['db'];function respondWithStatusCode(_0x47740d,_0x4dda9e){_0x4dda9e=_0x4dda9e||0xcc;return function(_0x424a2f){if(_0x424a2f){return _0x47740d['sendStatus'](_0x4dda9e);}return _0x47740d[_0x36f3('0x16')](_0x4dda9e)[_0x36f3('0x17')]();};}function respondWithResult(_0x112a9d,_0x12eb9b){_0x12eb9b=_0x12eb9b||0xc8;return function(_0x9da06a){if(_0x9da06a){return _0x112a9d['status'](_0x12eb9b)[_0x36f3('0x18')](_0x9da06a);}};}function respondWithFilteredResult(_0x25d29a,_0x2b108e){return function(_0x126414){if(_0x126414){var _0x116c49=typeof _0x2b108e['offset']===_0x36f3('0x19')&&typeof _0x2b108e[_0x36f3('0x1a')]===_0x36f3('0x19');var _0x376216=_0x126414[_0x36f3('0x1b')];var _0x2cc9ea=_0x116c49?0x0:_0x2b108e['offset'];var _0x232fd3=_0x116c49?_0x126414[_0x36f3('0x1b')]:_0x2b108e[_0x36f3('0x1c')]+_0x2b108e[_0x36f3('0x1a')];var _0x3cf8a2;if(_0x232fd3>=_0x376216){_0x232fd3=_0x376216;_0x3cf8a2=0xc8;}else{_0x3cf8a2=0xce;}_0x25d29a['status'](_0x3cf8a2);return _0x25d29a['set'](_0x36f3('0x1d'),_0x2cc9ea+'-'+_0x232fd3+'/'+_0x376216)[_0x36f3('0x18')](_0x126414);}return null;};}function patchUpdates(_0x402dc8){return function(_0x1930f4){try{jsonpatch[_0x36f3('0x1e')](_0x1930f4,_0x402dc8,!![]);}catch(_0xbf3556){return BPromise[_0x36f3('0x1f')](_0xbf3556);}return _0x1930f4['save']();};}function saveUpdates(_0x54f131,_0x57d1c2){return function(_0x496d70){if(_0x496d70){return _0x496d70[_0x36f3('0x20')](_0x54f131)['then'](function(_0x2cb42c){return _0x2cb42c;});}return null;};}function removeEntity(_0x292143,_0x481d99){return function(_0x4c45eb){if(_0x4c45eb){return _0x4c45eb[_0x36f3('0x21')]()['then'](function(){_0x292143[_0x36f3('0x16')](0xcc)[_0x36f3('0x17')]();});}};}function handleEntityNotFound(_0x165633,_0x1bf1f0){return function(_0x524b1a){if(!_0x524b1a){_0x165633[_0x36f3('0x22')](0x194);}return _0x524b1a;};}function handleError(_0x5acd45,_0x15e430){_0x15e430=_0x15e430||0x1f4;return function(_0xf04be4){logger[_0x36f3('0x23')](_0xf04be4['stack']);if(_0xf04be4['name']){delete _0xf04be4[_0x36f3('0x24')];}_0x5acd45[_0x36f3('0x16')](_0x15e430)[_0x36f3('0x25')](_0xf04be4);};}exports[_0x36f3('0x26')]=function(_0x188080,_0x4b1f12){var _0x4131ad={},_0x5d0635={},_0x4873f1={'count':0x0,'rows':[]};var _0x3ac376=_[_0x36f3('0x27')](db[_0x36f3('0x28')][_0x36f3('0x29')],function(_0x1809b6){return{'name':_0x1809b6['fieldName'],'type':_0x1809b6[_0x36f3('0x2a')][_0x36f3('0x2b')]};});_0x5d0635[_0x36f3('0x2c')]=_[_0x36f3('0x27')](_0x3ac376,_0x36f3('0x24'));_0x5d0635[_0x36f3('0x2d')]=_['keys'](_0x188080[_0x36f3('0x2d')]);_0x5d0635['filters']=_[_0x36f3('0x2e')](_0x5d0635[_0x36f3('0x2c')],_0x5d0635[_0x36f3('0x2d')]);_0x4131ad[_0x36f3('0x2f')]=_['intersection'](_0x5d0635[_0x36f3('0x2c')],qs[_0x36f3('0x30')](_0x188080['query'][_0x36f3('0x30')]));_0x4131ad[_0x36f3('0x2f')]=_0x4131ad[_0x36f3('0x2f')][_0x36f3('0x31')]?_0x4131ad[_0x36f3('0x2f')]:_0x5d0635[_0x36f3('0x2c')];if(!_0x188080[_0x36f3('0x2d')][_0x36f3('0x32')](_0x36f3('0x33'))){_0x4131ad[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x188080[_0x36f3('0x2d')][_0x36f3('0x1a')]);_0x4131ad[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x188080[_0x36f3('0x2d')]['offset']);}_0x4131ad[_0x36f3('0x34')]=qs['sort'](_0x188080[_0x36f3('0x2d')][_0x36f3('0x35')]);_0x4131ad[_0x36f3('0x36')]=qs[_0x36f3('0x37')](_[_0x36f3('0x38')](_0x188080[_0x36f3('0x2d')],_0x5d0635[_0x36f3('0x37')]),_0x3ac376);if(_0x188080['query']['filter']){_0x4131ad['where']=_[_0x36f3('0x39')](_0x4131ad[_0x36f3('0x36')],{'$or':_['map'](_0x3ac376,function(_0x4556cd){if(_0x4556cd[_0x36f3('0x2a')]!==_0x36f3('0x3a')){var _0x5f1d64={};_0x5f1d64[_0x4556cd[_0x36f3('0x24')]]={'$like':'%'+_0x188080['query'][_0x36f3('0x3b')]+'%'};return _0x5f1d64;}})});}_0x4131ad=_['merge']({},_0x4131ad,_0x188080[_0x36f3('0x3c')]);var _0x457cf={'where':_0x4131ad[_0x36f3('0x36')]};return db['ZendeskField'][_0x36f3('0x1b')](_0x457cf)[_0x36f3('0x3d')](function(_0x44a235){_0x4873f1[_0x36f3('0x1b')]=_0x44a235;if(_0x188080[_0x36f3('0x2d')]['includeAll']){_0x4131ad['include']=[{'all':!![]}];}return db['ZendeskField'][_0x36f3('0x3e')](_0x4131ad);})[_0x36f3('0x3d')](function(_0x1aabc0){_0x4873f1[_0x36f3('0x3f')]=_0x1aabc0;return _0x4873f1;})['then'](respondWithFilteredResult(_0x4b1f12,_0x4131ad))[_0x36f3('0x40')](handleError(_0x4b1f12,null));};exports[_0x36f3('0x41')]=function(_0x388b79,_0x21fafb){var _0x2ab529={'raw':!![],'where':{'id':_0x388b79[_0x36f3('0x42')]['id']}},_0xd63988={};_0xd63988['model']=_['keys'](db['ZendeskField'][_0x36f3('0x29')]);_0xd63988['query']=_[_0x36f3('0x43')](_0x388b79[_0x36f3('0x2d')]);_0xd63988[_0x36f3('0x37')]=_['intersection'](_0xd63988[_0x36f3('0x2c')],_0xd63988[_0x36f3('0x2d')]);_0x2ab529[_0x36f3('0x2f')]=_[_0x36f3('0x2e')](_0xd63988[_0x36f3('0x2c')],qs[_0x36f3('0x30')](_0x388b79[_0x36f3('0x2d')][_0x36f3('0x30')]));_0x2ab529[_0x36f3('0x2f')]=_0x2ab529[_0x36f3('0x2f')][_0x36f3('0x31')]?_0x2ab529[_0x36f3('0x2f')]:_0xd63988[_0x36f3('0x2c')];if(_0x388b79['query'][_0x36f3('0x44')]){_0x2ab529[_0x36f3('0x45')]=[{'all':!![]}];}_0x2ab529=_[_0x36f3('0x39')]({},_0x2ab529,_0x388b79[_0x36f3('0x3c')]);return db[_0x36f3('0x28')][_0x36f3('0x46')](_0x2ab529)[_0x36f3('0x3d')](handleEntityNotFound(_0x21fafb,null))[_0x36f3('0x3d')](respondWithResult(_0x21fafb,null))[_0x36f3('0x40')](handleError(_0x21fafb,null));};exports['create']=function(_0x35b8c5,_0x1bdaea){return db[_0x36f3('0x28')][_0x36f3('0x47')](_0x35b8c5[_0x36f3('0x48')],{})[_0x36f3('0x3d')](respondWithResult(_0x1bdaea,0xc9))[_0x36f3('0x40')](handleError(_0x1bdaea,null));};exports[_0x36f3('0x20')]=function(_0x2be4e0,_0x477cf6){if(_0x2be4e0[_0x36f3('0x48')]['id']){delete _0x2be4e0[_0x36f3('0x48')]['id'];}return db[_0x36f3('0x28')][_0x36f3('0x46')]({'where':{'id':_0x2be4e0[_0x36f3('0x42')]['id']}})[_0x36f3('0x3d')](handleEntityNotFound(_0x477cf6,null))[_0x36f3('0x3d')](saveUpdates(_0x2be4e0[_0x36f3('0x48')],null))[_0x36f3('0x3d')](respondWithResult(_0x477cf6,null))['catch'](handleError(_0x477cf6,null));};exports[_0x36f3('0x21')]=function(_0x6f3400,_0x2dbc36){return db[_0x36f3('0x28')][_0x36f3('0x46')]({'where':{'id':_0x6f3400['params']['id']}})[_0x36f3('0x3d')](handleEntityNotFound(_0x2dbc36,null))['then'](removeEntity(_0x2dbc36,null))[_0x36f3('0x40')](handleError(_0x2dbc36,null));}; \ No newline at end of file +var _0x98e1=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','json','undefined','offset','limit','status','set','apply','reject','save','update','then','destroy','end','sendStatus','name','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params','keys','include','find'];(function(_0x43bae0,_0x423a55){var _0x4f3f35=function(_0x4eda45){while(--_0x4eda45){_0x43bae0['push'](_0x43bae0['shift']());}};_0x4f3f35(++_0x423a55);}(_0x98e1,0x160));var _0x198e=function(_0x4fc03c,_0x27b94d){_0x4fc03c=_0x4fc03c-0x0;var _0x212972=_0x98e1[_0x4fc03c];return _0x212972;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x198e('0x0'));var zipdir=require(_0x198e('0x1'));var jsonpatch=require(_0x198e('0x2'));var rp=require(_0x198e('0x3'));var moment=require('moment');var BPromise=require(_0x198e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x198e('0x5'));var sox=require(_0x198e('0x6'));var csv=require(_0x198e('0x7'));var ejs=require(_0x198e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x198e('0x9'));var crypto=require('crypto');var jsforce=require(_0x198e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x198e('0x7'));var querystring=require(_0x198e('0xb'));var Papa=require(_0x198e('0xc'));var Redis=require(_0x198e('0xd'));var authService=require(_0x198e('0xe'));var qs=require(_0x198e('0xf'));var as=require(_0x198e('0x10'));var hardwareService=require(_0x198e('0x11'));var logger=require(_0x198e('0x12'))('api');var utils=require(_0x198e('0x13'));var config=require(_0x198e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x198e('0x15'))['db'];function respondWithStatusCode(_0x4f85a9,_0x358746){_0x358746=_0x358746||0xcc;return function(_0x4ceda9){if(_0x4ceda9){return _0x4f85a9['sendStatus'](_0x358746);}return _0x4f85a9['status'](_0x358746)['end']();};}function respondWithResult(_0x1ccac7,_0x2c9017){_0x2c9017=_0x2c9017||0xc8;return function(_0x10d24e){if(_0x10d24e){return _0x1ccac7['status'](_0x2c9017)[_0x198e('0x16')](_0x10d24e);}};}function respondWithFilteredResult(_0x1675a3,_0x3b4101){return function(_0x5035de){if(_0x5035de){var _0x53e4c1=typeof _0x3b4101['offset']==='undefined'&&typeof _0x3b4101['limit']===_0x198e('0x17');var _0x58de5f=_0x5035de['count'];var _0x440975=_0x53e4c1?0x0:_0x3b4101[_0x198e('0x18')];var _0x2485ea=_0x53e4c1?_0x5035de['count']:_0x3b4101[_0x198e('0x18')]+_0x3b4101[_0x198e('0x19')];var _0x2fdc34;if(_0x2485ea>=_0x58de5f){_0x2485ea=_0x58de5f;_0x2fdc34=0xc8;}else{_0x2fdc34=0xce;}_0x1675a3[_0x198e('0x1a')](_0x2fdc34);return _0x1675a3[_0x198e('0x1b')]('Content-Range',_0x440975+'-'+_0x2485ea+'/'+_0x58de5f)[_0x198e('0x16')](_0x5035de);}return null;};}function patchUpdates(_0x1b7c84){return function(_0x59814c){try{jsonpatch[_0x198e('0x1c')](_0x59814c,_0x1b7c84,!![]);}catch(_0x26b32c){return BPromise[_0x198e('0x1d')](_0x26b32c);}return _0x59814c[_0x198e('0x1e')]();};}function saveUpdates(_0xec5453,_0x41e27f){return function(_0x503986){if(_0x503986){return _0x503986[_0x198e('0x1f')](_0xec5453)[_0x198e('0x20')](function(_0x3aecd5){return _0x3aecd5;});}return null;};}function removeEntity(_0x43042f,_0x17d04d){return function(_0x2ab945){if(_0x2ab945){return _0x2ab945[_0x198e('0x21')]()['then'](function(){_0x43042f[_0x198e('0x1a')](0xcc)[_0x198e('0x22')]();});}};}function handleEntityNotFound(_0x1fceba,_0x2ed96f){return function(_0xbd105b){if(!_0xbd105b){_0x1fceba[_0x198e('0x23')](0x194);}return _0xbd105b;};}function handleError(_0x302771,_0x436992){_0x436992=_0x436992||0x1f4;return function(_0x66c071){logger['error'](_0x66c071['stack']);if(_0x66c071[_0x198e('0x24')]){delete _0x66c071[_0x198e('0x24')];}_0x302771['status'](_0x436992)['send'](_0x66c071);};}exports[_0x198e('0x25')]=function(_0x1962ea,_0x337c73){var _0x505dd8={},_0x5e657e={},_0x37ee38={'count':0x0,'rows':[]};var _0x17a5b5=_[_0x198e('0x26')](db[_0x198e('0x27')][_0x198e('0x28')],function(_0x25e452){return{'name':_0x25e452[_0x198e('0x29')],'type':_0x25e452[_0x198e('0x2a')]['key']};});_0x5e657e[_0x198e('0x2b')]=_[_0x198e('0x26')](_0x17a5b5,_0x198e('0x24'));_0x5e657e['query']=_['keys'](_0x1962ea[_0x198e('0x2c')]);_0x5e657e[_0x198e('0x2d')]=_['intersection'](_0x5e657e[_0x198e('0x2b')],_0x5e657e[_0x198e('0x2c')]);_0x505dd8[_0x198e('0x2e')]=_[_0x198e('0x2f')](_0x5e657e[_0x198e('0x2b')],qs['fields'](_0x1962ea['query'][_0x198e('0x30')]));_0x505dd8['attributes']=_0x505dd8['attributes']['length']?_0x505dd8[_0x198e('0x2e')]:_0x5e657e[_0x198e('0x2b')];if(!_0x1962ea['query'][_0x198e('0x31')](_0x198e('0x32'))){_0x505dd8[_0x198e('0x19')]=qs['limit'](_0x1962ea[_0x198e('0x2c')][_0x198e('0x19')]);_0x505dd8[_0x198e('0x18')]=qs[_0x198e('0x18')](_0x1962ea[_0x198e('0x2c')][_0x198e('0x18')]);}_0x505dd8[_0x198e('0x33')]=qs[_0x198e('0x34')](_0x1962ea['query'][_0x198e('0x34')]);_0x505dd8[_0x198e('0x35')]=qs[_0x198e('0x2d')](_[_0x198e('0x36')](_0x1962ea[_0x198e('0x2c')],_0x5e657e[_0x198e('0x2d')]),_0x17a5b5);if(_0x1962ea[_0x198e('0x2c')][_0x198e('0x37')]){_0x505dd8[_0x198e('0x35')]=_[_0x198e('0x38')](_0x505dd8['where'],{'$or':_[_0x198e('0x26')](_0x17a5b5,function(_0x30ed1f){if(_0x30ed1f[_0x198e('0x2a')]!==_0x198e('0x39')){var _0x3a6910={};_0x3a6910[_0x30ed1f[_0x198e('0x24')]]={'$like':'%'+_0x1962ea[_0x198e('0x2c')]['filter']+'%'};return _0x3a6910;}})});}_0x505dd8=_[_0x198e('0x38')]({},_0x505dd8,_0x1962ea[_0x198e('0x3a')]);var _0x4d927f={'where':_0x505dd8[_0x198e('0x35')]};return db[_0x198e('0x27')][_0x198e('0x3b')](_0x4d927f)[_0x198e('0x20')](function(_0x23d622){_0x37ee38['count']=_0x23d622;if(_0x1962ea[_0x198e('0x2c')][_0x198e('0x3c')]){_0x505dd8['include']=[{'all':!![]}];}return db[_0x198e('0x27')][_0x198e('0x3d')](_0x505dd8);})[_0x198e('0x20')](function(_0x4f5871){_0x37ee38['rows']=_0x4f5871;return _0x37ee38;})[_0x198e('0x20')](respondWithFilteredResult(_0x337c73,_0x505dd8))[_0x198e('0x3e')](handleError(_0x337c73,null));};exports[_0x198e('0x3f')]=function(_0x218be5,_0x5a863b){var _0x4d46d0={'raw':!![],'where':{'id':_0x218be5[_0x198e('0x40')]['id']}},_0x3dcca6={};_0x3dcca6[_0x198e('0x2b')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x3dcca6[_0x198e('0x2c')]=_[_0x198e('0x41')](_0x218be5[_0x198e('0x2c')]);_0x3dcca6[_0x198e('0x2d')]=_[_0x198e('0x2f')](_0x3dcca6[_0x198e('0x2b')],_0x3dcca6[_0x198e('0x2c')]);_0x4d46d0[_0x198e('0x2e')]=_[_0x198e('0x2f')](_0x3dcca6[_0x198e('0x2b')],qs[_0x198e('0x30')](_0x218be5[_0x198e('0x2c')][_0x198e('0x30')]));_0x4d46d0[_0x198e('0x2e')]=_0x4d46d0[_0x198e('0x2e')]['length']?_0x4d46d0[_0x198e('0x2e')]:_0x3dcca6['model'];if(_0x218be5[_0x198e('0x2c')][_0x198e('0x3c')]){_0x4d46d0[_0x198e('0x42')]=[{'all':!![]}];}_0x4d46d0=_['merge']({},_0x4d46d0,_0x218be5[_0x198e('0x3a')]);return db['ZendeskField'][_0x198e('0x43')](_0x4d46d0)[_0x198e('0x20')](handleEntityNotFound(_0x5a863b,null))[_0x198e('0x20')](respondWithResult(_0x5a863b,null))[_0x198e('0x3e')](handleError(_0x5a863b,null));};exports[_0x198e('0x44')]=function(_0x42be4b,_0x10d688){return db['ZendeskField'][_0x198e('0x44')](_0x42be4b[_0x198e('0x45')],{})[_0x198e('0x20')](respondWithResult(_0x10d688,0xc9))[_0x198e('0x3e')](handleError(_0x10d688,null));};exports[_0x198e('0x1f')]=function(_0x3528c1,_0x3b85ea){if(_0x3528c1[_0x198e('0x45')]['id']){delete _0x3528c1[_0x198e('0x45')]['id'];}return db[_0x198e('0x27')][_0x198e('0x43')]({'where':{'id':_0x3528c1[_0x198e('0x40')]['id']}})['then'](handleEntityNotFound(_0x3b85ea,null))[_0x198e('0x20')](saveUpdates(_0x3528c1[_0x198e('0x45')],null))[_0x198e('0x20')](respondWithResult(_0x3b85ea,null))[_0x198e('0x3e')](handleError(_0x3b85ea,null));};exports[_0x198e('0x21')]=function(_0x462a62,_0x2b6e06){return db[_0x198e('0x27')]['find']({'where':{'id':_0x462a62[_0x198e('0x40')]['id']}})[_0x198e('0x20')](handleEntityNotFound(_0x2b6e06,null))['then'](removeEntity(_0x2b6e06,null))[_0x198e('0x3e')](handleError(_0x2b6e06,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 10b2fdb..4a57403 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 _0xeded=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x1598da,_0x3baab4){var _0x17df50=function(_0x49a650){while(--_0x49a650){_0x1598da['push'](_0x1598da['shift']());}};_0x17df50(++_0x3baab4);}(_0xeded,0x9b));var _0xdede=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeded[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var logger=require(_0xdede('0x2'))(_0xdede('0x3'));var moment=require(_0xdede('0x4'));var BPromise=require(_0xdede('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdede('0x6'));var rimraf=require('rimraf');var config=require(_0xdede('0x7'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x18f025,_0x311d26){return _0x18f025[_0xdede('0x8')](_0xdede('0x9'),attributes,{'tableName':_0xdede('0xa'),'paranoid':![],'indexes':[{'name':_0xdede('0xb'),'fields':[_0xdede('0xc'),_0xdede('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8316=['exports','ZendeskField','int_zendesk_fields','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4f2ee2,_0x1828cd){var _0x3b87d9=function(_0x2bd93e){while(--_0x2bd93e){_0x4f2ee2['push'](_0x4f2ee2['shift']());}};_0x3b87d9(++_0x1828cd);}(_0x8316,0x1e4));var _0x6831=function(_0x2feb04,_0x1bbe3e){_0x2feb04=_0x2feb04-0x0;var _0x5e92f1=_0x8316[_0x2feb04];return _0x5e92f1;};'use strict';var _=require(_0x6831('0x0'));var util=require(_0x6831('0x1'));var logger=require(_0x6831('0x2'))(_0x6831('0x3'));var moment=require(_0x6831('0x4'));var BPromise=require(_0x6831('0x5'));var rp=require(_0x6831('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6831('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x6831('0x8')]=function(_0x242403,_0x869c8b){return _0x242403['define'](_0x6831('0x9'),attributes,{'tableName':_0x6831('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x6831('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 68cfdd4..271a00f 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 _0xd0b4=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x3c005c,_0x24c507){var _0x43b35c=function(_0x50c316){while(--_0x50c316){_0x3c005c['push'](_0x3c005c['shift']());}};_0x43b35c(++_0x24c507);}(_0xd0b4,0xc5));var _0x4d0b=function(_0x3658ca,_0x6061d){_0x3658ca=_0x3658ca-0x0;var _0x4c2eea=_0xd0b4[_0x3658ca];return _0x4c2eea;};'use strict';var _=require(_0x4d0b('0x0'));var util=require(_0x4d0b('0x1'));var moment=require(_0x4d0b('0x2'));var BPromise=require(_0x4d0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d0b('0x4'));var db=require(_0x4d0b('0x5'))['db'];var utils=require(_0x4d0b('0x6'));var logger=require(_0x4d0b('0x7'))('rpc');var config=require(_0x4d0b('0x8'));var jayson=require(_0x4d0b('0x9'));var client=jayson[_0x4d0b('0xa')][_0x4d0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a8e70,_0x179625,_0x2a99d5){return new BPromise(function(_0x11cdcd,_0xfd8946){return client['request'](_0x1a8e70,_0x2a99d5)[_0x4d0b('0xc')](function(_0x3e40fc){logger[_0x4d0b('0xd')](_0x4d0b('0xe'),_0x179625,_0x4d0b('0xf'));logger[_0x4d0b('0x10')](_0x4d0b('0x11'),_0x179625,_0x4d0b('0xf'),JSON['stringify'](_0x3e40fc));if(_0x3e40fc[_0x4d0b('0x12')]){if(_0x3e40fc[_0x4d0b('0x12')]['code']===0x1f4){logger[_0x4d0b('0x12')](_0x4d0b('0xe'),_0x179625,_0x3e40fc['error'][_0x4d0b('0x13')]);return _0xfd8946(_0x3e40fc['error'][_0x4d0b('0x13')]);}logger[_0x4d0b('0x12')]('ZendeskField,\x20%s,\x20%s',_0x179625,_0x3e40fc[_0x4d0b('0x12')][_0x4d0b('0x13')]);return _0x11cdcd(_0x3e40fc['error'][_0x4d0b('0x13')]);}else{logger[_0x4d0b('0xd')](_0x4d0b('0xe'),_0x179625,_0x4d0b('0xf'));_0x11cdcd(_0x3e40fc[_0x4d0b('0x14')][_0x4d0b('0x13')]);}})['catch'](function(_0x327765){logger[_0x4d0b('0x12')](_0x4d0b('0xe'),_0x179625,_0x327765);_0xfd8946(_0x327765);});});} \ No newline at end of file +var _0x9ca7=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','ZendeskField,\x20%s,\x20%s','info','result','catch'];(function(_0xc945ec,_0xdd67ba){var _0x238e02=function(_0x2e2da9){while(--_0x2e2da9){_0xc945ec['push'](_0xc945ec['shift']());}};_0x238e02(++_0xdd67ba);}(_0x9ca7,0xe7));var _0x79ca=function(_0x11e2bd,_0xd27110){_0x11e2bd=_0x11e2bd-0x0;var _0x547afa=_0x9ca7[_0x11e2bd];return _0x547afa;};'use strict';var _=require(_0x79ca('0x0'));var util=require(_0x79ca('0x1'));var moment=require(_0x79ca('0x2'));var BPromise=require(_0x79ca('0x3'));var rs=require(_0x79ca('0x4'));var fs=require('fs');var Redis=require(_0x79ca('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x79ca('0x6'))(_0x79ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x79ca('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec10a,_0x44577d,_0x3b6d53){return new BPromise(function(_0x3d15d9,_0xc93e2d){return client[_0x79ca('0x9')](_0x1ec10a,_0x3b6d53)[_0x79ca('0xa')](function(_0x3b908a){logger['info']('ZendeskField,\x20%s,\x20%s',_0x44577d,_0x79ca('0xb'));logger[_0x79ca('0xc')](_0x79ca('0xd'),_0x44577d,'request\x20sent',JSON[_0x79ca('0xe')](_0x3b908a));if(_0x3b908a[_0x79ca('0xf')]){if(_0x3b908a[_0x79ca('0xf')]['code']===0x1f4){logger[_0x79ca('0xf')]('ZendeskField,\x20%s,\x20%s',_0x44577d,_0x3b908a[_0x79ca('0xf')][_0x79ca('0x10')]);return _0xc93e2d(_0x3b908a[_0x79ca('0xf')]['message']);}logger[_0x79ca('0xf')](_0x79ca('0x11'),_0x44577d,_0x3b908a[_0x79ca('0xf')][_0x79ca('0x10')]);return _0x3d15d9(_0x3b908a[_0x79ca('0xf')][_0x79ca('0x10')]);}else{logger[_0x79ca('0x12')](_0x79ca('0x11'),_0x44577d,_0x79ca('0xb'));_0x3d15d9(_0x3b908a[_0x79ca('0x13')][_0x79ca('0x10')]);}})[_0x79ca('0x14')](function(_0x3cf8a0){logger[_0x79ca('0xf')]('ZendeskField,\x20%s,\x20%s',_0x44577d,_0x3cf8a0);_0xc93e2d(_0x3cf8a0);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 97b2bad..e82db73 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 _0x9df9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','exports','multer'];(function(_0x5ae990,_0x392abb){var _0x369e88=function(_0x379c9c){while(--_0x379c9c){_0x5ae990['push'](_0x5ae990['shift']());}};_0x369e88(++_0x392abb);}(_0x9df9,0xf1));var _0x99df=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9df9[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0x99df('0x0'));var util=require(_0x99df('0x1'));var path=require(_0x99df('0x2'));var timeout=require(_0x99df('0x3'));var express=require(_0x99df('0x4'));var router=express[_0x99df('0x5')]();var fs_extra=require(_0x99df('0x6'));var auth=require(_0x99df('0x7'));var interaction=require(_0x99df('0x8'));var config=require(_0x99df('0x9'));var controller=require(_0x99df('0xa'));router[_0x99df('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x99df('0xb')](_0x99df('0xc'),auth[_0x99df('0xd')](),controller['show']);router[_0x99df('0xb')](_0x99df('0xe'),auth[_0x99df('0xd')](),controller[_0x99df('0xf')]);router[_0x99df('0xb')](_0x99df('0x10'),auth[_0x99df('0xd')](),controller[_0x99df('0x11')]);router[_0x99df('0x12')]('/',auth[_0x99df('0xd')](),controller[_0x99df('0x13')]);router[_0x99df('0x12')](_0x99df('0xe'),auth[_0x99df('0xd')](),controller['addConfiguration']);router['put'](_0x99df('0xc'),auth[_0x99df('0xd')](),controller[_0x99df('0x14')]);router['delete'](_0x99df('0xc'),auth[_0x99df('0xd')](),controller['destroy']);module[_0x99df('0x15')]=router; \ No newline at end of file +var _0xb34f=['/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x58e18a,_0x11e4e6){var _0x5e7b95=function(_0xabb925){while(--_0xabb925){_0x58e18a['push'](_0x58e18a['shift']());}};_0x5e7b95(++_0x11e4e6);}(_0xb34f,0xab));var _0xfb34=function(_0x4744fe,_0x216c35){_0x4744fe=_0x4744fe-0x0;var _0x465ef2=_0xb34f[_0x4744fe];return _0x465ef2;};'use strict';var multer=require(_0xfb34('0x0'));var util=require(_0xfb34('0x1'));var path=require(_0xfb34('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb34('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfb34('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfb34('0x5'));var controller=require(_0xfb34('0x6'));router[_0xfb34('0x7')]('/',auth[_0xfb34('0x8')](),controller['index']);router[_0xfb34('0x7')](_0xfb34('0x9'),auth[_0xfb34('0x8')](),controller[_0xfb34('0xa')]);router['get'](_0xfb34('0xb'),auth[_0xfb34('0x8')](),controller[_0xfb34('0xc')]);router[_0xfb34('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfb34('0xd')]);router[_0xfb34('0xe')]('/',auth[_0xfb34('0x8')](),controller[_0xfb34('0xf')]);router['post'](_0xfb34('0xb'),auth['isAuthenticated'](),controller[_0xfb34('0x10')]);router['put'](_0xfb34('0x9'),auth[_0xfb34('0x8')](),controller['update']);router[_0xfb34('0x11')](_0xfb34('0x9'),auth['isAuthenticated'](),controller[_0xfb34('0x12')]);module[_0xfb34('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2c69acf..929c55d 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 _0x17ba=['sequelize','exports','STRING'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x17ba,0xab));var _0xa17b=function(_0x2132f2,_0x47ca39){_0x2132f2=_0x2132f2-0x0;var _0x42bab7=_0x17ba[_0x2132f2];return _0x42bab7;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa17b('0x2')]},'host':{'type':Sequelize[_0xa17b('0x2')]},'zone':{'type':Sequelize[_0xa17b('0x2')]},'clientId':{'type':Sequelize[_0xa17b('0x2')]},'clientSecret':{'type':Sequelize[_0xa17b('0x2')]},'serverUrl':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xa17b('0x2')]},'refreshToken':{'type':Sequelize[_0xa17b('0x2')]}}; \ No newline at end of file +var _0xec56=['STRING','sequelize'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xec56,0x1bd));var _0x6ec5=function(_0x38976f,_0x1704fc){_0x38976f=_0x38976f-0x0;var _0x28b7d5=_0xec56[_0x38976f];return _0x28b7d5;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ec5('0x1')]},'host':{'type':Sequelize[_0x6ec5('0x1')]},'zone':{'type':Sequelize[_0x6ec5('0x1')]},'clientId':{'type':Sequelize[_0x6ec5('0x1')]},'clientSecret':{'type':Sequelize[_0x6ec5('0x1')]},'serverUrl':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x6ec5('0x1')]},'refreshToken':{'type':Sequelize[_0x6ec5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 9c84964..cafc7da 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 _0x5818=['attributes','length','hasOwnProperty','nolimit','where','filters','filter','merge','map','VIRTUAL','include','findAll','catch','show','params','includeAll','create','body','find','getConfigurations','ZohoConfiguration','order','sort','options','addConfiguration','findOne','AccountId','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','system_mandatory','push','display_label','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ZohoAccount','rawAttributes','type','model','keys','intersection','query','fields'];(function(_0x5c17f7,_0x563b18){var _0x135b3a=function(_0x3f4c7b){while(--_0x3f4c7b){_0x5c17f7['push'](_0x5c17f7['shift']());}};_0x135b3a(++_0x563b18);}(_0x5818,0x1b8));var _0x8581=function(_0x1cce3f,_0x55dcc6){_0x1cce3f=_0x1cce3f-0x0;var _0x31544c=_0x5818[_0x1cce3f];return _0x31544c;};'use strict';var emlformat=require(_0x8581('0x0'));var rimraf=require(_0x8581('0x1'));var zipdir=require(_0x8581('0x2'));var jsonpatch=require(_0x8581('0x3'));var rp=require(_0x8581('0x4'));var moment=require(_0x8581('0x5'));var BPromise=require(_0x8581('0x6'));var Mustache=require(_0x8581('0x7'));var util=require('util');var path=require(_0x8581('0x8'));var sox=require(_0x8581('0x9'));var csv=require(_0x8581('0xa'));var ejs=require(_0x8581('0xb'));var fs=require('fs');var fs_extra=require(_0x8581('0xc'));var _=require(_0x8581('0xd'));var squel=require(_0x8581('0xe'));var crypto=require('crypto');var jsforce=require(_0x8581('0xf'));var deskjs=require(_0x8581('0x10'));var toCsv=require(_0x8581('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8581('0x11'));var qs=require(_0x8581('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8581('0x13'))('api');var utils=require(_0x8581('0x14'));var config=require(_0x8581('0x15'));var licenseUtil=require(_0x8581('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8581('0x17'));function respondWithStatusCode(_0x417213,_0x3b3c75){_0x3b3c75=_0x3b3c75||0xcc;return function(_0x2f5ee0){if(_0x2f5ee0){return _0x417213[_0x8581('0x18')](_0x3b3c75);}return _0x417213[_0x8581('0x19')](_0x3b3c75)[_0x8581('0x1a')]();};}function respondWithResult(_0x5ab200,_0x6c0f0e){_0x6c0f0e=_0x6c0f0e||0xc8;return function(_0x3b8301){if(_0x3b8301){return _0x5ab200['status'](_0x6c0f0e)[_0x8581('0x1b')](_0x3b8301);}};}function respondWithFilteredResult(_0x10e9fe,_0x49c05a){return function(_0x282fcf){if(_0x282fcf){var _0x569391=typeof _0x49c05a['offset']===_0x8581('0x1c')&&typeof _0x49c05a[_0x8581('0x1d')]===_0x8581('0x1c');var _0x43b00a=_0x282fcf[_0x8581('0x1e')];var _0x50a146=_0x569391?0x0:_0x49c05a[_0x8581('0x1f')];var _0xbdf9cb=_0x569391?_0x282fcf[_0x8581('0x1e')]:_0x49c05a[_0x8581('0x1f')]+_0x49c05a[_0x8581('0x1d')];var _0x40d744;if(_0xbdf9cb>=_0x43b00a){_0xbdf9cb=_0x43b00a;_0x40d744=0xc8;}else{_0x40d744=0xce;}_0x10e9fe[_0x8581('0x19')](_0x40d744);return _0x10e9fe[_0x8581('0x20')](_0x8581('0x21'),_0x50a146+'-'+_0xbdf9cb+'/'+_0x43b00a)[_0x8581('0x1b')](_0x282fcf);}return null;};}function patchUpdates(_0x393286){return function(_0x25ad61){try{jsonpatch[_0x8581('0x22')](_0x25ad61,_0x393286,!![]);}catch(_0x3f4bd6){return BPromise[_0x8581('0x23')](_0x3f4bd6);}return _0x25ad61[_0x8581('0x24')]();};}function saveUpdates(_0x37203b,_0x2512f2){return function(_0x1ef0bf){if(_0x1ef0bf){return _0x1ef0bf[_0x8581('0x25')](_0x37203b)[_0x8581('0x26')](function(_0x511ae2){return _0x511ae2;});}return null;};}function removeEntity(_0x1ebbad,_0x24581c){return function(_0x25b40f){if(_0x25b40f){return _0x25b40f[_0x8581('0x27')]()['then'](function(){_0x1ebbad['status'](0xcc)[_0x8581('0x1a')]();});}};}function handleEntityNotFound(_0x5d9e7e,_0x24141b){return function(_0x3c27aa){if(!_0x3c27aa){_0x5d9e7e[_0x8581('0x18')](0x194);}return _0x3c27aa;};}function handleError(_0x36e036,_0x1c06ae){_0x1c06ae=_0x1c06ae||0x1f4;return function(_0x444452){logger[_0x8581('0x28')](_0x444452[_0x8581('0x29')]);if(_0x444452[_0x8581('0x2a')]){delete _0x444452['name'];}_0x36e036[_0x8581('0x19')](_0x1c06ae)[_0x8581('0x2b')](_0x444452);};}exports['index']=function(_0x141fc8,_0x35d7a2){var _0x35f3c3={},_0xa81e0f={},_0x4d57da={'count':0x0,'rows':[]};var _0xb05c49=_['map'](db[_0x8581('0x2c')][_0x8581('0x2d')],function(_0x152ecd){return{'name':_0x152ecd['fieldName'],'type':_0x152ecd[_0x8581('0x2e')]['key']};});_0xa81e0f[_0x8581('0x2f')]=_['map'](_0xb05c49,_0x8581('0x2a'));_0xa81e0f['query']=_[_0x8581('0x30')](_0x141fc8['query']);_0xa81e0f['filters']=_[_0x8581('0x31')](_0xa81e0f[_0x8581('0x2f')],_0xa81e0f[_0x8581('0x32')]);_0x35f3c3['attributes']=_[_0x8581('0x31')](_0xa81e0f[_0x8581('0x2f')],qs[_0x8581('0x33')](_0x141fc8['query'][_0x8581('0x33')]));_0x35f3c3[_0x8581('0x34')]=_0x35f3c3[_0x8581('0x34')][_0x8581('0x35')]?_0x35f3c3[_0x8581('0x34')]:_0xa81e0f[_0x8581('0x2f')];if(!_0x141fc8[_0x8581('0x32')][_0x8581('0x36')](_0x8581('0x37'))){_0x35f3c3[_0x8581('0x1d')]=qs[_0x8581('0x1d')](_0x141fc8[_0x8581('0x32')][_0x8581('0x1d')]);_0x35f3c3['offset']=qs['offset'](_0x141fc8['query'][_0x8581('0x1f')]);}_0x35f3c3['order']=qs['sort'](_0x141fc8['query']['sort']);_0x35f3c3[_0x8581('0x38')]=qs[_0x8581('0x39')](_['pick'](_0x141fc8[_0x8581('0x32')],_0xa81e0f[_0x8581('0x39')]),_0xb05c49);if(_0x141fc8['query'][_0x8581('0x3a')]){_0x35f3c3['where']=_[_0x8581('0x3b')](_0x35f3c3[_0x8581('0x38')],{'$or':_[_0x8581('0x3c')](_0xb05c49,function(_0x3c4328){if(_0x3c4328['type']!==_0x8581('0x3d')){var _0x2fda7f={};_0x2fda7f[_0x3c4328[_0x8581('0x2a')]]={'$like':'%'+_0x141fc8[_0x8581('0x32')][_0x8581('0x3a')]+'%'};return _0x2fda7f;}})});}_0x35f3c3=_['merge']({},_0x35f3c3,_0x141fc8['options']);var _0x55d526={'where':_0x35f3c3[_0x8581('0x38')]};return db['ZohoAccount'][_0x8581('0x1e')](_0x55d526)[_0x8581('0x26')](function(_0x41e089){_0x4d57da['count']=_0x41e089;if(_0x141fc8['query']['includeAll']){_0x35f3c3[_0x8581('0x3e')]=[{'all':!![]}];}return db['ZohoAccount'][_0x8581('0x3f')](_0x35f3c3);})[_0x8581('0x26')](function(_0x62273){_0x4d57da['rows']=_0x62273;return _0x4d57da;})[_0x8581('0x26')](respondWithFilteredResult(_0x35d7a2,_0x35f3c3))[_0x8581('0x40')](handleError(_0x35d7a2,null));};exports[_0x8581('0x41')]=function(_0x553b27,_0x2d6f8b){var _0x278b17={'raw':![],'where':{'id':_0x553b27[_0x8581('0x42')]['id']}},_0x47d631={};_0x47d631[_0x8581('0x2f')]=_[_0x8581('0x30')](db[_0x8581('0x2c')][_0x8581('0x2d')]);_0x47d631[_0x8581('0x32')]=_[_0x8581('0x30')](_0x553b27[_0x8581('0x32')]);_0x47d631['filters']=_[_0x8581('0x31')](_0x47d631[_0x8581('0x2f')],_0x47d631[_0x8581('0x32')]);_0x278b17[_0x8581('0x34')]=_['intersection'](_0x47d631[_0x8581('0x2f')],qs[_0x8581('0x33')](_0x553b27[_0x8581('0x32')][_0x8581('0x33')]));_0x278b17[_0x8581('0x34')]=_0x278b17[_0x8581('0x34')][_0x8581('0x35')]?_0x278b17[_0x8581('0x34')]:_0x47d631['model'];if(_0x553b27['query'][_0x8581('0x43')]){_0x278b17[_0x8581('0x3e')]=[{'all':!![]}];}_0x278b17=_[_0x8581('0x3b')]({},_0x278b17,_0x553b27['options']);return db[_0x8581('0x2c')]['find'](_0x278b17)[_0x8581('0x26')](handleEntityNotFound(_0x2d6f8b,null))['then'](respondWithResult(_0x2d6f8b,null))['catch'](handleError(_0x2d6f8b,null));};exports[_0x8581('0x44')]=function(_0x1acee1,_0x53a8dc){return db[_0x8581('0x2c')][_0x8581('0x44')](_0x1acee1[_0x8581('0x45')],{})[_0x8581('0x26')](respondWithResult(_0x53a8dc,0xc9))['catch'](handleError(_0x53a8dc,null));};exports[_0x8581('0x25')]=function(_0x5d7cc7,_0x6906bc){if(_0x5d7cc7[_0x8581('0x45')]['id']){delete _0x5d7cc7[_0x8581('0x45')]['id'];}return db['ZohoAccount'][_0x8581('0x46')]({'where':{'id':_0x5d7cc7['params']['id']}})['then'](handleEntityNotFound(_0x6906bc,null))[_0x8581('0x26')](saveUpdates(_0x5d7cc7[_0x8581('0x45')],null))['then'](respondWithResult(_0x6906bc,null))['catch'](handleError(_0x6906bc,null));};exports['destroy']=function(_0x313180,_0x18b2d6){return db['ZohoAccount']['find']({'where':{'id':_0x313180[_0x8581('0x42')]['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x18b2d6,null))[_0x8581('0x26')](removeEntity(_0x18b2d6,null))[_0x8581('0x40')](handleError(_0x18b2d6,null));};exports[_0x8581('0x47')]=function(_0x2f3743,_0x2e297b,_0x5ee70c){var _0x1d9e89={};var _0xb6e7f={};var _0x3df234;var _0x4ec756;return db[_0x8581('0x2c')]['findOne']({'where':{'id':_0x2f3743[_0x8581('0x42')]['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x2e297b,null))[_0x8581('0x26')](function(_0x1b107f){if(_0x1b107f){_0x3df234=_0x1b107f;_0xb6e7f[_0x8581('0x2f')]=_[_0x8581('0x30')](db[_0x8581('0x48')][_0x8581('0x2d')]);_0xb6e7f['query']=_[_0x8581('0x30')](_0x2f3743[_0x8581('0x32')]);_0xb6e7f[_0x8581('0x39')]=_[_0x8581('0x31')](_0xb6e7f[_0x8581('0x2f')],_0xb6e7f['query']);_0x1d9e89['attributes']=_[_0x8581('0x31')](_0xb6e7f['model'],qs[_0x8581('0x33')](_0x2f3743['query'][_0x8581('0x33')]));_0x1d9e89[_0x8581('0x34')]=_0x1d9e89['attributes'][_0x8581('0x35')]?_0x1d9e89[_0x8581('0x34')]:_0xb6e7f[_0x8581('0x2f')];_0x1d9e89[_0x8581('0x49')]=qs[_0x8581('0x4a')](_0x2f3743[_0x8581('0x32')][_0x8581('0x4a')]);_0x1d9e89[_0x8581('0x38')]=qs[_0x8581('0x39')](_['pick'](_0x2f3743[_0x8581('0x32')],_0xb6e7f[_0x8581('0x39')]));if(_0x2f3743[_0x8581('0x32')][_0x8581('0x3a')]){_0x1d9e89[_0x8581('0x38')]=_[_0x8581('0x3b')](_0x1d9e89[_0x8581('0x38')],{'$or':_['map'](_0x1d9e89[_0x8581('0x34')],function(_0x24e837){var _0xf988ea={};_0xf988ea[_0x24e837]={'$like':'%'+_0x2f3743[_0x8581('0x32')][_0x8581('0x3a')]+'%'};return _0xf988ea;})});}_0x1d9e89=_[_0x8581('0x3b')]({},_0x1d9e89,_0x2f3743[_0x8581('0x4b')]);return _0x3df234[_0x8581('0x47')](_0x1d9e89);}})[_0x8581('0x26')](function(_0x525539){if(_0x525539){_0x4ec756=_0x525539['length'];if(!_0x2f3743[_0x8581('0x32')][_0x8581('0x36')](_0x8581('0x37'))){_0x1d9e89[_0x8581('0x1d')]=qs[_0x8581('0x1d')](_0x2f3743[_0x8581('0x32')]['limit']);_0x1d9e89[_0x8581('0x1f')]=qs[_0x8581('0x1f')](_0x2f3743[_0x8581('0x32')]['offset']);}return _0x3df234[_0x8581('0x47')](_0x1d9e89);}})[_0x8581('0x26')](function(_0x423bb){if(_0x423bb){return _0x423bb?{'count':_0x4ec756,'rows':_0x423bb}:null;}})[_0x8581('0x26')](respondWithResult(_0x2e297b,null))[_0x8581('0x40')](handleError(_0x2e297b,null));};exports[_0x8581('0x4c')]=function(_0x5c1271,_0x5ec728,_0x333095){if(_0x5c1271[_0x8581('0x45')]['id']){delete _0x5c1271[_0x8581('0x45')]['id'];}return db['ZohoAccount'][_0x8581('0x4d')]({'where':{'id':_0x5c1271['params']['id']}})[_0x8581('0x26')](handleEntityNotFound(_0x5ec728,null))[_0x8581('0x26')](function(_0x1fa392){if(_0x1fa392){_0x5c1271['body'][_0x8581('0x4e')]=_0x1fa392['id'];_0x5c1271[_0x8581('0x45')]['Subjects']=integrations[_0x8581('0x4f')](_0x5c1271[_0x8581('0x45')][_0x8581('0x50')],_0x5c1271[_0x8581('0x45')]['type']);_0x5c1271[_0x8581('0x45')]['Descriptions']=integrations['getDescriptions'](_0x5c1271[_0x8581('0x45')][_0x8581('0x50')],_0x5c1271[_0x8581('0x45')][_0x8581('0x2e')]);return db[_0x8581('0x48')]['create'](_0x5c1271['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x8581('0x51')],'as':_0x8581('0x52')}]});}return null;})[_0x8581('0x26')](respondWithResult(_0x5ec728,null))[_0x8581('0x40')](handleError(_0x5ec728,null));};function getAccessToken(_0x170dc7){return new Promise(function(_0x57b04d,_0x2d0df4){var _0xecc78a;switch(_0x170dc7[_0x8581('0x53')]){case'US':_0xecc78a=_0x8581('0x54');break;case'AU':_0xecc78a=_0x8581('0x55');break;case'EU':_0xecc78a=_0x8581('0x56');break;case'IN':_0xecc78a=_0x8581('0x57');break;case'CN':_0xecc78a='https://accounts.zoho.com.cn';break;default:_0xecc78a=_0x8581('0x56');break;}var _0x15c8fd={'method':_0x8581('0x58'),'uri':_0xecc78a+'/oauth/v2/token','qs':{'refresh_token':_0x170dc7[_0x8581('0x59')],'client_id':_0x170dc7[_0x8581('0x5a')],'client_secret':_0x170dc7[_0x8581('0x5b')],'grant_type':_0x8581('0x5c')},'json':!![]};return rp(_0x15c8fd)[_0x8581('0x26')](function(_0x52d519){if(_0x52d519['access_token']){_0x57b04d(_0x52d519[_0x8581('0x5d')]);}else{_0x2d0df4(_0x8581('0x5e'));}})[_0x8581('0x40')](function(_0x3ef02d){_0x2d0df4(_0x3ef02d);});});}exports['getFields']=function(_0x47925a,_0x1e01e1,_0xa7afd4){var _0xcc77ee,_0x1438db,_0x5d85b9,_0x3addd8,_0x1461b1;return db[_0x8581('0x2c')][_0x8581('0x4d')]({'where':{'id':_0x47925a['params']['id']},'attributes':['id',_0x8581('0x5f'),'zone','clientId',_0x8581('0x5b'),_0x8581('0x60'),'code',_0x8581('0x59')]})['then'](handleEntityNotFound(_0x1e01e1,null))[_0x8581('0x26')](function(_0x2a31e1){_0x1461b1=_0x2a31e1;_0xcc77ee=_0x1461b1['host'];_0x1438db=_0xcc77ee===_0x8581('0x61')?'eu':_0x8581('0x62');_0x5d85b9=_0x1461b1[_0x8581('0x60')];var _0xd870c0=_0x5d85b9[_0x8581('0x63')](-0x1);if(_0xd870c0==='/'||_0xd870c0==='\x5c'||_0xd870c0===':'){_0x5d85b9=_0x5d85b9[_0x8581('0x64')](0x0,_0x5d85b9[_0x8581('0x65')](_0xd870c0));}if(!_0x1461b1[_0x8581('0x59')]){throw new Error(_0x8581('0x66'));}return getAccessToken(_0x1461b1);})['then'](function(_0x1156ef){if(_0x1156ef){return rp({'method':_0x8581('0x67'),'uri':util['format'](_0x8581('0x68'),_0x1438db),'qs':{'module':_0x8581('0x69')},'headers':{'Authorization':_0x8581('0x6a')+_0x1156ef},'json':!![]});}})['then'](function(_0x47a9c0){if(_0x47a9c0){if(_0x47a9c0['response']&&_0x47a9c0[_0x8581('0x6b')][_0x8581('0x28')]){throw new Error(_0x47a9c0[_0x8581('0x6b')]['error']['message']);}var _0x5e4aee=[];var _0x3e3b6a=[];var _0x275908=['Owner','Subject',_0x8581('0x6c'),_0x8581('0x6d'),_0x8581('0x6e'),_0x8581('0x6f'),_0x8581('0x70'),_0x8581('0x71')];_0x3e3b6a=_['remove'](_0x47a9c0[_0x8581('0x33')],function(_0x22622b){return _0x275908['includes'](_0x22622b['api_name']);});for(var _0x1743fc=0x0;_0x1743fc<_0x3e3b6a['length'];_0x1743fc++){if(_0x3e3b6a[_0x1743fc][_0x8581('0x72')]===![]){_0x5e4aee[_0x8581('0x73')]({'id':_0x3e3b6a[_0x1743fc]['id'],'name':_0x3e3b6a[_0x1743fc][_0x8581('0x74')],'custom':_0x3e3b6a[_0x1743fc]['custom_field'],'options':_0x3e3b6a[_0x1743fc]['data_type']===_0x8581('0x75')&&_0x3e3b6a[_0x1743fc][_0x8581('0x76')][_0x8581('0x35')]>-0x1?_['map'](_0x3e3b6a[_0x1743fc]['pick_list_values'],function(_0x462d39){return{'name':_0x462d39,'value':_0x462d39};}):[]});}}return{'count':_0x5e4aee[_0x8581('0x35')],'rows':_0x5e4aee};}else{return{'count':0x0,'rows':[]};}})[_0x8581('0x26')](respondWithResult(_0x1e01e1,null))[_0x8581('0x40')](function(_0x500c20){var _0x19a8df=_0x47925a[_0x8581('0x32')][_0x8581('0x77')]?0x1f4:_0x500c20['statusCode']||0x1f4;logger[_0x8581('0x28')](_0x8581('0x78'),_0x8581('0x79'),_0x19a8df,JSON['stringify'](_0x500c20));delete _0x500c20[_0x8581('0x2a')];if(_0x19a8df===0x191){_0x19a8df=0x190;}_0x1e01e1[_0x8581('0x19')](_0x19a8df)[_0x8581('0x2b')](_0x47925a[_0x8581('0x32')][_0x8581('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x500c20[_0x8581('0x7a')]}:_0x500c20);});}; \ No newline at end of file +var _0x853e=['https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','zone','serverUrl','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send','index','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','ZohoAccount','findAll','rows','catch','params','keys','find','create','body','update','getConfigurations','ZohoConfiguration','rawAttributes','addConfiguration','AccountId','getSubjects','channel','Descriptions','ZohoField','Subjects','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in'];(function(_0x1cde3d,_0x3a84d5){var _0x177f0c=function(_0x23d672){while(--_0x23d672){_0x1cde3d['push'](_0x1cde3d['shift']());}};_0x177f0c(++_0x3a84d5);}(_0x853e,0x1b8));var _0xe853=function(_0x41b325,_0x5e31d8){_0x41b325=_0x41b325-0x0;var _0x57e17f=_0x853e[_0x41b325];return _0x57e17f;};'use strict';var emlformat=require(_0xe853('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe853('0x1'));var jsonpatch=require(_0xe853('0x2'));var rp=require(_0xe853('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe853('0x4'));var util=require(_0xe853('0x5'));var path=require(_0xe853('0x6'));var sox=require(_0xe853('0x7'));var csv=require(_0xe853('0x8'));var ejs=require(_0xe853('0x9'));var fs=require('fs');var fs_extra=require(_0xe853('0xa'));var _=require(_0xe853('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require(_0xe853('0x8'));var querystring=require(_0xe853('0xe'));var Papa=require(_0xe853('0xf'));var Redis=require('ioredis');var authService=require(_0xe853('0x10'));var qs=require(_0xe853('0x11'));var as=require(_0xe853('0x12'));var hardwareService=require(_0xe853('0x13'));var logger=require('../../config/logger')(_0xe853('0x14'));var utils=require(_0xe853('0x15'));var config=require(_0xe853('0x16'));var licenseUtil=require(_0xe853('0x17'));var db=require(_0xe853('0x18'))['db'];var integrations=require(_0xe853('0x19'));function respondWithStatusCode(_0x14ca44,_0x11c302){_0x11c302=_0x11c302||0xcc;return function(_0x21e45b){if(_0x21e45b){return _0x14ca44[_0xe853('0x1a')](_0x11c302);}return _0x14ca44['status'](_0x11c302)[_0xe853('0x1b')]();};}function respondWithResult(_0x12fa6d,_0x58356d){_0x58356d=_0x58356d||0xc8;return function(_0xb0c2e2){if(_0xb0c2e2){return _0x12fa6d[_0xe853('0x1c')](_0x58356d)[_0xe853('0x1d')](_0xb0c2e2);}};}function respondWithFilteredResult(_0x25a384,_0x198ca0){return function(_0x46d3a7){if(_0x46d3a7){var _0x1131de=typeof _0x198ca0[_0xe853('0x1e')]===_0xe853('0x1f')&&typeof _0x198ca0[_0xe853('0x20')]===_0xe853('0x1f');var _0x22d9fe=_0x46d3a7[_0xe853('0x21')];var _0x49e463=_0x1131de?0x0:_0x198ca0['offset'];var _0x47e131=_0x1131de?_0x46d3a7[_0xe853('0x21')]:_0x198ca0[_0xe853('0x1e')]+_0x198ca0[_0xe853('0x20')];var _0x95db52;if(_0x47e131>=_0x22d9fe){_0x47e131=_0x22d9fe;_0x95db52=0xc8;}else{_0x95db52=0xce;}_0x25a384['status'](_0x95db52);return _0x25a384[_0xe853('0x22')](_0xe853('0x23'),_0x49e463+'-'+_0x47e131+'/'+_0x22d9fe)[_0xe853('0x1d')](_0x46d3a7);}return null;};}function patchUpdates(_0x50a4db){return function(_0x5d10f6){try{jsonpatch['apply'](_0x5d10f6,_0x50a4db,!![]);}catch(_0xf4731b){return BPromise['reject'](_0xf4731b);}return _0x5d10f6[_0xe853('0x24')]();};}function saveUpdates(_0xd5124e,_0x166646){return function(_0x3fc865){if(_0x3fc865){return _0x3fc865['update'](_0xd5124e)[_0xe853('0x25')](function(_0x5386c6){return _0x5386c6;});}return null;};}function removeEntity(_0x368dd7,_0x386546){return function(_0x3b2640){if(_0x3b2640){return _0x3b2640[_0xe853('0x26')]()['then'](function(){_0x368dd7['status'](0xcc)[_0xe853('0x1b')]();});}};}function handleEntityNotFound(_0x64a919,_0x25f1bb){return function(_0x5ccfb0){if(!_0x5ccfb0){_0x64a919['sendStatus'](0x194);}return _0x5ccfb0;};}function handleError(_0x4be5ed,_0x375efe){_0x375efe=_0x375efe||0x1f4;return function(_0x56cb8c){logger['error'](_0x56cb8c[_0xe853('0x27')]);if(_0x56cb8c[_0xe853('0x28')]){delete _0x56cb8c[_0xe853('0x28')];}_0x4be5ed[_0xe853('0x1c')](_0x375efe)[_0xe853('0x29')](_0x56cb8c);};}exports[_0xe853('0x2a')]=function(_0x440695,_0x5472bc){var _0x35639e={},_0x4b0d21={},_0x3a50fd={'count':0x0,'rows':[]};var _0x14685a=_['map'](db['ZohoAccount']['rawAttributes'],function(_0x4dcf2e){return{'name':_0x4dcf2e[_0xe853('0x2b')],'type':_0x4dcf2e['type'][_0xe853('0x2c')]};});_0x4b0d21[_0xe853('0x2d')]=_[_0xe853('0x2e')](_0x14685a,'name');_0x4b0d21[_0xe853('0x2f')]=_['keys'](_0x440695[_0xe853('0x2f')]);_0x4b0d21[_0xe853('0x30')]=_[_0xe853('0x31')](_0x4b0d21[_0xe853('0x2d')],_0x4b0d21[_0xe853('0x2f')]);_0x35639e['attributes']=_[_0xe853('0x31')](_0x4b0d21[_0xe853('0x2d')],qs['fields'](_0x440695[_0xe853('0x2f')][_0xe853('0x32')]));_0x35639e[_0xe853('0x33')]=_0x35639e[_0xe853('0x33')][_0xe853('0x34')]?_0x35639e[_0xe853('0x33')]:_0x4b0d21[_0xe853('0x2d')];if(!_0x440695[_0xe853('0x2f')][_0xe853('0x35')](_0xe853('0x36'))){_0x35639e['limit']=qs[_0xe853('0x20')](_0x440695[_0xe853('0x2f')]['limit']);_0x35639e['offset']=qs[_0xe853('0x1e')](_0x440695[_0xe853('0x2f')][_0xe853('0x1e')]);}_0x35639e[_0xe853('0x37')]=qs[_0xe853('0x38')](_0x440695['query']['sort']);_0x35639e[_0xe853('0x39')]=qs[_0xe853('0x30')](_[_0xe853('0x3a')](_0x440695['query'],_0x4b0d21[_0xe853('0x30')]),_0x14685a);if(_0x440695[_0xe853('0x2f')][_0xe853('0x3b')]){_0x35639e[_0xe853('0x39')]=_[_0xe853('0x3c')](_0x35639e['where'],{'$or':_[_0xe853('0x2e')](_0x14685a,function(_0x513186){if(_0x513186[_0xe853('0x3d')]!=='VIRTUAL'){var _0xb98328={};_0xb98328[_0x513186[_0xe853('0x28')]]={'$like':'%'+_0x440695[_0xe853('0x2f')][_0xe853('0x3b')]+'%'};return _0xb98328;}})});}_0x35639e=_[_0xe853('0x3c')]({},_0x35639e,_0x440695[_0xe853('0x3e')]);var _0x2ec696={'where':_0x35639e[_0xe853('0x39')]};return db['ZohoAccount'][_0xe853('0x21')](_0x2ec696)[_0xe853('0x25')](function(_0x2d490f){_0x3a50fd['count']=_0x2d490f;if(_0x440695[_0xe853('0x2f')][_0xe853('0x3f')]){_0x35639e[_0xe853('0x40')]=[{'all':!![]}];}return db[_0xe853('0x41')][_0xe853('0x42')](_0x35639e);})[_0xe853('0x25')](function(_0x59553a){_0x3a50fd[_0xe853('0x43')]=_0x59553a;return _0x3a50fd;})[_0xe853('0x25')](respondWithFilteredResult(_0x5472bc,_0x35639e))[_0xe853('0x44')](handleError(_0x5472bc,null));};exports['show']=function(_0x349df2,_0x517001){var _0x2bd414={'raw':![],'where':{'id':_0x349df2[_0xe853('0x45')]['id']}},_0x2f0b14={};_0x2f0b14[_0xe853('0x2d')]=_[_0xe853('0x46')](db['ZohoAccount']['rawAttributes']);_0x2f0b14['query']=_[_0xe853('0x46')](_0x349df2[_0xe853('0x2f')]);_0x2f0b14[_0xe853('0x30')]=_[_0xe853('0x31')](_0x2f0b14['model'],_0x2f0b14['query']);_0x2bd414['attributes']=_[_0xe853('0x31')](_0x2f0b14[_0xe853('0x2d')],qs[_0xe853('0x32')](_0x349df2[_0xe853('0x2f')]['fields']));_0x2bd414[_0xe853('0x33')]=_0x2bd414[_0xe853('0x33')][_0xe853('0x34')]?_0x2bd414['attributes']:_0x2f0b14[_0xe853('0x2d')];if(_0x349df2['query'][_0xe853('0x3f')]){_0x2bd414['include']=[{'all':!![]}];}_0x2bd414=_[_0xe853('0x3c')]({},_0x2bd414,_0x349df2['options']);return db[_0xe853('0x41')][_0xe853('0x47')](_0x2bd414)[_0xe853('0x25')](handleEntityNotFound(_0x517001,null))['then'](respondWithResult(_0x517001,null))[_0xe853('0x44')](handleError(_0x517001,null));};exports[_0xe853('0x48')]=function(_0x85ae86,_0x26c8f1){return db[_0xe853('0x41')][_0xe853('0x48')](_0x85ae86[_0xe853('0x49')],{})[_0xe853('0x25')](respondWithResult(_0x26c8f1,0xc9))['catch'](handleError(_0x26c8f1,null));};exports[_0xe853('0x4a')]=function(_0x42ead8,_0xf26cab){if(_0x42ead8['body']['id']){delete _0x42ead8[_0xe853('0x49')]['id'];}return db[_0xe853('0x41')][_0xe853('0x47')]({'where':{'id':_0x42ead8['params']['id']}})[_0xe853('0x25')](handleEntityNotFound(_0xf26cab,null))[_0xe853('0x25')](saveUpdates(_0x42ead8[_0xe853('0x49')],null))['then'](respondWithResult(_0xf26cab,null))[_0xe853('0x44')](handleError(_0xf26cab,null));};exports[_0xe853('0x26')]=function(_0x10662a,_0x5a975c){return db[_0xe853('0x41')][_0xe853('0x47')]({'where':{'id':_0x10662a[_0xe853('0x45')]['id']}})[_0xe853('0x25')](handleEntityNotFound(_0x5a975c,null))[_0xe853('0x25')](removeEntity(_0x5a975c,null))[_0xe853('0x44')](handleError(_0x5a975c,null));};exports[_0xe853('0x4b')]=function(_0x2e0f93,_0x3e2e99,_0x3f1375){var _0x1593c6={};var _0x4d7fba={};var _0x7a2c93;var _0xc314d6;return db[_0xe853('0x41')]['findOne']({'where':{'id':_0x2e0f93['params']['id']}})[_0xe853('0x25')](handleEntityNotFound(_0x3e2e99,null))['then'](function(_0x13bbe3){if(_0x13bbe3){_0x7a2c93=_0x13bbe3;_0x4d7fba['model']=_['keys'](db[_0xe853('0x4c')][_0xe853('0x4d')]);_0x4d7fba[_0xe853('0x2f')]=_[_0xe853('0x46')](_0x2e0f93[_0xe853('0x2f')]);_0x4d7fba[_0xe853('0x30')]=_['intersection'](_0x4d7fba['model'],_0x4d7fba[_0xe853('0x2f')]);_0x1593c6[_0xe853('0x33')]=_['intersection'](_0x4d7fba['model'],qs[_0xe853('0x32')](_0x2e0f93[_0xe853('0x2f')][_0xe853('0x32')]));_0x1593c6['attributes']=_0x1593c6[_0xe853('0x33')][_0xe853('0x34')]?_0x1593c6[_0xe853('0x33')]:_0x4d7fba[_0xe853('0x2d')];_0x1593c6['order']=qs[_0xe853('0x38')](_0x2e0f93[_0xe853('0x2f')][_0xe853('0x38')]);_0x1593c6['where']=qs[_0xe853('0x30')](_['pick'](_0x2e0f93[_0xe853('0x2f')],_0x4d7fba[_0xe853('0x30')]));if(_0x2e0f93[_0xe853('0x2f')]['filter']){_0x1593c6[_0xe853('0x39')]=_[_0xe853('0x3c')](_0x1593c6[_0xe853('0x39')],{'$or':_[_0xe853('0x2e')](_0x1593c6[_0xe853('0x33')],function(_0x35c5f1){var _0x4867cb={};_0x4867cb[_0x35c5f1]={'$like':'%'+_0x2e0f93[_0xe853('0x2f')][_0xe853('0x3b')]+'%'};return _0x4867cb;})});}_0x1593c6=_[_0xe853('0x3c')]({},_0x1593c6,_0x2e0f93['options']);return _0x7a2c93['getConfigurations'](_0x1593c6);}})[_0xe853('0x25')](function(_0x55be7a){if(_0x55be7a){_0xc314d6=_0x55be7a[_0xe853('0x34')];if(!_0x2e0f93[_0xe853('0x2f')][_0xe853('0x35')](_0xe853('0x36'))){_0x1593c6[_0xe853('0x20')]=qs[_0xe853('0x20')](_0x2e0f93[_0xe853('0x2f')][_0xe853('0x20')]);_0x1593c6['offset']=qs['offset'](_0x2e0f93[_0xe853('0x2f')]['offset']);}return _0x7a2c93[_0xe853('0x4b')](_0x1593c6);}})[_0xe853('0x25')](function(_0x5931d3){if(_0x5931d3){return _0x5931d3?{'count':_0xc314d6,'rows':_0x5931d3}:null;}})[_0xe853('0x25')](respondWithResult(_0x3e2e99,null))[_0xe853('0x44')](handleError(_0x3e2e99,null));};exports[_0xe853('0x4e')]=function(_0x3c74c5,_0x9c7dff,_0x3d59d5){if(_0x3c74c5['body']['id']){delete _0x3c74c5[_0xe853('0x49')]['id'];}return db[_0xe853('0x41')]['findOne']({'where':{'id':_0x3c74c5['params']['id']}})[_0xe853('0x25')](handleEntityNotFound(_0x9c7dff,null))['then'](function(_0x8cf9){if(_0x8cf9){_0x3c74c5[_0xe853('0x49')][_0xe853('0x4f')]=_0x8cf9['id'];_0x3c74c5[_0xe853('0x49')]['Subjects']=integrations[_0xe853('0x50')](_0x3c74c5[_0xe853('0x49')][_0xe853('0x51')],_0x3c74c5[_0xe853('0x49')][_0xe853('0x3d')]);_0x3c74c5[_0xe853('0x49')][_0xe853('0x52')]=integrations['getDescriptions'](_0x3c74c5['body'][_0xe853('0x51')],_0x3c74c5[_0xe853('0x49')]['type']);return db[_0xe853('0x4c')][_0xe853('0x48')](_0x3c74c5[_0xe853('0x49')],{'include':[{'model':db[_0xe853('0x53')],'as':_0xe853('0x54')},{'model':db[_0xe853('0x53')],'as':_0xe853('0x52')}]});}return null;})[_0xe853('0x25')](respondWithResult(_0x9c7dff,null))[_0xe853('0x44')](handleError(_0x9c7dff,null));};function getAccessToken(_0x3a3fc2){return new Promise(function(_0x20238a,_0x157d4b){var _0x1a2f28;switch(_0x3a3fc2['zone']){case'US':_0x1a2f28='https://accounts.zoho.com';break;case'AU':_0x1a2f28=_0xe853('0x55');break;case'EU':_0x1a2f28=_0xe853('0x56');break;case'IN':_0x1a2f28=_0xe853('0x57');break;case'CN':_0x1a2f28=_0xe853('0x58');break;default:_0x1a2f28='https://accounts.zoho.eu';break;}var _0x5adc89={'method':'POST','uri':_0x1a2f28+_0xe853('0x59'),'qs':{'refresh_token':_0x3a3fc2[_0xe853('0x5a')],'client_id':_0x3a3fc2[_0xe853('0x5b')],'client_secret':_0x3a3fc2[_0xe853('0x5c')],'grant_type':_0xe853('0x5d')},'json':!![]};return rp(_0x5adc89)[_0xe853('0x25')](function(_0x4483f4){if(_0x4483f4['access_token']){_0x20238a(_0x4483f4[_0xe853('0x5e')]);}else{_0x157d4b(_0xe853('0x5f'));}})[_0xe853('0x44')](function(_0x4dc1af){_0x157d4b(_0x4dc1af);});});}exports[_0xe853('0x60')]=function(_0x25c595,_0x1d3a2b,_0x44a960){var _0x142b55,_0x1b1661,_0x55660c,_0x1412a7,_0x462e0c;return db[_0xe853('0x41')][_0xe853('0x61')]({'where':{'id':_0x25c595['params']['id']},'attributes':['id',_0xe853('0x62'),_0xe853('0x63'),'clientId',_0xe853('0x5c'),_0xe853('0x64'),'code',_0xe853('0x5a')]})['then'](handleEntityNotFound(_0x1d3a2b,null))['then'](function(_0x5b5e15){_0x462e0c=_0x5b5e15;_0x142b55=_0x462e0c['host'];_0x1b1661=_0x142b55===_0xe853('0x65')?'eu':_0xe853('0x66');_0x55660c=_0x462e0c[_0xe853('0x64')];var _0x1d5868=_0x55660c[_0xe853('0x67')](-0x1);if(_0x1d5868==='/'||_0x1d5868==='\x5c'||_0x1d5868===':'){_0x55660c=_0x55660c[_0xe853('0x68')](0x0,_0x55660c['lastIndexOf'](_0x1d5868));}if(!_0x462e0c[_0xe853('0x5a')]){throw new Error(_0xe853('0x69'));}return getAccessToken(_0x462e0c);})['then'](function(_0xe40537){if(_0xe40537){return rp({'method':_0xe853('0x6a'),'uri':util[_0xe853('0x6b')](_0xe853('0x6c'),_0x1b1661),'qs':{'module':_0xe853('0x6d')},'headers':{'Authorization':_0xe853('0x6e')+_0xe40537},'json':!![]});}})['then'](function(_0xf0f1e7){if(_0xf0f1e7){if(_0xf0f1e7[_0xe853('0x6f')]&&_0xf0f1e7[_0xe853('0x6f')][_0xe853('0x70')]){throw new Error(_0xf0f1e7[_0xe853('0x6f')][_0xe853('0x70')][_0xe853('0x71')]);}var _0x50f523=[];var _0x4b7cb9=[];var _0x262b73=[_0xe853('0x72'),'Subject','Description',_0xe853('0x73'),_0xe853('0x74'),_0xe853('0x75'),_0xe853('0x76'),_0xe853('0x77')];_0x4b7cb9=_[_0xe853('0x78')](_0xf0f1e7['fields'],function(_0x14048a){return _0x262b73[_0xe853('0x79')](_0x14048a[_0xe853('0x7a')]);});for(var _0x7d113f=0x0;_0x7d113f<_0x4b7cb9[_0xe853('0x34')];_0x7d113f++){if(_0x4b7cb9[_0x7d113f][_0xe853('0x7b')]===![]){_0x50f523[_0xe853('0x7c')]({'id':_0x4b7cb9[_0x7d113f]['id'],'name':_0x4b7cb9[_0x7d113f]['display_label'],'custom':_0x4b7cb9[_0x7d113f][_0xe853('0x7d')],'options':_0x4b7cb9[_0x7d113f]['data_type']===_0xe853('0x7e')&&_0x4b7cb9[_0x7d113f][_0xe853('0x7f')][_0xe853('0x34')]>-0x1?_[_0xe853('0x2e')](_0x4b7cb9[_0x7d113f]['pick_list_values'],function(_0x2fcfdb){return{'name':_0x2fcfdb,'value':_0x2fcfdb};}):[]});}}return{'count':_0x50f523[_0xe853('0x34')],'rows':_0x50f523};}else{return{'count':0x0,'rows':[]};}})[_0xe853('0x25')](respondWithResult(_0x1d3a2b,null))[_0xe853('0x44')](function(_0x24d24e){var _0x325e74=_0x25c595[_0xe853('0x2f')]['test']?0x1f4:_0x24d24e['statusCode']||0x1f4;logger[_0xe853('0x70')](_0xe853('0x80'),_0xe853('0x60'),_0x325e74,JSON[_0xe853('0x81')](_0x24d24e));delete _0x24d24e[_0xe853('0x28')];if(_0x325e74===0x191){_0x325e74=0x190;}_0x1d3a2b['status'](_0x325e74)[_0xe853('0x29')](_0x25c595[_0xe853('0x2f')]['test']?{'message':_0xe853('0x82'),'statusCode':_0x24d24e[_0xe853('0x83')]}:_0x24d24e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e4bc6a4..645a071 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 _0xe959=['https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','inspect','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','then','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','code','host','slice','substring','https://accounts.zoho.com'];(function(_0x53361f,_0x3b2cb6){var _0x279237=function(_0x317757){while(--_0x317757){_0x53361f['push'](_0x53361f['shift']());}};_0x279237(++_0x3b2cb6);}(_0xe959,0x143));var _0x9e95=function(_0x50ea53,_0x464069){_0x50ea53=_0x50ea53-0x0;var _0x50ec2d=_0xe959[_0x50ea53];return _0x50ec2d;};'use strict';var _=require(_0x9e95('0x0'));var util=require(_0x9e95('0x1'));var logger=require(_0x9e95('0x2'))(_0x9e95('0x3'));var moment=require(_0x9e95('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e95('0x5'));var rimraf=require('rimraf');var config=require(_0x9e95('0x6'));var attributes=require(_0x9e95('0x7'));var integrations=require(_0x9e95('0x8'));module[_0x9e95('0x9')]=function(_0x4fa7df,_0x1f53fa){return _0x4fa7df[_0x9e95('0xa')](_0x9e95('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x136f5a,_0x3769aa,_0x249418){if(_0x136f5a[_0x9e95('0xc')](_0x9e95('0xd'))||_0x136f5a[_0x9e95('0xc')](_0x9e95('0xe'))||_0x136f5a['changed'](_0x9e95('0xf'))||_0x136f5a[_0x9e95('0xc')]('clientSecret')||_0x136f5a['changed'](_0x9e95('0x10'))||_0x136f5a[_0x9e95('0xc')](_0x9e95('0x11'))){var _0x270822,_0x5cb111;_0x270822=_0x136f5a[_0x9e95('0xe')];var _0x2cf1e2=_0x270822[_0x9e95('0x12')](-0x1);if(_0x2cf1e2==='/'||_0x2cf1e2==='\x5c'||_0x2cf1e2===':'){_0x270822=_0x270822[_0x9e95('0x13')](0x0,_0x270822['lastIndexOf'](_0x2cf1e2));}switch(_0x136f5a[_0x9e95('0xd')]){case'US':_0x5cb111=_0x9e95('0x14');break;case'AU':_0x5cb111='https://accounts.zoho.com.au';break;case'IN':_0x5cb111='https://accounts.zoho.in';break;case'CN':_0x5cb111=_0x9e95('0x15');break;default:_0x5cb111=_0x9e95('0x16');break;}var _0x47a5a1={'method':_0x9e95('0x17'),'uri':_0x5cb111+_0x9e95('0x18'),'form':{'grant_type':_0x9e95('0x19'),'client_id':_0x136f5a['clientId'],'client_secret':_0x136f5a[_0x9e95('0x1a')],'redirect_uri':_0x136f5a[_0x9e95('0xe')],'code':_0x136f5a[_0x9e95('0x10')]},'headers':{'Content-Type':_0x9e95('0x1b')}};return rp(_0x47a5a1)['then'](function(_0x41cf7f){var _0x46e287=JSON[_0x9e95('0x1c')](_0x41cf7f);if(_0x46e287[_0x9e95('0x1d')]){_0x136f5a[_0x9e95('0x1e')]=_0x46e287['refresh_token'];logger[_0x9e95('0x1f')](util[_0x9e95('0x20')](_0x9e95('0x21'),_0x136f5a['name'],_0x136f5a['id']));}else{logger[_0x9e95('0x22')](util['format'](_0x9e95('0x23'),_0x136f5a[_0x9e95('0x24')],_0x136f5a['id']),util['inspect'](_0x46e287,{'showHidden':![],'depth':null}));}return _0x249418(null,_0x3769aa);})[_0x9e95('0x25')](function(_0x40ab62){logger[_0x9e95('0x22')](util[_0x9e95('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x136f5a[_0x9e95('0x24')],_0x136f5a['id']),util[_0x9e95('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x249418(_0x40ab62);});}else{return _0x249418(null,_0x3769aa);}},'beforeUpdate':function(_0xe2f7d4,_0x2b9007,_0x15788c){if(_0xe2f7d4['changed']('zone')||_0xe2f7d4['changed'](_0x9e95('0xe'))||_0xe2f7d4['changed'](_0x9e95('0xf'))||_0xe2f7d4[_0x9e95('0xc')](_0x9e95('0x1a'))||_0xe2f7d4[_0x9e95('0xc')]('code')||_0xe2f7d4['changed']('host')){var _0x5c9df5,_0xad3221;_0x5c9df5=_0xe2f7d4['serverUrl'];var _0x515def=_0x5c9df5['slice'](-0x1);if(_0x515def==='/'||_0x515def==='\x5c'||_0x515def===':'){_0x5c9df5=_0x5c9df5[_0x9e95('0x13')](0x0,_0x5c9df5[_0x9e95('0x27')](_0x515def));}switch(_0xe2f7d4[_0x9e95('0xd')]){case'US':_0xad3221=_0x9e95('0x14');break;case'AU':_0xad3221=_0x9e95('0x28');break;case'IN':_0xad3221=_0x9e95('0x29');break;case'CN':_0xad3221=_0x9e95('0x15');break;default:_0xad3221='https://accounts.zoho.eu';break;}var _0x5e2d5c={'method':_0x9e95('0x17'),'uri':_0xad3221+_0x9e95('0x18'),'form':{'grant_type':_0x9e95('0x19'),'client_id':_0xe2f7d4[_0x9e95('0xf')],'client_secret':_0xe2f7d4[_0x9e95('0x1a')],'redirect_uri':_0xe2f7d4['serverUrl'],'code':_0xe2f7d4[_0x9e95('0x10')]},'headers':{'Content-Type':_0x9e95('0x1b')}};return rp(_0x5e2d5c)[_0x9e95('0x2a')](function(_0x513b0b){var _0x3bc582=JSON[_0x9e95('0x1c')](_0x513b0b);if(_0x3bc582[_0x9e95('0x1d')]){_0xe2f7d4[_0x9e95('0x1e')]=_0x3bc582['refresh_token'];logger[_0x9e95('0x1f')](util[_0x9e95('0x20')](_0x9e95('0x21'),_0xe2f7d4[_0x9e95('0x24')],_0xe2f7d4['id']));}else{logger['error'](util[_0x9e95('0x20')](_0x9e95('0x23'),_0xe2f7d4[_0x9e95('0x24')],_0xe2f7d4['id']),util[_0x9e95('0x26')](_0x3bc582,{'showHidden':![],'depth':null}));}return _0x15788c(null,_0x2b9007);})[_0x9e95('0x25')](function(_0x2b76bb){logger['error'](util[_0x9e95('0x20')](_0x9e95('0x23'),_0xe2f7d4[_0x9e95('0x24')],_0xe2f7d4['id']),util[_0x9e95('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x15788c(_0x2b76bb);});}else{return _0x15788c(null,_0x2b9007);}}}});}; \ No newline at end of file +var _0xa7ae=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refresh_token','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','POST','/oauth/v2/token','authorization_code','clientId','code','application/x-www-form-urlencoded','then','parse','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x3b6487,_0x5df255){var _0xf60189=function(_0x59df56){while(--_0x59df56){_0x3b6487['push'](_0x3b6487['shift']());}};_0xf60189(++_0x5df255);}(_0xa7ae,0xb0));var _0xea7a=function(_0x5eef56,_0xdb0274){_0x5eef56=_0x5eef56-0x0;var _0x59b533=_0xa7ae[_0x5eef56];return _0x59b533;};'use strict';var _=require(_0xea7a('0x0'));var util=require(_0xea7a('0x1'));var logger=require(_0xea7a('0x2'))(_0xea7a('0x3'));var moment=require(_0xea7a('0x4'));var BPromise=require(_0xea7a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xea7a('0x6'));var config=require(_0xea7a('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xea7a('0x8'));module[_0xea7a('0x9')]=function(_0x2dcb22,_0x5f5588){return _0x2dcb22['define'](_0xea7a('0xa'),attributes,{'tableName':_0xea7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4446af,_0x1b720c,_0x8edaef){if(_0x4446af[_0xea7a('0xc')]('zone')||_0x4446af[_0xea7a('0xc')](_0xea7a('0xd'))||_0x4446af[_0xea7a('0xc')]('clientId')||_0x4446af[_0xea7a('0xc')](_0xea7a('0xe'))||_0x4446af['changed']('code')||_0x4446af['changed'](_0xea7a('0xf'))){var _0x2c8405,_0x50ebda;_0x2c8405=_0x4446af[_0xea7a('0xd')];var _0x2a95d2=_0x2c8405['slice'](-0x1);if(_0x2a95d2==='/'||_0x2a95d2==='\x5c'||_0x2a95d2===':'){_0x2c8405=_0x2c8405[_0xea7a('0x10')](0x0,_0x2c8405[_0xea7a('0x11')](_0x2a95d2));}switch(_0x4446af[_0xea7a('0x12')]){case'US':_0x50ebda=_0xea7a('0x13');break;case'AU':_0x50ebda=_0xea7a('0x14');break;case'IN':_0x50ebda='https://accounts.zoho.in';break;case'CN':_0x50ebda='https://accounts.zoho.com.cn';break;default:_0x50ebda='https://accounts.zoho.eu';break;}var _0x44555f={'method':_0xea7a('0x15'),'uri':_0x50ebda+_0xea7a('0x16'),'form':{'grant_type':_0xea7a('0x17'),'client_id':_0x4446af[_0xea7a('0x18')],'client_secret':_0x4446af['clientSecret'],'redirect_uri':_0x4446af[_0xea7a('0xd')],'code':_0x4446af[_0xea7a('0x19')]},'headers':{'Content-Type':_0xea7a('0x1a')}};return rp(_0x44555f)[_0xea7a('0x1b')](function(_0x1eb9cd){var _0x5c977d=JSON[_0xea7a('0x1c')](_0x1eb9cd);if(_0x5c977d['refresh_token']){_0x4446af['refreshToken']=_0x5c977d['refresh_token'];logger[_0xea7a('0x1d')](util[_0xea7a('0x1e')](_0xea7a('0x1f'),_0x4446af[_0xea7a('0x20')],_0x4446af['id']));}else{logger[_0xea7a('0x21')](util[_0xea7a('0x1e')](_0xea7a('0x22'),_0x4446af[_0xea7a('0x20')],_0x4446af['id']),util[_0xea7a('0x23')](_0x5c977d,{'showHidden':![],'depth':null}));}return _0x8edaef(null,_0x1b720c);})[_0xea7a('0x24')](function(_0x556e6f){logger[_0xea7a('0x21')](util[_0xea7a('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4446af[_0xea7a('0x20')],_0x4446af['id']),util[_0xea7a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x8edaef(_0x556e6f);});}else{return _0x8edaef(null,_0x1b720c);}},'beforeUpdate':function(_0x368fc8,_0x4e3c1d,_0xae9244){if(_0x368fc8[_0xea7a('0xc')]('zone')||_0x368fc8[_0xea7a('0xc')](_0xea7a('0xd'))||_0x368fc8[_0xea7a('0xc')]('clientId')||_0x368fc8[_0xea7a('0xc')](_0xea7a('0xe'))||_0x368fc8[_0xea7a('0xc')](_0xea7a('0x19'))||_0x368fc8[_0xea7a('0xc')](_0xea7a('0xf'))){var _0x875fb1,_0x341562;_0x875fb1=_0x368fc8['serverUrl'];var _0x5e1e14=_0x875fb1[_0xea7a('0x25')](-0x1);if(_0x5e1e14==='/'||_0x5e1e14==='\x5c'||_0x5e1e14===':'){_0x875fb1=_0x875fb1[_0xea7a('0x10')](0x0,_0x875fb1[_0xea7a('0x11')](_0x5e1e14));}switch(_0x368fc8[_0xea7a('0x12')]){case'US':_0x341562=_0xea7a('0x13');break;case'AU':_0x341562=_0xea7a('0x14');break;case'IN':_0x341562='https://accounts.zoho.in';break;case'CN':_0x341562=_0xea7a('0x26');break;default:_0x341562=_0xea7a('0x27');break;}var _0x1c7534={'method':'POST','uri':_0x341562+_0xea7a('0x16'),'form':{'grant_type':_0xea7a('0x17'),'client_id':_0x368fc8[_0xea7a('0x18')],'client_secret':_0x368fc8['clientSecret'],'redirect_uri':_0x368fc8['serverUrl'],'code':_0x368fc8[_0xea7a('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1c7534)[_0xea7a('0x1b')](function(_0x3cdd8d){var _0x27e24a=JSON[_0xea7a('0x1c')](_0x3cdd8d);if(_0x27e24a[_0xea7a('0x28')]){_0x368fc8[_0xea7a('0x29')]=_0x27e24a[_0xea7a('0x28')];logger[_0xea7a('0x1d')](util[_0xea7a('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x368fc8[_0xea7a('0x20')],_0x368fc8['id']));}else{logger[_0xea7a('0x21')](util[_0xea7a('0x1e')](_0xea7a('0x22'),_0x368fc8[_0xea7a('0x20')],_0x368fc8['id']),util['inspect'](_0x27e24a,{'showHidden':![],'depth':null}));}return _0xae9244(null,_0x4e3c1d);})[_0xea7a('0x24')](function(_0x3d9515){logger[_0xea7a('0x21')](util[_0xea7a('0x1e')](_0xea7a('0x22'),_0x368fc8[_0xea7a('0x20')],_0x368fc8['id']),util[_0xea7a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xae9244(_0x3d9515);});}else{return _0xae9244(null,_0x4e3c1d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 74e4795..663ff99 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 _0x97ce=['ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','ShowZohoAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x97ce,0x151));var _0xe97c=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x97ce[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});}exports['GetZohoAccount']=function(_0x42d95c){var _0x1ceb22=this;return new Promise(function(_0x22054c,_0x4ca281){return db[_0xe97c('0x17')][_0xe97c('0x18')]({'raw':_0x42d95c[_0xe97c('0x19')]?_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1a')]===undefined?!![]:![]:!![],'where':_0x42d95c['options']?_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1b')]||null:null,'attributes':_0x42d95c[_0xe97c('0x19')]?_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1c')]||null:null,'limit':_0x42d95c[_0xe97c('0x19')]?_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1d')]||null:null,'include':_0x42d95c[_0xe97c('0x19')]?_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1e')]?_[_0xe97c('0x1f')](_0x42d95c[_0xe97c('0x19')][_0xe97c('0x1e')],function(_0x3b957c){return{'model':db[_0x3b957c[_0xe97c('0x20')]],'as':_0x3b957c['as'],'attributes':_0x3b957c[_0xe97c('0x1c')],'include':_0x3b957c[_0xe97c('0x1e')]?_[_0xe97c('0x1f')](_0x3b957c['include'],function(_0x23ff1d){return{'model':db[_0x23ff1d[_0xe97c('0x20')]],'as':_0x23ff1d['as'],'attributes':_0x23ff1d[_0xe97c('0x1c')],'include':_0x23ff1d[_0xe97c('0x1e')]?_[_0xe97c('0x1f')](_0x23ff1d[_0xe97c('0x1e')],function(_0x42729e){return{'model':db[_0x42729e[_0xe97c('0x20')]],'as':_0x42729e['as'],'attributes':_0x42729e[_0xe97c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe97c('0xb')](function(_0x1684d3){logger[_0xe97c('0xc')]('GetZohoAccount',_0x42d95c);logger['debug'](_0xe97c('0x21'),_0x42d95c,JSON[_0xe97c('0x11')](_0x1684d3));_0x22054c(_0x1684d3);})[_0xe97c('0x16')](function(_0x27cfae){logger[_0xe97c('0x12')](_0xe97c('0x21'),_0x27cfae[_0xe97c('0x14')],_0x42d95c);_0x4ca281(_0x1ceb22['error'](0x1f4,_0x27cfae['message']));});});};exports[_0xe97c('0x22')]=function(_0x36536c){var _0x44c900=this;return new Promise(function(_0x2a21a9,_0x49d973){return db['ZohoAccount'][_0xe97c('0x23')]({'raw':_0x36536c[_0xe97c('0x19')]?_0x36536c[_0xe97c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x36536c['options']?_0x36536c[_0xe97c('0x19')][_0xe97c('0x1b')]||null:null,'attributes':_0x36536c[_0xe97c('0x19')]?_0x36536c[_0xe97c('0x19')][_0xe97c('0x1c')]||null:null,'include':_0x36536c[_0xe97c('0x19')]?_0x36536c[_0xe97c('0x19')]['include']?_[_0xe97c('0x1f')](_0x36536c[_0xe97c('0x19')]['include'],function(_0x32a7f6){return{'model':db[_0x32a7f6[_0xe97c('0x20')]],'as':_0x32a7f6['as'],'attributes':_0x32a7f6[_0xe97c('0x1c')],'include':_0x32a7f6[_0xe97c('0x1e')]?_[_0xe97c('0x1f')](_0x32a7f6[_0xe97c('0x1e')],function(_0x13f152){return{'model':db[_0x13f152[_0xe97c('0x20')]],'as':_0x13f152['as'],'attributes':_0x13f152['attributes'],'include':_0x13f152['include']?_[_0xe97c('0x1f')](_0x13f152[_0xe97c('0x1e')],function(_0x437755){return{'model':db[_0x437755[_0xe97c('0x20')]],'as':_0x437755['as'],'attributes':_0x437755['attributes']};}):[]};}):[]};}):[]:[]})[_0xe97c('0xb')](function(_0x57db43){logger[_0xe97c('0xc')](_0xe97c('0x22'),_0x36536c);logger[_0xe97c('0xf')]('ShowZohoAccount',_0x36536c,JSON[_0xe97c('0x11')](_0x57db43));_0x2a21a9(_0x57db43);})[_0xe97c('0x16')](function(_0x412e0a){logger[_0xe97c('0x12')](_0xe97c('0x22'),_0x412e0a['message'],_0x36536c);_0x49d973(_0x44c900[_0xe97c('0x12')](0x1f4,_0x412e0a[_0xe97c('0x14')]));});});}; \ No newline at end of file +var _0x5386=['map','model','GetZohoAccount','ShowZohoAccount','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ZohoAccount','options','raw','where','attributes','include'];(function(_0x22dae4,_0x51d7a4){var _0x5862ff=function(_0x26ee03){while(--_0x26ee03){_0x22dae4['push'](_0x22dae4['shift']());}};_0x5862ff(++_0x51d7a4);}(_0x5386,0x1e1));var _0x6538=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x5386[_0x3e4db1];return _0x33ecd5;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var moment=require(_0x6538('0x2'));var BPromise=require(_0x6538('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6538('0x4'));var db=require(_0x6538('0x5'))['db'];var utils=require(_0x6538('0x6'));var logger=require(_0x6538('0x7'))(_0x6538('0x8'));var config=require(_0x6538('0x9'));var jayson=require(_0x6538('0xa'));var client=jayson[_0x6538('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16c291,_0x4b0e05,_0x16d67){return new BPromise(function(_0x28e83b,_0x113fe4){return client[_0x6538('0xc')](_0x16c291,_0x16d67)[_0x6538('0xd')](function(_0x2bce05){logger[_0x6538('0xe')](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));logger[_0x6538('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4b0e05,_0x6538('0x10'),JSON[_0x6538('0x12')](_0x2bce05));if(_0x2bce05[_0x6538('0x13')]){if(_0x2bce05['error'][_0x6538('0x14')]===0x1f4){logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')]['message']);return _0x113fe4(_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);}logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);return _0x28e83b(_0x2bce05['error'][_0x6538('0x15')]);}else{logger['info'](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));_0x28e83b(_0x2bce05[_0x6538('0x16')][_0x6538('0x15')]);}})['catch'](function(_0x7caa07){logger[_0x6538('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x4b0e05,_0x7caa07);_0x113fe4(_0x7caa07);});});}exports['GetZohoAccount']=function(_0x7c32d0){var _0x5c2f2c=this;return new Promise(function(_0x12527d,_0x394585){return db[_0x6538('0x17')]['findAll']({'raw':_0x7c32d0[_0x6538('0x18')]?_0x7c32d0[_0x6538('0x18')][_0x6538('0x19')]===undefined?!![]:![]:!![],'where':_0x7c32d0[_0x6538('0x18')]?_0x7c32d0[_0x6538('0x18')][_0x6538('0x1a')]||null:null,'attributes':_0x7c32d0[_0x6538('0x18')]?_0x7c32d0[_0x6538('0x18')][_0x6538('0x1b')]||null:null,'limit':_0x7c32d0[_0x6538('0x18')]?_0x7c32d0['options']['limit']||null:null,'include':_0x7c32d0[_0x6538('0x18')]?_0x7c32d0['options'][_0x6538('0x1c')]?_[_0x6538('0x1d')](_0x7c32d0[_0x6538('0x18')][_0x6538('0x1c')],function(_0x4e56ae){return{'model':db[_0x4e56ae['model']],'as':_0x4e56ae['as'],'attributes':_0x4e56ae[_0x6538('0x1b')],'include':_0x4e56ae['include']?_[_0x6538('0x1d')](_0x4e56ae['include'],function(_0x4a28a0){return{'model':db[_0x4a28a0['model']],'as':_0x4a28a0['as'],'attributes':_0x4a28a0[_0x6538('0x1b')],'include':_0x4a28a0[_0x6538('0x1c')]?_['map'](_0x4a28a0[_0x6538('0x1c')],function(_0x4dab32){return{'model':db[_0x4dab32[_0x6538('0x1e')]],'as':_0x4dab32['as'],'attributes':_0x4dab32[_0x6538('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6538('0xd')](function(_0x4fb3d6){logger['info'](_0x6538('0x1f'),_0x7c32d0);logger[_0x6538('0x11')](_0x6538('0x1f'),_0x7c32d0,JSON[_0x6538('0x12')](_0x4fb3d6));_0x12527d(_0x4fb3d6);})['catch'](function(_0xb1ef40){logger['error'](_0x6538('0x1f'),_0xb1ef40[_0x6538('0x15')],_0x7c32d0);_0x394585(_0x5c2f2c[_0x6538('0x13')](0x1f4,_0xb1ef40[_0x6538('0x15')]));});});};exports[_0x6538('0x20')]=function(_0x12df00){var _0x325354=this;return new Promise(function(_0x3513ec,_0x2faa43){return db[_0x6538('0x17')]['find']({'raw':_0x12df00[_0x6538('0x18')]?_0x12df00[_0x6538('0x18')][_0x6538('0x19')]===undefined?!![]:![]:!![],'where':_0x12df00['options']?_0x12df00[_0x6538('0x18')][_0x6538('0x1a')]||null:null,'attributes':_0x12df00[_0x6538('0x18')]?_0x12df00['options']['attributes']||null:null,'include':_0x12df00[_0x6538('0x18')]?_0x12df00[_0x6538('0x18')]['include']?_[_0x6538('0x1d')](_0x12df00[_0x6538('0x18')]['include'],function(_0x1b8ed5){return{'model':db[_0x1b8ed5[_0x6538('0x1e')]],'as':_0x1b8ed5['as'],'attributes':_0x1b8ed5['attributes'],'include':_0x1b8ed5[_0x6538('0x1c')]?_[_0x6538('0x1d')](_0x1b8ed5[_0x6538('0x1c')],function(_0x1f69e1){return{'model':db[_0x1f69e1[_0x6538('0x1e')]],'as':_0x1f69e1['as'],'attributes':_0x1f69e1['attributes'],'include':_0x1f69e1[_0x6538('0x1c')]?_[_0x6538('0x1d')](_0x1f69e1[_0x6538('0x1c')],function(_0x5b7c23){return{'model':db[_0x5b7c23[_0x6538('0x1e')]],'as':_0x5b7c23['as'],'attributes':_0x5b7c23['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48a404){logger['info'](_0x6538('0x20'),_0x12df00);logger[_0x6538('0x11')](_0x6538('0x20'),_0x12df00,JSON[_0x6538('0x12')](_0x48a404));_0x3513ec(_0x48a404);})[_0x6538('0x21')](function(_0x475851){logger[_0x6538('0x13')](_0x6538('0x20'),_0x475851[_0x6538('0x15')],_0x12df00);_0x2faa43(_0x325354[_0x6538('0x13')](0x1f4,_0x475851[_0x6538('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f6a449a..68ed683 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 _0xbb27=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0xe9c770,_0x4f76c4){var _0x48f174=function(_0x430bc0){while(--_0x430bc0){_0xe9c770['push'](_0xe9c770['shift']());}};_0x48f174(++_0x4f76c4);}(_0xbb27,0x1bd));var _0x7bb2=function(_0x43a485,_0x336240){_0x43a485=_0x43a485-0x0;var _0x10ffa6=_0xbb27[_0x43a485];return _0x10ffa6;};'use strict';var multer=require(_0x7bb2('0x0'));var util=require(_0x7bb2('0x1'));var path=require(_0x7bb2('0x2'));var timeout=require(_0x7bb2('0x3'));var express=require(_0x7bb2('0x4'));var router=express[_0x7bb2('0x5')]();var fs_extra=require(_0x7bb2('0x6'));var auth=require(_0x7bb2('0x7'));var interaction=require(_0x7bb2('0x8'));var config=require(_0x7bb2('0x9'));var controller=require(_0x7bb2('0xa'));router[_0x7bb2('0xb')]('/',auth['isAuthenticated'](),controller[_0x7bb2('0xc')]);router[_0x7bb2('0xb')](_0x7bb2('0xd'),auth['isAuthenticated'](),controller[_0x7bb2('0xe')]);router[_0x7bb2('0xb')](_0x7bb2('0xf'),auth[_0x7bb2('0x10')](),controller[_0x7bb2('0x11')]);router[_0x7bb2('0xb')](_0x7bb2('0x12'),auth[_0x7bb2('0x10')](),controller['getSubjects']);router['get'](_0x7bb2('0x13'),auth['isAuthenticated'](),controller[_0x7bb2('0x14')]);router[_0x7bb2('0x15')]('/',auth[_0x7bb2('0x10')](),controller[_0x7bb2('0x16')]);router['put'](_0x7bb2('0xd'),auth['isAuthenticated'](),controller[_0x7bb2('0x17')]);router['delete'](_0x7bb2('0xd'),auth[_0x7bb2('0x10')](),controller[_0x7bb2('0x18')]);module[_0x7bb2('0x19')]=router; \ No newline at end of file +var _0xd659=['getSubjects','/:id/descriptions','getDescriptions','create','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x1bd819,_0x577068){var _0x127b5d=function(_0x4e85bc){while(--_0x4e85bc){_0x1bd819['push'](_0x1bd819['shift']());}};_0x127b5d(++_0x577068);}(_0xd659,0xe3));var _0x9d65=function(_0x518ccd,_0x1aaf07){_0x518ccd=_0x518ccd-0x0;var _0x274050=_0xd659[_0x518ccd];return _0x274050;};'use strict';var multer=require('multer');var util=require(_0x9d65('0x0'));var path=require('path');var timeout=require(_0x9d65('0x1'));var express=require(_0x9d65('0x2'));var router=express['Router']();var fs_extra=require(_0x9d65('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9d65('0x4'));var config=require(_0x9d65('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x9d65('0x6')]('/',auth[_0x9d65('0x7')](),controller['index']);router[_0x9d65('0x6')](_0x9d65('0x8'),auth[_0x9d65('0x7')](),controller[_0x9d65('0x9')]);router[_0x9d65('0x6')](_0x9d65('0xa'),auth[_0x9d65('0x7')](),controller[_0x9d65('0xb')]);router['get'](_0x9d65('0xc'),auth[_0x9d65('0x7')](),controller[_0x9d65('0xd')]);router['get'](_0x9d65('0xe'),auth['isAuthenticated'](),controller[_0x9d65('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9d65('0x10')]);router['put']('/:id',auth[_0x9d65('0x7')](),controller[_0x9d65('0x11')]);router['delete']('/:id',auth[_0x9d65('0x7')](),controller[_0x9d65('0x12')]);module[_0x9d65('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index d74ef31..79131b3 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 _0x391b=['ENUM','lead','contact','contact_lead','sequelize','exports','STRING'];(function(_0x1566a5,_0x429920){var _0x98f4b4=function(_0x253ac9){while(--_0x253ac9){_0x1566a5['push'](_0x1566a5['shift']());}};_0x98f4b4(++_0x429920);}(_0x391b,0x131));var _0xb391=function(_0x423312,_0x25f527){_0x423312=_0x423312-0x0;var _0x33f959=_0x391b[_0x423312];return _0x33f959;};'use strict';var Sequelize=require(_0xb391('0x0'));module[_0xb391('0x1')]={'name':{'type':Sequelize[_0xb391('0x2')]},'moduleCreate':{'type':Sequelize[_0xb391('0x3')](_0xb391('0x4'),_0xb391('0x5'),'nothing'),'defaultValue':_0xb391('0x4')},'moduleSearch':{'type':Sequelize[_0xb391('0x3')](_0xb391('0x6'),_0xb391('0x5'),_0xb391('0x4')),'defaultValue':_0xb391('0x6')},'description':{'type':Sequelize[_0xb391('0x2')]}}; \ No newline at end of file +var _0xbcef=['sequelize','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0xbcef,0x1b9));var _0xfbce=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbcef[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xfbce('0x0'));module['exports']={'name':{'type':Sequelize[_0xfbce('0x1')]},'moduleCreate':{'type':Sequelize[_0xfbce('0x2')](_0xfbce('0x3'),_0xfbce('0x4'),_0xfbce('0x5')),'defaultValue':_0xfbce('0x3')},'moduleSearch':{'type':Sequelize[_0xfbce('0x2')](_0xfbce('0x6'),_0xfbce('0x4'),_0xfbce('0x3')),'defaultValue':_0xfbce('0x6')},'description':{'type':Sequelize[_0xfbce('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1926c28..e0c04f1 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 _0x8d6d=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','intersection','options','create','body','find','getFields','ZohoField','order','hasOwnProperty','findOne','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x16d47f,_0x2a2540){var _0x48e652=function(_0x3b8be8){while(--_0x3b8be8){_0x16d47f['push'](_0x16d47f['shift']());}};_0x48e652(++_0x2a2540);}(_0x8d6d,0xe0));var _0xd8d6=function(_0x5e878e,_0x3b320a){_0x5e878e=_0x5e878e-0x0;var _0x56afb2=_0x8d6d[_0x5e878e];return _0x56afb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd8d6('0x0'));var zipdir=require(_0xd8d6('0x1'));var jsonpatch=require(_0xd8d6('0x2'));var rp=require(_0xd8d6('0x3'));var moment=require(_0xd8d6('0x4'));var BPromise=require(_0xd8d6('0x5'));var Mustache=require(_0xd8d6('0x6'));var util=require('util');var path=require(_0xd8d6('0x7'));var sox=require('sox');var csv=require(_0xd8d6('0x8'));var ejs=require(_0xd8d6('0x9'));var fs=require('fs');var fs_extra=require(_0xd8d6('0xa'));var _=require(_0xd8d6('0xb'));var squel=require(_0xd8d6('0xc'));var crypto=require(_0xd8d6('0xd'));var jsforce=require(_0xd8d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd8d6('0x8'));var querystring=require(_0xd8d6('0xf'));var Papa=require('papaparse');var Redis=require(_0xd8d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd8d6('0x11'));var as=require(_0xd8d6('0x12'));var hardwareService=require(_0xd8d6('0x13'));var logger=require(_0xd8d6('0x14'))(_0xd8d6('0x15'));var utils=require(_0xd8d6('0x16'));var config=require(_0xd8d6('0x17'));var licenseUtil=require(_0xd8d6('0x18'));var db=require(_0xd8d6('0x19'))['db'];function respondWithStatusCode(_0x5c3377,_0x226c5e){_0x226c5e=_0x226c5e||0xcc;return function(_0x354971){if(_0x354971){return _0x5c3377[_0xd8d6('0x1a')](_0x226c5e);}return _0x5c3377[_0xd8d6('0x1b')](_0x226c5e)[_0xd8d6('0x1c')]();};}function respondWithResult(_0x3ad27f,_0x212d48){_0x212d48=_0x212d48||0xc8;return function(_0x408bb8){if(_0x408bb8){return _0x3ad27f[_0xd8d6('0x1b')](_0x212d48)['json'](_0x408bb8);}};}function respondWithFilteredResult(_0x425be6,_0x2e2621){return function(_0x4328fd){if(_0x4328fd){var _0x3744a1=typeof _0x2e2621[_0xd8d6('0x1d')]===_0xd8d6('0x1e')&&typeof _0x2e2621[_0xd8d6('0x1f')]===_0xd8d6('0x1e');var _0xce923b=_0x4328fd[_0xd8d6('0x20')];var _0xd48f6e=_0x3744a1?0x0:_0x2e2621[_0xd8d6('0x1d')];var _0x5c29a1=_0x3744a1?_0x4328fd[_0xd8d6('0x20')]:_0x2e2621[_0xd8d6('0x1d')]+_0x2e2621['limit'];var _0x2491d4;if(_0x5c29a1>=_0xce923b){_0x5c29a1=_0xce923b;_0x2491d4=0xc8;}else{_0x2491d4=0xce;}_0x425be6[_0xd8d6('0x1b')](_0x2491d4);return _0x425be6['set'](_0xd8d6('0x21'),_0xd48f6e+'-'+_0x5c29a1+'/'+_0xce923b)['json'](_0x4328fd);}return null;};}function patchUpdates(_0x23288d){return function(_0x19ea63){try{jsonpatch['apply'](_0x19ea63,_0x23288d,!![]);}catch(_0x3b1439){return BPromise[_0xd8d6('0x22')](_0x3b1439);}return _0x19ea63[_0xd8d6('0x23')]();};}function saveUpdates(_0x251e0a,_0x13750c){return function(_0x2961c5){if(_0x2961c5){return _0x2961c5[_0xd8d6('0x24')](_0x251e0a)[_0xd8d6('0x25')](function(_0xf72fe1){return _0xf72fe1;});}return null;};}function removeEntity(_0x216048,_0x23524e){return function(_0x41bda1){if(_0x41bda1){return _0x41bda1[_0xd8d6('0x26')]()[_0xd8d6('0x25')](function(){_0x216048[_0xd8d6('0x1b')](0xcc)[_0xd8d6('0x1c')]();});}};}function handleEntityNotFound(_0x2169ca,_0x51e958){return function(_0x316e36){if(!_0x316e36){_0x2169ca[_0xd8d6('0x1a')](0x194);}return _0x316e36;};}function handleError(_0x1b1b44,_0xded6d0){_0xded6d0=_0xded6d0||0x1f4;return function(_0x2ea63b){logger[_0xd8d6('0x27')](_0x2ea63b['stack']);if(_0x2ea63b[_0xd8d6('0x28')]){delete _0x2ea63b[_0xd8d6('0x28')];}_0x1b1b44[_0xd8d6('0x1b')](_0xded6d0)[_0xd8d6('0x29')](_0x2ea63b);};}exports['index']=function(_0x2c3916,_0xfdde33){var _0x19c2bd={},_0x1f1fec={},_0x26d49b={'count':0x0,'rows':[]};var _0x3ea8d9=_['map'](db[_0xd8d6('0x2a')][_0xd8d6('0x2b')],function(_0x3caae2){return{'name':_0x3caae2[_0xd8d6('0x2c')],'type':_0x3caae2[_0xd8d6('0x2d')][_0xd8d6('0x2e')]};});_0x1f1fec[_0xd8d6('0x2f')]=_[_0xd8d6('0x30')](_0x3ea8d9,_0xd8d6('0x28'));_0x1f1fec['query']=_['keys'](_0x2c3916[_0xd8d6('0x31')]);_0x1f1fec['filters']=_['intersection'](_0x1f1fec[_0xd8d6('0x2f')],_0x1f1fec[_0xd8d6('0x31')]);_0x19c2bd[_0xd8d6('0x32')]=_['intersection'](_0x1f1fec[_0xd8d6('0x2f')],qs[_0xd8d6('0x33')](_0x2c3916[_0xd8d6('0x31')][_0xd8d6('0x33')]));_0x19c2bd[_0xd8d6('0x32')]=_0x19c2bd[_0xd8d6('0x32')][_0xd8d6('0x34')]?_0x19c2bd[_0xd8d6('0x32')]:_0x1f1fec[_0xd8d6('0x2f')];if(!_0x2c3916[_0xd8d6('0x31')]['hasOwnProperty']('nolimit')){_0x19c2bd['limit']=qs[_0xd8d6('0x1f')](_0x2c3916['query'][_0xd8d6('0x1f')]);_0x19c2bd[_0xd8d6('0x1d')]=qs[_0xd8d6('0x1d')](_0x2c3916[_0xd8d6('0x31')][_0xd8d6('0x1d')]);}_0x19c2bd['order']=qs[_0xd8d6('0x35')](_0x2c3916['query'][_0xd8d6('0x35')]);_0x19c2bd[_0xd8d6('0x36')]=qs[_0xd8d6('0x37')](_[_0xd8d6('0x38')](_0x2c3916[_0xd8d6('0x31')],_0x1f1fec[_0xd8d6('0x37')]),_0x3ea8d9);if(_0x2c3916[_0xd8d6('0x31')][_0xd8d6('0x39')]){_0x19c2bd[_0xd8d6('0x36')]=_[_0xd8d6('0x3a')](_0x19c2bd[_0xd8d6('0x36')],{'$or':_[_0xd8d6('0x30')](_0x3ea8d9,function(_0x1d59ec){if(_0x1d59ec[_0xd8d6('0x2d')]!==_0xd8d6('0x3b')){var _0x5d7fe2={};_0x5d7fe2[_0x1d59ec[_0xd8d6('0x28')]]={'$like':'%'+_0x2c3916[_0xd8d6('0x31')][_0xd8d6('0x39')]+'%'};return _0x5d7fe2;}})});}_0x19c2bd=_[_0xd8d6('0x3a')]({},_0x19c2bd,_0x2c3916['options']);var _0x864b07={'where':_0x19c2bd[_0xd8d6('0x36')]};return db['ZohoConfiguration']['count'](_0x864b07)[_0xd8d6('0x25')](function(_0x2c59f9){_0x26d49b[_0xd8d6('0x20')]=_0x2c59f9;if(_0x2c3916[_0xd8d6('0x31')][_0xd8d6('0x3c')]){_0x19c2bd[_0xd8d6('0x3d')]=[{'all':!![]}];}return db[_0xd8d6('0x2a')][_0xd8d6('0x3e')](_0x19c2bd);})[_0xd8d6('0x25')](function(_0x3090f8){_0x26d49b['rows']=_0x3090f8;return _0x26d49b;})[_0xd8d6('0x25')](respondWithFilteredResult(_0xfdde33,_0x19c2bd))[_0xd8d6('0x3f')](handleError(_0xfdde33,null));};exports[_0xd8d6('0x40')]=function(_0x22a87d,_0x2d3ecd){var _0x3af503={'raw':![],'where':{'id':_0x22a87d[_0xd8d6('0x41')]['id']}},_0x377e76={};_0x377e76[_0xd8d6('0x2f')]=_[_0xd8d6('0x42')](db[_0xd8d6('0x2a')]['rawAttributes']);_0x377e76['query']=_[_0xd8d6('0x42')](_0x22a87d[_0xd8d6('0x31')]);_0x377e76['filters']=_[_0xd8d6('0x43')](_0x377e76[_0xd8d6('0x2f')],_0x377e76[_0xd8d6('0x31')]);_0x3af503[_0xd8d6('0x32')]=_['intersection'](_0x377e76['model'],qs['fields'](_0x22a87d[_0xd8d6('0x31')][_0xd8d6('0x33')]));_0x3af503[_0xd8d6('0x32')]=_0x3af503[_0xd8d6('0x32')][_0xd8d6('0x34')]?_0x3af503[_0xd8d6('0x32')]:_0x377e76[_0xd8d6('0x2f')];if(_0x22a87d[_0xd8d6('0x31')][_0xd8d6('0x3c')]){_0x3af503['include']=[{'all':!![]}];}_0x3af503=_[_0xd8d6('0x3a')]({},_0x3af503,_0x22a87d[_0xd8d6('0x44')]);return db[_0xd8d6('0x2a')]['find'](_0x3af503)[_0xd8d6('0x25')](handleEntityNotFound(_0x2d3ecd,null))[_0xd8d6('0x25')](respondWithResult(_0x2d3ecd,null))['catch'](handleError(_0x2d3ecd,null));};exports[_0xd8d6('0x45')]=function(_0x58a0ad,_0x2db359){return db[_0xd8d6('0x2a')][_0xd8d6('0x45')](_0x58a0ad['body'],{})[_0xd8d6('0x25')](respondWithResult(_0x2db359,0xc9))[_0xd8d6('0x3f')](handleError(_0x2db359,null));};exports[_0xd8d6('0x24')]=function(_0x36f882,_0x514042){if(_0x36f882[_0xd8d6('0x46')]['id']){delete _0x36f882[_0xd8d6('0x46')]['id'];}return db[_0xd8d6('0x2a')][_0xd8d6('0x47')]({'where':{'id':_0x36f882[_0xd8d6('0x41')]['id']}})[_0xd8d6('0x25')](handleEntityNotFound(_0x514042,null))[_0xd8d6('0x25')](saveUpdates(_0x36f882[_0xd8d6('0x46')],null))[_0xd8d6('0x25')](respondWithResult(_0x514042,null))[_0xd8d6('0x3f')](handleError(_0x514042,null));};exports[_0xd8d6('0x26')]=function(_0x3f39da,_0x47afff){return db['ZohoConfiguration'][_0xd8d6('0x47')]({'where':{'id':_0x3f39da[_0xd8d6('0x41')]['id']}})[_0xd8d6('0x25')](handleEntityNotFound(_0x47afff,null))[_0xd8d6('0x25')](removeEntity(_0x47afff,null))['catch'](handleError(_0x47afff,null));};exports[_0xd8d6('0x48')]=function(_0x5e49cf,_0xc5ae69,_0x1f3cc7){var _0xc8eb16={};var _0x42d37b={};var _0x509ed9;var _0x41e62c;return db[_0xd8d6('0x2a')]['findOne']({'where':{'id':_0x5e49cf[_0xd8d6('0x41')]['id']}})[_0xd8d6('0x25')](handleEntityNotFound(_0xc5ae69,null))[_0xd8d6('0x25')](function(_0x52dcd9){if(_0x52dcd9){_0x509ed9=_0x52dcd9;_0x42d37b[_0xd8d6('0x2f')]=_[_0xd8d6('0x42')](db[_0xd8d6('0x49')]['rawAttributes']);_0x42d37b[_0xd8d6('0x31')]=_[_0xd8d6('0x42')](_0x5e49cf[_0xd8d6('0x31')]);_0x42d37b[_0xd8d6('0x37')]=_['intersection'](_0x42d37b[_0xd8d6('0x2f')],_0x42d37b['query']);_0xc8eb16[_0xd8d6('0x32')]=_[_0xd8d6('0x43')](_0x42d37b[_0xd8d6('0x2f')],qs['fields'](_0x5e49cf[_0xd8d6('0x31')][_0xd8d6('0x33')]));_0xc8eb16['attributes']=_0xc8eb16[_0xd8d6('0x32')]['length']?_0xc8eb16[_0xd8d6('0x32')]:_0x42d37b[_0xd8d6('0x2f')];_0xc8eb16[_0xd8d6('0x4a')]=qs['sort'](_0x5e49cf[_0xd8d6('0x31')][_0xd8d6('0x35')]);_0xc8eb16[_0xd8d6('0x36')]=qs[_0xd8d6('0x37')](_['pick'](_0x5e49cf[_0xd8d6('0x31')],_0x42d37b[_0xd8d6('0x37')]));if(_0x5e49cf[_0xd8d6('0x31')][_0xd8d6('0x39')]){_0xc8eb16[_0xd8d6('0x36')]=_[_0xd8d6('0x3a')](_0xc8eb16[_0xd8d6('0x36')],{'$or':_[_0xd8d6('0x30')](_0xc8eb16[_0xd8d6('0x32')],function(_0x48d74c){var _0x145fb5={};_0x145fb5[_0x48d74c]={'$like':'%'+_0x5e49cf[_0xd8d6('0x31')][_0xd8d6('0x39')]+'%'};return _0x145fb5;})});}_0xc8eb16=_['merge']({},_0xc8eb16,_0x5e49cf[_0xd8d6('0x44')]);return _0x509ed9[_0xd8d6('0x48')](_0xc8eb16);}})[_0xd8d6('0x25')](function(_0x3df1c9){if(_0x3df1c9){_0x41e62c=_0x3df1c9[_0xd8d6('0x34')];if(!_0x5e49cf['query'][_0xd8d6('0x4b')]('nolimit')){_0xc8eb16[_0xd8d6('0x1f')]=qs[_0xd8d6('0x1f')](_0x5e49cf['query'][_0xd8d6('0x1f')]);_0xc8eb16[_0xd8d6('0x1d')]=qs[_0xd8d6('0x1d')](_0x5e49cf['query'][_0xd8d6('0x1d')]);}return _0x509ed9[_0xd8d6('0x48')](_0xc8eb16);}})['then'](function(_0x7f9712){if(_0x7f9712){return _0x7f9712?{'count':_0x41e62c,'rows':_0x7f9712}:null;}})[_0xd8d6('0x25')](respondWithResult(_0xc5ae69,null))['catch'](handleError(_0xc5ae69,null));};exports['getSubjects']=function(_0x27fa24,_0x41421a,_0x1d4b46){var _0x2dde4d={};var _0x4b6e75={};var _0x943822;var _0x3aa1b9;return db[_0xd8d6('0x2a')][_0xd8d6('0x4c')]({'where':{'id':_0x27fa24[_0xd8d6('0x41')]['id']}})[_0xd8d6('0x25')](handleEntityNotFound(_0x41421a,null))[_0xd8d6('0x25')](function(_0x434c94){if(_0x434c94){_0x943822=_0x434c94;_0x4b6e75[_0xd8d6('0x2f')]=_['keys'](db[_0xd8d6('0x49')][_0xd8d6('0x2b')]);_0x4b6e75[_0xd8d6('0x31')]=_['keys'](_0x27fa24[_0xd8d6('0x31')]);_0x4b6e75['filters']=_[_0xd8d6('0x43')](_0x4b6e75['model'],_0x4b6e75['query']);_0x2dde4d[_0xd8d6('0x32')]=_[_0xd8d6('0x43')](_0x4b6e75[_0xd8d6('0x2f')],qs[_0xd8d6('0x33')](_0x27fa24['query'][_0xd8d6('0x33')]));_0x2dde4d[_0xd8d6('0x32')]=_0x2dde4d[_0xd8d6('0x32')][_0xd8d6('0x34')]?_0x2dde4d[_0xd8d6('0x32')]:_0x4b6e75[_0xd8d6('0x2f')];_0x2dde4d['order']=qs[_0xd8d6('0x35')](_0x27fa24[_0xd8d6('0x31')][_0xd8d6('0x35')]);_0x2dde4d['where']=qs[_0xd8d6('0x37')](_[_0xd8d6('0x38')](_0x27fa24[_0xd8d6('0x31')],_0x4b6e75[_0xd8d6('0x37')]));if(_0x27fa24['query'][_0xd8d6('0x39')]){_0x2dde4d['where']=_[_0xd8d6('0x3a')](_0x2dde4d[_0xd8d6('0x36')],{'$or':_[_0xd8d6('0x30')](_0x2dde4d[_0xd8d6('0x32')],function(_0x3e7c32){var _0x2416f6={};_0x2416f6[_0x3e7c32]={'$like':'%'+_0x27fa24[_0xd8d6('0x31')][_0xd8d6('0x39')]+'%'};return _0x2416f6;})});}_0x2dde4d=_[_0xd8d6('0x3a')]({},_0x2dde4d,_0x27fa24[_0xd8d6('0x44')]);return _0x943822[_0xd8d6('0x4d')](_0x2dde4d);}})[_0xd8d6('0x25')](function(_0x28c367){if(_0x28c367){_0x3aa1b9=_0x28c367[_0xd8d6('0x34')];if(!_0x27fa24[_0xd8d6('0x31')][_0xd8d6('0x4b')](_0xd8d6('0x4e'))){_0x2dde4d[_0xd8d6('0x1f')]=qs[_0xd8d6('0x1f')](_0x27fa24[_0xd8d6('0x31')][_0xd8d6('0x1f')]);_0x2dde4d[_0xd8d6('0x1d')]=qs[_0xd8d6('0x1d')](_0x27fa24['query'][_0xd8d6('0x1d')]);}return _0x943822[_0xd8d6('0x4d')](_0x2dde4d);}})['then'](function(_0x3607b6){if(_0x3607b6){return _0x3607b6?{'count':_0x3aa1b9,'rows':_0x3607b6}:null;}})[_0xd8d6('0x25')](respondWithResult(_0x41421a,null))[_0xd8d6('0x3f')](handleError(_0x41421a,null));};exports[_0xd8d6('0x4f')]=function(_0x115634,_0x4822c2,_0x36d76a){var _0xd80b22={};var _0x1cb66f={};var _0x4f855b;var _0x3d433f;return db[_0xd8d6('0x2a')]['findOne']({'where':{'id':_0x115634[_0xd8d6('0x41')]['id']}})[_0xd8d6('0x25')](handleEntityNotFound(_0x4822c2,null))[_0xd8d6('0x25')](function(_0x48d223){if(_0x48d223){_0x4f855b=_0x48d223;_0x1cb66f['model']=_[_0xd8d6('0x42')](db[_0xd8d6('0x49')][_0xd8d6('0x2b')]);_0x1cb66f['query']=_[_0xd8d6('0x42')](_0x115634[_0xd8d6('0x31')]);_0x1cb66f[_0xd8d6('0x37')]=_['intersection'](_0x1cb66f[_0xd8d6('0x2f')],_0x1cb66f['query']);_0xd80b22['attributes']=_[_0xd8d6('0x43')](_0x1cb66f[_0xd8d6('0x2f')],qs['fields'](_0x115634[_0xd8d6('0x31')][_0xd8d6('0x33')]));_0xd80b22['attributes']=_0xd80b22[_0xd8d6('0x32')][_0xd8d6('0x34')]?_0xd80b22[_0xd8d6('0x32')]:_0x1cb66f[_0xd8d6('0x2f')];_0xd80b22[_0xd8d6('0x4a')]=qs[_0xd8d6('0x35')](_0x115634['query']['sort']);_0xd80b22[_0xd8d6('0x36')]=qs[_0xd8d6('0x37')](_['pick'](_0x115634[_0xd8d6('0x31')],_0x1cb66f['filters']));if(_0x115634[_0xd8d6('0x31')][_0xd8d6('0x39')]){_0xd80b22[_0xd8d6('0x36')]=_[_0xd8d6('0x3a')](_0xd80b22[_0xd8d6('0x36')],{'$or':_['map'](_0xd80b22['attributes'],function(_0x5271a6){var _0x321ea3={};_0x321ea3[_0x5271a6]={'$like':'%'+_0x115634['query'][_0xd8d6('0x39')]+'%'};return _0x321ea3;})});}_0xd80b22=_[_0xd8d6('0x3a')]({},_0xd80b22,_0x115634['options']);return _0x4f855b[_0xd8d6('0x4f')](_0xd80b22);}})[_0xd8d6('0x25')](function(_0x20a9c5){if(_0x20a9c5){_0x3d433f=_0x20a9c5[_0xd8d6('0x34')];if(!_0x115634[_0xd8d6('0x31')][_0xd8d6('0x4b')](_0xd8d6('0x4e'))){_0xd80b22[_0xd8d6('0x1f')]=qs[_0xd8d6('0x1f')](_0x115634['query'][_0xd8d6('0x1f')]);_0xd80b22[_0xd8d6('0x1d')]=qs[_0xd8d6('0x1d')](_0x115634[_0xd8d6('0x31')]['offset']);}return _0x4f855b[_0xd8d6('0x4f')](_0xd80b22);}})[_0xd8d6('0x25')](function(_0xb41f2c){if(_0xb41f2c){return _0xb41f2c?{'count':_0x3d433f,'rows':_0xb41f2c}:null;}})['then'](respondWithResult(_0x4822c2,null))[_0xd8d6('0x3f')](handleError(_0x4822c2,null));}; \ No newline at end of file +var _0x2512=['reject','save','update','destroy','error','name','send','index','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','ZohoConfiguration','then','count','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range'];(function(_0x3f2262,_0x445ffa){var _0x293f32=function(_0x2b0e64){while(--_0x2b0e64){_0x3f2262['push'](_0x3f2262['shift']());}};_0x293f32(++_0x445ffa);}(_0x2512,0x7f));var _0x2251=function(_0xc6379f,_0x5d0315){_0xc6379f=_0xc6379f-0x0;var _0x437fe8=_0x2512[_0xc6379f];return _0x437fe8;};'use strict';var emlformat=require(_0x2251('0x0'));var rimraf=require(_0x2251('0x1'));var zipdir=require(_0x2251('0x2'));var jsonpatch=require(_0x2251('0x3'));var rp=require('request-promise');var moment=require(_0x2251('0x4'));var BPromise=require(_0x2251('0x5'));var Mustache=require(_0x2251('0x6'));var util=require(_0x2251('0x7'));var path=require(_0x2251('0x8'));var sox=require(_0x2251('0x9'));var csv=require(_0x2251('0xa'));var ejs=require(_0x2251('0xb'));var fs=require('fs');var fs_extra=require(_0x2251('0xc'));var _=require('lodash');var squel=require(_0x2251('0xd'));var crypto=require('crypto');var jsforce=require(_0x2251('0xe'));var deskjs=require(_0x2251('0xf'));var toCsv=require(_0x2251('0xa'));var querystring=require(_0x2251('0x10'));var Papa=require(_0x2251('0x11'));var Redis=require(_0x2251('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2251('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2251('0x14'))('api');var utils=require(_0x2251('0x15'));var config=require(_0x2251('0x16'));var licenseUtil=require(_0x2251('0x17'));var db=require(_0x2251('0x18'))['db'];function respondWithStatusCode(_0x22d22,_0x460a67){_0x460a67=_0x460a67||0xcc;return function(_0x5c02b9){if(_0x5c02b9){return _0x22d22[_0x2251('0x19')](_0x460a67);}return _0x22d22[_0x2251('0x1a')](_0x460a67)[_0x2251('0x1b')]();};}function respondWithResult(_0x17a727,_0x5b49e1){_0x5b49e1=_0x5b49e1||0xc8;return function(_0xd81a6d){if(_0xd81a6d){return _0x17a727[_0x2251('0x1a')](_0x5b49e1)[_0x2251('0x1c')](_0xd81a6d);}};}function respondWithFilteredResult(_0x169d5d,_0x379eeb){return function(_0x17c4cc){if(_0x17c4cc){var _0xfc9acc=typeof _0x379eeb['offset']===_0x2251('0x1d')&&typeof _0x379eeb[_0x2251('0x1e')]===_0x2251('0x1d');var _0x3c78fe=_0x17c4cc['count'];var _0x529eae=_0xfc9acc?0x0:_0x379eeb[_0x2251('0x1f')];var _0x207cea=_0xfc9acc?_0x17c4cc['count']:_0x379eeb[_0x2251('0x1f')]+_0x379eeb[_0x2251('0x1e')];var _0x42f0dd;if(_0x207cea>=_0x3c78fe){_0x207cea=_0x3c78fe;_0x42f0dd=0xc8;}else{_0x42f0dd=0xce;}_0x169d5d[_0x2251('0x1a')](_0x42f0dd);return _0x169d5d['set'](_0x2251('0x20'),_0x529eae+'-'+_0x207cea+'/'+_0x3c78fe)['json'](_0x17c4cc);}return null;};}function patchUpdates(_0x136453){return function(_0x5eb8f7){try{jsonpatch['apply'](_0x5eb8f7,_0x136453,!![]);}catch(_0xc30b5){return BPromise[_0x2251('0x21')](_0xc30b5);}return _0x5eb8f7[_0x2251('0x22')]();};}function saveUpdates(_0x40aa6c,_0x2a552b){return function(_0x2867b2){if(_0x2867b2){return _0x2867b2[_0x2251('0x23')](_0x40aa6c)['then'](function(_0x37daab){return _0x37daab;});}return null;};}function removeEntity(_0x234319,_0xd81c7){return function(_0x22579e){if(_0x22579e){return _0x22579e[_0x2251('0x24')]()['then'](function(){_0x234319['status'](0xcc)[_0x2251('0x1b')]();});}};}function handleEntityNotFound(_0x5b809a,_0x2cb3cb){return function(_0x24f1e6){if(!_0x24f1e6){_0x5b809a[_0x2251('0x19')](0x194);}return _0x24f1e6;};}function handleError(_0x12a3f6,_0x26724a){_0x26724a=_0x26724a||0x1f4;return function(_0x1cb115){logger[_0x2251('0x25')](_0x1cb115['stack']);if(_0x1cb115[_0x2251('0x26')]){delete _0x1cb115[_0x2251('0x26')];}_0x12a3f6[_0x2251('0x1a')](_0x26724a)[_0x2251('0x27')](_0x1cb115);};}exports[_0x2251('0x28')]=function(_0x2a412d,_0x43f6a3){var _0x8c99e9={},_0x31a911={},_0x4332fe={'count':0x0,'rows':[]};var _0x321dc6=_['map'](db['ZohoConfiguration'][_0x2251('0x29')],function(_0x1045f7){return{'name':_0x1045f7['fieldName'],'type':_0x1045f7[_0x2251('0x2a')][_0x2251('0x2b')]};});_0x31a911[_0x2251('0x2c')]=_['map'](_0x321dc6,'name');_0x31a911[_0x2251('0x2d')]=_['keys'](_0x2a412d[_0x2251('0x2d')]);_0x31a911['filters']=_[_0x2251('0x2e')](_0x31a911[_0x2251('0x2c')],_0x31a911[_0x2251('0x2d')]);_0x8c99e9['attributes']=_['intersection'](_0x31a911[_0x2251('0x2c')],qs[_0x2251('0x2f')](_0x2a412d[_0x2251('0x2d')][_0x2251('0x2f')]));_0x8c99e9[_0x2251('0x30')]=_0x8c99e9[_0x2251('0x30')][_0x2251('0x31')]?_0x8c99e9[_0x2251('0x30')]:_0x31a911['model'];if(!_0x2a412d[_0x2251('0x2d')][_0x2251('0x32')](_0x2251('0x33'))){_0x8c99e9[_0x2251('0x1e')]=qs[_0x2251('0x1e')](_0x2a412d[_0x2251('0x2d')]['limit']);_0x8c99e9[_0x2251('0x1f')]=qs[_0x2251('0x1f')](_0x2a412d[_0x2251('0x2d')]['offset']);}_0x8c99e9[_0x2251('0x34')]=qs['sort'](_0x2a412d[_0x2251('0x2d')][_0x2251('0x35')]);_0x8c99e9[_0x2251('0x36')]=qs['filters'](_['pick'](_0x2a412d[_0x2251('0x2d')],_0x31a911[_0x2251('0x37')]),_0x321dc6);if(_0x2a412d['query'][_0x2251('0x38')]){_0x8c99e9[_0x2251('0x36')]=_[_0x2251('0x39')](_0x8c99e9['where'],{'$or':_[_0x2251('0x3a')](_0x321dc6,function(_0x3b1d5a){if(_0x3b1d5a[_0x2251('0x2a')]!==_0x2251('0x3b')){var _0x3e207a={};_0x3e207a[_0x3b1d5a['name']]={'$like':'%'+_0x2a412d[_0x2251('0x2d')][_0x2251('0x38')]+'%'};return _0x3e207a;}})});}_0x8c99e9=_[_0x2251('0x39')]({},_0x8c99e9,_0x2a412d[_0x2251('0x3c')]);var _0x2c99c3={'where':_0x8c99e9[_0x2251('0x36')]};return db[_0x2251('0x3d')]['count'](_0x2c99c3)[_0x2251('0x3e')](function(_0x433a6d){_0x4332fe[_0x2251('0x3f')]=_0x433a6d;if(_0x2a412d[_0x2251('0x2d')][_0x2251('0x40')]){_0x8c99e9[_0x2251('0x41')]=[{'all':!![]}];}return db[_0x2251('0x3d')]['findAll'](_0x8c99e9);})['then'](function(_0x1c4904){_0x4332fe[_0x2251('0x42')]=_0x1c4904;return _0x4332fe;})[_0x2251('0x3e')](respondWithFilteredResult(_0x43f6a3,_0x8c99e9))[_0x2251('0x43')](handleError(_0x43f6a3,null));};exports[_0x2251('0x44')]=function(_0x3ec37b,_0xf7bec8){var _0x469cd3={'raw':![],'where':{'id':_0x3ec37b[_0x2251('0x45')]['id']}},_0x1a39bb={};_0x1a39bb['model']=_[_0x2251('0x46')](db[_0x2251('0x3d')][_0x2251('0x29')]);_0x1a39bb[_0x2251('0x2d')]=_[_0x2251('0x46')](_0x3ec37b[_0x2251('0x2d')]);_0x1a39bb[_0x2251('0x37')]=_[_0x2251('0x2e')](_0x1a39bb[_0x2251('0x2c')],_0x1a39bb[_0x2251('0x2d')]);_0x469cd3['attributes']=_['intersection'](_0x1a39bb[_0x2251('0x2c')],qs[_0x2251('0x2f')](_0x3ec37b[_0x2251('0x2d')][_0x2251('0x2f')]));_0x469cd3['attributes']=_0x469cd3[_0x2251('0x30')][_0x2251('0x31')]?_0x469cd3['attributes']:_0x1a39bb[_0x2251('0x2c')];if(_0x3ec37b[_0x2251('0x2d')][_0x2251('0x40')]){_0x469cd3[_0x2251('0x41')]=[{'all':!![]}];}_0x469cd3=_[_0x2251('0x39')]({},_0x469cd3,_0x3ec37b['options']);return db[_0x2251('0x3d')][_0x2251('0x47')](_0x469cd3)['then'](handleEntityNotFound(_0xf7bec8,null))[_0x2251('0x3e')](respondWithResult(_0xf7bec8,null))['catch'](handleError(_0xf7bec8,null));};exports[_0x2251('0x48')]=function(_0x23166d,_0x27b80b){return db[_0x2251('0x3d')][_0x2251('0x48')](_0x23166d['body'],{})['then'](respondWithResult(_0x27b80b,0xc9))['catch'](handleError(_0x27b80b,null));};exports[_0x2251('0x23')]=function(_0x569f82,_0x50e0ac){if(_0x569f82[_0x2251('0x49')]['id']){delete _0x569f82['body']['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x569f82[_0x2251('0x45')]['id']}})[_0x2251('0x3e')](handleEntityNotFound(_0x50e0ac,null))[_0x2251('0x3e')](saveUpdates(_0x569f82[_0x2251('0x49')],null))['then'](respondWithResult(_0x50e0ac,null))[_0x2251('0x43')](handleError(_0x50e0ac,null));};exports['destroy']=function(_0x412987,_0x2f8308){return db[_0x2251('0x3d')][_0x2251('0x47')]({'where':{'id':_0x412987[_0x2251('0x45')]['id']}})[_0x2251('0x3e')](handleEntityNotFound(_0x2f8308,null))[_0x2251('0x3e')](removeEntity(_0x2f8308,null))['catch'](handleError(_0x2f8308,null));};exports[_0x2251('0x4a')]=function(_0x400a54,_0x59e633,_0x3c67bb){var _0x6746dc={};var _0xff28d1={};var _0x488d23;var _0x259474;return db['ZohoConfiguration'][_0x2251('0x4b')]({'where':{'id':_0x400a54[_0x2251('0x45')]['id']}})['then'](handleEntityNotFound(_0x59e633,null))['then'](function(_0x3b206e){if(_0x3b206e){_0x488d23=_0x3b206e;_0xff28d1[_0x2251('0x2c')]=_[_0x2251('0x46')](db[_0x2251('0x4c')]['rawAttributes']);_0xff28d1[_0x2251('0x2d')]=_[_0x2251('0x46')](_0x400a54[_0x2251('0x2d')]);_0xff28d1[_0x2251('0x37')]=_[_0x2251('0x2e')](_0xff28d1[_0x2251('0x2c')],_0xff28d1[_0x2251('0x2d')]);_0x6746dc[_0x2251('0x30')]=_[_0x2251('0x2e')](_0xff28d1[_0x2251('0x2c')],qs[_0x2251('0x2f')](_0x400a54[_0x2251('0x2d')][_0x2251('0x2f')]));_0x6746dc[_0x2251('0x30')]=_0x6746dc[_0x2251('0x30')][_0x2251('0x31')]?_0x6746dc['attributes']:_0xff28d1[_0x2251('0x2c')];_0x6746dc[_0x2251('0x34')]=qs['sort'](_0x400a54[_0x2251('0x2d')][_0x2251('0x35')]);_0x6746dc[_0x2251('0x36')]=qs[_0x2251('0x37')](_[_0x2251('0x4d')](_0x400a54[_0x2251('0x2d')],_0xff28d1[_0x2251('0x37')]));if(_0x400a54[_0x2251('0x2d')][_0x2251('0x38')]){_0x6746dc[_0x2251('0x36')]=_[_0x2251('0x39')](_0x6746dc[_0x2251('0x36')],{'$or':_[_0x2251('0x3a')](_0x6746dc[_0x2251('0x30')],function(_0x1b7aa9){var _0x62e469={};_0x62e469[_0x1b7aa9]={'$like':'%'+_0x400a54[_0x2251('0x2d')][_0x2251('0x38')]+'%'};return _0x62e469;})});}_0x6746dc=_[_0x2251('0x39')]({},_0x6746dc,_0x400a54['options']);return _0x488d23[_0x2251('0x4a')](_0x6746dc);}})[_0x2251('0x3e')](function(_0x16a53b){if(_0x16a53b){_0x259474=_0x16a53b[_0x2251('0x31')];if(!_0x400a54[_0x2251('0x2d')][_0x2251('0x32')](_0x2251('0x33'))){_0x6746dc[_0x2251('0x1e')]=qs[_0x2251('0x1e')](_0x400a54[_0x2251('0x2d')][_0x2251('0x1e')]);_0x6746dc[_0x2251('0x1f')]=qs[_0x2251('0x1f')](_0x400a54[_0x2251('0x2d')][_0x2251('0x1f')]);}return _0x488d23[_0x2251('0x4a')](_0x6746dc);}})[_0x2251('0x3e')](function(_0xa91399){if(_0xa91399){return _0xa91399?{'count':_0x259474,'rows':_0xa91399}:null;}})['then'](respondWithResult(_0x59e633,null))[_0x2251('0x43')](handleError(_0x59e633,null));};exports[_0x2251('0x4e')]=function(_0x329675,_0x34b3f6,_0xf4f382){var _0x475f8b={};var _0x12517e={};var _0x17ec22;var _0x552b3c;return db[_0x2251('0x3d')][_0x2251('0x4b')]({'where':{'id':_0x329675[_0x2251('0x45')]['id']}})[_0x2251('0x3e')](handleEntityNotFound(_0x34b3f6,null))[_0x2251('0x3e')](function(_0x1bf57e){if(_0x1bf57e){_0x17ec22=_0x1bf57e;_0x12517e[_0x2251('0x2c')]=_[_0x2251('0x46')](db[_0x2251('0x4c')][_0x2251('0x29')]);_0x12517e[_0x2251('0x2d')]=_[_0x2251('0x46')](_0x329675[_0x2251('0x2d')]);_0x12517e[_0x2251('0x37')]=_[_0x2251('0x2e')](_0x12517e[_0x2251('0x2c')],_0x12517e[_0x2251('0x2d')]);_0x475f8b[_0x2251('0x30')]=_[_0x2251('0x2e')](_0x12517e[_0x2251('0x2c')],qs[_0x2251('0x2f')](_0x329675['query'][_0x2251('0x2f')]));_0x475f8b['attributes']=_0x475f8b[_0x2251('0x30')][_0x2251('0x31')]?_0x475f8b[_0x2251('0x30')]:_0x12517e[_0x2251('0x2c')];_0x475f8b['order']=qs[_0x2251('0x35')](_0x329675[_0x2251('0x2d')][_0x2251('0x35')]);_0x475f8b[_0x2251('0x36')]=qs[_0x2251('0x37')](_[_0x2251('0x4d')](_0x329675[_0x2251('0x2d')],_0x12517e[_0x2251('0x37')]));if(_0x329675[_0x2251('0x2d')][_0x2251('0x38')]){_0x475f8b[_0x2251('0x36')]=_['merge'](_0x475f8b['where'],{'$or':_[_0x2251('0x3a')](_0x475f8b[_0x2251('0x30')],function(_0x50c8cc){var _0x1a2826={};_0x1a2826[_0x50c8cc]={'$like':'%'+_0x329675[_0x2251('0x2d')]['filter']+'%'};return _0x1a2826;})});}_0x475f8b=_['merge']({},_0x475f8b,_0x329675[_0x2251('0x3c')]);return _0x17ec22[_0x2251('0x4e')](_0x475f8b);}})[_0x2251('0x3e')](function(_0x11d171){if(_0x11d171){_0x552b3c=_0x11d171[_0x2251('0x31')];if(!_0x329675[_0x2251('0x2d')][_0x2251('0x32')]('nolimit')){_0x475f8b['limit']=qs[_0x2251('0x1e')](_0x329675[_0x2251('0x2d')][_0x2251('0x1e')]);_0x475f8b[_0x2251('0x1f')]=qs[_0x2251('0x1f')](_0x329675['query'][_0x2251('0x1f')]);}return _0x17ec22[_0x2251('0x4e')](_0x475f8b);}})[_0x2251('0x3e')](function(_0xaa9480){if(_0xaa9480){return _0xaa9480?{'count':_0x552b3c,'rows':_0xaa9480}:null;}})[_0x2251('0x3e')](respondWithResult(_0x34b3f6,null))[_0x2251('0x43')](handleError(_0x34b3f6,null));};exports[_0x2251('0x4f')]=function(_0x51c4af,_0x5a0e6c,_0x4189d0){var _0x22b7fe={};var _0x578dd5={};var _0x3d48b9;var _0x296f2e;return db['ZohoConfiguration'][_0x2251('0x4b')]({'where':{'id':_0x51c4af[_0x2251('0x45')]['id']}})[_0x2251('0x3e')](handleEntityNotFound(_0x5a0e6c,null))[_0x2251('0x3e')](function(_0x4a4d6b){if(_0x4a4d6b){_0x3d48b9=_0x4a4d6b;_0x578dd5[_0x2251('0x2c')]=_['keys'](db['ZohoField'][_0x2251('0x29')]);_0x578dd5[_0x2251('0x2d')]=_[_0x2251('0x46')](_0x51c4af['query']);_0x578dd5['filters']=_['intersection'](_0x578dd5[_0x2251('0x2c')],_0x578dd5[_0x2251('0x2d')]);_0x22b7fe[_0x2251('0x30')]=_[_0x2251('0x2e')](_0x578dd5[_0x2251('0x2c')],qs[_0x2251('0x2f')](_0x51c4af[_0x2251('0x2d')][_0x2251('0x2f')]));_0x22b7fe[_0x2251('0x30')]=_0x22b7fe[_0x2251('0x30')][_0x2251('0x31')]?_0x22b7fe[_0x2251('0x30')]:_0x578dd5[_0x2251('0x2c')];_0x22b7fe[_0x2251('0x34')]=qs[_0x2251('0x35')](_0x51c4af[_0x2251('0x2d')][_0x2251('0x35')]);_0x22b7fe['where']=qs[_0x2251('0x37')](_[_0x2251('0x4d')](_0x51c4af[_0x2251('0x2d')],_0x578dd5[_0x2251('0x37')]));if(_0x51c4af[_0x2251('0x2d')]['filter']){_0x22b7fe[_0x2251('0x36')]=_[_0x2251('0x39')](_0x22b7fe[_0x2251('0x36')],{'$or':_[_0x2251('0x3a')](_0x22b7fe['attributes'],function(_0x5352af){var _0x4a9a8e={};_0x4a9a8e[_0x5352af]={'$like':'%'+_0x51c4af[_0x2251('0x2d')][_0x2251('0x38')]+'%'};return _0x4a9a8e;})});}_0x22b7fe=_[_0x2251('0x39')]({},_0x22b7fe,_0x51c4af[_0x2251('0x3c')]);return _0x3d48b9[_0x2251('0x4f')](_0x22b7fe);}})[_0x2251('0x3e')](function(_0x4f38a9){if(_0x4f38a9){_0x296f2e=_0x4f38a9['length'];if(!_0x51c4af[_0x2251('0x2d')]['hasOwnProperty'](_0x2251('0x33'))){_0x22b7fe[_0x2251('0x1e')]=qs[_0x2251('0x1e')](_0x51c4af[_0x2251('0x2d')]['limit']);_0x22b7fe[_0x2251('0x1f')]=qs[_0x2251('0x1f')](_0x51c4af[_0x2251('0x2d')][_0x2251('0x1f')]);}return _0x3d48b9[_0x2251('0x4f')](_0x22b7fe);}})[_0x2251('0x3e')](function(_0x483ebc){if(_0x483ebc){return _0x483ebc?{'count':_0x296f2e,'rows':_0x483ebc}:null;}})[_0x2251('0x3e')](respondWithResult(_0x5a0e6c,null))[_0x2251('0x43')](handleError(_0x5a0e6c,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 1362a07..c547af8 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 _0x6f14=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6f14,0x18d));var _0x46f1=function(_0x594e88,_0x442655){_0x594e88=_0x594e88-0x0;var _0x518fa8=_0x6f14[_0x594e88];return _0x518fa8;};'use strict';var _=require(_0x46f1('0x0'));var util=require(_0x46f1('0x1'));var logger=require(_0x46f1('0x2'))(_0x46f1('0x3'));var moment=require(_0x46f1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46f1('0x5'));var rimraf=require('rimraf');var config=require(_0x46f1('0x6'));var attributes=require(_0x46f1('0x7'));module['exports']=function(_0x2ebef3,_0x1cf123){return _0x2ebef3[_0x46f1('0x8')](_0x46f1('0x9'),attributes,{'tableName':_0x46f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e9a=['bluebird','path','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment'];(function(_0x349926,_0x1d3298){var _0x2b1597=function(_0x10066e){while(--_0x10066e){_0x349926['push'](_0x349926['shift']());}};_0x2b1597(++_0x1d3298);}(_0x1e9a,0x151));var _0xa1e9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x1e9a[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa1e9('0x0'))(_0xa1e9('0x1'));var moment=require(_0xa1e9('0x2'));var BPromise=require(_0xa1e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1e9('0x4'));var rimraf=require(_0xa1e9('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1e9('0x6'));module['exports']=function(_0x5aeb42,_0x384a40){return _0x5aeb42[_0xa1e9('0x7')](_0xa1e9('0x8'),attributes,{'tableName':_0xa1e9('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 4de29c7..7cabe81 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 _0x0d4b=['jayson/promise','client','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x0d4b,0x97));var _0xb0d4=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x0d4b[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xb0d4('0x0'));var util=require(_0xb0d4('0x1'));var moment=require('moment');var BPromise=require(_0xb0d4('0x2'));var rs=require(_0xb0d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0d4('0x4'))['db'];var utils=require(_0xb0d4('0x5'));var logger=require(_0xb0d4('0x6'))(_0xb0d4('0x7'));var config=require(_0xb0d4('0x8'));var jayson=require(_0xb0d4('0x9'));var client=jayson[_0xb0d4('0xa')][_0xb0d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x239cc9,_0x1613dd,_0x1f5966){return new BPromise(function(_0x29034e,_0x52c02c){return client['request'](_0x239cc9,_0x1f5966)[_0xb0d4('0xc')](function(_0x3dce9f){logger['info'](_0xb0d4('0xd'),_0x1613dd,_0xb0d4('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1613dd,_0xb0d4('0xe'),JSON['stringify'](_0x3dce9f));if(_0x3dce9f['error']){if(_0x3dce9f['error'][_0xb0d4('0xf')]===0x1f4){logger[_0xb0d4('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x1613dd,_0x3dce9f[_0xb0d4('0x10')][_0xb0d4('0x11')]);return _0x52c02c(_0x3dce9f[_0xb0d4('0x10')][_0xb0d4('0x11')]);}logger[_0xb0d4('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x1613dd,_0x3dce9f[_0xb0d4('0x10')][_0xb0d4('0x11')]);return _0x29034e(_0x3dce9f[_0xb0d4('0x10')][_0xb0d4('0x11')]);}else{logger['info'](_0xb0d4('0xd'),_0x1613dd,_0xb0d4('0xe'));_0x29034e(_0x3dce9f[_0xb0d4('0x12')][_0xb0d4('0x11')]);}})[_0xb0d4('0x13')](function(_0x1d9576){logger[_0xb0d4('0x10')](_0xb0d4('0xd'),_0x1613dd,_0x1d9576);_0x52c02c(_0x1d9576);});});} \ No newline at end of file +var _0x8846=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x54e5a8,_0x2c892f){var _0x4bdcbb=function(_0x22c676){while(--_0x22c676){_0x54e5a8['push'](_0x54e5a8['shift']());}};_0x4bdcbb(++_0x2c892f);}(_0x8846,0x140));var _0x6884=function(_0x2eabd8,_0x2dbad0){_0x2eabd8=_0x2eabd8-0x0;var _0x58529d=_0x8846[_0x2eabd8];return _0x58529d;};'use strict';var _=require(_0x6884('0x0'));var util=require(_0x6884('0x1'));var moment=require(_0x6884('0x2'));var BPromise=require(_0x6884('0x3'));var rs=require(_0x6884('0x4'));var fs=require('fs');var Redis=require(_0x6884('0x5'));var db=require(_0x6884('0x6'))['db'];var utils=require(_0x6884('0x7'));var logger=require('../../config/logger')(_0x6884('0x8'));var config=require(_0x6884('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6884('0xa')][_0x6884('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54e3b5,_0x131ae3,_0x54bc13){return new BPromise(function(_0x3f5886,_0x411cbf){return client[_0x6884('0xc')](_0x54e3b5,_0x54bc13)['then'](function(_0x3d9348){logger[_0x6884('0xd')](_0x6884('0xe'),_0x131ae3,_0x6884('0xf'));logger[_0x6884('0x10')](_0x6884('0x11'),_0x131ae3,_0x6884('0xf'),JSON[_0x6884('0x12')](_0x3d9348));if(_0x3d9348['error']){if(_0x3d9348[_0x6884('0x13')][_0x6884('0x14')]===0x1f4){logger[_0x6884('0x13')](_0x6884('0xe'),_0x131ae3,_0x3d9348[_0x6884('0x13')][_0x6884('0x15')]);return _0x411cbf(_0x3d9348[_0x6884('0x13')]['message']);}logger[_0x6884('0x13')](_0x6884('0xe'),_0x131ae3,_0x3d9348[_0x6884('0x13')]['message']);return _0x3f5886(_0x3d9348[_0x6884('0x13')][_0x6884('0x15')]);}else{logger[_0x6884('0xd')](_0x6884('0xe'),_0x131ae3,_0x6884('0xf'));_0x3f5886(_0x3d9348[_0x6884('0x16')][_0x6884('0x15')]);}})[_0x6884('0x17')](function(_0x7b2489){logger[_0x6884('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x131ae3,_0x7b2489);_0x411cbf(_0x7b2489);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index ee0db04..7ec2dfe 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 _0x8adc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','update','exports','path','connect-timeout','Router'];(function(_0xbd8a4d,_0x19d18c){var _0x2a31ac=function(_0x59105a){while(--_0x59105a){_0xbd8a4d['push'](_0xbd8a4d['shift']());}};_0x2a31ac(++_0x19d18c);}(_0x8adc,0xeb));var _0xc8ad=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x8adc[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8ad('0x0'));var timeout=require(_0xc8ad('0x1'));var express=require('express');var router=express[_0xc8ad('0x2')]();var fs_extra=require(_0xc8ad('0x3'));var auth=require(_0xc8ad('0x4'));var interaction=require(_0xc8ad('0x5'));var config=require(_0xc8ad('0x6'));var controller=require('./intZohoField.controller');router[_0xc8ad('0x7')]('/',auth[_0xc8ad('0x8')](),controller[_0xc8ad('0x9')]);router['get'](_0xc8ad('0xa'),auth[_0xc8ad('0x8')](),controller['show']);router[_0xc8ad('0xb')]('/',auth[_0xc8ad('0x8')](),controller['create']);router['put']('/:id',auth[_0xc8ad('0x8')](),controller[_0xc8ad('0xc')]);router['delete'](_0xc8ad('0xa'),auth[_0xc8ad('0x8')](),controller['destroy']);module[_0xc8ad('0xd')]=router; \ No newline at end of file +var _0x962e=['put','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x962e,0x1e4));var _0xe962=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0x962e[_0x271a95];return _0x3fa489;};'use strict';var multer=require(_0xe962('0x0'));var util=require(_0xe962('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe962('0x2'));var router=express['Router']();var fs_extra=require(_0xe962('0x3'));var auth=require(_0xe962('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe962('0x5'));var controller=require(_0xe962('0x6'));router[_0xe962('0x7')]('/',auth[_0xe962('0x8')](),controller[_0xe962('0x9')]);router[_0xe962('0x7')](_0xe962('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe962('0xb')]('/',auth[_0xe962('0x8')](),controller['create']);router[_0xe962('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe962('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe962('0xe')]);module[_0xe962('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8b99839..633014a 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 _0x36c8=['picklist','STRING','sequelize','exports','ENUM','string','customVariable'];(function(_0x5846dc,_0xecd703){var _0x1af1c5=function(_0x2774c4){while(--_0x2774c4){_0x5846dc['push'](_0x5846dc['shift']());}};_0x1af1c5(++_0xecd703);}(_0x36c8,0x121));var _0x836c=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0x36c8[_0x285c85];return _0x2f81cd;};'use strict';var Sequelize=require(_0x836c('0x0'));module[_0x836c('0x1')]={'type':{'type':Sequelize[_0x836c('0x2')](_0x836c('0x3'),'variable',_0x836c('0x4'),'keyValue',_0x836c('0x5')),'defaultValue':_0x836c('0x3')},'content':{'type':Sequelize[_0x836c('0x6')]},'key':{'type':Sequelize[_0x836c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x836c('0x3'),'variable',_0x836c('0x4'))},'keyContent':{'type':Sequelize[_0x836c('0x6')]},'idField':{'type':Sequelize[_0x836c('0x6')]},'nameField':{'type':Sequelize[_0x836c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x836c('0x6')]}}; \ No newline at end of file +var _0x7b65=['ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x5acd92,_0x219043){var _0xd95487=function(_0x5ff973){while(--_0x5ff973){_0x5acd92['push'](_0x5acd92['shift']());}};_0xd95487(++_0x219043);}(_0x7b65,0xb2));var _0x57b6=function(_0x56fb96,_0x91389c){_0x56fb96=_0x56fb96-0x0;var _0x535feb=_0x7b65[_0x56fb96];return _0x535feb;};'use strict';var Sequelize=require(_0x57b6('0x0'));module[_0x57b6('0x1')]={'type':{'type':Sequelize[_0x57b6('0x2')]('string',_0x57b6('0x3'),_0x57b6('0x4'),'keyValue',_0x57b6('0x5')),'defaultValue':_0x57b6('0x6')},'content':{'type':Sequelize[_0x57b6('0x7')]},'key':{'type':Sequelize[_0x57b6('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x57b6('0x6'),_0x57b6('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x57b6('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x57b6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57b6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index aff462d..a976984 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 _0xc282=['then','destroy','end','error','stack','name','send','index','map','ZohoField','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','include','findAll','rows','catch','params','includeAll','options','create','body','find','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','reject','save','update'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0xc282,0x1d1));var _0x2c28=function(_0x41aa7d,_0x553600){_0x41aa7d=_0x41aa7d-0x0;var _0x57f7f5=_0xc282[_0x41aa7d];return _0x57f7f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c28('0x0'));var jsonpatch=require(_0x2c28('0x1'));var rp=require(_0x2c28('0x2'));var moment=require(_0x2c28('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2c28('0x4'));var util=require(_0x2c28('0x5'));var path=require(_0x2c28('0x6'));var sox=require('sox');var csv=require(_0x2c28('0x7'));var ejs=require(_0x2c28('0x8'));var fs=require('fs');var fs_extra=require(_0x2c28('0x9'));var _=require(_0x2c28('0xa'));var squel=require('squel');var crypto=require(_0x2c28('0xb'));var jsforce=require(_0x2c28('0xc'));var deskjs=require(_0x2c28('0xd'));var toCsv=require(_0x2c28('0x7'));var querystring=require(_0x2c28('0xe'));var Papa=require(_0x2c28('0xf'));var Redis=require('ioredis');var authService=require(_0x2c28('0x10'));var qs=require(_0x2c28('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c28('0x12'))('api');var utils=require(_0x2c28('0x13'));var config=require(_0x2c28('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c28('0x15'))['db'];function respondWithStatusCode(_0x307535,_0x31927c){_0x31927c=_0x31927c||0xcc;return function(_0x37cda6){if(_0x37cda6){return _0x307535['sendStatus'](_0x31927c);}return _0x307535[_0x2c28('0x16')](_0x31927c)['end']();};}function respondWithResult(_0xe8d2ef,_0x273dc0){_0x273dc0=_0x273dc0||0xc8;return function(_0x21b2ca){if(_0x21b2ca){return _0xe8d2ef['status'](_0x273dc0)[_0x2c28('0x17')](_0x21b2ca);}};}function respondWithFilteredResult(_0x239dca,_0x11de0d){return function(_0x5398a4){if(_0x5398a4){var _0x5e89b5=typeof _0x11de0d[_0x2c28('0x18')]==='undefined'&&typeof _0x11de0d[_0x2c28('0x19')]==='undefined';var _0x3ad7e6=_0x5398a4['count'];var _0x40df50=_0x5e89b5?0x0:_0x11de0d[_0x2c28('0x18')];var _0x38c970=_0x5e89b5?_0x5398a4[_0x2c28('0x1a')]:_0x11de0d[_0x2c28('0x18')]+_0x11de0d['limit'];var _0x9a8971;if(_0x38c970>=_0x3ad7e6){_0x38c970=_0x3ad7e6;_0x9a8971=0xc8;}else{_0x9a8971=0xce;}_0x239dca['status'](_0x9a8971);return _0x239dca['set'](_0x2c28('0x1b'),_0x40df50+'-'+_0x38c970+'/'+_0x3ad7e6)['json'](_0x5398a4);}return null;};}function patchUpdates(_0x2ea840){return function(_0x50df72){try{jsonpatch[_0x2c28('0x1c')](_0x50df72,_0x2ea840,!![]);}catch(_0x40bc42){return BPromise[_0x2c28('0x1d')](_0x40bc42);}return _0x50df72[_0x2c28('0x1e')]();};}function saveUpdates(_0x4311e8,_0x22468d){return function(_0x27ba92){if(_0x27ba92){return _0x27ba92[_0x2c28('0x1f')](_0x4311e8)[_0x2c28('0x20')](function(_0x19f3a8){return _0x19f3a8;});}return null;};}function removeEntity(_0x7ba034,_0x125d88){return function(_0x55f3ad){if(_0x55f3ad){return _0x55f3ad[_0x2c28('0x21')]()['then'](function(){_0x7ba034[_0x2c28('0x16')](0xcc)[_0x2c28('0x22')]();});}};}function handleEntityNotFound(_0x30e02a,_0x36193d){return function(_0x5e96ae){if(!_0x5e96ae){_0x30e02a['sendStatus'](0x194);}return _0x5e96ae;};}function handleError(_0x43d132,_0x1cc570){_0x1cc570=_0x1cc570||0x1f4;return function(_0x406f44){logger[_0x2c28('0x23')](_0x406f44[_0x2c28('0x24')]);if(_0x406f44[_0x2c28('0x25')]){delete _0x406f44['name'];}_0x43d132[_0x2c28('0x16')](_0x1cc570)[_0x2c28('0x26')](_0x406f44);};}exports[_0x2c28('0x27')]=function(_0x2b4143,_0x484b5f){var _0x3a920d={},_0x3805f2={},_0x3c5004={'count':0x0,'rows':[]};var _0xbbdeb7=_[_0x2c28('0x28')](db[_0x2c28('0x29')]['rawAttributes'],function(_0x5ca497){return{'name':_0x5ca497['fieldName'],'type':_0x5ca497['type'][_0x2c28('0x2a')]};});_0x3805f2['model']=_['map'](_0xbbdeb7,_0x2c28('0x25'));_0x3805f2['query']=_[_0x2c28('0x2b')](_0x2b4143[_0x2c28('0x2c')]);_0x3805f2[_0x2c28('0x2d')]=_[_0x2c28('0x2e')](_0x3805f2[_0x2c28('0x2f')],_0x3805f2[_0x2c28('0x2c')]);_0x3a920d[_0x2c28('0x30')]=_[_0x2c28('0x2e')](_0x3805f2[_0x2c28('0x2f')],qs[_0x2c28('0x31')](_0x2b4143['query']['fields']));_0x3a920d[_0x2c28('0x30')]=_0x3a920d[_0x2c28('0x30')][_0x2c28('0x32')]?_0x3a920d[_0x2c28('0x30')]:_0x3805f2['model'];if(!_0x2b4143[_0x2c28('0x2c')][_0x2c28('0x33')](_0x2c28('0x34'))){_0x3a920d[_0x2c28('0x19')]=qs['limit'](_0x2b4143[_0x2c28('0x2c')][_0x2c28('0x19')]);_0x3a920d[_0x2c28('0x18')]=qs[_0x2c28('0x18')](_0x2b4143['query']['offset']);}_0x3a920d[_0x2c28('0x35')]=qs['sort'](_0x2b4143[_0x2c28('0x2c')][_0x2c28('0x36')]);_0x3a920d['where']=qs[_0x2c28('0x2d')](_[_0x2c28('0x37')](_0x2b4143[_0x2c28('0x2c')],_0x3805f2['filters']),_0xbbdeb7);if(_0x2b4143[_0x2c28('0x2c')][_0x2c28('0x38')]){_0x3a920d[_0x2c28('0x39')]=_['merge'](_0x3a920d['where'],{'$or':_[_0x2c28('0x28')](_0xbbdeb7,function(_0x5a8d1b){if(_0x5a8d1b[_0x2c28('0x3a')]!==_0x2c28('0x3b')){var _0x3d07a6={};_0x3d07a6[_0x5a8d1b[_0x2c28('0x25')]]={'$like':'%'+_0x2b4143['query'][_0x2c28('0x38')]+'%'};return _0x3d07a6;}})});}_0x3a920d=_[_0x2c28('0x3c')]({},_0x3a920d,_0x2b4143['options']);var _0x16e9a1={'where':_0x3a920d['where']};return db[_0x2c28('0x29')]['count'](_0x16e9a1)[_0x2c28('0x20')](function(_0x27b0be){_0x3c5004[_0x2c28('0x1a')]=_0x27b0be;if(_0x2b4143[_0x2c28('0x2c')]['includeAll']){_0x3a920d[_0x2c28('0x3d')]=[{'all':!![]}];}return db[_0x2c28('0x29')][_0x2c28('0x3e')](_0x3a920d);})[_0x2c28('0x20')](function(_0x4e1bf8){_0x3c5004[_0x2c28('0x3f')]=_0x4e1bf8;return _0x3c5004;})[_0x2c28('0x20')](respondWithFilteredResult(_0x484b5f,_0x3a920d))[_0x2c28('0x40')](handleError(_0x484b5f,null));};exports['show']=function(_0x3d656d,_0x366b29){var _0xeaba4c={'raw':!![],'where':{'id':_0x3d656d[_0x2c28('0x41')]['id']}},_0x32eff2={};_0x32eff2['model']=_[_0x2c28('0x2b')](db['ZohoField']['rawAttributes']);_0x32eff2['query']=_[_0x2c28('0x2b')](_0x3d656d[_0x2c28('0x2c')]);_0x32eff2['filters']=_[_0x2c28('0x2e')](_0x32eff2['model'],_0x32eff2[_0x2c28('0x2c')]);_0xeaba4c[_0x2c28('0x30')]=_[_0x2c28('0x2e')](_0x32eff2['model'],qs[_0x2c28('0x31')](_0x3d656d[_0x2c28('0x2c')][_0x2c28('0x31')]));_0xeaba4c[_0x2c28('0x30')]=_0xeaba4c[_0x2c28('0x30')][_0x2c28('0x32')]?_0xeaba4c[_0x2c28('0x30')]:_0x32eff2[_0x2c28('0x2f')];if(_0x3d656d['query'][_0x2c28('0x42')]){_0xeaba4c['include']=[{'all':!![]}];}_0xeaba4c=_['merge']({},_0xeaba4c,_0x3d656d[_0x2c28('0x43')]);return db[_0x2c28('0x29')]['find'](_0xeaba4c)[_0x2c28('0x20')](handleEntityNotFound(_0x366b29,null))['then'](respondWithResult(_0x366b29,null))[_0x2c28('0x40')](handleError(_0x366b29,null));};exports[_0x2c28('0x44')]=function(_0x4b8cd9,_0x2cb005){return db[_0x2c28('0x29')][_0x2c28('0x44')](_0x4b8cd9[_0x2c28('0x45')],{})[_0x2c28('0x20')](respondWithResult(_0x2cb005,0xc9))['catch'](handleError(_0x2cb005,null));};exports['update']=function(_0x2b9ceb,_0x3b3531){if(_0x2b9ceb[_0x2c28('0x45')]['id']){delete _0x2b9ceb['body']['id'];}return db[_0x2c28('0x29')]['find']({'where':{'id':_0x2b9ceb[_0x2c28('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b3531,null))[_0x2c28('0x20')](saveUpdates(_0x2b9ceb[_0x2c28('0x45')],null))[_0x2c28('0x20')](respondWithResult(_0x3b3531,null))[_0x2c28('0x40')](handleError(_0x3b3531,null));};exports[_0x2c28('0x21')]=function(_0x3542bd,_0x312303){return db[_0x2c28('0x29')][_0x2c28('0x46')]({'where':{'id':_0x3542bd[_0x2c28('0x41')]['id']}})[_0x2c28('0x20')](handleEntityNotFound(_0x312303,null))['then'](removeEntity(_0x312303,null))[_0x2c28('0x40')](handleError(_0x312303,null));}; \ No newline at end of file +var _0x705f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','reject','update','then','destroy','error','stack','name','send','index','ZohoField','fieldName','type','map','keys','query','intersection','model','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','rimraf'];(function(_0x11adbd,_0x5055f5){var _0x270029=function(_0x25feb6){while(--_0x25feb6){_0x11adbd['push'](_0x11adbd['shift']());}};_0x270029(++_0x5055f5);}(_0x705f,0x1f0));var _0xf705=function(_0x44db50,_0x5ecc02){_0x44db50=_0x44db50-0x0;var _0x2647ff=_0x705f[_0x44db50];return _0x2647ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf705('0x0'));var zipdir=require(_0xf705('0x1'));var jsonpatch=require(_0xf705('0x2'));var rp=require(_0xf705('0x3'));var moment=require(_0xf705('0x4'));var BPromise=require(_0xf705('0x5'));var Mustache=require(_0xf705('0x6'));var util=require(_0xf705('0x7'));var path=require(_0xf705('0x8'));var sox=require(_0xf705('0x9'));var csv=require(_0xf705('0xa'));var ejs=require(_0xf705('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf705('0xc'));var squel=require('squel');var crypto=require(_0xf705('0xd'));var jsforce=require(_0xf705('0xe'));var deskjs=require(_0xf705('0xf'));var toCsv=require(_0xf705('0xa'));var querystring=require('querystring');var Papa=require(_0xf705('0x10'));var Redis=require(_0xf705('0x11'));var authService=require(_0xf705('0x12'));var qs=require(_0xf705('0x13'));var as=require(_0xf705('0x14'));var hardwareService=require(_0xf705('0x15'));var logger=require(_0xf705('0x16'))(_0xf705('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf705('0x18'))['db'];function respondWithStatusCode(_0x39f0eb,_0x47dedf){_0x47dedf=_0x47dedf||0xcc;return function(_0x25ff09){if(_0x25ff09){return _0x39f0eb[_0xf705('0x19')](_0x47dedf);}return _0x39f0eb[_0xf705('0x1a')](_0x47dedf)[_0xf705('0x1b')]();};}function respondWithResult(_0x3c1548,_0x512210){_0x512210=_0x512210||0xc8;return function(_0x5f1040){if(_0x5f1040){return _0x3c1548[_0xf705('0x1a')](_0x512210)[_0xf705('0x1c')](_0x5f1040);}};}function respondWithFilteredResult(_0x246580,_0x37ed9a){return function(_0x3b3670){if(_0x3b3670){var _0x1b3f8e=typeof _0x37ed9a['offset']===_0xf705('0x1d')&&typeof _0x37ed9a[_0xf705('0x1e')]==='undefined';var _0x4c3a1c=_0x3b3670['count'];var _0x1ec693=_0x1b3f8e?0x0:_0x37ed9a[_0xf705('0x1f')];var _0x4a1718=_0x1b3f8e?_0x3b3670[_0xf705('0x20')]:_0x37ed9a[_0xf705('0x1f')]+_0x37ed9a[_0xf705('0x1e')];var _0x5b0f19;if(_0x4a1718>=_0x4c3a1c){_0x4a1718=_0x4c3a1c;_0x5b0f19=0xc8;}else{_0x5b0f19=0xce;}_0x246580[_0xf705('0x1a')](_0x5b0f19);return _0x246580['set']('Content-Range',_0x1ec693+'-'+_0x4a1718+'/'+_0x4c3a1c)[_0xf705('0x1c')](_0x3b3670);}return null;};}function patchUpdates(_0x2fdfcf){return function(_0x2c87f2){try{jsonpatch['apply'](_0x2c87f2,_0x2fdfcf,!![]);}catch(_0x445b21){return BPromise[_0xf705('0x21')](_0x445b21);}return _0x2c87f2['save']();};}function saveUpdates(_0x273158,_0x48a429){return function(_0x334b9f){if(_0x334b9f){return _0x334b9f[_0xf705('0x22')](_0x273158)[_0xf705('0x23')](function(_0x1c07ec){return _0x1c07ec;});}return null;};}function removeEntity(_0x239af7,_0x4537c2){return function(_0x69fc71){if(_0x69fc71){return _0x69fc71[_0xf705('0x24')]()['then'](function(){_0x239af7[_0xf705('0x1a')](0xcc)[_0xf705('0x1b')]();});}};}function handleEntityNotFound(_0x3b0f8f,_0x5eb195){return function(_0x38de18){if(!_0x38de18){_0x3b0f8f['sendStatus'](0x194);}return _0x38de18;};}function handleError(_0xec97ce,_0x567a72){_0x567a72=_0x567a72||0x1f4;return function(_0x498393){logger[_0xf705('0x25')](_0x498393[_0xf705('0x26')]);if(_0x498393[_0xf705('0x27')]){delete _0x498393[_0xf705('0x27')];}_0xec97ce[_0xf705('0x1a')](_0x567a72)[_0xf705('0x28')](_0x498393);};}exports[_0xf705('0x29')]=function(_0x13b548,_0x347580){var _0x3fc9b1={},_0x930385={},_0x3da7bb={'count':0x0,'rows':[]};var _0x1ad54f=_['map'](db[_0xf705('0x2a')]['rawAttributes'],function(_0x3d96e7){return{'name':_0x3d96e7[_0xf705('0x2b')],'type':_0x3d96e7[_0xf705('0x2c')]['key']};});_0x930385['model']=_[_0xf705('0x2d')](_0x1ad54f,'name');_0x930385['query']=_[_0xf705('0x2e')](_0x13b548[_0xf705('0x2f')]);_0x930385['filters']=_[_0xf705('0x30')](_0x930385[_0xf705('0x31')],_0x930385[_0xf705('0x2f')]);_0x3fc9b1[_0xf705('0x32')]=_[_0xf705('0x30')](_0x930385[_0xf705('0x31')],qs[_0xf705('0x33')](_0x13b548['query'][_0xf705('0x33')]));_0x3fc9b1[_0xf705('0x32')]=_0x3fc9b1['attributes']['length']?_0x3fc9b1[_0xf705('0x32')]:_0x930385['model'];if(!_0x13b548['query']['hasOwnProperty'](_0xf705('0x34'))){_0x3fc9b1[_0xf705('0x1e')]=qs['limit'](_0x13b548[_0xf705('0x2f')][_0xf705('0x1e')]);_0x3fc9b1['offset']=qs['offset'](_0x13b548[_0xf705('0x2f')][_0xf705('0x1f')]);}_0x3fc9b1[_0xf705('0x35')]=qs[_0xf705('0x36')](_0x13b548[_0xf705('0x2f')][_0xf705('0x36')]);_0x3fc9b1[_0xf705('0x37')]=qs[_0xf705('0x38')](_['pick'](_0x13b548[_0xf705('0x2f')],_0x930385[_0xf705('0x38')]),_0x1ad54f);if(_0x13b548['query'][_0xf705('0x39')]){_0x3fc9b1[_0xf705('0x37')]=_[_0xf705('0x3a')](_0x3fc9b1[_0xf705('0x37')],{'$or':_[_0xf705('0x2d')](_0x1ad54f,function(_0x53b90f){if(_0x53b90f['type']!==_0xf705('0x3b')){var _0x57d0ea={};_0x57d0ea[_0x53b90f[_0xf705('0x27')]]={'$like':'%'+_0x13b548[_0xf705('0x2f')][_0xf705('0x39')]+'%'};return _0x57d0ea;}})});}_0x3fc9b1=_['merge']({},_0x3fc9b1,_0x13b548['options']);var _0x32e695={'where':_0x3fc9b1[_0xf705('0x37')]};return db[_0xf705('0x2a')][_0xf705('0x20')](_0x32e695)[_0xf705('0x23')](function(_0x19540b){_0x3da7bb[_0xf705('0x20')]=_0x19540b;if(_0x13b548['query'][_0xf705('0x3c')]){_0x3fc9b1[_0xf705('0x3d')]=[{'all':!![]}];}return db[_0xf705('0x2a')][_0xf705('0x3e')](_0x3fc9b1);})[_0xf705('0x23')](function(_0x4b0a0d){_0x3da7bb[_0xf705('0x3f')]=_0x4b0a0d;return _0x3da7bb;})['then'](respondWithFilteredResult(_0x347580,_0x3fc9b1))[_0xf705('0x40')](handleError(_0x347580,null));};exports['show']=function(_0x3250cc,_0x23c361){var _0x3b305a={'raw':!![],'where':{'id':_0x3250cc[_0xf705('0x41')]['id']}},_0x1683b4={};_0x1683b4[_0xf705('0x31')]=_[_0xf705('0x2e')](db['ZohoField'][_0xf705('0x42')]);_0x1683b4[_0xf705('0x2f')]=_[_0xf705('0x2e')](_0x3250cc[_0xf705('0x2f')]);_0x1683b4[_0xf705('0x38')]=_[_0xf705('0x30')](_0x1683b4[_0xf705('0x31')],_0x1683b4[_0xf705('0x2f')]);_0x3b305a[_0xf705('0x32')]=_[_0xf705('0x30')](_0x1683b4[_0xf705('0x31')],qs['fields'](_0x3250cc[_0xf705('0x2f')]['fields']));_0x3b305a[_0xf705('0x32')]=_0x3b305a[_0xf705('0x32')][_0xf705('0x43')]?_0x3b305a[_0xf705('0x32')]:_0x1683b4[_0xf705('0x31')];if(_0x3250cc[_0xf705('0x2f')][_0xf705('0x3c')]){_0x3b305a[_0xf705('0x3d')]=[{'all':!![]}];}_0x3b305a=_[_0xf705('0x3a')]({},_0x3b305a,_0x3250cc['options']);return db[_0xf705('0x2a')][_0xf705('0x44')](_0x3b305a)[_0xf705('0x23')](handleEntityNotFound(_0x23c361,null))[_0xf705('0x23')](respondWithResult(_0x23c361,null))[_0xf705('0x40')](handleError(_0x23c361,null));};exports[_0xf705('0x45')]=function(_0x36fbb8,_0x4c9c2c){return db[_0xf705('0x2a')]['create'](_0x36fbb8[_0xf705('0x46')],{})[_0xf705('0x23')](respondWithResult(_0x4c9c2c,0xc9))[_0xf705('0x40')](handleError(_0x4c9c2c,null));};exports['update']=function(_0x4d9c9e,_0x51222a){if(_0x4d9c9e['body']['id']){delete _0x4d9c9e[_0xf705('0x46')]['id'];}return db[_0xf705('0x2a')][_0xf705('0x44')]({'where':{'id':_0x4d9c9e[_0xf705('0x41')]['id']}})[_0xf705('0x23')](handleEntityNotFound(_0x51222a,null))['then'](saveUpdates(_0x4d9c9e[_0xf705('0x46')],null))[_0xf705('0x23')](respondWithResult(_0x51222a,null))[_0xf705('0x40')](handleError(_0x51222a,null));};exports[_0xf705('0x24')]=function(_0x368c15,_0x241da9){return db['ZohoField'][_0xf705('0x44')]({'where':{'id':_0x368c15[_0xf705('0x41')]['id']}})[_0xf705('0x23')](handleEntityNotFound(_0x241da9,null))['then'](removeEntity(_0x241da9,null))[_0xf705('0x40')](handleError(_0x241da9,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f2845e0..91920d6 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 _0x2da6=['api','moment','bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0x37e544,_0x484b5c){var _0x3a204e=function(_0x3ae7dd){while(--_0x3ae7dd){_0x37e544['push'](_0x37e544['shift']());}};_0x3a204e(++_0x484b5c);}(_0x2da6,0x1dd));var _0x62da=function(_0x1dfc55,_0x4f9417){_0x1dfc55=_0x1dfc55-0x0;var _0x39c332=_0x2da6[_0x1dfc55];return _0x39c332;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));module[_0x62da('0x9')]=function(_0x3a59f8,_0x30437f){return _0x3a59f8[_0x62da('0xa')](_0x62da('0xb'),attributes,{'tableName':_0x62da('0xc'),'paranoid':![],'indexes':[{'name':_0x62da('0xd'),'fields':[_0x62da('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x4ffef0,_0x1b69dc){var _0x17a653=function(_0x3d6714){while(--_0x3d6714){_0x4ffef0['push'](_0x4ffef0['shift']());}};_0x17a653(++_0x1b69dc);}(_0xd117,0x182));var _0x7d11=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xd117[_0x44fef1];return _0x3c3a04;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xf'),_0x7d11('0x10')],'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 4f8a109..82165c1 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 _0x8626=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3fed94,_0x40d594){var _0x29cf44=function(_0x2687a6){while(--_0x2687a6){_0x3fed94['push'](_0x3fed94['shift']());}};_0x29cf44(++_0x40d594);}(_0x8626,0x15e));var _0x6862=function(_0x9add97,_0x17fbf1){_0x9add97=_0x9add97-0x0;var _0x1e6be8=_0x8626[_0x9add97];return _0x1e6be8;};'use strict';var _=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var moment=require(_0x6862('0x2'));var BPromise=require(_0x6862('0x3'));var rs=require(_0x6862('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6862('0x5'))['db'];var utils=require(_0x6862('0x6'));var logger=require(_0x6862('0x7'))(_0x6862('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6862('0x9')][_0x6862('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53e4d3,_0xb6a2b8,_0x3d9353){return new BPromise(function(_0xb7af7,_0x167afe){return client['request'](_0x53e4d3,_0x3d9353)[_0x6862('0xb')](function(_0x462f7d){logger[_0x6862('0xc')](_0x6862('0xd'),_0xb6a2b8,_0x6862('0xe'));logger[_0x6862('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0xb6a2b8,'request\x20sent',JSON[_0x6862('0x10')](_0x462f7d));if(_0x462f7d['error']){if(_0x462f7d[_0x6862('0x11')][_0x6862('0x12')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0xb6a2b8,_0x462f7d[_0x6862('0x11')][_0x6862('0x13')]);return _0x167afe(_0x462f7d[_0x6862('0x11')][_0x6862('0x13')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0xb6a2b8,_0x462f7d[_0x6862('0x11')][_0x6862('0x13')]);return _0xb7af7(_0x462f7d[_0x6862('0x11')][_0x6862('0x13')]);}else{logger[_0x6862('0xc')](_0x6862('0xd'),_0xb6a2b8,_0x6862('0xe'));_0xb7af7(_0x462f7d[_0x6862('0x14')]['message']);}})[_0x6862('0x15')](function(_0x1b2381){logger[_0x6862('0x11')](_0x6862('0xd'),_0xb6a2b8,_0x1b2381);_0x167afe(_0x1b2381);});});} \ No newline at end of file +var _0x7a8c=['code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x12ca89,_0x1b41f3){var _0x4137f0=function(_0x1658d7){while(--_0x1658d7){_0x12ca89['push'](_0x12ca89['shift']());}};_0x4137f0(++_0x1b41f3);}(_0x7a8c,0x73));var _0xc7a8=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7a8c[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xc7a8('0x0'));var util=require(_0xc7a8('0x1'));var moment=require('moment');var BPromise=require(_0xc7a8('0x2'));var rs=require(_0xc7a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7a8('0x4'))['db'];var utils=require(_0xc7a8('0x5'));var logger=require('../../config/logger')(_0xc7a8('0x6'));var config=require(_0xc7a8('0x7'));var jayson=require(_0xc7a8('0x8'));var client=jayson[_0xc7a8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34be62,_0xe884ca,_0x3d84bd){return new BPromise(function(_0x11364a,_0x25fe41){return client['request'](_0x34be62,_0x3d84bd)[_0xc7a8('0xa')](function(_0x2c3ff6){logger[_0xc7a8('0xb')](_0xc7a8('0xc'),_0xe884ca,'request\x20sent');logger[_0xc7a8('0xd')](_0xc7a8('0xe'),_0xe884ca,'request\x20sent',JSON[_0xc7a8('0xf')](_0x2c3ff6));if(_0x2c3ff6[_0xc7a8('0x10')]){if(_0x2c3ff6[_0xc7a8('0x10')][_0xc7a8('0x11')]===0x1f4){logger['error'](_0xc7a8('0xc'),_0xe884ca,_0x2c3ff6['error'][_0xc7a8('0x12')]);return _0x25fe41(_0x2c3ff6[_0xc7a8('0x10')][_0xc7a8('0x12')]);}logger['error'](_0xc7a8('0xc'),_0xe884ca,_0x2c3ff6['error'][_0xc7a8('0x12')]);return _0x11364a(_0x2c3ff6['error']['message']);}else{logger[_0xc7a8('0xb')](_0xc7a8('0xc'),_0xe884ca,_0xc7a8('0x13'));_0x11364a(_0x2c3ff6[_0xc7a8('0x14')][_0xc7a8('0x12')]);}})[_0xc7a8('0x15')](function(_0x28b130){logger[_0xc7a8('0x10')](_0xc7a8('0xc'),_0xe884ca,_0x28b130);_0x25fe41(_0x28b130);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index ae9a5db..277e127 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xb42ec7,_0x4a0132){var _0x5824d5=function(_0x3dfd6f){while(--_0x3dfd6f){_0xb42ec7['push'](_0xb42ec7['shift']());}};_0x5824d5(++_0x4a0132);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x26dccd,_0x177e4d){var _0x174350=function(_0x941e20){while(--_0x941e20){_0x26dccd['push'](_0x26dccd['shift']());}};_0x174350(++_0x177e4d);}(_0xedd9,0xfc));var _0x9edd=function(_0x5514a6,_0x34b379){_0x5514a6=_0x5514a6-0x0;var _0x1fef7f=_0xedd9[_0x5514a6];return _0x1fef7f;};'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 428413e..7f9d443 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 _0x523a=['app.js','INTEGER','state','STRING'];(function(_0x40b330,_0x42458b){var _0x27ae9a=function(_0xfeece7){while(--_0xfeece7){_0x40b330['push'](_0x40b330['shift']());}};_0x27ae9a(++_0x42458b);}(_0x523a,0x18f));var _0xa523=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x523a[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xa523('0x0')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa523('0x0')],'defaultValue':_0xa523('0x1')},'filename':{'type':Sequelize[_0xa523('0x0')]},'path':{'type':Sequelize[_0xa523('0x0')]},'type':{'type':Sequelize[_0xa523('0x0')]},'size':{'type':Sequelize[_0xa523('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa523('0x0')]},'logo':{'type':Sequelize[_0xa523('0x0')]},'state':{'type':Sequelize['STRING'],'unique':_0xa523('0x3')},'description':{'type':Sequelize[_0xa523('0x0')]},'title':{'type':Sequelize[_0xa523('0x0')]},'remoteUri':{'type':Sequelize[_0xa523('0x0')]},'link':{'type':Sequelize[_0xa523('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0x46cd=['exports','STRING','unique_name_and_version','app.js','state'];(function(_0x4ba86d,_0x28c896){var _0x52d473=function(_0x4c715a){while(--_0x4c715a){_0x4ba86d['push'](_0x4ba86d['shift']());}};_0x52d473(++_0x28c896);}(_0x46cd,0x181));var _0xd46c=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46cd[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require('sequelize');module[_0xd46c('0x0')]={'name':{'type':Sequelize[_0xd46c('0x1')],'allowNull':![],'unique':_0xd46c('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd46c('0x2')},'main':{'type':Sequelize[_0xd46c('0x1')],'defaultValue':_0xd46c('0x3')},'filename':{'type':Sequelize[_0xd46c('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd46c('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xd46c('0x1')]},'state':{'type':Sequelize[_0xd46c('0x1')],'unique':_0xd46c('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xd46c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd46c('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 1256f13..429df59 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 _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x66fa,0x117));var _0xa66f=function(_0x22ff5e,_0xfe041){_0x22ff5e=_0x22ff5e-0x0;var _0x2e27ab=_0x66fa[_0x22ff5e];return _0x2e27ab;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file +var _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x187d,0x93));var _0xd187=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x187d[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b75d017..65d541e 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 _0xa240=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes','exports','define','lodash'];(function(_0x1cb1f7,_0x3b1212){var _0x1c1df6=function(_0x41d72a){while(--_0x41d72a){_0x1cb1f7['push'](_0x1cb1f7['shift']());}};_0x1c1df6(++_0x3b1212);}(_0xa240,0x1a3));var _0x0a24=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xa240[_0x548627];return _0x844a84;};'use strict';var _=require(_0x0a24('0x0'));var util=require(_0x0a24('0x1'));var logger=require(_0x0a24('0x2'))(_0x0a24('0x3'));var moment=require(_0x0a24('0x4'));var BPromise=require(_0x0a24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a24('0x6'));var rimraf=require(_0x0a24('0x7'));var config=require(_0x0a24('0x8'));var attributes=require(_0x0a24('0x9'));module[_0x0a24('0xa')]=function(_0x1bc8a3,_0x3b4df0){return _0x1bc8a3[_0x0a24('0xb')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94b4=['path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1b857f,_0x286e31){var _0x5582e9=function(_0x643a90){while(--_0x643a90){_0x1b857f['push'](_0x1b857f['shift']());}};_0x5582e9(++_0x286e31);}(_0x94b4,0x1e8));var _0x494b=function(_0x3b3947,_0x1c5e57){_0x3b3947=_0x3b3947-0x0;var _0x4113d7=_0x94b4[_0x3b3947];return _0x4113d7;};'use strict';var _=require(_0x494b('0x0'));var util=require(_0x494b('0x1'));var logger=require(_0x494b('0x2'))(_0x494b('0x3'));var moment=require('moment');var BPromise=require(_0x494b('0x4'));var rp=require(_0x494b('0x5'));var fs=require('fs');var path=require(_0x494b('0x6'));var rimraf=require(_0x494b('0x7'));var config=require(_0x494b('0x8'));var attributes=require(_0x494b('0x9'));module['exports']=function(_0x393757,_0x518a82){return _0x393757[_0x494b('0xa')](_0x494b('0xb'),attributes,{'tableName':_0x494b('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 251ebd9..87e27d1 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f07ea,_0x37782f){var _0x5cab45=function(_0x24a13d){while(--_0x24a13d){_0x4f07ea['push'](_0x4f07ea['shift']());}};_0x5cab45(++_0x37782f);}(_0x7880,0x1f4));var _0x0788=function(_0x297b84,_0x302bb6){_0x297b84=_0x297b84-0x0;var _0x12c17d=_0x7880[_0x297b84];return _0x12c17d;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3cf7dd,_0x4a2499){var _0x39a0f2=function(_0x57b8ef){while(--_0x57b8ef){_0x3cf7dd['push'](_0x3cf7dd['shift']());}};_0x39a0f2(++_0x4a2499);}(_0x57ca,0x108));var _0xa57c=function(_0x377513,_0x5f53f9){_0x377513=_0x377513-0x0;var _0x2fbd9f=_0x57ca[_0x377513];return _0x2fbd9f;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5a8b306..0c58d33 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 _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x5813c1,_0x548630){var _0xb293a=function(_0x3c4128){while(--_0x3c4128){_0x5813c1['push'](_0x5813c1['shift']());}};_0xb293a(++_0x548630);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5e5b68,_0x37432d){_0x5e5b68=_0x5e5b68-0x0;var _0x3fd5c4=_0x9f0e[_0x5e5b68];return _0x3fd5c4;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x306250,_0x2c44ce){var _0x39e362=function(_0x3cf176){while(--_0x3cf176){_0x306250['push'](_0x306250['shift']());}};_0x39e362(++_0x2c44ce);}(_0x1a85,0x178));var _0x51a8=function(_0x321d0f,_0xc41539){_0x321d0f=_0x321d0f-0x0;var _0xbe7682=_0x1a85[_0x321d0f];return _0xbe7682;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index d92cd62..7232923 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 _0x5ec7=['SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x5c3f5c,_0x71ac0d){var _0x221e8a=function(_0x180df1){while(--_0x180df1){_0x5c3f5c['push'](_0x5c3f5c['shift']());}};_0x221e8a(++_0x71ac0d);}(_0x5ec7,0x76));var _0x75ec=function(_0x25da9f,_0x47d72c){_0x25da9f=_0x25da9f-0x0;var _0x447588=_0x5ec7[_0x25da9f];return _0x447588;};'use strict';var Sequelize=require(_0x75ec('0x0'));module[_0x75ec('0x1')]={'integration':{'type':Sequelize[_0x75ec('0x2')]},'eventChannel':{'type':Sequelize[_0x75ec('0x2')]},'exitStatus':{'type':Sequelize[_0x75ec('0x2')]},'ticketId':{'type':Sequelize[_0x75ec('0x2')]},'integrationId':{'type':Sequelize[_0x75ec('0x3')]},'contacts':{'type':Sequelize[_0x75ec('0x2')]},'uniqueid':{'type':Sequelize[_0x75ec('0x2')]},'calleridnum':{'type':Sequelize[_0x75ec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x75ec('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x75ec('0x2')]},'agentcalledAt':{'type':Sequelize[_0x75ec('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x75ec('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x75ec('0x4')]},'talktime':{'type':Sequelize[_0x75ec('0x3')]},'agentacw':{'type':Sequelize[_0x75ec('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x75ec('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x75ec('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x75ec('0x4')]},'agentdump':{'type':Sequelize[_0x75ec('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x75ec('0x4')]},'lastevent':{'type':Sequelize[_0x75ec('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x75ec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x75ec('0x2')]},'connectedlinenum':{'type':Sequelize[_0x75ec('0x2')]},'connectedlinename':{'type':Sequelize[_0x75ec('0x2')]},'language':{'type':Sequelize[_0x75ec('0x2')]},'accountcode':{'type':Sequelize[_0x75ec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x75ec('0x2')]},'destchannelstate':{'type':Sequelize[_0x75ec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x75ec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x75ec('0x2')]},'destcalleridname':{'type':Sequelize[_0x75ec('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x75ec('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x75ec('0x2')]},'destlanguage':{'type':Sequelize[_0x75ec('0x2')]},'destaccountcode':{'type':Sequelize[_0x75ec('0x2')]},'destcontext':{'type':Sequelize[_0x75ec('0x2')]},'destexten':{'type':Sequelize[_0x75ec('0x2')]},'destpriority':{'type':Sequelize[_0x75ec('0x2')]},'destuniqueid':{'type':Sequelize[_0x75ec('0x2')]},'messageId':{'type':Sequelize[_0x75ec('0x2')]},'inReplyTo':{'type':Sequelize[_0x75ec('0x2')]},'subject':{'type':Sequelize[_0x75ec('0x2')]},'from':{'type':Sequelize[_0x75ec('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x75ec('0x2')]},'attachment':{'type':Sequelize[_0x75ec('0x6')]},'html':{'type':Sequelize[_0x75ec('0x6')]},'text':{'type':Sequelize[_0x75ec('0x6')]},'status':{'type':Sequelize[_0x75ec('0x7')]('SENT',_0x75ec('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x75ec('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x75ec('0x2')]},'projectId':{'type':Sequelize[_0x75ec('0x3')]}}; \ No newline at end of file +var _0xf266=['INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf266,0x15c));var _0x6f26=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf266[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x6f26('0x0'));module['exports']={'integration':{'type':Sequelize[_0x6f26('0x1')]},'eventChannel':{'type':Sequelize[_0x6f26('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x6f26('0x1')]},'integrationId':{'type':Sequelize[_0x6f26('0x2')]},'contacts':{'type':Sequelize[_0x6f26('0x1')]},'uniqueid':{'type':Sequelize[_0x6f26('0x1')]},'calleridnum':{'type':Sequelize[_0x6f26('0x1')]},'calleridname':{'type':Sequelize[_0x6f26('0x1')]},'queue':{'type':Sequelize[_0x6f26('0x1')]},'interface':{'type':Sequelize[_0x6f26('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6f26('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6f26('0x3')]},'holdtime':{'type':Sequelize[_0x6f26('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6f26('0x3')]},'talktime':{'type':Sequelize[_0x6f26('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6f26('0x2')]},'reason':{'type':Sequelize[_0x6f26('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x6f26('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6f26('0x3')]},'agentdump':{'type':Sequelize[_0x6f26('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6f26('0x3')]},'lastevent':{'type':Sequelize[_0x6f26('0x1')]},'channel':{'type':Sequelize[_0x6f26('0x1')]},'channelstate':{'type':Sequelize[_0x6f26('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6f26('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6f26('0x1')]},'connectedlinename':{'type':Sequelize[_0x6f26('0x1')]},'language':{'type':Sequelize[_0x6f26('0x1')]},'accountcode':{'type':Sequelize[_0x6f26('0x1')]},'context':{'type':Sequelize[_0x6f26('0x1')]},'exten':{'type':Sequelize[_0x6f26('0x1')]},'priority':{'type':Sequelize[_0x6f26('0x1')]},'destchannel':{'type':Sequelize[_0x6f26('0x1')]},'destchannelstate':{'type':Sequelize[_0x6f26('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6f26('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6f26('0x1')]},'destcalleridname':{'type':Sequelize[_0x6f26('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6f26('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6f26('0x1')]},'destuniqueid':{'type':Sequelize[_0x6f26('0x1')]},'messageId':{'type':Sequelize[_0x6f26('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6f26('0x1')]},'from':{'type':Sequelize[_0x6f26('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x6f26('0x5')]},'text':{'type':Sequelize[_0x6f26('0x5')]},'status':{'type':Sequelize['ENUM'](_0x6f26('0x6'),_0x6f26('0x7'),_0x6f26('0x8'),_0x6f26('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x6f26('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d195a53..53b6cc4 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 _0x9def=['then','error','stack','name','index','IntegrationReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy'];(function(_0x43002c,_0x8fbb98){var _0x2b6b10=function(_0x50a935){while(--_0x50a935){_0x43002c['push'](_0x43002c['shift']());}};_0x2b6b10(++_0x8fbb98);}(_0x9def,0x18d));var _0xf9de=function(_0x467b23,_0x43125e){_0x467b23=_0x467b23-0x0;var _0x32e078=_0x9def[_0x467b23];return _0x32e078;};'use strict';var emlformat=require(_0xf9de('0x0'));var rimraf=require(_0xf9de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9de('0x2'));var moment=require(_0xf9de('0x3'));var BPromise=require(_0xf9de('0x4'));var Mustache=require(_0xf9de('0x5'));var util=require(_0xf9de('0x6'));var path=require('path');var sox=require(_0xf9de('0x7'));var csv=require(_0xf9de('0x8'));var ejs=require(_0xf9de('0x9'));var fs=require('fs');var fs_extra=require(_0xf9de('0xa'));var _=require(_0xf9de('0xb'));var squel=require('squel');var crypto=require(_0xf9de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf9de('0xd'));var toCsv=require(_0xf9de('0x8'));var querystring=require('querystring');var Papa=require(_0xf9de('0xe'));var Redis=require(_0xf9de('0xf'));var authService=require(_0xf9de('0x10'));var qs=require(_0xf9de('0x11'));var as=require(_0xf9de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9de('0x13'))('api');var utils=require(_0xf9de('0x14'));var config=require(_0xf9de('0x15'));var licenseUtil=require(_0xf9de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53fd9d,_0x32441c){_0x32441c=_0x32441c||0xcc;return function(_0x25f89a){if(_0x25f89a){return _0x53fd9d[_0xf9de('0x17')](_0x32441c);}return _0x53fd9d[_0xf9de('0x18')](_0x32441c)['end']();};}function respondWithResult(_0x1ac563,_0xdc957d){_0xdc957d=_0xdc957d||0xc8;return function(_0x303c99){if(_0x303c99){return _0x1ac563[_0xf9de('0x18')](_0xdc957d)['json'](_0x303c99);}};}function respondWithFilteredResult(_0x26765b,_0xd7f7a6){return function(_0x5d692c){if(_0x5d692c){var _0x251197=typeof _0xd7f7a6[_0xf9de('0x19')]===_0xf9de('0x1a')&&typeof _0xd7f7a6[_0xf9de('0x1b')]==='undefined';var _0x2c7187=_0x5d692c['count'];var _0x1fda25=_0x251197?0x0:_0xd7f7a6[_0xf9de('0x19')];var _0x8a2ae3=_0x251197?_0x5d692c[_0xf9de('0x1c')]:_0xd7f7a6[_0xf9de('0x19')]+_0xd7f7a6[_0xf9de('0x1b')];var _0x4bdbde;if(_0x8a2ae3>=_0x2c7187){_0x8a2ae3=_0x2c7187;_0x4bdbde=0xc8;}else{_0x4bdbde=0xce;}_0x26765b[_0xf9de('0x18')](_0x4bdbde);return _0x26765b[_0xf9de('0x1d')](_0xf9de('0x1e'),_0x1fda25+'-'+_0x8a2ae3+'/'+_0x2c7187)[_0xf9de('0x1f')](_0x5d692c);}return null;};}function patchUpdates(_0x40f2ec){return function(_0x5f2163){try{jsonpatch['apply'](_0x5f2163,_0x40f2ec,!![]);}catch(_0x2f86b1){return BPromise['reject'](_0x2f86b1);}return _0x5f2163[_0xf9de('0x20')]();};}function saveUpdates(_0x24ef5e,_0x4b6dfa){return function(_0x4f21e3){if(_0x4f21e3){return _0x4f21e3[_0xf9de('0x21')](_0x24ef5e)['then'](function(_0x14b3d0){return _0x14b3d0;});}return null;};}function removeEntity(_0x8c71c2,_0x109f97){return function(_0x10ca57){if(_0x10ca57){return _0x10ca57[_0xf9de('0x22')]()[_0xf9de('0x23')](function(){_0x8c71c2[_0xf9de('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c8cee,_0x3bfb4c){return function(_0x4a05fc){if(!_0x4a05fc){_0x6c8cee['sendStatus'](0x194);}return _0x4a05fc;};}function handleError(_0x19fc51,_0xbd16aa){_0xbd16aa=_0xbd16aa||0x1f4;return function(_0x5a4f6d){logger[_0xf9de('0x24')](_0x5a4f6d[_0xf9de('0x25')]);if(_0x5a4f6d[_0xf9de('0x26')]){delete _0x5a4f6d['name'];}_0x19fc51[_0xf9de('0x18')](_0xbd16aa)['send'](_0x5a4f6d);};}exports[_0xf9de('0x27')]=function(_0x2d538b,_0x23989f){var _0x555231={},_0x49d794={},_0xb3205={'count':0x0,'rows':[]};var _0x38af4b=_['map'](db[_0xf9de('0x28')][_0xf9de('0x29')],function(_0x51ef72){return{'name':_0x51ef72[_0xf9de('0x2a')],'type':_0x51ef72[_0xf9de('0x2b')][_0xf9de('0x2c')]};});_0x49d794[_0xf9de('0x2d')]=_['map'](_0x38af4b,'name');_0x49d794[_0xf9de('0x2e')]=_['keys'](_0x2d538b[_0xf9de('0x2e')]);_0x49d794['filters']=_[_0xf9de('0x2f')](_0x49d794[_0xf9de('0x2d')],_0x49d794[_0xf9de('0x2e')]);_0x555231[_0xf9de('0x30')]=_[_0xf9de('0x2f')](_0x49d794[_0xf9de('0x2d')],qs[_0xf9de('0x31')](_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x31')]));_0x555231['attributes']=_0x555231[_0xf9de('0x30')][_0xf9de('0x32')]?_0x555231[_0xf9de('0x30')]:_0x49d794[_0xf9de('0x2d')];if(!_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x33')](_0xf9de('0x34'))){_0x555231['limit']=qs['limit'](_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x1b')]);_0x555231[_0xf9de('0x19')]=qs[_0xf9de('0x19')](_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x19')]);}_0x555231['order']=qs[_0xf9de('0x35')](_0x2d538b['query'][_0xf9de('0x35')]);_0x555231[_0xf9de('0x36')]=qs['filters'](_[_0xf9de('0x37')](_0x2d538b['query'],_0x49d794[_0xf9de('0x38')]),_0x38af4b);if(_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x39')]){_0x555231[_0xf9de('0x36')]=_[_0xf9de('0x3a')](_0x555231[_0xf9de('0x36')],{'$or':_[_0xf9de('0x3b')](_0x38af4b,function(_0x346d3d){if(_0x346d3d[_0xf9de('0x2b')]!=='VIRTUAL'){var _0x20a464={};_0x20a464[_0x346d3d[_0xf9de('0x26')]]={'$like':'%'+_0x2d538b[_0xf9de('0x2e')][_0xf9de('0x39')]+'%'};return _0x20a464;}})});}_0x555231=_[_0xf9de('0x3a')]({},_0x555231,_0x2d538b[_0xf9de('0x3c')]);var _0x47e43e={'where':_0x555231[_0xf9de('0x36')]};return db['IntegrationReport']['count'](_0x47e43e)[_0xf9de('0x23')](function(_0x5a8408){_0xb3205[_0xf9de('0x1c')]=_0x5a8408;if(_0x2d538b['query']['includeAll']){_0x555231[_0xf9de('0x3d')]=[{'all':!![]}];}return db['IntegrationReport'][_0xf9de('0x3e')](_0x555231);})[_0xf9de('0x23')](function(_0x59af55){_0xb3205['rows']=_0x59af55;return _0xb3205;})['then'](respondWithFilteredResult(_0x23989f,_0x555231))[_0xf9de('0x3f')](handleError(_0x23989f,null));};exports[_0xf9de('0x40')]=function(_0x21d5b4,_0x2cb63c){var _0x364b47={'raw':![],'where':{'id':_0x21d5b4[_0xf9de('0x41')]['id']}},_0x12fb33={};_0x12fb33[_0xf9de('0x2d')]=_[_0xf9de('0x42')](db['IntegrationReport']['rawAttributes']);_0x12fb33[_0xf9de('0x2e')]=_[_0xf9de('0x42')](_0x21d5b4[_0xf9de('0x2e')]);_0x12fb33[_0xf9de('0x38')]=_['intersection'](_0x12fb33[_0xf9de('0x2d')],_0x12fb33[_0xf9de('0x2e')]);_0x364b47[_0xf9de('0x30')]=_[_0xf9de('0x2f')](_0x12fb33['model'],qs[_0xf9de('0x31')](_0x21d5b4['query'][_0xf9de('0x31')]));_0x364b47[_0xf9de('0x30')]=_0x364b47['attributes']['length']?_0x364b47[_0xf9de('0x30')]:_0x12fb33[_0xf9de('0x2d')];if(_0x21d5b4[_0xf9de('0x2e')][_0xf9de('0x43')]){_0x364b47[_0xf9de('0x3d')]=[{'all':!![]}];}_0x364b47=_[_0xf9de('0x3a')]({},_0x364b47,_0x21d5b4['options']);return db['IntegrationReport'][_0xf9de('0x44')](_0x364b47)[_0xf9de('0x23')](handleEntityNotFound(_0x2cb63c,null))[_0xf9de('0x23')](respondWithResult(_0x2cb63c,null))[_0xf9de('0x3f')](handleError(_0x2cb63c,null));};exports[_0xf9de('0x45')]=function(_0x2224d0,_0x4abd20){return db[_0xf9de('0x28')][_0xf9de('0x45')](_0x2224d0[_0xf9de('0x46')],{})[_0xf9de('0x23')](respondWithResult(_0x4abd20,0xc9))[_0xf9de('0x3f')](handleError(_0x4abd20,null));};exports[_0xf9de('0x21')]=function(_0x34ac4a,_0x4abdca){if(_0x34ac4a[_0xf9de('0x46')]['id']){delete _0x34ac4a[_0xf9de('0x46')]['id'];}return db[_0xf9de('0x28')][_0xf9de('0x44')]({'where':{'id':_0x34ac4a[_0xf9de('0x41')]['id']}})['then'](handleEntityNotFound(_0x4abdca,null))['then'](saveUpdates(_0x34ac4a['body'],null))[_0xf9de('0x23')](respondWithResult(_0x4abdca,null))[_0xf9de('0x3f')](handleError(_0x4abdca,null));};exports[_0xf9de('0x22')]=function(_0x116a2c,_0x53377d){return db['IntegrationReport'][_0xf9de('0x44')]({'where':{'id':_0x116a2c[_0xf9de('0x41')]['id']}})[_0xf9de('0x23')](handleEntityNotFound(_0x53377d,null))['then'](removeEntity(_0x53377d,null))[_0xf9de('0x3f')](handleError(_0x53377d,null));};exports[_0xf9de('0x47')]=function(_0x366069,_0x3c84d7){return db[_0xf9de('0x28')][_0xf9de('0x47')]()['then'](respondWithResult(_0x3c84d7,null))['catch'](handleError(_0x3c84d7,null));}; \ No newline at end of file +var _0x18bf=['../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x18bf,0xcc));var _0xf18b=function(_0x2d1b12,_0x7247e8){_0x2d1b12=_0x2d1b12-0x0;var _0x23a53b=_0x18bf[_0x2d1b12];return _0x23a53b;};'use strict';var emlformat=require(_0xf18b('0x0'));var rimraf=require(_0xf18b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf18b('0x2'));var rp=require(_0xf18b('0x3'));var moment=require(_0xf18b('0x4'));var BPromise=require(_0xf18b('0x5'));var Mustache=require(_0xf18b('0x6'));var util=require('util');var path=require(_0xf18b('0x7'));var sox=require(_0xf18b('0x8'));var csv=require('to-csv');var ejs=require(_0xf18b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf18b('0xa'));var squel=require(_0xf18b('0xb'));var crypto=require(_0xf18b('0xc'));var jsforce=require(_0xf18b('0xd'));var deskjs=require(_0xf18b('0xe'));var toCsv=require(_0xf18b('0xf'));var querystring=require(_0xf18b('0x10'));var Papa=require('papaparse');var Redis=require(_0xf18b('0x11'));var authService=require(_0xf18b('0x12'));var qs=require(_0xf18b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf18b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf18b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf18b('0x16'))['db'];function respondWithStatusCode(_0x10cc42,_0x2c80e2){_0x2c80e2=_0x2c80e2||0xcc;return function(_0x302851){if(_0x302851){return _0x10cc42[_0xf18b('0x17')](_0x2c80e2);}return _0x10cc42[_0xf18b('0x18')](_0x2c80e2)[_0xf18b('0x19')]();};}function respondWithResult(_0x149684,_0x223de6){_0x223de6=_0x223de6||0xc8;return function(_0x22e459){if(_0x22e459){return _0x149684[_0xf18b('0x18')](_0x223de6)[_0xf18b('0x1a')](_0x22e459);}};}function respondWithFilteredResult(_0x4ecc29,_0x188dca){return function(_0x3df7de){if(_0x3df7de){var _0x538133=typeof _0x188dca[_0xf18b('0x1b')]==='undefined'&&typeof _0x188dca['limit']===_0xf18b('0x1c');var _0x357d99=_0x3df7de[_0xf18b('0x1d')];var _0x2b5f8a=_0x538133?0x0:_0x188dca[_0xf18b('0x1b')];var _0x19f2f2=_0x538133?_0x3df7de[_0xf18b('0x1d')]:_0x188dca[_0xf18b('0x1b')]+_0x188dca[_0xf18b('0x1e')];var _0x13ad53;if(_0x19f2f2>=_0x357d99){_0x19f2f2=_0x357d99;_0x13ad53=0xc8;}else{_0x13ad53=0xce;}_0x4ecc29[_0xf18b('0x18')](_0x13ad53);return _0x4ecc29[_0xf18b('0x1f')]('Content-Range',_0x2b5f8a+'-'+_0x19f2f2+'/'+_0x357d99)[_0xf18b('0x1a')](_0x3df7de);}return null;};}function patchUpdates(_0x57474a){return function(_0x2b1c3d){try{jsonpatch[_0xf18b('0x20')](_0x2b1c3d,_0x57474a,!![]);}catch(_0x542753){return BPromise['reject'](_0x542753);}return _0x2b1c3d[_0xf18b('0x21')]();};}function saveUpdates(_0xe4ca6,_0xcbc5d8){return function(_0x121041){if(_0x121041){return _0x121041[_0xf18b('0x22')](_0xe4ca6)[_0xf18b('0x23')](function(_0x9858c8){return _0x9858c8;});}return null;};}function removeEntity(_0x59360a,_0x38d3cb){return function(_0x3d1816){if(_0x3d1816){return _0x3d1816['destroy']()['then'](function(){_0x59360a[_0xf18b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27e6b6,_0x49b133){return function(_0x3ceb54){if(!_0x3ceb54){_0x27e6b6[_0xf18b('0x17')](0x194);}return _0x3ceb54;};}function handleError(_0xf35c70,_0x45bb11){_0x45bb11=_0x45bb11||0x1f4;return function(_0x2e4b4c){logger[_0xf18b('0x24')](_0x2e4b4c[_0xf18b('0x25')]);if(_0x2e4b4c[_0xf18b('0x26')]){delete _0x2e4b4c[_0xf18b('0x26')];}_0xf35c70[_0xf18b('0x18')](_0x45bb11)[_0xf18b('0x27')](_0x2e4b4c);};}exports[_0xf18b('0x28')]=function(_0x438157,_0x1010ce){var _0x3aa650={},_0x45e755={},_0x45f5ce={'count':0x0,'rows':[]};var _0x1f2379=_[_0xf18b('0x29')](db[_0xf18b('0x2a')][_0xf18b('0x2b')],function(_0x2ab5be){return{'name':_0x2ab5be[_0xf18b('0x2c')],'type':_0x2ab5be[_0xf18b('0x2d')]['key']};});_0x45e755[_0xf18b('0x2e')]=_[_0xf18b('0x29')](_0x1f2379,_0xf18b('0x26'));_0x45e755[_0xf18b('0x2f')]=_[_0xf18b('0x30')](_0x438157[_0xf18b('0x2f')]);_0x45e755[_0xf18b('0x31')]=_[_0xf18b('0x32')](_0x45e755['model'],_0x45e755['query']);_0x3aa650[_0xf18b('0x33')]=_[_0xf18b('0x32')](_0x45e755[_0xf18b('0x2e')],qs[_0xf18b('0x34')](_0x438157[_0xf18b('0x2f')][_0xf18b('0x34')]));_0x3aa650[_0xf18b('0x33')]=_0x3aa650[_0xf18b('0x33')][_0xf18b('0x35')]?_0x3aa650[_0xf18b('0x33')]:_0x45e755['model'];if(!_0x438157[_0xf18b('0x2f')][_0xf18b('0x36')](_0xf18b('0x37'))){_0x3aa650[_0xf18b('0x1e')]=qs[_0xf18b('0x1e')](_0x438157['query'][_0xf18b('0x1e')]);_0x3aa650[_0xf18b('0x1b')]=qs[_0xf18b('0x1b')](_0x438157[_0xf18b('0x2f')][_0xf18b('0x1b')]);}_0x3aa650[_0xf18b('0x38')]=qs['sort'](_0x438157['query'][_0xf18b('0x39')]);_0x3aa650['where']=qs['filters'](_[_0xf18b('0x3a')](_0x438157[_0xf18b('0x2f')],_0x45e755[_0xf18b('0x31')]),_0x1f2379);if(_0x438157[_0xf18b('0x2f')]['filter']){_0x3aa650['where']=_[_0xf18b('0x3b')](_0x3aa650[_0xf18b('0x3c')],{'$or':_[_0xf18b('0x29')](_0x1f2379,function(_0x3372e4){if(_0x3372e4[_0xf18b('0x2d')]!==_0xf18b('0x3d')){var _0x2b935f={};_0x2b935f[_0x3372e4['name']]={'$like':'%'+_0x438157[_0xf18b('0x2f')][_0xf18b('0x3e')]+'%'};return _0x2b935f;}})});}_0x3aa650=_[_0xf18b('0x3b')]({},_0x3aa650,_0x438157[_0xf18b('0x3f')]);var _0x16fe4e={'where':_0x3aa650[_0xf18b('0x3c')]};return db[_0xf18b('0x2a')][_0xf18b('0x1d')](_0x16fe4e)[_0xf18b('0x23')](function(_0x202450){_0x45f5ce[_0xf18b('0x1d')]=_0x202450;if(_0x438157[_0xf18b('0x2f')]['includeAll']){_0x3aa650[_0xf18b('0x40')]=[{'all':!![]}];}return db[_0xf18b('0x2a')][_0xf18b('0x41')](_0x3aa650);})[_0xf18b('0x23')](function(_0x22886c){_0x45f5ce[_0xf18b('0x42')]=_0x22886c;return _0x45f5ce;})[_0xf18b('0x23')](respondWithFilteredResult(_0x1010ce,_0x3aa650))['catch'](handleError(_0x1010ce,null));};exports[_0xf18b('0x43')]=function(_0x149de7,_0x560aa2){var _0x340edb={'raw':![],'where':{'id':_0x149de7[_0xf18b('0x44')]['id']}},_0x2871ba={};_0x2871ba[_0xf18b('0x2e')]=_[_0xf18b('0x30')](db['IntegrationReport']['rawAttributes']);_0x2871ba['query']=_[_0xf18b('0x30')](_0x149de7[_0xf18b('0x2f')]);_0x2871ba[_0xf18b('0x31')]=_[_0xf18b('0x32')](_0x2871ba[_0xf18b('0x2e')],_0x2871ba['query']);_0x340edb[_0xf18b('0x33')]=_[_0xf18b('0x32')](_0x2871ba[_0xf18b('0x2e')],qs[_0xf18b('0x34')](_0x149de7[_0xf18b('0x2f')][_0xf18b('0x34')]));_0x340edb['attributes']=_0x340edb[_0xf18b('0x33')]['length']?_0x340edb[_0xf18b('0x33')]:_0x2871ba[_0xf18b('0x2e')];if(_0x149de7[_0xf18b('0x2f')]['includeAll']){_0x340edb['include']=[{'all':!![]}];}_0x340edb=_['merge']({},_0x340edb,_0x149de7[_0xf18b('0x3f')]);return db['IntegrationReport'][_0xf18b('0x45')](_0x340edb)[_0xf18b('0x23')](handleEntityNotFound(_0x560aa2,null))['then'](respondWithResult(_0x560aa2,null))[_0xf18b('0x46')](handleError(_0x560aa2,null));};exports[_0xf18b('0x47')]=function(_0x20489a,_0x1fcf5f){return db[_0xf18b('0x2a')][_0xf18b('0x47')](_0x20489a[_0xf18b('0x48')],{})['then'](respondWithResult(_0x1fcf5f,0xc9))[_0xf18b('0x46')](handleError(_0x1fcf5f,null));};exports[_0xf18b('0x22')]=function(_0x51b176,_0x39ebc5){if(_0x51b176[_0xf18b('0x48')]['id']){delete _0x51b176[_0xf18b('0x48')]['id'];}return db[_0xf18b('0x2a')][_0xf18b('0x45')]({'where':{'id':_0x51b176[_0xf18b('0x44')]['id']}})[_0xf18b('0x23')](handleEntityNotFound(_0x39ebc5,null))[_0xf18b('0x23')](saveUpdates(_0x51b176[_0xf18b('0x48')],null))[_0xf18b('0x23')](respondWithResult(_0x39ebc5,null))[_0xf18b('0x46')](handleError(_0x39ebc5,null));};exports[_0xf18b('0x49')]=function(_0x3afbeb,_0x3fd1e4){return db['IntegrationReport'][_0xf18b('0x45')]({'where':{'id':_0x3afbeb[_0xf18b('0x44')]['id']}})[_0xf18b('0x23')](handleEntityNotFound(_0x3fd1e4,null))['then'](removeEntity(_0x3fd1e4,null))[_0xf18b('0x46')](handleError(_0x3fd1e4,null));};exports[_0xf18b('0x4a')]=function(_0x17c3e9,_0x2bf97d){return db[_0xf18b('0x2a')][_0xf18b('0x4a')]()[_0xf18b('0x23')](respondWithResult(_0x2bf97d,null))[_0xf18b('0x46')](handleError(_0x2bf97d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index feeab47..c56bd08 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 _0x65a2=['IntegrationReport','report_integration','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x65a2,0x113));var _0x265a=function(_0x5ec114,_0x2a2131){_0x5ec114=_0x5ec114-0x0;var _0x42a77c=_0x65a2[_0x5ec114];return _0x42a77c;};'use strict';var _=require('lodash');var util=require(_0x265a('0x0'));var logger=require(_0x265a('0x1'))('api');var moment=require(_0x265a('0x2'));var BPromise=require(_0x265a('0x3'));var rp=require(_0x265a('0x4'));var fs=require('fs');var path=require(_0x265a('0x5'));var rimraf=require(_0x265a('0x6'));var config=require(_0x265a('0x7'));var attributes=require(_0x265a('0x8'));module[_0x265a('0x9')]=function(_0x23953d,_0x30f651){return _0x23953d[_0x265a('0xa')](_0x265a('0xb'),attributes,{'tableName':_0x265a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0725=['bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x1243da,_0x53b49e){var _0xd9871d=function(_0xd77540){while(--_0xd77540){_0x1243da['push'](_0x1243da['shift']());}};_0xd9871d(++_0x53b49e);}(_0x0725,0x7d));var _0x5072=function(_0x4cef53,_0xd69ab0){_0x4cef53=_0x4cef53-0x0;var _0x39f62c=_0x0725[_0x4cef53];return _0x39f62c;};'use strict';var _=require(_0x5072('0x0'));var util=require(_0x5072('0x1'));var logger=require(_0x5072('0x2'))(_0x5072('0x3'));var moment=require(_0x5072('0x4'));var BPromise=require(_0x5072('0x5'));var rp=require(_0x5072('0x6'));var fs=require('fs');var path=require(_0x5072('0x7'));var rimraf=require(_0x5072('0x8'));var config=require(_0x5072('0x9'));var attributes=require(_0x5072('0xa'));module[_0x5072('0xb')]=function(_0x139160,_0x86f887){return _0x139160['define']('IntegrationReport',attributes,{'tableName':_0x5072('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index ca93a1a..8166f78 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0xadb5,0xad));var _0x5adb=function(_0x408eef,_0x4fbb78){_0x408eef=_0x408eef-0x0;var _0x5ea35f=_0xadb5[_0x408eef];return _0x5ea35f;};'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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x56cddd,_0x22ad3b){var _0x116cc7=function(_0x40a1ba){while(--_0x40a1ba){_0x56cddd['push'](_0x56cddd['shift']());}};_0x116cc7(++_0x22ad3b);}(_0x4819,0xcd));var _0x9481=function(_0x3494e8,_0x4111ea){_0x3494e8=_0x3494e8-0x0;var _0x20bd8c=_0x4819[_0x3494e8];return _0x20bd8c;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5dc6872..2269018 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 _0xe35c=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','addInterval','addIntervals'];(function(_0x5567b3,_0x22ec93){var _0x339f80=function(_0xc4ae08){while(--_0xc4ae08){_0x5567b3['push'](_0x5567b3['shift']());}};_0x339f80(++_0x22ec93);}(_0xe35c,0x146));var _0xce35=function(_0x413cae,_0x55d795){_0x413cae=_0x413cae-0x0;var _0x1f0335=_0xe35c[_0x413cae];return _0x1f0335;};'use strict';var multer=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var path=require(_0xce35('0x2'));var timeout=require(_0xce35('0x3'));var express=require(_0xce35('0x4'));var router=express[_0xce35('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce35('0x6'));var config=require('../../config/environment');var controller=require(_0xce35('0x7'));router[_0xce35('0x8')]('/',auth[_0xce35('0x9')](),controller['index']);router[_0xce35('0x8')](_0xce35('0xa'),auth[_0xce35('0x9')](),controller[_0xce35('0xb')]);router['get'](_0xce35('0xc'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xce35('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce35('0xd')](_0xce35('0xc'),auth[_0xce35('0x9')](),controller[_0xce35('0xe')]);router[_0xce35('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xce35('0xf')]);router[_0xce35('0x10')](_0xce35('0xa'),auth[_0xce35('0x9')](),controller[_0xce35('0x11')]);router['delete']('/:id',auth[_0xce35('0x9')](),controller[_0xce35('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf360=['getIntervals','post','create','addInterval','addIntervals','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','/:id/sub_intervals'];(function(_0x261578,_0x868db1){var _0x356470=function(_0x4d452a){while(--_0x4d452a){_0x261578['push'](_0x261578['shift']());}};_0x356470(++_0x868db1);}(_0xf360,0x13c));var _0x0f36=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf360[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x0f36('0x0'));var util=require('util');var path=require(_0x0f36('0x1'));var timeout=require(_0x0f36('0x2'));var express=require(_0x0f36('0x3'));var router=express[_0x0f36('0x4')]();var fs_extra=require(_0x0f36('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0f36('0x6'));var config=require(_0x0f36('0x7'));var controller=require(_0x0f36('0x8'));router[_0x0f36('0x9')]('/',auth['isAuthenticated'](),controller[_0x0f36('0xa')]);router[_0x0f36('0x9')](_0x0f36('0xb'),auth[_0x0f36('0xc')](),controller['show']);router[_0x0f36('0x9')](_0x0f36('0xd'),auth['isAuthenticated'](),controller[_0x0f36('0xe')]);router[_0x0f36('0xf')]('/',auth[_0x0f36('0xc')](),controller[_0x0f36('0x10')]);router['post'](_0x0f36('0xd'),auth[_0x0f36('0xc')](),controller[_0x0f36('0x11')]);router[_0x0f36('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x0f36('0x12')]);router[_0x0f36('0x13')](_0x0f36('0xb'),auth[_0x0f36('0xc')](),controller['update']);router[_0x0f36('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0f36('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 661d61e..a58b62e 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 _0x3590=['STRING','sequelize','exports'];(function(_0x47462d,_0x3fe709){var _0x529d40=function(_0x226fc8){while(--_0x226fc8){_0x47462d['push'](_0x47462d['shift']());}};_0x529d40(++_0x3fe709);}(_0x3590,0xf1));var _0x0359=function(_0x25208f,_0x4fd219){_0x25208f=_0x25208f-0x0;var _0x4f2b87=_0x3590[_0x25208f];return _0x4f2b87;};'use strict';var Sequelize=require(_0x0359('0x0'));module[_0x0359('0x1')]={'name':{'type':Sequelize[_0x0359('0x2')]},'description':{'type':Sequelize[_0x0359('0x2')]},'interval':{'type':Sequelize[_0x0359('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x95ce=['sequelize','STRING'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x95ce,0xf2));var _0xe95c=function(_0x1d60b3,_0x65a805){_0x1d60b3=_0x1d60b3-0x0;var _0x2c5d8c=_0x95ce[_0x1d60b3];return _0x2c5d8c;};'use strict';var Sequelize=require(_0xe95c('0x0'));module['exports']={'name':{'type':Sequelize[_0xe95c('0x1')]},'description':{'type':Sequelize[_0xe95c('0x1')]},'interval':{'type':Sequelize[_0xe95c('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ced5502..b9236b5 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 _0xcce6=['autoAssociation','find','addInterval','IntervalId','getIntervals','options','addIntervals','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Intervals','userProfileId'];(function(_0x1fca0f,_0x31bc5f){var _0x16fee7=function(_0x50f929){while(--_0x50f929){_0x1fca0f['push'](_0x1fca0f['shift']());}};_0x16fee7(++_0x31bc5f);}(_0xcce6,0x65));var _0x6cce=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xcce6[_0xc82d1a];return _0x32fad2;};'use strict';var emlformat=require(_0x6cce('0x0'));var rimraf=require(_0x6cce('0x1'));var zipdir=require(_0x6cce('0x2'));var jsonpatch=require(_0x6cce('0x3'));var rp=require(_0x6cce('0x4'));var moment=require(_0x6cce('0x5'));var BPromise=require(_0x6cce('0x6'));var Mustache=require(_0x6cce('0x7'));var util=require('util');var path=require(_0x6cce('0x8'));var sox=require('sox');var csv=require(_0x6cce('0x9'));var ejs=require(_0x6cce('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cce('0xb'));var squel=require(_0x6cce('0xc'));var crypto=require(_0x6cce('0xd'));var jsforce=require(_0x6cce('0xe'));var deskjs=require(_0x6cce('0xf'));var toCsv=require(_0x6cce('0x9'));var querystring=require(_0x6cce('0x10'));var Papa=require(_0x6cce('0x11'));var Redis=require('ioredis');var authService=require(_0x6cce('0x12'));var qs=require(_0x6cce('0x13'));var as=require(_0x6cce('0x14'));var hardwareService=require(_0x6cce('0x15'));var logger=require(_0x6cce('0x16'))(_0x6cce('0x17'));var utils=require(_0x6cce('0x18'));var config=require(_0x6cce('0x19'));var licenseUtil=require(_0x6cce('0x1a'));var db=require(_0x6cce('0x1b'))['db'];var extensions=require(_0x6cce('0x1c'));function respondWithStatusCode(_0x55000d,_0x18490c){_0x18490c=_0x18490c||0xcc;return function(_0x1faf4f){if(_0x1faf4f){return _0x55000d[_0x6cce('0x1d')](_0x18490c);}return _0x55000d[_0x6cce('0x1e')](_0x18490c)['end']();};}function respondWithResult(_0x543298,_0x1ff497){_0x1ff497=_0x1ff497||0xc8;return function(_0x308b52){if(_0x308b52){return _0x543298[_0x6cce('0x1e')](_0x1ff497)[_0x6cce('0x1f')](_0x308b52);}};}function respondWithFilteredResult(_0x549bf2,_0x4a28ce){return function(_0x321806){if(_0x321806){var _0x137986=typeof _0x4a28ce[_0x6cce('0x20')]===_0x6cce('0x21')&&typeof _0x4a28ce[_0x6cce('0x22')]===_0x6cce('0x21');var _0x21a6d6=_0x321806[_0x6cce('0x23')];var _0x87c212=_0x137986?0x0:_0x4a28ce[_0x6cce('0x20')];var _0x344e61=_0x137986?_0x321806[_0x6cce('0x23')]:_0x4a28ce[_0x6cce('0x20')]+_0x4a28ce['limit'];var _0xa97fa5;if(_0x344e61>=_0x21a6d6){_0x344e61=_0x21a6d6;_0xa97fa5=0xc8;}else{_0xa97fa5=0xce;}_0x549bf2[_0x6cce('0x1e')](_0xa97fa5);return _0x549bf2['set'](_0x6cce('0x24'),_0x87c212+'-'+_0x344e61+'/'+_0x21a6d6)[_0x6cce('0x1f')](_0x321806);}return null;};}function patchUpdates(_0x38a0e6){return function(_0x5a2c8f){try{jsonpatch[_0x6cce('0x25')](_0x5a2c8f,_0x38a0e6,!![]);}catch(_0x26dedb){return BPromise['reject'](_0x26dedb);}return _0x5a2c8f['save']();};}function saveUpdates(_0x36d4b2,_0xac526d){return function(_0x2b5cde){if(_0x2b5cde){return _0x2b5cde[_0x6cce('0x26')](_0x36d4b2)[_0x6cce('0x27')](function(_0x40630b){return _0x40630b;});}return null;};}function removeEntity(_0x577578,_0xf565ac){return function(_0x4d1d8d){if(_0x4d1d8d){return _0x4d1d8d[_0x6cce('0x28')]()['then'](function(){var _0x4305ee=_0x4d1d8d[_0x6cce('0x29')]({'plain':!![]});var _0x1a0074='Intervals';return db[_0x6cce('0x2a')][_0x6cce('0x28')]({'where':{'type':_0x1a0074,'resourceId':_0x4305ee['id']}})['then'](function(){return _0x4d1d8d;});})[_0x6cce('0x27')](function(){_0x577578['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5942dc,_0x3c6f82){return function(_0x1c3a9a){if(!_0x1c3a9a){_0x5942dc[_0x6cce('0x1d')](0x194);}return _0x1c3a9a;};}function handleError(_0x548e0b,_0x1a21c0){_0x1a21c0=_0x1a21c0||0x1f4;return function(_0x3cd9c0){logger[_0x6cce('0x2b')](_0x3cd9c0[_0x6cce('0x2c')]);if(_0x3cd9c0['name']){delete _0x3cd9c0[_0x6cce('0x2d')];}_0x548e0b[_0x6cce('0x1e')](_0x1a21c0)[_0x6cce('0x2e')](_0x3cd9c0);};}exports['index']=function(_0x16e1e2,_0x220243){var _0x17a413={},_0x551bfd={},_0x51b493={'count':0x0,'rows':[]};var _0x2cf863=_[_0x6cce('0x2f')](db[_0x6cce('0x30')][_0x6cce('0x31')],function(_0x4fdb4c){return{'name':_0x4fdb4c[_0x6cce('0x32')],'type':_0x4fdb4c[_0x6cce('0x33')][_0x6cce('0x34')]};});_0x551bfd['model']=_['map'](_0x2cf863,_0x6cce('0x2d'));_0x551bfd[_0x6cce('0x35')]=_['keys'](_0x16e1e2[_0x6cce('0x35')]);_0x551bfd[_0x6cce('0x36')]=_[_0x6cce('0x37')](_0x551bfd['model'],_0x551bfd['query']);_0x17a413['attributes']=_[_0x6cce('0x37')](_0x551bfd[_0x6cce('0x38')],qs[_0x6cce('0x39')](_0x16e1e2[_0x6cce('0x35')][_0x6cce('0x39')]));_0x17a413[_0x6cce('0x3a')]=_0x17a413[_0x6cce('0x3a')][_0x6cce('0x3b')]?_0x17a413[_0x6cce('0x3a')]:_0x551bfd['model'];if(!_0x16e1e2[_0x6cce('0x35')][_0x6cce('0x3c')](_0x6cce('0x3d'))){_0x17a413[_0x6cce('0x22')]=qs[_0x6cce('0x22')](_0x16e1e2['query'][_0x6cce('0x22')]);_0x17a413[_0x6cce('0x20')]=qs['offset'](_0x16e1e2[_0x6cce('0x35')]['offset']);}_0x17a413[_0x6cce('0x3e')]=qs[_0x6cce('0x3f')](_0x16e1e2[_0x6cce('0x35')][_0x6cce('0x3f')]);_0x17a413[_0x6cce('0x40')]=qs[_0x6cce('0x36')](_[_0x6cce('0x41')](_0x16e1e2['query'],_0x551bfd['filters']),_0x2cf863);if(_0x16e1e2[_0x6cce('0x35')]['filter']){_0x17a413['where']=_[_0x6cce('0x42')](_0x17a413[_0x6cce('0x40')],{'$or':_[_0x6cce('0x2f')](_0x2cf863,function(_0x510a4a){if(_0x510a4a[_0x6cce('0x33')]!==_0x6cce('0x43')){var _0xd558ed={};_0xd558ed[_0x510a4a[_0x6cce('0x2d')]]={'$like':'%'+_0x16e1e2[_0x6cce('0x35')][_0x6cce('0x44')]+'%'};return _0xd558ed;}})});}_0x17a413=_[_0x6cce('0x42')]({},_0x17a413,_0x16e1e2['options']);var _0x3bb941={'where':_0x17a413[_0x6cce('0x40')]};return db[_0x6cce('0x30')][_0x6cce('0x23')](_0x3bb941)[_0x6cce('0x27')](function(_0x51900c){_0x51b493[_0x6cce('0x23')]=_0x51900c;if(_0x16e1e2[_0x6cce('0x35')][_0x6cce('0x45')]){_0x17a413[_0x6cce('0x46')]=[{'all':!![]}];}return db[_0x6cce('0x30')][_0x6cce('0x47')](_0x17a413);})[_0x6cce('0x27')](function(_0x29bb38){_0x51b493[_0x6cce('0x48')]=_0x29bb38;return _0x51b493;})[_0x6cce('0x27')](respondWithFilteredResult(_0x220243,_0x17a413))[_0x6cce('0x49')](handleError(_0x220243,null));};exports[_0x6cce('0x4a')]=function(_0x182801,_0x3df2af){var _0x1024fb={'raw':!![],'where':{'id':_0x182801[_0x6cce('0x4b')]['id']}},_0x24a134={};_0x24a134[_0x6cce('0x38')]=_[_0x6cce('0x4c')](db[_0x6cce('0x30')][_0x6cce('0x31')]);_0x24a134[_0x6cce('0x35')]=_[_0x6cce('0x4c')](_0x182801[_0x6cce('0x35')]);_0x24a134[_0x6cce('0x36')]=_[_0x6cce('0x37')](_0x24a134[_0x6cce('0x38')],_0x24a134[_0x6cce('0x35')]);_0x1024fb[_0x6cce('0x3a')]=_[_0x6cce('0x37')](_0x24a134[_0x6cce('0x38')],qs[_0x6cce('0x39')](_0x182801['query'][_0x6cce('0x39')]));_0x1024fb[_0x6cce('0x3a')]=_0x1024fb[_0x6cce('0x3a')][_0x6cce('0x3b')]?_0x1024fb[_0x6cce('0x3a')]:_0x24a134[_0x6cce('0x38')];if(_0x182801[_0x6cce('0x35')]['includeAll']){_0x1024fb[_0x6cce('0x46')]=[{'all':!![]}];}_0x1024fb=_[_0x6cce('0x42')]({},_0x1024fb,_0x182801['options']);return db[_0x6cce('0x30')]['find'](_0x1024fb)[_0x6cce('0x27')](handleEntityNotFound(_0x3df2af,null))[_0x6cce('0x27')](respondWithResult(_0x3df2af,null))[_0x6cce('0x49')](handleError(_0x3df2af,null));};exports[_0x6cce('0x4d')]=function(_0x5d237f,_0x3547da){return db[_0x6cce('0x30')][_0x6cce('0x4d')](_0x5d237f[_0x6cce('0x4e')],{})['then'](function(_0x1c342f){var _0x14e320=_0x5d237f['user'][_0x6cce('0x29')]({'plain':!![]});if(!_0x14e320)throw new Error(_0x6cce('0x4f'));if(_0x14e320['role']===_0x6cce('0x50')){var _0x18df6a=_0x1c342f[_0x6cce('0x29')]({'plain':!![]});var _0x54eb52=_0x6cce('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x54eb52,'userProfileId':_0x14e320[_0x6cce('0x52')]},'raw':!![]})[_0x6cce('0x27')](function(_0x5424b2){if(_0x5424b2&&_0x5424b2[_0x6cce('0x53')]===0x0){return db[_0x6cce('0x2a')]['create']({'name':_0x18df6a[_0x6cce('0x2d')],'resourceId':_0x18df6a['id'],'type':_0x5424b2[_0x6cce('0x2d')],'sectionId':_0x5424b2['id']},{})[_0x6cce('0x27')](function(){return _0x1c342f;});}else{return _0x1c342f;}})['catch'](function(_0x45706c){logger[_0x6cce('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45706c);throw _0x45706c;});}return _0x1c342f;})['then'](respondWithResult(_0x3547da,0xc9))[_0x6cce('0x49')](handleError(_0x3547da,null));};exports[_0x6cce('0x26')]=function(_0x175f2c,_0x5be8f1){if(_0x175f2c[_0x6cce('0x4e')]['id']){delete _0x175f2c['body']['id'];}return db['Interval'][_0x6cce('0x54')]({'where':{'id':_0x175f2c[_0x6cce('0x4b')]['id']}})[_0x6cce('0x27')](handleEntityNotFound(_0x5be8f1,null))['then'](saveUpdates(_0x175f2c[_0x6cce('0x4e')],null))[_0x6cce('0x27')](respondWithResult(_0x5be8f1,null))[_0x6cce('0x49')](handleError(_0x5be8f1,null));};exports['destroy']=function(_0x204f3f,_0x4cbe9d){return db[_0x6cce('0x30')][_0x6cce('0x54')]({'where':{'id':_0x204f3f[_0x6cce('0x4b')]['id']}})[_0x6cce('0x27')](handleEntityNotFound(_0x4cbe9d,null))[_0x6cce('0x27')](removeEntity(_0x4cbe9d,null))['catch'](handleError(_0x4cbe9d,null));};exports[_0x6cce('0x55')]=function(_0x398dac,_0x484aea,_0x2e0489){if(_0x398dac[_0x6cce('0x4e')]['id']){delete _0x398dac['body']['id'];}return db[_0x6cce('0x30')][_0x6cce('0x54')]({'where':{'id':_0x398dac[_0x6cce('0x4b')]['id']}})[_0x6cce('0x27')](handleEntityNotFound(_0x484aea,null))['then'](function(_0x2b8f3c){if(_0x2b8f3c){_0x398dac[_0x6cce('0x4e')][_0x6cce('0x56')]=_0x2b8f3c['id'];return db[_0x6cce('0x30')][_0x6cce('0x4d')](_0x398dac['body']);}})[_0x6cce('0x27')](respondWithResult(_0x484aea,null))[_0x6cce('0x49')](handleError(_0x484aea,null));};exports[_0x6cce('0x57')]=function(_0x4e3a2f,_0x349245,_0x13d1df){var _0x52110d={};var _0x427bd7={};var _0x47c1d1;var _0x5f033f;return db[_0x6cce('0x30')]['findOne']({'where':{'id':_0x4e3a2f['params']['id']}})[_0x6cce('0x27')](handleEntityNotFound(_0x349245,null))[_0x6cce('0x27')](function(_0x20f974){if(_0x20f974){_0x47c1d1=_0x20f974;_0x427bd7[_0x6cce('0x38')]=_[_0x6cce('0x4c')](db[_0x6cce('0x30')][_0x6cce('0x31')]);_0x427bd7['query']=_['keys'](_0x4e3a2f[_0x6cce('0x35')]);_0x427bd7[_0x6cce('0x36')]=_[_0x6cce('0x37')](_0x427bd7[_0x6cce('0x38')],_0x427bd7[_0x6cce('0x35')]);_0x52110d[_0x6cce('0x3a')]=_['intersection'](_0x427bd7[_0x6cce('0x38')],qs[_0x6cce('0x39')](_0x4e3a2f[_0x6cce('0x35')][_0x6cce('0x39')]));_0x52110d['attributes']=_0x52110d['attributes']['length']?_0x52110d['attributes']:_0x427bd7[_0x6cce('0x38')];_0x52110d[_0x6cce('0x3e')]=qs[_0x6cce('0x3f')](_0x4e3a2f[_0x6cce('0x35')][_0x6cce('0x3f')]);_0x52110d['where']=qs[_0x6cce('0x36')](_[_0x6cce('0x41')](_0x4e3a2f['query'],_0x427bd7[_0x6cce('0x36')]));if(_0x4e3a2f[_0x6cce('0x35')][_0x6cce('0x44')]){_0x52110d[_0x6cce('0x40')]=_[_0x6cce('0x42')](_0x52110d[_0x6cce('0x40')],{'$or':_['map'](_0x52110d['attributes'],function(_0x4a0ebb){var _0x3669bb={};_0x3669bb[_0x4a0ebb]={'$like':'%'+_0x4e3a2f[_0x6cce('0x35')][_0x6cce('0x44')]+'%'};return _0x3669bb;})});}_0x52110d=_[_0x6cce('0x42')]({},_0x52110d,_0x4e3a2f[_0x6cce('0x58')]);return _0x47c1d1[_0x6cce('0x57')](_0x52110d);}})[_0x6cce('0x27')](function(_0x42c18e){if(_0x42c18e){_0x5f033f=_0x42c18e[_0x6cce('0x3b')];if(!_0x4e3a2f['query'][_0x6cce('0x3c')]('nolimit')){_0x52110d[_0x6cce('0x22')]=qs['limit'](_0x4e3a2f['query'][_0x6cce('0x22')]);_0x52110d[_0x6cce('0x20')]=qs[_0x6cce('0x20')](_0x4e3a2f['query'][_0x6cce('0x20')]);}return _0x47c1d1['getIntervals'](_0x52110d);}})[_0x6cce('0x27')](function(_0x465eff){if(_0x465eff){return _0x465eff?{'count':_0x5f033f,'rows':_0x465eff}:null;}})['then'](respondWithResult(_0x349245,null))[_0x6cce('0x49')](handleError(_0x349245,null));};exports[_0x6cce('0x59')]=function(_0x42132a,_0x6034a9,_0x2cb927){return db[_0x6cce('0x30')][_0x6cce('0x5a')]({'where':{'id':_0x42132a['params']['id']}})[_0x6cce('0x27')](handleEntityNotFound(_0x6034a9,null))[_0x6cce('0x27')](function(_0xf2ee6){if(_0xf2ee6){return db['sequelize'][_0x6cce('0x5b')](function(_0x49748c){return db['Interval']['destroy']({'where':{'IntervalId':_0x42132a[_0x6cce('0x4b')]['id']},'transaction':_0x49748c})['then'](function(_0x54f5e0){var _0x3f035f=_['map'](_0x42132a['body'],function(_0x4ad6e9){delete _0x4ad6e9['id'];_0x4ad6e9['IntervalId']=_0x42132a[_0x6cce('0x4b')]['id'];return _0x4ad6e9;});return db[_0x6cce('0x30')]['bulkCreate'](_0x3f035f,{'transaction':_0x49748c});});})[_0x6cce('0x27')](function(){return db['Interval'][_0x6cce('0x47')]({'where':{'IntervalId':_0x42132a[_0x6cce('0x4b')]['id']}});});}})[_0x6cce('0x27')](respondWithResult(_0x6034a9,null))[_0x6cce('0x49')](handleError(_0x6034a9,null));}; \ No newline at end of file +var _0xd43b=['getIntervals','findOne','hasOwnProperty','addIntervals','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','Intervals','sendStatus','stack','name','map','Interval','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0xd43b,0xb4));var _0xbd43=function(_0x2df24b,_0x57bb9a){_0x2df24b=_0x2df24b-0x0;var _0x2dc649=_0xd43b[_0x2df24b];return _0x2dc649;};'use strict';var emlformat=require(_0xbd43('0x0'));var rimraf=require(_0xbd43('0x1'));var zipdir=require(_0xbd43('0x2'));var jsonpatch=require(_0xbd43('0x3'));var rp=require('request-promise');var moment=require(_0xbd43('0x4'));var BPromise=require(_0xbd43('0x5'));var Mustache=require(_0xbd43('0x6'));var util=require(_0xbd43('0x7'));var path=require(_0xbd43('0x8'));var sox=require(_0xbd43('0x9'));var csv=require('to-csv');var ejs=require(_0xbd43('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd43('0xb'));var squel=require(_0xbd43('0xc'));var crypto=require(_0xbd43('0xd'));var jsforce=require(_0xbd43('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbd43('0xf'));var querystring=require('querystring');var Papa=require(_0xbd43('0x10'));var Redis=require(_0xbd43('0x11'));var authService=require(_0xbd43('0x12'));var qs=require(_0xbd43('0x13'));var as=require(_0xbd43('0x14'));var hardwareService=require(_0xbd43('0x15'));var logger=require(_0xbd43('0x16'))(_0xbd43('0x17'));var utils=require(_0xbd43('0x18'));var config=require(_0xbd43('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd43('0x1a'))['db'];var extensions=require(_0xbd43('0x1b'));function respondWithStatusCode(_0x170856,_0x222248){_0x222248=_0x222248||0xcc;return function(_0xe1d2dc){if(_0xe1d2dc){return _0x170856['sendStatus'](_0x222248);}return _0x170856[_0xbd43('0x1c')](_0x222248)[_0xbd43('0x1d')]();};}function respondWithResult(_0x5d66e2,_0x126b7d){_0x126b7d=_0x126b7d||0xc8;return function(_0x9c46d9){if(_0x9c46d9){return _0x5d66e2[_0xbd43('0x1c')](_0x126b7d)[_0xbd43('0x1e')](_0x9c46d9);}};}function respondWithFilteredResult(_0x46e536,_0x597699){return function(_0x324a93){if(_0x324a93){var _0x46dd7b=typeof _0x597699[_0xbd43('0x1f')]===_0xbd43('0x20')&&typeof _0x597699['limit']===_0xbd43('0x20');var _0x106a35=_0x324a93[_0xbd43('0x21')];var _0x3e3fae=_0x46dd7b?0x0:_0x597699[_0xbd43('0x1f')];var _0x1a041e=_0x46dd7b?_0x324a93['count']:_0x597699[_0xbd43('0x1f')]+_0x597699[_0xbd43('0x22')];var _0x7a6026;if(_0x1a041e>=_0x106a35){_0x1a041e=_0x106a35;_0x7a6026=0xc8;}else{_0x7a6026=0xce;}_0x46e536[_0xbd43('0x1c')](_0x7a6026);return _0x46e536[_0xbd43('0x23')]('Content-Range',_0x3e3fae+'-'+_0x1a041e+'/'+_0x106a35)['json'](_0x324a93);}return null;};}function patchUpdates(_0x3249b7){return function(_0x526759){try{jsonpatch['apply'](_0x526759,_0x3249b7,!![]);}catch(_0x3d52ed){return BPromise[_0xbd43('0x24')](_0x3d52ed);}return _0x526759[_0xbd43('0x25')]();};}function saveUpdates(_0x4620ca,_0x1ba349){return function(_0x274ff9){if(_0x274ff9){return _0x274ff9[_0xbd43('0x26')](_0x4620ca)[_0xbd43('0x27')](function(_0x8c6d7f){return _0x8c6d7f;});}return null;};}function removeEntity(_0x550de3,_0x44b44c){return function(_0x8385b0){if(_0x8385b0){return _0x8385b0[_0xbd43('0x28')]()[_0xbd43('0x27')](function(){var _0x4f3202=_0x8385b0[_0xbd43('0x29')]({'plain':!![]});var _0x239be3=_0xbd43('0x2a');return db['UserProfileResource'][_0xbd43('0x28')]({'where':{'type':_0x239be3,'resourceId':_0x4f3202['id']}})[_0xbd43('0x27')](function(){return _0x8385b0;});})['then'](function(){_0x550de3['status'](0xcc)[_0xbd43('0x1d')]();});}};}function handleEntityNotFound(_0x998042,_0x535e51){return function(_0x168131){if(!_0x168131){_0x998042[_0xbd43('0x2b')](0x194);}return _0x168131;};}function handleError(_0x14e459,_0x10adf2){_0x10adf2=_0x10adf2||0x1f4;return function(_0x2abf82){logger['error'](_0x2abf82[_0xbd43('0x2c')]);if(_0x2abf82[_0xbd43('0x2d')]){delete _0x2abf82[_0xbd43('0x2d')];}_0x14e459[_0xbd43('0x1c')](_0x10adf2)['send'](_0x2abf82);};}exports['index']=function(_0x300022,_0x9bd25d){var _0x34c115={},_0x2012c2={},_0x57946c={'count':0x0,'rows':[]};var _0x35411c=_[_0xbd43('0x2e')](db[_0xbd43('0x2f')]['rawAttributes'],function(_0x398d70){return{'name':_0x398d70['fieldName'],'type':_0x398d70[_0xbd43('0x30')][_0xbd43('0x31')]};});_0x2012c2['model']=_[_0xbd43('0x2e')](_0x35411c,_0xbd43('0x2d'));_0x2012c2[_0xbd43('0x32')]=_['keys'](_0x300022['query']);_0x2012c2[_0xbd43('0x33')]=_[_0xbd43('0x34')](_0x2012c2['model'],_0x2012c2[_0xbd43('0x32')]);_0x34c115[_0xbd43('0x35')]=_[_0xbd43('0x34')](_0x2012c2[_0xbd43('0x36')],qs[_0xbd43('0x37')](_0x300022[_0xbd43('0x32')][_0xbd43('0x37')]));_0x34c115[_0xbd43('0x35')]=_0x34c115[_0xbd43('0x35')][_0xbd43('0x38')]?_0x34c115[_0xbd43('0x35')]:_0x2012c2[_0xbd43('0x36')];if(!_0x300022['query']['hasOwnProperty'](_0xbd43('0x39'))){_0x34c115[_0xbd43('0x22')]=qs[_0xbd43('0x22')](_0x300022['query']['limit']);_0x34c115[_0xbd43('0x1f')]=qs[_0xbd43('0x1f')](_0x300022[_0xbd43('0x32')]['offset']);}_0x34c115[_0xbd43('0x3a')]=qs[_0xbd43('0x3b')](_0x300022[_0xbd43('0x32')][_0xbd43('0x3b')]);_0x34c115[_0xbd43('0x3c')]=qs['filters'](_[_0xbd43('0x3d')](_0x300022['query'],_0x2012c2[_0xbd43('0x33')]),_0x35411c);if(_0x300022[_0xbd43('0x32')]['filter']){_0x34c115[_0xbd43('0x3c')]=_[_0xbd43('0x3e')](_0x34c115[_0xbd43('0x3c')],{'$or':_[_0xbd43('0x2e')](_0x35411c,function(_0x512fd3){if(_0x512fd3[_0xbd43('0x30')]!==_0xbd43('0x3f')){var _0x2c96fe={};_0x2c96fe[_0x512fd3['name']]={'$like':'%'+_0x300022[_0xbd43('0x32')][_0xbd43('0x40')]+'%'};return _0x2c96fe;}})});}_0x34c115=_[_0xbd43('0x3e')]({},_0x34c115,_0x300022[_0xbd43('0x41')]);var _0x5ba140={'where':_0x34c115[_0xbd43('0x3c')]};return db[_0xbd43('0x2f')]['count'](_0x5ba140)[_0xbd43('0x27')](function(_0x77416b){_0x57946c[_0xbd43('0x21')]=_0x77416b;if(_0x300022[_0xbd43('0x32')][_0xbd43('0x42')]){_0x34c115[_0xbd43('0x43')]=[{'all':!![]}];}return db[_0xbd43('0x2f')][_0xbd43('0x44')](_0x34c115);})[_0xbd43('0x27')](function(_0xe02979){_0x57946c['rows']=_0xe02979;return _0x57946c;})[_0xbd43('0x27')](respondWithFilteredResult(_0x9bd25d,_0x34c115))[_0xbd43('0x45')](handleError(_0x9bd25d,null));};exports['show']=function(_0x39162c,_0x26cc54){var _0x56908d={'raw':!![],'where':{'id':_0x39162c[_0xbd43('0x46')]['id']}},_0x552fb9={};_0x552fb9[_0xbd43('0x36')]=_[_0xbd43('0x47')](db[_0xbd43('0x2f')][_0xbd43('0x48')]);_0x552fb9[_0xbd43('0x32')]=_[_0xbd43('0x47')](_0x39162c[_0xbd43('0x32')]);_0x552fb9[_0xbd43('0x33')]=_[_0xbd43('0x34')](_0x552fb9['model'],_0x552fb9['query']);_0x56908d[_0xbd43('0x35')]=_['intersection'](_0x552fb9['model'],qs[_0xbd43('0x37')](_0x39162c[_0xbd43('0x32')][_0xbd43('0x37')]));_0x56908d[_0xbd43('0x35')]=_0x56908d[_0xbd43('0x35')][_0xbd43('0x38')]?_0x56908d[_0xbd43('0x35')]:_0x552fb9[_0xbd43('0x36')];if(_0x39162c[_0xbd43('0x32')][_0xbd43('0x42')]){_0x56908d['include']=[{'all':!![]}];}_0x56908d=_[_0xbd43('0x3e')]({},_0x56908d,_0x39162c['options']);return db[_0xbd43('0x2f')][_0xbd43('0x49')](_0x56908d)['then'](handleEntityNotFound(_0x26cc54,null))[_0xbd43('0x27')](respondWithResult(_0x26cc54,null))[_0xbd43('0x45')](handleError(_0x26cc54,null));};exports['create']=function(_0x119777,_0x18554a){return db[_0xbd43('0x2f')][_0xbd43('0x4a')](_0x119777['body'],{})['then'](function(_0x2643da){var _0x3a3a15=_0x119777['user'][_0xbd43('0x29')]({'plain':!![]});if(!_0x3a3a15)throw new Error(_0xbd43('0x4b'));if(_0x3a3a15['role']===_0xbd43('0x4c')){var _0x31e12d=_0x2643da[_0xbd43('0x29')]({'plain':!![]});var _0x27f89f=_0xbd43('0x2a');return db[_0xbd43('0x4d')][_0xbd43('0x49')]({'where':{'name':_0x27f89f,'userProfileId':_0x3a3a15[_0xbd43('0x4e')]},'raw':!![]})[_0xbd43('0x27')](function(_0x1909de){if(_0x1909de&&_0x1909de[_0xbd43('0x4f')]===0x0){return db[_0xbd43('0x50')][_0xbd43('0x4a')]({'name':_0x31e12d[_0xbd43('0x2d')],'resourceId':_0x31e12d['id'],'type':_0x1909de['name'],'sectionId':_0x1909de['id']},{})[_0xbd43('0x27')](function(){return _0x2643da;});}else{return _0x2643da;}})[_0xbd43('0x45')](function(_0x4db2c1){logger['error'](_0xbd43('0x51'),_0x4db2c1);throw _0x4db2c1;});}return _0x2643da;})[_0xbd43('0x27')](respondWithResult(_0x18554a,0xc9))[_0xbd43('0x45')](handleError(_0x18554a,null));};exports[_0xbd43('0x26')]=function(_0x41a023,_0x332934){if(_0x41a023[_0xbd43('0x52')]['id']){delete _0x41a023['body']['id'];}return db['Interval']['find']({'where':{'id':_0x41a023[_0xbd43('0x46')]['id']}})[_0xbd43('0x27')](handleEntityNotFound(_0x332934,null))[_0xbd43('0x27')](saveUpdates(_0x41a023[_0xbd43('0x52')],null))[_0xbd43('0x27')](respondWithResult(_0x332934,null))[_0xbd43('0x45')](handleError(_0x332934,null));};exports['destroy']=function(_0x6ca2cd,_0x4c2f15){return db[_0xbd43('0x2f')][_0xbd43('0x49')]({'where':{'id':_0x6ca2cd['params']['id']}})[_0xbd43('0x27')](handleEntityNotFound(_0x4c2f15,null))['then'](removeEntity(_0x4c2f15,null))[_0xbd43('0x45')](handleError(_0x4c2f15,null));};exports[_0xbd43('0x53')]=function(_0x5b2216,_0x43ce60,_0x2b4fa4){if(_0x5b2216['body']['id']){delete _0x5b2216[_0xbd43('0x52')]['id'];}return db[_0xbd43('0x2f')][_0xbd43('0x49')]({'where':{'id':_0x5b2216[_0xbd43('0x46')]['id']}})['then'](handleEntityNotFound(_0x43ce60,null))[_0xbd43('0x27')](function(_0x3be8a0){if(_0x3be8a0){_0x5b2216[_0xbd43('0x52')]['IntervalId']=_0x3be8a0['id'];return db['Interval']['create'](_0x5b2216[_0xbd43('0x52')]);}})['then'](respondWithResult(_0x43ce60,null))['catch'](handleError(_0x43ce60,null));};exports[_0xbd43('0x54')]=function(_0x37ed31,_0x47fc3f,_0x44515f){var _0x1ee43c={};var _0x4ef762={};var _0x1e74ac;var _0x32a8b2;return db['Interval'][_0xbd43('0x55')]({'where':{'id':_0x37ed31[_0xbd43('0x46')]['id']}})[_0xbd43('0x27')](handleEntityNotFound(_0x47fc3f,null))['then'](function(_0x1e78ec){if(_0x1e78ec){_0x1e74ac=_0x1e78ec;_0x4ef762[_0xbd43('0x36')]=_[_0xbd43('0x47')](db[_0xbd43('0x2f')][_0xbd43('0x48')]);_0x4ef762[_0xbd43('0x32')]=_['keys'](_0x37ed31[_0xbd43('0x32')]);_0x4ef762['filters']=_[_0xbd43('0x34')](_0x4ef762[_0xbd43('0x36')],_0x4ef762[_0xbd43('0x32')]);_0x1ee43c[_0xbd43('0x35')]=_[_0xbd43('0x34')](_0x4ef762[_0xbd43('0x36')],qs[_0xbd43('0x37')](_0x37ed31[_0xbd43('0x32')][_0xbd43('0x37')]));_0x1ee43c[_0xbd43('0x35')]=_0x1ee43c[_0xbd43('0x35')][_0xbd43('0x38')]?_0x1ee43c[_0xbd43('0x35')]:_0x4ef762['model'];_0x1ee43c[_0xbd43('0x3a')]=qs[_0xbd43('0x3b')](_0x37ed31[_0xbd43('0x32')]['sort']);_0x1ee43c[_0xbd43('0x3c')]=qs[_0xbd43('0x33')](_[_0xbd43('0x3d')](_0x37ed31['query'],_0x4ef762['filters']));if(_0x37ed31[_0xbd43('0x32')]['filter']){_0x1ee43c[_0xbd43('0x3c')]=_['merge'](_0x1ee43c[_0xbd43('0x3c')],{'$or':_[_0xbd43('0x2e')](_0x1ee43c[_0xbd43('0x35')],function(_0xdd7e3c){var _0x3ab991={};_0x3ab991[_0xdd7e3c]={'$like':'%'+_0x37ed31[_0xbd43('0x32')][_0xbd43('0x40')]+'%'};return _0x3ab991;})});}_0x1ee43c=_[_0xbd43('0x3e')]({},_0x1ee43c,_0x37ed31['options']);return _0x1e74ac[_0xbd43('0x54')](_0x1ee43c);}})['then'](function(_0x497eca){if(_0x497eca){_0x32a8b2=_0x497eca[_0xbd43('0x38')];if(!_0x37ed31[_0xbd43('0x32')][_0xbd43('0x56')](_0xbd43('0x39'))){_0x1ee43c['limit']=qs[_0xbd43('0x22')](_0x37ed31[_0xbd43('0x32')][_0xbd43('0x22')]);_0x1ee43c[_0xbd43('0x1f')]=qs[_0xbd43('0x1f')](_0x37ed31[_0xbd43('0x32')]['offset']);}return _0x1e74ac['getIntervals'](_0x1ee43c);}})[_0xbd43('0x27')](function(_0x39d83b){if(_0x39d83b){return _0x39d83b?{'count':_0x32a8b2,'rows':_0x39d83b}:null;}})[_0xbd43('0x27')](respondWithResult(_0x47fc3f,null))[_0xbd43('0x45')](handleError(_0x47fc3f,null));};exports[_0xbd43('0x57')]=function(_0xd076ee,_0x187c14,_0x43956f){return db[_0xbd43('0x2f')]['findOne']({'where':{'id':_0xd076ee[_0xbd43('0x46')]['id']}})[_0xbd43('0x27')](handleEntityNotFound(_0x187c14,null))[_0xbd43('0x27')](function(_0x485c42){if(_0x485c42){return db['sequelize']['transaction'](function(_0x5ad15d){return db[_0xbd43('0x2f')][_0xbd43('0x28')]({'where':{'IntervalId':_0xd076ee[_0xbd43('0x46')]['id']},'transaction':_0x5ad15d})['then'](function(_0x440bca){var _0x58264e=_[_0xbd43('0x2e')](_0xd076ee[_0xbd43('0x52')],function(_0x1553c5){delete _0x1553c5['id'];_0x1553c5['IntervalId']=_0xd076ee[_0xbd43('0x46')]['id'];return _0x1553c5;});return db[_0xbd43('0x2f')]['bulkCreate'](_0x58264e,{'transaction':_0x5ad15d});});})[_0xbd43('0x27')](function(){return db[_0xbd43('0x2f')]['findAll']({'where':{'IntervalId':_0xd076ee[_0xbd43('0x46')]['id']}});});}})[_0xbd43('0x27')](respondWithResult(_0x187c14,null))[_0xbd43('0x45')](handleError(_0x187c14,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 0603337..758da1d 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 _0x4885=['../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x179ccb,_0x1c1b61){var _0x3188f3=function(_0x4c1da4){while(--_0x4c1da4){_0x179ccb['push'](_0x179ccb['shift']());}};_0x3188f3(++_0x1c1b61);}(_0x4885,0x12e));var _0x5488=function(_0x2c9c71,_0x52eed2){_0x2c9c71=_0x2c9c71-0x0;var _0x1b012f=_0x4885[_0x2c9c71];return _0x1b012f;};'use strict';var _=require(_0x5488('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5488('0x1'));var rp=require(_0x5488('0x2'));var fs=require('fs');var path=require(_0x5488('0x3'));var rimraf=require(_0x5488('0x4'));var config=require(_0x5488('0x5'));var attributes=require('./interval.attributes');var extensions=require(_0x5488('0x6'));module[_0x5488('0x7')]=function(_0x24891c,_0x563c98){return _0x24891c[_0x5488('0x8')](_0x5488('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a1806,_0x10df59){extensions['rewrite'](_0x24891c,_0x1a1806);},'afterBulkCreate':function(_0x279cf8,_0x36298a,_0x42d2b4){_0x42d2b4();extensions[_0x5488('0xa')](_0x24891c,_0x279cf8[0x0]);},'afterUpdate':function(_0x2c49d8,_0x15a8fa){extensions[_0x5488('0xa')](_0x24891c,_0x2c49d8);},'afterDestroy':function(_0x3da30e,_0x3bd06f){extensions[_0x5488('0xa')](_0x24891c,_0x3da30e);}}});}; \ No newline at end of file +var _0xd6e4=['rewrite','util','api','moment','bluebird','request-promise','../../config/environment','./interval.attributes','../../components/extensions/rewrite','Interval'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd6e4,0x83));var _0x4d6e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd6e4[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x4d6e('0x0'));var logger=require('../../config/logger')(_0x4d6e('0x1'));var moment=require(_0x4d6e('0x2'));var BPromise=require(_0x4d6e('0x3'));var rp=require(_0x4d6e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d6e('0x5'));var attributes=require(_0x4d6e('0x6'));var extensions=require(_0x4d6e('0x7'));module['exports']=function(_0x43415a,_0xc0541b){return _0x43415a['define'](_0x4d6e('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4db40e,_0x156912){extensions[_0x4d6e('0x9')](_0x43415a,_0x4db40e);},'afterBulkCreate':function(_0x28c5e4,_0x25c242,_0x3bc06a){_0x3bc06a();extensions[_0x4d6e('0x9')](_0x43415a,_0x28c5e4[0x0]);},'afterUpdate':function(_0x2521f,_0x3aec12){extensions['rewrite'](_0x43415a,_0x2521f);},'afterDestroy':function(_0xbd0705,_0x4add5a){extensions['rewrite'](_0x43415a,_0xbd0705);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3db6234..00cfca2 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(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_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 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(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 93b6171..a5dbc54 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x5dd8c3,_0x271b09){var _0x2b62ce=function(_0x1a4872){while(--_0x1a4872){_0x5dd8c3['push'](_0x5dd8c3['shift']());}};_0x2b62ce(++_0x271b09);}(_0x2032,0xd9));var _0x2203=function(_0x3ab95a,_0x25e997){_0x3ab95a=_0x3ab95a-0x0;var _0x445672=_0x2032[_0x3ab95a];return _0x445672;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x0b0e[_0x3d1244];return _0x5d6372;};'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 10583c1..4afa81d 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 _0x2c7a=['socket','bluebird','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','toString','request','end','statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','connection','remoteAddress'];(function(_0x27dd89,_0x1549f2){var _0x26b660=function(_0x1085b6){while(--_0x1085b6){_0x27dd89['push'](_0x27dd89['shift']());}};_0x26b660(++_0x1549f2);}(_0x2c7a,0x85));var _0xa2c7=function(_0x356a56,_0x3fd0ed){_0x356a56=_0x356a56-0x0;var _0x2a85dd=_0x2c7a[_0x356a56];return _0x2a85dd;};'use strict';var BPromise=require(_0xa2c7('0x0'));var https=require('https');var logger=require(_0xa2c7('0x1'))(_0xa2c7('0x2'));var USERNAME='support';var PASSWORD=_0xa2c7('0x3');function openIssue(_0x85ad13,_0x1d0ec2){var _0x1793aa={'fields':{'project':{'key':_0x85ad13[_0xa2c7('0x4')]||_0xa2c7('0x5')},'summary':(_0x85ad13[_0xa2c7('0x6')]||_0xa2c7('0x7'))+_0xa2c7('0x8')+_0x85ad13['ip'],'description':_0x85ad13[_0xa2c7('0x9')]||JSON[_0xa2c7('0xa')](_0x85ad13),'issuetype':{'name':_0x85ad13[_0xa2c7('0xb')]||_0xa2c7('0xc')}}};_0x1793aa[_0xa2c7('0xd')][_0xa2c7('0xe')]=_0x85ad13[_0xa2c7('0xf')];_0x1793aa[_0xa2c7('0xd')][_0xa2c7('0x10')]=_0x85ad13[_0xa2c7('0x11')];_0x1793aa[_0xa2c7('0xd')][_0xa2c7('0x12')]=_0x85ad13[_0xa2c7('0x13')];_0x1793aa[_0xa2c7('0xd')][_0xa2c7('0x14')]=_0x85ad13[_0xa2c7('0x15')];_0x1793aa['fields'][_0xa2c7('0x16')]=_0x85ad13[_0xa2c7('0x17')];_0x1793aa[_0xa2c7('0xd')][_0xa2c7('0x18')]=_0x85ad13['ip'];var _0x5c4975={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xa2c7('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xa2c7('0x1a'),'Authorization':_0xa2c7('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xa2c7('0x1c')]('base64')}};var _0x22dd77=JSON['stringify'](_0x1793aa);var _0x721e43=https[_0xa2c7('0x1d')](_0x5c4975,function(_0x36b45e){_0x36b45e['setEncoding']('utf8');var _0x3a9384='';_0x36b45e['on']('data',function(_0x94e87b){_0x3a9384+=_0x94e87b;});_0x36b45e['on'](_0xa2c7('0x1e'),function(){if(_0x1d0ec2){return _0x1d0ec2['status'](_0x36b45e[_0xa2c7('0x1f')])['json'](JSON[_0xa2c7('0x20')](_0x3a9384));}});});_0x721e43['on'](_0xa2c7('0x21'),function(_0x16b642){if(_0x1d0ec2){return _0x1d0ec2[_0xa2c7('0x22')](0x1f4)[_0xa2c7('0x23')]({'errors':[{'message':_0xa2c7('0x24'),'type':'api.jira'}]});}});_0x721e43[_0xa2c7('0x25')](_0x22dd77);_0x721e43[_0xa2c7('0x1e')]();}exports[_0xa2c7('0x26')]=openIssue;exports[_0xa2c7('0x27')]=function(_0x18f11f,_0x152541){_0x18f11f[_0xa2c7('0x28')]['ip']=_0x18f11f['headers']['x-forwarded-for']||_0x18f11f[_0xa2c7('0x29')][_0xa2c7('0x2a')]||_0x18f11f[_0xa2c7('0x2b')][_0xa2c7('0x2a')]||_0x18f11f[_0xa2c7('0x29')][_0xa2c7('0x2b')][_0xa2c7('0x2a')];return openIssue(_0x18f11f[_0xa2c7('0x28')],_0x152541);}; \ No newline at end of file +var _0xe79c=['stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','name','customfield_11504','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','api','support','3eAmWpBVP0','key','\x20from\x20','description'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xe79c,0x78));var _0xce79=function(_0x39c28f,_0x1d9878){_0x39c28f=_0x39c28f-0x0;var _0x461bb1=_0xe79c[_0x39c28f];return _0x461bb1;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0xce79('0x0'));var USERNAME=_0xce79('0x1');var PASSWORD=_0xce79('0x2');function openIssue(_0xe83ff0,_0x3ab6ea){var _0x49e8d6={'fields':{'project':{'key':_0xe83ff0[_0xce79('0x3')]||'MOTGUI'},'summary':(_0xe83ff0['summary']||'Report')+_0xce79('0x4')+_0xe83ff0['ip'],'description':_0xe83ff0[_0xce79('0x5')]||JSON[_0xce79('0x6')](_0xe83ff0),'issuetype':{'name':_0xe83ff0[_0xce79('0x7')]||_0xce79('0x8')}}};_0x49e8d6[_0xce79('0x9')][_0xce79('0xa')]=_0xe83ff0[_0xce79('0xb')];_0x49e8d6[_0xce79('0x9')][_0xce79('0xc')]=_0xe83ff0[_0xce79('0xd')];_0x49e8d6[_0xce79('0x9')]['customfield_11502']=_0xe83ff0[_0xce79('0xe')];_0x49e8d6[_0xce79('0x9')]['customfield_11503']=_0xe83ff0[_0xce79('0xf')];_0x49e8d6['fields'][_0xce79('0x10')]=_0xe83ff0['reason'];_0x49e8d6[_0xce79('0x9')]['customfield_10102']=_0xe83ff0['ip'];var _0x3e1273={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xce79('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xce79('0x12'),'Authorization':_0xce79('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0xce79('0x14')](_0xce79('0x15'))}};var _0x22516e=JSON[_0xce79('0x6')](_0x49e8d6);var _0x4ea68f=https[_0xce79('0x16')](_0x3e1273,function(_0x35f09c){_0x35f09c[_0xce79('0x17')](_0xce79('0x18'));var _0x1c1596='';_0x35f09c['on'](_0xce79('0x19'),function(_0x57bc55){_0x1c1596+=_0x57bc55;});_0x35f09c['on'](_0xce79('0x1a'),function(){if(_0x3ab6ea){return _0x3ab6ea[_0xce79('0x1b')](_0x35f09c[_0xce79('0x1c')])['json'](JSON[_0xce79('0x1d')](_0x1c1596));}});});_0x4ea68f['on']('error',function(_0x450b13){if(_0x3ab6ea){return _0x3ab6ea[_0xce79('0x1b')](0x1f4)[_0xce79('0x1e')]({'errors':[{'message':_0xce79('0x1f'),'type':_0xce79('0x20')}]});}});_0x4ea68f[_0xce79('0x21')](_0x22516e);_0x4ea68f[_0xce79('0x1a')]();}exports[_0xce79('0x22')]=openIssue;exports[_0xce79('0x23')]=function(_0x449f62,_0x18e3ad){_0x449f62[_0xce79('0x24')]['ip']=_0x449f62[_0xce79('0x25')][_0xce79('0x26')]||_0x449f62['connection'][_0xce79('0x27')]||_0x449f62[_0xce79('0x28')][_0xce79('0x27')]||_0x449f62[_0xce79('0x29')][_0xce79('0x28')]['remoteAddress'];return openIssue(_0x449f62['body'],_0x18e3ad);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 39e2abc..0b84d04 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 _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_0x3dd3ed,_0x22611d){var _0x260711=function(_0x213730){while(--_0x213730){_0x3dd3ed['push'](_0x3dd3ed['shift']());}};_0x260711(++_0x22611d);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'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 +var _0x41bb=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x80a94c,_0x94c1f3){var _0x1ed0bd=function(_0x23e0e2){while(--_0x23e0e2){_0x80a94c['push'](_0x80a94c['shift']());}};_0x1ed0bd(++_0x94c1f3);}(_0x41bb,0xc5));var _0xb41b=function(_0x4b8171,_0x275da1){_0x4b8171=_0x4b8171-0x0;var _0x3f0288=_0x41bb[_0x4b8171];return _0x3f0288;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0xd')]('/',auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router[_0xb41b('0xf')]('/:id',auth[_0xb41b('0x9')](),controller['update']);router[_0xb41b('0x10')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x11')]);module[_0xb41b('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8dea6c8..c1d7c8f 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x188581,_0x327116){_0x188581=_0x188581-0x0;var _0x21773b=_0x7a54[_0x188581];return _0x21773b;};'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(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x5b6d2f,_0x223666){_0x5b6d2f=_0x5b6d2f-0x0;var _0x492da9=_0x7a54[_0x5b6d2f];return _0x492da9;};'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 6a63dec..a9731e1 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 _0x2d2c=['name','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','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','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0x2d2c[_0xf7a9cf];return _0x7fdc45;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require(_0xc2d2('0x1'));var zipdir=require(_0xc2d2('0x2'));var jsonpatch=require(_0xc2d2('0x3'));var rp=require(_0xc2d2('0x4'));var moment=require(_0xc2d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2d2('0x6'));var util=require('util');var path=require(_0xc2d2('0x7'));var sox=require(_0xc2d2('0x8'));var csv=require(_0xc2d2('0x9'));var ejs=require(_0xc2d2('0xa'));var fs=require('fs');var fs_extra=require(_0xc2d2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2d2('0xc'));var jsforce=require(_0xc2d2('0xd'));var deskjs=require(_0xc2d2('0xe'));var toCsv=require(_0xc2d2('0x9'));var querystring=require(_0xc2d2('0xf'));var Papa=require(_0xc2d2('0x10'));var Redis=require(_0xc2d2('0x11'));var authService=require(_0xc2d2('0x12'));var qs=require(_0xc2d2('0x13'));var as=require(_0xc2d2('0x14'));var hardwareService=require(_0xc2d2('0x15'));var logger=require(_0xc2d2('0x16'))('api');var utils=require(_0xc2d2('0x17'));var config=require(_0xc2d2('0x18'));var licenseUtil=require(_0xc2d2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273269,_0x738877){_0x738877=_0x738877||0xcc;return function(_0x4c2b12){if(_0x4c2b12){return _0x273269[_0xc2d2('0x1a')](_0x738877);}return _0x273269[_0xc2d2('0x1b')](_0x738877)['end']();};}function respondWithResult(_0xa6f836,_0x4de52a){_0x4de52a=_0x4de52a||0xc8;return function(_0x5a1d24){if(_0x5a1d24){return _0xa6f836[_0xc2d2('0x1b')](_0x4de52a)[_0xc2d2('0x1c')](_0x5a1d24);}};}function respondWithFilteredResult(_0xf6bc66,_0x4006f3){return function(_0x2c42a6){if(_0x2c42a6){var _0x37552b=typeof _0x4006f3[_0xc2d2('0x1d')]===_0xc2d2('0x1e')&&typeof _0x4006f3[_0xc2d2('0x1f')]===_0xc2d2('0x1e');var _0x403d51=_0x2c42a6['count'];var _0x2d4ec4=_0x37552b?0x0:_0x4006f3[_0xc2d2('0x1d')];var _0x34f750=_0x37552b?_0x2c42a6[_0xc2d2('0x20')]:_0x4006f3['offset']+_0x4006f3[_0xc2d2('0x1f')];var _0x18cef7;if(_0x34f750>=_0x403d51){_0x34f750=_0x403d51;_0x18cef7=0xc8;}else{_0x18cef7=0xce;}_0xf6bc66['status'](_0x18cef7);return _0xf6bc66[_0xc2d2('0x21')](_0xc2d2('0x22'),_0x2d4ec4+'-'+_0x34f750+'/'+_0x403d51)[_0xc2d2('0x1c')](_0x2c42a6);}return null;};}function patchUpdates(_0xb14bc3){return function(_0x603323){try{jsonpatch['apply'](_0x603323,_0xb14bc3,!![]);}catch(_0x100d5b){return BPromise[_0xc2d2('0x23')](_0x100d5b);}return _0x603323['save']();};}function saveUpdates(_0x2cac91,_0x4e3cb5){return function(_0x5ecf78){if(_0x5ecf78){return _0x5ecf78['update'](_0x2cac91)[_0xc2d2('0x24')](function(_0x1bdcb5){return _0x1bdcb5;});}return null;};}function removeEntity(_0x7ffb28,_0x4b3449){return function(_0x2dbc46){if(_0x2dbc46){return _0x2dbc46[_0xc2d2('0x25')]()[_0xc2d2('0x24')](function(){_0x7ffb28[_0xc2d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b201,_0x25e6af){return function(_0xf2ba15){if(!_0xf2ba15){_0x25b201[_0xc2d2('0x1a')](0x194);}return _0xf2ba15;};}function handleError(_0x1a11d2,_0x1c14e5){_0x1c14e5=_0x1c14e5||0x1f4;return function(_0x49e955){logger[_0xc2d2('0x26')](_0x49e955[_0xc2d2('0x27')]);if(_0x49e955[_0xc2d2('0x28')]){delete _0x49e955[_0xc2d2('0x28')];}_0x1a11d2['status'](_0x1c14e5)['send'](_0x49e955);};}exports[_0xc2d2('0x29')]=function(_0x7b75f4,_0x1f3b66){var _0x21ca37={},_0x402337={},_0x460379={'count':0x0,'rows':[]};var _0x4d4af2=_[_0xc2d2('0x2a')](db[_0xc2d2('0x2b')]['rawAttributes'],function(_0x29cae5){return{'name':_0x29cae5[_0xc2d2('0x2c')],'type':_0x29cae5[_0xc2d2('0x2d')][_0xc2d2('0x2e')]};});_0x402337[_0xc2d2('0x2f')]=_['map'](_0x4d4af2,'name');_0x402337[_0xc2d2('0x30')]=_['keys'](_0x7b75f4[_0xc2d2('0x30')]);_0x402337[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],_0x402337[_0xc2d2('0x30')]);_0x21ca37['attributes']=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],qs[_0xc2d2('0x33')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x21ca37[_0xc2d2('0x34')]=_0x21ca37['attributes'][_0xc2d2('0x35')]?_0x21ca37[_0xc2d2('0x34')]:_0x402337['model'];if(!_0x7b75f4[_0xc2d2('0x30')]['hasOwnProperty'](_0xc2d2('0x36'))){_0x21ca37[_0xc2d2('0x1f')]=qs[_0xc2d2('0x1f')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x1f')]);_0x21ca37[_0xc2d2('0x1d')]=qs[_0xc2d2('0x1d')](_0x7b75f4[_0xc2d2('0x30')]['offset']);}_0x21ca37[_0xc2d2('0x37')]=qs[_0xc2d2('0x38')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x38')]);_0x21ca37['where']=qs[_0xc2d2('0x31')](_[_0xc2d2('0x39')](_0x7b75f4[_0xc2d2('0x30')],_0x402337[_0xc2d2('0x31')]),_0x4d4af2);if(_0x7b75f4['query'][_0xc2d2('0x3a')]){_0x21ca37['where']=_[_0xc2d2('0x3b')](_0x21ca37[_0xc2d2('0x3c')],{'$or':_['map'](_0x4d4af2,function(_0xdbdce0){if(_0xdbdce0[_0xc2d2('0x2d')]!==_0xc2d2('0x3d')){var _0x29d04b={};_0x29d04b[_0xdbdce0[_0xc2d2('0x28')]]={'$like':'%'+_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x3a')]+'%'};return _0x29d04b;}})});}_0x21ca37=_[_0xc2d2('0x3b')]({},_0x21ca37,_0x7b75f4[_0xc2d2('0x3e')]);var _0x49d900={'where':_0x21ca37['where']};return db[_0xc2d2('0x2b')][_0xc2d2('0x20')](_0x49d900)['then'](function(_0xfd3ad4){_0x460379[_0xc2d2('0x20')]=_0xfd3ad4;if(_0x7b75f4[_0xc2d2('0x30')]['includeAll']){_0x21ca37['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc2d2('0x3f')](_0x21ca37);})[_0xc2d2('0x24')](function(_0x4031d0){_0x460379[_0xc2d2('0x40')]=_0x4031d0;return _0x460379;})['then'](respondWithFilteredResult(_0x1f3b66,_0x21ca37))[_0xc2d2('0x41')](handleError(_0x1f3b66,null));};exports['show']=function(_0x582edb,_0x24544e){var _0x2a987a={'raw':!![],'where':{'id':_0x582edb['params']['id']}},_0x386a39={};_0x386a39[_0xc2d2('0x2f')]=_[_0xc2d2('0x42')](db[_0xc2d2('0x2b')]['rawAttributes']);_0x386a39[_0xc2d2('0x30')]=_['keys'](_0x582edb[_0xc2d2('0x30')]);_0x386a39[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x386a39[_0xc2d2('0x2f')],_0x386a39[_0xc2d2('0x30')]);_0x2a987a[_0xc2d2('0x34')]=_['intersection'](_0x386a39[_0xc2d2('0x2f')],qs['fields'](_0x582edb[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x2a987a[_0xc2d2('0x34')]=_0x2a987a[_0xc2d2('0x34')][_0xc2d2('0x35')]?_0x2a987a['attributes']:_0x386a39[_0xc2d2('0x2f')];if(_0x582edb[_0xc2d2('0x30')]['includeAll']){_0x2a987a['include']=[{'all':!![]}];}_0x2a987a=_['merge']({},_0x2a987a,_0x582edb['options']);return db[_0xc2d2('0x2b')][_0xc2d2('0x43')](_0x2a987a)[_0xc2d2('0x24')](handleEntityNotFound(_0x24544e,null))[_0xc2d2('0x24')](respondWithResult(_0x24544e,null))[_0xc2d2('0x41')](handleError(_0x24544e,null));};exports[_0xc2d2('0x44')]=function(_0x1146cb,_0x3b795a){return db[_0xc2d2('0x2b')][_0xc2d2('0x44')](_0x1146cb[_0xc2d2('0x45')],{})[_0xc2d2('0x24')](respondWithResult(_0x3b795a,0xc9))['catch'](handleError(_0x3b795a,null));};exports[_0xc2d2('0x46')]=function(_0x4181dc,_0x572764){if(_0x4181dc[_0xc2d2('0x45')]['id']){delete _0x4181dc['body']['id'];}return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x4181dc[_0xc2d2('0x47')]['id']}})[_0xc2d2('0x24')](handleEntityNotFound(_0x572764,null))['then'](saveUpdates(_0x4181dc[_0xc2d2('0x45')],null))[_0xc2d2('0x24')](respondWithResult(_0x572764,null))[_0xc2d2('0x41')](handleError(_0x572764,null));};exports[_0xc2d2('0x25')]=function(_0x3b61ef,_0x4765f9){return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x3b61ef[_0xc2d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4765f9,null))['then'](removeEntity(_0x4765f9,null))[_0xc2d2('0x41')](handleError(_0x4765f9,null));};exports[_0xc2d2('0x48')]=function(_0x472299,_0x1827c3){return db[_0xc2d2('0x2b')]['describe']()[_0xc2d2('0x24')](respondWithResult(_0x1827c3,null))[_0xc2d2('0x41')](handleError(_0x1827c3,null));}; \ No newline at end of file +var _0xa786=['stack','name','send','index','JscriptyAnswerReport','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','update','then','destroy','end'];(function(_0x766d5f,_0x58ebf8){var _0xf5607b=function(_0x3a8768){while(--_0x3a8768){_0x766d5f['push'](_0x766d5f['shift']());}};_0xf5607b(++_0x58ebf8);}(_0xa786,0x71));var _0x6a78=function(_0x59cd76,_0x4adf39){_0x59cd76=_0x59cd76-0x0;var _0x52541b=_0xa786[_0x59cd76];return _0x52541b;};'use strict';var emlformat=require(_0x6a78('0x0'));var rimraf=require(_0x6a78('0x1'));var zipdir=require(_0x6a78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a78('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a78('0x4'));var util=require(_0x6a78('0x5'));var path=require(_0x6a78('0x6'));var sox=require(_0x6a78('0x7'));var csv=require(_0x6a78('0x8'));var ejs=require(_0x6a78('0x9'));var fs=require('fs');var fs_extra=require(_0x6a78('0xa'));var _=require('lodash');var squel=require(_0x6a78('0xb'));var crypto=require(_0x6a78('0xc'));var jsforce=require(_0x6a78('0xd'));var deskjs=require(_0x6a78('0xe'));var toCsv=require(_0x6a78('0x8'));var querystring=require(_0x6a78('0xf'));var Papa=require(_0x6a78('0x10'));var Redis=require(_0x6a78('0x11'));var authService=require(_0x6a78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a78('0x13'));var hardwareService=require(_0x6a78('0x14'));var logger=require(_0x6a78('0x15'))('api');var utils=require(_0x6a78('0x16'));var config=require(_0x6a78('0x17'));var licenseUtil=require(_0x6a78('0x18'));var db=require(_0x6a78('0x19'))['db'];function respondWithStatusCode(_0x1fd1be,_0x5b633c){_0x5b633c=_0x5b633c||0xcc;return function(_0x24a60a){if(_0x24a60a){return _0x1fd1be[_0x6a78('0x1a')](_0x5b633c);}return _0x1fd1be[_0x6a78('0x1b')](_0x5b633c)['end']();};}function respondWithResult(_0x44c863,_0xecf980){_0xecf980=_0xecf980||0xc8;return function(_0x4c5351){if(_0x4c5351){return _0x44c863[_0x6a78('0x1b')](_0xecf980)[_0x6a78('0x1c')](_0x4c5351);}};}function respondWithFilteredResult(_0xe27467,_0x40ef48){return function(_0x3deede){if(_0x3deede){var _0x36e824=typeof _0x40ef48['offset']===_0x6a78('0x1d')&&typeof _0x40ef48[_0x6a78('0x1e')]===_0x6a78('0x1d');var _0x265f90=_0x3deede['count'];var _0x5e3616=_0x36e824?0x0:_0x40ef48[_0x6a78('0x1f')];var _0x585917=_0x36e824?_0x3deede['count']:_0x40ef48['offset']+_0x40ef48[_0x6a78('0x1e')];var _0xed3863;if(_0x585917>=_0x265f90){_0x585917=_0x265f90;_0xed3863=0xc8;}else{_0xed3863=0xce;}_0xe27467[_0x6a78('0x1b')](_0xed3863);return _0xe27467['set']('Content-Range',_0x5e3616+'-'+_0x585917+'/'+_0x265f90)[_0x6a78('0x1c')](_0x3deede);}return null;};}function patchUpdates(_0x29dec5){return function(_0x356b93){try{jsonpatch[_0x6a78('0x20')](_0x356b93,_0x29dec5,!![]);}catch(_0x5dc3fa){return BPromise['reject'](_0x5dc3fa);}return _0x356b93['save']();};}function saveUpdates(_0xd57884,_0x5869fd){return function(_0xd938cd){if(_0xd938cd){return _0xd938cd[_0x6a78('0x21')](_0xd57884)[_0x6a78('0x22')](function(_0x4b47b6){return _0x4b47b6;});}return null;};}function removeEntity(_0x49f711,_0xa5f42f){return function(_0x89fd2b){if(_0x89fd2b){return _0x89fd2b[_0x6a78('0x23')]()[_0x6a78('0x22')](function(){_0x49f711[_0x6a78('0x1b')](0xcc)[_0x6a78('0x24')]();});}};}function handleEntityNotFound(_0xefaa55,_0x4ea33e){return function(_0x28cbbf){if(!_0x28cbbf){_0xefaa55[_0x6a78('0x1a')](0x194);}return _0x28cbbf;};}function handleError(_0x1e91ad,_0x57a859){_0x57a859=_0x57a859||0x1f4;return function(_0x19860c){logger['error'](_0x19860c[_0x6a78('0x25')]);if(_0x19860c[_0x6a78('0x26')]){delete _0x19860c['name'];}_0x1e91ad[_0x6a78('0x1b')](_0x57a859)[_0x6a78('0x27')](_0x19860c);};}exports[_0x6a78('0x28')]=function(_0x149105,_0x5942c0){var _0x8bc302={},_0x125ca2={},_0x273a73={'count':0x0,'rows':[]};var _0x12e0c5=_['map'](db[_0x6a78('0x29')][_0x6a78('0x2a')],function(_0x3299c2){return{'name':_0x3299c2['fieldName'],'type':_0x3299c2[_0x6a78('0x2b')][_0x6a78('0x2c')]};});_0x125ca2['model']=_[_0x6a78('0x2d')](_0x12e0c5,_0x6a78('0x26'));_0x125ca2[_0x6a78('0x2e')]=_[_0x6a78('0x2f')](_0x149105[_0x6a78('0x2e')]);_0x125ca2['filters']=_[_0x6a78('0x30')](_0x125ca2[_0x6a78('0x31')],_0x125ca2['query']);_0x8bc302[_0x6a78('0x32')]=_[_0x6a78('0x30')](_0x125ca2[_0x6a78('0x31')],qs[_0x6a78('0x33')](_0x149105[_0x6a78('0x2e')][_0x6a78('0x33')]));_0x8bc302['attributes']=_0x8bc302[_0x6a78('0x32')]['length']?_0x8bc302[_0x6a78('0x32')]:_0x125ca2[_0x6a78('0x31')];if(!_0x149105[_0x6a78('0x2e')][_0x6a78('0x34')](_0x6a78('0x35'))){_0x8bc302[_0x6a78('0x1e')]=qs[_0x6a78('0x1e')](_0x149105[_0x6a78('0x2e')][_0x6a78('0x1e')]);_0x8bc302['offset']=qs['offset'](_0x149105[_0x6a78('0x2e')]['offset']);}_0x8bc302[_0x6a78('0x36')]=qs[_0x6a78('0x37')](_0x149105[_0x6a78('0x2e')][_0x6a78('0x37')]);_0x8bc302[_0x6a78('0x38')]=qs[_0x6a78('0x39')](_[_0x6a78('0x3a')](_0x149105[_0x6a78('0x2e')],_0x125ca2['filters']),_0x12e0c5);if(_0x149105[_0x6a78('0x2e')][_0x6a78('0x3b')]){_0x8bc302[_0x6a78('0x38')]=_['merge'](_0x8bc302[_0x6a78('0x38')],{'$or':_['map'](_0x12e0c5,function(_0x310ab2){if(_0x310ab2[_0x6a78('0x2b')]!==_0x6a78('0x3c')){var _0xe180fb={};_0xe180fb[_0x310ab2['name']]={'$like':'%'+_0x149105['query']['filter']+'%'};return _0xe180fb;}})});}_0x8bc302=_[_0x6a78('0x3d')]({},_0x8bc302,_0x149105[_0x6a78('0x3e')]);var _0x48eafa={'where':_0x8bc302[_0x6a78('0x38')]};return db[_0x6a78('0x29')][_0x6a78('0x3f')](_0x48eafa)[_0x6a78('0x22')](function(_0x44d5f7){_0x273a73[_0x6a78('0x3f')]=_0x44d5f7;if(_0x149105['query'][_0x6a78('0x40')]){_0x8bc302[_0x6a78('0x41')]=[{'all':!![]}];}return db[_0x6a78('0x29')][_0x6a78('0x42')](_0x8bc302);})[_0x6a78('0x22')](function(_0x23dcce){_0x273a73[_0x6a78('0x43')]=_0x23dcce;return _0x273a73;})['then'](respondWithFilteredResult(_0x5942c0,_0x8bc302))[_0x6a78('0x44')](handleError(_0x5942c0,null));};exports['show']=function(_0xeddf03,_0x4d3aec){var _0x526f09={'raw':!![],'where':{'id':_0xeddf03[_0x6a78('0x45')]['id']}},_0xc8f3e8={};_0xc8f3e8['model']=_[_0x6a78('0x2f')](db[_0x6a78('0x29')][_0x6a78('0x2a')]);_0xc8f3e8[_0x6a78('0x2e')]=_[_0x6a78('0x2f')](_0xeddf03['query']);_0xc8f3e8['filters']=_[_0x6a78('0x30')](_0xc8f3e8[_0x6a78('0x31')],_0xc8f3e8[_0x6a78('0x2e')]);_0x526f09[_0x6a78('0x32')]=_[_0x6a78('0x30')](_0xc8f3e8[_0x6a78('0x31')],qs[_0x6a78('0x33')](_0xeddf03['query'][_0x6a78('0x33')]));_0x526f09[_0x6a78('0x32')]=_0x526f09['attributes'][_0x6a78('0x46')]?_0x526f09[_0x6a78('0x32')]:_0xc8f3e8[_0x6a78('0x31')];if(_0xeddf03[_0x6a78('0x2e')][_0x6a78('0x40')]){_0x526f09[_0x6a78('0x41')]=[{'all':!![]}];}_0x526f09=_['merge']({},_0x526f09,_0xeddf03[_0x6a78('0x3e')]);return db[_0x6a78('0x29')][_0x6a78('0x47')](_0x526f09)[_0x6a78('0x22')](handleEntityNotFound(_0x4d3aec,null))[_0x6a78('0x22')](respondWithResult(_0x4d3aec,null))['catch'](handleError(_0x4d3aec,null));};exports[_0x6a78('0x48')]=function(_0x59a4c1,_0x1bdd6b){return db[_0x6a78('0x29')]['create'](_0x59a4c1[_0x6a78('0x49')],{})['then'](respondWithResult(_0x1bdd6b,0xc9))[_0x6a78('0x44')](handleError(_0x1bdd6b,null));};exports[_0x6a78('0x21')]=function(_0xe40d18,_0x46c94e){if(_0xe40d18[_0x6a78('0x49')]['id']){delete _0xe40d18['body']['id'];}return db['JscriptyAnswerReport'][_0x6a78('0x47')]({'where':{'id':_0xe40d18[_0x6a78('0x45')]['id']}})[_0x6a78('0x22')](handleEntityNotFound(_0x46c94e,null))[_0x6a78('0x22')](saveUpdates(_0xe40d18['body'],null))[_0x6a78('0x22')](respondWithResult(_0x46c94e,null))[_0x6a78('0x44')](handleError(_0x46c94e,null));};exports[_0x6a78('0x23')]=function(_0x57c0c4,_0x57bd8a){return db[_0x6a78('0x29')]['find']({'where':{'id':_0x57c0c4['params']['id']}})[_0x6a78('0x22')](handleEntityNotFound(_0x57bd8a,null))[_0x6a78('0x22')](removeEntity(_0x57bd8a,null))[_0x6a78('0x44')](handleError(_0x57bd8a,null));};exports[_0x6a78('0x4a')]=function(_0x15ca1a,_0x5a4d6e){return db['JscriptyAnswerReport']['describe']()[_0x6a78('0x22')](respondWithResult(_0x5a4d6e,null))[_0x6a78('0x44')](handleError(_0x5a4d6e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 358ca29..37332b1 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 _0x7f7d=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3a6c6d,_0x2dda5c){var _0x4868ed=function(_0x3f3682){while(--_0x3f3682){_0x3a6c6d['push'](_0x3a6c6d['shift']());}};_0x4868ed(++_0x2dda5c);}(_0x7f7d,0xd2));var _0xd7f7=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x7f7d[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xd7f7('0x0'));var util=require(_0xd7f7('0x1'));var logger=require(_0xd7f7('0x2'))(_0xd7f7('0x3'));var moment=require('moment');var BPromise=require(_0xd7f7('0x4'));var rp=require(_0xd7f7('0x5'));var fs=require('fs');var path=require(_0xd7f7('0x6'));var rimraf=require(_0xd7f7('0x7'));var config=require(_0xd7f7('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xd7f7('0x9')]=function(_0x55bd3c,_0x4ef728){return _0x55bd3c[_0xd7f7('0xa')](_0xd7f7('0xb'),attributes,{'tableName':_0xd7f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ac2=['report_jscripty_answers','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x1ac2,0x175));var _0x21ac=function(_0x4958fe,_0x34eaa0){_0x4958fe=_0x4958fe-0x0;var _0x51ff32=_0x1ac2[_0x4958fe];return _0x51ff32;};'use strict';var _=require(_0x21ac('0x0'));var util=require('util');var logger=require(_0x21ac('0x1'))(_0x21ac('0x2'));var moment=require(_0x21ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x21ac('0x4'));var fs=require('fs');var path=require(_0x21ac('0x5'));var rimraf=require(_0x21ac('0x6'));var config=require(_0x21ac('0x7'));var attributes=require(_0x21ac('0x8'));module['exports']=function(_0x4ef6b2,_0x5a7a21){return _0x4ef6b2[_0x21ac('0x9')](_0x21ac('0xa'),attributes,{'tableName':_0x21ac('0xb'),'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 6dfa413..4146e12 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 _0xd692=['rpc','../../config/environment','client','http','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x5195b2,_0x28b5bc){var _0x529e38=function(_0xe92d99){while(--_0xe92d99){_0x5195b2['push'](_0x5195b2['shift']());}};_0x529e38(++_0x28b5bc);}(_0xd692,0xd7));var _0x2d69=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd692[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2d69('0x0'));var util=require(_0x2d69('0x1'));var moment=require(_0x2d69('0x2'));var BPromise=require(_0x2d69('0x3'));var rs=require(_0x2d69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d69('0x5'));var logger=require('../../config/logger')(_0x2d69('0x6'));var config=require(_0x2d69('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2d69('0x8')][_0x2d69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4951,_0x178e45,_0x534d6c){return new BPromise(function(_0x3ba81e,_0x468094){return client['request'](_0x3e4951,_0x534d6c)['then'](function(_0x165a95){logger['info'](_0x2d69('0xa'),_0x178e45,_0x2d69('0xb'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x178e45,_0x2d69('0xb'),JSON['stringify'](_0x165a95));if(_0x165a95[_0x2d69('0xc')]){if(_0x165a95[_0x2d69('0xc')]['code']===0x1f4){logger[_0x2d69('0xc')](_0x2d69('0xa'),_0x178e45,_0x165a95[_0x2d69('0xc')]['message']);return _0x468094(_0x165a95['error'][_0x2d69('0xd')]);}logger[_0x2d69('0xc')](_0x2d69('0xa'),_0x178e45,_0x165a95[_0x2d69('0xc')]['message']);return _0x3ba81e(_0x165a95[_0x2d69('0xc')][_0x2d69('0xd')]);}else{logger[_0x2d69('0xe')](_0x2d69('0xa'),_0x178e45,_0x2d69('0xb'));_0x3ba81e(_0x165a95[_0x2d69('0xf')][_0x2d69('0xd')]);}})[_0x2d69('0x10')](function(_0x209c38){logger[_0x2d69('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x178e45,_0x209c38);_0x468094(_0x209c38);});});} \ No newline at end of file +var _0x02ab=['request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0xce7dc4,_0x13498e){var _0x31f02f=function(_0x5ae1fe){while(--_0x5ae1fe){_0xce7dc4['push'](_0xce7dc4['shift']());}};_0x31f02f(++_0x13498e);}(_0x02ab,0x191));var _0xb02a=function(_0x5a956c,_0x5aae33){_0x5a956c=_0x5a956c-0x0;var _0x1b14cd=_0x02ab[_0x5a956c];return _0x1b14cd;};'use strict';var _=require(_0xb02a('0x0'));var util=require(_0xb02a('0x1'));var moment=require(_0xb02a('0x2'));var BPromise=require(_0xb02a('0x3'));var rs=require(_0xb02a('0x4'));var fs=require('fs');var Redis=require(_0xb02a('0x5'));var db=require(_0xb02a('0x6'))['db'];var utils=require(_0xb02a('0x7'));var logger=require('../../config/logger')(_0xb02a('0x8'));var config=require(_0xb02a('0x9'));var jayson=require(_0xb02a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x467a55,_0x105ba4,_0x2ec9df){return new BPromise(function(_0x1dda32,_0x4a2229){return client[_0xb02a('0xb')](_0x467a55,_0x2ec9df)[_0xb02a('0xc')](function(_0x3a806e){logger[_0xb02a('0xd')](_0xb02a('0xe'),_0x105ba4,'request\x20sent');logger[_0xb02a('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x105ba4,'request\x20sent',JSON[_0xb02a('0x10')](_0x3a806e));if(_0x3a806e[_0xb02a('0x11')]){if(_0x3a806e['error']['code']===0x1f4){logger[_0xb02a('0x11')](_0xb02a('0xe'),_0x105ba4,_0x3a806e[_0xb02a('0x11')][_0xb02a('0x12')]);return _0x4a2229(_0x3a806e[_0xb02a('0x11')][_0xb02a('0x12')]);}logger[_0xb02a('0x11')](_0xb02a('0xe'),_0x105ba4,_0x3a806e[_0xb02a('0x11')]['message']);return _0x1dda32(_0x3a806e['error']['message']);}else{logger[_0xb02a('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x105ba4,_0xb02a('0x13'));_0x1dda32(_0x3a806e[_0xb02a('0x14')][_0xb02a('0x12')]);}})['catch'](function(_0x107995){logger[_0xb02a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x105ba4,_0x107995);_0x4a2229(_0x107995);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 833dca7..d1b28c1 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 _0x91eb=['/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','create','post','/:id/clone','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get'];(function(_0x206977,_0x2f33dc){var _0x2531de=function(_0x2ff94c){while(--_0x2ff94c){_0x206977['push'](_0x206977['shift']());}};_0x2531de(++_0x2f33dc);}(_0x91eb,0x113));var _0xb91e=function(_0x3e02e8,_0x2d68df){_0x3e02e8=_0x3e02e8-0x0;var _0xf9a76c=_0x91eb[_0x3e02e8];return _0xf9a76c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb91e('0x0'));var timeout=require('connect-timeout');var express=require(_0xb91e('0x1'));var router=express[_0xb91e('0x2')]();var fs_extra=require(_0xb91e('0x3'));var auth=require(_0xb91e('0x4'));var interaction=require(_0xb91e('0x5'));var config=require(_0xb91e('0x6'));var controller=require(_0xb91e('0x7'));router['get']('/',auth[_0xb91e('0x8')](),controller[_0xb91e('0x9')]);router[_0xb91e('0xa')](_0xb91e('0xb'),auth[_0xb91e('0x8')](),controller[_0xb91e('0xc')]);router[_0xb91e('0xa')](_0xb91e('0xd'),auth[_0xb91e('0x8')](),controller[_0xb91e('0xe')]);router['get'](_0xb91e('0xf'),auth[_0xb91e('0x8')](),controller[_0xb91e('0x10')]);router[_0xb91e('0xa')]('/:id/summary',auth[_0xb91e('0x8')](),timeout(_0xb91e('0x11')),controller['getSummary']);router['post']('/',auth[_0xb91e('0x8')](),controller[_0xb91e('0x12')]);router[_0xb91e('0x13')](_0xb91e('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0xb91e('0x15')](_0xb91e('0xb'),auth[_0xb91e('0x8')](),controller[_0xb91e('0x16')]);router[_0xb91e('0x17')](_0xb91e('0xb'),auth[_0xb91e('0x8')](),controller[_0xb91e('0x18')]);module[_0xb91e('0x19')]=router; \ No newline at end of file +var _0xa553=['isAuthenticated','getSessions','/:id/answers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show'];(function(_0x3e4a47,_0x2d0bc9){var _0x299864=function(_0x45f5e6){while(--_0x45f5e6){_0x3e4a47['push'](_0x3e4a47['shift']());}};_0x299864(++_0x2d0bc9);}(_0xa553,0x120));var _0x3a55=function(_0x1c6def,_0x4cfbc5){_0x1c6def=_0x1c6def-0x0;var _0x375e0b=_0xa553[_0x1c6def];return _0x375e0b;};'use strict';var multer=require('multer');var util=require(_0x3a55('0x0'));var path=require(_0x3a55('0x1'));var timeout=require(_0x3a55('0x2'));var express=require(_0x3a55('0x3'));var router=express['Router']();var fs_extra=require(_0x3a55('0x4'));var auth=require(_0x3a55('0x5'));var interaction=require(_0x3a55('0x6'));var config=require(_0x3a55('0x7'));var controller=require('./jscriptyProject.controller');router[_0x3a55('0x8')]('/',auth['isAuthenticated'](),controller[_0x3a55('0x9')]);router[_0x3a55('0x8')](_0x3a55('0xa'),auth['isAuthenticated'](),controller[_0x3a55('0xb')]);router['get']('/:id/sessions',auth[_0x3a55('0xc')](),controller[_0x3a55('0xd')]);router[_0x3a55('0x8')](_0x3a55('0xe'),auth[_0x3a55('0xc')](),controller['getAnswers']);router[_0x3a55('0x8')](_0x3a55('0xf'),auth[_0x3a55('0xc')](),timeout('30s'),controller[_0x3a55('0x10')]);router[_0x3a55('0x11')]('/',auth[_0x3a55('0xc')](),controller[_0x3a55('0x12')]);router[_0x3a55('0x11')](_0x3a55('0x13'),auth[_0x3a55('0xc')](),controller[_0x3a55('0x14')]);router[_0x3a55('0x15')](_0x3a55('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3a55('0x16')](_0x3a55('0xa'),auth[_0x3a55('0xc')](),controller[_0x3a55('0x17')]);module[_0x3a55('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index f1a0079..7b804f0 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 _0x8544=['stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name','STRING','long','setDataValue','formData'];(function(_0x597e5d,_0x2954d5){var _0x6a6659=function(_0x3b9bc3){while(--_0x3b9bc3){_0x597e5d['push'](_0x597e5d['shift']());}};_0x6a6659(++_0x2954d5);}(_0x8544,0x156));var _0x4854=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x8544[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4854('0x0'));var util=require(_0x4854('0x1'));module[_0x4854('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x4854('0x3')},'description':{'type':Sequelize[_0x4854('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x4854('0x5')),'set':function(_0x108476){if(_['isObjectLike'](_0x108476)){this[_0x4854('0x6')](_0x4854('0x7'),JSON[_0x4854('0x8')](_0x108476));}else if(_['isString'](_0x108476)){this[_0x4854('0x6')](_0x4854('0x7'),_0x108476);}else{this[_0x4854('0x6')](_0x4854('0x7'),util[_0x4854('0x9')](_0x4854('0xa'),this[_0x4854('0xb')](_0x4854('0x3'))||'',this['getDataValue'](_0x4854('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4854('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4854('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x3589=['sequelize','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x38ebd7,_0x571193){var _0x5c6ca4=function(_0x38ee47){while(--_0x38ee47){_0x38ebd7['push'](_0x38ebd7['shift']());}};_0x5c6ca4(++_0x571193);}(_0x3589,0xc4));var _0x9358=function(_0x5cdead,_0x4cc697){_0x5cdead=_0x5cdead-0x0;var _0x34dd2f=_0x3589[_0x5cdead];return _0x34dd2f;};'use strict';var Sequelize=require(_0x9358('0x0'));var _=require('lodash');var util=require('util');module[_0x9358('0x1')]={'name':{'type':Sequelize[_0x9358('0x2')],'unique':_0x9358('0x3')},'description':{'type':Sequelize[_0x9358('0x2')]},'formData':{'type':Sequelize[_0x9358('0x4')](_0x9358('0x5')),'set':function(_0x4e6c00){if(_[_0x9358('0x6')](_0x4e6c00)){this[_0x9358('0x7')](_0x9358('0x8'),JSON['stringify'](_0x4e6c00));}else if(_[_0x9358('0x9')](_0x4e6c00)){this['setDataValue'](_0x9358('0x8'),_0x4e6c00);}else{this['setDataValue'](_0x9358('0x8'),util[_0x9358('0xa')](_0x9358('0xb'),this[_0x9358('0xc')](_0x9358('0x3'))||'',this['getDataValue'](_0x9358('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9daa528..e54f112 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 _0x62ba=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','Projects','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','JscriptyProject','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','pick','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','questionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62ba,0x1cd));var _0xa62b=function(_0x450274,_0x31a442){_0x450274=_0x450274-0x0;var _0x26a500=_0x62ba[_0x450274];return _0x26a500;};'use strict';var emlformat=require(_0xa62b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa62b('0x1'));var jsonpatch=require(_0xa62b('0x2'));var rp=require(_0xa62b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa62b('0x4'));var util=require(_0xa62b('0x5'));var path=require('path');var sox=require(_0xa62b('0x6'));var csv=require(_0xa62b('0x7'));var ejs=require(_0xa62b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa62b('0x9'));var squel=require(_0xa62b('0xa'));var crypto=require(_0xa62b('0xb'));var jsforce=require(_0xa62b('0xc'));var deskjs=require(_0xa62b('0xd'));var toCsv=require(_0xa62b('0x7'));var querystring=require(_0xa62b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa62b('0xf'));var authService=require(_0xa62b('0x10'));var qs=require(_0xa62b('0x11'));var as=require(_0xa62b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa62b('0x13'))('api');var utils=require(_0xa62b('0x14'));var config=require(_0xa62b('0x15'));var licenseUtil=require(_0xa62b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1495bd,_0x55fec5){_0x55fec5=_0x55fec5||0xcc;return function(_0x16b16f){if(_0x16b16f){return _0x1495bd['sendStatus'](_0x55fec5);}return _0x1495bd[_0xa62b('0x17')](_0x55fec5)['end']();};}function respondWithResult(_0x523923,_0x30163d){_0x30163d=_0x30163d||0xc8;return function(_0x580c87){if(_0x580c87){return _0x523923[_0xa62b('0x17')](_0x30163d)[_0xa62b('0x18')](_0x580c87);}};}function respondWithFilteredResult(_0x492149,_0x7a0fda){return function(_0x50e164){if(_0x50e164){var _0x5e2c98=typeof _0x7a0fda[_0xa62b('0x19')]==='undefined'&&typeof _0x7a0fda[_0xa62b('0x1a')]===_0xa62b('0x1b');var _0x152676=_0x50e164['count'];var _0xe01f06=_0x5e2c98?0x0:_0x7a0fda[_0xa62b('0x19')];var _0x30a267=_0x5e2c98?_0x50e164[_0xa62b('0x1c')]:_0x7a0fda[_0xa62b('0x19')]+_0x7a0fda[_0xa62b('0x1a')];var _0x2b1792;if(_0x30a267>=_0x152676){_0x30a267=_0x152676;_0x2b1792=0xc8;}else{_0x2b1792=0xce;}_0x492149[_0xa62b('0x17')](_0x2b1792);return _0x492149['set'](_0xa62b('0x1d'),_0xe01f06+'-'+_0x30a267+'/'+_0x152676)[_0xa62b('0x18')](_0x50e164);}return null;};}function patchUpdates(_0x3c1405){return function(_0x57f5dd){try{jsonpatch[_0xa62b('0x1e')](_0x57f5dd,_0x3c1405,!![]);}catch(_0x5c47c9){return BPromise['reject'](_0x5c47c9);}return _0x57f5dd[_0xa62b('0x1f')]();};}function saveUpdates(_0x5698a9,_0x572bc6){return function(_0x327851){if(_0x327851){return _0x327851[_0xa62b('0x20')](_0x5698a9)[_0xa62b('0x21')](function(_0x13be24){return _0x13be24;});}return null;};}function removeEntity(_0x185daa,_0xb48827){return function(_0x6aa24a){if(_0x6aa24a){return _0x6aa24a[_0xa62b('0x22')]()[_0xa62b('0x21')](function(){var _0x27a1e5=_0x6aa24a['get']({'plain':!![]});var _0x4d57a5=_0xa62b('0x23');return db[_0xa62b('0x24')]['destroy']({'where':{'type':_0x4d57a5,'resourceId':_0x27a1e5['id']}})[_0xa62b('0x21')](function(){return _0x6aa24a;});})['then'](function(){_0x185daa[_0xa62b('0x17')](0xcc)[_0xa62b('0x25')]();});}};}function handleEntityNotFound(_0x1c3f0e,_0x4cef89){return function(_0x3d86a0){if(!_0x3d86a0){_0x1c3f0e[_0xa62b('0x26')](0x194);}return _0x3d86a0;};}function handleError(_0x133857,_0x3c6482){_0x3c6482=_0x3c6482||0x1f4;return function(_0x5c6b2c){logger['error'](_0x5c6b2c[_0xa62b('0x27')]);if(_0x5c6b2c[_0xa62b('0x28')]){delete _0x5c6b2c['name'];}_0x133857[_0xa62b('0x17')](_0x3c6482)[_0xa62b('0x29')](_0x5c6b2c);};}exports[_0xa62b('0x2a')]=function(_0x1bb7a7,_0x912762){var _0x1622de={},_0x1b5753={},_0x5dfc33={'count':0x0,'rows':[]};var _0x14de0e=_[_0xa62b('0x2b')](db['JscriptyProject'][_0xa62b('0x2c')],function(_0x176e2c){return{'name':_0x176e2c[_0xa62b('0x2d')],'type':_0x176e2c[_0xa62b('0x2e')][_0xa62b('0x2f')]};});_0x1b5753[_0xa62b('0x30')]=_[_0xa62b('0x2b')](_0x14de0e,_0xa62b('0x28'));_0x1b5753[_0xa62b('0x31')]=_['keys'](_0x1bb7a7['query']);_0x1b5753[_0xa62b('0x32')]=_['intersection'](_0x1b5753[_0xa62b('0x30')],_0x1b5753[_0xa62b('0x31')]);_0x1622de[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x1b5753[_0xa62b('0x30')],qs[_0xa62b('0x35')](_0x1bb7a7[_0xa62b('0x31')]['fields']));_0x1622de[_0xa62b('0x33')]=_0x1622de['attributes'][_0xa62b('0x36')]?_0x1622de['attributes']:_0x1b5753[_0xa62b('0x30')];if(!_0x1bb7a7[_0xa62b('0x31')][_0xa62b('0x37')](_0xa62b('0x38'))){_0x1622de['limit']=qs[_0xa62b('0x1a')](_0x1bb7a7['query'][_0xa62b('0x1a')]);_0x1622de[_0xa62b('0x19')]=qs['offset'](_0x1bb7a7[_0xa62b('0x31')][_0xa62b('0x19')]);}_0x1622de[_0xa62b('0x39')]=qs[_0xa62b('0x3a')](_0x1bb7a7[_0xa62b('0x31')][_0xa62b('0x3a')]);_0x1622de[_0xa62b('0x3b')]=qs['filters'](_['pick'](_0x1bb7a7[_0xa62b('0x31')],_0x1b5753[_0xa62b('0x32')]),_0x14de0e);if(_0x1bb7a7[_0xa62b('0x31')][_0xa62b('0x3c')]){_0x1622de[_0xa62b('0x3b')]=_['merge'](_0x1622de[_0xa62b('0x3b')],{'$or':_[_0xa62b('0x2b')](_0x14de0e,function(_0x31945b){if(_0x31945b[_0xa62b('0x2e')]!=='VIRTUAL'){var _0x2a9a96={};_0x2a9a96[_0x31945b[_0xa62b('0x28')]]={'$like':'%'+_0x1bb7a7[_0xa62b('0x31')][_0xa62b('0x3c')]+'%'};return _0x2a9a96;}})});}_0x1622de=_[_0xa62b('0x3d')]({},_0x1622de,_0x1bb7a7[_0xa62b('0x3e')]);var _0x8dffb4={'where':_0x1622de[_0xa62b('0x3b')]};return db[_0xa62b('0x3f')][_0xa62b('0x1c')](_0x8dffb4)['then'](function(_0x182f3b){_0x5dfc33[_0xa62b('0x1c')]=_0x182f3b;if(_0x1bb7a7[_0xa62b('0x31')]['includeAll']){_0x1622de[_0xa62b('0x40')]=[{'all':!![]}];}return db[_0xa62b('0x3f')][_0xa62b('0x41')](_0x1622de);})[_0xa62b('0x21')](function(_0x10098e){_0x5dfc33[_0xa62b('0x42')]=_0x10098e;return _0x5dfc33;})[_0xa62b('0x21')](respondWithFilteredResult(_0x912762,_0x1622de))[_0xa62b('0x43')](handleError(_0x912762,null));};exports[_0xa62b('0x44')]=function(_0x4fa213,_0x5c47bd){var _0x28b95d={'raw':![],'where':{'id':_0x4fa213[_0xa62b('0x45')]['id']}},_0x32ddd6={};_0x32ddd6[_0xa62b('0x30')]=_['keys'](db[_0xa62b('0x3f')][_0xa62b('0x2c')]);_0x32ddd6[_0xa62b('0x31')]=_[_0xa62b('0x46')](_0x4fa213['query']);_0x32ddd6[_0xa62b('0x32')]=_[_0xa62b('0x34')](_0x32ddd6[_0xa62b('0x30')],_0x32ddd6[_0xa62b('0x31')]);_0x28b95d[_0xa62b('0x33')]=_['intersection'](_0x32ddd6[_0xa62b('0x30')],qs[_0xa62b('0x35')](_0x4fa213['query'][_0xa62b('0x35')]));_0x28b95d[_0xa62b('0x33')]=_0x28b95d[_0xa62b('0x33')][_0xa62b('0x36')]?_0x28b95d[_0xa62b('0x33')]:_0x32ddd6['model'];if(_0x4fa213[_0xa62b('0x31')]['includeAll']){_0x28b95d[_0xa62b('0x40')]=[{'all':!![]}];}_0x28b95d=_['merge']({},_0x28b95d,_0x4fa213[_0xa62b('0x3e')]);return db['JscriptyProject'][_0xa62b('0x47')](_0x28b95d)[_0xa62b('0x21')](handleEntityNotFound(_0x5c47bd,null))['then'](respondWithResult(_0x5c47bd,null))['catch'](handleError(_0x5c47bd,null));};exports['create']=function(_0x26881c,_0x397145){return db[_0xa62b('0x3f')][_0xa62b('0x48')](_0x26881c[_0xa62b('0x49')],{})[_0xa62b('0x21')](function(_0x4c07bd){var _0x73291d=_0x26881c[_0xa62b('0x4a')][_0xa62b('0x4b')]({'plain':!![]});if(!_0x73291d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x73291d[_0xa62b('0x4c')]===_0xa62b('0x4a')){var _0x4978f5=_0x4c07bd[_0xa62b('0x4b')]({'plain':!![]});var _0x40942e=_0xa62b('0x23');return db[_0xa62b('0x4d')][_0xa62b('0x47')]({'where':{'name':_0x40942e,'userProfileId':_0x73291d[_0xa62b('0x4e')]},'raw':!![]})['then'](function(_0x466b3f){if(_0x466b3f&&_0x466b3f[_0xa62b('0x4f')]===0x0){return db[_0xa62b('0x24')][_0xa62b('0x48')]({'name':_0x4978f5[_0xa62b('0x28')],'resourceId':_0x4978f5['id'],'type':_0x466b3f[_0xa62b('0x28')],'sectionId':_0x466b3f['id']},{})[_0xa62b('0x21')](function(){return _0x4c07bd;});}else{return _0x4c07bd;}})[_0xa62b('0x43')](function(_0x29b72a){logger[_0xa62b('0x50')](_0xa62b('0x51'),_0x29b72a);throw _0x29b72a;});}return _0x4c07bd;})['then'](respondWithResult(_0x397145,0xc9))[_0xa62b('0x43')](handleError(_0x397145,null));};exports[_0xa62b('0x52')]=function(_0x1b29d3,_0x57fa9b){var _0x547916={'where':{'id':_0x1b29d3[_0xa62b('0x45')]['id']}},_0x521e86={};_0x521e86[_0xa62b('0x30')]=_[_0xa62b('0x46')](db[_0xa62b('0x3f')][_0xa62b('0x2c')]);_0x547916[_0xa62b('0x33')]=_['intersection'](_0x521e86[_0xa62b('0x30')],qs[_0xa62b('0x35')](_0x1b29d3[_0xa62b('0x31')][_0xa62b('0x35')]));_0x547916[_0xa62b('0x33')]=_0x547916[_0xa62b('0x33')][_0xa62b('0x36')]?_0x547916[_0xa62b('0x33')]:_0x521e86['model'];if(_0x1b29d3[_0xa62b('0x31')][_0xa62b('0x53')]){_0x547916[_0xa62b('0x40')]=[{'all':!![]}];}_0x547916=_['merge']({},_0x547916,_0x1b29d3[_0xa62b('0x3e')]);return db[_0xa62b('0x3f')][_0xa62b('0x47')](_0x547916)['then'](handleEntityNotFound(_0x57fa9b,null))[_0xa62b('0x21')](function(_0x4d3335){if(_0x4d3335){var _0x47763a=_0x4d3335[_0xa62b('0x4b')]({'plain':!![]});_0x47763a=qs[_0xa62b('0x54')](_0x47763a,['id',_0xa62b('0x55'),_0xa62b('0x56')]);_0x1b29d3[_0xa62b('0x49')]=_[_0xa62b('0x54')](_0x1b29d3['body'],['id','createdAt',_0xa62b('0x56')]);return db[_0xa62b('0x3f')][_0xa62b('0x48')](_[_0xa62b('0x3d')](_0x47763a,_0x1b29d3[_0xa62b('0x49')]),{'include':_0x1b29d3[_0xa62b('0x31')][_0xa62b('0x53')]?[{'all':!![]}]:undefined})['then'](function(_0x11e3a4){var _0xa347ea=_0x1b29d3[_0xa62b('0x4a')]['get']({'plain':!![]});if(!_0xa347ea)throw new Error(_0xa62b('0x57'));if(_0xa347ea[_0xa62b('0x4c')]===_0xa62b('0x4a')){var _0x5d4003=_0x11e3a4[_0xa62b('0x4b')]({'plain':!![]});var _0x5c401e='Projects';return db[_0xa62b('0x4d')][_0xa62b('0x47')]({'where':{'name':_0x5c401e,'userProfileId':_0xa347ea['userProfileId']},'raw':!![]})[_0xa62b('0x21')](function(_0x3f3cde){if(_0x3f3cde&&_0x3f3cde['autoAssociation']===0x0){return db[_0xa62b('0x24')][_0xa62b('0x48')]({'name':_0x5d4003[_0xa62b('0x28')],'resourceId':_0x5d4003['id'],'type':_0x3f3cde['name'],'sectionId':_0x3f3cde['id']},{})[_0xa62b('0x21')](function(){return _0x11e3a4;});}else{return _0x11e3a4;}})[_0xa62b('0x43')](function(_0x2bd6b7){logger[_0xa62b('0x50')](_0xa62b('0x51'),_0x2bd6b7);throw _0x2bd6b7;});}return _0x11e3a4;});}})[_0xa62b('0x21')](respondWithResult(_0x57fa9b,0xc9))[_0xa62b('0x43')](handleError(_0x57fa9b,null));};exports[_0xa62b('0x20')]=function(_0x13fc8b,_0x59555d){if(_0x13fc8b[_0xa62b('0x49')]['id']){delete _0x13fc8b['body']['id'];}return db[_0xa62b('0x3f')][_0xa62b('0x47')]({'where':{'id':_0x13fc8b[_0xa62b('0x45')]['id']}})[_0xa62b('0x21')](handleEntityNotFound(_0x59555d,null))[_0xa62b('0x21')](saveUpdates(_0x13fc8b['body'],null))[_0xa62b('0x21')](respondWithResult(_0x59555d,null))[_0xa62b('0x43')](handleError(_0x59555d,null));};exports[_0xa62b('0x22')]=function(_0x5fa34,_0x20ace3){return db[_0xa62b('0x3f')]['find']({'where':{'id':_0x5fa34[_0xa62b('0x45')]['id']}})[_0xa62b('0x21')](handleEntityNotFound(_0x20ace3,null))[_0xa62b('0x21')](removeEntity(_0x20ace3,null))['catch'](handleError(_0x20ace3,null));};exports[_0xa62b('0x58')]=function(_0x277d5e,_0x282934,_0x5bcfd6){var _0x266c79={'raw':!![],'where':{}};var _0x4f360d={};var _0x6d8e1a={'count':0x0,'rows':[]};return db[_0xa62b('0x3f')][_0xa62b('0x59')]({'where':{'id':_0x277d5e[_0xa62b('0x45')]['id']}})[_0xa62b('0x21')](handleEntityNotFound(_0x282934,null))['then'](function(_0x1e9ce1){if(_0x1e9ce1){_0x4f360d[_0xa62b('0x30')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x4f360d[_0xa62b('0x31')]=_[_0xa62b('0x46')](_0x277d5e[_0xa62b('0x31')]);_0x4f360d['filters']=_[_0xa62b('0x34')](_0x4f360d[_0xa62b('0x30')],_0x4f360d[_0xa62b('0x31')]);_0x266c79[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x4f360d['model'],qs[_0xa62b('0x35')](_0x277d5e['query']['fields']));_0x266c79[_0xa62b('0x33')]=_0x266c79['attributes']['length']?_0x266c79[_0xa62b('0x33')]:_0x4f360d[_0xa62b('0x30')];if(!_0x277d5e[_0xa62b('0x31')][_0xa62b('0x37')]('nolimit')){_0x266c79[_0xa62b('0x1a')]=qs['limit'](_0x277d5e['query'][_0xa62b('0x1a')]);_0x266c79[_0xa62b('0x19')]=qs[_0xa62b('0x19')](_0x277d5e['query'][_0xa62b('0x19')]);}_0x266c79[_0xa62b('0x39')]=qs[_0xa62b('0x3a')](_0x277d5e[_0xa62b('0x31')][_0xa62b('0x3a')]);_0x266c79[_0xa62b('0x3b')]=qs[_0xa62b('0x32')](_['pick'](_0x277d5e[_0xa62b('0x31')],_0x4f360d[_0xa62b('0x32')]));_0x266c79[_0xa62b('0x3b')][_0xa62b('0x5a')]=_0x1e9ce1['id'];if(_0x277d5e['query'][_0xa62b('0x3c')]){_0x266c79['where']=_['merge'](_0x266c79['where'],{'$or':_[_0xa62b('0x2b')](_0x266c79['attributes'],function(_0x2ad98){var _0x5c08d6={};_0x5c08d6[_0x2ad98]={'$like':'%'+_0x277d5e[_0xa62b('0x31')][_0xa62b('0x3c')]+'%'};return _0x5c08d6;})});}_0x266c79=_['merge']({},_0x266c79,_0x277d5e['options']);return db[_0xa62b('0x5b')]['count']({'where':_0x266c79['where']})[_0xa62b('0x21')](function(_0x40cc3b){_0x6d8e1a[_0xa62b('0x1c')]=_0x40cc3b;if(_0x277d5e[_0xa62b('0x31')][_0xa62b('0x53')]){_0x266c79['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xa62b('0x41')](_0x266c79);})['then'](function(_0xc2cc45){_0x6d8e1a['rows']=_0xc2cc45;return _0x6d8e1a;});}})[_0xa62b('0x21')](respondWithFilteredResult(_0x282934,_0x266c79))[_0xa62b('0x43')](handleError(_0x282934,null));};exports[_0xa62b('0x5c')]=function(_0x56eb1b,_0x2e2dce,_0x59c7a7){var _0x33418c={'raw':!![],'where':{}};var _0x4eedc5={};var _0x4764f5={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa62b('0x59')]({'where':{'id':_0x56eb1b['params']['id']}})[_0xa62b('0x21')](handleEntityNotFound(_0x2e2dce,null))[_0xa62b('0x21')](function(_0x1772f4){if(_0x1772f4){_0x4eedc5['model']=_['keys'](db[_0xa62b('0x5d')][_0xa62b('0x2c')]);_0x4eedc5[_0xa62b('0x31')]=_[_0xa62b('0x46')](_0x56eb1b[_0xa62b('0x31')]);_0x4eedc5['filters']=_['intersection'](_0x4eedc5['model'],_0x4eedc5['query']);_0x33418c[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x4eedc5[_0xa62b('0x30')],qs['fields'](_0x56eb1b[_0xa62b('0x31')]['fields']));_0x33418c['attributes']=_0x33418c[_0xa62b('0x33')][_0xa62b('0x36')]?_0x33418c[_0xa62b('0x33')]:_0x4eedc5['model'];if(!_0x56eb1b[_0xa62b('0x31')][_0xa62b('0x37')](_0xa62b('0x38'))){_0x33418c[_0xa62b('0x1a')]=qs[_0xa62b('0x1a')](_0x56eb1b['query'][_0xa62b('0x1a')]);_0x33418c[_0xa62b('0x19')]=qs['offset'](_0x56eb1b[_0xa62b('0x31')]['offset']);}_0x33418c[_0xa62b('0x39')]=qs[_0xa62b('0x3a')](_0x56eb1b['query'][_0xa62b('0x3a')]);_0x33418c[_0xa62b('0x3b')]=qs[_0xa62b('0x32')](_[_0xa62b('0x5e')](_0x56eb1b['query'],_0x4eedc5[_0xa62b('0x32')]));_0x33418c[_0xa62b('0x3b')][_0xa62b('0x5a')]=_0x1772f4['id'];if(_0x56eb1b[_0xa62b('0x31')][_0xa62b('0x3c')]){_0x33418c[_0xa62b('0x3b')]=_['merge'](_0x33418c[_0xa62b('0x3b')],{'$or':_[_0xa62b('0x2b')](_0x33418c[_0xa62b('0x33')],function(_0x521ff5){var _0x3703fe={};_0x3703fe[_0x521ff5]={'$like':'%'+_0x56eb1b[_0xa62b('0x31')]['filter']+'%'};return _0x3703fe;})});}_0x33418c=_[_0xa62b('0x3d')]({},_0x33418c,_0x56eb1b[_0xa62b('0x3e')]);return db['JscriptyAnswerReport'][_0xa62b('0x1c')]({'where':_0x33418c['where']})[_0xa62b('0x21')](function(_0x5650b0){_0x4764f5[_0xa62b('0x1c')]=_0x5650b0;if(_0x56eb1b[_0xa62b('0x31')][_0xa62b('0x53')]){_0x33418c[_0xa62b('0x40')]=[{'all':!![]}];}return db[_0xa62b('0x5d')][_0xa62b('0x41')](_0x33418c);})[_0xa62b('0x21')](function(_0x3f4893){_0x4764f5['rows']=_0x3f4893;return _0x4764f5;});}})[_0xa62b('0x21')](respondWithFilteredResult(_0x2e2dce,_0x33418c))[_0xa62b('0x43')](handleError(_0x2e2dce,null));};function char(_0x47cdc5){return _0xa62b('0x5f')===typeof _0x47cdc5?String[_0xa62b('0x60')][_0xa62b('0x1e')](null,arguments):_0x47cdc5;}function needsEncapsulation(_0x296e53){return!!_0x296e53&&(_0x296e53[_0xa62b('0x61')]()[_0xa62b('0x62')](char(0xd))>=0x0||_0x296e53[_0xa62b('0x61')]()[_0xa62b('0x62')](char(0xa))>=0x0||_0x296e53[_0xa62b('0x61')]()[_0xa62b('0x62')](char(0x2c))>=0x0||_0x296e53[_0xa62b('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x22d2b1){var _0x4c26d0=char(0x22),_0x39d65a='\x5c'+char(0x22),_0x1e46d0=_0x22d2b1[_0xa62b('0x61')]()[_0xa62b('0x63')](new RegExp(_0x4c26d0,'g'),_0x39d65a);return _0x4c26d0+_0x1e46d0+_0x4c26d0;}exports['getSummary']=function(_0x1612f2,_0x2cd21e,_0x150145){var _0x2b3e63,_0x40dacb;var _0xae1b93={'where':{'ProjectId':_0x1612f2[_0xa62b('0x45')]['id']}};if(_0x1612f2[_0xa62b('0x31')][_0xa62b('0x64')]){_0xae1b93[_0xa62b('0x3b')][_0xa62b('0x65')]=JSON[_0xa62b('0x66')](_0x1612f2[_0xa62b('0x31')][_0xa62b('0x64')]);}return db['JscriptySessionReport'][_0xa62b('0x41')](_0xae1b93)[_0xa62b('0x21')](handleEntityNotFound(_0x2cd21e,null))[_0xa62b('0x21')](function(_0x390228){if(_0x390228){_0x2b3e63=_0x390228;return db[_0xa62b('0x67')][_0xa62b('0x41')]({'where':{'SessionId':{'$in':_['map'](_0x2b3e63,'id')},'ProjectId':_0x1612f2[_0xa62b('0x45')]['id']},'order':_0xa62b('0x68')});}})[_0xa62b('0x21')](handleEntityNotFound(_0x2cd21e,null))[_0xa62b('0x21')](function(_0x258547){if(_0x258547){_0x40dacb=_0x258547;var _0x42383b={};for(var _0x39c445=0x0,_0x1d5a57=_0x40dacb[_0xa62b('0x36')];_0x39c445<_0x1d5a57;_0x39c445++){if(!_0x42383b[_0xa62b('0x37')](_0x40dacb[_0x39c445]['questionId'])){_0x42383b[_0x40dacb[_0x39c445]['questionId']]=needsEncapsulation(_0x40dacb[_0x39c445]['question'])?encapsulate(_0x40dacb[_0x39c445][_0xa62b('0x69')]):_0x40dacb[_0x39c445]['question'];}}var _0x37dc8c=[],_0x4ba577={};for(var _0x1dd3ff=0x0,_0x2e5f0b=_0x2b3e63['length'];_0x1dd3ff<_0x2e5f0b;_0x1dd3ff++){_0x4ba577={'ProjectId':_0x1612f2[_0xa62b('0x45')]['id'],'SessionId':_0x2b3e63[_0x1dd3ff]['id'],'StartTime':moment(_0x2b3e63[_0x1dd3ff][_0xa62b('0x65')])[_0xa62b('0x6a')](_0xa62b('0x6b'))};for(var _0x48e0f4=0x0,_0x2af17c=_0x40dacb[_0xa62b('0x36')];_0x48e0f4<_0x2af17c;_0x48e0f4++){if(_0x40dacb[_0x48e0f4]['SessionId']==_0x2b3e63[_0x1dd3ff]['id']&&_0x42383b[_0xa62b('0x37')](_0x40dacb[_0x48e0f4]['questionId'])){_0x4ba577[_0x42383b[_0x40dacb[_0x48e0f4][_0xa62b('0x6c')]]]=_0x40dacb[_0x48e0f4]['answer'];}}for(var _0x36d09f in _0x42383b){if(!_0x4ba577[_0xa62b('0x37')](_0x42383b[_0x36d09f])){_0x4ba577[_0x42383b[_0x36d09f]]=null;}}_0x37dc8c[_0xa62b('0x6d')](_0x4ba577);}return _0x37dc8c;}})[_0xa62b('0x21')](function(_0x3f21e8){if(!_[_0xa62b('0x6e')](_0x3f21e8)){var _0x33c55c=toCsv(_0x3f21e8);var _0x3787ec=Date[_0xa62b('0x6f')]();fs[_0xa62b('0x70')](util[_0xa62b('0x6a')](_0xa62b('0x71'),_0x1612f2[_0xa62b('0x45')]['id'],_0x3787ec),_0x33c55c);_0x2cd21e[_0xa62b('0x72')]('Content-disposition','attachment;\x20filename='+util[_0xa62b('0x6a')](_0xa62b('0x73'),_0x1612f2[_0xa62b('0x45')]['id'],_0x3787ec));_0x2cd21e[_0xa62b('0x72')](_0xa62b('0x74'),'text/csv');return _0x2cd21e[_0xa62b('0x75')](util['format'](_0xa62b('0x71'),_0x1612f2['params']['id'],_0x3787ec));}else{return _0x2cd21e['sendStatus'](0xcc);}})[_0xa62b('0x43')](handleError(_0x2cd21e,null));}; \ No newline at end of file +var _0xebc0=['util','path','sox','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Projects','UserProfileResource','end','stack','name','send','index','map','JscriptyProject','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','user','userProfileId','getSessions','findOne','JscriptySessionReport','ProjectId','filter','findAll','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4004b8,_0x3ca725){var _0x29cff4=function(_0x554005){while(--_0x554005){_0x4004b8['push'](_0x4004b8['shift']());}};_0x29cff4(++_0x3ca725);}(_0xebc0,0xe5));var _0x0ebc=function(_0xb24e0d,_0x1dfe1d){_0xb24e0d=_0xb24e0d-0x0;var _0x4a1219=_0xebc0[_0xb24e0d];return _0x4a1219;};'use strict';var emlformat=require(_0x0ebc('0x0'));var rimraf=require(_0x0ebc('0x1'));var zipdir=require(_0x0ebc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ebc('0x3'));var moment=require(_0x0ebc('0x4'));var BPromise=require(_0x0ebc('0x5'));var Mustache=require(_0x0ebc('0x6'));var util=require(_0x0ebc('0x7'));var path=require(_0x0ebc('0x8'));var sox=require(_0x0ebc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ebc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ebc('0xb'));var jsforce=require(_0x0ebc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ebc('0xd'));var Redis=require(_0x0ebc('0xe'));var authService=require(_0x0ebc('0xf'));var qs=require(_0x0ebc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ebc('0x11'));var logger=require(_0x0ebc('0x12'))(_0x0ebc('0x13'));var utils=require(_0x0ebc('0x14'));var config=require(_0x0ebc('0x15'));var licenseUtil=require(_0x0ebc('0x16'));var db=require(_0x0ebc('0x17'))['db'];function respondWithStatusCode(_0x32eacb,_0x169522){_0x169522=_0x169522||0xcc;return function(_0x12814d){if(_0x12814d){return _0x32eacb[_0x0ebc('0x18')](_0x169522);}return _0x32eacb[_0x0ebc('0x19')](_0x169522)['end']();};}function respondWithResult(_0x1bdfdc,_0x4468e3){_0x4468e3=_0x4468e3||0xc8;return function(_0x3b9854){if(_0x3b9854){return _0x1bdfdc[_0x0ebc('0x19')](_0x4468e3)[_0x0ebc('0x1a')](_0x3b9854);}};}function respondWithFilteredResult(_0xd7eda3,_0x45d5d2){return function(_0x38af7c){if(_0x38af7c){var _0x2f713a=typeof _0x45d5d2[_0x0ebc('0x1b')]===_0x0ebc('0x1c')&&typeof _0x45d5d2[_0x0ebc('0x1d')]==='undefined';var _0x9175bf=_0x38af7c[_0x0ebc('0x1e')];var _0x395ad1=_0x2f713a?0x0:_0x45d5d2[_0x0ebc('0x1b')];var _0x2e79d5=_0x2f713a?_0x38af7c['count']:_0x45d5d2[_0x0ebc('0x1b')]+_0x45d5d2[_0x0ebc('0x1d')];var _0x1ddf3f;if(_0x2e79d5>=_0x9175bf){_0x2e79d5=_0x9175bf;_0x1ddf3f=0xc8;}else{_0x1ddf3f=0xce;}_0xd7eda3[_0x0ebc('0x19')](_0x1ddf3f);return _0xd7eda3[_0x0ebc('0x1f')](_0x0ebc('0x20'),_0x395ad1+'-'+_0x2e79d5+'/'+_0x9175bf)['json'](_0x38af7c);}return null;};}function patchUpdates(_0x60bd85){return function(_0x7a1cd){try{jsonpatch[_0x0ebc('0x21')](_0x7a1cd,_0x60bd85,!![]);}catch(_0x3c875f){return BPromise['reject'](_0x3c875f);}return _0x7a1cd['save']();};}function saveUpdates(_0x1e8e38,_0x319dc4){return function(_0x2b9a34){if(_0x2b9a34){return _0x2b9a34[_0x0ebc('0x22')](_0x1e8e38)[_0x0ebc('0x23')](function(_0x34f1cb){return _0x34f1cb;});}return null;};}function removeEntity(_0x24aa1d,_0x1a23d2){return function(_0x4c11dc){if(_0x4c11dc){return _0x4c11dc[_0x0ebc('0x24')]()[_0x0ebc('0x23')](function(){var _0x391ecd=_0x4c11dc[_0x0ebc('0x25')]({'plain':!![]});var _0x351f45=_0x0ebc('0x26');return db[_0x0ebc('0x27')][_0x0ebc('0x24')]({'where':{'type':_0x351f45,'resourceId':_0x391ecd['id']}})[_0x0ebc('0x23')](function(){return _0x4c11dc;});})[_0x0ebc('0x23')](function(){_0x24aa1d[_0x0ebc('0x19')](0xcc)[_0x0ebc('0x28')]();});}};}function handleEntityNotFound(_0x572db4,_0x3a8f62){return function(_0x2f8fdb){if(!_0x2f8fdb){_0x572db4['sendStatus'](0x194);}return _0x2f8fdb;};}function handleError(_0x26c66d,_0x5f5cad){_0x5f5cad=_0x5f5cad||0x1f4;return function(_0x8a76ec){logger['error'](_0x8a76ec[_0x0ebc('0x29')]);if(_0x8a76ec['name']){delete _0x8a76ec[_0x0ebc('0x2a')];}_0x26c66d['status'](_0x5f5cad)[_0x0ebc('0x2b')](_0x8a76ec);};}exports[_0x0ebc('0x2c')]=function(_0x1d64d8,_0x111d1a){var _0x2b71ef={},_0x1f9840={},_0x1d70af={'count':0x0,'rows':[]};var _0x1f2513=_[_0x0ebc('0x2d')](db[_0x0ebc('0x2e')]['rawAttributes'],function(_0x4ad65e){return{'name':_0x4ad65e[_0x0ebc('0x2f')],'type':_0x4ad65e[_0x0ebc('0x30')][_0x0ebc('0x31')]};});_0x1f9840['model']=_[_0x0ebc('0x2d')](_0x1f2513,'name');_0x1f9840['query']=_['keys'](_0x1d64d8['query']);_0x1f9840[_0x0ebc('0x32')]=_[_0x0ebc('0x33')](_0x1f9840[_0x0ebc('0x34')],_0x1f9840[_0x0ebc('0x35')]);_0x2b71ef[_0x0ebc('0x36')]=_[_0x0ebc('0x33')](_0x1f9840[_0x0ebc('0x34')],qs['fields'](_0x1d64d8['query'][_0x0ebc('0x37')]));_0x2b71ef[_0x0ebc('0x36')]=_0x2b71ef[_0x0ebc('0x36')][_0x0ebc('0x38')]?_0x2b71ef['attributes']:_0x1f9840['model'];if(!_0x1d64d8[_0x0ebc('0x35')][_0x0ebc('0x39')](_0x0ebc('0x3a'))){_0x2b71ef[_0x0ebc('0x1d')]=qs[_0x0ebc('0x1d')](_0x1d64d8[_0x0ebc('0x35')][_0x0ebc('0x1d')]);_0x2b71ef['offset']=qs[_0x0ebc('0x1b')](_0x1d64d8[_0x0ebc('0x35')]['offset']);}_0x2b71ef['order']=qs[_0x0ebc('0x3b')](_0x1d64d8[_0x0ebc('0x35')][_0x0ebc('0x3b')]);_0x2b71ef[_0x0ebc('0x3c')]=qs[_0x0ebc('0x32')](_[_0x0ebc('0x3d')](_0x1d64d8[_0x0ebc('0x35')],_0x1f9840[_0x0ebc('0x32')]),_0x1f2513);if(_0x1d64d8['query']['filter']){_0x2b71ef['where']=_['merge'](_0x2b71ef['where'],{'$or':_[_0x0ebc('0x2d')](_0x1f2513,function(_0x3373fd){if(_0x3373fd[_0x0ebc('0x30')]!=='VIRTUAL'){var _0x54dda1={};_0x54dda1[_0x3373fd[_0x0ebc('0x2a')]]={'$like':'%'+_0x1d64d8[_0x0ebc('0x35')]['filter']+'%'};return _0x54dda1;}})});}_0x2b71ef=_[_0x0ebc('0x3e')]({},_0x2b71ef,_0x1d64d8['options']);var _0x20123a={'where':_0x2b71ef['where']};return db['JscriptyProject'][_0x0ebc('0x1e')](_0x20123a)['then'](function(_0x22689b){_0x1d70af[_0x0ebc('0x1e')]=_0x22689b;if(_0x1d64d8[_0x0ebc('0x35')][_0x0ebc('0x3f')]){_0x2b71ef[_0x0ebc('0x40')]=[{'all':!![]}];}return db[_0x0ebc('0x2e')]['findAll'](_0x2b71ef);})[_0x0ebc('0x23')](function(_0xec2049){_0x1d70af[_0x0ebc('0x41')]=_0xec2049;return _0x1d70af;})[_0x0ebc('0x23')](respondWithFilteredResult(_0x111d1a,_0x2b71ef))[_0x0ebc('0x42')](handleError(_0x111d1a,null));};exports[_0x0ebc('0x43')]=function(_0x13d288,_0x54db7a){var _0x52ce93={'raw':![],'where':{'id':_0x13d288[_0x0ebc('0x44')]['id']}},_0xbf5217={};_0xbf5217[_0x0ebc('0x34')]=_[_0x0ebc('0x45')](db[_0x0ebc('0x2e')][_0x0ebc('0x46')]);_0xbf5217[_0x0ebc('0x35')]=_[_0x0ebc('0x45')](_0x13d288['query']);_0xbf5217[_0x0ebc('0x32')]=_[_0x0ebc('0x33')](_0xbf5217[_0x0ebc('0x34')],_0xbf5217[_0x0ebc('0x35')]);_0x52ce93['attributes']=_['intersection'](_0xbf5217['model'],qs[_0x0ebc('0x37')](_0x13d288[_0x0ebc('0x35')][_0x0ebc('0x37')]));_0x52ce93[_0x0ebc('0x36')]=_0x52ce93[_0x0ebc('0x36')][_0x0ebc('0x38')]?_0x52ce93[_0x0ebc('0x36')]:_0xbf5217[_0x0ebc('0x34')];if(_0x13d288['query'][_0x0ebc('0x3f')]){_0x52ce93['include']=[{'all':!![]}];}_0x52ce93=_[_0x0ebc('0x3e')]({},_0x52ce93,_0x13d288[_0x0ebc('0x47')]);return db[_0x0ebc('0x2e')]['find'](_0x52ce93)[_0x0ebc('0x23')](handleEntityNotFound(_0x54db7a,null))[_0x0ebc('0x23')](respondWithResult(_0x54db7a,null))[_0x0ebc('0x42')](handleError(_0x54db7a,null));};exports[_0x0ebc('0x48')]=function(_0x3fad40,_0x238c10){return db['JscriptyProject'][_0x0ebc('0x48')](_0x3fad40[_0x0ebc('0x49')],{})[_0x0ebc('0x23')](function(_0x29a69a){var _0x5a2d09=_0x3fad40['user']['get']({'plain':!![]});if(!_0x5a2d09)throw new Error(_0x0ebc('0x4a'));if(_0x5a2d09[_0x0ebc('0x4b')]==='user'){var _0x2b04d=_0x29a69a['get']({'plain':!![]});var _0xc165f1=_0x0ebc('0x26');return db[_0x0ebc('0x4c')][_0x0ebc('0x4d')]({'where':{'name':_0xc165f1,'userProfileId':_0x5a2d09['userProfileId']},'raw':!![]})[_0x0ebc('0x23')](function(_0x3b4d2d){if(_0x3b4d2d&&_0x3b4d2d[_0x0ebc('0x4e')]===0x0){return db[_0x0ebc('0x27')][_0x0ebc('0x48')]({'name':_0x2b04d[_0x0ebc('0x2a')],'resourceId':_0x2b04d['id'],'type':_0x3b4d2d[_0x0ebc('0x2a')],'sectionId':_0x3b4d2d['id']},{})[_0x0ebc('0x23')](function(){return _0x29a69a;});}else{return _0x29a69a;}})[_0x0ebc('0x42')](function(_0x5b5c77){logger[_0x0ebc('0x4f')](_0x0ebc('0x50'),_0x5b5c77);throw _0x5b5c77;});}return _0x29a69a;})[_0x0ebc('0x23')](respondWithResult(_0x238c10,0xc9))[_0x0ebc('0x42')](handleError(_0x238c10,null));};exports[_0x0ebc('0x51')]=function(_0x3c6a95,_0x41f66d){var _0x5466ec={'where':{'id':_0x3c6a95[_0x0ebc('0x44')]['id']}},_0xc9a8e6={};_0xc9a8e6[_0x0ebc('0x34')]=_[_0x0ebc('0x45')](db[_0x0ebc('0x2e')][_0x0ebc('0x46')]);_0x5466ec[_0x0ebc('0x36')]=_['intersection'](_0xc9a8e6['model'],qs['fields'](_0x3c6a95['query'][_0x0ebc('0x37')]));_0x5466ec[_0x0ebc('0x36')]=_0x5466ec[_0x0ebc('0x36')][_0x0ebc('0x38')]?_0x5466ec[_0x0ebc('0x36')]:_0xc9a8e6[_0x0ebc('0x34')];if(_0x3c6a95[_0x0ebc('0x35')][_0x0ebc('0x3f')]){_0x5466ec['include']=[{'all':!![]}];}_0x5466ec=_['merge']({},_0x5466ec,_0x3c6a95[_0x0ebc('0x47')]);return db[_0x0ebc('0x2e')]['find'](_0x5466ec)[_0x0ebc('0x23')](handleEntityNotFound(_0x41f66d,null))[_0x0ebc('0x23')](function(_0x3a3455){if(_0x3a3455){var _0x13d74a=_0x3a3455[_0x0ebc('0x25')]({'plain':!![]});_0x13d74a=qs[_0x0ebc('0x52')](_0x13d74a,['id','createdAt',_0x0ebc('0x53')]);_0x3c6a95['body']=_[_0x0ebc('0x52')](_0x3c6a95['body'],['id',_0x0ebc('0x54'),_0x0ebc('0x53')]);return db['JscriptyProject']['create'](_['merge'](_0x13d74a,_0x3c6a95[_0x0ebc('0x49')]),{'include':_0x3c6a95['query'][_0x0ebc('0x3f')]?[{'all':!![]}]:undefined})[_0x0ebc('0x23')](function(_0x504cb3){var _0x282236=_0x3c6a95[_0x0ebc('0x55')][_0x0ebc('0x25')]({'plain':!![]});if(!_0x282236)throw new Error(_0x0ebc('0x4a'));if(_0x282236[_0x0ebc('0x4b')]===_0x0ebc('0x55')){var _0x1336b0=_0x504cb3['get']({'plain':!![]});var _0xc182c0=_0x0ebc('0x26');return db[_0x0ebc('0x4c')][_0x0ebc('0x4d')]({'where':{'name':_0xc182c0,'userProfileId':_0x282236[_0x0ebc('0x56')]},'raw':!![]})[_0x0ebc('0x23')](function(_0xed86d4){if(_0xed86d4&&_0xed86d4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1336b0[_0x0ebc('0x2a')],'resourceId':_0x1336b0['id'],'type':_0xed86d4[_0x0ebc('0x2a')],'sectionId':_0xed86d4['id']},{})[_0x0ebc('0x23')](function(){return _0x504cb3;});}else{return _0x504cb3;}})[_0x0ebc('0x42')](function(_0x4c8338){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c8338);throw _0x4c8338;});}return _0x504cb3;});}})[_0x0ebc('0x23')](respondWithResult(_0x41f66d,0xc9))[_0x0ebc('0x42')](handleError(_0x41f66d,null));};exports['update']=function(_0xa35738,_0x46f4c4){if(_0xa35738[_0x0ebc('0x49')]['id']){delete _0xa35738[_0x0ebc('0x49')]['id'];}return db[_0x0ebc('0x2e')][_0x0ebc('0x4d')]({'where':{'id':_0xa35738['params']['id']}})[_0x0ebc('0x23')](handleEntityNotFound(_0x46f4c4,null))[_0x0ebc('0x23')](saveUpdates(_0xa35738[_0x0ebc('0x49')],null))[_0x0ebc('0x23')](respondWithResult(_0x46f4c4,null))[_0x0ebc('0x42')](handleError(_0x46f4c4,null));};exports['destroy']=function(_0x1f039c,_0xdcab47){return db[_0x0ebc('0x2e')][_0x0ebc('0x4d')]({'where':{'id':_0x1f039c[_0x0ebc('0x44')]['id']}})['then'](handleEntityNotFound(_0xdcab47,null))[_0x0ebc('0x23')](removeEntity(_0xdcab47,null))['catch'](handleError(_0xdcab47,null));};exports[_0x0ebc('0x57')]=function(_0x555f53,_0x3671e3,_0x58d14b){var _0x117d7c={'raw':!![],'where':{}};var _0x13d706={};var _0x53d3b6={'count':0x0,'rows':[]};return db[_0x0ebc('0x2e')][_0x0ebc('0x58')]({'where':{'id':_0x555f53['params']['id']}})[_0x0ebc('0x23')](handleEntityNotFound(_0x3671e3,null))[_0x0ebc('0x23')](function(_0x3abb28){if(_0x3abb28){_0x13d706[_0x0ebc('0x34')]=_[_0x0ebc('0x45')](db[_0x0ebc('0x59')][_0x0ebc('0x46')]);_0x13d706['query']=_[_0x0ebc('0x45')](_0x555f53[_0x0ebc('0x35')]);_0x13d706[_0x0ebc('0x32')]=_['intersection'](_0x13d706[_0x0ebc('0x34')],_0x13d706[_0x0ebc('0x35')]);_0x117d7c[_0x0ebc('0x36')]=_[_0x0ebc('0x33')](_0x13d706[_0x0ebc('0x34')],qs[_0x0ebc('0x37')](_0x555f53[_0x0ebc('0x35')][_0x0ebc('0x37')]));_0x117d7c[_0x0ebc('0x36')]=_0x117d7c['attributes'][_0x0ebc('0x38')]?_0x117d7c[_0x0ebc('0x36')]:_0x13d706[_0x0ebc('0x34')];if(!_0x555f53[_0x0ebc('0x35')]['hasOwnProperty'](_0x0ebc('0x3a'))){_0x117d7c[_0x0ebc('0x1d')]=qs[_0x0ebc('0x1d')](_0x555f53[_0x0ebc('0x35')][_0x0ebc('0x1d')]);_0x117d7c['offset']=qs['offset'](_0x555f53[_0x0ebc('0x35')][_0x0ebc('0x1b')]);}_0x117d7c['order']=qs[_0x0ebc('0x3b')](_0x555f53['query']['sort']);_0x117d7c[_0x0ebc('0x3c')]=qs['filters'](_[_0x0ebc('0x3d')](_0x555f53[_0x0ebc('0x35')],_0x13d706[_0x0ebc('0x32')]));_0x117d7c['where'][_0x0ebc('0x5a')]=_0x3abb28['id'];if(_0x555f53[_0x0ebc('0x35')][_0x0ebc('0x5b')]){_0x117d7c[_0x0ebc('0x3c')]=_[_0x0ebc('0x3e')](_0x117d7c[_0x0ebc('0x3c')],{'$or':_[_0x0ebc('0x2d')](_0x117d7c[_0x0ebc('0x36')],function(_0x37b37f){var _0x51153e={};_0x51153e[_0x37b37f]={'$like':'%'+_0x555f53[_0x0ebc('0x35')]['filter']+'%'};return _0x51153e;})});}_0x117d7c=_[_0x0ebc('0x3e')]({},_0x117d7c,_0x555f53[_0x0ebc('0x47')]);return db[_0x0ebc('0x59')][_0x0ebc('0x1e')]({'where':_0x117d7c[_0x0ebc('0x3c')]})[_0x0ebc('0x23')](function(_0x172297){_0x53d3b6[_0x0ebc('0x1e')]=_0x172297;if(_0x555f53[_0x0ebc('0x35')][_0x0ebc('0x3f')]){_0x117d7c['include']=[{'all':!![]}];}return db[_0x0ebc('0x59')][_0x0ebc('0x5c')](_0x117d7c);})[_0x0ebc('0x23')](function(_0x26cf37){_0x53d3b6[_0x0ebc('0x41')]=_0x26cf37;return _0x53d3b6;});}})['then'](respondWithFilteredResult(_0x3671e3,_0x117d7c))['catch'](handleError(_0x3671e3,null));};exports[_0x0ebc('0x5d')]=function(_0x46cc56,_0x3afeee,_0x3e2fe8){var _0x30f2a6={'raw':!![],'where':{}};var _0x59a2c={};var _0x16d8f4={'count':0x0,'rows':[]};return db[_0x0ebc('0x2e')][_0x0ebc('0x58')]({'where':{'id':_0x46cc56[_0x0ebc('0x44')]['id']}})[_0x0ebc('0x23')](handleEntityNotFound(_0x3afeee,null))['then'](function(_0x5f3f51){if(_0x5f3f51){_0x59a2c[_0x0ebc('0x34')]=_[_0x0ebc('0x45')](db[_0x0ebc('0x5e')][_0x0ebc('0x46')]);_0x59a2c[_0x0ebc('0x35')]=_[_0x0ebc('0x45')](_0x46cc56[_0x0ebc('0x35')]);_0x59a2c[_0x0ebc('0x32')]=_['intersection'](_0x59a2c[_0x0ebc('0x34')],_0x59a2c['query']);_0x30f2a6[_0x0ebc('0x36')]=_[_0x0ebc('0x33')](_0x59a2c['model'],qs[_0x0ebc('0x37')](_0x46cc56[_0x0ebc('0x35')][_0x0ebc('0x37')]));_0x30f2a6[_0x0ebc('0x36')]=_0x30f2a6['attributes']['length']?_0x30f2a6[_0x0ebc('0x36')]:_0x59a2c[_0x0ebc('0x34')];if(!_0x46cc56[_0x0ebc('0x35')]['hasOwnProperty'](_0x0ebc('0x3a'))){_0x30f2a6[_0x0ebc('0x1d')]=qs['limit'](_0x46cc56[_0x0ebc('0x35')][_0x0ebc('0x1d')]);_0x30f2a6[_0x0ebc('0x1b')]=qs[_0x0ebc('0x1b')](_0x46cc56[_0x0ebc('0x35')]['offset']);}_0x30f2a6['order']=qs['sort'](_0x46cc56[_0x0ebc('0x35')][_0x0ebc('0x3b')]);_0x30f2a6[_0x0ebc('0x3c')]=qs[_0x0ebc('0x32')](_[_0x0ebc('0x3d')](_0x46cc56[_0x0ebc('0x35')],_0x59a2c[_0x0ebc('0x32')]));_0x30f2a6[_0x0ebc('0x3c')]['ProjectId']=_0x5f3f51['id'];if(_0x46cc56['query']['filter']){_0x30f2a6['where']=_[_0x0ebc('0x3e')](_0x30f2a6[_0x0ebc('0x3c')],{'$or':_[_0x0ebc('0x2d')](_0x30f2a6[_0x0ebc('0x36')],function(_0x2da352){var _0x46209b={};_0x46209b[_0x2da352]={'$like':'%'+_0x46cc56[_0x0ebc('0x35')][_0x0ebc('0x5b')]+'%'};return _0x46209b;})});}_0x30f2a6=_[_0x0ebc('0x3e')]({},_0x30f2a6,_0x46cc56['options']);return db[_0x0ebc('0x5e')][_0x0ebc('0x1e')]({'where':_0x30f2a6['where']})[_0x0ebc('0x23')](function(_0x188e8e){_0x16d8f4[_0x0ebc('0x1e')]=_0x188e8e;if(_0x46cc56[_0x0ebc('0x35')][_0x0ebc('0x3f')]){_0x30f2a6[_0x0ebc('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x30f2a6);})['then'](function(_0x1768f2){_0x16d8f4[_0x0ebc('0x41')]=_0x1768f2;return _0x16d8f4;});}})[_0x0ebc('0x23')](respondWithFilteredResult(_0x3afeee,_0x30f2a6))[_0x0ebc('0x42')](handleError(_0x3afeee,null));};function char(_0x352b1c){return'number'===typeof _0x352b1c?String[_0x0ebc('0x5f')][_0x0ebc('0x21')](null,arguments):_0x352b1c;}function needsEncapsulation(_0x51a101){return!!_0x51a101&&(_0x51a101[_0x0ebc('0x60')]()[_0x0ebc('0x61')](char(0xd))>=0x0||_0x51a101[_0x0ebc('0x60')]()['indexOf'](char(0xa))>=0x0||_0x51a101[_0x0ebc('0x60')]()[_0x0ebc('0x61')](char(0x2c))>=0x0||_0x51a101[_0x0ebc('0x60')]()[_0x0ebc('0x61')](char(0x22))>=0x0);}function encapsulate(_0x5bed1e){var _0xd500e1=char(0x22),_0x185287='\x5c'+char(0x22),_0x19f946=_0x5bed1e[_0x0ebc('0x60')]()[_0x0ebc('0x62')](new RegExp(_0xd500e1,'g'),_0x185287);return _0xd500e1+_0x19f946+_0xd500e1;}exports[_0x0ebc('0x63')]=function(_0x18cc64,_0x690b92,_0x245b18){var _0x307d58,_0x3c8a58;var _0x293bed={'where':{'ProjectId':_0x18cc64[_0x0ebc('0x44')]['id']}};if(_0x18cc64['query'][_0x0ebc('0x64')]){_0x293bed['where'][_0x0ebc('0x65')]=JSON['parse'](_0x18cc64[_0x0ebc('0x35')][_0x0ebc('0x64')]);}return db[_0x0ebc('0x59')][_0x0ebc('0x5c')](_0x293bed)[_0x0ebc('0x23')](handleEntityNotFound(_0x690b92,null))['then'](function(_0x2af123){if(_0x2af123){_0x307d58=_0x2af123;return db['JscriptyQuestionReport'][_0x0ebc('0x5c')]({'where':{'SessionId':{'$in':_[_0x0ebc('0x2d')](_0x307d58,'id')},'ProjectId':_0x18cc64[_0x0ebc('0x44')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x690b92,null))[_0x0ebc('0x23')](function(_0xfadc4c){if(_0xfadc4c){_0x3c8a58=_0xfadc4c;var _0x220109={};for(var _0x372f7d=0x0,_0x3f833a=_0x3c8a58[_0x0ebc('0x38')];_0x372f7d<_0x3f833a;_0x372f7d++){if(!_0x220109[_0x0ebc('0x39')](_0x3c8a58[_0x372f7d][_0x0ebc('0x66')])){_0x220109[_0x3c8a58[_0x372f7d][_0x0ebc('0x66')]]=needsEncapsulation(_0x3c8a58[_0x372f7d][_0x0ebc('0x67')])?encapsulate(_0x3c8a58[_0x372f7d][_0x0ebc('0x67')]):_0x3c8a58[_0x372f7d][_0x0ebc('0x67')];}}var _0x5188a5=[],_0x29ef6c={};for(var _0x5ee35b=0x0,_0x2908f2=_0x307d58[_0x0ebc('0x38')];_0x5ee35b<_0x2908f2;_0x5ee35b++){_0x29ef6c={'ProjectId':_0x18cc64[_0x0ebc('0x44')]['id'],'SessionId':_0x307d58[_0x5ee35b]['id'],'StartTime':moment(_0x307d58[_0x5ee35b][_0x0ebc('0x65')])[_0x0ebc('0x68')](_0x0ebc('0x69'))};for(var _0x187dfc=0x0,_0x165295=_0x3c8a58[_0x0ebc('0x38')];_0x187dfc<_0x165295;_0x187dfc++){if(_0x3c8a58[_0x187dfc][_0x0ebc('0x6a')]==_0x307d58[_0x5ee35b]['id']&&_0x220109[_0x0ebc('0x39')](_0x3c8a58[_0x187dfc][_0x0ebc('0x66')])){_0x29ef6c[_0x220109[_0x3c8a58[_0x187dfc]['questionId']]]=_0x3c8a58[_0x187dfc][_0x0ebc('0x6b')];}}for(var _0x2c37aa in _0x220109){if(!_0x29ef6c[_0x0ebc('0x39')](_0x220109[_0x2c37aa])){_0x29ef6c[_0x220109[_0x2c37aa]]=null;}}_0x5188a5[_0x0ebc('0x6c')](_0x29ef6c);}return _0x5188a5;}})['then'](function(_0x33d755){if(!_[_0x0ebc('0x6d')](_0x33d755)){var _0x4a1860=toCsv(_0x33d755);var _0x5876aa=Date[_0x0ebc('0x6e')]();fs[_0x0ebc('0x6f')](util[_0x0ebc('0x68')](_0x0ebc('0x70'),_0x18cc64[_0x0ebc('0x44')]['id'],_0x5876aa),_0x4a1860);_0x690b92['setHeader'](_0x0ebc('0x71'),'attachment;\x20filename='+util['format'](_0x0ebc('0x72'),_0x18cc64['params']['id'],_0x5876aa));_0x690b92[_0x0ebc('0x73')](_0x0ebc('0x74'),'text/csv');return _0x690b92[_0x0ebc('0x75')](util['format'](_0x0ebc('0x70'),_0x18cc64['params']['id'],_0x5876aa));}else{return _0x690b92[_0x0ebc('0x18')](0xcc);}})[_0x0ebc('0x42')](handleError(_0x690b92,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 436a60b..7d22a90 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 _0x3351=['exports','define','JscriptyProject','jscripty_projects','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dbeb4,_0x499544){var _0x18a513=function(_0x2fe229){while(--_0x2fe229){_0x2dbeb4['push'](_0x2dbeb4['shift']());}};_0x18a513(++_0x499544);}(_0x3351,0x1b4));var _0x1335=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x3351[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x1335('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var fs=require('fs');var path=require(_0x1335('0x5'));var rimraf=require(_0x1335('0x6'));var config=require(_0x1335('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0x1335('0x8')]=function(_0x1b951c,_0x2ee73b){return _0x1b951c[_0x1335('0x9')](_0x1335('0xa'),attributes,{'tableName':_0x1335('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04de=['./jscriptyProject.attributes','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x04de,0x107));var _0xe04d=function(_0x2e4461,_0x2f46ab){_0x2e4461=_0x2e4461-0x0;var _0x2b507f=_0x04de[_0x2e4461];return _0x2b507f;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'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 dfd55fb..45d1ca4 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(_0x4323be,_0x4127a9){var _0x51e495=function(_0x12208c){while(--_0x12208c){_0x4323be['push'](_0x4323be['shift']());}};_0x51e495(++_0x4127a9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0xda3f,0xec));var _0xfda3=function(_0x5716bc,_0x17e065){_0x5716bc=_0x5716bc-0x0;var _0x44928f=_0xda3f[_0x5716bc];return _0x44928f;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\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);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e1627a2..bd538f4 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 _0xe42e=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe42e,0x109));var _0xee42=function(_0x19ff9d,_0x58c8af){_0x19ff9d=_0x19ff9d-0x0;var _0x695f61=_0xe42e[_0x19ff9d];return _0x695f61;};'use strict';var multer=require(_0xee42('0x0'));var util=require(_0xee42('0x1'));var path=require('path');var timeout=require(_0xee42('0x2'));var express=require(_0xee42('0x3'));var router=express[_0xee42('0x4')]();var fs_extra=require(_0xee42('0x5'));var auth=require(_0xee42('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0xee42('0x7')]('/',auth[_0xee42('0x8')](),controller[_0xee42('0x9')]);router['get'](_0xee42('0xa'),auth[_0xee42('0x8')](),controller[_0xee42('0xb')]);router[_0xee42('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee42('0xc')]);router[_0xee42('0xd')]('/',auth[_0xee42('0x8')](),controller[_0xee42('0xe')]);router[_0xee42('0xf')](_0xee42('0x10'),auth['isAuthenticated'](),controller[_0xee42('0x11')]);router[_0xee42('0x12')]('/:id',auth[_0xee42('0x8')](),controller['destroy']);module[_0xee42('0x13')]=router; \ No newline at end of file +var _0x5014=['delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x4d8a3e,_0x138340){var _0x241eee=function(_0x182649){while(--_0x182649){_0x4d8a3e['push'](_0x4d8a3e['shift']());}};_0x241eee(++_0x138340);}(_0x5014,0x106));var _0x4501=function(_0x4f3988,_0xa5a358){_0x4f3988=_0x4f3988-0x0;var _0x2bda86=_0x5014[_0x4f3988];return _0x2bda86;};'use strict';var multer=require(_0x4501('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4501('0x1'));var router=express[_0x4501('0x2')]();var fs_extra=require(_0x4501('0x3'));var auth=require(_0x4501('0x4'));var interaction=require(_0x4501('0x5'));var config=require(_0x4501('0x6'));var controller=require(_0x4501('0x7'));router[_0x4501('0x8')]('/',auth[_0x4501('0x9')](),controller[_0x4501('0xa')]);router['get'](_0x4501('0xb'),auth[_0x4501('0x9')](),controller[_0x4501('0xc')]);router[_0x4501('0x8')](_0x4501('0xd'),auth['isAuthenticated'](),controller[_0x4501('0xe')]);router[_0x4501('0xf')]('/',auth[_0x4501('0x9')](),controller['create']);router[_0x4501('0x10')]('/:id',auth[_0x4501('0x9')](),controller[_0x4501('0x11')]);router[_0x4501('0x12')]('/:id',auth[_0x4501('0x9')](),controller[_0x4501('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 36a93f4..045a637 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x110824,_0x4679ff){_0x110824=_0x110824-0x0;var _0x4a3f4a=_0x7a54[_0x110824];return _0x4a3f4a;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4c787b,_0x2cfff0){_0x4c787b=_0x4c787b-0x0;var _0x135f19=_0x7a54[_0x4c787b];return _0x135f19;};'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 e2aa6bd..9ae33a0 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 _0x89ff=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','show','params','fields','find','create','body','catch','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89ff,0x1c2));var _0xf89f=function(_0x37b729,_0x8f10af){_0x37b729=_0x37b729-0x0;var _0x40cd25=_0x89ff[_0x37b729];return _0x40cd25;};'use strict';var emlformat=require(_0xf89f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf89f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf89f('0x2'));var moment=require(_0xf89f('0x3'));var BPromise=require(_0xf89f('0x4'));var Mustache=require(_0xf89f('0x5'));var util=require(_0xf89f('0x6'));var path=require(_0xf89f('0x7'));var sox=require(_0xf89f('0x8'));var csv=require(_0xf89f('0x9'));var ejs=require(_0xf89f('0xa'));var fs=require('fs');var fs_extra=require(_0xf89f('0xb'));var _=require(_0xf89f('0xc'));var squel=require(_0xf89f('0xd'));var crypto=require(_0xf89f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf89f('0xf'));var Papa=require(_0xf89f('0x10'));var Redis=require(_0xf89f('0x11'));var authService=require(_0xf89f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf89f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf89f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf89f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf89f('0x16'))['db'];function respondWithStatusCode(_0x3093fb,_0x3d027d){_0x3d027d=_0x3d027d||0xcc;return function(_0x10fbbf){if(_0x10fbbf){return _0x3093fb[_0xf89f('0x17')](_0x3d027d);}return _0x3093fb[_0xf89f('0x18')](_0x3d027d)['end']();};}function respondWithResult(_0x2a0879,_0x566a89){_0x566a89=_0x566a89||0xc8;return function(_0x3260be){if(_0x3260be){return _0x2a0879[_0xf89f('0x18')](_0x566a89)[_0xf89f('0x19')](_0x3260be);}};}function respondWithFilteredResult(_0x1c47e6,_0x23c4a8){return function(_0x3770dc){if(_0x3770dc){var _0x4c08da=typeof _0x23c4a8['offset']===_0xf89f('0x1a')&&typeof _0x23c4a8[_0xf89f('0x1b')]===_0xf89f('0x1a');var _0x3a72f0=_0x3770dc['count'];var _0x413eb5=_0x4c08da?0x0:_0x23c4a8[_0xf89f('0x1c')];var _0x52890e=_0x4c08da?_0x3770dc['count']:_0x23c4a8[_0xf89f('0x1c')]+_0x23c4a8['limit'];var _0x4b888a;if(_0x52890e>=_0x3a72f0){_0x52890e=_0x3a72f0;_0x4b888a=0xc8;}else{_0x4b888a=0xce;}_0x1c47e6['status'](_0x4b888a);return _0x1c47e6[_0xf89f('0x1d')](_0xf89f('0x1e'),_0x413eb5+'-'+_0x52890e+'/'+_0x3a72f0)['json'](_0x3770dc);}return null;};}function patchUpdates(_0x2def3a){return function(_0x12c57d){try{jsonpatch[_0xf89f('0x1f')](_0x12c57d,_0x2def3a,!![]);}catch(_0x4899db){return BPromise[_0xf89f('0x20')](_0x4899db);}return _0x12c57d[_0xf89f('0x21')]();};}function saveUpdates(_0x3cbb3e,_0x5327fb){return function(_0x2ca5f2){if(_0x2ca5f2){return _0x2ca5f2[_0xf89f('0x22')](_0x3cbb3e)[_0xf89f('0x23')](function(_0x25c335){return _0x25c335;});}return null;};}function removeEntity(_0x2a3262,_0x15fc4a){return function(_0x4b4388){if(_0x4b4388){return _0x4b4388['destroy']()['then'](function(){_0x2a3262[_0xf89f('0x18')](0xcc)[_0xf89f('0x24')]();});}};}function handleEntityNotFound(_0x33e635,_0x3f7761){return function(_0x84e64d){if(!_0x84e64d){_0x33e635[_0xf89f('0x17')](0x194);}return _0x84e64d;};}function handleError(_0x3027ec,_0x12f2e3){_0x12f2e3=_0x12f2e3||0x1f4;return function(_0x22d158){logger[_0xf89f('0x25')](_0x22d158[_0xf89f('0x26')]);if(_0x22d158[_0xf89f('0x27')]){delete _0x22d158[_0xf89f('0x27')];}_0x3027ec[_0xf89f('0x18')](_0x12f2e3)[_0xf89f('0x28')](_0x22d158);};}exports[_0xf89f('0x29')]=function(_0x24449c,_0x56f07c){var _0x3e4d05={},_0x4f333c={},_0x2f1da7={'count':0x0,'rows':[]};var _0x138e90=_['map'](db[_0xf89f('0x2a')][_0xf89f('0x2b')],function(_0x473bd2){return{'name':_0x473bd2[_0xf89f('0x2c')],'type':_0x473bd2[_0xf89f('0x2d')]['key']};});_0x4f333c[_0xf89f('0x2e')]=_['map'](_0x138e90,_0xf89f('0x27'));_0x4f333c['query']=_[_0xf89f('0x2f')](_0x24449c[_0xf89f('0x30')]);_0x4f333c['filters']=_['intersection'](_0x4f333c[_0xf89f('0x2e')],_0x4f333c['query']);_0x3e4d05[_0xf89f('0x31')]=_[_0xf89f('0x32')](_0x4f333c[_0xf89f('0x2e')],qs['fields'](_0x24449c[_0xf89f('0x30')]['fields']));_0x3e4d05['attributes']=_0x3e4d05['attributes'][_0xf89f('0x33')]?_0x3e4d05[_0xf89f('0x31')]:_0x4f333c[_0xf89f('0x2e')];if(!_0x24449c[_0xf89f('0x30')][_0xf89f('0x34')](_0xf89f('0x35'))){_0x3e4d05['limit']=qs[_0xf89f('0x1b')](_0x24449c[_0xf89f('0x30')]['limit']);_0x3e4d05[_0xf89f('0x1c')]=qs[_0xf89f('0x1c')](_0x24449c[_0xf89f('0x30')][_0xf89f('0x1c')]);}_0x3e4d05['order']=qs[_0xf89f('0x36')](_0x24449c[_0xf89f('0x30')][_0xf89f('0x36')]);_0x3e4d05[_0xf89f('0x37')]=qs[_0xf89f('0x38')](_[_0xf89f('0x39')](_0x24449c[_0xf89f('0x30')],_0x4f333c[_0xf89f('0x38')]),_0x138e90);if(_0x24449c['query'][_0xf89f('0x3a')]){_0x3e4d05[_0xf89f('0x37')]=_[_0xf89f('0x3b')](_0x3e4d05[_0xf89f('0x37')],{'$or':_[_0xf89f('0x3c')](_0x138e90,function(_0x54b745){if(_0x54b745[_0xf89f('0x2d')]!==_0xf89f('0x3d')){var _0x218345={};_0x218345[_0x54b745['name']]={'$like':'%'+_0x24449c[_0xf89f('0x30')]['filter']+'%'};return _0x218345;}})});}_0x3e4d05=_[_0xf89f('0x3b')]({},_0x3e4d05,_0x24449c[_0xf89f('0x3e')]);var _0x4ca906={'where':_0x3e4d05[_0xf89f('0x37')]};return db[_0xf89f('0x2a')][_0xf89f('0x3f')](_0x4ca906)[_0xf89f('0x23')](function(_0x592a47){_0x2f1da7[_0xf89f('0x3f')]=_0x592a47;if(_0x24449c[_0xf89f('0x30')][_0xf89f('0x40')]){_0x3e4d05[_0xf89f('0x41')]=[{'all':!![]}];}return db[_0xf89f('0x2a')][_0xf89f('0x42')](_0x3e4d05);})[_0xf89f('0x23')](function(_0x26f4b0){_0x2f1da7['rows']=_0x26f4b0;return _0x2f1da7;})[_0xf89f('0x23')](respondWithFilteredResult(_0x56f07c,_0x3e4d05))['catch'](handleError(_0x56f07c,null));};exports[_0xf89f('0x43')]=function(_0x3a1e75,_0x14c0bf){var _0x31759e={'raw':!![],'where':{'id':_0x3a1e75[_0xf89f('0x44')]['id']}},_0x585a77={};_0x585a77[_0xf89f('0x2e')]=_['keys'](db[_0xf89f('0x2a')]['rawAttributes']);_0x585a77[_0xf89f('0x30')]=_[_0xf89f('0x2f')](_0x3a1e75[_0xf89f('0x30')]);_0x585a77[_0xf89f('0x38')]=_['intersection'](_0x585a77[_0xf89f('0x2e')],_0x585a77[_0xf89f('0x30')]);_0x31759e[_0xf89f('0x31')]=_[_0xf89f('0x32')](_0x585a77[_0xf89f('0x2e')],qs[_0xf89f('0x45')](_0x3a1e75[_0xf89f('0x30')]['fields']));_0x31759e[_0xf89f('0x31')]=_0x31759e[_0xf89f('0x31')][_0xf89f('0x33')]?_0x31759e['attributes']:_0x585a77['model'];if(_0x3a1e75[_0xf89f('0x30')]['includeAll']){_0x31759e[_0xf89f('0x41')]=[{'all':!![]}];}_0x31759e=_[_0xf89f('0x3b')]({},_0x31759e,_0x3a1e75[_0xf89f('0x3e')]);return db[_0xf89f('0x2a')][_0xf89f('0x46')](_0x31759e)[_0xf89f('0x23')](handleEntityNotFound(_0x14c0bf,null))['then'](respondWithResult(_0x14c0bf,null))['catch'](handleError(_0x14c0bf,null));};exports[_0xf89f('0x47')]=function(_0x4e90a2,_0x24d0ff){return db[_0xf89f('0x2a')][_0xf89f('0x47')](_0x4e90a2[_0xf89f('0x48')],{})['then'](respondWithResult(_0x24d0ff,0xc9))[_0xf89f('0x49')](handleError(_0x24d0ff,null));};exports['update']=function(_0x77493f,_0xd8d2e5){if(_0x77493f[_0xf89f('0x48')]['id']){delete _0x77493f[_0xf89f('0x48')]['id'];}return db['JscriptyQuestionReport'][_0xf89f('0x46')]({'where':{'id':_0x77493f[_0xf89f('0x44')]['id']}})['then'](handleEntityNotFound(_0xd8d2e5,null))[_0xf89f('0x23')](saveUpdates(_0x77493f[_0xf89f('0x48')],null))[_0xf89f('0x23')](respondWithResult(_0xd8d2e5,null))['catch'](handleError(_0xd8d2e5,null));};exports['destroy']=function(_0x4f5661,_0x452809){return db[_0xf89f('0x2a')][_0xf89f('0x46')]({'where':{'id':_0x4f5661[_0xf89f('0x44')]['id']}})[_0xf89f('0x23')](handleEntityNotFound(_0x452809,null))[_0xf89f('0x23')](removeEntity(_0x452809,null))['catch'](handleError(_0x452809,null));};exports[_0xf89f('0x4a')]=function(_0x308259,_0xc353f4){return db[_0xf89f('0x2a')]['describe']()[_0xf89f('0x23')](respondWithResult(_0xc353f4,null))[_0xf89f('0x49')](handleError(_0xc353f4,null));}; \ No newline at end of file +var _0xcebd=['name','index','JscriptyQuestionReport','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined','count','apply','update','then','destroy','sendStatus','error','stack'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0xcebd,0xf3));var _0xdceb=function(_0x4998af,_0xbe87f9){_0x4998af=_0x4998af-0x0;var _0x1ca727=_0xcebd[_0x4998af];return _0x1ca727;};'use strict';var emlformat=require(_0xdceb('0x0'));var rimraf=require(_0xdceb('0x1'));var zipdir=require(_0xdceb('0x2'));var jsonpatch=require(_0xdceb('0x3'));var rp=require(_0xdceb('0x4'));var moment=require(_0xdceb('0x5'));var BPromise=require(_0xdceb('0x6'));var Mustache=require(_0xdceb('0x7'));var util=require('util');var path=require(_0xdceb('0x8'));var sox=require(_0xdceb('0x9'));var csv=require(_0xdceb('0xa'));var ejs=require(_0xdceb('0xb'));var fs=require('fs');var fs_extra=require(_0xdceb('0xc'));var _=require(_0xdceb('0xd'));var squel=require('squel');var crypto=require(_0xdceb('0xe'));var jsforce=require(_0xdceb('0xf'));var deskjs=require(_0xdceb('0x10'));var toCsv=require(_0xdceb('0xa'));var querystring=require(_0xdceb('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdceb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdceb('0x13'))(_0xdceb('0x14'));var utils=require(_0xdceb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdceb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25e79f,_0x4a1a1e){_0x4a1a1e=_0x4a1a1e||0xcc;return function(_0x56542a){if(_0x56542a){return _0x25e79f['sendStatus'](_0x4a1a1e);}return _0x25e79f[_0xdceb('0x17')](_0x4a1a1e)[_0xdceb('0x18')]();};}function respondWithResult(_0x5acef5,_0x3b626b){_0x3b626b=_0x3b626b||0xc8;return function(_0x3d6db9){if(_0x3d6db9){return _0x5acef5[_0xdceb('0x17')](_0x3b626b)[_0xdceb('0x19')](_0x3d6db9);}};}function respondWithFilteredResult(_0x134bb6,_0x2ae6d6){return function(_0x183eab){if(_0x183eab){var _0x1f26c0=typeof _0x2ae6d6[_0xdceb('0x1a')]==='undefined'&&typeof _0x2ae6d6[_0xdceb('0x1b')]===_0xdceb('0x1c');var _0xc023de=_0x183eab[_0xdceb('0x1d')];var _0x5d474d=_0x1f26c0?0x0:_0x2ae6d6[_0xdceb('0x1a')];var _0x5cfd93=_0x1f26c0?_0x183eab[_0xdceb('0x1d')]:_0x2ae6d6[_0xdceb('0x1a')]+_0x2ae6d6['limit'];var _0x42cd9a;if(_0x5cfd93>=_0xc023de){_0x5cfd93=_0xc023de;_0x42cd9a=0xc8;}else{_0x42cd9a=0xce;}_0x134bb6[_0xdceb('0x17')](_0x42cd9a);return _0x134bb6['set']('Content-Range',_0x5d474d+'-'+_0x5cfd93+'/'+_0xc023de)[_0xdceb('0x19')](_0x183eab);}return null;};}function patchUpdates(_0x1c30be){return function(_0x2e920b){try{jsonpatch[_0xdceb('0x1e')](_0x2e920b,_0x1c30be,!![]);}catch(_0x38c2f1){return BPromise['reject'](_0x38c2f1);}return _0x2e920b['save']();};}function saveUpdates(_0x2721f1,_0x19e3f7){return function(_0x3f5bd0){if(_0x3f5bd0){return _0x3f5bd0[_0xdceb('0x1f')](_0x2721f1)[_0xdceb('0x20')](function(_0x38f2f7){return _0x38f2f7;});}return null;};}function removeEntity(_0x1505e1,_0x2ab4e0){return function(_0xb8b419){if(_0xb8b419){return _0xb8b419[_0xdceb('0x21')]()[_0xdceb('0x20')](function(){_0x1505e1[_0xdceb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7869c,_0x225207){return function(_0x570248){if(!_0x570248){_0xa7869c[_0xdceb('0x22')](0x194);}return _0x570248;};}function handleError(_0x34da88,_0x2fce03){_0x2fce03=_0x2fce03||0x1f4;return function(_0x1ba5e0){logger[_0xdceb('0x23')](_0x1ba5e0[_0xdceb('0x24')]);if(_0x1ba5e0[_0xdceb('0x25')]){delete _0x1ba5e0['name'];}_0x34da88[_0xdceb('0x17')](_0x2fce03)['send'](_0x1ba5e0);};}exports[_0xdceb('0x26')]=function(_0x3577b2,_0x584f9a){var _0x48c737={},_0x19a2c4={},_0x239e1b={'count':0x0,'rows':[]};var _0x4acd2=_['map'](db[_0xdceb('0x27')][_0xdceb('0x28')],function(_0x1891e5){return{'name':_0x1891e5[_0xdceb('0x29')],'type':_0x1891e5['type']['key']};});_0x19a2c4[_0xdceb('0x2a')]=_[_0xdceb('0x2b')](_0x4acd2,_0xdceb('0x25'));_0x19a2c4[_0xdceb('0x2c')]=_[_0xdceb('0x2d')](_0x3577b2['query']);_0x19a2c4['filters']=_[_0xdceb('0x2e')](_0x19a2c4[_0xdceb('0x2a')],_0x19a2c4['query']);_0x48c737[_0xdceb('0x2f')]=_[_0xdceb('0x2e')](_0x19a2c4[_0xdceb('0x2a')],qs['fields'](_0x3577b2['query']['fields']));_0x48c737[_0xdceb('0x2f')]=_0x48c737[_0xdceb('0x2f')][_0xdceb('0x30')]?_0x48c737['attributes']:_0x19a2c4[_0xdceb('0x2a')];if(!_0x3577b2['query'][_0xdceb('0x31')](_0xdceb('0x32'))){_0x48c737['limit']=qs[_0xdceb('0x1b')](_0x3577b2['query'][_0xdceb('0x1b')]);_0x48c737[_0xdceb('0x1a')]=qs[_0xdceb('0x1a')](_0x3577b2[_0xdceb('0x2c')]['offset']);}_0x48c737['order']=qs[_0xdceb('0x33')](_0x3577b2[_0xdceb('0x2c')][_0xdceb('0x33')]);_0x48c737['where']=qs[_0xdceb('0x34')](_['pick'](_0x3577b2['query'],_0x19a2c4[_0xdceb('0x34')]),_0x4acd2);if(_0x3577b2['query'][_0xdceb('0x35')]){_0x48c737['where']=_[_0xdceb('0x36')](_0x48c737[_0xdceb('0x37')],{'$or':_['map'](_0x4acd2,function(_0x36534e){if(_0x36534e[_0xdceb('0x38')]!==_0xdceb('0x39')){var _0x1eaee8={};_0x1eaee8[_0x36534e[_0xdceb('0x25')]]={'$like':'%'+_0x3577b2[_0xdceb('0x2c')][_0xdceb('0x35')]+'%'};return _0x1eaee8;}})});}_0x48c737=_[_0xdceb('0x36')]({},_0x48c737,_0x3577b2[_0xdceb('0x3a')]);var _0x36644e={'where':_0x48c737['where']};return db[_0xdceb('0x27')][_0xdceb('0x1d')](_0x36644e)[_0xdceb('0x20')](function(_0x34df7e){_0x239e1b[_0xdceb('0x1d')]=_0x34df7e;if(_0x3577b2[_0xdceb('0x2c')][_0xdceb('0x3b')]){_0x48c737[_0xdceb('0x3c')]=[{'all':!![]}];}return db[_0xdceb('0x27')]['findAll'](_0x48c737);})[_0xdceb('0x20')](function(_0x524e10){_0x239e1b[_0xdceb('0x3d')]=_0x524e10;return _0x239e1b;})[_0xdceb('0x20')](respondWithFilteredResult(_0x584f9a,_0x48c737))[_0xdceb('0x3e')](handleError(_0x584f9a,null));};exports[_0xdceb('0x3f')]=function(_0x37b2cf,_0x2cd713){var _0xa7260b={'raw':!![],'where':{'id':_0x37b2cf[_0xdceb('0x40')]['id']}},_0x522ba4={};_0x522ba4[_0xdceb('0x2a')]=_[_0xdceb('0x2d')](db[_0xdceb('0x27')][_0xdceb('0x28')]);_0x522ba4[_0xdceb('0x2c')]=_[_0xdceb('0x2d')](_0x37b2cf['query']);_0x522ba4['filters']=_[_0xdceb('0x2e')](_0x522ba4[_0xdceb('0x2a')],_0x522ba4['query']);_0xa7260b['attributes']=_[_0xdceb('0x2e')](_0x522ba4[_0xdceb('0x2a')],qs['fields'](_0x37b2cf[_0xdceb('0x2c')][_0xdceb('0x41')]));_0xa7260b[_0xdceb('0x2f')]=_0xa7260b[_0xdceb('0x2f')][_0xdceb('0x30')]?_0xa7260b[_0xdceb('0x2f')]:_0x522ba4[_0xdceb('0x2a')];if(_0x37b2cf['query'][_0xdceb('0x3b')]){_0xa7260b['include']=[{'all':!![]}];}_0xa7260b=_[_0xdceb('0x36')]({},_0xa7260b,_0x37b2cf[_0xdceb('0x3a')]);return db[_0xdceb('0x27')][_0xdceb('0x42')](_0xa7260b)[_0xdceb('0x20')](handleEntityNotFound(_0x2cd713,null))['then'](respondWithResult(_0x2cd713,null))[_0xdceb('0x3e')](handleError(_0x2cd713,null));};exports[_0xdceb('0x43')]=function(_0x5dfd05,_0x3bd8a0){return db[_0xdceb('0x27')][_0xdceb('0x43')](_0x5dfd05[_0xdceb('0x44')],{})[_0xdceb('0x20')](respondWithResult(_0x3bd8a0,0xc9))['catch'](handleError(_0x3bd8a0,null));};exports[_0xdceb('0x1f')]=function(_0x4da6c9,_0x12fc31){if(_0x4da6c9['body']['id']){delete _0x4da6c9['body']['id'];}return db[_0xdceb('0x27')][_0xdceb('0x42')]({'where':{'id':_0x4da6c9[_0xdceb('0x40')]['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x12fc31,null))['then'](saveUpdates(_0x4da6c9[_0xdceb('0x44')],null))['then'](respondWithResult(_0x12fc31,null))[_0xdceb('0x3e')](handleError(_0x12fc31,null));};exports['destroy']=function(_0x48e248,_0x1d8449){return db[_0xdceb('0x27')][_0xdceb('0x42')]({'where':{'id':_0x48e248[_0xdceb('0x40')]['id']}})[_0xdceb('0x20')](handleEntityNotFound(_0x1d8449,null))[_0xdceb('0x20')](removeEntity(_0x1d8449,null))[_0xdceb('0x3e')](handleError(_0x1d8449,null));};exports[_0xdceb('0x45')]=function(_0x25be7c,_0x1545c0){return db[_0xdceb('0x27')]['describe']()['then'](respondWithResult(_0x1545c0,null))['catch'](handleError(_0x1545c0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b545cd7..1271112 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 _0xc5de=['path','exports','JscriptyQuestionReport','../../config/logger','api','request-promise'];(function(_0x33269e,_0x1673cf){var _0x94636d=function(_0x1e6c58){while(--_0x1e6c58){_0x33269e['push'](_0x33269e['shift']());}};_0x94636d(++_0x1673cf);}(_0xc5de,0x117));var _0xec5d=function(_0x591565,_0x5371f8){_0x591565=_0x591565-0x0;var _0x17666b=_0xc5de[_0x591565];return _0x17666b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xec5d('0x0'))(_0xec5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xec5d('0x2'));var fs=require('fs');var path=require(_0xec5d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xec5d('0x4')]=function(_0x1f1b8d,_0x4dea6a){return _0x1f1b8d['define'](_0xec5d('0x5'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddc2=['./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x597470,_0x13efe2){var _0x26303e=function(_0x36961){while(--_0x36961){_0x597470['push'](_0x597470['shift']());}};_0x26303e(++_0x13efe2);}(_0xddc2,0xbf));var _0x2ddc=function(_0x975f0e,_0xefe292){_0x975f0e=_0x975f0e-0x0;var _0xe386a0=_0xddc2[_0x975f0e];return _0xe386a0;};'use strict';var _=require('lodash');var util=require(_0x2ddc('0x0'));var logger=require(_0x2ddc('0x1'))('api');var moment=require(_0x2ddc('0x2'));var BPromise=require(_0x2ddc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ddc('0x4'));var rimraf=require(_0x2ddc('0x5'));var config=require(_0x2ddc('0x6'));var attributes=require(_0x2ddc('0x7'));module[_0x2ddc('0x8')]=function(_0x234091,_0x43ec38){return _0x234091[_0x2ddc('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x2ddc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 9884539..7860d76 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 _0xb91e=['http','request','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb91e,0x83));var _0xeb91=function(_0x49fb1d,_0x2f6091){_0x49fb1d=_0x49fb1d-0x0;var _0x165377=_0xb91e[_0x49fb1d];return _0x165377;};'use strict';var _=require('lodash');var util=require(_0xeb91('0x0'));var moment=require(_0xeb91('0x1'));var BPromise=require(_0xeb91('0x2'));var rs=require(_0xeb91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb91('0x4'))['db'];var utils=require(_0xeb91('0x5'));var logger=require('../../config/logger')(_0xeb91('0x6'));var config=require(_0xeb91('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb91('0x8')][_0xeb91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57aab2,_0x358071,_0x578ad3){return new BPromise(function(_0x20888f,_0x15d793){return client[_0xeb91('0xa')](_0x57aab2,_0x578ad3)['then'](function(_0x44e04c){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x358071,'request\x20sent');logger['debug'](_0xeb91('0xb'),_0x358071,_0xeb91('0xc'),JSON['stringify'](_0x44e04c));if(_0x44e04c[_0xeb91('0xd')]){if(_0x44e04c[_0xeb91('0xd')][_0xeb91('0xe')]===0x1f4){logger[_0xeb91('0xd')](_0xeb91('0xf'),_0x358071,_0x44e04c[_0xeb91('0xd')]['message']);return _0x15d793(_0x44e04c[_0xeb91('0xd')][_0xeb91('0x10')]);}logger['error'](_0xeb91('0xf'),_0x358071,_0x44e04c[_0xeb91('0xd')][_0xeb91('0x10')]);return _0x20888f(_0x44e04c[_0xeb91('0xd')][_0xeb91('0x10')]);}else{logger[_0xeb91('0x11')](_0xeb91('0xf'),_0x358071,_0xeb91('0xc'));_0x20888f(_0x44e04c[_0xeb91('0x12')][_0xeb91('0x10')]);}})[_0xeb91('0x13')](function(_0x1dda17){logger[_0xeb91('0xd')](_0xeb91('0xf'),_0x358071,_0x1dda17);_0x15d793(_0x1dda17);});});} \ No newline at end of file +var _0xd844=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x9aa545,_0x1d5ff1){var _0x5ab8bb=function(_0x54cb9d){while(--_0x54cb9d){_0x9aa545['push'](_0x9aa545['shift']());}};_0x5ab8bb(++_0x1d5ff1);}(_0xd844,0x67));var _0x4d84=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd844[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x4d84('0x0'));var moment=require(_0x4d84('0x1'));var BPromise=require(_0x4d84('0x2'));var rs=require(_0x4d84('0x3'));var fs=require('fs');var Redis=require(_0x4d84('0x4'));var db=require(_0x4d84('0x5'))['db'];var utils=require(_0x4d84('0x6'));var logger=require(_0x4d84('0x7'))(_0x4d84('0x8'));var config=require(_0x4d84('0x9'));var jayson=require(_0x4d84('0xa'));var client=jayson[_0x4d84('0xb')][_0x4d84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x192992,_0x2b7c45,_0x45f73d){return new BPromise(function(_0x3aa143,_0x15db00){return client[_0x4d84('0xd')](_0x192992,_0x45f73d)['then'](function(_0x2042b6){logger[_0x4d84('0xe')](_0x4d84('0xf'),_0x2b7c45,_0x4d84('0x10'));logger[_0x4d84('0x11')](_0x4d84('0x12'),_0x2b7c45,_0x4d84('0x10'),JSON[_0x4d84('0x13')](_0x2042b6));if(_0x2042b6[_0x4d84('0x14')]){if(_0x2042b6[_0x4d84('0x14')][_0x4d84('0x15')]===0x1f4){logger['error'](_0x4d84('0xf'),_0x2b7c45,_0x2042b6[_0x4d84('0x14')]['message']);return _0x15db00(_0x2042b6[_0x4d84('0x14')][_0x4d84('0x16')]);}logger[_0x4d84('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2b7c45,_0x2042b6[_0x4d84('0x14')]['message']);return _0x3aa143(_0x2042b6[_0x4d84('0x14')][_0x4d84('0x16')]);}else{logger['info'](_0x4d84('0xf'),_0x2b7c45,_0x4d84('0x10'));_0x3aa143(_0x2042b6[_0x4d84('0x17')][_0x4d84('0x16')]);}})[_0x4d84('0x18')](function(_0x1e36f9){logger[_0x4d84('0x14')](_0x4d84('0xf'),_0x2b7c45,_0x1e36f9);_0x15db00(_0x1e36f9);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a88e77d..7a1cc7d 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 _0x2efb=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post'];(function(_0x151b71,_0x50f248){var _0x4c1b4a=function(_0x3837cc){while(--_0x3837cc){_0x151b71['push'](_0x151b71['shift']());}};_0x4c1b4a(++_0x50f248);}(_0x2efb,0x1e9));var _0xb2ef=function(_0x2a6d8c,_0x19c800){_0x2a6d8c=_0x2a6d8c-0x0;var _0x31a401=_0x2efb[_0x2a6d8c];return _0x31a401;};'use strict';var multer=require('multer');var util=require(_0xb2ef('0x0'));var path=require(_0xb2ef('0x1'));var timeout=require(_0xb2ef('0x2'));var express=require(_0xb2ef('0x3'));var router=express[_0xb2ef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb2ef('0x5'));var config=require('../../config/environment');var controller=require(_0xb2ef('0x6'));router[_0xb2ef('0x7')]('/',auth[_0xb2ef('0x8')](),controller[_0xb2ef('0x9')]);router[_0xb2ef('0x7')](_0xb2ef('0xa'),auth[_0xb2ef('0x8')](),controller[_0xb2ef('0xb')]);router['get'](_0xb2ef('0xc'),auth[_0xb2ef('0x8')](),controller[_0xb2ef('0xd')]);router[_0xb2ef('0x7')](_0xb2ef('0xe'),auth[_0xb2ef('0x8')](),controller[_0xb2ef('0xf')]);router[_0xb2ef('0x10')]('/',auth[_0xb2ef('0x8')](),controller[_0xb2ef('0x11')]);router[_0xb2ef('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb2ef('0x13')]);router['delete'](_0xb2ef('0xc'),auth['isAuthenticated'](),controller[_0xb2ef('0x14')]);module[_0xb2ef('0x15')]=router; \ No newline at end of file +var _0x9460=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','get','/:id','show','create','put','update','delete','destroy','multer','connect-timeout','fs-extra'];(function(_0x9ded2d,_0xfe7f2e){var _0x59cfc6=function(_0x349a15){while(--_0x349a15){_0x9ded2d['push'](_0x9ded2d['shift']());}};_0x59cfc6(++_0xfe7f2e);}(_0x9460,0xbd));var _0x0946=function(_0x513952,_0x23598e){_0x513952=_0x513952-0x0;var _0x2d4b25=_0x9460[_0x513952];return _0x2d4b25;};'use strict';var multer=require(_0x0946('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0946('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0946('0x2'));var auth=require(_0x0946('0x3'));var interaction=require(_0x0946('0x4'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x0946('0x5')](),controller[_0x0946('0x6')]);router['get'](_0x0946('0x7'),auth[_0x0946('0x5')](),controller['describe']);router[_0x0946('0x8')](_0x0946('0x9'),auth[_0x0946('0x5')](),controller[_0x0946('0xa')]);router[_0x0946('0x8')]('/:id/questions',auth[_0x0946('0x5')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0946('0xb')]);router[_0x0946('0xc')](_0x0946('0x9'),auth[_0x0946('0x5')](),controller[_0x0946('0xd')]);router[_0x0946('0xe')](_0x0946('0x9'),auth[_0x0946('0x5')](),controller[_0x0946('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d490f00..f7c8c1a 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 _0x6c88=['endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','sequelize','setDataValue','starttime'];(function(_0x49f510,_0x5e832a){var _0x26dc76=function(_0xaf7484){while(--_0xaf7484){_0x49f510['push'](_0x49f510['shift']());}};_0x26dc76(++_0x5e832a);}(_0x6c88,0x11d));var _0x86c8=function(_0x515f78,_0x3b69be){_0x515f78=_0x515f78-0x0;var _0x506f6c=_0x6c88[_0x515f78];return _0x506f6c;};'use strict';var moment=require('moment');var Sequelize=require(_0x86c8('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1298a4){this[_0x86c8('0x1')](_0x86c8('0x2'),_0x1298a4);this['setDataValue'](_0x86c8('0x3'),moment()['format'](_0x86c8('0x4')));}},'endtime':{'type':Sequelize[_0x86c8('0x5')]},'membername':{'type':Sequelize[_0x86c8('0x6')]},'projectname':{'type':Sequelize[_0x86c8('0x6')]},'queue':{'type':Sequelize[_0x86c8('0x6')]},'uniqueid':{'type':Sequelize[_0x86c8('0x6')]},'calleridname':{'type':Sequelize[_0x86c8('0x6')]},'calleridnum':{'type':Sequelize[_0x86c8('0x6')]},'completed':{'type':Sequelize[_0x86c8('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xa12e=['STRING','BOOLEAN','moment','sequelize','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x3e72da,_0x7909e3){var _0x20a27d=function(_0x2ce453){while(--_0x2ce453){_0x3e72da['push'](_0x3e72da['shift']());}};_0x20a27d(++_0x7909e3);}(_0xa12e,0x138));var _0xea12=function(_0x561467,_0x4e72f3){_0x561467=_0x561467-0x0;var _0x3ea7eb=_0xa12e[_0x561467];return _0x3ea7eb;};'use strict';var moment=require(_0xea12('0x0'));var Sequelize=require(_0xea12('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5dc609){this[_0xea12('0x2')](_0xea12('0x3'),_0x5dc609);this['setDataValue'](_0xea12('0x4'),moment()[_0xea12('0x5')](_0xea12('0x6')));}},'endtime':{'type':Sequelize[_0xea12('0x7')]},'membername':{'type':Sequelize[_0xea12('0x8')]},'projectname':{'type':Sequelize[_0xea12('0x8')]},'queue':{'type':Sequelize[_0xea12('0x8')]},'uniqueid':{'type':Sequelize[_0xea12('0x8')]},'calleridname':{'type':Sequelize[_0xea12('0x8')]},'calleridnum':{'type':Sequelize[_0xea12('0x8')]},'completed':{'type':Sequelize[_0xea12('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index e99d131..0946e9c 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 _0x89d2=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','limit','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','JscriptySessionReport','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x576351,_0x3db7d0){var _0x12972e=function(_0x420cb1){while(--_0x420cb1){_0x576351['push'](_0x576351['shift']());}};_0x12972e(++_0x3db7d0);}(_0x89d2,0x90));var _0x289d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x89d2[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0x289d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x289d('0x1'));var rp=require(_0x289d('0x2'));var moment=require(_0x289d('0x3'));var BPromise=require(_0x289d('0x4'));var Mustache=require(_0x289d('0x5'));var util=require('util');var path=require(_0x289d('0x6'));var sox=require(_0x289d('0x7'));var csv=require(_0x289d('0x8'));var ejs=require(_0x289d('0x9'));var fs=require('fs');var fs_extra=require(_0x289d('0xa'));var _=require('lodash');var squel=require(_0x289d('0xb'));var crypto=require(_0x289d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x289d('0xd'));var toCsv=require(_0x289d('0x8'));var querystring=require(_0x289d('0xe'));var Papa=require(_0x289d('0xf'));var Redis=require('ioredis');var authService=require(_0x289d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x289d('0x11'));var hardwareService=require(_0x289d('0x12'));var logger=require(_0x289d('0x13'))('api');var utils=require(_0x289d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x289d('0x15'))['db'];function respondWithStatusCode(_0x498c91,_0x3217b9){_0x3217b9=_0x3217b9||0xcc;return function(_0x41acd1){if(_0x41acd1){return _0x498c91['sendStatus'](_0x3217b9);}return _0x498c91['status'](_0x3217b9)[_0x289d('0x16')]();};}function respondWithResult(_0x3d5f09,_0x5c0b80){_0x5c0b80=_0x5c0b80||0xc8;return function(_0x5c64d6){if(_0x5c64d6){return _0x3d5f09['status'](_0x5c0b80)['json'](_0x5c64d6);}};}function respondWithFilteredResult(_0x5835bb,_0x2a9b18){return function(_0x390966){if(_0x390966){var _0x283899=typeof _0x2a9b18['offset']==='undefined'&&typeof _0x2a9b18[_0x289d('0x17')]==='undefined';var _0x33c78b=_0x390966['count'];var _0x1b40d1=_0x283899?0x0:_0x2a9b18[_0x289d('0x18')];var _0x4bc890=_0x283899?_0x390966['count']:_0x2a9b18[_0x289d('0x18')]+_0x2a9b18['limit'];var _0x505dc0;if(_0x4bc890>=_0x33c78b){_0x4bc890=_0x33c78b;_0x505dc0=0xc8;}else{_0x505dc0=0xce;}_0x5835bb[_0x289d('0x19')](_0x505dc0);return _0x5835bb[_0x289d('0x1a')](_0x289d('0x1b'),_0x1b40d1+'-'+_0x4bc890+'/'+_0x33c78b)[_0x289d('0x1c')](_0x390966);}return null;};}function patchUpdates(_0x2d4f44){return function(_0x6a5f48){try{jsonpatch[_0x289d('0x1d')](_0x6a5f48,_0x2d4f44,!![]);}catch(_0x562023){return BPromise[_0x289d('0x1e')](_0x562023);}return _0x6a5f48[_0x289d('0x1f')]();};}function saveUpdates(_0x58ac25,_0x42fe2b){return function(_0xd1beb9){if(_0xd1beb9){return _0xd1beb9[_0x289d('0x20')](_0x58ac25)[_0x289d('0x21')](function(_0x9771af){return _0x9771af;});}return null;};}function removeEntity(_0x47f8cd,_0x359c60){return function(_0x3aaf46){if(_0x3aaf46){return _0x3aaf46[_0x289d('0x22')]()[_0x289d('0x21')](function(){_0x47f8cd['status'](0xcc)[_0x289d('0x16')]();});}};}function handleEntityNotFound(_0x3bfbac,_0x1a9b30){return function(_0x35bffa){if(!_0x35bffa){_0x3bfbac[_0x289d('0x23')](0x194);}return _0x35bffa;};}function handleError(_0x18b1be,_0x852f56){_0x852f56=_0x852f56||0x1f4;return function(_0x7aac48){logger[_0x289d('0x24')](_0x7aac48[_0x289d('0x25')]);if(_0x7aac48['name']){delete _0x7aac48['name'];}_0x18b1be['status'](_0x852f56)[_0x289d('0x26')](_0x7aac48);};}exports[_0x289d('0x27')]=function(_0x3d7b51,_0x5344d6){var _0x4d150e={},_0x3cbb8b={},_0x59ca84={'count':0x0,'rows':[]};var _0x554a27=_[_0x289d('0x28')](db[_0x289d('0x29')]['rawAttributes'],function(_0xfa3bb1){return{'name':_0xfa3bb1['fieldName'],'type':_0xfa3bb1[_0x289d('0x2a')][_0x289d('0x2b')]};});_0x3cbb8b[_0x289d('0x2c')]=_[_0x289d('0x28')](_0x554a27,_0x289d('0x2d'));_0x3cbb8b[_0x289d('0x2e')]=_[_0x289d('0x2f')](_0x3d7b51[_0x289d('0x2e')]);_0x3cbb8b['filters']=_[_0x289d('0x30')](_0x3cbb8b[_0x289d('0x2c')],_0x3cbb8b[_0x289d('0x2e')]);_0x4d150e[_0x289d('0x31')]=_[_0x289d('0x30')](_0x3cbb8b[_0x289d('0x2c')],qs[_0x289d('0x32')](_0x3d7b51[_0x289d('0x2e')][_0x289d('0x32')]));_0x4d150e[_0x289d('0x31')]=_0x4d150e[_0x289d('0x31')][_0x289d('0x33')]?_0x4d150e[_0x289d('0x31')]:_0x3cbb8b[_0x289d('0x2c')];if(!_0x3d7b51[_0x289d('0x2e')][_0x289d('0x34')]('nolimit')){_0x4d150e['limit']=qs[_0x289d('0x17')](_0x3d7b51['query']['limit']);_0x4d150e[_0x289d('0x18')]=qs[_0x289d('0x18')](_0x3d7b51[_0x289d('0x2e')][_0x289d('0x18')]);}_0x4d150e[_0x289d('0x35')]=qs[_0x289d('0x36')](_0x3d7b51[_0x289d('0x2e')][_0x289d('0x36')]);_0x4d150e[_0x289d('0x37')]=qs['filters'](_[_0x289d('0x38')](_0x3d7b51[_0x289d('0x2e')],_0x3cbb8b[_0x289d('0x39')]),_0x554a27);if(_0x3d7b51[_0x289d('0x2e')]['filter']){_0x4d150e[_0x289d('0x37')]=_['merge'](_0x4d150e['where'],{'$or':_[_0x289d('0x28')](_0x554a27,function(_0x57de84){if(_0x57de84[_0x289d('0x2a')]!=='VIRTUAL'){var _0x3bec70={};_0x3bec70[_0x57de84[_0x289d('0x2d')]]={'$like':'%'+_0x3d7b51['query'][_0x289d('0x3a')]+'%'};return _0x3bec70;}})});}_0x4d150e=_[_0x289d('0x3b')]({},_0x4d150e,_0x3d7b51[_0x289d('0x3c')]);var _0x42a049={'where':_0x4d150e[_0x289d('0x37')]};return db[_0x289d('0x29')]['count'](_0x42a049)[_0x289d('0x21')](function(_0x32fbdc){_0x59ca84[_0x289d('0x3d')]=_0x32fbdc;if(_0x3d7b51[_0x289d('0x2e')][_0x289d('0x3e')]){_0x4d150e[_0x289d('0x3f')]=[{'all':!![]}];}return db[_0x289d('0x29')][_0x289d('0x40')](_0x4d150e);})[_0x289d('0x21')](function(_0x39eb08){_0x59ca84[_0x289d('0x41')]=_0x39eb08;return _0x59ca84;})[_0x289d('0x21')](respondWithFilteredResult(_0x5344d6,_0x4d150e))[_0x289d('0x42')](handleError(_0x5344d6,null));};exports[_0x289d('0x43')]=function(_0x15b963,_0x1dcdbb){var _0x43b3a0={'raw':!![],'where':{'id':_0x15b963[_0x289d('0x44')]['id']}},_0x23081d={};_0x23081d[_0x289d('0x2c')]=_[_0x289d('0x2f')](db[_0x289d('0x29')][_0x289d('0x45')]);_0x23081d[_0x289d('0x2e')]=_['keys'](_0x15b963[_0x289d('0x2e')]);_0x23081d[_0x289d('0x39')]=_[_0x289d('0x30')](_0x23081d[_0x289d('0x2c')],_0x23081d[_0x289d('0x2e')]);_0x43b3a0[_0x289d('0x31')]=_[_0x289d('0x30')](_0x23081d[_0x289d('0x2c')],qs[_0x289d('0x32')](_0x15b963[_0x289d('0x2e')][_0x289d('0x32')]));_0x43b3a0[_0x289d('0x31')]=_0x43b3a0[_0x289d('0x31')][_0x289d('0x33')]?_0x43b3a0['attributes']:_0x23081d[_0x289d('0x2c')];if(_0x15b963[_0x289d('0x2e')]['includeAll']){_0x43b3a0[_0x289d('0x3f')]=[{'all':!![]}];}_0x43b3a0=_[_0x289d('0x3b')]({},_0x43b3a0,_0x15b963[_0x289d('0x3c')]);return db['JscriptySessionReport'][_0x289d('0x46')](_0x43b3a0)[_0x289d('0x21')](handleEntityNotFound(_0x1dcdbb,null))[_0x289d('0x21')](respondWithResult(_0x1dcdbb,null))[_0x289d('0x42')](handleError(_0x1dcdbb,null));};exports[_0x289d('0x47')]=function(_0x14a5d1,_0x26dcd2){return db[_0x289d('0x29')][_0x289d('0x47')](_0x14a5d1['body'],{})[_0x289d('0x21')](respondWithResult(_0x26dcd2,0xc9))[_0x289d('0x42')](handleError(_0x26dcd2,null));};exports[_0x289d('0x20')]=function(_0x35212,_0x4b1512){if(_0x35212[_0x289d('0x48')]['id']){delete _0x35212[_0x289d('0x48')]['id'];}return db[_0x289d('0x29')][_0x289d('0x46')]({'where':{'id':_0x35212[_0x289d('0x44')]['id']}})[_0x289d('0x21')](handleEntityNotFound(_0x4b1512,null))[_0x289d('0x21')](saveUpdates(_0x35212[_0x289d('0x48')],null))['then'](respondWithResult(_0x4b1512,null))[_0x289d('0x42')](handleError(_0x4b1512,null));};exports['destroy']=function(_0x349680,_0x5b598f){return db['JscriptySessionReport'][_0x289d('0x46')]({'where':{'id':_0x349680[_0x289d('0x44')]['id']}})[_0x289d('0x21')](handleEntityNotFound(_0x5b598f,null))[_0x289d('0x21')](removeEntity(_0x5b598f,null))[_0x289d('0x42')](handleError(_0x5b598f,null));};exports['describe']=function(_0x24f8d2,_0x3bd5c7){return db[_0x289d('0x29')][_0x289d('0x49')]()['then'](respondWithResult(_0x3bd5c7,null))[_0x289d('0x42')](handleError(_0x3bd5c7,null));};exports[_0x289d('0x4a')]=function(_0x46600a,_0xf3f087,_0x2c2a79){var _0x339ca1={'raw':!![],'where':{}};var _0xe59ad7={};var _0x34224b={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x289d('0x4b')]({'where':{'id':_0x46600a[_0x289d('0x44')]['id']}})[_0x289d('0x21')](handleEntityNotFound(_0xf3f087,null))['then'](function(_0x86d6d8){if(_0x86d6d8){_0xe59ad7[_0x289d('0x2c')]=_[_0x289d('0x2f')](db[_0x289d('0x4c')][_0x289d('0x45')]);_0xe59ad7[_0x289d('0x2e')]=_[_0x289d('0x2f')](_0x46600a[_0x289d('0x2e')]);_0xe59ad7[_0x289d('0x39')]=_['intersection'](_0xe59ad7[_0x289d('0x2c')],_0xe59ad7[_0x289d('0x2e')]);_0x339ca1['attributes']=_[_0x289d('0x30')](_0xe59ad7[_0x289d('0x2c')],qs[_0x289d('0x32')](_0x46600a[_0x289d('0x2e')][_0x289d('0x32')]));_0x339ca1['attributes']=_0x339ca1[_0x289d('0x31')][_0x289d('0x33')]?_0x339ca1[_0x289d('0x31')]:_0xe59ad7['model'];if(!_0x46600a[_0x289d('0x2e')][_0x289d('0x34')](_0x289d('0x4d'))){_0x339ca1['limit']=qs[_0x289d('0x17')](_0x46600a[_0x289d('0x2e')]['limit']);_0x339ca1['offset']=qs[_0x289d('0x18')](_0x46600a[_0x289d('0x2e')][_0x289d('0x18')]);}_0x339ca1['order']=qs[_0x289d('0x36')](_0x46600a[_0x289d('0x2e')][_0x289d('0x36')]);_0x339ca1[_0x289d('0x37')]=qs['filters'](_[_0x289d('0x38')](_0x46600a['query'],_0xe59ad7[_0x289d('0x39')]));_0x339ca1['where']['SessionId']=_0x86d6d8['id'];if(_0x46600a[_0x289d('0x2e')][_0x289d('0x3a')]){_0x339ca1[_0x289d('0x37')]=_['merge'](_0x339ca1[_0x289d('0x37')],{'$or':_[_0x289d('0x28')](_0x339ca1[_0x289d('0x31')],function(_0x19f725){var _0x331488={};_0x331488[_0x19f725]={'$like':'%'+_0x46600a[_0x289d('0x2e')]['filter']+'%'};return _0x331488;})});}_0x339ca1=_[_0x289d('0x3b')]({},_0x339ca1,_0x46600a['options']);return db[_0x289d('0x4c')][_0x289d('0x3d')]({'where':_0x339ca1[_0x289d('0x37')]})['then'](function(_0xaf624f){_0x34224b['count']=_0xaf624f;if(_0x46600a[_0x289d('0x2e')][_0x289d('0x3e')]){_0x339ca1[_0x289d('0x3f')]=[{'all':!![]}];}return db[_0x289d('0x4c')][_0x289d('0x40')](_0x339ca1);})[_0x289d('0x21')](function(_0x52d41a){_0x34224b['rows']=_0x52d41a;return _0x34224b;});}})[_0x289d('0x21')](respondWithFilteredResult(_0xf3f087,_0x339ca1))[_0x289d('0x42')](handleError(_0xf3f087,null));}; \ No newline at end of file +var _0x3c36=['query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','options','JscriptySessionReport','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','order','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0x3c36,0xc3));var _0x63c3=function(_0x39eb23,_0xf7c0cc){_0x39eb23=_0x39eb23-0x0;var _0x4c3768=_0x3c36[_0x39eb23];return _0x4c3768;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63c3('0x0'));var zipdir=require(_0x63c3('0x1'));var jsonpatch=require(_0x63c3('0x2'));var rp=require(_0x63c3('0x3'));var moment=require(_0x63c3('0x4'));var BPromise=require(_0x63c3('0x5'));var Mustache=require('mustache');var util=require(_0x63c3('0x6'));var path=require(_0x63c3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63c3('0x8'));var fs=require('fs');var fs_extra=require(_0x63c3('0x9'));var _=require('lodash');var squel=require(_0x63c3('0xa'));var crypto=require(_0x63c3('0xb'));var jsforce=require(_0x63c3('0xc'));var deskjs=require(_0x63c3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63c3('0xe'));var Papa=require(_0x63c3('0xf'));var Redis=require(_0x63c3('0x10'));var authService=require(_0x63c3('0x11'));var qs=require(_0x63c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x63c3('0x13'))(_0x63c3('0x14'));var utils=require(_0x63c3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x63c3('0x16'));var db=require(_0x63c3('0x17'))['db'];function respondWithStatusCode(_0x45ed2c,_0x5f1c5b){_0x5f1c5b=_0x5f1c5b||0xcc;return function(_0x1cddf1){if(_0x1cddf1){return _0x45ed2c[_0x63c3('0x18')](_0x5f1c5b);}return _0x45ed2c[_0x63c3('0x19')](_0x5f1c5b)[_0x63c3('0x1a')]();};}function respondWithResult(_0x587a23,_0x284434){_0x284434=_0x284434||0xc8;return function(_0x7e908a){if(_0x7e908a){return _0x587a23[_0x63c3('0x19')](_0x284434)['json'](_0x7e908a);}};}function respondWithFilteredResult(_0x3885b5,_0xb24ec4){return function(_0x4d6bcf){if(_0x4d6bcf){var _0x1296d3=typeof _0xb24ec4['offset']==='undefined'&&typeof _0xb24ec4['limit']===_0x63c3('0x1b');var _0x5a0cd3=_0x4d6bcf[_0x63c3('0x1c')];var _0xec8e77=_0x1296d3?0x0:_0xb24ec4['offset'];var _0xf4b23f=_0x1296d3?_0x4d6bcf['count']:_0xb24ec4[_0x63c3('0x1d')]+_0xb24ec4['limit'];var _0x44dd18;if(_0xf4b23f>=_0x5a0cd3){_0xf4b23f=_0x5a0cd3;_0x44dd18=0xc8;}else{_0x44dd18=0xce;}_0x3885b5['status'](_0x44dd18);return _0x3885b5[_0x63c3('0x1e')](_0x63c3('0x1f'),_0xec8e77+'-'+_0xf4b23f+'/'+_0x5a0cd3)['json'](_0x4d6bcf);}return null;};}function patchUpdates(_0x5f13c9){return function(_0x1acfb9){try{jsonpatch[_0x63c3('0x20')](_0x1acfb9,_0x5f13c9,!![]);}catch(_0x1b8958){return BPromise[_0x63c3('0x21')](_0x1b8958);}return _0x1acfb9[_0x63c3('0x22')]();};}function saveUpdates(_0x113a1a,_0x1a1f58){return function(_0x4c8011){if(_0x4c8011){return _0x4c8011[_0x63c3('0x23')](_0x113a1a)['then'](function(_0x2cea6f){return _0x2cea6f;});}return null;};}function removeEntity(_0x5727ed,_0x2c4d6a){return function(_0x43b189){if(_0x43b189){return _0x43b189[_0x63c3('0x24')]()[_0x63c3('0x25')](function(){_0x5727ed[_0x63c3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e281,_0x3db3d5){return function(_0x27c3b2){if(!_0x27c3b2){_0x52e281[_0x63c3('0x18')](0x194);}return _0x27c3b2;};}function handleError(_0x32db65,_0x4e4eb3){_0x4e4eb3=_0x4e4eb3||0x1f4;return function(_0x474f3d){logger[_0x63c3('0x26')](_0x474f3d[_0x63c3('0x27')]);if(_0x474f3d[_0x63c3('0x28')]){delete _0x474f3d['name'];}_0x32db65[_0x63c3('0x19')](_0x4e4eb3)[_0x63c3('0x29')](_0x474f3d);};}exports['index']=function(_0x5d2c5e,_0x5048eb){var _0x364566={},_0x53e530={},_0x30081a={'count':0x0,'rows':[]};var _0x4303bf=_[_0x63c3('0x2a')](db['JscriptySessionReport'][_0x63c3('0x2b')],function(_0x303df8){return{'name':_0x303df8[_0x63c3('0x2c')],'type':_0x303df8['type'][_0x63c3('0x2d')]};});_0x53e530[_0x63c3('0x2e')]=_[_0x63c3('0x2a')](_0x4303bf,_0x63c3('0x28'));_0x53e530['query']=_[_0x63c3('0x2f')](_0x5d2c5e[_0x63c3('0x30')]);_0x53e530[_0x63c3('0x31')]=_[_0x63c3('0x32')](_0x53e530[_0x63c3('0x2e')],_0x53e530[_0x63c3('0x30')]);_0x364566[_0x63c3('0x33')]=_[_0x63c3('0x32')](_0x53e530['model'],qs[_0x63c3('0x34')](_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x34')]));_0x364566['attributes']=_0x364566[_0x63c3('0x33')][_0x63c3('0x35')]?_0x364566[_0x63c3('0x33')]:_0x53e530[_0x63c3('0x2e')];if(!_0x5d2c5e[_0x63c3('0x30')]['hasOwnProperty'](_0x63c3('0x36'))){_0x364566['limit']=qs[_0x63c3('0x37')](_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x37')]);_0x364566[_0x63c3('0x1d')]=qs[_0x63c3('0x1d')](_0x5d2c5e['query'][_0x63c3('0x1d')]);}_0x364566['order']=qs[_0x63c3('0x38')](_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x38')]);_0x364566[_0x63c3('0x39')]=qs[_0x63c3('0x31')](_[_0x63c3('0x3a')](_0x5d2c5e['query'],_0x53e530[_0x63c3('0x31')]),_0x4303bf);if(_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x3b')]){_0x364566['where']=_[_0x63c3('0x3c')](_0x364566[_0x63c3('0x39')],{'$or':_[_0x63c3('0x2a')](_0x4303bf,function(_0x3daf12){if(_0x3daf12[_0x63c3('0x3d')]!=='VIRTUAL'){var _0x10147e={};_0x10147e[_0x3daf12[_0x63c3('0x28')]]={'$like':'%'+_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x3b')]+'%'};return _0x10147e;}})});}_0x364566=_[_0x63c3('0x3c')]({},_0x364566,_0x5d2c5e[_0x63c3('0x3e')]);var _0x5ddd5a={'where':_0x364566[_0x63c3('0x39')]};return db[_0x63c3('0x3f')][_0x63c3('0x1c')](_0x5ddd5a)['then'](function(_0x40d24a){_0x30081a[_0x63c3('0x1c')]=_0x40d24a;if(_0x5d2c5e[_0x63c3('0x30')][_0x63c3('0x40')]){_0x364566[_0x63c3('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x63c3('0x42')](_0x364566);})[_0x63c3('0x25')](function(_0xa0fac5){_0x30081a[_0x63c3('0x43')]=_0xa0fac5;return _0x30081a;})[_0x63c3('0x25')](respondWithFilteredResult(_0x5048eb,_0x364566))['catch'](handleError(_0x5048eb,null));};exports[_0x63c3('0x44')]=function(_0x5db901,_0xdbbbe3){var _0x5021bb={'raw':!![],'where':{'id':_0x5db901['params']['id']}},_0x50c28c={};_0x50c28c['model']=_['keys'](db[_0x63c3('0x3f')]['rawAttributes']);_0x50c28c['query']=_[_0x63c3('0x2f')](_0x5db901['query']);_0x50c28c[_0x63c3('0x31')]=_[_0x63c3('0x32')](_0x50c28c[_0x63c3('0x2e')],_0x50c28c['query']);_0x5021bb['attributes']=_[_0x63c3('0x32')](_0x50c28c[_0x63c3('0x2e')],qs[_0x63c3('0x34')](_0x5db901[_0x63c3('0x30')][_0x63c3('0x34')]));_0x5021bb[_0x63c3('0x33')]=_0x5021bb[_0x63c3('0x33')]['length']?_0x5021bb[_0x63c3('0x33')]:_0x50c28c[_0x63c3('0x2e')];if(_0x5db901[_0x63c3('0x30')][_0x63c3('0x40')]){_0x5021bb[_0x63c3('0x41')]=[{'all':!![]}];}_0x5021bb=_[_0x63c3('0x3c')]({},_0x5021bb,_0x5db901['options']);return db[_0x63c3('0x3f')][_0x63c3('0x45')](_0x5021bb)['then'](handleEntityNotFound(_0xdbbbe3,null))[_0x63c3('0x25')](respondWithResult(_0xdbbbe3,null))[_0x63c3('0x46')](handleError(_0xdbbbe3,null));};exports[_0x63c3('0x47')]=function(_0x540802,_0x1f6637){return db[_0x63c3('0x3f')][_0x63c3('0x47')](_0x540802[_0x63c3('0x48')],{})[_0x63c3('0x25')](respondWithResult(_0x1f6637,0xc9))[_0x63c3('0x46')](handleError(_0x1f6637,null));};exports[_0x63c3('0x23')]=function(_0x35caf6,_0x5115e0){if(_0x35caf6[_0x63c3('0x48')]['id']){delete _0x35caf6['body']['id'];}return db[_0x63c3('0x3f')][_0x63c3('0x45')]({'where':{'id':_0x35caf6[_0x63c3('0x49')]['id']}})['then'](handleEntityNotFound(_0x5115e0,null))[_0x63c3('0x25')](saveUpdates(_0x35caf6[_0x63c3('0x48')],null))[_0x63c3('0x25')](respondWithResult(_0x5115e0,null))['catch'](handleError(_0x5115e0,null));};exports['destroy']=function(_0x3576b8,_0x463685){return db[_0x63c3('0x3f')][_0x63c3('0x45')]({'where':{'id':_0x3576b8['params']['id']}})['then'](handleEntityNotFound(_0x463685,null))['then'](removeEntity(_0x463685,null))['catch'](handleError(_0x463685,null));};exports[_0x63c3('0x4a')]=function(_0x5459ef,_0xc48956){return db[_0x63c3('0x3f')][_0x63c3('0x4a')]()['then'](respondWithResult(_0xc48956,null))[_0x63c3('0x46')](handleError(_0xc48956,null));};exports[_0x63c3('0x4b')]=function(_0x5f36b5,_0x2c3261,_0x529e09){var _0x3db909={'raw':!![],'where':{}};var _0x5ce4d6={};var _0x3dfe5f={'count':0x0,'rows':[]};return db[_0x63c3('0x3f')][_0x63c3('0x4c')]({'where':{'id':_0x5f36b5[_0x63c3('0x49')]['id']}})[_0x63c3('0x25')](handleEntityNotFound(_0x2c3261,null))[_0x63c3('0x25')](function(_0x182261){if(_0x182261){_0x5ce4d6[_0x63c3('0x2e')]=_[_0x63c3('0x2f')](db[_0x63c3('0x4d')]['rawAttributes']);_0x5ce4d6[_0x63c3('0x30')]=_[_0x63c3('0x2f')](_0x5f36b5[_0x63c3('0x30')]);_0x5ce4d6[_0x63c3('0x31')]=_[_0x63c3('0x32')](_0x5ce4d6[_0x63c3('0x2e')],_0x5ce4d6[_0x63c3('0x30')]);_0x3db909['attributes']=_[_0x63c3('0x32')](_0x5ce4d6[_0x63c3('0x2e')],qs['fields'](_0x5f36b5[_0x63c3('0x30')][_0x63c3('0x34')]));_0x3db909[_0x63c3('0x33')]=_0x3db909[_0x63c3('0x33')][_0x63c3('0x35')]?_0x3db909[_0x63c3('0x33')]:_0x5ce4d6['model'];if(!_0x5f36b5[_0x63c3('0x30')][_0x63c3('0x4e')](_0x63c3('0x36'))){_0x3db909['limit']=qs[_0x63c3('0x37')](_0x5f36b5[_0x63c3('0x30')]['limit']);_0x3db909['offset']=qs['offset'](_0x5f36b5[_0x63c3('0x30')][_0x63c3('0x1d')]);}_0x3db909[_0x63c3('0x4f')]=qs['sort'](_0x5f36b5['query'][_0x63c3('0x38')]);_0x3db909['where']=qs[_0x63c3('0x31')](_['pick'](_0x5f36b5['query'],_0x5ce4d6[_0x63c3('0x31')]));_0x3db909['where'][_0x63c3('0x50')]=_0x182261['id'];if(_0x5f36b5[_0x63c3('0x30')]['filter']){_0x3db909[_0x63c3('0x39')]=_[_0x63c3('0x3c')](_0x3db909[_0x63c3('0x39')],{'$or':_[_0x63c3('0x2a')](_0x3db909['attributes'],function(_0x52f1b1){var _0x5290c4={};_0x5290c4[_0x52f1b1]={'$like':'%'+_0x5f36b5['query'][_0x63c3('0x3b')]+'%'};return _0x5290c4;})});}_0x3db909=_['merge']({},_0x3db909,_0x5f36b5[_0x63c3('0x3e')]);return db[_0x63c3('0x4d')][_0x63c3('0x1c')]({'where':_0x3db909[_0x63c3('0x39')]})[_0x63c3('0x25')](function(_0x29ca63){_0x3dfe5f[_0x63c3('0x1c')]=_0x29ca63;if(_0x5f36b5[_0x63c3('0x30')][_0x63c3('0x40')]){_0x3db909[_0x63c3('0x41')]=[{'all':!![]}];}return db[_0x63c3('0x4d')][_0x63c3('0x42')](_0x3db909);})['then'](function(_0x4f8f91){_0x3dfe5f[_0x63c3('0x43')]=_0x4f8f91;return _0x3dfe5f;});}})[_0x63c3('0x25')](respondWithFilteredResult(_0x2c3261,_0x3db909))[_0x63c3('0x46')](handleError(_0x2c3261,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a87fb20..95c0427 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 _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc356b4,_0x5bd6ab){var _0x4fd6bf=function(_0x2d4f4c){while(--_0x2d4f4c){_0xc356b4['push'](_0xc356b4['shift']());}};_0x4fd6bf(++_0x5bd6ab);}(_0xaa3f,0xbb));var _0xfaa3=function(_0xc38d00,_0x3b59cf){_0xc38d00=_0xc38d00-0x0;var _0x5853d3=_0xaa3f[_0xc38d00];return _0x5853d3;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment'];(function(_0x8c628a,_0x5ceee9){var _0x4c0101=function(_0x4a7c4c){while(--_0x4a7c4c){_0x8c628a['push'](_0x8c628a['shift']());}};_0x4c0101(++_0x5ceee9);}(_0xe14b,0x93));var _0xbe14=function(_0x259530,_0x47d683){_0x259530=_0x259530-0x0;var _0x2fc4be=_0xe14b[_0x259530];return _0x2fc4be;};'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/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 802d465..f58f791 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 _0xf61e=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4cf6ed,_0x1e0fe8){var _0x30c45d=function(_0x3d1497){while(--_0x3d1497){_0x4cf6ed['push'](_0x4cf6ed['shift']());}};_0x30c45d(++_0x1e0fe8);}(_0xf61e,0x191));var _0xef61=function(_0x853f50,_0x439134){_0x853f50=_0x853f50-0x0;var _0x247b7a=_0xf61e[_0x853f50];return _0x247b7a;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x171fb6,_0x1116d6){var _0x2dda01=function(_0x517505){while(--_0x517505){_0x171fb6['push'](_0x171fb6['shift']());}};_0x2dda01(++_0x1116d6);}(_0x5fab,0x177));var _0xb5fa=function(_0x470d22,_0x1b6a4f){_0x470d22=_0x470d22-0x0;var _0x3cc44d=_0x5fab[_0x470d22];return _0x3cc44d;};'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']('JscriptySessionReport,\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')]('JscriptySessionReport,\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']('JscriptySessionReport,\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/license/index.js b/server/api/license/index.js index ba03b99..694ddbb 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 _0x95f4=['exports','multer','util','path','Router','fs-extra','../../config/environment','./license.controller','get','put','/:id','isAuthenticated'];(function(_0x4f0cb5,_0x4f6175){var _0x26f635=function(_0x31e05e){while(--_0x31e05e){_0x4f0cb5['push'](_0x4f0cb5['shift']());}};_0x26f635(++_0x4f6175);}(_0x95f4,0xf1));var _0x495f=function(_0x110437,_0x58f898){_0x110437=_0x110437-0x0;var _0x4d1bc0=_0x95f4[_0x110437];return _0x4d1bc0;};'use strict';var multer=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var path=require(_0x495f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x495f('0x3')]();var fs_extra=require(_0x495f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x495f('0x5'));var controller=require(_0x495f('0x6'));router[_0x495f('0x7')]('/',controller['index']);router[_0x495f('0x8')](_0x495f('0x9'),auth[_0x495f('0xa')](),controller['update']);module[_0x495f('0xb')]=router; \ No newline at end of file +var _0xaeef=['./license.controller','put','/:id','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26a3e5,_0x54d32b){var _0x792f65=function(_0x55efb4){while(--_0x55efb4){_0x26a3e5['push'](_0x26a3e5['shift']());}};_0x792f65(++_0x54d32b);}(_0xaeef,0x14a));var _0xfaee=function(_0x1d0df5,_0xd1aea5){_0x1d0df5=_0x1d0df5-0x0;var _0x4fb356=_0xaeef[_0x1d0df5];return _0x4fb356;};'use strict';var multer=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var path=require(_0xfaee('0x2'));var timeout=require('connect-timeout');var express=require(_0xfaee('0x3'));var router=express[_0xfaee('0x4')]();var fs_extra=require(_0xfaee('0x5'));var auth=require(_0xfaee('0x6'));var interaction=require(_0xfaee('0x7'));var config=require('../../config/environment');var controller=require(_0xfaee('0x8'));router['get']('/',controller['index']);router[_0xfaee('0x9')](_0xfaee('0xa'),auth['isAuthenticated'](),controller[_0xfaee('0xb')]);module[_0xfaee('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 76e5250..a33cc41 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 _0x2bd3=['INTEGER','sequelize','exports'];(function(_0x4b04ff,_0x45554f){var _0x549cea=function(_0x5edb7b){while(--_0x5edb7b){_0x4b04ff['push'](_0x4b04ff['shift']());}};_0x549cea(++_0x45554f);}(_0x2bd3,0x8b));var _0x32bd=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x2bd3[_0x5698a9];return _0x3be696;};'use strict';var Sequelize=require(_0x32bd('0x0'));module[_0x32bd('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x32bd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf5e4=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0xe0a478,_0x584736){var _0x24900b=function(_0x2cab19){while(--_0x2cab19){_0xe0a478['push'](_0xe0a478['shift']());}};_0x24900b(++_0x584736);}(_0xf5e4,0xed));var _0x4f5e=function(_0x4b84fd,_0x6ea9f8){_0x4b84fd=_0x4b84fd-0x0;var _0x431483=_0xf5e4[_0x4b84fd];return _0x431483;};'use strict';var Sequelize=require(_0x4f5e('0x0'));module[_0x4f5e('0x1')]={'license':{'type':Sequelize[_0x4f5e('0x2')]},'data1':{'type':Sequelize[_0x4f5e('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x4f5e('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 7f078b7..61c9eb0 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 _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0295,0x1f0));var _0x5029=function(_0x2f06b3,_0x12feb6){_0x2f06b3=_0x2f06b3-0x0;var _0x270d4d=_0x0295[_0x2f06b3];return _0x270d4d;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file +var _0x57ca=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','model','keys','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','get','checkLicense','key','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x108));var _0xa57c=function(_0x18f386,_0x48a562){_0x18f386=_0x18f386-0x0;var _0x331244=_0x57ca[_0x18f386];return _0x331244;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}var utilLicense=require(_0xa57c('0x15'));exports['index']=function(_0x54a18b,_0x257661){var _0x7d10ec={'raw':!![],'where':{'id':0x1}},_0x5a3e03={};_0x5a3e03[_0xa57c('0x28')]=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes']);_0x5a3e03[_0xa57c('0x2b')]=_['keys'](_0x54a18b[_0xa57c('0x2b')]);_0x5a3e03['filters']=_[_0xa57c('0x2c')](_0x5a3e03['model'],_0x5a3e03[_0xa57c('0x2b')]);_0x7d10ec['attributes']=_[_0xa57c('0x2c')](_0x5a3e03[_0xa57c('0x28')],qs[_0xa57c('0x2d')](_0x54a18b[_0xa57c('0x2b')][_0xa57c('0x2d')]));_0x7d10ec[_0xa57c('0x2e')]=_0x7d10ec[_0xa57c('0x2e')]['length']?_0x7d10ec[_0xa57c('0x2e')]:_0x5a3e03['model'];_0x7d10ec=_[_0xa57c('0x2f')]({},_0x7d10ec,_0x54a18b[_0xa57c('0x30')]);return utilLicense[_0xa57c('0x31')](_0x7d10ec)['then'](respondWithResult(_0x257661,null))[_0xa57c('0x32')](handleError(_0x257661,null));};exports['update']=function(_0x24a087,_0x501a4c){if(_0x24a087[_0xa57c('0x33')]['id']){delete _0x24a087['body']['id'];}return db[_0xa57c('0x2a')][_0xa57c('0x34')]({'where':{'id':_0x24a087['params']['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x501a4c,null))['then'](function(_0x1eeeb8){var _0x5c56d3=_0x1eeeb8[_0xa57c('0x35')]({'plain':!![]});return utilLicense[_0xa57c('0x36')](_0x5c56d3,_0x24a087[_0xa57c('0x33')][_0xa57c('0x37')]);})[_0xa57c('0x21')](function(_0x44350f){if(!_0x44350f['demo']){return saveUpdates(_0x24a087['body'],null);}return _0x44350f;})[_0xa57c('0x21')](respondWithResult(_0x501a4c,null))[_0xa57c('0x32')](handleError(_0x501a4c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 496c02a..c48444b 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 _0x8700=['bluebird','rimraf','./license.attributes','define','License','license','util','../../config/logger','moment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8700,0x165));var _0x0870=function(_0xbe9840,_0x53acf9){_0xbe9840=_0xbe9840-0x0;var _0x5c51de=_0x8700[_0xbe9840];return _0x5c51de;};'use strict';var _=require('lodash');var util=require(_0x0870('0x0'));var logger=require(_0x0870('0x1'))('api');var moment=require(_0x0870('0x2'));var BPromise=require(_0x0870('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0870('0x4'));var config=require('../../config/environment');var attributes=require(_0x0870('0x5'));module['exports']=function(_0x5697e2,_0x1d29b2){return _0x5697e2[_0x0870('0x6')](_0x0870('0x7'),attributes,{'tableName':_0x0870('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19bc=['rimraf','../../config/environment','./license.attributes','define','License','license','lodash','util','../../config/logger','api','moment','path'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x19bc,0x19e));var _0xc19b=function(_0x34bb93,_0x2398fd){_0x34bb93=_0x34bb93-0x0;var _0x23a5e2=_0x19bc[_0x34bb93];return _0x23a5e2;};'use strict';var _=require(_0xc19b('0x0'));var util=require(_0xc19b('0x1'));var logger=require(_0xc19b('0x2'))(_0xc19b('0x3'));var moment=require(_0xc19b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc19b('0x5'));var rimraf=require(_0xc19b('0x6'));var config=require(_0xc19b('0x7'));var attributes=require(_0xc19b('0x8'));module['exports']=function(_0x3f5767,_0x4a34e3){return _0x3f5767[_0xc19b('0x9')](_0xc19b('0xa'),attributes,{'tableName':_0xc19b('0xb'),'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 abf4153..8e8842c 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 _0x83fa=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x83fa,0xef));var _0xa83f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x83fa[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xa83f('0x0'));var util=require(_0xa83f('0x1'));var moment=require(_0xa83f('0x2'));var BPromise=require(_0xa83f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa83f('0x4'));var db=require(_0xa83f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa83f('0x6'));var config=require(_0xa83f('0x7'));var jayson=require(_0xa83f('0x8'));var client=jayson[_0xa83f('0x9')][_0xa83f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ff9be,_0x42fb64,_0x13c719){return new BPromise(function(_0x249c1d,_0x15fd0e){return client[_0xa83f('0xb')](_0x4ff9be,_0x13c719)[_0xa83f('0xc')](function(_0x3b95fa){logger['info'](_0xa83f('0xd'),_0x42fb64,_0xa83f('0xe'));logger[_0xa83f('0xf')](_0xa83f('0x10'),_0x42fb64,'request\x20sent',JSON['stringify'](_0x3b95fa));if(_0x3b95fa[_0xa83f('0x11')]){if(_0x3b95fa[_0xa83f('0x11')][_0xa83f('0x12')]===0x1f4){logger[_0xa83f('0x11')](_0xa83f('0xd'),_0x42fb64,_0x3b95fa[_0xa83f('0x11')][_0xa83f('0x13')]);return _0x15fd0e(_0x3b95fa[_0xa83f('0x11')][_0xa83f('0x13')]);}logger[_0xa83f('0x11')](_0xa83f('0xd'),_0x42fb64,_0x3b95fa[_0xa83f('0x11')][_0xa83f('0x13')]);return _0x249c1d(_0x3b95fa['error'][_0xa83f('0x13')]);}else{logger[_0xa83f('0x14')](_0xa83f('0xd'),_0x42fb64,_0xa83f('0xe'));_0x249c1d(_0x3b95fa[_0xa83f('0x15')]['message']);}})[_0xa83f('0x16')](function(_0x51d240){logger['error'](_0xa83f('0xd'),_0x42fb64,_0x51d240);_0x15fd0e(_0x51d240);});});} \ No newline at end of file +var _0x7740=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','stringify','code','error','License,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0x457c48,_0x5a7829){var _0x460e6d=function(_0x1a01de){while(--_0x1a01de){_0x457c48['push'](_0x457c48['shift']());}};_0x460e6d(++_0x5a7829);}(_0x7740,0x10d));var _0x0774=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x7740[_0x547456];return _0xc1fd7b;};'use strict';var _=require(_0x0774('0x0'));var util=require(_0x0774('0x1'));var moment=require('moment');var BPromise=require(_0x0774('0x2'));var rs=require(_0x0774('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0774('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0774('0x5'))(_0x0774('0x6'));var config=require(_0x0774('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0774('0x8')][_0x0774('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x370dc2,_0x55324b,_0x21e795){return new BPromise(function(_0x254b0a,_0x4d7e8f){return client[_0x0774('0xa')](_0x370dc2,_0x21e795)[_0x0774('0xb')](function(_0x4806e8){logger['info']('License,\x20%s,\x20%s',_0x55324b,'request\x20sent');logger[_0x0774('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x55324b,'request\x20sent',JSON[_0x0774('0xd')](_0x4806e8));if(_0x4806e8['error']){if(_0x4806e8['error'][_0x0774('0xe')]===0x1f4){logger[_0x0774('0xf')](_0x0774('0x10'),_0x55324b,_0x4806e8[_0x0774('0xf')][_0x0774('0x11')]);return _0x4d7e8f(_0x4806e8[_0x0774('0xf')][_0x0774('0x11')]);}logger[_0x0774('0xf')](_0x0774('0x10'),_0x55324b,_0x4806e8[_0x0774('0xf')][_0x0774('0x11')]);return _0x254b0a(_0x4806e8['error'][_0x0774('0x11')]);}else{logger[_0x0774('0x12')]('License,\x20%s,\x20%s',_0x55324b,_0x0774('0x13'));_0x254b0a(_0x4806e8[_0x0774('0x14')][_0x0774('0x11')]);}})['catch'](function(_0x388103){logger[_0x0774('0xf')]('License,\x20%s,\x20%s',_0x55324b,_0x388103);_0x4d7e8f(_0x388103);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 20a6df0..8c3135f 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 _0x2c69=['getApplications','getMessages','/:id/verify','verifySmtp','getAgents','/:id/dispositions','addAnswer','post','create','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','/:id','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications'];(function(_0x5c37a3,_0x578954){var _0x29c9c7=function(_0x2ff558){while(--_0x2ff558){_0x5c37a3['push'](_0x5c37a3['shift']());}};_0x29c9c7(++_0x578954);}(_0x2c69,0xc7));var _0x92c6=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x2c69[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0x92c6('0x0'));var util=require(_0x92c6('0x1'));var path=require(_0x92c6('0x2'));var timeout=require(_0x92c6('0x3'));var express=require(_0x92c6('0x4'));var router=express[_0x92c6('0x5')]();var fs_extra=require(_0x92c6('0x6'));var auth=require(_0x92c6('0x7'));var interaction=require(_0x92c6('0x8'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x92c6('0x9')]('/',auth['isAuthenticated'](),controller[_0x92c6('0xa')]);router[_0x92c6('0x9')]('/describe',auth[_0x92c6('0xb')](),controller['describe']);router['get']('/:id',auth[_0x92c6('0xb')](),controller['show']);router[_0x92c6('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x92c6('0xc')]);router[_0x92c6('0x9')](_0x92c6('0xd'),auth[_0x92c6('0xb')](),controller[_0x92c6('0xe')]);router[_0x92c6('0x9')](_0x92c6('0xf'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x10')]);router['get'](_0x92c6('0x11'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x12')]);router[_0x92c6('0x9')](_0x92c6('0x13'),auth[_0x92c6('0xb')](),controller['getInteractions']);router['get'](_0x92c6('0x14'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x15')]);router[_0x92c6('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x92c6('0x16')]);router['get'](_0x92c6('0x17'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x18')]);router[_0x92c6('0x9')]('/:id/users',auth[_0x92c6('0xb')](),controller[_0x92c6('0x19')]);router['post'](_0x92c6('0x1a'),auth[_0x92c6('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x92c6('0xb')](),controller[_0x92c6('0x1b')]);router[_0x92c6('0x1c')]('/',auth[_0x92c6('0xb')](),controller[_0x92c6('0x1d')]);router[_0x92c6('0x1c')](_0x92c6('0xf'),auth['isAuthenticated'](),controller['addImap']);router[_0x92c6('0x1c')](_0x92c6('0x11'),auth[_0x92c6('0xb')](),controller['addSmtp']);router[_0x92c6('0x1c')](_0x92c6('0x13'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x1e')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x92c6('0x1f')]);router[_0x92c6('0x1c')](_0x92c6('0x20'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x21')]);router[_0x92c6('0x1c')](_0x92c6('0x22'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x23')]);router[_0x92c6('0x24')](_0x92c6('0x25'),auth[_0x92c6('0xb')](),controller['update']);router[_0x92c6('0x26')]('/:id/dispositions',auth[_0x92c6('0xb')](),controller[_0x92c6('0x27')]);router['delete'](_0x92c6('0xd'),auth['isAuthenticated'](),controller[_0x92c6('0x28')]);router[_0x92c6('0x26')](_0x92c6('0xf'),auth[_0x92c6('0xb')](),controller['removeImap']);router[_0x92c6('0x26')](_0x92c6('0x11'),auth[_0x92c6('0xb')](),controller[_0x92c6('0x29')]);router[_0x92c6('0x26')]('/:id',auth[_0x92c6('0xb')](),controller[_0x92c6('0x2a')]);router[_0x92c6('0x26')](_0x92c6('0x22'),auth['isAuthenticated'](),controller[_0x92c6('0x2b')]);module['exports']=router; \ No newline at end of file +var _0xc91d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addInteraction','/:id/send','send','put','/:id','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util'];(function(_0x219e10,_0x1202b3){var _0x162e2b=function(_0xc3f164){while(--_0xc3f164){_0x219e10['push'](_0x219e10['shift']());}};_0x162e2b(++_0x1202b3);}(_0xc91d,0x139));var _0xdc91=function(_0x4c748f,_0x590ea5){_0x4c748f=_0x4c748f-0x0;var _0x3bca77=_0xc91d[_0x4c748f];return _0x3bca77;};'use strict';var multer=require(_0xdc91('0x0'));var util=require(_0xdc91('0x1'));var path=require(_0xdc91('0x2'));var timeout=require(_0xdc91('0x3'));var express=require(_0xdc91('0x4'));var router=express[_0xdc91('0x5')]();var fs_extra=require(_0xdc91('0x6'));var auth=require(_0xdc91('0x7'));var interaction=require(_0xdc91('0x8'));var config=require(_0xdc91('0x9'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xdc91('0xa')](),controller['index']);router[_0xdc91('0xb')]('/describe',auth[_0xdc91('0xa')](),controller[_0xdc91('0xc')]);router[_0xdc91('0xb')]('/:id',auth[_0xdc91('0xa')](),controller['show']);router[_0xdc91('0xb')](_0xdc91('0xd'),auth['isAuthenticated'](),controller[_0xdc91('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdc91('0xf')]);router[_0xdc91('0xb')](_0xdc91('0x10'),auth['isAuthenticated'](),controller[_0xdc91('0x11')]);router[_0xdc91('0xb')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xdc91('0x12')]);router[_0xdc91('0xb')](_0xdc91('0x13'),auth[_0xdc91('0xa')](),controller['getInteractions']);router['get']('/:id/applications',auth[_0xdc91('0xa')](),controller[_0xdc91('0x14')]);router[_0xdc91('0xb')](_0xdc91('0x15'),auth['isAuthenticated'](),controller[_0xdc91('0x16')]);router['get']('/:id/verify',auth[_0xdc91('0xa')](),controller[_0xdc91('0x17')]);router[_0xdc91('0xb')](_0xdc91('0x18'),auth['isAuthenticated'](),controller[_0xdc91('0x19')]);router[_0xdc91('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdc91('0x1b')]);router['post']('/:id/canned_answers',auth[_0xdc91('0xa')](),controller[_0xdc91('0x1c')]);router['post']('/',auth[_0xdc91('0xa')](),controller[_0xdc91('0x1d')]);router['post'](_0xdc91('0x10'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x1e')]);router[_0xdc91('0x1a')](_0xdc91('0x1f'),auth[_0xdc91('0xa')](),controller['addSmtp']);router[_0xdc91('0x1a')](_0xdc91('0x13'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x20')]);router[_0xdc91('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xdc91('0x1a')](_0xdc91('0x21'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x22')]);router[_0xdc91('0x1a')](_0xdc91('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0xdc91('0x23')](_0xdc91('0x24'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x25')]);router[_0xdc91('0x26')](_0xdc91('0xd'),auth['isAuthenticated'](),controller[_0xdc91('0x27')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xdc91('0x26')](_0xdc91('0x10'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x28')]);router[_0xdc91('0x26')](_0xdc91('0x1f'),auth['isAuthenticated'](),controller[_0xdc91('0x29')]);router['delete']('/:id',auth[_0xdc91('0xa')](),controller[_0xdc91('0x2a')]);router[_0xdc91('0x26')](_0xdc91('0x18'),auth[_0xdc91('0xa')](),controller[_0xdc91('0x2b')]);module[_0xdc91('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 396297a..6a802dc 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 _0xb43b=['mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x3c1b0d,_0x4e32aa){var _0x4e582f=function(_0x513dce){while(--_0x513dce){_0x3c1b0d['push'](_0x3c1b0d['shift']());}};_0x4e582f(++_0x4e32aa);}(_0xb43b,0xbf));var _0xbb43=function(_0x57b4b5,_0x2c2f59){_0x57b4b5=_0x57b4b5-0x0;var _0x590e47=_0xb43b[_0x57b4b5];return _0x590e47;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'description':{'type':Sequelize[_0xbb43('0x1')]},'name':{'type':Sequelize[_0xbb43('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbb43('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbb43('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xbb43('0x3')]},'markAsUnread':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbb43('0x1')],'allowNull':![],'defaultValue':_0xbb43('0x4')},'fontSize':{'type':Sequelize[_0xbb43('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbb43('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbb43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb43('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xbb43('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xbb43('0x2')],'defaultValue':![],'comment':_0xbb43('0x7'),'set':function(_0x5a4589){if(!_0x5a4589)this[_0xbb43('0x8')](_0xbb43('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x5a4589);}}}; \ No newline at end of file +var _0x9224=['TEXT','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','exports','STRING','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x3cfe76,_0x1d9d61){var _0x1f6f12=function(_0x1f2148){while(--_0x1f2148){_0x3cfe76['push'](_0x3cfe76['shift']());}};_0x1f6f12(++_0x1d9d61);}(_0x9224,0xa3));var _0x4922=function(_0x4143bc,_0x8fcb54){_0x4143bc=_0x4143bc-0x0;var _0x39cf03=_0x9224[_0x4143bc];return _0x39cf03;};'use strict';var Sequelize=require('sequelize');module[_0x4922('0x0')]={'description':{'type':Sequelize[_0x4922('0x1')]},'name':{'type':Sequelize[_0x4922('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x4922('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4922('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4922('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4922('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x4922('0x3')](0x2)[_0x4922('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4922('0x5')],'defaultValue':function(){return _0x4922('0x6');}},'notificationSound':{'type':Sequelize[_0x4922('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4922('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4922('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4922('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4922('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4922('0x3')],'allowNull':!![],'defaultValue':null,'comment':_0x4922('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x4922('0x2')],'defaultValue':![],'comment':_0x4922('0x8'),'set':function(_0x3aa36d){if(!_0x3aa36d)this[_0x4922('0x9')](_0x4922('0xa'),null);this['setDataValue'](_0x4922('0xb'),_0x3aa36d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index df9fadc..132b341 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 _0x90c7=['undefined','limit','count','Content-Range','json','apply','reject','save','update','get','UserProfileResource','destroy','end','send','MailServerIn','MailServerOut','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','name','filter','merge','options','includeAll','findAll','show','params','Imap','mandatoryDispositionPause','find','body','describe','Disposition','create','getDispositions','MailAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','order','include','email','ListId','isNil','active','description','cauthentication','user','cuser','pass','authentication','host','port','service','cservice','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','defaults','List\x20not\x20found','attach','out','messageId','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','html-to-text','juice','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset'];(function(_0x28c5eb,_0x4a0a2d){var _0x96e803=function(_0x5bf330){while(--_0x5bf330){_0x28c5eb['push'](_0x28c5eb['shift']());}};_0x96e803(++_0x4a0a2d);}(_0x90c7,0x9c));var _0x790c=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x90c7[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x790c('0x0'));var rimraf=require(_0x790c('0x1'));var zipdir=require(_0x790c('0x2'));var jsonpatch=require(_0x790c('0x3'));var rp=require(_0x790c('0x4'));var moment=require(_0x790c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x790c('0x6'));var util=require(_0x790c('0x7'));var path=require('path');var sox=require(_0x790c('0x8'));var csv=require(_0x790c('0x9'));var ejs=require(_0x790c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x790c('0xb'));var squel=require(_0x790c('0xc'));var crypto=require(_0x790c('0xd'));var jsforce=require(_0x790c('0xe'));var deskjs=require(_0x790c('0xf'));var toCsv=require(_0x790c('0x9'));var querystring=require(_0x790c('0x10'));var Papa=require('papaparse');var htmlToText=require(_0x790c('0x11'));var juice=require(_0x790c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x790c('0x13'));var hardwareService=require(_0x790c('0x14'));var logger=require(_0x790c('0x15'))(_0x790c('0x16'));var utils=require(_0x790c('0x17'));var config=require(_0x790c('0x18'));var licenseUtil=require(_0x790c('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x790c('0x1a')],{'host':_0x790c('0x1b'),'port':0x18eb});var socket=require(_0x790c('0x1c'))(new Redis(config[_0x790c('0x1a')]));require(_0x790c('0x1d'))[_0x790c('0x1e')](socket);var jayson=require(_0x790c('0x1f'));var client=jayson[_0x790c('0x20')][_0x790c('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x5beb11,_0x52f310,_0x178d17,_0x5094fa){return new BPromise(function(_0x102235,_0x5c2dbe){var _0x1dabbb=_0x5094fa||client;return _0x1dabbb[_0x790c('0x22')](_0x5beb11,_0x178d17)[_0x790c('0x23')](function(_0x36baf0){logger[_0x790c('0x24')](_0x790c('0x25'),_0x52f310,_0x790c('0x26'));logger['debug'](_0x790c('0x27'),_0x52f310,_0x790c('0x26'),JSON[_0x790c('0x28')](_0x36baf0));if(_0x36baf0[_0x790c('0x29')]){if(_0x36baf0['error'][_0x790c('0x2a')]===0x1f4){logger[_0x790c('0x29')](_0x790c('0x25'),_0x52f310,_0x36baf0[_0x790c('0x29')][_0x790c('0x2b')]);return _0x5c2dbe(_0x36baf0['error'][_0x790c('0x2b')]);}logger[_0x790c('0x29')](_0x790c('0x25'),_0x52f310,_0x36baf0[_0x790c('0x29')][_0x790c('0x2b')]);return _0x102235(_0x36baf0[_0x790c('0x29')]['message']);}else{logger[_0x790c('0x24')](_0x790c('0x25'),_0x52f310,'request\x20sent');_0x102235(_0x36baf0[_0x790c('0x2c')][_0x790c('0x2b')]);}})[_0x790c('0x2d')](function(_0x1de847){logger[_0x790c('0x29')](_0x790c('0x25'),_0x52f310,_0x1de847);_0x5c2dbe(_0x1de847);});});}function respondWithStatusCode(_0x2916dd,_0x313fdd){_0x313fdd=_0x313fdd||0xcc;return function(_0x1786bb){if(_0x1786bb){return _0x2916dd[_0x790c('0x2e')](_0x313fdd);}return _0x2916dd[_0x790c('0x2f')](_0x313fdd)['end']();};}function respondWithResult(_0x3bf4ca,_0x30e614){_0x30e614=_0x30e614||0xc8;return function(_0x3bf30a){if(_0x3bf30a){return _0x3bf4ca[_0x790c('0x2f')](_0x30e614)['json'](_0x3bf30a);}};}function respondWithFilteredResult(_0x1d442b,_0x4c8c79){return function(_0x20ff89){if(_0x20ff89){var _0x3cbd0c=typeof _0x4c8c79[_0x790c('0x30')]===_0x790c('0x31')&&typeof _0x4c8c79[_0x790c('0x32')]===_0x790c('0x31');var _0x268666=_0x20ff89[_0x790c('0x33')];var _0x518750=_0x3cbd0c?0x0:_0x4c8c79[_0x790c('0x30')];var _0x5bdb4b=_0x3cbd0c?_0x20ff89['count']:_0x4c8c79[_0x790c('0x30')]+_0x4c8c79['limit'];var _0x470daf;if(_0x5bdb4b>=_0x268666){_0x5bdb4b=_0x268666;_0x470daf=0xc8;}else{_0x470daf=0xce;}_0x1d442b[_0x790c('0x2f')](_0x470daf);return _0x1d442b['set'](_0x790c('0x34'),_0x518750+'-'+_0x5bdb4b+'/'+_0x268666)[_0x790c('0x35')](_0x20ff89);}return null;};}function patchUpdates(_0x495b8b){return function(_0x64f501){try{jsonpatch[_0x790c('0x36')](_0x64f501,_0x495b8b,!![]);}catch(_0x4d2e69){return BPromise[_0x790c('0x37')](_0x4d2e69);}return _0x64f501[_0x790c('0x38')]();};}function saveUpdates(_0x39e4f9,_0x3e2238){return function(_0x125a32){if(_0x125a32){return _0x125a32[_0x790c('0x39')](_0x39e4f9)[_0x790c('0x23')](function(_0x1310b6){return _0x1310b6;});}return null;};}function removeEntity(_0x5f5218,_0x43b1bb){return function(_0x392171){if(_0x392171){return _0x392171['destroy']()[_0x790c('0x23')](function(){var _0xcb1209=_0x392171[_0x790c('0x3a')]({'plain':!![]});var _0x566103='MailAccounts';return db[_0x790c('0x3b')][_0x790c('0x3c')]({'where':{'type':_0x566103,'resourceId':_0xcb1209['id']}})['then'](function(){return _0x392171;});})[_0x790c('0x23')](function(){_0x5f5218[_0x790c('0x2f')](0xcc)[_0x790c('0x3d')]();});}};}function handleEntityNotFound(_0x46c872,_0x33eaef){return function(_0x20e3a0){if(!_0x20e3a0){_0x46c872['sendStatus'](0x194);}return _0x20e3a0;};}function handleError(_0x59b86b,_0x3c1a67){_0x3c1a67=_0x3c1a67||0x1f4;return function(_0x35830b){logger[_0x790c('0x29')](_0x35830b['stack']);if(_0x35830b['name']){delete _0x35830b['name'];}_0x59b86b[_0x790c('0x2f')](_0x3c1a67)[_0x790c('0x3e')](_0x35830b);};}exports['index']=function(_0x2e7adb,_0x53a8e4){var _0x58b18c={'include':[{'model':db[_0x790c('0x3f')],'as':'Imap'},{'model':db[_0x790c('0x40')],'as':_0x790c('0x41')},{'model':db[_0x790c('0x42')],'as':'mandatoryDispositionPause'}]},_0x3f9d1e={},_0x587fa1={'count':0x0,'rows':[]};var _0x1d8432=_[_0x790c('0x43')](db[_0x790c('0x44')][_0x790c('0x45')],function(_0x153f9b){return{'name':_0x153f9b[_0x790c('0x46')],'type':_0x153f9b[_0x790c('0x47')][_0x790c('0x48')]};});_0x3f9d1e[_0x790c('0x49')]=_['map'](_0x1d8432,'name');_0x3f9d1e['query']=_[_0x790c('0x4a')](_0x2e7adb[_0x790c('0x4b')]);_0x3f9d1e[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x3f9d1e[_0x790c('0x49')],_0x3f9d1e[_0x790c('0x4b')]);_0x58b18c['attributes']=_[_0x790c('0x4d')](_0x3f9d1e[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x2e7adb[_0x790c('0x4b')][_0x790c('0x4e')]));_0x58b18c[_0x790c('0x4f')]=_0x58b18c[_0x790c('0x4f')][_0x790c('0x50')]?_0x58b18c['attributes']:_0x3f9d1e[_0x790c('0x49')];if(!_0x2e7adb[_0x790c('0x4b')][_0x790c('0x51')](_0x790c('0x52'))){_0x58b18c['limit']=qs[_0x790c('0x32')](_0x2e7adb[_0x790c('0x4b')][_0x790c('0x32')]);_0x58b18c['offset']=qs[_0x790c('0x30')](_0x2e7adb[_0x790c('0x4b')]['offset']);}_0x58b18c['order']=qs[_0x790c('0x53')](_0x2e7adb[_0x790c('0x4b')]['sort']);_0x58b18c['where']=qs[_0x790c('0x4c')](_[_0x790c('0x54')](_0x2e7adb[_0x790c('0x4b')],_0x3f9d1e[_0x790c('0x4c')]),_0x1d8432);if(_0x2e7adb['query']['filter']){_0x58b18c[_0x790c('0x55')]=_['merge'](_0x58b18c['where'],{'$or':_[_0x790c('0x43')](_0x1d8432,function(_0x17b938){if(_0x17b938['type']!=='VIRTUAL'){var _0x26ff47={};_0x26ff47[_0x17b938[_0x790c('0x56')]]={'$like':'%'+_0x2e7adb[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0x26ff47;}})});}_0x58b18c=_[_0x790c('0x58')]({},_0x58b18c,_0x2e7adb[_0x790c('0x59')]);var _0xda80e3={'where':_0x58b18c[_0x790c('0x55')]};return db['MailAccount'][_0x790c('0x33')](_0xda80e3)['then'](function(_0x39b2c9){_0x587fa1[_0x790c('0x33')]=_0x39b2c9;if(_0x2e7adb[_0x790c('0x4b')][_0x790c('0x5a')]){_0x58b18c['include']=[{'all':!![]}];}return db[_0x790c('0x44')][_0x790c('0x5b')](_0x58b18c);})[_0x790c('0x23')](function(_0x836c96){_0x587fa1['rows']=_0x836c96;return _0x587fa1;})['then'](respondWithFilteredResult(_0x53a8e4,_0x58b18c))[_0x790c('0x2d')](handleError(_0x53a8e4,null));};exports[_0x790c('0x5c')]=function(_0x27a8a8,_0x37770e){var _0x30c697={'raw':![],'where':{'id':_0x27a8a8[_0x790c('0x5d')]['id']},'include':[{'model':db[_0x790c('0x3f')],'as':_0x790c('0x5e')},{'model':db[_0x790c('0x40')],'as':_0x790c('0x41')},{'model':db[_0x790c('0x42')],'as':_0x790c('0x5f')}]},_0x3c5cb1={};_0x3c5cb1[_0x790c('0x49')]=_[_0x790c('0x4a')](db[_0x790c('0x44')][_0x790c('0x45')]);_0x3c5cb1['query']=_[_0x790c('0x4a')](_0x27a8a8[_0x790c('0x4b')]);_0x3c5cb1[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x3c5cb1[_0x790c('0x49')],_0x3c5cb1[_0x790c('0x4b')]);_0x30c697[_0x790c('0x4f')]=_['intersection'](_0x3c5cb1[_0x790c('0x49')],qs['fields'](_0x27a8a8[_0x790c('0x4b')][_0x790c('0x4e')]));_0x30c697[_0x790c('0x4f')]=_0x30c697[_0x790c('0x4f')][_0x790c('0x50')]?_0x30c697['attributes']:_0x3c5cb1['model'];if(_0x27a8a8[_0x790c('0x4b')][_0x790c('0x5a')]){_0x30c697['include']=[{'all':!![]}];}_0x30c697=_['merge']({},_0x30c697,_0x27a8a8[_0x790c('0x59')]);return db[_0x790c('0x44')][_0x790c('0x60')](_0x30c697)[_0x790c('0x23')](handleEntityNotFound(_0x37770e,null))[_0x790c('0x23')](respondWithResult(_0x37770e,null))[_0x790c('0x2d')](handleError(_0x37770e,null));};exports[_0x790c('0x39')]=function(_0x3a8243,_0x50029b){if(_0x3a8243[_0x790c('0x61')]['id']){delete _0x3a8243[_0x790c('0x61')]['id'];}return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x3a8243[_0x790c('0x5d')]['id']},'include':[{'model':db[_0x790c('0x3f')],'as':'Imap'},{'model':db[_0x790c('0x40')],'as':'Smtp'},{'model':db[_0x790c('0x42')],'as':_0x790c('0x5f')}]})[_0x790c('0x23')](handleEntityNotFound(_0x50029b,null))[_0x790c('0x23')](saveUpdates(_0x3a8243[_0x790c('0x61')],null))[_0x790c('0x23')](function(_0x1d1c8d){if(_0x1d1c8d&&_0x3a8243['body'][_0x790c('0x5e')]){return db[_0x790c('0x3f')][_0x790c('0x39')](_0x3a8243['body']['Imap'],{'where':{'MailAccountId':_0x1d1c8d['id']}})[_0x790c('0x23')](function(){return _0x1d1c8d;});}return _0x1d1c8d;})[_0x790c('0x23')](function(_0x507131){if(_0x507131&&_0x3a8243['body'][_0x790c('0x41')]){return db[_0x790c('0x40')]['update'](_0x3a8243['body'][_0x790c('0x41')],{'where':{'MailAccountId':_0x507131['id']}})['then'](function(){return _0x507131;});}return _0x507131;})['then'](respondWithResult(_0x50029b,null))[_0x790c('0x2d')](handleError(_0x50029b,null));};exports[_0x790c('0x62')]=function(_0x2c6fa9,_0x1f6a44){return db[_0x790c('0x44')]['describe']()[_0x790c('0x23')](respondWithResult(_0x1f6a44,null))[_0x790c('0x2d')](handleError(_0x1f6a44,null));};exports['addDisposition']=function(_0x287ea4,_0x201703,_0x579199){if(_0x287ea4[_0x790c('0x61')]['id']){delete _0x287ea4['body']['id'];}return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x287ea4[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x201703,null))[_0x790c('0x23')](function(_0x49d9a1){if(_0x49d9a1){_0x287ea4[_0x790c('0x61')]['MailAccountId']=_0x49d9a1['id'];return db[_0x790c('0x63')][_0x790c('0x64')](_0x287ea4[_0x790c('0x61')]);}})['then'](respondWithResult(_0x201703,null))['catch'](handleError(_0x201703,null));};exports[_0x790c('0x65')]=function(_0x2a8d88,_0x44db32,_0x350742){var _0x1208e4={'raw':![],'where':{}};var _0x9838bd={};var _0x4e5cdc={'count':0x0,'rows':[]};return db[_0x790c('0x44')]['findOne']({'where':{'id':_0x2a8d88[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x44db32,null))[_0x790c('0x23')](function(_0xa560a3){if(_0xa560a3){_0x9838bd[_0x790c('0x49')]=_[_0x790c('0x4a')](db[_0x790c('0x63')][_0x790c('0x45')]);_0x9838bd['query']=_[_0x790c('0x4a')](_0x2a8d88[_0x790c('0x4b')]);_0x9838bd[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x9838bd[_0x790c('0x49')],_0x9838bd[_0x790c('0x4b')]);_0x1208e4[_0x790c('0x4f')]=_['intersection'](_0x9838bd['model'],qs[_0x790c('0x4e')](_0x2a8d88['query'][_0x790c('0x4e')]));_0x1208e4[_0x790c('0x4f')]=_0x1208e4['attributes'][_0x790c('0x50')]?_0x1208e4[_0x790c('0x4f')]:_0x9838bd['model'];if(!_0x2a8d88[_0x790c('0x4b')][_0x790c('0x51')](_0x790c('0x52'))){_0x1208e4[_0x790c('0x32')]=qs['limit'](_0x2a8d88[_0x790c('0x4b')][_0x790c('0x32')]);_0x1208e4['offset']=qs[_0x790c('0x30')](_0x2a8d88['query'][_0x790c('0x30')]);}_0x1208e4['order']=qs[_0x790c('0x53')](_0x2a8d88[_0x790c('0x4b')][_0x790c('0x53')]);_0x1208e4[_0x790c('0x55')]=qs[_0x790c('0x4c')](_['pick'](_0x2a8d88[_0x790c('0x4b')],_0x9838bd[_0x790c('0x4c')]));_0x1208e4['where'][_0x790c('0x66')]=_0xa560a3['id'];if(_0x2a8d88[_0x790c('0x4b')][_0x790c('0x57')]){_0x1208e4[_0x790c('0x55')]=_[_0x790c('0x58')](_0x1208e4[_0x790c('0x55')],{'$or':_['map'](_0x1208e4[_0x790c('0x4f')],function(_0x341bcf){var _0x12d135={};_0x12d135[_0x341bcf]={'$like':'%'+_0x2a8d88[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0x12d135;})});}_0x1208e4=_[_0x790c('0x58')]({},_0x1208e4,_0x2a8d88[_0x790c('0x59')]);return db[_0x790c('0x63')][_0x790c('0x33')]({'where':_0x1208e4[_0x790c('0x55')]})['then'](function(_0x4219fc){_0x4e5cdc['count']=_0x4219fc;if(_0x2a8d88[_0x790c('0x4b')]['includeAll']){_0x1208e4['include']=[{'all':!![]}];}return db[_0x790c('0x63')][_0x790c('0x5b')](_0x1208e4);})['then'](function(_0x33a8e3){_0x4e5cdc[_0x790c('0x67')]=_0x33a8e3;return _0x4e5cdc;});}})[_0x790c('0x23')](respondWithFilteredResult(_0x44db32,_0x1208e4))['catch'](handleError(_0x44db32,null));};exports[_0x790c('0x68')]=function(_0x455540,_0x370a4b,_0x36bd74){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x455540[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x370a4b,null))['then'](function(_0x357454){if(_0x357454){return _0x357454[_0x790c('0x68')](_0x455540['query'][_0x790c('0x69')]);}})[_0x790c('0x23')](respondWithStatusCode(_0x370a4b,null))[_0x790c('0x2d')](handleError(_0x370a4b,null));};exports[_0x790c('0x6a')]=function(_0xfd8bbd,_0x31c2d7,_0x4c503a){if(_0xfd8bbd[_0x790c('0x61')]['id']){delete _0xfd8bbd[_0x790c('0x61')]['id'];}return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0xfd8bbd[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x31c2d7,null))['then'](function(_0xaca93a){if(_0xaca93a){_0xfd8bbd[_0x790c('0x61')][_0x790c('0x66')]=_0xaca93a['id'];return db[_0x790c('0x6b')][_0x790c('0x64')](_0xfd8bbd[_0x790c('0x61')]);}})[_0x790c('0x23')](respondWithResult(_0x31c2d7,null))[_0x790c('0x2d')](handleError(_0x31c2d7,null));};exports['getAnswers']=function(_0x3f82e6,_0x5d5562,_0x3a79b0){var _0x5a36eb={'raw':![],'where':{}};var _0x2e3d69={};var _0x483e60={'count':0x0,'rows':[]};return db[_0x790c('0x44')][_0x790c('0x6c')]({'where':{'id':_0x3f82e6['params']['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x5d5562,null))[_0x790c('0x23')](function(_0x51b6ba){if(_0x51b6ba){_0x2e3d69[_0x790c('0x49')]=_[_0x790c('0x4a')](db[_0x790c('0x6b')][_0x790c('0x45')]);_0x2e3d69[_0x790c('0x4b')]=_[_0x790c('0x4a')](_0x3f82e6['query']);_0x2e3d69[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x2e3d69[_0x790c('0x49')],_0x2e3d69[_0x790c('0x4b')]);_0x5a36eb[_0x790c('0x4f')]=_[_0x790c('0x4d')](_0x2e3d69[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x3f82e6[_0x790c('0x4b')][_0x790c('0x4e')]));_0x5a36eb[_0x790c('0x4f')]=_0x5a36eb['attributes'][_0x790c('0x50')]?_0x5a36eb[_0x790c('0x4f')]:_0x2e3d69[_0x790c('0x49')];if(!_0x3f82e6[_0x790c('0x4b')][_0x790c('0x51')](_0x790c('0x52'))){_0x5a36eb[_0x790c('0x32')]=qs['limit'](_0x3f82e6[_0x790c('0x4b')][_0x790c('0x32')]);_0x5a36eb['offset']=qs['offset'](_0x3f82e6[_0x790c('0x4b')][_0x790c('0x30')]);}_0x5a36eb[_0x790c('0x6d')]=qs['sort'](_0x3f82e6[_0x790c('0x4b')][_0x790c('0x53')]);_0x5a36eb['where']=qs['filters'](_['pick'](_0x3f82e6[_0x790c('0x4b')],_0x2e3d69[_0x790c('0x4c')]));_0x5a36eb[_0x790c('0x55')][_0x790c('0x66')]=_0x51b6ba['id'];if(_0x3f82e6[_0x790c('0x4b')][_0x790c('0x57')]){_0x5a36eb[_0x790c('0x55')]=_['merge'](_0x5a36eb[_0x790c('0x55')],{'$or':_['map'](_0x5a36eb['attributes'],function(_0x274f14){var _0x283162={};_0x283162[_0x274f14]={'$like':'%'+_0x3f82e6[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0x283162;})});}_0x5a36eb=_['merge']({},_0x5a36eb,_0x3f82e6[_0x790c('0x59')]);return db[_0x790c('0x6b')][_0x790c('0x33')]({'where':_0x5a36eb[_0x790c('0x55')]})[_0x790c('0x23')](function(_0x5f4bbd){_0x483e60[_0x790c('0x33')]=_0x5f4bbd;if(_0x3f82e6[_0x790c('0x4b')][_0x790c('0x5a')]){_0x5a36eb[_0x790c('0x6e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x790c('0x5b')](_0x5a36eb);})[_0x790c('0x23')](function(_0x1de3f9){_0x483e60[_0x790c('0x67')]=_0x1de3f9;return _0x483e60;});}})[_0x790c('0x23')](respondWithFilteredResult(_0x5d5562,_0x5a36eb))[_0x790c('0x2d')](handleError(_0x5d5562,null));};exports['removeAnswers']=function(_0x71ce8b,_0x4da25c,_0x2a50c5){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x71ce8b[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x4da25c,null))[_0x790c('0x23')](function(_0x136adb){if(_0x136adb){return _0x136adb['removeAnswers'](_0x71ce8b[_0x790c('0x4b')][_0x790c('0x69')]);}})['then'](respondWithStatusCode(_0x4da25c,null))[_0x790c('0x2d')](handleError(_0x4da25c,null));};exports[_0x790c('0x64')]=function(_0x3f1af9,_0x93a0cf){var _0x192b97={'name':_0x3f1af9[_0x790c('0x61')][_0x790c('0x56')],'key':_0x3f1af9['body'][_0x790c('0x48')],'email':_0x3f1af9['body'][_0x790c('0x6f')],'ListId':_0x3f1af9['body'][_0x790c('0x70')],'active':!_[_0x790c('0x71')](_0x3f1af9[_0x790c('0x61')][_0x790c('0x72')])?_0x3f1af9[_0x790c('0x61')][_0x790c('0x72')]:!![],'description':_0x3f1af9['body'][_0x790c('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x790c('0x71')](_0x3f1af9['body']['cservice'])){if(_0x3f1af9[_0x790c('0x61')][_0x790c('0x74')]){_0x192b97[_0x790c('0x5e')][_0x790c('0x75')]=_0x192b97[_0x790c('0x41')]['user']=_0x3f1af9[_0x790c('0x61')][_0x790c('0x76')];_0x192b97[_0x790c('0x5e')]['password']=_0x192b97['Smtp'][_0x790c('0x77')]=_0x3f1af9[_0x790c('0x61')]['cpassword'];}else{_0x192b97['Imap']['authentication']=_0x192b97[_0x790c('0x41')][_0x790c('0x78')]=![];}_0x192b97[_0x790c('0x5e')]['host']=_0x3f1af9[_0x790c('0x61')][_0x790c('0x5e')][_0x790c('0x79')];_0x192b97[_0x790c('0x5e')][_0x790c('0x7a')]=_0x3f1af9['body'][_0x790c('0x5e')][_0x790c('0x7a')];_0x192b97[_0x790c('0x41')][_0x790c('0x79')]=_0x3f1af9[_0x790c('0x61')]['Smtp'][_0x790c('0x79')];_0x192b97[_0x790c('0x41')]['port']=_0x3f1af9['body']['Smtp'][_0x790c('0x7a')];}else{_0x192b97[_0x790c('0x5e')]['service']=_0x192b97[_0x790c('0x41')][_0x790c('0x7b')]=_0x3f1af9['body'][_0x790c('0x7c')];_0x192b97[_0x790c('0x5e')]['user']=_0x192b97[_0x790c('0x41')][_0x790c('0x75')]=_0x3f1af9[_0x790c('0x61')][_0x790c('0x76')];_0x192b97[_0x790c('0x5e')][_0x790c('0x7d')]=_0x192b97[_0x790c('0x41')][_0x790c('0x77')]=_0x3f1af9[_0x790c('0x61')][_0x790c('0x7e')];}return db[_0x790c('0x44')][_0x790c('0x64')](_0x192b97,{'include':[{'model':db[_0x790c('0x40')],'as':_0x790c('0x41')},{'model':db['MailServerIn'],'as':_0x790c('0x5e')}]})['then'](function(_0x446cb2){var _0x5a955d=_0x3f1af9[_0x790c('0x75')]['get']({'plain':!![]});if(!_0x5a955d)throw new Error(_0x790c('0x7f'));if(_0x5a955d[_0x790c('0x80')]===_0x790c('0x75')){var _0x30ac99=_0x446cb2[_0x790c('0x3a')]({'plain':!![]});return db[_0x790c('0x81')][_0x790c('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x5a955d[_0x790c('0x82')]},'raw':!![]})['then'](function(_0x5e8b6a){if(_0x5e8b6a&&_0x5e8b6a[_0x790c('0x83')]===0x0){return db[_0x790c('0x3b')]['create']({'name':_0x30ac99[_0x790c('0x56')],'resourceId':_0x30ac99['id'],'type':_0x5e8b6a[_0x790c('0x56')],'sectionId':_0x5e8b6a['id']},{})[_0x790c('0x23')](function(){return _0x446cb2;});}else{return _0x446cb2;}})[_0x790c('0x2d')](function(_0x43f2d7){logger[_0x790c('0x29')](_0x790c('0x84'),_0x43f2d7);throw _0x43f2d7;});}return _0x446cb2;})[_0x790c('0x23')](respondWithResult(_0x93a0cf,0xc9))[_0x790c('0x2d')](handleError(_0x93a0cf,null));};exports[_0x790c('0x85')]=function(_0x441167,_0x50ce2f,_0x561549){return db['MailAccount'][_0x790c('0x6c')]({'where':{'id':_0x441167[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x50ce2f,null))[_0x790c('0x23')](function(_0x9a8e10){if(_0x9a8e10){return _0x9a8e10['getImap']();}return null;})[_0x790c('0x23')](respondWithResult(_0x50ce2f,null))[_0x790c('0x2d')](handleError(_0x50ce2f,null));};exports[_0x790c('0x86')]=function(_0x371d2f,_0x400454,_0x243cf6){if(_0x371d2f['body']['id']){delete _0x371d2f[_0x790c('0x61')]['id'];}return db[_0x790c('0x44')]['find']({'where':{'id':_0x371d2f['params']['id']}})['then'](handleEntityNotFound(_0x400454,null))['then'](function(_0x612fd4){if(_0x612fd4){_0x371d2f['body']['MailAccountId']=_0x612fd4['id'];return db['MailServerIn'][_0x790c('0x64')](_0x371d2f[_0x790c('0x61')]);}})[_0x790c('0x23')](respondWithResult(_0x400454,null))['catch'](handleError(_0x400454,null));};exports[_0x790c('0x87')]=function(_0x3cacae,_0x4f2709,_0x406a8b){return db[_0x790c('0x44')]['findOne']({'where':{'id':_0x3cacae['params']['id']}})['then'](handleEntityNotFound(_0x4f2709,null))['then'](function(_0x33ef0e){if(_0x33ef0e){return _0x33ef0e[_0x790c('0x88')](null);}return null;})[_0x790c('0x23')](respondWithStatusCode(_0x4f2709,null))[_0x790c('0x2d')](handleError(_0x4f2709,null));};exports['getSmtp']=function(_0x395937,_0x1eb896,_0x1d5f63){return db[_0x790c('0x44')][_0x790c('0x6c')]({'where':{'id':_0x395937[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x1eb896,null))['then'](function(_0x20cafd){if(_0x20cafd){return _0x20cafd['getSmtp']();}return null;})['then'](respondWithResult(_0x1eb896,null))[_0x790c('0x2d')](handleError(_0x1eb896,null));};exports[_0x790c('0x89')]=function(_0x426676,_0x524880,_0x55b893){if(_0x426676[_0x790c('0x61')]['id']){delete _0x426676[_0x790c('0x61')]['id'];}return db['MailAccount'][_0x790c('0x60')]({'where':{'id':_0x426676[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x524880,null))['then'](function(_0x184d63){if(_0x184d63){_0x426676[_0x790c('0x61')]['MailAccountId']=_0x184d63['id'];return db[_0x790c('0x40')][_0x790c('0x64')](_0x426676[_0x790c('0x61')]);}})[_0x790c('0x23')](respondWithResult(_0x524880,null))[_0x790c('0x2d')](handleError(_0x524880,null));};exports[_0x790c('0x8a')]=function(_0x55b8ce,_0x4e2ee4,_0x2ce8a8){return db['MailAccount'][_0x790c('0x6c')]({'where':{'id':_0x55b8ce['params']['id']}})['then'](handleEntityNotFound(_0x4e2ee4,null))[_0x790c('0x23')](function(_0xf21320){if(_0xf21320){return _0xf21320[_0x790c('0x8b')](null);}return null;})[_0x790c('0x23')](respondWithStatusCode(_0x4e2ee4,null))[_0x790c('0x2d')](handleError(_0x4e2ee4,null));};exports[_0x790c('0x8c')]=function(_0x527029,_0x317ad1,_0x15f4dd){return db['MailInteraction']['find']({'where':{'id':_0x527029['params']['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x317ad1,null))[_0x790c('0x23')](function(_0x2e08a1){if(_0x2e08a1){return _0x2e08a1[_0x790c('0x8c')](_0x527029['body'][_0x790c('0x69')],_[_0x790c('0x8d')](_0x527029[_0x790c('0x61')],[_0x790c('0x69'),'id'])||{});}})[_0x790c('0x23')](respondWithResult(_0x317ad1,null))[_0x790c('0x2d')](handleError(_0x317ad1,null));};exports[_0x790c('0x8e')]=function(_0x147098,_0x126675,_0x524c94){var _0x5c1f2a={'raw':![],'where':{}};var _0x56aa58={};var _0x1c1985={'count':0x0,'rows':[]};return db[_0x790c('0x44')][_0x790c('0x6c')]({'where':{'id':_0x147098['params']['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x126675,null))[_0x790c('0x23')](function(_0x9904b5){if(_0x9904b5){_0x56aa58[_0x790c('0x49')]=_[_0x790c('0x4a')](db['MailInteraction']['rawAttributes']);_0x56aa58[_0x790c('0x4b')]=_[_0x790c('0x4a')](_0x147098['query']);_0x56aa58[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x56aa58[_0x790c('0x49')],_0x56aa58[_0x790c('0x4b')]);_0x5c1f2a['attributes']=_['intersection'](_0x56aa58[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x147098[_0x790c('0x4b')][_0x790c('0x4e')]));_0x5c1f2a[_0x790c('0x4f')]=_0x5c1f2a[_0x790c('0x4f')][_0x790c('0x50')]?_0x5c1f2a[_0x790c('0x4f')]:_0x56aa58['model'];if(!_0x147098[_0x790c('0x4b')][_0x790c('0x51')](_0x790c('0x52'))){_0x5c1f2a[_0x790c('0x32')]=qs[_0x790c('0x32')](_0x147098['query'][_0x790c('0x32')]);_0x5c1f2a[_0x790c('0x30')]=qs[_0x790c('0x30')](_0x147098['query'][_0x790c('0x30')]);}_0x5c1f2a[_0x790c('0x6d')]=qs['sort'](_0x147098[_0x790c('0x4b')][_0x790c('0x53')]);_0x5c1f2a[_0x790c('0x55')]=qs[_0x790c('0x4c')](_[_0x790c('0x54')](_0x147098[_0x790c('0x4b')],_0x56aa58[_0x790c('0x4c')]));_0x5c1f2a[_0x790c('0x55')]['MailAccountId']=_0x9904b5['id'];if(_0x147098[_0x790c('0x4b')][_0x790c('0x57')]){_0x5c1f2a[_0x790c('0x55')]=_[_0x790c('0x58')](_0x5c1f2a['where'],{'$or':_['map'](_0x5c1f2a[_0x790c('0x4f')],function(_0x30f052){var _0x6f6f0a={};_0x6f6f0a[_0x30f052]={'$like':'%'+_0x147098[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0x6f6f0a;})});}_0x5c1f2a=_[_0x790c('0x58')]({},_0x5c1f2a,_0x147098[_0x790c('0x59')]);return db[_0x790c('0x8f')][_0x790c('0x33')]({'where':_0x5c1f2a[_0x790c('0x55')]})[_0x790c('0x23')](function(_0x37228e){_0x1c1985[_0x790c('0x33')]=_0x37228e;if(_0x147098['query'][_0x790c('0x5a')]){_0x5c1f2a[_0x790c('0x6e')]=[{'model':db[_0x790c('0x90')],'as':_0x790c('0x91'),'required':![]},{'model':db[_0x790c('0x92')],'as':_0x790c('0x93'),'attributes':[_0x790c('0x56'),'fullname','internal'],'required':![]},{'model':db[_0x790c('0x94')],'as':_0x790c('0x95'),'attributes':['id',_0x790c('0x56'),_0x790c('0x96')],'where':_0x147098[_0x790c('0x4b')][_0x790c('0x97')]?{'id':_0x147098['query'][_0x790c('0x97')]}:undefined,'required':_0x147098[_0x790c('0x4b')][_0x790c('0x97')]?!![]:![]}];}return db[_0x790c('0x8f')][_0x790c('0x5b')](_0x5c1f2a);})['then'](function(_0x212b51){_0x1c1985[_0x790c('0x67')]=_0x212b51;return _0x1c1985;});}})[_0x790c('0x23')](respondWithFilteredResult(_0x126675,_0x5c1f2a))[_0x790c('0x2d')](handleError(_0x126675,null));};exports[_0x790c('0x98')]=function addApplications(_0x1f4667,_0x2c0897){var _0x22a82c=_0x1f4667['params']['id'];var _0x84f8c5=_0x1f4667[_0x790c('0x61')];var _0x8c8f02=0xc8;var _0x463d09=null;return db[_0x790c('0x99')][_0x790c('0x9a')]({'isolationLevel':db[_0x790c('0x99')][_0x790c('0x9b')][_0x790c('0x9c')][_0x790c('0x9d')]},function(_0x970f5c){return db['MailAccount']['findOne']({'where':{'id':_0x22a82c},'transaction':_0x970f5c})[_0x790c('0x23')](function(_0x273d3c){if(_0x273d3c){return db[_0x790c('0x9e')][_0x790c('0x3c')]({'where':{'MailAccountId':_0x22a82c},'transaction':_0x970f5c})[_0x790c('0x23')](function(){var _0x2b5602=_[_0x790c('0x43')](_0x84f8c5,function(_0x5b2dee){_0x5b2dee[_0x790c('0x66')]=_0x22a82c;return _0x5b2dee;});return db['MailApplication'][_0x790c('0x9f')](_0x2b5602,{'transaction':_0x970f5c});});}else{_0x8c8f02=0x194;_0x463d09=[];}});})[_0x790c('0x23')](function(){if(_0x8c8f02!==0x194){return db['MailApplication'][_0x790c('0xa0')]({'where':{'MailAccountId':_0x22a82c},'order':_0x790c('0xa1')})['then'](function(_0x519bbf){_0x463d09=_0x519bbf;});}})[_0x790c('0x2d')](function(_0xb9a510){_0x8c8f02=0x1f4;logger[_0x790c('0x29')](_0xb9a510['stack']);if(_0xb9a510['name']){delete _0xb9a510[_0x790c('0x56')];}_0x463d09=_0xb9a510;})[_0x790c('0xa2')](function(){if(_0x463d09===null){_0x2c0897['sendStatus'](_0x8c8f02);}else{if(_0x8c8f02===0x1f4){_0x2c0897['status'](_0x8c8f02)[_0x790c('0x3e')](_0x463d09);}else{_0x2c0897['status'](_0x8c8f02)[_0x790c('0x35')](_0x463d09);}}});};exports[_0x790c('0xa3')]=function(_0x296598,_0x55df77,_0x2f70ad){var _0x1eff73={};var _0x48bc7c={};var _0x3b684d;var _0x37ba76;return db[_0x790c('0x44')]['findOne']({'where':{'id':_0x296598[_0x790c('0x5d')]['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x55df77,null))[_0x790c('0x23')](function(_0xfd0d81){if(_0xfd0d81){_0x3b684d=_0xfd0d81;_0x48bc7c['model']=_[_0x790c('0x4a')](db[_0x790c('0x9e')][_0x790c('0x45')]);_0x48bc7c[_0x790c('0x4b')]=_[_0x790c('0x4a')](_0x296598[_0x790c('0x4b')]);_0x48bc7c['filters']=_[_0x790c('0x4d')](_0x48bc7c[_0x790c('0x49')],_0x48bc7c['query']);_0x1eff73[_0x790c('0x4f')]=_[_0x790c('0x4d')](_0x48bc7c[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x296598['query'][_0x790c('0x4e')]));_0x1eff73[_0x790c('0x4f')]=_0x1eff73['attributes']['length']?_0x1eff73[_0x790c('0x4f')]:_0x48bc7c[_0x790c('0x49')];_0x1eff73[_0x790c('0x6d')]=qs[_0x790c('0x53')](_0x296598[_0x790c('0x4b')]['sort']);_0x1eff73[_0x790c('0x55')]=qs['filters'](_['pick'](_0x296598[_0x790c('0x4b')],_0x48bc7c['filters']));if(_0x296598[_0x790c('0x4b')][_0x790c('0x57')]){_0x1eff73[_0x790c('0x55')]=_[_0x790c('0x58')](_0x1eff73[_0x790c('0x55')],{'$or':_[_0x790c('0x43')](_0x1eff73[_0x790c('0x4f')],function(_0x1a62f1){var _0xa1b9f7={};_0xa1b9f7[_0x1a62f1]={'$like':'%'+_0x296598[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0xa1b9f7;})});}_0x1eff73=_[_0x790c('0x58')]({},_0x1eff73,_0x296598[_0x790c('0x59')]);return _0x3b684d[_0x790c('0xa3')](_0x1eff73);}})[_0x790c('0x23')](function(_0x45eb4d){if(_0x45eb4d){_0x37ba76=_0x45eb4d[_0x790c('0x50')];if(!_0x296598['query'][_0x790c('0x51')](_0x790c('0x52'))){_0x1eff73[_0x790c('0x32')]=qs[_0x790c('0x32')](_0x296598[_0x790c('0x4b')]['limit']);_0x1eff73[_0x790c('0x30')]=qs[_0x790c('0x30')](_0x296598[_0x790c('0x4b')][_0x790c('0x30')]);}return _0x3b684d['getApplications'](_0x1eff73);}})[_0x790c('0x23')](function(_0x47d357){if(_0x47d357){return _0x47d357?{'count':_0x37ba76,'rows':_0x47d357}:null;}})['then'](respondWithResult(_0x55df77,null))[_0x790c('0x2d')](handleError(_0x55df77,null));};exports[_0x790c('0xa4')]=function(_0x53f831,_0x523818,_0x2f3e7f){var _0x4a7a2b={'raw':!![],'where':{}};var _0x212707={};var _0xc7c952={'count':0x0,'rows':[]};return db[_0x790c('0x44')][_0x790c('0x6c')]({'where':{'id':_0x53f831['params']['id']}})[_0x790c('0x23')](handleEntityNotFound(_0x523818,null))[_0x790c('0x23')](function(_0x4af2d6){if(_0x4af2d6){_0x212707[_0x790c('0x49')]=_[_0x790c('0x4a')](db[_0x790c('0xa5')][_0x790c('0x45')]);_0x212707['query']=_['keys'](_0x53f831[_0x790c('0x4b')]);_0x212707[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x212707[_0x790c('0x49')],_0x212707['query']);_0x4a7a2b[_0x790c('0x4f')]=_[_0x790c('0x4d')](_0x212707[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x53f831[_0x790c('0x4b')][_0x790c('0x4e')]));_0x4a7a2b[_0x790c('0x4f')]=_0x4a7a2b[_0x790c('0x4f')][_0x790c('0x50')]?_0x4a7a2b['attributes']:_0x212707[_0x790c('0x49')];if(!_0x53f831['query']['hasOwnProperty'](_0x790c('0x52'))){_0x4a7a2b[_0x790c('0x32')]=qs[_0x790c('0x32')](_0x53f831[_0x790c('0x4b')]['limit']);_0x4a7a2b[_0x790c('0x30')]=qs['offset'](_0x53f831[_0x790c('0x4b')]['offset']);}_0x4a7a2b[_0x790c('0x6d')]=qs[_0x790c('0x53')](_0x53f831[_0x790c('0x4b')][_0x790c('0x53')]);_0x4a7a2b[_0x790c('0x55')]=qs[_0x790c('0x4c')](_[_0x790c('0x54')](_0x53f831[_0x790c('0x4b')],_0x212707['filters']));_0x4a7a2b[_0x790c('0x55')][_0x790c('0x66')]=_0x4af2d6['id'];if(_0x53f831['query']['filter']){_0x4a7a2b[_0x790c('0x55')]=_['merge'](_0x4a7a2b[_0x790c('0x55')],{'$or':_[_0x790c('0x43')](_0x4a7a2b[_0x790c('0x4f')],function(_0x339ed5){var _0x10d66b={};_0x10d66b[_0x339ed5]={'$like':'%'+_0x53f831[_0x790c('0x4b')]['filter']+'%'};return _0x10d66b;})});}if(_0x53f831['query'][_0x790c('0xa6')]){var _0x311737=_0x53f831[_0x790c('0x4b')][_0x790c('0xa6')][_0x790c('0xa7')](',');var _0x93c4c6={};_0x93c4c6[_0x311737[0x0]]={'$gte':moment(_0x311737[0x1])[_0x790c('0xa8')](_0x790c('0xa9'))};_0x4a7a2b[_0x790c('0x55')]=_[_0x790c('0x58')](_0x4a7a2b[_0x790c('0x55')],_0x93c4c6);}_0x4a7a2b=_[_0x790c('0x58')]({},_0x4a7a2b,_0x53f831[_0x790c('0x59')]);return db[_0x790c('0xa5')]['count']({'where':_0x4a7a2b[_0x790c('0x55')]})[_0x790c('0x23')](function(_0x45db3f){_0xc7c952[_0x790c('0x33')]=_0x45db3f;if(_0x53f831[_0x790c('0x4b')][_0x790c('0x5a')]){_0x4a7a2b[_0x790c('0x6e')]=[{'all':!![]}];}return db[_0x790c('0xa5')][_0x790c('0x5b')](_0x4a7a2b);})[_0x790c('0x23')](function(_0x209c89){if(_0x53f831[_0x790c('0x4b')][_0x790c('0xaa')]===_0x790c('0xab')){for(var _0x539d1a=0x0;_0x539d1a<_0x209c89[_0x790c('0x50')];_0x539d1a++){_0x209c89[_0x539d1a][_0x790c('0x61')]=juice(_0x209c89[_0x539d1a][_0x790c('0x61')]);}}_0xc7c952[_0x790c('0x67')]=_0x209c89;return _0xc7c952;});}})[_0x790c('0x23')](respondWithFilteredResult(_0x523818,_0x4a7a2b))[_0x790c('0x2d')](handleError(_0x523818,null));};exports['send']=function(_0x50edbe,_0x3ab57e,_0x5a2af3){var _0x284ff8,_0x390d20={},_0x7330e0;if(_0x50edbe[_0x790c('0x61')]['to']){_0x7330e0=_0x50edbe[_0x790c('0x61')]['to'][_0x790c('0xa7')](',')[0x0];}return db[_0x790c('0x44')]['find']({'where':{'id':_0x50edbe[_0x790c('0x5d')]['id']},'include':[{'model':db[_0x790c('0xac')],'as':_0x790c('0xad'),'include':[{'model':db[_0x790c('0x90')],'as':_0x790c('0xae'),'where':{'email':_0x7330e0},'limit':0x1,'order':[[_0x790c('0xaf'),_0x790c('0xb0')]]}]},{'model':db[_0x790c('0x40')],'as':'Smtp','raw':!![]}]})[_0x790c('0x23')](handleEntityNotFound(_0x3ab57e,null))[_0x790c('0x23')](function(_0x32ec6b){if(_0x32ec6b){_0x284ff8=_0x32ec6b;if(_0x32ec6b['Smtp']){if(_['isNil'](_0x50edbe['body'][_0x790c('0xb1')])){_0x50edbe['body'][_0x790c('0xb1')]=util[_0x790c('0xa8')](_0x790c('0xb2'),_0x32ec6b['name'],_0x32ec6b[_0x790c('0x6f')]||_0x32ec6b['Smtp'][_0x790c('0x75')]);}if(_0x50edbe['body'][_0x790c('0xb3')]&&_0x50edbe[_0x790c('0x61')][_0x790c('0xb3')][_0x790c('0x50')]){for(var _0x108593=0x0;_0x108593<_0x50edbe[_0x790c('0x61')]['attachments']['length'];_0x108593+=0x1){_0x50edbe['body'][_0x790c('0xb3')][_0x108593]={'filename':_0x50edbe[_0x790c('0x61')][_0x790c('0xb3')][_0x108593][_0x790c('0x56')],'path':path['join'](config[_0x790c('0xb4')],_0x790c('0xb5'),_0x50edbe[_0x790c('0x61')]['attachments'][_0x108593][_0x790c('0xb6')])};}}var _0x169ff1={'tls':{'rejectUnauthorized':![]}};if(_[_0x790c('0x71')](_0x32ec6b[_0x790c('0x41')][_0x790c('0x7b')])){if(_0x32ec6b[_0x790c('0x41')][_0x790c('0x78')]){_0x169ff1['auth']={'user':_0x32ec6b[_0x790c('0x41')][_0x790c('0x75')],'pass':_0x32ec6b[_0x790c('0x41')]['pass']};}_0x169ff1['host']=_0x32ec6b[_0x790c('0x41')][_0x790c('0x79')];_0x169ff1['port']=_0x32ec6b['Smtp'][_0x790c('0x7a')];_0x169ff1[_0x790c('0xb7')]=_0x32ec6b[_0x790c('0x41')]['secure'];}else{_0x169ff1[_0x790c('0x7b')]=_0x32ec6b[_0x790c('0x41')][_0x790c('0x7b')];_0x169ff1[_0x790c('0xb8')]={'user':_0x32ec6b['Smtp']['user'],'pass':_0x32ec6b[_0x790c('0x41')]['pass']};}return respondWithRpcPromise(_0x790c('0xb9'),_0x790c('0xba'),{'account':_0x169ff1,'message':_0x50edbe[_0x790c('0x61')]});}else{throw new Error('List\x20not\x20found');}}})[_0x790c('0x23')](function(_0x19e26c){if(_0x19e26c){_0x390d20=_0x19e26c;if(_0x284ff8['List']){if(_0x284ff8[_0x790c('0xad')][_0x790c('0xae')][_0x790c('0x50')]){return _0x284ff8['List']['Contacts'][0x0];}else{return db[_0x790c('0x90')][_0x790c('0x64')](_[_0x790c('0xbb')](_0x50edbe[_0x790c('0x61')],{'firstName':_0x50edbe[_0x790c('0x61')]['to'],'email':_0x50edbe[_0x790c('0x61')]['to'],'phone':_0x50edbe[_0x790c('0x61')]['to'],'ListId':_0x284ff8[_0x790c('0x70')]}));}}else{throw new Error(_0x790c('0xbc'));}}})['then'](function(_0x1d06e4){if(_0x1d06e4){var _0x24ece2={'UserId':_0x50edbe[_0x790c('0x75')]['id'],'ContactId':_0x1d06e4['id'],'MailAccountId':_0x284ff8['id'],'inReplyTo':_0x390d20['messageId'],'to':_0x50edbe[_0x790c('0x61')][_0x790c('0xb1')],'cc':_0x50edbe[_0x790c('0x61')]['cc'],'subject':_0x50edbe[_0x790c('0x61')]['subject'],'attach':_0x50edbe[_0x790c('0x61')][_0x790c('0xbd')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x790c('0xa8')](_0x790c('0xa9')),'lastMsgDirection':_0x790c('0xbe'),'Messages':[_[_0x790c('0x58')](_0x50edbe['body'],{'messageId':_0x390d20[_0x790c('0xbf')],'sentAt':moment()[_0x790c('0xa8')](_0x790c('0xa9')),'read':!![],'MailAccountId':_0x284ff8['id'],'UserId':_0x50edbe[_0x790c('0x75')]['id'],'ContactId':_0x1d06e4['id']})]};if(_0x50edbe[_0x790c('0x61')][_0x790c('0xc0')]){_0x24ece2=_[_0x790c('0x58')](_0x24ece2,_0x50edbe[_0x790c('0x61')][_0x790c('0xc0')]);}return db['MailInteraction'][_0x790c('0x64')](_0x24ece2,{'include':[{'model':db['MailMessage'],'as':_0x790c('0xc1')}]});}})['then'](respondWithResult(_0x3ab57e,null))[_0x790c('0x2d')](handleError(_0x3ab57e,null));};exports[_0x790c('0xc2')]=function(_0x540e2d,_0x79b626,_0xe97b88){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x540e2d[_0x790c('0x5d')]['id']},'include':[{'model':db[_0x790c('0x40')],'as':_0x790c('0x41'),'raw':!![]}]})[_0x790c('0x23')](handleEntityNotFound(_0x79b626,null))[_0x790c('0x23')](function(_0x292c38){if(_0x292c38&&_0x292c38['Smtp']){var _0xa874c3={'id':_0x292c38['id'],'tls':{'rejectUnauthorized':![]}};if(_0x292c38[_0x790c('0x41')][_0x790c('0x7b')]){_0xa874c3[_0x790c('0x7b')]=_0x292c38['Smtp'][_0x790c('0x7b')];}else{_0xa874c3[_0x790c('0x79')]=_0x292c38[_0x790c('0x41')]['host'];_0xa874c3[_0x790c('0x7a')]=_0x292c38[_0x790c('0x41')]['port'];_0xa874c3['secure']=_0x292c38[_0x790c('0x41')]['secure'];}if(_0x292c38[_0x790c('0x41')][_0x790c('0x78')]){_0xa874c3[_0x790c('0xb8')]={'user':_0x292c38[_0x790c('0x41')][_0x790c('0x75')],'pass':_0x292c38['Smtp'][_0x790c('0x77')]};}return respondWithRpcPromise('VerifySmtp',_0x790c('0xc2'),{'account':_0xa874c3});}})[_0x790c('0x23')](respondWithResult(_0x79b626,null))[_0x790c('0x2d')](handleError(_0x79b626,null));};exports['destroy']=function(_0x2a41f1,_0x383f03){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x2a41f1[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x383f03,null))[_0x790c('0x23')](function(_0x1f2927){if(_0x1f2927&&_0x1f2927[_0x790c('0x7b')]){throw new db[(_0x790c('0xc3'))][(_0x790c('0xc4'))](_0x790c('0xc5'));}return _0x1f2927;})[_0x790c('0x23')](removeEntity(_0x383f03,null))[_0x790c('0x2d')](handleError(_0x383f03,null));};exports['addAgents']=function(_0x2eacdf,_0xd6287c,_0x3f6813){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x2eacdf[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0xd6287c,null))['then'](function(_0x233f08){if(_0x233f08){return _0x233f08['addAgents'](_0x2eacdf[_0x790c('0x61')][_0x790c('0x69')],_[_0x790c('0x8d')](_0x2eacdf[_0x790c('0x61')],[_0x790c('0x69'),'id'])||{})[_0x790c('0xc6')](function(_0xf28bc6){for(var _0xf4c07d=0x0;_0xf4c07d<_0x2eacdf[_0x790c('0x61')][_0x790c('0x69')][_0x790c('0x50')];_0xf4c07d+=0x1){socket[_0x790c('0xc7')](_0x790c('0xc8'),{'UserId':Number(_0x2eacdf[_0x790c('0x61')][_0x790c('0x69')][_0xf4c07d]),'MailAccountId':Number(_0x2eacdf[_0x790c('0x5d')]['id'])});}return _0xf28bc6;});}})[_0x790c('0x23')](respondWithResult(_0xd6287c,null))[_0x790c('0x2d')](handleError(_0xd6287c,null));};exports[_0x790c('0xc9')]=function(_0x68bef1,_0x52beeb,_0x3527a0){return db[_0x790c('0x44')][_0x790c('0x60')]({'where':{'id':_0x68bef1[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x52beeb,null))[_0x790c('0x23')](function(_0x5f3ae0){if(_0x5f3ae0){return _0x5f3ae0[_0x790c('0xc9')](_0x68bef1['query'][_0x790c('0x69')])['then'](function(){if(_[_0x790c('0xca')](_0x68bef1[_0x790c('0x4b')]['ids'])){for(var _0xad1812=0x0;_0xad1812<_0x68bef1['query'][_0x790c('0x69')][_0x790c('0x50')];_0xad1812+=0x1){socket[_0x790c('0xc7')](_0x790c('0xcb'),{'UserId':Number(_0x68bef1[_0x790c('0x4b')][_0x790c('0x69')][_0xad1812]),'MailAccountId':Number(_0x68bef1['params']['id'])});}}else{socket[_0x790c('0xc7')]('userMailAccount:remove',{'UserId':Number(_0x68bef1[_0x790c('0x4b')][_0x790c('0x69')]),'MailAccountId':Number(_0x68bef1[_0x790c('0x5d')]['id'])});}});}})[_0x790c('0x23')](respondWithStatusCode(_0x52beeb,null))[_0x790c('0x2d')](handleError(_0x52beeb,null));};exports[_0x790c('0xcc')]=function(_0x1268ab,_0x4026fa,_0x4ed172){var _0x3e4ae9={};var _0x57f235={};var _0x26f823;var _0xe2df5;return db[_0x790c('0x44')][_0x790c('0x6c')]({'where':{'id':_0x1268ab[_0x790c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4026fa,null))[_0x790c('0x23')](function(_0x162413){if(_0x162413){_0x26f823=_0x162413;_0x57f235[_0x790c('0x49')]=_[_0x790c('0x4a')](db['User']['rawAttributes']);_0x57f235[_0x790c('0x4b')]=_[_0x790c('0x4a')](_0x1268ab[_0x790c('0x4b')]);_0x57f235[_0x790c('0x4c')]=_[_0x790c('0x4d')](_0x57f235[_0x790c('0x49')],_0x57f235[_0x790c('0x4b')]);_0x3e4ae9['attributes']=_['intersection'](_0x57f235[_0x790c('0x49')],qs[_0x790c('0x4e')](_0x1268ab[_0x790c('0x4b')]['fields']));_0x3e4ae9[_0x790c('0x4f')]=_0x3e4ae9[_0x790c('0x4f')][_0x790c('0x50')]?_0x3e4ae9[_0x790c('0x4f')]:_0x57f235[_0x790c('0x49')];_0x3e4ae9['order']=qs[_0x790c('0x53')](_0x1268ab[_0x790c('0x4b')][_0x790c('0x53')]);_0x3e4ae9['where']=qs[_0x790c('0x4c')](_[_0x790c('0x54')](_0x1268ab['query'],_0x57f235[_0x790c('0x4c')]));if(_0x1268ab[_0x790c('0x4b')]['filter']){_0x3e4ae9['where']=_['merge'](_0x3e4ae9[_0x790c('0x55')],{'$or':_[_0x790c('0x43')](_0x3e4ae9['attributes'],function(_0x43b171){var _0x2783ae={};_0x2783ae[_0x43b171]={'$like':'%'+_0x1268ab[_0x790c('0x4b')][_0x790c('0x57')]+'%'};return _0x2783ae;})});}_0x3e4ae9=_[_0x790c('0x58')]({},_0x3e4ae9,_0x1268ab[_0x790c('0x59')]);return _0x26f823[_0x790c('0xcc')](_0x3e4ae9);}})[_0x790c('0x23')](function(_0x3a1192){if(_0x3a1192){_0xe2df5=_0x3a1192['length'];if(!_0x1268ab[_0x790c('0x4b')][_0x790c('0x51')](_0x790c('0x52'))){_0x3e4ae9[_0x790c('0x32')]=qs[_0x790c('0x32')](_0x1268ab['query'][_0x790c('0x32')]);_0x3e4ae9[_0x790c('0x30')]=qs['offset'](_0x1268ab[_0x790c('0x4b')][_0x790c('0x30')]);}return _0x26f823[_0x790c('0xcc')](_0x3e4ae9);}})[_0x790c('0x23')](function(_0x4f719e){if(_0x4f719e){return _0x4f719e?{'count':_0xe2df5,'rows':_0x4f719e}:null;}})[_0x790c('0x23')](respondWithResult(_0x4026fa,null))[_0x790c('0x2d')](handleError(_0x4026fa,null));}; \ No newline at end of file +var _0x8d44=['MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','update','get','destroy','stack','name','send','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','nolimit','order','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','keys','length','merge','find','body','MailServerIn','describe','params','MailAccountId','Disposition','getDispositions','findOne','hasOwnProperty','sort','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','create','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','color','tag','addApplications','transaction','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','split','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','List','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8d44,0x161));var _0x48d4=function(_0x5aede3,_0x18c65a){_0x5aede3=_0x5aede3-0x0;var _0x3bb17f=_0x8d44[_0x5aede3];return _0x3bb17f;};'use strict';var emlformat=require(_0x48d4('0x0'));var rimraf=require(_0x48d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48d4('0x2'));var rp=require(_0x48d4('0x3'));var moment=require(_0x48d4('0x4'));var BPromise=require(_0x48d4('0x5'));var Mustache=require('mustache');var util=require(_0x48d4('0x6'));var path=require('path');var sox=require(_0x48d4('0x7'));var csv=require(_0x48d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48d4('0x9'));var _=require(_0x48d4('0xa'));var squel=require(_0x48d4('0xb'));var crypto=require('crypto');var jsforce=require(_0x48d4('0xc'));var deskjs=require(_0x48d4('0xd'));var toCsv=require(_0x48d4('0x8'));var querystring=require(_0x48d4('0xe'));var Papa=require(_0x48d4('0xf'));var htmlToText=require(_0x48d4('0x10'));var juice=require('juice');var Redis=require('ioredis');var authService=require(_0x48d4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48d4('0x12'));var hardwareService=require(_0x48d4('0x13'));var logger=require(_0x48d4('0x14'))('api');var utils=require(_0x48d4('0x15'));var config=require(_0x48d4('0x16'));var licenseUtil=require(_0x48d4('0x17'));var db=require(_0x48d4('0x18'))['db'];config[_0x48d4('0x19')]=_[_0x48d4('0x1a')](config[_0x48d4('0x19')],{'host':_0x48d4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48d4('0x19')]));require(_0x48d4('0x1c'))[_0x48d4('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x48d4('0x1e')][_0x48d4('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x2225bb,_0x23e47e,_0x2c07ee,_0x1199f6){return new BPromise(function(_0x56533f,_0x4c626d){var _0x5b5b2d=_0x1199f6||client;return _0x5b5b2d['request'](_0x2225bb,_0x2c07ee)[_0x48d4('0x20')](function(_0x3eec93){logger[_0x48d4('0x21')](_0x48d4('0x22'),_0x23e47e,_0x48d4('0x23'));logger[_0x48d4('0x24')](_0x48d4('0x25'),_0x23e47e,_0x48d4('0x23'),JSON['stringify'](_0x3eec93));if(_0x3eec93[_0x48d4('0x26')]){if(_0x3eec93[_0x48d4('0x26')][_0x48d4('0x27')]===0x1f4){logger[_0x48d4('0x26')](_0x48d4('0x22'),_0x23e47e,_0x3eec93['error'][_0x48d4('0x28')]);return _0x4c626d(_0x3eec93['error'][_0x48d4('0x28')]);}logger[_0x48d4('0x26')]('MailAccount,\x20%s,\x20%s',_0x23e47e,_0x3eec93[_0x48d4('0x26')]['message']);return _0x56533f(_0x3eec93[_0x48d4('0x26')]['message']);}else{logger['info'](_0x48d4('0x22'),_0x23e47e,_0x48d4('0x23'));_0x56533f(_0x3eec93['result']['message']);}})[_0x48d4('0x29')](function(_0x274dad){logger['error'](_0x48d4('0x22'),_0x23e47e,_0x274dad);_0x4c626d(_0x274dad);});});}function respondWithStatusCode(_0x4a2f75,_0x490f69){_0x490f69=_0x490f69||0xcc;return function(_0x3265fd){if(_0x3265fd){return _0x4a2f75[_0x48d4('0x2a')](_0x490f69);}return _0x4a2f75[_0x48d4('0x2b')](_0x490f69)[_0x48d4('0x2c')]();};}function respondWithResult(_0x2e83d7,_0x435442){_0x435442=_0x435442||0xc8;return function(_0x4d515a){if(_0x4d515a){return _0x2e83d7['status'](_0x435442)[_0x48d4('0x2d')](_0x4d515a);}};}function respondWithFilteredResult(_0x568c7a,_0x16e284){return function(_0x2eab9d){if(_0x2eab9d){var _0x544c6c=typeof _0x16e284['offset']==='undefined'&&typeof _0x16e284[_0x48d4('0x2e')]===_0x48d4('0x2f');var _0x6db8a1=_0x2eab9d[_0x48d4('0x30')];var _0x51833d=_0x544c6c?0x0:_0x16e284[_0x48d4('0x31')];var _0x27ef52=_0x544c6c?_0x2eab9d['count']:_0x16e284[_0x48d4('0x31')]+_0x16e284[_0x48d4('0x2e')];var _0x611b91;if(_0x27ef52>=_0x6db8a1){_0x27ef52=_0x6db8a1;_0x611b91=0xc8;}else{_0x611b91=0xce;}_0x568c7a[_0x48d4('0x2b')](_0x611b91);return _0x568c7a[_0x48d4('0x32')]('Content-Range',_0x51833d+'-'+_0x27ef52+'/'+_0x6db8a1)[_0x48d4('0x2d')](_0x2eab9d);}return null;};}function patchUpdates(_0x27f53c){return function(_0x306942){try{jsonpatch[_0x48d4('0x33')](_0x306942,_0x27f53c,!![]);}catch(_0xd4da17){return BPromise['reject'](_0xd4da17);}return _0x306942[_0x48d4('0x34')]();};}function saveUpdates(_0x4c07e1,_0x231e56){return function(_0x468169){if(_0x468169){return _0x468169[_0x48d4('0x35')](_0x4c07e1)[_0x48d4('0x20')](function(_0x7f665e){return _0x7f665e;});}return null;};}function removeEntity(_0x1091c3,_0x362ff5){return function(_0x23f2c1){if(_0x23f2c1){return _0x23f2c1['destroy']()['then'](function(){var _0x526428=_0x23f2c1[_0x48d4('0x36')]({'plain':!![]});var _0x41ec0e='MailAccounts';return db['UserProfileResource'][_0x48d4('0x37')]({'where':{'type':_0x41ec0e,'resourceId':_0x526428['id']}})[_0x48d4('0x20')](function(){return _0x23f2c1;});})[_0x48d4('0x20')](function(){_0x1091c3[_0x48d4('0x2b')](0xcc)[_0x48d4('0x2c')]();});}};}function handleEntityNotFound(_0x34e283,_0x536881){return function(_0x21747a){if(!_0x21747a){_0x34e283['sendStatus'](0x194);}return _0x21747a;};}function handleError(_0x5eae84,_0x3ae47b){_0x3ae47b=_0x3ae47b||0x1f4;return function(_0x41234f){logger[_0x48d4('0x26')](_0x41234f[_0x48d4('0x38')]);if(_0x41234f[_0x48d4('0x39')]){delete _0x41234f[_0x48d4('0x39')];}_0x5eae84[_0x48d4('0x2b')](_0x3ae47b)[_0x48d4('0x3a')](_0x41234f);};}exports['index']=function(_0x2836f8,_0x561466){var _0x3b618b={'include':[{'model':db['MailServerIn'],'as':_0x48d4('0x3b')},{'model':db[_0x48d4('0x3c')],'as':_0x48d4('0x3d')},{'model':db[_0x48d4('0x3e')],'as':_0x48d4('0x3f')}]},_0x3e4a5c={},_0xe11532={'count':0x0,'rows':[]};var _0x36f45e=_[_0x48d4('0x40')](db[_0x48d4('0x41')][_0x48d4('0x42')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0x48d4('0x43')][_0x48d4('0x44')]};});_0x3e4a5c[_0x48d4('0x45')]=_[_0x48d4('0x40')](_0x36f45e,_0x48d4('0x39'));_0x3e4a5c[_0x48d4('0x46')]=_['keys'](_0x2836f8['query']);_0x3e4a5c['filters']=_[_0x48d4('0x47')](_0x3e4a5c[_0x48d4('0x45')],_0x3e4a5c[_0x48d4('0x46')]);_0x3b618b[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x3e4a5c['model'],qs[_0x48d4('0x49')](_0x2836f8[_0x48d4('0x46')][_0x48d4('0x49')]));_0x3b618b[_0x48d4('0x48')]=_0x3b618b[_0x48d4('0x48')]['length']?_0x3b618b[_0x48d4('0x48')]:_0x3e4a5c[_0x48d4('0x45')];if(!_0x2836f8[_0x48d4('0x46')]['hasOwnProperty'](_0x48d4('0x4a'))){_0x3b618b['limit']=qs['limit'](_0x2836f8[_0x48d4('0x46')][_0x48d4('0x2e')]);_0x3b618b['offset']=qs[_0x48d4('0x31')](_0x2836f8['query']['offset']);}_0x3b618b[_0x48d4('0x4b')]=qs['sort'](_0x2836f8[_0x48d4('0x46')]['sort']);_0x3b618b[_0x48d4('0x4c')]=qs['filters'](_['pick'](_0x2836f8[_0x48d4('0x46')],_0x3e4a5c[_0x48d4('0x4d')]),_0x36f45e);if(_0x2836f8[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x3b618b[_0x48d4('0x4c')]=_['merge'](_0x3b618b[_0x48d4('0x4c')],{'$or':_[_0x48d4('0x40')](_0x36f45e,function(_0x481dc6){if(_0x481dc6[_0x48d4('0x43')]!==_0x48d4('0x4f')){var _0x2ff950={};_0x2ff950[_0x481dc6[_0x48d4('0x39')]]={'$like':'%'+_0x2836f8[_0x48d4('0x46')][_0x48d4('0x4e')]+'%'};return _0x2ff950;}})});}_0x3b618b=_['merge']({},_0x3b618b,_0x2836f8[_0x48d4('0x50')]);var _0x4d879f={'where':_0x3b618b[_0x48d4('0x4c')]};return db[_0x48d4('0x41')][_0x48d4('0x30')](_0x4d879f)['then'](function(_0x21d99a){_0xe11532[_0x48d4('0x30')]=_0x21d99a;if(_0x2836f8[_0x48d4('0x46')][_0x48d4('0x51')]){_0x3b618b[_0x48d4('0x52')]=[{'all':!![]}];}return db[_0x48d4('0x41')][_0x48d4('0x53')](_0x3b618b);})['then'](function(_0xed92bd){_0xe11532['rows']=_0xed92bd;return _0xe11532;})['then'](respondWithFilteredResult(_0x561466,_0x3b618b))[_0x48d4('0x29')](handleError(_0x561466,null));};exports['show']=function(_0x553236,_0x6f2954){var _0x61c62a={'raw':![],'where':{'id':_0x553236['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x48d4('0x3d')},{'model':db[_0x48d4('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1c7199={};_0x1c7199[_0x48d4('0x45')]=_['keys'](db[_0x48d4('0x41')][_0x48d4('0x42')]);_0x1c7199['query']=_[_0x48d4('0x54')](_0x553236[_0x48d4('0x46')]);_0x1c7199['filters']=_['intersection'](_0x1c7199['model'],_0x1c7199[_0x48d4('0x46')]);_0x61c62a['attributes']=_[_0x48d4('0x47')](_0x1c7199[_0x48d4('0x45')],qs['fields'](_0x553236[_0x48d4('0x46')][_0x48d4('0x49')]));_0x61c62a['attributes']=_0x61c62a['attributes'][_0x48d4('0x55')]?_0x61c62a[_0x48d4('0x48')]:_0x1c7199[_0x48d4('0x45')];if(_0x553236[_0x48d4('0x46')]['includeAll']){_0x61c62a[_0x48d4('0x52')]=[{'all':!![]}];}_0x61c62a=_[_0x48d4('0x56')]({},_0x61c62a,_0x553236[_0x48d4('0x50')]);return db['MailAccount'][_0x48d4('0x57')](_0x61c62a)[_0x48d4('0x20')](handleEntityNotFound(_0x6f2954,null))['then'](respondWithResult(_0x6f2954,null))['catch'](handleError(_0x6f2954,null));};exports[_0x48d4('0x35')]=function(_0x71ae43,_0x270cad){if(_0x71ae43[_0x48d4('0x58')]['id']){delete _0x71ae43[_0x48d4('0x58')]['id'];}return db[_0x48d4('0x41')]['find']({'where':{'id':_0x71ae43['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x48d4('0x3b')},{'model':db[_0x48d4('0x3c')],'as':_0x48d4('0x3d')},{'model':db[_0x48d4('0x3e')],'as':_0x48d4('0x3f')}]})['then'](handleEntityNotFound(_0x270cad,null))[_0x48d4('0x20')](saveUpdates(_0x71ae43[_0x48d4('0x58')],null))[_0x48d4('0x20')](function(_0x1f9174){if(_0x1f9174&&_0x71ae43[_0x48d4('0x58')]['Imap']){return db[_0x48d4('0x59')][_0x48d4('0x35')](_0x71ae43[_0x48d4('0x58')][_0x48d4('0x3b')],{'where':{'MailAccountId':_0x1f9174['id']}})[_0x48d4('0x20')](function(){return _0x1f9174;});}return _0x1f9174;})[_0x48d4('0x20')](function(_0x541ed2){if(_0x541ed2&&_0x71ae43[_0x48d4('0x58')]['Smtp']){return db[_0x48d4('0x3c')][_0x48d4('0x35')](_0x71ae43[_0x48d4('0x58')][_0x48d4('0x3d')],{'where':{'MailAccountId':_0x541ed2['id']}})[_0x48d4('0x20')](function(){return _0x541ed2;});}return _0x541ed2;})[_0x48d4('0x20')](respondWithResult(_0x270cad,null))['catch'](handleError(_0x270cad,null));};exports[_0x48d4('0x5a')]=function(_0x2a9d47,_0x219dbc){return db[_0x48d4('0x41')][_0x48d4('0x5a')]()['then'](respondWithResult(_0x219dbc,null))[_0x48d4('0x29')](handleError(_0x219dbc,null));};exports['addDisposition']=function(_0x19002f,_0x1f78d9,_0x3a927c){if(_0x19002f[_0x48d4('0x58')]['id']){delete _0x19002f['body']['id'];}return db[_0x48d4('0x41')]['find']({'where':{'id':_0x19002f[_0x48d4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1f78d9,null))[_0x48d4('0x20')](function(_0x2e8262){if(_0x2e8262){_0x19002f[_0x48d4('0x58')][_0x48d4('0x5c')]=_0x2e8262['id'];return db[_0x48d4('0x5d')]['create'](_0x19002f[_0x48d4('0x58')]);}})[_0x48d4('0x20')](respondWithResult(_0x1f78d9,null))[_0x48d4('0x29')](handleError(_0x1f78d9,null));};exports[_0x48d4('0x5e')]=function(_0x4aeee9,_0x4aa674,_0x5e3a21){var _0x236ff9={'raw':![],'where':{}};var _0x378cc9={};var _0x7cc2e6={'count':0x0,'rows':[]};return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x4aeee9[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x4aa674,null))['then'](function(_0x3920c5){if(_0x3920c5){_0x378cc9[_0x48d4('0x45')]=_[_0x48d4('0x54')](db[_0x48d4('0x5d')][_0x48d4('0x42')]);_0x378cc9[_0x48d4('0x46')]=_[_0x48d4('0x54')](_0x4aeee9[_0x48d4('0x46')]);_0x378cc9['filters']=_[_0x48d4('0x47')](_0x378cc9[_0x48d4('0x45')],_0x378cc9[_0x48d4('0x46')]);_0x236ff9[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x378cc9[_0x48d4('0x45')],qs[_0x48d4('0x49')](_0x4aeee9[_0x48d4('0x46')][_0x48d4('0x49')]));_0x236ff9[_0x48d4('0x48')]=_0x236ff9[_0x48d4('0x48')][_0x48d4('0x55')]?_0x236ff9[_0x48d4('0x48')]:_0x378cc9[_0x48d4('0x45')];if(!_0x4aeee9[_0x48d4('0x46')][_0x48d4('0x60')](_0x48d4('0x4a'))){_0x236ff9[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x4aeee9[_0x48d4('0x46')]['limit']);_0x236ff9['offset']=qs[_0x48d4('0x31')](_0x4aeee9[_0x48d4('0x46')][_0x48d4('0x31')]);}_0x236ff9[_0x48d4('0x4b')]=qs[_0x48d4('0x61')](_0x4aeee9[_0x48d4('0x46')]['sort']);_0x236ff9[_0x48d4('0x4c')]=qs[_0x48d4('0x4d')](_[_0x48d4('0x62')](_0x4aeee9[_0x48d4('0x46')],_0x378cc9['filters']));_0x236ff9['where'][_0x48d4('0x5c')]=_0x3920c5['id'];if(_0x4aeee9['query'][_0x48d4('0x4e')]){_0x236ff9['where']=_['merge'](_0x236ff9['where'],{'$or':_['map'](_0x236ff9['attributes'],function(_0x1e1f9f){var _0xaaa62d={};_0xaaa62d[_0x1e1f9f]={'$like':'%'+_0x4aeee9[_0x48d4('0x46')]['filter']+'%'};return _0xaaa62d;})});}_0x236ff9=_['merge']({},_0x236ff9,_0x4aeee9[_0x48d4('0x50')]);return db[_0x48d4('0x5d')]['count']({'where':_0x236ff9[_0x48d4('0x4c')]})[_0x48d4('0x20')](function(_0x3df150){_0x7cc2e6[_0x48d4('0x30')]=_0x3df150;if(_0x4aeee9['query'][_0x48d4('0x51')]){_0x236ff9[_0x48d4('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x48d4('0x53')](_0x236ff9);})[_0x48d4('0x20')](function(_0x1cd36e){_0x7cc2e6[_0x48d4('0x63')]=_0x1cd36e;return _0x7cc2e6;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x4aa674,_0x236ff9))[_0x48d4('0x29')](handleError(_0x4aa674,null));};exports[_0x48d4('0x64')]=function(_0x21eaeb,_0x2ded87,_0x335f10){return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x21eaeb[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x2ded87,null))[_0x48d4('0x20')](function(_0x44e778){if(_0x44e778){return _0x44e778['removeDispositions'](_0x21eaeb[_0x48d4('0x46')][_0x48d4('0x65')]);}})[_0x48d4('0x20')](respondWithStatusCode(_0x2ded87,null))[_0x48d4('0x29')](handleError(_0x2ded87,null));};exports[_0x48d4('0x66')]=function(_0x530ca9,_0xc40b2b,_0x3fa7cb){if(_0x530ca9[_0x48d4('0x58')]['id']){delete _0x530ca9['body']['id'];}return db[_0x48d4('0x41')]['find']({'where':{'id':_0x530ca9['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0xc40b2b,null))['then'](function(_0x135ea2){if(_0x135ea2){_0x530ca9[_0x48d4('0x58')][_0x48d4('0x5c')]=_0x135ea2['id'];return db[_0x48d4('0x67')]['create'](_0x530ca9[_0x48d4('0x58')]);}})[_0x48d4('0x20')](respondWithResult(_0xc40b2b,null))[_0x48d4('0x29')](handleError(_0xc40b2b,null));};exports[_0x48d4('0x68')]=function(_0x5954ef,_0xbb477d,_0x12038e){var _0x35328d={'raw':![],'where':{}};var _0x1086f9={};var _0x2f94c5={'count':0x0,'rows':[]};return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x5954ef[_0x48d4('0x5b')]['id']}})['then'](handleEntityNotFound(_0xbb477d,null))[_0x48d4('0x20')](function(_0x1402a5){if(_0x1402a5){_0x1086f9[_0x48d4('0x45')]=_[_0x48d4('0x54')](db[_0x48d4('0x67')][_0x48d4('0x42')]);_0x1086f9[_0x48d4('0x46')]=_[_0x48d4('0x54')](_0x5954ef[_0x48d4('0x46')]);_0x1086f9['filters']=_[_0x48d4('0x47')](_0x1086f9[_0x48d4('0x45')],_0x1086f9[_0x48d4('0x46')]);_0x35328d[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x1086f9['model'],qs['fields'](_0x5954ef['query'][_0x48d4('0x49')]));_0x35328d[_0x48d4('0x48')]=_0x35328d[_0x48d4('0x48')][_0x48d4('0x55')]?_0x35328d[_0x48d4('0x48')]:_0x1086f9[_0x48d4('0x45')];if(!_0x5954ef[_0x48d4('0x46')][_0x48d4('0x60')](_0x48d4('0x4a'))){_0x35328d[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x5954ef[_0x48d4('0x46')][_0x48d4('0x2e')]);_0x35328d[_0x48d4('0x31')]=qs[_0x48d4('0x31')](_0x5954ef[_0x48d4('0x46')][_0x48d4('0x31')]);}_0x35328d[_0x48d4('0x4b')]=qs['sort'](_0x5954ef[_0x48d4('0x46')][_0x48d4('0x61')]);_0x35328d[_0x48d4('0x4c')]=qs['filters'](_[_0x48d4('0x62')](_0x5954ef[_0x48d4('0x46')],_0x1086f9[_0x48d4('0x4d')]));_0x35328d['where'][_0x48d4('0x5c')]=_0x1402a5['id'];if(_0x5954ef[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x35328d[_0x48d4('0x4c')]=_[_0x48d4('0x56')](_0x35328d[_0x48d4('0x4c')],{'$or':_[_0x48d4('0x40')](_0x35328d[_0x48d4('0x48')],function(_0x173870){var _0xa90c4e={};_0xa90c4e[_0x173870]={'$like':'%'+_0x5954ef[_0x48d4('0x46')][_0x48d4('0x4e')]+'%'};return _0xa90c4e;})});}_0x35328d=_['merge']({},_0x35328d,_0x5954ef[_0x48d4('0x50')]);return db[_0x48d4('0x67')][_0x48d4('0x30')]({'where':_0x35328d[_0x48d4('0x4c')]})[_0x48d4('0x20')](function(_0x2ff8df){_0x2f94c5[_0x48d4('0x30')]=_0x2ff8df;if(_0x5954ef[_0x48d4('0x46')][_0x48d4('0x51')]){_0x35328d[_0x48d4('0x52')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x35328d);})[_0x48d4('0x20')](function(_0x395c89){_0x2f94c5[_0x48d4('0x63')]=_0x395c89;return _0x2f94c5;});}})['then'](respondWithFilteredResult(_0xbb477d,_0x35328d))[_0x48d4('0x29')](handleError(_0xbb477d,null));};exports[_0x48d4('0x69')]=function(_0x21c079,_0x2a800d,_0x5983ea){return db['MailAccount'][_0x48d4('0x57')]({'where':{'id':_0x21c079[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x2a800d,null))[_0x48d4('0x20')](function(_0x596012){if(_0x596012){return _0x596012[_0x48d4('0x69')](_0x21c079[_0x48d4('0x46')][_0x48d4('0x65')]);}})[_0x48d4('0x20')](respondWithStatusCode(_0x2a800d,null))[_0x48d4('0x29')](handleError(_0x2a800d,null));};exports[_0x48d4('0x6a')]=function(_0x39aa43,_0x444c1d){var _0x4b34fe={'name':_0x39aa43[_0x48d4('0x58')][_0x48d4('0x39')],'key':_0x39aa43[_0x48d4('0x58')]['key'],'email':_0x39aa43['body'][_0x48d4('0x6b')],'ListId':_0x39aa43['body'][_0x48d4('0x6c')],'active':!_[_0x48d4('0x6d')](_0x39aa43[_0x48d4('0x58')][_0x48d4('0x6e')])?_0x39aa43[_0x48d4('0x58')][_0x48d4('0x6e')]:!![],'description':_0x39aa43['body'][_0x48d4('0x6f')]||null,'Imap':{},'Smtp':{}};if(_[_0x48d4('0x6d')](_0x39aa43[_0x48d4('0x58')][_0x48d4('0x70')])){if(_0x39aa43[_0x48d4('0x58')][_0x48d4('0x71')]){_0x4b34fe['Imap'][_0x48d4('0x72')]=_0x4b34fe[_0x48d4('0x3d')]['user']=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x73')];_0x4b34fe[_0x48d4('0x3b')]['password']=_0x4b34fe[_0x48d4('0x3d')][_0x48d4('0x74')]=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x75')];}else{_0x4b34fe[_0x48d4('0x3b')][_0x48d4('0x76')]=_0x4b34fe[_0x48d4('0x3d')]['authentication']=![];}_0x4b34fe[_0x48d4('0x3b')][_0x48d4('0x77')]=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x3b')][_0x48d4('0x77')];_0x4b34fe[_0x48d4('0x3b')][_0x48d4('0x78')]=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x3b')]['port'];_0x4b34fe[_0x48d4('0x3d')][_0x48d4('0x77')]=_0x39aa43['body'][_0x48d4('0x3d')]['host'];_0x4b34fe['Smtp'][_0x48d4('0x78')]=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x3d')][_0x48d4('0x78')];}else{_0x4b34fe['Imap'][_0x48d4('0x79')]=_0x4b34fe[_0x48d4('0x3d')][_0x48d4('0x79')]=_0x39aa43['body'][_0x48d4('0x70')];_0x4b34fe[_0x48d4('0x3b')][_0x48d4('0x72')]=_0x4b34fe['Smtp']['user']=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x73')];_0x4b34fe['Imap'][_0x48d4('0x7a')]=_0x4b34fe[_0x48d4('0x3d')][_0x48d4('0x74')]=_0x39aa43[_0x48d4('0x58')][_0x48d4('0x75')];}return db[_0x48d4('0x41')][_0x48d4('0x6a')](_0x4b34fe,{'include':[{'model':db[_0x48d4('0x3c')],'as':_0x48d4('0x3d')},{'model':db[_0x48d4('0x59')],'as':_0x48d4('0x3b')}]})[_0x48d4('0x20')](function(_0x2c6182){var _0x5b39da=_0x39aa43[_0x48d4('0x72')][_0x48d4('0x36')]({'plain':!![]});if(!_0x5b39da)throw new Error(_0x48d4('0x7b'));if(_0x5b39da['role']===_0x48d4('0x72')){var _0xd502ff=_0x2c6182['get']({'plain':!![]});return db[_0x48d4('0x7c')][_0x48d4('0x57')]({'where':{'name':_0x48d4('0x7d'),'userProfileId':_0x5b39da[_0x48d4('0x7e')]},'raw':!![]})[_0x48d4('0x20')](function(_0x5f021e){if(_0x5f021e&&_0x5f021e[_0x48d4('0x7f')]===0x0){return db['UserProfileResource'][_0x48d4('0x6a')]({'name':_0xd502ff[_0x48d4('0x39')],'resourceId':_0xd502ff['id'],'type':_0x5f021e[_0x48d4('0x39')],'sectionId':_0x5f021e['id']},{})['then'](function(){return _0x2c6182;});}else{return _0x2c6182;}})[_0x48d4('0x29')](function(_0x91e982){logger['error'](_0x48d4('0x80'),_0x91e982);throw _0x91e982;});}return _0x2c6182;})[_0x48d4('0x20')](respondWithResult(_0x444c1d,0xc9))[_0x48d4('0x29')](handleError(_0x444c1d,null));};exports[_0x48d4('0x81')]=function(_0xcc1217,_0xf68880,_0xd3a80e){return db[_0x48d4('0x41')]['findOne']({'where':{'id':_0xcc1217[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0xf68880,null))[_0x48d4('0x20')](function(_0x532463){if(_0x532463){return _0x532463['getImap']();}return null;})[_0x48d4('0x20')](respondWithResult(_0xf68880,null))[_0x48d4('0x29')](handleError(_0xf68880,null));};exports['addImap']=function(_0x3afe90,_0x48489d,_0x13fd4b){if(_0x3afe90[_0x48d4('0x58')]['id']){delete _0x3afe90[_0x48d4('0x58')]['id'];}return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x3afe90['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x48489d,null))[_0x48d4('0x20')](function(_0x268e59){if(_0x268e59){_0x3afe90[_0x48d4('0x58')]['MailAccountId']=_0x268e59['id'];return db['MailServerIn'][_0x48d4('0x6a')](_0x3afe90[_0x48d4('0x58')]);}})[_0x48d4('0x20')](respondWithResult(_0x48489d,null))[_0x48d4('0x29')](handleError(_0x48489d,null));};exports[_0x48d4('0x82')]=function(_0x4ee688,_0x2a7ba0,_0x1e5b5f){return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x4ee688[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x2a7ba0,null))[_0x48d4('0x20')](function(_0x454bb2){if(_0x454bb2){return _0x454bb2[_0x48d4('0x83')](null);}return null;})[_0x48d4('0x20')](respondWithStatusCode(_0x2a7ba0,null))['catch'](handleError(_0x2a7ba0,null));};exports[_0x48d4('0x84')]=function(_0x2a6bab,_0x412621,_0x48523d){return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x2a6bab[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x412621,null))[_0x48d4('0x20')](function(_0x7e83bc){if(_0x7e83bc){return _0x7e83bc[_0x48d4('0x84')]();}return null;})['then'](respondWithResult(_0x412621,null))['catch'](handleError(_0x412621,null));};exports[_0x48d4('0x85')]=function(_0x36587c,_0x4159ac,_0x340bf5){if(_0x36587c[_0x48d4('0x58')]['id']){delete _0x36587c[_0x48d4('0x58')]['id'];}return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x36587c[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x4159ac,null))['then'](function(_0x158f0e){if(_0x158f0e){_0x36587c['body'][_0x48d4('0x5c')]=_0x158f0e['id'];return db[_0x48d4('0x3c')][_0x48d4('0x6a')](_0x36587c['body']);}})[_0x48d4('0x20')](respondWithResult(_0x4159ac,null))['catch'](handleError(_0x4159ac,null));};exports[_0x48d4('0x86')]=function(_0x561985,_0x2dbc1e,_0x1719d8){return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x561985[_0x48d4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2dbc1e,null))[_0x48d4('0x20')](function(_0x37f2df){if(_0x37f2df){return _0x37f2df['setSmtp'](null);}return null;})[_0x48d4('0x20')](respondWithStatusCode(_0x2dbc1e,null))[_0x48d4('0x29')](handleError(_0x2dbc1e,null));};exports[_0x48d4('0x87')]=function(_0x244dab,_0x241245,_0x3c32e2){return db[_0x48d4('0x88')][_0x48d4('0x57')]({'where':{'id':_0x244dab[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x241245,null))[_0x48d4('0x20')](function(_0x1e53c1){if(_0x1e53c1){return _0x1e53c1[_0x48d4('0x87')](_0x244dab[_0x48d4('0x58')]['ids'],_[_0x48d4('0x89')](_0x244dab['body'],[_0x48d4('0x65'),'id'])||{});}})[_0x48d4('0x20')](respondWithResult(_0x241245,null))[_0x48d4('0x29')](handleError(_0x241245,null));};exports[_0x48d4('0x8a')]=function(_0x4dd4b8,_0x385927,_0x54d12d){var _0x5ca949={'raw':![],'where':{}};var _0x330a42={};var _0x197d0e={'count':0x0,'rows':[]};return db['MailAccount'][_0x48d4('0x5f')]({'where':{'id':_0x4dd4b8[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x385927,null))[_0x48d4('0x20')](function(_0x5b030a){if(_0x5b030a){_0x330a42['model']=_[_0x48d4('0x54')](db[_0x48d4('0x88')][_0x48d4('0x42')]);_0x330a42[_0x48d4('0x46')]=_[_0x48d4('0x54')](_0x4dd4b8[_0x48d4('0x46')]);_0x330a42[_0x48d4('0x4d')]=_[_0x48d4('0x47')](_0x330a42[_0x48d4('0x45')],_0x330a42[_0x48d4('0x46')]);_0x5ca949[_0x48d4('0x48')]=_['intersection'](_0x330a42['model'],qs[_0x48d4('0x49')](_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x49')]));_0x5ca949[_0x48d4('0x48')]=_0x5ca949[_0x48d4('0x48')][_0x48d4('0x55')]?_0x5ca949['attributes']:_0x330a42[_0x48d4('0x45')];if(!_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x60')]('nolimit')){_0x5ca949['limit']=qs[_0x48d4('0x2e')](_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x2e')]);_0x5ca949[_0x48d4('0x31')]=qs[_0x48d4('0x31')](_0x4dd4b8['query'][_0x48d4('0x31')]);}_0x5ca949[_0x48d4('0x4b')]=qs[_0x48d4('0x61')](_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x61')]);_0x5ca949['where']=qs[_0x48d4('0x4d')](_[_0x48d4('0x62')](_0x4dd4b8['query'],_0x330a42[_0x48d4('0x4d')]));_0x5ca949[_0x48d4('0x4c')]['MailAccountId']=_0x5b030a['id'];if(_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x5ca949[_0x48d4('0x4c')]=_[_0x48d4('0x56')](_0x5ca949[_0x48d4('0x4c')],{'$or':_[_0x48d4('0x40')](_0x5ca949[_0x48d4('0x48')],function(_0x4411fa){var _0x5f35a7={};_0x5f35a7[_0x4411fa]={'$like':'%'+_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x4e')]+'%'};return _0x5f35a7;})});}_0x5ca949=_[_0x48d4('0x56')]({},_0x5ca949,_0x4dd4b8[_0x48d4('0x50')]);return db[_0x48d4('0x88')]['count']({'where':_0x5ca949[_0x48d4('0x4c')]})[_0x48d4('0x20')](function(_0x4d8177){_0x197d0e['count']=_0x4d8177;if(_0x4dd4b8[_0x48d4('0x46')]['includeAll']){_0x5ca949['include']=[{'model':db[_0x48d4('0x8b')],'as':_0x48d4('0x8c'),'required':![]},{'model':db[_0x48d4('0x8d')],'as':_0x48d4('0x8e'),'attributes':[_0x48d4('0x39'),_0x48d4('0x8f'),_0x48d4('0x90')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x48d4('0x91')],'where':_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x92')]?{'id':_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x92')]}:undefined,'required':_0x4dd4b8[_0x48d4('0x46')][_0x48d4('0x92')]?!![]:![]}];}return db[_0x48d4('0x88')][_0x48d4('0x53')](_0x5ca949);})[_0x48d4('0x20')](function(_0x53c1f6){_0x197d0e[_0x48d4('0x63')]=_0x53c1f6;return _0x197d0e;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x385927,_0x5ca949))[_0x48d4('0x29')](handleError(_0x385927,null));};exports[_0x48d4('0x93')]=function addApplications(_0x44d39f,_0x1c7d45){var _0x35c4d2=_0x44d39f['params']['id'];var _0x1b0c50=_0x44d39f[_0x48d4('0x58')];var _0x544940=0xc8;var _0x4c8e65=null;return db['sequelize'][_0x48d4('0x94')]({'isolationLevel':db['sequelize'][_0x48d4('0x95')]['ISOLATION_LEVELS'][_0x48d4('0x96')]},function(_0x32ece3){return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x35c4d2},'transaction':_0x32ece3})[_0x48d4('0x20')](function(_0x28ab76){if(_0x28ab76){return db[_0x48d4('0x97')][_0x48d4('0x37')]({'where':{'MailAccountId':_0x35c4d2},'transaction':_0x32ece3})['then'](function(){var _0x25d7fb=_[_0x48d4('0x40')](_0x1b0c50,function(_0x36b482){_0x36b482[_0x48d4('0x5c')]=_0x35c4d2;return _0x36b482;});return db[_0x48d4('0x97')]['bulkCreate'](_0x25d7fb,{'transaction':_0x32ece3});});}else{_0x544940=0x194;_0x4c8e65=[];}});})[_0x48d4('0x20')](function(){if(_0x544940!==0x194){return db[_0x48d4('0x97')][_0x48d4('0x98')]({'where':{'MailAccountId':_0x35c4d2},'order':_0x48d4('0x99')})[_0x48d4('0x20')](function(_0x54eb25){_0x4c8e65=_0x54eb25;});}})[_0x48d4('0x29')](function(_0x33f61a){_0x544940=0x1f4;logger[_0x48d4('0x26')](_0x33f61a['stack']);if(_0x33f61a[_0x48d4('0x39')]){delete _0x33f61a[_0x48d4('0x39')];}_0x4c8e65=_0x33f61a;})[_0x48d4('0x9a')](function(){if(_0x4c8e65===null){_0x1c7d45[_0x48d4('0x2a')](_0x544940);}else{if(_0x544940===0x1f4){_0x1c7d45[_0x48d4('0x2b')](_0x544940)[_0x48d4('0x3a')](_0x4c8e65);}else{_0x1c7d45['status'](_0x544940)[_0x48d4('0x2d')](_0x4c8e65);}}});};exports[_0x48d4('0x9b')]=function(_0x383c82,_0x3966b4,_0x37d460){var _0x4e0f9b={};var _0x56fafa={};var _0xc57e15;var _0xc9ab68;return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x383c82[_0x48d4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3966b4,null))[_0x48d4('0x20')](function(_0x59db24){if(_0x59db24){_0xc57e15=_0x59db24;_0x56fafa[_0x48d4('0x45')]=_[_0x48d4('0x54')](db['MailApplication'][_0x48d4('0x42')]);_0x56fafa[_0x48d4('0x46')]=_[_0x48d4('0x54')](_0x383c82['query']);_0x56fafa[_0x48d4('0x4d')]=_['intersection'](_0x56fafa['model'],_0x56fafa['query']);_0x4e0f9b[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x56fafa[_0x48d4('0x45')],qs[_0x48d4('0x49')](_0x383c82[_0x48d4('0x46')][_0x48d4('0x49')]));_0x4e0f9b[_0x48d4('0x48')]=_0x4e0f9b['attributes']['length']?_0x4e0f9b[_0x48d4('0x48')]:_0x56fafa[_0x48d4('0x45')];_0x4e0f9b[_0x48d4('0x4b')]=qs['sort'](_0x383c82['query'][_0x48d4('0x61')]);_0x4e0f9b[_0x48d4('0x4c')]=qs['filters'](_[_0x48d4('0x62')](_0x383c82[_0x48d4('0x46')],_0x56fafa[_0x48d4('0x4d')]));if(_0x383c82[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x4e0f9b[_0x48d4('0x4c')]=_[_0x48d4('0x56')](_0x4e0f9b['where'],{'$or':_[_0x48d4('0x40')](_0x4e0f9b['attributes'],function(_0x403819){var _0x3c4514={};_0x3c4514[_0x403819]={'$like':'%'+_0x383c82[_0x48d4('0x46')]['filter']+'%'};return _0x3c4514;})});}_0x4e0f9b=_[_0x48d4('0x56')]({},_0x4e0f9b,_0x383c82[_0x48d4('0x50')]);return _0xc57e15[_0x48d4('0x9b')](_0x4e0f9b);}})[_0x48d4('0x20')](function(_0x330fa4){if(_0x330fa4){_0xc9ab68=_0x330fa4[_0x48d4('0x55')];if(!_0x383c82['query'][_0x48d4('0x60')](_0x48d4('0x4a'))){_0x4e0f9b['limit']=qs[_0x48d4('0x2e')](_0x383c82[_0x48d4('0x46')]['limit']);_0x4e0f9b[_0x48d4('0x31')]=qs['offset'](_0x383c82[_0x48d4('0x46')][_0x48d4('0x31')]);}return _0xc57e15[_0x48d4('0x9b')](_0x4e0f9b);}})[_0x48d4('0x20')](function(_0x5682e0){if(_0x5682e0){return _0x5682e0?{'count':_0xc9ab68,'rows':_0x5682e0}:null;}})[_0x48d4('0x20')](respondWithResult(_0x3966b4,null))['catch'](handleError(_0x3966b4,null));};exports['getMessages']=function(_0x1dd407,_0x4ad2cc,_0x5c148a){var _0x3cfbc2={'raw':!![],'where':{}};var _0x221fde={};var _0x188b17={'count':0x0,'rows':[]};return db[_0x48d4('0x41')][_0x48d4('0x5f')]({'where':{'id':_0x1dd407['params']['id']}})['then'](handleEntityNotFound(_0x4ad2cc,null))['then'](function(_0x4c4c7b){if(_0x4c4c7b){_0x221fde['model']=_[_0x48d4('0x54')](db['MailMessage'][_0x48d4('0x42')]);_0x221fde[_0x48d4('0x46')]=_[_0x48d4('0x54')](_0x1dd407[_0x48d4('0x46')]);_0x221fde[_0x48d4('0x4d')]=_[_0x48d4('0x47')](_0x221fde[_0x48d4('0x45')],_0x221fde[_0x48d4('0x46')]);_0x3cfbc2[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x221fde[_0x48d4('0x45')],qs[_0x48d4('0x49')](_0x1dd407[_0x48d4('0x46')][_0x48d4('0x49')]));_0x3cfbc2[_0x48d4('0x48')]=_0x3cfbc2[_0x48d4('0x48')]['length']?_0x3cfbc2[_0x48d4('0x48')]:_0x221fde['model'];if(!_0x1dd407[_0x48d4('0x46')][_0x48d4('0x60')](_0x48d4('0x4a'))){_0x3cfbc2[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x1dd407[_0x48d4('0x46')][_0x48d4('0x2e')]);_0x3cfbc2[_0x48d4('0x31')]=qs[_0x48d4('0x31')](_0x1dd407[_0x48d4('0x46')][_0x48d4('0x31')]);}_0x3cfbc2[_0x48d4('0x4b')]=qs[_0x48d4('0x61')](_0x1dd407[_0x48d4('0x46')][_0x48d4('0x61')]);_0x3cfbc2['where']=qs[_0x48d4('0x4d')](_[_0x48d4('0x62')](_0x1dd407[_0x48d4('0x46')],_0x221fde[_0x48d4('0x4d')]));_0x3cfbc2[_0x48d4('0x4c')][_0x48d4('0x5c')]=_0x4c4c7b['id'];if(_0x1dd407[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x3cfbc2[_0x48d4('0x4c')]=_['merge'](_0x3cfbc2['where'],{'$or':_[_0x48d4('0x40')](_0x3cfbc2['attributes'],function(_0x1c0cf3){var _0xf2b3f5={};_0xf2b3f5[_0x1c0cf3]={'$like':'%'+_0x1dd407[_0x48d4('0x46')][_0x48d4('0x4e')]+'%'};return _0xf2b3f5;})});}if(_0x1dd407[_0x48d4('0x46')][_0x48d4('0x9c')]){var _0x3c14ba=_0x1dd407[_0x48d4('0x46')][_0x48d4('0x9c')]['split'](',');var _0x2c97b7={};_0x2c97b7[_0x3c14ba[0x0]]={'$gte':moment(_0x3c14ba[0x1])[_0x48d4('0x9d')](_0x48d4('0x9e'))};_0x3cfbc2[_0x48d4('0x4c')]=_[_0x48d4('0x56')](_0x3cfbc2[_0x48d4('0x4c')],_0x2c97b7);}_0x3cfbc2=_[_0x48d4('0x56')]({},_0x3cfbc2,_0x1dd407['options']);return db[_0x48d4('0x9f')][_0x48d4('0x30')]({'where':_0x3cfbc2[_0x48d4('0x4c')]})[_0x48d4('0x20')](function(_0x4b04ad){_0x188b17[_0x48d4('0x30')]=_0x4b04ad;if(_0x1dd407[_0x48d4('0x46')]['includeAll']){_0x3cfbc2[_0x48d4('0x52')]=[{'all':!![]}];}return db[_0x48d4('0x9f')][_0x48d4('0x53')](_0x3cfbc2);})['then'](function(_0x58375b){if(_0x1dd407[_0x48d4('0x46')][_0x48d4('0xa0')]==='true'){for(var _0x53fa03=0x0;_0x53fa03<_0x58375b[_0x48d4('0x55')];_0x53fa03++){_0x58375b[_0x53fa03][_0x48d4('0x58')]=juice(_0x58375b[_0x53fa03][_0x48d4('0x58')]);}}_0x188b17[_0x48d4('0x63')]=_0x58375b;return _0x188b17;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x4ad2cc,_0x3cfbc2))[_0x48d4('0x29')](handleError(_0x4ad2cc,null));};exports[_0x48d4('0x3a')]=function(_0x4260e2,_0x3f00e7,_0x481c9a){var _0x1b66e0,_0x5c9a06={},_0x2f259f;if(_0x4260e2[_0x48d4('0x58')]['to']){_0x2f259f=_0x4260e2['body']['to'][_0x48d4('0xa1')](',')[0x0];}return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x4260e2[_0x48d4('0x5b')]['id']},'include':[{'model':db[_0x48d4('0xa2')],'as':'List','include':[{'model':db[_0x48d4('0x8b')],'as':_0x48d4('0xa3'),'where':{'email':_0x2f259f},'limit':0x1,'order':[[_0x48d4('0xa4'),_0x48d4('0xa5')]]}]},{'model':db[_0x48d4('0x3c')],'as':_0x48d4('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x3f00e7,null))[_0x48d4('0x20')](function(_0x45c952){if(_0x45c952){_0x1b66e0=_0x45c952;if(_0x45c952[_0x48d4('0x3d')]){if(_[_0x48d4('0x6d')](_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa6')])){_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa6')]=util[_0x48d4('0x9d')](_0x48d4('0xa7'),_0x45c952[_0x48d4('0x39')],_0x45c952['email']||_0x45c952[_0x48d4('0x3d')][_0x48d4('0x72')]);}if(_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa8')]&&_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa8')][_0x48d4('0x55')]){for(var _0x5cefe1=0x0;_0x5cefe1<_0x4260e2['body'][_0x48d4('0xa8')][_0x48d4('0x55')];_0x5cefe1+=0x1){_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa8')][_0x5cefe1]={'filename':_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa8')][_0x5cefe1][_0x48d4('0x39')],'path':path[_0x48d4('0xa9')](config[_0x48d4('0xaa')],_0x48d4('0xab'),_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa8')][_0x5cefe1][_0x48d4('0xac')])};}}var _0x1c9227={'tls':{'rejectUnauthorized':![]}};if(_[_0x48d4('0x6d')](_0x45c952[_0x48d4('0x3d')][_0x48d4('0x79')])){if(_0x45c952['Smtp'][_0x48d4('0x76')]){_0x1c9227[_0x48d4('0xad')]={'user':_0x45c952['Smtp'][_0x48d4('0x72')],'pass':_0x45c952[_0x48d4('0x3d')][_0x48d4('0x74')]};}_0x1c9227['host']=_0x45c952[_0x48d4('0x3d')][_0x48d4('0x77')];_0x1c9227[_0x48d4('0x78')]=_0x45c952[_0x48d4('0x3d')][_0x48d4('0x78')];_0x1c9227[_0x48d4('0xae')]=_0x45c952['Smtp'][_0x48d4('0xae')];}else{_0x1c9227[_0x48d4('0x79')]=_0x45c952[_0x48d4('0x3d')][_0x48d4('0x79')];_0x1c9227['auth']={'user':_0x45c952[_0x48d4('0x3d')]['user'],'pass':_0x45c952[_0x48d4('0x3d')][_0x48d4('0x74')]};}return respondWithRpcPromise(_0x48d4('0xaf'),'sendMail',{'account':_0x1c9227,'message':_0x4260e2[_0x48d4('0x58')]});}else{throw new Error(_0x48d4('0xb0'));}}})[_0x48d4('0x20')](function(_0x3a4d6f){if(_0x3a4d6f){_0x5c9a06=_0x3a4d6f;if(_0x1b66e0[_0x48d4('0xb1')]){if(_0x1b66e0[_0x48d4('0xb1')][_0x48d4('0xa3')][_0x48d4('0x55')]){return _0x1b66e0[_0x48d4('0xb1')][_0x48d4('0xa3')][0x0];}else{return db[_0x48d4('0x8b')][_0x48d4('0x6a')](_[_0x48d4('0x1a')](_0x4260e2[_0x48d4('0x58')],{'firstName':_0x4260e2[_0x48d4('0x58')]['to'],'email':_0x4260e2[_0x48d4('0x58')]['to'],'phone':_0x4260e2[_0x48d4('0x58')]['to'],'ListId':_0x1b66e0[_0x48d4('0x6c')]}));}}else{throw new Error(_0x48d4('0xb0'));}}})[_0x48d4('0x20')](function(_0x545037){if(_0x545037){var _0x5bae7f={'UserId':_0x4260e2[_0x48d4('0x72')]['id'],'ContactId':_0x545037['id'],'MailAccountId':_0x1b66e0['id'],'inReplyTo':_0x5c9a06['messageId'],'to':_0x4260e2[_0x48d4('0x58')][_0x48d4('0xa6')],'cc':_0x4260e2['body']['cc'],'subject':_0x4260e2[_0x48d4('0x58')][_0x48d4('0xb2')],'attach':_0x4260e2[_0x48d4('0x58')][_0x48d4('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x48d4('0x9d')](_0x48d4('0x9e')),'lastMsgDirection':_0x48d4('0xb4'),'Messages':[_['merge'](_0x4260e2[_0x48d4('0x58')],{'messageId':_0x5c9a06['messageId'],'sentAt':moment()[_0x48d4('0x9d')](_0x48d4('0x9e')),'read':!![],'MailAccountId':_0x1b66e0['id'],'UserId':_0x4260e2[_0x48d4('0x72')]['id'],'ContactId':_0x545037['id']})]};if(_0x4260e2['body'][_0x48d4('0xb5')]){_0x5bae7f=_['merge'](_0x5bae7f,_0x4260e2['body'][_0x48d4('0xb5')]);}return db[_0x48d4('0x88')]['create'](_0x5bae7f,{'include':[{'model':db[_0x48d4('0x9f')],'as':_0x48d4('0xb6')}]});}})[_0x48d4('0x20')](respondWithResult(_0x3f00e7,null))[_0x48d4('0x29')](handleError(_0x3f00e7,null));};exports[_0x48d4('0xb7')]=function(_0x170883,_0x3e909b,_0x3dfe16){return db['MailAccount'][_0x48d4('0x57')]({'where':{'id':_0x170883[_0x48d4('0x5b')]['id']},'include':[{'model':db[_0x48d4('0x3c')],'as':_0x48d4('0x3d'),'raw':!![]}]})[_0x48d4('0x20')](handleEntityNotFound(_0x3e909b,null))[_0x48d4('0x20')](function(_0x54a231){if(_0x54a231&&_0x54a231[_0x48d4('0x3d')]){var _0x3f1462={'id':_0x54a231['id'],'tls':{'rejectUnauthorized':![]}};if(_0x54a231[_0x48d4('0x3d')][_0x48d4('0x79')]){_0x3f1462[_0x48d4('0x79')]=_0x54a231[_0x48d4('0x3d')]['service'];}else{_0x3f1462[_0x48d4('0x77')]=_0x54a231[_0x48d4('0x3d')][_0x48d4('0x77')];_0x3f1462[_0x48d4('0x78')]=_0x54a231[_0x48d4('0x3d')][_0x48d4('0x78')];_0x3f1462[_0x48d4('0xae')]=_0x54a231[_0x48d4('0x3d')][_0x48d4('0xae')];}if(_0x54a231[_0x48d4('0x3d')][_0x48d4('0x76')]){_0x3f1462[_0x48d4('0xad')]={'user':_0x54a231[_0x48d4('0x3d')][_0x48d4('0x72')],'pass':_0x54a231['Smtp'][_0x48d4('0x74')]};}return respondWithRpcPromise(_0x48d4('0xb8'),_0x48d4('0xb7'),{'account':_0x3f1462});}})[_0x48d4('0x20')](respondWithResult(_0x3e909b,null))[_0x48d4('0x29')](handleError(_0x3e909b,null));};exports[_0x48d4('0x37')]=function(_0x5bdd8d,_0x56b4a9){return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x5bdd8d[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x56b4a9,null))[_0x48d4('0x20')](function(_0x5c23d3){if(_0x5c23d3&&_0x5c23d3[_0x48d4('0x79')]){throw new db[(_0x48d4('0xb9'))][(_0x48d4('0xba'))](_0x48d4('0xbb'));}return _0x5c23d3;})[_0x48d4('0x20')](removeEntity(_0x56b4a9,null))[_0x48d4('0x29')](handleError(_0x56b4a9,null));};exports[_0x48d4('0xbc')]=function(_0x1daa39,_0x4eb325,_0x5049c1){return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x1daa39['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x4eb325,null))['then'](function(_0x5815c7){if(_0x5815c7){return _0x5815c7[_0x48d4('0xbc')](_0x1daa39[_0x48d4('0x58')][_0x48d4('0x65')],_[_0x48d4('0x89')](_0x1daa39['body'],[_0x48d4('0x65'),'id'])||{})[_0x48d4('0xbd')](function(_0x5ca628){for(var _0x42171e=0x0;_0x42171e<_0x1daa39[_0x48d4('0x58')][_0x48d4('0x65')][_0x48d4('0x55')];_0x42171e+=0x1){socket[_0x48d4('0xbe')]('userMailAccount:save',{'UserId':Number(_0x1daa39['body'][_0x48d4('0x65')][_0x42171e]),'MailAccountId':Number(_0x1daa39[_0x48d4('0x5b')]['id'])});}return _0x5ca628;});}})['then'](respondWithResult(_0x4eb325,null))[_0x48d4('0x29')](handleError(_0x4eb325,null));};exports[_0x48d4('0xbf')]=function(_0x1a7a8a,_0x4345e5,_0x4ef015){return db[_0x48d4('0x41')][_0x48d4('0x57')]({'where':{'id':_0x1a7a8a[_0x48d4('0x5b')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x4345e5,null))[_0x48d4('0x20')](function(_0x3f041b){if(_0x3f041b){return _0x3f041b[_0x48d4('0xbf')](_0x1a7a8a[_0x48d4('0x46')][_0x48d4('0x65')])['then'](function(){if(_[_0x48d4('0xc0')](_0x1a7a8a[_0x48d4('0x46')][_0x48d4('0x65')])){for(var _0x5c7b6d=0x0;_0x5c7b6d<_0x1a7a8a[_0x48d4('0x46')]['ids'][_0x48d4('0x55')];_0x5c7b6d+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x1a7a8a[_0x48d4('0x46')][_0x48d4('0x65')][_0x5c7b6d]),'MailAccountId':Number(_0x1a7a8a[_0x48d4('0x5b')]['id'])});}}else{socket[_0x48d4('0xbe')](_0x48d4('0xc1'),{'UserId':Number(_0x1a7a8a[_0x48d4('0x46')][_0x48d4('0x65')]),'MailAccountId':Number(_0x1a7a8a[_0x48d4('0x5b')]['id'])});}});}})[_0x48d4('0x20')](respondWithStatusCode(_0x4345e5,null))[_0x48d4('0x29')](handleError(_0x4345e5,null));};exports[_0x48d4('0xc2')]=function(_0x470e98,_0x444d0f,_0x5ee017){var _0x1351ec={};var _0x2f58ab={};var _0x419447;var _0x1d505e;return db[_0x48d4('0x41')]['findOne']({'where':{'id':_0x470e98['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x444d0f,null))[_0x48d4('0x20')](function(_0x5228cb){if(_0x5228cb){_0x419447=_0x5228cb;_0x2f58ab[_0x48d4('0x45')]=_[_0x48d4('0x54')](db[_0x48d4('0x8d')][_0x48d4('0x42')]);_0x2f58ab['query']=_[_0x48d4('0x54')](_0x470e98[_0x48d4('0x46')]);_0x2f58ab['filters']=_[_0x48d4('0x47')](_0x2f58ab[_0x48d4('0x45')],_0x2f58ab[_0x48d4('0x46')]);_0x1351ec[_0x48d4('0x48')]=_[_0x48d4('0x47')](_0x2f58ab[_0x48d4('0x45')],qs[_0x48d4('0x49')](_0x470e98['query'][_0x48d4('0x49')]));_0x1351ec[_0x48d4('0x48')]=_0x1351ec[_0x48d4('0x48')][_0x48d4('0x55')]?_0x1351ec['attributes']:_0x2f58ab[_0x48d4('0x45')];_0x1351ec[_0x48d4('0x4b')]=qs[_0x48d4('0x61')](_0x470e98[_0x48d4('0x46')][_0x48d4('0x61')]);_0x1351ec[_0x48d4('0x4c')]=qs[_0x48d4('0x4d')](_[_0x48d4('0x62')](_0x470e98[_0x48d4('0x46')],_0x2f58ab[_0x48d4('0x4d')]));if(_0x470e98[_0x48d4('0x46')][_0x48d4('0x4e')]){_0x1351ec[_0x48d4('0x4c')]=_[_0x48d4('0x56')](_0x1351ec['where'],{'$or':_['map'](_0x1351ec['attributes'],function(_0x123f1d){var _0x31695d={};_0x31695d[_0x123f1d]={'$like':'%'+_0x470e98['query']['filter']+'%'};return _0x31695d;})});}_0x1351ec=_[_0x48d4('0x56')]({},_0x1351ec,_0x470e98[_0x48d4('0x50')]);return _0x419447[_0x48d4('0xc2')](_0x1351ec);}})[_0x48d4('0x20')](function(_0x3bbc12){if(_0x3bbc12){_0x1d505e=_0x3bbc12['length'];if(!_0x470e98[_0x48d4('0x46')][_0x48d4('0x60')](_0x48d4('0x4a'))){_0x1351ec['limit']=qs[_0x48d4('0x2e')](_0x470e98[_0x48d4('0x46')]['limit']);_0x1351ec[_0x48d4('0x31')]=qs[_0x48d4('0x31')](_0x470e98[_0x48d4('0x46')]['offset']);}return _0x419447['getAgents'](_0x1351ec);}})[_0x48d4('0x20')](function(_0x391eb3){if(_0x391eb3){return _0x391eb3?{'count':_0x1d505e,'rows':_0x391eb3}:null;}})[_0x48d4('0x20')](respondWithResult(_0x444d0f,null))['catch'](handleError(_0x444d0f,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5d2edcd..2d3a2cd 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 _0x18b2=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount'];(function(_0x5de1ae,_0x541b75){var _0x2d5b6f=function(_0x4ce2ae){while(--_0x4ce2ae){_0x5de1ae['push'](_0x5de1ae['shift']());}};_0x2d5b6f(++_0x541b75);}(_0x18b2,0x85));var _0x218b=function(_0x34e6ff,_0x247ffb){_0x34e6ff=_0x34e6ff-0x0;var _0x3bf027=_0x18b2[_0x34e6ff];return _0x3bf027;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x218b('0x0'))['db'][_0x218b('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x218b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x218b('0x3'),'afterDestroy':_0x218b('0x4')};function emitEvent(_0x3f15c3){return function(_0x3ffe21,_0xb6f819,_0x452eb6){MailAccountEvents[_0x218b('0x5')](_0x3f15c3+':'+_0x3ffe21['id'],_0x3ffe21);MailAccountEvents[_0x218b('0x5')](_0x3f15c3,_0x3ffe21);_0x452eb6(null);};}for(var e in events){if(events[_0x218b('0x6')](e)){var event=events[e];MailAccount[_0x218b('0x7')](e,emitEvent(event));}}module[_0x218b('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x75dd=['MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5a2f49,_0x347618){var _0x394961=function(_0x257bff){while(--_0x257bff){_0x5a2f49['push'](_0x5a2f49['shift']());}};_0x394961(++_0x347618);}(_0x75dd,0x1c9));var _0xd75d=function(_0x507ba3,_0x5a327a){_0x507ba3=_0x507ba3-0x0;var _0x3ea33c=_0x75dd[_0x507ba3];return _0x3ea33c;};'use strict';var EventEmitter=require(_0xd75d('0x0'));var MailAccount=require(_0xd75d('0x1'))['db'][_0xd75d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd75d('0x3')](0x0);var events={'afterCreate':_0xd75d('0x4'),'afterUpdate':_0xd75d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x8515ac){return function(_0x1db51b,_0x468082,_0xcb99e){MailAccountEvents[_0xd75d('0x6')](_0x8515ac+':'+_0x1db51b['id'],_0x1db51b);MailAccountEvents[_0xd75d('0x6')](_0x8515ac,_0x1db51b);_0xcb99e(null);};}for(var e in events){if(events[_0xd75d('0x7')](e)){var event=events[e];MailAccount[_0xd75d('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c717c1c..98ba840 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 _0x6503=['path','rimraf','../../config/environment','define','MailAccount','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x474f2c,_0x5d8ae3){var _0x58593a=function(_0x248645){while(--_0x248645){_0x474f2c['push'](_0x474f2c['shift']());}};_0x58593a(++_0x5d8ae3);}(_0x6503,0x144));var _0x3650=function(_0x166d4d,_0x2eb94f){_0x166d4d=_0x166d4d-0x0;var _0x1d1ee2=_0x6503[_0x166d4d];return _0x1d1ee2;};'use strict';var _=require('lodash');var util=require(_0x3650('0x0'));var logger=require(_0x3650('0x1'))(_0x3650('0x2'));var moment=require(_0x3650('0x3'));var BPromise=require(_0x3650('0x4'));var rp=require(_0x3650('0x5'));var fs=require('fs');var path=require(_0x3650('0x6'));var rimraf=require(_0x3650('0x7'));var config=require(_0x3650('0x8'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x501ff5,_0x2a3d06){return _0x501ff5[_0x3650('0x9')](_0x3650('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x035c=['mail_accounts','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x035c,0x1bd));var _0xc035=function(_0x57b9ff,_0xf5ee59){_0x57b9ff=_0x57b9ff-0x0;var _0x3f8962=_0x035c[_0x57b9ff];return _0x3f8962;};'use strict';var _=require(_0xc035('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc035('0x1'));var moment=require(_0xc035('0x2'));var BPromise=require(_0xc035('0x3'));var rp=require(_0xc035('0x4'));var fs=require('fs');var path=require(_0xc035('0x5'));var rimraf=require('rimraf');var config=require(_0xc035('0x6'));var attributes=require(_0xc035('0x7'));module[_0xc035('0x8')]=function(_0x3c7f2d,_0x474774){return _0x3c7f2d[_0xc035('0x9')](_0xc035('0xa'),attributes,{'tableName':_0xc035('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 0222012..170e651 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 _0xcad8=['contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','attach','interaction','created','create','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','name','startRouting','Start','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowMailAccount','find','body','mail','difference','keys','CmContact','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','MailApplication','MailServerOut','List','get','Applications','list','applications','asc','push','length','close','autoclose','*,*,*,*','from','List\x20not\x20found'];(function(_0x23650f,_0x2fe018){var _0x5e3b92=function(_0x5b67ea){while(--_0x5b67ea){_0x23650f['push'](_0x23650f['shift']());}};_0x5e3b92(++_0x2fe018);}(_0xcad8,0x7b));var _0x8cad=function(_0x275996,_0x2315a8){_0x275996=_0x275996-0x0;var _0xd69fd3=_0xcad8[_0x275996];return _0xd69fd3;};'use strict';var _=require(_0x8cad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cad('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cad('0x2'));var logger=require(_0x8cad('0x3'))(_0x8cad('0x4'));var config=require(_0x8cad('0x5'));var jayson=require(_0x8cad('0x6'));var client=jayson['client'][_0x8cad('0x7')]({'port':0x232c});config[_0x8cad('0x8')]=_['defaults'](config[_0x8cad('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cad('0x9'))(new Redis(config[_0x8cad('0x8')]));require(_0x8cad('0xa'))[_0x8cad('0xb')](socket);function respondWithRpcPromise(_0x4aa09b,_0x2f8772,_0x1da497){return new BPromise(function(_0x439305,_0x57960f){return client[_0x8cad('0xc')](_0x4aa09b,_0x1da497)[_0x8cad('0xd')](function(_0x228025){logger[_0x8cad('0xe')](_0x8cad('0xf'),_0x2f8772,_0x8cad('0x10'));logger[_0x8cad('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2f8772,_0x8cad('0x10'),JSON[_0x8cad('0x12')](_0x228025));if(_0x228025[_0x8cad('0x13')]){if(_0x228025[_0x8cad('0x13')][_0x8cad('0x14')]===0x1f4){logger[_0x8cad('0x13')](_0x8cad('0xf'),_0x2f8772,_0x228025[_0x8cad('0x13')][_0x8cad('0x15')]);return _0x57960f(_0x228025[_0x8cad('0x13')][_0x8cad('0x15')]);}logger['error'](_0x8cad('0xf'),_0x2f8772,_0x228025[_0x8cad('0x13')]['message']);return _0x439305(_0x228025[_0x8cad('0x13')][_0x8cad('0x15')]);}else{logger[_0x8cad('0xe')]('MailAccount,\x20%s,\x20%s',_0x2f8772,_0x8cad('0x10'));_0x439305(_0x228025[_0x8cad('0x16')]['message']);}})[_0x8cad('0x17')](function(_0x2dbd95){logger[_0x8cad('0x13')](_0x8cad('0xf'),_0x2f8772,_0x2dbd95);_0x57960f(_0x2dbd95);});});}exports[_0x8cad('0x18')]=function(_0x19905e){var _0x2cef49=this;return new Promise(function(_0x597c69,_0x2398f2){return db[_0x8cad('0x19')][_0x8cad('0x1a')]({'raw':_0x19905e[_0x8cad('0x1b')]?_0x19905e[_0x8cad('0x1b')][_0x8cad('0x1c')]===undefined?!![]:![]:!![],'where':_0x19905e[_0x8cad('0x1b')]?_0x19905e[_0x8cad('0x1b')][_0x8cad('0x1d')]||null:null,'attributes':_0x19905e[_0x8cad('0x1b')]?_0x19905e[_0x8cad('0x1b')][_0x8cad('0x1e')]||null:null,'limit':_0x19905e[_0x8cad('0x1b')]?_0x19905e[_0x8cad('0x1b')][_0x8cad('0x1f')]||null:null,'include':_0x19905e['options']?_0x19905e[_0x8cad('0x1b')]['include']?_[_0x8cad('0x20')](_0x19905e[_0x8cad('0x1b')][_0x8cad('0x21')],function(_0x492ee0){return{'model':db[_0x492ee0[_0x8cad('0x22')]],'as':_0x492ee0['as'],'attributes':_0x492ee0['attributes'],'include':_0x492ee0[_0x8cad('0x21')]?_['map'](_0x492ee0[_0x8cad('0x21')],function(_0x4d352f){return{'model':db[_0x4d352f[_0x8cad('0x22')]],'as':_0x4d352f['as'],'attributes':_0x4d352f[_0x8cad('0x1e')],'include':_0x4d352f[_0x8cad('0x21')]?_[_0x8cad('0x20')](_0x4d352f[_0x8cad('0x21')],function(_0x13d3f9){return{'model':db[_0x13d3f9[_0x8cad('0x22')]],'as':_0x13d3f9['as'],'attributes':_0x13d3f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cad('0xd')](function(_0x257ac9){logger[_0x8cad('0xe')](_0x8cad('0x18'),_0x19905e);logger[_0x8cad('0x11')](_0x8cad('0x18'),_0x19905e,JSON[_0x8cad('0x12')](_0x257ac9));_0x597c69(_0x257ac9);})[_0x8cad('0x17')](function(_0x59f40c){logger['error'](_0x8cad('0x18'),_0x59f40c[_0x8cad('0x15')],_0x19905e);_0x2398f2(_0x2cef49['error'](0x1f4,_0x59f40c[_0x8cad('0x15')]));});});};exports[_0x8cad('0x23')]=function(_0x33f277){var _0x85586d=this;return new Promise(function(_0x2c43e1,_0x4ae19b){return db['MailAccount'][_0x8cad('0x24')]({'raw':_0x33f277[_0x8cad('0x1b')]?_0x33f277[_0x8cad('0x1b')][_0x8cad('0x1c')]===undefined?!![]:![]:!![],'where':_0x33f277[_0x8cad('0x1b')]?_0x33f277[_0x8cad('0x1b')]['where']||null:null,'attributes':_0x33f277[_0x8cad('0x1b')]?_0x33f277[_0x8cad('0x1b')][_0x8cad('0x1e')]||null:null,'include':_0x33f277[_0x8cad('0x1b')]?_0x33f277[_0x8cad('0x1b')][_0x8cad('0x21')]?_[_0x8cad('0x20')](_0x33f277[_0x8cad('0x1b')][_0x8cad('0x21')],function(_0x32b1eb){return{'model':db[_0x32b1eb[_0x8cad('0x22')]],'as':_0x32b1eb['as'],'attributes':_0x32b1eb['attributes'],'include':_0x32b1eb[_0x8cad('0x21')]?_[_0x8cad('0x20')](_0x32b1eb[_0x8cad('0x21')],function(_0x213972){return{'model':db[_0x213972['model']],'as':_0x213972['as'],'attributes':_0x213972[_0x8cad('0x1e')],'include':_0x213972['include']?_[_0x8cad('0x20')](_0x213972[_0x8cad('0x21')],function(_0x199379){return{'model':db[_0x199379[_0x8cad('0x22')]],'as':_0x199379['as'],'attributes':_0x199379[_0x8cad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8cad('0xd')](function(_0x493151){logger[_0x8cad('0xe')](_0x8cad('0x23'),_0x33f277);logger[_0x8cad('0x11')](_0x8cad('0x23'),_0x33f277,JSON['stringify'](_0x493151));_0x2c43e1(_0x493151);})[_0x8cad('0x17')](function(_0x325cce){logger[_0x8cad('0x13')](_0x8cad('0x23'),_0x325cce[_0x8cad('0x15')],_0x33f277);_0x4ae19b(_0x85586d[_0x8cad('0x13')](0x1f4,_0x325cce[_0x8cad('0x15')]));});});};exports['NotifyMailAccount']=function(_0x8977cd){var _0x10d474=this;return new Promise(function(_0x261a64,_0x32defe){var _0x2bcde1={'body':_0x8977cd[_0x8cad('0x25')],'channel':_0x8cad('0x26')};var _0x2e6629=_[_0x8cad('0x27')](_[_0x8cad('0x28')](db[_0x8cad('0x29')]['rawAttributes']),['createdAt',_0x8cad('0x2a'),_0x8cad('0x2b'),_0x8cad('0x2c')]);var _0xce9c7b=![];if(_0x8977cd[_0x8cad('0x25')]['id']){delete _0x8977cd['body']['id'];}if(_[_0x8cad('0x2d')](_0x8977cd['body']['from'])){return _0x32defe(_0x10d474[_0x8cad('0x13')](0x1f4,_0x8cad('0x2e')));}if(_[_0x8cad('0x2d')](_0x8977cd[_0x8cad('0x25')][_0x8cad('0x25')])||_0x8977cd['body']['body']===''){return _0x32defe(_0x10d474[_0x8cad('0x13')](0x1f4,_0x8cad('0x2f')));}if(_[_0x8cad('0x2d')](_0x8977cd[_0x8cad('0x25')][_0x8cad('0x30')])){return _0x32defe(_0x10d474[_0x8cad('0x13')](0x1f4,_0x8cad('0x31')+_0x2e6629));}if(!_['includes'](_0x2e6629,_0x8977cd[_0x8cad('0x25')]['mapKey'])){return _0x32defe(_0x10d474[_0x8cad('0x13')](0x1f4,_0x8cad('0x32')+_0x2e6629));}var _0x5969a4={};_0x5969a4[_0x8977cd[_0x8cad('0x25')][_0x8cad('0x30')]]=_0x8977cd[_0x8cad('0x25')]['from'];return db['MailAccount'][_0x8cad('0x24')]({'where':{'id':_0x8977cd[_0x8cad('0x33')]['id']},'include':[{'model':db[_0x8cad('0x34')],'as':'List','include':[{'model':db[_0x8cad('0x29')],'as':_0x8cad('0x35'),'where':_0x5969a4,'limit':0x1,'order':[[_0x8cad('0x2a'),'DESC']]}]},{'model':db[_0x8cad('0x36')],'as':'Applications'},{'model':db[_0x8cad('0x37')],'as':'Smtp'}]})[_0x8cad('0xd')](function(_0x131b25){if(_0x131b25&&_0x131b25[_0x8cad('0x38')]){var _0x171b20=_0x131b25[_0x8cad('0x39')]({'plain':!![]});_0x2bcde1[_0x8cad('0x33')]=_['omit'](_0x171b20,[_0x8cad('0x3a'),_0x8cad('0x38')]);_0x2bcde1['applications']=_0x171b20['Applications'];_0x2bcde1[_0x8cad('0x3b')]=_0x171b20[_0x8cad('0x38')];_0x2bcde1[_0x8cad('0x3c')]=_['orderBy'](_0x2bcde1[_0x8cad('0x3c')],['priority'],[_0x8cad('0x3d')]);if(_0x2bcde1[_0x8cad('0x33')]&&_0x2bcde1['account']['autoclose']){_0x2bcde1[_0x8cad('0x3c')][_0x8cad('0x3e')]({'id':0x0,'priority':_0x2bcde1['applications'][_0x8cad('0x3f')]+0x1,'app':_0x8cad('0x40'),'appdata':_0x8cad('0x41'),'interval':_0x8cad('0x42')});}if(_0x2bcde1[_0x8cad('0x33')][_0x8cad('0x3a')]){delete _0x2bcde1[_0x8cad('0x33')][_0x8cad('0x3a')];}if(_0x2bcde1['account'][_0x8cad('0x38')]){delete _0x2bcde1[_0x8cad('0x33')][_0x8cad('0x38')];}if(_0x171b20[_0x8cad('0x38')][_0x8cad('0x35')][_0x8cad('0x3f')]){return _0x171b20['List'][_0x8cad('0x35')][0x0];}var _0x588e07=_['defaults'](_0x8977cd[_0x8cad('0x25')],{'firstName':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x43')],'ListId':_0x171b20['ListId']});_0x588e07[_0x8977cd['body']['mapKey']]=_0x8977cd[_0x8cad('0x25')][_0x8cad('0x43')];return db[_0x8cad('0x29')]['create'](_0x588e07);}else{throw new Error(_0x8cad('0x44'));}})[_0x8cad('0xd')](function(_0xae1dc8){_0x2bcde1[_0x8cad('0x45')]=_0xae1dc8;if(_0xae1dc8){if(!_0x8977cd[_0x8cad('0x25')]['message'][_0x8cad('0x46')]){_0x8977cd['body']['message'][_0x8cad('0x46')]=rs[_0x8cad('0x47')]()+'\x20'+_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x43')];}var _0x4fd8f3={'ContactId':_0xae1dc8['id'],'MailAccountId':_0x8977cd[_0x8cad('0x33')]['id'],'inReplyTo':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x46')],'to':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x43')],'cc':_0x8977cd['body'][_0x8cad('0x15')]['cc'],'subject':_0x8977cd['body'][_0x8cad('0x15')][_0x8cad('0x48')],'attach':_0x8977cd[_0x8cad('0x25')]['message']['attach'],'lastMsgAt':moment()[_0x8cad('0x49')](_0x8cad('0x4a')),'lastMsgDirection':'in'};return db[_0x8cad('0x4b')][_0x8cad('0x24')]({'where':{'closed':![],'MailAccountId':_0x8977cd['account']['id']},'include':[{'model':db[_0x8cad('0x4c')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x8977cd[_0x8cad('0x25')]['message'][_0x8cad('0x4d')]}}]})['then'](function(_0xa60698){if(_0xa60698){return[_0xa60698,![]];}return db[_0x8cad('0x4b')]['create'](_0x4fd8f3)[_0x8cad('0xd')](function(_0xebb1a0){return[_0xebb1a0,!![]];});});}else{throw new Error(_0x8cad('0x4e'));}})['spread'](function(_0x152a62,_0x3545ec){if(_0x152a62){_0xce9c7b=_0x3545ec;if(!_0x3545ec){return _0x152a62['update']({'inReplyTo':_0x8977cd[_0x8cad('0x25')]['message'][_0x8cad('0x46')],'to':_0x8977cd['body'][_0x8cad('0x15')][_0x8cad('0x43')],'cc':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')]['cc'],'subject':_0x8977cd[_0x8cad('0x25')]['message']['subject'],'attach':_0x152a62['attach']?_0x152a62[_0x8cad('0x4f')]:_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x4f')],'substatus':null,'substatusAt':moment()[_0x8cad('0x49')](_0x8cad('0x4a')),'lastMsgAt':moment()[_0x8cad('0x49')](_0x8cad('0x4a')),'lastMsgDirection':'in'});}else{return _0x152a62;}}})[_0x8cad('0xd')](function(_0x8a19ed){_0x2bcde1[_0x8cad('0x50')]=_0x8a19ed[_0x8cad('0x39')]({'plain':!![]});_0x2bcde1[_0x8cad('0x50')][_0x8cad('0x51')]=_0xce9c7b;return db[_0x8cad('0x4c')][_0x8cad('0x52')]({'body':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x25')],'MailAccountId':_0x8977cd[_0x8cad('0x33')]['id'],'MailInteractionId':_0x8a19ed['id'],'direction':'in','ContactId':_0x2bcde1[_0x8cad('0x45')]['id'],'messageId':_0x8977cd[_0x8cad('0x25')]['message']['messageId'],'from':_0x8977cd['body'][_0x8cad('0x15')]['from'],'to':_0x8977cd['body'][_0x8cad('0x15')]['to'],'cc':_0x8977cd[_0x8cad('0x25')]['message']['cc'],'subject':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x48')],'attach':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x4f')],'Attachments':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x53')],'originTo':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')]['originTo'],'originCc':_0x8977cd['body'][_0x8cad('0x15')][_0x8cad('0x54')],'bcc':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')]['bcc'],'ChatWebsiteId':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')]['ChatWebsiteId']||null,'originChannel':_0x8977cd[_0x8cad('0x25')][_0x8cad('0x15')][_0x8cad('0x55')]||_0x8cad('0x56'),'ChatOfflineMessageId':_0x8977cd[_0x8cad('0x25')]['message'][_0x8cad('0x57')]||null},{'include':[{'model':db[_0x8cad('0x58')],'as':_0x8cad('0x59')}]});})[_0x8cad('0xd')](function(_0x466840){_0x2bcde1['message']=_0x466840;if(_0x2bcde1[_0x8cad('0x50')][_0x8cad('0x5a')]){return db[_0x8cad('0x5b')]['find']({'attributes':['id','name'],'where':{'id':_0x2bcde1[_0x8cad('0x50')][_0x8cad('0x5a')]}})['then'](function(_0x2d9902){if(_0x2d9902){_0x2bcde1['applications'][_0x8cad('0x5c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d9902[_0x8cad('0x5d')]+','+(_0x2bcde1[_0x8cad('0x33')]['waitForTheAssignedAgent']||0xa),'interval':_0x8cad('0x42')});}return respondWithRpcPromise('Start',_0x8cad('0x5e'),_0x2bcde1);});}return respondWithRpcPromise(_0x8cad('0x5f'),_0x8cad('0x5e'),_0x2bcde1);})[_0x8cad('0xd')](function(_0xad422c){_0x261a64(_0xad422c);})[_0x8cad('0x17')](function(_0x36a6a6){_0x32defe(_0x10d474[_0x8cad('0x13')](0x1f4,_0x36a6a6[_0x8cad('0x15')]));});});}; \ No newline at end of file +var _0xbca0=['code','message','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','find','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','Applications','MailServerOut','get','omit','applications','orderBy','push','length','close','autoclose','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','spread','update','YYYY-MM-DD\x20HH:mm:ss','created','MailMessage','attachments','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachments','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','redis','defaults','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xbca0,0x1c9));var _0x0bca=function(_0x33ffd6,_0x3f6ce5){_0x33ffd6=_0x33ffd6-0x0;var _0x2b4086=_0xbca0[_0x33ffd6];return _0x2b4086;};'use strict';var _=require('lodash');var util=require(_0x0bca('0x0'));var moment=require('moment');var BPromise=require(_0x0bca('0x1'));var rs=require(_0x0bca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bca('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bca('0x5')][_0x0bca('0x6')]({'port':0x232c});config[_0x0bca('0x7')]=_[_0x0bca('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bca('0x7')]));require(_0x0bca('0x9'))['register'](socket);function respondWithRpcPromise(_0x594b6e,_0x48ec34,_0x59489e){return new BPromise(function(_0x74f92e,_0x1e0863){return client[_0x0bca('0xa')](_0x594b6e,_0x59489e)[_0x0bca('0xb')](function(_0x17b74f){logger[_0x0bca('0xc')](_0x0bca('0xd'),_0x48ec34,_0x0bca('0xe'));logger[_0x0bca('0xf')](_0x0bca('0x10'),_0x48ec34,_0x0bca('0xe'),JSON['stringify'](_0x17b74f));if(_0x17b74f['error']){if(_0x17b74f[_0x0bca('0x11')][_0x0bca('0x12')]===0x1f4){logger[_0x0bca('0x11')](_0x0bca('0xd'),_0x48ec34,_0x17b74f[_0x0bca('0x11')]['message']);return _0x1e0863(_0x17b74f[_0x0bca('0x11')][_0x0bca('0x13')]);}logger['error'](_0x0bca('0xd'),_0x48ec34,_0x17b74f[_0x0bca('0x11')][_0x0bca('0x13')]);return _0x74f92e(_0x17b74f[_0x0bca('0x11')]['message']);}else{logger[_0x0bca('0xc')]('MailAccount,\x20%s,\x20%s',_0x48ec34,_0x0bca('0xe'));_0x74f92e(_0x17b74f['result'][_0x0bca('0x13')]);}})['catch'](function(_0x381c8c){logger['error'](_0x0bca('0xd'),_0x48ec34,_0x381c8c);_0x1e0863(_0x381c8c);});});}exports[_0x0bca('0x14')]=function(_0x19f47f){var _0x5cda7e=this;return new Promise(function(_0x491783,_0x452c1e){return db[_0x0bca('0x15')][_0x0bca('0x16')]({'raw':_0x19f47f[_0x0bca('0x17')]?_0x19f47f['options'][_0x0bca('0x18')]===undefined?!![]:![]:!![],'where':_0x19f47f[_0x0bca('0x17')]?_0x19f47f[_0x0bca('0x17')][_0x0bca('0x19')]||null:null,'attributes':_0x19f47f[_0x0bca('0x17')]?_0x19f47f[_0x0bca('0x17')][_0x0bca('0x1a')]||null:null,'limit':_0x19f47f[_0x0bca('0x17')]?_0x19f47f['options'][_0x0bca('0x1b')]||null:null,'include':_0x19f47f[_0x0bca('0x17')]?_0x19f47f[_0x0bca('0x17')][_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x19f47f[_0x0bca('0x17')]['include'],function(_0x30506f){return{'model':db[_0x30506f[_0x0bca('0x1e')]],'as':_0x30506f['as'],'attributes':_0x30506f['attributes'],'include':_0x30506f[_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x30506f[_0x0bca('0x1c')],function(_0x3130b6){return{'model':db[_0x3130b6['model']],'as':_0x3130b6['as'],'attributes':_0x3130b6[_0x0bca('0x1a')],'include':_0x3130b6[_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x3130b6[_0x0bca('0x1c')],function(_0x29eec0){return{'model':db[_0x29eec0[_0x0bca('0x1e')]],'as':_0x29eec0['as'],'attributes':_0x29eec0[_0x0bca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0bca('0xb')](function(_0x1766a6){logger['info'](_0x0bca('0x14'),_0x19f47f);logger[_0x0bca('0xf')](_0x0bca('0x14'),_0x19f47f,JSON[_0x0bca('0x1f')](_0x1766a6));_0x491783(_0x1766a6);})[_0x0bca('0x20')](function(_0x30473a){logger[_0x0bca('0x11')](_0x0bca('0x14'),_0x30473a[_0x0bca('0x13')],_0x19f47f);_0x452c1e(_0x5cda7e['error'](0x1f4,_0x30473a['message']));});});};exports['ShowMailAccount']=function(_0x450fe4){var _0x3a50c9=this;return new Promise(function(_0x3dded3,_0x509f61){return db[_0x0bca('0x15')][_0x0bca('0x21')]({'raw':_0x450fe4[_0x0bca('0x17')]?_0x450fe4[_0x0bca('0x17')][_0x0bca('0x18')]===undefined?!![]:![]:!![],'where':_0x450fe4[_0x0bca('0x17')]?_0x450fe4[_0x0bca('0x17')][_0x0bca('0x19')]||null:null,'attributes':_0x450fe4[_0x0bca('0x17')]?_0x450fe4['options'][_0x0bca('0x1a')]||null:null,'include':_0x450fe4[_0x0bca('0x17')]?_0x450fe4[_0x0bca('0x17')][_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x450fe4[_0x0bca('0x17')][_0x0bca('0x1c')],function(_0x37f776){return{'model':db[_0x37f776[_0x0bca('0x1e')]],'as':_0x37f776['as'],'attributes':_0x37f776[_0x0bca('0x1a')],'include':_0x37f776[_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x37f776[_0x0bca('0x1c')],function(_0x21cee3){return{'model':db[_0x21cee3['model']],'as':_0x21cee3['as'],'attributes':_0x21cee3[_0x0bca('0x1a')],'include':_0x21cee3[_0x0bca('0x1c')]?_[_0x0bca('0x1d')](_0x21cee3['include'],function(_0x453f19){return{'model':db[_0x453f19[_0x0bca('0x1e')]],'as':_0x453f19['as'],'attributes':_0x453f19[_0x0bca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0bca('0xb')](function(_0x53746b){logger[_0x0bca('0xc')](_0x0bca('0x22'),_0x450fe4);logger[_0x0bca('0xf')]('ShowMailAccount',_0x450fe4,JSON[_0x0bca('0x1f')](_0x53746b));_0x3dded3(_0x53746b);})[_0x0bca('0x20')](function(_0x1b5594){logger[_0x0bca('0x11')](_0x0bca('0x22'),_0x1b5594[_0x0bca('0x13')],_0x450fe4);_0x509f61(_0x3a50c9[_0x0bca('0x11')](0x1f4,_0x1b5594[_0x0bca('0x13')]));});});};exports[_0x0bca('0x23')]=function(_0x3fd019){var _0x23cbb1=this;return new Promise(function(_0x3268cd,_0x3ef72e){var _0x4296cd={'body':_0x3fd019[_0x0bca('0x24')],'channel':'mail'};var _0x55318c=_[_0x0bca('0x25')](_[_0x0bca('0x26')](db[_0x0bca('0x27')][_0x0bca('0x28')]),['createdAt',_0x0bca('0x29'),_0x0bca('0x2a'),'ListId']);var _0x4bca4f=![];if(_0x3fd019['body']['id']){delete _0x3fd019[_0x0bca('0x24')]['id'];}if(_[_0x0bca('0x2b')](_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2c')])){return _0x3ef72e(_0x23cbb1[_0x0bca('0x11')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x0bca('0x2b')](_0x3fd019['body']['body'])||_0x3fd019['body'][_0x0bca('0x24')]===''){return _0x3ef72e(_0x23cbb1[_0x0bca('0x11')](0x1f4,_0x0bca('0x2d')));}if(_['isNil'](_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2e')])){return _0x3ef72e(_0x23cbb1[_0x0bca('0x11')](0x1f4,_0x0bca('0x2f')+_0x55318c));}if(!_[_0x0bca('0x30')](_0x55318c,_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2e')])){return _0x3ef72e(_0x23cbb1[_0x0bca('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55318c));}var _0x513433={};_0x513433[_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2e')]]=_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2c')];return db[_0x0bca('0x15')][_0x0bca('0x21')]({'where':{'id':_0x3fd019[_0x0bca('0x31')]['id']},'include':[{'model':db['CmList'],'as':_0x0bca('0x32'),'include':[{'model':db[_0x0bca('0x27')],'as':_0x0bca('0x33'),'where':_0x513433,'limit':0x1,'order':[['updatedAt',_0x0bca('0x34')]]}]},{'model':db['MailApplication'],'as':_0x0bca('0x35')},{'model':db[_0x0bca('0x36')],'as':'Smtp'}]})['then'](function(_0x53833e){if(_0x53833e&&_0x53833e['List']){var _0x57fc18=_0x53833e[_0x0bca('0x37')]({'plain':!![]});_0x4296cd[_0x0bca('0x31')]=_[_0x0bca('0x38')](_0x57fc18,[_0x0bca('0x35'),_0x0bca('0x32')]);_0x4296cd[_0x0bca('0x39')]=_0x57fc18[_0x0bca('0x35')];_0x4296cd['list']=_0x57fc18[_0x0bca('0x32')];_0x4296cd[_0x0bca('0x39')]=_[_0x0bca('0x3a')](_0x4296cd['applications'],['priority'],['asc']);if(_0x4296cd[_0x0bca('0x31')]&&_0x4296cd[_0x0bca('0x31')]['autoclose']){_0x4296cd['applications'][_0x0bca('0x3b')]({'id':0x0,'priority':_0x4296cd[_0x0bca('0x39')][_0x0bca('0x3c')]+0x1,'app':_0x0bca('0x3d'),'appdata':_0x0bca('0x3e'),'interval':_0x0bca('0x3f')});}if(_0x4296cd[_0x0bca('0x31')]['Applications']){delete _0x4296cd[_0x0bca('0x31')][_0x0bca('0x35')];}if(_0x4296cd[_0x0bca('0x31')][_0x0bca('0x32')]){delete _0x4296cd[_0x0bca('0x31')]['List'];}if(_0x57fc18[_0x0bca('0x32')][_0x0bca('0x33')]['length']){return _0x57fc18[_0x0bca('0x32')][_0x0bca('0x33')][0x0];}var _0x239cc9=_['defaults'](_0x3fd019[_0x0bca('0x24')],{'firstName':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2c')],'ListId':_0x57fc18['ListId']});_0x239cc9[_0x3fd019[_0x0bca('0x24')][_0x0bca('0x2e')]]=_0x3fd019['body'][_0x0bca('0x2c')];return db['CmContact'][_0x0bca('0x40')](_0x239cc9);}else{throw new Error(_0x0bca('0x41'));}})[_0x0bca('0xb')](function(_0x4e6ed2){_0x4296cd[_0x0bca('0x42')]=_0x4e6ed2;if(_0x4e6ed2){if(!_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x43')]){_0x3fd019['body'][_0x0bca('0x13')][_0x0bca('0x43')]=rs[_0x0bca('0x44')]()+'\x20'+_0x3fd019[_0x0bca('0x24')]['message'][_0x0bca('0x2c')];}var _0x13fb24={'ContactId':_0x4e6ed2['id'],'MailAccountId':_0x3fd019[_0x0bca('0x31')]['id'],'inReplyTo':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x43')],'to':_0x3fd019[_0x0bca('0x24')]['message'][_0x0bca('0x2c')],'cc':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['cc'],'subject':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x45')],'attach':_0x3fd019['body']['message'][_0x0bca('0x46')],'lastMsgAt':moment()[_0x0bca('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x0bca('0x48')]['find']({'where':{'closed':![],'MailAccountId':_0x3fd019[_0x0bca('0x31')]['id']},'include':[{'model':db['MailMessage'],'as':_0x0bca('0x49'),'attributes':[_0x0bca('0x43')],'where':{'messageId':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['inReplyTo']}}]})[_0x0bca('0xb')](function(_0x115d61){if(_0x115d61){return[_0x115d61,![]];}return db[_0x0bca('0x48')][_0x0bca('0x40')](_0x13fb24)[_0x0bca('0xb')](function(_0x116a18){return[_0x116a18,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0bca('0x4a')](function(_0x50949f,_0x473c49){if(_0x50949f){_0x4bca4f=_0x473c49;if(!_0x473c49){return _0x50949f[_0x0bca('0x4b')]({'inReplyTo':_0x3fd019['body'][_0x0bca('0x13')]['messageId'],'to':_0x3fd019[_0x0bca('0x24')]['message']['from'],'cc':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['cc'],'subject':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x45')],'attach':_0x50949f[_0x0bca('0x46')]?_0x50949f[_0x0bca('0x46')]:_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x0bca('0x47')](_0x0bca('0x4c')),'lastMsgAt':moment()['format'](_0x0bca('0x4c')),'lastMsgDirection':'in'});}else{return _0x50949f;}}})[_0x0bca('0xb')](function(_0x566e05){_0x4296cd['interaction']=_0x566e05[_0x0bca('0x37')]({'plain':!![]});_0x4296cd['interaction'][_0x0bca('0x4d')]=_0x4bca4f;return db[_0x0bca('0x4e')][_0x0bca('0x40')]({'body':_0x3fd019['body']['body'],'MailAccountId':_0x3fd019[_0x0bca('0x31')]['id'],'MailInteractionId':_0x566e05['id'],'direction':'in','ContactId':_0x4296cd[_0x0bca('0x42')]['id'],'messageId':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x43')],'from':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x2c')],'to':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['to'],'cc':_0x3fd019[_0x0bca('0x24')]['message']['cc'],'subject':_0x3fd019[_0x0bca('0x24')]['message']['subject'],'attach':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x46')],'Attachments':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x4f')],'originTo':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x50')],'originCc':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x51')],'bcc':_0x3fd019[_0x0bca('0x24')]['message']['bcc'],'ChatWebsiteId':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')]['ChatWebsiteId']||null,'originChannel':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x52')]||_0x0bca('0x53'),'ChatOfflineMessageId':_0x3fd019[_0x0bca('0x24')][_0x0bca('0x13')][_0x0bca('0x54')]||null},{'include':[{'model':db['Attachment'],'as':_0x0bca('0x55')}]});})[_0x0bca('0xb')](function(_0x4eb728){_0x4296cd[_0x0bca('0x13')]=_0x4eb728;if(_0x4296cd[_0x0bca('0x56')][_0x0bca('0x57')]){return db[_0x0bca('0x58')]['find']({'attributes':['id',_0x0bca('0x59')],'where':{'id':_0x4296cd[_0x0bca('0x56')][_0x0bca('0x57')]}})[_0x0bca('0xb')](function(_0x1a592b){if(_0x1a592b){_0x4296cd[_0x0bca('0x39')][_0x0bca('0x5a')]({'id':0x0,'priority':0x0,'app':_0x0bca('0x5b'),'appdata':_0x1a592b[_0x0bca('0x59')]+','+(_0x4296cd[_0x0bca('0x31')][_0x0bca('0x5c')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0bca('0x5d'),_0x0bca('0x5e'),_0x4296cd);});}return respondWithRpcPromise(_0x0bca('0x5d'),_0x0bca('0x5e'),_0x4296cd);})[_0x0bca('0xb')](function(_0x4b9e33){_0x3268cd(_0x4b9e33);})['catch'](function(_0x3e5a63){_0x3ef72e(_0x23cbb1[_0x0bca('0x11')](0x1f4,_0x3e5a63[_0x0bca('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 251b3a5..0699c46 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 _0xe123=['removeListener','./mailAccount.events','save','remove','update','emit'];(function(_0x134330,_0x21629e){var _0x59c47a=function(_0x2dd5fb){while(--_0x2dd5fb){_0x134330['push'](_0x134330['shift']());}};_0x59c47a(++_0x21629e);}(_0xe123,0x1cf));var _0x3e12=function(_0x3177c5,_0x473677){_0x3177c5=_0x3177c5-0x0;var _0x62c482=_0xe123[_0x3177c5];return _0x62c482;};'use strict';var MailAccountEvents=require(_0x3e12('0x0'));var events=[_0x3e12('0x1'),_0x3e12('0x2'),_0x3e12('0x3')];function createListener(_0x1d8559,_0x2fc74c){return function(_0x1b9f10){_0x2fc74c[_0x3e12('0x4')](_0x1d8559,_0x1b9f10);};}function removeListener(_0x236dce,_0x189f82){return function(){MailAccountEvents[_0x3e12('0x5')](_0x236dce,_0x189f82);};}exports['register']=function(_0x2ffd37){for(var _0x4ad2ae=0x0,_0xe9ef82=events['length'];_0x4ad2ae<_0xe9ef82;_0x4ad2ae++){var _0x3709e3=events[_0x4ad2ae];var _0x48977b=createListener('mailAccount:'+_0x3709e3,_0x2ffd37);MailAccountEvents['on'](_0x3709e3,_0x48977b);}}; \ No newline at end of file +var _0xbdbe=['remove','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0xc85513,_0x49e852){var _0x3e70be=function(_0x53bbd6){while(--_0x53bbd6){_0xc85513['push'](_0xc85513['shift']());}};_0x3e70be(++_0x49e852);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbdbe[_0x4a9fb1];return _0x348672;};'use strict';var MailAccountEvents=require(_0xebdb('0x0'));var events=['save',_0xebdb('0x1'),'update'];function createListener(_0x145691,_0x5c7690){return function(_0x3d1cc6){_0x5c7690['emit'](_0x145691,_0x3d1cc6);};}function removeListener(_0x3678b0,_0x5857cc){return function(){MailAccountEvents[_0xebdb('0x2')](_0x3678b0,_0x5857cc);};}exports['register']=function(_0x230454){for(var _0xbc1822=0x0,_0x16eacd=events[_0xebdb('0x3')];_0xbc1822<_0x16eacd;_0xbc1822++){var _0x19ba0e=events[_0xbc1822];var _0x253968=createListener(_0xebdb('0x4')+_0x19ba0e,_0x230454);MailAccountEvents['on'](_0x19ba0e,_0x253968);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index cface91..855eae4 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 _0x5e36=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a1506,_0x750ec6){var _0x3e154b=function(_0x5f0744){while(--_0x5f0744){_0x5a1506['push'](_0x5a1506['shift']());}};_0x3e154b(++_0x750ec6);}(_0x5e36,0x180));var _0x65e3=function(_0x379e9c,_0x204c2a){_0x379e9c=_0x379e9c-0x0;var _0x2d802c=_0x5e36[_0x379e9c];return _0x2d802c;};'use strict';var multer=require(_0x65e3('0x0'));var util=require('util');var path=require(_0x65e3('0x1'));var timeout=require(_0x65e3('0x2'));var express=require(_0x65e3('0x3'));var router=express[_0x65e3('0x4')]();var fs_extra=require(_0x65e3('0x5'));var auth=require(_0x65e3('0x6'));var interaction=require(_0x65e3('0x7'));var config=require(_0x65e3('0x8'));var controller=require('./mailApplication.controller');router[_0x65e3('0x9')](_0x65e3('0xa'),auth[_0x65e3('0xb')](),controller[_0x65e3('0xc')]);router[_0x65e3('0xd')](_0x65e3('0xa'),auth[_0x65e3('0xb')](),controller['update']);router[_0x65e3('0xe')](_0x65e3('0xa'),auth[_0x65e3('0xb')](),controller[_0x65e3('0xf')]);module[_0x65e3('0x10')]=router; \ No newline at end of file +var _0x9ce7=['/:id','isAuthenticated','show','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x9ce7,0x1c6));var _0x79ce=function(_0x60f34b,_0x35545b){_0x60f34b=_0x60f34b-0x0;var _0x451cd7=_0x9ce7[_0x60f34b];return _0x451cd7;};'use strict';var multer=require('multer');var util=require(_0x79ce('0x0'));var path=require(_0x79ce('0x1'));var timeout=require(_0x79ce('0x2'));var express=require('express');var router=express[_0x79ce('0x3')]();var fs_extra=require(_0x79ce('0x4'));var auth=require(_0x79ce('0x5'));var interaction=require(_0x79ce('0x6'));var config=require(_0x79ce('0x7'));var controller=require(_0x79ce('0x8'));router[_0x79ce('0x9')](_0x79ce('0xa'),auth[_0x79ce('0xb')](),controller[_0x79ce('0xc')]);router['put'](_0x79ce('0xa'),auth[_0x79ce('0xb')](),controller[_0x79ce('0xd')]);router[_0x79ce('0xe')](_0x79ce('0xa'),auth[_0x79ce('0xb')](),controller[_0x79ce('0xf')]);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 5b49a99..62977fe 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 _0x1a31=['TEXT','STRING','sequelize','noop'];(function(_0x397c86,_0x24edb8){var _0x5c40c5=function(_0x3c92a3){while(--_0x3c92a3){_0x397c86['push'](_0x397c86['shift']());}};_0x5c40c5(++_0x24edb8);}(_0x1a31,0x6e));var _0x11a3=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x1a31[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0x11a3('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11a3('0x1')},'appdata':{'type':Sequelize[_0x11a3('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x11a3('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3e00=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x171bb0,_0x479cb5){var _0x556ce1=function(_0x62cecd){while(--_0x62cecd){_0x171bb0['push'](_0x171bb0['shift']());}};_0x556ce1(++_0x479cb5);}(_0x3e00,0xc1));var _0x03e0=function(_0x357576,_0x50cefc){_0x357576=_0x357576-0x0;var _0x5d4d8b=_0x3e00[_0x357576];return _0x5d4d8b;};'use strict';var Sequelize=require(_0x03e0('0x0'));module[_0x03e0('0x1')]={'priority':{'type':Sequelize[_0x03e0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x03e0('0x3')],'allowNull':![],'defaultValue':_0x03e0('0x4')},'appdata':{'type':Sequelize[_0x03e0('0x5')]()},'description':{'type':Sequelize[_0x03e0('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x03e0('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 2d33a92..2723f40 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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x331298,_0x12341a){var _0x3824bc=function(_0x19449f){while(--_0x19449f){_0x331298['push'](_0x331298['shift']());}};_0x3824bc(++_0x12341a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3b7dc5,_0x16b9ec){_0x3b7dc5=_0x3b7dc5-0x0;var _0x1b99fe=_0x9bde[_0x3b7dc5];return _0x1b99fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0x54ef,0x112));var _0xf54e=function(_0x3363ea,_0x2d05c1){_0x3363ea=_0x3363ea-0x0;var _0xe86691=_0x54ef[_0x3363ea];return _0xe86691;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4af2dd9..d2cb1ee 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 _0x12bd=['define','utf8mb4','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x38ed84,_0x31718d){var _0x4bb181=function(_0x2cceb7){while(--_0x2cceb7){_0x38ed84['push'](_0x38ed84['shift']());}};_0x4bb181(++_0x31718d);}(_0x12bd,0xbf));var _0xd12b=function(_0x267be3,_0x18ef5f){_0x267be3=_0x267be3-0x0;var _0x57fe29=_0x12bd[_0x267be3];return _0x57fe29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd12b('0x0'))(_0xd12b('0x1'));var moment=require('moment');var BPromise=require(_0xd12b('0x2'));var rp=require(_0xd12b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd12b('0x4'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x1d01b5,_0x3f4eb9){return _0x1d01b5[_0xd12b('0x5')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd12b('0x6'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x93b0=['bluebird','path','rimraf','../../config/environment','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0xda6fe3,_0x4ea34c){var _0x2aa10a=function(_0x43eaae){while(--_0x43eaae){_0xda6fe3['push'](_0xda6fe3['shift']());}};_0x2aa10a(++_0x4ea34c);}(_0x93b0,0xbd));var _0x093b=function(_0xa2ed71,_0x623c37){_0xa2ed71=_0xa2ed71-0x0;var _0x3dd0b7=_0x93b0[_0xa2ed71];return _0x3dd0b7;};'use strict';var _=require(_0x093b('0x0'));var util=require('util');var logger=require(_0x093b('0x1'))('api');var moment=require(_0x093b('0x2'));var BPromise=require(_0x093b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x093b('0x4'));var rimraf=require(_0x093b('0x5'));var config=require(_0x093b('0x6'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x4af64e,_0x211357){return _0x4af64e[_0x093b('0x7')](_0x093b('0x8'),attributes,{'tableName':_0x093b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x093b('0xa'),'collate':_0x093b('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d872e27..11ae124 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 _0x971c=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','raw','options','where','attributes','limit','stringify','lodash'];(function(_0x5c19d8,_0x10e7aa){var _0x558708=function(_0x2eefd7){while(--_0x2eefd7){_0x5c19d8['push'](_0x5c19d8['shift']());}};_0x558708(++_0x10e7aa);}(_0x971c,0x13f));var _0xc971=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x971c[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xc971('0x0'));var util=require(_0xc971('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc971('0x2'));var fs=require('fs');var Redis=require(_0xc971('0x3'));var db=require(_0xc971('0x4'))['db'];var utils=require(_0xc971('0x5'));var logger=require(_0xc971('0x6'))(_0xc971('0x7'));var config=require(_0xc971('0x8'));var jayson=require(_0xc971('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xae8328,_0xb2c7b6,_0x1cf86b){return new BPromise(function(_0xc8c021,_0x4ee45d){return client[_0xc971('0xa')](_0xae8328,_0x1cf86b)[_0xc971('0xb')](function(_0x4afa28){logger[_0xc971('0xc')](_0xc971('0xd'),_0xb2c7b6,_0xc971('0xe'));logger[_0xc971('0xf')](_0xc971('0x10'),_0xb2c7b6,_0xc971('0xe'),JSON['stringify'](_0x4afa28));if(_0x4afa28[_0xc971('0x11')]){if(_0x4afa28[_0xc971('0x11')][_0xc971('0x12')]===0x1f4){logger[_0xc971('0x11')](_0xc971('0xd'),_0xb2c7b6,_0x4afa28['error']['message']);return _0x4ee45d(_0x4afa28[_0xc971('0x11')][_0xc971('0x13')]);}logger[_0xc971('0x11')](_0xc971('0xd'),_0xb2c7b6,_0x4afa28[_0xc971('0x11')][_0xc971('0x13')]);return _0xc8c021(_0x4afa28[_0xc971('0x11')][_0xc971('0x13')]);}else{logger['info'](_0xc971('0xd'),_0xb2c7b6,_0xc971('0xe'));_0xc8c021(_0x4afa28[_0xc971('0x14')][_0xc971('0x13')]);}})[_0xc971('0x15')](function(_0x4400f1){logger[_0xc971('0x11')](_0xc971('0xd'),_0xb2c7b6,_0x4400f1);_0x4ee45d(_0x4400f1);});});}exports[_0xc971('0x16')]=function(_0x55015f){var _0x58d879=this;return new Promise(function(_0x9d50b0,_0x2b1807){return db[_0xc971('0x17')][_0xc971('0x18')](_0x55015f[_0xc971('0x19')],{'raw':_0x55015f['options']?_0x55015f['options'][_0xc971('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55015f[_0xc971('0x1b')]?_0x55015f[_0xc971('0x1b')][_0xc971('0x1c')]||null:null,'attributes':_0x55015f[_0xc971('0x1b')]?_0x55015f[_0xc971('0x1b')][_0xc971('0x1d')]||null:null,'limit':_0x55015f['options']?_0x55015f[_0xc971('0x1b')][_0xc971('0x1e')]||null:null})['then'](function(_0x5b150e){logger[_0xc971('0xc')](_0xc971('0x16'),_0x55015f);logger[_0xc971('0xf')](_0xc971('0x16'),_0x55015f,JSON[_0xc971('0x1f')](_0x5b150e));_0x9d50b0(_0x5b150e);})[_0xc971('0x15')](function(_0x5a8222){logger['error'](_0xc971('0x16'),_0x5a8222[_0xc971('0x13')],_0x55015f);_0x2b1807(_0x58d879[_0xc971('0x11')](0x1f4,_0x5a8222[_0xc971('0x13')]));});});}; \ No newline at end of file +var _0x7694=['raw','where','attributes','limit','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','update','body','options'];(function(_0x44b255,_0x3d924b){var _0x174e2c=function(_0x374d79){while(--_0x374d79){_0x44b255['push'](_0x44b255['shift']());}};_0x174e2c(++_0x3d924b);}(_0x7694,0x86));var _0x4769=function(_0x2a7082,_0x362c5e){_0x2a7082=_0x2a7082-0x0;var _0x39c954=_0x7694[_0x2a7082];return _0x39c954;};'use strict';var _=require(_0x4769('0x0'));var util=require(_0x4769('0x1'));var moment=require('moment');var BPromise=require(_0x4769('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4769('0x3'));var db=require(_0x4769('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4769('0x5'))(_0x4769('0x6'));var config=require(_0x4769('0x7'));var jayson=require(_0x4769('0x8'));var client=jayson[_0x4769('0x9')][_0x4769('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21717b,_0x81d7a2,_0x58bceb){return new BPromise(function(_0x113c1e,_0x160875){return client[_0x4769('0xb')](_0x21717b,_0x58bceb)['then'](function(_0x5a0eb8){logger[_0x4769('0xc')](_0x4769('0xd'),_0x81d7a2,_0x4769('0xe'));logger['debug'](_0x4769('0xf'),_0x81d7a2,_0x4769('0xe'),JSON[_0x4769('0x10')](_0x5a0eb8));if(_0x5a0eb8[_0x4769('0x11')]){if(_0x5a0eb8[_0x4769('0x11')]['code']===0x1f4){logger[_0x4769('0x11')](_0x4769('0xd'),_0x81d7a2,_0x5a0eb8[_0x4769('0x11')][_0x4769('0x12')]);return _0x160875(_0x5a0eb8[_0x4769('0x11')][_0x4769('0x12')]);}logger[_0x4769('0x11')]('MailApplication,\x20%s,\x20%s',_0x81d7a2,_0x5a0eb8[_0x4769('0x11')][_0x4769('0x12')]);return _0x113c1e(_0x5a0eb8[_0x4769('0x11')][_0x4769('0x12')]);}else{logger[_0x4769('0xc')](_0x4769('0xd'),_0x81d7a2,_0x4769('0xe'));_0x113c1e(_0x5a0eb8[_0x4769('0x13')]['message']);}})[_0x4769('0x14')](function(_0x21f83b){logger[_0x4769('0x11')](_0x4769('0xd'),_0x81d7a2,_0x21f83b);_0x160875(_0x21f83b);});});}exports[_0x4769('0x15')]=function(_0x3f5d42){var _0x511130=this;return new Promise(function(_0x503774,_0x115654){return db[_0x4769('0x16')][_0x4769('0x17')](_0x3f5d42[_0x4769('0x18')],{'raw':_0x3f5d42[_0x4769('0x19')]?_0x3f5d42[_0x4769('0x19')][_0x4769('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5d42[_0x4769('0x19')]?_0x3f5d42[_0x4769('0x19')][_0x4769('0x1b')]||null:null,'attributes':_0x3f5d42[_0x4769('0x19')]?_0x3f5d42[_0x4769('0x19')][_0x4769('0x1c')]||null:null,'limit':_0x3f5d42[_0x4769('0x19')]?_0x3f5d42[_0x4769('0x19')][_0x4769('0x1d')]||null:null})[_0x4769('0x1e')](function(_0x3183eb){logger[_0x4769('0xc')](_0x4769('0x15'),_0x3f5d42);logger[_0x4769('0x1f')](_0x4769('0x15'),_0x3f5d42,JSON[_0x4769('0x10')](_0x3183eb));_0x503774(_0x3183eb);})[_0x4769('0x14')](function(_0x4f7f44){logger[_0x4769('0x11')](_0x4769('0x15'),_0x4f7f44[_0x4769('0x12')],_0x3f5d42);_0x115654(_0x511130[_0x4769('0x11')](0x1f4,_0x4f7f44[_0x4769('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5da840f..02027aa 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 _0xa7d1=['isAuthenticated','index','/describe','describe','/:id/messages','getMessages','download','create','addMessage','post','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','update','delete','mailinteraction:destroy','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa7d1,0x1e8));var _0x1a7d=function(_0x564d53,_0x31ac8a){_0x564d53=_0x564d53-0x0;var _0x1ba891=_0xa7d1[_0x564d53];return _0x1ba891;};'use strict';var express=require(_0x1a7d('0x0'));var router=express[_0x1a7d('0x1')]();var auth=require(_0x1a7d('0x2'));var interaction=require(_0x1a7d('0x3'));var controller=require(_0x1a7d('0x4'));router[_0x1a7d('0x5')]('/',auth[_0x1a7d('0x6')](),controller[_0x1a7d('0x7')]);router[_0x1a7d('0x5')](_0x1a7d('0x8'),auth['isAuthenticated'](),controller[_0x1a7d('0x9')]);router[_0x1a7d('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1a7d('0x5')](_0x1a7d('0xa'),auth[_0x1a7d('0x6')](),controller[_0x1a7d('0xb')]);router[_0x1a7d('0x5')]('/:id/download',auth[_0x1a7d('0x6')](),controller[_0x1a7d('0xc')]);router['post']('/',auth[_0x1a7d('0x6')](),controller[_0x1a7d('0xd')]);router['post'](_0x1a7d('0xa'),auth['isAuthenticated'](),controller[_0x1a7d('0xe')]);router[_0x1a7d('0xf')](_0x1a7d('0x10'),auth[_0x1a7d('0x6')](),interaction[_0x1a7d('0x11')]('mail',_0x1a7d('0x12')),controller[_0x1a7d('0x13')]);router[_0x1a7d('0x14')](_0x1a7d('0x15'),auth[_0x1a7d('0x6')](),interaction[_0x1a7d('0x11')](_0x1a7d('0x16'),'mailinteraction:update'),controller[_0x1a7d('0x17')]);router[_0x1a7d('0x18')](_0x1a7d('0x15'),auth['isAuthenticated'](),interaction[_0x1a7d('0x11')]('mail',_0x1a7d('0x19')),controller['destroy']);router[_0x1a7d('0x18')](_0x1a7d('0x10'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x8fa4=['mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','delete','/:id/tags','exports','express','../../components/auth/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','addMessage','tracked'];(function(_0xdee7ec,_0x29d552){var _0x1879b6=function(_0x3a3e13){while(--_0x3a3e13){_0xdee7ec['push'](_0xdee7ec['shift']());}};_0x1879b6(++_0x29d552);}(_0x8fa4,0x134));var _0x48fa=function(_0x3d6317,_0x5e570a){_0x3d6317=_0x3d6317-0x0;var _0x53313b=_0x8fa4[_0x3d6317];return _0x53313b;};'use strict';var express=require(_0x48fa('0x0'));var router=express['Router']();var auth=require(_0x48fa('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x48fa('0x2'));router[_0x48fa('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x48fa('0x3')](_0x48fa('0x4'),auth[_0x48fa('0x5')](),controller[_0x48fa('0x6')]);router[_0x48fa('0x3')]('/:id',auth[_0x48fa('0x5')](),controller[_0x48fa('0x7')]);router[_0x48fa('0x3')](_0x48fa('0x8'),auth[_0x48fa('0x5')](),controller['getMessages']);router['get'](_0x48fa('0x9'),auth[_0x48fa('0x5')](),controller[_0x48fa('0xa')]);router[_0x48fa('0xb')]('/',auth[_0x48fa('0x5')](),controller['create']);router[_0x48fa('0xb')](_0x48fa('0x8'),auth[_0x48fa('0x5')](),controller[_0x48fa('0xc')]);router[_0x48fa('0xb')]('/:id/tags',auth[_0x48fa('0x5')](),interaction[_0x48fa('0xd')](_0x48fa('0xe'),_0x48fa('0xf')),controller[_0x48fa('0x10')]);router[_0x48fa('0x11')](_0x48fa('0x12'),auth[_0x48fa('0x5')](),interaction[_0x48fa('0xd')](_0x48fa('0xe'),_0x48fa('0x13')),controller['update']);router['delete'](_0x48fa('0x12'),auth['isAuthenticated'](),interaction[_0x48fa('0xd')](_0x48fa('0xe'),'mailinteraction:destroy'),controller['destroy']);router[_0x48fa('0x14')](_0x48fa('0x15'),auth[_0x48fa('0x5')](),controller['removeTags']);module[_0x48fa('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d842925..aa46aac 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 _0x180b=['sequelize','iconv','exports','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out'];(function(_0x5499d9,_0x1abd4f){var _0x52054c=function(_0x2205bc){while(--_0x2205bc){_0x5499d9['push'](_0x5499d9['shift']());}};_0x52054c(++_0x1abd4f);}(_0x180b,0xdc));var _0xb180=function(_0x2b78e3,_0x57aced){_0x2b78e3=_0x2b78e3-0x0;var _0x3e41f5=_0x180b[_0x2b78e3];return _0x3e41f5;};'use strict';var Sequelize=require(_0xb180('0x0'));var iconv=require(_0xb180('0x1'));module[_0xb180('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb180('0x3')]},'disposition':{'type':Sequelize[_0xb180('0x4')]},'secondDisposition':{'type':Sequelize[_0xb180('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb180('0x4')]},'note':{'type':Sequelize[_0xb180('0x4')]},'inReplyTo':{'type':Sequelize[_0xb180('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb180('0x4')]},'cc':{'type':Sequelize[_0xb180('0x5')](_0xb180('0x6'))},'subject':{'type':Sequelize[_0xb180('0x5')]()},'attach':{'type':Sequelize[_0xb180('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb180('0x3')]},'substatus':{'type':Sequelize[_0xb180('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xb180('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb180('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb180('0x8')]('in',_0xb180('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb180('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x51d0=['STRING','long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x51d0,0x1bd));var _0x051d=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x51d0[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x051d('0x0'));var iconv=require(_0x051d('0x1'));module[_0x051d('0x2')]={'closed':{'type':Sequelize[_0x051d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x051d('0x4')]},'disposition':{'type':Sequelize[_0x051d('0x5')]},'secondDisposition':{'type':Sequelize[_0x051d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x051d('0x5')]},'note':{'type':Sequelize[_0x051d('0x5')]},'inReplyTo':{'type':Sequelize[_0x051d('0x5')](0x1fe)},'to':{'type':Sequelize[_0x051d('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x051d('0x6'))},'subject':{'type':Sequelize[_0x051d('0x7')]()},'attach':{'type':Sequelize[_0x051d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x051d('0x4')]},'substatus':{'type':Sequelize[_0x051d('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x051d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x051d('0x8')]('in',_0x051d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x051d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x051d('0x8')]('in',_0x051d('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x051d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 0cd47dc..b95b8e5 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 _0x71e2=['includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','MailAccountId','concat','createdAt','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','MailInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params'];(function(_0x430c13,_0x17e388){var _0x3c67f8=function(_0x5f2d4b){while(--_0x5f2d4b){_0x430c13['push'](_0x430c13['shift']());}};_0x3c67f8(++_0x17e388);}(_0x71e2,0x11d));var _0x271e=function(_0x58c9a9,_0x4ecd86){_0x58c9a9=_0x58c9a9-0x0;var _0x151e6a=_0x71e2[_0x58c9a9];return _0x151e6a;};'use strict';var emlformat=require(_0x271e('0x0'));var rimraf=require(_0x271e('0x1'));var zipdir=require('zip-dir');var moment=require(_0x271e('0x2'));var BPromise=require(_0x271e('0x3'));var util=require(_0x271e('0x4'));var path=require(_0x271e('0x5'));var fs=require('fs');var _=require(_0x271e('0x6'));var squel=require(_0x271e('0x7'));var juice=require(_0x271e('0x8'));var Redis=require(_0x271e('0x9'));var qs=require(_0x271e('0xa'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x271e('0xb'))(_0x271e('0xc'));var config=require(_0x271e('0xd'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x271e('0xe'));config[_0x271e('0xf')]=_[_0x271e('0x10')](config[_0x271e('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x271e('0x11'))(new Redis(config[_0x271e('0xf')]));require(_0x271e('0x12'))['register'](socket);function respondWithStatusCode(_0x5df184,_0x1ad69e){_0x1ad69e=_0x1ad69e||0xcc;return function(_0x55b437){if(_0x55b437){return _0x5df184['sendStatus'](_0x1ad69e);}return _0x5df184[_0x271e('0x13')](_0x1ad69e)[_0x271e('0x14')]();};}function respondWithResult(_0x3f8878,_0x4d98a8){_0x4d98a8=_0x4d98a8||0xc8;return function(_0x51b262){if(_0x51b262){return _0x3f8878['status'](_0x4d98a8)['json'](_0x51b262);}};}function respondWithFilteredResult(_0x38998d,_0x38fe9c){return function(_0x774325){if(_0x774325){var _0x5c8e58=typeof _0x38fe9c[_0x271e('0x15')]===_0x271e('0x16')&&typeof _0x38fe9c[_0x271e('0x17')]===_0x271e('0x16');var _0x6dc29b=_0x774325[_0x271e('0x18')];var _0x106d34=_0x5c8e58?0x0:_0x38fe9c[_0x271e('0x15')];var _0x3c7a31=_0x5c8e58?_0x774325['count']:_0x38fe9c[_0x271e('0x15')]+_0x38fe9c[_0x271e('0x17')];var _0x4191bc;if(_0x3c7a31>=_0x6dc29b){_0x3c7a31=_0x6dc29b;_0x4191bc=0xc8;}else{_0x4191bc=0xce;}_0x38998d['status'](_0x4191bc);return _0x38998d[_0x271e('0x19')](_0x271e('0x1a'),_0x106d34+'-'+_0x3c7a31+'/'+_0x6dc29b)[_0x271e('0x1b')](_0x774325);}return null;};}function saveUpdates(_0x1c7bc4){return function(_0x5b52a6){if(_0x5b52a6){return _0x5b52a6[_0x271e('0x1c')](_0x1c7bc4)['then'](function(_0xb8575e){return _0xb8575e;});}return null;};}function removeEntity(_0xeb5fd7){return function(_0xe7386d){if(_0xe7386d){return _0xe7386d[_0x271e('0x1d')]()[_0x271e('0x1e')](function(){_0xeb5fd7[_0x271e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cff49){return function(_0x3670cd){if(!_0x3670cd){_0x9cff49[_0x271e('0x1f')](0x194);}return _0x3670cd;};}function handleError(_0x372f10,_0x20e0f4){_0x20e0f4=_0x20e0f4||0x1f4;return function(_0x563163){logger[_0x271e('0x20')](_0x563163[_0x271e('0x21')]);if(_0x563163['name']){delete _0x563163[_0x271e('0x22')];}_0x372f10[_0x271e('0x13')](_0x20e0f4)[_0x271e('0x23')](_0x563163);};}function getInteractionUsers(_0x33240d,_0x85b1e8){return new BPromise(function(_0x359b66,_0x18de69){try{if(_0x85b1e8[_0x33240d['id']]){_0x33240d[_0x271e('0x24')]=_[_0x271e('0x25')](_0x85b1e8[_0x33240d['id']],function(_0x34bdb7){return{'id':_0x34bdb7['id'],'fullname':_0x34bdb7['fullname']};});}}catch(_0x11a25c){_0x18de69(_0x11a25c);}_0x359b66(_0x33240d);});}function getInteractionTags(_0x49e9f0,_0x500929){return new BPromise(function(_0x32f85a,_0x2a8392){try{if(_0x49e9f0[_0x271e('0x26')]){_0x49e9f0[_0x271e('0x27')]=[];_0x49e9f0[_0x271e('0x26')]['split'](',')[_0x271e('0x28')](function(_0x4995d3){_0x49e9f0['Tags'][_0x271e('0x29')](_0x500929[_0x4995d3]);});}delete _0x49e9f0[_0x271e('0x26')];}catch(_0x41ae63){_0x2a8392(_0x41ae63);}_0x32f85a(_0x49e9f0);});}function getLastMessageText(_0x539a24){return new BPromise(function(_0x324002,_0x225a95){return db[_0x271e('0x2a')][_0x271e('0x2b')]({'where':{'$and':[{'MailInteractionId':_0x539a24['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x271e('0x2c')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x271e('0x2d')],'order':_0x271e('0x2e'),'raw':!![]})['then'](function(_0x374a47){if(_0x374a47&&_0x374a47[_0x271e('0x2d')]){_0x539a24[_0x271e('0x2f')]=_[_0x271e('0x30')](_0x374a47[_0x271e('0x2d')]);}_0x324002(_0x539a24);})[_0x271e('0x31')](function(_0x4519e5){_0x225a95(_0x4519e5);});});}function updateMailInteraction(_0x5ecf09,_0xbec73f,_0x19c922,_0x274fca){return new BPromise(function(_0x2cb9c4,_0x39df4c){return getInteractionUsers(_0x5ecf09,_0x19c922)[_0x271e('0x1e')](function(_0x1868b2){return getInteractionTags(_0x1868b2,_0xbec73f);})[_0x271e('0x1e')](function(_0x25df31){if(_0x274fca){_0x2cb9c4(getLastMessageText(_0x25df31));}else{_0x2cb9c4(_0x25df31);}})[_0x271e('0x31')](function(_0x5e50a1){_0x39df4c(_0x5e50a1);});});}exports[_0x271e('0x32')]=function(_0xb350fc,_0x1f3008){var _0x135cb9={},_0x56ef9f={},_0x54d64f={'count':0x0,'rows':[]};var _0xd59393=_['map'](db['MailInteraction'][_0x271e('0x33')],function(_0x46f095){return{'name':_0x46f095[_0x271e('0x34')],'type':_0x46f095['type'][_0x271e('0x35')]};});_0x56ef9f[_0x271e('0x36')]=_[_0x271e('0x25')](_0xd59393,_0x271e('0x22'));_0x56ef9f[_0x271e('0x37')]=_[_0x271e('0x38')](_0xb350fc[_0x271e('0x37')]);_0x56ef9f[_0x271e('0x39')]=_[_0x271e('0x3a')](_0x56ef9f['model'],_0x56ef9f['query']);_0x135cb9['attributes']=_['intersection'](_0x56ef9f[_0x271e('0x36')],qs[_0x271e('0x3b')](_0xb350fc['query'][_0x271e('0x3b')]));_0x135cb9[_0x271e('0x3c')]=_0x135cb9['attributes']['length']?_0x135cb9['attributes']:_0x56ef9f['model'];if(!_0xb350fc[_0x271e('0x37')][_0x271e('0x3d')](_0x271e('0x3e'))){_0x135cb9[_0x271e('0x17')]=qs[_0x271e('0x17')](_0xb350fc[_0x271e('0x37')][_0x271e('0x17')]);_0x135cb9[_0x271e('0x15')]=qs[_0x271e('0x15')](_0xb350fc[_0x271e('0x37')][_0x271e('0x15')]);}_0x135cb9['order']=qs[_0x271e('0x3f')](_0xb350fc[_0x271e('0x37')][_0x271e('0x3f')]);_0x135cb9[_0x271e('0x40')]=qs[_0x271e('0x39')](_[_0x271e('0x41')](_0xb350fc['query'],_0x56ef9f[_0x271e('0x39')]),_0xd59393);var _0x3f1013=[];var _0x40b257=squel[_0x271e('0x42')]()[_0x271e('0x43')]('id')[_0x271e('0x43')]('name')[_0x271e('0x43')]('color')[_0x271e('0x44')](_0x271e('0x45'));var _0xd8e7ed=squel['select']()[_0x271e('0x43')](_0x271e('0x46'))[_0x271e('0x43')](_0x271e('0x47'))['field'](_0x271e('0x48'))[_0x271e('0x44')](_0x271e('0x49'),'ui')[_0x271e('0x4a')](_0x271e('0x4b'),'u',_0x271e('0x4c'));var _0x16a3a6=squel[_0x271e('0x42')]()[_0x271e('0x44')](_0x271e('0x4d'),'i')['left_join'](_0x271e('0x4e'),'c',_0x271e('0x4f'))['left_join'](_0x271e('0x4b'),'o',_0x271e('0x50'))[_0x271e('0x4a')]('mail_accounts','a',_0x271e('0x51'))[_0x271e('0x4a')](_0x271e('0x52'),'me',_0x271e('0x53'))[_0x271e('0x4a')](_0x271e('0x54'),'it',_0x271e('0x55'))[_0x271e('0x4a')](_0x271e('0x45'),'t',_0x271e('0x56'));var _0xeacf2a=squel[_0x271e('0x57')]();var _0x3e2fb0=[];var _0x32add3=squel['expr']();var _0x565433;if(_0xb350fc[_0x271e('0x37')][_0x271e('0x58')]){_0x565433=as[_0x271e('0x59')](_0xb350fc['query'][_0x271e('0x58')]);var _0x572b26=_0x565433[_0x271e('0x5a')];for(var _0x30a32a=0x0;_0x30a32a<_0x565433[_0x271e('0x5b')][_0x271e('0x5c')];_0x30a32a++){var _0x26d2f7=_0x565433['conditions'][_0x30a32a];var _0x2305cf='i';var _0x334f6c=_['find'](_0xd59393,['name',_0x26d2f7[_0x271e('0x43')]]);if(!_0x334f6c){switch(_0x26d2f7['field']){case _0x271e('0x5d'):if(_0x26d2f7[_0x271e('0x5e')]==0x1){_0x16a3a6[_0x271e('0x5f')]('`'+_0x26d2f7[_0x271e('0x43')]+_0x271e('0x60'));}else{_0x16a3a6['having']('`'+_0x26d2f7[_0x271e('0x43')]+_0x271e('0x61'));}break;case _0x271e('0x62'):if(_0x26d2f7['operator']===_0x271e('0x63')){if(_0x26d2f7[_0x271e('0x5e')][_0x271e('0x64')]('\x20')[_0x271e('0x5c')]>0x1){_0xeacf2a[_0x572b26](_0x271e('0x65'),qs['getFullTextValue'](_0x26d2f7[_0x271e('0x5e')]),null);}else{var _0x107122='%'+_0x26d2f7[_0x271e('0x5e')]+'%';_0xeacf2a[_0x572b26](_0x271e('0x66'),_0x107122,_0x107122,_0x107122);}}else{_0x334f6c=_[_0x271e('0x67')](_0xd59393,[_0x271e('0x22'),_0x271e('0x68')]);_0x26d2f7[_0x271e('0x43')]=_0x271e('0x68');_0x588ae7=as[_0x271e('0x69')](_0x2305cf,_0x334f6c[_0x271e('0x6a')],_0x26d2f7);_0xeacf2a[_0x572b26](_0x588ae7[_0x271e('0x6b')],_0x588ae7[_0x271e('0x5e')]['start'],_0x588ae7[_0x271e('0x5e')][_0x271e('0x14')]);}break;case _0x271e('0x6c'):var _0x28f6d7=_0x26d2f7[_0x271e('0x5e')]['split'](',')[_0x271e('0x25')](function(_0x19e096){return Number(_0x19e096);});_0x28f6d7[_0x271e('0x28')](function(_0x5aa84b){_0x32add3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5aa84b+',%');});_0x3e2fb0=_[_0x271e('0x6d')](_0x3e2fb0,_0x28f6d7);break;case _0x271e('0x6e'):if(_0x26d2f7[_0x271e('0x6f')]===_0x271e('0x63')){_0xeacf2a[_0x572b26](_0x271e('0x70'),'%'+_0x26d2f7[_0x271e('0x5e')]+'%',null);}else{_0x334f6c=_[_0x271e('0x67')](_0xd59393,[_0x271e('0x22'),_0x271e('0x71')]);_0x26d2f7['field']=_0x271e('0x71');_0x588ae7=as[_0x271e('0x69')](_0x2305cf,_0x334f6c['type'],_0x26d2f7);_0xeacf2a[_0x572b26](_0x588ae7[_0x271e('0x6b')],_0x588ae7[_0x271e('0x5e')][_0x271e('0x72')],_0x588ae7[_0x271e('0x5e')][_0x271e('0x14')]);}break;case _0x271e('0x2d'):_0x588ae7=as['buildExpression']('me',null,_0x26d2f7);_0xeacf2a[_0x572b26](_0x588ae7[_0x271e('0x6b')],_0x588ae7['value'][_0x271e('0x72')],_0x588ae7[_0x271e('0x5e')][_0x271e('0x14')]);break;}}else{var _0x588ae7=as['buildExpression'](_0x2305cf,_0x334f6c[_0x271e('0x6a')],_0x26d2f7);_0xeacf2a[_0x572b26](_0x588ae7[_0x271e('0x6b')],_0x588ae7[_0x271e('0x5e')]['start'],_0x588ae7[_0x271e('0x5e')]['end']);}}}else{var _0x4ef9a8=_(_0xb350fc[_0x271e('0x37')])[_0x271e('0x38')]()[_0x271e('0x25')](function(_0x61509a){return _['some'](_0xd59393,['name',_0x61509a])?_0x61509a:undefined;})[_0x271e('0x73')]()[_0x271e('0x5e')]();if(!_[_0x271e('0x74')](_0x4ef9a8)){_0x4ef9a8[_0x271e('0x28')](function(_0x297933){if(_0x297933===_0x271e('0x75')){_0x16a3a6['where']('i.MailAccountId\x20IN\x20?',[][_0x271e('0x76')](_0xb350fc['query'][_0x297933]));}else if(_0x297933===_0x271e('0x77')){var _0x2d4533=JSON['parse'](_0xb350fc[_0x271e('0x37')][_0x297933])['$gte'];var _0x313952=JSON[_0x271e('0x78')](_0xb350fc[_0x271e('0x37')][_0x297933])[_0x271e('0x79')];_0x16a3a6['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2d4533,_0x313952);}else{if(_0xb350fc[_0x271e('0x37')][_0x297933]===_0x271e('0x7a')){_0x16a3a6[_0x271e('0x40')]('i.'+_0x297933+'\x20IS\x20NULL');}else{_0x16a3a6[_0x271e('0x40')]('i.'+_0x297933+_0x271e('0x7b'),_0xb350fc['query'][_0x297933]);}}});}if(_0xb350fc[_0x271e('0x37')][_0x271e('0x7c')]){if(_0xb350fc['query'][_0x271e('0x7c')]==0x1){_0x16a3a6[_0x271e('0x5f')](_0x271e('0x7d'));}else{_0x16a3a6[_0x271e('0x5f')](_0x271e('0x7e'));}}if(_0xb350fc[_0x271e('0x37')]['tag']){_0x3e2fb0=_[_0x271e('0x7f')](_0xb350fc[_0x271e('0x37')]['tag'])?_0xb350fc[_0x271e('0x37')][_0x271e('0x80')]:new Array(_0xb350fc[_0x271e('0x37')][_0x271e('0x80')]);_0x3e2fb0[_0x271e('0x28')](function(_0x437468){_0x32add3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x437468+',%');});}if(_0xb350fc[_0x271e('0x37')][_0x271e('0x81')]){var _0x37733f=_0xb350fc['query'][_0x271e('0x81')][_0x271e('0x82')]('\x5c','\x5c\x5c')[_0x271e('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x37733f)){_0xeacf2a['or'](_0x271e('0x83'),_0x37733f+'%');}else if(qs[_0x271e('0x84')](_0x37733f)){_0xeacf2a['or'](_0x271e('0x85'),_0x37733f+'%');}else{_0xeacf2a['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x271e('0x86')](_0x37733f))['or'](_0x271e('0x87'),qs[_0x271e('0x86')](_0x37733f));}}}_0x16a3a6[_0x271e('0x40')](_0xeacf2a);_0x16a3a6[_0x271e('0x88')]('i.id');var _0x3cf62f={'type':db[_0x271e('0x89')][_0x271e('0x8a')][_0x271e('0x8b')],'raw':!![]};var _0x2a0e32=_0x16a3a6[_0x271e('0x8c')]();_0x2a0e32[_0x271e('0x43')](_0x271e('0x8d'));_0x2a0e32[_0x271e('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x271e('0x5d'));if(_0x135cb9[_0x271e('0x8e')]){_0x135cb9[_0x271e('0x8e')]['forEach'](function(_0x15ee0a){var _0x173cac=_0x15ee0a[0x0]===_0x271e('0x8f')?_0x15ee0a[0x0]:'i.'+_0x15ee0a[0x0];_0x16a3a6[_0x271e('0x8e')](_0x173cac,_0x15ee0a[0x1]===_0x271e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x3e2fb0)){_0x16a3a6['having'](_0x32add3);_0x2a0e32[_0x271e('0x40')](_0x271e('0x91'),_0x3e2fb0);}BPromise[_0x271e('0x92')]()[_0x271e('0x1e')](function(){if(!_0x565433){if(_0xb350fc['query']['MailAccountId'])return;_0x2a0e32['where'](_0x271e('0x93'));_0x16a3a6['where'](_0x271e('0x93'));return;}if(_0xb350fc['user'][_0x271e('0x94')]!==_0x271e('0x95'))return;return _0xb350fc['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3d2ae5){if(_[_0x271e('0x74')](_0x3d2ae5)){_0x2a0e32[_0x271e('0x40')]('i.MailAccountId\x20IS\x20NULL');_0x16a3a6[_0x271e('0x40')]('i.MailAccountId\x20IS\x20NULL');}else{_0x2a0e32[_0x271e('0x40')](_0x271e('0x96'),_[_0x271e('0x25')](_0x3d2ae5,'id'));_0x16a3a6[_0x271e('0x40')](_0x271e('0x96'),_['map'](_0x3d2ae5,'id'));}});})[_0x271e('0x1e')](function(){if(_0xb350fc['user'][_0x271e('0x94')]===_0x271e('0x95')&&!_0x565433&&!_0xb350fc[_0x271e('0x37')][_0x271e('0x75')])return[];return db['sequelize']['query'](_0x2a0e32['toString'](),_0x3cf62f);})['then'](function(_0x200fc9){_0x54d64f[_0x271e('0x18')]=_0x200fc9[_0x271e('0x5c')];if(_0x54d64f['count']===0x0)return[];return db[_0x271e('0x97')][_0x271e('0x37')](_0x40b257[_0x271e('0x98')](),_0x3cf62f)[_0x271e('0x1e')](function(_0x4dc97c){_0x3f1013=_[_0x271e('0x99')](_0x4dc97c,'id');_0x3cf62f=_[_0x271e('0x9a')](_0x3cf62f,{'model':db[_0x271e('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb350fc[_0x271e('0x37')][_0x271e('0x3b')]){_0x135cb9[_0x271e('0x3c')][_0x271e('0x28')](function(_0x5998b9){_0x16a3a6[_0x271e('0x43')]('i.'+_0x5998b9);});}else{_0x16a3a6[_0x271e('0x43')](_0x271e('0x9c'),_0x271e('0x5d'));_0x16a3a6['field'](_0x271e('0x9d'),_0x271e('0x9e'));_0x16a3a6['field'](_0x271e('0x9f'),'Account.mandatoryDisposition');_0x16a3a6[_0x271e('0x43')]('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',_0x271e('0x8f'));_0x16a3a6[_0x271e('0x43')](_0x271e('0x8d'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa0'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa1'));_0x16a3a6[_0x271e('0x43')]('i.closed');_0x16a3a6[_0x271e('0x43')](_0x271e('0xa2'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa3'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa4'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa5'));_0x16a3a6['field'](_0x271e('0xa6'));_0x16a3a6['field'](_0x271e('0xa7'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa8'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xa9'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xaa'));_0x16a3a6['field'](_0x271e('0xab'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xac'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xad'));_0x16a3a6['field'](_0x271e('0xae'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xaf'),_0x271e('0xb0'));_0x16a3a6['field'](_0x271e('0xb1'),_0x271e('0xb2'));_0x16a3a6['field'](_0x271e('0xb3'),'Contact.email');_0x16a3a6[_0x271e('0x43')](_0x271e('0xb4'),'Contact.phone');_0x16a3a6[_0x271e('0x43')](_0x271e('0xb5'),_0x271e('0xb6'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xb7'),_0x271e('0xb8'));_0x16a3a6[_0x271e('0x43')]('o.fullname',_0x271e('0xb9'));_0x16a3a6[_0x271e('0x43')](_0x271e('0xba'),_0x271e('0xbb'));_0x16a3a6[_0x271e('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x271e('0x26'));}if(_0x135cb9['limit'])_0x16a3a6[_0x271e('0x17')](_0x135cb9[_0x271e('0x17')]);if(_0x135cb9[_0x271e('0x15')])_0x16a3a6[_0x271e('0x15')](_0x135cb9[_0x271e('0x15')]);return db[_0x271e('0x97')][_0x271e('0x37')](_0x16a3a6['toString'](),_0x3cf62f);})[_0x271e('0x1e')](function(_0x2bb2df){if(_0x2bb2df[_0x271e('0x5c')]>0x0)_0xd8e7ed[_0x271e('0x40')](_0x271e('0xbc'),_['map'](_0x2bb2df,'id'));return db['sequelize'][_0x271e('0x37')](_0xd8e7ed[_0x271e('0x98')](),_0x3cf62f)['then'](function(_0x27118c){var _0x247e0c=_[_0x271e('0xbd')](_0x27118c,_0x271e('0xbe'));var _0x545be4=[];return db[_0x271e('0xbf')]['findOne']({'attributes':[_0x271e('0xc0')],'raw':!![]})['then'](function(_0x31877d){var _0x356447=_0x31877d[_0x271e('0xc0')];_0x2bb2df[_0x271e('0x28')](function(_0x520c27){_0x545be4['push'](updateMailInteraction(_0x520c27,_0x3f1013,_0x247e0c,_0x356447));});return BPromise[_0x271e('0xc1')](_0x545be4);});});});})['then'](function(_0x5971cc){_0x54d64f[_0x271e('0xc2')]=_0x5971cc;return _0x54d64f;})[_0x271e('0x1e')](respondWithFilteredResult(_0x1f3008,_0x135cb9))['catch'](handleError(_0x1f3008,null));};exports[_0x271e('0xc3')]=function(_0xf46a9c,_0xa16aad){var _0x545a81={'raw':![],'where':{'id':_0xf46a9c[_0x271e('0xc4')]['id']}},_0x3abb79={};_0x3abb79['model']=_['keys'](db[_0x271e('0x9b')][_0x271e('0x33')]);_0x3abb79[_0x271e('0x37')]=_[_0x271e('0x38')](_0xf46a9c[_0x271e('0x37')]);_0x3abb79['filters']=_['intersection'](_0x3abb79['model'],_0x3abb79[_0x271e('0x37')]);_0x545a81[_0x271e('0x3c')]=_['intersection'](_0x3abb79[_0x271e('0x36')],qs[_0x271e('0x3b')](_0xf46a9c[_0x271e('0x37')]['fields']));_0x545a81[_0x271e('0x3c')]=_0x545a81[_0x271e('0x3c')][_0x271e('0x5c')]?_0x545a81[_0x271e('0x3c')]:_0x3abb79[_0x271e('0x36')];if(_0xf46a9c[_0x271e('0x37')][_0x271e('0xc5')]){_0x545a81[_0x271e('0xc6')]=[{'all':!![]}];}_0x545a81=_[_0x271e('0x9a')]({},_0x545a81,_0xf46a9c[_0x271e('0xc7')]);return db[_0x271e('0x9b')][_0x271e('0x67')](_0x545a81)[_0x271e('0x1e')](handleEntityNotFound(_0xa16aad,null))[_0x271e('0x1e')](respondWithResult(_0xa16aad,null))['catch'](handleError(_0xa16aad,null));};exports[_0x271e('0xc8')]=function(_0x1ab2b9,_0x15b53f){return db[_0x271e('0x9b')][_0x271e('0xc8')](_0x1ab2b9['body'],{})['then'](respondWithResult(_0x15b53f,0xc9))[_0x271e('0x31')](handleError(_0x15b53f,null));};exports[_0x271e('0x1c')]=function(_0xad413e,_0x47333a){if(_0xad413e[_0x271e('0xc9')]['id']){delete _0xad413e[_0x271e('0xc9')]['id'];}return db[_0x271e('0x9b')][_0x271e('0x67')]({'where':{'id':_0xad413e[_0x271e('0xc4')]['id']}})[_0x271e('0x1e')](handleEntityNotFound(_0x47333a,null))[_0x271e('0x1e')](saveUpdates(_0xad413e[_0x271e('0xc9')],null))[_0x271e('0x1e')](respondWithResult(_0x47333a,null))[_0x271e('0x31')](handleError(_0x47333a,null));};exports[_0x271e('0x1d')]=function(_0x27f286,_0x4b49c7){return db['MailInteraction'][_0x271e('0x67')]({'where':{'id':_0x27f286[_0x271e('0xc4')]['id']}})['then'](handleEntityNotFound(_0x4b49c7,null))[_0x271e('0x1e')](removeEntity(_0x4b49c7,null))[_0x271e('0x31')](handleError(_0x4b49c7,null));};exports[_0x271e('0xca')]=function(_0x507f81,_0x4a6f57){return db[_0x271e('0x9b')]['describe']()[_0x271e('0x1e')](respondWithResult(_0x4a6f57,null))[_0x271e('0x31')](handleError(_0x4a6f57,null));};exports[_0x271e('0xcb')]=function(_0x3700e6,_0x2250fc){return db[_0x271e('0x2a')][_0x271e('0x67')]({'where':{'id':_0x3700e6[_0x271e('0xc4')]['id']}})[_0x271e('0x1e')](handleEntityNotFound(_0x2250fc,null))['then'](function(_0x2d44d8){if(_0x2d44d8){return _0x2d44d8[_0x271e('0xcb')](_0x3700e6['body'][_0x271e('0xcc')],_[_0x271e('0xcd')](_0x3700e6['body'],['ids','id'])||{});}})[_0x271e('0x1e')](respondWithResult(_0x2250fc,null))['catch'](handleError(_0x2250fc,null));};exports[_0x271e('0xce')]=function(_0x24e5e3,_0x115966){var _0x2d7383={'raw':![],'where':{}};var _0x24b295={};var _0x4c1123={'count':0x0,'rows':[]};return db[_0x271e('0x9b')][_0x271e('0x2b')]({'where':{'id':_0x24e5e3[_0x271e('0xc4')]['id']}})[_0x271e('0x1e')](handleEntityNotFound(_0x115966,null))[_0x271e('0x1e')](function(_0x1a59bb){if(_0x1a59bb){_0x24b295['model']=_[_0x271e('0x38')](db[_0x271e('0x2a')][_0x271e('0x33')]);_0x24b295[_0x271e('0x37')]=_[_0x271e('0x38')](_0x24e5e3[_0x271e('0x37')]);_0x24b295[_0x271e('0x39')]=_[_0x271e('0x3a')](_0x24b295[_0x271e('0x36')],_0x24b295[_0x271e('0x37')]);_0x2d7383[_0x271e('0x3c')]=_['intersection'](_0x24b295['model'],qs[_0x271e('0x3b')](_0x24e5e3['query'][_0x271e('0x3b')]));_0x2d7383['attributes']=_0x2d7383['attributes']['length']?_0x2d7383[_0x271e('0x3c')]:_0x24b295['model'];if(!_0x24e5e3[_0x271e('0x37')]['hasOwnProperty'](_0x271e('0x3e'))){_0x2d7383['limit']=qs[_0x271e('0x17')](_0x24e5e3['query'][_0x271e('0x17')]);_0x2d7383['offset']=qs['offset'](_0x24e5e3[_0x271e('0x37')][_0x271e('0x15')]);}_0x2d7383[_0x271e('0x8e')]=qs['sort'](_0x24e5e3['query'][_0x271e('0x3f')]);_0x2d7383[_0x271e('0x40')]=qs[_0x271e('0x39')](_[_0x271e('0x41')](_0x24e5e3[_0x271e('0x37')],_0x24b295[_0x271e('0x39')]));_0x2d7383[_0x271e('0x40')][_0x271e('0xbe')]=_0x1a59bb['id'];if(_0x24e5e3[_0x271e('0x37')]['filter']){_0x2d7383['where']=_[_0x271e('0x9a')](_0x2d7383[_0x271e('0x40')],{'$or':_[_0x271e('0x25')](_0x2d7383[_0x271e('0x3c')],function(_0x167af7){var _0x481564={};_0x481564[_0x167af7]={'$like':'%'+_0x24e5e3[_0x271e('0x37')][_0x271e('0x81')]+'%'};return _0x481564;})});}if(_0x24e5e3[_0x271e('0x37')][_0x271e('0xcf')]){var _0x377d5f=_0x24e5e3[_0x271e('0x37')][_0x271e('0xcf')][_0x271e('0x64')](',');var _0x1f7e65={};_0x1f7e65[_0x377d5f[0x0]]={'$gte':moment(_0x377d5f[0x1])['format'](_0x271e('0xd0'))};_0x2d7383['where']=_[_0x271e('0x9a')](_0x2d7383['where'],_0x1f7e65);}_0x2d7383=_['merge']({},_0x2d7383,_0x24e5e3[_0x271e('0xc7')]);return db[_0x271e('0x2a')]['count']({'where':_0x2d7383[_0x271e('0x40')]})[_0x271e('0x1e')](function(_0x34fd83){_0x4c1123['count']=_0x34fd83;if(_0x24e5e3[_0x271e('0x37')]['includeAll']){_0x2d7383[_0x271e('0xc6')]=[{'all':!![]}];}return db[_0x271e('0x2a')]['findAll'](_0x2d7383);})[_0x271e('0x1e')](function(_0x37a367){if(_0x24e5e3['query'][_0x271e('0xd1')]===_0x271e('0xd2')){for(var _0x3f651a=0x0;_0x3f651a<_0x37a367[_0x271e('0x5c')];_0x3f651a++){_0x37a367[_0x3f651a][_0x271e('0xc9')]=juice(_0x37a367[_0x3f651a][_0x271e('0xc9')]);}}_0x4c1123[_0x271e('0xc2')]=_0x37a367;return _0x4c1123;});}})['then'](respondWithFilteredResult(_0x115966,_0x2d7383))['catch'](handleError(_0x115966,null));};exports[_0x271e('0xd3')]=function(_0x583986,_0x17465c){return db[_0x271e('0x9b')][_0x271e('0x67')]({'where':{'id':_0x583986[_0x271e('0xc4')]['id']}})[_0x271e('0x1e')](handleEntityNotFound(_0x17465c,null))[_0x271e('0x1e')](function(_0x32de16){if(_0x32de16){return _0x32de16[_0x271e('0xd4')](_0x583986[_0x271e('0xc9')][_0x271e('0xcc')],_[_0x271e('0xcd')](_0x583986[_0x271e('0xc9')],['ids','id'])||{})[_0x271e('0xd5')](function(){return db[_0x271e('0x6c')]['findAll']({'attributes':['id','name',_0x271e('0xd6')],'where':{'id':_0x583986['body'][_0x271e('0xcc')]}});})['then'](function(_0x890350){socket[_0x271e('0xd7')](_0x271e('0xd8'),{'id':Number(_0x583986[_0x271e('0xc4')]['id']),'tags':_0x890350||[]});return{'id':Number(_0x583986[_0x271e('0xc4')]['id']),'tags':_0x890350||[]};});}})[_0x271e('0x1e')](respondWithResult(_0x17465c,null))[_0x271e('0x31')](handleError(_0x17465c,null));};exports[_0x271e('0xd9')]=function(_0x3ec45d,_0x58f853){return db['MailInteraction'][_0x271e('0x67')]({'where':{'id':_0x3ec45d[_0x271e('0xc4')]['id']}})[_0x271e('0x1e')](handleEntityNotFound(_0x58f853,null))[_0x271e('0x1e')](function(_0x31ac83){if(_0x31ac83){return _0x31ac83[_0x271e('0xd9')](_0x3ec45d[_0x271e('0x37')][_0x271e('0xcc')]);}})[_0x271e('0x1e')](respondWithStatusCode(_0x58f853,null))['catch'](handleError(_0x58f853,null));};exports[_0x271e('0xda')]=function(_0x524e0a,_0x4f0535){var _0x271408=moment()[_0x271e('0xdb')]()[_0x271e('0x98')]();var _0x584021=path[_0x271e('0xdc')](config[_0x271e('0xdd')],_0x271e('0xde'),'files',_0x271e('0xdf'));var _0x12ff3b=path[_0x271e('0xdc')](config[_0x271e('0xdd')],_0x271e('0xde'),'files',_0x271e('0xe0'));var _0x167e8f=path[_0x271e('0xdc')](_0x584021,_0x271408);var _0x269cb4=util[_0x271e('0xe1')](_0x271e('0xe2'),_0x524e0a[_0x271e('0xc4')]['id'],_0x271408);var _0x14eda2=path[_0x271e('0xdc')](_0x584021,_0x269cb4);var _0x513d69=[];if(_0x524e0a[_0x271e('0x37')][_0x271e('0xe0')]){_0x513d69[_0x271e('0x29')]({'model':db[_0x271e('0xe3')],'as':_0x271e('0xe4'),'raw':!![]});}var _0x38e2a0=[{'model':db[_0x271e('0x2a')],'as':_0x271e('0xe5'),'attributes':['id',_0x271e('0xc9'),'from','to','cc',_0x271e('0xe6'),_0x271e('0xe7'),'createdAt'],'where':{'secret':![]},'order':qs[_0x271e('0x3f')]('id'),'include':_0x513d69}];return db[_0x271e('0x9b')][_0x271e('0x67')]({'where':{'id':_0x524e0a[_0x271e('0xc4')]['id']},'include':_0x38e2a0})[_0x271e('0x1e')](handleEntityNotFound(_0x4f0535,null))[_0x271e('0x1e')](function(_0x450f9c){if(_0x450f9c&&_0x450f9c['Messages']){var _0x1a3945=_0x450f9c['get']({'plain':!![]});fs['mkdirSync'](_0x167e8f);return BPromise['each'](_0x1a3945['Messages'],function(_0x541885,_0x1f7711){var _0x20de7d={'from':_0x541885['from'],'to':_0x541885['to'],'subject':_0x541885[_0x271e('0xe7')],'html':htmlEntities['decode'](_0x541885[_0x271e('0xc9')]),'headers':{'Date':moment(_0x541885[_0x271e('0x77')])[_0x271e('0xe1')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x541885['cc']){_0x20de7d['headers']['Cc']=_0x541885['cc'];}if(_0x541885[_0x271e('0xe6')]){_0x20de7d[_0x271e('0xe8')][_0x271e('0xe9')]=_0x541885[_0x271e('0xe6')];}return new BPromise(function(_0x5427ad,_0x39783b){if(_0x541885[_0x271e('0xe4')]){for(var _0x470e68=0x0;_0x470e68<_0x541885['Attachments'][_0x271e('0x5c')];_0x470e68++){var _0x54a887=_0x541885['Attachments'][_0x470e68];var _0x25675a=path[_0x271e('0xdc')](_0x12ff3b,_0x54a887[_0x271e('0xea')]);if(fs[_0x271e('0xeb')](_0x25675a)){_0x20de7d[_0x271e('0xe0')][_0x271e('0x29')]({'name':_0x54a887[_0x271e('0x22')],'contentType':_0x54a887['type'],'data':fs[_0x271e('0xec')](_0x25675a)});}}}emlformat[_0x271e('0xed')](_0x20de7d,function(_0x18df1c,_0x5a09f8){if(_0x18df1c)return _0x39783b(_0x18df1c);fs[_0x271e('0xee')](path[_0x271e('0xdc')](_0x167e8f,util['format'](_0x271e('0xef'),_0x1f7711)),_0x5a09f8);return _0x5427ad(_0x5a09f8);});});})[_0x271e('0x1e')](function(){return new BPromise(function(_0xfdf3e3,_0xd7e1c9){zipdir(_0x167e8f,{'saveTo':_0x14eda2},function(_0x333961,_0x1caa11){if(_0x333961)return _0xd7e1c9(_0x333961);return _0xfdf3e3(_0x1caa11);});})[_0x271e('0x1e')](function(){return new BPromise(function(_0x9c8eeb,_0x1c4eac){rimraf(_0x167e8f,function(_0x24359d){if(_0x24359d)_0x1c4eac(_0x24359d);return _0x9c8eeb();});});})[_0x271e('0x1e')](function(){return _0x4f0535[_0x271e('0xda')](_0x14eda2,_0x269cb4,function(_0xf563d8){if(!_0xf563d8)fs[_0x271e('0xf0')](_0x14eda2);});});});}else{return _0x4f0535['sendStatus'](0xc8);}})[_0x271e('0x31')](handleError(_0x4f0535,null));}; \ No newline at end of file +var _0x56a5=['socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','end','error','name','send','fullname','TagIds','Tags','split','forEach','out','plainBody','lastMsgText','trimStart','catch','index','type','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','union','User','UserId','start','keys','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.substatus','i.to','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','findOne','push','all','params','MailInteraction','rawAttributes','includeAll','include','options','create','body','addMessage','MailMessage','ids','omit','getMessages','hasOwnProperty','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','bcc','subject','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','moment','bluebird','util','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','html-entities','defaults','localhost'];(function(_0x1e883f,_0x24d516){var _0x192684=function(_0x11fe53){while(--_0x11fe53){_0x1e883f['push'](_0x1e883f['shift']());}};_0x192684(++_0x24d516);}(_0x56a5,0x1c3));var _0x556a=function(_0x484bbb,_0x323d99){_0x484bbb=_0x484bbb-0x0;var _0x5d1634=_0x56a5[_0x484bbb];return _0x5d1634;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x556a('0x0'));var BPromise=require(_0x556a('0x1'));var util=require(_0x556a('0x2'));var path=require(_0x556a('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x556a('0x4'));var juice=require(_0x556a('0x5'));var Redis=require(_0x556a('0x6'));var qs=require(_0x556a('0x7'));var as=require(_0x556a('0x8'));var logger=require('../../config/logger')(_0x556a('0x9'));var config=require(_0x556a('0xa'));var db=require(_0x556a('0xb'))['db'];var htmlEntities=require(_0x556a('0xc'));config['redis']=_[_0x556a('0xd')](config['redis'],{'host':_0x556a('0xe'),'port':0x18eb});var socket=require(_0x556a('0xf'))(new Redis(config['redis']));require(_0x556a('0x10'))[_0x556a('0x11')](socket);function respondWithStatusCode(_0x2f73be,_0x484f2d){_0x484f2d=_0x484f2d||0xcc;return function(_0x2b5039){if(_0x2b5039){return _0x2f73be[_0x556a('0x12')](_0x484f2d);}return _0x2f73be[_0x556a('0x13')](_0x484f2d)['end']();};}function respondWithResult(_0x5a421b,_0xb3cedd){_0xb3cedd=_0xb3cedd||0xc8;return function(_0x5c174e){if(_0x5c174e){return _0x5a421b[_0x556a('0x13')](_0xb3cedd)[_0x556a('0x14')](_0x5c174e);}};}function respondWithFilteredResult(_0x275e98,_0x5e7d52){return function(_0x30b976){if(_0x30b976){var _0xb6b43a=typeof _0x5e7d52[_0x556a('0x15')]===_0x556a('0x16')&&typeof _0x5e7d52['limit']===_0x556a('0x16');var _0x4cd8e5=_0x30b976[_0x556a('0x17')];var _0x1bdeab=_0xb6b43a?0x0:_0x5e7d52['offset'];var _0x426116=_0xb6b43a?_0x30b976[_0x556a('0x17')]:_0x5e7d52[_0x556a('0x15')]+_0x5e7d52['limit'];var _0x1ab8a2;if(_0x426116>=_0x4cd8e5){_0x426116=_0x4cd8e5;_0x1ab8a2=0xc8;}else{_0x1ab8a2=0xce;}_0x275e98[_0x556a('0x13')](_0x1ab8a2);return _0x275e98[_0x556a('0x18')](_0x556a('0x19'),_0x1bdeab+'-'+_0x426116+'/'+_0x4cd8e5)[_0x556a('0x14')](_0x30b976);}return null;};}function saveUpdates(_0x34e771){return function(_0x46634d){if(_0x46634d){return _0x46634d[_0x556a('0x1a')](_0x34e771)[_0x556a('0x1b')](function(_0x2738c7){return _0x2738c7;});}return null;};}function removeEntity(_0xe1475a){return function(_0x51ac22){if(_0x51ac22){return _0x51ac22[_0x556a('0x1c')]()['then'](function(){_0xe1475a[_0x556a('0x13')](0xcc)[_0x556a('0x1d')]();});}};}function handleEntityNotFound(_0x237bc2){return function(_0xc8c391){if(!_0xc8c391){_0x237bc2[_0x556a('0x12')](0x194);}return _0xc8c391;};}function handleError(_0x486a37,_0x4278ad){_0x4278ad=_0x4278ad||0x1f4;return function(_0x64bf49){logger[_0x556a('0x1e')](_0x64bf49['stack']);if(_0x64bf49['name']){delete _0x64bf49[_0x556a('0x1f')];}_0x486a37[_0x556a('0x13')](_0x4278ad)[_0x556a('0x20')](_0x64bf49);};}function getInteractionUsers(_0x204285,_0x1000c4){return new BPromise(function(_0x5e2d37,_0x5f4140){try{if(_0x1000c4[_0x204285['id']]){_0x204285['Users']=_['map'](_0x1000c4[_0x204285['id']],function(_0x4647af){return{'id':_0x4647af['id'],'fullname':_0x4647af[_0x556a('0x21')]};});}}catch(_0x4e0cd7){_0x5f4140(_0x4e0cd7);}_0x5e2d37(_0x204285);});}function getInteractionTags(_0x3a6c38,_0x3c4f6c){return new BPromise(function(_0x4208a4,_0xcea3dc){try{if(_0x3a6c38[_0x556a('0x22')]){_0x3a6c38[_0x556a('0x23')]=[];_0x3a6c38[_0x556a('0x22')][_0x556a('0x24')](',')[_0x556a('0x25')](function(_0x25bdfd){_0x3a6c38['Tags']['push'](_0x3c4f6c[_0x25bdfd]);});}delete _0x3a6c38['TagIds'];}catch(_0x260760){_0xcea3dc(_0x260760);}_0x4208a4(_0x3a6c38);});}function getLastMessageText(_0x37cf39){return new BPromise(function(_0x32213a,_0x16fc44){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x37cf39['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x556a('0x26')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x556a('0x1b')](function(_0x1b1592){if(_0x1b1592&&_0x1b1592[_0x556a('0x27')]){_0x37cf39[_0x556a('0x28')]=_[_0x556a('0x29')](_0x1b1592['plainBody']);}_0x32213a(_0x37cf39);})[_0x556a('0x2a')](function(_0x58fbde){_0x16fc44(_0x58fbde);});});}function updateMailInteraction(_0x4a45be,_0x26f843,_0x27b265,_0x2da4b4){return new BPromise(function(_0x2ab752,_0x261862){return getInteractionUsers(_0x4a45be,_0x27b265)['then'](function(_0x100cde){return getInteractionTags(_0x100cde,_0x26f843);})['then'](function(_0xabddd8){if(_0x2da4b4){_0x2ab752(getLastMessageText(_0xabddd8));}else{_0x2ab752(_0xabddd8);}})[_0x556a('0x2a')](function(_0xfbc668){_0x261862(_0xfbc668);});});}exports[_0x556a('0x2b')]=function(_0x99392f,_0x344992){var _0x1047d4={},_0x33bbe7={},_0x55e2a5={'count':0x0,'rows':[]};var _0x305db3=_['map'](db['MailInteraction']['rawAttributes'],function(_0x3e6b92){return{'name':_0x3e6b92['fieldName'],'type':_0x3e6b92[_0x556a('0x2c')][_0x556a('0x2d')]};});_0x33bbe7['model']=_[_0x556a('0x2e')](_0x305db3,'name');_0x33bbe7[_0x556a('0x2f')]=_['keys'](_0x99392f['query']);_0x33bbe7[_0x556a('0x30')]=_[_0x556a('0x31')](_0x33bbe7[_0x556a('0x32')],_0x33bbe7[_0x556a('0x2f')]);_0x1047d4[_0x556a('0x33')]=_[_0x556a('0x31')](_0x33bbe7[_0x556a('0x32')],qs[_0x556a('0x34')](_0x99392f[_0x556a('0x2f')][_0x556a('0x34')]));_0x1047d4[_0x556a('0x33')]=_0x1047d4[_0x556a('0x33')][_0x556a('0x35')]?_0x1047d4['attributes']:_0x33bbe7[_0x556a('0x32')];if(!_0x99392f['query']['hasOwnProperty'](_0x556a('0x36'))){_0x1047d4[_0x556a('0x37')]=qs['limit'](_0x99392f[_0x556a('0x2f')][_0x556a('0x37')]);_0x1047d4[_0x556a('0x15')]=qs[_0x556a('0x15')](_0x99392f[_0x556a('0x2f')][_0x556a('0x15')]);}_0x1047d4['order']=qs[_0x556a('0x38')](_0x99392f[_0x556a('0x2f')][_0x556a('0x38')]);_0x1047d4[_0x556a('0x39')]=qs['filters'](_['pick'](_0x99392f[_0x556a('0x2f')],_0x33bbe7['filters']),_0x305db3);var _0x37bf3c=[];var _0x1a01ae=squel[_0x556a('0x3a')]()[_0x556a('0x3b')]('id')[_0x556a('0x3b')]('name')[_0x556a('0x3b')]('color')[_0x556a('0x3c')](_0x556a('0x3d'));var _0x8d9c80=squel[_0x556a('0x3a')]()[_0x556a('0x3b')](_0x556a('0x3e'))[_0x556a('0x3b')](_0x556a('0x3f'))[_0x556a('0x3b')](_0x556a('0x40'))['from'](_0x556a('0x41'),'ui')[_0x556a('0x42')](_0x556a('0x43'),'u',_0x556a('0x44'));var _0x332de7=squel['select']()[_0x556a('0x3c')](_0x556a('0x45'),'i')['left_join']('cm_contacts','c',_0x556a('0x46'))['left_join'](_0x556a('0x43'),'o',_0x556a('0x47'))['left_join'](_0x556a('0x48'),'a',_0x556a('0x49'))[_0x556a('0x42')](_0x556a('0x4a'),'me',_0x556a('0x4b'))[_0x556a('0x42')](_0x556a('0x4c'),'it',_0x556a('0x4d'))[_0x556a('0x42')](_0x556a('0x3d'),'t',_0x556a('0x4e'));var _0x4d2a7e=squel[_0x556a('0x4f')]();var _0x5044ab=[];var _0xd7b148=squel['expr']();var _0x48d308;if(_0x99392f[_0x556a('0x2f')][_0x556a('0x50')]){_0x48d308=as[_0x556a('0x51')](_0x99392f[_0x556a('0x2f')][_0x556a('0x50')]);var _0x4819d6=_0x48d308[_0x556a('0x52')];for(var _0x57b1ea=0x0;_0x57b1ea<_0x48d308[_0x556a('0x53')][_0x556a('0x35')];_0x57b1ea++){var _0x3b2a2d=_0x48d308[_0x556a('0x53')][_0x57b1ea];var _0x3f3cb1='i';var _0x8c60df=_[_0x556a('0x54')](_0x305db3,['name',_0x3b2a2d['field']]);if(!_0x8c60df){switch(_0x3b2a2d[_0x556a('0x3b')]){case _0x556a('0x55'):if(_0x3b2a2d['value']==0x1){_0x332de7[_0x556a('0x56')]('`'+_0x3b2a2d['field']+_0x556a('0x57'));}else{_0x332de7[_0x556a('0x56')]('`'+_0x3b2a2d[_0x556a('0x3b')]+_0x556a('0x58'));}break;case'Contact':if(_0x3b2a2d[_0x556a('0x59')]===_0x556a('0x5a')){if(_0x3b2a2d[_0x556a('0x5b')][_0x556a('0x24')]('\x20')[_0x556a('0x35')]>0x1){_0x4d2a7e[_0x4819d6](_0x556a('0x5c'),qs[_0x556a('0x5d')](_0x3b2a2d[_0x556a('0x5b')]),null);}else{var _0xfb51ac='%'+_0x3b2a2d[_0x556a('0x5b')]+'%';_0x4d2a7e[_0x4819d6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xfb51ac,_0xfb51ac,_0xfb51ac);}}else{_0x8c60df=_[_0x556a('0x54')](_0x305db3,[_0x556a('0x1f'),_0x556a('0x5e')]);_0x3b2a2d[_0x556a('0x3b')]=_0x556a('0x5e');_0x2edb32=as[_0x556a('0x5f')](_0x3f3cb1,_0x8c60df['type'],_0x3b2a2d);_0x4d2a7e[_0x4819d6](_0x2edb32[_0x556a('0x60')],_0x2edb32['value']['start'],_0x2edb32[_0x556a('0x5b')][_0x556a('0x1d')]);}break;case _0x556a('0x61'):var _0x425e69=_0x3b2a2d[_0x556a('0x5b')][_0x556a('0x24')](',')[_0x556a('0x2e')](function(_0x2f237d){return Number(_0x2f237d);});_0x425e69['forEach'](function(_0x37cc1f){_0xd7b148['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37cc1f+',%');});_0x5044ab=_[_0x556a('0x62')](_0x5044ab,_0x425e69);break;case _0x556a('0x63'):if(_0x3b2a2d[_0x556a('0x59')]===_0x556a('0x5a')){_0x4d2a7e[_0x4819d6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3b2a2d['value']+'%',null);}else{_0x8c60df=_[_0x556a('0x54')](_0x305db3,[_0x556a('0x1f'),_0x556a('0x64')]);_0x3b2a2d[_0x556a('0x3b')]=_0x556a('0x64');_0x2edb32=as[_0x556a('0x5f')](_0x3f3cb1,_0x8c60df['type'],_0x3b2a2d);_0x4d2a7e[_0x4819d6](_0x2edb32['text'],_0x2edb32[_0x556a('0x5b')]['start'],_0x2edb32[_0x556a('0x5b')]['end']);}break;case _0x556a('0x27'):_0x2edb32=as[_0x556a('0x5f')]('me',null,_0x3b2a2d);_0x4d2a7e[_0x4819d6](_0x2edb32[_0x556a('0x60')],_0x2edb32[_0x556a('0x5b')][_0x556a('0x65')],_0x2edb32[_0x556a('0x5b')][_0x556a('0x1d')]);break;}}else{var _0x2edb32=as['buildExpression'](_0x3f3cb1,_0x8c60df[_0x556a('0x2c')],_0x3b2a2d);_0x4d2a7e[_0x4819d6](_0x2edb32['text'],_0x2edb32[_0x556a('0x5b')]['start'],_0x2edb32[_0x556a('0x5b')][_0x556a('0x1d')]);}}}else{var _0x24ec16=_(_0x99392f[_0x556a('0x2f')])[_0x556a('0x66')]()[_0x556a('0x2e')](function(_0x39c95c){return _[_0x556a('0x67')](_0x305db3,[_0x556a('0x1f'),_0x39c95c])?_0x39c95c:undefined;})[_0x556a('0x68')]()[_0x556a('0x5b')]();if(!_['isEmpty'](_0x24ec16)){_0x24ec16[_0x556a('0x25')](function(_0x17171d){if(_0x17171d===_0x556a('0x69')){_0x332de7['where'](_0x556a('0x6a'),[][_0x556a('0x6b')](_0x99392f[_0x556a('0x2f')][_0x17171d]));}else if(_0x17171d===_0x556a('0x6c')){var _0x461dd7=JSON[_0x556a('0x6d')](_0x99392f['query'][_0x17171d])[_0x556a('0x6e')];var _0x130d4e=JSON['parse'](_0x99392f['query'][_0x17171d])[_0x556a('0x6f')];_0x332de7['where'](_0x556a('0x70'),_0x461dd7,_0x130d4e);}else{if(_0x99392f[_0x556a('0x2f')][_0x17171d]===_0x556a('0x71')){_0x332de7[_0x556a('0x39')]('i.'+_0x17171d+_0x556a('0x72'));}else{_0x332de7['where']('i.'+_0x17171d+_0x556a('0x73'),_0x99392f['query'][_0x17171d]);}}});}if(_0x99392f[_0x556a('0x2f')][_0x556a('0x74')]){if(_0x99392f['query'][_0x556a('0x74')]==0x1){_0x332de7['having'](_0x556a('0x75'));}else{_0x332de7[_0x556a('0x56')](_0x556a('0x76'));}}if(_0x99392f[_0x556a('0x2f')][_0x556a('0x77')]){_0x5044ab=_[_0x556a('0x78')](_0x99392f[_0x556a('0x2f')]['tag'])?_0x99392f['query'][_0x556a('0x77')]:new Array(_0x99392f[_0x556a('0x2f')][_0x556a('0x77')]);_0x5044ab[_0x556a('0x25')](function(_0x439a55){_0xd7b148['or'](_0x556a('0x79'),'%,'+_0x439a55+',%');});}if(_0x99392f[_0x556a('0x2f')][_0x556a('0x7a')]){var _0x21d651=_0x99392f[_0x556a('0x2f')][_0x556a('0x7a')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x21d651)){_0x4d2a7e['or'](_0x556a('0x7b'),_0x21d651+'%');}else if(qs[_0x556a('0x7c')](_0x21d651)){_0x4d2a7e['or'](_0x556a('0x7d'),_0x21d651+'%');}else{_0x4d2a7e['or'](_0x556a('0x7e'),qs[_0x556a('0x5d')](_0x21d651))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x556a('0x5d')](_0x21d651));}}}_0x332de7['where'](_0x4d2a7e);_0x332de7[_0x556a('0x7f')]('i.id');var _0x7b8150={'type':db[_0x556a('0x80')]['QueryTypes'][_0x556a('0x81')],'raw':!![]};var _0x3d4777=_0x332de7[_0x556a('0x82')]();_0x3d4777[_0x556a('0x3b')](_0x556a('0x83'));_0x3d4777['field'](_0x556a('0x84'),_0x556a('0x55'));if(_0x1047d4[_0x556a('0x85')]){_0x1047d4[_0x556a('0x85')][_0x556a('0x25')](function(_0x1186ca){var _0x28d0b2=_0x1186ca[0x0]===_0x556a('0x86')?_0x1186ca[0x0]:'i.'+_0x1186ca[0x0];_0x332de7[_0x556a('0x85')](_0x28d0b2,_0x1186ca[0x1]===_0x556a('0x87')?![]:!![]);});}if(!_[_0x556a('0x88')](_0x5044ab)){_0x332de7[_0x556a('0x56')](_0xd7b148);_0x3d4777[_0x556a('0x39')](_0x556a('0x89'),_0x5044ab);}BPromise[_0x556a('0x8a')]()[_0x556a('0x1b')](function(){if(!_0x48d308){if(_0x99392f[_0x556a('0x2f')][_0x556a('0x69')])return;_0x3d4777['where'](_0x556a('0x8b'));_0x332de7[_0x556a('0x39')](_0x556a('0x8b'));return;}if(_0x99392f['user'][_0x556a('0x8c')]!=='agent')return;return _0x99392f[_0x556a('0x8d')][_0x556a('0x8e')]({'attributes':['id'],'raw':!![]})[_0x556a('0x1b')](function(_0x5b250e){if(_['isEmpty'](_0x5b250e)){_0x3d4777[_0x556a('0x39')](_0x556a('0x8f'));_0x332de7[_0x556a('0x39')](_0x556a('0x8f'));}else{_0x3d4777[_0x556a('0x39')](_0x556a('0x6a'),_['map'](_0x5b250e,'id'));_0x332de7[_0x556a('0x39')]('i.MailAccountId\x20IN\x20?',_['map'](_0x5b250e,'id'));}});})[_0x556a('0x1b')](function(){if(_0x99392f[_0x556a('0x8d')]['role']===_0x556a('0x90')&&!_0x48d308&&!_0x99392f[_0x556a('0x2f')]['MailAccountId'])return[];return db['sequelize'][_0x556a('0x2f')](_0x3d4777[_0x556a('0x91')](),_0x7b8150);})['then'](function(_0x2e0308){_0x55e2a5['count']=_0x2e0308[_0x556a('0x35')];if(_0x55e2a5[_0x556a('0x17')]===0x0)return[];return db[_0x556a('0x92')][_0x556a('0x2f')](_0x1a01ae[_0x556a('0x91')](),_0x7b8150)['then'](function(_0x14f6c4){_0x37bf3c=_[_0x556a('0x93')](_0x14f6c4,'id');_0x7b8150=_[_0x556a('0x94')](_0x7b8150,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x99392f[_0x556a('0x2f')]['fields']){_0x1047d4[_0x556a('0x33')][_0x556a('0x25')](function(_0x2b3ae5){_0x332de7[_0x556a('0x3b')]('i.'+_0x2b3ae5);});}else{_0x332de7[_0x556a('0x3b')](_0x556a('0x84'),_0x556a('0x55'));_0x332de7[_0x556a('0x3b')](_0x556a('0x95'),_0x556a('0x96'));_0x332de7[_0x556a('0x3b')](_0x556a('0x97'),_0x556a('0x98'));_0x332de7[_0x556a('0x3b')](_0x556a('0x99'),_0x556a('0x86'));_0x332de7['field'](_0x556a('0x83'));_0x332de7['field']('i.createdAt');_0x332de7[_0x556a('0x3b')](_0x556a('0x9a'));_0x332de7[_0x556a('0x3b')]('i.closed');_0x332de7[_0x556a('0x3b')]('i.closedAt');_0x332de7[_0x556a('0x3b')]('i.attach');_0x332de7[_0x556a('0x3b')](_0x556a('0x9b'));_0x332de7[_0x556a('0x3b')](_0x556a('0x9c'));_0x332de7[_0x556a('0x3b')](_0x556a('0x9d'));_0x332de7[_0x556a('0x3b')]('i.disposition');_0x332de7[_0x556a('0x3b')]('i.secondDisposition');_0x332de7[_0x556a('0x3b')]('i.thirdDisposition');_0x332de7['field'](_0x556a('0x9e'));_0x332de7[_0x556a('0x3b')](_0x556a('0x9f'));_0x332de7[_0x556a('0x3b')]('i.ContactId');_0x332de7['field']('i.MailAccountId');_0x332de7[_0x556a('0x3b')](_0x556a('0xa0'));_0x332de7[_0x556a('0x3b')](_0x556a('0xa1'),_0x556a('0xa2'));_0x332de7[_0x556a('0x3b')](_0x556a('0xa3'),_0x556a('0xa4'));_0x332de7[_0x556a('0x3b')]('c.email',_0x556a('0xa5'));_0x332de7[_0x556a('0x3b')](_0x556a('0xa6'),'Contact.phone');_0x332de7[_0x556a('0x3b')](_0x556a('0xa7'),_0x556a('0xa8'));_0x332de7[_0x556a('0x3b')](_0x556a('0xa9'),'Contact.fax');_0x332de7['field'](_0x556a('0xaa'),_0x556a('0xab'));_0x332de7[_0x556a('0x3b')](_0x556a('0xac'),'Owner.internal');_0x332de7[_0x556a('0x3b')](_0x556a('0xad'),_0x556a('0x22'));}if(_0x1047d4['limit'])_0x332de7['limit'](_0x1047d4['limit']);if(_0x1047d4['offset'])_0x332de7['offset'](_0x1047d4[_0x556a('0x15')]);return db[_0x556a('0x92')][_0x556a('0x2f')](_0x332de7['toString'](),_0x7b8150);})['then'](function(_0x2f95ab){if(_0x2f95ab[_0x556a('0x35')]>0x0)_0x8d9c80[_0x556a('0x39')](_0x556a('0xae'),_[_0x556a('0x2e')](_0x2f95ab,'id'));return db[_0x556a('0x92')][_0x556a('0x2f')](_0x8d9c80[_0x556a('0x91')](),_0x7b8150)[_0x556a('0x1b')](function(_0x3d190d){var _0x707872=_[_0x556a('0xaf')](_0x3d190d,'MailInteractionId');var _0x214168=[];return db[_0x556a('0xb0')][_0x556a('0xb1')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x556a('0x1b')](function(_0x593e10){var _0x571a31=_0x593e10['enableEmailPreview'];_0x2f95ab[_0x556a('0x25')](function(_0xee3f93){_0x214168[_0x556a('0xb2')](updateMailInteraction(_0xee3f93,_0x37bf3c,_0x707872,_0x571a31));});return BPromise[_0x556a('0xb3')](_0x214168);});});});})[_0x556a('0x1b')](function(_0x4919c5){_0x55e2a5['rows']=_0x4919c5;return _0x55e2a5;})['then'](respondWithFilteredResult(_0x344992,_0x1047d4))['catch'](handleError(_0x344992,null));};exports['show']=function(_0x37619a,_0xef71c9){var _0x5808eb={'raw':![],'where':{'id':_0x37619a[_0x556a('0xb4')]['id']}},_0x250026={};_0x250026[_0x556a('0x32')]=_[_0x556a('0x66')](db[_0x556a('0xb5')][_0x556a('0xb6')]);_0x250026[_0x556a('0x2f')]=_[_0x556a('0x66')](_0x37619a['query']);_0x250026['filters']=_[_0x556a('0x31')](_0x250026[_0x556a('0x32')],_0x250026[_0x556a('0x2f')]);_0x5808eb['attributes']=_[_0x556a('0x31')](_0x250026['model'],qs[_0x556a('0x34')](_0x37619a[_0x556a('0x2f')][_0x556a('0x34')]));_0x5808eb['attributes']=_0x5808eb[_0x556a('0x33')]['length']?_0x5808eb[_0x556a('0x33')]:_0x250026[_0x556a('0x32')];if(_0x37619a[_0x556a('0x2f')][_0x556a('0xb7')]){_0x5808eb[_0x556a('0xb8')]=[{'all':!![]}];}_0x5808eb=_['merge']({},_0x5808eb,_0x37619a[_0x556a('0xb9')]);return db['MailInteraction'][_0x556a('0x54')](_0x5808eb)[_0x556a('0x1b')](handleEntityNotFound(_0xef71c9,null))[_0x556a('0x1b')](respondWithResult(_0xef71c9,null))[_0x556a('0x2a')](handleError(_0xef71c9,null));};exports[_0x556a('0xba')]=function(_0x596b27,_0x33430a){return db[_0x556a('0xb5')]['create'](_0x596b27[_0x556a('0xbb')],{})[_0x556a('0x1b')](respondWithResult(_0x33430a,0xc9))[_0x556a('0x2a')](handleError(_0x33430a,null));};exports['update']=function(_0x74e584,_0x5b878f){if(_0x74e584[_0x556a('0xbb')]['id']){delete _0x74e584[_0x556a('0xbb')]['id'];}return db[_0x556a('0xb5')][_0x556a('0x54')]({'where':{'id':_0x74e584['params']['id']}})[_0x556a('0x1b')](handleEntityNotFound(_0x5b878f,null))[_0x556a('0x1b')](saveUpdates(_0x74e584[_0x556a('0xbb')],null))[_0x556a('0x1b')](respondWithResult(_0x5b878f,null))['catch'](handleError(_0x5b878f,null));};exports[_0x556a('0x1c')]=function(_0x2c0185,_0x43f6ce){return db[_0x556a('0xb5')]['find']({'where':{'id':_0x2c0185[_0x556a('0xb4')]['id']}})[_0x556a('0x1b')](handleEntityNotFound(_0x43f6ce,null))[_0x556a('0x1b')](removeEntity(_0x43f6ce,null))['catch'](handleError(_0x43f6ce,null));};exports['describe']=function(_0x28ec92,_0x512b71){return db[_0x556a('0xb5')]['describe']()['then'](respondWithResult(_0x512b71,null))[_0x556a('0x2a')](handleError(_0x512b71,null));};exports[_0x556a('0xbc')]=function(_0x6a2f01,_0x1e2b2f){return db[_0x556a('0xbd')]['find']({'where':{'id':_0x6a2f01[_0x556a('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1e2b2f,null))[_0x556a('0x1b')](function(_0x2b019f){if(_0x2b019f){return _0x2b019f[_0x556a('0xbc')](_0x6a2f01['body'][_0x556a('0xbe')],_[_0x556a('0xbf')](_0x6a2f01[_0x556a('0xbb')],['ids','id'])||{});}})['then'](respondWithResult(_0x1e2b2f,null))[_0x556a('0x2a')](handleError(_0x1e2b2f,null));};exports[_0x556a('0xc0')]=function(_0x4fcbf3,_0x3a03f8){var _0x319de2={'raw':![],'where':{}};var _0xebea7e={};var _0x3f2c31={'count':0x0,'rows':[]};return db[_0x556a('0xb5')][_0x556a('0xb1')]({'where':{'id':_0x4fcbf3['params']['id']}})[_0x556a('0x1b')](handleEntityNotFound(_0x3a03f8,null))[_0x556a('0x1b')](function(_0x371607){if(_0x371607){_0xebea7e[_0x556a('0x32')]=_[_0x556a('0x66')](db['MailMessage']['rawAttributes']);_0xebea7e[_0x556a('0x2f')]=_[_0x556a('0x66')](_0x4fcbf3[_0x556a('0x2f')]);_0xebea7e[_0x556a('0x30')]=_['intersection'](_0xebea7e[_0x556a('0x32')],_0xebea7e[_0x556a('0x2f')]);_0x319de2[_0x556a('0x33')]=_[_0x556a('0x31')](_0xebea7e[_0x556a('0x32')],qs[_0x556a('0x34')](_0x4fcbf3['query'][_0x556a('0x34')]));_0x319de2[_0x556a('0x33')]=_0x319de2[_0x556a('0x33')]['length']?_0x319de2[_0x556a('0x33')]:_0xebea7e[_0x556a('0x32')];if(!_0x4fcbf3[_0x556a('0x2f')][_0x556a('0xc1')](_0x556a('0x36'))){_0x319de2['limit']=qs['limit'](_0x4fcbf3[_0x556a('0x2f')]['limit']);_0x319de2[_0x556a('0x15')]=qs['offset'](_0x4fcbf3[_0x556a('0x2f')]['offset']);}_0x319de2[_0x556a('0x85')]=qs[_0x556a('0x38')](_0x4fcbf3[_0x556a('0x2f')]['sort']);_0x319de2[_0x556a('0x39')]=qs[_0x556a('0x30')](_[_0x556a('0xc2')](_0x4fcbf3['query'],_0xebea7e[_0x556a('0x30')]));_0x319de2[_0x556a('0x39')][_0x556a('0xc3')]=_0x371607['id'];if(_0x4fcbf3['query']['filter']){_0x319de2[_0x556a('0x39')]=_[_0x556a('0x94')](_0x319de2[_0x556a('0x39')],{'$or':_[_0x556a('0x2e')](_0x319de2['attributes'],function(_0x46847c){var _0x48b044={};_0x48b044[_0x46847c]={'$like':'%'+_0x4fcbf3[_0x556a('0x2f')]['filter']+'%'};return _0x48b044;})});}if(_0x4fcbf3['query'][_0x556a('0x6e')]){var _0x5183de=_0x4fcbf3[_0x556a('0x2f')]['$gte']['split'](',');var _0x7b32a5={};_0x7b32a5[_0x5183de[0x0]]={'$gte':moment(_0x5183de[0x1])[_0x556a('0xc4')](_0x556a('0xc5'))};_0x319de2[_0x556a('0x39')]=_['merge'](_0x319de2[_0x556a('0x39')],_0x7b32a5);}_0x319de2=_[_0x556a('0x94')]({},_0x319de2,_0x4fcbf3['options']);return db[_0x556a('0xbd')][_0x556a('0x17')]({'where':_0x319de2['where']})['then'](function(_0x2b8986){_0x3f2c31[_0x556a('0x17')]=_0x2b8986;if(_0x4fcbf3['query'][_0x556a('0xb7')]){_0x319de2['include']=[{'all':!![]}];}return db[_0x556a('0xbd')][_0x556a('0xc6')](_0x319de2);})[_0x556a('0x1b')](function(_0x57c94a){if(_0x4fcbf3['query'][_0x556a('0xc7')]===_0x556a('0xc8')){for(var _0x5682bd=0x0;_0x5682bd<_0x57c94a[_0x556a('0x35')];_0x5682bd++){_0x57c94a[_0x5682bd]['body']=juice(_0x57c94a[_0x5682bd][_0x556a('0xbb')]);}}_0x3f2c31[_0x556a('0xc9')]=_0x57c94a;return _0x3f2c31;});}})['then'](respondWithFilteredResult(_0x3a03f8,_0x319de2))['catch'](handleError(_0x3a03f8,null));};exports[_0x556a('0xca')]=function(_0x331c13,_0x242458){return db[_0x556a('0xb5')][_0x556a('0x54')]({'where':{'id':_0x331c13[_0x556a('0xb4')]['id']}})[_0x556a('0x1b')](handleEntityNotFound(_0x242458,null))[_0x556a('0x1b')](function(_0x5ab3c8){if(_0x5ab3c8){return _0x5ab3c8[_0x556a('0xcb')](_0x331c13[_0x556a('0xbb')][_0x556a('0xbe')],_[_0x556a('0xbf')](_0x331c13[_0x556a('0xbb')],[_0x556a('0xbe'),'id'])||{})[_0x556a('0xcc')](function(){return db['Tag'][_0x556a('0xc6')]({'attributes':['id',_0x556a('0x1f'),'color'],'where':{'id':_0x331c13[_0x556a('0xbb')][_0x556a('0xbe')]}});})['then'](function(_0x260224){socket['emit'](_0x556a('0xcd'),{'id':Number(_0x331c13[_0x556a('0xb4')]['id']),'tags':_0x260224||[]});return{'id':Number(_0x331c13[_0x556a('0xb4')]['id']),'tags':_0x260224||[]};});}})[_0x556a('0x1b')](respondWithResult(_0x242458,null))[_0x556a('0x2a')](handleError(_0x242458,null));};exports[_0x556a('0xce')]=function(_0x265ae5,_0x47f77e){return db[_0x556a('0xb5')][_0x556a('0x54')]({'where':{'id':_0x265ae5[_0x556a('0xb4')]['id']}})[_0x556a('0x1b')](handleEntityNotFound(_0x47f77e,null))[_0x556a('0x1b')](function(_0x5ace85){if(_0x5ace85){return _0x5ace85['removeTags'](_0x265ae5[_0x556a('0x2f')][_0x556a('0xbe')]);}})[_0x556a('0x1b')](respondWithStatusCode(_0x47f77e,null))[_0x556a('0x2a')](handleError(_0x47f77e,null));};exports[_0x556a('0xcf')]=function(_0x247fe1,_0x356ad3){var _0x48e568=moment()[_0x556a('0xd0')]()[_0x556a('0x91')]();var _0x4ae896=path[_0x556a('0xd1')](config[_0x556a('0xd2')],'server',_0x556a('0xd3'),_0x556a('0xd4'));var _0x4353f7=path['join'](config[_0x556a('0xd2')],_0x556a('0xd5'),'files','attachments');var _0x23beaf=path[_0x556a('0xd1')](_0x4ae896,_0x48e568);var _0x1a4543=util['format'](_0x556a('0xd6'),_0x247fe1[_0x556a('0xb4')]['id'],_0x48e568);var _0x5dcb86=path[_0x556a('0xd1')](_0x4ae896,_0x1a4543);var _0x280359=[];if(_0x247fe1[_0x556a('0x2f')][_0x556a('0xd7')]){_0x280359['push']({'model':db[_0x556a('0xd8')],'as':_0x556a('0xd9'),'raw':!![]});}var _0x3e42c6=[{'model':db[_0x556a('0xbd')],'as':_0x556a('0xda'),'attributes':['id',_0x556a('0xbb'),_0x556a('0x3c'),'to','cc',_0x556a('0xdb'),_0x556a('0xdc'),_0x556a('0x6c')],'where':{'secret':![]},'order':qs[_0x556a('0x38')]('id'),'include':_0x280359}];return db[_0x556a('0xb5')]['find']({'where':{'id':_0x247fe1['params']['id']},'include':_0x3e42c6})['then'](handleEntityNotFound(_0x356ad3,null))['then'](function(_0x12fd5f){if(_0x12fd5f&&_0x12fd5f['Messages']){var _0x36d050=_0x12fd5f[_0x556a('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x23beaf);return BPromise[_0x556a('0xde')](_0x36d050[_0x556a('0xda')],function(_0x2092ff,_0x82efd0){var _0x3dd030={'from':_0x2092ff[_0x556a('0x3c')],'to':_0x2092ff['to'],'subject':_0x2092ff[_0x556a('0xdc')],'html':htmlEntities[_0x556a('0xdf')](_0x2092ff['body']),'headers':{'Date':moment(_0x2092ff[_0x556a('0x6c')])[_0x556a('0xc4')](_0x556a('0xe0'))},'attachments':[]};if(_0x2092ff['cc']){_0x3dd030[_0x556a('0xe1')]['Cc']=_0x2092ff['cc'];}if(_0x2092ff[_0x556a('0xdb')]){_0x3dd030['headers'][_0x556a('0xe2')]=_0x2092ff['bcc'];}return new BPromise(function(_0x38cb7b,_0x55e2f7){if(_0x2092ff['Attachments']){for(var _0x35adbc=0x0;_0x35adbc<_0x2092ff[_0x556a('0xd9')][_0x556a('0x35')];_0x35adbc++){var _0x46f0a3=_0x2092ff[_0x556a('0xd9')][_0x35adbc];var _0x153583=path['join'](_0x4353f7,_0x46f0a3[_0x556a('0xe3')]);if(fs['existsSync'](_0x153583)){_0x3dd030['attachments'][_0x556a('0xb2')]({'name':_0x46f0a3['name'],'contentType':_0x46f0a3['type'],'data':fs[_0x556a('0xe4')](_0x153583)});}}}emlformat[_0x556a('0xe5')](_0x3dd030,function(_0x2f79e2,_0x288dab){if(_0x2f79e2)return _0x55e2f7(_0x2f79e2);fs[_0x556a('0xe6')](path['join'](_0x23beaf,util[_0x556a('0xc4')](_0x556a('0xe7'),_0x82efd0)),_0x288dab);return _0x38cb7b(_0x288dab);});});})[_0x556a('0x1b')](function(){return new BPromise(function(_0x4d70a5,_0x254362){zipdir(_0x23beaf,{'saveTo':_0x5dcb86},function(_0x404361,_0x243198){if(_0x404361)return _0x254362(_0x404361);return _0x4d70a5(_0x243198);});})[_0x556a('0x1b')](function(){return new BPromise(function(_0xd9a8dc,_0x381d26){rimraf(_0x23beaf,function(_0x105d4f){if(_0x105d4f)_0x381d26(_0x105d4f);return _0xd9a8dc();});});})[_0x556a('0x1b')](function(){return _0x356ad3['download'](_0x5dcb86,_0x1a4543,function(_0x2f4bcf){if(!_0x2f4bcf)fs[_0x556a('0xe8')](_0x5dcb86);});});});}else{return _0x356ad3[_0x556a('0x12')](0xc8);}})['catch'](handleError(_0x356ad3,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8be2329..b08163b 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 _0xfa5b=['hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x20f6b0,_0x496635){var _0x3703f2=function(_0x54e9d0){while(--_0x54e9d0){_0x20f6b0['push'](_0x20f6b0['shift']());}};_0x3703f2(++_0x496635);}(_0xfa5b,0x6e));var _0xbfa5=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xfa5b[_0x38eb23];return _0x48506a;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xbfa5('0x0'))['db'][_0xbfa5('0x1')];var MailMessage=require(_0xbfa5('0x0'))['db'][_0xbfa5('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbfa5('0x3')](0x0);var events={'afterCreate':_0xbfa5('0x4'),'afterUpdate':'update','afterDestroy':_0xbfa5('0x5')};function emitEvent(_0xc12ac2){return function(_0x41438b,_0x48b80a,_0x1c7250){_0x41438b[_0xbfa5('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9f4c0){_0x41438b[_0xbfa5('0x7')](_0xbfa5('0x8'),_0x9f4c0[_0xbfa5('0x9')](function(_0x1283cd){return{'id':_0x1283cd['id']};}));return MailMessage[_0xbfa5('0xa')]({'where':{'MailInteractionId':_0x41438b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x207542){_0x41438b[_0xbfa5('0x7')](_0xbfa5('0xb'),_0x207542[_0xbfa5('0xc')]);MailInteractionEvents[_0xbfa5('0xd')](_0xc12ac2+':'+_0x41438b['id'],_0x41438b);MailInteractionEvents[_0xbfa5('0xd')](_0xc12ac2,_0x41438b);_0x1c7250(null);})[_0xbfa5('0xe')](_0x1c7250(null));};}for(var e in events){if(events[_0xbfa5('0xf')](e)){var event=events[e];MailInteraction[_0xbfa5('0x10')](e,emitEvent(event));}}module[_0xbfa5('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x06dc=['then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06dc,0x1de));var _0xc06d=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x06dc[_0x20ef64];return _0x3707d8;};'use strict';var EventEmitter=require(_0xc06d('0x0'));var MailInteraction=require(_0xc06d('0x1'))['db'][_0xc06d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xc06d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc06d('0x4'),'afterUpdate':_0xc06d('0x5'),'afterDestroy':_0xc06d('0x6')};function emitEvent(_0x5c00f4){return function(_0x16ab95,_0x47c177,_0x4980e6){_0x16ab95[_0xc06d('0x7')]({'attributes':['id'],'raw':!![]})[_0xc06d('0x8')](function(_0x5a253c){_0x16ab95[_0xc06d('0x9')]('Users',_0x5a253c[_0xc06d('0xa')](function(_0x4e307a){return{'id':_0x4e307a['id']};}));return MailMessage[_0xc06d('0xb')]({'where':{'MailInteractionId':_0x16ab95['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc06d('0x8')](function(_0x16e371){_0x16ab95[_0xc06d('0x9')](_0xc06d('0xc'),_0x16e371[_0xc06d('0xd')]);MailInteractionEvents[_0xc06d('0xe')](_0x5c00f4+':'+_0x16ab95['id'],_0x16ab95);MailInteractionEvents[_0xc06d('0xe')](_0x5c00f4,_0x16ab95);_0x4980e6(null);})[_0xc06d('0xf')](_0x4980e6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xc06d('0x10')](e,emitEvent(event));}}module[_0xc06d('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 53ebadc..fe68595 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 _0x4a1d=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4dc80c,_0x4749a8){var _0x5250f6=function(_0x86e61b){while(--_0x86e61b){_0x4dc80c['push'](_0x4dc80c['shift']());}};_0x5250f6(++_0x4749a8);}(_0x4a1d,0x168));var _0xd4a1=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x4a1d[_0x1beef3];return _0x5af964;};'use strict';var _=require('lodash');var util=require(_0xd4a1('0x0'));var logger=require(_0xd4a1('0x1'))(_0xd4a1('0x2'));var moment=require(_0xd4a1('0x3'));var BPromise=require(_0xd4a1('0x4'));var rp=require(_0xd4a1('0x5'));var fs=require('fs');var path=require(_0xd4a1('0x6'));var rimraf=require('rimraf');var config=require(_0xd4a1('0x7'));var attributes=require(_0xd4a1('0x8'));module[_0xd4a1('0x9')]=function(_0x4382d1,_0xcad55a){return _0x4382d1[_0xd4a1('0xa')](_0xd4a1('0xb'),attributes,{'tableName':_0xd4a1('0xc'),'paranoid':![],'indexes':[{'name':_0xd4a1('0xd'),'fields':[_0xd4a1('0xe'),'to'],'type':_0xd4a1('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x429bf5,_0x356d2f,_0x55aa00){if(_0x429bf5[_0xd4a1('0x10')]){_0x429bf5[_0xd4a1('0x11')]=moment()['format'](_0xd4a1('0x12'));}if(_0x429bf5[_0xd4a1('0x13')]){_0x429bf5[_0xd4a1('0x14')]=moment()[_0xd4a1('0x15')](_0xd4a1('0x12'));}_0x55aa00(null,_0x356d2f);},'beforeUpdate':function(_0x3527ef,_0xb2afbf,_0x429ad3){if(_0x3527ef[_0xd4a1('0x16')]('substatus')){_0x3527ef[_0xd4a1('0x11')]=_0x3527ef[_0xd4a1('0x10')]?moment()[_0xd4a1('0x15')](_0xd4a1('0x12')):null;}if(_0x3527ef[_0xd4a1('0x16')]('closed')){_0x3527ef[_0xd4a1('0x14')]=moment()['format'](_0xd4a1('0x12'));_0x3527ef['substatus']=null;_0x3527ef[_0xd4a1('0x11')]=null;}_0x429ad3(null,_0x3527ef);},'afterUpdate':function(_0x2698c4,_0x3cadb3,_0x7c09f9){var _0x1e36c3=_0x4382d1['models'];var _0x3a258a=_0x2698c4[_0xd4a1('0x17')]({'plain':!![]});if(_0x3a258a[_0xd4a1('0x13')]){return _0x1e36c3[_0xd4a1('0x18')][_0xd4a1('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x3a258a['id']}})[_0xd4a1('0x1a')](function(){_0x7c09f9();})[_0xd4a1('0x1b')](function(_0x15eec2){_0x7c09f9(_0x15eec2);});}else{_0x7c09f9();}}},'charset':_0xd4a1('0x1c'),'collate':_0xd4a1('0x1d')});}; \ No newline at end of file +var _0x01bf=['define','mail_interactions','fti_mail_interactions','subject','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','closedAt','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0xb32c1c,_0xc55bfa){var _0x431c80=function(_0x511581){while(--_0x511581){_0xb32c1c['push'](_0xb32c1c['shift']());}};_0x431c80(++_0xc55bfa);}(_0x01bf,0x17e));var _0xf01b=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0x01bf[_0x5e42a7];return _0x36d21b;};'use strict';var _=require('lodash');var util=require(_0xf01b('0x0'));var logger=require(_0xf01b('0x1'))(_0xf01b('0x2'));var moment=require(_0xf01b('0x3'));var BPromise=require(_0xf01b('0x4'));var rp=require(_0xf01b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf01b('0x6'));var config=require(_0xf01b('0x7'));var attributes=require(_0xf01b('0x8'));module[_0xf01b('0x9')]=function(_0x90b462,_0x56a73c){return _0x90b462[_0xf01b('0xa')]('MailInteraction',attributes,{'tableName':_0xf01b('0xb'),'paranoid':![],'indexes':[{'name':_0xf01b('0xc'),'fields':[_0xf01b('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e007e,_0x29eda8,_0x1cc723){if(_0x5e007e['substatus']){_0x5e007e[_0xf01b('0xe')]=moment()[_0xf01b('0xf')](_0xf01b('0x10'));}if(_0x5e007e[_0xf01b('0x11')]){_0x5e007e['closedAt']=moment()[_0xf01b('0xf')](_0xf01b('0x10'));}_0x1cc723(null,_0x29eda8);},'beforeUpdate':function(_0x2998fa,_0x3c7e29,_0x1ce89d){if(_0x2998fa[_0xf01b('0x12')](_0xf01b('0x13'))){_0x2998fa[_0xf01b('0xe')]=_0x2998fa[_0xf01b('0x13')]?moment()[_0xf01b('0xf')](_0xf01b('0x10')):null;}if(_0x2998fa[_0xf01b('0x12')](_0xf01b('0x11'))){_0x2998fa[_0xf01b('0x14')]=moment()[_0xf01b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x2998fa[_0xf01b('0x13')]=null;_0x2998fa[_0xf01b('0xe')]=null;}_0x1ce89d(null,_0x2998fa);},'afterUpdate':function(_0xdd5a04,_0x196c8e,_0x40d401){var _0x349390=_0x90b462[_0xf01b('0x15')];var _0x4e7210=_0xdd5a04[_0xf01b('0x16')]({'plain':!![]});if(_0x4e7210[_0xf01b('0x11')]){return _0x349390[_0xf01b('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x4e7210['id']}})[_0xf01b('0x18')](function(){_0x40d401();})[_0xf01b('0x19')](function(_0x9cfcf5){_0x40d401(_0x9cfcf5);});}else{_0x40d401();}}},'charset':_0xf01b('0x1a'),'collate':_0xf01b('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index f64544e..99dc0de 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 _0x9fee=['spread','AddTags','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','then','debug','AddTagsToMailInteraction','find','addTags','ids','omit'];(function(_0x27b7ce,_0x248d12){var _0x535284=function(_0x1d8a93){while(--_0x1d8a93){_0x27b7ce['push'](_0x27b7ce['shift']());}};_0x535284(++_0x248d12);}(_0x9fee,0x1e7));var _0xe9fe=function(_0x532b45,_0x4ff588){_0x532b45=_0x532b45-0x0;var _0x3002d0=_0x9fee[_0x532b45];return _0x3002d0;};'use strict';var _=require('lodash');var util=require(_0xe9fe('0x0'));var moment=require(_0xe9fe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9fe('0x2'));var db=require(_0xe9fe('0x3'))['db'];var utils=require(_0xe9fe('0x4'));var logger=require(_0xe9fe('0x5'))(_0xe9fe('0x6'));var config=require(_0xe9fe('0x7'));var jayson=require(_0xe9fe('0x8'));var client=jayson['client'][_0xe9fe('0x9')]({'port':0x232a});config[_0xe9fe('0xa')]=_[_0xe9fe('0xb')](config['redis'],{'host':_0xe9fe('0xc'),'port':0x18eb});var socket=require(_0xe9fe('0xd'))(new Redis(config[_0xe9fe('0xa')]));require(_0xe9fe('0xe'))[_0xe9fe('0xf')](socket);function respondWithRpcPromise(_0x885f3d,_0x124d25,_0x2fb93c){return new BPromise(function(_0x548660,_0x2631c5){return client[_0xe9fe('0x10')](_0x885f3d,_0x2fb93c)['then'](function(_0x59449e){logger[_0xe9fe('0x11')]('MailInteraction,\x20%s,\x20%s',_0x124d25,_0xe9fe('0x12'));logger['debug'](_0xe9fe('0x13'),_0x124d25,'request\x20sent',JSON['stringify'](_0x59449e));if(_0x59449e[_0xe9fe('0x14')]){if(_0x59449e[_0xe9fe('0x14')][_0xe9fe('0x15')]===0x1f4){logger[_0xe9fe('0x14')](_0xe9fe('0x16'),_0x124d25,_0x59449e['error']['message']);return _0x2631c5(_0x59449e['error'][_0xe9fe('0x17')]);}logger[_0xe9fe('0x14')](_0xe9fe('0x16'),_0x124d25,_0x59449e[_0xe9fe('0x14')]['message']);return _0x548660(_0x59449e['error']['message']);}else{logger['info'](_0xe9fe('0x16'),_0x124d25,'request\x20sent');_0x548660(_0x59449e[_0xe9fe('0x18')]['message']);}})[_0xe9fe('0x19')](function(_0x16c44d){logger[_0xe9fe('0x14')]('MailInteraction,\x20%s,\x20%s',_0x124d25,_0x16c44d);_0x2631c5(_0x16c44d);});});}exports[_0xe9fe('0x1a')]=function(_0x39db72){var _0x23b607=this;return new Promise(function(_0x447359,_0x36658b){return db[_0xe9fe('0x1b')]['update'](_0x39db72[_0xe9fe('0x1c')],{'raw':_0x39db72[_0xe9fe('0x1d')]?_0x39db72[_0xe9fe('0x1d')][_0xe9fe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39db72['options']?_0x39db72[_0xe9fe('0x1d')][_0xe9fe('0x1f')]||null:null,'attributes':_0x39db72[_0xe9fe('0x1d')]?_0x39db72[_0xe9fe('0x1d')][_0xe9fe('0x20')]||null:null,'limit':_0x39db72['options']?_0x39db72[_0xe9fe('0x1d')][_0xe9fe('0x21')]||null:null})[_0xe9fe('0x22')](function(_0x486970){logger[_0xe9fe('0x11')]('UpdateMailInteraction',_0x39db72);logger[_0xe9fe('0x23')](_0xe9fe('0x1a'),_0x39db72,JSON['stringify'](_0x486970));_0x447359(_0x486970);})[_0xe9fe('0x19')](function(_0x28c43e){logger['error'](_0xe9fe('0x1a'),_0x28c43e[_0xe9fe('0x17')],_0x39db72);_0x36658b(_0x23b607[_0xe9fe('0x14')](0x1f4,_0x28c43e[_0xe9fe('0x17')]));});});};exports[_0xe9fe('0x24')]=function(_0x3b4b2b){return new Promise(function(_0x5308d3,_0x8ee56b){return db['MailInteraction'][_0xe9fe('0x25')]({'where':_0x3b4b2b[_0xe9fe('0x1d')]?_0x3b4b2b[_0xe9fe('0x1d')]['where']||null:null})['then'](function(_0x478db8){if(_0x478db8){return _0x478db8[_0xe9fe('0x26')](_0x3b4b2b[_0xe9fe('0x1c')][_0xe9fe('0x27')],_[_0xe9fe('0x28')](_0x3b4b2b[_0xe9fe('0x1c')],[_0xe9fe('0x27'),'id'])||{});}})[_0xe9fe('0x29')](function(_0x56bbf5){logger[_0xe9fe('0x11')](_0xe9fe('0x2a'),_0x3b4b2b);logger['debug'](_0xe9fe('0x2a'),_0x3b4b2b,JSON[_0xe9fe('0x2b')](_0x56bbf5));_0x5308d3(_0x56bbf5);})[_0xe9fe('0x19')](function(_0x2231ef){logger[_0xe9fe('0x14')](_0xe9fe('0x2a'),_0x2231ef[_0xe9fe('0x17')],_0x3b4b2b);_0x8ee56b(_this[_0xe9fe('0x14')](0x1f4,_0x2231ef[_0xe9fe('0x17')]));});});}; \ No newline at end of file +var _0x0ae1=['request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','then','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./mailInteraction.socket','register','request','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0ae1,0x167));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x10ae('0x0'));var util=require(_0x10ae('0x1'));var moment=require(_0x10ae('0x2'));var BPromise=require(_0x10ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10ae('0x4'));var db=require(_0x10ae('0x5'))['db'];var utils=require(_0x10ae('0x6'));var logger=require(_0x10ae('0x7'))(_0x10ae('0x8'));var config=require(_0x10ae('0x9'));var jayson=require(_0x10ae('0xa'));var client=jayson['client'][_0x10ae('0xb')]({'port':0x232a});config[_0x10ae('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x10ae('0xd'))[_0x10ae('0xe')](socket);function respondWithRpcPromise(_0x26a9a5,_0x320043,_0x1b480e){return new BPromise(function(_0x5a62ab,_0x5afe68){return client[_0x10ae('0xf')](_0x26a9a5,_0x1b480e)['then'](function(_0x235901){logger[_0x10ae('0x10')]('MailInteraction,\x20%s,\x20%s',_0x320043,'request\x20sent');logger[_0x10ae('0x11')](_0x10ae('0x12'),_0x320043,_0x10ae('0x13'),JSON[_0x10ae('0x14')](_0x235901));if(_0x235901[_0x10ae('0x15')]){if(_0x235901[_0x10ae('0x15')][_0x10ae('0x16')]===0x1f4){logger[_0x10ae('0x15')](_0x10ae('0x17'),_0x320043,_0x235901[_0x10ae('0x15')][_0x10ae('0x18')]);return _0x5afe68(_0x235901[_0x10ae('0x15')]['message']);}logger['error'](_0x10ae('0x17'),_0x320043,_0x235901['error'][_0x10ae('0x18')]);return _0x5a62ab(_0x235901[_0x10ae('0x15')][_0x10ae('0x18')]);}else{logger[_0x10ae('0x10')](_0x10ae('0x17'),_0x320043,_0x10ae('0x13'));_0x5a62ab(_0x235901[_0x10ae('0x19')]['message']);}})[_0x10ae('0x1a')](function(_0x81f35e){logger[_0x10ae('0x15')](_0x10ae('0x17'),_0x320043,_0x81f35e);_0x5afe68(_0x81f35e);});});}exports[_0x10ae('0x1b')]=function(_0x99f0a7){var _0x5bf37a=this;return new Promise(function(_0x403f97,_0x22f3a7){return db[_0x10ae('0x1c')]['update'](_0x99f0a7[_0x10ae('0x1d')],{'raw':_0x99f0a7[_0x10ae('0x1e')]?_0x99f0a7[_0x10ae('0x1e')][_0x10ae('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x99f0a7[_0x10ae('0x1e')]?_0x99f0a7[_0x10ae('0x1e')][_0x10ae('0x20')]||null:null,'attributes':_0x99f0a7[_0x10ae('0x1e')]?_0x99f0a7[_0x10ae('0x1e')][_0x10ae('0x21')]||null:null,'limit':_0x99f0a7[_0x10ae('0x1e')]?_0x99f0a7['options'][_0x10ae('0x22')]||null:null})[_0x10ae('0x23')](function(_0x3b668b){logger['info'](_0x10ae('0x1b'),_0x99f0a7);logger[_0x10ae('0x11')](_0x10ae('0x1b'),_0x99f0a7,JSON[_0x10ae('0x14')](_0x3b668b));_0x403f97(_0x3b668b);})[_0x10ae('0x1a')](function(_0x18e4e9){logger[_0x10ae('0x15')]('UpdateMailInteraction',_0x18e4e9[_0x10ae('0x18')],_0x99f0a7);_0x22f3a7(_0x5bf37a['error'](0x1f4,_0x18e4e9[_0x10ae('0x18')]));});});};exports[_0x10ae('0x24')]=function(_0x174fcc){return new Promise(function(_0x56f6a5,_0xc1eedb){return db['MailInteraction']['find']({'where':_0x174fcc[_0x10ae('0x1e')]?_0x174fcc['options'][_0x10ae('0x20')]||null:null})[_0x10ae('0x23')](function(_0x5e7501){if(_0x5e7501){return _0x5e7501[_0x10ae('0x25')](_0x174fcc['body'][_0x10ae('0x26')],_[_0x10ae('0x27')](_0x174fcc[_0x10ae('0x1d')],['ids','id'])||{});}})[_0x10ae('0x28')](function(_0x2317c7){logger[_0x10ae('0x10')](_0x10ae('0x29'),_0x174fcc);logger['debug'](_0x10ae('0x29'),_0x174fcc,JSON[_0x10ae('0x14')](_0x2317c7));_0x56f6a5(_0x2317c7);})[_0x10ae('0x1a')](function(_0x557d63){logger[_0x10ae('0x15')](_0x10ae('0x29'),_0x557d63[_0x10ae('0x18')],_0x174fcc);_0xc1eedb(_this[_0x10ae('0x15')](0x1f4,_0x557d63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d3f8642..2047e50 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 _0x4998=['length','mailInteraction:','remove','update','emit'];(function(_0x57fcd6,_0x70b457){var _0x5b6c73=function(_0x366b6a){while(--_0x366b6a){_0x57fcd6['push'](_0x57fcd6['shift']());}};_0x5b6c73(++_0x70b457);}(_0x4998,0x13d));var _0x8499=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x4998[_0x1fa759];return _0x2da9f4;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x8499('0x0'),_0x8499('0x1')];function createListener(_0x8b79b5,_0x10628a){return function(_0x3a941c){_0x10628a[_0x8499('0x2')](_0x8b79b5,_0x3a941c);};}function removeListener(_0x3edb31,_0x2264d6){return function(){MailInteractionEvents['removeListener'](_0x3edb31,_0x2264d6);};}exports['register']=function(_0x34ffee){for(var _0x2f9714=0x0,_0x30abc0=events[_0x8499('0x3')];_0x2f9714<_0x30abc0;_0x2f9714++){var _0x318ec2=events[_0x2f9714];var _0x34b5c4=createListener(_0x8499('0x4')+_0x318ec2,_0x34ffee);MailInteractionEvents['on'](_0x318ec2,_0x34b5c4);}}; \ No newline at end of file +var _0x41bd=['./mailInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0xc60230,_0x5a4a7d){var _0x3d4a1f=function(_0x47e4d1){while(--_0x47e4d1){_0xc60230['push'](_0xc60230['shift']());}};_0x3d4a1f(++_0x5a4a7d);}(_0x41bd,0xa1));var _0xd41b=function(_0x476cc9,_0x48465e){_0x476cc9=_0x476cc9-0x0;var _0xf354d8=_0x41bd[_0x476cc9];return _0xf354d8;};'use strict';var MailInteractionEvents=require(_0xd41b('0x0'));var events=[_0xd41b('0x1'),_0xd41b('0x2'),_0xd41b('0x3')];function createListener(_0x3c209a,_0x2afa31){return function(_0x1d4547){_0x2afa31[_0xd41b('0x4')](_0x3c209a,_0x1d4547);};}function removeListener(_0x5a0ca4,_0x5ed599){return function(){MailInteractionEvents[_0xd41b('0x5')](_0x5a0ca4,_0x5ed599);};}exports[_0xd41b('0x6')]=function(_0x3fd130){for(var _0x3d3ad8=0x0,_0x4ce2bc=events['length'];_0x3d3ad8<_0x4ce2bc;_0x3d3ad8++){var _0x50173b=events[_0x3d3ad8];var _0x36c2ba=createListener('mailInteraction:'+_0x50173b,_0x3fd130);MailInteractionEvents['on'](_0x50173b,_0x36c2ba);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f17ccc9..f5c7498 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 _0xc1cd=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mailmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x49431e,_0x17699a){var _0x759cc0=function(_0x149f00){while(--_0x149f00){_0x49431e['push'](_0x49431e['shift']());}};_0x759cc0(++_0x17699a);}(_0xc1cd,0x1e6));var _0xdc1c=function(_0x381920,_0x3e5bd4){_0x381920=_0x381920-0x0;var _0x2af5e6=_0xc1cd[_0x381920];return _0x2af5e6;};'use strict';var multer=require(_0xdc1c('0x0'));var util=require(_0xdc1c('0x1'));var path=require(_0xdc1c('0x2'));var timeout=require(_0xdc1c('0x3'));var express=require('express');var router=express[_0xdc1c('0x4')]();var fs_extra=require(_0xdc1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc1c('0x6'));var config=require(_0xdc1c('0x7'));var controller=require('./mailMessage.controller');router[_0xdc1c('0x8')]('/',auth[_0xdc1c('0x9')](),controller[_0xdc1c('0xa')]);router[_0xdc1c('0x8')](_0xdc1c('0xb'),auth['isAuthenticated'](),controller[_0xdc1c('0xc')]);router[_0xdc1c('0x8')]('/:id',auth[_0xdc1c('0x9')](),controller[_0xdc1c('0xd')]);router['get'](_0xdc1c('0xe'),auth['isAuthenticated'](),controller[_0xdc1c('0xf')]);router[_0xdc1c('0x10')]('/',auth[_0xdc1c('0x9')](),interaction[_0xdc1c('0x11')]('mail',_0xdc1c('0x12')),controller[_0xdc1c('0x13')]);router[_0xdc1c('0x14')](_0xdc1c('0x15'),auth[_0xdc1c('0x9')](),controller[_0xdc1c('0x16')]);router[_0xdc1c('0x14')](_0xdc1c('0x17'),auth[_0xdc1c('0x9')](),controller['accept']);router[_0xdc1c('0x14')](_0xdc1c('0x18'),auth[_0xdc1c('0x9')](),controller[_0xdc1c('0x19')]);router[_0xdc1c('0x1a')](_0xdc1c('0x15'),auth['isAuthenticated'](),controller[_0xdc1c('0x1b')]);module[_0xdc1c('0x1c')]=router; \ No newline at end of file +var _0x5b1c=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','tracked','mail','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xb3590f,_0x28b763){var _0x330da3=function(_0x57bb81){while(--_0x57bb81){_0xb3590f['push'](_0xb3590f['shift']());}};_0x330da3(++_0x28b763);}(_0x5b1c,0x1b9));var _0xc5b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5b1c[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xc5b1('0x0'));var util=require('util');var path=require(_0xc5b1('0x1'));var timeout=require(_0xc5b1('0x2'));var express=require(_0xc5b1('0x3'));var router=express[_0xc5b1('0x4')]();var fs_extra=require(_0xc5b1('0x5'));var auth=require(_0xc5b1('0x6'));var interaction=require(_0xc5b1('0x7'));var config=require(_0xc5b1('0x8'));var controller=require(_0xc5b1('0x9'));router[_0xc5b1('0xa')]('/',auth[_0xc5b1('0xb')](),controller[_0xc5b1('0xc')]);router[_0xc5b1('0xa')](_0xc5b1('0xd'),auth[_0xc5b1('0xb')](),controller['describe']);router[_0xc5b1('0xa')](_0xc5b1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc5b1('0xa')](_0xc5b1('0xf'),auth[_0xc5b1('0xb')](),controller[_0xc5b1('0x10')]);router[_0xc5b1('0x11')]('/',auth[_0xc5b1('0xb')](),interaction[_0xc5b1('0x12')](_0xc5b1('0x13'),'mailmessage:create'),controller[_0xc5b1('0x14')]);router[_0xc5b1('0x15')](_0xc5b1('0xe'),auth[_0xc5b1('0xb')](),controller['update']);router['put'](_0xc5b1('0x16'),auth[_0xc5b1('0xb')](),controller[_0xc5b1('0x17')]);router[_0xc5b1('0x15')](_0xc5b1('0x18'),auth[_0xc5b1('0xb')](),controller[_0xc5b1('0x19')]);router[_0xc5b1('0x1a')](_0xc5b1('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xc5b1('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 592d082..9ffcb38 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 _0xdcf6=['sequelize','lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x3333b7,_0x4dc98a){var _0x26e6c6=function(_0x48aee9){while(--_0x48aee9){_0x3333b7['push'](_0x3333b7['shift']());}};_0x26e6c6(++_0x4dc98a);}(_0xdcf6,0x1b0));var _0x6dcf=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0xdcf6[_0x38baac];return _0x47baf1;};'use strict';var Sequelize=require(_0x6dcf('0x0'));var _=require(_0x6dcf('0x1'));module[_0x6dcf('0x2')]={'body':{'type':Sequelize[_0x6dcf('0x3')](_0x6dcf('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x6dcf('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6dcf('0x6')]('in',_0x6dcf('0x7')),'defaultValue':_0x6dcf('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6dcf('0x8')](0x1fe)},'from':{'type':Sequelize[_0x6dcf('0x8')]},'to':{'type':Sequelize[_0x6dcf('0x3')](_0x6dcf('0x4'))},'cc':{'type':Sequelize[_0x6dcf('0x3')]('long')},'bcc':{'type':Sequelize[_0x6dcf('0x3')](_0x6dcf('0x4'))},'subject':{'type':Sequelize[_0x6dcf('0x3')]},'sentAt':{'type':Sequelize[_0x6dcf('0x9')]},'attach':{'type':Sequelize[_0x6dcf('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6dcf('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x6dcf('0x3')]('long')},'originCc':{'type':Sequelize[_0x6dcf('0x3')](_0x6dcf('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x6dcf('0xb'),'Chat'),'defaultValue':_0x6dcf('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x756f=['INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE'];(function(_0x146591,_0x4ed9e0){var _0x2870fb=function(_0x85bf6){while(--_0x85bf6){_0x146591['push'](_0x146591['shift']());}};_0x2870fb(++_0x4ed9e0);}(_0x756f,0x137));var _0xf756=function(_0x54ef80,_0x1544b6){_0x54ef80=_0x54ef80-0x0;var _0xf21288=_0x756f[_0x54ef80];return _0xf21288;};'use strict';var Sequelize=require(_0xf756('0x0'));var _=require(_0xf756('0x1'));module[_0xf756('0x2')]={'body':{'type':Sequelize[_0xf756('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf756('0x3')](_0xf756('0x4'))},'read':{'type':Sequelize[_0xf756('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf756('0x6')]('in',_0xf756('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xf756('0x8')]},'to':{'type':Sequelize['TEXT'](_0xf756('0x9'))},'cc':{'type':Sequelize[_0xf756('0x3')](_0xf756('0x9'))},'bcc':{'type':Sequelize[_0xf756('0x3')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xf756('0xa')]},'attach':{'type':Sequelize[_0xf756('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xf756('0x3')]('long')},'originCc':{'type':Sequelize[_0xf756('0x3')](_0xf756('0x9'))},'originChannel':{'type':Sequelize[_0xf756('0x6')](_0xf756('0xc'),_0xf756('0xd')),'defaultValue':_0xf756('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index edb8aa0..dcd0411 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 _0xd0ef=['eml-format','moment','bluebird','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','json','offset','limit','Content-Range','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','user','pass','auth','attachments','length','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','fullname','interface','reject','rejectmessage','download','unix','server','tmp','message-%s.eml','from','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','existsSync','push','readFileSync','unlinkSync'];(function(_0x37d3d,_0x1c3939){var _0x202c06=function(_0x4b6de9){while(--_0x4b6de9){_0x37d3d['push'](_0x37d3d['shift']());}};_0x202c06(++_0x1c3939);}(_0xd0ef,0x1e6));var _0xfd0e=function(_0x2919d3,_0x1afe40){_0x2919d3=_0x2919d3-0x0;var _0x35f11a=_0xd0ef[_0x2919d3];return _0x35f11a;};'use strict';var emlformat=require(_0xfd0e('0x0'));var moment=require(_0xfd0e('0x1'));var BPromise=require(_0xfd0e('0x2'));var util=require('util');var path=require(_0xfd0e('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xfd0e('0x4'));var htmlToText=require(_0xfd0e('0x5'));var qs=require(_0xfd0e('0x6'));var logger=require(_0xfd0e('0x7'))(_0xfd0e('0x8'));var interaction_log=require(_0xfd0e('0x7'))(_0xfd0e('0x9'));var config=require(_0xfd0e('0xa'));var db=require('../../mysqldb')['db'];config[_0xfd0e('0xb')]=_[_0xfd0e('0xc')](config['redis'],{'host':_0xfd0e('0xd'),'port':0x18eb});var socket=require(_0xfd0e('0xe'))(new Redis(config['redis']));var htmlEntities=require(_0xfd0e('0xf'));require(_0xfd0e('0x10'))['register'](socket);var jayson=require(_0xfd0e('0x11'));var client=jayson[_0xfd0e('0x12')]['http']({'port':0x232c});var client9003=jayson[_0xfd0e('0x12')][_0xfd0e('0x13')]({'port':0x232b});var client9002=jayson['client'][_0xfd0e('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1608ae,_0x3251ad,_0x2d90a7,_0x51ed29){return new BPromise(function(_0x11d110,_0x4e4fa3){var _0x13e20e=_0x51ed29||client;return _0x13e20e[_0xfd0e('0x14')](_0x1608ae,_0x2d90a7)[_0xfd0e('0x15')](function(_0x4050ec){logger['info'](_0xfd0e('0x16'),_0x3251ad,_0xfd0e('0x17'));logger[_0xfd0e('0x18')](_0xfd0e('0x19'),_0x3251ad,_0xfd0e('0x17'),JSON[_0xfd0e('0x1a')](_0x4050ec));if(_0x4050ec['error']){if(_0x4050ec[_0xfd0e('0x1b')]['code']===0x1f4){logger[_0xfd0e('0x1b')]('MailMessage,\x20%s,\x20%s',_0x3251ad,_0x4050ec[_0xfd0e('0x1b')][_0xfd0e('0x1c')]);return _0x4e4fa3(_0x4050ec[_0xfd0e('0x1b')]['message']);}logger[_0xfd0e('0x1b')](_0xfd0e('0x16'),_0x3251ad,_0x4050ec[_0xfd0e('0x1b')]['message']);return _0x11d110(_0x4050ec[_0xfd0e('0x1b')][_0xfd0e('0x1c')]);}else{logger[_0xfd0e('0x1d')](_0xfd0e('0x16'),_0x3251ad,_0xfd0e('0x17'));_0x11d110(_0x4050ec[_0xfd0e('0x1e')][_0xfd0e('0x1c')]);}})[_0xfd0e('0x1f')](function(_0x2d754f){logger[_0xfd0e('0x1b')]('MailMessage,\x20%s,\x20%s',_0x3251ad,_0x2d754f);_0x4e4fa3(_0x2d754f);});});}function respondWithResult(_0x230b43,_0x23d2d6){_0x23d2d6=_0x23d2d6||0xc8;return function(_0x5a348f){if(_0x5a348f){return _0x230b43[_0xfd0e('0x20')](_0x23d2d6)[_0xfd0e('0x21')](_0x5a348f);}};}function respondWithFilteredResult(_0x1a2ac4,_0xdc3df){return function(_0x31f98a){if(_0x31f98a){var _0x3dd148=typeof _0xdc3df[_0xfd0e('0x22')]==='undefined'&&typeof _0xdc3df[_0xfd0e('0x23')]==='undefined';var _0x4cc351=_0x31f98a['count'];var _0xfead04=_0x3dd148?0x0:_0xdc3df['offset'];var _0x57a70c=_0x3dd148?_0x31f98a['count']:_0xdc3df['offset']+_0xdc3df[_0xfd0e('0x23')];var _0x190012;if(_0x57a70c>=_0x4cc351){_0x57a70c=_0x4cc351;_0x190012=0xc8;}else{_0x190012=0xce;}_0x1a2ac4['status'](_0x190012);return _0x1a2ac4['set'](_0xfd0e('0x24'),_0xfead04+'-'+_0x57a70c+'/'+_0x4cc351)[_0xfd0e('0x21')](_0x31f98a);}return null;};}function saveUpdates(_0x1de1f8){return function(_0x38a110){if(_0x38a110){return _0x38a110[_0xfd0e('0x25')](_0x1de1f8)['then'](function(_0x4db8ce){return _0x4db8ce;});}return null;};}function removeEntity(_0x48b766){return function(_0x362cd9){if(_0x362cd9){return _0x362cd9[_0xfd0e('0x26')]()[_0xfd0e('0x15')](function(){_0x48b766[_0xfd0e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c692b){return function(_0x4a1037){if(!_0x4a1037){_0x4c692b[_0xfd0e('0x27')](0x194);}return _0x4a1037;};}function handleError(_0x363f7e,_0xdf7831){_0xdf7831=_0xdf7831||0x1f4;return function(_0x326cb9){logger[_0xfd0e('0x1b')](_0x326cb9[_0xfd0e('0x28')]);if(_0x326cb9[_0xfd0e('0x29')]){delete _0x326cb9[_0xfd0e('0x29')];}_0x363f7e['status'](_0xdf7831)[_0xfd0e('0x2a')](_0x326cb9);};}exports[_0xfd0e('0x2b')]=function(_0xf33bbd,_0x510e2e){var _0x253983={},_0x2e82a1={},_0x24d9b5={'count':0x0,'rows':[]};var _0x55eadc=_[_0xfd0e('0x2c')](db[_0xfd0e('0x2d')]['rawAttributes'],function(_0x4020d8){return{'name':_0x4020d8[_0xfd0e('0x2e')],'type':_0x4020d8['type'][_0xfd0e('0x2f')]};});_0x2e82a1[_0xfd0e('0x30')]=_['map'](_0x55eadc,_0xfd0e('0x29'));_0x2e82a1[_0xfd0e('0x31')]=_[_0xfd0e('0x32')](_0xf33bbd['query']);_0x2e82a1[_0xfd0e('0x33')]=_[_0xfd0e('0x34')](_0x2e82a1['model'],_0x2e82a1[_0xfd0e('0x31')]);_0x253983[_0xfd0e('0x35')]=_[_0xfd0e('0x34')](_0x2e82a1[_0xfd0e('0x30')],qs[_0xfd0e('0x36')](_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x36')]));_0x253983['attributes']=_0x253983['attributes']['length']?_0x253983[_0xfd0e('0x35')]:_0x2e82a1[_0xfd0e('0x30')];if(!_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x37')](_0xfd0e('0x38'))){_0x253983['limit']=qs[_0xfd0e('0x23')](_0xf33bbd[_0xfd0e('0x31')]['limit']);_0x253983[_0xfd0e('0x22')]=qs[_0xfd0e('0x22')](_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x22')]);}_0x253983[_0xfd0e('0x39')]=qs[_0xfd0e('0x3a')](_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x3a')]);_0x253983[_0xfd0e('0x3b')]=qs[_0xfd0e('0x33')](_[_0xfd0e('0x3c')](_0xf33bbd[_0xfd0e('0x31')],_0x2e82a1[_0xfd0e('0x33')]),_0x55eadc);if(_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x3d')]){_0x253983['where']=_['merge'](_0x253983[_0xfd0e('0x3b')],{'$or':_[_0xfd0e('0x2c')](_0x55eadc,function(_0x1a25ea){if(_0x1a25ea['type']!=='VIRTUAL'){var _0x47c700={};_0x47c700[_0x1a25ea[_0xfd0e('0x29')]]={'$like':'%'+_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x3d')]+'%'};return _0x47c700;}})});}_0x253983=_[_0xfd0e('0x3e')]({},_0x253983,_0xf33bbd['options']);var _0xac9fe1={'where':_0x253983[_0xfd0e('0x3b')]};return db[_0xfd0e('0x2d')][_0xfd0e('0x3f')](_0xac9fe1)[_0xfd0e('0x15')](function(_0x189de8){_0x24d9b5[_0xfd0e('0x3f')]=_0x189de8;if(_0xf33bbd[_0xfd0e('0x31')][_0xfd0e('0x40')]){_0x253983['include']=[{'all':!![]}];}return db[_0xfd0e('0x2d')][_0xfd0e('0x41')](_0x253983);})[_0xfd0e('0x15')](function(_0x26bba5){_0x24d9b5[_0xfd0e('0x42')]=_0x26bba5;return _0x24d9b5;})[_0xfd0e('0x15')](respondWithFilteredResult(_0x510e2e,_0x253983))['catch'](handleError(_0x510e2e,null));};exports[_0xfd0e('0x43')]=function(_0x5c0449,_0x55ede5){var _0x428160={'raw':!![],'where':{'id':_0x5c0449[_0xfd0e('0x44')]['id']}},_0x30347a={};_0x30347a[_0xfd0e('0x30')]=_['keys'](db[_0xfd0e('0x2d')][_0xfd0e('0x45')]);_0x30347a[_0xfd0e('0x31')]=_['keys'](_0x5c0449[_0xfd0e('0x31')]);_0x30347a[_0xfd0e('0x33')]=_[_0xfd0e('0x34')](_0x30347a['model'],_0x30347a['query']);_0x428160[_0xfd0e('0x35')]=_[_0xfd0e('0x34')](_0x30347a[_0xfd0e('0x30')],qs[_0xfd0e('0x36')](_0x5c0449[_0xfd0e('0x31')][_0xfd0e('0x36')]));_0x428160[_0xfd0e('0x35')]=_0x428160[_0xfd0e('0x35')]['length']?_0x428160[_0xfd0e('0x35')]:_0x30347a[_0xfd0e('0x30')];if(_0x5c0449[_0xfd0e('0x31')]['includeAll']){_0x428160[_0xfd0e('0x46')]=[{'all':!![]}];}_0x428160=_[_0xfd0e('0x3e')]({},_0x428160,_0x5c0449[_0xfd0e('0x47')]);return db[_0xfd0e('0x2d')][_0xfd0e('0x48')](_0x428160)['then'](handleEntityNotFound(_0x55ede5,null))[_0xfd0e('0x15')](respondWithResult(_0x55ede5,null))[_0xfd0e('0x1f')](handleError(_0x55ede5,null));};exports[_0xfd0e('0x25')]=function(_0x2a5a5b,_0x1ae9d8){if(_0x2a5a5b[_0xfd0e('0x49')]['id']){delete _0x2a5a5b[_0xfd0e('0x49')]['id'];}return db[_0xfd0e('0x2d')][_0xfd0e('0x48')]({'where':{'id':_0x2a5a5b[_0xfd0e('0x44')]['id']}})[_0xfd0e('0x15')](handleEntityNotFound(_0x1ae9d8,null))[_0xfd0e('0x15')](saveUpdates(_0x2a5a5b[_0xfd0e('0x49')],null))[_0xfd0e('0x15')](respondWithResult(_0x1ae9d8,null))[_0xfd0e('0x1f')](handleError(_0x1ae9d8,null));};exports[_0xfd0e('0x26')]=function(_0x7d9ad2,_0x2ac61b){return db[_0xfd0e('0x2d')][_0xfd0e('0x48')]({'where':{'id':_0x7d9ad2['params']['id']}})[_0xfd0e('0x15')](handleEntityNotFound(_0x2ac61b,null))['then'](removeEntity(_0x2ac61b,null))[_0xfd0e('0x1f')](handleError(_0x2ac61b,null));};exports[_0xfd0e('0x4a')]=function(_0xa127d7,_0x1020a7){return db[_0xfd0e('0x2d')]['describe']()[_0xfd0e('0x15')](respondWithResult(_0x1020a7,null))[_0xfd0e('0x1f')](handleError(_0x1020a7,null));};exports[_0xfd0e('0x4b')]=function(_0x48c06b,_0x3dc817){return db[_0xfd0e('0x2d')][_0xfd0e('0x4b')](_0x48c06b[_0xfd0e('0x49')])[_0xfd0e('0x15')](function(_0x1c4155){if(_0x1c4155){if(_0x1c4155[_0xfd0e('0x4c')]===_0xfd0e('0x4d')&&!_0x1c4155[_0xfd0e('0x4e')]){var _0x89f2d4,_0x3e2705,_0x1db4fe;if(_0x48c06b[_0xfd0e('0x49')]['to']){_0x3e2705=_0x48c06b[_0xfd0e('0x49')]['to']['split'](',')[0x0];}return db[_0xfd0e('0x4f')][_0xfd0e('0x50')]({'where':{'id':_0x1c4155[_0xfd0e('0x51')]},'include':[{'model':db['CmList'],'as':_0xfd0e('0x52'),'include':[{'model':db['CmContact'],'as':_0xfd0e('0x53'),'where':{'email':_0x3e2705},'limit':0x1,'order':[[_0xfd0e('0x54'),_0xfd0e('0x55')]]}]},{'model':db[_0xfd0e('0x56')],'as':'Smtp','raw':!![]}]})[_0xfd0e('0x15')](function(_0x11fd40){_0x89f2d4=_0x11fd40;if(_0x89f2d4&&_0x89f2d4[_0xfd0e('0x57')]){var _0x4219cf={'tls':{'rejectUnauthorized':![]}};if(_[_0xfd0e('0x58')](_0x89f2d4['Smtp']['service'])){_0x4219cf[_0xfd0e('0x59')]=_0x89f2d4[_0xfd0e('0x57')][_0xfd0e('0x59')];_0x4219cf[_0xfd0e('0x5a')]=_0x89f2d4['Smtp'][_0xfd0e('0x5a')];_0x4219cf[_0xfd0e('0x5b')]=_0x89f2d4[_0xfd0e('0x57')]['secure'];if(_0x89f2d4[_0xfd0e('0x57')][_0xfd0e('0x5c')]){_0x4219cf['auth']={'user':_0x89f2d4[_0xfd0e('0x57')][_0xfd0e('0x5d')],'pass':_0x89f2d4[_0xfd0e('0x57')][_0xfd0e('0x5e')]};}}else{_0x4219cf['service']=_0x89f2d4[_0xfd0e('0x57')]['service'];_0x4219cf[_0xfd0e('0x5f')]={'user':_0x89f2d4['Smtp']['user'],'pass':_0x89f2d4[_0xfd0e('0x57')]['pass']};_0x4219cf['secure']=_0x89f2d4[_0xfd0e('0x57')][_0xfd0e('0x5b')];}if(_0x48c06b[_0xfd0e('0x49')][_0xfd0e('0x60')]&&_0x48c06b['body'][_0xfd0e('0x60')]['length']){for(var _0x26def0=0x0;_0x26def0<_0x48c06b['body'][_0xfd0e('0x60')][_0xfd0e('0x61')];_0x26def0+=0x1){_0x48c06b[_0xfd0e('0x49')][_0xfd0e('0x60')][_0x26def0]={'filename':_0x48c06b['body'][_0xfd0e('0x60')][_0x26def0]['name'],'path':path[_0xfd0e('0x62')](config[_0xfd0e('0x63')],_0xfd0e('0x64'),_0x48c06b[_0xfd0e('0x49')]['attachments'][_0x26def0][_0xfd0e('0x65')])};}}_0x1db4fe={'account':_0x4219cf,'message':_0x48c06b['body']};return;}})['then'](function(){if(_0x89f2d4[_0xfd0e('0x52')]){if(_0x89f2d4[_0xfd0e('0x52')]['Contacts'][_0xfd0e('0x61')]){return _0x89f2d4[_0xfd0e('0x52')]['Contacts'][0x0];}else{return db[_0xfd0e('0x66')][_0xfd0e('0x4b')](_[_0xfd0e('0xc')](_0x48c06b[_0xfd0e('0x49')],{'firstName':_0x48c06b[_0xfd0e('0x49')]['to'],'email':_0x48c06b[_0xfd0e('0x49')]['to'],'phone':_0x48c06b['body']['to'],'ListId':_0x89f2d4[_0xfd0e('0x67')]}));}}else{throw new Error(_0xfd0e('0x68'));}})[_0xfd0e('0x15')](function(){if(_0x1db4fe){return respondWithRpcPromise('SendMail','sendMail',_0x1db4fe,client9003)[_0xfd0e('0x15')](function(_0x54d359){return _0x1c4155[_0xfd0e('0x25')]({'read':!![],'messageId':_0x54d359[_0xfd0e('0x69')],'sentAt':moment()[_0xfd0e('0x6a')](_0xfd0e('0x6b'))});})[_0xfd0e('0x1f')](function(_0x347ce4){logger['error']('%s',JSON[_0xfd0e('0x1a')](_0x347ce4));return _0x1c4155;});}return _0x1c4155;});}return _0x1c4155;}})['then'](respondWithResult(_0x3dc817,0xc9))[_0xfd0e('0x1f')](handleError(_0x3dc817,null));};exports[_0xfd0e('0x6c')]=function(_0x8267,_0x33cf5c){var _0x2297c0={'agent':{},'channel':_0xfd0e('0x6d')};if(_0x8267[_0xfd0e('0x49')]['id']){delete _0x8267[_0xfd0e('0x49')]['id'];}_0x8267['body']['read']=!![];_0x8267['body'][_0xfd0e('0x6e')]=moment()['format'](_0xfd0e('0x6b'));_0x8267[_0xfd0e('0x49')][_0xfd0e('0x6f')]=_0x8267[_0xfd0e('0x49')][_0xfd0e('0x6f')]||_0x8267['user']['id'];_0x2297c0['agent']['id']=_0x8267[_0xfd0e('0x49')][_0xfd0e('0x6f')];return db[_0xfd0e('0x2d')][_0xfd0e('0x48')]({'where':{'id':_0x8267[_0xfd0e('0x44')]['id'],'UserId':null}})[_0xfd0e('0x15')](handleEntityNotFound(_0x33cf5c,null))[_0xfd0e('0x15')](saveUpdates(_0x8267[_0xfd0e('0x49')],null))[_0xfd0e('0x15')](function(_0x57bb3c){if(_0x57bb3c){_0x2297c0[_0xfd0e('0x1c')]=_0x57bb3c[_0xfd0e('0x70')]({'plain':!![]});return db[_0xfd0e('0x71')][_0xfd0e('0x48')]({'where':{'id':_0x57bb3c[_0xfd0e('0x72')]}});}return null;})[_0xfd0e('0x15')](handleEntityNotFound(_0x33cf5c,null))[_0xfd0e('0x15')](function(_0x244783){if(_0x244783){return _0x244783[_0xfd0e('0x25')]({'UserId':_0x8267[_0xfd0e('0x49')][_0xfd0e('0x6f')],'read1stAt':_[_0xfd0e('0x58')](_0x244783[_0xfd0e('0x73')])?moment()[_0xfd0e('0x6a')](_0xfd0e('0x6b')):undefined});}return null;})[_0xfd0e('0x15')](function(_0x1a6dab){if(_0x1a6dab){_0x2297c0[_0xfd0e('0x74')]=_0x1a6dab[_0xfd0e('0x70')]({'plain':!![]});interaction_log[_0xfd0e('0x1d')](_0xfd0e('0x75'),_0x8267[_0xfd0e('0x5d')]['id'],_0x8267['user']['name'],_0x8267['user'][_0xfd0e('0x76')],_0x2297c0[_0xfd0e('0x74')]['id'],_0x8267['body']?JSON[_0xfd0e('0x1a')](_0x8267['body']):_0xfd0e('0x77'));return respondWithRpcPromise(_0xfd0e('0x78'),_0xfd0e('0x79'),_0x2297c0);}return null;})[_0xfd0e('0x15')](function(_0x58ffc0){var _0xdc82d0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58ffc0[_0xfd0e('0x1c')][_0xfd0e('0x7a')];return db['sequelize'][_0xfd0e('0x31')](_0xdc82d0,{'type':db[_0xfd0e('0x7b')][_0xfd0e('0x7c')][_0xfd0e('0x7d')],'raw':!![]})[_0xfd0e('0x15')](function(_0x282f84){return _0x282f84;});})[_0xfd0e('0x15')](function(_0x20ec61){if(_0x20ec61){_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x7e')]=_0x20ec61[0x0];if(!_0x8267['body'][_0xfd0e('0x6f')])return;return db[_0xfd0e('0x7f')][_0xfd0e('0x48')]({'where':{'id':_0x8267[_0xfd0e('0x49')][_0xfd0e('0x6f')],'role':_0xfd0e('0x80')},'attributes':['id','name','fullname','email',_0xfd0e('0x81')],'raw':!![]});}return null;})[_0xfd0e('0x15')](function(_0x582e26){if(!_0x582e26)return null;_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x80')]=_0x582e26;return _0x2297c0;})[_0xfd0e('0x15')](function(_0xbeca73){if(_0xbeca73){if(_0x8267[_0xfd0e('0x49')][_0xfd0e('0x82')]){_0x2297c0['message']['interface']=util['format'](_0xfd0e('0x83'),_0x8267[_0xfd0e('0x5d')][_0xfd0e('0x29')]);_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x84')]=_0x2297c0[_0xfd0e('0x84')];_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x85')]=_0x2297c0[_0xfd0e('0x84')];_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x86')]='accept';_0x2297c0[_0xfd0e('0x1c')]['body']=htmlToText['fromString'](_0x2297c0[_0xfd0e('0x1c')][_0xfd0e('0x49')]);return respondWithRpcPromise(_0xfd0e('0x87'),_0xfd0e('0x87'),{'event':_0xfd0e('0x88'),'message':_0x2297c0['message']},client9002)[_0xfd0e('0x15')](function(){return _0x2297c0;});}return _0x2297c0;}return null;})[_0xfd0e('0x15')](respondWithResult(_0x33cf5c,null))[_0xfd0e('0x1f')](handleError(_0x33cf5c,null));};exports['reject']=function(_0x2afd95,_0x196093){var _0x10cbf4={'agent':{},'channel':_0xfd0e('0x6d')};if(_0x2afd95[_0xfd0e('0x49')]['id']){delete _0x2afd95[_0xfd0e('0x49')]['id'];}_0x2afd95[_0xfd0e('0x49')][_0xfd0e('0x6f')]=_0x2afd95['body'][_0xfd0e('0x6f')]||_0x2afd95['user']['id'];_0x10cbf4[_0xfd0e('0x80')]['id']=_0x2afd95['body'][_0xfd0e('0x6f')];return db[_0xfd0e('0x2d')]['find']({'where':{'id':_0x2afd95[_0xfd0e('0x44')]['id'],'UserId':null}})[_0xfd0e('0x15')](handleEntityNotFound(_0x196093,null))[_0xfd0e('0x15')](function(_0x4b1062){if(_0x4b1062){_0x10cbf4[_0xfd0e('0x1c')]=_0x4b1062[_0xfd0e('0x70')]({'plain':!![]});return db[_0xfd0e('0x71')][_0xfd0e('0x48')]({'where':{'id':_0x4b1062[_0xfd0e('0x72')]}});}return null;})[_0xfd0e('0x15')](handleEntityNotFound(_0x196093,null))[_0xfd0e('0x15')](function(_0x5b0130){if(_0x5b0130){_0x10cbf4[_0xfd0e('0x74')]=_0x5b0130['get']({'plain':!![]});interaction_log[_0xfd0e('0x1d')](_0xfd0e('0x89'),_0x2afd95[_0xfd0e('0x5d')]['id'],_0x2afd95['user']['name'],_0x2afd95[_0xfd0e('0x5d')][_0xfd0e('0x76')],_0x10cbf4[_0xfd0e('0x74')]['id'],_0x2afd95[_0xfd0e('0x49')]?JSON['stringify'](_0x2afd95[_0xfd0e('0x49')]):_0xfd0e('0x77'));return respondWithRpcPromise(_0xfd0e('0x8a'),'rejectMessage',_0x10cbf4);}return null;})[_0xfd0e('0x15')](function(_0x31cb83){var _0x48a5f5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31cb83[_0xfd0e('0x1c')][_0xfd0e('0x7a')];return db[_0xfd0e('0x8b')][_0xfd0e('0x31')](_0x48a5f5,{'type':db[_0xfd0e('0x7b')][_0xfd0e('0x7c')][_0xfd0e('0x7d')],'raw':!![]})['then'](function(_0x1e135c){return _0x1e135c;});})[_0xfd0e('0x15')](function(_0x8165eb){if(_0x8165eb){_0x10cbf4[_0xfd0e('0x1c')]['contact']=_0x8165eb[0x0];if(!_0x2afd95[_0xfd0e('0x49')][_0xfd0e('0x6f')])return;return db[_0xfd0e('0x7f')][_0xfd0e('0x48')]({'where':{'id':_0x2afd95[_0xfd0e('0x49')][_0xfd0e('0x6f')],'role':_0xfd0e('0x80')},'attributes':['id',_0xfd0e('0x29'),_0xfd0e('0x8c'),'email',_0xfd0e('0x81')],'raw':!![]});}return null;})[_0xfd0e('0x15')](function(_0x168dcd){if(!_0x168dcd)return null;_0x10cbf4[_0xfd0e('0x1c')][_0xfd0e('0x80')]=_0x168dcd;return _0x10cbf4;})[_0xfd0e('0x15')](function(_0x5edbf){if(_0x5edbf){_0x5edbf['message'][_0xfd0e('0x8d')]=util[_0xfd0e('0x6a')](_0xfd0e('0x83'),_0x2afd95['user'][_0xfd0e('0x29')]);_0x5edbf[_0xfd0e('0x1c')][_0xfd0e('0x84')]=_0x10cbf4[_0xfd0e('0x84')];_0x5edbf[_0xfd0e('0x1c')][_0xfd0e('0x85')]=_0x10cbf4[_0xfd0e('0x84')];_0x5edbf[_0xfd0e('0x1c')]['event']=_0xfd0e('0x8e');_0x5edbf[_0xfd0e('0x1c')][_0xfd0e('0x49')]=htmlToText['fromString'](_0x10cbf4[_0xfd0e('0x1c')][_0xfd0e('0x49')]);respondWithRpcPromise(_0xfd0e('0x87'),'EventManager',{'event':_0xfd0e('0x8f'),'message':_0x5edbf['message']},client9002);return _0x10cbf4;}return null;})[_0xfd0e('0x15')](respondWithResult(_0x196093,null))[_0xfd0e('0x1f')](handleError(_0x196093,null));};exports[_0xfd0e('0x90')]=function(_0x42c346,_0x26d3f3){var _0x4daf0a=moment()[_0xfd0e('0x91')]()['toString']();var _0x368536=path['join'](config[_0xfd0e('0x63')],_0xfd0e('0x92'),'files',_0xfd0e('0x93'));var _0x50fd53=path['join'](config['root'],'server','files',_0xfd0e('0x60'));var _0x304133=util[_0xfd0e('0x6a')](_0xfd0e('0x94'),_0x4daf0a);return db['MailMessage'][_0xfd0e('0x48')]({'where':{'id':_0x42c346[_0xfd0e('0x44')]['id']},'attributes':['id',_0xfd0e('0x49'),_0xfd0e('0x95'),'to','cc','bcc',_0xfd0e('0x96'),'createdAt'],'include':_0x42c346[_0xfd0e('0x31')][_0xfd0e('0x60')]?[{'model':db[_0xfd0e('0x97')],'as':_0xfd0e('0x98')}]:undefined})[_0xfd0e('0x15')](handleEntityNotFound(_0x26d3f3,null))['then'](function(_0x24f268){if(_0x24f268){var _0xae013=_0x24f268;var _0x1e8110={'from':_0xae013['from'],'to':_0xae013['to'],'subject':_0xae013[_0xfd0e('0x96')],'html':htmlEntities['decode'](_0xae013[_0xfd0e('0x49')]),'headers':{'Date':moment(_0xae013[_0xfd0e('0x99')])[_0xfd0e('0x6a')](_0xfd0e('0x9a'))},'attachments':[]};if(_0x24f268['cc']){_0x1e8110['headers']['Cc']=_0x24f268['cc'];}if(_0x24f268[_0xfd0e('0x9b')]){_0x1e8110[_0xfd0e('0x9c')][_0xfd0e('0x9d')]=_0x24f268[_0xfd0e('0x9b')];}return new BPromise(function(_0x180f3f,_0x5a25c2){if(_0x24f268[_0xfd0e('0x98')]){for(var _0x1317b6=0x0;_0x1317b6<_0x24f268[_0xfd0e('0x98')][_0xfd0e('0x61')];_0x1317b6++){var _0x45b654=_0x24f268['Attachments'][_0x1317b6];var _0x2bfc9f=path[_0xfd0e('0x62')](_0x50fd53,_0x45b654[_0xfd0e('0x65')]);if(fs[_0xfd0e('0x9e')](_0x2bfc9f)){_0x1e8110[_0xfd0e('0x60')][_0xfd0e('0x9f')]({'name':_0x45b654[_0xfd0e('0x29')],'contentType':_0x45b654['type'],'data':fs[_0xfd0e('0xa0')](_0x2bfc9f)});}}}emlformat['build'](_0x1e8110,function(_0x3854cf,_0x5834d3){if(_0x3854cf)return _0x5a25c2(_0x3854cf);fs['writeFileSync'](path['join'](_0x368536,_0x304133),_0x5834d3);return _0x180f3f(_0x5834d3);});});}})['then'](function(_0x19ed8a){if(_0x19ed8a){return _0x26d3f3[_0xfd0e('0x90')](path['join'](_0x368536,_0x304133),_0x304133,function(_0xcb333){if(!_0xcb333)fs[_0xfd0e('0xa1')](path[_0xfd0e('0x62')](_0x368536,_0x304133));});}})[_0xfd0e('0x1f')](handleError(_0x26d3f3,null));}; \ No newline at end of file +var _0xd120=['fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','util','path','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','json','offset','undefined','count','limit','status','set','Content-Range','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','MailInteraction','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd120,0xcf));var _0x0d12=function(_0x3583db,_0x153042){_0x3583db=_0x3583db-0x0;var _0xe70b61=_0xd120[_0x3583db];return _0xe70b61;};'use strict';var emlformat=require('eml-format');var moment=require(_0x0d12('0x0'));var BPromise=require(_0x0d12('0x1'));var util=require(_0x0d12('0x2'));var path=require(_0x0d12('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0x0d12('0x4'));var qs=require(_0x0d12('0x5'));var logger=require(_0x0d12('0x6'))('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x0d12('0x7'));var db=require('../../mysqldb')['db'];config[_0x0d12('0x8')]=_[_0x0d12('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d12('0x8')]));var htmlEntities=require(_0x0d12('0xa'));require('./mailMessage.socket')[_0x0d12('0xb')](socket);var jayson=require(_0x0d12('0xc'));var client=jayson[_0x0d12('0xd')][_0x0d12('0xe')]({'port':0x232c});var client9003=jayson[_0x0d12('0xd')]['http']({'port':0x232b});var client9002=jayson['client'][_0x0d12('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x34a64d,_0x224f80,_0x5dd4c5,_0x55ed29){return new BPromise(function(_0x3631e5,_0x34f484){var _0x59637c=_0x55ed29||client;return _0x59637c[_0x0d12('0xf')](_0x34a64d,_0x5dd4c5)[_0x0d12('0x10')](function(_0x52c1f3){logger[_0x0d12('0x11')](_0x0d12('0x12'),_0x224f80,_0x0d12('0x13'));logger[_0x0d12('0x14')](_0x0d12('0x15'),_0x224f80,_0x0d12('0x13'),JSON['stringify'](_0x52c1f3));if(_0x52c1f3[_0x0d12('0x16')]){if(_0x52c1f3[_0x0d12('0x16')][_0x0d12('0x17')]===0x1f4){logger[_0x0d12('0x16')](_0x0d12('0x12'),_0x224f80,_0x52c1f3['error'][_0x0d12('0x18')]);return _0x34f484(_0x52c1f3[_0x0d12('0x16')][_0x0d12('0x18')]);}logger[_0x0d12('0x16')](_0x0d12('0x12'),_0x224f80,_0x52c1f3[_0x0d12('0x16')][_0x0d12('0x18')]);return _0x3631e5(_0x52c1f3['error'][_0x0d12('0x18')]);}else{logger[_0x0d12('0x11')](_0x0d12('0x12'),_0x224f80,_0x0d12('0x13'));_0x3631e5(_0x52c1f3[_0x0d12('0x19')]['message']);}})['catch'](function(_0x270736){logger[_0x0d12('0x16')](_0x0d12('0x12'),_0x224f80,_0x270736);_0x34f484(_0x270736);});});}function respondWithResult(_0x2f6209,_0x252697){_0x252697=_0x252697||0xc8;return function(_0x443c16){if(_0x443c16){return _0x2f6209['status'](_0x252697)[_0x0d12('0x1a')](_0x443c16);}};}function respondWithFilteredResult(_0x310b48,_0x170e37){return function(_0x2bbd82){if(_0x2bbd82){var _0x25c938=typeof _0x170e37[_0x0d12('0x1b')]===_0x0d12('0x1c')&&typeof _0x170e37['limit']===_0x0d12('0x1c');var _0x246e54=_0x2bbd82[_0x0d12('0x1d')];var _0x25ea00=_0x25c938?0x0:_0x170e37['offset'];var _0x597091=_0x25c938?_0x2bbd82[_0x0d12('0x1d')]:_0x170e37['offset']+_0x170e37[_0x0d12('0x1e')];var _0x1cd0c4;if(_0x597091>=_0x246e54){_0x597091=_0x246e54;_0x1cd0c4=0xc8;}else{_0x1cd0c4=0xce;}_0x310b48[_0x0d12('0x1f')](_0x1cd0c4);return _0x310b48[_0x0d12('0x20')](_0x0d12('0x21'),_0x25ea00+'-'+_0x597091+'/'+_0x246e54)[_0x0d12('0x1a')](_0x2bbd82);}return null;};}function saveUpdates(_0x577428){return function(_0x567317){if(_0x567317){return _0x567317[_0x0d12('0x22')](_0x577428)[_0x0d12('0x10')](function(_0x5a3fcb){return _0x5a3fcb;});}return null;};}function removeEntity(_0x36a0ea){return function(_0x4866fb){if(_0x4866fb){return _0x4866fb[_0x0d12('0x23')]()[_0x0d12('0x10')](function(){_0x36a0ea[_0x0d12('0x1f')](0xcc)[_0x0d12('0x24')]();});}};}function handleEntityNotFound(_0x188208){return function(_0x32aa03){if(!_0x32aa03){_0x188208['sendStatus'](0x194);}return _0x32aa03;};}function handleError(_0x5acc10,_0x128c76){_0x128c76=_0x128c76||0x1f4;return function(_0xc0e3ea){logger[_0x0d12('0x16')](_0xc0e3ea[_0x0d12('0x25')]);if(_0xc0e3ea['name']){delete _0xc0e3ea[_0x0d12('0x26')];}_0x5acc10['status'](_0x128c76)[_0x0d12('0x27')](_0xc0e3ea);};}exports[_0x0d12('0x28')]=function(_0x283c6b,_0x4c13ef){var _0x2c7435={},_0x915151={},_0x23a2ff={'count':0x0,'rows':[]};var _0xe5b201=_[_0x0d12('0x29')](db[_0x0d12('0x2a')][_0x0d12('0x2b')],function(_0x528e92){return{'name':_0x528e92[_0x0d12('0x2c')],'type':_0x528e92[_0x0d12('0x2d')][_0x0d12('0x2e')]};});_0x915151[_0x0d12('0x2f')]=_['map'](_0xe5b201,'name');_0x915151[_0x0d12('0x30')]=_[_0x0d12('0x31')](_0x283c6b[_0x0d12('0x30')]);_0x915151[_0x0d12('0x32')]=_[_0x0d12('0x33')](_0x915151[_0x0d12('0x2f')],_0x915151[_0x0d12('0x30')]);_0x2c7435['attributes']=_[_0x0d12('0x33')](_0x915151[_0x0d12('0x2f')],qs[_0x0d12('0x34')](_0x283c6b['query']['fields']));_0x2c7435['attributes']=_0x2c7435[_0x0d12('0x35')][_0x0d12('0x36')]?_0x2c7435[_0x0d12('0x35')]:_0x915151['model'];if(!_0x283c6b[_0x0d12('0x30')][_0x0d12('0x37')](_0x0d12('0x38'))){_0x2c7435['limit']=qs[_0x0d12('0x1e')](_0x283c6b['query'][_0x0d12('0x1e')]);_0x2c7435[_0x0d12('0x1b')]=qs[_0x0d12('0x1b')](_0x283c6b[_0x0d12('0x30')][_0x0d12('0x1b')]);}_0x2c7435['order']=qs['sort'](_0x283c6b[_0x0d12('0x30')][_0x0d12('0x39')]);_0x2c7435[_0x0d12('0x3a')]=qs[_0x0d12('0x32')](_[_0x0d12('0x3b')](_0x283c6b[_0x0d12('0x30')],_0x915151['filters']),_0xe5b201);if(_0x283c6b[_0x0d12('0x30')][_0x0d12('0x3c')]){_0x2c7435[_0x0d12('0x3a')]=_[_0x0d12('0x3d')](_0x2c7435[_0x0d12('0x3a')],{'$or':_['map'](_0xe5b201,function(_0x2df722){if(_0x2df722[_0x0d12('0x2d')]!==_0x0d12('0x3e')){var _0x23962b={};_0x23962b[_0x2df722['name']]={'$like':'%'+_0x283c6b[_0x0d12('0x30')][_0x0d12('0x3c')]+'%'};return _0x23962b;}})});}_0x2c7435=_[_0x0d12('0x3d')]({},_0x2c7435,_0x283c6b[_0x0d12('0x3f')]);var _0x304aae={'where':_0x2c7435['where']};return db[_0x0d12('0x2a')][_0x0d12('0x1d')](_0x304aae)[_0x0d12('0x10')](function(_0x304734){_0x23a2ff[_0x0d12('0x1d')]=_0x304734;if(_0x283c6b['query'][_0x0d12('0x40')]){_0x2c7435[_0x0d12('0x41')]=[{'all':!![]}];}return db[_0x0d12('0x2a')][_0x0d12('0x42')](_0x2c7435);})[_0x0d12('0x10')](function(_0x9317f7){_0x23a2ff[_0x0d12('0x43')]=_0x9317f7;return _0x23a2ff;})[_0x0d12('0x10')](respondWithFilteredResult(_0x4c13ef,_0x2c7435))['catch'](handleError(_0x4c13ef,null));};exports[_0x0d12('0x44')]=function(_0x1eaefa,_0x2b344c){var _0x176cc0={'raw':!![],'where':{'id':_0x1eaefa[_0x0d12('0x45')]['id']}},_0x576040={};_0x576040[_0x0d12('0x2f')]=_[_0x0d12('0x31')](db[_0x0d12('0x2a')][_0x0d12('0x2b')]);_0x576040[_0x0d12('0x30')]=_[_0x0d12('0x31')](_0x1eaefa[_0x0d12('0x30')]);_0x576040[_0x0d12('0x32')]=_[_0x0d12('0x33')](_0x576040['model'],_0x576040[_0x0d12('0x30')]);_0x176cc0[_0x0d12('0x35')]=_[_0x0d12('0x33')](_0x576040[_0x0d12('0x2f')],qs[_0x0d12('0x34')](_0x1eaefa['query'][_0x0d12('0x34')]));_0x176cc0[_0x0d12('0x35')]=_0x176cc0[_0x0d12('0x35')][_0x0d12('0x36')]?_0x176cc0['attributes']:_0x576040['model'];if(_0x1eaefa['query']['includeAll']){_0x176cc0[_0x0d12('0x41')]=[{'all':!![]}];}_0x176cc0=_[_0x0d12('0x3d')]({},_0x176cc0,_0x1eaefa[_0x0d12('0x3f')]);return db[_0x0d12('0x2a')][_0x0d12('0x46')](_0x176cc0)[_0x0d12('0x10')](handleEntityNotFound(_0x2b344c,null))[_0x0d12('0x10')](respondWithResult(_0x2b344c,null))[_0x0d12('0x47')](handleError(_0x2b344c,null));};exports['update']=function(_0x3ecfa3,_0x24f5b6){if(_0x3ecfa3[_0x0d12('0x48')]['id']){delete _0x3ecfa3[_0x0d12('0x48')]['id'];}return db[_0x0d12('0x2a')][_0x0d12('0x46')]({'where':{'id':_0x3ecfa3[_0x0d12('0x45')]['id']}})[_0x0d12('0x10')](handleEntityNotFound(_0x24f5b6,null))[_0x0d12('0x10')](saveUpdates(_0x3ecfa3[_0x0d12('0x48')],null))['then'](respondWithResult(_0x24f5b6,null))[_0x0d12('0x47')](handleError(_0x24f5b6,null));};exports['destroy']=function(_0x3db23f,_0x4eda07){return db[_0x0d12('0x2a')]['find']({'where':{'id':_0x3db23f[_0x0d12('0x45')]['id']}})[_0x0d12('0x10')](handleEntityNotFound(_0x4eda07,null))['then'](removeEntity(_0x4eda07,null))[_0x0d12('0x47')](handleError(_0x4eda07,null));};exports['describe']=function(_0x2f8771,_0x2d2724){return db[_0x0d12('0x2a')]['describe']()[_0x0d12('0x10')](respondWithResult(_0x2d2724,null))[_0x0d12('0x47')](handleError(_0x2d2724,null));};exports[_0x0d12('0x49')]=function(_0x320650,_0x3324d4){return db[_0x0d12('0x2a')][_0x0d12('0x49')](_0x320650['body'])[_0x0d12('0x10')](function(_0x2903c6){if(_0x2903c6){if(_0x2903c6[_0x0d12('0x4a')]===_0x0d12('0x4b')&&!_0x2903c6[_0x0d12('0x4c')]){var _0x53146a,_0xce8217,_0x5d9a6e;if(_0x320650['body']['to']){_0xce8217=_0x320650[_0x0d12('0x48')]['to'][_0x0d12('0x4d')](',')[0x0];}return db['MailAccount'][_0x0d12('0x4e')]({'where':{'id':_0x2903c6[_0x0d12('0x4f')]},'include':[{'model':db[_0x0d12('0x50')],'as':_0x0d12('0x51'),'include':[{'model':db[_0x0d12('0x52')],'as':_0x0d12('0x53'),'where':{'email':_0xce8217},'limit':0x1,'order':[[_0x0d12('0x54'),_0x0d12('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x0d12('0x56'),'raw':!![]}]})[_0x0d12('0x10')](function(_0x46927e){_0x53146a=_0x46927e;if(_0x53146a&&_0x53146a[_0x0d12('0x56')]){var _0x3292c6={'tls':{'rejectUnauthorized':![]}};if(_[_0x0d12('0x57')](_0x53146a['Smtp'][_0x0d12('0x58')])){_0x3292c6[_0x0d12('0x59')]=_0x53146a[_0x0d12('0x56')]['host'];_0x3292c6[_0x0d12('0x5a')]=_0x53146a[_0x0d12('0x56')][_0x0d12('0x5a')];_0x3292c6[_0x0d12('0x5b')]=_0x53146a['Smtp']['secure'];if(_0x53146a[_0x0d12('0x56')][_0x0d12('0x5c')]){_0x3292c6['auth']={'user':_0x53146a[_0x0d12('0x56')][_0x0d12('0x5d')],'pass':_0x53146a['Smtp'][_0x0d12('0x5e')]};}}else{_0x3292c6[_0x0d12('0x58')]=_0x53146a[_0x0d12('0x56')][_0x0d12('0x58')];_0x3292c6[_0x0d12('0x5f')]={'user':_0x53146a[_0x0d12('0x56')]['user'],'pass':_0x53146a['Smtp'][_0x0d12('0x5e')]};_0x3292c6[_0x0d12('0x5b')]=_0x53146a[_0x0d12('0x56')][_0x0d12('0x5b')];}if(_0x320650[_0x0d12('0x48')][_0x0d12('0x60')]&&_0x320650[_0x0d12('0x48')][_0x0d12('0x60')]['length']){for(var _0x7ad618=0x0;_0x7ad618<_0x320650[_0x0d12('0x48')][_0x0d12('0x60')][_0x0d12('0x36')];_0x7ad618+=0x1){_0x320650['body'][_0x0d12('0x60')][_0x7ad618]={'filename':_0x320650[_0x0d12('0x48')]['attachments'][_0x7ad618][_0x0d12('0x26')],'path':path[_0x0d12('0x61')](config[_0x0d12('0x62')],_0x0d12('0x63'),_0x320650[_0x0d12('0x48')]['attachments'][_0x7ad618][_0x0d12('0x64')])};}}_0x5d9a6e={'account':_0x3292c6,'message':_0x320650[_0x0d12('0x48')]};return;}})[_0x0d12('0x10')](function(){if(_0x53146a['List']){if(_0x53146a[_0x0d12('0x51')][_0x0d12('0x53')]['length']){return _0x53146a[_0x0d12('0x51')][_0x0d12('0x53')][0x0];}else{return db[_0x0d12('0x52')][_0x0d12('0x49')](_[_0x0d12('0x9')](_0x320650[_0x0d12('0x48')],{'firstName':_0x320650[_0x0d12('0x48')]['to'],'email':_0x320650[_0x0d12('0x48')]['to'],'phone':_0x320650[_0x0d12('0x48')]['to'],'ListId':_0x53146a[_0x0d12('0x65')]}));}}else{throw new Error(_0x0d12('0x66'));}})['then'](function(){if(_0x5d9a6e){return respondWithRpcPromise(_0x0d12('0x67'),_0x0d12('0x68'),_0x5d9a6e,client9003)['then'](function(_0x2cd3f5){return _0x2903c6[_0x0d12('0x22')]({'read':!![],'messageId':_0x2cd3f5[_0x0d12('0x69')],'sentAt':moment()[_0x0d12('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0d12('0x47')](function(_0x1b3547){logger[_0x0d12('0x16')]('%s',JSON[_0x0d12('0x6b')](_0x1b3547));return _0x2903c6;});}return _0x2903c6;});}return _0x2903c6;}})['then'](respondWithResult(_0x3324d4,0xc9))['catch'](handleError(_0x3324d4,null));};exports[_0x0d12('0x6c')]=function(_0x5391a7,_0x5d2212){var _0x121fcd={'agent':{},'channel':_0x0d12('0x6d')};if(_0x5391a7[_0x0d12('0x48')]['id']){delete _0x5391a7[_0x0d12('0x48')]['id'];}_0x5391a7[_0x0d12('0x48')][_0x0d12('0x6e')]=!![];_0x5391a7[_0x0d12('0x48')][_0x0d12('0x6f')]=moment()[_0x0d12('0x6a')](_0x0d12('0x70'));_0x5391a7['body'][_0x0d12('0x71')]=_0x5391a7[_0x0d12('0x48')][_0x0d12('0x71')]||_0x5391a7[_0x0d12('0x5d')]['id'];_0x121fcd[_0x0d12('0x72')]['id']=_0x5391a7['body'][_0x0d12('0x71')];return db[_0x0d12('0x2a')][_0x0d12('0x46')]({'where':{'id':_0x5391a7[_0x0d12('0x45')]['id'],'UserId':null}})[_0x0d12('0x10')](handleEntityNotFound(_0x5d2212,null))[_0x0d12('0x10')](saveUpdates(_0x5391a7[_0x0d12('0x48')],null))[_0x0d12('0x10')](function(_0x3ae5ae){if(_0x3ae5ae){_0x121fcd[_0x0d12('0x18')]=_0x3ae5ae['get']({'plain':!![]});return db[_0x0d12('0x73')][_0x0d12('0x46')]({'where':{'id':_0x3ae5ae['MailInteractionId']}});}return null;})[_0x0d12('0x10')](handleEntityNotFound(_0x5d2212,null))['then'](function(_0x4e4765){if(_0x4e4765){return _0x4e4765[_0x0d12('0x22')]({'UserId':_0x5391a7[_0x0d12('0x48')][_0x0d12('0x71')],'read1stAt':_[_0x0d12('0x57')](_0x4e4765[_0x0d12('0x74')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0d12('0x10')](function(_0xef8bc8){if(_0xef8bc8){_0x121fcd[_0x0d12('0x75')]=_0xef8bc8[_0x0d12('0x76')]({'plain':!![]});interaction_log[_0x0d12('0x11')](_0x0d12('0x77'),_0x5391a7[_0x0d12('0x5d')]['id'],_0x5391a7['user'][_0x0d12('0x26')],_0x5391a7[_0x0d12('0x5d')][_0x0d12('0x78')],_0x121fcd[_0x0d12('0x75')]['id'],_0x5391a7[_0x0d12('0x48')]?JSON['stringify'](_0x5391a7[_0x0d12('0x48')]):_0x0d12('0x79'));return respondWithRpcPromise(_0x0d12('0x7a'),_0x0d12('0x7b'),_0x121fcd);}return null;})['then'](function(_0x5d1419){var _0x3d45cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d1419[_0x0d12('0x18')][_0x0d12('0x7c')];return db[_0x0d12('0x7d')]['query'](_0x3d45cf,{'type':db[_0x0d12('0x7e')][_0x0d12('0x7f')][_0x0d12('0x80')],'raw':!![]})[_0x0d12('0x10')](function(_0x3d2a08){return _0x3d2a08;});})[_0x0d12('0x10')](function(_0x493e29){if(_0x493e29){_0x121fcd[_0x0d12('0x18')][_0x0d12('0x81')]=_0x493e29[0x0];if(!_0x5391a7[_0x0d12('0x48')]['UserId'])return;return db[_0x0d12('0x82')][_0x0d12('0x46')]({'where':{'id':_0x5391a7['body'][_0x0d12('0x71')],'role':_0x0d12('0x72')},'attributes':['id',_0x0d12('0x26'),_0x0d12('0x83'),_0x0d12('0x84'),_0x0d12('0x85')],'raw':!![]});}return null;})[_0x0d12('0x10')](function(_0x25bc8f){if(!_0x25bc8f)return null;_0x121fcd[_0x0d12('0x18')]['agent']=_0x25bc8f;return _0x121fcd;})['then'](function(_0x25d461){if(_0x25d461){if(_0x5391a7[_0x0d12('0x48')][_0x0d12('0x86')]){_0x121fcd[_0x0d12('0x18')][_0x0d12('0x87')]=util[_0x0d12('0x6a')](_0x0d12('0x88'),_0x5391a7['user']['name']);_0x121fcd[_0x0d12('0x18')][_0x0d12('0x89')]=_0x121fcd['channel'];_0x121fcd[_0x0d12('0x18')][_0x0d12('0x8a')]=_0x121fcd[_0x0d12('0x89')];_0x121fcd[_0x0d12('0x18')][_0x0d12('0x8b')]=_0x0d12('0x6c');_0x121fcd[_0x0d12('0x18')][_0x0d12('0x48')]=htmlToText[_0x0d12('0x8c')](_0x121fcd['message'][_0x0d12('0x48')]);return respondWithRpcPromise('EventManager',_0x0d12('0x8d'),{'event':'acceptmessage','message':_0x121fcd[_0x0d12('0x18')]},client9002)[_0x0d12('0x10')](function(){return _0x121fcd;});}return _0x121fcd;}return null;})[_0x0d12('0x10')](respondWithResult(_0x5d2212,null))[_0x0d12('0x47')](handleError(_0x5d2212,null));};exports[_0x0d12('0x8e')]=function(_0x50111b,_0x3b477b){var _0x3071f6={'agent':{},'channel':_0x0d12('0x6d')};if(_0x50111b[_0x0d12('0x48')]['id']){delete _0x50111b[_0x0d12('0x48')]['id'];}_0x50111b['body'][_0x0d12('0x71')]=_0x50111b[_0x0d12('0x48')][_0x0d12('0x71')]||_0x50111b[_0x0d12('0x5d')]['id'];_0x3071f6[_0x0d12('0x72')]['id']=_0x50111b[_0x0d12('0x48')][_0x0d12('0x71')];return db[_0x0d12('0x2a')][_0x0d12('0x46')]({'where':{'id':_0x50111b['params']['id'],'UserId':null}})[_0x0d12('0x10')](handleEntityNotFound(_0x3b477b,null))[_0x0d12('0x10')](function(_0x398ac5){if(_0x398ac5){_0x3071f6[_0x0d12('0x18')]=_0x398ac5[_0x0d12('0x76')]({'plain':!![]});return db[_0x0d12('0x73')][_0x0d12('0x46')]({'where':{'id':_0x398ac5[_0x0d12('0x8f')]}});}return null;})[_0x0d12('0x10')](handleEntityNotFound(_0x3b477b,null))[_0x0d12('0x10')](function(_0x748140){if(_0x748140){_0x3071f6[_0x0d12('0x75')]=_0x748140[_0x0d12('0x76')]({'plain':!![]});interaction_log[_0x0d12('0x11')](_0x0d12('0x90'),_0x50111b[_0x0d12('0x5d')]['id'],_0x50111b[_0x0d12('0x5d')][_0x0d12('0x26')],_0x50111b[_0x0d12('0x5d')][_0x0d12('0x78')],_0x3071f6[_0x0d12('0x75')]['id'],_0x50111b[_0x0d12('0x48')]?JSON[_0x0d12('0x6b')](_0x50111b[_0x0d12('0x48')]):_0x0d12('0x79'));return respondWithRpcPromise(_0x0d12('0x91'),_0x0d12('0x92'),_0x3071f6);}return null;})[_0x0d12('0x10')](function(_0x5c9029){var _0x47a7b1=_0x0d12('0x93')+_0x5c9029['message'][_0x0d12('0x7c')];return db[_0x0d12('0x7d')][_0x0d12('0x30')](_0x47a7b1,{'type':db[_0x0d12('0x7e')][_0x0d12('0x7f')][_0x0d12('0x80')],'raw':!![]})[_0x0d12('0x10')](function(_0x24b8af){return _0x24b8af;});})[_0x0d12('0x10')](function(_0x1d6928){if(_0x1d6928){_0x3071f6[_0x0d12('0x18')]['contact']=_0x1d6928[0x0];if(!_0x50111b[_0x0d12('0x48')][_0x0d12('0x71')])return;return db[_0x0d12('0x82')]['find']({'where':{'id':_0x50111b[_0x0d12('0x48')]['UserId'],'role':_0x0d12('0x72')},'attributes':['id',_0x0d12('0x26'),_0x0d12('0x83'),_0x0d12('0x84'),_0x0d12('0x85')],'raw':!![]});}return null;})[_0x0d12('0x10')](function(_0x2ed5fb){if(!_0x2ed5fb)return null;_0x3071f6[_0x0d12('0x18')][_0x0d12('0x72')]=_0x2ed5fb;return _0x3071f6;})[_0x0d12('0x10')](function(_0x3815d0){if(_0x3815d0){_0x3815d0[_0x0d12('0x18')][_0x0d12('0x87')]=util[_0x0d12('0x6a')](_0x0d12('0x88'),_0x50111b[_0x0d12('0x5d')][_0x0d12('0x26')]);_0x3815d0['message'][_0x0d12('0x89')]=_0x3071f6['channel'];_0x3815d0['message'][_0x0d12('0x8a')]=_0x3071f6[_0x0d12('0x89')];_0x3815d0['message']['event']='reject';_0x3815d0['message'][_0x0d12('0x48')]=htmlToText[_0x0d12('0x8c')](_0x3071f6[_0x0d12('0x18')][_0x0d12('0x48')]);respondWithRpcPromise(_0x0d12('0x8d'),_0x0d12('0x8d'),{'event':'rejectmessage','message':_0x3815d0[_0x0d12('0x18')]},client9002);return _0x3071f6;}return null;})[_0x0d12('0x10')](respondWithResult(_0x3b477b,null))[_0x0d12('0x47')](handleError(_0x3b477b,null));};exports['download']=function(_0x16f7b9,_0x1b668b){var _0x485cce=moment()['unix']()[_0x0d12('0x94')]();var _0x44d9ea=path[_0x0d12('0x61')](config[_0x0d12('0x62')],_0x0d12('0x95'),_0x0d12('0x96'),_0x0d12('0x97'));var _0xde745d=path[_0x0d12('0x61')](config[_0x0d12('0x62')],'server',_0x0d12('0x96'),'attachments');var _0x2f71d9=util[_0x0d12('0x6a')](_0x0d12('0x98'),_0x485cce);return db[_0x0d12('0x2a')][_0x0d12('0x46')]({'where':{'id':_0x16f7b9[_0x0d12('0x45')]['id']},'attributes':['id',_0x0d12('0x48'),'from','to','cc',_0x0d12('0x99'),_0x0d12('0x9a'),_0x0d12('0x9b')],'include':_0x16f7b9['query'][_0x0d12('0x60')]?[{'model':db[_0x0d12('0x9c')],'as':_0x0d12('0x9d')}]:undefined})[_0x0d12('0x10')](handleEntityNotFound(_0x1b668b,null))[_0x0d12('0x10')](function(_0x48235b){if(_0x48235b){var _0x452c05=_0x48235b;var _0x23794f={'from':_0x452c05[_0x0d12('0x9e')],'to':_0x452c05['to'],'subject':_0x452c05[_0x0d12('0x9a')],'html':htmlEntities[_0x0d12('0x9f')](_0x452c05[_0x0d12('0x48')]),'headers':{'Date':moment(_0x452c05['createdAt'])[_0x0d12('0x6a')](_0x0d12('0xa0'))},'attachments':[]};if(_0x48235b['cc']){_0x23794f[_0x0d12('0xa1')]['Cc']=_0x48235b['cc'];}if(_0x48235b[_0x0d12('0x99')]){_0x23794f[_0x0d12('0xa1')][_0x0d12('0xa2')]=_0x48235b[_0x0d12('0x99')];}return new BPromise(function(_0x487982,_0x318d23){if(_0x48235b[_0x0d12('0x9d')]){for(var _0x1c2a51=0x0;_0x1c2a51<_0x48235b[_0x0d12('0x9d')][_0x0d12('0x36')];_0x1c2a51++){var _0x20bf9c=_0x48235b[_0x0d12('0x9d')][_0x1c2a51];var _0x524765=path[_0x0d12('0x61')](_0xde745d,_0x20bf9c[_0x0d12('0x64')]);if(fs[_0x0d12('0xa3')](_0x524765)){_0x23794f[_0x0d12('0x60')][_0x0d12('0xa4')]({'name':_0x20bf9c[_0x0d12('0x26')],'contentType':_0x20bf9c[_0x0d12('0x2d')],'data':fs[_0x0d12('0xa5')](_0x524765)});}}}emlformat[_0x0d12('0xa6')](_0x23794f,function(_0xa6626e,_0x799c86){if(_0xa6626e)return _0x318d23(_0xa6626e);fs[_0x0d12('0xa7')](path[_0x0d12('0x61')](_0x44d9ea,_0x2f71d9),_0x799c86);return _0x487982(_0x799c86);});});}})[_0x0d12('0x10')](function(_0xe149e){if(_0xe149e){return _0x1b668b['download'](path['join'](_0x44d9ea,_0x2f71d9),_0x2f71d9,function(_0x12e007){if(!_0x12e007)fs[_0x0d12('0xa8')](path['join'](_0x44d9ea,_0x2f71d9));});}})['catch'](handleError(_0x1b668b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 338a969..57fcaee 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 _0x5b9f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x39d2c3,_0x1d9db6){var _0x4a37a0=function(_0x1df84e){while(--_0x1df84e){_0x39d2c3['push'](_0x39d2c3['shift']());}};_0x4a37a0(++_0x1d9db6);}(_0x5b9f,0xdf));var _0xf5b9=function(_0x352167,_0x2b7cf8){_0x352167=_0x352167-0x0;var _0x448bdd=_0x5b9f[_0x352167];return _0x448bdd;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xf5b9('0x0'))['db'][_0xf5b9('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf5b9('0x2')](0x0);var events={'afterCreate':_0xf5b9('0x3'),'afterUpdate':_0xf5b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37e7b5){return function(_0x3ad151,_0x88485b,_0x1e3e03){MailMessageEvents[_0xf5b9('0x5')](_0x37e7b5+':'+_0x3ad151['id'],_0x3ad151);MailMessageEvents['emit'](_0x37e7b5,_0x3ad151);_0x1e3e03(null);};}for(var e in events){if(events[_0xf5b9('0x6')](e)){var event=events[e];MailMessage[_0xf5b9('0x7')](e,emitEvent(event));}}module[_0xf5b9('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xc3f6=['hasOwnProperty','hook','exports','events','MailMessage','update','remove','emit'];(function(_0x41be00,_0x2c0bc8){var _0x83e3f0=function(_0x71d755){while(--_0x71d755){_0x41be00['push'](_0x41be00['shift']());}};_0x83e3f0(++_0x2c0bc8);}(_0xc3f6,0x93));var _0x6c3f=function(_0x30de9a,_0xa712f5){_0x30de9a=_0x30de9a-0x0;var _0x310c93=_0xc3f6[_0x30de9a];return _0x310c93;};'use strict';var EventEmitter=require(_0x6c3f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x6c3f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c3f('0x2'),'afterDestroy':_0x6c3f('0x3')};function emitEvent(_0x3e6405){return function(_0x4a5fd4,_0x166052,_0x8b5334){MailMessageEvents[_0x6c3f('0x4')](_0x3e6405+':'+_0x4a5fd4['id'],_0x4a5fd4);MailMessageEvents[_0x6c3f('0x4')](_0x3e6405,_0x4a5fd4);_0x8b5334(null);};}for(var e in events){if(events[_0x6c3f('0x5')](e)){var event=events[e];MailMessage[_0x6c3f('0x6')](e,emitEvent(event));}}module[_0x6c3f('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index abf282f..be3d255 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 _0x1b6c=['then','createdAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','FULLTEXT','body','plainBody','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b6c,0x76));var _0xc1b6=function(_0x362256,_0x4f8638){_0x362256=_0x362256-0x0;var _0xfa7997=_0x1b6c[_0x362256];return _0xfa7997;};'use strict';var _=require(_0xc1b6('0x0'));var util=require(_0xc1b6('0x1'));var logger=require(_0xc1b6('0x2'))(_0xc1b6('0x3'));var moment=require('moment');var BPromise=require(_0xc1b6('0x4'));var rp=require(_0xc1b6('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xc1b6('0x6'));var rimraf=require(_0xc1b6('0x7'));var config=require(_0xc1b6('0x8'));var attributes=require(_0xc1b6('0x9'));module[_0xc1b6('0xa')]=function(_0x4e9284,_0x430ecf){return _0x4e9284['define'](_0xc1b6('0xb'),attributes,{'tableName':_0xc1b6('0xc'),'paranoid':![],'indexes':[{'name':_0xc1b6('0xd'),'fields':[_0xc1b6('0xd')]},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':_0xc1b6('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe454dd,_0x2f01ab,_0x48e439){if(_0xe454dd[_0xc1b6('0xf')]){_0xe454dd[_0xc1b6('0x10')]=htmlToText[_0xc1b6('0x11')](_0xe454dd['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x48e439(null,_0x2f01ab);},'afterCreate':function(_0x223c5c,_0x158ae8,_0x2650ee){var _0x1a432e=_0x4e9284['models'];var _0x19e314=_0x223c5c[_0xc1b6('0x12')]({'plain':!![]});if(_0x19e314[_0xc1b6('0x13')]['toLowerCase']()==='in'||_0x19e314[_0xc1b6('0x13')][_0xc1b6('0x14')]()===_0xc1b6('0x15')&&!_0x19e314[_0xc1b6('0x16')]&&!_[_0xc1b6('0x17')](_0x19e314[_0xc1b6('0x18')])){_0x1a432e[_0xc1b6('0x19')]['findOne']({'where':{'id':_0x19e314[_0xc1b6('0x1a')]}})[_0xc1b6('0x1b')](function(_0x14383c){if(_0x14383c){_0x14383c['update']({'lastMsgAt':_0x19e314[_0xc1b6('0x1c')],'lastMsgDirection':_0x19e314[_0xc1b6('0x13')][_0xc1b6('0x14')]()});}})['catch'](function(_0xe6e349){console['error'](_0xe6e349);});}_0x2650ee();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf42c=['UserId','MailInteraction','findOne','update','createdAt','utf8mb4','util','../../config/logger','moment','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','isNil'];(function(_0x3f0e83,_0x433755){var _0x4b793e=function(_0x116b31){while(--_0x116b31){_0x3f0e83['push'](_0x3f0e83['shift']());}};_0x4b793e(++_0x433755);}(_0xf42c,0x128));var _0xcf42=function(_0x493696,_0x1c1d41){_0x493696=_0x493696-0x0;var _0x3c4e2a=_0xf42c[_0x493696];return _0x3c4e2a;};'use strict';var _=require('lodash');var util=require(_0xcf42('0x0'));var logger=require(_0xcf42('0x1'))('api');var moment=require(_0xcf42('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0xcf42('0x3'));var fs=require('fs');var path=require(_0xcf42('0x4'));var rimraf=require(_0xcf42('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf42('0x6'));module[_0xcf42('0x7')]=function(_0x2447cb,_0x1439cf){return _0x2447cb[_0xcf42('0x8')](_0xcf42('0x9'),attributes,{'tableName':_0xcf42('0xa'),'paranoid':![],'indexes':[{'name':_0xcf42('0xb'),'fields':[_0xcf42('0xb')]},{'name':_0xcf42('0xc'),'fields':[_0xcf42('0xd'),_0xcf42('0xe')],'type':_0xcf42('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28523c,_0x5003c3,_0xa133a8){if(_0x28523c['body']){_0x28523c[_0xcf42('0xd')]=htmlToText['fromString'](_0x28523c[_0xcf42('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xa133a8(null,_0x5003c3);},'afterCreate':function(_0x18c498,_0x3e9ed0,_0x5d632c){var _0x55c07b=_0x2447cb[_0xcf42('0x11')];var _0x2d9785=_0x18c498[_0xcf42('0x12')]({'plain':!![]});if(_0x2d9785[_0xcf42('0x13')][_0xcf42('0x14')]()==='in'||_0x2d9785[_0xcf42('0x13')]['toLowerCase']()===_0xcf42('0x15')&&!_0x2d9785['secret']&&!_[_0xcf42('0x16')](_0x2d9785[_0xcf42('0x17')])){_0x55c07b[_0xcf42('0x18')][_0xcf42('0x19')]({'where':{'id':_0x2d9785['MailInteractionId']}})['then'](function(_0x57633d){if(_0x57633d){_0x57633d[_0xcf42('0x1a')]({'lastMsgAt':_0x2d9785[_0xcf42('0x1b')],'lastMsgDirection':_0x2d9785[_0xcf42('0x13')][_0xcf42('0x14')]()});}})['catch'](function(_0x53cce6){console['error'](_0x53cce6);});}_0x5d632c();}},'charset':_0xcf42('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 268014a..514a9df 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 _0xbbbc=['CreateMailMessage','MailMessage','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x545c73,_0x1d886f){_0x545c73=_0x545c73-0x0;var _0x194561=_0xbbbc[_0x545c73];return _0x194561;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('MailMessage,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')](_0x25e92f[_0xcbbb('0x1d')],{'raw':_0x25e92f['options']?_0x25e92f[_0xcbbb('0x1e')][_0xcbbb('0x1f')]===undefined?!![]:![]:!![]})[_0xcbbb('0x20')](function(_0x42aaf1){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x21')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x42aaf1));_0x1cca90(_0x42aaf1);})['catch'](function(_0xf39ddd){logger[_0xcbbb('0x16')]('CreateMailMessage',_0xf39ddd[_0xcbbb('0x18')],_0x25e92f);_0x45de5f(_0x658337['error'](0x1f4,_0xf39ddd['message']));});});}; \ No newline at end of file +var _0x25e7=['result','CreateMailMessage','MailMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25e7,0x1d6));var _0x725e=function(_0xc721f5,_0x42404b){_0xc721f5=_0xc721f5-0x0;var _0x1bc1bd=_0x25e7[_0xc721f5];return _0x1bc1bd;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});config['redis']=_[_0x725e('0xb')](config[_0x725e('0xc')],{'host':_0x725e('0xd'),'port':0x18eb});var socket=require(_0x725e('0xe'))(new Redis(config[_0x725e('0xc')]));require(_0x725e('0xf'))[_0x725e('0x10')](socket);function respondWithRpcPromise(_0x7c40ff,_0x22c189,_0x45cb68){return new BPromise(function(_0x441c29,_0xb297c7){return client['request'](_0x7c40ff,_0x45cb68)['then'](function(_0x40741b){logger[_0x725e('0x11')]('MailMessage,\x20%s,\x20%s',_0x22c189,'request\x20sent');logger[_0x725e('0x12')](_0x725e('0x13'),_0x22c189,'request\x20sent',JSON[_0x725e('0x14')](_0x40741b));if(_0x40741b[_0x725e('0x15')]){if(_0x40741b[_0x725e('0x15')]['code']===0x1f4){logger[_0x725e('0x15')](_0x725e('0x16'),_0x22c189,_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);return _0xb297c7(_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);}logger['error'](_0x725e('0x16'),_0x22c189,_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);return _0x441c29(_0x40741b['error'][_0x725e('0x17')]);}else{logger[_0x725e('0x11')](_0x725e('0x16'),_0x22c189,_0x725e('0x18'));_0x441c29(_0x40741b[_0x725e('0x19')][_0x725e('0x17')]);}})['catch'](function(_0x22fba5){logger[_0x725e('0x15')](_0x725e('0x16'),_0x22c189,_0x22fba5);_0xb297c7(_0x22fba5);});});}exports[_0x725e('0x1a')]=function(_0x1a9ea6){var _0x3ad3d2=this;return new Promise(function(_0x540802,_0x2fc416){return db[_0x725e('0x1b')][_0x725e('0x1c')](_0x1a9ea6[_0x725e('0x1d')],{'raw':_0x1a9ea6[_0x725e('0x1e')]?_0x1a9ea6[_0x725e('0x1e')][_0x725e('0x1f')]===undefined?!![]:![]:!![]})[_0x725e('0x20')](function(_0x7d0792){logger['info'](_0x725e('0x1a'),_0x1a9ea6);logger[_0x725e('0x12')](_0x725e('0x1a'),_0x1a9ea6,JSON[_0x725e('0x14')](_0x7d0792));_0x540802(_0x7d0792);})['catch'](function(_0xffe474){logger['error']('CreateMailMessage',_0xffe474['message'],_0x1a9ea6);_0x2fc416(_0x3ad3d2[_0x725e('0x15')](0x1f4,_0xffe474[_0x725e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 4cf5563..7b26f99 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 _0x0fbb=['remove','update','emit','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x226140,_0x40cf07){var _0x5b21ce=function(_0x550dc8){while(--_0x550dc8){_0x226140['push'](_0x226140['shift']());}};_0x5b21ce(++_0x40cf07);}(_0x0fbb,0x17e));var _0xb0fb=function(_0x20fa78,_0x4bc0cb){_0x20fa78=_0x20fa78-0x0;var _0x26cc18=_0x0fbb[_0x20fa78];return _0x26cc18;};'use strict';var MailMessageEvents=require(_0xb0fb('0x0'));var events=[_0xb0fb('0x1'),_0xb0fb('0x2'),_0xb0fb('0x3')];function createListener(_0x270496,_0x4358b6){return function(_0x5e1d12){_0x4358b6[_0xb0fb('0x4')](_0x270496,_0x5e1d12);};}function removeListener(_0x52deb6,_0x139dd8){return function(){MailMessageEvents['removeListener'](_0x52deb6,_0x139dd8);};}exports[_0xb0fb('0x5')]=function(_0xc778bb){for(var _0x5b7f5e=0x0,_0xb9e66d=events[_0xb0fb('0x6')];_0x5b7f5e<_0xb9e66d;_0x5b7f5e++){var _0x17420c=events[_0x5b7f5e];var _0x213697=createListener(_0xb0fb('0x7')+_0x17420c,_0xc778bb);MailMessageEvents['on'](_0x17420c,_0x213697);}}; \ No newline at end of file +var _0xa404=['register','length','./mailMessage.events','save','remove','emit','removeListener'];(function(_0x495707,_0x2d72eb){var _0x269dc4=function(_0x594c0d){while(--_0x594c0d){_0x495707['push'](_0x495707['shift']());}};_0x269dc4(++_0x2d72eb);}(_0xa404,0x159));var _0x4a40=function(_0x3d65ec,_0x139615){_0x3d65ec=_0x3d65ec-0x0;var _0x25a7b8=_0xa404[_0x3d65ec];return _0x25a7b8;};'use strict';var MailMessageEvents=require(_0x4a40('0x0'));var events=[_0x4a40('0x1'),_0x4a40('0x2'),'update'];function createListener(_0x465161,_0x506783){return function(_0x58ae0b){_0x506783[_0x4a40('0x3')](_0x465161,_0x58ae0b);};}function removeListener(_0x4443ec,_0x5b6a14){return function(){MailMessageEvents[_0x4a40('0x4')](_0x4443ec,_0x5b6a14);};}exports[_0x4a40('0x5')]=function(_0x3ad5e6){for(var _0x44fcae=0x0,_0x1be9d0=events[_0x4a40('0x6')];_0x44fcae<_0x1be9d0;_0x44fcae++){var _0x2eb044=events[_0x44fcae];var _0x100a8a=createListener('mailMessage:'+_0x2eb044,_0x3ad5e6);MailMessageEvents['on'](_0x2eb044,_0x100a8a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 13138a8..debf8de 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 _0x7921=['addTeams','addAgents','/:id','update','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post'];(function(_0x3d69dc,_0x56dace){var _0x2bdefd=function(_0x459652){while(--_0x459652){_0x3d69dc['push'](_0x3d69dc['shift']());}};_0x2bdefd(++_0x56dace);}(_0x7921,0xd4));var _0x1792=function(_0x9386b,_0xb848d3){_0x9386b=_0x9386b-0x0;var _0x3d81a3=_0x7921[_0x9386b];return _0x3d81a3;};'use strict';var multer=require(_0x1792('0x0'));var util=require(_0x1792('0x1'));var path=require(_0x1792('0x2'));var timeout=require('connect-timeout');var express=require(_0x1792('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1792('0x4'));var interaction=require(_0x1792('0x5'));var config=require(_0x1792('0x6'));var controller=require(_0x1792('0x7'));router[_0x1792('0x8')]('/',auth[_0x1792('0x9')](),controller[_0x1792('0xa')]);router[_0x1792('0x8')](_0x1792('0xb'),auth['isAuthenticated'](),controller[_0x1792('0xc')]);router[_0x1792('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1792('0xd')]);router[_0x1792('0x8')](_0x1792('0xe'),auth[_0x1792('0x9')](),controller[_0x1792('0xf')]);router['get']('/:id/teams',auth[_0x1792('0x9')](),controller[_0x1792('0x10')]);router[_0x1792('0x8')](_0x1792('0x11'),auth['isAuthenticated'](),controller[_0x1792('0x12')]);router[_0x1792('0x13')]('/',auth[_0x1792('0x9')](),controller['create']);router['post']('/:id/teams',auth[_0x1792('0x9')](),controller[_0x1792('0x14')]);router[_0x1792('0x13')](_0x1792('0x11'),auth[_0x1792('0x9')](),controller[_0x1792('0x15')]);router['put'](_0x1792('0x16'),auth[_0x1792('0x9')](),controller[_0x1792('0x17')]);router['delete'](_0x1792('0x16'),auth[_0x1792('0x9')](),controller[_0x1792('0x18')]);router['delete'](_0x1792('0x19'),auth[_0x1792('0x9')](),controller[_0x1792('0x1a')]);router['delete'](_0x1792('0x11'),auth[_0x1792('0x9')](),controller[_0x1792('0x1b')]);module[_0x1792('0x1c')]=router; \ No newline at end of file +var _0x4235=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x4235,0x108));var _0x5423=function(_0x29fa3d,_0x45d24f){_0x29fa3d=_0x29fa3d-0x0;var _0x5d4bbf=_0x4235[_0x29fa3d];return _0x5d4bbf;};'use strict';var multer=require(_0x5423('0x0'));var util=require(_0x5423('0x1'));var path=require(_0x5423('0x2'));var timeout=require(_0x5423('0x3'));var express=require(_0x5423('0x4'));var router=express[_0x5423('0x5')]();var fs_extra=require(_0x5423('0x6'));var auth=require(_0x5423('0x7'));var interaction=require(_0x5423('0x8'));var config=require(_0x5423('0x9'));var controller=require('./mailQueue.controller');router[_0x5423('0xa')]('/',auth[_0x5423('0xb')](),controller[_0x5423('0xc')]);router['get'](_0x5423('0xd'),auth['isAuthenticated'](),controller[_0x5423('0xe')]);router[_0x5423('0xa')](_0x5423('0xf'),auth[_0x5423('0xb')](),controller[_0x5423('0x10')]);router[_0x5423('0xa')](_0x5423('0x11'),auth[_0x5423('0xb')](),controller[_0x5423('0x12')]);router[_0x5423('0xa')](_0x5423('0x13'),auth[_0x5423('0xb')](),controller[_0x5423('0x14')]);router[_0x5423('0xa')](_0x5423('0x15'),auth['isAuthenticated'](),controller[_0x5423('0x16')]);router[_0x5423('0x17')]('/',auth[_0x5423('0xb')](),controller[_0x5423('0x18')]);router['post'](_0x5423('0x13'),auth[_0x5423('0xb')](),controller['addTeams']);router['post']('/:id/users',auth[_0x5423('0xb')](),controller[_0x5423('0x19')]);router[_0x5423('0x1a')](_0x5423('0xf'),auth[_0x5423('0xb')](),controller['update']);router['delete'](_0x5423('0xf'),auth[_0x5423('0xb')](),controller['destroy']);router[_0x5423('0x1b')](_0x5423('0x13'),auth['isAuthenticated'](),controller[_0x5423('0x1c')]);router[_0x5423('0x1b')](_0x5423('0x15'),auth[_0x5423('0xb')](),controller[_0x5423('0x1d')]);module[_0x5423('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 7650d20..43f95f2 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 _0xacc4=['roundrobin','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xacc4,0x11b));var _0x4acc=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xacc4[_0x114b7c];return _0x47185f;};'use strict';var Sequelize=require('sequelize');module[_0x4acc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4acc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4acc('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4acc('0x3')](_0x4acc('0x4'),'beepall',_0x4acc('0x5'))}}; \ No newline at end of file +var _0x5936=['beepall','roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x5936,0x1a0));var _0x6593=function(_0x23a9fc,_0x34fa48){_0x23a9fc=_0x23a9fc-0x0;var _0x377f62=_0x5936[_0x23a9fc];return _0x377f62;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6593('0x0')],'unique':_0x6593('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6593('0x0')]},'timeout':{'type':Sequelize[_0x6593('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6593('0x3'),_0x6593('0x4'),_0x6593('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ce8fe8f..38f45a1 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 _0xd845=['getTeams','Team','addTeams','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','ids','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','union','removeTeams','userMailQueue:remove','addAgents','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','MailQueues','UserProfileResource','then','sendStatus','error','name','send','map','MailQueue','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','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','params','describe','getMembers','findOne','UserMailQueue','MailQueueId','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','SIP'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd845,0x135));var _0x5d84=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xd845[_0x3a6efd];return _0x487b9a;};'use strict';var emlformat=require(_0x5d84('0x0'));var rimraf=require(_0x5d84('0x1'));var zipdir=require(_0x5d84('0x2'));var jsonpatch=require(_0x5d84('0x3'));var rp=require('request-promise');var moment=require(_0x5d84('0x4'));var BPromise=require(_0x5d84('0x5'));var Mustache=require(_0x5d84('0x6'));var util=require(_0x5d84('0x7'));var path=require('path');var sox=require(_0x5d84('0x8'));var csv=require(_0x5d84('0x9'));var ejs=require(_0x5d84('0xa'));var fs=require('fs');var fs_extra=require(_0x5d84('0xb'));var _=require(_0x5d84('0xc'));var squel=require(_0x5d84('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d84('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d84('0x9'));var querystring=require(_0x5d84('0xf'));var Papa=require('papaparse');var Redis=require(_0x5d84('0x10'));var authService=require(_0x5d84('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d84('0x12'));var logger=require(_0x5d84('0x13'))(_0x5d84('0x14'));var utils=require(_0x5d84('0x15'));var config=require(_0x5d84('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d84('0x17'))['db'];config[_0x5d84('0x18')]=_[_0x5d84('0x19')](config[_0x5d84('0x18')],{'host':_0x5d84('0x1a'),'port':0x18eb});var socket=require(_0x5d84('0x1b'))(new Redis(config['redis']));require(_0x5d84('0x1c'))['register'](socket);function respondWithStatusCode(_0xa51886,_0x2b6ca3){_0x2b6ca3=_0x2b6ca3||0xcc;return function(_0x2d1325){if(_0x2d1325){return _0xa51886['sendStatus'](_0x2b6ca3);}return _0xa51886[_0x5d84('0x1d')](_0x2b6ca3)[_0x5d84('0x1e')]();};}function respondWithResult(_0x206c31,_0x3a73ed){_0x3a73ed=_0x3a73ed||0xc8;return function(_0x474937){if(_0x474937){return _0x206c31['status'](_0x3a73ed)[_0x5d84('0x1f')](_0x474937);}};}function respondWithFilteredResult(_0x51f717,_0x3426e9){return function(_0x59a6be){if(_0x59a6be){var _0x3b3f63=typeof _0x3426e9[_0x5d84('0x20')]===_0x5d84('0x21')&&typeof _0x3426e9[_0x5d84('0x22')]===_0x5d84('0x21');var _0x3c4bab=_0x59a6be[_0x5d84('0x23')];var _0x57ecfc=_0x3b3f63?0x0:_0x3426e9['offset'];var _0x4e1247=_0x3b3f63?_0x59a6be[_0x5d84('0x23')]:_0x3426e9[_0x5d84('0x20')]+_0x3426e9[_0x5d84('0x22')];var _0x77388a;if(_0x4e1247>=_0x3c4bab){_0x4e1247=_0x3c4bab;_0x77388a=0xc8;}else{_0x77388a=0xce;}_0x51f717[_0x5d84('0x1d')](_0x77388a);return _0x51f717[_0x5d84('0x24')](_0x5d84('0x25'),_0x57ecfc+'-'+_0x4e1247+'/'+_0x3c4bab)['json'](_0x59a6be);}return null;};}function patchUpdates(_0x57585b){return function(_0x4cfaf4){try{jsonpatch['apply'](_0x4cfaf4,_0x57585b,!![]);}catch(_0x3c17ad){return BPromise['reject'](_0x3c17ad);}return _0x4cfaf4[_0x5d84('0x26')]();};}function saveUpdates(_0x37a075,_0x2b8054){return function(_0x3a8d96){if(_0x3a8d96){return _0x3a8d96[_0x5d84('0x27')](_0x37a075)['then'](function(_0x43f129){return _0x43f129;});}return null;};}function removeEntity(_0x179834,_0x5cce13){return function(_0x1351dc){if(_0x1351dc){return _0x1351dc[_0x5d84('0x28')]()['then'](function(){var _0x6a4fd5=_0x1351dc['get']({'plain':!![]});var _0x290cce=_0x5d84('0x29');return db[_0x5d84('0x2a')]['destroy']({'where':{'type':_0x290cce,'resourceId':_0x6a4fd5['id']}})[_0x5d84('0x2b')](function(){return _0x1351dc;});})[_0x5d84('0x2b')](function(){_0x179834[_0x5d84('0x1d')](0xcc)[_0x5d84('0x1e')]();});}};}function handleEntityNotFound(_0x5a3852,_0x3339f9){return function(_0x1a533e){if(!_0x1a533e){_0x5a3852[_0x5d84('0x2c')](0x194);}return _0x1a533e;};}function handleError(_0x564e15,_0x4287be){_0x4287be=_0x4287be||0x1f4;return function(_0x59e6c5){logger[_0x5d84('0x2d')](_0x59e6c5['stack']);if(_0x59e6c5[_0x5d84('0x2e')]){delete _0x59e6c5[_0x5d84('0x2e')];}_0x564e15[_0x5d84('0x1d')](_0x4287be)[_0x5d84('0x2f')](_0x59e6c5);};}exports['index']=function(_0x805a12,_0x47246f){var _0x127dfe={},_0x121bff={},_0x218b09={'count':0x0,'rows':[]};var _0x1a9a46=_[_0x5d84('0x30')](db[_0x5d84('0x31')][_0x5d84('0x32')],function(_0x775d91){return{'name':_0x775d91[_0x5d84('0x33')],'type':_0x775d91[_0x5d84('0x34')][_0x5d84('0x35')]};});_0x121bff['model']=_[_0x5d84('0x30')](_0x1a9a46,_0x5d84('0x2e'));_0x121bff['query']=_[_0x5d84('0x36')](_0x805a12['query']);_0x121bff[_0x5d84('0x37')]=_[_0x5d84('0x38')](_0x121bff[_0x5d84('0x39')],_0x121bff[_0x5d84('0x3a')]);_0x127dfe[_0x5d84('0x3b')]=_[_0x5d84('0x38')](_0x121bff[_0x5d84('0x39')],qs[_0x5d84('0x3c')](_0x805a12[_0x5d84('0x3a')][_0x5d84('0x3c')]));_0x127dfe['attributes']=_0x127dfe[_0x5d84('0x3b')][_0x5d84('0x3d')]?_0x127dfe[_0x5d84('0x3b')]:_0x121bff[_0x5d84('0x39')];if(!_0x805a12[_0x5d84('0x3a')][_0x5d84('0x3e')](_0x5d84('0x3f'))){_0x127dfe['limit']=qs['limit'](_0x805a12[_0x5d84('0x3a')][_0x5d84('0x22')]);_0x127dfe[_0x5d84('0x20')]=qs[_0x5d84('0x20')](_0x805a12[_0x5d84('0x3a')][_0x5d84('0x20')]);}_0x127dfe[_0x5d84('0x40')]=qs['sort'](_0x805a12['query'][_0x5d84('0x41')]);_0x127dfe['where']=qs[_0x5d84('0x37')](_[_0x5d84('0x42')](_0x805a12[_0x5d84('0x3a')],_0x121bff[_0x5d84('0x37')]),_0x1a9a46);if(_0x805a12['query'][_0x5d84('0x43')]){_0x127dfe[_0x5d84('0x44')]=_['merge'](_0x127dfe[_0x5d84('0x44')],{'$or':_[_0x5d84('0x30')](_0x1a9a46,function(_0x228d5b){if(_0x228d5b[_0x5d84('0x34')]!==_0x5d84('0x45')){var _0x3d1a80={};_0x3d1a80[_0x228d5b[_0x5d84('0x2e')]]={'$like':'%'+_0x805a12[_0x5d84('0x3a')][_0x5d84('0x43')]+'%'};return _0x3d1a80;}})});}_0x127dfe=_[_0x5d84('0x46')]({},_0x127dfe,_0x805a12[_0x5d84('0x47')]);var _0x1be705={'where':_0x127dfe[_0x5d84('0x44')]};return db[_0x5d84('0x31')][_0x5d84('0x23')](_0x1be705)[_0x5d84('0x2b')](function(_0x2b55ac){_0x218b09[_0x5d84('0x23')]=_0x2b55ac;if(_0x805a12[_0x5d84('0x3a')][_0x5d84('0x48')]){_0x127dfe['include']=[{'all':!![]}];}return db['MailQueue'][_0x5d84('0x49')](_0x127dfe);})['then'](function(_0x5223a2){_0x218b09[_0x5d84('0x4a')]=_0x5223a2;return _0x218b09;})['then'](respondWithFilteredResult(_0x47246f,_0x127dfe))[_0x5d84('0x4b')](handleError(_0x47246f,null));};exports[_0x5d84('0x4c')]=function(_0x4a7221,_0x91d7c6){var _0x1adfd2={'raw':!![],'where':{'id':_0x4a7221['params']['id']}},_0x46e2fb={};_0x46e2fb[_0x5d84('0x39')]=_['keys'](db[_0x5d84('0x31')][_0x5d84('0x32')]);_0x46e2fb[_0x5d84('0x3a')]=_['keys'](_0x4a7221[_0x5d84('0x3a')]);_0x46e2fb[_0x5d84('0x37')]=_[_0x5d84('0x38')](_0x46e2fb[_0x5d84('0x39')],_0x46e2fb[_0x5d84('0x3a')]);_0x1adfd2['attributes']=_[_0x5d84('0x38')](_0x46e2fb[_0x5d84('0x39')],qs[_0x5d84('0x3c')](_0x4a7221[_0x5d84('0x3a')][_0x5d84('0x3c')]));_0x1adfd2[_0x5d84('0x3b')]=_0x1adfd2[_0x5d84('0x3b')]['length']?_0x1adfd2[_0x5d84('0x3b')]:_0x46e2fb[_0x5d84('0x39')];if(_0x4a7221[_0x5d84('0x3a')][_0x5d84('0x48')]){_0x1adfd2[_0x5d84('0x4d')]=[{'all':!![]}];}_0x1adfd2=_['merge']({},_0x1adfd2,_0x4a7221['options']);return db[_0x5d84('0x31')][_0x5d84('0x4e')](_0x1adfd2)[_0x5d84('0x2b')](handleEntityNotFound(_0x91d7c6,null))[_0x5d84('0x2b')](respondWithResult(_0x91d7c6,null))[_0x5d84('0x4b')](handleError(_0x91d7c6,null));};exports[_0x5d84('0x4f')]=function(_0x499cc8,_0x3e565f){return db[_0x5d84('0x31')][_0x5d84('0x4f')](_0x499cc8[_0x5d84('0x50')],{})['then'](function(_0x5934c5){var _0x2f900c=_0x499cc8[_0x5d84('0x51')][_0x5d84('0x52')]({'plain':!![]});if(!_0x2f900c)throw new Error(_0x5d84('0x53'));if(_0x2f900c[_0x5d84('0x54')]===_0x5d84('0x51')){var _0xbc85c4=_0x5934c5[_0x5d84('0x52')]({'plain':!![]});var _0x35d3f7=_0x5d84('0x29');return db[_0x5d84('0x55')][_0x5d84('0x4e')]({'where':{'name':_0x35d3f7,'userProfileId':_0x2f900c[_0x5d84('0x56')]},'raw':!![]})[_0x5d84('0x2b')](function(_0x3c99fc){if(_0x3c99fc&&_0x3c99fc[_0x5d84('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0xbc85c4[_0x5d84('0x2e')],'resourceId':_0xbc85c4['id'],'type':_0x3c99fc[_0x5d84('0x2e')],'sectionId':_0x3c99fc['id']},{})[_0x5d84('0x2b')](function(){return _0x5934c5;});}else{return _0x5934c5;}})['catch'](function(_0x439dfe){logger['error'](_0x5d84('0x58'),_0x439dfe);throw _0x439dfe;});}return _0x5934c5;})[_0x5d84('0x2b')](respondWithResult(_0x3e565f,0xc9))[_0x5d84('0x4b')](handleError(_0x3e565f,null));};exports[_0x5d84('0x27')]=function(_0x3a0a54,_0x5cc313){if(_0x3a0a54[_0x5d84('0x50')]['id']){delete _0x3a0a54[_0x5d84('0x50')]['id'];}return db[_0x5d84('0x31')][_0x5d84('0x4e')]({'where':{'id':_0x3a0a54[_0x5d84('0x59')]['id']}})['then'](handleEntityNotFound(_0x5cc313,null))[_0x5d84('0x2b')](saveUpdates(_0x3a0a54[_0x5d84('0x50')],null))['then'](respondWithResult(_0x5cc313,null))['catch'](handleError(_0x5cc313,null));};exports[_0x5d84('0x28')]=function(_0x466e1a,_0xb1d9cc){return db['MailQueue'][_0x5d84('0x4e')]({'where':{'id':_0x466e1a['params']['id']}})[_0x5d84('0x2b')](handleEntityNotFound(_0xb1d9cc,null))[_0x5d84('0x2b')](removeEntity(_0xb1d9cc,null))['catch'](handleError(_0xb1d9cc,null));};exports[_0x5d84('0x5a')]=function(_0x4f6314,_0x2d47b1){return db['MailQueue'][_0x5d84('0x5a')]()[_0x5d84('0x2b')](respondWithResult(_0x2d47b1,null))[_0x5d84('0x4b')](handleError(_0x2d47b1,null));};exports[_0x5d84('0x5b')]=function(_0x4a5bf3,_0x384f73,_0x141322){var _0x17817d={'raw':!![],'where':{}},_0x2abc72={},_0x23782b;return db['MailQueue'][_0x5d84('0x5c')]({'where':{'id':_0x4a5bf3[_0x5d84('0x59')]['id']}})[_0x5d84('0x2b')](handleEntityNotFound(_0x384f73,null))[_0x5d84('0x2b')](function(_0x2762ef){if(_0x2762ef){_0x23782b=_0x2762ef[_0x5d84('0x52')]({'plain':!![]});_0x2abc72[_0x5d84('0x39')]=_[_0x5d84('0x36')](db[_0x5d84('0x5d')][_0x5d84('0x32')]);_0x2abc72['query']=_[_0x5d84('0x36')](_0x4a5bf3[_0x5d84('0x3a')]);_0x2abc72['filters']=_[_0x5d84('0x38')](_0x2abc72[_0x5d84('0x39')],_0x2abc72[_0x5d84('0x3a')]);_0x17817d[_0x5d84('0x3b')]=_[_0x5d84('0x38')](_0x2abc72[_0x5d84('0x39')],qs[_0x5d84('0x3c')](_0x4a5bf3[_0x5d84('0x3a')][_0x5d84('0x3c')]));_0x17817d['attributes']=_0x17817d[_0x5d84('0x3b')][_0x5d84('0x3d')]?_0x17817d[_0x5d84('0x3b')]:_0x2abc72[_0x5d84('0x39')];if(!_0x4a5bf3[_0x5d84('0x3a')]['hasOwnProperty']('nolimit')){_0x17817d['limit']=qs[_0x5d84('0x22')](_0x4a5bf3[_0x5d84('0x3a')][_0x5d84('0x22')]);_0x17817d[_0x5d84('0x20')]=qs[_0x5d84('0x20')](_0x4a5bf3[_0x5d84('0x3a')][_0x5d84('0x20')]);}_0x17817d[_0x5d84('0x40')]=qs[_0x5d84('0x41')](_0x4a5bf3[_0x5d84('0x3a')][_0x5d84('0x41')]);_0x17817d[_0x5d84('0x44')]=qs['filters'](_[_0x5d84('0x42')](_0x4a5bf3['query'],_0x2abc72['filters']));_0x17817d[_0x5d84('0x44')][_0x5d84('0x5e')]=_0x2762ef['id'];if(_0x4a5bf3['query'][_0x5d84('0x43')]){_0x17817d[_0x5d84('0x44')]=_[_0x5d84('0x46')](_0x17817d['where'],{'$or':_['map'](_0x17817d[_0x5d84('0x3b')],function(_0x5ad5bc){var _0x929b49={};_0x929b49[_0x5ad5bc]={'$like':'%'+_0x4a5bf3[_0x5d84('0x3a')]['filter']+'%'};return _0x929b49;})});}_0x17817d=_[_0x5d84('0x46')]({},_0x17817d,_0x4a5bf3[_0x5d84('0x47')]);return db['UserMailQueue'][_0x5d84('0x49')](_0x17817d);}})[_0x5d84('0x2b')](function(_0x437c56){if(_0x437c56){return db['User'][_0x5d84('0x5f')]({'where':{'id':_[_0x5d84('0x30')](_0x437c56,'UserId'),'role':_0x5d84('0x60')},'attributes':['id',_0x5d84('0x2e'),_0x5d84('0x61'),_0x5d84('0x62'),_0x5d84('0x63')]});}})[_0x5d84('0x2b')](function(_0x48378c){if(_0x48378c){return{'count':_0x48378c['count'],'rows':_['map'](_0x48378c[_0x5d84('0x4a')],function(_0xb1330c){return{'membername':_0xb1330c['name'],'UserId':_0xb1330c['id'],'queue_name':_0x23782b[_0x5d84('0x2e')],'MailQueueId':_0x23782b['id'],'interface':util['format'](_0x5d84('0x64'),_0x5d84('0x65'),_0xb1330c[_0x5d84('0x2e')]),'penalty':0x0,'paused':_0xb1330c[_0x5d84('0x61')],'createdAt':_0xb1330c['createdAt'],'updatedAt':_0xb1330c[_0x5d84('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d84('0x2b')](respondWithFilteredResult(_0x384f73,_0x17817d))[_0x5d84('0x4b')](handleError(_0x384f73,null));};exports[_0x5d84('0x66')]=function(_0x587e11,_0x2a96c3,_0x598a10){var _0x4e4b67={};var _0x334463={};var _0x2e7e5d;var _0x37c357;return db[_0x5d84('0x31')][_0x5d84('0x5c')]({'where':{'id':_0x587e11[_0x5d84('0x59')]['id']}})[_0x5d84('0x2b')](handleEntityNotFound(_0x2a96c3,null))['then'](function(_0x3030c5){if(_0x3030c5){_0x2e7e5d=_0x3030c5;_0x334463[_0x5d84('0x39')]=_['keys'](db[_0x5d84('0x67')][_0x5d84('0x32')]);_0x334463['query']=_['keys'](_0x587e11[_0x5d84('0x3a')]);_0x334463[_0x5d84('0x37')]=_[_0x5d84('0x38')](_0x334463[_0x5d84('0x39')],_0x334463['query']);_0x4e4b67[_0x5d84('0x3b')]=_[_0x5d84('0x38')](_0x334463[_0x5d84('0x39')],qs[_0x5d84('0x3c')](_0x587e11[_0x5d84('0x3a')][_0x5d84('0x3c')]));_0x4e4b67[_0x5d84('0x3b')]=_0x4e4b67[_0x5d84('0x3b')][_0x5d84('0x3d')]?_0x4e4b67[_0x5d84('0x3b')]:_0x334463[_0x5d84('0x39')];_0x4e4b67[_0x5d84('0x40')]=qs[_0x5d84('0x41')](_0x587e11[_0x5d84('0x3a')][_0x5d84('0x41')]);_0x4e4b67[_0x5d84('0x44')]=qs[_0x5d84('0x37')](_[_0x5d84('0x42')](_0x587e11['query'],_0x334463[_0x5d84('0x37')]));if(_0x587e11[_0x5d84('0x3a')][_0x5d84('0x43')]){_0x4e4b67[_0x5d84('0x44')]=_[_0x5d84('0x46')](_0x4e4b67[_0x5d84('0x44')],{'$or':_[_0x5d84('0x30')](_0x4e4b67[_0x5d84('0x3b')],function(_0x29996e){var _0x4d56a7={};_0x4d56a7[_0x29996e]={'$like':'%'+_0x587e11[_0x5d84('0x3a')][_0x5d84('0x43')]+'%'};return _0x4d56a7;})});}_0x4e4b67=_[_0x5d84('0x46')]({},_0x4e4b67,_0x587e11[_0x5d84('0x47')]);return _0x2e7e5d[_0x5d84('0x66')](_0x4e4b67);}})[_0x5d84('0x2b')](function(_0x53368f){if(_0x53368f){_0x37c357=_0x53368f[_0x5d84('0x3d')];if(!_0x587e11[_0x5d84('0x3a')]['hasOwnProperty'](_0x5d84('0x3f'))){_0x4e4b67[_0x5d84('0x22')]=qs[_0x5d84('0x22')](_0x587e11[_0x5d84('0x3a')]['limit']);_0x4e4b67['offset']=qs[_0x5d84('0x20')](_0x587e11[_0x5d84('0x3a')][_0x5d84('0x20')]);}return _0x2e7e5d[_0x5d84('0x66')](_0x4e4b67);}})[_0x5d84('0x2b')](function(_0x5b7cb4){if(_0x5b7cb4){return _0x5b7cb4?{'count':_0x37c357,'rows':_0x5b7cb4}:null;}})['then'](respondWithResult(_0x2a96c3,null))[_0x5d84('0x4b')](handleError(_0x2a96c3,null));};exports[_0x5d84('0x68')]=function(_0x3cf87e,_0x5cd17d,_0x58e75b){var _0x1cbd96=_0x3cf87e[_0x5d84('0x50')]['ids'];return db[_0x5d84('0x67')][_0x5d84('0x49')]({'where':{'id':_0x1cbd96},'attributes':['id'],'include':[{'model':db[_0x5d84('0x69')],'as':'Agents','attributes':['id',_0x5d84('0x2e'),_0x5d84('0x6a'),_0x5d84('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0xbbfd17){if(_0xbbfd17){var _0x1f542b=_[_0x5d84('0x6c')](_0xbbfd17,function(_0x575b29){var _0x587a0a=_0x575b29['get']({'plain':!![]});return _0x587a0a[_0x5d84('0x6d')];});return db[_0x5d84('0x31')][_0x5d84('0x4e')]({'where':{'id':_0x3cf87e['params']['id']}})[_0x5d84('0x2b')](function(_0x55937f){return db[_0x5d84('0x6e')][_0x5d84('0x6f')](function(_0x44abb7){return _0x55937f[_0x5d84('0x68')](_0x1cbd96,{'transaction':_0x44abb7})[_0x5d84('0x2b')](function(){return BPromise[_0x5d84('0x70')](_0x1f542b,function(_0x10f999){return db['UserMailQueue'][_0x5d84('0x71')]({'where':{'UserId':_0x10f999['id'],'MailQueueId':_0x3cf87e[_0x5d84('0x59')]['id']},'transaction':_0x44abb7});});})[_0x5d84('0x2b')](function(){_0x1f542b[_0x5d84('0x72')](function(_0x4d996e){socket[_0x5d84('0x73')](_0x5d84('0x74'),{'UserId':_0x4d996e['id'],'MailQueueId':_0x55937f['id']});});});});});}})[_0x5d84('0x2b')](respondWithStatusCode(_0x5cd17d,null))[_0x5d84('0x4b')](handleError(_0x5cd17d,null));};exports['removeTeams']=function(_0x50ce61,_0x395006,_0x2608fd){return db[_0x5d84('0x67')][_0x5d84('0x49')]({'where':{'id':_0x50ce61[_0x5d84('0x3a')][_0x5d84('0x75')]},'attributes':['id'],'include':[{'model':db[_0x5d84('0x69')],'as':_0x5d84('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x5d84('0x2b')](handleEntityNotFound(_0x395006,null))[_0x5d84('0x2b')](function(_0x58cbbc){var _0x4979f1=_['map'](_0x58cbbc,'id');var _0x4c1e20=[];var _0x2e8146=[];var _0x3173b3=squel['select']();_0x3173b3[_0x5d84('0x76')](_0x5d84('0x77'))['from'](_0x5d84('0x78'),'tq')[_0x5d84('0x79')](_0x5d84('0x7a'),'ut',_0x5d84('0x7b'))[_0x5d84('0x44')](_0x5d84('0x7c'),_0x50ce61['params']['id']);for(var _0x384153=0x0;_0x384153<_0x58cbbc[_0x5d84('0x3d')];_0x384153+=0x1){let _0x58928f=_0x58cbbc[_0x384153];for(var _0x33989a=0x0;_0x33989a<_0x58928f[_0x5d84('0x6d')][_0x5d84('0x3d')];_0x33989a+=0x1){let _0x405502=_0x58928f[_0x5d84('0x6d')][_0x33989a];var _0x4d6cf0=_0x3173b3[_0x5d84('0x7d')]();_0x4d6cf0[_0x5d84('0x44')](_0x5d84('0x7e'),_0x405502['id']);_0x2e8146['push'](db['sequelize'][_0x5d84('0x3a')](_0x4d6cf0[_0x5d84('0x7f')](),{'type':db[_0x5d84('0x6e')]['QueryTypes'][_0x5d84('0x80')]})[_0x5d84('0x2b')](function(_0x533486){if(_0x533486[_0x5d84('0x3d')]===0x1){return _0x405502['id'];}else{var _0x349517=_[_0x5d84('0x81')](_['map'](_0x533486,'TeamId'),function(_0x133518){return _[_0x5d84('0x82')](_0x4979f1,_0x133518);});if(_0x349517){return _0x405502['id'];}}}));}}return BPromise['all'](_0x2e8146)['then'](function(_0x3c1845){_0x4c1e20=_(_0x4c1e20)[_0x5d84('0x83')](_0x3c1845)['compact']()['value']();return db['MailQueue'][_0x5d84('0x4e')]({'where':{'id':_0x50ce61[_0x5d84('0x59')]['id']}})['then'](function(_0x5bbcbe){return db[_0x5d84('0x6e')][_0x5d84('0x6f')](function(_0x3f812f){return _0x5bbcbe[_0x5d84('0x84')](_0x50ce61[_0x5d84('0x3a')][_0x5d84('0x75')],{'transaction':_0x3f812f})[_0x5d84('0x2b')](function(){if(!_['isEmpty'](_0x4c1e20)){return _0x5bbcbe['removeAgents'](_0x4c1e20,{'transaction':_0x3f812f});}})['then'](function(){_0x4c1e20[_0x5d84('0x72')](function(_0x95fc7c){socket[_0x5d84('0x73')](_0x5d84('0x85'),{'UserId':_0x95fc7c,'MailQueueId':_0x5bbcbe['id']});});});});});});})[_0x5d84('0x2b')](respondWithStatusCode(_0x395006,null))['catch'](handleError(_0x395006,null));};exports['addAgents']=function(_0x26a261,_0x3d89e2,_0x25299d){return db['MailQueue'][_0x5d84('0x4e')]({'where':{'id':_0x26a261[_0x5d84('0x59')]['id']}})[_0x5d84('0x2b')](handleEntityNotFound(_0x3d89e2,null))[_0x5d84('0x2b')](function(_0x140ce9){if(_0x140ce9){return _0x140ce9[_0x5d84('0x86')](_0x26a261[_0x5d84('0x50')][_0x5d84('0x75')],_['omit'](_0x26a261[_0x5d84('0x50')],[_0x5d84('0x75'),'id'])||{})['spread'](function(_0x4e5b70){for(var _0x108d53=0x0;_0x108d53<_0x26a261[_0x5d84('0x50')][_0x5d84('0x75')]['length'];_0x108d53+=0x1){socket[_0x5d84('0x73')]('userMailQueue:save',{'UserId':Number(_0x26a261[_0x5d84('0x50')]['ids'][_0x108d53]),'MailQueueId':Number(_0x26a261[_0x5d84('0x59')]['id'])});}return _0x4e5b70;});}})[_0x5d84('0x2b')](respondWithResult(_0x3d89e2,null))[_0x5d84('0x4b')](handleError(_0x3d89e2,null));};exports['removeAgents']=function(_0x256930,_0x352582,_0x278b05){return db['MailQueue'][_0x5d84('0x4e')]({'where':{'id':_0x256930[_0x5d84('0x59')]['id']}})['then'](handleEntityNotFound(_0x352582,null))[_0x5d84('0x2b')](function(_0x428a3b){if(_0x428a3b){return _0x428a3b[_0x5d84('0x87')](_0x256930[_0x5d84('0x3a')][_0x5d84('0x75')])[_0x5d84('0x2b')](function(){if(_['isArray'](_0x256930[_0x5d84('0x3a')][_0x5d84('0x75')])){for(var _0x483947=0x0;_0x483947<_0x256930['query'][_0x5d84('0x75')][_0x5d84('0x3d')];_0x483947+=0x1){socket[_0x5d84('0x73')](_0x5d84('0x85'),{'UserId':Number(_0x256930['query'][_0x5d84('0x75')][_0x483947]),'MailQueueId':Number(_0x256930[_0x5d84('0x59')]['id'])});}}else{socket[_0x5d84('0x73')]('userMailQueue:remove',{'UserId':Number(_0x256930[_0x5d84('0x3a')][_0x5d84('0x75')]),'MailQueueId':Number(_0x256930[_0x5d84('0x59')]['id'])});}});}})[_0x5d84('0x2b')](respondWithStatusCode(_0x352582,null))['catch'](handleError(_0x352582,null));};exports[_0x5d84('0x88')]=function(_0x657a34,_0x2482a6,_0x29bcb9){var _0x33b172={};var _0x12e5aa={};var _0x58082d;var _0x4895ae;return db['MailQueue'][_0x5d84('0x5c')]({'where':{'id':_0x657a34['params']['id']}})[_0x5d84('0x2b')](handleEntityNotFound(_0x2482a6,null))[_0x5d84('0x2b')](function(_0x884893){if(_0x884893){_0x58082d=_0x884893;_0x12e5aa[_0x5d84('0x39')]=_[_0x5d84('0x36')](db[_0x5d84('0x69')][_0x5d84('0x32')]);_0x12e5aa[_0x5d84('0x3a')]=_[_0x5d84('0x36')](_0x657a34[_0x5d84('0x3a')]);_0x12e5aa[_0x5d84('0x37')]=_[_0x5d84('0x38')](_0x12e5aa['model'],_0x12e5aa[_0x5d84('0x3a')]);_0x33b172[_0x5d84('0x3b')]=_['intersection'](_0x12e5aa[_0x5d84('0x39')],qs['fields'](_0x657a34[_0x5d84('0x3a')]['fields']));_0x33b172['attributes']=_0x33b172[_0x5d84('0x3b')]['length']?_0x33b172['attributes']:_0x12e5aa[_0x5d84('0x39')];_0x33b172[_0x5d84('0x40')]=qs[_0x5d84('0x41')](_0x657a34[_0x5d84('0x3a')][_0x5d84('0x41')]);_0x33b172['where']=qs[_0x5d84('0x37')](_['pick'](_0x657a34['query'],_0x12e5aa['filters']));if(_0x657a34[_0x5d84('0x3a')]['filter']){_0x33b172[_0x5d84('0x44')]=_['merge'](_0x33b172[_0x5d84('0x44')],{'$or':_[_0x5d84('0x30')](_0x33b172[_0x5d84('0x3b')],function(_0x270d23){var _0x30c186={};_0x30c186[_0x270d23]={'$like':'%'+_0x657a34[_0x5d84('0x3a')][_0x5d84('0x43')]+'%'};return _0x30c186;})});}_0x33b172=_[_0x5d84('0x46')]({},_0x33b172,_0x657a34['options']);return _0x58082d[_0x5d84('0x88')](_0x33b172);}})[_0x5d84('0x2b')](function(_0x28b1c2){if(_0x28b1c2){_0x4895ae=_0x28b1c2[_0x5d84('0x3d')];if(!_0x657a34[_0x5d84('0x3a')]['hasOwnProperty']('nolimit')){_0x33b172['limit']=qs['limit'](_0x657a34[_0x5d84('0x3a')][_0x5d84('0x22')]);_0x33b172[_0x5d84('0x20')]=qs[_0x5d84('0x20')](_0x657a34[_0x5d84('0x3a')][_0x5d84('0x20')]);}return _0x58082d[_0x5d84('0x88')](_0x33b172);}})[_0x5d84('0x2b')](function(_0x8677d3){if(_0x8677d3){return _0x8677d3?{'count':_0x4895ae,'rows':_0x8677d3}:null;}})[_0x5d84('0x2b')](respondWithResult(_0x2482a6,null))[_0x5d84('0x4b')](handleError(_0x2482a6,null));}; \ No newline at end of file +var _0x03f5=['json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','MailQueues','then','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','pick','MailQueueId','UserMailQueue','User','findAndCountAll','agent','createdAt','%s/%s','updatedAt','getTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userMailQueue:save','Team','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end'];(function(_0x16ee30,_0x5bd1a9){var _0xe2b8af=function(_0x308e09){while(--_0x308e09){_0x16ee30['push'](_0x16ee30['shift']());}};_0xe2b8af(++_0x5bd1a9);}(_0x03f5,0x6c));var _0x503f=function(_0x209523,_0x44551d){_0x209523=_0x209523-0x0;var _0x8ddb07=_0x03f5[_0x209523];return _0x8ddb07;};'use strict';var emlformat=require(_0x503f('0x0'));var rimraf=require(_0x503f('0x1'));var zipdir=require(_0x503f('0x2'));var jsonpatch=require(_0x503f('0x3'));var rp=require(_0x503f('0x4'));var moment=require(_0x503f('0x5'));var BPromise=require(_0x503f('0x6'));var Mustache=require(_0x503f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x503f('0x8'));var csv=require(_0x503f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x503f('0xa'));var squel=require(_0x503f('0xb'));var crypto=require(_0x503f('0xc'));var jsforce=require(_0x503f('0xd'));var deskjs=require(_0x503f('0xe'));var toCsv=require(_0x503f('0x9'));var querystring=require(_0x503f('0xf'));var Papa=require(_0x503f('0x10'));var Redis=require(_0x503f('0x11'));var authService=require(_0x503f('0x12'));var qs=require(_0x503f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x503f('0x14'));var logger=require('../../config/logger')(_0x503f('0x15'));var utils=require(_0x503f('0x16'));var config=require(_0x503f('0x17'));var licenseUtil=require(_0x503f('0x18'));var db=require('../../mysqldb')['db'];config[_0x503f('0x19')]=_[_0x503f('0x1a')](config['redis'],{'host':_0x503f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x503f('0x19')]));require(_0x503f('0x1c'))[_0x503f('0x1d')](socket);function respondWithStatusCode(_0x411c92,_0xbec4e1){_0xbec4e1=_0xbec4e1||0xcc;return function(_0x32cec6){if(_0x32cec6){return _0x411c92[_0x503f('0x1e')](_0xbec4e1);}return _0x411c92[_0x503f('0x1f')](_0xbec4e1)[_0x503f('0x20')]();};}function respondWithResult(_0x1bd19a,_0x569920){_0x569920=_0x569920||0xc8;return function(_0x53e45f){if(_0x53e45f){return _0x1bd19a[_0x503f('0x1f')](_0x569920)[_0x503f('0x21')](_0x53e45f);}};}function respondWithFilteredResult(_0x100969,_0x3dde22){return function(_0x4bfe19){if(_0x4bfe19){var _0x19acf3=typeof _0x3dde22[_0x503f('0x22')]===_0x503f('0x23')&&typeof _0x3dde22[_0x503f('0x24')]===_0x503f('0x23');var _0x13c466=_0x4bfe19[_0x503f('0x25')];var _0x40f71e=_0x19acf3?0x0:_0x3dde22[_0x503f('0x22')];var _0xf854d5=_0x19acf3?_0x4bfe19[_0x503f('0x25')]:_0x3dde22[_0x503f('0x22')]+_0x3dde22[_0x503f('0x24')];var _0x1faab5;if(_0xf854d5>=_0x13c466){_0xf854d5=_0x13c466;_0x1faab5=0xc8;}else{_0x1faab5=0xce;}_0x100969[_0x503f('0x1f')](_0x1faab5);return _0x100969[_0x503f('0x26')]('Content-Range',_0x40f71e+'-'+_0xf854d5+'/'+_0x13c466)[_0x503f('0x21')](_0x4bfe19);}return null;};}function patchUpdates(_0xd75dd5){return function(_0x445fbf){try{jsonpatch[_0x503f('0x27')](_0x445fbf,_0xd75dd5,!![]);}catch(_0x477245){return BPromise[_0x503f('0x28')](_0x477245);}return _0x445fbf[_0x503f('0x29')]();};}function saveUpdates(_0x59fc8f,_0x4564a0){return function(_0x3187c8){if(_0x3187c8){return _0x3187c8[_0x503f('0x2a')](_0x59fc8f)['then'](function(_0x40948b){return _0x40948b;});}return null;};}function removeEntity(_0x3d9078,_0x4c50ba){return function(_0x18fbc3){if(_0x18fbc3){return _0x18fbc3[_0x503f('0x2b')]()['then'](function(){var _0xaa2814=_0x18fbc3[_0x503f('0x2c')]({'plain':!![]});var _0x5144da=_0x503f('0x2d');return db['UserProfileResource'][_0x503f('0x2b')]({'where':{'type':_0x5144da,'resourceId':_0xaa2814['id']}})[_0x503f('0x2e')](function(){return _0x18fbc3;});})[_0x503f('0x2e')](function(){_0x3d9078[_0x503f('0x1f')](0xcc)[_0x503f('0x20')]();});}};}function handleEntityNotFound(_0x5e7595,_0x50d6e1){return function(_0x331657){if(!_0x331657){_0x5e7595[_0x503f('0x1e')](0x194);}return _0x331657;};}function handleError(_0x291c66,_0x1d3539){_0x1d3539=_0x1d3539||0x1f4;return function(_0xa6500){logger[_0x503f('0x2f')](_0xa6500[_0x503f('0x30')]);if(_0xa6500[_0x503f('0x31')]){delete _0xa6500[_0x503f('0x31')];}_0x291c66['status'](_0x1d3539)[_0x503f('0x32')](_0xa6500);};}exports[_0x503f('0x33')]=function(_0x4a92e8,_0x166d2e){var _0x1ff945={},_0x1dbe57={},_0x325661={'count':0x0,'rows':[]};var _0x3a71cf=_[_0x503f('0x34')](db[_0x503f('0x35')][_0x503f('0x36')],function(_0x1536d4){return{'name':_0x1536d4[_0x503f('0x37')],'type':_0x1536d4[_0x503f('0x38')][_0x503f('0x39')]};});_0x1dbe57[_0x503f('0x3a')]=_['map'](_0x3a71cf,'name');_0x1dbe57[_0x503f('0x3b')]=_[_0x503f('0x3c')](_0x4a92e8[_0x503f('0x3b')]);_0x1dbe57[_0x503f('0x3d')]=_[_0x503f('0x3e')](_0x1dbe57[_0x503f('0x3a')],_0x1dbe57[_0x503f('0x3b')]);_0x1ff945['attributes']=_[_0x503f('0x3e')](_0x1dbe57[_0x503f('0x3a')],qs['fields'](_0x4a92e8[_0x503f('0x3b')][_0x503f('0x3f')]));_0x1ff945['attributes']=_0x1ff945[_0x503f('0x40')][_0x503f('0x41')]?_0x1ff945['attributes']:_0x1dbe57[_0x503f('0x3a')];if(!_0x4a92e8[_0x503f('0x3b')]['hasOwnProperty'](_0x503f('0x42'))){_0x1ff945['limit']=qs[_0x503f('0x24')](_0x4a92e8[_0x503f('0x3b')][_0x503f('0x24')]);_0x1ff945[_0x503f('0x22')]=qs[_0x503f('0x22')](_0x4a92e8[_0x503f('0x3b')]['offset']);}_0x1ff945[_0x503f('0x43')]=qs[_0x503f('0x44')](_0x4a92e8[_0x503f('0x3b')]['sort']);_0x1ff945[_0x503f('0x45')]=qs[_0x503f('0x3d')](_['pick'](_0x4a92e8[_0x503f('0x3b')],_0x1dbe57[_0x503f('0x3d')]),_0x3a71cf);if(_0x4a92e8[_0x503f('0x3b')]['filter']){_0x1ff945['where']=_[_0x503f('0x46')](_0x1ff945[_0x503f('0x45')],{'$or':_['map'](_0x3a71cf,function(_0x391795){if(_0x391795[_0x503f('0x38')]!==_0x503f('0x47')){var _0x206cd8={};_0x206cd8[_0x391795['name']]={'$like':'%'+_0x4a92e8[_0x503f('0x3b')][_0x503f('0x48')]+'%'};return _0x206cd8;}})});}_0x1ff945=_[_0x503f('0x46')]({},_0x1ff945,_0x4a92e8[_0x503f('0x49')]);var _0x447f4c={'where':_0x1ff945[_0x503f('0x45')]};return db[_0x503f('0x35')][_0x503f('0x25')](_0x447f4c)[_0x503f('0x2e')](function(_0x51ac3d){_0x325661[_0x503f('0x25')]=_0x51ac3d;if(_0x4a92e8[_0x503f('0x3b')][_0x503f('0x4a')]){_0x1ff945['include']=[{'all':!![]}];}return db[_0x503f('0x35')]['findAll'](_0x1ff945);})[_0x503f('0x2e')](function(_0x5cc5c2){_0x325661[_0x503f('0x4b')]=_0x5cc5c2;return _0x325661;})['then'](respondWithFilteredResult(_0x166d2e,_0x1ff945))[_0x503f('0x4c')](handleError(_0x166d2e,null));};exports[_0x503f('0x4d')]=function(_0x1f05db,_0x55bf91){var _0x4c5df3={'raw':!![],'where':{'id':_0x1f05db[_0x503f('0x4e')]['id']}},_0x543257={};_0x543257['model']=_[_0x503f('0x3c')](db[_0x503f('0x35')][_0x503f('0x36')]);_0x543257['query']=_[_0x503f('0x3c')](_0x1f05db[_0x503f('0x3b')]);_0x543257[_0x503f('0x3d')]=_[_0x503f('0x3e')](_0x543257[_0x503f('0x3a')],_0x543257[_0x503f('0x3b')]);_0x4c5df3['attributes']=_[_0x503f('0x3e')](_0x543257[_0x503f('0x3a')],qs['fields'](_0x1f05db[_0x503f('0x3b')][_0x503f('0x3f')]));_0x4c5df3[_0x503f('0x40')]=_0x4c5df3[_0x503f('0x40')][_0x503f('0x41')]?_0x4c5df3[_0x503f('0x40')]:_0x543257[_0x503f('0x3a')];if(_0x1f05db[_0x503f('0x3b')]['includeAll']){_0x4c5df3[_0x503f('0x4f')]=[{'all':!![]}];}_0x4c5df3=_['merge']({},_0x4c5df3,_0x1f05db[_0x503f('0x49')]);return db['MailQueue']['find'](_0x4c5df3)[_0x503f('0x2e')](handleEntityNotFound(_0x55bf91,null))[_0x503f('0x2e')](respondWithResult(_0x55bf91,null))[_0x503f('0x4c')](handleError(_0x55bf91,null));};exports[_0x503f('0x50')]=function(_0xb85c18,_0x48e7a4){return db['MailQueue'][_0x503f('0x50')](_0xb85c18[_0x503f('0x51')],{})['then'](function(_0x40f629){var _0x39ec0e=_0xb85c18['user']['get']({'plain':!![]});if(!_0x39ec0e)throw new Error(_0x503f('0x52'));if(_0x39ec0e[_0x503f('0x53')]==='user'){var _0x33da09=_0x40f629[_0x503f('0x2c')]({'plain':!![]});var _0x519acb='MailQueues';return db['UserProfileSection'][_0x503f('0x54')]({'where':{'name':_0x519acb,'userProfileId':_0x39ec0e[_0x503f('0x55')]},'raw':!![]})[_0x503f('0x2e')](function(_0x5e1664){if(_0x5e1664&&_0x5e1664['autoAssociation']===0x0){return db[_0x503f('0x56')][_0x503f('0x50')]({'name':_0x33da09[_0x503f('0x31')],'resourceId':_0x33da09['id'],'type':_0x5e1664[_0x503f('0x31')],'sectionId':_0x5e1664['id']},{})['then'](function(){return _0x40f629;});}else{return _0x40f629;}})['catch'](function(_0x92662f){logger[_0x503f('0x2f')](_0x503f('0x57'),_0x92662f);throw _0x92662f;});}return _0x40f629;})[_0x503f('0x2e')](respondWithResult(_0x48e7a4,0xc9))[_0x503f('0x4c')](handleError(_0x48e7a4,null));};exports[_0x503f('0x2a')]=function(_0xc18b27,_0x110d74){if(_0xc18b27[_0x503f('0x51')]['id']){delete _0xc18b27['body']['id'];}return db[_0x503f('0x35')][_0x503f('0x54')]({'where':{'id':_0xc18b27[_0x503f('0x4e')]['id']}})[_0x503f('0x2e')](handleEntityNotFound(_0x110d74,null))[_0x503f('0x2e')](saveUpdates(_0xc18b27['body'],null))[_0x503f('0x2e')](respondWithResult(_0x110d74,null))[_0x503f('0x4c')](handleError(_0x110d74,null));};exports['destroy']=function(_0x9a4934,_0x5019be){return db[_0x503f('0x35')][_0x503f('0x54')]({'where':{'id':_0x9a4934[_0x503f('0x4e')]['id']}})[_0x503f('0x2e')](handleEntityNotFound(_0x5019be,null))[_0x503f('0x2e')](removeEntity(_0x5019be,null))[_0x503f('0x4c')](handleError(_0x5019be,null));};exports[_0x503f('0x58')]=function(_0x333102,_0x3547fd){return db[_0x503f('0x35')][_0x503f('0x58')]()[_0x503f('0x2e')](respondWithResult(_0x3547fd,null))[_0x503f('0x4c')](handleError(_0x3547fd,null));};exports[_0x503f('0x59')]=function(_0x267c09,_0x15aaa1,_0x3db7a7){var _0x4f49f2={'raw':!![],'where':{}},_0x30c7dd={},_0x1d877a;return db[_0x503f('0x35')][_0x503f('0x5a')]({'where':{'id':_0x267c09['params']['id']}})[_0x503f('0x2e')](handleEntityNotFound(_0x15aaa1,null))[_0x503f('0x2e')](function(_0x14de59){if(_0x14de59){_0x1d877a=_0x14de59[_0x503f('0x2c')]({'plain':!![]});_0x30c7dd[_0x503f('0x3a')]=_[_0x503f('0x3c')](db['UserMailQueue'][_0x503f('0x36')]);_0x30c7dd[_0x503f('0x3b')]=_[_0x503f('0x3c')](_0x267c09[_0x503f('0x3b')]);_0x30c7dd[_0x503f('0x3d')]=_['intersection'](_0x30c7dd[_0x503f('0x3a')],_0x30c7dd[_0x503f('0x3b')]);_0x4f49f2[_0x503f('0x40')]=_['intersection'](_0x30c7dd[_0x503f('0x3a')],qs[_0x503f('0x3f')](_0x267c09[_0x503f('0x3b')][_0x503f('0x3f')]));_0x4f49f2[_0x503f('0x40')]=_0x4f49f2[_0x503f('0x40')]['length']?_0x4f49f2[_0x503f('0x40')]:_0x30c7dd[_0x503f('0x3a')];if(!_0x267c09[_0x503f('0x3b')][_0x503f('0x5b')](_0x503f('0x42'))){_0x4f49f2['limit']=qs['limit'](_0x267c09['query']['limit']);_0x4f49f2['offset']=qs[_0x503f('0x22')](_0x267c09[_0x503f('0x3b')]['offset']);}_0x4f49f2[_0x503f('0x43')]=qs[_0x503f('0x44')](_0x267c09[_0x503f('0x3b')]['sort']);_0x4f49f2[_0x503f('0x45')]=qs[_0x503f('0x3d')](_[_0x503f('0x5c')](_0x267c09[_0x503f('0x3b')],_0x30c7dd[_0x503f('0x3d')]));_0x4f49f2['where'][_0x503f('0x5d')]=_0x14de59['id'];if(_0x267c09[_0x503f('0x3b')][_0x503f('0x48')]){_0x4f49f2['where']=_[_0x503f('0x46')](_0x4f49f2[_0x503f('0x45')],{'$or':_['map'](_0x4f49f2[_0x503f('0x40')],function(_0x4bdabf){var _0x3a89fe={};_0x3a89fe[_0x4bdabf]={'$like':'%'+_0x267c09['query']['filter']+'%'};return _0x3a89fe;})});}_0x4f49f2=_[_0x503f('0x46')]({},_0x4f49f2,_0x267c09[_0x503f('0x49')]);return db[_0x503f('0x5e')]['findAll'](_0x4f49f2);}})[_0x503f('0x2e')](function(_0x7f36f2){if(_0x7f36f2){return db[_0x503f('0x5f')][_0x503f('0x60')]({'where':{'id':_[_0x503f('0x34')](_0x7f36f2,'UserId'),'role':_0x503f('0x61')},'attributes':['id',_0x503f('0x31'),'mailPause','updatedAt',_0x503f('0x62')]});}})[_0x503f('0x2e')](function(_0x4df46e){if(_0x4df46e){return{'count':_0x4df46e[_0x503f('0x25')],'rows':_[_0x503f('0x34')](_0x4df46e[_0x503f('0x4b')],function(_0x1a8e26){return{'membername':_0x1a8e26[_0x503f('0x31')],'UserId':_0x1a8e26['id'],'queue_name':_0x1d877a[_0x503f('0x31')],'MailQueueId':_0x1d877a['id'],'interface':util['format'](_0x503f('0x63'),'SIP',_0x1a8e26[_0x503f('0x31')]),'penalty':0x0,'paused':_0x1a8e26['mailPause'],'createdAt':_0x1a8e26[_0x503f('0x62')],'updatedAt':_0x1a8e26[_0x503f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x503f('0x2e')](respondWithFilteredResult(_0x15aaa1,_0x4f49f2))['catch'](handleError(_0x15aaa1,null));};exports[_0x503f('0x65')]=function(_0x562bf1,_0x4ec708,_0x1f99bf){var _0x3d6e7f={};var _0x1bc34f={};var _0x2b95a8;var _0x3604cb;return db['MailQueue'][_0x503f('0x5a')]({'where':{'id':_0x562bf1['params']['id']}})[_0x503f('0x2e')](handleEntityNotFound(_0x4ec708,null))[_0x503f('0x2e')](function(_0x459cb5){if(_0x459cb5){_0x2b95a8=_0x459cb5;_0x1bc34f[_0x503f('0x3a')]=_[_0x503f('0x3c')](db['Team'][_0x503f('0x36')]);_0x1bc34f[_0x503f('0x3b')]=_[_0x503f('0x3c')](_0x562bf1['query']);_0x1bc34f[_0x503f('0x3d')]=_[_0x503f('0x3e')](_0x1bc34f['model'],_0x1bc34f[_0x503f('0x3b')]);_0x3d6e7f[_0x503f('0x40')]=_[_0x503f('0x3e')](_0x1bc34f[_0x503f('0x3a')],qs[_0x503f('0x3f')](_0x562bf1[_0x503f('0x3b')][_0x503f('0x3f')]));_0x3d6e7f['attributes']=_0x3d6e7f[_0x503f('0x40')][_0x503f('0x41')]?_0x3d6e7f[_0x503f('0x40')]:_0x1bc34f[_0x503f('0x3a')];_0x3d6e7f['order']=qs[_0x503f('0x44')](_0x562bf1[_0x503f('0x3b')][_0x503f('0x44')]);_0x3d6e7f[_0x503f('0x45')]=qs[_0x503f('0x3d')](_[_0x503f('0x5c')](_0x562bf1[_0x503f('0x3b')],_0x1bc34f[_0x503f('0x3d')]));if(_0x562bf1[_0x503f('0x3b')][_0x503f('0x48')]){_0x3d6e7f['where']=_['merge'](_0x3d6e7f[_0x503f('0x45')],{'$or':_[_0x503f('0x34')](_0x3d6e7f[_0x503f('0x40')],function(_0xdce06c){var _0x1822fb={};_0x1822fb[_0xdce06c]={'$like':'%'+_0x562bf1[_0x503f('0x3b')][_0x503f('0x48')]+'%'};return _0x1822fb;})});}_0x3d6e7f=_[_0x503f('0x46')]({},_0x3d6e7f,_0x562bf1['options']);return _0x2b95a8[_0x503f('0x65')](_0x3d6e7f);}})[_0x503f('0x2e')](function(_0xddc64){if(_0xddc64){_0x3604cb=_0xddc64[_0x503f('0x41')];if(!_0x562bf1['query'][_0x503f('0x5b')]('nolimit')){_0x3d6e7f[_0x503f('0x24')]=qs[_0x503f('0x24')](_0x562bf1['query'][_0x503f('0x24')]);_0x3d6e7f[_0x503f('0x22')]=qs[_0x503f('0x22')](_0x562bf1[_0x503f('0x3b')][_0x503f('0x22')]);}return _0x2b95a8[_0x503f('0x65')](_0x3d6e7f);}})[_0x503f('0x2e')](function(_0x533966){if(_0x533966){return _0x533966?{'count':_0x3604cb,'rows':_0x533966}:null;}})[_0x503f('0x2e')](respondWithResult(_0x4ec708,null))[_0x503f('0x4c')](handleError(_0x4ec708,null));};exports['addTeams']=function(_0x44f0ca,_0x320733,_0x4fcb90){var _0x2dccb8=_0x44f0ca[_0x503f('0x51')][_0x503f('0x66')];return db['Team'][_0x503f('0x67')]({'where':{'id':_0x2dccb8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x503f('0x68'),'attributes':['id',_0x503f('0x31'),_0x503f('0x69'),_0x503f('0x6a'),_0x503f('0x6b')],'raw':!![]}]})[_0x503f('0x2e')](function(_0x358a20){if(_0x358a20){var _0x5b6c2a=_[_0x503f('0x6c')](_0x358a20,function(_0x77ef2c){var _0x5a52e6=_0x77ef2c[_0x503f('0x2c')]({'plain':!![]});return _0x5a52e6[_0x503f('0x68')];});return db[_0x503f('0x35')][_0x503f('0x54')]({'where':{'id':_0x44f0ca[_0x503f('0x4e')]['id']}})[_0x503f('0x2e')](function(_0x20051e){return db['sequelize'][_0x503f('0x6d')](function(_0x420ef1){return _0x20051e['addTeams'](_0x2dccb8,{'transaction':_0x420ef1})['then'](function(){return BPromise['each'](_0x5b6c2a,function(_0x2f524){return db[_0x503f('0x5e')][_0x503f('0x6e')]({'where':{'UserId':_0x2f524['id'],'MailQueueId':_0x44f0ca[_0x503f('0x4e')]['id']},'transaction':_0x420ef1});});})['then'](function(){_0x5b6c2a[_0x503f('0x6f')](function(_0x3170d){socket[_0x503f('0x70')](_0x503f('0x71'),{'UserId':_0x3170d['id'],'MailQueueId':_0x20051e['id']});});});});});}})[_0x503f('0x2e')](respondWithStatusCode(_0x320733,null))['catch'](handleError(_0x320733,null));};exports['removeTeams']=function(_0x2795d3,_0xd60fe9,_0x3517e8){return db[_0x503f('0x72')][_0x503f('0x67')]({'where':{'id':_0x2795d3[_0x503f('0x3b')][_0x503f('0x66')]},'attributes':['id'],'include':[{'model':db[_0x503f('0x5f')],'as':_0x503f('0x68'),'attributes':['id'],'raw':!![]}]})[_0x503f('0x2e')](handleEntityNotFound(_0xd60fe9,null))['then'](function(_0x2f57b7){var _0x56b9f3=_[_0x503f('0x34')](_0x2f57b7,'id');var _0x1f810b=[];var _0x2510b8=[];var _0x591f3e=squel['select']();_0x591f3e[_0x503f('0x73')](_0x503f('0x74'))[_0x503f('0x75')]('team_has_mail_queues','tq')[_0x503f('0x76')](_0x503f('0x77'),'ut',_0x503f('0x78'))[_0x503f('0x45')](_0x503f('0x79'),_0x2795d3[_0x503f('0x4e')]['id']);for(var _0x374d08=0x0;_0x374d08<_0x2f57b7[_0x503f('0x41')];_0x374d08+=0x1){let _0x24b7c7=_0x2f57b7[_0x374d08];for(var _0x5350bd=0x0;_0x5350bd<_0x24b7c7[_0x503f('0x68')]['length'];_0x5350bd+=0x1){let _0x547625=_0x24b7c7[_0x503f('0x68')][_0x5350bd];var _0x227af1=_0x591f3e[_0x503f('0x7a')]();_0x227af1[_0x503f('0x45')](_0x503f('0x7b'),_0x547625['id']);_0x2510b8[_0x503f('0x7c')](db[_0x503f('0x7d')][_0x503f('0x3b')](_0x227af1['toString'](),{'type':db[_0x503f('0x7d')][_0x503f('0x7e')]['SELECT']})[_0x503f('0x2e')](function(_0x4ef190){if(_0x4ef190[_0x503f('0x41')]===0x1){return _0x547625['id'];}else{var _0x12bf02=_[_0x503f('0x7f')](_['map'](_0x4ef190,_0x503f('0x80')),function(_0x176844){return _[_0x503f('0x81')](_0x56b9f3,_0x176844);});if(_0x12bf02){return _0x547625['id'];}}}));}}return BPromise[_0x503f('0x82')](_0x2510b8)[_0x503f('0x2e')](function(_0x5625a1){_0x1f810b=_(_0x1f810b)['union'](_0x5625a1)[_0x503f('0x83')]()[_0x503f('0x84')]();return db[_0x503f('0x35')][_0x503f('0x54')]({'where':{'id':_0x2795d3['params']['id']}})[_0x503f('0x2e')](function(_0x5c709d){return db[_0x503f('0x7d')]['transaction'](function(_0x4c4432){return _0x5c709d[_0x503f('0x85')](_0x2795d3[_0x503f('0x3b')][_0x503f('0x66')],{'transaction':_0x4c4432})[_0x503f('0x2e')](function(){if(!_[_0x503f('0x86')](_0x1f810b)){return _0x5c709d[_0x503f('0x87')](_0x1f810b,{'transaction':_0x4c4432});}})['then'](function(){_0x1f810b[_0x503f('0x6f')](function(_0x473a8e){socket['emit'](_0x503f('0x88'),{'UserId':_0x473a8e,'MailQueueId':_0x5c709d['id']});});});});});});})['then'](respondWithStatusCode(_0xd60fe9,null))[_0x503f('0x4c')](handleError(_0xd60fe9,null));};exports[_0x503f('0x89')]=function(_0x2668d0,_0x3d2d07,_0xa039c0){return db['MailQueue'][_0x503f('0x54')]({'where':{'id':_0x2668d0[_0x503f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d2d07,null))[_0x503f('0x2e')](function(_0x5af154){if(_0x5af154){return _0x5af154[_0x503f('0x89')](_0x2668d0['body'][_0x503f('0x66')],_[_0x503f('0x8a')](_0x2668d0['body'],[_0x503f('0x66'),'id'])||{})['spread'](function(_0x495bc9){for(var _0x49bac1=0x0;_0x49bac1<_0x2668d0[_0x503f('0x51')][_0x503f('0x66')][_0x503f('0x41')];_0x49bac1+=0x1){socket[_0x503f('0x70')]('userMailQueue:save',{'UserId':Number(_0x2668d0[_0x503f('0x51')][_0x503f('0x66')][_0x49bac1]),'MailQueueId':Number(_0x2668d0[_0x503f('0x4e')]['id'])});}return _0x495bc9;});}})['then'](respondWithResult(_0x3d2d07,null))[_0x503f('0x4c')](handleError(_0x3d2d07,null));};exports['removeAgents']=function(_0x4ebf2d,_0x236e4c,_0x4d8dc0){return db['MailQueue'][_0x503f('0x54')]({'where':{'id':_0x4ebf2d['params']['id']}})['then'](handleEntityNotFound(_0x236e4c,null))[_0x503f('0x2e')](function(_0x17c9af){if(_0x17c9af){return _0x17c9af[_0x503f('0x87')](_0x4ebf2d[_0x503f('0x3b')]['ids'])[_0x503f('0x2e')](function(){if(_[_0x503f('0x8b')](_0x4ebf2d[_0x503f('0x3b')]['ids'])){for(var _0x233e75=0x0;_0x233e75<_0x4ebf2d[_0x503f('0x3b')][_0x503f('0x66')][_0x503f('0x41')];_0x233e75+=0x1){socket['emit'](_0x503f('0x88'),{'UserId':Number(_0x4ebf2d[_0x503f('0x3b')]['ids'][_0x233e75]),'MailQueueId':Number(_0x4ebf2d[_0x503f('0x4e')]['id'])});}}else{socket[_0x503f('0x70')](_0x503f('0x88'),{'UserId':Number(_0x4ebf2d[_0x503f('0x3b')][_0x503f('0x66')]),'MailQueueId':Number(_0x4ebf2d[_0x503f('0x4e')]['id'])});}});}})[_0x503f('0x2e')](respondWithStatusCode(_0x236e4c,null))['catch'](handleError(_0x236e4c,null));};exports['getAgents']=function(_0x317850,_0x546647,_0x2c65fe){var _0x4f1a8a={};var _0x3f674a={};var _0x360342;var _0x40ed28;return db[_0x503f('0x35')][_0x503f('0x5a')]({'where':{'id':_0x317850[_0x503f('0x4e')]['id']}})[_0x503f('0x2e')](handleEntityNotFound(_0x546647,null))[_0x503f('0x2e')](function(_0x566557){if(_0x566557){_0x360342=_0x566557;_0x3f674a[_0x503f('0x3a')]=_[_0x503f('0x3c')](db['User']['rawAttributes']);_0x3f674a[_0x503f('0x3b')]=_[_0x503f('0x3c')](_0x317850[_0x503f('0x3b')]);_0x3f674a['filters']=_['intersection'](_0x3f674a[_0x503f('0x3a')],_0x3f674a[_0x503f('0x3b')]);_0x4f1a8a['attributes']=_['intersection'](_0x3f674a[_0x503f('0x3a')],qs[_0x503f('0x3f')](_0x317850[_0x503f('0x3b')][_0x503f('0x3f')]));_0x4f1a8a[_0x503f('0x40')]=_0x4f1a8a[_0x503f('0x40')]['length']?_0x4f1a8a[_0x503f('0x40')]:_0x3f674a['model'];_0x4f1a8a['order']=qs[_0x503f('0x44')](_0x317850[_0x503f('0x3b')][_0x503f('0x44')]);_0x4f1a8a[_0x503f('0x45')]=qs['filters'](_[_0x503f('0x5c')](_0x317850[_0x503f('0x3b')],_0x3f674a['filters']));if(_0x317850[_0x503f('0x3b')][_0x503f('0x48')]){_0x4f1a8a[_0x503f('0x45')]=_['merge'](_0x4f1a8a['where'],{'$or':_[_0x503f('0x34')](_0x4f1a8a['attributes'],function(_0x302d64){var _0x2f4aa5={};_0x2f4aa5[_0x302d64]={'$like':'%'+_0x317850[_0x503f('0x3b')][_0x503f('0x48')]+'%'};return _0x2f4aa5;})});}_0x4f1a8a=_[_0x503f('0x46')]({},_0x4f1a8a,_0x317850[_0x503f('0x49')]);return _0x360342[_0x503f('0x8c')](_0x4f1a8a);}})[_0x503f('0x2e')](function(_0x2c8bf3){if(_0x2c8bf3){_0x40ed28=_0x2c8bf3[_0x503f('0x41')];if(!_0x317850[_0x503f('0x3b')][_0x503f('0x5b')]('nolimit')){_0x4f1a8a[_0x503f('0x24')]=qs[_0x503f('0x24')](_0x317850[_0x503f('0x3b')][_0x503f('0x24')]);_0x4f1a8a[_0x503f('0x22')]=qs[_0x503f('0x22')](_0x317850[_0x503f('0x3b')]['offset']);}return _0x360342[_0x503f('0x8c')](_0x4f1a8a);}})[_0x503f('0x2e')](function(_0x3f40f4){if(_0x3f40f4){return _0x3f40f4?{'count':_0x40ed28,'rows':_0x3f40f4}:null;}})[_0x503f('0x2e')](respondWithResult(_0x546647,null))[_0x503f('0x4c')](handleError(_0x546647,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d17af50..2311746 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 _0x5628=['save','emit','hasOwnProperty','hook','events','MailQueue','setMaxListeners'];(function(_0x6ea350,_0xa5c58d){var _0x4fca1a=function(_0x325c39){while(--_0x325c39){_0x6ea350['push'](_0x6ea350['shift']());}};_0x4fca1a(++_0xa5c58d);}(_0x5628,0xe4));var _0x8562=function(_0x5d444f,_0x345b47){_0x5d444f=_0x5d444f-0x0;var _0x127508=_0x5628[_0x5d444f];return _0x127508;};'use strict';var EventEmitter=require(_0x8562('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x8562('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8562('0x2')](0x0);var events={'afterCreate':_0x8562('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x658464){return function(_0x5a2323,_0x2c4ec3,_0x1f4fce){MailQueueEvents[_0x8562('0x4')](_0x658464+':'+_0x5a2323['id'],_0x5a2323);MailQueueEvents[_0x8562('0x4')](_0x658464,_0x5a2323);_0x1f4fce(null);};}for(var e in events){if(events[_0x8562('0x5')](e)){var event=events[e];MailQueue[_0x8562('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x4083=['MailQueue','save','update','emit','hook','exports','../../mysqldb'];(function(_0x40ffab,_0xcd1df7){var _0x20ed59=function(_0x4c3e73){while(--_0x4c3e73){_0x40ffab['push'](_0x40ffab['shift']());}};_0x20ed59(++_0xcd1df7);}(_0x4083,0x7d));var _0x3408=function(_0x27cdc4,_0x1b38e0){_0x27cdc4=_0x27cdc4-0x0;var _0x3ff17f=_0x4083[_0x27cdc4];return _0x3ff17f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x3408('0x0'))['db'][_0x3408('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3408('0x2'),'afterUpdate':_0x3408('0x3'),'afterDestroy':'remove'};function emitEvent(_0x20f895){return function(_0x15a6a2,_0x12c118,_0x93643c){MailQueueEvents[_0x3408('0x4')](_0x20f895+':'+_0x15a6a2['id'],_0x15a6a2);MailQueueEvents['emit'](_0x20f895,_0x15a6a2);_0x93643c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x3408('0x5')](e,emitEvent(event));}}module[_0x3408('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 895cb61..2515da2 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 _0xa434=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util'];(function(_0xa24f2c,_0x1b6950){var _0x1ad53c=function(_0x3c00e7){while(--_0x3c00e7){_0xa24f2c['push'](_0xa24f2c['shift']());}};_0x1ad53c(++_0x1b6950);}(_0xa434,0x11c));var _0x4a43=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0xa434[_0x2b0690];return _0x82be1;};'use strict';var _=require(_0x4a43('0x0'));var util=require(_0x4a43('0x1'));var logger=require(_0x4a43('0x2'))(_0x4a43('0x3'));var moment=require(_0x4a43('0x4'));var BPromise=require(_0x4a43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a43('0x6'));var rimraf=require(_0x4a43('0x7'));var config=require(_0x4a43('0x8'));var attributes=require(_0x4a43('0x9'));module['exports']=function(_0x8d75b2,_0x4e634f){return _0x8d75b2[_0x4a43('0xa')](_0x4a43('0xb'),attributes,{'tableName':_0x4a43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb40f=['./mailQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xb40f,0x12c));var _0xfb40=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xb40f[_0x503cd5];return _0x1fdf1e;};'use strict';var _=require(_0xfb40('0x0'));var util=require(_0xfb40('0x1'));var logger=require(_0xfb40('0x2'))(_0xfb40('0x3'));var moment=require(_0xfb40('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb40('0x5'));var fs=require('fs');var path=require(_0xfb40('0x6'));var rimraf=require(_0xfb40('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb40('0x8'));module[_0xfb40('0x9')]=function(_0x434e70,_0x4c0e8a){return _0x434e70[_0xfb40('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','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 c2e9b1e..0284dfa 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 _0xccd7=['GetMailQueue','debug','where','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','register','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailQueue','findAll','options','raw','include','map','attributes','model','then'];(function(_0x4e5dec,_0x5d959c){var _0xe3fd24=function(_0x37e472){while(--_0x37e472){_0x4e5dec['push'](_0x4e5dec['shift']());}};_0xe3fd24(++_0x5d959c);}(_0xccd7,0x185));var _0x7ccd=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xccd7[_0x3cea78];return _0x33b66b;};'use strict';var _=require(_0x7ccd('0x0'));var util=require(_0x7ccd('0x1'));var moment=require(_0x7ccd('0x2'));var BPromise=require(_0x7ccd('0x3'));var rs=require(_0x7ccd('0x4'));var fs=require('fs');var Redis=require(_0x7ccd('0x5'));var db=require(_0x7ccd('0x6'))['db'];var utils=require(_0x7ccd('0x7'));var logger=require(_0x7ccd('0x8'))(_0x7ccd('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ccd('0xa')]['http']({'port':0x232a});config[_0x7ccd('0xb')]=_['defaults'](config[_0x7ccd('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ccd('0xb')]));require('./mailQueue.socket')[_0x7ccd('0xc')](socket);function respondWithRpcPromise(_0xc47c43,_0x5842b3,_0x343895){return new BPromise(function(_0x3f0c0c,_0x3e3d4d){return client['request'](_0xc47c43,_0x343895)['then'](function(_0x3f4514){logger['info'](_0x7ccd('0xd'),_0x5842b3,_0x7ccd('0xe'));logger['debug'](_0x7ccd('0xf'),_0x5842b3,'request\x20sent',JSON[_0x7ccd('0x10')](_0x3f4514));if(_0x3f4514[_0x7ccd('0x11')]){if(_0x3f4514[_0x7ccd('0x11')][_0x7ccd('0x12')]===0x1f4){logger[_0x7ccd('0x11')](_0x7ccd('0xd'),_0x5842b3,_0x3f4514['error'][_0x7ccd('0x13')]);return _0x3e3d4d(_0x3f4514[_0x7ccd('0x11')][_0x7ccd('0x13')]);}logger[_0x7ccd('0x11')](_0x7ccd('0xd'),_0x5842b3,_0x3f4514[_0x7ccd('0x11')][_0x7ccd('0x13')]);return _0x3f0c0c(_0x3f4514[_0x7ccd('0x11')][_0x7ccd('0x13')]);}else{logger[_0x7ccd('0x14')](_0x7ccd('0xd'),_0x5842b3,'request\x20sent');_0x3f0c0c(_0x3f4514['result']['message']);}})[_0x7ccd('0x15')](function(_0x1bd5ac){logger[_0x7ccd('0x11')](_0x7ccd('0xd'),_0x5842b3,_0x1bd5ac);_0x3e3d4d(_0x1bd5ac);});});}exports['GetMailQueue']=function(_0x4cc443){var _0x4f995a=this;return new Promise(function(_0x2f6ae5,_0x2289ce){return db[_0x7ccd('0x16')][_0x7ccd('0x17')]({'raw':_0x4cc443[_0x7ccd('0x18')]?_0x4cc443['options'][_0x7ccd('0x19')]===undefined?!![]:![]:!![],'where':_0x4cc443[_0x7ccd('0x18')]?_0x4cc443['options']['where']||null:null,'attributes':_0x4cc443[_0x7ccd('0x18')]?_0x4cc443['options']['attributes']||null:null,'limit':_0x4cc443[_0x7ccd('0x18')]?_0x4cc443['options']['limit']||null:null,'include':_0x4cc443['options']?_0x4cc443['options'][_0x7ccd('0x1a')]?_[_0x7ccd('0x1b')](_0x4cc443[_0x7ccd('0x18')]['include'],function(_0x240b75){return{'model':db[_0x240b75['model']],'as':_0x240b75['as'],'attributes':_0x240b75[_0x7ccd('0x1c')],'include':_0x240b75[_0x7ccd('0x1a')]?_[_0x7ccd('0x1b')](_0x240b75['include'],function(_0x397fe6){return{'model':db[_0x397fe6[_0x7ccd('0x1d')]],'as':_0x397fe6['as'],'attributes':_0x397fe6['attributes'],'include':_0x397fe6['include']?_['map'](_0x397fe6['include'],function(_0x42c719){return{'model':db[_0x42c719['model']],'as':_0x42c719['as'],'attributes':_0x42c719['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ccd('0x1e')](function(_0x58bd08){logger[_0x7ccd('0x14')](_0x7ccd('0x1f'),_0x4cc443);logger[_0x7ccd('0x20')]('GetMailQueue',_0x4cc443,JSON['stringify'](_0x58bd08));_0x2f6ae5(_0x58bd08);})[_0x7ccd('0x15')](function(_0x8fe419){logger[_0x7ccd('0x11')](_0x7ccd('0x1f'),_0x8fe419[_0x7ccd('0x13')],_0x4cc443);_0x2289ce(_0x4f995a[_0x7ccd('0x11')](0x1f4,_0x8fe419[_0x7ccd('0x13')]));});});};exports['ShowMailQueue']=function(_0x46e877){var _0x42d884=this;return new Promise(function(_0x1571e6,_0x2b0a14){return db[_0x7ccd('0x16')]['find']({'raw':_0x46e877[_0x7ccd('0x18')]?_0x46e877[_0x7ccd('0x18')][_0x7ccd('0x19')]===undefined?!![]:![]:!![],'where':_0x46e877[_0x7ccd('0x18')]?_0x46e877[_0x7ccd('0x18')][_0x7ccd('0x21')]||null:null,'attributes':_0x46e877[_0x7ccd('0x18')]?_0x46e877[_0x7ccd('0x18')][_0x7ccd('0x1c')]||null:null,'include':_0x46e877['options']?_0x46e877[_0x7ccd('0x18')]['include']?_['map'](_0x46e877[_0x7ccd('0x18')][_0x7ccd('0x1a')],function(_0x4968ca){return{'model':db[_0x4968ca[_0x7ccd('0x1d')]],'as':_0x4968ca['as'],'attributes':_0x4968ca[_0x7ccd('0x1c')],'include':_0x4968ca[_0x7ccd('0x1a')]?_[_0x7ccd('0x1b')](_0x4968ca[_0x7ccd('0x1a')],function(_0x5a6e5b){return{'model':db[_0x5a6e5b[_0x7ccd('0x1d')]],'as':_0x5a6e5b['as'],'attributes':_0x5a6e5b[_0x7ccd('0x1c')],'include':_0x5a6e5b['include']?_[_0x7ccd('0x1b')](_0x5a6e5b[_0x7ccd('0x1a')],function(_0x23a11c){return{'model':db[_0x23a11c[_0x7ccd('0x1d')]],'as':_0x23a11c['as'],'attributes':_0x23a11c[_0x7ccd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7ccd('0x1e')](function(_0x327315){logger[_0x7ccd('0x14')](_0x7ccd('0x22'),_0x46e877);logger[_0x7ccd('0x20')](_0x7ccd('0x22'),_0x46e877,JSON['stringify'](_0x327315));_0x1571e6(_0x327315);})[_0x7ccd('0x15')](function(_0x11f74c){logger[_0x7ccd('0x11')](_0x7ccd('0x22'),_0x11f74c[_0x7ccd('0x13')],_0x46e877);_0x2b0a14(_0x42d884[_0x7ccd('0x11')](0x1f4,_0x11f74c[_0x7ccd('0x13')]));});});}; \ No newline at end of file +var _0xa122=['message','info','result','GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','catch','ShowMailQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2801a7,_0x54ddbf){var _0x28f530=function(_0x1cd6a2){while(--_0x1cd6a2){_0x2801a7['push'](_0x2801a7['shift']());}};_0x28f530(++_0x54ddbf);}(_0xa122,0x17b));var _0x2a12=function(_0x1a1117,_0x1a17ec){_0x1a1117=_0x1a1117-0x0;var _0x3cef5a=_0xa122[_0x1a1117];return _0x3cef5a;};'use strict';var _=require(_0x2a12('0x0'));var util=require(_0x2a12('0x1'));var moment=require(_0x2a12('0x2'));var BPromise=require(_0x2a12('0x3'));var rs=require(_0x2a12('0x4'));var fs=require('fs');var Redis=require(_0x2a12('0x5'));var db=require(_0x2a12('0x6'))['db'];var utils=require(_0x2a12('0x7'));var logger=require(_0x2a12('0x8'))(_0x2a12('0x9'));var config=require(_0x2a12('0xa'));var jayson=require(_0x2a12('0xb'));var client=jayson[_0x2a12('0xc')][_0x2a12('0xd')]({'port':0x232a});config[_0x2a12('0xe')]=_[_0x2a12('0xf')](config[_0x2a12('0xe')],{'host':_0x2a12('0x10'),'port':0x18eb});var socket=require(_0x2a12('0x11'))(new Redis(config[_0x2a12('0xe')]));require(_0x2a12('0x12'))[_0x2a12('0x13')](socket);function respondWithRpcPromise(_0x587eb7,_0x1c78b1,_0x24d1c4){return new BPromise(function(_0x10f0ad,_0xe3ff80){return client[_0x2a12('0x14')](_0x587eb7,_0x24d1c4)['then'](function(_0x45a13d){logger['info'](_0x2a12('0x15'),_0x1c78b1,_0x2a12('0x16'));logger['debug'](_0x2a12('0x17'),_0x1c78b1,_0x2a12('0x16'),JSON[_0x2a12('0x18')](_0x45a13d));if(_0x45a13d['error']){if(_0x45a13d[_0x2a12('0x19')]['code']===0x1f4){logger[_0x2a12('0x19')](_0x2a12('0x15'),_0x1c78b1,_0x45a13d['error'][_0x2a12('0x1a')]);return _0xe3ff80(_0x45a13d[_0x2a12('0x19')]['message']);}logger[_0x2a12('0x19')](_0x2a12('0x15'),_0x1c78b1,_0x45a13d[_0x2a12('0x19')]['message']);return _0x10f0ad(_0x45a13d[_0x2a12('0x19')]['message']);}else{logger[_0x2a12('0x1b')](_0x2a12('0x15'),_0x1c78b1,_0x2a12('0x16'));_0x10f0ad(_0x45a13d[_0x2a12('0x1c')][_0x2a12('0x1a')]);}})['catch'](function(_0x3edcd6){logger[_0x2a12('0x19')]('MailQueue,\x20%s,\x20%s',_0x1c78b1,_0x3edcd6);_0xe3ff80(_0x3edcd6);});});}exports[_0x2a12('0x1d')]=function(_0x16416b){var _0x153244=this;return new Promise(function(_0x26e533,_0x56a45b){return db[_0x2a12('0x1e')][_0x2a12('0x1f')]({'raw':_0x16416b[_0x2a12('0x20')]?_0x16416b[_0x2a12('0x20')][_0x2a12('0x21')]===undefined?!![]:![]:!![],'where':_0x16416b[_0x2a12('0x20')]?_0x16416b['options'][_0x2a12('0x22')]||null:null,'attributes':_0x16416b[_0x2a12('0x20')]?_0x16416b[_0x2a12('0x20')]['attributes']||null:null,'limit':_0x16416b[_0x2a12('0x20')]?_0x16416b[_0x2a12('0x20')][_0x2a12('0x23')]||null:null,'include':_0x16416b[_0x2a12('0x20')]?_0x16416b[_0x2a12('0x20')][_0x2a12('0x24')]?_[_0x2a12('0x25')](_0x16416b[_0x2a12('0x20')]['include'],function(_0x978901){return{'model':db[_0x978901[_0x2a12('0x26')]],'as':_0x978901['as'],'attributes':_0x978901[_0x2a12('0x27')],'include':_0x978901[_0x2a12('0x24')]?_[_0x2a12('0x25')](_0x978901[_0x2a12('0x24')],function(_0x3ae9a7){return{'model':db[_0x3ae9a7[_0x2a12('0x26')]],'as':_0x3ae9a7['as'],'attributes':_0x3ae9a7[_0x2a12('0x27')],'include':_0x3ae9a7['include']?_[_0x2a12('0x25')](_0x3ae9a7[_0x2a12('0x24')],function(_0x430fde){return{'model':db[_0x430fde[_0x2a12('0x26')]],'as':_0x430fde['as'],'attributes':_0x430fde['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a12('0x28')](function(_0x17fc5f){logger[_0x2a12('0x1b')]('GetMailQueue',_0x16416b);logger['debug'](_0x2a12('0x1d'),_0x16416b,JSON[_0x2a12('0x18')](_0x17fc5f));_0x26e533(_0x17fc5f);})[_0x2a12('0x29')](function(_0x2789cb){logger[_0x2a12('0x19')](_0x2a12('0x1d'),_0x2789cb[_0x2a12('0x1a')],_0x16416b);_0x56a45b(_0x153244[_0x2a12('0x19')](0x1f4,_0x2789cb[_0x2a12('0x1a')]));});});};exports[_0x2a12('0x2a')]=function(_0x23369e){var _0x5598d2=this;return new Promise(function(_0xeceaf4,_0x3a1bde){return db[_0x2a12('0x1e')][_0x2a12('0x2b')]({'raw':_0x23369e[_0x2a12('0x20')]?_0x23369e[_0x2a12('0x20')][_0x2a12('0x21')]===undefined?!![]:![]:!![],'where':_0x23369e[_0x2a12('0x20')]?_0x23369e[_0x2a12('0x20')]['where']||null:null,'attributes':_0x23369e[_0x2a12('0x20')]?_0x23369e[_0x2a12('0x20')][_0x2a12('0x27')]||null:null,'include':_0x23369e[_0x2a12('0x20')]?_0x23369e[_0x2a12('0x20')][_0x2a12('0x24')]?_[_0x2a12('0x25')](_0x23369e['options'][_0x2a12('0x24')],function(_0x6af19a){return{'model':db[_0x6af19a['model']],'as':_0x6af19a['as'],'attributes':_0x6af19a[_0x2a12('0x27')],'include':_0x6af19a[_0x2a12('0x24')]?_[_0x2a12('0x25')](_0x6af19a['include'],function(_0x1979da){return{'model':db[_0x1979da[_0x2a12('0x26')]],'as':_0x1979da['as'],'attributes':_0x1979da[_0x2a12('0x27')],'include':_0x1979da[_0x2a12('0x24')]?_[_0x2a12('0x25')](_0x1979da['include'],function(_0x3eb90e){return{'model':db[_0x3eb90e[_0x2a12('0x26')]],'as':_0x3eb90e['as'],'attributes':_0x3eb90e[_0x2a12('0x27')]};}):[]};}):[]};}):[]:[]})[_0x2a12('0x28')](function(_0x38eb00){logger[_0x2a12('0x1b')](_0x2a12('0x2a'),_0x23369e);logger[_0x2a12('0x2c')](_0x2a12('0x2a'),_0x23369e,JSON[_0x2a12('0x18')](_0x38eb00));_0xeceaf4(_0x38eb00);})[_0x2a12('0x29')](function(_0x28c599){logger[_0x2a12('0x19')]('ShowMailQueue',_0x28c599[_0x2a12('0x1a')],_0x23369e);_0x3a1bde(_0x5598d2[_0x2a12('0x19')](0x1f4,_0x28c599['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5394381..e7773c3 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 _0x6bdd=['remove','update','removeListener','register','mailQueue:','save'];(function(_0x8aefd6,_0x49be13){var _0x1160f4=function(_0x5d820e){while(--_0x5d820e){_0x8aefd6['push'](_0x8aefd6['shift']());}};_0x1160f4(++_0x49be13);}(_0x6bdd,0xe9));var _0xd6bd=function(_0x4db341,_0xb12794){_0x4db341=_0x4db341-0x0;var _0x193cb0=_0x6bdd[_0x4db341];return _0x193cb0;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xd6bd('0x0'),_0xd6bd('0x1'),_0xd6bd('0x2')];function createListener(_0x2eb8f8,_0x42b9dd){return function(_0x38eaf4){_0x42b9dd['emit'](_0x2eb8f8,_0x38eaf4);};}function removeListener(_0x7f59e3,_0x53e5c8){return function(){MailQueueEvents[_0xd6bd('0x3')](_0x7f59e3,_0x53e5c8);};}exports[_0xd6bd('0x4')]=function(_0x4f4a05){for(var _0x122321=0x0,_0x2bb565=events['length'];_0x122321<_0x2bb565;_0x122321++){var _0x5e3b1c=events[_0x122321];var _0x204e21=createListener(_0xd6bd('0x5')+_0x5e3b1c,_0x4f4a05);MailQueueEvents['on'](_0x5e3b1c,_0x204e21);}}; \ No newline at end of file +var _0x2781=['./mailQueue.events','save','remove','update','emit','register'];(function(_0x5c01d9,_0x4710eb){var _0x5c20d1=function(_0x95dd45){while(--_0x95dd45){_0x5c01d9['push'](_0x5c01d9['shift']());}};_0x5c20d1(++_0x4710eb);}(_0x2781,0xe4));var _0x1278=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2781[_0x2641f9];return _0x585741;};'use strict';var MailQueueEvents=require(_0x1278('0x0'));var events=[_0x1278('0x1'),_0x1278('0x2'),_0x1278('0x3')];function createListener(_0x230714,_0x3d207d){return function(_0x104be9){_0x3d207d[_0x1278('0x4')](_0x230714,_0x104be9);};}function removeListener(_0x1ef54c,_0x102fd4){return function(){MailQueueEvents['removeListener'](_0x1ef54c,_0x102fd4);};}exports[_0x1278('0x5')]=function(_0x216adf){for(var _0x5646b6=0x0,_0x387240=events['length'];_0x5646b6<_0x387240;_0x5646b6++){var _0x2b3476=events[_0x5646b6];var _0x31afae=createListener('mailQueue:'+_0x2b3476,_0x216adf);MailQueueEvents['on'](_0x2b3476,_0x31afae);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3a973ca..fe9e7f2 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 _0x76ee=['get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x76ee,0xd5));var _0xe76e=function(_0x2eb4a1,_0x1f80ce){_0x2eb4a1=_0x2eb4a1-0x0;var _0x581890=_0x76ee[_0x2eb4a1];return _0x581890;};'use strict';var multer=require('multer');var util=require(_0xe76e('0x0'));var path=require(_0xe76e('0x1'));var timeout=require(_0xe76e('0x2'));var express=require('express');var router=express[_0xe76e('0x3')]();var fs_extra=require(_0xe76e('0x4'));var auth=require(_0xe76e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe76e('0x6'));var controller=require('./mailQueueReport.controller');router[_0xe76e('0x7')]('/',auth[_0xe76e('0x8')](),controller['index']);router[_0xe76e('0x7')](_0xe76e('0x9'),auth[_0xe76e('0x8')](),controller[_0xe76e('0xa')]);router[_0xe76e('0x7')](_0xe76e('0xb'),auth[_0xe76e('0x8')](),controller[_0xe76e('0xc')]);router[_0xe76e('0xd')]('/',auth['isAuthenticated'](),controller[_0xe76e('0xe')]);router[_0xe76e('0xf')]('/:id',auth[_0xe76e('0x8')](),controller[_0xe76e('0x10')]);router[_0xe76e('0x11')](_0xe76e('0xb'),auth[_0xe76e('0x8')](),controller[_0xe76e('0x12')]);module[_0xe76e('0x13')]=router; \ No newline at end of file +var _0x4587=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','/:id','post','update','delete','exports','multer','util'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x4587,0x97));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7458('0x0'));var util=require(_0x7458('0x1'));var path=require(_0x7458('0x2'));var timeout=require(_0x7458('0x3'));var express=require(_0x7458('0x4'));var router=express[_0x7458('0x5')]();var fs_extra=require(_0x7458('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7458('0x7'));var config=require('../../config/environment');var controller=require(_0x7458('0x8'));router[_0x7458('0x9')]('/',auth[_0x7458('0xa')](),controller['index']);router[_0x7458('0x9')](_0x7458('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7458('0x9')](_0x7458('0xc'),auth[_0x7458('0xa')](),controller['show']);router[_0x7458('0xd')]('/',auth[_0x7458('0xa')](),controller['create']);router['put'](_0x7458('0xc'),auth[_0x7458('0xa')](),controller[_0x7458('0xe')]);router[_0x7458('0xf')](_0x7458('0xc'),auth[_0x7458('0xa')](),controller['destroy']);module[_0x7458('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f63a812..7ec4a3c 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 _0xe681=['exports','STRING','DATE','moment','sequelize'];(function(_0x389358,_0x174698){var _0x47f379=function(_0x57a10e){while(--_0x57a10e){_0x389358['push'](_0x389358['shift']());}};_0x47f379(++_0x174698);}(_0xe681,0xf8));var _0x1e68=function(_0x496e7a,_0x5b9656){_0x496e7a=_0x496e7a-0x0;var _0x40f42b=_0xe681[_0x496e7a];return _0x40f42b;};'use strict';var moment=require(_0x1e68('0x0'));var Sequelize=require(_0x1e68('0x1'));module[_0x1e68('0x2')]={'uniqueid':{'type':Sequelize[_0x1e68('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1e68('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1e68('0x4')]},'acceptAt':{'type':Sequelize[_0x1e68('0x4')]},'exitAt':{'type':Sequelize[_0x1e68('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ed1=['moment','exports','STRING','DATE'];(function(_0x5bd4ee,_0x21c287){var _0x5c2e17=function(_0x4306a7){while(--_0x4306a7){_0x5bd4ee['push'](_0x5bd4ee['shift']());}};_0x5c2e17(++_0x21c287);}(_0x1ed1,0x134));var _0x11ed=function(_0x5d2ed0,_0x51e01a){_0x5d2ed0=_0x5d2ed0-0x0;var _0x227400=_0x1ed1[_0x5d2ed0];return _0x227400;};'use strict';var moment=require(_0x11ed('0x0'));var Sequelize=require('sequelize');module[_0x11ed('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x11ed('0x2')]},'joinAt':{'type':Sequelize[_0x11ed('0x3')]},'leaveAt':{'type':Sequelize[_0x11ed('0x3')]},'acceptAt':{'type':Sequelize[_0x11ed('0x3')]},'exitAt':{'type':Sequelize[_0x11ed('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 85d1940..5218526 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 _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0x430c,0x1a1));var _0xc430=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x430c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,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','MailQueueReport','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(_0x32e7b8,_0x5eb994){var _0x173ad6=function(_0x4dfe64){while(--_0x4dfe64){_0x32e7b8['push'](_0x32e7b8['shift']());}};_0x173ad6(++_0x5eb994);}(_0xd943,0x15d));var _0x3d94=function(_0x1654aa,_0x2cdaf3){_0x1654aa=_0x1654aa-0x0;var _0x1fe452=_0xd943[_0x1654aa];return _0x1fe452;};'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['MailQueueReport']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a626e2f..8afc5b1 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 _0x0578=['rimraf','../../config/environment','exports','define','uniqueid','util','../../config/logger','api','moment','request-promise','path'];(function(_0x22cd12,_0x244934){var _0x55cf1d=function(_0x11f3c4){while(--_0x11f3c4){_0x22cd12['push'](_0x22cd12['shift']());}};_0x55cf1d(++_0x244934);}(_0x0578,0x7e));var _0x8057=function(_0x961771,_0x470110){_0x961771=_0x961771-0x0;var _0x293eae=_0x0578[_0x961771];return _0x293eae;};'use strict';var _=require('lodash');var util=require(_0x8057('0x0'));var logger=require(_0x8057('0x1'))(_0x8057('0x2'));var moment=require(_0x8057('0x3'));var BPromise=require('bluebird');var rp=require(_0x8057('0x4'));var fs=require('fs');var path=require(_0x8057('0x5'));var rimraf=require(_0x8057('0x6'));var config=require(_0x8057('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x8057('0x8')]=function(_0x23d462,_0x43801a){return _0x23d462[_0x8057('0x9')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x8057('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x836c=['MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define'];(function(_0x338698,_0x419f39){var _0x461b49=function(_0xcffdab){while(--_0xcffdab){_0x338698['push'](_0x338698['shift']());}};_0x461b49(++_0x419f39);}(_0x836c,0x11f));var _0xc836=function(_0x30f892,_0x385a46){_0x30f892=_0x30f892-0x0;var _0x4a0ca9=_0x836c[_0x30f892];return _0x4a0ca9;};'use strict';var _=require(_0xc836('0x0'));var util=require(_0xc836('0x1'));var logger=require(_0xc836('0x2'))(_0xc836('0x3'));var moment=require(_0xc836('0x4'));var BPromise=require(_0xc836('0x5'));var rp=require(_0xc836('0x6'));var fs=require('fs');var path=require(_0xc836('0x7'));var rimraf=require(_0xc836('0x8'));var config=require(_0xc836('0x9'));var attributes=require(_0xc836('0xa'));module[_0xc836('0xb')]=function(_0x11d816,_0x3727e7){return _0x11d816[_0xc836('0xc')](_0xc836('0xd'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc836('0xe'),'fields':[_0xc836('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index c4c8fd7..ea6df90 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x440106,_0x23b8c7){var _0x27cfa8=function(_0x3a51f2){while(--_0x3a51f2){_0x440106['push'](_0x440106['shift']());}};_0x27cfa8(++_0x23b8c7);}(_0x326f,0xd1));var _0xf326=function(_0xd6b570,_0xc832dd){_0xd6b570=_0xd6b570-0x0;var _0x259f6d=_0x326f[_0xd6b570];return _0x259f6d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2afcfa,_0x456ebd){var _0x1f012d=function(_0xca032e){while(--_0xca032e){_0x2afcfa['push'](_0x2afcfa['shift']());}};_0x1f012d(++_0x456ebd);}(_0xdb28,0x106));var _0x8db2=function(_0x30a053,_0x4a0089){_0x30a053=_0x30a053-0x0;var _0x179ded=_0xdb28[_0x30a053];return _0x179ded;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 7fcbbca..7491361 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x41f025,_0x49373a){var _0x1f240b=function(_0x5b671b){while(--_0x5b671b){_0x41f025['push'](_0x41f025['shift']());}};_0x1f240b(++_0x49373a);}(_0x70e0,0x17b));var _0x070e=function(_0x47a02e,_0x29ed6b){_0x47a02e=_0x47a02e-0x0;var _0x459e45=_0x70e0[_0x47a02e];return _0x459e45;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x43ca02,_0x5f063f){var _0x45c229=function(_0x14cb5a){while(--_0x14cb5a){_0x43ca02['push'](_0x43ca02['shift']());}};_0x45c229(++_0x5f063f);}(_0xedd9,0xfc));var _0x9edd=function(_0x14d0d2,_0x2ad908){_0x14d0d2=_0x14d0d2-0x0;var _0x57b04e=_0xedd9[_0x14d0d2];return _0x57b04e;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c738a0b..e2f28e7 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 _0x3c81=['sequelize','exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x12d41e,_0x160a2a){var _0x26cf39=function(_0x411fe7){while(--_0x411fe7){_0x12d41e['push'](_0x12d41e['shift']());}};_0x26cf39(++_0x160a2a);}(_0x3c81,0x102));var _0x13c8=function(_0x33c851,_0xe9a9af){_0x33c851=_0x33c851-0x0;var _0x63e186=_0x3c81[_0x33c851];return _0x63e186;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x13c8('0x2')]},'authentication':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x4')},'connTimeout':{'type':Sequelize[_0x13c8('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x13c8('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x13c8('0x2')]}}; \ No newline at end of file +var _0xb7e7=['INBOX','sequelize','STRING','BOOLEAN'];(function(_0xdf8df8,_0x4bca6b){var _0x33d2f8=function(_0x188edb){while(--_0x188edb){_0xdf8df8['push'](_0xdf8df8['shift']());}};_0x33d2f8(++_0x4bca6b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7b7e('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 9895b1d..2f7e04d 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 _0xe965=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x50dc37,_0x330ce8){var _0x177905=function(_0x41d1bd){while(--_0x41d1bd){_0x50dc37['push'](_0x50dc37['shift']());}};_0x177905(++_0x330ce8);}(_0xe965,0xb0));var _0x5e96=function(_0x4fd057,_0x37e395){_0x4fd057=_0x4fd057-0x0;var _0x1cfd8e=_0xe965[_0x4fd057];return _0x1cfd8e;};'use strict';var _=require(_0x5e96('0x0'));var util=require('util');var logger=require(_0x5e96('0x1'))(_0x5e96('0x2'));var moment=require('moment');var BPromise=require(_0x5e96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e96('0x4'));var rimraf=require(_0x5e96('0x5'));var config=require(_0x5e96('0x6'));var attributes=require(_0x5e96('0x7'));module[_0x5e96('0x8')]=function(_0x3e76d1,_0x1fdf67){return _0x3e76d1['define'](_0x5e96('0x9'),attributes,{'tableName':_0x5e96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d45=['exports','define','mail_servers_in','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes'];(function(_0x51bb0f,_0x1111e){var _0x2aa156=function(_0x4615bb){while(--_0x4615bb){_0x51bb0f['push'](_0x51bb0f['shift']());}};_0x2aa156(++_0x1111e);}(_0x7d45,0x1c6));var _0x57d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7d45[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x57d4('0x0'));var logger=require(_0x57d4('0x1'))(_0x57d4('0x2'));var moment=require(_0x57d4('0x3'));var BPromise=require(_0x57d4('0x4'));var rp=require(_0x57d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57d4('0x6'));var config=require('../../config/environment');var attributes=require(_0x57d4('0x7'));module[_0x57d4('0x8')]=function(_0x1548f2,_0x35e457){return _0x1548f2[_0x57d4('0x9')]('MailServerIn',attributes,{'tableName':_0x57d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 0f9a896..f79f9d7 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 _0x8e0d=['then','MailServerIn,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','GetMailServerIn','MailServerIn','options','attributes','limit','include','map','model','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0xb86cf4,_0x3e979b){var _0x11bd3e=function(_0x28aac3){while(--_0x28aac3){_0xb86cf4['push'](_0xb86cf4['shift']());}};_0x11bd3e(++_0x3e979b);}(_0x8e0d,0x82));var _0xd8e0=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x8e0d[_0x2f4c1c];return _0x25e0f2;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8e0('0x1'));var rs=require(_0xd8e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))(_0xd8e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8e0('0x7')][_0xd8e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d42b,_0x1e4616,_0x5e9735){return new BPromise(function(_0xd0c45c,_0x144a8a){return client[_0xd8e0('0x9')](_0x42d42b,_0x5e9735)[_0xd8e0('0xa')](function(_0x127a32){logger['info'](_0xd8e0('0xb'),_0x1e4616,'request\x20sent');logger[_0xd8e0('0xc')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1e4616,'request\x20sent',JSON[_0xd8e0('0xd')](_0x127a32));if(_0x127a32[_0xd8e0('0xe')]){if(_0x127a32[_0xd8e0('0xe')]['code']===0x1f4){logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0x144a8a(_0x127a32['error']['message']);}logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0xd0c45c(_0x127a32[_0xd8e0('0xe')][_0xd8e0('0xf')]);}else{logger[_0xd8e0('0x10')](_0xd8e0('0xb'),_0x1e4616,_0xd8e0('0x11'));_0xd0c45c(_0x127a32[_0xd8e0('0x12')][_0xd8e0('0xf')]);}})[_0xd8e0('0x13')](function(_0x488ed9){logger[_0xd8e0('0xe')](_0xd8e0('0xb'),_0x1e4616,_0x488ed9);_0x144a8a(_0x488ed9);});});}exports[_0xd8e0('0x14')]=function(_0x42586f){var _0x3b28bc=this;return new Promise(function(_0x2bf195,_0x2c4eaf){return db[_0xd8e0('0x15')]['findAll']({'raw':_0x42586f[_0xd8e0('0x16')]?_0x42586f[_0xd8e0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x42586f[_0xd8e0('0x16')]?_0x42586f['options']['where']||null:null,'attributes':_0x42586f['options']?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x17')]||null:null,'limit':_0x42586f['options']?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x18')]||null:null,'include':_0x42586f[_0xd8e0('0x16')]?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x19')]?_[_0xd8e0('0x1a')](_0x42586f['options'][_0xd8e0('0x19')],function(_0x340ae1){return{'model':db[_0x340ae1['model']],'as':_0x340ae1['as'],'attributes':_0x340ae1['attributes'],'include':_0x340ae1['include']?_[_0xd8e0('0x1a')](_0x340ae1[_0xd8e0('0x19')],function(_0x2c1257){return{'model':db[_0x2c1257[_0xd8e0('0x1b')]],'as':_0x2c1257['as'],'attributes':_0x2c1257[_0xd8e0('0x17')],'include':_0x2c1257['include']?_['map'](_0x2c1257[_0xd8e0('0x19')],function(_0x469b52){return{'model':db[_0x469b52[_0xd8e0('0x1b')]],'as':_0x469b52['as'],'attributes':_0x469b52[_0xd8e0('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15bd32){logger[_0xd8e0('0x10')](_0xd8e0('0x14'),_0x42586f);logger[_0xd8e0('0xc')]('GetMailServerIn',_0x42586f,JSON[_0xd8e0('0xd')](_0x15bd32));_0x2bf195(_0x15bd32);})[_0xd8e0('0x13')](function(_0x1a9364){logger[_0xd8e0('0xe')](_0xd8e0('0x14'),_0x1a9364[_0xd8e0('0xf')],_0x42586f);_0x2c4eaf(_0x3b28bc[_0xd8e0('0xe')](0x1f4,_0x1a9364['message']));});});}; \ No newline at end of file +var _0x6822=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','then','debug','stringify'];(function(_0xb02c4d,_0x241f70){var _0x2b0601=function(_0x19598f){while(--_0x19598f){_0xb02c4d['push'](_0xb02c4d['shift']());}};_0x2b0601(++_0x241f70);}(_0x6822,0x18c));var _0x2682=function(_0x4ed226,_0x637916){_0x4ed226=_0x4ed226-0x0;var _0x13c55c=_0x6822[_0x4ed226];return _0x13c55c;};'use strict';var _=require('lodash');var util=require(_0x2682('0x0'));var moment=require(_0x2682('0x1'));var BPromise=require(_0x2682('0x2'));var rs=require(_0x2682('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2682('0x4'))['db'];var utils=require(_0x2682('0x5'));var logger=require(_0x2682('0x6'))(_0x2682('0x7'));var config=require(_0x2682('0x8'));var jayson=require(_0x2682('0x9'));var client=jayson[_0x2682('0xa')][_0x2682('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f55b,_0x3f706c,_0x4242c5){return new BPromise(function(_0x1a1307,_0x303fe4){return client[_0x2682('0xc')](_0x35f55b,_0x4242c5)['then'](function(_0x3e72bc){logger[_0x2682('0xd')]('MailServerIn,\x20%s,\x20%s',_0x3f706c,'request\x20sent');logger['debug'](_0x2682('0xe'),_0x3f706c,_0x2682('0xf'),JSON['stringify'](_0x3e72bc));if(_0x3e72bc[_0x2682('0x10')]){if(_0x3e72bc[_0x2682('0x10')]['code']===0x1f4){logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x303fe4(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x1a1307(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}else{logger[_0x2682('0xd')](_0x2682('0x11'),_0x3f706c,_0x2682('0xf'));_0x1a1307(_0x3e72bc['result']['message']);}})[_0x2682('0x13')](function(_0x2b1ed2){logger[_0x2682('0x10')]('MailServerIn,\x20%s,\x20%s',_0x3f706c,_0x2b1ed2);_0x303fe4(_0x2b1ed2);});});}exports[_0x2682('0x14')]=function(_0x494946){var _0x498424=this;return new Promise(function(_0x19391e,_0x3d2b43){return db[_0x2682('0x15')][_0x2682('0x16')]({'raw':_0x494946[_0x2682('0x17')]?_0x494946['options'][_0x2682('0x18')]===undefined?!![]:![]:!![],'where':_0x494946['options']?_0x494946[_0x2682('0x17')][_0x2682('0x19')]||null:null,'attributes':_0x494946[_0x2682('0x17')]?_0x494946[_0x2682('0x17')][_0x2682('0x1a')]||null:null,'limit':_0x494946[_0x2682('0x17')]?_0x494946[_0x2682('0x17')]['limit']||null:null,'include':_0x494946['options']?_0x494946['options'][_0x2682('0x1b')]?_[_0x2682('0x1c')](_0x494946['options'][_0x2682('0x1b')],function(_0x35aa4c){return{'model':db[_0x35aa4c[_0x2682('0x1d')]],'as':_0x35aa4c['as'],'attributes':_0x35aa4c[_0x2682('0x1a')],'include':_0x35aa4c['include']?_[_0x2682('0x1c')](_0x35aa4c[_0x2682('0x1b')],function(_0x361791){return{'model':db[_0x361791[_0x2682('0x1d')]],'as':_0x361791['as'],'attributes':_0x361791[_0x2682('0x1a')],'include':_0x361791[_0x2682('0x1b')]?_['map'](_0x361791['include'],function(_0x48eee6){return{'model':db[_0x48eee6['model']],'as':_0x48eee6['as'],'attributes':_0x48eee6[_0x2682('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2682('0x1e')](function(_0x3eff92){logger[_0x2682('0xd')](_0x2682('0x14'),_0x494946);logger[_0x2682('0x1f')](_0x2682('0x14'),_0x494946,JSON[_0x2682('0x20')](_0x3eff92));_0x19391e(_0x3eff92);})['catch'](function(_0x9384b5){logger[_0x2682('0x10')]('GetMailServerIn',_0x9384b5[_0x2682('0x12')],_0x494946);_0x3d2b43(_0x498424[_0x2682('0x10')](0x1f4,_0x9384b5[_0x2682('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d864507..43d4063 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0xfc4c3b,_0x4ded6f){_0xfc4c3b=_0xfc4c3b-0x0;var _0x2ed961=_0x7a54[_0xfc4c3b];return _0x2ed961;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index dc8b9d9..6bf6686 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 _0xb221=['exports','STRING','BOOLEAN','sequelize'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xb221,0x193));var _0x1b22=function(_0x23f98f,_0xcf4c1c){_0x23f98f=_0x23f98f-0x0;var _0x3b4758=_0xb221[_0x23f98f];return _0x3b4758;};'use strict';var Sequelize=require(_0x1b22('0x0'));module[_0x1b22('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1b22('0x2')]},'user':{'type':Sequelize[_0x1b22('0x2')]},'pass':{'type':Sequelize[_0x1b22('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x1b22('0x2')]},'authentication':{'type':Sequelize[_0x1b22('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x32b4=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x2bfe4d,_0x362ebc){var _0x25083b=function(_0xcf4273){while(--_0xcf4273){_0x2bfe4d['push'](_0x2bfe4d['shift']());}};_0x25083b(++_0x362ebc);}(_0x32b4,0x73));var _0x432b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x32b4[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x432b('0x0')]={'description':{'type':Sequelize[_0x432b('0x1')]},'host':{'type':Sequelize[_0x432b('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x432b('0x2')]},'secure':{'type':Sequelize[_0x432b('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x432b('0x1')]},'authentication':{'type':Sequelize[_0x432b('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 f91d8cf..493478a 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 _0xa937=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','send','index','map','MailServerOut','rawAttributes','fieldName','key','name','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','keys','include','find','create','body','catch','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x4402f2,_0x5ac4c9){var _0x1ea359=function(_0x48c3a2){while(--_0x48c3a2){_0x4402f2['push'](_0x4402f2['shift']());}};_0x1ea359(++_0x5ac4c9);}(_0xa937,0x1ef));var _0x7a93=function(_0x1a09fa,_0x4534c8){_0x1a09fa=_0x1a09fa-0x0;var _0x45c8df=_0xa937[_0x1a09fa];return _0x45c8df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a93('0x0'));var rp=require(_0x7a93('0x1'));var moment=require(_0x7a93('0x2'));var BPromise=require(_0x7a93('0x3'));var Mustache=require(_0x7a93('0x4'));var util=require(_0x7a93('0x5'));var path=require('path');var sox=require(_0x7a93('0x6'));var csv=require(_0x7a93('0x7'));var ejs=require(_0x7a93('0x8'));var fs=require('fs');var fs_extra=require(_0x7a93('0x9'));var _=require(_0x7a93('0xa'));var squel=require('squel');var crypto=require(_0x7a93('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a93('0x7'));var querystring=require(_0x7a93('0xc'));var Papa=require(_0x7a93('0xd'));var Redis=require('ioredis');var authService=require(_0x7a93('0xe'));var qs=require(_0x7a93('0xf'));var as=require(_0x7a93('0x10'));var hardwareService=require(_0x7a93('0x11'));var logger=require('../../config/logger')(_0x7a93('0x12'));var utils=require(_0x7a93('0x13'));var config=require(_0x7a93('0x14'));var licenseUtil=require(_0x7a93('0x15'));var db=require(_0x7a93('0x16'))['db'];function respondWithStatusCode(_0xfcaa27,_0x19af02){_0x19af02=_0x19af02||0xcc;return function(_0x38cd54){if(_0x38cd54){return _0xfcaa27[_0x7a93('0x17')](_0x19af02);}return _0xfcaa27['status'](_0x19af02)['end']();};}function respondWithResult(_0x4bb893,_0x5e636c){_0x5e636c=_0x5e636c||0xc8;return function(_0xc4e302){if(_0xc4e302){return _0x4bb893[_0x7a93('0x18')](_0x5e636c)[_0x7a93('0x19')](_0xc4e302);}};}function respondWithFilteredResult(_0x3da6fb,_0x64d7d){return function(_0x1e38a0){if(_0x1e38a0){var _0x493446=typeof _0x64d7d[_0x7a93('0x1a')]==='undefined'&&typeof _0x64d7d['limit']===_0x7a93('0x1b');var _0x51a7b0=_0x1e38a0[_0x7a93('0x1c')];var _0x503c08=_0x493446?0x0:_0x64d7d[_0x7a93('0x1a')];var _0x45a74f=_0x493446?_0x1e38a0[_0x7a93('0x1c')]:_0x64d7d[_0x7a93('0x1a')]+_0x64d7d[_0x7a93('0x1d')];var _0x5dae4f;if(_0x45a74f>=_0x51a7b0){_0x45a74f=_0x51a7b0;_0x5dae4f=0xc8;}else{_0x5dae4f=0xce;}_0x3da6fb[_0x7a93('0x18')](_0x5dae4f);return _0x3da6fb[_0x7a93('0x1e')](_0x7a93('0x1f'),_0x503c08+'-'+_0x45a74f+'/'+_0x51a7b0)['json'](_0x1e38a0);}return null;};}function patchUpdates(_0x13abef){return function(_0x4e155f){try{jsonpatch['apply'](_0x4e155f,_0x13abef,!![]);}catch(_0x42d4e5){return BPromise[_0x7a93('0x20')](_0x42d4e5);}return _0x4e155f[_0x7a93('0x21')]();};}function saveUpdates(_0x452467,_0x318645){return function(_0x1fe30c){if(_0x1fe30c){return _0x1fe30c[_0x7a93('0x22')](_0x452467)['then'](function(_0x1dd8c8){return _0x1dd8c8;});}return null;};}function removeEntity(_0x5c0167,_0xc24765){return function(_0x879a30){if(_0x879a30){return _0x879a30[_0x7a93('0x23')]()[_0x7a93('0x24')](function(){_0x5c0167['status'](0xcc)[_0x7a93('0x25')]();});}};}function handleEntityNotFound(_0x5ee493,_0x451020){return function(_0x302343){if(!_0x302343){_0x5ee493[_0x7a93('0x17')](0x194);}return _0x302343;};}function handleError(_0x3a7ea0,_0x46f1b0){_0x46f1b0=_0x46f1b0||0x1f4;return function(_0x330439){logger['error'](_0x330439['stack']);if(_0x330439['name']){delete _0x330439['name'];}_0x3a7ea0['status'](_0x46f1b0)[_0x7a93('0x26')](_0x330439);};}exports[_0x7a93('0x27')]=function(_0xef9b07,_0x123c00){var _0x473b61={},_0x58c6b4={},_0x43c86b={'count':0x0,'rows':[]};var _0x2ea168=_[_0x7a93('0x28')](db[_0x7a93('0x29')][_0x7a93('0x2a')],function(_0x934d20){return{'name':_0x934d20[_0x7a93('0x2b')],'type':_0x934d20['type'][_0x7a93('0x2c')]};});_0x58c6b4['model']=_['map'](_0x2ea168,_0x7a93('0x2d'));_0x58c6b4[_0x7a93('0x2e')]=_['keys'](_0xef9b07[_0x7a93('0x2e')]);_0x58c6b4['filters']=_['intersection'](_0x58c6b4[_0x7a93('0x2f')],_0x58c6b4[_0x7a93('0x2e')]);_0x473b61['attributes']=_['intersection'](_0x58c6b4['model'],qs[_0x7a93('0x30')](_0xef9b07['query'][_0x7a93('0x30')]));_0x473b61['attributes']=_0x473b61[_0x7a93('0x31')][_0x7a93('0x32')]?_0x473b61[_0x7a93('0x31')]:_0x58c6b4[_0x7a93('0x2f')];if(!_0xef9b07['query'][_0x7a93('0x33')](_0x7a93('0x34'))){_0x473b61['limit']=qs[_0x7a93('0x1d')](_0xef9b07[_0x7a93('0x2e')][_0x7a93('0x1d')]);_0x473b61['offset']=qs[_0x7a93('0x1a')](_0xef9b07[_0x7a93('0x2e')]['offset']);}_0x473b61[_0x7a93('0x35')]=qs['sort'](_0xef9b07[_0x7a93('0x2e')][_0x7a93('0x36')]);_0x473b61[_0x7a93('0x37')]=qs[_0x7a93('0x38')](_[_0x7a93('0x39')](_0xef9b07[_0x7a93('0x2e')],_0x58c6b4[_0x7a93('0x38')]),_0x2ea168);if(_0xef9b07[_0x7a93('0x2e')][_0x7a93('0x3a')]){_0x473b61['where']=_[_0x7a93('0x3b')](_0x473b61[_0x7a93('0x37')],{'$or':_[_0x7a93('0x28')](_0x2ea168,function(_0x149b22){if(_0x149b22[_0x7a93('0x3c')]!==_0x7a93('0x3d')){var _0x269301={};_0x269301[_0x149b22[_0x7a93('0x2d')]]={'$like':'%'+_0xef9b07[_0x7a93('0x2e')]['filter']+'%'};return _0x269301;}})});}_0x473b61=_[_0x7a93('0x3b')]({},_0x473b61,_0xef9b07[_0x7a93('0x3e')]);var _0x1973c1={'where':_0x473b61[_0x7a93('0x37')]};return db['MailServerOut'][_0x7a93('0x1c')](_0x1973c1)[_0x7a93('0x24')](function(_0x269246){_0x43c86b[_0x7a93('0x1c')]=_0x269246;if(_0xef9b07[_0x7a93('0x2e')][_0x7a93('0x3f')]){_0x473b61['include']=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x473b61);})['then'](function(_0x7b614c){_0x43c86b[_0x7a93('0x40')]=_0x7b614c;return _0x43c86b;})['then'](respondWithFilteredResult(_0x123c00,_0x473b61))['catch'](handleError(_0x123c00,null));};exports[_0x7a93('0x41')]=function(_0x4a1f7f,_0x19667f){var _0x4efe79={'raw':!![],'where':{'id':_0x4a1f7f['params']['id']}},_0x1c98b3={};_0x1c98b3[_0x7a93('0x2f')]=_[_0x7a93('0x42')](db[_0x7a93('0x29')][_0x7a93('0x2a')]);_0x1c98b3[_0x7a93('0x2e')]=_[_0x7a93('0x42')](_0x4a1f7f[_0x7a93('0x2e')]);_0x1c98b3['filters']=_['intersection'](_0x1c98b3[_0x7a93('0x2f')],_0x1c98b3[_0x7a93('0x2e')]);_0x4efe79[_0x7a93('0x31')]=_['intersection'](_0x1c98b3[_0x7a93('0x2f')],qs['fields'](_0x4a1f7f['query']['fields']));_0x4efe79[_0x7a93('0x31')]=_0x4efe79[_0x7a93('0x31')][_0x7a93('0x32')]?_0x4efe79['attributes']:_0x1c98b3[_0x7a93('0x2f')];if(_0x4a1f7f[_0x7a93('0x2e')][_0x7a93('0x3f')]){_0x4efe79[_0x7a93('0x43')]=[{'all':!![]}];}_0x4efe79=_['merge']({},_0x4efe79,_0x4a1f7f[_0x7a93('0x3e')]);return db[_0x7a93('0x29')][_0x7a93('0x44')](_0x4efe79)[_0x7a93('0x24')](handleEntityNotFound(_0x19667f,null))['then'](respondWithResult(_0x19667f,null))['catch'](handleError(_0x19667f,null));};exports[_0x7a93('0x45')]=function(_0x134885,_0x57509d){return db[_0x7a93('0x29')][_0x7a93('0x45')](_0x134885[_0x7a93('0x46')],{})[_0x7a93('0x24')](respondWithResult(_0x57509d,0xc9))[_0x7a93('0x47')](handleError(_0x57509d,null));};exports['update']=function(_0x5eec4e,_0x3efc72){if(_0x5eec4e[_0x7a93('0x46')]['id']){delete _0x5eec4e[_0x7a93('0x46')]['id'];}return db[_0x7a93('0x29')][_0x7a93('0x44')]({'where':{'id':_0x5eec4e[_0x7a93('0x48')]['id']}})[_0x7a93('0x24')](handleEntityNotFound(_0x3efc72,null))[_0x7a93('0x24')](saveUpdates(_0x5eec4e[_0x7a93('0x46')],null))[_0x7a93('0x24')](respondWithResult(_0x3efc72,null))[_0x7a93('0x47')](handleError(_0x3efc72,null));};exports[_0x7a93('0x23')]=function(_0x2dd0e4,_0x15dfe6){return db[_0x7a93('0x29')][_0x7a93('0x44')]({'where':{'id':_0x2dd0e4['params']['id']}})[_0x7a93('0x24')](handleEntityNotFound(_0x15dfe6,null))[_0x7a93('0x24')](removeEntity(_0x15dfe6,null))[_0x7a93('0x47')](handleError(_0x15dfe6,null));}; \ No newline at end of file +var _0x97a3=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','then','error','stack','name','send','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','find','catch','create','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2b0373,_0x489311){var _0x2bf9d0=function(_0x2b6dbd){while(--_0x2b6dbd){_0x2b0373['push'](_0x2b0373['shift']());}};_0x2bf9d0(++_0x489311);}(_0x97a3,0x123));var _0x397a=function(_0x35ccf0,_0x5c3820){_0x35ccf0=_0x35ccf0-0x0;var _0x1bfc68=_0x97a3[_0x35ccf0];return _0x1bfc68;};'use strict';var emlformat=require(_0x397a('0x0'));var rimraf=require(_0x397a('0x1'));var zipdir=require(_0x397a('0x2'));var jsonpatch=require(_0x397a('0x3'));var rp=require('request-promise');var moment=require(_0x397a('0x4'));var BPromise=require(_0x397a('0x5'));var Mustache=require(_0x397a('0x6'));var util=require(_0x397a('0x7'));var path=require(_0x397a('0x8'));var sox=require(_0x397a('0x9'));var csv=require(_0x397a('0xa'));var ejs=require(_0x397a('0xb'));var fs=require('fs');var fs_extra=require(_0x397a('0xc'));var _=require('lodash');var squel=require(_0x397a('0xd'));var crypto=require(_0x397a('0xe'));var jsforce=require(_0x397a('0xf'));var deskjs=require(_0x397a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x397a('0x11'));var Redis=require(_0x397a('0x12'));var authService=require(_0x397a('0x13'));var qs=require(_0x397a('0x14'));var as=require(_0x397a('0x15'));var hardwareService=require(_0x397a('0x16'));var logger=require('../../config/logger')(_0x397a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x397a('0x18'))['db'];function respondWithStatusCode(_0x3c4a18,_0x4abe4a){_0x4abe4a=_0x4abe4a||0xcc;return function(_0x20ae91){if(_0x20ae91){return _0x3c4a18[_0x397a('0x19')](_0x4abe4a);}return _0x3c4a18[_0x397a('0x1a')](_0x4abe4a)[_0x397a('0x1b')]();};}function respondWithResult(_0x291562,_0x3c6379){_0x3c6379=_0x3c6379||0xc8;return function(_0x539468){if(_0x539468){return _0x291562[_0x397a('0x1a')](_0x3c6379)[_0x397a('0x1c')](_0x539468);}};}function respondWithFilteredResult(_0x4e0756,_0x1cf5df){return function(_0x1b4845){if(_0x1b4845){var _0x3b3087=typeof _0x1cf5df['offset']===_0x397a('0x1d')&&typeof _0x1cf5df['limit']==='undefined';var _0x52f763=_0x1b4845['count'];var _0x8a1f35=_0x3b3087?0x0:_0x1cf5df[_0x397a('0x1e')];var _0x55a413=_0x3b3087?_0x1b4845[_0x397a('0x1f')]:_0x1cf5df['offset']+_0x1cf5df[_0x397a('0x20')];var _0x12a5f0;if(_0x55a413>=_0x52f763){_0x55a413=_0x52f763;_0x12a5f0=0xc8;}else{_0x12a5f0=0xce;}_0x4e0756[_0x397a('0x1a')](_0x12a5f0);return _0x4e0756[_0x397a('0x21')](_0x397a('0x22'),_0x8a1f35+'-'+_0x55a413+'/'+_0x52f763)[_0x397a('0x1c')](_0x1b4845);}return null;};}function patchUpdates(_0x3619e3){return function(_0x36c717){try{jsonpatch[_0x397a('0x23')](_0x36c717,_0x3619e3,!![]);}catch(_0x37d20b){return BPromise['reject'](_0x37d20b);}return _0x36c717[_0x397a('0x24')]();};}function saveUpdates(_0x864756,_0x1a1dc9){return function(_0x3a87ce){if(_0x3a87ce){return _0x3a87ce['update'](_0x864756)[_0x397a('0x25')](function(_0xa659d3){return _0xa659d3;});}return null;};}function removeEntity(_0x4b1ae6,_0x17ba2d){return function(_0x256da1){if(_0x256da1){return _0x256da1['destroy']()[_0x397a('0x25')](function(){_0x4b1ae6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a92a2,_0xc1547a){return function(_0x41449d){if(!_0x41449d){_0x3a92a2[_0x397a('0x19')](0x194);}return _0x41449d;};}function handleError(_0x1b9bdc,_0x44ea86){_0x44ea86=_0x44ea86||0x1f4;return function(_0x2a15fa){logger[_0x397a('0x26')](_0x2a15fa[_0x397a('0x27')]);if(_0x2a15fa['name']){delete _0x2a15fa[_0x397a('0x28')];}_0x1b9bdc[_0x397a('0x1a')](_0x44ea86)[_0x397a('0x29')](_0x2a15fa);};}exports['index']=function(_0x139756,_0x1ce567){var _0x871b29={},_0x4bf7e2={},_0x689aac={'count':0x0,'rows':[]};var _0x1c800d=_['map'](db[_0x397a('0x2a')][_0x397a('0x2b')],function(_0x2ba534){return{'name':_0x2ba534[_0x397a('0x2c')],'type':_0x2ba534[_0x397a('0x2d')][_0x397a('0x2e')]};});_0x4bf7e2[_0x397a('0x2f')]=_[_0x397a('0x30')](_0x1c800d,'name');_0x4bf7e2[_0x397a('0x31')]=_[_0x397a('0x32')](_0x139756[_0x397a('0x31')]);_0x4bf7e2[_0x397a('0x33')]=_[_0x397a('0x34')](_0x4bf7e2[_0x397a('0x2f')],_0x4bf7e2['query']);_0x871b29[_0x397a('0x35')]=_[_0x397a('0x34')](_0x4bf7e2[_0x397a('0x2f')],qs[_0x397a('0x36')](_0x139756[_0x397a('0x31')][_0x397a('0x36')]));_0x871b29['attributes']=_0x871b29[_0x397a('0x35')][_0x397a('0x37')]?_0x871b29[_0x397a('0x35')]:_0x4bf7e2[_0x397a('0x2f')];if(!_0x139756[_0x397a('0x31')][_0x397a('0x38')](_0x397a('0x39'))){_0x871b29[_0x397a('0x20')]=qs[_0x397a('0x20')](_0x139756['query'][_0x397a('0x20')]);_0x871b29[_0x397a('0x1e')]=qs[_0x397a('0x1e')](_0x139756['query'][_0x397a('0x1e')]);}_0x871b29['order']=qs[_0x397a('0x3a')](_0x139756['query'][_0x397a('0x3a')]);_0x871b29[_0x397a('0x3b')]=qs[_0x397a('0x33')](_[_0x397a('0x3c')](_0x139756[_0x397a('0x31')],_0x4bf7e2[_0x397a('0x33')]),_0x1c800d);if(_0x139756[_0x397a('0x31')]['filter']){_0x871b29['where']=_[_0x397a('0x3d')](_0x871b29['where'],{'$or':_[_0x397a('0x30')](_0x1c800d,function(_0x4884d0){if(_0x4884d0[_0x397a('0x2d')]!==_0x397a('0x3e')){var _0xef104b={};_0xef104b[_0x4884d0[_0x397a('0x28')]]={'$like':'%'+_0x139756[_0x397a('0x31')][_0x397a('0x3f')]+'%'};return _0xef104b;}})});}_0x871b29=_[_0x397a('0x3d')]({},_0x871b29,_0x139756[_0x397a('0x40')]);var _0x364120={'where':_0x871b29[_0x397a('0x3b')]};return db[_0x397a('0x2a')]['count'](_0x364120)[_0x397a('0x25')](function(_0x5351db){_0x689aac[_0x397a('0x1f')]=_0x5351db;if(_0x139756[_0x397a('0x31')]['includeAll']){_0x871b29[_0x397a('0x41')]=[{'all':!![]}];}return db[_0x397a('0x2a')][_0x397a('0x42')](_0x871b29);})[_0x397a('0x25')](function(_0x41e729){_0x689aac[_0x397a('0x43')]=_0x41e729;return _0x689aac;})[_0x397a('0x25')](respondWithFilteredResult(_0x1ce567,_0x871b29))['catch'](handleError(_0x1ce567,null));};exports[_0x397a('0x44')]=function(_0x4f710,_0x3e68a8){var _0x14408b={'raw':!![],'where':{'id':_0x4f710['params']['id']}},_0xe78616={};_0xe78616[_0x397a('0x2f')]=_[_0x397a('0x32')](db['MailServerOut'][_0x397a('0x2b')]);_0xe78616[_0x397a('0x31')]=_[_0x397a('0x32')](_0x4f710[_0x397a('0x31')]);_0xe78616['filters']=_[_0x397a('0x34')](_0xe78616[_0x397a('0x2f')],_0xe78616[_0x397a('0x31')]);_0x14408b['attributes']=_[_0x397a('0x34')](_0xe78616[_0x397a('0x2f')],qs[_0x397a('0x36')](_0x4f710['query'][_0x397a('0x36')]));_0x14408b[_0x397a('0x35')]=_0x14408b[_0x397a('0x35')][_0x397a('0x37')]?_0x14408b[_0x397a('0x35')]:_0xe78616[_0x397a('0x2f')];if(_0x4f710[_0x397a('0x31')]['includeAll']){_0x14408b[_0x397a('0x41')]=[{'all':!![]}];}_0x14408b=_['merge']({},_0x14408b,_0x4f710[_0x397a('0x40')]);return db[_0x397a('0x2a')][_0x397a('0x45')](_0x14408b)['then'](handleEntityNotFound(_0x3e68a8,null))[_0x397a('0x25')](respondWithResult(_0x3e68a8,null))[_0x397a('0x46')](handleError(_0x3e68a8,null));};exports[_0x397a('0x47')]=function(_0x8a4d19,_0x33608b){return db[_0x397a('0x2a')][_0x397a('0x47')](_0x8a4d19['body'],{})[_0x397a('0x25')](respondWithResult(_0x33608b,0xc9))['catch'](handleError(_0x33608b,null));};exports[_0x397a('0x48')]=function(_0x396e11,_0x40faf9){if(_0x396e11[_0x397a('0x49')]['id']){delete _0x396e11[_0x397a('0x49')]['id'];}return db[_0x397a('0x2a')][_0x397a('0x45')]({'where':{'id':_0x396e11[_0x397a('0x4a')]['id']}})[_0x397a('0x25')](handleEntityNotFound(_0x40faf9,null))['then'](saveUpdates(_0x396e11[_0x397a('0x49')],null))[_0x397a('0x25')](respondWithResult(_0x40faf9,null))['catch'](handleError(_0x40faf9,null));};exports[_0x397a('0x4b')]=function(_0x2cb11f,_0x3346ba){return db[_0x397a('0x2a')][_0x397a('0x45')]({'where':{'id':_0x2cb11f[_0x397a('0x4a')]['id']}})[_0x397a('0x25')](handleEntityNotFound(_0x3346ba,null))[_0x397a('0x25')](removeEntity(_0x3346ba,null))[_0x397a('0x46')](handleError(_0x3346ba,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 359abd3..1c4dbb4 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 _0x1e65=['exports','define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x4c4cbf,_0x1e6e6){var _0xa65774=function(_0x7827f4){while(--_0x7827f4){_0x4c4cbf['push'](_0x4c4cbf['shift']());}};_0xa65774(++_0x1e6e6);}(_0x1e65,0xd5));var _0x51e6=function(_0x543ea3,_0x30e149){_0x543ea3=_0x543ea3-0x0;var _0x10f95c=_0x1e65[_0x543ea3];return _0x10f95c;};'use strict';var _=require(_0x51e6('0x0'));var util=require(_0x51e6('0x1'));var logger=require(_0x51e6('0x2'))(_0x51e6('0x3'));var moment=require(_0x51e6('0x4'));var BPromise=require(_0x51e6('0x5'));var rp=require(_0x51e6('0x6'));var fs=require('fs');var path=require(_0x51e6('0x7'));var rimraf=require(_0x51e6('0x8'));var config=require(_0x51e6('0x9'));var attributes=require(_0x51e6('0xa'));module[_0x51e6('0xb')]=function(_0x480985,_0x5a4019){return _0x480985[_0x51e6('0xc')](_0x51e6('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd436=['bluebird','path','rimraf','exports','define','MailServerOut','mail_servers_out','lodash','util'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0xd436,0x19c));var _0x6d43=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xd436[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x6d43('0x0'));var util=require(_0x6d43('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6d43('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d43('0x3'));var rimraf=require(_0x6d43('0x4'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0x6d43('0x5')]=function(_0x114e22,_0x2ccb90){return _0x114e22[_0x6d43('0x6')](_0x6d43('0x7'),attributes,{'tableName':_0x6d43('0x8'),'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 e1ab957..605e401 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x14ede9,_0x3bc38a){var _0x19958e=function(_0x44d56e){while(--_0x44d56e){_0x14ede9['push'](_0x14ede9['shift']());}};_0x19958e(++_0x3bc38a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _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(_0x1f6d42,_0x2459ef){var _0x4ed76c=function(_0x437774){while(--_0x437774){_0x1f6d42['push'](_0x1f6d42['shift']());}};_0x4ed76c(++_0x2459ef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x513428,_0x588a40){_0x513428=_0x513428-0x0;var _0x1f37fd=_0x5f2f[_0x513428];return _0x1f37fd;};'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 97e580c..2559503 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 _0x633e=['post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4373a6,_0x113a81){var _0x464e85=function(_0x54e272){while(--_0x54e272){_0x4373a6['push'](_0x4373a6['shift']());}};_0x464e85(++_0x113a81);}(_0x633e,0x68));var _0xe633=function(_0x50dbea,_0xc42864){_0x50dbea=_0x50dbea-0x0;var _0x1c4429=_0x633e[_0x50dbea];return _0x1c4429;};'use strict';var multer=require(_0xe633('0x0'));var util=require(_0xe633('0x1'));var path=require(_0xe633('0x2'));var timeout=require(_0xe633('0x3'));var express=require(_0xe633('0x4'));var router=express[_0xe633('0x5')]();var fs_extra=require(_0xe633('0x6'));var auth=require(_0xe633('0x7'));var interaction=require(_0xe633('0x8'));var config=require(_0xe633('0x9'));var controller=require(_0xe633('0xa'));router[_0xe633('0xb')]('/',auth[_0xe633('0xc')](),controller[_0xe633('0xd')]);router[_0xe633('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe633('0xb')](_0xe633('0xe'),auth[_0xe633('0xc')](),controller[_0xe633('0xf')]);router[_0xe633('0x10')]('/',auth[_0xe633('0xc')](),controller['create']);router[_0xe633('0x11')](_0xe633('0xe'),auth['isAuthenticated'](),controller[_0xe633('0x12')]);router[_0xe633('0x13')](_0xe633('0xe'),auth[_0xe633('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe35f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0xe35f,0x81));var _0xfe35=function(_0x4e0204,_0x5ed563){_0x4e0204=_0x4e0204-0x0;var _0x2a2167=_0xe35f[_0x4e0204];return _0x2a2167;};'use strict';var multer=require(_0xfe35('0x0'));var util=require(_0xfe35('0x1'));var path=require(_0xfe35('0x2'));var timeout=require(_0xfe35('0x3'));var express=require(_0xfe35('0x4'));var router=express['Router']();var fs_extra=require(_0xfe35('0x5'));var auth=require(_0xfe35('0x6'));var interaction=require(_0xfe35('0x7'));var config=require(_0xfe35('0x8'));var controller=require(_0xfe35('0x9'));router[_0xfe35('0xa')]('/',auth[_0xfe35('0xb')](),controller[_0xfe35('0xc')]);router[_0xfe35('0xa')](_0xfe35('0xd'),auth[_0xfe35('0xb')](),controller[_0xfe35('0xe')]);router[_0xfe35('0xa')](_0xfe35('0xf'),auth[_0xfe35('0xb')](),controller[_0xfe35('0x10')]);router[_0xfe35('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xfe35('0xb')](),controller[_0xfe35('0x12')]);router[_0xfe35('0x13')]('/:id',auth[_0xfe35('0xb')](),controller[_0xfe35('0x14')]);module[_0xfe35('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ac682b3..07b1c97 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 _0xafc4=['STRING','sequelize'];(function(_0x395630,_0x20959f){var _0x1e1a82=function(_0x69a294){while(--_0x69a294){_0x395630['push'](_0x395630['shift']());}};_0x1e1a82(++_0x20959f);}(_0xafc4,0x69));var _0x4afc=function(_0x3a15f8,_0x48b474){_0x3a15f8=_0x3a15f8-0x0;var _0x6e4f41=_0xafc4[_0x3a15f8];return _0x6e4f41;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4afc('0x1')]}}; \ No newline at end of file +var _0xd8fb=['name','sequelize','exports','STRING'];(function(_0x516e42,_0x5d98ec){var _0x93581e=function(_0x23715c){while(--_0x23715c){_0x516e42['push'](_0x516e42['shift']());}};_0x93581e(++_0x5d98ec);}(_0xd8fb,0x99));var _0xbd8f=function(_0x55ba65,_0x19454b){_0x55ba65=_0x55ba65-0x0;var _0x22afb5=_0xd8fb[_0x55ba65];return _0x22afb5;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'unique':_0xbd8f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 70dfe25..2642a00 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 _0xd246=['create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x39b6b9,_0x41eb05){var _0x40ce42=function(_0x534620){while(--_0x534620){_0x39b6b9['push'](_0x39b6b9['shift']());}};_0x40ce42(++_0x41eb05);}(_0xd246,0x1c1));var _0x6d24=function(_0x193bef,_0x229b65){_0x193bef=_0x193bef-0x0;var _0x4c725e=_0xd246[_0x193bef];return _0x4c725e;};'use strict';var emlformat=require(_0x6d24('0x0'));var rimraf=require(_0x6d24('0x1'));var zipdir=require(_0x6d24('0x2'));var jsonpatch=require(_0x6d24('0x3'));var rp=require(_0x6d24('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d24('0x5'));var util=require(_0x6d24('0x6'));var path=require(_0x6d24('0x7'));var sox=require('sox');var csv=require(_0x6d24('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d24('0x9'));var _=require('lodash');var squel=require(_0x6d24('0xa'));var crypto=require('crypto');var jsforce=require(_0x6d24('0xb'));var deskjs=require(_0x6d24('0xc'));var toCsv=require(_0x6d24('0x8'));var querystring=require(_0x6d24('0xd'));var Papa=require('papaparse');var Redis=require(_0x6d24('0xe'));var authService=require(_0x6d24('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6d24('0x10'));var hardwareService=require(_0x6d24('0x11'));var logger=require(_0x6d24('0x12'))(_0x6d24('0x13'));var utils=require(_0x6d24('0x14'));var config=require(_0x6d24('0x15'));var licenseUtil=require(_0x6d24('0x16'));var db=require(_0x6d24('0x17'))['db'];function respondWithStatusCode(_0x46527b,_0x3df827){_0x3df827=_0x3df827||0xcc;return function(_0x1738c8){if(_0x1738c8){return _0x46527b[_0x6d24('0x18')](_0x3df827);}return _0x46527b[_0x6d24('0x19')](_0x3df827)[_0x6d24('0x1a')]();};}function respondWithResult(_0x4e8fe9,_0x221dd3){_0x221dd3=_0x221dd3||0xc8;return function(_0x550c7f){if(_0x550c7f){return _0x4e8fe9[_0x6d24('0x19')](_0x221dd3)[_0x6d24('0x1b')](_0x550c7f);}};}function respondWithFilteredResult(_0x4e7711,_0x27f3d9){return function(_0x140bd9){if(_0x140bd9){var _0x3971c1=typeof _0x27f3d9[_0x6d24('0x1c')]===_0x6d24('0x1d')&&typeof _0x27f3d9[_0x6d24('0x1e')]===_0x6d24('0x1d');var _0x35653e=_0x140bd9[_0x6d24('0x1f')];var _0x520677=_0x3971c1?0x0:_0x27f3d9[_0x6d24('0x1c')];var _0x2120e4=_0x3971c1?_0x140bd9[_0x6d24('0x1f')]:_0x27f3d9[_0x6d24('0x1c')]+_0x27f3d9[_0x6d24('0x1e')];var _0x124160;if(_0x2120e4>=_0x35653e){_0x2120e4=_0x35653e;_0x124160=0xc8;}else{_0x124160=0xce;}_0x4e7711[_0x6d24('0x19')](_0x124160);return _0x4e7711[_0x6d24('0x20')]('Content-Range',_0x520677+'-'+_0x2120e4+'/'+_0x35653e)[_0x6d24('0x1b')](_0x140bd9);}return null;};}function patchUpdates(_0x4f38eb){return function(_0x8d0c54){try{jsonpatch[_0x6d24('0x21')](_0x8d0c54,_0x4f38eb,!![]);}catch(_0x564f39){return BPromise['reject'](_0x564f39);}return _0x8d0c54[_0x6d24('0x22')]();};}function saveUpdates(_0x205fd5,_0x8f98e3){return function(_0x53adc7){if(_0x53adc7){return _0x53adc7[_0x6d24('0x23')](_0x205fd5)[_0x6d24('0x24')](function(_0x4ecdfb){return _0x4ecdfb;});}return null;};}function removeEntity(_0x9c597b,_0x36df87){return function(_0x4f885e){if(_0x4f885e){return _0x4f885e['destroy']()[_0x6d24('0x24')](function(){_0x9c597b['status'](0xcc)[_0x6d24('0x1a')]();});}};}function handleEntityNotFound(_0x57e742,_0x146f21){return function(_0x1ae0ab){if(!_0x1ae0ab){_0x57e742[_0x6d24('0x18')](0x194);}return _0x1ae0ab;};}function handleError(_0x52db38,_0x1ea492){_0x1ea492=_0x1ea492||0x1f4;return function(_0x4f3485){logger[_0x6d24('0x25')](_0x4f3485[_0x6d24('0x26')]);if(_0x4f3485['name']){delete _0x4f3485[_0x6d24('0x27')];}_0x52db38[_0x6d24('0x19')](_0x1ea492)[_0x6d24('0x28')](_0x4f3485);};}exports[_0x6d24('0x29')]=function(_0x4adfa6,_0x4442fe){var _0x5118b={},_0x2935f1={},_0x198c8d={'count':0x0,'rows':[]};var _0x1af41b=_['map'](db[_0x6d24('0x2a')][_0x6d24('0x2b')],function(_0x394fd2){return{'name':_0x394fd2[_0x6d24('0x2c')],'type':_0x394fd2['type']['key']};});_0x2935f1[_0x6d24('0x2d')]=_['map'](_0x1af41b,_0x6d24('0x27'));_0x2935f1[_0x6d24('0x2e')]=_['keys'](_0x4adfa6[_0x6d24('0x2e')]);_0x2935f1[_0x6d24('0x2f')]=_[_0x6d24('0x30')](_0x2935f1[_0x6d24('0x2d')],_0x2935f1['query']);_0x5118b[_0x6d24('0x31')]=_[_0x6d24('0x30')](_0x2935f1[_0x6d24('0x2d')],qs[_0x6d24('0x32')](_0x4adfa6['query'][_0x6d24('0x32')]));_0x5118b['attributes']=_0x5118b[_0x6d24('0x31')]['length']?_0x5118b['attributes']:_0x2935f1[_0x6d24('0x2d')];if(!_0x4adfa6[_0x6d24('0x2e')][_0x6d24('0x33')](_0x6d24('0x34'))){_0x5118b[_0x6d24('0x1e')]=qs[_0x6d24('0x1e')](_0x4adfa6[_0x6d24('0x2e')][_0x6d24('0x1e')]);_0x5118b['offset']=qs[_0x6d24('0x1c')](_0x4adfa6[_0x6d24('0x2e')]['offset']);}_0x5118b[_0x6d24('0x35')]=qs[_0x6d24('0x36')](_0x4adfa6[_0x6d24('0x2e')][_0x6d24('0x36')]);_0x5118b[_0x6d24('0x37')]=qs[_0x6d24('0x2f')](_[_0x6d24('0x38')](_0x4adfa6['query'],_0x2935f1[_0x6d24('0x2f')]),_0x1af41b);if(_0x4adfa6[_0x6d24('0x2e')]['filter']){_0x5118b['where']=_[_0x6d24('0x39')](_0x5118b[_0x6d24('0x37')],{'$or':_['map'](_0x1af41b,function(_0x275133){if(_0x275133[_0x6d24('0x3a')]!=='VIRTUAL'){var _0x3af8e6={};_0x3af8e6[_0x275133['name']]={'$like':'%'+_0x4adfa6[_0x6d24('0x2e')][_0x6d24('0x3b')]+'%'};return _0x3af8e6;}})});}_0x5118b=_[_0x6d24('0x39')]({},_0x5118b,_0x4adfa6[_0x6d24('0x3c')]);var _0x1bef52={'where':_0x5118b['where']};return db[_0x6d24('0x2a')]['count'](_0x1bef52)[_0x6d24('0x24')](function(_0x35ae43){_0x198c8d[_0x6d24('0x1f')]=_0x35ae43;if(_0x4adfa6['query'][_0x6d24('0x3d')]){_0x5118b[_0x6d24('0x3e')]=[{'all':!![]}];}return db[_0x6d24('0x2a')][_0x6d24('0x3f')](_0x5118b);})['then'](function(_0x22390d){_0x198c8d[_0x6d24('0x40')]=_0x22390d;return _0x198c8d;})[_0x6d24('0x24')](respondWithFilteredResult(_0x4442fe,_0x5118b))[_0x6d24('0x41')](handleError(_0x4442fe,null));};exports[_0x6d24('0x42')]=function(_0x40f90c,_0x707850){var _0x3a8351={'raw':!![],'where':{'id':_0x40f90c[_0x6d24('0x43')]['id']}},_0x3c603b={};_0x3c603b['model']=_[_0x6d24('0x44')](db['MailSubstatus'][_0x6d24('0x2b')]);_0x3c603b[_0x6d24('0x2e')]=_['keys'](_0x40f90c['query']);_0x3c603b[_0x6d24('0x2f')]=_[_0x6d24('0x30')](_0x3c603b['model'],_0x3c603b[_0x6d24('0x2e')]);_0x3a8351[_0x6d24('0x31')]=_[_0x6d24('0x30')](_0x3c603b[_0x6d24('0x2d')],qs['fields'](_0x40f90c[_0x6d24('0x2e')][_0x6d24('0x32')]));_0x3a8351[_0x6d24('0x31')]=_0x3a8351[_0x6d24('0x31')]['length']?_0x3a8351['attributes']:_0x3c603b['model'];if(_0x40f90c[_0x6d24('0x2e')]['includeAll']){_0x3a8351[_0x6d24('0x3e')]=[{'all':!![]}];}_0x3a8351=_[_0x6d24('0x39')]({},_0x3a8351,_0x40f90c['options']);return db[_0x6d24('0x2a')]['find'](_0x3a8351)['then'](handleEntityNotFound(_0x707850,null))[_0x6d24('0x24')](respondWithResult(_0x707850,null))[_0x6d24('0x41')](handleError(_0x707850,null));};exports[_0x6d24('0x45')]=function(_0x3a1076,_0x7ede17){return db[_0x6d24('0x2a')][_0x6d24('0x45')](_0x3a1076[_0x6d24('0x46')],{})[_0x6d24('0x24')](respondWithResult(_0x7ede17,0xc9))[_0x6d24('0x41')](handleError(_0x7ede17,null));};exports[_0x6d24('0x23')]=function(_0x278ca2,_0x2250ba){if(_0x278ca2[_0x6d24('0x46')]['id']){delete _0x278ca2[_0x6d24('0x46')]['id'];}return db[_0x6d24('0x2a')]['find']({'where':{'id':_0x278ca2[_0x6d24('0x43')]['id']}})[_0x6d24('0x24')](handleEntityNotFound(_0x2250ba,null))['then'](saveUpdates(_0x278ca2['body'],null))[_0x6d24('0x24')](respondWithResult(_0x2250ba,null))['catch'](handleError(_0x2250ba,null));};exports[_0x6d24('0x47')]=function(_0x87805d,_0x58c2c8){return db[_0x6d24('0x2a')][_0x6d24('0x48')]({'where':{'id':_0x87805d['params']['id']}})[_0x6d24('0x24')](handleEntityNotFound(_0x58c2c8,null))[_0x6d24('0x24')](removeEntity(_0x58c2c8,null))[_0x6d24('0x41')](handleError(_0x58c2c8,null));};exports[_0x6d24('0x49')]=function(_0x387bf7,_0x3f8673){return db['MailSubstatus'][_0x6d24('0x49')]()[_0x6d24('0x24')](respondWithResult(_0x3f8673,null))[_0x6d24('0x41')](handleError(_0x3f8673,null));}; \ No newline at end of file +var _0xb764=['create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailSubstatus','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','fields','length','find'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb764,0x9a));var _0x4b76=function(_0xca875f,_0x544c50){_0xca875f=_0xca875f-0x0;var _0x5c8b6c=_0xb764[_0xca875f];return _0x5c8b6c;};'use strict';var emlformat=require(_0x4b76('0x0'));var rimraf=require(_0x4b76('0x1'));var zipdir=require(_0x4b76('0x2'));var jsonpatch=require(_0x4b76('0x3'));var rp=require(_0x4b76('0x4'));var moment=require(_0x4b76('0x5'));var BPromise=require(_0x4b76('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b76('0x7'));var sox=require(_0x4b76('0x8'));var csv=require('to-csv');var ejs=require(_0x4b76('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b76('0xa'));var squel=require('squel');var crypto=require(_0x4b76('0xb'));var jsforce=require(_0x4b76('0xc'));var deskjs=require(_0x4b76('0xd'));var toCsv=require(_0x4b76('0xe'));var querystring=require(_0x4b76('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b76('0x10'));var authService=require(_0x4b76('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4b76('0x12'));var hardwareService=require(_0x4b76('0x13'));var logger=require('../../config/logger')(_0x4b76('0x14'));var utils=require(_0x4b76('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4b76('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f2f02,_0x516757){_0x516757=_0x516757||0xcc;return function(_0x57be7b){if(_0x57be7b){return _0x2f2f02[_0x4b76('0x17')](_0x516757);}return _0x2f2f02[_0x4b76('0x18')](_0x516757)[_0x4b76('0x19')]();};}function respondWithResult(_0x3e2be2,_0x1f70cd){_0x1f70cd=_0x1f70cd||0xc8;return function(_0x22ad61){if(_0x22ad61){return _0x3e2be2['status'](_0x1f70cd)[_0x4b76('0x1a')](_0x22ad61);}};}function respondWithFilteredResult(_0x254341,_0x19fcbf){return function(_0xd40ab7){if(_0xd40ab7){var _0x94ad16=typeof _0x19fcbf[_0x4b76('0x1b')]===_0x4b76('0x1c')&&typeof _0x19fcbf['limit']===_0x4b76('0x1c');var _0x1286ff=_0xd40ab7['count'];var _0x4c1966=_0x94ad16?0x0:_0x19fcbf[_0x4b76('0x1b')];var _0x3d7514=_0x94ad16?_0xd40ab7['count']:_0x19fcbf[_0x4b76('0x1b')]+_0x19fcbf[_0x4b76('0x1d')];var _0x510002;if(_0x3d7514>=_0x1286ff){_0x3d7514=_0x1286ff;_0x510002=0xc8;}else{_0x510002=0xce;}_0x254341[_0x4b76('0x18')](_0x510002);return _0x254341['set'](_0x4b76('0x1e'),_0x4c1966+'-'+_0x3d7514+'/'+_0x1286ff)['json'](_0xd40ab7);}return null;};}function patchUpdates(_0xec1013){return function(_0xb103f0){try{jsonpatch[_0x4b76('0x1f')](_0xb103f0,_0xec1013,!![]);}catch(_0x569284){return BPromise[_0x4b76('0x20')](_0x569284);}return _0xb103f0[_0x4b76('0x21')]();};}function saveUpdates(_0x20778c,_0x9593e4){return function(_0x841e4a){if(_0x841e4a){return _0x841e4a[_0x4b76('0x22')](_0x20778c)[_0x4b76('0x23')](function(_0x5d4c40){return _0x5d4c40;});}return null;};}function removeEntity(_0x231d56,_0x230251){return function(_0x5c53d0){if(_0x5c53d0){return _0x5c53d0[_0x4b76('0x24')]()[_0x4b76('0x23')](function(){_0x231d56['status'](0xcc)[_0x4b76('0x19')]();});}};}function handleEntityNotFound(_0x4cc6f5,_0xf41272){return function(_0x26482c){if(!_0x26482c){_0x4cc6f5[_0x4b76('0x17')](0x194);}return _0x26482c;};}function handleError(_0xb219b7,_0xa033b0){_0xa033b0=_0xa033b0||0x1f4;return function(_0x4d3d75){logger[_0x4b76('0x25')](_0x4d3d75[_0x4b76('0x26')]);if(_0x4d3d75[_0x4b76('0x27')]){delete _0x4d3d75[_0x4b76('0x27')];}_0xb219b7[_0x4b76('0x18')](_0xa033b0)[_0x4b76('0x28')](_0x4d3d75);};}exports[_0x4b76('0x29')]=function(_0x5b6f64,_0x45cf45){var _0x4797d4={},_0x4d514f={},_0x4e7f17={'count':0x0,'rows':[]};var _0x13ff68=_['map'](db[_0x4b76('0x2a')]['rawAttributes'],function(_0x4b0dc5){return{'name':_0x4b0dc5['fieldName'],'type':_0x4b0dc5[_0x4b76('0x2b')][_0x4b76('0x2c')]};});_0x4d514f[_0x4b76('0x2d')]=_['map'](_0x13ff68,_0x4b76('0x27'));_0x4d514f[_0x4b76('0x2e')]=_['keys'](_0x5b6f64[_0x4b76('0x2e')]);_0x4d514f[_0x4b76('0x2f')]=_[_0x4b76('0x30')](_0x4d514f[_0x4b76('0x2d')],_0x4d514f[_0x4b76('0x2e')]);_0x4797d4[_0x4b76('0x31')]=_[_0x4b76('0x30')](_0x4d514f[_0x4b76('0x2d')],qs['fields'](_0x5b6f64[_0x4b76('0x2e')]['fields']));_0x4797d4['attributes']=_0x4797d4[_0x4b76('0x31')]['length']?_0x4797d4[_0x4b76('0x31')]:_0x4d514f[_0x4b76('0x2d')];if(!_0x5b6f64['query'][_0x4b76('0x32')](_0x4b76('0x33'))){_0x4797d4[_0x4b76('0x1d')]=qs['limit'](_0x5b6f64[_0x4b76('0x2e')][_0x4b76('0x1d')]);_0x4797d4[_0x4b76('0x1b')]=qs[_0x4b76('0x1b')](_0x5b6f64[_0x4b76('0x2e')][_0x4b76('0x1b')]);}_0x4797d4['order']=qs[_0x4b76('0x34')](_0x5b6f64[_0x4b76('0x2e')]['sort']);_0x4797d4['where']=qs['filters'](_[_0x4b76('0x35')](_0x5b6f64[_0x4b76('0x2e')],_0x4d514f[_0x4b76('0x2f')]),_0x13ff68);if(_0x5b6f64[_0x4b76('0x2e')][_0x4b76('0x36')]){_0x4797d4[_0x4b76('0x37')]=_[_0x4b76('0x38')](_0x4797d4[_0x4b76('0x37')],{'$or':_[_0x4b76('0x39')](_0x13ff68,function(_0x2d7636){if(_0x2d7636[_0x4b76('0x2b')]!==_0x4b76('0x3a')){var _0x5f0923={};_0x5f0923[_0x2d7636[_0x4b76('0x27')]]={'$like':'%'+_0x5b6f64['query'][_0x4b76('0x36')]+'%'};return _0x5f0923;}})});}_0x4797d4=_['merge']({},_0x4797d4,_0x5b6f64[_0x4b76('0x3b')]);var _0x352431={'where':_0x4797d4[_0x4b76('0x37')]};return db[_0x4b76('0x2a')][_0x4b76('0x3c')](_0x352431)[_0x4b76('0x23')](function(_0x1322a0){_0x4e7f17[_0x4b76('0x3c')]=_0x1322a0;if(_0x5b6f64['query'][_0x4b76('0x3d')]){_0x4797d4[_0x4b76('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4b76('0x3f')](_0x4797d4);})[_0x4b76('0x23')](function(_0x4d0e1b){_0x4e7f17[_0x4b76('0x40')]=_0x4d0e1b;return _0x4e7f17;})[_0x4b76('0x23')](respondWithFilteredResult(_0x45cf45,_0x4797d4))['catch'](handleError(_0x45cf45,null));};exports[_0x4b76('0x41')]=function(_0x931a44,_0x5a0e74){var _0xbff35c={'raw':!![],'where':{'id':_0x931a44[_0x4b76('0x42')]['id']}},_0x2b1753={};_0x2b1753[_0x4b76('0x2d')]=_[_0x4b76('0x43')](db[_0x4b76('0x2a')]['rawAttributes']);_0x2b1753[_0x4b76('0x2e')]=_[_0x4b76('0x43')](_0x931a44[_0x4b76('0x2e')]);_0x2b1753['filters']=_[_0x4b76('0x30')](_0x2b1753[_0x4b76('0x2d')],_0x2b1753[_0x4b76('0x2e')]);_0xbff35c[_0x4b76('0x31')]=_['intersection'](_0x2b1753['model'],qs['fields'](_0x931a44[_0x4b76('0x2e')][_0x4b76('0x44')]));_0xbff35c[_0x4b76('0x31')]=_0xbff35c[_0x4b76('0x31')][_0x4b76('0x45')]?_0xbff35c[_0x4b76('0x31')]:_0x2b1753['model'];if(_0x931a44['query'][_0x4b76('0x3d')]){_0xbff35c['include']=[{'all':!![]}];}_0xbff35c=_[_0x4b76('0x38')]({},_0xbff35c,_0x931a44[_0x4b76('0x3b')]);return db[_0x4b76('0x2a')][_0x4b76('0x46')](_0xbff35c)['then'](handleEntityNotFound(_0x5a0e74,null))[_0x4b76('0x23')](respondWithResult(_0x5a0e74,null))['catch'](handleError(_0x5a0e74,null));};exports[_0x4b76('0x47')]=function(_0x48749f,_0x588e20){return db[_0x4b76('0x2a')][_0x4b76('0x47')](_0x48749f[_0x4b76('0x48')],{})['then'](respondWithResult(_0x588e20,0xc9))[_0x4b76('0x49')](handleError(_0x588e20,null));};exports[_0x4b76('0x22')]=function(_0x1fb52c,_0x2127b3){if(_0x1fb52c[_0x4b76('0x48')]['id']){delete _0x1fb52c[_0x4b76('0x48')]['id'];}return db[_0x4b76('0x2a')][_0x4b76('0x46')]({'where':{'id':_0x1fb52c[_0x4b76('0x42')]['id']}})[_0x4b76('0x23')](handleEntityNotFound(_0x2127b3,null))[_0x4b76('0x23')](saveUpdates(_0x1fb52c[_0x4b76('0x48')],null))[_0x4b76('0x23')](respondWithResult(_0x2127b3,null))[_0x4b76('0x49')](handleError(_0x2127b3,null));};exports[_0x4b76('0x24')]=function(_0x30e2bb,_0x1c5151){return db[_0x4b76('0x2a')][_0x4b76('0x46')]({'where':{'id':_0x30e2bb['params']['id']}})[_0x4b76('0x23')](handleEntityNotFound(_0x1c5151,null))[_0x4b76('0x23')](removeEntity(_0x1c5151,null))[_0x4b76('0x49')](handleError(_0x1c5151,null));};exports[_0x4b76('0x4a')]=function(_0x5e97d9,_0x65492d){return db[_0x4b76('0x2a')][_0x4b76('0x4a')]()[_0x4b76('0x23')](respondWithResult(_0x65492d,null))[_0x4b76('0x49')](handleError(_0x65492d,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 1ac93d2..685936f 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 _0xfbbf=['setMaxListeners','emit','hasOwnProperty','exports'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0xfbbf,0x10c));var _0xffbb=function(_0x972e6,_0x2ee95b){_0x972e6=_0x972e6-0x0;var _0x24ec0a=_0xfbbf[_0x972e6];return _0x24ec0a;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xffbb('0x0')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x221c09){return function(_0x233bfd,_0x4b1a52,_0x2912e5){MailSubstatusEvents[_0xffbb('0x1')](_0x221c09+':'+_0x233bfd['id'],_0x233bfd);MailSubstatusEvents[_0xffbb('0x1')](_0x221c09,_0x233bfd);_0x2912e5(null);};}for(var e in events){if(events[_0xffbb('0x2')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xffbb('0x3')]=MailSubstatusEvents; \ No newline at end of file +var _0x77e8=['../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','events'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x77e8,0x148));var _0x877e=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x77e8[_0x1f5887];return _0x21774b;};'use strict';var EventEmitter=require(_0x877e('0x0'));var MailSubstatus=require(_0x877e('0x1'))['db'][_0x877e('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x877e('0x3')};function emitEvent(_0x5a1ff2){return function(_0x1d690b,_0x18b999,_0x4275fb){MailSubstatusEvents[_0x877e('0x4')](_0x5a1ff2+':'+_0x1d690b['id'],_0x1d690b);MailSubstatusEvents[_0x877e('0x4')](_0x5a1ff2,_0x1d690b);_0x4275fb(null);};}for(var e in events){if(events[_0x877e('0x5')](e)){var event=events[e];MailSubstatus[_0x877e('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7dd4472..4f287f7 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 _0xa4ad=['_previousDataValues','name','models','define','mail_substatuses','Condition'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0xa4ad,0x86));var _0xda4a=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0xa4ad[_0x5f46e7];return _0x567e95;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x22c5c4){var _0xb396fb=_0x22c5c4[_0xda4a('0x0')];return _0x22c5c4[_0xda4a('0x1')]('MailSubstatus',attributes,{'tableName':_0xda4a('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x535c97,_0x142c02,_0x1e4870){return _0xb396fb[_0xda4a('0x3')]['update']({'value':_0x535c97['name']},{'where':{'field':'mailSubstatus','value':_0x535c97[_0xda4a('0x4')][_0xda4a('0x5')]}})['then'](function(){_0x1e4870();})['catch'](function(_0x3b71e3){_0x1e4870(_0x3b71e3);});}}});}; \ No newline at end of file +var _0x5c4b=['./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','Condition','_previousDataValues','name','then','catch'];(function(_0xb4917f,_0x22f834){var _0x2b14ca=function(_0x5c5373){while(--_0x5c5373){_0xb4917f['push'](_0xb4917f['shift']());}};_0x2b14ca(++_0x22f834);}(_0x5c4b,0xa2));var _0xb5c4=function(_0x555f57,_0x9df815){_0x555f57=_0x555f57-0x0;var _0x2fb9c0=_0x5c4b[_0x555f57];return _0x2fb9c0;};'use strict';var attributes=require(_0xb5c4('0x0'));module[_0xb5c4('0x1')]=function(_0x25652d){var _0xd76fdf=_0x25652d['models'];return _0x25652d['define'](_0xb5c4('0x2'),attributes,{'tableName':_0xb5c4('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5b019d,_0x135934,_0x47aa8e){return _0xd76fdf[_0xb5c4('0x4')]['update']({'value':_0x5b019d['name']},{'where':{'field':'mailSubstatus','value':_0x5b019d[_0xb5c4('0x5')][_0xb5c4('0x6')]}})[_0xb5c4('0x7')](function(){_0x47aa8e();})[_0xb5c4('0x8')](function(_0x4388ad){_0x47aa8e(_0x4388ad);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9d9b39f..64633da 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 _0x9b62=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info'];(function(_0x176d1a,_0x3bfd6c){var _0x520c05=function(_0x3bc1fe){while(--_0x3bc1fe){_0x176d1a['push'](_0x176d1a['shift']());}};_0x520c05(++_0x3bfd6c);}(_0x9b62,0x169));var _0x29b6=function(_0x43127b,_0x1f0d19){_0x43127b=_0x43127b-0x0;var _0x3f71ad=_0x9b62[_0x43127b];return _0x3f71ad;};'use strict';var _=require(_0x29b6('0x0'));var util=require(_0x29b6('0x1'));var moment=require(_0x29b6('0x2'));var BPromise=require(_0x29b6('0x3'));var rs=require(_0x29b6('0x4'));var fs=require('fs');var Redis=require(_0x29b6('0x5'));var db=require(_0x29b6('0x6'))['db'];var utils=require(_0x29b6('0x7'));var logger=require(_0x29b6('0x8'))(_0x29b6('0x9'));var config=require(_0x29b6('0xa'));var jayson=require(_0x29b6('0xb'));var client=jayson[_0x29b6('0xc')][_0x29b6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35197d,_0x491590,_0x1455bc){return new BPromise(function(_0x5be608,_0x4213bd){return client[_0x29b6('0xe')](_0x35197d,_0x1455bc)['then'](function(_0x382ec2){logger['info'](_0x29b6('0xf'),_0x491590,'request\x20sent');logger[_0x29b6('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x491590,_0x29b6('0x11'),JSON[_0x29b6('0x12')](_0x382ec2));if(_0x382ec2['error']){if(_0x382ec2['error'][_0x29b6('0x13')]===0x1f4){logger[_0x29b6('0x14')](_0x29b6('0xf'),_0x491590,_0x382ec2[_0x29b6('0x14')]['message']);return _0x4213bd(_0x382ec2[_0x29b6('0x14')][_0x29b6('0x15')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x491590,_0x382ec2[_0x29b6('0x14')][_0x29b6('0x15')]);return _0x5be608(_0x382ec2[_0x29b6('0x14')][_0x29b6('0x15')]);}else{logger[_0x29b6('0x16')](_0x29b6('0xf'),_0x491590,'request\x20sent');_0x5be608(_0x382ec2[_0x29b6('0x17')][_0x29b6('0x15')]);}})['catch'](function(_0x323b1d){logger['error'](_0x29b6('0xf'),_0x491590,_0x323b1d);_0x4213bd(_0x323b1d);});});} \ No newline at end of file +var _0x3b2a=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x57372d,_0x11f69c){var _0x5ae855=function(_0xb635b1){while(--_0xb635b1){_0x57372d['push'](_0x57372d['shift']());}};_0x5ae855(++_0x11f69c);}(_0x3b2a,0x90));var _0xa3b2=function(_0x37ce45,_0xda6746){_0x37ce45=_0x37ce45-0x0;var _0x17d5f7=_0x3b2a[_0x37ce45];return _0x17d5f7;};'use strict';var _=require('lodash');var util=require(_0xa3b2('0x0'));var moment=require('moment');var BPromise=require(_0xa3b2('0x1'));var rs=require(_0xa3b2('0x2'));var fs=require('fs');var Redis=require(_0xa3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa3b2('0x4'))(_0xa3b2('0x5'));var config=require(_0xa3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3b2('0x7')][_0xa3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59dc01,_0xc01ac1,_0x42a74c){return new BPromise(function(_0xa63d94,_0xe1ef79){return client[_0xa3b2('0x9')](_0x59dc01,_0x42a74c)[_0xa3b2('0xa')](function(_0x198b5a){logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));logger[_0xa3b2('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0xc01ac1,_0xa3b2('0xd'),JSON[_0xa3b2('0xf')](_0x198b5a));if(_0x198b5a[_0xa3b2('0x10')]){if(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x11')]===0x1f4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a['error']['message']);return _0xe1ef79(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}logger[_0xa3b2('0x10')](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);return _0xa63d94(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}else{logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));_0xa63d94(_0x198b5a[_0xa3b2('0x13')][_0xa3b2('0x12')]);}})[_0xa3b2('0x14')](function(_0x5132e4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x5132e4);_0xe1ef79(_0x5132e4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 24caa5b..4bed7b6 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 _0xaa14=['delete','/:id','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put'];(function(_0x724b9a,_0x5a5fca){var _0x4c1413=function(_0x1f9ed1){while(--_0x1f9ed1){_0x724b9a['push'](_0x724b9a['shift']());}};_0x4c1413(++_0x5a5fca);}(_0xaa14,0x11f));var _0x4aa1=function(_0x43eb68,_0x34acfe){_0x43eb68=_0x43eb68-0x0;var _0x451a50=_0xaa14[_0x43eb68];return _0x451a50;};'use strict';var multer=require('multer');var util=require(_0x4aa1('0x0'));var path=require(_0x4aa1('0x1'));var timeout=require(_0x4aa1('0x2'));var express=require(_0x4aa1('0x3'));var router=express[_0x4aa1('0x4')]();var fs_extra=require(_0x4aa1('0x5'));var auth=require(_0x4aa1('0x6'));var interaction=require(_0x4aa1('0x7'));var config=require(_0x4aa1('0x8'));var controller=require('./mailTransferReport.controller');router[_0x4aa1('0x9')]('/',auth[_0x4aa1('0xa')](),controller[_0x4aa1('0xb')]);router[_0x4aa1('0x9')](_0x4aa1('0xc'),auth[_0x4aa1('0xa')](),controller[_0x4aa1('0xd')]);router['get']('/:id',auth[_0x4aa1('0xa')](),controller['show']);router[_0x4aa1('0xe')]('/',auth[_0x4aa1('0xa')](),controller[_0x4aa1('0xf')]);router[_0x4aa1('0x10')]('/:id',auth[_0x4aa1('0xa')](),controller['update']);router[_0x4aa1('0x11')](_0x4aa1('0x12'),auth[_0x4aa1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf6e5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xf6e5,0x10d));var _0x5f6e=function(_0x1278b6,_0x24252e){_0x1278b6=_0x1278b6-0x0;var _0x2cff42=_0xf6e5[_0x1278b6];return _0x2cff42;};'use strict';var multer=require(_0x5f6e('0x0'));var util=require(_0x5f6e('0x1'));var path=require(_0x5f6e('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f6e('0x3'));var router=express[_0x5f6e('0x4')]();var fs_extra=require(_0x5f6e('0x5'));var auth=require(_0x5f6e('0x6'));var interaction=require(_0x5f6e('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x9')]);router['get'](_0x5f6e('0xa'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0xb')]);router[_0x5f6e('0xc')](_0x5f6e('0xd'),auth['isAuthenticated'](),controller[_0x5f6e('0xe')]);router[_0x5f6e('0xf')]('/',auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x10')]);router[_0x5f6e('0x11')](_0x5f6e('0xd'),auth[_0x5f6e('0x8')](),controller[_0x5f6e('0x12')]);router[_0x5f6e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5f6e('0x14')]);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 e7c1601..4821cc2 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1a9709,_0x2c9f31){var _0x471907=function(_0x584673){while(--_0x584673){_0x1a9709['push'](_0x1a9709['shift']());}};_0x471907(++_0x2c9f31);}(_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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4f205d,_0x39af34){var _0x255e92=function(_0x238e4c){while(--_0x238e4c){_0x4f205d['push'](_0x4f205d['shift']());}};_0x255e92(++_0x39af34);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0x4b84[_0x1f5143];return _0x383a38;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e31868b..2feef76 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 _0x8564=['body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','MailTransferReport','rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8564,0x1dd));var _0x4856=function(_0x2c36c1,_0x4ca387){_0x2c36c1=_0x2c36c1-0x0;var _0x16f14b=_0x8564[_0x2c36c1];return _0x16f14b;};'use strict';var emlformat=require(_0x4856('0x0'));var rimraf=require(_0x4856('0x1'));var zipdir=require(_0x4856('0x2'));var jsonpatch=require(_0x4856('0x3'));var rp=require(_0x4856('0x4'));var moment=require(_0x4856('0x5'));var BPromise=require(_0x4856('0x6'));var Mustache=require(_0x4856('0x7'));var util=require(_0x4856('0x8'));var path=require(_0x4856('0x9'));var sox=require(_0x4856('0xa'));var csv=require(_0x4856('0xb'));var ejs=require(_0x4856('0xc'));var fs=require('fs');var fs_extra=require(_0x4856('0xd'));var _=require('lodash');var squel=require(_0x4856('0xe'));var crypto=require(_0x4856('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4856('0x10'));var toCsv=require(_0x4856('0xb'));var querystring=require(_0x4856('0x11'));var Papa=require(_0x4856('0x12'));var Redis=require('ioredis');var authService=require(_0x4856('0x13'));var qs=require(_0x4856('0x14'));var as=require(_0x4856('0x15'));var hardwareService=require(_0x4856('0x16'));var logger=require(_0x4856('0x17'))(_0x4856('0x18'));var utils=require(_0x4856('0x19'));var config=require(_0x4856('0x1a'));var licenseUtil=require(_0x4856('0x1b'));var db=require(_0x4856('0x1c'))['db'];function respondWithStatusCode(_0x270f81,_0x75f07b){_0x75f07b=_0x75f07b||0xcc;return function(_0x3ab8db){if(_0x3ab8db){return _0x270f81[_0x4856('0x1d')](_0x75f07b);}return _0x270f81[_0x4856('0x1e')](_0x75f07b)[_0x4856('0x1f')]();};}function respondWithResult(_0x49a1ce,_0x3e4bad){_0x3e4bad=_0x3e4bad||0xc8;return function(_0x45abb8){if(_0x45abb8){return _0x49a1ce[_0x4856('0x1e')](_0x3e4bad)[_0x4856('0x20')](_0x45abb8);}};}function respondWithFilteredResult(_0x561502,_0x2fef5e){return function(_0x3feb54){if(_0x3feb54){var _0x794bb7=typeof _0x2fef5e[_0x4856('0x21')]===_0x4856('0x22')&&typeof _0x2fef5e[_0x4856('0x23')]===_0x4856('0x22');var _0x22e3db=_0x3feb54[_0x4856('0x24')];var _0x49c47d=_0x794bb7?0x0:_0x2fef5e[_0x4856('0x21')];var _0x520d2c=_0x794bb7?_0x3feb54['count']:_0x2fef5e[_0x4856('0x21')]+_0x2fef5e[_0x4856('0x23')];var _0x349bad;if(_0x520d2c>=_0x22e3db){_0x520d2c=_0x22e3db;_0x349bad=0xc8;}else{_0x349bad=0xce;}_0x561502[_0x4856('0x1e')](_0x349bad);return _0x561502[_0x4856('0x25')]('Content-Range',_0x49c47d+'-'+_0x520d2c+'/'+_0x22e3db)[_0x4856('0x20')](_0x3feb54);}return null;};}function patchUpdates(_0x3bdae7){return function(_0x2f8660){try{jsonpatch[_0x4856('0x26')](_0x2f8660,_0x3bdae7,!![]);}catch(_0x367a56){return BPromise[_0x4856('0x27')](_0x367a56);}return _0x2f8660[_0x4856('0x28')]();};}function saveUpdates(_0x3bbaa8,_0x1e6f2d){return function(_0x495846){if(_0x495846){return _0x495846['update'](_0x3bbaa8)[_0x4856('0x29')](function(_0x1b928a){return _0x1b928a;});}return null;};}function removeEntity(_0x1bce61,_0x1666b9){return function(_0x491550){if(_0x491550){return _0x491550['destroy']()[_0x4856('0x29')](function(){_0x1bce61[_0x4856('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a9fb,_0x1ce7c1){return function(_0x42fa18){if(!_0x42fa18){_0x34a9fb['sendStatus'](0x194);}return _0x42fa18;};}function handleError(_0x23d52e,_0x54e330){_0x54e330=_0x54e330||0x1f4;return function(_0x30a013){logger[_0x4856('0x2a')](_0x30a013[_0x4856('0x2b')]);if(_0x30a013[_0x4856('0x2c')]){delete _0x30a013[_0x4856('0x2c')];}_0x23d52e[_0x4856('0x1e')](_0x54e330)['send'](_0x30a013);};}exports[_0x4856('0x2d')]=function(_0x17c4e1,_0x256d6d){var _0x7a2ba5={},_0x260800={},_0x10f700={'count':0x0,'rows':[]};var _0x220950=_['map'](db[_0x4856('0x2e')][_0x4856('0x2f')],function(_0x4abe85){return{'name':_0x4abe85['fieldName'],'type':_0x4abe85[_0x4856('0x30')][_0x4856('0x31')]};});_0x260800[_0x4856('0x32')]=_[_0x4856('0x33')](_0x220950,'name');_0x260800['query']=_[_0x4856('0x34')](_0x17c4e1[_0x4856('0x35')]);_0x260800['filters']=_[_0x4856('0x36')](_0x260800[_0x4856('0x32')],_0x260800['query']);_0x7a2ba5[_0x4856('0x37')]=_[_0x4856('0x36')](_0x260800[_0x4856('0x32')],qs[_0x4856('0x38')](_0x17c4e1[_0x4856('0x35')][_0x4856('0x38')]));_0x7a2ba5['attributes']=_0x7a2ba5[_0x4856('0x37')][_0x4856('0x39')]?_0x7a2ba5['attributes']:_0x260800[_0x4856('0x32')];if(!_0x17c4e1[_0x4856('0x35')][_0x4856('0x3a')]('nolimit')){_0x7a2ba5[_0x4856('0x23')]=qs[_0x4856('0x23')](_0x17c4e1[_0x4856('0x35')]['limit']);_0x7a2ba5['offset']=qs[_0x4856('0x21')](_0x17c4e1[_0x4856('0x35')][_0x4856('0x21')]);}_0x7a2ba5[_0x4856('0x3b')]=qs[_0x4856('0x3c')](_0x17c4e1[_0x4856('0x35')]['sort']);_0x7a2ba5[_0x4856('0x3d')]=qs[_0x4856('0x3e')](_[_0x4856('0x3f')](_0x17c4e1['query'],_0x260800[_0x4856('0x3e')]),_0x220950);if(_0x17c4e1[_0x4856('0x35')]['filter']){_0x7a2ba5['where']=_[_0x4856('0x40')](_0x7a2ba5[_0x4856('0x3d')],{'$or':_['map'](_0x220950,function(_0x53be71){if(_0x53be71[_0x4856('0x30')]!==_0x4856('0x41')){var _0x28e4e9={};_0x28e4e9[_0x53be71['name']]={'$like':'%'+_0x17c4e1['query']['filter']+'%'};return _0x28e4e9;}})});}_0x7a2ba5=_[_0x4856('0x40')]({},_0x7a2ba5,_0x17c4e1[_0x4856('0x42')]);var _0x4e7802={'where':_0x7a2ba5['where']};return db[_0x4856('0x2e')][_0x4856('0x24')](_0x4e7802)[_0x4856('0x29')](function(_0x1418dc){_0x10f700[_0x4856('0x24')]=_0x1418dc;if(_0x17c4e1[_0x4856('0x35')][_0x4856('0x43')]){_0x7a2ba5['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x4856('0x44')](_0x7a2ba5);})[_0x4856('0x29')](function(_0x6fe14b){_0x10f700[_0x4856('0x45')]=_0x6fe14b;return _0x10f700;})[_0x4856('0x29')](respondWithFilteredResult(_0x256d6d,_0x7a2ba5))['catch'](handleError(_0x256d6d,null));};exports[_0x4856('0x46')]=function(_0x52351c,_0x13ff58){var _0x36ca1e={'raw':!![],'where':{'id':_0x52351c[_0x4856('0x47')]['id']}},_0x5e70f7={};_0x5e70f7[_0x4856('0x32')]=_[_0x4856('0x34')](db[_0x4856('0x2e')][_0x4856('0x2f')]);_0x5e70f7['query']=_[_0x4856('0x34')](_0x52351c[_0x4856('0x35')]);_0x5e70f7['filters']=_['intersection'](_0x5e70f7[_0x4856('0x32')],_0x5e70f7[_0x4856('0x35')]);_0x36ca1e[_0x4856('0x37')]=_[_0x4856('0x36')](_0x5e70f7[_0x4856('0x32')],qs[_0x4856('0x38')](_0x52351c[_0x4856('0x35')]['fields']));_0x36ca1e[_0x4856('0x37')]=_0x36ca1e[_0x4856('0x37')][_0x4856('0x39')]?_0x36ca1e[_0x4856('0x37')]:_0x5e70f7[_0x4856('0x32')];if(_0x52351c[_0x4856('0x35')][_0x4856('0x43')]){_0x36ca1e[_0x4856('0x48')]=[{'all':!![]}];}_0x36ca1e=_[_0x4856('0x40')]({},_0x36ca1e,_0x52351c[_0x4856('0x42')]);return db[_0x4856('0x2e')][_0x4856('0x49')](_0x36ca1e)[_0x4856('0x29')](handleEntityNotFound(_0x13ff58,null))[_0x4856('0x29')](respondWithResult(_0x13ff58,null))[_0x4856('0x4a')](handleError(_0x13ff58,null));};exports[_0x4856('0x4b')]=function(_0x54fb82,_0xbf5860){return db[_0x4856('0x2e')][_0x4856('0x4b')](_0x54fb82[_0x4856('0x4c')],{})[_0x4856('0x29')](respondWithResult(_0xbf5860,0xc9))['catch'](handleError(_0xbf5860,null));};exports[_0x4856('0x4d')]=function(_0x228d2f,_0x1cba54){if(_0x228d2f[_0x4856('0x4c')]['id']){delete _0x228d2f['body']['id'];}return db[_0x4856('0x2e')][_0x4856('0x49')]({'where':{'id':_0x228d2f[_0x4856('0x47')]['id']}})[_0x4856('0x29')](handleEntityNotFound(_0x1cba54,null))[_0x4856('0x29')](saveUpdates(_0x228d2f[_0x4856('0x4c')],null))[_0x4856('0x29')](respondWithResult(_0x1cba54,null))[_0x4856('0x4a')](handleError(_0x1cba54,null));};exports['destroy']=function(_0x92e4fb,_0xa749ce){return db[_0x4856('0x2e')][_0x4856('0x49')]({'where':{'id':_0x92e4fb[_0x4856('0x47')]['id']}})[_0x4856('0x29')](handleEntityNotFound(_0xa749ce,null))[_0x4856('0x29')](removeEntity(_0xa749ce,null))[_0x4856('0x4a')](handleError(_0xa749ce,null));};exports[_0x4856('0x4e')]=function(_0x3ed269,_0x1a3a99){return db[_0x4856('0x2e')]['describe']()[_0x4856('0x29')](respondWithResult(_0x1a3a99,null))[_0x4856('0x4a')](handleError(_0x1a3a99,null));}; \ No newline at end of file +var _0x3fc4=['keys','rawAttributes','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','MailTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x3fc4,0x9f));var _0x43fc=function(_0x296273,_0x193dc1){_0x296273=_0x296273-0x0;var _0x60ff34=_0x3fc4[_0x296273];return _0x60ff34;};'use strict';var emlformat=require(_0x43fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43fc('0x1'));var jsonpatch=require(_0x43fc('0x2'));var rp=require(_0x43fc('0x3'));var moment=require('moment');var BPromise=require(_0x43fc('0x4'));var Mustache=require('mustache');var util=require(_0x43fc('0x5'));var path=require('path');var sox=require(_0x43fc('0x6'));var csv=require(_0x43fc('0x7'));var ejs=require(_0x43fc('0x8'));var fs=require('fs');var fs_extra=require(_0x43fc('0x9'));var _=require(_0x43fc('0xa'));var squel=require('squel');var crypto=require(_0x43fc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x43fc('0xc'));var toCsv=require(_0x43fc('0x7'));var querystring=require(_0x43fc('0xd'));var Papa=require(_0x43fc('0xe'));var Redis=require(_0x43fc('0xf'));var authService=require(_0x43fc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x43fc('0x11'));var hardwareService=require(_0x43fc('0x12'));var logger=require(_0x43fc('0x13'))(_0x43fc('0x14'));var utils=require(_0x43fc('0x15'));var config=require(_0x43fc('0x16'));var licenseUtil=require(_0x43fc('0x17'));var db=require(_0x43fc('0x18'))['db'];function respondWithStatusCode(_0x227203,_0x206203){_0x206203=_0x206203||0xcc;return function(_0x39a193){if(_0x39a193){return _0x227203[_0x43fc('0x19')](_0x206203);}return _0x227203[_0x43fc('0x1a')](_0x206203)[_0x43fc('0x1b')]();};}function respondWithResult(_0x312843,_0x168014){_0x168014=_0x168014||0xc8;return function(_0x1af6ae){if(_0x1af6ae){return _0x312843[_0x43fc('0x1a')](_0x168014)['json'](_0x1af6ae);}};}function respondWithFilteredResult(_0x40d206,_0x1a88ce){return function(_0x4f0552){if(_0x4f0552){var _0x424381=typeof _0x1a88ce[_0x43fc('0x1c')]===_0x43fc('0x1d')&&typeof _0x1a88ce[_0x43fc('0x1e')]===_0x43fc('0x1d');var _0x144b63=_0x4f0552[_0x43fc('0x1f')];var _0x5e3db5=_0x424381?0x0:_0x1a88ce[_0x43fc('0x1c')];var _0x352aef=_0x424381?_0x4f0552['count']:_0x1a88ce['offset']+_0x1a88ce['limit'];var _0x18fc44;if(_0x352aef>=_0x144b63){_0x352aef=_0x144b63;_0x18fc44=0xc8;}else{_0x18fc44=0xce;}_0x40d206[_0x43fc('0x1a')](_0x18fc44);return _0x40d206[_0x43fc('0x20')](_0x43fc('0x21'),_0x5e3db5+'-'+_0x352aef+'/'+_0x144b63)[_0x43fc('0x22')](_0x4f0552);}return null;};}function patchUpdates(_0x5362b8){return function(_0x5e173b){try{jsonpatch['apply'](_0x5e173b,_0x5362b8,!![]);}catch(_0x55902){return BPromise[_0x43fc('0x23')](_0x55902);}return _0x5e173b[_0x43fc('0x24')]();};}function saveUpdates(_0x250432,_0x3eba0e){return function(_0x4f928c){if(_0x4f928c){return _0x4f928c['update'](_0x250432)[_0x43fc('0x25')](function(_0x3bee8e){return _0x3bee8e;});}return null;};}function removeEntity(_0xb9a2b4,_0x5c64ab){return function(_0x121bef){if(_0x121bef){return _0x121bef[_0x43fc('0x26')]()[_0x43fc('0x25')](function(){_0xb9a2b4[_0x43fc('0x1a')](0xcc)[_0x43fc('0x1b')]();});}};}function handleEntityNotFound(_0x240b77,_0x3feb2a){return function(_0x44dc3e){if(!_0x44dc3e){_0x240b77[_0x43fc('0x19')](0x194);}return _0x44dc3e;};}function handleError(_0x5d8bcd,_0x27b062){_0x27b062=_0x27b062||0x1f4;return function(_0x40d8af){logger[_0x43fc('0x27')](_0x40d8af[_0x43fc('0x28')]);if(_0x40d8af[_0x43fc('0x29')]){delete _0x40d8af[_0x43fc('0x29')];}_0x5d8bcd[_0x43fc('0x1a')](_0x27b062)[_0x43fc('0x2a')](_0x40d8af);};}exports[_0x43fc('0x2b')]=function(_0x37c205,_0x58ab88){var _0x2c85cd={},_0x5a6135={},_0x55e405={'count':0x0,'rows':[]};var _0x10dd92=_[_0x43fc('0x2c')](db[_0x43fc('0x2d')]['rawAttributes'],function(_0x2143da){return{'name':_0x2143da[_0x43fc('0x2e')],'type':_0x2143da[_0x43fc('0x2f')][_0x43fc('0x30')]};});_0x5a6135[_0x43fc('0x31')]=_[_0x43fc('0x2c')](_0x10dd92,_0x43fc('0x29'));_0x5a6135[_0x43fc('0x32')]=_['keys'](_0x37c205['query']);_0x5a6135[_0x43fc('0x33')]=_[_0x43fc('0x34')](_0x5a6135[_0x43fc('0x31')],_0x5a6135['query']);_0x2c85cd[_0x43fc('0x35')]=_['intersection'](_0x5a6135[_0x43fc('0x31')],qs['fields'](_0x37c205[_0x43fc('0x32')][_0x43fc('0x36')]));_0x2c85cd[_0x43fc('0x35')]=_0x2c85cd[_0x43fc('0x35')][_0x43fc('0x37')]?_0x2c85cd[_0x43fc('0x35')]:_0x5a6135[_0x43fc('0x31')];if(!_0x37c205['query']['hasOwnProperty'](_0x43fc('0x38'))){_0x2c85cd[_0x43fc('0x1e')]=qs[_0x43fc('0x1e')](_0x37c205[_0x43fc('0x32')]['limit']);_0x2c85cd['offset']=qs[_0x43fc('0x1c')](_0x37c205['query'][_0x43fc('0x1c')]);}_0x2c85cd[_0x43fc('0x39')]=qs[_0x43fc('0x3a')](_0x37c205['query'][_0x43fc('0x3a')]);_0x2c85cd[_0x43fc('0x3b')]=qs['filters'](_[_0x43fc('0x3c')](_0x37c205['query'],_0x5a6135['filters']),_0x10dd92);if(_0x37c205['query'][_0x43fc('0x3d')]){_0x2c85cd[_0x43fc('0x3b')]=_[_0x43fc('0x3e')](_0x2c85cd[_0x43fc('0x3b')],{'$or':_[_0x43fc('0x2c')](_0x10dd92,function(_0x38cd4a){if(_0x38cd4a[_0x43fc('0x2f')]!==_0x43fc('0x3f')){var _0xf87af={};_0xf87af[_0x38cd4a[_0x43fc('0x29')]]={'$like':'%'+_0x37c205[_0x43fc('0x32')][_0x43fc('0x3d')]+'%'};return _0xf87af;}})});}_0x2c85cd=_[_0x43fc('0x3e')]({},_0x2c85cd,_0x37c205[_0x43fc('0x40')]);var _0x4396d9={'where':_0x2c85cd[_0x43fc('0x3b')]};return db[_0x43fc('0x2d')]['count'](_0x4396d9)[_0x43fc('0x25')](function(_0x429709){_0x55e405[_0x43fc('0x1f')]=_0x429709;if(_0x37c205[_0x43fc('0x32')]['includeAll']){_0x2c85cd[_0x43fc('0x41')]=[{'all':!![]}];}return db[_0x43fc('0x2d')]['findAll'](_0x2c85cd);})[_0x43fc('0x25')](function(_0x2c494e){_0x55e405[_0x43fc('0x42')]=_0x2c494e;return _0x55e405;})[_0x43fc('0x25')](respondWithFilteredResult(_0x58ab88,_0x2c85cd))[_0x43fc('0x43')](handleError(_0x58ab88,null));};exports['show']=function(_0x22fbfc,_0x48c1bb){var _0x2ed6a9={'raw':!![],'where':{'id':_0x22fbfc[_0x43fc('0x44')]['id']}},_0x316c36={};_0x316c36[_0x43fc('0x31')]=_[_0x43fc('0x45')](db[_0x43fc('0x2d')][_0x43fc('0x46')]);_0x316c36[_0x43fc('0x32')]=_['keys'](_0x22fbfc[_0x43fc('0x32')]);_0x316c36[_0x43fc('0x33')]=_[_0x43fc('0x34')](_0x316c36[_0x43fc('0x31')],_0x316c36[_0x43fc('0x32')]);_0x2ed6a9[_0x43fc('0x35')]=_['intersection'](_0x316c36[_0x43fc('0x31')],qs[_0x43fc('0x36')](_0x22fbfc[_0x43fc('0x32')][_0x43fc('0x36')]));_0x2ed6a9['attributes']=_0x2ed6a9['attributes'][_0x43fc('0x37')]?_0x2ed6a9[_0x43fc('0x35')]:_0x316c36['model'];if(_0x22fbfc[_0x43fc('0x32')]['includeAll']){_0x2ed6a9[_0x43fc('0x41')]=[{'all':!![]}];}_0x2ed6a9=_[_0x43fc('0x3e')]({},_0x2ed6a9,_0x22fbfc[_0x43fc('0x40')]);return db['MailTransferReport'][_0x43fc('0x47')](_0x2ed6a9)[_0x43fc('0x25')](handleEntityNotFound(_0x48c1bb,null))[_0x43fc('0x25')](respondWithResult(_0x48c1bb,null))[_0x43fc('0x43')](handleError(_0x48c1bb,null));};exports[_0x43fc('0x48')]=function(_0x2b0823,_0xade318){return db[_0x43fc('0x2d')][_0x43fc('0x48')](_0x2b0823[_0x43fc('0x49')],{})['then'](respondWithResult(_0xade318,0xc9))['catch'](handleError(_0xade318,null));};exports[_0x43fc('0x4a')]=function(_0x2de1e9,_0x4a08d1){if(_0x2de1e9['body']['id']){delete _0x2de1e9[_0x43fc('0x49')]['id'];}return db['MailTransferReport'][_0x43fc('0x47')]({'where':{'id':_0x2de1e9['params']['id']}})[_0x43fc('0x25')](handleEntityNotFound(_0x4a08d1,null))[_0x43fc('0x25')](saveUpdates(_0x2de1e9['body'],null))[_0x43fc('0x25')](respondWithResult(_0x4a08d1,null))[_0x43fc('0x43')](handleError(_0x4a08d1,null));};exports[_0x43fc('0x26')]=function(_0x39c605,_0x173f51){return db[_0x43fc('0x2d')][_0x43fc('0x47')]({'where':{'id':_0x39c605['params']['id']}})[_0x43fc('0x25')](handleEntityNotFound(_0x173f51,null))[_0x43fc('0x25')](removeEntity(_0x173f51,null))['catch'](handleError(_0x173f51,null));};exports[_0x43fc('0x4b')]=function(_0x305e3d,_0x5b118b){return db[_0x43fc('0x2d')][_0x43fc('0x4b')]()[_0x43fc('0x25')](respondWithResult(_0x5b118b,null))[_0x43fc('0x43')](handleError(_0x5b118b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 98c739f..ff239c4 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 _0x53bb=['bluebird','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x53bb,0x168));var _0xb53b=function(_0x45b7af,_0x4fb95){_0x45b7af=_0x45b7af-0x0;var _0x388aea=_0x53bb[_0x45b7af];return _0x388aea;};'use strict';var _=require(_0xb53b('0x0'));var util=require(_0xb53b('0x1'));var logger=require('../../config/logger')(_0xb53b('0x2'));var moment=require(_0xb53b('0x3'));var BPromise=require(_0xb53b('0x4'));var rp=require(_0xb53b('0x5'));var fs=require('fs');var path=require(_0xb53b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb53b('0x7'));module[_0xb53b('0x8')]=function(_0x162d36,_0x2cbbe8){return _0x162d36[_0xb53b('0x9')](_0xb53b('0xa'),attributes,{'tableName':_0xb53b('0xb'),'paranoid':![],'indexes':[{'name':_0xb53b('0xc'),'fields':[_0xb53b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e0e=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x33c40b,_0x54dd71){var _0x4ad337=function(_0x482d9a){while(--_0x482d9a){_0x33c40b['push'](_0x33c40b['shift']());}};_0x4ad337(++_0x54dd71);}(_0x6e0e,0x90));var _0xe6e0=function(_0x40f711,_0xf33a45){_0x40f711=_0x40f711-0x0;var _0x55ea5e=_0x6e0e[_0x40f711];return _0x55ea5e;};'use strict';var _=require(_0xe6e0('0x0'));var util=require(_0xe6e0('0x1'));var logger=require(_0xe6e0('0x2'))(_0xe6e0('0x3'));var moment=require(_0xe6e0('0x4'));var BPromise=require('bluebird');var rp=require(_0xe6e0('0x5'));var fs=require('fs');var path=require(_0xe6e0('0x6'));var rimraf=require(_0xe6e0('0x7'));var config=require(_0xe6e0('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0xe6e0('0x9')]=function(_0x39fc49,_0x23c6d8){return _0x39fc49[_0xe6e0('0xa')](_0xe6e0('0xb'),attributes,{'tableName':_0xe6e0('0xc'),'paranoid':![],'indexes':[{'name':_0xe6e0('0xd'),'fields':[_0xe6e0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 656c3cd..9fb538d 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 _0x9273=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x581cca,_0x267baf){var _0x404814=function(_0x1f0e8b){while(--_0x1f0e8b){_0x581cca['push'](_0x581cca['shift']());}};_0x404814(++_0x267baf);}(_0x9273,0x163));var _0x3927=function(_0x25f805,_0x59caf3){_0x25f805=_0x25f805-0x0;var _0xf6628f=_0x9273[_0x25f805];return _0xf6628f;};'use strict';var _=require(_0x3927('0x0'));var util=require(_0x3927('0x1'));var moment=require(_0x3927('0x2'));var BPromise=require('bluebird');var rs=require(_0x3927('0x3'));var fs=require('fs');var Redis=require(_0x3927('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3927('0x5'))(_0x3927('0x6'));var config=require(_0x3927('0x7'));var jayson=require(_0x3927('0x8'));var client=jayson['client'][_0x3927('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x144b9f,_0x563317,_0x4627b1){return new BPromise(function(_0x1c23a0,_0x39e711){return client[_0x3927('0xa')](_0x144b9f,_0x4627b1)['then'](function(_0x48f274){logger['info'](_0x3927('0xb'),_0x563317,_0x3927('0xc'));logger[_0x3927('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x563317,_0x3927('0xc'),JSON[_0x3927('0xe')](_0x48f274));if(_0x48f274['error']){if(_0x48f274[_0x3927('0xf')][_0x3927('0x10')]===0x1f4){logger[_0x3927('0xf')](_0x3927('0xb'),_0x563317,_0x48f274[_0x3927('0xf')][_0x3927('0x11')]);return _0x39e711(_0x48f274[_0x3927('0xf')][_0x3927('0x11')]);}logger[_0x3927('0xf')](_0x3927('0xb'),_0x563317,_0x48f274[_0x3927('0xf')][_0x3927('0x11')]);return _0x1c23a0(_0x48f274[_0x3927('0xf')][_0x3927('0x11')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x563317,_0x3927('0xc'));_0x1c23a0(_0x48f274[_0x3927('0x12')][_0x3927('0x11')]);}})[_0x3927('0x13')](function(_0x5dfad4){logger[_0x3927('0xf')](_0x3927('0xb'),_0x563317,_0x5dfad4);_0x39e711(_0x5dfad4);});});} \ No newline at end of file +var _0xd2b2=['../../config/utils','rpc','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x5c4e1d,_0x5e8354){var _0x53d1ab=function(_0xd76dd2){while(--_0xd76dd2){_0x5c4e1d['push'](_0x5c4e1d['shift']());}};_0x53d1ab(++_0x5e8354);}(_0xd2b2,0x1f0));var _0x2d2b=function(_0x368202,_0x230c56){_0x368202=_0x368202-0x0;var _0x194e29=_0xd2b2[_0x368202];return _0x194e29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d2b('0x0'));var BPromise=require(_0x2d2b('0x1'));var rs=require(_0x2d2b('0x2'));var fs=require('fs');var Redis=require(_0x2d2b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d2b('0x4'));var logger=require('../../config/logger')(_0x2d2b('0x5'));var config=require('../../config/environment');var jayson=require(_0x2d2b('0x6'));var client=jayson[_0x2d2b('0x7')][_0x2d2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21d207,_0x582f94,_0x33dadc){return new BPromise(function(_0x2af5f8,_0x16d66c){return client[_0x2d2b('0x9')](_0x21d207,_0x33dadc)[_0x2d2b('0xa')](function(_0x5ba249){logger['info'](_0x2d2b('0xb'),_0x582f94,_0x2d2b('0xc'));logger['debug'](_0x2d2b('0xd'),_0x582f94,_0x2d2b('0xc'),JSON[_0x2d2b('0xe')](_0x5ba249));if(_0x5ba249['error']){if(_0x5ba249[_0x2d2b('0xf')]['code']===0x1f4){logger[_0x2d2b('0xf')](_0x2d2b('0xb'),_0x582f94,_0x5ba249[_0x2d2b('0xf')][_0x2d2b('0x10')]);return _0x16d66c(_0x5ba249[_0x2d2b('0xf')][_0x2d2b('0x10')]);}logger[_0x2d2b('0xf')](_0x2d2b('0xb'),_0x582f94,_0x5ba249['error']['message']);return _0x2af5f8(_0x5ba249[_0x2d2b('0xf')][_0x2d2b('0x10')]);}else{logger[_0x2d2b('0x11')](_0x2d2b('0xb'),_0x582f94,_0x2d2b('0xc'));_0x2af5f8(_0x5ba249[_0x2d2b('0x12')][_0x2d2b('0x10')]);}})[_0x2d2b('0x13')](function(_0x3c8925){logger['error'](_0x2d2b('0xb'),_0x582f94,_0x3c8925);_0x16d66c(_0x3c8925);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 1251987..dc863f8 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 _0xb302=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xb302,0x14b));var _0x2b30=function(_0x153424,_0x32fd9c){_0x153424=_0x153424-0x0;var _0x3132d1=_0xb302[_0x153424];return _0x3132d1;};'use strict';var multer=require('multer');var util=require(_0x2b30('0x0'));var path=require(_0x2b30('0x1'));var timeout=require(_0x2b30('0x2'));var express=require(_0x2b30('0x3'));var router=express[_0x2b30('0x4')]();var fs_extra=require(_0x2b30('0x5'));var auth=require(_0x2b30('0x6'));var interaction=require(_0x2b30('0x7'));var config=require(_0x2b30('0x8'));var controller=require('./memberReport.controller');router[_0x2b30('0x9')]('/',auth[_0x2b30('0xa')](),controller[_0x2b30('0xb')]);router[_0x2b30('0x9')](_0x2b30('0xc'),auth[_0x2b30('0xa')](),controller[_0x2b30('0xd')]);router[_0x2b30('0x9')]('/:id',auth[_0x2b30('0xa')](),controller[_0x2b30('0xe')]);router[_0x2b30('0xf')]('/',auth[_0x2b30('0xa')](),controller[_0x2b30('0x10')]);router['put'](_0x2b30('0x11'),auth[_0x2b30('0xa')](),controller[_0x2b30('0x12')]);router[_0x2b30('0x13')](_0x2b30('0x11'),auth[_0x2b30('0xa')](),controller[_0x2b30('0x14')]);module['exports']=router; \ No newline at end of file +var _0x191c=['show','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3b6de2,_0x6f004a){var _0x5523f7=function(_0x59738d){while(--_0x59738d){_0x3b6de2['push'](_0x3b6de2['shift']());}};_0x5523f7(++_0x6f004a);}(_0x191c,0x113));var _0xc191=function(_0xbcd7fc,_0x4d78eb){_0xbcd7fc=_0xbcd7fc-0x0;var _0x51f5db=_0x191c[_0xbcd7fc];return _0x51f5db;};'use strict';var multer=require(_0xc191('0x0'));var util=require(_0xc191('0x1'));var path=require(_0xc191('0x2'));var timeout=require('connect-timeout');var express=require(_0xc191('0x3'));var router=express[_0xc191('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc191('0x5'));var interaction=require(_0xc191('0x6'));var config=require(_0xc191('0x7'));var controller=require('./memberReport.controller');router[_0xc191('0x8')]('/',auth[_0xc191('0x9')](),controller[_0xc191('0xa')]);router[_0xc191('0x8')](_0xc191('0xb'),auth['isAuthenticated'](),controller[_0xc191('0xc')]);router[_0xc191('0x8')](_0xc191('0xd'),auth[_0xc191('0x9')](),controller[_0xc191('0xe')]);router['post']('/',auth[_0xc191('0x9')](),controller['create']);router[_0xc191('0xf')](_0xc191('0xd'),auth[_0xc191('0x9')](),controller['update']);router['delete'](_0xc191('0xd'),auth[_0xc191('0x9')](),controller[_0xc191('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 7fb81dd..30d95a9 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 _0xa516=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x4cec39,_0x418d97){var _0x53b18a=function(_0x4b562b){while(--_0x4b562b){_0x4cec39['push'](_0x4cec39['shift']());}};_0x53b18a(++_0x418d97);}(_0xa516,0x95));var _0x6a51=function(_0x4a93c8,_0xfa3d7a){_0x4a93c8=_0x4a93c8-0x0;var _0x3cb396=_0xa516[_0x4a93c8];return _0x3cb396;};'use strict';var Sequelize=require(_0x6a51('0x0'));var moment=require(_0x6a51('0x1'));module[_0x6a51('0x2')]={'channel':{'type':Sequelize[_0x6a51('0x3')]},'membername':{'type':Sequelize[_0x6a51('0x3')]},'interface':{'type':Sequelize[_0x6a51('0x3')]},'type':{'type':Sequelize[_0x6a51('0x3')],'defaultValue':_0x6a51('0x4'),'comment':_0x6a51('0x5')},'duration':{'type':Sequelize[_0x6a51('0x6')]},'enterAt':{'type':Sequelize[_0x6a51('0x7')]},'exitAt':{'type':Sequelize[_0x6a51('0x7')],'set':function(_0x538c21){var _0x3d99b9=moment(_0x538c21);var _0x527c79=moment(this[_0x6a51('0x8')]('enterAt'));var _0x45e5e9=_0x3d99b9[_0x6a51('0x9')](_0x527c79,'seconds');this[_0x6a51('0xa')]('exitAt',_0x538c21);this[_0x6a51('0xa')]('duration',_0x45e5e9>=0x0?_0x45e5e9:null);}},'data1':{'type':Sequelize[_0x6a51('0x3')],'comment':_0x6a51('0xb')},'data2':{'type':Sequelize[_0x6a51('0x3')],'comment':_0x6a51('0xc')},'data3':{'type':Sequelize[_0x6a51('0x3')],'comment':_0x6a51('0xd')},'data4':{'type':Sequelize[_0x6a51('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x6a51('0xe')},'role':{'type':Sequelize[_0x6a51('0x3')]},'internal':{'type':Sequelize[_0x6a51('0x6')]},'uniqueid':{'type':Sequelize[_0x6a51('0x3')]}}; \ No newline at end of file +var _0x447b=['sequelize','moment','STRING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x124b21,_0x418625){var _0x30bbe9=function(_0x39bfd0){while(--_0x39bfd0){_0x124b21['push'](_0x124b21['shift']());}};_0x30bbe9(++_0x418625);}(_0x447b,0xe1));var _0xb447=function(_0x15e99d,_0x234768){_0x15e99d=_0x15e99d-0x0;var _0x5bd347=_0x447b[_0x15e99d];return _0x5bd347;};'use strict';var Sequelize=require(_0xb447('0x0'));var moment=require(_0xb447('0x1'));module['exports']={'channel':{'type':Sequelize[_0xb447('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb447('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb447('0x3')]},'enterAt':{'type':Sequelize[_0xb447('0x4')]},'exitAt':{'type':Sequelize[_0xb447('0x4')],'set':function(_0x32684d){var _0x3725f5=moment(_0x32684d);var _0x3970eb=moment(this[_0xb447('0x5')](_0xb447('0x6')));var _0x54a17e=_0x3725f5[_0xb447('0x7')](_0x3970eb,'seconds');this[_0xb447('0x8')]('exitAt',_0x32684d);this['setDataValue'](_0xb447('0x9'),_0x54a17e>=0x0?_0x54a17e:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb447('0xa')},'data2':{'type':Sequelize[_0xb447('0x2')],'comment':_0xb447('0xb')},'data3':{'type':Sequelize[_0xb447('0x2')],'comment':_0xb447('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0xb447('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0xb447('0xe')},'role':{'type':Sequelize[_0xb447('0x2')]},'internal':{'type':Sequelize[_0xb447('0x3')]},'uniqueid':{'type':Sequelize[_0xb447('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index bebafbc..3d77dd5 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x451317,_0x308726){_0x451317=_0x451317-0x0;var _0x23ef5b=_0xedd9[_0x451317];return _0x23ef5b;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x44c583,_0xdc4d48){var _0x396a41=function(_0x1f3e0d){while(--_0x1f3e0d){_0x44c583['push'](_0x44c583['shift']());}};_0x396a41(++_0xdc4d48);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 7657ebd..575f480 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 _0xabdd=['define','MemberReport','report_member','membername_interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xabdd,0x82));var _0xdabd=function(_0x349338,_0x1a73b4){_0x349338=_0x349338-0x0;var _0x247eb7=_0xabdd[_0x349338];return _0x247eb7;};'use strict';var _=require(_0xdabd('0x0'));var util=require(_0xdabd('0x1'));var logger=require(_0xdabd('0x2'))(_0xdabd('0x3'));var moment=require('moment');var BPromise=require(_0xdabd('0x4'));var rp=require(_0xdabd('0x5'));var fs=require('fs');var path=require(_0xdabd('0x6'));var rimraf=require('rimraf');var config=require(_0xdabd('0x7'));var attributes=require(_0xdabd('0x8'));module[_0xdabd('0x9')]=function(_0x175415,_0x96a737){return _0x175415[_0xdabd('0xa')](_0xdabd('0xb'),attributes,{'tableName':_0xdabd('0xc'),'paranoid':![],'indexes':[{'name':_0xdabd('0xd'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x28b2=['request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2695dc,_0x37d5bd){var _0x5741d9=function(_0x28fcb2){while(--_0x28fcb2){_0x2695dc['push'](_0x2695dc['shift']());}};_0x5741d9(++_0x37d5bd);}(_0x28b2,0x1ad));var _0x228b=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x28b2[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x228b('0x0'));var util=require(_0x228b('0x1'));var logger=require(_0x228b('0x2'))(_0x228b('0x3'));var moment=require(_0x228b('0x4'));var BPromise=require(_0x228b('0x5'));var rp=require(_0x228b('0x6'));var fs=require('fs');var path=require(_0x228b('0x7'));var rimraf=require(_0x228b('0x8'));var config=require(_0x228b('0x9'));var attributes=require(_0x228b('0xa'));module['exports']=function(_0x42b663,_0x2210fe){return _0x42b663[_0x228b('0xb')](_0x228b('0xc'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x228b('0xd'),'fields':[_0x228b('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 2f200fc..433b5cb 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 _0x3c94=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','create','body','CreateMemberReport','UpdateMemberReport','update'];(function(_0x20d9db,_0x47e423){var _0x49428c=function(_0xe63db4){while(--_0xe63db4){_0x20d9db['push'](_0x20d9db['shift']());}};_0x49428c(++_0x47e423);}(_0x3c94,0xcd));var _0x43c9=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0x3c94[_0x151553];return _0x1a0ad6;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var moment=require(_0x43c9('0x2'));var BPromise=require(_0x43c9('0x3'));var rs=require(_0x43c9('0x4'));var fs=require('fs');var Redis=require(_0x43c9('0x5'));var db=require(_0x43c9('0x6'))['db'];var utils=require(_0x43c9('0x7'));var logger=require(_0x43c9('0x8'))(_0x43c9('0x9'));var config=require(_0x43c9('0xa'));var jayson=require(_0x43c9('0xb'));var client=jayson['client'][_0x43c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf03007,_0x695b4f,_0x37c029){return new BPromise(function(_0x383adb,_0x7a0f6b){return client[_0x43c9('0xd')](_0xf03007,_0x37c029)[_0x43c9('0xe')](function(_0x45f3a1){logger['info'](_0x43c9('0xf'),_0x695b4f,_0x43c9('0x10'));logger[_0x43c9('0x11')](_0x43c9('0x12'),_0x695b4f,_0x43c9('0x10'),JSON[_0x43c9('0x13')](_0x45f3a1));if(_0x45f3a1[_0x43c9('0x14')]){if(_0x45f3a1[_0x43c9('0x14')][_0x43c9('0x15')]===0x1f4){logger[_0x43c9('0x14')](_0x43c9('0xf'),_0x695b4f,_0x45f3a1[_0x43c9('0x14')][_0x43c9('0x16')]);return _0x7a0f6b(_0x45f3a1[_0x43c9('0x14')][_0x43c9('0x16')]);}logger[_0x43c9('0x14')](_0x43c9('0xf'),_0x695b4f,_0x45f3a1['error'][_0x43c9('0x16')]);return _0x383adb(_0x45f3a1[_0x43c9('0x14')][_0x43c9('0x16')]);}else{logger[_0x43c9('0x17')](_0x43c9('0xf'),_0x695b4f,'request\x20sent');_0x383adb(_0x45f3a1['result'][_0x43c9('0x16')]);}})[_0x43c9('0x18')](function(_0x15035a){logger[_0x43c9('0x14')]('MemberReport,\x20%s,\x20%s',_0x695b4f,_0x15035a);_0x7a0f6b(_0x15035a);});});}exports[_0x43c9('0x19')]=function(_0x1da149){var _0x38fe46=this;return new Promise(function(_0x22bf3d,_0xc14827){return db[_0x43c9('0x1a')][_0x43c9('0x1b')]({'raw':_0x1da149[_0x43c9('0x1c')]?_0x1da149[_0x43c9('0x1c')][_0x43c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x1da149[_0x43c9('0x1c')]?_0x1da149['options'][_0x43c9('0x1e')]||null:null,'attributes':_0x1da149[_0x43c9('0x1c')]?_0x1da149[_0x43c9('0x1c')]['attributes']||null:null,'limit':_0x1da149[_0x43c9('0x1c')]?_0x1da149[_0x43c9('0x1c')][_0x43c9('0x1f')]||null:null,'include':_0x1da149['options']?_0x1da149[_0x43c9('0x1c')][_0x43c9('0x20')]?_[_0x43c9('0x21')](_0x1da149['options']['include'],function(_0x2a40f4){return{'model':db[_0x2a40f4[_0x43c9('0x22')]],'as':_0x2a40f4['as'],'attributes':_0x2a40f4[_0x43c9('0x23')],'include':_0x2a40f4['include']?_[_0x43c9('0x21')](_0x2a40f4[_0x43c9('0x20')],function(_0x1e676a){return{'model':db[_0x1e676a[_0x43c9('0x22')]],'as':_0x1e676a['as'],'attributes':_0x1e676a[_0x43c9('0x23')],'include':_0x1e676a['include']?_[_0x43c9('0x21')](_0x1e676a[_0x43c9('0x20')],function(_0x3910af){return{'model':db[_0x3910af[_0x43c9('0x22')]],'as':_0x3910af['as'],'attributes':_0x3910af[_0x43c9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x43c9('0xe')](function(_0x40345f){logger[_0x43c9('0x17')](_0x43c9('0x19'),_0x1da149);logger[_0x43c9('0x11')]('GetMemberReport',_0x1da149,JSON[_0x43c9('0x13')](_0x40345f));_0x22bf3d(_0x40345f);})[_0x43c9('0x18')](function(_0x15028c){logger['error'](_0x43c9('0x19'),_0x15028c[_0x43c9('0x16')],_0x1da149);_0xc14827(_0x38fe46['error'](0x1f4,_0x15028c[_0x43c9('0x16')]));});});};exports['CreateMemberReport']=function(_0x28bf33){var _0x33ee11=this;return new Promise(function(_0x496b67,_0x2e285c){return db['MemberReport'][_0x43c9('0x24')](_0x28bf33[_0x43c9('0x25')],{'raw':_0x28bf33[_0x43c9('0x1c')]?_0x28bf33['options'][_0x43c9('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3622c0){logger[_0x43c9('0x17')](_0x43c9('0x26'),_0x28bf33);logger[_0x43c9('0x11')]('CreateMemberReport',_0x28bf33,JSON[_0x43c9('0x13')](_0x3622c0));_0x496b67(_0x3622c0);})[_0x43c9('0x18')](function(_0x465116){logger[_0x43c9('0x14')]('CreateMemberReport',_0x465116[_0x43c9('0x16')],_0x28bf33);_0x2e285c(_0x33ee11[_0x43c9('0x14')](0x1f4,_0x465116[_0x43c9('0x16')]));});});};exports[_0x43c9('0x27')]=function(_0x1511e0){var _0x1e3888=this;return new Promise(function(_0x7351da,_0x29713b){return db['MemberReport'][_0x43c9('0x28')](_0x1511e0[_0x43c9('0x25')],{'raw':_0x1511e0[_0x43c9('0x1c')]?_0x1511e0[_0x43c9('0x1c')][_0x43c9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1511e0[_0x43c9('0x1c')]?_0x1511e0[_0x43c9('0x1c')][_0x43c9('0x1e')]||null:null,'attributes':_0x1511e0[_0x43c9('0x1c')]?_0x1511e0['options'][_0x43c9('0x23')]||null:null,'limit':_0x1511e0['options']?_0x1511e0[_0x43c9('0x1c')][_0x43c9('0x1f')]||null:null})[_0x43c9('0xe')](function(_0x312bd4){logger[_0x43c9('0x17')](_0x43c9('0x27'),_0x1511e0);logger[_0x43c9('0x11')](_0x43c9('0x27'),_0x1511e0,JSON[_0x43c9('0x13')](_0x312bd4));_0x7351da(_0x312bd4);})['catch'](function(_0x3e6b15){logger[_0x43c9('0x14')]('UpdateMemberReport',_0x3e6b15[_0x43c9('0x16')],_0x1511e0);_0x29713b(_0x1e3888[_0x43c9('0x14')](0x1f4,_0x3e6b15[_0x43c9('0x16')]));});});}; \ No newline at end of file +var _0x74f3=['options','where','limit','include','map','model','attributes','then','CreateMemberReport','create','UpdateMemberReport','MemberReport','update','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','findAll'];(function(_0x24e6ce,_0x4c63ee){var _0x546c65=function(_0x4052af){while(--_0x4052af){_0x24e6ce['push'](_0x24e6ce['shift']());}};_0x546c65(++_0x4c63ee);}(_0x74f3,0x164));var _0x374f=function(_0x3e4d00,_0x3d537a){_0x3e4d00=_0x3e4d00-0x0;var _0x381753=_0x74f3[_0x3e4d00];return _0x381753;};'use strict';var _=require(_0x374f('0x0'));var util=require(_0x374f('0x1'));var moment=require(_0x374f('0x2'));var BPromise=require('bluebird');var rs=require(_0x374f('0x3'));var fs=require('fs');var Redis=require(_0x374f('0x4'));var db=require(_0x374f('0x5'))['db'];var utils=require(_0x374f('0x6'));var logger=require('../../config/logger')(_0x374f('0x7'));var config=require(_0x374f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x374f('0x9')][_0x374f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x405e93,_0x407df1,_0x3bcc86){return new BPromise(function(_0x394073,_0x32861f){return client[_0x374f('0xb')](_0x405e93,_0x3bcc86)['then'](function(_0x2b0d45){logger[_0x374f('0xc')](_0x374f('0xd'),_0x407df1,_0x374f('0xe'));logger[_0x374f('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x407df1,_0x374f('0xe'),JSON[_0x374f('0x10')](_0x2b0d45));if(_0x2b0d45['error']){if(_0x2b0d45[_0x374f('0x11')][_0x374f('0x12')]===0x1f4){logger[_0x374f('0x11')]('MemberReport,\x20%s,\x20%s',_0x407df1,_0x2b0d45[_0x374f('0x11')][_0x374f('0x13')]);return _0x32861f(_0x2b0d45['error'][_0x374f('0x13')]);}logger[_0x374f('0x11')]('MemberReport,\x20%s,\x20%s',_0x407df1,_0x2b0d45[_0x374f('0x11')]['message']);return _0x394073(_0x2b0d45[_0x374f('0x11')][_0x374f('0x13')]);}else{logger[_0x374f('0xc')](_0x374f('0xd'),_0x407df1,_0x374f('0xe'));_0x394073(_0x2b0d45[_0x374f('0x14')][_0x374f('0x13')]);}})[_0x374f('0x15')](function(_0x250e33){logger[_0x374f('0x11')](_0x374f('0xd'),_0x407df1,_0x250e33);_0x32861f(_0x250e33);});});}exports[_0x374f('0x16')]=function(_0x13c210){var _0x58cdc5=this;return new Promise(function(_0x55eb4f,_0xac879a){return db['MemberReport'][_0x374f('0x17')]({'raw':_0x13c210[_0x374f('0x18')]?_0x13c210[_0x374f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x13c210[_0x374f('0x18')]?_0x13c210['options'][_0x374f('0x19')]||null:null,'attributes':_0x13c210[_0x374f('0x18')]?_0x13c210[_0x374f('0x18')]['attributes']||null:null,'limit':_0x13c210[_0x374f('0x18')]?_0x13c210['options'][_0x374f('0x1a')]||null:null,'include':_0x13c210[_0x374f('0x18')]?_0x13c210[_0x374f('0x18')][_0x374f('0x1b')]?_[_0x374f('0x1c')](_0x13c210[_0x374f('0x18')]['include'],function(_0x4d7ccf){return{'model':db[_0x4d7ccf[_0x374f('0x1d')]],'as':_0x4d7ccf['as'],'attributes':_0x4d7ccf[_0x374f('0x1e')],'include':_0x4d7ccf[_0x374f('0x1b')]?_['map'](_0x4d7ccf['include'],function(_0x2d13e4){return{'model':db[_0x2d13e4['model']],'as':_0x2d13e4['as'],'attributes':_0x2d13e4['attributes'],'include':_0x2d13e4['include']?_['map'](_0x2d13e4[_0x374f('0x1b')],function(_0x253239){return{'model':db[_0x253239['model']],'as':_0x253239['as'],'attributes':_0x253239[_0x374f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x374f('0x1f')](function(_0x1ef2c9){logger[_0x374f('0xc')]('GetMemberReport',_0x13c210);logger[_0x374f('0xf')](_0x374f('0x16'),_0x13c210,JSON[_0x374f('0x10')](_0x1ef2c9));_0x55eb4f(_0x1ef2c9);})[_0x374f('0x15')](function(_0x2a21d6){logger[_0x374f('0x11')](_0x374f('0x16'),_0x2a21d6[_0x374f('0x13')],_0x13c210);_0xac879a(_0x58cdc5[_0x374f('0x11')](0x1f4,_0x2a21d6[_0x374f('0x13')]));});});};exports[_0x374f('0x20')]=function(_0x2b86e7){var _0x5614a0=this;return new Promise(function(_0x197746,_0x6a58da){return db['MemberReport'][_0x374f('0x21')](_0x2b86e7['body'],{'raw':_0x2b86e7[_0x374f('0x18')]?_0x2b86e7[_0x374f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x374f('0x1f')](function(_0x559794){logger[_0x374f('0xc')](_0x374f('0x20'),_0x2b86e7);logger[_0x374f('0xf')]('CreateMemberReport',_0x2b86e7,JSON[_0x374f('0x10')](_0x559794));_0x197746(_0x559794);})[_0x374f('0x15')](function(_0x2dab12){logger[_0x374f('0x11')]('CreateMemberReport',_0x2dab12[_0x374f('0x13')],_0x2b86e7);_0x6a58da(_0x5614a0[_0x374f('0x11')](0x1f4,_0x2dab12['message']));});});};exports[_0x374f('0x22')]=function(_0x4c1d04){var _0x5af952=this;return new Promise(function(_0x482e25,_0x1b84ac){return db[_0x374f('0x23')][_0x374f('0x24')](_0x4c1d04[_0x374f('0x25')],{'raw':_0x4c1d04[_0x374f('0x18')]?_0x4c1d04[_0x374f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1d04[_0x374f('0x18')]?_0x4c1d04['options']['where']||null:null,'attributes':_0x4c1d04[_0x374f('0x18')]?_0x4c1d04['options'][_0x374f('0x1e')]||null:null,'limit':_0x4c1d04['options']?_0x4c1d04['options'][_0x374f('0x1a')]||null:null})[_0x374f('0x1f')](function(_0x19d7a5){logger[_0x374f('0xc')](_0x374f('0x22'),_0x4c1d04);logger[_0x374f('0xf')](_0x374f('0x22'),_0x4c1d04,JSON[_0x374f('0x10')](_0x19d7a5));_0x482e25(_0x19d7a5);})['catch'](function(_0x3b20b5){logger['error'](_0x374f('0x22'),_0x3b20b5[_0x374f('0x13')],_0x4c1d04);_0x1b84ac(_0x5af952['error'](0x1f4,_0x3b20b5[_0x374f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 04c6a62..98594af 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 _0xe083=['get','index','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0xe083,0x1a6));var _0x3e08=function(_0x5df8ba,_0x594ac6){_0x5df8ba=_0x5df8ba-0x0;var _0x458845=_0xe083[_0x5df8ba];return _0x458845;};'use strict';var multer=require(_0x3e08('0x0'));var util=require(_0x3e08('0x1'));var path=require(_0x3e08('0x2'));var timeout=require(_0x3e08('0x3'));var express=require('express');var router=express[_0x3e08('0x4')]();var fs_extra=require(_0x3e08('0x5'));var auth=require(_0x3e08('0x6'));var interaction=require(_0x3e08('0x7'));var config=require(_0x3e08('0x8'));var controller=require(_0x3e08('0x9'));router[_0x3e08('0xa')]('/',controller[_0x3e08('0xb')]);module['exports']=router; \ No newline at end of file +var _0xb209=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./migration.controller','exports','multer','util','path'];(function(_0xde0518,_0x1d681f){var _0x2f3cd7=function(_0x4ea66d){while(--_0x4ea66d){_0xde0518['push'](_0xde0518['shift']());}};_0x2f3cd7(++_0x1d681f);}(_0xb209,0x151));var _0x9b20=function(_0x4a183e,_0x5a1db3){_0x4a183e=_0x4a183e-0x0;var _0x4bdd90=_0xb209[_0x4a183e];return _0x4bdd90;};'use strict';var multer=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var path=require(_0x9b20('0x2'));var timeout=require(_0x9b20('0x3'));var express=require(_0x9b20('0x4'));var router=express[_0x9b20('0x5')]();var fs_extra=require(_0x9b20('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b20('0x7'));var config=require('../../config/environment');var controller=require(_0x9b20('0x8'));router['get']('/',controller['index']);module[_0x9b20('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 892b4ef..0797e8a 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 _0x6542=['sequelize','exports','STRING','version'];(function(_0x3a2797,_0x1f905c){var _0x5c2d96=function(_0x3c7bd7){while(--_0x3c7bd7){_0x3a2797['push'](_0x3a2797['shift']());}};_0x5c2d96(++_0x1f905c);}(_0x6542,0x150));var _0x2654=function(_0x21ee16,_0x20a8a8){_0x21ee16=_0x21ee16-0x0;var _0x35bce5=_0x6542[_0x21ee16];return _0x35bce5;};'use strict';var Sequelize=require(_0x2654('0x0'));module[_0x2654('0x1')]={'version':{'type':Sequelize[_0x2654('0x2')],'unique':_0x2654('0x3')}}; \ No newline at end of file +var _0xca73=['STRING','version','sequelize','exports'];(function(_0x4efbd9,_0x42bd0f){var _0x2e8057=function(_0x2c170f){while(--_0x2c170f){_0x4efbd9['push'](_0x4efbd9['shift']());}};_0x2e8057(++_0x42bd0f);}(_0xca73,0x136));var _0x3ca7=function(_0x4ce65a,_0x13e1da){_0x4ce65a=_0x4ce65a-0x0;var _0x404022=_0xca73[_0x4ce65a];return _0x404022;};'use strict';var Sequelize=require(_0x3ca7('0x0'));module[_0x3ca7('0x1')]={'version':{'type':Sequelize[_0x3ca7('0x2')],'unique':_0x3ca7('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 83b8a4d..52a7adf 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 _0x36a7=['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','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','map','Migration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1bb17c,_0x3fd6d2){var _0x41b4ff=function(_0x606ec8){while(--_0x606ec8){_0x1bb17c['push'](_0x1bb17c['shift']());}};_0x41b4ff(++_0x3fd6d2);}(_0x36a7,0x1bc));var _0x736a=function(_0x3cfad5,_0x2fbdd3){_0x3cfad5=_0x3cfad5-0x0;var _0x2f57f1=_0x36a7[_0x3cfad5];return _0x2f57f1;};'use strict';var emlformat=require(_0x736a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x736a('0x1'));var rp=require(_0x736a('0x2'));var moment=require(_0x736a('0x3'));var BPromise=require(_0x736a('0x4'));var Mustache=require('mustache');var util=require(_0x736a('0x5'));var path=require(_0x736a('0x6'));var sox=require(_0x736a('0x7'));var csv=require(_0x736a('0x8'));var ejs=require(_0x736a('0x9'));var fs=require('fs');var fs_extra=require(_0x736a('0xa'));var _=require(_0x736a('0xb'));var squel=require('squel');var crypto=require(_0x736a('0xc'));var jsforce=require(_0x736a('0xd'));var deskjs=require(_0x736a('0xe'));var toCsv=require(_0x736a('0x8'));var querystring=require(_0x736a('0xf'));var Papa=require(_0x736a('0x10'));var Redis=require(_0x736a('0x11'));var authService=require(_0x736a('0x12'));var qs=require(_0x736a('0x13'));var as=require(_0x736a('0x14'));var hardwareService=require(_0x736a('0x15'));var logger=require(_0x736a('0x16'))('api');var utils=require(_0x736a('0x17'));var config=require(_0x736a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8577b3,_0x57bc11){_0x57bc11=_0x57bc11||0xcc;return function(_0x221fc0){if(_0x221fc0){return _0x8577b3['sendStatus'](_0x57bc11);}return _0x8577b3[_0x736a('0x19')](_0x57bc11)[_0x736a('0x1a')]();};}function respondWithResult(_0x38a0c4,_0x15679c){_0x15679c=_0x15679c||0xc8;return function(_0x15db72){if(_0x15db72){return _0x38a0c4['status'](_0x15679c)['json'](_0x15db72);}};}function respondWithFilteredResult(_0x44df13,_0x4fcc21){return function(_0x456b19){if(_0x456b19){var _0x548d42=typeof _0x4fcc21[_0x736a('0x1b')]===_0x736a('0x1c')&&typeof _0x4fcc21[_0x736a('0x1d')]===_0x736a('0x1c');var _0x5b343e=_0x456b19['count'];var _0x51d055=_0x548d42?0x0:_0x4fcc21[_0x736a('0x1b')];var _0x376aaf=_0x548d42?_0x456b19[_0x736a('0x1e')]:_0x4fcc21[_0x736a('0x1b')]+_0x4fcc21[_0x736a('0x1d')];var _0x26fcbe;if(_0x376aaf>=_0x5b343e){_0x376aaf=_0x5b343e;_0x26fcbe=0xc8;}else{_0x26fcbe=0xce;}_0x44df13['status'](_0x26fcbe);return _0x44df13[_0x736a('0x1f')](_0x736a('0x20'),_0x51d055+'-'+_0x376aaf+'/'+_0x5b343e)['json'](_0x456b19);}return null;};}function patchUpdates(_0x314030){return function(_0x2f79c8){try{jsonpatch[_0x736a('0x21')](_0x2f79c8,_0x314030,!![]);}catch(_0x4415a9){return BPromise['reject'](_0x4415a9);}return _0x2f79c8[_0x736a('0x22')]();};}function saveUpdates(_0x971c97,_0x409676){return function(_0x35421b){if(_0x35421b){return _0x35421b[_0x736a('0x23')](_0x971c97)['then'](function(_0x364651){return _0x364651;});}return null;};}function removeEntity(_0x3315d9,_0x18b54d){return function(_0x14b5aa){if(_0x14b5aa){return _0x14b5aa[_0x736a('0x24')]()[_0x736a('0x25')](function(){_0x3315d9[_0x736a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4b60,_0x5a8f2c){return function(_0x86dfa){if(!_0x86dfa){_0x1b4b60[_0x736a('0x26')](0x194);}return _0x86dfa;};}function handleError(_0x40b3ff,_0xfd335c){_0xfd335c=_0xfd335c||0x1f4;return function(_0x24a42a){logger[_0x736a('0x27')](_0x24a42a[_0x736a('0x28')]);if(_0x24a42a[_0x736a('0x29')]){delete _0x24a42a['name'];}_0x40b3ff['status'](_0xfd335c)['send'](_0x24a42a);};}exports['index']=function(_0x387ddd,_0x1ba44c){var _0x315b4b={},_0x3bd6f9={},_0x39433c={'count':0x0,'rows':[]};var _0x23716d=_[_0x736a('0x2a')](db[_0x736a('0x2b')][_0x736a('0x2c')],function(_0x5d4902){return{'name':_0x5d4902['fieldName'],'type':_0x5d4902[_0x736a('0x2d')]['key']};});_0x3bd6f9[_0x736a('0x2e')]=_[_0x736a('0x2a')](_0x23716d,_0x736a('0x29'));_0x3bd6f9[_0x736a('0x2f')]=_[_0x736a('0x30')](_0x387ddd['query']);_0x3bd6f9[_0x736a('0x31')]=_[_0x736a('0x32')](_0x3bd6f9['model'],_0x3bd6f9[_0x736a('0x2f')]);_0x315b4b[_0x736a('0x33')]=_[_0x736a('0x32')](_0x3bd6f9['model'],qs[_0x736a('0x34')](_0x387ddd['query']['fields']));_0x315b4b['attributes']=_0x315b4b[_0x736a('0x33')]['length']?_0x315b4b[_0x736a('0x33')]:_0x3bd6f9[_0x736a('0x2e')];if(!_0x387ddd['query'][_0x736a('0x35')](_0x736a('0x36'))){_0x315b4b[_0x736a('0x1d')]=qs['limit'](_0x387ddd[_0x736a('0x2f')][_0x736a('0x1d')]);_0x315b4b[_0x736a('0x1b')]=qs['offset'](_0x387ddd[_0x736a('0x2f')]['offset']);}_0x315b4b['order']=qs[_0x736a('0x37')](_0x387ddd[_0x736a('0x2f')][_0x736a('0x37')]);_0x315b4b[_0x736a('0x38')]=qs[_0x736a('0x31')](_[_0x736a('0x39')](_0x387ddd[_0x736a('0x2f')],_0x3bd6f9['filters']),_0x23716d);if(_0x387ddd[_0x736a('0x2f')][_0x736a('0x3a')]){_0x315b4b['where']=_['merge'](_0x315b4b['where'],{'$or':_[_0x736a('0x2a')](_0x23716d,function(_0x784aef){if(_0x784aef[_0x736a('0x2d')]!==_0x736a('0x3b')){var _0x11517b={};_0x11517b[_0x784aef[_0x736a('0x29')]]={'$like':'%'+_0x387ddd[_0x736a('0x2f')][_0x736a('0x3a')]+'%'};return _0x11517b;}})});}_0x315b4b=_['merge']({},_0x315b4b,_0x387ddd['options']);var _0x372082={'where':_0x315b4b['where']};return db[_0x736a('0x2b')][_0x736a('0x1e')](_0x372082)[_0x736a('0x25')](function(_0x3b89a4){_0x39433c[_0x736a('0x1e')]=_0x3b89a4;if(_0x387ddd[_0x736a('0x2f')][_0x736a('0x3c')]){_0x315b4b[_0x736a('0x3d')]=[{'all':!![]}];}return db['Migration'][_0x736a('0x3e')](_0x315b4b);})[_0x736a('0x25')](function(_0x4d5a7e){_0x39433c[_0x736a('0x3f')]=_0x4d5a7e;return _0x39433c;})[_0x736a('0x25')](respondWithFilteredResult(_0x1ba44c,_0x315b4b))[_0x736a('0x40')](handleError(_0x1ba44c,null));}; \ No newline at end of file +var _0x87ba=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','eml-format','rimraf','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','name','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x5a7d2d,_0x15f976){var _0x12487b=function(_0x3cbf9c){while(--_0x3cbf9c){_0x5a7d2d['push'](_0x5a7d2d['shift']());}};_0x12487b(++_0x15f976);}(_0x87ba,0x12b));var _0xa87b=function(_0x4eb6e3,_0x555008){_0x4eb6e3=_0x4eb6e3-0x0;var _0x11bd33=_0x87ba[_0x4eb6e3];return _0x11bd33;};'use strict';var emlformat=require(_0xa87b('0x0'));var rimraf=require(_0xa87b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa87b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa87b('0x3'));var path=require(_0xa87b('0x4'));var sox=require(_0xa87b('0x5'));var csv=require(_0xa87b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa87b('0x7'));var _=require(_0xa87b('0x8'));var squel=require(_0xa87b('0x9'));var crypto=require(_0xa87b('0xa'));var jsforce=require(_0xa87b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa87b('0xc'));var Redis=require('ioredis');var authService=require(_0xa87b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa87b('0xe'));var logger=require('../../config/logger')(_0xa87b('0xf'));var utils=require('../../config/utils');var config=require(_0xa87b('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336271,_0x3e2c0d){_0x3e2c0d=_0x3e2c0d||0xcc;return function(_0x24ab96){if(_0x24ab96){return _0x336271[_0xa87b('0x11')](_0x3e2c0d);}return _0x336271[_0xa87b('0x12')](_0x3e2c0d)[_0xa87b('0x13')]();};}function respondWithResult(_0x1032ad,_0x45ee11){_0x45ee11=_0x45ee11||0xc8;return function(_0x4587f3){if(_0x4587f3){return _0x1032ad[_0xa87b('0x12')](_0x45ee11)[_0xa87b('0x14')](_0x4587f3);}};}function respondWithFilteredResult(_0x482f4d,_0x343f60){return function(_0x4dc785){if(_0x4dc785){var _0x52c7be=typeof _0x343f60['offset']==='undefined'&&typeof _0x343f60['limit']===_0xa87b('0x15');var _0x14af1c=_0x4dc785['count'];var _0x1dedb8=_0x52c7be?0x0:_0x343f60[_0xa87b('0x16')];var _0x40c261=_0x52c7be?_0x4dc785[_0xa87b('0x17')]:_0x343f60['offset']+_0x343f60[_0xa87b('0x18')];var _0x3465a9;if(_0x40c261>=_0x14af1c){_0x40c261=_0x14af1c;_0x3465a9=0xc8;}else{_0x3465a9=0xce;}_0x482f4d[_0xa87b('0x12')](_0x3465a9);return _0x482f4d[_0xa87b('0x19')](_0xa87b('0x1a'),_0x1dedb8+'-'+_0x40c261+'/'+_0x14af1c)[_0xa87b('0x14')](_0x4dc785);}return null;};}function patchUpdates(_0x55e0a0){return function(_0x32ed94){try{jsonpatch[_0xa87b('0x1b')](_0x32ed94,_0x55e0a0,!![]);}catch(_0x391fb4){return BPromise[_0xa87b('0x1c')](_0x391fb4);}return _0x32ed94[_0xa87b('0x1d')]();};}function saveUpdates(_0x44f6f0,_0x37958f){return function(_0x2fa9d7){if(_0x2fa9d7){return _0x2fa9d7['update'](_0x44f6f0)['then'](function(_0x5f145c){return _0x5f145c;});}return null;};}function removeEntity(_0x88f428,_0x16cf20){return function(_0x5f2a5d){if(_0x5f2a5d){return _0x5f2a5d[_0xa87b('0x1e')]()[_0xa87b('0x1f')](function(){_0x88f428['status'](0xcc)[_0xa87b('0x13')]();});}};}function handleEntityNotFound(_0x4bed17,_0x224e7c){return function(_0x59f31b){if(!_0x59f31b){_0x4bed17['sendStatus'](0x194);}return _0x59f31b;};}function handleError(_0x537dc2,_0x5f2574){_0x5f2574=_0x5f2574||0x1f4;return function(_0x574f1a){logger[_0xa87b('0x20')](_0x574f1a['stack']);if(_0x574f1a[_0xa87b('0x21')]){delete _0x574f1a[_0xa87b('0x21')];}_0x537dc2[_0xa87b('0x12')](_0x5f2574)['send'](_0x574f1a);};}exports[_0xa87b('0x22')]=function(_0x40b2e9,_0x321088){var _0x5cd3cc={},_0x184979={},_0x3a90c4={'count':0x0,'rows':[]};var _0x429b47=_[_0xa87b('0x23')](db[_0xa87b('0x24')][_0xa87b('0x25')],function(_0x33083e){return{'name':_0x33083e[_0xa87b('0x26')],'type':_0x33083e[_0xa87b('0x27')][_0xa87b('0x28')]};});_0x184979[_0xa87b('0x29')]=_['map'](_0x429b47,_0xa87b('0x21'));_0x184979[_0xa87b('0x2a')]=_[_0xa87b('0x2b')](_0x40b2e9[_0xa87b('0x2a')]);_0x184979[_0xa87b('0x2c')]=_['intersection'](_0x184979['model'],_0x184979[_0xa87b('0x2a')]);_0x5cd3cc['attributes']=_[_0xa87b('0x2d')](_0x184979[_0xa87b('0x29')],qs[_0xa87b('0x2e')](_0x40b2e9[_0xa87b('0x2a')]['fields']));_0x5cd3cc[_0xa87b('0x2f')]=_0x5cd3cc['attributes'][_0xa87b('0x30')]?_0x5cd3cc['attributes']:_0x184979['model'];if(!_0x40b2e9[_0xa87b('0x2a')][_0xa87b('0x31')](_0xa87b('0x32'))){_0x5cd3cc[_0xa87b('0x18')]=qs[_0xa87b('0x18')](_0x40b2e9[_0xa87b('0x2a')]['limit']);_0x5cd3cc['offset']=qs['offset'](_0x40b2e9[_0xa87b('0x2a')][_0xa87b('0x16')]);}_0x5cd3cc[_0xa87b('0x33')]=qs['sort'](_0x40b2e9['query'][_0xa87b('0x34')]);_0x5cd3cc[_0xa87b('0x35')]=qs[_0xa87b('0x2c')](_[_0xa87b('0x36')](_0x40b2e9[_0xa87b('0x2a')],_0x184979[_0xa87b('0x2c')]),_0x429b47);if(_0x40b2e9[_0xa87b('0x2a')][_0xa87b('0x37')]){_0x5cd3cc[_0xa87b('0x35')]=_['merge'](_0x5cd3cc[_0xa87b('0x35')],{'$or':_['map'](_0x429b47,function(_0x1f07da){if(_0x1f07da[_0xa87b('0x27')]!=='VIRTUAL'){var _0x187383={};_0x187383[_0x1f07da['name']]={'$like':'%'+_0x40b2e9[_0xa87b('0x2a')][_0xa87b('0x37')]+'%'};return _0x187383;}})});}_0x5cd3cc=_[_0xa87b('0x38')]({},_0x5cd3cc,_0x40b2e9['options']);var _0xcded0c={'where':_0x5cd3cc['where']};return db['Migration'][_0xa87b('0x17')](_0xcded0c)['then'](function(_0x164df7){_0x3a90c4[_0xa87b('0x17')]=_0x164df7;if(_0x40b2e9[_0xa87b('0x2a')][_0xa87b('0x39')]){_0x5cd3cc['include']=[{'all':!![]}];}return db[_0xa87b('0x24')]['findAll'](_0x5cd3cc);})[_0xa87b('0x1f')](function(_0x112865){_0x3a90c4['rows']=_0x112865;return _0x3a90c4;})[_0xa87b('0x1f')](respondWithFilteredResult(_0x321088,_0x5cd3cc))['catch'](handleError(_0x321088,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 4061e7e..a8a12d1 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 _0xbe0b=['./migration.attributes','exports','define','Migration','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x5e75f0,_0x27f703){var _0x182d6c=function(_0xeec54b){while(--_0xeec54b){_0x5e75f0['push'](_0x5e75f0['shift']());}};_0x182d6c(++_0x27f703);}(_0xbe0b,0xf6));var _0xbbe0=function(_0x748eb7,_0x1ce52b){_0x748eb7=_0x748eb7-0x0;var _0x2d7e18=_0xbe0b[_0x748eb7];return _0x2d7e18;};'use strict';var _=require(_0xbbe0('0x0'));var util=require(_0xbbe0('0x1'));var logger=require('../../config/logger')(_0xbbe0('0x2'));var moment=require(_0xbbe0('0x3'));var BPromise=require('bluebird');var rp=require(_0xbbe0('0x4'));var fs=require('fs');var path=require(_0xbbe0('0x5'));var rimraf=require(_0xbbe0('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbe0('0x7'));module[_0xbbe0('0x8')]=function(_0x5c9b9e,_0x49ad3b){return _0x5c9b9e[_0xbbe0('0x9')](_0xbbe0('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x952f=['rimraf','../../config/environment','exports','define','Migration','migrations','util','../../config/logger','moment','path'];(function(_0x3e2936,_0x1d57a9){var _0x35d87a=function(_0x19dd6a){while(--_0x19dd6a){_0x3e2936['push'](_0x3e2936['shift']());}};_0x35d87a(++_0x1d57a9);}(_0x952f,0x132));var _0xf952=function(_0x32be62,_0x22e6fd){_0x32be62=_0x32be62-0x0;var _0x1a37e9=_0x952f[_0x32be62];return _0x1a37e9;};'use strict';var _=require('lodash');var util=require(_0xf952('0x0'));var logger=require(_0xf952('0x1'))('api');var moment=require(_0xf952('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf952('0x3'));var rimraf=require(_0xf952('0x4'));var config=require(_0xf952('0x5'));var attributes=require('./migration.attributes');module[_0xf952('0x6')]=function(_0x4f8c05,_0x32edbe){return _0x4f8c05[_0xf952('0x7')](_0xf952('0x8'),attributes,{'tableName':_0xf952('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 f575e9b..97486f1 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 _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x50694c,_0x97a97d){_0x50694c=_0x50694c-0x0;var _0x33111e=_0xbc9d[_0x50694c];return _0x33111e;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('Migration,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});} \ No newline at end of file +var _0x1782=['info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x29c442,_0x1a414a){var _0x2b80bc=function(_0x384557){while(--_0x384557){_0x29c442['push'](_0x29c442['shift']());}};_0x2b80bc(++_0x1a414a);}(_0x1782,0x13e));var _0x2178=function(_0x1d628d,_0x325eb9){_0x1d628d=_0x1d628d-0x0;var _0x3eff3d=_0x1782[_0x1d628d];return _0x3eff3d;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('Migration,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('Migration,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0a52a18..fec4d06 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 _0x35a6=['show','post','create','put','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0x35a6,0x122));var _0x635a=function(_0x4e4ece,_0x10bb56){_0x4e4ece=_0x4e4ece-0x0;var _0x2cdc7a=_0x35a6[_0x4e4ece];return _0x2cdc7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x635a('0x0'));var timeout=require(_0x635a('0x1'));var express=require(_0x635a('0x2'));var router=express[_0x635a('0x3')]();var fs_extra=require(_0x635a('0x4'));var auth=require(_0x635a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x635a('0x6')](),controller[_0x635a('0x7')]);router[_0x635a('0x8')](_0x635a('0x9'),auth[_0x635a('0x6')](),controller[_0x635a('0xa')]);router[_0x635a('0xb')]('/',auth[_0x635a('0x6')](),controller[_0x635a('0xc')]);router[_0x635a('0xd')](_0x635a('0x9'),auth[_0x635a('0x6')](),controller['update']);router['delete'](_0x635a('0x9'),auth[_0x635a('0x6')](),controller[_0x635a('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe98c=['get','isAuthenticated','/:id','post','create','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x1975e1,_0x30d279){var _0xda0396=function(_0x2a4f00){while(--_0x2a4f00){_0x1975e1['push'](_0x1975e1['shift']());}};_0xda0396(++_0x30d279);}(_0xe98c,0xd3));var _0xce98=function(_0x201cac,_0x34b104){_0x201cac=_0x201cac-0x0;var _0x1a322e=_0xe98c[_0x201cac];return _0x1a322e;};'use strict';var multer=require(_0xce98('0x0'));var util=require(_0xce98('0x1'));var path=require(_0xce98('0x2'));var timeout=require(_0xce98('0x3'));var express=require(_0xce98('0x4'));var router=express['Router']();var fs_extra=require(_0xce98('0x5'));var auth=require(_0xce98('0x6'));var interaction=require(_0xce98('0x7'));var config=require(_0xce98('0x8'));var controller=require(_0xce98('0x9'));router[_0xce98('0xa')]('/',auth[_0xce98('0xb')](),controller['index']);router[_0xce98('0xa')](_0xce98('0xc'),auth[_0xce98('0xb')](),controller['show']);router[_0xce98('0xd')]('/',auth['isAuthenticated'](),controller[_0xce98('0xe')]);router['put'](_0xce98('0xc'),auth[_0xce98('0xb')](),controller[_0xce98('0xf')]);router['delete'](_0xce98('0xc'),auth[_0xce98('0xb')](),controller[_0xce98('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 9fc841d..70ac4fd 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 _0xff03=['STRING','sequelize','ENUM','externip','stun'];(function(_0x2853b6,_0x13e82b){var _0x5f01f6=function(_0x48c041){while(--_0x48c041){_0x2853b6['push'](_0x2853b6['shift']());}};_0x5f01f6(++_0x13e82b);}(_0xff03,0x1cd));var _0x3ff0=function(_0x5d78e,_0x40c041){_0x5d78e=_0x5d78e-0x0;var _0x24a61b=_0xff03[_0x5d78e];return _0x24a61b;};'use strict';var Sequelize=require(_0x3ff0('0x0'));module['exports']={'type':{'type':Sequelize[_0x3ff0('0x1')]('localnet',_0x3ff0('0x2'),_0x3ff0('0x3'),'turn')},'value':{'type':Sequelize[_0x3ff0('0x4')]},'username':{'type':Sequelize[_0x3ff0('0x4')]},'password':{'type':Sequelize[_0x3ff0('0x4')]}}; \ No newline at end of file +var _0xcd97=['STRING','sequelize','exports','ENUM','localnet','turn'];(function(_0x5430fa,_0x32cd7f){var _0x4900d4=function(_0x45ccd7){while(--_0x45ccd7){_0x5430fa['push'](_0x5430fa['shift']());}};_0x4900d4(++_0x32cd7f);}(_0xcd97,0xa3));var _0x7cd9=function(_0x3d3c7b,_0x4c3a7b){_0x3d3c7b=_0x3d3c7b-0x0;var _0x3dd92f=_0xcd97[_0x3d3c7b];return _0x3dd92f;};'use strict';var Sequelize=require(_0x7cd9('0x0'));module[_0x7cd9('0x1')]={'type':{'type':Sequelize[_0x7cd9('0x2')](_0x7cd9('0x3'),'externip','stun',_0x7cd9('0x4'))},'value':{'type':Sequelize[_0x7cd9('0x5')]},'username':{'type':Sequelize[_0x7cd9('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 1c1b161..0b24d3d 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 _0x791b=['info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','index','Network','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','transaction','body','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','sequelize','STUN','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x791b,0xc3));var _0xb791=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x791b[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xb791('0x0'));var rimraf=require(_0xb791('0x1'));var zipdir=require(_0xb791('0x2'));var jsonpatch=require(_0xb791('0x3'));var rp=require(_0xb791('0x4'));var moment=require(_0xb791('0x5'));var BPromise=require(_0xb791('0x6'));var Mustache=require(_0xb791('0x7'));var util=require(_0xb791('0x8'));var path=require(_0xb791('0x9'));var sox=require(_0xb791('0xa'));var csv=require(_0xb791('0xb'));var ejs=require(_0xb791('0xc'));var fs=require('fs');var fs_extra=require(_0xb791('0xd'));var _=require(_0xb791('0xe'));var squel=require(_0xb791('0xf'));var crypto=require(_0xb791('0x10'));var jsforce=require(_0xb791('0x11'));var deskjs=require(_0xb791('0x12'));var toCsv=require(_0xb791('0xb'));var querystring=require(_0xb791('0x13'));var Papa=require(_0xb791('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb791('0x15'));var as=require(_0xb791('0x16'));var hardwareService=require(_0xb791('0x17'));var logger=require(_0xb791('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xb791('0x19'));var licenseUtil=require(_0xb791('0x1a'));var db=require(_0xb791('0x1b'))['db'];var jayson=require(_0xb791('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f41f9,_0x58cf3e,_0x123185,_0x16f654){return new BPromise(function(_0x524bd0,_0x21b8eb){var _0x1d5215=_0x16f654||client;return _0x1d5215[_0xb791('0x1d')](_0x2f41f9,_0x123185)[_0xb791('0x1e')](function(_0x273196){logger[_0xb791('0x1f')](_0xb791('0x20'),_0x58cf3e,_0xb791('0x21'));logger[_0xb791('0x22')](_0xb791('0x23'),_0x58cf3e,_0xb791('0x21'),JSON[_0xb791('0x24')](_0x273196));if(_0x273196[_0xb791('0x25')]){if(_0x273196[_0xb791('0x25')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x58cf3e,_0x273196[_0xb791('0x25')][_0xb791('0x26')]);return _0x21b8eb(_0x273196['error']['message']);}logger[_0xb791('0x25')]('Network,\x20%s,\x20%s',_0x58cf3e,_0x273196[_0xb791('0x25')]['message']);return _0x524bd0(_0x273196[_0xb791('0x25')]['message']);}else{logger[_0xb791('0x1f')](_0xb791('0x20'),_0x58cf3e,_0xb791('0x21'));_0x524bd0(_0x273196[_0xb791('0x27')]['message']);}})[_0xb791('0x28')](function(_0x593dbe){logger[_0xb791('0x25')](_0xb791('0x20'),_0x58cf3e,_0x593dbe);_0x21b8eb(_0x593dbe);});});}function respondWithStatusCode(_0x57ba30,_0x2f49aa){_0x2f49aa=_0x2f49aa||0xcc;return function(_0x466251){if(_0x466251){return _0x57ba30[_0xb791('0x29')](_0x2f49aa);}return _0x57ba30[_0xb791('0x2a')](_0x2f49aa)[_0xb791('0x2b')]();};}function respondWithResult(_0x48697d,_0x21d9b9){_0x21d9b9=_0x21d9b9||0xc8;return function(_0x14c2c1){if(_0x14c2c1){return _0x48697d[_0xb791('0x2a')](_0x21d9b9)[_0xb791('0x2c')](_0x14c2c1);}};}function respondWithFilteredResult(_0x40970c,_0x41fb7b){return function(_0x16d987){if(_0x16d987){var _0x320224=typeof _0x41fb7b[_0xb791('0x2d')]===_0xb791('0x2e')&&typeof _0x41fb7b[_0xb791('0x2f')]===_0xb791('0x2e');var _0x192af5=_0x16d987[_0xb791('0x30')];var _0x33c6be=_0x320224?0x0:_0x41fb7b['offset'];var _0x1d15cc=_0x320224?_0x16d987[_0xb791('0x30')]:_0x41fb7b[_0xb791('0x2d')]+_0x41fb7b[_0xb791('0x2f')];var _0x4eba42;if(_0x1d15cc>=_0x192af5){_0x1d15cc=_0x192af5;_0x4eba42=0xc8;}else{_0x4eba42=0xce;}_0x40970c[_0xb791('0x2a')](_0x4eba42);return _0x40970c[_0xb791('0x31')](_0xb791('0x32'),_0x33c6be+'-'+_0x1d15cc+'/'+_0x192af5)[_0xb791('0x2c')](_0x16d987);}return null;};}function patchUpdates(_0x19ee21){return function(_0x490d2a){try{jsonpatch[_0xb791('0x33')](_0x490d2a,_0x19ee21,!![]);}catch(_0x42b42f){return BPromise[_0xb791('0x34')](_0x42b42f);}return _0x490d2a[_0xb791('0x35')]();};}function saveUpdates(_0x4fd350,_0x55102f){return function(_0x2b047f){if(_0x2b047f){return _0x2b047f['update'](_0x4fd350)['then'](function(_0x44ea11){return _0x44ea11;});}return null;};}function removeEntity(_0x520299,_0x59311c){return function(_0x545369){if(_0x545369){return _0x545369[_0xb791('0x36')]()[_0xb791('0x1e')](function(){_0x520299[_0xb791('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d6fde,_0x2c41b2){return function(_0xa738f3){if(!_0xa738f3){_0x1d6fde[_0xb791('0x29')](0x194);}return _0xa738f3;};}function handleError(_0x3a0391,_0x498d09){_0x498d09=_0x498d09||0x1f4;return function(_0x367d11){logger[_0xb791('0x25')](_0x367d11[_0xb791('0x37')]);if(_0x367d11['name']){delete _0x367d11[_0xb791('0x38')];}_0x3a0391[_0xb791('0x2a')](_0x498d09)['send'](_0x367d11);};}exports[_0xb791('0x39')]=function(_0x9126e4,_0x212cc0){var _0x41da3f={},_0x4063c6={},_0x9ba93b={'count':0x0,'rows':[]};var _0x2db153=_['map'](db[_0xb791('0x3a')][_0xb791('0x3b')],function(_0x37977e){return{'name':_0x37977e[_0xb791('0x3c')],'type':_0x37977e[_0xb791('0x3d')][_0xb791('0x3e')]};});_0x4063c6['model']=_[_0xb791('0x3f')](_0x2db153,_0xb791('0x38'));_0x4063c6['query']=_['keys'](_0x9126e4[_0xb791('0x40')]);_0x4063c6['filters']=_[_0xb791('0x41')](_0x4063c6[_0xb791('0x42')],_0x4063c6[_0xb791('0x40')]);_0x41da3f[_0xb791('0x43')]=_[_0xb791('0x41')](_0x4063c6['model'],qs[_0xb791('0x44')](_0x9126e4[_0xb791('0x40')][_0xb791('0x44')]));_0x41da3f[_0xb791('0x43')]=_0x41da3f['attributes'][_0xb791('0x45')]?_0x41da3f[_0xb791('0x43')]:_0x4063c6[_0xb791('0x42')];if(!_0x9126e4[_0xb791('0x40')][_0xb791('0x46')](_0xb791('0x47'))){_0x41da3f[_0xb791('0x2f')]=qs[_0xb791('0x2f')](_0x9126e4[_0xb791('0x40')][_0xb791('0x2f')]);_0x41da3f[_0xb791('0x2d')]=qs[_0xb791('0x2d')](_0x9126e4[_0xb791('0x40')][_0xb791('0x2d')]);}_0x41da3f[_0xb791('0x48')]=qs[_0xb791('0x49')](_0x9126e4[_0xb791('0x40')]['sort']);_0x41da3f[_0xb791('0x4a')]=qs[_0xb791('0x4b')](_['pick'](_0x9126e4[_0xb791('0x40')],_0x4063c6[_0xb791('0x4b')]),_0x2db153);if(_0x9126e4[_0xb791('0x40')]['filter']){_0x41da3f['where']=_[_0xb791('0x4c')](_0x41da3f['where'],{'$or':_[_0xb791('0x3f')](_0x2db153,function(_0xaa2895){if(_0xaa2895[_0xb791('0x3d')]!==_0xb791('0x4d')){var _0x363cda={};_0x363cda[_0xaa2895[_0xb791('0x38')]]={'$like':'%'+_0x9126e4[_0xb791('0x40')][_0xb791('0x4e')]+'%'};return _0x363cda;}})});}_0x41da3f=_[_0xb791('0x4c')]({},_0x41da3f,_0x9126e4[_0xb791('0x4f')]);var _0x193fcb={'where':_0x41da3f[_0xb791('0x4a')]};return db[_0xb791('0x3a')][_0xb791('0x30')](_0x193fcb)[_0xb791('0x1e')](function(_0x116b4f){_0x9ba93b['count']=_0x116b4f;if(_0x9126e4['query'][_0xb791('0x50')]){_0x41da3f[_0xb791('0x51')]=[{'all':!![]}];}return db[_0xb791('0x3a')][_0xb791('0x52')](_0x41da3f);})[_0xb791('0x1e')](function(_0xfd1edf){_0x9ba93b[_0xb791('0x53')]=_0xfd1edf;return _0x9ba93b;})[_0xb791('0x1e')](respondWithFilteredResult(_0x212cc0,_0x41da3f))['catch'](handleError(_0x212cc0,null));};exports[_0xb791('0x54')]=function(_0x603f7a,_0x3b2b85){var _0x245914={'raw':!![],'where':{'id':_0x603f7a[_0xb791('0x55')]['id']}},_0x2cdf6f={};_0x2cdf6f['model']=_[_0xb791('0x56')](db['Network'][_0xb791('0x3b')]);_0x2cdf6f[_0xb791('0x40')]=_['keys'](_0x603f7a[_0xb791('0x40')]);_0x2cdf6f[_0xb791('0x4b')]=_[_0xb791('0x41')](_0x2cdf6f[_0xb791('0x42')],_0x2cdf6f['query']);_0x245914['attributes']=_[_0xb791('0x41')](_0x2cdf6f['model'],qs['fields'](_0x603f7a[_0xb791('0x40')]['fields']));_0x245914[_0xb791('0x43')]=_0x245914[_0xb791('0x43')]['length']?_0x245914[_0xb791('0x43')]:_0x2cdf6f[_0xb791('0x42')];if(_0x603f7a[_0xb791('0x40')]['includeAll']){_0x245914[_0xb791('0x51')]=[{'all':!![]}];}_0x245914=_[_0xb791('0x4c')]({},_0x245914,_0x603f7a['options']);return db[_0xb791('0x3a')][_0xb791('0x57')](_0x245914)[_0xb791('0x1e')](handleEntityNotFound(_0x3b2b85,null))['then'](respondWithResult(_0x3b2b85,null))[_0xb791('0x28')](handleError(_0x3b2b85,null));};exports['create']=function(_0x352fff,_0x19cff6,_0x20f11f){var _0x30157e;return db['sequelize'][_0xb791('0x58')](function(_0x50727d){return db[_0xb791('0x3a')]['create'](_0x352fff[_0xb791('0x59')],{'raw':!![]})[_0xb791('0x1e')](function(_0x5a4b8b){_0x30157e=_0x5a4b8b;return db['Network']['findAll']({'where':{'type':_0x352fff['body'][_0xb791('0x3d')]},'raw':!![]});})[_0xb791('0x1e')](function(_0x24c9c3){if(_0x30157e[_0xb791('0x3d')][_0xb791('0x5a')]()=='STUN'){var _0xe8a81=fs['readFileSync'](path[_0xb791('0x5b')](config[_0xb791('0x5c')],'server/files/templates/stun_multiple.ejs'),_0xb791('0x5d'));var _0x58dcdb=ejs[_0xb791('0x5e')](_0xe8a81,{'networks':_0x24c9c3||[]});fs[_0xb791('0x5f')](_0xb791('0x60'),_0x58dcdb);return respondWithRpcPromise(_0xb791('0x61'),_0xb791('0x62'),{'module':_0xb791('0x63')});}else if(_0x30157e['type'][_0xb791('0x5a')]()==_0xb791('0x64')){var _0x516d5c=fs[_0xb791('0x65')](path['join'](config['root'],_0xb791('0x66')),_0xb791('0x5d'));var _0x3873ec=ejs[_0xb791('0x5e')](_0x516d5c,{'networks':_0x24c9c3||[]});fs[_0xb791('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x3873ec);return respondWithRpcPromise(_0xb791('0x61'),'create',{'module':_0xb791('0x63')});}else{var _0x2082f4=fs[_0xb791('0x65')](path[_0xb791('0x5b')](config['root'],_0xb791('0x67')),_0xb791('0x5d'));var _0x22c70e=ejs['render'](_0x2082f4,{'networks':_0x24c9c3||[]});fs['writeFileSync'](util[_0xb791('0x68')](_0xb791('0x69'),_0x352fff['body']['type'][_0xb791('0x6a')]()),_0x22c70e);return respondWithRpcPromise('Reload','create',{'module':_0xb791('0x6b')});}return null;})[_0xb791('0x1e')](function(){return _0x30157e;});})['then'](respondWithResult(_0x19cff6,0xc9))[_0xb791('0x28')](handleError(_0x19cff6,null));};exports[_0xb791('0x6c')]=function(_0x74ecaa,_0x21c46b,_0x134006){var _0x5068b2;return db[_0xb791('0x6d')][_0xb791('0x58')](function(_0x4e0e76){return db['Network'][_0xb791('0x57')]({'where':{'id':_0x74ecaa[_0xb791('0x55')]['id']}})['then'](handleEntityNotFound(_0x21c46b,null))['then'](saveUpdates(_0x74ecaa[_0xb791('0x59')],null))[_0xb791('0x1e')](function(_0x41642b){if(_0x41642b){_0x5068b2=_0x41642b;return db[_0xb791('0x3a')][_0xb791('0x52')]({'where':{'type':_0x5068b2[_0xb791('0x3d')]},'raw':!![]});}return null;})[_0xb791('0x1e')](function(_0x14e2c7){if(_0x5068b2[_0xb791('0x3d')]['toUpperCase']()==_0xb791('0x6e')){var _0x2ae360=fs[_0xb791('0x65')](path[_0xb791('0x5b')](config[_0xb791('0x5c')],_0xb791('0x6f')),_0xb791('0x5d'));var _0x23aa4a=ejs[_0xb791('0x5e')](_0x2ae360,{'networks':_0x14e2c7||[]});fs['writeFileSync'](_0xb791('0x60'),_0x23aa4a);return respondWithRpcPromise(_0xb791('0x61'),_0xb791('0x6c'),{'module':'res_stun_monitor.so'});}else if(_0x5068b2[_0xb791('0x3d')][_0xb791('0x5a')]()==_0xb791('0x64')){var _0x24c90d=fs['readFileSync'](path[_0xb791('0x5b')](config[_0xb791('0x5c')],_0xb791('0x66')),_0xb791('0x5d'));var _0xb8740b=ejs[_0xb791('0x5e')](_0x24c90d,{'networks':_0x14e2c7||[]});fs[_0xb791('0x5f')](_0xb791('0x70'),_0xb8740b);return respondWithRpcPromise(_0xb791('0x61'),'update',{'module':'res_stun_monitor.so'});}else{var _0x21566c=fs[_0xb791('0x65')](path[_0xb791('0x5b')](config['root'],_0xb791('0x67')),_0xb791('0x5d'));var _0x2e20d3=ejs[_0xb791('0x5e')](_0x21566c,{'networks':_0x14e2c7||[]});fs[_0xb791('0x5f')](util[_0xb791('0x68')](_0xb791('0x69'),_0x74ecaa['body']['type'][_0xb791('0x6a')]()),_0x2e20d3);return respondWithRpcPromise(_0xb791('0x61'),'update',{'module':_0xb791('0x6b')});}return null;})[_0xb791('0x1e')](function(_0x4851bb){if(_0x4851bb){return _0x5068b2;}return null;});})[_0xb791('0x1e')](respondWithResult(_0x21c46b,null))[_0xb791('0x28')](handleError(_0x21c46b,null));};exports[_0xb791('0x36')]=function(_0x2f1832,_0x4d59e6,_0x17aac5){var _0x250b99;return db[_0xb791('0x3a')]['find']({'where':{'id':_0x2f1832[_0xb791('0x55')]['id']}})[_0xb791('0x1e')](function(_0x11ad28){_0x250b99=_0x11ad28;return _0x11ad28;})[_0xb791('0x1e')](handleEntityNotFound(_0x4d59e6,null))['then'](removeEntity(_0x4d59e6,null))['then'](function(){if(_0x250b99){return db[_0xb791('0x3a')][_0xb791('0x52')]({'where':{'type':_0x250b99[_0xb791('0x3d')]},'raw':!![]});}})['then'](function(_0x218bc7){if(_0x250b99[_0xb791('0x3d')][_0xb791('0x5a')]()=='STUN'){var _0x29174c=fs['readFileSync'](path[_0xb791('0x5b')](config[_0xb791('0x5c')],_0xb791('0x6f')),'utf8');var _0x273e0f=ejs[_0xb791('0x5e')](_0x29174c,{'networks':_0x218bc7||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x273e0f);return respondWithRpcPromise(_0xb791('0x61'),'destroy',{'module':_0xb791('0x63')});}else if(_0x250b99['type']['toUpperCase']()==_0xb791('0x64')){var _0x12b841=fs['readFileSync'](path[_0xb791('0x5b')](config[_0xb791('0x5c')],_0xb791('0x66')),'utf8');var _0x432d38=ejs[_0xb791('0x5e')](_0x12b841,{'networks':_0x218bc7||[]});fs[_0xb791('0x5f')](_0xb791('0x70'),_0x432d38);return respondWithRpcPromise(_0xb791('0x61'),_0xb791('0x36'),{'module':_0xb791('0x63')});}else{var _0x2803e2=fs[_0xb791('0x65')](path['join'](config[_0xb791('0x5c')],'server/files/templates/network.ejs'),_0xb791('0x5d'));var _0xdfc5c4=ejs[_0xb791('0x5e')](_0x2803e2,{'networks':_0x218bc7||[]});fs[_0xb791('0x5f')](util[_0xb791('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x2f1832[_0xb791('0x59')][_0xb791('0x3d')]['toLowerCase']()),_0xdfc5c4);return respondWithRpcPromise(_0xb791('0x61'),'destroy',{'module':_0xb791('0x6b')});}return null;})['catch'](handleError(_0x4d59e6,null));}; \ No newline at end of file +var _0x3422=['end','status','json','undefined','limit','count','offset','Content-Range','apply','then','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','TURN','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','chan_sip.so','find','server/files/templates/turn_multiple.ejs','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus'];(function(_0x1d1cae,_0x5e08f7){var _0x2c06a8=function(_0x43309c){while(--_0x43309c){_0x1d1cae['push'](_0x1d1cae['shift']());}};_0x2c06a8(++_0x5e08f7);}(_0x3422,0x118));var _0x2342=function(_0x3f83dc,_0x5c8047){_0x3f83dc=_0x3f83dc-0x0;var _0x3876b8=_0x3422[_0x3f83dc];return _0x3876b8;};'use strict';var emlformat=require(_0x2342('0x0'));var rimraf=require(_0x2342('0x1'));var zipdir=require(_0x2342('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2342('0x3'));var moment=require(_0x2342('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2342('0x5'));var util=require('util');var path=require(_0x2342('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2342('0x7'));var fs=require('fs');var fs_extra=require(_0x2342('0x8'));var _=require(_0x2342('0x9'));var squel=require('squel');var crypto=require(_0x2342('0xa'));var jsforce=require(_0x2342('0xb'));var deskjs=require(_0x2342('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2342('0xd'));var Papa=require(_0x2342('0xe'));var Redis=require(_0x2342('0xf'));var authService=require(_0x2342('0x10'));var qs=require(_0x2342('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2342('0x12'));var logger=require(_0x2342('0x13'))(_0x2342('0x14'));var utils=require(_0x2342('0x15'));var config=require(_0x2342('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2342('0x17'))['db'];var jayson=require(_0x2342('0x18'));var client=jayson[_0x2342('0x19')][_0x2342('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1b486a,_0x47600c,_0x11e71d,_0xfe60d9){return new BPromise(function(_0x578242,_0x10378b){var _0x5d4ac0=_0xfe60d9||client;return _0x5d4ac0[_0x2342('0x1b')](_0x1b486a,_0x11e71d)['then'](function(_0x558947){logger[_0x2342('0x1c')](_0x2342('0x1d'),_0x47600c,'request\x20sent');logger[_0x2342('0x1e')]('Network,\x20%s,\x20%s,\x20%s',_0x47600c,'request\x20sent',JSON[_0x2342('0x1f')](_0x558947));if(_0x558947[_0x2342('0x20')]){if(_0x558947[_0x2342('0x20')]['code']===0x1f4){logger['error'](_0x2342('0x1d'),_0x47600c,_0x558947[_0x2342('0x20')]['message']);return _0x10378b(_0x558947[_0x2342('0x20')]['message']);}logger[_0x2342('0x20')](_0x2342('0x1d'),_0x47600c,_0x558947[_0x2342('0x20')][_0x2342('0x21')]);return _0x578242(_0x558947['error'][_0x2342('0x21')]);}else{logger[_0x2342('0x1c')](_0x2342('0x1d'),_0x47600c,_0x2342('0x22'));_0x578242(_0x558947[_0x2342('0x23')][_0x2342('0x21')]);}})[_0x2342('0x24')](function(_0x3dc488){logger['error'](_0x2342('0x1d'),_0x47600c,_0x3dc488);_0x10378b(_0x3dc488);});});}function respondWithStatusCode(_0x2cc068,_0x5dacc5){_0x5dacc5=_0x5dacc5||0xcc;return function(_0x4b76e0){if(_0x4b76e0){return _0x2cc068[_0x2342('0x25')](_0x5dacc5);}return _0x2cc068['status'](_0x5dacc5)[_0x2342('0x26')]();};}function respondWithResult(_0xbee717,_0x2202ca){_0x2202ca=_0x2202ca||0xc8;return function(_0x2af9d1){if(_0x2af9d1){return _0xbee717[_0x2342('0x27')](_0x2202ca)[_0x2342('0x28')](_0x2af9d1);}};}function respondWithFilteredResult(_0x4d2132,_0x4d65ef){return function(_0x8151ec){if(_0x8151ec){var _0xb29497=typeof _0x4d65ef['offset']===_0x2342('0x29')&&typeof _0x4d65ef[_0x2342('0x2a')]===_0x2342('0x29');var _0x52e8e6=_0x8151ec[_0x2342('0x2b')];var _0x5a843f=_0xb29497?0x0:_0x4d65ef[_0x2342('0x2c')];var _0x3aae5f=_0xb29497?_0x8151ec[_0x2342('0x2b')]:_0x4d65ef[_0x2342('0x2c')]+_0x4d65ef[_0x2342('0x2a')];var _0x1e0c47;if(_0x3aae5f>=_0x52e8e6){_0x3aae5f=_0x52e8e6;_0x1e0c47=0xc8;}else{_0x1e0c47=0xce;}_0x4d2132['status'](_0x1e0c47);return _0x4d2132['set'](_0x2342('0x2d'),_0x5a843f+'-'+_0x3aae5f+'/'+_0x52e8e6)[_0x2342('0x28')](_0x8151ec);}return null;};}function patchUpdates(_0x341643){return function(_0x34be43){try{jsonpatch[_0x2342('0x2e')](_0x34be43,_0x341643,!![]);}catch(_0x23cf12){return BPromise['reject'](_0x23cf12);}return _0x34be43['save']();};}function saveUpdates(_0x57c791,_0x5d2a24){return function(_0x4617be){if(_0x4617be){return _0x4617be['update'](_0x57c791)[_0x2342('0x2f')](function(_0x4193b6){return _0x4193b6;});}return null;};}function removeEntity(_0x20ca73,_0x468f7f){return function(_0x141250){if(_0x141250){return _0x141250[_0x2342('0x30')]()['then'](function(){_0x20ca73[_0x2342('0x27')](0xcc)[_0x2342('0x26')]();});}};}function handleEntityNotFound(_0x1730c9,_0x40111b){return function(_0x40276e){if(!_0x40276e){_0x1730c9[_0x2342('0x25')](0x194);}return _0x40276e;};}function handleError(_0x3f1a3e,_0xdcd37c){_0xdcd37c=_0xdcd37c||0x1f4;return function(_0x548170){logger['error'](_0x548170[_0x2342('0x31')]);if(_0x548170[_0x2342('0x32')]){delete _0x548170[_0x2342('0x32')];}_0x3f1a3e[_0x2342('0x27')](_0xdcd37c)[_0x2342('0x33')](_0x548170);};}exports[_0x2342('0x34')]=function(_0x2114ab,_0x2ed9a0){var _0x1a61fa={},_0x424a97={},_0x4d2736={'count':0x0,'rows':[]};var _0x2c43d1=_[_0x2342('0x35')](db[_0x2342('0x36')][_0x2342('0x37')],function(_0x159aa5){return{'name':_0x159aa5[_0x2342('0x38')],'type':_0x159aa5[_0x2342('0x39')][_0x2342('0x3a')]};});_0x424a97[_0x2342('0x3b')]=_[_0x2342('0x35')](_0x2c43d1,_0x2342('0x32'));_0x424a97[_0x2342('0x3c')]=_[_0x2342('0x3d')](_0x2114ab[_0x2342('0x3c')]);_0x424a97[_0x2342('0x3e')]=_['intersection'](_0x424a97[_0x2342('0x3b')],_0x424a97[_0x2342('0x3c')]);_0x1a61fa[_0x2342('0x3f')]=_[_0x2342('0x40')](_0x424a97[_0x2342('0x3b')],qs[_0x2342('0x41')](_0x2114ab[_0x2342('0x3c')][_0x2342('0x41')]));_0x1a61fa['attributes']=_0x1a61fa['attributes'][_0x2342('0x42')]?_0x1a61fa[_0x2342('0x3f')]:_0x424a97['model'];if(!_0x2114ab[_0x2342('0x3c')]['hasOwnProperty']('nolimit')){_0x1a61fa[_0x2342('0x2a')]=qs[_0x2342('0x2a')](_0x2114ab[_0x2342('0x3c')][_0x2342('0x2a')]);_0x1a61fa[_0x2342('0x2c')]=qs['offset'](_0x2114ab['query'][_0x2342('0x2c')]);}_0x1a61fa[_0x2342('0x43')]=qs['sort'](_0x2114ab[_0x2342('0x3c')]['sort']);_0x1a61fa['where']=qs[_0x2342('0x3e')](_[_0x2342('0x44')](_0x2114ab['query'],_0x424a97[_0x2342('0x3e')]),_0x2c43d1);if(_0x2114ab[_0x2342('0x3c')][_0x2342('0x45')]){_0x1a61fa['where']=_[_0x2342('0x46')](_0x1a61fa[_0x2342('0x47')],{'$or':_[_0x2342('0x35')](_0x2c43d1,function(_0x73392d){if(_0x73392d['type']!==_0x2342('0x48')){var _0x1cd976={};_0x1cd976[_0x73392d[_0x2342('0x32')]]={'$like':'%'+_0x2114ab[_0x2342('0x3c')][_0x2342('0x45')]+'%'};return _0x1cd976;}})});}_0x1a61fa=_['merge']({},_0x1a61fa,_0x2114ab[_0x2342('0x49')]);var _0x9b21b7={'where':_0x1a61fa[_0x2342('0x47')]};return db[_0x2342('0x36')][_0x2342('0x2b')](_0x9b21b7)[_0x2342('0x2f')](function(_0x2ff184){_0x4d2736[_0x2342('0x2b')]=_0x2ff184;if(_0x2114ab[_0x2342('0x3c')]['includeAll']){_0x1a61fa[_0x2342('0x4a')]=[{'all':!![]}];}return db[_0x2342('0x36')][_0x2342('0x4b')](_0x1a61fa);})['then'](function(_0x578a2a){_0x4d2736[_0x2342('0x4c')]=_0x578a2a;return _0x4d2736;})['then'](respondWithFilteredResult(_0x2ed9a0,_0x1a61fa))[_0x2342('0x24')](handleError(_0x2ed9a0,null));};exports[_0x2342('0x4d')]=function(_0xdec672,_0x1b7ee6){var _0x1889d4={'raw':!![],'where':{'id':_0xdec672[_0x2342('0x4e')]['id']}},_0x50d276={};_0x50d276[_0x2342('0x3b')]=_[_0x2342('0x3d')](db[_0x2342('0x36')][_0x2342('0x37')]);_0x50d276[_0x2342('0x3c')]=_[_0x2342('0x3d')](_0xdec672[_0x2342('0x3c')]);_0x50d276[_0x2342('0x3e')]=_[_0x2342('0x40')](_0x50d276[_0x2342('0x3b')],_0x50d276[_0x2342('0x3c')]);_0x1889d4[_0x2342('0x3f')]=_[_0x2342('0x40')](_0x50d276['model'],qs[_0x2342('0x41')](_0xdec672[_0x2342('0x3c')][_0x2342('0x41')]));_0x1889d4[_0x2342('0x3f')]=_0x1889d4[_0x2342('0x3f')][_0x2342('0x42')]?_0x1889d4[_0x2342('0x3f')]:_0x50d276[_0x2342('0x3b')];if(_0xdec672[_0x2342('0x3c')][_0x2342('0x4f')]){_0x1889d4[_0x2342('0x4a')]=[{'all':!![]}];}_0x1889d4=_[_0x2342('0x46')]({},_0x1889d4,_0xdec672[_0x2342('0x49')]);return db[_0x2342('0x36')]['find'](_0x1889d4)[_0x2342('0x2f')](handleEntityNotFound(_0x1b7ee6,null))[_0x2342('0x2f')](respondWithResult(_0x1b7ee6,null))[_0x2342('0x24')](handleError(_0x1b7ee6,null));};exports[_0x2342('0x50')]=function(_0x185486,_0xdede2a,_0x5959c2){var _0x589852;return db[_0x2342('0x51')][_0x2342('0x52')](function(_0x99316b){return db['Network'][_0x2342('0x50')](_0x185486['body'],{'raw':!![]})[_0x2342('0x2f')](function(_0x508aa0){_0x589852=_0x508aa0;return db[_0x2342('0x36')][_0x2342('0x4b')]({'where':{'type':_0x185486[_0x2342('0x53')][_0x2342('0x39')]},'raw':!![]});})[_0x2342('0x2f')](function(_0x3bec32){if(_0x589852[_0x2342('0x39')][_0x2342('0x54')]()==_0x2342('0x55')){var _0x201c5e=fs[_0x2342('0x56')](path[_0x2342('0x57')](config[_0x2342('0x58')],_0x2342('0x59')),'utf8');var _0xbb5761=ejs[_0x2342('0x5a')](_0x201c5e,{'networks':_0x3bec32||[]});fs[_0x2342('0x5b')]('/etc/asterisk/stun_xcally.conf',_0xbb5761);return respondWithRpcPromise('Reload',_0x2342('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x589852[_0x2342('0x39')]['toUpperCase']()==_0x2342('0x5c')){var _0x3016c9=fs['readFileSync'](path[_0x2342('0x57')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2342('0x5d'));var _0x5a336f=ejs[_0x2342('0x5a')](_0x3016c9,{'networks':_0x3bec32||[]});fs[_0x2342('0x5b')](_0x2342('0x5e'),_0x5a336f);return respondWithRpcPromise(_0x2342('0x5f'),_0x2342('0x50'),{'module':'res_stun_monitor.so'});}else{var _0xd0b445=fs[_0x2342('0x56')](path[_0x2342('0x57')](config['root'],_0x2342('0x60')),_0x2342('0x5d'));var _0x230b1f=ejs[_0x2342('0x5a')](_0xd0b445,{'networks':_0x3bec32||[]});fs[_0x2342('0x5b')](util[_0x2342('0x61')](_0x2342('0x62'),_0x185486[_0x2342('0x53')][_0x2342('0x39')][_0x2342('0x63')]()),_0x230b1f);return respondWithRpcPromise(_0x2342('0x5f'),'create',{'module':'chan_sip.so'});}return null;})[_0x2342('0x2f')](function(){return _0x589852;});})[_0x2342('0x2f')](respondWithResult(_0xdede2a,0xc9))[_0x2342('0x24')](handleError(_0xdede2a,null));};exports[_0x2342('0x64')]=function(_0x57a7b3,_0x5e7ede,_0x2e7305){var _0x24c8a9;return db[_0x2342('0x51')]['transaction'](function(_0x3c1d2d){return db[_0x2342('0x36')]['find']({'where':{'id':_0x57a7b3[_0x2342('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e7ede,null))[_0x2342('0x2f')](saveUpdates(_0x57a7b3[_0x2342('0x53')],null))[_0x2342('0x2f')](function(_0x270fca){if(_0x270fca){_0x24c8a9=_0x270fca;return db[_0x2342('0x36')][_0x2342('0x4b')]({'where':{'type':_0x24c8a9[_0x2342('0x39')]},'raw':!![]});}return null;})['then'](function(_0x2cd513){if(_0x24c8a9[_0x2342('0x39')][_0x2342('0x54')]()==_0x2342('0x55')){var _0x4f1306=fs[_0x2342('0x56')](path[_0x2342('0x57')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x2342('0x5d'));var _0x45994b=ejs[_0x2342('0x5a')](_0x4f1306,{'networks':_0x2cd513||[]});fs[_0x2342('0x5b')](_0x2342('0x65'),_0x45994b);return respondWithRpcPromise(_0x2342('0x5f'),'update',{'module':_0x2342('0x66')});}else if(_0x24c8a9[_0x2342('0x39')][_0x2342('0x54')]()==_0x2342('0x5c')){var _0x6acfd0=fs[_0x2342('0x56')](path[_0x2342('0x57')](config[_0x2342('0x58')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xd8432=ejs[_0x2342('0x5a')](_0x6acfd0,{'networks':_0x2cd513||[]});fs[_0x2342('0x5b')](_0x2342('0x5e'),_0xd8432);return respondWithRpcPromise('Reload','update',{'module':_0x2342('0x66')});}else{var _0x21cf8b=fs[_0x2342('0x56')](path['join'](config['root'],_0x2342('0x60')),_0x2342('0x5d'));var _0x3cf331=ejs[_0x2342('0x5a')](_0x21cf8b,{'networks':_0x2cd513||[]});fs[_0x2342('0x5b')](util[_0x2342('0x61')](_0x2342('0x62'),_0x57a7b3[_0x2342('0x53')][_0x2342('0x39')]['toLowerCase']()),_0x3cf331);return respondWithRpcPromise('Reload',_0x2342('0x64'),{'module':_0x2342('0x67')});}return null;})['then'](function(_0x10c8a){if(_0x10c8a){return _0x24c8a9;}return null;});})['then'](respondWithResult(_0x5e7ede,null))[_0x2342('0x24')](handleError(_0x5e7ede,null));};exports[_0x2342('0x30')]=function(_0x43526c,_0x466166,_0x353af8){var _0x5d8307;return db[_0x2342('0x36')][_0x2342('0x68')]({'where':{'id':_0x43526c[_0x2342('0x4e')]['id']}})[_0x2342('0x2f')](function(_0x3a1a9c){_0x5d8307=_0x3a1a9c;return _0x3a1a9c;})[_0x2342('0x2f')](handleEntityNotFound(_0x466166,null))['then'](removeEntity(_0x466166,null))[_0x2342('0x2f')](function(){if(_0x5d8307){return db[_0x2342('0x36')][_0x2342('0x4b')]({'where':{'type':_0x5d8307[_0x2342('0x39')]},'raw':!![]});}})[_0x2342('0x2f')](function(_0x2bcd50){if(_0x5d8307[_0x2342('0x39')][_0x2342('0x54')]()=='STUN'){var _0x226bc8=fs['readFileSync'](path['join'](config['root'],_0x2342('0x59')),_0x2342('0x5d'));var _0x76d01e=ejs[_0x2342('0x5a')](_0x226bc8,{'networks':_0x2bcd50||[]});fs['writeFileSync'](_0x2342('0x65'),_0x76d01e);return respondWithRpcPromise(_0x2342('0x5f'),_0x2342('0x30'),{'module':_0x2342('0x66')});}else if(_0x5d8307[_0x2342('0x39')][_0x2342('0x54')]()==_0x2342('0x5c')){var _0x13cb10=fs['readFileSync'](path[_0x2342('0x57')](config['root'],_0x2342('0x69')),_0x2342('0x5d'));var _0x1c6683=ejs[_0x2342('0x5a')](_0x13cb10,{'networks':_0x2bcd50||[]});fs['writeFileSync'](_0x2342('0x5e'),_0x1c6683);return respondWithRpcPromise(_0x2342('0x5f'),'destroy',{'module':_0x2342('0x66')});}else{var _0x14c18a=fs[_0x2342('0x56')](path['join'](config[_0x2342('0x58')],_0x2342('0x60')),_0x2342('0x5d'));var _0x31c7cf=ejs[_0x2342('0x5a')](_0x14c18a,{'networks':_0x2bcd50||[]});fs[_0x2342('0x5b')](util[_0x2342('0x61')](_0x2342('0x62'),_0x43526c[_0x2342('0x53')][_0x2342('0x39')]['toLowerCase']()),_0x31c7cf);return respondWithRpcPromise(_0x2342('0x5f'),'destroy',{'module':'chan_sip.so'});}return null;})[_0x2342('0x24')](handleError(_0x466166,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6e0c204..d3cfd34 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 _0xbf6e=['./network.attributes','exports','define','Network','network','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x171a8a,_0x755ef2){var _0x57227e=function(_0x35a985){while(--_0x35a985){_0x171a8a['push'](_0x171a8a['shift']());}};_0x57227e(++_0x755ef2);}(_0xbf6e,0x149));var _0xebf6=function(_0x113a1a,_0x22a2c9){_0x113a1a=_0x113a1a-0x0;var _0x14d16e=_0xbf6e[_0x113a1a];return _0x14d16e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebf6('0x0'))(_0xebf6('0x1'));var moment=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var rp=require(_0xebf6('0x4'));var fs=require('fs');var path=require(_0xebf6('0x5'));var rimraf=require(_0xebf6('0x6'));var config=require('../../config/environment');var attributes=require(_0xebf6('0x7'));module[_0xebf6('0x8')]=function(_0x3b2bb6,_0x1e15cf){return _0x3b2bb6[_0xebf6('0x9')](_0xebf6('0xa'),attributes,{'tableName':_0xebf6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5db8=['lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./network.attributes','exports','Network','network'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5db8,0xbb));var _0x85db=function(_0x221a6f,_0x1674c8){_0x221a6f=_0x221a6f-0x0;var _0x3db53d=_0x5db8[_0x221a6f];return _0x3db53d;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var moment=require(_0x85db('0x3'));var BPromise=require(_0x85db('0x4'));var rp=require(_0x85db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85db('0x6'));var attributes=require(_0x85db('0x7'));module[_0x85db('0x8')]=function(_0x34d71f,_0x48bf16){return _0x34d71f['define'](_0x85db('0x9'),attributes,{'tableName':_0x85db('0xa'),'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 0e03b03..405ba45 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x29e8ba,_0x24a1c4){_0x29e8ba=_0x29e8ba-0x0;var _0x331817=_0x7a54[_0x29e8ba];return _0x331817;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x449e9a,_0x664e9f){_0x449e9a=_0x449e9a-0x0;var _0x397403=_0x7a54[_0x449e9a];return _0x397403;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 9f6b984..6b2fb1e 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 _0x0180=['index','/describe','describe','/:id','show','getAnswers','/:id/applications','getApplications','/:id/interactions','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','express','Router','fs-extra','./openchannelAccount.controller','get','isAuthenticated'];(function(_0x8ee4e8,_0x192cf2){var _0x4b1ec4=function(_0xc3cfa5){while(--_0xc3cfa5){_0x8ee4e8['push'](_0x8ee4e8['shift']());}};_0x4b1ec4(++_0x192cf2);}(_0x0180,0x1e5));var _0x0018=function(_0x43c33f,_0x18c101){_0x43c33f=_0x43c33f-0x0;var _0x39398a=_0x0180[_0x43c33f];return _0x39398a;};'use strict';var multer=require(_0x0018('0x0'));var util=require(_0x0018('0x1'));var path=require(_0x0018('0x2'));var timeout=require('connect-timeout');var express=require(_0x0018('0x3'));var router=express[_0x0018('0x4')]();var fs_extra=require(_0x0018('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0018('0x6'));router[_0x0018('0x7')]('/',auth[_0x0018('0x8')](),controller[_0x0018('0x9')]);router[_0x0018('0x7')](_0x0018('0xa'),auth[_0x0018('0x8')](),controller[_0x0018('0xb')]);router[_0x0018('0x7')](_0x0018('0xc'),auth[_0x0018('0x8')](),controller[_0x0018('0xd')]);router[_0x0018('0x7')]('/:id/dispositions',auth[_0x0018('0x8')](),controller['getDispositions']);router[_0x0018('0x7')]('/:id/canned_answers',auth[_0x0018('0x8')](),controller[_0x0018('0xe')]);router[_0x0018('0x7')](_0x0018('0xf'),auth[_0x0018('0x8')](),controller[_0x0018('0x10')]);router[_0x0018('0x7')](_0x0018('0x11'),auth[_0x0018('0x8')](),controller['getInteractions']);router[_0x0018('0x7')]('/:id/users',auth[_0x0018('0x8')](),controller[_0x0018('0x12')]);router[_0x0018('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0018('0x13')](_0x0018('0x14'),auth[_0x0018('0x8')](),controller[_0x0018('0x15')]);router[_0x0018('0x13')](_0x0018('0x16'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x0018('0x17'),controller[_0x0018('0x18')]);router[_0x0018('0x13')](_0x0018('0xf'),auth['isAuthenticated'](),controller[_0x0018('0x19')]);router[_0x0018('0x13')]('/:id/users',auth[_0x0018('0x8')](),controller[_0x0018('0x1a')]);router['post'](_0x0018('0x1b'),auth['isAuthenticated'](),controller[_0x0018('0x1c')]);router[_0x0018('0x1d')](_0x0018('0xc'),auth[_0x0018('0x8')](),controller[_0x0018('0x1e')]);router['delete']('/:id',auth[_0x0018('0x8')](),controller[_0x0018('0x1f')]);router[_0x0018('0x20')]('/:id/dispositions',auth[_0x0018('0x8')](),controller[_0x0018('0x21')]);router[_0x0018('0x20')](_0x0018('0x16'),auth['isAuthenticated'](),controller[_0x0018('0x22')]);router[_0x0018('0x20')](_0x0018('0x23'),auth[_0x0018('0x8')](),controller[_0x0018('0x24')]);module[_0x0018('0x25')]=router; \ No newline at end of file +var _0xd391=['describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/users','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0xd2c332,_0x1b5f38){var _0x4efc6f=function(_0x56d70c){while(--_0x56d70c){_0xd2c332['push'](_0xd2c332['shift']());}};_0x4efc6f(++_0x1b5f38);}(_0xd391,0x131));var _0x1d39=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd391[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d39('0x0'));var timeout=require(_0x1d39('0x1'));var express=require(_0x1d39('0x2'));var router=express[_0x1d39('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1d39('0x4'));var interaction=require(_0x1d39('0x5'));var config=require(_0x1d39('0x6'));var controller=require('./openchannelAccount.controller');router[_0x1d39('0x7')]('/',auth[_0x1d39('0x8')](),controller['index']);router[_0x1d39('0x7')](_0x1d39('0x9'),auth[_0x1d39('0x8')](),controller[_0x1d39('0xa')]);router['get'](_0x1d39('0xb'),auth[_0x1d39('0x8')](),controller['show']);router['get'](_0x1d39('0xc'),auth['isAuthenticated'](),controller[_0x1d39('0xd')]);router[_0x1d39('0x7')]('/:id/canned_answers',auth[_0x1d39('0x8')](),controller[_0x1d39('0xe')]);router[_0x1d39('0x7')](_0x1d39('0xf'),auth[_0x1d39('0x8')](),controller['getApplications']);router['get'](_0x1d39('0x10'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x11')]);router[_0x1d39('0x7')]('/:id/users',auth[_0x1d39('0x8')](),controller[_0x1d39('0x12')]);router[_0x1d39('0x13')]('/',auth[_0x1d39('0x8')](),controller['create']);router[_0x1d39('0x13')]('/:id/dispositions',auth[_0x1d39('0x8')](),controller['addDisposition']);router['post'](_0x1d39('0x14'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x15')]);router[_0x1d39('0x13')](_0x1d39('0x16'),controller[_0x1d39('0x17')]);router[_0x1d39('0x13')](_0x1d39('0xf'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x18')]);router[_0x1d39('0x13')](_0x1d39('0x19'),auth[_0x1d39('0x8')](),controller['addAgents']);router[_0x1d39('0x13')](_0x1d39('0x1a'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x1b')]);router[_0x1d39('0x1c')](_0x1d39('0xb'),auth['isAuthenticated'](),controller[_0x1d39('0x1d')]);router[_0x1d39('0x1e')](_0x1d39('0xb'),auth[_0x1d39('0x8')](),controller['destroy']);router[_0x1d39('0x1e')](_0x1d39('0xc'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x1f')]);router[_0x1d39('0x1e')](_0x1d39('0x14'),auth[_0x1d39('0x8')](),controller[_0x1d39('0x20')]);router[_0x1d39('0x1e')](_0x1d39('0x19'),auth['isAuthenticated'](),controller[_0x1d39('0x21')]);module[_0x1d39('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9f06557..fb78bbb 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 _0x9fb0=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x718224,_0x57da19){var _0x3f0386=function(_0x263b15){while(--_0x263b15){_0x718224['push'](_0x718224['shift']());}};_0x3f0386(++_0x57da19);}(_0x9fb0,0x147));var _0x09fb=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x9fb0[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x09fb('0x0'));var rs=require(_0x09fb('0x1'));module[_0x09fb('0x2')]={'name':{'type':Sequelize[_0x09fb('0x3')],'unique':_0x09fb('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x09fb('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x09fb('0x5')]();}},'replyUri':{'type':Sequelize[_0x09fb('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x09fb('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x09fb('0x6');}},'notificationSound':{'type':Sequelize[_0x09fb('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x09fb('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x09fb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x09fb('0x3')]},'queueTransfer':{'type':Sequelize[_0x09fb('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09fb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x09fb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09fb('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x09fb('0x9'),'set':function(_0x42ed88){if(!_0x42ed88)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x09fb('0xa')](_0x09fb('0xb'),_0x42ed88);}}}; \ No newline at end of file +var _0xd0e9=['sequelize','randomstring','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0xd0e9,0x1cb));var _0x9d0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd0e9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9d0e('0x0'));var rs=require(_0x9d0e('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9d0e('0x2')],'defaultValue':function(){return rs[_0x9d0e('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9d0e('0x4');}},'notificationSound':{'type':Sequelize[_0x9d0e('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9d0e('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9d0e('0x2')]},'queueTransfer':{'type':Sequelize[_0x9d0e('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9d0e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9d0e('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9d0e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9d0e('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16f314){if(!_0x16f314)this[_0x9d0e('0x7')]('mandatoryDispositionPauseId',null);this[_0x9d0e('0x7')](_0x9d0e('0x8'),_0x16f314);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8d817a1..47fd9f8 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 _0x5a5f=['getInteractions','Contact','Owner','Tag','Tags','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','Content-Range','apply','reject','update','get','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','OpenchannelAccountId','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','account','list','applications','orderBy','priority','asc','Applications','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications'];(function(_0xddde89,_0x27811d){var _0x4ff3fe=function(_0x5c4b58){while(--_0x5c4b58){_0xddde89['push'](_0xddde89['shift']());}};_0x4ff3fe(++_0x27811d);}(_0x5a5f,0xcb));var _0xf5a5=function(_0xf8e45b,_0x336e08){_0xf8e45b=_0xf8e45b-0x0;var _0xb38c41=_0x5a5f[_0xf8e45b];return _0xb38c41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5a5('0x0'));var zipdir=require(_0xf5a5('0x1'));var jsonpatch=require(_0xf5a5('0x2'));var rp=require(_0xf5a5('0x3'));var moment=require(_0xf5a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf5a5('0x5'));var util=require(_0xf5a5('0x6'));var path=require(_0xf5a5('0x7'));var sox=require(_0xf5a5('0x8'));var csv=require('to-csv');var ejs=require(_0xf5a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5a5('0xa'));var squel=require(_0xf5a5('0xb'));var crypto=require(_0xf5a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf5a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf5a5('0xe'));var Papa=require(_0xf5a5('0xf'));var Redis=require(_0xf5a5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf5a5('0x11'));var as=require(_0xf5a5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5a5('0x13'))(_0xf5a5('0x14'));var utils=require('../../config/utils');var config=require(_0xf5a5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5a5('0x16'))['db'];config[_0xf5a5('0x17')]=_['defaults'](config[_0xf5a5('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5a5('0x18'))(new Redis(config[_0xf5a5('0x17')]));require('./openchannelAccount.socket')[_0xf5a5('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf5a5('0x1a')][_0xf5a5('0x1b')]({'port':0x232c});var client9002=jayson[_0xf5a5('0x1a')][_0xf5a5('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x13ad52,_0x51cc8f,_0x168304,_0x64cc29){return new BPromise(function(_0x356048,_0x3c723b){var _0xb2d80a=_0x64cc29||client;return _0xb2d80a[_0xf5a5('0x1c')](_0x13ad52,_0x168304)[_0xf5a5('0x1d')](function(_0x1aca5b){logger[_0xf5a5('0x1e')](_0xf5a5('0x1f'),_0x51cc8f,_0xf5a5('0x20'));logger[_0xf5a5('0x21')](_0xf5a5('0x22'),_0x51cc8f,'request\x20sent',JSON[_0xf5a5('0x23')](_0x1aca5b));if(_0x1aca5b[_0xf5a5('0x24')]){if(_0x1aca5b[_0xf5a5('0x24')][_0xf5a5('0x25')]===0x1f4){logger[_0xf5a5('0x24')](_0xf5a5('0x1f'),_0x51cc8f,_0x1aca5b['error']['message']);return _0x3c723b(_0x1aca5b[_0xf5a5('0x24')][_0xf5a5('0x26')]);}logger[_0xf5a5('0x24')](_0xf5a5('0x1f'),_0x51cc8f,_0x1aca5b[_0xf5a5('0x24')][_0xf5a5('0x26')]);return _0x356048(_0x1aca5b[_0xf5a5('0x24')][_0xf5a5('0x26')]);}else{logger[_0xf5a5('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x51cc8f,_0xf5a5('0x20'));_0x356048(_0x1aca5b['result']['message']);}})[_0xf5a5('0x27')](function(_0x268461){logger[_0xf5a5('0x24')](_0xf5a5('0x1f'),_0x51cc8f,_0x268461);_0x3c723b(_0x268461);});});}function respondWithStatusCode(_0x1e66d8,_0x279b51){_0x279b51=_0x279b51||0xcc;return function(_0x37d50f){if(_0x37d50f){return _0x1e66d8[_0xf5a5('0x28')](_0x279b51);}return _0x1e66d8['status'](_0x279b51)[_0xf5a5('0x29')]();};}function respondWithResult(_0x4b7c29,_0x4d750d){_0x4d750d=_0x4d750d||0xc8;return function(_0x239278){if(_0x239278){return _0x4b7c29[_0xf5a5('0x2a')](_0x4d750d)[_0xf5a5('0x2b')](_0x239278);}};}function respondWithFilteredResult(_0x1909aa,_0x5b02cf){return function(_0x558997){if(_0x558997){var _0x319d71=typeof _0x5b02cf['offset']==='undefined'&&typeof _0x5b02cf['limit']==='undefined';var _0x3bef8a=_0x558997['count'];var _0x8655ad=_0x319d71?0x0:_0x5b02cf[_0xf5a5('0x2c')];var _0x502ccc=_0x319d71?_0x558997['count']:_0x5b02cf[_0xf5a5('0x2c')]+_0x5b02cf['limit'];var _0x186a8c;if(_0x502ccc>=_0x3bef8a){_0x502ccc=_0x3bef8a;_0x186a8c=0xc8;}else{_0x186a8c=0xce;}_0x1909aa[_0xf5a5('0x2a')](_0x186a8c);return _0x1909aa['set'](_0xf5a5('0x2d'),_0x8655ad+'-'+_0x502ccc+'/'+_0x3bef8a)['json'](_0x558997);}return null;};}function patchUpdates(_0x310927){return function(_0x4a7ffc){try{jsonpatch[_0xf5a5('0x2e')](_0x4a7ffc,_0x310927,!![]);}catch(_0x49924a){return BPromise[_0xf5a5('0x2f')](_0x49924a);}return _0x4a7ffc['save']();};}function saveUpdates(_0x1001a8,_0x534be1){return function(_0x30b8e8){if(_0x30b8e8){return _0x30b8e8[_0xf5a5('0x30')](_0x1001a8)[_0xf5a5('0x1d')](function(_0x3111f4){return _0x3111f4;});}return null;};}function removeEntity(_0x5bf497,_0x15d79c){return function(_0x91d490){if(_0x91d490){return _0x91d490['destroy']()['then'](function(){var _0x181277=_0x91d490[_0xf5a5('0x31')]({'plain':!![]});var _0x5350f1='OpenchannelAccounts';return db[_0xf5a5('0x32')][_0xf5a5('0x33')]({'where':{'type':_0x5350f1,'resourceId':_0x181277['id']}})[_0xf5a5('0x1d')](function(){return _0x91d490;});})['then'](function(){_0x5bf497[_0xf5a5('0x2a')](0xcc)[_0xf5a5('0x29')]();});}};}function handleEntityNotFound(_0xa7be21,_0x318c9a){return function(_0x55adc6){if(!_0x55adc6){_0xa7be21['sendStatus'](0x194);}return _0x55adc6;};}function handleError(_0x5b5da4,_0x3b0158){_0x3b0158=_0x3b0158||0x1f4;return function(_0x1b4184){logger['error'](_0x1b4184['stack']);if(_0x1b4184[_0xf5a5('0x34')]){delete _0x1b4184[_0xf5a5('0x34')];}_0x5b5da4[_0xf5a5('0x2a')](_0x3b0158)[_0xf5a5('0x35')](_0x1b4184);};}exports[_0xf5a5('0x36')]=function(_0x4e190d,_0x47f393){var _0xe18cf9={'include':[{'model':db[_0xf5a5('0x37')],'as':_0xf5a5('0x38')}]},_0x4f022b={},_0x5b66b9={'count':0x0,'rows':[]};var _0x17a30f=_[_0xf5a5('0x39')](db[_0xf5a5('0x3a')]['rawAttributes'],function(_0xb85455){return{'name':_0xb85455[_0xf5a5('0x3b')],'type':_0xb85455[_0xf5a5('0x3c')][_0xf5a5('0x3d')]};});_0x4f022b[_0xf5a5('0x3e')]=_['map'](_0x17a30f,_0xf5a5('0x34'));_0x4f022b['query']=_[_0xf5a5('0x3f')](_0x4e190d[_0xf5a5('0x40')]);_0x4f022b[_0xf5a5('0x41')]=_['intersection'](_0x4f022b[_0xf5a5('0x3e')],_0x4f022b['query']);_0xe18cf9['attributes']=_[_0xf5a5('0x42')](_0x4f022b['model'],qs['fields'](_0x4e190d['query'][_0xf5a5('0x43')]));_0xe18cf9['attributes']=_0xe18cf9[_0xf5a5('0x44')][_0xf5a5('0x45')]?_0xe18cf9[_0xf5a5('0x44')]:_0x4f022b[_0xf5a5('0x3e')];if(!_0x4e190d[_0xf5a5('0x40')][_0xf5a5('0x46')](_0xf5a5('0x47'))){_0xe18cf9['limit']=qs[_0xf5a5('0x48')](_0x4e190d[_0xf5a5('0x40')][_0xf5a5('0x48')]);_0xe18cf9['offset']=qs['offset'](_0x4e190d[_0xf5a5('0x40')][_0xf5a5('0x2c')]);}_0xe18cf9[_0xf5a5('0x49')]=qs['sort'](_0x4e190d['query'][_0xf5a5('0x4a')]);_0xe18cf9[_0xf5a5('0x4b')]=qs[_0xf5a5('0x41')](_[_0xf5a5('0x4c')](_0x4e190d[_0xf5a5('0x40')],_0x4f022b[_0xf5a5('0x41')]),_0x17a30f);if(_0x4e190d[_0xf5a5('0x40')]['filter']){_0xe18cf9[_0xf5a5('0x4b')]=_[_0xf5a5('0x4d')](_0xe18cf9[_0xf5a5('0x4b')],{'$or':_['map'](_0x17a30f,function(_0x5681bb){if(_0x5681bb[_0xf5a5('0x3c')]!==_0xf5a5('0x4e')){var _0x5cf060={};_0x5cf060[_0x5681bb[_0xf5a5('0x34')]]={'$like':'%'+_0x4e190d[_0xf5a5('0x40')][_0xf5a5('0x4f')]+'%'};return _0x5cf060;}})});}_0xe18cf9=_[_0xf5a5('0x4d')]({},_0xe18cf9,_0x4e190d[_0xf5a5('0x50')]);var _0x1a7042={'where':_0xe18cf9[_0xf5a5('0x4b')]};return db[_0xf5a5('0x3a')][_0xf5a5('0x51')](_0x1a7042)[_0xf5a5('0x1d')](function(_0x21fa66){_0x5b66b9['count']=_0x21fa66;if(_0x4e190d['query'][_0xf5a5('0x52')]){_0xe18cf9[_0xf5a5('0x53')]=[{'all':!![]}];}return db[_0xf5a5('0x3a')][_0xf5a5('0x54')](_0xe18cf9);})[_0xf5a5('0x1d')](function(_0xf429b2){_0x5b66b9[_0xf5a5('0x55')]=_0xf429b2;return _0x5b66b9;})[_0xf5a5('0x1d')](respondWithFilteredResult(_0x47f393,_0xe18cf9))[_0xf5a5('0x27')](handleError(_0x47f393,null));};exports[_0xf5a5('0x56')]=function(_0x1846f5,_0x3ec816){var _0x2018d6={'raw':![],'where':{'id':_0x1846f5[_0xf5a5('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xf5a5('0x38')}]},_0x4e8add={};_0x4e8add[_0xf5a5('0x3e')]=_[_0xf5a5('0x3f')](db['OpenchannelAccount'][_0xf5a5('0x58')]);_0x4e8add[_0xf5a5('0x40')]=_['keys'](_0x1846f5[_0xf5a5('0x40')]);_0x4e8add[_0xf5a5('0x41')]=_['intersection'](_0x4e8add[_0xf5a5('0x3e')],_0x4e8add['query']);_0x2018d6['attributes']=_[_0xf5a5('0x42')](_0x4e8add[_0xf5a5('0x3e')],qs[_0xf5a5('0x43')](_0x1846f5[_0xf5a5('0x40')]['fields']));_0x2018d6[_0xf5a5('0x44')]=_0x2018d6[_0xf5a5('0x44')][_0xf5a5('0x45')]?_0x2018d6[_0xf5a5('0x44')]:_0x4e8add[_0xf5a5('0x3e')];if(_0x1846f5[_0xf5a5('0x40')][_0xf5a5('0x52')]){_0x2018d6[_0xf5a5('0x53')]=[{'all':!![]}];}_0x2018d6=_[_0xf5a5('0x4d')]({},_0x2018d6,_0x1846f5[_0xf5a5('0x50')]);return db['OpenchannelAccount'][_0xf5a5('0x59')](_0x2018d6)[_0xf5a5('0x1d')](handleEntityNotFound(_0x3ec816,null))[_0xf5a5('0x1d')](respondWithResult(_0x3ec816,null))['catch'](handleError(_0x3ec816,null));};exports[_0xf5a5('0x5a')]=function(_0x3a5d45,_0x1ffb88){return db[_0xf5a5('0x3a')][_0xf5a5('0x5a')](_0x3a5d45[_0xf5a5('0x5b')],{})['then'](function(_0x32818f){var _0xf0aa5c=_0x3a5d45[_0xf5a5('0x5c')][_0xf5a5('0x31')]({'plain':!![]});if(!_0xf0aa5c)throw new Error(_0xf5a5('0x5d'));if(_0xf0aa5c[_0xf5a5('0x5e')]==='user'){var _0x48c4b4=_0x32818f[_0xf5a5('0x31')]({'plain':!![]});var _0x2b8f2f=_0xf5a5('0x5f');return db[_0xf5a5('0x60')][_0xf5a5('0x59')]({'where':{'name':_0x2b8f2f,'userProfileId':_0xf0aa5c['userProfileId']},'raw':!![]})['then'](function(_0x387fbd){if(_0x387fbd&&_0x387fbd[_0xf5a5('0x61')]===0x0){return db[_0xf5a5('0x32')][_0xf5a5('0x5a')]({'name':_0x48c4b4[_0xf5a5('0x34')],'resourceId':_0x48c4b4['id'],'type':_0x387fbd['name'],'sectionId':_0x387fbd['id']},{})[_0xf5a5('0x1d')](function(){return _0x32818f;});}else{return _0x32818f;}})[_0xf5a5('0x27')](function(_0x34109c){logger[_0xf5a5('0x24')](_0xf5a5('0x62'),_0x34109c);throw _0x34109c;});}return _0x32818f;})[_0xf5a5('0x1d')](respondWithResult(_0x1ffb88,0xc9))['catch'](handleError(_0x1ffb88,null));};exports[_0xf5a5('0x30')]=function(_0x1e11e2,_0x289d34){if(_0x1e11e2[_0xf5a5('0x5b')]['id']){delete _0x1e11e2[_0xf5a5('0x5b')]['id'];}return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x1e11e2['params']['id']},'include':[{'model':db[_0xf5a5('0x37')],'as':'mandatoryDispositionPause'}]})[_0xf5a5('0x1d')](handleEntityNotFound(_0x289d34,null))[_0xf5a5('0x1d')](saveUpdates(_0x1e11e2['body'],null))[_0xf5a5('0x1d')](respondWithResult(_0x289d34,null))[_0xf5a5('0x27')](handleError(_0x289d34,null));};exports[_0xf5a5('0x33')]=function(_0x15f5ea,_0x2c2e24){return db['OpenchannelAccount']['find']({'where':{'id':_0x15f5ea[_0xf5a5('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c2e24,null))['then'](removeEntity(_0x2c2e24,null))[_0xf5a5('0x27')](handleError(_0x2c2e24,null));};exports['describe']=function(_0x5e1f1c,_0x2829dd){return db[_0xf5a5('0x3a')][_0xf5a5('0x63')]()[_0xf5a5('0x1d')](respondWithResult(_0x2829dd,null))[_0xf5a5('0x27')](handleError(_0x2829dd,null));};exports[_0xf5a5('0x64')]=function(_0x2a75f2,_0x14478d,_0x1c6d2a){if(_0x2a75f2[_0xf5a5('0x5b')]['id']){delete _0x2a75f2[_0xf5a5('0x5b')]['id'];}return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x2a75f2['params']['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x14478d,null))[_0xf5a5('0x1d')](function(_0x5e5cdb){if(_0x5e5cdb){_0x2a75f2[_0xf5a5('0x5b')]['OpenchannelAccountId']=_0x5e5cdb['id'];return db[_0xf5a5('0x65')]['create'](_0x2a75f2[_0xf5a5('0x5b')]);}})[_0xf5a5('0x1d')](respondWithResult(_0x14478d,null))[_0xf5a5('0x27')](handleError(_0x14478d,null));};exports['getDispositions']=function(_0x4d3783,_0xea4643,_0x3f7d6d){var _0x5af23a={'raw':![],'where':{}};var _0x1ad126={};var _0xf65615={'count':0x0,'rows':[]};return db[_0xf5a5('0x3a')][_0xf5a5('0x66')]({'where':{'id':_0x4d3783['params']['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0xea4643,null))[_0xf5a5('0x1d')](function(_0x4f904){if(_0x4f904){_0x1ad126[_0xf5a5('0x3e')]=_[_0xf5a5('0x3f')](db[_0xf5a5('0x65')][_0xf5a5('0x58')]);_0x1ad126[_0xf5a5('0x40')]=_[_0xf5a5('0x3f')](_0x4d3783[_0xf5a5('0x40')]);_0x1ad126[_0xf5a5('0x41')]=_[_0xf5a5('0x42')](_0x1ad126['model'],_0x1ad126['query']);_0x5af23a[_0xf5a5('0x44')]=_[_0xf5a5('0x42')](_0x1ad126[_0xf5a5('0x3e')],qs[_0xf5a5('0x43')](_0x4d3783[_0xf5a5('0x40')]['fields']));_0x5af23a[_0xf5a5('0x44')]=_0x5af23a['attributes']['length']?_0x5af23a[_0xf5a5('0x44')]:_0x1ad126['model'];if(!_0x4d3783[_0xf5a5('0x40')][_0xf5a5('0x46')](_0xf5a5('0x47'))){_0x5af23a[_0xf5a5('0x48')]=qs[_0xf5a5('0x48')](_0x4d3783[_0xf5a5('0x40')][_0xf5a5('0x48')]);_0x5af23a[_0xf5a5('0x2c')]=qs[_0xf5a5('0x2c')](_0x4d3783[_0xf5a5('0x40')]['offset']);}_0x5af23a['order']=qs['sort'](_0x4d3783[_0xf5a5('0x40')][_0xf5a5('0x4a')]);_0x5af23a[_0xf5a5('0x4b')]=qs[_0xf5a5('0x41')](_['pick'](_0x4d3783[_0xf5a5('0x40')],_0x1ad126[_0xf5a5('0x41')]));_0x5af23a[_0xf5a5('0x4b')][_0xf5a5('0x67')]=_0x4f904['id'];if(_0x4d3783[_0xf5a5('0x40')][_0xf5a5('0x4f')]){_0x5af23a['where']=_['merge'](_0x5af23a[_0xf5a5('0x4b')],{'$or':_[_0xf5a5('0x39')](_0x5af23a['attributes'],function(_0xb4b262){var _0x307f76={};_0x307f76[_0xb4b262]={'$like':'%'+_0x4d3783[_0xf5a5('0x40')]['filter']+'%'};return _0x307f76;})});}_0x5af23a=_[_0xf5a5('0x4d')]({},_0x5af23a,_0x4d3783[_0xf5a5('0x50')]);return db[_0xf5a5('0x65')]['count']({'where':_0x5af23a[_0xf5a5('0x4b')]})[_0xf5a5('0x1d')](function(_0x5ecf04){_0xf65615['count']=_0x5ecf04;if(_0x4d3783['query'][_0xf5a5('0x52')]){_0x5af23a[_0xf5a5('0x53')]=[{'all':!![]}];}return db[_0xf5a5('0x65')][_0xf5a5('0x54')](_0x5af23a);})[_0xf5a5('0x1d')](function(_0x2e3dc5){_0xf65615[_0xf5a5('0x55')]=_0x2e3dc5;return _0xf65615;});}})['then'](respondWithFilteredResult(_0xea4643,_0x5af23a))['catch'](handleError(_0xea4643,null));};exports['removeDispositions']=function(_0x500e44,_0x36a341,_0x4da51a){return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x500e44[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x36a341,null))[_0xf5a5('0x1d')](function(_0x1017a9){if(_0x1017a9){return _0x1017a9['removeDispositions'](_0x500e44[_0xf5a5('0x40')][_0xf5a5('0x68')]);}})[_0xf5a5('0x1d')](respondWithStatusCode(_0x36a341,null))[_0xf5a5('0x27')](handleError(_0x36a341,null));};exports[_0xf5a5('0x69')]=function(_0x312475,_0x479705,_0x252e9d){if(_0x312475[_0xf5a5('0x5b')]['id']){delete _0x312475[_0xf5a5('0x5b')]['id'];}return db[_0xf5a5('0x3a')]['find']({'where':{'id':_0x312475[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x479705,null))['then'](function(_0x4c5980){if(_0x4c5980){_0x312475[_0xf5a5('0x5b')]['OpenchannelAccountId']=_0x4c5980['id'];return db[_0xf5a5('0x6a')][_0xf5a5('0x5a')](_0x312475[_0xf5a5('0x5b')]);}})[_0xf5a5('0x1d')](respondWithResult(_0x479705,null))['catch'](handleError(_0x479705,null));};exports['getAnswers']=function(_0xfa4002,_0x4cf1e0,_0x16f469){var _0x4b2ce9={'raw':![],'where':{}};var _0x116b6f={};var _0x35b967={'count':0x0,'rows':[]};return db[_0xf5a5('0x3a')][_0xf5a5('0x66')]({'where':{'id':_0xfa4002[_0xf5a5('0x57')]['id']}})['then'](handleEntityNotFound(_0x4cf1e0,null))[_0xf5a5('0x1d')](function(_0x3e3b29){if(_0x3e3b29){_0x116b6f[_0xf5a5('0x3e')]=_[_0xf5a5('0x3f')](db[_0xf5a5('0x6a')]['rawAttributes']);_0x116b6f['query']=_['keys'](_0xfa4002[_0xf5a5('0x40')]);_0x116b6f[_0xf5a5('0x41')]=_['intersection'](_0x116b6f['model'],_0x116b6f[_0xf5a5('0x40')]);_0x4b2ce9['attributes']=_[_0xf5a5('0x42')](_0x116b6f['model'],qs[_0xf5a5('0x43')](_0xfa4002[_0xf5a5('0x40')][_0xf5a5('0x43')]));_0x4b2ce9[_0xf5a5('0x44')]=_0x4b2ce9[_0xf5a5('0x44')]['length']?_0x4b2ce9[_0xf5a5('0x44')]:_0x116b6f['model'];if(!_0xfa4002[_0xf5a5('0x40')][_0xf5a5('0x46')](_0xf5a5('0x47'))){_0x4b2ce9['limit']=qs['limit'](_0xfa4002[_0xf5a5('0x40')]['limit']);_0x4b2ce9[_0xf5a5('0x2c')]=qs[_0xf5a5('0x2c')](_0xfa4002[_0xf5a5('0x40')][_0xf5a5('0x2c')]);}_0x4b2ce9[_0xf5a5('0x49')]=qs[_0xf5a5('0x4a')](_0xfa4002['query']['sort']);_0x4b2ce9['where']=qs[_0xf5a5('0x41')](_['pick'](_0xfa4002[_0xf5a5('0x40')],_0x116b6f[_0xf5a5('0x41')]));_0x4b2ce9[_0xf5a5('0x4b')]['OpenchannelAccountId']=_0x3e3b29['id'];if(_0xfa4002[_0xf5a5('0x40')][_0xf5a5('0x4f')]){_0x4b2ce9[_0xf5a5('0x4b')]=_[_0xf5a5('0x4d')](_0x4b2ce9[_0xf5a5('0x4b')],{'$or':_[_0xf5a5('0x39')](_0x4b2ce9[_0xf5a5('0x44')],function(_0x1da2d8){var _0x26fd8c={};_0x26fd8c[_0x1da2d8]={'$like':'%'+_0xfa4002['query'][_0xf5a5('0x4f')]+'%'};return _0x26fd8c;})});}_0x4b2ce9=_[_0xf5a5('0x4d')]({},_0x4b2ce9,_0xfa4002[_0xf5a5('0x50')]);return db['CannedAnswer'][_0xf5a5('0x51')]({'where':_0x4b2ce9['where']})[_0xf5a5('0x1d')](function(_0x250126){_0x35b967['count']=_0x250126;if(_0xfa4002['query'][_0xf5a5('0x52')]){_0x4b2ce9['include']=[{'all':!![]}];}return db[_0xf5a5('0x6a')][_0xf5a5('0x54')](_0x4b2ce9);})['then'](function(_0x4d5228){_0x35b967[_0xf5a5('0x55')]=_0x4d5228;return _0x35b967;});}})[_0xf5a5('0x1d')](respondWithFilteredResult(_0x4cf1e0,_0x4b2ce9))['catch'](handleError(_0x4cf1e0,null));};exports[_0xf5a5('0x6b')]=function(_0x1f1555,_0x29f363,_0x13bf77){return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x1f1555['params']['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x29f363,null))['then'](function(_0x3cc14b){if(_0x3cc14b){return _0x3cc14b[_0xf5a5('0x6b')](_0x1f1555['query'][_0xf5a5('0x68')]);}})[_0xf5a5('0x1d')](respondWithStatusCode(_0x29f363,null))[_0xf5a5('0x27')](handleError(_0x29f363,null));};exports['notify']=function(_0x3238c7,_0x1b9b68,_0x4e7025){var _0x41ef12={'body':_0x3238c7[_0xf5a5('0x5b')],'channel':_0xf5a5('0x6c')};var _0x295c2d=[];var _0x1d6e4f=[];var _0x568e79={};var _0x37537d=![];return db[_0xf5a5('0x6d')]['describe']()[_0xf5a5('0x1d')](function(_0x2ef00f){if(!_0x2ef00f){throw new db[(_0xf5a5('0x6e'))][(_0xf5a5('0x6f'))](_0xf5a5('0x70'));}_0x295c2d=_['difference'](_[_0xf5a5('0x3f')](_0x2ef00f),[_0xf5a5('0x71'),'updatedAt']);_0x1d6e4f=_[_0xf5a5('0x72')](_[_0xf5a5('0x3f')](_0x2ef00f),['createdAt',_0xf5a5('0x73'),'CompanyId',_0xf5a5('0x74')]);if(_0x3238c7[_0xf5a5('0x5b')]['id']){delete _0x3238c7['body']['id'];}if(_[_0xf5a5('0x75')](_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x76')])){throw new db[(_0xf5a5('0x6e'))][(_0xf5a5('0x6f'))](_0xf5a5('0x77'));}if(_[_0xf5a5('0x75')](_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x5b')])||_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x5b')]===''){throw new db[(_0xf5a5('0x6e'))][(_0xf5a5('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf5a5('0x75')](_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x78')])){throw new db[(_0xf5a5('0x6e'))][(_0xf5a5('0x6f'))](_0xf5a5('0x79')+_0x1d6e4f);}if(!_['includes'](_0x1d6e4f,_0x3238c7[_0xf5a5('0x5b')]['mapKey'])){throw new db[(_0xf5a5('0x6e'))][(_0xf5a5('0x6f'))](_0xf5a5('0x7a')+_0x1d6e4f);}_0x568e79[_0x3238c7['body'][_0xf5a5('0x78')]]=_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x76')];})[_0xf5a5('0x1d')](function(){return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x3238c7[_0xf5a5('0x57')]['id']},'include':[{'model':db[_0xf5a5('0x7b')],'as':_0xf5a5('0x7c'),'include':[{'model':db[_0xf5a5('0x6d')],'as':_0xf5a5('0x7d'),'where':_0x568e79,'limit':0x1,'order':[[_0xf5a5('0x73'),_0xf5a5('0x7e')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1b9b68,null))[_0xf5a5('0x1d')](function(_0x86b87b){if(_0x86b87b&&_0x86b87b[_0xf5a5('0x7c')]){_0x41ef12[_0xf5a5('0x7f')]=_0x86b87b;_0x41ef12['applications']=_0x86b87b['Applications'];_0x41ef12[_0xf5a5('0x80')]=_0x86b87b[_0xf5a5('0x7c')];_0x41ef12[_0xf5a5('0x81')]=_[_0xf5a5('0x82')](_0x41ef12[_0xf5a5('0x81')],[_0xf5a5('0x83')],[_0xf5a5('0x84')]);if(_0x41ef12[_0xf5a5('0x7f')][_0xf5a5('0x85')]){delete _0x41ef12[_0xf5a5('0x7f')][_0xf5a5('0x85')];}if(_0x41ef12[_0xf5a5('0x7f')][_0xf5a5('0x7c')]&&_0x41ef12['account'][_0xf5a5('0x7c')][_0xf5a5('0x7d')][_0xf5a5('0x45')]){return _0x41ef12[_0xf5a5('0x7f')][_0xf5a5('0x7c')][_0xf5a5('0x7d')][0x0];}var _0x4ecbe1=_[_0xf5a5('0x86')](_0x3238c7['body'],{'firstName':_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x76')],'ListId':_0x86b87b['ListId']});_0x4ecbe1[_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x78')]]=_0x3238c7[_0xf5a5('0x5b')]['from'];return db[_0xf5a5('0x6d')]['create'](_0x4ecbe1,{'fields':_0x295c2d,'raw':!![]});}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x1b9b68,null))[_0xf5a5('0x1d')](function(_0x5bbecf){_0x41ef12[_0xf5a5('0x87')]=_0x5bbecf;if(_0x5bbecf){var _0x1d2172={'ContactId':_0x5bbecf['id'],'OpenchannelAccountId':_0x3238c7['params']['id'],'from':(_0x5bbecf[_0xf5a5('0x88')]||'')+'\x20'+(_0x5bbecf[_0xf5a5('0x89')]||'')};var _0x1ee2d7={'OpenchannelAccountId':_0x3238c7[_0xf5a5('0x57')]['id'],'closed':![]};if(_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8a')]){_0x1ee2d7[_0xf5a5('0x8a')]=_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8a')];return db[_0xf5a5('0x8b')][_0xf5a5('0x59')]({'where':_0x1ee2d7})[_0xf5a5('0x1d')](function(_0xf8bb8f){if(_0xf8bb8f){return[_0xf8bb8f,![]];}_0x1d2172[_0xf5a5('0x8a')]=_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8a')];_0x1d2172[_0xf5a5('0x8c')]=_0x3238c7['body'][_0xf5a5('0x8c')];return db['OpenchannelInteraction'][_0xf5a5('0x5a')](_0x1d2172)[_0xf5a5('0x1d')](function(_0x59c851){return[_0x59c851,!![]];});});}else{_0x1ee2d7[_0xf5a5('0x8a')]=null;}_0x1ee2d7[_0xf5a5('0x8d')]=_0x5bbecf['id'];return db[_0xf5a5('0x8b')][_0xf5a5('0x59')]({'where':_0x1ee2d7})['then'](function(_0x4a984a){if(_0x4a984a){return[_0x4a984a,![]];}return db[_0xf5a5('0x8b')][_0xf5a5('0x5a')](_0x1d2172)['then'](function(_0x3796dd){return[_0x3796dd,!![]];});});}})['spread'](function(_0x505a17,_0x1d6b7f){if(_0x505a17){_0x37537d=_0x1d6b7f;if(!_0x1d6b7f){var _0x5ab3fc={'from':(_0x41ef12['contact']['firstName']||'')+'\x20'+(_0x41ef12[_0xf5a5('0x87')]['lastName']||'')};if(_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8a')]&&_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8e')]&&_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x8a')]!=_0x3238c7['body']['messageId']){_0x5ab3fc[_0xf5a5('0x8a')]=_0x3238c7[_0xf5a5('0x5b')]['messageId'];}return _0x505a17[_0xf5a5('0x30')](_0x5ab3fc);}else{return _0x505a17;}}})[_0xf5a5('0x1d')](function(_0x306fc7){_0x41ef12[_0xf5a5('0x8f')]=_0x306fc7[_0xf5a5('0x31')]({'plain':!![]});_0x41ef12[_0xf5a5('0x8f')][_0xf5a5('0x90')]=_0x37537d;if(_0x41ef12[_0xf5a5('0x8f')][_0xf5a5('0x90')]){if(_0x41ef12[_0xf5a5('0x7f')][_0xf5a5('0x91')]){_0x41ef12[_0xf5a5('0x81')][_0xf5a5('0x92')]({'id':0x0,'priority':_0x41ef12['applications'][_0xf5a5('0x45')]+0x1,'app':_0xf5a5('0x93'),'appdata':_0xf5a5('0x94'),'interval':_0xf5a5('0x95')});}}return db['OpenchannelMessage'][_0xf5a5('0x5a')]({'body':_0x3238c7['body']['body'],'OpenchannelAccountId':_0x3238c7['params']['id'],'OpenchannelInteractionId':_0x306fc7['id'],'direction':'in','ContactId':_0x41ef12[_0xf5a5('0x87')]['id'],'AttachmentId':_0x3238c7[_0xf5a5('0x5b')][_0xf5a5('0x96')]});})[_0xf5a5('0x1d')](function(_0x591d78){_0x41ef12[_0xf5a5('0x26')]=_0x591d78;if(_0x41ef12[_0xf5a5('0x8f')][_0xf5a5('0x97')]){return db[_0xf5a5('0x98')][_0xf5a5('0x59')]({'attributes':['id',_0xf5a5('0x34')],'where':{'id':_0x41ef12[_0xf5a5('0x8f')]['UserId']}})[_0xf5a5('0x1d')](function(_0x9f244d){if(_0x9f244d){_0x41ef12[_0xf5a5('0x81')][_0xf5a5('0x99')]({'id':0x0,'priority':0x0,'app':_0xf5a5('0x9a'),'appdata':_0x9f244d[_0xf5a5('0x34')]+','+(_0x41ef12[_0xf5a5('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':_0xf5a5('0x95')});_0x41ef12[_0xf5a5('0x9b')]=![];}return respondWithRpcPromise(_0xf5a5('0x9c'),_0xf5a5('0x9d'),_0x41ef12);});}return respondWithRpcPromise('Start','startRouting',_0x41ef12);})[_0xf5a5('0x1d')](function(_0x472edb){respondWithRpcPromise(_0xf5a5('0x9e'),_0xf5a5('0x9e'),{'event':_0xf5a5('0x9f'),'message':_0x472edb},client9002);return _0x472edb;})['then'](respondWithResult(_0x1b9b68,null))['catch'](handleError(_0x1b9b68,null));};exports[_0xf5a5('0xa0')]=function(_0x29a57e,_0x374ebc,_0x32d01d){return db[_0xf5a5('0x3a')][_0xf5a5('0x66')]({'where':{'id':_0x29a57e[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x374ebc,null))[_0xf5a5('0x1d')](function(_0x15bb98){if(_0x15bb98){return db[_0xf5a5('0xa1')][_0xf5a5('0xa2')](function(_0x53f908){return db[_0xf5a5('0xa3')][_0xf5a5('0x33')]({'where':{'OpenchannelAccountId':_0x29a57e[_0xf5a5('0x57')]['id']},'transaction':_0x53f908})[_0xf5a5('0x1d')](function(_0xa4cbe7){var _0x3a655f=_[_0xf5a5('0x39')](_0x29a57e[_0xf5a5('0x5b')],function(_0x1a3715){_0x1a3715[_0xf5a5('0x67')]=_0x29a57e[_0xf5a5('0x57')]['id'];return _0x1a3715;});return db[_0xf5a5('0xa3')][_0xf5a5('0xa4')](_0x3a655f,{'transaction':_0x53f908});});})[_0xf5a5('0x1d')](function(){return db['OpenchannelApplication'][_0xf5a5('0xa5')]({'where':{'OpenchannelAccountId':_0x29a57e[_0xf5a5('0x57')]['id']},'order':_0xf5a5('0x83')});});}})[_0xf5a5('0x1d')](respondWithResult(_0x374ebc,null))[_0xf5a5('0x27')](handleError(_0x374ebc,null));};exports['getApplications']=function(_0x55bedb,_0x3c278e,_0x5138b4){var _0x366f49={};var _0x26d9b9={};var _0x3e5628;var _0x4b423d;return db[_0xf5a5('0x3a')][_0xf5a5('0x66')]({'where':{'id':_0x55bedb[_0xf5a5('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c278e,null))[_0xf5a5('0x1d')](function(_0x4783fe){if(_0x4783fe){_0x3e5628=_0x4783fe;_0x26d9b9[_0xf5a5('0x3e')]=_[_0xf5a5('0x3f')](db['OpenchannelApplication'][_0xf5a5('0x58')]);_0x26d9b9[_0xf5a5('0x40')]=_['keys'](_0x55bedb['query']);_0x26d9b9[_0xf5a5('0x41')]=_[_0xf5a5('0x42')](_0x26d9b9[_0xf5a5('0x3e')],_0x26d9b9[_0xf5a5('0x40')]);_0x366f49[_0xf5a5('0x44')]=_[_0xf5a5('0x42')](_0x26d9b9[_0xf5a5('0x3e')],qs['fields'](_0x55bedb['query'][_0xf5a5('0x43')]));_0x366f49['attributes']=_0x366f49[_0xf5a5('0x44')][_0xf5a5('0x45')]?_0x366f49[_0xf5a5('0x44')]:_0x26d9b9[_0xf5a5('0x3e')];_0x366f49['order']=qs[_0xf5a5('0x4a')](_0x55bedb[_0xf5a5('0x40')][_0xf5a5('0x4a')]);_0x366f49[_0xf5a5('0x4b')]=qs['filters'](_['pick'](_0x55bedb['query'],_0x26d9b9[_0xf5a5('0x41')]));if(_0x55bedb[_0xf5a5('0x40')][_0xf5a5('0x4f')]){_0x366f49['where']=_['merge'](_0x366f49[_0xf5a5('0x4b')],{'$or':_['map'](_0x366f49[_0xf5a5('0x44')],function(_0x35ce47){var _0x789b0d={};_0x789b0d[_0x35ce47]={'$like':'%'+_0x55bedb['query']['filter']+'%'};return _0x789b0d;})});}_0x366f49=_[_0xf5a5('0x4d')]({},_0x366f49,_0x55bedb['options']);return _0x3e5628['getApplications'](_0x366f49);}})[_0xf5a5('0x1d')](function(_0x54db54){if(_0x54db54){_0x4b423d=_0x54db54[_0xf5a5('0x45')];if(!_0x55bedb[_0xf5a5('0x40')][_0xf5a5('0x46')](_0xf5a5('0x47'))){_0x366f49['limit']=qs[_0xf5a5('0x48')](_0x55bedb[_0xf5a5('0x40')][_0xf5a5('0x48')]);_0x366f49[_0xf5a5('0x2c')]=qs[_0xf5a5('0x2c')](_0x55bedb[_0xf5a5('0x40')]['offset']);}return _0x3e5628[_0xf5a5('0xa6')](_0x366f49);}})[_0xf5a5('0x1d')](function(_0x43598f){if(_0x43598f){return _0x43598f?{'count':_0x4b423d,'rows':_0x43598f}:null;}})['then'](respondWithResult(_0x3c278e,null))[_0xf5a5('0x27')](handleError(_0x3c278e,null));};exports[_0xf5a5('0xa7')]=function(_0x3855c1,_0x377247,_0x9cb451){var _0xaadcc6={'raw':![],'where':{}};var _0xacaa88={};var _0x58dbf2={'count':0x0,'rows':[]};return db[_0xf5a5('0x3a')]['findOne']({'where':{'id':_0x3855c1[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x377247,null))['then'](function(_0x59b2ca){if(_0x59b2ca){_0xacaa88[_0xf5a5('0x3e')]=_[_0xf5a5('0x3f')](db['OpenchannelInteraction'][_0xf5a5('0x58')]);_0xacaa88['query']=_[_0xf5a5('0x3f')](_0x3855c1[_0xf5a5('0x40')]);_0xacaa88['filters']=_['intersection'](_0xacaa88[_0xf5a5('0x3e')],_0xacaa88[_0xf5a5('0x40')]);_0xaadcc6[_0xf5a5('0x44')]=_[_0xf5a5('0x42')](_0xacaa88[_0xf5a5('0x3e')],qs[_0xf5a5('0x43')](_0x3855c1[_0xf5a5('0x40')][_0xf5a5('0x43')]));_0xaadcc6[_0xf5a5('0x44')]=_0xaadcc6[_0xf5a5('0x44')][_0xf5a5('0x45')]?_0xaadcc6[_0xf5a5('0x44')]:_0xacaa88[_0xf5a5('0x3e')];if(!_0x3855c1[_0xf5a5('0x40')]['hasOwnProperty'](_0xf5a5('0x47'))){_0xaadcc6['limit']=qs[_0xf5a5('0x48')](_0x3855c1[_0xf5a5('0x40')]['limit']);_0xaadcc6[_0xf5a5('0x2c')]=qs[_0xf5a5('0x2c')](_0x3855c1['query'][_0xf5a5('0x2c')]);}_0xaadcc6['order']=qs['sort'](_0x3855c1[_0xf5a5('0x40')]['sort']);_0xaadcc6['where']=qs[_0xf5a5('0x41')](_[_0xf5a5('0x4c')](_0x3855c1[_0xf5a5('0x40')],_0xacaa88[_0xf5a5('0x41')]));_0xaadcc6[_0xf5a5('0x4b')]['OpenchannelAccountId']=_0x59b2ca['id'];if(_0x3855c1[_0xf5a5('0x40')][_0xf5a5('0x4f')]){_0xaadcc6['where']=_[_0xf5a5('0x4d')](_0xaadcc6[_0xf5a5('0x4b')],{'$or':_[_0xf5a5('0x39')](_0xaadcc6['attributes'],function(_0x3619dd){var _0x365bc8={};_0x365bc8[_0x3619dd]={'$like':'%'+_0x3855c1[_0xf5a5('0x40')][_0xf5a5('0x4f')]+'%'};return _0x365bc8;})});}_0xaadcc6=_['merge']({},_0xaadcc6,_0x3855c1['options']);return db[_0xf5a5('0x8b')][_0xf5a5('0x51')]({'where':_0xaadcc6[_0xf5a5('0x4b')]})[_0xf5a5('0x1d')](function(_0x553efe){_0x58dbf2[_0xf5a5('0x51')]=_0x553efe;if(_0x3855c1[_0xf5a5('0x40')]['includeAll']){_0xaadcc6[_0xf5a5('0x53')]=[{'model':db[_0xf5a5('0x6d')],'as':_0xf5a5('0xa8'),'required':![]},{'model':db[_0xf5a5('0x98')],'as':_0xf5a5('0xa9'),'attributes':[_0xf5a5('0x34'),'fullname','internal'],'required':![]},{'model':db[_0xf5a5('0xaa')],'as':_0xf5a5('0xab'),'attributes':['id',_0xf5a5('0x34'),_0xf5a5('0xac')],'where':_0x3855c1['query'][_0xf5a5('0xad')]?{'id':_0x3855c1[_0xf5a5('0x40')][_0xf5a5('0xad')]}:undefined,'required':_0x3855c1[_0xf5a5('0x40')][_0xf5a5('0xad')]?!![]:![]}];}return db[_0xf5a5('0x8b')][_0xf5a5('0x54')](_0xaadcc6);})[_0xf5a5('0x1d')](function(_0x2e143a){_0x58dbf2[_0xf5a5('0x55')]=_0x2e143a;return _0x58dbf2;});}})['then'](respondWithFilteredResult(_0x377247,_0xaadcc6))[_0xf5a5('0x27')](handleError(_0x377247,null));};exports[_0xf5a5('0xae')]=function(_0x2171f,_0x34b699,_0x51dc29){return db['OpenchannelAccount'][_0xf5a5('0x59')]({'where':{'id':_0x2171f[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x34b699,null))[_0xf5a5('0x1d')](function(_0x2fb4ee){if(_0x2fb4ee){return _0x2fb4ee['addAgents'](_0x2171f[_0xf5a5('0x5b')][_0xf5a5('0x68')],_[_0xf5a5('0xaf')](_0x2171f[_0xf5a5('0x5b')],[_0xf5a5('0x68'),'id'])||{})[_0xf5a5('0xb0')](function(_0x2d6fc6){for(var _0x8315cd=0x0;_0x8315cd<_0x2171f[_0xf5a5('0x5b')][_0xf5a5('0x68')]['length'];_0x8315cd+=0x1){socket[_0xf5a5('0xb1')]('userOpenchannelAccount:save',{'UserId':Number(_0x2171f[_0xf5a5('0x5b')]['ids'][_0x8315cd]),'OpenchannelAccountId':Number(_0x2171f[_0xf5a5('0x57')]['id'])});}return _0x2d6fc6;});}})['then'](respondWithResult(_0x34b699,null))[_0xf5a5('0x27')](handleError(_0x34b699,null));};exports['removeAgents']=function(_0x1756bf,_0x287269,_0x3d1786){return db[_0xf5a5('0x3a')][_0xf5a5('0x59')]({'where':{'id':_0x1756bf[_0xf5a5('0x57')]['id']}})['then'](handleEntityNotFound(_0x287269,null))['then'](function(_0x387356){if(_0x387356){return _0x387356[_0xf5a5('0xb2')](_0x1756bf['query'][_0xf5a5('0x68')])[_0xf5a5('0x1d')](function(){if(_[_0xf5a5('0xb3')](_0x1756bf['query']['ids'])){for(var _0x543e54=0x0;_0x543e54<_0x1756bf['query'][_0xf5a5('0x68')][_0xf5a5('0x45')];_0x543e54+=0x1){socket[_0xf5a5('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1756bf[_0xf5a5('0x40')]['ids'][_0x543e54]),'OpenchannelAccountId':Number(_0x1756bf['params']['id'])});}}else{socket[_0xf5a5('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1756bf[_0xf5a5('0x40')][_0xf5a5('0x68')]),'OpenchannelAccountId':Number(_0x1756bf[_0xf5a5('0x57')]['id'])});}});}})[_0xf5a5('0x1d')](respondWithStatusCode(_0x287269,null))[_0xf5a5('0x27')](handleError(_0x287269,null));};exports[_0xf5a5('0xb4')]=function(_0x48d181,_0x5d10ec,_0x32289a){var _0x5a859e={};var _0x4f28ae={};var _0x5558f3;var _0x582573;return db[_0xf5a5('0x3a')][_0xf5a5('0x66')]({'where':{'id':_0x48d181[_0xf5a5('0x57')]['id']}})[_0xf5a5('0x1d')](handleEntityNotFound(_0x5d10ec,null))[_0xf5a5('0x1d')](function(_0x674683){if(_0x674683){_0x5558f3=_0x674683;_0x4f28ae[_0xf5a5('0x3e')]=_['keys'](db['User']['rawAttributes']);_0x4f28ae['query']=_['keys'](_0x48d181[_0xf5a5('0x40')]);_0x4f28ae[_0xf5a5('0x41')]=_[_0xf5a5('0x42')](_0x4f28ae[_0xf5a5('0x3e')],_0x4f28ae[_0xf5a5('0x40')]);_0x5a859e['attributes']=_[_0xf5a5('0x42')](_0x4f28ae[_0xf5a5('0x3e')],qs[_0xf5a5('0x43')](_0x48d181['query']['fields']));_0x5a859e['attributes']=_0x5a859e[_0xf5a5('0x44')][_0xf5a5('0x45')]?_0x5a859e[_0xf5a5('0x44')]:_0x4f28ae[_0xf5a5('0x3e')];_0x5a859e[_0xf5a5('0x49')]=qs[_0xf5a5('0x4a')](_0x48d181['query'][_0xf5a5('0x4a')]);_0x5a859e[_0xf5a5('0x4b')]=qs[_0xf5a5('0x41')](_[_0xf5a5('0x4c')](_0x48d181[_0xf5a5('0x40')],_0x4f28ae[_0xf5a5('0x41')]));if(_0x48d181[_0xf5a5('0x40')][_0xf5a5('0x4f')]){_0x5a859e['where']=_['merge'](_0x5a859e[_0xf5a5('0x4b')],{'$or':_['map'](_0x5a859e['attributes'],function(_0x3fea77){var _0x4efb33={};_0x4efb33[_0x3fea77]={'$like':'%'+_0x48d181[_0xf5a5('0x40')]['filter']+'%'};return _0x4efb33;})});}_0x5a859e=_[_0xf5a5('0x4d')]({},_0x5a859e,_0x48d181[_0xf5a5('0x50')]);return _0x5558f3[_0xf5a5('0xb4')](_0x5a859e);}})[_0xf5a5('0x1d')](function(_0x15d003){if(_0x15d003){_0x582573=_0x15d003[_0xf5a5('0x45')];if(!_0x48d181[_0xf5a5('0x40')][_0xf5a5('0x46')]('nolimit')){_0x5a859e[_0xf5a5('0x48')]=qs[_0xf5a5('0x48')](_0x48d181[_0xf5a5('0x40')][_0xf5a5('0x48')]);_0x5a859e['offset']=qs[_0xf5a5('0x2c')](_0x48d181['query']['offset']);}return _0x5558f3['getAgents'](_0x5a859e);}})['then'](function(_0x12f487){if(_0x12f487){return _0x12f487?{'count':_0x582573,'rows':_0x12f487}:null;}})['then'](respondWithResult(_0x5d10ec,null))['catch'](handleError(_0x5d10ec,null));};exports[_0xf5a5('0x35')]=function(_0x1b706d,_0x1068ca,_0xc624d8){var _0xc91a93,_0x3c16ad,_0x26f54b;if(_[_0xf5a5('0x75')](_0x1b706d[_0xf5a5('0x5b')][_0xf5a5('0x5b')])||_0x1b706d[_0xf5a5('0x5b')][_0xf5a5('0x5b')]===''){throw new db[(_0xf5a5('0x6e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf5a5('0x75')](_0x1b706d[_0xf5a5('0x5b')]['to'])){}_0xc91a93=_0x1b706d[_0xf5a5('0x5b')]['to'];return db[_0xf5a5('0x3a')]['findOne']({'where':{'id':_0x1b706d[_0xf5a5('0x57')]['id']}})['then'](handleEntityNotFound(_0x1068ca,null))[_0xf5a5('0x1d')](function(_0x178bc4){if(_0x178bc4){return db['OpenchannelAccount'][_0xf5a5('0x59')]({'where':{'id':_0x178bc4['id']},'include':[{'model':db['CmList'],'as':_0xf5a5('0x7c'),'include':[{'model':db[_0xf5a5('0x6d')],'as':_0xf5a5('0x7d'),'where':{[_0x178bc4[_0xf5a5('0x78')]]:_0xc91a93},'limit':0x1,'order':[[_0xf5a5('0x73'),_0xf5a5('0x7e')]]}]}]})[_0xf5a5('0x1d')](handleEntityNotFound(_0x1068ca,null))['then'](function(_0xe64a9c){if(_0xe64a9c&&_0xe64a9c['List']){_0x3c16ad=_0xe64a9c[_0xf5a5('0x31')]({'plain':!![]});if(_0x3c16ad['List']&&_0x3c16ad[_0xf5a5('0x7c')][_0xf5a5('0x7d')][_0xf5a5('0x45')]){return _0x3c16ad['List'][_0xf5a5('0x7d')][0x0];}return db[_0xf5a5('0x6d')]['create'](_['defaults'](_0x1b706d[_0xf5a5('0x5b')],{'firstName':_0xc91a93,[_0xe64a9c['mapKey']]:_0xc91a93,'phone':_0xc91a93,'ListId':_0x3c16ad[_0xf5a5('0x74')]}));}})['then'](handleEntityNotFound(_0x1068ca,null))['then'](function(_0x155dab){if(_0x155dab){_0x26f54b=_0x155dab;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x26f54b['id'],'closed':![],'OpenchannelAccountId':_0x3c16ad['id']}})[_0xf5a5('0x1d')](function(_0x258427){if(_0x258427){return[_0x258427,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x1b706d[_0xf5a5('0x5c')]['id'],'ContactId':_0x26f54b['id'],'OpenchannelAccountId':_0x3c16ad['id'],'lastMsgDirection':_0xf5a5('0xb5'),'Messages':[_[_0xf5a5('0x4d')](_0x1b706d[_0xf5a5('0x5b')],{'read':![],'body':_0x1b706d[_0xf5a5('0x5b')][_0xf5a5('0x5b')],'OpenchannelAccountId':_0x3c16ad['id'],'UserId':_0x1b706d[_0xf5a5('0x5c')]['id'],'ContactId':_0x26f54b['id']})]},{'include':[{'model':db[_0xf5a5('0xb6')],'as':_0xf5a5('0xb7')}]})[_0xf5a5('0x1d')](function(_0x1811b8){return[_0x1811b8,!![]];});});}})[_0xf5a5('0xb0')](function(_0xabcc5c,_0x313164){if(_0x313164){return _0xabcc5c;}return db[_0xf5a5('0xb6')]['create'](_[_0xf5a5('0x4d')](_0x1b706d[_0xf5a5('0x5b')],{'read':![],'body':_0x1b706d['body'][_0xf5a5('0x5b')],'OpenchannelAccountId':_0x3c16ad['id'],'OpenchannelInteractionId':_0xabcc5c['id'],'UserId':_0x1b706d[_0xf5a5('0x5c')]['id'],'ContactId':_0x26f54b['id']}))[_0xf5a5('0x1d')](function(_0xbabbff){_0xabcc5c['dataValues'][_0xf5a5('0xb7')]=[];_0xabcc5c[_0xf5a5('0xb8')][_0xf5a5('0xb7')]['push'](_0xbabbff['dataValues']);return _0xabcc5c;});});}})['then'](respondWithResult(_0x1068ca,null))[_0xf5a5('0x27')](handleError(_0x1068ca,null));}; \ No newline at end of file +var _0x7f5c=['mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','priority','defaults','contact','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','findAndCountAll','getApplications','hasOwnProperty','User','Owner','fullname','internal','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','isNil','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','where','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x128d69,_0x144558){var _0x2b0338=function(_0x194843){while(--_0x194843){_0x128d69['push'](_0x128d69['shift']());}};_0x2b0338(++_0x144558);}(_0x7f5c,0xf7));var _0xc7f5=function(_0x37ea87,_0x192ef4){_0x37ea87=_0x37ea87-0x0;var _0x3bb06c=_0x7f5c[_0x37ea87];return _0x3bb06c;};'use strict';var emlformat=require(_0xc7f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7f5('0x2'));var moment=require(_0xc7f5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc7f5('0x4'));var sox=require(_0xc7f5('0x5'));var csv=require(_0xc7f5('0x6'));var ejs=require(_0xc7f5('0x7'));var fs=require('fs');var fs_extra=require(_0xc7f5('0x8'));var _=require(_0xc7f5('0x9'));var squel=require(_0xc7f5('0xa'));var crypto=require(_0xc7f5('0xb'));var jsforce=require(_0xc7f5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc7f5('0xd'));var Redis=require(_0xc7f5('0xe'));var authService=require(_0xc7f5('0xf'));var qs=require(_0xc7f5('0x10'));var as=require(_0xc7f5('0x11'));var hardwareService=require(_0xc7f5('0x12'));var logger=require(_0xc7f5('0x13'))(_0xc7f5('0x14'));var utils=require(_0xc7f5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7f5('0x16'));var db=require(_0xc7f5('0x17'))['db'];config[_0xc7f5('0x18')]=_['defaults'](config[_0xc7f5('0x18')],{'host':_0xc7f5('0x19'),'port':0x18eb});var socket=require(_0xc7f5('0x1a'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc7f5('0x1b')]({'port':0x232c});var client9002=jayson[_0xc7f5('0x1c')][_0xc7f5('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x156cb6,_0x7fb11b,_0x214de0,_0x2a7700){return new BPromise(function(_0x1e2e10,_0x5c6648){var _0x10e899=_0x2a7700||client;return _0x10e899['request'](_0x156cb6,_0x214de0)[_0xc7f5('0x1d')](function(_0x280bd2){logger[_0xc7f5('0x1e')](_0xc7f5('0x1f'),_0x7fb11b,_0xc7f5('0x20'));logger[_0xc7f5('0x21')](_0xc7f5('0x22'),_0x7fb11b,'request\x20sent',JSON[_0xc7f5('0x23')](_0x280bd2));if(_0x280bd2[_0xc7f5('0x24')]){if(_0x280bd2['error'][_0xc7f5('0x25')]===0x1f4){logger[_0xc7f5('0x24')](_0xc7f5('0x1f'),_0x7fb11b,_0x280bd2[_0xc7f5('0x24')][_0xc7f5('0x26')]);return _0x5c6648(_0x280bd2[_0xc7f5('0x24')][_0xc7f5('0x26')]);}logger[_0xc7f5('0x24')](_0xc7f5('0x1f'),_0x7fb11b,_0x280bd2[_0xc7f5('0x24')]['message']);return _0x1e2e10(_0x280bd2[_0xc7f5('0x24')][_0xc7f5('0x26')]);}else{logger[_0xc7f5('0x1e')](_0xc7f5('0x1f'),_0x7fb11b,_0xc7f5('0x20'));_0x1e2e10(_0x280bd2[_0xc7f5('0x27')][_0xc7f5('0x26')]);}})[_0xc7f5('0x28')](function(_0x186914){logger[_0xc7f5('0x24')](_0xc7f5('0x1f'),_0x7fb11b,_0x186914);_0x5c6648(_0x186914);});});}function respondWithStatusCode(_0x2135dc,_0x46dc8e){_0x46dc8e=_0x46dc8e||0xcc;return function(_0x4bc3fa){if(_0x4bc3fa){return _0x2135dc[_0xc7f5('0x29')](_0x46dc8e);}return _0x2135dc[_0xc7f5('0x2a')](_0x46dc8e)[_0xc7f5('0x2b')]();};}function respondWithResult(_0x2bd97b,_0x55e8a5){_0x55e8a5=_0x55e8a5||0xc8;return function(_0x2e7677){if(_0x2e7677){return _0x2bd97b[_0xc7f5('0x2a')](_0x55e8a5)[_0xc7f5('0x2c')](_0x2e7677);}};}function respondWithFilteredResult(_0x385d9a,_0xa430d3){return function(_0x547aa6){if(_0x547aa6){var _0x3039a3=typeof _0xa430d3[_0xc7f5('0x2d')]===_0xc7f5('0x2e')&&typeof _0xa430d3[_0xc7f5('0x2f')]===_0xc7f5('0x2e');var _0x4fe3a4=_0x547aa6['count'];var _0x36051d=_0x3039a3?0x0:_0xa430d3[_0xc7f5('0x2d')];var _0x1f1a92=_0x3039a3?_0x547aa6[_0xc7f5('0x30')]:_0xa430d3[_0xc7f5('0x2d')]+_0xa430d3['limit'];var _0xfcc0c3;if(_0x1f1a92>=_0x4fe3a4){_0x1f1a92=_0x4fe3a4;_0xfcc0c3=0xc8;}else{_0xfcc0c3=0xce;}_0x385d9a[_0xc7f5('0x2a')](_0xfcc0c3);return _0x385d9a[_0xc7f5('0x31')](_0xc7f5('0x32'),_0x36051d+'-'+_0x1f1a92+'/'+_0x4fe3a4)[_0xc7f5('0x2c')](_0x547aa6);}return null;};}function patchUpdates(_0x10daa6){return function(_0x434ead){try{jsonpatch[_0xc7f5('0x33')](_0x434ead,_0x10daa6,!![]);}catch(_0x2c45a9){return BPromise[_0xc7f5('0x34')](_0x2c45a9);}return _0x434ead[_0xc7f5('0x35')]();};}function saveUpdates(_0xfbf6c4,_0x3ee2f9){return function(_0x18e920){if(_0x18e920){return _0x18e920['update'](_0xfbf6c4)[_0xc7f5('0x1d')](function(_0x5123e4){return _0x5123e4;});}return null;};}function removeEntity(_0x4b555f,_0x2d7a5e){return function(_0x3f7524){if(_0x3f7524){return _0x3f7524[_0xc7f5('0x36')]()['then'](function(){var _0x267141=_0x3f7524[_0xc7f5('0x37')]({'plain':!![]});var _0x232ca1=_0xc7f5('0x38');return db[_0xc7f5('0x39')][_0xc7f5('0x36')]({'where':{'type':_0x232ca1,'resourceId':_0x267141['id']}})['then'](function(){return _0x3f7524;});})[_0xc7f5('0x1d')](function(){_0x4b555f[_0xc7f5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eb6ee,_0x2ee382){return function(_0x35aeb2){if(!_0x35aeb2){_0x2eb6ee[_0xc7f5('0x29')](0x194);}return _0x35aeb2;};}function handleError(_0x313c24,_0x1c5168){_0x1c5168=_0x1c5168||0x1f4;return function(_0x38ca64){logger[_0xc7f5('0x24')](_0x38ca64[_0xc7f5('0x3a')]);if(_0x38ca64[_0xc7f5('0x3b')]){delete _0x38ca64[_0xc7f5('0x3b')];}_0x313c24[_0xc7f5('0x2a')](_0x1c5168)[_0xc7f5('0x3c')](_0x38ca64);};}exports[_0xc7f5('0x3d')]=function(_0x3a892f,_0x3e44a0){var _0x573fe3={'include':[{'model':db[_0xc7f5('0x3e')],'as':_0xc7f5('0x3f')}]},_0x4c356d={},_0x47295a={'count':0x0,'rows':[]};var _0x2244d3=_[_0xc7f5('0x40')](db[_0xc7f5('0x41')]['rawAttributes'],function(_0x4827c8){return{'name':_0x4827c8[_0xc7f5('0x42')],'type':_0x4827c8['type']['key']};});_0x4c356d['model']=_[_0xc7f5('0x40')](_0x2244d3,_0xc7f5('0x3b'));_0x4c356d[_0xc7f5('0x43')]=_[_0xc7f5('0x44')](_0x3a892f[_0xc7f5('0x43')]);_0x4c356d[_0xc7f5('0x45')]=_[_0xc7f5('0x46')](_0x4c356d[_0xc7f5('0x47')],_0x4c356d[_0xc7f5('0x43')]);_0x573fe3[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x4c356d[_0xc7f5('0x47')],qs['fields'](_0x3a892f['query'][_0xc7f5('0x49')]));_0x573fe3[_0xc7f5('0x48')]=_0x573fe3[_0xc7f5('0x48')][_0xc7f5('0x4a')]?_0x573fe3[_0xc7f5('0x48')]:_0x4c356d['model'];if(!_0x3a892f['query']['hasOwnProperty'](_0xc7f5('0x4b'))){_0x573fe3[_0xc7f5('0x2f')]=qs[_0xc7f5('0x2f')](_0x3a892f[_0xc7f5('0x43')]['limit']);_0x573fe3[_0xc7f5('0x2d')]=qs[_0xc7f5('0x2d')](_0x3a892f[_0xc7f5('0x43')][_0xc7f5('0x2d')]);}_0x573fe3[_0xc7f5('0x4c')]=qs[_0xc7f5('0x4d')](_0x3a892f['query'][_0xc7f5('0x4d')]);_0x573fe3['where']=qs[_0xc7f5('0x45')](_['pick'](_0x3a892f[_0xc7f5('0x43')],_0x4c356d[_0xc7f5('0x45')]),_0x2244d3);if(_0x3a892f[_0xc7f5('0x43')][_0xc7f5('0x4e')]){_0x573fe3['where']=_[_0xc7f5('0x4f')](_0x573fe3[_0xc7f5('0x50')],{'$or':_[_0xc7f5('0x40')](_0x2244d3,function(_0x2ba510){if(_0x2ba510['type']!=='VIRTUAL'){var _0x50aad2={};_0x50aad2[_0x2ba510[_0xc7f5('0x3b')]]={'$like':'%'+_0x3a892f[_0xc7f5('0x43')][_0xc7f5('0x4e')]+'%'};return _0x50aad2;}})});}_0x573fe3=_['merge']({},_0x573fe3,_0x3a892f[_0xc7f5('0x51')]);var _0x2bc28c={'where':_0x573fe3[_0xc7f5('0x50')]};return db[_0xc7f5('0x41')][_0xc7f5('0x30')](_0x2bc28c)['then'](function(_0x31f62e){_0x47295a[_0xc7f5('0x30')]=_0x31f62e;if(_0x3a892f[_0xc7f5('0x43')][_0xc7f5('0x52')]){_0x573fe3[_0xc7f5('0x53')]=[{'all':!![]}];}return db[_0xc7f5('0x41')][_0xc7f5('0x54')](_0x573fe3);})[_0xc7f5('0x1d')](function(_0x5d9746){_0x47295a[_0xc7f5('0x55')]=_0x5d9746;return _0x47295a;})[_0xc7f5('0x1d')](respondWithFilteredResult(_0x3e44a0,_0x573fe3))[_0xc7f5('0x28')](handleError(_0x3e44a0,null));};exports[_0xc7f5('0x56')]=function(_0x321c05,_0x774f39){var _0x31cc12={'raw':![],'where':{'id':_0x321c05['params']['id']},'include':[{'model':db[_0xc7f5('0x3e')],'as':_0xc7f5('0x3f')}]},_0x16b071={};_0x16b071[_0xc7f5('0x47')]=_['keys'](db[_0xc7f5('0x41')][_0xc7f5('0x57')]);_0x16b071['query']=_[_0xc7f5('0x44')](_0x321c05[_0xc7f5('0x43')]);_0x16b071['filters']=_[_0xc7f5('0x46')](_0x16b071[_0xc7f5('0x47')],_0x16b071[_0xc7f5('0x43')]);_0x31cc12['attributes']=_['intersection'](_0x16b071[_0xc7f5('0x47')],qs[_0xc7f5('0x49')](_0x321c05[_0xc7f5('0x43')]['fields']));_0x31cc12['attributes']=_0x31cc12[_0xc7f5('0x48')][_0xc7f5('0x4a')]?_0x31cc12[_0xc7f5('0x48')]:_0x16b071[_0xc7f5('0x47')];if(_0x321c05[_0xc7f5('0x43')][_0xc7f5('0x52')]){_0x31cc12[_0xc7f5('0x53')]=[{'all':!![]}];}_0x31cc12=_[_0xc7f5('0x4f')]({},_0x31cc12,_0x321c05[_0xc7f5('0x51')]);return db['OpenchannelAccount'][_0xc7f5('0x58')](_0x31cc12)[_0xc7f5('0x1d')](handleEntityNotFound(_0x774f39,null))[_0xc7f5('0x1d')](respondWithResult(_0x774f39,null))[_0xc7f5('0x28')](handleError(_0x774f39,null));};exports[_0xc7f5('0x59')]=function(_0x3fd902,_0x15640c){return db[_0xc7f5('0x41')]['create'](_0x3fd902[_0xc7f5('0x5a')],{})['then'](function(_0x3d2c2b){var _0x21867d=_0x3fd902[_0xc7f5('0x5b')]['get']({'plain':!![]});if(!_0x21867d)throw new Error(_0xc7f5('0x5c'));if(_0x21867d['role']===_0xc7f5('0x5b')){var _0x5a75b5=_0x3d2c2b[_0xc7f5('0x37')]({'plain':!![]});var _0x3c4804=_0xc7f5('0x38');return db[_0xc7f5('0x5d')][_0xc7f5('0x58')]({'where':{'name':_0x3c4804,'userProfileId':_0x21867d[_0xc7f5('0x5e')]},'raw':!![]})[_0xc7f5('0x1d')](function(_0x2f2b90){if(_0x2f2b90&&_0x2f2b90[_0xc7f5('0x5f')]===0x0){return db[_0xc7f5('0x39')]['create']({'name':_0x5a75b5['name'],'resourceId':_0x5a75b5['id'],'type':_0x2f2b90[_0xc7f5('0x3b')],'sectionId':_0x2f2b90['id']},{})['then'](function(){return _0x3d2c2b;});}else{return _0x3d2c2b;}})[_0xc7f5('0x28')](function(_0x2319d1){logger[_0xc7f5('0x24')](_0xc7f5('0x60'),_0x2319d1);throw _0x2319d1;});}return _0x3d2c2b;})[_0xc7f5('0x1d')](respondWithResult(_0x15640c,0xc9))['catch'](handleError(_0x15640c,null));};exports[_0xc7f5('0x61')]=function(_0x2cc954,_0x1265a5){if(_0x2cc954['body']['id']){delete _0x2cc954[_0xc7f5('0x5a')]['id'];}return db[_0xc7f5('0x41')]['find']({'where':{'id':_0x2cc954[_0xc7f5('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xc7f5('0x3f')}]})[_0xc7f5('0x1d')](handleEntityNotFound(_0x1265a5,null))['then'](saveUpdates(_0x2cc954['body'],null))[_0xc7f5('0x1d')](respondWithResult(_0x1265a5,null))['catch'](handleError(_0x1265a5,null));};exports[_0xc7f5('0x36')]=function(_0x534c65,_0x15d3f1){return db[_0xc7f5('0x41')]['find']({'where':{'id':_0x534c65[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x15d3f1,null))[_0xc7f5('0x1d')](removeEntity(_0x15d3f1,null))[_0xc7f5('0x28')](handleError(_0x15d3f1,null));};exports[_0xc7f5('0x63')]=function(_0x4043b5,_0x403f72){return db['OpenchannelAccount']['describe']()[_0xc7f5('0x1d')](respondWithResult(_0x403f72,null))[_0xc7f5('0x28')](handleError(_0x403f72,null));};exports[_0xc7f5('0x64')]=function(_0x508400,_0x2e50b7,_0x4142cb){if(_0x508400[_0xc7f5('0x5a')]['id']){delete _0x508400['body']['id'];}return db['OpenchannelAccount'][_0xc7f5('0x58')]({'where':{'id':_0x508400['params']['id']}})['then'](handleEntityNotFound(_0x2e50b7,null))['then'](function(_0x492243){if(_0x492243){_0x508400[_0xc7f5('0x5a')][_0xc7f5('0x65')]=_0x492243['id'];return db['Disposition'][_0xc7f5('0x59')](_0x508400['body']);}})[_0xc7f5('0x1d')](respondWithResult(_0x2e50b7,null))['catch'](handleError(_0x2e50b7,null));};exports[_0xc7f5('0x66')]=function(_0x2fea57,_0x1ed79e,_0xfce874){var _0x3e8ee4={'raw':![],'where':{}};var _0x1c2e57={};var _0x503d8f={'count':0x0,'rows':[]};return db[_0xc7f5('0x41')][_0xc7f5('0x67')]({'where':{'id':_0x2fea57[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x1ed79e,null))[_0xc7f5('0x1d')](function(_0x1a44d4){if(_0x1a44d4){_0x1c2e57[_0xc7f5('0x47')]=_[_0xc7f5('0x44')](db[_0xc7f5('0x68')][_0xc7f5('0x57')]);_0x1c2e57[_0xc7f5('0x43')]=_[_0xc7f5('0x44')](_0x2fea57[_0xc7f5('0x43')]);_0x1c2e57['filters']=_['intersection'](_0x1c2e57[_0xc7f5('0x47')],_0x1c2e57[_0xc7f5('0x43')]);_0x3e8ee4[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x1c2e57[_0xc7f5('0x47')],qs['fields'](_0x2fea57[_0xc7f5('0x43')][_0xc7f5('0x49')]));_0x3e8ee4[_0xc7f5('0x48')]=_0x3e8ee4[_0xc7f5('0x48')][_0xc7f5('0x4a')]?_0x3e8ee4[_0xc7f5('0x48')]:_0x1c2e57[_0xc7f5('0x47')];if(!_0x2fea57[_0xc7f5('0x43')]['hasOwnProperty']('nolimit')){_0x3e8ee4['limit']=qs[_0xc7f5('0x2f')](_0x2fea57['query'][_0xc7f5('0x2f')]);_0x3e8ee4[_0xc7f5('0x2d')]=qs[_0xc7f5('0x2d')](_0x2fea57[_0xc7f5('0x43')]['offset']);}_0x3e8ee4['order']=qs['sort'](_0x2fea57[_0xc7f5('0x43')][_0xc7f5('0x4d')]);_0x3e8ee4['where']=qs[_0xc7f5('0x45')](_[_0xc7f5('0x69')](_0x2fea57[_0xc7f5('0x43')],_0x1c2e57[_0xc7f5('0x45')]));_0x3e8ee4[_0xc7f5('0x50')][_0xc7f5('0x65')]=_0x1a44d4['id'];if(_0x2fea57[_0xc7f5('0x43')][_0xc7f5('0x4e')]){_0x3e8ee4[_0xc7f5('0x50')]=_[_0xc7f5('0x4f')](_0x3e8ee4[_0xc7f5('0x50')],{'$or':_[_0xc7f5('0x40')](_0x3e8ee4[_0xc7f5('0x48')],function(_0x14e9cd){var _0x544da7={};_0x544da7[_0x14e9cd]={'$like':'%'+_0x2fea57[_0xc7f5('0x43')]['filter']+'%'};return _0x544da7;})});}_0x3e8ee4=_['merge']({},_0x3e8ee4,_0x2fea57['options']);return db[_0xc7f5('0x68')][_0xc7f5('0x30')]({'where':_0x3e8ee4['where']})['then'](function(_0x22b4f5){_0x503d8f[_0xc7f5('0x30')]=_0x22b4f5;if(_0x2fea57[_0xc7f5('0x43')]['includeAll']){_0x3e8ee4[_0xc7f5('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xc7f5('0x54')](_0x3e8ee4);})[_0xc7f5('0x1d')](function(_0x27bc06){_0x503d8f[_0xc7f5('0x55')]=_0x27bc06;return _0x503d8f;});}})['then'](respondWithFilteredResult(_0x1ed79e,_0x3e8ee4))[_0xc7f5('0x28')](handleError(_0x1ed79e,null));};exports['removeDispositions']=function(_0x471fc8,_0xb0c60a,_0x527723){return db[_0xc7f5('0x41')][_0xc7f5('0x58')]({'where':{'id':_0x471fc8[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0xb0c60a,null))['then'](function(_0x58646c){if(_0x58646c){return _0x58646c[_0xc7f5('0x6a')](_0x471fc8[_0xc7f5('0x43')][_0xc7f5('0x6b')]);}})[_0xc7f5('0x1d')](respondWithStatusCode(_0xb0c60a,null))['catch'](handleError(_0xb0c60a,null));};exports[_0xc7f5('0x6c')]=function(_0x2adc1e,_0x270637,_0x3747d3){if(_0x2adc1e[_0xc7f5('0x5a')]['id']){delete _0x2adc1e[_0xc7f5('0x5a')]['id'];}return db[_0xc7f5('0x41')]['find']({'where':{'id':_0x2adc1e[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x270637,null))[_0xc7f5('0x1d')](function(_0x25d2ec){if(_0x25d2ec){_0x2adc1e[_0xc7f5('0x5a')]['OpenchannelAccountId']=_0x25d2ec['id'];return db[_0xc7f5('0x6d')]['create'](_0x2adc1e['body']);}})[_0xc7f5('0x1d')](respondWithResult(_0x270637,null))[_0xc7f5('0x28')](handleError(_0x270637,null));};exports['getAnswers']=function(_0x526ea4,_0x42f5a0,_0x565bac){var _0x5b81d9={'raw':![],'where':{}};var _0x2aaebd={};var _0x266e63={'count':0x0,'rows':[]};return db[_0xc7f5('0x41')]['findOne']({'where':{'id':_0x526ea4[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x42f5a0,null))[_0xc7f5('0x1d')](function(_0x5d4c49){if(_0x5d4c49){_0x2aaebd[_0xc7f5('0x47')]=_[_0xc7f5('0x44')](db[_0xc7f5('0x6d')]['rawAttributes']);_0x2aaebd[_0xc7f5('0x43')]=_['keys'](_0x526ea4['query']);_0x2aaebd[_0xc7f5('0x45')]=_['intersection'](_0x2aaebd[_0xc7f5('0x47')],_0x2aaebd['query']);_0x5b81d9[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x2aaebd[_0xc7f5('0x47')],qs[_0xc7f5('0x49')](_0x526ea4[_0xc7f5('0x43')]['fields']));_0x5b81d9[_0xc7f5('0x48')]=_0x5b81d9[_0xc7f5('0x48')][_0xc7f5('0x4a')]?_0x5b81d9[_0xc7f5('0x48')]:_0x2aaebd[_0xc7f5('0x47')];if(!_0x526ea4['query']['hasOwnProperty']('nolimit')){_0x5b81d9['limit']=qs[_0xc7f5('0x2f')](_0x526ea4[_0xc7f5('0x43')]['limit']);_0x5b81d9[_0xc7f5('0x2d')]=qs[_0xc7f5('0x2d')](_0x526ea4[_0xc7f5('0x43')][_0xc7f5('0x2d')]);}_0x5b81d9[_0xc7f5('0x4c')]=qs[_0xc7f5('0x4d')](_0x526ea4['query'][_0xc7f5('0x4d')]);_0x5b81d9[_0xc7f5('0x50')]=qs[_0xc7f5('0x45')](_[_0xc7f5('0x69')](_0x526ea4['query'],_0x2aaebd[_0xc7f5('0x45')]));_0x5b81d9[_0xc7f5('0x50')][_0xc7f5('0x65')]=_0x5d4c49['id'];if(_0x526ea4[_0xc7f5('0x43')]['filter']){_0x5b81d9['where']=_[_0xc7f5('0x4f')](_0x5b81d9['where'],{'$or':_['map'](_0x5b81d9['attributes'],function(_0x57f42e){var _0x287d4a={};_0x287d4a[_0x57f42e]={'$like':'%'+_0x526ea4[_0xc7f5('0x43')][_0xc7f5('0x4e')]+'%'};return _0x287d4a;})});}_0x5b81d9=_[_0xc7f5('0x4f')]({},_0x5b81d9,_0x526ea4[_0xc7f5('0x51')]);return db[_0xc7f5('0x6d')][_0xc7f5('0x30')]({'where':_0x5b81d9['where']})[_0xc7f5('0x1d')](function(_0x1e2aa8){_0x266e63[_0xc7f5('0x30')]=_0x1e2aa8;if(_0x526ea4['query']['includeAll']){_0x5b81d9[_0xc7f5('0x53')]=[{'all':!![]}];}return db[_0xc7f5('0x6d')]['findAll'](_0x5b81d9);})[_0xc7f5('0x1d')](function(_0x45e9c1){_0x266e63[_0xc7f5('0x55')]=_0x45e9c1;return _0x266e63;});}})[_0xc7f5('0x1d')](respondWithFilteredResult(_0x42f5a0,_0x5b81d9))[_0xc7f5('0x28')](handleError(_0x42f5a0,null));};exports['removeAnswers']=function(_0x47574c,_0x228ee2,_0x30ce22){return db[_0xc7f5('0x41')]['find']({'where':{'id':_0x47574c['params']['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x228ee2,null))[_0xc7f5('0x1d')](function(_0x400ce5){if(_0x400ce5){return _0x400ce5['removeAnswers'](_0x47574c[_0xc7f5('0x43')][_0xc7f5('0x6b')]);}})[_0xc7f5('0x1d')](respondWithStatusCode(_0x228ee2,null))[_0xc7f5('0x28')](handleError(_0x228ee2,null));};exports[_0xc7f5('0x6e')]=function(_0x125dee,_0x2ab397,_0x4ec193){var _0x50d17b={'body':_0x125dee[_0xc7f5('0x5a')],'channel':_0xc7f5('0x6f')};var _0x28a91e=[];var _0x3f64da=[];var _0x36c1cd={};var _0x5db19f=![];return db[_0xc7f5('0x70')][_0xc7f5('0x63')]()[_0xc7f5('0x1d')](function(_0x2f554a){if(!_0x2f554a){throw new db[(_0xc7f5('0x71'))]['ValidationError'](_0xc7f5('0x72'));}_0x28a91e=_[_0xc7f5('0x73')](_[_0xc7f5('0x44')](_0x2f554a),['createdAt',_0xc7f5('0x74')]);_0x3f64da=_[_0xc7f5('0x73')](_[_0xc7f5('0x44')](_0x2f554a),['createdAt',_0xc7f5('0x74'),_0xc7f5('0x75'),_0xc7f5('0x76')]);if(_0x125dee[_0xc7f5('0x5a')]['id']){delete _0x125dee['body']['id'];}if(_['isNil'](_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x77')])){throw new db[(_0xc7f5('0x71'))]['ValidationError'](_0xc7f5('0x78'));}if(_['isNil'](_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x5a')])||_0x125dee['body'][_0xc7f5('0x5a')]===''){throw new db[(_0xc7f5('0x71'))][(_0xc7f5('0x79'))](_0xc7f5('0x7a'));}if(_['isNil'](_0x125dee[_0xc7f5('0x5a')]['mapKey'])){throw new db[(_0xc7f5('0x71'))][(_0xc7f5('0x79'))](_0xc7f5('0x7b')+_0x3f64da);}if(!_[_0xc7f5('0x7c')](_0x3f64da,_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x7d')])){throw new db['Sequelize'][(_0xc7f5('0x79'))](_0xc7f5('0x7e')+_0x3f64da);}_0x36c1cd[_0x125dee[_0xc7f5('0x5a')]['mapKey']]=_0x125dee[_0xc7f5('0x5a')]['from'];})[_0xc7f5('0x1d')](function(){return db[_0xc7f5('0x41')][_0xc7f5('0x58')]({'where':{'id':_0x125dee[_0xc7f5('0x62')]['id']},'include':[{'model':db[_0xc7f5('0x7f')],'as':_0xc7f5('0x80'),'include':[{'model':db['CmContact'],'as':_0xc7f5('0x81'),'where':_0x36c1cd,'limit':0x1,'order':[[_0xc7f5('0x74'),_0xc7f5('0x82')]]}]},{'model':db[_0xc7f5('0x83')],'as':'Applications'}]});})[_0xc7f5('0x1d')](handleEntityNotFound(_0x2ab397,null))['then'](function(_0x1e5295){if(_0x1e5295&&_0x1e5295[_0xc7f5('0x80')]){_0x50d17b[_0xc7f5('0x84')]=_0x1e5295;_0x50d17b[_0xc7f5('0x85')]=_0x1e5295[_0xc7f5('0x86')];_0x50d17b[_0xc7f5('0x87')]=_0x1e5295[_0xc7f5('0x80')];_0x50d17b[_0xc7f5('0x85')]=_['orderBy'](_0x50d17b[_0xc7f5('0x85')],[_0xc7f5('0x88')],['asc']);if(_0x50d17b[_0xc7f5('0x84')][_0xc7f5('0x86')]){delete _0x50d17b[_0xc7f5('0x84')][_0xc7f5('0x86')];}if(_0x50d17b[_0xc7f5('0x84')]['List']&&_0x50d17b['account'][_0xc7f5('0x80')]['Contacts']['length']){return _0x50d17b[_0xc7f5('0x84')][_0xc7f5('0x80')]['Contacts'][0x0];}var _0x17d6c6=_[_0xc7f5('0x89')](_0x125dee[_0xc7f5('0x5a')],{'firstName':_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x77')],'ListId':_0x1e5295[_0xc7f5('0x76')]});_0x17d6c6[_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x7d')]]=_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x77')];return db[_0xc7f5('0x70')][_0xc7f5('0x59')](_0x17d6c6,{'fields':_0x28a91e,'raw':!![]});}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x2ab397,null))[_0xc7f5('0x1d')](function(_0xcafb7a){_0x50d17b[_0xc7f5('0x8a')]=_0xcafb7a;if(_0xcafb7a){var _0x3879ad={'ContactId':_0xcafb7a['id'],'OpenchannelAccountId':_0x125dee[_0xc7f5('0x62')]['id'],'from':(_0xcafb7a['firstName']||'')+'\x20'+(_0xcafb7a['lastName']||'')};var _0x41c78f={'OpenchannelAccountId':_0x125dee['params']['id'],'closed':![]};if(_0x125dee[_0xc7f5('0x5a')]['threadId']){_0x41c78f[_0xc7f5('0x8b')]=_0x125dee['body'][_0xc7f5('0x8b')];return db['OpenchannelInteraction'][_0xc7f5('0x58')]({'where':_0x41c78f})[_0xc7f5('0x1d')](function(_0x5dbc8c){if(_0x5dbc8c){return[_0x5dbc8c,![]];}_0x3879ad[_0xc7f5('0x8b')]=_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x8b')];_0x3879ad['externalUrl']=_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x8c')];return db[_0xc7f5('0x8d')][_0xc7f5('0x59')](_0x3879ad)[_0xc7f5('0x1d')](function(_0x1dc1e3){return[_0x1dc1e3,!![]];});});}else{_0x41c78f[_0xc7f5('0x8b')]=null;}_0x41c78f[_0xc7f5('0x8e')]=_0xcafb7a['id'];return db[_0xc7f5('0x8d')][_0xc7f5('0x58')]({'where':_0x41c78f})['then'](function(_0x5fa06b){if(_0x5fa06b){return[_0x5fa06b,![]];}return db[_0xc7f5('0x8d')]['create'](_0x3879ad)['then'](function(_0x2ff563){return[_0x2ff563,!![]];});});}})[_0xc7f5('0x8f')](function(_0x24bfba,_0x3b90fa){if(_0x24bfba){_0x5db19f=_0x3b90fa;if(!_0x3b90fa){var _0x3deaae={'from':(_0x50d17b[_0xc7f5('0x8a')][_0xc7f5('0x90')]||'')+'\x20'+(_0x50d17b[_0xc7f5('0x8a')][_0xc7f5('0x91')]||'')};if(_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x8b')]&&_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x92')]&&_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x8b')]!=_0x125dee['body'][_0xc7f5('0x92')]){_0x3deaae[_0xc7f5('0x8b')]=_0x125dee['body'][_0xc7f5('0x92')];}return _0x24bfba['update'](_0x3deaae);}else{return _0x24bfba;}}})[_0xc7f5('0x1d')](function(_0x36cdde){_0x50d17b[_0xc7f5('0x93')]=_0x36cdde[_0xc7f5('0x37')]({'plain':!![]});_0x50d17b[_0xc7f5('0x93')][_0xc7f5('0x94')]=_0x5db19f;if(_0x50d17b['interaction']['created']){if(_0x50d17b[_0xc7f5('0x84')][_0xc7f5('0x95')]){_0x50d17b[_0xc7f5('0x85')][_0xc7f5('0x96')]({'id':0x0,'priority':_0x50d17b[_0xc7f5('0x85')][_0xc7f5('0x4a')]+0x1,'app':_0xc7f5('0x97'),'appdata':_0xc7f5('0x98'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0xc7f5('0x59')]({'body':_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x5a')],'OpenchannelAccountId':_0x125dee[_0xc7f5('0x62')]['id'],'OpenchannelInteractionId':_0x36cdde['id'],'direction':'in','ContactId':_0x50d17b['contact']['id'],'AttachmentId':_0x125dee[_0xc7f5('0x5a')][_0xc7f5('0x99')]});})[_0xc7f5('0x1d')](function(_0x266c00){_0x50d17b[_0xc7f5('0x26')]=_0x266c00;if(_0x50d17b[_0xc7f5('0x93')][_0xc7f5('0x9a')]){return db['User'][_0xc7f5('0x58')]({'attributes':['id','name'],'where':{'id':_0x50d17b[_0xc7f5('0x93')][_0xc7f5('0x9a')]}})[_0xc7f5('0x1d')](function(_0x3b6ef5){if(_0x3b6ef5){_0x50d17b[_0xc7f5('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc7f5('0x9b'),'appdata':_0x3b6ef5[_0xc7f5('0x3b')]+','+(_0x50d17b['account'][_0xc7f5('0x9c')]||0xa),'interval':_0xc7f5('0x9d')});_0x50d17b[_0xc7f5('0x9e')]=![];}return respondWithRpcPromise(_0xc7f5('0x9f'),_0xc7f5('0xa0'),_0x50d17b);});}return respondWithRpcPromise(_0xc7f5('0x9f'),'startRouting',_0x50d17b);})['then'](function(_0x2b5ea9){respondWithRpcPromise(_0xc7f5('0xa1'),_0xc7f5('0xa1'),{'event':'notify','message':_0x2b5ea9},client9002);return _0x2b5ea9;})[_0xc7f5('0x1d')](respondWithResult(_0x2ab397,null))[_0xc7f5('0x28')](handleError(_0x2ab397,null));};exports[_0xc7f5('0xa2')]=function(_0x5b902e,_0x53f933,_0x227708){return db[_0xc7f5('0x41')][_0xc7f5('0x67')]({'where':{'id':_0x5b902e[_0xc7f5('0x62')]['id']}})['then'](handleEntityNotFound(_0x53f933,null))[_0xc7f5('0x1d')](function(_0x5bd828){if(_0x5bd828){return db['sequelize'][_0xc7f5('0xa3')](function(_0xd3b4d6){return db[_0xc7f5('0x83')][_0xc7f5('0x36')]({'where':{'OpenchannelAccountId':_0x5b902e[_0xc7f5('0x62')]['id']},'transaction':_0xd3b4d6})[_0xc7f5('0x1d')](function(_0x4994b2){var _0x525f18=_[_0xc7f5('0x40')](_0x5b902e['body'],function(_0x1566df){_0x1566df[_0xc7f5('0x65')]=_0x5b902e['params']['id'];return _0x1566df;});return db[_0xc7f5('0x83')]['bulkCreate'](_0x525f18,{'transaction':_0xd3b4d6});});})[_0xc7f5('0x1d')](function(){return db['OpenchannelApplication'][_0xc7f5('0xa4')]({'where':{'OpenchannelAccountId':_0x5b902e[_0xc7f5('0x62')]['id']},'order':'priority'});});}})[_0xc7f5('0x1d')](respondWithResult(_0x53f933,null))[_0xc7f5('0x28')](handleError(_0x53f933,null));};exports[_0xc7f5('0xa5')]=function(_0x5e792f,_0x122472,_0x1b78d9){var _0xb7d5eb={};var _0x3f0773={};var _0x42d4d5;var _0x4c8767;return db['OpenchannelAccount'][_0xc7f5('0x67')]({'where':{'id':_0x5e792f[_0xc7f5('0x62')]['id']}})['then'](handleEntityNotFound(_0x122472,null))[_0xc7f5('0x1d')](function(_0x2841e2){if(_0x2841e2){_0x42d4d5=_0x2841e2;_0x3f0773['model']=_['keys'](db[_0xc7f5('0x83')][_0xc7f5('0x57')]);_0x3f0773[_0xc7f5('0x43')]=_[_0xc7f5('0x44')](_0x5e792f['query']);_0x3f0773[_0xc7f5('0x45')]=_[_0xc7f5('0x46')](_0x3f0773[_0xc7f5('0x47')],_0x3f0773[_0xc7f5('0x43')]);_0xb7d5eb[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x3f0773[_0xc7f5('0x47')],qs['fields'](_0x5e792f[_0xc7f5('0x43')][_0xc7f5('0x49')]));_0xb7d5eb[_0xc7f5('0x48')]=_0xb7d5eb['attributes'][_0xc7f5('0x4a')]?_0xb7d5eb[_0xc7f5('0x48')]:_0x3f0773[_0xc7f5('0x47')];_0xb7d5eb['order']=qs[_0xc7f5('0x4d')](_0x5e792f['query'][_0xc7f5('0x4d')]);_0xb7d5eb[_0xc7f5('0x50')]=qs[_0xc7f5('0x45')](_['pick'](_0x5e792f[_0xc7f5('0x43')],_0x3f0773[_0xc7f5('0x45')]));if(_0x5e792f[_0xc7f5('0x43')][_0xc7f5('0x4e')]){_0xb7d5eb['where']=_[_0xc7f5('0x4f')](_0xb7d5eb[_0xc7f5('0x50')],{'$or':_[_0xc7f5('0x40')](_0xb7d5eb[_0xc7f5('0x48')],function(_0x233d3a){var _0x4d5497={};_0x4d5497[_0x233d3a]={'$like':'%'+_0x5e792f['query']['filter']+'%'};return _0x4d5497;})});}_0xb7d5eb=_[_0xc7f5('0x4f')]({},_0xb7d5eb,_0x5e792f[_0xc7f5('0x51')]);return _0x42d4d5['getApplications'](_0xb7d5eb);}})[_0xc7f5('0x1d')](function(_0x5272dd){if(_0x5272dd){_0x4c8767=_0x5272dd[_0xc7f5('0x4a')];if(!_0x5e792f[_0xc7f5('0x43')][_0xc7f5('0xa6')]('nolimit')){_0xb7d5eb[_0xc7f5('0x2f')]=qs[_0xc7f5('0x2f')](_0x5e792f['query'][_0xc7f5('0x2f')]);_0xb7d5eb[_0xc7f5('0x2d')]=qs[_0xc7f5('0x2d')](_0x5e792f['query'][_0xc7f5('0x2d')]);}return _0x42d4d5['getApplications'](_0xb7d5eb);}})[_0xc7f5('0x1d')](function(_0x51c289){if(_0x51c289){return _0x51c289?{'count':_0x4c8767,'rows':_0x51c289}:null;}})[_0xc7f5('0x1d')](respondWithResult(_0x122472,null))['catch'](handleError(_0x122472,null));};exports['getInteractions']=function(_0xe132f,_0x3722c1,_0x5535c4){var _0x19f2c9={'raw':![],'where':{}};var _0x467c10={};var _0x5976a3={'count':0x0,'rows':[]};return db[_0xc7f5('0x41')][_0xc7f5('0x67')]({'where':{'id':_0xe132f['params']['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x3722c1,null))['then'](function(_0x417222){if(_0x417222){_0x467c10['model']=_[_0xc7f5('0x44')](db[_0xc7f5('0x8d')][_0xc7f5('0x57')]);_0x467c10['query']=_[_0xc7f5('0x44')](_0xe132f[_0xc7f5('0x43')]);_0x467c10['filters']=_[_0xc7f5('0x46')](_0x467c10[_0xc7f5('0x47')],_0x467c10[_0xc7f5('0x43')]);_0x19f2c9[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x467c10[_0xc7f5('0x47')],qs[_0xc7f5('0x49')](_0xe132f['query'][_0xc7f5('0x49')]));_0x19f2c9['attributes']=_0x19f2c9[_0xc7f5('0x48')][_0xc7f5('0x4a')]?_0x19f2c9[_0xc7f5('0x48')]:_0x467c10['model'];if(!_0xe132f[_0xc7f5('0x43')]['hasOwnProperty'](_0xc7f5('0x4b'))){_0x19f2c9['limit']=qs['limit'](_0xe132f['query'][_0xc7f5('0x2f')]);_0x19f2c9[_0xc7f5('0x2d')]=qs['offset'](_0xe132f[_0xc7f5('0x43')][_0xc7f5('0x2d')]);}_0x19f2c9[_0xc7f5('0x4c')]=qs['sort'](_0xe132f[_0xc7f5('0x43')]['sort']);_0x19f2c9[_0xc7f5('0x50')]=qs[_0xc7f5('0x45')](_[_0xc7f5('0x69')](_0xe132f[_0xc7f5('0x43')],_0x467c10[_0xc7f5('0x45')]));_0x19f2c9[_0xc7f5('0x50')][_0xc7f5('0x65')]=_0x417222['id'];if(_0xe132f[_0xc7f5('0x43')][_0xc7f5('0x4e')]){_0x19f2c9[_0xc7f5('0x50')]=_['merge'](_0x19f2c9[_0xc7f5('0x50')],{'$or':_['map'](_0x19f2c9[_0xc7f5('0x48')],function(_0x4fef20){var _0xae516={};_0xae516[_0x4fef20]={'$like':'%'+_0xe132f[_0xc7f5('0x43')][_0xc7f5('0x4e')]+'%'};return _0xae516;})});}_0x19f2c9=_['merge']({},_0x19f2c9,_0xe132f[_0xc7f5('0x51')]);return db[_0xc7f5('0x8d')][_0xc7f5('0x30')]({'where':_0x19f2c9[_0xc7f5('0x50')]})[_0xc7f5('0x1d')](function(_0x570df9){_0x5976a3[_0xc7f5('0x30')]=_0x570df9;if(_0xe132f[_0xc7f5('0x43')]['includeAll']){_0x19f2c9[_0xc7f5('0x53')]=[{'model':db[_0xc7f5('0x70')],'as':'Contact','required':![]},{'model':db[_0xc7f5('0xa7')],'as':_0xc7f5('0xa8'),'attributes':[_0xc7f5('0x3b'),_0xc7f5('0xa9'),_0xc7f5('0xaa')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xc7f5('0x3b'),_0xc7f5('0xab')],'where':_0xe132f['query'][_0xc7f5('0xac')]?{'id':_0xe132f[_0xc7f5('0x43')][_0xc7f5('0xac')]}:undefined,'required':_0xe132f[_0xc7f5('0x43')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xc7f5('0x54')](_0x19f2c9);})['then'](function(_0x2147a0){_0x5976a3[_0xc7f5('0x55')]=_0x2147a0;return _0x5976a3;});}})['then'](respondWithFilteredResult(_0x3722c1,_0x19f2c9))[_0xc7f5('0x28')](handleError(_0x3722c1,null));};exports[_0xc7f5('0xad')]=function(_0x5def6a,_0x30d061,_0x4ab215){return db[_0xc7f5('0x41')]['find']({'where':{'id':_0x5def6a['params']['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x30d061,null))[_0xc7f5('0x1d')](function(_0x5ee3a3){if(_0x5ee3a3){return _0x5ee3a3[_0xc7f5('0xad')](_0x5def6a[_0xc7f5('0x5a')]['ids'],_[_0xc7f5('0xae')](_0x5def6a[_0xc7f5('0x5a')],[_0xc7f5('0x6b'),'id'])||{})['spread'](function(_0x302a21){for(var _0xb0e48f=0x0;_0xb0e48f<_0x5def6a[_0xc7f5('0x5a')][_0xc7f5('0x6b')][_0xc7f5('0x4a')];_0xb0e48f+=0x1){socket[_0xc7f5('0xaf')](_0xc7f5('0xb0'),{'UserId':Number(_0x5def6a['body'][_0xc7f5('0x6b')][_0xb0e48f]),'OpenchannelAccountId':Number(_0x5def6a[_0xc7f5('0x62')]['id'])});}return _0x302a21;});}})['then'](respondWithResult(_0x30d061,null))[_0xc7f5('0x28')](handleError(_0x30d061,null));};exports[_0xc7f5('0xb1')]=function(_0x3cd58e,_0x53866a,_0x2800e5){return db[_0xc7f5('0x41')][_0xc7f5('0x58')]({'where':{'id':_0x3cd58e['params']['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x53866a,null))[_0xc7f5('0x1d')](function(_0xea608e){if(_0xea608e){return _0xea608e[_0xc7f5('0xb1')](_0x3cd58e['query'][_0xc7f5('0x6b')])[_0xc7f5('0x1d')](function(){if(_[_0xc7f5('0xb2')](_0x3cd58e[_0xc7f5('0x43')][_0xc7f5('0x6b')])){for(var _0x5e1eed=0x0;_0x5e1eed<_0x3cd58e[_0xc7f5('0x43')][_0xc7f5('0x6b')][_0xc7f5('0x4a')];_0x5e1eed+=0x1){socket[_0xc7f5('0xaf')](_0xc7f5('0xb3'),{'UserId':Number(_0x3cd58e[_0xc7f5('0x43')][_0xc7f5('0x6b')][_0x5e1eed]),'OpenchannelAccountId':Number(_0x3cd58e[_0xc7f5('0x62')]['id'])});}}else{socket[_0xc7f5('0xaf')](_0xc7f5('0xb3'),{'UserId':Number(_0x3cd58e[_0xc7f5('0x43')][_0xc7f5('0x6b')]),'OpenchannelAccountId':Number(_0x3cd58e[_0xc7f5('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x53866a,null))[_0xc7f5('0x28')](handleError(_0x53866a,null));};exports[_0xc7f5('0xb4')]=function(_0x2d5353,_0x12976b,_0x428515){var _0x2916b2={};var _0x163330={};var _0x5975c9;var _0x13647c;return db[_0xc7f5('0x41')]['findOne']({'where':{'id':_0x2d5353[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x12976b,null))['then'](function(_0x2842eb){if(_0x2842eb){_0x5975c9=_0x2842eb;_0x163330[_0xc7f5('0x47')]=_[_0xc7f5('0x44')](db['User'][_0xc7f5('0x57')]);_0x163330[_0xc7f5('0x43')]=_['keys'](_0x2d5353[_0xc7f5('0x43')]);_0x163330[_0xc7f5('0x45')]=_[_0xc7f5('0x46')](_0x163330[_0xc7f5('0x47')],_0x163330[_0xc7f5('0x43')]);_0x2916b2[_0xc7f5('0x48')]=_[_0xc7f5('0x46')](_0x163330[_0xc7f5('0x47')],qs['fields'](_0x2d5353[_0xc7f5('0x43')][_0xc7f5('0x49')]));_0x2916b2[_0xc7f5('0x48')]=_0x2916b2['attributes'][_0xc7f5('0x4a')]?_0x2916b2[_0xc7f5('0x48')]:_0x163330['model'];_0x2916b2[_0xc7f5('0x4c')]=qs[_0xc7f5('0x4d')](_0x2d5353[_0xc7f5('0x43')]['sort']);_0x2916b2[_0xc7f5('0x50')]=qs[_0xc7f5('0x45')](_['pick'](_0x2d5353['query'],_0x163330['filters']));if(_0x2d5353[_0xc7f5('0x43')][_0xc7f5('0x4e')]){_0x2916b2['where']=_[_0xc7f5('0x4f')](_0x2916b2[_0xc7f5('0x50')],{'$or':_[_0xc7f5('0x40')](_0x2916b2['attributes'],function(_0x54fff4){var _0x2ae7e2={};_0x2ae7e2[_0x54fff4]={'$like':'%'+_0x2d5353[_0xc7f5('0x43')][_0xc7f5('0x4e')]+'%'};return _0x2ae7e2;})});}_0x2916b2=_[_0xc7f5('0x4f')]({},_0x2916b2,_0x2d5353[_0xc7f5('0x51')]);return _0x5975c9[_0xc7f5('0xb4')](_0x2916b2);}})[_0xc7f5('0x1d')](function(_0x440be2){if(_0x440be2){_0x13647c=_0x440be2['length'];if(!_0x2d5353[_0xc7f5('0x43')][_0xc7f5('0xa6')]('nolimit')){_0x2916b2[_0xc7f5('0x2f')]=qs[_0xc7f5('0x2f')](_0x2d5353[_0xc7f5('0x43')][_0xc7f5('0x2f')]);_0x2916b2[_0xc7f5('0x2d')]=qs[_0xc7f5('0x2d')](_0x2d5353[_0xc7f5('0x43')]['offset']);}return _0x5975c9[_0xc7f5('0xb4')](_0x2916b2);}})[_0xc7f5('0x1d')](function(_0x45ab1c){if(_0x45ab1c){return _0x45ab1c?{'count':_0x13647c,'rows':_0x45ab1c}:null;}})[_0xc7f5('0x1d')](respondWithResult(_0x12976b,null))[_0xc7f5('0x28')](handleError(_0x12976b,null));};exports[_0xc7f5('0x3c')]=function(_0x8b3e30,_0x1f3ccb,_0x1400a6){var _0x4b1e66,_0x5cf0cd,_0x45f49b;if(_[_0xc7f5('0xb5')](_0x8b3e30[_0xc7f5('0x5a')][_0xc7f5('0x5a')])||_0x8b3e30[_0xc7f5('0x5a')][_0xc7f5('0x5a')]===''){throw new db[(_0xc7f5('0x71'))][(_0xc7f5('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x8b3e30['body']['to'])){}_0x4b1e66=_0x8b3e30[_0xc7f5('0x5a')]['to'];return db[_0xc7f5('0x41')]['findOne']({'where':{'id':_0x8b3e30[_0xc7f5('0x62')]['id']}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x1f3ccb,null))[_0xc7f5('0x1d')](function(_0x3b5492){if(_0x3b5492){return db[_0xc7f5('0x41')][_0xc7f5('0x58')]({'where':{'id':_0x3b5492['id']},'include':[{'model':db[_0xc7f5('0x7f')],'as':_0xc7f5('0x80'),'include':[{'model':db[_0xc7f5('0x70')],'as':_0xc7f5('0x81'),'where':{[_0x3b5492['mapKey']]:_0x4b1e66},'limit':0x1,'order':[[_0xc7f5('0x74'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1f3ccb,null))[_0xc7f5('0x1d')](function(_0x4c942a){if(_0x4c942a&&_0x4c942a[_0xc7f5('0x80')]){_0x5cf0cd=_0x4c942a['get']({'plain':!![]});if(_0x5cf0cd[_0xc7f5('0x80')]&&_0x5cf0cd[_0xc7f5('0x80')][_0xc7f5('0x81')][_0xc7f5('0x4a')]){return _0x5cf0cd[_0xc7f5('0x80')][_0xc7f5('0x81')][0x0];}return db['CmContact'][_0xc7f5('0x59')](_['defaults'](_0x8b3e30[_0xc7f5('0x5a')],{'firstName':_0x4b1e66,[_0x4c942a[_0xc7f5('0x7d')]]:_0x4b1e66,'phone':_0x4b1e66,'ListId':_0x5cf0cd[_0xc7f5('0x76')]}));}})[_0xc7f5('0x1d')](handleEntityNotFound(_0x1f3ccb,null))[_0xc7f5('0x1d')](function(_0x5a1996){if(_0x5a1996){_0x45f49b=_0x5a1996;return db[_0xc7f5('0x8d')]['find']({'where':{'ContactId':_0x45f49b['id'],'closed':![],'OpenchannelAccountId':_0x5cf0cd['id']}})['then'](function(_0x523f51){if(_0x523f51){return[_0x523f51,![]];}return db['OpenchannelInteraction'][_0xc7f5('0x59')]({'UserId':_0x8b3e30[_0xc7f5('0x5b')]['id'],'ContactId':_0x45f49b['id'],'OpenchannelAccountId':_0x5cf0cd['id'],'lastMsgDirection':_0xc7f5('0xb6'),'Messages':[_[_0xc7f5('0x4f')](_0x8b3e30['body'],{'read':![],'body':_0x8b3e30[_0xc7f5('0x5a')][_0xc7f5('0x5a')],'OpenchannelAccountId':_0x5cf0cd['id'],'UserId':_0x8b3e30[_0xc7f5('0x5b')]['id'],'ContactId':_0x45f49b['id']})]},{'include':[{'model':db[_0xc7f5('0xb7')],'as':_0xc7f5('0xb8')}]})['then'](function(_0x10f378){return[_0x10f378,!![]];});});}})[_0xc7f5('0x8f')](function(_0x59ade5,_0x2b60ce){if(_0x2b60ce){return _0x59ade5;}return db['OpenchannelMessage'][_0xc7f5('0x59')](_[_0xc7f5('0x4f')](_0x8b3e30[_0xc7f5('0x5a')],{'read':![],'body':_0x8b3e30[_0xc7f5('0x5a')][_0xc7f5('0x5a')],'OpenchannelAccountId':_0x5cf0cd['id'],'OpenchannelInteractionId':_0x59ade5['id'],'UserId':_0x8b3e30['user']['id'],'ContactId':_0x45f49b['id']}))[_0xc7f5('0x1d')](function(_0x24816e){_0x59ade5[_0xc7f5('0xb9')][_0xc7f5('0xb8')]=[];_0x59ade5[_0xc7f5('0xb9')][_0xc7f5('0xb8')]['push'](_0x24816e[_0xc7f5('0xb9')]);return _0x59ade5;});});}})[_0xc7f5('0x1d')](respondWithResult(_0x1f3ccb,null))[_0xc7f5('0x28')](handleError(_0x1f3ccb,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5c60470..3cd70f0 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 _0x55e0=['remove','emit','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x292102,_0x427efa){var _0x54c775=function(_0x27a4b6){while(--_0x27a4b6){_0x292102['push'](_0x292102['shift']());}};_0x54c775(++_0x427efa);}(_0x55e0,0xdc));var _0x055e=function(_0x5efd23,_0x2fa9cf){_0x5efd23=_0x5efd23-0x0;var _0x4cf463=_0x55e0[_0x5efd23];return _0x4cf463;};'use strict';var EventEmitter=require(_0x055e('0x0'));var OpenchannelAccount=require(_0x055e('0x1'))['db'][_0x055e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x055e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x055e('0x4')};function emitEvent(_0x2d9bd5){return function(_0x33cd7b,_0x2773e4,_0x157473){OpenchannelAccountEvents[_0x055e('0x5')](_0x2d9bd5+':'+_0x33cd7b['id'],_0x33cd7b);OpenchannelAccountEvents['emit'](_0x2d9bd5,_0x33cd7b);_0x157473(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x055e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x153f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount'];(function(_0x2aef0d,_0x1d648f){var _0x12397a=function(_0x58e543){while(--_0x58e543){_0x2aef0d['push'](_0x2aef0d['shift']());}};_0x12397a(++_0x1d648f);}(_0x153f,0x15b));var _0xf153=function(_0x4203e4,_0x2b4e99){_0x4203e4=_0x4203e4-0x0;var _0x241a6e=_0x153f[_0x4203e4];return _0x241a6e;};'use strict';var EventEmitter=require(_0xf153('0x0'));var OpenchannelAccount=require(_0xf153('0x1'))['db'][_0xf153('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf153('0x3')](0x0);var events={'afterCreate':_0xf153('0x4'),'afterUpdate':_0xf153('0x5'),'afterDestroy':_0xf153('0x6')};function emitEvent(_0x59757c){return function(_0x364e65,_0x5c49c7,_0x1f9ead){OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c+':'+_0x364e65['id'],_0x364e65);OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c,_0x364e65);_0x1f9ead(null);};}for(var e in events){if(events[_0xf153('0x8')](e)){var event=events[e];OpenchannelAccount[_0xf153('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 244f7c3..be390a2 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(_0x4b8f34,_0x4c57db){var _0x367dee=function(_0x50a1cf){while(--_0x50a1cf){_0x4b8f34['push'](_0x4b8f34['shift']());}};_0x367dee(++_0x4c57db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x26e985,_0x2359df){var _0x3225d2=function(_0xdda65d){while(--_0xdda65d){_0x26e985['push'](_0x26e985['shift']());}};_0x3225d2(++_0x2359df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 4c10a0d..8c1c5e2 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 _0x9c2c=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x982595,_0x250de7){var _0x259c18=function(_0x436295){while(--_0x436295){_0x982595['push'](_0x982595['shift']());}};_0x259c18(++_0x250de7);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9c2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9c2('0x3'));var logger=require(_0xc9c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9c2('0x5'));var client=jayson['client'][_0xc9c2('0x6')]({'port':0x232a});config[_0xc9c2('0x7')]=_[_0xc9c2('0x8')](config[_0xc9c2('0x7')],{'host':_0xc9c2('0x9'),'port':0x18eb});var socket=require(_0xc9c2('0xa'))(new Redis(config[_0xc9c2('0x7')]));require(_0xc9c2('0xb'))[_0xc9c2('0xc')](socket);function respondWithRpcPromise(_0x53e18d,_0x342609,_0x530f6a){return new BPromise(function(_0x46e650,_0x3e5847){return client[_0xc9c2('0xd')](_0x53e18d,_0x530f6a)[_0xc9c2('0xe')](function(_0x5894a4){logger['info'](_0xc9c2('0xf'),_0x342609,_0xc9c2('0x10'));logger['debug'](_0xc9c2('0x11'),_0x342609,_0xc9c2('0x10'),JSON[_0xc9c2('0x12')](_0x5894a4));if(_0x5894a4[_0xc9c2('0x13')]){if(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x14')]===0x1f4){logger[_0xc9c2('0x13')](_0xc9c2('0xf'),_0x342609,_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);return _0x3e5847(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);}logger['error'](_0xc9c2('0xf'),_0x342609,_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);return _0x46e650(_0x5894a4[_0xc9c2('0x13')][_0xc9c2('0x15')]);}else{logger['info'](_0xc9c2('0xf'),_0x342609,_0xc9c2('0x10'));_0x46e650(_0x5894a4[_0xc9c2('0x16')]['message']);}})[_0xc9c2('0x17')](function(_0x7de09c){logger[_0xc9c2('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x342609,_0x7de09c);_0x3e5847(_0x7de09c);});});} \ No newline at end of file +var _0x7d98=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3a9762,_0x50b377){var _0x38e317=function(_0x3a7f35){while(--_0x3a7f35){_0x3a9762['push'](_0x3a9762['shift']());}};_0x38e317(++_0x50b377);}(_0x7d98,0xe7));var _0x87d9=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x7d98[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x87d9('0x0'));var util=require('util');var moment=require(_0x87d9('0x1'));var BPromise=require(_0x87d9('0x2'));var rs=require(_0x87d9('0x3'));var fs=require('fs');var Redis=require(_0x87d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87d9('0x5'));var logger=require(_0x87d9('0x6'))('rpc');var config=require(_0x87d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x87d9('0x8')]=_[_0x87d9('0x9')](config[_0x87d9('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x87d9('0xa'))(new Redis(config[_0x87d9('0x8')]));require(_0x87d9('0xb'))['register'](socket);function respondWithRpcPromise(_0x22bc16,_0x469cff,_0x467a1b){return new BPromise(function(_0x3657ba,_0x10b32f){return client[_0x87d9('0xc')](_0x22bc16,_0x467a1b)[_0x87d9('0xd')](function(_0x4143f5){logger[_0x87d9('0xe')](_0x87d9('0xf'),_0x469cff,_0x87d9('0x10'));logger[_0x87d9('0x11')](_0x87d9('0x12'),_0x469cff,_0x87d9('0x10'),JSON[_0x87d9('0x13')](_0x4143f5));if(_0x4143f5[_0x87d9('0x14')]){if(_0x4143f5[_0x87d9('0x14')][_0x87d9('0x15')]===0x1f4){logger[_0x87d9('0x14')](_0x87d9('0xf'),_0x469cff,_0x4143f5['error']['message']);return _0x10b32f(_0x4143f5[_0x87d9('0x14')][_0x87d9('0x16')]);}logger[_0x87d9('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x469cff,_0x4143f5['error'][_0x87d9('0x16')]);return _0x3657ba(_0x4143f5[_0x87d9('0x14')][_0x87d9('0x16')]);}else{logger[_0x87d9('0xe')](_0x87d9('0xf'),_0x469cff,_0x87d9('0x10'));_0x3657ba(_0x4143f5[_0x87d9('0x17')][_0x87d9('0x16')]);}})[_0x87d9('0x18')](function(_0x6965d7){logger[_0x87d9('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x469cff,_0x6965d7);_0x10b32f(_0x6965d7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 15957f8..a6a69ee 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 _0x84e1=['emit','removeListener','register','length','./openchannelAccount.events','save','remove','update'];(function(_0x12aa66,_0x2d35c1){var _0x53dfe9=function(_0x2ab011){while(--_0x2ab011){_0x12aa66['push'](_0x12aa66['shift']());}};_0x53dfe9(++_0x2d35c1);}(_0x84e1,0x1dc));var _0x184e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x84e1[_0x1928c9];return _0x51b5fb;};'use strict';var OpenchannelAccountEvents=require(_0x184e('0x0'));var events=[_0x184e('0x1'),_0x184e('0x2'),_0x184e('0x3')];function createListener(_0x324aaa,_0x4df769){return function(_0x5c6973){_0x4df769[_0x184e('0x4')](_0x324aaa,_0x5c6973);};}function removeListener(_0x5fe43b,_0x26826d){return function(){OpenchannelAccountEvents[_0x184e('0x5')](_0x5fe43b,_0x26826d);};}exports[_0x184e('0x6')]=function(_0x86a78e){for(var _0x396183=0x0,_0x4ad2c3=events[_0x184e('0x7')];_0x396183<_0x4ad2c3;_0x396183++){var _0xa32654=events[_0x396183];var _0x1e79b2=createListener('openchannelAccount:'+_0xa32654,_0x86a78e);OpenchannelAccountEvents['on'](_0xa32654,_0x1e79b2);}}; \ No newline at end of file +var _0x4522=['register','length','openchannelAccount:','remove','update','emit','removeListener'];(function(_0x3ee31f,_0x41c88e){var _0x5a7cee=function(_0x310cf3){while(--_0x310cf3){_0x3ee31f['push'](_0x3ee31f['shift']());}};_0x5a7cee(++_0x41c88e);}(_0x4522,0x1a0));var _0x2452=function(_0x2de03e,_0x6eef11){_0x2de03e=_0x2de03e-0x0;var _0x17f335=_0x4522[_0x2de03e];return _0x17f335;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x2452('0x0'),_0x2452('0x1')];function createListener(_0x4a08d4,_0x5080f5){return function(_0x229028){_0x5080f5[_0x2452('0x2')](_0x4a08d4,_0x229028);};}function removeListener(_0x35e30a,_0x2f21dc){return function(){OpenchannelAccountEvents[_0x2452('0x3')](_0x35e30a,_0x2f21dc);};}exports[_0x2452('0x4')]=function(_0x15fc69){for(var _0x226578=0x0,_0x2f0139=events[_0x2452('0x5')];_0x226578<_0x2f0139;_0x226578++){var _0x3bc193=events[_0x226578];var _0x33b935=createListener(_0x2452('0x6')+_0x3bc193,_0x15fc69);OpenchannelAccountEvents['on'](_0x3bc193,_0x33b935);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index efc33da..d39f2e5 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 _0xb510=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x24433e,_0x166fc4){var _0x48cd0d=function(_0x31eb08){while(--_0x31eb08){_0x24433e['push'](_0x24433e['shift']());}};_0x48cd0d(++_0x166fc4);}(_0xb510,0xb6));var _0x0b51=function(_0x126b52,_0x18fa5e){_0x126b52=_0x126b52-0x0;var _0x139e32=_0xb510[_0x126b52];return _0x139e32;};'use strict';var multer=require(_0x0b51('0x0'));var util=require(_0x0b51('0x1'));var path=require(_0x0b51('0x2'));var timeout=require(_0x0b51('0x3'));var express=require(_0x0b51('0x4'));var router=express[_0x0b51('0x5')]();var fs_extra=require(_0x0b51('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0b51('0x7'));var controller=require('./openchannelApplication.controller');router[_0x0b51('0x8')]('/',auth[_0x0b51('0x9')](),controller['index']);router[_0x0b51('0x8')](_0x0b51('0xa'),auth[_0x0b51('0x9')](),controller[_0x0b51('0xb')]);router[_0x0b51('0xc')]('/',auth['isAuthenticated'](),controller[_0x0b51('0xd')]);router[_0x0b51('0xe')](_0x0b51('0xa'),auth[_0x0b51('0x9')](),controller[_0x0b51('0xf')]);router[_0x0b51('0x10')]('/:id',auth[_0x0b51('0x9')](),controller[_0x0b51('0x11')]);module[_0x0b51('0x12')]=router; \ No newline at end of file +var _0x2fa7=['post','create','put','update','exports','multer','util','path','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x2fa7,0x67));var _0x72fa=function(_0x4f532e,_0x2328ab){_0x4f532e=_0x4f532e-0x0;var _0x3ad09b=_0x2fa7[_0x4f532e];return _0x3ad09b;};'use strict';var multer=require(_0x72fa('0x0'));var util=require(_0x72fa('0x1'));var path=require(_0x72fa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72fa('0x3'));var config=require(_0x72fa('0x4'));var controller=require(_0x72fa('0x5'));router[_0x72fa('0x6')]('/',auth[_0x72fa('0x7')](),controller['index']);router[_0x72fa('0x6')](_0x72fa('0x8'),auth[_0x72fa('0x7')](),controller['show']);router[_0x72fa('0x9')]('/',auth[_0x72fa('0x7')](),controller[_0x72fa('0xa')]);router[_0x72fa('0xb')]('/:id',auth[_0x72fa('0x7')](),controller[_0x72fa('0xc')]);router['delete']('/:id',auth[_0x72fa('0x7')](),controller['destroy']);module[_0x72fa('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index a9002ef..8dd639c 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 _0xa7ed=['exports','INTEGER','STRING','noop','TEXT'];(function(_0x4173ca,_0x113c01){var _0x5d4f98=function(_0x51bdb8){while(--_0x51bdb8){_0x4173ca['push'](_0x4173ca['shift']());}};_0x5d4f98(++_0x113c01);}(_0xa7ed,0x131));var _0xda7e=function(_0xaaffc9,_0x1db33d){_0xaaffc9=_0xaaffc9-0x0;var _0xf447d3=_0xa7ed[_0xaaffc9];return _0xf447d3;};'use strict';var Sequelize=require('sequelize');module[_0xda7e('0x0')]={'priority':{'type':Sequelize[_0xda7e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xda7e('0x2')],'allowNull':![],'defaultValue':_0xda7e('0x3')},'appdata':{'type':Sequelize[_0xda7e('0x4')]()},'description':{'type':Sequelize[_0xda7e('0x2')]},'interval':{'type':Sequelize[_0xda7e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2e26=['INTEGER','STRING','noop'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2e26,0x105));var _0x62e2=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x2e26[_0x58c20f];return _0x3b0318;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x62e2('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x62e2('0x1')],'allowNull':![],'defaultValue':_0x62e2('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x62e2('0x1')]},'interval':{'type':Sequelize[_0x62e2('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 5a35dbb..4b749f7 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 _0x0c8b=['status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelApplication','includeAll','include','findAll','then','rows','length','catch','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2c7fb8,_0x414fdc){var _0x9b3e14=function(_0x53ddf6){while(--_0x53ddf6){_0x2c7fb8['push'](_0x2c7fb8['shift']());}};_0x9b3e14(++_0x414fdc);}(_0x0c8b,0xcf));var _0xb0c8=function(_0x5d2c6a,_0x196724){_0x5d2c6a=_0x5d2c6a-0x0;var _0x4420af=_0x0c8b[_0x5d2c6a];return _0x4420af;};'use strict';var emlformat=require(_0xb0c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0c8('0x1'));var jsonpatch=require(_0xb0c8('0x2'));var rp=require(_0xb0c8('0x3'));var moment=require(_0xb0c8('0x4'));var BPromise=require(_0xb0c8('0x5'));var Mustache=require(_0xb0c8('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb0c8('0x7'));var csv=require(_0xb0c8('0x8'));var ejs=require(_0xb0c8('0x9'));var fs=require('fs');var fs_extra=require(_0xb0c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb0c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb0c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb0c8('0xd'));var Papa=require(_0xb0c8('0xe'));var Redis=require(_0xb0c8('0xf'));var authService=require(_0xb0c8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb0c8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0c8('0x12'))(_0xb0c8('0x13'));var utils=require(_0xb0c8('0x14'));var config=require(_0xb0c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0c8('0x16'))['db'];function respondWithStatusCode(_0x189f85,_0x110a0e){_0x110a0e=_0x110a0e||0xcc;return function(_0x4c14e1){if(_0x4c14e1){return _0x189f85[_0xb0c8('0x17')](_0x110a0e);}return _0x189f85[_0xb0c8('0x18')](_0x110a0e)[_0xb0c8('0x19')]();};}function respondWithResult(_0x42bd4e,_0x433c13){_0x433c13=_0x433c13||0xc8;return function(_0x50e3a3){if(_0x50e3a3){return _0x42bd4e[_0xb0c8('0x18')](_0x433c13)[_0xb0c8('0x1a')](_0x50e3a3);}};}function respondWithFilteredResult(_0x145067,_0xc4f56a){return function(_0x4c6633){if(_0x4c6633){var _0x3c45dd=typeof _0xc4f56a['offset']==='undefined'&&typeof _0xc4f56a[_0xb0c8('0x1b')]===_0xb0c8('0x1c');var _0x62090b=_0x4c6633[_0xb0c8('0x1d')];var _0x35d0af=_0x3c45dd?0x0:_0xc4f56a['offset'];var _0x22eab9=_0x3c45dd?_0x4c6633[_0xb0c8('0x1d')]:_0xc4f56a[_0xb0c8('0x1e')]+_0xc4f56a['limit'];var _0x1527c4;if(_0x22eab9>=_0x62090b){_0x22eab9=_0x62090b;_0x1527c4=0xc8;}else{_0x1527c4=0xce;}_0x145067[_0xb0c8('0x18')](_0x1527c4);return _0x145067[_0xb0c8('0x1f')](_0xb0c8('0x20'),_0x35d0af+'-'+_0x22eab9+'/'+_0x62090b)[_0xb0c8('0x1a')](_0x4c6633);}return null;};}function patchUpdates(_0x370e8e){return function(_0x4749f2){try{jsonpatch[_0xb0c8('0x21')](_0x4749f2,_0x370e8e,!![]);}catch(_0x5beee2){return BPromise[_0xb0c8('0x22')](_0x5beee2);}return _0x4749f2[_0xb0c8('0x23')]();};}function saveUpdates(_0xecd039,_0x16dc58){return function(_0x18c85e){if(_0x18c85e){return _0x18c85e[_0xb0c8('0x24')](_0xecd039)['then'](function(_0x39a43b){return _0x39a43b;});}return null;};}function removeEntity(_0x155237,_0x191577){return function(_0x38c091){if(_0x38c091){return _0x38c091[_0xb0c8('0x25')]()['then'](function(){_0x155237[_0xb0c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e3103,_0x350e17){return function(_0x206ad4){if(!_0x206ad4){_0x5e3103[_0xb0c8('0x17')](0x194);}return _0x206ad4;};}function handleError(_0x43b05f,_0x4a1449){_0x4a1449=_0x4a1449||0x1f4;return function(_0x3c9c4a){logger[_0xb0c8('0x26')](_0x3c9c4a[_0xb0c8('0x27')]);if(_0x3c9c4a[_0xb0c8('0x28')]){delete _0x3c9c4a[_0xb0c8('0x28')];}_0x43b05f['status'](_0x4a1449)[_0xb0c8('0x29')](_0x3c9c4a);};}exports[_0xb0c8('0x2a')]=function(_0x23403d,_0x238f1a){var _0x381877={},_0x3d89ca={},_0x123866={'count':0x0,'rows':[]};var _0x2f058a=_[_0xb0c8('0x2b')](db['OpenchannelApplication'][_0xb0c8('0x2c')],function(_0x11abfa){return{'name':_0x11abfa[_0xb0c8('0x2d')],'type':_0x11abfa[_0xb0c8('0x2e')][_0xb0c8('0x2f')]};});_0x3d89ca[_0xb0c8('0x30')]=_[_0xb0c8('0x2b')](_0x2f058a,'name');_0x3d89ca[_0xb0c8('0x31')]=_[_0xb0c8('0x32')](_0x23403d[_0xb0c8('0x31')]);_0x3d89ca[_0xb0c8('0x33')]=_[_0xb0c8('0x34')](_0x3d89ca[_0xb0c8('0x30')],_0x3d89ca[_0xb0c8('0x31')]);_0x381877['attributes']=_[_0xb0c8('0x34')](_0x3d89ca[_0xb0c8('0x30')],qs['fields'](_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x35')]));_0x381877[_0xb0c8('0x36')]=_0x381877[_0xb0c8('0x36')]['length']?_0x381877[_0xb0c8('0x36')]:_0x3d89ca[_0xb0c8('0x30')];if(!_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x37')](_0xb0c8('0x38'))){_0x381877['limit']=qs[_0xb0c8('0x1b')](_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x1b')]);_0x381877[_0xb0c8('0x1e')]=qs[_0xb0c8('0x1e')](_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x1e')]);}_0x381877[_0xb0c8('0x39')]=qs[_0xb0c8('0x3a')](_0x23403d[_0xb0c8('0x31')]['sort']);_0x381877[_0xb0c8('0x3b')]=qs[_0xb0c8('0x33')](_[_0xb0c8('0x3c')](_0x23403d[_0xb0c8('0x31')],_0x3d89ca[_0xb0c8('0x33')]),_0x2f058a);if(_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x3d')]){_0x381877[_0xb0c8('0x3b')]=_['merge'](_0x381877['where'],{'$or':_[_0xb0c8('0x2b')](_0x2f058a,function(_0x2e2e32){if(_0x2e2e32[_0xb0c8('0x2e')]!==_0xb0c8('0x3e')){var _0x2b13f6={};_0x2b13f6[_0x2e2e32[_0xb0c8('0x28')]]={'$like':'%'+_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x3d')]+'%'};return _0x2b13f6;}})});}_0x381877=_[_0xb0c8('0x3f')]({},_0x381877,_0x23403d[_0xb0c8('0x40')]);var _0x4eec25={'where':_0x381877[_0xb0c8('0x3b')]};return db[_0xb0c8('0x41')]['count'](_0x4eec25)['then'](function(_0x31b17a){_0x123866[_0xb0c8('0x1d')]=_0x31b17a;if(_0x23403d[_0xb0c8('0x31')][_0xb0c8('0x42')]){_0x381877[_0xb0c8('0x43')]=[{'all':!![]}];}return db[_0xb0c8('0x41')][_0xb0c8('0x44')](_0x381877);})[_0xb0c8('0x45')](function(_0x339dc0){_0x123866[_0xb0c8('0x46')]=_0x339dc0;return _0x123866;})[_0xb0c8('0x45')](respondWithFilteredResult(_0x238f1a,_0x381877))['catch'](handleError(_0x238f1a,null));};exports['show']=function(_0x3ede74,_0x2e4a41){var _0x31c258={'raw':!![],'where':{'id':_0x3ede74['params']['id']}},_0x1fa52a={};_0x1fa52a[_0xb0c8('0x30')]=_['keys'](db[_0xb0c8('0x41')][_0xb0c8('0x2c')]);_0x1fa52a[_0xb0c8('0x31')]=_[_0xb0c8('0x32')](_0x3ede74[_0xb0c8('0x31')]);_0x1fa52a['filters']=_[_0xb0c8('0x34')](_0x1fa52a['model'],_0x1fa52a[_0xb0c8('0x31')]);_0x31c258[_0xb0c8('0x36')]=_['intersection'](_0x1fa52a['model'],qs[_0xb0c8('0x35')](_0x3ede74[_0xb0c8('0x31')][_0xb0c8('0x35')]));_0x31c258[_0xb0c8('0x36')]=_0x31c258[_0xb0c8('0x36')][_0xb0c8('0x47')]?_0x31c258[_0xb0c8('0x36')]:_0x1fa52a[_0xb0c8('0x30')];if(_0x3ede74[_0xb0c8('0x31')]['includeAll']){_0x31c258[_0xb0c8('0x43')]=[{'all':!![]}];}_0x31c258=_[_0xb0c8('0x3f')]({},_0x31c258,_0x3ede74['options']);return db[_0xb0c8('0x41')]['find'](_0x31c258)[_0xb0c8('0x45')](handleEntityNotFound(_0x2e4a41,null))['then'](respondWithResult(_0x2e4a41,null))[_0xb0c8('0x48')](handleError(_0x2e4a41,null));};exports[_0xb0c8('0x49')]=function(_0x34993e,_0x3d236a){return db[_0xb0c8('0x41')][_0xb0c8('0x49')](_0x34993e[_0xb0c8('0x4a')],{})[_0xb0c8('0x45')](respondWithResult(_0x3d236a,0xc9))[_0xb0c8('0x48')](handleError(_0x3d236a,null));};exports['update']=function(_0x32f190,_0x1400c5){if(_0x32f190[_0xb0c8('0x4a')]['id']){delete _0x32f190['body']['id'];}return db[_0xb0c8('0x41')][_0xb0c8('0x4b')]({'where':{'id':_0x32f190[_0xb0c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1400c5,null))[_0xb0c8('0x45')](saveUpdates(_0x32f190[_0xb0c8('0x4a')],null))[_0xb0c8('0x45')](respondWithResult(_0x1400c5,null))[_0xb0c8('0x48')](handleError(_0x1400c5,null));};exports[_0xb0c8('0x25')]=function(_0x168ea1,_0x12e231){return db[_0xb0c8('0x41')][_0xb0c8('0x4b')]({'where':{'id':_0x168ea1[_0xb0c8('0x4c')]['id']}})[_0xb0c8('0x45')](handleEntityNotFound(_0x12e231,null))[_0xb0c8('0x45')](removeEntity(_0x12e231,null))[_0xb0c8('0x48')](handleError(_0x12e231,null));}; \ No newline at end of file +var _0x492e=['apply','save','update','then','destroy','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x492e,0x1d1));var _0xe492=function(_0x39619f,_0x2c8aef){_0x39619f=_0x39619f-0x0;var _0x5651e2=_0x492e[_0x39619f];return _0x5651e2;};'use strict';var emlformat=require(_0xe492('0x0'));var rimraf=require(_0xe492('0x1'));var zipdir=require(_0xe492('0x2'));var jsonpatch=require(_0xe492('0x3'));var rp=require('request-promise');var moment=require(_0xe492('0x4'));var BPromise=require(_0xe492('0x5'));var Mustache=require(_0xe492('0x6'));var util=require(_0xe492('0x7'));var path=require(_0xe492('0x8'));var sox=require('sox');var csv=require(_0xe492('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe492('0xa'));var _=require('lodash');var squel=require(_0xe492('0xb'));var crypto=require(_0xe492('0xc'));var jsforce=require(_0xe492('0xd'));var deskjs=require(_0xe492('0xe'));var toCsv=require(_0xe492('0x9'));var querystring=require('querystring');var Papa=require(_0xe492('0xf'));var Redis=require(_0xe492('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe492('0x11'));var as=require(_0xe492('0x12'));var hardwareService=require(_0xe492('0x13'));var logger=require(_0xe492('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe492('0x15'));var db=require(_0xe492('0x16'))['db'];function respondWithStatusCode(_0x22671c,_0x148a7b){_0x148a7b=_0x148a7b||0xcc;return function(_0x540225){if(_0x540225){return _0x22671c[_0xe492('0x17')](_0x148a7b);}return _0x22671c['status'](_0x148a7b)[_0xe492('0x18')]();};}function respondWithResult(_0x5dc4f0,_0x27a0f7){_0x27a0f7=_0x27a0f7||0xc8;return function(_0x2833eb){if(_0x2833eb){return _0x5dc4f0[_0xe492('0x19')](_0x27a0f7)[_0xe492('0x1a')](_0x2833eb);}};}function respondWithFilteredResult(_0x5639c1,_0x280909){return function(_0x343589){if(_0x343589){var _0x2024cc=typeof _0x280909[_0xe492('0x1b')]==='undefined'&&typeof _0x280909[_0xe492('0x1c')]==='undefined';var _0x101b43=_0x343589[_0xe492('0x1d')];var _0x51b2c7=_0x2024cc?0x0:_0x280909['offset'];var _0x5e39e6=_0x2024cc?_0x343589[_0xe492('0x1d')]:_0x280909['offset']+_0x280909[_0xe492('0x1c')];var _0x56a69a;if(_0x5e39e6>=_0x101b43){_0x5e39e6=_0x101b43;_0x56a69a=0xc8;}else{_0x56a69a=0xce;}_0x5639c1[_0xe492('0x19')](_0x56a69a);return _0x5639c1[_0xe492('0x1e')](_0xe492('0x1f'),_0x51b2c7+'-'+_0x5e39e6+'/'+_0x101b43)[_0xe492('0x1a')](_0x343589);}return null;};}function patchUpdates(_0x28346a){return function(_0x2b7112){try{jsonpatch[_0xe492('0x20')](_0x2b7112,_0x28346a,!![]);}catch(_0x6cc496){return BPromise['reject'](_0x6cc496);}return _0x2b7112[_0xe492('0x21')]();};}function saveUpdates(_0x41cfd5,_0x1157c9){return function(_0x38e634){if(_0x38e634){return _0x38e634[_0xe492('0x22')](_0x41cfd5)[_0xe492('0x23')](function(_0x3b654b){return _0x3b654b;});}return null;};}function removeEntity(_0x3e90c5,_0x519b87){return function(_0x5ec73a){if(_0x5ec73a){return _0x5ec73a[_0xe492('0x24')]()[_0xe492('0x23')](function(){_0x3e90c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x120487,_0x5d7a7c){return function(_0x2b466e){if(!_0x2b466e){_0x120487['sendStatus'](0x194);}return _0x2b466e;};}function handleError(_0x58788d,_0x5018c8){_0x5018c8=_0x5018c8||0x1f4;return function(_0x3ed32c){logger[_0xe492('0x25')](_0x3ed32c['stack']);if(_0x3ed32c[_0xe492('0x26')]){delete _0x3ed32c['name'];}_0x58788d['status'](_0x5018c8)[_0xe492('0x27')](_0x3ed32c);};}exports[_0xe492('0x28')]=function(_0x1dc8c2,_0x38c2fc){var _0x1b5d75={},_0x9751a8={},_0x301b1c={'count':0x0,'rows':[]};var _0x28fb16=_[_0xe492('0x29')](db[_0xe492('0x2a')][_0xe492('0x2b')],function(_0x3c62d4){return{'name':_0x3c62d4[_0xe492('0x2c')],'type':_0x3c62d4[_0xe492('0x2d')][_0xe492('0x2e')]};});_0x9751a8[_0xe492('0x2f')]=_['map'](_0x28fb16,_0xe492('0x26'));_0x9751a8[_0xe492('0x30')]=_['keys'](_0x1dc8c2[_0xe492('0x30')]);_0x9751a8[_0xe492('0x31')]=_[_0xe492('0x32')](_0x9751a8[_0xe492('0x2f')],_0x9751a8[_0xe492('0x30')]);_0x1b5d75['attributes']=_[_0xe492('0x32')](_0x9751a8[_0xe492('0x2f')],qs[_0xe492('0x33')](_0x1dc8c2['query'][_0xe492('0x33')]));_0x1b5d75['attributes']=_0x1b5d75[_0xe492('0x34')]['length']?_0x1b5d75[_0xe492('0x34')]:_0x9751a8[_0xe492('0x2f')];if(!_0x1dc8c2['query']['hasOwnProperty']('nolimit')){_0x1b5d75['limit']=qs['limit'](_0x1dc8c2[_0xe492('0x30')][_0xe492('0x1c')]);_0x1b5d75[_0xe492('0x1b')]=qs[_0xe492('0x1b')](_0x1dc8c2[_0xe492('0x30')][_0xe492('0x1b')]);}_0x1b5d75[_0xe492('0x35')]=qs[_0xe492('0x36')](_0x1dc8c2['query']['sort']);_0x1b5d75[_0xe492('0x37')]=qs[_0xe492('0x31')](_[_0xe492('0x38')](_0x1dc8c2[_0xe492('0x30')],_0x9751a8[_0xe492('0x31')]),_0x28fb16);if(_0x1dc8c2['query']['filter']){_0x1b5d75[_0xe492('0x37')]=_[_0xe492('0x39')](_0x1b5d75[_0xe492('0x37')],{'$or':_[_0xe492('0x29')](_0x28fb16,function(_0xed5d36){if(_0xed5d36[_0xe492('0x2d')]!==_0xe492('0x3a')){var _0x406cb9={};_0x406cb9[_0xed5d36[_0xe492('0x26')]]={'$like':'%'+_0x1dc8c2['query'][_0xe492('0x3b')]+'%'};return _0x406cb9;}})});}_0x1b5d75=_[_0xe492('0x39')]({},_0x1b5d75,_0x1dc8c2['options']);var _0x57f626={'where':_0x1b5d75[_0xe492('0x37')]};return db['OpenchannelApplication'][_0xe492('0x1d')](_0x57f626)['then'](function(_0x57029c){_0x301b1c[_0xe492('0x1d')]=_0x57029c;if(_0x1dc8c2[_0xe492('0x30')][_0xe492('0x3c')]){_0x1b5d75[_0xe492('0x3d')]=[{'all':!![]}];}return db[_0xe492('0x2a')][_0xe492('0x3e')](_0x1b5d75);})[_0xe492('0x23')](function(_0x32ae3a){_0x301b1c['rows']=_0x32ae3a;return _0x301b1c;})[_0xe492('0x23')](respondWithFilteredResult(_0x38c2fc,_0x1b5d75))[_0xe492('0x3f')](handleError(_0x38c2fc,null));};exports[_0xe492('0x40')]=function(_0x113000,_0x2036ca){var _0x4780df={'raw':!![],'where':{'id':_0x113000[_0xe492('0x41')]['id']}},_0x4778a8={};_0x4778a8[_0xe492('0x2f')]=_[_0xe492('0x42')](db['OpenchannelApplication']['rawAttributes']);_0x4778a8['query']=_[_0xe492('0x42')](_0x113000[_0xe492('0x30')]);_0x4778a8['filters']=_[_0xe492('0x32')](_0x4778a8[_0xe492('0x2f')],_0x4778a8[_0xe492('0x30')]);_0x4780df['attributes']=_[_0xe492('0x32')](_0x4778a8[_0xe492('0x2f')],qs[_0xe492('0x33')](_0x113000[_0xe492('0x30')][_0xe492('0x33')]));_0x4780df[_0xe492('0x34')]=_0x4780df[_0xe492('0x34')][_0xe492('0x43')]?_0x4780df[_0xe492('0x34')]:_0x4778a8[_0xe492('0x2f')];if(_0x113000[_0xe492('0x30')]['includeAll']){_0x4780df[_0xe492('0x3d')]=[{'all':!![]}];}_0x4780df=_[_0xe492('0x39')]({},_0x4780df,_0x113000[_0xe492('0x44')]);return db[_0xe492('0x2a')][_0xe492('0x45')](_0x4780df)[_0xe492('0x23')](handleEntityNotFound(_0x2036ca,null))[_0xe492('0x23')](respondWithResult(_0x2036ca,null))[_0xe492('0x3f')](handleError(_0x2036ca,null));};exports['create']=function(_0x1e593c,_0x376cb3){return db[_0xe492('0x2a')]['create'](_0x1e593c[_0xe492('0x46')],{})[_0xe492('0x23')](respondWithResult(_0x376cb3,0xc9))[_0xe492('0x3f')](handleError(_0x376cb3,null));};exports['update']=function(_0x4e5b38,_0x275fd4){if(_0x4e5b38[_0xe492('0x46')]['id']){delete _0x4e5b38[_0xe492('0x46')]['id'];}return db['OpenchannelApplication'][_0xe492('0x45')]({'where':{'id':_0x4e5b38[_0xe492('0x41')]['id']}})[_0xe492('0x23')](handleEntityNotFound(_0x275fd4,null))[_0xe492('0x23')](saveUpdates(_0x4e5b38[_0xe492('0x46')],null))[_0xe492('0x23')](respondWithResult(_0x275fd4,null))[_0xe492('0x3f')](handleError(_0x275fd4,null));};exports[_0xe492('0x24')]=function(_0x48e04c,_0x537b66){return db[_0xe492('0x2a')][_0xe492('0x45')]({'where':{'id':_0x48e04c[_0xe492('0x41')]['id']}})[_0xe492('0x23')](handleEntityNotFound(_0x537b66,null))[_0xe492('0x23')](removeEntity(_0x537b66,null))['catch'](handleError(_0x537b66,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2b99cd5..3a804b7 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 _0x0834=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','openchannel_applications'];(function(_0x6a33,_0x304d4f){var _0x108688=function(_0x283413){while(--_0x283413){_0x6a33['push'](_0x6a33['shift']());}};_0x108688(++_0x304d4f);}(_0x0834,0x1bd));var _0x4083=function(_0x48db6f,_0x2c7f77){_0x48db6f=_0x48db6f-0x0;var _0x3ae269=_0x0834[_0x48db6f];return _0x3ae269;};'use strict';var _=require(_0x4083('0x0'));var util=require(_0x4083('0x1'));var logger=require('../../config/logger')(_0x4083('0x2'));var moment=require(_0x4083('0x3'));var BPromise=require(_0x4083('0x4'));var rp=require(_0x4083('0x5'));var fs=require('fs');var path=require(_0x4083('0x6'));var rimraf=require(_0x4083('0x7'));var config=require('../../config/environment');var attributes=require(_0x4083('0x8'));module['exports']=function(_0x550023,_0x995bd6){return _0x550023[_0x4083('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x4083('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4083('0xb')});}; \ No newline at end of file +var _0x10eb=['util','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','lodash'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x10eb,0xdb));var _0xb10e=function(_0x5a42be,_0x5e53d4){_0x5a42be=_0x5a42be-0x0;var _0x210a82=_0x10eb[_0x5a42be];return _0x210a82;};'use strict';var _=require(_0xb10e('0x0'));var util=require(_0xb10e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb10e('0x2'));var BPromise=require('bluebird');var rp=require(_0xb10e('0x3'));var fs=require('fs');var path=require(_0xb10e('0x4'));var rimraf=require(_0xb10e('0x5'));var config=require(_0xb10e('0x6'));var attributes=require(_0xb10e('0x7'));module['exports']=function(_0x373812,_0x2750d0){return _0x373812[_0xb10e('0x8')](_0xb10e('0x9'),attributes,{'tableName':_0xb10e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fe3f298..adc9204 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 _0xbc0a=['../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cec97,_0x251e54){var _0x3e13db=function(_0x2bab13){while(--_0x2bab13){_0x1cec97['push'](_0x1cec97['shift']());}};_0x3e13db(++_0x251e54);}(_0xbc0a,0xcf));var _0xabc0=function(_0x2e7c9b,_0x344f12){_0x2e7c9b=_0x2e7c9b-0x0;var _0x1aeaec=_0xbc0a[_0x2e7c9b];return _0x1aeaec;};'use strict';var _=require(_0xabc0('0x0'));var util=require(_0xabc0('0x1'));var moment=require(_0xabc0('0x2'));var BPromise=require(_0xabc0('0x3'));var rs=require(_0xabc0('0x4'));var fs=require('fs');var Redis=require(_0xabc0('0x5'));var db=require(_0xabc0('0x6'))['db'];var utils=require(_0xabc0('0x7'));var logger=require(_0xabc0('0x8'))(_0xabc0('0x9'));var config=require(_0xabc0('0xa'));var jayson=require(_0xabc0('0xb'));var client=jayson[_0xabc0('0xc')][_0xabc0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xebc54d,_0xc00678,_0x17d0ed){return new BPromise(function(_0xd14b9f,_0x510417){return client['request'](_0xebc54d,_0x17d0ed)[_0xabc0('0xe')](function(_0x2bcfb4){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0xc00678,_0xabc0('0xf'));logger[_0xabc0('0x10')](_0xabc0('0x11'),_0xc00678,_0xabc0('0xf'),JSON[_0xabc0('0x12')](_0x2bcfb4));if(_0x2bcfb4[_0xabc0('0x13')]){if(_0x2bcfb4[_0xabc0('0x13')]['code']===0x1f4){logger[_0xabc0('0x13')](_0xabc0('0x14'),_0xc00678,_0x2bcfb4['error']['message']);return _0x510417(_0x2bcfb4['error'][_0xabc0('0x15')]);}logger[_0xabc0('0x13')](_0xabc0('0x14'),_0xc00678,_0x2bcfb4[_0xabc0('0x13')][_0xabc0('0x15')]);return _0xd14b9f(_0x2bcfb4[_0xabc0('0x13')][_0xabc0('0x15')]);}else{logger[_0xabc0('0x16')]('OpenchannelApplication,\x20%s,\x20%s',_0xc00678,_0xabc0('0xf'));_0xd14b9f(_0x2bcfb4[_0xabc0('0x17')][_0xabc0('0x15')]);}})['catch'](function(_0x2dc3d4){logger[_0xabc0('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0xc00678,_0x2dc3d4);_0x510417(_0x2dc3d4);});});}exports[_0xabc0('0x18')]=function(_0x2ac3c9){var _0x39ecd3=this;return new Promise(function(_0x5e230e,_0x844f44){return db[_0xabc0('0x19')]['update'](_0x2ac3c9[_0xabc0('0x1a')],{'raw':_0x2ac3c9[_0xabc0('0x1b')]?_0x2ac3c9[_0xabc0('0x1b')][_0xabc0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ac3c9['options']?_0x2ac3c9[_0xabc0('0x1b')]['where']||null:null,'attributes':_0x2ac3c9[_0xabc0('0x1b')]?_0x2ac3c9['options'][_0xabc0('0x1d')]||null:null,'limit':_0x2ac3c9['options']?_0x2ac3c9[_0xabc0('0x1b')]['limit']||null:null})['then'](function(_0x3ff418){logger['info'](_0xabc0('0x18'),_0x2ac3c9);logger[_0xabc0('0x10')](_0xabc0('0x18'),_0x2ac3c9,JSON[_0xabc0('0x12')](_0x3ff418));_0x5e230e(_0x3ff418);})[_0xabc0('0x1e')](function(_0x5bd89b){logger['error'](_0xabc0('0x18'),_0x5bd89b['message'],_0x2ac3c9);_0x844f44(_0x39ecd3[_0xabc0('0x13')](0x1f4,_0x5bd89b[_0xabc0('0x15')]));});});}; \ No newline at end of file +var _0x4d99=['info','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','raw','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4fbf0c,_0x523626){var _0x1b862f=function(_0x3eb935){while(--_0x3eb935){_0x4fbf0c['push'](_0x4fbf0c['shift']());}};_0x1b862f(++_0x523626);}(_0x4d99,0xf4));var _0x94d9=function(_0x2e011a,_0x11b65f){_0x2e011a=_0x2e011a-0x0;var _0x541da0=_0x4d99[_0x2e011a];return _0x541da0;};'use strict';var _=require(_0x94d9('0x0'));var util=require('util');var moment=require(_0x94d9('0x1'));var BPromise=require(_0x94d9('0x2'));var rs=require(_0x94d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x94d9('0x4'));var logger=require(_0x94d9('0x5'))(_0x94d9('0x6'));var config=require(_0x94d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94d9('0x8')][_0x94d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539110,_0x339be0,_0x4f44a3){return new BPromise(function(_0x262603,_0x4ab6e5){return client[_0x94d9('0xa')](_0x539110,_0x4f44a3)[_0x94d9('0xb')](function(_0x16b544){logger['info'](_0x94d9('0xc'),_0x339be0,'request\x20sent');logger[_0x94d9('0xd')](_0x94d9('0xe'),_0x339be0,'request\x20sent',JSON['stringify'](_0x16b544));if(_0x16b544[_0x94d9('0xf')]){if(_0x16b544[_0x94d9('0xf')]['code']===0x1f4){logger[_0x94d9('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x339be0,_0x16b544[_0x94d9('0xf')][_0x94d9('0x10')]);return _0x4ab6e5(_0x16b544[_0x94d9('0xf')][_0x94d9('0x10')]);}logger[_0x94d9('0xf')](_0x94d9('0xc'),_0x339be0,_0x16b544['error'][_0x94d9('0x10')]);return _0x262603(_0x16b544[_0x94d9('0xf')][_0x94d9('0x10')]);}else{logger[_0x94d9('0x11')](_0x94d9('0xc'),_0x339be0,_0x94d9('0x12'));_0x262603(_0x16b544[_0x94d9('0x13')]['message']);}})[_0x94d9('0x14')](function(_0x4869ae){logger[_0x94d9('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x339be0,_0x4869ae);_0x4ab6e5(_0x4869ae);});});}exports[_0x94d9('0x15')]=function(_0x567af3){var _0x58b967=this;return new Promise(function(_0x15591b,_0x38675f){return db[_0x94d9('0x16')]['update'](_0x567af3[_0x94d9('0x17')],{'raw':_0x567af3['options']?_0x567af3['options'][_0x94d9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x567af3[_0x94d9('0x19')]?_0x567af3[_0x94d9('0x19')][_0x94d9('0x1a')]||null:null,'attributes':_0x567af3[_0x94d9('0x19')]?_0x567af3['options'][_0x94d9('0x1b')]||null:null,'limit':_0x567af3[_0x94d9('0x19')]?_0x567af3[_0x94d9('0x19')][_0x94d9('0x1c')]||null:null})['then'](function(_0x203feb){logger[_0x94d9('0x11')](_0x94d9('0x15'),_0x567af3);logger[_0x94d9('0xd')]('UpdateOpenchannelApplication',_0x567af3,JSON['stringify'](_0x203feb));_0x15591b(_0x203feb);})[_0x94d9('0x14')](function(_0x232968){logger['error'](_0x94d9('0x15'),_0x232968['message'],_0x567af3);_0x38675f(_0x58b967['error'](0x1f4,_0x232968['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9e6e5b5..cdf3893 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 _0xd381=['get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller'];(function(_0x235df2,_0x137292){var _0x4d91b7=function(_0xa18897){while(--_0xa18897){_0x235df2['push'](_0x235df2['shift']());}};_0x4d91b7(++_0x137292);}(_0xd381,0x1c9));var _0x1d38=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0xd381[_0x2bd1ec];return _0x2f7577;};'use strict';var multer=require('multer');var util=require(_0x1d38('0x0'));var path=require(_0x1d38('0x1'));var timeout=require(_0x1d38('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1d38('0x3'));var auth=require(_0x1d38('0x4'));var interaction=require(_0x1d38('0x5'));var config=require(_0x1d38('0x6'));var controller=require(_0x1d38('0x7'));router[_0x1d38('0x8')]('/',auth[_0x1d38('0x9')](),controller[_0x1d38('0xa')]);router[_0x1d38('0x8')](_0x1d38('0xb'),auth['isAuthenticated'](),controller[_0x1d38('0xc')]);router[_0x1d38('0x8')]('/:id',auth[_0x1d38('0x9')](),controller[_0x1d38('0xd')]);router[_0x1d38('0x8')](_0x1d38('0xe'),auth[_0x1d38('0x9')](),controller[_0x1d38('0xf')]);router[_0x1d38('0x8')](_0x1d38('0x10'),auth[_0x1d38('0x9')](),controller['download']);router[_0x1d38('0x11')]('/',auth['isAuthenticated'](),controller[_0x1d38('0x12')]);router[_0x1d38('0x11')](_0x1d38('0xe'),auth[_0x1d38('0x9')](),controller[_0x1d38('0x13')]);router[_0x1d38('0x11')](_0x1d38('0x14'),auth[_0x1d38('0x9')](),interaction[_0x1d38('0x15')]('openchannel',_0x1d38('0x16')),controller['addTags']);router[_0x1d38('0x17')]('/:id',auth[_0x1d38('0x9')](),interaction[_0x1d38('0x15')](_0x1d38('0x18'),_0x1d38('0x19')),controller[_0x1d38('0x1a')]);router['delete']('/:id',auth[_0x1d38('0x9')](),interaction[_0x1d38('0x15')](_0x1d38('0x18'),_0x1d38('0x1b')),controller['destroy']);router[_0x1d38('0x1c')](_0x1d38('0x14'),auth[_0x1d38('0x9')](),controller[_0x1d38('0x1d')]);module[_0x1d38('0x1e')]=router; \ No newline at end of file +var _0xe744=['getMessages','/:id/download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0xe744,0x1a3));var _0x4e74=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xe744[_0x5a776b];return _0xbbef59;};'use strict';var multer=require('multer');var util=require(_0x4e74('0x0'));var path=require(_0x4e74('0x1'));var timeout=require(_0x4e74('0x2'));var express=require('express');var router=express[_0x4e74('0x3')]();var fs_extra=require(_0x4e74('0x4'));var auth=require(_0x4e74('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e74('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x4e74('0x7')]('/',auth[_0x4e74('0x8')](),controller[_0x4e74('0x9')]);router[_0x4e74('0x7')]('/describe',auth[_0x4e74('0x8')](),controller[_0x4e74('0xa')]);router[_0x4e74('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4e74('0xb')]);router['get'](_0x4e74('0xc'),auth['isAuthenticated'](),controller[_0x4e74('0xd')]);router[_0x4e74('0x7')](_0x4e74('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x4e74('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e74('0xf')]('/:id/messages',auth[_0x4e74('0x8')](),controller['addMessage']);router[_0x4e74('0xf')](_0x4e74('0x10'),auth['isAuthenticated'](),interaction[_0x4e74('0x11')](_0x4e74('0x12'),_0x4e74('0x13')),controller['addTags']);router[_0x4e74('0x14')](_0x4e74('0x15'),auth[_0x4e74('0x8')](),interaction['tracked'](_0x4e74('0x12'),_0x4e74('0x16')),controller[_0x4e74('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4e74('0x12'),_0x4e74('0x18')),controller[_0x4e74('0x19')]);router['delete'](_0x4e74('0x10'),auth[_0x4e74('0x8')](),controller['removeTags']);module[_0x4e74('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index a509e4c..a0114e0 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 _0xf7a8=['out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x504086,_0x429e45){var _0xd973a3=function(_0x1bec06){while(--_0x1bec06){_0x504086['push'](_0x504086['shift']());}};_0xd973a3(++_0x429e45);}(_0xf7a8,0x157));var _0x8f7a=function(_0x33efee,_0x11985a){_0x33efee=_0x33efee-0x0;var _0x765dab=_0xf7a8[_0x33efee];return _0x765dab;};'use strict';var Sequelize=require(_0x8f7a('0x0'));module[_0x8f7a('0x1')]={'closed':{'type':Sequelize[_0x8f7a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8f7a('0x3')]},'secondDisposition':{'type':Sequelize[_0x8f7a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8f7a('0x3')]},'note':{'type':Sequelize[_0x8f7a('0x3')]},'read1stAt':{'type':Sequelize[_0x8f7a('0x4')]},'threadId':{'type':Sequelize[_0x8f7a('0x3')]},'externalUrl':{'type':Sequelize[_0x8f7a('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8f7a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8f7a('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa2ab=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xa2ab,0xa7));var _0xba2a=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0xa2ab[_0x1ea6eb];return _0x127200;};'use strict';var Sequelize=require(_0xba2a('0x0'));module[_0xba2a('0x1')]={'closed':{'type':Sequelize[_0xba2a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xba2a('0x3')]},'secondDisposition':{'type':Sequelize[_0xba2a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xba2a('0x3')]},'note':{'type':Sequelize[_0xba2a('0x3')]},'read1stAt':{'type':Sequelize[_0xba2a('0x4')]},'threadId':{'type':Sequelize[_0xba2a('0x3')]},'externalUrl':{'type':Sequelize[_0xba2a('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xba2a('0x5')]('in',_0xba2a('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xba2a('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 22521fe..018a071 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 _0x116d=['start','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','body','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','show','params','includeAll','include','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','findAll','emit','removeTags','download','unix','root','files','tmp','server','attachments','join','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','format','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x116d,0x180));var _0xd116=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x116d[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xd116('0x0'));var rimraf=require(_0xd116('0x1'));var zipdir=require(_0xd116('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd116('0x3'));var moment=require(_0xd116('0x4'));var BPromise=require(_0xd116('0x5'));var Mustache=require(_0xd116('0x6'));var util=require(_0xd116('0x7'));var path=require(_0xd116('0x8'));var sox=require(_0xd116('0x9'));var csv=require(_0xd116('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd116('0xb'));var _=require('lodash');var squel=require(_0xd116('0xc'));var crypto=require('crypto');var jsforce=require(_0xd116('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd116('0xa'));var querystring=require(_0xd116('0xe'));var Papa=require(_0xd116('0xf'));var Redis=require(_0xd116('0x10'));var authService=require(_0xd116('0x11'));var qs=require(_0xd116('0x12'));var as=require(_0xd116('0x13'));var pdf=require(_0xd116('0x14'));var hardwareService=require(_0xd116('0x15'));var logger=require('../../config/logger')(_0xd116('0x16'));var utils=require(_0xd116('0x17'));var config=require(_0xd116('0x18'));var licenseUtil=require(_0xd116('0x19'));var db=require(_0xd116('0x1a'))['db'];config[_0xd116('0x1b')]=_[_0xd116('0x1c')](config[_0xd116('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd116('0x1d'))(new Redis(config[_0xd116('0x1b')]));require(_0xd116('0x1e'))[_0xd116('0x1f')](socket);function respondWithStatusCode(_0x2177fd,_0x292e17){_0x292e17=_0x292e17||0xcc;return function(_0x5449fc){if(_0x5449fc){return _0x2177fd[_0xd116('0x20')](_0x292e17);}return _0x2177fd[_0xd116('0x21')](_0x292e17)['end']();};}function respondWithResult(_0x1b23c0,_0x3f323d){_0x3f323d=_0x3f323d||0xc8;return function(_0x506857){if(_0x506857){return _0x1b23c0['status'](_0x3f323d)['json'](_0x506857);}};}function respondWithFilteredResult(_0x39fb1f,_0x1e40e4){return function(_0x35599a){if(_0x35599a){var _0x429fae=typeof _0x1e40e4[_0xd116('0x22')]===_0xd116('0x23')&&typeof _0x1e40e4[_0xd116('0x24')]===_0xd116('0x23');var _0x324e4c=_0x35599a[_0xd116('0x25')];var _0x174070=_0x429fae?0x0:_0x1e40e4[_0xd116('0x22')];var _0x5eafec=_0x429fae?_0x35599a[_0xd116('0x25')]:_0x1e40e4[_0xd116('0x22')]+_0x1e40e4[_0xd116('0x24')];var _0x5bcd0b;if(_0x5eafec>=_0x324e4c){_0x5eafec=_0x324e4c;_0x5bcd0b=0xc8;}else{_0x5bcd0b=0xce;}_0x39fb1f[_0xd116('0x21')](_0x5bcd0b);return _0x39fb1f['set'](_0xd116('0x26'),_0x174070+'-'+_0x5eafec+'/'+_0x324e4c)[_0xd116('0x27')](_0x35599a);}return null;};}function patchUpdates(_0x10866d){return function(_0x406b79){try{jsonpatch[_0xd116('0x28')](_0x406b79,_0x10866d,!![]);}catch(_0x2b6d37){return BPromise[_0xd116('0x29')](_0x2b6d37);}return _0x406b79['save']();};}function saveUpdates(_0xa38365,_0x5923b1){return function(_0x4a39b3){if(_0x4a39b3){return _0x4a39b3[_0xd116('0x2a')](_0xa38365)['then'](function(_0x43977c){return _0x43977c;});}return null;};}function removeEntity(_0xf0d298,_0x24f88f){return function(_0x1326e0){if(_0x1326e0){return _0x1326e0['destroy']()[_0xd116('0x2b')](function(){_0xf0d298[_0xd116('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509ba4,_0x6d2cf9){return function(_0x13b706){if(!_0x13b706){_0x509ba4[_0xd116('0x20')](0x194);}return _0x13b706;};}function handleError(_0x159c96,_0x24125f){_0x24125f=_0x24125f||0x1f4;return function(_0x135c8b){logger[_0xd116('0x2c')](_0x135c8b[_0xd116('0x2d')]);if(_0x135c8b[_0xd116('0x2e')]){delete _0x135c8b[_0xd116('0x2e')];}_0x159c96['status'](_0x24125f)[_0xd116('0x2f')](_0x135c8b);};}function getInteractionUsers(_0x5299fd,_0x44953a){return new BPromise(function(_0x1e2293,_0x8e3805){try{if(_0x44953a[_0x5299fd['id']]){_0x5299fd[_0xd116('0x30')]=_[_0xd116('0x31')](_0x44953a[_0x5299fd['id']],function(_0x27c4d1){return{'id':_0x27c4d1['id'],'fullname':_0x27c4d1[_0xd116('0x32')]};});}}catch(_0x2c9a4b){_0x8e3805(_0x2c9a4b);}_0x1e2293(_0x5299fd);});}function getInteractionTags(_0x1c6043,_0x500346){return new BPromise(function(_0x4baf73,_0x3fee91){try{if(_0x1c6043[_0xd116('0x33')]){_0x1c6043[_0xd116('0x34')]=[];_0x1c6043[_0xd116('0x33')][_0xd116('0x35')](',')['forEach'](function(_0x38d014){_0x1c6043[_0xd116('0x34')][_0xd116('0x36')](_0x500346[_0x38d014]);});}delete _0x1c6043['TagIds'];}catch(_0x1024fb){_0x3fee91(_0x1024fb);}_0x4baf73(_0x1c6043);});}function updateOpenchannelInteraction(_0x2bc3a0,_0x56d59c,_0x4c84aa){return new BPromise(function(_0x273c07,_0x4528ae){return getInteractionUsers(_0x2bc3a0,_0x4c84aa)[_0xd116('0x2b')](function(_0x5b664c){return getInteractionTags(_0x5b664c,_0x56d59c);})[_0xd116('0x2b')](function(_0x1f6a69){_0x273c07(_0x1f6a69);})[_0xd116('0x37')](function(_0x3e0f79){_0x4528ae(_0x3e0f79);});});}exports[_0xd116('0x38')]=function(_0x5d588b,_0x2a1734){var _0x550184={},_0x1c9b77={},_0xe0133d={'count':0x0,'rows':[]};var _0x530d7e=_[_0xd116('0x31')](db['OpenchannelInteraction'][_0xd116('0x39')],function(_0x263164){return{'name':_0x263164[_0xd116('0x3a')],'type':_0x263164[_0xd116('0x3b')][_0xd116('0x3c')]};});_0x1c9b77['model']=_['map'](_0x530d7e,_0xd116('0x2e'));_0x1c9b77[_0xd116('0x3d')]=_[_0xd116('0x3e')](_0x5d588b['query']);_0x1c9b77[_0xd116('0x3f')]=_[_0xd116('0x40')](_0x1c9b77['model'],_0x1c9b77[_0xd116('0x3d')]);_0x550184[_0xd116('0x41')]=_[_0xd116('0x40')](_0x1c9b77[_0xd116('0x42')],qs[_0xd116('0x43')](_0x5d588b['query']['fields']));_0x550184['attributes']=_0x550184[_0xd116('0x41')][_0xd116('0x44')]?_0x550184['attributes']:_0x1c9b77[_0xd116('0x42')];if(!_0x5d588b[_0xd116('0x3d')][_0xd116('0x45')](_0xd116('0x46'))){_0x550184[_0xd116('0x24')]=qs[_0xd116('0x24')](_0x5d588b[_0xd116('0x3d')][_0xd116('0x24')]);_0x550184['offset']=qs[_0xd116('0x22')](_0x5d588b['query'][_0xd116('0x22')]);}_0x550184[_0xd116('0x47')]=qs[_0xd116('0x48')](_0x5d588b[_0xd116('0x3d')][_0xd116('0x48')]);_0x550184[_0xd116('0x49')]=qs[_0xd116('0x3f')](_[_0xd116('0x4a')](_0x5d588b[_0xd116('0x3d')],_0x1c9b77[_0xd116('0x3f')]),_0x530d7e);var _0x53eae8=[];var _0x56a676=squel[_0xd116('0x4b')]()['field']('id')[_0xd116('0x4c')](_0xd116('0x2e'))[_0xd116('0x4c')](_0xd116('0x4d'))[_0xd116('0x4e')](_0xd116('0x4f'));var _0x45ab83=squel[_0xd116('0x4b')]()[_0xd116('0x4c')](_0xd116('0x50'))[_0xd116('0x4c')](_0xd116('0x51'))[_0xd116('0x4c')](_0xd116('0x52'))[_0xd116('0x4e')](_0xd116('0x53'),'ui')[_0xd116('0x54')](_0xd116('0x55'),'u',_0xd116('0x56'));var _0x39b69e=squel[_0xd116('0x4b')]()['from'](_0xd116('0x57'),'i')[_0xd116('0x54')](_0xd116('0x58'),'c',_0xd116('0x59'))[_0xd116('0x54')](_0xd116('0x55'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xd116('0x5a'),'a',_0xd116('0x5b'))[_0xd116('0x54')](_0xd116('0x5c'),'me',_0xd116('0x5d'))['left_join']('openchannel_interaction_has_tags','it',_0xd116('0x5e'))[_0xd116('0x54')](_0xd116('0x4f'),'t',_0xd116('0x5f'));var _0x5c46c1=squel[_0xd116('0x60')]();var _0x5459f2=[];var _0x2779f7=squel[_0xd116('0x60')]();var _0x3d053b;if(_0x5d588b[_0xd116('0x3d')][_0xd116('0x61')]){_0x3d053b=as['parseSearch'](_0x5d588b[_0xd116('0x3d')][_0xd116('0x61')]);var _0x4f377e=_0x3d053b[_0xd116('0x62')];for(var _0x114f2b=0x0;_0x114f2b<_0x3d053b['conditions'][_0xd116('0x44')];_0x114f2b++){var _0x3f4a36=_0x3d053b['conditions'][_0x114f2b];var _0x215ae9='i';var _0x1d9455=_[_0xd116('0x63')](_0x530d7e,[_0xd116('0x2e'),_0x3f4a36['field']]);if(!_0x1d9455){switch(_0x3f4a36[_0xd116('0x4c')]){case _0xd116('0x64'):if(_0x3f4a36[_0xd116('0x65')]==0x1){_0x39b69e[_0xd116('0x66')]('`'+_0x3f4a36['field']+_0xd116('0x67'));}else{_0x39b69e[_0xd116('0x66')]('`'+_0x3f4a36[_0xd116('0x4c')]+_0xd116('0x68'));}break;case _0xd116('0x69'):if(_0x3f4a36['operator']===_0xd116('0x6a')){if(_0x3f4a36[_0xd116('0x65')][_0xd116('0x35')]('\x20')[_0xd116('0x44')]>0x1){_0x5c46c1[_0x4f377e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd116('0x6b')](_0x3f4a36[_0xd116('0x65')]),null);}else{var _0x9b0c94='%'+_0x3f4a36[_0xd116('0x65')]+'%';_0x5c46c1[_0x4f377e](_0xd116('0x6c'),_0x9b0c94,_0x9b0c94,_0x9b0c94);}}else{_0x1d9455=_[_0xd116('0x63')](_0x530d7e,['name','ContactId']);_0x3f4a36[_0xd116('0x4c')]=_0xd116('0x6d');_0x2ab496=as[_0xd116('0x6e')](_0x215ae9,_0x1d9455['type'],_0x3f4a36);_0x5c46c1[_0x4f377e](_0x2ab496[_0xd116('0x6f')],_0x2ab496[_0xd116('0x65')][_0xd116('0x70')],_0x2ab496[_0xd116('0x65')][_0xd116('0x71')]);}break;case _0xd116('0x72'):var _0x2fb0f0=_0x3f4a36[_0xd116('0x65')]['split'](',')['map'](function(_0x2a47dc){return Number(_0x2a47dc);});_0x2fb0f0[_0xd116('0x73')](function(_0x238fd0){_0x2779f7['or'](_0xd116('0x74'),'%,'+_0x238fd0+',%');});_0x5459f2=_[_0xd116('0x75')](_0x5459f2,_0x2fb0f0);break;case _0xd116('0x76'):if(_0x3f4a36[_0xd116('0x77')]===_0xd116('0x6a')){_0x5c46c1[_0x4f377e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3f4a36[_0xd116('0x65')]+'%',null);}else{_0x1d9455=_['find'](_0x530d7e,['name','UserId']);_0x3f4a36['field']=_0xd116('0x78');_0x2ab496=as[_0xd116('0x6e')](_0x215ae9,_0x1d9455[_0xd116('0x3b')],_0x3f4a36);_0x5c46c1[_0x4f377e](_0x2ab496['text'],_0x2ab496[_0xd116('0x65')]['start'],_0x2ab496[_0xd116('0x65')]['end']);}break;case _0xd116('0x79'):_0x2ab496=as['buildExpression']('me',null,_0x3f4a36);_0x5c46c1[_0x4f377e](_0x2ab496[_0xd116('0x6f')],_0x2ab496[_0xd116('0x65')]['start'],_0x2ab496[_0xd116('0x65')][_0xd116('0x71')]);break;}}else{var _0x2ab496=as['buildExpression'](_0x215ae9,_0x1d9455[_0xd116('0x3b')],_0x3f4a36);_0x5c46c1[_0x4f377e](_0x2ab496['text'],_0x2ab496[_0xd116('0x65')][_0xd116('0x70')],_0x2ab496['value'][_0xd116('0x71')]);}}}else{var _0x2fc43e=_(_0x5d588b[_0xd116('0x3d')])[_0xd116('0x3e')]()['map'](function(_0x10ea65){return _['some'](_0x530d7e,[_0xd116('0x2e'),_0x10ea65])?_0x10ea65:undefined;})['compact']()[_0xd116('0x65')]();if(!_[_0xd116('0x7a')](_0x2fc43e)){_0x2fc43e[_0xd116('0x73')](function(_0x256277){if(_0x256277===_0xd116('0x7b')){_0x39b69e['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xd116('0x7c')](_0x5d588b[_0xd116('0x3d')][_0x256277]));}else if(_0x256277===_0xd116('0x7d')){var _0x4b28b0=JSON[_0xd116('0x7e')](_0x5d588b[_0xd116('0x3d')][_0x256277])[_0xd116('0x7f')];var _0x3fb9af=JSON['parse'](_0x5d588b[_0xd116('0x3d')][_0x256277])[_0xd116('0x80')];_0x39b69e[_0xd116('0x49')](_0xd116('0x81'),_0x4b28b0,_0x3fb9af);}else{if(_0x5d588b[_0xd116('0x3d')][_0x256277]===_0xd116('0x82')){_0x39b69e[_0xd116('0x49')]('i.'+_0x256277+_0xd116('0x83'));}else{_0x39b69e['where']('i.'+_0x256277+_0xd116('0x84'),_0x5d588b[_0xd116('0x3d')][_0x256277]);}}});}if(_0x5d588b['query'][_0xd116('0x85')]){if(_0x5d588b[_0xd116('0x3d')]['read']==0x1){_0x39b69e[_0xd116('0x66')](_0xd116('0x86'));}else{_0x39b69e['having'](_0xd116('0x87'));}}if(_0x5d588b[_0xd116('0x3d')]['tag']){_0x5459f2=_['isArray'](_0x5d588b[_0xd116('0x3d')][_0xd116('0x88')])?_0x5d588b['query']['tag']:new Array(_0x5d588b[_0xd116('0x3d')][_0xd116('0x88')]);_0x5459f2[_0xd116('0x73')](function(_0x30fd90){_0x2779f7['or'](_0xd116('0x74'),'%,'+_0x30fd90+',%');});}if(_0x5d588b[_0xd116('0x3d')][_0xd116('0x89')]){var _0x155f25=_0x5d588b[_0xd116('0x3d')][_0xd116('0x89')]['replace']('\x5c','\x5c\x5c')[_0xd116('0x8a')](/'/g,'\x27\x27');if(qs[_0xd116('0x8b')](_0x155f25)){_0x5c46c1['or']('i.id\x20LIKE\x20?',_0x155f25+'%');}else{_0x5c46c1['or'](_0xd116('0x8c'),qs[_0xd116('0x6b')](_0x155f25))['or']('i.from\x20LIKE\x20?',_0x155f25+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x155f25+'%');}}}_0x39b69e[_0xd116('0x49')](_0x5c46c1);_0x39b69e[_0xd116('0x8d')]('i.id');var _0x3a3f60={'type':db[_0xd116('0x8e')][_0xd116('0x8f')][_0xd116('0x90')],'raw':!![]};var _0x171fcb=_0x39b69e[_0xd116('0x91')]();_0x171fcb[_0xd116('0x4c')](_0xd116('0x92'));_0x171fcb['field'](_0xd116('0x93'),_0xd116('0x64'));if(_0x550184[_0xd116('0x47')]){_0x550184[_0xd116('0x47')][_0xd116('0x73')](function(_0x560730){var _0x261240=_0x560730[0x0]==='contactName'?_0x560730[0x0]:'i.'+_0x560730[0x0];_0x39b69e[_0xd116('0x47')](_0x261240,_0x560730[0x1]===_0xd116('0x94')?![]:!![]);});}if(!_[_0xd116('0x7a')](_0x5459f2)){_0x39b69e[_0xd116('0x66')](_0x2779f7);_0x171fcb['where'](_0xd116('0x95'),_0x5459f2);}BPromise[_0xd116('0x96')]()[_0xd116('0x2b')](function(){if(!_0x3d053b){if(_0x5d588b[_0xd116('0x3d')]['OpenchannelAccountId'])return;_0x171fcb[_0xd116('0x49')](_0xd116('0x97'));_0x39b69e[_0xd116('0x49')](_0xd116('0x97'));return;}if(_0x5d588b['user'][_0xd116('0x98')]!=='agent')return;return _0x5d588b[_0xd116('0x99')][_0xd116('0x9a')]({'attributes':['id'],'raw':!![]})[_0xd116('0x2b')](function(_0xfac1d1){if(_[_0xd116('0x7a')](_0xfac1d1)){_0x171fcb[_0xd116('0x49')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x39b69e[_0xd116('0x49')](_0xd116('0x9b'));}else{_0x171fcb[_0xd116('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xd116('0x31')](_0xfac1d1,'id'));_0x39b69e['where'](_0xd116('0x9c'),_[_0xd116('0x31')](_0xfac1d1,'id'));}});})[_0xd116('0x2b')](function(){if(_0x5d588b['user'][_0xd116('0x98')]==='agent'&&!_0x3d053b&&!_0x5d588b[_0xd116('0x3d')][_0xd116('0x7b')])return[];return db[_0xd116('0x9d')][_0xd116('0x3d')](_0x171fcb[_0xd116('0x9e')](),_0x3a3f60);})['then'](function(_0x2ea9a){_0xe0133d[_0xd116('0x25')]=_0x2ea9a[_0xd116('0x44')];if(_0xe0133d[_0xd116('0x25')]===0x0)return[];return db[_0xd116('0x9d')][_0xd116('0x3d')](_0x56a676['toString'](),_0x3a3f60)[_0xd116('0x2b')](function(_0x142f63){_0x53eae8=_[_0xd116('0x9f')](_0x142f63,'id');_0x3a3f60=_[_0xd116('0xa0')](_0x3a3f60,{'model':db[_0xd116('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d588b['query'][_0xd116('0x43')]){_0x550184['attributes'][_0xd116('0x73')](function(_0x4faefa){_0x39b69e[_0xd116('0x4c')]('i.'+_0x4faefa);});}else{_0x39b69e[_0xd116('0x4c')](_0xd116('0x93'),_0xd116('0x64'));_0x39b69e[_0xd116('0x4c')](_0xd116('0xa2'),_0xd116('0xa3'));_0x39b69e[_0xd116('0x4c')](_0xd116('0xa4'),_0xd116('0xa5'));_0x39b69e['field'](_0xd116('0xa6'),'contactName');_0x39b69e[_0xd116('0x4c')](_0xd116('0xa7'));_0x39b69e['field'](_0xd116('0xa8'),_0xd116('0xa9'));_0x39b69e['field'](_0xd116('0xaa'),_0xd116('0xab'));_0x39b69e[_0xd116('0x4c')]('c.email','Contact.email');_0x39b69e[_0xd116('0x4c')](_0xd116('0xac'),_0xd116('0xad'));_0x39b69e['field'](_0xd116('0xae'),_0xd116('0xaf'));_0x39b69e[_0xd116('0x4c')](_0xd116('0xb0'),_0xd116('0xb1'));_0x39b69e[_0xd116('0x4c')](_0xd116('0xb2'),_0xd116('0xb3'));_0x39b69e['field']('o.internal','Owner.internal');_0x39b69e[_0xd116('0x4c')](_0xd116('0xb4'),_0xd116('0x33'));}if(_0x550184[_0xd116('0x24')])_0x39b69e[_0xd116('0x24')](_0x550184[_0xd116('0x24')]);if(_0x550184['offset'])_0x39b69e[_0xd116('0x22')](_0x550184[_0xd116('0x22')]);return db['sequelize']['query'](_0x39b69e[_0xd116('0x9e')](),_0x3a3f60);})[_0xd116('0x2b')](function(_0x443389){if(_0x443389[_0xd116('0x44')]>0x0)_0x45ab83['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xd116('0x31')](_0x443389,'id'));return db[_0xd116('0x9d')][_0xd116('0x3d')](_0x45ab83[_0xd116('0x9e')](),_0x3a3f60)[_0xd116('0x2b')](function(_0xa14dbf){var _0x24de11=_[_0xd116('0xb5')](_0xa14dbf,'OpenchannelInteractionId');var _0x290179=[];_0x443389[_0xd116('0x73')](function(_0x487352){_0x290179[_0xd116('0x36')](updateOpenchannelInteraction(_0x487352,_0x53eae8,_0x24de11));});return BPromise['all'](_0x290179);});});})['then'](function(_0x3f8bb4){_0xe0133d['rows']=_0x3f8bb4;return _0xe0133d;})['then'](respondWithFilteredResult(_0x2a1734,_0x550184))[_0xd116('0x37')](handleError(_0x2a1734,null));};exports[_0xd116('0xb6')]=function(_0x2ea2c9,_0x2a15a8){var _0x661450={};if(_0x2ea2c9[_0xd116('0x3d')][_0xd116('0x3b')]&&_0x2ea2c9['query']['type']==='from'){_0x661450[_0xd116('0x4e')]=_0x2ea2c9[_0xd116('0xb7')]['id'];}else{_0x661450['id']=_0x2ea2c9[_0xd116('0xb7')]['id'];}var _0x435fb4={'raw':![],'where':_0x661450},_0x56e87c={};_0x56e87c['model']=_[_0xd116('0x3e')](db[_0xd116('0xa1')]['rawAttributes']);_0x56e87c[_0xd116('0x3d')]=_[_0xd116('0x3e')](_0x2ea2c9[_0xd116('0x3d')]);_0x56e87c[_0xd116('0x3f')]=_['intersection'](_0x56e87c[_0xd116('0x42')],_0x56e87c[_0xd116('0x3d')]);_0x435fb4[_0xd116('0x41')]=_[_0xd116('0x40')](_0x56e87c['model'],qs['fields'](_0x2ea2c9[_0xd116('0x3d')][_0xd116('0x43')]));_0x435fb4['attributes']=_0x435fb4['attributes']['length']?_0x435fb4['attributes']:_0x56e87c['model'];if(_0x2ea2c9['query'][_0xd116('0xb8')]){_0x435fb4[_0xd116('0xb9')]=[{'all':!![]}];}_0x435fb4=_[_0xd116('0xa0')]({},_0x435fb4,_0x2ea2c9[_0xd116('0xba')]);return db[_0xd116('0xa1')][_0xd116('0x63')](_0x435fb4)[_0xd116('0x2b')](handleEntityNotFound(_0x2a15a8,null))[_0xd116('0x2b')](respondWithResult(_0x2a15a8,null))[_0xd116('0x37')](handleError(_0x2a15a8,null));};exports[_0xd116('0xbb')]=function(_0x162d98,_0x207861){return db[_0xd116('0xa1')]['create'](_0x162d98[_0xd116('0x79')],{})['then'](respondWithResult(_0x207861,0xc9))[_0xd116('0x37')](handleError(_0x207861,null));};exports[_0xd116('0x2a')]=function(_0x44026d,_0x264f30){if(_0x44026d['body']['id']){delete _0x44026d['body']['id'];}return db[_0xd116('0xa1')][_0xd116('0x63')]({'where':{'id':_0x44026d['params']['id']}})['then'](handleEntityNotFound(_0x264f30,null))[_0xd116('0x2b')](saveUpdates(_0x44026d['body'],null))[_0xd116('0x2b')](respondWithResult(_0x264f30,null))['catch'](handleError(_0x264f30,null));};exports[_0xd116('0xbc')]=function(_0x1d6437,_0x224097){return db['OpenchannelInteraction'][_0xd116('0x63')]({'where':{'id':_0x1d6437[_0xd116('0xb7')]['id']}})[_0xd116('0x2b')](handleEntityNotFound(_0x224097,null))[_0xd116('0x2b')](removeEntity(_0x224097,null))[_0xd116('0x37')](handleError(_0x224097,null));};exports['describe']=function(_0x430512,_0x39fcc4){return db[_0xd116('0xa1')][_0xd116('0xbd')]()[_0xd116('0x2b')](respondWithResult(_0x39fcc4,null))[_0xd116('0x37')](handleError(_0x39fcc4,null));};exports[_0xd116('0xbe')]=function(_0x1a16e2,_0x136f29,_0x43f682){return db[_0xd116('0xbf')][_0xd116('0x63')]({'where':{'id':_0x1a16e2[_0xd116('0xb7')]['id']}})['then'](handleEntityNotFound(_0x136f29,null))[_0xd116('0x2b')](function(_0x1bde6f){if(_0x1bde6f){return _0x1bde6f['addMessage'](_0x1a16e2['body'][_0xd116('0xc0')],_[_0xd116('0xc1')](_0x1a16e2[_0xd116('0x79')],[_0xd116('0xc0'),'id'])||{});}})[_0xd116('0x2b')](respondWithResult(_0x136f29,null))[_0xd116('0x37')](handleError(_0x136f29,null));};exports[_0xd116('0xc2')]=function(_0x4d7436,_0x511f0c,_0x4131cb){var _0x596156={'raw':![],'where':{}};var _0x5e398b={};var _0x844c4b={'count':0x0,'rows':[]};return db[_0xd116('0xa1')][_0xd116('0xc3')]({'where':{'id':_0x4d7436[_0xd116('0xb7')]['id']}})[_0xd116('0x2b')](handleEntityNotFound(_0x511f0c,null))[_0xd116('0x2b')](function(_0x46aaf0){if(_0x46aaf0){_0x5e398b['model']=_[_0xd116('0x3e')](db[_0xd116('0xbf')]['rawAttributes']);_0x5e398b['query']=_[_0xd116('0x3e')](_0x4d7436[_0xd116('0x3d')]);_0x5e398b['filters']=_[_0xd116('0x40')](_0x5e398b[_0xd116('0x42')],_0x5e398b[_0xd116('0x3d')]);_0x596156[_0xd116('0x41')]=_[_0xd116('0x40')](_0x5e398b[_0xd116('0x42')],qs[_0xd116('0x43')](_0x4d7436[_0xd116('0x3d')]['fields']));_0x596156[_0xd116('0x41')]=_0x596156[_0xd116('0x41')]['length']?_0x596156[_0xd116('0x41')]:_0x5e398b[_0xd116('0x42')];if(!_0x4d7436['query']['hasOwnProperty'](_0xd116('0x46'))){_0x596156['limit']=qs[_0xd116('0x24')](_0x4d7436['query'][_0xd116('0x24')]);_0x596156[_0xd116('0x22')]=qs['offset'](_0x4d7436[_0xd116('0x3d')]['offset']);}_0x596156['order']=qs[_0xd116('0x48')](_0x4d7436['query'][_0xd116('0x48')]);_0x596156['where']=qs[_0xd116('0x3f')](_[_0xd116('0x4a')](_0x4d7436[_0xd116('0x3d')],_0x5e398b[_0xd116('0x3f')]));_0x596156[_0xd116('0x49')][_0xd116('0xc4')]=_0x46aaf0['id'];if(_0x4d7436['query'][_0xd116('0x89')]){_0x596156[_0xd116('0x49')]=_[_0xd116('0xa0')](_0x596156['where'],{'$or':_[_0xd116('0x31')](_0x596156[_0xd116('0x41')],function(_0x1907d1){var _0x4f7531={};_0x4f7531[_0x1907d1]={'$like':'%'+_0x4d7436[_0xd116('0x3d')]['filter']+'%'};return _0x4f7531;})});}if(_0x4d7436[_0xd116('0x3d')][_0xd116('0x7f')]){var _0x59523e=_0x4d7436[_0xd116('0x3d')][_0xd116('0x7f')]['split'](',');var _0x49d6ea={};_0x49d6ea[_0x59523e[0x0]]={'$gte':moment(_0x59523e[0x1])['format'](_0xd116('0xc5'))};_0x596156[_0xd116('0x49')]=_[_0xd116('0xa0')](_0x596156['where'],_0x49d6ea);}_0x596156=_[_0xd116('0xa0')]({},_0x596156,_0x4d7436['options']);return db[_0xd116('0xbf')]['count']({'where':_0x596156[_0xd116('0x49')]})[_0xd116('0x2b')](function(_0x342a77){_0x844c4b['count']=_0x342a77;if(_0x4d7436[_0xd116('0x3d')][_0xd116('0xb8')]){_0x596156[_0xd116('0xb9')]=[{'all':!![]}];}return db[_0xd116('0xbf')]['findAll'](_0x596156);})['then'](function(_0xb558b8){_0x844c4b[_0xd116('0xc6')]=_0xb558b8;return _0x844c4b;});}})[_0xd116('0x2b')](respondWithFilteredResult(_0x511f0c,_0x596156))[_0xd116('0x37')](handleError(_0x511f0c,null));};exports[_0xd116('0xc7')]=function(_0x429cd8,_0x45adc8,_0x51f88c){return db['OpenchannelInteraction'][_0xd116('0x63')]({'where':{'id':_0x429cd8[_0xd116('0xb7')]['id']}})['then'](handleEntityNotFound(_0x45adc8,null))[_0xd116('0x2b')](function(_0x21b1b8){if(_0x21b1b8){return _0x21b1b8[_0xd116('0xc8')](_0x429cd8['body']['ids'],_[_0xd116('0xc1')](_0x429cd8[_0xd116('0x79')],['ids','id'])||{})[_0xd116('0xc9')](function(){return db[_0xd116('0x72')][_0xd116('0xca')]({'attributes':['id','name',_0xd116('0x4d')],'where':{'id':_0x429cd8[_0xd116('0x79')][_0xd116('0xc0')]}});})[_0xd116('0x2b')](function(_0x3f9d1c){socket[_0xd116('0xcb')]('openchannelInteractionTags:save',{'id':Number(_0x429cd8['params']['id']),'tags':_0x3f9d1c||[]});return{'id':Number(_0x429cd8[_0xd116('0xb7')]['id']),'tags':_0x3f9d1c||[]};});}})[_0xd116('0x2b')](respondWithResult(_0x45adc8,null))[_0xd116('0x37')](handleError(_0x45adc8,null));};exports[_0xd116('0xcc')]=function(_0x1a77d0,_0x1c8f8c,_0x1221f1){return db['OpenchannelInteraction'][_0xd116('0x63')]({'where':{'id':_0x1a77d0[_0xd116('0xb7')]['id']}})[_0xd116('0x2b')](handleEntityNotFound(_0x1c8f8c,null))[_0xd116('0x2b')](function(_0x273467){if(_0x273467){return _0x273467['removeTags'](_0x1a77d0[_0xd116('0x3d')]['ids']);}})[_0xd116('0x2b')](respondWithStatusCode(_0x1c8f8c,null))[_0xd116('0x37')](handleError(_0x1c8f8c,null));};exports[_0xd116('0xcd')]=function(_0x5a7b43,_0x3463e6){var _0x5be84c=moment()[_0xd116('0xce')]()[_0xd116('0x9e')]();var _0xa158c1=path['join'](config[_0xd116('0xcf')],'server',_0xd116('0xd0'),_0xd116('0xd1'));var _0xc37a61=path['join'](config[_0xd116('0xcf')],_0xd116('0xd2'),'files',_0xd116('0xd3'));var _0xcf0332=path[_0xd116('0xd4')](_0xa158c1,_0x5be84c);var _0x3cf075=util['format'](_0xd116('0xd5'),_0x5a7b43['params']['id'],_0x5be84c);var _0x5a7f1d=path['join'](_0xa158c1,_0x3cf075);var _0x4ef955=[];_0x4ef955[_0xd116('0x36')]({'model':db['User'],'as':_0xd116('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x4ef955['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xd116('0xd6'),_0xd116('0xd7')],'raw':!![]});if(_0x5a7b43['query'][_0xd116('0xd3')]){_0x4ef955[_0xd116('0x36')]({'model':db['Attachment'],'as':_0xd116('0xd8'),'raw':!![]});}var _0x248c43=[{'model':db[_0xd116('0xbf')],'as':'Messages','attributes':['id','body','createdAt',_0xd116('0xd9'),_0xd116('0xda'),_0xd116('0x85')],'include':_0x4ef955}];_0x248c43[_0xd116('0x36')]({'model':db[_0xd116('0xdb')],'as':_0xd116('0xdc'),'attributes':['id',_0xd116('0x2e')]});_0x248c43['push']({'model':db['User'],'as':_0xd116('0xdd'),'attributes':['id',_0xd116('0x32')]});return db[_0xd116('0xa1')]['find']({'where':{'id':_0x5a7b43['params']['id']},'include':_0x248c43})[_0xd116('0x2b')](handleEntityNotFound(_0x3463e6,null))['then'](function(_0x162fbb){if(_0x162fbb){var _0x23e515=_0x162fbb['get']({'plain':!![]});fs[_0xd116('0xde')](_0xcf0332);var _0xbfcc29={'channel':'Openchannel','account':_0x23e515[_0xd116('0xdc')]['name'],'agent':_0x23e515[_0xd116('0xdd')]?_0x23e515['Owner'][_0xd116('0x32')]:_0xd116('0xdf'),'createdAt':moment(_0x23e515[_0xd116('0x7d')])[_0xd116('0xe0')](_0xd116('0xc5'))[_0xd116('0x9e')](),'closedAt':_0x23e515[_0xd116('0xe1')]?moment(_0x23e515[_0xd116('0xe2')])[_0xd116('0xe0')](_0xd116('0xc5'))['toString']():'','disposition':_0x23e515[_0xd116('0xe3')],'visibility':_0x23e515[_0xd116('0xe4')]?_0xd116('0xe5'):_0xd116('0xe6'),'messages':_(_0x23e515[_0xd116('0xe7')])[_0xd116('0x89')]({'secret':![]})[_0xd116('0x31')](function(_0xc7a8a7){if(_0xc7a8a7['Attachment']){var _0x361a4a=path['join'](_0xc37a61,_0xc7a8a7[_0xd116('0xd8')][_0xd116('0xe8')]);if(fs[_0xd116('0xe9')](_0x361a4a)){fs[_0xd116('0xea')](_0x361a4a)[_0xd116('0xeb')](fs[_0xd116('0xec')](path[_0xd116('0xd4')](_0xcf0332,_0xc7a8a7[_0xd116('0xd8')]['basename'])));}}return{'date':moment(_0xc7a8a7[_0xd116('0x7d')])[_0xd116('0xe0')](_0xd116('0xc5'))[_0xd116('0x9e')](),'sender':_0xc7a8a7[_0xd116('0xd9')]==='out'?_0xc7a8a7[_0xd116('0x76')]?_0xc7a8a7[_0xd116('0x76')][_0xd116('0x32')]:_0xd116('0xed'):_0xc7a8a7[_0xd116('0x69')]['firstName']+(_0xc7a8a7['Contact'][_0xd116('0xd7')]?'\x20'+_0xc7a8a7['Contact'][_0xd116('0xd7')]:''),'body':_0xc7a8a7[_0xd116('0xd8')]?_0xc7a8a7[_0xd116('0xd8')][_0xd116('0xe8')]:_0xc7a8a7[_0xd116('0x79')],'direction':_0xc7a8a7[_0xd116('0xd9')]===_0xd116('0xee')?'A':'C','secret':_0xc7a8a7[_0xd116('0xda')],'read':_0xc7a8a7[_0xd116('0x85')],'attachment':_0xc7a8a7[_0xd116('0xd8')]};})[_0xd116('0x65')]()};return ejs['renderFile'](path[_0xd116('0xd4')](config[_0xd116('0xcf')],'server',_0xd116('0xef'),_0xd116('0xf0')),{'interaction':_0xbfcc29})[_0xd116('0x2b')](function(_0x36eac2){var _0x1a619e=path[_0xd116('0xd4')](_0xcf0332,_0xd116('0xf1')+_0x23e515['id']+'-'+_0x5be84c+_0xd116('0xf2'));var _0x3ededf={'path':_0x1a619e,'channel':_0xd116('0xf3'),'interactionId':_0x23e515['id']};return pdf[_0xd116('0xf4')](_0x36eac2,_0x3ededf);})[_0xd116('0x2b')](function(){return new BPromise(function(_0x35293b,_0x46ba8c){zipdir(_0xcf0332,{'saveTo':_0x5a7f1d},function(_0x1932e7,_0x8c4d92){if(_0x1932e7)return _0x46ba8c(_0x1932e7);return _0x35293b(_0x8c4d92);});})['then'](function(){return new BPromise(function(_0x3defd3,_0x18376b){rimraf(_0xcf0332,function(_0x5cb2d8){if(_0x5cb2d8)_0x18376b(_0x5cb2d8);return _0x3defd3();});});})['then'](function(){return _0x3463e6['download'](_0x5a7f1d,_0x3cf075,function(_0x497b32){if(_0x497b32){console[_0xd116('0xf5')](_0xd116('0xf6'),_0x497b32);}else{fs[_0xd116('0xf7')](_0x5a7f1d);}});});});}else{return _0x3463e6[_0xd116('0x20')](0xc8);}})['catch'](handleError(_0x3463e6,null));}; \ No newline at end of file +var _0xa12f=['basename','out','System','secret','server','views','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','name','send','Users','fullname','Tags','TagIds','split','push','catch','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','openchannel_interactions','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','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?','Sequelize','QueryTypes','clone','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','sequelize','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','format','findAll','rows','addTags','spread','emit','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','Account','Owner','get','mkdirSync','Openchannel','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Private','existsSync','createWriteStream'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0xa12f,0xf2));var _0xfa12=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa12f[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xfa12('0x0'));var rimraf=require(_0xfa12('0x1'));var zipdir=require(_0xfa12('0x2'));var jsonpatch=require(_0xfa12('0x3'));var rp=require(_0xfa12('0x4'));var moment=require(_0xfa12('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfa12('0x6'));var util=require('util');var path=require(_0xfa12('0x7'));var sox=require(_0xfa12('0x8'));var csv=require(_0xfa12('0x9'));var ejs=require(_0xfa12('0xa'));var fs=require('fs');var fs_extra=require(_0xfa12('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa12('0xc'));var deskjs=require(_0xfa12('0xd'));var toCsv=require(_0xfa12('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa12('0xe'));var as=require(_0xfa12('0xf'));var pdf=require(_0xfa12('0x10'));var hardwareService=require(_0xfa12('0x11'));var logger=require('../../config/logger')(_0xfa12('0x12'));var utils=require(_0xfa12('0x13'));var config=require(_0xfa12('0x14'));var licenseUtil=require(_0xfa12('0x15'));var db=require(_0xfa12('0x16'))['db'];config['redis']=_['defaults'](config[_0xfa12('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa12('0x18'))(new Redis(config['redis']));require(_0xfa12('0x19'))[_0xfa12('0x1a')](socket);function respondWithStatusCode(_0x34671e,_0x5334dd){_0x5334dd=_0x5334dd||0xcc;return function(_0x30709f){if(_0x30709f){return _0x34671e[_0xfa12('0x1b')](_0x5334dd);}return _0x34671e[_0xfa12('0x1c')](_0x5334dd)['end']();};}function respondWithResult(_0x5a60a3,_0x3f70c7){_0x3f70c7=_0x3f70c7||0xc8;return function(_0x4da5fa){if(_0x4da5fa){return _0x5a60a3['status'](_0x3f70c7)[_0xfa12('0x1d')](_0x4da5fa);}};}function respondWithFilteredResult(_0x385f18,_0x140625){return function(_0x13f5ab){if(_0x13f5ab){var _0x483457=typeof _0x140625[_0xfa12('0x1e')]===_0xfa12('0x1f')&&typeof _0x140625[_0xfa12('0x20')]===_0xfa12('0x1f');var _0x139f0a=_0x13f5ab[_0xfa12('0x21')];var _0x494b10=_0x483457?0x0:_0x140625[_0xfa12('0x1e')];var _0x2afb55=_0x483457?_0x13f5ab[_0xfa12('0x21')]:_0x140625[_0xfa12('0x1e')]+_0x140625[_0xfa12('0x20')];var _0x2dfe85;if(_0x2afb55>=_0x139f0a){_0x2afb55=_0x139f0a;_0x2dfe85=0xc8;}else{_0x2dfe85=0xce;}_0x385f18[_0xfa12('0x1c')](_0x2dfe85);return _0x385f18[_0xfa12('0x22')]('Content-Range',_0x494b10+'-'+_0x2afb55+'/'+_0x139f0a)['json'](_0x13f5ab);}return null;};}function patchUpdates(_0x392117){return function(_0x27a19e){try{jsonpatch['apply'](_0x27a19e,_0x392117,!![]);}catch(_0x10a3bd){return BPromise[_0xfa12('0x23')](_0x10a3bd);}return _0x27a19e[_0xfa12('0x24')]();};}function saveUpdates(_0x3d2f9f,_0x2a5b69){return function(_0x11cae8){if(_0x11cae8){return _0x11cae8[_0xfa12('0x25')](_0x3d2f9f)[_0xfa12('0x26')](function(_0x3d6e7a){return _0x3d6e7a;});}return null;};}function removeEntity(_0x31f3e5,_0x353ab3){return function(_0x4c73cc){if(_0x4c73cc){return _0x4c73cc[_0xfa12('0x27')]()[_0xfa12('0x26')](function(){_0x31f3e5[_0xfa12('0x1c')](0xcc)[_0xfa12('0x28')]();});}};}function handleEntityNotFound(_0x314d40,_0x48bd0c){return function(_0x8ee8fc){if(!_0x8ee8fc){_0x314d40[_0xfa12('0x1b')](0x194);}return _0x8ee8fc;};}function handleError(_0x30902a,_0x3991f9){_0x3991f9=_0x3991f9||0x1f4;return function(_0x505105){logger['error'](_0x505105['stack']);if(_0x505105['name']){delete _0x505105[_0xfa12('0x29')];}_0x30902a[_0xfa12('0x1c')](_0x3991f9)[_0xfa12('0x2a')](_0x505105);};}function getInteractionUsers(_0x534317,_0x28574e){return new BPromise(function(_0x1b4578,_0x4738ca){try{if(_0x28574e[_0x534317['id']]){_0x534317[_0xfa12('0x2b')]=_['map'](_0x28574e[_0x534317['id']],function(_0x56b98a){return{'id':_0x56b98a['id'],'fullname':_0x56b98a[_0xfa12('0x2c')]};});}}catch(_0x19da9d){_0x4738ca(_0x19da9d);}_0x1b4578(_0x534317);});}function getInteractionTags(_0x49acd5,_0xdbd20e){return new BPromise(function(_0x50ce3d,_0x533f54){try{if(_0x49acd5['TagIds']){_0x49acd5[_0xfa12('0x2d')]=[];_0x49acd5[_0xfa12('0x2e')][_0xfa12('0x2f')](',')['forEach'](function(_0x4e5818){_0x49acd5[_0xfa12('0x2d')][_0xfa12('0x30')](_0xdbd20e[_0x4e5818]);});}delete _0x49acd5['TagIds'];}catch(_0x35ada0){_0x533f54(_0x35ada0);}_0x50ce3d(_0x49acd5);});}function updateOpenchannelInteraction(_0xb21233,_0x314ca0,_0x549033){return new BPromise(function(_0x42018a,_0x12e49a){return getInteractionUsers(_0xb21233,_0x549033)[_0xfa12('0x26')](function(_0x1d8293){return getInteractionTags(_0x1d8293,_0x314ca0);})[_0xfa12('0x26')](function(_0x3753d8){_0x42018a(_0x3753d8);})[_0xfa12('0x31')](function(_0x15fccd){_0x12e49a(_0x15fccd);});});}exports[_0xfa12('0x32')]=function(_0x2c53ee,_0x4c8ac1){var _0x216922={},_0x4c429c={},_0x1e6c80={'count':0x0,'rows':[]};var _0x1b68af=_[_0xfa12('0x33')](db[_0xfa12('0x34')][_0xfa12('0x35')],function(_0x28819a){return{'name':_0x28819a[_0xfa12('0x36')],'type':_0x28819a['type'][_0xfa12('0x37')]};});_0x4c429c['model']=_[_0xfa12('0x33')](_0x1b68af,'name');_0x4c429c[_0xfa12('0x38')]=_[_0xfa12('0x39')](_0x2c53ee[_0xfa12('0x38')]);_0x4c429c[_0xfa12('0x3a')]=_[_0xfa12('0x3b')](_0x4c429c[_0xfa12('0x3c')],_0x4c429c[_0xfa12('0x38')]);_0x216922['attributes']=_[_0xfa12('0x3b')](_0x4c429c[_0xfa12('0x3c')],qs[_0xfa12('0x3d')](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x3d')]));_0x216922[_0xfa12('0x3e')]=_0x216922[_0xfa12('0x3e')][_0xfa12('0x3f')]?_0x216922[_0xfa12('0x3e')]:_0x4c429c[_0xfa12('0x3c')];if(!_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x40')](_0xfa12('0x41'))){_0x216922[_0xfa12('0x20')]=qs[_0xfa12('0x20')](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x20')]);_0x216922[_0xfa12('0x1e')]=qs[_0xfa12('0x1e')](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x1e')]);}_0x216922[_0xfa12('0x42')]=qs[_0xfa12('0x43')](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x43')]);_0x216922[_0xfa12('0x44')]=qs['filters'](_[_0xfa12('0x45')](_0x2c53ee[_0xfa12('0x38')],_0x4c429c[_0xfa12('0x3a')]),_0x1b68af);var _0x5464e8=[];var _0x33446c=squel[_0xfa12('0x46')]()[_0xfa12('0x47')]('id')[_0xfa12('0x47')]('name')[_0xfa12('0x47')](_0xfa12('0x48'))['from']('tools_tags');var _0x1a4692=squel['select']()[_0xfa12('0x47')](_0xfa12('0x49'))['field']('u.fullname')['field'](_0xfa12('0x4a'))[_0xfa12('0x4b')](_0xfa12('0x4c'),'ui')[_0xfa12('0x4d')]('users','u','u.id\x20=\x20ui.UserId');var _0x3baeaa=squel['select']()[_0xfa12('0x4b')](_0xfa12('0x4e'),'i')[_0xfa12('0x4d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xfa12('0x4d')](_0xfa12('0x4f'),'o',_0xfa12('0x50'))[_0xfa12('0x4d')](_0xfa12('0x51'),'a',_0xfa12('0x52'))[_0xfa12('0x4d')](_0xfa12('0x53'),'me',_0xfa12('0x54'))[_0xfa12('0x4d')](_0xfa12('0x55'),'it',_0xfa12('0x56'))[_0xfa12('0x4d')](_0xfa12('0x57'),'t','t.id\x20=\x20it.TagId');var _0x3118cf=squel[_0xfa12('0x58')]();var _0x4cc96e=[];var _0x71433e=squel[_0xfa12('0x58')]();var _0x1d3708;if(_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x59')]){_0x1d3708=as[_0xfa12('0x5a')](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x59')]);var _0x130fa=_0x1d3708[_0xfa12('0x5b')];for(var _0x55b2ab=0x0;_0x55b2ab<_0x1d3708[_0xfa12('0x5c')][_0xfa12('0x3f')];_0x55b2ab++){var _0x633c29=_0x1d3708[_0xfa12('0x5c')][_0x55b2ab];var _0x4a0959='i';var _0x447552=_[_0xfa12('0x5d')](_0x1b68af,[_0xfa12('0x29'),_0x633c29['field']]);if(!_0x447552){switch(_0x633c29[_0xfa12('0x47')]){case _0xfa12('0x5e'):if(_0x633c29[_0xfa12('0x5f')]==0x1){_0x3baeaa['having']('`'+_0x633c29[_0xfa12('0x47')]+_0xfa12('0x60'));}else{_0x3baeaa[_0xfa12('0x61')]('`'+_0x633c29[_0xfa12('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x633c29[_0xfa12('0x62')]===_0xfa12('0x63')){if(_0x633c29[_0xfa12('0x5f')][_0xfa12('0x2f')]('\x20')['length']>0x1){_0x3118cf[_0x130fa](_0xfa12('0x64'),qs[_0xfa12('0x65')](_0x633c29[_0xfa12('0x5f')]),null);}else{var _0x4cdff5='%'+_0x633c29['value']+'%';_0x3118cf[_0x130fa]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4cdff5,_0x4cdff5,_0x4cdff5);}}else{_0x447552=_[_0xfa12('0x5d')](_0x1b68af,['name',_0xfa12('0x66')]);_0x633c29[_0xfa12('0x47')]=_0xfa12('0x66');_0x16b4df=as[_0xfa12('0x67')](_0x4a0959,_0x447552['type'],_0x633c29);_0x3118cf[_0x130fa](_0x16b4df[_0xfa12('0x68')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x69')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x28')]);}break;case _0xfa12('0x6a'):var _0x6f446=_0x633c29[_0xfa12('0x5f')][_0xfa12('0x2f')](',')[_0xfa12('0x33')](function(_0x198cc4){return Number(_0x198cc4);});_0x6f446[_0xfa12('0x6b')](function(_0x3daddc){_0x71433e['or'](_0xfa12('0x6c'),'%,'+_0x3daddc+',%');});_0x4cc96e=_['union'](_0x4cc96e,_0x6f446);break;case _0xfa12('0x6d'):if(_0x633c29[_0xfa12('0x62')]===_0xfa12('0x63')){_0x3118cf[_0x130fa](_0xfa12('0x6e'),'%'+_0x633c29[_0xfa12('0x5f')]+'%',null);}else{_0x447552=_['find'](_0x1b68af,[_0xfa12('0x29'),_0xfa12('0x6f')]);_0x633c29['field']=_0xfa12('0x6f');_0x16b4df=as[_0xfa12('0x67')](_0x4a0959,_0x447552[_0xfa12('0x70')],_0x633c29);_0x3118cf[_0x130fa](_0x16b4df[_0xfa12('0x68')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x69')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x28')]);}break;case _0xfa12('0x71'):_0x16b4df=as[_0xfa12('0x67')]('me',null,_0x633c29);_0x3118cf[_0x130fa](_0x16b4df['text'],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x69')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x28')]);break;}}else{var _0x16b4df=as[_0xfa12('0x67')](_0x4a0959,_0x447552[_0xfa12('0x70')],_0x633c29);_0x3118cf[_0x130fa](_0x16b4df['text'],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x69')],_0x16b4df[_0xfa12('0x5f')][_0xfa12('0x28')]);}}}else{var _0x210c54=_(_0x2c53ee[_0xfa12('0x38')])[_0xfa12('0x39')]()[_0xfa12('0x33')](function(_0x74b2f3){return _['some'](_0x1b68af,['name',_0x74b2f3])?_0x74b2f3:undefined;})[_0xfa12('0x72')]()[_0xfa12('0x5f')]();if(!_[_0xfa12('0x73')](_0x210c54)){_0x210c54[_0xfa12('0x6b')](function(_0x273759){if(_0x273759===_0xfa12('0x74')){_0x3baeaa['where'](_0xfa12('0x75'),[][_0xfa12('0x76')](_0x2c53ee[_0xfa12('0x38')][_0x273759]));}else if(_0x273759==='createdAt'){var _0x484977=JSON['parse'](_0x2c53ee[_0xfa12('0x38')][_0x273759])[_0xfa12('0x77')];var _0x456d9e=JSON['parse'](_0x2c53ee[_0xfa12('0x38')][_0x273759])[_0xfa12('0x78')];_0x3baeaa['where'](_0xfa12('0x79'),_0x484977,_0x456d9e);}else{if(_0x2c53ee['query'][_0x273759]===_0xfa12('0x7a')){_0x3baeaa[_0xfa12('0x44')]('i.'+_0x273759+_0xfa12('0x7b'));}else{_0x3baeaa[_0xfa12('0x44')]('i.'+_0x273759+_0xfa12('0x7c'),_0x2c53ee['query'][_0x273759]);}}});}if(_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x7d')]){if(_0x2c53ee[_0xfa12('0x38')]['read']==0x1){_0x3baeaa[_0xfa12('0x61')](_0xfa12('0x7e'));}else{_0x3baeaa[_0xfa12('0x61')](_0xfa12('0x7f'));}}if(_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x80')]){_0x4cc96e=_['isArray'](_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x80')])?_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x80')]:new Array(_0x2c53ee[_0xfa12('0x38')]['tag']);_0x4cc96e['forEach'](function(_0x123a0b){_0x71433e['or'](_0xfa12('0x6c'),'%,'+_0x123a0b+',%');});}if(_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x81')]){var _0x13b9c1=_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x81')]['replace']('\x5c','\x5c\x5c')[_0xfa12('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x13b9c1)){_0x3118cf['or'](_0xfa12('0x83'),_0x13b9c1+'%');}else{_0x3118cf['or'](_0xfa12('0x84'),qs[_0xfa12('0x65')](_0x13b9c1))['or'](_0xfa12('0x85'),_0x13b9c1+'%')['or'](_0xfa12('0x86'),_0x13b9c1+'%');}}}_0x3baeaa['where'](_0x3118cf);_0x3baeaa['group']('i.id');var _0x3c256c={'type':db[_0xfa12('0x87')][_0xfa12('0x88')]['SELECT'],'raw':!![]};var _0x53a06f=_0x3baeaa[_0xfa12('0x89')]();_0x53a06f[_0xfa12('0x47')](_0xfa12('0x8a'));_0x53a06f[_0xfa12('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfa12('0x5e'));if(_0x216922[_0xfa12('0x42')]){_0x216922[_0xfa12('0x42')][_0xfa12('0x6b')](function(_0x6ebd1a){var _0x4d5205=_0x6ebd1a[0x0]===_0xfa12('0x8b')?_0x6ebd1a[0x0]:'i.'+_0x6ebd1a[0x0];_0x3baeaa[_0xfa12('0x42')](_0x4d5205,_0x6ebd1a[0x1]===_0xfa12('0x8c')?![]:!![]);});}if(!_[_0xfa12('0x73')](_0x4cc96e)){_0x3baeaa[_0xfa12('0x61')](_0x71433e);_0x53a06f[_0xfa12('0x44')](_0xfa12('0x8d'),_0x4cc96e);}BPromise[_0xfa12('0x8e')]()['then'](function(){if(!_0x1d3708){if(_0x2c53ee[_0xfa12('0x38')]['OpenchannelAccountId'])return;_0x53a06f[_0xfa12('0x44')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x3baeaa[_0xfa12('0x44')](_0xfa12('0x8f'));return;}if(_0x2c53ee[_0xfa12('0x90')]['role']!==_0xfa12('0x91'))return;return _0x2c53ee['user'][_0xfa12('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2b6f9e){if(_[_0xfa12('0x73')](_0x2b6f9e)){_0x53a06f[_0xfa12('0x44')](_0xfa12('0x93'));_0x3baeaa[_0xfa12('0x44')](_0xfa12('0x93'));}else{_0x53a06f[_0xfa12('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x2b6f9e,'id'));_0x3baeaa['where'](_0xfa12('0x75'),_[_0xfa12('0x33')](_0x2b6f9e,'id'));}});})['then'](function(){if(_0x2c53ee['user'][_0xfa12('0x94')]===_0xfa12('0x91')&&!_0x1d3708&&!_0x2c53ee[_0xfa12('0x38')][_0xfa12('0x74')])return[];return db['sequelize'][_0xfa12('0x38')](_0x53a06f[_0xfa12('0x95')](),_0x3c256c);})[_0xfa12('0x26')](function(_0x57dc4b){_0x1e6c80[_0xfa12('0x21')]=_0x57dc4b[_0xfa12('0x3f')];if(_0x1e6c80[_0xfa12('0x21')]===0x0)return[];return db['sequelize'][_0xfa12('0x38')](_0x33446c[_0xfa12('0x95')](),_0x3c256c)['then'](function(_0x14288b){_0x5464e8=_[_0xfa12('0x96')](_0x14288b,'id');_0x3c256c=_[_0xfa12('0x97')](_0x3c256c,{'model':db[_0xfa12('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c53ee['query'][_0xfa12('0x3d')]){_0x216922['attributes'][_0xfa12('0x6b')](function(_0x32bd37){_0x3baeaa[_0xfa12('0x47')]('i.'+_0x32bd37);});}else{_0x3baeaa['field'](_0xfa12('0x98'),_0xfa12('0x5e'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0x99'),_0xfa12('0x9a'));_0x3baeaa['field']('a.mandatoryDisposition',_0xfa12('0x9b'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0x9c'),_0xfa12('0x8b'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0x9d'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0x9e'),_0xfa12('0x9f'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa0'),_0xfa12('0xa1'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa2'),_0xfa12('0xa3'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa4'),_0xfa12('0xa5'));_0x3baeaa[_0xfa12('0x47')]('c.mobile','Contact.mobile');_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa6'),'Contact.fax');_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa7'),_0xfa12('0xa8'));_0x3baeaa[_0xfa12('0x47')](_0xfa12('0xa9'),_0xfa12('0xaa'));_0x3baeaa['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfa12('0x2e'));}if(_0x216922['limit'])_0x3baeaa['limit'](_0x216922[_0xfa12('0x20')]);if(_0x216922[_0xfa12('0x1e')])_0x3baeaa['offset'](_0x216922['offset']);return db[_0xfa12('0xab')]['query'](_0x3baeaa[_0xfa12('0x95')](),_0x3c256c);})[_0xfa12('0x26')](function(_0x41a232){if(_0x41a232[_0xfa12('0x3f')]>0x0)_0x1a4692['where'](_0xfa12('0xac'),_[_0xfa12('0x33')](_0x41a232,'id'));return db[_0xfa12('0xab')][_0xfa12('0x38')](_0x1a4692[_0xfa12('0x95')](),_0x3c256c)[_0xfa12('0x26')](function(_0xb30d16){var _0x538809=_['groupBy'](_0xb30d16,_0xfa12('0xad'));var _0x23a6de=[];_0x41a232[_0xfa12('0x6b')](function(_0x309cdb){_0x23a6de['push'](updateOpenchannelInteraction(_0x309cdb,_0x5464e8,_0x538809));});return BPromise[_0xfa12('0xae')](_0x23a6de);});});})[_0xfa12('0x26')](function(_0x116ae5){_0x1e6c80['rows']=_0x116ae5;return _0x1e6c80;})[_0xfa12('0x26')](respondWithFilteredResult(_0x4c8ac1,_0x216922))[_0xfa12('0x31')](handleError(_0x4c8ac1,null));};exports['show']=function(_0xdd7619,_0x370980){var _0x485aa6={};if(_0xdd7619[_0xfa12('0x38')][_0xfa12('0x70')]&&_0xdd7619[_0xfa12('0x38')][_0xfa12('0x70')]==='from'){_0x485aa6[_0xfa12('0x4b')]=_0xdd7619['params']['id'];}else{_0x485aa6['id']=_0xdd7619[_0xfa12('0xaf')]['id'];}var _0x3ef621={'raw':![],'where':_0x485aa6},_0x4e69b9={};_0x4e69b9['model']=_['keys'](db[_0xfa12('0x34')][_0xfa12('0x35')]);_0x4e69b9[_0xfa12('0x38')]=_[_0xfa12('0x39')](_0xdd7619[_0xfa12('0x38')]);_0x4e69b9[_0xfa12('0x3a')]=_[_0xfa12('0x3b')](_0x4e69b9[_0xfa12('0x3c')],_0x4e69b9[_0xfa12('0x38')]);_0x3ef621['attributes']=_[_0xfa12('0x3b')](_0x4e69b9[_0xfa12('0x3c')],qs['fields'](_0xdd7619[_0xfa12('0x38')]['fields']));_0x3ef621[_0xfa12('0x3e')]=_0x3ef621[_0xfa12('0x3e')][_0xfa12('0x3f')]?_0x3ef621[_0xfa12('0x3e')]:_0x4e69b9[_0xfa12('0x3c')];if(_0xdd7619['query'][_0xfa12('0xb0')]){_0x3ef621[_0xfa12('0xb1')]=[{'all':!![]}];}_0x3ef621=_[_0xfa12('0x97')]({},_0x3ef621,_0xdd7619[_0xfa12('0xb2')]);return db[_0xfa12('0x34')][_0xfa12('0x5d')](_0x3ef621)['then'](handleEntityNotFound(_0x370980,null))[_0xfa12('0x26')](respondWithResult(_0x370980,null))[_0xfa12('0x31')](handleError(_0x370980,null));};exports['create']=function(_0xa74d62,_0x41fc36){return db[_0xfa12('0x34')][_0xfa12('0xb3')](_0xa74d62['body'],{})['then'](respondWithResult(_0x41fc36,0xc9))[_0xfa12('0x31')](handleError(_0x41fc36,null));};exports['update']=function(_0x12c709,_0xe6869a){if(_0x12c709[_0xfa12('0x71')]['id']){delete _0x12c709[_0xfa12('0x71')]['id'];}return db['OpenchannelInteraction'][_0xfa12('0x5d')]({'where':{'id':_0x12c709[_0xfa12('0xaf')]['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0xe6869a,null))[_0xfa12('0x26')](saveUpdates(_0x12c709[_0xfa12('0x71')],null))['then'](respondWithResult(_0xe6869a,null))[_0xfa12('0x31')](handleError(_0xe6869a,null));};exports[_0xfa12('0x27')]=function(_0x4c1fb3,_0x1b1540){return db[_0xfa12('0x34')]['find']({'where':{'id':_0x4c1fb3[_0xfa12('0xaf')]['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0x1b1540,null))[_0xfa12('0x26')](removeEntity(_0x1b1540,null))[_0xfa12('0x31')](handleError(_0x1b1540,null));};exports[_0xfa12('0xb4')]=function(_0x3e4df7,_0x419684){return db[_0xfa12('0x34')]['describe']()[_0xfa12('0x26')](respondWithResult(_0x419684,null))['catch'](handleError(_0x419684,null));};exports[_0xfa12('0xb5')]=function(_0x1ad2fd,_0x5d2342,_0x1c93bb){return db[_0xfa12('0xb6')][_0xfa12('0x5d')]({'where':{'id':_0x1ad2fd[_0xfa12('0xaf')]['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0x5d2342,null))[_0xfa12('0x26')](function(_0x124c9f){if(_0x124c9f){return _0x124c9f[_0xfa12('0xb5')](_0x1ad2fd['body']['ids'],_[_0xfa12('0xb7')](_0x1ad2fd[_0xfa12('0x71')],[_0xfa12('0xb8'),'id'])||{});}})[_0xfa12('0x26')](respondWithResult(_0x5d2342,null))[_0xfa12('0x31')](handleError(_0x5d2342,null));};exports[_0xfa12('0xb9')]=function(_0x3fb571,_0x533a65,_0x8b218b){var _0x473778={'raw':![],'where':{}};var _0x5600d8={};var _0xbef57a={'count':0x0,'rows':[]};return db[_0xfa12('0x34')][_0xfa12('0xba')]({'where':{'id':_0x3fb571[_0xfa12('0xaf')]['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0x533a65,null))[_0xfa12('0x26')](function(_0x807ea9){if(_0x807ea9){_0x5600d8[_0xfa12('0x3c')]=_[_0xfa12('0x39')](db[_0xfa12('0xb6')]['rawAttributes']);_0x5600d8[_0xfa12('0x38')]=_['keys'](_0x3fb571['query']);_0x5600d8[_0xfa12('0x3a')]=_['intersection'](_0x5600d8[_0xfa12('0x3c')],_0x5600d8[_0xfa12('0x38')]);_0x473778[_0xfa12('0x3e')]=_[_0xfa12('0x3b')](_0x5600d8[_0xfa12('0x3c')],qs[_0xfa12('0x3d')](_0x3fb571[_0xfa12('0x38')][_0xfa12('0x3d')]));_0x473778[_0xfa12('0x3e')]=_0x473778['attributes'][_0xfa12('0x3f')]?_0x473778[_0xfa12('0x3e')]:_0x5600d8[_0xfa12('0x3c')];if(!_0x3fb571['query'][_0xfa12('0x40')](_0xfa12('0x41'))){_0x473778[_0xfa12('0x20')]=qs[_0xfa12('0x20')](_0x3fb571['query'][_0xfa12('0x20')]);_0x473778[_0xfa12('0x1e')]=qs['offset'](_0x3fb571[_0xfa12('0x38')][_0xfa12('0x1e')]);}_0x473778[_0xfa12('0x42')]=qs['sort'](_0x3fb571[_0xfa12('0x38')]['sort']);_0x473778[_0xfa12('0x44')]=qs[_0xfa12('0x3a')](_[_0xfa12('0x45')](_0x3fb571[_0xfa12('0x38')],_0x5600d8[_0xfa12('0x3a')]));_0x473778[_0xfa12('0x44')][_0xfa12('0xad')]=_0x807ea9['id'];if(_0x3fb571[_0xfa12('0x38')][_0xfa12('0x81')]){_0x473778[_0xfa12('0x44')]=_[_0xfa12('0x97')](_0x473778['where'],{'$or':_[_0xfa12('0x33')](_0x473778[_0xfa12('0x3e')],function(_0x596e99){var _0x1dc1be={};_0x1dc1be[_0x596e99]={'$like':'%'+_0x3fb571[_0xfa12('0x38')][_0xfa12('0x81')]+'%'};return _0x1dc1be;})});}if(_0x3fb571[_0xfa12('0x38')]['$gte']){var _0x37d89e=_0x3fb571[_0xfa12('0x38')][_0xfa12('0x77')][_0xfa12('0x2f')](',');var _0x4bba22={};_0x4bba22[_0x37d89e[0x0]]={'$gte':moment(_0x37d89e[0x1])[_0xfa12('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x473778[_0xfa12('0x44')]=_['merge'](_0x473778[_0xfa12('0x44')],_0x4bba22);}_0x473778=_['merge']({},_0x473778,_0x3fb571[_0xfa12('0xb2')]);return db[_0xfa12('0xb6')][_0xfa12('0x21')]({'where':_0x473778[_0xfa12('0x44')]})[_0xfa12('0x26')](function(_0x4bf08b){_0xbef57a[_0xfa12('0x21')]=_0x4bf08b;if(_0x3fb571['query'][_0xfa12('0xb0')]){_0x473778[_0xfa12('0xb1')]=[{'all':!![]}];}return db[_0xfa12('0xb6')][_0xfa12('0xbc')](_0x473778);})[_0xfa12('0x26')](function(_0x20105c){_0xbef57a[_0xfa12('0xbd')]=_0x20105c;return _0xbef57a;});}})[_0xfa12('0x26')](respondWithFilteredResult(_0x533a65,_0x473778))[_0xfa12('0x31')](handleError(_0x533a65,null));};exports[_0xfa12('0xbe')]=function(_0xdc3eee,_0xe264f6,_0x5836ed){return db[_0xfa12('0x34')]['find']({'where':{'id':_0xdc3eee[_0xfa12('0xaf')]['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0xe264f6,null))[_0xfa12('0x26')](function(_0x2e1086){if(_0x2e1086){return _0x2e1086['setTags'](_0xdc3eee['body']['ids'],_[_0xfa12('0xb7')](_0xdc3eee['body'],[_0xfa12('0xb8'),'id'])||{})[_0xfa12('0xbf')](function(){return db[_0xfa12('0x6a')]['findAll']({'attributes':['id',_0xfa12('0x29'),_0xfa12('0x48')],'where':{'id':_0xdc3eee['body']['ids']}});})[_0xfa12('0x26')](function(_0x474be6){socket[_0xfa12('0xc0')]('openchannelInteractionTags:save',{'id':Number(_0xdc3eee[_0xfa12('0xaf')]['id']),'tags':_0x474be6||[]});return{'id':Number(_0xdc3eee[_0xfa12('0xaf')]['id']),'tags':_0x474be6||[]};});}})[_0xfa12('0x26')](respondWithResult(_0xe264f6,null))['catch'](handleError(_0xe264f6,null));};exports['removeTags']=function(_0x42888e,_0x7edd7e,_0x5cc109){return db[_0xfa12('0x34')][_0xfa12('0x5d')]({'where':{'id':_0x42888e['params']['id']}})[_0xfa12('0x26')](handleEntityNotFound(_0x7edd7e,null))[_0xfa12('0x26')](function(_0x490cd3){if(_0x490cd3){return _0x490cd3['removeTags'](_0x42888e['query'][_0xfa12('0xb8')]);}})['then'](respondWithStatusCode(_0x7edd7e,null))[_0xfa12('0x31')](handleError(_0x7edd7e,null));};exports['download']=function(_0x3dd944,_0x37eaa4){var _0xb8850e=moment()[_0xfa12('0xc1')]()[_0xfa12('0x95')]();var _0x27979f=path[_0xfa12('0xc2')](config[_0xfa12('0xc3')],'server',_0xfa12('0xc4'),_0xfa12('0xc5'));var _0x389859=path[_0xfa12('0xc2')](config[_0xfa12('0xc3')],'server',_0xfa12('0xc4'),_0xfa12('0xc6'));var _0x420804=path[_0xfa12('0xc2')](_0x27979f,_0xb8850e);var _0x45b4c9=util[_0xfa12('0xbb')](_0xfa12('0xc7'),_0x3dd944['params']['id'],_0xb8850e);var _0x507f3e=path['join'](_0x27979f,_0x45b4c9);var _0x2d581e=[];_0x2d581e[_0xfa12('0x30')]({'model':db[_0xfa12('0x6d')],'as':_0xfa12('0x6d'),'attributes':['id',_0xfa12('0x2c')],'raw':!![]});_0x2d581e[_0xfa12('0x30')]({'model':db[_0xfa12('0xc8')],'as':_0xfa12('0xc9'),'attributes':['id',_0xfa12('0xca'),_0xfa12('0xcb')],'raw':!![]});if(_0x3dd944['query'][_0xfa12('0xc6')]){_0x2d581e[_0xfa12('0x30')]({'model':db[_0xfa12('0xcc')],'as':_0xfa12('0xcc'),'raw':!![]});}var _0x30ffc7=[{'model':db['OpenchannelMessage'],'as':_0xfa12('0xcd'),'attributes':['id',_0xfa12('0x71'),'createdAt',_0xfa12('0xce'),'secret',_0xfa12('0x7d')],'include':_0x2d581e}];_0x30ffc7[_0xfa12('0x30')]({'model':db['OpenchannelAccount'],'as':_0xfa12('0xcf'),'attributes':['id',_0xfa12('0x29')]});_0x30ffc7[_0xfa12('0x30')]({'model':db[_0xfa12('0x6d')],'as':_0xfa12('0xd0'),'attributes':['id',_0xfa12('0x2c')]});return db[_0xfa12('0x34')][_0xfa12('0x5d')]({'where':{'id':_0x3dd944[_0xfa12('0xaf')]['id']},'include':_0x30ffc7})['then'](handleEntityNotFound(_0x37eaa4,null))['then'](function(_0x54943f){if(_0x54943f){var _0x20b308=_0x54943f[_0xfa12('0xd1')]({'plain':!![]});fs[_0xfa12('0xd2')](_0x420804);var _0x4c7602={'channel':_0xfa12('0xd3'),'account':_0x20b308[_0xfa12('0xcf')]['name'],'agent':_0x20b308[_0xfa12('0xd0')]?_0x20b308['Owner'][_0xfa12('0x2c')]:'N.A.','createdAt':moment(_0x20b308[_0xfa12('0xd4')])[_0xfa12('0xbb')](_0xfa12('0xd5'))[_0xfa12('0x95')](),'closedAt':_0x20b308[_0xfa12('0xd6')]?moment(_0x20b308[_0xfa12('0xd7')])[_0xfa12('0xbb')](_0xfa12('0xd5'))[_0xfa12('0x95')]():'','disposition':_0x20b308[_0xfa12('0xd8')],'visibility':_0x20b308['threadId']?'Public':_0xfa12('0xd9'),'messages':_(_0x20b308[_0xfa12('0xcd')])[_0xfa12('0x81')]({'secret':![]})[_0xfa12('0x33')](function(_0x37dd32){if(_0x37dd32['Attachment']){var _0x52becf=path[_0xfa12('0xc2')](_0x389859,_0x37dd32[_0xfa12('0xcc')]['basename']);if(fs[_0xfa12('0xda')](_0x52becf)){fs['createReadStream'](_0x52becf)['pipe'](fs[_0xfa12('0xdb')](path[_0xfa12('0xc2')](_0x420804,_0x37dd32[_0xfa12('0xcc')][_0xfa12('0xdc')])));}}return{'date':moment(_0x37dd32[_0xfa12('0xd4')])[_0xfa12('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x37dd32[_0xfa12('0xce')]===_0xfa12('0xdd')?_0x37dd32[_0xfa12('0x6d')]?_0x37dd32[_0xfa12('0x6d')][_0xfa12('0x2c')]:_0xfa12('0xde'):_0x37dd32['Contact']['firstName']+(_0x37dd32[_0xfa12('0xc9')][_0xfa12('0xcb')]?'\x20'+_0x37dd32[_0xfa12('0xc9')][_0xfa12('0xcb')]:''),'body':_0x37dd32[_0xfa12('0xcc')]?_0x37dd32[_0xfa12('0xcc')][_0xfa12('0xdc')]:_0x37dd32['body'],'direction':_0x37dd32[_0xfa12('0xce')]===_0xfa12('0xdd')?'A':'C','secret':_0x37dd32[_0xfa12('0xdf')],'read':_0x37dd32[_0xfa12('0x7d')],'attachment':_0x37dd32[_0xfa12('0xcc')]};})[_0xfa12('0x5f')]()};return ejs['renderFile'](path[_0xfa12('0xc2')](config[_0xfa12('0xc3')],_0xfa12('0xe0'),_0xfa12('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x4c7602})[_0xfa12('0x26')](function(_0x34a645){var _0x2f9f0a=path[_0xfa12('0xc2')](_0x420804,_0xfa12('0xe2')+_0x20b308['id']+'-'+_0xb8850e+'.pdf');var _0x578447={'path':_0x2f9f0a,'channel':_0xfa12('0xd3'),'interactionId':_0x20b308['id']};return pdf[_0xfa12('0xe3')](_0x34a645,_0x578447);})[_0xfa12('0x26')](function(){return new BPromise(function(_0x363a40,_0x23dfaf){zipdir(_0x420804,{'saveTo':_0x507f3e},function(_0xcddb88,_0x33b9d9){if(_0xcddb88)return _0x23dfaf(_0xcddb88);return _0x363a40(_0x33b9d9);});})[_0xfa12('0x26')](function(){return new BPromise(function(_0x156829,_0x1af8bf){rimraf(_0x420804,function(_0x25b160){if(_0x25b160)_0x1af8bf(_0x25b160);return _0x156829();});});})[_0xfa12('0x26')](function(){return _0x37eaa4['download'](_0x507f3e,_0x45b4c9,function(_0x24b9f0){if(_0x24b9f0){console[_0xfa12('0xe4')](_0xfa12('0xe5'),_0x24b9f0);}else{fs[_0xfa12('0xe6')](_0x507f3e);}});});});}else{return _0x37eaa4['sendStatus'](0xc8);}})[_0xfa12('0x31')](handleError(_0x37eaa4,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5686e0f..f32f639 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 _0xda63=['events','../../mysqldb','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x2006e5,_0x476dcf){var _0x2c6b98=function(_0x4578a9){while(--_0x4578a9){_0x2006e5['push'](_0x2006e5['shift']());}};_0x2c6b98(++_0x476dcf);}(_0xda63,0xd0));var _0x3da6=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xda63[_0x4f0c2b];return _0x526436;};'use strict';var EventEmitter=require(_0x3da6('0x0'));var OpenchannelInteraction=require(_0x3da6('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x3da6('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3da6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2d49d7){return function(_0x3702ed,_0x58ed69,_0x21b31a){_0x3702ed[_0x3da6('0x3')]({'attributes':['id'],'raw':!![]})[_0x3da6('0x4')](function(_0x41311e){_0x3702ed[_0x3da6('0x5')](_0x3da6('0x6'),_0x41311e['map'](function(_0x150b9c){return{'id':_0x150b9c['id']};}));return OpenchannelMessage[_0x3da6('0x7')]({'where':{'OpenchannelInteractionId':_0x3702ed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3da6('0x4')](function(_0x27e19c){_0x3702ed[_0x3da6('0x5')](_0x3da6('0x8'),_0x27e19c[_0x3da6('0x9')]);OpenchannelInteractionEvents['emit'](_0x2d49d7+':'+_0x3702ed['id'],_0x3702ed);OpenchannelInteractionEvents[_0x3da6('0xa')](_0x2d49d7,_0x3702ed);_0x21b31a(null);})['catch'](_0x21b31a(null));};}for(var e in events){if(events[_0x3da6('0xb')](e)){var event=events[e];OpenchannelInteraction[_0x3da6('0xc')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1380=['hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','setDataValue','length','emit','hasOwnProperty'];(function(_0x56d6cc,_0x4c33e6){var _0x22bc95=function(_0x38430b){while(--_0x38430b){_0x56d6cc['push'](_0x56d6cc['shift']());}};_0x22bc95(++_0x4c33e6);}(_0x1380,0x1b1));var _0x0138=function(_0xb22469,_0x527395){_0xb22469=_0xb22469-0x0;var _0x2f18f2=_0x1380[_0xb22469];return _0x2f18f2;};'use strict';var EventEmitter=require(_0x0138('0x0'));var OpenchannelInteraction=require(_0x0138('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x0138('0x1'))['db'][_0x0138('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0138('0x3')](0x0);var events={'afterCreate':_0x0138('0x4'),'afterUpdate':_0x0138('0x5'),'afterDestroy':_0x0138('0x6')};function emitEvent(_0x3b05c4){return function(_0xc5d885,_0x53ca6f,_0x41ce70){_0xc5d885[_0x0138('0x7')]({'attributes':['id'],'raw':!![]})[_0x0138('0x8')](function(_0x464171){_0xc5d885['setDataValue'](_0x0138('0x9'),_0x464171['map'](function(_0x439345){return{'id':_0x439345['id']};}));return OpenchannelMessage[_0x0138('0xa')]({'where':{'OpenchannelInteractionId':_0xc5d885['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x153601){_0xc5d885[_0x0138('0xb')]('unreadMessages',_0x153601[_0x0138('0xc')]);OpenchannelInteractionEvents[_0x0138('0xd')](_0x3b05c4+':'+_0xc5d885['id'],_0xc5d885);OpenchannelInteractionEvents[_0x0138('0xd')](_0x3b05c4,_0xc5d885);_0x41ce70(null);})['catch'](_0x41ce70(null));};}for(var e in events){if(events[_0x0138('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x0138('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index d7533c2..84b4c21 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 _0xf53e=['utf8mb4','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','openchannel_interactions'];(function(_0x2f304e,_0xccd9b4){var _0x2a8bda=function(_0x4e2d43){while(--_0x4e2d43){_0x2f304e['push'](_0x2f304e['shift']());}};_0x2a8bda(++_0xccd9b4);}(_0xf53e,0x146));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var logger=require(_0xef53('0x2'))(_0xef53('0x3'));var moment=require(_0xef53('0x4'));var BPromise=require('bluebird');var rp=require(_0xef53('0x5'));var fs=require('fs');var path=require(_0xef53('0x6'));var rimraf=require('rimraf');var config=require(_0xef53('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x108849,_0x1811d1){return _0x108849[_0xef53('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0xef53('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef53('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4a71db,_0x39a410,_0x184719){if(_0x4a71db[_0xef53('0xb')]('closed')){_0x4a71db[_0xef53('0xc')]=moment()['format'](_0xef53('0xd'));}_0x184719(null,_0x4a71db);}}});}; \ No newline at end of file +var _0xefce=['./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefce,0x1e8));var _0xeefc=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xefce[_0x35181c];return _0xe14bf9;};'use strict';var _=require('lodash');var util=require(_0xeefc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xeefc('0x1'));var BPromise=require(_0xeefc('0x2'));var rp=require(_0xeefc('0x3'));var fs=require('fs');var path=require(_0xeefc('0x4'));var rimraf=require(_0xeefc('0x5'));var config=require(_0xeefc('0x6'));var attributes=require(_0xeefc('0x7'));module[_0xeefc('0x8')]=function(_0x41ba7c,_0x181dd7){return _0x41ba7c['define']('OpenchannelInteraction',attributes,{'tableName':_0xeefc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeefc('0xa'),'collate':_0xeefc('0xb'),'hooks':{'beforeUpdate':function(_0x2f19ee,_0x4aad6c,_0x560d33){if(_0x2f19ee[_0xeefc('0xc')](_0xeefc('0xd'))){_0x2f19ee['closedAt']=moment()[_0xeefc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x560d33(null,_0x2f19ee);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 1d64a53..6d55646 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 _0xd901=['options','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','request\x20sent','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x5e76e6,_0x54cb76){var _0x3bae49=function(_0x2ad5b9){while(--_0x2ad5b9){_0x5e76e6['push'](_0x5e76e6['shift']());}};_0x3bae49(++_0x54cb76);}(_0xd901,0xaf));var _0x1d90=function(_0x4fbd3b,_0x3d5679){_0x4fbd3b=_0x4fbd3b-0x0;var _0x343438=_0xd901[_0x4fbd3b];return _0x343438;};'use strict';var _=require('lodash');var util=require(_0x1d90('0x0'));var moment=require(_0x1d90('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d90('0x2'));var fs=require('fs');var Redis=require(_0x1d90('0x3'));var db=require(_0x1d90('0x4'))['db'];var utils=require(_0x1d90('0x5'));var logger=require('../../config/logger')(_0x1d90('0x6'));var config=require(_0x1d90('0x7'));var jayson=require(_0x1d90('0x8'));var client=jayson[_0x1d90('0x9')][_0x1d90('0xa')]({'port':0x232a});config[_0x1d90('0xb')]=_[_0x1d90('0xc')](config[_0x1d90('0xb')],{'host':_0x1d90('0xd'),'port':0x18eb});var socket=require(_0x1d90('0xe'))(new Redis(config['redis']));require(_0x1d90('0xf'))[_0x1d90('0x10')](socket);function respondWithRpcPromise(_0x242d18,_0x1485b8,_0x3d70a0){return new BPromise(function(_0x42682a,_0x27c1bc){return client['request'](_0x242d18,_0x3d70a0)[_0x1d90('0x11')](function(_0x4458f2){logger[_0x1d90('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1485b8,_0x1d90('0x13'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1485b8,_0x1d90('0x13'),JSON[_0x1d90('0x14')](_0x4458f2));if(_0x4458f2[_0x1d90('0x15')]){if(_0x4458f2[_0x1d90('0x15')]['code']===0x1f4){logger[_0x1d90('0x15')](_0x1d90('0x16'),_0x1485b8,_0x4458f2['error'][_0x1d90('0x17')]);return _0x27c1bc(_0x4458f2['error'][_0x1d90('0x17')]);}logger[_0x1d90('0x15')](_0x1d90('0x16'),_0x1485b8,_0x4458f2[_0x1d90('0x15')]['message']);return _0x42682a(_0x4458f2[_0x1d90('0x15')][_0x1d90('0x17')]);}else{logger[_0x1d90('0x12')](_0x1d90('0x16'),_0x1485b8,'request\x20sent');_0x42682a(_0x4458f2[_0x1d90('0x18')][_0x1d90('0x17')]);}})[_0x1d90('0x19')](function(_0x57a227){logger[_0x1d90('0x15')](_0x1d90('0x16'),_0x1485b8,_0x57a227);_0x27c1bc(_0x57a227);});});}exports[_0x1d90('0x1a')]=function(_0x584a69){var _0x1bbc1d=this;return new Promise(function(_0x28f97e,_0x4eab97){return db[_0x1d90('0x1b')][_0x1d90('0x1c')](_0x584a69[_0x1d90('0x1d')],{'raw':_0x584a69[_0x1d90('0x1e')]?_0x584a69[_0x1d90('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x584a69[_0x1d90('0x1e')]?_0x584a69[_0x1d90('0x1e')][_0x1d90('0x1f')]||null:null,'attributes':_0x584a69[_0x1d90('0x1e')]?_0x584a69[_0x1d90('0x1e')][_0x1d90('0x20')]||null:null,'limit':_0x584a69[_0x1d90('0x1e')]?_0x584a69[_0x1d90('0x1e')][_0x1d90('0x21')]||null:null})[_0x1d90('0x11')](function(_0x3bac27){logger['info'](_0x1d90('0x1a'),_0x584a69);logger[_0x1d90('0x22')](_0x1d90('0x1a'),_0x584a69,JSON['stringify'](_0x3bac27));_0x28f97e(_0x3bac27);})[_0x1d90('0x19')](function(_0x506e05){logger[_0x1d90('0x15')](_0x1d90('0x1a'),_0x506e05[_0x1d90('0x17')],_0x584a69);_0x4eab97(_0x1bbc1d['error'](0x1f4,_0x506e05[_0x1d90('0x17')]));});});};exports[_0x1d90('0x23')]=function(_0x19edd3){return new Promise(function(_0x201cb5,_0x59cde3){return db[_0x1d90('0x1b')][_0x1d90('0x24')]({'where':_0x19edd3[_0x1d90('0x1e')]?_0x19edd3[_0x1d90('0x1e')][_0x1d90('0x1f')]||null:null})[_0x1d90('0x11')](function(_0x37e2ea){if(_0x37e2ea){return _0x37e2ea[_0x1d90('0x25')](_0x19edd3[_0x1d90('0x1d')]['ids'],_['omit'](_0x19edd3[_0x1d90('0x1d')],[_0x1d90('0x26'),'id'])||{});}})[_0x1d90('0x27')](function(_0x44a88d){logger[_0x1d90('0x12')](_0x1d90('0x28'),_0x19edd3);logger['debug'](_0x1d90('0x28'),_0x19edd3,JSON[_0x1d90('0x14')](_0x44a88d));_0x201cb5(_0x44a88d);})['catch'](function(_0x5a09ae){logger[_0x1d90('0x15')](_0x1d90('0x28'),_0x5a09ae[_0x1d90('0x17')],_0x19edd3);_0x59cde3(_this[_0x1d90('0x15')](0x1f4,_0x5a09ae['message']));});});}; \ No newline at end of file +var _0x44f7=['AddTags','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','attributes','AddTagsToOpenchannelInteraction','where','body','ids','spread'];(function(_0x73c5c2,_0x58d172){var _0x24fee2=function(_0x1b7fc7){while(--_0x1b7fc7){_0x73c5c2['push'](_0x73c5c2['shift']());}};_0x24fee2(++_0x58d172);}(_0x44f7,0xbf));var _0x744f=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x44f7[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x744f('0x0'));var util=require('util');var moment=require(_0x744f('0x1'));var BPromise=require('bluebird');var rs=require(_0x744f('0x2'));var fs=require('fs');var Redis=require(_0x744f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x744f('0x4'));var logger=require('../../config/logger')(_0x744f('0x5'));var config=require(_0x744f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x744f('0x7')]({'port':0x232a});config['redis']=_[_0x744f('0x8')](config[_0x744f('0x9')],{'host':_0x744f('0xa'),'port':0x18eb});var socket=require(_0x744f('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x744f('0xc')](socket);function respondWithRpcPromise(_0x51e4f1,_0x4a8711,_0x5f28fd){return new BPromise(function(_0x589bcd,_0x3dd41f){return client[_0x744f('0xd')](_0x51e4f1,_0x5f28fd)[_0x744f('0xe')](function(_0x8c61b){logger[_0x744f('0xf')](_0x744f('0x10'),_0x4a8711,'request\x20sent');logger[_0x744f('0x11')](_0x744f('0x12'),_0x4a8711,_0x744f('0x13'),JSON[_0x744f('0x14')](_0x8c61b));if(_0x8c61b[_0x744f('0x15')]){if(_0x8c61b[_0x744f('0x15')][_0x744f('0x16')]===0x1f4){logger[_0x744f('0x15')](_0x744f('0x10'),_0x4a8711,_0x8c61b[_0x744f('0x15')][_0x744f('0x17')]);return _0x3dd41f(_0x8c61b[_0x744f('0x15')]['message']);}logger[_0x744f('0x15')](_0x744f('0x10'),_0x4a8711,_0x8c61b[_0x744f('0x15')]['message']);return _0x589bcd(_0x8c61b['error'][_0x744f('0x17')]);}else{logger[_0x744f('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4a8711,_0x744f('0x13'));_0x589bcd(_0x8c61b[_0x744f('0x18')][_0x744f('0x17')]);}})[_0x744f('0x19')](function(_0x59be05){logger[_0x744f('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4a8711,_0x59be05);_0x3dd41f(_0x59be05);});});}exports[_0x744f('0x1a')]=function(_0x33db14){var _0x201064=this;return new Promise(function(_0x1d7ed5,_0x43454a){return db[_0x744f('0x1b')][_0x744f('0x1c')](_0x33db14['body'],{'raw':_0x33db14[_0x744f('0x1d')]?_0x33db14[_0x744f('0x1d')][_0x744f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33db14[_0x744f('0x1d')]?_0x33db14[_0x744f('0x1d')]['where']||null:null,'attributes':_0x33db14[_0x744f('0x1d')]?_0x33db14[_0x744f('0x1d')][_0x744f('0x1f')]||null:null,'limit':_0x33db14[_0x744f('0x1d')]?_0x33db14[_0x744f('0x1d')]['limit']||null:null})[_0x744f('0xe')](function(_0x47b959){logger[_0x744f('0xf')](_0x744f('0x1a'),_0x33db14);logger[_0x744f('0x11')](_0x744f('0x1a'),_0x33db14,JSON[_0x744f('0x14')](_0x47b959));_0x1d7ed5(_0x47b959);})['catch'](function(_0x28900e){logger[_0x744f('0x15')](_0x744f('0x1a'),_0x28900e[_0x744f('0x17')],_0x33db14);_0x43454a(_0x201064[_0x744f('0x15')](0x1f4,_0x28900e['message']));});});};exports[_0x744f('0x20')]=function(_0x35210e){return new Promise(function(_0x471f85,_0x4de55e){return db[_0x744f('0x1b')]['find']({'where':_0x35210e[_0x744f('0x1d')]?_0x35210e[_0x744f('0x1d')][_0x744f('0x21')]||null:null})['then'](function(_0x3a8194){if(_0x3a8194){return _0x3a8194['addTags'](_0x35210e[_0x744f('0x22')]['ids'],_['omit'](_0x35210e['body'],[_0x744f('0x23'),'id'])||{});}})[_0x744f('0x24')](function(_0x1f80b0){logger['info'](_0x744f('0x25'),_0x35210e);logger[_0x744f('0x11')](_0x744f('0x25'),_0x35210e,JSON[_0x744f('0x14')](_0x1f80b0));_0x471f85(_0x1f80b0);})[_0x744f('0x19')](function(_0x1fc8f1){logger['error'](_0x744f('0x25'),_0x1fc8f1[_0x744f('0x17')],_0x35210e);_0x4de55e(_this['error'](0x1f4,_0x1fc8f1[_0x744f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 446f64a..6578b4a 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 _0xd108=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x5863af,_0x1a003b){var _0x20c666=function(_0x30b0c6){while(--_0x30b0c6){_0x5863af['push'](_0x5863af['shift']());}};_0x20c666(++_0x1a003b);}(_0xd108,0x1aa));var _0x8d10=function(_0x4256c5,_0x288cee){_0x4256c5=_0x4256c5-0x0;var _0x3c8bfd=_0xd108[_0x4256c5];return _0x3c8bfd;};'use strict';var OpenchannelInteractionEvents=require(_0x8d10('0x0'));var events=['save',_0x8d10('0x1'),_0x8d10('0x2')];function createListener(_0x49268b,_0x1197eb){return function(_0x548a68){_0x1197eb[_0x8d10('0x3')](_0x49268b,_0x548a68);};}function removeListener(_0x224cc6,_0x2eb66c){return function(){OpenchannelInteractionEvents[_0x8d10('0x4')](_0x224cc6,_0x2eb66c);};}exports[_0x8d10('0x5')]=function(_0x35e49f){for(var _0x4b4493=0x0,_0x1dc13b=events[_0x8d10('0x6')];_0x4b4493<_0x1dc13b;_0x4b4493++){var _0x7457fe=events[_0x4b4493];var _0x3bce05=createListener(_0x8d10('0x7')+_0x7457fe,_0x35e49f);OpenchannelInteractionEvents['on'](_0x7457fe,_0x3bce05);}}; \ No newline at end of file +var _0xaf2a=['emit','removeListener','register','length','./openchannelInteraction.events','save','remove','update'];(function(_0xd8e885,_0x10481b){var _0x5e2873=function(_0x116022){while(--_0x116022){_0xd8e885['push'](_0xd8e885['shift']());}};_0x5e2873(++_0x10481b);}(_0xaf2a,0xf4));var _0xaaf2=function(_0x2be41f,_0x1cd89c){_0x2be41f=_0x2be41f-0x0;var _0x449e93=_0xaf2a[_0x2be41f];return _0x449e93;};'use strict';var OpenchannelInteractionEvents=require(_0xaaf2('0x0'));var events=[_0xaaf2('0x1'),_0xaaf2('0x2'),_0xaaf2('0x3')];function createListener(_0x39d39e,_0x35d3e0){return function(_0x5d28dd){_0x35d3e0[_0xaaf2('0x4')](_0x39d39e,_0x5d28dd);};}function removeListener(_0x126b25,_0x3bad36){return function(){OpenchannelInteractionEvents[_0xaaf2('0x5')](_0x126b25,_0x3bad36);};}exports[_0xaaf2('0x6')]=function(_0x104b9b){for(var _0x229ee9=0x0,_0x5eeddc=events[_0xaaf2('0x7')];_0x229ee9<_0x5eeddc;_0x229ee9++){var _0x1d6df7=events[_0x229ee9];var _0x2cc50b=createListener('openchannelInteraction:'+_0x1d6df7,_0x104b9b);OpenchannelInteractionEvents['on'](_0x1d6df7,_0x2cc50b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 71e5e78..d32cc60 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x536de1,_0x5197b4){_0x536de1=_0x536de1-0x0;var _0x524d58=_0x70e0[_0x536de1];return _0x524d58;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x2825e8,_0x4b49ba){var _0x2ce74c=function(_0x4cb19c){while(--_0x4cb19c){_0x2825e8['push'](_0x2825e8['shift']());}};_0x2ce74c(++_0x4b49ba);}(_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('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 290466b..5b2b456 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 _0x6f2f=['BOOLEAN','out','DATE','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x6f2f[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0xf6f2('0x0'));module[_0xf6f2('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf6f2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf6f2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf6f2('0x4')]},'providerName':{'type':Sequelize[_0xf6f2('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x13f6=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x53fe17,_0x5cc12d){var _0xcf5dc=function(_0x30f224){while(--_0x30f224){_0x53fe17['push'](_0x53fe17['shift']());}};_0xcf5dc(++_0x5cc12d);}(_0x13f6,0x124));var _0x613f=function(_0x3b3846,_0x20c812){_0x3b3846=_0x3b3846-0x0;var _0x2a1bd8=_0x13f6[_0x3b3846];return _0x2a1bd8;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x613f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x613f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x613f('0x3')]('in','out'),'defaultValue':_0x613f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x613f('0x5')]},'providerName':{'type':Sequelize[_0x613f('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3762f7e..84f893e 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 _0x5c46=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','jayson/promise','client','http','request','then','request\x20sent','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','catch','rawAttributes','find','create','body','params','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','reject','openchannel','rejectMessage','SELECT','contact','interface','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis'];(function(_0x2ff8ae,_0x459670){var _0x52d112=function(_0x1388eb){while(--_0x1388eb){_0x2ff8ae['push'](_0x2ff8ae['shift']());}};_0x52d112(++_0x459670);}(_0x5c46,0x1ef));var _0x65c4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c46[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x65c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65c4('0x2'));var moment=require(_0x65c4('0x3'));var BPromise=require(_0x65c4('0x4'));var Mustache=require(_0x65c4('0x5'));var util=require(_0x65c4('0x6'));var path=require(_0x65c4('0x7'));var sox=require(_0x65c4('0x8'));var csv=require(_0x65c4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65c4('0xa'));var _=require(_0x65c4('0xb'));var squel=require(_0x65c4('0xc'));var crypto=require(_0x65c4('0xd'));var jsforce=require(_0x65c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x65c4('0x9'));var querystring=require('querystring');var Papa=require(_0x65c4('0xf'));var Redis=require(_0x65c4('0x10'));var authService=require(_0x65c4('0x11'));var qs=require(_0x65c4('0x12'));var as=require(_0x65c4('0x13'));var hardwareService=require(_0x65c4('0x14'));var logger=require(_0x65c4('0x15'))(_0x65c4('0x16'));var utils=require(_0x65c4('0x17'));var config=require(_0x65c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x65c4('0x19'))['db'];config[_0x65c4('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x65c4('0x1b'))(new Redis(config[_0x65c4('0x1a')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x65c4('0x1c'));var client=jayson[_0x65c4('0x1d')][_0x65c4('0x1e')]({'port':0x232c});var client9002=jayson[_0x65c4('0x1d')][_0x65c4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4408c7,_0x2ef54f,_0x48ae3e,_0x57f72e){return new BPromise(function(_0x2e1115,_0x4270df){var _0x138e8f=_0x57f72e||client;return _0x138e8f[_0x65c4('0x1f')](_0x4408c7,_0x48ae3e)[_0x65c4('0x20')](function(_0x32cf9f){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2ef54f,_0x65c4('0x21'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2ef54f,'request\x20sent',JSON['stringify'](_0x32cf9f));if(_0x32cf9f[_0x65c4('0x22')]){if(_0x32cf9f[_0x65c4('0x22')][_0x65c4('0x23')]===0x1f4){logger[_0x65c4('0x22')](_0x65c4('0x24'),_0x2ef54f,_0x32cf9f[_0x65c4('0x22')]['message']);return _0x4270df(_0x32cf9f['error'][_0x65c4('0x25')]);}logger[_0x65c4('0x22')](_0x65c4('0x24'),_0x2ef54f,_0x32cf9f['error'][_0x65c4('0x25')]);return _0x2e1115(_0x32cf9f[_0x65c4('0x22')][_0x65c4('0x25')]);}else{logger[_0x65c4('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x2ef54f,_0x65c4('0x21'));_0x2e1115(_0x32cf9f[_0x65c4('0x27')][_0x65c4('0x25')]);}})['catch'](function(_0x1c9fdf){logger[_0x65c4('0x22')](_0x65c4('0x24'),_0x2ef54f,_0x1c9fdf);_0x4270df(_0x1c9fdf);});});}function respondWithStatusCode(_0x32b38d,_0x222de0){_0x222de0=_0x222de0||0xcc;return function(_0x42837e){if(_0x42837e){return _0x32b38d[_0x65c4('0x28')](_0x222de0);}return _0x32b38d[_0x65c4('0x29')](_0x222de0)[_0x65c4('0x2a')]();};}function respondWithResult(_0x108914,_0x5383b5){_0x5383b5=_0x5383b5||0xc8;return function(_0x101a2b){if(_0x101a2b){return _0x108914[_0x65c4('0x29')](_0x5383b5)[_0x65c4('0x2b')](_0x101a2b);}};}function respondWithFilteredResult(_0x3c0837,_0x401bd9){return function(_0x1bf633){if(_0x1bf633){var _0x281ff5=typeof _0x401bd9[_0x65c4('0x2c')]===_0x65c4('0x2d')&&typeof _0x401bd9[_0x65c4('0x2e')]===_0x65c4('0x2d');var _0x3f1108=_0x1bf633['count'];var _0x3ab403=_0x281ff5?0x0:_0x401bd9[_0x65c4('0x2c')];var _0x3c8b68=_0x281ff5?_0x1bf633[_0x65c4('0x2f')]:_0x401bd9[_0x65c4('0x2c')]+_0x401bd9[_0x65c4('0x2e')];var _0x11b928;if(_0x3c8b68>=_0x3f1108){_0x3c8b68=_0x3f1108;_0x11b928=0xc8;}else{_0x11b928=0xce;}_0x3c0837[_0x65c4('0x29')](_0x11b928);return _0x3c0837[_0x65c4('0x30')]('Content-Range',_0x3ab403+'-'+_0x3c8b68+'/'+_0x3f1108)[_0x65c4('0x2b')](_0x1bf633);}return null;};}function patchUpdates(_0x2b865b){return function(_0x62b21e){try{jsonpatch[_0x65c4('0x31')](_0x62b21e,_0x2b865b,!![]);}catch(_0x152ec6){return BPromise['reject'](_0x152ec6);}return _0x62b21e[_0x65c4('0x32')]();};}function saveUpdates(_0x248224,_0x44da39){return function(_0x5da24d){if(_0x5da24d){return _0x5da24d[_0x65c4('0x33')](_0x248224)[_0x65c4('0x20')](function(_0x45a4e3){return _0x45a4e3;});}return null;};}function removeEntity(_0x1f0e5e,_0x235ae9){return function(_0x5370b3){if(_0x5370b3){return _0x5370b3[_0x65c4('0x34')]()['then'](function(){_0x1f0e5e['status'](0xcc)[_0x65c4('0x2a')]();});}};}function handleEntityNotFound(_0xb31eac,_0x1d46a6){return function(_0x33199a){if(!_0x33199a){_0xb31eac[_0x65c4('0x28')](0x194);}return _0x33199a;};}function handleError(_0x36c57a,_0x1d9fa9){_0x1d9fa9=_0x1d9fa9||0x1f4;return function(_0x4d5ab4){logger[_0x65c4('0x22')](_0x4d5ab4['stack']);if(_0x4d5ab4[_0x65c4('0x35')]){delete _0x4d5ab4['name'];}_0x36c57a[_0x65c4('0x29')](_0x1d9fa9)[_0x65c4('0x36')](_0x4d5ab4);};}exports[_0x65c4('0x37')]=function(_0x779d2e,_0x2c2f64){var _0x246bea={},_0x3a611e={},_0x732463={'count':0x0,'rows':[]};var _0x3ab695=_[_0x65c4('0x38')](db[_0x65c4('0x39')]['rawAttributes'],function(_0x245788){return{'name':_0x245788[_0x65c4('0x3a')],'type':_0x245788[_0x65c4('0x3b')][_0x65c4('0x3c')]};});_0x3a611e[_0x65c4('0x3d')]=_[_0x65c4('0x38')](_0x3ab695,_0x65c4('0x35'));_0x3a611e['query']=_[_0x65c4('0x3e')](_0x779d2e[_0x65c4('0x3f')]);_0x3a611e[_0x65c4('0x40')]=_[_0x65c4('0x41')](_0x3a611e['model'],_0x3a611e[_0x65c4('0x3f')]);_0x246bea[_0x65c4('0x42')]=_['intersection'](_0x3a611e[_0x65c4('0x3d')],qs[_0x65c4('0x43')](_0x779d2e['query']['fields']));_0x246bea[_0x65c4('0x42')]=_0x246bea[_0x65c4('0x42')][_0x65c4('0x44')]?_0x246bea[_0x65c4('0x42')]:_0x3a611e[_0x65c4('0x3d')];if(!_0x779d2e[_0x65c4('0x3f')][_0x65c4('0x45')](_0x65c4('0x46'))){_0x246bea[_0x65c4('0x2e')]=qs[_0x65c4('0x2e')](_0x779d2e[_0x65c4('0x3f')][_0x65c4('0x2e')]);_0x246bea[_0x65c4('0x2c')]=qs[_0x65c4('0x2c')](_0x779d2e[_0x65c4('0x3f')][_0x65c4('0x2c')]);}_0x246bea[_0x65c4('0x47')]=qs[_0x65c4('0x48')](_0x779d2e[_0x65c4('0x3f')][_0x65c4('0x48')]);_0x246bea['where']=qs[_0x65c4('0x40')](_[_0x65c4('0x49')](_0x779d2e[_0x65c4('0x3f')],_0x3a611e[_0x65c4('0x40')]),_0x3ab695);if(_0x779d2e[_0x65c4('0x3f')]['filter']){_0x246bea[_0x65c4('0x4a')]=_[_0x65c4('0x4b')](_0x246bea[_0x65c4('0x4a')],{'$or':_['map'](_0x3ab695,function(_0xdb0bb3){if(_0xdb0bb3[_0x65c4('0x3b')]!==_0x65c4('0x4c')){var _0x13e4b0={};_0x13e4b0[_0xdb0bb3[_0x65c4('0x35')]]={'$like':'%'+_0x779d2e[_0x65c4('0x3f')]['filter']+'%'};return _0x13e4b0;}})});}_0x246bea=_['merge']({},_0x246bea,_0x779d2e[_0x65c4('0x4d')]);var _0x18ad28={'where':_0x246bea[_0x65c4('0x4a')]};return db[_0x65c4('0x39')]['count'](_0x18ad28)[_0x65c4('0x20')](function(_0x5ba1eb){_0x732463[_0x65c4('0x2f')]=_0x5ba1eb;if(_0x779d2e[_0x65c4('0x3f')][_0x65c4('0x4e')]){_0x246bea[_0x65c4('0x4f')]=[{'all':!![]}];}return db[_0x65c4('0x39')]['findAll'](_0x246bea);})[_0x65c4('0x20')](function(_0x49a034){_0x732463['rows']=_0x49a034;return _0x732463;})[_0x65c4('0x20')](respondWithFilteredResult(_0x2c2f64,_0x246bea))[_0x65c4('0x50')](handleError(_0x2c2f64,null));};exports['show']=function(_0x52b27f,_0x240a21){var _0x100f56={'raw':!![],'where':{'id':_0x52b27f['params']['id']}},_0x3751fd={};_0x3751fd[_0x65c4('0x3d')]=_[_0x65c4('0x3e')](db[_0x65c4('0x39')][_0x65c4('0x51')]);_0x3751fd[_0x65c4('0x3f')]=_['keys'](_0x52b27f['query']);_0x3751fd[_0x65c4('0x40')]=_[_0x65c4('0x41')](_0x3751fd['model'],_0x3751fd[_0x65c4('0x3f')]);_0x100f56[_0x65c4('0x42')]=_[_0x65c4('0x41')](_0x3751fd['model'],qs[_0x65c4('0x43')](_0x52b27f['query'][_0x65c4('0x43')]));_0x100f56[_0x65c4('0x42')]=_0x100f56[_0x65c4('0x42')]['length']?_0x100f56['attributes']:_0x3751fd[_0x65c4('0x3d')];if(_0x52b27f[_0x65c4('0x3f')][_0x65c4('0x4e')]){_0x100f56[_0x65c4('0x4f')]=[{'all':!![]}];}_0x100f56=_['merge']({},_0x100f56,_0x52b27f['options']);return db[_0x65c4('0x39')][_0x65c4('0x52')](_0x100f56)[_0x65c4('0x20')](handleEntityNotFound(_0x240a21,null))[_0x65c4('0x20')](respondWithResult(_0x240a21,null))[_0x65c4('0x50')](handleError(_0x240a21,null));};exports[_0x65c4('0x53')]=function(_0x329d89,_0x51feb2){return db[_0x65c4('0x39')][_0x65c4('0x53')](_0x329d89[_0x65c4('0x54')],{})[_0x65c4('0x20')](respondWithResult(_0x51feb2,0xc9))[_0x65c4('0x50')](handleError(_0x51feb2,null));};exports[_0x65c4('0x33')]=function(_0x3df319,_0x2716fa){if(_0x3df319[_0x65c4('0x54')]['id']){delete _0x3df319[_0x65c4('0x54')]['id'];}return db[_0x65c4('0x39')][_0x65c4('0x52')]({'where':{'id':_0x3df319[_0x65c4('0x55')]['id']}})[_0x65c4('0x20')](handleEntityNotFound(_0x2716fa,null))[_0x65c4('0x20')](saveUpdates(_0x3df319[_0x65c4('0x54')],null))[_0x65c4('0x20')](respondWithResult(_0x2716fa,null))['catch'](handleError(_0x2716fa,null));};exports[_0x65c4('0x34')]=function(_0x148d0b,_0x312457){return db['OpenchannelMessage']['find']({'where':{'id':_0x148d0b[_0x65c4('0x55')]['id']}})[_0x65c4('0x20')](handleEntityNotFound(_0x312457,null))[_0x65c4('0x20')](removeEntity(_0x312457,null))[_0x65c4('0x50')](handleError(_0x312457,null));};exports[_0x65c4('0x56')]=function(_0x2ec62a,_0x44bddb){return db['OpenchannelMessage'][_0x65c4('0x56')]()['then'](respondWithResult(_0x44bddb,null))[_0x65c4('0x50')](handleError(_0x44bddb,null));};var interaction_log=require(_0x65c4('0x15'))('openchannel-interactions');exports['accept']=function(_0xc6e8f0,_0x6df77e,_0x2bb463){var _0x31cd1b={'agent':{},'channel':'openchannel'};if(_0xc6e8f0[_0x65c4('0x54')]['id']){delete _0xc6e8f0[_0x65c4('0x54')]['id'];}_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x57')]=!![];_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x58')]=moment()[_0x65c4('0x59')](_0x65c4('0x5a'));_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x5b')]=_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x5b')]||_0xc6e8f0[_0x65c4('0x5c')]['id'];_0x31cd1b[_0x65c4('0x5d')]['id']=_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x5b')];return db[_0x65c4('0x39')][_0x65c4('0x52')]({'where':{'id':_0xc6e8f0[_0x65c4('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6df77e,null))[_0x65c4('0x20')](saveUpdates(_0xc6e8f0[_0x65c4('0x54')],null))[_0x65c4('0x20')](function(_0x4fba08){if(_0x4fba08){_0x31cd1b[_0x65c4('0x25')]=_0x4fba08[_0x65c4('0x5e')]({'plain':!![]});return db[_0x65c4('0x5f')][_0x65c4('0x52')]({'where':{'id':_0x4fba08[_0x65c4('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x6df77e,null))[_0x65c4('0x20')](function(_0x20bc7a){if(_0x20bc7a){return _0x20bc7a[_0x65c4('0x33')]({'UserId':_0xc6e8f0[_0x65c4('0x54')]['UserId'],'read1stAt':_[_0x65c4('0x61')](_0x20bc7a[_0x65c4('0x62')])?moment()['format'](_0x65c4('0x5a')):undefined});}return null;})[_0x65c4('0x20')](function(_0x225073){if(_0x225073){_0x31cd1b[_0x65c4('0x63')]=_0x225073[_0x65c4('0x5e')]({'plain':!![]});interaction_log[_0x65c4('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc6e8f0[_0x65c4('0x5c')]['id'],_0xc6e8f0[_0x65c4('0x5c')][_0x65c4('0x35')],_0xc6e8f0[_0x65c4('0x5c')][_0x65c4('0x64')],_0x31cd1b[_0x65c4('0x63')]['id'],_0xc6e8f0[_0x65c4('0x54')]?JSON[_0x65c4('0x65')](_0xc6e8f0[_0x65c4('0x54')]):_0x65c4('0x66'));return respondWithRpcPromise('AcceptMessage',_0x65c4('0x67'),_0x31cd1b);}return null;})['then'](function(_0x2b20ab){var _0x21db4d=_0x65c4('0x68')+_0x2b20ab[_0x65c4('0x25')][_0x65c4('0x69')];return db[_0x65c4('0x6a')][_0x65c4('0x3f')](_0x21db4d,{'type':db[_0x65c4('0x6b')][_0x65c4('0x6c')]['SELECT'],'raw':!![]})[_0x65c4('0x20')](function(_0x252ac2){return _0x252ac2;});})[_0x65c4('0x20')](function(_0x259a7e){if(_0x259a7e){_0x31cd1b[_0x65c4('0x25')]['contact']=_0x259a7e[0x0];if(!_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x5b')])return;return db[_0x65c4('0x6d')]['find']({'where':{'id':_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x5b')],'role':_0x65c4('0x5d')},'attributes':['id',_0x65c4('0x35'),_0x65c4('0x6e'),_0x65c4('0x6f'),_0x65c4('0x70')],'raw':!![]});}return null;})[_0x65c4('0x20')](function(_0x35c8b9){if(!_0x35c8b9)return null;_0x31cd1b[_0x65c4('0x25')]['agent']=_0x35c8b9;return _0x31cd1b;})[_0x65c4('0x20')](function(_0x46996b){if(_0x46996b){if(_0xc6e8f0[_0x65c4('0x54')][_0x65c4('0x71')]){_0x31cd1b[_0x65c4('0x25')]['interface']=util[_0x65c4('0x59')](_0x65c4('0x72'),_0xc6e8f0[_0x65c4('0x5c')]['name']);_0x31cd1b['message'][_0x65c4('0x73')]=_0x31cd1b[_0x65c4('0x73')];_0x31cd1b[_0x65c4('0x25')][_0x65c4('0x74')]=_0x31cd1b[_0x65c4('0x73')];_0x31cd1b[_0x65c4('0x25')][_0x65c4('0x75')]='accept';return respondWithRpcPromise(_0x65c4('0x76'),_0x65c4('0x76'),{'event':_0x65c4('0x77'),'message':_0x31cd1b[_0x65c4('0x25')]},client9002)[_0x65c4('0x20')](function(){return _0x31cd1b;});}return _0x31cd1b;}return null;})[_0x65c4('0x20')](respondWithResult(_0x6df77e,null))[_0x65c4('0x50')](handleError(_0x6df77e,null));};var interaction_log=require(_0x65c4('0x15'))(_0x65c4('0x78'));exports[_0x65c4('0x79')]=function(_0x2aa68f,_0x126cb5,_0x5580d2){var _0x4edab0={'agent':{},'channel':_0x65c4('0x7a')};if(_0x2aa68f[_0x65c4('0x54')]['id']){delete _0x2aa68f[_0x65c4('0x54')]['id'];}_0x2aa68f[_0x65c4('0x54')]['UserId']=_0x2aa68f[_0x65c4('0x54')][_0x65c4('0x5b')]||_0x2aa68f[_0x65c4('0x5c')]['id'];_0x4edab0[_0x65c4('0x5d')]['id']=_0x2aa68f[_0x65c4('0x54')][_0x65c4('0x5b')];return db['OpenchannelMessage'][_0x65c4('0x52')]({'where':{'id':_0x2aa68f[_0x65c4('0x55')]['id'],'UserId':null}})[_0x65c4('0x20')](handleEntityNotFound(_0x126cb5,null))[_0x65c4('0x20')](function(_0xa15830){if(_0xa15830){_0x4edab0[_0x65c4('0x25')]=_0xa15830['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x65c4('0x52')]({'where':{'id':_0xa15830[_0x65c4('0x60')]}});}return null;})[_0x65c4('0x20')](handleEntityNotFound(_0x126cb5,null))['then'](function(_0xe4e82f){if(_0xe4e82f){_0x4edab0[_0x65c4('0x63')]=_0xe4e82f[_0x65c4('0x5e')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2aa68f['user']['id'],_0x2aa68f[_0x65c4('0x5c')]['name'],_0x2aa68f[_0x65c4('0x5c')]['role'],_0x4edab0[_0x65c4('0x63')]['id'],_0x2aa68f[_0x65c4('0x54')]?JSON[_0x65c4('0x65')](_0x2aa68f[_0x65c4('0x54')]):_0x65c4('0x66'));return respondWithRpcPromise('RejectMessage',_0x65c4('0x7b'),_0x4edab0);}return null;})[_0x65c4('0x20')](function(_0x57f51f){var _0x1db2eb=_0x65c4('0x68')+_0x57f51f[_0x65c4('0x25')]['ContactId'];return db[_0x65c4('0x6a')][_0x65c4('0x3f')](_0x1db2eb,{'type':db['Sequelize'][_0x65c4('0x6c')][_0x65c4('0x7c')],'raw':!![]})['then'](function(_0x24ac4d){return _0x24ac4d;});})[_0x65c4('0x20')](function(_0x271259){if(_0x271259){_0x4edab0[_0x65c4('0x25')][_0x65c4('0x7d')]=_0x271259[0x0];if(!_0x2aa68f['body'][_0x65c4('0x5b')])return;return db[_0x65c4('0x6d')][_0x65c4('0x52')]({'where':{'id':_0x2aa68f[_0x65c4('0x54')][_0x65c4('0x5b')],'role':_0x65c4('0x5d')},'attributes':['id','name',_0x65c4('0x6e'),_0x65c4('0x6f'),_0x65c4('0x70')],'raw':!![]});}return null;})[_0x65c4('0x20')](function(_0x17207c){if(!_0x17207c)return null;_0x4edab0[_0x65c4('0x25')][_0x65c4('0x5d')]=_0x17207c;return _0x4edab0;})[_0x65c4('0x20')](function(_0x134827){if(_0x134827){_0x134827['message'][_0x65c4('0x7e')]=util[_0x65c4('0x59')](_0x65c4('0x72'),_0x2aa68f[_0x65c4('0x5c')][_0x65c4('0x35')]);_0x134827[_0x65c4('0x25')][_0x65c4('0x73')]=_0x4edab0['channel'];_0x134827[_0x65c4('0x25')][_0x65c4('0x74')]=_0x4edab0['channel'];_0x134827[_0x65c4('0x25')]['event']='reject';respondWithRpcPromise('EventManager',_0x65c4('0x76'),{'event':_0x65c4('0x7f'),'message':_0x134827[_0x65c4('0x25')]},client9002);return _0x4edab0;}return null;})[_0x65c4('0x20')](respondWithResult(_0x126cb5,null))['catch'](handleError(_0x126cb5,null));}; \ No newline at end of file +var _0x37cc=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','save','update','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','length','merge','options','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','isNil','read1stAt','interaction','get','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','User','fullname','email','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x3df10b,_0x564e39){var _0x202560=function(_0x3a8c20){while(--_0x3a8c20){_0x3df10b['push'](_0x3df10b['shift']());}};_0x202560(++_0x564e39);}(_0x37cc,0x185));var _0xc37c=function(_0x366494,_0x497c8a){_0x366494=_0x366494-0x0;var _0xf041a6=_0x37cc[_0x366494];return _0xf041a6;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require(_0xc37c('0x1'));var zipdir=require(_0xc37c('0x2'));var jsonpatch=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var moment=require(_0xc37c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc37c('0x6'));var path=require(_0xc37c('0x7'));var sox=require(_0xc37c('0x8'));var csv=require(_0xc37c('0x9'));var ejs=require(_0xc37c('0xa'));var fs=require('fs');var fs_extra=require(_0xc37c('0xb'));var _=require(_0xc37c('0xc'));var squel=require(_0xc37c('0xd'));var crypto=require(_0xc37c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc37c('0xf'));var toCsv=require(_0xc37c('0x9'));var querystring=require(_0xc37c('0x10'));var Papa=require(_0xc37c('0x11'));var Redis=require(_0xc37c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc37c('0x13'));var as=require(_0xc37c('0x14'));var hardwareService=require(_0xc37c('0x15'));var logger=require(_0xc37c('0x16'))(_0xc37c('0x17'));var utils=require(_0xc37c('0x18'));var config=require(_0xc37c('0x19'));var licenseUtil=require(_0xc37c('0x1a'));var db=require(_0xc37c('0x1b'))['db'];config[_0xc37c('0x1c')]=_[_0xc37c('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc37c('0x1e'))(new Redis(config[_0xc37c('0x1c')]));require(_0xc37c('0x1f'))[_0xc37c('0x20')](socket);var jayson=require(_0xc37c('0x21'));var client=jayson[_0xc37c('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xc37c('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b05f8,_0x128d81,_0x9c1ee7,_0xb00fb1){return new BPromise(function(_0x674ccf,_0x51a2da){var _0x577165=_0xb00fb1||client;return _0x577165['request'](_0x5b05f8,_0x9c1ee7)[_0xc37c('0x23')](function(_0x5c7bd2){logger[_0xc37c('0x24')](_0xc37c('0x25'),_0x128d81,'request\x20sent');logger[_0xc37c('0x26')](_0xc37c('0x27'),_0x128d81,_0xc37c('0x28'),JSON[_0xc37c('0x29')](_0x5c7bd2));if(_0x5c7bd2['error']){if(_0x5c7bd2[_0xc37c('0x2a')]['code']===0x1f4){logger[_0xc37c('0x2a')](_0xc37c('0x25'),_0x128d81,_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);return _0x51a2da(_0x5c7bd2[_0xc37c('0x2a')]['message']);}logger[_0xc37c('0x2a')](_0xc37c('0x25'),_0x128d81,_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);return _0x674ccf(_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);}else{logger[_0xc37c('0x24')](_0xc37c('0x25'),_0x128d81,_0xc37c('0x28'));_0x674ccf(_0x5c7bd2[_0xc37c('0x2c')][_0xc37c('0x2b')]);}})[_0xc37c('0x2d')](function(_0x3076fc){logger['error'](_0xc37c('0x25'),_0x128d81,_0x3076fc);_0x51a2da(_0x3076fc);});});}function respondWithStatusCode(_0x1ecf92,_0x1d59fa){_0x1d59fa=_0x1d59fa||0xcc;return function(_0x484c43){if(_0x484c43){return _0x1ecf92['sendStatus'](_0x1d59fa);}return _0x1ecf92[_0xc37c('0x2e')](_0x1d59fa)[_0xc37c('0x2f')]();};}function respondWithResult(_0x45cce8,_0xbd5d3a){_0xbd5d3a=_0xbd5d3a||0xc8;return function(_0x422c1a){if(_0x422c1a){return _0x45cce8[_0xc37c('0x2e')](_0xbd5d3a)[_0xc37c('0x30')](_0x422c1a);}};}function respondWithFilteredResult(_0x47266c,_0x5d13b3){return function(_0x14129d){if(_0x14129d){var _0x466094=typeof _0x5d13b3[_0xc37c('0x31')]===_0xc37c('0x32')&&typeof _0x5d13b3[_0xc37c('0x33')]===_0xc37c('0x32');var _0x2c75c=_0x14129d[_0xc37c('0x34')];var _0x2c59df=_0x466094?0x0:_0x5d13b3[_0xc37c('0x31')];var _0x224641=_0x466094?_0x14129d[_0xc37c('0x34')]:_0x5d13b3[_0xc37c('0x31')]+_0x5d13b3['limit'];var _0x1690f3;if(_0x224641>=_0x2c75c){_0x224641=_0x2c75c;_0x1690f3=0xc8;}else{_0x1690f3=0xce;}_0x47266c[_0xc37c('0x2e')](_0x1690f3);return _0x47266c['set']('Content-Range',_0x2c59df+'-'+_0x224641+'/'+_0x2c75c)[_0xc37c('0x30')](_0x14129d);}return null;};}function patchUpdates(_0x3b9ac4){return function(_0x15b7a2){try{jsonpatch['apply'](_0x15b7a2,_0x3b9ac4,!![]);}catch(_0x152921){return BPromise['reject'](_0x152921);}return _0x15b7a2[_0xc37c('0x35')]();};}function saveUpdates(_0x31df03,_0x58429b){return function(_0x409af1){if(_0x409af1){return _0x409af1[_0xc37c('0x36')](_0x31df03)[_0xc37c('0x23')](function(_0xdf3420){return _0xdf3420;});}return null;};}function removeEntity(_0x918e9d,_0x1c063c){return function(_0x445f07){if(_0x445f07){return _0x445f07['destroy']()['then'](function(){_0x918e9d[_0xc37c('0x2e')](0xcc)[_0xc37c('0x2f')]();});}};}function handleEntityNotFound(_0x29e9cf,_0x13fa10){return function(_0x5894cf){if(!_0x5894cf){_0x29e9cf[_0xc37c('0x37')](0x194);}return _0x5894cf;};}function handleError(_0x3d2ce6,_0xd30011){_0xd30011=_0xd30011||0x1f4;return function(_0x5d30b7){logger[_0xc37c('0x2a')](_0x5d30b7[_0xc37c('0x38')]);if(_0x5d30b7['name']){delete _0x5d30b7[_0xc37c('0x39')];}_0x3d2ce6[_0xc37c('0x2e')](_0xd30011)['send'](_0x5d30b7);};}exports[_0xc37c('0x3a')]=function(_0x346c5d,_0x17dd56){var _0x44b21f={},_0x13d943={},_0x1fc342={'count':0x0,'rows':[]};var _0xccc652=_[_0xc37c('0x3b')](db[_0xc37c('0x3c')][_0xc37c('0x3d')],function(_0x167b50){return{'name':_0x167b50[_0xc37c('0x3e')],'type':_0x167b50[_0xc37c('0x3f')][_0xc37c('0x40')]};});_0x13d943[_0xc37c('0x41')]=_[_0xc37c('0x3b')](_0xccc652,_0xc37c('0x39'));_0x13d943['query']=_[_0xc37c('0x42')](_0x346c5d[_0xc37c('0x43')]);_0x13d943[_0xc37c('0x44')]=_['intersection'](_0x13d943[_0xc37c('0x41')],_0x13d943['query']);_0x44b21f['attributes']=_['intersection'](_0x13d943['model'],qs['fields'](_0x346c5d[_0xc37c('0x43')][_0xc37c('0x45')]));_0x44b21f[_0xc37c('0x46')]=_0x44b21f[_0xc37c('0x46')]['length']?_0x44b21f[_0xc37c('0x46')]:_0x13d943[_0xc37c('0x41')];if(!_0x346c5d['query'][_0xc37c('0x47')](_0xc37c('0x48'))){_0x44b21f[_0xc37c('0x33')]=qs[_0xc37c('0x33')](_0x346c5d[_0xc37c('0x43')][_0xc37c('0x33')]);_0x44b21f[_0xc37c('0x31')]=qs['offset'](_0x346c5d[_0xc37c('0x43')]['offset']);}_0x44b21f['order']=qs['sort'](_0x346c5d[_0xc37c('0x43')]['sort']);_0x44b21f[_0xc37c('0x49')]=qs['filters'](_[_0xc37c('0x4a')](_0x346c5d[_0xc37c('0x43')],_0x13d943[_0xc37c('0x44')]),_0xccc652);if(_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4b')]){_0x44b21f[_0xc37c('0x49')]=_['merge'](_0x44b21f['where'],{'$or':_['map'](_0xccc652,function(_0x159716){if(_0x159716[_0xc37c('0x3f')]!==_0xc37c('0x4c')){var _0x34c874={};_0x34c874[_0x159716[_0xc37c('0x39')]]={'$like':'%'+_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4b')]+'%'};return _0x34c874;}})});}_0x44b21f=_['merge']({},_0x44b21f,_0x346c5d['options']);var _0xcffc55={'where':_0x44b21f[_0xc37c('0x49')]};return db[_0xc37c('0x3c')][_0xc37c('0x34')](_0xcffc55)[_0xc37c('0x23')](function(_0x14377a){_0x1fc342[_0xc37c('0x34')]=_0x14377a;if(_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4d')]){_0x44b21f[_0xc37c('0x4e')]=[{'all':!![]}];}return db[_0xc37c('0x3c')][_0xc37c('0x4f')](_0x44b21f);})[_0xc37c('0x23')](function(_0x2ff7d0){_0x1fc342[_0xc37c('0x50')]=_0x2ff7d0;return _0x1fc342;})[_0xc37c('0x23')](respondWithFilteredResult(_0x17dd56,_0x44b21f))['catch'](handleError(_0x17dd56,null));};exports[_0xc37c('0x51')]=function(_0x5287cd,_0x144926){var _0x3c3ad0={'raw':!![],'where':{'id':_0x5287cd[_0xc37c('0x52')]['id']}},_0xa68da6={};_0xa68da6[_0xc37c('0x41')]=_[_0xc37c('0x42')](db[_0xc37c('0x3c')][_0xc37c('0x3d')]);_0xa68da6[_0xc37c('0x43')]=_[_0xc37c('0x42')](_0x5287cd[_0xc37c('0x43')]);_0xa68da6[_0xc37c('0x44')]=_[_0xc37c('0x53')](_0xa68da6[_0xc37c('0x41')],_0xa68da6[_0xc37c('0x43')]);_0x3c3ad0[_0xc37c('0x46')]=_[_0xc37c('0x53')](_0xa68da6[_0xc37c('0x41')],qs[_0xc37c('0x45')](_0x5287cd[_0xc37c('0x43')][_0xc37c('0x45')]));_0x3c3ad0[_0xc37c('0x46')]=_0x3c3ad0[_0xc37c('0x46')][_0xc37c('0x54')]?_0x3c3ad0[_0xc37c('0x46')]:_0xa68da6[_0xc37c('0x41')];if(_0x5287cd[_0xc37c('0x43')]['includeAll']){_0x3c3ad0[_0xc37c('0x4e')]=[{'all':!![]}];}_0x3c3ad0=_[_0xc37c('0x55')]({},_0x3c3ad0,_0x5287cd[_0xc37c('0x56')]);return db[_0xc37c('0x3c')][_0xc37c('0x57')](_0x3c3ad0)['then'](handleEntityNotFound(_0x144926,null))[_0xc37c('0x23')](respondWithResult(_0x144926,null))['catch'](handleError(_0x144926,null));};exports[_0xc37c('0x58')]=function(_0x59ce80,_0x49f73d){return db['OpenchannelMessage']['create'](_0x59ce80['body'],{})['then'](respondWithResult(_0x49f73d,0xc9))[_0xc37c('0x2d')](handleError(_0x49f73d,null));};exports[_0xc37c('0x36')]=function(_0x4e9858,_0x4883aa){if(_0x4e9858['body']['id']){delete _0x4e9858[_0xc37c('0x59')]['id'];}return db[_0xc37c('0x3c')][_0xc37c('0x57')]({'where':{'id':_0x4e9858[_0xc37c('0x52')]['id']}})['then'](handleEntityNotFound(_0x4883aa,null))[_0xc37c('0x23')](saveUpdates(_0x4e9858[_0xc37c('0x59')],null))[_0xc37c('0x23')](respondWithResult(_0x4883aa,null))['catch'](handleError(_0x4883aa,null));};exports[_0xc37c('0x5a')]=function(_0xbf2ddc,_0x15f2f8){return db['OpenchannelMessage'][_0xc37c('0x57')]({'where':{'id':_0xbf2ddc[_0xc37c('0x52')]['id']}})[_0xc37c('0x23')](handleEntityNotFound(_0x15f2f8,null))[_0xc37c('0x23')](removeEntity(_0x15f2f8,null))[_0xc37c('0x2d')](handleError(_0x15f2f8,null));};exports['describe']=function(_0x48657c,_0x24a681){return db[_0xc37c('0x3c')][_0xc37c('0x5b')]()[_0xc37c('0x23')](respondWithResult(_0x24a681,null))[_0xc37c('0x2d')](handleError(_0x24a681,null));};var interaction_log=require('../../config/logger')(_0xc37c('0x5c'));exports[_0xc37c('0x5d')]=function(_0x2bc8f2,_0x17bb20,_0x5425b1){var _0x35f215={'agent':{},'channel':_0xc37c('0x5e')};if(_0x2bc8f2[_0xc37c('0x59')]['id']){delete _0x2bc8f2[_0xc37c('0x59')]['id'];}_0x2bc8f2['body'][_0xc37c('0x5f')]=!![];_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x60')]=moment()[_0xc37c('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')]=_0x2bc8f2['body'][_0xc37c('0x62')]||_0x2bc8f2[_0xc37c('0x63')]['id'];_0x35f215[_0xc37c('0x64')]['id']=_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')];return db[_0xc37c('0x3c')][_0xc37c('0x57')]({'where':{'id':_0x2bc8f2['params']['id'],'UserId':null}})[_0xc37c('0x23')](handleEntityNotFound(_0x17bb20,null))[_0xc37c('0x23')](saveUpdates(_0x2bc8f2[_0xc37c('0x59')],null))[_0xc37c('0x23')](function(_0x5b3d9f){if(_0x5b3d9f){_0x35f215[_0xc37c('0x2b')]=_0x5b3d9f['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xc37c('0x57')]({'where':{'id':_0x5b3d9f['OpenchannelInteractionId']}});}return null;})[_0xc37c('0x23')](handleEntityNotFound(_0x17bb20,null))[_0xc37c('0x23')](function(_0x4d591d){if(_0x4d591d){return _0x4d591d[_0xc37c('0x36')]({'UserId':_0x2bc8f2['body']['UserId'],'read1stAt':_[_0xc37c('0x65')](_0x4d591d[_0xc37c('0x66')])?moment()[_0xc37c('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc37c('0x23')](function(_0x3d9764){if(_0x3d9764){_0x35f215[_0xc37c('0x67')]=_0x3d9764[_0xc37c('0x68')]({'plain':!![]});interaction_log[_0xc37c('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bc8f2['user']['id'],_0x2bc8f2[_0xc37c('0x63')][_0xc37c('0x39')],_0x2bc8f2[_0xc37c('0x63')]['role'],_0x35f215[_0xc37c('0x67')]['id'],_0x2bc8f2['body']?JSON[_0xc37c('0x29')](_0x2bc8f2[_0xc37c('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0xc37c('0x69'),_0x35f215);}return null;})[_0xc37c('0x23')](function(_0x1e7771){var _0x371f2c=_0xc37c('0x6a')+_0x1e7771[_0xc37c('0x2b')]['ContactId'];return db[_0xc37c('0x6b')][_0xc37c('0x43')](_0x371f2c,{'type':db[_0xc37c('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc37c('0x23')](function(_0x46df59){return _0x46df59;});})[_0xc37c('0x23')](function(_0x19bb87){if(_0x19bb87){_0x35f215[_0xc37c('0x2b')][_0xc37c('0x6d')]=_0x19bb87[0x0];if(!_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')])return;return db['User'][_0xc37c('0x57')]({'where':{'id':_0x2bc8f2['body']['UserId'],'role':_0xc37c('0x64')},'attributes':['id',_0xc37c('0x39'),'fullname','email',_0xc37c('0x6e')],'raw':!![]});}return null;})['then'](function(_0x548618){if(!_0x548618)return null;_0x35f215[_0xc37c('0x2b')]['agent']=_0x548618;return _0x35f215;})[_0xc37c('0x23')](function(_0x34fd85){if(_0x34fd85){if(_0x2bc8f2['body'][_0xc37c('0x6f')]){_0x35f215[_0xc37c('0x2b')][_0xc37c('0x70')]=util[_0xc37c('0x61')]('SIP/%s',_0x2bc8f2['user'][_0xc37c('0x39')]);_0x35f215[_0xc37c('0x2b')][_0xc37c('0x71')]=_0x35f215['channel'];_0x35f215['message'][_0xc37c('0x72')]=_0x35f215[_0xc37c('0x71')];_0x35f215[_0xc37c('0x2b')][_0xc37c('0x73')]=_0xc37c('0x5d');return respondWithRpcPromise(_0xc37c('0x74'),_0xc37c('0x74'),{'event':_0xc37c('0x75'),'message':_0x35f215[_0xc37c('0x2b')]},client9002)[_0xc37c('0x23')](function(){return _0x35f215;});}return _0x35f215;}return null;})['then'](respondWithResult(_0x17bb20,null))[_0xc37c('0x2d')](handleError(_0x17bb20,null));};var interaction_log=require(_0xc37c('0x16'))(_0xc37c('0x5c'));exports['reject']=function(_0x4b8686,_0xc64bcf,_0xa3e314){var _0x187123={'agent':{},'channel':_0xc37c('0x5e')};if(_0x4b8686[_0xc37c('0x59')]['id']){delete _0x4b8686[_0xc37c('0x59')]['id'];}_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')]=_0x4b8686[_0xc37c('0x59')]['UserId']||_0x4b8686[_0xc37c('0x63')]['id'];_0x187123[_0xc37c('0x64')]['id']=_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')];return db['OpenchannelMessage'][_0xc37c('0x57')]({'where':{'id':_0x4b8686['params']['id'],'UserId':null}})[_0xc37c('0x23')](handleEntityNotFound(_0xc64bcf,null))[_0xc37c('0x23')](function(_0x3587c3){if(_0x3587c3){_0x187123['message']=_0x3587c3[_0xc37c('0x68')]({'plain':!![]});return db[_0xc37c('0x76')]['find']({'where':{'id':_0x3587c3[_0xc37c('0x77')]}});}return null;})[_0xc37c('0x23')](handleEntityNotFound(_0xc64bcf,null))[_0xc37c('0x23')](function(_0x3e584f){if(_0x3e584f){_0x187123[_0xc37c('0x67')]=_0x3e584f[_0xc37c('0x68')]({'plain':!![]});interaction_log[_0xc37c('0x24')](_0xc37c('0x78'),_0x4b8686[_0xc37c('0x63')]['id'],_0x4b8686[_0xc37c('0x63')][_0xc37c('0x39')],_0x4b8686[_0xc37c('0x63')][_0xc37c('0x79')],_0x187123[_0xc37c('0x67')]['id'],_0x4b8686[_0xc37c('0x59')]?JSON[_0xc37c('0x29')](_0x4b8686['body']):_0xc37c('0x7a'));return respondWithRpcPromise(_0xc37c('0x7b'),_0xc37c('0x7c'),_0x187123);}return null;})['then'](function(_0x46471a){var _0x538156=_0xc37c('0x6a')+_0x46471a[_0xc37c('0x2b')][_0xc37c('0x7d')];return db['sequelize'][_0xc37c('0x43')](_0x538156,{'type':db[_0xc37c('0x6c')][_0xc37c('0x7e')][_0xc37c('0x7f')],'raw':!![]})[_0xc37c('0x23')](function(_0x22d25a){return _0x22d25a;});})['then'](function(_0x550099){if(_0x550099){_0x187123[_0xc37c('0x2b')][_0xc37c('0x6d')]=_0x550099[0x0];if(!_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')])return;return db[_0xc37c('0x80')]['find']({'where':{'id':_0x4b8686[_0xc37c('0x59')]['UserId'],'role':_0xc37c('0x64')},'attributes':['id',_0xc37c('0x39'),_0xc37c('0x81'),_0xc37c('0x82'),_0xc37c('0x6e')],'raw':!![]});}return null;})[_0xc37c('0x23')](function(_0x57ccd0){if(!_0x57ccd0)return null;_0x187123[_0xc37c('0x2b')][_0xc37c('0x64')]=_0x57ccd0;return _0x187123;})[_0xc37c('0x23')](function(_0x29e5a6){if(_0x29e5a6){_0x29e5a6['message']['interface']=util['format'](_0xc37c('0x83'),_0x4b8686[_0xc37c('0x63')][_0xc37c('0x39')]);_0x29e5a6['message']['channel']=_0x187123['channel'];_0x29e5a6[_0xc37c('0x2b')][_0xc37c('0x72')]=_0x187123[_0xc37c('0x71')];_0x29e5a6[_0xc37c('0x2b')][_0xc37c('0x73')]='reject';respondWithRpcPromise('EventManager',_0xc37c('0x74'),{'event':_0xc37c('0x84'),'message':_0x29e5a6['message']},client9002);return _0x187123;}return null;})['then'](respondWithResult(_0xc64bcf,null))[_0xc37c('0x2d')](handleError(_0xc64bcf,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6373ba7..e95f945 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 _0x4331=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0x4331,0x1d5));var _0x1433=function(_0x3ee80f,_0x2629e6){_0x3ee80f=_0x3ee80f-0x0;var _0x2c6605=_0x4331[_0x3ee80f];return _0x2c6605;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x1433('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1433('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1433('0x2'),'afterDestroy':_0x1433('0x3')};function emitEvent(_0x2c35a4){return function(_0x1f6411,_0x23ed77,_0x36a9d5){OpenchannelMessageEvents[_0x1433('0x4')](_0x2c35a4+':'+_0x1f6411['id'],_0x1f6411);OpenchannelMessageEvents['emit'](_0x2c35a4,_0x1f6411);_0x36a9d5(null);};}for(var e in events){if(events[_0x1433('0x5')](e)){var event=events[e];OpenchannelMessage[_0x1433('0x6')](e,emitEvent(event));}}module[_0x1433('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x2a04=['hook','events','../../mysqldb','OpenchannelMessage','save','update','emit'];(function(_0x14b887,_0x115f1f){var _0x24b690=function(_0x36e6c8){while(--_0x36e6c8){_0x14b887['push'](_0x14b887['shift']());}};_0x24b690(++_0x115f1f);}(_0x2a04,0x13c));var _0x42a0=function(_0x27ac0a,_0x549330){_0x27ac0a=_0x27ac0a-0x0;var _0x4a918a=_0x2a04[_0x27ac0a];return _0x4a918a;};'use strict';var EventEmitter=require(_0x42a0('0x0'));var OpenchannelMessage=require(_0x42a0('0x1'))['db'][_0x42a0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x42a0('0x3'),'afterUpdate':_0x42a0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c9d1f){return function(_0x8dcd1c,_0x11e0a8,_0x3c8772){OpenchannelMessageEvents['emit'](_0x1c9d1f+':'+_0x8dcd1c['id'],_0x8dcd1c);OpenchannelMessageEvents[_0x42a0('0x5')](_0x1c9d1f,_0x8dcd1c);_0x3c8772(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x42a0('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index b4e9ae7..567dbd0 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 _0xd4a2=['OpenchannelInteractionId','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','POST','threadId','update','inspect','finally','utf8mb4','lodash','api','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0xe477a6,_0xa98e47){var _0x795a7a=function(_0x5e304f){while(--_0x5e304f){_0xe477a6['push'](_0xe477a6['shift']());}};_0x795a7a(++_0xa98e47);}(_0xd4a2,0x173));var _0x2d4a=function(_0x10d094,_0x29dcdb){_0x10d094=_0x10d094-0x0;var _0x567927=_0xd4a2[_0x10d094];return _0x567927;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[{'name':_0x2d4a('0x9'),'fields':[_0x2d4a('0xa')],'type':_0x2d4a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x535b2f,_0xb9f016,_0x113839){var _0x33b786=_0x3a88e2[_0x2d4a('0xc')];var _0x3abbbd=_0x535b2f[_0x2d4a('0xd')]({'plain':!![]});if(_0x3abbbd['direction']['toLowerCase']()==='in'||_0x3abbbd[_0x2d4a('0xe')]['toLowerCase']()===_0x2d4a('0xf')&&!_0x3abbbd[_0x2d4a('0x10')]&&!_[_0x2d4a('0x11')](_0x3abbbd[_0x2d4a('0x12')])){_0x33b786[_0x2d4a('0x13')][_0x2d4a('0x14')]({'where':{'id':_0x3abbbd[_0x2d4a('0x15')]}})[_0x2d4a('0x16')](function(_0x544622){if(_0x544622){_0x544622['update']({'lastMsgAt':_0x3abbbd[_0x2d4a('0x17')],'lastMsgDirection':_0x3abbbd['direction'][_0x2d4a('0x18')]()});}})[_0x2d4a('0x19')](function(_0x11896d){console[_0x2d4a('0x1a')](_0x11896d);});}if(_0x3abbbd['direction']===_0x2d4a('0xf')&&!_0x3abbbd['secret']){var _0x2838fa;_0x33b786['CmContact'][_0x2d4a('0x1b')]()[_0x2d4a('0x16')](function(_0x2188b2){return _0x33b786[_0x2d4a('0x1c')]['find']({'where':{'id':_0x3abbbd['OpenchannelAccountId']},'include':[{'model':_0x33b786['OpenchannelInteraction'],'as':_0x2d4a('0x1d'),'where':{'id':_0x3abbbd[_0x2d4a('0x15')]},'limit':0x1,'include':[{'model':_0x33b786[_0x2d4a('0x1e')],'as':_0x2d4a('0x1f'),'attributes':_[_0x2d4a('0x20')](_0x2188b2)}]}]});})[_0x2d4a('0x16')](function(_0x56445a){_0x2838fa=_0x56445a['get']({'plain':!![]});if(_0x2838fa&&_0x2838fa[_0x2d4a('0x21')]){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')](_0x2d4a('0x26'),_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x2838fa[_0x2d4a('0x1d')]&&_0x2838fa['Interactions'][_0x2d4a('0x27')]){_0x3abbbd[_0x2d4a('0x28')]=_[_0x2d4a('0x29')](_0x2838fa[_0x2d4a('0x1d')][0x0],_0x2d4a('0x1f'));_0x3abbbd[_0x2d4a('0x1f')]=_0x2838fa[_0x2d4a('0x1d')][0x0][_0x2d4a('0x1f')];}var _0xb9f016={'method':'POST','uri':encodeURI(_0x2838fa['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xb9f016[_0x2d4a('0x2a')]){case'GET':_0xb9f016['qs']=_0x3abbbd;break;case _0x2d4a('0x2b'):_0xb9f016[_0x2d4a('0xa')]=_0x3abbbd;break;}return rp(_0xb9f016)[_0x2d4a('0x16')](function(_0x1d2fa6){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x1d2fa6['body'][_0x2d4a('0x2c')]&&_0x1d2fa6[_0x2d4a('0xa')][_0x2d4a('0x2c')]!=_0x3abbbd[_0x2d4a('0x28')][_0x2d4a('0x2c')]){return _0x33b786[_0x2d4a('0x13')][_0x2d4a('0x2d')]({'threadId':_0x1d2fa6[_0x2d4a('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x3abbbd[_0x2d4a('0x28')]['id']}});}else{return;}})[_0x2d4a('0x16')](function(){return _0x535b2f[_0x2d4a('0x2d')]({'read':!![]});})[_0x2d4a('0x19')](function(_0x2b66af){logger['error'](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x2e')](_0x2b66af,{'showHidden':![],'depth':null}));_0x113839();});}else{_0x113839();}})[_0x2d4a('0x2f')](function(){_0x113839();});}else{_0x113839();}}},'charset':_0x2d4a('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xef0f=['POST','method','GET','body','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','Contact'];(function(_0x1f75e8,_0x7fa97f){var _0x120699=function(_0x4d817b){while(--_0x4d817b){_0x1f75e8['push'](_0x1f75e8['shift']());}};_0x120699(++_0x7fa97f);}(_0xef0f,0x168));var _0xfef0=function(_0x202c36,_0x2c7b28){_0x202c36=_0x202c36-0x0;var _0x3b2505=_0xef0f[_0x202c36];return _0x3b2505;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xfef0('0xb'),'fields':['body'],'type':_0xfef0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x100e3a,_0x3a81cc,_0x2d42dc){var _0x334e74=_0x2697df[_0xfef0('0xd')];var _0xc177db=_0x100e3a[_0xfef0('0xe')]({'plain':!![]});if(_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()==='in'||_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]&&!_['isNil'](_0xc177db[_0xfef0('0x13')])){_0x334e74[_0xfef0('0x14')][_0xfef0('0x15')]({'where':{'id':_0xc177db[_0xfef0('0x16')]}})[_0xfef0('0x17')](function(_0x45599a){if(_0x45599a){_0x45599a[_0xfef0('0x18')]({'lastMsgAt':_0xc177db['createdAt'],'lastMsgDirection':_0xc177db[_0xfef0('0xf')]['toLowerCase']()});}})['catch'](function(_0x5acdd0){console[_0xfef0('0x19')](_0x5acdd0);});}if(_0xc177db[_0xfef0('0xf')]===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]){var _0x2a96d9;_0x334e74[_0xfef0('0x1a')][_0xfef0('0x1b')]()[_0xfef0('0x17')](function(_0x581459){return _0x334e74[_0xfef0('0x1c')][_0xfef0('0x1d')]({'where':{'id':_0xc177db[_0xfef0('0x1e')]},'include':[{'model':_0x334e74[_0xfef0('0x14')],'as':_0xfef0('0x1f'),'where':{'id':_0xc177db['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x334e74[_0xfef0('0x1a')],'as':'Contact','attributes':_[_0xfef0('0x20')](_0x581459)}]}]});})[_0xfef0('0x17')](function(_0x28dee1){_0x2a96d9=_0x28dee1['get']({'plain':!![]});if(_0x2a96d9&&_0x2a96d9[_0xfef0('0x21')]){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0xc177db['id'],_0x2a96d9['replyUri']));if(_0x2a96d9[_0xfef0('0x1f')]&&_0x2a96d9['Interactions'][_0xfef0('0x24')]){_0xc177db[_0xfef0('0x25')]=_[_0xfef0('0x26')](_0x2a96d9[_0xfef0('0x1f')][0x0],_0xfef0('0x27'));_0xc177db[_0xfef0('0x27')]=_0x2a96d9['Interactions'][0x0]['Contact'];}var _0x3a81cc={'method':_0xfef0('0x28'),'uri':encodeURI(_0x2a96d9[_0xfef0('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3a81cc[_0xfef0('0x29')]){case _0xfef0('0x2a'):_0x3a81cc['qs']=_0xc177db;break;case _0xfef0('0x28'):_0x3a81cc[_0xfef0('0x2b')]=_0xc177db;break;}return rp(_0x3a81cc)[_0xfef0('0x17')](function(_0x391279){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util[_0xfef0('0x2c')](_0xfef0('0x2d'),_0xc177db['id'],_0x2a96d9[_0xfef0('0x21')]));if(_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]&&_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]!=_0xc177db[_0xfef0('0x25')][_0xfef0('0x2e')]){return _0x334e74[_0xfef0('0x14')]['update']({'threadId':_0x391279[_0xfef0('0x2b')]['threadId']},{'logging':!![],'where':{'id':_0xc177db['Interaction']['id']}});}else{return;}})[_0xfef0('0x17')](function(){return _0x100e3a[_0xfef0('0x18')]({'read':!![]});})['catch'](function(_0x4bbdba){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xfef0('0x2f')](_0x4bbdba,{'showHidden':![],'depth':null}));_0x2d42dc();});}else{_0x2d42dc();}})[_0xfef0('0x30')](function(){_0x2d42dc();});}else{_0x2d42dc();}}},'charset':_0xfef0('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ee592e7..d07cab3 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x463534,_0x1e2cc2){var _0x2c9b81=function(_0x387a21){while(--_0x387a21){_0x463534['push'](_0x463534['shift']());}};_0x2c9b81(++_0x1e2cc2);}(_0x2ef3,0xba));var _0x32ef=function(_0x31d6d4,_0x5abdd8){_0x31d6d4=_0x31d6d4-0x0;var _0x4d1b98=_0x2ef3[_0x31d6d4];return _0x4d1b98;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1c093f,_0x37bea5){var _0x46d6ec=function(_0x3aa4b5){while(--_0x3aa4b5){_0x1c093f['push'](_0x1c093f['shift']());}};_0x46d6ec(++_0x37bea5);}(_0xadb5,0xad));var _0x5adb=function(_0x435901,_0x43373c){_0x435901=_0x435901-0x0;var _0x154175=_0xadb5[_0x435901];return _0x154175;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b445e7b..a2623a1 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 _0x3463=['length','./openchannelMessage.events','removeListener'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0x3463,0x97));var _0x3346=function(_0x5e761b,_0x355e38){_0x5e761b=_0x5e761b-0x0;var _0x98502c=_0x3463[_0x5e761b];return _0x98502c;};'use strict';var OpenchannelMessageEvents=require(_0x3346('0x0'));var events=['save','remove','update'];function createListener(_0x55bf8b,_0xc86e5d){return function(_0x512d0d){_0xc86e5d['emit'](_0x55bf8b,_0x512d0d);};}function removeListener(_0x3a6620,_0x297b7e){return function(){OpenchannelMessageEvents[_0x3346('0x1')](_0x3a6620,_0x297b7e);};}exports['register']=function(_0x5ce4e3){for(var _0x1d210b=0x0,_0x21f872=events[_0x3346('0x2')];_0x1d210b<_0x21f872;_0x1d210b++){var _0x3f7ed5=events[_0x1d210b];var _0x372256=createListener('openchannelMessage:'+_0x3f7ed5,_0x5ce4e3);OpenchannelMessageEvents['on'](_0x3f7ed5,_0x372256);}}; \ No newline at end of file +var _0x2f2e=['emit','length','save','remove'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2f2e,0x146));var _0xe2f2=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0x2f2e[_0x16ed87];return _0xc1a1d8;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){OpenchannelMessageEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('openchannelMessage:'+_0xc44c89,_0x5b202f);OpenchannelMessageEvents['on'](_0xc44c89,_0x48111c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 00faae0..d767900 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 _0xb7d9=['../../components/auth/service','../../config/environment','./openchannelQueue.controller','index','/describe','get','/:id','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','create','addTeams','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x43647b,_0x3ad472){var _0xf2f678=function(_0x565ec1){while(--_0x565ec1){_0x43647b['push'](_0x43647b['shift']());}};_0xf2f678(++_0x3ad472);}(_0xb7d9,0xd1));var _0x9b7d=function(_0x4ee37d,_0x413307){_0x4ee37d=_0x4ee37d-0x0;var _0x5610e3=_0xb7d9[_0x4ee37d];return _0x5610e3;};'use strict';var multer=require(_0x9b7d('0x0'));var util=require(_0x9b7d('0x1'));var path=require(_0x9b7d('0x2'));var timeout=require(_0x9b7d('0x3'));var express=require(_0x9b7d('0x4'));var router=express[_0x9b7d('0x5')]();var fs_extra=require(_0x9b7d('0x6'));var auth=require(_0x9b7d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9b7d('0x8'));var controller=require(_0x9b7d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b7d('0xa')]);router['get'](_0x9b7d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x9b7d('0xc')](_0x9b7d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9b7d('0xc')]('/:id/members',auth[_0x9b7d('0xe')](),controller[_0x9b7d('0xf')]);router[_0x9b7d('0xc')](_0x9b7d('0x10'),auth[_0x9b7d('0xe')](),controller[_0x9b7d('0x11')]);router[_0x9b7d('0xc')](_0x9b7d('0x12'),auth[_0x9b7d('0xe')](),controller['getAgents']);router['post']('/',auth[_0x9b7d('0xe')](),controller[_0x9b7d('0x13')]);router['post']('/:id/teams',auth[_0x9b7d('0xe')](),controller[_0x9b7d('0x14')]);router['post']('/:id/users',auth[_0x9b7d('0xe')](),controller[_0x9b7d('0x15')]);router[_0x9b7d('0x16')](_0x9b7d('0xd'),auth[_0x9b7d('0xe')](),controller[_0x9b7d('0x17')]);router[_0x9b7d('0x18')](_0x9b7d('0xd'),auth[_0x9b7d('0xe')](),controller['destroy']);router[_0x9b7d('0x18')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x9b7d('0x19')]);module[_0x9b7d('0x1a')]=router; \ No newline at end of file +var _0xcbdf=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','destroy','removeTeams','delete','removeAgents','exports','multer','path'];(function(_0x167bb5,_0x442f3c){var _0x18cb1a=function(_0x3fb854){while(--_0x3fb854){_0x167bb5['push'](_0x167bb5['shift']());}};_0x18cb1a(++_0x442f3c);}(_0xcbdf,0xd7));var _0xfcbd=function(_0x1912d8,_0x5a47ed){_0x1912d8=_0x1912d8-0x0;var _0x513dab=_0xcbdf[_0x1912d8];return _0x513dab;};'use strict';var multer=require(_0xfcbd('0x0'));var util=require('util');var path=require(_0xfcbd('0x1'));var timeout=require('connect-timeout');var express=require(_0xfcbd('0x2'));var router=express[_0xfcbd('0x3')]();var fs_extra=require(_0xfcbd('0x4'));var auth=require(_0xfcbd('0x5'));var interaction=require(_0xfcbd('0x6'));var config=require(_0xfcbd('0x7'));var controller=require(_0xfcbd('0x8'));router[_0xfcbd('0x9')]('/',auth[_0xfcbd('0xa')](),controller[_0xfcbd('0xb')]);router[_0xfcbd('0x9')]('/describe',auth[_0xfcbd('0xa')](),controller[_0xfcbd('0xc')]);router[_0xfcbd('0x9')](_0xfcbd('0xd'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0xe')]);router['get'](_0xfcbd('0xf'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x10')]);router[_0xfcbd('0x9')](_0xfcbd('0x11'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x12')]);router[_0xfcbd('0x9')](_0xfcbd('0x13'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x14')]);router['post']('/',auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x15')]);router[_0xfcbd('0x16')](_0xfcbd('0x11'),auth[_0xfcbd('0xa')](),controller['addTeams']);router['post'](_0xfcbd('0x13'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x17')]);router[_0xfcbd('0x18')](_0xfcbd('0xd'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x19')]);router['delete']('/:id',auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x1a')]);router['delete']('/:id/teams',auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x1b')]);router[_0xfcbd('0x1c')](_0xfcbd('0x13'),auth[_0xfcbd('0xa')](),controller[_0xfcbd('0x1d')]);module[_0xfcbd('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index e30c9f5..f37b066 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 _0x8f4c=['ENUM','rrmemory','beepall','STRING'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x8f4c,0xe3));var _0xc8f4=function(_0x28b115,_0x2de018){_0x28b115=_0x28b115-0x0;var _0x389b5c=_0x8f4c[_0x28b115];return _0x389b5c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc8f4('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc8f4('0x1')](_0xc8f4('0x2'),_0xc8f4('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x0cd2=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0xaeda82,_0x58973c){var _0x4f7909=function(_0x59519e){while(--_0x59519e){_0xaeda82['push'](_0xaeda82['shift']());}};_0x4f7909(++_0x58973c);}(_0x0cd2,0x19d));var _0x20cd=function(_0x2be52a,_0x873515){_0x2be52a=_0x2be52a-0x0;var _0x127d62=_0x0cd2[_0x2be52a];return _0x127d62;};'use strict';var Sequelize=require('sequelize');module[_0x20cd('0x0')]={'name':{'type':Sequelize[_0x20cd('0x1')],'unique':_0x20cd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x20cd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20cd('0x4')](_0x20cd('0x5'),_0x20cd('0x6'),_0x20cd('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 44ed17e..0af03ff 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 _0x98bf=['status','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','findAll','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus'];(function(_0x14101f,_0x182332){var _0x552bf0=function(_0x5de469){while(--_0x5de469){_0x14101f['push'](_0x14101f['shift']());}};_0x552bf0(++_0x182332);}(_0x98bf,0x190));var _0xf98b=function(_0x42764d,_0x332a27){_0x42764d=_0x42764d-0x0;var _0x2a643c=_0x98bf[_0x42764d];return _0x2a643c;};'use strict';var emlformat=require(_0xf98b('0x0'));var rimraf=require(_0xf98b('0x1'));var zipdir=require(_0xf98b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf98b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf98b('0x4'));var util=require(_0xf98b('0x5'));var path=require('path');var sox=require(_0xf98b('0x6'));var csv=require(_0xf98b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf98b('0x8'));var squel=require(_0xf98b('0x9'));var crypto=require(_0xf98b('0xa'));var jsforce=require(_0xf98b('0xb'));var deskjs=require(_0xf98b('0xc'));var toCsv=require(_0xf98b('0x7'));var querystring=require(_0xf98b('0xd'));var Papa=require(_0xf98b('0xe'));var Redis=require(_0xf98b('0xf'));var authService=require(_0xf98b('0x10'));var qs=require(_0xf98b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf98b('0x12'));var logger=require(_0xf98b('0x13'))(_0xf98b('0x14'));var utils=require('../../config/utils');var config=require(_0xf98b('0x15'));var licenseUtil=require(_0xf98b('0x16'));var db=require(_0xf98b('0x17'))['db'];config[_0xf98b('0x18')]=_['defaults'](config[_0xf98b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf98b('0x19'))(new Redis(config[_0xf98b('0x18')]));require(_0xf98b('0x1a'))[_0xf98b('0x1b')](socket);function respondWithStatusCode(_0x2fd032,_0x7db778){_0x7db778=_0x7db778||0xcc;return function(_0x27403e){if(_0x27403e){return _0x2fd032[_0xf98b('0x1c')](_0x7db778);}return _0x2fd032[_0xf98b('0x1d')](_0x7db778)['end']();};}function respondWithResult(_0x3b89d9,_0x13786f){_0x13786f=_0x13786f||0xc8;return function(_0x3152e8){if(_0x3152e8){return _0x3b89d9[_0xf98b('0x1d')](_0x13786f)['json'](_0x3152e8);}};}function respondWithFilteredResult(_0x2467fd,_0x4aa0fa){return function(_0x524b00){if(_0x524b00){var _0x3ddc29=typeof _0x4aa0fa[_0xf98b('0x1e')]===_0xf98b('0x1f')&&typeof _0x4aa0fa[_0xf98b('0x20')]==='undefined';var _0x5408ef=_0x524b00[_0xf98b('0x21')];var _0x5c5cc9=_0x3ddc29?0x0:_0x4aa0fa[_0xf98b('0x1e')];var _0x21be75=_0x3ddc29?_0x524b00['count']:_0x4aa0fa[_0xf98b('0x1e')]+_0x4aa0fa['limit'];var _0xcc0d92;if(_0x21be75>=_0x5408ef){_0x21be75=_0x5408ef;_0xcc0d92=0xc8;}else{_0xcc0d92=0xce;}_0x2467fd[_0xf98b('0x1d')](_0xcc0d92);return _0x2467fd['set'](_0xf98b('0x22'),_0x5c5cc9+'-'+_0x21be75+'/'+_0x5408ef)[_0xf98b('0x23')](_0x524b00);}return null;};}function patchUpdates(_0x355a44){return function(_0x476fef){try{jsonpatch[_0xf98b('0x24')](_0x476fef,_0x355a44,!![]);}catch(_0x1402d6){return BPromise['reject'](_0x1402d6);}return _0x476fef[_0xf98b('0x25')]();};}function saveUpdates(_0x37521b,_0x2172a0){return function(_0x136129){if(_0x136129){return _0x136129[_0xf98b('0x26')](_0x37521b)['then'](function(_0x46faf9){return _0x46faf9;});}return null;};}function removeEntity(_0x3fe2b9,_0x2d137a){return function(_0x2a2415){if(_0x2a2415){return _0x2a2415[_0xf98b('0x27')]()[_0xf98b('0x28')](function(){var _0x516e90=_0x2a2415[_0xf98b('0x29')]({'plain':!![]});var _0x1d02e8=_0xf98b('0x2a');return db[_0xf98b('0x2b')][_0xf98b('0x27')]({'where':{'type':_0x1d02e8,'resourceId':_0x516e90['id']}})[_0xf98b('0x28')](function(){return _0x2a2415;});})['then'](function(){_0x3fe2b9[_0xf98b('0x1d')](0xcc)[_0xf98b('0x2c')]();});}};}function handleEntityNotFound(_0x316862,_0x1f9ed4){return function(_0x34b34a){if(!_0x34b34a){_0x316862[_0xf98b('0x1c')](0x194);}return _0x34b34a;};}function handleError(_0x41f7e8,_0x5d0f6c){_0x5d0f6c=_0x5d0f6c||0x1f4;return function(_0x14af58){logger[_0xf98b('0x2d')](_0x14af58[_0xf98b('0x2e')]);if(_0x14af58[_0xf98b('0x2f')]){delete _0x14af58[_0xf98b('0x2f')];}_0x41f7e8['status'](_0x5d0f6c)[_0xf98b('0x30')](_0x14af58);};}exports[_0xf98b('0x31')]=function(_0x49ff82,_0x50c134){var _0x346a85={},_0x16e283={},_0x45c91d={'count':0x0,'rows':[]};var _0x233cec=_[_0xf98b('0x32')](db[_0xf98b('0x33')][_0xf98b('0x34')],function(_0x6fe77f){return{'name':_0x6fe77f[_0xf98b('0x35')],'type':_0x6fe77f[_0xf98b('0x36')][_0xf98b('0x37')]};});_0x16e283[_0xf98b('0x38')]=_[_0xf98b('0x32')](_0x233cec,_0xf98b('0x2f'));_0x16e283[_0xf98b('0x39')]=_['keys'](_0x49ff82['query']);_0x16e283[_0xf98b('0x3a')]=_[_0xf98b('0x3b')](_0x16e283[_0xf98b('0x38')],_0x16e283[_0xf98b('0x39')]);_0x346a85[_0xf98b('0x3c')]=_[_0xf98b('0x3b')](_0x16e283['model'],qs['fields'](_0x49ff82[_0xf98b('0x39')]['fields']));_0x346a85[_0xf98b('0x3c')]=_0x346a85['attributes'][_0xf98b('0x3d')]?_0x346a85[_0xf98b('0x3c')]:_0x16e283[_0xf98b('0x38')];if(!_0x49ff82[_0xf98b('0x39')][_0xf98b('0x3e')]('nolimit')){_0x346a85[_0xf98b('0x20')]=qs[_0xf98b('0x20')](_0x49ff82[_0xf98b('0x39')][_0xf98b('0x20')]);_0x346a85[_0xf98b('0x1e')]=qs['offset'](_0x49ff82[_0xf98b('0x39')][_0xf98b('0x1e')]);}_0x346a85[_0xf98b('0x3f')]=qs[_0xf98b('0x40')](_0x49ff82[_0xf98b('0x39')]['sort']);_0x346a85[_0xf98b('0x41')]=qs['filters'](_[_0xf98b('0x42')](_0x49ff82[_0xf98b('0x39')],_0x16e283[_0xf98b('0x3a')]),_0x233cec);if(_0x49ff82['query'][_0xf98b('0x43')]){_0x346a85[_0xf98b('0x41')]=_[_0xf98b('0x44')](_0x346a85[_0xf98b('0x41')],{'$or':_[_0xf98b('0x32')](_0x233cec,function(_0x40639a){if(_0x40639a['type']!==_0xf98b('0x45')){var _0x470eb4={};_0x470eb4[_0x40639a[_0xf98b('0x2f')]]={'$like':'%'+_0x49ff82[_0xf98b('0x39')][_0xf98b('0x43')]+'%'};return _0x470eb4;}})});}_0x346a85=_[_0xf98b('0x44')]({},_0x346a85,_0x49ff82[_0xf98b('0x46')]);var _0x5ed994={'where':_0x346a85['where']};return db['OpenchannelQueue']['count'](_0x5ed994)['then'](function(_0x23beb2){_0x45c91d[_0xf98b('0x21')]=_0x23beb2;if(_0x49ff82['query'][_0xf98b('0x47')]){_0x346a85[_0xf98b('0x48')]=[{'all':!![]}];}return db[_0xf98b('0x33')]['findAll'](_0x346a85);})['then'](function(_0xafa00c){_0x45c91d['rows']=_0xafa00c;return _0x45c91d;})[_0xf98b('0x28')](respondWithFilteredResult(_0x50c134,_0x346a85))[_0xf98b('0x49')](handleError(_0x50c134,null));};exports[_0xf98b('0x4a')]=function(_0x312440,_0x23bf17){var _0x3d4f3c={'raw':!![],'where':{'id':_0x312440[_0xf98b('0x4b')]['id']}},_0x1b9dd0={};_0x1b9dd0['model']=_[_0xf98b('0x4c')](db[_0xf98b('0x33')][_0xf98b('0x34')]);_0x1b9dd0['query']=_[_0xf98b('0x4c')](_0x312440[_0xf98b('0x39')]);_0x1b9dd0['filters']=_['intersection'](_0x1b9dd0[_0xf98b('0x38')],_0x1b9dd0[_0xf98b('0x39')]);_0x3d4f3c['attributes']=_[_0xf98b('0x3b')](_0x1b9dd0[_0xf98b('0x38')],qs[_0xf98b('0x4d')](_0x312440['query'][_0xf98b('0x4d')]));_0x3d4f3c['attributes']=_0x3d4f3c[_0xf98b('0x3c')]['length']?_0x3d4f3c[_0xf98b('0x3c')]:_0x1b9dd0[_0xf98b('0x38')];if(_0x312440[_0xf98b('0x39')]['includeAll']){_0x3d4f3c[_0xf98b('0x48')]=[{'all':!![]}];}_0x3d4f3c=_[_0xf98b('0x44')]({},_0x3d4f3c,_0x312440['options']);return db['OpenchannelQueue'][_0xf98b('0x4e')](_0x3d4f3c)[_0xf98b('0x28')](handleEntityNotFound(_0x23bf17,null))[_0xf98b('0x28')](respondWithResult(_0x23bf17,null))[_0xf98b('0x49')](handleError(_0x23bf17,null));};exports['create']=function(_0x12d7b5,_0x59e18e){return db[_0xf98b('0x33')][_0xf98b('0x4f')](_0x12d7b5['body'],{})['then'](function(_0x4d8011){var _0x5629c6=_0x12d7b5['user'][_0xf98b('0x29')]({'plain':!![]});if(!_0x5629c6)throw new Error(_0xf98b('0x50'));if(_0x5629c6[_0xf98b('0x51')]===_0xf98b('0x52')){var _0x1c57eb=_0x4d8011['get']({'plain':!![]});var _0x525ba7=_0xf98b('0x2a');return db[_0xf98b('0x53')][_0xf98b('0x4e')]({'where':{'name':_0x525ba7,'userProfileId':_0x5629c6['userProfileId']},'raw':!![]})[_0xf98b('0x28')](function(_0x5cbc9d){if(_0x5cbc9d&&_0x5cbc9d[_0xf98b('0x54')]===0x0){return db[_0xf98b('0x2b')][_0xf98b('0x4f')]({'name':_0x1c57eb[_0xf98b('0x2f')],'resourceId':_0x1c57eb['id'],'type':_0x5cbc9d['name'],'sectionId':_0x5cbc9d['id']},{})['then'](function(){return _0x4d8011;});}else{return _0x4d8011;}})['catch'](function(_0x2c7a84){logger['error'](_0xf98b('0x55'),_0x2c7a84);throw _0x2c7a84;});}return _0x4d8011;})[_0xf98b('0x28')](respondWithResult(_0x59e18e,0xc9))[_0xf98b('0x49')](handleError(_0x59e18e,null));};exports[_0xf98b('0x26')]=function(_0x3cfc59,_0x3c8195){if(_0x3cfc59[_0xf98b('0x56')]['id']){delete _0x3cfc59[_0xf98b('0x56')]['id'];}return db[_0xf98b('0x33')][_0xf98b('0x4e')]({'where':{'id':_0x3cfc59[_0xf98b('0x4b')]['id']}})[_0xf98b('0x28')](handleEntityNotFound(_0x3c8195,null))['then'](saveUpdates(_0x3cfc59['body'],null))[_0xf98b('0x28')](respondWithResult(_0x3c8195,null))[_0xf98b('0x49')](handleError(_0x3c8195,null));};exports['destroy']=function(_0x31e04e,_0x518ed3){return db[_0xf98b('0x33')]['find']({'where':{'id':_0x31e04e[_0xf98b('0x4b')]['id']}})[_0xf98b('0x28')](handleEntityNotFound(_0x518ed3,null))[_0xf98b('0x28')](removeEntity(_0x518ed3,null))['catch'](handleError(_0x518ed3,null));};exports[_0xf98b('0x57')]=function(_0x2cfe8e,_0x2e8988){return db[_0xf98b('0x33')][_0xf98b('0x57')]()[_0xf98b('0x28')](respondWithResult(_0x2e8988,null))[_0xf98b('0x49')](handleError(_0x2e8988,null));};exports[_0xf98b('0x58')]=function(_0x104c2f,_0xf390de,_0xc9340b){var _0x276019={'raw':!![],'where':{}},_0x382118={},_0x461410;return db[_0xf98b('0x33')][_0xf98b('0x59')]({'where':{'id':_0x104c2f['params']['id']}})[_0xf98b('0x28')](handleEntityNotFound(_0xf390de,null))['then'](function(_0x2ba265){if(_0x2ba265){_0x461410=_0x2ba265['get']({'plain':!![]});_0x382118[_0xf98b('0x38')]=_[_0xf98b('0x4c')](db[_0xf98b('0x5a')][_0xf98b('0x34')]);_0x382118['query']=_[_0xf98b('0x4c')](_0x104c2f[_0xf98b('0x39')]);_0x382118[_0xf98b('0x3a')]=_[_0xf98b('0x3b')](_0x382118[_0xf98b('0x38')],_0x382118['query']);_0x276019[_0xf98b('0x3c')]=_[_0xf98b('0x3b')](_0x382118['model'],qs[_0xf98b('0x4d')](_0x104c2f[_0xf98b('0x39')][_0xf98b('0x4d')]));_0x276019[_0xf98b('0x3c')]=_0x276019[_0xf98b('0x3c')]['length']?_0x276019[_0xf98b('0x3c')]:_0x382118[_0xf98b('0x38')];if(!_0x104c2f[_0xf98b('0x39')][_0xf98b('0x3e')](_0xf98b('0x5b'))){_0x276019[_0xf98b('0x20')]=qs[_0xf98b('0x20')](_0x104c2f[_0xf98b('0x39')][_0xf98b('0x20')]);_0x276019['offset']=qs[_0xf98b('0x1e')](_0x104c2f[_0xf98b('0x39')]['offset']);}_0x276019[_0xf98b('0x3f')]=qs[_0xf98b('0x40')](_0x104c2f[_0xf98b('0x39')][_0xf98b('0x40')]);_0x276019[_0xf98b('0x41')]=qs[_0xf98b('0x3a')](_['pick'](_0x104c2f['query'],_0x382118['filters']));_0x276019[_0xf98b('0x41')][_0xf98b('0x5c')]=_0x2ba265['id'];if(_0x104c2f[_0xf98b('0x39')][_0xf98b('0x43')]){_0x276019[_0xf98b('0x41')]=_[_0xf98b('0x44')](_0x276019['where'],{'$or':_[_0xf98b('0x32')](_0x276019['attributes'],function(_0x1fcff0){var _0x6fc9d8={};_0x6fc9d8[_0x1fcff0]={'$like':'%'+_0x104c2f[_0xf98b('0x39')]['filter']+'%'};return _0x6fc9d8;})});}_0x276019=_[_0xf98b('0x44')]({},_0x276019,_0x104c2f[_0xf98b('0x46')]);return db['UserOpenchannelQueue'][_0xf98b('0x5d')](_0x276019);}})[_0xf98b('0x28')](function(_0x43ead7){if(_0x43ead7){return db[_0xf98b('0x5e')][_0xf98b('0x5f')]({'where':{'id':_['map'](_0x43ead7,'UserId'),'role':_0xf98b('0x60')},'attributes':['id','name',_0xf98b('0x61'),_0xf98b('0x62'),_0xf98b('0x63')]});}})['then'](function(_0x136a43){if(_0x136a43){return{'count':_0x136a43[_0xf98b('0x21')],'rows':_[_0xf98b('0x32')](_0x136a43[_0xf98b('0x64')],function(_0x2f85fb){return{'membername':_0x2f85fb[_0xf98b('0x2f')],'UserId':_0x2f85fb['id'],'queue_name':_0x461410[_0xf98b('0x2f')],'OpenchannelQueueId':_0x461410['id'],'interface':util[_0xf98b('0x65')](_0xf98b('0x66'),_0xf98b('0x67'),_0x2f85fb[_0xf98b('0x2f')]),'penalty':0x0,'paused':_0x2f85fb[_0xf98b('0x61')],'createdAt':_0x2f85fb[_0xf98b('0x63')],'updatedAt':_0x2f85fb[_0xf98b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf98b('0x28')](respondWithFilteredResult(_0xf390de,_0x276019))[_0xf98b('0x49')](handleError(_0xf390de,null));};exports['getTeams']=function(_0x55d8cb,_0x45a8d2,_0x44c252){var _0x53cc31={};var _0x5e3b42={};var _0x311b84;var _0x3be7da;return db[_0xf98b('0x33')][_0xf98b('0x59')]({'where':{'id':_0x55d8cb[_0xf98b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45a8d2,null))[_0xf98b('0x28')](function(_0x56706f){if(_0x56706f){_0x311b84=_0x56706f;_0x5e3b42['model']=_[_0xf98b('0x4c')](db['Team'][_0xf98b('0x34')]);_0x5e3b42['query']=_['keys'](_0x55d8cb['query']);_0x5e3b42[_0xf98b('0x3a')]=_[_0xf98b('0x3b')](_0x5e3b42[_0xf98b('0x38')],_0x5e3b42[_0xf98b('0x39')]);_0x53cc31[_0xf98b('0x3c')]=_['intersection'](_0x5e3b42[_0xf98b('0x38')],qs[_0xf98b('0x4d')](_0x55d8cb[_0xf98b('0x39')][_0xf98b('0x4d')]));_0x53cc31[_0xf98b('0x3c')]=_0x53cc31[_0xf98b('0x3c')][_0xf98b('0x3d')]?_0x53cc31['attributes']:_0x5e3b42[_0xf98b('0x38')];_0x53cc31[_0xf98b('0x3f')]=qs[_0xf98b('0x40')](_0x55d8cb['query'][_0xf98b('0x40')]);_0x53cc31[_0xf98b('0x41')]=qs[_0xf98b('0x3a')](_[_0xf98b('0x42')](_0x55d8cb[_0xf98b('0x39')],_0x5e3b42[_0xf98b('0x3a')]));if(_0x55d8cb[_0xf98b('0x39')][_0xf98b('0x43')]){_0x53cc31[_0xf98b('0x41')]=_['merge'](_0x53cc31[_0xf98b('0x41')],{'$or':_[_0xf98b('0x32')](_0x53cc31[_0xf98b('0x3c')],function(_0x29e6e9){var _0x474ecc={};_0x474ecc[_0x29e6e9]={'$like':'%'+_0x55d8cb[_0xf98b('0x39')][_0xf98b('0x43')]+'%'};return _0x474ecc;})});}_0x53cc31=_['merge']({},_0x53cc31,_0x55d8cb[_0xf98b('0x46')]);return _0x311b84['getTeams'](_0x53cc31);}})[_0xf98b('0x28')](function(_0x4397a3){if(_0x4397a3){_0x3be7da=_0x4397a3[_0xf98b('0x3d')];if(!_0x55d8cb[_0xf98b('0x39')]['hasOwnProperty'](_0xf98b('0x5b'))){_0x53cc31[_0xf98b('0x20')]=qs['limit'](_0x55d8cb['query']['limit']);_0x53cc31[_0xf98b('0x1e')]=qs[_0xf98b('0x1e')](_0x55d8cb[_0xf98b('0x39')][_0xf98b('0x1e')]);}return _0x311b84[_0xf98b('0x68')](_0x53cc31);}})[_0xf98b('0x28')](function(_0x5b0de1){if(_0x5b0de1){return _0x5b0de1?{'count':_0x3be7da,'rows':_0x5b0de1}:null;}})[_0xf98b('0x28')](respondWithResult(_0x45a8d2,null))[_0xf98b('0x49')](handleError(_0x45a8d2,null));};exports['addTeams']=function(_0x2f935c,_0x501b52,_0x16baf1){var _0x43a1b0=_0x2f935c[_0xf98b('0x56')][_0xf98b('0x69')];return db['Team'][_0xf98b('0x5d')]({'where':{'id':_0x43a1b0},'attributes':['id'],'include':[{'model':db[_0xf98b('0x5e')],'as':_0xf98b('0x6a'),'attributes':['id',_0xf98b('0x2f'),_0xf98b('0x6b'),_0xf98b('0x6c'),_0xf98b('0x6d')],'raw':!![]}]})[_0xf98b('0x28')](function(_0x31addd){if(_0x31addd){var _0x92f291=_[_0xf98b('0x6e')](_0x31addd,function(_0x4d09e8){var _0xbd6acf=_0x4d09e8[_0xf98b('0x29')]({'plain':!![]});return _0xbd6acf[_0xf98b('0x6a')];});return db[_0xf98b('0x33')][_0xf98b('0x4e')]({'where':{'id':_0x2f935c[_0xf98b('0x4b')]['id']}})[_0xf98b('0x28')](function(_0x159f26){return db[_0xf98b('0x6f')][_0xf98b('0x70')](function(_0x1595e4){return _0x159f26[_0xf98b('0x71')](_0x43a1b0,{'transaction':_0x1595e4})[_0xf98b('0x28')](function(){return BPromise['each'](_0x92f291,function(_0x1d85cf){return db[_0xf98b('0x5a')][_0xf98b('0x72')]({'where':{'UserId':_0x1d85cf['id'],'OpenchannelQueueId':_0x2f935c[_0xf98b('0x4b')]['id']},'transaction':_0x1595e4});});})[_0xf98b('0x28')](function(){_0x92f291[_0xf98b('0x73')](function(_0x31cfc2){socket[_0xf98b('0x74')](_0xf98b('0x75'),{'UserId':_0x31cfc2['id'],'OpenchannelQueueId':_0x159f26['id']});});});});});}})[_0xf98b('0x28')](respondWithStatusCode(_0x501b52,null))['catch'](handleError(_0x501b52,null));};exports[_0xf98b('0x76')]=function(_0x18570c,_0x4b4d42,_0x159502){return db[_0xf98b('0x77')][_0xf98b('0x5d')]({'where':{'id':_0x18570c[_0xf98b('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf98b('0x5e')],'as':_0xf98b('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf98b('0x28')](handleEntityNotFound(_0x4b4d42,null))[_0xf98b('0x28')](function(_0x4b3dfd){var _0x428984=_[_0xf98b('0x32')](_0x4b3dfd,'id');var _0x32dd31=[];var _0x15726b=[];var _0x1a9e68=squel[_0xf98b('0x78')]();_0x1a9e68[_0xf98b('0x79')](_0xf98b('0x7a'))['from']('team_has_openchannel_queues','tq')['join'](_0xf98b('0x7b'),'ut',_0xf98b('0x7c'))[_0xf98b('0x41')](_0xf98b('0x7d'),_0x18570c[_0xf98b('0x4b')]['id']);for(var _0xc0920a=0x0;_0xc0920a<_0x4b3dfd[_0xf98b('0x3d')];_0xc0920a+=0x1){let _0x4499ca=_0x4b3dfd[_0xc0920a];for(var _0x2dbdf2=0x0;_0x2dbdf2<_0x4499ca[_0xf98b('0x6a')]['length'];_0x2dbdf2+=0x1){let _0x2d33b4=_0x4499ca['Agents'][_0x2dbdf2];var _0xf04e5=_0x1a9e68[_0xf98b('0x7e')]();_0xf04e5[_0xf98b('0x41')](_0xf98b('0x7f'),_0x2d33b4['id']);_0x15726b['push'](db[_0xf98b('0x6f')][_0xf98b('0x39')](_0xf04e5[_0xf98b('0x80')](),{'type':db[_0xf98b('0x6f')][_0xf98b('0x81')][_0xf98b('0x82')]})['then'](function(_0x7f30c6){if(_0x7f30c6[_0xf98b('0x3d')]===0x1){return _0x2d33b4['id'];}else{var _0x3d1141=_[_0xf98b('0x83')](_[_0xf98b('0x32')](_0x7f30c6,'TeamId'),function(_0x4f69ba){return _[_0xf98b('0x84')](_0x428984,_0x4f69ba);});if(_0x3d1141){return _0x2d33b4['id'];}}}));}}return BPromise['all'](_0x15726b)[_0xf98b('0x28')](function(_0x2aa31f){_0x32dd31=_(_0x32dd31)[_0xf98b('0x85')](_0x2aa31f)[_0xf98b('0x86')]()[_0xf98b('0x87')]();return db[_0xf98b('0x33')][_0xf98b('0x4e')]({'where':{'id':_0x18570c['params']['id']}})[_0xf98b('0x28')](function(_0x479691){return db[_0xf98b('0x6f')]['transaction'](function(_0x33c583){return _0x479691['removeTeams'](_0x18570c[_0xf98b('0x39')][_0xf98b('0x69')],{'transaction':_0x33c583})[_0xf98b('0x28')](function(){if(!_['isEmpty'](_0x32dd31)){return _0x479691[_0xf98b('0x88')](_0x32dd31,{'transaction':_0x33c583});}})[_0xf98b('0x28')](function(){_0x32dd31[_0xf98b('0x73')](function(_0x578fd3){socket[_0xf98b('0x74')](_0xf98b('0x89'),{'UserId':_0x578fd3,'OpenchannelQueueId':_0x479691['id']});});});});});});})['then'](respondWithStatusCode(_0x4b4d42,null))[_0xf98b('0x49')](handleError(_0x4b4d42,null));};exports[_0xf98b('0x8a')]=function(_0x21c4e0,_0x1142ff,_0x4511ba){return db[_0xf98b('0x33')][_0xf98b('0x4e')]({'where':{'id':_0x21c4e0[_0xf98b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1142ff,null))[_0xf98b('0x28')](function(_0x32bc90){if(_0x32bc90){return _0x32bc90['addAgents'](_0x21c4e0[_0xf98b('0x56')][_0xf98b('0x69')],_[_0xf98b('0x8b')](_0x21c4e0[_0xf98b('0x56')],[_0xf98b('0x69'),'id'])||{})[_0xf98b('0x8c')](function(_0xb28b43){for(var _0x3ce547=0x0;_0x3ce547<_0x21c4e0['body'][_0xf98b('0x69')][_0xf98b('0x3d')];_0x3ce547+=0x1){socket[_0xf98b('0x74')]('userOpenchannelQueue:save',{'UserId':Number(_0x21c4e0[_0xf98b('0x56')][_0xf98b('0x69')][_0x3ce547]),'OpenchannelQueueId':Number(_0x21c4e0[_0xf98b('0x4b')]['id'])});}return _0xb28b43;});}})[_0xf98b('0x28')](respondWithResult(_0x1142ff,null))[_0xf98b('0x49')](handleError(_0x1142ff,null));};exports[_0xf98b('0x88')]=function(_0x50934a,_0x531329,_0x56290a){return db['OpenchannelQueue']['find']({'where':{'id':_0x50934a[_0xf98b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x531329,null))['then'](function(_0x16d179){if(_0x16d179){return _0x16d179['removeAgents'](_0x50934a[_0xf98b('0x39')]['ids'])[_0xf98b('0x28')](function(){if(_[_0xf98b('0x8d')](_0x50934a[_0xf98b('0x39')][_0xf98b('0x69')])){for(var _0x903f48=0x0;_0x903f48<_0x50934a['query'][_0xf98b('0x69')][_0xf98b('0x3d')];_0x903f48+=0x1){socket[_0xf98b('0x74')](_0xf98b('0x89'),{'UserId':Number(_0x50934a[_0xf98b('0x39')]['ids'][_0x903f48]),'OpenchannelQueueId':Number(_0x50934a['params']['id'])});}}else{socket[_0xf98b('0x74')](_0xf98b('0x89'),{'UserId':Number(_0x50934a['query'][_0xf98b('0x69')]),'OpenchannelQueueId':Number(_0x50934a[_0xf98b('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x531329,null))[_0xf98b('0x49')](handleError(_0x531329,null));};exports[_0xf98b('0x8e')]=function(_0x2ce401,_0x580fa6,_0x2a702f){var _0x1c2dfe={};var _0x59015b={};var _0x37dd5f;var _0x36b16c;return db[_0xf98b('0x33')][_0xf98b('0x59')]({'where':{'id':_0x2ce401[_0xf98b('0x4b')]['id']}})[_0xf98b('0x28')](handleEntityNotFound(_0x580fa6,null))[_0xf98b('0x28')](function(_0x4ffb80){if(_0x4ffb80){_0x37dd5f=_0x4ffb80;_0x59015b[_0xf98b('0x38')]=_['keys'](db['User'][_0xf98b('0x34')]);_0x59015b['query']=_['keys'](_0x2ce401[_0xf98b('0x39')]);_0x59015b[_0xf98b('0x3a')]=_[_0xf98b('0x3b')](_0x59015b[_0xf98b('0x38')],_0x59015b['query']);_0x1c2dfe[_0xf98b('0x3c')]=_[_0xf98b('0x3b')](_0x59015b[_0xf98b('0x38')],qs[_0xf98b('0x4d')](_0x2ce401[_0xf98b('0x39')][_0xf98b('0x4d')]));_0x1c2dfe[_0xf98b('0x3c')]=_0x1c2dfe[_0xf98b('0x3c')][_0xf98b('0x3d')]?_0x1c2dfe['attributes']:_0x59015b[_0xf98b('0x38')];_0x1c2dfe[_0xf98b('0x3f')]=qs['sort'](_0x2ce401['query']['sort']);_0x1c2dfe[_0xf98b('0x41')]=qs[_0xf98b('0x3a')](_[_0xf98b('0x42')](_0x2ce401[_0xf98b('0x39')],_0x59015b[_0xf98b('0x3a')]));if(_0x2ce401[_0xf98b('0x39')][_0xf98b('0x43')]){_0x1c2dfe['where']=_[_0xf98b('0x44')](_0x1c2dfe['where'],{'$or':_['map'](_0x1c2dfe[_0xf98b('0x3c')],function(_0xd4a98f){var _0x35e59b={};_0x35e59b[_0xd4a98f]={'$like':'%'+_0x2ce401[_0xf98b('0x39')][_0xf98b('0x43')]+'%'};return _0x35e59b;})});}_0x1c2dfe=_[_0xf98b('0x44')]({},_0x1c2dfe,_0x2ce401[_0xf98b('0x46')]);return _0x37dd5f[_0xf98b('0x8e')](_0x1c2dfe);}})[_0xf98b('0x28')](function(_0x2e87f7){if(_0x2e87f7){_0x36b16c=_0x2e87f7[_0xf98b('0x3d')];if(!_0x2ce401[_0xf98b('0x39')][_0xf98b('0x3e')](_0xf98b('0x5b'))){_0x1c2dfe['limit']=qs[_0xf98b('0x20')](_0x2ce401['query'][_0xf98b('0x20')]);_0x1c2dfe[_0xf98b('0x1e')]=qs[_0xf98b('0x1e')](_0x2ce401[_0xf98b('0x39')]['offset']);}return _0x37dd5f[_0xf98b('0x8e')](_0x1c2dfe);}})[_0xf98b('0x28')](function(_0x17c54d){if(_0x17c54d){return _0x17c54d?{'count':_0x36b16c,'rows':_0x17c54d}:null;}})['then'](respondWithResult(_0x580fa6,null))['catch'](handleError(_0x580fa6,null));}; \ No newline at end of file +var _0x20b9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','include','OpenchannelQueue','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x34c857,_0xdce140){var _0x333149=function(_0x484b85){while(--_0x484b85){_0x34c857['push'](_0x34c857['shift']());}};_0x333149(++_0xdce140);}(_0x20b9,0x18e));var _0x920b=function(_0x311b4e,_0x38e028){_0x311b4e=_0x311b4e-0x0;var _0x3cdd2b=_0x20b9[_0x311b4e];return _0x3cdd2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x920b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x920b('0x1'));var rp=require(_0x920b('0x2'));var moment=require(_0x920b('0x3'));var BPromise=require(_0x920b('0x4'));var Mustache=require(_0x920b('0x5'));var util=require(_0x920b('0x6'));var path=require(_0x920b('0x7'));var sox=require(_0x920b('0x8'));var csv=require(_0x920b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x920b('0xa'));var _=require(_0x920b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x920b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x920b('0x9'));var querystring=require(_0x920b('0xd'));var Papa=require('papaparse');var Redis=require(_0x920b('0xe'));var authService=require(_0x920b('0xf'));var qs=require(_0x920b('0x10'));var as=require(_0x920b('0x11'));var hardwareService=require(_0x920b('0x12'));var logger=require(_0x920b('0x13'))('api');var utils=require(_0x920b('0x14'));var config=require(_0x920b('0x15'));var licenseUtil=require(_0x920b('0x16'));var db=require(_0x920b('0x17'))['db'];config[_0x920b('0x18')]=_[_0x920b('0x19')](config['redis'],{'host':_0x920b('0x1a'),'port':0x18eb});var socket=require(_0x920b('0x1b'))(new Redis(config[_0x920b('0x18')]));require(_0x920b('0x1c'))[_0x920b('0x1d')](socket);function respondWithStatusCode(_0x2ae674,_0x5e52f4){_0x5e52f4=_0x5e52f4||0xcc;return function(_0x5cbbab){if(_0x5cbbab){return _0x2ae674[_0x920b('0x1e')](_0x5e52f4);}return _0x2ae674[_0x920b('0x1f')](_0x5e52f4)[_0x920b('0x20')]();};}function respondWithResult(_0x24d637,_0x5f3f9d){_0x5f3f9d=_0x5f3f9d||0xc8;return function(_0x50bf51){if(_0x50bf51){return _0x24d637[_0x920b('0x1f')](_0x5f3f9d)[_0x920b('0x21')](_0x50bf51);}};}function respondWithFilteredResult(_0x5e9c51,_0x23b4c3){return function(_0x576335){if(_0x576335){var _0x296007=typeof _0x23b4c3['offset']===_0x920b('0x22')&&typeof _0x23b4c3[_0x920b('0x23')]===_0x920b('0x22');var _0x206ab5=_0x576335[_0x920b('0x24')];var _0x7325c8=_0x296007?0x0:_0x23b4c3[_0x920b('0x25')];var _0x1cc5c8=_0x296007?_0x576335[_0x920b('0x24')]:_0x23b4c3['offset']+_0x23b4c3[_0x920b('0x23')];var _0x5b9723;if(_0x1cc5c8>=_0x206ab5){_0x1cc5c8=_0x206ab5;_0x5b9723=0xc8;}else{_0x5b9723=0xce;}_0x5e9c51[_0x920b('0x1f')](_0x5b9723);return _0x5e9c51[_0x920b('0x26')]('Content-Range',_0x7325c8+'-'+_0x1cc5c8+'/'+_0x206ab5)['json'](_0x576335);}return null;};}function patchUpdates(_0x22c5e4){return function(_0x5c5b5f){try{jsonpatch['apply'](_0x5c5b5f,_0x22c5e4,!![]);}catch(_0x4ba82c){return BPromise[_0x920b('0x27')](_0x4ba82c);}return _0x5c5b5f[_0x920b('0x28')]();};}function saveUpdates(_0xfdbe77,_0x5527df){return function(_0x1cf5e9){if(_0x1cf5e9){return _0x1cf5e9[_0x920b('0x29')](_0xfdbe77)[_0x920b('0x2a')](function(_0xdf6eda){return _0xdf6eda;});}return null;};}function removeEntity(_0x288e85,_0xc39db1){return function(_0x563cb7){if(_0x563cb7){return _0x563cb7['destroy']()[_0x920b('0x2a')](function(){var _0x32bd01=_0x563cb7[_0x920b('0x2b')]({'plain':!![]});var _0x28a7e3=_0x920b('0x2c');return db[_0x920b('0x2d')][_0x920b('0x2e')]({'where':{'type':_0x28a7e3,'resourceId':_0x32bd01['id']}})[_0x920b('0x2a')](function(){return _0x563cb7;});})[_0x920b('0x2a')](function(){_0x288e85[_0x920b('0x1f')](0xcc)[_0x920b('0x20')]();});}};}function handleEntityNotFound(_0x1ba125,_0x11af15){return function(_0x5df575){if(!_0x5df575){_0x1ba125[_0x920b('0x1e')](0x194);}return _0x5df575;};}function handleError(_0x28b00e,_0x3df872){_0x3df872=_0x3df872||0x1f4;return function(_0x3db674){logger[_0x920b('0x2f')](_0x3db674['stack']);if(_0x3db674[_0x920b('0x30')]){delete _0x3db674[_0x920b('0x30')];}_0x28b00e[_0x920b('0x1f')](_0x3df872)['send'](_0x3db674);};}exports[_0x920b('0x31')]=function(_0x1f16af,_0x2d1ced){var _0x486827={},_0x2da801={},_0x42ec1b={'count':0x0,'rows':[]};var _0x3a03b7=_[_0x920b('0x32')](db['OpenchannelQueue'][_0x920b('0x33')],function(_0x22a16b){return{'name':_0x22a16b['fieldName'],'type':_0x22a16b[_0x920b('0x34')]['key']};});_0x2da801['model']=_[_0x920b('0x32')](_0x3a03b7,_0x920b('0x30'));_0x2da801[_0x920b('0x35')]=_[_0x920b('0x36')](_0x1f16af[_0x920b('0x35')]);_0x2da801[_0x920b('0x37')]=_[_0x920b('0x38')](_0x2da801[_0x920b('0x39')],_0x2da801['query']);_0x486827[_0x920b('0x3a')]=_[_0x920b('0x38')](_0x2da801[_0x920b('0x39')],qs[_0x920b('0x3b')](_0x1f16af['query'][_0x920b('0x3b')]));_0x486827[_0x920b('0x3a')]=_0x486827[_0x920b('0x3a')][_0x920b('0x3c')]?_0x486827[_0x920b('0x3a')]:_0x2da801[_0x920b('0x39')];if(!_0x1f16af[_0x920b('0x35')][_0x920b('0x3d')](_0x920b('0x3e'))){_0x486827[_0x920b('0x23')]=qs['limit'](_0x1f16af['query'][_0x920b('0x23')]);_0x486827[_0x920b('0x25')]=qs[_0x920b('0x25')](_0x1f16af['query'][_0x920b('0x25')]);}_0x486827[_0x920b('0x3f')]=qs[_0x920b('0x40')](_0x1f16af[_0x920b('0x35')][_0x920b('0x40')]);_0x486827['where']=qs['filters'](_[_0x920b('0x41')](_0x1f16af[_0x920b('0x35')],_0x2da801[_0x920b('0x37')]),_0x3a03b7);if(_0x1f16af[_0x920b('0x35')]['filter']){_0x486827[_0x920b('0x42')]=_[_0x920b('0x43')](_0x486827[_0x920b('0x42')],{'$or':_[_0x920b('0x32')](_0x3a03b7,function(_0x15d8ed){if(_0x15d8ed[_0x920b('0x34')]!=='VIRTUAL'){var _0x3263cf={};_0x3263cf[_0x15d8ed[_0x920b('0x30')]]={'$like':'%'+_0x1f16af[_0x920b('0x35')][_0x920b('0x44')]+'%'};return _0x3263cf;}})});}_0x486827=_[_0x920b('0x43')]({},_0x486827,_0x1f16af[_0x920b('0x45')]);var _0x6abda={'where':_0x486827['where']};return db['OpenchannelQueue'][_0x920b('0x24')](_0x6abda)[_0x920b('0x2a')](function(_0x462a94){_0x42ec1b[_0x920b('0x24')]=_0x462a94;if(_0x1f16af[_0x920b('0x35')]['includeAll']){_0x486827[_0x920b('0x46')]=[{'all':!![]}];}return db[_0x920b('0x47')][_0x920b('0x48')](_0x486827);})[_0x920b('0x2a')](function(_0x16e33f){_0x42ec1b[_0x920b('0x49')]=_0x16e33f;return _0x42ec1b;})[_0x920b('0x2a')](respondWithFilteredResult(_0x2d1ced,_0x486827))[_0x920b('0x4a')](handleError(_0x2d1ced,null));};exports[_0x920b('0x4b')]=function(_0x55729a,_0x10b979){var _0x566bd9={'raw':!![],'where':{'id':_0x55729a['params']['id']}},_0x57c5e0={};_0x57c5e0['model']=_[_0x920b('0x36')](db['OpenchannelQueue']['rawAttributes']);_0x57c5e0[_0x920b('0x35')]=_[_0x920b('0x36')](_0x55729a[_0x920b('0x35')]);_0x57c5e0[_0x920b('0x37')]=_[_0x920b('0x38')](_0x57c5e0[_0x920b('0x39')],_0x57c5e0[_0x920b('0x35')]);_0x566bd9[_0x920b('0x3a')]=_['intersection'](_0x57c5e0['model'],qs[_0x920b('0x3b')](_0x55729a[_0x920b('0x35')][_0x920b('0x3b')]));_0x566bd9[_0x920b('0x3a')]=_0x566bd9[_0x920b('0x3a')]['length']?_0x566bd9[_0x920b('0x3a')]:_0x57c5e0[_0x920b('0x39')];if(_0x55729a[_0x920b('0x35')][_0x920b('0x4c')]){_0x566bd9['include']=[{'all':!![]}];}_0x566bd9=_[_0x920b('0x43')]({},_0x566bd9,_0x55729a[_0x920b('0x45')]);return db['OpenchannelQueue'][_0x920b('0x4d')](_0x566bd9)[_0x920b('0x2a')](handleEntityNotFound(_0x10b979,null))[_0x920b('0x2a')](respondWithResult(_0x10b979,null))[_0x920b('0x4a')](handleError(_0x10b979,null));};exports[_0x920b('0x4e')]=function(_0x30581e,_0x3a8721){return db['OpenchannelQueue']['create'](_0x30581e[_0x920b('0x4f')],{})[_0x920b('0x2a')](function(_0x4e979f){var _0x103f5c=_0x30581e[_0x920b('0x50')][_0x920b('0x2b')]({'plain':!![]});if(!_0x103f5c)throw new Error(_0x920b('0x51'));if(_0x103f5c[_0x920b('0x52')]===_0x920b('0x50')){var _0x11be27=_0x4e979f[_0x920b('0x2b')]({'plain':!![]});var _0x5820f8=_0x920b('0x2c');return db[_0x920b('0x53')][_0x920b('0x4d')]({'where':{'name':_0x5820f8,'userProfileId':_0x103f5c[_0x920b('0x54')]},'raw':!![]})[_0x920b('0x2a')](function(_0x1ca41e){if(_0x1ca41e&&_0x1ca41e[_0x920b('0x55')]===0x0){return db['UserProfileResource'][_0x920b('0x4e')]({'name':_0x11be27[_0x920b('0x30')],'resourceId':_0x11be27['id'],'type':_0x1ca41e[_0x920b('0x30')],'sectionId':_0x1ca41e['id']},{})['then'](function(){return _0x4e979f;});}else{return _0x4e979f;}})[_0x920b('0x4a')](function(_0x3a9515){logger[_0x920b('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a9515);throw _0x3a9515;});}return _0x4e979f;})[_0x920b('0x2a')](respondWithResult(_0x3a8721,0xc9))['catch'](handleError(_0x3a8721,null));};exports[_0x920b('0x29')]=function(_0x7b484f,_0x1e4ab5){if(_0x7b484f[_0x920b('0x4f')]['id']){delete _0x7b484f[_0x920b('0x4f')]['id'];}return db[_0x920b('0x47')][_0x920b('0x4d')]({'where':{'id':_0x7b484f['params']['id']}})['then'](handleEntityNotFound(_0x1e4ab5,null))['then'](saveUpdates(_0x7b484f[_0x920b('0x4f')],null))[_0x920b('0x2a')](respondWithResult(_0x1e4ab5,null))['catch'](handleError(_0x1e4ab5,null));};exports['destroy']=function(_0x1bda43,_0x48300f){return db[_0x920b('0x47')][_0x920b('0x4d')]({'where':{'id':_0x1bda43[_0x920b('0x56')]['id']}})[_0x920b('0x2a')](handleEntityNotFound(_0x48300f,null))[_0x920b('0x2a')](removeEntity(_0x48300f,null))[_0x920b('0x4a')](handleError(_0x48300f,null));};exports[_0x920b('0x57')]=function(_0x54141c,_0x5311e9){return db['OpenchannelQueue'][_0x920b('0x57')]()[_0x920b('0x2a')](respondWithResult(_0x5311e9,null))[_0x920b('0x4a')](handleError(_0x5311e9,null));};exports['getMembers']=function(_0x54f066,_0xb73115,_0x416f13){var _0x78846c={'raw':!![],'where':{}},_0x94b3c5={},_0x2ece85;return db['OpenchannelQueue'][_0x920b('0x58')]({'where':{'id':_0x54f066[_0x920b('0x56')]['id']}})[_0x920b('0x2a')](handleEntityNotFound(_0xb73115,null))[_0x920b('0x2a')](function(_0x242c2f){if(_0x242c2f){_0x2ece85=_0x242c2f[_0x920b('0x2b')]({'plain':!![]});_0x94b3c5['model']=_[_0x920b('0x36')](db[_0x920b('0x59')][_0x920b('0x33')]);_0x94b3c5[_0x920b('0x35')]=_[_0x920b('0x36')](_0x54f066['query']);_0x94b3c5[_0x920b('0x37')]=_['intersection'](_0x94b3c5[_0x920b('0x39')],_0x94b3c5[_0x920b('0x35')]);_0x78846c[_0x920b('0x3a')]=_[_0x920b('0x38')](_0x94b3c5[_0x920b('0x39')],qs[_0x920b('0x3b')](_0x54f066['query'][_0x920b('0x3b')]));_0x78846c['attributes']=_0x78846c['attributes'][_0x920b('0x3c')]?_0x78846c[_0x920b('0x3a')]:_0x94b3c5['model'];if(!_0x54f066[_0x920b('0x35')][_0x920b('0x3d')](_0x920b('0x3e'))){_0x78846c[_0x920b('0x23')]=qs[_0x920b('0x23')](_0x54f066[_0x920b('0x35')][_0x920b('0x23')]);_0x78846c['offset']=qs[_0x920b('0x25')](_0x54f066['query'][_0x920b('0x25')]);}_0x78846c['order']=qs[_0x920b('0x40')](_0x54f066['query'][_0x920b('0x40')]);_0x78846c['where']=qs[_0x920b('0x37')](_['pick'](_0x54f066[_0x920b('0x35')],_0x94b3c5['filters']));_0x78846c[_0x920b('0x42')][_0x920b('0x5a')]=_0x242c2f['id'];if(_0x54f066[_0x920b('0x35')][_0x920b('0x44')]){_0x78846c['where']=_[_0x920b('0x43')](_0x78846c[_0x920b('0x42')],{'$or':_['map'](_0x78846c[_0x920b('0x3a')],function(_0x4f6268){var _0x6e9cb6={};_0x6e9cb6[_0x4f6268]={'$like':'%'+_0x54f066['query'][_0x920b('0x44')]+'%'};return _0x6e9cb6;})});}_0x78846c=_[_0x920b('0x43')]({},_0x78846c,_0x54f066[_0x920b('0x45')]);return db[_0x920b('0x59')][_0x920b('0x48')](_0x78846c);}})[_0x920b('0x2a')](function(_0x14a0a5){if(_0x14a0a5){return db[_0x920b('0x5b')]['findAndCountAll']({'where':{'id':_[_0x920b('0x32')](_0x14a0a5,_0x920b('0x5c')),'role':'agent'},'attributes':['id',_0x920b('0x30'),_0x920b('0x5d'),_0x920b('0x5e'),_0x920b('0x5f')]});}})['then'](function(_0x15a163){if(_0x15a163){return{'count':_0x15a163['count'],'rows':_[_0x920b('0x32')](_0x15a163['rows'],function(_0x235703){return{'membername':_0x235703[_0x920b('0x30')],'UserId':_0x235703['id'],'queue_name':_0x2ece85['name'],'OpenchannelQueueId':_0x2ece85['id'],'interface':util[_0x920b('0x60')]('%s/%s',_0x920b('0x61'),_0x235703[_0x920b('0x30')]),'penalty':0x0,'paused':_0x235703[_0x920b('0x5d')],'createdAt':_0x235703[_0x920b('0x5f')],'updatedAt':_0x235703[_0x920b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb73115,_0x78846c))['catch'](handleError(_0xb73115,null));};exports[_0x920b('0x62')]=function(_0x498c86,_0xf29a7,_0xc36b9){var _0x4b9db3={};var _0x22767a={};var _0x1d542c;var _0x41b136;return db[_0x920b('0x47')]['findOne']({'where':{'id':_0x498c86['params']['id']}})[_0x920b('0x2a')](handleEntityNotFound(_0xf29a7,null))[_0x920b('0x2a')](function(_0xc32820){if(_0xc32820){_0x1d542c=_0xc32820;_0x22767a[_0x920b('0x39')]=_[_0x920b('0x36')](db[_0x920b('0x63')][_0x920b('0x33')]);_0x22767a['query']=_['keys'](_0x498c86['query']);_0x22767a['filters']=_[_0x920b('0x38')](_0x22767a['model'],_0x22767a[_0x920b('0x35')]);_0x4b9db3['attributes']=_['intersection'](_0x22767a[_0x920b('0x39')],qs[_0x920b('0x3b')](_0x498c86[_0x920b('0x35')][_0x920b('0x3b')]));_0x4b9db3[_0x920b('0x3a')]=_0x4b9db3['attributes'][_0x920b('0x3c')]?_0x4b9db3[_0x920b('0x3a')]:_0x22767a[_0x920b('0x39')];_0x4b9db3[_0x920b('0x3f')]=qs[_0x920b('0x40')](_0x498c86[_0x920b('0x35')]['sort']);_0x4b9db3[_0x920b('0x42')]=qs[_0x920b('0x37')](_['pick'](_0x498c86[_0x920b('0x35')],_0x22767a[_0x920b('0x37')]));if(_0x498c86[_0x920b('0x35')][_0x920b('0x44')]){_0x4b9db3[_0x920b('0x42')]=_[_0x920b('0x43')](_0x4b9db3[_0x920b('0x42')],{'$or':_[_0x920b('0x32')](_0x4b9db3[_0x920b('0x3a')],function(_0xb781e6){var _0x2ab813={};_0x2ab813[_0xb781e6]={'$like':'%'+_0x498c86['query'][_0x920b('0x44')]+'%'};return _0x2ab813;})});}_0x4b9db3=_['merge']({},_0x4b9db3,_0x498c86['options']);return _0x1d542c[_0x920b('0x62')](_0x4b9db3);}})[_0x920b('0x2a')](function(_0x5cddb6){if(_0x5cddb6){_0x41b136=_0x5cddb6['length'];if(!_0x498c86[_0x920b('0x35')][_0x920b('0x3d')](_0x920b('0x3e'))){_0x4b9db3[_0x920b('0x23')]=qs[_0x920b('0x23')](_0x498c86[_0x920b('0x35')][_0x920b('0x23')]);_0x4b9db3[_0x920b('0x25')]=qs['offset'](_0x498c86[_0x920b('0x35')][_0x920b('0x25')]);}return _0x1d542c['getTeams'](_0x4b9db3);}})[_0x920b('0x2a')](function(_0x4067d1){if(_0x4067d1){return _0x4067d1?{'count':_0x41b136,'rows':_0x4067d1}:null;}})['then'](respondWithResult(_0xf29a7,null))['catch'](handleError(_0xf29a7,null));};exports[_0x920b('0x64')]=function(_0x46406d,_0x58d796,_0x1fb951){var _0x2037ea=_0x46406d['body'][_0x920b('0x65')];return db[_0x920b('0x63')][_0x920b('0x48')]({'where':{'id':_0x2037ea},'attributes':['id'],'include':[{'model':db[_0x920b('0x5b')],'as':'Agents','attributes':['id','name','online',_0x920b('0x66'),_0x920b('0x67')],'raw':!![]}]})[_0x920b('0x2a')](function(_0x4c1ad4){if(_0x4c1ad4){var _0x3a2de3=_[_0x920b('0x68')](_0x4c1ad4,function(_0x34b2b4){var _0x2888e8=_0x34b2b4[_0x920b('0x2b')]({'plain':!![]});return _0x2888e8[_0x920b('0x69')];});return db[_0x920b('0x47')]['find']({'where':{'id':_0x46406d[_0x920b('0x56')]['id']}})['then'](function(_0x4d0f4d){return db[_0x920b('0x6a')]['transaction'](function(_0x53d806){return _0x4d0f4d[_0x920b('0x64')](_0x2037ea,{'transaction':_0x53d806})[_0x920b('0x2a')](function(){return BPromise[_0x920b('0x6b')](_0x3a2de3,function(_0x32ad40){return db[_0x920b('0x59')][_0x920b('0x6c')]({'where':{'UserId':_0x32ad40['id'],'OpenchannelQueueId':_0x46406d[_0x920b('0x56')]['id']},'transaction':_0x53d806});});})[_0x920b('0x2a')](function(){_0x3a2de3[_0x920b('0x6d')](function(_0x30ffca){socket[_0x920b('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x30ffca['id'],'OpenchannelQueueId':_0x4d0f4d['id']});});});});});}})[_0x920b('0x2a')](respondWithStatusCode(_0x58d796,null))[_0x920b('0x4a')](handleError(_0x58d796,null));};exports[_0x920b('0x6f')]=function(_0x468412,_0x2d5f54,_0x182af1){return db[_0x920b('0x63')]['findAll']({'where':{'id':_0x468412[_0x920b('0x35')][_0x920b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x920b('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x920b('0x2a')](handleEntityNotFound(_0x2d5f54,null))[_0x920b('0x2a')](function(_0x173291){var _0x125cae=_[_0x920b('0x32')](_0x173291,'id');var _0x5c7482=[];var _0x440f65=[];var _0x17d845=squel[_0x920b('0x70')]();_0x17d845[_0x920b('0x71')]('tq.TeamId')[_0x920b('0x72')](_0x920b('0x73'),'tq')[_0x920b('0x74')](_0x920b('0x75'),'ut',_0x920b('0x76'))[_0x920b('0x42')](_0x920b('0x77'),_0x468412[_0x920b('0x56')]['id']);for(var _0x9a85f5=0x0;_0x9a85f5<_0x173291['length'];_0x9a85f5+=0x1){let _0x401fcd=_0x173291[_0x9a85f5];for(var _0x357baf=0x0;_0x357baf<_0x401fcd['Agents'][_0x920b('0x3c')];_0x357baf+=0x1){let _0x409648=_0x401fcd[_0x920b('0x69')][_0x357baf];var _0x260579=_0x17d845[_0x920b('0x78')]();_0x260579[_0x920b('0x42')](_0x920b('0x79'),_0x409648['id']);_0x440f65['push'](db[_0x920b('0x6a')][_0x920b('0x35')](_0x260579[_0x920b('0x7a')](),{'type':db[_0x920b('0x6a')][_0x920b('0x7b')][_0x920b('0x7c')]})[_0x920b('0x2a')](function(_0x2c8cad){if(_0x2c8cad[_0x920b('0x3c')]===0x1){return _0x409648['id'];}else{var _0x57e17e=_[_0x920b('0x7d')](_[_0x920b('0x32')](_0x2c8cad,_0x920b('0x7e')),function(_0x568540){return _['includes'](_0x125cae,_0x568540);});if(_0x57e17e){return _0x409648['id'];}}}));}}return BPromise['all'](_0x440f65)['then'](function(_0x48a115){_0x5c7482=_(_0x5c7482)[_0x920b('0x7f')](_0x48a115)[_0x920b('0x80')]()[_0x920b('0x81')]();return db[_0x920b('0x47')][_0x920b('0x4d')]({'where':{'id':_0x468412['params']['id']}})[_0x920b('0x2a')](function(_0x1cfd15){return db[_0x920b('0x6a')][_0x920b('0x82')](function(_0x5898f4){return _0x1cfd15[_0x920b('0x6f')](_0x468412[_0x920b('0x35')][_0x920b('0x65')],{'transaction':_0x5898f4})[_0x920b('0x2a')](function(){if(!_[_0x920b('0x83')](_0x5c7482)){return _0x1cfd15[_0x920b('0x84')](_0x5c7482,{'transaction':_0x5898f4});}})['then'](function(){_0x5c7482[_0x920b('0x6d')](function(_0x354a25){socket['emit'](_0x920b('0x85'),{'UserId':_0x354a25,'OpenchannelQueueId':_0x1cfd15['id']});});});});});});})[_0x920b('0x2a')](respondWithStatusCode(_0x2d5f54,null))[_0x920b('0x4a')](handleError(_0x2d5f54,null));};exports[_0x920b('0x86')]=function(_0x27b121,_0x34831e,_0x431b7d){return db[_0x920b('0x47')][_0x920b('0x4d')]({'where':{'id':_0x27b121[_0x920b('0x56')]['id']}})[_0x920b('0x2a')](handleEntityNotFound(_0x34831e,null))['then'](function(_0x1f9571){if(_0x1f9571){return _0x1f9571[_0x920b('0x86')](_0x27b121[_0x920b('0x4f')][_0x920b('0x65')],_[_0x920b('0x87')](_0x27b121[_0x920b('0x4f')],[_0x920b('0x65'),'id'])||{})['spread'](function(_0x40dcca){for(var _0x1131ca=0x0;_0x1131ca<_0x27b121[_0x920b('0x4f')]['ids'][_0x920b('0x3c')];_0x1131ca+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x27b121[_0x920b('0x4f')]['ids'][_0x1131ca]),'OpenchannelQueueId':Number(_0x27b121['params']['id'])});}return _0x40dcca;});}})[_0x920b('0x2a')](respondWithResult(_0x34831e,null))[_0x920b('0x4a')](handleError(_0x34831e,null));};exports[_0x920b('0x84')]=function(_0x396857,_0x505bee,_0x285620){return db['OpenchannelQueue']['find']({'where':{'id':_0x396857[_0x920b('0x56')]['id']}})[_0x920b('0x2a')](handleEntityNotFound(_0x505bee,null))['then'](function(_0x483665){if(_0x483665){return _0x483665[_0x920b('0x84')](_0x396857[_0x920b('0x35')][_0x920b('0x65')])[_0x920b('0x2a')](function(){if(_[_0x920b('0x88')](_0x396857[_0x920b('0x35')]['ids'])){for(var _0x1d3fab=0x0;_0x1d3fab<_0x396857[_0x920b('0x35')][_0x920b('0x65')][_0x920b('0x3c')];_0x1d3fab+=0x1){socket[_0x920b('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x396857[_0x920b('0x35')]['ids'][_0x1d3fab]),'OpenchannelQueueId':Number(_0x396857[_0x920b('0x56')]['id'])});}}else{socket[_0x920b('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x396857[_0x920b('0x35')][_0x920b('0x65')]),'OpenchannelQueueId':Number(_0x396857[_0x920b('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x505bee,null))[_0x920b('0x4a')](handleError(_0x505bee,null));};exports[_0x920b('0x89')]=function(_0x29cafe,_0x456e00,_0x19884b){var _0x34171f={};var _0x5e694a={};var _0x271ba3;var _0x574fbe;return db[_0x920b('0x47')][_0x920b('0x58')]({'where':{'id':_0x29cafe[_0x920b('0x56')]['id']}})['then'](handleEntityNotFound(_0x456e00,null))[_0x920b('0x2a')](function(_0x52bc25){if(_0x52bc25){_0x271ba3=_0x52bc25;_0x5e694a[_0x920b('0x39')]=_[_0x920b('0x36')](db[_0x920b('0x5b')]['rawAttributes']);_0x5e694a[_0x920b('0x35')]=_['keys'](_0x29cafe[_0x920b('0x35')]);_0x5e694a['filters']=_[_0x920b('0x38')](_0x5e694a[_0x920b('0x39')],_0x5e694a[_0x920b('0x35')]);_0x34171f[_0x920b('0x3a')]=_[_0x920b('0x38')](_0x5e694a[_0x920b('0x39')],qs[_0x920b('0x3b')](_0x29cafe['query'][_0x920b('0x3b')]));_0x34171f[_0x920b('0x3a')]=_0x34171f['attributes'][_0x920b('0x3c')]?_0x34171f[_0x920b('0x3a')]:_0x5e694a[_0x920b('0x39')];_0x34171f[_0x920b('0x3f')]=qs[_0x920b('0x40')](_0x29cafe['query'][_0x920b('0x40')]);_0x34171f[_0x920b('0x42')]=qs[_0x920b('0x37')](_['pick'](_0x29cafe[_0x920b('0x35')],_0x5e694a[_0x920b('0x37')]));if(_0x29cafe[_0x920b('0x35')][_0x920b('0x44')]){_0x34171f[_0x920b('0x42')]=_['merge'](_0x34171f['where'],{'$or':_[_0x920b('0x32')](_0x34171f[_0x920b('0x3a')],function(_0x5c5c77){var _0x3696b3={};_0x3696b3[_0x5c5c77]={'$like':'%'+_0x29cafe['query'][_0x920b('0x44')]+'%'};return _0x3696b3;})});}_0x34171f=_['merge']({},_0x34171f,_0x29cafe[_0x920b('0x45')]);return _0x271ba3[_0x920b('0x89')](_0x34171f);}})[_0x920b('0x2a')](function(_0x11eefb){if(_0x11eefb){_0x574fbe=_0x11eefb[_0x920b('0x3c')];if(!_0x29cafe[_0x920b('0x35')][_0x920b('0x3d')](_0x920b('0x3e'))){_0x34171f[_0x920b('0x23')]=qs[_0x920b('0x23')](_0x29cafe[_0x920b('0x35')]['limit']);_0x34171f[_0x920b('0x25')]=qs[_0x920b('0x25')](_0x29cafe[_0x920b('0x35')]['offset']);}return _0x271ba3[_0x920b('0x89')](_0x34171f);}})[_0x920b('0x2a')](function(_0x4ef2ef){if(_0x4ef2ef){return _0x4ef2ef?{'count':_0x574fbe,'rows':_0x4ef2ef}:null;}})[_0x920b('0x2a')](respondWithResult(_0x456e00,null))[_0x920b('0x4a')](handleError(_0x456e00,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 59ee4ec..5888ee8 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 _0xde6a=['hook','exports','events','OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1e98c9,_0x339fc5){var _0x548276=function(_0x5bac9f){while(--_0x5bac9f){_0x1e98c9['push'](_0x1e98c9['shift']());}};_0x548276(++_0x339fc5);}(_0xde6a,0x1df));var _0xade6=function(_0x57e377,_0x1ef1b0){_0x57e377=_0x57e377-0x0;var _0x1937c0=_0xde6a[_0x57e377];return _0x1937c0;};'use strict';var EventEmitter=require(_0xade6('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xade6('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xade6('0x2')](0x0);var events={'afterCreate':_0xade6('0x3'),'afterUpdate':_0xade6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e9826){return function(_0x2f3aaf,_0x1fde08,_0x45d748){OpenchannelQueueEvents[_0xade6('0x5')](_0x5e9826+':'+_0x2f3aaf['id'],_0x2f3aaf);OpenchannelQueueEvents[_0xade6('0x5')](_0x5e9826,_0x2f3aaf);_0x45d748(null);};}for(var e in events){if(events[_0xade6('0x6')](e)){var event=events[e];OpenchannelQueue[_0xade6('0x7')](e,emitEvent(event));}}module[_0xade6('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe3a5=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x2dae84,_0x530729){var _0x2c11d2=function(_0x4104f8){while(--_0x4104f8){_0x2dae84['push'](_0x2dae84['shift']());}};_0x2c11d2(++_0x530729);}(_0xe3a5,0x6c));var _0x5e3a=function(_0x22cd0f,_0xc8b7c0){_0x22cd0f=_0x22cd0f-0x0;var _0x24d3c6=_0xe3a5[_0x22cd0f];return _0x24d3c6;};'use strict';var EventEmitter=require(_0x5e3a('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5e3a('0x1')](0x0);var events={'afterCreate':_0x5e3a('0x2'),'afterUpdate':_0x5e3a('0x3'),'afterDestroy':_0x5e3a('0x4')};function emitEvent(_0xdea9ea){return function(_0x176b5c,_0x3dd153,_0x59b743){OpenchannelQueueEvents[_0x5e3a('0x5')](_0xdea9ea+':'+_0x176b5c['id'],_0x176b5c);OpenchannelQueueEvents[_0x5e3a('0x5')](_0xdea9ea,_0x176b5c);_0x59b743(null);};}for(var e in events){if(events[_0x5e3a('0x6')](e)){var event=events[e];OpenchannelQueue[_0x5e3a('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f5ff343..29766e9 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 _0x32bd=['moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','lodash','api'];(function(_0x3f0dda,_0x342566){var _0x42a632=function(_0xdcfb){while(--_0xdcfb){_0x3f0dda['push'](_0x3f0dda['shift']());}};_0x42a632(++_0x342566);}(_0x32bd,0x1db));var _0xd32b=function(_0x471b0b,_0x94cb4c){_0x471b0b=_0x471b0b-0x0;var _0x521a4e=_0x32bd[_0x471b0b];return _0x521a4e;};'use strict';var _=require(_0xd32b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd32b('0x1'));var moment=require(_0xd32b('0x2'));var BPromise=require(_0xd32b('0x3'));var rp=require(_0xd32b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd32b('0x5'));var config=require(_0xd32b('0x6'));var attributes=require(_0xd32b('0x7'));module['exports']=function(_0x2ea58c,_0x332708){return _0x2ea58c[_0xd32b('0x8')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc765=['bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xc765,0xec));var _0x5c76=function(_0x232a6c,_0x22572e){_0x232a6c=_0x232a6c-0x0;var _0x17cf55=_0xc765[_0x232a6c];return _0x17cf55;};'use strict';var _=require(_0x5c76('0x0'));var util=require('util');var logger=require(_0x5c76('0x1'))(_0x5c76('0x2'));var moment=require(_0x5c76('0x3'));var BPromise=require(_0x5c76('0x4'));var rp=require(_0x5c76('0x5'));var fs=require('fs');var path=require(_0x5c76('0x6'));var rimraf=require(_0x5c76('0x7'));var config=require('../../config/environment');var attributes=require(_0x5c76('0x8'));module['exports']=function(_0x3b0de0,_0x485251){return _0x3b0de0[_0x5c76('0x9')](_0x5c76('0xa'),attributes,{'tableName':_0x5c76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index a19294b..acad70d 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 _0xdd00=['defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','code','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','find','stringify','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x15d572,_0x5785ba){var _0x35d485=function(_0x3d9258){while(--_0x3d9258){_0x15d572['push'](_0x15d572['shift']());}};_0x35d485(++_0x5785ba);}(_0xdd00,0x18e));var _0x0dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0dd0('0x0'));var util=require(_0x0dd0('0x1'));var moment=require(_0x0dd0('0x2'));var BPromise=require(_0x0dd0('0x3'));var rs=require(_0x0dd0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dd0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0dd0('0x6'))('rpc');var config=require(_0x0dd0('0x7'));var jayson=require(_0x0dd0('0x8'));var client=jayson[_0x0dd0('0x9')][_0x0dd0('0xa')]({'port':0x232a});config[_0x0dd0('0xb')]=_[_0x0dd0('0xc')](config[_0x0dd0('0xb')],{'host':_0x0dd0('0xd'),'port':0x18eb});var socket=require(_0x0dd0('0xe'))(new Redis(config[_0x0dd0('0xb')]));require('./openchannelQueue.socket')[_0x0dd0('0xf')](socket);function respondWithRpcPromise(_0x11b9f2,_0x52b47e,_0x1bdb03){return new BPromise(function(_0x38aef5,_0x474776){return client[_0x0dd0('0x10')](_0x11b9f2,_0x1bdb03)[_0x0dd0('0x11')](function(_0x3d79c7){logger[_0x0dd0('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x52b47e,_0x0dd0('0x13'));logger[_0x0dd0('0x14')](_0x0dd0('0x15'),_0x52b47e,_0x0dd0('0x13'),JSON['stringify'](_0x3d79c7));if(_0x3d79c7['error']){if(_0x3d79c7['error'][_0x0dd0('0x16')]===0x1f4){logger[_0x0dd0('0x17')](_0x0dd0('0x18'),_0x52b47e,_0x3d79c7[_0x0dd0('0x17')][_0x0dd0('0x19')]);return _0x474776(_0x3d79c7[_0x0dd0('0x17')][_0x0dd0('0x19')]);}logger[_0x0dd0('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x52b47e,_0x3d79c7['error'][_0x0dd0('0x19')]);return _0x38aef5(_0x3d79c7['error'][_0x0dd0('0x19')]);}else{logger[_0x0dd0('0x12')](_0x0dd0('0x18'),_0x52b47e,_0x0dd0('0x13'));_0x38aef5(_0x3d79c7['result'][_0x0dd0('0x19')]);}})[_0x0dd0('0x1a')](function(_0x3bf01f){logger[_0x0dd0('0x17')](_0x0dd0('0x18'),_0x52b47e,_0x3bf01f);_0x474776(_0x3bf01f);});});}exports['GetOpenchannelQueue']=function(_0x12e774){var _0x2af83b=this;return new Promise(function(_0x2a20a4,_0x3971ee){return db[_0x0dd0('0x1b')][_0x0dd0('0x1c')]({'raw':_0x12e774[_0x0dd0('0x1d')]?_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x1e')]===undefined?!![]:![]:!![],'where':_0x12e774[_0x0dd0('0x1d')]?_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x1f')]||null:null,'attributes':_0x12e774[_0x0dd0('0x1d')]?_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x20')]||null:null,'limit':_0x12e774['options']?_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x21')]||null:null,'include':_0x12e774[_0x0dd0('0x1d')]?_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x22')]?_[_0x0dd0('0x23')](_0x12e774[_0x0dd0('0x1d')][_0x0dd0('0x22')],function(_0x472617){return{'model':db[_0x472617[_0x0dd0('0x24')]],'as':_0x472617['as'],'attributes':_0x472617[_0x0dd0('0x20')],'include':_0x472617[_0x0dd0('0x22')]?_['map'](_0x472617['include'],function(_0x13b840){return{'model':db[_0x13b840[_0x0dd0('0x24')]],'as':_0x13b840['as'],'attributes':_0x13b840[_0x0dd0('0x20')],'include':_0x13b840['include']?_[_0x0dd0('0x23')](_0x13b840[_0x0dd0('0x22')],function(_0x1da22b){return{'model':db[_0x1da22b[_0x0dd0('0x24')]],'as':_0x1da22b['as'],'attributes':_0x1da22b['attributes']};}):[]};}):[]};}):[]:[]})[_0x0dd0('0x11')](function(_0x2cef15){logger[_0x0dd0('0x12')](_0x0dd0('0x25'),_0x12e774);logger[_0x0dd0('0x14')](_0x0dd0('0x25'),_0x12e774,JSON['stringify'](_0x2cef15));_0x2a20a4(_0x2cef15);})[_0x0dd0('0x1a')](function(_0x3580eb){logger[_0x0dd0('0x17')]('GetOpenchannelQueue',_0x3580eb[_0x0dd0('0x19')],_0x12e774);_0x3971ee(_0x2af83b[_0x0dd0('0x17')](0x1f4,_0x3580eb[_0x0dd0('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x14930e){var _0xa98753=this;return new Promise(function(_0x808572,_0x3d35f2){return db[_0x0dd0('0x1b')][_0x0dd0('0x26')]({'raw':_0x14930e[_0x0dd0('0x1d')]?_0x14930e[_0x0dd0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x14930e[_0x0dd0('0x1d')]?_0x14930e[_0x0dd0('0x1d')]['where']||null:null,'attributes':_0x14930e['options']?_0x14930e[_0x0dd0('0x1d')]['attributes']||null:null,'include':_0x14930e[_0x0dd0('0x1d')]?_0x14930e[_0x0dd0('0x1d')][_0x0dd0('0x22')]?_[_0x0dd0('0x23')](_0x14930e['options'][_0x0dd0('0x22')],function(_0x3d1c20){return{'model':db[_0x3d1c20[_0x0dd0('0x24')]],'as':_0x3d1c20['as'],'attributes':_0x3d1c20['attributes'],'include':_0x3d1c20[_0x0dd0('0x22')]?_[_0x0dd0('0x23')](_0x3d1c20[_0x0dd0('0x22')],function(_0x5e1f26){return{'model':db[_0x5e1f26[_0x0dd0('0x24')]],'as':_0x5e1f26['as'],'attributes':_0x5e1f26[_0x0dd0('0x20')],'include':_0x5e1f26[_0x0dd0('0x22')]?_[_0x0dd0('0x23')](_0x5e1f26['include'],function(_0x13a70a){return{'model':db[_0x13a70a[_0x0dd0('0x24')]],'as':_0x13a70a['as'],'attributes':_0x13a70a[_0x0dd0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bbd24){logger[_0x0dd0('0x12')]('ShowOpenchannelQueue',_0x14930e);logger[_0x0dd0('0x14')]('ShowOpenchannelQueue',_0x14930e,JSON[_0x0dd0('0x27')](_0x4bbd24));_0x808572(_0x4bbd24);})[_0x0dd0('0x1a')](function(_0x61bcfc){logger[_0x0dd0('0x17')](_0x0dd0('0x28'),_0x61bcfc[_0x0dd0('0x19')],_0x14930e);_0x3d35f2(_0xa98753[_0x0dd0('0x17')](0x1f4,_0x61bcfc[_0x0dd0('0x19')]));});});}; \ No newline at end of file +var _0x8b4e=['include','map','model','ShowOpenchannelQueue','OpenchannelQueue','where','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','raw','attributes'];(function(_0x179b80,_0x440291){var _0x1e8d03=function(_0x466a71){while(--_0x466a71){_0x179b80['push'](_0x179b80['shift']());}};_0x1e8d03(++_0x440291);}(_0x8b4e,0x118));var _0xe8b4=function(_0xa490eb,_0x3caa70){_0xa490eb=_0xa490eb-0x0;var _0x10fe45=_0x8b4e[_0xa490eb];return _0x10fe45;};'use strict';var _=require(_0xe8b4('0x0'));var util=require(_0xe8b4('0x1'));var moment=require(_0xe8b4('0x2'));var BPromise=require(_0xe8b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8b4('0x4'));var db=require(_0xe8b4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8b4('0x6'))(_0xe8b4('0x7'));var config=require(_0xe8b4('0x8'));var jayson=require(_0xe8b4('0x9'));var client=jayson[_0xe8b4('0xa')]['http']({'port':0x232a});config[_0xe8b4('0xb')]=_[_0xe8b4('0xc')](config['redis'],{'host':_0xe8b4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe8b4('0xe'))[_0xe8b4('0xf')](socket);function respondWithRpcPromise(_0x4c73c4,_0x1b57f9,_0x517da6){return new BPromise(function(_0x17eaaa,_0x27d617){return client[_0xe8b4('0x10')](_0x4c73c4,_0x517da6)[_0xe8b4('0x11')](function(_0x39f6e8){logger[_0xe8b4('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x1b57f9,_0xe8b4('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1b57f9,_0xe8b4('0x13'),JSON[_0xe8b4('0x14')](_0x39f6e8));if(_0x39f6e8[_0xe8b4('0x15')]){if(_0x39f6e8[_0xe8b4('0x15')][_0xe8b4('0x16')]===0x1f4){logger['error'](_0xe8b4('0x17'),_0x1b57f9,_0x39f6e8[_0xe8b4('0x15')]['message']);return _0x27d617(_0x39f6e8['error'][_0xe8b4('0x18')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1b57f9,_0x39f6e8[_0xe8b4('0x15')][_0xe8b4('0x18')]);return _0x17eaaa(_0x39f6e8[_0xe8b4('0x15')][_0xe8b4('0x18')]);}else{logger[_0xe8b4('0x12')](_0xe8b4('0x17'),_0x1b57f9,'request\x20sent');_0x17eaaa(_0x39f6e8[_0xe8b4('0x19')]['message']);}})[_0xe8b4('0x1a')](function(_0x8c98ed){logger['error'](_0xe8b4('0x17'),_0x1b57f9,_0x8c98ed);_0x27d617(_0x8c98ed);});});}exports[_0xe8b4('0x1b')]=function(_0xbfb3b8){var _0x21a26e=this;return new Promise(function(_0x5181f9,_0x3bccf1){return db['OpenchannelQueue'][_0xe8b4('0x1c')]({'raw':_0xbfb3b8[_0xe8b4('0x1d')]?_0xbfb3b8[_0xe8b4('0x1d')][_0xe8b4('0x1e')]===undefined?!![]:![]:!![],'where':_0xbfb3b8[_0xe8b4('0x1d')]?_0xbfb3b8['options']['where']||null:null,'attributes':_0xbfb3b8[_0xe8b4('0x1d')]?_0xbfb3b8[_0xe8b4('0x1d')][_0xe8b4('0x1f')]||null:null,'limit':_0xbfb3b8[_0xe8b4('0x1d')]?_0xbfb3b8['options']['limit']||null:null,'include':_0xbfb3b8[_0xe8b4('0x1d')]?_0xbfb3b8[_0xe8b4('0x1d')]['include']?_['map'](_0xbfb3b8[_0xe8b4('0x1d')][_0xe8b4('0x20')],function(_0x1c6842){return{'model':db[_0x1c6842['model']],'as':_0x1c6842['as'],'attributes':_0x1c6842[_0xe8b4('0x1f')],'include':_0x1c6842[_0xe8b4('0x20')]?_[_0xe8b4('0x21')](_0x1c6842['include'],function(_0x5a0379){return{'model':db[_0x5a0379[_0xe8b4('0x22')]],'as':_0x5a0379['as'],'attributes':_0x5a0379[_0xe8b4('0x1f')],'include':_0x5a0379[_0xe8b4('0x20')]?_[_0xe8b4('0x21')](_0x5a0379[_0xe8b4('0x20')],function(_0x53839f){return{'model':db[_0x53839f[_0xe8b4('0x22')]],'as':_0x53839f['as'],'attributes':_0x53839f[_0xe8b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe8b4('0x11')](function(_0x1851fe){logger[_0xe8b4('0x12')](_0xe8b4('0x1b'),_0xbfb3b8);logger['debug'](_0xe8b4('0x1b'),_0xbfb3b8,JSON[_0xe8b4('0x14')](_0x1851fe));_0x5181f9(_0x1851fe);})['catch'](function(_0x1e2619){logger[_0xe8b4('0x15')](_0xe8b4('0x1b'),_0x1e2619[_0xe8b4('0x18')],_0xbfb3b8);_0x3bccf1(_0x21a26e[_0xe8b4('0x15')](0x1f4,_0x1e2619[_0xe8b4('0x18')]));});});};exports[_0xe8b4('0x23')]=function(_0x158994){var _0xe4873c=this;return new Promise(function(_0x273ae5,_0x1cda06){return db[_0xe8b4('0x24')]['find']({'raw':_0x158994[_0xe8b4('0x1d')]?_0x158994[_0xe8b4('0x1d')][_0xe8b4('0x1e')]===undefined?!![]:![]:!![],'where':_0x158994['options']?_0x158994['options'][_0xe8b4('0x25')]||null:null,'attributes':_0x158994[_0xe8b4('0x1d')]?_0x158994['options'][_0xe8b4('0x1f')]||null:null,'include':_0x158994[_0xe8b4('0x1d')]?_0x158994[_0xe8b4('0x1d')][_0xe8b4('0x20')]?_[_0xe8b4('0x21')](_0x158994[_0xe8b4('0x1d')][_0xe8b4('0x20')],function(_0x138053){return{'model':db[_0x138053[_0xe8b4('0x22')]],'as':_0x138053['as'],'attributes':_0x138053['attributes'],'include':_0x138053[_0xe8b4('0x20')]?_[_0xe8b4('0x21')](_0x138053['include'],function(_0x20ba81){return{'model':db[_0x20ba81[_0xe8b4('0x22')]],'as':_0x20ba81['as'],'attributes':_0x20ba81[_0xe8b4('0x1f')],'include':_0x20ba81[_0xe8b4('0x20')]?_[_0xe8b4('0x21')](_0x20ba81['include'],function(_0x2465ac){return{'model':db[_0x2465ac['model']],'as':_0x2465ac['as'],'attributes':_0x2465ac[_0xe8b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe8b4('0x11')](function(_0x36c109){logger['info'](_0xe8b4('0x23'),_0x158994);logger[_0xe8b4('0x26')](_0xe8b4('0x23'),_0x158994,JSON[_0xe8b4('0x14')](_0x36c109));_0x273ae5(_0x36c109);})['catch'](function(_0x27316f){logger[_0xe8b4('0x15')]('ShowOpenchannelQueue',_0x27316f[_0xe8b4('0x18')],_0x158994);_0x1cda06(_0xe4873c[_0xe8b4('0x15')](0x1f4,_0x27316f['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 331439b..11c45b5 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 _0x037c=['removeListener','register','length','save','update','emit'];(function(_0x36743b,_0x41426a){var _0xc6db05=function(_0xa1afe5){while(--_0xa1afe5){_0x36743b['push'](_0x36743b['shift']());}};_0xc6db05(++_0x41426a);}(_0x037c,0x189));var _0xc037=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x037c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc037('0x0'),'remove',_0xc037('0x1')];function createListener(_0x400f2b,_0xcfe153){return function(_0x3fd1f3){_0xcfe153[_0xc037('0x2')](_0x400f2b,_0x3fd1f3);};}function removeListener(_0x5a26c6,_0x3d8d8f){return function(){OpenchannelQueueEvents[_0xc037('0x3')](_0x5a26c6,_0x3d8d8f);};}exports[_0xc037('0x4')]=function(_0x49f3d1){for(var _0x3e0cac=0x0,_0x4cd86a=events[_0xc037('0x5')];_0x3e0cac<_0x4cd86a;_0x3e0cac++){var _0x3e9b0c=events[_0x3e0cac];var _0x8bc86e=createListener('openchannelQueue:'+_0x3e9b0c,_0x49f3d1);OpenchannelQueueEvents['on'](_0x3e9b0c,_0x8bc86e);}}; \ No newline at end of file +var _0x900f=['register','openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener'];(function(_0x13844e,_0x14d041){var _0x5183b0=function(_0xb973){while(--_0xb973){_0x13844e['push'](_0x13844e['shift']());}};_0x5183b0(++_0x14d041);}(_0x900f,0x18a));var _0xf900=function(_0x3e78f4,_0x5d4c9a){_0x3e78f4=_0x3e78f4-0x0;var _0x5ca5eb=_0x900f[_0x3e78f4];return _0x5ca5eb;};'use strict';var OpenchannelQueueEvents=require(_0xf900('0x0'));var events=[_0xf900('0x1'),'remove',_0xf900('0x2')];function createListener(_0x3f4c34,_0x343f5e){return function(_0x10ecd8){_0x343f5e[_0xf900('0x3')](_0x3f4c34,_0x10ecd8);};}function removeListener(_0x29b960,_0x594ce8){return function(){OpenchannelQueueEvents[_0xf900('0x4')](_0x29b960,_0x594ce8);};}exports[_0xf900('0x5')]=function(_0xce3c1b){for(var _0x16c686=0x0,_0x1f01ff=events['length'];_0x16c686<_0x1f01ff;_0x16c686++){var _0x44153a=events[_0x16c686];var _0x4cfc6d=createListener(_0xf900('0x6')+_0x44153a,_0xce3c1b);OpenchannelQueueEvents['on'](_0x44153a,_0x4cfc6d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 7f34bbf..4de32fa 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 _0xf222=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf222,0x163));var _0x2f22=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf222[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x2f22('0x0'));var util=require(_0x2f22('0x1'));var path=require(_0x2f22('0x2'));var timeout=require(_0x2f22('0x3'));var express=require('express');var router=express[_0x2f22('0x4')]();var fs_extra=require(_0x2f22('0x5'));var auth=require(_0x2f22('0x6'));var interaction=require(_0x2f22('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x2f22('0x8')](),controller['index']);router[_0x2f22('0x9')](_0x2f22('0xa'),auth[_0x2f22('0x8')](),controller[_0x2f22('0xb')]);router[_0x2f22('0x9')](_0x2f22('0xc'),auth[_0x2f22('0x8')](),controller[_0x2f22('0xd')]);router[_0x2f22('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f22('0xf')](_0x2f22('0xc'),auth[_0x2f22('0x8')](),controller[_0x2f22('0x10')]);router[_0x2f22('0x11')](_0x2f22('0xc'),auth['isAuthenticated'](),controller[_0x2f22('0x12')]);module['exports']=router; \ No newline at end of file +var _0x75d7=['../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x75d7,0x19c));var _0x775d=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x75d7[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x775d('0x0'));var util=require(_0x775d('0x1'));var path=require(_0x775d('0x2'));var timeout=require(_0x775d('0x3'));var express=require(_0x775d('0x4'));var router=express[_0x775d('0x5')]();var fs_extra=require(_0x775d('0x6'));var auth=require(_0x775d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x775d('0x8'));var controller=require(_0x775d('0x9'));router['get']('/',auth[_0x775d('0xa')](),controller[_0x775d('0xb')]);router[_0x775d('0xc')](_0x775d('0xd'),auth[_0x775d('0xa')](),controller['describe']);router[_0x775d('0xc')](_0x775d('0xe'),auth['isAuthenticated'](),controller[_0x775d('0xf')]);router[_0x775d('0x10')]('/',auth[_0x775d('0xa')](),controller[_0x775d('0x11')]);router[_0x775d('0x12')](_0x775d('0xe'),auth[_0x775d('0xa')](),controller['update']);router['delete']('/:id',auth[_0x775d('0xa')](),controller[_0x775d('0x13')]);module[_0x775d('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index f1159a2..738a5cf 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 _0x38c5=['sequelize','STRING','DATE','moment'];(function(_0x3ff59d,_0x209599){var _0x221f59=function(_0x121af2){while(--_0x121af2){_0x3ff59d['push'](_0x3ff59d['shift']());}};_0x221f59(++_0x209599);}(_0x38c5,0x8f));var _0x538c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x38c5[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0x538c('0x0'));var Sequelize=require(_0x538c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x538c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x538c('0x2')]},'joinAt':{'type':Sequelize[_0x538c('0x3')]},'leaveAt':{'type':Sequelize[_0x538c('0x3')]},'acceptAt':{'type':Sequelize[_0x538c('0x3')]},'exitAt':{'type':Sequelize[_0x538c('0x3')]},'reason':{'type':Sequelize[_0x538c('0x2')]}}; \ No newline at end of file +var _0xc9b9=['STRING','exports'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0xc9b9[_0x205e5a];return _0x10da58;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9c9b('0x0')]={'uniqueid':{'type':Sequelize[_0x9c9b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9c9b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9c9b('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2e0bfb8..f9292cb 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 _0xa591=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','filter','includeAll','findAll','rows','catch','show','params','length','options','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x261430,_0x200cf5){var _0x507d95=function(_0x238c22){while(--_0x238c22){_0x261430['push'](_0x261430['shift']());}};_0x507d95(++_0x200cf5);}(_0xa591,0x1a1));var _0x1a59=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xa591[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a59('0x0'));var zipdir=require(_0x1a59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a59('0x2'));var moment=require(_0x1a59('0x3'));var BPromise=require(_0x1a59('0x4'));var Mustache=require(_0x1a59('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1a59('0x6'));var csv=require('to-csv');var ejs=require(_0x1a59('0x7'));var fs=require('fs');var fs_extra=require(_0x1a59('0x8'));var _=require('lodash');var squel=require(_0x1a59('0x9'));var crypto=require(_0x1a59('0xa'));var jsforce=require(_0x1a59('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a59('0xc'));var Papa=require(_0x1a59('0xd'));var Redis=require(_0x1a59('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a59('0xf'));var hardwareService=require(_0x1a59('0x10'));var logger=require(_0x1a59('0x11'))(_0x1a59('0x12'));var utils=require(_0x1a59('0x13'));var config=require(_0x1a59('0x14'));var licenseUtil=require(_0x1a59('0x15'));var db=require(_0x1a59('0x16'))['db'];function respondWithStatusCode(_0x271251,_0x50baf9){_0x50baf9=_0x50baf9||0xcc;return function(_0x446e9d){if(_0x446e9d){return _0x271251[_0x1a59('0x17')](_0x50baf9);}return _0x271251[_0x1a59('0x18')](_0x50baf9)[_0x1a59('0x19')]();};}function respondWithResult(_0x5bb36c,_0x2c450b){_0x2c450b=_0x2c450b||0xc8;return function(_0xf471ad){if(_0xf471ad){return _0x5bb36c[_0x1a59('0x18')](_0x2c450b)[_0x1a59('0x1a')](_0xf471ad);}};}function respondWithFilteredResult(_0x2e77a6,_0x29380c){return function(_0x1d2099){if(_0x1d2099){var _0x429e20=typeof _0x29380c[_0x1a59('0x1b')]===_0x1a59('0x1c')&&typeof _0x29380c[_0x1a59('0x1d')]===_0x1a59('0x1c');var _0x391a98=_0x1d2099[_0x1a59('0x1e')];var _0x302cc3=_0x429e20?0x0:_0x29380c[_0x1a59('0x1b')];var _0x4f3c8c=_0x429e20?_0x1d2099[_0x1a59('0x1e')]:_0x29380c['offset']+_0x29380c[_0x1a59('0x1d')];var _0x22a92c;if(_0x4f3c8c>=_0x391a98){_0x4f3c8c=_0x391a98;_0x22a92c=0xc8;}else{_0x22a92c=0xce;}_0x2e77a6['status'](_0x22a92c);return _0x2e77a6[_0x1a59('0x1f')]('Content-Range',_0x302cc3+'-'+_0x4f3c8c+'/'+_0x391a98)['json'](_0x1d2099);}return null;};}function patchUpdates(_0x19e85c){return function(_0x289fdb){try{jsonpatch[_0x1a59('0x20')](_0x289fdb,_0x19e85c,!![]);}catch(_0x5e296f){return BPromise['reject'](_0x5e296f);}return _0x289fdb[_0x1a59('0x21')]();};}function saveUpdates(_0x32e725,_0x4a2f37){return function(_0x55d3d5){if(_0x55d3d5){return _0x55d3d5['update'](_0x32e725)[_0x1a59('0x22')](function(_0x13058a){return _0x13058a;});}return null;};}function removeEntity(_0x23fca0,_0x376919){return function(_0x1ff374){if(_0x1ff374){return _0x1ff374[_0x1a59('0x23')]()[_0x1a59('0x22')](function(){_0x23fca0[_0x1a59('0x18')](0xcc)[_0x1a59('0x19')]();});}};}function handleEntityNotFound(_0x2cceef,_0x49a131){return function(_0x54355f){if(!_0x54355f){_0x2cceef[_0x1a59('0x17')](0x194);}return _0x54355f;};}function handleError(_0x275244,_0x7b0b84){_0x7b0b84=_0x7b0b84||0x1f4;return function(_0x2810a3){logger[_0x1a59('0x24')](_0x2810a3[_0x1a59('0x25')]);if(_0x2810a3['name']){delete _0x2810a3[_0x1a59('0x26')];}_0x275244['status'](_0x7b0b84)[_0x1a59('0x27')](_0x2810a3);};}exports[_0x1a59('0x28')]=function(_0x2dc936,_0x1574cb){var _0x22efd3={},_0x3f5763={},_0x1a748f={'count':0x0,'rows':[]};var _0x4971af=_['map'](db[_0x1a59('0x29')][_0x1a59('0x2a')],function(_0x3a988c){return{'name':_0x3a988c['fieldName'],'type':_0x3a988c['type'][_0x1a59('0x2b')]};});_0x3f5763[_0x1a59('0x2c')]=_['map'](_0x4971af,_0x1a59('0x26'));_0x3f5763['query']=_[_0x1a59('0x2d')](_0x2dc936[_0x1a59('0x2e')]);_0x3f5763[_0x1a59('0x2f')]=_['intersection'](_0x3f5763[_0x1a59('0x2c')],_0x3f5763['query']);_0x22efd3['attributes']=_[_0x1a59('0x30')](_0x3f5763[_0x1a59('0x2c')],qs['fields'](_0x2dc936[_0x1a59('0x2e')][_0x1a59('0x31')]));_0x22efd3[_0x1a59('0x32')]=_0x22efd3[_0x1a59('0x32')]['length']?_0x22efd3[_0x1a59('0x32')]:_0x3f5763[_0x1a59('0x2c')];if(!_0x2dc936[_0x1a59('0x2e')][_0x1a59('0x33')](_0x1a59('0x34'))){_0x22efd3[_0x1a59('0x1d')]=qs[_0x1a59('0x1d')](_0x2dc936['query']['limit']);_0x22efd3[_0x1a59('0x1b')]=qs[_0x1a59('0x1b')](_0x2dc936[_0x1a59('0x2e')][_0x1a59('0x1b')]);}_0x22efd3[_0x1a59('0x35')]=qs[_0x1a59('0x36')](_0x2dc936['query'][_0x1a59('0x36')]);_0x22efd3['where']=qs['filters'](_[_0x1a59('0x37')](_0x2dc936[_0x1a59('0x2e')],_0x3f5763[_0x1a59('0x2f')]),_0x4971af);if(_0x2dc936[_0x1a59('0x2e')]['filter']){_0x22efd3[_0x1a59('0x38')]=_[_0x1a59('0x39')](_0x22efd3[_0x1a59('0x38')],{'$or':_[_0x1a59('0x3a')](_0x4971af,function(_0x39fd2b){if(_0x39fd2b[_0x1a59('0x3b')]!=='VIRTUAL'){var _0x31f6da={};_0x31f6da[_0x39fd2b[_0x1a59('0x26')]]={'$like':'%'+_0x2dc936[_0x1a59('0x2e')][_0x1a59('0x3c')]+'%'};return _0x31f6da;}})});}_0x22efd3=_[_0x1a59('0x39')]({},_0x22efd3,_0x2dc936['options']);var _0x152187={'where':_0x22efd3[_0x1a59('0x38')]};return db['OpenchannelQueueReport']['count'](_0x152187)[_0x1a59('0x22')](function(_0x162eb0){_0x1a748f[_0x1a59('0x1e')]=_0x162eb0;if(_0x2dc936['query'][_0x1a59('0x3d')]){_0x22efd3['include']=[{'all':!![]}];}return db[_0x1a59('0x29')][_0x1a59('0x3e')](_0x22efd3);})[_0x1a59('0x22')](function(_0x1c64d0){_0x1a748f[_0x1a59('0x3f')]=_0x1c64d0;return _0x1a748f;})[_0x1a59('0x22')](respondWithFilteredResult(_0x1574cb,_0x22efd3))[_0x1a59('0x40')](handleError(_0x1574cb,null));};exports[_0x1a59('0x41')]=function(_0x50ca5c,_0x4ad08f){var _0x973ce={'raw':!![],'where':{'id':_0x50ca5c[_0x1a59('0x42')]['id']}},_0x122332={};_0x122332[_0x1a59('0x2c')]=_[_0x1a59('0x2d')](db[_0x1a59('0x29')][_0x1a59('0x2a')]);_0x122332[_0x1a59('0x2e')]=_[_0x1a59('0x2d')](_0x50ca5c['query']);_0x122332[_0x1a59('0x2f')]=_['intersection'](_0x122332[_0x1a59('0x2c')],_0x122332[_0x1a59('0x2e')]);_0x973ce['attributes']=_[_0x1a59('0x30')](_0x122332[_0x1a59('0x2c')],qs[_0x1a59('0x31')](_0x50ca5c['query'][_0x1a59('0x31')]));_0x973ce[_0x1a59('0x32')]=_0x973ce[_0x1a59('0x32')][_0x1a59('0x43')]?_0x973ce['attributes']:_0x122332[_0x1a59('0x2c')];if(_0x50ca5c[_0x1a59('0x2e')][_0x1a59('0x3d')]){_0x973ce['include']=[{'all':!![]}];}_0x973ce=_['merge']({},_0x973ce,_0x50ca5c[_0x1a59('0x44')]);return db[_0x1a59('0x29')]['find'](_0x973ce)['then'](handleEntityNotFound(_0x4ad08f,null))[_0x1a59('0x22')](respondWithResult(_0x4ad08f,null))['catch'](handleError(_0x4ad08f,null));};exports['create']=function(_0x1b5713,_0x3bc063){return db[_0x1a59('0x29')][_0x1a59('0x45')](_0x1b5713[_0x1a59('0x46')],{})['then'](respondWithResult(_0x3bc063,0xc9))[_0x1a59('0x40')](handleError(_0x3bc063,null));};exports['update']=function(_0x2adf2e,_0xc1039){if(_0x2adf2e[_0x1a59('0x46')]['id']){delete _0x2adf2e['body']['id'];}return db[_0x1a59('0x29')][_0x1a59('0x47')]({'where':{'id':_0x2adf2e[_0x1a59('0x42')]['id']}})[_0x1a59('0x22')](handleEntityNotFound(_0xc1039,null))[_0x1a59('0x22')](saveUpdates(_0x2adf2e[_0x1a59('0x46')],null))['then'](respondWithResult(_0xc1039,null))[_0x1a59('0x40')](handleError(_0xc1039,null));};exports[_0x1a59('0x23')]=function(_0x3b1f74,_0x98012a){return db['OpenchannelQueueReport'][_0x1a59('0x47')]({'where':{'id':_0x3b1f74[_0x1a59('0x42')]['id']}})[_0x1a59('0x22')](handleEntityNotFound(_0x98012a,null))[_0x1a59('0x22')](removeEntity(_0x98012a,null))[_0x1a59('0x40')](handleError(_0x98012a,null));};exports['describe']=function(_0x1f9950,_0x50e8ea){return db[_0x1a59('0x29')][_0x1a59('0x48')]()[_0x1a59('0x22')](respondWithResult(_0x50e8ea,null))[_0x1a59('0x40')](handleError(_0x50e8ea,null));}; \ No newline at end of file +var _0x1a32=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x41d885,_0x16e4e0){var _0x490994=function(_0x384362){while(--_0x384362){_0x41d885['push'](_0x41d885['shift']());}};_0x490994(++_0x16e4e0);}(_0x1a32,0x185));var _0x21a3=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x1a32[_0x242a4f];return _0x122117;};'use strict';var emlformat=require(_0x21a3('0x0'));var rimraf=require(_0x21a3('0x1'));var zipdir=require(_0x21a3('0x2'));var jsonpatch=require(_0x21a3('0x3'));var rp=require(_0x21a3('0x4'));var moment=require('moment');var BPromise=require(_0x21a3('0x5'));var Mustache=require(_0x21a3('0x6'));var util=require(_0x21a3('0x7'));var path=require(_0x21a3('0x8'));var sox=require(_0x21a3('0x9'));var csv=require(_0x21a3('0xa'));var ejs=require(_0x21a3('0xb'));var fs=require('fs');var fs_extra=require(_0x21a3('0xc'));var _=require(_0x21a3('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x21a3('0xe'));var deskjs=require(_0x21a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x21a3('0x10'));var Papa=require(_0x21a3('0x11'));var Redis=require(_0x21a3('0x12'));var authService=require(_0x21a3('0x13'));var qs=require(_0x21a3('0x14'));var as=require(_0x21a3('0x15'));var hardwareService=require(_0x21a3('0x16'));var logger=require(_0x21a3('0x17'))(_0x21a3('0x18'));var utils=require(_0x21a3('0x19'));var config=require(_0x21a3('0x1a'));var licenseUtil=require(_0x21a3('0x1b'));var db=require(_0x21a3('0x1c'))['db'];function respondWithStatusCode(_0x2a0031,_0x2afcba){_0x2afcba=_0x2afcba||0xcc;return function(_0x4ff157){if(_0x4ff157){return _0x2a0031[_0x21a3('0x1d')](_0x2afcba);}return _0x2a0031[_0x21a3('0x1e')](_0x2afcba)['end']();};}function respondWithResult(_0xcc9896,_0x101932){_0x101932=_0x101932||0xc8;return function(_0xa83518){if(_0xa83518){return _0xcc9896[_0x21a3('0x1e')](_0x101932)['json'](_0xa83518);}};}function respondWithFilteredResult(_0x5c72fe,_0x5ddc9e){return function(_0x3110db){if(_0x3110db){var _0x41c787=typeof _0x5ddc9e[_0x21a3('0x1f')]===_0x21a3('0x20')&&typeof _0x5ddc9e[_0x21a3('0x21')]===_0x21a3('0x20');var _0x2d463e=_0x3110db[_0x21a3('0x22')];var _0x5780f0=_0x41c787?0x0:_0x5ddc9e[_0x21a3('0x1f')];var _0x52b039=_0x41c787?_0x3110db[_0x21a3('0x22')]:_0x5ddc9e['offset']+_0x5ddc9e[_0x21a3('0x21')];var _0x12db00;if(_0x52b039>=_0x2d463e){_0x52b039=_0x2d463e;_0x12db00=0xc8;}else{_0x12db00=0xce;}_0x5c72fe[_0x21a3('0x1e')](_0x12db00);return _0x5c72fe['set'](_0x21a3('0x23'),_0x5780f0+'-'+_0x52b039+'/'+_0x2d463e)['json'](_0x3110db);}return null;};}function patchUpdates(_0x1c3e90){return function(_0x9d0fdc){try{jsonpatch[_0x21a3('0x24')](_0x9d0fdc,_0x1c3e90,!![]);}catch(_0x36a5b3){return BPromise['reject'](_0x36a5b3);}return _0x9d0fdc['save']();};}function saveUpdates(_0x197521,_0x403097){return function(_0x5695a5){if(_0x5695a5){return _0x5695a5['update'](_0x197521)[_0x21a3('0x25')](function(_0x31ead0){return _0x31ead0;});}return null;};}function removeEntity(_0x2aeec6,_0x5a1276){return function(_0x48e24a){if(_0x48e24a){return _0x48e24a[_0x21a3('0x26')]()['then'](function(){_0x2aeec6[_0x21a3('0x1e')](0xcc)[_0x21a3('0x27')]();});}};}function handleEntityNotFound(_0x19d67d,_0xfa7436){return function(_0x335f5e){if(!_0x335f5e){_0x19d67d[_0x21a3('0x1d')](0x194);}return _0x335f5e;};}function handleError(_0x5d6ca7,_0x151b31){_0x151b31=_0x151b31||0x1f4;return function(_0x566cf3){logger['error'](_0x566cf3[_0x21a3('0x28')]);if(_0x566cf3['name']){delete _0x566cf3[_0x21a3('0x29')];}_0x5d6ca7['status'](_0x151b31)[_0x21a3('0x2a')](_0x566cf3);};}exports[_0x21a3('0x2b')]=function(_0x5380af,_0x4b0faa){var _0xfdd56d={},_0xdbb51d={},_0x35243d={'count':0x0,'rows':[]};var _0x554825=_[_0x21a3('0x2c')](db['OpenchannelQueueReport'][_0x21a3('0x2d')],function(_0x87da86){return{'name':_0x87da86[_0x21a3('0x2e')],'type':_0x87da86[_0x21a3('0x2f')][_0x21a3('0x30')]};});_0xdbb51d[_0x21a3('0x31')]=_[_0x21a3('0x2c')](_0x554825,_0x21a3('0x29'));_0xdbb51d[_0x21a3('0x32')]=_[_0x21a3('0x33')](_0x5380af['query']);_0xdbb51d[_0x21a3('0x34')]=_[_0x21a3('0x35')](_0xdbb51d['model'],_0xdbb51d[_0x21a3('0x32')]);_0xfdd56d[_0x21a3('0x36')]=_['intersection'](_0xdbb51d['model'],qs[_0x21a3('0x37')](_0x5380af['query']['fields']));_0xfdd56d[_0x21a3('0x36')]=_0xfdd56d[_0x21a3('0x36')]['length']?_0xfdd56d[_0x21a3('0x36')]:_0xdbb51d[_0x21a3('0x31')];if(!_0x5380af[_0x21a3('0x32')][_0x21a3('0x38')](_0x21a3('0x39'))){_0xfdd56d[_0x21a3('0x21')]=qs[_0x21a3('0x21')](_0x5380af[_0x21a3('0x32')][_0x21a3('0x21')]);_0xfdd56d[_0x21a3('0x1f')]=qs[_0x21a3('0x1f')](_0x5380af[_0x21a3('0x32')]['offset']);}_0xfdd56d[_0x21a3('0x3a')]=qs[_0x21a3('0x3b')](_0x5380af[_0x21a3('0x32')][_0x21a3('0x3b')]);_0xfdd56d['where']=qs[_0x21a3('0x34')](_[_0x21a3('0x3c')](_0x5380af[_0x21a3('0x32')],_0xdbb51d['filters']),_0x554825);if(_0x5380af[_0x21a3('0x32')]['filter']){_0xfdd56d[_0x21a3('0x3d')]=_['merge'](_0xfdd56d[_0x21a3('0x3d')],{'$or':_[_0x21a3('0x2c')](_0x554825,function(_0x3dc142){if(_0x3dc142[_0x21a3('0x2f')]!==_0x21a3('0x3e')){var _0x1816e7={};_0x1816e7[_0x3dc142['name']]={'$like':'%'+_0x5380af[_0x21a3('0x32')][_0x21a3('0x3f')]+'%'};return _0x1816e7;}})});}_0xfdd56d=_[_0x21a3('0x40')]({},_0xfdd56d,_0x5380af[_0x21a3('0x41')]);var _0x614877={'where':_0xfdd56d['where']};return db[_0x21a3('0x42')][_0x21a3('0x22')](_0x614877)['then'](function(_0x3163ed){_0x35243d['count']=_0x3163ed;if(_0x5380af[_0x21a3('0x32')][_0x21a3('0x43')]){_0xfdd56d[_0x21a3('0x44')]=[{'all':!![]}];}return db[_0x21a3('0x42')][_0x21a3('0x45')](_0xfdd56d);})[_0x21a3('0x25')](function(_0x31ee6d){_0x35243d[_0x21a3('0x46')]=_0x31ee6d;return _0x35243d;})[_0x21a3('0x25')](respondWithFilteredResult(_0x4b0faa,_0xfdd56d))[_0x21a3('0x47')](handleError(_0x4b0faa,null));};exports[_0x21a3('0x48')]=function(_0x39d266,_0x117ea7){var _0x26a77a={'raw':!![],'where':{'id':_0x39d266[_0x21a3('0x49')]['id']}},_0x501f7a={};_0x501f7a[_0x21a3('0x31')]=_['keys'](db[_0x21a3('0x42')]['rawAttributes']);_0x501f7a[_0x21a3('0x32')]=_[_0x21a3('0x33')](_0x39d266[_0x21a3('0x32')]);_0x501f7a[_0x21a3('0x34')]=_[_0x21a3('0x35')](_0x501f7a['model'],_0x501f7a['query']);_0x26a77a[_0x21a3('0x36')]=_[_0x21a3('0x35')](_0x501f7a[_0x21a3('0x31')],qs[_0x21a3('0x37')](_0x39d266[_0x21a3('0x32')]['fields']));_0x26a77a[_0x21a3('0x36')]=_0x26a77a[_0x21a3('0x36')][_0x21a3('0x4a')]?_0x26a77a[_0x21a3('0x36')]:_0x501f7a[_0x21a3('0x31')];if(_0x39d266[_0x21a3('0x32')]['includeAll']){_0x26a77a[_0x21a3('0x44')]=[{'all':!![]}];}_0x26a77a=_[_0x21a3('0x40')]({},_0x26a77a,_0x39d266[_0x21a3('0x41')]);return db[_0x21a3('0x42')][_0x21a3('0x4b')](_0x26a77a)[_0x21a3('0x25')](handleEntityNotFound(_0x117ea7,null))[_0x21a3('0x25')](respondWithResult(_0x117ea7,null))[_0x21a3('0x47')](handleError(_0x117ea7,null));};exports[_0x21a3('0x4c')]=function(_0x420a47,_0x1b6911){return db[_0x21a3('0x42')]['create'](_0x420a47[_0x21a3('0x4d')],{})['then'](respondWithResult(_0x1b6911,0xc9))[_0x21a3('0x47')](handleError(_0x1b6911,null));};exports[_0x21a3('0x4e')]=function(_0x3767a6,_0x333378){if(_0x3767a6[_0x21a3('0x4d')]['id']){delete _0x3767a6[_0x21a3('0x4d')]['id'];}return db[_0x21a3('0x42')][_0x21a3('0x4b')]({'where':{'id':_0x3767a6[_0x21a3('0x49')]['id']}})[_0x21a3('0x25')](handleEntityNotFound(_0x333378,null))[_0x21a3('0x25')](saveUpdates(_0x3767a6[_0x21a3('0x4d')],null))['then'](respondWithResult(_0x333378,null))[_0x21a3('0x47')](handleError(_0x333378,null));};exports[_0x21a3('0x26')]=function(_0x1db8b9,_0x329fd3){return db['OpenchannelQueueReport'][_0x21a3('0x4b')]({'where':{'id':_0x1db8b9[_0x21a3('0x49')]['id']}})[_0x21a3('0x25')](handleEntityNotFound(_0x329fd3,null))[_0x21a3('0x25')](removeEntity(_0x329fd3,null))[_0x21a3('0x47')](handleError(_0x329fd3,null));};exports['describe']=function(_0xe80090,_0x2c3bfe){return db['OpenchannelQueueReport'][_0x21a3('0x4f')]()[_0x21a3('0x25')](respondWithResult(_0x2c3bfe,null))[_0x21a3('0x47')](handleError(_0x2c3bfe,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a58036b..0fd72a1 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x814b,0x1a2));var _0xb814=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x814b[_0x79cd47];return _0x3b9484;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x814b,0x1a2));var _0xb814=function(_0x386187,_0x1ad2ac){_0x386187=_0x386187-0x0;var _0x4abeaa=_0x814b[_0x386187];return _0x4abeaa;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index fd7aa49..adf0d72 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 _0xd26f=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','update','body','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0xeff0b7,_0x1c450a){var _0x3a086c=function(_0xed6609){while(--_0xed6609){_0xeff0b7['push'](_0xeff0b7['shift']());}};_0x3a086c(++_0x1c450a);}(_0xd26f,0x113));var _0xfd26=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd26f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});}exports[_0xfd26('0x16')]=function(_0xeb7aeb){var _0x210dd4=this;return new Promise(function(_0x36a275,_0x5b3e8b){return db[_0xfd26('0x17')]['create'](_0xeb7aeb['body'],{'raw':_0xeb7aeb['options']?_0xeb7aeb[_0xfd26('0x18')][_0xfd26('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x523cbe){logger[_0xfd26('0xc')](_0xfd26('0x16'),_0xeb7aeb);logger['debug'](_0xfd26('0x16'),_0xeb7aeb,JSON['stringify'](_0x523cbe));_0x36a275(_0x523cbe);})[_0xfd26('0x15')](function(_0x531bf7){logger[_0xfd26('0x12')]('CreateOpenchannelQueueReport',_0x531bf7[_0xfd26('0x13')],_0xeb7aeb);_0x5b3e8b(_0x210dd4[_0xfd26('0x12')](0x1f4,_0x531bf7['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1194c2){var _0x4bc02c=this;return new Promise(function(_0x1d62c5,_0xebbab7){return db[_0xfd26('0x17')][_0xfd26('0x1a')](_0x1194c2[_0xfd26('0x1b')],{'raw':_0x1194c2['options']?_0x1194c2[_0xfd26('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')]['where']||null:null,'attributes':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1c')]||null:null,'limit':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1d')]||null:null})[_0xfd26('0x1e')](function(_0x565c0){logger[_0xfd26('0xc')]('UpdateOpenchannelQueueReport',_0x1194c2);logger['debug']('UpdateOpenchannelQueueReport',_0x1194c2,JSON['stringify'](_0x565c0));_0x1d62c5(_0x565c0);})[_0xfd26('0x15')](function(_0x5d0101){logger[_0xfd26('0x12')](_0xfd26('0x1f'),_0x5d0101['message'],_0x1194c2);_0xebbab7(_0x4bc02c['error'](0x1f4,_0x5d0101[_0xfd26('0x13')]));});});}; \ No newline at end of file +var _0x6582=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ae13c,_0x2f94ec){var _0x2039c6=function(_0x3105a4){while(--_0x3105a4){_0x4ae13c['push'](_0x4ae13c['shift']());}};_0x2039c6(++_0x2f94ec);}(_0x6582,0x108));var _0x2658=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0x6582[_0x32bb6b];return _0x58dcb4;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}exports['CreateOpenchannelQueueReport']=function(_0x4eb90d){var _0x57337e=this;return new Promise(function(_0xf4193a,_0x260fc7){return db[_0x2658('0x16')][_0x2658('0x17')](_0x4eb90d['body'],{'raw':_0x4eb90d[_0x2658('0x18')]?_0x4eb90d[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![]})[_0x2658('0xb')](function(_0x23cf70){logger[_0x2658('0xc')]('CreateOpenchannelQueueReport',_0x4eb90d);logger[_0x2658('0xf')]('CreateOpenchannelQueueReport',_0x4eb90d,JSON['stringify'](_0x23cf70));_0xf4193a(_0x23cf70);})[_0x2658('0x15')](function(_0x132000){logger['error'](_0x2658('0x1a'),_0x132000['message'],_0x4eb90d);_0x260fc7(_0x57337e[_0x2658('0x11')](0x1f4,_0x132000[_0x2658('0x13')]));});});};exports[_0x2658('0x1b')]=function(_0x2e6d6a){var _0x31231c=this;return new Promise(function(_0x2e80fc,_0xe9f81){return db[_0x2658('0x16')][_0x2658('0x1c')](_0x2e6d6a[_0x2658('0x1d')],{'raw':_0x2e6d6a['options']?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x1e')]||null:null,'attributes':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a['options'][_0x2658('0x1f')]||null:null,'limit':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x20')]||null:null})[_0x2658('0xb')](function(_0x1492cb){logger[_0x2658('0xc')](_0x2658('0x1b'),_0x2e6d6a);logger[_0x2658('0xf')](_0x2658('0x1b'),_0x2e6d6a,JSON[_0x2658('0x21')](_0x1492cb));_0x2e80fc(_0x1492cb);})[_0x2658('0x15')](function(_0x291bb4){logger[_0x2658('0x11')](_0x2658('0x1b'),_0x291bb4[_0x2658('0x13')],_0x2e6d6a);_0xe9f81(_0x31231c[_0x2658('0x11')](0x1f4,_0x291bb4[_0x2658('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index c2052a8..594bc26 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 _0x2060=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x2060,0x89));var _0x0206=function(_0xb9b499,_0x3fa8d7){_0xb9b499=_0xb9b499-0x0;var _0x46d7c2=_0x2060[_0xb9b499];return _0x46d7c2;};'use strict';var multer=require('multer');var util=require(_0x0206('0x0'));var path=require(_0x0206('0x1'));var timeout=require(_0x0206('0x2'));var express=require(_0x0206('0x3'));var router=express[_0x0206('0x4')]();var fs_extra=require(_0x0206('0x5'));var auth=require(_0x0206('0x6'));var interaction=require(_0x0206('0x7'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x0206('0x8')]('/',auth[_0x0206('0x9')](),controller[_0x0206('0xa')]);router[_0x0206('0x8')](_0x0206('0xb'),auth[_0x0206('0x9')](),controller[_0x0206('0xc')]);router['get'](_0x0206('0xd'),auth['isAuthenticated'](),controller[_0x0206('0xe')]);router[_0x0206('0xf')]('/',auth[_0x0206('0x9')](),controller[_0x0206('0x10')]);router[_0x0206('0x11')](_0x0206('0xd'),auth['isAuthenticated'](),controller[_0x0206('0x12')]);router[_0x0206('0x13')](_0x0206('0xd'),auth[_0x0206('0x9')](),controller[_0x0206('0x14')]);module[_0x0206('0x15')]=router; \ No newline at end of file +var _0x856c=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x343950,_0x2167cc){var _0x136745=function(_0x19d8c5){while(--_0x19d8c5){_0x343950['push'](_0x343950['shift']());}};_0x136745(++_0x2167cc);}(_0x856c,0x84));var _0xc856=function(_0x58175c,_0x5d31a4){_0x58175c=_0x58175c-0x0;var _0x2b8290=_0x856c[_0x58175c];return _0x2b8290;};'use strict';var multer=require(_0xc856('0x0'));var util=require('util');var path=require(_0xc856('0x1'));var timeout=require(_0xc856('0x2'));var express=require(_0xc856('0x3'));var router=express[_0xc856('0x4')]();var fs_extra=require(_0xc856('0x5'));var auth=require(_0xc856('0x6'));var interaction=require(_0xc856('0x7'));var config=require(_0xc856('0x8'));var controller=require(_0xc856('0x9'));router[_0xc856('0xa')]('/',auth[_0xc856('0xb')](),controller['index']);router[_0xc856('0xa')](_0xc856('0xc'),auth[_0xc856('0xb')](),controller[_0xc856('0xd')]);router[_0xc856('0xa')](_0xc856('0xe'),auth[_0xc856('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc856('0xf')]);router[_0xc856('0x10')]('/:id',auth[_0xc856('0xb')](),controller[_0xc856('0x11')]);router[_0xc856('0x12')](_0xc856('0xe'),auth[_0xc856('0xb')](),controller[_0xc856('0x13')]);module[_0xc856('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index bd88f1c..11ef394 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x2779c7,_0x16ea9d){var _0x3c1248=function(_0x31b0f0){while(--_0x31b0f0){_0x2779c7['push'](_0x2779c7['shift']());}};_0x3c1248(++_0x16ea9d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x4b84[_0x29d6e6];return _0xc75ff0;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2ee822,_0x4c15ab){var _0x3df987=function(_0x29e89a){while(--_0x29e89a){_0x2ee822['push'](_0x2ee822['shift']());}};_0x3df987(++_0x4c15ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 817024b..fdc2f28 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 _0xb748=['rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xb748,0xd7));var _0x8b74=function(_0x18271c,_0x42c545){_0x18271c=_0x18271c-0x0;var _0x5f1dfa=_0xb748[_0x18271c];return _0x5f1dfa;};'use strict';var emlformat=require(_0x8b74('0x0'));var rimraf=require(_0x8b74('0x1'));var zipdir=require(_0x8b74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b74('0x3'));var moment=require('moment');var BPromise=require(_0x8b74('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8b74('0x5'));var sox=require(_0x8b74('0x6'));var csv=require(_0x8b74('0x7'));var ejs=require(_0x8b74('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b74('0x9'));var squel=require(_0x8b74('0xa'));var crypto=require(_0x8b74('0xb'));var jsforce=require(_0x8b74('0xc'));var deskjs=require(_0x8b74('0xd'));var toCsv=require(_0x8b74('0x7'));var querystring=require(_0x8b74('0xe'));var Papa=require(_0x8b74('0xf'));var Redis=require(_0x8b74('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b74('0x11'));var as=require(_0x8b74('0x12'));var hardwareService=require(_0x8b74('0x13'));var logger=require(_0x8b74('0x14'))('api');var utils=require(_0x8b74('0x15'));var config=require(_0x8b74('0x16'));var licenseUtil=require(_0x8b74('0x17'));var db=require(_0x8b74('0x18'))['db'];function respondWithStatusCode(_0x3543bb,_0xecb068){_0xecb068=_0xecb068||0xcc;return function(_0xa037af){if(_0xa037af){return _0x3543bb[_0x8b74('0x19')](_0xecb068);}return _0x3543bb[_0x8b74('0x1a')](_0xecb068)[_0x8b74('0x1b')]();};}function respondWithResult(_0x26ad46,_0x4d34bb){_0x4d34bb=_0x4d34bb||0xc8;return function(_0x294997){if(_0x294997){return _0x26ad46[_0x8b74('0x1a')](_0x4d34bb)[_0x8b74('0x1c')](_0x294997);}};}function respondWithFilteredResult(_0xfcfd14,_0x171ca7){return function(_0xe1e38b){if(_0xe1e38b){var _0x3dadbb=typeof _0x171ca7['offset']===_0x8b74('0x1d')&&typeof _0x171ca7[_0x8b74('0x1e')]==='undefined';var _0x204b70=_0xe1e38b[_0x8b74('0x1f')];var _0x918bfc=_0x3dadbb?0x0:_0x171ca7[_0x8b74('0x20')];var _0x5e0cc8=_0x3dadbb?_0xe1e38b[_0x8b74('0x1f')]:_0x171ca7[_0x8b74('0x20')]+_0x171ca7['limit'];var _0x3a3d67;if(_0x5e0cc8>=_0x204b70){_0x5e0cc8=_0x204b70;_0x3a3d67=0xc8;}else{_0x3a3d67=0xce;}_0xfcfd14[_0x8b74('0x1a')](_0x3a3d67);return _0xfcfd14[_0x8b74('0x21')](_0x8b74('0x22'),_0x918bfc+'-'+_0x5e0cc8+'/'+_0x204b70)[_0x8b74('0x1c')](_0xe1e38b);}return null;};}function patchUpdates(_0x5aa6a3){return function(_0x513f41){try{jsonpatch[_0x8b74('0x23')](_0x513f41,_0x5aa6a3,!![]);}catch(_0x1dbc13){return BPromise['reject'](_0x1dbc13);}return _0x513f41[_0x8b74('0x24')]();};}function saveUpdates(_0x4aef84,_0xb4ecca){return function(_0x4b112e){if(_0x4b112e){return _0x4b112e['update'](_0x4aef84)[_0x8b74('0x25')](function(_0x12cca3){return _0x12cca3;});}return null;};}function removeEntity(_0x53c52f,_0x26c9f9){return function(_0x26ab48){if(_0x26ab48){return _0x26ab48[_0x8b74('0x26')]()[_0x8b74('0x25')](function(){_0x53c52f['status'](0xcc)[_0x8b74('0x1b')]();});}};}function handleEntityNotFound(_0x16f94d,_0x6256ed){return function(_0x401a32){if(!_0x401a32){_0x16f94d['sendStatus'](0x194);}return _0x401a32;};}function handleError(_0x4524de,_0x16edc7){_0x16edc7=_0x16edc7||0x1f4;return function(_0x5a65fe){logger['error'](_0x5a65fe['stack']);if(_0x5a65fe[_0x8b74('0x27')]){delete _0x5a65fe[_0x8b74('0x27')];}_0x4524de[_0x8b74('0x1a')](_0x16edc7)['send'](_0x5a65fe);};}exports['index']=function(_0x145c4a,_0x881c9c){var _0x51c0d9={},_0x47c65f={},_0x27f88f={'count':0x0,'rows':[]};var _0x1cd16f=_[_0x8b74('0x28')](db[_0x8b74('0x29')][_0x8b74('0x2a')],function(_0x22d107){return{'name':_0x22d107[_0x8b74('0x2b')],'type':_0x22d107[_0x8b74('0x2c')][_0x8b74('0x2d')]};});_0x47c65f[_0x8b74('0x2e')]=_['map'](_0x1cd16f,_0x8b74('0x27'));_0x47c65f[_0x8b74('0x2f')]=_['keys'](_0x145c4a[_0x8b74('0x2f')]);_0x47c65f['filters']=_[_0x8b74('0x30')](_0x47c65f[_0x8b74('0x2e')],_0x47c65f[_0x8b74('0x2f')]);_0x51c0d9[_0x8b74('0x31')]=_[_0x8b74('0x30')](_0x47c65f[_0x8b74('0x2e')],qs['fields'](_0x145c4a[_0x8b74('0x2f')][_0x8b74('0x32')]));_0x51c0d9[_0x8b74('0x31')]=_0x51c0d9['attributes'][_0x8b74('0x33')]?_0x51c0d9[_0x8b74('0x31')]:_0x47c65f[_0x8b74('0x2e')];if(!_0x145c4a['query'][_0x8b74('0x34')]('nolimit')){_0x51c0d9[_0x8b74('0x1e')]=qs[_0x8b74('0x1e')](_0x145c4a['query'][_0x8b74('0x1e')]);_0x51c0d9['offset']=qs[_0x8b74('0x20')](_0x145c4a[_0x8b74('0x2f')][_0x8b74('0x20')]);}_0x51c0d9[_0x8b74('0x35')]=qs['sort'](_0x145c4a[_0x8b74('0x2f')][_0x8b74('0x36')]);_0x51c0d9[_0x8b74('0x37')]=qs[_0x8b74('0x38')](_[_0x8b74('0x39')](_0x145c4a[_0x8b74('0x2f')],_0x47c65f[_0x8b74('0x38')]),_0x1cd16f);if(_0x145c4a[_0x8b74('0x2f')][_0x8b74('0x3a')]){_0x51c0d9[_0x8b74('0x37')]=_[_0x8b74('0x3b')](_0x51c0d9['where'],{'$or':_['map'](_0x1cd16f,function(_0x5326d1){if(_0x5326d1[_0x8b74('0x2c')]!=='VIRTUAL'){var _0x5f05aa={};_0x5f05aa[_0x5326d1[_0x8b74('0x27')]]={'$like':'%'+_0x145c4a[_0x8b74('0x2f')][_0x8b74('0x3a')]+'%'};return _0x5f05aa;}})});}_0x51c0d9=_[_0x8b74('0x3b')]({},_0x51c0d9,_0x145c4a[_0x8b74('0x3c')]);var _0xb567a8={'where':_0x51c0d9[_0x8b74('0x37')]};return db[_0x8b74('0x29')][_0x8b74('0x1f')](_0xb567a8)['then'](function(_0x14a195){_0x27f88f[_0x8b74('0x1f')]=_0x14a195;if(_0x145c4a['query']['includeAll']){_0x51c0d9[_0x8b74('0x3d')]=[{'all':!![]}];}return db[_0x8b74('0x29')][_0x8b74('0x3e')](_0x51c0d9);})[_0x8b74('0x25')](function(_0x27f79f){_0x27f88f[_0x8b74('0x3f')]=_0x27f79f;return _0x27f88f;})['then'](respondWithFilteredResult(_0x881c9c,_0x51c0d9))[_0x8b74('0x40')](handleError(_0x881c9c,null));};exports['show']=function(_0xf0f362,_0x4c4b0c){var _0x9a3d6a={'raw':!![],'where':{'id':_0xf0f362[_0x8b74('0x41')]['id']}},_0x3b51a3={};_0x3b51a3[_0x8b74('0x2e')]=_[_0x8b74('0x42')](db[_0x8b74('0x29')][_0x8b74('0x2a')]);_0x3b51a3[_0x8b74('0x2f')]=_[_0x8b74('0x42')](_0xf0f362['query']);_0x3b51a3[_0x8b74('0x38')]=_[_0x8b74('0x30')](_0x3b51a3['model'],_0x3b51a3['query']);_0x9a3d6a[_0x8b74('0x31')]=_[_0x8b74('0x30')](_0x3b51a3[_0x8b74('0x2e')],qs['fields'](_0xf0f362[_0x8b74('0x2f')][_0x8b74('0x32')]));_0x9a3d6a[_0x8b74('0x31')]=_0x9a3d6a[_0x8b74('0x31')][_0x8b74('0x33')]?_0x9a3d6a[_0x8b74('0x31')]:_0x3b51a3[_0x8b74('0x2e')];if(_0xf0f362['query'][_0x8b74('0x43')]){_0x9a3d6a[_0x8b74('0x3d')]=[{'all':!![]}];}_0x9a3d6a=_[_0x8b74('0x3b')]({},_0x9a3d6a,_0xf0f362[_0x8b74('0x3c')]);return db['OpenchannelTransferReport'][_0x8b74('0x44')](_0x9a3d6a)['then'](handleEntityNotFound(_0x4c4b0c,null))['then'](respondWithResult(_0x4c4b0c,null))[_0x8b74('0x40')](handleError(_0x4c4b0c,null));};exports[_0x8b74('0x45')]=function(_0x31af7b,_0x4b1cf4){return db[_0x8b74('0x29')][_0x8b74('0x45')](_0x31af7b[_0x8b74('0x46')],{})[_0x8b74('0x25')](respondWithResult(_0x4b1cf4,0xc9))[_0x8b74('0x40')](handleError(_0x4b1cf4,null));};exports['update']=function(_0x3f9c76,_0x42f8ac){if(_0x3f9c76[_0x8b74('0x46')]['id']){delete _0x3f9c76['body']['id'];}return db[_0x8b74('0x29')][_0x8b74('0x44')]({'where':{'id':_0x3f9c76['params']['id']}})[_0x8b74('0x25')](handleEntityNotFound(_0x42f8ac,null))[_0x8b74('0x25')](saveUpdates(_0x3f9c76[_0x8b74('0x46')],null))[_0x8b74('0x25')](respondWithResult(_0x42f8ac,null))[_0x8b74('0x40')](handleError(_0x42f8ac,null));};exports[_0x8b74('0x26')]=function(_0x496ffb,_0xf12a6){return db[_0x8b74('0x29')]['find']({'where':{'id':_0x496ffb[_0x8b74('0x41')]['id']}})['then'](handleEntityNotFound(_0xf12a6,null))[_0x8b74('0x25')](removeEntity(_0xf12a6,null))[_0x8b74('0x40')](handleError(_0xf12a6,null));};exports[_0x8b74('0x47')]=function(_0x1d7ab5,_0x4220a3){return db[_0x8b74('0x29')][_0x8b74('0x47')]()['then'](respondWithResult(_0x4220a3,null))[_0x8b74('0x40')](handleError(_0x4220a3,null));}; \ No newline at end of file +var _0x72bd=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','count','limit','set','apply','save','then','destroy','sendStatus','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x50c9cc,_0x46b750){var _0x49eda5=function(_0x4faea0){while(--_0x4faea0){_0x50c9cc['push'](_0x50c9cc['shift']());}};_0x49eda5(++_0x46b750);}(_0x72bd,0xcf));var _0xd72b=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x72bd[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xd72b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd72b('0x1'));var jsonpatch=require(_0xd72b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd72b('0x3'));var Mustache=require('mustache');var util=require(_0xd72b('0x4'));var path=require(_0xd72b('0x5'));var sox=require(_0xd72b('0x6'));var csv=require('to-csv');var ejs=require(_0xd72b('0x7'));var fs=require('fs');var fs_extra=require(_0xd72b('0x8'));var _=require(_0xd72b('0x9'));var squel=require(_0xd72b('0xa'));var crypto=require(_0xd72b('0xb'));var jsforce=require(_0xd72b('0xc'));var deskjs=require(_0xd72b('0xd'));var toCsv=require(_0xd72b('0xe'));var querystring=require(_0xd72b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd72b('0x10'));var qs=require(_0xd72b('0x11'));var as=require(_0xd72b('0x12'));var hardwareService=require(_0xd72b('0x13'));var logger=require('../../config/logger')(_0xd72b('0x14'));var utils=require(_0xd72b('0x15'));var config=require(_0xd72b('0x16'));var licenseUtil=require(_0xd72b('0x17'));var db=require(_0xd72b('0x18'))['db'];function respondWithStatusCode(_0x3ec422,_0x4b2cea){_0x4b2cea=_0x4b2cea||0xcc;return function(_0x2338b8){if(_0x2338b8){return _0x3ec422['sendStatus'](_0x4b2cea);}return _0x3ec422[_0xd72b('0x19')](_0x4b2cea)[_0xd72b('0x1a')]();};}function respondWithResult(_0x4f2681,_0x4e4c2e){_0x4e4c2e=_0x4e4c2e||0xc8;return function(_0x47e461){if(_0x47e461){return _0x4f2681[_0xd72b('0x19')](_0x4e4c2e)['json'](_0x47e461);}};}function respondWithFilteredResult(_0x42f52a,_0x49c014){return function(_0x72105a){if(_0x72105a){var _0xbee614=typeof _0x49c014[_0xd72b('0x1b')]==='undefined'&&typeof _0x49c014['limit']==='undefined';var _0x1f128b=_0x72105a[_0xd72b('0x1c')];var _0x255656=_0xbee614?0x0:_0x49c014[_0xd72b('0x1b')];var _0x4e41a7=_0xbee614?_0x72105a['count']:_0x49c014[_0xd72b('0x1b')]+_0x49c014[_0xd72b('0x1d')];var _0x5c9c1b;if(_0x4e41a7>=_0x1f128b){_0x4e41a7=_0x1f128b;_0x5c9c1b=0xc8;}else{_0x5c9c1b=0xce;}_0x42f52a['status'](_0x5c9c1b);return _0x42f52a[_0xd72b('0x1e')]('Content-Range',_0x255656+'-'+_0x4e41a7+'/'+_0x1f128b)['json'](_0x72105a);}return null;};}function patchUpdates(_0x43ff5a){return function(_0x3f2cc6){try{jsonpatch[_0xd72b('0x1f')](_0x3f2cc6,_0x43ff5a,!![]);}catch(_0x3c1f32){return BPromise['reject'](_0x3c1f32);}return _0x3f2cc6[_0xd72b('0x20')]();};}function saveUpdates(_0x582e48,_0x192041){return function(_0x8191bb){if(_0x8191bb){return _0x8191bb['update'](_0x582e48)[_0xd72b('0x21')](function(_0x35abac){return _0x35abac;});}return null;};}function removeEntity(_0x70c62d,_0x342968){return function(_0x1c1bbb){if(_0x1c1bbb){return _0x1c1bbb[_0xd72b('0x22')]()[_0xd72b('0x21')](function(){_0x70c62d[_0xd72b('0x19')](0xcc)[_0xd72b('0x1a')]();});}};}function handleEntityNotFound(_0x124eed,_0x236a9d){return function(_0x21d447){if(!_0x21d447){_0x124eed[_0xd72b('0x23')](0x194);}return _0x21d447;};}function handleError(_0x1e00e7,_0x346bc7){_0x346bc7=_0x346bc7||0x1f4;return function(_0x2dd9a6){logger['error'](_0x2dd9a6['stack']);if(_0x2dd9a6[_0xd72b('0x24')]){delete _0x2dd9a6[_0xd72b('0x24')];}_0x1e00e7['status'](_0x346bc7)['send'](_0x2dd9a6);};}exports['index']=function(_0x9ec165,_0x40b503){var _0x49291d={},_0x4467b6={},_0x20b714={'count':0x0,'rows':[]};var _0x293ce=_[_0xd72b('0x25')](db[_0xd72b('0x26')][_0xd72b('0x27')],function(_0x5254ab){return{'name':_0x5254ab[_0xd72b('0x28')],'type':_0x5254ab[_0xd72b('0x29')][_0xd72b('0x2a')]};});_0x4467b6['model']=_[_0xd72b('0x25')](_0x293ce,_0xd72b('0x24'));_0x4467b6['query']=_[_0xd72b('0x2b')](_0x9ec165[_0xd72b('0x2c')]);_0x4467b6[_0xd72b('0x2d')]=_[_0xd72b('0x2e')](_0x4467b6[_0xd72b('0x2f')],_0x4467b6[_0xd72b('0x2c')]);_0x49291d['attributes']=_[_0xd72b('0x2e')](_0x4467b6['model'],qs[_0xd72b('0x30')](_0x9ec165['query'][_0xd72b('0x30')]));_0x49291d['attributes']=_0x49291d[_0xd72b('0x31')][_0xd72b('0x32')]?_0x49291d[_0xd72b('0x31')]:_0x4467b6[_0xd72b('0x2f')];if(!_0x9ec165[_0xd72b('0x2c')][_0xd72b('0x33')](_0xd72b('0x34'))){_0x49291d[_0xd72b('0x1d')]=qs[_0xd72b('0x1d')](_0x9ec165[_0xd72b('0x2c')]['limit']);_0x49291d[_0xd72b('0x1b')]=qs[_0xd72b('0x1b')](_0x9ec165[_0xd72b('0x2c')][_0xd72b('0x1b')]);}_0x49291d[_0xd72b('0x35')]=qs[_0xd72b('0x36')](_0x9ec165['query']['sort']);_0x49291d[_0xd72b('0x37')]=qs[_0xd72b('0x2d')](_[_0xd72b('0x38')](_0x9ec165[_0xd72b('0x2c')],_0x4467b6[_0xd72b('0x2d')]),_0x293ce);if(_0x9ec165['query'][_0xd72b('0x39')]){_0x49291d[_0xd72b('0x37')]=_[_0xd72b('0x3a')](_0x49291d[_0xd72b('0x37')],{'$or':_[_0xd72b('0x25')](_0x293ce,function(_0xc36ef1){if(_0xc36ef1['type']!==_0xd72b('0x3b')){var _0x1e67fa={};_0x1e67fa[_0xc36ef1[_0xd72b('0x24')]]={'$like':'%'+_0x9ec165[_0xd72b('0x2c')][_0xd72b('0x39')]+'%'};return _0x1e67fa;}})});}_0x49291d=_[_0xd72b('0x3a')]({},_0x49291d,_0x9ec165['options']);var _0x4dd753={'where':_0x49291d[_0xd72b('0x37')]};return db[_0xd72b('0x26')]['count'](_0x4dd753)[_0xd72b('0x21')](function(_0x4d1dbb){_0x20b714[_0xd72b('0x1c')]=_0x4d1dbb;if(_0x9ec165[_0xd72b('0x2c')]['includeAll']){_0x49291d['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xd72b('0x3c')](_0x49291d);})['then'](function(_0xdd394a){_0x20b714[_0xd72b('0x3d')]=_0xdd394a;return _0x20b714;})[_0xd72b('0x21')](respondWithFilteredResult(_0x40b503,_0x49291d))[_0xd72b('0x3e')](handleError(_0x40b503,null));};exports[_0xd72b('0x3f')]=function(_0x45e1aa,_0x4d47ee){var _0x3406ce={'raw':!![],'where':{'id':_0x45e1aa[_0xd72b('0x40')]['id']}},_0x4f96e5={};_0x4f96e5[_0xd72b('0x2f')]=_[_0xd72b('0x2b')](db[_0xd72b('0x26')][_0xd72b('0x27')]);_0x4f96e5['query']=_[_0xd72b('0x2b')](_0x45e1aa[_0xd72b('0x2c')]);_0x4f96e5[_0xd72b('0x2d')]=_[_0xd72b('0x2e')](_0x4f96e5[_0xd72b('0x2f')],_0x4f96e5[_0xd72b('0x2c')]);_0x3406ce[_0xd72b('0x31')]=_[_0xd72b('0x2e')](_0x4f96e5[_0xd72b('0x2f')],qs[_0xd72b('0x30')](_0x45e1aa['query'][_0xd72b('0x30')]));_0x3406ce[_0xd72b('0x31')]=_0x3406ce[_0xd72b('0x31')][_0xd72b('0x32')]?_0x3406ce[_0xd72b('0x31')]:_0x4f96e5['model'];if(_0x45e1aa[_0xd72b('0x2c')][_0xd72b('0x41')]){_0x3406ce[_0xd72b('0x42')]=[{'all':!![]}];}_0x3406ce=_[_0xd72b('0x3a')]({},_0x3406ce,_0x45e1aa[_0xd72b('0x43')]);return db['OpenchannelTransferReport']['find'](_0x3406ce)[_0xd72b('0x21')](handleEntityNotFound(_0x4d47ee,null))[_0xd72b('0x21')](respondWithResult(_0x4d47ee,null))[_0xd72b('0x3e')](handleError(_0x4d47ee,null));};exports[_0xd72b('0x44')]=function(_0x16bffd,_0x2ac157){return db[_0xd72b('0x26')][_0xd72b('0x44')](_0x16bffd[_0xd72b('0x45')],{})[_0xd72b('0x21')](respondWithResult(_0x2ac157,0xc9))['catch'](handleError(_0x2ac157,null));};exports['update']=function(_0x97cea8,_0x471e40){if(_0x97cea8[_0xd72b('0x45')]['id']){delete _0x97cea8[_0xd72b('0x45')]['id'];}return db['OpenchannelTransferReport'][_0xd72b('0x46')]({'where':{'id':_0x97cea8[_0xd72b('0x40')]['id']}})[_0xd72b('0x21')](handleEntityNotFound(_0x471e40,null))['then'](saveUpdates(_0x97cea8[_0xd72b('0x45')],null))[_0xd72b('0x21')](respondWithResult(_0x471e40,null))[_0xd72b('0x3e')](handleError(_0x471e40,null));};exports['destroy']=function(_0x27011b,_0x31acad){return db[_0xd72b('0x26')][_0xd72b('0x46')]({'where':{'id':_0x27011b[_0xd72b('0x40')]['id']}})[_0xd72b('0x21')](handleEntityNotFound(_0x31acad,null))[_0xd72b('0x21')](removeEntity(_0x31acad,null))['catch'](handleError(_0x31acad,null));};exports[_0xd72b('0x47')]=function(_0x1acc31,_0x1ef281){return db['OpenchannelTransferReport'][_0xd72b('0x47')]()[_0xd72b('0x21')](respondWithResult(_0x1ef281,null))[_0xd72b('0x3e')](handleError(_0x1ef281,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index c73624b..93f1288 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 _0x30b2=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','path'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x30b2,0xd7));var _0x230b=function(_0x490ccd,_0x135b99){_0x490ccd=_0x490ccd-0x0;var _0x1fbf40=_0x30b2[_0x490ccd];return _0x1fbf40;};'use strict';var _=require(_0x230b('0x0'));var util=require('util');var logger=require(_0x230b('0x1'))(_0x230b('0x2'));var moment=require('moment');var BPromise=require(_0x230b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x230b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x230b('0x5'));module[_0x230b('0x6')]=function(_0x3e37ac,_0x54a6f0){return _0x3e37ac[_0x230b('0x7')](_0x230b('0x8'),attributes,{'tableName':_0x230b('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x230b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdf5=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x10e166,_0x13af25){var _0x34d505=function(_0x26eded){while(--_0x26eded){_0x10e166['push'](_0x10e166['shift']());}};_0x34d505(++_0x13af25);}(_0xcdf5,0x127));var _0x5cdf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcdf5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5cdf('0x0'));var util=require(_0x5cdf('0x1'));var logger=require(_0x5cdf('0x2'))(_0x5cdf('0x3'));var moment=require(_0x5cdf('0x4'));var BPromise=require(_0x5cdf('0x5'));var rp=require(_0x5cdf('0x6'));var fs=require('fs');var path=require(_0x5cdf('0x7'));var rimraf=require(_0x5cdf('0x8'));var config=require(_0x5cdf('0x9'));var attributes=require(_0x5cdf('0xa'));module[_0x5cdf('0xb')]=function(_0x2ed1ea,_0x1b739d){return _0x2ed1ea[_0x5cdf('0xc')](_0x5cdf('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5cdf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f477ad4..1b7b55d 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 _0x2494=['../../config/utils','../../config/environment','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2fb19a,_0x15729){var _0xac58ac=function(_0x1a43eb){while(--_0x1a43eb){_0x2fb19a['push'](_0x2fb19a['shift']());}};_0xac58ac(++_0x15729);}(_0x2494,0x82));var _0x4249=function(_0x58a1ac,_0x5a2b3e){_0x58a1ac=_0x58a1ac-0x0;var _0xdc77e1=_0x2494[_0x58a1ac];return _0xdc77e1;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file +var _0x7f42=['message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e4e48,_0x322a92){var _0x2642a0=function(_0x441f97){while(--_0x441f97){_0x2e4e48['push'](_0x2e4e48['shift']());}};_0x2642a0(++_0x322a92);}(_0x7f42,0x1dd));var _0x27f4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7f42[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var moment=require(_0x27f4('0x1'));var BPromise=require(_0x27f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f4('0x4'));var logger=require('../../config/logger')(_0x27f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x27f4('0x6'));var client=jayson['client'][_0x27f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a85f2,_0xd283e2,_0x3010e3){return new BPromise(function(_0x2a4b6f,_0x9bc56e){return client[_0x27f4('0x8')](_0x1a85f2,_0x3010e3)[_0x27f4('0x9')](function(_0xe67021){logger[_0x27f4('0xa')](_0x27f4('0xb'),_0xd283e2,_0x27f4('0xc'));logger[_0x27f4('0xd')](_0x27f4('0xe'),_0xd283e2,_0x27f4('0xc'),JSON[_0x27f4('0xf')](_0xe67021));if(_0xe67021[_0x27f4('0x10')]){if(_0xe67021[_0x27f4('0x10')]['code']===0x1f4){logger['error'](_0x27f4('0xb'),_0xd283e2,_0xe67021[_0x27f4('0x10')][_0x27f4('0x11')]);return _0x9bc56e(_0xe67021[_0x27f4('0x10')][_0x27f4('0x11')]);}logger[_0x27f4('0x10')](_0x27f4('0xb'),_0xd283e2,_0xe67021[_0x27f4('0x10')]['message']);return _0x2a4b6f(_0xe67021['error'][_0x27f4('0x11')]);}else{logger[_0x27f4('0xa')](_0x27f4('0xb'),_0xd283e2,_0x27f4('0xc'));_0x2a4b6f(_0xe67021['result'][_0x27f4('0x11')]);}})[_0x27f4('0x12')](function(_0x321821){logger['error'](_0x27f4('0xb'),_0xd283e2,_0x321821);_0x9bc56e(_0x321821);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0ce9ddf..1b3f471 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 _0xec41=['create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','post'];(function(_0x5adf21,_0x113754){var _0x50e98f=function(_0x1428da){while(--_0x1428da){_0x5adf21['push'](_0x5adf21['shift']());}};_0x50e98f(++_0x113754);}(_0xec41,0x19c));var _0x1ec4=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0xec41[_0x24618a];return _0x2e3d64;};'use strict';var multer=require('multer');var util=require(_0x1ec4('0x0'));var path=require(_0x1ec4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ec4('0x2'));var router=express[_0x1ec4('0x3')]();var fs_extra=require(_0x1ec4('0x4'));var auth=require(_0x1ec4('0x5'));var interaction=require(_0x1ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x1ec4('0x7'));router[_0x1ec4('0x8')]('/',auth[_0x1ec4('0x9')](),controller[_0x1ec4('0xa')]);router[_0x1ec4('0x8')](_0x1ec4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1ec4('0xc')]('/',auth[_0x1ec4('0x9')](),controller[_0x1ec4('0xd')]);router[_0x1ec4('0xe')](_0x1ec4('0xb'),auth[_0x1ec4('0x9')](),controller['update']);router[_0x1ec4('0xf')](_0x1ec4('0xb'),auth[_0x1ec4('0x9')](),controller[_0x1ec4('0x10')]);module['exports']=router; \ No newline at end of file +var _0x885b=['post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show'];(function(_0x1f2227,_0x117574){var _0x20f76a=function(_0x4d765a){while(--_0x4d765a){_0x1f2227['push'](_0x1f2227['shift']());}};_0x20f76a(++_0x117574);}(_0x885b,0x73));var _0xb885=function(_0x4696eb,_0x4a1171){_0x4696eb=_0x4696eb-0x0;var _0x552451=_0x885b[_0x4696eb];return _0x552451;};'use strict';var multer=require(_0xb885('0x0'));var util=require(_0xb885('0x1'));var path=require(_0xb885('0x2'));var timeout=require(_0xb885('0x3'));var express=require('express');var router=express[_0xb885('0x4')]();var fs_extra=require(_0xb885('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb885('0x6'));var config=require(_0xb885('0x7'));var controller=require('./pause.controller');router['get']('/',auth[_0xb885('0x8')](),controller[_0xb885('0x9')]);router['get']('/:id',auth[_0xb885('0x8')](),controller[_0xb885('0xa')]);router[_0xb885('0xb')]('/',auth[_0xb885('0x8')](),controller[_0xb885('0xc')]);router['put'](_0xb885('0xd'),auth['isAuthenticated'](),controller[_0xb885('0xe')]);router[_0xb885('0xf')]('/:id',auth[_0xb885('0x8')](),controller[_0xb885('0x10')]);module[_0xb885('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 1ee4b2a..deb6907 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 _0x8126=['name','sequelize','exports','STRING'];(function(_0x2acd99,_0x55a1a4){var _0x44bf61=function(_0x27b0e6){while(--_0x27b0e6){_0x2acd99['push'](_0x2acd99['shift']());}};_0x44bf61(++_0x55a1a4);}(_0x8126,0x19d));var _0x6812=function(_0x58256e,_0x48f062){_0x58256e=_0x58256e-0x0;var _0xc9e57b=_0x8126[_0x58256e];return _0xc9e57b;};'use strict';var Sequelize=require(_0x6812('0x0'));module[_0x6812('0x1')]={'name':{'type':Sequelize[_0x6812('0x2')],'unique':_0x6812('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6812('0x2')]}}; \ No newline at end of file +var _0x8a90=['STRING','name','sequelize'];(function(_0x3f8f11,_0x5078e8){var _0x56a10d=function(_0x4a990e){while(--_0x4a990e){_0x3f8f11['push'](_0x3f8f11['shift']());}};_0x56a10d(++_0x5078e8);}(_0x8a90,0x1ac));var _0x08a9=function(_0x43824c,_0x34037e){_0x43824c=_0x43824c-0x0;var _0x51e37a=_0x8a90[_0x43824c];return _0x51e37a;};'use strict';var Sequelize=require(_0x08a9('0x0'));module['exports']={'name':{'type':Sequelize[_0x08a9('0x1')],'unique':_0x08a9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x08a9('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 87627f9..36219db 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 _0xc949=['Content-Range','apply','reject','save','update','then','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xc949,0x139));var _0x9c94=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc949[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require(_0x9c94('0x1'));var zipdir=require(_0x9c94('0x2'));var jsonpatch=require(_0x9c94('0x3'));var rp=require(_0x9c94('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9c94('0x5'));var sox=require(_0x9c94('0x6'));var csv=require(_0x9c94('0x7'));var ejs=require(_0x9c94('0x8'));var fs=require('fs');var fs_extra=require(_0x9c94('0x9'));var _=require(_0x9c94('0xa'));var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9c94('0xf'));var Papa=require('papaparse');var Redis=require(_0x9c94('0x10'));var authService=require(_0x9c94('0x11'));var qs=require(_0x9c94('0x12'));var as=require(_0x9c94('0x13'));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(_0xa500c0,_0x19f8cf){_0x19f8cf=_0x19f8cf||0xcc;return function(_0x2e783b){if(_0x2e783b){return _0xa500c0[_0x9c94('0x1b')](_0x19f8cf);}return _0xa500c0[_0x9c94('0x1c')](_0x19f8cf)[_0x9c94('0x1d')]();};}function respondWithResult(_0x1b28c5,_0x13e03a){_0x13e03a=_0x13e03a||0xc8;return function(_0x41c106){if(_0x41c106){return _0x1b28c5['status'](_0x13e03a)[_0x9c94('0x1e')](_0x41c106);}};}function respondWithFilteredResult(_0x5a201b,_0x5c9b3a){return function(_0x540cdd){if(_0x540cdd){var _0x46e982=typeof _0x5c9b3a[_0x9c94('0x1f')]===_0x9c94('0x20')&&typeof _0x5c9b3a[_0x9c94('0x21')]===_0x9c94('0x20');var _0x129ebd=_0x540cdd[_0x9c94('0x22')];var _0x52ece8=_0x46e982?0x0:_0x5c9b3a[_0x9c94('0x1f')];var _0x16a93c=_0x46e982?_0x540cdd[_0x9c94('0x22')]:_0x5c9b3a['offset']+_0x5c9b3a[_0x9c94('0x21')];var _0x48bb9d;if(_0x16a93c>=_0x129ebd){_0x16a93c=_0x129ebd;_0x48bb9d=0xc8;}else{_0x48bb9d=0xce;}_0x5a201b[_0x9c94('0x1c')](_0x48bb9d);return _0x5a201b['set'](_0x9c94('0x23'),_0x52ece8+'-'+_0x16a93c+'/'+_0x129ebd)['json'](_0x540cdd);}return null;};}function patchUpdates(_0x4c902d){return function(_0x2dbfc3){try{jsonpatch[_0x9c94('0x24')](_0x2dbfc3,_0x4c902d,!![]);}catch(_0x3fdd45){return BPromise[_0x9c94('0x25')](_0x3fdd45);}return _0x2dbfc3[_0x9c94('0x26')]();};}function saveUpdates(_0x1977d8,_0x518e85){return function(_0x482217){if(_0x482217){return _0x482217[_0x9c94('0x27')](_0x1977d8)[_0x9c94('0x28')](function(_0x1a4734){return _0x1a4734;});}return null;};}function removeEntity(_0xae4be4,_0x2d0e1f){return function(_0x324e46){if(_0x324e46){return _0x324e46['destroy']()[_0x9c94('0x28')](function(){var _0x10969f=_0x324e46['get']({'plain':!![]});var _0x354017=_0x9c94('0x29');return db[_0x9c94('0x2a')]['destroy']({'where':{'type':_0x354017,'resourceId':_0x10969f['id']}})['then'](function(){return _0x324e46;});})[_0x9c94('0x28')](function(){_0xae4be4['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x381a18,_0x18d2f8){return function(_0x5f406d){if(!_0x5f406d){_0x381a18[_0x9c94('0x1b')](0x194);}return _0x5f406d;};}function handleError(_0x5c385b,_0x5ae262){_0x5ae262=_0x5ae262||0x1f4;return function(_0x48620a){logger[_0x9c94('0x2b')](_0x48620a[_0x9c94('0x2c')]);if(_0x48620a[_0x9c94('0x2d')]){delete _0x48620a[_0x9c94('0x2d')];}_0x5c385b['status'](_0x5ae262)[_0x9c94('0x2e')](_0x48620a);};}exports[_0x9c94('0x2f')]=function(_0x3affd4,_0x4664e0){var _0x2db239={},_0x490f00={},_0x17d7b9={'count':0x0,'rows':[]};var _0x51462b=_[_0x9c94('0x30')](db[_0x9c94('0x31')]['rawAttributes'],function(_0x572d3f){return{'name':_0x572d3f[_0x9c94('0x32')],'type':_0x572d3f['type'][_0x9c94('0x33')]};});_0x490f00[_0x9c94('0x34')]=_[_0x9c94('0x30')](_0x51462b,_0x9c94('0x2d'));_0x490f00[_0x9c94('0x35')]=_[_0x9c94('0x36')](_0x3affd4[_0x9c94('0x35')]);_0x490f00['filters']=_['intersection'](_0x490f00[_0x9c94('0x34')],_0x490f00[_0x9c94('0x35')]);_0x2db239[_0x9c94('0x37')]=_[_0x9c94('0x38')](_0x490f00[_0x9c94('0x34')],qs[_0x9c94('0x39')](_0x3affd4['query'][_0x9c94('0x39')]));_0x2db239['attributes']=_0x2db239['attributes']['length']?_0x2db239['attributes']:_0x490f00[_0x9c94('0x34')];if(!_0x3affd4[_0x9c94('0x35')][_0x9c94('0x3a')]('nolimit')){_0x2db239[_0x9c94('0x21')]=qs[_0x9c94('0x21')](_0x3affd4['query'][_0x9c94('0x21')]);_0x2db239[_0x9c94('0x1f')]=qs['offset'](_0x3affd4[_0x9c94('0x35')]['offset']);}_0x2db239[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x3affd4[_0x9c94('0x35')][_0x9c94('0x3c')]);_0x2db239['where']=qs['filters'](_[_0x9c94('0x3d')](_0x3affd4[_0x9c94('0x35')],_0x490f00[_0x9c94('0x3e')]),_0x51462b);if(_0x3affd4[_0x9c94('0x35')][_0x9c94('0x3f')]){_0x2db239[_0x9c94('0x40')]=_[_0x9c94('0x41')](_0x2db239[_0x9c94('0x40')],{'$or':_[_0x9c94('0x30')](_0x51462b,function(_0x500366){if(_0x500366[_0x9c94('0x42')]!==_0x9c94('0x43')){var _0x141461={};_0x141461[_0x500366['name']]={'$like':'%'+_0x3affd4[_0x9c94('0x35')][_0x9c94('0x3f')]+'%'};return _0x141461;}})});}_0x2db239=_[_0x9c94('0x41')]({},_0x2db239,_0x3affd4[_0x9c94('0x44')]);var _0x52afaf={'where':_0x2db239[_0x9c94('0x40')]};return db[_0x9c94('0x31')][_0x9c94('0x22')](_0x52afaf)[_0x9c94('0x28')](function(_0x4be594){_0x17d7b9['count']=_0x4be594;if(_0x3affd4[_0x9c94('0x35')][_0x9c94('0x45')]){_0x2db239[_0x9c94('0x46')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x2db239);})[_0x9c94('0x28')](function(_0xb78295){_0x17d7b9[_0x9c94('0x47')]=_0xb78295;return _0x17d7b9;})[_0x9c94('0x28')](respondWithFilteredResult(_0x4664e0,_0x2db239))[_0x9c94('0x48')](handleError(_0x4664e0,null));};exports[_0x9c94('0x49')]=function(_0x2a3707,_0x47625c){var _0x49185f={'raw':!![],'where':{'id':_0x2a3707[_0x9c94('0x4a')]['id']}},_0xbf46c4={};_0xbf46c4[_0x9c94('0x34')]=_[_0x9c94('0x36')](db[_0x9c94('0x31')][_0x9c94('0x4b')]);_0xbf46c4[_0x9c94('0x35')]=_[_0x9c94('0x36')](_0x2a3707['query']);_0xbf46c4[_0x9c94('0x3e')]=_[_0x9c94('0x38')](_0xbf46c4['model'],_0xbf46c4['query']);_0x49185f[_0x9c94('0x37')]=_[_0x9c94('0x38')](_0xbf46c4['model'],qs[_0x9c94('0x39')](_0x2a3707[_0x9c94('0x35')]['fields']));_0x49185f[_0x9c94('0x37')]=_0x49185f[_0x9c94('0x37')][_0x9c94('0x4c')]?_0x49185f[_0x9c94('0x37')]:_0xbf46c4['model'];if(_0x2a3707[_0x9c94('0x35')][_0x9c94('0x45')]){_0x49185f[_0x9c94('0x46')]=[{'all':!![]}];}_0x49185f=_[_0x9c94('0x41')]({},_0x49185f,_0x2a3707[_0x9c94('0x44')]);return db[_0x9c94('0x31')][_0x9c94('0x4d')](_0x49185f)[_0x9c94('0x28')](handleEntityNotFound(_0x47625c,null))[_0x9c94('0x28')](respondWithResult(_0x47625c,null))['catch'](handleError(_0x47625c,null));};exports[_0x9c94('0x4e')]=function(_0x1929ff,_0x1e1a3c){return db[_0x9c94('0x31')][_0x9c94('0x4e')](_0x1929ff[_0x9c94('0x4f')],{})['then'](function(_0x44e716){var _0x430a96=_0x1929ff[_0x9c94('0x50')][_0x9c94('0x51')]({'plain':!![]});if(!_0x430a96)throw new Error(_0x9c94('0x52'));if(_0x430a96[_0x9c94('0x53')]==='user'){var _0x4e3021=_0x44e716['get']({'plain':!![]});var _0x42ec60='Pauses';return db[_0x9c94('0x54')][_0x9c94('0x4d')]({'where':{'name':_0x42ec60,'userProfileId':_0x430a96[_0x9c94('0x55')]},'raw':!![]})['then'](function(_0x1906f0){if(_0x1906f0&&_0x1906f0['autoAssociation']===0x0){return db[_0x9c94('0x2a')]['create']({'name':_0x4e3021[_0x9c94('0x2d')],'resourceId':_0x4e3021['id'],'type':_0x1906f0['name'],'sectionId':_0x1906f0['id']},{})[_0x9c94('0x28')](function(){return _0x44e716;});}else{return _0x44e716;}})[_0x9c94('0x48')](function(_0x577cb5){logger[_0x9c94('0x2b')](_0x9c94('0x56'),_0x577cb5);throw _0x577cb5;});}return _0x44e716;})['then'](respondWithResult(_0x1e1a3c,0xc9))[_0x9c94('0x48')](handleError(_0x1e1a3c,null));};exports['update']=function(_0x51068c,_0x5b830b){if(_0x51068c[_0x9c94('0x4f')]['id']){delete _0x51068c[_0x9c94('0x4f')]['id'];}return db[_0x9c94('0x31')]['find']({'where':{'id':_0x51068c['params']['id']}})['then'](handleEntityNotFound(_0x5b830b,null))[_0x9c94('0x28')](saveUpdates(_0x51068c['body'],null))[_0x9c94('0x28')](respondWithResult(_0x5b830b,null))[_0x9c94('0x48')](handleError(_0x5b830b,null));};exports['destroy']=function(_0x25f8da,_0x35c7ed){return db[_0x9c94('0x31')][_0x9c94('0x4d')]({'where':{'id':_0x25f8da[_0x9c94('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35c7ed,null))['then'](removeEntity(_0x35c7ed,null))['catch'](handleError(_0x35c7ed,null));}; \ No newline at end of file +var _0xc6b7=['key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','end','sendStatus','error','stack','name','send','map','Pause','rawAttributes','fieldName','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6b7,0x169));var _0x7c6b=function(_0x4829e7,_0x36c511){_0x4829e7=_0x4829e7-0x0;var _0x122e73=_0xc6b7[_0x4829e7];return _0x122e73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c6b('0x1'));var rp=require(_0x7c6b('0x2'));var moment=require(_0x7c6b('0x3'));var BPromise=require(_0x7c6b('0x4'));var Mustache=require('mustache');var util=require(_0x7c6b('0x5'));var path=require(_0x7c6b('0x6'));var sox=require('sox');var csv=require(_0x7c6b('0x7'));var ejs=require(_0x7c6b('0x8'));var fs=require('fs');var fs_extra=require(_0x7c6b('0x9'));var _=require(_0x7c6b('0xa'));var squel=require(_0x7c6b('0xb'));var crypto=require(_0x7c6b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c6b('0xd'));var toCsv=require(_0x7c6b('0x7'));var querystring=require(_0x7c6b('0xe'));var Papa=require(_0x7c6b('0xf'));var Redis=require(_0x7c6b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7c6b('0x11'));var as=require(_0x7c6b('0x12'));var hardwareService=require(_0x7c6b('0x13'));var logger=require(_0x7c6b('0x14'))(_0x7c6b('0x15'));var utils=require(_0x7c6b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7c6b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28d842,_0x5aab18){_0x5aab18=_0x5aab18||0xcc;return function(_0x340e7a){if(_0x340e7a){return _0x28d842['sendStatus'](_0x5aab18);}return _0x28d842[_0x7c6b('0x18')](_0x5aab18)['end']();};}function respondWithResult(_0x3b24e9,_0x412c48){_0x412c48=_0x412c48||0xc8;return function(_0x13a621){if(_0x13a621){return _0x3b24e9[_0x7c6b('0x18')](_0x412c48)[_0x7c6b('0x19')](_0x13a621);}};}function respondWithFilteredResult(_0x4bdc4a,_0x1d288a){return function(_0x15d4c3){if(_0x15d4c3){var _0x30a378=typeof _0x1d288a[_0x7c6b('0x1a')]==='undefined'&&typeof _0x1d288a[_0x7c6b('0x1b')]==='undefined';var _0x15963a=_0x15d4c3[_0x7c6b('0x1c')];var _0x210312=_0x30a378?0x0:_0x1d288a[_0x7c6b('0x1a')];var _0x1fa825=_0x30a378?_0x15d4c3[_0x7c6b('0x1c')]:_0x1d288a['offset']+_0x1d288a[_0x7c6b('0x1b')];var _0xdc543f;if(_0x1fa825>=_0x15963a){_0x1fa825=_0x15963a;_0xdc543f=0xc8;}else{_0xdc543f=0xce;}_0x4bdc4a[_0x7c6b('0x18')](_0xdc543f);return _0x4bdc4a['set'](_0x7c6b('0x1d'),_0x210312+'-'+_0x1fa825+'/'+_0x15963a)['json'](_0x15d4c3);}return null;};}function patchUpdates(_0x47bfb2){return function(_0x40a760){try{jsonpatch[_0x7c6b('0x1e')](_0x40a760,_0x47bfb2,!![]);}catch(_0x82089c){return BPromise[_0x7c6b('0x1f')](_0x82089c);}return _0x40a760[_0x7c6b('0x20')]();};}function saveUpdates(_0x222466,_0x49997e){return function(_0x171d89){if(_0x171d89){return _0x171d89[_0x7c6b('0x21')](_0x222466)[_0x7c6b('0x22')](function(_0x4eda69){return _0x4eda69;});}return null;};}function removeEntity(_0x5a2249,_0x50ed47){return function(_0x207d9b){if(_0x207d9b){return _0x207d9b[_0x7c6b('0x23')]()[_0x7c6b('0x22')](function(){var _0x211850=_0x207d9b[_0x7c6b('0x24')]({'plain':!![]});var _0x7779de=_0x7c6b('0x25');return db['UserProfileResource'][_0x7c6b('0x23')]({'where':{'type':_0x7779de,'resourceId':_0x211850['id']}})[_0x7c6b('0x22')](function(){return _0x207d9b;});})['then'](function(){_0x5a2249[_0x7c6b('0x18')](0xcc)[_0x7c6b('0x26')]();});}};}function handleEntityNotFound(_0x6e9423,_0x407ebd){return function(_0x25a0a2){if(!_0x25a0a2){_0x6e9423[_0x7c6b('0x27')](0x194);}return _0x25a0a2;};}function handleError(_0x28301f,_0x38fab1){_0x38fab1=_0x38fab1||0x1f4;return function(_0x3729d0){logger[_0x7c6b('0x28')](_0x3729d0[_0x7c6b('0x29')]);if(_0x3729d0[_0x7c6b('0x2a')]){delete _0x3729d0['name'];}_0x28301f[_0x7c6b('0x18')](_0x38fab1)[_0x7c6b('0x2b')](_0x3729d0);};}exports['index']=function(_0x55038f,_0x55e9a6){var _0x8a2b0={},_0x5ad006={},_0x3de090={'count':0x0,'rows':[]};var _0x376eed=_[_0x7c6b('0x2c')](db[_0x7c6b('0x2d')][_0x7c6b('0x2e')],function(_0x4a0a41){return{'name':_0x4a0a41[_0x7c6b('0x2f')],'type':_0x4a0a41[_0x7c6b('0x30')][_0x7c6b('0x31')]};});_0x5ad006['model']=_[_0x7c6b('0x2c')](_0x376eed,_0x7c6b('0x2a'));_0x5ad006[_0x7c6b('0x32')]=_[_0x7c6b('0x33')](_0x55038f[_0x7c6b('0x32')]);_0x5ad006[_0x7c6b('0x34')]=_['intersection'](_0x5ad006[_0x7c6b('0x35')],_0x5ad006['query']);_0x8a2b0[_0x7c6b('0x36')]=_[_0x7c6b('0x37')](_0x5ad006[_0x7c6b('0x35')],qs[_0x7c6b('0x38')](_0x55038f[_0x7c6b('0x32')][_0x7c6b('0x38')]));_0x8a2b0[_0x7c6b('0x36')]=_0x8a2b0[_0x7c6b('0x36')][_0x7c6b('0x39')]?_0x8a2b0[_0x7c6b('0x36')]:_0x5ad006[_0x7c6b('0x35')];if(!_0x55038f[_0x7c6b('0x32')]['hasOwnProperty'](_0x7c6b('0x3a'))){_0x8a2b0[_0x7c6b('0x1b')]=qs['limit'](_0x55038f[_0x7c6b('0x32')][_0x7c6b('0x1b')]);_0x8a2b0[_0x7c6b('0x1a')]=qs['offset'](_0x55038f['query'][_0x7c6b('0x1a')]);}_0x8a2b0['order']=qs['sort'](_0x55038f[_0x7c6b('0x32')][_0x7c6b('0x3b')]);_0x8a2b0[_0x7c6b('0x3c')]=qs['filters'](_[_0x7c6b('0x3d')](_0x55038f[_0x7c6b('0x32')],_0x5ad006[_0x7c6b('0x34')]),_0x376eed);if(_0x55038f[_0x7c6b('0x32')][_0x7c6b('0x3e')]){_0x8a2b0['where']=_[_0x7c6b('0x3f')](_0x8a2b0[_0x7c6b('0x3c')],{'$or':_['map'](_0x376eed,function(_0x457cb2){if(_0x457cb2[_0x7c6b('0x30')]!==_0x7c6b('0x40')){var _0x17cce8={};_0x17cce8[_0x457cb2[_0x7c6b('0x2a')]]={'$like':'%'+_0x55038f[_0x7c6b('0x32')][_0x7c6b('0x3e')]+'%'};return _0x17cce8;}})});}_0x8a2b0=_[_0x7c6b('0x3f')]({},_0x8a2b0,_0x55038f['options']);var _0x201ba9={'where':_0x8a2b0[_0x7c6b('0x3c')]};return db[_0x7c6b('0x2d')][_0x7c6b('0x1c')](_0x201ba9)[_0x7c6b('0x22')](function(_0x532169){_0x3de090[_0x7c6b('0x1c')]=_0x532169;if(_0x55038f['query']['includeAll']){_0x8a2b0[_0x7c6b('0x41')]=[{'all':!![]}];}return db[_0x7c6b('0x2d')][_0x7c6b('0x42')](_0x8a2b0);})[_0x7c6b('0x22')](function(_0x2e6e84){_0x3de090[_0x7c6b('0x43')]=_0x2e6e84;return _0x3de090;})[_0x7c6b('0x22')](respondWithFilteredResult(_0x55e9a6,_0x8a2b0))[_0x7c6b('0x44')](handleError(_0x55e9a6,null));};exports[_0x7c6b('0x45')]=function(_0x52cdce,_0x30215f){var _0x39bf9b={'raw':!![],'where':{'id':_0x52cdce[_0x7c6b('0x46')]['id']}},_0x219792={};_0x219792[_0x7c6b('0x35')]=_[_0x7c6b('0x33')](db[_0x7c6b('0x2d')][_0x7c6b('0x2e')]);_0x219792[_0x7c6b('0x32')]=_[_0x7c6b('0x33')](_0x52cdce['query']);_0x219792[_0x7c6b('0x34')]=_[_0x7c6b('0x37')](_0x219792[_0x7c6b('0x35')],_0x219792[_0x7c6b('0x32')]);_0x39bf9b[_0x7c6b('0x36')]=_['intersection'](_0x219792['model'],qs[_0x7c6b('0x38')](_0x52cdce[_0x7c6b('0x32')][_0x7c6b('0x38')]));_0x39bf9b[_0x7c6b('0x36')]=_0x39bf9b[_0x7c6b('0x36')][_0x7c6b('0x39')]?_0x39bf9b['attributes']:_0x219792[_0x7c6b('0x35')];if(_0x52cdce[_0x7c6b('0x32')]['includeAll']){_0x39bf9b[_0x7c6b('0x41')]=[{'all':!![]}];}_0x39bf9b=_[_0x7c6b('0x3f')]({},_0x39bf9b,_0x52cdce[_0x7c6b('0x47')]);return db['Pause'][_0x7c6b('0x48')](_0x39bf9b)[_0x7c6b('0x22')](handleEntityNotFound(_0x30215f,null))[_0x7c6b('0x22')](respondWithResult(_0x30215f,null))['catch'](handleError(_0x30215f,null));};exports[_0x7c6b('0x49')]=function(_0x146413,_0x4198c1){return db[_0x7c6b('0x2d')][_0x7c6b('0x49')](_0x146413[_0x7c6b('0x4a')],{})[_0x7c6b('0x22')](function(_0x4d09f0){var _0x5d1f4a=_0x146413[_0x7c6b('0x4b')][_0x7c6b('0x24')]({'plain':!![]});if(!_0x5d1f4a)throw new Error(_0x7c6b('0x4c'));if(_0x5d1f4a[_0x7c6b('0x4d')]===_0x7c6b('0x4b')){var _0x10d2b0=_0x4d09f0[_0x7c6b('0x24')]({'plain':!![]});var _0x3b73f0='Pauses';return db['UserProfileSection'][_0x7c6b('0x48')]({'where':{'name':_0x3b73f0,'userProfileId':_0x5d1f4a[_0x7c6b('0x4e')]},'raw':!![]})['then'](function(_0x3e8f91){if(_0x3e8f91&&_0x3e8f91[_0x7c6b('0x4f')]===0x0){return db[_0x7c6b('0x50')]['create']({'name':_0x10d2b0[_0x7c6b('0x2a')],'resourceId':_0x10d2b0['id'],'type':_0x3e8f91[_0x7c6b('0x2a')],'sectionId':_0x3e8f91['id']},{})[_0x7c6b('0x22')](function(){return _0x4d09f0;});}else{return _0x4d09f0;}})[_0x7c6b('0x44')](function(_0x2b969b){logger[_0x7c6b('0x28')](_0x7c6b('0x51'),_0x2b969b);throw _0x2b969b;});}return _0x4d09f0;})['then'](respondWithResult(_0x4198c1,0xc9))[_0x7c6b('0x44')](handleError(_0x4198c1,null));};exports[_0x7c6b('0x21')]=function(_0x59acab,_0x86b47){if(_0x59acab['body']['id']){delete _0x59acab[_0x7c6b('0x4a')]['id'];}return db[_0x7c6b('0x2d')][_0x7c6b('0x48')]({'where':{'id':_0x59acab[_0x7c6b('0x46')]['id']}})['then'](handleEntityNotFound(_0x86b47,null))[_0x7c6b('0x22')](saveUpdates(_0x59acab[_0x7c6b('0x4a')],null))['then'](respondWithResult(_0x86b47,null))['catch'](handleError(_0x86b47,null));};exports[_0x7c6b('0x23')]=function(_0x21b31b,_0x7a2079){return db[_0x7c6b('0x2d')][_0x7c6b('0x48')]({'where':{'id':_0x21b31b['params']['id']}})[_0x7c6b('0x22')](handleEntityNotFound(_0x7a2079,null))[_0x7c6b('0x22')](removeEntity(_0x7a2079,null))[_0x7c6b('0x44')](handleError(_0x7a2079,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 243f4c7..dde5fad 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x50b3ac,_0x2b55dc){_0x50b3ac=_0x50b3ac-0x0;var _0x5da59f=_0x6aa7[_0x50b3ac];return _0x5da59f;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 2acd11c..5bd1c0d 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(_0x5495b3,_0x10cd9a){var _0x5e6721=function(_0x3d08c2){while(--_0x3d08c2){_0x5495b3['push'](_0x5495b3['shift']());}};_0x5e6721(++_0x10cd9a);}(_0x7a54,0x106));var _0x47a5=function(_0x1224dd,_0x3d1875){_0x1224dd=_0x1224dd-0x0;var _0xa9a45d=_0x7a54[_0x1224dd];return _0xa9a45d;};'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(_0x45ec30,_0x5393f8){var _0x7ece9e=function(_0x3482b9){while(--_0x3482b9){_0x45ec30['push'](_0x45ec30['shift']());}};_0x7ece9e(++_0x5393f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xb10b[_0x30cd7e];return _0x462a02;};'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 4cd9174..707772b 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 _0xe5b3=['now','file','upload','/webhook','webhookPost','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','extname'];(function(_0x45c289,_0x43e029){var _0x41a76f=function(_0x2a4cfb){while(--_0x2a4cfb){_0x45c289['push'](_0x45c289['shift']());}};_0x41a76f(++_0x43e029);}(_0xe5b3,0x133));var _0x3e5b=function(_0x7094f5,_0x28c76e){_0x7094f5=_0x7094f5-0x0;var _0x4e6954=_0xe5b3[_0x7094f5];return _0x4e6954;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/webhook',controller[_0x3e5b('0xc')]);router[_0x3e5b('0xa')](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller['show']);router['get'](_0x3e5b('0xf'),auth[_0x3e5b('0xe')](),controller[_0x3e5b('0x10')]);var upload=multer({'storage':multer[_0x3e5b('0x11')]({'destination':function(_0xeeaabc,_0x522e9e,_0x3be027){_0x3be027(null,path['join'](config[_0x3e5b('0x12')],_0x3e5b('0x13')));},'filename':function(_0x4d69dd,_0x374068,_0x20b97b){_0x374068[_0x3e5b('0x14')]=_0x374068[_0x3e5b('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20b97b(null,util[_0x3e5b('0x15')]('%s-%s%s',path['basename'](_0x374068['originalname'],path[_0x3e5b('0x16')](_0x374068[_0x3e5b('0x14')])),Date[_0x3e5b('0x17')](),path['extname'](_0x374068[_0x3e5b('0x14')])));}})});router['post']('/',upload['single'](_0x3e5b('0x18')),controller[_0x3e5b('0x19')]);router['post'](_0x3e5b('0x1a'),controller[_0x3e5b('0x1b')]);router['put'](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller['update']);router['delete'](_0x3e5b('0xd'),auth[_0x3e5b('0xe')](),controller[_0x3e5b('0x1c')]);module[_0x3e5b('0x1d')]=router; \ No newline at end of file +var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x32b7b9,_0x3de1e6){var _0x2c5a74=function(_0x3dba68){while(--_0x3dba68){_0x32b7b9['push'](_0x32b7b9['shift']());}};_0x2c5a74(++_0x3de1e6);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4c568f,_0x40942b){_0x4c568f=_0x4c568f-0x0;var _0x546451=_0x4c4e[_0x4c568f];return _0x546451;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8db9567..d79555d 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 _0xae84=['exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never','sequelize'];(function(_0x533c09,_0xf5c417){var _0x1bd3b3=function(_0x5b6189){while(--_0x5b6189){_0x533c09['push'](_0x533c09['shift']());}};_0x1bd3b3(++_0xf5c417);}(_0xae84,0xf6));var _0x4ae8=function(_0x331a22,_0xa51c75){_0x331a22=_0x331a22-0x0;var _0x46bce2=_0xae84[_0x331a22];return _0x46bce2;};'use strict';var Sequelize=require(_0x4ae8('0x0'));module[_0x4ae8('0x1')]={'name':{'type':Sequelize[_0x4ae8('0x2')]},'type':{'type':Sequelize[_0x4ae8('0x3')](_0x4ae8('0x4'),_0x4ae8('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x4ae8('0x6')]},'path':{'type':Sequelize[_0x4ae8('0x2')],'comment':_0x4ae8('0x7')},'active':{'type':Sequelize[_0x4ae8('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x4ae8('0x9'),_0x4ae8('0xa'),_0x4ae8('0xb'),_0x4ae8('0xc')),'defaultValue':_0x4ae8('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x4ae8('0x2')]},'adminUrl':{'type':Sequelize[_0x4ae8('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x4ae8('0x2')]}}; \ No newline at end of file +var _0x5afa=['TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','script'];(function(_0x581a7b,_0x5b9f6b){var _0x42ea2c=function(_0x2b576c){while(--_0x2b576c){_0x581a7b['push'](_0x581a7b['shift']());}};_0x42ea2c(++_0x5b9f6b);}(_0x5afa,0x8a));var _0xa5af=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x5afa[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa5af('0x0')]},'type':{'type':Sequelize['ENUM']('html',_0xa5af('0x1'))},'description':{'type':Sequelize[_0xa5af('0x2')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xa5af('0x0')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa5af('0x3')},'sidebar':{'type':Sequelize[_0xa5af('0x4')](_0xa5af('0x5'),_0xa5af('0x6'),_0xa5af('0x7'),_0xa5af('0x8')),'defaultValue':_0xa5af('0x7'),'comment':_0xa5af('0x9')},'icon':{'type':Sequelize[_0xa5af('0x0')]},'adminUrl':{'type':Sequelize[_0xa5af('0x0')]},'agentUrl':{'type':Sequelize[_0xa5af('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa5af('0x0')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1d73e28..0daa567 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 _0x41fa=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','encoding','method','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','get','UserProfileResource','stack','name','send','index','Plugin','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','download','join','root','format','basename','createWriteStream','zip','warning','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Error','pipe','**/*','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','Plugin\x20not\x20found','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','Plugins'];(function(_0x153157,_0x157684){var _0x1a29e0=function(_0x140682){while(--_0x140682){_0x153157['push'](_0x153157['shift']());}};_0x1a29e0(++_0x157684);}(_0x41fa,0x168));var _0xa41f=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0x41fa[_0x529a0f];return _0x187a88;};'use strict';var emlformat=require(_0xa41f('0x0'));var rimraf=require(_0xa41f('0x1'));var zipdir=require(_0xa41f('0x2'));var jsonpatch=require(_0xa41f('0x3'));var rp=require(_0xa41f('0x4'));var moment=require(_0xa41f('0x5'));var BPromise=require(_0xa41f('0x6'));var Mustache=require('mustache');var util=require(_0xa41f('0x7'));var path=require(_0xa41f('0x8'));var sox=require(_0xa41f('0x9'));var csv=require(_0xa41f('0xa'));var ejs=require(_0xa41f('0xb'));var fs=require('fs');var fs_extra=require(_0xa41f('0xc'));var _=require(_0xa41f('0xd'));var squel=require(_0xa41f('0xe'));var crypto=require(_0xa41f('0xf'));var jsforce=require(_0xa41f('0x10'));var deskjs=require(_0xa41f('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa41f('0x12'));var extract=require('extract-zip');var rimraf=require(_0xa41f('0x1'));var archiver=require(_0xa41f('0x13'));var Redis=require(_0xa41f('0x14'));var authService=require(_0xa41f('0x15'));var qs=require(_0xa41f('0x16'));var as=require(_0xa41f('0x17'));var hardwareService=require(_0xa41f('0x18'));var logger=require(_0xa41f('0x19'))(_0xa41f('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa41f('0x1b')]=_['defaults'](config['redis'],{'host':_0xa41f('0x1c'),'port':0x18eb});var socket=require(_0xa41f('0x1d'))(new Redis(config[_0xa41f('0x1b')]));require(_0xa41f('0x1e'))['register'](socket);function respondWithStatusCode(_0xd72695,_0x18212c){_0x18212c=_0x18212c||0xcc;return function(_0x58afc2){if(_0x58afc2){return _0xd72695[_0xa41f('0x1f')](_0x18212c);}return _0xd72695[_0xa41f('0x20')](_0x18212c)[_0xa41f('0x21')]();};}function respondWithResult(_0xa31461,_0x2b43a2){_0x2b43a2=_0x2b43a2||0xc8;return function(_0x35a2c4){if(_0x35a2c4){return _0xa31461['status'](_0x2b43a2)[_0xa41f('0x22')](_0x35a2c4);}};}function respondWithFilteredResult(_0x5300e4,_0x4d0889){return function(_0x18fade){if(_0x18fade){var _0x41dacf=typeof _0x4d0889[_0xa41f('0x23')]==='undefined'&&typeof _0x4d0889[_0xa41f('0x24')]===_0xa41f('0x25');var _0x207041=_0x18fade[_0xa41f('0x26')];var _0x1d6b9e=_0x41dacf?0x0:_0x4d0889[_0xa41f('0x23')];var _0x53c4b4=_0x41dacf?_0x18fade[_0xa41f('0x26')]:_0x4d0889[_0xa41f('0x23')]+_0x4d0889[_0xa41f('0x24')];var _0x25fdff;if(_0x53c4b4>=_0x207041){_0x53c4b4=_0x207041;_0x25fdff=0xc8;}else{_0x25fdff=0xce;}_0x5300e4[_0xa41f('0x20')](_0x25fdff);return _0x5300e4['set'](_0xa41f('0x27'),_0x1d6b9e+'-'+_0x53c4b4+'/'+_0x207041)[_0xa41f('0x22')](_0x18fade);}return null;};}function patchUpdates(_0x11f2f2){return function(_0x2f46d0){try{jsonpatch['apply'](_0x2f46d0,_0x11f2f2,!![]);}catch(_0x4e4491){return BPromise['reject'](_0x4e4491);}return _0x2f46d0[_0xa41f('0x28')]();};}function saveUpdates(_0x21c554,_0x4bb615){return function(_0x3be28f){if(_0x3be28f){return _0x3be28f[_0xa41f('0x29')](_0x21c554)[_0xa41f('0x2a')](function(_0xe252a7){return _0xe252a7;});}return null;};}function removeEntity(_0x6d6db5,_0x5cd331){return function(_0x4ad9b3){if(_0x4ad9b3){return _0x4ad9b3['destroy']()['then'](function(){var _0x138492=_0x4ad9b3[_0xa41f('0x2b')]({'plain':!![]});var _0x400ad1='Plugins';return db[_0xa41f('0x2c')]['destroy']({'where':{'type':_0x400ad1,'resourceId':_0x138492['id']}})[_0xa41f('0x2a')](function(){return _0x4ad9b3;});})[_0xa41f('0x2a')](function(){_0x6d6db5[_0xa41f('0x20')](0xcc)[_0xa41f('0x21')]();});}};}function handleEntityNotFound(_0x2fe29f,_0x215d81){return function(_0x33ae83){if(!_0x33ae83){_0x2fe29f[_0xa41f('0x1f')](0x194);}return _0x33ae83;};}function handleError(_0x345e1d,_0x58286c){_0x58286c=_0x58286c||0x1f4;return function(_0x3401d1){logger['error'](_0x3401d1[_0xa41f('0x2d')]);if(_0x3401d1[_0xa41f('0x2e')]){delete _0x3401d1[_0xa41f('0x2e')];}_0x345e1d[_0xa41f('0x20')](_0x58286c)[_0xa41f('0x2f')](_0x3401d1);};}exports[_0xa41f('0x30')]=function(_0x20187c,_0x2ed283){var _0x5344aa={},_0x55b284={},_0x4b574b={'count':0x0,'rows':[]};var _0x3f557e=_['map'](db[_0xa41f('0x31')][_0xa41f('0x32')],function(_0xeaf84b){return{'name':_0xeaf84b['fieldName'],'type':_0xeaf84b[_0xa41f('0x33')][_0xa41f('0x34')]};});_0x55b284[_0xa41f('0x35')]=_[_0xa41f('0x36')](_0x3f557e,'name');_0x55b284['query']=_['keys'](_0x20187c[_0xa41f('0x37')]);_0x55b284[_0xa41f('0x38')]=_['intersection'](_0x55b284[_0xa41f('0x35')],_0x55b284[_0xa41f('0x37')]);_0x5344aa[_0xa41f('0x39')]=_[_0xa41f('0x3a')](_0x55b284['model'],qs['fields'](_0x20187c['query'][_0xa41f('0x3b')]));_0x5344aa[_0xa41f('0x39')]=_0x5344aa[_0xa41f('0x39')][_0xa41f('0x3c')]?_0x5344aa[_0xa41f('0x39')]:_0x55b284[_0xa41f('0x35')];if(!_0x20187c[_0xa41f('0x37')][_0xa41f('0x3d')]('nolimit')){_0x5344aa[_0xa41f('0x24')]=qs[_0xa41f('0x24')](_0x20187c[_0xa41f('0x37')]['limit']);_0x5344aa[_0xa41f('0x23')]=qs[_0xa41f('0x23')](_0x20187c[_0xa41f('0x37')][_0xa41f('0x23')]);}_0x5344aa[_0xa41f('0x3e')]=qs['sort'](_0x20187c[_0xa41f('0x37')][_0xa41f('0x3f')]);_0x5344aa[_0xa41f('0x40')]=qs['filters'](_[_0xa41f('0x41')](_0x20187c[_0xa41f('0x37')],_0x55b284[_0xa41f('0x38')]),_0x3f557e);if(_0x20187c[_0xa41f('0x37')][_0xa41f('0x42')]){_0x5344aa['where']=_[_0xa41f('0x43')](_0x5344aa[_0xa41f('0x40')],{'$or':_[_0xa41f('0x36')](_0x3f557e,function(_0x884982){if(_0x884982['type']!=='VIRTUAL'){var _0x4dbbfd={};_0x4dbbfd[_0x884982[_0xa41f('0x2e')]]={'$like':'%'+_0x20187c[_0xa41f('0x37')][_0xa41f('0x42')]+'%'};return _0x4dbbfd;}})});}_0x5344aa=_[_0xa41f('0x43')]({},_0x5344aa,_0x20187c[_0xa41f('0x44')]);var _0x29280c={'where':_0x5344aa['where']};return db[_0xa41f('0x31')][_0xa41f('0x26')](_0x29280c)[_0xa41f('0x2a')](function(_0x3e2b39){_0x4b574b[_0xa41f('0x26')]=_0x3e2b39;if(_0x20187c[_0xa41f('0x37')][_0xa41f('0x45')]){_0x5344aa[_0xa41f('0x46')]=[{'all':!![]}];}return db[_0xa41f('0x31')][_0xa41f('0x47')](_0x5344aa);})[_0xa41f('0x2a')](function(_0x267acb){_0x4b574b[_0xa41f('0x48')]=_0x267acb;return _0x4b574b;})[_0xa41f('0x2a')](respondWithFilteredResult(_0x2ed283,_0x5344aa))[_0xa41f('0x49')](handleError(_0x2ed283,null));};exports[_0xa41f('0x4a')]=function(_0x4459b8,_0xd4999a){var _0x812aa2={'raw':!![],'where':{'id':_0x4459b8[_0xa41f('0x4b')]['id']}},_0x4610ec={};_0x4610ec[_0xa41f('0x35')]=_[_0xa41f('0x4c')](db[_0xa41f('0x31')][_0xa41f('0x32')]);_0x4610ec[_0xa41f('0x37')]=_[_0xa41f('0x4c')](_0x4459b8[_0xa41f('0x37')]);_0x4610ec[_0xa41f('0x38')]=_['intersection'](_0x4610ec[_0xa41f('0x35')],_0x4610ec['query']);_0x812aa2['attributes']=_[_0xa41f('0x3a')](_0x4610ec[_0xa41f('0x35')],qs[_0xa41f('0x3b')](_0x4459b8['query']['fields']));_0x812aa2[_0xa41f('0x39')]=_0x812aa2[_0xa41f('0x39')]['length']?_0x812aa2['attributes']:_0x4610ec[_0xa41f('0x35')];if(_0x4459b8['query']['includeAll']){_0x812aa2[_0xa41f('0x46')]=[{'all':!![]}];}_0x812aa2=_[_0xa41f('0x43')]({},_0x812aa2,_0x4459b8['options']);return db[_0xa41f('0x31')][_0xa41f('0x4d')](_0x812aa2)[_0xa41f('0x2a')](handleEntityNotFound(_0xd4999a,null))[_0xa41f('0x2a')](respondWithResult(_0xd4999a,null))[_0xa41f('0x49')](handleError(_0xd4999a,null));};exports[_0xa41f('0x4e')]=function(_0x51c271,_0x399965,_0x58c3e5){return db[_0xa41f('0x31')][_0xa41f('0x4d')]({'where':{'id':_0x51c271[_0xa41f('0x4b')]['id']},'attributes':[_0xa41f('0x2e'),'path'],'raw':!![]})[_0xa41f('0x2a')](handleEntityNotFound(_0x399965,null))['then'](function(_0x191632){if(_0x191632){var _0x4beadf=path[_0xa41f('0x4f')](config[_0xa41f('0x50')],'server/files/plugins',util[_0xa41f('0x51')]('%s.zip',path[_0xa41f('0x52')](_0x191632['path'])));var _0x4b98a8=fs[_0xa41f('0x53')](_0x4beadf);var _0x6deb57=archiver(_0xa41f('0x54'),{'zlib':{'level':0x9}});_0x6deb57['on'](_0xa41f('0x55'),function(_0x2eae5f){if(_0x2eae5f['code']==='ENOENT'){logger['error'](_0x2eae5f);}else{throw new db[(_0xa41f('0x56'))]['Error'](_0xa41f('0x57'));}});_0x6deb57['on'](_0xa41f('0x58'),function(_0x872837){throw new db['Sequelize'][(_0xa41f('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x6deb57[_0xa41f('0x5a')](_0x4b98a8);_0x6deb57['glob'](_0xa41f('0x5b'),{'cwd':path[_0xa41f('0x4f')](config[_0xa41f('0x50')],_0xa41f('0x5c'),path['dirname'](_0x191632[_0xa41f('0x8')])),'ignore':[path[_0xa41f('0x4f')](path[_0xa41f('0x52')](_0x191632[_0xa41f('0x8')]),_0xa41f('0x5d')),path[_0xa41f('0x4f')](path[_0xa41f('0x52')](_0x191632[_0xa41f('0x8')]),_0xa41f('0x5e'))],'nodir':!![]})[_0xa41f('0x5f')]();_0x4b98a8['on']('close',function(){if(!fs['existsSync'](_0x4beadf)){throw new db[(_0xa41f('0x56'))][(_0xa41f('0x59'))](_0xa41f('0x60'));}return _0x399965['download'](_0x4beadf,util[_0xa41f('0x51')](_0xa41f('0x61'),path[_0xa41f('0x52')](_0x191632['path'])),function(_0x3d417d){if(_0x3d417d){throw new db[(_0xa41f('0x56'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xa41f('0x62')](_0x4beadf);logger[_0xa41f('0x63')](_0xa41f('0x64'));logger['info'](_0xa41f('0x65'));});});}return null;})[_0xa41f('0x49')](handleError(_0x399965,null));};exports['upload']=function(_0x2daba4,_0xb76b93,_0x32aab9){var _0x7beb0=path['basename'](_0x2daba4[_0xa41f('0x66')][_0xa41f('0x67')],path['extname'](_0x2daba4[_0xa41f('0x66')][_0xa41f('0x67')]));var _0x15de2f=path['join'](config[_0xa41f('0x50')],'server/files/plugins',_0x2daba4[_0xa41f('0x66')][_0xa41f('0x67')]);var _0x4d0b16=path[_0xa41f('0x4f')](config['root'],_0xa41f('0x5c'),_0x7beb0);logger['info'](_0xa41f('0x68'),_0x15de2f);logger[_0xa41f('0x63')](_0xa41f('0x69'),_0x4d0b16);try{fs[_0xa41f('0x6a')](_0x15de2f,parseInt('0777',0x8));extract(_0x15de2f,{'dir':_0x4d0b16},function(_0x17bbca){if(_0x17bbca){logger[_0xa41f('0x58')](_0x17bbca);handleError(_0x17bbca,!![]);};var _0x1124db=fs[_0xa41f('0x6b')](_0x4d0b16);if(_0x1124db[_0xa41f('0x3c')]>0x1){removeReferences(_0x15de2f,_0x4d0b16);logger[_0xa41f('0x58')](_0xa41f('0x6c'));return _0x32aab9(new Error(_0xa41f('0x6c')));}var _0x429016=fs[_0xa41f('0x6d')](path[_0xa41f('0x4f')](_0x4d0b16,_0x1124db[0x0]));if(_0x429016[_0xa41f('0x6e')]()){removeReferences(_0x15de2f,_0x4d0b16);logger['error'](_0xa41f('0x6c'));return _0x32aab9(new Error('Invalid\x20plugin\x20structure'));}if(_0x429016['isDirectory']()){var _0x5a3cc1=fs[_0xa41f('0x6b')](path['join'](_0x4d0b16,_0x1124db[0x0]));if(_0x5a3cc1[_0xa41f('0x3c')]===0x0){removeReferences(_0x15de2f,_0x4d0b16);logger['error'](_0xa41f('0x6c'));return _0x32aab9(new Error(_0xa41f('0x6c')));}var _0x1f958d=_0x5a3cc1[_0xa41f('0x6f')](function(_0x58a189){return _0x58a189==='manifest.json';});if(!_0x1f958d){return _0x32aab9(new Error('Plugin\x20manifest\x20missing'));}var _0xe919c=fs[_0xa41f('0x70')](path['join'](_0x4d0b16,_0x1124db[0x0],_0xa41f('0x71')));var _0xd7840c=JSON[_0xa41f('0x72')](_0xe919c);if('undefined'==typeof _0xd7840c[_0xa41f('0x2e')]){return _0x32aab9(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xa41f('0x25')==typeof _0xd7840c[_0xa41f('0x33')]){return _0x32aab9(new Error(_0xa41f('0x73')));}if(_0xa41f('0x25')==typeof _0xd7840c['version']){return _0x32aab9(new Error(_0xa41f('0x74')));}if(_0xa41f('0x25')==typeof _0xd7840c[_0xa41f('0x75')]){return _0x32aab9(new Error(_0xa41f('0x76')));}if(_0xd7840c['type']===_0xa41f('0x77')){if(_0xa41f('0x25')==typeof _0xd7840c['parameters'][_0xa41f('0x78')]){return _0x32aab9(new Error(_0xa41f('0x79')));}if('undefined'==typeof _0xd7840c[_0xa41f('0x75')][_0xa41f('0x78')][_0xa41f('0x7a')]&&_0xa41f('0x25')==typeof _0xd7840c[_0xa41f('0x75')][_0xa41f('0x78')][_0xa41f('0x7b')]){return _0x32aab9(new Error(_0xa41f('0x7c')));}}else if(_0xd7840c[_0xa41f('0x33')]===_0xa41f('0x7d')){if(_0xa41f('0x25')==typeof _0xd7840c[_0xa41f('0x75')][_0xa41f('0x7e')]){return _0x32aab9(new Error(_0xa41f('0x7f')));}if('undefined'==typeof _0xd7840c['parameters'][_0xa41f('0x80')]){return _0x32aab9(new Error(_0xa41f('0x81')));}}else{return _0x32aab9(new Error(_0xa41f('0x82')));}var _0x5840b8=_0xd7840c['name'];var _0xf70025=_0xd7840c[_0xa41f('0x83')];var _0x3edf55=_0xd7840c[_0xa41f('0x33')];var _0x27e8ec=_0xd7840c[_0xa41f('0x84')]?_0xd7840c[_0xa41f('0x84')]:'always';var _0x283650=_0xd7840c['icon']?_0xd7840c[_0xa41f('0x85')]:_0xa41f('0x86');var _0x2b9c2a='';var _0x295ca2='';var _0x1df999='';var _0x61531c='';var _0x4e9ee2=_0xd7840c['version'];if(_0x3edf55==='html'){if(_0xa41f('0x25')!=typeof _0xd7840c['parameters'][_0xa41f('0x78')][_0xa41f('0x7a')]){var _0x514d1a=_0xd7840c[_0xa41f('0x75')][_0xa41f('0x78')][_0xa41f('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xa41f('0x87')](_0x514d1a)){_0x2b9c2a=path[_0xa41f('0x4f')](_0xa41f('0x88'),_0x7beb0,_0x1124db[0x0],_0x514d1a);}else{_0x2b9c2a=_0x514d1a;}}else{logger['info'](_0xa41f('0x89'));}if(_0xa41f('0x25')!=typeof _0xd7840c[_0xa41f('0x75')]['views'][_0xa41f('0x7b')]){var _0x587ae7=_0xd7840c['parameters']['views'][_0xa41f('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xa41f('0x87')](_0x587ae7)){_0x295ca2=path[_0xa41f('0x4f')]('plugins',_0x7beb0,_0x1124db[0x0],_0x587ae7);}else{_0x295ca2=_0x587ae7;}}else{logger[_0xa41f('0x63')](_0xa41f('0x8a'));}}else if(_0x3edf55===_0xa41f('0x7d')){_0x1df999=_0xd7840c[_0xa41f('0x75')]['scriptName'];_0x61531c=_0xd7840c[_0xa41f('0x75')][_0xa41f('0x80')];if(_0xa41f('0x25')!=typeof _0xd7840c[_0xa41f('0x75')]['views']){if(_0xa41f('0x25')!=typeof _0xd7840c[_0xa41f('0x75')][_0xa41f('0x78')]['admin']){var _0x514d1a=_0xd7840c['parameters']['views'][_0xa41f('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xa41f('0x87')](_0x514d1a)){_0x2b9c2a=path[_0xa41f('0x4f')](_0xa41f('0x88'),_0x7beb0,_0x1124db[0x0],_0x514d1a);}else{_0x2b9c2a=_0x514d1a;}}if(_0xa41f('0x25')!=typeof _0xd7840c[_0xa41f('0x75')]['views']['agent']){var _0x587ae7=_0xd7840c[_0xa41f('0x75')]['views'][_0xa41f('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xa41f('0x87')](_0x587ae7)){_0x295ca2=path['join'](_0xa41f('0x88'),_0x7beb0,_0x1124db[0x0],_0x587ae7);}else{_0x295ca2=_0x587ae7;}}}}var _0x3ce4d5={'name':_0x5840b8,'description':_0xf70025,'path':path[_0xa41f('0x4f')](_0x7beb0,_0x1124db[0x0]),'type':_0x3edf55,'sidebar':_0x27e8ec,'icon':_0x283650,'adminUrl':_0x2b9c2a,'agentUrl':_0x295ca2,'scriptName':_0x1df999,'scriptPath':_0x61531c,'version':_0x4e9ee2};removeReferences(_0x15de2f,null);return db['Plugin'][_0xa41f('0x8b')](_0x3ce4d5)['then'](function(_0x20b1ff){var _0x21fde8={'role':_0x2daba4[_0xa41f('0x8c')][_0xa41f('0x8d')],'userProfileId':_0x2daba4['body']['userProfileId']};if(!_0x21fde8)throw new Error(_0xa41f('0x8e'));if(_0x21fde8['role']==='user'){var _0x44ad69=_0x20b1ff['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xa41f('0x8f'),'userProfileId':_0x21fde8[_0xa41f('0x90')]},'raw':!![]})[_0xa41f('0x2a')](function(_0x5226ad){if(_0x5226ad&&_0x5226ad[_0xa41f('0x91')]===0x0){return db[_0xa41f('0x2c')][_0xa41f('0x8b')]({'name':_0x44ad69[_0xa41f('0x2e')],'resourceId':_0x44ad69['id'],'type':_0x5226ad[_0xa41f('0x2e')],'sectionId':_0x5226ad['id']},{})[_0xa41f('0x2a')](function(){return _0x20b1ff;});}else{return _0x20b1ff;}})['catch'](function(_0x12d345){logger[_0xa41f('0x58')](_0xa41f('0x92'),_0x12d345);throw _0x12d345;});}return _0x20b1ff;})['then'](respondWithResult(_0xb76b93,null))['catch'](handleError(_0xb76b93,null));}});}catch(_0x19d31a){_0xb76b93['status'](0x1f4)[_0xa41f('0x2f')](_0x19d31a);}};function removeReferences(_0x175d5c,_0x3caf47){try{if(_0x175d5c){fs[_0xa41f('0x62')](_0x175d5c);logger[_0xa41f('0x63')](_0xa41f('0x93'));}if(_0x3caf47){rimraf(_0x3caf47,function(){});logger[_0xa41f('0x63')](_0xa41f('0x94'));}}catch(_0x2fbc52){logger[_0xa41f('0x58')](_0x2fbc52);}}exports[_0xa41f('0x29')]=function(_0x5b0585,_0x3455af,_0xc61826){return db[_0xa41f('0x31')][_0xa41f('0x4d')]({'where':{'id':_0x5b0585[_0xa41f('0x4b')]['id']}})[_0xa41f('0x2a')](handleEntityNotFound(_0x3455af,null))['then'](saveUpdates(_0x5b0585['body'],null))[_0xa41f('0x2a')](respondWithResult(_0x3455af,null))[_0xa41f('0x49')](handleError(_0x3455af,null));};exports[_0xa41f('0x95')]=function(_0x259338,_0x9a2052,_0x709f4c){return db['Plugin'][_0xa41f('0x4d')]({'where':{'id':_0x259338[_0xa41f('0x4b')]['id']}})[_0xa41f('0x2a')](function(_0x4dd957){if(_0x4dd957){return _0x4dd957[_0xa41f('0x96')]();}})[_0xa41f('0x2a')](function(_0x3a77b6){rimraf(path[_0xa41f('0x4f')](config[_0xa41f('0x50')],_0xa41f('0x5c'),path[_0xa41f('0x97')](_0x3a77b6[_0xa41f('0x8')])),function(){});return _0x3a77b6;})[_0xa41f('0x2a')](handleEntityNotFound(_0x9a2052,null))[_0xa41f('0x2a')](respondWithStatusCode(_0x9a2052,null))[_0xa41f('0x49')](handleError(_0x9a2052,null));};exports['webhookGet']=function(_0x3b6476,_0x254d9c,_0x517017){return BPromise[_0xa41f('0x98')]()['then'](function(){if(!_0x3b6476[_0xa41f('0x37')][_0xa41f('0x8')]){throw new Error(_0xa41f('0x99'));}if(!_0x3b6476[_0xa41f('0x37')][_0xa41f('0x9a')]){throw new Error(_0xa41f('0x9b'));}var _0x472dec=_0x3b6476[_0xa41f('0x37')][_0xa41f('0x9c')]?_0x3b6476['query'][_0xa41f('0x9c')]+':'+_0x3b6476['query']['port']:_0xa41f('0x9d')+_0x3b6476[_0xa41f('0x37')][_0xa41f('0x9a')];var _0x466e34=_0x3b6476[_0xa41f('0x37')][_0xa41f('0x22')]?_0x3b6476['query'][_0xa41f('0x22')]:!![];var _0x35ffda=_0x3b6476['query']['encoding']?_0x3b6476[_0xa41f('0x37')]['encoding']:null;var _0x4fc681={'method':_0x3b6476['method'],'uri':util[_0xa41f('0x51')](_0xa41f('0x9e'),_0x472dec,_0x3b6476[_0xa41f('0x37')][_0xa41f('0x8')]),'json':_0x466e34,'resolveWithFullResponse':!![],'encoding':_0x35ffda,'qs':_0x3b6476['query']};if(_0x3b6476['headers']){_0x4fc681[_0xa41f('0x9f')]=_0x3b6476[_0xa41f('0x9f')];if(_0x4fc681['headers']['content-length']){delete _0x4fc681['headers'][_0xa41f('0xa0')];}}if(_0x4fc681[_0xa41f('0x9f')][_0xa41f('0xa1')]){delete _0x4fc681[_0xa41f('0x9f')]['content-type'];}return rp(_0x4fc681);})['then'](function(_0x1f8251){if(_0x1f8251){_0x254d9c['set'](_0x1f8251[_0xa41f('0x9f')]);logger[_0xa41f('0x63')](_0x1f8251['body']);if(_[_0xa41f('0xa2')](_0x3b6476[_0xa41f('0x37')]['path'],_0xa41f('0x4e'))&&_0x1f8251[_0xa41f('0xa3')]==0x1f4){return _0x254d9c[_0xa41f('0x1f')](_0x1f8251[_0xa41f('0xa3')]);}else{return _0x254d9c[_0xa41f('0x20')](_0x1f8251['statusCode'])[_0xa41f('0x2f')](_0x1f8251[_0xa41f('0x8c')]);}}else{return _0x254d9c['sendStatus'](0xc8);}})[_0xa41f('0x49')](handleError(_0x254d9c,null));};exports[_0xa41f('0xa4')]=function(_0x290f2c,_0x1b9b28,_0xd4ccef){return BPromise[_0xa41f('0x98')]()[_0xa41f('0x2a')](function(){if(!_0x290f2c[_0xa41f('0x37')][_0xa41f('0x8')]){throw new Error(_0xa41f('0x99'));}if(!_0x290f2c[_0xa41f('0x37')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x81d3de=_0x290f2c['query']['hostname']?_0x290f2c[_0xa41f('0x37')]['hostname']+':'+_0x290f2c[_0xa41f('0x37')][_0xa41f('0x9a')]:_0xa41f('0x9d')+_0x290f2c[_0xa41f('0x37')][_0xa41f('0x9a')];var _0x287dee=_0x290f2c[_0xa41f('0x37')][_0xa41f('0x22')]?_0x290f2c[_0xa41f('0x37')][_0xa41f('0x22')]:!![];var _0x39d785=_0x290f2c[_0xa41f('0x37')]['encoding']?_0x290f2c['query'][_0xa41f('0xa5')]:null;var _0x532b1d={'method':_0x290f2c[_0xa41f('0xa6')],'uri':util['format'](_0xa41f('0x9e'),_0x81d3de,_0x290f2c[_0xa41f('0x37')]['path']),'json':_0x287dee,'resolveWithFullResponse':!![],'encoding':_0x39d785,'body':_0x290f2c['body']};if(_0x290f2c[_0xa41f('0x9f')]){_0x532b1d[_0xa41f('0x9f')]=_0x290f2c['headers'];if(_0x532b1d[_0xa41f('0x9f')][_0xa41f('0xa0')]){delete _0x532b1d[_0xa41f('0x9f')][_0xa41f('0xa0')];}}if(_0x532b1d[_0xa41f('0x9f')]['content-type']){delete _0x532b1d[_0xa41f('0x9f')]['content-type'];}return rp(_0x532b1d);})[_0xa41f('0x2a')](function(_0x2a8449){if(_0x2a8449){_0x1b9b28[_0xa41f('0xa7')](_0x2a8449[_0xa41f('0x9f')]);logger[_0xa41f('0x63')](_0x2a8449['body']);return _0x1b9b28[_0xa41f('0x20')](_0x2a8449[_0xa41f('0xa3')])[_0xa41f('0x2f')](_0x2a8449[_0xa41f('0x8c')]);}else{return _0x1b9b28['sendStatus'](0xc8);}})[_0xa41f('0x49')](handleError(_0x1b9b28,null));}; \ No newline at end of file +var _0x6722=['method','headers','content-length','content-type','set','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','get','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','catch','download','path','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','basename','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','params','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding'];(function(_0x531d99,_0x401d87){var _0x165652=function(_0x53b2a1){while(--_0x53b2a1){_0x531d99['push'](_0x531d99['shift']());}};_0x165652(++_0x401d87);}(_0x6722,0x15f));var _0x2672=function(_0xe8a7fa,_0x19144c){_0xe8a7fa=_0xe8a7fa-0x0;var _0x51bad0=_0x6722[_0xe8a7fa];return _0x51bad0;};'use strict';var emlformat=require(_0x2672('0x0'));var rimraf=require(_0x2672('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2672('0x2'));var Mustache=require(_0x2672('0x3'));var util=require(_0x2672('0x4'));var path=require('path');var sox=require(_0x2672('0x5'));var csv=require(_0x2672('0x6'));var ejs=require(_0x2672('0x7'));var fs=require('fs');var fs_extra=require(_0x2672('0x8'));var _=require(_0x2672('0x9'));var squel=require(_0x2672('0xa'));var crypto=require('crypto');var jsforce=require(_0x2672('0xb'));var deskjs=require(_0x2672('0xc'));var toCsv=require(_0x2672('0x6'));var querystring=require('querystring');var Papa=require(_0x2672('0xd'));var extract=require(_0x2672('0xe'));var rimraf=require(_0x2672('0x1'));var archiver=require(_0x2672('0xf'));var Redis=require(_0x2672('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2672('0x11'));var as=require(_0x2672('0x12'));var hardwareService=require(_0x2672('0x13'));var logger=require('../../config/logger')(_0x2672('0x14'));var utils=require('../../config/utils');var config=require(_0x2672('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2672('0x16'))['db'];config[_0x2672('0x17')]=_['defaults'](config[_0x2672('0x17')],{'host':_0x2672('0x18'),'port':0x18eb});var socket=require(_0x2672('0x19'))(new Redis(config['redis']));require('./plugin.socket')[_0x2672('0x1a')](socket);function respondWithStatusCode(_0x939a9a,_0x57a982){_0x57a982=_0x57a982||0xcc;return function(_0x52277e){if(_0x52277e){return _0x939a9a[_0x2672('0x1b')](_0x57a982);}return _0x939a9a['status'](_0x57a982)[_0x2672('0x1c')]();};}function respondWithResult(_0x8b1540,_0x49f2c1){_0x49f2c1=_0x49f2c1||0xc8;return function(_0x525e36){if(_0x525e36){return _0x8b1540[_0x2672('0x1d')](_0x49f2c1)[_0x2672('0x1e')](_0x525e36);}};}function respondWithFilteredResult(_0x206479,_0x177cb4){return function(_0x4d992c){if(_0x4d992c){var _0x53e746=typeof _0x177cb4[_0x2672('0x1f')]===_0x2672('0x20')&&typeof _0x177cb4[_0x2672('0x21')]===_0x2672('0x20');var _0x4df275=_0x4d992c[_0x2672('0x22')];var _0x36f41f=_0x53e746?0x0:_0x177cb4[_0x2672('0x1f')];var _0x94735a=_0x53e746?_0x4d992c[_0x2672('0x22')]:_0x177cb4[_0x2672('0x1f')]+_0x177cb4['limit'];var _0x1be13f;if(_0x94735a>=_0x4df275){_0x94735a=_0x4df275;_0x1be13f=0xc8;}else{_0x1be13f=0xce;}_0x206479[_0x2672('0x1d')](_0x1be13f);return _0x206479['set'](_0x2672('0x23'),_0x36f41f+'-'+_0x94735a+'/'+_0x4df275)[_0x2672('0x1e')](_0x4d992c);}return null;};}function patchUpdates(_0x1d8ecf){return function(_0x4e8a8b){try{jsonpatch[_0x2672('0x24')](_0x4e8a8b,_0x1d8ecf,!![]);}catch(_0x4b393d){return BPromise['reject'](_0x4b393d);}return _0x4e8a8b[_0x2672('0x25')]();};}function saveUpdates(_0x1e97a9,_0x96b951){return function(_0x368a0e){if(_0x368a0e){return _0x368a0e[_0x2672('0x26')](_0x1e97a9)['then'](function(_0x445130){return _0x445130;});}return null;};}function removeEntity(_0x38845e,_0x5cade0){return function(_0x3671c4){if(_0x3671c4){return _0x3671c4[_0x2672('0x27')]()[_0x2672('0x28')](function(){var _0xb8b860=_0x3671c4[_0x2672('0x29')]({'plain':!![]});var _0x4ec4fe=_0x2672('0x2a');return db[_0x2672('0x2b')]['destroy']({'where':{'type':_0x4ec4fe,'resourceId':_0xb8b860['id']}})[_0x2672('0x28')](function(){return _0x3671c4;});})[_0x2672('0x28')](function(){_0x38845e[_0x2672('0x1d')](0xcc)[_0x2672('0x1c')]();});}};}function handleEntityNotFound(_0x1eb46f,_0x4047e3){return function(_0x294662){if(!_0x294662){_0x1eb46f[_0x2672('0x1b')](0x194);}return _0x294662;};}function handleError(_0x214b33,_0x228e8b){_0x228e8b=_0x228e8b||0x1f4;return function(_0x5ca042){logger[_0x2672('0x2c')](_0x5ca042[_0x2672('0x2d')]);if(_0x5ca042['name']){delete _0x5ca042[_0x2672('0x2e')];}_0x214b33[_0x2672('0x1d')](_0x228e8b)[_0x2672('0x2f')](_0x5ca042);};}exports['index']=function(_0x28facc,_0x5e1118){var _0x141c46={},_0x4abd39={},_0x57c505={'count':0x0,'rows':[]};var _0x2fa805=_[_0x2672('0x30')](db[_0x2672('0x31')][_0x2672('0x32')],function(_0x1a84c1){return{'name':_0x1a84c1[_0x2672('0x33')],'type':_0x1a84c1[_0x2672('0x34')]['key']};});_0x4abd39[_0x2672('0x35')]=_['map'](_0x2fa805,_0x2672('0x2e'));_0x4abd39[_0x2672('0x36')]=_[_0x2672('0x37')](_0x28facc[_0x2672('0x36')]);_0x4abd39[_0x2672('0x38')]=_[_0x2672('0x39')](_0x4abd39['model'],_0x4abd39['query']);_0x141c46[_0x2672('0x3a')]=_[_0x2672('0x39')](_0x4abd39[_0x2672('0x35')],qs[_0x2672('0x3b')](_0x28facc[_0x2672('0x36')][_0x2672('0x3b')]));_0x141c46['attributes']=_0x141c46['attributes'][_0x2672('0x3c')]?_0x141c46[_0x2672('0x3a')]:_0x4abd39[_0x2672('0x35')];if(!_0x28facc[_0x2672('0x36')][_0x2672('0x3d')](_0x2672('0x3e'))){_0x141c46[_0x2672('0x21')]=qs[_0x2672('0x21')](_0x28facc['query'][_0x2672('0x21')]);_0x141c46[_0x2672('0x1f')]=qs[_0x2672('0x1f')](_0x28facc[_0x2672('0x36')][_0x2672('0x1f')]);}_0x141c46[_0x2672('0x3f')]=qs[_0x2672('0x40')](_0x28facc['query'][_0x2672('0x40')]);_0x141c46['where']=qs[_0x2672('0x38')](_['pick'](_0x28facc['query'],_0x4abd39[_0x2672('0x38')]),_0x2fa805);if(_0x28facc['query']['filter']){_0x141c46[_0x2672('0x41')]=_[_0x2672('0x42')](_0x141c46[_0x2672('0x41')],{'$or':_['map'](_0x2fa805,function(_0x57b21c){if(_0x57b21c[_0x2672('0x34')]!==_0x2672('0x43')){var _0x3ab0b8={};_0x3ab0b8[_0x57b21c[_0x2672('0x2e')]]={'$like':'%'+_0x28facc['query'][_0x2672('0x44')]+'%'};return _0x3ab0b8;}})});}_0x141c46=_['merge']({},_0x141c46,_0x28facc[_0x2672('0x45')]);var _0x4ac869={'where':_0x141c46[_0x2672('0x41')]};return db['Plugin'][_0x2672('0x22')](_0x4ac869)[_0x2672('0x28')](function(_0x1a5553){_0x57c505[_0x2672('0x22')]=_0x1a5553;if(_0x28facc[_0x2672('0x36')][_0x2672('0x46')]){_0x141c46[_0x2672('0x47')]=[{'all':!![]}];}return db[_0x2672('0x31')][_0x2672('0x48')](_0x141c46);})['then'](function(_0x37bf54){_0x57c505[_0x2672('0x49')]=_0x37bf54;return _0x57c505;})['then'](respondWithFilteredResult(_0x5e1118,_0x141c46))['catch'](handleError(_0x5e1118,null));};exports[_0x2672('0x4a')]=function(_0x430cfc,_0x2d4abd){var _0x6164={'raw':!![],'where':{'id':_0x430cfc['params']['id']}},_0x5b7a1c={};_0x5b7a1c[_0x2672('0x35')]=_[_0x2672('0x37')](db['Plugin'][_0x2672('0x32')]);_0x5b7a1c[_0x2672('0x36')]=_[_0x2672('0x37')](_0x430cfc[_0x2672('0x36')]);_0x5b7a1c[_0x2672('0x38')]=_[_0x2672('0x39')](_0x5b7a1c[_0x2672('0x35')],_0x5b7a1c['query']);_0x6164[_0x2672('0x3a')]=_['intersection'](_0x5b7a1c['model'],qs[_0x2672('0x3b')](_0x430cfc[_0x2672('0x36')][_0x2672('0x3b')]));_0x6164['attributes']=_0x6164[_0x2672('0x3a')][_0x2672('0x3c')]?_0x6164[_0x2672('0x3a')]:_0x5b7a1c[_0x2672('0x35')];if(_0x430cfc[_0x2672('0x36')][_0x2672('0x46')]){_0x6164[_0x2672('0x47')]=[{'all':!![]}];}_0x6164=_['merge']({},_0x6164,_0x430cfc['options']);return db[_0x2672('0x31')][_0x2672('0x4b')](_0x6164)[_0x2672('0x28')](handleEntityNotFound(_0x2d4abd,null))[_0x2672('0x28')](respondWithResult(_0x2d4abd,null))[_0x2672('0x4c')](handleError(_0x2d4abd,null));};exports[_0x2672('0x4d')]=function(_0x46dc8f,_0x3a756d,_0x2ea102){return db[_0x2672('0x31')][_0x2672('0x4b')]({'where':{'id':_0x46dc8f['params']['id']},'attributes':['name',_0x2672('0x4e')],'raw':!![]})[_0x2672('0x28')](handleEntityNotFound(_0x3a756d,null))['then'](function(_0x3caad7){if(_0x3caad7){var _0x41a586=path[_0x2672('0x4f')](config[_0x2672('0x50')],_0x2672('0x51'),util[_0x2672('0x52')](_0x2672('0x53'),path['basename'](_0x3caad7[_0x2672('0x4e')])));var _0xa9d022=fs[_0x2672('0x54')](_0x41a586);var _0x181487=archiver(_0x2672('0x55'),{'zlib':{'level':0x9}});_0x181487['on'](_0x2672('0x56'),function(_0x563630){if(_0x563630[_0x2672('0x57')]===_0x2672('0x58')){logger[_0x2672('0x2c')](_0x563630);}else{throw new db[(_0x2672('0x59'))]['Error'](_0x2672('0x5a'));}});_0x181487['on'](_0x2672('0x2c'),function(_0x50da64){throw new db[(_0x2672('0x59'))][(_0x2672('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x181487[_0x2672('0x5c')](_0xa9d022);_0x181487[_0x2672('0x5d')](_0x2672('0x5e'),{'cwd':path[_0x2672('0x4f')](config['root'],_0x2672('0x51'),path[_0x2672('0x5f')](_0x3caad7[_0x2672('0x4e')])),'ignore':[path[_0x2672('0x4f')](path[_0x2672('0x60')](_0x3caad7[_0x2672('0x4e')]),'node_modules/**/*'),path['join'](path[_0x2672('0x60')](_0x3caad7['path']),'attachments/**/*')],'nodir':!![]})[_0x2672('0x61')]();_0xa9d022['on'](_0x2672('0x62'),function(){if(!fs[_0x2672('0x63')](_0x41a586)){throw new db[(_0x2672('0x59'))]['Error'](_0x2672('0x64'));}return _0x3a756d['download'](_0x41a586,util['format'](_0x2672('0x53'),path[_0x2672('0x60')](_0x3caad7['path'])),function(_0x427114){if(_0x427114){throw new db[(_0x2672('0x59'))][(_0x2672('0x5b'))](_0x2672('0x65'));}fs[_0x2672('0x66')](_0x41a586);logger['info']('Download\x20completed');logger[_0x2672('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0x2672('0x4c')](handleError(_0x3a756d,null));};exports[_0x2672('0x68')]=function(_0x5455bd,_0x29a8e7,_0x18a58b){var _0x41c1f3=path[_0x2672('0x60')](_0x5455bd[_0x2672('0x69')][_0x2672('0x6a')],path[_0x2672('0x6b')](_0x5455bd[_0x2672('0x69')][_0x2672('0x6a')]));var _0x4be4d4=path['join'](config[_0x2672('0x50')],_0x2672('0x51'),_0x5455bd['file'][_0x2672('0x6a')]);var _0x4b3951=path[_0x2672('0x4f')](config['root'],_0x2672('0x51'),_0x41c1f3);logger[_0x2672('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x4be4d4);logger[_0x2672('0x67')](_0x2672('0x6c'),_0x4b3951);try{fs[_0x2672('0x6d')](_0x4be4d4,parseInt(_0x2672('0x6e'),0x8));extract(_0x4be4d4,{'dir':_0x4b3951},function(_0x10b496){if(_0x10b496){logger[_0x2672('0x2c')](_0x10b496);handleError(_0x10b496,!![]);};var _0x1d366e=fs[_0x2672('0x6f')](_0x4b3951);if(_0x1d366e[_0x2672('0x3c')]>0x1){removeReferences(_0x4be4d4,_0x4b3951);logger[_0x2672('0x2c')]('Invalid\x20plugin\x20structure');return _0x18a58b(new Error(_0x2672('0x70')));}var _0x166788=fs[_0x2672('0x71')](path['join'](_0x4b3951,_0x1d366e[0x0]));if(_0x166788[_0x2672('0x72')]()){removeReferences(_0x4be4d4,_0x4b3951);logger['error'](_0x2672('0x70'));return _0x18a58b(new Error(_0x2672('0x70')));}if(_0x166788['isDirectory']()){var _0x834891=fs[_0x2672('0x6f')](path[_0x2672('0x4f')](_0x4b3951,_0x1d366e[0x0]));if(_0x834891[_0x2672('0x3c')]===0x0){removeReferences(_0x4be4d4,_0x4b3951);logger[_0x2672('0x2c')](_0x2672('0x70'));return _0x18a58b(new Error(_0x2672('0x70')));}var _0x26f6d1=_0x834891[_0x2672('0x73')](function(_0x19ae67){return _0x19ae67==='manifest.json';});if(!_0x26f6d1){return _0x18a58b(new Error(_0x2672('0x74')));}var _0x368f8a=fs[_0x2672('0x75')](path[_0x2672('0x4f')](_0x4b3951,_0x1d366e[0x0],_0x2672('0x76')));var _0x39626c=JSON[_0x2672('0x77')](_0x368f8a);if(_0x2672('0x20')==typeof _0x39626c[_0x2672('0x2e')]){return _0x18a58b(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x2672('0x20')==typeof _0x39626c['type']){return _0x18a58b(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x39626c[_0x2672('0x78')]){return _0x18a58b(new Error(_0x2672('0x79')));}if(_0x2672('0x20')==typeof _0x39626c[_0x2672('0x7a')]){return _0x18a58b(new Error(_0x2672('0x7b')));}if(_0x39626c[_0x2672('0x34')]===_0x2672('0x7c')){if(_0x2672('0x20')==typeof _0x39626c['parameters'][_0x2672('0x7d')]){return _0x18a58b(new Error(_0x2672('0x7e')));}if(_0x2672('0x20')==typeof _0x39626c['parameters'][_0x2672('0x7d')]['admin']&&_0x2672('0x20')==typeof _0x39626c[_0x2672('0x7a')][_0x2672('0x7d')][_0x2672('0x7f')]){return _0x18a58b(new Error(_0x2672('0x80')));}}else if(_0x39626c['type']===_0x2672('0x81')){if(_0x2672('0x20')==typeof _0x39626c[_0x2672('0x7a')][_0x2672('0x82')]){return _0x18a58b(new Error(_0x2672('0x83')));}if(_0x2672('0x20')==typeof _0x39626c[_0x2672('0x7a')][_0x2672('0x84')]){return _0x18a58b(new Error(_0x2672('0x85')));}}else{return _0x18a58b(new Error(_0x2672('0x86')));}var _0x1dd3c0=_0x39626c['name'];var _0x210b4d=_0x39626c['description'];var _0x38454d=_0x39626c[_0x2672('0x34')];var _0xf85715=_0x39626c[_0x2672('0x87')]?_0x39626c['sidebar']:'always';var _0x14d4df=_0x39626c[_0x2672('0x88')]?_0x39626c[_0x2672('0x88')]:_0x2672('0x89');var _0x291af7='';var _0x3e3c87='';var _0x28807e='';var _0x5e4262='';var _0x502c4e=_0x39626c[_0x2672('0x78')];if(_0x38454d===_0x2672('0x7c')){if(_0x2672('0x20')!=typeof _0x39626c['parameters'][_0x2672('0x7d')][_0x2672('0x8a')]){var _0x125534=_0x39626c['parameters'][_0x2672('0x7d')][_0x2672('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2672('0x8b')](_0x125534)){_0x291af7=path[_0x2672('0x4f')](_0x2672('0x8c'),_0x41c1f3,_0x1d366e[0x0],_0x125534);}else{_0x291af7=_0x125534;}}else{logger[_0x2672('0x67')](_0x2672('0x8d'));}if(_0x2672('0x20')!=typeof _0x39626c[_0x2672('0x7a')]['views'][_0x2672('0x7f')]){var _0x3b53d9=_0x39626c[_0x2672('0x7a')][_0x2672('0x7d')][_0x2672('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x2672('0x8b')](_0x3b53d9)){_0x3e3c87=path[_0x2672('0x4f')](_0x2672('0x8c'),_0x41c1f3,_0x1d366e[0x0],_0x3b53d9);}else{_0x3e3c87=_0x3b53d9;}}else{logger['info'](_0x2672('0x8e'));}}else if(_0x38454d==='script'){_0x28807e=_0x39626c[_0x2672('0x7a')][_0x2672('0x82')];_0x5e4262=_0x39626c[_0x2672('0x7a')][_0x2672('0x84')];if(_0x2672('0x20')!=typeof _0x39626c['parameters'][_0x2672('0x7d')]){if('undefined'!=typeof _0x39626c[_0x2672('0x7a')][_0x2672('0x7d')][_0x2672('0x8a')]){var _0x125534=_0x39626c[_0x2672('0x7a')][_0x2672('0x7d')][_0x2672('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2672('0x8b')](_0x125534)){_0x291af7=path['join'](_0x2672('0x8c'),_0x41c1f3,_0x1d366e[0x0],_0x125534);}else{_0x291af7=_0x125534;}}if(_0x2672('0x20')!=typeof _0x39626c[_0x2672('0x7a')][_0x2672('0x7d')][_0x2672('0x7f')]){var _0x3b53d9=_0x39626c['parameters']['views'][_0x2672('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b53d9)){_0x3e3c87=path['join'](_0x2672('0x8c'),_0x41c1f3,_0x1d366e[0x0],_0x3b53d9);}else{_0x3e3c87=_0x3b53d9;}}}}var _0x104a05={'name':_0x1dd3c0,'description':_0x210b4d,'path':path[_0x2672('0x4f')](_0x41c1f3,_0x1d366e[0x0]),'type':_0x38454d,'sidebar':_0xf85715,'icon':_0x14d4df,'adminUrl':_0x291af7,'agentUrl':_0x3e3c87,'scriptName':_0x28807e,'scriptPath':_0x5e4262,'version':_0x502c4e};removeReferences(_0x4be4d4,null);return db[_0x2672('0x31')][_0x2672('0x8f')](_0x104a05)[_0x2672('0x28')](function(_0x42bfdd){var _0x263e00={'role':_0x5455bd[_0x2672('0x90')][_0x2672('0x91')],'userProfileId':_0x5455bd[_0x2672('0x90')][_0x2672('0x92')]};if(!_0x263e00)throw new Error(_0x2672('0x93'));if(_0x263e00[_0x2672('0x91')]===_0x2672('0x94')){var _0x4aa449=_0x42bfdd[_0x2672('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x2672('0x4b')]({'where':{'name':_0x2672('0x2a'),'userProfileId':_0x263e00[_0x2672('0x92')]},'raw':!![]})['then'](function(_0x572d60){if(_0x572d60&&_0x572d60[_0x2672('0x95')]===0x0){return db['UserProfileResource']['create']({'name':_0x4aa449[_0x2672('0x2e')],'resourceId':_0x4aa449['id'],'type':_0x572d60['name'],'sectionId':_0x572d60['id']},{})[_0x2672('0x28')](function(){return _0x42bfdd;});}else{return _0x42bfdd;}})[_0x2672('0x4c')](function(_0x4f5aa2){logger[_0x2672('0x2c')](_0x2672('0x96'),_0x4f5aa2);throw _0x4f5aa2;});}return _0x42bfdd;})[_0x2672('0x28')](respondWithResult(_0x29a8e7,null))[_0x2672('0x4c')](handleError(_0x29a8e7,null));}});}catch(_0x1d1d16){_0x29a8e7['status'](0x1f4)[_0x2672('0x2f')](_0x1d1d16);}};function removeReferences(_0x3661b0,_0x222da7){try{if(_0x3661b0){fs[_0x2672('0x66')](_0x3661b0);logger[_0x2672('0x67')](_0x2672('0x97'));}if(_0x222da7){rimraf(_0x222da7,function(){});logger[_0x2672('0x67')](_0x2672('0x98'));}}catch(_0x3be24e){logger[_0x2672('0x2c')](_0x3be24e);}}exports['update']=function(_0xfbdbe5,_0x27ae1d,_0x1082a5){return db['Plugin'][_0x2672('0x4b')]({'where':{'id':_0xfbdbe5[_0x2672('0x99')]['id']}})[_0x2672('0x28')](handleEntityNotFound(_0x27ae1d,null))[_0x2672('0x28')](saveUpdates(_0xfbdbe5[_0x2672('0x90')],null))[_0x2672('0x28')](respondWithResult(_0x27ae1d,null))[_0x2672('0x4c')](handleError(_0x27ae1d,null));};exports[_0x2672('0x9a')]=function(_0x23d8a2,_0x1c13c9,_0x28e93e){return db[_0x2672('0x31')][_0x2672('0x4b')]({'where':{'id':_0x23d8a2[_0x2672('0x99')]['id']}})[_0x2672('0x28')](function(_0x34d410){if(_0x34d410){return _0x34d410['destroy']();}})['then'](function(_0x3e890d){rimraf(path[_0x2672('0x4f')](config[_0x2672('0x50')],_0x2672('0x51'),path['dirname'](_0x3e890d[_0x2672('0x4e')])),function(){});return _0x3e890d;})['then'](handleEntityNotFound(_0x1c13c9,null))[_0x2672('0x28')](respondWithStatusCode(_0x1c13c9,null))[_0x2672('0x4c')](handleError(_0x1c13c9,null));};exports[_0x2672('0x9b')]=function(_0x5908a6,_0x3430f1,_0x6038d9){return BPromise[_0x2672('0x9c')]()[_0x2672('0x28')](function(){if(!_0x5908a6[_0x2672('0x36')][_0x2672('0x4e')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5908a6['query'][_0x2672('0x9d')]){throw new Error(_0x2672('0x9e'));}var _0xf5773f=_0x5908a6['query'][_0x2672('0x9f')]?_0x5908a6['query'][_0x2672('0x9f')]+':'+_0x5908a6[_0x2672('0x36')][_0x2672('0x9d')]:_0x2672('0xa0')+_0x5908a6['query']['port'];var _0x3f228c=_0x5908a6[_0x2672('0x36')][_0x2672('0x1e')]?_0x5908a6[_0x2672('0x36')]['json']:!![];var _0x20e01f=_0x5908a6[_0x2672('0x36')][_0x2672('0xa1')]?_0x5908a6['query'][_0x2672('0xa1')]:null;var _0x12f9ca={'method':_0x5908a6[_0x2672('0xa2')],'uri':util[_0x2672('0x52')]('%s%s',_0xf5773f,_0x5908a6[_0x2672('0x36')]['path']),'json':_0x3f228c,'resolveWithFullResponse':!![],'encoding':_0x20e01f,'qs':_0x5908a6['query']};if(_0x5908a6[_0x2672('0xa3')]){_0x12f9ca[_0x2672('0xa3')]=_0x5908a6[_0x2672('0xa3')];if(_0x12f9ca[_0x2672('0xa3')][_0x2672('0xa4')]){delete _0x12f9ca['headers']['content-length'];}}if(_0x12f9ca[_0x2672('0xa3')][_0x2672('0xa5')]){delete _0x12f9ca['headers'][_0x2672('0xa5')];}return rp(_0x12f9ca);})[_0x2672('0x28')](function(_0xe0be9a){if(_0xe0be9a){_0x3430f1[_0x2672('0xa6')](_0xe0be9a[_0x2672('0xa3')]);logger['info'](_0xe0be9a['body']);if(_['endsWith'](_0x5908a6[_0x2672('0x36')][_0x2672('0x4e')],_0x2672('0x4d'))&&_0xe0be9a[_0x2672('0xa7')]==0x1f4){return _0x3430f1[_0x2672('0x1b')](_0xe0be9a[_0x2672('0xa7')]);}else{return _0x3430f1[_0x2672('0x1d')](_0xe0be9a[_0x2672('0xa7')])['send'](_0xe0be9a[_0x2672('0x90')]);}}else{return _0x3430f1[_0x2672('0x1b')](0xc8);}})[_0x2672('0x4c')](handleError(_0x3430f1,null));};exports[_0x2672('0xa8')]=function(_0x272c53,_0x3c4d71,_0x2206d6){return BPromise[_0x2672('0x9c')]()['then'](function(){if(!_0x272c53['query'][_0x2672('0x4e')]){throw new Error(_0x2672('0xa9'));}if(!_0x272c53[_0x2672('0x36')][_0x2672('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x481116=_0x272c53[_0x2672('0x36')]['hostname']?_0x272c53['query']['hostname']+':'+_0x272c53[_0x2672('0x36')][_0x2672('0x9d')]:_0x2672('0xa0')+_0x272c53[_0x2672('0x36')]['port'];var _0x569827=_0x272c53[_0x2672('0x36')][_0x2672('0x1e')]?_0x272c53['query'][_0x2672('0x1e')]:!![];var _0x5300cc=_0x272c53[_0x2672('0x36')][_0x2672('0xa1')]?_0x272c53[_0x2672('0x36')][_0x2672('0xa1')]:null;var _0x103d20={'method':_0x272c53[_0x2672('0xa2')],'uri':util[_0x2672('0x52')](_0x2672('0xaa'),_0x481116,_0x272c53[_0x2672('0x36')]['path']),'json':_0x569827,'resolveWithFullResponse':!![],'encoding':_0x5300cc,'body':_0x272c53['body']};if(_0x272c53[_0x2672('0xa3')]){_0x103d20['headers']=_0x272c53[_0x2672('0xa3')];if(_0x103d20['headers']['content-length']){delete _0x103d20[_0x2672('0xa3')][_0x2672('0xa4')];}}if(_0x103d20[_0x2672('0xa3')][_0x2672('0xa5')]){delete _0x103d20[_0x2672('0xa3')][_0x2672('0xa5')];}return rp(_0x103d20);})[_0x2672('0x28')](function(_0x13f9df){if(_0x13f9df){_0x3c4d71['set'](_0x13f9df[_0x2672('0xa3')]);logger[_0x2672('0x67')](_0x13f9df[_0x2672('0x90')]);return _0x3c4d71[_0x2672('0x1d')](_0x13f9df[_0x2672('0xa7')])['send'](_0x13f9df[_0x2672('0x90')]);}else{return _0x3c4d71['sendStatus'](0xc8);}})['catch'](handleError(_0x3c4d71,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 29aad9d..b15de4b 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 _0x9261=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9261,0x1de));var _0x1926=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0x9261[_0x1ed46f];return _0x43b931;};'use strict';var EventEmitter=require(_0x1926('0x0'));var Plugin=require(_0x1926('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x1926('0x2')](0x0);var events={'afterCreate':_0x1926('0x3'),'afterUpdate':_0x1926('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b2b33){return function(_0x2fb805,_0x269cb1,_0x31eef2){PluginEvents[_0x1926('0x5')](_0x1b2b33+':'+_0x2fb805['id'],_0x2fb805);PluginEvents['emit'](_0x1b2b33,_0x2fb805);_0x31eef2(null);};}for(var e in events){if(events[_0x1926('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x1926('0x7')]=PluginEvents; \ No newline at end of file +var _0x1c23=['hook','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x6f76f5,_0x29737e){var _0x4b11e6=function(_0xcf4cb9){while(--_0xcf4cb9){_0x6f76f5['push'](_0x6f76f5['shift']());}};_0x4b11e6(++_0x29737e);}(_0x1c23,0x1d5));var _0x31c2=function(_0x71dda2,_0x339824){_0x71dda2=_0x71dda2-0x0;var _0x41f352=_0x1c23[_0x71dda2];return _0x41f352;};'use strict';var EventEmitter=require(_0x31c2('0x0'));var Plugin=require(_0x31c2('0x1'))['db'][_0x31c2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x31c2('0x3')](0x0);var events={'afterCreate':_0x31c2('0x4'),'afterUpdate':_0x31c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x30a2af){return function(_0x2da7ad,_0x55e8c3,_0x50b513){PluginEvents[_0x31c2('0x6')](_0x30a2af+':'+_0x2da7ad['id'],_0x2da7ad);PluginEvents[_0x31c2('0x6')](_0x30a2af,_0x2da7ad);_0x50b513(null);};}for(var e in events){if(events[_0x31c2('0x7')](e)){var event=events[e];Plugin[_0x31c2('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 262a1dd..575cf62 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 _0xa832=['bluebird','path','./plugin.attributes','exports','plugins','lodash','util','../../config/logger','api','moment'];(function(_0x1a81cc,_0x1ba564){var _0x2c7dd2=function(_0x289a27){while(--_0x289a27){_0x1a81cc['push'](_0x1a81cc['shift']());}};_0x2c7dd2(++_0x1ba564);}(_0xa832,0x1db));var _0x2a83=function(_0x175214,_0x275490){_0x175214=_0x175214-0x0;var _0x33eaf3=_0xa832[_0x175214];return _0x33eaf3;};'use strict';var _=require(_0x2a83('0x0'));var util=require(_0x2a83('0x1'));var logger=require(_0x2a83('0x2'))(_0x2a83('0x3'));var moment=require(_0x2a83('0x4'));var BPromise=require(_0x2a83('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a83('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2a83('0x7'));module[_0x2a83('0x8')]=function(_0x5bc70c,_0x4fe76f){return _0x5bc70c['define']('Plugin',attributes,{'tableName':_0x2a83('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee54=['rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10d348,_0x3cf191){var _0x2d282c=function(_0x34e8b6){while(--_0x34e8b6){_0x10d348['push'](_0x10d348['shift']());}};_0x2d282c(++_0x3cf191);}(_0xee54,0x1f0));var _0x4ee5=function(_0xaf6f46,_0x3d4d3c){_0xaf6f46=_0xaf6f46-0x0;var _0x48e3d0=_0xee54[_0xaf6f46];return _0x48e3d0;};'use strict';var _=require(_0x4ee5('0x0'));var util=require(_0x4ee5('0x1'));var logger=require(_0x4ee5('0x2'))(_0x4ee5('0x3'));var moment=require(_0x4ee5('0x4'));var BPromise=require(_0x4ee5('0x5'));var rp=require(_0x4ee5('0x6'));var fs=require('fs');var path=require(_0x4ee5('0x7'));var rimraf=require(_0x4ee5('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ee5('0x9'));module[_0x4ee5('0xa')]=function(_0x4edbd5,_0x244f32){return _0x4edbd5[_0x4ee5('0xb')](_0x4ee5('0xc'),attributes,{'tableName':_0x4ee5('0xd'),'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 f4f7e93..08898c8 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 _0xcd54=['Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x330753,_0x177e86){var _0x363f1d=function(_0x11d091){while(--_0x11d091){_0x330753['push'](_0x330753['shift']());}};_0x363f1d(++_0x177e86);}(_0xcd54,0xaf));var _0x4cd5=function(_0x9ffebe,_0x390a27){_0x9ffebe=_0x9ffebe-0x0;var _0x4931b8=_0xcd54[_0x9ffebe];return _0x4931b8;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var moment=require(_0x4cd5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cd5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cd5('0x4'))(_0x4cd5('0x5'));var config=require(_0x4cd5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4cd5('0x7')][_0x4cd5('0x8')]({'port':0x232a});config[_0x4cd5('0x9')]=_[_0x4cd5('0xa')](config[_0x4cd5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4cd5('0xb'))(new Redis(config[_0x4cd5('0x9')]));require(_0x4cd5('0xc'))[_0x4cd5('0xd')](socket);function respondWithRpcPromise(_0x50fc4b,_0x2b94e0,_0x43576c){return new BPromise(function(_0x455666,_0x567ef0){return client[_0x4cd5('0xe')](_0x50fc4b,_0x43576c)[_0x4cd5('0xf')](function(_0xcb5c71){logger[_0x4cd5('0x10')]('Plugin,\x20%s,\x20%s',_0x2b94e0,_0x4cd5('0x11'));logger[_0x4cd5('0x12')](_0x4cd5('0x13'),_0x2b94e0,'request\x20sent',JSON[_0x4cd5('0x14')](_0xcb5c71));if(_0xcb5c71[_0x4cd5('0x15')]){if(_0xcb5c71[_0x4cd5('0x15')][_0x4cd5('0x16')]===0x1f4){logger[_0x4cd5('0x15')](_0x4cd5('0x17'),_0x2b94e0,_0xcb5c71[_0x4cd5('0x15')][_0x4cd5('0x18')]);return _0x567ef0(_0xcb5c71[_0x4cd5('0x15')]['message']);}logger[_0x4cd5('0x15')](_0x4cd5('0x17'),_0x2b94e0,_0xcb5c71['error'][_0x4cd5('0x18')]);return _0x455666(_0xcb5c71['error'][_0x4cd5('0x18')]);}else{logger[_0x4cd5('0x10')](_0x4cd5('0x17'),_0x2b94e0,_0x4cd5('0x11'));_0x455666(_0xcb5c71[_0x4cd5('0x19')][_0x4cd5('0x18')]);}})[_0x4cd5('0x1a')](function(_0x5d0c85){logger[_0x4cd5('0x15')](_0x4cd5('0x17'),_0x2b94e0,_0x5d0c85);_0x567ef0(_0x5d0c85);});});}exports[_0x4cd5('0x1b')]=function(_0x561ab5){var _0x56a7b8=this;return new Promise(function(_0x36350a,_0x14cf36){return db[_0x4cd5('0x1c')][_0x4cd5('0x1d')](_0x561ab5[_0x4cd5('0x1e')],{'raw':_0x561ab5[_0x4cd5('0x1f')]?_0x561ab5['options'][_0x4cd5('0x20')]===undefined?!![]:![]:!![]})[_0x4cd5('0xf')](function(_0x1e9456){logger[_0x4cd5('0x10')](_0x4cd5('0x1b'),_0x561ab5);logger[_0x4cd5('0x12')]('CreatePlugin',_0x561ab5,JSON[_0x4cd5('0x14')](_0x1e9456));_0x36350a(_0x1e9456);})[_0x4cd5('0x1a')](function(_0x35f81b){logger[_0x4cd5('0x15')](_0x4cd5('0x1b'),_0x35f81b[_0x4cd5('0x18')],_0x561ab5);_0x14cf36(_0x56a7b8['error'](0x1f4,_0x35f81b[_0x4cd5('0x18')]));});});}; \ No newline at end of file +var _0xf8cb=['CreatePlugin','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','Plugin','body','options','raw'];(function(_0x418609,_0x42448e){var _0x4d0da2=function(_0x1e8161){while(--_0x1e8161){_0x418609['push'](_0x418609['shift']());}};_0x4d0da2(++_0x42448e);}(_0xf8cb,0x71));var _0xbf8c=function(_0x4839e5,_0x1a28af){_0x4839e5=_0x4839e5-0x0;var _0x9d419f=_0xf8cb[_0x4839e5];return _0x9d419f;};'use strict';var _=require('lodash');var util=require(_0xbf8c('0x0'));var moment=require('moment');var BPromise=require(_0xbf8c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf8c('0x2'))['db'];var utils=require(_0xbf8c('0x3'));var logger=require(_0xbf8c('0x4'))(_0xbf8c('0x5'));var config=require(_0xbf8c('0x6'));var jayson=require(_0xbf8c('0x7'));var client=jayson[_0xbf8c('0x8')]['http']({'port':0x232a});config['redis']=_[_0xbf8c('0x9')](config[_0xbf8c('0xa')],{'host':_0xbf8c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf8c('0xa')]));require(_0xbf8c('0xc'))['register'](socket);function respondWithRpcPromise(_0x19da42,_0x30e620,_0x141241){return new BPromise(function(_0x2aa08c,_0x5da112){return client[_0xbf8c('0xd')](_0x19da42,_0x141241)[_0xbf8c('0xe')](function(_0x457e38){logger[_0xbf8c('0xf')](_0xbf8c('0x10'),_0x30e620,_0xbf8c('0x11'));logger[_0xbf8c('0x12')](_0xbf8c('0x13'),_0x30e620,_0xbf8c('0x11'),JSON['stringify'](_0x457e38));if(_0x457e38[_0xbf8c('0x14')]){if(_0x457e38[_0xbf8c('0x14')]['code']===0x1f4){logger[_0xbf8c('0x14')](_0xbf8c('0x10'),_0x30e620,_0x457e38[_0xbf8c('0x14')][_0xbf8c('0x15')]);return _0x5da112(_0x457e38['error'][_0xbf8c('0x15')]);}logger[_0xbf8c('0x14')](_0xbf8c('0x10'),_0x30e620,_0x457e38[_0xbf8c('0x14')]['message']);return _0x2aa08c(_0x457e38[_0xbf8c('0x14')]['message']);}else{logger[_0xbf8c('0xf')](_0xbf8c('0x10'),_0x30e620,'request\x20sent');_0x2aa08c(_0x457e38[_0xbf8c('0x16')][_0xbf8c('0x15')]);}})['catch'](function(_0x49976e){logger['error'](_0xbf8c('0x10'),_0x30e620,_0x49976e);_0x5da112(_0x49976e);});});}exports['CreatePlugin']=function(_0x1d204e){var _0x5d3d91=this;return new Promise(function(_0x46cd49,_0x502f1a){return db[_0xbf8c('0x17')]['create'](_0x1d204e[_0xbf8c('0x18')],{'raw':_0x1d204e[_0xbf8c('0x19')]?_0x1d204e[_0xbf8c('0x19')][_0xbf8c('0x1a')]===undefined?!![]:![]:!![]})[_0xbf8c('0xe')](function(_0x17845e){logger['info'](_0xbf8c('0x1b'),_0x1d204e);logger[_0xbf8c('0x12')]('CreatePlugin',_0x1d204e,JSON['stringify'](_0x17845e));_0x46cd49(_0x17845e);})['catch'](function(_0x5025ec){logger[_0xbf8c('0x14')](_0xbf8c('0x1b'),_0x5025ec[_0xbf8c('0x15')],_0x1d204e);_0x502f1a(_0x5d3d91[_0xbf8c('0x14')](0x1f4,_0x5025ec['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 2ad5ce8..fa50059 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 _0x0476=['update','emit','removeListener','length','plugin:','save','remove'];(function(_0x37c823,_0xd72ade){var _0x19444d=function(_0x3549dc){while(--_0x3549dc){_0x37c823['push'](_0x37c823['shift']());}};_0x19444d(++_0xd72ade);}(_0x0476,0x8a));var _0x6047=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0x0476[_0x4b6507];return _0x2001ec;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x6047('0x0'),_0x6047('0x1'),_0x6047('0x2')];function createListener(_0x42616a,_0x19622f){return function(_0x1d773c){_0x19622f[_0x6047('0x3')](_0x42616a,_0x1d773c);};}function removeListener(_0x2fbfbb,_0x6c5571){return function(){PluginEvents[_0x6047('0x4')](_0x2fbfbb,_0x6c5571);};}exports['register']=function(_0x11e217){for(var _0x2332ad=0x0,_0x55c521=events[_0x6047('0x5')];_0x2332ad<_0x55c521;_0x2332ad++){var _0x53f8c2=events[_0x2332ad];var _0x50bed7=createListener(_0x6047('0x6')+_0x53f8c2,_0x11e217);PluginEvents['on'](_0x53f8c2,_0x50bed7);}}; \ No newline at end of file +var _0xfc86=['./plugin.events','save','remove','update','emit','removeListener','plugin:'];(function(_0xca6f74,_0x24190d){var _0x230c39=function(_0x46bd5f){while(--_0x46bd5f){_0xca6f74['push'](_0xca6f74['shift']());}};_0x230c39(++_0x24190d);}(_0xfc86,0x69));var _0x6fc8=function(_0x1626d3,_0x563159){_0x1626d3=_0x1626d3-0x0;var _0x410374=_0xfc86[_0x1626d3];return _0x410374;};'use strict';var PluginEvents=require(_0x6fc8('0x0'));var events=[_0x6fc8('0x1'),_0x6fc8('0x2'),_0x6fc8('0x3')];function createListener(_0x106426,_0x59d732){return function(_0x507d5f){_0x59d732[_0x6fc8('0x4')](_0x106426,_0x507d5f);};}function removeListener(_0x52ae15,_0x54bb94){return function(){PluginEvents[_0x6fc8('0x5')](_0x52ae15,_0x54bb94);};}exports['register']=function(_0x273e50){for(var _0x4b63b5=0x0,_0x4ff214=events['length'];_0x4b63b5<_0x4ff214;_0x4b63b5++){var _0x3344be=events[_0x4b63b5];var _0x4ace5d=createListener(_0x6fc8('0x6')+_0x3344be,_0x273e50);PluginEvents['on'](_0x3344be,_0x4ace5d);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 6993ef2..2febc7b 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(_0x1d9208,_0x3de0e1){var _0x2d34f3=function(_0x660991){while(--_0x660991){_0x1d9208['push'](_0x1d9208['shift']());}};_0x2d34f3(++_0x3de0e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x52f97b,_0x462380){var _0x3aff8d=function(_0x34aeba){while(--_0x34aeba){_0x52f97b['push'](_0x52f97b['shift']());}};_0x3aff8d(++_0x462380);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 0382e8b..80a5e50 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 _0x222f=['dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','stack','name','status','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','body','join','../../files/plugins','script','chdir','dirname','start'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x222f,0x1a4));var _0xf222=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0x222f[_0x426dd2];return _0x4bc76c;};'use strict';var _=require(_0xf222('0x0'));var pm2=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var path=require('path');var exec=require('child_process')[_0xf222('0x4')];var BPromise=require(_0xf222('0x5'));function handleEntityNotFound(_0x307791,_0x7b187d){return function(_0x59a619){if(!_0x59a619){_0x307791[_0xf222('0x6')](0x194);;}return _0x59a619;};}function respondWithResult(_0x54a758,_0x112e6d){_0x112e6d=_0x112e6d||0xc8;return function(_0x26f129){if(_0x26f129){return _0x54a758['status'](_0x112e6d)[_0xf222('0x7')](_0x26f129);}return null;};}function handleError(_0x302d7a,_0x4aceb4){_0x4aceb4=_0x4aceb4||0x1f4;return function(_0x31c027){logger[_0xf222('0x8')](_0x31c027[_0xf222('0x9')]);if(_0x31c027[_0xf222('0xa')]){delete _0x31c027[_0xf222('0xa')];}_0x302d7a[_0xf222('0xb')](_0x4aceb4)['send'](_0x31c027);};}function execChildProcess(){return new BPromise(function(_0x2e29ad,_0x405080){exec(_0xf222('0xc'),function(_0x182bc3,_0x48f740,_0x3c9b96){logger[_0xf222('0xd')](_0x48f740);logger[_0xf222('0xd')](_0x3c9b96);if(_0x182bc3){logger[_0xf222('0x8')](_0x182bc3);return _0x405080(_0x182bc3);}return _0x2e29ad(_0x48f740);});});}exports[_0xf222('0xe')]=function(_0x334017,_0x11fca0){return pm2[_0xf222('0xf')]()['then'](function(_0x5b8f97){if(_0x5b8f97){var _0x1feb86=_[_0xf222('0x10')](_0x5b8f97,function(_0x4c2314){return _0x4c2314[_0xf222('0xa')]===_0xf222('0x11')||_0x4c2314[_0xf222('0xa')]===_0xf222('0x12');});return{'rows':_0x1feb86,'count':_0x1feb86[_0xf222('0x13')]};}return null;})[_0xf222('0x14')](respondWithResult(_0x11fca0,null))[_0xf222('0x15')](handleError(_0x11fca0,null));};exports['show']=function(_0x1efa9f,_0x823314){return pm2[_0xf222('0x16')](_0x1efa9f[_0xf222('0x17')]['id'])[_0xf222('0x14')](respondWithResult(_0x823314,null))[_0xf222('0x14')](handleEntityNotFound(_0x823314,null))[_0xf222('0x15')](handleError(_0x823314,null));};exports['create']=function(_0xf26a16,_0x1bdd0a){if(_0xf26a16[_0xf222('0x18')][_0xf222('0xa')]&&_0xf26a16['body']['script']){var _0x398ff4=path[_0xf222('0x19')](__dirname,_0xf222('0x1a'),_0xf26a16[_0xf222('0x18')][_0xf222('0x1b')]);var _0x151a89=process['cwd']();process[_0xf222('0x1c')](path[_0xf222('0x1d')](_0x398ff4));return execChildProcess()[_0xf222('0x14')](function(_0x12d443){process[_0xf222('0x1c')](_0x151a89);return pm2[_0xf222('0x1e')]({'name':_0xf26a16[_0xf222('0x18')][_0xf222('0xa')],'script':_0x398ff4});})['then'](function(_0x145e2e){pm2[_0xf222('0x1f')]();return _0x145e2e[0x0];})[_0xf222('0x14')](respondWithResult(_0x1bdd0a,0xc9))[_0xf222('0x15')](handleError(_0x1bdd0a,null));}else{return _0x1bdd0a[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x21')});}};exports[_0xf222('0x22')]=function(_0x15bf4e,_0x2ec2e9){if(_0x15bf4e[_0xf222('0x18')]['id']){delete _0x15bf4e['body']['id'];}var _0x14b2b1={'online':_0xf222('0x23'),'stopped':_0xf222('0x24')};if(_0x14b2b1[_0xf222('0x25')](_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')])){return pm2[_0x14b2b1[_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')]]](_0x15bf4e[_0xf222('0x17')]['id'])['then'](respondWithResult(_0x2ec2e9,0xc8))[_0xf222('0x15')](handleError(_0x2ec2e9,null));}else{return _0x2ec2e9[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf222('0x26')]=function(_0x5d5963,_0x40c7e7){if(_0x5d5963[_0xf222('0x18')]['id']){delete _0x5d5963[_0xf222('0x18')]['id'];}if(_0x5d5963[_0xf222('0x17')]['id']){return pm2[_0xf222('0x27')](_0x5d5963[_0xf222('0x17')]['id'])[_0xf222('0x14')](function(_0x5075ad){pm2['dump']();return _0x5075ad[0x0];})[_0xf222('0x14')](respondWithResult(_0x40c7e7,null))[_0xf222('0x15')](handleError(_0x40c7e7,null));}else{return _0x40c7e7[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x28')});}}; \ No newline at end of file +var _0x57f8=['error','name','npm\x20install','info','index','list','express','length','then','catch','show','describe','params','body','script','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x57f8,0x198));var _0x857f=function(_0x12fc36,_0x6530d3){_0x12fc36=_0x12fc36-0x0;var _0x55c667=_0x57f8[_0x12fc36];return _0x55c667;};'use strict';var _=require('lodash');var pm2=require(_0x857f('0x0'));var logger=require(_0x857f('0x1'))(_0x857f('0x2'));var path=require(_0x857f('0x3'));var exec=require(_0x857f('0x4'))[_0x857f('0x5')];var BPromise=require(_0x857f('0x6'));function handleEntityNotFound(_0x6f054b,_0x318050){return function(_0xced48e){if(!_0xced48e){_0x6f054b[_0x857f('0x7')](0x194);;}return _0xced48e;};}function respondWithResult(_0x369c40,_0x5d22e4){_0x5d22e4=_0x5d22e4||0xc8;return function(_0x8380e8){if(_0x8380e8){return _0x369c40[_0x857f('0x8')](_0x5d22e4)[_0x857f('0x9')](_0x8380e8);}return null;};}function handleError(_0x577fc3,_0x5f6a66){_0x5f6a66=_0x5f6a66||0x1f4;return function(_0x135855){logger[_0x857f('0xa')](_0x135855['stack']);if(_0x135855[_0x857f('0xb')]){delete _0x135855[_0x857f('0xb')];}_0x577fc3[_0x857f('0x8')](_0x5f6a66)['send'](_0x135855);};}function execChildProcess(){return new BPromise(function(_0xefee53,_0x360827){exec(_0x857f('0xc'),function(_0x11adfd,_0x268f9d,_0x3eb530){logger[_0x857f('0xd')](_0x268f9d);logger['info'](_0x3eb530);if(_0x11adfd){logger[_0x857f('0xa')](_0x11adfd);return _0x360827(_0x11adfd);}return _0xefee53(_0x268f9d);});});}exports[_0x857f('0xe')]=function(_0x373333,_0x2caf29){return pm2[_0x857f('0xf')]()['then'](function(_0x4bc590){if(_0x4bc590){var _0x3b09d9=_['reject'](_0x4bc590,function(_0x1fafbe){return _0x1fafbe['name']===_0x857f('0x10')||_0x1fafbe[_0x857f('0xb')]==='motion2';});return{'rows':_0x3b09d9,'count':_0x3b09d9[_0x857f('0x11')]};}return null;})[_0x857f('0x12')](respondWithResult(_0x2caf29,null))[_0x857f('0x13')](handleError(_0x2caf29,null));};exports[_0x857f('0x14')]=function(_0x279e74,_0x38a3c2){return pm2[_0x857f('0x15')](_0x279e74[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x38a3c2,null))[_0x857f('0x12')](handleEntityNotFound(_0x38a3c2,null))[_0x857f('0x13')](handleError(_0x38a3c2,null));};exports['create']=function(_0x1729d8,_0x1e8fd4){if(_0x1729d8['body'][_0x857f('0xb')]&&_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]){var _0x484035=path['join'](__dirname,_0x857f('0x19'),_0x1729d8[_0x857f('0x17')][_0x857f('0x18')]);var _0x4fa031=process[_0x857f('0x1a')]();process[_0x857f('0x1b')](path[_0x857f('0x1c')](_0x484035));return execChildProcess()['then'](function(_0x1961ea){process[_0x857f('0x1b')](_0x4fa031);return pm2['start']({'name':_0x1729d8[_0x857f('0x17')][_0x857f('0xb')],'script':_0x484035});})[_0x857f('0x12')](function(_0x44ff23){pm2[_0x857f('0x1d')]();return _0x44ff23[0x0];})[_0x857f('0x12')](respondWithResult(_0x1e8fd4,0xc9))[_0x857f('0x13')](handleError(_0x1e8fd4,null));}else{return _0x1e8fd4[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x1f')});}};exports[_0x857f('0x20')]=function(_0x4782ab,_0x250731){if(_0x4782ab[_0x857f('0x17')]['id']){delete _0x4782ab['body']['id'];}var _0x17e415={'online':_0x857f('0x21'),'stopped':_0x857f('0x22')};if(_0x17e415[_0x857f('0x23')](_0x4782ab['body'][_0x857f('0x8')])){return pm2[_0x17e415[_0x4782ab['body'][_0x857f('0x8')]]](_0x4782ab[_0x857f('0x16')]['id'])[_0x857f('0x12')](respondWithResult(_0x250731,0xc8))[_0x857f('0x13')](handleError(_0x250731,null));}else{return _0x250731[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':_0x857f('0x24')});}};exports[_0x857f('0x25')]=function(_0x17e7b6,_0x41f832){if(_0x17e7b6[_0x857f('0x17')]['id']){delete _0x17e7b6[_0x857f('0x17')]['id'];}if(_0x17e7b6[_0x857f('0x16')]['id']){return pm2['delete'](_0x17e7b6[_0x857f('0x16')]['id'])[_0x857f('0x12')](function(_0x55e69f){pm2[_0x857f('0x1d')]();return _0x55e69f[0x0];})[_0x857f('0x12')](respondWithResult(_0x41f832,null))['catch'](handleError(_0x41f832,null));}else{return _0x41f832[_0x857f('0x8')](0x1f4)[_0x857f('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d3c0835..5850d2c 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 _0x050a=['/queues','getQueues','exports','express','Router','get','/agents','isAuthenticated','getAgents'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x050a,0xa5));var _0xa050=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x050a[_0x3ab51d];return _0x29a04e;};'use strict';var express=require(_0xa050('0x0'));var router=express[_0xa050('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xa050('0x2')](_0xa050('0x3'),auth[_0xa050('0x4')](),controller[_0xa050('0x5')]);router[_0xa050('0x2')](_0xa050('0x6'),auth[_0xa050('0x4')](),controller[_0xa050('0x7')]);module[_0xa050('0x8')]=router; \ No newline at end of file +var _0x2f68=['/agents','isAuthenticated','getAgents','/queues','exports','express','Router','../../components/auth/service','get'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x2f68,0x1c7));var _0x82f6=function(_0x4f890e,_0x4877fb){_0x4f890e=_0x4f890e-0x0;var _0x569797=_0x2f68[_0x4f890e];return _0x569797;};'use strict';var express=require(_0x82f6('0x0'));var router=express[_0x82f6('0x1')]();var auth=require(_0x82f6('0x2'));var controller=require('./realtime.controller');router[_0x82f6('0x3')](_0x82f6('0x4'),auth[_0x82f6('0x5')](),controller[_0x82f6('0x6')]);router[_0x82f6('0x3')](_0x82f6('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x82f6('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e3e9008..0c67a64 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 _0x57af=['faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatus','openchannelStatus','chatStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','User','rawAttributes','fieldName','type','key','query','role','getOptions','user','agent','nolimit','sort','UserProfile','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','Queue','userProfileId','QueueCampaigns','findAndCountAll','all','util','jayson/promise','../../components/parsers/qs','../../mysqldb','http','client','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)','catch','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','talking','paused','outbound','push','pTalking','originated','message','dialActive','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','waiting','voice','find','merge','pick','filter','queue','busy','some','connectedlinenum','getMembers','UserId','accountcode','voiceStatus','online','loggedInDb','agents','startCase','Pause','findAll','QueueId','length','idle','unavailable','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','faxStatus','mailStatus','smsStatus','whatsappStatus','unknown','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','internal','address'];(function(_0x33fe4e,_0x4eac1d){var _0x1ae9f3=function(_0x5003c0){while(--_0x5003c0){_0x33fe4e['push'](_0x33fe4e['shift']());}};_0x1ae9f3(++_0x4eac1d);}(_0x57af,0xcb));var _0xf57a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x57af[_0x278e3c];return _0x3e2d9b;};'use strict';var util=require(_0xf57a('0x0'));var _=require('lodash');var jayson=require(_0xf57a('0x1'));var qs=require(_0xf57a('0x2'));var logger=require('../../config/logger')('api');var db=require(_0xf57a('0x3'))['db'];var amiClient=jayson['client'][_0xf57a('0x4')]({'port':0x232a});var routingClient=jayson[_0xf57a('0x5')][_0xf57a('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x45e8ee,_0x5b9f62){return function(_0x4e3799){if(_0x4e3799){var _0x3203f7=typeof _0x5b9f62[_0xf57a('0x6')]===_0xf57a('0x7')&&typeof _0x5b9f62[_0xf57a('0x8')]===_0xf57a('0x7');var _0x425327=_0x4e3799[_0xf57a('0x9')];var _0x14efc7=_0x3203f7?0x0:_0x5b9f62['offset'];var _0x43987d=_0x3203f7?_0x4e3799['count']:_0x5b9f62[_0xf57a('0x6')]+_0x5b9f62[_0xf57a('0x8')];var _0x1a9e62;if(_0x43987d>=_0x425327){_0x43987d=_0x425327;_0x1a9e62=0xc8;}else{_0x1a9e62=0xce;}_0x45e8ee[_0xf57a('0xa')](_0x1a9e62);return _0x45e8ee[_0xf57a('0xb')](_0xf57a('0xc'),_0x14efc7+'-'+_0x43987d+'/'+_0x425327)[_0xf57a('0xd')](_0x4e3799);}return null;};}function handleError(_0x4cea16,_0x1e7023){_0x1e7023=_0x1e7023||0x1f4;return function(_0x1d108f){logger[_0xf57a('0xe')](_0x1d108f[_0xf57a('0xf')]);if(_0x1d108f[_0xf57a('0x10')]){delete _0x1d108f[_0xf57a('0x10')];}_0x4cea16[_0xf57a('0xa')](_0x1e7023)['send'](_0x1d108f);};}function getRealtimeAgents(){return new Promise(function(_0x51f30c,_0x3c769e){return amiClient[_0xf57a('0x11')](_0xf57a('0x12'),{})[_0xf57a('0x13')](function(_0x194d25){if(_0x194d25[_0xf57a('0xe')])throw new Error(_0xf57a('0x14'));var _0x5b22cd=_0x194d25[_0xf57a('0x15')];return routingClient['request']('Agents',{})['then'](function(_0x2be2fe){if(_0x2be2fe[_0xf57a('0xe')])throw new Error(_0xf57a('0x16'));var _0x246187=_0x2be2fe[_0xf57a('0x15')];return _0x51f30c(_['merge']({},_0x5b22cd,_0x246187));});})[_0xf57a('0x17')](function(_0x42e119){_0x3c769e(_0x42e119);});});}function getRealtimeQueues(_0x2182b6,_0x2c8df0){return new Promise(function(_0x5d80a9,_0x5e42e5){var _0xd5614e=_0x2c8df0==='voice'?amiClient:routingClient;return _0xd5614e[_0xf57a('0x11')](_['startCase'](_0x2c8df0)+_0xf57a('0x18'),_0x2182b6)['then'](function(_0x26f7ff){if(_0x26f7ff[_0xf57a('0xe')])throw new Error(util[_0xf57a('0x19')](_0xf57a('0x1a'),_0x2c8df0));return _0x5d80a9(_0x26f7ff[_0xf57a('0x15')]);})[_0xf57a('0x17')](function(_0x43ecc4){_0x5e42e5(_0x43ecc4);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x50b516,_0x1b4853){return amiClient[_0xf57a('0x11')]('VoiceQueuesChannels',{})[_0xf57a('0x13')](function(_0x19dd88){if(_0x19dd88[_0xf57a('0xe')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x50b516(_0x19dd88[_0xf57a('0x15')]);})[_0xf57a('0x17')](function(_0xb0530b){_0x1b4853(_0xb0530b);});});}function initializeQueues(_0x575389,_0x84bf15,_0x124755,_0x33c057){var _0x55a639=[_0xf57a('0x1b'),_0xf57a('0x1c'),'waiting',_0xf57a('0x1d'),_0xf57a('0x1e')];if(_0x124755==='voice'&&_0x33c057===_0xf57a('0x1f')){_0x55a639[_0xf57a('0x20')](_0xf57a('0x21'),_0xf57a('0x22'),_0xf57a('0x23'),_0xf57a('0x24'),'dialMethod','Trunk',_0xf57a('0x25'),_0xf57a('0x26'),_0xf57a('0x27'),_0xf57a('0x28'),'erlangAbandonmentRate',_0xf57a('0x29'),_0xf57a('0x2a'),_0xf57a('0x2b'),'dialPredictiveIntervalMinThreshold',_0xf57a('0x2c'),_0xf57a('0x2d'),_0xf57a('0x2e'),_0xf57a('0x2f'),_0xf57a('0x30'),'predictiveIntervalAvgHoldtime',_0xf57a('0x31'));}return _0x575389[_0xf57a('0x32')](function(_0x132580){var _0x96b54c=_0x132580[_0xf57a('0x33')]({'plain':!![]});_0x96b54c['agents']=[];_0x96b54c[_0xf57a('0x1e')]=0x0;_0x96b54c['loggedInDb']=0x0;_0x96b54c['loggedIn']=0x0;_0x96b54c[_0xf57a('0x1c')]=0x0;_0x96b54c[_0xf57a('0x34')]=0x0;if(_0x124755===_0xf57a('0x35')){_0x96b54c[_0xf57a('0x1d')]=0x0;_0x96b54c['busy']=0x0;if(_0x33c057==='outbound'){_0x96b54c[_0xf57a('0x21')]=0x0;_0x96b54c[_0xf57a('0x22')]=0x0;}}var _0x395c5f=_[_0xf57a('0x36')](_0x84bf15,['id',_0x96b54c['id']]);if(_0x395c5f)_[_0xf57a('0x37')](_0x96b54c,_[_0xf57a('0x38')](_0x395c5f,_0x55a639));return _0x96b54c;});}function updateAgentVoiceStatus(_0x87f8a6,_0x498914,_0x5e62a3){var _0x28cb27=_[_0xf57a('0x39')](_0x5e62a3,[_0xf57a('0x3a'),_0x498914[_0xf57a('0x10')]]);if(_0x28cb27['length']===0x0)return _0x87f8a6[_0xf57a('0x3b')]=!![];if(_[_0xf57a('0x3c')](_0x28cb27,[_0xf57a('0x3d'),_0x87f8a6['internal']['toString']()]))return _0x87f8a6[_0xf57a('0x1d')]=!![];if(!_0x87f8a6[_0xf57a('0x1d')])return _0x87f8a6[_0xf57a('0x3b')]=!![];}function getVoiceQueueAgents(_0x31d4ab,_0x5504b3,_0x4547ae,_0x546140){var _0x2bd527=_[_0xf57a('0x36')](_0x5504b3,['id',_0x31d4ab['id']]);if(!_0x2bd527)return _0x31d4ab;return _0x2bd527[_0xf57a('0x3e')]({'raw':!![]})[_0xf57a('0x13')](function(_0x2d824a){for(var _0x26599a=0x0;_0x26599a<_0x2d824a['length'];_0x26599a++){var _0x331c28=_[_0xf57a('0x36')](_0x4547ae,['id',_0x2d824a[_0x26599a][_0xf57a('0x3f')]]);if(!_0x331c28){_0x331c28={'id':_0x2d824a[_0x26599a][_0xf57a('0x3f')],'name':_0x2d824a[_0x26599a][_0xf57a('0x3f')],'accountcode':'','online':![]};}var _0x12c7e8={'id':_0x331c28['id'],'name':_0x331c28['name'],'internal':_0x331c28[_0xf57a('0x40')],'online':Boolean(_0x331c28['online']),'paused':Boolean(_0x2d824a[_0x26599a][_0xf57a('0x1e')])};if(_0x331c28[_0xf57a('0x41')]===_0xf57a('0x1d'))updateAgentVoiceStatus(_0x12c7e8,_0x31d4ab,_0x546140);if(_0x12c7e8[_0xf57a('0x42')])_0x31d4ab[_0xf57a('0x43')]++;if(_0x12c7e8['busy'])_0x31d4ab[_0xf57a('0x3b')]++;if(_0x12c7e8['paused']&&!_0x12c7e8[_0xf57a('0x3b')]&&!_0x12c7e8[_0xf57a('0x1d')])_0x31d4ab['paused']++;_0x31d4ab[_0xf57a('0x44')][_0xf57a('0x20')](_0x12c7e8);}return _0x31d4ab;});}function getQueueAgents(_0x31b633,_0x8ab748,_0x34c2f6){var _0x134ad6='User'+_[_0xf57a('0x45')](_0x34c2f6)+'Queue';var _0x3a5838=_0x34c2f6+_0xf57a('0x46');return db[_0x134ad6][_0xf57a('0x47')]({'where':{[_[_0xf57a('0x45')](_0x34c2f6)+_0xf57a('0x48')]:_0x31b633['id']},'raw':!![]})[_0xf57a('0x13')](function(_0x239b9c){for(var _0x5ec06b=0x0;_0x5ec06b<_0x239b9c[_0xf57a('0x49')];_0x5ec06b++){var _0x1b9e28=_[_0xf57a('0x36')](_0x8ab748,['id',_0x239b9c[_0x5ec06b][_0xf57a('0x3f')]]);if(!_0x1b9e28){_0x1b9e28={'id':_0x239b9c[_0x5ec06b][_0xf57a('0x3f')],'name':_0x239b9c[_0x5ec06b][_0xf57a('0x3f')],'online':![],['pauseField']:![]};}var _0x67f892={'id':_0x1b9e28['id'],'name':_0x1b9e28[_0xf57a('0x10')],'online':Boolean(_0x1b9e28['online']),'paused':Boolean(_0x1b9e28[_0x3a5838])};if(_0x67f892[_0xf57a('0x42')])_0x31b633[_0xf57a('0x43')]++;_0x31b633[_0xf57a('0x44')][_0xf57a('0x20')](_0x67f892);}return _0x31b633;});}function isIdle(_0x3a32db){return _0x3a32db===_0xf57a('0x4a')||_0x3a32db==='unknown'||_0x3a32db===_0xf57a('0x4b')||_0x3a32db==='ringing'||_[_0xf57a('0x4c')](_0x3a32db);}function isAgentPaused(_0xcaf889,_0x58ffe9){var _0x22731e=[_0xcaf889[_0xf57a('0x4d')],_0xcaf889['faxPause'],_0xcaf889[_0xf57a('0x4e')],_0xcaf889[_0xf57a('0x4f')],_0xcaf889[_0xf57a('0x50')],_0xcaf889[_0xf57a('0x51')],_0xcaf889[_0xf57a('0x52')]];if(!_0x58ffe9)return _[_0xf57a('0x53')](_0x22731e);var _0x2bbc14=_[_0xf57a('0x39')](_0x22731e);return _0x2bbc14['length']>0x0&&_0x2bbc14[_0xf57a('0x49')]<_0x22731e['length']?!![]:![];}function isAgentIdle(_0x26eb6b){if(_0x26eb6b[_0xf57a('0x41')]!==_0xf57a('0x4a')&&_0x26eb6b[_0xf57a('0x51')]){_0x26eb6b['voiceStatus']=_0xf57a('0x54');return![];}return _['every']([_0x26eb6b['chatStatus'],_0x26eb6b[_0xf57a('0x55')],_0x26eb6b[_0xf57a('0x56')],_0x26eb6b['openchannelStatus'],_0x26eb6b[_0xf57a('0x57')],_0x26eb6b['voiceStatus'],_0x26eb6b[_0xf57a('0x58')]],isIdle);}function getAgentStatus(_0x1a3990){var _0x8faff3=_0xf57a('0x59');if(isAgentPaused(_0x1a3990))_0x8faff3='pause';else if(isAgentPaused(_0x1a3990,!![]))_0x8faff3='*pause';else if(isAgentIdle(_0x1a3990))_0x8faff3='idle';else _0x8faff3=_0xf57a('0x3b');return _0x8faff3;}exports[_0xf57a('0x5a')]=function(_0x28a7d3,_0x388c3e){var _0x1d7af1={'count':0x0,'rows':[]},_0x116b30={},_0x2dbc1b,_0x443b62,_0x52c7ca=[_0xf57a('0x5b'),'online',_0xf57a('0x5c'),_0xf57a('0x5d'),_0xf57a('0x5e'),'lastPauseAt',_0xf57a('0x5f'),_0xf57a('0x60'),'chatPause',_0xf57a('0x4f'),_0xf57a('0x4e'),'smsPause','whatsappPause',_0xf57a('0x61'),_0xf57a('0x51'),_0xf57a('0x62'),_0xf57a('0x63'),_0xf57a('0x64'),_0xf57a('0x65'),_0xf57a('0x66'),'faxCapacity','chatCurrentCapacity',_0xf57a('0x67'),_0xf57a('0x68'),_0xf57a('0x69'),_0xf57a('0x6a'),'faxCurrentCapacity',_0xf57a('0x6b'),_0xf57a('0x6c'),_0xf57a('0x56'),'smsStatus',_0xf57a('0x58'),_0xf57a('0x55'),_0xf57a('0x41'),_0xf57a('0x6d'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0xf57a('0x6e'),_0xf57a('0x6f'),'queue',_0xf57a('0x70'),_0xf57a('0x71'),_0xf57a('0x72'),_0xf57a('0x73'),_0xf57a('0x74')],_0x1fbee9=['chatPause',_0xf57a('0x4f'),_0xf57a('0x4e'),_0xf57a('0x50'),_0xf57a('0x52'),_0xf57a('0x61'),'voicePause',_0xf57a('0x42')];Promise[_0xf57a('0x75')]()[_0xf57a('0x13')](function(){var _0x29ecd4=_[_0xf57a('0x32')](db[_0xf57a('0x76')][_0xf57a('0x77')],function(_0x55240b){return{'name':_0x55240b[_0xf57a('0x78')],'type':_0x55240b[_0xf57a('0x79')][_0xf57a('0x7a')]};});_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x7c')]='agent';_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x42')]=!![];_0x116b30=qs[_0xf57a('0x7d')](_0x29ecd4,_0x28a7d3);_0x116b30['raw']=!![];if(_0x28a7d3[_0xf57a('0x7e')][_0xf57a('0x7c')]==='user'){var _0x29c8b4={'params':{'id':_0x28a7d3['user']['userProfileId']},'query':{'section':'Agents','role':_0xf57a('0x7f'),'online':!![],'nolimit':_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x80')],'sort':_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x81')],'filter':_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x39')]},'raw':!![]};return db[_0xf57a('0x82')]['getResources'](_0x29c8b4);}return db['User']['findAndCountAll'](_0x116b30);})[_0xf57a('0x13')](function(_0x552388){_0x1d7af1['count']=_0x552388[_0xf57a('0x9')];_0x2dbc1b=_0x552388[_0xf57a('0x83')];return getRealtimeAgents();})[_0xf57a('0x13')](function(_0x59c468){_0x443b62=_0x59c468[_0xf57a('0x83')];return _0x2dbc1b[_0xf57a('0x32')](function(_0x3fd2ff){var _0x43893e=_[_0xf57a('0x36')](_0x443b62,['id',_0x3fd2ff['id']]);if(_0x43893e)_['merge'](_0x3fd2ff,_['pick'](_[_0xf57a('0x84')](_0x43893e,_0x1fbee9),_0x52c7ca));_0x3fd2ff[_0xf57a('0x85')]=getAgentStatus(_0x3fd2ff);return _0x3fd2ff;});})[_0xf57a('0x13')](function(_0x396e21){if(_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x86')]){var _0x2b4ff4=_[_0xf57a('0x39')](_0x396e21,[_0xf57a('0x85'),_0x28a7d3[_0xf57a('0x7b')][_0xf57a('0x86')]]);if(_0x28a7d3['query'][_0xf57a('0x87')]){_0x2b4ff4=_[_0xf57a('0x39')](_0x2b4ff4,[_0xf57a('0x5e'),_0x28a7d3[_0xf57a('0x7b')]['pauseTypeFilter']]);}}_0x1d7af1[_0xf57a('0x83')]=_0x2b4ff4||_0x396e21;return _0x1d7af1;})[_0xf57a('0x13')](respondWithFilteredResult(_0x388c3e,_0x116b30))[_0xf57a('0x17')](handleError(_0x388c3e,null));};exports[_0xf57a('0x88')]=function(_0x101ba7,_0x41714c){var _0x242c1e=[_0xf57a('0x89'),_0xf57a('0x8a'),_0xf57a('0x8b'),'openchannel',_0xf57a('0x8c'),_0xf57a('0x8d'),_0xf57a('0x35')];var _0x1b07c1={'count':0x0,'rows':[]},_0x1242be={},_0x4af156,_0x93e953,_0x51ed44,_0x555078,_0x1b953;Promise[_0xf57a('0x75')]()['then'](function(){if(_0x101ba7[_0xf57a('0x7b')][_0xf57a('0x8e')]){if(!_['includes'](_0x242c1e,_0x101ba7['query'][_0xf57a('0x8e')][_0xf57a('0x8f')]()))throw new Error(_0xf57a('0x90'));_0x4af156=_0x101ba7[_0xf57a('0x7b')]['channel'][_0xf57a('0x8f')]();}var _0x5c76cf=_['startCase'](_0x4af156)+_0xf57a('0x91');var _0x2e9efe=_[_0xf57a('0x32')](db[_0x5c76cf][_0xf57a('0x77')],function(_0x1b87c6){return{'name':_0x1b87c6[_0xf57a('0x78')],'type':_0x1b87c6[_0xf57a('0x79')][_0xf57a('0x7a')]};});_0x1242be=qs[_0xf57a('0x7d')](_0x2e9efe,_0x101ba7);if(_0x101ba7['user'][_0xf57a('0x7c')]===_0xf57a('0x7e')){var _0x27a18e={'params':{'id':_0x101ba7[_0xf57a('0x7e')][_0xf57a('0x92')]},'query':{'section':_0x4af156===_0xf57a('0x35')&&_0x101ba7['query']['type']==='outbound'?_0xf57a('0x93'):_[_0xf57a('0x45')](_0x4af156)+_0xf57a('0x18'),'type':_0x101ba7[_0xf57a('0x7b')]['type'],'nolimit':!![],'sort':_0xf57a('0x10'),'filter':_0x101ba7[_0xf57a('0x7b')][_0xf57a('0x39')]}};return db[_0xf57a('0x82')]['getResources'](_0x27a18e);}return db[_0x5c76cf][_0xf57a('0x94')](_0x1242be);})['then'](function(_0x240ea5){_0x1b07c1[_0xf57a('0x9')]=_0x240ea5[_0xf57a('0x9')];_0x93e953=_0x240ea5[_0xf57a('0x83')];return getRealtimeQueues(_0x101ba7,_0x4af156);})[_0xf57a('0x13')](function(_0x3ed8b6){_0x555078=_0x3ed8b6[_0xf57a('0x83')];return getRealtimeAgents();})[_0xf57a('0x13')](function(_0x32401a){_0x51ed44=_0x32401a['rows'];if(_0x4af156!=_0xf57a('0x35'))return;return getRealtimeVoiceQueueChannels();})[_0xf57a('0x13')](function(_0xae2af8){_0x1b953=_0xae2af8?_0xae2af8['rows']:[];return initializeQueues(_0x93e953,_0x555078,_0x4af156,_0x101ba7[_0xf57a('0x7b')][_0xf57a('0x79')]);})[_0xf57a('0x13')](function(_0x5d4a50){var _0x117988=_0x5d4a50[_0xf57a('0x32')](function(_0x693a8a){if(_0x4af156===_0xf57a('0x35'))return getVoiceQueueAgents(_0x693a8a,_0x93e953,_0x51ed44,_0x1b953);else return getQueueAgents(_0x693a8a,_0x51ed44,_0x4af156);});return Promise[_0xf57a('0x95')](_0x117988);})[_0xf57a('0x13')](function(_0x5cca45){_0x1b07c1['rows']=_0x5cca45;return _0x1b07c1;})[_0xf57a('0x13')](respondWithFilteredResult(_0x41714c,_0x1242be))[_0xf57a('0x17')](handleError(_0x41714c,null));}; \ No newline at end of file +var _0x60f2=['client','http','offset','undefined','count','limit','set','Content-Range','json','error','stack','name','status','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','then','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','outbound','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','loggedInDb','voice','busy','find','merge','queue','length','some','connectedlinenum','toString','getMembers','UserId','accountcode','online','paused','voiceStatus','push','User','Queue','Pause','QueueId','agents','unknown','ringing','isNil','chatPause','faxPause','smsPause','voicePause','whatsappPause','filter','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','idle','userpic','lastPauseAt','pauseType','internal','address','openchannelPause','mailPause','chatCapacity','openchannelCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','map','rawAttributes','fieldName','type','key','query','role','agent','getOptions','raw','user','userProfileId','sort','UserProfile','getResources','findAndCountAll','rows','pick','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','QueueCampaigns','util','lodash','../../components/parsers/qs','api','../../mysqldb'];(function(_0x40b091,_0xe02e95){var _0xafe339=function(_0xd8db1e){while(--_0xd8db1e){_0x40b091['push'](_0x40b091['shift']());}};_0xafe339(++_0xe02e95);}(_0x60f2,0x1bd));var _0x260f=function(_0x602045,_0x2e4d25){_0x602045=_0x602045-0x0;var _0x24aa35=_0x60f2[_0x602045];return _0x24aa35;};'use strict';var util=require(_0x260f('0x0'));var _=require(_0x260f('0x1'));var jayson=require('jayson/promise');var qs=require(_0x260f('0x2'));var logger=require('../../config/logger')(_0x260f('0x3'));var db=require(_0x260f('0x4'))['db'];var amiClient=jayson[_0x260f('0x5')][_0x260f('0x6')]({'port':0x232a});var routingClient=jayson[_0x260f('0x5')][_0x260f('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x576699,_0x48c643){return function(_0x4e44f0){if(_0x4e44f0){var _0x31c922=typeof _0x48c643[_0x260f('0x7')]===_0x260f('0x8')&&typeof _0x48c643['limit']==='undefined';var _0x31168e=_0x4e44f0[_0x260f('0x9')];var _0x55c50f=_0x31c922?0x0:_0x48c643[_0x260f('0x7')];var _0x3a7708=_0x31c922?_0x4e44f0[_0x260f('0x9')]:_0x48c643['offset']+_0x48c643[_0x260f('0xa')];var _0x3bc162;if(_0x3a7708>=_0x31168e){_0x3a7708=_0x31168e;_0x3bc162=0xc8;}else{_0x3bc162=0xce;}_0x576699['status'](_0x3bc162);return _0x576699[_0x260f('0xb')](_0x260f('0xc'),_0x55c50f+'-'+_0x3a7708+'/'+_0x31168e)[_0x260f('0xd')](_0x4e44f0);}return null;};}function handleError(_0x366375,_0x4ccf78){_0x4ccf78=_0x4ccf78||0x1f4;return function(_0x58f7c0){logger[_0x260f('0xe')](_0x58f7c0[_0x260f('0xf')]);if(_0x58f7c0['name']){delete _0x58f7c0[_0x260f('0x10')];}_0x366375[_0x260f('0x11')](_0x4ccf78)['send'](_0x58f7c0);};}function getRealtimeAgents(){return new Promise(function(_0x2aab61,_0x213913){return amiClient['request'](_0x260f('0x12'),{})['then'](function(_0x1bfccf){if(_0x1bfccf[_0x260f('0xe')])throw new Error(_0x260f('0x13'));var _0x2951bc=_0x1bfccf[_0x260f('0x14')];return routingClient[_0x260f('0x15')](_0x260f('0x12'),{})[_0x260f('0x16')](function(_0x14b23e){if(_0x14b23e['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x30675d=_0x14b23e[_0x260f('0x14')];return _0x2aab61(_['merge']({},_0x2951bc,_0x30675d));});})['catch'](function(_0x2836b6){_0x213913(_0x2836b6);});});}function getRealtimeQueues(_0x534118,_0x2faf67){return new Promise(function(_0x3f070d,_0x4fe495){var _0x43409f=_0x2faf67==='voice'?amiClient:routingClient;return _0x43409f[_0x260f('0x15')](_[_0x260f('0x17')](_0x2faf67)+_0x260f('0x18'),_0x534118)['then'](function(_0x333a99){if(_0x333a99[_0x260f('0xe')])throw new Error(util[_0x260f('0x19')](_0x260f('0x1a'),_0x2faf67));return _0x3f070d(_0x333a99[_0x260f('0x14')]);})[_0x260f('0x1b')](function(_0x49f885){_0x4fe495(_0x49f885);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x57fbe4,_0x1f001c){return amiClient[_0x260f('0x15')](_0x260f('0x1c'),{})[_0x260f('0x16')](function(_0x54a51a){if(_0x54a51a[_0x260f('0xe')])throw new Error(_0x260f('0x1d'));return _0x57fbe4(_0x54a51a[_0x260f('0x14')]);})[_0x260f('0x1b')](function(_0x4c9412){_0x1f001c(_0x4c9412);});});}function initializeQueues(_0x299e2d,_0xa62522,_0x1d8c1b,_0x12b087){var _0x44f0dc=[_0x260f('0x1e'),_0x260f('0x1f'),_0x260f('0x20'),_0x260f('0x21'),'paused'];if(_0x1d8c1b==='voice'&&_0x12b087===_0x260f('0x22')){_0x44f0dc['push'](_0x260f('0x23'),_0x260f('0x24'),'message',_0x260f('0x25'),_0x260f('0x26'),_0x260f('0x27'),_0x260f('0x28'),_0x260f('0x29'),_0x260f('0x2a'),_0x260f('0x2b'),_0x260f('0x2c'),_0x260f('0x2d'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x260f('0x2e'),_0x260f('0x2f'),_0x260f('0x30'),_0x260f('0x31'),_0x260f('0x32'),'predictiveIntervalDroppedCallsCallersExit',_0x260f('0x33'),'predictiveIntervalAvgTalktime');}return _0x299e2d['map'](function(_0x1b3bca){var _0xea8db4=_0x1b3bca['get']({'plain':!![]});_0xea8db4['agents']=[];_0xea8db4['paused']=0x0;_0xea8db4[_0x260f('0x34')]=0x0;_0xea8db4['loggedIn']=0x0;_0xea8db4[_0x260f('0x1f')]=0x0;_0xea8db4['waiting']=0x0;if(_0x1d8c1b===_0x260f('0x35')){_0xea8db4['talking']=0x0;_0xea8db4[_0x260f('0x36')]=0x0;if(_0x12b087===_0x260f('0x22')){_0xea8db4[_0x260f('0x23')]=0x0;_0xea8db4[_0x260f('0x24')]=0x0;}}var _0x533003=_[_0x260f('0x37')](_0xa62522,['id',_0xea8db4['id']]);if(_0x533003)_[_0x260f('0x38')](_0xea8db4,_['pick'](_0x533003,_0x44f0dc));return _0xea8db4;});}function updateAgentVoiceStatus(_0x179e1a,_0xdb3596,_0xff2956){var _0x24277a=_['filter'](_0xff2956,[_0x260f('0x39'),_0xdb3596[_0x260f('0x10')]]);if(_0x24277a[_0x260f('0x3a')]===0x0)return _0x179e1a[_0x260f('0x36')]=!![];if(_[_0x260f('0x3b')](_0x24277a,[_0x260f('0x3c'),_0x179e1a['internal'][_0x260f('0x3d')]()]))return _0x179e1a[_0x260f('0x21')]=!![];if(!_0x179e1a[_0x260f('0x21')])return _0x179e1a[_0x260f('0x36')]=!![];}function getVoiceQueueAgents(_0x5c26d7,_0x5b1470,_0x44cf0d,_0x1d03f3){var _0x466773=_[_0x260f('0x37')](_0x5b1470,['id',_0x5c26d7['id']]);if(!_0x466773)return _0x5c26d7;return _0x466773[_0x260f('0x3e')]({'raw':!![]})[_0x260f('0x16')](function(_0x1d57db){for(var _0x543a31=0x0;_0x543a31<_0x1d57db['length'];_0x543a31++){var _0x44e5e4=_[_0x260f('0x37')](_0x44cf0d,['id',_0x1d57db[_0x543a31][_0x260f('0x3f')]]);if(!_0x44e5e4){_0x44e5e4={'id':_0x1d57db[_0x543a31][_0x260f('0x3f')],'name':_0x1d57db[_0x543a31][_0x260f('0x3f')],'accountcode':'','online':![]};}var _0x4493d0={'id':_0x44e5e4['id'],'name':_0x44e5e4[_0x260f('0x10')],'internal':_0x44e5e4[_0x260f('0x40')],'online':Boolean(_0x44e5e4[_0x260f('0x41')]),'paused':Boolean(_0x1d57db[_0x543a31][_0x260f('0x42')])};if(_0x44e5e4[_0x260f('0x43')]===_0x260f('0x21'))updateAgentVoiceStatus(_0x4493d0,_0x5c26d7,_0x1d03f3);if(_0x4493d0[_0x260f('0x41')])_0x5c26d7[_0x260f('0x34')]++;if(_0x4493d0[_0x260f('0x36')])_0x5c26d7[_0x260f('0x36')]++;if(_0x4493d0[_0x260f('0x42')]&&!_0x4493d0['busy']&&!_0x4493d0[_0x260f('0x21')])_0x5c26d7[_0x260f('0x42')]++;_0x5c26d7['agents'][_0x260f('0x44')](_0x4493d0);}return _0x5c26d7;});}function getQueueAgents(_0x40da6a,_0x321f0c,_0x4b5dbf){var _0x50c1b2=_0x260f('0x45')+_[_0x260f('0x17')](_0x4b5dbf)+_0x260f('0x46');var _0xfecb95=_0x4b5dbf+_0x260f('0x47');return db[_0x50c1b2]['findAll']({'where':{[_['startCase'](_0x4b5dbf)+_0x260f('0x48')]:_0x40da6a['id']},'raw':!![]})[_0x260f('0x16')](function(_0x1a001e){for(var _0x5356e8=0x0;_0x5356e8<_0x1a001e[_0x260f('0x3a')];_0x5356e8++){var _0x418409=_[_0x260f('0x37')](_0x321f0c,['id',_0x1a001e[_0x5356e8][_0x260f('0x3f')]]);if(!_0x418409){_0x418409={'id':_0x1a001e[_0x5356e8][_0x260f('0x3f')],'name':_0x1a001e[_0x5356e8][_0x260f('0x3f')],'online':![],['pauseField']:![]};}var _0x14857f={'id':_0x418409['id'],'name':_0x418409['name'],'online':Boolean(_0x418409['online']),'paused':Boolean(_0x418409[_0xfecb95])};if(_0x14857f['online'])_0x40da6a[_0x260f('0x34')]++;_0x40da6a[_0x260f('0x49')][_0x260f('0x44')](_0x14857f);}return _0x40da6a;});}function isIdle(_0x5befc0){return _0x5befc0==='idle'||_0x5befc0===_0x260f('0x4a')||_0x5befc0==='unavailable'||_0x5befc0===_0x260f('0x4b')||_[_0x260f('0x4c')](_0x5befc0);}function isAgentPaused(_0x4acf74,_0x23a266){var _0x1c5ff1=[_0x4acf74[_0x260f('0x4d')],_0x4acf74[_0x260f('0x4e')],_0x4acf74['mailPause'],_0x4acf74['openchannelPause'],_0x4acf74[_0x260f('0x4f')],_0x4acf74[_0x260f('0x50')],_0x4acf74[_0x260f('0x51')]];if(!_0x23a266)return _['every'](_0x1c5ff1);var _0x4496a5=_[_0x260f('0x52')](_0x1c5ff1);return _0x4496a5['length']>0x0&&_0x4496a5[_0x260f('0x3a')]<_0x1c5ff1[_0x260f('0x3a')]?!![]:![];}function isAgentIdle(_0x4b4673){if(_0x4b4673['voiceStatus']!=='idle'&&_0x4b4673[_0x260f('0x50')]){_0x4b4673['voiceStatus']='pause';return![];}return _[_0x260f('0x53')]([_0x4b4673[_0x260f('0x54')],_0x4b4673[_0x260f('0x55')],_0x4b4673[_0x260f('0x56')],_0x4b4673['openchannelStatus'],_0x4b4673[_0x260f('0x57')],_0x4b4673[_0x260f('0x43')],_0x4b4673[_0x260f('0x58')]],isIdle);}function getAgentStatus(_0x3e06d0){var _0x243793=_0x260f('0x4a');if(isAgentPaused(_0x3e06d0))_0x243793='pause';else if(isAgentPaused(_0x3e06d0,!![]))_0x243793='*pause';else if(isAgentIdle(_0x3e06d0))_0x243793=_0x260f('0x59');else _0x243793=_0x260f('0x36');return _0x243793;}exports['getAgents']=function(_0x3184ca,_0x21ed88){var _0x172b90={'count':0x0,'rows':[]},_0x4a31d4={},_0x15f422,_0x43e6ac,_0x4712dd=[_0x260f('0x5a'),_0x260f('0x41'),'lastLoginAt',_0x260f('0x5b'),_0x260f('0x5c'),_0x260f('0x5b'),_0x260f('0x5d'),_0x260f('0x5e'),_0x260f('0x4d'),_0x260f('0x5f'),_0x260f('0x60'),_0x260f('0x4f'),_0x260f('0x51'),_0x260f('0x4e'),'voicePause',_0x260f('0x61'),_0x260f('0x62'),'mailCapacity','smsCapacity',_0x260f('0x63'),'faxCapacity',_0x260f('0x64'),_0x260f('0x65'),_0x260f('0x66'),_0x260f('0x67'),_0x260f('0x68'),_0x260f('0x69'),_0x260f('0x54'),'openchannelStatus',_0x260f('0x56'),_0x260f('0x57'),'whatsappStatus','faxStatus',_0x260f('0x43'),'chatStatusTime',_0x260f('0x6a'),_0x260f('0x6b'),'smsStatusTime',_0x260f('0x6c'),_0x260f('0x6d'),'voiceStatusTime',_0x260f('0x39'),_0x260f('0x6e'),_0x260f('0x6f'),_0x260f('0x70'),_0x260f('0x71'),_0x260f('0x72')],_0x564bd7=[_0x260f('0x4d'),_0x260f('0x5f'),'mailPause',_0x260f('0x4f'),_0x260f('0x51'),'faxPause',_0x260f('0x50'),_0x260f('0x41')];Promise[_0x260f('0x73')]()[_0x260f('0x16')](function(){var _0x4c5d5c=_[_0x260f('0x74')](db['User'][_0x260f('0x75')],function(_0x1c4cce){return{'name':_0x1c4cce[_0x260f('0x76')],'type':_0x1c4cce[_0x260f('0x77')][_0x260f('0x78')]};});_0x3184ca[_0x260f('0x79')][_0x260f('0x7a')]=_0x260f('0x7b');_0x3184ca[_0x260f('0x79')][_0x260f('0x41')]=!![];_0x4a31d4=qs[_0x260f('0x7c')](_0x4c5d5c,_0x3184ca);_0x4a31d4[_0x260f('0x7d')]=!![];if(_0x3184ca[_0x260f('0x7e')][_0x260f('0x7a')]==='user'){var _0x4a3e5e={'params':{'id':_0x3184ca[_0x260f('0x7e')][_0x260f('0x7f')]},'query':{'section':'Agents','role':_0x260f('0x7b'),'online':!![],'nolimit':_0x3184ca['query']['nolimit'],'sort':_0x3184ca[_0x260f('0x79')][_0x260f('0x80')],'filter':_0x3184ca[_0x260f('0x79')][_0x260f('0x52')]},'raw':!![]};return db[_0x260f('0x81')][_0x260f('0x82')](_0x4a3e5e);}return db[_0x260f('0x45')][_0x260f('0x83')](_0x4a31d4);})[_0x260f('0x16')](function(_0x518980){_0x172b90[_0x260f('0x9')]=_0x518980[_0x260f('0x9')];_0x15f422=_0x518980[_0x260f('0x84')];return getRealtimeAgents();})[_0x260f('0x16')](function(_0x404e1d){_0x43e6ac=_0x404e1d[_0x260f('0x84')];return _0x15f422['map'](function(_0x26e6d4){var _0x4ea28e=_[_0x260f('0x37')](_0x43e6ac,['id',_0x26e6d4['id']]);if(_0x4ea28e)_[_0x260f('0x38')](_0x26e6d4,_[_0x260f('0x85')](_[_0x260f('0x86')](_0x4ea28e,_0x564bd7),_0x4712dd));_0x26e6d4[_0x260f('0x87')]=getAgentStatus(_0x26e6d4);return _0x26e6d4;});})[_0x260f('0x16')](function(_0x6d2f60){if(_0x3184ca[_0x260f('0x79')][_0x260f('0x88')]){var _0x2ef423=_[_0x260f('0x52')](_0x6d2f60,[_0x260f('0x87'),_0x3184ca['query']['globalStatusFilter']]);if(_0x3184ca['query'][_0x260f('0x89')]){_0x2ef423=_[_0x260f('0x52')](_0x2ef423,[_0x260f('0x5c'),_0x3184ca['query'][_0x260f('0x89')]]);}}_0x172b90[_0x260f('0x84')]=_0x2ef423||_0x6d2f60;return _0x172b90;})[_0x260f('0x16')](respondWithFilteredResult(_0x21ed88,_0x4a31d4))[_0x260f('0x1b')](handleError(_0x21ed88,null));};exports[_0x260f('0x8a')]=function(_0x509ca4,_0x580bbb){var _0x5512c8=[_0x260f('0x8b'),_0x260f('0x8c'),_0x260f('0x8d'),_0x260f('0x8e'),_0x260f('0x8f'),_0x260f('0x90'),'voice'];var _0x14f4bf={'count':0x0,'rows':[]},_0x572cf2={},_0x28700b,_0x4d7b9b,_0x31d09d,_0x5a7848,_0x3b79b8;Promise[_0x260f('0x73')]()[_0x260f('0x16')](function(){if(_0x509ca4['query'][_0x260f('0x91')]){if(!_[_0x260f('0x92')](_0x5512c8,_0x509ca4['query'][_0x260f('0x91')][_0x260f('0x93')]()))throw new Error(_0x260f('0x94'));_0x28700b=_0x509ca4[_0x260f('0x79')][_0x260f('0x91')][_0x260f('0x93')]();}var _0x4e5260=_[_0x260f('0x17')](_0x28700b)+'Queue';var _0x253bfb=_[_0x260f('0x74')](db[_0x4e5260][_0x260f('0x75')],function(_0x23dadc){return{'name':_0x23dadc['fieldName'],'type':_0x23dadc[_0x260f('0x77')][_0x260f('0x78')]};});_0x572cf2=qs['getOptions'](_0x253bfb,_0x509ca4);if(_0x509ca4[_0x260f('0x7e')][_0x260f('0x7a')]===_0x260f('0x7e')){var _0x5d6227={'params':{'id':_0x509ca4[_0x260f('0x7e')][_0x260f('0x7f')]},'query':{'section':_0x28700b===_0x260f('0x35')&&_0x509ca4[_0x260f('0x79')][_0x260f('0x77')]==='outbound'?_0x260f('0x95'):_[_0x260f('0x17')](_0x28700b)+_0x260f('0x18'),'type':_0x509ca4[_0x260f('0x79')][_0x260f('0x77')],'nolimit':!![],'sort':_0x260f('0x10'),'filter':_0x509ca4[_0x260f('0x79')][_0x260f('0x52')]}};return db['UserProfile'][_0x260f('0x82')](_0x5d6227);}return db[_0x4e5260][_0x260f('0x83')](_0x572cf2);})['then'](function(_0x27b29f){_0x14f4bf[_0x260f('0x9')]=_0x27b29f[_0x260f('0x9')];_0x4d7b9b=_0x27b29f[_0x260f('0x84')];return getRealtimeQueues(_0x509ca4,_0x28700b);})[_0x260f('0x16')](function(_0x716092){_0x5a7848=_0x716092[_0x260f('0x84')];return getRealtimeAgents();})[_0x260f('0x16')](function(_0x42460a){_0x31d09d=_0x42460a['rows'];if(_0x28700b!=_0x260f('0x35'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x5bc9b4){_0x3b79b8=_0x5bc9b4?_0x5bc9b4[_0x260f('0x84')]:[];return initializeQueues(_0x4d7b9b,_0x5a7848,_0x28700b,_0x509ca4[_0x260f('0x79')]['type']);})['then'](function(_0x153765){var _0x5318ae=_0x153765['map'](function(_0x20b26a){if(_0x28700b===_0x260f('0x35'))return getVoiceQueueAgents(_0x20b26a,_0x4d7b9b,_0x31d09d,_0x3b79b8);else return getQueueAgents(_0x20b26a,_0x31d09d,_0x28700b);});return Promise['all'](_0x5318ae);})['then'](function(_0x39eac4){_0x14f4bf[_0x260f('0x84')]=_0x39eac4;return _0x14f4bf;})[_0x260f('0x16')](respondWithFilteredResult(_0x580bbb,_0x572cf2))[_0x260f('0x1b')](handleError(_0x580bbb,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index d60a460..39b152a 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2f40b0,_0x40122e){var _0x5bc71b=function(_0xcb1864){while(--_0xcb1864){_0x2f40b0['push'](_0x2f40b0['shift']());}};_0x5bc71b(++_0x40122e);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 122f143..8a6d00e 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 _0x66da=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x27fe39,_0x4ea969){var _0x4d5ed0=function(_0x46df11){while(--_0x46df11){_0x27fe39['push'](_0x27fe39['shift']());}};_0x4d5ed0(++_0x4ea969);}(_0x66da,0x16f));var _0xa66d=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x66da[_0x31bab3];return _0x4fd382;};'use strict';var Sequelize=require(_0xa66d('0x0'));module[_0xa66d('0x1')]={'state':{'type':Sequelize[_0xa66d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa66d('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa66d('0x4')]},'ringtime':{'type':Sequelize[_0xa66d('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa66d('0x3')]},'campaigntype':{'type':Sequelize[_0xa66d('0x3')]},'membername':{'type':Sequelize[_0xa66d('0x3')]}}; \ No newline at end of file +var _0x0686=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x1869a0,_0x5c7015){var _0x10a44c=function(_0x20d6c9){while(--_0x20d6c9){_0x1869a0['push'](_0x1869a0['shift']());}};_0x10a44c(++_0x5c7015);}(_0x0686,0x123));var _0x6068=function(_0x1fe41e,_0x4c9459){_0x1fe41e=_0x1fe41e-0x0;var _0x478e5a=_0x0686[_0x1fe41e];return _0x478e5a;};'use strict';var Sequelize=require(_0x6068('0x0'));module[_0x6068('0x1')]={'state':{'type':Sequelize[_0x6068('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6068('0x3')]},'scheduledat':{'type':Sequelize[_0x6068('0x4')]},'uniqueid':{'type':Sequelize[_0x6068('0x3')]},'starttime':{'type':Sequelize[_0x6068('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6068('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6068('0x3')]},'campaigntype':{'type':Sequelize[_0x6068('0x3')]},'membername':{'type':Sequelize[_0x6068('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 6c360fd..6559c3f 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 _0x1484=['../../config/environment','./reportAgentPreview.attributes','exports','define','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x37bd96,_0x4a6212){var _0x5dc6f8=function(_0x56ff80){while(--_0x56ff80){_0x37bd96['push'](_0x37bd96['shift']());}};_0x5dc6f8(++_0x4a6212);}(_0x1484,0x1e4));var _0x4148=function(_0x1c7b33,_0x381cc5){_0x1c7b33=_0x1c7b33-0x0;var _0x154be0=_0x1484[_0x1c7b33];return _0x154be0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4148('0x0'));var moment=require(_0x4148('0x1'));var BPromise=require(_0x4148('0x2'));var rp=require(_0x4148('0x3'));var fs=require('fs');var path=require(_0x4148('0x4'));var rimraf=require(_0x4148('0x5'));var config=require(_0x4148('0x6'));var attributes=require(_0x4148('0x7'));module[_0x4148('0x8')]=function(_0x19bc9e,_0x284e2d){return _0x19bc9e[_0x4148('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe89b=['path','rimraf','exports','define','ReportAgentPreview','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3b7f66,_0x521211){var _0x55ff98=function(_0x1dc880){while(--_0x1dc880){_0x3b7f66['push'](_0x3b7f66['shift']());}};_0x55ff98(++_0x521211);}(_0xe89b,0x12e));var _0xbe89=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe89b[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xbe89('0x0'));var util=require(_0xbe89('0x1'));var logger=require('../../config/logger')(_0xbe89('0x2'));var moment=require(_0xbe89('0x3'));var BPromise=require(_0xbe89('0x4'));var rp=require(_0xbe89('0x5'));var fs=require('fs');var path=require(_0xbe89('0x6'));var rimraf=require(_0xbe89('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xbe89('0x8')]=function(_0x10aaa3,_0x2ac328){return _0x10aaa3[_0xbe89('0x9')](_0xbe89('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 1a0ccb5..78b5304 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 _0xe994=['randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateReportAgentPreview','options','raw','util'];(function(_0x38786d,_0x39d47e){var _0x5053fc=function(_0x1a30df){while(--_0x1a30df){_0x38786d['push'](_0x38786d['shift']());}};_0x5053fc(++_0x39d47e);}(_0xe994,0xe6));var _0x4e99=function(_0x1e7bdd,_0x216b81){_0x1e7bdd=_0x1e7bdd-0x0;var _0xcd343d=_0xe994[_0x1e7bdd];return _0xcd343d;};'use strict';var _=require('lodash');var util=require(_0x4e99('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e99('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e99('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e99('0x3'));var config=require(_0x4e99('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4e99('0x5')][_0x4e99('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52917d,_0x47ee6b,_0x11d391){return new BPromise(function(_0x50b283,_0x3fa1ee){return client[_0x4e99('0x7')](_0x52917d,_0x11d391)[_0x4e99('0x8')](function(_0x4804c2){logger[_0x4e99('0x9')](_0x4e99('0xa'),_0x47ee6b,_0x4e99('0xb'));logger[_0x4e99('0xc')](_0x4e99('0xd'),_0x47ee6b,_0x4e99('0xb'),JSON[_0x4e99('0xe')](_0x4804c2));if(_0x4804c2[_0x4e99('0xf')]){if(_0x4804c2[_0x4e99('0xf')]['code']===0x1f4){logger[_0x4e99('0xf')](_0x4e99('0xa'),_0x47ee6b,_0x4804c2[_0x4e99('0xf')][_0x4e99('0x10')]);return _0x3fa1ee(_0x4804c2[_0x4e99('0xf')][_0x4e99('0x10')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x47ee6b,_0x4804c2[_0x4e99('0xf')][_0x4e99('0x10')]);return _0x50b283(_0x4804c2['error'][_0x4e99('0x10')]);}else{logger[_0x4e99('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x47ee6b,_0x4e99('0xb'));_0x50b283(_0x4804c2['result'][_0x4e99('0x10')]);}})[_0x4e99('0x11')](function(_0x1bda33){logger[_0x4e99('0xf')](_0x4e99('0xa'),_0x47ee6b,_0x1bda33);_0x3fa1ee(_0x1bda33);});});}exports[_0x4e99('0x12')]=function(_0x2d3046){var _0x33366c=this;return new Promise(function(_0x67cec8,_0x259ac9){return db['ReportAgentPreview']['create'](_0x2d3046['body'],{'raw':_0x2d3046[_0x4e99('0x13')]?_0x2d3046[_0x4e99('0x13')][_0x4e99('0x14')]===undefined?!![]:![]:!![]})[_0x4e99('0x8')](function(_0x4ed23d){logger[_0x4e99('0x9')](_0x4e99('0x12'),_0x2d3046);logger[_0x4e99('0xc')]('CreateReportAgentPreview',_0x2d3046,JSON[_0x4e99('0xe')](_0x4ed23d));_0x67cec8(_0x4ed23d);})[_0x4e99('0x11')](function(_0x1c6ed8){logger[_0x4e99('0xf')](_0x4e99('0x12'),_0x1c6ed8[_0x4e99('0x10')],_0x2d3046);_0x259ac9(_0x33366c[_0x4e99('0xf')](0x1f4,_0x1c6ed8[_0x4e99('0x10')]));});});}; \ No newline at end of file +var _0x8df8=['jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateReportAgentPreview','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8df8,0x18d));var _0x88df=function(_0x439c9b,_0x523f09){_0x439c9b=_0x439c9b-0x0;var _0x30f989=_0x8df8[_0x439c9b];return _0x30f989;};'use strict';var _=require(_0x88df('0x0'));var util=require(_0x88df('0x1'));var moment=require(_0x88df('0x2'));var BPromise=require(_0x88df('0x3'));var rs=require(_0x88df('0x4'));var fs=require('fs');var Redis=require(_0x88df('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x88df('0x6'));var logger=require(_0x88df('0x7'))(_0x88df('0x8'));var config=require('../../config/environment');var jayson=require(_0x88df('0x9'));var client=jayson[_0x88df('0xa')][_0x88df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b40b7,_0x4a43f9,_0x41e35f){return new BPromise(function(_0x51502c,_0x5ac8a5){return client[_0x88df('0xc')](_0x5b40b7,_0x41e35f)[_0x88df('0xd')](function(_0x5c939a){logger['info'](_0x88df('0xe'),_0x4a43f9,_0x88df('0xf'));logger[_0x88df('0x10')](_0x88df('0x11'),_0x4a43f9,_0x88df('0xf'),JSON['stringify'](_0x5c939a));if(_0x5c939a[_0x88df('0x12')]){if(_0x5c939a[_0x88df('0x12')][_0x88df('0x13')]===0x1f4){logger[_0x88df('0x12')](_0x88df('0xe'),_0x4a43f9,_0x5c939a[_0x88df('0x12')][_0x88df('0x14')]);return _0x5ac8a5(_0x5c939a['error']['message']);}logger['error'](_0x88df('0xe'),_0x4a43f9,_0x5c939a['error']['message']);return _0x51502c(_0x5c939a[_0x88df('0x12')][_0x88df('0x14')]);}else{logger[_0x88df('0x15')](_0x88df('0xe'),_0x4a43f9,'request\x20sent');_0x51502c(_0x5c939a[_0x88df('0x16')][_0x88df('0x14')]);}})['catch'](function(_0x7b38d4){logger[_0x88df('0x12')](_0x88df('0xe'),_0x4a43f9,_0x7b38d4);_0x5ac8a5(_0x7b38d4);});});}exports[_0x88df('0x17')]=function(_0x4c25ed){var _0x3f751f=this;return new Promise(function(_0x5f3c05,_0xb2eae5){return db['ReportAgentPreview'][_0x88df('0x18')](_0x4c25ed[_0x88df('0x19')],{'raw':_0x4c25ed[_0x88df('0x1a')]?_0x4c25ed['options'][_0x88df('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42f6ba){logger['info'](_0x88df('0x17'),_0x4c25ed);logger[_0x88df('0x10')]('CreateReportAgentPreview',_0x4c25ed,JSON['stringify'](_0x42f6ba));_0x5f3c05(_0x42f6ba);})[_0x88df('0x1c')](function(_0x3ad994){logger[_0x88df('0x12')](_0x88df('0x17'),_0x3ad994[_0x88df('0x14')],_0x4c25ed);_0xb2eae5(_0x3f751f[_0x88df('0x12')](0x1f4,_0x3ad994[_0x88df('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 33ac27f..4dad29a 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 _0xff9a=['/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/accounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','chat','showChatQueues','post','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues'];(function(_0x18d9dc,_0x5e5027){var _0x23c022=function(_0x1672d8){while(--_0x1672d8){_0x18d9dc['push'](_0x18d9dc['shift']());}};_0x23c022(++_0x5e5027);}(_0xff9a,0xf6));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var path=require(_0xaff9('0x2'));var express=require(_0xaff9('0x3'));var router=express[_0xaff9('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xaff9('0x5'));router[_0xaff9('0x6')](_0xaff9('0x7'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xaff9('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xaff9('0x8')](),controller[_0xaff9('0x9')]);router[_0xaff9('0x6')](_0xaff9('0xa'),auth[_0xaff9('0x8')](),controller[_0xaff9('0xb')]);router['get'](_0xaff9('0xc'),auth[_0xaff9('0x8')](),controller['voiceQueues']);router['get'](_0xaff9('0xd'),auth[_0xaff9('0x8')](),controller['chatQueues']);router[_0xaff9('0x6')]('/mail/queues',auth[_0xaff9('0x8')](),controller['mailQueues']);router[_0xaff9('0x6')](_0xaff9('0xe'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0xaff9('0x6')]('/openchannel/queues',auth[_0xaff9('0x8')](),controller['openchannelQueues']);router[_0xaff9('0x6')](_0xaff9('0xf'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x10')]);router[_0xaff9('0x6')](_0xaff9('0x11'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x12')]);router['get']('/fax/queues',auth[_0xaff9('0x8')](),controller['faxQueues']);router['get'](_0xaff9('0x13'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x14')]);router['get'](_0xaff9('0x15'),auth[_0xaff9('0x8')](),controller['voiceQueuesChannels']);router[_0xaff9('0x6')](_0xaff9('0x16'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x17')]);router[_0xaff9('0x6')](_0xaff9('0x18'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x19')]);router[_0xaff9('0x6')](_0xaff9('0x1a'),auth['isAuthenticated'](),controller[_0xaff9('0x1b')]);router[_0xaff9('0x6')](_0xaff9('0x1c'),auth['isAuthenticated'](),controller[_0xaff9('0x1d')]);router[_0xaff9('0x1e')](_0xaff9('0x1c'),auth['isAuthenticated'](),controller[_0xaff9('0x1f')]);router[_0xaff9('0x6')](_0xaff9('0x20'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x21')]);router[_0xaff9('0x6')](_0xaff9('0x22'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x23')]);router['get'](_0xaff9('0x24'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x25')]);router[_0xaff9('0x1e')](_0xaff9('0x26'),auth['isAuthenticated'](),controller[_0xaff9('0x27')]);router[_0xaff9('0x6')](_0xaff9('0x28'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x29')]);router[_0xaff9('0x6')](_0xaff9('0x2a'),auth['isAuthenticated'](),controller[_0xaff9('0x2b')]);router[_0xaff9('0x6')](_0xaff9('0x2c'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x2d')]);router['get'](_0xaff9('0x2e'),auth['isAuthenticated'](),controller[_0xaff9('0x2f')]);router[_0xaff9('0x6')]('/chat/queues/waitinginteractions',auth[_0xaff9('0x8')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0xaff9('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0xaff9('0x6')](_0xaff9('0x30'),auth['isAuthenticated'](),controller[_0xaff9('0x31')]);router[_0xaff9('0x6')](_0xaff9('0x32'),auth['isAuthenticated'](),controller[_0xaff9('0x33')]);router['get'](_0xaff9('0x34'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x35')]);router[_0xaff9('0x6')](_0xaff9('0x36'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x37')]);router['get'](_0xaff9('0x38'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x39')]);router['post'](_0xaff9('0x3a'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x3b')](_0xaff9('0x3c')));router[_0xaff9('0x6')]('/mail/queues/:id',auth[_0xaff9('0x8')](),controller['showMailQueues']);router['post'](_0xaff9('0x3d'),auth[_0xaff9('0x8')](),controller['queueNotify'](_0xaff9('0x3e')));router[_0xaff9('0x6')]('/chat/queues/:id',auth[_0xaff9('0x8')](),controller[_0xaff9('0x3f')]);router[_0xaff9('0x40')](_0xaff9('0x41'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x3b')](_0xaff9('0x42')));router['get'](_0xaff9('0x43'),auth[_0xaff9('0x8')](),controller['showFaxQueues']);router['post'](_0xaff9('0x44'),auth['isAuthenticated'](),controller[_0xaff9('0x3b')](_0xaff9('0x45')));router[_0xaff9('0x6')](_0xaff9('0x46'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x47')]);router[_0xaff9('0x40')]('/sms/queues/:id/notify',auth[_0xaff9('0x8')](),controller[_0xaff9('0x3b')](_0xaff9('0x48')));router[_0xaff9('0x40')](_0xaff9('0x49'),auth['isAuthenticated'](),controller['queueNotify'](_0xaff9('0x4a')));router[_0xaff9('0x6')](_0xaff9('0x4b'),auth[_0xaff9('0x8')](),controller['showSmsQueues']);router[_0xaff9('0x6')](_0xaff9('0x4c'),auth[_0xaff9('0x8')](),controller[_0xaff9('0x4d')]);router[_0xaff9('0x40')](_0xaff9('0x4e'),auth['isAuthenticated'](),controller[_0xaff9('0x4f')]);module[_0xaff9('0x50')]=router; \ No newline at end of file +var _0xff33=['outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','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/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xff33,0x17a));var _0x3ff3=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0xff33[_0x5c1345];return _0x1c070d;};'use strict';var multer=require('multer');var util=require(_0x3ff3('0x0'));var path=require(_0x3ff3('0x1'));var express=require(_0x3ff3('0x2'));var router=express['Router']();var auth=require(_0x3ff3('0x3'));var controller=require(_0x3ff3('0x4'));router[_0x3ff3('0x5')](_0x3ff3('0x6'),auth['isAuthenticated'](),controller[_0x3ff3('0x7')]);router[_0x3ff3('0x5')](_0x3ff3('0x8'),auth[_0x3ff3('0x9')](),controller['voiceChannelMixMonitor']);router['get'](_0x3ff3('0xa'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0xb')]);router[_0x3ff3('0x5')](_0x3ff3('0xc'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0xd')]);router['get'](_0x3ff3('0xe'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0xf')]);router[_0x3ff3('0x5')](_0x3ff3('0x10'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x3ff3('0x5')]('/mail/accounts',auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x11')]);router[_0x3ff3('0x5')](_0x3ff3('0x12'),auth['isAuthenticated'](),controller[_0x3ff3('0x13')]);router[_0x3ff3('0x5')](_0x3ff3('0x14'),auth['isAuthenticated'](),controller[_0x3ff3('0x15')]);router[_0x3ff3('0x5')](_0x3ff3('0x16'),auth['isAuthenticated'](),controller[_0x3ff3('0x17')]);router[_0x3ff3('0x5')](_0x3ff3('0x18'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x19')]);router[_0x3ff3('0x5')](_0x3ff3('0x1a'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x1b')]);router[_0x3ff3('0x5')](_0x3ff3('0x1c'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x1d')]);router[_0x3ff3('0x5')](_0x3ff3('0x1e'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x1f')]);router[_0x3ff3('0x5')](_0x3ff3('0x20'),auth[_0x3ff3('0x9')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0x3ff3('0x21')]);router['get'](_0x3ff3('0x22'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x23')]);router[_0x3ff3('0x24')](_0x3ff3('0x22'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get']('/outbound',auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x25')]);router['get'](_0x3ff3('0x26'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x27')]);router[_0x3ff3('0x5')](_0x3ff3('0x28'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x29')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x3ff3('0x2a')]);router['get'](_0x3ff3('0x2b'),auth['isAuthenticated'](),controller[_0x3ff3('0x2c')]);router[_0x3ff3('0x5')](_0x3ff3('0x2d'),auth[_0x3ff3('0x9')](),controller['trunks']);router['get'](_0x3ff3('0x2e'),auth['isAuthenticated'](),controller[_0x3ff3('0x2f')]);router[_0x3ff3('0x5')](_0x3ff3('0x30'),auth['isAuthenticated'](),controller[_0x3ff3('0x31')]);router[_0x3ff3('0x5')](_0x3ff3('0x32'),auth[_0x3ff3('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0x3ff3('0x5')](_0x3ff3('0x33'),auth[_0x3ff3('0x9')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x3ff3('0x34'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x35')]);router['get'](_0x3ff3('0x36'),auth['isAuthenticated'](),controller[_0x3ff3('0x37')]);router[_0x3ff3('0x5')](_0x3ff3('0x38'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x39')]);router[_0x3ff3('0x5')](_0x3ff3('0x3a'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x3ff3('0x5')](_0x3ff3('0x3b'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x3c')]);router['post'](_0x3ff3('0x3d'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x3e')](_0x3ff3('0x3f')));router[_0x3ff3('0x5')](_0x3ff3('0x40'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x41')]);router[_0x3ff3('0x42')](_0x3ff3('0x43'),auth['isAuthenticated'](),controller[_0x3ff3('0x3e')](_0x3ff3('0x44')));router[_0x3ff3('0x5')](_0x3ff3('0x45'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x46')]);router[_0x3ff3('0x42')](_0x3ff3('0x47'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x3e')]('fax'));router[_0x3ff3('0x5')](_0x3ff3('0x48'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x49')]);router[_0x3ff3('0x42')](_0x3ff3('0x4a'),auth['isAuthenticated'](),controller[_0x3ff3('0x3e')](_0x3ff3('0x4b')));router[_0x3ff3('0x5')](_0x3ff3('0x4c'),auth[_0x3ff3('0x9')](),controller['showOpenchannelQueues']);router[_0x3ff3('0x42')]('/sms/queues/:id/notify',auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x3e')]('sms'));router[_0x3ff3('0x42')](_0x3ff3('0x4d'),auth['isAuthenticated'](),controller[_0x3ff3('0x3e')]('whatsapp'));router[_0x3ff3('0x5')](_0x3ff3('0x4e'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x4f')]);router[_0x3ff3('0x5')](_0x3ff3('0x50'),auth[_0x3ff3('0x9')](),controller['showWhatsappQueues']);router['post'](_0x3ff3('0x51'),auth[_0x3ff3('0x9')](),controller[_0x3ff3('0x52')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 8b29a51..ceaa637 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 _0x98a8=['openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','messageId','From','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','result','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions'];(function(_0x3f3d5e,_0x3e258c){var _0x179dbd=function(_0x44410c){while(--_0x44410c){_0x3f3d5e['push'](_0x3f3d5e['shift']());}};_0x179dbd(++_0x3e258c);}(_0x98a8,0x12c));var _0x898a=function(_0x3023fd,_0x3a30df){_0x3023fd=_0x3023fd-0x0;var _0x21c7f3=_0x98a8[_0x3023fd];return _0x21c7f3;};'use strict';var BPromise=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var _=require(_0x898a('0x2'));var util=require(_0x898a('0x3'));var db=require(_0x898a('0x4'))['db'];var logger=require(_0x898a('0x5'))(_0x898a('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232a});var mailClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232b});var routingClient=jayson[_0x898a('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){var _0x283c5=_0xfa8c50?_0xfa8c50:amiClient;return _0x283c5[_0x898a('0x9')](_0x3aadc2,_0x564583)[_0x898a('0xa')](function(_0x3150df){if(_0x3150df[_0x898a('0xb')]){if(_0x3150df[_0x898a('0xb')][_0x898a('0xc')]===0x1f4){return _0x42021d(_0x3150df[_0x898a('0xb')]['message']);}return _0x4fbce5(_0x3150df[_0x898a('0xb')]['message']);}else{_0x4fbce5(_0x3150df[_0x898a('0xd')]);}})['catch'](function(_0x25d7f2){_0x42021d(_0x25d7f2);});});}function respondWithResult(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xc8;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['status'](_0x364a23)['json'](_0x5f5e06);}return _0x2c76b7[_0x898a('0xe')](0x194);};}function handleError(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0x1f4;return function(_0x116fbe){logger[_0x898a('0xb')](_0x116fbe[_0x898a('0xf')]);if(_0x116fbe['name']){delete _0x116fbe[_0x898a('0x10')];}_0x1f5be4['status'](_0xb24335)[_0x898a('0x11')](_0x116fbe);};}function findById(_0x5c96a6){return function(_0x303321){if(!_['isNil'](_0x5c96a6)&&!_[_0x898a('0x12')](_0x303321)&&!_['isNil'](_0x303321[_0x898a('0x13')])){return _[_0x898a('0x14')](_0x303321[_0x898a('0x13')],function(_0x4ddd4d){return _0x4ddd4d['id']==_0x5c96a6;});}return null;};}exports[_0x898a('0x15')]=function(_0x5960e0,_0x54c8f3){return respondWithRpcPromise(_0x898a('0x16'),_0x5960e0[_0x898a('0x17')])['then'](respondWithResult(_0x54c8f3,null))['catch'](handleError(_0x54c8f3,null));};exports[_0x898a('0x18')]=function(_0x26449a,_0x38a8f0){return respondWithRpcPromise(_0x898a('0x19'),_[_0x898a('0x1a')](_0x26449a[_0x898a('0x17')],_0x26449a[_0x898a('0x1b')]))['then'](respondWithResult(_0x38a8f0,null))[_0x898a('0x1c')](handleError(_0x38a8f0,null));};exports[_0x898a('0x1d')]=function(_0x11cae2,_0x3cfd9c){return respondWithRpcPromise(_0x898a('0x1e'),_[_0x898a('0x1a')](_0x11cae2['query'],_0x11cae2[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x3cfd9c,null))[_0x898a('0x1c')](handleError(_0x3cfd9c,null));};exports[_0x898a('0x1f')]=function(_0x3901ab,_0x1426e3){return respondWithRpcPromise('VoiceQueues',_0x3901ab[_0x898a('0x17')])['then'](respondWithResult(_0x1426e3,null))['catch'](handleError(_0x1426e3,null));};exports['showVoiceQueues']=function(_0x3678be,_0x1f4d86){return respondWithRpcPromise(_0x898a('0x20'),_0x3678be[_0x898a('0x17')])[_0x898a('0xa')](findById(_0x3678be[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x1f4d86,null))[_0x898a('0x1c')](handleError(_0x1f4d86,null));};exports[_0x898a('0x21')]=function(_0x58149d,_0x4b3e68){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x898a('0x1a')](_0x58149d[_0x898a('0x22')],_0x58149d[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4b3e68,null))[_0x898a('0x1c')](handleError(_0x4b3e68,null));};exports[_0x898a('0x23')]=function(_0xe3c983,_0xf74645){return respondWithRpcPromise(_0x898a('0x24'),_[_0x898a('0x1a')](_0xe3c983[_0x898a('0x17')],_0xe3c983[_0x898a('0x1b')]))['then'](respondWithResult(_0xf74645,null))[_0x898a('0x1c')](handleError(_0xf74645,null));};exports[_0x898a('0x25')]=function(_0x26eead,_0x17a980){return respondWithRpcPromise(_0x898a('0x26'),_0x26eead['query'])['then'](respondWithResult(_0x17a980,null))[_0x898a('0x1c')](handleError(_0x17a980,null));};exports[_0x898a('0x27')]=function(_0x1d6d66,_0x4de9bf){return respondWithRpcPromise(_0x898a('0x28'),_[_0x898a('0x1a')](_0x1d6d66[_0x898a('0x17')],_0x1d6d66[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4de9bf,null))[_0x898a('0x1c')](handleError(_0x4de9bf,null));};exports[_0x898a('0x29')]=function(_0x146f32,_0x50bb4b){return respondWithRpcPromise(_0x898a('0x2a'),_['merge'](_0x146f32['query'],_0x146f32[_0x898a('0x1b')]))['then'](respondWithResult(_0x50bb4b,null))[_0x898a('0x1c')](handleError(_0x50bb4b,null));};exports['voiceQueuesChannelRedirect']=function(_0x37cb11,_0x4f202c){return respondWithRpcPromise(_0x898a('0x2b'),_[_0x898a('0x1a')](_0x37cb11[_0x898a('0x17')],_0x37cb11['params']))['then'](respondWithResult(_0x4f202c,null))['catch'](handleError(_0x4f202c,null));};exports[_0x898a('0x2c')]=function(_0x429c32,_0x5a228f){return respondWithRpcPromise(_0x898a('0x2d'),_0x429c32[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x5a228f,null))[_0x898a('0x1c')](handleError(_0x5a228f,null));};exports['outboundChannels']=function(_0x4b07bc,_0x3aed01){return respondWithRpcPromise(_0x898a('0x2e'),_0x4b07bc['query'])['then'](respondWithResult(_0x3aed01,null))[_0x898a('0x1c')](handleError(_0x3aed01,null));};exports[_0x898a('0x2f')]=function(_0x181cc8,_0xa45405){var _0x51681f;return respondWithRpcPromise(_0x898a('0x30'),_0x181cc8[_0x898a('0x17')])['then'](function(_0x516b8c){_0x51681f=_0x516b8c;return respondWithRpcPromise('Agents',_0x181cc8[_0x898a('0x17')],routingClient);})[_0x898a('0xa')](function(_0x35d767){return _[_0x898a('0x1a')]({},_0x35d767,_0x51681f);})[_0x898a('0xa')](respondWithResult(_0xa45405,null))[_0x898a('0x1c')](handleError(_0xa45405,null));};exports[_0x898a('0x31')]=function(_0x1432ec,_0x3292c2){if(_0x1432ec[_0x898a('0x22')]&&_0x1432ec[_0x898a('0x22')][_0x898a('0x32')]&&_0x1432ec[_0x898a('0x33')]&&_0x1432ec[_0x898a('0x33')][_0x898a('0x10')]){for(var _0x4c8628 in _0x1432ec[_0x898a('0x22')][_0x898a('0x32')]){if(_0x1432ec[_0x898a('0x22')]['interaction'][_0x898a('0x34')](_0x4c8628)){db[_0x898a('0x35')][_0x898a('0x36')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')][_0x898a('0x10')],'type':_0x898a('0x37'),'exitAt':null,'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]&&_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')]?{'$notIn':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]}:{'$ne':null}}})['then'](function(_0x3d5fba){var _0x152060=moment()['format'](_0x898a('0x39'));for(var _0x4ce00e=0x0,_0x56a40c=_0x3d5fba['length'];_0x4ce00e<_0x56a40c;_0x4ce00e+=0x1){_0x3d5fba[_0x4ce00e]['updateAttributes']({'exitAt':_0x152060});}});for(var _0x322ecc=0x0;_0x322ecc<_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')];_0x322ecc+=0x1){db['MemberReport'][_0x898a('0x3a')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'type':_0x898a('0x37'),'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628][_0x322ecc],'exitAt':null},'defaults':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'interface':_[_0x898a('0x12')](_0x1432ec[_0x898a('0x33')]['interface'])?util[_0x898a('0x3b')](_0x898a('0x3c'),_0x1432ec['user'][_0x898a('0x10')]):_0x1432ec['user'][_0x898a('0x3d')],'type':_0x898a('0x37'),'enterAt':moment()[_0x898a('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x898a('0x3e'),'internal':_0x1432ec[_0x898a('0x33')][_0x898a('0x3f')],'uniqueid':_0x1432ec[_0x898a('0x22')]['interaction'][_0x4c8628][_0x322ecc]}});}}}}return respondWithRpcPromise(_0x898a('0x40'),{'id':_0x1432ec['params']['id'],'capacity':_0x1432ec[_0x898a('0x22')][_0x898a('0x41')]},routingClient)[_0x898a('0xa')](respondWithResult(_0x3292c2,null))['catch'](handleError(_0x3292c2,null));};exports[_0x898a('0x42')]=function(_0x3c4db0,_0x195ac2){return respondWithRpcPromise('Telephones',_0x3c4db0['query'])[_0x898a('0xa')](respondWithResult(_0x195ac2,null))[_0x898a('0x1c')](handleError(_0x195ac2,null));};exports[_0x898a('0x43')]=function(_0x295f1e,_0x28b8c9){return respondWithRpcPromise(_0x898a('0x44'),_0x295f1e[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x28b8c9,null))[_0x898a('0x1c')](handleError(_0x28b8c9,null));};exports[_0x898a('0x45')]=function(_0x2382a9,_0x5e9329){return respondWithRpcPromise(_0x898a('0x46'),_0x2382a9[_0x898a('0x17')])['then'](respondWithResult(_0x5e9329,null))[_0x898a('0x1c')](handleError(_0x5e9329,null));};exports['chatQueues']=function(_0x54c44b,_0x15f11e){return respondWithRpcPromise(_0x898a('0x47'),_0x54c44b[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x15f11e,null))['catch'](handleError(_0x15f11e,null));};exports[_0x898a('0x48')]=function(_0x1f5e4b,_0x515725){return respondWithRpcPromise(_0x898a('0x47'),_0x1f5e4b[_0x898a('0x17')],routingClient)['then'](findById(_0x1f5e4b[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x515725,null))[_0x898a('0x1c')](handleError(_0x515725,null));};exports['mailQueues']=function(_0xf29714,_0x2ef2f1){return respondWithRpcPromise(_0x898a('0x49'),_0xf29714[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2ef2f1,null))[_0x898a('0x1c')](handleError(_0x2ef2f1,null));};exports['showMailQueues']=function(_0x22a08a,_0x4df5f0){return respondWithRpcPromise(_0x898a('0x49'),_0x22a08a[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x22a08a[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x4df5f0,null))[_0x898a('0x1c')](handleError(_0x4df5f0,null));};exports[_0x898a('0x4a')]=function(_0x75ff57,_0x3c761c){return respondWithRpcPromise('MailAccounts',_0x75ff57[_0x898a('0x17')],mailClient)[_0x898a('0xa')](respondWithResult(_0x3c761c,null))[_0x898a('0x1c')](handleError(_0x3c761c,null));};exports[_0x898a('0x4b')]=function(_0x219976,_0x2a1345){return respondWithRpcPromise(_0x898a('0x4c'),_0x219976[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2a1345,null))[_0x898a('0x1c')](handleError(_0x2a1345,null));};exports[_0x898a('0x4d')]=function(_0x217dda,_0x3331c0){return respondWithRpcPromise(_0x898a('0x4c'),_0x217dda[_0x898a('0x17')],routingClient)['then'](findById(_0x217dda[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x3331c0,null))['catch'](handleError(_0x3331c0,null));};exports[_0x898a('0x4e')]=function(_0x4583a1,_0x5f0944){return respondWithRpcPromise(_0x898a('0x4f'),_0x4583a1[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5f0944,null))[_0x898a('0x1c')](handleError(_0x5f0944,null));};exports['showSmsQueues']=function(_0xdc0cc4,_0x11def5){return respondWithRpcPromise(_0x898a('0x4f'),_0xdc0cc4[_0x898a('0x17')],routingClient)['then'](findById(_0xdc0cc4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x11def5,null))['catch'](handleError(_0x11def5,null));};exports[_0x898a('0x50')]=function(_0x3c0bf6,_0x5b7019){return respondWithRpcPromise(_0x898a('0x51'),_0x3c0bf6['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5b7019,null))['catch'](handleError(_0x5b7019,null));};exports['showWhatsappQueues']=function(_0x5ed35e,_0xfdd6d8){return respondWithRpcPromise(_0x898a('0x51'),_0x5ed35e[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x5ed35e['params']['id']))['then'](respondWithResult(_0xfdd6d8,null))[_0x898a('0x1c')](handleError(_0xfdd6d8,null));};exports[_0x898a('0x52')]=function(_0x1c2661,_0x5dc44e){return respondWithRpcPromise(_0x898a('0x53'),_0x1c2661[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5dc44e,null))[_0x898a('0x1c')](handleError(_0x5dc44e,null));};exports['showFaxQueues']=function(_0xaac6d4,_0x43bf93){return respondWithRpcPromise('FaxQueues',_0xaac6d4[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0xaac6d4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x43bf93,null))[_0x898a('0x1c')](handleError(_0x43bf93,null));};exports[_0x898a('0x54')]=function(_0x3bcc3d,_0x2dc61c){return respondWithRpcPromise(_0x898a('0x55'),_0x3bcc3d[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x2dc61c,null))[_0x898a('0x1c')](handleError(_0x2dc61c,null));};exports[_0x898a('0x56')]=function(_0x4a7705,_0x2d9a9c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4a7705[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2d9a9c,null))[_0x898a('0x1c')](handleError(_0x2d9a9c,null));};exports['mailQueuesWaitingInteractions']=function(_0x31102d,_0x3f0d9f){return respondWithRpcPromise(_0x898a('0x57'),_0x31102d[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x3f0d9f,null))['catch'](handleError(_0x3f0d9f,null));};exports[_0x898a('0x58')]=function(_0x352ebb,_0x37b1d0){return respondWithRpcPromise(_0x898a('0x59'),_0x352ebb[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x37b1d0,null))[_0x898a('0x1c')](handleError(_0x37b1d0,null));};exports[_0x898a('0x5a')]=function(_0x474029,_0x37d205){return respondWithRpcPromise(_0x898a('0x59'),_0x474029[_0x898a('0x17')],routingClient)[_0x898a('0xa')](function(_0x1b0c09){if(_0x474029['query'][_0x898a('0x5b')]!==undefined){var _0x4607e1=_(_0x1b0c09['rows'])[_0x898a('0x5c')]([_0x474029['query'][_0x898a('0x5b')],_0x474029['params']['id']])[_0x898a('0x5d')](_0x898a('0x5e'))[_0x898a('0x5f')]()[_0x898a('0x60')]();return _0x1b0c09[_0x898a('0x13')][_0x898a('0x5c')](function(_0x170267){return _0x4607e1[_0x898a('0x61')](_0x170267[_0x898a('0x5e')])>-0x1;});}else{return _0x1b0c09['rows'][_0x898a('0x5c')](function(_0xd627d0){return _0xd627d0[_0x898a('0x5e')]===parseInt(_0x474029[_0x898a('0x1b')]['id']);});}})[_0x898a('0xa')](respondWithResult(_0x37d205,null))[_0x898a('0x1c')](handleError(_0x37d205,null));};exports[_0x898a('0x62')]=function(_0x4bcf85,_0x380f8c){return respondWithRpcPromise(_0x898a('0x63'),_0x4bcf85['query'],routingClient)['then'](respondWithResult(_0x380f8c,null))[_0x898a('0x1c')](handleError(_0x380f8c,null));};exports[_0x898a('0x64')]=function(_0x48e9c2,_0x5710a0){return respondWithRpcPromise(_0x898a('0x65'),_0x48e9c2['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5710a0,null))[_0x898a('0x1c')](handleError(_0x5710a0,null));};exports['faxQueuesWaitingInteractions']=function(_0x3f6815,_0x1c782e){return respondWithRpcPromise(_0x898a('0x66'),_0x3f6815[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x1c782e,null))[_0x898a('0x1c')](handleError(_0x1c782e,null));};exports[_0x898a('0x67')]=function(_0x49f8ac){return function(_0x3237e8,_0x1efe1e){var _0x37ee4d,_0x50d978;var _0x27560f=_[_0x898a('0x68')](_0x49f8ac);var _0x5c6247=_0x49f8ac===_0x898a('0x69')?'Website':'Account';return db[_0x27560f+'Queue'][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3237e8[_0x898a('0x1b')]['id']}})[_0x898a('0xa')](function(_0x2079d0){if(_[_0x898a('0x12')](_0x2079d0)){throw new Error(_0x27560f+_0x898a('0x6b'));}_0x37ee4d=_0x2079d0;return db[_0x27560f+_0x898a('0x6c')]['findOne']({'where':{'id':_0x3237e8[_0x898a('0x22')]['messageId']},'include':[{'model':db[_0x27560f+_0x898a('0x6d')],'as':_0x898a('0x6d')},{'model':db[_0x27560f+_0x5c6247],'as':'Account'}]});})[_0x898a('0xa')](function(_0x2269fb){if(_[_0x898a('0x12')](_0x2269fb)){throw new Error(_0x27560f+_0x898a('0x6e'));}_0x50d978=_0x2269fb;return _0x2269fb[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5847cb={'uniqueid':_0x49f8ac+'.'+_0x50d978['id']+'.'+_0x50d978['Interaction']['id'],'FromUserId':_0x3237e8[_0x898a('0x33')]['id'],'type':_0x898a('0x70')};_0x5847cb[_0x27560f+_0x898a('0x71')]=_0x50d978['id'];_0x5847cb[_0x27560f+'InteractionId']=_0x50d978[_0x898a('0x6d')]['id'];_0x5847cb['From'+_0x27560f+_0x5c6247+'Id']=_0x50d978['Account']['id'];_0x5847cb['To'+_0x27560f+_0x898a('0x72')]=_0x37ee4d['id'];return db[_0x27560f+_0x898a('0x73')][_0x898a('0x74')](_0x5847cb);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0x49f8ac,'interaction':_0x50d978[_0x898a('0x6d')],'message':_0x50d978,'account':_0x50d978[_0x898a('0x76')],'applications':[{'id':0x0,'priority':0x1,'app':_0x898a('0x70'),'appdata':_0x37ee4d[_0x898a('0x10')]+','+(_0x50d978[_0x898a('0x76')][_0x898a('0x77')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x1efe1e,null))[_0x898a('0x1c')](handleError(_0x1efe1e,null));};};exports[_0x898a('0x79')]=function(_0x3d9634,_0x54c440){var _0x435689,_0x3eaf3e;if(_[_0x898a('0x12')](_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')])){throw new Error(_0x898a('0x7b'));}var _0xd45b78=_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')];var _0x427eff=_[_0x898a('0x68')](_0xd45b78);var _0x381071=_0xd45b78==='chat'?_0x898a('0x7c'):'Account';return db[_0x898a('0x7d')][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3d9634[_0x898a('0x1b')]['id'],'role':'agent'}})[_0x898a('0xa')](function(_0x223775){if(_['isNil'](_0x223775)){throw new Error(_0x898a('0x7e'));}_0x435689=_0x223775;return db[_0x427eff+_0x898a('0x6c')][_0x898a('0x6a')]({'where':{'id':_0x3d9634[_0x898a('0x22')][_0x898a('0x7f')]},'include':[{'model':db[_0x427eff+_0x898a('0x6d')],'as':'Interaction'},{'model':db[_0x427eff+_0x381071],'as':'Account'}]});})[_0x898a('0xa')](function(_0x4b7334){if(_[_0x898a('0x12')](_0x4b7334)){throw new Error(_0x427eff+_0x898a('0x6e'));}_0x3eaf3e=_0x4b7334;return _0x4b7334[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x898a('0xa')](function(){var _0x13b3f9={'uniqueid':_0xd45b78+'.'+_0x3eaf3e['id']+'.'+_0x3eaf3e[_0x898a('0x6d')]['id'],'FromUserId':_0x3d9634['user']['id'],'type':'queue','ToUserId':_0x435689['id']};_0x13b3f9[_0x427eff+_0x898a('0x71')]=_0x3eaf3e['id'];_0x13b3f9[_0x427eff+'InteractionId']=_0x3eaf3e[_0x898a('0x6d')]['id'];_0x13b3f9[_0x898a('0x80')+_0x427eff+_0x381071+'Id']=_0x3eaf3e['Account']['id'];return db[_0x427eff+_0x898a('0x73')]['create'](_0x13b3f9);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0xd45b78,'interaction':_0x3eaf3e[_0x898a('0x6d')],'message':_0x3eaf3e,'account':_0x3eaf3e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x435689['name']+','+(_0x3eaf3e[_0x898a('0x76')][_0x898a('0x81')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x54c440,null))[_0x898a('0x1c')](handleError(_0x54c440,null));}; \ No newline at end of file +var _0x7fbe=['VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','user','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','queue_id','uniq','value','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','Website','User','Agent\x20not\x20found','From','TransferReport','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','result','catch','status','json','stack','name','send','isNil','find','voiceChannels','query','VoiceChannelMixMonitor','merge','params','then','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body'];(function(_0x5c355e,_0x3c7cf9){var _0x42f7ed=function(_0x339894){while(--_0x339894){_0x5c355e['push'](_0x5c355e['shift']());}};_0x42f7ed(++_0x3c7cf9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x174fc1,_0x384973){_0x174fc1=_0x174fc1-0x0;var _0x41b79a=_0x7fbe[_0x174fc1];return _0x41b79a;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var db=require(_0xe7fb('0x2'))['db'];var logger=require(_0xe7fb('0x3'))(_0xe7fb('0x4'));var jayson=require(_0xe7fb('0x5'));var amiClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232a});var mailClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232b});var routingClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){var _0x1d0741=_0x5ad75b?_0x5ad75b:amiClient;return _0x1d0741[_0xe7fb('0x8')](_0x24cd67,_0x1f943f)['then'](function(_0x558857){if(_0x558857[_0xe7fb('0x9')]){if(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xa')]===0x1f4){return _0x228f6b(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}return _0x213ebc(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}else{_0x213ebc(_0x558857[_0xe7fb('0xc')]);}})[_0xe7fb('0xd')](function(_0x2fe8ab){_0x228f6b(_0x2fe8ab);});});}function respondWithResult(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xc8;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0xe')](_0x188e1d)[_0xe7fb('0xf')](_0xdf9760);}return _0x2437d4['sendStatus'](0x194);};}function handleError(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0x1f4;return function(_0x5573ab){logger[_0xe7fb('0x9')](_0x5573ab[_0xe7fb('0x10')]);if(_0x5573ab['name']){delete _0x5573ab[_0xe7fb('0x11')];}_0x278b75['status'](_0x2225e5)[_0xe7fb('0x12')](_0x5573ab);};}function findById(_0x18d23c){return function(_0x12603d){if(!_[_0xe7fb('0x13')](_0x18d23c)&&!_['isNil'](_0x12603d)&&!_[_0xe7fb('0x13')](_0x12603d['rows'])){return _[_0xe7fb('0x14')](_0x12603d['rows'],function(_0x1e77fd){return _0x1e77fd['id']==_0x18d23c;});}return null;};}exports[_0xe7fb('0x15')]=function(_0x3f96a7,_0x182269){return respondWithRpcPromise('VoiceChannels',_0x3f96a7[_0xe7fb('0x16')])['then'](respondWithResult(_0x182269,null))[_0xe7fb('0xd')](handleError(_0x182269,null));};exports['voiceChannelMixMonitor']=function(_0x15f7a4,_0x4ea664){return respondWithRpcPromise(_0xe7fb('0x17'),_[_0xe7fb('0x18')](_0x15f7a4['query'],_0x15f7a4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x4ea664,null))[_0xe7fb('0xd')](handleError(_0x4ea664,null));};exports['voiceChannelStopMixMonitor']=function(_0x469d50,_0x469ead){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x469d50['query'],_0x469d50[_0xe7fb('0x19')]))['then'](respondWithResult(_0x469ead,null))['catch'](handleError(_0x469ead,null));};exports[_0xe7fb('0x1b')]=function(_0x32e8b2,_0x2996ae){return respondWithRpcPromise('VoiceQueues',_0x32e8b2[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2996ae,null))[_0xe7fb('0xd')](handleError(_0x2996ae,null));};exports[_0xe7fb('0x1c')]=function(_0x392d75,_0x16237a){return respondWithRpcPromise(_0xe7fb('0x1d'),_0x392d75['query'])['then'](findById(_0x392d75[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x16237a,null))[_0xe7fb('0xd')](handleError(_0x16237a,null));};exports['updateVoiceQueue']=function(_0xb1f2f4,_0x251807){return respondWithRpcPromise(_0xe7fb('0x1e'),_[_0xe7fb('0x18')](_0xb1f2f4[_0xe7fb('0x1f')],_0xb1f2f4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x251807,null))[_0xe7fb('0xd')](handleError(_0x251807,null));};exports['voiceQueuesPreview']=function(_0x3d1fb5,_0x1742f3){return respondWithRpcPromise(_0xe7fb('0x20'),_['merge'](_0x3d1fb5['query'],_0x3d1fb5[_0xe7fb('0x19')]))['then'](respondWithResult(_0x1742f3,null))[_0xe7fb('0xd')](handleError(_0x1742f3,null));};exports[_0xe7fb('0x21')]=function(_0xe49053,_0x2a4745){return respondWithRpcPromise('VoiceQueuesChannels',_0xe49053[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2a4745,null))[_0xe7fb('0xd')](handleError(_0x2a4745,null));};exports[_0xe7fb('0x22')]=function(_0x2d650d,_0x480819){return respondWithRpcPromise(_0xe7fb('0x23'),_[_0xe7fb('0x18')](_0x2d650d[_0xe7fb('0x16')],_0x2d650d[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x480819,null))[_0xe7fb('0xd')](handleError(_0x480819,null));};exports[_0xe7fb('0x24')]=function(_0x147eb1,_0x389903){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe7fb('0x18')](_0x147eb1[_0xe7fb('0x16')],_0x147eb1[_0xe7fb('0x19')]))['then'](respondWithResult(_0x389903,null))[_0xe7fb('0xd')](handleError(_0x389903,null));};exports[_0xe7fb('0x25')]=function(_0x4218bc,_0x1530b1){return respondWithRpcPromise(_0xe7fb('0x26'),_[_0xe7fb('0x18')](_0x4218bc[_0xe7fb('0x16')],_0x4218bc[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x1530b1,null))[_0xe7fb('0xd')](handleError(_0x1530b1,null));};exports[_0xe7fb('0x27')]=function(_0x3c4f4b,_0x1544f2){return respondWithRpcPromise(_0xe7fb('0x28'),_0x3c4f4b[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1544f2,null))[_0xe7fb('0xd')](handleError(_0x1544f2,null));};exports[_0xe7fb('0x29')]=function(_0x21e35c,_0x4d6fe6){return respondWithRpcPromise(_0xe7fb('0x2a'),_0x21e35c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x4d6fe6,null))[_0xe7fb('0xd')](handleError(_0x4d6fe6,null));};exports['agents']=function(_0x3426a9,_0x186418){var _0xd472d;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9['query'])[_0xe7fb('0x1a')](function(_0x451a6c){_0xd472d=_0x451a6c;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9[_0xe7fb('0x16')],routingClient);})[_0xe7fb('0x1a')](function(_0xb729fc){return _['merge']({},_0xb729fc,_0xd472d);})[_0xe7fb('0x1a')](respondWithResult(_0x186418,null))[_0xe7fb('0xd')](handleError(_0x186418,null));};exports[_0xe7fb('0x2c')]=function(_0x4b263d,_0x36a341){if(_0x4b263d[_0xe7fb('0x1f')]&&_0x4b263d['body']['interaction']&&_0x4b263d['user']&&_0x4b263d['user']['name']){for(var _0x900d67 in _0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')]){if(_0x4b263d['body'][_0xe7fb('0x2d')]['hasOwnProperty'](_0x900d67)){db[_0xe7fb('0x2e')][_0xe7fb('0x2f')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'type':_0xe7fb('0x30'),'exitAt':null,'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67]&&_0x4b263d['body'][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')]?{'$notIn':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67]}:{'$ne':null}}})[_0xe7fb('0x1a')](function(_0x6eb1ab){var _0x13b17f=moment()[_0xe7fb('0x32')](_0xe7fb('0x33'));for(var _0x5a1ce1=0x0,_0x2eb999=_0x6eb1ab['length'];_0x5a1ce1<_0x2eb999;_0x5a1ce1+=0x1){_0x6eb1ab[_0x5a1ce1][_0xe7fb('0x34')]({'exitAt':_0x13b17f});}});for(var _0x468c62=0x0;_0x468c62<_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')];_0x468c62+=0x1){db['MemberReport'][_0xe7fb('0x35')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user']['name'],'type':_0xe7fb('0x30'),'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0x468c62],'exitAt':null},'defaults':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'interface':_[_0xe7fb('0x13')](_0x4b263d['user']['interface'])?util[_0xe7fb('0x32')](_0xe7fb('0x36'),_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x11')]):_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x38')],'type':_0xe7fb('0x30'),'enterAt':moment()[_0xe7fb('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe7fb('0x39'),'internal':_0x4b263d['user'][_0xe7fb('0x3a')],'uniqueid':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67][_0x468c62]}});}}}}return respondWithRpcPromise(_0xe7fb('0x3b'),{'id':_0x4b263d['params']['id'],'capacity':_0x4b263d[_0xe7fb('0x1f')]['capacity']},routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x36a341,null))['catch'](handleError(_0x36a341,null));};exports[_0xe7fb('0x3c')]=function(_0x59158c,_0x1fff6c){return respondWithRpcPromise(_0xe7fb('0x3d'),_0x59158c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1fff6c,null))[_0xe7fb('0xd')](handleError(_0x1fff6c,null));};exports[_0xe7fb('0x3e')]=function(_0x2f4760,_0x582a4a){return respondWithRpcPromise('Trunks',_0x2f4760[_0xe7fb('0x16')])['then'](respondWithResult(_0x582a4a,null))['catch'](handleError(_0x582a4a,null));};exports['campaigns']=function(_0x50b8df,_0x539252){return respondWithRpcPromise(_0xe7fb('0x3f'),_0x50b8df[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x539252,null))[_0xe7fb('0xd')](handleError(_0x539252,null));};exports['chatQueues']=function(_0x37af37,_0x236b35){return respondWithRpcPromise(_0xe7fb('0x40'),_0x37af37['query'],routingClient)['then'](respondWithResult(_0x236b35,null))[_0xe7fb('0xd')](handleError(_0x236b35,null));};exports[_0xe7fb('0x41')]=function(_0x300b8e,_0x4f4ba3){return respondWithRpcPromise(_0xe7fb('0x40'),_0x300b8e[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x300b8e[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x4f4ba3,null))['catch'](handleError(_0x4f4ba3,null));};exports[_0xe7fb('0x42')]=function(_0x3104c2,_0x1f16b2){return respondWithRpcPromise(_0xe7fb('0x43'),_0x3104c2[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x1f16b2,null))[_0xe7fb('0xd')](handleError(_0x1f16b2,null));};exports[_0xe7fb('0x44')]=function(_0x23755b,_0x590d7a){return respondWithRpcPromise('MailQueues',_0x23755b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x23755b[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x590d7a,null))[_0xe7fb('0xd')](handleError(_0x590d7a,null));};exports[_0xe7fb('0x45')]=function(_0x585b7c,_0x1e21e4){return respondWithRpcPromise(_0xe7fb('0x46'),_0x585b7c[_0xe7fb('0x16')],mailClient)[_0xe7fb('0x1a')](respondWithResult(_0x1e21e4,null))[_0xe7fb('0xd')](handleError(_0x1e21e4,null));};exports[_0xe7fb('0x47')]=function(_0x554092,_0x2e457c){return respondWithRpcPromise('OpenchannelQueues',_0x554092[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2e457c,null))[_0xe7fb('0xd')](handleError(_0x2e457c,null));};exports[_0xe7fb('0x48')]=function(_0x5925e6,_0x47ac92){return respondWithRpcPromise(_0xe7fb('0x49'),_0x5925e6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5925e6[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x47ac92,null))['catch'](handleError(_0x47ac92,null));};exports[_0xe7fb('0x4a')]=function(_0x58d4ec,_0x127b0e){return respondWithRpcPromise('SmsQueues',_0x58d4ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x127b0e,null))[_0xe7fb('0xd')](handleError(_0x127b0e,null));};exports[_0xe7fb('0x4b')]=function(_0x5da884,_0x475716){return respondWithRpcPromise(_0xe7fb('0x4c'),_0x5da884[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5da884[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x475716,null))[_0xe7fb('0xd')](handleError(_0x475716,null));};exports[_0xe7fb('0x4d')]=function(_0x5151ec,_0x4136ae){return respondWithRpcPromise(_0xe7fb('0x4e'),_0x5151ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x4136ae,null))['catch'](handleError(_0x4136ae,null));};exports[_0xe7fb('0x4f')]=function(_0x1dc9c1,_0xa93f35){return respondWithRpcPromise('WhatsappQueues',_0x1dc9c1[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x1dc9c1[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0xa93f35,null))[_0xe7fb('0xd')](handleError(_0xa93f35,null));};exports[_0xe7fb('0x50')]=function(_0xcdc72e,_0x187040){return respondWithRpcPromise('FaxQueues',_0xcdc72e['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x187040,null))[_0xe7fb('0xd')](handleError(_0x187040,null));};exports[_0xe7fb('0x51')]=function(_0x50c705,_0x519c5f){return respondWithRpcPromise(_0xe7fb('0x52'),_0x50c705[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x50c705[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x519c5f,null))[_0xe7fb('0xd')](handleError(_0x519c5f,null));};exports[_0xe7fb('0x53')]=function(_0x3f11f1,_0xb06693){return respondWithRpcPromise(_0xe7fb('0x54'),_0x3f11f1[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0xb06693,null))[_0xe7fb('0xd')](handleError(_0xb06693,null));};exports['chatQueuesWaitingInteractions']=function(_0x4fa142,_0x125427){return respondWithRpcPromise(_0xe7fb('0x55'),_0x4fa142[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x125427,null))[_0xe7fb('0xd')](handleError(_0x125427,null));};exports['mailQueuesWaitingInteractions']=function(_0x43f14b,_0x1beb13){return respondWithRpcPromise(_0xe7fb('0x56'),_0x43f14b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x1beb13,null))[_0xe7fb('0xd')](handleError(_0x1beb13,null));};exports[_0xe7fb('0x57')]=function(_0x1e6256,_0xa7fa61){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1e6256[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0xa7fa61,null))[_0xe7fb('0xd')](handleError(_0xa7fa61,null));};exports[_0xe7fb('0x58')]=function(_0x2a2079,_0x31c159){return respondWithRpcPromise(_0xe7fb('0x59'),_0x2a2079['query'],routingClient)[_0xe7fb('0x1a')](function(_0x38e66a){if(_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')]!==undefined){var _0x15d881=_(_0x38e66a[_0xe7fb('0x5b')])[_0xe7fb('0x5c')]([_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')],_0x2a2079[_0xe7fb('0x19')]['id']])[_0xe7fb('0x5d')](_0xe7fb('0x5e'))[_0xe7fb('0x5f')]()[_0xe7fb('0x60')]();return _0x38e66a['rows']['filter'](function(_0x48a015){return _0x15d881[_0xe7fb('0x61')](_0x48a015[_0xe7fb('0x5e')])>-0x1;});}else{return _0x38e66a[_0xe7fb('0x5b')][_0xe7fb('0x5c')](function(_0x535e8b){return _0x535e8b[_0xe7fb('0x5e')]===parseInt(_0x2a2079[_0xe7fb('0x19')]['id']);});}})[_0xe7fb('0x1a')](respondWithResult(_0x31c159,null))[_0xe7fb('0xd')](handleError(_0x31c159,null));};exports['smsQueuesWaitingInteractions']=function(_0x2f7fa6,_0x5650c6){return respondWithRpcPromise(_0xe7fb('0x62'),_0x2f7fa6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x5650c6,null))[_0xe7fb('0xd')](handleError(_0x5650c6,null));};exports[_0xe7fb('0x63')]=function(_0x4ab541,_0x3ffd6c){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4ab541[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x3ffd6c,null))[_0xe7fb('0xd')](handleError(_0x3ffd6c,null));};exports[_0xe7fb('0x64')]=function(_0x4c37cd,_0x2b6d69){return respondWithRpcPromise(_0xe7fb('0x65'),_0x4c37cd[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2b6d69,null))['catch'](handleError(_0x2b6d69,null));};exports[_0xe7fb('0x66')]=function(_0x277335){return function(_0x1412e2,_0x4d0eed){var _0x11d5b6,_0x4b2cc4;var _0x5b1e28=_['capitalize'](_0x277335);var _0x3c99e7=_0x277335===_0xe7fb('0x67')?'Website':_0xe7fb('0x68');return db[_0x5b1e28+_0xe7fb('0x69')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0x1412e2[_0xe7fb('0x19')]['id']}})[_0xe7fb('0x1a')](function(_0x1cc21d){if(_[_0xe7fb('0x13')](_0x1cc21d)){throw new Error(_0x5b1e28+_0xe7fb('0x6b'));}_0x11d5b6=_0x1cc21d;return db[_0x5b1e28+_0xe7fb('0x6c')][_0xe7fb('0x6a')]({'where':{'id':_0x1412e2[_0xe7fb('0x1f')][_0xe7fb('0x6d')]},'include':[{'model':db[_0x5b1e28+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x5b1e28+_0x3c99e7],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x3c5bd9){if(_[_0xe7fb('0x13')](_0x3c5bd9)){throw new Error(_0x5b1e28+_0xe7fb('0x6f'));}_0x4b2cc4=_0x3c5bd9;return _0x3c5bd9[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x47568c={'uniqueid':_0x277335+'.'+_0x4b2cc4['id']+'.'+_0x4b2cc4[_0xe7fb('0x6e')]['id'],'FromUserId':_0x1412e2[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71')};_0x47568c[_0x5b1e28+_0xe7fb('0x72')]=_0x4b2cc4['id'];_0x47568c[_0x5b1e28+_0xe7fb('0x73')]=_0x4b2cc4[_0xe7fb('0x6e')]['id'];_0x47568c['From'+_0x5b1e28+_0x3c99e7+'Id']=_0x4b2cc4['Account']['id'];_0x47568c['To'+_0x5b1e28+_0xe7fb('0x74')]=_0x11d5b6['id'];return db[_0x5b1e28+'TransferReport'][_0xe7fb('0x75')](_0x47568c);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise('Start',{'channel':_0x277335,'interaction':_0x4b2cc4[_0xe7fb('0x6e')],'message':_0x4b2cc4,'account':_0x4b2cc4[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x71'),'appdata':_0x11d5b6[_0xe7fb('0x11')]+','+(_0x4b2cc4[_0xe7fb('0x68')][_0xe7fb('0x76')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x4d0eed,null))[_0xe7fb('0xd')](handleError(_0x4d0eed,null));};};exports[_0xe7fb('0x77')]=function(_0xae9441,_0x276c28){var _0xd5a417,_0x48de0c;if(_['isNil'](_0xae9441['body'][_0xe7fb('0x78')])){throw new Error(_0xe7fb('0x79'));}var _0x2b0600=_0xae9441['body'][_0xe7fb('0x78')];var _0x57ee3b=_[_0xe7fb('0x7a')](_0x2b0600);var _0x278a6c=_0x2b0600===_0xe7fb('0x67')?_0xe7fb('0x7b'):'Account';return db[_0xe7fb('0x7c')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0xae9441[_0xe7fb('0x19')]['id'],'role':_0xe7fb('0x39')}})[_0xe7fb('0x1a')](function(_0x33262f){if(_[_0xe7fb('0x13')](_0x33262f)){throw new Error(_0xe7fb('0x7d'));}_0xd5a417=_0x33262f;return db[_0x57ee3b+'Message']['findOne']({'where':{'id':_0xae9441[_0xe7fb('0x1f')]['messageId']},'include':[{'model':db[_0x57ee3b+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x57ee3b+_0x278a6c],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x58352d){if(_['isNil'](_0x58352d)){throw new Error(_0x57ee3b+_0xe7fb('0x6f'));}_0x48de0c=_0x58352d;return _0x58352d[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x21cb12={'uniqueid':_0x2b0600+'.'+_0x48de0c['id']+'.'+_0x48de0c[_0xe7fb('0x6e')]['id'],'FromUserId':_0xae9441[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71'),'ToUserId':_0xd5a417['id']};_0x21cb12[_0x57ee3b+_0xe7fb('0x72')]=_0x48de0c['id'];_0x21cb12[_0x57ee3b+_0xe7fb('0x73')]=_0x48de0c['Interaction']['id'];_0x21cb12[_0xe7fb('0x7e')+_0x57ee3b+_0x278a6c+'Id']=_0x48de0c[_0xe7fb('0x68')]['id'];return db[_0x57ee3b+_0xe7fb('0x7f')][_0xe7fb('0x75')](_0x21cb12);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise(_0xe7fb('0x80'),{'channel':_0x2b0600,'interaction':_0x48de0c[_0xe7fb('0x6e')],'message':_0x48de0c,'account':_0x48de0c[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x39'),'appdata':_0xd5a417[_0xe7fb('0x11')]+','+(_0x48de0c[_0xe7fb('0x68')][_0xe7fb('0x81')]||0x12c),'interval':_0xe7fb('0x82')}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x276c28,null))[_0xe7fb('0xd')](handleError(_0x276c28,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index c64dafe..79c027a 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 _0x06d2=['index','isAuthenticated','show','/:id/run','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./schedule.controller','get'];(function(_0x590800,_0x45aa50){var _0x2f76fa=function(_0x1b961a){while(--_0x1b961a){_0x590800['push'](_0x590800['shift']());}};_0x2f76fa(++_0x45aa50);}(_0x06d2,0x174));var _0x206d=function(_0x746106,_0x38dd85){_0x746106=_0x746106-0x0;var _0xd6aedd=_0x06d2[_0x746106];return _0xd6aedd;};'use strict';var multer=require(_0x206d('0x0'));var util=require('util');var path=require(_0x206d('0x1'));var timeout=require(_0x206d('0x2'));var express=require(_0x206d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x206d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x206d('0x5'));var controller=require(_0x206d('0x6'));router[_0x206d('0x7')]('/',auth['isAuthenticated'](),controller[_0x206d('0x8')]);router[_0x206d('0x7')]('/:id',auth[_0x206d('0x9')](),controller[_0x206d('0xa')]);router[_0x206d('0x7')](_0x206d('0xb'),auth[_0x206d('0x9')](),controller['run']);router[_0x206d('0xc')]('/',auth[_0x206d('0x9')](),controller[_0x206d('0xd')]);router[_0x206d('0xe')](_0x206d('0xf'),auth[_0x206d('0x9')](),controller[_0x206d('0x10')]);router[_0x206d('0x11')](_0x206d('0xf'),auth[_0x206d('0x9')](),controller[_0x206d('0x12')]);module[_0x206d('0x13')]=router; \ No newline at end of file +var _0xa113=['run','post','create','put','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','/:id/run'];(function(_0x535c52,_0x579ecf){var _0x4e03c2=function(_0x4a67d6){while(--_0x4a67d6){_0x535c52['push'](_0x535c52['shift']());}};_0x4e03c2(++_0x579ecf);}(_0xa113,0x1cf));var _0x3a11=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa113[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x3a11('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a11('0x1'));var express=require('express');var router=express[_0x3a11('0x2')]();var fs_extra=require(_0x3a11('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3a11('0x4'));var config=require(_0x3a11('0x5'));var controller=require(_0x3a11('0x6'));router[_0x3a11('0x7')]('/',auth['isAuthenticated'](),controller[_0x3a11('0x8')]);router[_0x3a11('0x7')](_0x3a11('0x9'),auth[_0x3a11('0xa')](),controller['show']);router[_0x3a11('0x7')](_0x3a11('0xb'),auth[_0x3a11('0xa')](),controller[_0x3a11('0xc')]);router[_0x3a11('0xd')]('/',auth[_0x3a11('0xa')](),controller[_0x3a11('0xe')]);router[_0x3a11('0xf')](_0x3a11('0x9'),auth[_0x3a11('0xa')](),controller[_0x3a11('0x10')]);router[_0x3a11('0x11')](_0x3a11('0x9'),auth[_0x3a11('0xa')](),controller['destroy']);module[_0x3a11('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index acfc514..1e17d7b 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 _0x5e93=['years','months','weeks','days','hours','minutes','xlsx','csv','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x5e93,0xdc));var _0x35e9=function(_0x3628f7,_0x1602b8){_0x3628f7=_0x3628f7-0x0;var _0x5197af=_0x5e93[_0x3628f7];return _0x5197af;};'use strict';var Sequelize=require(_0x35e9('0x0'));module[_0x35e9('0x1')]={'name':{'type':Sequelize[_0x35e9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x35e9('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x35e9('0x2')],'allowNull':![],'defaultValue':_0x35e9('0x4')},'startAt':{'type':Sequelize[_0x35e9('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x35e9('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x35e9('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x35e9('0x7')](_0x35e9('0x8'),'quarters',_0x35e9('0x9'),_0x35e9('0xa'),_0x35e9('0xb'),_0x35e9('0xc'),_0x35e9('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM']('csv','pdf',_0x35e9('0xe')),'allowNull':![],'defaultValue':_0x35e9('0xf')},'type':{'type':Sequelize['ENUM']('custom',_0x35e9('0x10')),'allowNull':![],'defaultValue':_0x35e9('0x11')},'sendMail':{'type':Sequelize[_0x35e9('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x35e9('0x12')]},'bcc':{'type':Sequelize[_0x35e9('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9dbe=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','months','weeks','hours','days','csv','pdf','xlsx'];(function(_0xe5bc6a,_0x1d794d){var _0x3c596a=function(_0x331a0f){while(--_0x331a0f){_0xe5bc6a['push'](_0xe5bc6a['shift']());}};_0x3c596a(++_0x1d794d);}(_0x9dbe,0x102));var _0xe9db=function(_0x326045,_0x4bc2cb){_0x326045=_0x326045-0x0;var _0x37b3df=_0x9dbe[_0x326045];return _0x37b3df;};'use strict';var Sequelize=require(_0xe9db('0x0'));module[_0xe9db('0x1')]={'name':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe9db('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xe9db('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe9db('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe9db('0x6')]('years','quarters',_0xe9db('0x7'),_0xe9db('0x8'),'days',_0xe9db('0x9'),'minutes'),'allowNull':![],'defaultValue':_0xe9db('0xa')},'output':{'type':Sequelize[_0xe9db('0x6')](_0xe9db('0xb'),_0xe9db('0xc'),_0xe9db('0xd')),'allowNull':![],'defaultValue':_0xe9db('0xb')},'type':{'type':Sequelize[_0xe9db('0x6')](_0xe9db('0xe'),_0xe9db('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xe9db('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe9db('0x2')]},'cc':{'type':Sequelize[_0xe9db('0x10')]},'bcc':{'type':Sequelize[_0xe9db('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xe9db('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 10941ad..5e1139f 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 _0x5d88=['json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','get','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x5d88,0x1a2));var _0x85d8=function(_0x4d1c5b,_0x25acb1){_0x4d1c5b=_0x4d1c5b-0x0;var _0x5ead2c=_0x5d88[_0x4d1c5b];return _0x5ead2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85d8('0x0'));var jsonpatch=require(_0x85d8('0x1'));var rp=require(_0x85d8('0x2'));var moment=require(_0x85d8('0x3'));var BPromise=require(_0x85d8('0x4'));var Mustache=require(_0x85d8('0x5'));var util=require('util');var path=require(_0x85d8('0x6'));var sox=require(_0x85d8('0x7'));var csv=require(_0x85d8('0x8'));var ejs=require(_0x85d8('0x9'));var fs=require('fs');var fs_extra=require(_0x85d8('0xa'));var _=require(_0x85d8('0xb'));var squel=require(_0x85d8('0xc'));var crypto=require(_0x85d8('0xd'));var jsforce=require(_0x85d8('0xe'));var deskjs=require(_0x85d8('0xf'));var toCsv=require(_0x85d8('0x8'));var querystring=require(_0x85d8('0x10'));var Papa=require('papaparse');var Redis=require(_0x85d8('0x11'));var authService=require(_0x85d8('0x12'));var qs=require(_0x85d8('0x13'));var as=require(_0x85d8('0x14'));var hardwareService=require(_0x85d8('0x15'));var logger=require(_0x85d8('0x16'))(_0x85d8('0x17'));var utils=require(_0x85d8('0x18'));var config=require(_0x85d8('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27fc8e,_0x4a2d82){_0x4a2d82=_0x4a2d82||0xcc;return function(_0x148fb3){if(_0x148fb3){return _0x27fc8e['sendStatus'](_0x4a2d82);}return _0x27fc8e[_0x85d8('0x1a')](_0x4a2d82)['end']();};}function respondWithResult(_0x302cef,_0x2af9f1){_0x2af9f1=_0x2af9f1||0xc8;return function(_0x37ecd2){if(_0x37ecd2){return _0x302cef[_0x85d8('0x1a')](_0x2af9f1)[_0x85d8('0x1b')](_0x37ecd2);}};}function respondWithFilteredResult(_0x269d75,_0xf411e8){return function(_0x84f5c8){if(_0x84f5c8){var _0x45d4aa=typeof _0xf411e8[_0x85d8('0x1c')]===_0x85d8('0x1d')&&typeof _0xf411e8['limit']===_0x85d8('0x1d');var _0x3a0217=_0x84f5c8[_0x85d8('0x1e')];var _0x15b91e=_0x45d4aa?0x0:_0xf411e8['offset'];var _0xaeb09c=_0x45d4aa?_0x84f5c8[_0x85d8('0x1e')]:_0xf411e8[_0x85d8('0x1c')]+_0xf411e8['limit'];var _0x4a50ef;if(_0xaeb09c>=_0x3a0217){_0xaeb09c=_0x3a0217;_0x4a50ef=0xc8;}else{_0x4a50ef=0xce;}_0x269d75['status'](_0x4a50ef);return _0x269d75[_0x85d8('0x1f')](_0x85d8('0x20'),_0x15b91e+'-'+_0xaeb09c+'/'+_0x3a0217)[_0x85d8('0x1b')](_0x84f5c8);}return null;};}function patchUpdates(_0x4f5449){return function(_0x193dbc){try{jsonpatch['apply'](_0x193dbc,_0x4f5449,!![]);}catch(_0x48da4){return BPromise[_0x85d8('0x21')](_0x48da4);}return _0x193dbc['save']();};}function saveUpdates(_0x58c3fe,_0x1ce3e0){return function(_0x330d62){if(_0x330d62){return _0x330d62[_0x85d8('0x22')](_0x58c3fe)[_0x85d8('0x23')](function(_0x580841){return _0x580841;});}return null;};}function removeEntity(_0x430e6c,_0x329fdf){return function(_0x11d621){if(_0x11d621){return _0x11d621[_0x85d8('0x24')]()[_0x85d8('0x23')](function(){var _0x150e21=_0x11d621[_0x85d8('0x25')]({'plain':!![]});var _0x358e32=_0x85d8('0x26');return db[_0x85d8('0x27')][_0x85d8('0x24')]({'where':{'type':_0x358e32,'resourceId':_0x150e21['id']}})['then'](function(){return _0x11d621;});})[_0x85d8('0x23')](function(){_0x430e6c[_0x85d8('0x1a')](0xcc)[_0x85d8('0x28')]();});}};}function handleEntityNotFound(_0x65bff4,_0x2e89c9){return function(_0x36d1aa){if(!_0x36d1aa){_0x65bff4[_0x85d8('0x29')](0x194);}return _0x36d1aa;};}function handleError(_0xd3abbd,_0x54953f){_0x54953f=_0x54953f||0x1f4;return function(_0x3863c6){logger[_0x85d8('0x2a')](_0x3863c6[_0x85d8('0x2b')]);if(_0x3863c6[_0x85d8('0x2c')]){delete _0x3863c6[_0x85d8('0x2c')];}_0xd3abbd[_0x85d8('0x1a')](_0x54953f)[_0x85d8('0x2d')](_0x3863c6);};}exports[_0x85d8('0x2e')]=function(_0x4cf5e3,_0x35821c){var _0x418cdd={},_0x32fb5={},_0xd4f6d2={'count':0x0,'rows':[]};var _0x4c0da1=_[_0x85d8('0x2f')](db[_0x85d8('0x30')][_0x85d8('0x31')],function(_0xa51b61){return{'name':_0xa51b61[_0x85d8('0x32')],'type':_0xa51b61[_0x85d8('0x33')][_0x85d8('0x34')]};});_0x32fb5[_0x85d8('0x35')]=_[_0x85d8('0x2f')](_0x4c0da1,'name');_0x32fb5['query']=_['keys'](_0x4cf5e3[_0x85d8('0x36')]);_0x32fb5[_0x85d8('0x37')]=_[_0x85d8('0x38')](_0x32fb5[_0x85d8('0x35')],_0x32fb5[_0x85d8('0x36')]);_0x418cdd['attributes']=_[_0x85d8('0x38')](_0x32fb5[_0x85d8('0x35')],qs[_0x85d8('0x39')](_0x4cf5e3[_0x85d8('0x36')][_0x85d8('0x39')]));_0x418cdd[_0x85d8('0x3a')]=_0x418cdd['attributes']['length']?_0x418cdd[_0x85d8('0x3a')]:_0x32fb5[_0x85d8('0x35')];if(!_0x4cf5e3[_0x85d8('0x36')]['hasOwnProperty'](_0x85d8('0x3b'))){_0x418cdd['limit']=qs[_0x85d8('0x3c')](_0x4cf5e3['query'][_0x85d8('0x3c')]);_0x418cdd[_0x85d8('0x1c')]=qs[_0x85d8('0x1c')](_0x4cf5e3['query'][_0x85d8('0x1c')]);}_0x418cdd[_0x85d8('0x3d')]=qs[_0x85d8('0x3e')](_0x4cf5e3['query'][_0x85d8('0x3e')]);_0x418cdd[_0x85d8('0x3f')]=qs[_0x85d8('0x37')](_[_0x85d8('0x40')](_0x4cf5e3[_0x85d8('0x36')],_0x32fb5[_0x85d8('0x37')]),_0x4c0da1);if(_0x4cf5e3['query']['filter']){_0x418cdd[_0x85d8('0x3f')]=_[_0x85d8('0x41')](_0x418cdd[_0x85d8('0x3f')],{'$or':_[_0x85d8('0x2f')](_0x4c0da1,function(_0x210c07){if(_0x210c07[_0x85d8('0x33')]!==_0x85d8('0x42')){var _0x213674={};_0x213674[_0x210c07['name']]={'$like':'%'+_0x4cf5e3[_0x85d8('0x36')]['filter']+'%'};return _0x213674;}})});}_0x418cdd=_[_0x85d8('0x41')]({},_0x418cdd,_0x4cf5e3[_0x85d8('0x43')]);var _0x396060={'where':_0x418cdd[_0x85d8('0x3f')]};return db[_0x85d8('0x30')][_0x85d8('0x1e')](_0x396060)[_0x85d8('0x23')](function(_0x405ca7){_0xd4f6d2['count']=_0x405ca7;if(_0x4cf5e3[_0x85d8('0x36')][_0x85d8('0x44')]){_0x418cdd[_0x85d8('0x45')]=[{'all':!![]}];}return db[_0x85d8('0x30')][_0x85d8('0x46')](_0x418cdd);})[_0x85d8('0x23')](function(_0x2f36ea){_0xd4f6d2[_0x85d8('0x47')]=_0x2f36ea;return _0xd4f6d2;})[_0x85d8('0x23')](respondWithFilteredResult(_0x35821c,_0x418cdd))[_0x85d8('0x48')](handleError(_0x35821c,null));};exports[_0x85d8('0x49')]=function(_0x19b30b,_0x49e089){var _0x5a284f={'raw':![],'where':{'id':_0x19b30b[_0x85d8('0x4a')]['id']}},_0x1cd912={};_0x1cd912[_0x85d8('0x35')]=_[_0x85d8('0x4b')](db[_0x85d8('0x30')][_0x85d8('0x31')]);_0x1cd912['query']=_[_0x85d8('0x4b')](_0x19b30b[_0x85d8('0x36')]);_0x1cd912[_0x85d8('0x37')]=_[_0x85d8('0x38')](_0x1cd912[_0x85d8('0x35')],_0x1cd912[_0x85d8('0x36')]);_0x5a284f[_0x85d8('0x3a')]=_[_0x85d8('0x38')](_0x1cd912[_0x85d8('0x35')],qs['fields'](_0x19b30b[_0x85d8('0x36')][_0x85d8('0x39')]));_0x5a284f[_0x85d8('0x3a')]=_0x5a284f[_0x85d8('0x3a')][_0x85d8('0x4c')]?_0x5a284f[_0x85d8('0x3a')]:_0x1cd912[_0x85d8('0x35')];if(_0x19b30b[_0x85d8('0x36')][_0x85d8('0x44')]){_0x5a284f['include']=[{'all':!![]}];}_0x5a284f=_[_0x85d8('0x41')]({},_0x5a284f,_0x19b30b['options']);return db[_0x85d8('0x30')][_0x85d8('0x4d')](_0x5a284f)[_0x85d8('0x23')](handleEntityNotFound(_0x49e089,null))['then'](respondWithResult(_0x49e089,null))[_0x85d8('0x48')](handleError(_0x49e089,null));};exports[_0x85d8('0x4e')]=function(_0xaa132a,_0x3a1049){return db[_0x85d8('0x30')]['create'](_0xaa132a[_0x85d8('0x4f')],{})['then'](function(_0x3f4742){var _0x1fd975=_0xaa132a['user']['get']({'plain':!![]});if(!_0x1fd975)throw new Error(_0x85d8('0x50'));if(_0x1fd975[_0x85d8('0x51')]===_0x85d8('0x52')){var _0x33e27f=_0x3f4742['get']({'plain':!![]});var _0x47a928=_0x85d8('0x26');return db[_0x85d8('0x53')][_0x85d8('0x4d')]({'where':{'name':_0x47a928,'userProfileId':_0x1fd975[_0x85d8('0x54')]},'raw':!![]})['then'](function(_0x4dde1d){if(_0x4dde1d&&_0x4dde1d[_0x85d8('0x55')]===0x0){return db[_0x85d8('0x27')][_0x85d8('0x4e')]({'name':_0x33e27f['name'],'resourceId':_0x33e27f['id'],'type':_0x4dde1d[_0x85d8('0x2c')],'sectionId':_0x4dde1d['id']},{})[_0x85d8('0x23')](function(){return _0x3f4742;});}else{return _0x3f4742;}})[_0x85d8('0x48')](function(_0x59dc6f){logger['error'](_0x85d8('0x56'),_0x59dc6f);throw _0x59dc6f;});}return _0x3f4742;})[_0x85d8('0x23')](respondWithResult(_0x3a1049,0xc9))[_0x85d8('0x48')](handleError(_0x3a1049,null));};exports[_0x85d8('0x22')]=function(_0x3a7716,_0x578712){if(_0x3a7716[_0x85d8('0x4f')]['id']){delete _0x3a7716[_0x85d8('0x4f')]['id'];}return db[_0x85d8('0x30')][_0x85d8('0x4d')]({'where':{'id':_0x3a7716[_0x85d8('0x4a')]['id']}})[_0x85d8('0x23')](handleEntityNotFound(_0x578712,null))[_0x85d8('0x23')](saveUpdates(_0x3a7716['body'],null))[_0x85d8('0x23')](respondWithResult(_0x578712,null))[_0x85d8('0x48')](handleError(_0x578712,null));};exports[_0x85d8('0x24')]=function(_0x2f7db0,_0x4334d5){return db[_0x85d8('0x30')][_0x85d8('0x4d')]({'where':{'id':_0x2f7db0[_0x85d8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4334d5,null))[_0x85d8('0x23')](removeEntity(_0x4334d5,null))['catch'](handleError(_0x4334d5,null));};exports['run']=function(_0x451339,_0x156086,_0x4d5817){var _0xa95402=require(_0x85d8('0x57'));return db[_0x85d8('0x30')][_0x85d8('0x4d')]({'where':{'id':_0x451339['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x156086,null))[_0x85d8('0x23')](function(){_0xa95402[_0x85d8('0x58')](_0x451339['params']['id']);})['then'](respondWithStatusCode(_0x156086,null))['catch'](handleError(_0x156086,null));}; \ No newline at end of file +var _0x54cc=['squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','save','then','destroy','get','sendStatus','error','name','send','index','map','Schedule','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash'];(function(_0x3ffa5d,_0x5cea17){var _0x1bf6f2=function(_0x1f1e1d){while(--_0x1f1e1d){_0x3ffa5d['push'](_0x3ffa5d['shift']());}};_0x1bf6f2(++_0x5cea17);}(_0x54cc,0x96));var _0xc54c=function(_0x5dffdd,_0x373b08){_0x5dffdd=_0x5dffdd-0x0;var _0x41494b=_0x54cc[_0x5dffdd];return _0x41494b;};'use strict';var emlformat=require(_0xc54c('0x0'));var rimraf=require(_0xc54c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc54c('0x2'));var rp=require(_0xc54c('0x3'));var moment=require(_0xc54c('0x4'));var BPromise=require(_0xc54c('0x5'));var Mustache=require(_0xc54c('0x6'));var util=require('util');var path=require(_0xc54c('0x7'));var sox=require(_0xc54c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc54c('0x9'));var squel=require(_0xc54c('0xa'));var crypto=require(_0xc54c('0xb'));var jsforce=require(_0xc54c('0xc'));var deskjs=require(_0xc54c('0xd'));var toCsv=require(_0xc54c('0xe'));var querystring=require('querystring');var Papa=require(_0xc54c('0xf'));var Redis=require('ioredis');var authService=require(_0xc54c('0x10'));var qs=require(_0xc54c('0x11'));var as=require(_0xc54c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc54c('0x13'));var utils=require('../../config/utils');var config=require(_0xc54c('0x14'));var licenseUtil=require(_0xc54c('0x15'));var db=require(_0xc54c('0x16'))['db'];function respondWithStatusCode(_0x34ad6b,_0x2f875d){_0x2f875d=_0x2f875d||0xcc;return function(_0x2b4c5a){if(_0x2b4c5a){return _0x34ad6b['sendStatus'](_0x2f875d);}return _0x34ad6b[_0xc54c('0x17')](_0x2f875d)[_0xc54c('0x18')]();};}function respondWithResult(_0x48f73d,_0x14f95f){_0x14f95f=_0x14f95f||0xc8;return function(_0x9d2d01){if(_0x9d2d01){return _0x48f73d[_0xc54c('0x17')](_0x14f95f)['json'](_0x9d2d01);}};}function respondWithFilteredResult(_0x181cbb,_0x22363a){return function(_0x47e50e){if(_0x47e50e){var _0x2060df=typeof _0x22363a[_0xc54c('0x19')]===_0xc54c('0x1a')&&typeof _0x22363a[_0xc54c('0x1b')]==='undefined';var _0x8e2b57=_0x47e50e[_0xc54c('0x1c')];var _0x35f830=_0x2060df?0x0:_0x22363a['offset'];var _0x106c6c=_0x2060df?_0x47e50e[_0xc54c('0x1c')]:_0x22363a[_0xc54c('0x19')]+_0x22363a['limit'];var _0x14c5b6;if(_0x106c6c>=_0x8e2b57){_0x106c6c=_0x8e2b57;_0x14c5b6=0xc8;}else{_0x14c5b6=0xce;}_0x181cbb[_0xc54c('0x17')](_0x14c5b6);return _0x181cbb['set']('Content-Range',_0x35f830+'-'+_0x106c6c+'/'+_0x8e2b57)[_0xc54c('0x1d')](_0x47e50e);}return null;};}function patchUpdates(_0x4a72db){return function(_0x1685fc){try{jsonpatch['apply'](_0x1685fc,_0x4a72db,!![]);}catch(_0x4c34f2){return BPromise['reject'](_0x4c34f2);}return _0x1685fc[_0xc54c('0x1e')]();};}function saveUpdates(_0x155b69,_0x22a74e){return function(_0x5c1b4f){if(_0x5c1b4f){return _0x5c1b4f['update'](_0x155b69)[_0xc54c('0x1f')](function(_0x2fbb97){return _0x2fbb97;});}return null;};}function removeEntity(_0x1be538,_0x19dc6c){return function(_0x417309){if(_0x417309){return _0x417309[_0xc54c('0x20')]()[_0xc54c('0x1f')](function(){var _0x43e58f=_0x417309[_0xc54c('0x21')]({'plain':!![]});var _0x3cbb13='Scheduler';return db['UserProfileResource'][_0xc54c('0x20')]({'where':{'type':_0x3cbb13,'resourceId':_0x43e58f['id']}})['then'](function(){return _0x417309;});})[_0xc54c('0x1f')](function(){_0x1be538[_0xc54c('0x17')](0xcc)[_0xc54c('0x18')]();});}};}function handleEntityNotFound(_0x4b655b,_0x240436){return function(_0x1a1ab4){if(!_0x1a1ab4){_0x4b655b[_0xc54c('0x22')](0x194);}return _0x1a1ab4;};}function handleError(_0x3c0054,_0x2bd702){_0x2bd702=_0x2bd702||0x1f4;return function(_0x2d70dd){logger[_0xc54c('0x23')](_0x2d70dd['stack']);if(_0x2d70dd['name']){delete _0x2d70dd[_0xc54c('0x24')];}_0x3c0054[_0xc54c('0x17')](_0x2bd702)[_0xc54c('0x25')](_0x2d70dd);};}exports[_0xc54c('0x26')]=function(_0x3a35ed,_0x1b39a8){var _0x318402={},_0x47f27d={},_0x227c66={'count':0x0,'rows':[]};var _0x8e9fea=_[_0xc54c('0x27')](db[_0xc54c('0x28')]['rawAttributes'],function(_0x514713){return{'name':_0x514713[_0xc54c('0x29')],'type':_0x514713['type'][_0xc54c('0x2a')]};});_0x47f27d[_0xc54c('0x2b')]=_[_0xc54c('0x27')](_0x8e9fea,_0xc54c('0x24'));_0x47f27d[_0xc54c('0x2c')]=_[_0xc54c('0x2d')](_0x3a35ed[_0xc54c('0x2c')]);_0x47f27d['filters']=_['intersection'](_0x47f27d[_0xc54c('0x2b')],_0x47f27d[_0xc54c('0x2c')]);_0x318402[_0xc54c('0x2e')]=_[_0xc54c('0x2f')](_0x47f27d[_0xc54c('0x2b')],qs['fields'](_0x3a35ed[_0xc54c('0x2c')][_0xc54c('0x30')]));_0x318402[_0xc54c('0x2e')]=_0x318402[_0xc54c('0x2e')][_0xc54c('0x31')]?_0x318402['attributes']:_0x47f27d[_0xc54c('0x2b')];if(!_0x3a35ed[_0xc54c('0x2c')][_0xc54c('0x32')]('nolimit')){_0x318402['limit']=qs[_0xc54c('0x1b')](_0x3a35ed[_0xc54c('0x2c')]['limit']);_0x318402[_0xc54c('0x19')]=qs['offset'](_0x3a35ed[_0xc54c('0x2c')]['offset']);}_0x318402[_0xc54c('0x33')]=qs['sort'](_0x3a35ed[_0xc54c('0x2c')][_0xc54c('0x34')]);_0x318402[_0xc54c('0x35')]=qs['filters'](_[_0xc54c('0x36')](_0x3a35ed[_0xc54c('0x2c')],_0x47f27d['filters']),_0x8e9fea);if(_0x3a35ed[_0xc54c('0x2c')][_0xc54c('0x37')]){_0x318402[_0xc54c('0x35')]=_['merge'](_0x318402[_0xc54c('0x35')],{'$or':_['map'](_0x8e9fea,function(_0x5197fa){if(_0x5197fa[_0xc54c('0x38')]!==_0xc54c('0x39')){var _0x4cdb89={};_0x4cdb89[_0x5197fa['name']]={'$like':'%'+_0x3a35ed[_0xc54c('0x2c')]['filter']+'%'};return _0x4cdb89;}})});}_0x318402=_['merge']({},_0x318402,_0x3a35ed[_0xc54c('0x3a')]);var _0x20d2b3={'where':_0x318402[_0xc54c('0x35')]};return db[_0xc54c('0x28')][_0xc54c('0x1c')](_0x20d2b3)['then'](function(_0x3b2ed9){_0x227c66[_0xc54c('0x1c')]=_0x3b2ed9;if(_0x3a35ed[_0xc54c('0x2c')][_0xc54c('0x3b')]){_0x318402[_0xc54c('0x3c')]=[{'all':!![]}];}return db[_0xc54c('0x28')][_0xc54c('0x3d')](_0x318402);})[_0xc54c('0x1f')](function(_0x37b684){_0x227c66[_0xc54c('0x3e')]=_0x37b684;return _0x227c66;})[_0xc54c('0x1f')](respondWithFilteredResult(_0x1b39a8,_0x318402))[_0xc54c('0x3f')](handleError(_0x1b39a8,null));};exports['show']=function(_0x405595,_0x4ba12d){var _0x2c809c={'raw':![],'where':{'id':_0x405595[_0xc54c('0x40')]['id']}},_0x58aa50={};_0x58aa50[_0xc54c('0x2b')]=_[_0xc54c('0x2d')](db[_0xc54c('0x28')]['rawAttributes']);_0x58aa50[_0xc54c('0x2c')]=_['keys'](_0x405595[_0xc54c('0x2c')]);_0x58aa50[_0xc54c('0x41')]=_[_0xc54c('0x2f')](_0x58aa50[_0xc54c('0x2b')],_0x58aa50[_0xc54c('0x2c')]);_0x2c809c[_0xc54c('0x2e')]=_[_0xc54c('0x2f')](_0x58aa50['model'],qs[_0xc54c('0x30')](_0x405595[_0xc54c('0x2c')][_0xc54c('0x30')]));_0x2c809c[_0xc54c('0x2e')]=_0x2c809c[_0xc54c('0x2e')][_0xc54c('0x31')]?_0x2c809c['attributes']:_0x58aa50[_0xc54c('0x2b')];if(_0x405595[_0xc54c('0x2c')][_0xc54c('0x3b')]){_0x2c809c['include']=[{'all':!![]}];}_0x2c809c=_['merge']({},_0x2c809c,_0x405595[_0xc54c('0x3a')]);return db[_0xc54c('0x28')][_0xc54c('0x42')](_0x2c809c)[_0xc54c('0x1f')](handleEntityNotFound(_0x4ba12d,null))['then'](respondWithResult(_0x4ba12d,null))[_0xc54c('0x3f')](handleError(_0x4ba12d,null));};exports['create']=function(_0x1a2e8c,_0x2c9b18){return db['Schedule'][_0xc54c('0x43')](_0x1a2e8c['body'],{})['then'](function(_0x1b3b98){var _0x3ca145=_0x1a2e8c[_0xc54c('0x44')][_0xc54c('0x21')]({'plain':!![]});if(!_0x3ca145)throw new Error(_0xc54c('0x45'));if(_0x3ca145[_0xc54c('0x46')]===_0xc54c('0x44')){var _0x298b2e=_0x1b3b98['get']({'plain':!![]});var _0x5ce99d=_0xc54c('0x47');return db[_0xc54c('0x48')]['find']({'where':{'name':_0x5ce99d,'userProfileId':_0x3ca145[_0xc54c('0x49')]},'raw':!![]})['then'](function(_0x596e6e){if(_0x596e6e&&_0x596e6e[_0xc54c('0x4a')]===0x0){return db[_0xc54c('0x4b')]['create']({'name':_0x298b2e[_0xc54c('0x24')],'resourceId':_0x298b2e['id'],'type':_0x596e6e[_0xc54c('0x24')],'sectionId':_0x596e6e['id']},{})[_0xc54c('0x1f')](function(){return _0x1b3b98;});}else{return _0x1b3b98;}})['catch'](function(_0x4e1175){logger[_0xc54c('0x23')](_0xc54c('0x4c'),_0x4e1175);throw _0x4e1175;});}return _0x1b3b98;})[_0xc54c('0x1f')](respondWithResult(_0x2c9b18,0xc9))[_0xc54c('0x3f')](handleError(_0x2c9b18,null));};exports[_0xc54c('0x4d')]=function(_0x51ffb7,_0x37032d){if(_0x51ffb7[_0xc54c('0x4e')]['id']){delete _0x51ffb7['body']['id'];}return db[_0xc54c('0x28')]['find']({'where':{'id':_0x51ffb7['params']['id']}})[_0xc54c('0x1f')](handleEntityNotFound(_0x37032d,null))[_0xc54c('0x1f')](saveUpdates(_0x51ffb7[_0xc54c('0x4e')],null))['then'](respondWithResult(_0x37032d,null))[_0xc54c('0x3f')](handleError(_0x37032d,null));};exports[_0xc54c('0x20')]=function(_0x442312,_0x2696b2){return db['Schedule'][_0xc54c('0x42')]({'where':{'id':_0x442312[_0xc54c('0x40')]['id']}})[_0xc54c('0x1f')](handleEntityNotFound(_0x2696b2,null))['then'](removeEntity(_0x2696b2,null))[_0xc54c('0x3f')](handleError(_0x2696b2,null));};exports[_0xc54c('0x4f')]=function(_0x20b484,_0xabf8d8,_0x2159c1){var _0x24a2cc=require('../../config/schedule');return db[_0xc54c('0x28')][_0xc54c('0x42')]({'where':{'id':_0x20b484['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xabf8d8,null))[_0xc54c('0x1f')](function(){_0x24a2cc[_0xc54c('0x4f')](_0x20b484[_0xc54c('0x40')]['id']);})['then'](respondWithStatusCode(_0xabf8d8,null))[_0xc54c('0x3f')](handleError(_0xabf8d8,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 32b04ea..51d3c7f 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 _0x3895=['rimraf','../../config/environment','exports','Schedule','tools_schedules','lodash','util','api','moment','request-promise','path'];(function(_0x47ea39,_0x569093){var _0x3bd6cc=function(_0x1deddd){while(--_0x1deddd){_0x47ea39['push'](_0x47ea39['shift']());}};_0x3bd6cc(++_0x569093);}(_0x3895,0x144));var _0x5389=function(_0x122c26,_0x56104c){_0x122c26=_0x122c26-0x0;var _0x1559fc=_0x3895[_0x122c26];return _0x1559fc;};'use strict';var _=require(_0x5389('0x0'));var util=require(_0x5389('0x1'));var logger=require('../../config/logger')(_0x5389('0x2'));var moment=require(_0x5389('0x3'));var BPromise=require('bluebird');var rp=require(_0x5389('0x4'));var fs=require('fs');var path=require(_0x5389('0x5'));var rimraf=require(_0x5389('0x6'));var config=require(_0x5389('0x7'));var attributes=require('./schedule.attributes');module[_0x5389('0x8')]=function(_0x2fa167,_0x370a34){return _0x2fa167['define'](_0x5389('0x9'),attributes,{'tableName':_0x5389('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8ba=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','util'];(function(_0x1a8815,_0x5d199b){var _0x531892=function(_0x31d46a){while(--_0x31d46a){_0x1a8815['push'](_0x1a8815['shift']());}};_0x531892(++_0x5d199b);}(_0xa8ba,0xc1));var _0xaa8b=function(_0x5175b7,_0x45b2ab){_0x5175b7=_0x5175b7-0x0;var _0x41f556=_0xa8ba[_0x5175b7];return _0x41f556;};'use strict';var _=require(_0xaa8b('0x0'));var util=require(_0xaa8b('0x1'));var logger=require('../../config/logger')(_0xaa8b('0x2'));var moment=require(_0xaa8b('0x3'));var BPromise=require(_0xaa8b('0x4'));var rp=require(_0xaa8b('0x5'));var fs=require('fs');var path=require(_0xaa8b('0x6'));var rimraf=require(_0xaa8b('0x7'));var config=require(_0xaa8b('0x8'));var attributes=require(_0xaa8b('0x9'));module[_0xaa8b('0xa')]=function(_0x5280ef,_0x5636e3){return _0x5280ef[_0xaa8b('0xb')]('Schedule',attributes,{'tableName':_0xaa8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1c3961f..d521b6d 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 _0x3a20=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x2384bb,_0x12f81b){var _0x3f2bac=function(_0x337ece){while(--_0x337ece){_0x2384bb['push'](_0x2384bb['shift']());}};_0x3f2bac(++_0x12f81b);}(_0x3a20,0x95));var _0x03a2=function(_0x2442c4,_0x2ebe62){_0x2442c4=_0x2442c4-0x0;var _0x4b93f6=_0x3a20[_0x2442c4];return _0x4b93f6;};'use strict';var _=require(_0x03a2('0x0'));var util=require('util');var moment=require(_0x03a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03a2('0x2'));var db=require(_0x03a2('0x3'))['db'];var utils=require(_0x03a2('0x4'));var logger=require(_0x03a2('0x5'))(_0x03a2('0x6'));var config=require(_0x03a2('0x7'));var jayson=require(_0x03a2('0x8'));var client=jayson[_0x03a2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3264d1,_0x3d54d7,_0x5503a4){return new BPromise(function(_0x3e5624,_0x4a4175){return client['request'](_0x3264d1,_0x5503a4)[_0x03a2('0xa')](function(_0x3a7fbf){logger[_0x03a2('0xb')](_0x03a2('0xc'),_0x3d54d7,_0x03a2('0xd'));logger[_0x03a2('0xe')](_0x03a2('0xf'),_0x3d54d7,_0x03a2('0xd'),JSON[_0x03a2('0x10')](_0x3a7fbf));if(_0x3a7fbf['error']){if(_0x3a7fbf[_0x03a2('0x11')][_0x03a2('0x12')]===0x1f4){logger[_0x03a2('0x11')]('Schedule,\x20%s,\x20%s',_0x3d54d7,_0x3a7fbf[_0x03a2('0x11')][_0x03a2('0x13')]);return _0x4a4175(_0x3a7fbf['error']['message']);}logger[_0x03a2('0x11')](_0x03a2('0xc'),_0x3d54d7,_0x3a7fbf['error']['message']);return _0x3e5624(_0x3a7fbf[_0x03a2('0x11')]['message']);}else{logger[_0x03a2('0xb')](_0x03a2('0xc'),_0x3d54d7,_0x03a2('0xd'));_0x3e5624(_0x3a7fbf[_0x03a2('0x14')][_0x03a2('0x13')]);}})[_0x03a2('0x15')](function(_0x4a888b){logger[_0x03a2('0x11')]('Schedule,\x20%s,\x20%s',_0x3d54d7,_0x4a888b);_0x4a4175(_0x4a888b);});});} \ No newline at end of file +var _0x981d=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x2ee122,_0x29a979){var _0x3d9be6=function(_0x411847){while(--_0x411847){_0x2ee122['push'](_0x2ee122['shift']());}};_0x3d9be6(++_0x29a979);}(_0x981d,0xa6));var _0xd981=function(_0xdf32b4,_0x430d2a){_0xdf32b4=_0xdf32b4-0x0;var _0x53addb=_0x981d[_0xdf32b4];return _0x53addb;};'use strict';var _=require(_0xd981('0x0'));var util=require('util');var moment=require(_0xd981('0x1'));var BPromise=require(_0xd981('0x2'));var rs=require(_0xd981('0x3'));var fs=require('fs');var Redis=require(_0xd981('0x4'));var db=require(_0xd981('0x5'))['db'];var utils=require(_0xd981('0x6'));var logger=require(_0xd981('0x7'))(_0xd981('0x8'));var config=require(_0xd981('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd981('0xa')][_0xd981('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x715241,_0x1c8631,_0x267201){return new BPromise(function(_0x3cb96b,_0x1f7dd2){return client[_0xd981('0xc')](_0x715241,_0x267201)[_0xd981('0xd')](function(_0x26da69){logger[_0xd981('0xe')](_0xd981('0xf'),_0x1c8631,_0xd981('0x10'));logger['debug'](_0xd981('0x11'),_0x1c8631,'request\x20sent',JSON[_0xd981('0x12')](_0x26da69));if(_0x26da69['error']){if(_0x26da69[_0xd981('0x13')]['code']===0x1f4){logger[_0xd981('0x13')]('Schedule,\x20%s,\x20%s',_0x1c8631,_0x26da69[_0xd981('0x13')][_0xd981('0x14')]);return _0x1f7dd2(_0x26da69['error'][_0xd981('0x14')]);}logger[_0xd981('0x13')](_0xd981('0xf'),_0x1c8631,_0x26da69[_0xd981('0x13')][_0xd981('0x14')]);return _0x3cb96b(_0x26da69[_0xd981('0x13')]['message']);}else{logger[_0xd981('0xe')]('Schedule,\x20%s,\x20%s',_0x1c8631,_0xd981('0x10'));_0x3cb96b(_0x26da69[_0xd981('0x15')]['message']);}})[_0xd981('0x16')](function(_0x1ee0d1){logger[_0xd981('0x13')](_0xd981('0xf'),_0x1c8631,_0x1ee0d1);_0x1f7dd2(_0x1ee0d1);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index f484ada..7921f7c 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 _0x9ee1=['update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','create'];(function(_0x122513,_0x27ebe4){var _0x3fc3bd=function(_0x56f3a2){while(--_0x56f3a2){_0x122513['push'](_0x122513['shift']());}};_0x3fc3bd(++_0x27ebe4);}(_0x9ee1,0xe6));var _0x19ee=function(_0x36e56f,_0x5495cd){_0x36e56f=_0x36e56f-0x0;var _0x15c27f=_0x9ee1[_0x36e56f];return _0x15c27f;};'use strict';var multer=require(_0x19ee('0x0'));var util=require('util');var path=require(_0x19ee('0x1'));var timeout=require(_0x19ee('0x2'));var express=require(_0x19ee('0x3'));var router=express[_0x19ee('0x4')]();var fs_extra=require(_0x19ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19ee('0x6'));var config=require(_0x19ee('0x7'));var controller=require('./screenRecording.controller');router[_0x19ee('0x8')]('/',auth[_0x19ee('0x9')](),controller['index']);router[_0x19ee('0x8')](_0x19ee('0xa'),auth[_0x19ee('0x9')](),controller[_0x19ee('0xb')]);router[_0x19ee('0x8')](_0x19ee('0xc'),auth[_0x19ee('0x9')](),controller[_0x19ee('0xd')]);router[_0x19ee('0x8')](_0x19ee('0xe'),auth[_0x19ee('0x9')](),controller['download']);router[_0x19ee('0xf')]('/',auth[_0x19ee('0x9')](),controller[_0x19ee('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x19ee('0x11')]);router[_0x19ee('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x08b0=['/describe','/:id','show','download','post','create','destroy','exports','connect-timeout','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x4e380c,_0x321a2d){var _0x2e0d40=function(_0x51e140){while(--_0x51e140){_0x4e380c['push'](_0x4e380c['shift']());}};_0x2e0d40(++_0x321a2d);}(_0x08b0,0xb0));var _0x008b=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x08b0[_0x54e6f5];return _0x5e8794;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x008b('0x0'));var express=require(_0x008b('0x1'));var router=express[_0x008b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x008b('0x3'));var controller=require('./screenRecording.controller');router[_0x008b('0x4')]('/',auth[_0x008b('0x5')](),controller['index']);router[_0x008b('0x4')](_0x008b('0x6'),auth[_0x008b('0x5')](),controller['describe']);router['get'](_0x008b('0x7'),auth[_0x008b('0x5')](),controller[_0x008b('0x8')]);router[_0x008b('0x4')]('/:id/download',auth['isAuthenticated'](),controller[_0x008b('0x9')]);router[_0x008b('0xa')]('/',auth[_0x008b('0x5')](),controller[_0x008b('0xb')]);router['put'](_0x008b('0x7'),auth[_0x008b('0x5')](),controller['update']);router['delete'](_0x008b('0x7'),auth[_0x008b('0x5')](),controller[_0x008b('0xc')]);module[_0x008b('0xd')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1c14f11..2e5f927 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 _0x726f=['toString','updatedAt','sequelize','moment','../../config/environment','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1cc2bf,_0x105dff){var _0x2a5489=function(_0x592920){while(--_0x592920){_0x1cc2bf['push'](_0x1cc2bf['shift']());}};_0x2a5489(++_0x105dff);}(_0x726f,0xa2));var _0xf726=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x726f[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xf726('0x0'));var moment=require(_0xf726('0x1'));var path=require('path');var config=require(_0xf726('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf726('0x3')](_0xf726('0x4'))?path[_0xf726('0x5')](this[_0xf726('0x3')](_0xf726('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xf726('0x6')]},'channel':{'type':Sequelize[_0xf726('0x6')]},'value':{'type':Sequelize[_0xf726('0x6')],'set':function(_0x2dd6b8){var _0x2ed93b=_0x2dd6b8[_0xf726('0x7')](/\\/g,'/');this[_0xf726('0x8')](_0xf726('0x4'),_0x2ed93b);}},'rating':{'type':Sequelize[_0xf726('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf726('0x9')],'set':function(_0x45c2a3){this[_0xf726('0x8')]('startedAt',moment()['subtract'](_0x45c2a3,'ms'));this['setDataValue'](_0xf726('0xa'),moment());this['setDataValue']('duration',_0x45c2a3);}},'startedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')]('startedAt'))[_0xf726('0xc')](_0xf726('0xd'))[_0xf726('0xe')]();}},'closedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')](_0xf726('0xa')))[_0xf726('0xc')](_0xf726('0xd'))['toString']();}},'createdAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xf726('0xc')](_0xf726('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')](_0xf726('0xf')))['format'](_0xf726('0xd'))[_0xf726('0xe')]();}}}; \ No newline at end of file +var _0xde3a=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','VIRTUAL'];(function(_0xd09f2b,_0x1ed16a){var _0x2265fa=function(_0x3864b2){while(--_0x3864b2){_0xd09f2b['push'](_0xd09f2b['shift']());}};_0x2265fa(++_0x1ed16a);}(_0xde3a,0x140));var _0xade3=function(_0x3f54f4,_0x71b7a3){_0x3f54f4=_0x3f54f4-0x0;var _0x170ba2=_0xde3a[_0x3f54f4];return _0x170ba2;};'use strict';var Sequelize=require(_0xade3('0x0'));var moment=require(_0xade3('0x1'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0xade3('0x2')],'get':function(){return this[_0xade3('0x3')](_0xade3('0x4'))?path[_0xade3('0x5')](this[_0xade3('0x3')](_0xade3('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xade3('0x6')]},'channel':{'type':Sequelize[_0xade3('0x6')]},'value':{'type':Sequelize[_0xade3('0x6')],'set':function(_0x4b7e03){var _0xe8c0ff=_0x4b7e03[_0xade3('0x7')](/\\/g,'/');this[_0xade3('0x8')](_0xade3('0x4'),_0xe8c0ff);}},'rating':{'type':Sequelize[_0xade3('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xade3('0x9')],'set':function(_0xc08245){this['setDataValue'](_0xade3('0xa'),moment()[_0xade3('0xb')](_0xc08245,'ms'));this[_0xade3('0x8')](_0xade3('0xc'),moment());this[_0xade3('0x8')]('duration',_0xc08245);}},'startedAt':{'type':Sequelize[_0xade3('0xd')],'get':function(){return moment(this[_0xade3('0x3')](_0xade3('0xa')))[_0xade3('0xe')](_0xade3('0xf'))[_0xade3('0x10')]();}},'closedAt':{'type':Sequelize[_0xade3('0xd')],'get':function(){return moment(this[_0xade3('0x3')]('closedAt'))[_0xade3('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xade3('0x10')]();}},'createdAt':{'type':Sequelize[_0xade3('0xd')],'get':function(){return moment(this[_0xade3('0x3')]('createdAt'))['format'](_0xade3('0xf'))[_0xade3('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xade3('0x3')]('updatedAt'))[_0xade3('0xe')](_0xade3('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 249b989..785bc2b 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 _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3f0a3c,_0x5f4c63){var _0x5e8f6e=function(_0x1a3b9a){while(--_0x1a3b9a){_0x3f0a3c['push'](_0x3f0a3c['shift']());}};_0x5e8f6e(++_0x5f4c63);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x7fbe[_0x38c699];return _0x3b1ded;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,null));}; \ No newline at end of file +var _0x3eea=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','Not\x20found','isNil','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys'];(function(_0x252cfc,_0x1e4c46){var _0x5f4b93=function(_0xced9ae){while(--_0xced9ae){_0x252cfc['push'](_0x252cfc['shift']());}};_0x5f4b93(++_0x1e4c46);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2c5e14,_0x2b3f85){_0x2c5e14=_0x2c5e14-0x0;var _0x36e03b=_0x3eea[_0x2c5e14];return _0x36e03b;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x31')](_['map'](_0x3fa094,_0xa3ee('0x27')),['format']);_0x78e581[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x59c6f9['query']);_0x78e581[_0xa3ee('0x34')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x59c6f9[_0xa3ee('0x32')]['fields']));_0x4abf49[_0xa3ee('0x35')]=_0x4abf49[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x4abf49['attributes']:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x39')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x1b')]);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x3a')]=qs[_0xa3ee('0x3b')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3b')]);_0x4abf49[_0xa3ee('0x3c')]=qs[_0xa3ee('0x34')](_[_0xa3ee('0x3d')](_0x59c6f9['query'],_0x78e581[_0xa3ee('0x34')]),_0x3fa094);if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]){_0x4abf49[_0xa3ee('0x3c')]=_['merge'](_0x4abf49[_0xa3ee('0x3c')],{'$or':_[_0xa3ee('0x2a')](_0x3fa094,function(_0x1a9b63){if(_0x1a9b63['type']!==_0xa3ee('0x3f')){var _0x3554eb={};_0x3554eb[_0x1a9b63['name']]={'$like':'%'+_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]+'%'};return _0x3554eb;}})});}_0x4abf49=_['merge']({},_0x4abf49,_0x59c6f9[_0xa3ee('0x40')]);var _0x6dd235={'where':_0x4abf49[_0xa3ee('0x3c')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x6dd235)[_0xa3ee('0x23')](function(_0x2ca04f){_0x481358[_0xa3ee('0x1c')]=_0x2ca04f;if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x41')]){_0x4abf49[_0xa3ee('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x4abf49);})['then'](function(_0x45aeec){_0x481358[_0xa3ee('0x43')]=_0x45aeec;return _0x481358;})['then'](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x44')](handleError(_0x5ba571,null));};exports[_0xa3ee('0x45')]=function(_0x279834,_0x55f47f){var _0x1af10b={'raw':![],'where':{'id':_0x279834[_0xa3ee('0x46')]['id']}},_0x559cc1={};_0x559cc1[_0xa3ee('0x30')]=_[_0xa3ee('0x33')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x559cc1[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x279834[_0xa3ee('0x32')]);_0x559cc1[_0xa3ee('0x34')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],_0x559cc1[_0xa3ee('0x32')]);_0x1af10b[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x279834[_0xa3ee('0x32')][_0xa3ee('0x37')]));_0x1af10b['attributes']=_0x1af10b[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x1af10b[_0xa3ee('0x35')]:_0x559cc1[_0xa3ee('0x30')];if(_0x279834['query'][_0xa3ee('0x41')]){_0x1af10b['include']=[{'all':!![]}];}_0x1af10b=_[_0xa3ee('0x47')]({},_0x1af10b,_0x279834[_0xa3ee('0x40')]);return db[_0xa3ee('0x2b')][_0xa3ee('0x48')](_0x1af10b)[_0xa3ee('0x23')](handleEntityNotFound(_0x55f47f,null))[_0xa3ee('0x23')](respondWithResult(_0x55f47f,null))[_0xa3ee('0x44')](handleError(_0x55f47f,null));};exports[_0xa3ee('0x49')]=function(_0x3c3677,_0xd6160e){return db['ScreenRecording'][_0xa3ee('0x49')](_0x3c3677['body'],{})['then'](respondWithResult(_0xd6160e,0xc9))[_0xa3ee('0x44')](handleError(_0xd6160e,null));};exports[_0xa3ee('0x22')]=function(_0x45029f,_0x1ec479){if(_0x45029f[_0xa3ee('0x4a')]['id']){delete _0x45029f[_0xa3ee('0x4a')]['id'];}delete _0x45029f[_0xa3ee('0x4a')]['duration'];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4b')];delete _0x45029f['body'][_0xa3ee('0x4c')];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x45029f[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x1ec479,null))[_0xa3ee('0x23')](saveUpdates(_0x45029f[_0xa3ee('0x4a')],null))[_0xa3ee('0x23')](respondWithResult(_0x1ec479,null))['catch'](handleError(_0x1ec479,null));};exports['describe']=function(_0x15b55e,_0x441b23){return db['ScreenRecording'][_0xa3ee('0x4e')]()[_0xa3ee('0x23')](respondWithResult(_0x441b23,null))[_0xa3ee('0x44')](handleError(_0x441b23,null));};exports['download']=function(_0x505444,_0x2388f7,_0x49057c){var _0x172a73=require(_0xa3ee('0x4f'));var _0x5b8e79=![];var _0x4232e0={};if(_0x505444[_0xa3ee('0x32')][_0xa3ee('0x2e')]&&_0x505444['query'][_0xa3ee('0x2e')]===_0xa3ee('0x50')){_0x4232e0['uniqueid']=_0x505444[_0xa3ee('0x46')]['id'];}else{_0x4232e0['id']=_0x505444[_0xa3ee('0x46')]['id'];}return db[_0xa3ee('0x2b')]['find']({'where':_0x4232e0,'attributes':['id','value'],'raw':!![]})[_0xa3ee('0x23')](handleEntityNotFound(_0x2388f7,null))[_0xa3ee('0x23')](function(_0x4a1a2f){if(_0x4a1a2f){var _0x1f9913=path[_0xa3ee('0x51')](config['root'],'server/files/screen_recordings',_0x4a1a2f[_0xa3ee('0x4d')]);var _0x659491=util[_0xa3ee('0x52')]('%s.cypher',_0x1f9913);if(fs[_0xa3ee('0x53')](_0x659491)){_0x5b8e79=!![];return _0x172a73[_0xa3ee('0x54')](_0x659491,_0x1f9913,config[_0xa3ee('0x55')][_0xa3ee('0x56')])[_0xa3ee('0x23')](function(){return _0x4a1a2f;});}return _0x4a1a2f;}})[_0xa3ee('0x23')](function(_0x497be4){if(_0x497be4){var _0x10f508=path[_0xa3ee('0x51')](config['root'],_0xa3ee('0x57'),_0x497be4[_0xa3ee('0x4d')]);if(!fs[_0xa3ee('0x53')](_0x10f508)){throw new db[(_0xa3ee('0x58'))][(_0xa3ee('0x59'))](_0xa3ee('0x5a'));}if(_0x497be4['filename']){return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,_0x497be4[_0xa3ee('0x5c')]+path[_0xa3ee('0x5d')](_0x10f508),function(){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}else{return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,function(_0x13b81b){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}}})['catch'](function(_0x4df186){if(_0x4df186['message']===_0xa3ee('0x5a')){_0x2388f7[_0xa3ee('0x1d')](0x194)[_0xa3ee('0x28')](_0xa3ee('0x5e'));}else{return handleError(_0x2388f7,null);}});};exports[_0xa3ee('0x24')]=function(_0x18a164,_0x4000ee){return db['ScreenRecording'][_0xa3ee('0x48')]({'where':{'id':_0x18a164[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](function(_0xaff641){if(_[_0xa3ee('0x5f')](_0xaff641)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaff641;})['then'](function(_0x7b1e97){var _0x303b71=path[_0xa3ee('0x51')](config[_0xa3ee('0x60')],_0xa3ee('0x57'),_0x7b1e97[_0xa3ee('0x4d')]);logger[_0xa3ee('0x61')](_0xa3ee('0x62'),_0x303b71);if(!_[_0xa3ee('0x5f')](_0x7b1e97[_0xa3ee('0x4d')])&&fs[_0xa3ee('0x53')](_0x303b71)){logger[_0xa3ee('0x61')](_0xa3ee('0x63')+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}_0x303b71=_0x303b71+'.cypher';if(!_[_0xa3ee('0x5f')](_0x7b1e97['value'])&&fs['existsSync'](_0x303b71)){logger[_0xa3ee('0x61')]('File:\x20\x22'+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}return _0x7b1e97;})[_0xa3ee('0x23')](function(_0x221deb){if(!_0x221deb)throw new InternalError();return _0x221deb['destroy']();})[_0xa3ee('0x23')](function(){_0x4000ee[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();})[_0xa3ee('0x44')](handleError(_0x4000ee,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 77ca80c..08709dc 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 _0xa2c0=['rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','request-promise','path'];(function(_0x4b6709,_0x21f365){var _0x59b6d3=function(_0x23ac38){while(--_0x23ac38){_0x4b6709['push'](_0x4b6709['shift']());}};_0x59b6d3(++_0x21f365);}(_0xa2c0,0x1db));var _0x0a2c=function(_0x191082,_0x560831){_0x191082=_0x191082-0x0;var _0x2064a5=_0xa2c0[_0x191082];return _0x2064a5;};'use strict';var _=require(_0x0a2c('0x0'));var util=require(_0x0a2c('0x1'));var logger=require('../../config/logger')(_0x0a2c('0x2'));var moment=require(_0x0a2c('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a2c('0x4'));var fs=require('fs');var path=require(_0x0a2c('0x5'));var rimraf=require(_0x0a2c('0x6'));var config=require('../../config/environment');var attributes=require(_0x0a2c('0x7'));module[_0x0a2c('0x8')]=function(_0x1ee884,_0x57251b){return _0x1ee884[_0x0a2c('0x9')](_0x0a2c('0xa'),attributes,{'tableName':_0x0a2c('0xb'),'paranoid':![],'indexes':[{'name':_0x0a2c('0xc'),'fields':[_0x0a2c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa07=['./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5be7c6,_0x31ef8b){var _0x58704d=function(_0xdba1f6){while(--_0xdba1f6){_0x5be7c6['push'](_0x5be7c6['shift']());}};_0x58704d(++_0x31ef8b);}(_0xfa07,0x119));var _0x7fa0=function(_0x5c3f50,_0x499da7){_0x5c3f50=_0x5c3f50-0x0;var _0x957d2f=_0xfa07[_0x5c3f50];return _0x957d2f;};'use strict';var _=require('lodash');var util=require(_0x7fa0('0x0'));var logger=require(_0x7fa0('0x1'))(_0x7fa0('0x2'));var moment=require(_0x7fa0('0x3'));var BPromise=require('bluebird');var rp=require(_0x7fa0('0x4'));var fs=require('fs');var path=require(_0x7fa0('0x5'));var rimraf=require(_0x7fa0('0x6'));var config=require('../../config/environment');var attributes=require(_0x7fa0('0x7'));module['exports']=function(_0x17b95a,_0x118ac4){return _0x17b95a[_0x7fa0('0x8')](_0x7fa0('0x9'),attributes,{'tableName':_0x7fa0('0xa'),'paranoid':![],'indexes':[{'name':_0x7fa0('0xb'),'fields':[_0x7fa0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index d41b269..6a1eed3 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 _0x2274=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0xe1d0bd,_0x341b81){var _0x330fc2=function(_0x302a5c){while(--_0x302a5c){_0xe1d0bd['push'](_0xe1d0bd['shift']());}};_0x330fc2(++_0x341b81);}(_0x2274,0x10e));var _0x4227=function(_0x17d0bf,_0x5d9d60){_0x17d0bf=_0x17d0bf-0x0;var _0x45c9f9=_0x2274[_0x17d0bf];return _0x45c9f9;};'use strict';var _=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var moment=require(_0x4227('0x2'));var BPromise=require(_0x4227('0x3'));var rs=require(_0x4227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4227('0x5'));var logger=require(_0x4227('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4227('0x7'));var client=jayson[_0x4227('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x599ddf,_0x2500b4,_0x321a43){return new BPromise(function(_0x3322ff,_0x6222c7){return client['request'](_0x599ddf,_0x321a43)[_0x4227('0x9')](function(_0x4726ce){logger[_0x4227('0xa')](_0x4227('0xb'),_0x2500b4,'request\x20sent');logger['debug'](_0x4227('0xc'),_0x2500b4,_0x4227('0xd'),JSON[_0x4227('0xe')](_0x4726ce));if(_0x4726ce[_0x4227('0xf')]){if(_0x4726ce[_0x4227('0xf')]['code']===0x1f4){logger[_0x4227('0xf')](_0x4227('0xb'),_0x2500b4,_0x4726ce[_0x4227('0xf')]['message']);return _0x6222c7(_0x4726ce[_0x4227('0xf')][_0x4227('0x10')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2500b4,_0x4726ce['error']['message']);return _0x3322ff(_0x4726ce[_0x4227('0xf')][_0x4227('0x10')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x2500b4,_0x4227('0xd'));_0x3322ff(_0x4726ce[_0x4227('0x11')][_0x4227('0x10')]);}})['catch'](function(_0x101fde){logger[_0x4227('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x2500b4,_0x101fde);_0x6222c7(_0x101fde);});});} \ No newline at end of file +var _0x1e97=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0x1e97,0x196));var _0x71e9=function(_0x3cbd84,_0xea3669){_0x3cbd84=_0x3cbd84-0x0;var _0x1aa334=_0x1e97[_0x3cbd84];return _0x1aa334;};'use strict';var _=require(_0x71e9('0x0'));var util=require('util');var moment=require(_0x71e9('0x1'));var BPromise=require(_0x71e9('0x2'));var rs=require(_0x71e9('0x3'));var fs=require('fs');var Redis=require(_0x71e9('0x4'));var db=require(_0x71e9('0x5'))['db'];var utils=require(_0x71e9('0x6'));var logger=require('../../config/logger')(_0x71e9('0x7'));var config=require(_0x71e9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x71e9('0x9')][_0x71e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1114,_0xc51ae1,_0x266cb4){return new BPromise(function(_0x345ae,_0x2a7c66){return client[_0x71e9('0xb')](_0x3e1114,_0x266cb4)[_0x71e9('0xc')](function(_0x4e1b9e){logger[_0x71e9('0xd')](_0x71e9('0xe'),_0xc51ae1,_0x71e9('0xf'));logger[_0x71e9('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xc51ae1,_0x71e9('0xf'),JSON['stringify'](_0x4e1b9e));if(_0x4e1b9e[_0x71e9('0x11')]){if(_0x4e1b9e[_0x71e9('0x11')][_0x71e9('0x12')]===0x1f4){logger[_0x71e9('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xc51ae1,_0x4e1b9e[_0x71e9('0x11')]['message']);return _0x2a7c66(_0x4e1b9e[_0x71e9('0x11')][_0x71e9('0x13')]);}logger[_0x71e9('0x11')](_0x71e9('0xe'),_0xc51ae1,_0x4e1b9e[_0x71e9('0x11')]['message']);return _0x345ae(_0x4e1b9e[_0x71e9('0x11')][_0x71e9('0x13')]);}else{logger[_0x71e9('0xd')](_0x71e9('0xe'),_0xc51ae1,'request\x20sent');_0x345ae(_0x4e1b9e['result'][_0x71e9('0x13')]);}})[_0x71e9('0x14')](function(_0x59be3e){logger[_0x71e9('0x11')](_0x71e9('0xe'),_0xc51ae1,_0x59be3e);_0x2a7c66(_0x59be3e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 47265ad..f21ac7a 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 _0xc158=['getLogo','/:id/logo_login','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','post','single','file','addLogo','logologin','extname','originalname','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo'];(function(_0x3e44c4,_0x167f56){var _0x322738=function(_0x414ddf){while(--_0x414ddf){_0x3e44c4['push'](_0x3e44c4['shift']());}};_0x322738(++_0x167f56);}(_0xc158,0x18c));var _0x8c15=function(_0x4cdfb5,_0x58ce18){_0x4cdfb5=_0x4cdfb5-0x0;var _0x5ca496=_0xc158[_0x4cdfb5];return _0x5ca496;};'use strict';var multer=require('multer');var util=require(_0x8c15('0x0'));var path=require('path');var timeout=require(_0x8c15('0x1'));var express=require(_0x8c15('0x2'));var router=express[_0x8c15('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8c15('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8c15('0x5'));var controller=require(_0x8c15('0x6'));router[_0x8c15('0x7')]('/',auth[_0x8c15('0x8')](),controller[_0x8c15('0x9')]);router[_0x8c15('0x7')](_0x8c15('0xa'),controller['getDate']);router[_0x8c15('0x7')](_0x8c15('0xb'),controller[_0x8c15('0xc')]);router[_0x8c15('0x7')](_0x8c15('0xd'),controller[_0x8c15('0xe')]);router[_0x8c15('0x7')](_0x8c15('0xf'),controller['getLogoLogin']);router[_0x8c15('0x7')](_0x8c15('0x10'),controller['gdpr']);router[_0x8c15('0x7')]('/:id/preferred',controller[_0x8c15('0x11')]);router[_0x8c15('0x7')](_0x8c15('0x12'),controller[_0x8c15('0x13')]);var upload=multer({'storage':multer[_0x8c15('0x14')]({'destination':function(_0x1dda08,_0x5688dd,_0x348200){_0x348200(null,path[_0x8c15('0x15')](config[_0x8c15('0x16')],_0x8c15('0x17')));},'filename':function(_0x59478e,_0x263559,_0x11fbe3){_0x11fbe3(null,util[_0x8c15('0x18')](_0x8c15('0x19'),_0x8c15('0x1a'),path['extname'](_0x263559['originalname'])));}})});router[_0x8c15('0x1b')](_0x8c15('0xd'),upload[_0x8c15('0x1c')](_0x8c15('0x1d')),controller[_0x8c15('0x1e')]);var upload=multer({'storage':multer[_0x8c15('0x14')]({'destination':function(_0x2e4521,_0x1b88c5,_0x375fbb){_0x375fbb(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x2cf18d,_0x58c307,_0x10c050){_0x10c050(null,util[_0x8c15('0x18')](_0x8c15('0x19'),_0x8c15('0x1f'),path[_0x8c15('0x20')](_0x58c307[_0x8c15('0x21')])));}})});router[_0x8c15('0x1b')](_0x8c15('0xf'),upload[_0x8c15('0x1c')]('file'),controller[_0x8c15('0x22')]);var upload=multer({'storage':multer[_0x8c15('0x14')]({'destination':function(_0xa85bb0,_0x2cf260,_0x153f86){_0x153f86(null,path[_0x8c15('0x15')](config[_0x8c15('0x16')],'server/files/images/logos/'));},'filename':function(_0x43ffa7,_0x119362,_0x3a282e){_0x3a282e(null,util['format'](_0x8c15('0x19'),_0x8c15('0x23'),path['extname'](_0x119362[_0x8c15('0x21')])));}})});router[_0x8c15('0x1b')]('/:id/preferred',upload[_0x8c15('0x1c')](_0x8c15('0x1d')),controller[_0x8c15('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52116e,_0x54abe6,_0x59698b){_0x59698b(null,path['join'](config['root'],_0x8c15('0x17')));},'filename':function(_0x4fff20,_0x3e622e,_0x53b774){_0x53b774(null,util[_0x8c15('0x18')]('%s%s',_0x8c15('0x25'),path[_0x8c15('0x20')](_0x3e622e[_0x8c15('0x21')])));}})});router[_0x8c15('0x1b')](_0x8c15('0x12'),upload[_0x8c15('0x1c')](_0x8c15('0x1d')),controller[_0x8c15('0x26')]);router[_0x8c15('0x27')]('/:id',auth[_0x8c15('0x8')](),controller['update']);module[_0x8c15('0x28')]=router; \ No newline at end of file +var _0x05cb=['logo','extname','originalname','post','file','addLogo','join','logologin','addLogoLogin','preferred','/:id/preferred','single','addFavicon','put','/:id','update','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/favicon','diskStorage','root','server/files/images/logos/','format','%s%s'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x05cb,0x88));var _0xb05c=function(_0xd75585,_0x516721){_0xd75585=_0xd75585-0x0;var _0x6abf33=_0x05cb[_0xd75585];return _0x6abf33;};'use strict';var multer=require(_0xb05c('0x0'));var util=require(_0xb05c('0x1'));var path=require(_0xb05c('0x2'));var timeout=require(_0xb05c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb05c('0x4'));var interaction=require(_0xb05c('0x5'));var config=require(_0xb05c('0x6'));var controller=require(_0xb05c('0x7'));router[_0xb05c('0x8')]('/',auth[_0xb05c('0x9')](),controller[_0xb05c('0xa')]);router[_0xb05c('0x8')](_0xb05c('0xb'),controller[_0xb05c('0xc')]);router[_0xb05c('0x8')]('/:id',controller[_0xb05c('0xd')]);router[_0xb05c('0x8')](_0xb05c('0xe'),controller[_0xb05c('0xf')]);router[_0xb05c('0x8')](_0xb05c('0x10'),controller[_0xb05c('0x11')]);router[_0xb05c('0x8')]('/:id/gdpr',controller['gdpr']);router[_0xb05c('0x8')]('/:id/preferred',controller['getPreferred']);router['get'](_0xb05c('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0xb05c('0x13')]({'destination':function(_0x5474e8,_0x11dff6,_0x3d5973){_0x3d5973(null,path['join'](config[_0xb05c('0x14')],_0xb05c('0x15')));},'filename':function(_0x5d07bb,_0x13af34,_0x53ffe9){_0x53ffe9(null,util[_0xb05c('0x16')](_0xb05c('0x17'),_0xb05c('0x18'),path[_0xb05c('0x19')](_0x13af34[_0xb05c('0x1a')])));}})});router[_0xb05c('0x1b')](_0xb05c('0xe'),upload['single'](_0xb05c('0x1c')),controller[_0xb05c('0x1d')]);var upload=multer({'storage':multer[_0xb05c('0x13')]({'destination':function(_0x27cd7a,_0x3095cc,_0x2d7e8e){_0x2d7e8e(null,path[_0xb05c('0x1e')](config[_0xb05c('0x14')],_0xb05c('0x15')));},'filename':function(_0x1b7785,_0x13b68a,_0x453cdc){_0x453cdc(null,util[_0xb05c('0x16')](_0xb05c('0x17'),_0xb05c('0x1f'),path[_0xb05c('0x19')](_0x13b68a[_0xb05c('0x1a')])));}})});router[_0xb05c('0x1b')](_0xb05c('0x10'),upload['single']('file'),controller[_0xb05c('0x20')]);var upload=multer({'storage':multer[_0xb05c('0x13')]({'destination':function(_0x46a406,_0x22bea6,_0x3af3bb){_0x3af3bb(null,path[_0xb05c('0x1e')](config[_0xb05c('0x14')],'server/files/images/logos/'));},'filename':function(_0x4323f9,_0x5ad9f9,_0x396789){_0x396789(null,util[_0xb05c('0x16')](_0xb05c('0x17'),_0xb05c('0x21'),path[_0xb05c('0x19')](_0x5ad9f9[_0xb05c('0x1a')])));}})});router['post'](_0xb05c('0x22'),upload['single'](_0xb05c('0x1c')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe8e19d,_0x18305d,_0x705dc8){_0x705dc8(null,path[_0xb05c('0x1e')](config[_0xb05c('0x14')],_0xb05c('0x15')));},'filename':function(_0x4c5803,_0x14859e,_0x596b20){_0x596b20(null,util['format'](_0xb05c('0x17'),'favicon',path[_0xb05c('0x19')](_0x14859e['originalname'])));}})});router['post']('/:id/favicon',upload[_0xb05c('0x23')](_0xb05c('0x1c')),controller[_0xb05c('0x24')]);router[_0xb05c('0x25')](_0xb05c('0x26'),auth[_0xb05c('0x9')](),controller[_0xb05c('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 28b572c..a2bd46b 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 _0xf951=['/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x294e64,_0x22460a){var _0x42b05b=function(_0x1b4b93){while(--_0x1b4b93){_0x294e64['push'](_0x294e64['shift']());}};_0x42b05b(++_0x22460a);}(_0xf951,0x1a4));var _0x1f95=function(_0x13f2b7,_0x224502){_0x13f2b7=_0x13f2b7-0x0;var _0x59c0d6=_0xf951[_0x13f2b7];return _0x59c0d6;};'use strict';var Sequelize=require(_0x1f95('0x0'));module[_0x1f95('0x1')]={'min_internal':{'type':Sequelize[_0x1f95('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1f95('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1f95('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x1f95('0x3')},'logo':{'type':Sequelize[_0x1f95('0x4')]},'defaultLogo':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1f95('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x1f95('0x4')]},'turnusername':{'type':Sequelize[_0x1f95('0x4')]},'turnpassword':{'type':Sequelize[_0x1f95('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1f95('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1f95('0x4')],'defaultValue':_0x1f95('0x6')},'enableEmailPreview':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1f95('0x4')],'defaultValue':_0x1f95('0x7')},'chatTimeout':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1f95('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1f95('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1f95('0x2')]},'transcribeRegion':{'type':Sequelize[_0x1f95('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1f95('0x2')]},'sentimentRegion':{'type':Sequelize[_0x1f95('0x4')]},'language':{'type':Sequelize[_0x1f95('0x4')]},'bucket':{'type':Sequelize[_0x1f95('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x1f95('0x2')](0x2)[_0x1f95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1f95('0x2')](0x2)[_0x1f95('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1f95('0x2')](0x2)[_0x1f95('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1f95('0x2')](0x2)[_0x1f95('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1f95('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x1f95('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x1599=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x1599,0xd8));var _0x9159=function(_0x155bd6,_0x28ed03){_0x155bd6=_0x155bd6-0x0;var _0x5b18d5=_0x1599[_0x155bd6];return _0x5b18d5;};'use strict';var Sequelize=require(_0x9159('0x0'));module[_0x9159('0x1')]={'min_internal':{'type':Sequelize[_0x9159('0x2')](0xb),'unique':_0x9159('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x9159('0x2')](0xb),'unique':_0x9159('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x9159('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x9159('0x5')],'defaultValue':_0x9159('0x6')},'logo':{'type':Sequelize[_0x9159('0x5')]},'defaultLogo':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x9159('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x9159('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x9159('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x9159('0x5')]},'turnpassword':{'type':Sequelize[_0x9159('0x5')]},'pageTitle':{'type':Sequelize[_0x9159('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x9159('0x5')],'defaultValue':_0x9159('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x9159('0x5')],'defaultValue':_0x9159('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x9159('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x9159('0x5')]},'defaultFavicon':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x9159('0x2')]},'transcribeRegion':{'type':Sequelize[_0x9159('0x5')]},'sentiment':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9159('0x5')]},'bucket':{'type':Sequelize[_0x9159('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x9159('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x9159('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x9159('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x9159('0x2')](0x2)[_0x9159('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x9159('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x9159('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x9159('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 3aa2eef..4026e3c 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 _0xd3e3=['../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','offset','limit','count','Content-Range','apply','reject','update','sendStatus','stack','name','send','index','map','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','type','VIRTUAL','filter','options','Setting','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','getLogoLogin','default_loginLogo.svg','\x20not\x20found','download','securePassword','addPreferred','getPreferred','preferred','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','moment','bluebird','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x295eef,_0x26b782){var _0xbc16d4=function(_0x364277){while(--_0x364277){_0x295eef['push'](_0x295eef['shift']());}};_0xbc16d4(++_0x26b782);}(_0xd3e3,0x1c9));var _0x3d3e=function(_0x4f4b55,_0x31cbd6){_0x4f4b55=_0x4f4b55-0x0;var _0x36fbf9=_0xd3e3[_0x4f4b55];return _0x36fbf9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d3e('0x0'));var zipdir=require(_0x3d3e('0x1'));var jsonpatch=require(_0x3d3e('0x2'));var rp=require('request-promise');var moment=require(_0x3d3e('0x3'));var BPromise=require(_0x3d3e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3d3e('0x5'));var csv=require('to-csv');var ejs=require(_0x3d3e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d3e('0x7'));var jsforce=require(_0x3d3e('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x3d3e('0x9'));var querystring=require('querystring');var Papa=require(_0x3d3e('0xa'));var Redis=require(_0x3d3e('0xb'));var authService=require(_0x3d3e('0xc'));var qs=require(_0x3d3e('0xd'));var as=require(_0x3d3e('0xe'));var hardwareService=require(_0x3d3e('0xf'));var logger=require(_0x3d3e('0x10'))('api');var utils=require(_0x3d3e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3e('0x12'));var db=require(_0x3d3e('0x13'))['db'];var jayson=require(_0x3d3e('0x14'));var client=jayson[_0x3d3e('0x15')][_0x3d3e('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5dc667,_0x253c3e,_0x237e67,_0x28baba){return new BPromise(function(_0x3bc858,_0x415836){var _0x4eaaf5=_0x28baba||client;return _0x4eaaf5[_0x3d3e('0x17')](_0x5dc667,_0x237e67)[_0x3d3e('0x18')](function(_0x2957f0){logger[_0x3d3e('0x19')](_0x3d3e('0x1a'),_0x253c3e,_0x3d3e('0x1b'));logger[_0x3d3e('0x1c')](_0x3d3e('0x1d'),_0x253c3e,'request\x20sent',JSON[_0x3d3e('0x1e')](_0x2957f0));if(_0x2957f0['error']){if(_0x2957f0[_0x3d3e('0x1f')][_0x3d3e('0x20')]===0x1f4){logger['error'](_0x3d3e('0x1a'),_0x253c3e,_0x2957f0[_0x3d3e('0x1f')][_0x3d3e('0x21')]);return _0x415836(_0x2957f0['error'][_0x3d3e('0x21')]);}logger['error'](_0x3d3e('0x1a'),_0x253c3e,_0x2957f0[_0x3d3e('0x1f')][_0x3d3e('0x21')]);return _0x3bc858(_0x2957f0[_0x3d3e('0x1f')]['message']);}else{logger[_0x3d3e('0x19')]('Setting,\x20%s,\x20%s',_0x253c3e,'request\x20sent');_0x3bc858(_0x2957f0[_0x3d3e('0x22')]['message']);}})['catch'](function(_0x5cb730){logger[_0x3d3e('0x1f')](_0x3d3e('0x1a'),_0x253c3e,_0x5cb730);_0x415836(_0x5cb730);});});}function respondWithStatusCode(_0x4ff236,_0xe3c9da){_0xe3c9da=_0xe3c9da||0xcc;return function(_0x1197fc){if(_0x1197fc){return _0x4ff236['sendStatus'](_0xe3c9da);}return _0x4ff236[_0x3d3e('0x23')](_0xe3c9da)[_0x3d3e('0x24')]();};}function respondWithResult(_0x593d28,_0x3e44c6){_0x3e44c6=_0x3e44c6||0xc8;return function(_0x2de181){if(_0x2de181){return _0x593d28[_0x3d3e('0x23')](_0x3e44c6)['json'](_0x2de181);}};}function respondWithFilteredResult(_0x360c84,_0x36e96a){return function(_0x2a5fe2){if(_0x2a5fe2){var _0x5eaafc=typeof _0x36e96a[_0x3d3e('0x25')]==='undefined'&&typeof _0x36e96a[_0x3d3e('0x26')]==='undefined';var _0x513624=_0x2a5fe2[_0x3d3e('0x27')];var _0x1a3a06=_0x5eaafc?0x0:_0x36e96a[_0x3d3e('0x25')];var _0x42b9b5=_0x5eaafc?_0x2a5fe2[_0x3d3e('0x27')]:_0x36e96a[_0x3d3e('0x25')]+_0x36e96a[_0x3d3e('0x26')];var _0x2fb8f4;if(_0x42b9b5>=_0x513624){_0x42b9b5=_0x513624;_0x2fb8f4=0xc8;}else{_0x2fb8f4=0xce;}_0x360c84[_0x3d3e('0x23')](_0x2fb8f4);return _0x360c84['set'](_0x3d3e('0x28'),_0x1a3a06+'-'+_0x42b9b5+'/'+_0x513624)['json'](_0x2a5fe2);}return null;};}function patchUpdates(_0x79e850){return function(_0x5a5ef5){try{jsonpatch[_0x3d3e('0x29')](_0x5a5ef5,_0x79e850,!![]);}catch(_0xb1be3b){return BPromise[_0x3d3e('0x2a')](_0xb1be3b);}return _0x5a5ef5['save']();};}function saveUpdates(_0x1cc45,_0xe44fdb){return function(_0x378dc0){if(_0x378dc0){return _0x378dc0[_0x3d3e('0x2b')](_0x1cc45)[_0x3d3e('0x18')](function(_0x13ddc7){return _0x13ddc7;});}return null;};}function removeEntity(_0xe41fb3,_0x23816d){return function(_0x1f929c){if(_0x1f929c){return _0x1f929c['destroy']()[_0x3d3e('0x18')](function(){_0xe41fb3[_0x3d3e('0x23')](0xcc)[_0x3d3e('0x24')]();});}};}function handleEntityNotFound(_0x4f9e24,_0x534643){return function(_0xb8eac){if(!_0xb8eac){_0x4f9e24[_0x3d3e('0x2c')](0x194);}return _0xb8eac;};}function handleError(_0x3c120a,_0x27b26c){_0x27b26c=_0x27b26c||0x1f4;return function(_0xaff8c3){logger[_0x3d3e('0x1f')](_0xaff8c3[_0x3d3e('0x2d')]);if(_0xaff8c3[_0x3d3e('0x2e')]){delete _0xaff8c3['name'];}_0x3c120a['status'](_0x27b26c)[_0x3d3e('0x2f')](_0xaff8c3);};}exports[_0x3d3e('0x30')]=function(_0x5a47cc,_0x40d53c){var _0x40abb6={},_0x25de0b={},_0x5a3a6f={'count':0x0,'rows':[]};var _0x48c9c0=_[_0x3d3e('0x31')](db['Setting']['rawAttributes'],function(_0x133749){return{'name':_0x133749['fieldName'],'type':_0x133749['type'][_0x3d3e('0x32')]};});_0x25de0b['model']=_['map'](_0x48c9c0,_0x3d3e('0x2e'));_0x25de0b[_0x3d3e('0x33')]=_[_0x3d3e('0x34')](_0x5a47cc[_0x3d3e('0x33')]);_0x25de0b[_0x3d3e('0x35')]=_[_0x3d3e('0x36')](_0x25de0b['model'],_0x25de0b[_0x3d3e('0x33')]);_0x40abb6[_0x3d3e('0x37')]=_[_0x3d3e('0x36')](_0x25de0b[_0x3d3e('0x38')],qs[_0x3d3e('0x39')](_0x5a47cc[_0x3d3e('0x33')][_0x3d3e('0x39')]));_0x40abb6[_0x3d3e('0x37')]=_0x40abb6['attributes'][_0x3d3e('0x3a')]?_0x40abb6[_0x3d3e('0x37')]:_0x25de0b[_0x3d3e('0x38')];if(!_0x5a47cc[_0x3d3e('0x33')][_0x3d3e('0x3b')]('nolimit')){_0x40abb6[_0x3d3e('0x26')]=qs[_0x3d3e('0x26')](_0x5a47cc['query'][_0x3d3e('0x26')]);_0x40abb6[_0x3d3e('0x25')]=qs[_0x3d3e('0x25')](_0x5a47cc[_0x3d3e('0x33')][_0x3d3e('0x25')]);}_0x40abb6['order']=qs['sort'](_0x5a47cc['query'][_0x3d3e('0x3c')]);_0x40abb6[_0x3d3e('0x3d')]=qs[_0x3d3e('0x35')](_[_0x3d3e('0x3e')](_0x5a47cc['query'],_0x25de0b[_0x3d3e('0x35')]),_0x48c9c0);if(_0x5a47cc['query']['filter']){_0x40abb6[_0x3d3e('0x3d')]=_['merge'](_0x40abb6['where'],{'$or':_[_0x3d3e('0x31')](_0x48c9c0,function(_0x2d29a0){if(_0x2d29a0[_0x3d3e('0x3f')]!==_0x3d3e('0x40')){var _0x38ab03={};_0x38ab03[_0x2d29a0[_0x3d3e('0x2e')]]={'$like':'%'+_0x5a47cc[_0x3d3e('0x33')][_0x3d3e('0x41')]+'%'};return _0x38ab03;}})});}_0x40abb6=_['merge']({},_0x40abb6,_0x5a47cc[_0x3d3e('0x42')]);var _0x4d3bb5={'where':_0x40abb6['where']};return db[_0x3d3e('0x43')][_0x3d3e('0x27')](_0x4d3bb5)[_0x3d3e('0x18')](function(_0x518c30){_0x5a3a6f[_0x3d3e('0x27')]=_0x518c30;if(_0x5a47cc[_0x3d3e('0x33')][_0x3d3e('0x44')]){_0x40abb6[_0x3d3e('0x45')]=[{'all':!![]}];}return db[_0x3d3e('0x43')][_0x3d3e('0x46')](_0x40abb6);})[_0x3d3e('0x18')](function(_0x5a018f){_0x5a3a6f[_0x3d3e('0x47')]=_0x5a018f;return _0x5a3a6f;})['then'](respondWithFilteredResult(_0x40d53c,_0x40abb6))[_0x3d3e('0x48')](handleError(_0x40d53c,null));};exports['show']=function(_0x5cdadf,_0x478ed9){var _0x45c936={'raw':![],'where':{'id':_0x5cdadf[_0x3d3e('0x49')]['id']}},_0x58985a={};_0x58985a[_0x3d3e('0x38')]=_[_0x3d3e('0x34')](db['Setting'][_0x3d3e('0x4a')]);_0x58985a['query']=_[_0x3d3e('0x34')](_0x5cdadf['query']);_0x58985a[_0x3d3e('0x35')]=_['intersection'](_0x58985a[_0x3d3e('0x38')],_0x58985a[_0x3d3e('0x33')]);_0x45c936[_0x3d3e('0x37')]=_[_0x3d3e('0x36')](_0x58985a[_0x3d3e('0x38')],qs[_0x3d3e('0x39')](_0x5cdadf['query']['fields']));_0x45c936[_0x3d3e('0x37')]=_0x45c936[_0x3d3e('0x37')][_0x3d3e('0x3a')]?_0x45c936[_0x3d3e('0x37')]:_0x58985a[_0x3d3e('0x38')];if(_0x5cdadf[_0x3d3e('0x33')][_0x3d3e('0x44')]){_0x45c936['include']=[{'all':!![]}];}_0x45c936=_[_0x3d3e('0x4b')]({},_0x45c936,_0x5cdadf[_0x3d3e('0x42')]);return db[_0x3d3e('0x43')][_0x3d3e('0x4c')](_0x45c936)['then'](handleEntityNotFound(_0x478ed9,null))[_0x3d3e('0x18')](respondWithResult(_0x478ed9,null))[_0x3d3e('0x48')](handleError(_0x478ed9,null));};exports['update']=function(_0x43e136,_0x4ca8ac){if(_0x43e136[_0x3d3e('0x4d')]['id']){delete _0x43e136[_0x3d3e('0x4d')]['id'];}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x43e136[_0x3d3e('0x49')]['id']}})[_0x3d3e('0x18')](handleEntityNotFound(_0x4ca8ac,null))['then'](saveUpdates(_0x43e136['body'],null))[_0x3d3e('0x18')](respondWithResult(_0x4ca8ac,null))[_0x3d3e('0x48')](handleError(_0x4ca8ac,null));};exports[_0x3d3e('0x4e')]=function(_0x32e10f,_0x1da0db,_0xa6c50){if(_0x32e10f['file']&&_0x32e10f[_0x3d3e('0x4f')][_0x3d3e('0x50')]){_0x32e10f[_0x3d3e('0x4d')][_0x3d3e('0x51')]=_0x32e10f[_0x3d3e('0x4f')][_0x3d3e('0x50')];}return db[_0x3d3e('0x43')]['find']({'where':{'id':_0x32e10f[_0x3d3e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1da0db,null))[_0x3d3e('0x18')](saveUpdates(_0x32e10f[_0x3d3e('0x4d')],null))['then'](respondWithResult(_0x1da0db,null))[_0x3d3e('0x48')](handleError(_0x1da0db,null));};exports[_0x3d3e('0x52')]=function(_0x8dd49b,_0x9e9798,_0x52a231){if(_0x8dd49b[_0x3d3e('0x4f')]&&_0x8dd49b[_0x3d3e('0x4f')]['filename']){_0x8dd49b[_0x3d3e('0x4d')][_0x3d3e('0x53')]=_0x8dd49b[_0x3d3e('0x4f')]['filename'];}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x8dd49b['params']['id']}})[_0x3d3e('0x18')](handleEntityNotFound(_0x9e9798,null))[_0x3d3e('0x18')](saveUpdates(_0x8dd49b[_0x3d3e('0x4d')],null))['then'](respondWithResult(_0x9e9798,null))[_0x3d3e('0x48')](handleError(_0x9e9798,null));};var utilLicense=require(_0x3d3e('0x12'));exports[_0x3d3e('0x54')]=function(_0x536064,_0x18724a,_0x1322e9){var _0x59f287=_0x3d3e('0x55');var _0x2e733c={'custom':![]};return utilLicense[_0x3d3e('0x56')]()[_0x3d3e('0x18')](function(_0x195428){if(_0x195428){_0x2e733c=_0x195428;}return db['Setting'][_0x3d3e('0x4c')]({'where':{'id':_0x536064[_0x3d3e('0x49')]['id']},'attributes':[_0x3d3e('0x51'),_0x3d3e('0x53'),'preferred',_0x3d3e('0x57'),_0x3d3e('0x58'),_0x3d3e('0x59'),_0x3d3e('0x5a'),_0x3d3e('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x18724a,null))[_0x3d3e('0x18')](function(_0x3a3ed){if(_0x3a3ed){var _0x3776cf=_0x3a3ed[_0x3d3e('0x51')]&&fs['existsSync'](path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x59f287,_[_0x3d3e('0x5e')](_0x3a3ed[_0x3d3e('0x51')])))?path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x59f287,_[_0x3d3e('0x5e')](_0x3a3ed['logo'])):path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x59f287,_[_0x3d3e('0x5e')](_0x3d3e('0x5f')));var _0x586950=_0x3d3e('0x60')+_[_0x3d3e('0x61')](_0x3d3e('0x51'));if(_0x3a3ed[_0x586950]||!_0x2e733c[_0x3d3e('0x62')]){_0x3776cf=path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x59f287,_[_0x3d3e('0x5e')](_0x3d3e('0x5f')));}if(!fs[_0x3d3e('0x63')](_0x3776cf)){throw new db[(_0x3d3e('0x64'))][(_0x3d3e('0x65'))](_[_0x3d3e('0x61')]('logo')+'\x20not\x20found');}return _0x18724a['download'](_0x3776cf);}})['catch'](handleError(_0x18724a,null));};var utilLicense=require(_0x3d3e('0x12'));exports[_0x3d3e('0x66')]=function(_0x22c143,_0x379b23,_0x3c84af){var _0x2597f9='server/files/images/logos';var _0x350ace={'custom':![]};return utilLicense[_0x3d3e('0x56')]()[_0x3d3e('0x18')](function(_0x53bf2f){if(_0x53bf2f){_0x350ace=_0x53bf2f;}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x22c143[_0x3d3e('0x49')]['id']},'attributes':['logo',_0x3d3e('0x53'),'preferred','favicon',_0x3d3e('0x58'),'defaultLoginLogo','defaultPreferred',_0x3d3e('0x5b')],'raw':!![]});})[_0x3d3e('0x18')](handleEntityNotFound(_0x379b23,null))[_0x3d3e('0x18')](function(_0x2d7a01){if(_0x2d7a01){var _0x4a2a63=_0x2d7a01[_0x3d3e('0x53')]&&fs['existsSync'](path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x2597f9,_[_0x3d3e('0x5e')](_0x2d7a01[_0x3d3e('0x53')])))?path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x2597f9,_[_0x3d3e('0x5e')](_0x2d7a01[_0x3d3e('0x53')])):path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x2597f9,_[_0x3d3e('0x5e')](_0x3d3e('0x67')));var _0x22a47a=_0x3d3e('0x60')+_[_0x3d3e('0x61')]('loginLogo');if(_0x2d7a01[_0x22a47a]||!_0x350ace[_0x3d3e('0x62')]){_0x4a2a63=path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x2597f9,_[_0x3d3e('0x5e')](_0x3d3e('0x67')));}if(!fs[_0x3d3e('0x63')](_0x4a2a63)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x3d3e('0x53'))+_0x3d3e('0x68'));}return _0x379b23[_0x3d3e('0x69')](_0x4a2a63);}})[_0x3d3e('0x48')](handleError(_0x379b23,null));};exports['gdpr']=function(_0x254170,_0x981ae6){return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x254170[_0x3d3e('0x49')]['id']},'attributes':[_0x3d3e('0x6a')]})[_0x3d3e('0x18')](respondWithResult(_0x981ae6,null))[_0x3d3e('0x48')](handleError(_0x981ae6,null));};exports[_0x3d3e('0x6b')]=function(_0x3e865d,_0x40823b,_0x356416){if(_0x3e865d['file']&&_0x3e865d[_0x3d3e('0x4f')][_0x3d3e('0x50')]){_0x3e865d['body']['preferred']=_0x3e865d[_0x3d3e('0x4f')][_0x3d3e('0x50')];}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x3e865d[_0x3d3e('0x49')]['id']}})[_0x3d3e('0x18')](handleEntityNotFound(_0x40823b,null))[_0x3d3e('0x18')](saveUpdates(_0x3e865d['body'],null))[_0x3d3e('0x18')](respondWithResult(_0x40823b,null))[_0x3d3e('0x48')](handleError(_0x40823b,null));};var utilLicense=require('../../config/license/util');exports[_0x3d3e('0x6c')]=function(_0x47f5e9,_0x1b8a98,_0x1450dc){var _0x1e0eaf='server/files/images/logos';var _0x1988aa={'custom':![]};return utilLicense[_0x3d3e('0x56')]()[_0x3d3e('0x18')](function(_0x25fca8){if(_0x25fca8){_0x1988aa=_0x25fca8;}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x47f5e9[_0x3d3e('0x49')]['id']},'attributes':['logo',_0x3d3e('0x53'),_0x3d3e('0x6d'),'favicon',_0x3d3e('0x58'),_0x3d3e('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x3d3e('0x18')](handleEntityNotFound(_0x1b8a98,null))[_0x3d3e('0x18')](function(_0x53ce1d){if(_0x53ce1d){var _0x2fe8d0=_0x53ce1d[_0x3d3e('0x6d')]&&fs[_0x3d3e('0x63')](path[_0x3d3e('0x5c')](config['root'],_0x1e0eaf,_[_0x3d3e('0x5e')](_0x53ce1d[_0x3d3e('0x6d')])))?path['join'](config[_0x3d3e('0x5d')],_0x1e0eaf,_['toLower'](_0x53ce1d['preferred'])):path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x1e0eaf,_[_0x3d3e('0x5e')](_0x3d3e('0x6e')));var _0x486cec='default'+_[_0x3d3e('0x61')](_0x3d3e('0x6d'));if(_0x53ce1d[_0x486cec]||!_0x1988aa[_0x3d3e('0x62')]||!_0x1988aa[_0x3d3e('0x6d')]){_0x2fe8d0=path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x1e0eaf,_[_0x3d3e('0x5e')](_0x3d3e('0x6e')));}if(!fs[_0x3d3e('0x63')](_0x2fe8d0)){throw new db[(_0x3d3e('0x64'))]['ValidationError'](_[_0x3d3e('0x61')]('preferred')+_0x3d3e('0x68'));}return _0x1b8a98[_0x3d3e('0x69')](_0x2fe8d0);}})['catch'](handleError(_0x1b8a98,null));};exports[_0x3d3e('0x6f')]=function(_0x373793,_0x2c9951,_0x45d782){if(_0x373793['file']&&_0x373793['file']['filename']){_0x373793[_0x3d3e('0x4d')]['favicon']=_0x373793[_0x3d3e('0x4f')][_0x3d3e('0x50')];}return db[_0x3d3e('0x43')]['find']({'where':{'id':_0x373793['params']['id']}})[_0x3d3e('0x18')](handleEntityNotFound(_0x2c9951,null))[_0x3d3e('0x18')](saveUpdates(_0x373793['body'],null))[_0x3d3e('0x18')](respondWithResult(_0x2c9951,null))['catch'](handleError(_0x2c9951,null));};var utilLicense=require('../../config/license/util');exports[_0x3d3e('0x70')]=function(_0x2f911f,_0x2f96f1,_0x1e784a){var _0x204f96=_0x3d3e('0x55');var _0x58e2ce={'custom':![]};return utilLicense['getLicense']()[_0x3d3e('0x18')](function(_0x392eac){if(_0x392eac){_0x58e2ce=_0x392eac;}return db[_0x3d3e('0x43')][_0x3d3e('0x4c')]({'where':{'id':_0x2f911f[_0x3d3e('0x49')]['id']},'attributes':[_0x3d3e('0x51'),_0x3d3e('0x53'),_0x3d3e('0x6d'),'favicon',_0x3d3e('0x58'),_0x3d3e('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x3d3e('0x18')](handleEntityNotFound(_0x2f96f1,null))[_0x3d3e('0x18')](function(_0x146df3){if(_0x146df3){var _0x27a8d8=_0x146df3[_0x3d3e('0x57')]&&fs[_0x3d3e('0x63')](path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x204f96,_['toLower'](_0x146df3[_0x3d3e('0x57')])))?path['join'](config[_0x3d3e('0x5d')],_0x204f96,_[_0x3d3e('0x5e')](_0x146df3['favicon'])):path[_0x3d3e('0x5c')](config[_0x3d3e('0x5d')],_0x204f96,_[_0x3d3e('0x5e')]('default_favicon.ico'));var _0x4222fc=_0x3d3e('0x60')+_['upperFirst'](_0x3d3e('0x57'));if(_0x146df3[_0x4222fc]||!_0x58e2ce[_0x3d3e('0x62')]){_0x27a8d8=path[_0x3d3e('0x5c')](config['root'],_0x204f96,_[_0x3d3e('0x5e')](_0x3d3e('0x71')));}if(!fs[_0x3d3e('0x63')](_0x27a8d8)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x3d3e('0x57'))+'\x20not\x20found');}return _0x2f96f1[_0x3d3e('0x69')](_0x27a8d8);}})['catch'](handleError(_0x2f96f1,null));};exports[_0x3d3e('0x72')]=function(_0x46d317,_0x3942a1){var _0x3b188a={'offset':moment()[_0x3d3e('0x73')]()};_0x3b188a[_0x3d3e('0x74')]=moment()['utcOffset'](_0x3b188a[_0x3d3e('0x25')])[_0x3d3e('0x75')](_0x3d3e('0x76'));return _0x3942a1[_0x3d3e('0x23')](0xc8)[_0x3d3e('0x2f')](_0x3b188a);}; \ No newline at end of file +var _0xa04d=['filename','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','../../config/license/util','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','Setting','rawAttributes','key','model','map','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','length','find','params','body','logo','file','addLogoLogin'];(function(_0x4adee4,_0x42bd3d){var _0x37841b=function(_0x46769a){while(--_0x46769a){_0x4adee4['push'](_0x4adee4['shift']());}};_0x37841b(++_0x42bd3d);}(_0xa04d,0x118));var _0xda04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa04d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda04('0x0'));var zipdir=require(_0xda04('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda04('0x2'));var moment=require(_0xda04('0x3'));var BPromise=require(_0xda04('0x4'));var Mustache=require(_0xda04('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xda04('0x6'));var ejs=require(_0xda04('0x7'));var fs=require('fs');var fs_extra=require(_0xda04('0x8'));var _=require('lodash');var squel=require(_0xda04('0x9'));var crypto=require(_0xda04('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xda04('0xb'));var toCsv=require(_0xda04('0x6'));var querystring=require('querystring');var Papa=require(_0xda04('0xc'));var Redis=require(_0xda04('0xd'));var authService=require(_0xda04('0xe'));var qs=require(_0xda04('0xf'));var as=require(_0xda04('0x10'));var hardwareService=require(_0xda04('0x11'));var logger=require(_0xda04('0x12'))(_0xda04('0x13'));var utils=require(_0xda04('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xda04('0x15'));var client=jayson[_0xda04('0x16')][_0xda04('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3c409d,_0x153e4c,_0x48c2f6,_0x5d3f8e){return new BPromise(function(_0x3222a1,_0x4a0c82){var _0x21818d=_0x5d3f8e||client;return _0x21818d[_0xda04('0x18')](_0x3c409d,_0x48c2f6)['then'](function(_0x1dc9c3){logger[_0xda04('0x19')](_0xda04('0x1a'),_0x153e4c,_0xda04('0x1b'));logger[_0xda04('0x1c')](_0xda04('0x1d'),_0x153e4c,_0xda04('0x1b'),JSON[_0xda04('0x1e')](_0x1dc9c3));if(_0x1dc9c3[_0xda04('0x1f')]){if(_0x1dc9c3[_0xda04('0x1f')]['code']===0x1f4){logger[_0xda04('0x1f')](_0xda04('0x1a'),_0x153e4c,_0x1dc9c3['error']['message']);return _0x4a0c82(_0x1dc9c3[_0xda04('0x1f')]['message']);}logger['error'](_0xda04('0x1a'),_0x153e4c,_0x1dc9c3[_0xda04('0x1f')]['message']);return _0x3222a1(_0x1dc9c3[_0xda04('0x1f')][_0xda04('0x20')]);}else{logger[_0xda04('0x19')]('Setting,\x20%s,\x20%s',_0x153e4c,_0xda04('0x1b'));_0x3222a1(_0x1dc9c3[_0xda04('0x21')][_0xda04('0x20')]);}})[_0xda04('0x22')](function(_0x3fc5aa){logger[_0xda04('0x1f')](_0xda04('0x1a'),_0x153e4c,_0x3fc5aa);_0x4a0c82(_0x3fc5aa);});});}function respondWithStatusCode(_0x4a4257,_0xe2cb06){_0xe2cb06=_0xe2cb06||0xcc;return function(_0x16c336){if(_0x16c336){return _0x4a4257[_0xda04('0x23')](_0xe2cb06);}return _0x4a4257[_0xda04('0x24')](_0xe2cb06)[_0xda04('0x25')]();};}function respondWithResult(_0x198c08,_0x5cb9da){_0x5cb9da=_0x5cb9da||0xc8;return function(_0x59d80b){if(_0x59d80b){return _0x198c08[_0xda04('0x24')](_0x5cb9da)[_0xda04('0x26')](_0x59d80b);}};}function respondWithFilteredResult(_0x27d447,_0x2b2cd8){return function(_0x101ef4){if(_0x101ef4){var _0x24594a=typeof _0x2b2cd8[_0xda04('0x27')]===_0xda04('0x28')&&typeof _0x2b2cd8[_0xda04('0x29')]===_0xda04('0x28');var _0x37f69f=_0x101ef4[_0xda04('0x2a')];var _0x18f586=_0x24594a?0x0:_0x2b2cd8[_0xda04('0x27')];var _0x18b41f=_0x24594a?_0x101ef4[_0xda04('0x2a')]:_0x2b2cd8['offset']+_0x2b2cd8[_0xda04('0x29')];var _0x5f3db4;if(_0x18b41f>=_0x37f69f){_0x18b41f=_0x37f69f;_0x5f3db4=0xc8;}else{_0x5f3db4=0xce;}_0x27d447[_0xda04('0x24')](_0x5f3db4);return _0x27d447[_0xda04('0x2b')]('Content-Range',_0x18f586+'-'+_0x18b41f+'/'+_0x37f69f)[_0xda04('0x26')](_0x101ef4);}return null;};}function patchUpdates(_0x33e911){return function(_0x50bd63){try{jsonpatch[_0xda04('0x2c')](_0x50bd63,_0x33e911,!![]);}catch(_0x2104f7){return BPromise[_0xda04('0x2d')](_0x2104f7);}return _0x50bd63['save']();};}function saveUpdates(_0x3ea7df,_0x1dee07){return function(_0x5b57b6){if(_0x5b57b6){return _0x5b57b6[_0xda04('0x2e')](_0x3ea7df)[_0xda04('0x2f')](function(_0x40412c){return _0x40412c;});}return null;};}function removeEntity(_0x27ca7b,_0x2aef91){return function(_0x12722a){if(_0x12722a){return _0x12722a[_0xda04('0x30')]()[_0xda04('0x2f')](function(){_0x27ca7b['status'](0xcc)[_0xda04('0x25')]();});}};}function handleEntityNotFound(_0x1d6c6c,_0x5e5270){return function(_0x103763){if(!_0x103763){_0x1d6c6c[_0xda04('0x23')](0x194);}return _0x103763;};}function handleError(_0x17e118,_0x3f148b){_0x3f148b=_0x3f148b||0x1f4;return function(_0x4d3040){logger[_0xda04('0x1f')](_0x4d3040[_0xda04('0x31')]);if(_0x4d3040[_0xda04('0x32')]){delete _0x4d3040[_0xda04('0x32')];}_0x17e118[_0xda04('0x24')](_0x3f148b)[_0xda04('0x33')](_0x4d3040);};}exports[_0xda04('0x34')]=function(_0x35f3a0,_0x3b99bc){var _0x4e755c={},_0x2630bf={},_0x76d4f6={'count':0x0,'rows':[]};var _0x10c72d=_['map'](db[_0xda04('0x35')][_0xda04('0x36')],function(_0x16ccb2){return{'name':_0x16ccb2['fieldName'],'type':_0x16ccb2['type'][_0xda04('0x37')]};});_0x2630bf[_0xda04('0x38')]=_[_0xda04('0x39')](_0x10c72d,_0xda04('0x32'));_0x2630bf['query']=_[_0xda04('0x3a')](_0x35f3a0['query']);_0x2630bf['filters']=_['intersection'](_0x2630bf[_0xda04('0x38')],_0x2630bf['query']);_0x4e755c[_0xda04('0x3b')]=_[_0xda04('0x3c')](_0x2630bf['model'],qs[_0xda04('0x3d')](_0x35f3a0[_0xda04('0x3e')][_0xda04('0x3d')]));_0x4e755c[_0xda04('0x3b')]=_0x4e755c['attributes']['length']?_0x4e755c['attributes']:_0x2630bf[_0xda04('0x38')];if(!_0x35f3a0['query']['hasOwnProperty'](_0xda04('0x3f'))){_0x4e755c[_0xda04('0x29')]=qs[_0xda04('0x29')](_0x35f3a0[_0xda04('0x3e')][_0xda04('0x29')]);_0x4e755c[_0xda04('0x27')]=qs[_0xda04('0x27')](_0x35f3a0[_0xda04('0x3e')][_0xda04('0x27')]);}_0x4e755c[_0xda04('0x40')]=qs[_0xda04('0x41')](_0x35f3a0[_0xda04('0x3e')][_0xda04('0x41')]);_0x4e755c[_0xda04('0x42')]=qs[_0xda04('0x43')](_[_0xda04('0x44')](_0x35f3a0[_0xda04('0x3e')],_0x2630bf[_0xda04('0x43')]),_0x10c72d);if(_0x35f3a0[_0xda04('0x3e')]['filter']){_0x4e755c['where']=_[_0xda04('0x45')](_0x4e755c[_0xda04('0x42')],{'$or':_[_0xda04('0x39')](_0x10c72d,function(_0x446e67){if(_0x446e67[_0xda04('0x46')]!==_0xda04('0x47')){var _0x3d0e0f={};_0x3d0e0f[_0x446e67['name']]={'$like':'%'+_0x35f3a0[_0xda04('0x3e')][_0xda04('0x48')]+'%'};return _0x3d0e0f;}})});}_0x4e755c=_[_0xda04('0x45')]({},_0x4e755c,_0x35f3a0[_0xda04('0x49')]);var _0x167ff4={'where':_0x4e755c[_0xda04('0x42')]};return db['Setting'][_0xda04('0x2a')](_0x167ff4)['then'](function(_0x5f4484){_0x76d4f6['count']=_0x5f4484;if(_0x35f3a0[_0xda04('0x3e')][_0xda04('0x4a')]){_0x4e755c[_0xda04('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xda04('0x4c')](_0x4e755c);})[_0xda04('0x2f')](function(_0x30152a){_0x76d4f6[_0xda04('0x4d')]=_0x30152a;return _0x76d4f6;})[_0xda04('0x2f')](respondWithFilteredResult(_0x3b99bc,_0x4e755c))[_0xda04('0x22')](handleError(_0x3b99bc,null));};exports[_0xda04('0x4e')]=function(_0x498fb2,_0x562698){var _0x58284a={'raw':![],'where':{'id':_0x498fb2['params']['id']}},_0x42a5ca={};_0x42a5ca[_0xda04('0x38')]=_[_0xda04('0x3a')](db[_0xda04('0x35')][_0xda04('0x36')]);_0x42a5ca[_0xda04('0x3e')]=_[_0xda04('0x3a')](_0x498fb2['query']);_0x42a5ca[_0xda04('0x43')]=_[_0xda04('0x3c')](_0x42a5ca['model'],_0x42a5ca[_0xda04('0x3e')]);_0x58284a[_0xda04('0x3b')]=_['intersection'](_0x42a5ca['model'],qs[_0xda04('0x3d')](_0x498fb2[_0xda04('0x3e')][_0xda04('0x3d')]));_0x58284a[_0xda04('0x3b')]=_0x58284a[_0xda04('0x3b')][_0xda04('0x4f')]?_0x58284a[_0xda04('0x3b')]:_0x42a5ca[_0xda04('0x38')];if(_0x498fb2['query']['includeAll']){_0x58284a[_0xda04('0x4b')]=[{'all':!![]}];}_0x58284a=_['merge']({},_0x58284a,_0x498fb2[_0xda04('0x49')]);return db[_0xda04('0x35')][_0xda04('0x50')](_0x58284a)['then'](handleEntityNotFound(_0x562698,null))[_0xda04('0x2f')](respondWithResult(_0x562698,null))[_0xda04('0x22')](handleError(_0x562698,null));};exports['update']=function(_0x522182,_0x481c60){if(_0x522182['body']['id']){delete _0x522182['body']['id'];}return db[_0xda04('0x35')][_0xda04('0x50')]({'where':{'id':_0x522182[_0xda04('0x51')]['id']}})[_0xda04('0x2f')](handleEntityNotFound(_0x481c60,null))[_0xda04('0x2f')](saveUpdates(_0x522182[_0xda04('0x52')],null))[_0xda04('0x2f')](respondWithResult(_0x481c60,null))[_0xda04('0x22')](handleError(_0x481c60,null));};exports['addLogo']=function(_0x29f931,_0x2bd185,_0x4aa887){if(_0x29f931['file']&&_0x29f931['file']['filename']){_0x29f931[_0xda04('0x52')][_0xda04('0x53')]=_0x29f931[_0xda04('0x54')]['filename'];}return db['Setting'][_0xda04('0x50')]({'where':{'id':_0x29f931[_0xda04('0x51')]['id']}})[_0xda04('0x2f')](handleEntityNotFound(_0x2bd185,null))[_0xda04('0x2f')](saveUpdates(_0x29f931[_0xda04('0x52')],null))['then'](respondWithResult(_0x2bd185,null))[_0xda04('0x22')](handleError(_0x2bd185,null));};exports[_0xda04('0x55')]=function(_0x305156,_0xc43a5d,_0x21dcd6){if(_0x305156[_0xda04('0x54')]&&_0x305156[_0xda04('0x54')][_0xda04('0x56')]){_0x305156[_0xda04('0x52')]['loginLogo']=_0x305156[_0xda04('0x54')]['filename'];}return db[_0xda04('0x35')][_0xda04('0x50')]({'where':{'id':_0x305156['params']['id']}})[_0xda04('0x2f')](handleEntityNotFound(_0xc43a5d,null))['then'](saveUpdates(_0x305156[_0xda04('0x52')],null))[_0xda04('0x2f')](respondWithResult(_0xc43a5d,null))[_0xda04('0x22')](handleError(_0xc43a5d,null));};var utilLicense=require('../../config/license/util');exports[_0xda04('0x57')]=function(_0x2fcb34,_0x3a3869,_0x294266){var _0x4e8ea9=_0xda04('0x58');var _0x19e869={'custom':![]};return utilLicense[_0xda04('0x59')]()[_0xda04('0x2f')](function(_0x37d14a){if(_0x37d14a){_0x19e869=_0x37d14a;}return db[_0xda04('0x35')]['find']({'where':{'id':_0x2fcb34[_0xda04('0x51')]['id']},'attributes':[_0xda04('0x53'),_0xda04('0x5a'),_0xda04('0x5b'),_0xda04('0x5c'),_0xda04('0x5d'),_0xda04('0x5e'),_0xda04('0x5f'),_0xda04('0x60')],'raw':!![]});})[_0xda04('0x2f')](handleEntityNotFound(_0x3a3869,null))[_0xda04('0x2f')](function(_0x224adf){if(_0x224adf){var _0x5fe6fd=_0x224adf['logo']&&fs[_0xda04('0x61')](path[_0xda04('0x62')](config['root'],_0x4e8ea9,_[_0xda04('0x63')](_0x224adf[_0xda04('0x53')])))?path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4e8ea9,_[_0xda04('0x63')](_0x224adf['logo'])):path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4e8ea9,_[_0xda04('0x63')]('default_logo.svg'));var _0xd456eb=_0xda04('0x65')+_[_0xda04('0x66')](_0xda04('0x53'));if(_0x224adf[_0xd456eb]||!_0x19e869[_0xda04('0x67')]){_0x5fe6fd=path[_0xda04('0x62')](config['root'],_0x4e8ea9,_[_0xda04('0x63')]('default_logo.svg'));}if(!fs['existsSync'](_0x5fe6fd)){throw new db['Sequelize'][(_0xda04('0x68'))](_[_0xda04('0x66')](_0xda04('0x53'))+_0xda04('0x69'));}return _0x3a3869[_0xda04('0x6a')](_0x5fe6fd);}})['catch'](handleError(_0x3a3869,null));};var utilLicense=require('../../config/license/util');exports[_0xda04('0x6b')]=function(_0x3832fb,_0x36c296,_0x3645a9){var _0x4a41c3=_0xda04('0x58');var _0x558b99={'custom':![]};return utilLicense[_0xda04('0x59')]()[_0xda04('0x2f')](function(_0x7654d8){if(_0x7654d8){_0x558b99=_0x7654d8;}return db['Setting'][_0xda04('0x50')]({'where':{'id':_0x3832fb[_0xda04('0x51')]['id']},'attributes':[_0xda04('0x53'),_0xda04('0x5a'),_0xda04('0x5b'),_0xda04('0x5c'),_0xda04('0x5d'),_0xda04('0x5e'),_0xda04('0x5f'),_0xda04('0x60')],'raw':!![]});})[_0xda04('0x2f')](handleEntityNotFound(_0x36c296,null))[_0xda04('0x2f')](function(_0x5ecd2e){if(_0x5ecd2e){var _0x5f1486=_0x5ecd2e[_0xda04('0x5a')]&&fs[_0xda04('0x61')](path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4a41c3,_['toLower'](_0x5ecd2e[_0xda04('0x5a')])))?path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4a41c3,_[_0xda04('0x63')](_0x5ecd2e['loginLogo'])):path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4a41c3,_[_0xda04('0x63')](_0xda04('0x6c')));var _0x4381b1='default'+_['upperFirst'](_0xda04('0x5a'));if(_0x5ecd2e[_0x4381b1]||!_0x558b99[_0xda04('0x67')]){_0x5f1486=path[_0xda04('0x62')](config[_0xda04('0x64')],_0x4a41c3,_[_0xda04('0x63')](_0xda04('0x6c')));}if(!fs[_0xda04('0x61')](_0x5f1486)){throw new db[(_0xda04('0x6d'))][(_0xda04('0x68'))](_[_0xda04('0x66')](_0xda04('0x5a'))+'\x20not\x20found');}return _0x36c296[_0xda04('0x6a')](_0x5f1486);}})[_0xda04('0x22')](handleError(_0x36c296,null));};exports[_0xda04('0x6e')]=function(_0x6c0313,_0x27b784){return db[_0xda04('0x35')]['find']({'where':{'id':_0x6c0313['params']['id']},'attributes':[_0xda04('0x6f')]})[_0xda04('0x2f')](respondWithResult(_0x27b784,null))[_0xda04('0x22')](handleError(_0x27b784,null));};exports[_0xda04('0x70')]=function(_0x466f4f,_0x3c3af8,_0x9263e2){if(_0x466f4f[_0xda04('0x54')]&&_0x466f4f['file'][_0xda04('0x56')]){_0x466f4f[_0xda04('0x52')]['preferred']=_0x466f4f[_0xda04('0x54')][_0xda04('0x56')];}return db[_0xda04('0x35')][_0xda04('0x50')]({'where':{'id':_0x466f4f['params']['id']}})[_0xda04('0x2f')](handleEntityNotFound(_0x3c3af8,null))[_0xda04('0x2f')](saveUpdates(_0x466f4f[_0xda04('0x52')],null))[_0xda04('0x2f')](respondWithResult(_0x3c3af8,null))[_0xda04('0x22')](handleError(_0x3c3af8,null));};var utilLicense=require('../../config/license/util');exports[_0xda04('0x71')]=function(_0x490231,_0x2afa0e,_0x4eed2e){var _0x586091=_0xda04('0x58');var _0x733782={'custom':![]};return utilLicense[_0xda04('0x59')]()[_0xda04('0x2f')](function(_0x278074){if(_0x278074){_0x733782=_0x278074;}return db['Setting'][_0xda04('0x50')]({'where':{'id':_0x490231['params']['id']},'attributes':[_0xda04('0x53'),_0xda04('0x5a'),'preferred',_0xda04('0x5c'),'defaultLogo',_0xda04('0x5e'),'defaultPreferred',_0xda04('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x2afa0e,null))[_0xda04('0x2f')](function(_0x326603){if(_0x326603){var _0x26711f=_0x326603['preferred']&&fs[_0xda04('0x61')](path[_0xda04('0x62')](config['root'],_0x586091,_[_0xda04('0x63')](_0x326603[_0xda04('0x5b')])))?path[_0xda04('0x62')](config[_0xda04('0x64')],_0x586091,_['toLower'](_0x326603['preferred'])):path[_0xda04('0x62')](config[_0xda04('0x64')],_0x586091,_['toLower'](_0xda04('0x72')));var _0x411fe4=_0xda04('0x65')+_['upperFirst'](_0xda04('0x5b'));if(_0x326603[_0x411fe4]||!_0x733782['custom']||!_0x733782['preferred']){_0x26711f=path[_0xda04('0x62')](config[_0xda04('0x64')],_0x586091,_['toLower'](_0xda04('0x72')));}if(!fs[_0xda04('0x61')](_0x26711f)){throw new db[(_0xda04('0x6d'))][(_0xda04('0x68'))](_[_0xda04('0x66')](_0xda04('0x5b'))+_0xda04('0x69'));}return _0x2afa0e['download'](_0x26711f);}})[_0xda04('0x22')](handleError(_0x2afa0e,null));};exports[_0xda04('0x73')]=function(_0x4564bc,_0x3fe2ab,_0x5196af){if(_0x4564bc[_0xda04('0x54')]&&_0x4564bc[_0xda04('0x54')][_0xda04('0x56')]){_0x4564bc[_0xda04('0x52')]['favicon']=_0x4564bc['file'][_0xda04('0x56')];}return db[_0xda04('0x35')][_0xda04('0x50')]({'where':{'id':_0x4564bc[_0xda04('0x51')]['id']}})[_0xda04('0x2f')](handleEntityNotFound(_0x3fe2ab,null))[_0xda04('0x2f')](saveUpdates(_0x4564bc['body'],null))[_0xda04('0x2f')](respondWithResult(_0x3fe2ab,null))[_0xda04('0x22')](handleError(_0x3fe2ab,null));};var utilLicense=require(_0xda04('0x74'));exports['getFavicon']=function(_0x3ee404,_0x432bfa,_0xf71f13){var _0x1713cc=_0xda04('0x58');var _0x3eda59={'custom':![]};return utilLicense[_0xda04('0x59')]()[_0xda04('0x2f')](function(_0x3ceb0d){if(_0x3ceb0d){_0x3eda59=_0x3ceb0d;}return db[_0xda04('0x35')][_0xda04('0x50')]({'where':{'id':_0x3ee404['params']['id']},'attributes':[_0xda04('0x53'),_0xda04('0x5a'),_0xda04('0x5b'),'favicon',_0xda04('0x5d'),_0xda04('0x5e'),_0xda04('0x5f'),_0xda04('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x432bfa,null))[_0xda04('0x2f')](function(_0x2a52a7){if(_0x2a52a7){var _0x555975=_0x2a52a7[_0xda04('0x5c')]&&fs[_0xda04('0x61')](path['join'](config['root'],_0x1713cc,_[_0xda04('0x63')](_0x2a52a7[_0xda04('0x5c')])))?path[_0xda04('0x62')](config['root'],_0x1713cc,_[_0xda04('0x63')](_0x2a52a7[_0xda04('0x5c')])):path[_0xda04('0x62')](config[_0xda04('0x64')],_0x1713cc,_[_0xda04('0x63')]('default_favicon.ico'));var _0x741eb7=_0xda04('0x65')+_[_0xda04('0x66')](_0xda04('0x5c'));if(_0x2a52a7[_0x741eb7]||!_0x3eda59['custom']){_0x555975=path[_0xda04('0x62')](config[_0xda04('0x64')],_0x1713cc,_[_0xda04('0x63')](_0xda04('0x75')));}if(!fs['existsSync'](_0x555975)){throw new db[(_0xda04('0x6d'))][(_0xda04('0x68'))](_[_0xda04('0x66')](_0xda04('0x5c'))+_0xda04('0x69'));}return _0x432bfa[_0xda04('0x6a')](_0x555975);}})[_0xda04('0x22')](handleError(_0x432bfa,null));};exports[_0xda04('0x76')]=function(_0x1ffdba,_0x43c522){var _0x20f486={'offset':moment()[_0xda04('0x77')]()};_0x20f486['now']=moment()[_0xda04('0x77')](_0x20f486['offset'])[_0xda04('0x78')](_0xda04('0x79'));return _0x43c522[_0xda04('0x24')](0xc8)['send'](_0x20f486);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5a80728..81bd442 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x36f99f,_0x10dfa2){var _0x85cb3b=function(_0x26d6b7){while(--_0x26d6b7){_0x36f99f['push'](_0x36f99f['shift']());}};_0x85cb3b(++_0x10dfa2);}(_0x008c,0x188));var _0xc008=function(_0x4acf20,_0x3f4636){_0x4acf20=_0x4acf20-0x0;var _0x50eabc=_0x008c[_0x4acf20];return _0x50eabc;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x1cda69,_0x3728a8){var _0x515ac5=function(_0x6919dc){while(--_0x6919dc){_0x1cda69['push'](_0x1cda69['shift']());}};_0x515ac5(++_0x3728a8);}(_0x34e8,0x12c));var _0x834e=function(_0x192e55,_0x4bb135){_0x192e55=_0x192e55-0x0;var _0x3eeaa4=_0x34e8[_0x192e55];return _0x3eeaa4;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c6f7ca5..d73aae6 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 _0x69de=['stringify','error','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','map','include','model','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Setting,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3165ab,_0x49ab2b){var _0x1b49d4=function(_0x16b820){while(--_0x16b820){_0x3165ab['push'](_0x3165ab['shift']());}};_0x1b49d4(++_0x49ab2b);}(_0x69de,0x184));var _0xe69d=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x69de[_0x2637ac];return _0x4a5758;};'use strict';var _=require('lodash');var util=require(_0xe69d('0x0'));var moment=require(_0xe69d('0x1'));var BPromise=require(_0xe69d('0x2'));var rs=require(_0xe69d('0x3'));var fs=require('fs');var Redis=require(_0xe69d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe69d('0x5'));var logger=require(_0xe69d('0x6'))(_0xe69d('0x7'));var config=require(_0xe69d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe69d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16586c,_0x3bd196,_0x2d3195){return new BPromise(function(_0x1f11c5,_0x20a0d9){return client[_0xe69d('0xa')](_0x16586c,_0x2d3195)[_0xe69d('0xb')](function(_0x4c67d8){logger['info'](_0xe69d('0xc'),_0x3bd196,'request\x20sent');logger[_0xe69d('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x3bd196,_0xe69d('0xe'),JSON[_0xe69d('0xf')](_0x4c67d8));if(_0x4c67d8['error']){if(_0x4c67d8[_0xe69d('0x10')]['code']===0x1f4){logger[_0xe69d('0x10')]('Setting,\x20%s,\x20%s',_0x3bd196,_0x4c67d8['error'][_0xe69d('0x11')]);return _0x20a0d9(_0x4c67d8[_0xe69d('0x10')][_0xe69d('0x11')]);}logger[_0xe69d('0x10')](_0xe69d('0xc'),_0x3bd196,_0x4c67d8[_0xe69d('0x10')]['message']);return _0x1f11c5(_0x4c67d8['error']['message']);}else{logger[_0xe69d('0x12')](_0xe69d('0xc'),_0x3bd196,_0xe69d('0xe'));_0x1f11c5(_0x4c67d8[_0xe69d('0x13')][_0xe69d('0x11')]);}})[_0xe69d('0x14')](function(_0x3f8ee4){logger[_0xe69d('0x10')]('Setting,\x20%s,\x20%s',_0x3bd196,_0x3f8ee4);_0x20a0d9(_0x3f8ee4);});});}exports[_0xe69d('0x15')]=function(_0x3682e8){var _0x29c93b=this;return new Promise(function(_0x55414d,_0x161e63){return db[_0xe69d('0x16')][_0xe69d('0x17')]({'raw':_0x3682e8[_0xe69d('0x18')]?_0x3682e8[_0xe69d('0x18')][_0xe69d('0x19')]===undefined?!![]:![]:!![],'where':_0x3682e8['options']?_0x3682e8[_0xe69d('0x18')][_0xe69d('0x1a')]||null:null,'attributes':_0x3682e8[_0xe69d('0x18')]?_0x3682e8[_0xe69d('0x18')]['attributes']||null:null,'include':_0x3682e8[_0xe69d('0x18')]?_0x3682e8['options']['include']?_[_0xe69d('0x1b')](_0x3682e8[_0xe69d('0x18')][_0xe69d('0x1c')],function(_0x593726){return{'model':db[_0x593726[_0xe69d('0x1d')]],'as':_0x593726['as'],'attributes':_0x593726[_0xe69d('0x1e')],'include':_0x593726['include']?_['map'](_0x593726[_0xe69d('0x1c')],function(_0x202ab3){return{'model':db[_0x202ab3[_0xe69d('0x1d')]],'as':_0x202ab3['as'],'attributes':_0x202ab3[_0xe69d('0x1e')],'include':_0x202ab3[_0xe69d('0x1c')]?_['map'](_0x202ab3[_0xe69d('0x1c')],function(_0x1d0308){return{'model':db[_0x1d0308[_0xe69d('0x1d')]],'as':_0x1d0308['as'],'attributes':_0x1d0308['attributes']};}):[]};}):[]};}):[]:[]})[_0xe69d('0xb')](function(_0x3b2e15){logger[_0xe69d('0x12')](_0xe69d('0x15'),_0x3682e8);logger[_0xe69d('0xd')](_0xe69d('0x15'),_0x3682e8,JSON[_0xe69d('0xf')](_0x3b2e15));_0x55414d(_0x3b2e15);})[_0xe69d('0x14')](function(_0x36c854){logger[_0xe69d('0x10')](_0xe69d('0x15'),_0x36c854['message'],_0x3682e8);_0x161e63(_0x29c93b['error'](0x1f4,_0x36c854[_0xe69d('0x11')]));});});}; \ No newline at end of file +var _0x4fa6=['include','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','find','options','raw','where','map','attributes'];(function(_0x4ac0a3,_0x3e6a40){var _0x260ee1=function(_0x3d9022){while(--_0x3d9022){_0x4ac0a3['push'](_0x4ac0a3['shift']());}};_0x260ee1(++_0x3e6a40);}(_0x4fa6,0x143));var _0x64fa=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x4fa6[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x64fa('0x0'));var util=require('util');var moment=require(_0x64fa('0x1'));var BPromise=require(_0x64fa('0x2'));var rs=require(_0x64fa('0x3'));var fs=require('fs');var Redis=require(_0x64fa('0x4'));var db=require(_0x64fa('0x5'))['db'];var utils=require(_0x64fa('0x6'));var logger=require(_0x64fa('0x7'))('rpc');var config=require(_0x64fa('0x8'));var jayson=require(_0x64fa('0x9'));var client=jayson[_0x64fa('0xa')][_0x64fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x285fae,_0x2ee2e3,_0x45acfe){return new BPromise(function(_0x1fc7fc,_0x13b28d){return client['request'](_0x285fae,_0x45acfe)['then'](function(_0x2ffa8c){logger[_0x64fa('0xc')]('Setting,\x20%s,\x20%s',_0x2ee2e3,_0x64fa('0xd'));logger['debug'](_0x64fa('0xe'),_0x2ee2e3,'request\x20sent',JSON[_0x64fa('0xf')](_0x2ffa8c));if(_0x2ffa8c[_0x64fa('0x10')]){if(_0x2ffa8c[_0x64fa('0x10')][_0x64fa('0x11')]===0x1f4){logger['error'](_0x64fa('0x12'),_0x2ee2e3,_0x2ffa8c[_0x64fa('0x10')][_0x64fa('0x13')]);return _0x13b28d(_0x2ffa8c['error']['message']);}logger[_0x64fa('0x10')]('Setting,\x20%s,\x20%s',_0x2ee2e3,_0x2ffa8c['error']['message']);return _0x1fc7fc(_0x2ffa8c[_0x64fa('0x10')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x2ee2e3,_0x64fa('0xd'));_0x1fc7fc(_0x2ffa8c[_0x64fa('0x14')][_0x64fa('0x13')]);}})[_0x64fa('0x15')](function(_0x24404c){logger[_0x64fa('0x10')](_0x64fa('0x12'),_0x2ee2e3,_0x24404c);_0x13b28d(_0x24404c);});});}exports[_0x64fa('0x16')]=function(_0x1bb9d3){var _0x44c613=this;return new Promise(function(_0xf51500,_0x1c5015){return db['Setting'][_0x64fa('0x17')]({'raw':_0x1bb9d3[_0x64fa('0x18')]?_0x1bb9d3[_0x64fa('0x18')][_0x64fa('0x19')]===undefined?!![]:![]:!![],'where':_0x1bb9d3[_0x64fa('0x18')]?_0x1bb9d3['options'][_0x64fa('0x1a')]||null:null,'attributes':_0x1bb9d3['options']?_0x1bb9d3[_0x64fa('0x18')]['attributes']||null:null,'include':_0x1bb9d3[_0x64fa('0x18')]?_0x1bb9d3[_0x64fa('0x18')]['include']?_[_0x64fa('0x1b')](_0x1bb9d3['options']['include'],function(_0x22a699){return{'model':db[_0x22a699['model']],'as':_0x22a699['as'],'attributes':_0x22a699[_0x64fa('0x1c')],'include':_0x22a699[_0x64fa('0x1d')]?_[_0x64fa('0x1b')](_0x22a699['include'],function(_0x25531d){return{'model':db[_0x25531d[_0x64fa('0x1e')]],'as':_0x25531d['as'],'attributes':_0x25531d[_0x64fa('0x1c')],'include':_0x25531d['include']?_[_0x64fa('0x1b')](_0x25531d['include'],function(_0x2d27ec){return{'model':db[_0x2d27ec[_0x64fa('0x1e')]],'as':_0x2d27ec['as'],'attributes':_0x2d27ec['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd8c94c){logger[_0x64fa('0xc')](_0x64fa('0x16'),_0x1bb9d3);logger[_0x64fa('0x1f')]('ShowSetting',_0x1bb9d3,JSON[_0x64fa('0xf')](_0xd8c94c));_0xf51500(_0xd8c94c);})[_0x64fa('0x15')](function(_0x33e457){logger[_0x64fa('0x10')](_0x64fa('0x16'),_0x33e457[_0x64fa('0x13')],_0x1bb9d3);_0x1c5015(_0x44c613[_0x64fa('0x10')](0x1f4,_0x33e457[_0x64fa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9af6569..c1e8400 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x55cdb7,_0x1e2f87){var _0xc74604=function(_0x163a1e){while(--_0x163a1e){_0x55cdb7['push'](_0x55cdb7['shift']());}};_0xc74604(++_0x1e2f87);}(_0x6aa7,0x178));var _0x76aa=function(_0x4720a5,_0x55745d){_0x4720a5=_0x4720a5-0x0;var _0x5a67ab=_0x6aa7[_0x4720a5];return _0x5a67ab;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _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(_0x28eb96,_0x193474){_0x28eb96=_0x28eb96-0x0;var _0x494a7a=_0x1cb9[_0x28eb96];return _0x494a7a;};'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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 375f6c2..f8b65f2 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 _0x16a4=['twilio','skebby','connectel','plivo','bandwidth','csc','intelepeer','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x16a4,0xcc));var _0x416a=function(_0x818881,_0x3342b1){_0x818881=_0x818881-0x0;var _0x252f10=_0x16a4[_0x818881];return _0x252f10;};'use strict';var Sequelize=require(_0x416a('0x0'));var rs=require(_0x416a('0x1'));module[_0x416a('0x2')]={'name':{'type':Sequelize[_0x416a('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x416a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x416a('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x416a('0x4')](_0x416a('0x5'),_0x416a('0x6'),_0x416a('0x7'),'clicksend',_0x416a('0x8'),'clickatell',_0x416a('0x9'),_0x416a('0xa'),'infobip',_0x416a('0xb'))},'accountSid':{'type':Sequelize[_0x416a('0x3')]},'authId':{'type':Sequelize[_0x416a('0x3')]},'authToken':{'type':Sequelize[_0x416a('0x3')]},'smsMethod':{'type':Sequelize[_0x416a('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x416a('0x3')]},'password':{'type':Sequelize[_0x416a('0x3')]},'apiKey':{'type':Sequelize[_0x416a('0x3')]},'applicationId':{'type':Sequelize[_0x416a('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x416a('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x416a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x416a('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x416a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x416a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x416a('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x416a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x416a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x416a('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x416a('0xd')],'defaultValue':![],'comment':_0x416a('0xf'),'set':function(_0x338537){if(!_0x338537)this[_0x416a('0x10')](_0x416a('0x11'),null);this[_0x416a('0x10')](_0x416a('0x12'),_0x338537);}}}; \ No newline at end of file +var _0x54fc=['clicksend','plivo','bandwidth','csc','infobip','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','name'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x54fc,0x7c));var _0xc54f=function(_0x43401b,_0x421dc9){_0x43401b=_0x43401b-0x0;var _0x5af16d=_0x54fc[_0x43401b];return _0x5af16d;};'use strict';var Sequelize=require(_0xc54f('0x0'));var rs=require('randomstring');module[_0xc54f('0x1')]={'name':{'type':Sequelize[_0xc54f('0x2')],'unique':_0xc54f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc54f('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc54f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc54f('0x2')]},'type':{'type':Sequelize['ENUM']('twilio','skebby','connectel',_0xc54f('0x4'),_0xc54f('0x5'),'clickatell',_0xc54f('0x6'),_0xc54f('0x7'),_0xc54f('0x8'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xc54f('0x2')]},'authToken':{'type':Sequelize[_0xc54f('0x2')]},'smsMethod':{'type':Sequelize[_0xc54f('0x9')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc54f('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xc54f('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xc54f('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc54f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc54f('0xa')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc54f('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc54f('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc54f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc54f('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc54f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc54f('0xc')],'comment':_0xc54f('0xd')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc54f('0xe'),'set':function(_0xbf4c15){if(!_0xbf4c15)this[_0xc54f('0xf')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xbf4c15);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4491388..e07ab8a 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 _0x2c5a=['contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','message_id','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','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/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','then','info','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsAccount,\x20%s,\x20%s','request\x20sent','result','catch','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','filters','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','connectel','Text','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','list','omit','Contacts'];(function(_0x4a5ce9,_0x1e1b5c){var _0x46d6d6=function(_0x37a363){while(--_0x37a363){_0x4a5ce9['push'](_0x4a5ce9['shift']());}};_0x46d6d6(++_0x1e1b5c);}(_0x2c5a,0x129));var _0xa2c5=function(_0x2a7e6f,_0x4c9fd6){_0x2a7e6f=_0x2a7e6f-0x0;var _0x11921f=_0x2c5a[_0x2a7e6f];return _0x11921f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2c5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2c5('0x1'));var rp=require(_0xa2c5('0x2'));var moment=require(_0xa2c5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa2c5('0x4'));var util=require(_0xa2c5('0x5'));var path=require(_0xa2c5('0x6'));var sox=require(_0xa2c5('0x7'));var csv=require(_0xa2c5('0x8'));var ejs=require(_0xa2c5('0x9'));var fs=require('fs');var fs_extra=require(_0xa2c5('0xa'));var _=require(_0xa2c5('0xb'));var squel=require('squel');var crypto=require(_0xa2c5('0xc'));var jsforce=require(_0xa2c5('0xd'));var deskjs=require(_0xa2c5('0xe'));var toCsv=require(_0xa2c5('0x8'));var querystring=require(_0xa2c5('0xf'));var Papa=require(_0xa2c5('0x10'));var Redis=require(_0xa2c5('0x11'));var authService=require(_0xa2c5('0x12'));var qs=require(_0xa2c5('0x13'));var as=require(_0xa2c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2c5('0x15'))(_0xa2c5('0x16'));var utils=require(_0xa2c5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa2c5('0x18'))['db'];config[_0xa2c5('0x19')]=_[_0xa2c5('0x1a')](config[_0xa2c5('0x19')],{'host':_0xa2c5('0x1b'),'port':0x18eb});var socket=require(_0xa2c5('0x1c'))(new Redis(config[_0xa2c5('0x19')]));require('./smsAccount.socket')[_0xa2c5('0x1d')](socket);var jayson=require(_0xa2c5('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x43c84b,_0x5084dd,_0x43b66d,_0x1ad321){return new BPromise(function(_0x3ecee9,_0x4a3b6e){var _0x3050d7=_0x1ad321||client;return _0x3050d7['request'](_0x43c84b,_0x43b66d)[_0xa2c5('0x1f')](function(_0x4a2189){logger[_0xa2c5('0x20')]('SmsAccount,\x20%s,\x20%s',_0x5084dd,'request\x20sent');logger['debug'](_0xa2c5('0x21'),_0x5084dd,'request\x20sent',JSON[_0xa2c5('0x22')](_0x4a2189));if(_0x4a2189[_0xa2c5('0x23')]){if(_0x4a2189['error']['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5084dd,_0x4a2189[_0xa2c5('0x23')][_0xa2c5('0x24')]);return _0x4a3b6e(_0x4a2189[_0xa2c5('0x23')][_0xa2c5('0x24')]);}logger['error'](_0xa2c5('0x25'),_0x5084dd,_0x4a2189[_0xa2c5('0x23')][_0xa2c5('0x24')]);return _0x3ecee9(_0x4a2189[_0xa2c5('0x23')][_0xa2c5('0x24')]);}else{logger[_0xa2c5('0x20')](_0xa2c5('0x25'),_0x5084dd,_0xa2c5('0x26'));_0x3ecee9(_0x4a2189[_0xa2c5('0x27')][_0xa2c5('0x24')]);}})[_0xa2c5('0x28')](function(_0x55f951){logger['error'](_0xa2c5('0x25'),_0x5084dd,_0x55f951);_0x4a3b6e(_0x55f951);});});}function respondWithStatusCode(_0x3552b9,_0x1b1654){_0x1b1654=_0x1b1654||0xcc;return function(_0x318cd7){if(_0x318cd7){return _0x3552b9['sendStatus'](_0x1b1654);}return _0x3552b9[_0xa2c5('0x29')](_0x1b1654)['end']();};}function respondWithResult(_0x37a706,_0x16f5de){_0x16f5de=_0x16f5de||0xc8;return function(_0x515308){if(_0x515308){return _0x37a706[_0xa2c5('0x29')](_0x16f5de)[_0xa2c5('0x2a')](_0x515308);}};}function respondWithFilteredResult(_0x371a42,_0xea788f){return function(_0xa1f24e){if(_0xa1f24e){var _0x3a9905=typeof _0xea788f['offset']==='undefined'&&typeof _0xea788f[_0xa2c5('0x2b')]===_0xa2c5('0x2c');var _0x179e0a=_0xa1f24e[_0xa2c5('0x2d')];var _0x43d0fb=_0x3a9905?0x0:_0xea788f[_0xa2c5('0x2e')];var _0x18c3f1=_0x3a9905?_0xa1f24e[_0xa2c5('0x2d')]:_0xea788f['offset']+_0xea788f[_0xa2c5('0x2b')];var _0x1c194e;if(_0x18c3f1>=_0x179e0a){_0x18c3f1=_0x179e0a;_0x1c194e=0xc8;}else{_0x1c194e=0xce;}_0x371a42[_0xa2c5('0x29')](_0x1c194e);return _0x371a42[_0xa2c5('0x2f')](_0xa2c5('0x30'),_0x43d0fb+'-'+_0x18c3f1+'/'+_0x179e0a)[_0xa2c5('0x2a')](_0xa1f24e);}return null;};}function patchUpdates(_0x2e8981){return function(_0x768be2){try{jsonpatch[_0xa2c5('0x31')](_0x768be2,_0x2e8981,!![]);}catch(_0x29cd13){return BPromise[_0xa2c5('0x32')](_0x29cd13);}return _0x768be2[_0xa2c5('0x33')]();};}function saveUpdates(_0x63ae6f,_0xb359f3){return function(_0x280360){if(_0x280360){return _0x280360[_0xa2c5('0x34')](_0x63ae6f)['then'](function(_0x5c11e3){return _0x5c11e3;});}return null;};}function removeEntity(_0x5e0039,_0x3aa7a2){return function(_0x5411bf){if(_0x5411bf){return _0x5411bf[_0xa2c5('0x35')]()[_0xa2c5('0x1f')](function(){var _0x281857=_0x5411bf[_0xa2c5('0x36')]({'plain':!![]});var _0x388995=_0xa2c5('0x37');return db[_0xa2c5('0x38')]['destroy']({'where':{'type':_0x388995,'resourceId':_0x281857['id']}})[_0xa2c5('0x1f')](function(){return _0x5411bf;});})['then'](function(){_0x5e0039[_0xa2c5('0x29')](0xcc)[_0xa2c5('0x39')]();});}};}function handleEntityNotFound(_0x851616,_0x2f06f9){return function(_0x298632){if(!_0x298632){_0x851616[_0xa2c5('0x3a')](0x194);}return _0x298632;};}function handleError(_0x521da0,_0x1261c4){_0x1261c4=_0x1261c4||0x1f4;return function(_0x26f6aa){logger['error'](_0x26f6aa[_0xa2c5('0x3b')]);if(_0x26f6aa[_0xa2c5('0x3c')]){delete _0x26f6aa['name'];}_0x521da0['status'](_0x1261c4)[_0xa2c5('0x3d')](_0x26f6aa);};}exports[_0xa2c5('0x3e')]=function(_0x407ca8,_0x17b535){var _0x5dc703={'include':[{'model':db['Pause'],'as':_0xa2c5('0x3f')}]},_0x31e4e6={},_0x44b2fa={'count':0x0,'rows':[]};var _0x5cef15=_[_0xa2c5('0x40')](db[_0xa2c5('0x41')][_0xa2c5('0x42')],function(_0x7f55a3){return{'name':_0x7f55a3[_0xa2c5('0x43')],'type':_0x7f55a3[_0xa2c5('0x44')]['key']};});_0x31e4e6[_0xa2c5('0x45')]=_['map'](_0x5cef15,_0xa2c5('0x3c'));_0x31e4e6[_0xa2c5('0x46')]=_[_0xa2c5('0x47')](_0x407ca8[_0xa2c5('0x46')]);_0x31e4e6['filters']=_[_0xa2c5('0x48')](_0x31e4e6[_0xa2c5('0x45')],_0x31e4e6[_0xa2c5('0x46')]);_0x5dc703[_0xa2c5('0x49')]=_[_0xa2c5('0x48')](_0x31e4e6[_0xa2c5('0x45')],qs[_0xa2c5('0x4a')](_0x407ca8['query'][_0xa2c5('0x4a')]));_0x5dc703[_0xa2c5('0x49')]=_0x5dc703['attributes'][_0xa2c5('0x4b')]?_0x5dc703[_0xa2c5('0x49')]:_0x31e4e6[_0xa2c5('0x45')];if(!_0x407ca8[_0xa2c5('0x46')]['hasOwnProperty'](_0xa2c5('0x4c'))){_0x5dc703['limit']=qs[_0xa2c5('0x2b')](_0x407ca8[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x5dc703[_0xa2c5('0x2e')]=qs[_0xa2c5('0x2e')](_0x407ca8[_0xa2c5('0x46')][_0xa2c5('0x2e')]);}_0x5dc703[_0xa2c5('0x4d')]=qs[_0xa2c5('0x4e')](_0x407ca8[_0xa2c5('0x46')][_0xa2c5('0x4e')]);_0x5dc703['where']=qs['filters'](_[_0xa2c5('0x4f')](_0x407ca8[_0xa2c5('0x46')],_0x31e4e6['filters']),_0x5cef15);if(_0x407ca8['query'][_0xa2c5('0x50')]){_0x5dc703['where']=_[_0xa2c5('0x51')](_0x5dc703[_0xa2c5('0x52')],{'$or':_[_0xa2c5('0x40')](_0x5cef15,function(_0x2043b9){if(_0x2043b9['type']!==_0xa2c5('0x53')){var _0x213e54={};_0x213e54[_0x2043b9['name']]={'$like':'%'+_0x407ca8[_0xa2c5('0x46')]['filter']+'%'};return _0x213e54;}})});}_0x5dc703=_[_0xa2c5('0x51')]({},_0x5dc703,_0x407ca8[_0xa2c5('0x54')]);var _0x16c865={'where':_0x5dc703[_0xa2c5('0x52')]};return db[_0xa2c5('0x41')][_0xa2c5('0x2d')](_0x16c865)[_0xa2c5('0x1f')](function(_0x41efbc){_0x44b2fa[_0xa2c5('0x2d')]=_0x41efbc;if(_0x407ca8[_0xa2c5('0x46')][_0xa2c5('0x55')]){_0x5dc703[_0xa2c5('0x56')]=[{'all':!![]}];}return db[_0xa2c5('0x41')][_0xa2c5('0x57')](_0x5dc703);})['then'](function(_0x3c67e5){_0x44b2fa[_0xa2c5('0x58')]=_0x3c67e5;return _0x44b2fa;})[_0xa2c5('0x1f')](respondWithFilteredResult(_0x17b535,_0x5dc703))[_0xa2c5('0x28')](handleError(_0x17b535,null));};exports[_0xa2c5('0x59')]=function(_0x122313,_0x4409bd){var _0x259200={'raw':![],'where':{'id':_0x122313[_0xa2c5('0x5a')]['id']},'include':[{'model':db[_0xa2c5('0x5b')],'as':'mandatoryDispositionPause'}]},_0xc0bb84={};_0xc0bb84[_0xa2c5('0x45')]=_[_0xa2c5('0x47')](db[_0xa2c5('0x41')][_0xa2c5('0x42')]);_0xc0bb84[_0xa2c5('0x46')]=_[_0xa2c5('0x47')](_0x122313[_0xa2c5('0x46')]);_0xc0bb84[_0xa2c5('0x5c')]=_[_0xa2c5('0x48')](_0xc0bb84['model'],_0xc0bb84[_0xa2c5('0x46')]);_0x259200[_0xa2c5('0x49')]=_[_0xa2c5('0x48')](_0xc0bb84[_0xa2c5('0x45')],qs[_0xa2c5('0x4a')](_0x122313[_0xa2c5('0x46')][_0xa2c5('0x4a')]));_0x259200['attributes']=_0x259200[_0xa2c5('0x49')][_0xa2c5('0x4b')]?_0x259200[_0xa2c5('0x49')]:_0xc0bb84['model'];if(_0x122313[_0xa2c5('0x46')][_0xa2c5('0x55')]){_0x259200[_0xa2c5('0x56')]=[{'all':!![]}];}_0x259200=_[_0xa2c5('0x51')]({},_0x259200,_0x122313[_0xa2c5('0x54')]);return db[_0xa2c5('0x41')][_0xa2c5('0x5d')](_0x259200)[_0xa2c5('0x1f')](handleEntityNotFound(_0x4409bd,null))[_0xa2c5('0x1f')](respondWithResult(_0x4409bd,null))[_0xa2c5('0x28')](handleError(_0x4409bd,null));};exports['create']=function(_0x133f35,_0x5d4dca){return db[_0xa2c5('0x41')][_0xa2c5('0x5e')](_0x133f35[_0xa2c5('0x5f')],{})[_0xa2c5('0x1f')](function(_0x263b21){var _0x544b86=_0x133f35['user'][_0xa2c5('0x36')]({'plain':!![]});if(!_0x544b86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x544b86['role']===_0xa2c5('0x60')){var _0x42f64e=_0x263b21[_0xa2c5('0x36')]({'plain':!![]});var _0x118a48='SmsAccounts';return db[_0xa2c5('0x61')][_0xa2c5('0x5d')]({'where':{'name':_0x118a48,'userProfileId':_0x544b86[_0xa2c5('0x62')]},'raw':!![]})['then'](function(_0x13bbae){if(_0x13bbae&&_0x13bbae[_0xa2c5('0x63')]===0x0){return db[_0xa2c5('0x38')][_0xa2c5('0x5e')]({'name':_0x42f64e[_0xa2c5('0x3c')],'resourceId':_0x42f64e['id'],'type':_0x13bbae[_0xa2c5('0x3c')],'sectionId':_0x13bbae['id']},{})[_0xa2c5('0x1f')](function(){return _0x263b21;});}else{return _0x263b21;}})[_0xa2c5('0x28')](function(_0x2d39cb){logger[_0xa2c5('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d39cb);throw _0x2d39cb;});}return _0x263b21;})[_0xa2c5('0x1f')](respondWithResult(_0x5d4dca,0xc9))[_0xa2c5('0x28')](handleError(_0x5d4dca,null));};exports['update']=function(_0x36a3d0,_0x5f3e3e){if(_0x36a3d0[_0xa2c5('0x5f')]['id']){delete _0x36a3d0[_0xa2c5('0x5f')]['id'];}return db[_0xa2c5('0x41')]['find']({'where':{'id':_0x36a3d0[_0xa2c5('0x5a')]['id']},'include':[{'model':db[_0xa2c5('0x5b')],'as':_0xa2c5('0x3f')}]})['then'](handleEntityNotFound(_0x5f3e3e,null))[_0xa2c5('0x1f')](saveUpdates(_0x36a3d0[_0xa2c5('0x5f')],null))[_0xa2c5('0x1f')](respondWithResult(_0x5f3e3e,null))[_0xa2c5('0x28')](handleError(_0x5f3e3e,null));};exports[_0xa2c5('0x35')]=function(_0x1564b1,_0x195a46){return db[_0xa2c5('0x41')]['find']({'where':{'id':_0x1564b1[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x195a46,null))[_0xa2c5('0x1f')](removeEntity(_0x195a46,null))[_0xa2c5('0x28')](handleError(_0x195a46,null));};exports[_0xa2c5('0x64')]=function(_0x3b7459,_0x5ad4cc){return db[_0xa2c5('0x41')][_0xa2c5('0x64')]()['then'](respondWithResult(_0x5ad4cc,null))[_0xa2c5('0x28')](handleError(_0x5ad4cc,null));};exports[_0xa2c5('0x65')]=function(_0x5212f4,_0x155690,_0x4136b9){if(_0x5212f4['body']['id']){delete _0x5212f4['body']['id'];}return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0x5212f4[_0xa2c5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x155690,null))[_0xa2c5('0x1f')](function(_0x197c80){if(_0x197c80){_0x5212f4['body'][_0xa2c5('0x66')]=_0x197c80['id'];return db['Disposition'][_0xa2c5('0x5e')](_0x5212f4[_0xa2c5('0x5f')]);}})[_0xa2c5('0x1f')](respondWithResult(_0x155690,null))[_0xa2c5('0x28')](handleError(_0x155690,null));};exports[_0xa2c5('0x67')]=function(_0x2a2585,_0x2c2f9b,_0x1e0027){var _0x187b80={'raw':![],'where':{}};var _0x5f17c0={};var _0xcfbbf2={'count':0x0,'rows':[]};return db[_0xa2c5('0x41')][_0xa2c5('0x68')]({'where':{'id':_0x2a2585[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x2c2f9b,null))['then'](function(_0x5d2544){if(_0x5d2544){_0x5f17c0['model']=_['keys'](db[_0xa2c5('0x69')]['rawAttributes']);_0x5f17c0[_0xa2c5('0x46')]=_[_0xa2c5('0x47')](_0x2a2585[_0xa2c5('0x46')]);_0x5f17c0[_0xa2c5('0x5c')]=_[_0xa2c5('0x48')](_0x5f17c0[_0xa2c5('0x45')],_0x5f17c0[_0xa2c5('0x46')]);_0x187b80[_0xa2c5('0x49')]=_['intersection'](_0x5f17c0[_0xa2c5('0x45')],qs[_0xa2c5('0x4a')](_0x2a2585[_0xa2c5('0x46')][_0xa2c5('0x4a')]));_0x187b80[_0xa2c5('0x49')]=_0x187b80['attributes'][_0xa2c5('0x4b')]?_0x187b80[_0xa2c5('0x49')]:_0x5f17c0[_0xa2c5('0x45')];if(!_0x2a2585[_0xa2c5('0x46')][_0xa2c5('0x6a')](_0xa2c5('0x4c'))){_0x187b80['limit']=qs[_0xa2c5('0x2b')](_0x2a2585[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x187b80[_0xa2c5('0x2e')]=qs[_0xa2c5('0x2e')](_0x2a2585[_0xa2c5('0x46')]['offset']);}_0x187b80['order']=qs[_0xa2c5('0x4e')](_0x2a2585[_0xa2c5('0x46')][_0xa2c5('0x4e')]);_0x187b80['where']=qs[_0xa2c5('0x5c')](_[_0xa2c5('0x4f')](_0x2a2585['query'],_0x5f17c0[_0xa2c5('0x5c')]));_0x187b80[_0xa2c5('0x52')][_0xa2c5('0x66')]=_0x5d2544['id'];if(_0x2a2585['query']['filter']){_0x187b80[_0xa2c5('0x52')]=_[_0xa2c5('0x51')](_0x187b80[_0xa2c5('0x52')],{'$or':_['map'](_0x187b80[_0xa2c5('0x49')],function(_0x18ae81){var _0x1d320d={};_0x1d320d[_0x18ae81]={'$like':'%'+_0x2a2585[_0xa2c5('0x46')]['filter']+'%'};return _0x1d320d;})});}_0x187b80=_['merge']({},_0x187b80,_0x2a2585['options']);return db['Disposition']['count']({'where':_0x187b80[_0xa2c5('0x52')]})[_0xa2c5('0x1f')](function(_0xb7e173){_0xcfbbf2[_0xa2c5('0x2d')]=_0xb7e173;if(_0x2a2585['query'][_0xa2c5('0x55')]){_0x187b80[_0xa2c5('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xa2c5('0x57')](_0x187b80);})['then'](function(_0x5f2d26){_0xcfbbf2[_0xa2c5('0x58')]=_0x5f2d26;return _0xcfbbf2;});}})[_0xa2c5('0x1f')](respondWithFilteredResult(_0x2c2f9b,_0x187b80))[_0xa2c5('0x28')](handleError(_0x2c2f9b,null));};exports[_0xa2c5('0x6b')]=function(_0x9cb70c,_0x351082,_0xf1cfc8){return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0x9cb70c[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x351082,null))[_0xa2c5('0x1f')](function(_0x3b90f1){if(_0x3b90f1){return _0x3b90f1[_0xa2c5('0x6b')](_0x9cb70c['query'][_0xa2c5('0x6c')]);}})[_0xa2c5('0x1f')](respondWithStatusCode(_0x351082,null))[_0xa2c5('0x28')](handleError(_0x351082,null));};exports['addAnswer']=function(_0x2b2fcc,_0x3e2ce7,_0x3961a0){if(_0x2b2fcc[_0xa2c5('0x5f')]['id']){delete _0x2b2fcc[_0xa2c5('0x5f')]['id'];}return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0x2b2fcc[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x3e2ce7,null))[_0xa2c5('0x1f')](function(_0x5717a4){if(_0x5717a4){_0x2b2fcc[_0xa2c5('0x5f')][_0xa2c5('0x66')]=_0x5717a4['id'];return db[_0xa2c5('0x6d')]['create'](_0x2b2fcc[_0xa2c5('0x5f')]);}})[_0xa2c5('0x1f')](respondWithResult(_0x3e2ce7,null))['catch'](handleError(_0x3e2ce7,null));};exports[_0xa2c5('0x6e')]=function(_0x411f3f,_0x43ac06,_0x57873b){var _0x4c56d8={'raw':![],'where':{}};var _0x3e2b4d={};var _0x553f3a={'count':0x0,'rows':[]};return db[_0xa2c5('0x41')][_0xa2c5('0x68')]({'where':{'id':_0x411f3f[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x43ac06,null))['then'](function(_0x479a6d){if(_0x479a6d){_0x3e2b4d[_0xa2c5('0x45')]=_[_0xa2c5('0x47')](db[_0xa2c5('0x6d')][_0xa2c5('0x42')]);_0x3e2b4d[_0xa2c5('0x46')]=_['keys'](_0x411f3f[_0xa2c5('0x46')]);_0x3e2b4d['filters']=_[_0xa2c5('0x48')](_0x3e2b4d[_0xa2c5('0x45')],_0x3e2b4d['query']);_0x4c56d8[_0xa2c5('0x49')]=_[_0xa2c5('0x48')](_0x3e2b4d[_0xa2c5('0x45')],qs['fields'](_0x411f3f[_0xa2c5('0x46')][_0xa2c5('0x4a')]));_0x4c56d8[_0xa2c5('0x49')]=_0x4c56d8['attributes'][_0xa2c5('0x4b')]?_0x4c56d8[_0xa2c5('0x49')]:_0x3e2b4d[_0xa2c5('0x45')];if(!_0x411f3f[_0xa2c5('0x46')][_0xa2c5('0x6a')](_0xa2c5('0x4c'))){_0x4c56d8[_0xa2c5('0x2b')]=qs[_0xa2c5('0x2b')](_0x411f3f[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x4c56d8[_0xa2c5('0x2e')]=qs['offset'](_0x411f3f[_0xa2c5('0x46')][_0xa2c5('0x2e')]);}_0x4c56d8[_0xa2c5('0x4d')]=qs['sort'](_0x411f3f[_0xa2c5('0x46')][_0xa2c5('0x4e')]);_0x4c56d8['where']=qs['filters'](_[_0xa2c5('0x4f')](_0x411f3f[_0xa2c5('0x46')],_0x3e2b4d[_0xa2c5('0x5c')]));_0x4c56d8[_0xa2c5('0x52')][_0xa2c5('0x66')]=_0x479a6d['id'];if(_0x411f3f['query']['filter']){_0x4c56d8[_0xa2c5('0x52')]=_[_0xa2c5('0x51')](_0x4c56d8['where'],{'$or':_[_0xa2c5('0x40')](_0x4c56d8[_0xa2c5('0x49')],function(_0x280ac0){var _0x40f5f1={};_0x40f5f1[_0x280ac0]={'$like':'%'+_0x411f3f[_0xa2c5('0x46')]['filter']+'%'};return _0x40f5f1;})});}_0x4c56d8=_[_0xa2c5('0x51')]({},_0x4c56d8,_0x411f3f[_0xa2c5('0x54')]);return db[_0xa2c5('0x6d')]['count']({'where':_0x4c56d8['where']})[_0xa2c5('0x1f')](function(_0x4fe113){_0x553f3a['count']=_0x4fe113;if(_0x411f3f['query']['includeAll']){_0x4c56d8[_0xa2c5('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4c56d8);})['then'](function(_0x57999b){_0x553f3a['rows']=_0x57999b;return _0x553f3a;});}})['then'](respondWithFilteredResult(_0x43ac06,_0x4c56d8))[_0xa2c5('0x28')](handleError(_0x43ac06,null));};exports[_0xa2c5('0x6f')]=function(_0xa5717a,_0x419322,_0x54e20b){return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0xa5717a['params']['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x419322,null))[_0xa2c5('0x1f')](function(_0x5d6082){if(_0x5d6082){return _0x5d6082[_0xa2c5('0x6f')](_0xa5717a['query'][_0xa2c5('0x6c')]);}})[_0xa2c5('0x1f')](respondWithStatusCode(_0x419322,null))[_0xa2c5('0x28')](handleError(_0x419322,null));};exports[_0xa2c5('0x70')]=function(_0x48a5fa,_0x26c8dc,_0x4fe3cd){var _0x449566={'channel':_0xa2c5('0x71')};var _0x50f631=[];var _0x2b634d=[];var _0x500e3a={};return db['SmsAccount'][_0xa2c5('0x5d')]({'where':{'id':_0x48a5fa[_0xa2c5('0x5a')]['id']},'include':[{'model':db[_0xa2c5('0x72')],'as':_0xa2c5('0x73')}]})[_0xa2c5('0x1f')](handleEntityNotFound(_0x26c8dc,null))[_0xa2c5('0x1f')](function(_0x240093){_0x449566[_0xa2c5('0x74')]=_0x240093;_0x449566[_0xa2c5('0x75')]=_[_0xa2c5('0x76')](_0x240093[_0xa2c5('0x73')],[_0xa2c5('0x77')],[_0xa2c5('0x78')]);if(_0x449566['account'][_0xa2c5('0x73')]){delete _0x449566[_0xa2c5('0x74')][_0xa2c5('0x73')];}return db['CmContact'][_0xa2c5('0x64')]();})[_0xa2c5('0x1f')](function(_0x3a34ed){if(!_0x3a34ed){throw new db[(_0xa2c5('0x79'))][(_0xa2c5('0x7a'))](_0xa2c5('0x7b'));}_0x50f631=_[_0xa2c5('0x7c')](_[_0xa2c5('0x47')](_0x3a34ed),[_0xa2c5('0x7d'),_0xa2c5('0x7e')]);_0x2b634d=_[_0xa2c5('0x7c')](_[_0xa2c5('0x47')](_0x3a34ed),['createdAt',_0xa2c5('0x7e'),_0xa2c5('0x7f'),_0xa2c5('0x80')]);_0x449566[_0xa2c5('0x5f')]={'mapKey':'mobile'};if(_0x449566[_0xa2c5('0x74')][_0xa2c5('0x44')]){switch(_0x449566[_0xa2c5('0x74')][_0xa2c5('0x44')]){case _0xa2c5('0x81'):_0x449566['body'][_0xa2c5('0x82')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x83')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x84')];_0x449566['body'][_0xa2c5('0x85')]=_0x48a5fa['body'][_0xa2c5('0x86')];break;case _0xa2c5('0x87'):_0x449566['body'][_0xa2c5('0x82')]='+'+_0x48a5fa[_0xa2c5('0x5f')]['sender'];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa['body']['text'];break;case _0xa2c5('0x88'):_0x449566['body'][_0xa2c5('0x82')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x82')];_0x449566['body'][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x24')];break;case'clicksend':_0x449566['body']['from']=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x82')];_0x449566[_0xa2c5('0x5f')]['body']=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x5f')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x85')]=_0x48a5fa[_0xa2c5('0x5f')]['message_id'];break;case'plivo':_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x83')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x89')];_0x449566['body'][_0xa2c5('0x85')]=_0x48a5fa['body']['MessageUUID'];break;case _0xa2c5('0x8a'):_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')]='+'+_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x8b')][0x0]['from'];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x8b')][0x0][_0xa2c5('0x8c')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x85')]=_0x48a5fa['body'][_0xa2c5('0x8b')][0x0]['messageId'];break;case _0xa2c5('0x8d'):_0x449566[_0xa2c5('0x5f')]['from']=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x8e')];_0x449566[_0xa2c5('0x5f')]['body']=_0x48a5fa['body'][_0xa2c5('0x8f')][_0xa2c5('0x24')];break;case _0xa2c5('0x90'):_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')]=_0x48a5fa[_0xa2c5('0x5f')]['fromNumber'];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x8c')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x85')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x91')];break;case _0xa2c5('0x92'):_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x85')]=_0x48a5fa[_0xa2c5('0x5f')][0x0]['message']['id'];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')]=_0x48a5fa['body'][0x0]['message']['from'];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa['body'][0x0][_0xa2c5('0x24')][_0xa2c5('0x8c')];break;case'intelepeer':_0x449566['body']['from']=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x82')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x24')];_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x85')]=_0x48a5fa[_0xa2c5('0x5f')][_0xa2c5('0x93')];break;}}if(_0x449566[_0xa2c5('0x5f')]['id']){delete _0x449566[_0xa2c5('0x5f')]['id'];}if(_[_0xa2c5('0x94')](_0x449566['body'][_0xa2c5('0x82')])){throw new db['Sequelize'][(_0xa2c5('0x7a'))](_0xa2c5('0x95'));}if(_[_0xa2c5('0x94')](_0x449566[_0xa2c5('0x5f')]['body'])||_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x5f')]===''){throw new db[(_0xa2c5('0x79'))][(_0xa2c5('0x7a'))](_0xa2c5('0x96'));}if(_[_0xa2c5('0x94')](_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x97')])){throw new db[(_0xa2c5('0x79'))][(_0xa2c5('0x7a'))](_0xa2c5('0x98')+_0x2b634d);}if(!_['includes'](_0x2b634d,_0x449566['body'][_0xa2c5('0x97')])){throw new db[(_0xa2c5('0x79'))]['ValidationError'](_0xa2c5('0x99')+_0x2b634d);}_0x500e3a[_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x97')]]=_0x449566[_0xa2c5('0x5f')]['from'];return db[_0xa2c5('0x9a')][_0xa2c5('0x5d')]({'where':{'id':_0x449566['account'][_0xa2c5('0x80')]},'include':[{'model':db[_0xa2c5('0x9b')],'as':'Contacts','where':_0x500e3a,'limit':0x1,'order':[[_0xa2c5('0x7e'),'DESC']]}]});})[_0xa2c5('0x1f')](handleEntityNotFound(_0x26c8dc,null))[_0xa2c5('0x1f')](function(_0x5ac680){if(_0x5ac680){_0x449566[_0xa2c5('0x9c')]=_[_0xa2c5('0x9d')](_0x5ac680,[_0xa2c5('0x9e')]);if(_0x5ac680[_0xa2c5('0x9e')][_0xa2c5('0x4b')]){return _0x5ac680[_0xa2c5('0x9e')][0x0];}var _0x2544a6=_['defaults'](_0x449566[_0xa2c5('0x5f')],{'firstName':_0x449566[_0xa2c5('0x5f')]['from'],'ListId':_0x5ac680['id']});_0x2544a6[_0x449566['body']['mapKey']]=_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')];return db[_0xa2c5('0x9b')][_0xa2c5('0x5e')](_0x2544a6,{'fields':_0x50f631,'raw':!![]});}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x26c8dc,null))[_0xa2c5('0x1f')](function(_0x3e921a){if(_0x3e921a){_0x449566[_0xa2c5('0x9f')]=_0x3e921a;var _0x486b0e={'ContactId':_0x3e921a['id'],'phone':_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')],'SmsAccountId':_0x48a5fa[_0xa2c5('0x5a')]['id']};var _0x2e75e8={'ContactId':_0x3e921a['id'],'SmsAccountId':_0x48a5fa[_0xa2c5('0x5a')]['id'],'closed':![]};return db[_0xa2c5('0xa0')][_0xa2c5('0x5d')]({'where':_0x2e75e8})[_0xa2c5('0x1f')](function(_0x3f5aa2){if(_0x3f5aa2){return[_0x3f5aa2,![]];}return db[_0xa2c5('0xa0')]['create'](_0x486b0e)[_0xa2c5('0x1f')](function(_0x232e72){return[_0x232e72,!![]];});});}})[_0xa2c5('0xa1')](function(_0x97f48c,_0x3f9f27){_0x449566[_0xa2c5('0xa2')]=_0x97f48c['get']({'plain':!![]});_0x449566[_0xa2c5('0xa2')][_0xa2c5('0xa3')]=![];if(_0x3f9f27){if(_0x449566[_0xa2c5('0x74')][_0xa2c5('0xa4')]){_0x449566[_0xa2c5('0x75')][_0xa2c5('0xa5')]({'id':0x0,'priority':_0x449566['applications'][_0xa2c5('0x4b')]+0x1,'app':'close','appdata':_0xa2c5('0xa6'),'interval':_0xa2c5('0xa7')});}_0x449566[_0xa2c5('0xa2')]['created']=!![];}return db[_0xa2c5('0xa8')][_0xa2c5('0x5e')]({'phone':_0x449566[_0xa2c5('0x5f')][_0xa2c5('0x82')],'messageId':_0x449566['body'][_0xa2c5('0x85')],'body':_0x449566[_0xa2c5('0x5f')]['body'],'SmsAccountId':_0x48a5fa[_0xa2c5('0x5a')]['id'],'SmsInteractionId':_0x97f48c['id'],'direction':'in','ContactId':_0x97f48c[_0xa2c5('0xa9')],'AttachmentId':_0x449566[_0xa2c5('0x5f')]['AttachmentId']});})[_0xa2c5('0x1f')](function(_0xcf3bd7){_0x449566[_0xa2c5('0x24')]=_0xcf3bd7;if(_0x449566['interaction'][_0xa2c5('0xaa')]){return db[_0xa2c5('0xab')][_0xa2c5('0x5d')]({'attributes':['id','name'],'where':{'id':_0x449566[_0xa2c5('0xa2')][_0xa2c5('0xaa')]}})[_0xa2c5('0x1f')](function(_0x9da0d8){if(_0x9da0d8){_0x449566['applications'][_0xa2c5('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x9da0d8['name']+','+(_0x449566[_0xa2c5('0x74')][_0xa2c5('0xad')]||0xa),'interval':_0xa2c5('0xa7')});}return respondWithRpcPromise(_0xa2c5('0xae'),'startRouting',_0x449566);});}return respondWithRpcPromise(_0xa2c5('0xae'),_0xa2c5('0xaf'),_0x449566);})[_0xa2c5('0x1f')](function(_0x33856a){if(_0x33856a){var _0x3de843=0xc8;var _0x22460d=_0xa2c5('0xb0');logger[_0xa2c5('0x20')](_0xa2c5('0x21'),_0x22460d,_0x3de843,_0xa2c5('0xb1'));logger[_0xa2c5('0xb2')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x22460d,_0x3de843,_0xa2c5('0xb1'),JSON[_0xa2c5('0x22')](_0x33856a));if(_0x449566[_0xa2c5('0x74')][_0xa2c5('0x44')]===_0xa2c5('0x81')){return _0x26c8dc[_0xa2c5('0x29')](_0x3de843)[_0xa2c5('0x2f')](_0xa2c5('0xb3'),'text/xml')['send'](_0xa2c5('0xb4'));}else{return _0x26c8dc[_0xa2c5('0x29')](_0x3de843)[_0xa2c5('0x2a')](_0x33856a);}}})[_0xa2c5('0x28')](handleError(_0x26c8dc,null));};exports[_0xa2c5('0xb5')]=function(_0x50ea0c,_0x9949c1,_0x10df8f){return db[_0xa2c5('0x41')][_0xa2c5('0x68')]({'where':{'id':_0x50ea0c[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x9949c1,null))['then'](function(_0x2ff676){if(_0x2ff676){return db[_0xa2c5('0xb6')][_0xa2c5('0xb7')](function(_0x3871ac){return db[_0xa2c5('0x72')][_0xa2c5('0x35')]({'where':{'SmsAccountId':_0x50ea0c[_0xa2c5('0x5a')]['id']},'transaction':_0x3871ac})[_0xa2c5('0x1f')](function(_0x399848){var _0x5e897f=_[_0xa2c5('0x40')](_0x50ea0c[_0xa2c5('0x5f')],function(_0x514fd9){_0x514fd9[_0xa2c5('0x66')]=_0x50ea0c[_0xa2c5('0x5a')]['id'];return _0x514fd9;});return db[_0xa2c5('0x72')][_0xa2c5('0xb8')](_0x5e897f,{'transaction':_0x3871ac});});})[_0xa2c5('0x1f')](function(){return db[_0xa2c5('0x72')][_0xa2c5('0xb9')]({'where':{'SmsAccountId':_0x50ea0c['params']['id']},'order':_0xa2c5('0x77')});});}})[_0xa2c5('0x1f')](respondWithResult(_0x9949c1,null))[_0xa2c5('0x28')](handleError(_0x9949c1,null));};exports[_0xa2c5('0xba')]=function(_0x396141,_0x45ddb6,_0x2523ab){var _0x390d82={};var _0x456c7e={};var _0x447bd6;var _0x851cae;return db[_0xa2c5('0x41')]['findOne']({'where':{'id':_0x396141['params']['id']}})['then'](handleEntityNotFound(_0x45ddb6,null))[_0xa2c5('0x1f')](function(_0x35186b){if(_0x35186b){_0x447bd6=_0x35186b;_0x456c7e['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x456c7e['query']=_['keys'](_0x396141['query']);_0x456c7e[_0xa2c5('0x5c')]=_[_0xa2c5('0x48')](_0x456c7e[_0xa2c5('0x45')],_0x456c7e[_0xa2c5('0x46')]);_0x390d82[_0xa2c5('0x49')]=_[_0xa2c5('0x48')](_0x456c7e['model'],qs[_0xa2c5('0x4a')](_0x396141[_0xa2c5('0x46')][_0xa2c5('0x4a')]));_0x390d82['attributes']=_0x390d82['attributes'][_0xa2c5('0x4b')]?_0x390d82[_0xa2c5('0x49')]:_0x456c7e[_0xa2c5('0x45')];_0x390d82[_0xa2c5('0x4d')]=qs[_0xa2c5('0x4e')](_0x396141[_0xa2c5('0x46')][_0xa2c5('0x4e')]);_0x390d82[_0xa2c5('0x52')]=qs[_0xa2c5('0x5c')](_[_0xa2c5('0x4f')](_0x396141['query'],_0x456c7e['filters']));if(_0x396141[_0xa2c5('0x46')]['filter']){_0x390d82[_0xa2c5('0x52')]=_[_0xa2c5('0x51')](_0x390d82[_0xa2c5('0x52')],{'$or':_[_0xa2c5('0x40')](_0x390d82[_0xa2c5('0x49')],function(_0x39824f){var _0x4dab9e={};_0x4dab9e[_0x39824f]={'$like':'%'+_0x396141[_0xa2c5('0x46')]['filter']+'%'};return _0x4dab9e;})});}_0x390d82=_[_0xa2c5('0x51')]({},_0x390d82,_0x396141['options']);return _0x447bd6[_0xa2c5('0xba')](_0x390d82);}})[_0xa2c5('0x1f')](function(_0x40dacf){if(_0x40dacf){_0x851cae=_0x40dacf[_0xa2c5('0x4b')];if(!_0x396141[_0xa2c5('0x46')]['hasOwnProperty']('nolimit')){_0x390d82[_0xa2c5('0x2b')]=qs[_0xa2c5('0x2b')](_0x396141[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x390d82[_0xa2c5('0x2e')]=qs[_0xa2c5('0x2e')](_0x396141[_0xa2c5('0x46')][_0xa2c5('0x2e')]);}return _0x447bd6[_0xa2c5('0xba')](_0x390d82);}})['then'](function(_0x1128b8){if(_0x1128b8){return _0x1128b8?{'count':_0x851cae,'rows':_0x1128b8}:null;}})[_0xa2c5('0x1f')](respondWithResult(_0x45ddb6,null))['catch'](handleError(_0x45ddb6,null));};exports[_0xa2c5('0xbb')]=function(_0x3693bd,_0x4833fb,_0x2bfa0e){var _0x49b030={'raw':![],'where':{}};var _0x48d082={};var _0x5ac821={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa2c5('0x68')]({'where':{'id':_0x3693bd[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x4833fb,null))[_0xa2c5('0x1f')](function(_0x577d16){if(_0x577d16){_0x48d082[_0xa2c5('0x45')]=_[_0xa2c5('0x47')](db[_0xa2c5('0xa0')][_0xa2c5('0x42')]);_0x48d082[_0xa2c5('0x46')]=_[_0xa2c5('0x47')](_0x3693bd[_0xa2c5('0x46')]);_0x48d082['filters']=_[_0xa2c5('0x48')](_0x48d082[_0xa2c5('0x45')],_0x48d082[_0xa2c5('0x46')]);_0x49b030[_0xa2c5('0x49')]=_['intersection'](_0x48d082[_0xa2c5('0x45')],qs[_0xa2c5('0x4a')](_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x4a')]));_0x49b030[_0xa2c5('0x49')]=_0x49b030[_0xa2c5('0x49')][_0xa2c5('0x4b')]?_0x49b030['attributes']:_0x48d082[_0xa2c5('0x45')];if(!_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x6a')](_0xa2c5('0x4c'))){_0x49b030['limit']=qs[_0xa2c5('0x2b')](_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x49b030[_0xa2c5('0x2e')]=qs[_0xa2c5('0x2e')](_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x2e')]);}_0x49b030[_0xa2c5('0x4d')]=qs[_0xa2c5('0x4e')](_0x3693bd['query'][_0xa2c5('0x4e')]);_0x49b030[_0xa2c5('0x52')]=qs[_0xa2c5('0x5c')](_['pick'](_0x3693bd[_0xa2c5('0x46')],_0x48d082[_0xa2c5('0x5c')]));_0x49b030[_0xa2c5('0x52')][_0xa2c5('0x66')]=_0x577d16['id'];if(_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x50')]){_0x49b030[_0xa2c5('0x52')]=_[_0xa2c5('0x51')](_0x49b030[_0xa2c5('0x52')],{'$or':_[_0xa2c5('0x40')](_0x49b030[_0xa2c5('0x49')],function(_0x11f15f){var _0x142e97={};_0x142e97[_0x11f15f]={'$like':'%'+_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x50')]+'%'};return _0x142e97;})});}_0x49b030=_[_0xa2c5('0x51')]({},_0x49b030,_0x3693bd['options']);return db[_0xa2c5('0xa0')][_0xa2c5('0x2d')]({'where':_0x49b030['where']})[_0xa2c5('0x1f')](function(_0x171bd3){_0x5ac821['count']=_0x171bd3;if(_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0x55')]){_0x49b030['include']=[{'model':db[_0xa2c5('0x9b')],'as':_0xa2c5('0xbc'),'required':![]},{'model':db[_0xa2c5('0xab')],'as':_0xa2c5('0xbd'),'attributes':['name',_0xa2c5('0xbe'),_0xa2c5('0xbf')],'required':![]},{'model':db[_0xa2c5('0xc0')],'as':'Tags','attributes':['id',_0xa2c5('0x3c'),_0xa2c5('0xc1')],'where':_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0xc2')]?{'id':_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0xc2')]}:undefined,'required':_0x3693bd[_0xa2c5('0x46')][_0xa2c5('0xc2')]?!![]:![]}];}return db[_0xa2c5('0xa0')]['findAll'](_0x49b030);})[_0xa2c5('0x1f')](function(_0x226fd9){_0x5ac821['rows']=_0x226fd9;return _0x5ac821;});}})[_0xa2c5('0x1f')](respondWithFilteredResult(_0x4833fb,_0x49b030))[_0xa2c5('0x28')](handleError(_0x4833fb,null));};exports[_0xa2c5('0x3d')]=function(_0xbce35e,_0x482dc3,_0x29ed9f){var _0x560c8d,_0x5c2fb3,_0x24cf62;if(_['isNil'](_0xbce35e[_0xa2c5('0x5f')]['body'])||_0xbce35e[_0xa2c5('0x5f')]['body']===''){throw new db[(_0xa2c5('0x79'))][(_0xa2c5('0x7a'))](_0xa2c5('0x96'));}if(_['isNil'](_0xbce35e[_0xa2c5('0x5f')]['to'])){throw new db[(_0xa2c5('0x79'))][(_0xa2c5('0x7a'))](_0xa2c5('0xc3'));}_0x560c8d=_0xbce35e[_0xa2c5('0x5f')]['to'];return db['SmsAccount'][_0xa2c5('0x5d')]({'where':{'id':_0xbce35e[_0xa2c5('0x5a')]['id']},'include':[{'model':db[_0xa2c5('0x9a')],'as':'List','include':[{'model':db[_0xa2c5('0x9b')],'as':_0xa2c5('0x9e'),'where':{'mobile':_0x560c8d},'limit':0x1,'order':[[_0xa2c5('0x7e'),_0xa2c5('0xc4')]]}]}]})[_0xa2c5('0x1f')](handleEntityNotFound(_0x482dc3,null))[_0xa2c5('0x1f')](function(_0x1e89b7){if(_0x1e89b7&&_0x1e89b7['List']){_0x5c2fb3=_0x1e89b7[_0xa2c5('0x36')]({'plain':!![]});if(_0x5c2fb3['List']&&_0x5c2fb3[_0xa2c5('0xc5')][_0xa2c5('0x9e')]['length']){return _0x5c2fb3[_0xa2c5('0xc5')][_0xa2c5('0x9e')][0x0];}return db['CmContact'][_0xa2c5('0x5e')](_[_0xa2c5('0x1a')](_0xbce35e[_0xa2c5('0x5f')],{'firstName':_0x560c8d,'mobile':_0x560c8d,'phone':_0x560c8d,'ListId':_0x5c2fb3[_0xa2c5('0x80')]}));}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x482dc3,null))[_0xa2c5('0x1f')](function(_0x5e981e){if(_0x5e981e){_0x24cf62=_0x5e981e;return db[_0xa2c5('0xa0')][_0xa2c5('0x5d')]({'where':{'ContactId':_0x24cf62['id'],'closed':![],'SmsAccountId':_0x5c2fb3['id']}})[_0xa2c5('0x1f')](function(_0x424109){if(_0x424109){return[_0x424109,![]];}return db[_0xa2c5('0xa0')]['create']({'UserId':_0xbce35e[_0xa2c5('0x60')]['id'],'ContactId':_0x24cf62['id'],'SmsAccountId':_0x5c2fb3['id'],'phone':_0x560c8d,'firstMsgDirection':_0xa2c5('0xc6'),'Messages':[_[_0xa2c5('0x51')](_0xbce35e[_0xa2c5('0x5f')],{'read':![],'body':_0xbce35e[_0xa2c5('0x5f')][_0xa2c5('0x5f')],'phone':_0x560c8d,'SmsAccountId':_0x5c2fb3['id'],'UserId':_0xbce35e[_0xa2c5('0x60')]['id'],'ContactId':_0x24cf62['id']})]},{'include':[{'model':db[_0xa2c5('0xa8')],'as':_0xa2c5('0xc7')}]})[_0xa2c5('0x1f')](function(_0x311645){return[_0x311645,!![]];});});}})[_0xa2c5('0xa1')](function(_0x436a50,_0x5be8b7){if(_0x5be8b7){return _0x436a50;}return db[_0xa2c5('0xa8')][_0xa2c5('0x5e')](_[_0xa2c5('0x51')](_0xbce35e[_0xa2c5('0x5f')],{'read':![],'body':_0xbce35e[_0xa2c5('0x5f')][_0xa2c5('0x5f')],'phone':_0x560c8d,'SmsAccountId':_0x5c2fb3['id'],'SmsInteractionId':_0x436a50['id'],'UserId':_0xbce35e['user']['id'],'ContactId':_0x24cf62['id']}))['then'](function(_0x4d6325){_0x436a50[_0xa2c5('0xc8')]['Messages']=[];_0x436a50[_0xa2c5('0xc8')][_0xa2c5('0xc7')]['push'](_0x4d6325[_0xa2c5('0xc8')]);return _0x436a50;});})[_0xa2c5('0x1f')](respondWithResult(_0x482dc3,null))[_0xa2c5('0x28')](handleError(_0x482dc3,null));};exports['status']=function(_0x58e009,_0x1e7e90,_0x3aa41c){if(_0x58e009[_0xa2c5('0x5f')]['id']){delete _0x58e009['body']['id'];}var _0x4fce47,_0x58083d,_0x509e18;return db[_0xa2c5('0x41')]['find']({'where':{'id':_0x58e009[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x1e7e90,null))['then'](function(_0x2b3f84){if(_0x2b3f84){_0x509e18=_0x2b3f84;logger['debug'](_0xa2c5('0x21'),_0xa2c5('0x29'),_0xa2c5('0xc9'),_0x2b3f84[_0xa2c5('0x44')],util[_0xa2c5('0xca')](_0x58e009['body'],{'showHidden':![],'depth':null}));switch(_0x2b3f84[_0xa2c5('0x44')]){case _0xa2c5('0x87'):if(_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xcb')]&&_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x29')]){_0x58083d=_0x58e009['body'][_0xa2c5('0x29')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009[_0xa2c5('0x5f')]['skebby_dispatch_id']}});}break;case _0xa2c5('0x88'):if(_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xcc')]&&_0x58e009[_0xa2c5('0x5f')]['statusInt']){_0x58083d=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xcd')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xcc')]}});}break;case _0xa2c5('0xce'):if(_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xcf')]&&_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xd0')]){_0x58083d=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xd0')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009['body'][_0xa2c5('0xcf')]}});}break;case _0xa2c5('0x8a'):var _0x56bde4=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x8b')][0x0];if(_0x56bde4['messageId']&&_0x56bde4[_0xa2c5('0x29')][_0xa2c5('0xd1')]===_0xa2c5('0xd2')){_0x58083d=_0x56bde4[_0xa2c5('0x29')][_0xa2c5('0xd1')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x56bde4[_0xa2c5('0x85')]}});}break;case'clickatell':if(_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x85')]&&_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x29')]){_0x58083d=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x29')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x85')]}});}break;case _0xa2c5('0x92'):if(_0x58e009['body'][0x0][_0xa2c5('0x24')]['id']){_0x58083d=_0x58e009[_0xa2c5('0x5f')][0x0]['type'];return db['SmsMessage'][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009['body'][0x0][_0xa2c5('0x24')]['id']}});}break;case _0xa2c5('0xd3'):if(_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xd4')]&&_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x29')]){_0x58083d=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x29')];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x58e009[_0xa2c5('0x5f')]['redif']}});}break;}}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x1e7e90,null))[_0xa2c5('0x1f')](function(_0x41a98c){if(_0x41a98c){_0x4fce47=_0x41a98c;switch(_0x509e18[_0xa2c5('0x44')]){case _0xa2c5('0x87'):if(_0x58083d===_0xa2c5('0xd2')){return _0x4fce47[_0xa2c5('0x34')]({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),_0xa2c5('0x29'),_0xa2c5('0x87'),util[_0xa2c5('0xca')](_0x58e009[_0xa2c5('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x58083d==='1'){return _0x4fce47['update']({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),'status',_0xa2c5('0x87'),util[_0xa2c5('0xca')](_0x58e009[_0xa2c5('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa2c5('0xce'):if(!_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0xd5')]&&_0x58083d>=0xc8&&_0x58083d<=0xce){return _0x4fce47[_0xa2c5('0x34')]({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),_0xa2c5('0x29'),'clicksend',util[_0xa2c5('0xca')](_0x58e009[_0xa2c5('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa2c5('0x8a'):var _0x561cbb=_0x58e009[_0xa2c5('0x5f')][_0xa2c5('0x8b')][0x0];if(_0x561cbb[_0xa2c5('0x29')][_0xa2c5('0xd1')]===_0xa2c5('0xd2')){return _0x4fce47[_0xa2c5('0x34')]({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),_0xa2c5('0x29'),_0xa2c5('0x8a'),util['inspect'](_0x58e009[_0xa2c5('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xa2c5('0x90'):if(_0x58083d==_0xa2c5('0xd6')||_0x58083d==_0xa2c5('0xd7')){return _0x4fce47['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa2c5('0x90'),util['inspect'](_0x58e009['body'],{'showHidden':![],'depth':null}));}break;case _0xa2c5('0x92'):if(_0x58083d==_0xa2c5('0xd8')){return _0x4fce47['update']({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),_0xa2c5('0x29'),'bandwidth',util[_0xa2c5('0xca')](_0x58e009['body'],{'showHidden':![],'depth':null}));}break;case _0xa2c5('0xd3'):if(_0x58083d===_0xa2c5('0xd9')||_0x58083d===_0xa2c5('0xda')){return _0x4fce47[_0xa2c5('0x34')]({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),'status','intelepeer',util[_0xa2c5('0xca')](_0x58e009['body'],{'showHidden':![],'depth':null}));}break;}return _0x4fce47;}})['then'](respondWithResult(_0x1e7e90,null))[_0xa2c5('0x28')](handleError(_0x1e7e90,null));};exports[_0xa2c5('0xdb')]=function(_0x4511c4,_0x51b290,_0x22d077){var _0x4f0022,_0x296553,_0x2c4b47;return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0x4511c4[_0xa2c5('0x5a')]['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x51b290,null))['then'](function(_0x59065f){if(_0x59065f){_0x2c4b47=_0x59065f;logger[_0xa2c5('0xb2')](_0xa2c5('0x21'),_0xa2c5('0x29'),_0xa2c5('0xc9'),_0x59065f[_0xa2c5('0x44')],util[_0xa2c5('0xca')](_0x4511c4[_0xa2c5('0x46')],{'showHidden':![],'depth':null}));switch(_0x59065f[_0xa2c5('0x44')]){case _0xa2c5('0x8d'):if(_0x4511c4[_0xa2c5('0x46')][_0xa2c5('0xdc')]&&_0x4511c4[_0xa2c5('0x46')][_0xa2c5('0xdd')]){_0x296553=_0x4511c4['query']['state'];return db[_0xa2c5('0xa8')][_0xa2c5('0x5d')]({'where':{'messageId':_0x4511c4[_0xa2c5('0x46')][_0xa2c5('0xdc')]}});}break;}}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x51b290,null))[_0xa2c5('0x1f')](function(_0x273203){if(_0x273203){_0x4f0022=_0x273203;switch(_0x2c4b47['type']){case _0xa2c5('0x8d'):if(_0x296553==='2'||_0x296553==='6'){return _0x4f0022[_0xa2c5('0x34')]({'read':!![]});}else{logger[_0xa2c5('0x23')](_0xa2c5('0x21'),_0xa2c5('0x29'),_0xa2c5('0x8d'),util[_0xa2c5('0xca')](_0x4511c4[_0xa2c5('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x4f0022;}})['then'](respondWithResult(_0x51b290,null))[_0xa2c5('0x28')](handleError(_0x51b290,null));};exports[_0xa2c5('0xde')]=function(_0xe80199,_0x2f2ed8,_0x5bcb1a){return db[_0xa2c5('0x41')][_0xa2c5('0x5d')]({'where':{'id':_0xe80199['params']['id']}})[_0xa2c5('0x1f')](handleEntityNotFound(_0x2f2ed8,null))[_0xa2c5('0x1f')](function(_0x3ab4a2){if(_0x3ab4a2){return _0x3ab4a2[_0xa2c5('0xde')](_0xe80199[_0xa2c5('0x5f')][_0xa2c5('0x6c')],_['omit'](_0xe80199[_0xa2c5('0x5f')],[_0xa2c5('0x6c'),'id'])||{})[_0xa2c5('0xa1')](function(_0xd1367c){for(var _0x2f1435=0x0;_0x2f1435<_0xe80199[_0xa2c5('0x5f')][_0xa2c5('0x6c')][_0xa2c5('0x4b')];_0x2f1435+=0x1){socket[_0xa2c5('0xdf')](_0xa2c5('0xe0'),{'UserId':Number(_0xe80199[_0xa2c5('0x5f')][_0xa2c5('0x6c')][_0x2f1435]),'SmsAccountId':Number(_0xe80199[_0xa2c5('0x5a')]['id'])});}return _0xd1367c;});}})['then'](respondWithResult(_0x2f2ed8,null))['catch'](handleError(_0x2f2ed8,null));};exports[_0xa2c5('0xe1')]=function(_0x33a3d9,_0x2d64db,_0x30469d){return db[_0xa2c5('0x41')]['find']({'where':{'id':_0x33a3d9[_0xa2c5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2d64db,null))['then'](function(_0xdd0c16){if(_0xdd0c16){return _0xdd0c16['removeAgents'](_0x33a3d9[_0xa2c5('0x46')][_0xa2c5('0x6c')])['then'](function(){if(_[_0xa2c5('0xe2')](_0x33a3d9['query']['ids'])){for(var _0x2be8ba=0x0;_0x2be8ba<_0x33a3d9[_0xa2c5('0x46')]['ids'][_0xa2c5('0x4b')];_0x2be8ba+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x33a3d9[_0xa2c5('0x46')][_0xa2c5('0x6c')][_0x2be8ba]),'SmsAccountId':Number(_0x33a3d9[_0xa2c5('0x5a')]['id'])});}}else{socket[_0xa2c5('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x33a3d9[_0xa2c5('0x46')][_0xa2c5('0x6c')]),'SmsAccountId':Number(_0x33a3d9[_0xa2c5('0x5a')]['id'])});}});}})[_0xa2c5('0x1f')](respondWithStatusCode(_0x2d64db,null))[_0xa2c5('0x28')](handleError(_0x2d64db,null));};exports[_0xa2c5('0xe3')]=function(_0x1df126,_0x2b2d07,_0x4905a7){var _0x47a0bf={};var _0x33ff88={};var _0x1b7c94;var _0x209c68;return db[_0xa2c5('0x41')]['findOne']({'where':{'id':_0x1df126[_0xa2c5('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2b2d07,null))[_0xa2c5('0x1f')](function(_0x1d4ad6){if(_0x1d4ad6){_0x1b7c94=_0x1d4ad6;_0x33ff88[_0xa2c5('0x45')]=_[_0xa2c5('0x47')](db[_0xa2c5('0xab')]['rawAttributes']);_0x33ff88[_0xa2c5('0x46')]=_['keys'](_0x1df126[_0xa2c5('0x46')]);_0x33ff88[_0xa2c5('0x5c')]=_[_0xa2c5('0x48')](_0x33ff88['model'],_0x33ff88[_0xa2c5('0x46')]);_0x47a0bf[_0xa2c5('0x49')]=_[_0xa2c5('0x48')](_0x33ff88['model'],qs['fields'](_0x1df126['query']['fields']));_0x47a0bf[_0xa2c5('0x49')]=_0x47a0bf[_0xa2c5('0x49')][_0xa2c5('0x4b')]?_0x47a0bf[_0xa2c5('0x49')]:_0x33ff88[_0xa2c5('0x45')];_0x47a0bf[_0xa2c5('0x4d')]=qs[_0xa2c5('0x4e')](_0x1df126[_0xa2c5('0x46')][_0xa2c5('0x4e')]);_0x47a0bf[_0xa2c5('0x52')]=qs[_0xa2c5('0x5c')](_['pick'](_0x1df126[_0xa2c5('0x46')],_0x33ff88[_0xa2c5('0x5c')]));if(_0x1df126[_0xa2c5('0x46')]['filter']){_0x47a0bf[_0xa2c5('0x52')]=_['merge'](_0x47a0bf['where'],{'$or':_[_0xa2c5('0x40')](_0x47a0bf[_0xa2c5('0x49')],function(_0x4b70e0){var _0x265c2b={};_0x265c2b[_0x4b70e0]={'$like':'%'+_0x1df126[_0xa2c5('0x46')]['filter']+'%'};return _0x265c2b;})});}_0x47a0bf=_[_0xa2c5('0x51')]({},_0x47a0bf,_0x1df126['options']);return _0x1b7c94[_0xa2c5('0xe3')](_0x47a0bf);}})[_0xa2c5('0x1f')](function(_0x7f0eb3){if(_0x7f0eb3){_0x209c68=_0x7f0eb3['length'];if(!_0x1df126[_0xa2c5('0x46')][_0xa2c5('0x6a')](_0xa2c5('0x4c'))){_0x47a0bf[_0xa2c5('0x2b')]=qs[_0xa2c5('0x2b')](_0x1df126[_0xa2c5('0x46')][_0xa2c5('0x2b')]);_0x47a0bf['offset']=qs[_0xa2c5('0x2e')](_0x1df126[_0xa2c5('0x46')][_0xa2c5('0x2e')]);}return _0x1b7c94[_0xa2c5('0xe3')](_0x47a0bf);}})['then'](function(_0x2cb4de){if(_0x2cb4de){return _0x2cb4de?{'count':_0x209c68,'rows':_0x2cb4de}:null;}})[_0xa2c5('0x1f')](respondWithResult(_0x2b2d07,null))[_0xa2c5('0x28')](handleError(_0x2b2d07,null));}; \ No newline at end of file +var _0x6500=['model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','SmsAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','Tag','tag','send','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','message_id','status_code','groupName','clickatell','redif','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x1711e0,_0x645432){var _0x186f71=function(_0x32030a){while(--_0x32030a){_0x1711e0['push'](_0x1711e0['shift']());}};_0x186f71(++_0x645432);}(_0x6500,0x17a));var _0x0650=function(_0x678720,_0x5d1b39){_0x678720=_0x678720-0x0;var _0x17a4e5=_0x6500[_0x678720];return _0x17a4e5;};'use strict';var emlformat=require(_0x0650('0x0'));var rimraf=require(_0x0650('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0650('0x2'));var rp=require('request-promise');var moment=require(_0x0650('0x3'));var BPromise=require(_0x0650('0x4'));var Mustache=require(_0x0650('0x5'));var util=require('util');var path=require(_0x0650('0x6'));var sox=require(_0x0650('0x7'));var csv=require(_0x0650('0x8'));var ejs=require(_0x0650('0x9'));var fs=require('fs');var fs_extra=require(_0x0650('0xa'));var _=require(_0x0650('0xb'));var squel=require(_0x0650('0xc'));var crypto=require(_0x0650('0xd'));var jsforce=require(_0x0650('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0650('0x8'));var querystring=require(_0x0650('0xf'));var Papa=require(_0x0650('0x10'));var Redis=require('ioredis');var authService=require(_0x0650('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0650('0x12'));var utils=require(_0x0650('0x13'));var config=require(_0x0650('0x14'));var licenseUtil=require(_0x0650('0x15'));var db=require(_0x0650('0x16'))['db'];config['redis']=_[_0x0650('0x17')](config[_0x0650('0x18')],{'host':_0x0650('0x19'),'port':0x18eb});var socket=require(_0x0650('0x1a'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x0650('0x1b')](socket);var jayson=require(_0x0650('0x1c'));var client=jayson['client'][_0x0650('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5f488a,_0x54cd55,_0x444711,_0x1320f5){return new BPromise(function(_0x36f6f3,_0x46c256){var _0x1bdbdd=_0x1320f5||client;return _0x1bdbdd[_0x0650('0x1e')](_0x5f488a,_0x444711)['then'](function(_0x39128a){logger[_0x0650('0x1f')](_0x0650('0x20'),_0x54cd55,_0x0650('0x21'));logger[_0x0650('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x54cd55,_0x0650('0x21'),JSON[_0x0650('0x23')](_0x39128a));if(_0x39128a[_0x0650('0x24')]){if(_0x39128a['error'][_0x0650('0x25')]===0x1f4){logger[_0x0650('0x24')]('SmsAccount,\x20%s,\x20%s',_0x54cd55,_0x39128a[_0x0650('0x24')]['message']);return _0x46c256(_0x39128a[_0x0650('0x24')]['message']);}logger[_0x0650('0x24')](_0x0650('0x20'),_0x54cd55,_0x39128a[_0x0650('0x24')][_0x0650('0x26')]);return _0x36f6f3(_0x39128a['error']['message']);}else{logger['info'](_0x0650('0x20'),_0x54cd55,_0x0650('0x21'));_0x36f6f3(_0x39128a[_0x0650('0x27')][_0x0650('0x26')]);}})[_0x0650('0x28')](function(_0x5c1d58){logger[_0x0650('0x24')](_0x0650('0x20'),_0x54cd55,_0x5c1d58);_0x46c256(_0x5c1d58);});});}function respondWithStatusCode(_0x196d4a,_0x4cff85){_0x4cff85=_0x4cff85||0xcc;return function(_0x3f8a6b){if(_0x3f8a6b){return _0x196d4a[_0x0650('0x29')](_0x4cff85);}return _0x196d4a[_0x0650('0x2a')](_0x4cff85)[_0x0650('0x2b')]();};}function respondWithResult(_0x1aeed9,_0x19833b){_0x19833b=_0x19833b||0xc8;return function(_0x2a5c45){if(_0x2a5c45){return _0x1aeed9[_0x0650('0x2a')](_0x19833b)[_0x0650('0x2c')](_0x2a5c45);}};}function respondWithFilteredResult(_0xec468c,_0x8d60cf){return function(_0x41f07e){if(_0x41f07e){var _0x4455cf=typeof _0x8d60cf['offset']===_0x0650('0x2d')&&typeof _0x8d60cf[_0x0650('0x2e')]===_0x0650('0x2d');var _0x6a626b=_0x41f07e[_0x0650('0x2f')];var _0x3b3d50=_0x4455cf?0x0:_0x8d60cf[_0x0650('0x30')];var _0x52781c=_0x4455cf?_0x41f07e[_0x0650('0x2f')]:_0x8d60cf[_0x0650('0x30')]+_0x8d60cf[_0x0650('0x2e')];var _0x1014c0;if(_0x52781c>=_0x6a626b){_0x52781c=_0x6a626b;_0x1014c0=0xc8;}else{_0x1014c0=0xce;}_0xec468c[_0x0650('0x2a')](_0x1014c0);return _0xec468c[_0x0650('0x31')]('Content-Range',_0x3b3d50+'-'+_0x52781c+'/'+_0x6a626b)[_0x0650('0x2c')](_0x41f07e);}return null;};}function patchUpdates(_0x47a922){return function(_0x3d5187){try{jsonpatch['apply'](_0x3d5187,_0x47a922,!![]);}catch(_0x1781ad){return BPromise[_0x0650('0x32')](_0x1781ad);}return _0x3d5187['save']();};}function saveUpdates(_0x3f2143,_0xef7183){return function(_0x5bdc33){if(_0x5bdc33){return _0x5bdc33[_0x0650('0x33')](_0x3f2143)[_0x0650('0x34')](function(_0x37171b){return _0x37171b;});}return null;};}function removeEntity(_0x118721,_0x56f721){return function(_0x8ff8a0){if(_0x8ff8a0){return _0x8ff8a0[_0x0650('0x35')]()[_0x0650('0x34')](function(){var _0x432b1b=_0x8ff8a0['get']({'plain':!![]});var _0xd4fec0=_0x0650('0x36');return db[_0x0650('0x37')]['destroy']({'where':{'type':_0xd4fec0,'resourceId':_0x432b1b['id']}})['then'](function(){return _0x8ff8a0;});})['then'](function(){_0x118721[_0x0650('0x2a')](0xcc)[_0x0650('0x2b')]();});}};}function handleEntityNotFound(_0x2690da,_0x367045){return function(_0x28b808){if(!_0x28b808){_0x2690da[_0x0650('0x29')](0x194);}return _0x28b808;};}function handleError(_0x5998f3,_0x112b4b){_0x112b4b=_0x112b4b||0x1f4;return function(_0x4fe2f9){logger[_0x0650('0x24')](_0x4fe2f9[_0x0650('0x38')]);if(_0x4fe2f9[_0x0650('0x39')]){delete _0x4fe2f9[_0x0650('0x39')];}_0x5998f3[_0x0650('0x2a')](_0x112b4b)['send'](_0x4fe2f9);};}exports[_0x0650('0x3a')]=function(_0x47373f,_0x1a969f){var _0x10086e={'include':[{'model':db[_0x0650('0x3b')],'as':_0x0650('0x3c')}]},_0x15d4b4={},_0x4798ce={'count':0x0,'rows':[]};var _0x307015=_[_0x0650('0x3d')](db[_0x0650('0x3e')][_0x0650('0x3f')],function(_0x38c569){return{'name':_0x38c569[_0x0650('0x40')],'type':_0x38c569[_0x0650('0x41')][_0x0650('0x42')]};});_0x15d4b4['model']=_[_0x0650('0x3d')](_0x307015,'name');_0x15d4b4[_0x0650('0x43')]=_[_0x0650('0x44')](_0x47373f[_0x0650('0x43')]);_0x15d4b4[_0x0650('0x45')]=_['intersection'](_0x15d4b4[_0x0650('0x46')],_0x15d4b4[_0x0650('0x43')]);_0x10086e['attributes']=_[_0x0650('0x47')](_0x15d4b4[_0x0650('0x46')],qs[_0x0650('0x48')](_0x47373f[_0x0650('0x43')][_0x0650('0x48')]));_0x10086e[_0x0650('0x49')]=_0x10086e[_0x0650('0x49')]['length']?_0x10086e[_0x0650('0x49')]:_0x15d4b4[_0x0650('0x46')];if(!_0x47373f[_0x0650('0x43')][_0x0650('0x4a')](_0x0650('0x4b'))){_0x10086e[_0x0650('0x2e')]=qs[_0x0650('0x2e')](_0x47373f[_0x0650('0x43')][_0x0650('0x2e')]);_0x10086e['offset']=qs['offset'](_0x47373f[_0x0650('0x43')][_0x0650('0x30')]);}_0x10086e['order']=qs['sort'](_0x47373f['query'][_0x0650('0x4c')]);_0x10086e[_0x0650('0x4d')]=qs['filters'](_[_0x0650('0x4e')](_0x47373f['query'],_0x15d4b4['filters']),_0x307015);if(_0x47373f[_0x0650('0x43')]['filter']){_0x10086e[_0x0650('0x4d')]=_[_0x0650('0x4f')](_0x10086e[_0x0650('0x4d')],{'$or':_[_0x0650('0x3d')](_0x307015,function(_0x3c26b1){if(_0x3c26b1[_0x0650('0x41')]!=='VIRTUAL'){var _0x448eb6={};_0x448eb6[_0x3c26b1[_0x0650('0x39')]]={'$like':'%'+_0x47373f[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0x448eb6;}})});}_0x10086e=_[_0x0650('0x4f')]({},_0x10086e,_0x47373f[_0x0650('0x51')]);var _0x20ee99={'where':_0x10086e[_0x0650('0x4d')]};return db['SmsAccount'][_0x0650('0x2f')](_0x20ee99)[_0x0650('0x34')](function(_0x2fd7dd){_0x4798ce[_0x0650('0x2f')]=_0x2fd7dd;if(_0x47373f[_0x0650('0x43')][_0x0650('0x52')]){_0x10086e[_0x0650('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0x0650('0x54')](_0x10086e);})[_0x0650('0x34')](function(_0x2522f1){_0x4798ce[_0x0650('0x55')]=_0x2522f1;return _0x4798ce;})[_0x0650('0x34')](respondWithFilteredResult(_0x1a969f,_0x10086e))[_0x0650('0x28')](handleError(_0x1a969f,null));};exports[_0x0650('0x56')]=function(_0xb51c5c,_0x39e203){var _0x3a823c={'raw':![],'where':{'id':_0xb51c5c[_0x0650('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0650('0x3c')}]},_0x425dd9={};_0x425dd9['model']=_['keys'](db['SmsAccount']['rawAttributes']);_0x425dd9[_0x0650('0x43')]=_[_0x0650('0x44')](_0xb51c5c[_0x0650('0x43')]);_0x425dd9[_0x0650('0x45')]=_[_0x0650('0x47')](_0x425dd9[_0x0650('0x46')],_0x425dd9[_0x0650('0x43')]);_0x3a823c['attributes']=_[_0x0650('0x47')](_0x425dd9[_0x0650('0x46')],qs[_0x0650('0x48')](_0xb51c5c['query'][_0x0650('0x48')]));_0x3a823c['attributes']=_0x3a823c[_0x0650('0x49')][_0x0650('0x58')]?_0x3a823c['attributes']:_0x425dd9[_0x0650('0x46')];if(_0xb51c5c[_0x0650('0x43')][_0x0650('0x52')]){_0x3a823c['include']=[{'all':!![]}];}_0x3a823c=_[_0x0650('0x4f')]({},_0x3a823c,_0xb51c5c['options']);return db[_0x0650('0x3e')]['find'](_0x3a823c)[_0x0650('0x34')](handleEntityNotFound(_0x39e203,null))['then'](respondWithResult(_0x39e203,null))['catch'](handleError(_0x39e203,null));};exports['create']=function(_0x3e7ad1,_0x37db85){return db[_0x0650('0x3e')][_0x0650('0x59')](_0x3e7ad1[_0x0650('0x5a')],{})['then'](function(_0x55a2ee){var _0x201fb3=_0x3e7ad1[_0x0650('0x5b')]['get']({'plain':!![]});if(!_0x201fb3)throw new Error(_0x0650('0x5c'));if(_0x201fb3[_0x0650('0x5d')]==='user'){var _0x5cf3a=_0x55a2ee[_0x0650('0x5e')]({'plain':!![]});var _0x4e59f9=_0x0650('0x36');return db[_0x0650('0x5f')]['find']({'where':{'name':_0x4e59f9,'userProfileId':_0x201fb3[_0x0650('0x60')]},'raw':!![]})[_0x0650('0x34')](function(_0x49e1b9){if(_0x49e1b9&&_0x49e1b9[_0x0650('0x61')]===0x0){return db[_0x0650('0x37')]['create']({'name':_0x5cf3a[_0x0650('0x39')],'resourceId':_0x5cf3a['id'],'type':_0x49e1b9[_0x0650('0x39')],'sectionId':_0x49e1b9['id']},{})[_0x0650('0x34')](function(){return _0x55a2ee;});}else{return _0x55a2ee;}})[_0x0650('0x28')](function(_0x6a461b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6a461b);throw _0x6a461b;});}return _0x55a2ee;})[_0x0650('0x34')](respondWithResult(_0x37db85,0xc9))[_0x0650('0x28')](handleError(_0x37db85,null));};exports['update']=function(_0x19d73a,_0x4e9912){if(_0x19d73a['body']['id']){delete _0x19d73a[_0x0650('0x5a')]['id'];}return db['SmsAccount'][_0x0650('0x62')]({'where':{'id':_0x19d73a['params']['id']},'include':[{'model':db['Pause'],'as':_0x0650('0x3c')}]})[_0x0650('0x34')](handleEntityNotFound(_0x4e9912,null))[_0x0650('0x34')](saveUpdates(_0x19d73a['body'],null))[_0x0650('0x34')](respondWithResult(_0x4e9912,null))[_0x0650('0x28')](handleError(_0x4e9912,null));};exports['destroy']=function(_0xe2a801,_0x102bb4){return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0xe2a801[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x102bb4,null))[_0x0650('0x34')](removeEntity(_0x102bb4,null))['catch'](handleError(_0x102bb4,null));};exports[_0x0650('0x63')]=function(_0x5d3287,_0x160dbb){return db[_0x0650('0x3e')][_0x0650('0x63')]()[_0x0650('0x34')](respondWithResult(_0x160dbb,null))[_0x0650('0x28')](handleError(_0x160dbb,null));};exports[_0x0650('0x64')]=function(_0x38142e,_0xca0751,_0x2b3103){if(_0x38142e[_0x0650('0x5a')]['id']){delete _0x38142e[_0x0650('0x5a')]['id'];}return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x38142e[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0xca0751,null))['then'](function(_0x4941b4){if(_0x4941b4){_0x38142e[_0x0650('0x5a')][_0x0650('0x65')]=_0x4941b4['id'];return db[_0x0650('0x66')]['create'](_0x38142e[_0x0650('0x5a')]);}})['then'](respondWithResult(_0xca0751,null))[_0x0650('0x28')](handleError(_0xca0751,null));};exports['getDispositions']=function(_0x2f3d80,_0x51e753,_0x329b20){var _0x15f7c1={'raw':![],'where':{}};var _0x42c434={};var _0x42d52a={'count':0x0,'rows':[]};return db[_0x0650('0x3e')][_0x0650('0x67')]({'where':{'id':_0x2f3d80[_0x0650('0x57')]['id']}})['then'](handleEntityNotFound(_0x51e753,null))['then'](function(_0x2c0c8d){if(_0x2c0c8d){_0x42c434[_0x0650('0x46')]=_[_0x0650('0x44')](db[_0x0650('0x66')][_0x0650('0x3f')]);_0x42c434[_0x0650('0x43')]=_[_0x0650('0x44')](_0x2f3d80[_0x0650('0x43')]);_0x42c434[_0x0650('0x45')]=_[_0x0650('0x47')](_0x42c434['model'],_0x42c434[_0x0650('0x43')]);_0x15f7c1[_0x0650('0x49')]=_['intersection'](_0x42c434[_0x0650('0x46')],qs[_0x0650('0x48')](_0x2f3d80[_0x0650('0x43')][_0x0650('0x48')]));_0x15f7c1[_0x0650('0x49')]=_0x15f7c1['attributes'][_0x0650('0x58')]?_0x15f7c1[_0x0650('0x49')]:_0x42c434['model'];if(!_0x2f3d80[_0x0650('0x43')][_0x0650('0x4a')](_0x0650('0x4b'))){_0x15f7c1[_0x0650('0x2e')]=qs[_0x0650('0x2e')](_0x2f3d80['query']['limit']);_0x15f7c1['offset']=qs['offset'](_0x2f3d80[_0x0650('0x43')][_0x0650('0x30')]);}_0x15f7c1[_0x0650('0x68')]=qs[_0x0650('0x4c')](_0x2f3d80[_0x0650('0x43')][_0x0650('0x4c')]);_0x15f7c1[_0x0650('0x4d')]=qs[_0x0650('0x45')](_[_0x0650('0x4e')](_0x2f3d80[_0x0650('0x43')],_0x42c434[_0x0650('0x45')]));_0x15f7c1['where'][_0x0650('0x65')]=_0x2c0c8d['id'];if(_0x2f3d80[_0x0650('0x43')]['filter']){_0x15f7c1[_0x0650('0x4d')]=_[_0x0650('0x4f')](_0x15f7c1['where'],{'$or':_[_0x0650('0x3d')](_0x15f7c1['attributes'],function(_0x1da638){var _0x2442a4={};_0x2442a4[_0x1da638]={'$like':'%'+_0x2f3d80[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0x2442a4;})});}_0x15f7c1=_[_0x0650('0x4f')]({},_0x15f7c1,_0x2f3d80[_0x0650('0x51')]);return db[_0x0650('0x66')][_0x0650('0x2f')]({'where':_0x15f7c1[_0x0650('0x4d')]})['then'](function(_0x56e08b){_0x42d52a[_0x0650('0x2f')]=_0x56e08b;if(_0x2f3d80['query'][_0x0650('0x52')]){_0x15f7c1[_0x0650('0x53')]=[{'all':!![]}];}return db[_0x0650('0x66')]['findAll'](_0x15f7c1);})[_0x0650('0x34')](function(_0x40410a){_0x42d52a[_0x0650('0x55')]=_0x40410a;return _0x42d52a;});}})['then'](respondWithFilteredResult(_0x51e753,_0x15f7c1))[_0x0650('0x28')](handleError(_0x51e753,null));};exports['removeDispositions']=function(_0x37bb40,_0x23a8cc,_0x26da55){return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x37bb40[_0x0650('0x57')]['id']}})['then'](handleEntityNotFound(_0x23a8cc,null))[_0x0650('0x34')](function(_0x47e2aa){if(_0x47e2aa){return _0x47e2aa[_0x0650('0x69')](_0x37bb40[_0x0650('0x43')][_0x0650('0x6a')]);}})['then'](respondWithStatusCode(_0x23a8cc,null))[_0x0650('0x28')](handleError(_0x23a8cc,null));};exports[_0x0650('0x6b')]=function(_0x24eb5f,_0x519762,_0x2ed6e1){if(_0x24eb5f[_0x0650('0x5a')]['id']){delete _0x24eb5f[_0x0650('0x5a')]['id'];}return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x24eb5f['params']['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x519762,null))['then'](function(_0x29b13f){if(_0x29b13f){_0x24eb5f[_0x0650('0x5a')][_0x0650('0x65')]=_0x29b13f['id'];return db['CannedAnswer']['create'](_0x24eb5f['body']);}})[_0x0650('0x34')](respondWithResult(_0x519762,null))['catch'](handleError(_0x519762,null));};exports[_0x0650('0x6c')]=function(_0x409b7e,_0x5f409d,_0x2ae59c){var _0x37683f={'raw':![],'where':{}};var _0x5b3ba2={};var _0x422955={'count':0x0,'rows':[]};return db[_0x0650('0x3e')][_0x0650('0x67')]({'where':{'id':_0x409b7e[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x5f409d,null))['then'](function(_0xd79ac1){if(_0xd79ac1){_0x5b3ba2[_0x0650('0x46')]=_[_0x0650('0x44')](db[_0x0650('0x6d')][_0x0650('0x3f')]);_0x5b3ba2[_0x0650('0x43')]=_[_0x0650('0x44')](_0x409b7e['query']);_0x5b3ba2['filters']=_[_0x0650('0x47')](_0x5b3ba2[_0x0650('0x46')],_0x5b3ba2[_0x0650('0x43')]);_0x37683f[_0x0650('0x49')]=_[_0x0650('0x47')](_0x5b3ba2[_0x0650('0x46')],qs['fields'](_0x409b7e[_0x0650('0x43')][_0x0650('0x48')]));_0x37683f['attributes']=_0x37683f[_0x0650('0x49')][_0x0650('0x58')]?_0x37683f[_0x0650('0x49')]:_0x5b3ba2[_0x0650('0x46')];if(!_0x409b7e[_0x0650('0x43')][_0x0650('0x4a')](_0x0650('0x4b'))){_0x37683f[_0x0650('0x2e')]=qs[_0x0650('0x2e')](_0x409b7e[_0x0650('0x43')]['limit']);_0x37683f[_0x0650('0x30')]=qs[_0x0650('0x30')](_0x409b7e['query'][_0x0650('0x30')]);}_0x37683f[_0x0650('0x68')]=qs[_0x0650('0x4c')](_0x409b7e[_0x0650('0x43')]['sort']);_0x37683f['where']=qs[_0x0650('0x45')](_[_0x0650('0x4e')](_0x409b7e['query'],_0x5b3ba2[_0x0650('0x45')]));_0x37683f['where'][_0x0650('0x65')]=_0xd79ac1['id'];if(_0x409b7e['query'][_0x0650('0x50')]){_0x37683f['where']=_['merge'](_0x37683f[_0x0650('0x4d')],{'$or':_['map'](_0x37683f[_0x0650('0x49')],function(_0x5619bd){var _0x212b70={};_0x212b70[_0x5619bd]={'$like':'%'+_0x409b7e[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0x212b70;})});}_0x37683f=_['merge']({},_0x37683f,_0x409b7e['options']);return db[_0x0650('0x6d')]['count']({'where':_0x37683f[_0x0650('0x4d')]})[_0x0650('0x34')](function(_0x4d9ec8){_0x422955[_0x0650('0x2f')]=_0x4d9ec8;if(_0x409b7e[_0x0650('0x43')][_0x0650('0x52')]){_0x37683f[_0x0650('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0650('0x54')](_0x37683f);})['then'](function(_0x43d483){_0x422955[_0x0650('0x55')]=_0x43d483;return _0x422955;});}})[_0x0650('0x34')](respondWithFilteredResult(_0x5f409d,_0x37683f))[_0x0650('0x28')](handleError(_0x5f409d,null));};exports['removeAnswers']=function(_0x2eb239,_0x1ac44f,_0x537666){return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x2eb239[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x1ac44f,null))[_0x0650('0x34')](function(_0x2bcca8){if(_0x2bcca8){return _0x2bcca8[_0x0650('0x6e')](_0x2eb239[_0x0650('0x43')][_0x0650('0x6a')]);}})[_0x0650('0x34')](respondWithStatusCode(_0x1ac44f,null))[_0x0650('0x28')](handleError(_0x1ac44f,null));};exports[_0x0650('0x6f')]=function(_0x2ec19e,_0x36c572,_0x39838e){var _0x2461b8={'channel':_0x0650('0x70')};var _0x5e89b0=[];var _0x17ff3a=[];var _0x47a658={};return db[_0x0650('0x3e')]['find']({'where':{'id':_0x2ec19e[_0x0650('0x57')]['id']},'include':[{'model':db[_0x0650('0x71')],'as':_0x0650('0x72')}]})['then'](handleEntityNotFound(_0x36c572,null))[_0x0650('0x34')](function(_0x7a4bd3){_0x2461b8[_0x0650('0x73')]=_0x7a4bd3;_0x2461b8[_0x0650('0x74')]=_[_0x0650('0x75')](_0x7a4bd3[_0x0650('0x72')],[_0x0650('0x76')],[_0x0650('0x77')]);if(_0x2461b8[_0x0650('0x73')][_0x0650('0x72')]){delete _0x2461b8[_0x0650('0x73')][_0x0650('0x72')];}return db[_0x0650('0x78')]['describe']();})['then'](function(_0x295e76){if(!_0x295e76){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))](_0x0650('0x7b'));}_0x5e89b0=_['difference'](_['keys'](_0x295e76),[_0x0650('0x7c'),_0x0650('0x7d')]);_0x17ff3a=_[_0x0650('0x7e')](_[_0x0650('0x44')](_0x295e76),[_0x0650('0x7c'),_0x0650('0x7d'),_0x0650('0x7f'),_0x0650('0x80')]);_0x2461b8[_0x0650('0x5a')]={'mapKey':'mobile'};if(_0x2461b8[_0x0650('0x73')]['type']){switch(_0x2461b8[_0x0650('0x73')][_0x0650('0x41')]){case'twilio':_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x82')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x83')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x84')]=_0x2ec19e['body'][_0x0650('0x85')];break;case _0x0650('0x86'):_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')]='+'+_0x2ec19e[_0x0650('0x5a')][_0x0650('0x87')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e['body']['text'];break;case _0x0650('0x88'):_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')]=_0x2ec19e['body'][_0x0650('0x81')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x26')];break;case _0x0650('0x89'):_0x2461b8[_0x0650('0x5a')]['from']=_0x2ec19e[_0x0650('0x5a')]['from'];_0x2461b8[_0x0650('0x5a')]['body']=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x5a')];_0x2461b8['body'][_0x0650('0x84')]=_0x2ec19e[_0x0650('0x5a')]['message_id'];break;case _0x0650('0x8a'):_0x2461b8[_0x0650('0x5a')]['from']=_0x2ec19e['body']['From'];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x8b')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x84')]=_0x2ec19e['body'][_0x0650('0x8c')];break;case _0x0650('0x8d'):_0x2461b8[_0x0650('0x5a')]['from']='+'+_0x2ec19e[_0x0650('0x5a')][_0x0650('0x8e')][0x0][_0x0650('0x81')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x8e')][0x0][_0x0650('0x8f')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x84')]=_0x2ec19e[_0x0650('0x5a')]['results'][0x0]['messageId'];break;case _0x0650('0x90'):_0x2461b8['body'][_0x0650('0x81')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x91')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x92')][_0x0650('0x26')];break;case'clickatell':_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')]=_0x2ec19e['body'][_0x0650('0x93')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x8f')];_0x2461b8[_0x0650('0x5a')][_0x0650('0x84')]=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x94')];break;case _0x0650('0x95'):_0x2461b8['body']['messageId']=_0x2ec19e[_0x0650('0x5a')][0x0][_0x0650('0x26')]['id'];_0x2461b8[_0x0650('0x5a')]['from']=_0x2ec19e[_0x0650('0x5a')][0x0][_0x0650('0x26')]['from'];_0x2461b8[_0x0650('0x5a')]['body']=_0x2ec19e[_0x0650('0x5a')][0x0][_0x0650('0x26')]['text'];break;case _0x0650('0x96'):_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')]=_0x2ec19e[_0x0650('0x5a')]['from'];_0x2461b8['body']['body']=_0x2ec19e[_0x0650('0x5a')][_0x0650('0x26')];_0x2461b8['body'][_0x0650('0x84')]=_0x2ec19e['body'][_0x0650('0x97')];break;}}if(_0x2461b8[_0x0650('0x5a')]['id']){delete _0x2461b8[_0x0650('0x5a')]['id'];}if(_[_0x0650('0x98')](_0x2461b8['body'][_0x0650('0x81')])){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))](_0x0650('0x99'));}if(_[_0x0650('0x98')](_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')])||_0x2461b8[_0x0650('0x5a')][_0x0650('0x5a')]===''){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))](_0x0650('0x9a'));}if(_[_0x0650('0x98')](_0x2461b8[_0x0650('0x5a')]['mapKey'])){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17ff3a);}if(!_[_0x0650('0x9b')](_0x17ff3a,_0x2461b8[_0x0650('0x5a')][_0x0650('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x0650('0x9d')+_0x17ff3a);}_0x47a658[_0x2461b8[_0x0650('0x5a')]['mapKey']]=_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')];return db[_0x0650('0x9e')][_0x0650('0x62')]({'where':{'id':_0x2461b8[_0x0650('0x73')]['ListId']},'include':[{'model':db[_0x0650('0x78')],'as':_0x0650('0x9f'),'where':_0x47a658,'limit':0x1,'order':[[_0x0650('0x7d'),_0x0650('0xa0')]]}]});})[_0x0650('0x34')](handleEntityNotFound(_0x36c572,null))['then'](function(_0x32b1b8){if(_0x32b1b8){_0x2461b8[_0x0650('0xa1')]=_[_0x0650('0xa2')](_0x32b1b8,[_0x0650('0x9f')]);if(_0x32b1b8['Contacts'][_0x0650('0x58')]){return _0x32b1b8[_0x0650('0x9f')][0x0];}var _0x835a5e=_['defaults'](_0x2461b8[_0x0650('0x5a')],{'firstName':_0x2461b8['body']['from'],'ListId':_0x32b1b8['id']});_0x835a5e[_0x2461b8['body'][_0x0650('0x9c')]]=_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')];return db[_0x0650('0x78')][_0x0650('0x59')](_0x835a5e,{'fields':_0x5e89b0,'raw':!![]});}})[_0x0650('0x34')](handleEntityNotFound(_0x36c572,null))['then'](function(_0x308efc){if(_0x308efc){_0x2461b8[_0x0650('0xa3')]=_0x308efc;var _0x2b152e={'ContactId':_0x308efc['id'],'phone':_0x2461b8[_0x0650('0x5a')][_0x0650('0x81')],'SmsAccountId':_0x2ec19e[_0x0650('0x57')]['id']};var _0x3676e8={'ContactId':_0x308efc['id'],'SmsAccountId':_0x2ec19e[_0x0650('0x57')]['id'],'closed':![]};return db[_0x0650('0xa4')]['find']({'where':_0x3676e8})[_0x0650('0x34')](function(_0x12d1ec){if(_0x12d1ec){return[_0x12d1ec,![]];}return db[_0x0650('0xa4')][_0x0650('0x59')](_0x2b152e)[_0x0650('0x34')](function(_0x4b93b9){return[_0x4b93b9,!![]];});});}})[_0x0650('0xa5')](function(_0x250fa3,_0x9be1c2){_0x2461b8[_0x0650('0xa6')]=_0x250fa3[_0x0650('0x5e')]({'plain':!![]});_0x2461b8[_0x0650('0xa6')][_0x0650('0xa7')]=![];if(_0x9be1c2){if(_0x2461b8[_0x0650('0x73')][_0x0650('0xa8')]){_0x2461b8['applications'][_0x0650('0xa9')]({'id':0x0,'priority':_0x2461b8[_0x0650('0x74')][_0x0650('0x58')]+0x1,'app':_0x0650('0xaa'),'appdata':_0x0650('0xab'),'interval':_0x0650('0xac')});}_0x2461b8[_0x0650('0xa6')][_0x0650('0xa7')]=!![];}return db[_0x0650('0xad')]['create']({'phone':_0x2461b8[_0x0650('0x5a')]['from'],'messageId':_0x2461b8[_0x0650('0x5a')][_0x0650('0x84')],'body':_0x2461b8['body'][_0x0650('0x5a')],'SmsAccountId':_0x2ec19e[_0x0650('0x57')]['id'],'SmsInteractionId':_0x250fa3['id'],'direction':'in','ContactId':_0x250fa3[_0x0650('0xae')],'AttachmentId':_0x2461b8[_0x0650('0x5a')]['AttachmentId']});})[_0x0650('0x34')](function(_0x4b52be){_0x2461b8['message']=_0x4b52be;if(_0x2461b8[_0x0650('0xa6')][_0x0650('0xaf')]){return db[_0x0650('0xb0')][_0x0650('0x62')]({'attributes':['id','name'],'where':{'id':_0x2461b8[_0x0650('0xa6')]['UserId']}})['then'](function(_0x1fe983){if(_0x1fe983){_0x2461b8[_0x0650('0x74')][_0x0650('0xb1')]({'id':0x0,'priority':0x0,'app':_0x0650('0xb2'),'appdata':_0x1fe983[_0x0650('0x39')]+','+(_0x2461b8[_0x0650('0x73')][_0x0650('0xb3')]||0xa),'interval':_0x0650('0xac')});}return respondWithRpcPromise('Start','startRouting',_0x2461b8);});}return respondWithRpcPromise(_0x0650('0xb4'),'startRouting',_0x2461b8);})[_0x0650('0x34')](function(_0x128d25){if(_0x128d25){var _0x308bc2=0xc8;var _0x23790b=_0x0650('0xb5');logger[_0x0650('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x23790b,_0x308bc2,_0x0650('0xb6'));logger[_0x0650('0x22')](_0x0650('0xb7'),_0x23790b,_0x308bc2,_0x0650('0xb6'),JSON[_0x0650('0x23')](_0x128d25));if(_0x2461b8[_0x0650('0x73')]['type']==='twilio'){return _0x36c572[_0x0650('0x2a')](_0x308bc2)[_0x0650('0x31')](_0x0650('0xb8'),_0x0650('0xb9'))['send']('\x0a');}else{return _0x36c572[_0x0650('0x2a')](_0x308bc2)['json'](_0x128d25);}}})['catch'](handleError(_0x36c572,null));};exports[_0x0650('0xba')]=function(_0x59756f,_0x3274c4,_0x412fe4){return db[_0x0650('0x3e')][_0x0650('0x67')]({'where':{'id':_0x59756f[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x3274c4,null))[_0x0650('0x34')](function(_0x54ce90){if(_0x54ce90){return db['sequelize'][_0x0650('0xbb')](function(_0xf59d9c){return db[_0x0650('0x71')][_0x0650('0x35')]({'where':{'SmsAccountId':_0x59756f[_0x0650('0x57')]['id']},'transaction':_0xf59d9c})['then'](function(_0x5823c8){var _0x59d025=_[_0x0650('0x3d')](_0x59756f[_0x0650('0x5a')],function(_0x284140){_0x284140[_0x0650('0x65')]=_0x59756f[_0x0650('0x57')]['id'];return _0x284140;});return db[_0x0650('0x71')][_0x0650('0xbc')](_0x59d025,{'transaction':_0xf59d9c});});})[_0x0650('0x34')](function(){return db['SmsApplication'][_0x0650('0xbd')]({'where':{'SmsAccountId':_0x59756f[_0x0650('0x57')]['id']},'order':_0x0650('0x76')});});}})[_0x0650('0x34')](respondWithResult(_0x3274c4,null))[_0x0650('0x28')](handleError(_0x3274c4,null));};exports[_0x0650('0xbe')]=function(_0x28d471,_0x805f78,_0x1372f8){var _0x39c598={};var _0x4e8181={};var _0x2ea379;var _0x6a8722;return db[_0x0650('0x3e')]['findOne']({'where':{'id':_0x28d471[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x805f78,null))[_0x0650('0x34')](function(_0x574ab8){if(_0x574ab8){_0x2ea379=_0x574ab8;_0x4e8181[_0x0650('0x46')]=_[_0x0650('0x44')](db[_0x0650('0x71')][_0x0650('0x3f')]);_0x4e8181[_0x0650('0x43')]=_['keys'](_0x28d471[_0x0650('0x43')]);_0x4e8181[_0x0650('0x45')]=_[_0x0650('0x47')](_0x4e8181[_0x0650('0x46')],_0x4e8181[_0x0650('0x43')]);_0x39c598[_0x0650('0x49')]=_[_0x0650('0x47')](_0x4e8181[_0x0650('0x46')],qs['fields'](_0x28d471[_0x0650('0x43')][_0x0650('0x48')]));_0x39c598[_0x0650('0x49')]=_0x39c598[_0x0650('0x49')][_0x0650('0x58')]?_0x39c598[_0x0650('0x49')]:_0x4e8181['model'];_0x39c598[_0x0650('0x68')]=qs[_0x0650('0x4c')](_0x28d471[_0x0650('0x43')]['sort']);_0x39c598[_0x0650('0x4d')]=qs[_0x0650('0x45')](_[_0x0650('0x4e')](_0x28d471[_0x0650('0x43')],_0x4e8181[_0x0650('0x45')]));if(_0x28d471[_0x0650('0x43')]['filter']){_0x39c598[_0x0650('0x4d')]=_['merge'](_0x39c598[_0x0650('0x4d')],{'$or':_[_0x0650('0x3d')](_0x39c598[_0x0650('0x49')],function(_0x33205a){var _0x56ea87={};_0x56ea87[_0x33205a]={'$like':'%'+_0x28d471[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0x56ea87;})});}_0x39c598=_[_0x0650('0x4f')]({},_0x39c598,_0x28d471['options']);return _0x2ea379['getApplications'](_0x39c598);}})[_0x0650('0x34')](function(_0x55411c){if(_0x55411c){_0x6a8722=_0x55411c['length'];if(!_0x28d471['query'][_0x0650('0x4a')](_0x0650('0x4b'))){_0x39c598[_0x0650('0x2e')]=qs[_0x0650('0x2e')](_0x28d471[_0x0650('0x43')][_0x0650('0x2e')]);_0x39c598[_0x0650('0x30')]=qs[_0x0650('0x30')](_0x28d471[_0x0650('0x43')][_0x0650('0x30')]);}return _0x2ea379['getApplications'](_0x39c598);}})[_0x0650('0x34')](function(_0x148d80){if(_0x148d80){return _0x148d80?{'count':_0x6a8722,'rows':_0x148d80}:null;}})[_0x0650('0x34')](respondWithResult(_0x805f78,null))[_0x0650('0x28')](handleError(_0x805f78,null));};exports['getInteractions']=function(_0x1f20c0,_0x4d251b,_0x765729){var _0x118f5={'raw':![],'where':{}};var _0x47ae31={};var _0x5ade85={'count':0x0,'rows':[]};return db[_0x0650('0x3e')]['findOne']({'where':{'id':_0x1f20c0[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x4d251b,null))[_0x0650('0x34')](function(_0x2a3d0b){if(_0x2a3d0b){_0x47ae31[_0x0650('0x46')]=_[_0x0650('0x44')](db[_0x0650('0xa4')][_0x0650('0x3f')]);_0x47ae31[_0x0650('0x43')]=_[_0x0650('0x44')](_0x1f20c0['query']);_0x47ae31[_0x0650('0x45')]=_[_0x0650('0x47')](_0x47ae31['model'],_0x47ae31['query']);_0x118f5[_0x0650('0x49')]=_[_0x0650('0x47')](_0x47ae31['model'],qs[_0x0650('0x48')](_0x1f20c0[_0x0650('0x43')][_0x0650('0x48')]));_0x118f5[_0x0650('0x49')]=_0x118f5[_0x0650('0x49')]['length']?_0x118f5[_0x0650('0x49')]:_0x47ae31['model'];if(!_0x1f20c0[_0x0650('0x43')][_0x0650('0x4a')](_0x0650('0x4b'))){_0x118f5['limit']=qs[_0x0650('0x2e')](_0x1f20c0[_0x0650('0x43')][_0x0650('0x2e')]);_0x118f5['offset']=qs[_0x0650('0x30')](_0x1f20c0[_0x0650('0x43')]['offset']);}_0x118f5[_0x0650('0x68')]=qs[_0x0650('0x4c')](_0x1f20c0['query'][_0x0650('0x4c')]);_0x118f5[_0x0650('0x4d')]=qs[_0x0650('0x45')](_[_0x0650('0x4e')](_0x1f20c0[_0x0650('0x43')],_0x47ae31['filters']));_0x118f5[_0x0650('0x4d')][_0x0650('0x65')]=_0x2a3d0b['id'];if(_0x1f20c0[_0x0650('0x43')][_0x0650('0x50')]){_0x118f5[_0x0650('0x4d')]=_[_0x0650('0x4f')](_0x118f5['where'],{'$or':_['map'](_0x118f5['attributes'],function(_0x572216){var _0xcf4a2={};_0xcf4a2[_0x572216]={'$like':'%'+_0x1f20c0[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0xcf4a2;})});}_0x118f5=_[_0x0650('0x4f')]({},_0x118f5,_0x1f20c0[_0x0650('0x51')]);return db[_0x0650('0xa4')]['count']({'where':_0x118f5[_0x0650('0x4d')]})['then'](function(_0x2ca284){_0x5ade85[_0x0650('0x2f')]=_0x2ca284;if(_0x1f20c0[_0x0650('0x43')][_0x0650('0x52')]){_0x118f5[_0x0650('0x53')]=[{'model':db['CmContact'],'as':_0x0650('0xbf'),'required':![]},{'model':db['User'],'as':_0x0650('0xc0'),'attributes':[_0x0650('0x39'),'fullname','internal'],'required':![]},{'model':db[_0x0650('0xc1')],'as':'Tags','attributes':['id',_0x0650('0x39'),'color'],'where':_0x1f20c0[_0x0650('0x43')][_0x0650('0xc2')]?{'id':_0x1f20c0[_0x0650('0x43')][_0x0650('0xc2')]}:undefined,'required':_0x1f20c0['query'][_0x0650('0xc2')]?!![]:![]}];}return db[_0x0650('0xa4')][_0x0650('0x54')](_0x118f5);})['then'](function(_0x5f3562){_0x5ade85[_0x0650('0x55')]=_0x5f3562;return _0x5ade85;});}})[_0x0650('0x34')](respondWithFilteredResult(_0x4d251b,_0x118f5))[_0x0650('0x28')](handleError(_0x4d251b,null));};exports[_0x0650('0xc3')]=function(_0x258238,_0x3a624f,_0xdbdf46){var _0x1445b1,_0x69e572,_0xbc0daa;if(_[_0x0650('0x98')](_0x258238[_0x0650('0x5a')][_0x0650('0x5a')])||_0x258238[_0x0650('0x5a')][_0x0650('0x5a')]===''){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))](_0x0650('0x9a'));}if(_[_0x0650('0x98')](_0x258238[_0x0650('0x5a')]['to'])){throw new db[(_0x0650('0x79'))][(_0x0650('0x7a'))](_0x0650('0xc4'));}_0x1445b1=_0x258238[_0x0650('0x5a')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x258238['params']['id']},'include':[{'model':db[_0x0650('0x9e')],'as':_0x0650('0xc5'),'include':[{'model':db[_0x0650('0x78')],'as':_0x0650('0x9f'),'where':{'mobile':_0x1445b1},'limit':0x1,'order':[[_0x0650('0x7d'),_0x0650('0xa0')]]}]}]})['then'](handleEntityNotFound(_0x3a624f,null))['then'](function(_0x5abfd4){if(_0x5abfd4&&_0x5abfd4['List']){_0x69e572=_0x5abfd4['get']({'plain':!![]});if(_0x69e572[_0x0650('0xc5')]&&_0x69e572['List'][_0x0650('0x9f')]['length']){return _0x69e572[_0x0650('0xc5')]['Contacts'][0x0];}return db[_0x0650('0x78')][_0x0650('0x59')](_['defaults'](_0x258238[_0x0650('0x5a')],{'firstName':_0x1445b1,'mobile':_0x1445b1,'phone':_0x1445b1,'ListId':_0x69e572[_0x0650('0x80')]}));}})['then'](handleEntityNotFound(_0x3a624f,null))['then'](function(_0x140f70){if(_0x140f70){_0xbc0daa=_0x140f70;return db[_0x0650('0xa4')]['find']({'where':{'ContactId':_0xbc0daa['id'],'closed':![],'SmsAccountId':_0x69e572['id']}})[_0x0650('0x34')](function(_0x45af42){if(_0x45af42){return[_0x45af42,![]];}return db['SmsInteraction'][_0x0650('0x59')]({'UserId':_0x258238[_0x0650('0x5b')]['id'],'ContactId':_0xbc0daa['id'],'SmsAccountId':_0x69e572['id'],'phone':_0x1445b1,'firstMsgDirection':_0x0650('0xc6'),'Messages':[_[_0x0650('0x4f')](_0x258238[_0x0650('0x5a')],{'read':![],'body':_0x258238[_0x0650('0x5a')][_0x0650('0x5a')],'phone':_0x1445b1,'SmsAccountId':_0x69e572['id'],'UserId':_0x258238[_0x0650('0x5b')]['id'],'ContactId':_0xbc0daa['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x0650('0xc7')}]})[_0x0650('0x34')](function(_0x4642a1){return[_0x4642a1,!![]];});});}})[_0x0650('0xa5')](function(_0xb5ab2a,_0x117a91){if(_0x117a91){return _0xb5ab2a;}return db[_0x0650('0xad')]['create'](_['merge'](_0x258238[_0x0650('0x5a')],{'read':![],'body':_0x258238[_0x0650('0x5a')][_0x0650('0x5a')],'phone':_0x1445b1,'SmsAccountId':_0x69e572['id'],'SmsInteractionId':_0xb5ab2a['id'],'UserId':_0x258238['user']['id'],'ContactId':_0xbc0daa['id']}))[_0x0650('0x34')](function(_0x23ded6){_0xb5ab2a[_0x0650('0xc8')][_0x0650('0xc7')]=[];_0xb5ab2a[_0x0650('0xc8')]['Messages'][_0x0650('0xa9')](_0x23ded6[_0x0650('0xc8')]);return _0xb5ab2a;});})['then'](respondWithResult(_0x3a624f,null))[_0x0650('0x28')](handleError(_0x3a624f,null));};exports['status']=function(_0x568156,_0x598e99,_0xba4704){if(_0x568156['body']['id']){delete _0x568156[_0x0650('0x5a')]['id'];}var _0x48d9f6,_0x58d93f,_0x22ee08;return db[_0x0650('0x3e')]['find']({'where':{'id':_0x568156[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x598e99,null))[_0x0650('0x34')](function(_0x128e8e){if(_0x128e8e){_0x22ee08=_0x128e8e;logger[_0x0650('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0650('0x2a'),_0x0650('0xc9'),_0x128e8e[_0x0650('0x41')],util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));switch(_0x128e8e[_0x0650('0x41')]){case _0x0650('0x86'):if(_0x568156[_0x0650('0x5a')]['skebby_dispatch_id']&&_0x568156[_0x0650('0x5a')][_0x0650('0x2a')]){_0x58d93f=_0x568156[_0x0650('0x5a')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x568156['body'][_0x0650('0xcb')]}});}break;case _0x0650('0x88'):if(_0x568156['body'][_0x0650('0xcc')]&&_0x568156['body']['statusInt']){_0x58d93f=_0x568156[_0x0650('0x5a')]['statusInt'];return db[_0x0650('0xad')][_0x0650('0x62')]({'where':{'messageId':_0x568156[_0x0650('0x5a')]['requestid']}});}break;case _0x0650('0x89'):if(_0x568156[_0x0650('0x5a')][_0x0650('0xcd')]&&_0x568156['body'][_0x0650('0xce')]){_0x58d93f=_0x568156[_0x0650('0x5a')][_0x0650('0xce')];return db[_0x0650('0xad')][_0x0650('0x62')]({'where':{'messageId':_0x568156[_0x0650('0x5a')][_0x0650('0xcd')]}});}break;case _0x0650('0x8d'):var _0x3eea1e=_0x568156[_0x0650('0x5a')][_0x0650('0x8e')][0x0];if(_0x3eea1e[_0x0650('0x84')]&&_0x3eea1e[_0x0650('0x2a')][_0x0650('0xcf')]==='DELIVERED'){_0x58d93f=_0x3eea1e[_0x0650('0x2a')][_0x0650('0xcf')];return db[_0x0650('0xad')][_0x0650('0x62')]({'where':{'messageId':_0x3eea1e['messageId']}});}break;case _0x0650('0xd0'):if(_0x568156[_0x0650('0x5a')]['messageId']&&_0x568156[_0x0650('0x5a')][_0x0650('0x2a')]){_0x58d93f=_0x568156[_0x0650('0x5a')][_0x0650('0x2a')];return db['SmsMessage'][_0x0650('0x62')]({'where':{'messageId':_0x568156[_0x0650('0x5a')][_0x0650('0x84')]}});}break;case _0x0650('0x95'):if(_0x568156['body'][0x0]['message']['id']){_0x58d93f=_0x568156[_0x0650('0x5a')][0x0]['type'];return db[_0x0650('0xad')]['find']({'where':{'messageId':_0x568156[_0x0650('0x5a')][0x0][_0x0650('0x26')]['id']}});}break;case _0x0650('0x96'):if(_0x568156['body'][_0x0650('0xd1')]&&_0x568156[_0x0650('0x5a')]['status']){_0x58d93f=_0x568156['body']['status'];return db[_0x0650('0xad')]['find']({'where':{'messageId':_0x568156['body'][_0x0650('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x598e99,null))[_0x0650('0x34')](function(_0x458ac4){if(_0x458ac4){_0x48d9f6=_0x458ac4;switch(_0x22ee08['type']){case'skebby':if(_0x58d93f===_0x0650('0xd2')){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')](_0x0650('0xd3'),_0x0650('0x2a'),_0x0650('0x86'),util[_0x0650('0xca')](_0x568156['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x58d93f==='1'){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger['error'](_0x0650('0xd3'),'status','skebby',util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0650('0x89'):if(!_0x568156[_0x0650('0x5a')][_0x0650('0xd4')]&&_0x58d93f>=0xc8&&_0x58d93f<=0xce){return _0x48d9f6['update']({'read':!![]});}else{logger[_0x0650('0x24')](_0x0650('0xd3'),_0x0650('0x2a'),_0x0650('0x89'),util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0650('0x8d'):var _0x557850=_0x568156[_0x0650('0x5a')][_0x0650('0x8e')][0x0];if(_0x557850[_0x0650('0x2a')][_0x0650('0xcf')]==='DELIVERED'){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0650('0x2a'),'infobip',util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0650('0xd0'):if(_0x58d93f==_0x0650('0xd5')||_0x58d93f==_0x0650('0xd6')){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')](_0x0650('0xd3'),'status','clickatell',util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0650('0x95'):if(_0x58d93f==_0x0650('0xd7')){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')](_0x0650('0xd3'),_0x0650('0x2a'),_0x0650('0x95'),util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0650('0x96'):if(_0x58d93f===_0x0650('0xd8')||_0x58d93f==='ACCEPTD'){return _0x48d9f6[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0650('0x2a'),_0x0650('0x96'),util[_0x0650('0xca')](_0x568156[_0x0650('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x48d9f6;}})[_0x0650('0x34')](respondWithResult(_0x598e99,null))['catch'](handleError(_0x598e99,null));};exports['statusGet']=function(_0x391716,_0x39bce2,_0x2b411e){var _0x2c1d85,_0x51c4e5,_0x17a147;return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x391716[_0x0650('0x57')]['id']}})['then'](handleEntityNotFound(_0x39bce2,null))['then'](function(_0x292cbf){if(_0x292cbf){_0x17a147=_0x292cbf;logger[_0x0650('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x292cbf[_0x0650('0x41')],util[_0x0650('0xca')](_0x391716[_0x0650('0x43')],{'showHidden':![],'depth':null}));switch(_0x292cbf['type']){case'csc':if(_0x391716['query'][_0x0650('0xd9')]&&_0x391716[_0x0650('0x43')]['state']){_0x51c4e5=_0x391716[_0x0650('0x43')]['state'];return db[_0x0650('0xad')][_0x0650('0x62')]({'where':{'messageId':_0x391716[_0x0650('0x43')][_0x0650('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x39bce2,null))[_0x0650('0x34')](function(_0x42610e){if(_0x42610e){_0x2c1d85=_0x42610e;switch(_0x17a147[_0x0650('0x41')]){case _0x0650('0x90'):if(_0x51c4e5==='2'||_0x51c4e5==='6'){return _0x2c1d85[_0x0650('0x33')]({'read':!![]});}else{logger[_0x0650('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0650('0x90'),util[_0x0650('0xca')](_0x391716[_0x0650('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x2c1d85;}})[_0x0650('0x34')](respondWithResult(_0x39bce2,null))[_0x0650('0x28')](handleError(_0x39bce2,null));};exports[_0x0650('0xda')]=function(_0x4d5260,_0x15ac3b,_0x51dfb1){return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x4d5260[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x15ac3b,null))['then'](function(_0x52e125){if(_0x52e125){return _0x52e125['addAgents'](_0x4d5260[_0x0650('0x5a')][_0x0650('0x6a')],_[_0x0650('0xa2')](_0x4d5260[_0x0650('0x5a')],[_0x0650('0x6a'),'id'])||{})['spread'](function(_0x5ea781){for(var _0x54812c=0x0;_0x54812c<_0x4d5260[_0x0650('0x5a')][_0x0650('0x6a')][_0x0650('0x58')];_0x54812c+=0x1){socket[_0x0650('0xdb')]('userSmsAccount:save',{'UserId':Number(_0x4d5260[_0x0650('0x5a')][_0x0650('0x6a')][_0x54812c]),'SmsAccountId':Number(_0x4d5260[_0x0650('0x57')]['id'])});}return _0x5ea781;});}})[_0x0650('0x34')](respondWithResult(_0x15ac3b,null))['catch'](handleError(_0x15ac3b,null));};exports[_0x0650('0xdc')]=function(_0x8595c4,_0x35fd48,_0x13bda6){return db[_0x0650('0x3e')][_0x0650('0x62')]({'where':{'id':_0x8595c4[_0x0650('0x57')]['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x35fd48,null))[_0x0650('0x34')](function(_0x5a019f){if(_0x5a019f){return _0x5a019f[_0x0650('0xdc')](_0x8595c4['query'][_0x0650('0x6a')])[_0x0650('0x34')](function(){if(_[_0x0650('0xdd')](_0x8595c4[_0x0650('0x43')][_0x0650('0x6a')])){for(var _0x931f=0x0;_0x931f<_0x8595c4[_0x0650('0x43')]['ids'][_0x0650('0x58')];_0x931f+=0x1){socket[_0x0650('0xdb')](_0x0650('0xde'),{'UserId':Number(_0x8595c4['query']['ids'][_0x931f]),'SmsAccountId':Number(_0x8595c4['params']['id'])});}}else{socket[_0x0650('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x8595c4['query'][_0x0650('0x6a')]),'SmsAccountId':Number(_0x8595c4['params']['id'])});}});}})[_0x0650('0x34')](respondWithStatusCode(_0x35fd48,null))['catch'](handleError(_0x35fd48,null));};exports[_0x0650('0xdf')]=function(_0x1a2af2,_0x449719,_0x2a940e){var _0x4eee23={};var _0x17651d={};var _0x2c4765;var _0x21a4a2;return db[_0x0650('0x3e')][_0x0650('0x67')]({'where':{'id':_0x1a2af2['params']['id']}})[_0x0650('0x34')](handleEntityNotFound(_0x449719,null))[_0x0650('0x34')](function(_0x369003){if(_0x369003){_0x2c4765=_0x369003;_0x17651d['model']=_[_0x0650('0x44')](db[_0x0650('0xb0')][_0x0650('0x3f')]);_0x17651d[_0x0650('0x43')]=_[_0x0650('0x44')](_0x1a2af2[_0x0650('0x43')]);_0x17651d['filters']=_['intersection'](_0x17651d[_0x0650('0x46')],_0x17651d[_0x0650('0x43')]);_0x4eee23[_0x0650('0x49')]=_[_0x0650('0x47')](_0x17651d['model'],qs['fields'](_0x1a2af2[_0x0650('0x43')]['fields']));_0x4eee23['attributes']=_0x4eee23[_0x0650('0x49')][_0x0650('0x58')]?_0x4eee23[_0x0650('0x49')]:_0x17651d[_0x0650('0x46')];_0x4eee23[_0x0650('0x68')]=qs[_0x0650('0x4c')](_0x1a2af2[_0x0650('0x43')][_0x0650('0x4c')]);_0x4eee23[_0x0650('0x4d')]=qs[_0x0650('0x45')](_['pick'](_0x1a2af2[_0x0650('0x43')],_0x17651d[_0x0650('0x45')]));if(_0x1a2af2[_0x0650('0x43')][_0x0650('0x50')]){_0x4eee23[_0x0650('0x4d')]=_[_0x0650('0x4f')](_0x4eee23[_0x0650('0x4d')],{'$or':_[_0x0650('0x3d')](_0x4eee23[_0x0650('0x49')],function(_0x2adf2a){var _0x4d9c77={};_0x4d9c77[_0x2adf2a]={'$like':'%'+_0x1a2af2[_0x0650('0x43')][_0x0650('0x50')]+'%'};return _0x4d9c77;})});}_0x4eee23=_[_0x0650('0x4f')]({},_0x4eee23,_0x1a2af2[_0x0650('0x51')]);return _0x2c4765[_0x0650('0xdf')](_0x4eee23);}})[_0x0650('0x34')](function(_0x195f16){if(_0x195f16){_0x21a4a2=_0x195f16[_0x0650('0x58')];if(!_0x1a2af2[_0x0650('0x43')][_0x0650('0x4a')](_0x0650('0x4b'))){_0x4eee23['limit']=qs[_0x0650('0x2e')](_0x1a2af2[_0x0650('0x43')]['limit']);_0x4eee23['offset']=qs[_0x0650('0x30')](_0x1a2af2[_0x0650('0x43')]['offset']);}return _0x2c4765[_0x0650('0xdf')](_0x4eee23);}})[_0x0650('0x34')](function(_0x137527){if(_0x137527){return _0x137527?{'count':_0x21a4a2,'rows':_0x137527}:null;}})[_0x0650('0x34')](respondWithResult(_0x449719,null))[_0x0650('0x28')](handleError(_0x449719,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 58ac331..a1ed937 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 _0xad83=['../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x40bfbd,_0x53bd70){var _0x190034=function(_0x18059c){while(--_0x18059c){_0x40bfbd['push'](_0x40bfbd['shift']());}};_0x190034(++_0x53bd70);}(_0xad83,0x18b));var _0x3ad8=function(_0xf86978,_0x1336fb){_0xf86978=_0xf86978-0x0;var _0x2fa099=_0xad83[_0xf86978];return _0x2fa099;};'use strict';var EventEmitter=require(_0x3ad8('0x0'));var SmsAccount=require(_0x3ad8('0x1'))['db'][_0x3ad8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3ad8('0x3')](0x0);var events={'afterCreate':_0x3ad8('0x4'),'afterUpdate':_0x3ad8('0x5'),'afterDestroy':_0x3ad8('0x6')};function emitEvent(_0x38b7b4){return function(_0x30d024,_0x4249e6,_0x3ba928){SmsAccountEvents[_0x3ad8('0x7')](_0x38b7b4+':'+_0x30d024['id'],_0x30d024);SmsAccountEvents['emit'](_0x38b7b4,_0x30d024);_0x3ba928(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x3ad8('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x9c57=['hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x46920a,_0x420e2d){var _0x859987=function(_0x18d141){while(--_0x18d141){_0x46920a['push'](_0x46920a['shift']());}};_0x859987(++_0x420e2d);}(_0x9c57,0x1ed));var _0x79c5=function(_0xd548ea,_0x4ed8f4){_0xd548ea=_0xd548ea-0x0;var _0x4a83ff=_0x9c57[_0xd548ea];return _0x4a83ff;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x79c5('0x0'))['db'][_0x79c5('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x79c5('0x2')](0x0);var events={'afterCreate':_0x79c5('0x3'),'afterUpdate':_0x79c5('0x4'),'afterDestroy':_0x79c5('0x5')};function emitEvent(_0x5865c1){return function(_0x2d89a9,_0x4583af,_0x196a65){SmsAccountEvents[_0x79c5('0x6')](_0x5865c1+':'+_0x2d89a9['id'],_0x2d89a9);SmsAccountEvents[_0x79c5('0x6')](_0x5865c1,_0x2d89a9);_0x196a65(null);};}for(var e in events){if(events[_0x79c5('0x7')](e)){var event=events[e];SmsAccount[_0x79c5('0x8')](e,emitEvent(event));}}module[_0x79c5('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 651c7ce..1df0495 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 _0xb33f=['api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','SmsAccount','sms_accounts','util','../../config/logger'];(function(_0x3f48f3,_0x1153b4){var _0x381c6c=function(_0xd707e){while(--_0xd707e){_0x3f48f3['push'](_0x3f48f3['shift']());}};_0x381c6c(++_0x1153b4);}(_0xb33f,0x1ab));var _0xfb33=function(_0xe78452,_0x3d4ca3){_0xe78452=_0xe78452-0x0;var _0x13431c=_0xb33f[_0xe78452];return _0x13431c;};'use strict';var _=require('lodash');var util=require(_0xfb33('0x0'));var logger=require(_0xfb33('0x1'))(_0xfb33('0x2'));var moment=require('moment');var BPromise=require(_0xfb33('0x3'));var rp=require(_0xfb33('0x4'));var fs=require('fs');var path=require(_0xfb33('0x5'));var rimraf=require(_0xfb33('0x6'));var config=require(_0xfb33('0x7'));var attributes=require(_0xfb33('0x8'));module['exports']=function(_0x2aad43,_0x14f477){return _0x2aad43['define'](_0xfb33('0x9'),attributes,{'tableName':_0xfb33('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6804=['./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','api','request-promise','path','../../config/environment'];(function(_0x2c1cf7,_0x3923eb){var _0x4c13eb=function(_0x4e08dc){while(--_0x4e08dc){_0x2c1cf7['push'](_0x2c1cf7['shift']());}};_0x4c13eb(++_0x3923eb);}(_0x6804,0x158));var _0x4680=function(_0x211d54,_0x799b95){_0x211d54=_0x211d54-0x0;var _0x5eea3f=_0x6804[_0x211d54];return _0x5eea3f;};'use strict';var _=require(_0x4680('0x0'));var util=require(_0x4680('0x1'));var logger=require('../../config/logger')(_0x4680('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4680('0x3'));var fs=require('fs');var path=require(_0x4680('0x4'));var rimraf=require('rimraf');var config=require(_0x4680('0x5'));var attributes=require(_0x4680('0x6'));module[_0x4680('0x7')]=function(_0x7e42e4,_0x22a810){return _0x7e42e4['define'](_0x4680('0x8'),attributes,{'tableName':_0x4680('0x9'),'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 444110c..d6a47f5 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 _0x2516=['raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ShowSmsAccount','find','options'];(function(_0x3342ce,_0xa695c){var _0x4bc979=function(_0x222895){while(--_0x222895){_0x3342ce['push'](_0x3342ce['shift']());}};_0x4bc979(++_0xa695c);}(_0x2516,0x111));var _0x6251=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2516[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var moment=require(_0x6251('0x2'));var BPromise=require(_0x6251('0x3'));var rs=require(_0x6251('0x4'));var fs=require('fs');var Redis=require(_0x6251('0x5'));var db=require(_0x6251('0x6'))['db'];var utils=require(_0x6251('0x7'));var logger=require(_0x6251('0x8'))(_0x6251('0x9'));var config=require(_0x6251('0xa'));var jayson=require(_0x6251('0xb'));var client=jayson['client'][_0x6251('0xc')]({'port':0x232a});config['redis']=_[_0x6251('0xd')](config['redis'],{'host':_0x6251('0xe'),'port':0x18eb});var socket=require(_0x6251('0xf'))(new Redis(config[_0x6251('0x10')]));require(_0x6251('0x11'))[_0x6251('0x12')](socket);function respondWithRpcPromise(_0x5c3c87,_0x42ad2c,_0x3fe42d){return new BPromise(function(_0x405095,_0x3ae20b){return client['request'](_0x5c3c87,_0x3fe42d)[_0x6251('0x13')](function(_0x45e606){logger[_0x6251('0x14')](_0x6251('0x15'),_0x42ad2c,_0x6251('0x16'));logger[_0x6251('0x17')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x42ad2c,_0x6251('0x16'),JSON[_0x6251('0x18')](_0x45e606));if(_0x45e606[_0x6251('0x19')]){if(_0x45e606[_0x6251('0x19')]['code']===0x1f4){logger[_0x6251('0x19')](_0x6251('0x15'),_0x42ad2c,_0x45e606['error']['message']);return _0x3ae20b(_0x45e606['error'][_0x6251('0x1a')]);}logger[_0x6251('0x19')](_0x6251('0x15'),_0x42ad2c,_0x45e606[_0x6251('0x19')][_0x6251('0x1a')]);return _0x405095(_0x45e606[_0x6251('0x19')][_0x6251('0x1a')]);}else{logger[_0x6251('0x14')](_0x6251('0x15'),_0x42ad2c,'request\x20sent');_0x405095(_0x45e606[_0x6251('0x1b')][_0x6251('0x1a')]);}})['catch'](function(_0xd238ac){logger[_0x6251('0x19')](_0x6251('0x15'),_0x42ad2c,_0xd238ac);_0x3ae20b(_0xd238ac);});});}exports[_0x6251('0x1c')]=function(_0x15e6ad){var _0x2ecde4=this;return new Promise(function(_0x4e7f60,_0x2b44a1){return db['SmsAccount'][_0x6251('0x1d')]({'raw':_0x15e6ad[_0x6251('0x1e')]?_0x15e6ad[_0x6251('0x1e')][_0x6251('0x1f')]===undefined?!![]:![]:!![],'where':_0x15e6ad[_0x6251('0x1e')]?_0x15e6ad['options'][_0x6251('0x20')]||null:null,'attributes':_0x15e6ad[_0x6251('0x1e')]?_0x15e6ad[_0x6251('0x1e')][_0x6251('0x21')]||null:null,'include':_0x15e6ad['options']?_0x15e6ad[_0x6251('0x1e')][_0x6251('0x22')]?_[_0x6251('0x23')](_0x15e6ad[_0x6251('0x1e')][_0x6251('0x22')],function(_0x13ba5b){return{'model':db[_0x13ba5b['model']],'as':_0x13ba5b['as'],'attributes':_0x13ba5b[_0x6251('0x21')],'include':_0x13ba5b[_0x6251('0x22')]?_[_0x6251('0x23')](_0x13ba5b[_0x6251('0x22')],function(_0x8909b9){return{'model':db[_0x8909b9[_0x6251('0x24')]],'as':_0x8909b9['as'],'attributes':_0x8909b9[_0x6251('0x21')],'include':_0x8909b9[_0x6251('0x22')]?_[_0x6251('0x23')](_0x8909b9[_0x6251('0x22')],function(_0x98b79a){return{'model':db[_0x98b79a[_0x6251('0x24')]],'as':_0x98b79a['as'],'attributes':_0x98b79a[_0x6251('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6251('0x13')](function(_0x66b065){logger[_0x6251('0x14')](_0x6251('0x1c'),_0x15e6ad);logger[_0x6251('0x17')]('ShowSmsAccount',_0x15e6ad,JSON[_0x6251('0x18')](_0x66b065));_0x4e7f60(_0x66b065);})[_0x6251('0x25')](function(_0x9a954b){logger['error']('ShowSmsAccount',_0x9a954b[_0x6251('0x1a')],_0x15e6ad);_0x2b44a1(_0x2ecde4[_0x6251('0x19')](0x1f4,_0x9a954b[_0x6251('0x1a')]));});});}; \ No newline at end of file +var _0x2d32=['attributes','include','map','model','then','info','debug','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','socket.io-emitter','redis','./smsAccount.socket','register','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2d32,0x19f));var _0x22d3=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x2d32[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x22d3('0x0'));var util=require(_0x22d3('0x1'));var moment=require(_0x22d3('0x2'));var BPromise=require(_0x22d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22d3('0x4'));var logger=require(_0x22d3('0x5'))(_0x22d3('0x6'));var config=require('../../config/environment');var jayson=require(_0x22d3('0x7'));var client=jayson[_0x22d3('0x8')]['http']({'port':0x232a});config['redis']=_[_0x22d3('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x22d3('0xa'))(new Redis(config[_0x22d3('0xb')]));require(_0x22d3('0xc'))[_0x22d3('0xd')](socket);function respondWithRpcPromise(_0x92ac2f,_0xa223a6,_0x2cfd93){return new BPromise(function(_0x5f38cc,_0x212b6f){return client['request'](_0x92ac2f,_0x2cfd93)['then'](function(_0x4073e3){logger['info'](_0x22d3('0xe'),_0xa223a6,'request\x20sent');logger['debug'](_0x22d3('0xf'),_0xa223a6,'request\x20sent',JSON[_0x22d3('0x10')](_0x4073e3));if(_0x4073e3['error']){if(_0x4073e3[_0x22d3('0x11')]['code']===0x1f4){logger[_0x22d3('0x11')](_0x22d3('0xe'),_0xa223a6,_0x4073e3[_0x22d3('0x11')][_0x22d3('0x12')]);return _0x212b6f(_0x4073e3[_0x22d3('0x11')][_0x22d3('0x12')]);}logger['error'](_0x22d3('0xe'),_0xa223a6,_0x4073e3[_0x22d3('0x11')][_0x22d3('0x12')]);return _0x5f38cc(_0x4073e3[_0x22d3('0x11')]['message']);}else{logger['info'](_0x22d3('0xe'),_0xa223a6,'request\x20sent');_0x5f38cc(_0x4073e3[_0x22d3('0x13')][_0x22d3('0x12')]);}})[_0x22d3('0x14')](function(_0x1f97b7){logger[_0x22d3('0x11')]('SmsAccount,\x20%s,\x20%s',_0xa223a6,_0x1f97b7);_0x212b6f(_0x1f97b7);});});}exports[_0x22d3('0x15')]=function(_0x1b4444){var _0x16905a=this;return new Promise(function(_0xe2a799,_0x45c56d){return db[_0x22d3('0x16')][_0x22d3('0x17')]({'raw':_0x1b4444[_0x22d3('0x18')]?_0x1b4444['options'][_0x22d3('0x19')]===undefined?!![]:![]:!![],'where':_0x1b4444[_0x22d3('0x18')]?_0x1b4444[_0x22d3('0x18')][_0x22d3('0x1a')]||null:null,'attributes':_0x1b4444['options']?_0x1b4444[_0x22d3('0x18')][_0x22d3('0x1b')]||null:null,'include':_0x1b4444['options']?_0x1b4444[_0x22d3('0x18')][_0x22d3('0x1c')]?_[_0x22d3('0x1d')](_0x1b4444['options']['include'],function(_0x3d16c5){return{'model':db[_0x3d16c5[_0x22d3('0x1e')]],'as':_0x3d16c5['as'],'attributes':_0x3d16c5[_0x22d3('0x1b')],'include':_0x3d16c5['include']?_[_0x22d3('0x1d')](_0x3d16c5['include'],function(_0x4c09a9){return{'model':db[_0x4c09a9[_0x22d3('0x1e')]],'as':_0x4c09a9['as'],'attributes':_0x4c09a9['attributes'],'include':_0x4c09a9['include']?_[_0x22d3('0x1d')](_0x4c09a9[_0x22d3('0x1c')],function(_0x4d90bc){return{'model':db[_0x4d90bc[_0x22d3('0x1e')]],'as':_0x4d90bc['as'],'attributes':_0x4d90bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x22d3('0x1f')](function(_0x1cb49d){logger[_0x22d3('0x20')](_0x22d3('0x15'),_0x1b4444);logger[_0x22d3('0x21')](_0x22d3('0x15'),_0x1b4444,JSON['stringify'](_0x1cb49d));_0xe2a799(_0x1cb49d);})[_0x22d3('0x14')](function(_0x43e143){logger[_0x22d3('0x11')](_0x22d3('0x15'),_0x43e143['message'],_0x1b4444);_0x45c56d(_0x16905a[_0x22d3('0x11')](0x1f4,_0x43e143[_0x22d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7adc6af..d048a84 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(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 02ab143..a248501 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19ebef,_0x451d2c){var _0x4aac24=function(_0x55983f){while(--_0x55983f){_0x19ebef['push'](_0x19ebef['shift']());}};_0x4aac24(++_0x451d2c);}(_0x34e8,0x12c));var _0x834e=function(_0x55f661,_0x23666a){_0x55f661=_0x55f661-0x0;var _0x3096f1=_0x34e8[_0x55f661];return _0x3096f1;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x51880a,_0x14249b){var _0x30b65e=function(_0x32f787){while(--_0x32f787){_0x51880a['push'](_0x51880a['shift']());}};_0x30b65e(++_0x14249b);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'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('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 81769ef..d61215e 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 _0x7f87=['noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x8c318b,_0x309481){var _0x3c000a=function(_0x33db55){while(--_0x33db55){_0x8c318b['push'](_0x8c318b['shift']());}};_0x3c000a(++_0x309481);}(_0x7f87,0x154));var _0x77f8=function(_0x4ae13c,_0x2f94ec){_0x4ae13c=_0x4ae13c-0x0;var _0x2039c6=_0x7f87[_0x4ae13c];return _0x2039c6;};'use strict';var Sequelize=require(_0x77f8('0x0'));module[_0x77f8('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x77f8('0x2')},'appdata':{'type':Sequelize[_0x77f8('0x3')]()},'description':{'type':Sequelize[_0x77f8('0x4')]},'interval':{'type':Sequelize[_0x77f8('0x4')],'defaultValue':_0x77f8('0x5')}}; \ No newline at end of file +var _0x7514=['*,*,*,*','sequelize','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7514,0x181));var _0x4751=function(_0x1053b4,_0x30dd5a){_0x1053b4=_0x1053b4-0x0;var _0x3f4e6c=_0x7514[_0x1053b4];return _0x3f4e6c;};'use strict';var Sequelize=require(_0x4751('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4751('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4751('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4751('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index e3090b7..12dc5cd 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 _0x4426=['intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','then','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x16ca89,_0x4ddbab){var _0x4ff80c=function(_0x5980f){while(--_0x5980f){_0x16ca89['push'](_0x16ca89['shift']());}};_0x4ff80c(++_0x4ddbab);}(_0x4426,0xef));var _0x6442=function(_0x211445,_0x3d4aaa){_0x211445=_0x211445-0x0;var _0x39f9c4=_0x4426[_0x211445];return _0x39f9c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6442('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6442('0x1'));var moment=require(_0x6442('0x2'));var BPromise=require(_0x6442('0x3'));var Mustache=require(_0x6442('0x4'));var util=require(_0x6442('0x5'));var path=require('path');var sox=require(_0x6442('0x6'));var csv=require(_0x6442('0x7'));var ejs=require(_0x6442('0x8'));var fs=require('fs');var fs_extra=require(_0x6442('0x9'));var _=require(_0x6442('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6442('0xb'));var deskjs=require(_0x6442('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6442('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6442('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6442('0xf'));var hardwareService=require(_0x6442('0x10'));var logger=require(_0x6442('0x11'))(_0x6442('0x12'));var utils=require(_0x6442('0x13'));var config=require(_0x6442('0x14'));var licenseUtil=require(_0x6442('0x15'));var db=require(_0x6442('0x16'))['db'];function respondWithStatusCode(_0x3f859e,_0x1828dc){_0x1828dc=_0x1828dc||0xcc;return function(_0x2c880f){if(_0x2c880f){return _0x3f859e[_0x6442('0x17')](_0x1828dc);}return _0x3f859e['status'](_0x1828dc)['end']();};}function respondWithResult(_0x3995d0,_0x33b363){_0x33b363=_0x33b363||0xc8;return function(_0x15eed6){if(_0x15eed6){return _0x3995d0[_0x6442('0x18')](_0x33b363)[_0x6442('0x19')](_0x15eed6);}};}function respondWithFilteredResult(_0x4a390a,_0x395ab5){return function(_0x132d65){if(_0x132d65){var _0xc1adec=typeof _0x395ab5[_0x6442('0x1a')]===_0x6442('0x1b')&&typeof _0x395ab5[_0x6442('0x1c')]===_0x6442('0x1b');var _0x23514a=_0x132d65[_0x6442('0x1d')];var _0x25e4e4=_0xc1adec?0x0:_0x395ab5['offset'];var _0x3c7e73=_0xc1adec?_0x132d65[_0x6442('0x1d')]:_0x395ab5[_0x6442('0x1a')]+_0x395ab5[_0x6442('0x1c')];var _0x4bc040;if(_0x3c7e73>=_0x23514a){_0x3c7e73=_0x23514a;_0x4bc040=0xc8;}else{_0x4bc040=0xce;}_0x4a390a[_0x6442('0x18')](_0x4bc040);return _0x4a390a[_0x6442('0x1e')]('Content-Range',_0x25e4e4+'-'+_0x3c7e73+'/'+_0x23514a)[_0x6442('0x19')](_0x132d65);}return null;};}function patchUpdates(_0x3b48d6){return function(_0x506455){try{jsonpatch[_0x6442('0x1f')](_0x506455,_0x3b48d6,!![]);}catch(_0x4cecf8){return BPromise[_0x6442('0x20')](_0x4cecf8);}return _0x506455['save']();};}function saveUpdates(_0x269b72,_0x4d6815){return function(_0x5688ff){if(_0x5688ff){return _0x5688ff[_0x6442('0x21')](_0x269b72)['then'](function(_0x5afa6d){return _0x5afa6d;});}return null;};}function removeEntity(_0x3c7b78,_0x1d9616){return function(_0x3c5894){if(_0x3c5894){return _0x3c5894[_0x6442('0x22')]()['then'](function(){_0x3c7b78[_0x6442('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257d8d,_0x552b3f){return function(_0x12378e){if(!_0x12378e){_0x257d8d['sendStatus'](0x194);}return _0x12378e;};}function handleError(_0x33b125,_0x582995){_0x582995=_0x582995||0x1f4;return function(_0x26c00d){logger[_0x6442('0x23')](_0x26c00d[_0x6442('0x24')]);if(_0x26c00d[_0x6442('0x25')]){delete _0x26c00d[_0x6442('0x25')];}_0x33b125[_0x6442('0x18')](_0x582995)[_0x6442('0x26')](_0x26c00d);};}exports[_0x6442('0x27')]=function(_0x3fca44,_0x129b41){var _0x55bceb={},_0x215672={},_0x477d78={'count':0x0,'rows':[]};var _0x3a178e=_[_0x6442('0x28')](db[_0x6442('0x29')][_0x6442('0x2a')],function(_0xd3413f){return{'name':_0xd3413f[_0x6442('0x2b')],'type':_0xd3413f['type'][_0x6442('0x2c')]};});_0x215672[_0x6442('0x2d')]=_[_0x6442('0x28')](_0x3a178e,_0x6442('0x25'));_0x215672[_0x6442('0x2e')]=_[_0x6442('0x2f')](_0x3fca44['query']);_0x215672[_0x6442('0x30')]=_[_0x6442('0x31')](_0x215672[_0x6442('0x2d')],_0x215672[_0x6442('0x2e')]);_0x55bceb[_0x6442('0x32')]=_[_0x6442('0x31')](_0x215672[_0x6442('0x2d')],qs[_0x6442('0x33')](_0x3fca44[_0x6442('0x2e')][_0x6442('0x33')]));_0x55bceb[_0x6442('0x32')]=_0x55bceb[_0x6442('0x32')][_0x6442('0x34')]?_0x55bceb[_0x6442('0x32')]:_0x215672[_0x6442('0x2d')];if(!_0x3fca44['query'][_0x6442('0x35')]('nolimit')){_0x55bceb[_0x6442('0x1c')]=qs[_0x6442('0x1c')](_0x3fca44['query'][_0x6442('0x1c')]);_0x55bceb[_0x6442('0x1a')]=qs[_0x6442('0x1a')](_0x3fca44[_0x6442('0x2e')][_0x6442('0x1a')]);}_0x55bceb[_0x6442('0x36')]=qs['sort'](_0x3fca44[_0x6442('0x2e')][_0x6442('0x37')]);_0x55bceb['where']=qs[_0x6442('0x30')](_['pick'](_0x3fca44['query'],_0x215672[_0x6442('0x30')]),_0x3a178e);if(_0x3fca44['query'][_0x6442('0x38')]){_0x55bceb[_0x6442('0x39')]=_['merge'](_0x55bceb['where'],{'$or':_[_0x6442('0x28')](_0x3a178e,function(_0x51cfbe){if(_0x51cfbe[_0x6442('0x3a')]!=='VIRTUAL'){var _0x45128={};_0x45128[_0x51cfbe[_0x6442('0x25')]]={'$like':'%'+_0x3fca44[_0x6442('0x2e')][_0x6442('0x38')]+'%'};return _0x45128;}})});}_0x55bceb=_['merge']({},_0x55bceb,_0x3fca44['options']);var _0x55f4cb={'where':_0x55bceb['where']};return db['SmsApplication'][_0x6442('0x1d')](_0x55f4cb)[_0x6442('0x3b')](function(_0x2cac3c){_0x477d78[_0x6442('0x1d')]=_0x2cac3c;if(_0x3fca44[_0x6442('0x2e')][_0x6442('0x3c')]){_0x55bceb[_0x6442('0x3d')]=[{'all':!![]}];}return db[_0x6442('0x29')][_0x6442('0x3e')](_0x55bceb);})[_0x6442('0x3b')](function(_0x9299e4){_0x477d78[_0x6442('0x3f')]=_0x9299e4;return _0x477d78;})['then'](respondWithFilteredResult(_0x129b41,_0x55bceb))[_0x6442('0x40')](handleError(_0x129b41,null));};exports[_0x6442('0x41')]=function(_0x52766a,_0x4e3faf){var _0x1c38b7={'raw':!![],'where':{'id':_0x52766a[_0x6442('0x42')]['id']}},_0xf2e680={};_0xf2e680[_0x6442('0x2d')]=_['keys'](db[_0x6442('0x29')][_0x6442('0x2a')]);_0xf2e680[_0x6442('0x2e')]=_[_0x6442('0x2f')](_0x52766a[_0x6442('0x2e')]);_0xf2e680['filters']=_[_0x6442('0x31')](_0xf2e680[_0x6442('0x2d')],_0xf2e680[_0x6442('0x2e')]);_0x1c38b7[_0x6442('0x32')]=_[_0x6442('0x31')](_0xf2e680[_0x6442('0x2d')],qs[_0x6442('0x33')](_0x52766a[_0x6442('0x2e')]['fields']));_0x1c38b7[_0x6442('0x32')]=_0x1c38b7[_0x6442('0x32')]['length']?_0x1c38b7['attributes']:_0xf2e680['model'];if(_0x52766a['query'][_0x6442('0x3c')]){_0x1c38b7[_0x6442('0x3d')]=[{'all':!![]}];}_0x1c38b7=_[_0x6442('0x43')]({},_0x1c38b7,_0x52766a[_0x6442('0x44')]);return db[_0x6442('0x29')][_0x6442('0x45')](_0x1c38b7)[_0x6442('0x3b')](handleEntityNotFound(_0x4e3faf,null))['then'](respondWithResult(_0x4e3faf,null))['catch'](handleError(_0x4e3faf,null));};exports['create']=function(_0xab737e,_0x55f1bb){return db[_0x6442('0x29')][_0x6442('0x46')](_0xab737e[_0x6442('0x47')],{})[_0x6442('0x3b')](respondWithResult(_0x55f1bb,0xc9))[_0x6442('0x40')](handleError(_0x55f1bb,null));};exports['update']=function(_0x442d5c,_0xdd37c7){if(_0x442d5c[_0x6442('0x47')]['id']){delete _0x442d5c[_0x6442('0x47')]['id'];}return db[_0x6442('0x29')][_0x6442('0x45')]({'where':{'id':_0x442d5c[_0x6442('0x42')]['id']}})[_0x6442('0x3b')](handleEntityNotFound(_0xdd37c7,null))['then'](saveUpdates(_0x442d5c[_0x6442('0x47')],null))[_0x6442('0x3b')](respondWithResult(_0xdd37c7,null))['catch'](handleError(_0xdd37c7,null));};exports[_0x6442('0x22')]=function(_0x4b72b6,_0x7432d6){return db[_0x6442('0x29')][_0x6442('0x45')]({'where':{'id':_0x4b72b6[_0x6442('0x42')]['id']}})['then'](handleEntityNotFound(_0x7432d6,null))[_0x6442('0x3b')](removeEntity(_0x7432d6,null))[_0x6442('0x40')](handleError(_0x7432d6,null));}; \ No newline at end of file +var _0xbb54=['count','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SmsApplication','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','where','merge','map','VIRTUAL','filter','options'];(function(_0x236c40,_0x454c90){var _0x116fbb=function(_0x45c06a){while(--_0x45c06a){_0x236c40['push'](_0x236c40['shift']());}};_0x116fbb(++_0x454c90);}(_0xbb54,0x1a8));var _0x4bb5=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xbb54[_0x1e4150];return _0x1ce3ee;};'use strict';var emlformat=require(_0x4bb5('0x0'));var rimraf=require(_0x4bb5('0x1'));var zipdir=require(_0x4bb5('0x2'));var jsonpatch=require(_0x4bb5('0x3'));var rp=require('request-promise');var moment=require(_0x4bb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4bb5('0x5'));var path=require(_0x4bb5('0x6'));var sox=require(_0x4bb5('0x7'));var csv=require('to-csv');var ejs=require(_0x4bb5('0x8'));var fs=require('fs');var fs_extra=require(_0x4bb5('0x9'));var _=require(_0x4bb5('0xa'));var squel=require(_0x4bb5('0xb'));var crypto=require('crypto');var jsforce=require(_0x4bb5('0xc'));var deskjs=require(_0x4bb5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4bb5('0xe'));var Redis=require(_0x4bb5('0xf'));var authService=require(_0x4bb5('0x10'));var qs=require(_0x4bb5('0x11'));var as=require(_0x4bb5('0x12'));var hardwareService=require(_0x4bb5('0x13'));var logger=require(_0x4bb5('0x14'))('api');var utils=require(_0x4bb5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241f20,_0x26c12b){_0x26c12b=_0x26c12b||0xcc;return function(_0x2c28b3){if(_0x2c28b3){return _0x241f20[_0x4bb5('0x16')](_0x26c12b);}return _0x241f20[_0x4bb5('0x17')](_0x26c12b)['end']();};}function respondWithResult(_0x1e365c,_0x2b80e8){_0x2b80e8=_0x2b80e8||0xc8;return function(_0x351a87){if(_0x351a87){return _0x1e365c[_0x4bb5('0x17')](_0x2b80e8)[_0x4bb5('0x18')](_0x351a87);}};}function respondWithFilteredResult(_0x56f2bb,_0x535a3d){return function(_0x4fa713){if(_0x4fa713){var _0x36f409=typeof _0x535a3d[_0x4bb5('0x19')]===_0x4bb5('0x1a')&&typeof _0x535a3d[_0x4bb5('0x1b')]===_0x4bb5('0x1a');var _0x4dfc72=_0x4fa713['count'];var _0x535bfd=_0x36f409?0x0:_0x535a3d[_0x4bb5('0x19')];var _0x574f49=_0x36f409?_0x4fa713['count']:_0x535a3d['offset']+_0x535a3d[_0x4bb5('0x1b')];var _0x524a9e;if(_0x574f49>=_0x4dfc72){_0x574f49=_0x4dfc72;_0x524a9e=0xc8;}else{_0x524a9e=0xce;}_0x56f2bb['status'](_0x524a9e);return _0x56f2bb[_0x4bb5('0x1c')]('Content-Range',_0x535bfd+'-'+_0x574f49+'/'+_0x4dfc72)['json'](_0x4fa713);}return null;};}function patchUpdates(_0x1c3d46){return function(_0x375e47){try{jsonpatch[_0x4bb5('0x1d')](_0x375e47,_0x1c3d46,!![]);}catch(_0x5ba418){return BPromise[_0x4bb5('0x1e')](_0x5ba418);}return _0x375e47[_0x4bb5('0x1f')]();};}function saveUpdates(_0x497fcc,_0x263f64){return function(_0x1916d5){if(_0x1916d5){return _0x1916d5[_0x4bb5('0x20')](_0x497fcc)[_0x4bb5('0x21')](function(_0x399fdf){return _0x399fdf;});}return null;};}function removeEntity(_0x1a8806,_0x12413d){return function(_0x5bffb3){if(_0x5bffb3){return _0x5bffb3[_0x4bb5('0x22')]()[_0x4bb5('0x21')](function(){_0x1a8806[_0x4bb5('0x17')](0xcc)[_0x4bb5('0x23')]();});}};}function handleEntityNotFound(_0x135e10,_0x5f4bb4){return function(_0x5a1bdf){if(!_0x5a1bdf){_0x135e10[_0x4bb5('0x16')](0x194);}return _0x5a1bdf;};}function handleError(_0x43ac96,_0x2c4c17){_0x2c4c17=_0x2c4c17||0x1f4;return function(_0x344c44){logger[_0x4bb5('0x24')](_0x344c44[_0x4bb5('0x25')]);if(_0x344c44[_0x4bb5('0x26')]){delete _0x344c44[_0x4bb5('0x26')];}_0x43ac96[_0x4bb5('0x17')](_0x2c4c17)[_0x4bb5('0x27')](_0x344c44);};}exports[_0x4bb5('0x28')]=function(_0x368472,_0x1f452d){var _0x42dcbc={},_0x3062ed={},_0x21c8e6={'count':0x0,'rows':[]};var _0x441a4b=_['map'](db[_0x4bb5('0x29')]['rawAttributes'],function(_0x283604){return{'name':_0x283604['fieldName'],'type':_0x283604[_0x4bb5('0x2a')][_0x4bb5('0x2b')]};});_0x3062ed[_0x4bb5('0x2c')]=_['map'](_0x441a4b,'name');_0x3062ed['query']=_[_0x4bb5('0x2d')](_0x368472[_0x4bb5('0x2e')]);_0x3062ed[_0x4bb5('0x2f')]=_[_0x4bb5('0x30')](_0x3062ed[_0x4bb5('0x2c')],_0x3062ed[_0x4bb5('0x2e')]);_0x42dcbc[_0x4bb5('0x31')]=_[_0x4bb5('0x30')](_0x3062ed[_0x4bb5('0x2c')],qs['fields'](_0x368472['query'][_0x4bb5('0x32')]));_0x42dcbc[_0x4bb5('0x31')]=_0x42dcbc[_0x4bb5('0x31')][_0x4bb5('0x33')]?_0x42dcbc[_0x4bb5('0x31')]:_0x3062ed[_0x4bb5('0x2c')];if(!_0x368472['query']['hasOwnProperty']('nolimit')){_0x42dcbc[_0x4bb5('0x1b')]=qs[_0x4bb5('0x1b')](_0x368472['query']['limit']);_0x42dcbc[_0x4bb5('0x19')]=qs[_0x4bb5('0x19')](_0x368472[_0x4bb5('0x2e')]['offset']);}_0x42dcbc[_0x4bb5('0x34')]=qs['sort'](_0x368472['query']['sort']);_0x42dcbc[_0x4bb5('0x35')]=qs[_0x4bb5('0x2f')](_['pick'](_0x368472[_0x4bb5('0x2e')],_0x3062ed[_0x4bb5('0x2f')]),_0x441a4b);if(_0x368472[_0x4bb5('0x2e')]['filter']){_0x42dcbc[_0x4bb5('0x35')]=_[_0x4bb5('0x36')](_0x42dcbc[_0x4bb5('0x35')],{'$or':_[_0x4bb5('0x37')](_0x441a4b,function(_0x1eb91f){if(_0x1eb91f['type']!==_0x4bb5('0x38')){var _0x209720={};_0x209720[_0x1eb91f[_0x4bb5('0x26')]]={'$like':'%'+_0x368472[_0x4bb5('0x2e')][_0x4bb5('0x39')]+'%'};return _0x209720;}})});}_0x42dcbc=_[_0x4bb5('0x36')]({},_0x42dcbc,_0x368472[_0x4bb5('0x3a')]);var _0x108468={'where':_0x42dcbc[_0x4bb5('0x35')]};return db['SmsApplication'][_0x4bb5('0x3b')](_0x108468)['then'](function(_0x38ba23){_0x21c8e6['count']=_0x38ba23;if(_0x368472[_0x4bb5('0x2e')][_0x4bb5('0x3c')]){_0x42dcbc[_0x4bb5('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x4bb5('0x3e')](_0x42dcbc);})[_0x4bb5('0x21')](function(_0x163de6){_0x21c8e6['rows']=_0x163de6;return _0x21c8e6;})[_0x4bb5('0x21')](respondWithFilteredResult(_0x1f452d,_0x42dcbc))[_0x4bb5('0x3f')](handleError(_0x1f452d,null));};exports['show']=function(_0x3143de,_0x1ec603){var _0x1c923d={'raw':!![],'where':{'id':_0x3143de[_0x4bb5('0x40')]['id']}},_0x3aa587={};_0x3aa587['model']=_[_0x4bb5('0x2d')](db[_0x4bb5('0x29')][_0x4bb5('0x41')]);_0x3aa587['query']=_[_0x4bb5('0x2d')](_0x3143de[_0x4bb5('0x2e')]);_0x3aa587[_0x4bb5('0x2f')]=_[_0x4bb5('0x30')](_0x3aa587[_0x4bb5('0x2c')],_0x3aa587[_0x4bb5('0x2e')]);_0x1c923d['attributes']=_[_0x4bb5('0x30')](_0x3aa587[_0x4bb5('0x2c')],qs[_0x4bb5('0x32')](_0x3143de[_0x4bb5('0x2e')][_0x4bb5('0x32')]));_0x1c923d['attributes']=_0x1c923d[_0x4bb5('0x31')]['length']?_0x1c923d[_0x4bb5('0x31')]:_0x3aa587[_0x4bb5('0x2c')];if(_0x3143de[_0x4bb5('0x2e')][_0x4bb5('0x3c')]){_0x1c923d[_0x4bb5('0x3d')]=[{'all':!![]}];}_0x1c923d=_['merge']({},_0x1c923d,_0x3143de[_0x4bb5('0x3a')]);return db['SmsApplication'][_0x4bb5('0x42')](_0x1c923d)[_0x4bb5('0x21')](handleEntityNotFound(_0x1ec603,null))[_0x4bb5('0x21')](respondWithResult(_0x1ec603,null))[_0x4bb5('0x3f')](handleError(_0x1ec603,null));};exports[_0x4bb5('0x43')]=function(_0x1a1f06,_0x1a14a5){return db[_0x4bb5('0x29')][_0x4bb5('0x43')](_0x1a1f06[_0x4bb5('0x44')],{})[_0x4bb5('0x21')](respondWithResult(_0x1a14a5,0xc9))[_0x4bb5('0x3f')](handleError(_0x1a14a5,null));};exports[_0x4bb5('0x20')]=function(_0x2665bc,_0x421a91){if(_0x2665bc['body']['id']){delete _0x2665bc[_0x4bb5('0x44')]['id'];}return db[_0x4bb5('0x29')][_0x4bb5('0x42')]({'where':{'id':_0x2665bc['params']['id']}})['then'](handleEntityNotFound(_0x421a91,null))['then'](saveUpdates(_0x2665bc[_0x4bb5('0x44')],null))[_0x4bb5('0x21')](respondWithResult(_0x421a91,null))[_0x4bb5('0x3f')](handleError(_0x421a91,null));};exports[_0x4bb5('0x22')]=function(_0x451835,_0x1233fe){return db[_0x4bb5('0x29')][_0x4bb5('0x42')]({'where':{'id':_0x451835[_0x4bb5('0x40')]['id']}})[_0x4bb5('0x21')](handleEntityNotFound(_0x1233fe,null))[_0x4bb5('0x21')](removeEntity(_0x1233fe,null))['catch'](handleError(_0x1233fe,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3082f97..746bc60 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 _0x9acd=['moment','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x512878,_0x33453f){var _0x21669c=function(_0x46e4a5){while(--_0x46e4a5){_0x512878['push'](_0x512878['shift']());}};_0x21669c(++_0x33453f);}(_0x9acd,0x76));var _0xd9ac=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9acd[_0x279d37];return _0x530173;};'use strict';var _=require(_0xd9ac('0x0'));var util=require(_0xd9ac('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd9ac('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9ac('0x3'));var rimraf=require(_0xd9ac('0x4'));var config=require('../../config/environment');var attributes=require(_0xd9ac('0x5'));module[_0xd9ac('0x6')]=function(_0x340104,_0x3fec24){return _0x340104[_0xd9ac('0x7')](_0xd9ac('0x8'),attributes,{'tableName':_0xd9ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9ac('0xa'),'collate':_0xd9ac('0xb')});}; \ No newline at end of file +var _0x5197=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x4d48d9,_0x4f7314){var _0x2ef306=function(_0x3484b9){while(--_0x3484b9){_0x4d48d9['push'](_0x4d48d9['shift']());}};_0x2ef306(++_0x4f7314);}(_0x5197,0x145));var _0x7519=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x5197[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x7519('0x0'));var util=require(_0x7519('0x1'));var logger=require(_0x7519('0x2'))(_0x7519('0x3'));var moment=require('moment');var BPromise=require(_0x7519('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7519('0x5'));var rimraf=require(_0x7519('0x6'));var config=require(_0x7519('0x7'));var attributes=require(_0x7519('0x8'));module[_0x7519('0x9')]=function(_0xa163ac,_0x2419b6){return _0xa163ac[_0x7519('0xa')](_0x7519('0xb'),attributes,{'tableName':_0x7519('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7519('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 15f3bcb..1d37f73 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 _0x5b12=['SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x5b12,0xa3));var _0x25b1=function(_0x2f7c59,_0x234857){_0x2f7c59=_0x2f7c59-0x0;var _0xbddea7=_0x5b12[_0x2f7c59];return _0xbddea7;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SmsApplication,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});} \ No newline at end of file +var _0xa30a=['stringify','error','code','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x4e3310,_0x108111){var _0x5ed02d=function(_0x19a872){while(--_0x19a872){_0x4e3310['push'](_0x4e3310['shift']());}};_0x5ed02d(++_0x108111);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 33ee9d3..8383ed2 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x387a24,_0x2e3d02){var _0x5dfd29=function(_0x476a0a){while(--_0x476a0a){_0x387a24['push'](_0x387a24['shift']());}};_0x5dfd29(++_0x2e3d02);}(_0x2547,0x1cd));var _0x7254=function(_0x4ab6c2,_0x1323ac){_0x4ab6c2=_0x4ab6c2-0x0;var _0x28d53f=_0x2547[_0x4ab6c2];return _0x28d53f;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x54a333,_0x38a6d0){var _0x127327=function(_0x3858d8){while(--_0x3858d8){_0x54a333['push'](_0x54a333['shift']());}};_0x127327(++_0x38a6d0);}(_0x14a0,0x8e));var _0x014a=function(_0x28d173,_0x309dac){_0x28d173=_0x28d173-0x0;var _0x38c7b8=_0x14a0[_0x28d173];return _0x38c7b8;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8adb388..31effac 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 _0x1298=['moment','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3cc29f,_0x353898){var _0x5609de=function(_0x1cb9ae){while(--_0x1cb9ae){_0x3cc29f['push'](_0x3cc29f['shift']());}};_0x5609de(++_0x353898);}(_0x1298,0x19e));var _0x8129=function(_0x385249,_0x275192){_0x385249=_0x385249-0x0;var _0x2de21b=_0x1298[_0x385249];return _0x2de21b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8129('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8129('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8129('0x2')]},'disposition':{'type':Sequelize[_0x8129('0x3')]},'secondDisposition':{'type':Sequelize[_0x8129('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8129('0x3')]},'note':{'type':Sequelize[_0x8129('0x3')]},'phone':{'type':Sequelize[_0x8129('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x8129('0x4')]('in',_0x8129('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8129('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8129('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x3ca4=['STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment','exports'];(function(_0x25cd6d,_0x30a718){var _0x7811e1=function(_0x29c1a1){while(--_0x29c1a1){_0x25cd6d['push'](_0x25cd6d['shift']());}};_0x7811e1(++_0x30a718);}(_0x3ca4,0x17d));var _0x43ca=function(_0x3d9175,_0x5a8fca){_0x3d9175=_0x3d9175-0x0;var _0x400be5=_0x3ca4[_0x3d9175];return _0x400be5;};'use strict';var Sequelize=require(_0x43ca('0x0'));var moment=require(_0x43ca('0x1'));module[_0x43ca('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x43ca('0x3')]},'secondDisposition':{'type':Sequelize[_0x43ca('0x3')]},'thirdDisposition':{'type':Sequelize[_0x43ca('0x3')]},'note':{'type':Sequelize[_0x43ca('0x3')]},'phone':{'type':Sequelize[_0x43ca('0x3')]},'read1stAt':{'type':Sequelize[_0x43ca('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x43ca('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43ca('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x43ca('0x5')]('in',_0x43ca('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x43ca('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index bf8f765..ab31560 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 _0x77d3=['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','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','Tags','TagIds','forEach','push','catch','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','length','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?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','SmsInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','include','options','create','describe','SmsMessage','addMessage','ids','findOne','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','omit','spread','smsInteractionTags:save','removeTags','download','root','server','files','tmp','attachments','join','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','closed','closedAt','disposition','direction','out','System','renderFile','downloadInteraction.ejs','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','util'];(function(_0xbc2d9e,_0x40ef4f){var _0x2e315c=function(_0x57fc55){while(--_0x57fc55){_0xbc2d9e['push'](_0xbc2d9e['shift']());}};_0x2e315c(++_0x40ef4f);}(_0x77d3,0xe4));var _0x377d=function(_0x3b6bab,_0x4dd853){_0x3b6bab=_0x3b6bab-0x0;var _0x3f6478=_0x77d3[_0x3b6bab];return _0x3f6478;};'use strict';var emlformat=require(_0x377d('0x0'));var rimraf=require(_0x377d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x377d('0x2'));var rp=require(_0x377d('0x3'));var moment=require(_0x377d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x377d('0x5'));var path=require('path');var sox=require(_0x377d('0x6'));var csv=require(_0x377d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x377d('0x8'));var _=require(_0x377d('0x9'));var squel=require(_0x377d('0xa'));var crypto=require(_0x377d('0xb'));var jsforce=require(_0x377d('0xc'));var deskjs=require(_0x377d('0xd'));var toCsv=require(_0x377d('0x7'));var querystring=require(_0x377d('0xe'));var Papa=require(_0x377d('0xf'));var Redis=require(_0x377d('0x10'));var authService=require(_0x377d('0x11'));var qs=require(_0x377d('0x12'));var as=require(_0x377d('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x377d('0x14'));var logger=require(_0x377d('0x15'))(_0x377d('0x16'));var utils=require(_0x377d('0x17'));var config=require(_0x377d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x377d('0x19')]=_[_0x377d('0x1a')](config[_0x377d('0x19')],{'host':_0x377d('0x1b'),'port':0x18eb});var socket=require(_0x377d('0x1c'))(new Redis(config[_0x377d('0x19')]));require(_0x377d('0x1d'))[_0x377d('0x1e')](socket);function respondWithStatusCode(_0x1fedfe,_0x383d6f){_0x383d6f=_0x383d6f||0xcc;return function(_0x162200){if(_0x162200){return _0x1fedfe[_0x377d('0x1f')](_0x383d6f);}return _0x1fedfe[_0x377d('0x20')](_0x383d6f)[_0x377d('0x21')]();};}function respondWithResult(_0x133d07,_0x20949f){_0x20949f=_0x20949f||0xc8;return function(_0x4966fb){if(_0x4966fb){return _0x133d07[_0x377d('0x20')](_0x20949f)[_0x377d('0x22')](_0x4966fb);}};}function respondWithFilteredResult(_0x35a3fb,_0x196245){return function(_0xf6dff3){if(_0xf6dff3){var _0x4deb79=typeof _0x196245[_0x377d('0x23')]===_0x377d('0x24')&&typeof _0x196245['limit']==='undefined';var _0x418cc2=_0xf6dff3[_0x377d('0x25')];var _0x5607da=_0x4deb79?0x0:_0x196245[_0x377d('0x23')];var _0x446e7e=_0x4deb79?_0xf6dff3[_0x377d('0x25')]:_0x196245['offset']+_0x196245[_0x377d('0x26')];var _0x1a1d5c;if(_0x446e7e>=_0x418cc2){_0x446e7e=_0x418cc2;_0x1a1d5c=0xc8;}else{_0x1a1d5c=0xce;}_0x35a3fb[_0x377d('0x20')](_0x1a1d5c);return _0x35a3fb[_0x377d('0x27')](_0x377d('0x28'),_0x5607da+'-'+_0x446e7e+'/'+_0x418cc2)[_0x377d('0x22')](_0xf6dff3);}return null;};}function patchUpdates(_0x13361d){return function(_0x4e6a91){try{jsonpatch[_0x377d('0x29')](_0x4e6a91,_0x13361d,!![]);}catch(_0x36fb87){return BPromise[_0x377d('0x2a')](_0x36fb87);}return _0x4e6a91[_0x377d('0x2b')]();};}function saveUpdates(_0x562d70,_0x864a0d){return function(_0x4d37e4){if(_0x4d37e4){return _0x4d37e4[_0x377d('0x2c')](_0x562d70)[_0x377d('0x2d')](function(_0x2466d3){return _0x2466d3;});}return null;};}function removeEntity(_0x3af1de,_0x471357){return function(_0x5bc622){if(_0x5bc622){return _0x5bc622[_0x377d('0x2e')]()[_0x377d('0x2d')](function(){_0x3af1de[_0x377d('0x20')](0xcc)[_0x377d('0x21')]();});}};}function handleEntityNotFound(_0x3db59d,_0xb4e6c0){return function(_0x128bcb){if(!_0x128bcb){_0x3db59d[_0x377d('0x1f')](0x194);}return _0x128bcb;};}function handleError(_0x2b4c91,_0x2039a3){_0x2039a3=_0x2039a3||0x1f4;return function(_0x2bd170){logger[_0x377d('0x2f')](_0x2bd170[_0x377d('0x30')]);if(_0x2bd170[_0x377d('0x31')]){delete _0x2bd170['name'];}_0x2b4c91['status'](_0x2039a3)[_0x377d('0x32')](_0x2bd170);};}function getInteractionUsers(_0x50c700,_0x462d7f){return new BPromise(function(_0x245869,_0x4f10eb){try{if(_0x462d7f[_0x50c700['id']]){_0x50c700[_0x377d('0x33')]=_['map'](_0x462d7f[_0x50c700['id']],function(_0x36fb66){return{'id':_0x36fb66['id'],'fullname':_0x36fb66[_0x377d('0x34')]};});}}catch(_0xaba8){_0x4f10eb(_0xaba8);}_0x245869(_0x50c700);});}function getInteractionTags(_0x220235,_0x4db5ad){return new BPromise(function(_0x7fe04f,_0x55fade){try{if(_0x220235['TagIds']){_0x220235[_0x377d('0x35')]=[];_0x220235[_0x377d('0x36')]['split'](',')[_0x377d('0x37')](function(_0x141610){_0x220235['Tags'][_0x377d('0x38')](_0x4db5ad[_0x141610]);});}delete _0x220235[_0x377d('0x36')];}catch(_0x45802a){_0x55fade(_0x45802a);}_0x7fe04f(_0x220235);});}function updateSmsInteraction(_0x155ba0,_0x2be89b,_0x46474a){return new BPromise(function(_0x42fd34,_0x504ca7){return getInteractionUsers(_0x155ba0,_0x46474a)[_0x377d('0x2d')](function(_0x2fdb00){return getInteractionTags(_0x2fdb00,_0x2be89b);})['then'](function(_0x21bd2b){_0x42fd34(_0x21bd2b);})[_0x377d('0x39')](function(_0xf4b8c4){_0x504ca7(_0xf4b8c4);});});}exports[_0x377d('0x3a')]=function(_0x18e7b7,_0x4cb6d4){var _0x4124b2={},_0x67b339={},_0x2d729e={'count':0x0,'rows':[]};var _0x54727d=_[_0x377d('0x3b')](db['SmsInteraction'][_0x377d('0x3c')],function(_0x19cb48){return{'name':_0x19cb48[_0x377d('0x3d')],'type':_0x19cb48['type'][_0x377d('0x3e')]};});_0x67b339[_0x377d('0x3f')]=_[_0x377d('0x3b')](_0x54727d,_0x377d('0x31'));_0x67b339[_0x377d('0x40')]=_['keys'](_0x18e7b7['query']);_0x67b339[_0x377d('0x41')]=_[_0x377d('0x42')](_0x67b339['model'],_0x67b339[_0x377d('0x40')]);_0x4124b2['attributes']=_[_0x377d('0x42')](_0x67b339[_0x377d('0x3f')],qs[_0x377d('0x43')](_0x18e7b7['query'][_0x377d('0x43')]));_0x4124b2[_0x377d('0x44')]=_0x4124b2[_0x377d('0x44')]['length']?_0x4124b2[_0x377d('0x44')]:_0x67b339[_0x377d('0x3f')];if(!_0x18e7b7['query'][_0x377d('0x45')](_0x377d('0x46'))){_0x4124b2[_0x377d('0x26')]=qs[_0x377d('0x26')](_0x18e7b7[_0x377d('0x40')][_0x377d('0x26')]);_0x4124b2[_0x377d('0x23')]=qs[_0x377d('0x23')](_0x18e7b7[_0x377d('0x40')][_0x377d('0x23')]);}_0x4124b2[_0x377d('0x47')]=qs['sort'](_0x18e7b7[_0x377d('0x40')]['sort']);_0x4124b2[_0x377d('0x48')]=qs[_0x377d('0x41')](_[_0x377d('0x49')](_0x18e7b7['query'],_0x67b339[_0x377d('0x41')]),_0x54727d);var _0x589307=[];var _0x163ecc=squel[_0x377d('0x4a')]()[_0x377d('0x4b')]('id')[_0x377d('0x4b')](_0x377d('0x31'))[_0x377d('0x4b')](_0x377d('0x4c'))['from'](_0x377d('0x4d'));var _0x376623=squel[_0x377d('0x4a')]()['field'](_0x377d('0x4e'))[_0x377d('0x4b')]('u.fullname')[_0x377d('0x4b')](_0x377d('0x4f'))[_0x377d('0x50')](_0x377d('0x51'),'ui')[_0x377d('0x52')]('users','u','u.id\x20=\x20ui.UserId');var _0x1aa7a2=squel['select']()[_0x377d('0x50')](_0x377d('0x53'),'i')[_0x377d('0x52')](_0x377d('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x377d('0x55'),'o',_0x377d('0x56'))[_0x377d('0x52')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x377d('0x52')](_0x377d('0x57'),'me',_0x377d('0x58'))[_0x377d('0x52')](_0x377d('0x59'),'it',_0x377d('0x5a'))[_0x377d('0x52')](_0x377d('0x4d'),'t',_0x377d('0x5b'));var _0xc8c244=squel[_0x377d('0x5c')]();var _0x3f1db9=[];var _0xb2bbb=squel[_0x377d('0x5c')]();var _0x28ab91;if(_0x18e7b7[_0x377d('0x40')]['search']){_0x28ab91=as[_0x377d('0x5d')](_0x18e7b7[_0x377d('0x40')][_0x377d('0x5e')]);var _0x138a13=_0x28ab91['sqlOperator'];for(var _0x13ecd5=0x0;_0x13ecd5<_0x28ab91[_0x377d('0x5f')]['length'];_0x13ecd5++){var _0x1251f4=_0x28ab91[_0x377d('0x5f')][_0x13ecd5];var _0x38b4e1='i';var _0x3ed1e1=_[_0x377d('0x60')](_0x54727d,[_0x377d('0x31'),_0x1251f4[_0x377d('0x4b')]]);if(!_0x3ed1e1){switch(_0x1251f4['field']){case'unreadMessages':if(_0x1251f4[_0x377d('0x61')]==0x1){_0x1aa7a2[_0x377d('0x62')]('`'+_0x1251f4[_0x377d('0x4b')]+_0x377d('0x63'));}else{_0x1aa7a2[_0x377d('0x62')]('`'+_0x1251f4['field']+_0x377d('0x64'));}break;case'Contact':if(_0x1251f4[_0x377d('0x65')]===_0x377d('0x66')){if(_0x1251f4[_0x377d('0x61')][_0x377d('0x67')]('\x20')[_0x377d('0x68')]>0x1){_0xc8c244[_0x138a13]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x377d('0x69')](_0x1251f4[_0x377d('0x61')]),null);}else{var _0x482c10='%'+_0x1251f4[_0x377d('0x61')]+'%';_0xc8c244[_0x138a13](_0x377d('0x6a'),_0x482c10,_0x482c10,_0x482c10);}}else{_0x3ed1e1=_[_0x377d('0x60')](_0x54727d,[_0x377d('0x31'),_0x377d('0x6b')]);_0x1251f4[_0x377d('0x4b')]=_0x377d('0x6b');_0xd84a42=as[_0x377d('0x6c')](_0x38b4e1,_0x3ed1e1[_0x377d('0x6d')],_0x1251f4);_0xc8c244[_0x138a13](_0xd84a42[_0x377d('0x6e')],_0xd84a42[_0x377d('0x61')][_0x377d('0x6f')],_0xd84a42['value']['end']);}break;case _0x377d('0x70'):var _0x54aef9=_0x1251f4['value'][_0x377d('0x67')](',')[_0x377d('0x3b')](function(_0x57f165){return Number(_0x57f165);});_0x54aef9[_0x377d('0x37')](function(_0x4213dd){_0xb2bbb['or'](_0x377d('0x71'),'%,'+_0x4213dd+',%');});_0x3f1db9=_['union'](_0x3f1db9,_0x54aef9);break;case _0x377d('0x72'):if(_0x1251f4[_0x377d('0x65')]===_0x377d('0x66')){_0xc8c244[_0x138a13](_0x377d('0x73'),'%'+_0x1251f4[_0x377d('0x61')]+'%',null);}else{_0x3ed1e1=_[_0x377d('0x60')](_0x54727d,[_0x377d('0x31'),'UserId']);_0x1251f4[_0x377d('0x4b')]=_0x377d('0x74');_0xd84a42=as[_0x377d('0x6c')](_0x38b4e1,_0x3ed1e1[_0x377d('0x6d')],_0x1251f4);_0xc8c244[_0x138a13](_0xd84a42[_0x377d('0x6e')],_0xd84a42['value'][_0x377d('0x6f')],_0xd84a42[_0x377d('0x61')]['end']);}break;case _0x377d('0x75'):_0xd84a42=as['buildExpression']('me',null,_0x1251f4);_0xc8c244[_0x138a13](_0xd84a42[_0x377d('0x6e')],_0xd84a42[_0x377d('0x61')][_0x377d('0x6f')],_0xd84a42['value']['end']);break;}}else{var _0xd84a42=as[_0x377d('0x6c')](_0x38b4e1,_0x3ed1e1[_0x377d('0x6d')],_0x1251f4);_0xc8c244[_0x138a13](_0xd84a42['text'],_0xd84a42['value'][_0x377d('0x6f')],_0xd84a42[_0x377d('0x61')][_0x377d('0x21')]);}}}else{var _0x38d0aa=_(_0x18e7b7[_0x377d('0x40')])[_0x377d('0x76')]()[_0x377d('0x3b')](function(_0x183f61){return _[_0x377d('0x77')](_0x54727d,['name',_0x183f61])?_0x183f61:undefined;})['compact']()[_0x377d('0x61')]();if(!_[_0x377d('0x78')](_0x38d0aa)){_0x38d0aa[_0x377d('0x37')](function(_0x4ecf74){if(_0x4ecf74==='SmsAccountId'){_0x1aa7a2[_0x377d('0x48')](_0x377d('0x79'),[][_0x377d('0x7a')](_0x18e7b7[_0x377d('0x40')][_0x4ecf74]));}else if(_0x4ecf74===_0x377d('0x7b')){var _0x3e6e21=JSON[_0x377d('0x7c')](_0x18e7b7[_0x377d('0x40')][_0x4ecf74])['$gte'];var _0x5598f4=JSON['parse'](_0x18e7b7[_0x377d('0x40')][_0x4ecf74])[_0x377d('0x7d')];_0x1aa7a2[_0x377d('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3e6e21,_0x5598f4);}else{if(_0x18e7b7[_0x377d('0x40')][_0x4ecf74]==='null'){_0x1aa7a2[_0x377d('0x48')]('i.'+_0x4ecf74+'\x20IS\x20NULL');}else{_0x1aa7a2['where']('i.'+_0x4ecf74+_0x377d('0x7e'),_0x18e7b7[_0x377d('0x40')][_0x4ecf74]);}}});}if(_0x18e7b7[_0x377d('0x40')][_0x377d('0x7f')]){if(_0x18e7b7['query'][_0x377d('0x7f')]==0x1){_0x1aa7a2[_0x377d('0x62')](_0x377d('0x80'));}else{_0x1aa7a2[_0x377d('0x62')](_0x377d('0x81'));}}if(_0x18e7b7[_0x377d('0x40')][_0x377d('0x82')]){_0x3f1db9=_['isArray'](_0x18e7b7[_0x377d('0x40')]['tag'])?_0x18e7b7[_0x377d('0x40')]['tag']:new Array(_0x18e7b7['query'][_0x377d('0x82')]);_0x3f1db9[_0x377d('0x37')](function(_0x267e0a){_0xb2bbb['or'](_0x377d('0x71'),'%,'+_0x267e0a+',%');});}if(_0x18e7b7[_0x377d('0x40')][_0x377d('0x83')]){var _0x1c93ec=_0x18e7b7[_0x377d('0x40')][_0x377d('0x83')][_0x377d('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x377d('0x85')](_0x1c93ec)){_0xc8c244['or']('i.id\x20LIKE\x20?',_0x1c93ec+'%')['or'](_0x377d('0x86'),_0x1c93ec+'%');}else{_0xc8c244['or'](_0x377d('0x87'),qs[_0x377d('0x69')](_0x1c93ec))['or'](_0x377d('0x88'),_0x1c93ec+'%');}}}_0x1aa7a2[_0x377d('0x48')](_0xc8c244);_0x1aa7a2[_0x377d('0x89')](_0x377d('0x8a'));var _0x786468={'type':db['Sequelize'][_0x377d('0x8b')][_0x377d('0x8c')],'raw':!![]};var _0x429050=_0x1aa7a2[_0x377d('0x8d')]();_0x429050['field']('i.id');_0x429050[_0x377d('0x4b')](_0x377d('0x8e'),'unreadMessages');if(_0x4124b2[_0x377d('0x47')]){_0x4124b2[_0x377d('0x47')][_0x377d('0x37')](function(_0x56b4ac){var _0x31494f=_0x56b4ac[0x0]===_0x377d('0x8f')?_0x56b4ac[0x0]:'i.'+_0x56b4ac[0x0];_0x1aa7a2[_0x377d('0x47')](_0x31494f,_0x56b4ac[0x1]===_0x377d('0x90')?![]:!![]);});}if(!_[_0x377d('0x78')](_0x3f1db9)){_0x1aa7a2[_0x377d('0x62')](_0xb2bbb);_0x429050['where'](_0x377d('0x91'),_0x3f1db9);}BPromise[_0x377d('0x92')]()[_0x377d('0x2d')](function(){if(!_0x28ab91){if(_0x18e7b7[_0x377d('0x40')][_0x377d('0x93')])return;_0x429050['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1aa7a2['where'](_0x377d('0x94'));return;}if(_0x18e7b7['user']['role']!==_0x377d('0x95'))return;return _0x18e7b7[_0x377d('0x96')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x377d('0x2d')](function(_0x65ff6e){if(_['isEmpty'](_0x65ff6e)){_0x429050[_0x377d('0x48')](_0x377d('0x97'));_0x1aa7a2[_0x377d('0x48')](_0x377d('0x97'));}else{_0x429050[_0x377d('0x48')](_0x377d('0x79'),_['map'](_0x65ff6e,'id'));_0x1aa7a2[_0x377d('0x48')](_0x377d('0x79'),_[_0x377d('0x3b')](_0x65ff6e,'id'));}});})[_0x377d('0x2d')](function(){if(_0x18e7b7[_0x377d('0x96')][_0x377d('0x98')]===_0x377d('0x95')&&!_0x28ab91&&!_0x18e7b7[_0x377d('0x40')][_0x377d('0x93')])return[];return db[_0x377d('0x99')][_0x377d('0x40')](_0x429050[_0x377d('0x9a')](),_0x786468);})[_0x377d('0x2d')](function(_0x30e1ab){_0x2d729e[_0x377d('0x25')]=_0x30e1ab[_0x377d('0x68')];if(_0x2d729e[_0x377d('0x25')]===0x0)return[];return db['sequelize']['query'](_0x163ecc[_0x377d('0x9a')](),_0x786468)[_0x377d('0x2d')](function(_0x4f4893){_0x589307=_[_0x377d('0x9b')](_0x4f4893,'id');_0x786468=_[_0x377d('0x9c')](_0x786468,{'model':db[_0x377d('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18e7b7['query'][_0x377d('0x43')]){_0x4124b2['attributes']['forEach'](function(_0x63c49d){_0x1aa7a2['field']('i.'+_0x63c49d);});}else{_0x1aa7a2[_0x377d('0x4b')](_0x377d('0x8e'),_0x377d('0x9e'));_0x1aa7a2[_0x377d('0x4b')](_0x377d('0x9f'),_0x377d('0xa0'));_0x1aa7a2[_0x377d('0x4b')](_0x377d('0xa1'),_0x377d('0xa2'));_0x1aa7a2['field'](_0x377d('0xa3'),_0x377d('0x8f'));_0x1aa7a2[_0x377d('0x4b')](_0x377d('0xa4'));_0x1aa7a2['field'](_0x377d('0xa5'),'Contact.firstName');_0x1aa7a2[_0x377d('0x4b')](_0x377d('0xa6'),_0x377d('0xa7'));_0x1aa7a2[_0x377d('0x4b')](_0x377d('0xa8'),_0x377d('0xa9'));_0x1aa7a2[_0x377d('0x4b')]('c.phone',_0x377d('0xaa'));_0x1aa7a2['field'](_0x377d('0xab'),_0x377d('0xac'));_0x1aa7a2['field'](_0x377d('0xad'),'Contact.fax');_0x1aa7a2['field']('o.fullname',_0x377d('0xae'));_0x1aa7a2[_0x377d('0x4b')](_0x377d('0xaf'),_0x377d('0xb0'));_0x1aa7a2[_0x377d('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x377d('0x36'));}if(_0x4124b2[_0x377d('0x26')])_0x1aa7a2[_0x377d('0x26')](_0x4124b2[_0x377d('0x26')]);if(_0x4124b2['offset'])_0x1aa7a2[_0x377d('0x23')](_0x4124b2[_0x377d('0x23')]);return db[_0x377d('0x99')][_0x377d('0x40')](_0x1aa7a2['toString'](),_0x786468);})[_0x377d('0x2d')](function(_0x2281ca){if(_0x2281ca['length']>0x0)_0x376623[_0x377d('0x48')](_0x377d('0xb1'),_['map'](_0x2281ca,'id'));return db[_0x377d('0x99')][_0x377d('0x40')](_0x376623['toString'](),_0x786468)['then'](function(_0x2da5df){var _0x373cdd=_[_0x377d('0xb2')](_0x2da5df,_0x377d('0xb3'));var _0x17a5e7=[];_0x2281ca[_0x377d('0x37')](function(_0x2476d3){_0x17a5e7[_0x377d('0x38')](updateSmsInteraction(_0x2476d3,_0x589307,_0x373cdd));});return BPromise[_0x377d('0xb4')](_0x17a5e7);});});})[_0x377d('0x2d')](function(_0x5b2f0e){_0x2d729e['rows']=_0x5b2f0e;return _0x2d729e;})[_0x377d('0x2d')](respondWithFilteredResult(_0x4cb6d4,_0x4124b2))[_0x377d('0x39')](handleError(_0x4cb6d4,null));};exports[_0x377d('0xb5')]=function(_0x3f95bb,_0x1bac8b){var _0x4df08b={'raw':![],'where':{'id':_0x3f95bb[_0x377d('0xb6')]['id']}},_0x46eb3f={};_0x46eb3f[_0x377d('0x3f')]=_[_0x377d('0x76')](db['SmsInteraction'][_0x377d('0x3c')]);_0x46eb3f[_0x377d('0x40')]=_[_0x377d('0x76')](_0x3f95bb[_0x377d('0x40')]);_0x46eb3f['filters']=_[_0x377d('0x42')](_0x46eb3f[_0x377d('0x3f')],_0x46eb3f[_0x377d('0x40')]);_0x4df08b[_0x377d('0x44')]=_[_0x377d('0x42')](_0x46eb3f[_0x377d('0x3f')],qs[_0x377d('0x43')](_0x3f95bb[_0x377d('0x40')][_0x377d('0x43')]));_0x4df08b[_0x377d('0x44')]=_0x4df08b[_0x377d('0x44')][_0x377d('0x68')]?_0x4df08b[_0x377d('0x44')]:_0x46eb3f[_0x377d('0x3f')];if(_0x3f95bb[_0x377d('0x40')]['includeAll']){_0x4df08b[_0x377d('0xb7')]=[{'all':!![]}];}_0x4df08b=_[_0x377d('0x9c')]({},_0x4df08b,_0x3f95bb[_0x377d('0xb8')]);return db[_0x377d('0x9d')][_0x377d('0x60')](_0x4df08b)[_0x377d('0x2d')](handleEntityNotFound(_0x1bac8b,null))[_0x377d('0x2d')](respondWithResult(_0x1bac8b,null))[_0x377d('0x39')](handleError(_0x1bac8b,null));};exports['create']=function(_0x371301,_0xe9800){return db[_0x377d('0x9d')][_0x377d('0xb9')](_0x371301[_0x377d('0x75')],{})[_0x377d('0x2d')](respondWithResult(_0xe9800,0xc9))[_0x377d('0x39')](handleError(_0xe9800,null));};exports[_0x377d('0x2c')]=function(_0x7ccffe,_0x2fbdb9){if(_0x7ccffe[_0x377d('0x75')]['id']){delete _0x7ccffe[_0x377d('0x75')]['id'];}return db[_0x377d('0x9d')]['find']({'where':{'id':_0x7ccffe['params']['id']}})[_0x377d('0x2d')](handleEntityNotFound(_0x2fbdb9,null))[_0x377d('0x2d')](saveUpdates(_0x7ccffe[_0x377d('0x75')],null))[_0x377d('0x2d')](respondWithResult(_0x2fbdb9,null))[_0x377d('0x39')](handleError(_0x2fbdb9,null));};exports[_0x377d('0x2e')]=function(_0xccaf12,_0x4661d0){return db['SmsInteraction'][_0x377d('0x60')]({'where':{'id':_0xccaf12[_0x377d('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4661d0,null))[_0x377d('0x2d')](removeEntity(_0x4661d0,null))[_0x377d('0x39')](handleError(_0x4661d0,null));};exports[_0x377d('0xba')]=function(_0x10d30b,_0x1be115){return db[_0x377d('0x9d')][_0x377d('0xba')]()[_0x377d('0x2d')](respondWithResult(_0x1be115,null))['catch'](handleError(_0x1be115,null));};exports['addMessage']=function(_0x523b5a,_0x5b38ea,_0x4182de){return db[_0x377d('0xbb')][_0x377d('0x60')]({'where':{'id':_0x523b5a[_0x377d('0xb6')]['id']}})[_0x377d('0x2d')](handleEntityNotFound(_0x5b38ea,null))['then'](function(_0x328f70){if(_0x328f70){return _0x328f70[_0x377d('0xbc')](_0x523b5a[_0x377d('0x75')]['ids'],_['omit'](_0x523b5a[_0x377d('0x75')],[_0x377d('0xbd'),'id'])||{});}})[_0x377d('0x2d')](respondWithResult(_0x5b38ea,null))['catch'](handleError(_0x5b38ea,null));};exports['getMessages']=function(_0x327e22,_0x290749,_0x3a52aa){var _0x392fb2={'raw':![],'where':{}};var _0x21de94={};var _0x3b91d2={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x377d('0xbe')]({'where':{'id':_0x327e22[_0x377d('0xb6')]['id']}})['then'](handleEntityNotFound(_0x290749,null))[_0x377d('0x2d')](function(_0x236dea){if(_0x236dea){_0x21de94['model']=_[_0x377d('0x76')](db['SmsMessage'][_0x377d('0x3c')]);_0x21de94[_0x377d('0x40')]=_[_0x377d('0x76')](_0x327e22[_0x377d('0x40')]);_0x21de94[_0x377d('0x41')]=_[_0x377d('0x42')](_0x21de94['model'],_0x21de94[_0x377d('0x40')]);_0x392fb2['attributes']=_[_0x377d('0x42')](_0x21de94[_0x377d('0x3f')],qs['fields'](_0x327e22[_0x377d('0x40')]['fields']));_0x392fb2[_0x377d('0x44')]=_0x392fb2[_0x377d('0x44')][_0x377d('0x68')]?_0x392fb2['attributes']:_0x21de94['model'];if(!_0x327e22[_0x377d('0x40')][_0x377d('0x45')]('nolimit')){_0x392fb2[_0x377d('0x26')]=qs['limit'](_0x327e22[_0x377d('0x40')][_0x377d('0x26')]);_0x392fb2[_0x377d('0x23')]=qs[_0x377d('0x23')](_0x327e22['query'][_0x377d('0x23')]);}_0x392fb2['order']=qs[_0x377d('0xbf')](_0x327e22['query'][_0x377d('0xbf')]);_0x392fb2[_0x377d('0x48')]=qs[_0x377d('0x41')](_[_0x377d('0x49')](_0x327e22[_0x377d('0x40')],_0x21de94['filters']));_0x392fb2[_0x377d('0x48')][_0x377d('0xb3')]=_0x236dea['id'];if(_0x327e22[_0x377d('0x40')]['filter']){_0x392fb2['where']=_[_0x377d('0x9c')](_0x392fb2['where'],{'$or':_[_0x377d('0x3b')](_0x392fb2[_0x377d('0x44')],function(_0xfd0731){var _0x29c484={};_0x29c484[_0xfd0731]={'$like':'%'+_0x327e22['query']['filter']+'%'};return _0x29c484;})});}if(_0x327e22[_0x377d('0x40')][_0x377d('0xc0')]){var _0x54fbf4=_0x327e22[_0x377d('0x40')][_0x377d('0xc0')][_0x377d('0x67')](',');var _0x283e49={};_0x283e49[_0x54fbf4[0x0]]={'$gte':moment(_0x54fbf4[0x1])['format'](_0x377d('0xc1'))};_0x392fb2['where']=_['merge'](_0x392fb2[_0x377d('0x48')],_0x283e49);}_0x392fb2=_[_0x377d('0x9c')]({},_0x392fb2,_0x327e22[_0x377d('0xb8')]);return db['SmsMessage'][_0x377d('0x25')]({'where':_0x392fb2[_0x377d('0x48')]})['then'](function(_0x25ba14){_0x3b91d2[_0x377d('0x25')]=_0x25ba14;if(_0x327e22['query'][_0x377d('0xc2')]){_0x392fb2[_0x377d('0xb7')]=[{'all':!![]}];}return db[_0x377d('0xbb')]['findAll'](_0x392fb2);})[_0x377d('0x2d')](function(_0xde3357){_0x3b91d2[_0x377d('0xc3')]=_0xde3357;return _0x3b91d2;});}})[_0x377d('0x2d')](respondWithFilteredResult(_0x290749,_0x392fb2))[_0x377d('0x39')](handleError(_0x290749,null));};exports[_0x377d('0xc4')]=function(_0x2a523c,_0x5a4f50,_0x3a9b2e){return db[_0x377d('0x9d')][_0x377d('0x60')]({'where':{'id':_0x2a523c['params']['id']}})[_0x377d('0x2d')](handleEntityNotFound(_0x5a4f50,null))[_0x377d('0x2d')](function(_0x5c2f4c){if(_0x5c2f4c){return _0x5c2f4c['setTags'](_0x2a523c[_0x377d('0x75')]['ids'],_[_0x377d('0xc5')](_0x2a523c['body'],[_0x377d('0xbd'),'id'])||{})[_0x377d('0xc6')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x377d('0x4c')],'where':{'id':_0x2a523c[_0x377d('0x75')]['ids']}});})[_0x377d('0x2d')](function(_0x1ac83e){socket['emit'](_0x377d('0xc7'),{'id':Number(_0x2a523c[_0x377d('0xb6')]['id']),'tags':_0x1ac83e||[]});return{'id':Number(_0x2a523c[_0x377d('0xb6')]['id']),'tags':_0x1ac83e||[]};});}})[_0x377d('0x2d')](respondWithResult(_0x5a4f50,null))[_0x377d('0x39')](handleError(_0x5a4f50,null));};exports[_0x377d('0xc8')]=function(_0x18be7a,_0x1d331a,_0x4985e8){return db[_0x377d('0x9d')][_0x377d('0x60')]({'where':{'id':_0x18be7a[_0x377d('0xb6')]['id']}})[_0x377d('0x2d')](handleEntityNotFound(_0x1d331a,null))['then'](function(_0x36c908){if(_0x36c908){return _0x36c908[_0x377d('0xc8')](_0x18be7a[_0x377d('0x40')][_0x377d('0xbd')]);}})['then'](respondWithStatusCode(_0x1d331a,null))[_0x377d('0x39')](handleError(_0x1d331a,null));};exports[_0x377d('0xc9')]=function(_0x140d0d,_0x376b98){var _0x50c2c3=moment()['unix']()[_0x377d('0x9a')]();var _0x347e4c=path['join'](config[_0x377d('0xca')],_0x377d('0xcb'),_0x377d('0xcc'),_0x377d('0xcd'));var _0x24cb84=path['join'](config[_0x377d('0xca')],'server',_0x377d('0xcc'),_0x377d('0xce'));var _0x120aa3=path[_0x377d('0xcf')](_0x347e4c,_0x50c2c3);var _0x238d99=util[_0x377d('0xd0')](_0x377d('0xd1'),_0x140d0d[_0x377d('0xb6')]['id'],_0x50c2c3);var _0x41f0c9=path[_0x377d('0xcf')](_0x347e4c,_0x238d99);var _0x281e6e=[];_0x281e6e[_0x377d('0x38')]({'model':db[_0x377d('0x72')],'as':_0x377d('0x72'),'attributes':['id',_0x377d('0x34')],'raw':!![]});_0x281e6e[_0x377d('0x38')]({'model':db[_0x377d('0xd2')],'as':_0x377d('0xd3'),'attributes':['id',_0x377d('0xd4'),_0x377d('0xd5')],'raw':!![]});var _0x37e5cc=[{'model':db[_0x377d('0xbb')],'as':_0x377d('0xd6'),'attributes':['id',_0x377d('0x75'),'createdAt','direction',_0x377d('0xd7'),_0x377d('0x7f')],'include':_0x281e6e}];_0x37e5cc[_0x377d('0x38')]({'model':db[_0x377d('0xd8')],'as':_0x377d('0xd9'),'attributes':['id',_0x377d('0x31')]});_0x37e5cc['push']({'model':db[_0x377d('0x72')],'as':_0x377d('0xda'),'attributes':['id',_0x377d('0x34')]});return db[_0x377d('0x9d')][_0x377d('0x60')]({'where':{'id':_0x140d0d['params']['id']},'include':_0x37e5cc})[_0x377d('0x2d')](handleEntityNotFound(_0x376b98,null))[_0x377d('0x2d')](function(_0x3172fe){if(_0x3172fe){var _0x42a9f6=_0x3172fe[_0x377d('0xdb')]({'plain':!![]});fs[_0x377d('0xdc')](_0x120aa3);var _0x4430cb={'channel':'Sms','account':_0x42a9f6['Account']['name'],'agent':_0x42a9f6[_0x377d('0xda')]?_0x42a9f6[_0x377d('0xda')][_0x377d('0x34')]:'N.A.','createdAt':moment(_0x42a9f6['createdAt'])[_0x377d('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x377d('0x9a')](),'closedAt':_0x42a9f6[_0x377d('0xdd')]?moment(_0x42a9f6[_0x377d('0xde')])['format'](_0x377d('0xc1'))[_0x377d('0x9a')]():'','disposition':_0x42a9f6[_0x377d('0xdf')],'messages':_(_0x42a9f6['Messages'])[_0x377d('0x83')]({'secret':![]})[_0x377d('0x3b')](function(_0x48f734){return{'date':moment(_0x48f734['createdAt'])[_0x377d('0xd0')](_0x377d('0xc1'))['toString'](),'sender':_0x48f734[_0x377d('0xe0')]===_0x377d('0xe1')?_0x48f734[_0x377d('0x72')]?_0x48f734[_0x377d('0x72')][_0x377d('0x34')]:_0x377d('0xe2'):_0x48f734[_0x377d('0xd3')][_0x377d('0xd4')]+(_0x48f734['Contact']['lastName']?'\x20'+_0x48f734[_0x377d('0xd3')][_0x377d('0xd5')]:''),'body':_0x48f734[_0x377d('0x75')],'direction':_0x48f734[_0x377d('0xe0')]===_0x377d('0xe1')?'A':'C','secret':_0x48f734[_0x377d('0xd7')],'read':_0x48f734[_0x377d('0x7f')]};})[_0x377d('0x61')]()};return ejs[_0x377d('0xe3')](path[_0x377d('0xcf')](config[_0x377d('0xca')],'server','views',_0x377d('0xe4')),{'interaction':_0x4430cb})[_0x377d('0x2d')](function(_0x1ae02d){var _0x380fd6=path[_0x377d('0xcf')](_0x120aa3,'transcript-'+_0x42a9f6['id']+'-'+_0x50c2c3+'.pdf');var _0xba0922={'path':_0x380fd6,'channel':_0x377d('0xe5'),'interactionId':_0x42a9f6['id']};return pdf[_0x377d('0xe6')](_0x1ae02d,_0xba0922);})[_0x377d('0x2d')](function(){return new BPromise(function(_0x437284,_0x1ee921){zipdir(_0x120aa3,{'saveTo':_0x41f0c9},function(_0x72a22c,_0x4e0274){if(_0x72a22c)return _0x1ee921(_0x72a22c);return _0x437284(_0x4e0274);});})[_0x377d('0x2d')](function(){return new BPromise(function(_0x3b2cb7,_0x5b88db){rimraf(_0x120aa3,function(_0x28647b){if(_0x28647b)_0x5b88db(_0x28647b);return _0x3b2cb7();});});})[_0x377d('0x2d')](function(){return _0x376b98['download'](_0x41f0c9,_0x238d99,function(_0x4b046b){if(_0x4b046b){console[_0x377d('0xe7')](_0x377d('0xe8'),_0x4b046b);}else{fs[_0x377d('0xe9')](_0x41f0c9);}});});});}else{return _0x376b98[_0x377d('0x1f')](0xc8);}})[_0x377d('0x39')](handleError(_0x376b98,null));}; \ No newline at end of file +var _0xcba9=['compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','forEach','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','o.internal','Owner.internal','groupBy','SmsInteractionId','all','params','includeAll','merge','create','update','describe','addMessage','ids','omit','getMessages','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','SmsMessage','include','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','fullname','CmContact','Contact','firstName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','out','System','lastName','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Users','map','Tags','split','push','TagIds','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some'];(function(_0x14dc4e,_0x1ecab0){var _0x39be72=function(_0xbc18da){while(--_0xbc18da){_0x14dc4e['push'](_0x14dc4e['shift']());}};_0x39be72(++_0x1ecab0);}(_0xcba9,0x155));var _0x9cba=function(_0x2859f9,_0x55c196){_0x2859f9=_0x2859f9-0x0;var _0x1b6067=_0xcba9[_0x2859f9];return _0x1b6067;};'use strict';var emlformat=require(_0x9cba('0x0'));var rimraf=require(_0x9cba('0x1'));var zipdir=require(_0x9cba('0x2'));var jsonpatch=require(_0x9cba('0x3'));var rp=require(_0x9cba('0x4'));var moment=require(_0x9cba('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9cba('0x6'));var path=require(_0x9cba('0x7'));var sox=require(_0x9cba('0x8'));var csv=require('to-csv');var ejs=require(_0x9cba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cba('0xa'));var squel=require(_0x9cba('0xb'));var crypto=require(_0x9cba('0xc'));var jsforce=require(_0x9cba('0xd'));var deskjs=require(_0x9cba('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9cba('0xf'));var Papa=require(_0x9cba('0x10'));var Redis=require('ioredis');var authService=require(_0x9cba('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9cba('0x12'));var pdf=require(_0x9cba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cba('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9cba('0x15'))['db'];config['redis']=_[_0x9cba('0x16')](config[_0x9cba('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9cba('0x18'))(new Redis(config['redis']));require(_0x9cba('0x19'))[_0x9cba('0x1a')](socket);function respondWithStatusCode(_0x22a9b1,_0x1ca75c){_0x1ca75c=_0x1ca75c||0xcc;return function(_0x1bd7ac){if(_0x1bd7ac){return _0x22a9b1[_0x9cba('0x1b')](_0x1ca75c);}return _0x22a9b1[_0x9cba('0x1c')](_0x1ca75c)[_0x9cba('0x1d')]();};}function respondWithResult(_0x116598,_0x20c534){_0x20c534=_0x20c534||0xc8;return function(_0x42b76a){if(_0x42b76a){return _0x116598[_0x9cba('0x1c')](_0x20c534)[_0x9cba('0x1e')](_0x42b76a);}};}function respondWithFilteredResult(_0x60b3f1,_0x4c6172){return function(_0xe4e9c8){if(_0xe4e9c8){var _0x2ad2fc=typeof _0x4c6172[_0x9cba('0x1f')]===_0x9cba('0x20')&&typeof _0x4c6172[_0x9cba('0x21')]===_0x9cba('0x20');var _0x251ffc=_0xe4e9c8[_0x9cba('0x22')];var _0x440041=_0x2ad2fc?0x0:_0x4c6172[_0x9cba('0x1f')];var _0x465928=_0x2ad2fc?_0xe4e9c8['count']:_0x4c6172[_0x9cba('0x1f')]+_0x4c6172[_0x9cba('0x21')];var _0x2b2bf4;if(_0x465928>=_0x251ffc){_0x465928=_0x251ffc;_0x2b2bf4=0xc8;}else{_0x2b2bf4=0xce;}_0x60b3f1[_0x9cba('0x1c')](_0x2b2bf4);return _0x60b3f1[_0x9cba('0x23')](_0x9cba('0x24'),_0x440041+'-'+_0x465928+'/'+_0x251ffc)[_0x9cba('0x1e')](_0xe4e9c8);}return null;};}function patchUpdates(_0x51ed12){return function(_0x187ba5){try{jsonpatch[_0x9cba('0x25')](_0x187ba5,_0x51ed12,!![]);}catch(_0x15b45a){return BPromise[_0x9cba('0x26')](_0x15b45a);}return _0x187ba5[_0x9cba('0x27')]();};}function saveUpdates(_0x2ac881,_0x2b6e82){return function(_0x4ab40a){if(_0x4ab40a){return _0x4ab40a['update'](_0x2ac881)[_0x9cba('0x28')](function(_0x2eefa4){return _0x2eefa4;});}return null;};}function removeEntity(_0x4f22c2,_0x370bba){return function(_0x11171c){if(_0x11171c){return _0x11171c[_0x9cba('0x29')]()[_0x9cba('0x28')](function(){_0x4f22c2[_0x9cba('0x1c')](0xcc)[_0x9cba('0x1d')]();});}};}function handleEntityNotFound(_0x446961,_0x104900){return function(_0x30d624){if(!_0x30d624){_0x446961[_0x9cba('0x1b')](0x194);}return _0x30d624;};}function handleError(_0x51e5d0,_0x5b8096){_0x5b8096=_0x5b8096||0x1f4;return function(_0x140a4d){logger[_0x9cba('0x2a')](_0x140a4d[_0x9cba('0x2b')]);if(_0x140a4d[_0x9cba('0x2c')]){delete _0x140a4d['name'];}_0x51e5d0[_0x9cba('0x1c')](_0x5b8096)[_0x9cba('0x2d')](_0x140a4d);};}function getInteractionUsers(_0x15ca62,_0x409ae0){return new BPromise(function(_0x19f354,_0x5b4fef){try{if(_0x409ae0[_0x15ca62['id']]){_0x15ca62[_0x9cba('0x2e')]=_[_0x9cba('0x2f')](_0x409ae0[_0x15ca62['id']],function(_0x5a3d71){return{'id':_0x5a3d71['id'],'fullname':_0x5a3d71['fullname']};});}}catch(_0x39103b){_0x5b4fef(_0x39103b);}_0x19f354(_0x15ca62);});}function getInteractionTags(_0x18a6a2,_0x912b3b){return new BPromise(function(_0x88d37e,_0xaaf7e3){try{if(_0x18a6a2['TagIds']){_0x18a6a2[_0x9cba('0x30')]=[];_0x18a6a2['TagIds'][_0x9cba('0x31')](',')['forEach'](function(_0xaa7588){_0x18a6a2['Tags'][_0x9cba('0x32')](_0x912b3b[_0xaa7588]);});}delete _0x18a6a2[_0x9cba('0x33')];}catch(_0x25125c){_0xaaf7e3(_0x25125c);}_0x88d37e(_0x18a6a2);});}function updateSmsInteraction(_0x1b7e97,_0x8bbc00,_0x55643b){return new BPromise(function(_0x5cebf8,_0x651d8f){return getInteractionUsers(_0x1b7e97,_0x55643b)[_0x9cba('0x28')](function(_0x2be1e0){return getInteractionTags(_0x2be1e0,_0x8bbc00);})['then'](function(_0x28e195){_0x5cebf8(_0x28e195);})[_0x9cba('0x34')](function(_0x41a66f){_0x651d8f(_0x41a66f);});});}exports[_0x9cba('0x35')]=function(_0x1d5433,_0x24f93a){var _0x145287={},_0x4f6847={},_0x4225c4={'count':0x0,'rows':[]};var _0x1e93e1=_[_0x9cba('0x2f')](db[_0x9cba('0x36')][_0x9cba('0x37')],function(_0xe1c983){return{'name':_0xe1c983[_0x9cba('0x38')],'type':_0xe1c983[_0x9cba('0x39')][_0x9cba('0x3a')]};});_0x4f6847['model']=_[_0x9cba('0x2f')](_0x1e93e1,_0x9cba('0x2c'));_0x4f6847[_0x9cba('0x3b')]=_[_0x9cba('0x3c')](_0x1d5433['query']);_0x4f6847[_0x9cba('0x3d')]=_['intersection'](_0x4f6847['model'],_0x4f6847[_0x9cba('0x3b')]);_0x145287[_0x9cba('0x3e')]=_[_0x9cba('0x3f')](_0x4f6847[_0x9cba('0x40')],qs[_0x9cba('0x41')](_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x41')]));_0x145287[_0x9cba('0x3e')]=_0x145287['attributes'][_0x9cba('0x42')]?_0x145287[_0x9cba('0x3e')]:_0x4f6847[_0x9cba('0x40')];if(!_0x1d5433['query']['hasOwnProperty'](_0x9cba('0x43'))){_0x145287['limit']=qs['limit'](_0x1d5433['query'][_0x9cba('0x21')]);_0x145287[_0x9cba('0x1f')]=qs[_0x9cba('0x1f')](_0x1d5433[_0x9cba('0x3b')]['offset']);}_0x145287[_0x9cba('0x44')]=qs[_0x9cba('0x45')](_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x45')]);_0x145287[_0x9cba('0x46')]=qs['filters'](_['pick'](_0x1d5433[_0x9cba('0x3b')],_0x4f6847['filters']),_0x1e93e1);var _0x2ec8c1=[];var _0x4ab883=squel['select']()[_0x9cba('0x47')]('id')[_0x9cba('0x47')]('name')[_0x9cba('0x47')](_0x9cba('0x48'))['from'](_0x9cba('0x49'));var _0x40557a=squel['select']()[_0x9cba('0x47')](_0x9cba('0x4a'))[_0x9cba('0x47')](_0x9cba('0x4b'))[_0x9cba('0x47')](_0x9cba('0x4c'))[_0x9cba('0x4d')](_0x9cba('0x4e'),'ui')[_0x9cba('0x4f')](_0x9cba('0x50'),'u',_0x9cba('0x51'));var _0x5e8c63=squel['select']()[_0x9cba('0x4d')](_0x9cba('0x52'),'i')[_0x9cba('0x4f')](_0x9cba('0x53'),'c',_0x9cba('0x54'))[_0x9cba('0x4f')]('users','o',_0x9cba('0x55'))['left_join']('sms_accounts','a',_0x9cba('0x56'))['left_join'](_0x9cba('0x57'),'me',_0x9cba('0x58'))[_0x9cba('0x4f')](_0x9cba('0x59'),'it',_0x9cba('0x5a'))['left_join'](_0x9cba('0x49'),'t','t.id\x20=\x20it.TagId');var _0x292140=squel[_0x9cba('0x5b')]();var _0x228efa=[];var _0x1c2ac0=squel['expr']();var _0xd1bcd;if(_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x5c')]){_0xd1bcd=as[_0x9cba('0x5d')](_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x5c')]);var _0x11e551=_0xd1bcd['sqlOperator'];for(var _0x290d8c=0x0;_0x290d8c<_0xd1bcd[_0x9cba('0x5e')][_0x9cba('0x42')];_0x290d8c++){var _0x44fd70=_0xd1bcd[_0x9cba('0x5e')][_0x290d8c];var _0x3839ac='i';var _0x34ee1b=_[_0x9cba('0x5f')](_0x1e93e1,[_0x9cba('0x2c'),_0x44fd70[_0x9cba('0x47')]]);if(!_0x34ee1b){switch(_0x44fd70[_0x9cba('0x47')]){case _0x9cba('0x60'):if(_0x44fd70[_0x9cba('0x61')]==0x1){_0x5e8c63['having']('`'+_0x44fd70[_0x9cba('0x47')]+_0x9cba('0x62'));}else{_0x5e8c63[_0x9cba('0x63')]('`'+_0x44fd70[_0x9cba('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x44fd70['operator']===_0x9cba('0x64')){if(_0x44fd70[_0x9cba('0x61')]['split']('\x20')['length']>0x1){_0x292140[_0x11e551](_0x9cba('0x65'),qs['getFullTextValue'](_0x44fd70[_0x9cba('0x61')]),null);}else{var _0x17c672='%'+_0x44fd70['value']+'%';_0x292140[_0x11e551](_0x9cba('0x66'),_0x17c672,_0x17c672,_0x17c672);}}else{_0x34ee1b=_[_0x9cba('0x5f')](_0x1e93e1,[_0x9cba('0x2c'),_0x9cba('0x67')]);_0x44fd70[_0x9cba('0x47')]='ContactId';_0x448392=as[_0x9cba('0x68')](_0x3839ac,_0x34ee1b[_0x9cba('0x39')],_0x44fd70);_0x292140[_0x11e551](_0x448392['text'],_0x448392[_0x9cba('0x61')][_0x9cba('0x69')],_0x448392[_0x9cba('0x61')][_0x9cba('0x1d')]);}break;case'Tag':var _0x3eca1b=_0x44fd70[_0x9cba('0x61')][_0x9cba('0x31')](',')[_0x9cba('0x2f')](function(_0xb2ac12){return Number(_0xb2ac12);});_0x3eca1b['forEach'](function(_0x17deb3){_0x1c2ac0['or'](_0x9cba('0x6a'),'%,'+_0x17deb3+',%');});_0x228efa=_[_0x9cba('0x6b')](_0x228efa,_0x3eca1b);break;case _0x9cba('0x6c'):if(_0x44fd70[_0x9cba('0x6d')]===_0x9cba('0x64')){_0x292140[_0x11e551](_0x9cba('0x6e'),'%'+_0x44fd70[_0x9cba('0x61')]+'%',null);}else{_0x34ee1b=_['find'](_0x1e93e1,[_0x9cba('0x2c'),_0x9cba('0x6f')]);_0x44fd70['field']='UserId';_0x448392=as[_0x9cba('0x68')](_0x3839ac,_0x34ee1b['type'],_0x44fd70);_0x292140[_0x11e551](_0x448392[_0x9cba('0x70')],_0x448392[_0x9cba('0x61')]['start'],_0x448392[_0x9cba('0x61')][_0x9cba('0x1d')]);}break;case _0x9cba('0x71'):_0x448392=as[_0x9cba('0x68')]('me',null,_0x44fd70);_0x292140[_0x11e551](_0x448392['text'],_0x448392['value'][_0x9cba('0x69')],_0x448392[_0x9cba('0x61')][_0x9cba('0x1d')]);break;}}else{var _0x448392=as[_0x9cba('0x68')](_0x3839ac,_0x34ee1b[_0x9cba('0x39')],_0x44fd70);_0x292140[_0x11e551](_0x448392['text'],_0x448392[_0x9cba('0x61')][_0x9cba('0x69')],_0x448392[_0x9cba('0x61')][_0x9cba('0x1d')]);}}}else{var _0x3da83e=_(_0x1d5433[_0x9cba('0x3b')])[_0x9cba('0x3c')]()[_0x9cba('0x2f')](function(_0x17cd56){return _[_0x9cba('0x72')](_0x1e93e1,[_0x9cba('0x2c'),_0x17cd56])?_0x17cd56:undefined;})[_0x9cba('0x73')]()[_0x9cba('0x61')]();if(!_[_0x9cba('0x74')](_0x3da83e)){_0x3da83e['forEach'](function(_0x5482e6){if(_0x5482e6===_0x9cba('0x75')){_0x5e8c63[_0x9cba('0x46')](_0x9cba('0x76'),[][_0x9cba('0x77')](_0x1d5433[_0x9cba('0x3b')][_0x5482e6]));}else if(_0x5482e6===_0x9cba('0x78')){var _0x1cf84d=JSON[_0x9cba('0x79')](_0x1d5433['query'][_0x5482e6])[_0x9cba('0x7a')];var _0x322850=JSON[_0x9cba('0x79')](_0x1d5433[_0x9cba('0x3b')][_0x5482e6])[_0x9cba('0x7b')];_0x5e8c63[_0x9cba('0x46')](_0x9cba('0x7c'),_0x1cf84d,_0x322850);}else{if(_0x1d5433['query'][_0x5482e6]==='null'){_0x5e8c63[_0x9cba('0x46')]('i.'+_0x5482e6+'\x20IS\x20NULL');}else{_0x5e8c63['where']('i.'+_0x5482e6+'\x20=\x20?',_0x1d5433[_0x9cba('0x3b')][_0x5482e6]);}}});}if(_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x7d')]){if(_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x7d')]==0x1){_0x5e8c63['having'](_0x9cba('0x7e'));}else{_0x5e8c63[_0x9cba('0x63')](_0x9cba('0x7f'));}}if(_0x1d5433['query']['tag']){_0x228efa=_['isArray'](_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x80')])?_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x80')]:new Array(_0x1d5433['query']['tag']);_0x228efa[_0x9cba('0x81')](function(_0x18297b){_0x1c2ac0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18297b+',%');});}if(_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x82')]){var _0x3d9cbb=_0x1d5433[_0x9cba('0x3b')][_0x9cba('0x82')]['replace']('\x5c','\x5c\x5c')[_0x9cba('0x83')](/'/g,'\x27\x27');if(qs[_0x9cba('0x84')](_0x3d9cbb)){_0x292140['or']('i.id\x20LIKE\x20?',_0x3d9cbb+'%')['or'](_0x9cba('0x85'),_0x3d9cbb+'%');}else{_0x292140['or'](_0x9cba('0x86'),qs[_0x9cba('0x87')](_0x3d9cbb))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3d9cbb+'%');}}}_0x5e8c63[_0x9cba('0x46')](_0x292140);_0x5e8c63[_0x9cba('0x88')](_0x9cba('0x89'));var _0x4ea4fe={'type':db[_0x9cba('0x8a')][_0x9cba('0x8b')]['SELECT'],'raw':!![]};var _0x2c78f9=_0x5e8c63[_0x9cba('0x8c')]();_0x2c78f9[_0x9cba('0x47')]('i.id');_0x2c78f9[_0x9cba('0x47')](_0x9cba('0x8d'),_0x9cba('0x60'));if(_0x145287[_0x9cba('0x44')]){_0x145287[_0x9cba('0x44')]['forEach'](function(_0x33e9ab){var _0xb025f7=_0x33e9ab[0x0]===_0x9cba('0x8e')?_0x33e9ab[0x0]:'i.'+_0x33e9ab[0x0];_0x5e8c63[_0x9cba('0x44')](_0xb025f7,_0x33e9ab[0x1]===_0x9cba('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x228efa)){_0x5e8c63[_0x9cba('0x63')](_0x1c2ac0);_0x2c78f9['where']('t.id\x20IN\x20?',_0x228efa);}BPromise[_0x9cba('0x90')]()[_0x9cba('0x28')](function(){if(!_0xd1bcd){if(_0x1d5433['query'][_0x9cba('0x75')])return;_0x2c78f9[_0x9cba('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5e8c63[_0x9cba('0x46')](_0x9cba('0x91'));return;}if(_0x1d5433[_0x9cba('0x92')][_0x9cba('0x93')]!==_0x9cba('0x94'))return;return _0x1d5433['user'][_0x9cba('0x95')]({'attributes':['id'],'raw':!![]})[_0x9cba('0x28')](function(_0x194119){if(_[_0x9cba('0x74')](_0x194119)){_0x2c78f9[_0x9cba('0x46')](_0x9cba('0x96'));_0x5e8c63['where'](_0x9cba('0x96'));}else{_0x2c78f9['where']('i.SmsAccountId\x20IN\x20?',_[_0x9cba('0x2f')](_0x194119,'id'));_0x5e8c63[_0x9cba('0x46')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x194119,'id'));}});})[_0x9cba('0x28')](function(){if(_0x1d5433[_0x9cba('0x92')][_0x9cba('0x93')]==='agent'&&!_0xd1bcd&&!_0x1d5433['query']['SmsAccountId'])return[];return db[_0x9cba('0x97')][_0x9cba('0x3b')](_0x2c78f9['toString'](),_0x4ea4fe);})[_0x9cba('0x28')](function(_0x44b7d9){_0x4225c4['count']=_0x44b7d9[_0x9cba('0x42')];if(_0x4225c4[_0x9cba('0x22')]===0x0)return[];return db[_0x9cba('0x97')][_0x9cba('0x3b')](_0x4ab883[_0x9cba('0x98')](),_0x4ea4fe)['then'](function(_0x5cd6d3){_0x2ec8c1=_['keyBy'](_0x5cd6d3,'id');_0x4ea4fe=_['merge'](_0x4ea4fe,{'model':db[_0x9cba('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d5433['query']['fields']){_0x145287[_0x9cba('0x3e')][_0x9cba('0x81')](function(_0xaea7a0){_0x5e8c63[_0x9cba('0x47')]('i.'+_0xaea7a0);});}else{_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x8d'),_0x9cba('0x60'));_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x99'),'Account.key');_0x5e8c63[_0x9cba('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x9a'),'contactName');_0x5e8c63['field'](_0x9cba('0x9b'));_0x5e8c63['field']('c.firstName','Contact.firstName');_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x9c'),'Contact.lastName');_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x9d'),_0x9cba('0x9e'));_0x5e8c63[_0x9cba('0x47')](_0x9cba('0x9f'),_0x9cba('0xa0'));_0x5e8c63['field'](_0x9cba('0xa1'),'Contact.mobile');_0x5e8c63['field'](_0x9cba('0xa2'),'Contact.fax');_0x5e8c63[_0x9cba('0x47')](_0x9cba('0xa3'),'Owner.fullname');_0x5e8c63[_0x9cba('0x47')](_0x9cba('0xa4'),_0x9cba('0xa5'));_0x5e8c63['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9cba('0x33'));}if(_0x145287['limit'])_0x5e8c63[_0x9cba('0x21')](_0x145287[_0x9cba('0x21')]);if(_0x145287[_0x9cba('0x1f')])_0x5e8c63['offset'](_0x145287[_0x9cba('0x1f')]);return db['sequelize']['query'](_0x5e8c63[_0x9cba('0x98')](),_0x4ea4fe);})['then'](function(_0x2886cb){if(_0x2886cb[_0x9cba('0x42')]>0x0)_0x40557a[_0x9cba('0x46')]('ui.SmsInteractionId\x20IN\x20?',_[_0x9cba('0x2f')](_0x2886cb,'id'));return db[_0x9cba('0x97')][_0x9cba('0x3b')](_0x40557a[_0x9cba('0x98')](),_0x4ea4fe)[_0x9cba('0x28')](function(_0x2af973){var _0xa24535=_[_0x9cba('0xa6')](_0x2af973,_0x9cba('0xa7'));var _0x3dbd60=[];_0x2886cb[_0x9cba('0x81')](function(_0x184575){_0x3dbd60[_0x9cba('0x32')](updateSmsInteraction(_0x184575,_0x2ec8c1,_0xa24535));});return BPromise[_0x9cba('0xa8')](_0x3dbd60);});});})[_0x9cba('0x28')](function(_0x4484c5){_0x4225c4['rows']=_0x4484c5;return _0x4225c4;})[_0x9cba('0x28')](respondWithFilteredResult(_0x24f93a,_0x145287))['catch'](handleError(_0x24f93a,null));};exports['show']=function(_0xee0b46,_0x14cb25){var _0x343ad1={'raw':![],'where':{'id':_0xee0b46[_0x9cba('0xa9')]['id']}},_0x2b408f={};_0x2b408f[_0x9cba('0x40')]=_[_0x9cba('0x3c')](db[_0x9cba('0x36')][_0x9cba('0x37')]);_0x2b408f[_0x9cba('0x3b')]=_[_0x9cba('0x3c')](_0xee0b46[_0x9cba('0x3b')]);_0x2b408f['filters']=_['intersection'](_0x2b408f[_0x9cba('0x40')],_0x2b408f['query']);_0x343ad1[_0x9cba('0x3e')]=_[_0x9cba('0x3f')](_0x2b408f[_0x9cba('0x40')],qs[_0x9cba('0x41')](_0xee0b46[_0x9cba('0x3b')]['fields']));_0x343ad1['attributes']=_0x343ad1['attributes'][_0x9cba('0x42')]?_0x343ad1['attributes']:_0x2b408f[_0x9cba('0x40')];if(_0xee0b46[_0x9cba('0x3b')][_0x9cba('0xaa')]){_0x343ad1['include']=[{'all':!![]}];}_0x343ad1=_[_0x9cba('0xab')]({},_0x343ad1,_0xee0b46['options']);return db['SmsInteraction'][_0x9cba('0x5f')](_0x343ad1)[_0x9cba('0x28')](handleEntityNotFound(_0x14cb25,null))[_0x9cba('0x28')](respondWithResult(_0x14cb25,null))[_0x9cba('0x34')](handleError(_0x14cb25,null));};exports[_0x9cba('0xac')]=function(_0x66cdea,_0xae3130){return db[_0x9cba('0x36')]['create'](_0x66cdea[_0x9cba('0x71')],{})[_0x9cba('0x28')](respondWithResult(_0xae3130,0xc9))[_0x9cba('0x34')](handleError(_0xae3130,null));};exports[_0x9cba('0xad')]=function(_0x1c0beb,_0x562af9){if(_0x1c0beb[_0x9cba('0x71')]['id']){delete _0x1c0beb[_0x9cba('0x71')]['id'];}return db[_0x9cba('0x36')][_0x9cba('0x5f')]({'where':{'id':_0x1c0beb[_0x9cba('0xa9')]['id']}})[_0x9cba('0x28')](handleEntityNotFound(_0x562af9,null))['then'](saveUpdates(_0x1c0beb[_0x9cba('0x71')],null))[_0x9cba('0x28')](respondWithResult(_0x562af9,null))[_0x9cba('0x34')](handleError(_0x562af9,null));};exports[_0x9cba('0x29')]=function(_0x2b8d21,_0x16255b){return db[_0x9cba('0x36')]['find']({'where':{'id':_0x2b8d21[_0x9cba('0xa9')]['id']}})[_0x9cba('0x28')](handleEntityNotFound(_0x16255b,null))['then'](removeEntity(_0x16255b,null))['catch'](handleError(_0x16255b,null));};exports[_0x9cba('0xae')]=function(_0x3ead82,_0x2e262b){return db[_0x9cba('0x36')]['describe']()['then'](respondWithResult(_0x2e262b,null))[_0x9cba('0x34')](handleError(_0x2e262b,null));};exports[_0x9cba('0xaf')]=function(_0x510736,_0x2313e7,_0xcddb6){return db['SmsMessage'][_0x9cba('0x5f')]({'where':{'id':_0x510736['params']['id']}})[_0x9cba('0x28')](handleEntityNotFound(_0x2313e7,null))[_0x9cba('0x28')](function(_0x5b3c99){if(_0x5b3c99){return _0x5b3c99[_0x9cba('0xaf')](_0x510736[_0x9cba('0x71')][_0x9cba('0xb0')],_[_0x9cba('0xb1')](_0x510736[_0x9cba('0x71')],[_0x9cba('0xb0'),'id'])||{});}})[_0x9cba('0x28')](respondWithResult(_0x2313e7,null))[_0x9cba('0x34')](handleError(_0x2313e7,null));};exports[_0x9cba('0xb2')]=function(_0x12a7a5,_0x4d5cb8,_0x1ccb04){var _0x2c5e1d={'raw':![],'where':{}};var _0x3946d8={};var _0x1d95ac={'count':0x0,'rows':[]};return db[_0x9cba('0x36')]['findOne']({'where':{'id':_0x12a7a5['params']['id']}})[_0x9cba('0x28')](handleEntityNotFound(_0x4d5cb8,null))['then'](function(_0x53992f){if(_0x53992f){_0x3946d8[_0x9cba('0x40')]=_[_0x9cba('0x3c')](db['SmsMessage'][_0x9cba('0x37')]);_0x3946d8[_0x9cba('0x3b')]=_[_0x9cba('0x3c')](_0x12a7a5[_0x9cba('0x3b')]);_0x3946d8['filters']=_[_0x9cba('0x3f')](_0x3946d8[_0x9cba('0x40')],_0x3946d8['query']);_0x2c5e1d[_0x9cba('0x3e')]=_[_0x9cba('0x3f')](_0x3946d8[_0x9cba('0x40')],qs[_0x9cba('0x41')](_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0x41')]));_0x2c5e1d['attributes']=_0x2c5e1d[_0x9cba('0x3e')][_0x9cba('0x42')]?_0x2c5e1d[_0x9cba('0x3e')]:_0x3946d8['model'];if(!_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0xb3')](_0x9cba('0x43'))){_0x2c5e1d[_0x9cba('0x21')]=qs[_0x9cba('0x21')](_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0x21')]);_0x2c5e1d[_0x9cba('0x1f')]=qs[_0x9cba('0x1f')](_0x12a7a5['query'][_0x9cba('0x1f')]);}_0x2c5e1d['order']=qs['sort'](_0x12a7a5[_0x9cba('0x3b')]['sort']);_0x2c5e1d[_0x9cba('0x46')]=qs[_0x9cba('0x3d')](_[_0x9cba('0xb4')](_0x12a7a5['query'],_0x3946d8[_0x9cba('0x3d')]));_0x2c5e1d['where'][_0x9cba('0xa7')]=_0x53992f['id'];if(_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0x82')]){_0x2c5e1d['where']=_[_0x9cba('0xab')](_0x2c5e1d[_0x9cba('0x46')],{'$or':_[_0x9cba('0x2f')](_0x2c5e1d[_0x9cba('0x3e')],function(_0x10b526){var _0xdef57={};_0xdef57[_0x10b526]={'$like':'%'+_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0x82')]+'%'};return _0xdef57;})});}if(_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0x7a')]){var _0x196d95=_0x12a7a5['query']['$gte'][_0x9cba('0x31')](',');var _0x29fdd0={};_0x29fdd0[_0x196d95[0x0]]={'$gte':moment(_0x196d95[0x1])[_0x9cba('0xb5')](_0x9cba('0xb6'))};_0x2c5e1d[_0x9cba('0x46')]=_[_0x9cba('0xab')](_0x2c5e1d[_0x9cba('0x46')],_0x29fdd0);}_0x2c5e1d=_[_0x9cba('0xab')]({},_0x2c5e1d,_0x12a7a5[_0x9cba('0xb7')]);return db[_0x9cba('0xb8')][_0x9cba('0x22')]({'where':_0x2c5e1d[_0x9cba('0x46')]})[_0x9cba('0x28')](function(_0x193fad){_0x1d95ac[_0x9cba('0x22')]=_0x193fad;if(_0x12a7a5[_0x9cba('0x3b')][_0x9cba('0xaa')]){_0x2c5e1d[_0x9cba('0xb9')]=[{'all':!![]}];}return db[_0x9cba('0xb8')][_0x9cba('0xba')](_0x2c5e1d);})['then'](function(_0x54080a){_0x1d95ac[_0x9cba('0xbb')]=_0x54080a;return _0x1d95ac;});}})[_0x9cba('0x28')](respondWithFilteredResult(_0x4d5cb8,_0x2c5e1d))[_0x9cba('0x34')](handleError(_0x4d5cb8,null));};exports[_0x9cba('0xbc')]=function(_0x4fd20a,_0x55f561,_0x21f857){return db[_0x9cba('0x36')]['find']({'where':{'id':_0x4fd20a[_0x9cba('0xa9')]['id']}})[_0x9cba('0x28')](handleEntityNotFound(_0x55f561,null))[_0x9cba('0x28')](function(_0x244b16){if(_0x244b16){return _0x244b16[_0x9cba('0xbd')](_0x4fd20a[_0x9cba('0x71')][_0x9cba('0xb0')],_[_0x9cba('0xb1')](_0x4fd20a[_0x9cba('0x71')],[_0x9cba('0xb0'),'id'])||{})[_0x9cba('0xbe')](function(){return db['Tag'][_0x9cba('0xba')]({'attributes':['id','name','color'],'where':{'id':_0x4fd20a[_0x9cba('0x71')][_0x9cba('0xb0')]}});})[_0x9cba('0x28')](function(_0x4cbf78){socket[_0x9cba('0xbf')](_0x9cba('0xc0'),{'id':Number(_0x4fd20a['params']['id']),'tags':_0x4cbf78||[]});return{'id':Number(_0x4fd20a['params']['id']),'tags':_0x4cbf78||[]};});}})[_0x9cba('0x28')](respondWithResult(_0x55f561,null))['catch'](handleError(_0x55f561,null));};exports[_0x9cba('0xc1')]=function(_0x10720a,_0x34881e,_0x37047a){return db[_0x9cba('0x36')]['find']({'where':{'id':_0x10720a[_0x9cba('0xa9')]['id']}})['then'](handleEntityNotFound(_0x34881e,null))['then'](function(_0x36ffe0){if(_0x36ffe0){return _0x36ffe0[_0x9cba('0xc1')](_0x10720a[_0x9cba('0x3b')][_0x9cba('0xb0')]);}})[_0x9cba('0x28')](respondWithStatusCode(_0x34881e,null))[_0x9cba('0x34')](handleError(_0x34881e,null));};exports[_0x9cba('0xc2')]=function(_0x55c25b,_0x3313bc){var _0x3121ec=moment()['unix']()[_0x9cba('0x98')]();var _0x559cf7=path[_0x9cba('0xc3')](config[_0x9cba('0xc4')],_0x9cba('0xc5'),_0x9cba('0xc6'),_0x9cba('0xc7'));var _0x3fc5c6=path[_0x9cba('0xc3')](config[_0x9cba('0xc4')],_0x9cba('0xc5'),_0x9cba('0xc6'),_0x9cba('0xc8'));var _0x28b476=path[_0x9cba('0xc3')](_0x559cf7,_0x3121ec);var _0x15efbd=util['format']('transcript-%d-%s.zip',_0x55c25b['params']['id'],_0x3121ec);var _0x134a23=path['join'](_0x559cf7,_0x15efbd);var _0x14a3a3=[];_0x14a3a3[_0x9cba('0x32')]({'model':db[_0x9cba('0x6c')],'as':_0x9cba('0x6c'),'attributes':['id',_0x9cba('0xc9')],'raw':!![]});_0x14a3a3[_0x9cba('0x32')]({'model':db[_0x9cba('0xca')],'as':_0x9cba('0xcb'),'attributes':['id',_0x9cba('0xcc'),'lastName'],'raw':!![]});var _0x2dbc3e=[{'model':db[_0x9cba('0xb8')],'as':_0x9cba('0xcd'),'attributes':['id',_0x9cba('0x71'),_0x9cba('0x78'),'direction',_0x9cba('0xce'),_0x9cba('0x7d')],'include':_0x14a3a3}];_0x2dbc3e['push']({'model':db[_0x9cba('0xcf')],'as':_0x9cba('0xd0'),'attributes':['id','name']});_0x2dbc3e['push']({'model':db[_0x9cba('0x6c')],'as':_0x9cba('0xd1'),'attributes':['id',_0x9cba('0xc9')]});return db[_0x9cba('0x36')][_0x9cba('0x5f')]({'where':{'id':_0x55c25b[_0x9cba('0xa9')]['id']},'include':_0x2dbc3e})[_0x9cba('0x28')](handleEntityNotFound(_0x3313bc,null))['then'](function(_0x1dcf1e){if(_0x1dcf1e){var _0x57431f=_0x1dcf1e[_0x9cba('0xd2')]({'plain':!![]});fs[_0x9cba('0xd3')](_0x28b476);var _0x534f49={'channel':_0x9cba('0xd4'),'account':_0x57431f[_0x9cba('0xd0')][_0x9cba('0x2c')],'agent':_0x57431f[_0x9cba('0xd1')]?_0x57431f[_0x9cba('0xd1')][_0x9cba('0xc9')]:_0x9cba('0xd5'),'createdAt':moment(_0x57431f[_0x9cba('0x78')])['format'](_0x9cba('0xb6'))[_0x9cba('0x98')](),'closedAt':_0x57431f[_0x9cba('0xd6')]?moment(_0x57431f[_0x9cba('0xd7')])[_0x9cba('0xb5')](_0x9cba('0xb6'))[_0x9cba('0x98')]():'','disposition':_0x57431f['disposition'],'messages':_(_0x57431f[_0x9cba('0xcd')])['filter']({'secret':![]})[_0x9cba('0x2f')](function(_0xe287e8){return{'date':moment(_0xe287e8['createdAt'])[_0x9cba('0xb5')](_0x9cba('0xb6'))[_0x9cba('0x98')](),'sender':_0xe287e8['direction']===_0x9cba('0xd8')?_0xe287e8[_0x9cba('0x6c')]?_0xe287e8[_0x9cba('0x6c')][_0x9cba('0xc9')]:_0x9cba('0xd9'):_0xe287e8[_0x9cba('0xcb')][_0x9cba('0xcc')]+(_0xe287e8[_0x9cba('0xcb')][_0x9cba('0xda')]?'\x20'+_0xe287e8[_0x9cba('0xcb')]['lastName']:''),'body':_0xe287e8[_0x9cba('0x71')],'direction':_0xe287e8[_0x9cba('0xdb')]===_0x9cba('0xd8')?'A':'C','secret':_0xe287e8[_0x9cba('0xce')],'read':_0xe287e8[_0x9cba('0x7d')]};})[_0x9cba('0x61')]()};return ejs[_0x9cba('0xdc')](path[_0x9cba('0xc3')](config['root'],_0x9cba('0xc5'),_0x9cba('0xdd'),_0x9cba('0xde')),{'interaction':_0x534f49})[_0x9cba('0x28')](function(_0x3002bb){var _0x2af250=path[_0x9cba('0xc3')](_0x28b476,_0x9cba('0xdf')+_0x57431f['id']+'-'+_0x3121ec+_0x9cba('0xe0'));var _0xe82073={'path':_0x2af250,'channel':_0x9cba('0xd4'),'interactionId':_0x57431f['id']};return pdf[_0x9cba('0xe1')](_0x3002bb,_0xe82073);})[_0x9cba('0x28')](function(){return new BPromise(function(_0x2e92f3,_0x2af7f2){zipdir(_0x28b476,{'saveTo':_0x134a23},function(_0x1618d6,_0x44e434){if(_0x1618d6)return _0x2af7f2(_0x1618d6);return _0x2e92f3(_0x44e434);});})[_0x9cba('0x28')](function(){return new BPromise(function(_0x316faf,_0x1a4a77){rimraf(_0x28b476,function(_0x2ba14c){if(_0x2ba14c)_0x1a4a77(_0x2ba14c);return _0x316faf();});});})[_0x9cba('0x28')](function(){return _0x3313bc[_0x9cba('0xc2')](_0x134a23,_0x15efbd,function(_0x4e125f){if(_0x4e125f){console['log'](_0x9cba('0xe2'),_0x4e125f);}else{fs[_0x9cba('0xe3')](_0x134a23);}});});});}else{return _0x3313bc[_0x9cba('0x1b')](0xc8);}})[_0x9cba('0x34')](handleError(_0x3313bc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index b113a11..a1f4b16 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 _0x47c5=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x47c5,0x165));var _0x547c=function(_0x31a655,_0x581842){_0x31a655=_0x31a655-0x0;var _0x361094=_0x47c5[_0x31a655];return _0x361094;};'use strict';var EventEmitter=require(_0x547c('0x0'));var SmsInteraction=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var SmsMessage=require(_0x547c('0x1'))['db'][_0x547c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x547c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x547c('0x5'),'afterDestroy':_0x547c('0x6')};function emitEvent(_0x5b48c9){return function(_0x3e827e,_0x468220,_0x51ab7f){_0x3e827e[_0x547c('0x7')]({'attributes':['id'],'raw':!![]})[_0x547c('0x8')](function(_0x381f2e){_0x3e827e[_0x547c('0x9')](_0x547c('0xa'),_0x381f2e[_0x547c('0xb')](function(_0x3e2279){return{'id':_0x3e2279['id']};}));return SmsMessage[_0x547c('0xc')]({'where':{'SmsInteractionId':_0x3e827e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x547c('0x8')](function(_0x44a581){_0x3e827e[_0x547c('0x9')](_0x547c('0xd'),_0x44a581[_0x547c('0xe')]);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9+':'+_0x3e827e['id'],_0x3e827e);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9,_0x3e827e);_0x51ab7f(null);})[_0x547c('0x10')](_0x51ab7f(null));};}for(var e in events){if(events[_0x547c('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x547c('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x7334=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction'];(function(_0x4d6321,_0x13044d){var _0x185667=function(_0x556b6a){while(--_0x556b6a){_0x4d6321['push'](_0x4d6321['shift']());}};_0x185667(++_0x13044d);}(_0x7334,0x184));var _0x4733=function(_0x599f4c,_0x3c4235){_0x599f4c=_0x599f4c-0x0;var _0x84ed8e=_0x7334[_0x599f4c];return _0x84ed8e;};'use strict';var EventEmitter=require(_0x4733('0x0'));var SmsInteraction=require(_0x4733('0x1'))['db'][_0x4733('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4733('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4733('0x4'),'afterDestroy':_0x4733('0x5')};function emitEvent(_0x3645a2){return function(_0x29d7da,_0x2b146d,_0x449ead){_0x29d7da[_0x4733('0x6')]({'attributes':['id'],'raw':!![]})[_0x4733('0x7')](function(_0x12cafa){_0x29d7da[_0x4733('0x8')](_0x4733('0x9'),_0x12cafa[_0x4733('0xa')](function(_0x4c5c0){return{'id':_0x4c5c0['id']};}));return SmsMessage[_0x4733('0xb')]({'where':{'SmsInteractionId':_0x29d7da['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4733('0x7')](function(_0x1bc511){_0x29d7da[_0x4733('0x8')]('unreadMessages',_0x1bc511[_0x4733('0xc')]);SmsInteractionEvents[_0x4733('0xd')](_0x3645a2+':'+_0x29d7da['id'],_0x29d7da);SmsInteractionEvents['emit'](_0x3645a2,_0x29d7da);_0x449ead(null);})[_0x4733('0xe')](_0x449ead(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4733('0xf')](e,emitEvent(event));}}module[_0x4733('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 d4b69c4..0e05778 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 _0xf111=['exports','define','SmsInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x7df4cb,_0x5d824d){var _0x10b458=function(_0x16c220){while(--_0x16c220){_0x7df4cb['push'](_0x7df4cb['shift']());}};_0x10b458(++_0x5d824d);}(_0xf111,0x197));var _0x1f11=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xf111[_0x587ba2];return _0x50ec73;};'use strict';var _=require('lodash');var util=require(_0x1f11('0x0'));var logger=require(_0x1f11('0x1'))(_0x1f11('0x2'));var moment=require('moment');var BPromise=require(_0x1f11('0x3'));var rp=require(_0x1f11('0x4'));var fs=require('fs');var path=require(_0x1f11('0x5'));var rimraf=require(_0x1f11('0x6'));var config=require(_0x1f11('0x7'));var attributes=require(_0x1f11('0x8'));module[_0x1f11('0x9')]=function(_0x2ca63d,_0x4f2447){return _0x2ca63d[_0x1f11('0xa')](_0x1f11('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x370bab,_0x57a26b,_0x31fa02){if(_0x370bab[_0x1f11('0xc')](_0x1f11('0xd'))){_0x370bab['closedAt']=moment()[_0x1f11('0xe')](_0x1f11('0xf'));}_0x31fa02(null,_0x370bab);}}});}; \ No newline at end of file +var _0x9bfd=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x24c66d,_0x2650e8){var _0x54dfc0=function(_0x55a274){while(--_0x55a274){_0x24c66d['push'](_0x24c66d['shift']());}};_0x54dfc0(++_0x2650e8);}(_0x9bfd,0x1ec));var _0xd9bf=function(_0x29e138,_0x109f6a){_0x29e138=_0x29e138-0x0;var _0x33bf46=_0x9bfd[_0x29e138];return _0x33bf46;};'use strict';var _=require(_0xd9bf('0x0'));var util=require(_0xd9bf('0x1'));var logger=require(_0xd9bf('0x2'))(_0xd9bf('0x3'));var moment=require(_0xd9bf('0x4'));var BPromise=require(_0xd9bf('0x5'));var rp=require(_0xd9bf('0x6'));var fs=require('fs');var path=require(_0xd9bf('0x7'));var rimraf=require(_0xd9bf('0x8'));var config=require('../../config/environment');var attributes=require(_0xd9bf('0x9'));module[_0xd9bf('0xa')]=function(_0x5f4a00,_0x21fc2f){return _0x5f4a00[_0xd9bf('0xb')](_0xd9bf('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x398ef3,_0x3d27b2,_0x5eb5f9){if(_0x398ef3[_0xd9bf('0xd')]('closed')){_0x398ef3[_0xd9bf('0xe')]=moment()[_0xd9bf('0xf')](_0xd9bf('0x10'));}_0x5eb5f9(null,_0x398ef3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index adc7a4d..19224c8 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 _0x33c0=['omit','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','find','then','addTags','ids'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x33c0,0x173));var _0x033c=function(_0xdb0221,_0x5ebe4c){_0xdb0221=_0xdb0221-0x0;var _0x43287c=_0x33c0[_0xdb0221];return _0x43287c;};'use strict';var _=require('lodash');var util=require(_0x033c('0x0'));var moment=require('moment');var BPromise=require(_0x033c('0x1'));var rs=require(_0x033c('0x2'));var fs=require('fs');var Redis=require(_0x033c('0x3'));var db=require(_0x033c('0x4'))['db'];var utils=require(_0x033c('0x5'));var logger=require('../../config/logger')(_0x033c('0x6'));var config=require(_0x033c('0x7'));var jayson=require(_0x033c('0x8'));var client=jayson[_0x033c('0x9')][_0x033c('0xa')]({'port':0x232a});config[_0x033c('0xb')]=_[_0x033c('0xc')](config[_0x033c('0xb')],{'host':_0x033c('0xd'),'port':0x18eb});var socket=require(_0x033c('0xe'))(new Redis(config[_0x033c('0xb')]));require(_0x033c('0xf'))[_0x033c('0x10')](socket);function respondWithRpcPromise(_0x58695b,_0x364623,_0x10cd82){return new BPromise(function(_0xdb56df,_0x3f6f0e){return client['request'](_0x58695b,_0x10cd82)['then'](function(_0xac7959){logger[_0x033c('0x11')](_0x033c('0x12'),_0x364623,'request\x20sent');logger[_0x033c('0x13')](_0x033c('0x14'),_0x364623,_0x033c('0x15'),JSON[_0x033c('0x16')](_0xac7959));if(_0xac7959[_0x033c('0x17')]){if(_0xac7959[_0x033c('0x17')]['code']===0x1f4){logger[_0x033c('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x364623,_0xac7959[_0x033c('0x17')][_0x033c('0x18')]);return _0x3f6f0e(_0xac7959['error'][_0x033c('0x18')]);}logger['error'](_0x033c('0x12'),_0x364623,_0xac7959[_0x033c('0x17')]['message']);return _0xdb56df(_0xac7959[_0x033c('0x17')]['message']);}else{logger[_0x033c('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x364623,_0x033c('0x15'));_0xdb56df(_0xac7959['result'][_0x033c('0x18')]);}})[_0x033c('0x19')](function(_0x12958d){logger['error'](_0x033c('0x12'),_0x364623,_0x12958d);_0x3f6f0e(_0x12958d);});});}exports[_0x033c('0x1a')]=function(_0x4c6235){var _0x44398d=this;return new Promise(function(_0x2f5b48,_0x1d53c0){return db[_0x033c('0x1b')][_0x033c('0x1c')](_0x4c6235[_0x033c('0x1d')],{'raw':_0x4c6235['options']?_0x4c6235[_0x033c('0x1e')][_0x033c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c6235[_0x033c('0x1e')]?_0x4c6235[_0x033c('0x1e')][_0x033c('0x20')]||null:null,'attributes':_0x4c6235[_0x033c('0x1e')]?_0x4c6235[_0x033c('0x1e')][_0x033c('0x21')]||null:null,'limit':_0x4c6235['options']?_0x4c6235[_0x033c('0x1e')][_0x033c('0x22')]||null:null})['then'](function(_0x2d1695){logger[_0x033c('0x11')](_0x033c('0x1a'),_0x4c6235);logger[_0x033c('0x13')](_0x033c('0x1a'),_0x4c6235,JSON['stringify'](_0x2d1695));_0x2f5b48(_0x2d1695);})[_0x033c('0x19')](function(_0x4292ee){logger[_0x033c('0x17')](_0x033c('0x1a'),_0x4292ee[_0x033c('0x18')],_0x4c6235);_0x1d53c0(_0x44398d[_0x033c('0x17')](0x1f4,_0x4292ee[_0x033c('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x33b877){return new Promise(function(_0x108e82,_0x375160){return db[_0x033c('0x1b')][_0x033c('0x23')]({'where':_0x33b877[_0x033c('0x1e')]?_0x33b877[_0x033c('0x1e')][_0x033c('0x20')]||null:null})[_0x033c('0x24')](function(_0x272877){if(_0x272877){return _0x272877[_0x033c('0x25')](_0x33b877[_0x033c('0x1d')][_0x033c('0x26')],_[_0x033c('0x27')](_0x33b877[_0x033c('0x1d')],[_0x033c('0x26'),'id'])||{});}})['spread'](function(_0x3fabc1){logger[_0x033c('0x11')](_0x033c('0x28'),_0x33b877);logger[_0x033c('0x13')]('AddTags',_0x33b877,JSON['stringify'](_0x3fabc1));_0x108e82(_0x3fabc1);})[_0x033c('0x19')](function(_0x52bed7){logger[_0x033c('0x17')](_0x033c('0x28'),_0x52bed7[_0x033c('0x18')],_0x33b877);_0x375160(_this[_0x033c('0x17')](0x1f4,_0x52bed7['message']));});});}; \ No newline at end of file +var _0xea0e=['message','SmsInteraction,\x20%s,\x20%s','options','raw','where','attributes','limit','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','SmsInteraction','find','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1362cd,_0x41d949){var _0x143f10=function(_0x2338e9){while(--_0x2338e9){_0x1362cd['push'](_0x1362cd['shift']());}};_0x143f10(++_0x41d949);}(_0xea0e,0x1c8));var _0xeea0=function(_0x19ca53,_0x20e6c4){_0x19ca53=_0x19ca53-0x0;var _0x19b397=_0xea0e[_0x19ca53];return _0x19b397;};'use strict';var _=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var moment=require(_0xeea0('0x2'));var BPromise=require(_0xeea0('0x3'));var rs=require(_0xeea0('0x4'));var fs=require('fs');var Redis=require(_0xeea0('0x5'));var db=require(_0xeea0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeea0('0x7'))(_0xeea0('0x8'));var config=require(_0xeea0('0x9'));var jayson=require(_0xeea0('0xa'));var client=jayson['client'][_0xeea0('0xb')]({'port':0x232a});config[_0xeea0('0xc')]=_['defaults'](config['redis'],{'host':_0xeea0('0xd'),'port':0x18eb});var socket=require(_0xeea0('0xe'))(new Redis(config[_0xeea0('0xc')]));require('./smsInteraction.socket')[_0xeea0('0xf')](socket);function respondWithRpcPromise(_0x142c5f,_0x53036a,_0x25e659){return new BPromise(function(_0x300257,_0x5a0446){return client[_0xeea0('0x10')](_0x142c5f,_0x25e659)[_0xeea0('0x11')](function(_0x38310b){logger[_0xeea0('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x53036a,_0xeea0('0x13'));logger['debug'](_0xeea0('0x14'),_0x53036a,_0xeea0('0x13'),JSON[_0xeea0('0x15')](_0x38310b));if(_0x38310b[_0xeea0('0x16')]){if(_0x38310b[_0xeea0('0x16')][_0xeea0('0x17')]===0x1f4){logger[_0xeea0('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x53036a,_0x38310b[_0xeea0('0x16')]['message']);return _0x5a0446(_0x38310b[_0xeea0('0x16')][_0xeea0('0x18')]);}logger[_0xeea0('0x16')](_0xeea0('0x19'),_0x53036a,_0x38310b[_0xeea0('0x16')]['message']);return _0x300257(_0x38310b['error'][_0xeea0('0x18')]);}else{logger['info'](_0xeea0('0x19'),_0x53036a,_0xeea0('0x13'));_0x300257(_0x38310b['result'][_0xeea0('0x18')]);}})['catch'](function(_0x2bb483){logger[_0xeea0('0x16')](_0xeea0('0x19'),_0x53036a,_0x2bb483);_0x5a0446(_0x2bb483);});});}exports['UpdateSmsInteraction']=function(_0x42165c){var _0x485020=this;return new Promise(function(_0x1222c7,_0xc15887){return db['SmsInteraction']['update'](_0x42165c['body'],{'raw':_0x42165c['options']?_0x42165c[_0xeea0('0x1a')][_0xeea0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42165c[_0xeea0('0x1a')]?_0x42165c[_0xeea0('0x1a')][_0xeea0('0x1c')]||null:null,'attributes':_0x42165c[_0xeea0('0x1a')]?_0x42165c[_0xeea0('0x1a')][_0xeea0('0x1d')]||null:null,'limit':_0x42165c['options']?_0x42165c[_0xeea0('0x1a')][_0xeea0('0x1e')]||null:null})['then'](function(_0x5ab279){logger['info'](_0xeea0('0x1f'),_0x42165c);logger['debug']('UpdateSmsInteraction',_0x42165c,JSON[_0xeea0('0x15')](_0x5ab279));_0x1222c7(_0x5ab279);})[_0xeea0('0x20')](function(_0x270052){logger['error'](_0xeea0('0x1f'),_0x270052[_0xeea0('0x18')],_0x42165c);_0xc15887(_0x485020[_0xeea0('0x16')](0x1f4,_0x270052[_0xeea0('0x18')]));});});};exports[_0xeea0('0x21')]=function(_0x23852a){return new Promise(function(_0x3debe2,_0xb78a00){return db[_0xeea0('0x22')][_0xeea0('0x23')]({'where':_0x23852a[_0xeea0('0x1a')]?_0x23852a[_0xeea0('0x1a')][_0xeea0('0x1c')]||null:null})['then'](function(_0x133317){if(_0x133317){return _0x133317['addTags'](_0x23852a[_0xeea0('0x24')][_0xeea0('0x25')],_[_0xeea0('0x26')](_0x23852a[_0xeea0('0x24')],[_0xeea0('0x25'),'id'])||{});}})['spread'](function(_0x221a1a){logger[_0xeea0('0x12')](_0xeea0('0x27'),_0x23852a);logger['debug'](_0xeea0('0x27'),_0x23852a,JSON[_0xeea0('0x15')](_0x221a1a));_0x3debe2(_0x221a1a);})[_0xeea0('0x20')](function(_0x5194ce){logger['error'](_0xeea0('0x27'),_0x5194ce[_0xeea0('0x18')],_0x23852a);_0xb78a00(_this[_0xeea0('0x16')](0x1f4,_0x5194ce['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index bc4be62..a3bc7f6 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 _0xd476=['update','emit','register','length','smsInteraction:','save','remove'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xd476,0x83));var _0x6d47=function(_0x2a61ac,_0x57a539){_0x2a61ac=_0x2a61ac-0x0;var _0x1e8b62=_0xd476[_0x2a61ac];return _0x1e8b62;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x6d47('0x0'),_0x6d47('0x1'),_0x6d47('0x2')];function createListener(_0x4b22c7,_0x177567){return function(_0x1587ea){_0x177567[_0x6d47('0x3')](_0x4b22c7,_0x1587ea);};}function removeListener(_0x4dbc8e,_0x2e18d4){return function(){SmsInteractionEvents['removeListener'](_0x4dbc8e,_0x2e18d4);};}exports[_0x6d47('0x4')]=function(_0x458f1a){for(var _0x79f09b=0x0,_0x102794=events[_0x6d47('0x5')];_0x79f09b<_0x102794;_0x79f09b++){var _0x5a6c9d=events[_0x79f09b];var _0x10acce=createListener(_0x6d47('0x6')+_0x5a6c9d,_0x458f1a);SmsInteractionEvents['on'](_0x5a6c9d,_0x10acce);}}; \ No newline at end of file +var _0x7db5=['./smsInteraction.events','save','update','emit','register','length','smsInteraction:'];(function(_0x58ed81,_0x2e5247){var _0x230669=function(_0x33e4fc){while(--_0x33e4fc){_0x58ed81['push'](_0x58ed81['shift']());}};_0x230669(++_0x2e5247);}(_0x7db5,0x19d));var _0x57db=function(_0x4b21cc,_0x2502f1){_0x4b21cc=_0x4b21cc-0x0;var _0xf2c394=_0x7db5[_0x4b21cc];return _0xf2c394;};'use strict';var SmsInteractionEvents=require(_0x57db('0x0'));var events=[_0x57db('0x1'),'remove',_0x57db('0x2')];function createListener(_0x4ffa73,_0x30a433){return function(_0x55c89c){_0x30a433[_0x57db('0x3')](_0x4ffa73,_0x55c89c);};}function removeListener(_0x5a274f,_0x412c05){return function(){SmsInteractionEvents['removeListener'](_0x5a274f,_0x412c05);};}exports[_0x57db('0x4')]=function(_0x1bf796){for(var _0x4571d9=0x0,_0x31a431=events[_0x57db('0x5')];_0x4571d9<_0x31a431;_0x4571d9++){var _0x18b594=events[_0x4571d9];var _0x55461a=createListener(_0x57db('0x6')+_0x18b594,_0x1bf796);SmsInteractionEvents['on'](_0x18b594,_0x55461a);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c34b296..b298679 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 _0x8e7a=['delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','/:id','isAuthenticated','show','tracked','sms','smsmessage:create','create','status','put','update','/:id/accept','/:id/reject','reject'];(function(_0x273dbf,_0x304164){var _0x590ba1=function(_0x5e55a7){while(--_0x5e55a7){_0x273dbf['push'](_0x273dbf['shift']());}};_0x590ba1(++_0x304164);}(_0x8e7a,0x1ac));var _0xa8e7=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x8e7a[_0x802997];return _0x35c641;};'use strict';var multer=require('multer');var util=require(_0xa8e7('0x0'));var path=require(_0xa8e7('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8e7('0x2'));var router=express[_0xa8e7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8e7('0x4'));var config=require(_0xa8e7('0x5'));var controller=require(_0xa8e7('0x6'));router[_0xa8e7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa8e7('0x7')](_0xa8e7('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xa8e7('0x7')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0xb')]);router['post']('/',auth[_0xa8e7('0xa')](),interaction[_0xa8e7('0xc')](_0xa8e7('0xd'),_0xa8e7('0xe')),controller[_0xa8e7('0xf')]);router['post']('/:id/status',controller[_0xa8e7('0x10')]);router[_0xa8e7('0x11')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x12')]);router['put'](_0xa8e7('0x13'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xa8e7('0x14'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x15')]);router[_0xa8e7('0x16')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x17')]);module[_0xa8e7('0x18')]=router; \ No newline at end of file +var _0x0dff=['multer','path','express','Router','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','smsmessage:create','create','/:id/status','status','update','put','/:id/accept','/:id/reject','reject','destroy','exports'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x0dff,0x168));var _0xf0df=function(_0x4dc681,_0x188637){_0x4dc681=_0x4dc681-0x0;var _0x3e58c1=_0x0dff[_0x4dc681];return _0x3e58c1;};'use strict';var multer=require(_0xf0df('0x0'));var util=require('util');var path=require(_0xf0df('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0df('0x2'));var router=express[_0xf0df('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf0df('0x4'));var config=require('../../config/environment');var controller=require(_0xf0df('0x5'));router[_0xf0df('0x6')]('/',auth[_0xf0df('0x7')](),controller['index']);router[_0xf0df('0x6')](_0xf0df('0x8'),auth[_0xf0df('0x7')](),controller[_0xf0df('0x9')]);router['get'](_0xf0df('0xa'),auth[_0xf0df('0x7')](),controller[_0xf0df('0xb')]);router[_0xf0df('0xc')]('/',auth[_0xf0df('0x7')](),interaction['tracked']('sms',_0xf0df('0xd')),controller[_0xf0df('0xe')]);router[_0xf0df('0xc')](_0xf0df('0xf'),controller[_0xf0df('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf0df('0x11')]);router[_0xf0df('0x12')](_0xf0df('0x13'),auth[_0xf0df('0x7')](),controller['accept']);router[_0xf0df('0x12')](_0xf0df('0x14'),auth[_0xf0df('0x7')](),controller[_0xf0df('0x15')]);router['delete'](_0xf0df('0xa'),auth[_0xf0df('0x7')](),controller[_0xf0df('0x16')]);module[_0xf0df('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 62d23e5..5ab954b 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 _0x0c7a=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x0c7a,0xef));var _0xa0c7=function(_0x536baa,_0x5c5c2b){_0x536baa=_0x536baa-0x0;var _0x579374=_0x0c7a[_0x536baa];return _0x579374;};'use strict';var Sequelize=require(_0xa0c7('0x0'));module[_0xa0c7('0x1')]={'body':{'type':Sequelize[_0xa0c7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa0c7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa0c7('0x4')]('in','out'),'defaultValue':_0xa0c7('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa0c7('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa0c7('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa0c7('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe9e7=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x42dbb9,_0x197281){var _0x599b5b=function(_0x2b38e2){while(--_0x2b38e2){_0x42dbb9['push'](_0x42dbb9['shift']());}};_0x599b5b(++_0x197281);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x252b16,_0x560858){_0x252b16=_0x252b16-0x0;var _0x275bbb=_0xe9e7[_0x252b16];return _0x275bbb;};'use strict';var Sequelize=require(_0x7e9e('0x0'));module[_0x7e9e('0x1')]={'body':{'type':Sequelize[_0x7e9e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7e9e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7e9e('0x4')]('in',_0x7e9e('0x5')),'defaultValue':_0x7e9e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7e9e('0x6')](0xbe)},'phone':{'type':Sequelize[_0x7e9e('0x6')]},'readAt':{'type':Sequelize[_0x7e9e('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7e9e('0x6')]},'providerResponse':{'type':Sequelize[_0x7e9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3a2847e..6688b4e 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 _0xdc15=['isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','SELECT','User','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','sent','Status','plivio','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xdc15[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require(_0x5dc1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5dc1('0x1'));var jsonpatch=require(_0x5dc1('0x2'));var rp=require(_0x5dc1('0x3'));var moment=require(_0x5dc1('0x4'));var BPromise=require(_0x5dc1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5dc1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5dc1('0x7'));var _=require(_0x5dc1('0x8'));var squel=require(_0x5dc1('0x9'));var crypto=require(_0x5dc1('0xa'));var jsforce=require(_0x5dc1('0xb'));var deskjs=require(_0x5dc1('0xc'));var toCsv=require(_0x5dc1('0xd'));var querystring=require(_0x5dc1('0xe'));var Papa=require(_0x5dc1('0xf'));var Redis=require(_0x5dc1('0x10'));var authService=require(_0x5dc1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5dc1('0x12'));var logger=require(_0x5dc1('0x13'))('api');var utils=require(_0x5dc1('0x14'));var config=require(_0x5dc1('0x15'));var licenseUtil=require(_0x5dc1('0x16'));var db=require(_0x5dc1('0x17'))['db'];config[_0x5dc1('0x18')]=_[_0x5dc1('0x19')](config[_0x5dc1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc1('0x1a'))(new Redis(config[_0x5dc1('0x18')]));require('./smsMessage.socket')[_0x5dc1('0x1b')](socket);var jayson=require(_0x5dc1('0x1c'));var client=jayson['client'][_0x5dc1('0x1d')]({'port':0x232c});var client9002=jayson[_0x5dc1('0x1e')][_0x5dc1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x588327,_0x1424ee,_0x4a8652,_0x5b6518){return new BPromise(function(_0x17506b,_0x708888){var _0x1f2e4a=_0x5b6518||client;return _0x1f2e4a['request'](_0x588327,_0x4a8652)[_0x5dc1('0x1f')](function(_0xf980e7){logger[_0x5dc1('0x20')](_0x5dc1('0x21'),_0x1424ee,_0x5dc1('0x22'));logger[_0x5dc1('0x23')](_0x5dc1('0x24'),_0x1424ee,_0x5dc1('0x22'),JSON['stringify'](_0xf980e7));if(_0xf980e7[_0x5dc1('0x25')]){if(_0xf980e7[_0x5dc1('0x25')][_0x5dc1('0x26')]===0x1f4){logger[_0x5dc1('0x25')](_0x5dc1('0x21'),_0x1424ee,_0xf980e7[_0x5dc1('0x25')]['message']);return _0x708888(_0xf980e7[_0x5dc1('0x25')][_0x5dc1('0x27')]);}logger[_0x5dc1('0x25')](_0x5dc1('0x21'),_0x1424ee,_0xf980e7[_0x5dc1('0x25')][_0x5dc1('0x27')]);return _0x17506b(_0xf980e7[_0x5dc1('0x25')][_0x5dc1('0x27')]);}else{logger[_0x5dc1('0x20')](_0x5dc1('0x21'),_0x1424ee,_0x5dc1('0x22'));_0x17506b(_0xf980e7[_0x5dc1('0x28')][_0x5dc1('0x27')]);}})['catch'](function(_0x1a21f2){logger[_0x5dc1('0x25')]('SmsMessage,\x20%s,\x20%s',_0x1424ee,_0x1a21f2);_0x708888(_0x1a21f2);});});}function respondWithStatusCode(_0x4562a5,_0x435d99){_0x435d99=_0x435d99||0xcc;return function(_0x2bf06b){if(_0x2bf06b){return _0x4562a5[_0x5dc1('0x29')](_0x435d99);}return _0x4562a5[_0x5dc1('0x2a')](_0x435d99)[_0x5dc1('0x2b')]();};}function respondWithResult(_0x1b2063,_0x2a13f9){_0x2a13f9=_0x2a13f9||0xc8;return function(_0x272201){if(_0x272201){return _0x1b2063[_0x5dc1('0x2a')](_0x2a13f9)[_0x5dc1('0x2c')](_0x272201);}};}function respondWithFilteredResult(_0xddba38,_0x1d7677){return function(_0xe70dec){if(_0xe70dec){var _0x2fb55e=typeof _0x1d7677[_0x5dc1('0x2d')]===_0x5dc1('0x2e')&&typeof _0x1d7677[_0x5dc1('0x2f')]===_0x5dc1('0x2e');var _0x4eadf1=_0xe70dec[_0x5dc1('0x30')];var _0x3ab569=_0x2fb55e?0x0:_0x1d7677[_0x5dc1('0x2d')];var _0x1dfe74=_0x2fb55e?_0xe70dec[_0x5dc1('0x30')]:_0x1d7677['offset']+_0x1d7677[_0x5dc1('0x2f')];var _0x571018;if(_0x1dfe74>=_0x4eadf1){_0x1dfe74=_0x4eadf1;_0x571018=0xc8;}else{_0x571018=0xce;}_0xddba38['status'](_0x571018);return _0xddba38[_0x5dc1('0x31')](_0x5dc1('0x32'),_0x3ab569+'-'+_0x1dfe74+'/'+_0x4eadf1)[_0x5dc1('0x2c')](_0xe70dec);}return null;};}function patchUpdates(_0x2ec6fe){return function(_0x14e3fa){try{jsonpatch['apply'](_0x14e3fa,_0x2ec6fe,!![]);}catch(_0x3bdf1b){return BPromise[_0x5dc1('0x33')](_0x3bdf1b);}return _0x14e3fa[_0x5dc1('0x34')]();};}function saveUpdates(_0x105511,_0x4fde1a){return function(_0x9b166c){if(_0x9b166c){return _0x9b166c['update'](_0x105511)[_0x5dc1('0x1f')](function(_0x1aab81){return _0x1aab81;});}return null;};}function removeEntity(_0x2c48,_0x38f2b6){return function(_0x1716e4){if(_0x1716e4){return _0x1716e4[_0x5dc1('0x35')]()[_0x5dc1('0x1f')](function(){_0x2c48[_0x5dc1('0x2a')](0xcc)[_0x5dc1('0x2b')]();});}};}function handleEntityNotFound(_0x3a4178,_0x1f1119){return function(_0x398f33){if(!_0x398f33){_0x3a4178['sendStatus'](0x194);}return _0x398f33;};}function handleError(_0x2e74d9,_0x7d5bed){_0x7d5bed=_0x7d5bed||0x1f4;return function(_0x13fa8e){logger[_0x5dc1('0x25')](_0x13fa8e['stack']);if(_0x13fa8e[_0x5dc1('0x36')]){delete _0x13fa8e[_0x5dc1('0x36')];}_0x2e74d9[_0x5dc1('0x2a')](_0x7d5bed)[_0x5dc1('0x37')](_0x13fa8e);};}exports[_0x5dc1('0x38')]=function(_0x1a18d3,_0x195926){var _0x822c2e={},_0x2049ce={},_0x3caa92={'count':0x0,'rows':[]};var _0x43f78c=_[_0x5dc1('0x39')](db[_0x5dc1('0x3a')][_0x5dc1('0x3b')],function(_0x56bf14){return{'name':_0x56bf14[_0x5dc1('0x3c')],'type':_0x56bf14[_0x5dc1('0x3d')][_0x5dc1('0x3e')]};});_0x2049ce[_0x5dc1('0x3f')]=_[_0x5dc1('0x39')](_0x43f78c,_0x5dc1('0x36'));_0x2049ce[_0x5dc1('0x40')]=_[_0x5dc1('0x41')](_0x1a18d3['query']);_0x2049ce[_0x5dc1('0x42')]=_[_0x5dc1('0x43')](_0x2049ce[_0x5dc1('0x3f')],_0x2049ce[_0x5dc1('0x40')]);_0x822c2e[_0x5dc1('0x44')]=_['intersection'](_0x2049ce[_0x5dc1('0x3f')],qs[_0x5dc1('0x45')](_0x1a18d3[_0x5dc1('0x40')][_0x5dc1('0x45')]));_0x822c2e[_0x5dc1('0x44')]=_0x822c2e[_0x5dc1('0x44')][_0x5dc1('0x46')]?_0x822c2e['attributes']:_0x2049ce[_0x5dc1('0x3f')];if(!_0x1a18d3['query'][_0x5dc1('0x47')](_0x5dc1('0x48'))){_0x822c2e[_0x5dc1('0x2f')]=qs[_0x5dc1('0x2f')](_0x1a18d3['query']['limit']);_0x822c2e[_0x5dc1('0x2d')]=qs[_0x5dc1('0x2d')](_0x1a18d3[_0x5dc1('0x40')][_0x5dc1('0x2d')]);}_0x822c2e[_0x5dc1('0x49')]=qs[_0x5dc1('0x4a')](_0x1a18d3['query'][_0x5dc1('0x4a')]);_0x822c2e[_0x5dc1('0x4b')]=qs['filters'](_[_0x5dc1('0x4c')](_0x1a18d3[_0x5dc1('0x40')],_0x2049ce[_0x5dc1('0x42')]),_0x43f78c);if(_0x1a18d3[_0x5dc1('0x40')]['filter']){_0x822c2e[_0x5dc1('0x4b')]=_[_0x5dc1('0x4d')](_0x822c2e[_0x5dc1('0x4b')],{'$or':_[_0x5dc1('0x39')](_0x43f78c,function(_0x44792e){if(_0x44792e[_0x5dc1('0x3d')]!==_0x5dc1('0x4e')){var _0x14002c={};_0x14002c[_0x44792e['name']]={'$like':'%'+_0x1a18d3[_0x5dc1('0x40')][_0x5dc1('0x4f')]+'%'};return _0x14002c;}})});}_0x822c2e=_['merge']({},_0x822c2e,_0x1a18d3['options']);var _0x1d2d9d={'where':_0x822c2e[_0x5dc1('0x4b')]};return db['SmsMessage'][_0x5dc1('0x30')](_0x1d2d9d)['then'](function(_0x319a5b){_0x3caa92['count']=_0x319a5b;if(_0x1a18d3[_0x5dc1('0x40')]['includeAll']){_0x822c2e[_0x5dc1('0x50')]=[{'all':!![]}];}return db[_0x5dc1('0x3a')][_0x5dc1('0x51')](_0x822c2e);})[_0x5dc1('0x1f')](function(_0x3aa4c3){_0x3caa92[_0x5dc1('0x52')]=_0x3aa4c3;return _0x3caa92;})['then'](respondWithFilteredResult(_0x195926,_0x822c2e))[_0x5dc1('0x53')](handleError(_0x195926,null));};exports[_0x5dc1('0x54')]=function(_0x4e03bc,_0x3e9d9f){var _0x3b51c8={'raw':!![],'where':{'id':_0x4e03bc['params']['id']}},_0x5e5f06={};_0x5e5f06[_0x5dc1('0x3f')]=_['keys'](db[_0x5dc1('0x3a')][_0x5dc1('0x3b')]);_0x5e5f06[_0x5dc1('0x40')]=_[_0x5dc1('0x41')](_0x4e03bc[_0x5dc1('0x40')]);_0x5e5f06[_0x5dc1('0x42')]=_[_0x5dc1('0x43')](_0x5e5f06[_0x5dc1('0x3f')],_0x5e5f06['query']);_0x3b51c8['attributes']=_[_0x5dc1('0x43')](_0x5e5f06[_0x5dc1('0x3f')],qs[_0x5dc1('0x45')](_0x4e03bc['query'][_0x5dc1('0x45')]));_0x3b51c8['attributes']=_0x3b51c8[_0x5dc1('0x44')][_0x5dc1('0x46')]?_0x3b51c8[_0x5dc1('0x44')]:_0x5e5f06[_0x5dc1('0x3f')];if(_0x4e03bc['query'][_0x5dc1('0x55')]){_0x3b51c8['include']=[{'all':!![]}];}_0x3b51c8=_[_0x5dc1('0x4d')]({},_0x3b51c8,_0x4e03bc[_0x5dc1('0x56')]);return db['SmsMessage'][_0x5dc1('0x57')](_0x3b51c8)[_0x5dc1('0x1f')](handleEntityNotFound(_0x3e9d9f,null))[_0x5dc1('0x1f')](respondWithResult(_0x3e9d9f,null))['catch'](handleError(_0x3e9d9f,null));};exports['create']=function(_0x5af3cc,_0x4c9115){return db[_0x5dc1('0x3a')][_0x5dc1('0x58')](_0x5af3cc[_0x5dc1('0x59')],{})['then'](respondWithResult(_0x4c9115,0xc9))[_0x5dc1('0x53')](handleError(_0x4c9115,null));};exports[_0x5dc1('0x5a')]=function(_0x4b5286,_0x10477a){if(_0x4b5286[_0x5dc1('0x59')]['id']){delete _0x4b5286[_0x5dc1('0x59')]['id'];}return db[_0x5dc1('0x3a')]['find']({'where':{'id':_0x4b5286[_0x5dc1('0x5b')]['id']}})[_0x5dc1('0x1f')](handleEntityNotFound(_0x10477a,null))[_0x5dc1('0x1f')](saveUpdates(_0x4b5286[_0x5dc1('0x59')],null))['then'](respondWithResult(_0x10477a,null))['catch'](handleError(_0x10477a,null));};exports['destroy']=function(_0x5e6c74,_0x1a2669){return db[_0x5dc1('0x3a')]['find']({'where':{'id':_0x5e6c74['params']['id']}})[_0x5dc1('0x1f')](handleEntityNotFound(_0x1a2669,null))['then'](removeEntity(_0x1a2669,null))[_0x5dc1('0x53')](handleError(_0x1a2669,null));};exports[_0x5dc1('0x5c')]=function(_0x510205,_0x2c062b){return db[_0x5dc1('0x3a')][_0x5dc1('0x5c')]()[_0x5dc1('0x1f')](respondWithResult(_0x2c062b,null))[_0x5dc1('0x53')](handleError(_0x2c062b,null));};var interaction_log=require(_0x5dc1('0x13'))(_0x5dc1('0x5d'));exports[_0x5dc1('0x5e')]=function(_0x1109e7,_0x4be135,_0x234251){var _0x552cf6={'agent':{},'channel':_0x5dc1('0x5f')};if(_0x1109e7[_0x5dc1('0x59')]['id']){delete _0x1109e7[_0x5dc1('0x59')]['id'];}_0x1109e7['body'][_0x5dc1('0x60')]=!![];_0x1109e7[_0x5dc1('0x59')][_0x5dc1('0x61')]=moment()[_0x5dc1('0x62')](_0x5dc1('0x63'));_0x1109e7[_0x5dc1('0x59')][_0x5dc1('0x64')]=_0x1109e7['body']['UserId']||_0x1109e7[_0x5dc1('0x65')]['id'];_0x552cf6[_0x5dc1('0x66')]['id']=_0x1109e7['body'][_0x5dc1('0x64')];return db[_0x5dc1('0x3a')][_0x5dc1('0x57')]({'where':{'id':_0x1109e7['params']['id'],'UserId':null}})[_0x5dc1('0x1f')](handleEntityNotFound(_0x4be135,null))[_0x5dc1('0x1f')](saveUpdates(_0x1109e7['body'],null))['then'](function(_0x120049){if(_0x120049){_0x552cf6['message']=_0x120049[_0x5dc1('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x5dc1('0x57')]({'where':{'id':_0x120049[_0x5dc1('0x68')]}});}return null;})[_0x5dc1('0x1f')](handleEntityNotFound(_0x4be135,null))[_0x5dc1('0x1f')](function(_0x1252e9){if(_0x1252e9){return _0x1252e9['update']({'UserId':_0x1109e7[_0x5dc1('0x59')][_0x5dc1('0x64')],'read1stAt':_[_0x5dc1('0x69')](_0x1252e9[_0x5dc1('0x6a')])?moment()[_0x5dc1('0x62')](_0x5dc1('0x63')):undefined});}return null;})['then'](function(_0x10a0ce){if(_0x10a0ce){_0x552cf6[_0x5dc1('0x6b')]=_0x10a0ce['get']({'plain':!![]});interaction_log['info'](_0x5dc1('0x6c'),_0x1109e7[_0x5dc1('0x65')]['id'],_0x1109e7[_0x5dc1('0x65')][_0x5dc1('0x36')],_0x1109e7[_0x5dc1('0x65')][_0x5dc1('0x6d')],_0x552cf6[_0x5dc1('0x6b')]['id'],_0x1109e7['body']?JSON['stringify'](_0x1109e7[_0x5dc1('0x59')]):_0x5dc1('0x6e'));return respondWithRpcPromise(_0x5dc1('0x6f'),_0x5dc1('0x70'),_0x552cf6);}return null;})[_0x5dc1('0x1f')](function(_0xdeb228){var _0x54554f=_0x5dc1('0x71')+_0xdeb228[_0x5dc1('0x27')][_0x5dc1('0x72')];return db[_0x5dc1('0x73')]['query'](_0x54554f,{'type':db[_0x5dc1('0x74')][_0x5dc1('0x75')]['SELECT'],'raw':!![]})[_0x5dc1('0x1f')](function(_0x3c9dbc){return _0x3c9dbc;});})['then'](function(_0x4397ed){if(_0x4397ed){_0x552cf6[_0x5dc1('0x27')][_0x5dc1('0x76')]=_0x4397ed[0x0];if(!_0x1109e7[_0x5dc1('0x59')]['UserId'])return;return db['User']['find']({'where':{'id':_0x1109e7[_0x5dc1('0x59')][_0x5dc1('0x64')],'role':_0x5dc1('0x66')},'attributes':['id',_0x5dc1('0x36'),_0x5dc1('0x77'),_0x5dc1('0x78'),_0x5dc1('0x79')],'raw':!![]});}return null;})[_0x5dc1('0x1f')](function(_0x2b49c0){if(!_0x2b49c0)return null;_0x552cf6[_0x5dc1('0x27')]['agent']=_0x2b49c0;return _0x552cf6;})['then'](function(_0x1e3b21){if(_0x1e3b21){if(_0x1109e7[_0x5dc1('0x59')][_0x5dc1('0x7a')]){_0x552cf6[_0x5dc1('0x27')]['interface']=util[_0x5dc1('0x62')](_0x5dc1('0x7b'),_0x1109e7[_0x5dc1('0x65')][_0x5dc1('0x36')]);_0x552cf6[_0x5dc1('0x27')][_0x5dc1('0x7c')]=_0x552cf6[_0x5dc1('0x7c')];_0x552cf6[_0x5dc1('0x27')][_0x5dc1('0x7d')]=_0x552cf6[_0x5dc1('0x7c')];_0x552cf6[_0x5dc1('0x27')][_0x5dc1('0x7e')]=_0x5dc1('0x5e');return respondWithRpcPromise(_0x5dc1('0x7f'),_0x5dc1('0x7f'),{'event':'acceptmessage','message':_0x552cf6[_0x5dc1('0x27')]},client9002)[_0x5dc1('0x1f')](function(){return _0x552cf6;});}return _0x552cf6;}return null;})['then'](respondWithResult(_0x4be135,null))[_0x5dc1('0x53')](handleError(_0x4be135,null));};var interaction_log=require(_0x5dc1('0x13'))(_0x5dc1('0x5d'));exports['reject']=function(_0x38ebe7,_0x5abb60,_0x3c64a8){var _0x523423={'agent':{},'channel':_0x5dc1('0x5f')};if(_0x38ebe7[_0x5dc1('0x59')]['id']){delete _0x38ebe7['body']['id'];}_0x38ebe7[_0x5dc1('0x59')][_0x5dc1('0x64')]=_0x38ebe7[_0x5dc1('0x59')][_0x5dc1('0x64')]||_0x38ebe7[_0x5dc1('0x65')]['id'];_0x523423[_0x5dc1('0x66')]['id']=_0x38ebe7[_0x5dc1('0x59')][_0x5dc1('0x64')];return db[_0x5dc1('0x3a')]['find']({'where':{'id':_0x38ebe7[_0x5dc1('0x5b')]['id'],'UserId':null}})[_0x5dc1('0x1f')](handleEntityNotFound(_0x5abb60,null))['then'](function(_0x117201){if(_0x117201){_0x523423[_0x5dc1('0x27')]=_0x117201['get']({'plain':!![]});return db['SmsInteraction'][_0x5dc1('0x57')]({'where':{'id':_0x117201[_0x5dc1('0x68')]}});}return null;})[_0x5dc1('0x1f')](handleEntityNotFound(_0x5abb60,null))[_0x5dc1('0x1f')](function(_0x4d8478){if(_0x4d8478){_0x523423[_0x5dc1('0x6b')]=_0x4d8478[_0x5dc1('0x67')]({'plain':!![]});interaction_log[_0x5dc1('0x20')](_0x5dc1('0x80'),_0x38ebe7[_0x5dc1('0x65')]['id'],_0x38ebe7['user'][_0x5dc1('0x36')],_0x38ebe7[_0x5dc1('0x65')]['role'],_0x523423[_0x5dc1('0x6b')]['id'],_0x38ebe7[_0x5dc1('0x59')]?JSON[_0x5dc1('0x81')](_0x38ebe7[_0x5dc1('0x59')]):_0x5dc1('0x6e'));return respondWithRpcPromise(_0x5dc1('0x82'),'rejectMessage',_0x523423);}return null;})[_0x5dc1('0x1f')](function(_0x530c15){var _0x1e7e16='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x530c15[_0x5dc1('0x27')]['ContactId'];return db['sequelize'][_0x5dc1('0x40')](_0x1e7e16,{'type':db[_0x5dc1('0x74')][_0x5dc1('0x75')][_0x5dc1('0x83')],'raw':!![]})[_0x5dc1('0x1f')](function(_0x30972c){return _0x30972c;});})[_0x5dc1('0x1f')](function(_0x20cd8c){if(_0x20cd8c){_0x523423[_0x5dc1('0x27')]['contact']=_0x20cd8c[0x0];if(!_0x38ebe7[_0x5dc1('0x59')][_0x5dc1('0x64')])return;return db[_0x5dc1('0x84')][_0x5dc1('0x57')]({'where':{'id':_0x38ebe7['body'][_0x5dc1('0x64')],'role':_0x5dc1('0x66')},'attributes':['id',_0x5dc1('0x36'),'fullname',_0x5dc1('0x78'),_0x5dc1('0x79')],'raw':!![]});}return null;})['then'](function(_0x445e8b){if(!_0x445e8b)return null;_0x523423[_0x5dc1('0x27')][_0x5dc1('0x66')]=_0x445e8b;return _0x523423;})[_0x5dc1('0x1f')](function(_0x5be41c){if(_0x5be41c){_0x5be41c[_0x5dc1('0x27')][_0x5dc1('0x85')]=util[_0x5dc1('0x62')]('SIP/%s',_0x38ebe7['user'][_0x5dc1('0x36')]);_0x5be41c[_0x5dc1('0x27')][_0x5dc1('0x7c')]=_0x523423['channel'];_0x5be41c['message'][_0x5dc1('0x7d')]=_0x523423['channel'];_0x5be41c['message']['event']='reject';respondWithRpcPromise(_0x5dc1('0x7f'),_0x5dc1('0x7f'),{'event':_0x5dc1('0x86'),'message':_0x5be41c[_0x5dc1('0x27')]},client9002);return _0x523423;}return null;})[_0x5dc1('0x1f')](respondWithResult(_0x5abb60,null))[_0x5dc1('0x53')](handleError(_0x5abb60,null));};exports[_0x5dc1('0x2a')]=function(_0x1a5322,_0x58fd34,_0x440f72){if(_0x1a5322[_0x5dc1('0x59')]['id']){delete _0x1a5322['body']['id'];}var _0x325419;return db[_0x5dc1('0x3a')]['find']({'where':{'id':_0x1a5322[_0x5dc1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x58fd34,null))['then'](function(_0x2330fe){if(_0x2330fe){_0x325419=_0x2330fe;return db[_0x5dc1('0x87')][_0x5dc1('0x57')]({'where':{'id':_0x2330fe[_0x5dc1('0x88')]}});}})[_0x5dc1('0x1f')](handleEntityNotFound(_0x58fd34,null))[_0x5dc1('0x1f')](function(_0x2447e2){if(_0x2447e2){logger[_0x5dc1('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5dc1('0x2a'),_0x5dc1('0x89'),_0x2447e2['type'],util[_0x5dc1('0x8a')](_0x1a5322[_0x5dc1('0x59')],{'showHidden':![],'depth':null}));switch(_0x2447e2['type']){case _0x5dc1('0x8b'):if(_0x1a5322['body']['MessageSid']&&_0x1a5322[_0x5dc1('0x59')][_0x5dc1('0x8c')]===_0x325419['messageId']){return _0x325419[_0x5dc1('0x5a')]({'read':!![]});}else{logger[_0x5dc1('0x25')](_0x5dc1('0x8d'),_0x5dc1('0x2a'),'twilio',util['inspect'](_0x1a5322[_0x5dc1('0x59')],{'showHidden':![],'depth':null}));}break;case _0x5dc1('0x8e'):if(_0x1a5322[_0x5dc1('0x59')][_0x5dc1('0x8f')]&&_0x1a5322[_0x5dc1('0x59')][_0x5dc1('0x8f')]===_0x325419[_0x5dc1('0x90')]&&_['indexOf']([_0x5dc1('0x91'),'delivered'],_0x1a5322[_0x5dc1('0x59')][_0x5dc1('0x92')])>=0x0){return _0x325419[_0x5dc1('0x5a')]({'read':!![]});}else{logger['error'](_0x5dc1('0x8d'),'status',_0x5dc1('0x93'),util['inspect'](_0x1a5322[_0x5dc1('0x59')],{'showHidden':![],'depth':null}));}break;case _0x5dc1('0x94'):var _0x1714f3=_0x1a5322[_0x5dc1('0x59')]['results'][0x0];if(_0x1714f3[_0x5dc1('0x2a')][_0x5dc1('0x95')]===_0x5dc1('0x96')){return _0x325419['update']({'read':!![]});}else{logger[_0x5dc1('0x25')](_0x5dc1('0x8d'),_0x5dc1('0x2a'),_0x5dc1('0x94'),util[_0x5dc1('0x8a')](_0x1a5322['body'],{'showHidden':![],'depth':null}));}break;}return _0x325419;}})[_0x5dc1('0x1f')](respondWithResult(_0x58fd34,null))[_0x5dc1('0x53')](handleError(_0x58fd34,null));}; \ No newline at end of file +var _0xf03a=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','SmsMessage','include','options','find','body','update','destroy','describe','sms-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','sms','get','role','RejectMessage','rejectMessage','ContactId','event','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','http','client','request','then','request\x20sent'];(function(_0xb212a7,_0x4143af){var _0x48ed49=function(_0x2344d7){while(--_0x2344d7){_0xb212a7['push'](_0xb212a7['shift']());}};_0x48ed49(++_0x4143af);}(_0xf03a,0x1a0));var _0xaf03=function(_0x4cc291,_0x4ca61f){_0x4cc291=_0x4cc291-0x0;var _0x37772f=_0xf03a[_0x4cc291];return _0x37772f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf03('0x0'));var zipdir=require(_0xaf03('0x1'));var jsonpatch=require(_0xaf03('0x2'));var rp=require(_0xaf03('0x3'));var moment=require('moment');var BPromise=require(_0xaf03('0x4'));var Mustache=require(_0xaf03('0x5'));var util=require('util');var path=require(_0xaf03('0x6'));var sox=require(_0xaf03('0x7'));var csv=require(_0xaf03('0x8'));var ejs=require(_0xaf03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf03('0xa'));var squel=require('squel');var crypto=require(_0xaf03('0xb'));var jsforce=require(_0xaf03('0xc'));var deskjs=require(_0xaf03('0xd'));var toCsv=require(_0xaf03('0x8'));var querystring=require(_0xaf03('0xe'));var Papa=require(_0xaf03('0xf'));var Redis=require('ioredis');var authService=require(_0xaf03('0x10'));var qs=require(_0xaf03('0x11'));var as=require(_0xaf03('0x12'));var hardwareService=require(_0xaf03('0x13'));var logger=require(_0xaf03('0x14'))('api');var utils=require(_0xaf03('0x15'));var config=require(_0xaf03('0x16'));var licenseUtil=require(_0xaf03('0x17'));var db=require(_0xaf03('0x18'))['db'];config[_0xaf03('0x19')]=_[_0xaf03('0x1a')](config[_0xaf03('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf03('0x19')]));require(_0xaf03('0x1b'))[_0xaf03('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xaf03('0x1d')]({'port':0x232c});var client9002=jayson[_0xaf03('0x1e')][_0xaf03('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2de266,_0x342f7a,_0x3902d7,_0x533699){return new BPromise(function(_0xcdc24,_0x136ad9){var _0x12bd6=_0x533699||client;return _0x12bd6[_0xaf03('0x1f')](_0x2de266,_0x3902d7)[_0xaf03('0x20')](function(_0x27e625){logger['info']('SmsMessage,\x20%s,\x20%s',_0x342f7a,_0xaf03('0x21'));logger[_0xaf03('0x22')](_0xaf03('0x23'),_0x342f7a,_0xaf03('0x21'),JSON[_0xaf03('0x24')](_0x27e625));if(_0x27e625['error']){if(_0x27e625[_0xaf03('0x25')]['code']===0x1f4){logger[_0xaf03('0x25')](_0xaf03('0x26'),_0x342f7a,_0x27e625[_0xaf03('0x25')][_0xaf03('0x27')]);return _0x136ad9(_0x27e625[_0xaf03('0x25')][_0xaf03('0x27')]);}logger[_0xaf03('0x25')](_0xaf03('0x26'),_0x342f7a,_0x27e625[_0xaf03('0x25')][_0xaf03('0x27')]);return _0xcdc24(_0x27e625[_0xaf03('0x25')]['message']);}else{logger[_0xaf03('0x28')](_0xaf03('0x26'),_0x342f7a,_0xaf03('0x21'));_0xcdc24(_0x27e625[_0xaf03('0x29')]['message']);}})['catch'](function(_0x38aa61){logger[_0xaf03('0x25')]('SmsMessage,\x20%s,\x20%s',_0x342f7a,_0x38aa61);_0x136ad9(_0x38aa61);});});}function respondWithStatusCode(_0x245ad7,_0xec24e2){_0xec24e2=_0xec24e2||0xcc;return function(_0x247b05){if(_0x247b05){return _0x245ad7[_0xaf03('0x2a')](_0xec24e2);}return _0x245ad7[_0xaf03('0x2b')](_0xec24e2)[_0xaf03('0x2c')]();};}function respondWithResult(_0x5bb6a7,_0x50ec36){_0x50ec36=_0x50ec36||0xc8;return function(_0x898120){if(_0x898120){return _0x5bb6a7[_0xaf03('0x2b')](_0x50ec36)[_0xaf03('0x2d')](_0x898120);}};}function respondWithFilteredResult(_0x166a23,_0x416728){return function(_0x3a74b9){if(_0x3a74b9){var _0x2e2d91=typeof _0x416728[_0xaf03('0x2e')]===_0xaf03('0x2f')&&typeof _0x416728[_0xaf03('0x30')]===_0xaf03('0x2f');var _0x1d75f5=_0x3a74b9[_0xaf03('0x31')];var _0x5be2ab=_0x2e2d91?0x0:_0x416728[_0xaf03('0x2e')];var _0x3d505a=_0x2e2d91?_0x3a74b9['count']:_0x416728[_0xaf03('0x2e')]+_0x416728['limit'];var _0xfdaeb8;if(_0x3d505a>=_0x1d75f5){_0x3d505a=_0x1d75f5;_0xfdaeb8=0xc8;}else{_0xfdaeb8=0xce;}_0x166a23[_0xaf03('0x2b')](_0xfdaeb8);return _0x166a23[_0xaf03('0x32')](_0xaf03('0x33'),_0x5be2ab+'-'+_0x3d505a+'/'+_0x1d75f5)[_0xaf03('0x2d')](_0x3a74b9);}return null;};}function patchUpdates(_0x96670e){return function(_0x5a6e1e){try{jsonpatch[_0xaf03('0x34')](_0x5a6e1e,_0x96670e,!![]);}catch(_0x5b6cdb){return BPromise[_0xaf03('0x35')](_0x5b6cdb);}return _0x5a6e1e[_0xaf03('0x36')]();};}function saveUpdates(_0x3eb7f7,_0x1d10bb){return function(_0x4fd942){if(_0x4fd942){return _0x4fd942['update'](_0x3eb7f7)['then'](function(_0x450238){return _0x450238;});}return null;};}function removeEntity(_0xcf44d8,_0x2e6b3b){return function(_0x7a96cd){if(_0x7a96cd){return _0x7a96cd['destroy']()[_0xaf03('0x20')](function(){_0xcf44d8[_0xaf03('0x2b')](0xcc)[_0xaf03('0x2c')]();});}};}function handleEntityNotFound(_0x6b06e6,_0x485102){return function(_0x233f73){if(!_0x233f73){_0x6b06e6['sendStatus'](0x194);}return _0x233f73;};}function handleError(_0x3eae73,_0x35cf63){_0x35cf63=_0x35cf63||0x1f4;return function(_0xd08544){logger[_0xaf03('0x25')](_0xd08544[_0xaf03('0x37')]);if(_0xd08544[_0xaf03('0x38')]){delete _0xd08544[_0xaf03('0x38')];}_0x3eae73[_0xaf03('0x2b')](_0x35cf63)[_0xaf03('0x39')](_0xd08544);};}exports['index']=function(_0x2a72fd,_0x14a32f){var _0x304c3f={},_0x3332cb={},_0xad4de5={'count':0x0,'rows':[]};var _0x4e72e0=_[_0xaf03('0x3a')](db['SmsMessage'][_0xaf03('0x3b')],function(_0x477b31){return{'name':_0x477b31[_0xaf03('0x3c')],'type':_0x477b31[_0xaf03('0x3d')]['key']};});_0x3332cb[_0xaf03('0x3e')]=_[_0xaf03('0x3a')](_0x4e72e0,_0xaf03('0x38'));_0x3332cb[_0xaf03('0x3f')]=_[_0xaf03('0x40')](_0x2a72fd[_0xaf03('0x3f')]);_0x3332cb[_0xaf03('0x41')]=_['intersection'](_0x3332cb['model'],_0x3332cb[_0xaf03('0x3f')]);_0x304c3f['attributes']=_[_0xaf03('0x42')](_0x3332cb[_0xaf03('0x3e')],qs[_0xaf03('0x43')](_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x43')]));_0x304c3f['attributes']=_0x304c3f[_0xaf03('0x44')][_0xaf03('0x45')]?_0x304c3f[_0xaf03('0x44')]:_0x3332cb[_0xaf03('0x3e')];if(!_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x46')](_0xaf03('0x47'))){_0x304c3f[_0xaf03('0x30')]=qs['limit'](_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x30')]);_0x304c3f[_0xaf03('0x2e')]=qs[_0xaf03('0x2e')](_0x2a72fd['query'][_0xaf03('0x2e')]);}_0x304c3f[_0xaf03('0x48')]=qs[_0xaf03('0x49')](_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x49')]);_0x304c3f[_0xaf03('0x4a')]=qs['filters'](_[_0xaf03('0x4b')](_0x2a72fd[_0xaf03('0x3f')],_0x3332cb[_0xaf03('0x41')]),_0x4e72e0);if(_0x2a72fd[_0xaf03('0x3f')]['filter']){_0x304c3f[_0xaf03('0x4a')]=_[_0xaf03('0x4c')](_0x304c3f[_0xaf03('0x4a')],{'$or':_[_0xaf03('0x3a')](_0x4e72e0,function(_0x2ad042){if(_0x2ad042[_0xaf03('0x3d')]!==_0xaf03('0x4d')){var _0x492759={};_0x492759[_0x2ad042[_0xaf03('0x38')]]={'$like':'%'+_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x4e')]+'%'};return _0x492759;}})});}_0x304c3f=_[_0xaf03('0x4c')]({},_0x304c3f,_0x2a72fd['options']);var _0x1559a2={'where':_0x304c3f['where']};return db['SmsMessage'][_0xaf03('0x31')](_0x1559a2)[_0xaf03('0x20')](function(_0x2b0e8a){_0xad4de5['count']=_0x2b0e8a;if(_0x2a72fd[_0xaf03('0x3f')][_0xaf03('0x4f')]){_0x304c3f['include']=[{'all':!![]}];}return db['SmsMessage'][_0xaf03('0x50')](_0x304c3f);})[_0xaf03('0x20')](function(_0x3f3fe0){_0xad4de5[_0xaf03('0x51')]=_0x3f3fe0;return _0xad4de5;})[_0xaf03('0x20')](respondWithFilteredResult(_0x14a32f,_0x304c3f))[_0xaf03('0x52')](handleError(_0x14a32f,null));};exports[_0xaf03('0x53')]=function(_0x5b0fbd,_0x2ce497){var _0x4b791f={'raw':!![],'where':{'id':_0x5b0fbd[_0xaf03('0x54')]['id']}},_0x5ee0b4={};_0x5ee0b4[_0xaf03('0x3e')]=_[_0xaf03('0x40')](db[_0xaf03('0x55')]['rawAttributes']);_0x5ee0b4[_0xaf03('0x3f')]=_[_0xaf03('0x40')](_0x5b0fbd[_0xaf03('0x3f')]);_0x5ee0b4[_0xaf03('0x41')]=_[_0xaf03('0x42')](_0x5ee0b4[_0xaf03('0x3e')],_0x5ee0b4[_0xaf03('0x3f')]);_0x4b791f[_0xaf03('0x44')]=_[_0xaf03('0x42')](_0x5ee0b4[_0xaf03('0x3e')],qs[_0xaf03('0x43')](_0x5b0fbd[_0xaf03('0x3f')]['fields']));_0x4b791f[_0xaf03('0x44')]=_0x4b791f['attributes']['length']?_0x4b791f['attributes']:_0x5ee0b4[_0xaf03('0x3e')];if(_0x5b0fbd['query']['includeAll']){_0x4b791f[_0xaf03('0x56')]=[{'all':!![]}];}_0x4b791f=_[_0xaf03('0x4c')]({},_0x4b791f,_0x5b0fbd[_0xaf03('0x57')]);return db[_0xaf03('0x55')][_0xaf03('0x58')](_0x4b791f)[_0xaf03('0x20')](handleEntityNotFound(_0x2ce497,null))[_0xaf03('0x20')](respondWithResult(_0x2ce497,null))[_0xaf03('0x52')](handleError(_0x2ce497,null));};exports['create']=function(_0x332959,_0x3a4207){return db[_0xaf03('0x55')]['create'](_0x332959[_0xaf03('0x59')],{})[_0xaf03('0x20')](respondWithResult(_0x3a4207,0xc9))[_0xaf03('0x52')](handleError(_0x3a4207,null));};exports[_0xaf03('0x5a')]=function(_0x47b30a,_0x1e4db7){if(_0x47b30a[_0xaf03('0x59')]['id']){delete _0x47b30a['body']['id'];}return db[_0xaf03('0x55')][_0xaf03('0x58')]({'where':{'id':_0x47b30a[_0xaf03('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e4db7,null))[_0xaf03('0x20')](saveUpdates(_0x47b30a[_0xaf03('0x59')],null))[_0xaf03('0x20')](respondWithResult(_0x1e4db7,null))[_0xaf03('0x52')](handleError(_0x1e4db7,null));};exports[_0xaf03('0x5b')]=function(_0x481aa4,_0x7044b6){return db[_0xaf03('0x55')][_0xaf03('0x58')]({'where':{'id':_0x481aa4[_0xaf03('0x54')]['id']}})['then'](handleEntityNotFound(_0x7044b6,null))[_0xaf03('0x20')](removeEntity(_0x7044b6,null))[_0xaf03('0x52')](handleError(_0x7044b6,null));};exports[_0xaf03('0x5c')]=function(_0x26774c,_0x3c8ba4){return db[_0xaf03('0x55')]['describe']()[_0xaf03('0x20')](respondWithResult(_0x3c8ba4,null))[_0xaf03('0x52')](handleError(_0x3c8ba4,null));};var interaction_log=require('../../config/logger')(_0xaf03('0x5d'));exports['accept']=function(_0x40e115,_0x54034b,_0x342201){var _0x47d9c6={'agent':{},'channel':'sms'};if(_0x40e115[_0xaf03('0x59')]['id']){delete _0x40e115[_0xaf03('0x59')]['id'];}_0x40e115[_0xaf03('0x59')][_0xaf03('0x5e')]=!![];_0x40e115[_0xaf03('0x59')][_0xaf03('0x5f')]=moment()[_0xaf03('0x60')](_0xaf03('0x61'));_0x40e115['body'][_0xaf03('0x62')]=_0x40e115[_0xaf03('0x59')]['UserId']||_0x40e115['user']['id'];_0x47d9c6['agent']['id']=_0x40e115['body'][_0xaf03('0x62')];return db[_0xaf03('0x55')][_0xaf03('0x58')]({'where':{'id':_0x40e115[_0xaf03('0x54')]['id'],'UserId':null}})[_0xaf03('0x20')](handleEntityNotFound(_0x54034b,null))['then'](saveUpdates(_0x40e115[_0xaf03('0x59')],null))['then'](function(_0x6438b2){if(_0x6438b2){_0x47d9c6[_0xaf03('0x27')]=_0x6438b2['get']({'plain':!![]});return db[_0xaf03('0x63')][_0xaf03('0x58')]({'where':{'id':_0x6438b2[_0xaf03('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x54034b,null))[_0xaf03('0x20')](function(_0xd3955b){if(_0xd3955b){return _0xd3955b['update']({'UserId':_0x40e115[_0xaf03('0x59')]['UserId'],'read1stAt':_[_0xaf03('0x65')](_0xd3955b[_0xaf03('0x66')])?moment()[_0xaf03('0x60')](_0xaf03('0x61')):undefined});}return null;})['then'](function(_0x501838){if(_0x501838){_0x47d9c6[_0xaf03('0x67')]=_0x501838['get']({'plain':!![]});interaction_log[_0xaf03('0x28')](_0xaf03('0x68'),_0x40e115[_0xaf03('0x69')]['id'],_0x40e115[_0xaf03('0x69')]['name'],_0x40e115['user']['role'],_0x47d9c6[_0xaf03('0x67')]['id'],_0x40e115[_0xaf03('0x59')]?JSON[_0xaf03('0x24')](_0x40e115[_0xaf03('0x59')]):_0xaf03('0x6a'));return respondWithRpcPromise(_0xaf03('0x6b'),'acceptMessage',_0x47d9c6);}return null;})[_0xaf03('0x20')](function(_0xe6ab8e){var _0x4e5e81=_0xaf03('0x6c')+_0xe6ab8e['message']['ContactId'];return db[_0xaf03('0x6d')]['query'](_0x4e5e81,{'type':db[_0xaf03('0x6e')][_0xaf03('0x6f')][_0xaf03('0x70')],'raw':!![]})[_0xaf03('0x20')](function(_0x4befb1){return _0x4befb1;});})[_0xaf03('0x20')](function(_0x183146){if(_0x183146){_0x47d9c6[_0xaf03('0x27')][_0xaf03('0x71')]=_0x183146[0x0];if(!_0x40e115['body'][_0xaf03('0x62')])return;return db[_0xaf03('0x72')][_0xaf03('0x58')]({'where':{'id':_0x40e115[_0xaf03('0x59')][_0xaf03('0x62')],'role':_0xaf03('0x73')},'attributes':['id','name',_0xaf03('0x74'),_0xaf03('0x75'),_0xaf03('0x76')],'raw':!![]});}return null;})[_0xaf03('0x20')](function(_0x282c54){if(!_0x282c54)return null;_0x47d9c6['message'][_0xaf03('0x73')]=_0x282c54;return _0x47d9c6;})[_0xaf03('0x20')](function(_0xd7e167){if(_0xd7e167){if(_0x40e115[_0xaf03('0x59')][_0xaf03('0x77')]){_0x47d9c6[_0xaf03('0x27')][_0xaf03('0x78')]=util[_0xaf03('0x60')]('SIP/%s',_0x40e115[_0xaf03('0x69')][_0xaf03('0x38')]);_0x47d9c6['message'][_0xaf03('0x79')]=_0x47d9c6[_0xaf03('0x79')];_0x47d9c6[_0xaf03('0x27')][_0xaf03('0x7a')]=_0x47d9c6['channel'];_0x47d9c6[_0xaf03('0x27')]['event']='accept';return respondWithRpcPromise(_0xaf03('0x7b'),_0xaf03('0x7b'),{'event':_0xaf03('0x7c'),'message':_0x47d9c6[_0xaf03('0x27')]},client9002)['then'](function(){return _0x47d9c6;});}return _0x47d9c6;}return null;})['then'](respondWithResult(_0x54034b,null))[_0xaf03('0x52')](handleError(_0x54034b,null));};var interaction_log=require(_0xaf03('0x14'))(_0xaf03('0x5d'));exports[_0xaf03('0x35')]=function(_0x4522e0,_0xa3557,_0xdc0ffc){var _0x3c558d={'agent':{},'channel':_0xaf03('0x7d')};if(_0x4522e0['body']['id']){delete _0x4522e0[_0xaf03('0x59')]['id'];}_0x4522e0[_0xaf03('0x59')][_0xaf03('0x62')]=_0x4522e0[_0xaf03('0x59')][_0xaf03('0x62')]||_0x4522e0[_0xaf03('0x69')]['id'];_0x3c558d[_0xaf03('0x73')]['id']=_0x4522e0[_0xaf03('0x59')][_0xaf03('0x62')];return db[_0xaf03('0x55')][_0xaf03('0x58')]({'where':{'id':_0x4522e0[_0xaf03('0x54')]['id'],'UserId':null}})[_0xaf03('0x20')](handleEntityNotFound(_0xa3557,null))['then'](function(_0x4379a1){if(_0x4379a1){_0x3c558d[_0xaf03('0x27')]=_0x4379a1[_0xaf03('0x7e')]({'plain':!![]});return db[_0xaf03('0x63')][_0xaf03('0x58')]({'where':{'id':_0x4379a1[_0xaf03('0x64')]}});}return null;})[_0xaf03('0x20')](handleEntityNotFound(_0xa3557,null))[_0xaf03('0x20')](function(_0x2aea77){if(_0x2aea77){_0x3c558d['interaction']=_0x2aea77['get']({'plain':!![]});interaction_log[_0xaf03('0x28')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4522e0[_0xaf03('0x69')]['id'],_0x4522e0['user'][_0xaf03('0x38')],_0x4522e0[_0xaf03('0x69')][_0xaf03('0x7f')],_0x3c558d['interaction']['id'],_0x4522e0[_0xaf03('0x59')]?JSON[_0xaf03('0x24')](_0x4522e0['body']):_0xaf03('0x6a'));return respondWithRpcPromise(_0xaf03('0x80'),_0xaf03('0x81'),_0x3c558d);}return null;})[_0xaf03('0x20')](function(_0x377f87){var _0x1079aa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x377f87[_0xaf03('0x27')][_0xaf03('0x82')];return db[_0xaf03('0x6d')][_0xaf03('0x3f')](_0x1079aa,{'type':db[_0xaf03('0x6e')][_0xaf03('0x6f')][_0xaf03('0x70')],'raw':!![]})[_0xaf03('0x20')](function(_0x2f43c2){return _0x2f43c2;});})[_0xaf03('0x20')](function(_0x387ca6){if(_0x387ca6){_0x3c558d[_0xaf03('0x27')]['contact']=_0x387ca6[0x0];if(!_0x4522e0[_0xaf03('0x59')]['UserId'])return;return db[_0xaf03('0x72')][_0xaf03('0x58')]({'where':{'id':_0x4522e0[_0xaf03('0x59')][_0xaf03('0x62')],'role':_0xaf03('0x73')},'attributes':['id','name','fullname',_0xaf03('0x75'),_0xaf03('0x76')],'raw':!![]});}return null;})[_0xaf03('0x20')](function(_0x4a9003){if(!_0x4a9003)return null;_0x3c558d[_0xaf03('0x27')]['agent']=_0x4a9003;return _0x3c558d;})['then'](function(_0x38be23){if(_0x38be23){_0x38be23['message'][_0xaf03('0x78')]=util[_0xaf03('0x60')]('SIP/%s',_0x4522e0[_0xaf03('0x69')][_0xaf03('0x38')]);_0x38be23['message'][_0xaf03('0x79')]=_0x3c558d['channel'];_0x38be23[_0xaf03('0x27')][_0xaf03('0x7a')]=_0x3c558d['channel'];_0x38be23[_0xaf03('0x27')][_0xaf03('0x83')]=_0xaf03('0x35');respondWithRpcPromise(_0xaf03('0x7b'),_0xaf03('0x7b'),{'event':_0xaf03('0x84'),'message':_0x38be23[_0xaf03('0x27')]},client9002);return _0x3c558d;}return null;})[_0xaf03('0x20')](respondWithResult(_0xa3557,null))[_0xaf03('0x52')](handleError(_0xa3557,null));};exports['status']=function(_0x3f60be,_0x3d4d86,_0x4dc4e2){if(_0x3f60be[_0xaf03('0x59')]['id']){delete _0x3f60be[_0xaf03('0x59')]['id'];}var _0x3bfd70;return db[_0xaf03('0x55')][_0xaf03('0x58')]({'where':{'id':_0x3f60be['params']['id']}})[_0xaf03('0x20')](handleEntityNotFound(_0x3d4d86,null))[_0xaf03('0x20')](function(_0x411c51){if(_0x411c51){_0x3bfd70=_0x411c51;return db[_0xaf03('0x85')]['find']({'where':{'id':_0x411c51[_0xaf03('0x86')]}});}})[_0xaf03('0x20')](handleEntityNotFound(_0x3d4d86,null))[_0xaf03('0x20')](function(_0x854634){if(_0x854634){logger['debug'](_0xaf03('0x23'),_0xaf03('0x2b'),'received\x20delivery\x20report\x20from',_0x854634[_0xaf03('0x3d')],util[_0xaf03('0x87')](_0x3f60be['body'],{'showHidden':![],'depth':null}));switch(_0x854634[_0xaf03('0x3d')]){case _0xaf03('0x88'):if(_0x3f60be['body'][_0xaf03('0x89')]&&_0x3f60be[_0xaf03('0x59')]['MessageSid']===_0x3bfd70['messageId']){return _0x3bfd70[_0xaf03('0x5a')]({'read':!![]});}else{logger[_0xaf03('0x25')](_0xaf03('0x8a'),_0xaf03('0x2b'),_0xaf03('0x88'),util[_0xaf03('0x87')](_0x3f60be['body'],{'showHidden':![],'depth':null}));}break;case _0xaf03('0x8b'):if(_0x3f60be[_0xaf03('0x59')][_0xaf03('0x8c')]&&_0x3f60be['body'][_0xaf03('0x8c')]===_0x3bfd70['messageId']&&_[_0xaf03('0x8d')]([_0xaf03('0x8e'),_0xaf03('0x8f')],_0x3f60be[_0xaf03('0x59')][_0xaf03('0x90')])>=0x0){return _0x3bfd70[_0xaf03('0x5a')]({'read':!![]});}else{logger['error'](_0xaf03('0x8a'),_0xaf03('0x2b'),_0xaf03('0x91'),util[_0xaf03('0x87')](_0x3f60be[_0xaf03('0x59')],{'showHidden':![],'depth':null}));}break;case _0xaf03('0x92'):var _0x1e8c1c=_0x3f60be[_0xaf03('0x59')][_0xaf03('0x93')][0x0];if(_0x1e8c1c['status'][_0xaf03('0x94')]===_0xaf03('0x95')){return _0x3bfd70[_0xaf03('0x5a')]({'read':!![]});}else{logger[_0xaf03('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaf03('0x2b'),_0xaf03('0x92'),util['inspect'](_0x3f60be[_0xaf03('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3bfd70;}})[_0xaf03('0x20')](respondWithResult(_0x3d4d86,null))[_0xaf03('0x52')](handleError(_0x3d4d86,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 9122440..ac51dee 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 _0x69ae=['hasOwnProperty','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x3a05cc,_0x2ea1f1){var _0x3d63a1=function(_0x537090){while(--_0x537090){_0x3a05cc['push'](_0x3a05cc['shift']());}};_0x3d63a1(++_0x2ea1f1);}(_0x69ae,0x19a));var _0xe69a=function(_0x5dc386,_0x360090){_0x5dc386=_0x5dc386-0x0;var _0x1b12a6=_0x69ae[_0x5dc386];return _0x1b12a6;};'use strict';var EventEmitter=require(_0xe69a('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe69a('0x1')](0x0);var events={'afterCreate':_0xe69a('0x2'),'afterUpdate':_0xe69a('0x3'),'afterDestroy':_0xe69a('0x4')};function emitEvent(_0x12108c){return function(_0x39dbe2,_0x4245e9,_0x473953){SmsMessageEvents[_0xe69a('0x5')](_0x12108c+':'+_0x39dbe2['id'],_0x39dbe2);SmsMessageEvents[_0xe69a('0x5')](_0x12108c,_0x39dbe2);_0x473953(null);};}for(var e in events){if(events[_0xe69a('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xe69a('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x502a=['emit','exports','setMaxListeners','save'];(function(_0x201d3a,_0x586a70){var _0xc4c063=function(_0x3cfd0a){while(--_0x3cfd0a){_0x201d3a['push'](_0x201d3a['shift']());}};_0xc4c063(++_0x586a70);}(_0x502a,0xc2));var _0xa502=function(_0x1807d2,_0x56776c){_0x1807d2=_0x1807d2-0x0;var _0x59f5fc=_0x502a[_0x1807d2];return _0x59f5fc;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa502('0x0')](0x0);var events={'afterCreate':_0xa502('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4dd28a){return function(_0x52f8e7,_0x49111a,_0x5ec4b3){SmsMessageEvents[_0xa502('0x2')](_0x4dd28a+':'+_0x52f8e7['id'],_0x52f8e7);SmsMessageEvents[_0xa502('0x2')](_0x4dd28a,_0x52f8e7);_0x5ec4b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xa502('0x3')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index d999426..e28cc58 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 _0xef95=['then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','plivo','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','keys','sort','length','createHash','md5','hex','signature=','GET','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','refid','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xef95,0x151));var _0x5ef9=function(_0x27758f,_0x2ebe86){_0x27758f=_0x27758f-0x0;var _0x3277d8=_0xef95[_0x27758f];return _0x3277d8;};'use strict';var _=require(_0x5ef9('0x0'));var util=require(_0x5ef9('0x1'));var logger=require(_0x5ef9('0x2'))(_0x5ef9('0x3'));var moment=require(_0x5ef9('0x4'));var BPromise=require(_0x5ef9('0x5'));var rp=require(_0x5ef9('0x6'));var fs=require('fs');var path=require(_0x5ef9('0x7'));var rimraf=require('rimraf');var config=require(_0x5ef9('0x8'));var attributes=require(_0x5ef9('0x9'));module['exports']=function(_0x5d435b,_0x154092){return _0x5d435b[_0x5ef9('0xa')](_0x5ef9('0xb'),attributes,{'tableName':_0x5ef9('0xc'),'paranoid':![],'indexes':[{'name':_0x5ef9('0xd'),'fields':[_0x5ef9('0xd')]},{'name':_0x5ef9('0xe'),'fields':[_0x5ef9('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x522770,_0x5051f6,_0x58d3b0){var _0x4615ea=_0x5d435b[_0x5ef9('0x10')];var _0x42ecb0=_0x522770[_0x5ef9('0x11')]({'plain':!![]});if(_0x42ecb0['direction']['toLowerCase']()==='in'||_0x42ecb0[_0x5ef9('0x12')][_0x5ef9('0x13')]()===_0x5ef9('0x14')&&!_0x42ecb0[_0x5ef9('0x15')]&&!_[_0x5ef9('0x16')](_0x42ecb0[_0x5ef9('0x17')])&&!_['isNil'](_0x42ecb0['SmsInteractionId'])){_0x4615ea[_0x5ef9('0x18')]['findOne']({'where':{'id':_0x42ecb0[_0x5ef9('0x19')]}})[_0x5ef9('0x1a')](function(_0x1c3da6){if(_0x1c3da6){_0x1c3da6[_0x5ef9('0x1b')]({'lastMsgAt':_0x42ecb0[_0x5ef9('0x1c')],'lastMsgDirection':_0x42ecb0['direction'][_0x5ef9('0x13')]()});}})[_0x5ef9('0x1d')](function(_0x3424a7){console[_0x5ef9('0x1e')](_0x3424a7);});}if(_0x42ecb0[_0x5ef9('0x12')]===_0x5ef9('0x14')&&!_0x42ecb0['secret']){var _0x4026ff;_0x4615ea[_0x5ef9('0x1f')][_0x5ef9('0x20')]({'where':{'id':_0x42ecb0[_0x5ef9('0x21')]},'raw':!![]})[_0x5ef9('0x1a')](function(_0x232b75){_0x4026ff=_0x232b75;if(_0x4026ff&&_0x4026ff[_0x5ef9('0x22')]){switch(_0x4026ff[_0x5ef9('0x22')]){case _0x5ef9('0x23'):var _0x31429b=require(_0x5ef9('0x23'));if(_0x4026ff[_0x5ef9('0x24')]&&_0x4026ff['authToken']&&_0x4026ff[_0x5ef9('0x25')]){var _0x2580a6=new _0x31429b(_0x4026ff[_0x5ef9('0x24')],_0x4026ff[_0x5ef9('0x26')]);_0x2580a6[_0x5ef9('0x27')][_0x5ef9('0x28')]({'body':_0x42ecb0[_0x5ef9('0xf')],'to':_0x42ecb0[_0x5ef9('0x25')],'from':_0x4026ff[_0x5ef9('0x25')],'statusCallback':_0x4026ff['remote']+_0x5ef9('0x29')+_0x42ecb0['id']+_0x5ef9('0x2a')+_0x4026ff[_0x5ef9('0x2b')]})[_0x5ef9('0x1a')](function(_0x412fb4){if(_0x412fb4['sid']){return _0x522770['update']({'messageId':_0x412fb4[_0x5ef9('0x2c')]});}})[_0x5ef9('0x1d')](function(_0x193ac8){logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),'afterCreate',_0x5ef9('0x23'),util[_0x5ef9('0x2e')](_0x193ac8,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5ef9('0x2f'),_0x5ef9('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5ef9('0x30'):var _0x369d80=_0x5ef9('0x31');if(_0x4026ff[_0x5ef9('0x32')]&&_0x4026ff[_0x5ef9('0x33')]){var _0x57a0aa={'recipient':[_0x42ecb0['phone']],'message':_0x42ecb0[_0x5ef9('0xf')],'message_type':_0x4026ff[_0x5ef9('0x34')]};if(_0x4026ff['smsMethod']&&_0x4026ff['smsMethod']!=='SI'){_0x57a0aa[_0x5ef9('0x35')]=_0x4026ff[_0x5ef9('0x25')];}var _0x361f89={'url':_0x369d80+_0x5ef9('0x36')+_0x4026ff[_0x5ef9('0x32')]+'&password='+_0x4026ff[_0x5ef9('0x33')],'method':'GET'};rp(_0x361f89)[_0x5ef9('0x1a')](function(_0x423438){var _0x487c84=_0x423438[_0x5ef9('0x37')](';');var _0x50f0ea={'user_key':_0x487c84[0x0],'session_key':_0x487c84[0x1]};_0x361f89={'url':_0x369d80+_0x5ef9('0x38'),'method':'POST','headers':{'user_key':_0x50f0ea['user_key'],'Session_key':_0x50f0ea[_0x5ef9('0x39')]},'json':!![],'body':_0x57a0aa};return rp(_0x361f89);})[_0x5ef9('0x1a')](function(_0x3218a4){if(_0x3218a4['total_sent']>=0x1){var _0x3f909d={'messageId':_0x3218a4[_0x5ef9('0x3a')]};if(_0x4026ff[_0x5ef9('0x34')]!=='GP'||!_0x4026ff[_0x5ef9('0x3b')]){_0x3f909d[_0x5ef9('0x3c')]=!![];}return _0x522770['update'](_0x3f909d);}else{return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x30'),util[_0x5ef9('0x2e')](_0x3218a4,{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x3cecfa){return logger[_0x5ef9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5ef9('0x2f'),'skebby',util[_0x5ef9('0x2e')](_0x3cecfa,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5ef9('0x2f'),_0x5ef9('0x30'),_0x5ef9('0x3d'));}break;case _0x5ef9('0x3e'):if(_0x4026ff[_0x5ef9('0x26')]){var _0x30fc9d={'recipient':_0x42ecb0[_0x5ef9('0x25')],'message':_0x42ecb0[_0x5ef9('0xf')],'sender':_0x4026ff['senderString']||_0x4026ff[_0x5ef9('0x25')],'authorization':_0x4026ff[_0x5ef9('0x26')]};var _0x5051f6={'method':_0x5ef9('0x3f'),'uri':_0x5ef9('0x40'),'body':_0x30fc9d,'json':!![]};rp(_0x5051f6)[_0x5ef9('0x1a')](function(_0x28dacb){var _0x668244={'messageId':_0x28dacb[_0x5ef9('0x41')]};if(!_0x4026ff[_0x5ef9('0x3b')]){_0x668244[_0x5ef9('0x3c')]=!![];}return _0x522770[_0x5ef9('0x1b')](_0x668244);})[_0x5ef9('0x1d')](function(_0x331081){logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x3e'),util[_0x5ef9('0x2e')](_0x331081,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'connectel',_0x5ef9('0x42'));}break;case _0x5ef9('0x43'):if(_0x4026ff[_0x5ef9('0x32')]&&_0x4026ff[_0x5ef9('0x33')]){var _0x30fc9d={'messages':[{'source':_0x5ef9('0x44'),'to':_0x42ecb0[_0x5ef9('0x25')],'body':_0x42ecb0[_0x5ef9('0xf')],'from':_0x4026ff[_0x5ef9('0x45')]||_0x4026ff['phone']}]};var _0xacf4=util['format'](_0x5ef9('0x46'),_0x4026ff[_0x5ef9('0x32')],_0x4026ff[_0x5ef9('0x33')]);var _0x5051f6={'method':_0x5ef9('0x3f'),'uri':_0x5ef9('0x47'),'body':_0x30fc9d,'headers':{'Authorization':util[_0x5ef9('0x48')](_0x5ef9('0x49'),new Buffer(_0xacf4)[_0x5ef9('0x4a')](_0x5ef9('0x4b')))},'json':!![]};rp(_0x5051f6)[_0x5ef9('0x1a')](function(_0x836bba){if(_0x836bba[_0x5ef9('0x4c')]>=0xc8&&_0x836bba[_0x5ef9('0x4c')]<=0xce){if(_0x836bba['data']&&_0x836bba[_0x5ef9('0x4d')][_0x5ef9('0x4e')]>0x0){var _0x4edb3e=_['head'](_0x836bba[_0x5ef9('0x4d')][_0x5ef9('0x27')]);var _0x4d19a8={'messageId':_0x4edb3e[_0x5ef9('0x4f')]};if(!_0x4026ff['deliveryReport']){_0x4d19a8[_0x5ef9('0x3c')]=!![];}return _0x522770[_0x5ef9('0x1b')](_0x4d19a8);}else{logger['error'](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x50'),util[_0x5ef9('0x2e')](_0x836bba,{'showHidden':![],'depth':null}));}}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x50'),util[_0x5ef9('0x2e')](_0x836bba,{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x9850a1){logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x50'),util['inspect'](_0x9850a1,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'clickSend',_0x5ef9('0x3d'));}break;case'plivo':if(_0x4026ff[_0x5ef9('0x51')]&&_0x4026ff['authToken']){var _0x30fc9d={'dst':_0x42ecb0[_0x5ef9('0x25')],'text':_0x42ecb0[_0x5ef9('0xf')],'src':_0x4026ff[_0x5ef9('0x45')]||_0x4026ff[_0x5ef9('0x25')],'url':_0x4026ff[_0x5ef9('0x52')]+_0x5ef9('0x29')+_0x42ecb0['id']+_0x5ef9('0x2a')+_0x4026ff[_0x5ef9('0x2b')]};var _0xacf4=util[_0x5ef9('0x48')](_0x5ef9('0x46'),_0x4026ff[_0x5ef9('0x51')],_0x4026ff[_0x5ef9('0x26')]);var _0x5051f6={'method':'POST','uri':util[_0x5ef9('0x48')](_0x5ef9('0x53'),_0x4026ff[_0x5ef9('0x51')]),'body':_0x30fc9d,'headers':{'Authorization':util[_0x5ef9('0x48')](_0x5ef9('0x49'),new Buffer(_0xacf4)[_0x5ef9('0x4a')](_0x5ef9('0x4b')))},'json':!![]};rp(_0x5051f6)[_0x5ef9('0x1a')](function(_0x394cf8){var _0x418a05={'messageId':_0x394cf8['message_uuid'][0x0]};return _0x522770[_0x5ef9('0x1b')](_0x418a05);})[_0x5ef9('0x1d')](function(_0x2c9541){logger['error'](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x54'),util[_0x5ef9('0x2e')](_0x2c9541,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x4026ff[_0x5ef9('0x32')]&&_0x4026ff[_0x5ef9('0x33')]){if(_0x4026ff[_0x5ef9('0x55')]){var _0x777538={'method':'POST','uri':_0x4026ff['baseUrl']+'/auth/1/session','body':{'username':_0x4026ff[_0x5ef9('0x32')],'password':_0x4026ff[_0x5ef9('0x33')]},'json':!![]};return rp(_0x777538)[_0x5ef9('0x1a')](function(_0x559bc8){var _0x455f55={'method':_0x5ef9('0x3f'),'uri':_0x4026ff['baseUrl']+_0x5ef9('0x56'),'body':{'messages':[{'from':_0x4026ff[_0x5ef9('0x25')],'destinations':[{'to':_0x42ecb0[_0x5ef9('0x25')]}],'text':_0x42ecb0[_0x5ef9('0xf')],'notifyUrl':_0x4026ff['remote']+_0x5ef9('0x29')+_0x42ecb0['id']+_0x5ef9('0x2a')+_0x4026ff[_0x5ef9('0x2b')],'notifyContentType':_0x5ef9('0x57'),'callbackData':_0x4026ff[_0x5ef9('0x25')]+';'+_0x42ecb0[_0x5ef9('0xf')]}]},'headers':{'Authorization':_0x5ef9('0x58')+_0x559bc8[_0x5ef9('0x2b')]},'json':!![]};return rp(_0x455f55)['then'](function(_0x408bb4){if(_0x408bb4[_0x5ef9('0x27')]){var _0xc57c0e={'messageId':_0x408bb4[_0x5ef9('0x27')][0x0][_0x5ef9('0xd')]};if(!_0x4026ff['deliveryReport']){_0xc57c0e['read']=!![];}return _0x522770[_0x5ef9('0x1b')](_0xc57c0e);}else{return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),'afterCreate',_0x5ef9('0x59'),util[_0x5ef9('0x2e')](_0x408bb4,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2f72df){return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),'afterCreate',_0x5ef9('0x59'),util[_0x5ef9('0x2e')](_0x2f72df,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0x5ef9('0x5a'));}}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x59'),_0x5ef9('0x3d'));}break;case _0x5ef9('0x5b'):var _0x4ab01c=require('crypto');if(_0x4026ff[_0x5ef9('0x5c')]){var _0x518038={};_0x518038[_0x5ef9('0x5d')]=_0x4026ff[_0x5ef9('0x32')];_0x518038[_0x5ef9('0x25')]=_0x42ecb0['phone'];_0x518038[_0x5ef9('0x35')]=_0x4026ff[_0x5ef9('0x25')];_0x518038['text']=_0x42ecb0[_0x5ef9('0xf')];_0x518038['timestamp']=+new Date();var _0x2bc52f='';var _0x2f80da='';var _0x1b2349=Object[_0x5ef9('0x5e')](_0x518038);_0x1b2349[_0x5ef9('0x5f')]();for(var _0x39477b=0x0;_0x39477b<_0x1b2349[_0x5ef9('0x60')];_0x39477b++){if(_0x2bc52f!=''){_0x2bc52f+='&';}_0x2bc52f+=_0x1b2349[_0x39477b]+'='+encodeURIComponent(_0x518038[_0x1b2349[_0x39477b]]);_0x2f80da+=_0x518038[_0x1b2349[_0x39477b]];}_0x2f80da+=_0x4026ff[_0x5ef9('0x5c')];_0x2f80da=_0x4ab01c[_0x5ef9('0x61')](_0x5ef9('0x62'))['update'](_0x2f80da)['digest'](_0x5ef9('0x63'));if(_0x2bc52f!==''){_0x2bc52f+='&';}_0x2bc52f+=_0x5ef9('0x64')+_0x2f80da;var _0x361f89={'method':_0x5ef9('0x65'),'uri':_0x4026ff['baseUrl']+_0x5ef9('0x66')+_0x2bc52f,'json':!![]};return rp(_0x361f89)['then'](function(_0x5871f6){var _0x4fe5a7=Object[_0x5ef9('0x5e')](_0x5871f6);if(_0x5871f6[_0x4fe5a7[0x0]][_0x5ef9('0x1e')]&&parseInt(_0x5871f6[_0x4fe5a7[0x0]][_0x5ef9('0x1e')])===0x0){var _0x39fd9b={'messageId':_0x5871f6[_0x4fe5a7[0x0]][_0x5ef9('0x67')]};if(!_0x4026ff[_0x5ef9('0x3b')]){_0x39fd9b[_0x5ef9('0x3c')]=!![];}return _0x522770[_0x5ef9('0x1b')](_0x39fd9b);}else{return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x5b'),util[_0x5ef9('0x2e')](_0x5871f6['error'],{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x5f49f9){return logger[_0x5ef9('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5ef9('0x2f'),_0x5ef9('0x5b'),util[_0x5ef9('0x2e')](_0x5f49f9,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x5ef9('0x68'):if(_0x4026ff[_0x5ef9('0x5c')]){var _0x50095f={'method':'POST','uri':_0x5ef9('0x69'),'headers':{'Authorization':_0x4026ff[_0x5ef9('0x5c')]},'body':{'content':_0x42ecb0['body'],'to':[_0x42ecb0['phone']],'from':_0x4026ff[_0x5ef9('0x25')],'binary':![],'clientMessageId':_0x5ef9('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x50095f)[_0x5ef9('0x1a')](function(_0x4beba6){if(!_0x4beba6[_0x5ef9('0x1e')]){var _0x462365={'messageId':_0x4beba6[_0x5ef9('0x27')][0x0]['apiMessageId']};if(!_0x4026ff['deliveryReport']){_0x462365[_0x5ef9('0x3c')]=!![];}return _0x522770[_0x5ef9('0x1b')](_0x462365);}else{return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x68'),util[_0x5ef9('0x2e')](_0x4beba6['error'],{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x1388ca){return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x68'),util[_0x5ef9('0x2e')](_0x1388ca,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'clickatell',_0x5ef9('0x6b'));}break;case _0x5ef9('0x6c'):if(_0x4026ff[_0x5ef9('0x32')]&&_0x4026ff['password']){var _0xacf4=util[_0x5ef9('0x48')]('%s:%s',_0x4026ff[_0x5ef9('0x32')],_0x4026ff['password']);var _0x5051f6={'method':_0x5ef9('0x3f'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4026ff[_0x5ef9('0x6d')]+_0x5ef9('0x6e'),'body':{'to':[_0x42ecb0[_0x5ef9('0x25')]],'text':_0x42ecb0['body'],'from':_0x4026ff['phone'],'applicationId':_0x4026ff[_0x5ef9('0x6f')]},'headers':{'Authorization':util[_0x5ef9('0x48')](_0x5ef9('0x49'),new Buffer(_0xacf4)[_0x5ef9('0x4a')](_0x5ef9('0x4b')))},'json':!![]};rp(_0x5051f6)['then'](function(_0x10aa9e){if(_0x10aa9e['id']){var _0xc1c59={'messageId':_0x10aa9e['id']};return _0x522770[_0x5ef9('0x1b')](_0xc1c59);}else{logger['error'](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x6c'),util['inspect'](_0x10aa9e,{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x1606cf){logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'bandwidth',util[_0x5ef9('0x2e')](_0x1606cf,{'showHidden':![],'depth':null}));});}else{logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'bandwidth',_0x5ef9('0x3d'));}break;case _0x5ef9('0x70'):if(_0x4026ff[_0x5ef9('0x5c')]){var _0x1cbf21={};var _0x361f89={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x5ef9('0x71')+_0x4026ff['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x4026ff[_0x5ef9('0x25')],'to':_0x42ecb0[_0x5ef9('0x25')],'text':_0x42ecb0[_0x5ef9('0xf')]},'json':!![]};return rp(_0x361f89)[_0x5ef9('0x1a')](function(_0x2d567e){if(_0x2d567e[_0x5ef9('0x72')]==0xca){_0x1cbf21['message']=_0x2d567e;var _0x5e2b9c={'method':'POST','uri':_0x5ef9('0x73'),'headers':{'Authorization':_0x5ef9('0x71')+_0x4026ff[_0x5ef9('0x5c')],'Content-Type':'application/json'},'body':{'refid':_0x1cbf21[_0x5ef9('0x74')]['refid']},'json':!![]};return rp(_0x5e2b9c)[_0x5ef9('0x1a')](function(_0x54457c){_0x1cbf21[_0x5ef9('0x75')]=_0x54457c;var _0xdfafa={'messageId':_0x1cbf21[_0x5ef9('0x74')][_0x5ef9('0x76')],'read':!![]};return _0x522770['update'](_0xdfafa);});}else{return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),_0x5ef9('0x2f'),'intelepeer',util[_0x5ef9('0x2e')](_0x2d567e,{'showHidden':![],'depth':null}));}})[_0x5ef9('0x1d')](function(_0x56b24a){return logger[_0x5ef9('0x1e')](_0x5ef9('0x2d'),'afterCreate','intelepeer',util[_0x5ef9('0x2e')](_0x56b24a,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x5ef9('0x2d'),_0x5ef9('0x2f'),_0x5ef9('0x70'),_0x5ef9('0x77'));}break;}}})['finally'](function(){_0x58d3b0();});}else{_0x58d3b0();}}},'charset':'utf8mb4','collate':_0x5ef9('0x78')});}; \ No newline at end of file +var _0x1c1d=['token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','update','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','sort','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','csc','uuid','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','findOne','then','catch','error','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token='];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1c1d,0x1b3));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1c1('0x0'));var util=require('util');var logger=require(_0xd1c1('0x1'))(_0xd1c1('0x2'));var moment=require('moment');var BPromise=require(_0xd1c1('0x3'));var rp=require(_0xd1c1('0x4'));var fs=require('fs');var path=require(_0xd1c1('0x5'));var rimraf=require(_0xd1c1('0x6'));var config=require(_0xd1c1('0x7'));var attributes=require('./smsMessage.attributes');module[_0xd1c1('0x8')]=function(_0x49cbfd,_0x317cb6){return _0x49cbfd[_0xd1c1('0x9')](_0xd1c1('0xa'),attributes,{'tableName':_0xd1c1('0xb'),'paranoid':![],'indexes':[{'name':_0xd1c1('0xc'),'fields':[_0xd1c1('0xc')]},{'name':_0xd1c1('0xd'),'fields':[_0xd1c1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11fb14,_0x5c4dad,_0x351d4b){var _0x5e513e=_0x49cbfd[_0xd1c1('0xf')];var _0x2d8543=_0x11fb14['get']({'plain':!![]});if(_0x2d8543[_0xd1c1('0x10')][_0xd1c1('0x11')]()==='in'||_0x2d8543[_0xd1c1('0x10')][_0xd1c1('0x11')]()===_0xd1c1('0x12')&&!_0x2d8543['secret']&&!_[_0xd1c1('0x13')](_0x2d8543[_0xd1c1('0x14')])&&!_[_0xd1c1('0x13')](_0x2d8543[_0xd1c1('0x15')])){_0x5e513e['SmsInteraction'][_0xd1c1('0x16')]({'where':{'id':_0x2d8543[_0xd1c1('0x15')]}})[_0xd1c1('0x17')](function(_0x153ea4){if(_0x153ea4){_0x153ea4['update']({'lastMsgAt':_0x2d8543['createdAt'],'lastMsgDirection':_0x2d8543[_0xd1c1('0x10')][_0xd1c1('0x11')]()});}})[_0xd1c1('0x18')](function(_0x1d061e){console[_0xd1c1('0x19')](_0x1d061e);});}if(_0x2d8543['direction']===_0xd1c1('0x12')&&!_0x2d8543[_0xd1c1('0x1a')]){var _0x39af45;_0x5e513e[_0xd1c1('0x1b')]['find']({'where':{'id':_0x2d8543[_0xd1c1('0x1c')]},'raw':!![]})[_0xd1c1('0x17')](function(_0x451ae5){_0x39af45=_0x451ae5;if(_0x39af45&&_0x39af45['type']){switch(_0x39af45[_0xd1c1('0x1d')]){case _0xd1c1('0x1e'):var _0x1e38dc=require(_0xd1c1('0x1e'));if(_0x39af45[_0xd1c1('0x1f')]&&_0x39af45[_0xd1c1('0x20')]&&_0x39af45[_0xd1c1('0x21')]){var _0x23d0e1=new _0x1e38dc(_0x39af45['accountSid'],_0x39af45[_0xd1c1('0x20')]);_0x23d0e1[_0xd1c1('0x22')]['create']({'body':_0x2d8543[_0xd1c1('0xe')],'to':_0x2d8543[_0xd1c1('0x21')],'from':_0x39af45[_0xd1c1('0x21')],'statusCallback':_0x39af45['remote']+_0xd1c1('0x23')+_0x2d8543['id']+_0xd1c1('0x24')+_0x39af45[_0xd1c1('0x25')]})['then'](function(_0x274a4a){if(_0x274a4a[_0xd1c1('0x26')]){return _0x11fb14['update']({'messageId':_0x274a4a[_0xd1c1('0x26')]});}})[_0xd1c1('0x18')](function(_0x266fb6){logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),'twilio',util[_0xd1c1('0x29')](_0x266fb6,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x1e'),_0xd1c1('0x2a'));}break;case _0xd1c1('0x2b'):var _0x1d22f4=_0xd1c1('0x2c');if(_0x39af45[_0xd1c1('0x2d')]&&_0x39af45[_0xd1c1('0x2e')]){var _0x4e2b66={'recipient':[_0x2d8543[_0xd1c1('0x21')]],'message':_0x2d8543[_0xd1c1('0xe')],'message_type':_0x39af45[_0xd1c1('0x2f')]};if(_0x39af45[_0xd1c1('0x2f')]&&_0x39af45[_0xd1c1('0x2f')]!=='SI'){_0x4e2b66[_0xd1c1('0x30')]=_0x39af45[_0xd1c1('0x21')];}var _0x2b3a78={'url':_0x1d22f4+'login?username='+_0x39af45['username']+_0xd1c1('0x31')+_0x39af45[_0xd1c1('0x2e')],'method':_0xd1c1('0x32')};rp(_0x2b3a78)['then'](function(_0xb84212){var _0x21fbba=_0xb84212[_0xd1c1('0x33')](';');var _0x2e311c={'user_key':_0x21fbba[0x0],'session_key':_0x21fbba[0x1]};_0x2b3a78={'url':_0x1d22f4+_0xd1c1('0x34'),'method':_0xd1c1('0x35'),'headers':{'user_key':_0x2e311c[_0xd1c1('0x36')],'Session_key':_0x2e311c[_0xd1c1('0x37')]},'json':!![],'body':_0x4e2b66};return rp(_0x2b3a78);})[_0xd1c1('0x17')](function(_0x40fb42){if(_0x40fb42[_0xd1c1('0x38')]>=0x1){var _0x307bf6={'messageId':_0x40fb42[_0xd1c1('0x39')]};if(_0x39af45[_0xd1c1('0x2f')]!=='GP'||!_0x39af45[_0xd1c1('0x3a')]){_0x307bf6[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x307bf6);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x2b'),util[_0xd1c1('0x29')](_0x40fb42,{'showHidden':![],'depth':null}));}})[_0xd1c1('0x18')](function(_0x2e8071){return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x2b'),util[_0xd1c1('0x29')](_0x2e8071,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd1c1('0x3d'):if(_0x39af45[_0xd1c1('0x20')]){var _0x5d0042={'recipient':_0x2d8543[_0xd1c1('0x21')],'message':_0x2d8543[_0xd1c1('0xe')],'sender':_0x39af45[_0xd1c1('0x3e')]||_0x39af45[_0xd1c1('0x21')],'authorization':_0x39af45[_0xd1c1('0x20')]};var _0x5c4dad={'method':_0xd1c1('0x35'),'uri':_0xd1c1('0x3f'),'body':_0x5d0042,'json':!![]};rp(_0x5c4dad)[_0xd1c1('0x17')](function(_0x4f4a66){var _0x566064={'messageId':_0x4f4a66['requestid']};if(!_0x39af45[_0xd1c1('0x3a')]){_0x566064[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x566064);})['catch'](function(_0x19c814){logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x3d'),util[_0xd1c1('0x29')](_0x19c814,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x3d'),_0xd1c1('0x40'));}break;case _0xd1c1('0x41'):if(_0x39af45[_0xd1c1('0x2d')]&&_0x39af45['password']){var _0x5d0042={'messages':[{'source':'xCALLY\x20Motion','to':_0x2d8543[_0xd1c1('0x21')],'body':_0x2d8543[_0xd1c1('0xe')],'from':_0x39af45[_0xd1c1('0x3e')]||_0x39af45['phone']}]};var _0x5366b1=util[_0xd1c1('0x42')](_0xd1c1('0x43'),_0x39af45[_0xd1c1('0x2d')],_0x39af45['password']);var _0x5c4dad={'method':_0xd1c1('0x35'),'uri':_0xd1c1('0x44'),'body':_0x5d0042,'headers':{'Authorization':util[_0xd1c1('0x42')](_0xd1c1('0x45'),new Buffer(_0x5366b1)[_0xd1c1('0x46')](_0xd1c1('0x47')))},'json':!![]};rp(_0x5c4dad)[_0xd1c1('0x17')](function(_0x666ac6){if(_0x666ac6[_0xd1c1('0x48')]>=0xc8&&_0x666ac6[_0xd1c1('0x48')]<=0xce){if(_0x666ac6[_0xd1c1('0x49')]&&_0x666ac6['data']['queued_count']>0x0){var _0x2300fb=_[_0xd1c1('0x4a')](_0x666ac6[_0xd1c1('0x49')][_0xd1c1('0x22')]);var _0x47ff80={'messageId':_0x2300fb['message_id']};if(!_0x39af45[_0xd1c1('0x3a')]){_0x47ff80[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x47ff80);}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x4b'),util['inspect'](_0x666ac6,{'showHidden':![],'depth':null}));}}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x4b'),util[_0xd1c1('0x29')](_0x666ac6,{'showHidden':![],'depth':null}));}})[_0xd1c1('0x18')](function(_0x432bab){logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x4b'),util[_0xd1c1('0x29')](_0x432bab,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x4b'),_0xd1c1('0x4c'));}break;case _0xd1c1('0x4d'):if(_0x39af45['authId']&&_0x39af45['authToken']){var _0x5d0042={'dst':_0x2d8543[_0xd1c1('0x21')],'text':_0x2d8543[_0xd1c1('0xe')],'src':_0x39af45[_0xd1c1('0x3e')]||_0x39af45[_0xd1c1('0x21')],'url':_0x39af45[_0xd1c1('0x4e')]+_0xd1c1('0x23')+_0x2d8543['id']+_0xd1c1('0x24')+_0x39af45[_0xd1c1('0x25')]};var _0x5366b1=util[_0xd1c1('0x42')](_0xd1c1('0x43'),_0x39af45[_0xd1c1('0x4f')],_0x39af45[_0xd1c1('0x20')]);var _0x5c4dad={'method':_0xd1c1('0x35'),'uri':util['format'](_0xd1c1('0x50'),_0x39af45[_0xd1c1('0x4f')]),'body':_0x5d0042,'headers':{'Authorization':util[_0xd1c1('0x42')](_0xd1c1('0x45'),new Buffer(_0x5366b1)[_0xd1c1('0x46')]('base64'))},'json':!![]};rp(_0x5c4dad)[_0xd1c1('0x17')](function(_0x2d300c){var _0xaacefe={'messageId':_0x2d300c[_0xd1c1('0x51')][0x0]};return _0x11fb14['update'](_0xaacefe);})[_0xd1c1('0x18')](function(_0x4b039b){logger['error'](_0xd1c1('0x27'),_0xd1c1('0x28'),'plivo',util['inspect'](_0x4b039b,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd1c1('0x52'):if(_0x39af45[_0xd1c1('0x2d')]&&_0x39af45[_0xd1c1('0x2e')]){if(_0x39af45[_0xd1c1('0x53')]){var _0x163f6c={'method':_0xd1c1('0x35'),'uri':_0x39af45[_0xd1c1('0x53')]+'/auth/1/session','body':{'username':_0x39af45[_0xd1c1('0x2d')],'password':_0x39af45['password']},'json':!![]};return rp(_0x163f6c)[_0xd1c1('0x17')](function(_0x3738d2){var _0x70fac8={'method':_0xd1c1('0x35'),'uri':_0x39af45[_0xd1c1('0x53')]+_0xd1c1('0x54'),'body':{'messages':[{'from':_0x39af45[_0xd1c1('0x21')],'destinations':[{'to':_0x2d8543['phone']}],'text':_0x2d8543[_0xd1c1('0xe')],'notifyUrl':_0x39af45[_0xd1c1('0x4e')]+_0xd1c1('0x23')+_0x2d8543['id']+_0xd1c1('0x24')+_0x39af45['token'],'notifyContentType':'application/json','callbackData':_0x39af45[_0xd1c1('0x21')]+';'+_0x2d8543[_0xd1c1('0xe')]}]},'headers':{'Authorization':_0xd1c1('0x55')+_0x3738d2[_0xd1c1('0x25')]},'json':!![]};return rp(_0x70fac8)[_0xd1c1('0x17')](function(_0x402d10){if(_0x402d10[_0xd1c1('0x22')]){var _0x8d2479={'messageId':_0x402d10['messages'][0x0][_0xd1c1('0xc')]};if(!_0x39af45['deliveryReport']){_0x8d2479[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x8d2479);}else{return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate',_0xd1c1('0x52'),util[_0xd1c1('0x29')](_0x402d10,{'showHidden':![],'depth':null}));}});})[_0xd1c1('0x18')](function(_0x868d29){return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),'infobip',util['inspect'](_0x868d29,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate',_0xd1c1('0x52'),_0xd1c1('0x56'));}}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x52'),_0xd1c1('0x4c'));}break;case'csc':var _0xda34b6=require(_0xd1c1('0x57'));if(_0x39af45[_0xd1c1('0x58')]){var _0x3ff2b6={};_0x3ff2b6[_0xd1c1('0x59')]=_0x39af45[_0xd1c1('0x2d')];_0x3ff2b6[_0xd1c1('0x21')]=_0x2d8543[_0xd1c1('0x21')];_0x3ff2b6['sender']=_0x39af45[_0xd1c1('0x21')];_0x3ff2b6[_0xd1c1('0x5a')]=_0x2d8543[_0xd1c1('0xe')];_0x3ff2b6['timestamp']=+new Date();var _0xc56e2='';var _0x1a918a='';var _0x5e75c1=Object[_0xd1c1('0x5b')](_0x3ff2b6);_0x5e75c1[_0xd1c1('0x5c')]();for(var _0x531a3b=0x0;_0x531a3b<_0x5e75c1['length'];_0x531a3b++){if(_0xc56e2!=''){_0xc56e2+='&';}_0xc56e2+=_0x5e75c1[_0x531a3b]+'='+encodeURIComponent(_0x3ff2b6[_0x5e75c1[_0x531a3b]]);_0x1a918a+=_0x3ff2b6[_0x5e75c1[_0x531a3b]];}_0x1a918a+=_0x39af45[_0xd1c1('0x58')];_0x1a918a=_0xda34b6[_0xd1c1('0x5d')]('md5')['update'](_0x1a918a)[_0xd1c1('0x5e')](_0xd1c1('0x5f'));if(_0xc56e2!==''){_0xc56e2+='&';}_0xc56e2+=_0xd1c1('0x60')+_0x1a918a;var _0x2b3a78={'method':_0xd1c1('0x32'),'uri':_0x39af45[_0xd1c1('0x53')]+_0xd1c1('0x61')+_0xc56e2,'json':!![]};return rp(_0x2b3a78)[_0xd1c1('0x17')](function(_0x3dbffe){var _0x37a06a=Object[_0xd1c1('0x5b')](_0x3dbffe);if(_0x3dbffe[_0x37a06a[0x0]]['error']&&parseInt(_0x3dbffe[_0x37a06a[0x0]][_0xd1c1('0x19')])===0x0){var _0x55ff55={'messageId':_0x3dbffe[_0x37a06a[0x0]][_0xd1c1('0x62')]};if(!_0x39af45[_0xd1c1('0x3a')]){_0x55ff55[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x55ff55);}else{return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate',_0xd1c1('0x63'),util[_0xd1c1('0x29')](_0x3dbffe[_0xd1c1('0x19')],{'showHidden':![],'depth':null}));}})[_0xd1c1('0x18')](function(_0x92d418){return logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x63'),util['inspect'](_0x92d418,{'showHidden':![],'depth':null}));});}else{logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd1c1('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x39af45[_0xd1c1('0x58')]){var _0x31e2de={'method':_0xd1c1('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x39af45[_0xd1c1('0x58')]},'body':{'content':_0x2d8543[_0xd1c1('0xe')],'to':[_0x2d8543['phone']],'from':_0x39af45[_0xd1c1('0x21')],'binary':![],'clientMessageId':_0xd1c1('0x64'),'charset':'UTF-8'},'json':!![]};rp(_0x31e2de)['then'](function(_0x3a8bb6){if(!_0x3a8bb6[_0xd1c1('0x19')]){var _0x5ddde9={'messageId':_0x3a8bb6[_0xd1c1('0x22')][0x0][_0xd1c1('0x65')]};if(!_0x39af45[_0xd1c1('0x3a')]){_0x5ddde9[_0xd1c1('0x3b')]=!![];}return _0x11fb14[_0xd1c1('0x3c')](_0x5ddde9);}else{return logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x66'),util[_0xd1c1('0x29')](_0x3a8bb6[_0xd1c1('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x57574b){return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate','clickatell',util[_0xd1c1('0x29')](_0x57574b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x66'),_0xd1c1('0x67'));}break;case _0xd1c1('0x68'):if(_0x39af45[_0xd1c1('0x2d')]&&_0x39af45[_0xd1c1('0x2e')]){var _0x5366b1=util[_0xd1c1('0x42')]('%s:%s',_0x39af45[_0xd1c1('0x2d')],_0x39af45[_0xd1c1('0x2e')]);var _0x5c4dad={'method':_0xd1c1('0x35'),'uri':_0xd1c1('0x69')+_0x39af45[_0xd1c1('0x6a')]+'/messages','body':{'to':[_0x2d8543[_0xd1c1('0x21')]],'text':_0x2d8543[_0xd1c1('0xe')],'from':_0x39af45[_0xd1c1('0x21')],'applicationId':_0x39af45['applicationId']},'headers':{'Authorization':util[_0xd1c1('0x42')](_0xd1c1('0x45'),new Buffer(_0x5366b1)[_0xd1c1('0x46')](_0xd1c1('0x47')))},'json':!![]};rp(_0x5c4dad)['then'](function(_0x5efc1f){if(_0x5efc1f['id']){var _0x35d149={'messageId':_0x5efc1f['id']};return _0x11fb14[_0xd1c1('0x3c')](_0x35d149);}else{logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x68'),util[_0xd1c1('0x29')](_0x5efc1f,{'showHidden':![],'depth':null}));}})[_0xd1c1('0x18')](function(_0x15820b){logger[_0xd1c1('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd1c1('0x28'),_0xd1c1('0x68'),util[_0xd1c1('0x29')](_0x15820b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd1c1('0x27'),_0xd1c1('0x28'),'bandwidth',_0xd1c1('0x4c'));}break;case _0xd1c1('0x6b'):if(_0x39af45[_0xd1c1('0x58')]){var _0x293534={};var _0x2b3a78={'method':_0xd1c1('0x35'),'uri':_0xd1c1('0x6c'),'headers':{'Authorization':_0xd1c1('0x6d')+_0x39af45['apiKey'],'Content-Type':_0xd1c1('0x6e')},'body':{'from':_0x39af45['phone'],'to':_0x2d8543['phone'],'text':_0x2d8543[_0xd1c1('0xe')]},'json':!![]};return rp(_0x2b3a78)[_0xd1c1('0x17')](function(_0x298955){if(_0x298955['code']==0xca){_0x293534[_0xd1c1('0x6f')]=_0x298955;var _0x3f8602={'method':_0xd1c1('0x35'),'uri':_0xd1c1('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x39af45['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x293534[_0xd1c1('0x6f')][_0xd1c1('0x71')]},'json':!![]};return rp(_0x3f8602)['then'](function(_0x450516){_0x293534['status']=_0x450516;var _0x302c27={'messageId':_0x293534[_0xd1c1('0x6f')]['refid'],'read':!![]};return _0x11fb14[_0xd1c1('0x3c')](_0x302c27);});}else{return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate',_0xd1c1('0x6b'),util[_0xd1c1('0x29')](_0x298955,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3701de){return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),'afterCreate',_0xd1c1('0x6b'),util[_0xd1c1('0x29')](_0x3701de,{'showHidden':![],'depth':null}));});}else{return logger[_0xd1c1('0x19')](_0xd1c1('0x27'),_0xd1c1('0x28'),_0xd1c1('0x6b'),_0xd1c1('0x72'));}break;}}})[_0xd1c1('0x73')](function(){_0x351d4b();});}else{_0x351d4b();}}},'charset':_0xd1c1('0x74'),'collate':_0xd1c1('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fef49f1..2836f63 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 _0xa54b=['request','then','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateSmsMessage','SmsMessage','body','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','register'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xa54b,0xc3));var _0xba54=function(_0x3c5413,_0xae780a){_0x3c5413=_0x3c5413-0x0;var _0x213299=_0xa54b[_0x3c5413];return _0x213299;};'use strict';var _=require(_0xba54('0x0'));var util=require(_0xba54('0x1'));var moment=require(_0xba54('0x2'));var BPromise=require(_0xba54('0x3'));var rs=require(_0xba54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba54('0x5'))['db'];var utils=require(_0xba54('0x6'));var logger=require(_0xba54('0x7'))(_0xba54('0x8'));var config=require(_0xba54('0x9'));var jayson=require(_0xba54('0xa'));var client=jayson['client'][_0xba54('0xb')]({'port':0x232a});config['redis']=_[_0xba54('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba54('0xd')]));require('./smsMessage.socket')[_0xba54('0xe')](socket);function respondWithRpcPromise(_0x132608,_0x36780c,_0x205a6d){return new BPromise(function(_0x507e33,_0x107ab6){return client[_0xba54('0xf')](_0x132608,_0x205a6d)[_0xba54('0x10')](function(_0x538882){logger['info']('SmsMessage,\x20%s,\x20%s',_0x36780c,'request\x20sent');logger[_0xba54('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x36780c,'request\x20sent',JSON[_0xba54('0x12')](_0x538882));if(_0x538882[_0xba54('0x13')]){if(_0x538882[_0xba54('0x13')]['code']===0x1f4){logger[_0xba54('0x13')](_0xba54('0x14'),_0x36780c,_0x538882[_0xba54('0x13')][_0xba54('0x15')]);return _0x107ab6(_0x538882['error'][_0xba54('0x15')]);}logger['error'](_0xba54('0x14'),_0x36780c,_0x538882[_0xba54('0x13')][_0xba54('0x15')]);return _0x507e33(_0x538882[_0xba54('0x13')][_0xba54('0x15')]);}else{logger[_0xba54('0x16')]('SmsMessage,\x20%s,\x20%s',_0x36780c,_0xba54('0x17'));_0x507e33(_0x538882[_0xba54('0x18')]['message']);}})[_0xba54('0x19')](function(_0x473e40){logger['error'](_0xba54('0x14'),_0x36780c,_0x473e40);_0x107ab6(_0x473e40);});});}exports[_0xba54('0x1a')]=function(_0x5ca833){var _0x515630=this;return new Promise(function(_0x213182,_0x11de9d){return db[_0xba54('0x1b')]['create'](_0x5ca833[_0xba54('0x1c')],{'raw':_0x5ca833['options']?_0x5ca833['options'][_0xba54('0x1d')]===undefined?!![]:![]:!![]})[_0xba54('0x10')](function(_0x5043db){logger[_0xba54('0x16')](_0xba54('0x1a'),_0x5ca833);logger['debug'](_0xba54('0x1a'),_0x5ca833,JSON[_0xba54('0x12')](_0x5043db));_0x213182(_0x5043db);})['catch'](function(_0xe304f7){logger[_0xba54('0x13')](_0xba54('0x1a'),_0xe304f7[_0xba54('0x15')],_0x5ca833);_0x11de9d(_0x515630[_0xba54('0x13')](0x1f4,_0xe304f7[_0xba54('0x15')]));});});}; \ No newline at end of file +var _0x19fc=['socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x19fc,0x114));var _0xc19f=function(_0x155bbf,_0x1bca34){_0x155bbf=_0x155bbf-0x0;var _0x1cb0ac=_0x19fc[_0x155bbf];return _0x1cb0ac;};'use strict';var _=require('lodash');var util=require(_0xc19f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc19f('0x1'));var fs=require('fs');var Redis=require(_0xc19f('0x2'));var db=require(_0xc19f('0x3'))['db'];var utils=require(_0xc19f('0x4'));var logger=require(_0xc19f('0x5'))('rpc');var config=require(_0xc19f('0x6'));var jayson=require(_0xc19f('0x7'));var client=jayson[_0xc19f('0x8')][_0xc19f('0x9')]({'port':0x232a});config[_0xc19f('0xa')]=_['defaults'](config['redis'],{'host':_0xc19f('0xb'),'port':0x18eb});var socket=require(_0xc19f('0xc'))(new Redis(config[_0xc19f('0xa')]));require(_0xc19f('0xd'))[_0xc19f('0xe')](socket);function respondWithRpcPromise(_0x1c3cd2,_0x32054b,_0xecfcb0){return new BPromise(function(_0x48f0be,_0x446b96){return client[_0xc19f('0xf')](_0x1c3cd2,_0xecfcb0)['then'](function(_0x565884){logger[_0xc19f('0x10')](_0xc19f('0x11'),_0x32054b,_0xc19f('0x12'));logger[_0xc19f('0x13')](_0xc19f('0x14'),_0x32054b,_0xc19f('0x12'),JSON['stringify'](_0x565884));if(_0x565884['error']){if(_0x565884[_0xc19f('0x15')][_0xc19f('0x16')]===0x1f4){logger['error'](_0xc19f('0x11'),_0x32054b,_0x565884[_0xc19f('0x15')]['message']);return _0x446b96(_0x565884[_0xc19f('0x15')][_0xc19f('0x17')]);}logger[_0xc19f('0x15')](_0xc19f('0x11'),_0x32054b,_0x565884['error'][_0xc19f('0x17')]);return _0x48f0be(_0x565884['error']['message']);}else{logger[_0xc19f('0x10')](_0xc19f('0x11'),_0x32054b,_0xc19f('0x12'));_0x48f0be(_0x565884['result'][_0xc19f('0x17')]);}})['catch'](function(_0xbe4c04){logger[_0xc19f('0x15')]('SmsMessage,\x20%s,\x20%s',_0x32054b,_0xbe4c04);_0x446b96(_0xbe4c04);});});}exports[_0xc19f('0x18')]=function(_0x320a85){var _0x2f6ad2=this;return new Promise(function(_0x48e68a,_0x3b3e0f){return db[_0xc19f('0x19')][_0xc19f('0x1a')](_0x320a85[_0xc19f('0x1b')],{'raw':_0x320a85[_0xc19f('0x1c')]?_0x320a85['options'][_0xc19f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xcaedfc){logger[_0xc19f('0x10')](_0xc19f('0x18'),_0x320a85);logger[_0xc19f('0x13')](_0xc19f('0x18'),_0x320a85,JSON[_0xc19f('0x1e')](_0xcaedfc));_0x48e68a(_0xcaedfc);})[_0xc19f('0x1f')](function(_0x4f3224){logger[_0xc19f('0x15')]('CreateSmsMessage',_0x4f3224[_0xc19f('0x17')],_0x320a85);_0x3b3e0f(_0x2f6ad2['error'](0x1f4,_0x4f3224['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b9f2916..7bcbb2d 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 _0xe954=['removeListener','register','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0xe954,0x1e3));var _0x4e95=function(_0x5413b3,_0x9fa66c){_0x5413b3=_0x5413b3-0x0;var _0x327685=_0xe954[_0x5413b3];return _0x327685;};'use strict';var SmsMessageEvents=require(_0x4e95('0x0'));var events=[_0x4e95('0x1'),_0x4e95('0x2'),_0x4e95('0x3')];function createListener(_0x431db0,_0x36a321){return function(_0x3cd1b4){_0x36a321[_0x4e95('0x4')](_0x431db0,_0x3cd1b4);};}function removeListener(_0x3fb312,_0xf9bbe7){return function(){SmsMessageEvents[_0x4e95('0x5')](_0x3fb312,_0xf9bbe7);};}exports[_0x4e95('0x6')]=function(_0x275f0f){for(var _0x3f1a71=0x0,_0x5c9e89=events['length'];_0x3f1a71<_0x5c9e89;_0x3f1a71++){var _0x3f74ef=events[_0x3f1a71];var _0x207e80=createListener(_0x4e95('0x7')+_0x3f74ef,_0x275f0f);SmsMessageEvents['on'](_0x3f74ef,_0x207e80);}}; \ No newline at end of file +var _0x8183=['register','length','save','remove','update','emit','removeListener'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0x8183,0xd4));var _0x3818=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8183[_0x53ccf2];return _0x5a2964;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x3818('0x0'),_0x3818('0x1'),_0x3818('0x2')];function createListener(_0xfa5abd,_0x16d1c6){return function(_0x456d0e){_0x16d1c6[_0x3818('0x3')](_0xfa5abd,_0x456d0e);};}function removeListener(_0x536e1f,_0x79bcb7){return function(){SmsMessageEvents[_0x3818('0x4')](_0x536e1f,_0x79bcb7);};}exports[_0x3818('0x5')]=function(_0x1a6da7){for(var _0x2c8d98=0x0,_0x4c8f9d=events[_0x3818('0x6')];_0x2c8d98<_0x4c8f9d;_0x2c8d98++){var _0x3cd8c0=events[_0x2c8d98];var _0x380c65=createListener('smsMessage:'+_0x3cd8c0,_0x1a6da7);SmsMessageEvents['on'](_0x3cd8c0,_0x380c65);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9499c6d..8c95a1b 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 _0x7e91=['getAgents','post','create','put','/:id','update','delete','destroy','removeTeams','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','describe','show','get','/:id/members','getMembers','/:id/teams','/:id/users'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7e91,0x18f));var _0x17e9=function(_0x3644c9,_0x344521){_0x3644c9=_0x3644c9-0x0;var _0x1e5ae8=_0x7e91[_0x3644c9];return _0x1e5ae8;};'use strict';var multer=require('multer');var util=require(_0x17e9('0x0'));var path=require(_0x17e9('0x1'));var timeout=require(_0x17e9('0x2'));var express=require('express');var router=express[_0x17e9('0x3')]();var fs_extra=require(_0x17e9('0x4'));var auth=require(_0x17e9('0x5'));var interaction=require(_0x17e9('0x6'));var config=require(_0x17e9('0x7'));var controller=require(_0x17e9('0x8'));router['get']('/',auth[_0x17e9('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x17e9('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x17e9('0xb')]);router[_0x17e9('0xc')](_0x17e9('0xd'),auth['isAuthenticated'](),controller[_0x17e9('0xe')]);router[_0x17e9('0xc')](_0x17e9('0xf'),auth[_0x17e9('0x9')](),controller['getTeams']);router[_0x17e9('0xc')](_0x17e9('0x10'),auth['isAuthenticated'](),controller[_0x17e9('0x11')]);router[_0x17e9('0x12')]('/',auth[_0x17e9('0x9')](),controller[_0x17e9('0x13')]);router[_0x17e9('0x12')](_0x17e9('0xf'),auth[_0x17e9('0x9')](),controller['addTeams']);router['post'](_0x17e9('0x10'),auth[_0x17e9('0x9')](),controller['addAgents']);router[_0x17e9('0x14')](_0x17e9('0x15'),auth['isAuthenticated'](),controller[_0x17e9('0x16')]);router[_0x17e9('0x17')](_0x17e9('0x15'),auth[_0x17e9('0x9')](),controller[_0x17e9('0x18')]);router[_0x17e9('0x17')](_0x17e9('0xf'),auth[_0x17e9('0x9')](),controller[_0x17e9('0x19')]);router[_0x17e9('0x17')](_0x17e9('0x10'),auth[_0x17e9('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf6cb=['/:id','update','delete','destroy','/:id/users','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','post','create'];(function(_0x2a4c8d,_0x3f8d0e){var _0x413461=function(_0x43e00d){while(--_0x43e00d){_0x2a4c8d['push'](_0x2a4c8d['shift']());}};_0x413461(++_0x3f8d0e);}(_0xf6cb,0xb5));var _0xbf6c=function(_0xeb4d7a,_0x29f0d8){_0xeb4d7a=_0xeb4d7a-0x0;var _0x473ce4=_0xf6cb[_0xeb4d7a];return _0x473ce4;};'use strict';var multer=require('multer');var util=require(_0xbf6c('0x0'));var path=require(_0xbf6c('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf6c('0x2'));var router=express[_0xbf6c('0x3')]();var fs_extra=require(_0xbf6c('0x4'));var auth=require(_0xbf6c('0x5'));var interaction=require(_0xbf6c('0x6'));var config=require(_0xbf6c('0x7'));var controller=require(_0xbf6c('0x8'));router[_0xbf6c('0x9')]('/',auth[_0xbf6c('0xa')](),controller['index']);router['get'](_0xbf6c('0xb'),auth[_0xbf6c('0xa')](),controller['describe']);router[_0xbf6c('0x9')]('/:id',auth[_0xbf6c('0xa')](),controller[_0xbf6c('0xc')]);router[_0xbf6c('0x9')](_0xbf6c('0xd'),auth['isAuthenticated'](),controller[_0xbf6c('0xe')]);router[_0xbf6c('0x9')](_0xbf6c('0xf'),auth[_0xbf6c('0xa')](),controller[_0xbf6c('0x10')]);router[_0xbf6c('0x9')]('/:id/users',auth[_0xbf6c('0xa')](),controller['getAgents']);router[_0xbf6c('0x11')]('/',auth[_0xbf6c('0xa')](),controller[_0xbf6c('0x12')]);router['post'](_0xbf6c('0xf'),auth[_0xbf6c('0xa')](),controller['addTeams']);router[_0xbf6c('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xbf6c('0x13'),auth[_0xbf6c('0xa')](),controller[_0xbf6c('0x14')]);router[_0xbf6c('0x15')](_0xbf6c('0x13'),auth[_0xbf6c('0xa')](),controller[_0xbf6c('0x16')]);router[_0xbf6c('0x15')](_0xbf6c('0xf'),auth[_0xbf6c('0xa')](),controller['removeTeams']);router['delete'](_0xbf6c('0x17'),auth[_0xbf6c('0xa')](),controller['removeAgents']);module[_0xbf6c('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6bfeebe..7f713dc 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 _0x06a5=['STRING','name','INTEGER','ENUM','rrmemory','beepall','exports'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x06a5,0xf4));var _0x506a=function(_0x3e3b4e,_0x2a974b){_0x3e3b4e=_0x3e3b4e-0x0;var _0x1e434b=_0x06a5[_0x3e3b4e];return _0x1e434b;};'use strict';var Sequelize=require('sequelize');module[_0x506a('0x0')]={'name':{'type':Sequelize[_0x506a('0x1')],'unique':_0x506a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x506a('0x1')]},'timeout':{'type':Sequelize[_0x506a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x506a('0x4')](_0x506a('0x5'),_0x506a('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x5764=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1b7515,_0x3a5876){var _0xf317e4=function(_0x593c2c){while(--_0x593c2c){_0x1b7515['push'](_0x1b7515['shift']());}};_0xf317e4(++_0x3a5876);}(_0x5764,0x160));var _0x4576=function(_0x4c5ea1,_0x20981a){_0x4c5ea1=_0x4c5ea1-0x0;var _0x3d7e26=_0x5764[_0x4c5ea1];return _0x3d7e26;};'use strict';var Sequelize=require(_0x4576('0x0'));module[_0x4576('0x1')]={'name':{'type':Sequelize[_0x4576('0x2')],'unique':_0x4576('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4576('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4576('0x5')](_0x4576('0x6'),_0x4576('0x7'),_0x4576('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 9d90cc7..e9fb7bb 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 _0xd39b=['Content-Range','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','merge','map','type','filter','options','includeAll','include','findAll','SmsQueue','rawAttributes','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','nolimit','order','sort','pick','SmsQueueId','User','findAndCountAll','UserId','updatedAt','rows','format','%s/%s','SIP','smsPause','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','UserSmsQueue','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','includes','all','union','compact','removeAgents','forEach','userSmsQueue:remove','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd39b,0x181));var _0xbd39=function(_0x54afe3,_0x258ce5){_0x54afe3=_0x54afe3-0x0;var _0x3e76d6=_0xd39b[_0x54afe3];return _0x3e76d6;};'use strict';var emlformat=require(_0xbd39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd39('0x1'));var jsonpatch=require(_0xbd39('0x2'));var rp=require(_0xbd39('0x3'));var moment=require('moment');var BPromise=require(_0xbd39('0x4'));var Mustache=require(_0xbd39('0x5'));var util=require(_0xbd39('0x6'));var path=require('path');var sox=require(_0xbd39('0x7'));var csv=require(_0xbd39('0x8'));var ejs=require(_0xbd39('0x9'));var fs=require('fs');var fs_extra=require(_0xbd39('0xa'));var _=require('lodash');var squel=require(_0xbd39('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd39('0xc'));var deskjs=require(_0xbd39('0xd'));var toCsv=require(_0xbd39('0x8'));var querystring=require(_0xbd39('0xe'));var Papa=require(_0xbd39('0xf'));var Redis=require(_0xbd39('0x10'));var authService=require(_0xbd39('0x11'));var qs=require(_0xbd39('0x12'));var as=require(_0xbd39('0x13'));var hardwareService=require(_0xbd39('0x14'));var logger=require(_0xbd39('0x15'))(_0xbd39('0x16'));var utils=require('../../config/utils');var config=require(_0xbd39('0x17'));var licenseUtil=require(_0xbd39('0x18'));var db=require(_0xbd39('0x19'))['db'];config[_0xbd39('0x1a')]=_[_0xbd39('0x1b')](config[_0xbd39('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd39('0x1a')]));require(_0xbd39('0x1c'))['register'](socket);function respondWithStatusCode(_0x493adc,_0x8896c4){_0x8896c4=_0x8896c4||0xcc;return function(_0x59ee91){if(_0x59ee91){return _0x493adc[_0xbd39('0x1d')](_0x8896c4);}return _0x493adc[_0xbd39('0x1e')](_0x8896c4)[_0xbd39('0x1f')]();};}function respondWithResult(_0x142e08,_0x1e1e8a){_0x1e1e8a=_0x1e1e8a||0xc8;return function(_0x88d4b0){if(_0x88d4b0){return _0x142e08[_0xbd39('0x1e')](_0x1e1e8a)[_0xbd39('0x20')](_0x88d4b0);}};}function respondWithFilteredResult(_0x38f359,_0x5a4ef8){return function(_0x4fb2ca){if(_0x4fb2ca){var _0x5b69d6=typeof _0x5a4ef8[_0xbd39('0x21')]===_0xbd39('0x22')&&typeof _0x5a4ef8[_0xbd39('0x23')]===_0xbd39('0x22');var _0x5ebafa=_0x4fb2ca[_0xbd39('0x24')];var _0x50a717=_0x5b69d6?0x0:_0x5a4ef8[_0xbd39('0x21')];var _0x282212=_0x5b69d6?_0x4fb2ca['count']:_0x5a4ef8[_0xbd39('0x21')]+_0x5a4ef8[_0xbd39('0x23')];var _0x58fd7e;if(_0x282212>=_0x5ebafa){_0x282212=_0x5ebafa;_0x58fd7e=0xc8;}else{_0x58fd7e=0xce;}_0x38f359[_0xbd39('0x1e')](_0x58fd7e);return _0x38f359[_0xbd39('0x25')](_0xbd39('0x26'),_0x50a717+'-'+_0x282212+'/'+_0x5ebafa)[_0xbd39('0x20')](_0x4fb2ca);}return null;};}function patchUpdates(_0x4820f2){return function(_0x1422ab){try{jsonpatch[_0xbd39('0x27')](_0x1422ab,_0x4820f2,!![]);}catch(_0x257f74){return BPromise['reject'](_0x257f74);}return _0x1422ab[_0xbd39('0x28')]();};}function saveUpdates(_0x15a9ca,_0x455421){return function(_0x15d829){if(_0x15d829){return _0x15d829[_0xbd39('0x29')](_0x15a9ca)[_0xbd39('0x2a')](function(_0x46ebca){return _0x46ebca;});}return null;};}function removeEntity(_0x217503,_0x3e3928){return function(_0xf1a254){if(_0xf1a254){return _0xf1a254[_0xbd39('0x2b')]()[_0xbd39('0x2a')](function(){var _0x430352=_0xf1a254[_0xbd39('0x2c')]({'plain':!![]});var _0x284b7a=_0xbd39('0x2d');return db[_0xbd39('0x2e')]['destroy']({'where':{'type':_0x284b7a,'resourceId':_0x430352['id']}})[_0xbd39('0x2a')](function(){return _0xf1a254;});})[_0xbd39('0x2a')](function(){_0x217503['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21fa24,_0x1690d3){return function(_0x408e87){if(!_0x408e87){_0x21fa24['sendStatus'](0x194);}return _0x408e87;};}function handleError(_0x2a4f12,_0x4c13a0){_0x4c13a0=_0x4c13a0||0x1f4;return function(_0x39b377){logger[_0xbd39('0x2f')](_0x39b377[_0xbd39('0x30')]);if(_0x39b377[_0xbd39('0x31')]){delete _0x39b377['name'];}_0x2a4f12[_0xbd39('0x1e')](_0x4c13a0)[_0xbd39('0x32')](_0x39b377);};}exports[_0xbd39('0x33')]=function(_0x250ea6,_0x14aa78){var _0x4058ed={},_0x5d2086={},_0x587840={'count':0x0,'rows':[]};var _0x2f338c=_['map'](db['SmsQueue']['rawAttributes'],function(_0x5306cf){return{'name':_0x5306cf[_0xbd39('0x34')],'type':_0x5306cf['type']['key']};});_0x5d2086[_0xbd39('0x35')]=_['map'](_0x2f338c,'name');_0x5d2086[_0xbd39('0x36')]=_[_0xbd39('0x37')](_0x250ea6[_0xbd39('0x36')]);_0x5d2086[_0xbd39('0x38')]=_[_0xbd39('0x39')](_0x5d2086['model'],_0x5d2086[_0xbd39('0x36')]);_0x4058ed[_0xbd39('0x3a')]=_[_0xbd39('0x39')](_0x5d2086[_0xbd39('0x35')],qs[_0xbd39('0x3b')](_0x250ea6[_0xbd39('0x36')][_0xbd39('0x3b')]));_0x4058ed[_0xbd39('0x3a')]=_0x4058ed[_0xbd39('0x3a')][_0xbd39('0x3c')]?_0x4058ed[_0xbd39('0x3a')]:_0x5d2086[_0xbd39('0x35')];if(!_0x250ea6[_0xbd39('0x36')][_0xbd39('0x3d')]('nolimit')){_0x4058ed[_0xbd39('0x23')]=qs['limit'](_0x250ea6['query'][_0xbd39('0x23')]);_0x4058ed[_0xbd39('0x21')]=qs[_0xbd39('0x21')](_0x250ea6[_0xbd39('0x36')][_0xbd39('0x21')]);}_0x4058ed['order']=qs['sort'](_0x250ea6[_0xbd39('0x36')]['sort']);_0x4058ed[_0xbd39('0x3e')]=qs['filters'](_['pick'](_0x250ea6[_0xbd39('0x36')],_0x5d2086['filters']),_0x2f338c);if(_0x250ea6[_0xbd39('0x36')]['filter']){_0x4058ed['where']=_[_0xbd39('0x3f')](_0x4058ed[_0xbd39('0x3e')],{'$or':_[_0xbd39('0x40')](_0x2f338c,function(_0x59ad75){if(_0x59ad75[_0xbd39('0x41')]!=='VIRTUAL'){var _0x2c8fe2={};_0x2c8fe2[_0x59ad75[_0xbd39('0x31')]]={'$like':'%'+_0x250ea6[_0xbd39('0x36')][_0xbd39('0x42')]+'%'};return _0x2c8fe2;}})});}_0x4058ed=_[_0xbd39('0x3f')]({},_0x4058ed,_0x250ea6[_0xbd39('0x43')]);var _0x4f590f={'where':_0x4058ed[_0xbd39('0x3e')]};return db['SmsQueue']['count'](_0x4f590f)[_0xbd39('0x2a')](function(_0x35392a){_0x587840[_0xbd39('0x24')]=_0x35392a;if(_0x250ea6['query'][_0xbd39('0x44')]){_0x4058ed[_0xbd39('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xbd39('0x46')](_0x4058ed);})['then'](function(_0xd7ae9d){_0x587840['rows']=_0xd7ae9d;return _0x587840;})[_0xbd39('0x2a')](respondWithFilteredResult(_0x14aa78,_0x4058ed))['catch'](handleError(_0x14aa78,null));};exports['show']=function(_0x1b9e5f,_0x476e0a){var _0x5ecc22={'raw':!![],'where':{'id':_0x1b9e5f['params']['id']}},_0x293cd1={};_0x293cd1[_0xbd39('0x35')]=_[_0xbd39('0x37')](db[_0xbd39('0x47')][_0xbd39('0x48')]);_0x293cd1[_0xbd39('0x36')]=_['keys'](_0x1b9e5f[_0xbd39('0x36')]);_0x293cd1[_0xbd39('0x38')]=_[_0xbd39('0x39')](_0x293cd1[_0xbd39('0x35')],_0x293cd1[_0xbd39('0x36')]);_0x5ecc22[_0xbd39('0x3a')]=_[_0xbd39('0x39')](_0x293cd1[_0xbd39('0x35')],qs[_0xbd39('0x3b')](_0x1b9e5f[_0xbd39('0x36')][_0xbd39('0x3b')]));_0x5ecc22[_0xbd39('0x3a')]=_0x5ecc22[_0xbd39('0x3a')][_0xbd39('0x3c')]?_0x5ecc22[_0xbd39('0x3a')]:_0x293cd1[_0xbd39('0x35')];if(_0x1b9e5f[_0xbd39('0x36')]['includeAll']){_0x5ecc22[_0xbd39('0x45')]=[{'all':!![]}];}_0x5ecc22=_[_0xbd39('0x3f')]({},_0x5ecc22,_0x1b9e5f[_0xbd39('0x43')]);return db[_0xbd39('0x47')][_0xbd39('0x49')](_0x5ecc22)['then'](handleEntityNotFound(_0x476e0a,null))[_0xbd39('0x2a')](respondWithResult(_0x476e0a,null))[_0xbd39('0x4a')](handleError(_0x476e0a,null));};exports[_0xbd39('0x4b')]=function(_0x4ca7ba,_0x294533){return db[_0xbd39('0x47')][_0xbd39('0x4b')](_0x4ca7ba[_0xbd39('0x4c')],{})[_0xbd39('0x2a')](function(_0x521162){var _0x22c8b8=_0x4ca7ba['user'][_0xbd39('0x2c')]({'plain':!![]});if(!_0x22c8b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22c8b8[_0xbd39('0x4d')]===_0xbd39('0x4e')){var _0x367960=_0x521162['get']({'plain':!![]});var _0x277d92=_0xbd39('0x2d');return db[_0xbd39('0x4f')][_0xbd39('0x49')]({'where':{'name':_0x277d92,'userProfileId':_0x22c8b8[_0xbd39('0x50')]},'raw':!![]})['then'](function(_0x77dfd2){if(_0x77dfd2&&_0x77dfd2[_0xbd39('0x51')]===0x0){return db['UserProfileResource'][_0xbd39('0x4b')]({'name':_0x367960[_0xbd39('0x31')],'resourceId':_0x367960['id'],'type':_0x77dfd2[_0xbd39('0x31')],'sectionId':_0x77dfd2['id']},{})[_0xbd39('0x2a')](function(){return _0x521162;});}else{return _0x521162;}})[_0xbd39('0x4a')](function(_0x42d892){logger[_0xbd39('0x2f')](_0xbd39('0x52'),_0x42d892);throw _0x42d892;});}return _0x521162;})[_0xbd39('0x2a')](respondWithResult(_0x294533,0xc9))[_0xbd39('0x4a')](handleError(_0x294533,null));};exports[_0xbd39('0x29')]=function(_0x14080a,_0xd1c9d9){if(_0x14080a['body']['id']){delete _0x14080a[_0xbd39('0x4c')]['id'];}return db[_0xbd39('0x47')][_0xbd39('0x49')]({'where':{'id':_0x14080a[_0xbd39('0x53')]['id']}})['then'](handleEntityNotFound(_0xd1c9d9,null))[_0xbd39('0x2a')](saveUpdates(_0x14080a['body'],null))[_0xbd39('0x2a')](respondWithResult(_0xd1c9d9,null))['catch'](handleError(_0xd1c9d9,null));};exports['destroy']=function(_0x1ad201,_0x3d1937){return db[_0xbd39('0x47')]['find']({'where':{'id':_0x1ad201[_0xbd39('0x53')]['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x3d1937,null))[_0xbd39('0x2a')](removeEntity(_0x3d1937,null))['catch'](handleError(_0x3d1937,null));};exports[_0xbd39('0x54')]=function(_0x30c7ad,_0x4eb83f){return db[_0xbd39('0x47')][_0xbd39('0x54')]()[_0xbd39('0x2a')](respondWithResult(_0x4eb83f,null))['catch'](handleError(_0x4eb83f,null));};exports[_0xbd39('0x55')]=function(_0x2c1e6a,_0x3e17af,_0xbfc043){var _0x18f5af={'raw':!![],'where':{}},_0x1c7b78={},_0x29f862;return db[_0xbd39('0x47')][_0xbd39('0x56')]({'where':{'id':_0x2c1e6a[_0xbd39('0x53')]['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x3e17af,null))[_0xbd39('0x2a')](function(_0x35c6f6){if(_0x35c6f6){_0x29f862=_0x35c6f6[_0xbd39('0x2c')]({'plain':!![]});_0x1c7b78[_0xbd39('0x35')]=_[_0xbd39('0x37')](db['UserSmsQueue']['rawAttributes']);_0x1c7b78[_0xbd39('0x36')]=_[_0xbd39('0x37')](_0x2c1e6a[_0xbd39('0x36')]);_0x1c7b78['filters']=_[_0xbd39('0x39')](_0x1c7b78['model'],_0x1c7b78[_0xbd39('0x36')]);_0x18f5af[_0xbd39('0x3a')]=_[_0xbd39('0x39')](_0x1c7b78[_0xbd39('0x35')],qs[_0xbd39('0x3b')](_0x2c1e6a[_0xbd39('0x36')]['fields']));_0x18f5af[_0xbd39('0x3a')]=_0x18f5af[_0xbd39('0x3a')][_0xbd39('0x3c')]?_0x18f5af[_0xbd39('0x3a')]:_0x1c7b78[_0xbd39('0x35')];if(!_0x2c1e6a['query']['hasOwnProperty'](_0xbd39('0x57'))){_0x18f5af[_0xbd39('0x23')]=qs['limit'](_0x2c1e6a[_0xbd39('0x36')][_0xbd39('0x23')]);_0x18f5af[_0xbd39('0x21')]=qs['offset'](_0x2c1e6a[_0xbd39('0x36')][_0xbd39('0x21')]);}_0x18f5af[_0xbd39('0x58')]=qs[_0xbd39('0x59')](_0x2c1e6a[_0xbd39('0x36')][_0xbd39('0x59')]);_0x18f5af[_0xbd39('0x3e')]=qs[_0xbd39('0x38')](_[_0xbd39('0x5a')](_0x2c1e6a[_0xbd39('0x36')],_0x1c7b78['filters']));_0x18f5af[_0xbd39('0x3e')][_0xbd39('0x5b')]=_0x35c6f6['id'];if(_0x2c1e6a[_0xbd39('0x36')][_0xbd39('0x42')]){_0x18f5af[_0xbd39('0x3e')]=_[_0xbd39('0x3f')](_0x18f5af[_0xbd39('0x3e')],{'$or':_[_0xbd39('0x40')](_0x18f5af[_0xbd39('0x3a')],function(_0x3df1e3){var _0x481699={};_0x481699[_0x3df1e3]={'$like':'%'+_0x2c1e6a[_0xbd39('0x36')][_0xbd39('0x42')]+'%'};return _0x481699;})});}_0x18f5af=_[_0xbd39('0x3f')]({},_0x18f5af,_0x2c1e6a[_0xbd39('0x43')]);return db['UserSmsQueue'][_0xbd39('0x46')](_0x18f5af);}})[_0xbd39('0x2a')](function(_0x16c153){if(_0x16c153){return db[_0xbd39('0x5c')][_0xbd39('0x5d')]({'where':{'id':_['map'](_0x16c153,_0xbd39('0x5e')),'role':'agent'},'attributes':['id',_0xbd39('0x31'),'smsPause',_0xbd39('0x5f'),'createdAt']});}})[_0xbd39('0x2a')](function(_0x20255f){if(_0x20255f){return{'count':_0x20255f[_0xbd39('0x24')],'rows':_[_0xbd39('0x40')](_0x20255f[_0xbd39('0x60')],function(_0x182217){return{'membername':_0x182217[_0xbd39('0x31')],'UserId':_0x182217['id'],'queue_name':_0x29f862['name'],'SmsQueueId':_0x29f862['id'],'interface':util[_0xbd39('0x61')](_0xbd39('0x62'),_0xbd39('0x63'),_0x182217[_0xbd39('0x31')]),'penalty':0x0,'paused':_0x182217[_0xbd39('0x64')],'createdAt':_0x182217[_0xbd39('0x65')],'updatedAt':_0x182217[_0xbd39('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbd39('0x2a')](respondWithFilteredResult(_0x3e17af,_0x18f5af))[_0xbd39('0x4a')](handleError(_0x3e17af,null));};exports[_0xbd39('0x66')]=function(_0x358d18,_0x593e86,_0x4e1acd){var _0x3843ff={};var _0x5c2405={};var _0x4c3b6b;var _0x3ab48f;return db[_0xbd39('0x47')][_0xbd39('0x56')]({'where':{'id':_0x358d18[_0xbd39('0x53')]['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x593e86,null))['then'](function(_0x569f66){if(_0x569f66){_0x4c3b6b=_0x569f66;_0x5c2405[_0xbd39('0x35')]=_['keys'](db[_0xbd39('0x67')][_0xbd39('0x48')]);_0x5c2405[_0xbd39('0x36')]=_[_0xbd39('0x37')](_0x358d18['query']);_0x5c2405[_0xbd39('0x38')]=_[_0xbd39('0x39')](_0x5c2405[_0xbd39('0x35')],_0x5c2405['query']);_0x3843ff[_0xbd39('0x3a')]=_[_0xbd39('0x39')](_0x5c2405[_0xbd39('0x35')],qs[_0xbd39('0x3b')](_0x358d18[_0xbd39('0x36')][_0xbd39('0x3b')]));_0x3843ff[_0xbd39('0x3a')]=_0x3843ff[_0xbd39('0x3a')][_0xbd39('0x3c')]?_0x3843ff['attributes']:_0x5c2405[_0xbd39('0x35')];_0x3843ff['order']=qs[_0xbd39('0x59')](_0x358d18[_0xbd39('0x36')]['sort']);_0x3843ff[_0xbd39('0x3e')]=qs['filters'](_['pick'](_0x358d18[_0xbd39('0x36')],_0x5c2405['filters']));if(_0x358d18[_0xbd39('0x36')]['filter']){_0x3843ff[_0xbd39('0x3e')]=_['merge'](_0x3843ff[_0xbd39('0x3e')],{'$or':_[_0xbd39('0x40')](_0x3843ff[_0xbd39('0x3a')],function(_0x4eec47){var _0x23ea70={};_0x23ea70[_0x4eec47]={'$like':'%'+_0x358d18[_0xbd39('0x36')][_0xbd39('0x42')]+'%'};return _0x23ea70;})});}_0x3843ff=_[_0xbd39('0x3f')]({},_0x3843ff,_0x358d18[_0xbd39('0x43')]);return _0x4c3b6b['getTeams'](_0x3843ff);}})[_0xbd39('0x2a')](function(_0x5f393e){if(_0x5f393e){_0x3ab48f=_0x5f393e[_0xbd39('0x3c')];if(!_0x358d18[_0xbd39('0x36')][_0xbd39('0x3d')](_0xbd39('0x57'))){_0x3843ff[_0xbd39('0x23')]=qs[_0xbd39('0x23')](_0x358d18[_0xbd39('0x36')][_0xbd39('0x23')]);_0x3843ff[_0xbd39('0x21')]=qs[_0xbd39('0x21')](_0x358d18[_0xbd39('0x36')][_0xbd39('0x21')]);}return _0x4c3b6b[_0xbd39('0x66')](_0x3843ff);}})[_0xbd39('0x2a')](function(_0x144736){if(_0x144736){return _0x144736?{'count':_0x3ab48f,'rows':_0x144736}:null;}})[_0xbd39('0x2a')](respondWithResult(_0x593e86,null))['catch'](handleError(_0x593e86,null));};exports['addTeams']=function(_0x19281d,_0x580792,_0x492930){var _0x58f277=_0x19281d[_0xbd39('0x4c')][_0xbd39('0x68')];return db['Team'][_0xbd39('0x46')]({'where':{'id':_0x58f277},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbd39('0x69'),'attributes':['id','name',_0xbd39('0x6a'),_0xbd39('0x6b'),_0xbd39('0x6c')],'raw':!![]}]})[_0xbd39('0x2a')](function(_0x5b9c3b){if(_0x5b9c3b){var _0x230eae=_[_0xbd39('0x6d')](_0x5b9c3b,function(_0x4447c8){var _0x5b316f=_0x4447c8[_0xbd39('0x2c')]({'plain':!![]});return _0x5b316f['Agents'];});return db[_0xbd39('0x47')][_0xbd39('0x49')]({'where':{'id':_0x19281d[_0xbd39('0x53')]['id']}})[_0xbd39('0x2a')](function(_0x4ba444){return db['sequelize'][_0xbd39('0x6e')](function(_0x230f72){return _0x4ba444[_0xbd39('0x6f')](_0x58f277,{'transaction':_0x230f72})[_0xbd39('0x2a')](function(){return BPromise[_0xbd39('0x70')](_0x230eae,function(_0x28f8d4){return db[_0xbd39('0x71')]['findOrCreate']({'where':{'UserId':_0x28f8d4['id'],'SmsQueueId':_0x19281d['params']['id']},'transaction':_0x230f72});});})['then'](function(){_0x230eae['forEach'](function(_0x19b590){socket[_0xbd39('0x72')](_0xbd39('0x73'),{'UserId':_0x19b590['id'],'SmsQueueId':_0x4ba444['id']});});});});});}})['then'](respondWithStatusCode(_0x580792,null))[_0xbd39('0x4a')](handleError(_0x580792,null));};exports[_0xbd39('0x74')]=function(_0x470ffd,_0x1fbfde,_0x567c2a){return db[_0xbd39('0x67')]['findAll']({'where':{'id':_0x470ffd[_0xbd39('0x36')][_0xbd39('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbd39('0x69'),'attributes':['id'],'raw':!![]}]})[_0xbd39('0x2a')](handleEntityNotFound(_0x1fbfde,null))['then'](function(_0x2e6594){var _0x12e202=_[_0xbd39('0x40')](_0x2e6594,'id');var _0x5698c4=[];var _0x1e9f44=[];var _0x521dce=squel[_0xbd39('0x75')]();_0x521dce[_0xbd39('0x76')](_0xbd39('0x77'))[_0xbd39('0x78')](_0xbd39('0x79'),'tq')[_0xbd39('0x7a')]('user_has_teams','ut',_0xbd39('0x7b'))[_0xbd39('0x3e')](_0xbd39('0x7c'),_0x470ffd[_0xbd39('0x53')]['id']);for(var _0x304924=0x0;_0x304924<_0x2e6594[_0xbd39('0x3c')];_0x304924+=0x1){let _0xb18e11=_0x2e6594[_0x304924];for(var _0x4cf5b3=0x0;_0x4cf5b3<_0xb18e11[_0xbd39('0x69')][_0xbd39('0x3c')];_0x4cf5b3+=0x1){let _0x375e82=_0xb18e11[_0xbd39('0x69')][_0x4cf5b3];var _0x67e885=_0x521dce[_0xbd39('0x7d')]();_0x67e885[_0xbd39('0x3e')](_0xbd39('0x7e'),_0x375e82['id']);_0x1e9f44['push'](db[_0xbd39('0x7f')][_0xbd39('0x36')](_0x67e885[_0xbd39('0x80')](),{'type':db[_0xbd39('0x7f')]['QueryTypes'][_0xbd39('0x81')]})[_0xbd39('0x2a')](function(_0x3502a4){if(_0x3502a4[_0xbd39('0x3c')]===0x1){return _0x375e82['id'];}else{var _0xea7b47=_[_0xbd39('0x82')](_[_0xbd39('0x40')](_0x3502a4,'TeamId'),function(_0x4a5a43){return _[_0xbd39('0x83')](_0x12e202,_0x4a5a43);});if(_0xea7b47){return _0x375e82['id'];}}}));}}return BPromise[_0xbd39('0x84')](_0x1e9f44)[_0xbd39('0x2a')](function(_0x59b283){_0x5698c4=_(_0x5698c4)[_0xbd39('0x85')](_0x59b283)[_0xbd39('0x86')]()['value']();return db[_0xbd39('0x47')][_0xbd39('0x49')]({'where':{'id':_0x470ffd['params']['id']}})[_0xbd39('0x2a')](function(_0x369088){return db[_0xbd39('0x7f')][_0xbd39('0x6e')](function(_0x2f81b3){return _0x369088[_0xbd39('0x74')](_0x470ffd[_0xbd39('0x36')]['ids'],{'transaction':_0x2f81b3})['then'](function(){if(!_['isEmpty'](_0x5698c4)){return _0x369088[_0xbd39('0x87')](_0x5698c4,{'transaction':_0x2f81b3});}})[_0xbd39('0x2a')](function(){_0x5698c4[_0xbd39('0x88')](function(_0x197af5){socket[_0xbd39('0x72')](_0xbd39('0x89'),{'UserId':_0x197af5,'SmsQueueId':_0x369088['id']});});});});});});})['then'](respondWithStatusCode(_0x1fbfde,null))[_0xbd39('0x4a')](handleError(_0x1fbfde,null));};exports['addAgents']=function(_0x4b21e1,_0x3de5b5,_0x178e6e){return db[_0xbd39('0x47')][_0xbd39('0x49')]({'where':{'id':_0x4b21e1[_0xbd39('0x53')]['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x3de5b5,null))[_0xbd39('0x2a')](function(_0x3a57aa){if(_0x3a57aa){return _0x3a57aa['addAgents'](_0x4b21e1[_0xbd39('0x4c')][_0xbd39('0x68')],_[_0xbd39('0x8a')](_0x4b21e1[_0xbd39('0x4c')],['ids','id'])||{})[_0xbd39('0x8b')](function(_0x9a5410){for(var _0x59a3c6=0x0;_0x59a3c6<_0x4b21e1['body']['ids'][_0xbd39('0x3c')];_0x59a3c6+=0x1){socket[_0xbd39('0x72')](_0xbd39('0x73'),{'UserId':Number(_0x4b21e1['body'][_0xbd39('0x68')][_0x59a3c6]),'SmsQueueId':Number(_0x4b21e1['params']['id'])});}return _0x9a5410;});}})['then'](respondWithResult(_0x3de5b5,null))[_0xbd39('0x4a')](handleError(_0x3de5b5,null));};exports['removeAgents']=function(_0x415da0,_0x123af8,_0x29a52d){return db[_0xbd39('0x47')][_0xbd39('0x49')]({'where':{'id':_0x415da0['params']['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x123af8,null))[_0xbd39('0x2a')](function(_0x4f4922){if(_0x4f4922){return _0x4f4922[_0xbd39('0x87')](_0x415da0[_0xbd39('0x36')][_0xbd39('0x68')])['then'](function(){if(_['isArray'](_0x415da0[_0xbd39('0x36')][_0xbd39('0x68')])){for(var _0x580d34=0x0;_0x580d34<_0x415da0[_0xbd39('0x36')][_0xbd39('0x68')][_0xbd39('0x3c')];_0x580d34+=0x1){socket[_0xbd39('0x72')](_0xbd39('0x89'),{'UserId':Number(_0x415da0[_0xbd39('0x36')]['ids'][_0x580d34]),'SmsQueueId':Number(_0x415da0[_0xbd39('0x53')]['id'])});}}else{socket[_0xbd39('0x72')](_0xbd39('0x89'),{'UserId':Number(_0x415da0[_0xbd39('0x36')][_0xbd39('0x68')]),'SmsQueueId':Number(_0x415da0[_0xbd39('0x53')]['id'])});}});}})[_0xbd39('0x2a')](respondWithStatusCode(_0x123af8,null))[_0xbd39('0x4a')](handleError(_0x123af8,null));};exports[_0xbd39('0x8c')]=function(_0x38603a,_0x22dd81,_0x2c7b5f){var _0x300ecb={};var _0x5385e5={};var _0x4d7564;var _0x35db61;return db[_0xbd39('0x47')][_0xbd39('0x56')]({'where':{'id':_0x38603a['params']['id']}})[_0xbd39('0x2a')](handleEntityNotFound(_0x22dd81,null))[_0xbd39('0x2a')](function(_0x5c9cba){if(_0x5c9cba){_0x4d7564=_0x5c9cba;_0x5385e5[_0xbd39('0x35')]=_[_0xbd39('0x37')](db[_0xbd39('0x5c')][_0xbd39('0x48')]);_0x5385e5[_0xbd39('0x36')]=_[_0xbd39('0x37')](_0x38603a[_0xbd39('0x36')]);_0x5385e5[_0xbd39('0x38')]=_[_0xbd39('0x39')](_0x5385e5[_0xbd39('0x35')],_0x5385e5[_0xbd39('0x36')]);_0x300ecb[_0xbd39('0x3a')]=_[_0xbd39('0x39')](_0x5385e5['model'],qs[_0xbd39('0x3b')](_0x38603a[_0xbd39('0x36')][_0xbd39('0x3b')]));_0x300ecb[_0xbd39('0x3a')]=_0x300ecb['attributes'][_0xbd39('0x3c')]?_0x300ecb['attributes']:_0x5385e5[_0xbd39('0x35')];_0x300ecb[_0xbd39('0x58')]=qs[_0xbd39('0x59')](_0x38603a[_0xbd39('0x36')]['sort']);_0x300ecb[_0xbd39('0x3e')]=qs['filters'](_[_0xbd39('0x5a')](_0x38603a[_0xbd39('0x36')],_0x5385e5['filters']));if(_0x38603a['query'][_0xbd39('0x42')]){_0x300ecb[_0xbd39('0x3e')]=_['merge'](_0x300ecb[_0xbd39('0x3e')],{'$or':_['map'](_0x300ecb[_0xbd39('0x3a')],function(_0x506dc0){var _0x8508e0={};_0x8508e0[_0x506dc0]={'$like':'%'+_0x38603a['query'][_0xbd39('0x42')]+'%'};return _0x8508e0;})});}_0x300ecb=_[_0xbd39('0x3f')]({},_0x300ecb,_0x38603a[_0xbd39('0x43')]);return _0x4d7564[_0xbd39('0x8c')](_0x300ecb);}})[_0xbd39('0x2a')](function(_0xf429c7){if(_0xf429c7){_0x35db61=_0xf429c7[_0xbd39('0x3c')];if(!_0x38603a[_0xbd39('0x36')]['hasOwnProperty'](_0xbd39('0x57'))){_0x300ecb['limit']=qs['limit'](_0x38603a[_0xbd39('0x36')][_0xbd39('0x23')]);_0x300ecb[_0xbd39('0x21')]=qs[_0xbd39('0x21')](_0x38603a[_0xbd39('0x36')][_0xbd39('0x21')]);}return _0x4d7564[_0xbd39('0x8c')](_0x300ecb);}})[_0xbd39('0x2a')](function(_0x423ba2){if(_0x423ba2){return _0x423ba2?{'count':_0x35db61,'rows':_0x423ba2}:null;}})[_0xbd39('0x2a')](respondWithResult(_0x22dd81,null))['catch'](handleError(_0x22dd81,null));}; \ No newline at end of file +var _0xc3c2=['toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','SmsQueues','UserProfileResource','then','error','stack','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','emit','removeTeams','ids','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?'];(function(_0x3ac015,_0x447011){var _0x183938=function(_0x426d10){while(--_0x426d10){_0x3ac015['push'](_0x3ac015['shift']());}};_0x183938(++_0x447011);}(_0xc3c2,0x1bc));var _0x2c3c=function(_0x2c1837,_0x21ecb5){_0x2c1837=_0x2c1837-0x0;var _0x1633f8=_0xc3c2[_0x2c1837];return _0x1633f8;};'use strict';var emlformat=require(_0x2c3c('0x0'));var rimraf=require(_0x2c3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c3c('0x2'));var rp=require(_0x2c3c('0x3'));var moment=require(_0x2c3c('0x4'));var BPromise=require(_0x2c3c('0x5'));var Mustache=require(_0x2c3c('0x6'));var util=require(_0x2c3c('0x7'));var path=require('path');var sox=require(_0x2c3c('0x8'));var csv=require(_0x2c3c('0x9'));var ejs=require(_0x2c3c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c3c('0xb'));var squel=require(_0x2c3c('0xc'));var crypto=require(_0x2c3c('0xd'));var jsforce=require(_0x2c3c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2c3c('0x9'));var querystring=require(_0x2c3c('0xf'));var Papa=require(_0x2c3c('0x10'));var Redis=require(_0x2c3c('0x11'));var authService=require(_0x2c3c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2c3c('0x13'));var hardwareService=require(_0x2c3c('0x14'));var logger=require(_0x2c3c('0x15'))(_0x2c3c('0x16'));var utils=require(_0x2c3c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c3c('0x18'))['db'];config['redis']=_['defaults'](config[_0x2c3c('0x19')],{'host':_0x2c3c('0x1a'),'port':0x18eb});var socket=require(_0x2c3c('0x1b'))(new Redis(config[_0x2c3c('0x19')]));require(_0x2c3c('0x1c'))[_0x2c3c('0x1d')](socket);function respondWithStatusCode(_0x34dbfe,_0xa1b852){_0xa1b852=_0xa1b852||0xcc;return function(_0x5d330b){if(_0x5d330b){return _0x34dbfe[_0x2c3c('0x1e')](_0xa1b852);}return _0x34dbfe[_0x2c3c('0x1f')](_0xa1b852)['end']();};}function respondWithResult(_0x4ea0cc,_0x57210f){_0x57210f=_0x57210f||0xc8;return function(_0x361c2b){if(_0x361c2b){return _0x4ea0cc['status'](_0x57210f)['json'](_0x361c2b);}};}function respondWithFilteredResult(_0x19695,_0x8543c4){return function(_0x4de211){if(_0x4de211){var _0x259e45=typeof _0x8543c4[_0x2c3c('0x20')]===_0x2c3c('0x21')&&typeof _0x8543c4[_0x2c3c('0x22')]==='undefined';var _0x41ab03=_0x4de211['count'];var _0x34444b=_0x259e45?0x0:_0x8543c4[_0x2c3c('0x20')];var _0x37204e=_0x259e45?_0x4de211[_0x2c3c('0x23')]:_0x8543c4[_0x2c3c('0x20')]+_0x8543c4[_0x2c3c('0x22')];var _0x35b206;if(_0x37204e>=_0x41ab03){_0x37204e=_0x41ab03;_0x35b206=0xc8;}else{_0x35b206=0xce;}_0x19695['status'](_0x35b206);return _0x19695[_0x2c3c('0x24')](_0x2c3c('0x25'),_0x34444b+'-'+_0x37204e+'/'+_0x41ab03)[_0x2c3c('0x26')](_0x4de211);}return null;};}function patchUpdates(_0x2d83fd){return function(_0x4256bc){try{jsonpatch[_0x2c3c('0x27')](_0x4256bc,_0x2d83fd,!![]);}catch(_0x1b47db){return BPromise[_0x2c3c('0x28')](_0x1b47db);}return _0x4256bc[_0x2c3c('0x29')]();};}function saveUpdates(_0xf76526,_0x30f37a){return function(_0x11a395){if(_0x11a395){return _0x11a395[_0x2c3c('0x2a')](_0xf76526)['then'](function(_0x502b59){return _0x502b59;});}return null;};}function removeEntity(_0x130915,_0xfc65c0){return function(_0x4317cc){if(_0x4317cc){return _0x4317cc[_0x2c3c('0x2b')]()['then'](function(){var _0x13de2c=_0x4317cc[_0x2c3c('0x2c')]({'plain':!![]});var _0x4b5111=_0x2c3c('0x2d');return db[_0x2c3c('0x2e')][_0x2c3c('0x2b')]({'where':{'type':_0x4b5111,'resourceId':_0x13de2c['id']}})[_0x2c3c('0x2f')](function(){return _0x4317cc;});})['then'](function(){_0x130915[_0x2c3c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34382d,_0x385aa9){return function(_0x8b81fd){if(!_0x8b81fd){_0x34382d[_0x2c3c('0x1e')](0x194);}return _0x8b81fd;};}function handleError(_0x340f5e,_0x3ecbe2){_0x3ecbe2=_0x3ecbe2||0x1f4;return function(_0x477ccb){logger[_0x2c3c('0x30')](_0x477ccb[_0x2c3c('0x31')]);if(_0x477ccb['name']){delete _0x477ccb[_0x2c3c('0x32')];}_0x340f5e['status'](_0x3ecbe2)[_0x2c3c('0x33')](_0x477ccb);};}exports['index']=function(_0x1815aa,_0xee9486){var _0x32fa98={},_0x2824ca={},_0x5805b9={'count':0x0,'rows':[]};var _0x252e66=_[_0x2c3c('0x34')](db[_0x2c3c('0x35')][_0x2c3c('0x36')],function(_0x3959a3){return{'name':_0x3959a3[_0x2c3c('0x37')],'type':_0x3959a3[_0x2c3c('0x38')][_0x2c3c('0x39')]};});_0x2824ca[_0x2c3c('0x3a')]=_[_0x2c3c('0x34')](_0x252e66,_0x2c3c('0x32'));_0x2824ca[_0x2c3c('0x3b')]=_['keys'](_0x1815aa[_0x2c3c('0x3b')]);_0x2824ca[_0x2c3c('0x3c')]=_[_0x2c3c('0x3d')](_0x2824ca[_0x2c3c('0x3a')],_0x2824ca['query']);_0x32fa98['attributes']=_['intersection'](_0x2824ca[_0x2c3c('0x3a')],qs[_0x2c3c('0x3e')](_0x1815aa[_0x2c3c('0x3b')]['fields']));_0x32fa98['attributes']=_0x32fa98[_0x2c3c('0x3f')]['length']?_0x32fa98[_0x2c3c('0x3f')]:_0x2824ca[_0x2c3c('0x3a')];if(!_0x1815aa['query'][_0x2c3c('0x40')](_0x2c3c('0x41'))){_0x32fa98[_0x2c3c('0x22')]=qs[_0x2c3c('0x22')](_0x1815aa[_0x2c3c('0x3b')]['limit']);_0x32fa98['offset']=qs[_0x2c3c('0x20')](_0x1815aa[_0x2c3c('0x3b')][_0x2c3c('0x20')]);}_0x32fa98['order']=qs[_0x2c3c('0x42')](_0x1815aa[_0x2c3c('0x3b')][_0x2c3c('0x42')]);_0x32fa98[_0x2c3c('0x43')]=qs[_0x2c3c('0x3c')](_[_0x2c3c('0x44')](_0x1815aa[_0x2c3c('0x3b')],_0x2824ca[_0x2c3c('0x3c')]),_0x252e66);if(_0x1815aa[_0x2c3c('0x3b')]['filter']){_0x32fa98[_0x2c3c('0x43')]=_[_0x2c3c('0x45')](_0x32fa98[_0x2c3c('0x43')],{'$or':_['map'](_0x252e66,function(_0x4563f0){if(_0x4563f0['type']!==_0x2c3c('0x46')){var _0x44dda6={};_0x44dda6[_0x4563f0[_0x2c3c('0x32')]]={'$like':'%'+_0x1815aa[_0x2c3c('0x3b')][_0x2c3c('0x47')]+'%'};return _0x44dda6;}})});}_0x32fa98=_['merge']({},_0x32fa98,_0x1815aa[_0x2c3c('0x48')]);var _0xaa76c4={'where':_0x32fa98['where']};return db[_0x2c3c('0x35')][_0x2c3c('0x23')](_0xaa76c4)[_0x2c3c('0x2f')](function(_0x3c7b24){_0x5805b9[_0x2c3c('0x23')]=_0x3c7b24;if(_0x1815aa['query'][_0x2c3c('0x49')]){_0x32fa98[_0x2c3c('0x4a')]=[{'all':!![]}];}return db[_0x2c3c('0x35')][_0x2c3c('0x4b')](_0x32fa98);})[_0x2c3c('0x2f')](function(_0x132c8b){_0x5805b9[_0x2c3c('0x4c')]=_0x132c8b;return _0x5805b9;})[_0x2c3c('0x2f')](respondWithFilteredResult(_0xee9486,_0x32fa98))[_0x2c3c('0x4d')](handleError(_0xee9486,null));};exports[_0x2c3c('0x4e')]=function(_0x325a41,_0x33fee6){var _0x5b149f={'raw':!![],'where':{'id':_0x325a41[_0x2c3c('0x4f')]['id']}},_0x416b4d={};_0x416b4d[_0x2c3c('0x3a')]=_[_0x2c3c('0x50')](db[_0x2c3c('0x35')][_0x2c3c('0x36')]);_0x416b4d[_0x2c3c('0x3b')]=_[_0x2c3c('0x50')](_0x325a41[_0x2c3c('0x3b')]);_0x416b4d[_0x2c3c('0x3c')]=_[_0x2c3c('0x3d')](_0x416b4d[_0x2c3c('0x3a')],_0x416b4d[_0x2c3c('0x3b')]);_0x5b149f[_0x2c3c('0x3f')]=_[_0x2c3c('0x3d')](_0x416b4d[_0x2c3c('0x3a')],qs['fields'](_0x325a41['query'][_0x2c3c('0x3e')]));_0x5b149f[_0x2c3c('0x3f')]=_0x5b149f['attributes'][_0x2c3c('0x51')]?_0x5b149f[_0x2c3c('0x3f')]:_0x416b4d[_0x2c3c('0x3a')];if(_0x325a41['query'][_0x2c3c('0x49')]){_0x5b149f[_0x2c3c('0x4a')]=[{'all':!![]}];}_0x5b149f=_[_0x2c3c('0x45')]({},_0x5b149f,_0x325a41[_0x2c3c('0x48')]);return db[_0x2c3c('0x35')]['find'](_0x5b149f)['then'](handleEntityNotFound(_0x33fee6,null))[_0x2c3c('0x2f')](respondWithResult(_0x33fee6,null))[_0x2c3c('0x4d')](handleError(_0x33fee6,null));};exports[_0x2c3c('0x52')]=function(_0x275743,_0x5bffb9){return db[_0x2c3c('0x35')][_0x2c3c('0x52')](_0x275743[_0x2c3c('0x53')],{})[_0x2c3c('0x2f')](function(_0x2bf6f5){var _0x562233=_0x275743['user']['get']({'plain':!![]});if(!_0x562233)throw new Error(_0x2c3c('0x54'));if(_0x562233[_0x2c3c('0x55')]===_0x2c3c('0x56')){var _0x7fbd28=_0x2bf6f5[_0x2c3c('0x2c')]({'plain':!![]});var _0x4629b3=_0x2c3c('0x2d');return db[_0x2c3c('0x57')][_0x2c3c('0x58')]({'where':{'name':_0x4629b3,'userProfileId':_0x562233[_0x2c3c('0x59')]},'raw':!![]})[_0x2c3c('0x2f')](function(_0x347202){if(_0x347202&&_0x347202[_0x2c3c('0x5a')]===0x0){return db[_0x2c3c('0x2e')][_0x2c3c('0x52')]({'name':_0x7fbd28[_0x2c3c('0x32')],'resourceId':_0x7fbd28['id'],'type':_0x347202[_0x2c3c('0x32')],'sectionId':_0x347202['id']},{})[_0x2c3c('0x2f')](function(){return _0x2bf6f5;});}else{return _0x2bf6f5;}})[_0x2c3c('0x4d')](function(_0x1f4945){logger[_0x2c3c('0x30')](_0x2c3c('0x5b'),_0x1f4945);throw _0x1f4945;});}return _0x2bf6f5;})[_0x2c3c('0x2f')](respondWithResult(_0x5bffb9,0xc9))[_0x2c3c('0x4d')](handleError(_0x5bffb9,null));};exports[_0x2c3c('0x2a')]=function(_0xdc04a0,_0x35169e){if(_0xdc04a0['body']['id']){delete _0xdc04a0['body']['id'];}return db[_0x2c3c('0x35')][_0x2c3c('0x58')]({'where':{'id':_0xdc04a0[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x35169e,null))[_0x2c3c('0x2f')](saveUpdates(_0xdc04a0[_0x2c3c('0x53')],null))['then'](respondWithResult(_0x35169e,null))[_0x2c3c('0x4d')](handleError(_0x35169e,null));};exports[_0x2c3c('0x2b')]=function(_0x597438,_0x280de7){return db['SmsQueue']['find']({'where':{'id':_0x597438[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x280de7,null))[_0x2c3c('0x2f')](removeEntity(_0x280de7,null))[_0x2c3c('0x4d')](handleError(_0x280de7,null));};exports[_0x2c3c('0x5c')]=function(_0x4e58ba,_0x2f35d1){return db['SmsQueue'][_0x2c3c('0x5c')]()[_0x2c3c('0x2f')](respondWithResult(_0x2f35d1,null))[_0x2c3c('0x4d')](handleError(_0x2f35d1,null));};exports['getMembers']=function(_0x7edec1,_0x8dee20,_0x488371){var _0x2f9e47={'raw':!![],'where':{}},_0x1d7e24={},_0x1a2755;return db[_0x2c3c('0x35')][_0x2c3c('0x5d')]({'where':{'id':_0x7edec1[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x8dee20,null))['then'](function(_0x57c17b){if(_0x57c17b){_0x1a2755=_0x57c17b[_0x2c3c('0x2c')]({'plain':!![]});_0x1d7e24[_0x2c3c('0x3a')]=_[_0x2c3c('0x50')](db['UserSmsQueue']['rawAttributes']);_0x1d7e24['query']=_[_0x2c3c('0x50')](_0x7edec1[_0x2c3c('0x3b')]);_0x1d7e24[_0x2c3c('0x3c')]=_[_0x2c3c('0x3d')](_0x1d7e24[_0x2c3c('0x3a')],_0x1d7e24['query']);_0x2f9e47[_0x2c3c('0x3f')]=_[_0x2c3c('0x3d')](_0x1d7e24[_0x2c3c('0x3a')],qs[_0x2c3c('0x3e')](_0x7edec1['query'][_0x2c3c('0x3e')]));_0x2f9e47[_0x2c3c('0x3f')]=_0x2f9e47[_0x2c3c('0x3f')][_0x2c3c('0x51')]?_0x2f9e47[_0x2c3c('0x3f')]:_0x1d7e24[_0x2c3c('0x3a')];if(!_0x7edec1[_0x2c3c('0x3b')][_0x2c3c('0x40')]('nolimit')){_0x2f9e47[_0x2c3c('0x22')]=qs[_0x2c3c('0x22')](_0x7edec1[_0x2c3c('0x3b')][_0x2c3c('0x22')]);_0x2f9e47[_0x2c3c('0x20')]=qs[_0x2c3c('0x20')](_0x7edec1[_0x2c3c('0x3b')][_0x2c3c('0x20')]);}_0x2f9e47[_0x2c3c('0x5e')]=qs[_0x2c3c('0x42')](_0x7edec1[_0x2c3c('0x3b')][_0x2c3c('0x42')]);_0x2f9e47[_0x2c3c('0x43')]=qs[_0x2c3c('0x3c')](_[_0x2c3c('0x44')](_0x7edec1[_0x2c3c('0x3b')],_0x1d7e24[_0x2c3c('0x3c')]));_0x2f9e47['where'][_0x2c3c('0x5f')]=_0x57c17b['id'];if(_0x7edec1[_0x2c3c('0x3b')][_0x2c3c('0x47')]){_0x2f9e47[_0x2c3c('0x43')]=_[_0x2c3c('0x45')](_0x2f9e47[_0x2c3c('0x43')],{'$or':_[_0x2c3c('0x34')](_0x2f9e47[_0x2c3c('0x3f')],function(_0x74651){var _0x1bae9a={};_0x1bae9a[_0x74651]={'$like':'%'+_0x7edec1['query'][_0x2c3c('0x47')]+'%'};return _0x1bae9a;})});}_0x2f9e47=_[_0x2c3c('0x45')]({},_0x2f9e47,_0x7edec1[_0x2c3c('0x48')]);return db[_0x2c3c('0x60')][_0x2c3c('0x4b')](_0x2f9e47);}})[_0x2c3c('0x2f')](function(_0x20dd07){if(_0x20dd07){return db[_0x2c3c('0x61')][_0x2c3c('0x62')]({'where':{'id':_[_0x2c3c('0x34')](_0x20dd07,'UserId'),'role':_0x2c3c('0x63')},'attributes':['id',_0x2c3c('0x32'),_0x2c3c('0x64'),_0x2c3c('0x65'),'createdAt']});}})[_0x2c3c('0x2f')](function(_0x51318a){if(_0x51318a){return{'count':_0x51318a[_0x2c3c('0x23')],'rows':_['map'](_0x51318a['rows'],function(_0x56662c){return{'membername':_0x56662c[_0x2c3c('0x32')],'UserId':_0x56662c['id'],'queue_name':_0x1a2755[_0x2c3c('0x32')],'SmsQueueId':_0x1a2755['id'],'interface':util[_0x2c3c('0x66')](_0x2c3c('0x67'),_0x2c3c('0x68'),_0x56662c[_0x2c3c('0x32')]),'penalty':0x0,'paused':_0x56662c[_0x2c3c('0x64')],'createdAt':_0x56662c[_0x2c3c('0x69')],'updatedAt':_0x56662c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x8dee20,_0x2f9e47))['catch'](handleError(_0x8dee20,null));};exports['getTeams']=function(_0x39ae08,_0x456542,_0x16ca0f){var _0x3f3a12={};var _0x4897dc={};var _0x3c79c3;var _0xd207b;return db[_0x2c3c('0x35')][_0x2c3c('0x5d')]({'where':{'id':_0x39ae08[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x456542,null))[_0x2c3c('0x2f')](function(_0x221604){if(_0x221604){_0x3c79c3=_0x221604;_0x4897dc['model']=_['keys'](db['Team'][_0x2c3c('0x36')]);_0x4897dc[_0x2c3c('0x3b')]=_[_0x2c3c('0x50')](_0x39ae08[_0x2c3c('0x3b')]);_0x4897dc[_0x2c3c('0x3c')]=_['intersection'](_0x4897dc['model'],_0x4897dc[_0x2c3c('0x3b')]);_0x3f3a12[_0x2c3c('0x3f')]=_['intersection'](_0x4897dc['model'],qs[_0x2c3c('0x3e')](_0x39ae08[_0x2c3c('0x3b')][_0x2c3c('0x3e')]));_0x3f3a12['attributes']=_0x3f3a12[_0x2c3c('0x3f')]['length']?_0x3f3a12['attributes']:_0x4897dc[_0x2c3c('0x3a')];_0x3f3a12[_0x2c3c('0x5e')]=qs[_0x2c3c('0x42')](_0x39ae08[_0x2c3c('0x3b')][_0x2c3c('0x42')]);_0x3f3a12['where']=qs[_0x2c3c('0x3c')](_[_0x2c3c('0x44')](_0x39ae08['query'],_0x4897dc['filters']));if(_0x39ae08['query'][_0x2c3c('0x47')]){_0x3f3a12[_0x2c3c('0x43')]=_[_0x2c3c('0x45')](_0x3f3a12[_0x2c3c('0x43')],{'$or':_[_0x2c3c('0x34')](_0x3f3a12[_0x2c3c('0x3f')],function(_0x106776){var _0x5d24a5={};_0x5d24a5[_0x106776]={'$like':'%'+_0x39ae08[_0x2c3c('0x3b')][_0x2c3c('0x47')]+'%'};return _0x5d24a5;})});}_0x3f3a12=_[_0x2c3c('0x45')]({},_0x3f3a12,_0x39ae08[_0x2c3c('0x48')]);return _0x3c79c3[_0x2c3c('0x6a')](_0x3f3a12);}})[_0x2c3c('0x2f')](function(_0x5deeea){if(_0x5deeea){_0xd207b=_0x5deeea['length'];if(!_0x39ae08[_0x2c3c('0x3b')]['hasOwnProperty'](_0x2c3c('0x41'))){_0x3f3a12[_0x2c3c('0x22')]=qs[_0x2c3c('0x22')](_0x39ae08[_0x2c3c('0x3b')]['limit']);_0x3f3a12[_0x2c3c('0x20')]=qs[_0x2c3c('0x20')](_0x39ae08['query'][_0x2c3c('0x20')]);}return _0x3c79c3[_0x2c3c('0x6a')](_0x3f3a12);}})[_0x2c3c('0x2f')](function(_0xee9a9e){if(_0xee9a9e){return _0xee9a9e?{'count':_0xd207b,'rows':_0xee9a9e}:null;}})['then'](respondWithResult(_0x456542,null))[_0x2c3c('0x4d')](handleError(_0x456542,null));};exports['addTeams']=function(_0x13b0d7,_0x510c1b,_0x474c06){var _0x2d39f2=_0x13b0d7[_0x2c3c('0x53')]['ids'];return db[_0x2c3c('0x6b')][_0x2c3c('0x4b')]({'where':{'id':_0x2d39f2},'attributes':['id'],'include':[{'model':db[_0x2c3c('0x61')],'as':_0x2c3c('0x6c'),'attributes':['id',_0x2c3c('0x32'),_0x2c3c('0x6d'),_0x2c3c('0x6e'),_0x2c3c('0x6f')],'raw':!![]}]})['then'](function(_0x4273e9){if(_0x4273e9){var _0x32e9ec=_['flatMap'](_0x4273e9,function(_0x2f668c){var _0x3c7b29=_0x2f668c['get']({'plain':!![]});return _0x3c7b29[_0x2c3c('0x6c')];});return db['SmsQueue']['find']({'where':{'id':_0x13b0d7[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](function(_0x435f71){return db[_0x2c3c('0x70')][_0x2c3c('0x71')](function(_0x40c1ab){return _0x435f71['addTeams'](_0x2d39f2,{'transaction':_0x40c1ab})[_0x2c3c('0x2f')](function(){return BPromise[_0x2c3c('0x72')](_0x32e9ec,function(_0x37dba0){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x37dba0['id'],'SmsQueueId':_0x13b0d7[_0x2c3c('0x4f')]['id']},'transaction':_0x40c1ab});});})[_0x2c3c('0x2f')](function(){_0x32e9ec['forEach'](function(_0x5070ed){socket[_0x2c3c('0x73')]('userSmsQueue:save',{'UserId':_0x5070ed['id'],'SmsQueueId':_0x435f71['id']});});});});});}})[_0x2c3c('0x2f')](respondWithStatusCode(_0x510c1b,null))['catch'](handleError(_0x510c1b,null));};exports[_0x2c3c('0x74')]=function(_0x5ad6d1,_0x506ec7,_0x1beb2f){return db[_0x2c3c('0x6b')][_0x2c3c('0x4b')]({'where':{'id':_0x5ad6d1['query'][_0x2c3c('0x75')]},'attributes':['id'],'include':[{'model':db[_0x2c3c('0x61')],'as':_0x2c3c('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x506ec7,null))[_0x2c3c('0x2f')](function(_0x2bc59f){var _0xe2a586=_['map'](_0x2bc59f,'id');var _0x49dd07=[];var _0x3e0297=[];var _0x3c193f=squel[_0x2c3c('0x76')]();_0x3c193f[_0x2c3c('0x77')]('tq.TeamId')[_0x2c3c('0x78')](_0x2c3c('0x79'),'tq')[_0x2c3c('0x7a')](_0x2c3c('0x7b'),'ut',_0x2c3c('0x7c'))[_0x2c3c('0x43')](_0x2c3c('0x7d'),_0x5ad6d1[_0x2c3c('0x4f')]['id']);for(var _0x3f3ab5=0x0;_0x3f3ab5<_0x2bc59f['length'];_0x3f3ab5+=0x1){let _0x471d05=_0x2bc59f[_0x3f3ab5];for(var _0x263ddd=0x0;_0x263ddd<_0x471d05[_0x2c3c('0x6c')]['length'];_0x263ddd+=0x1){let _0x5e0219=_0x471d05[_0x2c3c('0x6c')][_0x263ddd];var _0x1faf3c=_0x3c193f[_0x2c3c('0x7e')]();_0x1faf3c['where'](_0x2c3c('0x7f'),_0x5e0219['id']);_0x3e0297['push'](db[_0x2c3c('0x70')][_0x2c3c('0x3b')](_0x1faf3c[_0x2c3c('0x80')](),{'type':db[_0x2c3c('0x70')][_0x2c3c('0x81')]['SELECT']})[_0x2c3c('0x2f')](function(_0x167d2e){if(_0x167d2e[_0x2c3c('0x51')]===0x1){return _0x5e0219['id'];}else{var _0x3483b8=_[_0x2c3c('0x82')](_[_0x2c3c('0x34')](_0x167d2e,_0x2c3c('0x83')),function(_0x1d5081){return _['includes'](_0xe2a586,_0x1d5081);});if(_0x3483b8){return _0x5e0219['id'];}}}));}}return BPromise[_0x2c3c('0x84')](_0x3e0297)[_0x2c3c('0x2f')](function(_0x31c725){_0x49dd07=_(_0x49dd07)[_0x2c3c('0x85')](_0x31c725)[_0x2c3c('0x86')]()[_0x2c3c('0x87')]();return db[_0x2c3c('0x35')][_0x2c3c('0x58')]({'where':{'id':_0x5ad6d1[_0x2c3c('0x4f')]['id']}})['then'](function(_0x545f10){return db[_0x2c3c('0x70')]['transaction'](function(_0x22ffc4){return _0x545f10[_0x2c3c('0x74')](_0x5ad6d1['query'][_0x2c3c('0x75')],{'transaction':_0x22ffc4})[_0x2c3c('0x2f')](function(){if(!_[_0x2c3c('0x88')](_0x49dd07)){return _0x545f10[_0x2c3c('0x89')](_0x49dd07,{'transaction':_0x22ffc4});}})['then'](function(){_0x49dd07['forEach'](function(_0x55d612){socket[_0x2c3c('0x73')](_0x2c3c('0x8a'),{'UserId':_0x55d612,'SmsQueueId':_0x545f10['id']});});});});});});})[_0x2c3c('0x2f')](respondWithStatusCode(_0x506ec7,null))[_0x2c3c('0x4d')](handleError(_0x506ec7,null));};exports[_0x2c3c('0x8b')]=function(_0x523c4a,_0x50ef50,_0x17b410){return db[_0x2c3c('0x35')][_0x2c3c('0x58')]({'where':{'id':_0x523c4a[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x50ef50,null))[_0x2c3c('0x2f')](function(_0x40d0c9){if(_0x40d0c9){return _0x40d0c9[_0x2c3c('0x8b')](_0x523c4a[_0x2c3c('0x53')][_0x2c3c('0x75')],_[_0x2c3c('0x8c')](_0x523c4a[_0x2c3c('0x53')],['ids','id'])||{})['spread'](function(_0xae63ed){for(var _0x29541e=0x0;_0x29541e<_0x523c4a[_0x2c3c('0x53')][_0x2c3c('0x75')][_0x2c3c('0x51')];_0x29541e+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x523c4a[_0x2c3c('0x53')][_0x2c3c('0x75')][_0x29541e]),'SmsQueueId':Number(_0x523c4a['params']['id'])});}return _0xae63ed;});}})[_0x2c3c('0x2f')](respondWithResult(_0x50ef50,null))['catch'](handleError(_0x50ef50,null));};exports['removeAgents']=function(_0x467d76,_0x398efa,_0x53e6cb){return db[_0x2c3c('0x35')][_0x2c3c('0x58')]({'where':{'id':_0x467d76[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x398efa,null))[_0x2c3c('0x2f')](function(_0x32d9e8){if(_0x32d9e8){return _0x32d9e8[_0x2c3c('0x89')](_0x467d76['query'][_0x2c3c('0x75')])[_0x2c3c('0x2f')](function(){if(_[_0x2c3c('0x8d')](_0x467d76[_0x2c3c('0x3b')]['ids'])){for(var _0x316c1e=0x0;_0x316c1e<_0x467d76[_0x2c3c('0x3b')][_0x2c3c('0x75')][_0x2c3c('0x51')];_0x316c1e+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x467d76[_0x2c3c('0x3b')][_0x2c3c('0x75')][_0x316c1e]),'SmsQueueId':Number(_0x467d76[_0x2c3c('0x4f')]['id'])});}}else{socket[_0x2c3c('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x467d76['query'][_0x2c3c('0x75')]),'SmsQueueId':Number(_0x467d76['params']['id'])});}});}})[_0x2c3c('0x2f')](respondWithStatusCode(_0x398efa,null))[_0x2c3c('0x4d')](handleError(_0x398efa,null));};exports[_0x2c3c('0x8e')]=function(_0x42cd34,_0x2c2c4f,_0x102557){var _0x2e9ade={};var _0x168d0d={};var _0x258339;var _0x10fdda;return db[_0x2c3c('0x35')]['findOne']({'where':{'id':_0x42cd34[_0x2c3c('0x4f')]['id']}})[_0x2c3c('0x2f')](handleEntityNotFound(_0x2c2c4f,null))[_0x2c3c('0x2f')](function(_0x2e7234){if(_0x2e7234){_0x258339=_0x2e7234;_0x168d0d[_0x2c3c('0x3a')]=_[_0x2c3c('0x50')](db[_0x2c3c('0x61')][_0x2c3c('0x36')]);_0x168d0d[_0x2c3c('0x3b')]=_[_0x2c3c('0x50')](_0x42cd34['query']);_0x168d0d[_0x2c3c('0x3c')]=_['intersection'](_0x168d0d['model'],_0x168d0d[_0x2c3c('0x3b')]);_0x2e9ade['attributes']=_[_0x2c3c('0x3d')](_0x168d0d[_0x2c3c('0x3a')],qs['fields'](_0x42cd34[_0x2c3c('0x3b')][_0x2c3c('0x3e')]));_0x2e9ade[_0x2c3c('0x3f')]=_0x2e9ade[_0x2c3c('0x3f')][_0x2c3c('0x51')]?_0x2e9ade['attributes']:_0x168d0d[_0x2c3c('0x3a')];_0x2e9ade[_0x2c3c('0x5e')]=qs['sort'](_0x42cd34[_0x2c3c('0x3b')][_0x2c3c('0x42')]);_0x2e9ade[_0x2c3c('0x43')]=qs[_0x2c3c('0x3c')](_[_0x2c3c('0x44')](_0x42cd34[_0x2c3c('0x3b')],_0x168d0d[_0x2c3c('0x3c')]));if(_0x42cd34[_0x2c3c('0x3b')][_0x2c3c('0x47')]){_0x2e9ade['where']=_[_0x2c3c('0x45')](_0x2e9ade[_0x2c3c('0x43')],{'$or':_[_0x2c3c('0x34')](_0x2e9ade['attributes'],function(_0xc0046f){var _0x42885e={};_0x42885e[_0xc0046f]={'$like':'%'+_0x42cd34['query'][_0x2c3c('0x47')]+'%'};return _0x42885e;})});}_0x2e9ade=_[_0x2c3c('0x45')]({},_0x2e9ade,_0x42cd34[_0x2c3c('0x48')]);return _0x258339['getAgents'](_0x2e9ade);}})[_0x2c3c('0x2f')](function(_0x5c1a28){if(_0x5c1a28){_0x10fdda=_0x5c1a28[_0x2c3c('0x51')];if(!_0x42cd34[_0x2c3c('0x3b')]['hasOwnProperty'](_0x2c3c('0x41'))){_0x2e9ade[_0x2c3c('0x22')]=qs[_0x2c3c('0x22')](_0x42cd34[_0x2c3c('0x3b')]['limit']);_0x2e9ade[_0x2c3c('0x20')]=qs['offset'](_0x42cd34[_0x2c3c('0x3b')][_0x2c3c('0x20')]);}return _0x258339[_0x2c3c('0x8e')](_0x2e9ade);}})[_0x2c3c('0x2f')](function(_0x598c7b){if(_0x598c7b){return _0x598c7b?{'count':_0x10fdda,'rows':_0x598c7b}:null;}})['then'](respondWithResult(_0x2c2c4f,null))[_0x2c3c('0x4d')](handleError(_0x2c2c4f,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 3a32003..be55057 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 _0x0031=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0031,0x6b));var _0x1003=function(_0x44de7b,_0x1f15df){_0x44de7b=_0x44de7b-0x0;var _0x567598=_0x0031[_0x44de7b];return _0x567598;};'use strict';var EventEmitter=require(_0x1003('0x0'));var SmsQueue=require(_0x1003('0x1'))['db'][_0x1003('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1003('0x3')](0x0);var events={'afterCreate':_0x1003('0x4'),'afterUpdate':_0x1003('0x5'),'afterDestroy':_0x1003('0x6')};function emitEvent(_0x222610){return function(_0x1a75ea,_0x44ef25,_0x13dac8){SmsQueueEvents[_0x1003('0x7')](_0x222610+':'+_0x1a75ea['id'],_0x1a75ea);SmsQueueEvents[_0x1003('0x7')](_0x222610,_0x1a75ea);_0x13dac8(null);};}for(var e in events){if(events[_0x1003('0x8')](e)){var event=events[e];SmsQueue[_0x1003('0x9')](e,emitEvent(event));}}module[_0x1003('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0x5218=['SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x5f0798,_0x15bdac){var _0x272174=function(_0x485a51){while(--_0x485a51){_0x5f0798['push'](_0x5f0798['shift']());}};_0x272174(++_0x15bdac);}(_0x5218,0x149));var _0x8521=function(_0xbeed37,_0x1df629){_0xbeed37=_0xbeed37-0x0;var _0x1dd39c=_0x5218[_0xbeed37];return _0x1dd39c;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x8521('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8521('0x1')](0x0);var events={'afterCreate':_0x8521('0x2'),'afterUpdate':'update','afterDestroy':_0x8521('0x3')};function emitEvent(_0x18d745){return function(_0x5bb47a,_0x2c3a01,_0x177ce6){SmsQueueEvents[_0x8521('0x4')](_0x18d745+':'+_0x5bb47a['id'],_0x5bb47a);SmsQueueEvents[_0x8521('0x4')](_0x18d745,_0x5bb47a);_0x177ce6(null);};}for(var e in events){if(events[_0x8521('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x8521('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 595e31f..00d021f 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 _0xe0eb=['sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x50399a,_0x1d2483){var _0xa6986d=function(_0x46fbd4){while(--_0x46fbd4){_0x50399a['push'](_0x50399a['shift']());}};_0xa6986d(++_0x1d2483);}(_0xe0eb,0x1b1));var _0xbe0e=function(_0x4b01b7,_0x183b04){_0x4b01b7=_0x4b01b7-0x0;var _0x2ed185=_0xe0eb[_0x4b01b7];return _0x2ed185;};'use strict';var _=require(_0xbe0e('0x0'));var util=require('util');var logger=require(_0xbe0e('0x1'))(_0xbe0e('0x2'));var moment=require(_0xbe0e('0x3'));var BPromise=require(_0xbe0e('0x4'));var rp=require(_0xbe0e('0x5'));var fs=require('fs');var path=require(_0xbe0e('0x6'));var rimraf=require(_0xbe0e('0x7'));var config=require(_0xbe0e('0x8'));var attributes=require('./smsQueue.attributes');module[_0xbe0e('0x9')]=function(_0x1d253e,_0x5e6c63){return _0x1d253e[_0xbe0e('0xa')]('SmsQueue',attributes,{'tableName':_0xbe0e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9b9=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','request-promise','path','rimraf'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xa9b9,0xf6));var _0x9a9b=function(_0x1c2ad3,_0x1105eb){_0x1c2ad3=_0x1c2ad3-0x0;var _0x383430=_0xa9b9[_0x1c2ad3];return _0x383430;};'use strict';var _=require(_0x9a9b('0x0'));var util=require(_0x9a9b('0x1'));var logger=require('../../config/logger')(_0x9a9b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a9b('0x3'));var fs=require('fs');var path=require(_0x9a9b('0x4'));var rimraf=require(_0x9a9b('0x5'));var config=require(_0x9a9b('0x6'));var attributes=require(_0x9a9b('0x7'));module[_0x9a9b('0x8')]=function(_0xca3010,_0x5a41d7){return _0xca3010[_0x9a9b('0x9')](_0x9a9b('0xa'),attributes,{'tableName':_0x9a9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index de6b859..0996958 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 _0xf6e9=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','limit','include','map','model','attributes','ShowSmsQueue','find','raw','debug','lodash','util','bluebird'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xf6e9,0x107));var _0x9f6e=function(_0x24e8c8,_0x5ea1fc){_0x24e8c8=_0x24e8c8-0x0;var _0x4bd3e9=_0xf6e9[_0x24e8c8];return _0x4bd3e9;};'use strict';var _=require(_0x9f6e('0x0'));var util=require(_0x9f6e('0x1'));var moment=require('moment');var BPromise=require(_0x9f6e('0x2'));var rs=require(_0x9f6e('0x3'));var fs=require('fs');var Redis=require(_0x9f6e('0x4'));var db=require(_0x9f6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f6e('0x6'))('rpc');var config=require(_0x9f6e('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9f6e('0x8')]=_['defaults'](config[_0x9f6e('0x8')],{'host':_0x9f6e('0x9'),'port':0x18eb});var socket=require(_0x9f6e('0xa'))(new Redis(config[_0x9f6e('0x8')]));require(_0x9f6e('0xb'))[_0x9f6e('0xc')](socket);function respondWithRpcPromise(_0x4c8cc0,_0x5e8cbb,_0x27e3fb){return new BPromise(function(_0x295385,_0x256da1){return client[_0x9f6e('0xd')](_0x4c8cc0,_0x27e3fb)[_0x9f6e('0xe')](function(_0x31523f){logger[_0x9f6e('0xf')]('SmsQueue,\x20%s,\x20%s',_0x5e8cbb,_0x9f6e('0x10'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5e8cbb,_0x9f6e('0x10'),JSON[_0x9f6e('0x11')](_0x31523f));if(_0x31523f['error']){if(_0x31523f[_0x9f6e('0x12')][_0x9f6e('0x13')]===0x1f4){logger[_0x9f6e('0x12')](_0x9f6e('0x14'),_0x5e8cbb,_0x31523f[_0x9f6e('0x12')][_0x9f6e('0x15')]);return _0x256da1(_0x31523f[_0x9f6e('0x12')][_0x9f6e('0x15')]);}logger[_0x9f6e('0x12')](_0x9f6e('0x14'),_0x5e8cbb,_0x31523f[_0x9f6e('0x12')][_0x9f6e('0x15')]);return _0x295385(_0x31523f[_0x9f6e('0x12')][_0x9f6e('0x15')]);}else{logger[_0x9f6e('0xf')](_0x9f6e('0x14'),_0x5e8cbb,'request\x20sent');_0x295385(_0x31523f[_0x9f6e('0x16')]['message']);}})[_0x9f6e('0x17')](function(_0x579e88){logger[_0x9f6e('0x12')](_0x9f6e('0x14'),_0x5e8cbb,_0x579e88);_0x256da1(_0x579e88);});});}exports[_0x9f6e('0x18')]=function(_0x12de62){var _0x3c0d8c=this;return new Promise(function(_0x10bc3e,_0x19369e){return db[_0x9f6e('0x19')][_0x9f6e('0x1a')]({'raw':_0x12de62[_0x9f6e('0x1b')]?_0x12de62[_0x9f6e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x12de62[_0x9f6e('0x1b')]?_0x12de62['options'][_0x9f6e('0x1c')]||null:null,'attributes':_0x12de62[_0x9f6e('0x1b')]?_0x12de62[_0x9f6e('0x1b')]['attributes']||null:null,'limit':_0x12de62[_0x9f6e('0x1b')]?_0x12de62[_0x9f6e('0x1b')][_0x9f6e('0x1d')]||null:null,'include':_0x12de62[_0x9f6e('0x1b')]?_0x12de62['options'][_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x12de62['options'][_0x9f6e('0x1e')],function(_0x4f9101){return{'model':db[_0x4f9101[_0x9f6e('0x20')]],'as':_0x4f9101['as'],'attributes':_0x4f9101[_0x9f6e('0x21')],'include':_0x4f9101[_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x4f9101[_0x9f6e('0x1e')],function(_0x53e2be){return{'model':db[_0x53e2be[_0x9f6e('0x20')]],'as':_0x53e2be['as'],'attributes':_0x53e2be[_0x9f6e('0x21')],'include':_0x53e2be[_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x53e2be['include'],function(_0x5eab96){return{'model':db[_0x5eab96[_0x9f6e('0x20')]],'as':_0x5eab96['as'],'attributes':_0x5eab96[_0x9f6e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9f6e('0xe')](function(_0x22fb46){logger['info'](_0x9f6e('0x18'),_0x12de62);logger['debug']('GetSmsQueue',_0x12de62,JSON['stringify'](_0x22fb46));_0x10bc3e(_0x22fb46);})[_0x9f6e('0x17')](function(_0x2f0fb7){logger[_0x9f6e('0x12')](_0x9f6e('0x18'),_0x2f0fb7[_0x9f6e('0x15')],_0x12de62);_0x19369e(_0x3c0d8c[_0x9f6e('0x12')](0x1f4,_0x2f0fb7[_0x9f6e('0x15')]));});});};exports[_0x9f6e('0x22')]=function(_0x5e9255){var _0x2245b1=this;return new Promise(function(_0x3c7132,_0x393405){return db[_0x9f6e('0x19')][_0x9f6e('0x23')]({'raw':_0x5e9255[_0x9f6e('0x1b')]?_0x5e9255[_0x9f6e('0x1b')][_0x9f6e('0x24')]===undefined?!![]:![]:!![],'where':_0x5e9255[_0x9f6e('0x1b')]?_0x5e9255[_0x9f6e('0x1b')][_0x9f6e('0x1c')]||null:null,'attributes':_0x5e9255[_0x9f6e('0x1b')]?_0x5e9255[_0x9f6e('0x1b')][_0x9f6e('0x21')]||null:null,'include':_0x5e9255[_0x9f6e('0x1b')]?_0x5e9255[_0x9f6e('0x1b')][_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x5e9255[_0x9f6e('0x1b')]['include'],function(_0x3a1a83){return{'model':db[_0x3a1a83['model']],'as':_0x3a1a83['as'],'attributes':_0x3a1a83[_0x9f6e('0x21')],'include':_0x3a1a83[_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x3a1a83[_0x9f6e('0x1e')],function(_0x3f55a2){return{'model':db[_0x3f55a2[_0x9f6e('0x20')]],'as':_0x3f55a2['as'],'attributes':_0x3f55a2[_0x9f6e('0x21')],'include':_0x3f55a2[_0x9f6e('0x1e')]?_[_0x9f6e('0x1f')](_0x3f55a2[_0x9f6e('0x1e')],function(_0x5652d3){return{'model':db[_0x5652d3[_0x9f6e('0x20')]],'as':_0x5652d3['as'],'attributes':_0x5652d3[_0x9f6e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9f6e('0xe')](function(_0x528ab3){logger['info'](_0x9f6e('0x22'),_0x5e9255);logger[_0x9f6e('0x25')](_0x9f6e('0x22'),_0x5e9255,JSON[_0x9f6e('0x11')](_0x528ab3));_0x3c7132(_0x528ab3);})[_0x9f6e('0x17')](function(_0x185821){logger['error'](_0x9f6e('0x22'),_0x185821[_0x9f6e('0x15')],_0x5e9255);_0x393405(_0x2245b1[_0x9f6e('0x12')](0x1f4,_0x185821[_0x9f6e('0x15')]));});});}; \ No newline at end of file +var _0x2670=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsQueue','findAll','options','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9f0fad,_0xaac881){var _0x3e3ada=function(_0x32cfba){while(--_0x32cfba){_0x9f0fad['push'](_0x9f0fad['shift']());}};_0x3e3ada(++_0xaac881);}(_0x2670,0x183));var _0x0267=function(_0x3aeb08,_0x2f30da){_0x3aeb08=_0x3aeb08-0x0;var _0x45f6d1=_0x2670[_0x3aeb08];return _0x45f6d1;};'use strict';var _=require(_0x0267('0x0'));var util=require(_0x0267('0x1'));var moment=require(_0x0267('0x2'));var BPromise=require(_0x0267('0x3'));var rs=require(_0x0267('0x4'));var fs=require('fs');var Redis=require(_0x0267('0x5'));var db=require(_0x0267('0x6'))['db'];var utils=require(_0x0267('0x7'));var logger=require('../../config/logger')(_0x0267('0x8'));var config=require(_0x0267('0x9'));var jayson=require(_0x0267('0xa'));var client=jayson[_0x0267('0xb')][_0x0267('0xc')]({'port':0x232a});config[_0x0267('0xd')]=_[_0x0267('0xe')](config[_0x0267('0xd')],{'host':_0x0267('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0267('0x10'))['register'](socket);function respondWithRpcPromise(_0x407e70,_0x254de0,_0x2f828c){return new BPromise(function(_0x151274,_0x56362a){return client[_0x0267('0x11')](_0x407e70,_0x2f828c)[_0x0267('0x12')](function(_0x3809e5){logger[_0x0267('0x13')](_0x0267('0x14'),_0x254de0,_0x0267('0x15'));logger[_0x0267('0x16')](_0x0267('0x17'),_0x254de0,_0x0267('0x15'),JSON[_0x0267('0x18')](_0x3809e5));if(_0x3809e5[_0x0267('0x19')]){if(_0x3809e5[_0x0267('0x19')]['code']===0x1f4){logger['error'](_0x0267('0x14'),_0x254de0,_0x3809e5[_0x0267('0x19')][_0x0267('0x1a')]);return _0x56362a(_0x3809e5['error'][_0x0267('0x1a')]);}logger[_0x0267('0x19')]('SmsQueue,\x20%s,\x20%s',_0x254de0,_0x3809e5['error'][_0x0267('0x1a')]);return _0x151274(_0x3809e5[_0x0267('0x19')][_0x0267('0x1a')]);}else{logger[_0x0267('0x13')](_0x0267('0x14'),_0x254de0,'request\x20sent');_0x151274(_0x3809e5['result'][_0x0267('0x1a')]);}})[_0x0267('0x1b')](function(_0x5d70b0){logger['error']('SmsQueue,\x20%s,\x20%s',_0x254de0,_0x5d70b0);_0x56362a(_0x5d70b0);});});}exports['GetSmsQueue']=function(_0x39140d){var _0x3a040f=this;return new Promise(function(_0x57b299,_0x573186){return db[_0x0267('0x1c')][_0x0267('0x1d')]({'raw':_0x39140d['options']?_0x39140d[_0x0267('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x39140d[_0x0267('0x1e')]?_0x39140d[_0x0267('0x1e')][_0x0267('0x1f')]||null:null,'attributes':_0x39140d[_0x0267('0x1e')]?_0x39140d['options'][_0x0267('0x20')]||null:null,'limit':_0x39140d['options']?_0x39140d['options'][_0x0267('0x21')]||null:null,'include':_0x39140d[_0x0267('0x1e')]?_0x39140d[_0x0267('0x1e')][_0x0267('0x22')]?_['map'](_0x39140d[_0x0267('0x1e')][_0x0267('0x22')],function(_0x2a51a3){return{'model':db[_0x2a51a3['model']],'as':_0x2a51a3['as'],'attributes':_0x2a51a3[_0x0267('0x20')],'include':_0x2a51a3[_0x0267('0x22')]?_[_0x0267('0x23')](_0x2a51a3[_0x0267('0x22')],function(_0x268905){return{'model':db[_0x268905[_0x0267('0x24')]],'as':_0x268905['as'],'attributes':_0x268905[_0x0267('0x20')],'include':_0x268905[_0x0267('0x22')]?_['map'](_0x268905['include'],function(_0x4aab1e){return{'model':db[_0x4aab1e[_0x0267('0x24')]],'as':_0x4aab1e['as'],'attributes':_0x4aab1e[_0x0267('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0267('0x12')](function(_0x2c8342){logger[_0x0267('0x13')](_0x0267('0x25'),_0x39140d);logger[_0x0267('0x16')](_0x0267('0x25'),_0x39140d,JSON[_0x0267('0x18')](_0x2c8342));_0x57b299(_0x2c8342);})['catch'](function(_0x400a7c){logger[_0x0267('0x19')](_0x0267('0x25'),_0x400a7c[_0x0267('0x1a')],_0x39140d);_0x573186(_0x3a040f[_0x0267('0x19')](0x1f4,_0x400a7c[_0x0267('0x1a')]));});});};exports[_0x0267('0x26')]=function(_0x1cf0a9){var _0x35b2a3=this;return new Promise(function(_0x3d97a0,_0x384d6f){return db[_0x0267('0x1c')][_0x0267('0x27')]({'raw':_0x1cf0a9[_0x0267('0x1e')]?_0x1cf0a9[_0x0267('0x1e')][_0x0267('0x28')]===undefined?!![]:![]:!![],'where':_0x1cf0a9[_0x0267('0x1e')]?_0x1cf0a9[_0x0267('0x1e')][_0x0267('0x1f')]||null:null,'attributes':_0x1cf0a9[_0x0267('0x1e')]?_0x1cf0a9[_0x0267('0x1e')][_0x0267('0x20')]||null:null,'include':_0x1cf0a9[_0x0267('0x1e')]?_0x1cf0a9['options']['include']?_[_0x0267('0x23')](_0x1cf0a9[_0x0267('0x1e')][_0x0267('0x22')],function(_0x3859be){return{'model':db[_0x3859be[_0x0267('0x24')]],'as':_0x3859be['as'],'attributes':_0x3859be[_0x0267('0x20')],'include':_0x3859be['include']?_[_0x0267('0x23')](_0x3859be['include'],function(_0x261b7f){return{'model':db[_0x261b7f[_0x0267('0x24')]],'as':_0x261b7f['as'],'attributes':_0x261b7f[_0x0267('0x20')],'include':_0x261b7f[_0x0267('0x22')]?_[_0x0267('0x23')](_0x261b7f['include'],function(_0xd940ad){return{'model':db[_0xd940ad[_0x0267('0x24')]],'as':_0xd940ad['as'],'attributes':_0xd940ad[_0x0267('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0267('0x12')](function(_0x44db3b){logger['info']('ShowSmsQueue',_0x1cf0a9);logger[_0x0267('0x16')](_0x0267('0x26'),_0x1cf0a9,JSON[_0x0267('0x18')](_0x44db3b));_0x3d97a0(_0x44db3b);})[_0x0267('0x1b')](function(_0xefa292){logger[_0x0267('0x19')](_0x0267('0x26'),_0xefa292[_0x0267('0x1a')],_0x1cf0a9);_0x384d6f(_0x35b2a3[_0x0267('0x19')](0x1f4,_0xefa292['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f07b531..ea5aa91 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 _0x5bae=['smsQueue:','remove','update','emit','removeListener'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x5bae,0xd3));var _0xe5ba=function(_0x2ccc7f,_0x2f8b86){_0x2ccc7f=_0x2ccc7f-0x0;var _0x422256=_0x5bae[_0x2ccc7f];return _0x422256;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xe5ba('0x0'),_0xe5ba('0x1')];function createListener(_0x4b62c6,_0x4047a5){return function(_0x4b081b){_0x4047a5[_0xe5ba('0x2')](_0x4b62c6,_0x4b081b);};}function removeListener(_0x506809,_0x534662){return function(){SmsQueueEvents[_0xe5ba('0x3')](_0x506809,_0x534662);};}exports['register']=function(_0x1d6308){for(var _0x39d758=0x0,_0x3b709b=events['length'];_0x39d758<_0x3b709b;_0x39d758++){var _0x4f8f15=events[_0x39d758];var _0x57f80c=createListener(_0xe5ba('0x4')+_0x4f8f15,_0x1d6308);SmsQueueEvents['on'](_0x4f8f15,_0x57f80c);}}; \ No newline at end of file +var _0xda24=['remove','update','emit','removeListener','register','length','smsQueue:','save'];(function(_0x3d8ac5,_0x50ca6f){var _0x605ee0=function(_0x4ab8c5){while(--_0x4ab8c5){_0x3d8ac5['push'](_0x3d8ac5['shift']());}};_0x605ee0(++_0x50ca6f);}(_0xda24,0x14f));var _0x4da2=function(_0x208128,_0x9e2557){_0x208128=_0x208128-0x0;var _0x213a02=_0xda24[_0x208128];return _0x213a02;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x4da2('0x0'),_0x4da2('0x1'),_0x4da2('0x2')];function createListener(_0x2e558c,_0x1ddbe4){return function(_0x4de3b5){_0x1ddbe4[_0x4da2('0x3')](_0x2e558c,_0x4de3b5);};}function removeListener(_0x4b6281,_0x420c6f){return function(){SmsQueueEvents[_0x4da2('0x4')](_0x4b6281,_0x420c6f);};}exports[_0x4da2('0x5')]=function(_0x1ad047){for(var _0x1d34c3=0x0,_0x224db9=events[_0x4da2('0x6')];_0x1d34c3<_0x224db9;_0x1d34c3++){var _0x237c09=events[_0x1d34c3];var _0x13a22b=createListener(_0x4da2('0x7')+_0x237c09,_0x1ad047);SmsQueueEvents['on'](_0x237c09,_0x13a22b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 036cf97..870e6cc 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 _0x9167=['../../config/environment','./smsQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x17f891,_0x34c577){var _0x5bf2d4=function(_0x208a07){while(--_0x208a07){_0x17f891['push'](_0x17f891['shift']());}};_0x5bf2d4(++_0x34c577);}(_0x9167,0x1b3));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7916('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7916('0x1'));var router=express[_0x7916('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7916('0x3'));var interaction=require(_0x7916('0x4'));var config=require(_0x7916('0x5'));var controller=require(_0x7916('0x6'));router[_0x7916('0x7')]('/',auth['isAuthenticated'](),controller[_0x7916('0x8')]);router['get'](_0x7916('0x9'),auth['isAuthenticated'](),controller[_0x7916('0xa')]);router[_0x7916('0x7')](_0x7916('0xb'),auth[_0x7916('0xc')](),controller['show']);router[_0x7916('0xd')]('/',auth[_0x7916('0xc')](),controller[_0x7916('0xe')]);router[_0x7916('0xf')](_0x7916('0xb'),auth['isAuthenticated'](),controller[_0x7916('0x10')]);router[_0x7916('0x11')](_0x7916('0xb'),auth['isAuthenticated'](),controller[_0x7916('0x12')]);module[_0x7916('0x13')]=router; \ No newline at end of file +var _0x728d=['post','create','put','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x38bc4c,_0x42183d){var _0x176d7e=function(_0x273a7e){while(--_0x273a7e){_0x38bc4c['push'](_0x38bc4c['shift']());}};_0x176d7e(++_0x42183d);}(_0x728d,0x1e8));var _0xd728=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x728d[_0x3f8a03];return _0x147fb2;};'use strict';var multer=require(_0xd728('0x0'));var util=require('util');var path=require(_0xd728('0x1'));var timeout=require('connect-timeout');var express=require(_0xd728('0x2'));var router=express[_0xd728('0x3')]();var fs_extra=require(_0xd728('0x4'));var auth=require(_0xd728('0x5'));var interaction=require(_0xd728('0x6'));var config=require(_0xd728('0x7'));var controller=require(_0xd728('0x8'));router[_0xd728('0x9')]('/',auth[_0xd728('0xa')](),controller[_0xd728('0xb')]);router['get'](_0xd728('0xc'),auth[_0xd728('0xa')](),controller[_0xd728('0xd')]);router[_0xd728('0x9')](_0xd728('0xe'),auth['isAuthenticated'](),controller[_0xd728('0xf')]);router[_0xd728('0x10')]('/',auth[_0xd728('0xa')](),controller[_0xd728('0x11')]);router[_0xd728('0x12')](_0xd728('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xd728('0x13')](_0xd728('0xe'),auth[_0xd728('0xa')](),controller['destroy']);module[_0xd728('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index ec78aef..524d91b 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 _0xd114=['moment','sequelize','exports','STRING','DATE'];(function(_0x1a3f08,_0x1ac9e0){var _0x2057f6=function(_0x179f6b){while(--_0x179f6b){_0x1a3f08['push'](_0x1a3f08['shift']());}};_0x2057f6(++_0x1ac9e0);}(_0xd114,0xd7));var _0x4d11=function(_0x363356,_0x166eb3){_0x363356=_0x363356-0x0;var _0x3000ef=_0xd114[_0x363356];return _0x3000ef;};'use strict';var moment=require(_0x4d11('0x0'));var Sequelize=require(_0x4d11('0x1'));module[_0x4d11('0x2')]={'uniqueid':{'type':Sequelize[_0x4d11('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4d11('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4d11('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4d11('0x3')]}}; \ No newline at end of file +var _0xa1db=['DATE','moment','sequelize','exports','STRING'];(function(_0x4ddfc9,_0x23f05f){var _0x47da83=function(_0xf31784){while(--_0xf31784){_0x4ddfc9['push'](_0x4ddfc9['shift']());}};_0x47da83(++_0x23f05f);}(_0xa1db,0xb0));var _0xba1d=function(_0x2a5042,_0x307d04){_0x2a5042=_0x2a5042-0x0;var _0x4bc22f=_0xa1db[_0x2a5042];return _0x4bc22f;};'use strict';var moment=require(_0xba1d('0x0'));var Sequelize=require(_0xba1d('0x1'));module[_0xba1d('0x2')]={'uniqueid':{'type':Sequelize[_0xba1d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xba1d('0x4')]},'acceptAt':{'type':Sequelize[_0xba1d('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xba1d('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 87abef2..27eb730 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 _0x6c66=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x6c66,0x171));var _0x66c6=function(_0x52f595,_0x343db6){_0x52f595=_0x52f595-0x0;var _0x55547=_0x6c66[_0x52f595];return _0x55547;};'use strict';var emlformat=require(_0x66c6('0x0'));var rimraf=require(_0x66c6('0x1'));var zipdir=require(_0x66c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c6('0x3'));var moment=require('moment');var BPromise=require(_0x66c6('0x4'));var Mustache=require(_0x66c6('0x5'));var util=require(_0x66c6('0x6'));var path=require(_0x66c6('0x7'));var sox=require(_0x66c6('0x8'));var csv=require(_0x66c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c6('0xa'));var squel=require(_0x66c6('0xb'));var crypto=require(_0x66c6('0xc'));var jsforce=require(_0x66c6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x66c6('0x9'));var querystring=require(_0x66c6('0xe'));var Papa=require(_0x66c6('0xf'));var Redis=require('ioredis');var authService=require(_0x66c6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x66c6('0x11'));var hardwareService=require(_0x66c6('0x12'));var logger=require(_0x66c6('0x13'))(_0x66c6('0x14'));var utils=require(_0x66c6('0x15'));var config=require(_0x66c6('0x16'));var licenseUtil=require(_0x66c6('0x17'));var db=require(_0x66c6('0x18'))['db'];function respondWithStatusCode(_0x1d0c4d,_0x4a79d3){_0x4a79d3=_0x4a79d3||0xcc;return function(_0x4332fc){if(_0x4332fc){return _0x1d0c4d[_0x66c6('0x19')](_0x4a79d3);}return _0x1d0c4d[_0x66c6('0x1a')](_0x4a79d3)[_0x66c6('0x1b')]();};}function respondWithResult(_0x4cfe85,_0x18fd4f){_0x18fd4f=_0x18fd4f||0xc8;return function(_0x22c3cf){if(_0x22c3cf){return _0x4cfe85[_0x66c6('0x1a')](_0x18fd4f)[_0x66c6('0x1c')](_0x22c3cf);}};}function respondWithFilteredResult(_0x5a7708,_0x3a1cc3){return function(_0xdde220){if(_0xdde220){var _0x2d665b=typeof _0x3a1cc3[_0x66c6('0x1d')]===_0x66c6('0x1e')&&typeof _0x3a1cc3[_0x66c6('0x1f')]===_0x66c6('0x1e');var _0x54e7b4=_0xdde220[_0x66c6('0x20')];var _0x533676=_0x2d665b?0x0:_0x3a1cc3[_0x66c6('0x1d')];var _0x581adf=_0x2d665b?_0xdde220[_0x66c6('0x20')]:_0x3a1cc3[_0x66c6('0x1d')]+_0x3a1cc3[_0x66c6('0x1f')];var _0x5f3fb4;if(_0x581adf>=_0x54e7b4){_0x581adf=_0x54e7b4;_0x5f3fb4=0xc8;}else{_0x5f3fb4=0xce;}_0x5a7708[_0x66c6('0x1a')](_0x5f3fb4);return _0x5a7708[_0x66c6('0x21')](_0x66c6('0x22'),_0x533676+'-'+_0x581adf+'/'+_0x54e7b4)[_0x66c6('0x1c')](_0xdde220);}return null;};}function patchUpdates(_0x1e5ea8){return function(_0x4f3a3d){try{jsonpatch[_0x66c6('0x23')](_0x4f3a3d,_0x1e5ea8,!![]);}catch(_0x493089){return BPromise['reject'](_0x493089);}return _0x4f3a3d['save']();};}function saveUpdates(_0x3e674c,_0x406ade){return function(_0xe660f6){if(_0xe660f6){return _0xe660f6[_0x66c6('0x24')](_0x3e674c)[_0x66c6('0x25')](function(_0x200103){return _0x200103;});}return null;};}function removeEntity(_0x515334,_0x31307d){return function(_0x23504c){if(_0x23504c){return _0x23504c[_0x66c6('0x26')]()[_0x66c6('0x25')](function(){_0x515334[_0x66c6('0x1a')](0xcc)[_0x66c6('0x1b')]();});}};}function handleEntityNotFound(_0x412deb,_0x2d88aa){return function(_0xeacf86){if(!_0xeacf86){_0x412deb[_0x66c6('0x19')](0x194);}return _0xeacf86;};}function handleError(_0x2962e4,_0x28931a){_0x28931a=_0x28931a||0x1f4;return function(_0x563ae9){logger[_0x66c6('0x27')](_0x563ae9['stack']);if(_0x563ae9[_0x66c6('0x28')]){delete _0x563ae9['name'];}_0x2962e4[_0x66c6('0x1a')](_0x28931a)[_0x66c6('0x29')](_0x563ae9);};}exports[_0x66c6('0x2a')]=function(_0xb8e0dc,_0x852718){var _0x301212={},_0x49c151={},_0x1b38d1={'count':0x0,'rows':[]};var _0x5cd7ed=_[_0x66c6('0x2b')](db[_0x66c6('0x2c')][_0x66c6('0x2d')],function(_0x345529){return{'name':_0x345529[_0x66c6('0x2e')],'type':_0x345529[_0x66c6('0x2f')][_0x66c6('0x30')]};});_0x49c151[_0x66c6('0x31')]=_[_0x66c6('0x2b')](_0x5cd7ed,_0x66c6('0x28'));_0x49c151[_0x66c6('0x32')]=_[_0x66c6('0x33')](_0xb8e0dc['query']);_0x49c151['filters']=_[_0x66c6('0x34')](_0x49c151[_0x66c6('0x31')],_0x49c151[_0x66c6('0x32')]);_0x301212[_0x66c6('0x35')]=_[_0x66c6('0x34')](_0x49c151['model'],qs[_0x66c6('0x36')](_0xb8e0dc['query'][_0x66c6('0x36')]));_0x301212['attributes']=_0x301212[_0x66c6('0x35')]['length']?_0x301212[_0x66c6('0x35')]:_0x49c151[_0x66c6('0x31')];if(!_0xb8e0dc[_0x66c6('0x32')][_0x66c6('0x37')]('nolimit')){_0x301212[_0x66c6('0x1f')]=qs[_0x66c6('0x1f')](_0xb8e0dc[_0x66c6('0x32')][_0x66c6('0x1f')]);_0x301212[_0x66c6('0x1d')]=qs[_0x66c6('0x1d')](_0xb8e0dc['query']['offset']);}_0x301212[_0x66c6('0x38')]=qs[_0x66c6('0x39')](_0xb8e0dc[_0x66c6('0x32')][_0x66c6('0x39')]);_0x301212[_0x66c6('0x3a')]=qs[_0x66c6('0x3b')](_[_0x66c6('0x3c')](_0xb8e0dc['query'],_0x49c151['filters']),_0x5cd7ed);if(_0xb8e0dc[_0x66c6('0x32')][_0x66c6('0x3d')]){_0x301212['where']=_[_0x66c6('0x3e')](_0x301212['where'],{'$or':_['map'](_0x5cd7ed,function(_0x2c4336){if(_0x2c4336['type']!==_0x66c6('0x3f')){var _0x321598={};_0x321598[_0x2c4336[_0x66c6('0x28')]]={'$like':'%'+_0xb8e0dc['query'][_0x66c6('0x3d')]+'%'};return _0x321598;}})});}_0x301212=_[_0x66c6('0x3e')]({},_0x301212,_0xb8e0dc[_0x66c6('0x40')]);var _0x2fc16e={'where':_0x301212[_0x66c6('0x3a')]};return db[_0x66c6('0x2c')][_0x66c6('0x20')](_0x2fc16e)[_0x66c6('0x25')](function(_0x1bfaa5){_0x1b38d1[_0x66c6('0x20')]=_0x1bfaa5;if(_0xb8e0dc[_0x66c6('0x32')][_0x66c6('0x41')]){_0x301212['include']=[{'all':!![]}];}return db[_0x66c6('0x2c')][_0x66c6('0x42')](_0x301212);})[_0x66c6('0x25')](function(_0xc24022){_0x1b38d1['rows']=_0xc24022;return _0x1b38d1;})[_0x66c6('0x25')](respondWithFilteredResult(_0x852718,_0x301212))[_0x66c6('0x43')](handleError(_0x852718,null));};exports[_0x66c6('0x44')]=function(_0x5aba48,_0x2102f6){var _0x43753e={'raw':!![],'where':{'id':_0x5aba48[_0x66c6('0x45')]['id']}},_0x4137c1={};_0x4137c1[_0x66c6('0x31')]=_[_0x66c6('0x33')](db[_0x66c6('0x2c')][_0x66c6('0x2d')]);_0x4137c1[_0x66c6('0x32')]=_[_0x66c6('0x33')](_0x5aba48[_0x66c6('0x32')]);_0x4137c1[_0x66c6('0x3b')]=_[_0x66c6('0x34')](_0x4137c1['model'],_0x4137c1[_0x66c6('0x32')]);_0x43753e[_0x66c6('0x35')]=_[_0x66c6('0x34')](_0x4137c1['model'],qs[_0x66c6('0x36')](_0x5aba48[_0x66c6('0x32')][_0x66c6('0x36')]));_0x43753e[_0x66c6('0x35')]=_0x43753e['attributes']['length']?_0x43753e[_0x66c6('0x35')]:_0x4137c1[_0x66c6('0x31')];if(_0x5aba48[_0x66c6('0x32')][_0x66c6('0x41')]){_0x43753e[_0x66c6('0x46')]=[{'all':!![]}];}_0x43753e=_[_0x66c6('0x3e')]({},_0x43753e,_0x5aba48['options']);return db[_0x66c6('0x2c')]['find'](_0x43753e)[_0x66c6('0x25')](handleEntityNotFound(_0x2102f6,null))['then'](respondWithResult(_0x2102f6,null))[_0x66c6('0x43')](handleError(_0x2102f6,null));};exports[_0x66c6('0x47')]=function(_0x20d485,_0x39bd3b){return db[_0x66c6('0x2c')][_0x66c6('0x47')](_0x20d485[_0x66c6('0x48')],{})['then'](respondWithResult(_0x39bd3b,0xc9))[_0x66c6('0x43')](handleError(_0x39bd3b,null));};exports[_0x66c6('0x24')]=function(_0x2fa17b,_0x483b7d){if(_0x2fa17b[_0x66c6('0x48')]['id']){delete _0x2fa17b['body']['id'];}return db[_0x66c6('0x2c')][_0x66c6('0x49')]({'where':{'id':_0x2fa17b[_0x66c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x483b7d,null))[_0x66c6('0x25')](saveUpdates(_0x2fa17b[_0x66c6('0x48')],null))[_0x66c6('0x25')](respondWithResult(_0x483b7d,null))[_0x66c6('0x43')](handleError(_0x483b7d,null));};exports[_0x66c6('0x26')]=function(_0x4c0d0a,_0x22037e){return db[_0x66c6('0x2c')][_0x66c6('0x49')]({'where':{'id':_0x4c0d0a[_0x66c6('0x45')]['id']}})[_0x66c6('0x25')](handleEntityNotFound(_0x22037e,null))[_0x66c6('0x25')](removeEntity(_0x22037e,null))[_0x66c6('0x43')](handleError(_0x22037e,null));};exports[_0x66c6('0x4a')]=function(_0x2a6dee,_0x449eb3){return db[_0x66c6('0x2c')][_0x66c6('0x4a')]()[_0x66c6('0x25')](respondWithResult(_0x449eb3,null))[_0x66c6('0x43')](handleError(_0x449eb3,null));}; \ No newline at end of file +var _0x34bd=['jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SmsQueueReport','includeAll','rows','show','params','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x34bd,0x1c7));var _0xd34b=function(_0xc989a3,_0x2ad1b0){_0xc989a3=_0xc989a3-0x0;var _0x24de1a=_0x34bd[_0xc989a3];return _0x24de1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd34b('0x0'));var zipdir=require(_0xd34b('0x1'));var jsonpatch=require(_0xd34b('0x2'));var rp=require(_0xd34b('0x3'));var moment=require(_0xd34b('0x4'));var BPromise=require(_0xd34b('0x5'));var Mustache=require('mustache');var util=require(_0xd34b('0x6'));var path=require(_0xd34b('0x7'));var sox=require(_0xd34b('0x8'));var csv=require('to-csv');var ejs=require(_0xd34b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd34b('0xa'));var squel=require(_0xd34b('0xb'));var crypto=require(_0xd34b('0xc'));var jsforce=require(_0xd34b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd34b('0xe'));var querystring=require(_0xd34b('0xf'));var Papa=require('papaparse');var Redis=require(_0xd34b('0x10'));var authService=require(_0xd34b('0x11'));var qs=require(_0xd34b('0x12'));var as=require(_0xd34b('0x13'));var hardwareService=require(_0xd34b('0x14'));var logger=require(_0xd34b('0x15'))(_0xd34b('0x16'));var utils=require('../../config/utils');var config=require(_0xd34b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd34b('0x18'))['db'];function respondWithStatusCode(_0x312038,_0x20e7d4){_0x20e7d4=_0x20e7d4||0xcc;return function(_0x18d0e7){if(_0x18d0e7){return _0x312038[_0xd34b('0x19')](_0x20e7d4);}return _0x312038[_0xd34b('0x1a')](_0x20e7d4)['end']();};}function respondWithResult(_0xe6a72e,_0x382cc6){_0x382cc6=_0x382cc6||0xc8;return function(_0x1f2414){if(_0x1f2414){return _0xe6a72e[_0xd34b('0x1a')](_0x382cc6)['json'](_0x1f2414);}};}function respondWithFilteredResult(_0x46f5a2,_0xdd56e8){return function(_0x2954a3){if(_0x2954a3){var _0x5274a6=typeof _0xdd56e8[_0xd34b('0x1b')]===_0xd34b('0x1c')&&typeof _0xdd56e8[_0xd34b('0x1d')]===_0xd34b('0x1c');var _0x3070ba=_0x2954a3[_0xd34b('0x1e')];var _0x307515=_0x5274a6?0x0:_0xdd56e8[_0xd34b('0x1b')];var _0x70fc38=_0x5274a6?_0x2954a3['count']:_0xdd56e8[_0xd34b('0x1b')]+_0xdd56e8[_0xd34b('0x1d')];var _0x4b0adb;if(_0x70fc38>=_0x3070ba){_0x70fc38=_0x3070ba;_0x4b0adb=0xc8;}else{_0x4b0adb=0xce;}_0x46f5a2['status'](_0x4b0adb);return _0x46f5a2[_0xd34b('0x1f')](_0xd34b('0x20'),_0x307515+'-'+_0x70fc38+'/'+_0x3070ba)[_0xd34b('0x21')](_0x2954a3);}return null;};}function patchUpdates(_0x5d1d2e){return function(_0xe01dd0){try{jsonpatch[_0xd34b('0x22')](_0xe01dd0,_0x5d1d2e,!![]);}catch(_0x4f90f0){return BPromise[_0xd34b('0x23')](_0x4f90f0);}return _0xe01dd0[_0xd34b('0x24')]();};}function saveUpdates(_0x13a0de,_0x2c3e57){return function(_0x281d36){if(_0x281d36){return _0x281d36[_0xd34b('0x25')](_0x13a0de)['then'](function(_0x13a62a){return _0x13a62a;});}return null;};}function removeEntity(_0x44b782,_0x3c13a8){return function(_0x21fb77){if(_0x21fb77){return _0x21fb77[_0xd34b('0x26')]()[_0xd34b('0x27')](function(){_0x44b782[_0xd34b('0x1a')](0xcc)[_0xd34b('0x28')]();});}};}function handleEntityNotFound(_0x5e21ef,_0x57bf52){return function(_0x28c559){if(!_0x28c559){_0x5e21ef[_0xd34b('0x19')](0x194);}return _0x28c559;};}function handleError(_0x3883c8,_0x25cb61){_0x25cb61=_0x25cb61||0x1f4;return function(_0xd1070f){logger[_0xd34b('0x29')](_0xd1070f[_0xd34b('0x2a')]);if(_0xd1070f['name']){delete _0xd1070f[_0xd34b('0x2b')];}_0x3883c8['status'](_0x25cb61)['send'](_0xd1070f);};}exports[_0xd34b('0x2c')]=function(_0xeceb7a,_0x13fe90){var _0x2b1a47={},_0x2ba07b={},_0x5a4ef0={'count':0x0,'rows':[]};var _0x387e4e=_['map'](db['SmsQueueReport'][_0xd34b('0x2d')],function(_0x2cc5b4){return{'name':_0x2cc5b4[_0xd34b('0x2e')],'type':_0x2cc5b4[_0xd34b('0x2f')][_0xd34b('0x30')]};});_0x2ba07b[_0xd34b('0x31')]=_[_0xd34b('0x32')](_0x387e4e,_0xd34b('0x2b'));_0x2ba07b[_0xd34b('0x33')]=_[_0xd34b('0x34')](_0xeceb7a[_0xd34b('0x33')]);_0x2ba07b[_0xd34b('0x35')]=_[_0xd34b('0x36')](_0x2ba07b[_0xd34b('0x31')],_0x2ba07b[_0xd34b('0x33')]);_0x2b1a47[_0xd34b('0x37')]=_[_0xd34b('0x36')](_0x2ba07b[_0xd34b('0x31')],qs[_0xd34b('0x38')](_0xeceb7a[_0xd34b('0x33')][_0xd34b('0x38')]));_0x2b1a47['attributes']=_0x2b1a47[_0xd34b('0x37')][_0xd34b('0x39')]?_0x2b1a47[_0xd34b('0x37')]:_0x2ba07b[_0xd34b('0x31')];if(!_0xeceb7a[_0xd34b('0x33')][_0xd34b('0x3a')](_0xd34b('0x3b'))){_0x2b1a47[_0xd34b('0x1d')]=qs[_0xd34b('0x1d')](_0xeceb7a[_0xd34b('0x33')]['limit']);_0x2b1a47[_0xd34b('0x1b')]=qs[_0xd34b('0x1b')](_0xeceb7a[_0xd34b('0x33')][_0xd34b('0x1b')]);}_0x2b1a47[_0xd34b('0x3c')]=qs[_0xd34b('0x3d')](_0xeceb7a[_0xd34b('0x33')]['sort']);_0x2b1a47[_0xd34b('0x3e')]=qs[_0xd34b('0x35')](_[_0xd34b('0x3f')](_0xeceb7a[_0xd34b('0x33')],_0x2ba07b['filters']),_0x387e4e);if(_0xeceb7a[_0xd34b('0x33')]['filter']){_0x2b1a47[_0xd34b('0x3e')]=_[_0xd34b('0x40')](_0x2b1a47['where'],{'$or':_[_0xd34b('0x32')](_0x387e4e,function(_0x31d444){if(_0x31d444['type']!==_0xd34b('0x41')){var _0x5b5f7e={};_0x5b5f7e[_0x31d444[_0xd34b('0x2b')]]={'$like':'%'+_0xeceb7a[_0xd34b('0x33')]['filter']+'%'};return _0x5b5f7e;}})});}_0x2b1a47=_[_0xd34b('0x40')]({},_0x2b1a47,_0xeceb7a[_0xd34b('0x42')]);var _0x2e806e={'where':_0x2b1a47['where']};return db[_0xd34b('0x43')][_0xd34b('0x1e')](_0x2e806e)[_0xd34b('0x27')](function(_0x3ffd8c){_0x5a4ef0[_0xd34b('0x1e')]=_0x3ffd8c;if(_0xeceb7a[_0xd34b('0x33')][_0xd34b('0x44')]){_0x2b1a47['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x2b1a47);})[_0xd34b('0x27')](function(_0x5f4ef9){_0x5a4ef0[_0xd34b('0x45')]=_0x5f4ef9;return _0x5a4ef0;})[_0xd34b('0x27')](respondWithFilteredResult(_0x13fe90,_0x2b1a47))['catch'](handleError(_0x13fe90,null));};exports[_0xd34b('0x46')]=function(_0xde6b50,_0x19851f){var _0xce8467={'raw':!![],'where':{'id':_0xde6b50[_0xd34b('0x47')]['id']}},_0xc543bf={};_0xc543bf['model']=_[_0xd34b('0x34')](db['SmsQueueReport'][_0xd34b('0x2d')]);_0xc543bf[_0xd34b('0x33')]=_[_0xd34b('0x34')](_0xde6b50['query']);_0xc543bf[_0xd34b('0x35')]=_[_0xd34b('0x36')](_0xc543bf[_0xd34b('0x31')],_0xc543bf[_0xd34b('0x33')]);_0xce8467[_0xd34b('0x37')]=_[_0xd34b('0x36')](_0xc543bf['model'],qs[_0xd34b('0x38')](_0xde6b50[_0xd34b('0x33')]['fields']));_0xce8467['attributes']=_0xce8467[_0xd34b('0x37')][_0xd34b('0x39')]?_0xce8467[_0xd34b('0x37')]:_0xc543bf[_0xd34b('0x31')];if(_0xde6b50[_0xd34b('0x33')][_0xd34b('0x44')]){_0xce8467[_0xd34b('0x48')]=[{'all':!![]}];}_0xce8467=_[_0xd34b('0x40')]({},_0xce8467,_0xde6b50['options']);return db['SmsQueueReport'][_0xd34b('0x49')](_0xce8467)[_0xd34b('0x27')](handleEntityNotFound(_0x19851f,null))[_0xd34b('0x27')](respondWithResult(_0x19851f,null))[_0xd34b('0x4a')](handleError(_0x19851f,null));};exports[_0xd34b('0x4b')]=function(_0xbb6ac3,_0x4cde5a){return db[_0xd34b('0x43')][_0xd34b('0x4b')](_0xbb6ac3['body'],{})['then'](respondWithResult(_0x4cde5a,0xc9))[_0xd34b('0x4a')](handleError(_0x4cde5a,null));};exports[_0xd34b('0x25')]=function(_0x15f2f5,_0x267f45){if(_0x15f2f5['body']['id']){delete _0x15f2f5[_0xd34b('0x4c')]['id'];}return db['SmsQueueReport'][_0xd34b('0x49')]({'where':{'id':_0x15f2f5[_0xd34b('0x47')]['id']}})[_0xd34b('0x27')](handleEntityNotFound(_0x267f45,null))['then'](saveUpdates(_0x15f2f5[_0xd34b('0x4c')],null))[_0xd34b('0x27')](respondWithResult(_0x267f45,null))['catch'](handleError(_0x267f45,null));};exports[_0xd34b('0x26')]=function(_0x3f50ec,_0x31615f){return db[_0xd34b('0x43')][_0xd34b('0x49')]({'where':{'id':_0x3f50ec[_0xd34b('0x47')]['id']}})[_0xd34b('0x27')](handleEntityNotFound(_0x31615f,null))['then'](removeEntity(_0x31615f,null))[_0xd34b('0x4a')](handleError(_0x31615f,null));};exports[_0xd34b('0x4d')]=function(_0x116edd,_0x5bca27){return db[_0xd34b('0x43')][_0xd34b('0x4d')]()['then'](respondWithResult(_0x5bca27,null))[_0xd34b('0x4a')](handleError(_0x5bca27,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 830c9f8..620d953 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x5f29a2,_0x475002){var _0x49030b=function(_0xff4ceb){while(--_0xff4ceb){_0x5f29a2['push'](_0x5f29a2['shift']());}};_0x49030b(++_0x475002);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6581f9f..ee8e7bd 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 _0x89b2=['info','result','catch','SmsQueueReport','create','options','debug','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x89b2,0x1dc));var _0x289b=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x89b2[_0x8c1005];return _0x175354;};'use strict';var _=require(_0x289b('0x0'));var util=require(_0x289b('0x1'));var moment=require(_0x289b('0x2'));var BPromise=require('bluebird');var rs=require(_0x289b('0x3'));var fs=require('fs');var Redis=require(_0x289b('0x4'));var db=require(_0x289b('0x5'))['db'];var utils=require(_0x289b('0x6'));var logger=require('../../config/logger')(_0x289b('0x7'));var config=require(_0x289b('0x8'));var jayson=require(_0x289b('0x9'));var client=jayson[_0x289b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36bcc2,_0x2d5503,_0x3438e6){return new BPromise(function(_0x6aa578,_0x463577){return client[_0x289b('0xb')](_0x36bcc2,_0x3438e6)[_0x289b('0xc')](function(_0x5af659){logger['info'](_0x289b('0xd'),_0x2d5503,_0x289b('0xe'));logger['debug'](_0x289b('0xf'),_0x2d5503,_0x289b('0xe'),JSON['stringify'](_0x5af659));if(_0x5af659[_0x289b('0x10')]){if(_0x5af659[_0x289b('0x10')][_0x289b('0x11')]===0x1f4){logger[_0x289b('0x10')](_0x289b('0xd'),_0x2d5503,_0x5af659['error']['message']);return _0x463577(_0x5af659[_0x289b('0x10')]['message']);}logger[_0x289b('0x10')](_0x289b('0xd'),_0x2d5503,_0x5af659[_0x289b('0x10')][_0x289b('0x12')]);return _0x6aa578(_0x5af659[_0x289b('0x10')][_0x289b('0x12')]);}else{logger[_0x289b('0x13')](_0x289b('0xd'),_0x2d5503,_0x289b('0xe'));_0x6aa578(_0x5af659[_0x289b('0x14')]['message']);}})[_0x289b('0x15')](function(_0x52cf05){logger[_0x289b('0x10')](_0x289b('0xd'),_0x2d5503,_0x52cf05);_0x463577(_0x52cf05);});});}exports['CreateSmsQueueReport']=function(_0x5a2f3d){var _0xb1eab9=this;return new Promise(function(_0x4a517b,_0x301fcc){return db[_0x289b('0x16')][_0x289b('0x17')](_0x5a2f3d['body'],{'raw':_0x5a2f3d[_0x289b('0x18')]?_0x5a2f3d[_0x289b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x289b('0xc')](function(_0x42745d){logger['info']('CreateSmsQueueReport',_0x5a2f3d);logger[_0x289b('0x19')]('CreateSmsQueueReport',_0x5a2f3d,JSON['stringify'](_0x42745d));_0x4a517b(_0x42745d);})[_0x289b('0x15')](function(_0x10ef07){logger[_0x289b('0x10')](_0x289b('0x1a'),_0x10ef07[_0x289b('0x12')],_0x5a2f3d);_0x301fcc(_0xb1eab9[_0x289b('0x10')](0x1f4,_0x10ef07[_0x289b('0x12')]));});});};exports[_0x289b('0x1b')]=function(_0xa9f749){var _0x24b44d=this;return new Promise(function(_0x1aa5d7,_0x4e3d9c){return db[_0x289b('0x16')][_0x289b('0x1c')](_0xa9f749['body'],{'raw':_0xa9f749[_0x289b('0x18')]?_0xa9f749[_0x289b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa9f749[_0x289b('0x18')]?_0xa9f749[_0x289b('0x18')][_0x289b('0x1d')]||null:null,'attributes':_0xa9f749[_0x289b('0x18')]?_0xa9f749[_0x289b('0x18')][_0x289b('0x1e')]||null:null,'limit':_0xa9f749[_0x289b('0x18')]?_0xa9f749[_0x289b('0x18')][_0x289b('0x1f')]||null:null})['then'](function(_0x1683ce){logger[_0x289b('0x13')](_0x289b('0x1b'),_0xa9f749);logger[_0x289b('0x19')](_0x289b('0x1b'),_0xa9f749,JSON[_0x289b('0x20')](_0x1683ce));_0x1aa5d7(_0x1683ce);})[_0x289b('0x15')](function(_0x2b2200){logger[_0x289b('0x10')]('UpdateSmsQueueReport',_0x2b2200['message'],_0xa9f749);_0x4e3d9c(_0x24b44d[_0x289b('0x10')](0x1f4,_0x2b2200['message']));});});}; \ No newline at end of file +var _0xc2c2=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s'];(function(_0x2864e0,_0x197804){var _0x460b6f=function(_0x3104d8){while(--_0x3104d8){_0x2864e0['push'](_0x2864e0['shift']());}};_0x460b6f(++_0x197804);}(_0xc2c2,0x1a7));var _0x2c2c=function(_0x1686eb,_0x3a9343){_0x1686eb=_0x1686eb-0x0;var _0x20c267=_0xc2c2[_0x1686eb];return _0x20c267;};'use strict';var _=require(_0x2c2c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c2c('0x1'));var rs=require(_0x2c2c('0x2'));var fs=require('fs');var Redis=require(_0x2c2c('0x3'));var db=require(_0x2c2c('0x4'))['db'];var utils=require(_0x2c2c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2c2c('0x6'));var client=jayson[_0x2c2c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3deeaa,_0x483127,_0x42be31){return new BPromise(function(_0x2ffbf0,_0x4b2d34){return client[_0x2c2c('0x8')](_0x3deeaa,_0x42be31)[_0x2c2c('0x9')](function(_0x5f40d7){logger['info'](_0x2c2c('0xa'),_0x483127,'request\x20sent');logger[_0x2c2c('0xb')](_0x2c2c('0xc'),_0x483127,_0x2c2c('0xd'),JSON[_0x2c2c('0xe')](_0x5f40d7));if(_0x5f40d7[_0x2c2c('0xf')]){if(_0x5f40d7[_0x2c2c('0xf')]['code']===0x1f4){logger[_0x2c2c('0xf')](_0x2c2c('0xa'),_0x483127,_0x5f40d7[_0x2c2c('0xf')][_0x2c2c('0x10')]);return _0x4b2d34(_0x5f40d7['error'][_0x2c2c('0x10')]);}logger[_0x2c2c('0xf')](_0x2c2c('0xa'),_0x483127,_0x5f40d7[_0x2c2c('0xf')][_0x2c2c('0x10')]);return _0x2ffbf0(_0x5f40d7['error']['message']);}else{logger[_0x2c2c('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x483127,_0x2c2c('0xd'));_0x2ffbf0(_0x5f40d7[_0x2c2c('0x12')][_0x2c2c('0x10')]);}})[_0x2c2c('0x13')](function(_0x274196){logger[_0x2c2c('0xf')](_0x2c2c('0xa'),_0x483127,_0x274196);_0x4b2d34(_0x274196);});});}exports['CreateSmsQueueReport']=function(_0x3de641){var _0x1d9d68=this;return new Promise(function(_0x28e1ff,_0x5347fd){return db[_0x2c2c('0x14')][_0x2c2c('0x15')](_0x3de641[_0x2c2c('0x16')],{'raw':_0x3de641['options']?_0x3de641[_0x2c2c('0x17')][_0x2c2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x239d77){logger[_0x2c2c('0x11')](_0x2c2c('0x19'),_0x3de641);logger[_0x2c2c('0xb')](_0x2c2c('0x19'),_0x3de641,JSON['stringify'](_0x239d77));_0x28e1ff(_0x239d77);})[_0x2c2c('0x13')](function(_0x145d3a){logger[_0x2c2c('0xf')](_0x2c2c('0x19'),_0x145d3a['message'],_0x3de641);_0x5347fd(_0x1d9d68[_0x2c2c('0xf')](0x1f4,_0x145d3a[_0x2c2c('0x10')]));});});};exports[_0x2c2c('0x1a')]=function(_0x5615be){var _0x3e7728=this;return new Promise(function(_0x327f04,_0x2c1042){return db[_0x2c2c('0x14')][_0x2c2c('0x1b')](_0x5615be[_0x2c2c('0x16')],{'raw':_0x5615be[_0x2c2c('0x17')]?_0x5615be[_0x2c2c('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5615be[_0x2c2c('0x17')]?_0x5615be[_0x2c2c('0x17')][_0x2c2c('0x1c')]||null:null,'attributes':_0x5615be[_0x2c2c('0x17')]?_0x5615be[_0x2c2c('0x17')][_0x2c2c('0x1d')]||null:null,'limit':_0x5615be[_0x2c2c('0x17')]?_0x5615be[_0x2c2c('0x17')][_0x2c2c('0x1e')]||null:null})['then'](function(_0x5cf6b0){logger[_0x2c2c('0x11')](_0x2c2c('0x1a'),_0x5615be);logger[_0x2c2c('0xb')]('UpdateSmsQueueReport',_0x5615be,JSON[_0x2c2c('0xe')](_0x5cf6b0));_0x327f04(_0x5cf6b0);})[_0x2c2c('0x13')](function(_0x3b5413){logger[_0x2c2c('0xf')](_0x2c2c('0x1a'),_0x3b5413[_0x2c2c('0x10')],_0x5615be);_0x2c1042(_0x3e7728['error'](0x1f4,_0x3b5413['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 72b7b37..ab4925b 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 _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x1079c4,_0x33add8){var _0x28a2f1=function(_0x5df1f0){while(--_0x5df1f0){_0x1079c4['push'](_0x1079c4['shift']());}};_0x28a2f1(++_0x33add8);}(_0x5178,0x171));var _0x8517=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5178[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./smsTransferReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file +var _0x81bd=['../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56d78c,_0x2b65d6){var _0x9a8155=function(_0x3cb3ad){while(--_0x3cb3ad){_0x56d78c['push'](_0x56d78c['shift']());}};_0x9a8155(++_0x2b65d6);}(_0x81bd,0x7c));var _0xd81b=function(_0x2a193f,_0x10ab8e){_0x2a193f=_0x2a193f-0x0;var _0x579e2c=_0x81bd[_0x2a193f];return _0x579e2c;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var fs_extra=require(_0xd81b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var controller=require(_0xd81b('0x9'));router['get']('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0xb')]);router[_0xd81b('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd81b('0xd')]);router['get'](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')]('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x12')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x13')]);router[_0xd81b('0x14')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller['destroy']);module[_0xd81b('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2f3393b..6466ae2 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3a1f91,_0x15fe8b){var _0x451178=function(_0x5d99){while(--_0x5d99){_0x3a1f91['push'](_0x3a1f91['shift']());}};_0x451178(++_0x15fe8b);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x53fb21,_0xabdf4c){var _0x4649f1=function(_0x401599){while(--_0x401599){_0x53fb21['push'](_0x53fb21['shift']());}};_0x4649f1(++_0xabdf4c);}(_0x54ef,0x112));var _0xf54e=function(_0x448e7c,_0xba580c){_0x448e7c=_0x448e7c-0x0;var _0x112662=_0x54ef[_0x448e7c];return _0x112662;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9f49451..476208d 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 _0x45ce=['moment','util','path','to-csv','ejs','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','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','send','SmsTransferReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x45ce,0x1c4));var _0xe45c=function(_0x34d238,_0x349c28){_0x34d238=_0x34d238-0x0;var _0x2a6ee9=_0x45ce[_0x34d238];return _0x2a6ee9;};'use strict';var emlformat=require(_0xe45c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe45c('0x1'));var jsonpatch=require(_0xe45c('0x2'));var rp=require(_0xe45c('0x3'));var moment=require(_0xe45c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe45c('0x5'));var path=require(_0xe45c('0x6'));var sox=require('sox');var csv=require(_0xe45c('0x7'));var ejs=require(_0xe45c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe45c('0x9'));var squel=require(_0xe45c('0xa'));var crypto=require(_0xe45c('0xb'));var jsforce=require(_0xe45c('0xc'));var deskjs=require(_0xe45c('0xd'));var toCsv=require(_0xe45c('0x7'));var querystring=require('querystring');var Papa=require(_0xe45c('0xe'));var Redis=require('ioredis');var authService=require(_0xe45c('0xf'));var qs=require(_0xe45c('0x10'));var as=require(_0xe45c('0x11'));var hardwareService=require(_0xe45c('0x12'));var logger=require(_0xe45c('0x13'))(_0xe45c('0x14'));var utils=require(_0xe45c('0x15'));var config=require(_0xe45c('0x16'));var licenseUtil=require(_0xe45c('0x17'));var db=require(_0xe45c('0x18'))['db'];function respondWithStatusCode(_0x46719d,_0x1d5790){_0x1d5790=_0x1d5790||0xcc;return function(_0x4d8a68){if(_0x4d8a68){return _0x46719d['sendStatus'](_0x1d5790);}return _0x46719d[_0xe45c('0x19')](_0x1d5790)['end']();};}function respondWithResult(_0x54de4c,_0x9448c4){_0x9448c4=_0x9448c4||0xc8;return function(_0x2cf4a7){if(_0x2cf4a7){return _0x54de4c[_0xe45c('0x19')](_0x9448c4)['json'](_0x2cf4a7);}};}function respondWithFilteredResult(_0x3d1e09,_0x31fa9b){return function(_0x43df76){if(_0x43df76){var _0x195aa6=typeof _0x31fa9b[_0xe45c('0x1a')]==='undefined'&&typeof _0x31fa9b[_0xe45c('0x1b')]===_0xe45c('0x1c');var _0x257862=_0x43df76[_0xe45c('0x1d')];var _0x35b94b=_0x195aa6?0x0:_0x31fa9b[_0xe45c('0x1a')];var _0x547cd0=_0x195aa6?_0x43df76[_0xe45c('0x1d')]:_0x31fa9b[_0xe45c('0x1a')]+_0x31fa9b[_0xe45c('0x1b')];var _0x51c2ac;if(_0x547cd0>=_0x257862){_0x547cd0=_0x257862;_0x51c2ac=0xc8;}else{_0x51c2ac=0xce;}_0x3d1e09[_0xe45c('0x19')](_0x51c2ac);return _0x3d1e09[_0xe45c('0x1e')](_0xe45c('0x1f'),_0x35b94b+'-'+_0x547cd0+'/'+_0x257862)['json'](_0x43df76);}return null;};}function patchUpdates(_0x25f02d){return function(_0x24ccfe){try{jsonpatch['apply'](_0x24ccfe,_0x25f02d,!![]);}catch(_0x413fd5){return BPromise[_0xe45c('0x20')](_0x413fd5);}return _0x24ccfe[_0xe45c('0x21')]();};}function saveUpdates(_0x502556,_0x5a6c2b){return function(_0xbce9e6){if(_0xbce9e6){return _0xbce9e6['update'](_0x502556)[_0xe45c('0x22')](function(_0x17eadf){return _0x17eadf;});}return null;};}function removeEntity(_0x2d9a94,_0x25e7fd){return function(_0x54f9ce){if(_0x54f9ce){return _0x54f9ce[_0xe45c('0x23')]()[_0xe45c('0x22')](function(){_0x2d9a94[_0xe45c('0x19')](0xcc)[_0xe45c('0x24')]();});}};}function handleEntityNotFound(_0x267fb9,_0x438c42){return function(_0x3f5270){if(!_0x3f5270){_0x267fb9[_0xe45c('0x25')](0x194);}return _0x3f5270;};}function handleError(_0x4a0373,_0x10d1fd){_0x10d1fd=_0x10d1fd||0x1f4;return function(_0x51395f){logger[_0xe45c('0x26')](_0x51395f[_0xe45c('0x27')]);if(_0x51395f['name']){delete _0x51395f[_0xe45c('0x28')];}_0x4a0373[_0xe45c('0x19')](_0x10d1fd)[_0xe45c('0x29')](_0x51395f);};}exports['index']=function(_0x432b54,_0x4d5b72){var _0x31dc10={},_0x391ede={},_0x1840ed={'count':0x0,'rows':[]};var _0x492814=_['map'](db[_0xe45c('0x2a')][_0xe45c('0x2b')],function(_0x1aa61b){return{'name':_0x1aa61b[_0xe45c('0x2c')],'type':_0x1aa61b['type']['key']};});_0x391ede[_0xe45c('0x2d')]=_[_0xe45c('0x2e')](_0x492814,'name');_0x391ede[_0xe45c('0x2f')]=_[_0xe45c('0x30')](_0x432b54[_0xe45c('0x2f')]);_0x391ede[_0xe45c('0x31')]=_[_0xe45c('0x32')](_0x391ede[_0xe45c('0x2d')],_0x391ede[_0xe45c('0x2f')]);_0x31dc10[_0xe45c('0x33')]=_[_0xe45c('0x32')](_0x391ede[_0xe45c('0x2d')],qs['fields'](_0x432b54[_0xe45c('0x2f')][_0xe45c('0x34')]));_0x31dc10[_0xe45c('0x33')]=_0x31dc10[_0xe45c('0x33')][_0xe45c('0x35')]?_0x31dc10[_0xe45c('0x33')]:_0x391ede[_0xe45c('0x2d')];if(!_0x432b54[_0xe45c('0x2f')][_0xe45c('0x36')](_0xe45c('0x37'))){_0x31dc10[_0xe45c('0x1b')]=qs['limit'](_0x432b54[_0xe45c('0x2f')][_0xe45c('0x1b')]);_0x31dc10[_0xe45c('0x1a')]=qs[_0xe45c('0x1a')](_0x432b54[_0xe45c('0x2f')][_0xe45c('0x1a')]);}_0x31dc10[_0xe45c('0x38')]=qs[_0xe45c('0x39')](_0x432b54[_0xe45c('0x2f')][_0xe45c('0x39')]);_0x31dc10[_0xe45c('0x3a')]=qs[_0xe45c('0x31')](_[_0xe45c('0x3b')](_0x432b54['query'],_0x391ede[_0xe45c('0x31')]),_0x492814);if(_0x432b54[_0xe45c('0x2f')][_0xe45c('0x3c')]){_0x31dc10['where']=_[_0xe45c('0x3d')](_0x31dc10['where'],{'$or':_[_0xe45c('0x2e')](_0x492814,function(_0x48e60a){if(_0x48e60a[_0xe45c('0x3e')]!==_0xe45c('0x3f')){var _0x4b7840={};_0x4b7840[_0x48e60a['name']]={'$like':'%'+_0x432b54[_0xe45c('0x2f')]['filter']+'%'};return _0x4b7840;}})});}_0x31dc10=_[_0xe45c('0x3d')]({},_0x31dc10,_0x432b54[_0xe45c('0x40')]);var _0x4cb6ce={'where':_0x31dc10[_0xe45c('0x3a')]};return db[_0xe45c('0x2a')][_0xe45c('0x1d')](_0x4cb6ce)[_0xe45c('0x22')](function(_0x3714cb){_0x1840ed[_0xe45c('0x1d')]=_0x3714cb;if(_0x432b54['query'][_0xe45c('0x41')]){_0x31dc10['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xe45c('0x42')](_0x31dc10);})['then'](function(_0x30fa63){_0x1840ed[_0xe45c('0x43')]=_0x30fa63;return _0x1840ed;})[_0xe45c('0x22')](respondWithFilteredResult(_0x4d5b72,_0x31dc10))[_0xe45c('0x44')](handleError(_0x4d5b72,null));};exports['show']=function(_0x22914e,_0x560d09){var _0x56a572={'raw':!![],'where':{'id':_0x22914e[_0xe45c('0x45')]['id']}},_0x13369e={};_0x13369e[_0xe45c('0x2d')]=_[_0xe45c('0x30')](db[_0xe45c('0x2a')][_0xe45c('0x2b')]);_0x13369e[_0xe45c('0x2f')]=_[_0xe45c('0x30')](_0x22914e['query']);_0x13369e['filters']=_[_0xe45c('0x32')](_0x13369e[_0xe45c('0x2d')],_0x13369e[_0xe45c('0x2f')]);_0x56a572[_0xe45c('0x33')]=_[_0xe45c('0x32')](_0x13369e['model'],qs['fields'](_0x22914e[_0xe45c('0x2f')][_0xe45c('0x34')]));_0x56a572['attributes']=_0x56a572[_0xe45c('0x33')]['length']?_0x56a572[_0xe45c('0x33')]:_0x13369e['model'];if(_0x22914e['query'][_0xe45c('0x41')]){_0x56a572[_0xe45c('0x46')]=[{'all':!![]}];}_0x56a572=_[_0xe45c('0x3d')]({},_0x56a572,_0x22914e[_0xe45c('0x40')]);return db[_0xe45c('0x2a')][_0xe45c('0x47')](_0x56a572)[_0xe45c('0x22')](handleEntityNotFound(_0x560d09,null))[_0xe45c('0x22')](respondWithResult(_0x560d09,null))[_0xe45c('0x44')](handleError(_0x560d09,null));};exports[_0xe45c('0x48')]=function(_0x599cc5,_0x5e8b7e){return db[_0xe45c('0x2a')][_0xe45c('0x48')](_0x599cc5['body'],{})['then'](respondWithResult(_0x5e8b7e,0xc9))[_0xe45c('0x44')](handleError(_0x5e8b7e,null));};exports[_0xe45c('0x49')]=function(_0x2d8e7b,_0x5eb2c5){if(_0x2d8e7b[_0xe45c('0x4a')]['id']){delete _0x2d8e7b[_0xe45c('0x4a')]['id'];}return db[_0xe45c('0x2a')][_0xe45c('0x47')]({'where':{'id':_0x2d8e7b[_0xe45c('0x45')]['id']}})[_0xe45c('0x22')](handleEntityNotFound(_0x5eb2c5,null))[_0xe45c('0x22')](saveUpdates(_0x2d8e7b['body'],null))[_0xe45c('0x22')](respondWithResult(_0x5eb2c5,null))[_0xe45c('0x44')](handleError(_0x5eb2c5,null));};exports[_0xe45c('0x23')]=function(_0xf88bda,_0x116830){return db[_0xe45c('0x2a')][_0xe45c('0x47')]({'where':{'id':_0xf88bda[_0xe45c('0x45')]['id']}})['then'](handleEntityNotFound(_0x116830,null))['then'](removeEntity(_0x116830,null))[_0xe45c('0x44')](handleError(_0x116830,null));};exports[_0xe45c('0x4b')]=function(_0x35ee67,_0x840f26){return db[_0xe45c('0x2a')]['describe']()[_0xe45c('0x22')](respondWithResult(_0x840f26,null))[_0xe45c('0x44')](handleError(_0x840f26,null));}; \ No newline at end of file +var _0x63d3=['bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x63d3,0x180));var _0x363d=function(_0x1e32ec,_0x253bdf){_0x1e32ec=_0x1e32ec-0x0;var _0x1b8295=_0x63d3[_0x1e32ec];return _0x1b8295;};'use strict';var emlformat=require(_0x363d('0x0'));var rimraf=require(_0x363d('0x1'));var zipdir=require(_0x363d('0x2'));var jsonpatch=require(_0x363d('0x3'));var rp=require(_0x363d('0x4'));var moment=require(_0x363d('0x5'));var BPromise=require(_0x363d('0x6'));var Mustache=require('mustache');var util=require(_0x363d('0x7'));var path=require(_0x363d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x363d('0x9'));var fs=require('fs');var fs_extra=require(_0x363d('0xa'));var _=require('lodash');var squel=require(_0x363d('0xb'));var crypto=require(_0x363d('0xc'));var jsforce=require(_0x363d('0xd'));var deskjs=require(_0x363d('0xe'));var toCsv=require(_0x363d('0xf'));var querystring=require(_0x363d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x363d('0x11'));var as=require(_0x363d('0x12'));var hardwareService=require(_0x363d('0x13'));var logger=require(_0x363d('0x14'))('api');var utils=require(_0x363d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x363d('0x16'));var db=require(_0x363d('0x17'))['db'];function respondWithStatusCode(_0x46e493,_0x27f388){_0x27f388=_0x27f388||0xcc;return function(_0x2fb20d){if(_0x2fb20d){return _0x46e493[_0x363d('0x18')](_0x27f388);}return _0x46e493[_0x363d('0x19')](_0x27f388)[_0x363d('0x1a')]();};}function respondWithResult(_0x1e6839,_0x25467c){_0x25467c=_0x25467c||0xc8;return function(_0x1918af){if(_0x1918af){return _0x1e6839[_0x363d('0x19')](_0x25467c)[_0x363d('0x1b')](_0x1918af);}};}function respondWithFilteredResult(_0x144c24,_0x34a7ed){return function(_0x1e2d15){if(_0x1e2d15){var _0x3f949b=typeof _0x34a7ed['offset']===_0x363d('0x1c')&&typeof _0x34a7ed['limit']===_0x363d('0x1c');var _0x58200e=_0x1e2d15[_0x363d('0x1d')];var _0x55c4be=_0x3f949b?0x0:_0x34a7ed['offset'];var _0x5e9728=_0x3f949b?_0x1e2d15['count']:_0x34a7ed['offset']+_0x34a7ed[_0x363d('0x1e')];var _0x2f9a7b;if(_0x5e9728>=_0x58200e){_0x5e9728=_0x58200e;_0x2f9a7b=0xc8;}else{_0x2f9a7b=0xce;}_0x144c24[_0x363d('0x19')](_0x2f9a7b);return _0x144c24[_0x363d('0x1f')](_0x363d('0x20'),_0x55c4be+'-'+_0x5e9728+'/'+_0x58200e)[_0x363d('0x1b')](_0x1e2d15);}return null;};}function patchUpdates(_0x4f3f57){return function(_0x2db63a){try{jsonpatch[_0x363d('0x21')](_0x2db63a,_0x4f3f57,!![]);}catch(_0x59df0c){return BPromise[_0x363d('0x22')](_0x59df0c);}return _0x2db63a[_0x363d('0x23')]();};}function saveUpdates(_0x190a76,_0x95faad){return function(_0x461633){if(_0x461633){return _0x461633[_0x363d('0x24')](_0x190a76)[_0x363d('0x25')](function(_0x3e75f1){return _0x3e75f1;});}return null;};}function removeEntity(_0x2347aa,_0x2be34d){return function(_0x2ffcfb){if(_0x2ffcfb){return _0x2ffcfb['destroy']()[_0x363d('0x25')](function(){_0x2347aa['status'](0xcc)[_0x363d('0x1a')]();});}};}function handleEntityNotFound(_0x32f968,_0xb77837){return function(_0x316423){if(!_0x316423){_0x32f968[_0x363d('0x18')](0x194);}return _0x316423;};}function handleError(_0x3a305c,_0x428a49){_0x428a49=_0x428a49||0x1f4;return function(_0xc7de0d){logger[_0x363d('0x26')](_0xc7de0d[_0x363d('0x27')]);if(_0xc7de0d[_0x363d('0x28')]){delete _0xc7de0d['name'];}_0x3a305c['status'](_0x428a49)[_0x363d('0x29')](_0xc7de0d);};}exports['index']=function(_0x489dda,_0x182db7){var _0x255295={},_0xb5b551={},_0x42f59e={'count':0x0,'rows':[]};var _0x22a756=_[_0x363d('0x2a')](db[_0x363d('0x2b')][_0x363d('0x2c')],function(_0x23ad12){return{'name':_0x23ad12[_0x363d('0x2d')],'type':_0x23ad12[_0x363d('0x2e')][_0x363d('0x2f')]};});_0xb5b551[_0x363d('0x30')]=_[_0x363d('0x2a')](_0x22a756,_0x363d('0x28'));_0xb5b551[_0x363d('0x31')]=_[_0x363d('0x32')](_0x489dda[_0x363d('0x31')]);_0xb5b551['filters']=_['intersection'](_0xb5b551[_0x363d('0x30')],_0xb5b551[_0x363d('0x31')]);_0x255295[_0x363d('0x33')]=_[_0x363d('0x34')](_0xb5b551[_0x363d('0x30')],qs[_0x363d('0x35')](_0x489dda[_0x363d('0x31')][_0x363d('0x35')]));_0x255295['attributes']=_0x255295[_0x363d('0x33')][_0x363d('0x36')]?_0x255295[_0x363d('0x33')]:_0xb5b551[_0x363d('0x30')];if(!_0x489dda[_0x363d('0x31')][_0x363d('0x37')](_0x363d('0x38'))){_0x255295['limit']=qs[_0x363d('0x1e')](_0x489dda[_0x363d('0x31')]['limit']);_0x255295[_0x363d('0x39')]=qs[_0x363d('0x39')](_0x489dda[_0x363d('0x31')]['offset']);}_0x255295[_0x363d('0x3a')]=qs[_0x363d('0x3b')](_0x489dda['query'][_0x363d('0x3b')]);_0x255295[_0x363d('0x3c')]=qs[_0x363d('0x3d')](_['pick'](_0x489dda[_0x363d('0x31')],_0xb5b551['filters']),_0x22a756);if(_0x489dda[_0x363d('0x31')][_0x363d('0x3e')]){_0x255295[_0x363d('0x3c')]=_['merge'](_0x255295[_0x363d('0x3c')],{'$or':_[_0x363d('0x2a')](_0x22a756,function(_0x47f568){if(_0x47f568[_0x363d('0x2e')]!==_0x363d('0x3f')){var _0x23d804={};_0x23d804[_0x47f568['name']]={'$like':'%'+_0x489dda[_0x363d('0x31')]['filter']+'%'};return _0x23d804;}})});}_0x255295=_['merge']({},_0x255295,_0x489dda[_0x363d('0x40')]);var _0xd51233={'where':_0x255295[_0x363d('0x3c')]};return db['SmsTransferReport'][_0x363d('0x1d')](_0xd51233)[_0x363d('0x25')](function(_0x5b2b95){_0x42f59e[_0x363d('0x1d')]=_0x5b2b95;if(_0x489dda['query']['includeAll']){_0x255295[_0x363d('0x41')]=[{'all':!![]}];}return db[_0x363d('0x2b')][_0x363d('0x42')](_0x255295);})['then'](function(_0x2b0538){_0x42f59e[_0x363d('0x43')]=_0x2b0538;return _0x42f59e;})[_0x363d('0x25')](respondWithFilteredResult(_0x182db7,_0x255295))[_0x363d('0x44')](handleError(_0x182db7,null));};exports[_0x363d('0x45')]=function(_0x2b16d1,_0x154aad){var _0x129497={'raw':!![],'where':{'id':_0x2b16d1[_0x363d('0x46')]['id']}},_0x4c6f36={};_0x4c6f36[_0x363d('0x30')]=_[_0x363d('0x32')](db[_0x363d('0x2b')][_0x363d('0x2c')]);_0x4c6f36['query']=_['keys'](_0x2b16d1[_0x363d('0x31')]);_0x4c6f36['filters']=_[_0x363d('0x34')](_0x4c6f36[_0x363d('0x30')],_0x4c6f36[_0x363d('0x31')]);_0x129497[_0x363d('0x33')]=_[_0x363d('0x34')](_0x4c6f36[_0x363d('0x30')],qs[_0x363d('0x35')](_0x2b16d1[_0x363d('0x31')]['fields']));_0x129497[_0x363d('0x33')]=_0x129497[_0x363d('0x33')][_0x363d('0x36')]?_0x129497['attributes']:_0x4c6f36['model'];if(_0x2b16d1['query'][_0x363d('0x47')]){_0x129497[_0x363d('0x41')]=[{'all':!![]}];}_0x129497=_[_0x363d('0x48')]({},_0x129497,_0x2b16d1[_0x363d('0x40')]);return db[_0x363d('0x2b')]['find'](_0x129497)[_0x363d('0x25')](handleEntityNotFound(_0x154aad,null))[_0x363d('0x25')](respondWithResult(_0x154aad,null))[_0x363d('0x44')](handleError(_0x154aad,null));};exports['create']=function(_0x21df19,_0x49f4b9){return db[_0x363d('0x2b')][_0x363d('0x49')](_0x21df19[_0x363d('0x4a')],{})[_0x363d('0x25')](respondWithResult(_0x49f4b9,0xc9))[_0x363d('0x44')](handleError(_0x49f4b9,null));};exports[_0x363d('0x24')]=function(_0x3a238f,_0xfc3c9e){if(_0x3a238f[_0x363d('0x4a')]['id']){delete _0x3a238f[_0x363d('0x4a')]['id'];}return db[_0x363d('0x2b')][_0x363d('0x4b')]({'where':{'id':_0x3a238f[_0x363d('0x46')]['id']}})[_0x363d('0x25')](handleEntityNotFound(_0xfc3c9e,null))[_0x363d('0x25')](saveUpdates(_0x3a238f[_0x363d('0x4a')],null))[_0x363d('0x25')](respondWithResult(_0xfc3c9e,null))[_0x363d('0x44')](handleError(_0xfc3c9e,null));};exports[_0x363d('0x4c')]=function(_0x30e137,_0x1df8eb){return db[_0x363d('0x2b')][_0x363d('0x4b')]({'where':{'id':_0x30e137[_0x363d('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df8eb,null))[_0x363d('0x25')](removeEntity(_0x1df8eb,null))[_0x363d('0x44')](handleError(_0x1df8eb,null));};exports[_0x363d('0x4d')]=function(_0x246ee5,_0x96986c){return db[_0x363d('0x2b')][_0x363d('0x4d')]()[_0x363d('0x25')](respondWithResult(_0x96986c,null))[_0x363d('0x44')](handleError(_0x96986c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2f48f20..c5bdd6a 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 _0x4cbc=['rimraf','../../config/environment','exports','define','uniqueid','util','api','moment','bluebird','path'];(function(_0x24d33,_0x11ddb5){var _0x715d60=function(_0x320182){while(--_0x320182){_0x24d33['push'](_0x24d33['shift']());}};_0x715d60(++_0x11ddb5);}(_0x4cbc,0x127));var _0xc4cb=function(_0x37bae3,_0x19e506){_0x37bae3=_0x37bae3-0x0;var _0x1912c2=_0x4cbc[_0x37bae3];return _0x1912c2;};'use strict';var _=require('lodash');var util=require(_0xc4cb('0x0'));var logger=require('../../config/logger')(_0xc4cb('0x1'));var moment=require(_0xc4cb('0x2'));var BPromise=require(_0xc4cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4cb('0x4'));var rimraf=require(_0xc4cb('0x5'));var config=require(_0xc4cb('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xc4cb('0x7')]=function(_0x5cf49e,_0x25abb7){return _0x5cf49e[_0xc4cb('0x8')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc4cb('0x9'),'fields':[_0xc4cb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c5b=['SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','moment','path','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x930ae7,_0x5d40f8){var _0x23ec7a=function(_0x59e439){while(--_0x59e439){_0x930ae7['push'](_0x930ae7['shift']());}};_0x23ec7a(++_0x5d40f8);}(_0x1c5b,0x184));var _0xb1c5=function(_0x3e397c,_0x59e377){_0x3e397c=_0x3e397c-0x0;var _0x25b232=_0x1c5b[_0x3e397c];return _0x25b232;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb1c5('0x0'))(_0xb1c5('0x1'));var moment=require(_0xb1c5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1c5('0x3'));var rimraf=require('rimraf');var config=require(_0xb1c5('0x4'));var attributes=require(_0xb1c5('0x5'));module[_0xb1c5('0x6')]=function(_0x2f1a57,_0x4a05e9){return _0x2f1a57[_0xb1c5('0x7')](_0xb1c5('0x8'),attributes,{'tableName':_0xb1c5('0x9'),'paranoid':![],'indexes':[{'name':_0xb1c5('0xa'),'fields':[_0xb1c5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b784901..3c5a61d 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xcb99,0x8b));var _0x9cb9=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xcb99[_0x210603];return _0x1bcb7d;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0x2cd3=['request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xc3c670,_0x1d0dfd){var _0x4f3a5a=function(_0x205f83){while(--_0x205f83){_0xc3c670['push'](_0xc3c670['shift']());}};_0x4f3a5a(++_0x1d0dfd);}(_0x2cd3,0xf1));var _0x32cd=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x2cd3[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x32cd('0x0'));var util=require('util');var moment=require(_0x32cd('0x1'));var BPromise=require(_0x32cd('0x2'));var rs=require(_0x32cd('0x3'));var fs=require('fs');var Redis=require(_0x32cd('0x4'));var db=require(_0x32cd('0x5'))['db'];var utils=require(_0x32cd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x32cd('0x7'));var jayson=require(_0x32cd('0x8'));var client=jayson[_0x32cd('0x9')][_0x32cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41784f,_0x43eb37,_0x1bbf19){return new BPromise(function(_0x27797f,_0x2d60fa){return client[_0x32cd('0xb')](_0x41784f,_0x1bbf19)[_0x32cd('0xc')](function(_0x192cf4){logger[_0x32cd('0xd')](_0x32cd('0xe'),_0x43eb37,_0x32cd('0xf'));logger[_0x32cd('0x10')](_0x32cd('0x11'),_0x43eb37,_0x32cd('0xf'),JSON['stringify'](_0x192cf4));if(_0x192cf4['error']){if(_0x192cf4[_0x32cd('0x12')]['code']===0x1f4){logger['error'](_0x32cd('0xe'),_0x43eb37,_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);return _0x2d60fa(_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);}logger[_0x32cd('0x12')](_0x32cd('0xe'),_0x43eb37,_0x192cf4['error']['message']);return _0x27797f(_0x192cf4[_0x32cd('0x12')][_0x32cd('0x13')]);}else{logger[_0x32cd('0xd')](_0x32cd('0xe'),_0x43eb37,'request\x20sent');_0x27797f(_0x192cf4[_0x32cd('0x14')]['message']);}})['catch'](function(_0x3de693){logger[_0x32cd('0x12')](_0x32cd('0xe'),_0x43eb37,_0x3de693);_0x2d60fa(_0x3de693);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 515a137..aa0ef64 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 _0x4528=['put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','diskStorage','join','replace','format','%s-%s%s','extname','originalname','now','single','create'];(function(_0x40a1de,_0x399e42){var _0x461c68=function(_0x848d97){while(--_0x848d97){_0x40a1de['push'](_0x40a1de['shift']());}};_0x461c68(++_0x399e42);}(_0x4528,0x197));var _0x8452=function(_0x52d57e,_0x1f32f9){_0x52d57e=_0x52d57e-0x0;var _0x452709=_0x4528[_0x52d57e];return _0x452709;};'use strict';var multer=require(_0x8452('0x0'));var util=require(_0x8452('0x1'));var path=require(_0x8452('0x2'));var timeout=require(_0x8452('0x3'));var express=require(_0x8452('0x4'));var router=express[_0x8452('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8452('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8452('0x7'));var controller=require(_0x8452('0x8'));router['get']('/',auth[_0x8452('0x9')](),controller[_0x8452('0xa')]);router[_0x8452('0xb')](_0x8452('0xc'),auth['isAuthenticated'](),controller[_0x8452('0xd')]);router[_0x8452('0xb')](_0x8452('0xe'),auth[_0x8452('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x8452('0xf')]({'destination':function(_0x4de78f,_0x1266a8,_0x57e92c){_0x57e92c(null,path[_0x8452('0x10')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x30684a,_0x54107c,_0x5e86f5){_0x54107c['originalname']=_0x54107c['originalname'][_0x8452('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e86f5(null,util[_0x8452('0x12')](_0x8452('0x13'),path['basename'](_0x54107c['originalname'],path[_0x8452('0x14')](_0x54107c[_0x8452('0x15')])),Date[_0x8452('0x16')](),path[_0x8452('0x14')](_0x54107c[_0x8452('0x15')])));}})});router['post']('/',upload[_0x8452('0x17')]('file'),controller[_0x8452('0x18')]);router[_0x8452('0x19')]('/:id',auth[_0x8452('0x9')](),controller['update']);router[_0x8452('0x1a')](_0x8452('0xc'),auth[_0x8452('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x52b4=['diskStorage','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','file','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','download'];(function(_0xfbf801,_0x1216d3){var _0x1e69dd=function(_0x192968){while(--_0x192968){_0xfbf801['push'](_0xfbf801['shift']());}};_0x1e69dd(++_0x1216d3);}(_0x52b4,0xdd));var _0x452b=function(_0x1322b9,_0x23ca43){_0x1322b9=_0x1322b9-0x0;var _0x1818cf=_0x52b4[_0x1322b9];return _0x1818cf;};'use strict';var multer=require(_0x452b('0x0'));var util=require(_0x452b('0x1'));var path=require(_0x452b('0x2'));var timeout=require(_0x452b('0x3'));var express=require(_0x452b('0x4'));var router=express[_0x452b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x452b('0x6'));var config=require(_0x452b('0x7'));var controller=require(_0x452b('0x8'));router[_0x452b('0x9')]('/',auth[_0x452b('0xa')](),controller['index']);router[_0x452b('0x9')]('/:id',auth[_0x452b('0xa')](),controller[_0x452b('0xb')]);router[_0x452b('0x9')]('/:id/download',auth[_0x452b('0xa')](),controller[_0x452b('0xc')]);var upload=multer({'storage':multer[_0x452b('0xd')]({'destination':function(_0x551b64,_0x3f217f,_0x275423){_0x275423(null,path['join'](config['root'],_0x452b('0xe')));},'filename':function(_0x495fba,_0x4ce453,_0x477221){_0x4ce453['originalname']=_0x4ce453[_0x452b('0xf')][_0x452b('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x477221(null,util[_0x452b('0x11')]('%s-%s%s',path[_0x452b('0x12')](_0x4ce453[_0x452b('0xf')],path[_0x452b('0x13')](_0x4ce453[_0x452b('0xf')])),Date[_0x452b('0x14')](),path[_0x452b('0x13')](_0x4ce453[_0x452b('0xf')])));}})});router[_0x452b('0x15')]('/',upload['single'](_0x452b('0x16')),controller['create']);router['put'](_0x452b('0x17'),auth['isAuthenticated'](),controller[_0x452b('0x18')]);router[_0x452b('0x19')](_0x452b('0x17'),auth['isAuthenticated'](),controller[_0x452b('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a479486..68ed1e8 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 _0xdbbc=['BIGINT','INTEGER','FLOAT','sequelize','STRING','name'];(function(_0x158d28,_0xd89868){var _0x934ba5=function(_0x566e56){while(--_0x566e56){_0x158d28['push'](_0x158d28['shift']());}};_0x934ba5(++_0xd89868);}(_0xdbbc,0xed));var _0xcdbb=function(_0x56880d,_0x315eb5){_0x56880d=_0x56880d-0x0;var _0x3ebe18=_0xdbbc[_0x56880d];return _0x3ebe18;};'use strict';var Sequelize=require(_0xcdbb('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdbb('0x1')],'unique':_0xcdbb('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcdbb('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xcdbb('0x1')]},'original_format':{'type':Sequelize[_0xcdbb('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xcdbb('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xcdbb('0x3')]},'original_sampleRate':{'type':Sequelize[_0xcdbb('0x4')]},'converted_format':{'type':Sequelize[_0xcdbb('0x1')]},'converted_duration':{'type':Sequelize[_0xcdbb('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xcdbb('0x3')]},'converted_channelCount':{'type':Sequelize[_0xcdbb('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xcdbb('0x4')]}}; \ No newline at end of file +var _0xc178=['INTEGER','sequelize','name','STRING','FLOAT','BIGINT'];(function(_0x52a497,_0x4cd1ed){var _0x1db01c=function(_0x5c9f66){while(--_0x5c9f66){_0x52a497['push'](_0x52a497['shift']());}};_0x1db01c(++_0x4cd1ed);}(_0xc178,0xeb));var _0x8c17=function(_0x4ecd57,_0x1798f6){_0x4ecd57=_0x4ecd57-0x0;var _0x5a3c7f=_0xc178[_0x4ecd57];return _0x5a3c7f;};'use strict';var Sequelize=require(_0x8c17('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8c17('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8c17('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x8c17('0x2')]},'original_duration':{'type':Sequelize[_0x8c17('0x3')]},'original_sampleCount':{'type':Sequelize[_0x8c17('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x8c17('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8c17('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x8c17('0x5')]},'converted_bitRate':{'type':Sequelize[_0x8c17('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x8c17('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 684b8ea..462d353 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 _0xbc68=['extname','file','filename','originalname','substring','wav','server/files/sounds/original','info','chmodSync','0777','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','Sounds','UserProfileResource','error','index','Sound','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','keys','includeAll','download','find','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename'];(function(_0x486d84,_0x491583){var _0x55b1af=function(_0xfce001){while(--_0xfce001){_0x486d84['push'](_0x486d84['shift']());}};_0x55b1af(++_0x491583);}(_0xbc68,0x1a2));var _0x8bc6=function(_0x574147,_0x4a8298){_0x574147=_0x574147-0x0;var _0x1bad14=_0xbc68[_0x574147];return _0x1bad14;};'use strict';var emlformat=require(_0x8bc6('0x0'));var rimraf=require(_0x8bc6('0x1'));var zipdir=require(_0x8bc6('0x2'));var jsonpatch=require(_0x8bc6('0x3'));var rp=require(_0x8bc6('0x4'));var moment=require(_0x8bc6('0x5'));var BPromise=require(_0x8bc6('0x6'));var Mustache=require(_0x8bc6('0x7'));var util=require(_0x8bc6('0x8'));var path=require(_0x8bc6('0x9'));var sox=require(_0x8bc6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bc6('0xb'));var _=require(_0x8bc6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bc6('0xd'));var deskjs=require(_0x8bc6('0xe'));var toCsv=require(_0x8bc6('0xf'));var querystring=require('querystring');var Papa=require(_0x8bc6('0x10'));var Redis=require(_0x8bc6('0x11'));var authService=require(_0x8bc6('0x12'));var qs=require(_0x8bc6('0x13'));var as=require(_0x8bc6('0x14'));var hardwareService=require(_0x8bc6('0x15'));var logger=require(_0x8bc6('0x16'))(_0x8bc6('0x17'));var utils=require(_0x8bc6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8bc6('0x19'));var db=require(_0x8bc6('0x1a'))['db'];function respondWithStatusCode(_0x38620d,_0x91f7ce){_0x91f7ce=_0x91f7ce||0xcc;return function(_0x2780f8){if(_0x2780f8){return _0x38620d[_0x8bc6('0x1b')](_0x91f7ce);}return _0x38620d[_0x8bc6('0x1c')](_0x91f7ce)[_0x8bc6('0x1d')]();};}function respondWithResult(_0x2f487c,_0xc407db){_0xc407db=_0xc407db||0xc8;return function(_0x1be0e5){if(_0x1be0e5){return _0x2f487c[_0x8bc6('0x1c')](_0xc407db)['json'](_0x1be0e5);}};}function respondWithFilteredResult(_0x57e3e9,_0x1ead08){return function(_0x1467d5){if(_0x1467d5){var _0x57efe2=typeof _0x1ead08[_0x8bc6('0x1e')]===_0x8bc6('0x1f')&&typeof _0x1ead08['limit']==='undefined';var _0x3cabd4=_0x1467d5[_0x8bc6('0x20')];var _0x1ed67d=_0x57efe2?0x0:_0x1ead08['offset'];var _0x4330d2=_0x57efe2?_0x1467d5['count']:_0x1ead08[_0x8bc6('0x1e')]+_0x1ead08[_0x8bc6('0x21')];var _0x2dd5b1;if(_0x4330d2>=_0x3cabd4){_0x4330d2=_0x3cabd4;_0x2dd5b1=0xc8;}else{_0x2dd5b1=0xce;}_0x57e3e9[_0x8bc6('0x1c')](_0x2dd5b1);return _0x57e3e9[_0x8bc6('0x22')](_0x8bc6('0x23'),_0x1ed67d+'-'+_0x4330d2+'/'+_0x3cabd4)[_0x8bc6('0x24')](_0x1467d5);}return null;};}function patchUpdates(_0x83e6b3){return function(_0x19306e){try{jsonpatch[_0x8bc6('0x25')](_0x19306e,_0x83e6b3,!![]);}catch(_0x28c296){return BPromise[_0x8bc6('0x26')](_0x28c296);}return _0x19306e[_0x8bc6('0x27')]();};}function saveUpdates(_0x495149,_0x10ccfd){return function(_0x57e7e6){if(_0x57e7e6){return _0x57e7e6['update'](_0x495149)[_0x8bc6('0x28')](function(_0x25f850){return _0x25f850;});}return null;};}function removeEntity(_0x277487,_0x5a09aa){return function(_0x3adb33){if(_0x3adb33){return _0x3adb33[_0x8bc6('0x29')]()['then'](function(){var _0x55d76b=_0x3adb33['get']({'plain':!![]});var _0x4b11e7=_0x8bc6('0x2a');return db[_0x8bc6('0x2b')][_0x8bc6('0x29')]({'where':{'type':_0x4b11e7,'resourceId':_0x55d76b['id']}})[_0x8bc6('0x28')](function(){return _0x3adb33;});})[_0x8bc6('0x28')](function(){_0x277487[_0x8bc6('0x1c')](0xcc)[_0x8bc6('0x1d')]();});}};}function handleEntityNotFound(_0x363873,_0x206b04){return function(_0x375071){if(!_0x375071){_0x363873[_0x8bc6('0x1b')](0x194);}return _0x375071;};}function handleError(_0x5cb138,_0xa071f5){_0xa071f5=_0xa071f5||0x1f4;return function(_0x3fb64e){logger[_0x8bc6('0x2c')](_0x3fb64e['stack']);if(_0x3fb64e['name']){delete _0x3fb64e['name'];}_0x5cb138[_0x8bc6('0x1c')](_0xa071f5)['send'](_0x3fb64e);};}exports[_0x8bc6('0x2d')]=function(_0x44d2cc,_0x18f0e3){var _0x180d76={},_0x39b459={},_0x2ba379={'count':0x0,'rows':[]};var _0x105bf3=_['map'](db[_0x8bc6('0x2e')][_0x8bc6('0x2f')],function(_0x16ede2){return{'name':_0x16ede2[_0x8bc6('0x30')],'type':_0x16ede2[_0x8bc6('0x31')][_0x8bc6('0x32')]};});_0x39b459[_0x8bc6('0x33')]=_[_0x8bc6('0x34')](_0x105bf3,_0x8bc6('0x35'));_0x39b459['query']=_['keys'](_0x44d2cc[_0x8bc6('0x36')]);_0x39b459[_0x8bc6('0x37')]=_[_0x8bc6('0x38')](_0x39b459[_0x8bc6('0x33')],_0x39b459['query']);_0x180d76[_0x8bc6('0x39')]=_['intersection'](_0x39b459[_0x8bc6('0x33')],qs[_0x8bc6('0x3a')](_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x3a')]));_0x180d76['attributes']=_0x180d76[_0x8bc6('0x39')][_0x8bc6('0x3b')]?_0x180d76['attributes']:_0x39b459['model'];if(!_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x3c')](_0x8bc6('0x3d'))){_0x180d76[_0x8bc6('0x21')]=qs[_0x8bc6('0x21')](_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x21')]);_0x180d76[_0x8bc6('0x1e')]=qs['offset'](_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x1e')]);}_0x180d76[_0x8bc6('0x3e')]=qs[_0x8bc6('0x3f')](_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x3f')]);_0x180d76[_0x8bc6('0x40')]=qs['filters'](_[_0x8bc6('0x41')](_0x44d2cc[_0x8bc6('0x36')],_0x39b459[_0x8bc6('0x37')]),_0x105bf3);if(_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x42')]){_0x180d76['where']=_['merge'](_0x180d76[_0x8bc6('0x40')],{'$or':_['map'](_0x105bf3,function(_0x2ad6be){if(_0x2ad6be[_0x8bc6('0x31')]!=='VIRTUAL'){var _0x2dcc6e={};_0x2dcc6e[_0x2ad6be[_0x8bc6('0x35')]]={'$like':'%'+_0x44d2cc[_0x8bc6('0x36')][_0x8bc6('0x42')]+'%'};return _0x2dcc6e;}})});}_0x180d76=_[_0x8bc6('0x43')]({},_0x180d76,_0x44d2cc[_0x8bc6('0x44')]);var _0x27303c={'where':_0x180d76[_0x8bc6('0x40')]};return db[_0x8bc6('0x2e')][_0x8bc6('0x20')](_0x27303c)[_0x8bc6('0x28')](function(_0x29aff0){_0x2ba379[_0x8bc6('0x20')]=_0x29aff0;if(_0x44d2cc[_0x8bc6('0x36')]['includeAll']){_0x180d76[_0x8bc6('0x45')]=[{'all':!![]}];}return db[_0x8bc6('0x2e')][_0x8bc6('0x46')](_0x180d76);})['then'](function(_0x31e549){_0x2ba379[_0x8bc6('0x47')]=_0x31e549;return _0x2ba379;})[_0x8bc6('0x28')](respondWithFilteredResult(_0x18f0e3,_0x180d76))[_0x8bc6('0x48')](handleError(_0x18f0e3,null));};exports['show']=function(_0x2f54f3,_0x470832){var _0xbb92e3={'raw':!![],'where':{'id':_0x2f54f3['params']['id']}},_0x1120ca={};_0x1120ca[_0x8bc6('0x33')]=_[_0x8bc6('0x49')](db['Sound'][_0x8bc6('0x2f')]);_0x1120ca[_0x8bc6('0x36')]=_[_0x8bc6('0x49')](_0x2f54f3[_0x8bc6('0x36')]);_0x1120ca[_0x8bc6('0x37')]=_[_0x8bc6('0x38')](_0x1120ca['model'],_0x1120ca[_0x8bc6('0x36')]);_0xbb92e3[_0x8bc6('0x39')]=_[_0x8bc6('0x38')](_0x1120ca[_0x8bc6('0x33')],qs[_0x8bc6('0x3a')](_0x2f54f3[_0x8bc6('0x36')][_0x8bc6('0x3a')]));_0xbb92e3[_0x8bc6('0x39')]=_0xbb92e3[_0x8bc6('0x39')]['length']?_0xbb92e3[_0x8bc6('0x39')]:_0x1120ca['model'];if(_0x2f54f3[_0x8bc6('0x36')][_0x8bc6('0x4a')]){_0xbb92e3[_0x8bc6('0x45')]=[{'all':!![]}];}_0xbb92e3=_['merge']({},_0xbb92e3,_0x2f54f3[_0x8bc6('0x44')]);return db[_0x8bc6('0x2e')]['find'](_0xbb92e3)[_0x8bc6('0x28')](handleEntityNotFound(_0x470832,null))[_0x8bc6('0x28')](respondWithResult(_0x470832,null))['catch'](handleError(_0x470832,null));};exports[_0x8bc6('0x4b')]=function(_0x53893d,_0x63ec7a,_0x592132){return db['Sound'][_0x8bc6('0x4c')]({'where':{'id':_0x53893d[_0x8bc6('0x4d')]['id']},'attributes':[_0x8bc6('0x35'),_0x8bc6('0x4e'),_0x8bc6('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x63ec7a,null))[_0x8bc6('0x28')](function(_0x4ef846){if(_0x4ef846){if(!fs[_0x8bc6('0x50')](path['join'](config[_0x8bc6('0x51')],_0x8bc6('0x52'),_0x4ef846[_0x8bc6('0x4e')]+'.'+_0x4ef846[_0x8bc6('0x4f')]))){throw new db['Sequelize'][(_0x8bc6('0x53'))](_0x8bc6('0x54'));}return _0x63ec7a[_0x8bc6('0x4b')](path[_0x8bc6('0x55')](config[_0x8bc6('0x51')],_0x8bc6('0x52'),util[_0x8bc6('0x56')]('%s.%s',_0x4ef846[_0x8bc6('0x4e')],_0x4ef846[_0x8bc6('0x4f')])),util['format'](_0x8bc6('0x57'),_0x4ef846['name'],_0x4ef846['converted_format']));}return null;})[_0x8bc6('0x48')](handleError(_0x63ec7a,null));};exports[_0x8bc6('0x58')]=function(_0x317355,_0xbe5bbe,_0x480a21){var _0x18acba={'name':path[_0x8bc6('0x59')](_0x317355['file']['originalname'],path[_0x8bc6('0x5a')](_0x317355['file']['originalname'])),'save_name':path['basename'](_0x317355[_0x8bc6('0x5b')][_0x8bc6('0x5c')],path[_0x8bc6('0x5a')](_0x317355[_0x8bc6('0x5b')][_0x8bc6('0x5c')])),'original_format':path[_0x8bc6('0x5a')](_0x317355['file'][_0x8bc6('0x5d')])[_0x8bc6('0x5e')](0x1),'converted_format':_0x8bc6('0x5f')};var _0x5aff7c=path['join'](config[_0x8bc6('0x51')],_0x8bc6('0x60'),_0x317355[_0x8bc6('0x5b')][_0x8bc6('0x5c')]);var _0x4d6d16=path['join'](config['root'],_0x8bc6('0x52'),util[_0x8bc6('0x56')]('%s.%s',path[_0x8bc6('0x59')](_0x317355[_0x8bc6('0x5b')][_0x8bc6('0x5c')],path[_0x8bc6('0x5a')](_0x317355[_0x8bc6('0x5b')][_0x8bc6('0x5c')])),_0x18acba['converted_format']));logger[_0x8bc6('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x5aff7c);logger[_0x8bc6('0x61')]('Sound\x20upload\x20destination:\x20%s',_0x4d6d16);try{fs[_0x8bc6('0x62')](_0x5aff7c,parseInt(_0x8bc6('0x63'),0x8));var _0x4701d8=sox['transcode'](_0x5aff7c,_0x4d6d16,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4701d8['on'](_0x8bc6('0x2c'),function(_0xb87f88){fs[_0x8bc6('0x64')](_0x5aff7c);_0xbe5bbe['status'](0x1f4)[_0x8bc6('0x65')](_0xb87f88);});_0x4701d8['on'](_0x8bc6('0x66'),function(_0x1d3fab){_0x18acba[_0x8bc6('0x67')]=isNaN(_0x1d3fab['duration'])?null:_0x1d3fab[_0x8bc6('0x68')]*0x3e8;_0x18acba[_0x8bc6('0x69')]=isNaN(_0x1d3fab[_0x8bc6('0x6a')])?null:_0x1d3fab[_0x8bc6('0x6a')];_0x18acba[_0x8bc6('0x6b')]=isNaN(_0x1d3fab[_0x8bc6('0x6c')])?null:_0x1d3fab[_0x8bc6('0x6c')];_0x18acba['original_bitRate']=isNaN(_0x1d3fab[_0x8bc6('0x6d')])?null:_0x1d3fab[_0x8bc6('0x6d')];_0x18acba[_0x8bc6('0x6e')]=isNaN(_0x1d3fab[_0x8bc6('0x6f')])?null:_0x1d3fab[_0x8bc6('0x6f')];});_0x4701d8['on'](_0x8bc6('0x70'),function(_0x53bb3f){_0x18acba['converted_duration']=isNaN(_0x53bb3f['duration'])?null:_0x53bb3f[_0x8bc6('0x68')]*0x3e8;_0x18acba[_0x8bc6('0x71')]=isNaN(_0x53bb3f[_0x8bc6('0x6a')])?null:_0x53bb3f[_0x8bc6('0x6a')];_0x18acba[_0x8bc6('0x72')]=isNaN(_0x53bb3f[_0x8bc6('0x6c')])?null:_0x53bb3f[_0x8bc6('0x6c')];_0x18acba[_0x8bc6('0x73')]=isNaN(_0x53bb3f[_0x8bc6('0x6d')])?null:_0x53bb3f['bitRate'];_0x18acba['converted_sampleRate']=isNaN(_0x53bb3f[_0x8bc6('0x6f')])?null:_0x53bb3f[_0x8bc6('0x6f')];});_0x4701d8['on'](_0x8bc6('0x1d'),function(){fs[_0x8bc6('0x62')](_0x4d6d16,parseInt(_0x8bc6('0x63'),0x8));return db[_0x8bc6('0x2e')]['create'](_0x18acba)[_0x8bc6('0x28')](function(_0x2b6242){var _0x5a642f={'role':_0x317355[_0x8bc6('0x74')][_0x8bc6('0x75')],'userProfileId':_0x317355[_0x8bc6('0x74')][_0x8bc6('0x76')]};if(!_0x5a642f)throw new Error(_0x8bc6('0x77'));if(_0x5a642f['role']==='user'){var _0xef5523=_0x2b6242['get']({'plain':!![]});return db[_0x8bc6('0x78')][_0x8bc6('0x4c')]({'where':{'name':_0x8bc6('0x2a'),'userProfileId':_0x5a642f[_0x8bc6('0x76')]},'raw':!![]})[_0x8bc6('0x28')](function(_0x1aa10d){if(_0x1aa10d&&_0x1aa10d[_0x8bc6('0x79')]===0x0){return db[_0x8bc6('0x2b')][_0x8bc6('0x58')]({'name':_0xef5523[_0x8bc6('0x35')],'resourceId':_0xef5523['id'],'type':_0x1aa10d[_0x8bc6('0x35')],'sectionId':_0x1aa10d['id']},{})[_0x8bc6('0x28')](function(){return _0x2b6242;});}else{return _0x2b6242;}})['catch'](function(_0x41f133){logger[_0x8bc6('0x2c')](_0x8bc6('0x7a'),_0x41f133);throw _0x41f133;});}return _0x2b6242;})[_0x8bc6('0x28')](respondWithResult(_0xbe5bbe,null))[_0x8bc6('0x48')](handleError(_0xbe5bbe,null));});_0x4701d8[_0x8bc6('0x7b')]();}catch(_0x3b4b6b){_0xbe5bbe[_0x8bc6('0x1c')](0x1f4)[_0x8bc6('0x65')](_0x3b4b6b);}};exports[_0x8bc6('0x7c')]=function(_0x3dca51,_0x2c4ebd,_0x112658){return db[_0x8bc6('0x2e')][_0x8bc6('0x4c')]({'where':{'id':_0x3dca51[_0x8bc6('0x4d')]['id']}})[_0x8bc6('0x28')](handleEntityNotFound(_0x2c4ebd,null))[_0x8bc6('0x28')](saveUpdates(_[_0x8bc6('0x41')](_0x3dca51[_0x8bc6('0x74')],['name',_0x8bc6('0x7d')]),null))[_0x8bc6('0x28')](respondWithResult(_0x2c4ebd,null))[_0x8bc6('0x48')](handleError(_0x2c4ebd,null));};exports['delete']=function(_0x4ace48,_0x282203,_0x2a03af){return db['Sound'][_0x8bc6('0x4c')]({'where':{'id':_0x4ace48['params']['id']}})[_0x8bc6('0x28')](function(_0x32fd96){if(_0x32fd96){return _0x32fd96[_0x8bc6('0x29')]();}})[_0x8bc6('0x28')](function(_0x7c2547){var _0x1d6000=path[_0x8bc6('0x55')](config[_0x8bc6('0x51')],_0x8bc6('0x60'),util[_0x8bc6('0x56')](_0x8bc6('0x57'),_0x7c2547['save_name'],_0x7c2547[_0x8bc6('0x7e')]));var _0x335f64=path['join'](config[_0x8bc6('0x51')],_0x8bc6('0x52'),util['format'](_0x8bc6('0x57'),_0x7c2547[_0x8bc6('0x4e')],_0x7c2547[_0x8bc6('0x4f')]));fs[_0x8bc6('0x64')](_0x1d6000);fs['unlinkSync'](_0x335f64);return _0x7c2547;})[_0x8bc6('0x28')](function(_0x57a32d){if(_0x57a32d){return _0x282203[_0x8bc6('0x1c')](0xcc)[_0x8bc6('0x1d')]();}})[_0x8bc6('0x28')](handleEntityNotFound(_0x282203,null))['catch'](handleError(_0x282203,null));}; \ No newline at end of file +var _0x26f6=['pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','format','%s.%s','create','basename','file','extname','originalname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','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','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','get','Sounds','UserProfileResource','error','stack','send','map','Sound','rawAttributes','type','model','name','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x26f6,0xbb));var _0x626f=function(_0x2a5739,_0x4aba91){_0x2a5739=_0x2a5739-0x0;var _0x5d0c34=_0x26f6[_0x2a5739];return _0x5d0c34;};'use strict';var emlformat=require(_0x626f('0x0'));var rimraf=require(_0x626f('0x1'));var zipdir=require(_0x626f('0x2'));var jsonpatch=require(_0x626f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x626f('0x4'));var Mustache=require(_0x626f('0x5'));var util=require(_0x626f('0x6'));var path=require(_0x626f('0x7'));var sox=require(_0x626f('0x8'));var csv=require(_0x626f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x626f('0xa'));var crypto=require(_0x626f('0xb'));var jsforce=require(_0x626f('0xc'));var deskjs=require(_0x626f('0xd'));var toCsv=require(_0x626f('0x9'));var querystring=require(_0x626f('0xe'));var Papa=require(_0x626f('0xf'));var Redis=require(_0x626f('0x10'));var authService=require(_0x626f('0x11'));var qs=require(_0x626f('0x12'));var as=require(_0x626f('0x13'));var hardwareService=require(_0x626f('0x14'));var logger=require(_0x626f('0x15'))(_0x626f('0x16'));var utils=require(_0x626f('0x17'));var config=require(_0x626f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x626f('0x19'))['db'];function respondWithStatusCode(_0x1f0205,_0x5a7782){_0x5a7782=_0x5a7782||0xcc;return function(_0xca1cf0){if(_0xca1cf0){return _0x1f0205[_0x626f('0x1a')](_0x5a7782);}return _0x1f0205['status'](_0x5a7782)[_0x626f('0x1b')]();};}function respondWithResult(_0x2aa64a,_0x2c1ac6){_0x2c1ac6=_0x2c1ac6||0xc8;return function(_0x1892c4){if(_0x1892c4){return _0x2aa64a[_0x626f('0x1c')](_0x2c1ac6)[_0x626f('0x1d')](_0x1892c4);}};}function respondWithFilteredResult(_0x42e761,_0x59d913){return function(_0x4e671a){if(_0x4e671a){var _0x1fe501=typeof _0x59d913[_0x626f('0x1e')]===_0x626f('0x1f')&&typeof _0x59d913[_0x626f('0x20')]===_0x626f('0x1f');var _0x3ef414=_0x4e671a[_0x626f('0x21')];var _0x350fad=_0x1fe501?0x0:_0x59d913[_0x626f('0x1e')];var _0x2563d1=_0x1fe501?_0x4e671a[_0x626f('0x21')]:_0x59d913[_0x626f('0x1e')]+_0x59d913['limit'];var _0x2030d2;if(_0x2563d1>=_0x3ef414){_0x2563d1=_0x3ef414;_0x2030d2=0xc8;}else{_0x2030d2=0xce;}_0x42e761[_0x626f('0x1c')](_0x2030d2);return _0x42e761[_0x626f('0x22')](_0x626f('0x23'),_0x350fad+'-'+_0x2563d1+'/'+_0x3ef414)[_0x626f('0x1d')](_0x4e671a);}return null;};}function patchUpdates(_0x29ae59){return function(_0x382575){try{jsonpatch['apply'](_0x382575,_0x29ae59,!![]);}catch(_0x17686b){return BPromise[_0x626f('0x24')](_0x17686b);}return _0x382575['save']();};}function saveUpdates(_0x1235e4,_0x31e54e){return function(_0x390636){if(_0x390636){return _0x390636['update'](_0x1235e4)['then'](function(_0x7618f2){return _0x7618f2;});}return null;};}function removeEntity(_0x2e82db,_0x2cda80){return function(_0x37d556){if(_0x37d556){return _0x37d556[_0x626f('0x25')]()[_0x626f('0x26')](function(){var _0x34a592=_0x37d556[_0x626f('0x27')]({'plain':!![]});var _0x205ad3=_0x626f('0x28');return db[_0x626f('0x29')][_0x626f('0x25')]({'where':{'type':_0x205ad3,'resourceId':_0x34a592['id']}})[_0x626f('0x26')](function(){return _0x37d556;});})[_0x626f('0x26')](function(){_0x2e82db[_0x626f('0x1c')](0xcc)[_0x626f('0x1b')]();});}};}function handleEntityNotFound(_0x422e5a,_0xf77573){return function(_0x984fa8){if(!_0x984fa8){_0x422e5a[_0x626f('0x1a')](0x194);}return _0x984fa8;};}function handleError(_0x337c85,_0xe57da2){_0xe57da2=_0xe57da2||0x1f4;return function(_0x24cee2){logger[_0x626f('0x2a')](_0x24cee2[_0x626f('0x2b')]);if(_0x24cee2['name']){delete _0x24cee2['name'];}_0x337c85[_0x626f('0x1c')](_0xe57da2)[_0x626f('0x2c')](_0x24cee2);};}exports['index']=function(_0x4b8f6e,_0xf82a40){var _0x1400cd={},_0x1abfac={},_0x4e6bab={'count':0x0,'rows':[]};var _0xffe8ee=_[_0x626f('0x2d')](db[_0x626f('0x2e')][_0x626f('0x2f')],function(_0x15ce69){return{'name':_0x15ce69['fieldName'],'type':_0x15ce69[_0x626f('0x30')]['key']};});_0x1abfac[_0x626f('0x31')]=_['map'](_0xffe8ee,_0x626f('0x32'));_0x1abfac['query']=_[_0x626f('0x33')](_0x4b8f6e['query']);_0x1abfac['filters']=_[_0x626f('0x34')](_0x1abfac[_0x626f('0x31')],_0x1abfac[_0x626f('0x35')]);_0x1400cd[_0x626f('0x36')]=_[_0x626f('0x34')](_0x1abfac[_0x626f('0x31')],qs['fields'](_0x4b8f6e[_0x626f('0x35')][_0x626f('0x37')]));_0x1400cd['attributes']=_0x1400cd[_0x626f('0x36')][_0x626f('0x38')]?_0x1400cd['attributes']:_0x1abfac[_0x626f('0x31')];if(!_0x4b8f6e[_0x626f('0x35')][_0x626f('0x39')](_0x626f('0x3a'))){_0x1400cd[_0x626f('0x20')]=qs[_0x626f('0x20')](_0x4b8f6e[_0x626f('0x35')]['limit']);_0x1400cd[_0x626f('0x1e')]=qs['offset'](_0x4b8f6e['query'][_0x626f('0x1e')]);}_0x1400cd[_0x626f('0x3b')]=qs[_0x626f('0x3c')](_0x4b8f6e[_0x626f('0x35')]['sort']);_0x1400cd[_0x626f('0x3d')]=qs[_0x626f('0x3e')](_[_0x626f('0x3f')](_0x4b8f6e[_0x626f('0x35')],_0x1abfac[_0x626f('0x3e')]),_0xffe8ee);if(_0x4b8f6e[_0x626f('0x35')]['filter']){_0x1400cd[_0x626f('0x3d')]=_[_0x626f('0x40')](_0x1400cd[_0x626f('0x3d')],{'$or':_[_0x626f('0x2d')](_0xffe8ee,function(_0x27c7e3){if(_0x27c7e3[_0x626f('0x30')]!==_0x626f('0x41')){var _0x24a064={};_0x24a064[_0x27c7e3[_0x626f('0x32')]]={'$like':'%'+_0x4b8f6e['query'][_0x626f('0x42')]+'%'};return _0x24a064;}})});}_0x1400cd=_[_0x626f('0x40')]({},_0x1400cd,_0x4b8f6e['options']);var _0xf674c6={'where':_0x1400cd[_0x626f('0x3d')]};return db[_0x626f('0x2e')]['count'](_0xf674c6)[_0x626f('0x26')](function(_0x993f01){_0x4e6bab['count']=_0x993f01;if(_0x4b8f6e[_0x626f('0x35')][_0x626f('0x43')]){_0x1400cd[_0x626f('0x44')]=[{'all':!![]}];}return db[_0x626f('0x2e')][_0x626f('0x45')](_0x1400cd);})['then'](function(_0x153c1a){_0x4e6bab['rows']=_0x153c1a;return _0x4e6bab;})[_0x626f('0x26')](respondWithFilteredResult(_0xf82a40,_0x1400cd))[_0x626f('0x46')](handleError(_0xf82a40,null));};exports[_0x626f('0x47')]=function(_0x40d1c3,_0x1348ed){var _0x50e439={'raw':!![],'where':{'id':_0x40d1c3[_0x626f('0x48')]['id']}},_0x19138a={};_0x19138a[_0x626f('0x31')]=_['keys'](db['Sound']['rawAttributes']);_0x19138a['query']=_[_0x626f('0x33')](_0x40d1c3[_0x626f('0x35')]);_0x19138a[_0x626f('0x3e')]=_['intersection'](_0x19138a[_0x626f('0x31')],_0x19138a['query']);_0x50e439[_0x626f('0x36')]=_['intersection'](_0x19138a[_0x626f('0x31')],qs[_0x626f('0x37')](_0x40d1c3[_0x626f('0x35')][_0x626f('0x37')]));_0x50e439['attributes']=_0x50e439[_0x626f('0x36')][_0x626f('0x38')]?_0x50e439[_0x626f('0x36')]:_0x19138a[_0x626f('0x31')];if(_0x40d1c3[_0x626f('0x35')][_0x626f('0x43')]){_0x50e439['include']=[{'all':!![]}];}_0x50e439=_['merge']({},_0x50e439,_0x40d1c3['options']);return db[_0x626f('0x2e')][_0x626f('0x49')](_0x50e439)['then'](handleEntityNotFound(_0x1348ed,null))[_0x626f('0x26')](respondWithResult(_0x1348ed,null))['catch'](handleError(_0x1348ed,null));};exports[_0x626f('0x4a')]=function(_0x30c31b,_0x18df7f,_0x2367e5){return db[_0x626f('0x2e')][_0x626f('0x49')]({'where':{'id':_0x30c31b['params']['id']},'attributes':['name',_0x626f('0x4b'),_0x626f('0x4c')],'raw':!![]})[_0x626f('0x26')](handleEntityNotFound(_0x18df7f,null))[_0x626f('0x26')](function(_0x2f8fea){if(_0x2f8fea){if(!fs[_0x626f('0x4d')](path[_0x626f('0x4e')](config[_0x626f('0x4f')],_0x626f('0x50'),_0x2f8fea[_0x626f('0x4b')]+'.'+_0x2f8fea[_0x626f('0x4c')]))){throw new db[(_0x626f('0x51'))]['ValidationError']('Sound\x20not\x20found');}return _0x18df7f[_0x626f('0x4a')](path[_0x626f('0x4e')](config[_0x626f('0x4f')],_0x626f('0x50'),util[_0x626f('0x52')]('%s.%s',_0x2f8fea['save_name'],_0x2f8fea[_0x626f('0x4c')])),util[_0x626f('0x52')](_0x626f('0x53'),_0x2f8fea[_0x626f('0x32')],_0x2f8fea[_0x626f('0x4c')]));}return null;})[_0x626f('0x46')](handleError(_0x18df7f,null));};exports[_0x626f('0x54')]=function(_0x4dd63e,_0x4df9ed,_0x23f069){var _0x5c442e={'name':path[_0x626f('0x55')](_0x4dd63e[_0x626f('0x56')]['originalname'],path[_0x626f('0x57')](_0x4dd63e[_0x626f('0x56')]['originalname'])),'save_name':path[_0x626f('0x55')](_0x4dd63e['file']['filename'],path[_0x626f('0x57')](_0x4dd63e[_0x626f('0x56')]['filename'])),'original_format':path[_0x626f('0x57')](_0x4dd63e[_0x626f('0x56')][_0x626f('0x58')])[_0x626f('0x59')](0x1),'converted_format':_0x626f('0x5a')};var _0x45a66d=path[_0x626f('0x4e')](config[_0x626f('0x4f')],_0x626f('0x5b'),_0x4dd63e[_0x626f('0x56')][_0x626f('0x5c')]);var _0x5abb7c=path[_0x626f('0x4e')](config[_0x626f('0x4f')],_0x626f('0x50'),util[_0x626f('0x52')](_0x626f('0x53'),path['basename'](_0x4dd63e[_0x626f('0x56')][_0x626f('0x5c')],path[_0x626f('0x57')](_0x4dd63e['file'][_0x626f('0x5c')])),_0x5c442e['converted_format']));logger[_0x626f('0x5d')](_0x626f('0x5e'),_0x45a66d);logger[_0x626f('0x5d')](_0x626f('0x5f'),_0x5abb7c);try{fs[_0x626f('0x60')](_0x45a66d,parseInt(_0x626f('0x61'),0x8));var _0x36e533=sox[_0x626f('0x62')](_0x45a66d,_0x5abb7c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36e533['on'](_0x626f('0x2a'),function(_0x5886ae){fs[_0x626f('0x63')](_0x45a66d);_0x4df9ed[_0x626f('0x1c')](0x1f4)['send'](_0x5886ae);});_0x36e533['on'](_0x626f('0x64'),function(_0x12154a){_0x5c442e[_0x626f('0x65')]=isNaN(_0x12154a['duration'])?null:_0x12154a[_0x626f('0x66')]*0x3e8;_0x5c442e[_0x626f('0x67')]=isNaN(_0x12154a[_0x626f('0x68')])?null:_0x12154a[_0x626f('0x68')];_0x5c442e[_0x626f('0x69')]=isNaN(_0x12154a['channelCount'])?null:_0x12154a[_0x626f('0x6a')];_0x5c442e[_0x626f('0x6b')]=isNaN(_0x12154a[_0x626f('0x6c')])?null:_0x12154a['bitRate'];_0x5c442e['original_sampleRate']=isNaN(_0x12154a[_0x626f('0x6d')])?null:_0x12154a[_0x626f('0x6d')];});_0x36e533['on']('dest',function(_0x43271b){_0x5c442e['converted_duration']=isNaN(_0x43271b[_0x626f('0x66')])?null:_0x43271b[_0x626f('0x66')]*0x3e8;_0x5c442e[_0x626f('0x6e')]=isNaN(_0x43271b[_0x626f('0x68')])?null:_0x43271b[_0x626f('0x68')];_0x5c442e[_0x626f('0x6f')]=isNaN(_0x43271b[_0x626f('0x6a')])?null:_0x43271b[_0x626f('0x6a')];_0x5c442e[_0x626f('0x70')]=isNaN(_0x43271b[_0x626f('0x6c')])?null:_0x43271b[_0x626f('0x6c')];_0x5c442e[_0x626f('0x71')]=isNaN(_0x43271b['sampleRate'])?null:_0x43271b[_0x626f('0x6d')];});_0x36e533['on'](_0x626f('0x1b'),function(){fs['chmodSync'](_0x5abb7c,parseInt(_0x626f('0x61'),0x8));return db[_0x626f('0x2e')]['create'](_0x5c442e)[_0x626f('0x26')](function(_0x188342){var _0x2847e2={'role':_0x4dd63e[_0x626f('0x72')][_0x626f('0x73')],'userProfileId':_0x4dd63e['body'][_0x626f('0x74')]};if(!_0x2847e2)throw new Error(_0x626f('0x75'));if(_0x2847e2[_0x626f('0x73')]===_0x626f('0x76')){var _0x39998f=_0x188342[_0x626f('0x27')]({'plain':!![]});return db[_0x626f('0x77')][_0x626f('0x49')]({'where':{'name':'Sounds','userProfileId':_0x2847e2[_0x626f('0x74')]},'raw':!![]})['then'](function(_0x5bd9ce){if(_0x5bd9ce&&_0x5bd9ce[_0x626f('0x78')]===0x0){return db[_0x626f('0x29')][_0x626f('0x54')]({'name':_0x39998f['name'],'resourceId':_0x39998f['id'],'type':_0x5bd9ce[_0x626f('0x32')],'sectionId':_0x5bd9ce['id']},{})[_0x626f('0x26')](function(){return _0x188342;});}else{return _0x188342;}})[_0x626f('0x46')](function(_0x495ed7){logger['error'](_0x626f('0x79'),_0x495ed7);throw _0x495ed7;});}return _0x188342;})[_0x626f('0x26')](respondWithResult(_0x4df9ed,null))[_0x626f('0x46')](handleError(_0x4df9ed,null));});_0x36e533['start']();}catch(_0x566894){_0x4df9ed[_0x626f('0x1c')](0x1f4)[_0x626f('0x2c')](_0x566894);}};exports[_0x626f('0x7a')]=function(_0x188990,_0x10b5f9,_0x252387){return db['Sound'][_0x626f('0x49')]({'where':{'id':_0x188990[_0x626f('0x48')]['id']}})[_0x626f('0x26')](handleEntityNotFound(_0x10b5f9,null))[_0x626f('0x26')](saveUpdates(_[_0x626f('0x3f')](_0x188990[_0x626f('0x72')],[_0x626f('0x32'),'description']),null))[_0x626f('0x26')](respondWithResult(_0x10b5f9,null))['catch'](handleError(_0x10b5f9,null));};exports[_0x626f('0x7b')]=function(_0x1fe991,_0x4ff770,_0x4dc023){return db[_0x626f('0x2e')]['find']({'where':{'id':_0x1fe991[_0x626f('0x48')]['id']}})['then'](function(_0x1ce6c4){if(_0x1ce6c4){return _0x1ce6c4[_0x626f('0x25')]();}})[_0x626f('0x26')](function(_0x481cc4){var _0x2c28a4=path[_0x626f('0x4e')](config[_0x626f('0x4f')],_0x626f('0x5b'),util[_0x626f('0x52')]('%s.%s',_0x481cc4[_0x626f('0x4b')],_0x481cc4[_0x626f('0x7c')]));var _0x59285c=path['join'](config['root'],_0x626f('0x50'),util[_0x626f('0x52')](_0x626f('0x53'),_0x481cc4['save_name'],_0x481cc4[_0x626f('0x4c')]));fs[_0x626f('0x63')](_0x2c28a4);fs[_0x626f('0x63')](_0x59285c);return _0x481cc4;})[_0x626f('0x26')](function(_0x52267c){if(_0x52267c){return _0x4ff770['status'](0xcc)[_0x626f('0x1b')]();}})[_0x626f('0x26')](handleEntityNotFound(_0x4ff770,null))[_0x626f('0x46')](handleError(_0x4ff770,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 11432e5..9af1dee 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 _0x1b41=['tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','Sound'];(function(_0x991a35,_0x216bfe){var _0x3fa2a9=function(_0x33aa01){while(--_0x33aa01){_0x991a35['push'](_0x991a35['shift']());}};_0x3fa2a9(++_0x216bfe);}(_0x1b41,0x6f));var _0x11b4=function(_0x4bf3a7,_0x5d756b){_0x4bf3a7=_0x4bf3a7-0x0;var _0x58c9cc=_0x1b41[_0x4bf3a7];return _0x58c9cc;};'use strict';var _=require(_0x11b4('0x0'));var util=require(_0x11b4('0x1'));var logger=require(_0x11b4('0x2'))('api');var moment=require(_0x11b4('0x3'));var BPromise=require(_0x11b4('0x4'));var rp=require(_0x11b4('0x5'));var fs=require('fs');var path=require(_0x11b4('0x6'));var rimraf=require('rimraf');var config=require(_0x11b4('0x7'));var attributes=require('./sound.attributes');module['exports']=function(_0x9204c8,_0x2e7353){return _0x9204c8[_0x11b4('0x8')](_0x11b4('0x9'),attributes,{'tableName':_0x11b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf84b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util'];(function(_0xcc811c,_0xb3663f){var _0x3907c0=function(_0x3bba46){while(--_0x3bba46){_0xcc811c['push'](_0xcc811c['shift']());}};_0x3907c0(++_0xb3663f);}(_0xf84b,0xdb));var _0xbf84=function(_0x154bd0,_0x5bf8ac){_0x154bd0=_0x154bd0-0x0;var _0x4db1dc=_0xf84b[_0x154bd0];return _0x4db1dc;};'use strict';var _=require(_0xbf84('0x0'));var util=require(_0xbf84('0x1'));var logger=require(_0xbf84('0x2'))(_0xbf84('0x3'));var moment=require(_0xbf84('0x4'));var BPromise=require(_0xbf84('0x5'));var rp=require(_0xbf84('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf84('0x7'));var config=require(_0xbf84('0x8'));var attributes=require(_0xbf84('0x9'));module[_0xbf84('0xa')]=function(_0x345304,_0x1493b4){return _0x345304[_0xbf84('0xb')](_0xbf84('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 9bcd4cf..39b68ed 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 _0x9f2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','ShowSound','Sound','options','raw','where','map','include','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3226d6,_0x5420a8){var _0x215a6a=function(_0xffdefd){while(--_0xffdefd){_0x3226d6['push'](_0x3226d6['shift']());}};_0x215a6a(++_0x5420a8);}(_0x9f2f,0xf2));var _0xf9f2=function(_0xef0238,_0x4c1d56){_0xef0238=_0xef0238-0x0;var _0x5c4dab=_0x9f2f[_0xef0238];return _0x5c4dab;};'use strict';var _=require(_0xf9f2('0x0'));var util=require(_0xf9f2('0x1'));var moment=require(_0xf9f2('0x2'));var BPromise=require(_0xf9f2('0x3'));var rs=require(_0xf9f2('0x4'));var fs=require('fs');var Redis=require(_0xf9f2('0x5'));var db=require(_0xf9f2('0x6'))['db'];var utils=require(_0xf9f2('0x7'));var logger=require(_0xf9f2('0x8'))(_0xf9f2('0x9'));var config=require('../../config/environment');var jayson=require(_0xf9f2('0xa'));var client=jayson['client'][_0xf9f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6ed5,_0x25e2ee,_0x45ec44){return new BPromise(function(_0x5a701c,_0x253c42){return client['request'](_0x4d6ed5,_0x45ec44)[_0xf9f2('0xc')](function(_0x83f637){logger[_0xf9f2('0xd')](_0xf9f2('0xe'),_0x25e2ee,_0xf9f2('0xf'));logger[_0xf9f2('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x25e2ee,'request\x20sent',JSON['stringify'](_0x83f637));if(_0x83f637[_0xf9f2('0x11')]){if(_0x83f637['error'][_0xf9f2('0x12')]===0x1f4){logger[_0xf9f2('0x11')](_0xf9f2('0xe'),_0x25e2ee,_0x83f637['error'][_0xf9f2('0x13')]);return _0x253c42(_0x83f637[_0xf9f2('0x11')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x25e2ee,_0x83f637[_0xf9f2('0x11')][_0xf9f2('0x13')]);return _0x5a701c(_0x83f637['error']['message']);}else{logger[_0xf9f2('0xd')](_0xf9f2('0xe'),_0x25e2ee,_0xf9f2('0xf'));_0x5a701c(_0x83f637['result'][_0xf9f2('0x13')]);}})[_0xf9f2('0x14')](function(_0x49a17f){logger[_0xf9f2('0x11')](_0xf9f2('0xe'),_0x25e2ee,_0x49a17f);_0x253c42(_0x49a17f);});});}exports[_0xf9f2('0x15')]=function(_0x33065f){var _0x2ccc6b=this;return new Promise(function(_0x18ef65,_0x508470){return db[_0xf9f2('0x16')]['find']({'raw':_0x33065f[_0xf9f2('0x17')]?_0x33065f[_0xf9f2('0x17')][_0xf9f2('0x18')]===undefined?!![]:![]:!![],'where':_0x33065f[_0xf9f2('0x17')]?_0x33065f[_0xf9f2('0x17')][_0xf9f2('0x19')]||null:null,'attributes':_0x33065f[_0xf9f2('0x17')]?_0x33065f[_0xf9f2('0x17')]['attributes']||null:null,'include':_0x33065f['options']?_0x33065f[_0xf9f2('0x17')]['include']?_[_0xf9f2('0x1a')](_0x33065f['options'][_0xf9f2('0x1b')],function(_0x548696){return{'model':db[_0x548696[_0xf9f2('0x1c')]],'as':_0x548696['as'],'attributes':_0x548696[_0xf9f2('0x1d')],'include':_0x548696[_0xf9f2('0x1b')]?_[_0xf9f2('0x1a')](_0x548696['include'],function(_0x338971){return{'model':db[_0x338971[_0xf9f2('0x1c')]],'as':_0x338971['as'],'attributes':_0x338971[_0xf9f2('0x1d')],'include':_0x338971['include']?_[_0xf9f2('0x1a')](_0x338971['include'],function(_0x52e4cb){return{'model':db[_0x52e4cb[_0xf9f2('0x1c')]],'as':_0x52e4cb['as'],'attributes':_0x52e4cb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16637f){logger[_0xf9f2('0xd')](_0xf9f2('0x15'),_0x33065f);logger['debug'](_0xf9f2('0x15'),_0x33065f,JSON[_0xf9f2('0x1e')](_0x16637f));_0x18ef65(_0x16637f);})[_0xf9f2('0x14')](function(_0x900e51){logger[_0xf9f2('0x11')](_0xf9f2('0x15'),_0x900e51[_0xf9f2('0x13')],_0x33065f);_0x508470(_0x2ccc6b[_0xf9f2('0x11')](0x1f4,_0x900e51[_0xf9f2('0x13')]));});});}; \ No newline at end of file +var _0xef1f=['rpc','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','model','map','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2122f,_0x41c9d7){var _0x25924c=function(_0x4adc79){while(--_0x4adc79){_0x2122f['push'](_0x2122f['shift']());}};_0x25924c(++_0x41c9d7);}(_0xef1f,0x18e));var _0xfef1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xef1f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfef1('0x0'));var util=require('util');var moment=require(_0xfef1('0x1'));var BPromise=require('bluebird');var rs=require(_0xfef1('0x2'));var fs=require('fs');var Redis=require(_0xfef1('0x3'));var db=require(_0xfef1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfef1('0x5'));var config=require('../../config/environment');var jayson=require(_0xfef1('0x6'));var client=jayson[_0xfef1('0x7')][_0xfef1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x592fbd,_0x20ee9c,_0x1f97be){return new BPromise(function(_0x3c6004,_0x34eb0e){return client[_0xfef1('0x9')](_0x592fbd,_0x1f97be)['then'](function(_0x297720){logger[_0xfef1('0xa')](_0xfef1('0xb'),_0x20ee9c,_0xfef1('0xc'));logger['debug'](_0xfef1('0xd'),_0x20ee9c,_0xfef1('0xc'),JSON[_0xfef1('0xe')](_0x297720));if(_0x297720[_0xfef1('0xf')]){if(_0x297720[_0xfef1('0xf')][_0xfef1('0x10')]===0x1f4){logger[_0xfef1('0xf')](_0xfef1('0xb'),_0x20ee9c,_0x297720[_0xfef1('0xf')][_0xfef1('0x11')]);return _0x34eb0e(_0x297720['error']['message']);}logger[_0xfef1('0xf')]('Sound,\x20%s,\x20%s',_0x20ee9c,_0x297720[_0xfef1('0xf')]['message']);return _0x3c6004(_0x297720['error'][_0xfef1('0x11')]);}else{logger[_0xfef1('0xa')](_0xfef1('0xb'),_0x20ee9c,_0xfef1('0xc'));_0x3c6004(_0x297720[_0xfef1('0x12')][_0xfef1('0x11')]);}})[_0xfef1('0x13')](function(_0x96e831){logger['error'](_0xfef1('0xb'),_0x20ee9c,_0x96e831);_0x34eb0e(_0x96e831);});});}exports[_0xfef1('0x14')]=function(_0x3f0030){var _0x56d757=this;return new Promise(function(_0x2eac84,_0x501f19){return db[_0xfef1('0x15')][_0xfef1('0x16')]({'raw':_0x3f0030[_0xfef1('0x17')]?_0x3f0030[_0xfef1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3f0030['options']?_0x3f0030['options'][_0xfef1('0x18')]||null:null,'attributes':_0x3f0030[_0xfef1('0x17')]?_0x3f0030['options'][_0xfef1('0x19')]||null:null,'include':_0x3f0030[_0xfef1('0x17')]?_0x3f0030[_0xfef1('0x17')][_0xfef1('0x1a')]?_['map'](_0x3f0030[_0xfef1('0x17')]['include'],function(_0xcdc79d){return{'model':db[_0xcdc79d[_0xfef1('0x1b')]],'as':_0xcdc79d['as'],'attributes':_0xcdc79d[_0xfef1('0x19')],'include':_0xcdc79d['include']?_[_0xfef1('0x1c')](_0xcdc79d['include'],function(_0x4b0f21){return{'model':db[_0x4b0f21[_0xfef1('0x1b')]],'as':_0x4b0f21['as'],'attributes':_0x4b0f21[_0xfef1('0x19')],'include':_0x4b0f21['include']?_[_0xfef1('0x1c')](_0x4b0f21[_0xfef1('0x1a')],function(_0x562d75){return{'model':db[_0x562d75[_0xfef1('0x1b')]],'as':_0x562d75['as'],'attributes':_0x562d75[_0xfef1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfef1('0x1d')](function(_0x103820){logger[_0xfef1('0xa')]('ShowSound',_0x3f0030);logger[_0xfef1('0x1e')](_0xfef1('0x14'),_0x3f0030,JSON[_0xfef1('0xe')](_0x103820));_0x2eac84(_0x103820);})[_0xfef1('0x13')](function(_0x5841be){logger[_0xfef1('0xf')](_0xfef1('0x14'),_0x5841be['message'],_0x3f0030);_0x501f19(_0x56d757['error'](0x1f4,_0x5841be[_0xfef1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 8781ae4..6142ea3 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x4baa11,_0x7c6290){var _0x219273=function(_0x4a3887){while(--_0x4a3887){_0x4baa11['push'](_0x4baa11['shift']());}};_0x219273(++_0x7c6290);}(_0xda2d,0x102));var _0xdda2=function(_0x48ff22,_0x41c15d){_0x48ff22=_0x48ff22-0x0;var _0x55685a=_0xda2d[_0x48ff22];return _0x55685a;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x6b4f52,_0x4a17d1){var _0xa387e5=function(_0x2643b8){while(--_0x2643b8){_0x6b4f52['push'](_0x6b4f52['shift']());}};_0xa387e5(++_0x4a17d1);}(_0xda2d,0x102));var _0xdda2=function(_0x45df74,_0x553495){_0x45df74=_0x45df74-0x0;var _0x51608c=_0xda2d[_0x45df74];return _0x51608c;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 3b23cfe..6f47b33 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 _0x539a=['ENUM','STRING','sequelize','TEXT','medium'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x539a,0x7a));var _0xa539=function(_0x26ebfe,_0x5813f2){_0x26ebfe=_0x26ebfe-0x0;var _0x33544c=_0x539a[_0x26ebfe];return _0x33544c;};'use strict';var Sequelize=require(_0xa539('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xa539('0x1')](_0xa539('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xa539('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xa539('0x4')]},'providerResponse':{'type':Sequelize[_0xa539('0x1')]}}; \ No newline at end of file +var _0xbfae=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbfae,0x197));var _0xebfa=function(_0x12f14b,_0x45bcb1){_0x12f14b=_0x12f14b-0x0;var _0x53a73a=_0xbfae[_0x12f14b];return _0x53a73a;};'use strict';var Sequelize=require(_0xebfa('0x0'));module[_0xebfa('0x1')]={'uniqueid':{'type':Sequelize[_0xebfa('0x2')]},'body':{'type':Sequelize[_0xebfa('0x3')](_0xebfa('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xebfa('0x5')),'defaultValue':_0xebfa('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xebfa('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 9781c4b..e10fc24 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 _0xd386=['../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','SquareMessage','fieldName','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','filters','intersection','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x393f55,_0x42563c){var _0x525c6c=function(_0x39e732){while(--_0x39e732){_0x393f55['push'](_0x393f55['shift']());}};_0x525c6c(++_0x42563c);}(_0xd386,0x10c));var _0x6d38=function(_0xf53937,_0x2bf512){_0xf53937=_0xf53937-0x0;var _0x33b67b=_0xd386[_0xf53937];return _0x33b67b;};'use strict';var emlformat=require(_0x6d38('0x0'));var rimraf=require(_0x6d38('0x1'));var zipdir=require(_0x6d38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d38('0x3'));var moment=require(_0x6d38('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d38('0x5'));var util=require(_0x6d38('0x6'));var path=require(_0x6d38('0x7'));var sox=require(_0x6d38('0x8'));var csv=require('to-csv');var ejs=require(_0x6d38('0x9'));var fs=require('fs');var fs_extra=require(_0x6d38('0xa'));var _=require(_0x6d38('0xb'));var squel=require(_0x6d38('0xc'));var crypto=require(_0x6d38('0xd'));var jsforce=require(_0x6d38('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d38('0xf'));var querystring=require('querystring');var Papa=require(_0x6d38('0x10'));var Redis=require('ioredis');var authService=require(_0x6d38('0x11'));var qs=require(_0x6d38('0x12'));var as=require(_0x6d38('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d38('0x14'))(_0x6d38('0x15'));var utils=require(_0x6d38('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bde60,_0x2d904c){_0x2d904c=_0x2d904c||0xcc;return function(_0x1f75fa){if(_0x1f75fa){return _0x1bde60[_0x6d38('0x17')](_0x2d904c);}return _0x1bde60[_0x6d38('0x18')](_0x2d904c)['end']();};}function respondWithResult(_0xa01398,_0x499239){_0x499239=_0x499239||0xc8;return function(_0x8a13ed){if(_0x8a13ed){return _0xa01398[_0x6d38('0x18')](_0x499239)[_0x6d38('0x19')](_0x8a13ed);}};}function respondWithFilteredResult(_0x22a822,_0x30a7f5){return function(_0x49c7ac){if(_0x49c7ac){var _0x585db3=typeof _0x30a7f5['offset']===_0x6d38('0x1a')&&typeof _0x30a7f5[_0x6d38('0x1b')]===_0x6d38('0x1a');var _0xdc66e8=_0x49c7ac[_0x6d38('0x1c')];var _0x11298c=_0x585db3?0x0:_0x30a7f5['offset'];var _0x278829=_0x585db3?_0x49c7ac[_0x6d38('0x1c')]:_0x30a7f5[_0x6d38('0x1d')]+_0x30a7f5[_0x6d38('0x1b')];var _0x29a768;if(_0x278829>=_0xdc66e8){_0x278829=_0xdc66e8;_0x29a768=0xc8;}else{_0x29a768=0xce;}_0x22a822[_0x6d38('0x18')](_0x29a768);return _0x22a822[_0x6d38('0x1e')](_0x6d38('0x1f'),_0x11298c+'-'+_0x278829+'/'+_0xdc66e8)['json'](_0x49c7ac);}return null;};}function patchUpdates(_0x3da186){return function(_0x24680b){try{jsonpatch['apply'](_0x24680b,_0x3da186,!![]);}catch(_0x4b68a4){return BPromise[_0x6d38('0x20')](_0x4b68a4);}return _0x24680b[_0x6d38('0x21')]();};}function saveUpdates(_0x45708c,_0x153cae){return function(_0x593d66){if(_0x593d66){return _0x593d66[_0x6d38('0x22')](_0x45708c)['then'](function(_0x44ad2d){return _0x44ad2d;});}return null;};}function removeEntity(_0x52f608,_0x473895){return function(_0x509860){if(_0x509860){return _0x509860[_0x6d38('0x23')]()[_0x6d38('0x24')](function(){_0x52f608[_0x6d38('0x18')](0xcc)[_0x6d38('0x25')]();});}};}function handleEntityNotFound(_0x3c777a,_0x4fc364){return function(_0x5dfb0c){if(!_0x5dfb0c){_0x3c777a[_0x6d38('0x17')](0x194);}return _0x5dfb0c;};}function handleError(_0x7f5c61,_0x552e59){_0x552e59=_0x552e59||0x1f4;return function(_0x4f2769){logger[_0x6d38('0x26')](_0x4f2769['stack']);if(_0x4f2769['name']){delete _0x4f2769[_0x6d38('0x27')];}_0x7f5c61[_0x6d38('0x18')](_0x552e59)[_0x6d38('0x28')](_0x4f2769);};}exports[_0x6d38('0x29')]=function(_0x2b73af,_0x19a674){var _0x513f13={},_0x3e62cf={},_0x572648={'count':0x0,'rows':[]};var _0x19ab6e=_['map'](db[_0x6d38('0x2a')]['rawAttributes'],function(_0x2eddcc){return{'name':_0x2eddcc[_0x6d38('0x2b')],'type':_0x2eddcc['type']['key']};});_0x3e62cf[_0x6d38('0x2c')]=_[_0x6d38('0x2d')](_0x19ab6e,_0x6d38('0x27'));_0x3e62cf[_0x6d38('0x2e')]=_[_0x6d38('0x2f')](_0x2b73af[_0x6d38('0x2e')]);_0x3e62cf['filters']=_['intersection'](_0x3e62cf[_0x6d38('0x2c')],_0x3e62cf['query']);_0x513f13[_0x6d38('0x30')]=_['intersection'](_0x3e62cf[_0x6d38('0x2c')],qs[_0x6d38('0x31')](_0x2b73af[_0x6d38('0x2e')]['fields']));_0x513f13[_0x6d38('0x30')]=_0x513f13[_0x6d38('0x30')][_0x6d38('0x32')]?_0x513f13[_0x6d38('0x30')]:_0x3e62cf[_0x6d38('0x2c')];if(!_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x33')](_0x6d38('0x34'))){_0x513f13[_0x6d38('0x1b')]=qs['limit'](_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x1b')]);_0x513f13[_0x6d38('0x1d')]=qs['offset'](_0x2b73af['query'][_0x6d38('0x1d')]);}_0x513f13['order']=qs[_0x6d38('0x35')](_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x35')]);_0x513f13[_0x6d38('0x36')]=qs['filters'](_[_0x6d38('0x37')](_0x2b73af['query'],_0x3e62cf['filters']),_0x19ab6e);if(_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x38')]){_0x513f13['where']=_['merge'](_0x513f13[_0x6d38('0x36')],{'$or':_[_0x6d38('0x2d')](_0x19ab6e,function(_0x58b5bc){if(_0x58b5bc['type']!==_0x6d38('0x39')){var _0x4491c4={};_0x4491c4[_0x58b5bc['name']]={'$like':'%'+_0x2b73af['query'][_0x6d38('0x38')]+'%'};return _0x4491c4;}})});}_0x513f13=_[_0x6d38('0x3a')]({},_0x513f13,_0x2b73af[_0x6d38('0x3b')]);var _0x2a17a5={'where':_0x513f13[_0x6d38('0x36')]};return db[_0x6d38('0x2a')][_0x6d38('0x1c')](_0x2a17a5)['then'](function(_0x1f4732){_0x572648[_0x6d38('0x1c')]=_0x1f4732;if(_0x2b73af['query'][_0x6d38('0x3c')]){_0x513f13[_0x6d38('0x3d')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x513f13);})['then'](function(_0x5c789d){_0x572648[_0x6d38('0x3e')]=_0x5c789d;return _0x572648;})[_0x6d38('0x24')](respondWithFilteredResult(_0x19a674,_0x513f13))['catch'](handleError(_0x19a674,null));};exports[_0x6d38('0x3f')]=function(_0x16da57,_0x4ea04c){var _0x49f278={'raw':!![],'where':{'id':_0x16da57[_0x6d38('0x40')]['id']}},_0x26203c={};_0x26203c[_0x6d38('0x2c')]=_[_0x6d38('0x2f')](db['SquareMessage'][_0x6d38('0x41')]);_0x26203c[_0x6d38('0x2e')]=_[_0x6d38('0x2f')](_0x16da57[_0x6d38('0x2e')]);_0x26203c[_0x6d38('0x42')]=_[_0x6d38('0x43')](_0x26203c[_0x6d38('0x2c')],_0x26203c[_0x6d38('0x2e')]);_0x49f278[_0x6d38('0x30')]=_[_0x6d38('0x43')](_0x26203c['model'],qs[_0x6d38('0x31')](_0x16da57[_0x6d38('0x2e')][_0x6d38('0x31')]));_0x49f278[_0x6d38('0x30')]=_0x49f278['attributes'][_0x6d38('0x32')]?_0x49f278[_0x6d38('0x30')]:_0x26203c[_0x6d38('0x2c')];if(_0x16da57[_0x6d38('0x2e')][_0x6d38('0x3c')]){_0x49f278[_0x6d38('0x3d')]=[{'all':!![]}];}_0x49f278=_[_0x6d38('0x3a')]({},_0x49f278,_0x16da57[_0x6d38('0x3b')]);return db[_0x6d38('0x2a')][_0x6d38('0x44')](_0x49f278)[_0x6d38('0x24')](handleEntityNotFound(_0x4ea04c,null))['then'](respondWithResult(_0x4ea04c,null))['catch'](handleError(_0x4ea04c,null));};exports[_0x6d38('0x45')]=function(_0x5de7c4,_0x50f0c7){return db['SquareMessage'][_0x6d38('0x45')](_0x5de7c4[_0x6d38('0x46')],{})[_0x6d38('0x24')](respondWithResult(_0x50f0c7,0xc9))['catch'](handleError(_0x50f0c7,null));};exports[_0x6d38('0x22')]=function(_0x30bfc0,_0x492024){if(_0x30bfc0['body']['id']){delete _0x30bfc0[_0x6d38('0x46')]['id'];}return db['SquareMessage'][_0x6d38('0x44')]({'where':{'id':_0x30bfc0['params']['id']}})[_0x6d38('0x24')](handleEntityNotFound(_0x492024,null))[_0x6d38('0x24')](saveUpdates(_0x30bfc0[_0x6d38('0x46')],null))['then'](respondWithResult(_0x492024,null))[_0x6d38('0x47')](handleError(_0x492024,null));};exports[_0x6d38('0x23')]=function(_0x5ecb1c,_0x5389f6){return db[_0x6d38('0x2a')][_0x6d38('0x44')]({'where':{'id':_0x5ecb1c[_0x6d38('0x40')]['id']}})[_0x6d38('0x24')](handleEntityNotFound(_0x5389f6,null))[_0x6d38('0x24')](removeEntity(_0x5389f6,null))[_0x6d38('0x47')](handleError(_0x5389f6,null));}; \ No newline at end of file +var _0x29b1=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','create','body','update','find','destroy','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x2dd1ca,_0x19367b){var _0xeeeeb6=function(_0x4ecf82){while(--_0x4ecf82){_0x2dd1ca['push'](_0x2dd1ca['shift']());}};_0xeeeeb6(++_0x19367b);}(_0x29b1,0xbb));var _0x129b=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x29b1[_0x1b5aea];return _0x15cfc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x129b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x129b('0x1'));var BPromise=require(_0x129b('0x2'));var Mustache=require(_0x129b('0x3'));var util=require('util');var path=require(_0x129b('0x4'));var sox=require(_0x129b('0x5'));var csv=require(_0x129b('0x6'));var ejs=require(_0x129b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x129b('0x8'));var squel=require(_0x129b('0x9'));var crypto=require(_0x129b('0xa'));var jsforce=require(_0x129b('0xb'));var deskjs=require(_0x129b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x129b('0xd'));var Redis=require(_0x129b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x129b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x129b('0x10'));var logger=require('../../config/logger')(_0x129b('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x129b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14bb9e,_0x2d91ae){_0x2d91ae=_0x2d91ae||0xcc;return function(_0x9c34e9){if(_0x9c34e9){return _0x14bb9e[_0x129b('0x13')](_0x2d91ae);}return _0x14bb9e['status'](_0x2d91ae)[_0x129b('0x14')]();};}function respondWithResult(_0x31af49,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0xc8;return function(_0x3e8cdd){if(_0x3e8cdd){return _0x31af49[_0x129b('0x15')](_0x1d2d9d)[_0x129b('0x16')](_0x3e8cdd);}};}function respondWithFilteredResult(_0x27cc3c,_0xccd96f){return function(_0x3fb558){if(_0x3fb558){var _0x1e28b2=typeof _0xccd96f[_0x129b('0x17')]===_0x129b('0x18')&&typeof _0xccd96f[_0x129b('0x19')]===_0x129b('0x18');var _0x5fb732=_0x3fb558[_0x129b('0x1a')];var _0xdaa9d7=_0x1e28b2?0x0:_0xccd96f[_0x129b('0x17')];var _0x40047e=_0x1e28b2?_0x3fb558[_0x129b('0x1a')]:_0xccd96f[_0x129b('0x17')]+_0xccd96f[_0x129b('0x19')];var _0x1f4394;if(_0x40047e>=_0x5fb732){_0x40047e=_0x5fb732;_0x1f4394=0xc8;}else{_0x1f4394=0xce;}_0x27cc3c['status'](_0x1f4394);return _0x27cc3c[_0x129b('0x1b')](_0x129b('0x1c'),_0xdaa9d7+'-'+_0x40047e+'/'+_0x5fb732)[_0x129b('0x16')](_0x3fb558);}return null;};}function patchUpdates(_0x52d3e9){return function(_0x1457a6){try{jsonpatch['apply'](_0x1457a6,_0x52d3e9,!![]);}catch(_0x4ba9fb){return BPromise[_0x129b('0x1d')](_0x4ba9fb);}return _0x1457a6[_0x129b('0x1e')]();};}function saveUpdates(_0x5ca376,_0xad9cd0){return function(_0x220e97){if(_0x220e97){return _0x220e97['update'](_0x5ca376)['then'](function(_0x51cc74){return _0x51cc74;});}return null;};}function removeEntity(_0x10f641,_0x49c772){return function(_0xff1d67){if(_0xff1d67){return _0xff1d67['destroy']()[_0x129b('0x1f')](function(){_0x10f641['status'](0xcc)[_0x129b('0x14')]();});}};}function handleEntityNotFound(_0x1cb446,_0x330e9e){return function(_0x4e2105){if(!_0x4e2105){_0x1cb446[_0x129b('0x13')](0x194);}return _0x4e2105;};}function handleError(_0x23a35c,_0x53de1c){_0x53de1c=_0x53de1c||0x1f4;return function(_0xab26ee){logger['error'](_0xab26ee[_0x129b('0x20')]);if(_0xab26ee['name']){delete _0xab26ee[_0x129b('0x21')];}_0x23a35c[_0x129b('0x15')](_0x53de1c)[_0x129b('0x22')](_0xab26ee);};}exports[_0x129b('0x23')]=function(_0x10cc9e,_0xc8b344){var _0x3286e2={},_0x401c41={},_0x5388d2={'count':0x0,'rows':[]};var _0x29f816=_[_0x129b('0x24')](db[_0x129b('0x25')][_0x129b('0x26')],function(_0x26f1e2){return{'name':_0x26f1e2[_0x129b('0x27')],'type':_0x26f1e2[_0x129b('0x28')]['key']};});_0x401c41[_0x129b('0x29')]=_[_0x129b('0x24')](_0x29f816,_0x129b('0x21'));_0x401c41[_0x129b('0x2a')]=_['keys'](_0x10cc9e[_0x129b('0x2a')]);_0x401c41['filters']=_[_0x129b('0x2b')](_0x401c41[_0x129b('0x29')],_0x401c41['query']);_0x3286e2[_0x129b('0x2c')]=_[_0x129b('0x2b')](_0x401c41[_0x129b('0x29')],qs['fields'](_0x10cc9e[_0x129b('0x2a')]['fields']));_0x3286e2[_0x129b('0x2c')]=_0x3286e2[_0x129b('0x2c')][_0x129b('0x2d')]?_0x3286e2[_0x129b('0x2c')]:_0x401c41[_0x129b('0x29')];if(!_0x10cc9e['query'][_0x129b('0x2e')]('nolimit')){_0x3286e2[_0x129b('0x19')]=qs[_0x129b('0x19')](_0x10cc9e[_0x129b('0x2a')]['limit']);_0x3286e2['offset']=qs[_0x129b('0x17')](_0x10cc9e[_0x129b('0x2a')]['offset']);}_0x3286e2[_0x129b('0x2f')]=qs['sort'](_0x10cc9e['query'][_0x129b('0x30')]);_0x3286e2[_0x129b('0x31')]=qs[_0x129b('0x32')](_['pick'](_0x10cc9e[_0x129b('0x2a')],_0x401c41['filters']),_0x29f816);if(_0x10cc9e['query'][_0x129b('0x33')]){_0x3286e2[_0x129b('0x31')]=_[_0x129b('0x34')](_0x3286e2[_0x129b('0x31')],{'$or':_[_0x129b('0x24')](_0x29f816,function(_0xe5631e){if(_0xe5631e[_0x129b('0x28')]!==_0x129b('0x35')){var _0x1fb955={};_0x1fb955[_0xe5631e[_0x129b('0x21')]]={'$like':'%'+_0x10cc9e[_0x129b('0x2a')][_0x129b('0x33')]+'%'};return _0x1fb955;}})});}_0x3286e2=_['merge']({},_0x3286e2,_0x10cc9e[_0x129b('0x36')]);var _0x964798={'where':_0x3286e2[_0x129b('0x31')]};return db[_0x129b('0x25')][_0x129b('0x1a')](_0x964798)[_0x129b('0x1f')](function(_0x34839a){_0x5388d2['count']=_0x34839a;if(_0x10cc9e[_0x129b('0x2a')][_0x129b('0x37')]){_0x3286e2['include']=[{'all':!![]}];}return db[_0x129b('0x25')][_0x129b('0x38')](_0x3286e2);})[_0x129b('0x1f')](function(_0xc6a93f){_0x5388d2[_0x129b('0x39')]=_0xc6a93f;return _0x5388d2;})[_0x129b('0x1f')](respondWithFilteredResult(_0xc8b344,_0x3286e2))[_0x129b('0x3a')](handleError(_0xc8b344,null));};exports['show']=function(_0x4b9d34,_0x36c22a){var _0x29a4a7={'raw':!![],'where':{'id':_0x4b9d34[_0x129b('0x3b')]['id']}},_0x5e76cc={};_0x5e76cc['model']=_['keys'](db[_0x129b('0x25')][_0x129b('0x26')]);_0x5e76cc[_0x129b('0x2a')]=_[_0x129b('0x3c')](_0x4b9d34['query']);_0x5e76cc[_0x129b('0x32')]=_['intersection'](_0x5e76cc[_0x129b('0x29')],_0x5e76cc['query']);_0x29a4a7[_0x129b('0x2c')]=_['intersection'](_0x5e76cc[_0x129b('0x29')],qs['fields'](_0x4b9d34[_0x129b('0x2a')][_0x129b('0x3d')]));_0x29a4a7['attributes']=_0x29a4a7[_0x129b('0x2c')][_0x129b('0x2d')]?_0x29a4a7['attributes']:_0x5e76cc[_0x129b('0x29')];if(_0x4b9d34[_0x129b('0x2a')][_0x129b('0x37')]){_0x29a4a7['include']=[{'all':!![]}];}_0x29a4a7=_[_0x129b('0x34')]({},_0x29a4a7,_0x4b9d34[_0x129b('0x36')]);return db[_0x129b('0x25')]['find'](_0x29a4a7)[_0x129b('0x1f')](handleEntityNotFound(_0x36c22a,null))[_0x129b('0x1f')](respondWithResult(_0x36c22a,null))['catch'](handleError(_0x36c22a,null));};exports[_0x129b('0x3e')]=function(_0x562960,_0x2aefa8){return db[_0x129b('0x25')][_0x129b('0x3e')](_0x562960[_0x129b('0x3f')],{})[_0x129b('0x1f')](respondWithResult(_0x2aefa8,0xc9))[_0x129b('0x3a')](handleError(_0x2aefa8,null));};exports[_0x129b('0x40')]=function(_0x13e29a,_0x31116a){if(_0x13e29a['body']['id']){delete _0x13e29a[_0x129b('0x3f')]['id'];}return db['SquareMessage'][_0x129b('0x41')]({'where':{'id':_0x13e29a[_0x129b('0x3b')]['id']}})[_0x129b('0x1f')](handleEntityNotFound(_0x31116a,null))['then'](saveUpdates(_0x13e29a[_0x129b('0x3f')],null))['then'](respondWithResult(_0x31116a,null))['catch'](handleError(_0x31116a,null));};exports[_0x129b('0x42')]=function(_0x4eea3c,_0x15bd08){return db['SquareMessage'][_0x129b('0x41')]({'where':{'id':_0x4eea3c[_0x129b('0x3b')]['id']}})[_0x129b('0x1f')](handleEntityNotFound(_0x15bd08,null))[_0x129b('0x1f')](removeEntity(_0x15bd08,null))[_0x129b('0x3a')](handleError(_0x15bd08,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 7f010d7..8b88506 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 _0x686b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x51ad4f,_0x45d87d){var _0x592932=function(_0x24f8b0){while(--_0x24f8b0){_0x51ad4f['push'](_0x51ad4f['shift']());}};_0x592932(++_0x45d87d);}(_0x686b,0x81));var _0xb686=function(_0x2045fb,_0x238de8){_0x2045fb=_0x2045fb-0x0;var _0xf8f792=_0x686b[_0x2045fb];return _0xf8f792;};'use strict';var _=require(_0xb686('0x0'));var util=require(_0xb686('0x1'));var logger=require(_0xb686('0x2'))(_0xb686('0x3'));var moment=require(_0xb686('0x4'));var BPromise=require(_0xb686('0x5'));var rp=require(_0xb686('0x6'));var fs=require('fs');var path=require(_0xb686('0x7'));var rimraf=require(_0xb686('0x8'));var config=require(_0xb686('0x9'));var attributes=require('./squareMessage.attributes');module[_0xb686('0xa')]=function(_0x21da72,_0x27b098){return _0x21da72[_0xb686('0xb')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a97=['../../config/environment','./squareMessage.attributes','SquareMessage','lodash','api','moment','bluebird'];(function(_0x3b3a3e,_0x2a59ad){var _0x3d50e3=function(_0x5be867){while(--_0x5be867){_0x3b3a3e['push'](_0x3b3a3e['shift']());}};_0x3d50e3(++_0x2a59ad);}(_0x7a97,0x73));var _0x77a9=function(_0x50dd35,_0x4d3789){_0x50dd35=_0x50dd35-0x0;var _0x20e5df=_0x7a97[_0x50dd35];return _0x20e5df;};'use strict';var _=require(_0x77a9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77a9('0x1'));var moment=require(_0x77a9('0x2'));var BPromise=require(_0x77a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77a9('0x4'));var attributes=require(_0x77a9('0x5'));module['exports']=function(_0x21bc25,_0x2025de){return _0x21bc25['define'](_0x77a9('0x6'),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 fcca323..e12349f 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 _0x6c01=['catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4863bc,_0x26dd88){var _0xa20d45=function(_0x483267){while(--_0x483267){_0x4863bc['push'](_0x4863bc['shift']());}};_0xa20d45(++_0x26dd88);}(_0x6c01,0x173));var _0x16c0=function(_0x1705fb,_0x3a4dda){_0x1705fb=_0x1705fb-0x0;var _0x2a1f70=_0x6c01[_0x1705fb];return _0x2a1f70;};'use strict';var _=require(_0x16c0('0x0'));var util=require('util');var moment=require(_0x16c0('0x1'));var BPromise=require(_0x16c0('0x2'));var rs=require(_0x16c0('0x3'));var fs=require('fs');var Redis=require(_0x16c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x16c0('0x5'))(_0x16c0('0x6'));var config=require(_0x16c0('0x7'));var jayson=require(_0x16c0('0x8'));var client=jayson[_0x16c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad88b,_0x10ec6f,_0x3964fb){return new BPromise(function(_0x3d3f35,_0x613fc3){return client['request'](_0x2ad88b,_0x3964fb)[_0x16c0('0xa')](function(_0x4b9449){logger[_0x16c0('0xb')](_0x16c0('0xc'),_0x10ec6f,_0x16c0('0xd'));logger[_0x16c0('0xe')](_0x16c0('0xf'),_0x10ec6f,_0x16c0('0xd'),JSON[_0x16c0('0x10')](_0x4b9449));if(_0x4b9449['error']){if(_0x4b9449[_0x16c0('0x11')][_0x16c0('0x12')]===0x1f4){logger[_0x16c0('0x11')](_0x16c0('0xc'),_0x10ec6f,_0x4b9449[_0x16c0('0x11')][_0x16c0('0x13')]);return _0x613fc3(_0x4b9449[_0x16c0('0x11')][_0x16c0('0x13')]);}logger[_0x16c0('0x11')](_0x16c0('0xc'),_0x10ec6f,_0x4b9449[_0x16c0('0x11')][_0x16c0('0x13')]);return _0x3d3f35(_0x4b9449[_0x16c0('0x11')][_0x16c0('0x13')]);}else{logger[_0x16c0('0xb')]('SquareMessage,\x20%s,\x20%s',_0x10ec6f,_0x16c0('0xd'));_0x3d3f35(_0x4b9449[_0x16c0('0x14')][_0x16c0('0x13')]);}})[_0x16c0('0x15')](function(_0x1a6cc1){logger[_0x16c0('0x11')](_0x16c0('0xc'),_0x10ec6f,_0x1a6cc1);_0x613fc3(_0x1a6cc1);});});}exports['CreateSquareMessage']=function(_0x50bf83){var _0x41c406=this;return new Promise(function(_0x12c73e,_0x2c5ed7){return db[_0x16c0('0x16')][_0x16c0('0x17')](_0x50bf83[_0x16c0('0x18')],{'raw':_0x50bf83[_0x16c0('0x19')]?_0x50bf83[_0x16c0('0x19')][_0x16c0('0x1a')]===undefined?!![]:![]:!![]})[_0x16c0('0xa')](function(_0x1bd17d){logger['info'](_0x16c0('0x1b'),_0x50bf83);logger[_0x16c0('0xe')](_0x16c0('0x1b'),_0x50bf83,JSON[_0x16c0('0x10')](_0x1bd17d));_0x12c73e(_0x1bd17d);})[_0x16c0('0x15')](function(_0x197519){logger[_0x16c0('0x11')]('CreateSquareMessage',_0x197519[_0x16c0('0x13')],_0x50bf83);_0x2c5ed7(_0x41c406[_0x16c0('0x11')](0x1f4,_0x197519['message']));});});}; \ No newline at end of file +var _0x7df7=['request','then','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','body','options','raw','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7df7,0x10d));var _0x77df=function(_0x1f7039,_0x5cd440){_0x1f7039=_0x1f7039-0x0;var _0x45f2f1=_0x7df7[_0x1f7039];return _0x45f2f1;};'use strict';var _=require(_0x77df('0x0'));var util=require(_0x77df('0x1'));var moment=require(_0x77df('0x2'));var BPromise=require(_0x77df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77df('0x4'));var db=require(_0x77df('0x5'))['db'];var utils=require(_0x77df('0x6'));var logger=require(_0x77df('0x7'))(_0x77df('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77df('0x9')][_0x77df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x160ab3,_0x50318c,_0x3dbec6){return new BPromise(function(_0x5ed4cf,_0x288cbc){return client[_0x77df('0xb')](_0x160ab3,_0x3dbec6)[_0x77df('0xc')](function(_0x39f346){logger['info']('SquareMessage,\x20%s,\x20%s',_0x50318c,_0x77df('0xd'));logger[_0x77df('0xe')](_0x77df('0xf'),_0x50318c,'request\x20sent',JSON[_0x77df('0x10')](_0x39f346));if(_0x39f346[_0x77df('0x11')]){if(_0x39f346[_0x77df('0x11')][_0x77df('0x12')]===0x1f4){logger[_0x77df('0x11')](_0x77df('0x13'),_0x50318c,_0x39f346[_0x77df('0x11')]['message']);return _0x288cbc(_0x39f346['error'][_0x77df('0x14')]);}logger['error'](_0x77df('0x13'),_0x50318c,_0x39f346['error'][_0x77df('0x14')]);return _0x5ed4cf(_0x39f346[_0x77df('0x11')]['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x50318c,_0x77df('0xd'));_0x5ed4cf(_0x39f346[_0x77df('0x15')][_0x77df('0x14')]);}})[_0x77df('0x16')](function(_0x53b4da){logger[_0x77df('0x11')](_0x77df('0x13'),_0x50318c,_0x53b4da);_0x288cbc(_0x53b4da);});});}exports[_0x77df('0x17')]=function(_0x859351){var _0xb362b6=this;return new Promise(function(_0x160c96,_0x926b03){return db['SquareMessage']['create'](_0x859351[_0x77df('0x18')],{'raw':_0x859351['options']?_0x859351[_0x77df('0x19')][_0x77df('0x1a')]===undefined?!![]:![]:!![]})[_0x77df('0xc')](function(_0x3d022d){logger[_0x77df('0x1b')](_0x77df('0x17'),_0x859351);logger['debug']('CreateSquareMessage',_0x859351,JSON[_0x77df('0x10')](_0x3d022d));_0x160c96(_0x3d022d);})[_0x77df('0x16')](function(_0x23a179){logger['error'](_0x77df('0x17'),_0x23a179[_0x77df('0x14')],_0x859351);_0x926b03(_0xb362b6['error'](0x1f4,_0x23a179[_0x77df('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index adf116e..8d8d181 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 _0x1e98=['create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test','post'];(function(_0x4fc8dd,_0x44239a){var _0xfa6052=function(_0x199dff){while(--_0x199dff){_0x4fc8dd['push'](_0x4fc8dd['shift']());}};_0xfa6052(++_0x44239a);}(_0x1e98,0x85));var _0x81e9=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x1e98[_0x5e6cb8];return _0x3faeb3;};'use strict';var multer=require(_0x81e9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x81e9('0x1'));var express=require(_0x81e9('0x2'));var router=express[_0x81e9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x81e9('0x4'));var config=require(_0x81e9('0x5'));var controller=require(_0x81e9('0x6'));router[_0x81e9('0x7')]('/',auth[_0x81e9('0x8')](),controller[_0x81e9('0x9')]);router[_0x81e9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x81e9('0xa')]);router[_0x81e9('0x7')](_0x81e9('0xb'),auth[_0x81e9('0x8')](),timeout('15s'),controller[_0x81e9('0xc')]);router[_0x81e9('0xd')]('/',auth[_0x81e9('0x8')](),controller[_0x81e9('0xe')]);router[_0x81e9('0xf')](_0x81e9('0x10'),auth[_0x81e9('0x8')](),controller[_0x81e9('0x11')]);router[_0x81e9('0x12')](_0x81e9('0x10'),auth[_0x81e9('0x8')](),controller[_0x81e9('0x13')]);module[_0x81e9('0x14')]=router; \ No newline at end of file +var _0xef2c=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0xdaded2,_0x2b3260){var _0x868cc6=function(_0x2207ac){while(--_0x2207ac){_0xdaded2['push'](_0xdaded2['shift']());}};_0x868cc6(++_0x2b3260);}(_0xef2c,0x79));var _0xcef2=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xef2c[_0x5a636f];return _0x6a8cfb;};'use strict';var multer=require(_0xcef2('0x0'));var util=require(_0xcef2('0x1'));var path=require(_0xcef2('0x2'));var timeout=require(_0xcef2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcef2('0x4'));var auth=require(_0xcef2('0x5'));var interaction=require(_0xcef2('0x6'));var config=require(_0xcef2('0x7'));var controller=require('./squareOdbc.controller');router[_0xcef2('0x8')]('/',auth[_0xcef2('0x9')](),controller[_0xcef2('0xa')]);router[_0xcef2('0x8')](_0xcef2('0xb'),auth[_0xcef2('0x9')](),controller[_0xcef2('0xc')]);router['get'](_0xcef2('0xd'),auth[_0xcef2('0x9')](),timeout(_0xcef2('0xe')),controller[_0xcef2('0xf')]);router['post']('/',auth[_0xcef2('0x9')](),controller['create']);router[_0xcef2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xcef2('0x11')]);router[_0xcef2('0x12')]('/:id',auth[_0xcef2('0x9')](),controller[_0xcef2('0x13')]);module[_0xcef2('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index efe600f..7ba8f55 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 _0x9f25=['STRING','sequelize','name'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x9f25,0x70));var _0x59f2=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x9f25[_0x3f8759];return _0x2d33ca;};'use strict';var Sequelize=require(_0x59f2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x59f2('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x59f2('0x2')]},'description':{'type':Sequelize[_0x59f2('0x2')]}}; \ No newline at end of file +var _0xacf0=['sequelize','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacf0,0x7b));var _0x0acf=function(_0x2a0765,_0x3ae964){_0x2a0765=_0x2a0765-0x0;var _0x547461=_0xacf0[_0x2a0765];return _0x547461;};'use strict';var Sequelize=require(_0x0acf('0x0'));module['exports']={'name':{'type':Sequelize[_0x0acf('0x1')],'unique':_0x0acf('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0acf('0x1')]},'description':{'type':Sequelize[_0x0acf('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8e250b9..35ba47f 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 _0xdcc6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','ODBC','destroy','stack','name','send','index','SquareOdbc','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','body','test','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis'];(function(_0x395e89,_0xbb4253){var _0xb3a88f=function(_0x4adaf8){while(--_0x4adaf8){_0x395e89['push'](_0x395e89['shift']());}};_0xb3a88f(++_0xbb4253);}(_0xdcc6,0x1d7));var _0x6dcc=function(_0x453701,_0x356ac6){_0x453701=_0x453701-0x0;var _0x47c71a=_0xdcc6[_0x453701];return _0x47c71a;};'use strict';var emlformat=require(_0x6dcc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dcc('0x1'));var jsonpatch=require(_0x6dcc('0x2'));var rp=require(_0x6dcc('0x3'));var moment=require(_0x6dcc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6dcc('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6dcc('0x6'));var fs=require('fs');var fs_extra=require(_0x6dcc('0x7'));var _=require(_0x6dcc('0x8'));var squel=require(_0x6dcc('0x9'));var crypto=require(_0x6dcc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6dcc('0xb'));var toCsv=require(_0x6dcc('0xc'));var querystring=require('querystring');var Papa=require(_0x6dcc('0xd'));var Redis=require(_0x6dcc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dcc('0xf'));var logger=require(_0x6dcc('0x10'))(_0x6dcc('0x11'));var utils=require(_0x6dcc('0x12'));var config=require(_0x6dcc('0x13'));var licenseUtil=require(_0x6dcc('0x14'));var db=require(_0x6dcc('0x15'))['db'];function respondWithStatusCode(_0x2ed244,_0x1e8228){_0x1e8228=_0x1e8228||0xcc;return function(_0x5780d6){if(_0x5780d6){return _0x2ed244[_0x6dcc('0x16')](_0x1e8228);}return _0x2ed244[_0x6dcc('0x17')](_0x1e8228)[_0x6dcc('0x18')]();};}function respondWithResult(_0x4ee7a9,_0x3cf639){_0x3cf639=_0x3cf639||0xc8;return function(_0x530376){if(_0x530376){return _0x4ee7a9[_0x6dcc('0x17')](_0x3cf639)['json'](_0x530376);}};}function respondWithFilteredResult(_0x183425,_0xa6081b){return function(_0x3f00a7){if(_0x3f00a7){var _0x26e88e=typeof _0xa6081b['offset']===_0x6dcc('0x19')&&typeof _0xa6081b[_0x6dcc('0x1a')]===_0x6dcc('0x19');var _0x230e0f=_0x3f00a7[_0x6dcc('0x1b')];var _0x426c3f=_0x26e88e?0x0:_0xa6081b[_0x6dcc('0x1c')];var _0x46564d=_0x26e88e?_0x3f00a7['count']:_0xa6081b['offset']+_0xa6081b[_0x6dcc('0x1a')];var _0x400b2f;if(_0x46564d>=_0x230e0f){_0x46564d=_0x230e0f;_0x400b2f=0xc8;}else{_0x400b2f=0xce;}_0x183425[_0x6dcc('0x17')](_0x400b2f);return _0x183425[_0x6dcc('0x1d')](_0x6dcc('0x1e'),_0x426c3f+'-'+_0x46564d+'/'+_0x230e0f)['json'](_0x3f00a7);}return null;};}function patchUpdates(_0x20fab7){return function(_0x209d46){try{jsonpatch['apply'](_0x209d46,_0x20fab7,!![]);}catch(_0x492a55){return BPromise[_0x6dcc('0x1f')](_0x492a55);}return _0x209d46['save']();};}function saveUpdates(_0xda3ec7,_0x168711){return function(_0x588ee4){if(_0x588ee4){return _0x588ee4[_0x6dcc('0x20')](_0xda3ec7)[_0x6dcc('0x21')](function(_0x344f6){return _0x344f6;});}return null;};}function removeEntity(_0x46915d,_0x4b8047){return function(_0x179f68){if(_0x179f68){return _0x179f68['destroy']()[_0x6dcc('0x21')](function(){var _0x16edd8=_0x179f68[_0x6dcc('0x22')]({'plain':!![]});var _0x5de78e=_0x6dcc('0x23');return db['UserProfileResource'][_0x6dcc('0x24')]({'where':{'type':_0x5de78e,'resourceId':_0x16edd8['id']}})['then'](function(){return _0x179f68;});})[_0x6dcc('0x21')](function(){_0x46915d[_0x6dcc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e178e,_0x52a08d){return function(_0x52c283){if(!_0x52c283){_0x2e178e['sendStatus'](0x194);}return _0x52c283;};}function handleError(_0x30e108,_0x187026){_0x187026=_0x187026||0x1f4;return function(_0x45d8ff){logger['error'](_0x45d8ff[_0x6dcc('0x25')]);if(_0x45d8ff['name']){delete _0x45d8ff[_0x6dcc('0x26')];}_0x30e108[_0x6dcc('0x17')](_0x187026)[_0x6dcc('0x27')](_0x45d8ff);};}exports[_0x6dcc('0x28')]=function(_0x4970e1,_0x1a16b5){var _0x1febe9={},_0x42c39f={},_0x3b321e={'count':0x0,'rows':[]};var _0x36395e=_['map'](db[_0x6dcc('0x29')]['rawAttributes'],function(_0x417acc){return{'name':_0x417acc['fieldName'],'type':_0x417acc[_0x6dcc('0x2a')]['key']};});_0x42c39f['model']=_['map'](_0x36395e,_0x6dcc('0x26'));_0x42c39f[_0x6dcc('0x2b')]=_[_0x6dcc('0x2c')](_0x4970e1[_0x6dcc('0x2b')]);_0x42c39f['filters']=_[_0x6dcc('0x2d')](_0x42c39f[_0x6dcc('0x2e')],_0x42c39f[_0x6dcc('0x2b')]);_0x1febe9[_0x6dcc('0x2f')]=_[_0x6dcc('0x2d')](_0x42c39f[_0x6dcc('0x2e')],qs[_0x6dcc('0x30')](_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x30')]));_0x1febe9['attributes']=_0x1febe9[_0x6dcc('0x2f')][_0x6dcc('0x31')]?_0x1febe9[_0x6dcc('0x2f')]:_0x42c39f['model'];if(!_0x4970e1[_0x6dcc('0x2b')]['hasOwnProperty'](_0x6dcc('0x32'))){_0x1febe9[_0x6dcc('0x1a')]=qs[_0x6dcc('0x1a')](_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x1a')]);_0x1febe9[_0x6dcc('0x1c')]=qs[_0x6dcc('0x1c')](_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x1c')]);}_0x1febe9[_0x6dcc('0x33')]=qs[_0x6dcc('0x34')](_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x34')]);_0x1febe9[_0x6dcc('0x35')]=qs[_0x6dcc('0x36')](_[_0x6dcc('0x37')](_0x4970e1['query'],_0x42c39f[_0x6dcc('0x36')]),_0x36395e);if(_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x38')]){_0x1febe9[_0x6dcc('0x35')]=_[_0x6dcc('0x39')](_0x1febe9[_0x6dcc('0x35')],{'$or':_[_0x6dcc('0x3a')](_0x36395e,function(_0x4567cc){if(_0x4567cc[_0x6dcc('0x2a')]!==_0x6dcc('0x3b')){var _0x15e5ce={};_0x15e5ce[_0x4567cc['name']]={'$like':'%'+_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x38')]+'%'};return _0x15e5ce;}})});}_0x1febe9=_[_0x6dcc('0x39')]({},_0x1febe9,_0x4970e1[_0x6dcc('0x3c')]);var _0x3363fe={'where':_0x1febe9['where']};return db['SquareOdbc'][_0x6dcc('0x1b')](_0x3363fe)['then'](function(_0x263093){_0x3b321e[_0x6dcc('0x1b')]=_0x263093;if(_0x4970e1[_0x6dcc('0x2b')][_0x6dcc('0x3d')]){_0x1febe9[_0x6dcc('0x3e')]=[{'all':!![]}];}return db[_0x6dcc('0x29')][_0x6dcc('0x3f')](_0x1febe9);})[_0x6dcc('0x21')](function(_0x1ce02a){_0x3b321e['rows']=_0x1ce02a;return _0x3b321e;})[_0x6dcc('0x21')](respondWithFilteredResult(_0x1a16b5,_0x1febe9))[_0x6dcc('0x40')](handleError(_0x1a16b5,null));};exports[_0x6dcc('0x41')]=function(_0x2f2e4d,_0x1ff968){var _0x453707={'raw':!![],'where':{'id':_0x2f2e4d[_0x6dcc('0x42')]['id']}},_0x5d5c60={};_0x5d5c60[_0x6dcc('0x2e')]=_[_0x6dcc('0x2c')](db[_0x6dcc('0x29')][_0x6dcc('0x43')]);_0x5d5c60[_0x6dcc('0x2b')]=_[_0x6dcc('0x2c')](_0x2f2e4d['query']);_0x5d5c60[_0x6dcc('0x36')]=_['intersection'](_0x5d5c60[_0x6dcc('0x2e')],_0x5d5c60['query']);_0x453707[_0x6dcc('0x2f')]=_['intersection'](_0x5d5c60['model'],qs[_0x6dcc('0x30')](_0x2f2e4d[_0x6dcc('0x2b')][_0x6dcc('0x30')]));_0x453707[_0x6dcc('0x2f')]=_0x453707[_0x6dcc('0x2f')][_0x6dcc('0x31')]?_0x453707[_0x6dcc('0x2f')]:_0x5d5c60[_0x6dcc('0x2e')];if(_0x2f2e4d['query'][_0x6dcc('0x3d')]){_0x453707['include']=[{'all':!![]}];}_0x453707=_[_0x6dcc('0x39')]({},_0x453707,_0x2f2e4d[_0x6dcc('0x3c')]);return db[_0x6dcc('0x29')][_0x6dcc('0x44')](_0x453707)['then'](handleEntityNotFound(_0x1ff968,null))[_0x6dcc('0x21')](respondWithResult(_0x1ff968,null))['catch'](handleError(_0x1ff968,null));};exports['create']=function(_0xe42750,_0x7a62cb){return db['SquareOdbc'][_0x6dcc('0x45')](_0xe42750['body'],{})[_0x6dcc('0x21')](function(_0x5c4ace){var _0x22533c=_0xe42750[_0x6dcc('0x46')]['get']({'plain':!![]});if(!_0x22533c)throw new Error(_0x6dcc('0x47'));if(_0x22533c[_0x6dcc('0x48')]===_0x6dcc('0x46')){var _0x1296b5=_0x5c4ace['get']({'plain':!![]});var _0x46db4b=_0x6dcc('0x23');return db[_0x6dcc('0x49')][_0x6dcc('0x44')]({'where':{'name':_0x46db4b,'userProfileId':_0x22533c[_0x6dcc('0x4a')]},'raw':!![]})[_0x6dcc('0x21')](function(_0x3dd98b){if(_0x3dd98b&&_0x3dd98b[_0x6dcc('0x4b')]===0x0){return db['UserProfileResource'][_0x6dcc('0x45')]({'name':_0x1296b5[_0x6dcc('0x26')],'resourceId':_0x1296b5['id'],'type':_0x3dd98b[_0x6dcc('0x26')],'sectionId':_0x3dd98b['id']},{})['then'](function(){return _0x5c4ace;});}else{return _0x5c4ace;}})[_0x6dcc('0x40')](function(_0x4223bf){logger[_0x6dcc('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4223bf);throw _0x4223bf;});}return _0x5c4ace;})['then'](respondWithResult(_0x7a62cb,0xc9))[_0x6dcc('0x40')](handleError(_0x7a62cb,null));};exports[_0x6dcc('0x20')]=function(_0x3e30d9,_0x112cd7){if(_0x3e30d9[_0x6dcc('0x4d')]['id']){delete _0x3e30d9[_0x6dcc('0x4d')]['id'];}return db['SquareOdbc'][_0x6dcc('0x44')]({'where':{'id':_0x3e30d9[_0x6dcc('0x42')]['id']}})[_0x6dcc('0x21')](handleEntityNotFound(_0x112cd7,null))['then'](saveUpdates(_0x3e30d9['body'],null))[_0x6dcc('0x21')](respondWithResult(_0x112cd7,null))['catch'](handleError(_0x112cd7,null));};exports['destroy']=function(_0x5196f8,_0x27ce8e){return db[_0x6dcc('0x29')]['find']({'where':{'id':_0x5196f8[_0x6dcc('0x42')]['id']}})[_0x6dcc('0x21')](handleEntityNotFound(_0x27ce8e,null))[_0x6dcc('0x21')](removeEntity(_0x27ce8e,null))['catch'](handleError(_0x27ce8e,null));};exports[_0x6dcc('0x4e')]=function(_0x2643c9,_0x46dfd7,_0x48493a){var _0x331c63;return db[_0x6dcc('0x29')][_0x6dcc('0x44')]({'where':{'id':_0x2643c9[_0x6dcc('0x42')]['id']},'attributes':['id','dsn']})[_0x6dcc('0x21')](handleEntityNotFound(_0x46dfd7,null))['then'](function(_0x524671){if(_0x524671){var _0x44f48b=require('odbc')();_0x44f48b['openSync'](_0x524671[_0x6dcc('0x4f')]);_0x44f48b[_0x6dcc('0x50')]();return _0x524671;}})['then'](respondWithResult(_0x46dfd7,null))[_0x6dcc('0x40')](handleError(_0x46dfd7,null));}; \ No newline at end of file +var _0xa87a=['rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','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','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','error','name','index','SquareOdbc','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x286244,_0x376a02){var _0x375d78=function(_0x24ccde){while(--_0x24ccde){_0x286244['push'](_0x286244['shift']());}};_0x375d78(++_0x376a02);}(_0xa87a,0xcd));var _0xaa87=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xa87a[_0x55821d];return _0x58ea8a;};'use strict';var emlformat=require(_0xaa87('0x0'));var rimraf=require(_0xaa87('0x1'));var zipdir=require(_0xaa87('0x2'));var jsonpatch=require(_0xaa87('0x3'));var rp=require('request-promise');var moment=require(_0xaa87('0x4'));var BPromise=require(_0xaa87('0x5'));var Mustache=require(_0xaa87('0x6'));var util=require(_0xaa87('0x7'));var path=require('path');var sox=require(_0xaa87('0x8'));var csv=require('to-csv');var ejs=require(_0xaa87('0x9'));var fs=require('fs');var fs_extra=require(_0xaa87('0xa'));var _=require(_0xaa87('0xb'));var squel=require('squel');var crypto=require(_0xaa87('0xc'));var jsforce=require(_0xaa87('0xd'));var deskjs=require(_0xaa87('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa87('0xf'));var Papa=require(_0xaa87('0x10'));var Redis=require(_0xaa87('0x11'));var authService=require(_0xaa87('0x12'));var qs=require(_0xaa87('0x13'));var as=require(_0xaa87('0x14'));var hardwareService=require(_0xaa87('0x15'));var logger=require(_0xaa87('0x16'))('api');var utils=require(_0xaa87('0x17'));var config=require(_0xaa87('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa87('0x19'))['db'];function respondWithStatusCode(_0x499c48,_0x100737){_0x100737=_0x100737||0xcc;return function(_0x59ba5f){if(_0x59ba5f){return _0x499c48[_0xaa87('0x1a')](_0x100737);}return _0x499c48['status'](_0x100737)[_0xaa87('0x1b')]();};}function respondWithResult(_0x30580b,_0x3e17b3){_0x3e17b3=_0x3e17b3||0xc8;return function(_0x421949){if(_0x421949){return _0x30580b[_0xaa87('0x1c')](_0x3e17b3)[_0xaa87('0x1d')](_0x421949);}};}function respondWithFilteredResult(_0x3f6f4a,_0xf1d495){return function(_0x18ef4d){if(_0x18ef4d){var _0x5c4b4e=typeof _0xf1d495['offset']===_0xaa87('0x1e')&&typeof _0xf1d495['limit']==='undefined';var _0x31ba4d=_0x18ef4d['count'];var _0x5bf783=_0x5c4b4e?0x0:_0xf1d495[_0xaa87('0x1f')];var _0x3bf30f=_0x5c4b4e?_0x18ef4d[_0xaa87('0x20')]:_0xf1d495[_0xaa87('0x1f')]+_0xf1d495[_0xaa87('0x21')];var _0x232eed;if(_0x3bf30f>=_0x31ba4d){_0x3bf30f=_0x31ba4d;_0x232eed=0xc8;}else{_0x232eed=0xce;}_0x3f6f4a[_0xaa87('0x1c')](_0x232eed);return _0x3f6f4a['set'](_0xaa87('0x22'),_0x5bf783+'-'+_0x3bf30f+'/'+_0x31ba4d)[_0xaa87('0x1d')](_0x18ef4d);}return null;};}function patchUpdates(_0x47a973){return function(_0x1f3b5c){try{jsonpatch[_0xaa87('0x23')](_0x1f3b5c,_0x47a973,!![]);}catch(_0x2310f0){return BPromise[_0xaa87('0x24')](_0x2310f0);}return _0x1f3b5c[_0xaa87('0x25')]();};}function saveUpdates(_0x71abe0,_0x15562d){return function(_0x2f7a04){if(_0x2f7a04){return _0x2f7a04[_0xaa87('0x26')](_0x71abe0)[_0xaa87('0x27')](function(_0x4bccea){return _0x4bccea;});}return null;};}function removeEntity(_0x2befa8,_0x31e4c9){return function(_0x50fa0b){if(_0x50fa0b){return _0x50fa0b['destroy']()['then'](function(){var _0x1b2252=_0x50fa0b[_0xaa87('0x28')]({'plain':!![]});var _0x22eaec=_0xaa87('0x29');return db[_0xaa87('0x2a')]['destroy']({'where':{'type':_0x22eaec,'resourceId':_0x1b2252['id']}})[_0xaa87('0x27')](function(){return _0x50fa0b;});})[_0xaa87('0x27')](function(){_0x2befa8[_0xaa87('0x1c')](0xcc)[_0xaa87('0x1b')]();});}};}function handleEntityNotFound(_0x2d4dcc,_0xa186e){return function(_0x1e465b){if(!_0x1e465b){_0x2d4dcc[_0xaa87('0x1a')](0x194);}return _0x1e465b;};}function handleError(_0x257300,_0x441e63){_0x441e63=_0x441e63||0x1f4;return function(_0x5e4ca0){logger[_0xaa87('0x2b')](_0x5e4ca0['stack']);if(_0x5e4ca0[_0xaa87('0x2c')]){delete _0x5e4ca0[_0xaa87('0x2c')];}_0x257300[_0xaa87('0x1c')](_0x441e63)['send'](_0x5e4ca0);};}exports[_0xaa87('0x2d')]=function(_0x26ec28,_0xbcec1b){var _0x385ecb={},_0x44f42a={},_0x3e11b9={'count':0x0,'rows':[]};var _0x775065=_['map'](db[_0xaa87('0x2e')][_0xaa87('0x2f')],function(_0x3d18c5){return{'name':_0x3d18c5['fieldName'],'type':_0x3d18c5['type'][_0xaa87('0x30')]};});_0x44f42a[_0xaa87('0x31')]=_['map'](_0x775065,_0xaa87('0x2c'));_0x44f42a[_0xaa87('0x32')]=_[_0xaa87('0x33')](_0x26ec28[_0xaa87('0x32')]);_0x44f42a[_0xaa87('0x34')]=_['intersection'](_0x44f42a[_0xaa87('0x31')],_0x44f42a[_0xaa87('0x32')]);_0x385ecb['attributes']=_[_0xaa87('0x35')](_0x44f42a[_0xaa87('0x31')],qs[_0xaa87('0x36')](_0x26ec28[_0xaa87('0x32')][_0xaa87('0x36')]));_0x385ecb[_0xaa87('0x37')]=_0x385ecb[_0xaa87('0x37')]['length']?_0x385ecb[_0xaa87('0x37')]:_0x44f42a[_0xaa87('0x31')];if(!_0x26ec28['query'][_0xaa87('0x38')](_0xaa87('0x39'))){_0x385ecb['limit']=qs[_0xaa87('0x21')](_0x26ec28['query'][_0xaa87('0x21')]);_0x385ecb['offset']=qs[_0xaa87('0x1f')](_0x26ec28[_0xaa87('0x32')][_0xaa87('0x1f')]);}_0x385ecb[_0xaa87('0x3a')]=qs[_0xaa87('0x3b')](_0x26ec28[_0xaa87('0x32')]['sort']);_0x385ecb['where']=qs[_0xaa87('0x34')](_[_0xaa87('0x3c')](_0x26ec28[_0xaa87('0x32')],_0x44f42a[_0xaa87('0x34')]),_0x775065);if(_0x26ec28[_0xaa87('0x32')][_0xaa87('0x3d')]){_0x385ecb[_0xaa87('0x3e')]=_[_0xaa87('0x3f')](_0x385ecb[_0xaa87('0x3e')],{'$or':_[_0xaa87('0x40')](_0x775065,function(_0x463465){if(_0x463465[_0xaa87('0x41')]!==_0xaa87('0x42')){var _0x12f15f={};_0x12f15f[_0x463465[_0xaa87('0x2c')]]={'$like':'%'+_0x26ec28['query'][_0xaa87('0x3d')]+'%'};return _0x12f15f;}})});}_0x385ecb=_[_0xaa87('0x3f')]({},_0x385ecb,_0x26ec28[_0xaa87('0x43')]);var _0x31c7e6={'where':_0x385ecb['where']};return db[_0xaa87('0x2e')]['count'](_0x31c7e6)[_0xaa87('0x27')](function(_0x2d43af){_0x3e11b9[_0xaa87('0x20')]=_0x2d43af;if(_0x26ec28['query'][_0xaa87('0x44')]){_0x385ecb[_0xaa87('0x45')]=[{'all':!![]}];}return db[_0xaa87('0x2e')][_0xaa87('0x46')](_0x385ecb);})[_0xaa87('0x27')](function(_0x4c58d3){_0x3e11b9[_0xaa87('0x47')]=_0x4c58d3;return _0x3e11b9;})['then'](respondWithFilteredResult(_0xbcec1b,_0x385ecb))[_0xaa87('0x48')](handleError(_0xbcec1b,null));};exports[_0xaa87('0x49')]=function(_0x4d6301,_0x342995){var _0x5d3489={'raw':!![],'where':{'id':_0x4d6301[_0xaa87('0x4a')]['id']}},_0x137c9b={};_0x137c9b[_0xaa87('0x31')]=_[_0xaa87('0x33')](db[_0xaa87('0x2e')][_0xaa87('0x2f')]);_0x137c9b[_0xaa87('0x32')]=_[_0xaa87('0x33')](_0x4d6301['query']);_0x137c9b[_0xaa87('0x34')]=_[_0xaa87('0x35')](_0x137c9b[_0xaa87('0x31')],_0x137c9b[_0xaa87('0x32')]);_0x5d3489['attributes']=_[_0xaa87('0x35')](_0x137c9b[_0xaa87('0x31')],qs['fields'](_0x4d6301[_0xaa87('0x32')][_0xaa87('0x36')]));_0x5d3489[_0xaa87('0x37')]=_0x5d3489['attributes'][_0xaa87('0x4b')]?_0x5d3489['attributes']:_0x137c9b['model'];if(_0x4d6301['query'][_0xaa87('0x44')]){_0x5d3489[_0xaa87('0x45')]=[{'all':!![]}];}_0x5d3489=_[_0xaa87('0x3f')]({},_0x5d3489,_0x4d6301[_0xaa87('0x43')]);return db['SquareOdbc'][_0xaa87('0x4c')](_0x5d3489)[_0xaa87('0x27')](handleEntityNotFound(_0x342995,null))[_0xaa87('0x27')](respondWithResult(_0x342995,null))[_0xaa87('0x48')](handleError(_0x342995,null));};exports[_0xaa87('0x4d')]=function(_0x20b822,_0x4288fe){return db['SquareOdbc']['create'](_0x20b822[_0xaa87('0x4e')],{})[_0xaa87('0x27')](function(_0x1c9954){var _0x3b88d6=_0x20b822['user'][_0xaa87('0x28')]({'plain':!![]});if(!_0x3b88d6)throw new Error(_0xaa87('0x4f'));if(_0x3b88d6[_0xaa87('0x50')]===_0xaa87('0x51')){var _0x4f2883=_0x1c9954[_0xaa87('0x28')]({'plain':!![]});var _0x10eebf=_0xaa87('0x29');return db[_0xaa87('0x52')]['find']({'where':{'name':_0x10eebf,'userProfileId':_0x3b88d6[_0xaa87('0x53')]},'raw':!![]})[_0xaa87('0x27')](function(_0x2189ea){if(_0x2189ea&&_0x2189ea[_0xaa87('0x54')]===0x0){return db['UserProfileResource'][_0xaa87('0x4d')]({'name':_0x4f2883[_0xaa87('0x2c')],'resourceId':_0x4f2883['id'],'type':_0x2189ea[_0xaa87('0x2c')],'sectionId':_0x2189ea['id']},{})[_0xaa87('0x27')](function(){return _0x1c9954;});}else{return _0x1c9954;}})[_0xaa87('0x48')](function(_0x5a845c){logger[_0xaa87('0x2b')](_0xaa87('0x55'),_0x5a845c);throw _0x5a845c;});}return _0x1c9954;})[_0xaa87('0x27')](respondWithResult(_0x4288fe,0xc9))[_0xaa87('0x48')](handleError(_0x4288fe,null));};exports[_0xaa87('0x26')]=function(_0x4d522e,_0x5c9b8b){if(_0x4d522e[_0xaa87('0x4e')]['id']){delete _0x4d522e[_0xaa87('0x4e')]['id'];}return db[_0xaa87('0x2e')]['find']({'where':{'id':_0x4d522e[_0xaa87('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c9b8b,null))['then'](saveUpdates(_0x4d522e[_0xaa87('0x4e')],null))[_0xaa87('0x27')](respondWithResult(_0x5c9b8b,null))[_0xaa87('0x48')](handleError(_0x5c9b8b,null));};exports[_0xaa87('0x56')]=function(_0x45883b,_0x150abd){return db['SquareOdbc']['find']({'where':{'id':_0x45883b[_0xaa87('0x4a')]['id']}})['then'](handleEntityNotFound(_0x150abd,null))[_0xaa87('0x27')](removeEntity(_0x150abd,null))[_0xaa87('0x48')](handleError(_0x150abd,null));};exports[_0xaa87('0x57')]=function(_0x4cebf9,_0x1da7b9,_0x1b35e2){var _0x37a831;return db[_0xaa87('0x2e')][_0xaa87('0x4c')]({'where':{'id':_0x4cebf9[_0xaa87('0x4a')]['id']},'attributes':['id',_0xaa87('0x58')]})[_0xaa87('0x27')](handleEntityNotFound(_0x1da7b9,null))[_0xaa87('0x27')](function(_0x5a9514){if(_0x5a9514){var _0x270c63=require(_0xaa87('0x59'))();_0x270c63[_0xaa87('0x5a')](_0x5a9514[_0xaa87('0x58')]);_0x270c63[_0xaa87('0x5b')]();return _0x5a9514;}})['then'](respondWithResult(_0x1da7b9,null))[_0xaa87('0x48')](handleError(_0x1da7b9,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 82b9366..ad33d89 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 _0x608e=['exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x4ba8a7,_0x491d88){var _0x1b3ce3=function(_0x212e1d){while(--_0x212e1d){_0x4ba8a7['push'](_0x4ba8a7['shift']());}};_0x1b3ce3(++_0x491d88);}(_0x608e,0x16e));var _0xe608=function(_0x3577f2,_0x439173){_0x3577f2=_0x3577f2-0x0;var _0x49a51f=_0x608e[_0x3577f2];return _0x49a51f;};'use strict';var _=require(_0xe608('0x0'));var util=require(_0xe608('0x1'));var logger=require(_0xe608('0x2'))(_0xe608('0x3'));var moment=require(_0xe608('0x4'));var BPromise=require(_0xe608('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe608('0x6'));var config=require(_0xe608('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xe608('0x8')]=function(_0x55a56f,_0x54dd7d){return _0x55a56f[_0xe608('0x9')](_0xe608('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55a9=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0x55a9,0xf2));var _0x955a=function(_0x7cd3d1,_0x40940a){_0x7cd3d1=_0x7cd3d1-0x0;var _0x54379b=_0x55a9[_0x7cd3d1];return _0x54379b;};'use strict';var _=require(_0x955a('0x0'));var util=require('util');var logger=require(_0x955a('0x1'))('api');var moment=require(_0x955a('0x2'));var BPromise=require(_0x955a('0x3'));var rp=require(_0x955a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x955a('0x5'));var config=require(_0x955a('0x6'));var attributes=require(_0x955a('0x7'));module['exports']=function(_0x107e68,_0x626990){return _0x107e68[_0x955a('0x8')](_0x955a('0x9'),attributes,{'tableName':_0x955a('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 88861e1..7e3c1c6 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 _0x4382=['util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc','options','raw','where','include','map','model','attributes','ShowSquareOdbc','catch','lodash'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4382,0x95));var _0x2438=function(_0x1130da,_0x342826){_0x1130da=_0x1130da-0x0;var _0x36ff60=_0x4382[_0x1130da];return _0x36ff60;};'use strict';var _=require(_0x2438('0x0'));var util=require(_0x2438('0x1'));var moment=require('moment');var BPromise=require(_0x2438('0x2'));var rs=require(_0x2438('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2438('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2438('0x5'))('rpc');var config=require(_0x2438('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2438('0x7')][_0x2438('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4678,_0x146739,_0x1330e0){return new BPromise(function(_0x4b8ef2,_0x569eeb){return client[_0x2438('0x9')](_0x2d4678,_0x1330e0)[_0x2438('0xa')](function(_0x122beb){logger[_0x2438('0xb')](_0x2438('0xc'),_0x146739,_0x2438('0xd'));logger[_0x2438('0xe')](_0x2438('0xf'),_0x146739,_0x2438('0xd'),JSON[_0x2438('0x10')](_0x122beb));if(_0x122beb[_0x2438('0x11')]){if(_0x122beb[_0x2438('0x11')][_0x2438('0x12')]===0x1f4){logger[_0x2438('0x11')](_0x2438('0xc'),_0x146739,_0x122beb[_0x2438('0x11')][_0x2438('0x13')]);return _0x569eeb(_0x122beb[_0x2438('0x11')]['message']);}logger[_0x2438('0x11')](_0x2438('0xc'),_0x146739,_0x122beb[_0x2438('0x11')][_0x2438('0x13')]);return _0x4b8ef2(_0x122beb[_0x2438('0x11')][_0x2438('0x13')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x146739,_0x2438('0xd'));_0x4b8ef2(_0x122beb['result'][_0x2438('0x13')]);}})['catch'](function(_0x1bea52){logger[_0x2438('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x146739,_0x1bea52);_0x569eeb(_0x1bea52);});});}exports['ShowSquareOdbc']=function(_0x41f1fc){var _0xb7e00b=this;return new Promise(function(_0x111957,_0x44dd36){return db[_0x2438('0x14')]['find']({'raw':_0x41f1fc[_0x2438('0x15')]?_0x41f1fc[_0x2438('0x15')][_0x2438('0x16')]===undefined?!![]:![]:!![],'where':_0x41f1fc[_0x2438('0x15')]?_0x41f1fc[_0x2438('0x15')][_0x2438('0x17')]||null:null,'attributes':_0x41f1fc[_0x2438('0x15')]?_0x41f1fc[_0x2438('0x15')]['attributes']||null:null,'include':_0x41f1fc[_0x2438('0x15')]?_0x41f1fc[_0x2438('0x15')][_0x2438('0x18')]?_[_0x2438('0x19')](_0x41f1fc['options'][_0x2438('0x18')],function(_0x528942){return{'model':db[_0x528942[_0x2438('0x1a')]],'as':_0x528942['as'],'attributes':_0x528942['attributes'],'include':_0x528942[_0x2438('0x18')]?_[_0x2438('0x19')](_0x528942[_0x2438('0x18')],function(_0x3831c2){return{'model':db[_0x3831c2['model']],'as':_0x3831c2['as'],'attributes':_0x3831c2['attributes'],'include':_0x3831c2[_0x2438('0x18')]?_['map'](_0x3831c2['include'],function(_0x1f23d3){return{'model':db[_0x1f23d3[_0x2438('0x1a')]],'as':_0x1f23d3['as'],'attributes':_0x1f23d3[_0x2438('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e07b7){logger[_0x2438('0xb')](_0x2438('0x1c'),_0x41f1fc);logger[_0x2438('0xe')]('ShowSquareOdbc',_0x41f1fc,JSON['stringify'](_0x5e07b7));_0x111957(_0x5e07b7);})[_0x2438('0x1d')](function(_0x5456e4){logger[_0x2438('0x11')](_0x2438('0x1c'),_0x5456e4[_0x2438('0x13')],_0x41f1fc);_0x44dd36(_0xb7e00b[_0x2438('0x11')](0x1f4,_0x5456e4[_0x2438('0x13')]));});});}; \ No newline at end of file +var _0xe5aa=['../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13c867,_0x59293d){var _0x464b2c=function(_0x1e38fb){while(--_0x1e38fb){_0x13c867['push'](_0x13c867['shift']());}};_0x464b2c(++_0x59293d);}(_0xe5aa,0x129));var _0xae5a=function(_0x43a8b1,_0x17dda3){_0x43a8b1=_0x43a8b1-0x0;var _0x429ba4=_0xe5aa[_0x43a8b1];return _0x429ba4;};'use strict';var _=require(_0xae5a('0x0'));var util=require(_0xae5a('0x1'));var moment=require(_0xae5a('0x2'));var BPromise=require(_0xae5a('0x3'));var rs=require(_0xae5a('0x4'));var fs=require('fs');var Redis=require(_0xae5a('0x5'));var db=require(_0xae5a('0x6'))['db'];var utils=require(_0xae5a('0x7'));var logger=require(_0xae5a('0x8'))('rpc');var config=require(_0xae5a('0x9'));var jayson=require(_0xae5a('0xa'));var client=jayson[_0xae5a('0xb')][_0xae5a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdd5bb5,_0x267c75,_0x3bd71d){return new BPromise(function(_0x2c012e,_0x47f677){return client['request'](_0xdd5bb5,_0x3bd71d)['then'](function(_0xf3718e){logger[_0xae5a('0xd')](_0xae5a('0xe'),_0x267c75,_0xae5a('0xf'));logger[_0xae5a('0x10')](_0xae5a('0x11'),_0x267c75,_0xae5a('0xf'),JSON[_0xae5a('0x12')](_0xf3718e));if(_0xf3718e[_0xae5a('0x13')]){if(_0xf3718e[_0xae5a('0x13')][_0xae5a('0x14')]===0x1f4){logger[_0xae5a('0x13')](_0xae5a('0xe'),_0x267c75,_0xf3718e[_0xae5a('0x13')][_0xae5a('0x15')]);return _0x47f677(_0xf3718e[_0xae5a('0x13')][_0xae5a('0x15')]);}logger['error'](_0xae5a('0xe'),_0x267c75,_0xf3718e[_0xae5a('0x13')]['message']);return _0x2c012e(_0xf3718e[_0xae5a('0x13')][_0xae5a('0x15')]);}else{logger[_0xae5a('0xd')](_0xae5a('0xe'),_0x267c75,_0xae5a('0xf'));_0x2c012e(_0xf3718e[_0xae5a('0x16')][_0xae5a('0x15')]);}})[_0xae5a('0x17')](function(_0x3f29c6){logger[_0xae5a('0x13')](_0xae5a('0xe'),_0x267c75,_0x3f29c6);_0x47f677(_0x3f29c6);});});}exports[_0xae5a('0x18')]=function(_0x251c33){var _0x41bede=this;return new Promise(function(_0xde75aa,_0xaed990){return db[_0xae5a('0x19')]['find']({'raw':_0x251c33[_0xae5a('0x1a')]?_0x251c33['options'][_0xae5a('0x1b')]===undefined?!![]:![]:!![],'where':_0x251c33[_0xae5a('0x1a')]?_0x251c33['options'][_0xae5a('0x1c')]||null:null,'attributes':_0x251c33[_0xae5a('0x1a')]?_0x251c33[_0xae5a('0x1a')][_0xae5a('0x1d')]||null:null,'include':_0x251c33[_0xae5a('0x1a')]?_0x251c33[_0xae5a('0x1a')][_0xae5a('0x1e')]?_[_0xae5a('0x1f')](_0x251c33['options'][_0xae5a('0x1e')],function(_0x3e3229){return{'model':db[_0x3e3229['model']],'as':_0x3e3229['as'],'attributes':_0x3e3229[_0xae5a('0x1d')],'include':_0x3e3229[_0xae5a('0x1e')]?_[_0xae5a('0x1f')](_0x3e3229[_0xae5a('0x1e')],function(_0x4261ad){return{'model':db[_0x4261ad[_0xae5a('0x20')]],'as':_0x4261ad['as'],'attributes':_0x4261ad[_0xae5a('0x1d')],'include':_0x4261ad[_0xae5a('0x1e')]?_[_0xae5a('0x1f')](_0x4261ad[_0xae5a('0x1e')],function(_0x4b7636){return{'model':db[_0x4b7636[_0xae5a('0x20')]],'as':_0x4b7636['as'],'attributes':_0x4b7636[_0xae5a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xae5a('0x21')](function(_0x4182a2){logger['info'](_0xae5a('0x18'),_0x251c33);logger[_0xae5a('0x10')]('ShowSquareOdbc',_0x251c33,JSON['stringify'](_0x4182a2));_0xde75aa(_0x4182a2);})[_0xae5a('0x17')](function(_0xb9b6ac){logger[_0xae5a('0x13')](_0xae5a('0x18'),_0xb9b6ac[_0xae5a('0x15')],_0x251c33);_0xaed990(_0x41bede['error'](0x1f4,_0xb9b6ac[_0xae5a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1574e8b..c4b0baf 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 _0xab75=['show','/:id/users','getUsers','post','create','addUsers','update','delete','destroy','removeUsers','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id'];(function(_0x51682d,_0x415a3b){var _0xc0b24f=function(_0x52bbdc){while(--_0x52bbdc){_0x51682d['push'](_0x51682d['shift']());}};_0xc0b24f(++_0x415a3b);}(_0xab75,0x11f));var _0x5ab7=function(_0x476532,_0x509161){_0x476532=_0x476532-0x0;var _0x357738=_0xab75[_0x476532];return _0x357738;};'use strict';var multer=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var path=require(_0x5ab7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5ab7('0x3')]();var fs_extra=require(_0x5ab7('0x4'));var auth=require(_0x5ab7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ab7('0x6'));var controller=require(_0x5ab7('0x7'));router[_0x5ab7('0x8')]('/',auth[_0x5ab7('0x9')](),controller[_0x5ab7('0xa')]);router[_0x5ab7('0x8')](_0x5ab7('0xb'),auth[_0x5ab7('0x9')](),controller[_0x5ab7('0xc')]);router[_0x5ab7('0x8')](_0x5ab7('0xd'),auth['isAuthenticated'](),controller[_0x5ab7('0xe')]);router[_0x5ab7('0xf')]('/',auth['isAuthenticated'](),controller[_0x5ab7('0x10')]);router[_0x5ab7('0xf')](_0x5ab7('0xd'),auth[_0x5ab7('0x9')](),controller[_0x5ab7('0x11')]);router['put']('/:id',auth[_0x5ab7('0x9')](),controller[_0x5ab7('0x12')]);router[_0x5ab7('0x13')](_0x5ab7('0xb'),auth[_0x5ab7('0x9')](),controller[_0x5ab7('0x14')]);router[_0x5ab7('0x13')](_0x5ab7('0xd'),auth[_0x5ab7('0x9')](),controller[_0x5ab7('0x15')]);module[_0x5ab7('0x16')]=router; \ No newline at end of file +var _0x5ed0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','index','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','exports','util','path','connect-timeout','express'];(function(_0x368566,_0x4fb53b){var _0x21cc9d=function(_0x140dcd){while(--_0x140dcd){_0x368566['push'](_0x368566['shift']());}};_0x21cc9d(++_0x4fb53b);}(_0x5ed0,0xcb));var _0x05ed=function(_0x2efe12,_0x42b68d){_0x2efe12=_0x2efe12-0x0;var _0x330f7a=_0x5ed0[_0x2efe12];return _0x330f7a;};'use strict';var multer=require('multer');var util=require(_0x05ed('0x0'));var path=require(_0x05ed('0x1'));var timeout=require(_0x05ed('0x2'));var express=require(_0x05ed('0x3'));var router=express[_0x05ed('0x4')]();var fs_extra=require(_0x05ed('0x5'));var auth=require(_0x05ed('0x6'));var interaction=require(_0x05ed('0x7'));var config=require('../../config/environment');var controller=require(_0x05ed('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x05ed('0x9')]);router[_0x05ed('0xa')](_0x05ed('0xb'),auth[_0x05ed('0xc')](),controller[_0x05ed('0xd')]);router['get'](_0x05ed('0xe'),auth['isAuthenticated'](),controller[_0x05ed('0xf')]);router[_0x05ed('0x10')]('/',auth['isAuthenticated'](),controller[_0x05ed('0x11')]);router[_0x05ed('0x10')]('/:id/users',auth[_0x05ed('0xc')](),controller[_0x05ed('0x12')]);router[_0x05ed('0x13')](_0x05ed('0xb'),auth[_0x05ed('0xc')](),controller[_0x05ed('0x14')]);router[_0x05ed('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x05ed('0x15')](_0x05ed('0xe'),auth[_0x05ed('0xc')](),controller['removeUsers']);module[_0x05ed('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7e41979..645647a 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 _0x3f3c=['exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','production','DATE'];(function(_0x39c793,_0x8e253e){var _0x4e2769=function(_0x234e4b){while(--_0x234e4b){_0x39c793['push'](_0x39c793['shift']());}};_0x4e2769(++_0x8e253e);}(_0x3f3c,0x1e0));var _0xc3f3=function(_0x1345ba,_0x1490b4){_0x1345ba=_0x1345ba-0x0;var _0x31d02a=_0x3f3c[_0x1345ba];return _0x31d02a;};'use strict';var Sequelize=require('sequelize');module[_0xc3f3('0x0')]={'name':{'type':Sequelize[_0xc3f3('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc3f3('0x1')]},'notes':{'type':Sequelize[_0xc3f3('0x2')]},'preproduction':{'type':Sequelize[_0xc3f3('0x3')](_0xc3f3('0x4')),'get':function(){if(this[_0xc3f3('0x5')]('preproduction')){return this[_0xc3f3('0x5')](_0xc3f3('0x6'))[_0xc3f3('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xc3f3('0x4')),'get':function(){if(this['getDataValue']('production')){return this[_0xc3f3('0x5')](_0xc3f3('0x8'))[_0xc3f3('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0xc3f3('0x9')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xa1cc=['BLOB','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','TEXT'];(function(_0x422a9d,_0x35e344){var _0x13e59d=function(_0x46d2ad){while(--_0x46d2ad){_0x422a9d['push'](_0x422a9d['shift']());}};_0x13e59d(++_0x35e344);}(_0xa1cc,0x10f));var _0xca1c=function(_0x5cd843,_0x5a5230){_0x5cd843=_0x5cd843-0x0;var _0x50b6eb=_0xa1cc[_0x5cd843];return _0x50b6eb;};'use strict';var Sequelize=require(_0xca1c('0x0'));module[_0xca1c('0x1')]={'name':{'type':Sequelize[_0xca1c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xca1c('0x2')]},'notes':{'type':Sequelize[_0xca1c('0x3')]},'preproduction':{'type':Sequelize[_0xca1c('0x4')]('long'),'get':function(){if(this[_0xca1c('0x5')]('preproduction')){return this[_0xca1c('0x5')](_0xca1c('0x6'))[_0xca1c('0x7')](_0xca1c('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xca1c('0x5')](_0xca1c('0x9'))){return this[_0xca1c('0x5')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xca1c('0xa')]},'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 678a394..d157380 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 _0x92b3=['user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','omit','ids','removeUsers','isArray','userSquareProject:remove','emit','getUsers','fields','order','pick','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./squareProject.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','index','map','SquareProject','fieldName','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','create'];(function(_0x2670e8,_0x4b568a){var _0x3bebd5=function(_0x33e04c){while(--_0x33e04c){_0x2670e8['push'](_0x2670e8['shift']());}};_0x3bebd5(++_0x4b568a);}(_0x92b3,0xce));var _0x392b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x92b3[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x392b('0x0'));var rimraf=require(_0x392b('0x1'));var zipdir=require(_0x392b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x392b('0x3'));var Mustache=require(_0x392b('0x4'));var util=require(_0x392b('0x5'));var path=require(_0x392b('0x6'));var sox=require('sox');var csv=require(_0x392b('0x7'));var ejs=require(_0x392b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x392b('0x9'));var crypto=require(_0x392b('0xa'));var jsforce=require(_0x392b('0xb'));var deskjs=require(_0x392b('0xc'));var toCsv=require(_0x392b('0x7'));var querystring=require(_0x392b('0xd'));var Papa=require(_0x392b('0xe'));var Redis=require('ioredis');var authService=require(_0x392b('0xf'));var qs=require(_0x392b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x392b('0x11'));var logger=require(_0x392b('0x12'))(_0x392b('0x13'));var utils=require(_0x392b('0x14'));var config=require(_0x392b('0x15'));var licenseUtil=require(_0x392b('0x16'));var db=require(_0x392b('0x17'))['db'];config[_0x392b('0x18')]=_['defaults'](config[_0x392b('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x392b('0x18')]));require(_0x392b('0x19'))['register'](socket);function respondWithStatusCode(_0x42e46d,_0xe910b6){_0xe910b6=_0xe910b6||0xcc;return function(_0x5a3dae){if(_0x5a3dae){return _0x42e46d[_0x392b('0x1a')](_0xe910b6);}return _0x42e46d[_0x392b('0x1b')](_0xe910b6)[_0x392b('0x1c')]();};}function respondWithResult(_0x4d7761,_0x25a602){_0x25a602=_0x25a602||0xc8;return function(_0x1849ec){if(_0x1849ec){return _0x4d7761[_0x392b('0x1b')](_0x25a602)[_0x392b('0x1d')](_0x1849ec);}};}function respondWithFilteredResult(_0x2bf588,_0x4d7d00){return function(_0x36925c){if(_0x36925c){var _0x22e3f4=typeof _0x4d7d00['offset']===_0x392b('0x1e')&&typeof _0x4d7d00[_0x392b('0x1f')]===_0x392b('0x1e');var _0x56db8d=_0x36925c['count'];var _0x4623e7=_0x22e3f4?0x0:_0x4d7d00['offset'];var _0x37984e=_0x22e3f4?_0x36925c[_0x392b('0x20')]:_0x4d7d00['offset']+_0x4d7d00['limit'];var _0x584fd8;if(_0x37984e>=_0x56db8d){_0x37984e=_0x56db8d;_0x584fd8=0xc8;}else{_0x584fd8=0xce;}_0x2bf588[_0x392b('0x1b')](_0x584fd8);return _0x2bf588[_0x392b('0x21')](_0x392b('0x22'),_0x4623e7+'-'+_0x37984e+'/'+_0x56db8d)['json'](_0x36925c);}return null;};}function patchUpdates(_0x418f14){return function(_0xdf9d8e){try{jsonpatch[_0x392b('0x23')](_0xdf9d8e,_0x418f14,!![]);}catch(_0x93667f){return BPromise[_0x392b('0x24')](_0x93667f);}return _0xdf9d8e[_0x392b('0x25')]();};}function saveUpdates(_0x33c2ee,_0x367db6){return function(_0x451b89){if(_0x451b89){return _0x451b89[_0x392b('0x26')](_0x33c2ee)['then'](function(_0x183c7d){return _0x183c7d;});}return null;};}function removeEntity(_0x4fde71,_0x3e33d1){return function(_0x1e60f3){if(_0x1e60f3){return _0x1e60f3['destroy']()[_0x392b('0x27')](function(){var _0x5de811=_0x1e60f3[_0x392b('0x28')]({'plain':!![]});var _0x5e95d9=_0x392b('0x29');return db[_0x392b('0x2a')][_0x392b('0x2b')]({'where':{'type':_0x5e95d9,'resourceId':_0x5de811['id']}})[_0x392b('0x27')](function(){return _0x1e60f3;});})[_0x392b('0x27')](function(){_0x4fde71['status'](0xcc)[_0x392b('0x1c')]();});}};}function handleEntityNotFound(_0x452ead,_0x5e57ee){return function(_0x5361e5){if(!_0x5361e5){_0x452ead[_0x392b('0x1a')](0x194);}return _0x5361e5;};}function handleError(_0x5632a3,_0xa2d767){_0xa2d767=_0xa2d767||0x1f4;return function(_0xe1d18c){logger[_0x392b('0x2c')](_0xe1d18c[_0x392b('0x2d')]);if(_0xe1d18c[_0x392b('0x2e')]){delete _0xe1d18c[_0x392b('0x2e')];}_0x5632a3['status'](_0xa2d767)['send'](_0xe1d18c);};}exports[_0x392b('0x2f')]=function(_0xe64773,_0x1eb14d){var _0x405445={},_0x709d83={},_0x3be525={'count':0x0,'rows':[]};var _0x516895=_[_0x392b('0x30')](db[_0x392b('0x31')]['rawAttributes'],function(_0x4f9ed2){return{'name':_0x4f9ed2[_0x392b('0x32')],'type':_0x4f9ed2[_0x392b('0x33')]['key']};});_0x709d83['model']=_[_0x392b('0x30')](_0x516895,'name');_0x709d83[_0x392b('0x34')]=_[_0x392b('0x35')](_0xe64773[_0x392b('0x34')]);_0x709d83['filters']=_[_0x392b('0x36')](_0x709d83[_0x392b('0x37')],_0x709d83[_0x392b('0x34')]);_0x405445[_0x392b('0x38')]=_[_0x392b('0x36')](_0x709d83[_0x392b('0x37')],qs['fields'](_0xe64773['query']['fields']));_0x405445['attributes']=_0x405445['attributes'][_0x392b('0x39')]?_0x405445[_0x392b('0x38')]:_0x709d83[_0x392b('0x37')];if(!_0xe64773['query'][_0x392b('0x3a')](_0x392b('0x3b'))){_0x405445[_0x392b('0x1f')]=qs[_0x392b('0x1f')](_0xe64773[_0x392b('0x34')]['limit']);_0x405445[_0x392b('0x3c')]=qs[_0x392b('0x3c')](_0xe64773[_0x392b('0x34')][_0x392b('0x3c')]);}_0x405445['order']=qs[_0x392b('0x3d')](_0xe64773['query'][_0x392b('0x3d')]);_0x405445[_0x392b('0x3e')]=qs[_0x392b('0x3f')](_['pick'](_0xe64773[_0x392b('0x34')],_0x709d83[_0x392b('0x3f')]),_0x516895);if(_0xe64773['query'][_0x392b('0x40')]){_0x405445[_0x392b('0x3e')]=_['merge'](_0x405445[_0x392b('0x3e')],{'$or':_[_0x392b('0x30')](_0x516895,function(_0x3646ab){if(_0x3646ab[_0x392b('0x33')]!==_0x392b('0x41')){var _0x915612={};_0x915612[_0x3646ab['name']]={'$like':'%'+_0xe64773['query']['filter']+'%'};return _0x915612;}})});}_0x405445=_[_0x392b('0x42')]({},_0x405445,_0xe64773[_0x392b('0x43')]);var _0x4e2b50={'where':_0x405445[_0x392b('0x3e')]};return db[_0x392b('0x31')][_0x392b('0x20')](_0x4e2b50)[_0x392b('0x27')](function(_0x1867d7){_0x3be525[_0x392b('0x20')]=_0x1867d7;if(_0xe64773[_0x392b('0x34')]['includeAll']){_0x405445[_0x392b('0x44')]=[{'all':!![]}];}return db[_0x392b('0x31')][_0x392b('0x45')](_0x405445);})['then'](function(_0x89e77b){_0x3be525[_0x392b('0x46')]=_0x89e77b;return _0x3be525;})['then'](respondWithFilteredResult(_0x1eb14d,_0x405445))[_0x392b('0x47')](handleError(_0x1eb14d,null));};exports[_0x392b('0x48')]=function(_0x721aa1,_0x4ae0dc){var _0x1b8952={'raw':![],'where':{'id':_0x721aa1[_0x392b('0x49')]['id']}},_0x4048f6={};_0x4048f6[_0x392b('0x37')]=_[_0x392b('0x35')](db[_0x392b('0x31')][_0x392b('0x4a')]);_0x4048f6[_0x392b('0x34')]=_[_0x392b('0x35')](_0x721aa1[_0x392b('0x34')]);_0x4048f6[_0x392b('0x3f')]=_[_0x392b('0x36')](_0x4048f6['model'],_0x4048f6[_0x392b('0x34')]);_0x1b8952[_0x392b('0x38')]=_[_0x392b('0x36')](_0x4048f6[_0x392b('0x37')],qs['fields'](_0x721aa1[_0x392b('0x34')]['fields']));_0x1b8952[_0x392b('0x38')]=_0x1b8952['attributes'][_0x392b('0x39')]?_0x1b8952[_0x392b('0x38')]:_0x4048f6[_0x392b('0x37')];if(_0x721aa1[_0x392b('0x34')]['includeAll']){_0x1b8952[_0x392b('0x44')]=[{'all':!![]}];}_0x1b8952=_[_0x392b('0x42')]({},_0x1b8952,_0x721aa1[_0x392b('0x43')]);return db[_0x392b('0x31')]['find'](_0x1b8952)[_0x392b('0x27')](handleEntityNotFound(_0x4ae0dc,null))[_0x392b('0x27')](respondWithResult(_0x4ae0dc,null))[_0x392b('0x47')](handleError(_0x4ae0dc,null));};exports[_0x392b('0x4b')]=function(_0x5bdae5,_0x20908c){return db[_0x392b('0x31')]['create'](_0x5bdae5['body'],{})[_0x392b('0x27')](function(_0x34f6f4){var _0x3c4f4f=_0x5bdae5[_0x392b('0x4c')][_0x392b('0x28')]({'plain':!![]});if(!_0x3c4f4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c4f4f[_0x392b('0x4d')]===_0x392b('0x4c')){var _0x810078=_0x34f6f4[_0x392b('0x28')]({'plain':!![]});var _0x23b057=_0x392b('0x29');return db[_0x392b('0x4e')][_0x392b('0x4f')]({'where':{'name':_0x23b057,'userProfileId':_0x3c4f4f['userProfileId']},'raw':!![]})[_0x392b('0x27')](function(_0x41a74e){if(_0x41a74e&&_0x41a74e[_0x392b('0x50')]===0x0){return db['UserProfileResource'][_0x392b('0x4b')]({'name':_0x810078['name'],'resourceId':_0x810078['id'],'type':_0x41a74e[_0x392b('0x2e')],'sectionId':_0x41a74e['id']},{})['then'](function(){return _0x34f6f4;});}else{return _0x34f6f4;}})['catch'](function(_0x587c6c){logger[_0x392b('0x2c')](_0x392b('0x51'),_0x587c6c);throw _0x587c6c;});}return _0x34f6f4;})['then'](respondWithResult(_0x20908c,0xc9))[_0x392b('0x47')](handleError(_0x20908c,null));};exports['update']=function(_0x4064c9,_0x438e1c){if(_0x4064c9['body']['id']){delete _0x4064c9['body']['id'];}return db['SquareProject'][_0x392b('0x4f')]({'where':{'id':_0x4064c9['params']['id']}})[_0x392b('0x27')](handleEntityNotFound(_0x438e1c,null))['then'](saveUpdates(_0x4064c9[_0x392b('0x52')],null))[_0x392b('0x27')](respondWithResult(_0x438e1c,null))[_0x392b('0x47')](handleError(_0x438e1c,null));};exports['destroy']=function(_0x4ee1e8,_0x5ca6bf){return db[_0x392b('0x31')][_0x392b('0x4f')]({'where':{'id':_0x4ee1e8['params']['id']}})[_0x392b('0x27')](handleEntityNotFound(_0x5ca6bf,null))[_0x392b('0x27')](removeEntity(_0x5ca6bf,null))[_0x392b('0x47')](handleError(_0x5ca6bf,null));};exports['addUsers']=function(_0x198cf2,_0x5a5cc0,_0x94f05a){return db[_0x392b('0x31')]['find']({'where':{'id':_0x198cf2['params']['id']}})['then'](handleEntityNotFound(_0x5a5cc0,null))[_0x392b('0x27')](function(_0x29319a){if(_0x29319a){return _0x29319a[_0x392b('0x53')](_0x198cf2[_0x392b('0x52')]['ids'],_[_0x392b('0x54')](_0x198cf2[_0x392b('0x52')],[_0x392b('0x55'),'id'])||{});}})['then'](respondWithResult(_0x5a5cc0,null))[_0x392b('0x47')](handleError(_0x5a5cc0,null));};exports[_0x392b('0x56')]=function(_0x2619e1,_0x304210,_0x2c67cd){return db[_0x392b('0x31')][_0x392b('0x4f')]({'where':{'id':_0x2619e1['params']['id']}})[_0x392b('0x27')](handleEntityNotFound(_0x304210,null))[_0x392b('0x27')](function(_0x1dba0d){if(_0x1dba0d){return _0x1dba0d[_0x392b('0x56')](_0x2619e1['query'][_0x392b('0x55')])[_0x392b('0x27')](function(){if(_[_0x392b('0x57')](_0x2619e1['query']['ids'])){for(var _0x421030=0x0;_0x421030<_0x2619e1[_0x392b('0x34')][_0x392b('0x55')]['length'];_0x421030+=0x1){socket['emit'](_0x392b('0x58'),{'UserId':Number(_0x2619e1[_0x392b('0x34')][_0x392b('0x55')][_0x421030]),'SquareProjectId':Number(_0x2619e1['params']['id'])});}}else{socket[_0x392b('0x59')](_0x392b('0x58'),{'UserId':Number(_0x2619e1[_0x392b('0x34')]['ids']),'SquareProjectId':Number(_0x2619e1[_0x392b('0x49')]['id'])});}});}})[_0x392b('0x27')](respondWithStatusCode(_0x304210,null))['catch'](handleError(_0x304210,null));};exports[_0x392b('0x5a')]=function(_0x4bc538,_0x2d5a13,_0x3e6fda){var _0x220563={};var _0x5efd50={};var _0x144635;var _0x43d6c7;return db[_0x392b('0x31')]['findOne']({'where':{'id':_0x4bc538[_0x392b('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d5a13,null))[_0x392b('0x27')](function(_0x1d5a95){if(_0x1d5a95){_0x144635=_0x1d5a95;_0x5efd50[_0x392b('0x37')]=_[_0x392b('0x35')](db['User'][_0x392b('0x4a')]);_0x5efd50[_0x392b('0x34')]=_[_0x392b('0x35')](_0x4bc538['query']);_0x5efd50['filters']=_['intersection'](_0x5efd50[_0x392b('0x37')],_0x5efd50[_0x392b('0x34')]);_0x220563[_0x392b('0x38')]=_[_0x392b('0x36')](_0x5efd50['model'],qs['fields'](_0x4bc538[_0x392b('0x34')][_0x392b('0x5b')]));_0x220563[_0x392b('0x38')]=_0x220563[_0x392b('0x38')]['length']?_0x220563['attributes']:_0x5efd50[_0x392b('0x37')];_0x220563[_0x392b('0x5c')]=qs[_0x392b('0x3d')](_0x4bc538['query'][_0x392b('0x3d')]);_0x220563[_0x392b('0x3e')]=qs[_0x392b('0x3f')](_[_0x392b('0x5d')](_0x4bc538[_0x392b('0x34')],_0x5efd50[_0x392b('0x3f')]));if(_0x4bc538['query'][_0x392b('0x40')]){_0x220563['where']=_[_0x392b('0x42')](_0x220563['where'],{'$or':_[_0x392b('0x30')](_0x220563['attributes'],function(_0x59e5ab){var _0x152447={};_0x152447[_0x59e5ab]={'$like':'%'+_0x4bc538[_0x392b('0x34')][_0x392b('0x40')]+'%'};return _0x152447;})});}_0x220563=_[_0x392b('0x42')]({},_0x220563,_0x4bc538['options']);return _0x144635[_0x392b('0x5a')](_0x220563);}})[_0x392b('0x27')](function(_0x37ed32){if(_0x37ed32){_0x43d6c7=_0x37ed32[_0x392b('0x39')];if(!_0x4bc538[_0x392b('0x34')][_0x392b('0x3a')]('nolimit')){_0x220563[_0x392b('0x1f')]=qs['limit'](_0x4bc538['query']['limit']);_0x220563['offset']=qs[_0x392b('0x3c')](_0x4bc538[_0x392b('0x34')][_0x392b('0x3c')]);}return _0x144635['getUsers'](_0x220563);}})[_0x392b('0x27')](function(_0x463e29){if(_0x463e29){return _0x463e29?{'count':_0x43d6c7,'rows':_0x463e29}:null;}})[_0x392b('0x27')](respondWithResult(_0x2d5a13,null))[_0x392b('0x47')](handleError(_0x2d5a13,null));}; \ No newline at end of file +var _0x2572=['isArray','emit','userSquareProject:remove','User','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','redis','defaults','localhost','register','status','undefined','count','offset','json','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','findAll','catch','show','params','fields','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids'];(function(_0x2a8822,_0xe2542d){var _0x4d3ef8=function(_0x275185){while(--_0x275185){_0x2a8822['push'](_0x2a8822['shift']());}};_0x4d3ef8(++_0xe2542d);}(_0x2572,0x12b));var _0x2257=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2572[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2257('0x6'));var util=require(_0x2257('0x7'));var path=require('path');var sox=require(_0x2257('0x8'));var csv=require(_0x2257('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2257('0xa'));var _=require('lodash');var squel=require(_0x2257('0xb'));var crypto=require(_0x2257('0xc'));var jsforce=require(_0x2257('0xd'));var deskjs=require(_0x2257('0xe'));var toCsv=require(_0x2257('0x9'));var querystring=require(_0x2257('0xf'));var Papa=require(_0x2257('0x10'));var Redis=require(_0x2257('0x11'));var authService=require(_0x2257('0x12'));var qs=require(_0x2257('0x13'));var as=require(_0x2257('0x14'));var hardwareService=require(_0x2257('0x15'));var logger=require(_0x2257('0x16'))(_0x2257('0x17'));var utils=require(_0x2257('0x18'));var config=require(_0x2257('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1a'))['db'];config[_0x2257('0x1b')]=_[_0x2257('0x1c')](config[_0x2257('0x1b')],{'host':_0x2257('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2257('0x1b')]));require('./squareProject.socket')[_0x2257('0x1e')](socket);function respondWithStatusCode(_0x83c893,_0x2a7dd9){_0x2a7dd9=_0x2a7dd9||0xcc;return function(_0x4700c8){if(_0x4700c8){return _0x83c893['sendStatus'](_0x2a7dd9);}return _0x83c893['status'](_0x2a7dd9)['end']();};}function respondWithResult(_0x373bea,_0x3bb6e5){_0x3bb6e5=_0x3bb6e5||0xc8;return function(_0x435288){if(_0x435288){return _0x373bea[_0x2257('0x1f')](_0x3bb6e5)['json'](_0x435288);}};}function respondWithFilteredResult(_0xc81f00,_0x22b3ea){return function(_0x5eb547){if(_0x5eb547){var _0x5d3945=typeof _0x22b3ea['offset']===_0x2257('0x20')&&typeof _0x22b3ea['limit']===_0x2257('0x20');var _0x130116=_0x5eb547[_0x2257('0x21')];var _0x61d7ef=_0x5d3945?0x0:_0x22b3ea[_0x2257('0x22')];var _0xe22a7c=_0x5d3945?_0x5eb547[_0x2257('0x21')]:_0x22b3ea[_0x2257('0x22')]+_0x22b3ea['limit'];var _0x44ee24;if(_0xe22a7c>=_0x130116){_0xe22a7c=_0x130116;_0x44ee24=0xc8;}else{_0x44ee24=0xce;}_0xc81f00[_0x2257('0x1f')](_0x44ee24);return _0xc81f00['set']('Content-Range',_0x61d7ef+'-'+_0xe22a7c+'/'+_0x130116)[_0x2257('0x23')](_0x5eb547);}return null;};}function patchUpdates(_0x43010b){return function(_0x17883f){try{jsonpatch[_0x2257('0x24')](_0x17883f,_0x43010b,!![]);}catch(_0x30c2f1){return BPromise[_0x2257('0x25')](_0x30c2f1);}return _0x17883f[_0x2257('0x26')]();};}function saveUpdates(_0x1340e1,_0x171954){return function(_0x163802){if(_0x163802){return _0x163802['update'](_0x1340e1)[_0x2257('0x27')](function(_0x4aa396){return _0x4aa396;});}return null;};}function removeEntity(_0x3b90ec,_0x1999e7){return function(_0x52ff3a){if(_0x52ff3a){return _0x52ff3a[_0x2257('0x28')]()[_0x2257('0x27')](function(){var _0x55e797=_0x52ff3a[_0x2257('0x29')]({'plain':!![]});var _0x2d71e0=_0x2257('0x2a');return db[_0x2257('0x2b')][_0x2257('0x28')]({'where':{'type':_0x2d71e0,'resourceId':_0x55e797['id']}})[_0x2257('0x27')](function(){return _0x52ff3a;});})[_0x2257('0x27')](function(){_0x3b90ec['status'](0xcc)[_0x2257('0x2c')]();});}};}function handleEntityNotFound(_0xf6ab2c,_0x53fe63){return function(_0x413745){if(!_0x413745){_0xf6ab2c[_0x2257('0x2d')](0x194);}return _0x413745;};}function handleError(_0x4f695,_0x397c43){_0x397c43=_0x397c43||0x1f4;return function(_0x4d2ddd){logger[_0x2257('0x2e')](_0x4d2ddd[_0x2257('0x2f')]);if(_0x4d2ddd['name']){delete _0x4d2ddd[_0x2257('0x30')];}_0x4f695[_0x2257('0x1f')](_0x397c43)[_0x2257('0x31')](_0x4d2ddd);};}exports[_0x2257('0x32')]=function(_0x4996db,_0x353fe9){var _0x3eaaf5={},_0x2faf0={},_0x400d5b={'count':0x0,'rows':[]};var _0x16cc01=_[_0x2257('0x33')](db['SquareProject'][_0x2257('0x34')],function(_0x1c3941){return{'name':_0x1c3941[_0x2257('0x35')],'type':_0x1c3941[_0x2257('0x36')][_0x2257('0x37')]};});_0x2faf0[_0x2257('0x38')]=_[_0x2257('0x33')](_0x16cc01,'name');_0x2faf0['query']=_[_0x2257('0x39')](_0x4996db[_0x2257('0x3a')]);_0x2faf0[_0x2257('0x3b')]=_[_0x2257('0x3c')](_0x2faf0[_0x2257('0x38')],_0x2faf0['query']);_0x3eaaf5[_0x2257('0x3d')]=_['intersection'](_0x2faf0[_0x2257('0x38')],qs['fields'](_0x4996db[_0x2257('0x3a')]['fields']));_0x3eaaf5[_0x2257('0x3d')]=_0x3eaaf5[_0x2257('0x3d')][_0x2257('0x3e')]?_0x3eaaf5[_0x2257('0x3d')]:_0x2faf0[_0x2257('0x38')];if(!_0x4996db[_0x2257('0x3a')][_0x2257('0x3f')](_0x2257('0x40'))){_0x3eaaf5[_0x2257('0x41')]=qs['limit'](_0x4996db[_0x2257('0x3a')][_0x2257('0x41')]);_0x3eaaf5[_0x2257('0x22')]=qs[_0x2257('0x22')](_0x4996db[_0x2257('0x3a')][_0x2257('0x22')]);}_0x3eaaf5[_0x2257('0x42')]=qs[_0x2257('0x43')](_0x4996db[_0x2257('0x3a')]['sort']);_0x3eaaf5[_0x2257('0x44')]=qs[_0x2257('0x3b')](_[_0x2257('0x45')](_0x4996db['query'],_0x2faf0[_0x2257('0x3b')]),_0x16cc01);if(_0x4996db['query'][_0x2257('0x46')]){_0x3eaaf5[_0x2257('0x44')]=_[_0x2257('0x47')](_0x3eaaf5[_0x2257('0x44')],{'$or':_[_0x2257('0x33')](_0x16cc01,function(_0x4a12c9){if(_0x4a12c9[_0x2257('0x36')]!==_0x2257('0x48')){var _0x1123c9={};_0x1123c9[_0x4a12c9[_0x2257('0x30')]]={'$like':'%'+_0x4996db[_0x2257('0x3a')][_0x2257('0x46')]+'%'};return _0x1123c9;}})});}_0x3eaaf5=_[_0x2257('0x47')]({},_0x3eaaf5,_0x4996db[_0x2257('0x49')]);var _0x473538={'where':_0x3eaaf5['where']};return db[_0x2257('0x4a')][_0x2257('0x21')](_0x473538)[_0x2257('0x27')](function(_0x480270){_0x400d5b['count']=_0x480270;if(_0x4996db['query'][_0x2257('0x4b')]){_0x3eaaf5['include']=[{'all':!![]}];}return db['SquareProject'][_0x2257('0x4c')](_0x3eaaf5);})[_0x2257('0x27')](function(_0x5e5e20){_0x400d5b['rows']=_0x5e5e20;return _0x400d5b;})['then'](respondWithFilteredResult(_0x353fe9,_0x3eaaf5))[_0x2257('0x4d')](handleError(_0x353fe9,null));};exports[_0x2257('0x4e')]=function(_0x54a790,_0x3edf23){var _0x788100={'raw':![],'where':{'id':_0x54a790[_0x2257('0x4f')]['id']}},_0x413793={};_0x413793['model']=_[_0x2257('0x39')](db[_0x2257('0x4a')][_0x2257('0x34')]);_0x413793['query']=_[_0x2257('0x39')](_0x54a790['query']);_0x413793[_0x2257('0x3b')]=_[_0x2257('0x3c')](_0x413793[_0x2257('0x38')],_0x413793['query']);_0x788100[_0x2257('0x3d')]=_[_0x2257('0x3c')](_0x413793[_0x2257('0x38')],qs['fields'](_0x54a790['query'][_0x2257('0x50')]));_0x788100[_0x2257('0x3d')]=_0x788100[_0x2257('0x3d')][_0x2257('0x3e')]?_0x788100['attributes']:_0x413793[_0x2257('0x38')];if(_0x54a790[_0x2257('0x3a')][_0x2257('0x4b')]){_0x788100[_0x2257('0x51')]=[{'all':!![]}];}_0x788100=_[_0x2257('0x47')]({},_0x788100,_0x54a790[_0x2257('0x49')]);return db[_0x2257('0x4a')]['find'](_0x788100)[_0x2257('0x27')](handleEntityNotFound(_0x3edf23,null))['then'](respondWithResult(_0x3edf23,null))[_0x2257('0x4d')](handleError(_0x3edf23,null));};exports['create']=function(_0x1ed6db,_0x2bf0ff){return db['SquareProject'][_0x2257('0x52')](_0x1ed6db[_0x2257('0x53')],{})[_0x2257('0x27')](function(_0x4d3ecd){var _0x5106cb=_0x1ed6db['user'][_0x2257('0x29')]({'plain':!![]});if(!_0x5106cb)throw new Error(_0x2257('0x54'));if(_0x5106cb[_0x2257('0x55')]===_0x2257('0x56')){var _0x1a7df3=_0x4d3ecd[_0x2257('0x29')]({'plain':!![]});var _0x187736=_0x2257('0x2a');return db[_0x2257('0x57')][_0x2257('0x58')]({'where':{'name':_0x187736,'userProfileId':_0x5106cb['userProfileId']},'raw':!![]})['then'](function(_0x2007aa){if(_0x2007aa&&_0x2007aa['autoAssociation']===0x0){return db[_0x2257('0x2b')][_0x2257('0x52')]({'name':_0x1a7df3[_0x2257('0x30')],'resourceId':_0x1a7df3['id'],'type':_0x2007aa[_0x2257('0x30')],'sectionId':_0x2007aa['id']},{})[_0x2257('0x27')](function(){return _0x4d3ecd;});}else{return _0x4d3ecd;}})['catch'](function(_0x4a19c7){logger['error'](_0x2257('0x59'),_0x4a19c7);throw _0x4a19c7;});}return _0x4d3ecd;})[_0x2257('0x27')](respondWithResult(_0x2bf0ff,0xc9))[_0x2257('0x4d')](handleError(_0x2bf0ff,null));};exports[_0x2257('0x5a')]=function(_0x4b8589,_0x223739){if(_0x4b8589[_0x2257('0x53')]['id']){delete _0x4b8589[_0x2257('0x53')]['id'];}return db[_0x2257('0x4a')][_0x2257('0x58')]({'where':{'id':_0x4b8589[_0x2257('0x4f')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x223739,null))[_0x2257('0x27')](saveUpdates(_0x4b8589[_0x2257('0x53')],null))[_0x2257('0x27')](respondWithResult(_0x223739,null))['catch'](handleError(_0x223739,null));};exports[_0x2257('0x28')]=function(_0x16082a,_0x5ebef9){return db[_0x2257('0x4a')]['find']({'where':{'id':_0x16082a[_0x2257('0x4f')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x5ebef9,null))[_0x2257('0x27')](removeEntity(_0x5ebef9,null))[_0x2257('0x4d')](handleError(_0x5ebef9,null));};exports[_0x2257('0x5b')]=function(_0x2fc3e3,_0x18dc0d,_0x3945a7){return db[_0x2257('0x4a')][_0x2257('0x58')]({'where':{'id':_0x2fc3e3['params']['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x18dc0d,null))[_0x2257('0x27')](function(_0x514406){if(_0x514406){return _0x514406[_0x2257('0x5b')](_0x2fc3e3[_0x2257('0x53')][_0x2257('0x5c')],_['omit'](_0x2fc3e3[_0x2257('0x53')],[_0x2257('0x5c'),'id'])||{});}})[_0x2257('0x27')](respondWithResult(_0x18dc0d,null))['catch'](handleError(_0x18dc0d,null));};exports['removeUsers']=function(_0x58865e,_0x15325c,_0x15464a){return db['SquareProject'][_0x2257('0x58')]({'where':{'id':_0x58865e[_0x2257('0x4f')]['id']}})['then'](handleEntityNotFound(_0x15325c,null))['then'](function(_0x59f53b){if(_0x59f53b){return _0x59f53b['removeUsers'](_0x58865e[_0x2257('0x3a')][_0x2257('0x5c')])['then'](function(){if(_[_0x2257('0x5d')](_0x58865e[_0x2257('0x3a')][_0x2257('0x5c')])){for(var _0x13ef27=0x0;_0x13ef27<_0x58865e[_0x2257('0x3a')]['ids'][_0x2257('0x3e')];_0x13ef27+=0x1){socket[_0x2257('0x5e')](_0x2257('0x5f'),{'UserId':Number(_0x58865e[_0x2257('0x3a')][_0x2257('0x5c')][_0x13ef27]),'SquareProjectId':Number(_0x58865e['params']['id'])});}}else{socket[_0x2257('0x5e')](_0x2257('0x5f'),{'UserId':Number(_0x58865e[_0x2257('0x3a')][_0x2257('0x5c')]),'SquareProjectId':Number(_0x58865e[_0x2257('0x4f')]['id'])});}});}})[_0x2257('0x27')](respondWithStatusCode(_0x15325c,null))[_0x2257('0x4d')](handleError(_0x15325c,null));};exports['getUsers']=function(_0x59cc08,_0x9a47c8,_0x42e9a8){var _0x1fe53d={};var _0x2af515={};var _0x410e2b;var _0x3ee497;return db[_0x2257('0x4a')]['findOne']({'where':{'id':_0x59cc08[_0x2257('0x4f')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x9a47c8,null))[_0x2257('0x27')](function(_0x3e477d){if(_0x3e477d){_0x410e2b=_0x3e477d;_0x2af515[_0x2257('0x38')]=_[_0x2257('0x39')](db[_0x2257('0x60')]['rawAttributes']);_0x2af515[_0x2257('0x3a')]=_[_0x2257('0x39')](_0x59cc08[_0x2257('0x3a')]);_0x2af515['filters']=_['intersection'](_0x2af515[_0x2257('0x38')],_0x2af515[_0x2257('0x3a')]);_0x1fe53d[_0x2257('0x3d')]=_[_0x2257('0x3c')](_0x2af515[_0x2257('0x38')],qs['fields'](_0x59cc08[_0x2257('0x3a')][_0x2257('0x50')]));_0x1fe53d[_0x2257('0x3d')]=_0x1fe53d[_0x2257('0x3d')][_0x2257('0x3e')]?_0x1fe53d[_0x2257('0x3d')]:_0x2af515[_0x2257('0x38')];_0x1fe53d[_0x2257('0x42')]=qs['sort'](_0x59cc08['query'][_0x2257('0x43')]);_0x1fe53d[_0x2257('0x44')]=qs[_0x2257('0x3b')](_[_0x2257('0x45')](_0x59cc08[_0x2257('0x3a')],_0x2af515[_0x2257('0x3b')]));if(_0x59cc08[_0x2257('0x3a')][_0x2257('0x46')]){_0x1fe53d[_0x2257('0x44')]=_[_0x2257('0x47')](_0x1fe53d['where'],{'$or':_[_0x2257('0x33')](_0x1fe53d['attributes'],function(_0x4b7946){var _0x354d3b={};_0x354d3b[_0x4b7946]={'$like':'%'+_0x59cc08['query'][_0x2257('0x46')]+'%'};return _0x354d3b;})});}_0x1fe53d=_[_0x2257('0x47')]({},_0x1fe53d,_0x59cc08[_0x2257('0x49')]);return _0x410e2b[_0x2257('0x61')](_0x1fe53d);}})[_0x2257('0x27')](function(_0x252174){if(_0x252174){_0x3ee497=_0x252174[_0x2257('0x3e')];if(!_0x59cc08[_0x2257('0x3a')][_0x2257('0x3f')](_0x2257('0x40'))){_0x1fe53d[_0x2257('0x41')]=qs[_0x2257('0x41')](_0x59cc08['query'][_0x2257('0x41')]);_0x1fe53d[_0x2257('0x22')]=qs[_0x2257('0x22')](_0x59cc08[_0x2257('0x3a')][_0x2257('0x22')]);}return _0x410e2b['getUsers'](_0x1fe53d);}})[_0x2257('0x27')](function(_0x210f49){if(_0x210f49){return _0x210f49?{'count':_0x3ee497,'rows':_0x210f49}:null;}})[_0x2257('0x27')](respondWithResult(_0x9a47c8,null))['catch'](handleError(_0x9a47c8,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7b2d566..9e13f1b 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 _0x494b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','update','remove'];(function(_0x3e893f,_0x2c2d02){var _0x1f17d2=function(_0x7cd7e8){while(--_0x7cd7e8){_0x3e893f['push'](_0x3e893f['shift']());}};_0x1f17d2(++_0x2c2d02);}(_0x494b,0x1da));var _0xb494=function(_0x1eff59,_0x195aa6){_0x1eff59=_0x1eff59-0x0;var _0xa061cd=_0x494b[_0x1eff59];return _0xa061cd;};'use strict';var EventEmitter=require(_0xb494('0x0'));var SquareProject=require(_0xb494('0x1'))['db'][_0xb494('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb494('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb494('0x4'),'afterDestroy':_0xb494('0x5')};function emitEvent(_0x1bd775){return function(_0x1159d9,_0x2a7d54,_0x34b13f){SquareProjectEvents[_0xb494('0x6')](_0x1bd775+':'+_0x1159d9['id'],_0x1159d9);SquareProjectEvents['emit'](_0x1bd775,_0x1159d9);_0x34b13f(null);};}for(var e in events){if(events[_0xb494('0x7')](e)){var event=events[e];SquareProject[_0xb494('0x8')](e,emitEvent(event));}}module[_0xb494('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x8108=['SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1cb568,_0x2cba5f){var _0x191caa=function(_0x3ec3d1){while(--_0x3ec3d1){_0x1cb568['push'](_0x1cb568['shift']());}};_0x191caa(++_0x2cba5f);}(_0x8108,0xb2));var _0x8810=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x8108[_0x5e4563];return _0x8d1bf5;};'use strict';var EventEmitter=require(_0x8810('0x0'));var SquareProject=require(_0x8810('0x1'))['db'][_0x8810('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8810('0x3')](0x0);var events={'afterCreate':_0x8810('0x4'),'afterUpdate':'update','afterDestroy':_0x8810('0x5')};function emitEvent(_0x255a5b){return function(_0x37504e,_0xfc7af5,_0x338f1c){SquareProjectEvents[_0x8810('0x6')](_0x255a5b+':'+_0x37504e['id'],_0x37504e);SquareProjectEvents[_0x8810('0x6')](_0x255a5b,_0x37504e);_0x338f1c(null);};}for(var e in events){if(events[_0x8810('0x7')](e)){var event=events[e];SquareProject[_0x8810('0x8')](e,emitEvent(event));}}module[_0x8810('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2e65a1e..fa9b513 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 _0x821b=['square_projects','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x821b,0x180));var _0xb821=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x821b[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xb821('0x0'));var util=require(_0xb821('0x1'));var logger=require('../../config/logger')(_0xb821('0x2'));var moment=require(_0xb821('0x3'));var BPromise=require(_0xb821('0x4'));var rp=require(_0xb821('0x5'));var fs=require('fs');var path=require(_0xb821('0x6'));var rimraf=require(_0xb821('0x7'));var config=require('../../config/environment');var attributes=require(_0xb821('0x8'));module[_0xb821('0x9')]=function(_0x1df304,_0x51c352){return _0x1df304[_0xb821('0xa')](_0xb821('0xb'),attributes,{'tableName':_0xb821('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9e53aa,_0x2784c1,_0x1f5cea){if(_0x9e53aa['changed']('preproduction')){_0x9e53aa[_0xb821('0xd')]=moment()[_0xb821('0xe')](_0xb821('0xf'));}if(_0x9e53aa[_0xb821('0x10')](_0xb821('0x11'))){_0x9e53aa['publishedAt']=moment()[_0xb821('0xe')](_0xb821('0xf'));}_0x1f5cea(null,_0x9e53aa);}}});}; \ No newline at end of file +var _0xfe50=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction'];(function(_0x2c9c21,_0xa64239){var _0x2483da=function(_0x2c4a38){while(--_0x2c4a38){_0x2c9c21['push'](_0x2c9c21['shift']());}};_0x2483da(++_0xa64239);}(_0xfe50,0x194));var _0x0fe5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfe50[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0fe5('0x0'));var logger=require(_0x0fe5('0x1'))(_0x0fe5('0x2'));var moment=require('moment');var BPromise=require(_0x0fe5('0x3'));var rp=require(_0x0fe5('0x4'));var fs=require('fs');var path=require(_0x0fe5('0x5'));var rimraf=require(_0x0fe5('0x6'));var config=require(_0x0fe5('0x7'));var attributes=require(_0x0fe5('0x8'));module[_0x0fe5('0x9')]=function(_0x4dcafc,_0x3570c2){return _0x4dcafc[_0x0fe5('0xa')](_0x0fe5('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53ed56,_0x470473,_0x56cf40){if(_0x53ed56[_0x0fe5('0xc')](_0x0fe5('0xd'))){_0x53ed56[_0x0fe5('0xe')]=moment()[_0x0fe5('0xf')](_0x0fe5('0x10'));}if(_0x53ed56[_0x0fe5('0xc')](_0x0fe5('0x11'))){_0x53ed56[_0x0fe5('0x12')]=moment()[_0x0fe5('0xf')](_0x0fe5('0x10'));}_0x56cf40(null,_0x53ed56);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index ef0a04b..60f8b04 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 _0x586f=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareProject','find','options','where','include','map','model','attributes','ShowSquareProject','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24a56a,_0x550eb7){var _0x4175c0=function(_0x1bc188){while(--_0x1bc188){_0x24a56a['push'](_0x24a56a['shift']());}};_0x4175c0(++_0x550eb7);}(_0x586f,0x11a));var _0xf586=function(_0x211f66,_0x6d409f){_0x211f66=_0x211f66-0x0;var _0x324240=_0x586f[_0x211f66];return _0x324240;};'use strict';var _=require(_0xf586('0x0'));var util=require(_0xf586('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf586('0x2'));var fs=require('fs');var Redis=require(_0xf586('0x3'));var db=require(_0xf586('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf586('0x5'))(_0xf586('0x6'));var config=require(_0xf586('0x7'));var jayson=require(_0xf586('0x8'));var client=jayson[_0xf586('0x9')]['http']({'port':0x232a});config[_0xf586('0xa')]=_[_0xf586('0xb')](config[_0xf586('0xa')],{'host':_0xf586('0xc'),'port':0x18eb});var socket=require(_0xf586('0xd'))(new Redis(config[_0xf586('0xa')]));require(_0xf586('0xe'))[_0xf586('0xf')](socket);function respondWithRpcPromise(_0x180143,_0x2b1513,_0x38cf00){return new BPromise(function(_0x5dcac1,_0x4af02b){return client[_0xf586('0x10')](_0x180143,_0x38cf00)[_0xf586('0x11')](function(_0x43f130){logger[_0xf586('0x12')](_0xf586('0x13'),_0x2b1513,_0xf586('0x14'));logger[_0xf586('0x15')](_0xf586('0x16'),_0x2b1513,_0xf586('0x14'),JSON[_0xf586('0x17')](_0x43f130));if(_0x43f130[_0xf586('0x18')]){if(_0x43f130[_0xf586('0x18')][_0xf586('0x19')]===0x1f4){logger[_0xf586('0x18')]('SquareProject,\x20%s,\x20%s',_0x2b1513,_0x43f130[_0xf586('0x18')][_0xf586('0x1a')]);return _0x4af02b(_0x43f130[_0xf586('0x18')][_0xf586('0x1a')]);}logger['error'](_0xf586('0x13'),_0x2b1513,_0x43f130[_0xf586('0x18')][_0xf586('0x1a')]);return _0x5dcac1(_0x43f130[_0xf586('0x18')][_0xf586('0x1a')]);}else{logger['info'](_0xf586('0x13'),_0x2b1513,_0xf586('0x14'));_0x5dcac1(_0x43f130[_0xf586('0x1b')][_0xf586('0x1a')]);}})[_0xf586('0x1c')](function(_0x552e88){logger['error'](_0xf586('0x13'),_0x2b1513,_0x552e88);_0x4af02b(_0x552e88);});});}exports['ShowSquareProject']=function(_0x310569){var _0x54c148=this;return new Promise(function(_0x11a86a,_0xd53be4){return db[_0xf586('0x1d')][_0xf586('0x1e')]({'raw':_0x310569[_0xf586('0x1f')]?_0x310569[_0xf586('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x310569[_0xf586('0x1f')]?_0x310569[_0xf586('0x1f')][_0xf586('0x20')]||null:null,'attributes':_0x310569[_0xf586('0x1f')]?_0x310569[_0xf586('0x1f')]['attributes']||null:null,'include':_0x310569[_0xf586('0x1f')]?_0x310569['options'][_0xf586('0x21')]?_[_0xf586('0x22')](_0x310569[_0xf586('0x1f')][_0xf586('0x21')],function(_0x6cb404){return{'model':db[_0x6cb404[_0xf586('0x23')]],'as':_0x6cb404['as'],'attributes':_0x6cb404[_0xf586('0x24')],'include':_0x6cb404['include']?_[_0xf586('0x22')](_0x6cb404[_0xf586('0x21')],function(_0x2ffbb2){return{'model':db[_0x2ffbb2['model']],'as':_0x2ffbb2['as'],'attributes':_0x2ffbb2['attributes'],'include':_0x2ffbb2[_0xf586('0x21')]?_[_0xf586('0x22')](_0x2ffbb2[_0xf586('0x21')],function(_0x347d5c){return{'model':db[_0x347d5c[_0xf586('0x23')]],'as':_0x347d5c['as'],'attributes':_0x347d5c[_0xf586('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf586('0x11')](function(_0xd08121){logger['info'](_0xf586('0x25'),_0x310569);logger[_0xf586('0x15')](_0xf586('0x25'),_0x310569,JSON[_0xf586('0x17')](_0xd08121));_0x11a86a(_0xd08121);})['catch'](function(_0x47164b){logger[_0xf586('0x18')](_0xf586('0x25'),_0x47164b['message'],_0x310569);_0xd53be4(_0x54c148[_0xf586('0x18')](0x1f4,_0x47164b[_0xf586('0x1a')]));});});}; \ No newline at end of file +var _0x5bda=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','include','map','model','attributes','then','info','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x21bdd1,_0x3f7cd8){var _0x30514e=function(_0x4c644a){while(--_0x4c644a){_0x21bdd1['push'](_0x21bdd1['shift']());}};_0x30514e(++_0x3f7cd8);}(_0x5bda,0x162));var _0xa5bd=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x5bda[_0x1e5db8];return _0x219a51;};'use strict';var _=require(_0xa5bd('0x0'));var util=require(_0xa5bd('0x1'));var moment=require(_0xa5bd('0x2'));var BPromise=require(_0xa5bd('0x3'));var rs=require(_0xa5bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa5bd('0x5'));var logger=require(_0xa5bd('0x6'))(_0xa5bd('0x7'));var config=require(_0xa5bd('0x8'));var jayson=require(_0xa5bd('0x9'));var client=jayson[_0xa5bd('0xa')][_0xa5bd('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa5bd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5bd('0xd'))(new Redis(config[_0xa5bd('0xc')]));require('./squareProject.socket')[_0xa5bd('0xe')](socket);function respondWithRpcPromise(_0x196dec,_0x394426,_0x4bd5a7){return new BPromise(function(_0xef655f,_0x45824c){return client['request'](_0x196dec,_0x4bd5a7)['then'](function(_0x444d4d){logger['info'](_0xa5bd('0xf'),_0x394426,_0xa5bd('0x10'));logger['debug'](_0xa5bd('0x11'),_0x394426,_0xa5bd('0x10'),JSON['stringify'](_0x444d4d));if(_0x444d4d[_0xa5bd('0x12')]){if(_0x444d4d[_0xa5bd('0x12')][_0xa5bd('0x13')]===0x1f4){logger['error'](_0xa5bd('0xf'),_0x394426,_0x444d4d[_0xa5bd('0x12')][_0xa5bd('0x14')]);return _0x45824c(_0x444d4d[_0xa5bd('0x12')][_0xa5bd('0x14')]);}logger[_0xa5bd('0x12')](_0xa5bd('0xf'),_0x394426,_0x444d4d[_0xa5bd('0x12')][_0xa5bd('0x14')]);return _0xef655f(_0x444d4d['error']['message']);}else{logger['info'](_0xa5bd('0xf'),_0x394426,'request\x20sent');_0xef655f(_0x444d4d[_0xa5bd('0x15')][_0xa5bd('0x14')]);}})[_0xa5bd('0x16')](function(_0x1f7512){logger[_0xa5bd('0x12')](_0xa5bd('0xf'),_0x394426,_0x1f7512);_0x45824c(_0x1f7512);});});}exports[_0xa5bd('0x17')]=function(_0x5cdea0){var _0x379e5c=this;return new Promise(function(_0x1f1bc0,_0x281883){return db[_0xa5bd('0x18')][_0xa5bd('0x19')]({'raw':_0x5cdea0[_0xa5bd('0x1a')]?_0x5cdea0[_0xa5bd('0x1a')][_0xa5bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cdea0['options']?_0x5cdea0['options']['where']||null:null,'attributes':_0x5cdea0['options']?_0x5cdea0[_0xa5bd('0x1a')]['attributes']||null:null,'include':_0x5cdea0[_0xa5bd('0x1a')]?_0x5cdea0[_0xa5bd('0x1a')][_0xa5bd('0x1c')]?_[_0xa5bd('0x1d')](_0x5cdea0['options'][_0xa5bd('0x1c')],function(_0x45adc6){return{'model':db[_0x45adc6[_0xa5bd('0x1e')]],'as':_0x45adc6['as'],'attributes':_0x45adc6[_0xa5bd('0x1f')],'include':_0x45adc6[_0xa5bd('0x1c')]?_['map'](_0x45adc6[_0xa5bd('0x1c')],function(_0x10fbd8){return{'model':db[_0x10fbd8[_0xa5bd('0x1e')]],'as':_0x10fbd8['as'],'attributes':_0x10fbd8[_0xa5bd('0x1f')],'include':_0x10fbd8[_0xa5bd('0x1c')]?_[_0xa5bd('0x1d')](_0x10fbd8['include'],function(_0x4a0baa){return{'model':db[_0x4a0baa[_0xa5bd('0x1e')]],'as':_0x4a0baa['as'],'attributes':_0x4a0baa[_0xa5bd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa5bd('0x20')](function(_0x206fb4){logger[_0xa5bd('0x21')]('ShowSquareProject',_0x5cdea0);logger[_0xa5bd('0x22')](_0xa5bd('0x17'),_0x5cdea0,JSON[_0xa5bd('0x23')](_0x206fb4));_0x1f1bc0(_0x206fb4);})[_0xa5bd('0x16')](function(_0x36e635){logger[_0xa5bd('0x12')](_0xa5bd('0x17'),_0x36e635[_0xa5bd('0x14')],_0x5cdea0);_0x281883(_0x379e5c[_0xa5bd('0x12')](0x1f4,_0x36e635[_0xa5bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8c4a83a..86e6ddb 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 _0x6de2=['remove','update','removeListener','register','squareProject:','./squareProject.events','save'];(function(_0x1237bd,_0x5ef0ad){var _0x2439ee=function(_0x46f492){while(--_0x46f492){_0x1237bd['push'](_0x1237bd['shift']());}};_0x2439ee(++_0x5ef0ad);}(_0x6de2,0x8a));var _0x26de=function(_0x4448af,_0x37e144){_0x4448af=_0x4448af-0x0;var _0x4f4dc7=_0x6de2[_0x4448af];return _0x4f4dc7;};'use strict';var SquareProjectEvents=require(_0x26de('0x0'));var events=[_0x26de('0x1'),_0x26de('0x2'),_0x26de('0x3')];function createListener(_0x58b2b2,_0x134649){return function(_0x4943e0){_0x134649['emit'](_0x58b2b2,_0x4943e0);};}function removeListener(_0x4212be,_0x467dfb){return function(){SquareProjectEvents[_0x26de('0x4')](_0x4212be,_0x467dfb);};}exports[_0x26de('0x5')]=function(_0x40471a){for(var _0x3fbb10=0x0,_0x208efc=events['length'];_0x3fbb10<_0x208efc;_0x3fbb10++){var _0x4fa86f=events[_0x3fbb10];var _0x41ed54=createListener(_0x26de('0x6')+_0x4fa86f,_0x40471a);SquareProjectEvents['on'](_0x4fa86f,_0x41ed54);}}; \ No newline at end of file +var _0x0734=['save','remove','update','register','length','squareProject:'];(function(_0x286030,_0x4bf753){var _0x233391=function(_0x211ed8){while(--_0x211ed8){_0x286030['push'](_0x286030['shift']());}};_0x233391(++_0x4bf753);}(_0x0734,0x1ce));var _0x4073=function(_0x2ef4d5,_0xec1531){_0x2ef4d5=_0x2ef4d5-0x0;var _0x1302fd=_0x0734[_0x2ef4d5];return _0x1302fd;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4073('0x0'),_0x4073('0x1'),_0x4073('0x2')];function createListener(_0x3f38d1,_0xe35f55){return function(_0x871859){_0xe35f55['emit'](_0x3f38d1,_0x871859);};}function removeListener(_0x244c94,_0x1de956){return function(){SquareProjectEvents['removeListener'](_0x244c94,_0x1de956);};}exports[_0x4073('0x3')]=function(_0x1c75ff){for(var _0x4760fb=0x0,_0x25b376=events[_0x4073('0x4')];_0x4760fb<_0x25b376;_0x4760fb++){var _0x51b1ef=events[_0x4760fb];var _0x32d907=createListener(_0x4073('0x5')+_0x51b1ef,_0x1c75ff);SquareProjectEvents['on'](_0x51b1ef,_0x32d907);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9eb7aef..16dda8a 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(_0x26f665,_0x2dd4f1){var _0x485b9d=function(_0x5cf002){while(--_0x5cf002){_0x26f665['push'](_0x26f665['shift']());}};_0x485b9d(++_0x2dd4f1);}(_0x814b,0x1a2));var _0xb814=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x814b[_0x2aee2f];return _0x19337f;};'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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x326f,0xd1));var _0xf326=function(_0x280972,_0x197e6a){_0x280972=_0x280972-0x0;var _0x3333a3=_0x326f[_0x280972];return _0x3333a3;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c185371..4674e53 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 _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x55555f,_0x26f977){var _0x515e2d=function(_0xc87912){while(--_0xc87912){_0x55555f['push'](_0x55555f['shift']());}};_0x515e2d(++_0x26f977);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x51bab0,_0x5bd2e7){_0x51bab0=_0x51bab0-0x0;var _0x259ef7=_0xdbf5[_0x51bab0];return _0x259ef7;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}}; \ No newline at end of file +var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0x98a8,0x12c));var _0x898a=function(_0x4b79c7,_0x32fe06){_0x4b79c7=_0x4b79c7-0x0;var _0x296a64=_0x98a8[_0x4b79c7];return _0x296a64;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index db94b67..5b13a48 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 _0x55ea=['pick','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','catch','show','params','keys','create','update','body','find','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','download','unlink','message','send','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x16afdf,_0x1ad7f6){var _0x277a9e=function(_0x3477ba){while(--_0x3477ba){_0x16afdf['push'](_0x16afdf['shift']());}};_0x277a9e(++_0x1ad7f6);}(_0x55ea,0x143));var _0xa55e=function(_0x5768b0,_0x4ffb64){_0x5768b0=_0x5768b0-0x0;var _0x44d203=_0x55ea[_0x5768b0];return _0x44d203;};'use strict';var emlformat=require(_0xa55e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa55e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa55e('0x2'));var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var Mustache=require(_0xa55e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa55e('0x6'));var ejs=require(_0xa55e('0x7'));var fs=require('fs');var fs_extra=require(_0xa55e('0x8'));var _=require(_0xa55e('0x9'));var squel=require(_0xa55e('0xa'));var crypto=require(_0xa55e('0xb'));var jsforce=require(_0xa55e('0xc'));var deskjs=require(_0xa55e('0xd'));var toCsv=require(_0xa55e('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55e('0xe'));var qs=require(_0xa55e('0xf'));var as=require(_0xa55e('0x10'));var hardwareService=require(_0xa55e('0x11'));var logger=require(_0xa55e('0x12'))(_0xa55e('0x13'));var utils=require(_0xa55e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa55e('0x15'));var db=require(_0xa55e('0x16'))['db'];function respondWithStatusCode(_0x4357d0,_0x24d242){_0x24d242=_0x24d242||0xcc;return function(_0x5ebb1d){if(_0x5ebb1d){return _0x4357d0[_0xa55e('0x17')](_0x24d242);}return _0x4357d0[_0xa55e('0x18')](_0x24d242)[_0xa55e('0x19')]();};}function respondWithResult(_0x3f6b19,_0x10e9ed){_0x10e9ed=_0x10e9ed||0xc8;return function(_0x225e1a){if(_0x225e1a){return _0x3f6b19['status'](_0x10e9ed)[_0xa55e('0x1a')](_0x225e1a);}};}function respondWithFilteredResult(_0x20bc50,_0x1b801f){return function(_0x569320){if(_0x569320){var _0x80f4a4=typeof _0x1b801f[_0xa55e('0x1b')]===_0xa55e('0x1c')&&typeof _0x1b801f[_0xa55e('0x1d')]==='undefined';var _0x33b032=_0x569320[_0xa55e('0x1e')];var _0x5b8135=_0x80f4a4?0x0:_0x1b801f[_0xa55e('0x1b')];var _0x295648=_0x80f4a4?_0x569320[_0xa55e('0x1e')]:_0x1b801f['offset']+_0x1b801f[_0xa55e('0x1d')];var _0x5059e3;if(_0x295648>=_0x33b032){_0x295648=_0x33b032;_0x5059e3=0xc8;}else{_0x5059e3=0xce;}_0x20bc50[_0xa55e('0x18')](_0x5059e3);return _0x20bc50[_0xa55e('0x1f')](_0xa55e('0x20'),_0x5b8135+'-'+_0x295648+'/'+_0x33b032)[_0xa55e('0x1a')](_0x569320);}return null;};}function patchUpdates(_0x5d0d1b){return function(_0x271532){try{jsonpatch[_0xa55e('0x21')](_0x271532,_0x5d0d1b,!![]);}catch(_0x1dd490){return BPromise[_0xa55e('0x22')](_0x1dd490);}return _0x271532[_0xa55e('0x23')]();};}function saveUpdates(_0x499f08,_0x52c906){return function(_0x991e8c){if(_0x991e8c){return _0x991e8c['update'](_0x499f08)[_0xa55e('0x24')](function(_0x5ce725){return _0x5ce725;});}return null;};}function removeEntity(_0x53cd07,_0x48ca07){return function(_0xbe978e){if(_0xbe978e){return _0xbe978e[_0xa55e('0x25')]()[_0xa55e('0x24')](function(){_0x53cd07[_0xa55e('0x18')](0xcc)[_0xa55e('0x19')]();});}};}function handleEntityNotFound(_0x2e92a6,_0x33cd2e){return function(_0x57d79d){if(!_0x57d79d){_0x2e92a6[_0xa55e('0x17')](0x194);}return _0x57d79d;};}function handleError(_0x46df88,_0x47cbe6){_0x47cbe6=_0x47cbe6||0x1f4;return function(_0x284939){logger[_0xa55e('0x26')](_0x284939[_0xa55e('0x27')]);if(_0x284939['name']){delete _0x284939[_0xa55e('0x28')];}_0x46df88['status'](_0x47cbe6)['send'](_0x284939);};}exports[_0xa55e('0x29')]=function(_0xdb9f65,_0x5e9ed2){var _0xe41650={},_0x2e1f52={},_0x2407da={'count':0x0,'rows':[]};var _0x5c44d2=_['map'](db['SquareRecording'][_0xa55e('0x2a')],function(_0x1a1e0e){return{'name':_0x1a1e0e[_0xa55e('0x2b')],'type':_0x1a1e0e[_0xa55e('0x2c')]['key']};});_0x2e1f52[_0xa55e('0x2d')]=_[_0xa55e('0x2e')](_0x5c44d2,_0xa55e('0x28'));_0x2e1f52['query']=_['keys'](_0xdb9f65[_0xa55e('0x2f')]);_0x2e1f52[_0xa55e('0x30')]=_[_0xa55e('0x31')](_0x2e1f52[_0xa55e('0x2d')],_0x2e1f52[_0xa55e('0x2f')]);_0xe41650['attributes']=_[_0xa55e('0x31')](_0x2e1f52[_0xa55e('0x2d')],qs[_0xa55e('0x32')](_0xdb9f65[_0xa55e('0x2f')][_0xa55e('0x32')]));_0xe41650[_0xa55e('0x33')]=_0xe41650[_0xa55e('0x33')][_0xa55e('0x34')]?_0xe41650[_0xa55e('0x33')]:_0x2e1f52['model'];if(!_0xdb9f65[_0xa55e('0x2f')][_0xa55e('0x35')]('nolimit')){_0xe41650[_0xa55e('0x1d')]=qs['limit'](_0xdb9f65['query'][_0xa55e('0x1d')]);_0xe41650[_0xa55e('0x1b')]=qs[_0xa55e('0x1b')](_0xdb9f65['query'][_0xa55e('0x1b')]);}_0xe41650[_0xa55e('0x36')]=qs['sort'](_0xdb9f65[_0xa55e('0x2f')][_0xa55e('0x37')]);_0xe41650[_0xa55e('0x38')]=qs[_0xa55e('0x30')](_[_0xa55e('0x39')](_0xdb9f65[_0xa55e('0x2f')],_0x2e1f52[_0xa55e('0x30')]),_0x5c44d2);if(_0xdb9f65[_0xa55e('0x2f')]['filter']){_0xe41650['where']=_['merge'](_0xe41650['where'],{'$or':_[_0xa55e('0x2e')](_0x5c44d2,function(_0x518c0a){if(_0x518c0a[_0xa55e('0x2c')]!==_0xa55e('0x3a')){var _0x5da52e={};_0x5da52e[_0x518c0a['name']]={'$like':'%'+_0xdb9f65[_0xa55e('0x2f')][_0xa55e('0x3b')]+'%'};return _0x5da52e;}})});}_0xe41650=_['merge']({},_0xe41650,_0xdb9f65[_0xa55e('0x3c')]);var _0x28f124={'where':_0xe41650[_0xa55e('0x38')]};return db[_0xa55e('0x3d')]['count'](_0x28f124)['then'](function(_0x4a0b1b){_0x2407da[_0xa55e('0x1e')]=_0x4a0b1b;if(_0xdb9f65[_0xa55e('0x2f')][_0xa55e('0x3e')]){_0xe41650[_0xa55e('0x3f')]=[{'all':!![]}];}return db[_0xa55e('0x3d')][_0xa55e('0x40')](_0xe41650);})[_0xa55e('0x24')](function(_0x3e7664){_0x2407da['rows']=_0x3e7664;return _0x2407da;})['then'](respondWithFilteredResult(_0x5e9ed2,_0xe41650))[_0xa55e('0x41')](handleError(_0x5e9ed2,null));};exports[_0xa55e('0x42')]=function(_0x3737ad,_0x118f6b){var _0xf26d65={'raw':!![],'where':{'id':_0x3737ad[_0xa55e('0x43')]['id']}},_0x54b862={};_0x54b862[_0xa55e('0x2d')]=_[_0xa55e('0x44')](db[_0xa55e('0x3d')][_0xa55e('0x2a')]);_0x54b862[_0xa55e('0x2f')]=_[_0xa55e('0x44')](_0x3737ad[_0xa55e('0x2f')]);_0x54b862[_0xa55e('0x30')]=_[_0xa55e('0x31')](_0x54b862['model'],_0x54b862[_0xa55e('0x2f')]);_0xf26d65[_0xa55e('0x33')]=_['intersection'](_0x54b862[_0xa55e('0x2d')],qs[_0xa55e('0x32')](_0x3737ad['query'][_0xa55e('0x32')]));_0xf26d65[_0xa55e('0x33')]=_0xf26d65[_0xa55e('0x33')][_0xa55e('0x34')]?_0xf26d65['attributes']:_0x54b862[_0xa55e('0x2d')];if(_0x3737ad['query']['includeAll']){_0xf26d65[_0xa55e('0x3f')]=[{'all':!![]}];}_0xf26d65=_['merge']({},_0xf26d65,_0x3737ad[_0xa55e('0x3c')]);return db[_0xa55e('0x3d')]['find'](_0xf26d65)[_0xa55e('0x24')](handleEntityNotFound(_0x118f6b,null))['then'](respondWithResult(_0x118f6b,null))['catch'](handleError(_0x118f6b,null));};exports[_0xa55e('0x45')]=function(_0x212550,_0x7fcd4e){return db[_0xa55e('0x3d')][_0xa55e('0x45')](_0x212550['body'],{})['then'](respondWithResult(_0x7fcd4e,0xc9))[_0xa55e('0x41')](handleError(_0x7fcd4e,null));};exports[_0xa55e('0x46')]=function(_0x55e6ff,_0x42b4e7){if(_0x55e6ff[_0xa55e('0x47')]['id']){delete _0x55e6ff[_0xa55e('0x47')]['id'];}return db['SquareRecording'][_0xa55e('0x48')]({'where':{'id':_0x55e6ff[_0xa55e('0x43')]['id']}})[_0xa55e('0x24')](handleEntityNotFound(_0x42b4e7,null))[_0xa55e('0x24')](saveUpdates(_0x55e6ff[_0xa55e('0x47')],null))[_0xa55e('0x24')](respondWithResult(_0x42b4e7,null))['catch'](handleError(_0x42b4e7,null));};exports['download']=function(_0x2f73ad,_0xa920f1,_0x16e9e8){var _0x4ac670=require(_0xa55e('0x49'));var _0x57433a=![];var _0x432810={};if(_0x2f73ad['query'][_0xa55e('0x2c')]&&_0x2f73ad[_0xa55e('0x2f')][_0xa55e('0x2c')]===_0xa55e('0x4a')){_0x432810['uniqueid']=_0x2f73ad[_0xa55e('0x43')]['id'];}else{_0x432810['id']=_0x2f73ad[_0xa55e('0x43')]['id'];}return db[_0xa55e('0x3d')][_0xa55e('0x48')]({'where':_0x432810,'attributes':['id',_0xa55e('0x4b'),'filename'],'raw':!![]})[_0xa55e('0x24')](handleEntityNotFound(_0xa920f1,null))['then'](function(_0x8ffa3e){if(_0x8ffa3e){var _0x3f62bb=_0x8ffa3e[_0xa55e('0x4b')];var _0x39eb78=util[_0xa55e('0x4c')]('%s.cypher',_0x3f62bb);if(fs[_0xa55e('0x4d')](_0x39eb78)){_0x57433a=!![];return _0x4ac670[_0xa55e('0x4e')](_0x39eb78,_0x3f62bb,config[_0xa55e('0x4f')][_0xa55e('0x50')])['then'](function(){return _0x8ffa3e;});}return _0x8ffa3e;}})[_0xa55e('0x24')](function(_0x59c9a2){if(_0x59c9a2){var _0x11fb50=_0x59c9a2[_0xa55e('0x4b')];if(!fs[_0xa55e('0x4d')](_0x11fb50)){throw new db[(_0xa55e('0x51'))]['ValidationError'](_0xa55e('0x52'));}if(_0x59c9a2[_0xa55e('0x53')]){return _0xa920f1[_0xa55e('0x54')](_0x11fb50,_0x59c9a2[_0xa55e('0x53')]+path['extname'](_0x11fb50),function(){if(_0x57433a){fs['unlink'](_0x11fb50);}});}else{return _0xa920f1['download'](_0x11fb50,function(_0x516b94){if(_0x57433a){fs[_0xa55e('0x55')](_0x11fb50);}});}}})['catch'](function(_0x272630){if(_0x272630[_0xa55e('0x56')]==='SquareRecording\x20not\x20found'){_0xa920f1[_0xa55e('0x18')](0x194)[_0xa55e('0x57')]('Not\x20found');}else{return handleError(_0xa920f1,null);}});};exports[_0xa55e('0x25')]=function(_0x219e88,_0x1415f1){return db[_0xa55e('0x3d')][_0xa55e('0x48')]({'where':{'id':_0x219e88[_0xa55e('0x43')]['id']}})['then'](function(_0x304874){if(_['isNil'](_0x304874)){throw new ReferenceError('Entity\x20not\x20found');}return _0x304874;})[_0xa55e('0x24')](function(_0x1fd632){var _0x55db6c=_0x1fd632['savePath'];logger['info'](_0xa55e('0x58'),_0x55db6c);if(!_[_0xa55e('0x59')](_0x1fd632['savePath'])&&fs[_0xa55e('0x4d')](_0x55db6c)){logger[_0xa55e('0x5a')](_0xa55e('0x5b')+_0x55db6c+_0xa55e('0x5c'));fs['unlinkSync'](_0x55db6c);}_0x55db6c=_0x55db6c+_0xa55e('0x5d');if(!_['isNil'](_0x1fd632[_0xa55e('0x4b')])&&fs['existsSync'](_0x55db6c)){logger[_0xa55e('0x5a')]('File:\x20\x22'+_0x55db6c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55e('0x5e')](_0x55db6c);}return _0x1fd632;})[_0xa55e('0x24')](function(_0x2582e8){if(!_0x2582e8)throw new InternalError();return _0x2582e8[_0xa55e('0x25')]();})[_0xa55e('0x24')](function(){_0x1415f1[_0xa55e('0x18')](0xcc)[_0xa55e('0x19')]();})[_0xa55e('0x41')](handleError(_0x1415f1,null));}; \ No newline at end of file +var _0xd721=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SquareRecording','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','catch','show','find','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x47f2af,_0x4d79c0){var _0x5657e7=function(_0xf6962e){while(--_0xf6962e){_0x47f2af['push'](_0x47f2af['shift']());}};_0x5657e7(++_0x4d79c0);}(_0xd721,0x176));var _0x1d72=function(_0x41c56b,_0x2976e9){_0x41c56b=_0x41c56b-0x0;var _0x418fed=_0xd721[_0x41c56b];return _0x418fed;};'use strict';var emlformat=require(_0x1d72('0x0'));var rimraf=require(_0x1d72('0x1'));var zipdir=require(_0x1d72('0x2'));var jsonpatch=require(_0x1d72('0x3'));var rp=require(_0x1d72('0x4'));var moment=require(_0x1d72('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1d72('0x6'));var util=require(_0x1d72('0x7'));var path=require(_0x1d72('0x8'));var sox=require('sox');var csv=require(_0x1d72('0x9'));var ejs=require(_0x1d72('0xa'));var fs=require('fs');var fs_extra=require(_0x1d72('0xb'));var _=require(_0x1d72('0xc'));var squel=require(_0x1d72('0xd'));var crypto=require(_0x1d72('0xe'));var jsforce=require(_0x1d72('0xf'));var deskjs=require(_0x1d72('0x10'));var toCsv=require(_0x1d72('0x9'));var querystring=require(_0x1d72('0x11'));var Papa=require(_0x1d72('0x12'));var Redis=require(_0x1d72('0x13'));var authService=require(_0x1d72('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1d72('0x15'));var hardwareService=require(_0x1d72('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1d72('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1d72('0x18'));var db=require(_0x1d72('0x19'))['db'];function respondWithStatusCode(_0x44eaef,_0x420b89){_0x420b89=_0x420b89||0xcc;return function(_0x3dcb9a){if(_0x3dcb9a){return _0x44eaef[_0x1d72('0x1a')](_0x420b89);}return _0x44eaef['status'](_0x420b89)[_0x1d72('0x1b')]();};}function respondWithResult(_0x55a9fe,_0xac86ec){_0xac86ec=_0xac86ec||0xc8;return function(_0x43b546){if(_0x43b546){return _0x55a9fe[_0x1d72('0x1c')](_0xac86ec)[_0x1d72('0x1d')](_0x43b546);}};}function respondWithFilteredResult(_0x2981a2,_0x23d8ae){return function(_0x57d460){if(_0x57d460){var _0x3d9b38=typeof _0x23d8ae[_0x1d72('0x1e')]===_0x1d72('0x1f')&&typeof _0x23d8ae['limit']===_0x1d72('0x1f');var _0x91a805=_0x57d460[_0x1d72('0x20')];var _0x175c19=_0x3d9b38?0x0:_0x23d8ae['offset'];var _0x3192d1=_0x3d9b38?_0x57d460['count']:_0x23d8ae[_0x1d72('0x1e')]+_0x23d8ae[_0x1d72('0x21')];var _0x33795c;if(_0x3192d1>=_0x91a805){_0x3192d1=_0x91a805;_0x33795c=0xc8;}else{_0x33795c=0xce;}_0x2981a2[_0x1d72('0x1c')](_0x33795c);return _0x2981a2[_0x1d72('0x22')](_0x1d72('0x23'),_0x175c19+'-'+_0x3192d1+'/'+_0x91a805)[_0x1d72('0x1d')](_0x57d460);}return null;};}function patchUpdates(_0x59ab0a){return function(_0x58675b){try{jsonpatch[_0x1d72('0x24')](_0x58675b,_0x59ab0a,!![]);}catch(_0x32b1e7){return BPromise[_0x1d72('0x25')](_0x32b1e7);}return _0x58675b[_0x1d72('0x26')]();};}function saveUpdates(_0x401e06,_0x310e42){return function(_0x42d324){if(_0x42d324){return _0x42d324[_0x1d72('0x27')](_0x401e06)[_0x1d72('0x28')](function(_0x2baeef){return _0x2baeef;});}return null;};}function removeEntity(_0x53b823,_0x335cd7){return function(_0x25cdbf){if(_0x25cdbf){return _0x25cdbf[_0x1d72('0x29')]()[_0x1d72('0x28')](function(){_0x53b823[_0x1d72('0x1c')](0xcc)[_0x1d72('0x1b')]();});}};}function handleEntityNotFound(_0x25b8d0,_0x16d7e1){return function(_0x1f1949){if(!_0x1f1949){_0x25b8d0[_0x1d72('0x1a')](0x194);}return _0x1f1949;};}function handleError(_0x36335b,_0x2f19b4){_0x2f19b4=_0x2f19b4||0x1f4;return function(_0x185b7e){logger[_0x1d72('0x2a')](_0x185b7e[_0x1d72('0x2b')]);if(_0x185b7e['name']){delete _0x185b7e[_0x1d72('0x2c')];}_0x36335b[_0x1d72('0x1c')](_0x2f19b4)[_0x1d72('0x2d')](_0x185b7e);};}exports[_0x1d72('0x2e')]=function(_0x16031f,_0x48bf4c){var _0x26eec2={},_0x5b2c87={},_0x24dae7={'count':0x0,'rows':[]};var _0x505cd5=_['map'](db[_0x1d72('0x2f')]['rawAttributes'],function(_0xf68536){return{'name':_0xf68536['fieldName'],'type':_0xf68536['type'][_0x1d72('0x30')]};});_0x5b2c87[_0x1d72('0x31')]=_[_0x1d72('0x32')](_0x505cd5,_0x1d72('0x2c'));_0x5b2c87[_0x1d72('0x33')]=_[_0x1d72('0x34')](_0x16031f['query']);_0x5b2c87[_0x1d72('0x35')]=_[_0x1d72('0x36')](_0x5b2c87[_0x1d72('0x31')],_0x5b2c87[_0x1d72('0x33')]);_0x26eec2[_0x1d72('0x37')]=_['intersection'](_0x5b2c87[_0x1d72('0x31')],qs[_0x1d72('0x38')](_0x16031f[_0x1d72('0x33')][_0x1d72('0x38')]));_0x26eec2[_0x1d72('0x37')]=_0x26eec2[_0x1d72('0x37')][_0x1d72('0x39')]?_0x26eec2[_0x1d72('0x37')]:_0x5b2c87['model'];if(!_0x16031f[_0x1d72('0x33')][_0x1d72('0x3a')](_0x1d72('0x3b'))){_0x26eec2[_0x1d72('0x21')]=qs['limit'](_0x16031f[_0x1d72('0x33')][_0x1d72('0x21')]);_0x26eec2['offset']=qs[_0x1d72('0x1e')](_0x16031f['query'][_0x1d72('0x1e')]);}_0x26eec2[_0x1d72('0x3c')]=qs[_0x1d72('0x3d')](_0x16031f[_0x1d72('0x33')][_0x1d72('0x3d')]);_0x26eec2[_0x1d72('0x3e')]=qs['filters'](_[_0x1d72('0x3f')](_0x16031f['query'],_0x5b2c87[_0x1d72('0x35')]),_0x505cd5);if(_0x16031f[_0x1d72('0x33')]['filter']){_0x26eec2[_0x1d72('0x3e')]=_['merge'](_0x26eec2[_0x1d72('0x3e')],{'$or':_[_0x1d72('0x32')](_0x505cd5,function(_0x1cfd37){if(_0x1cfd37[_0x1d72('0x40')]!==_0x1d72('0x41')){var _0x4fdc7f={};_0x4fdc7f[_0x1cfd37['name']]={'$like':'%'+_0x16031f[_0x1d72('0x33')][_0x1d72('0x42')]+'%'};return _0x4fdc7f;}})});}_0x26eec2=_[_0x1d72('0x43')]({},_0x26eec2,_0x16031f[_0x1d72('0x44')]);var _0x2a7030={'where':_0x26eec2[_0x1d72('0x3e')]};return db['SquareRecording'][_0x1d72('0x20')](_0x2a7030)[_0x1d72('0x28')](function(_0x19fee8){_0x24dae7[_0x1d72('0x20')]=_0x19fee8;if(_0x16031f[_0x1d72('0x33')][_0x1d72('0x45')]){_0x26eec2[_0x1d72('0x46')]=[{'all':!![]}];}return db[_0x1d72('0x2f')]['findAll'](_0x26eec2);})[_0x1d72('0x28')](function(_0xb27308){_0x24dae7['rows']=_0xb27308;return _0x24dae7;})['then'](respondWithFilteredResult(_0x48bf4c,_0x26eec2))[_0x1d72('0x47')](handleError(_0x48bf4c,null));};exports[_0x1d72('0x48')]=function(_0x14b858,_0xf9d1d5){var _0xb5d96e={'raw':!![],'where':{'id':_0x14b858['params']['id']}},_0x3d8605={};_0x3d8605['model']=_[_0x1d72('0x34')](db[_0x1d72('0x2f')]['rawAttributes']);_0x3d8605[_0x1d72('0x33')]=_[_0x1d72('0x34')](_0x14b858[_0x1d72('0x33')]);_0x3d8605[_0x1d72('0x35')]=_[_0x1d72('0x36')](_0x3d8605[_0x1d72('0x31')],_0x3d8605[_0x1d72('0x33')]);_0xb5d96e['attributes']=_[_0x1d72('0x36')](_0x3d8605['model'],qs[_0x1d72('0x38')](_0x14b858[_0x1d72('0x33')][_0x1d72('0x38')]));_0xb5d96e['attributes']=_0xb5d96e[_0x1d72('0x37')][_0x1d72('0x39')]?_0xb5d96e[_0x1d72('0x37')]:_0x3d8605[_0x1d72('0x31')];if(_0x14b858[_0x1d72('0x33')]['includeAll']){_0xb5d96e['include']=[{'all':!![]}];}_0xb5d96e=_['merge']({},_0xb5d96e,_0x14b858[_0x1d72('0x44')]);return db[_0x1d72('0x2f')][_0x1d72('0x49')](_0xb5d96e)[_0x1d72('0x28')](handleEntityNotFound(_0xf9d1d5,null))['then'](respondWithResult(_0xf9d1d5,null))[_0x1d72('0x47')](handleError(_0xf9d1d5,null));};exports['create']=function(_0x5ec94e,_0x334f86){return db[_0x1d72('0x2f')]['create'](_0x5ec94e[_0x1d72('0x4a')],{})['then'](respondWithResult(_0x334f86,0xc9))[_0x1d72('0x47')](handleError(_0x334f86,null));};exports[_0x1d72('0x27')]=function(_0x46954e,_0x316295){if(_0x46954e[_0x1d72('0x4a')]['id']){delete _0x46954e['body']['id'];}return db[_0x1d72('0x2f')]['find']({'where':{'id':_0x46954e['params']['id']}})[_0x1d72('0x28')](handleEntityNotFound(_0x316295,null))[_0x1d72('0x28')](saveUpdates(_0x46954e[_0x1d72('0x4a')],null))['then'](respondWithResult(_0x316295,null))[_0x1d72('0x47')](handleError(_0x316295,null));};exports[_0x1d72('0x4b')]=function(_0x536a38,_0x575c42,_0x351a82){var _0x42c5bd=require(_0x1d72('0x4c'));var _0x135d85=![];var _0x1ae31b={};if(_0x536a38[_0x1d72('0x33')][_0x1d72('0x40')]&&_0x536a38[_0x1d72('0x33')]['type']===_0x1d72('0x4d')){_0x1ae31b[_0x1d72('0x4d')]=_0x536a38['params']['id'];}else{_0x1ae31b['id']=_0x536a38['params']['id'];}return db[_0x1d72('0x2f')][_0x1d72('0x49')]({'where':_0x1ae31b,'attributes':['id',_0x1d72('0x4e'),_0x1d72('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x575c42,null))[_0x1d72('0x28')](function(_0x59859e){if(_0x59859e){var _0x77d8aa=_0x59859e['savePath'];var _0x2a20b5=util['format'](_0x1d72('0x50'),_0x77d8aa);if(fs[_0x1d72('0x51')](_0x2a20b5)){_0x135d85=!![];return _0x42c5bd[_0x1d72('0x52')](_0x2a20b5,_0x77d8aa,config['secrets'][_0x1d72('0x53')])[_0x1d72('0x28')](function(){return _0x59859e;});}return _0x59859e;}})[_0x1d72('0x28')](function(_0x51cb72){if(_0x51cb72){var _0x5b5c12=_0x51cb72[_0x1d72('0x4e')];if(!fs[_0x1d72('0x51')](_0x5b5c12)){throw new db[(_0x1d72('0x54'))][(_0x1d72('0x55'))](_0x1d72('0x56'));}if(_0x51cb72[_0x1d72('0x4f')]){return _0x575c42[_0x1d72('0x4b')](_0x5b5c12,_0x51cb72[_0x1d72('0x4f')]+path[_0x1d72('0x57')](_0x5b5c12),function(){if(_0x135d85){fs[_0x1d72('0x58')](_0x5b5c12);}});}else{return _0x575c42['download'](_0x5b5c12,function(_0xa713dd){if(_0x135d85){fs[_0x1d72('0x58')](_0x5b5c12);}});}}})[_0x1d72('0x47')](function(_0x5a57e9){if(_0x5a57e9[_0x1d72('0x59')]==='SquareRecording\x20not\x20found'){_0x575c42[_0x1d72('0x1c')](0x194)['send'](_0x1d72('0x5a'));}else{return handleError(_0x575c42,null);}});};exports[_0x1d72('0x29')]=function(_0x3ab18b,_0x109f9e){return db['SquareRecording'][_0x1d72('0x49')]({'where':{'id':_0x3ab18b['params']['id']}})['then'](function(_0x734040){if(_[_0x1d72('0x5b')](_0x734040)){throw new ReferenceError(_0x1d72('0x5c'));}return _0x734040;})['then'](function(_0x48e569){var _0x33f702=_0x48e569[_0x1d72('0x4e')];logger[_0x1d72('0x5d')]('cancellazione\x20fisica\x20documento\x20%s',_0x33f702);if(!_[_0x1d72('0x5b')](_0x48e569['savePath'])&&fs['existsSync'](_0x33f702)){logger[_0x1d72('0x5d')](_0x1d72('0x5e')+_0x33f702+_0x1d72('0x5f'));fs[_0x1d72('0x60')](_0x33f702);}_0x33f702=_0x33f702+'.cypher';if(!_[_0x1d72('0x5b')](_0x48e569[_0x1d72('0x4e')])&&fs[_0x1d72('0x51')](_0x33f702)){logger[_0x1d72('0x5d')]('File:\x20\x22'+_0x33f702+_0x1d72('0x5f'));fs[_0x1d72('0x60')](_0x33f702);}return _0x48e569;})['then'](function(_0x5f1ab8){if(!_0x5f1ab8)throw new InternalError();return _0x5f1ab8[_0x1d72('0x29')]();})[_0x1d72('0x28')](function(){_0x109f9e[_0x1d72('0x1c')](0xcc)[_0x1d72('0x1b')]();})[_0x1d72('0x47')](handleError(_0x109f9e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c6a6296..d544288 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 _0x8506=['util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3c40e1,_0xdbda65){var _0xdbc79d=function(_0x28cff8){while(--_0x28cff8){_0x3c40e1['push'](_0x3c40e1['shift']());}};_0xdbc79d(++_0xdbda65);}(_0x8506,0xe8));var _0x6850=function(_0x52fc14,_0x4bf24c){_0x52fc14=_0x52fc14-0x0;var _0x1d416b=_0x8506[_0x52fc14];return _0x1d416b;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var logger=require('../../config/logger')(_0x6850('0x1'));var moment=require('moment');var BPromise=require(_0x6850('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6850('0x3'));var rimraf=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var attributes=require('./squareRecording.attributes');module[_0x6850('0x6')]=function(_0x372f0b,_0x232459){return _0x372f0b[_0x6850('0x7')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f25=['bluebird','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x431c07,_0x1f3c46){var _0x12864a=function(_0x3ff772){while(--_0x3ff772){_0x431c07['push'](_0x431c07['shift']());}};_0x12864a(++_0x1f3c46);}(_0x8f25,0x14b));var _0x58f2=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x8f25[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var logger=require(_0x58f2('0x2'))(_0x58f2('0x3'));var moment=require(_0x58f2('0x4'));var BPromise=require(_0x58f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x58f2('0x6'));var attributes=require(_0x58f2('0x7'));module[_0x58f2('0x8')]=function(_0x486395,_0x415a68){return _0x486395[_0x58f2('0x9')](_0x58f2('0xa'),attributes,{'tableName':_0x58f2('0xb'),'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 5de686a..96a18c2 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 _0x655e=['info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareRecording','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x3dc4ec,_0x2479ff){var _0x52cb7e=function(_0x26642f){while(--_0x26642f){_0x3dc4ec['push'](_0x3dc4ec['shift']());}};_0x52cb7e(++_0x2479ff);}(_0x655e,0x126));var _0xe655=function(_0x37e860,_0x3b6612){_0x37e860=_0x37e860-0x0;var _0x4077ed=_0x655e[_0x37e860];return _0x4077ed;};'use strict';var _=require(_0xe655('0x0'));var util=require(_0xe655('0x1'));var moment=require(_0xe655('0x2'));var BPromise=require(_0xe655('0x3'));var rs=require(_0xe655('0x4'));var fs=require('fs');var Redis=require(_0xe655('0x5'));var db=require(_0xe655('0x6'))['db'];var utils=require(_0xe655('0x7'));var logger=require(_0xe655('0x8'))(_0xe655('0x9'));var config=require('../../config/environment');var jayson=require(_0xe655('0xa'));var client=jayson[_0xe655('0xb')][_0xe655('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56929f,_0xe541b8,_0x31a9f0){return new BPromise(function(_0x5227f8,_0x24f441){return client['request'](_0x56929f,_0x31a9f0)[_0xe655('0xd')](function(_0x5b23c0){logger[_0xe655('0xe')](_0xe655('0xf'),_0xe541b8,_0xe655('0x10'));logger['debug'](_0xe655('0x11'),_0xe541b8,_0xe655('0x10'),JSON[_0xe655('0x12')](_0x5b23c0));if(_0x5b23c0[_0xe655('0x13')]){if(_0x5b23c0[_0xe655('0x13')]['code']===0x1f4){logger[_0xe655('0x13')](_0xe655('0xf'),_0xe541b8,_0x5b23c0[_0xe655('0x13')]['message']);return _0x24f441(_0x5b23c0[_0xe655('0x13')][_0xe655('0x14')]);}logger[_0xe655('0x13')]('SquareRecording,\x20%s,\x20%s',_0xe541b8,_0x5b23c0[_0xe655('0x13')][_0xe655('0x14')]);return _0x5227f8(_0x5b23c0[_0xe655('0x13')]['message']);}else{logger[_0xe655('0xe')](_0xe655('0xf'),_0xe541b8,_0xe655('0x10'));_0x5227f8(_0x5b23c0['result'][_0xe655('0x14')]);}})[_0xe655('0x15')](function(_0x1bce1f){logger['error'](_0xe655('0xf'),_0xe541b8,_0x1bce1f);_0x24f441(_0x1bce1f);});});}exports[_0xe655('0x16')]=function(_0x1a0e30){var _0x169467=this;return new Promise(function(_0x1f48c5,_0x1da12b){return db['SquareRecording'][_0xe655('0x17')](_0x1a0e30[_0xe655('0x18')],{'raw':_0x1a0e30[_0xe655('0x19')]?_0x1a0e30[_0xe655('0x19')][_0xe655('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2834fe){logger[_0xe655('0xe')](_0xe655('0x16'),_0x1a0e30);logger[_0xe655('0x1b')]('CreateSquareRecording',_0x1a0e30,JSON[_0xe655('0x12')](_0x2834fe));_0x1f48c5(_0x2834fe);})[_0xe655('0x15')](function(_0x85816d){logger[_0xe655('0x13')]('CreateSquareRecording',_0x85816d[_0xe655('0x14')],_0x1a0e30);_0x1da12b(_0x169467['error'](0x1f4,_0x85816d[_0xe655('0x14')]));});});}; \ No newline at end of file +var _0x2850=['CreateSquareRecording','SquareRecording','create','body','options','raw','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x316ac4,_0xd53942){var _0x88106c=function(_0x8ea683){while(--_0x8ea683){_0x316ac4['push'](_0x316ac4['shift']());}};_0x88106c(++_0xd53942);}(_0x2850,0xc4));var _0x0285=function(_0x45e09b,_0x37cc8d){_0x45e09b=_0x45e09b-0x0;var _0x178707=_0x2850[_0x45e09b];return _0x178707;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0285('0x0'));var BPromise=require(_0x0285('0x1'));var rs=require(_0x0285('0x2'));var fs=require('fs');var Redis=require(_0x0285('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0285('0x4'))(_0x0285('0x5'));var config=require(_0x0285('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0285('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x287106,_0x43ff1c,_0x4a6180){return new BPromise(function(_0x31a0dc,_0x9e10e5){return client[_0x0285('0x8')](_0x287106,_0x4a6180)[_0x0285('0x9')](function(_0x126e1a){logger[_0x0285('0xa')](_0x0285('0xb'),_0x43ff1c,_0x0285('0xc'));logger[_0x0285('0xd')](_0x0285('0xe'),_0x43ff1c,_0x0285('0xc'),JSON[_0x0285('0xf')](_0x126e1a));if(_0x126e1a['error']){if(_0x126e1a['error'][_0x0285('0x10')]===0x1f4){logger['error'](_0x0285('0xb'),_0x43ff1c,_0x126e1a[_0x0285('0x11')]['message']);return _0x9e10e5(_0x126e1a[_0x0285('0x11')][_0x0285('0x12')]);}logger[_0x0285('0x11')](_0x0285('0xb'),_0x43ff1c,_0x126e1a[_0x0285('0x11')][_0x0285('0x12')]);return _0x31a0dc(_0x126e1a[_0x0285('0x11')][_0x0285('0x12')]);}else{logger[_0x0285('0xa')](_0x0285('0xb'),_0x43ff1c,'request\x20sent');_0x31a0dc(_0x126e1a[_0x0285('0x13')][_0x0285('0x12')]);}})['catch'](function(_0x52fba3){logger[_0x0285('0x11')](_0x0285('0xb'),_0x43ff1c,_0x52fba3);_0x9e10e5(_0x52fba3);});});}exports[_0x0285('0x14')]=function(_0x74d5a3){var _0x254812=this;return new Promise(function(_0x55e7ce,_0x3f3ad5){return db[_0x0285('0x15')][_0x0285('0x16')](_0x74d5a3[_0x0285('0x17')],{'raw':_0x74d5a3[_0x0285('0x18')]?_0x74d5a3[_0x0285('0x18')][_0x0285('0x19')]===undefined?!![]:![]:!![]})[_0x0285('0x9')](function(_0x417888){logger[_0x0285('0xa')](_0x0285('0x14'),_0x74d5a3);logger[_0x0285('0xd')](_0x0285('0x14'),_0x74d5a3,JSON[_0x0285('0xf')](_0x417888));_0x55e7ce(_0x417888);})[_0x0285('0x1a')](function(_0xc2e98d){logger['error'](_0x0285('0x14'),_0xc2e98d[_0x0285('0x12')],_0x74d5a3);_0x3f3ad5(_0x254812[_0x0285('0x11')](0x1f4,_0xc2e98d[_0x0285('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 5fce303..00219d1 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1cfe0f,_0x264e1e){var _0x1d140d=function(_0x43a779){while(--_0x43a779){_0x1cfe0f['push'](_0x1cfe0f['shift']());}};_0x1d140d(++_0x264e1e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0x306106,_0x7dc50d){var _0x4d6083=function(_0x2a5b5a){while(--_0x2a5b5a){_0x306106['push'](_0x306106['shift']());}};_0x4d6083(++_0x7dc50d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1fcd535..abdaf70 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 _0x825b=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x3ff795,_0x50100e){var _0xff9fdd=function(_0x2d1cc0){while(--_0x2d1cc0){_0x3ff795['push'](_0x3ff795['shift']());}};_0xff9fdd(++_0x50100e);}(_0x825b,0x10e));var _0xb825=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0x825b[_0x4af01e];return _0x178c11;};'use strict';var Sequelize=require(_0xb825('0x0'));module['exports']={'network':{'type':Sequelize[_0xb825('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb825('0x1')]},'language':{'type':Sequelize[_0xb825('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb825('0x1')]},'version':{'type':Sequelize[_0xb825('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb825('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xb825('0x1')]},'callington':{'type':Sequelize[_0xb825('0x1')]},'callingtns':{'type':Sequelize[_0xb825('0x1')]},'dnid':{'type':Sequelize[_0xb825('0x1')]},'rdnis':{'type':Sequelize[_0xb825('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb825('0x1')]},'priority':{'type':Sequelize[_0xb825('0x1')]},'enhanced':{'type':Sequelize[_0xb825('0x1')]},'accountcode':{'type':Sequelize[_0xb825('0x1')]},'threadid':{'type':Sequelize[_0xb825('0x1')]},'project_name':{'type':Sequelize[_0xb825('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb825('0x2')]},'bot':{'type':Sequelize[_0xb825('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x00a7=['sequelize','exports','STRING','DATE'];(function(_0x374ea4,_0x4acee0){var _0x45887c=function(_0x1fafcf){while(--_0x1fafcf){_0x374ea4['push'](_0x374ea4['shift']());}};_0x45887c(++_0x4acee0);}(_0x00a7,0xf0));var _0x700a=function(_0x4bd17d,_0x4075cf){_0x4bd17d=_0x4bd17d-0x0;var _0x1c95c6=_0x00a7[_0x4bd17d];return _0x1c95c6;};'use strict';var Sequelize=require(_0x700a('0x0'));module[_0x700a('0x1')]={'network':{'type':Sequelize[_0x700a('0x2')]},'network_script':{'type':Sequelize[_0x700a('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x700a('0x2')]},'type':{'type':Sequelize[_0x700a('0x2')]},'uniqueid':{'type':Sequelize[_0x700a('0x2')]},'version':{'type':Sequelize[_0x700a('0x2')]},'callerid':{'type':Sequelize[_0x700a('0x2')]},'calleridname':{'type':Sequelize[_0x700a('0x2')]},'callingpres':{'type':Sequelize[_0x700a('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x700a('0x2')]},'callingtns':{'type':Sequelize[_0x700a('0x2')]},'dnid':{'type':Sequelize[_0x700a('0x2')]},'rdnis':{'type':Sequelize[_0x700a('0x2')]},'context':{'type':Sequelize[_0x700a('0x2')]},'extension':{'type':Sequelize[_0x700a('0x2')]},'priority':{'type':Sequelize[_0x700a('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x700a('0x2')]},'threadid':{'type':Sequelize[_0x700a('0x2')]},'project_name':{'type':Sequelize[_0x700a('0x2')]},'joinAt':{'type':Sequelize[_0x700a('0x3')]},'leaveAt':{'type':Sequelize[_0x700a('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 0fd3315..a6751f1 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 _0x2e65=['then','destroy','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','type','model','query','intersection','attributes','fields','nolimit','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','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','end','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x43b9af,_0x2c8316){var _0x1df62e=function(_0x2b2e79){while(--_0x2b2e79){_0x43b9af['push'](_0x43b9af['shift']());}};_0x1df62e(++_0x2c8316);}(_0x2e65,0xfc));var _0x52e6=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x2e65[_0x1646fa];return _0x5a47a5;};'use strict';var emlformat=require(_0x52e6('0x0'));var rimraf=require(_0x52e6('0x1'));var zipdir=require(_0x52e6('0x2'));var jsonpatch=require(_0x52e6('0x3'));var rp=require(_0x52e6('0x4'));var moment=require(_0x52e6('0x5'));var BPromise=require(_0x52e6('0x6'));var Mustache=require('mustache');var util=require(_0x52e6('0x7'));var path=require('path');var sox=require(_0x52e6('0x8'));var csv=require(_0x52e6('0x9'));var ejs=require(_0x52e6('0xa'));var fs=require('fs');var fs_extra=require(_0x52e6('0xb'));var _=require(_0x52e6('0xc'));var squel=require('squel');var crypto=require(_0x52e6('0xd'));var jsforce=require(_0x52e6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x52e6('0x9'));var querystring=require(_0x52e6('0xf'));var Papa=require('papaparse');var Redis=require(_0x52e6('0x10'));var authService=require(_0x52e6('0x11'));var qs=require(_0x52e6('0x12'));var as=require(_0x52e6('0x13'));var hardwareService=require(_0x52e6('0x14'));var logger=require(_0x52e6('0x15'))(_0x52e6('0x16'));var utils=require(_0x52e6('0x17'));var config=require(_0x52e6('0x18'));var licenseUtil=require(_0x52e6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42e18f,_0x19bb76){_0x19bb76=_0x19bb76||0xcc;return function(_0x44298e){if(_0x44298e){return _0x42e18f['sendStatus'](_0x19bb76);}return _0x42e18f['status'](_0x19bb76)[_0x52e6('0x1a')]();};}function respondWithResult(_0x20d7b5,_0x1ade52){_0x1ade52=_0x1ade52||0xc8;return function(_0x414bca){if(_0x414bca){return _0x20d7b5[_0x52e6('0x1b')](_0x1ade52)[_0x52e6('0x1c')](_0x414bca);}};}function respondWithFilteredResult(_0x5ba7df,_0x2759bd){return function(_0x29051f){if(_0x29051f){var _0x1cf13d=typeof _0x2759bd[_0x52e6('0x1d')]===_0x52e6('0x1e')&&typeof _0x2759bd[_0x52e6('0x1f')]===_0x52e6('0x1e');var _0x120d92=_0x29051f['count'];var _0x2512b1=_0x1cf13d?0x0:_0x2759bd[_0x52e6('0x1d')];var _0x492174=_0x1cf13d?_0x29051f[_0x52e6('0x20')]:_0x2759bd[_0x52e6('0x1d')]+_0x2759bd[_0x52e6('0x1f')];var _0x81d7aa;if(_0x492174>=_0x120d92){_0x492174=_0x120d92;_0x81d7aa=0xc8;}else{_0x81d7aa=0xce;}_0x5ba7df[_0x52e6('0x1b')](_0x81d7aa);return _0x5ba7df[_0x52e6('0x21')](_0x52e6('0x22'),_0x2512b1+'-'+_0x492174+'/'+_0x120d92)[_0x52e6('0x1c')](_0x29051f);}return null;};}function patchUpdates(_0x53bbbe){return function(_0xd7c6b3){try{jsonpatch['apply'](_0xd7c6b3,_0x53bbbe,!![]);}catch(_0x5b3cfd){return BPromise[_0x52e6('0x23')](_0x5b3cfd);}return _0xd7c6b3['save']();};}function saveUpdates(_0x2d9aa7,_0x744287){return function(_0x24b5d9){if(_0x24b5d9){return _0x24b5d9['update'](_0x2d9aa7)[_0x52e6('0x24')](function(_0x366d1c){return _0x366d1c;});}return null;};}function removeEntity(_0x1feaad,_0x744ff5){return function(_0x56108d){if(_0x56108d){return _0x56108d[_0x52e6('0x25')]()['then'](function(){_0x1feaad[_0x52e6('0x1b')](0xcc)[_0x52e6('0x1a')]();});}};}function handleEntityNotFound(_0x301076,_0x44c916){return function(_0x1a3559){if(!_0x1a3559){_0x301076[_0x52e6('0x26')](0x194);}return _0x1a3559;};}function handleError(_0x5d0410,_0x31f361){_0x31f361=_0x31f361||0x1f4;return function(_0x39e0e3){logger[_0x52e6('0x27')](_0x39e0e3[_0x52e6('0x28')]);if(_0x39e0e3[_0x52e6('0x29')]){delete _0x39e0e3['name'];}_0x5d0410['status'](_0x31f361)[_0x52e6('0x2a')](_0x39e0e3);};}exports[_0x52e6('0x2b')]=function(_0x45a334,_0x5ee092){var _0x17abed={},_0x1a974d={},_0x3d4494={'count':0x0,'rows':[]};var _0x212c00=_['map'](db[_0x52e6('0x2c')][_0x52e6('0x2d')],function(_0x3c2f26){return{'name':_0x3c2f26['fieldName'],'type':_0x3c2f26[_0x52e6('0x2e')]['key']};});_0x1a974d[_0x52e6('0x2f')]=_['map'](_0x212c00,_0x52e6('0x29'));_0x1a974d[_0x52e6('0x30')]=_['keys'](_0x45a334[_0x52e6('0x30')]);_0x1a974d['filters']=_[_0x52e6('0x31')](_0x1a974d[_0x52e6('0x2f')],_0x1a974d[_0x52e6('0x30')]);_0x17abed[_0x52e6('0x32')]=_[_0x52e6('0x31')](_0x1a974d[_0x52e6('0x2f')],qs[_0x52e6('0x33')](_0x45a334[_0x52e6('0x30')][_0x52e6('0x33')]));_0x17abed[_0x52e6('0x32')]=_0x17abed[_0x52e6('0x32')]['length']?_0x17abed[_0x52e6('0x32')]:_0x1a974d['model'];if(!_0x45a334['query']['hasOwnProperty'](_0x52e6('0x34'))){_0x17abed[_0x52e6('0x1f')]=qs[_0x52e6('0x1f')](_0x45a334['query'][_0x52e6('0x1f')]);_0x17abed['offset']=qs[_0x52e6('0x1d')](_0x45a334[_0x52e6('0x30')]['offset']);}_0x17abed['order']=qs['sort'](_0x45a334[_0x52e6('0x30')]['sort']);_0x17abed['where']=qs['filters'](_[_0x52e6('0x35')](_0x45a334['query'],_0x1a974d['filters']),_0x212c00);if(_0x45a334[_0x52e6('0x30')][_0x52e6('0x36')]){_0x17abed[_0x52e6('0x37')]=_[_0x52e6('0x38')](_0x17abed[_0x52e6('0x37')],{'$or':_[_0x52e6('0x39')](_0x212c00,function(_0xa23609){if(_0xa23609[_0x52e6('0x2e')]!==_0x52e6('0x3a')){var _0x52e700={};_0x52e700[_0xa23609['name']]={'$like':'%'+_0x45a334[_0x52e6('0x30')][_0x52e6('0x36')]+'%'};return _0x52e700;}})});}_0x17abed=_[_0x52e6('0x38')]({},_0x17abed,_0x45a334[_0x52e6('0x3b')]);var _0x486674={'where':_0x17abed[_0x52e6('0x37')]};return db[_0x52e6('0x2c')]['count'](_0x486674)['then'](function(_0x5dbaf3){_0x3d4494[_0x52e6('0x20')]=_0x5dbaf3;if(_0x45a334[_0x52e6('0x30')][_0x52e6('0x3c')]){_0x17abed[_0x52e6('0x3d')]=[{'all':!![]}];}return db[_0x52e6('0x2c')]['findAll'](_0x17abed);})[_0x52e6('0x24')](function(_0x466091){_0x3d4494[_0x52e6('0x3e')]=_0x466091;return _0x3d4494;})[_0x52e6('0x24')](respondWithFilteredResult(_0x5ee092,_0x17abed))[_0x52e6('0x3f')](handleError(_0x5ee092,null));};exports[_0x52e6('0x40')]=function(_0x5adedc,_0x305b6c){var _0x29dafd={'raw':!![],'where':{'id':_0x5adedc[_0x52e6('0x41')]['id']}},_0x556747={};_0x556747[_0x52e6('0x2f')]=_[_0x52e6('0x42')](db[_0x52e6('0x2c')]['rawAttributes']);_0x556747['query']=_[_0x52e6('0x42')](_0x5adedc[_0x52e6('0x30')]);_0x556747['filters']=_[_0x52e6('0x31')](_0x556747['model'],_0x556747[_0x52e6('0x30')]);_0x29dafd[_0x52e6('0x32')]=_[_0x52e6('0x31')](_0x556747['model'],qs['fields'](_0x5adedc['query'][_0x52e6('0x33')]));_0x29dafd[_0x52e6('0x32')]=_0x29dafd[_0x52e6('0x32')][_0x52e6('0x43')]?_0x29dafd[_0x52e6('0x32')]:_0x556747[_0x52e6('0x2f')];if(_0x5adedc[_0x52e6('0x30')][_0x52e6('0x3c')]){_0x29dafd[_0x52e6('0x3d')]=[{'all':!![]}];}_0x29dafd=_[_0x52e6('0x38')]({},_0x29dafd,_0x5adedc[_0x52e6('0x3b')]);return db[_0x52e6('0x2c')][_0x52e6('0x44')](_0x29dafd)['then'](handleEntityNotFound(_0x305b6c,null))[_0x52e6('0x24')](respondWithResult(_0x305b6c,null))[_0x52e6('0x3f')](handleError(_0x305b6c,null));};exports[_0x52e6('0x45')]=function(_0x5092,_0xc25bf){return db[_0x52e6('0x2c')][_0x52e6('0x45')](_0x5092[_0x52e6('0x46')],{})[_0x52e6('0x24')](respondWithResult(_0xc25bf,0xc9))['catch'](handleError(_0xc25bf,null));};exports['update']=function(_0x5a25a6,_0x54e998){if(_0x5a25a6['body']['id']){delete _0x5a25a6[_0x52e6('0x46')]['id'];}return db[_0x52e6('0x2c')][_0x52e6('0x44')]({'where':{'id':_0x5a25a6[_0x52e6('0x41')]['id']}})[_0x52e6('0x24')](handleEntityNotFound(_0x54e998,null))[_0x52e6('0x24')](saveUpdates(_0x5a25a6[_0x52e6('0x46')],null))[_0x52e6('0x24')](respondWithResult(_0x54e998,null))[_0x52e6('0x3f')](handleError(_0x54e998,null));};exports[_0x52e6('0x25')]=function(_0x24282b,_0x26d47b){return db[_0x52e6('0x2c')]['find']({'where':{'id':_0x24282b['params']['id']}})[_0x52e6('0x24')](handleEntityNotFound(_0x26d47b,null))[_0x52e6('0x24')](removeEntity(_0x26d47b,null))[_0x52e6('0x3f')](handleError(_0x26d47b,null));};exports[_0x52e6('0x47')]=function(_0x543e38,_0x138228){return db['SquareReport'][_0x52e6('0x47')]()[_0x52e6('0x24')](respondWithResult(_0x138228,null))['catch'](handleError(_0x138228,null));}; \ No newline at end of file +var _0xa6a1=['find','body','catch','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','end','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','fields','includeAll','include'];(function(_0x1aab89,_0x40e92d){var _0x192afe=function(_0x34ff86){while(--_0x34ff86){_0x1aab89['push'](_0x1aab89['shift']());}};_0x192afe(++_0x40e92d);}(_0xa6a1,0x115));var _0x1a6a=function(_0x3ac70,_0x3f2d0d){_0x3ac70=_0x3ac70-0x0;var _0x2aeb28=_0xa6a1[_0x3ac70];return _0x2aeb28;};'use strict';var emlformat=require(_0x1a6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a6a('0x1'));var jsonpatch=require(_0x1a6a('0x2'));var rp=require('request-promise');var moment=require(_0x1a6a('0x3'));var BPromise=require(_0x1a6a('0x4'));var Mustache=require(_0x1a6a('0x5'));var util=require(_0x1a6a('0x6'));var path=require(_0x1a6a('0x7'));var sox=require(_0x1a6a('0x8'));var csv=require(_0x1a6a('0x9'));var ejs=require(_0x1a6a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a6a('0xb'));var crypto=require(_0x1a6a('0xc'));var jsforce=require(_0x1a6a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a6a('0x9'));var querystring=require(_0x1a6a('0xe'));var Papa=require(_0x1a6a('0xf'));var Redis=require(_0x1a6a('0x10'));var authService=require(_0x1a6a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a6a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1a6a('0x13'));var config=require(_0x1a6a('0x14'));var licenseUtil=require(_0x1a6a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3add71,_0x5e6d2b){_0x5e6d2b=_0x5e6d2b||0xcc;return function(_0x23e820){if(_0x23e820){return _0x3add71[_0x1a6a('0x16')](_0x5e6d2b);}return _0x3add71[_0x1a6a('0x17')](_0x5e6d2b)['end']();};}function respondWithResult(_0x16d17d,_0x2914ae){_0x2914ae=_0x2914ae||0xc8;return function(_0x4d5d6c){if(_0x4d5d6c){return _0x16d17d[_0x1a6a('0x17')](_0x2914ae)[_0x1a6a('0x18')](_0x4d5d6c);}};}function respondWithFilteredResult(_0x23d649,_0x228143){return function(_0x17d868){if(_0x17d868){var _0x4ef09c=typeof _0x228143[_0x1a6a('0x19')]==='undefined'&&typeof _0x228143[_0x1a6a('0x1a')]==='undefined';var _0x4bf5c1=_0x17d868[_0x1a6a('0x1b')];var _0x66db10=_0x4ef09c?0x0:_0x228143['offset'];var _0x583815=_0x4ef09c?_0x17d868[_0x1a6a('0x1b')]:_0x228143[_0x1a6a('0x19')]+_0x228143[_0x1a6a('0x1a')];var _0x5b7ac0;if(_0x583815>=_0x4bf5c1){_0x583815=_0x4bf5c1;_0x5b7ac0=0xc8;}else{_0x5b7ac0=0xce;}_0x23d649[_0x1a6a('0x17')](_0x5b7ac0);return _0x23d649[_0x1a6a('0x1c')](_0x1a6a('0x1d'),_0x66db10+'-'+_0x583815+'/'+_0x4bf5c1)[_0x1a6a('0x18')](_0x17d868);}return null;};}function patchUpdates(_0x56feb1){return function(_0x5af6a9){try{jsonpatch['apply'](_0x5af6a9,_0x56feb1,!![]);}catch(_0x36bc70){return BPromise[_0x1a6a('0x1e')](_0x36bc70);}return _0x5af6a9['save']();};}function saveUpdates(_0x299d22,_0xdbca3a){return function(_0x5c33e5){if(_0x5c33e5){return _0x5c33e5[_0x1a6a('0x1f')](_0x299d22)[_0x1a6a('0x20')](function(_0x2a3660){return _0x2a3660;});}return null;};}function removeEntity(_0x2b344f,_0x32d269){return function(_0x16435b){if(_0x16435b){return _0x16435b[_0x1a6a('0x21')]()[_0x1a6a('0x20')](function(){_0x2b344f['status'](0xcc)[_0x1a6a('0x22')]();});}};}function handleEntityNotFound(_0x4bb14b,_0x1057b4){return function(_0x352483){if(!_0x352483){_0x4bb14b['sendStatus'](0x194);}return _0x352483;};}function handleError(_0xe78108,_0x1be301){_0x1be301=_0x1be301||0x1f4;return function(_0x1d8964){logger['error'](_0x1d8964[_0x1a6a('0x23')]);if(_0x1d8964[_0x1a6a('0x24')]){delete _0x1d8964['name'];}_0xe78108[_0x1a6a('0x17')](_0x1be301)[_0x1a6a('0x25')](_0x1d8964);};}exports[_0x1a6a('0x26')]=function(_0xf42663,_0x1060f1){var _0x3497c9={},_0x1c59bd={},_0x4f4849={'count':0x0,'rows':[]};var _0x3bda64=_[_0x1a6a('0x27')](db[_0x1a6a('0x28')][_0x1a6a('0x29')],function(_0x1c6cc9){return{'name':_0x1c6cc9[_0x1a6a('0x2a')],'type':_0x1c6cc9['type'][_0x1a6a('0x2b')]};});_0x1c59bd[_0x1a6a('0x2c')]=_[_0x1a6a('0x27')](_0x3bda64,_0x1a6a('0x24'));_0x1c59bd[_0x1a6a('0x2d')]=_[_0x1a6a('0x2e')](_0xf42663[_0x1a6a('0x2d')]);_0x1c59bd['filters']=_[_0x1a6a('0x2f')](_0x1c59bd[_0x1a6a('0x2c')],_0x1c59bd[_0x1a6a('0x2d')]);_0x3497c9[_0x1a6a('0x30')]=_[_0x1a6a('0x2f')](_0x1c59bd[_0x1a6a('0x2c')],qs['fields'](_0xf42663[_0x1a6a('0x2d')]['fields']));_0x3497c9[_0x1a6a('0x30')]=_0x3497c9[_0x1a6a('0x30')][_0x1a6a('0x31')]?_0x3497c9[_0x1a6a('0x30')]:_0x1c59bd['model'];if(!_0xf42663[_0x1a6a('0x2d')]['hasOwnProperty'](_0x1a6a('0x32'))){_0x3497c9[_0x1a6a('0x1a')]=qs[_0x1a6a('0x1a')](_0xf42663[_0x1a6a('0x2d')][_0x1a6a('0x1a')]);_0x3497c9[_0x1a6a('0x19')]=qs[_0x1a6a('0x19')](_0xf42663[_0x1a6a('0x2d')][_0x1a6a('0x19')]);}_0x3497c9[_0x1a6a('0x33')]=qs[_0x1a6a('0x34')](_0xf42663[_0x1a6a('0x2d')][_0x1a6a('0x34')]);_0x3497c9[_0x1a6a('0x35')]=qs[_0x1a6a('0x36')](_['pick'](_0xf42663[_0x1a6a('0x2d')],_0x1c59bd[_0x1a6a('0x36')]),_0x3bda64);if(_0xf42663[_0x1a6a('0x2d')][_0x1a6a('0x37')]){_0x3497c9['where']=_[_0x1a6a('0x38')](_0x3497c9['where'],{'$or':_[_0x1a6a('0x27')](_0x3bda64,function(_0x1a7544){if(_0x1a7544['type']!==_0x1a6a('0x39')){var _0x2314b0={};_0x2314b0[_0x1a7544['name']]={'$like':'%'+_0xf42663[_0x1a6a('0x2d')][_0x1a6a('0x37')]+'%'};return _0x2314b0;}})});}_0x3497c9=_[_0x1a6a('0x38')]({},_0x3497c9,_0xf42663[_0x1a6a('0x3a')]);var _0x3207ab={'where':_0x3497c9[_0x1a6a('0x35')]};return db['SquareReport'][_0x1a6a('0x1b')](_0x3207ab)[_0x1a6a('0x20')](function(_0x27219a){_0x4f4849[_0x1a6a('0x1b')]=_0x27219a;if(_0xf42663[_0x1a6a('0x2d')]['includeAll']){_0x3497c9['include']=[{'all':!![]}];}return db['SquareReport'][_0x1a6a('0x3b')](_0x3497c9);})[_0x1a6a('0x20')](function(_0x40f0a3){_0x4f4849['rows']=_0x40f0a3;return _0x4f4849;})[_0x1a6a('0x20')](respondWithFilteredResult(_0x1060f1,_0x3497c9))['catch'](handleError(_0x1060f1,null));};exports['show']=function(_0x30a0c3,_0x48ed3f){var _0x415943={'raw':!![],'where':{'id':_0x30a0c3['params']['id']}},_0x300c9b={};_0x300c9b[_0x1a6a('0x2c')]=_[_0x1a6a('0x2e')](db[_0x1a6a('0x28')][_0x1a6a('0x29')]);_0x300c9b[_0x1a6a('0x2d')]=_[_0x1a6a('0x2e')](_0x30a0c3['query']);_0x300c9b['filters']=_['intersection'](_0x300c9b[_0x1a6a('0x2c')],_0x300c9b[_0x1a6a('0x2d')]);_0x415943['attributes']=_['intersection'](_0x300c9b[_0x1a6a('0x2c')],qs[_0x1a6a('0x3c')](_0x30a0c3['query'][_0x1a6a('0x3c')]));_0x415943[_0x1a6a('0x30')]=_0x415943['attributes'][_0x1a6a('0x31')]?_0x415943['attributes']:_0x300c9b[_0x1a6a('0x2c')];if(_0x30a0c3['query'][_0x1a6a('0x3d')]){_0x415943[_0x1a6a('0x3e')]=[{'all':!![]}];}_0x415943=_[_0x1a6a('0x38')]({},_0x415943,_0x30a0c3[_0x1a6a('0x3a')]);return db[_0x1a6a('0x28')][_0x1a6a('0x3f')](_0x415943)[_0x1a6a('0x20')](handleEntityNotFound(_0x48ed3f,null))[_0x1a6a('0x20')](respondWithResult(_0x48ed3f,null))['catch'](handleError(_0x48ed3f,null));};exports['create']=function(_0x275041,_0x1a7344){return db['SquareReport']['create'](_0x275041[_0x1a6a('0x40')],{})['then'](respondWithResult(_0x1a7344,0xc9))[_0x1a6a('0x41')](handleError(_0x1a7344,null));};exports[_0x1a6a('0x1f')]=function(_0x106cf6,_0x3c0ebb){if(_0x106cf6['body']['id']){delete _0x106cf6['body']['id'];}return db[_0x1a6a('0x28')][_0x1a6a('0x3f')]({'where':{'id':_0x106cf6[_0x1a6a('0x42')]['id']}})[_0x1a6a('0x20')](handleEntityNotFound(_0x3c0ebb,null))[_0x1a6a('0x20')](saveUpdates(_0x106cf6['body'],null))['then'](respondWithResult(_0x3c0ebb,null))[_0x1a6a('0x41')](handleError(_0x3c0ebb,null));};exports[_0x1a6a('0x21')]=function(_0x43f834,_0x692577){return db[_0x1a6a('0x28')]['find']({'where':{'id':_0x43f834[_0x1a6a('0x42')]['id']}})['then'](handleEntityNotFound(_0x692577,null))[_0x1a6a('0x20')](removeEntity(_0x692577,null))[_0x1a6a('0x41')](handleError(_0x692577,null));};exports[_0x1a6a('0x43')]=function(_0x3eae45,_0x447054){return db[_0x1a6a('0x28')][_0x1a6a('0x43')]()[_0x1a6a('0x20')](respondWithResult(_0x447054,null))[_0x1a6a('0x41')](handleError(_0x447054,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index d3a7c14..c7f66a8 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 _0x5e67=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','report_square','uniqueid','project_name','leaveAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5e67,0x70));var _0x75e6=function(_0x5a64fc,_0x2baaa5){_0x5a64fc=_0x5a64fc-0x0;var _0xe73019=_0x5e67[_0x5a64fc];return _0xe73019;};'use strict';var _=require(_0x75e6('0x0'));var util=require(_0x75e6('0x1'));var logger=require(_0x75e6('0x2'))(_0x75e6('0x3'));var moment=require(_0x75e6('0x4'));var BPromise=require(_0x75e6('0x5'));var rp=require(_0x75e6('0x6'));var fs=require('fs');var path=require(_0x75e6('0x7'));var rimraf=require(_0x75e6('0x8'));var config=require(_0x75e6('0x9'));var attributes=require(_0x75e6('0xa'));module[_0x75e6('0xb')]=function(_0x4d23fc,_0x47d757){return _0x4d23fc['define']('SquareReport',attributes,{'tableName':_0x75e6('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x75e6('0xd'),_0x75e6('0xe')]},{'name':_0x75e6('0xf'),'fields':[_0x75e6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x777e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','lodash'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x777e,0x1df));var _0xe777=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x777e[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0xe777('0x0'));var util=require(_0xe777('0x1'));var logger=require(_0xe777('0x2'))(_0xe777('0x3'));var moment=require(_0xe777('0x4'));var BPromise=require(_0xe777('0x5'));var rp=require(_0xe777('0x6'));var fs=require('fs');var path=require(_0xe777('0x7'));var rimraf=require('rimraf');var config=require(_0xe777('0x8'));var attributes=require(_0xe777('0x9'));module['exports']=function(_0xb29184,_0x52f23b){return _0xb29184[_0xe777('0xa')](_0xe777('0xb'),attributes,{'tableName':_0xe777('0xc'),'paranoid':![],'indexes':[{'name':_0xe777('0xd'),'fields':[_0xe777('0xe'),_0xe777('0xf')]},{'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 e65d318..e7a638b 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 _0xbf97=['../../config/utils','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareReport','create','body','options','raw','then','catch','UpdateSquareReport','where','limit','debug','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbf97,0x100));var _0x7bf9=function(_0x1db5a1,_0xfdcf89){_0x1db5a1=_0x1db5a1-0x0;var _0x1d4f6e=_0xbf97[_0x1db5a1];return _0x1d4f6e;};'use strict';var _=require(_0x7bf9('0x0'));var util=require('util');var moment=require(_0x7bf9('0x1'));var BPromise=require(_0x7bf9('0x2'));var rs=require(_0x7bf9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bf9('0x4'))['db'];var utils=require(_0x7bf9('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7bf9('0x6'));var client=jayson[_0x7bf9('0x7')][_0x7bf9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a6838,_0x5af27a,_0x48e4ab){return new BPromise(function(_0x28c50,_0x28a5c6){return client[_0x7bf9('0x9')](_0x5a6838,_0x48e4ab)['then'](function(_0x2368a8){logger[_0x7bf9('0xa')](_0x7bf9('0xb'),_0x5af27a,_0x7bf9('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x5af27a,'request\x20sent',JSON[_0x7bf9('0xd')](_0x2368a8));if(_0x2368a8['error']){if(_0x2368a8[_0x7bf9('0xe')][_0x7bf9('0xf')]===0x1f4){logger[_0x7bf9('0xe')](_0x7bf9('0xb'),_0x5af27a,_0x2368a8[_0x7bf9('0xe')][_0x7bf9('0x10')]);return _0x28a5c6(_0x2368a8[_0x7bf9('0xe')][_0x7bf9('0x10')]);}logger['error'](_0x7bf9('0xb'),_0x5af27a,_0x2368a8['error']['message']);return _0x28c50(_0x2368a8[_0x7bf9('0xe')][_0x7bf9('0x10')]);}else{logger[_0x7bf9('0xa')]('SquareReport,\x20%s,\x20%s',_0x5af27a,_0x7bf9('0xc'));_0x28c50(_0x2368a8[_0x7bf9('0x11')][_0x7bf9('0x10')]);}})['catch'](function(_0x475dd8){logger[_0x7bf9('0xe')](_0x7bf9('0xb'),_0x5af27a,_0x475dd8);_0x28a5c6(_0x475dd8);});});}exports[_0x7bf9('0x12')]=function(_0x2db462){var _0x4d7c33=this;return new Promise(function(_0x517aea,_0x2cd5a4){return db['SquareReport'][_0x7bf9('0x13')](_0x2db462[_0x7bf9('0x14')],{'raw':_0x2db462['options']?_0x2db462[_0x7bf9('0x15')][_0x7bf9('0x16')]===undefined?!![]:![]:!![]})[_0x7bf9('0x17')](function(_0x1836d1){logger[_0x7bf9('0xa')]('CreateSquareReport',_0x2db462);logger['debug'](_0x7bf9('0x12'),_0x2db462,JSON[_0x7bf9('0xd')](_0x1836d1));_0x517aea(_0x1836d1);})[_0x7bf9('0x18')](function(_0x13197f){logger['error']('CreateSquareReport',_0x13197f['message'],_0x2db462);_0x2cd5a4(_0x4d7c33[_0x7bf9('0xe')](0x1f4,_0x13197f[_0x7bf9('0x10')]));});});};exports[_0x7bf9('0x19')]=function(_0x4cd4b1){var _0x3d1983=this;return new Promise(function(_0x317946,_0x181259){return db['SquareReport']['update'](_0x4cd4b1[_0x7bf9('0x14')],{'raw':_0x4cd4b1[_0x7bf9('0x15')]?_0x4cd4b1[_0x7bf9('0x15')][_0x7bf9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd4b1[_0x7bf9('0x15')]?_0x4cd4b1[_0x7bf9('0x15')][_0x7bf9('0x1a')]||null:null,'attributes':_0x4cd4b1[_0x7bf9('0x15')]?_0x4cd4b1['options']['attributes']||null:null,'limit':_0x4cd4b1[_0x7bf9('0x15')]?_0x4cd4b1[_0x7bf9('0x15')][_0x7bf9('0x1b')]||null:null})[_0x7bf9('0x17')](function(_0x41a5fe){logger['info']('UpdateSquareReport',_0x4cd4b1);logger[_0x7bf9('0x1c')]('UpdateSquareReport',_0x4cd4b1,JSON['stringify'](_0x41a5fe));_0x317946(_0x41a5fe);})[_0x7bf9('0x18')](function(_0x517dfb){logger[_0x7bf9('0xe')](_0x7bf9('0x19'),_0x517dfb[_0x7bf9('0x10')],_0x4cd4b1);_0x181259(_0x3d1983['error'](0x1f4,_0x517dfb[_0x7bf9('0x10')]));});});}; \ No newline at end of file +var _0x26a7=['jayson/promise','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','body','options','UpdateSquareReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5536b0,_0x5d5846){var _0xf9e16f=function(_0x546622){while(--_0x546622){_0x5536b0['push'](_0x5536b0['shift']());}};_0xf9e16f(++_0x5d5846);}(_0x26a7,0xe6));var _0x726a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x26a7[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x726a('0x0'));var util=require(_0x726a('0x1'));var moment=require(_0x726a('0x2'));var BPromise=require(_0x726a('0x3'));var rs=require(_0x726a('0x4'));var fs=require('fs');var Redis=require(_0x726a('0x5'));var db=require(_0x726a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x726a('0x7'))(_0x726a('0x8'));var config=require(_0x726a('0x9'));var jayson=require(_0x726a('0xa'));var client=jayson['client'][_0x726a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10209d,_0x4d8813,_0xda7340){return new BPromise(function(_0x5611da,_0x4a5887){return client[_0x726a('0xc')](_0x10209d,_0xda7340)[_0x726a('0xd')](function(_0x41f9cd){logger[_0x726a('0xe')]('SquareReport,\x20%s,\x20%s',_0x4d8813,_0x726a('0xf'));logger[_0x726a('0x10')](_0x726a('0x11'),_0x4d8813,'request\x20sent',JSON[_0x726a('0x12')](_0x41f9cd));if(_0x41f9cd['error']){if(_0x41f9cd['error']['code']===0x1f4){logger[_0x726a('0x13')](_0x726a('0x14'),_0x4d8813,_0x41f9cd[_0x726a('0x13')]['message']);return _0x4a5887(_0x41f9cd[_0x726a('0x13')][_0x726a('0x15')]);}logger[_0x726a('0x13')](_0x726a('0x14'),_0x4d8813,_0x41f9cd['error'][_0x726a('0x15')]);return _0x5611da(_0x41f9cd[_0x726a('0x13')][_0x726a('0x15')]);}else{logger[_0x726a('0xe')](_0x726a('0x14'),_0x4d8813,'request\x20sent');_0x5611da(_0x41f9cd[_0x726a('0x16')][_0x726a('0x15')]);}})[_0x726a('0x17')](function(_0x55981f){logger[_0x726a('0x13')](_0x726a('0x14'),_0x4d8813,_0x55981f);_0x4a5887(_0x55981f);});});}exports[_0x726a('0x18')]=function(_0x5c5ebb){var _0xe1dcce=this;return new Promise(function(_0x3decce,_0x17454a){return db['SquareReport']['create'](_0x5c5ebb[_0x726a('0x19')],{'raw':_0x5c5ebb[_0x726a('0x1a')]?_0x5c5ebb['options']['raw']===undefined?!![]:![]:!![]})[_0x726a('0xd')](function(_0xe1bac0){logger[_0x726a('0xe')](_0x726a('0x18'),_0x5c5ebb);logger[_0x726a('0x10')](_0x726a('0x18'),_0x5c5ebb,JSON[_0x726a('0x12')](_0xe1bac0));_0x3decce(_0xe1bac0);})[_0x726a('0x17')](function(_0x547827){logger['error']('CreateSquareReport',_0x547827[_0x726a('0x15')],_0x5c5ebb);_0x17454a(_0xe1dcce['error'](0x1f4,_0x547827['message']));});});};exports[_0x726a('0x1b')]=function(_0x537a7f){var _0x50d242=this;return new Promise(function(_0x3e3a6a,_0x13bb1e){return db['SquareReport'][_0x726a('0x1c')](_0x537a7f[_0x726a('0x19')],{'raw':_0x537a7f['options']?_0x537a7f[_0x726a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537a7f[_0x726a('0x1a')]?_0x537a7f[_0x726a('0x1a')]['where']||null:null,'attributes':_0x537a7f[_0x726a('0x1a')]?_0x537a7f[_0x726a('0x1a')][_0x726a('0x1d')]||null:null,'limit':_0x537a7f['options']?_0x537a7f[_0x726a('0x1a')]['limit']||null:null})['then'](function(_0x38843c){logger[_0x726a('0xe')](_0x726a('0x1b'),_0x537a7f);logger[_0x726a('0x10')]('UpdateSquareReport',_0x537a7f,JSON[_0x726a('0x12')](_0x38843c));_0x3e3a6a(_0x38843c);})[_0x726a('0x17')](function(_0x379a9f){logger[_0x726a('0x13')](_0x726a('0x1b'),_0x379a9f['message'],_0x537a7f);_0x13bb1e(_0x50d242[_0x726a('0x13')](0x1f4,_0x379a9f[_0x726a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 302c1dc..676a82c 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 _0xcddc=['Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xcddc,0x8e));var _0xccdd=function(_0x1e6e27,_0x58222){_0x1e6e27=_0x1e6e27-0x0;var _0x41a31a=_0xcddc[_0x1e6e27];return _0x41a31a;};'use strict';var multer=require(_0xccdd('0x0'));var util=require(_0xccdd('0x1'));var path=require(_0xccdd('0x2'));var timeout=require(_0xccdd('0x3'));var express=require(_0xccdd('0x4'));var router=express[_0xccdd('0x5')]();var fs_extra=require(_0xccdd('0x6'));var auth=require(_0xccdd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xccdd('0x8'));var controller=require(_0xccdd('0x9'));router[_0xccdd('0xa')]('/',auth['isAuthenticated'](),controller[_0xccdd('0xb')]);router[_0xccdd('0xa')](_0xccdd('0xc'),auth[_0xccdd('0xd')](),controller['describe']);router[_0xccdd('0xa')](_0xccdd('0xe'),auth[_0xccdd('0xd')](),controller[_0xccdd('0xf')]);router[_0xccdd('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xccdd('0x11')]('/:id',auth[_0xccdd('0xd')](),controller[_0xccdd('0x12')]);router[_0xccdd('0x13')](_0xccdd('0xe'),auth[_0xccdd('0xd')](),controller[_0xccdd('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbfd3=['post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0xbfd3,0x6a));var _0x3bfd=function(_0x321691,_0xebc6ea){_0x321691=_0x321691-0x0;var _0x545094=_0xbfd3[_0x321691];return _0x545094;};'use strict';var multer=require(_0x3bfd('0x0'));var util=require('util');var path=require(_0x3bfd('0x1'));var timeout=require(_0x3bfd('0x2'));var express=require(_0x3bfd('0x3'));var router=express['Router']();var fs_extra=require(_0x3bfd('0x4'));var auth=require(_0x3bfd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3bfd('0x6'));var controller=require(_0x3bfd('0x7'));router[_0x3bfd('0x8')]('/',auth[_0x3bfd('0x9')](),controller[_0x3bfd('0xa')]);router[_0x3bfd('0x8')]('/describe',auth[_0x3bfd('0x9')](),controller[_0x3bfd('0xb')]);router[_0x3bfd('0x8')](_0x3bfd('0xc'),auth[_0x3bfd('0x9')](),controller[_0x3bfd('0xd')]);router[_0x3bfd('0xe')]('/',auth[_0x3bfd('0x9')](),controller[_0x3bfd('0xf')]);router['put'](_0x3bfd('0xc'),auth[_0x3bfd('0x9')](),controller[_0x3bfd('0x10')]);router[_0x3bfd('0x11')](_0x3bfd('0xc'),auth[_0x3bfd('0x9')](),controller[_0x3bfd('0x12')]);module[_0x3bfd('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ca37945..7b791f9 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 _0x1e90=['exports','STRING','TEXT','sequelize'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1e90,0x103));var _0x01e9=function(_0x1e7f5e,_0x1402ee){_0x1e7f5e=_0x1e7f5e-0x0;var _0x2bf6f0=_0x1e90[_0x1e7f5e];return _0x2bf6f0;};'use strict';var Sequelize=require(_0x01e9('0x0'));module[_0x01e9('0x1')]={'uniqueid':{'type':Sequelize[_0x01e9('0x2')]},'node':{'type':Sequelize[_0x01e9('0x2')]},'application':{'type':Sequelize[_0x01e9('0x2')]},'data':{'type':Sequelize[_0x01e9('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x01e9('0x2')]}}; \ No newline at end of file +var _0xa19b=['sequelize','STRING','TEXT'];(function(_0x2dbac1,_0x44db3b){var _0x8c4e86=function(_0x1544ef){while(--_0x1544ef){_0x2dbac1['push'](_0x2dbac1['shift']());}};_0x8c4e86(++_0x44db3b);}(_0xa19b,0x6c));var _0xba19=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa19b[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xba19('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xba19('0x1')]},'application':{'type':Sequelize[_0xba19('0x1')]},'data':{'type':Sequelize[_0xba19('0x2')]},'project_name':{'type':Sequelize[_0xba19('0x1')]},'callerid':{'type':Sequelize[_0xba19('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 062963b..d257345 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 _0x9229=['eml-format','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','destroy','describe'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x9229,0x92));var _0x9922=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x9229[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require(_0x9922('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9922('0x1'));var rp=require('request-promise');var moment=require(_0x9922('0x2'));var BPromise=require(_0x9922('0x3'));var Mustache=require('mustache');var util=require(_0x9922('0x4'));var path=require(_0x9922('0x5'));var sox=require('sox');var csv=require(_0x9922('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9922('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9922('0x8'));var deskjs=require(_0x9922('0x9'));var toCsv=require(_0x9922('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9922('0xa'));var authService=require(_0x9922('0xb'));var qs=require(_0x9922('0xc'));var as=require(_0x9922('0xd'));var hardwareService=require(_0x9922('0xe'));var logger=require('../../config/logger')(_0x9922('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9922('0x10'));var db=require(_0x9922('0x11'))['db'];function respondWithStatusCode(_0x47f926,_0x29d4b8){_0x29d4b8=_0x29d4b8||0xcc;return function(_0x362ee7){if(_0x362ee7){return _0x47f926[_0x9922('0x12')](_0x29d4b8);}return _0x47f926[_0x9922('0x13')](_0x29d4b8)[_0x9922('0x14')]();};}function respondWithResult(_0x2a773d,_0x3e3ef9){_0x3e3ef9=_0x3e3ef9||0xc8;return function(_0x490729){if(_0x490729){return _0x2a773d['status'](_0x3e3ef9)[_0x9922('0x15')](_0x490729);}};}function respondWithFilteredResult(_0x453466,_0x4a3b93){return function(_0x5527c2){if(_0x5527c2){var _0x4c9845=typeof _0x4a3b93[_0x9922('0x16')]===_0x9922('0x17')&&typeof _0x4a3b93[_0x9922('0x18')]===_0x9922('0x17');var _0x1d94f0=_0x5527c2[_0x9922('0x19')];var _0x50ba79=_0x4c9845?0x0:_0x4a3b93['offset'];var _0x43c8bc=_0x4c9845?_0x5527c2[_0x9922('0x19')]:_0x4a3b93[_0x9922('0x16')]+_0x4a3b93[_0x9922('0x18')];var _0xc31740;if(_0x43c8bc>=_0x1d94f0){_0x43c8bc=_0x1d94f0;_0xc31740=0xc8;}else{_0xc31740=0xce;}_0x453466['status'](_0xc31740);return _0x453466[_0x9922('0x1a')](_0x9922('0x1b'),_0x50ba79+'-'+_0x43c8bc+'/'+_0x1d94f0)['json'](_0x5527c2);}return null;};}function patchUpdates(_0x4d8fd4){return function(_0x19697d){try{jsonpatch[_0x9922('0x1c')](_0x19697d,_0x4d8fd4,!![]);}catch(_0x5cb8c3){return BPromise[_0x9922('0x1d')](_0x5cb8c3);}return _0x19697d[_0x9922('0x1e')]();};}function saveUpdates(_0x4b0bd7,_0xf87d51){return function(_0x299325){if(_0x299325){return _0x299325['update'](_0x4b0bd7)[_0x9922('0x1f')](function(_0x145d94){return _0x145d94;});}return null;};}function removeEntity(_0x11018d,_0x2c8c54){return function(_0x546345){if(_0x546345){return _0x546345['destroy']()[_0x9922('0x1f')](function(){_0x11018d[_0x9922('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b173,_0x3a7276){return function(_0x36665a){if(!_0x36665a){_0x53b173[_0x9922('0x12')](0x194);}return _0x36665a;};}function handleError(_0x12e0ff,_0x1dc2fa){_0x1dc2fa=_0x1dc2fa||0x1f4;return function(_0x4f5ffe){logger[_0x9922('0x20')](_0x4f5ffe[_0x9922('0x21')]);if(_0x4f5ffe[_0x9922('0x22')]){delete _0x4f5ffe[_0x9922('0x22')];}_0x12e0ff[_0x9922('0x13')](_0x1dc2fa)['send'](_0x4f5ffe);};}exports[_0x9922('0x23')]=function(_0x1fbdab,_0x6c6090){var _0x41e932={},_0x30928e={},_0x4564d5={'count':0x0,'rows':[]};var _0x565c81=_[_0x9922('0x24')](db[_0x9922('0x25')][_0x9922('0x26')],function(_0x3ba86d){return{'name':_0x3ba86d[_0x9922('0x27')],'type':_0x3ba86d[_0x9922('0x28')][_0x9922('0x29')]};});_0x30928e[_0x9922('0x2a')]=_['map'](_0x565c81,_0x9922('0x22'));_0x30928e[_0x9922('0x2b')]=_[_0x9922('0x2c')](_0x1fbdab[_0x9922('0x2b')]);_0x30928e['filters']=_['intersection'](_0x30928e[_0x9922('0x2a')],_0x30928e['query']);_0x41e932[_0x9922('0x2d')]=_[_0x9922('0x2e')](_0x30928e['model'],qs['fields'](_0x1fbdab[_0x9922('0x2b')][_0x9922('0x2f')]));_0x41e932[_0x9922('0x2d')]=_0x41e932['attributes'][_0x9922('0x30')]?_0x41e932['attributes']:_0x30928e['model'];if(!_0x1fbdab[_0x9922('0x2b')][_0x9922('0x31')](_0x9922('0x32'))){_0x41e932[_0x9922('0x18')]=qs['limit'](_0x1fbdab[_0x9922('0x2b')][_0x9922('0x18')]);_0x41e932[_0x9922('0x16')]=qs[_0x9922('0x16')](_0x1fbdab['query'][_0x9922('0x16')]);}_0x41e932[_0x9922('0x33')]=qs['sort'](_0x1fbdab[_0x9922('0x2b')][_0x9922('0x34')]);_0x41e932[_0x9922('0x35')]=qs[_0x9922('0x36')](_[_0x9922('0x37')](_0x1fbdab[_0x9922('0x2b')],_0x30928e[_0x9922('0x36')]),_0x565c81);if(_0x1fbdab[_0x9922('0x2b')][_0x9922('0x38')]){_0x41e932[_0x9922('0x35')]=_['merge'](_0x41e932[_0x9922('0x35')],{'$or':_[_0x9922('0x24')](_0x565c81,function(_0xced416){if(_0xced416[_0x9922('0x28')]!==_0x9922('0x39')){var _0x183177={};_0x183177[_0xced416[_0x9922('0x22')]]={'$like':'%'+_0x1fbdab[_0x9922('0x2b')][_0x9922('0x38')]+'%'};return _0x183177;}})});}_0x41e932=_[_0x9922('0x3a')]({},_0x41e932,_0x1fbdab[_0x9922('0x3b')]);var _0x5832bd={'where':_0x41e932['where']};return db[_0x9922('0x25')]['count'](_0x5832bd)[_0x9922('0x1f')](function(_0x150f7f){_0x4564d5['count']=_0x150f7f;if(_0x1fbdab[_0x9922('0x2b')][_0x9922('0x3c')]){_0x41e932[_0x9922('0x3d')]=[{'all':!![]}];}return db[_0x9922('0x25')][_0x9922('0x3e')](_0x41e932);})[_0x9922('0x1f')](function(_0x56fca3){_0x4564d5[_0x9922('0x3f')]=_0x56fca3;return _0x4564d5;})['then'](respondWithFilteredResult(_0x6c6090,_0x41e932))['catch'](handleError(_0x6c6090,null));};exports[_0x9922('0x40')]=function(_0x26671c,_0x4ec4a6){var _0x41ffc1={'raw':!![],'where':{'id':_0x26671c[_0x9922('0x41')]['id']}},_0x1b6f1b={};_0x1b6f1b['model']=_[_0x9922('0x2c')](db['SquareDetailsReport'][_0x9922('0x26')]);_0x1b6f1b[_0x9922('0x2b')]=_[_0x9922('0x2c')](_0x26671c['query']);_0x1b6f1b[_0x9922('0x36')]=_['intersection'](_0x1b6f1b[_0x9922('0x2a')],_0x1b6f1b[_0x9922('0x2b')]);_0x41ffc1[_0x9922('0x2d')]=_[_0x9922('0x2e')](_0x1b6f1b[_0x9922('0x2a')],qs['fields'](_0x26671c[_0x9922('0x2b')][_0x9922('0x2f')]));_0x41ffc1[_0x9922('0x2d')]=_0x41ffc1[_0x9922('0x2d')][_0x9922('0x30')]?_0x41ffc1[_0x9922('0x2d')]:_0x1b6f1b[_0x9922('0x2a')];if(_0x26671c[_0x9922('0x2b')]['includeAll']){_0x41ffc1[_0x9922('0x3d')]=[{'all':!![]}];}_0x41ffc1=_[_0x9922('0x3a')]({},_0x41ffc1,_0x26671c['options']);return db['SquareDetailsReport']['find'](_0x41ffc1)[_0x9922('0x1f')](handleEntityNotFound(_0x4ec4a6,null))[_0x9922('0x1f')](respondWithResult(_0x4ec4a6,null))[_0x9922('0x42')](handleError(_0x4ec4a6,null));};exports['create']=function(_0x961cf8,_0x9da6fc){return db[_0x9922('0x25')][_0x9922('0x43')](_0x961cf8[_0x9922('0x44')],{})['then'](respondWithResult(_0x9da6fc,0xc9))['catch'](handleError(_0x9da6fc,null));};exports[_0x9922('0x45')]=function(_0x25af78,_0x4279c7){if(_0x25af78[_0x9922('0x44')]['id']){delete _0x25af78[_0x9922('0x44')]['id'];}return db[_0x9922('0x25')][_0x9922('0x46')]({'where':{'id':_0x25af78[_0x9922('0x41')]['id']}})[_0x9922('0x1f')](handleEntityNotFound(_0x4279c7,null))['then'](saveUpdates(_0x25af78[_0x9922('0x44')],null))[_0x9922('0x1f')](respondWithResult(_0x4279c7,null))[_0x9922('0x42')](handleError(_0x4279c7,null));};exports[_0x9922('0x47')]=function(_0x4389b7,_0x4b7b73){return db['SquareDetailsReport']['find']({'where':{'id':_0x4389b7[_0x9922('0x41')]['id']}})[_0x9922('0x1f')](handleEntityNotFound(_0x4b7b73,null))['then'](removeEntity(_0x4b7b73,null))[_0x9922('0x42')](handleError(_0x4b7b73,null));};exports[_0x9922('0x48')]=function(_0x24056e,_0x27e42d){return db[_0x9922('0x25')][_0x9922('0x48')]()[_0x9922('0x1f')](respondWithResult(_0x27e42d,null))['catch'](handleError(_0x27e42d,null));}; \ No newline at end of file +var _0x5754=['util','path','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','update','then','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x36616c,_0x23a468){var _0x56e518=function(_0x2a4d7a){while(--_0x2a4d7a){_0x36616c['push'](_0x36616c['shift']());}};_0x56e518(++_0x23a468);}(_0x5754,0x126));var _0x4575=function(_0x187b94,_0xa9abb3){_0x187b94=_0x187b94-0x0;var _0x2d5dcf=_0x5754[_0x187b94];return _0x2d5dcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4575('0x0'));var zipdir=require(_0x4575('0x1'));var jsonpatch=require(_0x4575('0x2'));var rp=require('request-promise');var moment=require(_0x4575('0x3'));var BPromise=require(_0x4575('0x4'));var Mustache=require(_0x4575('0x5'));var util=require(_0x4575('0x6'));var path=require(_0x4575('0x7'));var sox=require('sox');var csv=require(_0x4575('0x8'));var ejs=require(_0x4575('0x9'));var fs=require('fs');var fs_extra=require(_0x4575('0xa'));var _=require(_0x4575('0xb'));var squel=require(_0x4575('0xc'));var crypto=require(_0x4575('0xd'));var jsforce=require(_0x4575('0xe'));var deskjs=require(_0x4575('0xf'));var toCsv=require(_0x4575('0x8'));var querystring=require('querystring');var Papa=require(_0x4575('0x10'));var Redis=require('ioredis');var authService=require(_0x4575('0x11'));var qs=require(_0x4575('0x12'));var as=require(_0x4575('0x13'));var hardwareService=require(_0x4575('0x14'));var logger=require(_0x4575('0x15'))(_0x4575('0x16'));var utils=require(_0x4575('0x17'));var config=require(_0x4575('0x18'));var licenseUtil=require(_0x4575('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cdde0,_0x26460a){_0x26460a=_0x26460a||0xcc;return function(_0x39a61a){if(_0x39a61a){return _0x2cdde0[_0x4575('0x1a')](_0x26460a);}return _0x2cdde0[_0x4575('0x1b')](_0x26460a)[_0x4575('0x1c')]();};}function respondWithResult(_0x5105c2,_0x5ee6d8){_0x5ee6d8=_0x5ee6d8||0xc8;return function(_0x1cbc22){if(_0x1cbc22){return _0x5105c2[_0x4575('0x1b')](_0x5ee6d8)[_0x4575('0x1d')](_0x1cbc22);}};}function respondWithFilteredResult(_0x2e8498,_0x40a7e8){return function(_0x4085c9){if(_0x4085c9){var _0x1b86f9=typeof _0x40a7e8[_0x4575('0x1e')]==='undefined'&&typeof _0x40a7e8[_0x4575('0x1f')]===_0x4575('0x20');var _0x32fb01=_0x4085c9['count'];var _0x1d3f67=_0x1b86f9?0x0:_0x40a7e8[_0x4575('0x1e')];var _0x38ead0=_0x1b86f9?_0x4085c9['count']:_0x40a7e8[_0x4575('0x1e')]+_0x40a7e8[_0x4575('0x1f')];var _0x5723df;if(_0x38ead0>=_0x32fb01){_0x38ead0=_0x32fb01;_0x5723df=0xc8;}else{_0x5723df=0xce;}_0x2e8498[_0x4575('0x1b')](_0x5723df);return _0x2e8498['set'](_0x4575('0x21'),_0x1d3f67+'-'+_0x38ead0+'/'+_0x32fb01)[_0x4575('0x1d')](_0x4085c9);}return null;};}function patchUpdates(_0x4477b1){return function(_0x4af905){try{jsonpatch[_0x4575('0x22')](_0x4af905,_0x4477b1,!![]);}catch(_0x176664){return BPromise[_0x4575('0x23')](_0x176664);}return _0x4af905['save']();};}function saveUpdates(_0x15224c,_0x4350b4){return function(_0x10c6f1){if(_0x10c6f1){return _0x10c6f1[_0x4575('0x24')](_0x15224c)[_0x4575('0x25')](function(_0x31651b){return _0x31651b;});}return null;};}function removeEntity(_0x1652f7,_0x153697){return function(_0x3d03e8){if(_0x3d03e8){return _0x3d03e8['destroy']()[_0x4575('0x25')](function(){_0x1652f7['status'](0xcc)[_0x4575('0x1c')]();});}};}function handleEntityNotFound(_0x4d8222,_0x45745d){return function(_0x11a7c9){if(!_0x11a7c9){_0x4d8222[_0x4575('0x1a')](0x194);}return _0x11a7c9;};}function handleError(_0x28d7aa,_0x6eedd){_0x6eedd=_0x6eedd||0x1f4;return function(_0x1f7ad5){logger['error'](_0x1f7ad5[_0x4575('0x26')]);if(_0x1f7ad5[_0x4575('0x27')]){delete _0x1f7ad5[_0x4575('0x27')];}_0x28d7aa[_0x4575('0x1b')](_0x6eedd)[_0x4575('0x28')](_0x1f7ad5);};}exports['index']=function(_0x7065ca,_0x535257){var _0x6b2b7f={},_0x5660db={},_0x271cd8={'count':0x0,'rows':[]};var _0xd8f93f=_[_0x4575('0x29')](db[_0x4575('0x2a')][_0x4575('0x2b')],function(_0x3ca615){return{'name':_0x3ca615[_0x4575('0x2c')],'type':_0x3ca615['type'][_0x4575('0x2d')]};});_0x5660db[_0x4575('0x2e')]=_[_0x4575('0x29')](_0xd8f93f,_0x4575('0x27'));_0x5660db['query']=_[_0x4575('0x2f')](_0x7065ca[_0x4575('0x30')]);_0x5660db[_0x4575('0x31')]=_[_0x4575('0x32')](_0x5660db[_0x4575('0x2e')],_0x5660db[_0x4575('0x30')]);_0x6b2b7f[_0x4575('0x33')]=_['intersection'](_0x5660db['model'],qs[_0x4575('0x34')](_0x7065ca['query'][_0x4575('0x34')]));_0x6b2b7f[_0x4575('0x33')]=_0x6b2b7f[_0x4575('0x33')][_0x4575('0x35')]?_0x6b2b7f[_0x4575('0x33')]:_0x5660db[_0x4575('0x2e')];if(!_0x7065ca['query'][_0x4575('0x36')]('nolimit')){_0x6b2b7f['limit']=qs[_0x4575('0x1f')](_0x7065ca[_0x4575('0x30')]['limit']);_0x6b2b7f[_0x4575('0x1e')]=qs['offset'](_0x7065ca['query'][_0x4575('0x1e')]);}_0x6b2b7f['order']=qs[_0x4575('0x37')](_0x7065ca[_0x4575('0x30')]['sort']);_0x6b2b7f[_0x4575('0x38')]=qs['filters'](_[_0x4575('0x39')](_0x7065ca['query'],_0x5660db[_0x4575('0x31')]),_0xd8f93f);if(_0x7065ca[_0x4575('0x30')][_0x4575('0x3a')]){_0x6b2b7f['where']=_[_0x4575('0x3b')](_0x6b2b7f[_0x4575('0x38')],{'$or':_[_0x4575('0x29')](_0xd8f93f,function(_0x44dd52){if(_0x44dd52[_0x4575('0x3c')]!==_0x4575('0x3d')){var _0x1309cb={};_0x1309cb[_0x44dd52['name']]={'$like':'%'+_0x7065ca['query'][_0x4575('0x3a')]+'%'};return _0x1309cb;}})});}_0x6b2b7f=_['merge']({},_0x6b2b7f,_0x7065ca[_0x4575('0x3e')]);var _0x5cc7d3={'where':_0x6b2b7f['where']};return db[_0x4575('0x2a')][_0x4575('0x3f')](_0x5cc7d3)[_0x4575('0x25')](function(_0x16f06e){_0x271cd8[_0x4575('0x3f')]=_0x16f06e;if(_0x7065ca[_0x4575('0x30')][_0x4575('0x40')]){_0x6b2b7f['include']=[{'all':!![]}];}return db[_0x4575('0x2a')][_0x4575('0x41')](_0x6b2b7f);})[_0x4575('0x25')](function(_0x16d475){_0x271cd8['rows']=_0x16d475;return _0x271cd8;})[_0x4575('0x25')](respondWithFilteredResult(_0x535257,_0x6b2b7f))[_0x4575('0x42')](handleError(_0x535257,null));};exports[_0x4575('0x43')]=function(_0x54c920,_0x2a0d9f){var _0x5b5c2d={'raw':!![],'where':{'id':_0x54c920[_0x4575('0x44')]['id']}},_0x5aef84={};_0x5aef84['model']=_[_0x4575('0x2f')](db[_0x4575('0x2a')][_0x4575('0x2b')]);_0x5aef84[_0x4575('0x30')]=_['keys'](_0x54c920['query']);_0x5aef84[_0x4575('0x31')]=_[_0x4575('0x32')](_0x5aef84[_0x4575('0x2e')],_0x5aef84[_0x4575('0x30')]);_0x5b5c2d[_0x4575('0x33')]=_[_0x4575('0x32')](_0x5aef84[_0x4575('0x2e')],qs['fields'](_0x54c920[_0x4575('0x30')][_0x4575('0x34')]));_0x5b5c2d['attributes']=_0x5b5c2d[_0x4575('0x33')][_0x4575('0x35')]?_0x5b5c2d[_0x4575('0x33')]:_0x5aef84['model'];if(_0x54c920[_0x4575('0x30')][_0x4575('0x40')]){_0x5b5c2d[_0x4575('0x45')]=[{'all':!![]}];}_0x5b5c2d=_[_0x4575('0x3b')]({},_0x5b5c2d,_0x54c920['options']);return db[_0x4575('0x2a')][_0x4575('0x46')](_0x5b5c2d)[_0x4575('0x25')](handleEntityNotFound(_0x2a0d9f,null))[_0x4575('0x25')](respondWithResult(_0x2a0d9f,null))[_0x4575('0x42')](handleError(_0x2a0d9f,null));};exports[_0x4575('0x47')]=function(_0x1e2265,_0x2f79cb){return db[_0x4575('0x2a')]['create'](_0x1e2265[_0x4575('0x48')],{})[_0x4575('0x25')](respondWithResult(_0x2f79cb,0xc9))[_0x4575('0x42')](handleError(_0x2f79cb,null));};exports[_0x4575('0x24')]=function(_0x14bfd1,_0x160937){if(_0x14bfd1[_0x4575('0x48')]['id']){delete _0x14bfd1[_0x4575('0x48')]['id'];}return db['SquareDetailsReport'][_0x4575('0x46')]({'where':{'id':_0x14bfd1[_0x4575('0x44')]['id']}})['then'](handleEntityNotFound(_0x160937,null))[_0x4575('0x25')](saveUpdates(_0x14bfd1[_0x4575('0x48')],null))[_0x4575('0x25')](respondWithResult(_0x160937,null))['catch'](handleError(_0x160937,null));};exports[_0x4575('0x49')]=function(_0x44e429,_0x37b7be){return db[_0x4575('0x2a')]['find']({'where':{'id':_0x44e429[_0x4575('0x44')]['id']}})[_0x4575('0x25')](handleEntityNotFound(_0x37b7be,null))[_0x4575('0x25')](removeEntity(_0x37b7be,null))[_0x4575('0x42')](handleError(_0x37b7be,null));};exports[_0x4575('0x4a')]=function(_0xc033ab,_0x2fa234){return db[_0x4575('0x2a')][_0x4575('0x4a')]()[_0x4575('0x25')](respondWithResult(_0x2fa234,null))['catch'](handleError(_0x2fa234,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c75c021..2146daf 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 _0xfc72=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes','define'];(function(_0x2d3d18,_0x475f4c){var _0x202f49=function(_0x41abb5){while(--_0x41abb5){_0x2d3d18['push'](_0x2d3d18['shift']());}};_0x202f49(++_0x475f4c);}(_0xfc72,0x146));var _0x2fc7=function(_0x16b561,_0x5a914f){_0x16b561=_0x16b561-0x0;var _0x22599f=_0xfc72[_0x16b561];return _0x22599f;};'use strict';var _=require(_0x2fc7('0x0'));var util=require(_0x2fc7('0x1'));var logger=require(_0x2fc7('0x2'))(_0x2fc7('0x3'));var moment=require(_0x2fc7('0x4'));var BPromise=require(_0x2fc7('0x5'));var rp=require(_0x2fc7('0x6'));var fs=require('fs');var path=require(_0x2fc7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2fc7('0x8'));module['exports']=function(_0x18c632,_0x45568e){return _0x18c632[_0x2fc7('0x9')](_0x2fc7('0xa'),attributes,{'tableName':_0x2fc7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4e4=['../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2ff501,_0x4f8e6e){var _0x21dda1=function(_0x78ba35){while(--_0x78ba35){_0x2ff501['push'](_0x2ff501['shift']());}};_0x21dda1(++_0x4f8e6e);}(_0xa4e4,0x1b5));var _0x4a4e=function(_0x1d5f43,_0x56277f){_0x1d5f43=_0x1d5f43-0x0;var _0xea8d41=_0xa4e4[_0x1d5f43];return _0xea8d41;};'use strict';var _=require(_0x4a4e('0x0'));var util=require(_0x4a4e('0x1'));var logger=require(_0x4a4e('0x2'))(_0x4a4e('0x3'));var moment=require('moment');var BPromise=require(_0x4a4e('0x4'));var rp=require(_0x4a4e('0x5'));var fs=require('fs');var path=require(_0x4a4e('0x6'));var rimraf=require('rimraf');var config=require(_0x4a4e('0x7'));var attributes=require(_0x4a4e('0x8'));module['exports']=function(_0x473db1,_0x2796e6){return _0x473db1[_0x4a4e('0x9')](_0x4a4e('0xa'),attributes,{'tableName':_0x4a4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 09bbde8..ee31210 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 _0xe2cf=['info','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1287a6,_0x38b142){_0x1287a6=_0x1287a6-0x0;var _0x3b6196=_0xe2cf[_0x1287a6];return _0x3b6196;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')](_0x23242b[_0xfe2c('0x16')],{'raw':_0x23242b[_0xfe2c('0x17')]?_0x23242b['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9137){logger[_0xfe2c('0x19')](_0xfe2c('0x13'),_0x23242b);logger['debug'](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x4e9137));_0x13f233(_0x4e9137);})['catch'](function(_0x1bd50e){logger['error'](_0xfe2c('0x13'),_0x1bd50e[_0xfe2c('0x10')],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x1bd50e[_0xfe2c('0x10')]));});});}; \ No newline at end of file +var _0x263f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','lodash','util','moment','bluebird'];(function(_0xcb347b,_0xdb4264){var _0x8db83a=function(_0x2a2d19){while(--_0x2a2d19){_0xcb347b['push'](_0xcb347b['shift']());}};_0x8db83a(++_0xdb4264);}(_0x263f,0x182));var _0xf263=function(_0x40f05d,_0x11863d){_0x40f05d=_0x40f05d-0x0;var _0x2d6ed1=_0x263f[_0x40f05d];return _0x2d6ed1;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});}exports[_0xf263('0x16')]=function(_0x325a84){var _0x2e660e=this;return new Promise(function(_0x1ea46b,_0x56bd2d){return db[_0xf263('0x17')]['create'](_0x325a84[_0xf263('0x18')],{'raw':_0x325a84[_0xf263('0x19')]?_0x325a84[_0xf263('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf263('0xb')](function(_0x169328){logger[_0xf263('0xc')]('CreateSquareDetailsReport',_0x325a84);logger[_0xf263('0xf')](_0xf263('0x16'),_0x325a84,JSON[_0xf263('0x11')](_0x169328));_0x1ea46b(_0x169328);})[_0xf263('0x15')](function(_0xa0695){logger[_0xf263('0x12')](_0xf263('0x16'),_0xa0695[_0xf263('0x13')],_0x325a84);_0x56bd2d(_0x2e660e[_0xf263('0x12')](0x1f4,_0xa0695[_0xf263('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 10764bd..eb1b86c 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 _0x1410=['get','index','isAuthenticated','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x1410,0x1bc));var _0x0141=function(_0x46ab55,_0x5713dd){_0x46ab55=_0x46ab55-0x0;var _0x93d4ec=_0x1410[_0x46ab55];return _0x93d4ec;};'use strict';var express=require(_0x0141('0x0'));var router=express[_0x0141('0x1')]();var auth=require(_0x0141('0x2'));var controller=require(_0x0141('0x3'));router[_0x0141('0x4')]('/',auth['isAuthenticated'](),controller[_0x0141('0x5')]);router[_0x0141('0x4')]('/process/:pid/kill',auth[_0x0141('0x6')](),controller['killProcess']);module[_0x0141('0x7')]=router; \ No newline at end of file +var _0x940a=['../../components/auth/service','isAuthenticated','get','/process/:pid/kill','express'];(function(_0x47fe2f,_0x3c07f8){var _0x36d4d8=function(_0x3336ad){while(--_0x3336ad){_0x47fe2f['push'](_0x47fe2f['shift']());}};_0x36d4d8(++_0x3c07f8);}(_0x940a,0x1cb));var _0xa940=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0x940a[_0x109371];return _0x4fd858;};'use strict';var express=require(_0xa940('0x0'));var router=express['Router']();var auth=require(_0xa940('0x1'));var controller=require('./system.controller');router['get']('/',auth[_0xa940('0x2')](),controller['index']);router[_0xa940('0x3')](_0xa940('0x4'),auth[_0xa940('0x2')](),controller['killProcess']);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 1c83dc2..265514f 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 _0x3b7e=['exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x3b7e,0x148));var _0xe3b7=function(_0x4875d0,_0x1c5102){_0x4875d0=_0x4875d0-0x0;var _0x2214f8=_0x3b7e[_0x4875d0];return _0x2214f8;};'use strict';var info=require(_0xe3b7('0x0'));var exec=require(_0xe3b7('0x1'))[_0xe3b7('0x2')];var logger=require(_0xe3b7('0x3'))(_0xe3b7('0x4'));var util=require(_0xe3b7('0x5'));var BPromise=require('bluebird');var _=require(_0xe3b7('0x6'));function handleError(_0x326017,_0x7dd039,_0x3a179c){_0x7dd039=_0x7dd039||0x1f4;return function(_0x1415de){logger[_0xe3b7('0x7')](_0xe3b7('0x8'),_0x3a179c,_0x7dd039,util[_0xe3b7('0x9')](_0x1415de,{'showHidden':![],'depth':null}));delete _0x1415de[_0xe3b7('0xa')];_0x326017[_0xe3b7('0xb')](_0x7dd039)[_0xe3b7('0xc')](_0x1415de);};}exports[_0xe3b7('0xd')]=function(_0x4ea454,_0x100f15){return info[_0xe3b7('0xe')]()['then'](function(_0x476cc2){return _0x100f15[_0xe3b7('0xb')](0xc8)[_0xe3b7('0xf')](_0x476cc2);})[_0xe3b7('0x10')](function(_0x4ef75d){return _0x100f15[_0xe3b7('0xb')](0x1f4)[_0xe3b7('0xf')](_0x4ef75d);});};exports['killProcess']=function(_0x5aa568,_0x41a55f){var _0x5a29df=[_0xe3b7('0x11')];return new BPromise(function(_0x569b1f,_0x3d127a){return exec(util['format'](_0xe3b7('0x12'),_0x5aa568[_0xe3b7('0x13')][_0xe3b7('0x14')]),function(_0x502eeb,_0x580a01,_0x23fd65){if(_0x502eeb){return _0x3d127a(_0x502eeb);}return _0x569b1f(_0x580a01);});})[_0xe3b7('0x15')](function(_0x5caf92){var _0x3e3885=![];var _0x1bdbc7=_0x5caf92['split'](/\n/);for(var _0x4b5d21=0x0,_0x291762=_0x5a29df[_0xe3b7('0x16')];_0x4b5d21<_0x291762,_0x3e3885===![];_0x4b5d21+=0x1){if(_0x5caf92[_0xe3b7('0x17')](_0x5a29df[_0x4b5d21])>=0x0){_0x3e3885=!![];}}if(!_0x3e3885){throw new Error(util['format'](_0xe3b7('0x18'),_0x5aa568[_0xe3b7('0x13')][_0xe3b7('0x14')]));}process[_0xe3b7('0x19')](_0x5aa568['params'][_0xe3b7('0x14')],_0xe3b7('0x1a'));return _0x41a55f['status'](0xc8)[_0xe3b7('0xf')]({'message':util[_0xe3b7('0x1b')](_0xe3b7('0x1c'),_0x5aa568[_0xe3b7('0x13')][_0xe3b7('0x14')])});})[_0xe3b7('0x10')](handleError(_0x41a55f,null,_0xe3b7('0x1d')));}; \ No newline at end of file +var _0xec27=['error','inspect','name','index','then','json','catch','status','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','bluebird','lodash'];(function(_0x1d5918,_0x3f2b56){var _0x4ca5c8=function(_0xe9a10f){while(--_0xe9a10f){_0x1d5918['push'](_0x1d5918['shift']());}};_0x4ca5c8(++_0x3f2b56);}(_0xec27,0x13e));var _0x7ec2=function(_0x44bc6b,_0x17fe72){_0x44bc6b=_0x44bc6b-0x0;var _0x40d979=_0xec27[_0x44bc6b];return _0x40d979;};'use strict';var info=require(_0x7ec2('0x0'));var exec=require('child_process')[_0x7ec2('0x1')];var logger=require(_0x7ec2('0x2'))(_0x7ec2('0x3'));var util=require(_0x7ec2('0x4'));var BPromise=require(_0x7ec2('0x5'));var _=require(_0x7ec2('0x6'));function handleError(_0x2a8e8e,_0x351db3,_0x65a5c0){_0x351db3=_0x351db3||0x1f4;return function(_0x365220){logger[_0x7ec2('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x65a5c0,_0x351db3,util[_0x7ec2('0x8')](_0x365220,{'showHidden':![],'depth':null}));delete _0x365220[_0x7ec2('0x9')];_0x2a8e8e['status'](_0x351db3)['send'](_0x365220);};}exports[_0x7ec2('0xa')]=function(_0x54d81d,_0x22ffed){return info['getAllData']()[_0x7ec2('0xb')](function(_0x3921b5){return _0x22ffed['status'](0xc8)[_0x7ec2('0xc')](_0x3921b5);})[_0x7ec2('0xd')](function(_0x5ef1ef){return _0x22ffed[_0x7ec2('0xe')](0x1f4)[_0x7ec2('0xc')](_0x5ef1ef);});};exports['killProcess']=function(_0x3ed8cf,_0x32f9d0){var _0x4fcec6=[_0x7ec2('0xf')];return new BPromise(function(_0x1461dd,_0x164171){return exec(util[_0x7ec2('0x10')](_0x7ec2('0x11'),_0x3ed8cf['params'][_0x7ec2('0x12')]),function(_0x21f092,_0x4f8308,_0x4ca483){if(_0x21f092){return _0x164171(_0x21f092);}return _0x1461dd(_0x4f8308);});})['then'](function(_0x3bc447){var _0x7aeb04=![];var _0x3d83a5=_0x3bc447[_0x7ec2('0x13')](/\n/);for(var _0x4cb4e2=0x0,_0x321851=_0x4fcec6['length'];_0x4cb4e2<_0x321851,_0x7aeb04===![];_0x4cb4e2+=0x1){if(_0x3bc447[_0x7ec2('0x14')](_0x4fcec6[_0x4cb4e2])>=0x0){_0x7aeb04=!![];}}if(!_0x7aeb04){throw new Error(util[_0x7ec2('0x10')](_0x7ec2('0x15'),_0x3ed8cf['params'][_0x7ec2('0x12')]));}process[_0x7ec2('0x16')](_0x3ed8cf[_0x7ec2('0x17')][_0x7ec2('0x12')],'SIGINT');return _0x32f9d0[_0x7ec2('0xe')](0xc8)[_0x7ec2('0xc')]({'message':util[_0x7ec2('0x10')](_0x7ec2('0x18'),_0x3ed8cf['params'][_0x7ec2('0x12')])});})[_0x7ec2('0xd')](handleError(_0x32f9d0,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 19367c9..734fcd8 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 _0xe48c=['/:id','show','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get'];(function(_0x325743,_0x139dd6){var _0xf742b9=function(_0x3c0908){while(--_0x3c0908){_0x325743['push'](_0x325743['shift']());}};_0xf742b9(++_0x139dd6);}(_0xe48c,0xd7));var _0xce48=function(_0x47a3f5,_0x9a749){_0x47a3f5=_0x47a3f5-0x0;var _0x1f1c0d=_0xe48c[_0x47a3f5];return _0x1f1c0d;};'use strict';var multer=require(_0xce48('0x0'));var util=require(_0xce48('0x1'));var path=require(_0xce48('0x2'));var timeout=require('connect-timeout');var express=require(_0xce48('0x3'));var router=express[_0xce48('0x4')]();var fs_extra=require(_0xce48('0x5'));var auth=require(_0xce48('0x6'));var interaction=require(_0xce48('0x7'));var config=require(_0xce48('0x8'));var controller=require(_0xce48('0x9'));router['get']('/',auth[_0xce48('0xa')](),controller[_0xce48('0xb')]);router[_0xce48('0xc')](_0xce48('0xd'),auth['isAuthenticated'](),controller[_0xce48('0xe')]);router['post']('/',auth[_0xce48('0xa')](),controller[_0xce48('0xf')]);router['put'](_0xce48('0xd'),auth[_0xce48('0xa')](),controller[_0xce48('0x10')]);router[_0xce48('0x11')](_0xce48('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xce48('0x12')]=router; \ No newline at end of file +var _0x158d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports'];(function(_0x2616bc,_0x41c5e3){var _0x58e842=function(_0x2ac3b3){while(--_0x2ac3b3){_0x2616bc['push'](_0x2616bc['shift']());}};_0x58e842(++_0x41c5e3);}(_0x158d,0x1a2));var _0xd158=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x158d[_0x396466];return _0x5e9ab4;};'use strict';var multer=require(_0xd158('0x0'));var util=require('util');var path=require(_0xd158('0x1'));var timeout=require(_0xd158('0x2'));var express=require(_0xd158('0x3'));var router=express[_0xd158('0x4')]();var fs_extra=require(_0xd158('0x5'));var auth=require(_0xd158('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd158('0x7'));var controller=require(_0xd158('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd158('0x9')]);router[_0xd158('0xa')](_0xd158('0xb'),auth[_0xd158('0xc')](),controller['show']);router[_0xd158('0xd')]('/',auth['isAuthenticated'](),controller[_0xd158('0xe')]);router[_0xd158('0xf')](_0xd158('0xb'),auth[_0xd158('0xc')](),controller['update']);router[_0xd158('0x10')](_0xd158('0xb'),auth[_0xd158('0xc')](),controller[_0xd158('0x11')]);module[_0xd158('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 4eeb104..2ae5817 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 _0xf3aa=['#0091EA','sequelize','exports','STRING','name'];(function(_0x495f66,_0x38bb2f){var _0x529297=function(_0x49d0e0){while(--_0x49d0e0){_0x495f66['push'](_0x495f66['shift']());}};_0x529297(++_0x38bb2f);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x5c6c64,_0x12d4cb){_0x5c6c64=_0x5c6c64-0x0;var _0x172174=_0xf3aa[_0x5c6c64];return _0x172174;};'use strict';var Sequelize=require(_0xaf3a('0x0'));module[_0xaf3a('0x1')]={'name':{'type':Sequelize[_0xaf3a('0x2')],'unique':_0xaf3a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xaf3a('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf92=['sequelize','name','STRING','#0091EA'];(function(_0x813abf,_0x4c215a){var _0x403f98=function(_0x2b9f9b){while(--_0x2b9f9b){_0x813abf['push'](_0x813abf['shift']());}};_0x403f98(++_0x4c215a);}(_0xdf92,0x10c));var _0x2df9=function(_0x28b6ad,_0x1dbc42){_0x28b6ad=_0x28b6ad-0x0;var _0x21f424=_0xdf92[_0x28b6ad];return _0x21f424;};'use strict';var Sequelize=require(_0x2df9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2df9('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':_0x2df9('0x3')},'description':{'type':Sequelize[_0x2df9('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8a7b69c..e8102a0 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 _0x87ae=['moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','UserProfileResource','destroy','status','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','Tag','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x87ae,0xf5));var _0xe87a=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x87ae[_0x503950];return _0x1657a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe87a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe87a('0x1'));var BPromise=require(_0xe87a('0x2'));var Mustache=require(_0xe87a('0x3'));var util=require('util');var path=require(_0xe87a('0x4'));var sox=require(_0xe87a('0x5'));var csv=require(_0xe87a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe87a('0x7'));var squel=require(_0xe87a('0x8'));var crypto=require('crypto');var jsforce=require(_0xe87a('0x9'));var deskjs=require(_0xe87a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe87a('0xb'));var Papa=require(_0xe87a('0xc'));var Redis=require('ioredis');var authService=require(_0xe87a('0xd'));var qs=require(_0xe87a('0xe'));var as=require(_0xe87a('0xf'));var hardwareService=require(_0xe87a('0x10'));var logger=require(_0xe87a('0x11'))(_0xe87a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe87a('0x13'));var db=require(_0xe87a('0x14'))['db'];function respondWithStatusCode(_0x3e990c,_0x4db185){_0x4db185=_0x4db185||0xcc;return function(_0x1a725a){if(_0x1a725a){return _0x3e990c[_0xe87a('0x15')](_0x4db185);}return _0x3e990c['status'](_0x4db185)[_0xe87a('0x16')]();};}function respondWithResult(_0x353c52,_0x136340){_0x136340=_0x136340||0xc8;return function(_0x5032c5){if(_0x5032c5){return _0x353c52['status'](_0x136340)['json'](_0x5032c5);}};}function respondWithFilteredResult(_0x53a4f7,_0x44474f){return function(_0x1fa2cd){if(_0x1fa2cd){var _0xd2ca53=typeof _0x44474f[_0xe87a('0x17')]==='undefined'&&typeof _0x44474f[_0xe87a('0x18')]===_0xe87a('0x19');var _0x527c58=_0x1fa2cd['count'];var _0x4160e2=_0xd2ca53?0x0:_0x44474f['offset'];var _0x182e6f=_0xd2ca53?_0x1fa2cd[_0xe87a('0x1a')]:_0x44474f[_0xe87a('0x17')]+_0x44474f['limit'];var _0x444eeb;if(_0x182e6f>=_0x527c58){_0x182e6f=_0x527c58;_0x444eeb=0xc8;}else{_0x444eeb=0xce;}_0x53a4f7['status'](_0x444eeb);return _0x53a4f7[_0xe87a('0x1b')](_0xe87a('0x1c'),_0x4160e2+'-'+_0x182e6f+'/'+_0x527c58)[_0xe87a('0x1d')](_0x1fa2cd);}return null;};}function patchUpdates(_0x4059e1){return function(_0x104f67){try{jsonpatch[_0xe87a('0x1e')](_0x104f67,_0x4059e1,!![]);}catch(_0x1e37aa){return BPromise[_0xe87a('0x1f')](_0x1e37aa);}return _0x104f67['save']();};}function saveUpdates(_0x59c17c,_0x42ba03){return function(_0x363c6a){if(_0x363c6a){return _0x363c6a[_0xe87a('0x20')](_0x59c17c)[_0xe87a('0x21')](function(_0x15ced2){return _0x15ced2;});}return null;};}function removeEntity(_0x46731f,_0x56eba0){return function(_0x59d9f7){if(_0x59d9f7){return _0x59d9f7['destroy']()['then'](function(){var _0x328921=_0x59d9f7['get']({'plain':!![]});var _0x1108d0='Tags';return db[_0xe87a('0x22')][_0xe87a('0x23')]({'where':{'type':_0x1108d0,'resourceId':_0x328921['id']}})[_0xe87a('0x21')](function(){return _0x59d9f7;});})[_0xe87a('0x21')](function(){_0x46731f[_0xe87a('0x24')](0xcc)[_0xe87a('0x16')]();});}};}function handleEntityNotFound(_0x4fe080,_0x3fc24e){return function(_0x5b984f){if(!_0x5b984f){_0x4fe080['sendStatus'](0x194);}return _0x5b984f;};}function handleError(_0x39ec27,_0x48511b){_0x48511b=_0x48511b||0x1f4;return function(_0x537b52){logger['error'](_0x537b52[_0xe87a('0x25')]);if(_0x537b52[_0xe87a('0x26')]){delete _0x537b52[_0xe87a('0x26')];}_0x39ec27['status'](_0x48511b)['send'](_0x537b52);};}exports[_0xe87a('0x27')]=function(_0x5a747b,_0x4f61f7){var _0x3a5dc4={},_0x1d9742={},_0x15407d={'count':0x0,'rows':[]};var _0x2d3f77=_[_0xe87a('0x28')](db['Tag'][_0xe87a('0x29')],function(_0x4b80df){return{'name':_0x4b80df[_0xe87a('0x2a')],'type':_0x4b80df['type'][_0xe87a('0x2b')]};});_0x1d9742[_0xe87a('0x2c')]=_[_0xe87a('0x28')](_0x2d3f77,_0xe87a('0x26'));_0x1d9742[_0xe87a('0x2d')]=_[_0xe87a('0x2e')](_0x5a747b[_0xe87a('0x2d')]);_0x1d9742[_0xe87a('0x2f')]=_[_0xe87a('0x30')](_0x1d9742[_0xe87a('0x2c')],_0x1d9742['query']);_0x3a5dc4['attributes']=_['intersection'](_0x1d9742[_0xe87a('0x2c')],qs['fields'](_0x5a747b[_0xe87a('0x2d')][_0xe87a('0x31')]));_0x3a5dc4['attributes']=_0x3a5dc4[_0xe87a('0x32')]['length']?_0x3a5dc4['attributes']:_0x1d9742[_0xe87a('0x2c')];if(!_0x5a747b[_0xe87a('0x2d')][_0xe87a('0x33')](_0xe87a('0x34'))){_0x3a5dc4['limit']=qs[_0xe87a('0x18')](_0x5a747b[_0xe87a('0x2d')]['limit']);_0x3a5dc4[_0xe87a('0x17')]=qs[_0xe87a('0x17')](_0x5a747b['query'][_0xe87a('0x17')]);}_0x3a5dc4[_0xe87a('0x35')]=qs[_0xe87a('0x36')](_0x5a747b[_0xe87a('0x2d')][_0xe87a('0x36')]);_0x3a5dc4['where']=qs[_0xe87a('0x2f')](_['pick'](_0x5a747b[_0xe87a('0x2d')],_0x1d9742['filters']),_0x2d3f77);if(_0x5a747b['query'][_0xe87a('0x37')]){_0x3a5dc4[_0xe87a('0x38')]=_[_0xe87a('0x39')](_0x3a5dc4[_0xe87a('0x38')],{'$or':_[_0xe87a('0x28')](_0x2d3f77,function(_0x1109b9){if(_0x1109b9[_0xe87a('0x3a')]!==_0xe87a('0x3b')){var _0xda1ce1={};_0xda1ce1[_0x1109b9[_0xe87a('0x26')]]={'$like':'%'+_0x5a747b[_0xe87a('0x2d')][_0xe87a('0x37')]+'%'};return _0xda1ce1;}})});}_0x3a5dc4=_[_0xe87a('0x39')]({},_0x3a5dc4,_0x5a747b[_0xe87a('0x3c')]);var _0x553537={'where':_0x3a5dc4[_0xe87a('0x38')]};return db[_0xe87a('0x3d')][_0xe87a('0x1a')](_0x553537)[_0xe87a('0x21')](function(_0x5eb4e1){_0x15407d['count']=_0x5eb4e1;if(_0x5a747b['query'][_0xe87a('0x3e')]){_0x3a5dc4['include']=[{'all':!![]}];}return db['Tag'][_0xe87a('0x3f')](_0x3a5dc4);})['then'](function(_0x5b1f55){_0x15407d[_0xe87a('0x40')]=_0x5b1f55;return _0x15407d;})[_0xe87a('0x21')](respondWithFilteredResult(_0x4f61f7,_0x3a5dc4))['catch'](handleError(_0x4f61f7,null));};exports[_0xe87a('0x41')]=function(_0x4e8f4c,_0x5ad3af){var _0x551ba3={'raw':!![],'where':{'id':_0x4e8f4c[_0xe87a('0x42')]['id']}},_0x3aba9c={};_0x3aba9c['model']=_[_0xe87a('0x2e')](db[_0xe87a('0x3d')][_0xe87a('0x29')]);_0x3aba9c['query']=_['keys'](_0x4e8f4c['query']);_0x3aba9c['filters']=_[_0xe87a('0x30')](_0x3aba9c['model'],_0x3aba9c[_0xe87a('0x2d')]);_0x551ba3[_0xe87a('0x32')]=_[_0xe87a('0x30')](_0x3aba9c[_0xe87a('0x2c')],qs['fields'](_0x4e8f4c[_0xe87a('0x2d')][_0xe87a('0x31')]));_0x551ba3['attributes']=_0x551ba3[_0xe87a('0x32')][_0xe87a('0x43')]?_0x551ba3[_0xe87a('0x32')]:_0x3aba9c[_0xe87a('0x2c')];if(_0x4e8f4c[_0xe87a('0x2d')][_0xe87a('0x3e')]){_0x551ba3[_0xe87a('0x44')]=[{'all':!![]}];}_0x551ba3=_[_0xe87a('0x39')]({},_0x551ba3,_0x4e8f4c[_0xe87a('0x3c')]);return db['Tag'][_0xe87a('0x45')](_0x551ba3)[_0xe87a('0x21')](handleEntityNotFound(_0x5ad3af,null))[_0xe87a('0x21')](respondWithResult(_0x5ad3af,null))[_0xe87a('0x46')](handleError(_0x5ad3af,null));};exports['create']=function(_0x6ddec4,_0x28c00b){return db[_0xe87a('0x3d')][_0xe87a('0x47')](_0x6ddec4[_0xe87a('0x48')],{})[_0xe87a('0x21')](function(_0x154f73){var _0x324d97=_0x6ddec4['user'][_0xe87a('0x49')]({'plain':!![]});if(!_0x324d97)throw new Error(_0xe87a('0x4a'));if(_0x324d97[_0xe87a('0x4b')]==='user'){var _0x19d380=_0x154f73[_0xe87a('0x49')]({'plain':!![]});var _0xe032c8=_0xe87a('0x4c');return db[_0xe87a('0x4d')][_0xe87a('0x45')]({'where':{'name':_0xe032c8,'userProfileId':_0x324d97[_0xe87a('0x4e')]},'raw':!![]})[_0xe87a('0x21')](function(_0x1d268a){if(_0x1d268a&&_0x1d268a[_0xe87a('0x4f')]===0x0){return db[_0xe87a('0x22')][_0xe87a('0x47')]({'name':_0x19d380['name'],'resourceId':_0x19d380['id'],'type':_0x1d268a[_0xe87a('0x26')],'sectionId':_0x1d268a['id']},{})[_0xe87a('0x21')](function(){return _0x154f73;});}else{return _0x154f73;}})[_0xe87a('0x46')](function(_0x1bbd2e){logger[_0xe87a('0x50')](_0xe87a('0x51'),_0x1bbd2e);throw _0x1bbd2e;});}return _0x154f73;})[_0xe87a('0x21')](respondWithResult(_0x28c00b,0xc9))[_0xe87a('0x46')](handleError(_0x28c00b,null));};exports[_0xe87a('0x20')]=function(_0x5ee0b9,_0x553df2){if(_0x5ee0b9[_0xe87a('0x48')]['id']){delete _0x5ee0b9[_0xe87a('0x48')]['id'];}return db['Tag'][_0xe87a('0x45')]({'where':{'id':_0x5ee0b9[_0xe87a('0x42')]['id']}})['then'](handleEntityNotFound(_0x553df2,null))[_0xe87a('0x21')](saveUpdates(_0x5ee0b9[_0xe87a('0x48')],null))['then'](respondWithResult(_0x553df2,null))[_0xe87a('0x46')](handleError(_0x553df2,null));};exports[_0xe87a('0x23')]=function(_0x86d45e,_0xe84a3a){return db['Tag']['find']({'where':{'id':_0x86d45e[_0xe87a('0x42')]['id']}})[_0xe87a('0x21')](handleEntityNotFound(_0xe84a3a,null))['then'](removeEntity(_0xe84a3a,null))[_0xe87a('0x46')](handleError(_0xe84a3a,null));}; \ No newline at end of file +var _0x668b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x4f84e2,_0x46e547){var _0xd9601b=function(_0x4b7060){while(--_0x4b7060){_0x4f84e2['push'](_0x4f84e2['shift']());}};_0xd9601b(++_0x46e547);}(_0x668b,0x140));var _0xb668=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0x668b[_0x21090b];return _0x3c68d7;};'use strict';var emlformat=require(_0xb668('0x0'));var rimraf=require(_0xb668('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb668('0x2'));var rp=require(_0xb668('0x3'));var moment=require('moment');var BPromise=require(_0xb668('0x4'));var Mustache=require('mustache');var util=require(_0xb668('0x5'));var path=require(_0xb668('0x6'));var sox=require(_0xb668('0x7'));var csv=require('to-csv');var ejs=require(_0xb668('0x8'));var fs=require('fs');var fs_extra=require(_0xb668('0x9'));var _=require(_0xb668('0xa'));var squel=require(_0xb668('0xb'));var crypto=require(_0xb668('0xc'));var jsforce=require(_0xb668('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb668('0xe'));var querystring=require(_0xb668('0xf'));var Papa=require(_0xb668('0x10'));var Redis=require(_0xb668('0x11'));var authService=require(_0xb668('0x12'));var qs=require(_0xb668('0x13'));var as=require(_0xb668('0x14'));var hardwareService=require(_0xb668('0x15'));var logger=require('../../config/logger')(_0xb668('0x16'));var utils=require(_0xb668('0x17'));var config=require(_0xb668('0x18'));var licenseUtil=require(_0xb668('0x19'));var db=require(_0xb668('0x1a'))['db'];function respondWithStatusCode(_0x167057,_0x1d111a){_0x1d111a=_0x1d111a||0xcc;return function(_0x10ed24){if(_0x10ed24){return _0x167057[_0xb668('0x1b')](_0x1d111a);}return _0x167057[_0xb668('0x1c')](_0x1d111a)[_0xb668('0x1d')]();};}function respondWithResult(_0x3b7556,_0x3aed25){_0x3aed25=_0x3aed25||0xc8;return function(_0xd0450f){if(_0xd0450f){return _0x3b7556[_0xb668('0x1c')](_0x3aed25)[_0xb668('0x1e')](_0xd0450f);}};}function respondWithFilteredResult(_0x1ca6e7,_0x222cad){return function(_0x4fa32a){if(_0x4fa32a){var _0x4a755b=typeof _0x222cad[_0xb668('0x1f')]===_0xb668('0x20')&&typeof _0x222cad['limit']===_0xb668('0x20');var _0x567ad7=_0x4fa32a[_0xb668('0x21')];var _0x89fe72=_0x4a755b?0x0:_0x222cad['offset'];var _0x38595d=_0x4a755b?_0x4fa32a[_0xb668('0x21')]:_0x222cad['offset']+_0x222cad[_0xb668('0x22')];var _0x5b31ab;if(_0x38595d>=_0x567ad7){_0x38595d=_0x567ad7;_0x5b31ab=0xc8;}else{_0x5b31ab=0xce;}_0x1ca6e7[_0xb668('0x1c')](_0x5b31ab);return _0x1ca6e7[_0xb668('0x23')](_0xb668('0x24'),_0x89fe72+'-'+_0x38595d+'/'+_0x567ad7)[_0xb668('0x1e')](_0x4fa32a);}return null;};}function patchUpdates(_0x5d33ae){return function(_0x2b7f96){try{jsonpatch[_0xb668('0x25')](_0x2b7f96,_0x5d33ae,!![]);}catch(_0x25e5be){return BPromise['reject'](_0x25e5be);}return _0x2b7f96['save']();};}function saveUpdates(_0x43a70b,_0x1e5620){return function(_0x517eee){if(_0x517eee){return _0x517eee[_0xb668('0x26')](_0x43a70b)['then'](function(_0x2f1394){return _0x2f1394;});}return null;};}function removeEntity(_0x4bd365,_0x3f4745){return function(_0x1e1c94){if(_0x1e1c94){return _0x1e1c94[_0xb668('0x27')]()[_0xb668('0x28')](function(){var _0x2a5b3d=_0x1e1c94[_0xb668('0x29')]({'plain':!![]});var _0x4d4bf8=_0xb668('0x2a');return db[_0xb668('0x2b')][_0xb668('0x27')]({'where':{'type':_0x4d4bf8,'resourceId':_0x2a5b3d['id']}})['then'](function(){return _0x1e1c94;});})['then'](function(){_0x4bd365[_0xb668('0x1c')](0xcc)[_0xb668('0x1d')]();});}};}function handleEntityNotFound(_0x30b965,_0x5a67e9){return function(_0x3a2543){if(!_0x3a2543){_0x30b965[_0xb668('0x1b')](0x194);}return _0x3a2543;};}function handleError(_0x1616e5,_0x4c78a0){_0x4c78a0=_0x4c78a0||0x1f4;return function(_0x5709e2){logger[_0xb668('0x2c')](_0x5709e2[_0xb668('0x2d')]);if(_0x5709e2['name']){delete _0x5709e2[_0xb668('0x2e')];}_0x1616e5[_0xb668('0x1c')](_0x4c78a0)[_0xb668('0x2f')](_0x5709e2);};}exports[_0xb668('0x30')]=function(_0x256a8,_0x5f36b5){var _0x138ee5={},_0x3bd27c={},_0x5dfa2c={'count':0x0,'rows':[]};var _0x28bcdd=_['map'](db[_0xb668('0x31')][_0xb668('0x32')],function(_0x467fea){return{'name':_0x467fea[_0xb668('0x33')],'type':_0x467fea[_0xb668('0x34')][_0xb668('0x35')]};});_0x3bd27c[_0xb668('0x36')]=_[_0xb668('0x37')](_0x28bcdd,_0xb668('0x2e'));_0x3bd27c['query']=_[_0xb668('0x38')](_0x256a8[_0xb668('0x39')]);_0x3bd27c[_0xb668('0x3a')]=_['intersection'](_0x3bd27c[_0xb668('0x36')],_0x3bd27c[_0xb668('0x39')]);_0x138ee5[_0xb668('0x3b')]=_[_0xb668('0x3c')](_0x3bd27c['model'],qs[_0xb668('0x3d')](_0x256a8[_0xb668('0x39')][_0xb668('0x3d')]));_0x138ee5[_0xb668('0x3b')]=_0x138ee5[_0xb668('0x3b')][_0xb668('0x3e')]?_0x138ee5[_0xb668('0x3b')]:_0x3bd27c['model'];if(!_0x256a8[_0xb668('0x39')][_0xb668('0x3f')]('nolimit')){_0x138ee5[_0xb668('0x22')]=qs['limit'](_0x256a8['query'][_0xb668('0x22')]);_0x138ee5[_0xb668('0x1f')]=qs['offset'](_0x256a8[_0xb668('0x39')]['offset']);}_0x138ee5[_0xb668('0x40')]=qs['sort'](_0x256a8['query'][_0xb668('0x41')]);_0x138ee5[_0xb668('0x42')]=qs['filters'](_['pick'](_0x256a8[_0xb668('0x39')],_0x3bd27c[_0xb668('0x3a')]),_0x28bcdd);if(_0x256a8[_0xb668('0x39')][_0xb668('0x43')]){_0x138ee5[_0xb668('0x42')]=_['merge'](_0x138ee5['where'],{'$or':_[_0xb668('0x37')](_0x28bcdd,function(_0x43e98c){if(_0x43e98c[_0xb668('0x34')]!==_0xb668('0x44')){var _0x41aeca={};_0x41aeca[_0x43e98c[_0xb668('0x2e')]]={'$like':'%'+_0x256a8['query']['filter']+'%'};return _0x41aeca;}})});}_0x138ee5=_[_0xb668('0x45')]({},_0x138ee5,_0x256a8[_0xb668('0x46')]);var _0x89956d={'where':_0x138ee5[_0xb668('0x42')]};return db[_0xb668('0x31')]['count'](_0x89956d)[_0xb668('0x28')](function(_0x429b14){_0x5dfa2c['count']=_0x429b14;if(_0x256a8[_0xb668('0x39')][_0xb668('0x47')]){_0x138ee5[_0xb668('0x48')]=[{'all':!![]}];}return db[_0xb668('0x31')]['findAll'](_0x138ee5);})['then'](function(_0x4b7192){_0x5dfa2c[_0xb668('0x49')]=_0x4b7192;return _0x5dfa2c;})['then'](respondWithFilteredResult(_0x5f36b5,_0x138ee5))['catch'](handleError(_0x5f36b5,null));};exports['show']=function(_0x50ffe0,_0x467ac9){var _0x4874a8={'raw':!![],'where':{'id':_0x50ffe0[_0xb668('0x4a')]['id']}},_0x14b269={};_0x14b269[_0xb668('0x36')]=_[_0xb668('0x38')](db[_0xb668('0x31')]['rawAttributes']);_0x14b269[_0xb668('0x39')]=_[_0xb668('0x38')](_0x50ffe0[_0xb668('0x39')]);_0x14b269[_0xb668('0x3a')]=_[_0xb668('0x3c')](_0x14b269[_0xb668('0x36')],_0x14b269[_0xb668('0x39')]);_0x4874a8[_0xb668('0x3b')]=_[_0xb668('0x3c')](_0x14b269[_0xb668('0x36')],qs[_0xb668('0x3d')](_0x50ffe0['query'][_0xb668('0x3d')]));_0x4874a8[_0xb668('0x3b')]=_0x4874a8[_0xb668('0x3b')]['length']?_0x4874a8['attributes']:_0x14b269[_0xb668('0x36')];if(_0x50ffe0['query'][_0xb668('0x47')]){_0x4874a8['include']=[{'all':!![]}];}_0x4874a8=_['merge']({},_0x4874a8,_0x50ffe0['options']);return db[_0xb668('0x31')][_0xb668('0x4b')](_0x4874a8)['then'](handleEntityNotFound(_0x467ac9,null))[_0xb668('0x28')](respondWithResult(_0x467ac9,null))[_0xb668('0x4c')](handleError(_0x467ac9,null));};exports[_0xb668('0x4d')]=function(_0x1b649f,_0x16d06f){return db[_0xb668('0x31')][_0xb668('0x4d')](_0x1b649f[_0xb668('0x4e')],{})[_0xb668('0x28')](function(_0x4065f7){var _0x4e0628=_0x1b649f[_0xb668('0x4f')][_0xb668('0x29')]({'plain':!![]});if(!_0x4e0628)throw new Error(_0xb668('0x50'));if(_0x4e0628[_0xb668('0x51')]===_0xb668('0x4f')){var _0x3da9ba=_0x4065f7[_0xb668('0x29')]({'plain':!![]});var _0x1bff79=_0xb668('0x2a');return db['UserProfileSection'][_0xb668('0x4b')]({'where':{'name':_0x1bff79,'userProfileId':_0x4e0628[_0xb668('0x52')]},'raw':!![]})[_0xb668('0x28')](function(_0x4c9eab){if(_0x4c9eab&&_0x4c9eab['autoAssociation']===0x0){return db[_0xb668('0x2b')][_0xb668('0x4d')]({'name':_0x3da9ba[_0xb668('0x2e')],'resourceId':_0x3da9ba['id'],'type':_0x4c9eab['name'],'sectionId':_0x4c9eab['id']},{})[_0xb668('0x28')](function(){return _0x4065f7;});}else{return _0x4065f7;}})['catch'](function(_0x51a5d3){logger[_0xb668('0x2c')](_0xb668('0x53'),_0x51a5d3);throw _0x51a5d3;});}return _0x4065f7;})[_0xb668('0x28')](respondWithResult(_0x16d06f,0xc9))[_0xb668('0x4c')](handleError(_0x16d06f,null));};exports[_0xb668('0x26')]=function(_0x42b306,_0x40f9a0){if(_0x42b306[_0xb668('0x4e')]['id']){delete _0x42b306[_0xb668('0x4e')]['id'];}return db[_0xb668('0x31')][_0xb668('0x4b')]({'where':{'id':_0x42b306[_0xb668('0x4a')]['id']}})[_0xb668('0x28')](handleEntityNotFound(_0x40f9a0,null))[_0xb668('0x28')](saveUpdates(_0x42b306[_0xb668('0x4e')],null))[_0xb668('0x28')](respondWithResult(_0x40f9a0,null))[_0xb668('0x4c')](handleError(_0x40f9a0,null));};exports[_0xb668('0x27')]=function(_0x414660,_0x3b4fd5){return db[_0xb668('0x31')][_0xb668('0x4b')]({'where':{'id':_0x414660[_0xb668('0x4a')]['id']}})[_0xb668('0x28')](handleEntityNotFound(_0x3b4fd5,null))[_0xb668('0x28')](removeEntity(_0x3b4fd5,null))[_0xb668('0x4c')](handleError(_0x3b4fd5,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 52b86f0..896afff 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 _0xc56c=['tools_tags','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','Tag'];(function(_0x217523,_0x5d793a){var _0x43e3e1=function(_0x477f77){while(--_0x477f77){_0x217523['push'](_0x217523['shift']());}};_0x43e3e1(++_0x5d793a);}(_0xc56c,0x8d));var _0xcc56=function(_0x5076de,_0x1fec41){_0x5076de=_0x5076de-0x0;var _0x5e0aef=_0xc56c[_0x5076de];return _0x5e0aef;};'use strict';var _=require(_0xcc56('0x0'));var util=require(_0xcc56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc56('0x2'));var BPromise=require('bluebird');var rp=require(_0xcc56('0x3'));var fs=require('fs');var path=require(_0xcc56('0x4'));var rimraf=require(_0xcc56('0x5'));var config=require(_0xcc56('0x6'));var attributes=require(_0xcc56('0x7'));module['exports']=function(_0x5f575c,_0x239e70){return _0x5f575c['define'](_0xcc56('0x8'),attributes,{'tableName':_0xcc56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ba=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util'];(function(_0xf3120,_0x80a54c){var _0x5aa549=function(_0x17ba5b){while(--_0x17ba5b){_0xf3120['push'](_0xf3120['shift']());}};_0x5aa549(++_0x80a54c);}(_0x05ba,0x116));var _0xa05b=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x05ba[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require(_0xa05b('0x0'));var util=require(_0xa05b('0x1'));var logger=require(_0xa05b('0x2'))(_0xa05b('0x3'));var moment=require(_0xa05b('0x4'));var BPromise=require(_0xa05b('0x5'));var rp=require(_0xa05b('0x6'));var fs=require('fs');var path=require(_0xa05b('0x7'));var rimraf=require(_0xa05b('0x8'));var config=require(_0xa05b('0x9'));var attributes=require(_0xa05b('0xa'));module[_0xa05b('0xb')]=function(_0x4d0e20,_0x8471a2){return _0x4d0e20['define'](_0xa05b('0xc'),attributes,{'tableName':_0xa05b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7a91d8d..df34c29 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result'];(function(_0x4ed383,_0x5cd212){var _0x135bf3=function(_0x3096e4){while(--_0x3096e4){_0x4ed383['push'](_0x4ed383['shift']());}};_0x135bf3(++_0x5cd212);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0xf3cd[_0x319cb9];return _0x1735fc;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('Tag,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('Tag,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0x3561=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','Tag,\x20%s,\x20%s','message','result'];(function(_0x3789b9,_0x5c2f00){var _0x4d020d=function(_0x170650){while(--_0x170650){_0x3789b9['push'](_0x3789b9['shift']());}};_0x4d020d(++_0x5c2f00);}(_0x3561,0x94));var _0x1356=function(_0x4ed3ca,_0x19c3c5){_0x4ed3ca=_0x4ed3ca-0x0;var _0x3ced07=_0x3561[_0x4ed3ca];return _0x3ced07;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var moment=require(_0x1356('0x1'));var BPromise=require(_0x1356('0x2'));var rs=require(_0x1356('0x3'));var fs=require('fs');var Redis=require(_0x1356('0x4'));var db=require(_0x1356('0x5'))['db'];var utils=require(_0x1356('0x6'));var logger=require(_0x1356('0x7'))(_0x1356('0x8'));var config=require(_0x1356('0x9'));var jayson=require(_0x1356('0xa'));var client=jayson[_0x1356('0xb')][_0x1356('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ac56,_0x4b4527,_0x105aaf){return new BPromise(function(_0x33529f,_0x1e98ae){return client['request'](_0x45ac56,_0x105aaf)['then'](function(_0x4e1adb){logger[_0x1356('0xd')]('Tag,\x20%s,\x20%s',_0x4b4527,_0x1356('0xe'));logger['debug'](_0x1356('0xf'),_0x4b4527,_0x1356('0xe'),JSON['stringify'](_0x4e1adb));if(_0x4e1adb[_0x1356('0x10')]){if(_0x4e1adb[_0x1356('0x10')]['code']===0x1f4){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x1e98ae(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x33529f(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}else{logger[_0x1356('0xd')]('Tag,\x20%s,\x20%s',_0x4b4527,'request\x20sent');_0x33529f(_0x4e1adb[_0x1356('0x13')][_0x1356('0x12')]);}})[_0x1356('0x14')](function(_0x5cecb2){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x5cecb2);_0x1e98ae(_0x5cecb2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 0e74d7a..50f71bd 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_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/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 049428f..dfb2325 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 _0xb7e7=['STRING','sequelize'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4d8a63,_0x1497c1){var _0x11e950=function(_0x312d15){while(--_0x312d15){_0x4d8a63['push'](_0x4d8a63['shift']());}};_0x11e950(++_0x1497c1);}(_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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 597dbee..5e95dfc 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 _0x1651=['status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','name','Team','rawAttributes','type','key','map','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','sequelize','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','Queue','Queues','addQueues','ids','removeQueues','Unknown\x20channel','toLowerCase','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','transaction','QueueId','defaults','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','User','online','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Openchannel','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','end'];(function(_0x5fefb0,_0x5dc4fc){var _0x457afe=function(_0xe2814f){while(--_0xe2814f){_0x5fefb0['push'](_0x5fefb0['shift']());}};_0x457afe(++_0x5dc4fc);}(_0x1651,0x1ab));var _0x1165=function(_0x3cc163,_0x5d21b7){_0x3cc163=_0x3cc163-0x0;var _0x503be5=_0x1651[_0x3cc163];return _0x503be5;};'use strict';var emlformat=require(_0x1165('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1165('0x1'));var jsonpatch=require(_0x1165('0x2'));var rp=require('request-promise');var moment=require(_0x1165('0x3'));var BPromise=require(_0x1165('0x4'));var Mustache=require(_0x1165('0x5'));var util=require(_0x1165('0x6'));var path=require(_0x1165('0x7'));var sox=require(_0x1165('0x8'));var csv=require(_0x1165('0x9'));var ejs=require(_0x1165('0xa'));var fs=require('fs');var fs_extra=require(_0x1165('0xb'));var _=require('lodash');var squel=require(_0x1165('0xc'));var crypto=require(_0x1165('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1165('0xe'));var toCsv=require(_0x1165('0x9'));var querystring=require(_0x1165('0xf'));var Papa=require(_0x1165('0x10'));var Redis=require(_0x1165('0x11'));var authService=require(_0x1165('0x12'));var qs=require(_0x1165('0x13'));var as=require(_0x1165('0x14'));var hardwareService=require(_0x1165('0x15'));var logger=require(_0x1165('0x16'))(_0x1165('0x17'));var utils=require(_0x1165('0x18'));var config=require(_0x1165('0x19'));var licenseUtil=require(_0x1165('0x1a'));var db=require(_0x1165('0x1b'))['db'];config[_0x1165('0x1c')]=_['defaults'](config[_0x1165('0x1c')],{'host':_0x1165('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1165('0x1c')]));require('./team.socket')[_0x1165('0x1e')](socket);function respondWithStatusCode(_0x58e5dc,_0x492ada){_0x492ada=_0x492ada||0xcc;return function(_0x172ad9){if(_0x172ad9){return _0x58e5dc['sendStatus'](_0x492ada);}return _0x58e5dc['status'](_0x492ada)[_0x1165('0x1f')]();};}function respondWithResult(_0x50e393,_0xf693e3){_0xf693e3=_0xf693e3||0xc8;return function(_0x36caa5){if(_0x36caa5){return _0x50e393[_0x1165('0x20')](_0xf693e3)['json'](_0x36caa5);}};}function respondWithFilteredResult(_0xa3ccd,_0x251ed0){return function(_0x423782){if(_0x423782){var _0x23edec=typeof _0x251ed0[_0x1165('0x21')]===_0x1165('0x22')&&typeof _0x251ed0[_0x1165('0x23')]===_0x1165('0x22');var _0x35e110=_0x423782[_0x1165('0x24')];var _0x780357=_0x23edec?0x0:_0x251ed0[_0x1165('0x21')];var _0x484269=_0x23edec?_0x423782['count']:_0x251ed0[_0x1165('0x21')]+_0x251ed0['limit'];var _0xb21033;if(_0x484269>=_0x35e110){_0x484269=_0x35e110;_0xb21033=0xc8;}else{_0xb21033=0xce;}_0xa3ccd[_0x1165('0x20')](_0xb21033);return _0xa3ccd[_0x1165('0x25')](_0x1165('0x26'),_0x780357+'-'+_0x484269+'/'+_0x35e110)[_0x1165('0x27')](_0x423782);}return null;};}function patchUpdates(_0x383aae){return function(_0x45c2db){try{jsonpatch[_0x1165('0x28')](_0x45c2db,_0x383aae,!![]);}catch(_0x3b2a4d){return BPromise[_0x1165('0x29')](_0x3b2a4d);}return _0x45c2db['save']();};}function saveUpdates(_0x30de39,_0x485d74){return function(_0x4a26a9){if(_0x4a26a9){return _0x4a26a9[_0x1165('0x2a')](_0x30de39)[_0x1165('0x2b')](function(_0x38282b){return _0x38282b;});}return null;};}function handleEntityNotFound(_0x44a58b,_0x25be17){return function(_0xfb6e83){if(!_0xfb6e83){_0x44a58b[_0x1165('0x2c')](0x194);}return _0xfb6e83;};}function handleError(_0x269229,_0x1afb8f){_0x1afb8f=_0x1afb8f||0x1f4;return function(_0x3120d7){logger[_0x1165('0x2d')](_0x3120d7['stack']);if(_0x3120d7[_0x1165('0x2e')]){delete _0x3120d7[_0x1165('0x2e')];}_0x269229[_0x1165('0x20')](_0x1afb8f)['send'](_0x3120d7);};}exports['index']=function(_0x301805,_0x2644e9){var _0x6ebd92={},_0xfa2ee1={},_0x37058a={'count':0x0,'rows':[]};var _0x12d8c3=_['map'](db[_0x1165('0x2f')][_0x1165('0x30')],function(_0x1b10d9){return{'name':_0x1b10d9['fieldName'],'type':_0x1b10d9[_0x1165('0x31')][_0x1165('0x32')]};});_0xfa2ee1['model']=_[_0x1165('0x33')](_0x12d8c3,_0x1165('0x2e'));_0xfa2ee1['query']=_[_0x1165('0x34')](_0x301805[_0x1165('0x35')]);_0xfa2ee1['filters']=_[_0x1165('0x36')](_0xfa2ee1[_0x1165('0x37')],_0xfa2ee1[_0x1165('0x35')]);_0x6ebd92[_0x1165('0x38')]=_[_0x1165('0x36')](_0xfa2ee1[_0x1165('0x37')],qs[_0x1165('0x39')](_0x301805[_0x1165('0x35')][_0x1165('0x39')]));_0x6ebd92[_0x1165('0x38')]=_0x6ebd92[_0x1165('0x38')][_0x1165('0x3a')]?_0x6ebd92[_0x1165('0x38')]:_0xfa2ee1[_0x1165('0x37')];if(!_0x301805[_0x1165('0x35')]['hasOwnProperty'](_0x1165('0x3b'))){_0x6ebd92[_0x1165('0x23')]=qs['limit'](_0x301805['query'][_0x1165('0x23')]);_0x6ebd92[_0x1165('0x21')]=qs[_0x1165('0x21')](_0x301805['query'][_0x1165('0x21')]);}_0x6ebd92[_0x1165('0x3c')]=qs[_0x1165('0x3d')](_0x301805[_0x1165('0x35')][_0x1165('0x3d')]);_0x6ebd92[_0x1165('0x3e')]=qs['filters'](_[_0x1165('0x3f')](_0x301805[_0x1165('0x35')],_0xfa2ee1[_0x1165('0x40')]),_0x12d8c3);if(_0x301805[_0x1165('0x35')][_0x1165('0x41')]){_0x6ebd92['where']=_['merge'](_0x6ebd92[_0x1165('0x3e')],{'$or':_[_0x1165('0x33')](_0x12d8c3,function(_0x3be4ee){if(_0x3be4ee['type']!==_0x1165('0x42')){var _0x4e4e10={};_0x4e4e10[_0x3be4ee[_0x1165('0x2e')]]={'$like':'%'+_0x301805[_0x1165('0x35')][_0x1165('0x41')]+'%'};return _0x4e4e10;}})});}_0x6ebd92=_[_0x1165('0x43')]({},_0x6ebd92,_0x301805['options']);var _0x37b0e8={'where':_0x6ebd92['where']};return db[_0x1165('0x2f')][_0x1165('0x24')](_0x37b0e8)[_0x1165('0x2b')](function(_0xeb5ba7){_0x37058a[_0x1165('0x24')]=_0xeb5ba7;if(_0x301805[_0x1165('0x35')][_0x1165('0x44')]){_0x6ebd92[_0x1165('0x45')]=[{'all':!![]}];}return db['Team'][_0x1165('0x46')](_0x6ebd92);})[_0x1165('0x2b')](function(_0xe32abb){_0x37058a[_0x1165('0x47')]=_0xe32abb;return _0x37058a;})[_0x1165('0x2b')](respondWithFilteredResult(_0x2644e9,_0x6ebd92))[_0x1165('0x48')](handleError(_0x2644e9,null));};exports[_0x1165('0x49')]=function(_0x3671c4,_0x4b9e33){var _0x769d49={'raw':![],'where':{'id':_0x3671c4[_0x1165('0x4a')]['id']}},_0x54ed21={};_0x54ed21[_0x1165('0x37')]=_[_0x1165('0x34')](db[_0x1165('0x2f')]['rawAttributes']);_0x54ed21[_0x1165('0x35')]=_[_0x1165('0x34')](_0x3671c4[_0x1165('0x35')]);_0x54ed21[_0x1165('0x40')]=_[_0x1165('0x36')](_0x54ed21['model'],_0x54ed21['query']);_0x769d49[_0x1165('0x38')]=_[_0x1165('0x36')](_0x54ed21[_0x1165('0x37')],qs[_0x1165('0x39')](_0x3671c4['query']['fields']));_0x769d49['attributes']=_0x769d49[_0x1165('0x38')]['length']?_0x769d49[_0x1165('0x38')]:_0x54ed21[_0x1165('0x37')];if(_0x3671c4[_0x1165('0x35')][_0x1165('0x44')]){_0x769d49['include']=[{'all':!![]}];}_0x769d49=_[_0x1165('0x43')]({},_0x769d49,_0x3671c4[_0x1165('0x4b')]);return db['Team']['find'](_0x769d49)[_0x1165('0x2b')](handleEntityNotFound(_0x4b9e33,null))[_0x1165('0x2b')](respondWithResult(_0x4b9e33,null))[_0x1165('0x48')](handleError(_0x4b9e33,null));};exports[_0x1165('0x4c')]=function(_0x1e880e,_0x5b7123){return db['Team'][_0x1165('0x4c')](_0x1e880e[_0x1165('0x4d')],{})[_0x1165('0x2b')](function(_0x58deba){var _0x487d4f=_0x1e880e[_0x1165('0x4e')]['get']({'plain':!![]});if(!_0x487d4f)throw new Error(_0x1165('0x4f'));if(_0x487d4f[_0x1165('0x50')]===_0x1165('0x4e')){var _0x28a397=_0x58deba[_0x1165('0x51')]({'plain':!![]});var _0x3bf72c=_0x1165('0x52');return db[_0x1165('0x53')][_0x1165('0x54')]({'where':{'name':_0x3bf72c,'userProfileId':_0x487d4f[_0x1165('0x55')]},'raw':!![]})[_0x1165('0x2b')](function(_0xea5f6b){if(_0xea5f6b&&_0xea5f6b['autoAssociation']===0x0){return db[_0x1165('0x56')]['create']({'name':_0x28a397[_0x1165('0x2e')],'resourceId':_0x28a397['id'],'type':_0xea5f6b[_0x1165('0x2e')],'sectionId':_0xea5f6b['id']},{})[_0x1165('0x2b')](function(){return _0x58deba;});}else{return _0x58deba;}})[_0x1165('0x48')](function(_0x50bedc){logger[_0x1165('0x2d')](_0x1165('0x57'),_0x50bedc);throw _0x50bedc;});}return _0x58deba;})[_0x1165('0x2b')](respondWithResult(_0x5b7123,0xc9))[_0x1165('0x48')](handleError(_0x5b7123,null));};exports[_0x1165('0x2a')]=function(_0x4a350b,_0x31fff3){if(_0x4a350b[_0x1165('0x4d')]['id']){delete _0x4a350b[_0x1165('0x4d')]['id'];}return db[_0x1165('0x2f')]['find']({'where':{'id':_0x4a350b[_0x1165('0x4a')]['id']}})[_0x1165('0x2b')](handleEntityNotFound(_0x31fff3,null))[_0x1165('0x2b')](saveUpdates(_0x4a350b[_0x1165('0x4d')],null))[_0x1165('0x2b')](respondWithResult(_0x31fff3,null))[_0x1165('0x48')](handleError(_0x31fff3,null));};exports[_0x1165('0x58')]=function(_0x581b3b,_0x5dbfb0){var _0x59326d=_0x581b3b[_0x1165('0x4a')]['id'];var _0x5c6995=[];return db['sequelize']['transaction'](function(_0x4c9bbb){var _0x4a3e24='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x59326d;return db['sequelize'][_0x1165('0x35')](_0x4a3e24,{'type':db[_0x1165('0x59')][_0x1165('0x5a')][_0x1165('0x5b')],'raw':!![],'transaction':_0x4c9bbb})[_0x1165('0x2b')](function(_0x1ce8df){_0x5c6995=_[_0x1165('0x33')](_0x1ce8df,function(_0x4bcbc5){return Number(_0x4bcbc5[_0x1165('0x5c')]);});})[_0x1165('0x2b')](function(){var _0xb4bd67=_0x1165('0x5d')+_0x59326d;return db['sequelize']['query'](_0xb4bd67,{'type':db['Sequelize'][_0x1165('0x5a')]['SELECT'],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x231850){var _0x52e544=_[_0x1165('0x33')](_0x231850,function(_0x2fa994){return Number(_0x2fa994[_0x1165('0x5e')]);});return db[_0x1165('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x5c6995},'VoiceQueueId':{'$in':_0x52e544}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){var _0xc4290f='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0xc4290f,{'type':db[_0x1165('0x59')][_0x1165('0x5a')]['SELECT'],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x12e8ee){var _0x45996a=_[_0x1165('0x33')](_0x12e8ee,function(_0xaa9347){return Number(_0xaa9347[_0x1165('0x61')]);});return db[_0x1165('0x62')]['destroy']({'where':{'UserId':{'$in':_0x5c6995},'MailQueueId':{'$in':_0x45996a}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){var _0x355693=_0x1165('0x63')+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0x355693,{'type':db[_0x1165('0x59')][_0x1165('0x5a')]['SELECT'],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x30ba04){var _0xb8573c=_['map'](_0x30ba04,function(_0x18e67d){return Number(_0x18e67d[_0x1165('0x64')]);});return db[_0x1165('0x65')][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'SmsQueueId':{'$in':_0xb8573c}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){var _0x8c119=_0x1165('0x66')+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0x8c119,{'type':db['Sequelize']['QueryTypes'][_0x1165('0x5b')],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x388946){var _0x945763=_[_0x1165('0x33')](_0x388946,function(_0xd7105b){return Number(_0xd7105b[_0x1165('0x67')]);});return db['UserChatQueue'][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'ChatQueueId':{'$in':_0x945763}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){var _0x3de32f='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0x3de32f,{'type':db[_0x1165('0x59')][_0x1165('0x5a')][_0x1165('0x5b')],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x23344d){var _0x14b7f8=_['map'](_0x23344d,function(_0x3c6538){return Number(_0x3c6538['FaxQueueId']);});return db['UserFaxQueue'][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'FaxQueueId':{'$in':_0x14b7f8}},'transaction':_0x4c9bbb});})['then'](function(){var _0x28960d=_0x1165('0x68')+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0x28960d,{'type':db[_0x1165('0x59')]['QueryTypes'][_0x1165('0x5b')],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x4684c8){var _0x3b6495=_[_0x1165('0x33')](_0x4684c8,function(_0x360e66){return Number(_0x360e66[_0x1165('0x69')]);});return db['UserOpenchannelQueue'][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'OpenchannelQueueId':{'$in':_0x3b6495}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){var _0x5db1c8=_0x1165('0x6a')+_0x59326d;return db[_0x1165('0x60')][_0x1165('0x35')](_0x5db1c8,{'type':db[_0x1165('0x59')][_0x1165('0x5a')][_0x1165('0x5b')],'raw':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x58b209){var _0x2baf4d=_[_0x1165('0x33')](_0x58b209,function(_0x3eabbc){return Number(_0x3eabbc[_0x1165('0x6b')]);});return db['UserWhatsappQueue'][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'WhatsappQueueId':{'$in':_0x2baf4d}},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){return db[_0x1165('0x6c')][_0x1165('0x54')]({'where':{'TeamId':_0x59326d}});})[_0x1165('0x2b')](function(_0x3c3343){if(_0x3c3343===null){return;}return db[_0x1165('0x6d')][_0x1165('0x58')]({'where':{'UserId':{'$in':_0x5c6995},'VoicePrefixId':_0x3c3343[_0x1165('0x6e')]},'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(){return db['Team'][_0x1165('0x58')]({'where':{'id':_0x59326d},'cascade':!![],'transaction':_0x4c9bbb});})[_0x1165('0x2b')](function(_0x5f1d73){if(_0x5f1d73===0x0){_0x5dbfb0[_0x1165('0x2c')](0x194);}else{return db[_0x1165('0x56')][_0x1165('0x58')]({'where':{'type':_0x1165('0x52'),'resourceId':_0x59326d},'cascade':!![],'transaction':_0x4c9bbb})[_0x1165('0x2b')](function(){_0x5dbfb0[_0x1165('0x20')](0xcc)[_0x1165('0x1f')]();});}})[_0x1165('0x48')](function(_0x4f2b3b){_0x5dbfb0[_0x1165('0x20')](0x1f4)['send'](_0x4f2b3b);});});};exports[_0x1165('0x6f')]=function(_0x165d06,_0x3aca3e,_0x379a18){return db['Team'][_0x1165('0x70')]({'where':{'id':_0x165d06[_0x1165('0x4a')]['id']}})[_0x1165('0x2b')](handleEntityNotFound(_0x3aca3e,null))['then'](function(_0x5b45bf){if(!_0x165d06[_0x1165('0x35')][_0x1165('0x71')]||!utils[_0x1165('0x72')](_0x165d06['query'][_0x1165('0x71')])){throw new db[(_0x1165('0x59'))][(_0x1165('0x73'))]('Unknown\x20channel');}var _0x2dae48={};var _0x4acee8={};_0x4acee8[_0x1165('0x37')]=_[_0x1165('0x34')](db[_[_0x1165('0x74')](_0x165d06[_0x1165('0x35')]['channel']['toLowerCase']())+_0x1165('0x75')]['rawAttributes']);_0x4acee8['query']=_['keys'](_0x165d06[_0x1165('0x35')]);_0x4acee8[_0x1165('0x40')]=_[_0x1165('0x36')](_0x4acee8[_0x1165('0x37')],_0x4acee8[_0x1165('0x35')]);_0x2dae48['attributes']=_[_0x1165('0x36')](_0x4acee8[_0x1165('0x37')],qs[_0x1165('0x39')](_0x165d06[_0x1165('0x35')][_0x1165('0x39')]));_0x2dae48[_0x1165('0x38')]=_0x2dae48['attributes']['length']?_0x2dae48['attributes']:_0x4acee8[_0x1165('0x37')];_0x2dae48[_0x1165('0x23')]=qs[_0x1165('0x23')](_0x165d06[_0x1165('0x35')][_0x1165('0x23')]);_0x2dae48[_0x1165('0x21')]=qs[_0x1165('0x21')](_0x165d06['query']['offset']);_0x2dae48['order']=qs['sort'](_0x165d06[_0x1165('0x35')][_0x1165('0x3d')]);_0x2dae48[_0x1165('0x3e')]=qs['filters'](_[_0x1165('0x3f')](_0x165d06[_0x1165('0x35')],_0x4acee8[_0x1165('0x40')]));_0x2dae48=_['merge']({},_0x2dae48,_0x165d06[_0x1165('0x4b')]);return _0x5b45bf[_0x1165('0x51')+_[_0x1165('0x74')](_0x165d06[_0x1165('0x35')][_0x1165('0x71')]['toLowerCase']())+_0x1165('0x76')](_0x2dae48);})['then'](respondWithResult(_0x3aca3e,null))[_0x1165('0x48')](handleError(_0x3aca3e,null));};exports[_0x1165('0x77')]=function(_0x11cfd3,_0x146dfc,_0xd55701){return db[_0x1165('0x2f')][_0x1165('0x70')]({'where':{'id':_0x11cfd3[_0x1165('0x4a')]['id']}})[_0x1165('0x2b')](function(_0x56f9ea){if(_0x56f9ea){if(!_0x11cfd3[_0x1165('0x4d')][_0x1165('0x71')]||!utils[_0x1165('0x72')](_0x11cfd3[_0x1165('0x4d')][_0x1165('0x71')])){throw new db[(_0x1165('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x56f9ea['add'+_[_0x1165('0x74')](_0x11cfd3['body']['channel']['toLowerCase']())+'Queues'](_0x11cfd3[_0x1165('0x4d')][_0x1165('0x78')]);}return null;})['then'](handleEntityNotFound(_0x146dfc,null))[_0x1165('0x2b')](respondWithStatusCode(_0x146dfc,null))[_0x1165('0x48')](handleError(_0x146dfc,null));};exports[_0x1165('0x79')]=function(_0x529234,_0x451294,_0x2aed1f){return db[_0x1165('0x2f')][_0x1165('0x70')]({'where':{'id':_0x529234['params']['id']}})[_0x1165('0x2b')](function(_0x495d17){if(_0x495d17){if(!_0x529234[_0x1165('0x35')]['channel']||!utils['isValidChannel'](_0x529234[_0x1165('0x35')][_0x1165('0x71')])){throw new db[(_0x1165('0x59'))][(_0x1165('0x73'))](_0x1165('0x7a'));}return _0x495d17['remove'+_['capitalize'](_0x529234[_0x1165('0x35')][_0x1165('0x71')][_0x1165('0x7b')]())+'Queues'](_0x529234[_0x1165('0x35')][_0x1165('0x78')]);}return null;})[_0x1165('0x2b')](handleEntityNotFound(_0x451294,null))[_0x1165('0x2b')](respondWithStatusCode(_0x451294,null))[_0x1165('0x48')](handleError(_0x451294,null));};exports[_0x1165('0x7c')]=function(_0x42c9e4,_0x5f4f77){var _0x3c4df8=_[_0x1165('0x7d')](_0x42c9e4['body'][_0x1165('0x78')])?_0x42c9e4[_0x1165('0x4d')][_0x1165('0x78')]:[_0x42c9e4[_0x1165('0x4d')][_0x1165('0x78')]];var _0x4e1650=_0x42c9e4[_0x1165('0x4a')]['id'];return db['Team']['find']({'where':{'id':_0x4e1650}})['then'](handleEntityNotFound(_0x5f4f77,null))[_0x1165('0x2b')](function(_0x29474e){if(_0x29474e){var _0x1d0d1c=[_0x1165('0x7e'),_0x1165('0x7f'),_0x1165('0x80'),_0x1165('0x81'),_0x1165('0x82'),'Openchannel',_0x1165('0x83')];return db[_0x1165('0x60')][_0x1165('0x84')](function(_0xf2f61a){var _0x14d544=_['map'](_0x1d0d1c,function(_0x3aed5e){var _0xebf735={'attributes':['id','name']};if(_0x3aed5e===_0x1165('0x7e')){_0xebf735['through']={'attributes':['penalty']};}return _0x29474e[_0x1165('0x51')+_0x3aed5e+'Queues'](_0xebf735)[_0x1165('0x2b')](function(_0x43bce4){var _0x6080c=_['map'](_0x43bce4,function(_0x50841){var _0x221e18=_[_0x1165('0x33')](_0x3c4df8,function(_0xfcd9e1){var _0x42c5fe={'where':{'UserId':_0xfcd9e1,[_0x3aed5e+_0x1165('0x85')]:_0x50841['id']},'transaction':_0xf2f61a};if(_0x3aed5e===_0x1165('0x7e')){_0x42c5fe[_0x1165('0x86')]={'penalty':_0x50841[_0x1165('0x87')][_0x1165('0x88')]};}return db['User'+_0x3aed5e+_0x1165('0x75')][_0x1165('0x89')](_0x42c5fe)[_0x1165('0x2b')](function(){socket[_0x1165('0x8a')](_0x1165('0x4e')+_0x3aed5e+_0x1165('0x8b'),{'UserId':_0xfcd9e1,[_0x3aed5e+_0x1165('0x85')]:_0x50841['id']});if(_0x3aed5e!=='Voice'){return;}return db[_0x1165('0x8c')][_0x1165('0x46')]({'where':{'id':_0x3c4df8,'online':0x1},'attributes':['id',_0x1165('0x2e'),_0x1165('0x8d'),'voicePause','interface'],'raw':!![]})['then'](function(_0xef9eb4){var _0x28120a=_[_0x1165('0x33')](_0xef9eb4,function(_0x1fd4cc){return db[_0x1165('0x8e')][_0x1165('0x8f')]({'membername':_0x1fd4cc['name'],'UserId':_0x1fd4cc['id'],'queue_name':_0x50841['name'],'VoiceQueueId':_0x50841['id'],'interface':_[_0x1165('0x90')](_0x1fd4cc['interface'])?util[_0x1165('0x91')](_0x1165('0x92'),_0x1fd4cc[_0x1165('0x2e')]):_0x1fd4cc['interface'],'paused':_0x1fd4cc['voicePause']||![],'penalty':_0x50841[_0x1165('0x87')][_0x1165('0x88')]},{'transaction':_0xf2f61a});});return Promise['all'](_0x28120a);});});});return Promise['all'](_0x221e18);});return Promise[_0x1165('0x93')](_0x6080c);})['then'](function(){return db[_0x1165('0x6c')][_0x1165('0x70')]({'where':{'teamId':_0x4e1650}})[_0x1165('0x2b')](function(_0x1b2c7f){if(_0x1b2c7f){var _0xa38c6b=_[_0x1165('0x33')](_0x3c4df8,function(_0x4e044f){db['UserVoicePrefix'][_0x1165('0x8f')]({'UserId':_0x4e044f,'VoicePrefixId':_0x1b2c7f[_0x1165('0x6e')]});});return Promise[_0x1165('0x93')](_0xa38c6b);}});});});return Promise[_0x1165('0x93')](_0x14d544)[_0x1165('0x2b')](function(){return _0x29474e[_0x1165('0x7c')](_0x3c4df8,{'transaction':_0xf2f61a})[_0x1165('0x94')](function(_0xffbd41){return _0xffbd41;});});});}})[_0x1165('0x2b')](respondWithResult(_0x5f4f77,null))[_0x1165('0x48')](handleError(_0x5f4f77,null));};exports[_0x1165('0x95')]=function(_0x221013,_0x3ee5e7){var _0x36b88f=_[_0x1165('0x7d')](_0x221013[_0x1165('0x35')][_0x1165('0x78')])?_0x221013[_0x1165('0x35')][_0x1165('0x78')]:[_0x221013[_0x1165('0x35')][_0x1165('0x78')]];var _0x2777e9=_0x221013[_0x1165('0x4a')]['id'];return db[_0x1165('0x2f')]['find']({'where':{'id':_0x2777e9}})['then'](handleEntityNotFound(_0x3ee5e7,null))[_0x1165('0x2b')](function(_0xc816f4){if(_0xc816f4){var _0x460944=['Voice',_0x1165('0x7f'),_0x1165('0x80'),_0x1165('0x81'),'Fax',_0x1165('0x96'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x37141d){var _0x300812=_[_0x1165('0x33')](_0x460944,function(_0x2dfc16){var _0x1c9b14={'attributes':['id',_0x1165('0x2e')]};return _0xc816f4[_0x1165('0x51')+_0x2dfc16+'Queues'](_0x1c9b14)[_0x1165('0x2b')](function(_0x4d45a0){var _0x1a6581=_[_0x1165('0x33')](_0x4d45a0,function(_0x466e13){return _0x466e13[_0x1165('0x95')](_0x36b88f,{'transaction':_0x37141d})['then'](function(){var _0x58e131=_[_0x1165('0x33')](_0x36b88f,function(_0x37927b){socket['emit'](_0x1165('0x4e')+_0x2dfc16+_0x1165('0x97'),{'UserId':Number(_0x37927b),[_0x2dfc16+_0x1165('0x85')]:_0x466e13['id']});if(_0x2dfc16!=='Voice'){return;}return db[_0x1165('0x8e')][_0x1165('0x58')]({'where':{'VoiceQueueId':_0x466e13['id'],'UserId':_0x37927b},'transaction':_0x37141d});});return Promise['all'](_0x58e131);});});return Promise[_0x1165('0x93')](_0x1a6581);});});return Promise[_0x1165('0x93')](_0x300812)[_0x1165('0x2b')](function(){return _0xc816f4['removeAgents'](_0x36b88f,{'transaction':_0x37141d});})['then'](function(){return db[_0x1165('0x6c')][_0x1165('0x70')]({'where':{'teamId':_0x2777e9}})[_0x1165('0x2b')](function(_0xc06a5a){if(_0xc06a5a){var _0x302ef9=_[_0x1165('0x33')](_0x36b88f,function(_0x253f86){db[_0x1165('0x6d')]['destroy']({'where':{'UserId':_0x253f86,'VoicePrefixId':_0xc06a5a['VoicePrefixId']}});});return Promise[_0x1165('0x93')](_0x302ef9);}});});});}})[_0x1165('0x2b')](respondWithStatusCode(_0x3ee5e7,null))['catch'](handleError(_0x3ee5e7,null));};exports['getAgents']=function(_0x55c6d1,_0x68ecb3,_0x10a82b){var _0x1ec3e1={};var _0x20e3c0={};var _0x384989;var _0x1d70aa;return db[_0x1165('0x2f')][_0x1165('0x70')]({'where':{'id':_0x55c6d1[_0x1165('0x4a')]['id']}})['then'](handleEntityNotFound(_0x68ecb3,null))['then'](function(_0xbed386){if(_0xbed386){_0x384989=_0xbed386;_0x20e3c0['model']=_[_0x1165('0x34')](db[_0x1165('0x8c')][_0x1165('0x30')]);_0x20e3c0[_0x1165('0x35')]=_[_0x1165('0x34')](_0x55c6d1[_0x1165('0x35')]);_0x20e3c0[_0x1165('0x40')]=_[_0x1165('0x36')](_0x20e3c0[_0x1165('0x37')],_0x20e3c0[_0x1165('0x35')]);_0x1ec3e1[_0x1165('0x38')]=_[_0x1165('0x36')](_0x20e3c0[_0x1165('0x37')],qs[_0x1165('0x39')](_0x55c6d1[_0x1165('0x35')]['fields']));_0x1ec3e1[_0x1165('0x38')]=_0x1ec3e1['attributes'][_0x1165('0x3a')]?_0x1ec3e1[_0x1165('0x38')]:_0x20e3c0['model'];_0x1ec3e1[_0x1165('0x3c')]=qs[_0x1165('0x3d')](_0x55c6d1[_0x1165('0x35')][_0x1165('0x3d')]);_0x1ec3e1[_0x1165('0x3e')]=qs['filters'](_['pick'](_0x55c6d1['query'],_0x20e3c0[_0x1165('0x40')]));if(_0x55c6d1['query'][_0x1165('0x41')]){_0x1ec3e1[_0x1165('0x3e')]=_[_0x1165('0x43')](_0x1ec3e1[_0x1165('0x3e')],{'$or':_['map'](_0x1ec3e1['attributes'],function(_0x3a3463){var _0x1b30da={};_0x1b30da[_0x3a3463]={'$like':'%'+_0x55c6d1[_0x1165('0x35')]['filter']+'%'};return _0x1b30da;})});}_0x1ec3e1=_[_0x1165('0x43')]({},_0x1ec3e1,_0x55c6d1[_0x1165('0x4b')]);return _0x384989['getAgents'](_0x1ec3e1);}})[_0x1165('0x2b')](function(_0x5e9de7){if(_0x5e9de7){_0x1d70aa=_0x5e9de7[_0x1165('0x3a')];if(!_0x55c6d1['query']['hasOwnProperty'](_0x1165('0x3b'))){_0x1ec3e1[_0x1165('0x23')]=qs[_0x1165('0x23')](_0x55c6d1['query'][_0x1165('0x23')]);_0x1ec3e1[_0x1165('0x21')]=qs[_0x1165('0x21')](_0x55c6d1[_0x1165('0x35')]['offset']);}return _0x384989[_0x1165('0x98')](_0x1ec3e1);}})[_0x1165('0x2b')](function(_0xe352d8){if(_0xe352d8){return _0xe352d8?{'count':_0x1d70aa,'rows':_0xe352d8}:null;}})[_0x1165('0x2b')](respondWithResult(_0x68ecb3,null))['catch'](handleError(_0x68ecb3,null));}; \ No newline at end of file +var _0x6627=['redis','socket.io-emitter','./team.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Team','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserProfileResource','getQueues','findOne','channel','Unknown\x20channel','capitalize','toLowerCase','addQueues','isValidChannel','Queues','remove','addAgents','isArray','ids','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','penalty','TeamVoiceQueue','emit','Queue:save','QueueId','User','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','all','UserVoicePrefix','upsert','VoicePrefixId','spread','removeAgents','Queue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults'];(function(_0x32a2da,_0x2f6c05){var _0x2ea5e9=function(_0x4e0f12){while(--_0x4e0f12){_0x32a2da['push'](_0x32a2da['shift']());}};_0x2ea5e9(++_0x2f6c05);}(_0x6627,0x82));var _0x7662=function(_0x5128d5,_0x340941){_0x5128d5=_0x5128d5-0x0;var _0x2a64dc=_0x6627[_0x5128d5];return _0x2a64dc;};'use strict';var emlformat=require(_0x7662('0x0'));var rimraf=require(_0x7662('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7662('0x2'));var rp=require(_0x7662('0x3'));var moment=require('moment');var BPromise=require(_0x7662('0x4'));var Mustache=require(_0x7662('0x5'));var util=require(_0x7662('0x6'));var path=require(_0x7662('0x7'));var sox=require(_0x7662('0x8'));var csv=require(_0x7662('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7662('0xa'));var _=require(_0x7662('0xb'));var squel=require(_0x7662('0xc'));var crypto=require(_0x7662('0xd'));var jsforce=require(_0x7662('0xe'));var deskjs=require(_0x7662('0xf'));var toCsv=require(_0x7662('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7662('0x10'));var authService=require(_0x7662('0x11'));var qs=require(_0x7662('0x12'));var as=require(_0x7662('0x13'));var hardwareService=require(_0x7662('0x14'));var logger=require(_0x7662('0x15'))(_0x7662('0x16'));var utils=require(_0x7662('0x17'));var config=require(_0x7662('0x18'));var licenseUtil=require(_0x7662('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7662('0x1a')](config[_0x7662('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x7662('0x1c'))(new Redis(config[_0x7662('0x1b')]));require(_0x7662('0x1d'))['register'](socket);function respondWithStatusCode(_0x526b0b,_0x1c7618){_0x1c7618=_0x1c7618||0xcc;return function(_0x4c04dc){if(_0x4c04dc){return _0x526b0b[_0x7662('0x1e')](_0x1c7618);}return _0x526b0b[_0x7662('0x1f')](_0x1c7618)[_0x7662('0x20')]();};}function respondWithResult(_0x41492e,_0x3f62ce){_0x3f62ce=_0x3f62ce||0xc8;return function(_0x3251fa){if(_0x3251fa){return _0x41492e['status'](_0x3f62ce)['json'](_0x3251fa);}};}function respondWithFilteredResult(_0x5a579b,_0x5b477c){return function(_0x5cf56a){if(_0x5cf56a){var _0x35e33e=typeof _0x5b477c[_0x7662('0x21')]===_0x7662('0x22')&&typeof _0x5b477c['limit']===_0x7662('0x22');var _0x3a993d=_0x5cf56a[_0x7662('0x23')];var _0x374fa0=_0x35e33e?0x0:_0x5b477c[_0x7662('0x21')];var _0x1b139c=_0x35e33e?_0x5cf56a[_0x7662('0x23')]:_0x5b477c[_0x7662('0x21')]+_0x5b477c[_0x7662('0x24')];var _0x1b683a;if(_0x1b139c>=_0x3a993d){_0x1b139c=_0x3a993d;_0x1b683a=0xc8;}else{_0x1b683a=0xce;}_0x5a579b[_0x7662('0x1f')](_0x1b683a);return _0x5a579b[_0x7662('0x25')](_0x7662('0x26'),_0x374fa0+'-'+_0x1b139c+'/'+_0x3a993d)[_0x7662('0x27')](_0x5cf56a);}return null;};}function patchUpdates(_0x59eb95){return function(_0x50ec3c){try{jsonpatch[_0x7662('0x28')](_0x50ec3c,_0x59eb95,!![]);}catch(_0x43c24d){return BPromise[_0x7662('0x29')](_0x43c24d);}return _0x50ec3c[_0x7662('0x2a')]();};}function saveUpdates(_0x2fc3ce,_0x119d75){return function(_0x10470b){if(_0x10470b){return _0x10470b[_0x7662('0x2b')](_0x2fc3ce)[_0x7662('0x2c')](function(_0x6f243){return _0x6f243;});}return null;};}function handleEntityNotFound(_0x3d4e99,_0x35812e){return function(_0x2ffa5a){if(!_0x2ffa5a){_0x3d4e99['sendStatus'](0x194);}return _0x2ffa5a;};}function handleError(_0x504d5e,_0xacd69f){_0xacd69f=_0xacd69f||0x1f4;return function(_0x429f59){logger[_0x7662('0x2d')](_0x429f59[_0x7662('0x2e')]);if(_0x429f59[_0x7662('0x2f')]){delete _0x429f59[_0x7662('0x2f')];}_0x504d5e['status'](_0xacd69f)[_0x7662('0x30')](_0x429f59);};}exports[_0x7662('0x31')]=function(_0x882ad0,_0x2cb348){var _0x37097d={},_0xcb4b17={},_0x19bc6e={'count':0x0,'rows':[]};var _0x13b866=_['map'](db['Team'][_0x7662('0x32')],function(_0x1729e8){return{'name':_0x1729e8[_0x7662('0x33')],'type':_0x1729e8[_0x7662('0x34')][_0x7662('0x35')]};});_0xcb4b17[_0x7662('0x36')]=_[_0x7662('0x37')](_0x13b866,_0x7662('0x2f'));_0xcb4b17[_0x7662('0x38')]=_[_0x7662('0x39')](_0x882ad0[_0x7662('0x38')]);_0xcb4b17[_0x7662('0x3a')]=_[_0x7662('0x3b')](_0xcb4b17[_0x7662('0x36')],_0xcb4b17[_0x7662('0x38')]);_0x37097d['attributes']=_[_0x7662('0x3b')](_0xcb4b17[_0x7662('0x36')],qs[_0x7662('0x3c')](_0x882ad0['query']['fields']));_0x37097d[_0x7662('0x3d')]=_0x37097d[_0x7662('0x3d')][_0x7662('0x3e')]?_0x37097d[_0x7662('0x3d')]:_0xcb4b17[_0x7662('0x36')];if(!_0x882ad0[_0x7662('0x38')][_0x7662('0x3f')](_0x7662('0x40'))){_0x37097d[_0x7662('0x24')]=qs[_0x7662('0x24')](_0x882ad0[_0x7662('0x38')][_0x7662('0x24')]);_0x37097d[_0x7662('0x21')]=qs[_0x7662('0x21')](_0x882ad0[_0x7662('0x38')][_0x7662('0x21')]);}_0x37097d[_0x7662('0x41')]=qs['sort'](_0x882ad0[_0x7662('0x38')][_0x7662('0x42')]);_0x37097d[_0x7662('0x43')]=qs[_0x7662('0x3a')](_[_0x7662('0x44')](_0x882ad0[_0x7662('0x38')],_0xcb4b17[_0x7662('0x3a')]),_0x13b866);if(_0x882ad0['query']['filter']){_0x37097d['where']=_[_0x7662('0x45')](_0x37097d['where'],{'$or':_[_0x7662('0x37')](_0x13b866,function(_0x201d7e){if(_0x201d7e['type']!==_0x7662('0x46')){var _0x50bdf4={};_0x50bdf4[_0x201d7e[_0x7662('0x2f')]]={'$like':'%'+_0x882ad0[_0x7662('0x38')][_0x7662('0x47')]+'%'};return _0x50bdf4;}})});}_0x37097d=_['merge']({},_0x37097d,_0x882ad0[_0x7662('0x48')]);var _0x3d8763={'where':_0x37097d['where']};return db[_0x7662('0x49')][_0x7662('0x23')](_0x3d8763)[_0x7662('0x2c')](function(_0x5c1996){_0x19bc6e['count']=_0x5c1996;if(_0x882ad0['query'][_0x7662('0x4a')]){_0x37097d[_0x7662('0x4b')]=[{'all':!![]}];}return db[_0x7662('0x49')][_0x7662('0x4c')](_0x37097d);})['then'](function(_0x1899b9){_0x19bc6e[_0x7662('0x4d')]=_0x1899b9;return _0x19bc6e;})[_0x7662('0x2c')](respondWithFilteredResult(_0x2cb348,_0x37097d))[_0x7662('0x4e')](handleError(_0x2cb348,null));};exports['show']=function(_0x11a1ea,_0x130c16){var _0x14c282={'raw':![],'where':{'id':_0x11a1ea[_0x7662('0x4f')]['id']}},_0x38c59b={};_0x38c59b['model']=_[_0x7662('0x39')](db[_0x7662('0x49')][_0x7662('0x32')]);_0x38c59b[_0x7662('0x38')]=_[_0x7662('0x39')](_0x11a1ea[_0x7662('0x38')]);_0x38c59b['filters']=_[_0x7662('0x3b')](_0x38c59b['model'],_0x38c59b[_0x7662('0x38')]);_0x14c282['attributes']=_[_0x7662('0x3b')](_0x38c59b[_0x7662('0x36')],qs[_0x7662('0x3c')](_0x11a1ea[_0x7662('0x38')][_0x7662('0x3c')]));_0x14c282[_0x7662('0x3d')]=_0x14c282[_0x7662('0x3d')][_0x7662('0x3e')]?_0x14c282[_0x7662('0x3d')]:_0x38c59b[_0x7662('0x36')];if(_0x11a1ea[_0x7662('0x38')][_0x7662('0x4a')]){_0x14c282[_0x7662('0x4b')]=[{'all':!![]}];}_0x14c282=_['merge']({},_0x14c282,_0x11a1ea[_0x7662('0x48')]);return db['Team'][_0x7662('0x50')](_0x14c282)['then'](handleEntityNotFound(_0x130c16,null))[_0x7662('0x2c')](respondWithResult(_0x130c16,null))['catch'](handleError(_0x130c16,null));};exports[_0x7662('0x51')]=function(_0x3709c5,_0x45ff0e){return db[_0x7662('0x49')][_0x7662('0x51')](_0x3709c5[_0x7662('0x52')],{})[_0x7662('0x2c')](function(_0x2fbd52){var _0x410fdd=_0x3709c5[_0x7662('0x53')][_0x7662('0x54')]({'plain':!![]});if(!_0x410fdd)throw new Error(_0x7662('0x55'));if(_0x410fdd[_0x7662('0x56')]==='user'){var _0x518bee=_0x2fbd52[_0x7662('0x54')]({'plain':!![]});var _0x3412b8=_0x7662('0x57');return db[_0x7662('0x58')][_0x7662('0x50')]({'where':{'name':_0x3412b8,'userProfileId':_0x410fdd['userProfileId']},'raw':!![]})[_0x7662('0x2c')](function(_0x55749e){if(_0x55749e&&_0x55749e[_0x7662('0x59')]===0x0){return db['UserProfileResource'][_0x7662('0x51')]({'name':_0x518bee['name'],'resourceId':_0x518bee['id'],'type':_0x55749e[_0x7662('0x2f')],'sectionId':_0x55749e['id']},{})['then'](function(){return _0x2fbd52;});}else{return _0x2fbd52;}})[_0x7662('0x4e')](function(_0x18bea6){logger[_0x7662('0x2d')](_0x7662('0x5a'),_0x18bea6);throw _0x18bea6;});}return _0x2fbd52;})[_0x7662('0x2c')](respondWithResult(_0x45ff0e,0xc9))['catch'](handleError(_0x45ff0e,null));};exports['update']=function(_0x25972b,_0x351464){if(_0x25972b[_0x7662('0x52')]['id']){delete _0x25972b[_0x7662('0x52')]['id'];}return db[_0x7662('0x49')][_0x7662('0x50')]({'where':{'id':_0x25972b[_0x7662('0x4f')]['id']}})[_0x7662('0x2c')](handleEntityNotFound(_0x351464,null))[_0x7662('0x2c')](saveUpdates(_0x25972b[_0x7662('0x52')],null))['then'](respondWithResult(_0x351464,null))['catch'](handleError(_0x351464,null));};exports[_0x7662('0x5b')]=function(_0x4eaf2d,_0x1cc062){var _0x15e76f=_0x4eaf2d['params']['id'];var _0x5ae848=[];return db[_0x7662('0x5c')]['transaction'](function(_0x2b33ac){var _0x2e2c82=_0x7662('0x5d')+_0x15e76f;return db[_0x7662('0x5c')][_0x7662('0x38')](_0x2e2c82,{'type':db[_0x7662('0x5e')]['QueryTypes'][_0x7662('0x5f')],'raw':!![],'transaction':_0x2b33ac})['then'](function(_0x4ad4f7){_0x5ae848=_[_0x7662('0x37')](_0x4ad4f7,function(_0x378dbb){return Number(_0x378dbb[_0x7662('0x60')]);});})['then'](function(){var _0x1144c4='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15e76f;return db[_0x7662('0x5c')]['query'](_0x1144c4,{'type':db['Sequelize']['QueryTypes'][_0x7662('0x5f')],'raw':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x514bdf){var _0x3fcfd1=_['map'](_0x514bdf,function(_0x330f0d){return Number(_0x330f0d[_0x7662('0x61')]);});return db[_0x7662('0x62')]['destroy']({'where':{'UserId':{'$in':_0x5ae848},'VoiceQueueId':{'$in':_0x3fcfd1}},'transaction':_0x2b33ac});})['then'](function(){var _0x9d9fa7='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15e76f;return db['sequelize'][_0x7662('0x38')](_0x9d9fa7,{'type':db[_0x7662('0x5e')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2b33ac});})['then'](function(_0x3ad05d){var _0x488984=_[_0x7662('0x37')](_0x3ad05d,function(_0x36f0c8){return Number(_0x36f0c8[_0x7662('0x63')]);});return db[_0x7662('0x64')][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'MailQueueId':{'$in':_0x488984}},'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(){var _0x552a3e=_0x7662('0x65')+_0x15e76f;return db[_0x7662('0x5c')][_0x7662('0x38')](_0x552a3e,{'type':db[_0x7662('0x5e')]['QueryTypes'][_0x7662('0x5f')],'raw':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x2edcac){var _0x10b2c6=_['map'](_0x2edcac,function(_0x3e3fab){return Number(_0x3e3fab[_0x7662('0x66')]);});return db[_0x7662('0x67')]['destroy']({'where':{'UserId':{'$in':_0x5ae848},'SmsQueueId':{'$in':_0x10b2c6}},'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(){var _0x1614a4=_0x7662('0x68')+_0x15e76f;return db[_0x7662('0x5c')]['query'](_0x1614a4,{'type':db[_0x7662('0x5e')][_0x7662('0x69')]['SELECT'],'raw':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x3a0475){var _0x4ec9f0=_[_0x7662('0x37')](_0x3a0475,function(_0x768208){return Number(_0x768208[_0x7662('0x6a')]);});return db[_0x7662('0x6b')][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'ChatQueueId':{'$in':_0x4ec9f0}},'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(){var _0x224d46=_0x7662('0x6c')+_0x15e76f;return db['sequelize'][_0x7662('0x38')](_0x224d46,{'type':db[_0x7662('0x5e')][_0x7662('0x69')][_0x7662('0x5f')],'raw':!![],'transaction':_0x2b33ac});})['then'](function(_0x117b24){var _0x2153f4=_[_0x7662('0x37')](_0x117b24,function(_0x57a304){return Number(_0x57a304[_0x7662('0x6d')]);});return db['UserFaxQueue'][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'FaxQueueId':{'$in':_0x2153f4}},'transaction':_0x2b33ac});})['then'](function(){var _0x2429e4='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15e76f;return db[_0x7662('0x5c')]['query'](_0x2429e4,{'type':db[_0x7662('0x5e')][_0x7662('0x69')]['SELECT'],'raw':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x46f146){var _0x41f7cb=_[_0x7662('0x37')](_0x46f146,function(_0x1a91c1){return Number(_0x1a91c1['OpenchannelQueueId']);});return db[_0x7662('0x6e')][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'OpenchannelQueueId':{'$in':_0x41f7cb}},'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(){var _0x2dca5b=_0x7662('0x6f')+_0x15e76f;return db[_0x7662('0x5c')]['query'](_0x2dca5b,{'type':db[_0x7662('0x5e')][_0x7662('0x69')][_0x7662('0x5f')],'raw':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x56df5a){var _0x8555b3=_[_0x7662('0x37')](_0x56df5a,function(_0x549711){return Number(_0x549711[_0x7662('0x70')]);});return db['UserWhatsappQueue'][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'WhatsappQueueId':{'$in':_0x8555b3}},'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(){return db[_0x7662('0x71')][_0x7662('0x50')]({'where':{'TeamId':_0x15e76f}});})[_0x7662('0x2c')](function(_0x269859){if(_0x269859===null){return;}return db['UserVoicePrefix'][_0x7662('0x5b')]({'where':{'UserId':{'$in':_0x5ae848},'VoicePrefixId':_0x269859['VoicePrefixId']},'transaction':_0x2b33ac});})['then'](function(){return db[_0x7662('0x49')][_0x7662('0x5b')]({'where':{'id':_0x15e76f},'cascade':!![],'transaction':_0x2b33ac});})[_0x7662('0x2c')](function(_0x3beaa1){if(_0x3beaa1===0x0){_0x1cc062[_0x7662('0x1e')](0x194);}else{return db[_0x7662('0x72')][_0x7662('0x5b')]({'where':{'type':_0x7662('0x57'),'resourceId':_0x15e76f},'cascade':!![],'transaction':_0x2b33ac})[_0x7662('0x2c')](function(){_0x1cc062[_0x7662('0x1f')](0xcc)[_0x7662('0x20')]();});}})['catch'](function(_0x1dd5de){_0x1cc062['status'](0x1f4)[_0x7662('0x30')](_0x1dd5de);});});};exports[_0x7662('0x73')]=function(_0x1a7c3d,_0x35bb2a,_0x5c6297){return db['Team'][_0x7662('0x74')]({'where':{'id':_0x1a7c3d['params']['id']}})[_0x7662('0x2c')](handleEntityNotFound(_0x35bb2a,null))[_0x7662('0x2c')](function(_0x372cf3){if(!_0x1a7c3d[_0x7662('0x38')][_0x7662('0x75')]||!utils['isValidChannel'](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x75')])){throw new db[(_0x7662('0x5e'))]['ValidationError'](_0x7662('0x76'));}var _0x564f1d={};var _0x35d1b5={};_0x35d1b5[_0x7662('0x36')]=_[_0x7662('0x39')](db[_[_0x7662('0x77')](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x75')][_0x7662('0x78')]())+'Queue'][_0x7662('0x32')]);_0x35d1b5['query']=_[_0x7662('0x39')](_0x1a7c3d['query']);_0x35d1b5[_0x7662('0x3a')]=_[_0x7662('0x3b')](_0x35d1b5['model'],_0x35d1b5['query']);_0x564f1d[_0x7662('0x3d')]=_[_0x7662('0x3b')](_0x35d1b5[_0x7662('0x36')],qs['fields'](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x3c')]));_0x564f1d[_0x7662('0x3d')]=_0x564f1d[_0x7662('0x3d')]['length']?_0x564f1d[_0x7662('0x3d')]:_0x35d1b5[_0x7662('0x36')];_0x564f1d[_0x7662('0x24')]=qs['limit'](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x24')]);_0x564f1d[_0x7662('0x21')]=qs[_0x7662('0x21')](_0x1a7c3d['query'][_0x7662('0x21')]);_0x564f1d[_0x7662('0x41')]=qs[_0x7662('0x42')](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x42')]);_0x564f1d[_0x7662('0x43')]=qs[_0x7662('0x3a')](_['pick'](_0x1a7c3d[_0x7662('0x38')],_0x35d1b5[_0x7662('0x3a')]));_0x564f1d=_[_0x7662('0x45')]({},_0x564f1d,_0x1a7c3d['options']);return _0x372cf3['get'+_[_0x7662('0x77')](_0x1a7c3d[_0x7662('0x38')][_0x7662('0x75')][_0x7662('0x78')]())+'Queues'](_0x564f1d);})['then'](respondWithResult(_0x35bb2a,null))['catch'](handleError(_0x35bb2a,null));};exports[_0x7662('0x79')]=function(_0x24b231,_0x5cc3e2,_0xaf5a82){return db['Team'][_0x7662('0x74')]({'where':{'id':_0x24b231['params']['id']}})['then'](function(_0x4f9f2c){if(_0x4f9f2c){if(!_0x24b231[_0x7662('0x52')][_0x7662('0x75')]||!utils[_0x7662('0x7a')](_0x24b231[_0x7662('0x52')][_0x7662('0x75')])){throw new db[(_0x7662('0x5e'))]['ValidationError'](_0x7662('0x76'));}return _0x4f9f2c['add'+_[_0x7662('0x77')](_0x24b231[_0x7662('0x52')]['channel']['toLowerCase']())+_0x7662('0x7b')](_0x24b231[_0x7662('0x52')]['ids']);}return null;})[_0x7662('0x2c')](handleEntityNotFound(_0x5cc3e2,null))['then'](respondWithStatusCode(_0x5cc3e2,null))[_0x7662('0x4e')](handleError(_0x5cc3e2,null));};exports['removeQueues']=function(_0x1392ae,_0x3feda3,_0x3afd10){return db[_0x7662('0x49')]['findOne']({'where':{'id':_0x1392ae[_0x7662('0x4f')]['id']}})['then'](function(_0x523b41){if(_0x523b41){if(!_0x1392ae[_0x7662('0x38')]['channel']||!utils[_0x7662('0x7a')](_0x1392ae[_0x7662('0x38')][_0x7662('0x75')])){throw new db[(_0x7662('0x5e'))]['ValidationError'](_0x7662('0x76'));}return _0x523b41[_0x7662('0x7c')+_[_0x7662('0x77')](_0x1392ae[_0x7662('0x38')][_0x7662('0x75')][_0x7662('0x78')]())+_0x7662('0x7b')](_0x1392ae['query']['ids']);}return null;})[_0x7662('0x2c')](handleEntityNotFound(_0x3feda3,null))[_0x7662('0x2c')](respondWithStatusCode(_0x3feda3,null))[_0x7662('0x4e')](handleError(_0x3feda3,null));};exports[_0x7662('0x7d')]=function(_0x16d616,_0x3d1e90){var _0x108ad2=_[_0x7662('0x7e')](_0x16d616[_0x7662('0x52')][_0x7662('0x7f')])?_0x16d616[_0x7662('0x52')][_0x7662('0x7f')]:[_0x16d616[_0x7662('0x52')][_0x7662('0x7f')]];var _0x81fd31=_0x16d616[_0x7662('0x4f')]['id'];return db[_0x7662('0x49')][_0x7662('0x50')]({'where':{'id':_0x81fd31}})[_0x7662('0x2c')](handleEntityNotFound(_0x3d1e90,null))[_0x7662('0x2c')](function(_0x4269d6){if(_0x4269d6){var _0x5da585=['Voice',_0x7662('0x80'),_0x7662('0x81'),_0x7662('0x82'),_0x7662('0x83'),_0x7662('0x84'),_0x7662('0x85')];return db['sequelize'][_0x7662('0x86')](function(_0x36229e){var _0x4b241f=_[_0x7662('0x37')](_0x5da585,function(_0x24bd84){var _0x2d58ac={'attributes':['id','name']};if(_0x24bd84===_0x7662('0x87')){_0x2d58ac[_0x7662('0x88')]={'attributes':[_0x7662('0x89')]};}return _0x4269d6[_0x7662('0x54')+_0x24bd84+_0x7662('0x7b')](_0x2d58ac)[_0x7662('0x2c')](function(_0x183b6d){var _0x56425d=_[_0x7662('0x37')](_0x183b6d,function(_0x3fa40b){var _0x15c14e=_[_0x7662('0x37')](_0x108ad2,function(_0x376f5b){var _0x26536e={'where':{'UserId':_0x376f5b,[_0x24bd84+'QueueId']:_0x3fa40b['id']},'transaction':_0x36229e};if(_0x24bd84===_0x7662('0x87')){_0x26536e['defaults']={'penalty':_0x3fa40b[_0x7662('0x8a')][_0x7662('0x89')]};}return db['User'+_0x24bd84+'Queue']['findOrCreate'](_0x26536e)[_0x7662('0x2c')](function(){socket[_0x7662('0x8b')](_0x7662('0x53')+_0x24bd84+_0x7662('0x8c'),{'UserId':_0x376f5b,[_0x24bd84+_0x7662('0x8d')]:_0x3fa40b['id']});if(_0x24bd84!==_0x7662('0x87')){return;}return db[_0x7662('0x8e')][_0x7662('0x4c')]({'where':{'id':_0x108ad2,'online':0x1},'attributes':['id','name',_0x7662('0x8f'),_0x7662('0x90'),_0x7662('0x91')],'raw':!![]})[_0x7662('0x2c')](function(_0x4193a9){var _0x1e860e=_[_0x7662('0x37')](_0x4193a9,function(_0x56e258){return db[_0x7662('0x92')]['upsert']({'membername':_0x56e258['name'],'UserId':_0x56e258['id'],'queue_name':_0x3fa40b[_0x7662('0x2f')],'VoiceQueueId':_0x3fa40b['id'],'interface':_['isNil'](_0x56e258[_0x7662('0x91')])?util[_0x7662('0x93')](_0x7662('0x94'),_0x56e258['name']):_0x56e258['interface'],'paused':_0x56e258[_0x7662('0x90')]||![],'penalty':_0x3fa40b[_0x7662('0x8a')]['penalty']},{'transaction':_0x36229e});});return Promise[_0x7662('0x95')](_0x1e860e);});});});return Promise[_0x7662('0x95')](_0x15c14e);});return Promise[_0x7662('0x95')](_0x56425d);})[_0x7662('0x2c')](function(){return db[_0x7662('0x71')][_0x7662('0x74')]({'where':{'teamId':_0x81fd31}})['then'](function(_0x48d852){if(_0x48d852){var _0x54fd24=_[_0x7662('0x37')](_0x108ad2,function(_0xef053e){db[_0x7662('0x96')][_0x7662('0x97')]({'UserId':_0xef053e,'VoicePrefixId':_0x48d852[_0x7662('0x98')]});});return Promise[_0x7662('0x95')](_0x54fd24);}});});});return Promise[_0x7662('0x95')](_0x4b241f)[_0x7662('0x2c')](function(){return _0x4269d6[_0x7662('0x7d')](_0x108ad2,{'transaction':_0x36229e})[_0x7662('0x99')](function(_0x1164d2){return _0x1164d2;});});});}})['then'](respondWithResult(_0x3d1e90,null))[_0x7662('0x4e')](handleError(_0x3d1e90,null));};exports[_0x7662('0x9a')]=function(_0x2c0315,_0x48690f){var _0x273bd0=_[_0x7662('0x7e')](_0x2c0315[_0x7662('0x38')][_0x7662('0x7f')])?_0x2c0315[_0x7662('0x38')][_0x7662('0x7f')]:[_0x2c0315['query'][_0x7662('0x7f')]];var _0x11144b=_0x2c0315[_0x7662('0x4f')]['id'];return db['Team']['find']({'where':{'id':_0x11144b}})[_0x7662('0x2c')](handleEntityNotFound(_0x48690f,null))[_0x7662('0x2c')](function(_0x2b87df){if(_0x2b87df){var _0x3aa874=[_0x7662('0x87'),_0x7662('0x80'),'Mail','Sms',_0x7662('0x83'),_0x7662('0x84'),_0x7662('0x85')];return db['sequelize'][_0x7662('0x86')](function(_0x4150ff){var _0x2a4fa5=_[_0x7662('0x37')](_0x3aa874,function(_0x180de8){var _0xd961b7={'attributes':['id',_0x7662('0x2f')]};return _0x2b87df['get'+_0x180de8+_0x7662('0x7b')](_0xd961b7)[_0x7662('0x2c')](function(_0x16960a){var _0x46fa24=_[_0x7662('0x37')](_0x16960a,function(_0x535fe2){return _0x535fe2[_0x7662('0x9a')](_0x273bd0,{'transaction':_0x4150ff})[_0x7662('0x2c')](function(){var _0x69f09b=_[_0x7662('0x37')](_0x273bd0,function(_0x3c7d52){socket[_0x7662('0x8b')](_0x7662('0x53')+_0x180de8+_0x7662('0x9b'),{'UserId':Number(_0x3c7d52),[_0x180de8+'QueueId']:_0x535fe2['id']});if(_0x180de8!==_0x7662('0x87')){return;}return db[_0x7662('0x92')][_0x7662('0x5b')]({'where':{'VoiceQueueId':_0x535fe2['id'],'UserId':_0x3c7d52},'transaction':_0x4150ff});});return Promise[_0x7662('0x95')](_0x69f09b);});});return Promise[_0x7662('0x95')](_0x46fa24);});});return Promise[_0x7662('0x95')](_0x2a4fa5)[_0x7662('0x2c')](function(){return _0x2b87df[_0x7662('0x9a')](_0x273bd0,{'transaction':_0x4150ff});})[_0x7662('0x2c')](function(){return db['TeamVoicePrefix'][_0x7662('0x74')]({'where':{'teamId':_0x11144b}})[_0x7662('0x2c')](function(_0x34ec61){if(_0x34ec61){var _0x5ab6ad=_[_0x7662('0x37')](_0x273bd0,function(_0x14ccf2){db[_0x7662('0x96')][_0x7662('0x5b')]({'where':{'UserId':_0x14ccf2,'VoicePrefixId':_0x34ec61['VoicePrefixId']}});});return Promise[_0x7662('0x95')](_0x5ab6ad);}});});});}})['then'](respondWithStatusCode(_0x48690f,null))[_0x7662('0x4e')](handleError(_0x48690f,null));};exports[_0x7662('0x9c')]=function(_0x292365,_0xe246b7,_0x395366){var _0x46df92={};var _0x58b101={};var _0x5311e3;var _0x33aacd;return db['Team'][_0x7662('0x74')]({'where':{'id':_0x292365[_0x7662('0x4f')]['id']}})['then'](handleEntityNotFound(_0xe246b7,null))['then'](function(_0x5bfa5e){if(_0x5bfa5e){_0x5311e3=_0x5bfa5e;_0x58b101['model']=_['keys'](db[_0x7662('0x8e')]['rawAttributes']);_0x58b101[_0x7662('0x38')]=_[_0x7662('0x39')](_0x292365['query']);_0x58b101[_0x7662('0x3a')]=_[_0x7662('0x3b')](_0x58b101[_0x7662('0x36')],_0x58b101['query']);_0x46df92[_0x7662('0x3d')]=_[_0x7662('0x3b')](_0x58b101[_0x7662('0x36')],qs['fields'](_0x292365['query'][_0x7662('0x3c')]));_0x46df92['attributes']=_0x46df92[_0x7662('0x3d')][_0x7662('0x3e')]?_0x46df92[_0x7662('0x3d')]:_0x58b101[_0x7662('0x36')];_0x46df92[_0x7662('0x41')]=qs['sort'](_0x292365[_0x7662('0x38')][_0x7662('0x42')]);_0x46df92[_0x7662('0x43')]=qs['filters'](_[_0x7662('0x44')](_0x292365[_0x7662('0x38')],_0x58b101[_0x7662('0x3a')]));if(_0x292365[_0x7662('0x38')]['filter']){_0x46df92[_0x7662('0x43')]=_[_0x7662('0x45')](_0x46df92[_0x7662('0x43')],{'$or':_[_0x7662('0x37')](_0x46df92[_0x7662('0x3d')],function(_0x498722){var _0x51310f={};_0x51310f[_0x498722]={'$like':'%'+_0x292365[_0x7662('0x38')]['filter']+'%'};return _0x51310f;})});}_0x46df92=_['merge']({},_0x46df92,_0x292365[_0x7662('0x48')]);return _0x5311e3['getAgents'](_0x46df92);}})['then'](function(_0x51fa92){if(_0x51fa92){_0x33aacd=_0x51fa92[_0x7662('0x3e')];if(!_0x292365['query'][_0x7662('0x3f')](_0x7662('0x40'))){_0x46df92['limit']=qs[_0x7662('0x24')](_0x292365[_0x7662('0x38')][_0x7662('0x24')]);_0x46df92[_0x7662('0x21')]=qs[_0x7662('0x21')](_0x292365[_0x7662('0x38')][_0x7662('0x21')]);}return _0x5311e3[_0x7662('0x9c')](_0x46df92);}})['then'](function(_0x1d5dbf){if(_0x1d5dbf){return _0x1d5dbf?{'count':_0x33aacd,'rows':_0x1d5dbf}:null;}})['then'](respondWithResult(_0xe246b7,null))[_0x7662('0x4e')](handleError(_0xe246b7,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e5c5958..3f10c07 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 _0x40f4=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x575c17,_0x58cf05){var _0x4be569=function(_0x1b8c4e){while(--_0x1b8c4e){_0x575c17['push'](_0x575c17['shift']());}};_0x4be569(++_0x58cf05);}(_0x40f4,0x148));var _0x440f=function(_0x14ae01,_0x861682){_0x14ae01=_0x14ae01-0x0;var _0x4cdfaa=_0x40f4[_0x14ae01];return _0x4cdfaa;};'use strict';var EventEmitter=require(_0x440f('0x0'));var Team=require(_0x440f('0x1'))['db'][_0x440f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x440f('0x3')](0x0);var events={'afterCreate':_0x440f('0x4'),'afterUpdate':_0x440f('0x5'),'afterDestroy':_0x440f('0x6')};function emitEvent(_0xbaa677){return function(_0x915d4c,_0x4dec61,_0x582ddf){TeamEvents[_0x440f('0x7')](_0xbaa677+':'+_0x915d4c['id'],_0x915d4c);TeamEvents[_0x440f('0x7')](_0xbaa677,_0x915d4c);_0x582ddf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x308c=['exports','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x492145,_0x29e885){var _0x2f8f7f=function(_0x351dc1){while(--_0x351dc1){_0x492145['push'](_0x492145['shift']());}};_0x2f8f7f(++_0x29e885);}(_0x308c,0x6f));var _0xc308=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x308c[_0x49b207];return _0x2dc8fa;};'use strict';var EventEmitter=require('events');var Team=require(_0xc308('0x0'))['db'][_0xc308('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc308('0x2')](0x0);var events={'afterCreate':_0xc308('0x3'),'afterUpdate':_0xc308('0x4'),'afterDestroy':_0xc308('0x5')};function emitEvent(_0x54b08c){return function(_0x467bd9,_0x3221f5,_0x4be0b1){TeamEvents['emit'](_0x54b08c+':'+_0x467bd9['id'],_0x467bd9);TeamEvents[_0xc308('0x6')](_0x54b08c,_0x467bd9);_0x4be0b1(null);};}for(var e in events){if(events[_0xc308('0x7')](e)){var event=events[e];Team[_0xc308('0x8')](e,emitEvent(event));}}module[_0xc308('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ce32389..4421ea7 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 _0x2781=['exports','define','Team','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./team.attributes'];(function(_0x15371a,_0x1ba987){var _0x5c87bd=function(_0x1109da){while(--_0x1109da){_0x15371a['push'](_0x15371a['shift']());}};_0x5c87bd(++_0x1ba987);}(_0x2781,0x183));var _0x1278=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2781[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x1278('0x0'));var logger=require(_0x1278('0x1'))(_0x1278('0x2'));var moment=require(_0x1278('0x3'));var BPromise=require('bluebird');var rp=require(_0x1278('0x4'));var fs=require('fs');var path=require(_0x1278('0x5'));var rimraf=require(_0x1278('0x6'));var config=require(_0x1278('0x7'));var attributes=require(_0x1278('0x8'));module[_0x1278('0x9')]=function(_0x50d9ee,_0x490e06){return _0x50d9ee[_0x1278('0xa')](_0x1278('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa426=['../../config/logger','api','moment','bluebird','request-promise','path','./team.attributes','exports','Team','teams','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa426,0xe2));var _0x6a42=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa426[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x6a42('0x0'));var util=require(_0x6a42('0x1'));var logger=require(_0x6a42('0x2'))(_0x6a42('0x3'));var moment=require(_0x6a42('0x4'));var BPromise=require(_0x6a42('0x5'));var rp=require(_0x6a42('0x6'));var fs=require('fs');var path=require(_0x6a42('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a42('0x8'));module[_0x6a42('0x9')]=function(_0x339088,_0xff3b35){return _0x339088['define'](_0x6a42('0xa'),attributes,{'tableName':_0x6a42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 87762a1..d1884d7 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 _0xe5a0=['Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./team.socket','register','request','then','info'];(function(_0x1e7383,_0x5e50dc){var _0x3a8d8c=function(_0x5bee66){while(--_0x5bee66){_0x1e7383['push'](_0x1e7383['shift']());}};_0x3a8d8c(++_0x5e50dc);}(_0xe5a0,0xcd));var _0x0e5a=function(_0x275d9e,_0x3e91e2){_0x275d9e=_0x275d9e-0x0;var _0x2a61d0=_0xe5a0[_0x275d9e];return _0x2a61d0;};'use strict';var _=require(_0x0e5a('0x0'));var util=require(_0x0e5a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e5a('0x2'));var fs=require('fs');var Redis=require(_0x0e5a('0x3'));var db=require(_0x0e5a('0x4'))['db'];var utils=require(_0x0e5a('0x5'));var logger=require(_0x0e5a('0x6'))(_0x0e5a('0x7'));var config=require(_0x0e5a('0x8'));var jayson=require(_0x0e5a('0x9'));var client=jayson[_0x0e5a('0xa')]['http']({'port':0x232a});config[_0x0e5a('0xb')]=_[_0x0e5a('0xc')](config[_0x0e5a('0xb')],{'host':_0x0e5a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e5a('0xb')]));require(_0x0e5a('0xe'))[_0x0e5a('0xf')](socket);function respondWithRpcPromise(_0x4b4390,_0x1b1788,_0x23066b){return new BPromise(function(_0x2ca3ab,_0x2f353b){return client[_0x0e5a('0x10')](_0x4b4390,_0x23066b)[_0x0e5a('0x11')](function(_0x5b5d74){logger[_0x0e5a('0x12')](_0x0e5a('0x13'),_0x1b1788,_0x0e5a('0x14'));logger['debug'](_0x0e5a('0x15'),_0x1b1788,'request\x20sent',JSON[_0x0e5a('0x16')](_0x5b5d74));if(_0x5b5d74['error']){if(_0x5b5d74[_0x0e5a('0x17')][_0x0e5a('0x18')]===0x1f4){logger[_0x0e5a('0x17')](_0x0e5a('0x13'),_0x1b1788,_0x5b5d74[_0x0e5a('0x17')]['message']);return _0x2f353b(_0x5b5d74[_0x0e5a('0x17')][_0x0e5a('0x19')]);}logger[_0x0e5a('0x17')](_0x0e5a('0x13'),_0x1b1788,_0x5b5d74[_0x0e5a('0x17')][_0x0e5a('0x19')]);return _0x2ca3ab(_0x5b5d74['error'][_0x0e5a('0x19')]);}else{logger[_0x0e5a('0x12')](_0x0e5a('0x13'),_0x1b1788,'request\x20sent');_0x2ca3ab(_0x5b5d74[_0x0e5a('0x1a')]['message']);}})[_0x0e5a('0x1b')](function(_0xc3cb78){logger[_0x0e5a('0x17')]('Team,\x20%s,\x20%s',_0x1b1788,_0xc3cb78);_0x2f353b(_0xc3cb78);});});} \ No newline at end of file +var _0x14c4=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','util'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x14c4,0xbc));var _0x414c=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x14c4[_0x3c858f];return _0x198090;};'use strict';var _=require('lodash');var util=require(_0x414c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x414c('0x1'));var fs=require('fs');var Redis=require(_0x414c('0x2'));var db=require(_0x414c('0x3'))['db'];var utils=require(_0x414c('0x4'));var logger=require(_0x414c('0x5'))('rpc');var config=require(_0x414c('0x6'));var jayson=require(_0x414c('0x7'));var client=jayson[_0x414c('0x8')]['http']({'port':0x232a});config[_0x414c('0x9')]=_[_0x414c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x414c('0xb'))(new Redis(config[_0x414c('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x3f0458,_0x237fa4,_0x2f9007){return new BPromise(function(_0x375dfe,_0x44a64d){return client[_0x414c('0xc')](_0x3f0458,_0x2f9007)[_0x414c('0xd')](function(_0x4a3725){logger[_0x414c('0xe')](_0x414c('0xf'),_0x237fa4,_0x414c('0x10'));logger[_0x414c('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x237fa4,'request\x20sent',JSON['stringify'](_0x4a3725));if(_0x4a3725[_0x414c('0x12')]){if(_0x4a3725[_0x414c('0x12')]['code']===0x1f4){logger[_0x414c('0x12')]('Team,\x20%s,\x20%s',_0x237fa4,_0x4a3725[_0x414c('0x12')][_0x414c('0x13')]);return _0x44a64d(_0x4a3725[_0x414c('0x12')][_0x414c('0x13')]);}logger['error'](_0x414c('0xf'),_0x237fa4,_0x4a3725[_0x414c('0x12')]['message']);return _0x375dfe(_0x4a3725[_0x414c('0x12')][_0x414c('0x13')]);}else{logger['info'](_0x414c('0xf'),_0x237fa4,_0x414c('0x10'));_0x375dfe(_0x4a3725['result'][_0x414c('0x13')]);}})[_0x414c('0x14')](function(_0x9d1f0e){logger[_0x414c('0x12')]('Team,\x20%s,\x20%s',_0x237fa4,_0x9d1f0e);_0x44a64d(_0x9d1f0e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a6c518d..961c5f2 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 _0xca91=['update','emit','removeListener','register','./team.events','save','remove'];(function(_0x21d8f6,_0x76bc58){var _0x154b1c=function(_0x59842b){while(--_0x59842b){_0x21d8f6['push'](_0x21d8f6['shift']());}};_0x154b1c(++_0x76bc58);}(_0xca91,0x1d2));var _0x1ca9=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0xca91[_0x54fbff];return _0x5cf619;};'use strict';var TeamEvents=require(_0x1ca9('0x0'));var events=[_0x1ca9('0x1'),_0x1ca9('0x2'),_0x1ca9('0x3')];function createListener(_0x46c4f1,_0x1cb6d7){return function(_0x180a1e){_0x1cb6d7[_0x1ca9('0x4')](_0x46c4f1,_0x180a1e);};}function removeListener(_0x17e8c8,_0xa98958){return function(){TeamEvents[_0x1ca9('0x5')](_0x17e8c8,_0xa98958);};}exports[_0x1ca9('0x6')]=function(_0x1c8919){for(var _0x4137d0=0x0,_0x3471fe=events['length'];_0x4137d0<_0x3471fe;_0x4137d0++){var _0x41d468=events[_0x4137d0];var _0x1eb56b=createListener('team:'+_0x41d468,_0x1c8919);TeamEvents['on'](_0x41d468,_0x1eb56b);}}; \ No newline at end of file +var _0x1ebd=['removeListener','register','length','team:','./team.events','save','remove','emit'];(function(_0x3b8c54,_0x50d5cb){var _0x8a302f=function(_0x4e222d){while(--_0x4e222d){_0x3b8c54['push'](_0x3b8c54['shift']());}};_0x8a302f(++_0x50d5cb);}(_0x1ebd,0x64));var _0xd1eb=function(_0x226aa0,_0x548f44){_0x226aa0=_0x226aa0-0x0;var _0x4ad413=_0x1ebd[_0x226aa0];return _0x4ad413;};'use strict';var TeamEvents=require(_0xd1eb('0x0'));var events=[_0xd1eb('0x1'),_0xd1eb('0x2'),'update'];function createListener(_0x37e607,_0x2b61e0){return function(_0x2c2171){_0x2b61e0[_0xd1eb('0x3')](_0x37e607,_0x2c2171);};}function removeListener(_0x48993c,_0x4f3a2a){return function(){TeamEvents[_0xd1eb('0x4')](_0x48993c,_0x4f3a2a);};}exports[_0xd1eb('0x5')]=function(_0x536a93){for(var _0x2f050e=0x0,_0xb4c88d=events[_0xd1eb('0x6')];_0x2f050e<_0xb4c88d;_0x2f050e++){var _0x5ea9bf=events[_0x2f050e];var _0x33ce51=createListener(_0xd1eb('0x7')+_0x5ea9bf,_0x536a93);TeamEvents['on'](_0x5ea9bf,_0x33ce51);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c825022..786fcbe 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 _0x325b=['INTEGER','sequelize','exports'];(function(_0x426d1d,_0x5f364d){var _0x18366a=function(_0x17f90b){while(--_0x17f90b){_0x426d1d['push'](_0x426d1d['shift']());}};_0x18366a(++_0x5f364d);}(_0x325b,0x8b));var _0xb325=function(_0x260787,_0x2f295b){_0x260787=_0x260787-0x0;var _0x1d6047=_0x325b[_0x260787];return _0x1d6047;};'use strict';var Sequelize=require(_0xb325('0x0'));module[_0xb325('0x1')]={'TeamId':{'type':Sequelize[_0xb325('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0f93=['exports','INTEGER'];(function(_0x47f93f,_0x4a15f4){var _0x59f494=function(_0x3ddcfa){while(--_0x3ddcfa){_0x47f93f['push'](_0x47f93f['shift']());}};_0x59f494(++_0x4a15f4);}(_0x0f93,0x66));var _0x30f9=function(_0xe544f,_0x523488){_0xe544f=_0xe544f-0x0;var _0x1155fd=_0x0f93[_0xe544f];return _0x1155fd;};'use strict';var Sequelize=require('sequelize');module[_0x30f9('0x0')]={'TeamId':{'type':Sequelize[_0x30f9('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x30f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6276fcc..a0be7a1 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 _0x2fc9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','util'];(function(_0x49b473,_0x5cb5e6){var _0x479fbc=function(_0x59d157){while(--_0x59d157){_0x49b473['push'](_0x49b473['shift']());}};_0x479fbc(++_0x5cb5e6);}(_0x2fc9,0xc2));var _0x92fc=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x2fc9[_0x3070dc];return _0x431489;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var logger=require(_0x92fc('0x1'))(_0x92fc('0x2'));var moment=require(_0x92fc('0x3'));var BPromise=require(_0x92fc('0x4'));var rp=require(_0x92fc('0x5'));var fs=require('fs');var path=require(_0x92fc('0x6'));var rimraf=require(_0x92fc('0x7'));var config=require(_0x92fc('0x8'));var attributes=require(_0x92fc('0x9'));module[_0x92fc('0xa')]=function(_0x5d492e,_0x580d4a){return _0x5d492e['define'](_0x92fc('0xb'),attributes,{'tableName':_0x92fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88a6=['TeamVoicePrefix','util','../../config/logger','moment','bluebird','request-promise','path','./teamVoicePrefix.attributes','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x88a6,0x121));var _0x688a=function(_0x472ca8,_0x2c8c37){_0x472ca8=_0x472ca8-0x0;var _0x14c783=_0x88a6[_0x472ca8];return _0x14c783;};'use strict';var _=require('lodash');var util=require(_0x688a('0x0'));var logger=require(_0x688a('0x1'))('api');var moment=require(_0x688a('0x2'));var BPromise=require(_0x688a('0x3'));var rp=require(_0x688a('0x4'));var fs=require('fs');var path=require(_0x688a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x688a('0x6'));module['exports']=function(_0x1743a3,_0x357896){return _0x1743a3[_0x688a('0x7')](_0x688a('0x8'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 531852d..1a858d5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2545e5,_0x874fb){var _0x4fd9b2=function(_0x1d4dc2){while(--_0x1d4dc2){_0x2545e5['push'](_0x2545e5['shift']());}};_0x4fd9b2(++_0x874fb);}(_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(_0x15c319,_0x167933){var _0x5e781b=function(_0x4e0e9a){while(--_0x4e0e9a){_0x15c319['push'](_0x15c319['shift']());}};_0x5e781b(++_0x167933);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 26029ea..c5cdc03 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 _0xe1e5=['sequelize','exports','INTEGER'];(function(_0x18a79a,_0x2d5fc9){var _0x2cbf2c=function(_0x105319){while(--_0x105319){_0x18a79a['push'](_0x18a79a['shift']());}};_0x2cbf2c(++_0x2d5fc9);}(_0xe1e5,0x156));var _0x5e1e=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xe1e5[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x5e1e('0x0'));module[_0x5e1e('0x1')]={'penalty':{'type':Sequelize[_0x5e1e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x55ad=['INTEGER','sequelize'];(function(_0x5b3790,_0x33e018){var _0x33eeae=function(_0xe70b79){while(--_0xe70b79){_0x5b3790['push'](_0x5b3790['shift']());}};_0x33eeae(++_0x33e018);}(_0x55ad,0x1dd));var _0xd55a=function(_0x26c673,_0x594f7a){_0x26c673=_0x26c673-0x0;var _0x14c924=_0x55ad[_0x26c673];return _0x14c924;};'use strict';var Sequelize=require(_0xd55a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd55a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 0b670df..fba2805 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 _0x1501=['bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api'];(function(_0x332d50,_0x590aef){var _0x2be0e1=function(_0x119f82){while(--_0x119f82){_0x332d50['push'](_0x332d50['shift']());}};_0x2be0e1(++_0x590aef);}(_0x1501,0x126));var _0x1150=function(_0x923e53,_0x2cc867){_0x923e53=_0x923e53-0x0;var _0x4d0120=_0x1501[_0x923e53];return _0x4d0120;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5712=['bluebird','request-promise','path','rimraf','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4f77dd,_0xfe2afa){var _0x276d0a=function(_0x19d1f3){while(--_0x19d1f3){_0x4f77dd['push'](_0x4f77dd['shift']());}};_0x276d0a(++_0xfe2afa);}(_0x5712,0x140));var _0x2571=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5712[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var logger=require(_0x2571('0x2'))(_0x2571('0x3'));var moment=require(_0x2571('0x4'));var BPromise=require(_0x2571('0x5'));var rp=require(_0x2571('0x6'));var fs=require('fs');var path=require(_0x2571('0x7'));var rimraf=require(_0x2571('0x8'));var config=require(_0x2571('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x4713ad,_0x50fc72){return _0x4713ad[_0x2571('0xa')](_0x2571('0xb'),attributes,{'tableName':_0x2571('0xc'),'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 c66a0fe..3421fbc 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 _0xc7a4=['jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x113503,_0x28dd19){var _0x5366da=function(_0x3edbbb){while(--_0x3edbbb){_0x113503['push'](_0x113503['shift']());}};_0x5366da(++_0x28dd19);}(_0xc7a4,0x8b));var _0x4c7a=function(_0x17ca32,_0x5a8cec){_0x17ca32=_0x17ca32-0x0;var _0x2c9ae1=_0xc7a4[_0x17ca32];return _0x2c9ae1;};'use strict';var _=require(_0x4c7a('0x0'));var util=require(_0x4c7a('0x1'));var moment=require(_0x4c7a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c7a('0x3'));var db=require(_0x4c7a('0x4'))['db'];var utils=require(_0x4c7a('0x5'));var logger=require(_0x4c7a('0x6'))(_0x4c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c7a('0x8'));var client=jayson[_0x4c7a('0x9')][_0x4c7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b213,_0x30ac05,_0x5b246a){return new BPromise(function(_0x2ac39b,_0x5f4763){return client[_0x4c7a('0xb')](_0x31b213,_0x5b246a)['then'](function(_0xefde54){logger[_0x4c7a('0xc')](_0x4c7a('0xd'),_0x30ac05,_0x4c7a('0xe'));logger[_0x4c7a('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x30ac05,_0x4c7a('0xe'),JSON[_0x4c7a('0x10')](_0xefde54));if(_0xefde54['error']){if(_0xefde54[_0x4c7a('0x11')][_0x4c7a('0x12')]===0x1f4){logger['error'](_0x4c7a('0xd'),_0x30ac05,_0xefde54[_0x4c7a('0x11')][_0x4c7a('0x13')]);return _0x5f4763(_0xefde54[_0x4c7a('0x11')][_0x4c7a('0x13')]);}logger[_0x4c7a('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x30ac05,_0xefde54[_0x4c7a('0x11')]['message']);return _0x2ac39b(_0xefde54[_0x4c7a('0x11')][_0x4c7a('0x13')]);}else{logger['info'](_0x4c7a('0xd'),_0x30ac05,_0x4c7a('0xe'));_0x2ac39b(_0xefde54[_0x4c7a('0x14')][_0x4c7a('0x13')]);}})['catch'](function(_0x156e28){logger[_0x4c7a('0x11')](_0x4c7a('0xd'),_0x30ac05,_0x156e28);_0x5f4763(_0x156e28);});});} \ No newline at end of file +var _0x0ec2=['client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x0ec2,0x72));var _0x20ec=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x0ec2[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require(_0x20ec('0x0'));var util=require('util');var moment=require(_0x20ec('0x1'));var BPromise=require(_0x20ec('0x2'));var rs=require(_0x20ec('0x3'));var fs=require('fs');var Redis=require(_0x20ec('0x4'));var db=require(_0x20ec('0x5'))['db'];var utils=require(_0x20ec('0x6'));var logger=require(_0x20ec('0x7'))(_0x20ec('0x8'));var config=require(_0x20ec('0x9'));var jayson=require(_0x20ec('0xa'));var client=jayson[_0x20ec('0xb')][_0x20ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x206398,_0x223215,_0x12f5b2){return new BPromise(function(_0x505472,_0x3fe13e){return client['request'](_0x206398,_0x12f5b2)[_0x20ec('0xd')](function(_0x3d2ad2){logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));logger[_0x20ec('0x11')](_0x20ec('0x12'),_0x223215,_0x20ec('0x10'),JSON[_0x20ec('0x13')](_0x3d2ad2));if(_0x3d2ad2[_0x20ec('0x14')]){if(_0x3d2ad2['error'][_0x20ec('0x15')]===0x1f4){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);return _0x3fe13e(_0x3d2ad2['error']['message']);}logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2['error'][_0x20ec('0x16')]);return _0x505472(_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);}else{logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));_0x505472(_0x3d2ad2[_0x20ec('0x17')][_0x20ec('0x16')]);}})[_0x20ec('0x18')](function(_0x32a33b){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x32a33b);_0x3fe13e(_0x32a33b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5909c91..9f009fc 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 _0x6dc0=['get','/:id','show','post','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','isAuthenticated'];(function(_0x5a25f6,_0x3db5cb){var _0x5a524d=function(_0x11f0fd){while(--_0x11f0fd){_0x5a25f6['push'](_0x5a25f6['shift']());}};_0x5a524d(++_0x3db5cb);}(_0x6dc0,0xb6));var _0x06dc=function(_0x26fa14,_0x28eb85){_0x26fa14=_0x26fa14-0x0;var _0x2fa92b=_0x6dc0[_0x26fa14];return _0x2fa92b;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var fs_extra=require(_0x06dc('0x5'));var auth=require(_0x06dc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x06dc('0x7'));var controller=require(_0x06dc('0x8'));router['get']('/',auth[_0x06dc('0x9')](),controller['index']);router[_0x06dc('0xa')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xc')]);router[_0x06dc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller['update']);router[_0x06dc('0xe')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xf')]);module['exports']=router; \ No newline at end of file +var _0x82d8=['get','isAuthenticated','index','/:id','post','create','delete','exports','multer','path','Router','../../components/auth/service','./template.controller'];(function(_0x1412f1,_0x436110){var _0xbe96b=function(_0xb11546){while(--_0xb11546){_0x1412f1['push'](_0x1412f1['shift']());}};_0xbe96b(++_0x436110);}(_0x82d8,0xff));var _0x882d=function(_0x3e8c6c,_0x39e48b){_0x3e8c6c=_0x3e8c6c-0x0;var _0x5b2d68=_0x82d8[_0x3e8c6c];return _0x5b2d68;};'use strict';var multer=require(_0x882d('0x0'));var util=require('util');var path=require(_0x882d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x882d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x882d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x882d('0x4'));router[_0x882d('0x5')]('/',auth[_0x882d('0x6')](),controller[_0x882d('0x7')]);router[_0x882d('0x5')](_0x882d('0x8'),auth[_0x882d('0x6')](),controller['show']);router[_0x882d('0x9')]('/',auth[_0x882d('0x6')](),controller[_0x882d('0xa')]);router['put'](_0x882d('0x8'),auth[_0x882d('0x6')](),controller['update']);router[_0x882d('0xb')](_0x882d('0x8'),auth[_0x882d('0x6')](),controller['destroy']);module[_0x882d('0xc')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 30d1b1b..7644cdf 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 _0x07c1=['TEXT','sequelize','exports','STRING'];(function(_0xdb951d,_0x1dc42b){var _0x5e789e=function(_0x1056cd){while(--_0x1056cd){_0xdb951d['push'](_0xdb951d['shift']());}};_0x5e789e(++_0x1dc42b);}(_0x07c1,0x1e1));var _0x107c=function(_0x18f8f2,_0x351d62){_0x18f8f2=_0x18f8f2-0x0;var _0x32e7d8=_0x07c1[_0x18f8f2];return _0x32e7d8;};'use strict';var Sequelize=require(_0x107c('0x0'));module[_0x107c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x107c('0x2')]},'html':{'type':Sequelize[_0x107c('0x3')]}}; \ No newline at end of file +var _0x70d7=['STRING','TEXT','exports'];(function(_0x42457d,_0x42b9fc){var _0x2bcda2=function(_0x5854ef){while(--_0x5854ef){_0x42457d['push'](_0x42457d['shift']());}};_0x2bcda2(++_0x42b9fc);}(_0x70d7,0x110));var _0x770d=function(_0xe4db28,_0x4b59c6){_0xe4db28=_0xe4db28-0x0;var _0x49a32f=_0x70d7[_0xe4db28];return _0x49a32f;};'use strict';var Sequelize=require('sequelize');module[_0x770d('0x0')]={'name':{'type':Sequelize[_0x770d('0x1')]},'description':{'type':Sequelize[_0x770d('0x1')]},'html':{'type':Sequelize[_0x770d('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8d2c20d..4c4d126 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 _0xff61=['show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','then','UserProfileResource','destroy','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows'];(function(_0x534af9,_0x1fa0a8){var _0x1a79dd=function(_0x257495){while(--_0x257495){_0x534af9['push'](_0x534af9['shift']());}};_0x1a79dd(++_0x1fa0a8);}(_0xff61,0x19e));var _0x1ff6=function(_0x5b6aad,_0x3d2d66){_0x5b6aad=_0x5b6aad-0x0;var _0x288128=_0xff61[_0x5b6aad];return _0x288128;};'use strict';var emlformat=require(_0x1ff6('0x0'));var rimraf=require(_0x1ff6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ff6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ff6('0x3'));var Mustache=require(_0x1ff6('0x4'));var util=require(_0x1ff6('0x5'));var path=require(_0x1ff6('0x6'));var sox=require('sox');var csv=require(_0x1ff6('0x7'));var ejs=require(_0x1ff6('0x8'));var fs=require('fs');var fs_extra=require(_0x1ff6('0x9'));var _=require('lodash');var squel=require(_0x1ff6('0xa'));var crypto=require(_0x1ff6('0xb'));var jsforce=require(_0x1ff6('0xc'));var deskjs=require(_0x1ff6('0xd'));var toCsv=require(_0x1ff6('0x7'));var querystring=require(_0x1ff6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ff6('0xf'));var qs=require(_0x1ff6('0x10'));var as=require(_0x1ff6('0x11'));var hardwareService=require(_0x1ff6('0x12'));var logger=require(_0x1ff6('0x13'))('api');var utils=require(_0x1ff6('0x14'));var config=require(_0x1ff6('0x15'));var licenseUtil=require(_0x1ff6('0x16'));var db=require(_0x1ff6('0x17'))['db'];function respondWithStatusCode(_0x4b8b2c,_0x2c00f0){_0x2c00f0=_0x2c00f0||0xcc;return function(_0x2cd4ab){if(_0x2cd4ab){return _0x4b8b2c[_0x1ff6('0x18')](_0x2c00f0);}return _0x4b8b2c[_0x1ff6('0x19')](_0x2c00f0)[_0x1ff6('0x1a')]();};}function respondWithResult(_0x3eedf0,_0x2f329d){_0x2f329d=_0x2f329d||0xc8;return function(_0x3efc2b){if(_0x3efc2b){return _0x3eedf0[_0x1ff6('0x19')](_0x2f329d)['json'](_0x3efc2b);}};}function respondWithFilteredResult(_0x5d7f7e,_0x5c9551){return function(_0x1a9181){if(_0x1a9181){var _0x1a3cfe=typeof _0x5c9551[_0x1ff6('0x1b')]==='undefined'&&typeof _0x5c9551[_0x1ff6('0x1c')]==='undefined';var _0x5c1790=_0x1a9181[_0x1ff6('0x1d')];var _0x657e86=_0x1a3cfe?0x0:_0x5c9551[_0x1ff6('0x1b')];var _0x464473=_0x1a3cfe?_0x1a9181[_0x1ff6('0x1d')]:_0x5c9551['offset']+_0x5c9551[_0x1ff6('0x1c')];var _0x167413;if(_0x464473>=_0x5c1790){_0x464473=_0x5c1790;_0x167413=0xc8;}else{_0x167413=0xce;}_0x5d7f7e['status'](_0x167413);return _0x5d7f7e[_0x1ff6('0x1e')]('Content-Range',_0x657e86+'-'+_0x464473+'/'+_0x5c1790)[_0x1ff6('0x1f')](_0x1a9181);}return null;};}function patchUpdates(_0x1c58bd){return function(_0x548f6a){try{jsonpatch[_0x1ff6('0x20')](_0x548f6a,_0x1c58bd,!![]);}catch(_0x12a432){return BPromise[_0x1ff6('0x21')](_0x12a432);}return _0x548f6a['save']();};}function saveUpdates(_0x109acd,_0x32ad1c){return function(_0x5bac48){if(_0x5bac48){return _0x5bac48[_0x1ff6('0x22')](_0x109acd)['then'](function(_0x1eef89){return _0x1eef89;});}return null;};}function removeEntity(_0x1503a0,_0x244e0a){return function(_0x1e1715){if(_0x1e1715){return _0x1e1715['destroy']()[_0x1ff6('0x23')](function(){var _0x5324d1=_0x1e1715['get']({'plain':!![]});var _0x5b007f='Templates';return db[_0x1ff6('0x24')][_0x1ff6('0x25')]({'where':{'type':_0x5b007f,'resourceId':_0x5324d1['id']}})[_0x1ff6('0x23')](function(){return _0x1e1715;});})[_0x1ff6('0x23')](function(){_0x1503a0[_0x1ff6('0x19')](0xcc)[_0x1ff6('0x1a')]();});}};}function handleEntityNotFound(_0x5da504,_0x22231c){return function(_0x138d75){if(!_0x138d75){_0x5da504[_0x1ff6('0x18')](0x194);}return _0x138d75;};}function handleError(_0x907a4e,_0x4d0fa9){_0x4d0fa9=_0x4d0fa9||0x1f4;return function(_0x2f5655){logger['error'](_0x2f5655[_0x1ff6('0x26')]);if(_0x2f5655['name']){delete _0x2f5655[_0x1ff6('0x27')];}_0x907a4e[_0x1ff6('0x19')](_0x4d0fa9)[_0x1ff6('0x28')](_0x2f5655);};}exports[_0x1ff6('0x29')]=function(_0x539a72,_0x2a05e4){var _0x504413={},_0x220dfc={},_0x2af50b={'count':0x0,'rows':[]};var _0x2ef1a4=_[_0x1ff6('0x2a')](db[_0x1ff6('0x2b')][_0x1ff6('0x2c')],function(_0x4c010b){return{'name':_0x4c010b[_0x1ff6('0x2d')],'type':_0x4c010b[_0x1ff6('0x2e')]['key']};});_0x220dfc[_0x1ff6('0x2f')]=_[_0x1ff6('0x2a')](_0x2ef1a4,_0x1ff6('0x27'));_0x220dfc[_0x1ff6('0x30')]=_[_0x1ff6('0x31')](_0x539a72[_0x1ff6('0x30')]);_0x220dfc[_0x1ff6('0x32')]=_[_0x1ff6('0x33')](_0x220dfc[_0x1ff6('0x2f')],_0x220dfc[_0x1ff6('0x30')]);_0x504413[_0x1ff6('0x34')]=_[_0x1ff6('0x33')](_0x220dfc[_0x1ff6('0x2f')],qs[_0x1ff6('0x35')](_0x539a72['query'][_0x1ff6('0x35')]));_0x504413['attributes']=_0x504413[_0x1ff6('0x34')][_0x1ff6('0x36')]?_0x504413[_0x1ff6('0x34')]:_0x220dfc['model'];if(!_0x539a72['query'][_0x1ff6('0x37')](_0x1ff6('0x38'))){_0x504413[_0x1ff6('0x1c')]=qs[_0x1ff6('0x1c')](_0x539a72['query'][_0x1ff6('0x1c')]);_0x504413[_0x1ff6('0x1b')]=qs[_0x1ff6('0x1b')](_0x539a72[_0x1ff6('0x30')][_0x1ff6('0x1b')]);}_0x504413['order']=qs[_0x1ff6('0x39')](_0x539a72[_0x1ff6('0x30')][_0x1ff6('0x39')]);_0x504413[_0x1ff6('0x3a')]=qs['filters'](_[_0x1ff6('0x3b')](_0x539a72[_0x1ff6('0x30')],_0x220dfc[_0x1ff6('0x32')]),_0x2ef1a4);if(_0x539a72['query'][_0x1ff6('0x3c')]){_0x504413[_0x1ff6('0x3a')]=_[_0x1ff6('0x3d')](_0x504413[_0x1ff6('0x3a')],{'$or':_[_0x1ff6('0x2a')](_0x2ef1a4,function(_0x1e2eb9){if(_0x1e2eb9[_0x1ff6('0x2e')]!==_0x1ff6('0x3e')){var _0x525174={};_0x525174[_0x1e2eb9[_0x1ff6('0x27')]]={'$like':'%'+_0x539a72[_0x1ff6('0x30')][_0x1ff6('0x3c')]+'%'};return _0x525174;}})});}_0x504413=_[_0x1ff6('0x3d')]({},_0x504413,_0x539a72['options']);var _0x4d530b={'where':_0x504413[_0x1ff6('0x3a')]};return db[_0x1ff6('0x2b')][_0x1ff6('0x1d')](_0x4d530b)[_0x1ff6('0x23')](function(_0x99d8a8){_0x2af50b['count']=_0x99d8a8;if(_0x539a72['query']['includeAll']){_0x504413[_0x1ff6('0x3f')]=[{'all':!![]}];}return db[_0x1ff6('0x2b')][_0x1ff6('0x40')](_0x504413);})[_0x1ff6('0x23')](function(_0x13f057){_0x2af50b[_0x1ff6('0x41')]=_0x13f057;return _0x2af50b;})[_0x1ff6('0x23')](respondWithFilteredResult(_0x2a05e4,_0x504413))['catch'](handleError(_0x2a05e4,null));};exports[_0x1ff6('0x42')]=function(_0xcdb222,_0x2951e7){var _0x11a796={'raw':!![],'where':{'id':_0xcdb222[_0x1ff6('0x43')]['id']}},_0x4cb99e={};_0x4cb99e[_0x1ff6('0x2f')]=_[_0x1ff6('0x31')](db[_0x1ff6('0x2b')]['rawAttributes']);_0x4cb99e[_0x1ff6('0x30')]=_[_0x1ff6('0x31')](_0xcdb222[_0x1ff6('0x30')]);_0x4cb99e[_0x1ff6('0x32')]=_[_0x1ff6('0x33')](_0x4cb99e[_0x1ff6('0x2f')],_0x4cb99e[_0x1ff6('0x30')]);_0x11a796[_0x1ff6('0x34')]=_['intersection'](_0x4cb99e[_0x1ff6('0x2f')],qs[_0x1ff6('0x35')](_0xcdb222[_0x1ff6('0x30')][_0x1ff6('0x35')]));_0x11a796['attributes']=_0x11a796[_0x1ff6('0x34')][_0x1ff6('0x36')]?_0x11a796[_0x1ff6('0x34')]:_0x4cb99e[_0x1ff6('0x2f')];if(_0xcdb222[_0x1ff6('0x30')][_0x1ff6('0x44')]){_0x11a796[_0x1ff6('0x3f')]=[{'all':!![]}];}_0x11a796=_[_0x1ff6('0x3d')]({},_0x11a796,_0xcdb222['options']);return db[_0x1ff6('0x2b')][_0x1ff6('0x45')](_0x11a796)[_0x1ff6('0x23')](handleEntityNotFound(_0x2951e7,null))[_0x1ff6('0x23')](respondWithResult(_0x2951e7,null))['catch'](handleError(_0x2951e7,null));};exports[_0x1ff6('0x46')]=function(_0x229f14,_0xa9029b){return db['Template']['create'](_0x229f14[_0x1ff6('0x47')],{})['then'](function(_0x44bd83){var _0x1a2c8e=_0x229f14[_0x1ff6('0x48')]['get']({'plain':!![]});if(!_0x1a2c8e)throw new Error(_0x1ff6('0x49'));if(_0x1a2c8e[_0x1ff6('0x4a')]===_0x1ff6('0x48')){var _0x47be70=_0x44bd83['get']({'plain':!![]});var _0xb5d8e1=_0x1ff6('0x4b');return db[_0x1ff6('0x4c')]['find']({'where':{'name':_0xb5d8e1,'userProfileId':_0x1a2c8e[_0x1ff6('0x4d')]},'raw':!![]})[_0x1ff6('0x23')](function(_0x24cbf4){if(_0x24cbf4&&_0x24cbf4['autoAssociation']===0x0){return db[_0x1ff6('0x24')]['create']({'name':_0x47be70[_0x1ff6('0x27')],'resourceId':_0x47be70['id'],'type':_0x24cbf4[_0x1ff6('0x27')],'sectionId':_0x24cbf4['id']},{})[_0x1ff6('0x23')](function(){return _0x44bd83;});}else{return _0x44bd83;}})[_0x1ff6('0x4e')](function(_0x2ce176){logger['error'](_0x1ff6('0x4f'),_0x2ce176);throw _0x2ce176;});}return _0x44bd83;})[_0x1ff6('0x23')](respondWithResult(_0xa9029b,0xc9))[_0x1ff6('0x4e')](handleError(_0xa9029b,null));};exports[_0x1ff6('0x22')]=function(_0x3395e9,_0x2ee5bc){if(_0x3395e9[_0x1ff6('0x47')]['id']){delete _0x3395e9[_0x1ff6('0x47')]['id'];}return db[_0x1ff6('0x2b')]['find']({'where':{'id':_0x3395e9[_0x1ff6('0x43')]['id']}})[_0x1ff6('0x23')](handleEntityNotFound(_0x2ee5bc,null))['then'](saveUpdates(_0x3395e9[_0x1ff6('0x47')],null))[_0x1ff6('0x23')](respondWithResult(_0x2ee5bc,null))['catch'](handleError(_0x2ee5bc,null));};exports[_0x1ff6('0x25')]=function(_0x386c6b,_0x29731a){return db[_0x1ff6('0x2b')][_0x1ff6('0x45')]({'where':{'id':_0x386c6b['params']['id']}})[_0x1ff6('0x23')](handleEntityNotFound(_0x29731a,null))[_0x1ff6('0x23')](removeEntity(_0x29731a,null))['catch'](handleError(_0x29731a,null));}; \ No newline at end of file +var _0x49b3=['hasOwnProperty','nolimit','order','sort','pick','merge','where','includeAll','findAll','rows','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x262c16,_0x899a11){var _0x19e2ed=function(_0x55b812){while(--_0x55b812){_0x262c16['push'](_0x262c16['shift']());}};_0x19e2ed(++_0x899a11);}(_0x49b3,0x69));var _0x349b=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x49b3[_0x59c301];return _0x3866b9;};'use strict';var emlformat=require(_0x349b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x349b('0x1'));var jsonpatch=require(_0x349b('0x2'));var rp=require(_0x349b('0x3'));var moment=require(_0x349b('0x4'));var BPromise=require(_0x349b('0x5'));var Mustache=require(_0x349b('0x6'));var util=require(_0x349b('0x7'));var path=require(_0x349b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x349b('0x9'));var _=require(_0x349b('0xa'));var squel=require(_0x349b('0xb'));var crypto=require(_0x349b('0xc'));var jsforce=require(_0x349b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x349b('0xe'));var Papa=require(_0x349b('0xf'));var Redis=require('ioredis');var authService=require(_0x349b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x349b('0x11'));var hardwareService=require(_0x349b('0x12'));var logger=require(_0x349b('0x13'))(_0x349b('0x14'));var utils=require(_0x349b('0x15'));var config=require(_0x349b('0x16'));var licenseUtil=require(_0x349b('0x17'));var db=require(_0x349b('0x18'))['db'];function respondWithStatusCode(_0x3c10d2,_0x60c1f3){_0x60c1f3=_0x60c1f3||0xcc;return function(_0x4ca186){if(_0x4ca186){return _0x3c10d2[_0x349b('0x19')](_0x60c1f3);}return _0x3c10d2[_0x349b('0x1a')](_0x60c1f3)['end']();};}function respondWithResult(_0x304879,_0x88e64b){_0x88e64b=_0x88e64b||0xc8;return function(_0x2ac13e){if(_0x2ac13e){return _0x304879[_0x349b('0x1a')](_0x88e64b)['json'](_0x2ac13e);}};}function respondWithFilteredResult(_0x3b151b,_0x43c457){return function(_0x232697){if(_0x232697){var _0x5725b1=typeof _0x43c457[_0x349b('0x1b')]===_0x349b('0x1c')&&typeof _0x43c457[_0x349b('0x1d')]==='undefined';var _0x440a3c=_0x232697[_0x349b('0x1e')];var _0x4559ff=_0x5725b1?0x0:_0x43c457['offset'];var _0x3b9c1d=_0x5725b1?_0x232697[_0x349b('0x1e')]:_0x43c457['offset']+_0x43c457[_0x349b('0x1d')];var _0x3cd0db;if(_0x3b9c1d>=_0x440a3c){_0x3b9c1d=_0x440a3c;_0x3cd0db=0xc8;}else{_0x3cd0db=0xce;}_0x3b151b['status'](_0x3cd0db);return _0x3b151b[_0x349b('0x1f')](_0x349b('0x20'),_0x4559ff+'-'+_0x3b9c1d+'/'+_0x440a3c)[_0x349b('0x21')](_0x232697);}return null;};}function patchUpdates(_0x35e0f1){return function(_0x4b53d9){try{jsonpatch[_0x349b('0x22')](_0x4b53d9,_0x35e0f1,!![]);}catch(_0x566edf){return BPromise[_0x349b('0x23')](_0x566edf);}return _0x4b53d9[_0x349b('0x24')]();};}function saveUpdates(_0x14bce1,_0x5ab5ab){return function(_0x16dced){if(_0x16dced){return _0x16dced[_0x349b('0x25')](_0x14bce1)[_0x349b('0x26')](function(_0x4d748a){return _0x4d748a;});}return null;};}function removeEntity(_0x209a63,_0x53e041){return function(_0x3a4fde){if(_0x3a4fde){return _0x3a4fde[_0x349b('0x27')]()[_0x349b('0x26')](function(){var _0x37ac04=_0x3a4fde[_0x349b('0x28')]({'plain':!![]});var _0x2f8195=_0x349b('0x29');return db[_0x349b('0x2a')][_0x349b('0x27')]({'where':{'type':_0x2f8195,'resourceId':_0x37ac04['id']}})['then'](function(){return _0x3a4fde;});})['then'](function(){_0x209a63['status'](0xcc)[_0x349b('0x2b')]();});}};}function handleEntityNotFound(_0x3b9f1b,_0x7f006c){return function(_0x3a4e13){if(!_0x3a4e13){_0x3b9f1b[_0x349b('0x19')](0x194);}return _0x3a4e13;};}function handleError(_0x7087ca,_0x334e51){_0x334e51=_0x334e51||0x1f4;return function(_0x402608){logger[_0x349b('0x2c')](_0x402608[_0x349b('0x2d')]);if(_0x402608[_0x349b('0x2e')]){delete _0x402608[_0x349b('0x2e')];}_0x7087ca[_0x349b('0x1a')](_0x334e51)[_0x349b('0x2f')](_0x402608);};}exports['index']=function(_0x4d8cf9,_0x44214e){var _0x120f70={},_0x4ea172={},_0x2abff5={'count':0x0,'rows':[]};var _0x16bc3f=_[_0x349b('0x30')](db[_0x349b('0x31')][_0x349b('0x32')],function(_0x53c8ce){return{'name':_0x53c8ce[_0x349b('0x33')],'type':_0x53c8ce[_0x349b('0x34')][_0x349b('0x35')]};});_0x4ea172[_0x349b('0x36')]=_[_0x349b('0x30')](_0x16bc3f,'name');_0x4ea172['query']=_['keys'](_0x4d8cf9[_0x349b('0x37')]);_0x4ea172[_0x349b('0x38')]=_[_0x349b('0x39')](_0x4ea172[_0x349b('0x36')],_0x4ea172[_0x349b('0x37')]);_0x120f70[_0x349b('0x3a')]=_[_0x349b('0x39')](_0x4ea172[_0x349b('0x36')],qs[_0x349b('0x3b')](_0x4d8cf9[_0x349b('0x37')][_0x349b('0x3b')]));_0x120f70[_0x349b('0x3a')]=_0x120f70[_0x349b('0x3a')][_0x349b('0x3c')]?_0x120f70[_0x349b('0x3a')]:_0x4ea172['model'];if(!_0x4d8cf9[_0x349b('0x37')][_0x349b('0x3d')](_0x349b('0x3e'))){_0x120f70[_0x349b('0x1d')]=qs[_0x349b('0x1d')](_0x4d8cf9[_0x349b('0x37')][_0x349b('0x1d')]);_0x120f70[_0x349b('0x1b')]=qs['offset'](_0x4d8cf9[_0x349b('0x37')]['offset']);}_0x120f70[_0x349b('0x3f')]=qs[_0x349b('0x40')](_0x4d8cf9[_0x349b('0x37')][_0x349b('0x40')]);_0x120f70['where']=qs[_0x349b('0x38')](_[_0x349b('0x41')](_0x4d8cf9[_0x349b('0x37')],_0x4ea172[_0x349b('0x38')]),_0x16bc3f);if(_0x4d8cf9[_0x349b('0x37')]['filter']){_0x120f70['where']=_[_0x349b('0x42')](_0x120f70['where'],{'$or':_['map'](_0x16bc3f,function(_0x3857df){if(_0x3857df[_0x349b('0x34')]!=='VIRTUAL'){var _0x1e81ac={};_0x1e81ac[_0x3857df[_0x349b('0x2e')]]={'$like':'%'+_0x4d8cf9['query']['filter']+'%'};return _0x1e81ac;}})});}_0x120f70=_[_0x349b('0x42')]({},_0x120f70,_0x4d8cf9['options']);var _0x163b7d={'where':_0x120f70[_0x349b('0x43')]};return db[_0x349b('0x31')]['count'](_0x163b7d)[_0x349b('0x26')](function(_0x442ffc){_0x2abff5['count']=_0x442ffc;if(_0x4d8cf9[_0x349b('0x37')][_0x349b('0x44')]){_0x120f70['include']=[{'all':!![]}];}return db[_0x349b('0x31')][_0x349b('0x45')](_0x120f70);})[_0x349b('0x26')](function(_0x2331f4){_0x2abff5[_0x349b('0x46')]=_0x2331f4;return _0x2abff5;})[_0x349b('0x26')](respondWithFilteredResult(_0x44214e,_0x120f70))['catch'](handleError(_0x44214e,null));};exports['show']=function(_0x1f4121,_0x2d05d4){var _0x3b0655={'raw':!![],'where':{'id':_0x1f4121['params']['id']}},_0x190493={};_0x190493[_0x349b('0x36')]=_[_0x349b('0x47')](db['Template'][_0x349b('0x32')]);_0x190493[_0x349b('0x37')]=_[_0x349b('0x47')](_0x1f4121['query']);_0x190493['filters']=_['intersection'](_0x190493[_0x349b('0x36')],_0x190493[_0x349b('0x37')]);_0x3b0655[_0x349b('0x3a')]=_['intersection'](_0x190493['model'],qs[_0x349b('0x3b')](_0x1f4121[_0x349b('0x37')][_0x349b('0x3b')]));_0x3b0655[_0x349b('0x3a')]=_0x3b0655[_0x349b('0x3a')][_0x349b('0x3c')]?_0x3b0655['attributes']:_0x190493[_0x349b('0x36')];if(_0x1f4121[_0x349b('0x37')][_0x349b('0x44')]){_0x3b0655[_0x349b('0x48')]=[{'all':!![]}];}_0x3b0655=_[_0x349b('0x42')]({},_0x3b0655,_0x1f4121['options']);return db['Template'][_0x349b('0x49')](_0x3b0655)['then'](handleEntityNotFound(_0x2d05d4,null))[_0x349b('0x26')](respondWithResult(_0x2d05d4,null))[_0x349b('0x4a')](handleError(_0x2d05d4,null));};exports[_0x349b('0x4b')]=function(_0x44a09f,_0x1b5bc5){return db[_0x349b('0x31')]['create'](_0x44a09f[_0x349b('0x4c')],{})[_0x349b('0x26')](function(_0xf6e149){var _0x152a18=_0x44a09f[_0x349b('0x4d')]['get']({'plain':!![]});if(!_0x152a18)throw new Error(_0x349b('0x4e'));if(_0x152a18[_0x349b('0x4f')]===_0x349b('0x4d')){var _0x3cdc79=_0xf6e149[_0x349b('0x28')]({'plain':!![]});var _0x11f2d3='Templates';return db[_0x349b('0x50')]['find']({'where':{'name':_0x11f2d3,'userProfileId':_0x152a18['userProfileId']},'raw':!![]})[_0x349b('0x26')](function(_0x59ecd3){if(_0x59ecd3&&_0x59ecd3['autoAssociation']===0x0){return db[_0x349b('0x2a')][_0x349b('0x4b')]({'name':_0x3cdc79[_0x349b('0x2e')],'resourceId':_0x3cdc79['id'],'type':_0x59ecd3[_0x349b('0x2e')],'sectionId':_0x59ecd3['id']},{})[_0x349b('0x26')](function(){return _0xf6e149;});}else{return _0xf6e149;}})[_0x349b('0x4a')](function(_0x7243f7){logger['error'](_0x349b('0x51'),_0x7243f7);throw _0x7243f7;});}return _0xf6e149;})[_0x349b('0x26')](respondWithResult(_0x1b5bc5,0xc9))['catch'](handleError(_0x1b5bc5,null));};exports[_0x349b('0x25')]=function(_0x5da610,_0x5f5bd1){if(_0x5da610[_0x349b('0x4c')]['id']){delete _0x5da610['body']['id'];}return db[_0x349b('0x31')][_0x349b('0x49')]({'where':{'id':_0x5da610['params']['id']}})[_0x349b('0x26')](handleEntityNotFound(_0x5f5bd1,null))[_0x349b('0x26')](saveUpdates(_0x5da610[_0x349b('0x4c')],null))[_0x349b('0x26')](respondWithResult(_0x5f5bd1,null))[_0x349b('0x4a')](handleError(_0x5f5bd1,null));};exports[_0x349b('0x27')]=function(_0x341fe7,_0x2858a0){return db['Template'][_0x349b('0x49')]({'where':{'id':_0x341fe7[_0x349b('0x52')]['id']}})[_0x349b('0x26')](handleEntityNotFound(_0x2858a0,null))[_0x349b('0x26')](removeEntity(_0x2858a0,null))['catch'](handleError(_0x2858a0,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b798f3d..c4ce9d1 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 _0x6ff8=['define','Template','tools_templates','api','request-promise','path','rimraf','../../config/environment'];(function(_0xf12159,_0x5ccb77){var _0x12aadb=function(_0x33abed){while(--_0x33abed){_0xf12159['push'](_0xf12159['shift']());}};_0x12aadb(++_0x5ccb77);}(_0x6ff8,0x93));var _0x86ff=function(_0x15bc2f,_0x25e563){_0x15bc2f=_0x15bc2f-0x0;var _0x574008=_0x6ff8[_0x15bc2f];return _0x574008;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x86ff('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86ff('0x1'));var fs=require('fs');var path=require(_0x86ff('0x2'));var rimraf=require(_0x86ff('0x3'));var config=require(_0x86ff('0x4'));var attributes=require('./template.attributes');module['exports']=function(_0xaa5ee3,_0x2b133a){return _0xaa5ee3[_0x86ff('0x5')](_0x86ff('0x6'),attributes,{'tableName':_0x86ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5fd=['../../config/logger','api','moment','bluebird','request-promise','exports','define','Template','lodash','util'];(function(_0x574c24,_0x3526c9){var _0x14ee4e=function(_0x34e44f){while(--_0x34e44f){_0x574c24['push'](_0x574c24['shift']());}};_0x14ee4e(++_0x3526c9);}(_0xf5fd,0x9e));var _0xdf5f=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xf5fd[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xdf5f('0x0'));var util=require(_0xdf5f('0x1'));var logger=require(_0xdf5f('0x2'))(_0xdf5f('0x3'));var moment=require(_0xdf5f('0x4'));var BPromise=require(_0xdf5f('0x5'));var rp=require(_0xdf5f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0xdf5f('0x7')]=function(_0xb845c1,_0x2e47c9){return _0xb845c1[_0xdf5f('0x8')](_0xdf5f('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 5c5d0fe..753c00a 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 _0x02a4=['where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','GetTemplate','Template','options','raw'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x02a4,0x146));var _0x402a=function(_0x90626,_0x2129be){_0x90626=_0x90626-0x0;var _0x170219=_0x02a4[_0x90626];return _0x170219;};'use strict';var _=require(_0x402a('0x0'));var util=require(_0x402a('0x1'));var moment=require(_0x402a('0x2'));var BPromise=require(_0x402a('0x3'));var rs=require(_0x402a('0x4'));var fs=require('fs');var Redis=require(_0x402a('0x5'));var db=require(_0x402a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x402a('0x7'))(_0x402a('0x8'));var config=require('../../config/environment');var jayson=require(_0x402a('0x9'));var client=jayson[_0x402a('0xa')][_0x402a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d24d5,_0x417e01,_0x43a044){return new BPromise(function(_0x55c0b4,_0x12f9ad){return client['request'](_0x1d24d5,_0x43a044)[_0x402a('0xc')](function(_0x5cb63e){logger[_0x402a('0xd')]('Template,\x20%s,\x20%s',_0x417e01,_0x402a('0xe'));logger[_0x402a('0xf')](_0x402a('0x10'),_0x417e01,'request\x20sent',JSON[_0x402a('0x11')](_0x5cb63e));if(_0x5cb63e[_0x402a('0x12')]){if(_0x5cb63e[_0x402a('0x12')][_0x402a('0x13')]===0x1f4){logger['error'](_0x402a('0x14'),_0x417e01,_0x5cb63e[_0x402a('0x12')][_0x402a('0x15')]);return _0x12f9ad(_0x5cb63e['error']['message']);}logger[_0x402a('0x12')](_0x402a('0x14'),_0x417e01,_0x5cb63e[_0x402a('0x12')][_0x402a('0x15')]);return _0x55c0b4(_0x5cb63e[_0x402a('0x12')][_0x402a('0x15')]);}else{logger[_0x402a('0xd')]('Template,\x20%s,\x20%s',_0x417e01,_0x402a('0xe'));_0x55c0b4(_0x5cb63e['result'][_0x402a('0x15')]);}})['catch'](function(_0x21110b){logger[_0x402a('0x12')](_0x402a('0x14'),_0x417e01,_0x21110b);_0x12f9ad(_0x21110b);});});}exports[_0x402a('0x16')]=function(_0x5acc9b){var _0x2a1e5e=this;return new Promise(function(_0x494f4a,_0x3541a4){return db[_0x402a('0x17')]['findAll']({'raw':_0x5acc9b['options']?_0x5acc9b[_0x402a('0x18')][_0x402a('0x19')]===undefined?!![]:![]:!![],'where':_0x5acc9b[_0x402a('0x18')]?_0x5acc9b[_0x402a('0x18')][_0x402a('0x1a')]||null:null,'attributes':_0x5acc9b[_0x402a('0x18')]?_0x5acc9b[_0x402a('0x18')][_0x402a('0x1b')]||null:null,'limit':_0x5acc9b[_0x402a('0x18')]?_0x5acc9b['options']['limit']||null:null,'include':_0x5acc9b['options']?_0x5acc9b[_0x402a('0x18')][_0x402a('0x1c')]?_[_0x402a('0x1d')](_0x5acc9b[_0x402a('0x18')][_0x402a('0x1c')],function(_0x4b338a){return{'model':db[_0x4b338a[_0x402a('0x1e')]],'as':_0x4b338a['as'],'attributes':_0x4b338a[_0x402a('0x1b')],'include':_0x4b338a[_0x402a('0x1c')]?_['map'](_0x4b338a['include'],function(_0x469277){return{'model':db[_0x469277['model']],'as':_0x469277['as'],'attributes':_0x469277[_0x402a('0x1b')],'include':_0x469277['include']?_[_0x402a('0x1d')](_0x469277[_0x402a('0x1c')],function(_0x24c83e){return{'model':db[_0x24c83e[_0x402a('0x1e')]],'as':_0x24c83e['as'],'attributes':_0x24c83e[_0x402a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f4d7c){logger['info'](_0x402a('0x16'),_0x5acc9b);logger[_0x402a('0xf')](_0x402a('0x16'),_0x5acc9b,JSON[_0x402a('0x11')](_0x2f4d7c));_0x494f4a(_0x2f4d7c);})[_0x402a('0x1f')](function(_0x14572c){logger[_0x402a('0x12')]('GetTemplate',_0x14572c[_0x402a('0x15')],_0x5acc9b);_0x3541a4(_0x2a1e5e[_0x402a('0x12')](0x1f4,_0x14572c['message']));});});}; \ No newline at end of file +var _0x605d=['request\x20sent','stringify','error','code','message','Template','findAll','options','where','attributes','include','map','model','then','GetTemplate','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s'];(function(_0x54ac71,_0x1043f6){var _0xc11d8d=function(_0x6319e1){while(--_0x6319e1){_0x54ac71['push'](_0x54ac71['shift']());}};_0xc11d8d(++_0x1043f6);}(_0x605d,0xe8));var _0xd605=function(_0x211d4a,_0x9d4244){_0x211d4a=_0x211d4a-0x0;var _0x208576=_0x605d[_0x211d4a];return _0x208576;};'use strict';var _=require('lodash');var util=require(_0xd605('0x0'));var moment=require(_0xd605('0x1'));var BPromise=require(_0xd605('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd605('0x3'));var db=require(_0xd605('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd605('0x5'))(_0xd605('0x6'));var config=require(_0xd605('0x7'));var jayson=require(_0xd605('0x8'));var client=jayson[_0xd605('0x9')][_0xd605('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ad82d,_0x4a68bb,_0x5b3518){return new BPromise(function(_0x27e75e,_0x589bd5){return client[_0xd605('0xb')](_0x1ad82d,_0x5b3518)['then'](function(_0x1dfa01){logger[_0xd605('0xc')](_0xd605('0xd'),_0x4a68bb,'request\x20sent');logger[_0xd605('0xe')](_0xd605('0xf'),_0x4a68bb,_0xd605('0x10'),JSON[_0xd605('0x11')](_0x1dfa01));if(_0x1dfa01['error']){if(_0x1dfa01[_0xd605('0x12')][_0xd605('0x13')]===0x1f4){logger['error'](_0xd605('0xd'),_0x4a68bb,_0x1dfa01['error'][_0xd605('0x14')]);return _0x589bd5(_0x1dfa01[_0xd605('0x12')][_0xd605('0x14')]);}logger['error']('Template,\x20%s,\x20%s',_0x4a68bb,_0x1dfa01[_0xd605('0x12')][_0xd605('0x14')]);return _0x27e75e(_0x1dfa01[_0xd605('0x12')][_0xd605('0x14')]);}else{logger[_0xd605('0xc')]('Template,\x20%s,\x20%s',_0x4a68bb,_0xd605('0x10'));_0x27e75e(_0x1dfa01['result']['message']);}})['catch'](function(_0x5d5ca5){logger['error'](_0xd605('0xd'),_0x4a68bb,_0x5d5ca5);_0x589bd5(_0x5d5ca5);});});}exports['GetTemplate']=function(_0x22ba2a){var _0x15268b=this;return new Promise(function(_0x1fbf08,_0x36320b){return db[_0xd605('0x15')][_0xd605('0x16')]({'raw':_0x22ba2a['options']?_0x22ba2a[_0xd605('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22ba2a[_0xd605('0x17')]?_0x22ba2a['options'][_0xd605('0x18')]||null:null,'attributes':_0x22ba2a[_0xd605('0x17')]?_0x22ba2a[_0xd605('0x17')][_0xd605('0x19')]||null:null,'limit':_0x22ba2a[_0xd605('0x17')]?_0x22ba2a[_0xd605('0x17')]['limit']||null:null,'include':_0x22ba2a[_0xd605('0x17')]?_0x22ba2a[_0xd605('0x17')][_0xd605('0x1a')]?_['map'](_0x22ba2a[_0xd605('0x17')]['include'],function(_0x43d45b){return{'model':db[_0x43d45b['model']],'as':_0x43d45b['as'],'attributes':_0x43d45b['attributes'],'include':_0x43d45b[_0xd605('0x1a')]?_[_0xd605('0x1b')](_0x43d45b[_0xd605('0x1a')],function(_0x2259d){return{'model':db[_0x2259d[_0xd605('0x1c')]],'as':_0x2259d['as'],'attributes':_0x2259d['attributes'],'include':_0x2259d[_0xd605('0x1a')]?_[_0xd605('0x1b')](_0x2259d['include'],function(_0x3b3549){return{'model':db[_0x3b3549[_0xd605('0x1c')]],'as':_0x3b3549['as'],'attributes':_0x3b3549[_0xd605('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd605('0x1d')](function(_0xb8fece){logger['info'](_0xd605('0x1e'),_0x22ba2a);logger[_0xd605('0xe')]('GetTemplate',_0x22ba2a,JSON[_0xd605('0x11')](_0xb8fece));_0x1fbf08(_0xb8fece);})['catch'](function(_0x10bc0b){logger[_0xd605('0x12')]('GetTemplate',_0x10bc0b[_0xd605('0x14')],_0x22ba2a);_0x36320b(_0x15268b[_0xd605('0x12')](0x1f4,_0x10bc0b['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index caf0c46..750f7c5 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 _0xc6ec=['./trigger.controller','get','/:id','isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getActions','post','addAnyCondition','/:id/actions','addAction','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33ba7a,_0x2df826){var _0x28653c=function(_0x29a075){while(--_0x29a075){_0x33ba7a['push'](_0x33ba7a['shift']());}};_0x28653c(++_0x2df826);}(_0xc6ec,0x151));var _0xcc6e=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xc6ec[_0x4f431d];return _0x4f31e1;};'use strict';var multer=require(_0xcc6e('0x0'));var util=require(_0xcc6e('0x1'));var path=require(_0xcc6e('0x2'));var timeout=require(_0xcc6e('0x3'));var express=require(_0xcc6e('0x4'));var router=express[_0xcc6e('0x5')]();var fs_extra=require(_0xcc6e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcc6e('0x7'));var config=require('../../config/environment');var controller=require(_0xcc6e('0x8'));router[_0xcc6e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc6e('0x9')](_0xcc6e('0xa'),auth[_0xcc6e('0xb')](),controller[_0xcc6e('0xc')]);router[_0xcc6e('0x9')](_0xcc6e('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xcc6e('0x9')](_0xcc6e('0xe'),auth[_0xcc6e('0xb')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0xcc6e('0xb')](),controller[_0xcc6e('0xf')]);router[_0xcc6e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcc6e('0x10')]('/:id/all_conditions',auth['isAuthenticated'](),controller['addAllCondition']);router[_0xcc6e('0x10')]('/:id/any_conditions',auth[_0xcc6e('0xb')](),controller[_0xcc6e('0x11')]);router[_0xcc6e('0x10')](_0xcc6e('0x12'),auth[_0xcc6e('0xb')](),controller[_0xcc6e('0x13')]);router[_0xcc6e('0x14')](_0xcc6e('0xa'),auth[_0xcc6e('0xb')](),controller['update']);router['delete'](_0xcc6e('0xa'),auth[_0xcc6e('0xb')](),controller[_0xcc6e('0x15')]);module[_0xcc6e('0x16')]=router; \ No newline at end of file +var _0xeef7=['addAction','put','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','/:id/actions'];(function(_0x265b89,_0x3b9dde){var _0x3d972c=function(_0x4277f1){while(--_0x4277f1){_0x265b89['push'](_0x265b89['shift']());}};_0x3d972c(++_0x3b9dde);}(_0xeef7,0x7d));var _0x7eef=function(_0x3794db,_0x1028fc){_0x3794db=_0x3794db-0x0;var _0x3fae2f=_0xeef7[_0x3794db];return _0x3fae2f;};'use strict';var multer=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var path=require('path');var timeout=require(_0x7eef('0x2'));var express=require(_0x7eef('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7eef('0x4'));var config=require(_0x7eef('0x5'));var controller=require(_0x7eef('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7eef('0x7')](_0x7eef('0x8'),auth[_0x7eef('0x9')](),controller['show']);router[_0x7eef('0x7')](_0x7eef('0xa'),auth[_0x7eef('0x9')](),controller[_0x7eef('0xb')]);router[_0x7eef('0x7')](_0x7eef('0xc'),auth[_0x7eef('0x9')](),controller[_0x7eef('0xd')]);router[_0x7eef('0x7')]('/:id/actions',auth[_0x7eef('0x9')](),controller[_0x7eef('0xe')]);router[_0x7eef('0xf')]('/',auth[_0x7eef('0x9')](),controller[_0x7eef('0x10')]);router[_0x7eef('0xf')](_0x7eef('0xa'),auth['isAuthenticated'](),controller[_0x7eef('0x11')]);router[_0x7eef('0xf')](_0x7eef('0xc'),auth[_0x7eef('0x9')](),controller['addAnyCondition']);router['post'](_0x7eef('0x12'),auth[_0x7eef('0x9')](),controller[_0x7eef('0x13')]);router[_0x7eef('0x14')](_0x7eef('0x8'),auth[_0x7eef('0x9')](),controller[_0x7eef('0x15')]);router[_0x7eef('0x16')](_0x7eef('0x8'),auth[_0x7eef('0x9')](),controller[_0x7eef('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fa17aff..4235e96 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 _0xc8c7=['sequelize','STRING','BOOLEAN'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xc8c7,0x117));var _0x7c8c=function(_0x55f29f,_0x18da59){_0x55f29f=_0x55f29f-0x0;var _0xd6a338=_0xc8c7[_0x55f29f];return _0xd6a338;};'use strict';var Sequelize=require(_0x7c8c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7c8c('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7c8c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7fcb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x39a679,_0x20d4a7){var _0xb95b51=function(_0x22d326){while(--_0x22d326){_0x39a679['push'](_0x39a679['shift']());}};_0xb95b51(++_0x20d4a7);}(_0x7fcb,0xd5));var _0xb7fc=function(_0x415f7e,_0x4630b6){_0x415f7e=_0x415f7e-0x0;var _0x311ff4=_0x7fcb[_0x415f7e];return _0x311ff4;};'use strict';var Sequelize=require(_0xb7fc('0x0'));module[_0xb7fc('0x1')]={'name':{'type':Sequelize[_0xb7fc('0x2')]},'channel':{'type':Sequelize[_0xb7fc('0x2')]},'description':{'type':Sequelize[_0xb7fc('0x2')]},'status':{'type':Sequelize[_0xb7fc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 7d62a1c..76a83c0 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 _0xff98=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','Triggers','UserProfileResource','sendStatus','stack','name','map','Trigger','rawAttributes','fieldName','model'];(function(_0xf3c465,_0x27d6e1){var _0x4aff11=function(_0x419fe4){while(--_0x419fe4){_0xf3c465['push'](_0xf3c465['shift']());}};_0x4aff11(++_0x27d6e1);}(_0xff98,0x14b));var _0x8ff9=function(_0x4125a5,_0x370545){_0x4125a5=_0x4125a5-0x0;var _0x2144f7=_0xff98[_0x4125a5];return _0x2144f7;};'use strict';var emlformat=require(_0x8ff9('0x0'));var rimraf=require(_0x8ff9('0x1'));var zipdir=require(_0x8ff9('0x2'));var jsonpatch=require(_0x8ff9('0x3'));var rp=require(_0x8ff9('0x4'));var moment=require(_0x8ff9('0x5'));var BPromise=require(_0x8ff9('0x6'));var Mustache=require('mustache');var util=require(_0x8ff9('0x7'));var path=require('path');var sox=require(_0x8ff9('0x8'));var csv=require(_0x8ff9('0x9'));var ejs=require(_0x8ff9('0xa'));var fs=require('fs');var fs_extra=require(_0x8ff9('0xb'));var _=require(_0x8ff9('0xc'));var squel=require(_0x8ff9('0xd'));var crypto=require(_0x8ff9('0xe'));var jsforce=require(_0x8ff9('0xf'));var deskjs=require(_0x8ff9('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ff9('0x11'));var Redis=require(_0x8ff9('0x12'));var authService=require(_0x8ff9('0x13'));var qs=require(_0x8ff9('0x14'));var as=require(_0x8ff9('0x15'));var hardwareService=require(_0x8ff9('0x16'));var logger=require(_0x8ff9('0x17'))(_0x8ff9('0x18'));var utils=require(_0x8ff9('0x19'));var config=require(_0x8ff9('0x1a'));var licenseUtil=require(_0x8ff9('0x1b'));var db=require(_0x8ff9('0x1c'))['db'];function respondWithStatusCode(_0x6637b8,_0xfc563f){_0xfc563f=_0xfc563f||0xcc;return function(_0xddb2c7){if(_0xddb2c7){return _0x6637b8['sendStatus'](_0xfc563f);}return _0x6637b8['status'](_0xfc563f)['end']();};}function respondWithResult(_0x36887f,_0x43ad22){_0x43ad22=_0x43ad22||0xc8;return function(_0x265cd6){if(_0x265cd6){return _0x36887f[_0x8ff9('0x1d')](_0x43ad22)[_0x8ff9('0x1e')](_0x265cd6);}};}function respondWithFilteredResult(_0x5af025,_0x585143){return function(_0x33d14a){if(_0x33d14a){var _0x27d8ec=typeof _0x585143[_0x8ff9('0x1f')]==='undefined'&&typeof _0x585143[_0x8ff9('0x20')]===_0x8ff9('0x21');var _0x5709fc=_0x33d14a[_0x8ff9('0x22')];var _0x5b365d=_0x27d8ec?0x0:_0x585143[_0x8ff9('0x1f')];var _0x197236=_0x27d8ec?_0x33d14a[_0x8ff9('0x22')]:_0x585143[_0x8ff9('0x1f')]+_0x585143['limit'];var _0x5fcb38;if(_0x197236>=_0x5709fc){_0x197236=_0x5709fc;_0x5fcb38=0xc8;}else{_0x5fcb38=0xce;}_0x5af025['status'](_0x5fcb38);return _0x5af025[_0x8ff9('0x23')](_0x8ff9('0x24'),_0x5b365d+'-'+_0x197236+'/'+_0x5709fc)[_0x8ff9('0x1e')](_0x33d14a);}return null;};}function patchUpdates(_0x20c1a1){return function(_0x1754a3){try{jsonpatch[_0x8ff9('0x25')](_0x1754a3,_0x20c1a1,!![]);}catch(_0x8bf2f4){return BPromise['reject'](_0x8bf2f4);}return _0x1754a3[_0x8ff9('0x26')]();};}function saveUpdates(_0x48ef30,_0x4751c0){return function(_0x3db6da){if(_0x3db6da){return _0x3db6da[_0x8ff9('0x27')](_0x48ef30)['then'](function(_0x3d0afb){return _0x3d0afb;});}return null;};}function removeEntity(_0x3b277b,_0x2618ef){return function(_0x5670d4){if(_0x5670d4){return _0x5670d4[_0x8ff9('0x28')]()[_0x8ff9('0x29')](function(){var _0x260b77=_0x5670d4[_0x8ff9('0x2a')]({'plain':!![]});var _0x210d74=_0x8ff9('0x2b');return db[_0x8ff9('0x2c')][_0x8ff9('0x28')]({'where':{'type':_0x210d74,'resourceId':_0x260b77['id']}})[_0x8ff9('0x29')](function(){return _0x5670d4;});})[_0x8ff9('0x29')](function(){_0x3b277b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x554d3e,_0x53b890){return function(_0x4a1d82){if(!_0x4a1d82){_0x554d3e[_0x8ff9('0x2d')](0x194);}return _0x4a1d82;};}function handleError(_0x253a7f,_0x54af50){_0x54af50=_0x54af50||0x1f4;return function(_0x59aeb2){logger['error'](_0x59aeb2[_0x8ff9('0x2e')]);if(_0x59aeb2[_0x8ff9('0x2f')]){delete _0x59aeb2[_0x8ff9('0x2f')];}_0x253a7f[_0x8ff9('0x1d')](_0x54af50)['send'](_0x59aeb2);};}exports['index']=function(_0x3ff9b9,_0xb02128){var _0x3eac7c={},_0x3032ad={},_0x4c72ae={'count':0x0,'rows':[]};var _0x55be31=_[_0x8ff9('0x30')](db[_0x8ff9('0x31')][_0x8ff9('0x32')],function(_0x2c9e77){return{'name':_0x2c9e77[_0x8ff9('0x33')],'type':_0x2c9e77['type']['key']};});_0x3032ad[_0x8ff9('0x34')]=_[_0x8ff9('0x30')](_0x55be31,_0x8ff9('0x2f'));_0x3032ad[_0x8ff9('0x35')]=_[_0x8ff9('0x36')](_0x3ff9b9['query']);_0x3032ad[_0x8ff9('0x37')]=_[_0x8ff9('0x38')](_0x3032ad[_0x8ff9('0x34')],_0x3032ad[_0x8ff9('0x35')]);_0x3eac7c['attributes']=_['intersection'](_0x3032ad[_0x8ff9('0x34')],qs[_0x8ff9('0x39')](_0x3ff9b9['query'][_0x8ff9('0x39')]));_0x3eac7c[_0x8ff9('0x3a')]=_0x3eac7c[_0x8ff9('0x3a')][_0x8ff9('0x3b')]?_0x3eac7c[_0x8ff9('0x3a')]:_0x3032ad[_0x8ff9('0x34')];if(!_0x3ff9b9[_0x8ff9('0x35')][_0x8ff9('0x3c')](_0x8ff9('0x3d'))){_0x3eac7c[_0x8ff9('0x20')]=qs[_0x8ff9('0x20')](_0x3ff9b9[_0x8ff9('0x35')]['limit']);_0x3eac7c[_0x8ff9('0x1f')]=qs[_0x8ff9('0x1f')](_0x3ff9b9[_0x8ff9('0x35')]['offset']);}_0x3eac7c[_0x8ff9('0x3e')]=qs[_0x8ff9('0x3f')](_0x3ff9b9['query'][_0x8ff9('0x3f')]);_0x3eac7c['where']=qs[_0x8ff9('0x37')](_[_0x8ff9('0x40')](_0x3ff9b9[_0x8ff9('0x35')],_0x3032ad['filters']),_0x55be31);if(_0x3ff9b9[_0x8ff9('0x35')][_0x8ff9('0x41')]){_0x3eac7c[_0x8ff9('0x42')]=_[_0x8ff9('0x43')](_0x3eac7c[_0x8ff9('0x42')],{'$or':_[_0x8ff9('0x30')](_0x55be31,function(_0x454ec6){if(_0x454ec6['type']!==_0x8ff9('0x44')){var _0x499ae8={};_0x499ae8[_0x454ec6[_0x8ff9('0x2f')]]={'$like':'%'+_0x3ff9b9['query'][_0x8ff9('0x41')]+'%'};return _0x499ae8;}})});}_0x3eac7c=_[_0x8ff9('0x43')]({},_0x3eac7c,_0x3ff9b9['options']);var _0x37d908={'where':_0x3eac7c[_0x8ff9('0x42')]};return db[_0x8ff9('0x31')][_0x8ff9('0x22')](_0x37d908)[_0x8ff9('0x29')](function(_0x5e62e7){_0x4c72ae[_0x8ff9('0x22')]=_0x5e62e7;if(_0x3ff9b9[_0x8ff9('0x35')][_0x8ff9('0x45')]){_0x3eac7c[_0x8ff9('0x46')]=[{'all':!![]}];}return db[_0x8ff9('0x31')][_0x8ff9('0x47')](_0x3eac7c);})[_0x8ff9('0x29')](function(_0x107a85){_0x4c72ae[_0x8ff9('0x48')]=_0x107a85;return _0x4c72ae;})[_0x8ff9('0x29')](respondWithFilteredResult(_0xb02128,_0x3eac7c))[_0x8ff9('0x49')](handleError(_0xb02128,null));};exports[_0x8ff9('0x4a')]=function(_0x1fbbdd,_0x82d22f){var _0x4c56cc={'raw':![],'where':{'id':_0x1fbbdd[_0x8ff9('0x4b')]['id']}},_0x19944b={};_0x19944b[_0x8ff9('0x34')]=_[_0x8ff9('0x36')](db['Trigger'][_0x8ff9('0x32')]);_0x19944b[_0x8ff9('0x35')]=_[_0x8ff9('0x36')](_0x1fbbdd[_0x8ff9('0x35')]);_0x19944b[_0x8ff9('0x37')]=_[_0x8ff9('0x38')](_0x19944b[_0x8ff9('0x34')],_0x19944b[_0x8ff9('0x35')]);_0x4c56cc[_0x8ff9('0x3a')]=_[_0x8ff9('0x38')](_0x19944b['model'],qs['fields'](_0x1fbbdd[_0x8ff9('0x35')][_0x8ff9('0x39')]));_0x4c56cc[_0x8ff9('0x3a')]=_0x4c56cc[_0x8ff9('0x3a')][_0x8ff9('0x3b')]?_0x4c56cc[_0x8ff9('0x3a')]:_0x19944b[_0x8ff9('0x34')];if(_0x1fbbdd[_0x8ff9('0x35')][_0x8ff9('0x45')]){_0x4c56cc['include']=[{'all':!![]}];}_0x4c56cc=_['merge']({},_0x4c56cc,_0x1fbbdd[_0x8ff9('0x4c')]);return db['Trigger'][_0x8ff9('0x4d')](_0x4c56cc)[_0x8ff9('0x29')](handleEntityNotFound(_0x82d22f,null))[_0x8ff9('0x29')](respondWithResult(_0x82d22f,null))[_0x8ff9('0x49')](handleError(_0x82d22f,null));};exports[_0x8ff9('0x4e')]=function(_0x3f796d,_0x28f8ef){return db['Trigger'][_0x8ff9('0x4e')](_0x3f796d[_0x8ff9('0x4f')],{})['then'](function(_0x29dcfe){var _0xe7e239=_0x3f796d[_0x8ff9('0x50')][_0x8ff9('0x2a')]({'plain':!![]});if(!_0xe7e239)throw new Error(_0x8ff9('0x51'));if(_0xe7e239[_0x8ff9('0x52')]===_0x8ff9('0x50')){var _0x56bf52=_0x29dcfe[_0x8ff9('0x2a')]({'plain':!![]});var _0x4092d6=_0x8ff9('0x2b');return db[_0x8ff9('0x53')][_0x8ff9('0x4d')]({'where':{'name':_0x4092d6,'userProfileId':_0xe7e239['userProfileId']},'raw':!![]})[_0x8ff9('0x29')](function(_0x1a2218){if(_0x1a2218&&_0x1a2218[_0x8ff9('0x54')]===0x0){return db[_0x8ff9('0x2c')][_0x8ff9('0x4e')]({'name':_0x56bf52[_0x8ff9('0x2f')],'resourceId':_0x56bf52['id'],'type':_0x1a2218['name'],'sectionId':_0x1a2218['id']},{})['then'](function(){return _0x29dcfe;});}else{return _0x29dcfe;}})[_0x8ff9('0x49')](function(_0xa9864f){logger[_0x8ff9('0x55')](_0x8ff9('0x56'),_0xa9864f);throw _0xa9864f;});}return _0x29dcfe;})['then'](respondWithResult(_0x28f8ef,0xc9))[_0x8ff9('0x49')](handleError(_0x28f8ef,null));};exports[_0x8ff9('0x27')]=function(_0x203082,_0x6a82e9){if(_0x203082[_0x8ff9('0x4f')]['id']){delete _0x203082[_0x8ff9('0x4f')]['id'];}return db[_0x8ff9('0x31')][_0x8ff9('0x4d')]({'where':{'id':_0x203082[_0x8ff9('0x4b')]['id']}})[_0x8ff9('0x29')](handleEntityNotFound(_0x6a82e9,null))[_0x8ff9('0x29')](saveUpdates(_0x203082[_0x8ff9('0x4f')],null))['then'](respondWithResult(_0x6a82e9,null))[_0x8ff9('0x49')](handleError(_0x6a82e9,null));};exports['destroy']=function(_0x18b78e,_0x2c9f3e){return db['Trigger']['find']({'where':{'id':_0x18b78e[_0x8ff9('0x4b')]['id']}})[_0x8ff9('0x29')](handleEntityNotFound(_0x2c9f3e,null))[_0x8ff9('0x29')](removeEntity(_0x2c9f3e,null))[_0x8ff9('0x49')](handleError(_0x2c9f3e,null));};exports[_0x8ff9('0x57')]=function(_0x37f193,_0x25d4fb,_0x1e2eb8){if(_0x37f193[_0x8ff9('0x4f')]['id']){delete _0x37f193[_0x8ff9('0x4f')]['id'];}return db[_0x8ff9('0x31')][_0x8ff9('0x4d')]({'where':{'id':_0x37f193[_0x8ff9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25d4fb,null))[_0x8ff9('0x29')](function(_0x19bd4b){if(_0x19bd4b){_0x37f193[_0x8ff9('0x4f')]['TriggerAllId']=_0x19bd4b['id'];return db[_0x8ff9('0x58')][_0x8ff9('0x4e')](_0x37f193[_0x8ff9('0x4f')]);}})[_0x8ff9('0x29')](respondWithResult(_0x25d4fb,null))[_0x8ff9('0x49')](handleError(_0x25d4fb,null));};exports[_0x8ff9('0x59')]=function(_0x53455b,_0x7d41ee,_0x3624ba){if(_0x53455b['body']['id']){delete _0x53455b[_0x8ff9('0x4f')]['id'];}return db[_0x8ff9('0x31')][_0x8ff9('0x4d')]({'where':{'id':_0x53455b[_0x8ff9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x7d41ee,null))[_0x8ff9('0x29')](function(_0xc976ab){if(_0xc976ab){_0x53455b[_0x8ff9('0x4f')]['TriggerAnyId']=_0xc976ab['id'];return db[_0x8ff9('0x58')][_0x8ff9('0x4e')](_0x53455b[_0x8ff9('0x4f')]);}})['then'](respondWithResult(_0x7d41ee,null))[_0x8ff9('0x49')](handleError(_0x7d41ee,null));};exports[_0x8ff9('0x5a')]=function(_0x2d6dd5,_0xcac480,_0x4f223a){var _0x2bbbc6={};var _0x34fb59={};var _0x7ec59e;var _0x290376;return db['Trigger']['findOne']({'where':{'id':_0x2d6dd5[_0x8ff9('0x4b')]['id']}})[_0x8ff9('0x29')](handleEntityNotFound(_0xcac480,null))[_0x8ff9('0x29')](function(_0xa4293d){if(_0xa4293d){_0x7ec59e=_0xa4293d;_0x34fb59[_0x8ff9('0x34')]=_[_0x8ff9('0x36')](db['Condition'][_0x8ff9('0x32')]);_0x34fb59[_0x8ff9('0x35')]=_[_0x8ff9('0x36')](_0x2d6dd5[_0x8ff9('0x35')]);_0x34fb59[_0x8ff9('0x37')]=_['intersection'](_0x34fb59['model'],_0x34fb59[_0x8ff9('0x35')]);_0x2bbbc6[_0x8ff9('0x3a')]=_[_0x8ff9('0x38')](_0x34fb59[_0x8ff9('0x34')],qs[_0x8ff9('0x39')](_0x2d6dd5[_0x8ff9('0x35')]['fields']));_0x2bbbc6[_0x8ff9('0x3a')]=_0x2bbbc6[_0x8ff9('0x3a')][_0x8ff9('0x3b')]?_0x2bbbc6[_0x8ff9('0x3a')]:_0x34fb59['model'];_0x2bbbc6[_0x8ff9('0x3e')]=qs[_0x8ff9('0x3f')](_0x2d6dd5[_0x8ff9('0x35')]['sort']);_0x2bbbc6[_0x8ff9('0x42')]=qs[_0x8ff9('0x37')](_[_0x8ff9('0x40')](_0x2d6dd5['query'],_0x34fb59[_0x8ff9('0x37')]));if(_0x2d6dd5[_0x8ff9('0x35')]['filter']){_0x2bbbc6[_0x8ff9('0x42')]=_[_0x8ff9('0x43')](_0x2bbbc6[_0x8ff9('0x42')],{'$or':_[_0x8ff9('0x30')](_0x2bbbc6[_0x8ff9('0x3a')],function(_0x2bff8d){var _0x80c203={};_0x80c203[_0x2bff8d]={'$like':'%'+_0x2d6dd5[_0x8ff9('0x35')][_0x8ff9('0x41')]+'%'};return _0x80c203;})});}_0x2bbbc6=_[_0x8ff9('0x43')]({},_0x2bbbc6,_0x2d6dd5[_0x8ff9('0x4c')]);return _0x7ec59e[_0x8ff9('0x5a')](_0x2bbbc6);}})[_0x8ff9('0x29')](function(_0x469580){if(_0x469580){_0x290376=_0x469580[_0x8ff9('0x3b')];if(!_0x2d6dd5[_0x8ff9('0x35')]['hasOwnProperty'](_0x8ff9('0x3d'))){_0x2bbbc6[_0x8ff9('0x20')]=qs['limit'](_0x2d6dd5[_0x8ff9('0x35')][_0x8ff9('0x20')]);_0x2bbbc6[_0x8ff9('0x1f')]=qs[_0x8ff9('0x1f')](_0x2d6dd5[_0x8ff9('0x35')][_0x8ff9('0x1f')]);}return _0x7ec59e[_0x8ff9('0x5a')](_0x2bbbc6);}})[_0x8ff9('0x29')](function(_0x16b880){if(_0x16b880){return _0x16b880?{'count':_0x290376,'rows':_0x16b880}:null;}})[_0x8ff9('0x29')](respondWithResult(_0xcac480,null))['catch'](handleError(_0xcac480,null));};exports[_0x8ff9('0x5b')]=function(_0x50a5e3,_0x2ead62,_0x97d9e6){var _0x5d0c36={};var _0x291ce2={};var _0x1a42bf;var _0x86aa9;return db[_0x8ff9('0x31')][_0x8ff9('0x5c')]({'where':{'id':_0x50a5e3[_0x8ff9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ead62,null))[_0x8ff9('0x29')](function(_0x26a564){if(_0x26a564){_0x1a42bf=_0x26a564;_0x291ce2[_0x8ff9('0x34')]=_[_0x8ff9('0x36')](db[_0x8ff9('0x58')][_0x8ff9('0x32')]);_0x291ce2['query']=_[_0x8ff9('0x36')](_0x50a5e3[_0x8ff9('0x35')]);_0x291ce2[_0x8ff9('0x37')]=_[_0x8ff9('0x38')](_0x291ce2[_0x8ff9('0x34')],_0x291ce2[_0x8ff9('0x35')]);_0x5d0c36['attributes']=_[_0x8ff9('0x38')](_0x291ce2['model'],qs[_0x8ff9('0x39')](_0x50a5e3[_0x8ff9('0x35')]['fields']));_0x5d0c36[_0x8ff9('0x3a')]=_0x5d0c36[_0x8ff9('0x3a')][_0x8ff9('0x3b')]?_0x5d0c36['attributes']:_0x291ce2['model'];_0x5d0c36[_0x8ff9('0x3e')]=qs[_0x8ff9('0x3f')](_0x50a5e3[_0x8ff9('0x35')][_0x8ff9('0x3f')]);_0x5d0c36[_0x8ff9('0x42')]=qs[_0x8ff9('0x37')](_[_0x8ff9('0x40')](_0x50a5e3[_0x8ff9('0x35')],_0x291ce2[_0x8ff9('0x37')]));if(_0x50a5e3[_0x8ff9('0x35')][_0x8ff9('0x41')]){_0x5d0c36[_0x8ff9('0x42')]=_[_0x8ff9('0x43')](_0x5d0c36[_0x8ff9('0x42')],{'$or':_[_0x8ff9('0x30')](_0x5d0c36[_0x8ff9('0x3a')],function(_0x32a19e){var _0xa1332b={};_0xa1332b[_0x32a19e]={'$like':'%'+_0x50a5e3[_0x8ff9('0x35')][_0x8ff9('0x41')]+'%'};return _0xa1332b;})});}_0x5d0c36=_['merge']({},_0x5d0c36,_0x50a5e3[_0x8ff9('0x4c')]);return _0x1a42bf['getAnyConditions'](_0x5d0c36);}})[_0x8ff9('0x29')](function(_0x56d16){if(_0x56d16){_0x86aa9=_0x56d16[_0x8ff9('0x3b')];if(!_0x50a5e3[_0x8ff9('0x35')][_0x8ff9('0x3c')](_0x8ff9('0x3d'))){_0x5d0c36['limit']=qs['limit'](_0x50a5e3[_0x8ff9('0x35')][_0x8ff9('0x20')]);_0x5d0c36[_0x8ff9('0x1f')]=qs['offset'](_0x50a5e3[_0x8ff9('0x35')]['offset']);}return _0x1a42bf[_0x8ff9('0x5b')](_0x5d0c36);}})[_0x8ff9('0x29')](function(_0x3e176b){if(_0x3e176b){return _0x3e176b?{'count':_0x86aa9,'rows':_0x3e176b}:null;}})[_0x8ff9('0x29')](respondWithResult(_0x2ead62,null))['catch'](handleError(_0x2ead62,null));};exports['addAction']=function(_0x1ef823,_0x369b07,_0x394438){if(_0x1ef823[_0x8ff9('0x4f')]['id']){delete _0x1ef823[_0x8ff9('0x4f')]['id'];}return db['Trigger'][_0x8ff9('0x4d')]({'where':{'id':_0x1ef823['params']['id']}})[_0x8ff9('0x29')](handleEntityNotFound(_0x369b07,null))[_0x8ff9('0x29')](function(_0x4511fd){if(_0x4511fd){_0x1ef823[_0x8ff9('0x4f')][_0x8ff9('0x5d')]=_0x4511fd['id'];return db[_0x8ff9('0x5e')][_0x8ff9('0x4e')](_0x1ef823[_0x8ff9('0x4f')]);}})[_0x8ff9('0x29')](respondWithResult(_0x369b07,null))['catch'](handleError(_0x369b07,null));};exports[_0x8ff9('0x5f')]=function(_0x51f9bb,_0x24d9fb,_0x116b2a){var _0x341fea={};var _0x526d3f={};var _0x28526e;var _0x11cba9;return db['Trigger'][_0x8ff9('0x5c')]({'where':{'id':_0x51f9bb['params']['id']}})[_0x8ff9('0x29')](handleEntityNotFound(_0x24d9fb,null))['then'](function(_0x1afeb6){if(_0x1afeb6){_0x28526e=_0x1afeb6;_0x526d3f[_0x8ff9('0x34')]=_[_0x8ff9('0x36')](db['Action'][_0x8ff9('0x32')]);_0x526d3f[_0x8ff9('0x35')]=_[_0x8ff9('0x36')](_0x51f9bb[_0x8ff9('0x35')]);_0x526d3f[_0x8ff9('0x37')]=_[_0x8ff9('0x38')](_0x526d3f[_0x8ff9('0x34')],_0x526d3f[_0x8ff9('0x35')]);_0x341fea[_0x8ff9('0x3a')]=_[_0x8ff9('0x38')](_0x526d3f[_0x8ff9('0x34')],qs[_0x8ff9('0x39')](_0x51f9bb[_0x8ff9('0x35')]['fields']));_0x341fea[_0x8ff9('0x3a')]=_0x341fea[_0x8ff9('0x3a')][_0x8ff9('0x3b')]?_0x341fea[_0x8ff9('0x3a')]:_0x526d3f[_0x8ff9('0x34')];_0x341fea['order']=qs[_0x8ff9('0x3f')](_0x51f9bb[_0x8ff9('0x35')]['sort']);_0x341fea['where']=qs[_0x8ff9('0x37')](_[_0x8ff9('0x40')](_0x51f9bb[_0x8ff9('0x35')],_0x526d3f['filters']));if(_0x51f9bb[_0x8ff9('0x35')][_0x8ff9('0x41')]){_0x341fea[_0x8ff9('0x42')]=_['merge'](_0x341fea[_0x8ff9('0x42')],{'$or':_[_0x8ff9('0x30')](_0x341fea['attributes'],function(_0x5f2c70){var _0x1539b5={};_0x1539b5[_0x5f2c70]={'$like':'%'+_0x51f9bb[_0x8ff9('0x35')][_0x8ff9('0x41')]+'%'};return _0x1539b5;})});}_0x341fea=_[_0x8ff9('0x43')]({},_0x341fea,_0x51f9bb['options']);return _0x28526e['getActions'](_0x341fea);}})[_0x8ff9('0x29')](function(_0x46099c){if(_0x46099c){_0x11cba9=_0x46099c[_0x8ff9('0x3b')];if(!_0x51f9bb[_0x8ff9('0x35')][_0x8ff9('0x3c')](_0x8ff9('0x3d'))){_0x341fea['limit']=qs[_0x8ff9('0x20')](_0x51f9bb[_0x8ff9('0x35')][_0x8ff9('0x20')]);_0x341fea[_0x8ff9('0x1f')]=qs['offset'](_0x51f9bb['query'][_0x8ff9('0x1f')]);}return _0x28526e['getActions'](_0x341fea);}})[_0x8ff9('0x29')](function(_0x48469b){if(_0x48469b){return _0x48469b?{'count':_0x11cba9,'rows':_0x48469b}:null;}})['then'](respondWithResult(_0x24d9fb,null))[_0x8ff9('0x49')](handleError(_0x24d9fb,null));}; \ No newline at end of file +var _0x0397=['options','Trigger','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','findOne','getAllConditions','getAnyConditions','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x13c958,_0x3d79a8){var _0x40f933=function(_0x79a88e){while(--_0x79a88e){_0x13c958['push'](_0x13c958['shift']());}};_0x40f933(++_0x3d79a8);}(_0x0397,0x134));var _0x7039=function(_0x16acb7,_0x23f034){_0x16acb7=_0x16acb7-0x0;var _0x39bf39=_0x0397[_0x16acb7];return _0x39bf39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7039('0x0'));var zipdir=require(_0x7039('0x1'));var jsonpatch=require(_0x7039('0x2'));var rp=require('request-promise');var moment=require(_0x7039('0x3'));var BPromise=require(_0x7039('0x4'));var Mustache=require(_0x7039('0x5'));var util=require(_0x7039('0x6'));var path=require(_0x7039('0x7'));var sox=require('sox');var csv=require(_0x7039('0x8'));var ejs=require(_0x7039('0x9'));var fs=require('fs');var fs_extra=require(_0x7039('0xa'));var _=require('lodash');var squel=require(_0x7039('0xb'));var crypto=require(_0x7039('0xc'));var jsforce=require(_0x7039('0xd'));var deskjs=require(_0x7039('0xe'));var toCsv=require(_0x7039('0x8'));var querystring=require('querystring');var Papa=require(_0x7039('0xf'));var Redis=require(_0x7039('0x10'));var authService=require(_0x7039('0x11'));var qs=require(_0x7039('0x12'));var as=require(_0x7039('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7039('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7039('0x15'));var db=require(_0x7039('0x16'))['db'];function respondWithStatusCode(_0x487d50,_0x403ca6){_0x403ca6=_0x403ca6||0xcc;return function(_0x550a27){if(_0x550a27){return _0x487d50['sendStatus'](_0x403ca6);}return _0x487d50[_0x7039('0x17')](_0x403ca6)[_0x7039('0x18')]();};}function respondWithResult(_0x388534,_0x1ae63f){_0x1ae63f=_0x1ae63f||0xc8;return function(_0xb5eec3){if(_0xb5eec3){return _0x388534[_0x7039('0x17')](_0x1ae63f)[_0x7039('0x19')](_0xb5eec3);}};}function respondWithFilteredResult(_0xf792,_0x45d5b6){return function(_0x11cec0){if(_0x11cec0){var _0x4c7935=typeof _0x45d5b6[_0x7039('0x1a')]==='undefined'&&typeof _0x45d5b6[_0x7039('0x1b')]===_0x7039('0x1c');var _0x2d8dc4=_0x11cec0['count'];var _0xafbbdb=_0x4c7935?0x0:_0x45d5b6[_0x7039('0x1a')];var _0x30efd9=_0x4c7935?_0x11cec0[_0x7039('0x1d')]:_0x45d5b6[_0x7039('0x1a')]+_0x45d5b6[_0x7039('0x1b')];var _0x181afb;if(_0x30efd9>=_0x2d8dc4){_0x30efd9=_0x2d8dc4;_0x181afb=0xc8;}else{_0x181afb=0xce;}_0xf792[_0x7039('0x17')](_0x181afb);return _0xf792[_0x7039('0x1e')](_0x7039('0x1f'),_0xafbbdb+'-'+_0x30efd9+'/'+_0x2d8dc4)['json'](_0x11cec0);}return null;};}function patchUpdates(_0x1e0779){return function(_0x57f423){try{jsonpatch[_0x7039('0x20')](_0x57f423,_0x1e0779,!![]);}catch(_0x1f6900){return BPromise[_0x7039('0x21')](_0x1f6900);}return _0x57f423[_0x7039('0x22')]();};}function saveUpdates(_0x74194a,_0x1dd0c5){return function(_0x4f62d6){if(_0x4f62d6){return _0x4f62d6[_0x7039('0x23')](_0x74194a)[_0x7039('0x24')](function(_0x405af8){return _0x405af8;});}return null;};}function removeEntity(_0x2d82bc,_0x29724e){return function(_0x58dbf0){if(_0x58dbf0){return _0x58dbf0[_0x7039('0x25')]()[_0x7039('0x24')](function(){var _0x1a7f8b=_0x58dbf0[_0x7039('0x26')]({'plain':!![]});var _0x17ff5c=_0x7039('0x27');return db[_0x7039('0x28')][_0x7039('0x25')]({'where':{'type':_0x17ff5c,'resourceId':_0x1a7f8b['id']}})[_0x7039('0x24')](function(){return _0x58dbf0;});})[_0x7039('0x24')](function(){_0x2d82bc[_0x7039('0x17')](0xcc)[_0x7039('0x18')]();});}};}function handleEntityNotFound(_0x3ee909,_0x377760){return function(_0x3e9a75){if(!_0x3e9a75){_0x3ee909['sendStatus'](0x194);}return _0x3e9a75;};}function handleError(_0xe0ccd,_0xa0ca54){_0xa0ca54=_0xa0ca54||0x1f4;return function(_0x4be94b){logger[_0x7039('0x29')](_0x4be94b[_0x7039('0x2a')]);if(_0x4be94b[_0x7039('0x2b')]){delete _0x4be94b[_0x7039('0x2b')];}_0xe0ccd[_0x7039('0x17')](_0xa0ca54)[_0x7039('0x2c')](_0x4be94b);};}exports[_0x7039('0x2d')]=function(_0xfeb1b6,_0x785dac){var _0x296536={},_0x2b89f4={},_0x573713={'count':0x0,'rows':[]};var _0x2ea7eb=_[_0x7039('0x2e')](db['Trigger'][_0x7039('0x2f')],function(_0x59fc11){return{'name':_0x59fc11[_0x7039('0x30')],'type':_0x59fc11[_0x7039('0x31')][_0x7039('0x32')]};});_0x2b89f4[_0x7039('0x33')]=_[_0x7039('0x2e')](_0x2ea7eb,_0x7039('0x2b'));_0x2b89f4['query']=_[_0x7039('0x34')](_0xfeb1b6[_0x7039('0x35')]);_0x2b89f4['filters']=_[_0x7039('0x36')](_0x2b89f4[_0x7039('0x33')],_0x2b89f4[_0x7039('0x35')]);_0x296536[_0x7039('0x37')]=_[_0x7039('0x36')](_0x2b89f4[_0x7039('0x33')],qs[_0x7039('0x38')](_0xfeb1b6[_0x7039('0x35')][_0x7039('0x38')]));_0x296536[_0x7039('0x37')]=_0x296536[_0x7039('0x37')][_0x7039('0x39')]?_0x296536[_0x7039('0x37')]:_0x2b89f4['model'];if(!_0xfeb1b6[_0x7039('0x35')][_0x7039('0x3a')](_0x7039('0x3b'))){_0x296536[_0x7039('0x1b')]=qs[_0x7039('0x1b')](_0xfeb1b6[_0x7039('0x35')]['limit']);_0x296536[_0x7039('0x1a')]=qs[_0x7039('0x1a')](_0xfeb1b6[_0x7039('0x35')][_0x7039('0x1a')]);}_0x296536[_0x7039('0x3c')]=qs['sort'](_0xfeb1b6['query'][_0x7039('0x3d')]);_0x296536[_0x7039('0x3e')]=qs[_0x7039('0x3f')](_[_0x7039('0x40')](_0xfeb1b6[_0x7039('0x35')],_0x2b89f4[_0x7039('0x3f')]),_0x2ea7eb);if(_0xfeb1b6['query'][_0x7039('0x41')]){_0x296536[_0x7039('0x3e')]=_[_0x7039('0x42')](_0x296536[_0x7039('0x3e')],{'$or':_[_0x7039('0x2e')](_0x2ea7eb,function(_0x1c215d){if(_0x1c215d[_0x7039('0x31')]!==_0x7039('0x43')){var _0x2ea283={};_0x2ea283[_0x1c215d[_0x7039('0x2b')]]={'$like':'%'+_0xfeb1b6['query'][_0x7039('0x41')]+'%'};return _0x2ea283;}})});}_0x296536=_[_0x7039('0x42')]({},_0x296536,_0xfeb1b6[_0x7039('0x44')]);var _0x5b92ae={'where':_0x296536[_0x7039('0x3e')]};return db[_0x7039('0x45')][_0x7039('0x1d')](_0x5b92ae)['then'](function(_0x827778){_0x573713['count']=_0x827778;if(_0xfeb1b6[_0x7039('0x35')][_0x7039('0x46')]){_0x296536[_0x7039('0x47')]=[{'all':!![]}];}return db[_0x7039('0x45')][_0x7039('0x48')](_0x296536);})['then'](function(_0x5a631a){_0x573713['rows']=_0x5a631a;return _0x573713;})[_0x7039('0x24')](respondWithFilteredResult(_0x785dac,_0x296536))[_0x7039('0x49')](handleError(_0x785dac,null));};exports[_0x7039('0x4a')]=function(_0x298a62,_0x2e3be2){var _0x104531={'raw':![],'where':{'id':_0x298a62[_0x7039('0x4b')]['id']}},_0x286fac={};_0x286fac[_0x7039('0x33')]=_[_0x7039('0x34')](db[_0x7039('0x45')][_0x7039('0x2f')]);_0x286fac[_0x7039('0x35')]=_[_0x7039('0x34')](_0x298a62['query']);_0x286fac[_0x7039('0x3f')]=_[_0x7039('0x36')](_0x286fac['model'],_0x286fac[_0x7039('0x35')]);_0x104531[_0x7039('0x37')]=_[_0x7039('0x36')](_0x286fac[_0x7039('0x33')],qs[_0x7039('0x38')](_0x298a62[_0x7039('0x35')][_0x7039('0x38')]));_0x104531['attributes']=_0x104531[_0x7039('0x37')][_0x7039('0x39')]?_0x104531['attributes']:_0x286fac[_0x7039('0x33')];if(_0x298a62[_0x7039('0x35')][_0x7039('0x46')]){_0x104531[_0x7039('0x47')]=[{'all':!![]}];}_0x104531=_[_0x7039('0x42')]({},_0x104531,_0x298a62['options']);return db[_0x7039('0x45')][_0x7039('0x4c')](_0x104531)[_0x7039('0x24')](handleEntityNotFound(_0x2e3be2,null))[_0x7039('0x24')](respondWithResult(_0x2e3be2,null))[_0x7039('0x49')](handleError(_0x2e3be2,null));};exports['create']=function(_0x4c9cc3,_0x48b908){return db[_0x7039('0x45')][_0x7039('0x4d')](_0x4c9cc3[_0x7039('0x4e')],{})['then'](function(_0x5dc1fe){var _0xe64af2=_0x4c9cc3[_0x7039('0x4f')][_0x7039('0x26')]({'plain':!![]});if(!_0xe64af2)throw new Error(_0x7039('0x50'));if(_0xe64af2[_0x7039('0x51')]===_0x7039('0x4f')){var _0xe30f6c=_0x5dc1fe[_0x7039('0x26')]({'plain':!![]});var _0x449fd1='Triggers';return db[_0x7039('0x52')][_0x7039('0x4c')]({'where':{'name':_0x449fd1,'userProfileId':_0xe64af2['userProfileId']},'raw':!![]})[_0x7039('0x24')](function(_0x3370e3){if(_0x3370e3&&_0x3370e3[_0x7039('0x53')]===0x0){return db[_0x7039('0x28')][_0x7039('0x4d')]({'name':_0xe30f6c[_0x7039('0x2b')],'resourceId':_0xe30f6c['id'],'type':_0x3370e3[_0x7039('0x2b')],'sectionId':_0x3370e3['id']},{})['then'](function(){return _0x5dc1fe;});}else{return _0x5dc1fe;}})[_0x7039('0x49')](function(_0x3e9412){logger[_0x7039('0x29')](_0x7039('0x54'),_0x3e9412);throw _0x3e9412;});}return _0x5dc1fe;})['then'](respondWithResult(_0x48b908,0xc9))[_0x7039('0x49')](handleError(_0x48b908,null));};exports[_0x7039('0x23')]=function(_0x2e44dc,_0x372d14){if(_0x2e44dc[_0x7039('0x4e')]['id']){delete _0x2e44dc[_0x7039('0x4e')]['id'];}return db['Trigger'][_0x7039('0x4c')]({'where':{'id':_0x2e44dc[_0x7039('0x4b')]['id']}})['then'](handleEntityNotFound(_0x372d14,null))[_0x7039('0x24')](saveUpdates(_0x2e44dc[_0x7039('0x4e')],null))[_0x7039('0x24')](respondWithResult(_0x372d14,null))['catch'](handleError(_0x372d14,null));};exports[_0x7039('0x25')]=function(_0x23fecf,_0x54456a){return db[_0x7039('0x45')][_0x7039('0x4c')]({'where':{'id':_0x23fecf['params']['id']}})[_0x7039('0x24')](handleEntityNotFound(_0x54456a,null))[_0x7039('0x24')](removeEntity(_0x54456a,null))[_0x7039('0x49')](handleError(_0x54456a,null));};exports['addAllCondition']=function(_0x288e5f,_0x45b237,_0x45f256){if(_0x288e5f[_0x7039('0x4e')]['id']){delete _0x288e5f[_0x7039('0x4e')]['id'];}return db[_0x7039('0x45')][_0x7039('0x4c')]({'where':{'id':_0x288e5f[_0x7039('0x4b')]['id']}})[_0x7039('0x24')](handleEntityNotFound(_0x45b237,null))['then'](function(_0x19ae99){if(_0x19ae99){_0x288e5f['body'][_0x7039('0x55')]=_0x19ae99['id'];return db[_0x7039('0x56')]['create'](_0x288e5f[_0x7039('0x4e')]);}})[_0x7039('0x24')](respondWithResult(_0x45b237,null))['catch'](handleError(_0x45b237,null));};exports[_0x7039('0x57')]=function(_0x53139a,_0xc4b58a,_0xc4e151){if(_0x53139a[_0x7039('0x4e')]['id']){delete _0x53139a[_0x7039('0x4e')]['id'];}return db[_0x7039('0x45')][_0x7039('0x4c')]({'where':{'id':_0x53139a[_0x7039('0x4b')]['id']}})[_0x7039('0x24')](handleEntityNotFound(_0xc4b58a,null))[_0x7039('0x24')](function(_0x2b773e){if(_0x2b773e){_0x53139a['body']['TriggerAnyId']=_0x2b773e['id'];return db['Condition'][_0x7039('0x4d')](_0x53139a[_0x7039('0x4e')]);}})[_0x7039('0x24')](respondWithResult(_0xc4b58a,null))[_0x7039('0x49')](handleError(_0xc4b58a,null));};exports['getAllConditions']=function(_0x45137d,_0x4555a7,_0x3ac5df){var _0x2e4a42={};var _0x5ccba3={};var _0x170a25;var _0xc3c6f4;return db['Trigger'][_0x7039('0x58')]({'where':{'id':_0x45137d[_0x7039('0x4b')]['id']}})[_0x7039('0x24')](handleEntityNotFound(_0x4555a7,null))[_0x7039('0x24')](function(_0xf6e2a0){if(_0xf6e2a0){_0x170a25=_0xf6e2a0;_0x5ccba3['model']=_[_0x7039('0x34')](db['Condition'][_0x7039('0x2f')]);_0x5ccba3[_0x7039('0x35')]=_['keys'](_0x45137d[_0x7039('0x35')]);_0x5ccba3[_0x7039('0x3f')]=_['intersection'](_0x5ccba3['model'],_0x5ccba3['query']);_0x2e4a42['attributes']=_[_0x7039('0x36')](_0x5ccba3[_0x7039('0x33')],qs[_0x7039('0x38')](_0x45137d['query'][_0x7039('0x38')]));_0x2e4a42[_0x7039('0x37')]=_0x2e4a42['attributes'][_0x7039('0x39')]?_0x2e4a42[_0x7039('0x37')]:_0x5ccba3[_0x7039('0x33')];_0x2e4a42['order']=qs['sort'](_0x45137d[_0x7039('0x35')]['sort']);_0x2e4a42[_0x7039('0x3e')]=qs['filters'](_[_0x7039('0x40')](_0x45137d[_0x7039('0x35')],_0x5ccba3[_0x7039('0x3f')]));if(_0x45137d[_0x7039('0x35')][_0x7039('0x41')]){_0x2e4a42[_0x7039('0x3e')]=_[_0x7039('0x42')](_0x2e4a42[_0x7039('0x3e')],{'$or':_[_0x7039('0x2e')](_0x2e4a42[_0x7039('0x37')],function(_0x3cac22){var _0x14b8da={};_0x14b8da[_0x3cac22]={'$like':'%'+_0x45137d[_0x7039('0x35')][_0x7039('0x41')]+'%'};return _0x14b8da;})});}_0x2e4a42=_['merge']({},_0x2e4a42,_0x45137d[_0x7039('0x44')]);return _0x170a25[_0x7039('0x59')](_0x2e4a42);}})[_0x7039('0x24')](function(_0x2bbe22){if(_0x2bbe22){_0xc3c6f4=_0x2bbe22[_0x7039('0x39')];if(!_0x45137d[_0x7039('0x35')][_0x7039('0x3a')](_0x7039('0x3b'))){_0x2e4a42[_0x7039('0x1b')]=qs['limit'](_0x45137d['query'][_0x7039('0x1b')]);_0x2e4a42[_0x7039('0x1a')]=qs['offset'](_0x45137d[_0x7039('0x35')][_0x7039('0x1a')]);}return _0x170a25[_0x7039('0x59')](_0x2e4a42);}})[_0x7039('0x24')](function(_0x52a70b){if(_0x52a70b){return _0x52a70b?{'count':_0xc3c6f4,'rows':_0x52a70b}:null;}})[_0x7039('0x24')](respondWithResult(_0x4555a7,null))[_0x7039('0x49')](handleError(_0x4555a7,null));};exports[_0x7039('0x5a')]=function(_0x4ccdbb,_0xb32bdd,_0x4d3b65){var _0x96e7bf={};var _0x1f3c9c={};var _0xfd56cf;var _0xe52415;return db['Trigger']['findOne']({'where':{'id':_0x4ccdbb[_0x7039('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb32bdd,null))[_0x7039('0x24')](function(_0x9652d7){if(_0x9652d7){_0xfd56cf=_0x9652d7;_0x1f3c9c['model']=_[_0x7039('0x34')](db[_0x7039('0x56')][_0x7039('0x2f')]);_0x1f3c9c[_0x7039('0x35')]=_['keys'](_0x4ccdbb['query']);_0x1f3c9c[_0x7039('0x3f')]=_[_0x7039('0x36')](_0x1f3c9c[_0x7039('0x33')],_0x1f3c9c[_0x7039('0x35')]);_0x96e7bf[_0x7039('0x37')]=_[_0x7039('0x36')](_0x1f3c9c['model'],qs[_0x7039('0x38')](_0x4ccdbb[_0x7039('0x35')]['fields']));_0x96e7bf[_0x7039('0x37')]=_0x96e7bf[_0x7039('0x37')][_0x7039('0x39')]?_0x96e7bf[_0x7039('0x37')]:_0x1f3c9c['model'];_0x96e7bf['order']=qs['sort'](_0x4ccdbb[_0x7039('0x35')][_0x7039('0x3d')]);_0x96e7bf['where']=qs[_0x7039('0x3f')](_[_0x7039('0x40')](_0x4ccdbb[_0x7039('0x35')],_0x1f3c9c[_0x7039('0x3f')]));if(_0x4ccdbb[_0x7039('0x35')][_0x7039('0x41')]){_0x96e7bf['where']=_['merge'](_0x96e7bf[_0x7039('0x3e')],{'$or':_[_0x7039('0x2e')](_0x96e7bf[_0x7039('0x37')],function(_0x4f2985){var _0x1d1045={};_0x1d1045[_0x4f2985]={'$like':'%'+_0x4ccdbb[_0x7039('0x35')][_0x7039('0x41')]+'%'};return _0x1d1045;})});}_0x96e7bf=_[_0x7039('0x42')]({},_0x96e7bf,_0x4ccdbb[_0x7039('0x44')]);return _0xfd56cf[_0x7039('0x5a')](_0x96e7bf);}})[_0x7039('0x24')](function(_0x1e06aa){if(_0x1e06aa){_0xe52415=_0x1e06aa[_0x7039('0x39')];if(!_0x4ccdbb[_0x7039('0x35')][_0x7039('0x3a')](_0x7039('0x3b'))){_0x96e7bf[_0x7039('0x1b')]=qs[_0x7039('0x1b')](_0x4ccdbb[_0x7039('0x35')]['limit']);_0x96e7bf['offset']=qs[_0x7039('0x1a')](_0x4ccdbb[_0x7039('0x35')]['offset']);}return _0xfd56cf[_0x7039('0x5a')](_0x96e7bf);}})[_0x7039('0x24')](function(_0x2597a7){if(_0x2597a7){return _0x2597a7?{'count':_0xe52415,'rows':_0x2597a7}:null;}})[_0x7039('0x24')](respondWithResult(_0xb32bdd,null))[_0x7039('0x49')](handleError(_0xb32bdd,null));};exports[_0x7039('0x5b')]=function(_0x593729,_0x489e97,_0x1c865f){if(_0x593729[_0x7039('0x4e')]['id']){delete _0x593729[_0x7039('0x4e')]['id'];}return db['Trigger'][_0x7039('0x4c')]({'where':{'id':_0x593729[_0x7039('0x4b')]['id']}})[_0x7039('0x24')](handleEntityNotFound(_0x489e97,null))[_0x7039('0x24')](function(_0x4151b8){if(_0x4151b8){_0x593729[_0x7039('0x4e')]['TriggerId']=_0x4151b8['id'];return db[_0x7039('0x5c')]['create'](_0x593729[_0x7039('0x4e')]);}})[_0x7039('0x24')](respondWithResult(_0x489e97,null))['catch'](handleError(_0x489e97,null));};exports[_0x7039('0x5d')]=function(_0x76f45f,_0x3e4c74,_0x395b9b){var _0x5a40c3={};var _0x44791f={};var _0x134d19;var _0x28a82a;return db['Trigger'][_0x7039('0x58')]({'where':{'id':_0x76f45f[_0x7039('0x4b')]['id']}})[_0x7039('0x24')](handleEntityNotFound(_0x3e4c74,null))['then'](function(_0x374531){if(_0x374531){_0x134d19=_0x374531;_0x44791f[_0x7039('0x33')]=_[_0x7039('0x34')](db[_0x7039('0x5c')][_0x7039('0x2f')]);_0x44791f['query']=_[_0x7039('0x34')](_0x76f45f[_0x7039('0x35')]);_0x44791f[_0x7039('0x3f')]=_[_0x7039('0x36')](_0x44791f[_0x7039('0x33')],_0x44791f[_0x7039('0x35')]);_0x5a40c3[_0x7039('0x37')]=_['intersection'](_0x44791f['model'],qs[_0x7039('0x38')](_0x76f45f[_0x7039('0x35')][_0x7039('0x38')]));_0x5a40c3['attributes']=_0x5a40c3[_0x7039('0x37')]['length']?_0x5a40c3[_0x7039('0x37')]:_0x44791f['model'];_0x5a40c3['order']=qs['sort'](_0x76f45f[_0x7039('0x35')][_0x7039('0x3d')]);_0x5a40c3[_0x7039('0x3e')]=qs[_0x7039('0x3f')](_[_0x7039('0x40')](_0x76f45f[_0x7039('0x35')],_0x44791f['filters']));if(_0x76f45f[_0x7039('0x35')][_0x7039('0x41')]){_0x5a40c3[_0x7039('0x3e')]=_[_0x7039('0x42')](_0x5a40c3[_0x7039('0x3e')],{'$or':_[_0x7039('0x2e')](_0x5a40c3[_0x7039('0x37')],function(_0x118f84){var _0x1363fe={};_0x1363fe[_0x118f84]={'$like':'%'+_0x76f45f[_0x7039('0x35')][_0x7039('0x41')]+'%'};return _0x1363fe;})});}_0x5a40c3=_['merge']({},_0x5a40c3,_0x76f45f['options']);return _0x134d19[_0x7039('0x5d')](_0x5a40c3);}})['then'](function(_0x351d09){if(_0x351d09){_0x28a82a=_0x351d09[_0x7039('0x39')];if(!_0x76f45f['query'][_0x7039('0x3a')]('nolimit')){_0x5a40c3[_0x7039('0x1b')]=qs[_0x7039('0x1b')](_0x76f45f[_0x7039('0x35')][_0x7039('0x1b')]);_0x5a40c3['offset']=qs[_0x7039('0x1a')](_0x76f45f[_0x7039('0x35')][_0x7039('0x1a')]);}return _0x134d19[_0x7039('0x5d')](_0x5a40c3);}})[_0x7039('0x24')](function(_0x3dd670){if(_0x3dd670){return _0x3dd670?{'count':_0x28a82a,'rows':_0x3dd670}:null;}})[_0x7039('0x24')](respondWithResult(_0x3e4c74,null))[_0x7039('0x49')](handleError(_0x3e4c74,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index cad15f9..cf04e83 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 _0x0048=['bluebird','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','util','../../config/logger','moment'];(function(_0x2d9198,_0x542740){var _0x22dd02=function(_0x139d18){while(--_0x139d18){_0x2d9198['push'](_0x2d9198['shift']());}};_0x22dd02(++_0x542740);}(_0x0048,0x129));var _0x8004=function(_0x52b016,_0x33ec6e){_0x52b016=_0x52b016-0x0;var _0x13e797=_0x0048[_0x52b016];return _0x13e797;};'use strict';var _=require('lodash');var util=require(_0x8004('0x0'));var logger=require(_0x8004('0x1'))('api');var moment=require(_0x8004('0x2'));var BPromise=require(_0x8004('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8004('0x4'));var rimraf=require(_0x8004('0x5'));var config=require(_0x8004('0x6'));var attributes=require(_0x8004('0x7'));module['exports']=function(_0x532337,_0x3aaed7){return _0x532337[_0x8004('0x8')](_0x8004('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3351=['exports','define','Trigger','tools_triggers','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x3351,0x1b4));var _0x1335=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3351[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x1335('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var fs=require('fs');var path=require(_0x1335('0x5'));var rimraf=require(_0x1335('0x6'));var config=require(_0x1335('0x7'));var attributes=require('./trigger.attributes');module[_0x1335('0x8')]=function(_0x1b951c,_0x2ee73b){return _0x1b951c[_0x1335('0x9')](_0x1335('0xa'),attributes,{'tableName':_0x1335('0xb'),'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 2718006..a09a7ce 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 _0x11a5=['findAll','options','attributes','limit','include','model','info','ShowTrigger','raw','where','map','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','GetTrigger','Trigger'];(function(_0x447029,_0x48fda3){var _0x41a6d8=function(_0x2399bf){while(--_0x2399bf){_0x447029['push'](_0x447029['shift']());}};_0x41a6d8(++_0x48fda3);}(_0x11a5,0x83));var _0x511a=function(_0x388bfa,_0x1f518c){_0x388bfa=_0x388bfa-0x0;var _0x11d6a6=_0x11a5[_0x388bfa];return _0x11d6a6;};'use strict';var _=require(_0x511a('0x0'));var util=require('util');var moment=require(_0x511a('0x1'));var BPromise=require(_0x511a('0x2'));var rs=require(_0x511a('0x3'));var fs=require('fs');var Redis=require(_0x511a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x511a('0x5'))(_0x511a('0x6'));var config=require('../../config/environment');var jayson=require(_0x511a('0x7'));var client=jayson[_0x511a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59a83b,_0x54c803,_0x3bceee){return new BPromise(function(_0x9f6488,_0x1dbf9a){return client['request'](_0x59a83b,_0x3bceee)[_0x511a('0x9')](function(_0x376d9d){logger['info']('Trigger,\x20%s,\x20%s',_0x54c803,_0x511a('0xa'));logger[_0x511a('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x54c803,_0x511a('0xa'),JSON[_0x511a('0xc')](_0x376d9d));if(_0x376d9d[_0x511a('0xd')]){if(_0x376d9d[_0x511a('0xd')][_0x511a('0xe')]===0x1f4){logger['error'](_0x511a('0xf'),_0x54c803,_0x376d9d['error'][_0x511a('0x10')]);return _0x1dbf9a(_0x376d9d[_0x511a('0xd')]['message']);}logger[_0x511a('0xd')](_0x511a('0xf'),_0x54c803,_0x376d9d[_0x511a('0xd')][_0x511a('0x10')]);return _0x9f6488(_0x376d9d[_0x511a('0xd')][_0x511a('0x10')]);}else{logger['info'](_0x511a('0xf'),_0x54c803,'request\x20sent');_0x9f6488(_0x376d9d['result'][_0x511a('0x10')]);}})['catch'](function(_0x32ff98){logger[_0x511a('0xd')](_0x511a('0xf'),_0x54c803,_0x32ff98);_0x1dbf9a(_0x32ff98);});});}exports[_0x511a('0x11')]=function(_0x1abb05){var _0x150f6=this;return new Promise(function(_0x5bd60f,_0x3c3210){return db[_0x511a('0x12')][_0x511a('0x13')]({'raw':_0x1abb05[_0x511a('0x14')]?_0x1abb05[_0x511a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1abb05[_0x511a('0x14')]?_0x1abb05['options']['where']||null:null,'attributes':_0x1abb05[_0x511a('0x14')]?_0x1abb05['options'][_0x511a('0x15')]||null:null,'limit':_0x1abb05[_0x511a('0x14')]?_0x1abb05[_0x511a('0x14')][_0x511a('0x16')]||null:null,'include':_0x1abb05[_0x511a('0x14')]?_0x1abb05[_0x511a('0x14')][_0x511a('0x17')]?_['map'](_0x1abb05[_0x511a('0x14')]['include'],function(_0x58a2d3){return{'model':db[_0x58a2d3[_0x511a('0x18')]],'as':_0x58a2d3['as'],'attributes':_0x58a2d3[_0x511a('0x15')],'include':_0x58a2d3[_0x511a('0x17')]?_['map'](_0x58a2d3[_0x511a('0x17')],function(_0x339b3a){return{'model':db[_0x339b3a[_0x511a('0x18')]],'as':_0x339b3a['as'],'attributes':_0x339b3a[_0x511a('0x15')],'include':_0x339b3a[_0x511a('0x17')]?_['map'](_0x339b3a[_0x511a('0x17')],function(_0x48aeda){return{'model':db[_0x48aeda[_0x511a('0x18')]],'as':_0x48aeda['as'],'attributes':_0x48aeda[_0x511a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x511a('0x9')](function(_0x3f44f9){logger[_0x511a('0x19')](_0x511a('0x11'),_0x1abb05);logger['debug']('GetTrigger',_0x1abb05,JSON['stringify'](_0x3f44f9));_0x5bd60f(_0x3f44f9);})['catch'](function(_0x5473ed){logger[_0x511a('0xd')](_0x511a('0x11'),_0x5473ed[_0x511a('0x10')],_0x1abb05);_0x3c3210(_0x150f6[_0x511a('0xd')](0x1f4,_0x5473ed['message']));});});};exports[_0x511a('0x1a')]=function(_0x41178d){var _0x9cba48=this;return new Promise(function(_0x5c6cf9,_0x543613){return db['Trigger']['find']({'raw':_0x41178d[_0x511a('0x14')]?_0x41178d[_0x511a('0x14')][_0x511a('0x1b')]===undefined?!![]:![]:!![],'where':_0x41178d[_0x511a('0x14')]?_0x41178d['options'][_0x511a('0x1c')]||null:null,'attributes':_0x41178d[_0x511a('0x14')]?_0x41178d[_0x511a('0x14')][_0x511a('0x15')]||null:null,'include':_0x41178d[_0x511a('0x14')]?_0x41178d[_0x511a('0x14')][_0x511a('0x17')]?_['map'](_0x41178d[_0x511a('0x14')]['include'],function(_0x454987){return{'model':db[_0x454987[_0x511a('0x18')]],'as':_0x454987['as'],'attributes':_0x454987['attributes'],'include':_0x454987['include']?_[_0x511a('0x1d')](_0x454987['include'],function(_0x5d52d4){return{'model':db[_0x5d52d4[_0x511a('0x18')]],'as':_0x5d52d4['as'],'attributes':_0x5d52d4['attributes'],'include':_0x5d52d4[_0x511a('0x17')]?_[_0x511a('0x1d')](_0x5d52d4[_0x511a('0x17')],function(_0x2d6e21){return{'model':db[_0x2d6e21[_0x511a('0x18')]],'as':_0x2d6e21['as'],'attributes':_0x2d6e21[_0x511a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x511a('0x9')](function(_0x474de0){logger['info'](_0x511a('0x1a'),_0x41178d);logger[_0x511a('0xb')](_0x511a('0x1a'),_0x41178d,JSON[_0x511a('0xc')](_0x474de0));_0x5c6cf9(_0x474de0);})['catch'](function(_0x9b5572){logger[_0x511a('0xd')](_0x511a('0x1a'),_0x9b5572[_0x511a('0x10')],_0x41178d);_0x543613(_0x9cba48[_0x511a('0xd')](0x1f4,_0x9b5572[_0x511a('0x10')]));});});}; \ No newline at end of file +var _0x4c81=['result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','map','include','model','find','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3935a6,_0x4855af){var _0x5025b9=function(_0x51a86a){while(--_0x51a86a){_0x3935a6['push'](_0x3935a6['shift']());}};_0x5025b9(++_0x4855af);}(_0x4c81,0x1a5));var _0x14c8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4c81[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x14c8('0x0'));var util=require(_0x14c8('0x1'));var moment=require('moment');var BPromise=require(_0x14c8('0x2'));var rs=require(_0x14c8('0x3'));var fs=require('fs');var Redis=require(_0x14c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14c8('0x5'));var logger=require(_0x14c8('0x6'))(_0x14c8('0x7'));var config=require(_0x14c8('0x8'));var jayson=require(_0x14c8('0x9'));var client=jayson[_0x14c8('0xa')][_0x14c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b2fd,_0x2f7014,_0x37d0c3){return new BPromise(function(_0x16a801,_0x112507){return client[_0x14c8('0xc')](_0x52b2fd,_0x37d0c3)[_0x14c8('0xd')](function(_0x425945){logger[_0x14c8('0xe')](_0x14c8('0xf'),_0x2f7014,'request\x20sent');logger[_0x14c8('0x10')](_0x14c8('0x11'),_0x2f7014,_0x14c8('0x12'),JSON[_0x14c8('0x13')](_0x425945));if(_0x425945[_0x14c8('0x14')]){if(_0x425945[_0x14c8('0x14')][_0x14c8('0x15')]===0x1f4){logger[_0x14c8('0x14')](_0x14c8('0xf'),_0x2f7014,_0x425945[_0x14c8('0x14')][_0x14c8('0x16')]);return _0x112507(_0x425945[_0x14c8('0x14')][_0x14c8('0x16')]);}logger[_0x14c8('0x14')](_0x14c8('0xf'),_0x2f7014,_0x425945['error']['message']);return _0x16a801(_0x425945[_0x14c8('0x14')][_0x14c8('0x16')]);}else{logger[_0x14c8('0xe')]('Trigger,\x20%s,\x20%s',_0x2f7014,_0x14c8('0x12'));_0x16a801(_0x425945[_0x14c8('0x17')][_0x14c8('0x16')]);}})[_0x14c8('0x18')](function(_0x2af006){logger[_0x14c8('0x14')](_0x14c8('0xf'),_0x2f7014,_0x2af006);_0x112507(_0x2af006);});});}exports[_0x14c8('0x19')]=function(_0x19e39b){var _0x4d1899=this;return new Promise(function(_0x5632f3,_0x27daa7){return db[_0x14c8('0x1a')][_0x14c8('0x1b')]({'raw':_0x19e39b[_0x14c8('0x1c')]?_0x19e39b[_0x14c8('0x1c')][_0x14c8('0x1d')]===undefined?!![]:![]:!![],'where':_0x19e39b[_0x14c8('0x1c')]?_0x19e39b[_0x14c8('0x1c')]['where']||null:null,'attributes':_0x19e39b[_0x14c8('0x1c')]?_0x19e39b['options'][_0x14c8('0x1e')]||null:null,'limit':_0x19e39b['options']?_0x19e39b[_0x14c8('0x1c')][_0x14c8('0x1f')]||null:null,'include':_0x19e39b[_0x14c8('0x1c')]?_0x19e39b[_0x14c8('0x1c')]['include']?_[_0x14c8('0x20')](_0x19e39b[_0x14c8('0x1c')][_0x14c8('0x21')],function(_0x44c454){return{'model':db[_0x44c454[_0x14c8('0x22')]],'as':_0x44c454['as'],'attributes':_0x44c454[_0x14c8('0x1e')],'include':_0x44c454[_0x14c8('0x21')]?_['map'](_0x44c454[_0x14c8('0x21')],function(_0x1ec620){return{'model':db[_0x1ec620[_0x14c8('0x22')]],'as':_0x1ec620['as'],'attributes':_0x1ec620[_0x14c8('0x1e')],'include':_0x1ec620[_0x14c8('0x21')]?_[_0x14c8('0x20')](_0x1ec620[_0x14c8('0x21')],function(_0x31dcb6){return{'model':db[_0x31dcb6['model']],'as':_0x31dcb6['as'],'attributes':_0x31dcb6[_0x14c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14c8('0xd')](function(_0x46beaf){logger['info']('GetTrigger',_0x19e39b);logger[_0x14c8('0x10')](_0x14c8('0x19'),_0x19e39b,JSON[_0x14c8('0x13')](_0x46beaf));_0x5632f3(_0x46beaf);})[_0x14c8('0x18')](function(_0x5728c6){logger[_0x14c8('0x14')](_0x14c8('0x19'),_0x5728c6[_0x14c8('0x16')],_0x19e39b);_0x27daa7(_0x4d1899[_0x14c8('0x14')](0x1f4,_0x5728c6[_0x14c8('0x16')]));});});};exports['ShowTrigger']=function(_0x9dda66){var _0x29563d=this;return new Promise(function(_0x5eb29f,_0x3776e7){return db[_0x14c8('0x1a')][_0x14c8('0x23')]({'raw':_0x9dda66[_0x14c8('0x1c')]?_0x9dda66['options'][_0x14c8('0x1d')]===undefined?!![]:![]:!![],'where':_0x9dda66[_0x14c8('0x1c')]?_0x9dda66[_0x14c8('0x1c')]['where']||null:null,'attributes':_0x9dda66['options']?_0x9dda66[_0x14c8('0x1c')]['attributes']||null:null,'include':_0x9dda66[_0x14c8('0x1c')]?_0x9dda66['options'][_0x14c8('0x21')]?_[_0x14c8('0x20')](_0x9dda66[_0x14c8('0x1c')][_0x14c8('0x21')],function(_0x100527){return{'model':db[_0x100527[_0x14c8('0x22')]],'as':_0x100527['as'],'attributes':_0x100527[_0x14c8('0x1e')],'include':_0x100527[_0x14c8('0x21')]?_[_0x14c8('0x20')](_0x100527[_0x14c8('0x21')],function(_0x898897){return{'model':db[_0x898897['model']],'as':_0x898897['as'],'attributes':_0x898897[_0x14c8('0x1e')],'include':_0x898897[_0x14c8('0x21')]?_[_0x14c8('0x20')](_0x898897[_0x14c8('0x21')],function(_0x32e1eb){return{'model':db[_0x32e1eb[_0x14c8('0x22')]],'as':_0x32e1eb['as'],'attributes':_0x32e1eb[_0x14c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14c8('0xd')](function(_0x23e8e0){logger[_0x14c8('0xe')](_0x14c8('0x24'),_0x9dda66);logger[_0x14c8('0x10')]('ShowTrigger',_0x9dda66,JSON[_0x14c8('0x13')](_0x23e8e0));_0x5eb29f(_0x23e8e0);})[_0x14c8('0x18')](function(_0x26ff20){logger[_0x14c8('0x14')](_0x14c8('0x24'),_0x26ff20['message'],_0x9dda66);_0x3776e7(_0x29563d[_0x14c8('0x14')](0x1f4,_0x26ff20[_0x14c8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 6c52a25..5253860 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 _0xf33f=['index','get','show','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0xf33f,0x165));var _0xff33=function(_0x3e50ea,_0x43be43){_0x3e50ea=_0x3e50ea-0x0;var _0x3ec954=_0xf33f[_0x3e50ea];return _0x3ec954;};'use strict';var multer=require(_0xff33('0x0'));var util=require('util');var path=require(_0xff33('0x1'));var timeout=require(_0xff33('0x2'));var express=require(_0xff33('0x3'));var router=express[_0xff33('0x4')]();var fs_extra=require(_0xff33('0x5'));var auth=require(_0xff33('0x6'));var interaction=require(_0xff33('0x7'));var config=require(_0xff33('0x8'));var controller=require(_0xff33('0x9'));router['get']('/',auth[_0xff33('0xa')](),controller[_0xff33('0xb')]);router[_0xff33('0xc')]('/:id',auth[_0xff33('0xa')](),controller[_0xff33('0xd')]);router[_0xff33('0xe')](_0xff33('0xf'),auth['isAuthenticated'](),controller[_0xff33('0x10')]);router[_0xff33('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xff33('0x11')](_0xff33('0x12'),auth[_0xff33('0xa')](),controller[_0xff33('0x13')]);router[_0xff33('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xff33('0x15')]);module[_0xff33('0x16')]=router; \ No newline at end of file +var _0x50d9=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','update'];(function(_0x1b5549,_0x4a4f2f){var _0x373443=function(_0x33e575){while(--_0x33e575){_0x1b5549['push'](_0x1b5549['shift']());}};_0x373443(++_0x4a4f2f);}(_0x50d9,0x17d));var _0x950d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x50d9[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x950d('0x0'));var util=require(_0x950d('0x1'));var path=require(_0x950d('0x2'));var timeout=require(_0x950d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x950d('0x4'));var auth=require(_0x950d('0x5'));var interaction=require(_0x950d('0x6'));var config=require('../../config/environment');var controller=require(_0x950d('0x7'));router[_0x950d('0x8')]('/',auth[_0x950d('0x9')](),controller['index']);router[_0x950d('0x8')](_0x950d('0xa'),auth[_0x950d('0x9')](),controller[_0x950d('0xb')]);router[_0x950d('0xc')](_0x950d('0xd'),auth[_0x950d('0x9')](),controller[_0x950d('0xe')]);router[_0x950d('0xc')]('/',auth[_0x950d('0x9')](),controller[_0x950d('0xf')]);router[_0x950d('0x10')](_0x950d('0xa'),auth[_0x950d('0x9')](),controller[_0x950d('0x11')]);router[_0x950d('0x12')](_0x950d('0xa'),auth[_0x950d('0x9')](),controller[_0x950d('0x13')]);module[_0x950d('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c45fd67..af2aaa8 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 _0x9365=['shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','accept','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0x2f3a6c,_0x57864b){var _0x30ae10=function(_0x32ffb0){while(--_0x32ffb0){_0x2f3a6c['push'](_0x2f3a6c['shift']());}};_0x30ae10(++_0x57864b);}(_0x9365,0x1c6));var _0x5936=function(_0x99934c,_0x46b906){_0x99934c=_0x99934c-0x0;var _0x460631=_0x9365[_0x99934c];return _0x460631;};'use strict';var Sequelize=require(_0x5936('0x0'));module[_0x5936('0x1')]={'name':{'type':Sequelize[_0x5936('0x2')],'allowNull':![],'unique':_0x5936('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x5'),'user',_0x5936('0x6')),'allowNull':![],'defaultValue':_0x5936('0x5')},'context':{'type':Sequelize[_0x5936('0x2')],'allowNull':![],'defaultValue':_0x5936('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x5936('0x8'),_0x5936('0x9'),_0x5936('0xa'),_0x5936('0xb'),_0x5936('0xc'),_0x5936('0xd'),_0x5936('0xe'),_0x5936('0xf'))},'deny':{'type':Sequelize[_0x5936('0x2')]},'permit':{'type':Sequelize[_0x5936('0x2')]},'secret':{'type':Sequelize[_0x5936('0x2')]},'md5secret':{'type':Sequelize[_0x5936('0x2')]},'remotesecret':{'type':Sequelize[_0x5936('0x2')]},'transport':{'type':Sequelize[_0x5936('0x2')],'defaultValue':_0x5936('0x10'),'set':function(_0xc2546d){this['setDataValue'](_0x5936('0x11'),_0xc2546d?_0xc2546d[_0x5936('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x5936('0x11'))?this['getDataValue']('transport')[_0x5936('0x13')](','):null;},'comment':_0x5936('0x14')},'dtmfmode':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x15'),_0x5936('0x16'),_0x5936('0x17'),_0x5936('0x18'),_0x5936('0x19')),'defaultValue':_0x5936('0x15')},'directmedia':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no',_0x5936('0x1b'),'update',_0x5936('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x5936('0x2')],'defaultValue':_0x5936('0x1d'),'set':function(_0x3c17b0){this[_0x5936('0x1e')](_0x5936('0x1f'),_0x3c17b0?_0x3c17b0[_0x5936('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x5936('0x1f'))?this[_0x5936('0x20')](_0x5936('0x1f'))[_0x5936('0x13')](','):null;},'comment':_0x5936('0x21')},'callgroup':{'type':Sequelize[_0x5936('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5936('0x2')]},'pickupgroup':{'type':Sequelize[_0x5936('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x5936('0x2')]},'language':{'type':Sequelize[_0x5936('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5936('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5936('0x2')],'defaultValue':_0x5936('0x22')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5936('0x23'),'set':function(_0x37fee7){this['setDataValue'](_0x5936('0x24'),_0x37fee7?_0x37fee7['join'](';'):_0x5936('0x23'));},'get':function(){return this[_0x5936('0x20')](_0x5936('0x24'))?this[_0x5936('0x20')](_0x5936('0x24'))[_0x5936('0x13')](';'):null;},'comment':_0x5936('0x25')},'autoframing':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'insecure':{'type':Sequelize[_0x5936('0x2')],'defaultValue':_0x5936('0x26'),'set':function(_0x4567e3){this[_0x5936('0x1e')](_0x5936('0x27'),_0x4567e3?_0x4567e3[_0x5936('0x12')](','):null);},'get':function(){return this[_0x5936('0x20')]('insecure')?this[_0x5936('0x20')](_0x5936('0x27'))['split'](','):null;},'comment':_0x5936('0x28')},'trustrpid':{'type':Sequelize['ENUM'](_0x5936('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x5936('0x29')](0xb)},'setvar':{'type':Sequelize[_0x5936('0x2')]},'callerid':{'type':Sequelize[_0x5936('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':_0x5936('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x5936('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x5936('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x5936('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x5936('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5936('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x5936('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x5936('0x2a'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x5936('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x5936('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x2b'),_0x5936('0x2c')),'defaultValue':_0x5936('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x5936('0x2')]},'regexten':{'type':Sequelize[_0x5936('0x2')]},'fromdomain':{'type':Sequelize[_0x5936('0x2')]},'fromuser':{'type':Sequelize[_0x5936('0x2')]},'port':{'type':Sequelize[_0x5936('0x29')](0x5)},'qualify':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':_0x5936('0x1a')},'keepalive':{'type':Sequelize[_0x5936('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x5936('0x2')]},'defaultuser':{'type':Sequelize[_0x5936('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5936('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5936('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no',_0x5936('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5936('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x5936('0x29')](0xb)},'timerb':{'type':Sequelize[_0x5936('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x5936('0x2')]},'contactacl':{'type':Sequelize[_0x5936('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x5936('0x2')]},'use_q850_reason':{'type':Sequelize[_0x5936('0x2')]},'maxforwards':{'type':Sequelize[_0x5936('0x29')](0xb)},'encryption':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5936('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x5936('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no',_0x5936('0x2e'),_0x5936('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x5936('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x5936('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x5936('0x2')]},'dtlscafile':{'type':Sequelize[_0x5936('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x30'),_0x5936('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5936('0x2')]},'usereqphone':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x5936('0x2')]},'call_limit':{'type':Sequelize[_0x5936('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x5936('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x5936('0x4')](_0x5936('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x5936('0x2')]},'mohinterpret':{'type':Sequelize[_0x5936('0x2')]},'mohsuggest':{'type':Sequelize[_0x5936('0x2')]},'parkinglot':{'type':Sequelize[_0x5936('0x2')]},'description':{'type':Sequelize[_0x5936('0x2')]},'host':{'type':Sequelize[_0x5936('0x2')],'defaultValue':_0x5936('0x32')},'canreinvite':{'type':Sequelize[_0x5936('0x4')]('yes','no',_0x5936('0x1b'),'update',_0x5936('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5936('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5936('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x5936('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x3493=['pai','fingerprint','certificate','active','actpass','update,nonat','exports','STRING','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','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','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas'];(function(_0x54da81,_0x598394){var _0xf28757=function(_0x2047b8){while(--_0x2047b8){_0x54da81['push'](_0x54da81['shift']());}};_0xf28757(++_0x598394);}(_0x3493,0x16b));var _0x3349=function(_0x124e0b,_0x50d410){_0x124e0b=_0x124e0b-0x0;var _0x2f4c1b=_0x3493[_0x124e0b];return _0x2f4c1b;};'use strict';var Sequelize=require('sequelize');module[_0x3349('0x0')]={'name':{'type':Sequelize[_0x3349('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3349('0x2'),_0x3349('0x3'),_0x3349('0x4')),'allowNull':![],'defaultValue':_0x3349('0x2')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3349('0x5')},'callingpres':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x7'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x3349('0x8'),'PROHIB_NOT_SCREENED',_0x3349('0x9'),_0x3349('0xa'),_0x3349('0xb'))},'deny':{'type':Sequelize[_0x3349('0x1')]},'permit':{'type':Sequelize[_0x3349('0x1')]},'secret':{'type':Sequelize[_0x3349('0x1')]},'md5secret':{'type':Sequelize[_0x3349('0x1')]},'remotesecret':{'type':Sequelize[_0x3349('0x1')]},'transport':{'type':Sequelize[_0x3349('0x1')],'defaultValue':_0x3349('0xc'),'set':function(_0x12615b){this[_0x3349('0xd')]('transport',_0x12615b?_0x12615b[_0x3349('0xe')](','):null);},'get':function(){return this[_0x3349('0xf')](_0x3349('0x10'))?this[_0x3349('0xf')](_0x3349('0x10'))[_0x3349('0x11')](','):null;},'comment':_0x3349('0x12')},'dtmfmode':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x13'),_0x3349('0x14'),_0x3349('0x15'),_0x3349('0x16'),_0x3349('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no',_0x3349('0x19'),_0x3349('0x1a'),_0x3349('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3349('0x1')]},'directmediadeny':{'type':Sequelize[_0x3349('0x1')]},'nat':{'type':Sequelize[_0x3349('0x1')],'defaultValue':_0x3349('0x1c'),'set':function(_0x24cbf7){this[_0x3349('0xd')]('nat',_0x24cbf7?_0x24cbf7['join'](','):null);},'get':function(){return this[_0x3349('0xf')]('nat')?this[_0x3349('0xf')](_0x3349('0x1d'))[_0x3349('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3349('0x1')]},'namedcallgroup':{'type':Sequelize[_0x3349('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3349('0x1')]},'language':{'type':Sequelize[_0x3349('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3349('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3349('0x1')],'defaultValue':_0x3349('0x1e')},'allow':{'type':Sequelize[_0x3349('0x1')],'allowNull':![],'defaultValue':_0x3349('0x1f'),'set':function(_0x2ad9d6){this['setDataValue'](_0x3349('0x20'),_0x2ad9d6?_0x2ad9d6[_0x3349('0xe')](';'):_0x3349('0x1f'));},'get':function(){return this[_0x3349('0xf')]('allow')?this[_0x3349('0xf')](_0x3349('0x20'))['split'](';'):null;},'comment':_0x3349('0x21')},'autoframing':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'insecure':{'type':Sequelize[_0x3349('0x1')],'defaultValue':_0x3349('0x22'),'set':function(_0x56d955){this[_0x3349('0xd')](_0x3349('0x23'),_0x56d955?_0x56d955[_0x3349('0xe')](','):null);},'get':function(){return this[_0x3349('0xf')]('insecure')?this['getDataValue'](_0x3349('0x23'))['split'](','):null;},'comment':_0x3349('0x24')},'trustrpid':{'type':Sequelize[_0x3349('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no',_0x3349('0x25'))},'promiscredir':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3349('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x3349('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3349('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x3349('0x1')]},'template':{'type':Sequelize[_0x3349('0x1')]},'videosupport':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no',_0x3349('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3349('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x29'),_0x3349('0x2a'),_0x3349('0x2b'))},'session_expires':{'type':Sequelize[_0x3349('0x27')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'defaultValue':_0x3349('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x3349('0x1')]},'regexten':{'type':Sequelize[_0x3349('0x1')]},'fromdomain':{'type':Sequelize[_0x3349('0x1')]},'fromuser':{'type':Sequelize[_0x3349('0x1')]},'port':{'type':Sequelize[_0x3349('0x27')](0x5)},'qualify':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no'),'defaultValue':_0x3349('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3349('0x1')]},'defaultuser':{'type':Sequelize[_0x3349('0x1')]},'rtptimeout':{'type':Sequelize[_0x3349('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3349('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no',_0x3349('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x3349('0x1')]},'timert1':{'type':Sequelize[_0x3349('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x3349('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x3349('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x3349('0x1')]},'use_q850_reason':{'type':Sequelize[_0x3349('0x1')]},'maxforwards':{'type':Sequelize[_0x3349('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'force_avp':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'icesupport':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x3349('0x6')]('yes','no',_0x3349('0x2e'),_0x3349('0x2f'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x3349('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x3349('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3349('0x30'),'passive',_0x3349('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3349('0x1')]},'usereqphone':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3349('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x3349('0x18'),'no')},'vmexten':{'type':Sequelize[_0x3349('0x1')]},'mohinterpret':{'type':Sequelize[_0x3349('0x1')]},'mohsuggest':{'type':Sequelize[_0x3349('0x1')]},'parkinglot':{'type':Sequelize[_0x3349('0x1')]},'description':{'type':Sequelize[_0x3349('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x3349('0x6')](_0x3349('0x18'),'no','nonat',_0x3349('0x1a'),_0x3349('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x3349('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3349('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index ef341e6..f642519 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x20f256,_0x2f58ec){var _0x5ced25=function(_0x15a4c4){while(--_0x15a4c4){_0x20f256['push'](_0x20f256['shift']());}};_0x5ced25(++_0x2f58ec);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x24ca[_0x1573ea];return _0x51c0e2;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','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','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x20ca54,_0x41474f){var _0x521b21=function(_0x3b449d){while(--_0x3b449d){_0x20ca54['push'](_0x20ca54['shift']());}};_0x521b21(++_0x41474f);}(_0x3e74,0x175));var _0x43e7=function(_0x4efa6a,_0x5436ce){_0x4efa6a=_0x4efa6a-0x0;var _0x555295=_0x3e74[_0x4efa6a];return _0x555295;};'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'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 17c155b..79ea595 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 _0x6c67=['path','rimraf','../../config/environment','./trunk.attributes','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c67,0xf7));var _0x76c6=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x6c67[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x76c6('0x0'));var util=require(_0x76c6('0x1'));var logger=require('../../config/logger')(_0x76c6('0x2'));var moment=require(_0x76c6('0x3'));var BPromise=require(_0x76c6('0x4'));var rp=require(_0x76c6('0x5'));var fs=require('fs');var path=require(_0x76c6('0x6'));var rimraf=require(_0x76c6('0x7'));var config=require(_0x76c6('0x8'));var attributes=require(_0x76c6('0x9'));module['exports']=function(_0x5aba0c,_0x267342){return _0x5aba0c[_0x76c6('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8218=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x2123f3,_0x397cac){var _0x354e06=function(_0x2d39c2){while(--_0x2d39c2){_0x2123f3['push'](_0x2123f3['shift']());}};_0x354e06(++_0x397cac);}(_0x8218,0x92));var _0x8821=function(_0x5e86ba,_0x3f1d62){_0x5e86ba=_0x5e86ba-0x0;var _0x2f3173=_0x8218[_0x5e86ba];return _0x2f3173;};'use strict';var _=require(_0x8821('0x0'));var util=require(_0x8821('0x1'));var logger=require(_0x8821('0x2'))(_0x8821('0x3'));var moment=require(_0x8821('0x4'));var BPromise=require(_0x8821('0x5'));var rp=require(_0x8821('0x6'));var fs=require('fs');var path=require(_0x8821('0x7'));var rimraf=require(_0x8821('0x8'));var config=require(_0x8821('0x9'));var attributes=require(_0x8821('0xa'));module[_0x8821('0xb')]=function(_0x3d2c8d,_0x58f8c5){return _0x3d2c8d[_0x8821('0xc')](_0x8821('0xd'),attributes,{'tableName':_0x8821('0xe'),'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 d26c642..75b6fb2 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 _0xe48a=['../../config/environment','jayson/promise','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','findAll','options','where','limit','include','model','map','attributes','info','debug','catch','ShowTrunk','find','raw','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x406490,_0x48609e){var _0x3b92eb=function(_0x475720){while(--_0x475720){_0x406490['push'](_0x406490['shift']());}};_0x3b92eb(++_0x48609e);}(_0xe48a,0xad));var _0xae48=function(_0x30eb36,_0x4f7dab){_0x30eb36=_0x30eb36-0x0;var _0x1b33d1=_0xe48a[_0x30eb36];return _0x1b33d1;};'use strict';var _=require(_0xae48('0x0'));var util=require('util');var moment=require(_0xae48('0x1'));var BPromise=require('bluebird');var rs=require(_0xae48('0x2'));var fs=require('fs');var Redis=require(_0xae48('0x3'));var db=require(_0xae48('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae48('0x5'))(_0xae48('0x6'));var config=require(_0xae48('0x7'));var jayson=require(_0xae48('0x8'));var client=jayson['client'][_0xae48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x382b6d,_0x5c1cd6,_0xda8b60){return new BPromise(function(_0x4503ca,_0x25b85b){return client[_0xae48('0xa')](_0x382b6d,_0xda8b60)['then'](function(_0x279b5d){logger['info']('Trunk,\x20%s,\x20%s',_0x5c1cd6,_0xae48('0xb'));logger['debug'](_0xae48('0xc'),_0x5c1cd6,_0xae48('0xb'),JSON[_0xae48('0xd')](_0x279b5d));if(_0x279b5d['error']){if(_0x279b5d[_0xae48('0xe')][_0xae48('0xf')]===0x1f4){logger[_0xae48('0xe')](_0xae48('0x10'),_0x5c1cd6,_0x279b5d['error'][_0xae48('0x11')]);return _0x25b85b(_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);}logger['error'](_0xae48('0x10'),_0x5c1cd6,_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);return _0x4503ca(_0x279b5d[_0xae48('0xe')][_0xae48('0x11')]);}else{logger['info'](_0xae48('0x10'),_0x5c1cd6,'request\x20sent');_0x4503ca(_0x279b5d[_0xae48('0x12')]['message']);}})['catch'](function(_0x10f592){logger[_0xae48('0xe')](_0xae48('0x10'),_0x5c1cd6,_0x10f592);_0x25b85b(_0x10f592);});});}exports[_0xae48('0x13')]=function(_0x2fb4f3){var _0x178139=this;return new Promise(function(_0x34db70,_0x56d757){return db[_0xae48('0x14')][_0xae48('0x15')]({'raw':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2fb4f3['options']?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x17')]||null:null,'attributes':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3['options']['attributes']||null:null,'limit':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x18')]||null:null,'include':_0x2fb4f3[_0xae48('0x16')]?_0x2fb4f3[_0xae48('0x16')][_0xae48('0x19')]?_['map'](_0x2fb4f3[_0xae48('0x16')][_0xae48('0x19')],function(_0x3ed350){return{'model':db[_0x3ed350[_0xae48('0x1a')]],'as':_0x3ed350['as'],'attributes':_0x3ed350['attributes'],'include':_0x3ed350[_0xae48('0x19')]?_['map'](_0x3ed350[_0xae48('0x19')],function(_0x3807b9){return{'model':db[_0x3807b9[_0xae48('0x1a')]],'as':_0x3807b9['as'],'attributes':_0x3807b9['attributes'],'include':_0x3807b9[_0xae48('0x19')]?_[_0xae48('0x1b')](_0x3807b9['include'],function(_0x468014){return{'model':db[_0x468014['model']],'as':_0x468014['as'],'attributes':_0x468014[_0xae48('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9c5b){logger[_0xae48('0x1d')]('GetTrunk',_0x2fb4f3);logger[_0xae48('0x1e')](_0xae48('0x13'),_0x2fb4f3,JSON[_0xae48('0xd')](_0x3f9c5b));_0x34db70(_0x3f9c5b);})[_0xae48('0x1f')](function(_0x56db38){logger[_0xae48('0xe')]('GetTrunk',_0x56db38[_0xae48('0x11')],_0x2fb4f3);_0x56d757(_0x178139[_0xae48('0xe')](0x1f4,_0x56db38[_0xae48('0x11')]));});});};exports[_0xae48('0x20')]=function(_0x15ecbb){var _0x3954a7=this;return new Promise(function(_0x32e42a,_0x50f44b){return db[_0xae48('0x14')][_0xae48('0x21')]({'raw':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb[_0xae48('0x16')][_0xae48('0x22')]===undefined?!![]:![]:!![],'where':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb[_0xae48('0x16')][_0xae48('0x17')]||null:null,'attributes':_0x15ecbb[_0xae48('0x16')]?_0x15ecbb['options'][_0xae48('0x1c')]||null:null,'include':_0x15ecbb['options']?_0x15ecbb[_0xae48('0x16')]['include']?_[_0xae48('0x1b')](_0x15ecbb['options'][_0xae48('0x19')],function(_0x599769){return{'model':db[_0x599769[_0xae48('0x1a')]],'as':_0x599769['as'],'attributes':_0x599769[_0xae48('0x1c')],'include':_0x599769[_0xae48('0x19')]?_['map'](_0x599769['include'],function(_0x34baf4){return{'model':db[_0x34baf4[_0xae48('0x1a')]],'as':_0x34baf4['as'],'attributes':_0x34baf4['attributes'],'include':_0x34baf4[_0xae48('0x19')]?_[_0xae48('0x1b')](_0x34baf4['include'],function(_0x50d410){return{'model':db[_0x50d410[_0xae48('0x1a')]],'as':_0x50d410['as'],'attributes':_0x50d410[_0xae48('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae48('0x23')](function(_0x26fac4){logger[_0xae48('0x1d')](_0xae48('0x20'),_0x15ecbb);logger['debug'](_0xae48('0x20'),_0x15ecbb,JSON[_0xae48('0xd')](_0x26fac4));_0x32e42a(_0x26fac4);})[_0xae48('0x1f')](function(_0x80970d){logger['error'](_0xae48('0x20'),_0x80970d[_0xae48('0x11')],_0x15ecbb);_0x50f44b(_0x3954a7['error'](0x1f4,_0x80970d['message']));});});}; \ No newline at end of file +var _0x4b57=['attributes','limit','include','map','model','stringify','ShowTrunk','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetTrunk','Trunk','options','raw','where'];(function(_0x57c0a4,_0x4f6b82){var _0x3c8e00=function(_0x25643c){while(--_0x25643c){_0x57c0a4['push'](_0x57c0a4['shift']());}};_0x3c8e00(++_0x4f6b82);}(_0x4b57,0x19b));var _0x74b5=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x4b57[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0x74b5('0x0'));var util=require(_0x74b5('0x1'));var moment=require(_0x74b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74b5('0x3'));var db=require(_0x74b5('0x4'))['db'];var utils=require(_0x74b5('0x5'));var logger=require(_0x74b5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74b5('0x7')][_0x74b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b82c3,_0x25af93,_0x41b1e4){return new BPromise(function(_0x2bddfc,_0x29a537){return client['request'](_0x2b82c3,_0x41b1e4)[_0x74b5('0x9')](function(_0x2b6f17){logger[_0x74b5('0xa')](_0x74b5('0xb'),_0x25af93,'request\x20sent');logger[_0x74b5('0xc')](_0x74b5('0xd'),_0x25af93,_0x74b5('0xe'),JSON['stringify'](_0x2b6f17));if(_0x2b6f17[_0x74b5('0xf')]){if(_0x2b6f17[_0x74b5('0xf')]['code']===0x1f4){logger[_0x74b5('0xf')]('Trunk,\x20%s,\x20%s',_0x25af93,_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);return _0x29a537(_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x25af93,_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);return _0x2bddfc(_0x2b6f17[_0x74b5('0xf')][_0x74b5('0x10')]);}else{logger[_0x74b5('0xa')](_0x74b5('0xb'),_0x25af93,_0x74b5('0xe'));_0x2bddfc(_0x2b6f17['result'][_0x74b5('0x10')]);}})[_0x74b5('0x11')](function(_0x900402){logger[_0x74b5('0xf')]('Trunk,\x20%s,\x20%s',_0x25af93,_0x900402);_0x29a537(_0x900402);});});}exports[_0x74b5('0x12')]=function(_0x17f66c){var _0x3f59b0=this;return new Promise(function(_0x456283,_0x2cb257){return db[_0x74b5('0x13')]['findAll']({'raw':_0x17f66c[_0x74b5('0x14')]?_0x17f66c[_0x74b5('0x14')][_0x74b5('0x15')]===undefined?!![]:![]:!![],'where':_0x17f66c[_0x74b5('0x14')]?_0x17f66c['options'][_0x74b5('0x16')]||null:null,'attributes':_0x17f66c[_0x74b5('0x14')]?_0x17f66c['options'][_0x74b5('0x17')]||null:null,'limit':_0x17f66c['options']?_0x17f66c[_0x74b5('0x14')][_0x74b5('0x18')]||null:null,'include':_0x17f66c[_0x74b5('0x14')]?_0x17f66c['options'][_0x74b5('0x19')]?_[_0x74b5('0x1a')](_0x17f66c[_0x74b5('0x14')][_0x74b5('0x19')],function(_0x41ce92){return{'model':db[_0x41ce92['model']],'as':_0x41ce92['as'],'attributes':_0x41ce92[_0x74b5('0x17')],'include':_0x41ce92[_0x74b5('0x19')]?_[_0x74b5('0x1a')](_0x41ce92[_0x74b5('0x19')],function(_0x1ef4af){return{'model':db[_0x1ef4af[_0x74b5('0x1b')]],'as':_0x1ef4af['as'],'attributes':_0x1ef4af[_0x74b5('0x17')],'include':_0x1ef4af[_0x74b5('0x19')]?_[_0x74b5('0x1a')](_0x1ef4af['include'],function(_0x1811c4){return{'model':db[_0x1811c4[_0x74b5('0x1b')]],'as':_0x1811c4['as'],'attributes':_0x1811c4[_0x74b5('0x17')]};}):[]};}):[]};}):[]:[]})[_0x74b5('0x9')](function(_0x517414){logger[_0x74b5('0xa')](_0x74b5('0x12'),_0x17f66c);logger[_0x74b5('0xc')](_0x74b5('0x12'),_0x17f66c,JSON[_0x74b5('0x1c')](_0x517414));_0x456283(_0x517414);})[_0x74b5('0x11')](function(_0x407da9){logger['error'](_0x74b5('0x12'),_0x407da9[_0x74b5('0x10')],_0x17f66c);_0x2cb257(_0x3f59b0[_0x74b5('0xf')](0x1f4,_0x407da9['message']));});});};exports[_0x74b5('0x1d')]=function(_0x2adb19){var _0x2dc017=this;return new Promise(function(_0x463f52,_0x3982f5){return db[_0x74b5('0x13')][_0x74b5('0x1e')]({'raw':_0x2adb19['options']?_0x2adb19[_0x74b5('0x14')][_0x74b5('0x15')]===undefined?!![]:![]:!![],'where':_0x2adb19[_0x74b5('0x14')]?_0x2adb19[_0x74b5('0x14')][_0x74b5('0x16')]||null:null,'attributes':_0x2adb19[_0x74b5('0x14')]?_0x2adb19[_0x74b5('0x14')][_0x74b5('0x17')]||null:null,'include':_0x2adb19[_0x74b5('0x14')]?_0x2adb19['options']['include']?_[_0x74b5('0x1a')](_0x2adb19[_0x74b5('0x14')][_0x74b5('0x19')],function(_0x117578){return{'model':db[_0x117578[_0x74b5('0x1b')]],'as':_0x117578['as'],'attributes':_0x117578[_0x74b5('0x17')],'include':_0x117578[_0x74b5('0x19')]?_[_0x74b5('0x1a')](_0x117578[_0x74b5('0x19')],function(_0x35b031){return{'model':db[_0x35b031[_0x74b5('0x1b')]],'as':_0x35b031['as'],'attributes':_0x35b031[_0x74b5('0x17')],'include':_0x35b031[_0x74b5('0x19')]?_[_0x74b5('0x1a')](_0x35b031[_0x74b5('0x19')],function(_0x2b7843){return{'model':db[_0x2b7843[_0x74b5('0x1b')]],'as':_0x2b7843['as'],'attributes':_0x2b7843[_0x74b5('0x17')]};}):[]};}):[]};}):[]:[]})[_0x74b5('0x9')](function(_0x25a214){logger[_0x74b5('0xa')]('ShowTrunk',_0x2adb19);logger[_0x74b5('0xc')](_0x74b5('0x1d'),_0x2adb19,JSON[_0x74b5('0x1c')](_0x25a214));_0x463f52(_0x25a214);})[_0x74b5('0x11')](function(_0x383a26){logger[_0x74b5('0xf')](_0x74b5('0x1d'),_0x383a26[_0x74b5('0x10')],_0x2adb19);_0x3982f5(_0x2dc017[_0x74b5('0xf')](0x1f4,_0x383a26[_0x74b5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a8e42e0..1687ec3 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 _0xe302=['/:id/whatsapp_accounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/whoami','whoami','/presence','getPresence','/:id','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites'];(function(_0xecec8a,_0x23a7d1){var _0x3eab5f=function(_0x1ddef5){while(--_0x1ddef5){_0xecec8a['push'](_0xecec8a['shift']());}};_0x3eab5f(++_0x23a7d1);}(_0xe302,0x108));var _0x2e30=function(_0x5c3e97,_0x36cc4d){_0x5c3e97=_0x5c3e97-0x0;var _0x4b1f52=_0xe302[_0x5c3e97];return _0x4b1f52;};'use strict';var multer=require(_0x2e30('0x0'));var util=require(_0x2e30('0x1'));var path=require(_0x2e30('0x2'));var timeout=require(_0x2e30('0x3'));var express=require(_0x2e30('0x4'));var router=express['Router']();var fs_extra=require(_0x2e30('0x5'));var auth=require(_0x2e30('0x6'));var interaction=require(_0x2e30('0x7'));var config=require(_0x2e30('0x8'));var controller=require('./user.controller');router[_0x2e30('0x9')]('/',auth['isAuthenticated'](),controller[_0x2e30('0xa')]);router[_0x2e30('0x9')](_0x2e30('0xb'),auth[_0x2e30('0xc')](),controller['describe']);router['get'](_0x2e30('0xd'),auth[_0x2e30('0xc')](),controller[_0x2e30('0xe')]);router[_0x2e30('0x9')](_0x2e30('0xf'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x10')]);router['get'](_0x2e30('0x11'),auth[_0x2e30('0xc')](),controller['show']);router[_0x2e30('0x9')]('/:id/avatar',controller[_0x2e30('0x12')]);router[_0x2e30('0x9')](_0x2e30('0x13'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x14')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x2e30('0x15')]);router[_0x2e30('0x9')](_0x2e30('0x16'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x17')]);router[_0x2e30('0x9')](_0x2e30('0x18'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router['get'](_0x2e30('0x19'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x1a')]);router['get'](_0x2e30('0x1b'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x2e30('0xc')](),controller[_0x2e30('0x1d')]);router[_0x2e30('0x9')]('/:id/chat/interactions',auth[_0x2e30('0xc')](),controller[_0x2e30('0x1e')]);router[_0x2e30('0x9')](_0x2e30('0x1f'),auth['isAuthenticated'](),controller[_0x2e30('0x20')]);router[_0x2e30('0x9')]('/:id/mail/interactions',auth[_0x2e30('0xc')](),controller[_0x2e30('0x21')]);router['get'](_0x2e30('0x22'),auth['isAuthenticated'](),controller[_0x2e30('0x23')]);router[_0x2e30('0x9')](_0x2e30('0x24'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x25')]);router[_0x2e30('0x9')](_0x2e30('0x26'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x27')]);router[_0x2e30('0x9')](_0x2e30('0x28'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x29')]);router[_0x2e30('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2e30('0x2a')]);router[_0x2e30('0x9')](_0x2e30('0x2b'),auth['isAuthenticated'](),controller[_0x2e30('0x2c')]);router[_0x2e30('0x9')](_0x2e30('0x2d'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x2e30('0x9')](_0x2e30('0x2e'),auth[_0x2e30('0xc')](),controller['getFaxAccounts']);router[_0x2e30('0x9')]('/:id/mail_accounts',auth[_0x2e30('0xc')](),controller[_0x2e30('0x2f')]);router[_0x2e30('0x9')](_0x2e30('0x30'),auth['isAuthenticated'](),controller[_0x2e30('0x31')]);router['get']('/:id/sms_accounts',auth[_0x2e30('0xc')](),controller['getSmsAccounts']);router[_0x2e30('0x9')](_0x2e30('0x32'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x33')]);router['get']('/:id/whatsapp_accounts',auth[_0x2e30('0xc')](),controller[_0x2e30('0x34')]);router[_0x2e30('0x9')](_0x2e30('0x35'),auth[_0x2e30('0xc')](),controller['getSquareProjects']);router[_0x2e30('0x9')](_0x2e30('0x36'),auth[_0x2e30('0xc')](),controller['getScheduledCalls']);router['get'](_0x2e30('0x37'),auth['isAuthenticated'](),controller[_0x2e30('0x38')]);router[_0x2e30('0x39')](_0x2e30('0x3a'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x3b')]);router[_0x2e30('0x39')]('/',auth[_0x2e30('0xc')](),controller[_0x2e30('0x3c')]);router[_0x2e30('0x39')](_0x2e30('0x3d'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x3e')]);router[_0x2e30('0x39')](_0x2e30('0x16'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x3f')]);var upload=multer({'storage':multer[_0x2e30('0x40')]({'destination':function(_0x4eadc9,_0x30fb84,_0x17b80f){_0x17b80f(null,path[_0x2e30('0x41')](config[_0x2e30('0x42')],_0x2e30('0x43')));},'filename':function(_0x17b075,_0x36c575,_0x5eff2a){_0x5eff2a(null,util[_0x2e30('0x44')](_0x2e30('0x45'),Date[_0x2e30('0x46')](),_0x36c575[_0x2e30('0x47')]));}})});router[_0x2e30('0x39')](_0x2e30('0x48'),upload[_0x2e30('0x49')](_0x2e30('0x4a')),controller[_0x2e30('0x4b')]);router[_0x2e30('0x39')](_0x2e30('0x4c'),auth[_0x2e30('0xc')](),controller['login']);router[_0x2e30('0x39')]('/:id/logout',auth[_0x2e30('0xc')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller['pause']);router['post'](_0x2e30('0x4d'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x4e')]);router[_0x2e30('0x39')]('/:id/teams',auth[_0x2e30('0xc')](),controller['addTeams']);router[_0x2e30('0x39')](_0x2e30('0x4f'),auth['isAuthenticated'](),controller[_0x2e30('0x50')]);router[_0x2e30('0x39')](_0x2e30('0x51'),auth['isAuthenticated'](),controller[_0x2e30('0x52')]);router[_0x2e30('0x39')](_0x2e30('0x53'),auth['isAuthenticated'](),controller[_0x2e30('0x54')]);router[_0x2e30('0x39')]('/:id/sms_interactions',auth[_0x2e30('0xc')](),controller[_0x2e30('0x55')]);router[_0x2e30('0x39')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x2e30('0x56')]);router['post'](_0x2e30('0x57'),auth['isAuthenticated'](),controller[_0x2e30('0x58')]);router['post'](_0x2e30('0x2e'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x59')]);router[_0x2e30('0x39')](_0x2e30('0x5a'),auth['isAuthenticated'](),controller[_0x2e30('0x5b')]);router[_0x2e30('0x39')]('/:id/openchannel_accounts',auth[_0x2e30('0xc')](),controller[_0x2e30('0x5c')]);router[_0x2e30('0x39')](_0x2e30('0x5d'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x5e')]);router['post'](_0x2e30('0x32'),auth['isAuthenticated'](),controller[_0x2e30('0x5f')]);router['post'](_0x2e30('0x60'),auth[_0x2e30('0xc')](),controller['addWhatsappAccounts']);router[_0x2e30('0x39')](_0x2e30('0x35'),auth[_0x2e30('0xc')](),controller['addSquareProjects']);router['post'](_0x2e30('0x37'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x61')]);router[_0x2e30('0x62')]('/:id',auth['isAuthenticated'](),controller[_0x2e30('0x63')]);router[_0x2e30('0x62')](_0x2e30('0x64'),auth['isAuthenticated'](),controller['changePassword']);router[_0x2e30('0x65')]('/:id/queues',auth['isAuthenticated'](),controller[_0x2e30('0x66')]);router[_0x2e30('0x65')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2e30('0x67')]);router[_0x2e30('0x65')](_0x2e30('0x11'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x68')]);router[_0x2e30('0x65')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x2e30('0x69')]);router[_0x2e30('0x65')]('/:id/mail_interactions',auth[_0x2e30('0xc')](),controller[_0x2e30('0x6a')]);router['delete'](_0x2e30('0x53'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x6b')]);router['delete'](_0x2e30('0x6c'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x6d')]);router['delete'](_0x2e30('0x6e'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x6f')]);router[_0x2e30('0x65')]('/:id/whatsapp_interactions',auth[_0x2e30('0xc')](),controller[_0x2e30('0x70')]);router[_0x2e30('0x65')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2e30('0x71')]);router['delete'](_0x2e30('0x5a'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x72')]);router[_0x2e30('0x65')](_0x2e30('0x30'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x73')]);router[_0x2e30('0x65')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x2e30('0x74')]);router['delete'](_0x2e30('0x32'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x75')]);router[_0x2e30('0x65')](_0x2e30('0x60'),auth[_0x2e30('0xc')](),controller[_0x2e30('0x76')]);router[_0x2e30('0x65')]('/:id/square_projects',auth[_0x2e30('0xc')](),controller[_0x2e30('0x77')]);router[_0x2e30('0x65')](_0x2e30('0x37'),auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0xb2a3=['getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','whoami','/presence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists'];(function(_0x2c1578,_0x4a1066){var _0x26cb29=function(_0x10f5fb){while(--_0x10f5fb){_0x2c1578['push'](_0x2c1578['shift']());}};_0x26cb29(++_0x4a1066);}(_0xb2a3,0xcd));var _0x3b2a=function(_0x4214cc,_0x57c06c){_0x4214cc=_0x4214cc-0x0;var _0x4ad436=_0xb2a3[_0x4214cc];return _0x4ad436;};'use strict';var multer=require(_0x3b2a('0x0'));var util=require(_0x3b2a('0x1'));var path=require('path');var timeout=require(_0x3b2a('0x2'));var express=require('express');var router=express[_0x3b2a('0x3')]();var fs_extra=require(_0x3b2a('0x4'));var auth=require(_0x3b2a('0x5'));var interaction=require(_0x3b2a('0x6'));var config=require(_0x3b2a('0x7'));var controller=require(_0x3b2a('0x8'));router[_0x3b2a('0x9')]('/',auth[_0x3b2a('0xa')](),controller['index']);router['get']('/describe',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0xb')]);router[_0x3b2a('0x9')](_0x3b2a('0xc'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0xd')]);router['get'](_0x3b2a('0xe'),auth[_0x3b2a('0xa')](),controller['getPresence']);router[_0x3b2a('0x9')](_0x3b2a('0xf'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x10')]);router[_0x3b2a('0x9')]('/:id/avatar',controller[_0x3b2a('0x11')]);router[_0x3b2a('0x9')](_0x3b2a('0x12'),auth['isAuthenticated'](),controller[_0x3b2a('0x13')]);router['get'](_0x3b2a('0x14'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x15')]);router[_0x3b2a('0x9')](_0x3b2a('0x16'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x17')]);router['get'](_0x3b2a('0x18'),auth['isAuthenticated'](),controller[_0x3b2a('0x19')]);router[_0x3b2a('0x9')](_0x3b2a('0x1a'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x1b')]);router['get'](_0x3b2a('0x1c'),auth[_0x3b2a('0xa')](),controller['getRecordings']);router[_0x3b2a('0x9')](_0x3b2a('0x1d'),auth['isAuthenticated'](),controller[_0x3b2a('0x1e')]);router[_0x3b2a('0x9')](_0x3b2a('0x1f'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x20')]);router['get'](_0x3b2a('0x21'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x22')]);router[_0x3b2a('0x9')](_0x3b2a('0x23'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x24')]);router[_0x3b2a('0x9')](_0x3b2a('0x25'),auth[_0x3b2a('0xa')](),controller['getSmsInteractions']);router[_0x3b2a('0x9')](_0x3b2a('0x26'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x27')]);router['get'](_0x3b2a('0x28'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x29')]);router[_0x3b2a('0x9')](_0x3b2a('0x2a'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x2b')]);router['get'](_0x3b2a('0x2c'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x2d')]);router[_0x3b2a('0x9')]('/:id/agents',auth[_0x3b2a('0xa')](),controller['getAgents']);router[_0x3b2a('0x9')](_0x3b2a('0x2e'),auth['isAuthenticated'](),controller[_0x3b2a('0x2f')]);router[_0x3b2a('0x9')](_0x3b2a('0x30'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x31')]);router[_0x3b2a('0x9')]('/:id/mail_accounts',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x32')]);router[_0x3b2a('0x9')](_0x3b2a('0x33'),auth['isAuthenticated'](),controller[_0x3b2a('0x34')]);router[_0x3b2a('0x9')](_0x3b2a('0x35'),auth['isAuthenticated'](),controller[_0x3b2a('0x36')]);router[_0x3b2a('0x9')](_0x3b2a('0x37'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x38')]);router[_0x3b2a('0x9')](_0x3b2a('0x39'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x3a')]);router['get'](_0x3b2a('0x3b'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x3c')]);router[_0x3b2a('0x9')](_0x3b2a('0x3d'),auth[_0x3b2a('0xa')](),controller['getScheduledCalls']);router[_0x3b2a('0x9')](_0x3b2a('0x3e'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x3f')]);router['post']('/:id/contacts',auth[_0x3b2a('0xa')](),controller['addContacts']);router[_0x3b2a('0x40')]('/',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x41')]);router[_0x3b2a('0x40')](_0x3b2a('0x42'),auth['isAuthenticated'](),controller[_0x3b2a('0x43')]);router[_0x3b2a('0x40')](_0x3b2a('0x16'),auth[_0x3b2a('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x3b2a('0x44')]({'destination':function(_0x538637,_0x42aafc,_0x1f7967){_0x1f7967(null,path[_0x3b2a('0x45')](config[_0x3b2a('0x46')],_0x3b2a('0x47')));},'filename':function(_0x58dedb,_0x39c205,_0x24852f){_0x24852f(null,util[_0x3b2a('0x48')](_0x3b2a('0x49'),Date[_0x3b2a('0x4a')](),_0x39c205['originalname']));}})});router['post'](_0x3b2a('0x4b'),upload[_0x3b2a('0x4c')](_0x3b2a('0x4d')),controller[_0x3b2a('0x4e')]);router[_0x3b2a('0x40')](_0x3b2a('0x4f'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x50')]);router[_0x3b2a('0x40')](_0x3b2a('0x51'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x52')]);router[_0x3b2a('0x40')](_0x3b2a('0x53'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x54')]);router[_0x3b2a('0x40')](_0x3b2a('0x55'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x56')]);router[_0x3b2a('0x40')](_0x3b2a('0x2a'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x57')]);router['post'](_0x3b2a('0x58'),auth['isAuthenticated'](),controller[_0x3b2a('0x59')]);router[_0x3b2a('0x40')](_0x3b2a('0x5a'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x5b')]);router['post'](_0x3b2a('0x5c'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x5d')]);router['post'](_0x3b2a('0x5e'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x5f')]);router[_0x3b2a('0x40')](_0x3b2a('0x60'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x61')]);router[_0x3b2a('0x40')](_0x3b2a('0x62'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x63')]);router[_0x3b2a('0x40')](_0x3b2a('0x30'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x64')]);router[_0x3b2a('0x40')](_0x3b2a('0x65'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x66')]);router['post'](_0x3b2a('0x33'),auth['isAuthenticated'](),controller[_0x3b2a('0x67')]);router[_0x3b2a('0x40')](_0x3b2a('0x35'),auth['isAuthenticated'](),controller['addSmsAccounts']);router['post'](_0x3b2a('0x37'),auth[_0x3b2a('0xa')](),controller['addChatWebsites']);router[_0x3b2a('0x40')](_0x3b2a('0x39'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x3b2a('0x40')](_0x3b2a('0x3b'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x68')]);router[_0x3b2a('0x40')](_0x3b2a('0x3e'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x69')]);router[_0x3b2a('0x6a')](_0x3b2a('0xf'),auth[_0x3b2a('0xa')](),controller['update']);router[_0x3b2a('0x6a')](_0x3b2a('0x6b'),auth['isAuthenticated'](),controller[_0x3b2a('0x6c')]);router[_0x3b2a('0x6d')](_0x3b2a('0x16'),auth['isAuthenticated'](),controller[_0x3b2a('0x6e')]);router['delete']('/:id/teams',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x6f')]);router[_0x3b2a('0x6d')]('/:id',auth['isAuthenticated'](),controller[_0x3b2a('0x70')]);router[_0x3b2a('0x6d')](_0x3b2a('0x58'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x71')]);router[_0x3b2a('0x6d')]('/:id/mail_interactions',auth[_0x3b2a('0xa')](),controller['removeMailInteractions']);router[_0x3b2a('0x6d')]('/:id/fax_interactions',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x72')]);router['delete']('/:id/sms_interactions',auth[_0x3b2a('0xa')](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x73')]);router['delete'](_0x3b2a('0x62'),auth['isAuthenticated'](),controller[_0x3b2a('0x74')]);router[_0x3b2a('0x6d')](_0x3b2a('0x30'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x75')]);router[_0x3b2a('0x6d')](_0x3b2a('0x65'),auth['isAuthenticated'](),controller[_0x3b2a('0x76')]);router[_0x3b2a('0x6d')](_0x3b2a('0x33'),auth['isAuthenticated'](),controller[_0x3b2a('0x77')]);router[_0x3b2a('0x6d')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x3b2a('0x78')]);router[_0x3b2a('0x6d')]('/:id/chat_websites',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x79')]);router[_0x3b2a('0x6d')]('/:id/whatsapp_accounts',auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x7a')]);router[_0x3b2a('0x6d')](_0x3b2a('0x3b'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x7b')]);router[_0x3b2a('0x6d')](_0x3b2a('0x3e'),auth[_0x3b2a('0xa')](),controller[_0x3b2a('0x7c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index daf5a48..ca8972e 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 _0x4d9e=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','active','passive','update,nonat','showWebBar','get','isArray','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','encryption','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','lodash','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow'];(function(_0x2f9d2b,_0x8c5f4c){var _0x190bc6=function(_0x4e698b){while(--_0x4e698b){_0x2f9d2b['push'](_0x2f9d2b['shift']());}};_0x190bc6(++_0x8c5f4c);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x12c14e,_0x3a73bd){_0x12c14e=_0x12c14e-0x0;var _0x373975=_0x4d9e[_0x12c14e];return _0x373975;};'use strict';var Sequelize=require(_0xe4d9('0x0'));var moment=require('moment');var util=require('util');var _=require(_0xe4d9('0x1'));module['exports']={'name':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2c6990){this[_0xe4d9('0x3')]('name',_0x2c6990);this[_0xe4d9('0x3')](_0xe4d9('0x4'),_0x2c6990);},'comment':_0xe4d9('0x5')},'fullname':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':![],'set':function(_0x125dbc){this[_0xe4d9('0x3')]('fullname',_0x125dbc);this[_0xe4d9('0x3')](_0xe4d9('0x6'),util[_0xe4d9('0x7')](_0xe4d9('0x8'),_0x125dbc,this[_0xe4d9('0x9')](_0xe4d9('0xa'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':![],'unique':_0xe4d9('0xb'),'validate':{'isEmail':!![]},'set':function(_0x32eb8a){if(_0x32eb8a){this[_0xe4d9('0x3')](_0xe4d9('0xb'),_0x32eb8a[_0xe4d9('0xc')]());}}},'role':{'type':Sequelize[_0xe4d9('0xd')]('admin','user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xe4d9('0xa'),'set':function(_0x3238d4){this[_0xe4d9('0x3')]('internal',_0x3238d4);this[_0xe4d9('0x3')](_0xe4d9('0xe'),_0x3238d4);this[_0xe4d9('0x3')](_0xe4d9('0x6'),util['format'](_0xe4d9('0x8'),this[_0xe4d9('0x9')](_0xe4d9('0xf')),_0x3238d4));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe4d9('0x2')]},'address':{'type':Sequelize[_0xe4d9('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xe4d9('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe4d9('0x2')]},'online':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xe4d9('0x11')]},'voicePause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xe4d9('0x2')],'defaultValue':_0xe4d9('0x12')},'lastPauseAt':{'type':Sequelize[_0xe4d9('0x11')]},'chatCapacity':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe4d9('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0xe4d9('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xe4d9('0x14'),_0xe4d9('0x15'),_0xe4d9('0x16')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![],'defaultValue':_0xe4d9('0x17')},'callingpres':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x18'),_0xe4d9('0x19'),_0xe4d9('0x1a'),_0xe4d9('0x1b'),_0xe4d9('0x1c'),_0xe4d9('0x1d'),_0xe4d9('0x1e'),_0xe4d9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![],'defaultValue':_0xe4d9('0x20'),'set':function(_0x12e0ae){this['setDataValue']('transport',_0x12e0ae?_0x12e0ae['join'](','):null);},'get':function(){return this[_0xe4d9('0x9')](_0xe4d9('0x21'))?this[_0xe4d9('0x9')]('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xe4d9('0x22'),_0xe4d9('0x23'),'shortinfo',_0xe4d9('0x24'),_0xe4d9('0x25')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no',_0xe4d9('0x27'),_0xe4d9('0x28'),_0xe4d9('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![],'defaultValue':_0xe4d9('0x2a'),'set':function(_0x517f24){this[_0xe4d9('0x3')](_0xe4d9('0x2b'),_0x517f24?_0x517f24['join'](','):null);},'get':function(){return this[_0xe4d9('0x9')](_0xe4d9('0x2b'))?this[_0xe4d9('0x9')](_0xe4d9('0x2b'))[_0xe4d9('0x2c')](','):null;},'comment':_0xe4d9('0x2d')},'callgroup':{'type':Sequelize[_0xe4d9('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe4d9('0x2')]},'pickupgroup':{'type':Sequelize[_0xe4d9('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':![],'defaultValue':_0xe4d9('0x2e')},'allow':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':![],'defaultValue':_0xe4d9('0x2f'),'set':function(_0xd0e919){this[_0xe4d9('0x3')](_0xe4d9('0x30'),_0xd0e919?_0xd0e919['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xe4d9('0x30'))?this[_0xe4d9('0x9')]('allow')[_0xe4d9('0x2c')](';'):null;},'comment':_0xe4d9('0x31')},'autoframing':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2f5423){this[_0xe4d9('0x3')](_0xe4d9('0x32'),_0x2f5423?_0x2f5423[_0xe4d9('0x33')](','):null);},'get':function(){return this[_0xe4d9('0x9')](_0xe4d9('0x32'))?this[_0xe4d9('0x9')](_0xe4d9('0x32'))[_0xe4d9('0x2c')](','):null;},'comment':_0xe4d9('0x34')},'trustrpid':{'type':Sequelize[_0xe4d9('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no',_0xe4d9('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![],'defaultValue':_0xe4d9('0x36')},'amaflags':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no',_0xe4d9('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xe4d9('0x38'),_0xe4d9('0x39'),_0xe4d9('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe4d9('0xd')]('uac',_0xe4d9('0x3b')),'allowNull':!![],'defaultValue':_0xe4d9('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe4d9('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xe4d9('0x26')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xe4d9('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe4d9('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xe4d9('0xd')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no',_0xe4d9('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe4d9('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x3d'),_0xe4d9('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe4d9('0xd')](_0xe4d9('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0xe4d9('0x27'),_0xe4d9('0x28'),_0xe4d9('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe4d9('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0xe4d9('0x11')]},'passwordResetAt':{'type':Sequelize[_0xe4d9('0x11')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x7d1fb9){this[_0xe4d9('0x3')](_0xe4d9('0x40'),_0x7d1fb9);var _0x1ab736=this[_0xe4d9('0x41')]({'plain':!![]});switch(_0x7d1fb9){case 0x0:case 0x1:var _0xa7cbad=_0x1ab736[_0xe4d9('0x21')]?_[_0xe4d9('0x42')](_0x1ab736[_0xe4d9('0x21')])?_0x1ab736[_0xe4d9('0x21')][_0xe4d9('0x33')]():_0x1ab736[_0xe4d9('0x21')]:'udp';if(_0xa7cbad===_0xe4d9('0x43')){_0xa7cbad=_0xe4d9('0x20');}this[_0xe4d9('0x3')](_0xe4d9('0x21'),_0xa7cbad);this['setDataValue']('encryption','no');this['setDataValue'](_0xe4d9('0x44'),null);this[_0xe4d9('0x3')](_0xe4d9('0x45'),null);this[_0xe4d9('0x3')]('icesupport',null);this['setDataValue'](_0xe4d9('0x46'),null);this[_0xe4d9('0x3')](_0xe4d9('0x47'),null);this[_0xe4d9('0x3')](_0xe4d9('0x48'),null);this[_0xe4d9('0x3')]('dtlscertfile',null);this[_0xe4d9('0x3')]('dtlsprivatekey',null);this[_0xe4d9('0x3')](_0xe4d9('0x49'),'no');break;case 0x2:this['setDataValue'](_0xe4d9('0x21'),_0xe4d9('0x43'));this['setDataValue'](_0xe4d9('0x4a'),_0xe4d9('0x26'));this[_0xe4d9('0x3')](_0xe4d9('0x44'),_0xe4d9('0x26'));this[_0xe4d9('0x3')]('force_avp','yes');this[_0xe4d9('0x3')]('icesupport',_0xe4d9('0x26'));this['setDataValue']('dtlsenable',_0xe4d9('0x26'));this[_0xe4d9('0x3')](_0xe4d9('0x47'),'no');this['setDataValue'](_0xe4d9('0x48'),'actpass');this[_0xe4d9('0x3')](_0xe4d9('0x4b'),_0x1ab736[_0xe4d9('0x4b')]||_0xe4d9('0x4c'));this['setDataValue'](_0xe4d9('0x4d'),_0x1ab736[_0xe4d9('0x4d')]||_0xe4d9('0x4e'));this[_0xe4d9('0x3')](_0xe4d9('0x49'),_0xe4d9('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xe4d9('0x4f')],'set':function(_0x2ce194){this[_0xe4d9('0x3')]('permissions',_0x2ce194?_0x2ce194[_0xe4d9('0x33')](','):[]);},'get':function(){return this['getDataValue'](_0xe4d9('0x50'))?_[_0xe4d9('0x51')](this[_0xe4d9('0x9')](_0xe4d9('0x50'))['split'](','),function(_0x5d8656){return parseInt(_0x5d8656,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe4d9('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xe4d9('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0xe4d9('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xe4d9('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xe4d9('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xe4d9('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe4d9('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe4d9('0x9')](_0xe4d9('0x52'))?this[_0xe4d9('0x9')](_0xe4d9('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe4d9('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe4d9('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x28fb7d){if(typeof _0x28fb7d===_0xe4d9('0x53')){var _0x40c93a=_0x28fb7d==='1'?!![]:_0x28fb7d==='0'?![]:_0x28fb7d===_0xe4d9('0x54')?!![]:_0x28fb7d==='false'?![]:![];this[_0xe4d9('0x3')](_0xe4d9('0x55'),_0x40c93a);}else{this['setDataValue'](_0xe4d9('0x55'),_0x28fb7d);}}},'blocked':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![],'set':function(_0x4acc49){this[_0xe4d9('0x3')](_0xe4d9('0x56'),_0x4acc49);if(_0x4acc49===!![]){this[_0xe4d9('0x3')](_0xe4d9('0x57'),moment());this[_0xe4d9('0x3')](_0xe4d9('0x58'),0x0);}else{this[_0xe4d9('0x3')](_0xe4d9('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xe4d9('0x11')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe4d9('0x13')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xe4d9('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xf0ba=['PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','join','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uac','uas','fingerprint','active','actpass','update,nonat','TEXT','get','isArray','encryption','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','wss','avpf','force_avp','dtlsverify','dtlssetup','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','name','defaultuser','setDataValue','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x2b7f56,_0x41bc7d){var _0x36896d=function(_0x551d56){while(--_0x551d56){_0x2b7f56['push'](_0x2b7f56['shift']());}};_0x36896d(++_0x41bc7d);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaf0b('0x0'));var moment=require(_0xaf0b('0x1'));var util=require(_0xaf0b('0x2'));var _=require(_0xaf0b('0x3'));module[_0xaf0b('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaf0b('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xce0364){this['setDataValue'](_0xaf0b('0x5'),_0xce0364);this['setDataValue'](_0xaf0b('0x6'),_0xce0364);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x53b32d){this[_0xaf0b('0x7')](_0xaf0b('0x8'),_0x53b32d);this[_0xaf0b('0x7')](_0xaf0b('0x9'),util['format'](_0xaf0b('0xa'),_0x53b32d,this[_0xaf0b('0xb')](_0xaf0b('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3261b8){if(_0x3261b8){this[_0xaf0b('0x7')](_0xaf0b('0xe'),_0x3261b8['toLowerCase']());}}},'role':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x10'),_0xaf0b('0x11'),_0xaf0b('0x12'),_0xaf0b('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xaf0b('0x14')},'internal':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':![],'unique':_0xaf0b('0xc'),'set':function(_0x27732e){this['setDataValue'](_0xaf0b('0xc'),_0x27732e);this[_0xaf0b('0x7')](_0xaf0b('0x16'),_0x27732e);this[_0xaf0b('0x7')](_0xaf0b('0x9'),util[_0xaf0b('0x17')](_0xaf0b('0xa'),this[_0xaf0b('0xb')]('fullname'),_0x27732e));}},'salt':{'type':Sequelize[_0xaf0b('0xd')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xaf0b('0xd')]},'address':{'type':Sequelize[_0xaf0b('0xd')]},'zipcode':{'type':Sequelize[_0xaf0b('0xd')]},'userpic':{'type':Sequelize[_0xaf0b('0xd')]},'city':{'type':Sequelize[_0xaf0b('0xd')]},'country':{'type':Sequelize[_0xaf0b('0xd')]},'online':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xaf0b('0x19')]},'voicePause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xaf0b('0xd')],'defaultValue':_0xaf0b('0x1a')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xaf0b('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xaf0b('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'defaultValue':_0xaf0b('0x1b')},'ipaddr':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x1c'),_0xaf0b('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xaf0b('0x1c')},'context':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'defaultValue':_0xaf0b('0x1d')},'callingpres':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x1e'),_0xaf0b('0x1f'),_0xaf0b('0x20'),'ALLOWED',_0xaf0b('0x21'),_0xaf0b('0x22'),'PROHIB_FAILED_SCREEN',_0xaf0b('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'permit':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'secret':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'transport':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'defaultValue':_0xaf0b('0x24'),'set':function(_0x14a952){this['setDataValue'](_0xaf0b('0x25'),_0x14a952?_0x14a952['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xaf0b('0xb')](_0xaf0b('0x25'))[_0xaf0b('0x26')](','):null;},'comment':_0xaf0b('0x27')},'dtmfmode':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x28'),'info',_0xaf0b('0x29'),_0xaf0b('0x2a'),_0xaf0b('0x2b')),'allowNull':!![],'defaultValue':_0xaf0b('0x28')},'directmedia':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no',_0xaf0b('0x2d'),_0xaf0b('0x2e'),_0xaf0b('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaf0b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1f429d){this['setDataValue'](_0xaf0b('0x30'),_0x1f429d?_0x1f429d[_0xaf0b('0x31')](','):null);},'get':function(){return this[_0xaf0b('0xb')](_0xaf0b('0x30'))?this[_0xaf0b('0xb')](_0xaf0b('0x30'))[_0xaf0b('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xaf0b('0xd')]},'namedcallgroup':{'type':Sequelize[_0xaf0b('0xd')]},'pickupgroup':{'type':Sequelize[_0xaf0b('0xd')]},'namedpickupgroup':{'type':Sequelize[_0xaf0b('0xd')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaf0b('0xd')]},'disallow':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':![],'defaultValue':_0xaf0b('0x32')},'allow':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':![],'defaultValue':_0xaf0b('0x33'),'set':function(_0x5df6d2){this[_0xaf0b('0x7')](_0xaf0b('0x34'),_0x5df6d2?_0x5df6d2[_0xaf0b('0x31')](';'):_0xaf0b('0x33'));},'get':function(){return this[_0xaf0b('0xb')](_0xaf0b('0x34'))?this[_0xaf0b('0xb')]('allow')[_0xaf0b('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'set':function(_0x3ef036){this[_0xaf0b('0x7')](_0xaf0b('0x35'),_0x3ef036?_0x3ef036[_0xaf0b('0x31')](','):null);},'get':function(){return this[_0xaf0b('0xb')](_0xaf0b('0x35'))?this['getDataValue'](_0xaf0b('0x35'))[_0xaf0b('0x26')](','):null;},'comment':_0xaf0b('0x36')},'trustrpid':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xaf0b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xaf0b('0x2c'),'no',_0xaf0b('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xaf0b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0xaf0b('0x2c')},'busylevel':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no',_0xaf0b('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x39'),'refuse',_0xaf0b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x3b'),_0xaf0b('0x3c')),'allowNull':!![],'defaultValue':_0xaf0b('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xaf0b('0x2c')},'keepalive':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xaf0b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xaf0b('0xf')]('yes','no',_0xaf0b('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xaf0b('0x3e'),'passive',_0xaf0b('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xaf0b('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xaf0b('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xaf0b('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no',_0xaf0b('0x2d'),_0xaf0b('0x2e'),_0xaf0b('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xaf0b('0xd')]},'resetPasswordExpires':{'type':Sequelize[_0xaf0b('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xaf0b('0x41')]},'showWebBar':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0,'set':function(_0x126a5d){this[_0xaf0b('0x7')]('showWebBar',_0x126a5d);var _0x2189b7=this[_0xaf0b('0x42')]({'plain':!![]});switch(_0x126a5d){case 0x0:case 0x1:var _0x54208d=_0x2189b7['transport']?_[_0xaf0b('0x43')](_0x2189b7[_0xaf0b('0x25')])?_0x2189b7[_0xaf0b('0x25')]['join']():_0x2189b7['transport']:'udp';if(_0x54208d==='wss'){_0x54208d='udp';}this[_0xaf0b('0x7')](_0xaf0b('0x25'),_0x54208d);this[_0xaf0b('0x7')](_0xaf0b('0x44'),'no');this[_0xaf0b('0x7')]('avpf',null);this[_0xaf0b('0x7')]('force_avp',null);this[_0xaf0b('0x7')](_0xaf0b('0x45'),null);this[_0xaf0b('0x7')](_0xaf0b('0x46'),null);this['setDataValue']('dtlsverify',null);this[_0xaf0b('0x7')]('dtlssetup',null);this[_0xaf0b('0x7')](_0xaf0b('0x47'),null);this['setDataValue'](_0xaf0b('0x48'),null);this[_0xaf0b('0x7')]('rtcp_mux','no');break;case 0x2:this['setDataValue']('transport',_0xaf0b('0x49'));this[_0xaf0b('0x7')]('encryption','yes');this['setDataValue'](_0xaf0b('0x4a'),'yes');this['setDataValue'](_0xaf0b('0x4b'),_0xaf0b('0x2c'));this[_0xaf0b('0x7')](_0xaf0b('0x45'),'yes');this[_0xaf0b('0x7')](_0xaf0b('0x46'),_0xaf0b('0x2c'));this[_0xaf0b('0x7')](_0xaf0b('0x4c'),'no');this[_0xaf0b('0x7')](_0xaf0b('0x4d'),_0xaf0b('0x3f'));this[_0xaf0b('0x7')](_0xaf0b('0x47'),_0x2189b7[_0xaf0b('0x47')]||_0xaf0b('0x4e'));this[_0xaf0b('0x7')]('dtlsprivatekey',_0x2189b7[_0xaf0b('0x48')]||'/etc/pki/tls/private/motion.key');this[_0xaf0b('0x7')](_0xaf0b('0x4f'),_0xaf0b('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xaf0b('0x41')],'set':function(_0x69785a){this['setDataValue']('permissions',_0x69785a?_0x69785a[_0xaf0b('0x31')](','):[]);},'get':function(){return this[_0xaf0b('0xb')](_0xaf0b('0x50'))?_['map'](this[_0xaf0b('0xb')](_0xaf0b('0x50'))[_0xaf0b('0x26')](','),function(_0x270105){return parseInt(_0x270105,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xaf0b('0xd')]},'phoneBarBusyNumber':{'type':Sequelize[_0xaf0b('0xd')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xaf0b('0xd')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xaf0b('0xf')](_0xaf0b('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xaf0b('0xd')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xaf0b('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xaf0b('0xb')](_0xaf0b('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xaf0b('0xd')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![],'set':function(_0x58c774){if(typeof _0x58c774===_0xaf0b('0x52')){var _0x26e703=_0x58c774==='1'?!![]:_0x58c774==='0'?![]:_0x58c774===_0xaf0b('0x53')?!![]:_0x58c774==='false'?![]:![];this[_0xaf0b('0x7')](_0xaf0b('0x54'),_0x26e703);}else{this[_0xaf0b('0x7')](_0xaf0b('0x54'),_0x58c774);}}},'blocked':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![],'set':function(_0x582335){this['setDataValue'](_0xaf0b('0x55'),_0x582335);if(_0x582335===!![]){this['setDataValue'](_0xaf0b('0x56'),moment());this['setDataValue'](_0xaf0b('0x57'),0x0);}else{this[_0xaf0b('0x7')](_0xaf0b('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xaf0b('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xaf0b('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xaf0b('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xaf0b('0x18')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a03b697..1998530 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 _0x4c60=['order','pick','UserVoiceQueueRt','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','login','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','device','PAUSE','LOGININPAUSE','YYYY-MM-DD\x20HH:mm:ss','logout','pause','QueuePause','updateAttributes','getChannels','forEach','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','getVoiceQueues','setDataValue','getChatQueues','getMailQueues','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Chat','Mail','Sms','removeAgent','Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$overlap','$contains','$any','firstName','phone','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','resolve','queues','teams','inbound','isEmpty','lower','col','toString','desc','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unavailable','voiceStatus','QueryTypes','SELECT','select','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','http','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','role','Users','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','send','rawAttributes','fieldName','password','getOptions','where','User','query','include','attributes','push','findAll','rows','length','dataValues','sms','mail','openchannel','whatsapp','all','show','params','differenceBy','keys','salt','intersection','model','fields','includeAll','options','openTabs','true','chat','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','107','109','111','114','115','create','user','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','compact','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','emit','Queue:save','voice','VoiceQueue','get','SIP/%s','voicePause','upsert','remove','isArray','addAvatar','userpic','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','fax','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','filters','sort','merge','hasOwnProperty','CmList','List','Tag','Tags','nolimit','getQueues','Queue'];(function(_0x35f733,_0x3e258e){var _0xc73566=function(_0x24460f){while(--_0x24460f){_0x35f733['push'](_0x35f733['shift']());}};_0xc73566(++_0x3e258e);}(_0x4c60,0xc1));var _0x04c6=function(_0x18021c,_0x134754){_0x18021c=_0x18021c-0x0;var _0x58a6c5=_0x4c60[_0x18021c];return _0x58a6c5;};'use strict';var moment=require(_0x04c6('0x0'));var BPromise=require(_0x04c6('0x1'));var util=require(_0x04c6('0x2'));var path=require(_0x04c6('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x04c6('0x4'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0x04c6('0x5'))(_0x04c6('0x6'));var utils=require(_0x04c6('0x7'));var config=require(_0x04c6('0x8'));var licenseUtil=require(_0x04c6('0x9'));var db=require(_0x04c6('0xa'))['db'];var socket=require(_0x04c6('0xb'))(new Redis(config['redis']));require(_0x04c6('0xc'))[_0x04c6('0xd')](socket);config[_0x04c6('0xe')]=_[_0x04c6('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var client=jayson['client'][_0x04c6('0x10')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5584cd,_0x15d31a,_0x2772fa,_0x5236c8){return new BPromise(function(_0x4316f8,_0x19eb01){var _0x119187=_0x5236c8||client;return _0x119187[_0x04c6('0x11')](_0x5584cd,_0x2772fa)['then'](function(_0x257a0a){logger[_0x04c6('0x12')](_0x04c6('0x13'),_0x15d31a,'request\x20sent');logger[_0x04c6('0x14')](_0x04c6('0x15'),_0x15d31a,_0x04c6('0x16'),JSON[_0x04c6('0x17')](_0x257a0a));if(_0x257a0a[_0x04c6('0x18')]){if(_0x257a0a[_0x04c6('0x18')][_0x04c6('0x19')]===0x1f4){logger[_0x04c6('0x18')]('User,\x20%s,\x20%s',_0x15d31a,_0x257a0a[_0x04c6('0x18')][_0x04c6('0x1a')]);return _0x19eb01(_0x257a0a[_0x04c6('0x18')][_0x04c6('0x1a')]);}logger[_0x04c6('0x18')](_0x04c6('0x13'),_0x15d31a,_0x257a0a[_0x04c6('0x18')][_0x04c6('0x1a')]);return _0x4316f8(_0x257a0a['error'][_0x04c6('0x1a')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x13'),_0x15d31a,'request\x20sent');_0x4316f8(_0x257a0a['result']['message']);}})[_0x04c6('0x1b')](function(_0xb997e0){logger['error']('User,\x20%s,\x20%s',_0x15d31a,_0xb997e0);_0x19eb01(_0xb997e0);});});}function respondWithStatusCode(_0x1e6854,_0x2eed94){_0x2eed94=_0x2eed94||0xcc;return function(_0x3cd448){if(_0x3cd448){return _0x1e6854['sendStatus'](_0x2eed94);}return _0x1e6854[_0x04c6('0x1c')](_0x2eed94)[_0x04c6('0x1d')]();};}function respondWithResult(_0x9d41f8,_0x49c179){_0x49c179=_0x49c179||0xc8;return function(_0x2d3277){if(_0x2d3277){return _0x9d41f8[_0x04c6('0x1c')](_0x49c179)['json'](_0x2d3277);}};}function respondWithFilteredResult(_0x54a8b0,_0x4c8d72){return function(_0x348ea3){if(_0x348ea3){var _0x3a2014=typeof _0x4c8d72[_0x04c6('0x1e')]===_0x04c6('0x1f')&&typeof _0x4c8d72[_0x04c6('0x20')]==='undefined';var _0x562952=_0x348ea3[_0x04c6('0x21')];var _0x2ab1d2=_0x3a2014?0x0:_0x4c8d72[_0x04c6('0x1e')];var _0x3233d7=_0x3a2014?_0x348ea3[_0x04c6('0x21')]:_0x4c8d72[_0x04c6('0x1e')]+_0x4c8d72['limit'];var _0x1d0d3f;if(_0x3233d7>=_0x562952){_0x3233d7=_0x562952;_0x1d0d3f=0xc8;}else{_0x1d0d3f=0xce;}_0x54a8b0[_0x04c6('0x1c')](_0x1d0d3f);return _0x54a8b0['set'](_0x04c6('0x22'),_0x2ab1d2+'-'+_0x3233d7+'/'+_0x562952)[_0x04c6('0x23')](_0x348ea3);}return null;};}function saveUpdates(_0x5f1331){return function(_0x5c9003){if(_0x5c9003){return _0x5c9003[_0x04c6('0x24')](_0x5f1331)[_0x04c6('0x25')](function(_0x2a191f){return _0x2a191f;});}return null;};}function removeEntity(_0xbb9e81){return function(_0x23c500){if(_0x23c500){return _0x23c500[_0x04c6('0x26')]()['then'](function(){var _0x5d8c88=_0x23c500['get']({'plain':!![]});if(_0x5d8c88[_0x04c6('0x27')]==='admin')return;var _0x1e76e2=[{'name':_0x04c6('0x28'),'value':'user','ignore':!![]},{'name':_0x04c6('0x29'),'value':_0x04c6('0x2a'),'ignore':![]},{'name':_0x04c6('0x2b'),'value':_0x04c6('0x2c'),'ignore':![]}];var _0x5b2056=_(_0x1e76e2)[_0x04c6('0x2d')](_0x04c6('0x2e'))[_0x04c6('0x2f')](_0x04c6('0x30'))[_0x04c6('0x30')]();if(_[_0x04c6('0x31')](_0x5b2056,_0x5d8c88[_0x04c6('0x27')])){return;}var _0x46380e=_[_0x04c6('0x32')](_0x1e76e2,[_0x04c6('0x30'),_0x5d8c88[_0x04c6('0x27')]])[_0x04c6('0x33')];return db[_0x04c6('0x34')][_0x04c6('0x26')]({'where':{'type':_0x46380e,'resourceId':_0x5d8c88['id']}})[_0x04c6('0x25')](function(){return _0x23c500;});})['then'](function(){_0xbb9e81[_0x04c6('0x1c')](0xcc)[_0x04c6('0x1d')]();});}};}function handleEntityNotFound(_0x332811){return function(_0x206e32){if(!_0x206e32){_0x332811['sendStatus'](0x194);}return _0x206e32;};}function handleError(_0x181736,_0x31de0f){_0x31de0f=_0x31de0f||0x1f4;return function(_0x4e1cfa){logger['error'](_0x4e1cfa['stack']);if(_0x4e1cfa[_0x04c6('0x33')]){delete _0x4e1cfa[_0x04c6('0x33')];}_0x181736['status'](_0x31de0f)[_0x04c6('0x35')](_0x4e1cfa);};}exports['index']=function(_0x15c270,_0x1373ca){var _0x3806ea={},_0x2b28cd={'count':0x0,'rows':[]};var _0x5144f5=_(db['User'][_0x04c6('0x36')])[_0x04c6('0x2f')](function(_0x50041f){return{'name':_0x50041f[_0x04c6('0x37')],'type':_0x50041f['type']['key']};})[_0x04c6('0x2d')](function(_0x5aede6){return!_[_0x04c6('0x31')]([_0x04c6('0x38'),'salt'],_0x5aede6[_0x04c6('0x33')]);})['value']();_0x3806ea=qs[_0x04c6('0x39')](_0x5144f5,_0x15c270);var _0x39513d={'where':_0x3806ea[_0x04c6('0x3a')]};return db[_0x04c6('0x3b')][_0x04c6('0x21')](_0x39513d)['then'](function(_0x297b25){_0x2b28cd['count']=_0x297b25;if(_0x15c270[_0x04c6('0x3c')]['includeAll']){_0x3806ea[_0x04c6('0x3d')]=[{'all':!![]}];}if(!_[_0x04c6('0x31')](_0x3806ea[_0x04c6('0x3e')],'id')){_0x3806ea[_0x04c6('0x3e')][_0x04c6('0x3f')]('id');}return db[_0x04c6('0x3b')][_0x04c6('0x40')](_0x3806ea);})['then'](function(_0xdfdc34){_0x2b28cd['rows']=_0xdfdc34;if(_0x15c270[_0x04c6('0x3c')]['openTabs']==='true'){var _0x463222=[];for(var _0x58a9ad=0x0;_0x58a9ad<_0x2b28cd[_0x04c6('0x41')][_0x04c6('0x42')];_0x58a9ad++){_0x463222[_0x04c6('0x3f')](get_open_tabs('chat',_0x2b28cd[_0x04c6('0x41')][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x44'),_0x2b28cd[_0x04c6('0x41')][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs('fax',_0x2b28cd['rows'][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x45'),_0x2b28cd['rows'][_0x58a9ad][_0x04c6('0x43')]));_0x463222[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x46'),_0x2b28cd['rows'][_0x58a9ad]['dataValues']));_0x463222['push'](get_open_tabs(_0x04c6('0x47'),_0x2b28cd[_0x04c6('0x41')][_0x58a9ad]['dataValues']));}return BPromise[_0x04c6('0x48')](_0x463222)[_0x04c6('0x25')](function(_0x2bd045){return _0x2b28cd;});}else{return _0x2b28cd;}})['then'](respondWithFilteredResult(_0x1373ca,_0x3806ea))[_0x04c6('0x1b')](handleError(_0x1373ca,null));};exports[_0x04c6('0x49')]=function(_0x5e68e0,_0x25a6fc){var _0x203943={'raw':![],'where':{'id':_0x5e68e0[_0x04c6('0x4a')]['id']}},_0x2472ed={};_0x2472ed['model']=_[_0x04c6('0x4b')](_[_0x04c6('0x4c')](db[_0x04c6('0x3b')][_0x04c6('0x36')]),['password',_0x04c6('0x4d')]);_0x2472ed[_0x04c6('0x3c')]=_[_0x04c6('0x4c')](_0x5e68e0[_0x04c6('0x3c')]);_0x2472ed['filters']=_[_0x04c6('0x4e')](_0x2472ed[_0x04c6('0x4f')],_0x2472ed[_0x04c6('0x3c')]);_0x203943['attributes']=_[_0x04c6('0x4e')](_0x2472ed[_0x04c6('0x4f')],qs[_0x04c6('0x50')](_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x50')]));_0x203943[_0x04c6('0x3e')]=_0x203943[_0x04c6('0x3e')][_0x04c6('0x42')]?_0x203943[_0x04c6('0x3e')]:_0x2472ed[_0x04c6('0x4f')];if(_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x51')]){_0x203943[_0x04c6('0x3d')]=[{'all':!![]}];}_0x203943=_['merge']({},_0x203943,_0x5e68e0[_0x04c6('0x52')]);if(!_[_0x04c6('0x31')](_0x203943[_0x04c6('0x3e')],'id')){_0x203943[_0x04c6('0x3e')][_0x04c6('0x3f')]('id');}return db['User'][_0x04c6('0x32')](_0x203943)[_0x04c6('0x25')](handleEntityNotFound(_0x25a6fc,null))[_0x04c6('0x25')](function(_0x32d5e8){var _0x28dfd0=[];values=_0x32d5e8;if(_0x5e68e0[_0x04c6('0x3c')][_0x04c6('0x53')]===_0x04c6('0x54')){_0x28dfd0[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x55'),_0x32d5e8['dataValues']));_0x28dfd0['push'](get_open_tabs('sms',_0x32d5e8['dataValues']));_0x28dfd0[_0x04c6('0x3f')](get_open_tabs('openchannel',_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0['push'](get_open_tabs(_0x04c6('0x47'),_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0['push'](get_open_tabs('fax',_0x32d5e8[_0x04c6('0x43')]));_0x28dfd0[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x45'),_0x32d5e8[_0x04c6('0x43')]));return BPromise['all'](_0x28dfd0);}else{return values;}})[_0x04c6('0x25')](function(_0xf4e9d6){return values;})[_0x04c6('0x25')](respondWithResult(_0x25a6fc,null))[_0x04c6('0x1b')](handleError(_0x25a6fc,null));};exports[_0x04c6('0x24')]=function(_0x29c72f,_0x145854){if(_0x29c72f['body']['id']){delete _0x29c72f[_0x04c6('0x56')]['id'];}delete _0x29c72f['body'][_0x04c6('0x27')];return db[_0x04c6('0x3b')]['find']({'where':{'id':_0x29c72f[_0x04c6('0x4a')]['id']}})[_0x04c6('0x25')](handleEntityNotFound(_0x145854,null))[_0x04c6('0x25')](saveUpdates(_0x29c72f[_0x04c6('0x56')],null))[_0x04c6('0x25')](respondWithResult(_0x145854,null))[_0x04c6('0x1b')](handleError(_0x145854,null));};exports[_0x04c6('0x57')]=function(_0x3333a4,_0x5c51dc){return db[_0x04c6('0x3b')]['describe']()[_0x04c6('0x25')](respondWithResult(_0x5c51dc,null))[_0x04c6('0x1b')](handleError(_0x5c51dc,null));};exports['addContacts']=function(_0x503426,_0x2e649d){return db['User'][_0x04c6('0x32')]({'where':{'id':_0x503426[_0x04c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e649d,null))[_0x04c6('0x25')](function(_0x4520f0){if(_0x4520f0){return _0x4520f0[_0x04c6('0x58')](_0x503426[_0x04c6('0x56')][_0x04c6('0x59')],_[_0x04c6('0x5a')](_0x503426[_0x04c6('0x56')],[_0x04c6('0x59'),'id'])||{});}})[_0x04c6('0x25')](respondWithResult(_0x2e649d,null))[_0x04c6('0x1b')](handleError(_0x2e649d,null));};function validateUser(_0x2c9c36){return new BPromise(function(_0x52413f,_0x3aaa1e){if(_0x2c9c36[_0x04c6('0x5b')])return _0x52413f(_0x2c9c36);return db[_0x04c6('0x5c')][_0x04c6('0x5d')](0x1)['then'](function(_0x1598f0){if(_0x1598f0[_0x04c6('0x5e')])authService[_0x04c6('0x5f')](_0x2c9c36['password']);db['User'][_0x04c6('0x60')](_0x04c6('0x5b'))[_0x04c6('0x25')](function(_0x396f79){if(_[_0x04c6('0x61')](_0x396f79)){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0['min_internal']||0x1;return;}if(_[_0x04c6('0x61')](_0x1598f0[_0x04c6('0x62')])||_0x1598f0[_0x04c6('0x62')]===_0x396f79){_0x2c9c36['internal']=_0x396f79+0x1;return;}if(_0x1598f0['min_internal']>_0x396f79){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0[_0x04c6('0x62')];return;}return db[_0x04c6('0x63')][_0x04c6('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x04c6('0x63')]['QueryTypes']['SELECT']})[_0x04c6('0x25')](function(_0xe178dd){if(_0xe178dd&&_0xe178dd[_0x04c6('0x42')]){for(var _0x1904d4=0x0,_0x43260e=_0xe178dd[_0x04c6('0x42')];_0x1904d4<_0x43260e&&_[_0x04c6('0x61')](_0x2c9c36['internal']);_0x1904d4++){if(_0x1598f0[_0x04c6('0x62')]<=_0xe178dd[_0x1904d4][_0x04c6('0x64')]){_0x2c9c36[_0x04c6('0x5b')]=_0xe178dd[_0x1904d4][_0x04c6('0x64')];}else if(_0x1598f0[_0x04c6('0x62')]>_0xe178dd[_0x1904d4]['from']&&_0x1598f0['min_internal']<=_0xe178dd[_0x1904d4]['to']){_0x2c9c36[_0x04c6('0x5b')]=_0x1598f0[_0x04c6('0x62')];}}}if(_[_0x04c6('0x61')](_0x2c9c36['internal'])){_0x2c9c36[_0x04c6('0x5b')]=_0x396f79+0x1;}return _0x52413f(_0x2c9c36);});});})[_0x04c6('0x1b')](function(_0x4c9507){_0x3aaa1e(_0x4c9507);});});}function updateUser(_0x12d92e){return new BPromise(function(_0x866829,_0x152a00){try{if(_0x12d92e[_0x04c6('0x65')]){_0x12d92e[_0x04c6('0x66')]=_0x12d92e[_0x04c6('0x5b')];_0x12d92e[_0x04c6('0x67')]={'mailbox':_0x12d92e[_0x04c6('0x5b')],'password':_0x12d92e[_0x04c6('0x38')],'fullname':_0x12d92e[_0x04c6('0x68')],'email':_0x12d92e[_0x04c6('0x69')]};}if(_0x12d92e[_0x04c6('0x27')]===_0x04c6('0x2a')){if(!_0x12d92e['permissions'])_0x12d92e[_0x04c6('0x6a')]=[_0x04c6('0x6b'),'102',_0x04c6('0x6c'),_0x04c6('0x6d'),_0x04c6('0x6e'),_0x04c6('0x6f'),_0x04c6('0x70'),'106',_0x04c6('0x71'),'108',_0x04c6('0x72'),'100',_0x04c6('0x73'),_0x04c6('0x74'),_0x04c6('0x75')];}_0x866829(_0x12d92e);}catch(_0x23ce75){_0x152a00(_0x23ce75);}});}exports[_0x04c6('0x76')]=function(_0x150639,_0x34f7a6){if(_0x150639[_0x04c6('0x77')][_0x04c6('0x27')]==='agent')throw new Error(_0x04c6('0x78'));if(_0x150639[_0x04c6('0x56')]['role']===_0x04c6('0x77')&&_0x150639['user'][_0x04c6('0x27')]!==_0x04c6('0x79')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x150639[_0x04c6('0x56')][_0x04c6('0x27')]==='admin'&&_0x150639[_0x04c6('0x77')][_0x04c6('0x27')]!=='admin'){throw new Error(_0x04c6('0x7a'));}return licenseUtil[_0x04c6('0x7b')]([_0x150639['body']])[_0x04c6('0x25')](function(){return validateUser(_0x150639[_0x04c6('0x56')]);})['then'](function(_0x5314ee){return updateUser(_0x5314ee)['then'](function(_0x37d3e0){if(_0x37d3e0[_0x04c6('0x27')]===_0x04c6('0x79')){_0x37d3e0[_0x04c6('0x7c')]=_0x150639[_0x04c6('0x77')]['settingsEnabled'];delete _0x37d3e0[_0x04c6('0x7d')];}return _0x37d3e0;});})[_0x04c6('0x25')](function(_0x1a5356){return db[_0x04c6('0x3b')][_0x04c6('0x76')](_0x1a5356,{'include':[{'model':db[_0x04c6('0x67')],'as':_0x04c6('0x67')}]});})['then'](function(_0x22e182){if(_0x150639['body'][_0x04c6('0x27')]==='user')return _0x22e182;if(_0x150639['user'][_0x04c6('0x27')]!=='user')return _0x22e182;return db[_0x04c6('0x7e')][_0x04c6('0x32')]({'where':{'name':_0x22e182[_0x04c6('0x27')]===_0x04c6('0x2a')?_0x04c6('0x29'):'Telephones','userProfileId':_0x150639['user'][_0x04c6('0x7d')]},'raw':!![]})[_0x04c6('0x25')](function(_0x38d8b2){if(!_0x38d8b2||_0x38d8b2[_0x04c6('0x7f')]!=0x0)return _0x22e182;return db[_0x04c6('0x34')][_0x04c6('0x76')]({'name':_0x22e182['name'],'resourceId':_0x22e182['id'],'type':_0x38d8b2[_0x04c6('0x33')],'sectionId':_0x38d8b2['id']},{})['then'](function(){return _0x22e182;});})['catch'](function(_0x866f47){logger[_0x04c6('0x18')](_0x04c6('0x80'),_0x866f47);throw _0x866f47;});})[_0x04c6('0x25')](respondWithResult(_0x34f7a6,0xc9))[_0x04c6('0x1b')](handleError(_0x34f7a6,null));};exports[_0x04c6('0x81')]=function(_0x2e65f0,_0x243553){var _0x338e58=_0x2e65f0[_0x04c6('0x56')];var _0x21dc7c=[];if(_0x2e65f0['user'][_0x04c6('0x27')]==='agent')throw new Error('Unauthorized');if(_[_0x04c6('0x82')](_0x338e58,[_0x04c6('0x27'),_0x04c6('0x77')])&&_0x2e65f0[_0x04c6('0x77')][_0x04c6('0x27')]!==_0x04c6('0x79')){throw new Error(_0x04c6('0x83'));}if(_[_0x04c6('0x82')](_0x338e58,[_0x04c6('0x27'),_0x04c6('0x79')])&&_0x2e65f0[_0x04c6('0x77')]['role']!=='admin'){throw new Error(_0x04c6('0x84'));}return licenseUtil[_0x04c6('0x7b')](_0x338e58)['then'](function(){return validateUser(_0x338e58[0x0]);})[_0x04c6('0x25')](function(){for(var _0x3addb1=0x1;_0x3addb1<_0x338e58['length'];_0x3addb1++){var _0x4504fc=_0x338e58[_0x3addb1-0x1][_0x04c6('0x5b')];if(!_0x338e58[_0x3addb1][_0x04c6('0x5b')])_0x338e58[_0x3addb1][_0x04c6('0x5b')]=_0x4504fc+0x1;_0x21dc7c[_0x04c6('0x3f')](validateUser(_0x338e58[_0x3addb1]));}return BPromise[_0x04c6('0x48')](_0x21dc7c);})[_0x04c6('0x25')](function(){_0x21dc7c=[];for(var _0x5efcc8=0x0;_0x5efcc8<_0x338e58['length'];_0x5efcc8++){_0x21dc7c[_0x04c6('0x3f')](updateUser(_0x338e58[_0x5efcc8]));}return BPromise['all'](_0x21dc7c);})[_0x04c6('0x25')](function(){return BPromise[_0x04c6('0x85')](_0x338e58,function(_0x23b79a){return db[_0x04c6('0x3b')][_0x04c6('0x76')](_0x23b79a,{'include':[{'model':db[_0x04c6('0x67')],'as':'VoiceMail'}]})[_0x04c6('0x25')](function(_0x1b7cec){_0x23b79a['id']=_0x1b7cec['id'];return _0x23b79a;});});})[_0x04c6('0x25')](function(_0x54fe47){if(_0x2e65f0['body']['role']===_0x04c6('0x77'))return _0x54fe47;if(_0x2e65f0[_0x04c6('0x77')]['role']!==_0x04c6('0x77'))return _0x54fe47;var _0x29461e=_[_0x04c6('0x82')](_0x54fe47,function(_0x5c47a4){return _0x5c47a4[_0x04c6('0x27')]==='agent'||_0x5c47a4[_0x04c6('0x27')]===_0x04c6('0x2c');});if(!_0x29461e)return _0x54fe47;return db[_0x04c6('0x7e')]['findAll']({'where':{'name':{'$or':['Agents',_0x04c6('0x2b')]},'userProfileId':_0x2e65f0[_0x04c6('0x77')][_0x04c6('0x7d')]},'raw':!![]})[_0x04c6('0x25')](function(_0x546f5d){if(_['isEmpty'](_0x546f5d)||!_[_0x04c6('0x82')](_0x546f5d,[_0x04c6('0x7f'),0x0]))return _0x54fe47;_0x21dc7c=[];var _0x91f883=_(_0x546f5d)['map'](function(_0x2c1536){if(_0x2c1536[_0x04c6('0x7f')]===0x1)return;return _0x2c1536[_0x04c6('0x33')]===_0x04c6('0x29')?_0x04c6('0x2a'):_0x04c6('0x2c');})[_0x04c6('0x86')]()[_0x04c6('0x30')]();for(var _0x2192ff=0x0;_0x2192ff<_0x54fe47[_0x04c6('0x42')];_0x2192ff++){if(!_['includes'](_0x91f883,_0x54fe47[_0x2192ff][_0x04c6('0x27')]))return;var _0x388811=_0x54fe47[_0x2192ff][_0x04c6('0x27')]===_0x04c6('0x2a')?_0x04c6('0x29'):_0x04c6('0x2b');_0x21dc7c[_0x04c6('0x3f')](db['UserProfileResource'][_0x04c6('0x76')]({'name':_0x54fe47[_0x2192ff][_0x04c6('0x33')],'resourceId':_0x54fe47[_0x2192ff]['id'],'type':_0x388811,'sectionId':_[_0x04c6('0x32')](_0x546f5d,[_0x04c6('0x33'),_0x388811])['id']},{}));}return BPromise[_0x04c6('0x48')](_0x21dc7c);});})[_0x04c6('0x25')](respondWithResult(_0x243553,0xc9))[_0x04c6('0x1b')](handleError(_0x243553,null));};exports[_0x04c6('0x87')]=function(_0x4bfb6c,_0x203630){if(_0x4bfb6c[_0x04c6('0x56')]['id']){delete _0x4bfb6c['body']['id'];}return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x4bfb6c[_0x04c6('0x4a')]['id']}})[_0x04c6('0x25')](function(_0x29b5f2){if(!_0x29b5f2)return null;if(_0x29b5f2['id']===_0x4bfb6c['user']['id']){if(!_0x4bfb6c['body'][_0x04c6('0x88')]||!_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')]){throw new db['Sequelize'][(_0x04c6('0x8a'))](_0x04c6('0x8b'));}if(!_0x29b5f2['authenticate'](_0x4bfb6c['body'][_0x04c6('0x88')])){throw new db[(_0x04c6('0x8c'))]['ValidationError'](_0x04c6('0x8d'));}if(_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x88')]===_0x4bfb6c[_0x04c6('0x56')]['newPassword']){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x8e'));}}else if(_0x4bfb6c[_0x04c6('0x77')][_0x04c6('0x27')]===_0x04c6('0x79')){if(!_0x4bfb6c['body'][_0x04c6('0x89')]){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x8f'));}}else if(_0x4bfb6c[_0x04c6('0x77')][_0x04c6('0x27')]===_0x04c6('0x77')){if(!_0x4bfb6c[_0x04c6('0x56')]['newPassword']){throw new db['Sequelize'][(_0x04c6('0x8a'))](_0x04c6('0x8f'));}if(_0x29b5f2[_0x04c6('0x27')]!=='agent'){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x78'));}}else{throw new db['Sequelize']['ValidationError'](_0x04c6('0x78'));}return _0x29b5f2;})[_0x04c6('0x25')](handleEntityNotFound(_0x203630,null))[_0x04c6('0x25')](function(_0x414e80){return db[_0x04c6('0x5c')][_0x04c6('0x90')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x04c6('0x25')](function(_0x531c75){if(_0x531c75['securePassword'])authService[_0x04c6('0x5f')](_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')]);if(!_0x531c75['enforcePasswordHistory']||!_0x414e80[_0x04c6('0x91')])return _0x414e80;authService[_0x04c6('0x92')](_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')],_0x414e80['previousPasswords'],_0x531c75['passwordHistoryLimit']);return _0x414e80;})['then'](saveUpdates({'password':_0x4bfb6c[_0x04c6('0x56')][_0x04c6('0x89')],'passwordResetAt':_0x4bfb6c['user']['id']==_0x4bfb6c['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4bfb6c[_0x04c6('0x56')]['newPassword'],_0x414e80[_0x04c6('0x91')])},null));})[_0x04c6('0x25')](respondWithResult(_0x203630,null))[_0x04c6('0x1b')](handleError(_0x203630,null));};exports[_0x04c6('0x93')]=function(_0x3906b2,_0x410bc2){var _0x59a97f=_0x3906b2[_0x04c6('0x56')][_0x04c6('0x94')];return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x3906b2[_0x04c6('0x4a')]['id']},'attributes':['id','name',_0x04c6('0x27'),_0x04c6('0x95'),_0x04c6('0x96'),'voicePause',_0x04c6('0x97')]})[_0x04c6('0x25')](handleEntityNotFound(_0x410bc2,null))[_0x04c6('0x25')](function(_0x5ee1d3){if(_0x5ee1d3){if(!utils[_0x04c6('0x98')](_0x59a97f)){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x99'));}return _0x5ee1d3[_0x04c6('0x9a')+_[_0x04c6('0x9b')](_0x59a97f[_0x04c6('0x9c')]())+_0x04c6('0x9d')](_0x3906b2['body'][_0x04c6('0x59')],{'penalty':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x9e')]||0x0})['spread'](function(_0x55f0b9){for(var _0x4dfaa4=0x0;_0x4dfaa4<_0x3906b2[_0x04c6('0x56')][_0x04c6('0x59')][_0x04c6('0x42')];_0x4dfaa4+=0x1){var _0x579168={'UserId':Number(_0x3906b2[_0x04c6('0x4a')]['id'])};_0x579168[_[_0x04c6('0x9b')](_0x59a97f[_0x04c6('0x9c')]())+_0x04c6('0x9f')]=Number(_0x3906b2['body'][_0x04c6('0x59')][_0x4dfaa4]);socket[_0x04c6('0xa0')](_0x04c6('0x77')+_[_0x04c6('0x9b')](_0x59a97f['toLowerCase']())+_0x04c6('0xa1'),_0x579168);}return _0x55f0b9;})['then'](function(){if(_0x59a97f===_0x04c6('0xa2')){return db[_0x04c6('0xa3')]['findAll']({'where':{'id':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x59')]||[]},'raw':!![],'attributes':['id',_0x04c6('0x33')]});}})['then'](function(_0x39985f){var _0x2e71fa=_0x5ee1d3[_0x04c6('0xa4')]({'plain':!![]});var _0x4fb402=[];if(_0x59a97f===_0x04c6('0xa2')&&_0x2e71fa[_0x04c6('0x27')]==='agent'&&_0x2e71fa['online']){for(var _0x487c2a=0x0;_0x487c2a<_0x39985f['length'];_0x487c2a+=0x1){_0x4fb402[_0x04c6('0x3f')]({'membername':_0x2e71fa[_0x04c6('0x33')],'UserId':_0x2e71fa['id'],'queue_name':_0x39985f[_0x487c2a]['name'],'VoiceQueueId':_0x39985f[_0x487c2a]['id'],'interface':_[_0x04c6('0x61')](_0x2e71fa[_0x04c6('0x97')])?util['format'](_0x04c6('0xa5'),_0x2e71fa[_0x04c6('0x33')]):_0x2e71fa['interface'],'paused':_0x2e71fa[_0x04c6('0xa6')]||![],'penalty':_0x3906b2[_0x04c6('0x56')][_0x04c6('0x9e')]||0x0});}return BPromise['each'](_0x4fb402,function(_0x4c616d){return db['UserVoiceQueueRt'][_0x04c6('0xa7')](_0x4c616d);});}return _0x5ee1d3;});}})[_0x04c6('0x25')](respondWithStatusCode(_0x410bc2,null))[_0x04c6('0x1b')](handleError(_0x410bc2,null));};exports['removeQueues']=function(_0x4ed0a4,_0x55c939){var _0x29e5b4;return db['User']['find']({'where':{'id':_0x4ed0a4[_0x04c6('0x4a')]['id']},'attributes':['id','name',_0x04c6('0x27')]})[_0x04c6('0x25')](handleEntityNotFound(_0x55c939,null))[_0x04c6('0x25')](function(_0x287fa8){if(_0x287fa8){_0x29e5b4=_0x287fa8;if(!_0x4ed0a4[_0x04c6('0x3c')]['channel']||!utils['isValidChannel'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')])){throw new db[(_0x04c6('0x8c'))][(_0x04c6('0x8a'))](_0x04c6('0x99'));}return _0x287fa8[_0x04c6('0xa8')+_['capitalize'](_0x4ed0a4['query'][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queues'](_0x4ed0a4[_0x04c6('0x3c')]['ids']);}})['then'](function(_0x3a9b88){if(_[_0x04c6('0xa9')](_0x4ed0a4['query'][_0x04c6('0x59')])){for(var _0x314e68=0x0;_0x314e68<_0x4ed0a4[_0x04c6('0x3c')]['ids'][_0x04c6('0x42')];_0x314e68+=0x1){var _0x7b32e6={'UserId':Number(_0x4ed0a4[_0x04c6('0x4a')]['id'])};_0x7b32e6[_[_0x04c6('0x9b')](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+_0x04c6('0x9f')]=Number(_0x4ed0a4['query'][_0x04c6('0x59')][_0x314e68]);socket['emit'](_0x04c6('0x77')+_[_0x04c6('0x9b')](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queue:remove',_0x7b32e6);}}else{var _0x7b32e6={'UserId':Number(_0x4ed0a4[_0x04c6('0x4a')]['id'])};_0x7b32e6[_['capitalize'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'QueueId']=Number(_0x4ed0a4[_0x04c6('0x3c')]['ids']);socket['emit'](_0x04c6('0x77')+_['capitalize'](_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x94')][_0x04c6('0x9c')]())+'Queue:remove',_0x7b32e6);}return _0x3a9b88;})[_0x04c6('0x25')](function(){if(_0x4ed0a4['query'][_0x04c6('0x94')]==='voice'){return db['UserVoiceQueueRt'][_0x04c6('0x26')]({'where':{'UserId':_0x4ed0a4['params']['id'],'VoiceQueueId':_0x4ed0a4[_0x04c6('0x3c')][_0x04c6('0x59')]},'individualHooks':!![]})[_0x04c6('0x25')](function(){return _0x29e5b4;});}return _0x29e5b4;})[_0x04c6('0x25')](respondWithStatusCode(_0x55c939,null))[_0x04c6('0x1b')](handleError(_0x55c939,null));};exports[_0x04c6('0xaa')]=function(_0x257524,_0x81e27b){_0x257524[_0x04c6('0x56')][_0x04c6('0xab')]=_0x257524['file']['filename'];return db[_0x04c6('0x3b')][_0x04c6('0x32')]({'where':{'id':_0x257524[_0x04c6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x81e27b,null))[_0x04c6('0x25')](saveUpdates(_0x257524['body'],null))['then'](respondWithResult(_0x81e27b,null))[_0x04c6('0x1b')](handleError(_0x81e27b,null));};exports[_0x04c6('0xac')]=function(_0x3a3d48,_0xeca2d9){var _0x4bf86a=path['join'](config[_0x04c6('0xad')],_0x04c6('0xae'));return db['User'][_0x04c6('0x32')]({'where':{'id':_0x3a3d48[_0x04c6('0x4a')]['id']},'attributes':['id',_0x04c6('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0xeca2d9,null))['then'](function(_0x37fbde){if(_0x37fbde){if(_[_0x04c6('0x61')](_0x37fbde[_0x04c6('0xab')])){return _0xeca2d9[_0x04c6('0xaf')](_0x4bf86a);}else{if(!fs[_0x04c6('0xb0')](path[_0x04c6('0xb1')](config[_0x04c6('0xad')],_0x04c6('0xb2'),_0x37fbde['userpic']))){return _0xeca2d9['download'](_0x4bf86a);}return _0xeca2d9['download'](path[_0x04c6('0xb1')](config[_0x04c6('0xad')],_0x04c6('0xb2'),_0x37fbde[_0x04c6('0xab')]));}}})[_0x04c6('0x1b')](handleError(_0xeca2d9,null));};exports[_0x04c6('0xb3')]=function(_0xc7dfe5,_0x53982d){return db[_0x04c6('0x3b')]['find']({'where':{'id':_0xc7dfe5['params']['id']},'attributes':['id']})[_0x04c6('0x25')](handleEntityNotFound(_0x53982d,null))[_0x04c6('0x25')](function(_0x3eac1f){var _0x10a9ae=[];values=_0x3eac1f[_0x04c6('0x43')];_0x10a9ae[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x55'),_0x3eac1f['dataValues']));_0x10a9ae['push'](get_open_tabs(_0x04c6('0x44'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs('openchannel',_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs(_0x04c6('0x47'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae['push'](get_open_tabs(_0x04c6('0xb4'),_0x3eac1f[_0x04c6('0x43')]));_0x10a9ae[_0x04c6('0x3f')](get_open_tabs('mail',_0x3eac1f[_0x04c6('0x43')]));return BPromise[_0x04c6('0x48')](_0x10a9ae);})[_0x04c6('0x25')](function(_0x2cc0d2){var _0x3d6281=[];if(_0x2cc0d2){for(var _0x24e786=0x0;_0x24e786=_0x5cb15f){_0x71cbb4=_0x5cb15f;_0x896552=0xc8;}else{_0x896552=0xce;}_0x3b0c81[_0x7413('0x22')](_0x896552);return _0x3b0c81[_0x7413('0x28')](_0x7413('0x29'),_0x48c2dc+'-'+_0x71cbb4+'/'+_0x5cb15f)[_0x7413('0x23')](_0x1d46e9);}return null;};}function saveUpdates(_0x5eb4d9){return function(_0x24dce7){if(_0x24dce7){return _0x24dce7['update'](_0x5eb4d9)[_0x7413('0x17')](function(_0x23e682){return _0x23e682;});}return null;};}function removeEntity(_0xae2969){return function(_0x13a836){if(_0x13a836){return _0x13a836[_0x7413('0x2a')]()[_0x7413('0x17')](function(){var _0x5bb3ea=_0x13a836[_0x7413('0x2b')]({'plain':!![]});if(_0x5bb3ea[_0x7413('0x2c')]===_0x7413('0x2d'))return;var _0x31ae6a=[{'name':_0x7413('0x2e'),'value':_0x7413('0x2f'),'ignore':!![]},{'name':_0x7413('0x30'),'value':'agent','ignore':![]},{'name':_0x7413('0x31'),'value':_0x7413('0x32'),'ignore':![]}];var _0x41c7db=_(_0x31ae6a)[_0x7413('0x33')](_0x7413('0x34'))['map'](_0x7413('0x35'))['value']();if(_[_0x7413('0x36')](_0x41c7db,_0x5bb3ea[_0x7413('0x2c')])){return;}var _0x1cc4d8=_['find'](_0x31ae6a,[_0x7413('0x35'),_0x5bb3ea['role']])[_0x7413('0x37')];return db[_0x7413('0x38')]['destroy']({'where':{'type':_0x1cc4d8,'resourceId':_0x5bb3ea['id']}})['then'](function(){return _0x13a836;});})[_0x7413('0x17')](function(){_0xae2969[_0x7413('0x22')](0xcc)[_0x7413('0x39')]();});}};}function handleEntityNotFound(_0x513334){return function(_0x4dd1ce){if(!_0x4dd1ce){_0x513334[_0x7413('0x21')](0x194);}return _0x4dd1ce;};}function handleError(_0x5a92ab,_0x50aa24){_0x50aa24=_0x50aa24||0x1f4;return function(_0xda3035){logger['error'](_0xda3035[_0x7413('0x3a')]);if(_0xda3035[_0x7413('0x37')]){delete _0xda3035[_0x7413('0x37')];}_0x5a92ab[_0x7413('0x22')](_0x50aa24)[_0x7413('0x3b')](_0xda3035);};}exports['index']=function(_0xa58bd2,_0x8dc047){var _0x44e8b5={},_0xfa34ef={'count':0x0,'rows':[]};var _0x245777=_(db[_0x7413('0x3c')][_0x7413('0x3d')])[_0x7413('0x3e')](function(_0x5993d){return{'name':_0x5993d[_0x7413('0x3f')],'type':_0x5993d[_0x7413('0x40')][_0x7413('0x41')]};})['filter'](function(_0x31f8){return!_['includes'](['password','salt'],_0x31f8['name']);})['value']();_0x44e8b5=qs[_0x7413('0x42')](_0x245777,_0xa58bd2);var _0x4c1770={'where':_0x44e8b5['where']};return db[_0x7413('0x3c')]['count'](_0x4c1770)['then'](function(_0x3d92ec){_0xfa34ef[_0x7413('0x27')]=_0x3d92ec;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x44')]){_0x44e8b5[_0x7413('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x44e8b5[_0x7413('0x46')],'id')){_0x44e8b5['attributes'][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x48')](_0x44e8b5);})[_0x7413('0x17')](function(_0x3f7da2){_0xfa34ef[_0x7413('0x49')]=_0x3f7da2;if(_0xa58bd2[_0x7413('0x43')][_0x7413('0x4a')]===_0x7413('0x4b')){var _0x1dd908=[];for(var _0x38cd61=0x0;_0x38cd61<_0xfa34ef[_0x7413('0x49')][_0x7413('0x4c')];_0x38cd61++){_0x1dd908['push'](get_open_tabs(_0x7413('0x4d'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908['push'](get_open_tabs(_0x7413('0x51'),_0xfa34ef['rows'][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));_0x1dd908[_0x7413('0x47')](get_open_tabs(_0x7413('0x53'),_0xfa34ef[_0x7413('0x49')][_0x38cd61][_0x7413('0x4e')]));}return BPromise[_0x7413('0x54')](_0x1dd908)['then'](function(_0x513657){return _0xfa34ef;});}else{return _0xfa34ef;}})[_0x7413('0x17')](respondWithFilteredResult(_0x8dc047,_0x44e8b5))['catch'](handleError(_0x8dc047,null));};exports['show']=function(_0x27d2b6,_0x208338){var _0x5cb3bb={'raw':![],'where':{'id':_0x27d2b6['params']['id']}},_0x2aa12c={};_0x2aa12c['model']=_[_0x7413('0x55')](_['keys'](db[_0x7413('0x3c')][_0x7413('0x3d')]),[_0x7413('0x56'),_0x7413('0x57')]);_0x2aa12c[_0x7413('0x43')]=_[_0x7413('0x58')](_0x27d2b6[_0x7413('0x43')]);_0x2aa12c[_0x7413('0x59')]=_[_0x7413('0x5a')](_0x2aa12c[_0x7413('0x5b')],_0x2aa12c['query']);_0x5cb3bb[_0x7413('0x46')]=_['intersection'](_0x2aa12c['model'],qs['fields'](_0x27d2b6[_0x7413('0x43')][_0x7413('0x5c')]));_0x5cb3bb[_0x7413('0x46')]=_0x5cb3bb[_0x7413('0x46')]['length']?_0x5cb3bb['attributes']:_0x2aa12c[_0x7413('0x5b')];if(_0x27d2b6['query'][_0x7413('0x44')]){_0x5cb3bb['include']=[{'all':!![]}];}_0x5cb3bb=_['merge']({},_0x5cb3bb,_0x27d2b6['options']);if(!_['includes'](_0x5cb3bb['attributes'],'id')){_0x5cb3bb[_0x7413('0x46')][_0x7413('0x47')]('id');}return db[_0x7413('0x3c')][_0x7413('0x5d')](_0x5cb3bb)[_0x7413('0x17')](handleEntityNotFound(_0x208338,null))['then'](function(_0x33017d){var _0x1762b0=[];values=_0x33017d;if(_0x27d2b6[_0x7413('0x43')]['openTabs']===_0x7413('0x4b')){_0x1762b0['push'](get_open_tabs('chat',_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x33017d[_0x7413('0x4e')]));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs('whatsapp',_0x33017d[_0x7413('0x4e')]));_0x1762b0['push'](get_open_tabs(_0x7413('0x50'),_0x33017d['dataValues']));_0x1762b0[_0x7413('0x47')](get_open_tabs(_0x7413('0x51'),_0x33017d['dataValues']));return BPromise[_0x7413('0x54')](_0x1762b0);}else{return values;}})['then'](function(_0xf01452){return values;})[_0x7413('0x17')](respondWithResult(_0x208338,null))['catch'](handleError(_0x208338,null));};exports[_0x7413('0x5e')]=function(_0x12048c,_0x59d639){if(_0x12048c[_0x7413('0x5f')]['id']){delete _0x12048c[_0x7413('0x5f')]['id'];}delete _0x12048c['body'][_0x7413('0x2c')];return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12048c[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x59d639,null))[_0x7413('0x17')](saveUpdates(_0x12048c[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x59d639,null))['catch'](handleError(_0x59d639,null));};exports[_0x7413('0x61')]=function(_0x4ca888,_0x3808d3){return db[_0x7413('0x3c')][_0x7413('0x61')]()[_0x7413('0x17')](respondWithResult(_0x3808d3,null))['catch'](handleError(_0x3808d3,null));};exports['addContacts']=function(_0x559ce3,_0x56b090){return db['User'][_0x7413('0x5d')]({'where':{'id':_0x559ce3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x56b090,null))['then'](function(_0x3c20db){if(_0x3c20db){return _0x3c20db[_0x7413('0x62')](_0x559ce3[_0x7413('0x5f')][_0x7413('0x63')],_[_0x7413('0x64')](_0x559ce3[_0x7413('0x5f')],[_0x7413('0x63'),'id'])||{});}})[_0x7413('0x17')](respondWithResult(_0x56b090,null))[_0x7413('0x65')](handleError(_0x56b090,null));};function validateUser(_0x47512d){return new BPromise(function(_0x3f9cfd,_0x1264f3){if(_0x47512d[_0x7413('0x66')])return _0x3f9cfd(_0x47512d);return db['Setting'][_0x7413('0x67')](0x1)[_0x7413('0x17')](function(_0x4cab22){if(_0x4cab22[_0x7413('0x68')])authService[_0x7413('0x69')](_0x47512d[_0x7413('0x56')]);db[_0x7413('0x3c')][_0x7413('0x6a')](_0x7413('0x66'))['then'](function(_0x61e533){if(_[_0x7413('0x6b')](_0x61e533)){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')]||0x1;return;}if(_['isNil'](_0x4cab22['min_internal'])||_0x4cab22[_0x7413('0x6c')]===_0x61e533){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;return;}if(_0x4cab22[_0x7413('0x6c')]>_0x61e533){_0x47512d[_0x7413('0x66')]=_0x4cab22[_0x7413('0x6c')];return;}return db[_0x7413('0x6d')][_0x7413('0x43')](_0x7413('0x6e'),{'type':db['sequelize'][_0x7413('0x6f')]['SELECT']})[_0x7413('0x17')](function(_0x3deb37){if(_0x3deb37&&_0x3deb37[_0x7413('0x4c')]){for(var _0x3054f5=0x0,_0x2c4664=_0x3deb37[_0x7413('0x4c')];_0x3054f5<_0x2c4664&&_[_0x7413('0x6b')](_0x47512d[_0x7413('0x66')]);_0x3054f5++){if(_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['from']){_0x47512d[_0x7413('0x66')]=_0x3deb37[_0x3054f5][_0x7413('0x70')];}else if(_0x4cab22['min_internal']>_0x3deb37[_0x3054f5][_0x7413('0x70')]&&_0x4cab22[_0x7413('0x6c')]<=_0x3deb37[_0x3054f5]['to']){_0x47512d['internal']=_0x4cab22[_0x7413('0x6c')];}}}if(_['isNil'](_0x47512d[_0x7413('0x66')])){_0x47512d[_0x7413('0x66')]=_0x61e533+0x1;}return _0x3f9cfd(_0x47512d);});});})['catch'](function(_0x51f2c3){_0x1264f3(_0x51f2c3);});});}function updateUser(_0x227a66){return new BPromise(function(_0x19fe72,_0x34ec9a){try{if(_0x227a66['voicemail']){_0x227a66[_0x7413('0x71')]=_0x227a66[_0x7413('0x66')];_0x227a66[_0x7413('0x72')]={'mailbox':_0x227a66[_0x7413('0x66')],'password':_0x227a66[_0x7413('0x56')],'fullname':_0x227a66[_0x7413('0x73')],'email':_0x227a66['email']};}if(_0x227a66[_0x7413('0x2c')]===_0x7413('0x74')){if(!_0x227a66[_0x7413('0x75')])_0x227a66['permissions']=[_0x7413('0x76'),_0x7413('0x77'),_0x7413('0x78'),_0x7413('0x79'),_0x7413('0x7a'),_0x7413('0x7b'),_0x7413('0x7c'),_0x7413('0x7d'),_0x7413('0x7e'),'108',_0x7413('0x7f'),_0x7413('0x80'),_0x7413('0x81'),_0x7413('0x82'),_0x7413('0x83')];}_0x19fe72(_0x227a66);}catch(_0x3b7d16){_0x34ec9a(_0x3b7d16);}});}exports['create']=function(_0x3e6393,_0x56d20e){if(_0x3e6393['user'][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error('Unauthorized');if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f')&&_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_0x3e6393[_0x7413('0x5f')]['role']===_0x7413('0x2d')&&_0x3e6393['user'][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x7413('0x85')]([_0x3e6393[_0x7413('0x5f')]])[_0x7413('0x17')](function(){return validateUser(_0x3e6393[_0x7413('0x5f')]);})[_0x7413('0x17')](function(_0x3920b5){return updateUser(_0x3920b5)[_0x7413('0x17')](function(_0x12fbb2){if(_0x12fbb2[_0x7413('0x2c')]===_0x7413('0x2d')){_0x12fbb2['settingsEnabled']=_0x3e6393[_0x7413('0x2f')][_0x7413('0x86')];delete _0x12fbb2['userProfileId'];}return _0x12fbb2;});})['then'](function(_0x544fa2){return db[_0x7413('0x3c')]['create'](_0x544fa2,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]});})[_0x7413('0x17')](function(_0x36cd29){if(_0x3e6393[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x36cd29;if(_0x3e6393[_0x7413('0x2f')][_0x7413('0x2c')]!=='user')return _0x36cd29;return db[_0x7413('0x87')][_0x7413('0x5d')]({'where':{'name':_0x36cd29[_0x7413('0x2c')]==='agent'?_0x7413('0x30'):_0x7413('0x31'),'userProfileId':_0x3e6393[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x19a777){if(!_0x19a777||_0x19a777[_0x7413('0x89')]!=0x0)return _0x36cd29;return db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x36cd29[_0x7413('0x37')],'resourceId':_0x36cd29['id'],'type':_0x19a777['name'],'sectionId':_0x19a777['id']},{})[_0x7413('0x17')](function(){return _0x36cd29;});})[_0x7413('0x65')](function(_0x4d2aed){logger[_0x7413('0x1b')](_0x7413('0x8b'),_0x4d2aed);throw _0x4d2aed;});})['then'](respondWithResult(_0x56d20e,0xc9))[_0x7413('0x65')](handleError(_0x56d20e,null));};exports[_0x7413('0x8c')]=function(_0x230191,_0x47fbf0){var _0x36d8cf=_0x230191['body'];var _0x466ec8=[];if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]===_0x7413('0x74'))throw new Error(_0x7413('0x8d'));if(_[_0x7413('0x8e')](_0x36d8cf,['role',_0x7413('0x2f')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error(_0x7413('0x84'));}if(_['some'](_0x36d8cf,[_0x7413('0x2c'),_0x7413('0x2d')])&&_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x36d8cf)[_0x7413('0x17')](function(){return validateUser(_0x36d8cf[0x0]);})[_0x7413('0x17')](function(){for(var _0x389ce1=0x1;_0x389ce1<_0x36d8cf[_0x7413('0x4c')];_0x389ce1++){var _0x4ec202=_0x36d8cf[_0x389ce1-0x1]['internal'];if(!_0x36d8cf[_0x389ce1][_0x7413('0x66')])_0x36d8cf[_0x389ce1][_0x7413('0x66')]=_0x4ec202+0x1;_0x466ec8[_0x7413('0x47')](validateUser(_0x36d8cf[_0x389ce1]));}return BPromise['all'](_0x466ec8);})['then'](function(){_0x466ec8=[];for(var _0x2d71c8=0x0;_0x2d71c8<_0x36d8cf[_0x7413('0x4c')];_0x2d71c8++){_0x466ec8[_0x7413('0x47')](updateUser(_0x36d8cf[_0x2d71c8]));}return BPromise[_0x7413('0x54')](_0x466ec8);})[_0x7413('0x17')](function(){return BPromise[_0x7413('0x8f')](_0x36d8cf,function(_0x5fd045){return db['User']['create'](_0x5fd045,{'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x72')}]})['then'](function(_0x2016de){_0x5fd045['id']=_0x2016de['id'];return _0x5fd045;});});})[_0x7413('0x17')](function(_0x35389e){if(_0x230191[_0x7413('0x5f')][_0x7413('0x2c')]===_0x7413('0x2f'))return _0x35389e;if(_0x230191[_0x7413('0x2f')][_0x7413('0x2c')]!==_0x7413('0x2f'))return _0x35389e;var _0x5802e0=_[_0x7413('0x8e')](_0x35389e,function(_0x3baf5c){return _0x3baf5c[_0x7413('0x2c')]===_0x7413('0x74')||_0x3baf5c[_0x7413('0x2c')]===_0x7413('0x32');});if(!_0x5802e0)return _0x35389e;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':['Agents',_0x7413('0x31')]},'userProfileId':_0x230191[_0x7413('0x2f')][_0x7413('0x88')]},'raw':!![]})[_0x7413('0x17')](function(_0x29c329){if(_[_0x7413('0x90')](_0x29c329)||!_[_0x7413('0x8e')](_0x29c329,[_0x7413('0x89'),0x0]))return _0x35389e;_0x466ec8=[];var _0x4e872e=_(_0x29c329)[_0x7413('0x3e')](function(_0x4ef245){if(_0x4ef245[_0x7413('0x89')]===0x1)return;return _0x4ef245[_0x7413('0x37')]===_0x7413('0x30')?_0x7413('0x74'):_0x7413('0x32');})['compact']()[_0x7413('0x35')]();for(var _0xdbb32=0x0;_0xdbb32<_0x35389e[_0x7413('0x4c')];_0xdbb32++){if(!_[_0x7413('0x36')](_0x4e872e,_0x35389e[_0xdbb32][_0x7413('0x2c')]))return;var _0x38f6cc=_0x35389e[_0xdbb32][_0x7413('0x2c')]===_0x7413('0x74')?_0x7413('0x30'):_0x7413('0x31');_0x466ec8[_0x7413('0x47')](db[_0x7413('0x38')][_0x7413('0x8a')]({'name':_0x35389e[_0xdbb32][_0x7413('0x37')],'resourceId':_0x35389e[_0xdbb32]['id'],'type':_0x38f6cc,'sectionId':_[_0x7413('0x5d')](_0x29c329,['name',_0x38f6cc])['id']},{}));}return BPromise['all'](_0x466ec8);});})[_0x7413('0x17')](respondWithResult(_0x47fbf0,0xc9))[_0x7413('0x65')](handleError(_0x47fbf0,null));};exports['changePassword']=function(_0x2144b3,_0x571a6c){if(_0x2144b3[_0x7413('0x5f')]['id']){delete _0x2144b3[_0x7413('0x5f')]['id'];}return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2144b3[_0x7413('0x60')]['id']}})[_0x7413('0x17')](function(_0x10024a){if(!_0x10024a)return null;if(_0x10024a['id']===_0x2144b3[_0x7413('0x2f')]['id']){if(!_0x2144b3['body'][_0x7413('0x91')]||!_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize'][(_0x7413('0x93'))](_0x7413('0x94'));}if(!_0x10024a[_0x7413('0x95')](_0x2144b3['body'][_0x7413('0x91')])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x97'));}if(_0x2144b3[_0x7413('0x5f')][_0x7413('0x91')]===_0x2144b3['body'][_0x7413('0x92')]){throw new db['Sequelize']['ValidationError'](_0x7413('0x98'));}}else if(_0x2144b3[_0x7413('0x2f')][_0x7413('0x2c')]==='admin'){if(!_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0x99'));}}else if(_0x2144b3[_0x7413('0x2f')]['role']==='user'){if(!_0x2144b3['body'][_0x7413('0x92')]){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x99'));}if(_0x10024a[_0x7413('0x2c')]!==_0x7413('0x74')){throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}}else{throw new db[(_0x7413('0x96'))]['ValidationError'](_0x7413('0x8d'));}return _0x10024a;})[_0x7413('0x17')](handleEntityNotFound(_0x571a6c,null))[_0x7413('0x17')](function(_0x3819d3){return db['Setting'][_0x7413('0x9a')]({'attributes':['id',_0x7413('0x68'),'enforcePasswordHistory',_0x7413('0x9b')]})[_0x7413('0x17')](function(_0x570989){if(_0x570989[_0x7413('0x68')])authService['validatePasswordPattern'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')]);if(!_0x570989[_0x7413('0x9c')]||!_0x3819d3[_0x7413('0x9d')])return _0x3819d3;authService[_0x7413('0x9e')](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')],_0x570989['passwordHistoryLimit']);return _0x3819d3;})[_0x7413('0x17')](saveUpdates({'password':_0x2144b3['body']['newPassword'],'passwordResetAt':_0x2144b3[_0x7413('0x2f')]['id']==_0x2144b3[_0x7413('0x60')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2144b3[_0x7413('0x5f')][_0x7413('0x92')],_0x3819d3[_0x7413('0x9d')])},null));})[_0x7413('0x17')](respondWithResult(_0x571a6c,null))[_0x7413('0x65')](handleError(_0x571a6c,null));};exports[_0x7413('0x9f')]=function(_0x5ca6c3,_0x2c1a90){var _0x337540=_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa0')];return db['User'][_0x7413('0x5d')]({'where':{'id':_0x5ca6c3[_0x7413('0x60')]['id']},'attributes':['id','name',_0x7413('0x2c'),_0x7413('0xa1'),_0x7413('0xa2'),'voicePause',_0x7413('0xa3')]})[_0x7413('0x17')](handleEntityNotFound(_0x2c1a90,null))[_0x7413('0x17')](function(_0x1aa397){if(_0x1aa397){if(!utils[_0x7413('0xa4')](_0x337540)){throw new db[(_0x7413('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x1aa397[_0x7413('0xa5')+_[_0x7413('0xa6')](_0x337540[_0x7413('0xa7')]())+_0x7413('0xa8')](_0x5ca6c3['body'][_0x7413('0x63')],{'penalty':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0xa9')]||0x0})[_0x7413('0xaa')](function(_0x57b209){for(var _0x56422f=0x0;_0x56422f<_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]['length'];_0x56422f+=0x1){var _0x1eeb5c={'UserId':Number(_0x5ca6c3[_0x7413('0x60')]['id'])};_0x1eeb5c[_['capitalize'](_0x337540[_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')][_0x56422f]);socket['emit']('user'+_['capitalize'](_0x337540['toLowerCase']())+_0x7413('0xac'),_0x1eeb5c);}return _0x57b209;})[_0x7413('0x17')](function(){if(_0x337540===_0x7413('0xad')){return db[_0x7413('0xae')][_0x7413('0x48')]({'where':{'id':_0x5ca6c3[_0x7413('0x5f')][_0x7413('0x63')]||[]},'raw':!![],'attributes':['id',_0x7413('0x37')]});}})[_0x7413('0x17')](function(_0x321ce){var _0x19a1f6=_0x1aa397['get']({'plain':!![]});var _0x5d6c8b=[];if(_0x337540==='voice'&&_0x19a1f6[_0x7413('0x2c')]===_0x7413('0x74')&&_0x19a1f6[_0x7413('0xa1')]){for(var _0x4c6236=0x0;_0x4c6236<_0x321ce['length'];_0x4c6236+=0x1){_0x5d6c8b[_0x7413('0x47')]({'membername':_0x19a1f6[_0x7413('0x37')],'UserId':_0x19a1f6['id'],'queue_name':_0x321ce[_0x4c6236][_0x7413('0x37')],'VoiceQueueId':_0x321ce[_0x4c6236]['id'],'interface':_['isNil'](_0x19a1f6[_0x7413('0xa3')])?util['format'](_0x7413('0xaf'),_0x19a1f6[_0x7413('0x37')]):_0x19a1f6[_0x7413('0xa3')],'paused':_0x19a1f6[_0x7413('0xb0')]||![],'penalty':_0x5ca6c3['body']['penalty']||0x0});}return BPromise['each'](_0x5d6c8b,function(_0x48a547){return db['UserVoiceQueueRt']['upsert'](_0x48a547);});}return _0x1aa397;});}})[_0x7413('0x17')](respondWithStatusCode(_0x2c1a90,null))[_0x7413('0x65')](handleError(_0x2c1a90,null));};exports['removeQueues']=function(_0x2304bc,_0x34b2e2){var _0x545c7e;return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x2304bc[_0x7413('0x60')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x34b2e2,null))[_0x7413('0x17')](function(_0xb1d14b){if(_0xb1d14b){_0x545c7e=_0xb1d14b;if(!_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]||!utils[_0x7413('0xa4')](_0x2304bc['query']['channel'])){throw new db[(_0x7413('0x96'))][(_0x7413('0x93'))](_0x7413('0xb1'));}return _0xb1d14b[_0x7413('0xb2')+_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xa8')](_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]);}})[_0x7413('0x17')](function(_0x2ee4f8){if(_[_0x7413('0xb3')](_0x2304bc[_0x7413('0x43')]['ids'])){for(var _0xb42506=0x0;_0xb42506<_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0x7413('0x4c')];_0xb42506+=0x1){var _0x1b03f8={'UserId':Number(_0x2304bc[_0x7413('0x60')]['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc[_0x7413('0x43')][_0x7413('0x63')][_0xb42506]);socket['emit']('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xb4'),_0x1b03f8);}}else{var _0x1b03f8={'UserId':Number(_0x2304bc['params']['id'])};_0x1b03f8[_['capitalize'](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+_0x7413('0xab')]=Number(_0x2304bc['query'][_0x7413('0x63')]);socket[_0x7413('0xb5')]('user'+_[_0x7413('0xa6')](_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')][_0x7413('0xa7')]())+'Queue:remove',_0x1b03f8);}return _0x2ee4f8;})[_0x7413('0x17')](function(){if(_0x2304bc[_0x7413('0x43')][_0x7413('0xa0')]===_0x7413('0xad')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2304bc[_0x7413('0x60')]['id'],'VoiceQueueId':_0x2304bc[_0x7413('0x43')][_0x7413('0x63')]},'individualHooks':!![]})[_0x7413('0x17')](function(){return _0x545c7e;});}return _0x545c7e;})[_0x7413('0x17')](respondWithStatusCode(_0x34b2e2,null))[_0x7413('0x65')](handleError(_0x34b2e2,null));};exports[_0x7413('0xb6')]=function(_0x56a565,_0x2ec725){_0x56a565[_0x7413('0x5f')]['userpic']=_0x56a565['file'][_0x7413('0xb7')];return db['User']['find']({'where':{'id':_0x56a565[_0x7413('0x60')]['id']}})[_0x7413('0x17')](handleEntityNotFound(_0x2ec725,null))[_0x7413('0x17')](saveUpdates(_0x56a565[_0x7413('0x5f')],null))[_0x7413('0x17')](respondWithResult(_0x2ec725,null))[_0x7413('0x65')](handleError(_0x2ec725,null));};exports[_0x7413('0xb8')]=function(_0x12fcf7,_0x4f01ef){var _0x3d0eee=path[_0x7413('0xb9')](config['root'],_0x7413('0xba'));return db[_0x7413('0x3c')][_0x7413('0x5d')]({'where':{'id':_0x12fcf7[_0x7413('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7413('0x17')](handleEntityNotFound(_0x4f01ef,null))[_0x7413('0x17')](function(_0x714cde){if(_0x714cde){if(_['isNil'](_0x714cde[_0x7413('0xbb')])){return _0x4f01ef[_0x7413('0xbc')](_0x3d0eee);}else{if(!fs[_0x7413('0xbd')](path['join'](config[_0x7413('0xbe')],'server/files/images/',_0x714cde[_0x7413('0xbb')]))){return _0x4f01ef['download'](_0x3d0eee);}return _0x4f01ef['download'](path[_0x7413('0xb9')](config[_0x7413('0xbe')],_0x7413('0xbf'),_0x714cde[_0x7413('0xbb')]));}}})['catch'](handleError(_0x4f01ef,null));};exports[_0x7413('0xc0')]=function(_0x5477e9,_0x237b80){return db[_0x7413('0x3c')]['find']({'where':{'id':_0x5477e9[_0x7413('0x60')]['id']},'attributes':['id']})[_0x7413('0x17')](handleEntityNotFound(_0x237b80,null))[_0x7413('0x17')](function(_0x11e565){var _0xf04ba3=[];values=_0x11e565[_0x7413('0x4e')];_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4d'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x4f'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x52'),_0x11e565[_0x7413('0x4e')]));_0xf04ba3[_0x7413('0x47')](get_open_tabs('whatsapp',_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs(_0x7413('0x50'),_0x11e565['dataValues']));_0xf04ba3[_0x7413('0x47')](get_open_tabs('mail',_0x11e565['dataValues']));return BPromise[_0x7413('0x54')](_0xf04ba3);})['then'](function(_0x39dc56){var _0xb939e=[];if(_0x39dc56){for(var _0x52b81a=0x0;_0x52b81a=_0x584c7c['agents']){throw new Error(_0x0fb3('0x54'));}})[_0x0fb3('0x11')](function(){if(_0x474750){return db['UserVoiceQueueRt'][_0x0fb3('0x55')]({'where':{'membername':_0x474750['name']},'individualHooks':!![]});}})['then'](function(){if(_0x474750){return _0x474750['getVoiceQueues']({'raw':!![]});}})[_0x0fb3('0x11')](function(_0xeb0b5){if(_0x474750){if(_0xeb0b5){var _0x157528=[];_0xf5b701=_0xeb0b5;if(_0xf5b701[_0x0fb3('0x31')]){for(var _0x54c774=0x0;_0x54c774<_0xf5b701[_0x0fb3('0x31')];_0x54c774++){_0x157528['push'](db[_0x0fb3('0x2c')]['upsert']({'membername':_0x474750[_0x0fb3('0x29')],'UserId':_0x474750['id'],'queue_name':_0xf5b701[_0x54c774]['name'],'VoiceQueueId':_0xf5b701[_0x54c774]['id'],'interface':_0x206596,'paused':_0x474750[_0x0fb3('0x50')]||![],'penalty':_0xf5b701[_0x54c774]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0fb3('0x4d')](_0x157528);}}}})[_0x0fb3('0x11')](function(){if(_0x474750){return db['MemberReport']['findAll']({'where':{'membername':_0x474750[_0x0fb3('0x29')],'exitAt':null}});}})[_0x0fb3('0x11')](function(_0x4389dd){if(_0x474750){if(_0x4389dd&&_0x4389dd['length']){var _0x139c6a=[];_0x4389dd[_0x0fb3('0x36')](function(_0x20aa4d){_0x139c6a[_0x0fb3('0x37')](_0x20aa4d[_0x0fb3('0x2d')]({'exitAt':moment()[_0x0fb3('0x32')](_0x0fb3('0x33'))}));});return BPromise['all'](_0x139c6a);}}})['then'](function(_0x4218d8){if(_0x474750){var _0x1293c5=[];var _0x149882=[];var _0x1a474e=utils[_0x0fb3('0x35')]();var _0xa17b16={'membername':_0x474750[_0x0fb3('0x29')],'interface':_0x206596,'enterAt':moment()[_0x0fb3('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x474750['role'],'internal':_0x474750[_0x0fb3('0x2b')]};_0x1a474e[_0x0fb3('0x36')](function(_0x2f77d5){_0x1293c5['push'](_[_0x0fb3('0x56')]({'channel':_0x2f77d5,'type':'LOGIN','data1':_0x0fb3('0x57'),'data2':_0x206596},_0xa17b16));if(_0x474750[_0x0fb3('0x50')]){_0x149882['push'](_[_0x0fb3('0x56')]({'channel':_0x2f77d5,'type':_0x0fb3('0x30'),'data1':'LOGININPAUSE'},_0xa17b16));}});return db[_0x0fb3('0x2e')]['bulkCreate'](_0x1293c5[_0x0fb3('0x58')](_0x149882),{'individualHooks':!![]});}})[_0x0fb3('0x11')](function(){if(_0x474750){return _0x474750[_0x0fb3('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x0fb3('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x474750[_0x0fb3('0x50')]||![],'mailPause':_0x474750['loginInPause']||![],'chatPause':_0x474750[_0x0fb3('0x50')]||![],'faxPause':_0x474750[_0x0fb3('0x50')]||![],'smsPause':_0x474750[_0x0fb3('0x50')]||![],'openchannelPause':_0x474750[_0x0fb3('0x50')]||![],'pauseType':_0x474750['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x0fb3('0x32')](_0x0fb3('0x33')),'interface':_0x206596});}})['then'](function(_0x35ad91){_0x1192dd(_0x35ad91);})[_0x0fb3('0x1a')](function(_0x38bc13){_0x52563d(_0x4cf8fd['error'](0x1f4,_0x38bc13['message']));});});}; \ No newline at end of file +var _0xff0e=['options','where','attributes','limit','include','map','model','then','ShowUser','find','raw','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','mail','sms','openchannel','whatsapp','system','set','%s%s','all','destroy','mobile','phone','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetUser','User','findAll'];(function(_0x4f6942,_0x5342cf){var _0x3b2040=function(_0x4abea2){while(--_0x4abea2){_0x4f6942['push'](_0x4f6942['shift']());}};_0x3b2040(++_0x5342cf);}(_0xff0e,0xf2));var _0xeff0=function(_0x951090,_0x46859f){_0x951090=_0x951090-0x0;var _0x56bab3=_0xff0e[_0x951090];return _0x56bab3;};'use strict';var _=require(_0xeff0('0x0'));var util=require(_0xeff0('0x1'));var moment=require(_0xeff0('0x2'));var BPromise=require('bluebird');var rs=require(_0xeff0('0x3'));var fs=require('fs');var Redis=require(_0xeff0('0x4'));var db=require(_0xeff0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeff0('0x6'))(_0xeff0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeff0('0x8')][_0xeff0('0x9')]({'port':0x232a});config[_0xeff0('0xa')]=_['defaults'](config[_0xeff0('0xa')],{'host':_0xeff0('0xb'),'port':0x18eb});var socket=require(_0xeff0('0xc'))(new Redis(config[_0xeff0('0xa')]));require('./user.socket')[_0xeff0('0xd')](socket);function respondWithRpcPromise(_0x440a8f,_0x37b5f0,_0x3816dc){return new BPromise(function(_0x2e93b0,_0x29f18a){return client[_0xeff0('0xe')](_0x440a8f,_0x3816dc)['then'](function(_0x4d0d34){logger['info'](_0xeff0('0xf'),_0x37b5f0,_0xeff0('0x10'));logger[_0xeff0('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x37b5f0,_0xeff0('0x10'),JSON[_0xeff0('0x12')](_0x4d0d34));if(_0x4d0d34[_0xeff0('0x13')]){if(_0x4d0d34[_0xeff0('0x13')][_0xeff0('0x14')]===0x1f4){logger[_0xeff0('0x13')](_0xeff0('0xf'),_0x37b5f0,_0x4d0d34[_0xeff0('0x13')][_0xeff0('0x15')]);return _0x29f18a(_0x4d0d34['error'][_0xeff0('0x15')]);}logger[_0xeff0('0x13')](_0xeff0('0xf'),_0x37b5f0,_0x4d0d34['error'][_0xeff0('0x15')]);return _0x2e93b0(_0x4d0d34[_0xeff0('0x13')][_0xeff0('0x15')]);}else{logger[_0xeff0('0x16')](_0xeff0('0xf'),_0x37b5f0,_0xeff0('0x10'));_0x2e93b0(_0x4d0d34[_0xeff0('0x17')][_0xeff0('0x15')]);}})[_0xeff0('0x18')](function(_0x266807){logger['error'](_0xeff0('0xf'),_0x37b5f0,_0x266807);_0x29f18a(_0x266807);});});}exports[_0xeff0('0x19')]=function(_0x223437){var _0x348566=this;return new Promise(function(_0xa29519,_0x4cd622){return db[_0xeff0('0x1a')][_0xeff0('0x1b')]({'raw':_0x223437[_0xeff0('0x1c')]?_0x223437[_0xeff0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x223437[_0xeff0('0x1c')]?_0x223437[_0xeff0('0x1c')][_0xeff0('0x1d')]||null:null,'attributes':_0x223437['options']?_0x223437['options'][_0xeff0('0x1e')]||null:null,'limit':_0x223437['options']?_0x223437['options'][_0xeff0('0x1f')]||null:null,'include':_0x223437[_0xeff0('0x1c')]?_0x223437['options'][_0xeff0('0x20')]?_[_0xeff0('0x21')](_0x223437[_0xeff0('0x1c')][_0xeff0('0x20')],function(_0x3d2f02){return{'model':db[_0x3d2f02[_0xeff0('0x22')]],'as':_0x3d2f02['as'],'attributes':_0x3d2f02[_0xeff0('0x1e')],'include':_0x3d2f02[_0xeff0('0x20')]?_[_0xeff0('0x21')](_0x3d2f02[_0xeff0('0x20')],function(_0x5f2bb1){return{'model':db[_0x5f2bb1['model']],'as':_0x5f2bb1['as'],'attributes':_0x5f2bb1[_0xeff0('0x1e')],'include':_0x5f2bb1[_0xeff0('0x20')]?_[_0xeff0('0x21')](_0x5f2bb1['include'],function(_0x3af61a){return{'model':db[_0x3af61a[_0xeff0('0x22')]],'as':_0x3af61a['as'],'attributes':_0x3af61a[_0xeff0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeff0('0x23')](function(_0x3773de){logger[_0xeff0('0x16')](_0xeff0('0x19'),_0x223437);logger['debug']('GetUser',_0x223437,JSON[_0xeff0('0x12')](_0x3773de));_0xa29519(_0x3773de);})[_0xeff0('0x18')](function(_0x4f2733){logger[_0xeff0('0x13')](_0xeff0('0x19'),_0x4f2733[_0xeff0('0x15')],_0x223437);_0x4cd622(_0x348566[_0xeff0('0x13')](0x1f4,_0x4f2733[_0xeff0('0x15')]));});});};exports[_0xeff0('0x24')]=function(_0x24865d){var _0x58adc8=this;return new Promise(function(_0xef8036,_0x293b94){return db[_0xeff0('0x1a')][_0xeff0('0x25')]({'raw':_0x24865d['options']?_0x24865d[_0xeff0('0x1c')][_0xeff0('0x26')]===undefined?!![]:![]:!![],'where':_0x24865d[_0xeff0('0x1c')]?_0x24865d[_0xeff0('0x1c')]['where']||null:null,'attributes':_0x24865d[_0xeff0('0x1c')]?_0x24865d[_0xeff0('0x1c')][_0xeff0('0x1e')]||null:null,'include':_0x24865d[_0xeff0('0x1c')]?_0x24865d[_0xeff0('0x1c')][_0xeff0('0x20')]?_['map'](_0x24865d[_0xeff0('0x1c')][_0xeff0('0x20')],function(_0x53075d){return{'model':db[_0x53075d[_0xeff0('0x22')]],'as':_0x53075d['as'],'attributes':_0x53075d[_0xeff0('0x1e')],'include':_0x53075d[_0xeff0('0x20')]?_[_0xeff0('0x21')](_0x53075d[_0xeff0('0x20')],function(_0x438f8f){return{'model':db[_0x438f8f[_0xeff0('0x22')]],'as':_0x438f8f['as'],'attributes':_0x438f8f[_0xeff0('0x1e')],'include':_0x438f8f[_0xeff0('0x20')]?_[_0xeff0('0x21')](_0x438f8f[_0xeff0('0x20')],function(_0x129b2f){return{'model':db[_0x129b2f[_0xeff0('0x22')]],'as':_0x129b2f['as'],'attributes':_0x129b2f[_0xeff0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeff0('0x23')](function(_0x3c7624){logger[_0xeff0('0x16')](_0xeff0('0x24'),_0x24865d);logger[_0xeff0('0x11')]('ShowUser',_0x24865d,JSON[_0xeff0('0x12')](_0x3c7624));_0xef8036(_0x3c7624);})[_0xeff0('0x18')](function(_0x5b6aa2){logger[_0xeff0('0x13')]('ShowUser',_0x5b6aa2[_0xeff0('0x15')],_0x24865d);_0x293b94(_0x58adc8[_0xeff0('0x13')](0x1f4,_0x5b6aa2[_0xeff0('0x15')]));});});};exports['PauseUser']=function(_0x3e4f55){var _0x3a68a2=this;return new Promise(function(_0x14aec6,_0x156437){var _0x28f163;return db[_0xeff0('0x1a')]['find']({'where':_0x3e4f55[_0xeff0('0x1c')][_0xeff0('0x1d')]||{},'attributes':['id',_0xeff0('0x27'),_0xeff0('0x28'),_0xeff0('0x29'),_0xeff0('0x2a')]})['then'](function(_0x56ff99){if(_0x56ff99){_0x28f163=_0x56ff99;return db[_0xeff0('0x2b')][_0xeff0('0x2c')]({'paused':0x1},{'where':{'UserId':_0x28f163['id']},'individualHooks':!![]});}})[_0xeff0('0x23')](function(){if(_0x28f163){return db[_0xeff0('0x2d')][_0xeff0('0x1b')]({'where':{'membername':_0x28f163[_0xeff0('0x27')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x819475){if(_0x28f163){if(_0x819475&&_0x819475[_0xeff0('0x2e')]){var _0xd217ab=moment()[_0xeff0('0x2f')](_0xeff0('0x30'));for(var _0x18ae71=0x0,_0x30c999=_0x819475[_0xeff0('0x2e')];_0x18ae71<_0x30c999;_0x18ae71++){_0x819475[_0x18ae71][_0xeff0('0x31')]({'exitAt':_0xd217ab});}}}})[_0xeff0('0x23')](function(){if(_0x28f163){var _0x23422c=[];var _0x281f19=utils[_0xeff0('0x32')]();_0x281f19[_0xeff0('0x33')](function(_0x2dd713){_0x23422c[_0xeff0('0x34')]({'channel':_0x2dd713,'membername':_0x28f163[_0xeff0('0x27')],'interface':_[_0xeff0('0x35')](_0x28f163[_0xeff0('0x2a')])?util['format']('SIP/%s',_0x28f163['name']):_0x28f163[_0xeff0('0x2a')],'type':_0xeff0('0x36'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3e4f55[_0xeff0('0x37')][_0xeff0('0x38')]||_0xeff0('0x39'),'role':_0x28f163['role'],'internal':_0x28f163[_0xeff0('0x29')],'uniqueid':_0x3e4f55[_0xeff0('0x37')][_0xeff0('0x3a')]||null});});return db[_0xeff0('0x2d')][_0xeff0('0x3b')](_0x23422c,{'individualHooks':!![]});}})['then'](function(){if(_0x28f163){return _0x28f163['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3e4f55[_0xeff0('0x37')][_0xeff0('0x38')]||_0xeff0('0x39'),'lastPauseAt':moment()['format'](_0xeff0('0x30'))});}})[_0xeff0('0x23')](function(_0x49fb80){_0x14aec6(_0x49fb80);})[_0xeff0('0x18')](function(_0x2ba454){_0x156437(_0x3a68a2[_0xeff0('0x13')](0x1f4,_0x2ba454[_0xeff0('0x15')]));});});};exports[_0xeff0('0x3c')]=function(_0x1c01cc){var _0x5ec2ab=this;return new Promise(function(_0xde28a7,_0x53cc30){var _0x2c2b5a;return db['User'][_0xeff0('0x3d')]({'where':_0x1c01cc[_0xeff0('0x1c')]['where']||{},'attributes':['id',_0xeff0('0x27')]})['then'](function(_0xe606f4){if(_0xe606f4){_0x2c2b5a=_0xe606f4;if(_0x1c01cc['body']['channel']&&!utils[_0xeff0('0x3e')](_0x1c01cc[_0xeff0('0x37')][_0xeff0('0x3f')])){throw new Error(_0xeff0('0x40'));}switch(_0x1c01cc[_0xeff0('0x37')]['channel']){case _0xeff0('0x41'):return db[_0xeff0('0x2b')][_0xeff0('0x2c')]({'paused':0x0},{'where':{'UserId':_0x2c2b5a['id']}})[_0xeff0('0x23')](function(){return db[_0xeff0('0x2d')][_0xeff0('0x25')]({'where':{'channel':_0x1c01cc[_0xeff0('0x37')][_0xeff0('0x3f')],'membername':_0x2c2b5a[_0xeff0('0x27')],'type':_0xeff0('0x36'),'exitAt':null}});})[_0xeff0('0x23')](function(_0x59d584){if(_0x59d584){return _0x59d584[_0xeff0('0x2c')]({'exitAt':moment()['format'](_0xeff0('0x30')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xeff0('0x23')](function(){return _0x2c2b5a[_0xeff0('0x2c')]({'voicePause':![]});});case _0xeff0('0x42'):case'chat':case'fax':case _0xeff0('0x43'):case _0xeff0('0x44'):case _0xeff0('0x45'):return db[_0xeff0('0x2d')][_0xeff0('0x25')]({'where':{'channel':_0x1c01cc[_0xeff0('0x37')][_0xeff0('0x3f')],'membername':_0x2c2b5a[_0xeff0('0x27')],'type':_0xeff0('0x36'),'exitAt':null}})[_0xeff0('0x23')](function(_0x2263a6){return _0x2263a6[_0xeff0('0x2c')]({'exitAt':moment()[_0xeff0('0x2f')](_0xeff0('0x30')),'data2':_0xeff0('0x46')},{'individualHooks':!![]});})['then'](function(){var _0x46ddb1={};_[_0xeff0('0x47')](_0x46ddb1,util[_0xeff0('0x2f')](_0xeff0('0x48'),_0x1c01cc[_0xeff0('0x37')][_0xeff0('0x3f')],'Pause'),![]);return _0x2c2b5a[_0xeff0('0x2c')](_0x46ddb1);});default:return db['UserVoiceQueueRt'][_0xeff0('0x2c')]({'paused':0x0},{'where':{'UserId':_0x2c2b5a['id']}})[_0xeff0('0x23')](function(){return db[_0xeff0('0x2d')][_0xeff0('0x1b')]({'where':{'membername':_0x2c2b5a[_0xeff0('0x27')],'type':_0xeff0('0x36'),'exitAt':null}});})[_0xeff0('0x23')](function(_0x4548c3){var _0x551c60=[];_0x4548c3[_0xeff0('0x33')](function(_0x51baf3){_0x551c60[_0xeff0('0x34')](_0x51baf3[_0xeff0('0x2c')]({'exitAt':moment()[_0xeff0('0x2f')](_0xeff0('0x30')),'data2':_0xeff0('0x46')}));});return BPromise[_0xeff0('0x49')](_0x551c60);})['then'](function(){return _0x2c2b5a[_0xeff0('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xeff0('0x23')](function(_0x2668a9){_0xde28a7(_0x2668a9);})['catch'](function(_0x5d2bf2){_0x53cc30(_0x5ec2ab['error'](0x1f4,_0x5d2bf2[_0xeff0('0x15')]));});});};exports['LogoutUser']=function(_0x261954){var _0x46a138=this;return new Promise(function(_0xf271a2,_0xfc598b){var _0x3c012f;return db[_0xeff0('0x1a')][_0xeff0('0x3d')]({'where':_0x261954[_0xeff0('0x1c')][_0xeff0('0x1d')]||{},'attributes':['id',_0xeff0('0x27')]})['then'](function(_0x170270){if(_0x170270){_0x3c012f=_0x170270;return db[_0xeff0('0x2b')][_0xeff0('0x4a')]({'where':{'membername':_0x3c012f['name']},'individualHooks':!![]});}})[_0xeff0('0x23')](function(){if(_0x3c012f){return db['MemberReport'][_0xeff0('0x1b')]({'where':{'membername':_0x3c012f[_0xeff0('0x27')],'exitAt':null}});}})[_0xeff0('0x23')](function(_0x2ae2aa){if(_0x3c012f){if(_0x2ae2aa&&_0x2ae2aa[_0xeff0('0x2e')]){var _0x1ce592=[];_0x2ae2aa[_0xeff0('0x33')](function(_0x3372e2){_0x1ce592[_0xeff0('0x34')](_0x3372e2[_0xeff0('0x2c')]({'exitAt':moment()[_0xeff0('0x2f')](_0xeff0('0x30'))}));});return BPromise[_0xeff0('0x49')](_0x1ce592);}}})['then'](function(){if(_0x3c012f){return _0x3c012f[_0xeff0('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xeff0('0x23')](function(_0x198241){_0xf271a2(_0x198241);})['catch'](function(_0x5dae5e){_0xfc598b(_0x46a138['error'](0x1f4,_0x5dae5e[_0xeff0('0x15')]));});});};exports['LoginUser']=function(_0x3739c1){var _0x1f6c7e=this;return new Promise(function(_0x1d4833,_0x1f970c){var _0x5b4ee8;var _0x16b05c;var _0xf41abc;var _0x4cd215;return db[_0xeff0('0x1a')]['findOne']({'where':_0x3739c1[_0xeff0('0x1c')][_0xeff0('0x1d')]||{},'attributes':['id',_0xeff0('0x27'),_0xeff0('0x28'),_0xeff0('0x4b'),_0xeff0('0x4c'),_0xeff0('0x29'),'loginInPause','interface']})[_0xeff0('0x23')](function(_0x472a7e){if(_0x472a7e){_0x5b4ee8=_0x472a7e;_0x4cd215=_0x3739c1[_0xeff0('0x37')][_0xeff0('0x2a')]?_0x3739c1[_0xeff0('0x37')][_0xeff0('0x2a')]:util[_0xeff0('0x2f')](_0xeff0('0x4d'),_0x5b4ee8[_0xeff0('0x27')]);return db[_0xeff0('0x1a')][_0xeff0('0x4e')]({'where':{'role':_0xeff0('0x4f'),'online':!![],'id':{'$ne':_0x5b4ee8['id']}}});}})[_0xeff0('0x23')](function(_0x4cf2c5){if(_0x4cf2c5){_0xf41abc=_0x4cf2c5;return require('../../config/license/util')[_0xeff0('0x50')]();}})['then'](function(_0x357094){if(_0x357094&&_0x357094[_0xeff0('0x51')]&&_0xf41abc>=_0x357094[_0xeff0('0x51')]){throw new Error(_0xeff0('0x52'));}})[_0xeff0('0x23')](function(){if(_0x5b4ee8){return db[_0xeff0('0x2b')][_0xeff0('0x4a')]({'where':{'membername':_0x5b4ee8[_0xeff0('0x27')]},'individualHooks':!![]});}})[_0xeff0('0x23')](function(){if(_0x5b4ee8){return _0x5b4ee8[_0xeff0('0x53')]({'raw':!![]});}})[_0xeff0('0x23')](function(_0x5b5f6b){if(_0x5b4ee8){if(_0x5b5f6b){var _0x59bc6c=[];_0x16b05c=_0x5b5f6b;if(_0x16b05c[_0xeff0('0x2e')]){for(var _0x37af43=0x0;_0x37af43<_0x16b05c[_0xeff0('0x2e')];_0x37af43++){_0x59bc6c[_0xeff0('0x34')](db[_0xeff0('0x2b')]['upsert']({'membername':_0x5b4ee8[_0xeff0('0x27')],'UserId':_0x5b4ee8['id'],'queue_name':_0x16b05c[_0x37af43][_0xeff0('0x27')],'VoiceQueueId':_0x16b05c[_0x37af43]['id'],'interface':_0x4cd215,'paused':_0x5b4ee8[_0xeff0('0x54')]||![],'penalty':_0x16b05c[_0x37af43]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xeff0('0x49')](_0x59bc6c);}}}})[_0xeff0('0x23')](function(){if(_0x5b4ee8){return db[_0xeff0('0x2d')][_0xeff0('0x1b')]({'where':{'membername':_0x5b4ee8[_0xeff0('0x27')],'exitAt':null}});}})[_0xeff0('0x23')](function(_0x3c4a23){if(_0x5b4ee8){if(_0x3c4a23&&_0x3c4a23[_0xeff0('0x2e')]){var _0x4ce8ca=[];_0x3c4a23['forEach'](function(_0x327911){_0x4ce8ca[_0xeff0('0x34')](_0x327911[_0xeff0('0x2c')]({'exitAt':moment()[_0xeff0('0x2f')](_0xeff0('0x30'))}));});return BPromise[_0xeff0('0x49')](_0x4ce8ca);}}})[_0xeff0('0x23')](function(_0x494fd2){if(_0x5b4ee8){var _0x572a93=[];var _0x4f86db=[];var _0x9216c4=utils[_0xeff0('0x32')]();var _0x737c0d={'membername':_0x5b4ee8[_0xeff0('0x27')],'interface':_0x4cd215,'enterAt':moment()['format'](_0xeff0('0x30')),'role':_0x5b4ee8[_0xeff0('0x28')],'internal':_0x5b4ee8[_0xeff0('0x29')]};_0x9216c4[_0xeff0('0x33')](function(_0x54215c){_0x572a93[_0xeff0('0x34')](_[_0xeff0('0x55')]({'channel':_0x54215c,'type':_0xeff0('0x56'),'data1':_0xeff0('0x57'),'data2':_0x4cd215},_0x737c0d));if(_0x5b4ee8[_0xeff0('0x54')]){_0x4f86db[_0xeff0('0x34')](_[_0xeff0('0x55')]({'channel':_0x54215c,'type':_0xeff0('0x36'),'data1':_0xeff0('0x58')},_0x737c0d));}});return db[_0xeff0('0x2d')][_0xeff0('0x3b')](_0x572a93[_0xeff0('0x59')](_0x4f86db),{'individualHooks':!![]});}})[_0xeff0('0x23')](function(){if(_0x5b4ee8){return _0x5b4ee8[_0xeff0('0x2c')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5b4ee8['loginInPause']||![],'mailPause':_0x5b4ee8[_0xeff0('0x54')]||![],'chatPause':_0x5b4ee8[_0xeff0('0x54')]||![],'faxPause':_0x5b4ee8['loginInPause']||![],'smsPause':_0x5b4ee8[_0xeff0('0x54')]||![],'openchannelPause':_0x5b4ee8[_0xeff0('0x54')]||![],'pauseType':_0x5b4ee8['loginInPause']?_0xeff0('0x58'):null,'lastPauseAt':moment()[_0xeff0('0x2f')](_0xeff0('0x30')),'interface':_0x4cd215});}})[_0xeff0('0x23')](function(_0x2ed6c3){_0x1d4833(_0x2ed6c3);})['catch'](function(_0x4236f7){_0x1f970c(_0x1f6c7e[_0xeff0('0x13')](0x1f4,_0x4236f7[_0xeff0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index bc510dd..f29bb6b 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 _0x5347=['update','emit','./user.events','save','remove'];(function(_0x380575,_0xc72d46){var _0x15080a=function(_0x5f1ac5){while(--_0x5f1ac5){_0x380575['push'](_0x380575['shift']());}};_0x15080a(++_0xc72d46);}(_0x5347,0x1ba));var _0x7534=function(_0x3e6c96,_0x5b780b){_0x3e6c96=_0x3e6c96-0x0;var _0x43a176=_0x5347[_0x3e6c96];return _0x43a176;};'use strict';var UserEvents=require(_0x7534('0x0'));var events=[_0x7534('0x1'),_0x7534('0x2'),_0x7534('0x3')];function createListener(_0x549e66,_0x2cc817){return function(_0x1e8757){_0x2cc817[_0x7534('0x4')](_0x549e66,_0x1e8757);};}function removeListener(_0x12bef3,_0x4188ab){return function(){UserEvents['removeListener'](_0x12bef3,_0x4188ab);};}exports['register']=function(_0x261795){for(var _0x190d2d=0x0,_0x58ce14=events['length'];_0x190d2d<_0x58ce14;_0x190d2d++){var _0xea8f07=events[_0x190d2d];var _0x1bab29=createListener('user:'+_0xea8f07,_0x261795);UserEvents['on'](_0xea8f07,_0x1bab29);}}; \ No newline at end of file +var _0x25c2=['emit','length','save','remove','update'];(function(_0x31f998,_0x25596b){var _0x349e9c=function(_0x31657f){while(--_0x31657f){_0x31f998['push'](_0x31f998['shift']());}};_0x349e9c(++_0x25596b);}(_0x25c2,0x183));var _0x225c=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x25c2[_0x29db36];return _0x234e87;};'use strict';var UserEvents=require('./user.events');var events=[_0x225c('0x0'),_0x225c('0x1'),_0x225c('0x2')];function createListener(_0x3728d5,_0x296efa){return function(_0x571f71){_0x296efa[_0x225c('0x3')](_0x3728d5,_0x571f71);};}function removeListener(_0x5a17cb,_0x590933){return function(){UserEvents['removeListener'](_0x5a17cb,_0x590933);};}exports['register']=function(_0x5912f8){for(var _0x5bfe62=0x0,_0x170c33=events[_0x225c('0x4')];_0x5bfe62<_0x170c33;_0x5bfe62++){var _0x340766=events[_0x5bfe62];var _0x3c28f0=createListener('user:'+_0x340766,_0x5912f8);UserEvents['on'](_0x340766,_0x3c28f0);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d4e18b0..408e6bb 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ca741,_0x5c758c){var _0x54a577=function(_0x574b9f){while(--_0x574b9f){_0x1ca741['push'](_0x1ca741['shift']());}};_0x54a577(++_0x5c758c);}(_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(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 0956bd8..5f7b9a1 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 _0x03ca=['INTEGER','exports'];(function(_0x1dfdd5,_0x3bc9ec){var _0x26e29f=function(_0x5b9cf5){while(--_0x5b9cf5){_0x1dfdd5['push'](_0x1dfdd5['shift']());}};_0x26e29f(++_0x3bc9ec);}(_0x03ca,0x1c5));var _0xa03c=function(_0x5aeea0,_0x1eff98){_0x5aeea0=_0x5aeea0-0x0;var _0x3edf94=_0x03ca[_0x5aeea0];return _0x3edf94;};'use strict';var Sequelize=require('sequelize');module[_0xa03c('0x0')]={'penalty':{'type':Sequelize[_0xa03c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf03c=['INTEGER','sequelize','exports'];(function(_0x31a6a2,_0x2225f1){var _0x2c5004=function(_0x97154f){while(--_0x97154f){_0x31a6a2['push'](_0x31a6a2['shift']());}};_0x2c5004(++_0x2225f1);}(_0xf03c,0x199));var _0xcf03=function(_0x4c5f97,_0xe2bed8){_0x4c5f97=_0x4c5f97-0x0;var _0x557e29=_0xf03c[_0x4c5f97];return _0x557e29;};'use strict';var Sequelize=require(_0xcf03('0x0'));module[_0xcf03('0x1')]={'penalty':{'type':Sequelize[_0xcf03('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 fb89153..9105af0 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 _0x78e1=['define','UserChatQueue','user_has_chat_queues','lodash','bluebird','path','rimraf','exports'];(function(_0x109cce,_0x5ea165){var _0x73df4b=function(_0x48146a){while(--_0x48146a){_0x109cce['push'](_0x109cce['shift']());}};_0x73df4b(++_0x5ea165);}(_0x78e1,0x1b3));var _0x178e=function(_0x113f18,_0xf850d1){_0x113f18=_0x113f18-0x0;var _0x4b671f=_0x78e1[_0x113f18];return _0x4b671f;};'use strict';var _=require(_0x178e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x178e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x178e('0x2'));var rimraf=require(_0x178e('0x3'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x178e('0x4')]=function(_0x23487e,_0x42094a){return _0x23487e[_0x178e('0x5')](_0x178e('0x6'),attributes,{'tableName':_0x178e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x526c=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0xce11bc,_0x159e62){var _0x5eb1da=function(_0x2b8a2c){while(--_0x2b8a2c){_0xce11bc['push'](_0xce11bc['shift']());}};_0x5eb1da(++_0x159e62);}(_0x526c,0x1e2));var _0xc526=function(_0x50c7e5,_0x380f0f){_0x50c7e5=_0x50c7e5-0x0;var _0x108f56=_0x526c[_0x50c7e5];return _0x108f56;};'use strict';var _=require('lodash');var util=require(_0xc526('0x0'));var logger=require(_0xc526('0x1'))(_0xc526('0x2'));var moment=require(_0xc526('0x3'));var BPromise=require(_0xc526('0x4'));var rp=require(_0xc526('0x5'));var fs=require('fs');var path=require(_0xc526('0x6'));var rimraf=require('rimraf');var config=require(_0xc526('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xc526('0x8')]=function(_0x55c2a1,_0x3bbd1b){return _0x55c2a1[_0xc526('0x9')](_0xc526('0xa'),attributes,{'tableName':_0xc526('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 7e677fa..b61d7fc 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 _0x79fb=['lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x79fb,0x72));var _0xb79f=function(_0x2ad0a1,_0x4896f5){_0x2ad0a1=_0x2ad0a1-0x0;var _0x56b6c6=_0x79fb[_0x2ad0a1];return _0x56b6c6;};'use strict';var _=require(_0xb79f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb79f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb79f('0x2'))['db'];var utils=require(_0xb79f('0x3'));var logger=require(_0xb79f('0x4'))('rpc');var config=require(_0xb79f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb79f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x185580,_0x10e3a2,_0x513fb9){return new BPromise(function(_0x103fc4,_0x4e0bd0){return client[_0xb79f('0x7')](_0x185580,_0x513fb9)[_0xb79f('0x8')](function(_0x3a4cfd){logger[_0xb79f('0x9')](_0xb79f('0xa'),_0x10e3a2,_0xb79f('0xb'));logger[_0xb79f('0xc')](_0xb79f('0xd'),_0x10e3a2,'request\x20sent',JSON['stringify'](_0x3a4cfd));if(_0x3a4cfd[_0xb79f('0xe')]){if(_0x3a4cfd[_0xb79f('0xe')][_0xb79f('0xf')]===0x1f4){logger['error'](_0xb79f('0xa'),_0x10e3a2,_0x3a4cfd[_0xb79f('0xe')]['message']);return _0x4e0bd0(_0x3a4cfd[_0xb79f('0xe')][_0xb79f('0x10')]);}logger[_0xb79f('0xe')](_0xb79f('0xa'),_0x10e3a2,_0x3a4cfd['error'][_0xb79f('0x10')]);return _0x103fc4(_0x3a4cfd['error'][_0xb79f('0x10')]);}else{logger['info'](_0xb79f('0xa'),_0x10e3a2,_0xb79f('0xb'));_0x103fc4(_0x3a4cfd[_0xb79f('0x11')][_0xb79f('0x10')]);}})[_0xb79f('0x12')](function(_0x5a1b83){logger[_0xb79f('0xe')](_0xb79f('0xa'),_0x10e3a2,_0x5a1b83);_0x4e0bd0(_0x5a1b83);});});} \ No newline at end of file +var _0xfae2=['http','request','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1f863c,_0x536329){var _0x10256f=function(_0x2ba276){while(--_0x2ba276){_0x1f863c['push'](_0x1f863c['shift']());}};_0x10256f(++_0x536329);}(_0xfae2,0x65));var _0x2fae=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xfae2[_0x48b5e0];return _0x4287ea;};'use strict';var _=require(_0x2fae('0x0'));var util=require('util');var moment=require(_0x2fae('0x1'));var BPromise=require(_0x2fae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fae('0x4'));var logger=require(_0x2fae('0x5'))('rpc');var config=require(_0x2fae('0x6'));var jayson=require(_0x2fae('0x7'));var client=jayson[_0x2fae('0x8')][_0x2fae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f08f,_0x5ba6c7,_0x176a54){return new BPromise(function(_0x24b56d,_0x4fa9f8){return client[_0x2fae('0xa')](_0x49f08f,_0x176a54)['then'](function(_0x8beb48){logger['info'](_0x2fae('0xb'),_0x5ba6c7,_0x2fae('0xc'));logger[_0x2fae('0xd')](_0x2fae('0xe'),_0x5ba6c7,_0x2fae('0xc'),JSON[_0x2fae('0xf')](_0x8beb48));if(_0x8beb48['error']){if(_0x8beb48[_0x2fae('0x10')][_0x2fae('0x11')]===0x1f4){logger[_0x2fae('0x10')](_0x2fae('0xb'),_0x5ba6c7,_0x8beb48[_0x2fae('0x10')][_0x2fae('0x12')]);return _0x4fa9f8(_0x8beb48[_0x2fae('0x10')]['message']);}logger[_0x2fae('0x10')](_0x2fae('0xb'),_0x5ba6c7,_0x8beb48['error'][_0x2fae('0x12')]);return _0x24b56d(_0x8beb48[_0x2fae('0x10')][_0x2fae('0x12')]);}else{logger[_0x2fae('0x13')](_0x2fae('0xb'),_0x5ba6c7,_0x2fae('0xc'));_0x24b56d(_0x8beb48[_0x2fae('0x14')]['message']);}})[_0x2fae('0x15')](function(_0x2de1b0){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5ba6c7,_0x2de1b0);_0x4fa9f8(_0x2de1b0);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 13f6e84..4bea10a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x56ec04,_0x16985e){var _0x4fb09b=function(_0x3748dc){while(--_0x3748dc){_0x56ec04['push'](_0x56ec04['shift']());}};_0x4fb09b(++_0x16985e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xcb91[_0x4a82ac];return _0x58ee97;};'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(_0x4f83ea,_0x4b484e){var _0x3e41f6=function(_0x5cfcdc){while(--_0x5cfcdc){_0x4f83ea['push'](_0x4f83ea['shift']());}};_0x3e41f6(++_0x4b484e);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index a73adb9..6bde493 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 _0xee81=['STRING','exports','INTEGER'];(function(_0x4459de,_0x3490a7){var _0x48b986=function(_0x2e551e){while(--_0x2e551e){_0x4459de['push'](_0x4459de['shift']());}};_0x48b986(++_0x3490a7);}(_0xee81,0x178));var _0x1ee8=function(_0x403c95,_0x2549b6){_0x403c95=_0x403c95-0x0;var _0x166232=_0xee81[_0x403c95];return _0x166232;};'use strict';var Sequelize=require('sequelize');module[_0x1ee8('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1ee8('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1ee8('0x2')]}}; \ No newline at end of file +var _0x92d1=['sequelize','exports','INTEGER','STRING'];(function(_0x1765a,_0x188c19){var _0xbff87d=function(_0x26710e){while(--_0x26710e){_0x1765a['push'](_0x1765a['shift']());}};_0xbff87d(++_0x188c19);}(_0x92d1,0x18c));var _0x192d=function(_0x528a4c,_0x20cfaa){_0x528a4c=_0x528a4c-0x0;var _0x3bc82c=_0x92d1[_0x528a4c];return _0x3bc82c;};'use strict';var Sequelize=require(_0x192d('0x0'));module[_0x192d('0x1')]={'penalty':{'type':Sequelize[_0x192d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x192d('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d7a2827..9f68f95 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 _0xbf7f=['rimraf','exports','define','lodash','api','moment','bluebird','request-promise'];(function(_0x20cdca,_0x1c99ec){var _0x5ab50b=function(_0xbf1d7c){while(--_0xbf1d7c){_0x20cdca['push'](_0x20cdca['shift']());}};_0x5ab50b(++_0x1c99ec);}(_0xbf7f,0xbb));var _0xfbf7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbf7f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xfbf7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfbf7('0x1'));var moment=require(_0xfbf7('0x2'));var BPromise=require(_0xfbf7('0x3'));var rp=require(_0xfbf7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbf7('0x5'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0xfbf7('0x6')]=function(_0x263a91,_0x23c2cc){return _0x263a91[_0xfbf7('0x7')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d32=['./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7d32,0x1e8));var _0x27d3=function(_0x80d08d,_0x2ee46e){_0x80d08d=_0x80d08d-0x0;var _0x233d92=_0x7d32[_0x80d08d];return _0x233d92;};'use strict';var _=require(_0x27d3('0x0'));var util=require('util');var logger=require(_0x27d3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x27d3('0x2'));var rp=require(_0x27d3('0x3'));var fs=require('fs');var path=require(_0x27d3('0x4'));var rimraf=require(_0x27d3('0x5'));var config=require(_0x27d3('0x6'));var attributes=require(_0x27d3('0x7'));module[_0x27d3('0x8')]=function(_0x3edf73,_0x1c5a41){return _0x3edf73[_0x27d3('0x9')]('UserFaxQueue',attributes,{'tableName':_0x27d3('0xa'),'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 5141c83..3feeefb 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 _0x6f12=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x254e65,_0x433dd3){var _0x16100d=function(_0x5b8a55){while(--_0x5b8a55){_0x254e65['push'](_0x254e65['shift']());}};_0x16100d(++_0x433dd3);}(_0x6f12,0x17b));var _0x26f1=function(_0x43763f,_0x338f0b){_0x43763f=_0x43763f-0x0;var _0x1132c3=_0x6f12[_0x43763f];return _0x1132c3;};'use strict';var _=require('lodash');var util=require(_0x26f1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26f1('0x1'))['db'];var utils=require(_0x26f1('0x2'));var logger=require(_0x26f1('0x3'))(_0x26f1('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x26f1('0x5')][_0x26f1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x544e35,_0x5b7237,_0x32dcad){return new BPromise(function(_0x31e1de,_0x1374bc){return client[_0x26f1('0x7')](_0x544e35,_0x32dcad)[_0x26f1('0x8')](function(_0x4acf1d){logger[_0x26f1('0x9')](_0x26f1('0xa'),_0x5b7237,_0x26f1('0xb'));logger['debug'](_0x26f1('0xc'),_0x5b7237,_0x26f1('0xb'),JSON[_0x26f1('0xd')](_0x4acf1d));if(_0x4acf1d['error']){if(_0x4acf1d[_0x26f1('0xe')]['code']===0x1f4){logger[_0x26f1('0xe')](_0x26f1('0xa'),_0x5b7237,_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);return _0x1374bc(_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);}logger[_0x26f1('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x5b7237,_0x4acf1d[_0x26f1('0xe')]['message']);return _0x31e1de(_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);}else{logger[_0x26f1('0x9')](_0x26f1('0xa'),_0x5b7237,'request\x20sent');_0x31e1de(_0x4acf1d['result'][_0x26f1('0xf')]);}})[_0x26f1('0x10')](function(_0x51e7ca){logger[_0x26f1('0xe')](_0x26f1('0xa'),_0x5b7237,_0x51e7ca);_0x1374bc(_0x51e7ca);});});} \ No newline at end of file +var _0x3b9b=['UserFaxQueue,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b9b,0x157));var _0xb3b9=function(_0x264e43,_0x1ea472){_0x264e43=_0x264e43-0x0;var _0x4e34fd=_0x3b9b[_0x264e43];return _0x4e34fd;};'use strict';var _=require('lodash');var util=require(_0xb3b9('0x0'));var moment=require(_0xb3b9('0x1'));var BPromise=require(_0xb3b9('0x2'));var rs=require(_0xb3b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3b9('0x5'))('rpc');var config=require(_0xb3b9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb3b9('0x7')][_0xb3b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e4e61,_0x5e09a0,_0x42aac8){return new BPromise(function(_0x18c227,_0x436938){return client[_0xb3b9('0x9')](_0x2e4e61,_0x42aac8)[_0xb3b9('0xa')](function(_0x5a2794){logger[_0xb3b9('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x5e09a0,'request\x20sent');logger[_0xb3b9('0xc')](_0xb3b9('0xd'),_0x5e09a0,_0xb3b9('0xe'),JSON[_0xb3b9('0xf')](_0x5a2794));if(_0x5a2794[_0xb3b9('0x10')]){if(_0x5a2794[_0xb3b9('0x10')]['code']===0x1f4){logger[_0xb3b9('0x10')](_0xb3b9('0x11'),_0x5e09a0,_0x5a2794['error'][_0xb3b9('0x12')]);return _0x436938(_0x5a2794[_0xb3b9('0x10')]['message']);}logger['error'](_0xb3b9('0x11'),_0x5e09a0,_0x5a2794[_0xb3b9('0x10')]['message']);return _0x18c227(_0x5a2794[_0xb3b9('0x10')]['message']);}else{logger[_0xb3b9('0xb')](_0xb3b9('0x11'),_0x5e09a0,_0xb3b9('0xe'));_0x18c227(_0x5a2794['result'][_0xb3b9('0x12')]);}})[_0xb3b9('0x13')](function(_0x4213a6){logger[_0xb3b9('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x5e09a0,_0x4213a6);_0x436938(_0x4213a6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 533694a..106aea5 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x53fd58,_0x42eba1){var _0x4ab647=function(_0xaf4bbb){while(--_0xaf4bbb){_0x53fd58['push'](_0x53fd58['shift']());}};_0x4ab647(++_0x42eba1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xcb91[_0x687ddc];return _0x441991;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2c219e,_0x3dd29f){var _0x47baca=function(_0x419398){while(--_0x419398){_0x2c219e['push'](_0x2c219e['shift']());}};_0x47baca(++_0x3dd29f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index de43d5a..7a0e140 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 _0xcad5=['INTEGER','sequelize','exports'];(function(_0x548a89,_0x523eb7){var _0x2272eb=function(_0x261d45){while(--_0x261d45){_0x548a89['push'](_0x548a89['shift']());}};_0x2272eb(++_0x523eb7);}(_0xcad5,0x1ae));var _0x5cad=function(_0xcb6d0e,_0x2ffd13){_0xcb6d0e=_0xcb6d0e-0x0;var _0x12ca7c=_0xcad5[_0xcb6d0e];return _0x12ca7c;};'use strict';var Sequelize=require(_0x5cad('0x0'));module[_0x5cad('0x1')]={'penalty':{'type':Sequelize[_0x5cad('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb33d=['sequelize','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb33d,0x72));var _0xdb33=function(_0x2dee81,_0x58c3df){_0x2dee81=_0x2dee81-0x0;var _0xa3a214=_0xb33d[_0x2dee81];return _0xa3a214;};'use strict';var Sequelize=require(_0xdb33('0x0'));module[_0xdb33('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 20f3483..bf25ce4 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 _0x0ccf=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger'];(function(_0x4ed0f6,_0x6db618){var _0x229d96=function(_0x3da840){while(--_0x3da840){_0x4ed0f6['push'](_0x4ed0f6['shift']());}};_0x229d96(++_0x6db618);}(_0x0ccf,0xb4));var _0xf0cc=function(_0x3245a3,_0x324a39){_0x3245a3=_0x3245a3-0x0;var _0x5b10c9=_0x0ccf[_0x3245a3];return _0x5b10c9;};'use strict';var _=require('lodash');var util=require(_0xf0cc('0x0'));var logger=require(_0xf0cc('0x1'))(_0xf0cc('0x2'));var moment=require(_0xf0cc('0x3'));var BPromise=require(_0xf0cc('0x4'));var rp=require(_0xf0cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0cc('0x6'));var config=require(_0xf0cc('0x7'));var attributes=require(_0xf0cc('0x8'));module[_0xf0cc('0x9')]=function(_0x21853a,_0x1cbe6e){return _0x21853a[_0xf0cc('0xa')](_0xf0cc('0xb'),attributes,{'tableName':_0xf0cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73b3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0x73b3,0xf9));var _0x373b=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x73b3[_0x26da89];return _0xc95b7b;};'use strict';var _=require(_0x373b('0x0'));var util=require(_0x373b('0x1'));var logger=require(_0x373b('0x2'))(_0x373b('0x3'));var moment=require(_0x373b('0x4'));var BPromise=require(_0x373b('0x5'));var rp=require(_0x373b('0x6'));var fs=require('fs');var path=require(_0x373b('0x7'));var rimraf=require(_0x373b('0x8'));var config=require(_0x373b('0x9'));var attributes=require(_0x373b('0xa'));module[_0x373b('0xb')]=function(_0x3a3f98,_0x545fa1){return _0x3a3f98['define'](_0x373b('0xc'),attributes,{'tableName':_0x373b('0xd'),'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 cbcd8f3..bb3e126 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x48c971,_0x2ce140){_0x48c971=_0x48c971-0x0;var _0x49f5f7=_0x1cb9[_0x48c971];return _0x49f5f7;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5277da,_0x450170){var _0x5a5e20=function(_0xe769f9){while(--_0xe769f9){_0x5277da['push'](_0x5277da['shift']());}};_0x5a5e20(++_0x450170);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4a7145,_0x14c18b){_0x4a7145=_0x4a7145-0x0;var _0x9e46d5=_0x7fbe[_0x4a7145];return _0x9e46d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 7468afd..7264bf0 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 _0xa46f=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','sendUserNotification'];(function(_0x450aaf,_0x1c1a8c){var _0x199a88=function(_0x27ea3a){while(--_0x27ea3a){_0x450aaf['push'](_0x450aaf['shift']());}};_0x199a88(++_0x1c1a8c);}(_0xa46f,0xb5));var _0xfa46=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xa46f[_0x243b59];return _0x3e1676;};'use strict';var multer=require('multer');var util=require(_0xfa46('0x0'));var path=require(_0xfa46('0x1'));var timeout=require(_0xfa46('0x2'));var express=require('express');var router=express[_0xfa46('0x3')]();var fs_extra=require(_0xfa46('0x4'));var auth=require(_0xfa46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa46('0x6'));var controller=require(_0xfa46('0x7'));router['post']('/',auth['isAuthenticated'](),controller[_0xfa46('0x8')]);module[_0xfa46('0x9')]=router; \ No newline at end of file +var _0xa2bd=['sendUserNotification','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x11fcb6,_0x1cbcbf){var _0x1fbb39=function(_0x126121){while(--_0x126121){_0x11fcb6['push'](_0x11fcb6['shift']());}};_0x1fbb39(++_0x1cbcbf);}(_0xa2bd,0x151));var _0xda2b=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xa2bd[_0x236d24];return _0x1574cf;};'use strict';var multer=require(_0xda2b('0x0'));var util=require(_0xda2b('0x1'));var path=require(_0xda2b('0x2'));var timeout=require('connect-timeout');var express=require(_0xda2b('0x3'));var router=express[_0xda2b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda2b('0x5'));var interaction=require(_0xda2b('0x6'));var config=require(_0xda2b('0x7'));var controller=require(_0xda2b('0x8'));router[_0xda2b('0x9')]('/',auth[_0xda2b('0xa')](),controller[_0xda2b('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index f9778aa..6e8c904 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 _0x51ae=['STRING','BOOLEAN','exports','TEXT'];(function(_0x54da68,_0x3a81fe){var _0x2ec6a7=function(_0x1a705a){while(--_0x1a705a){_0x54da68['push'](_0x54da68['shift']());}};_0x2ec6a7(++_0x3a81fe);}(_0x51ae,0x156));var _0xe51a=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x51ae[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require('sequelize');module[_0xe51a('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xe51a('0x1')]},'recipientsDescription':{'type':Sequelize[_0xe51a('0x2')]},'beep':{'type':Sequelize[_0xe51a('0x3')]}}; \ No newline at end of file +var _0x4281=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x45d6a9,_0x549ec9){var _0x3f42a2=function(_0x29d62d){while(--_0x29d62d){_0x45d6a9['push'](_0x45d6a9['shift']());}};_0x3f42a2(++_0x549ec9);}(_0x4281,0x1a2));var _0x1428=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x4281[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0x1428('0x0'));module[_0x1428('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x1428('0x2')]},'recipientsId':{'type':Sequelize[_0x1428('0x3')]},'recipientsDescription':{'type':Sequelize[_0x1428('0x2')]},'beep':{'type':Sequelize[_0x1428('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index cf20d56..e0b7501 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 _0x1196=['queue','replace','Queue','push','all','flatten','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids'];(function(_0x41d441,_0x2f1d5b){var _0x3daad3=function(_0x542876){while(--_0x542876){_0x41d441['push'](_0x41d441['shift']());}};_0x3daad3(++_0x2f1d5b);}(_0x1196,0xd3));var _0x6119=function(_0x24eb35,_0xc05f3b){_0x24eb35=_0x24eb35-0x0;var _0x8e7f4=_0x1196[_0x24eb35];return _0x8e7f4;};'use strict';var emlformat=require(_0x6119('0x0'));var rimraf=require(_0x6119('0x1'));var zipdir=require(_0x6119('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6119('0x3'));var moment=require(_0x6119('0x4'));var BPromise=require(_0x6119('0x5'));var Mustache=require(_0x6119('0x6'));var util=require(_0x6119('0x7'));var path=require('path');var sox=require(_0x6119('0x8'));var csv=require(_0x6119('0x9'));var ejs=require(_0x6119('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6119('0xb'));var crypto=require(_0x6119('0xc'));var jsforce=require(_0x6119('0xd'));var deskjs=require(_0x6119('0xe'));var toCsv=require(_0x6119('0x9'));var querystring=require(_0x6119('0xf'));var Papa=require('papaparse');var Redis=require(_0x6119('0x10'));var authService=require(_0x6119('0x11'));var qs=require(_0x6119('0x12'));var as=require(_0x6119('0x13'));var hardwareService=require(_0x6119('0x14'));var logger=require(_0x6119('0x15'))(_0x6119('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6119('0x17'))['db'];config[_0x6119('0x18')]=_['defaults'](config[_0x6119('0x18')],{'host':_0x6119('0x19'),'port':0x18eb});var socket=require(_0x6119('0x1a'))(new Redis(config['redis']));require(_0x6119('0x1b'))['register'](socket);function respondWithStatusCode(_0x183f56,_0x1166ce){_0x1166ce=_0x1166ce||0xcc;return function(_0x49198c){if(_0x49198c){return _0x183f56[_0x6119('0x1c')](_0x1166ce);}return _0x183f56[_0x6119('0x1d')](_0x1166ce)['end']();};}function respondWithResult(_0x51bb0b,_0x15092c){_0x15092c=_0x15092c||0xc8;return function(_0x4b561c){if(_0x4b561c){return _0x51bb0b[_0x6119('0x1d')](_0x15092c)[_0x6119('0x1e')](_0x4b561c);}};}function respondWithFilteredResult(_0x5b65f3,_0x12cf1a){return function(_0x2d572d){if(_0x2d572d){var _0x249d7e=typeof _0x12cf1a[_0x6119('0x1f')]===_0x6119('0x20')&&typeof _0x12cf1a[_0x6119('0x21')]===_0x6119('0x20');var _0x3d2f41=_0x2d572d[_0x6119('0x22')];var _0x5a16c0=_0x249d7e?0x0:_0x12cf1a['offset'];var _0x2fc4fe=_0x249d7e?_0x2d572d[_0x6119('0x22')]:_0x12cf1a['offset']+_0x12cf1a[_0x6119('0x21')];var _0x486e6e;if(_0x2fc4fe>=_0x3d2f41){_0x2fc4fe=_0x3d2f41;_0x486e6e=0xc8;}else{_0x486e6e=0xce;}_0x5b65f3[_0x6119('0x1d')](_0x486e6e);return _0x5b65f3[_0x6119('0x23')]('Content-Range',_0x5a16c0+'-'+_0x2fc4fe+'/'+_0x3d2f41)[_0x6119('0x1e')](_0x2d572d);}return null;};}function patchUpdates(_0x5a37c4){return function(_0x4c83c6){try{jsonpatch[_0x6119('0x24')](_0x4c83c6,_0x5a37c4,!![]);}catch(_0x2df7d6){return BPromise['reject'](_0x2df7d6);}return _0x4c83c6[_0x6119('0x25')]();};}function saveUpdates(_0x9200b1,_0xff5b3){return function(_0x8fc60a){if(_0x8fc60a){return _0x8fc60a[_0x6119('0x26')](_0x9200b1)[_0x6119('0x27')](function(_0x10cd01){return _0x10cd01;});}return null;};}function removeEntity(_0x5c387c,_0x19d2af){return function(_0x4c4efe){if(_0x4c4efe){return _0x4c4efe['destroy']()[_0x6119('0x27')](function(){_0x5c387c[_0x6119('0x1d')](0xcc)[_0x6119('0x28')]();});}};}function handleEntityNotFound(_0x1e3f29,_0x464c6a){return function(_0x181b24){if(!_0x181b24){_0x1e3f29[_0x6119('0x1c')](0x194);}return _0x181b24;};}function handleError(_0x1f360d,_0x74220){_0x74220=_0x74220||0x1f4;return function(_0x59c374){logger[_0x6119('0x29')](_0x59c374[_0x6119('0x2a')]);if(_0x59c374[_0x6119('0x2b')]){delete _0x59c374[_0x6119('0x2b')];}_0x1f360d[_0x6119('0x1d')](_0x74220)[_0x6119('0x2c')](_0x59c374);};}exports[_0x6119('0x2d')]=function(_0x396e79,_0x1fda9d,_0x198800){if(!_0x396e79[_0x6119('0x2e')]['hasOwnProperty'](_0x6119('0x2f'))&&!_0x396e79[_0x6119('0x2e')][_0x6119('0x30')](_0x6119('0x31'))){throw new db[(_0x6119('0x32'))][(_0x6119('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x396e79['body'][_0x6119('0x30')]('TemplateId')&&!_0x396e79['body'][_0x6119('0x30')](_0x6119('0x34'))){throw new db['Sequelize'][(_0x6119('0x33'))](_0x6119('0x35'));}if(!_0x396e79[_0x6119('0x2e')]['hasOwnProperty'](_0x6119('0x36'))){throw new db['Sequelize'][(_0x6119('0x33'))](_0x6119('0x37'));}else{try{var _0x2a3f7d=JSON[_0x6119('0x38')](_0x396e79[_0x6119('0x2e')][_0x6119('0x36')]);}catch(_0x4eaa2a){logger[_0x6119('0x29')](_0x4eaa2a);throw new db[(_0x6119('0x32'))][(_0x6119('0x33'))](_0x6119('0x39'));}var _0x548d6f=[_0x6119('0x3a'),_0x6119('0x3b'),'mailqueue',_0x6119('0x3c'),_0x6119('0x3d'),_0x6119('0x3e'),_0x6119('0x3f'),_0x6119('0x40'),'user'];if(_[_0x6119('0x41')](_0x2a3f7d,function(_0x1b40d7){return!_[_0x6119('0x42')](_0x548d6f,_0x1b40d7[_0x6119('0x43')][_0x6119('0x44')]());})){throw new db[(_0x6119('0x32'))][(_0x6119('0x33'))](_0x6119('0x45'));}}}var _0x196d63={};_0x196d63['senderName']=_0x396e79['body'][_0x6119('0x30')](_0x6119('0x46'))?_0x396e79['body']['senderName']:_0x396e79[_0x6119('0x47')]['fullname'];_0x196d63['recipientsDescription']=_[_0x6119('0x48')](_0x396e79['body'][_0x6119('0x49')])?null:_0x396e79[_0x6119('0x2e')][_0x6119('0x49')];_0x196d63[_0x6119('0x4a')]=_0x396e79[_0x6119('0x2e')]['beep']||![];_0x196d63[_0x6119('0x4b')]=_0x396e79[_0x6119('0x47')]['id'];return getContent(_0x396e79[_0x6119('0x2e')])[_0x6119('0x27')](function(_0x4289fc){_0x196d63[_0x6119('0x2e')]=_0x4289fc;return getRecipients(_0x2a3f7d);})[_0x6119('0x27')](function(_0x140a48){_0x196d63[_0x6119('0x4c')]=_[_0x6119('0x4d')](_0x140a48)[_0x6119('0x4e')](',');return db[_0x6119('0x4f')][_0x6119('0x50')](function(_0x297894){return db[_0x6119('0x51')][_0x6119('0x52')](_0x196d63,{'raw':!![],'transaction':_0x297894})[_0x6119('0x27')](function(_0x2afe97){var _0x3b81aa={'sender':_0x196d63['senderName'],'description':_0x196d63['recipientsDescription'],'content':_0x196d63['body'],'beep':_0x196d63[_0x6119('0x4a')]};_0x140a48[_0x6119('0x53')](function(_0x46a067){_0x3b81aa[_0x6119('0x54')]=_0x46a067;socket['emit'](_0x6119('0x55'),_0x3b81aa);});return _0x2afe97;});});})[_0x6119('0x27')](respondWithResult(_0x1fda9d,0xc9))[_0x6119('0x56')](handleError(_0x1fda9d,null));};function getContent(_0x334c23){return new BPromise(function(_0x3ef917,_0x19a9f){if(_0x334c23['text']){_0x3ef917(_0x334c23[_0x6119('0x2f')]);return;}return db['Template'][_0x6119('0x57')]({'attributes':[_0x6119('0x58')],'where':{'id':_0x334c23['TemplateId']},'raw':!![]})[_0x6119('0x27')](function(_0x2838c0){if(!_0x2838c0)throw new db[(_0x6119('0x32'))][(_0x6119('0x33'))](_0x6119('0x59'));var _0x23d2b9=Mustache[_0x6119('0x5a')](_0x2838c0['html'],_0x334c23[_0x6119('0x34')]);_0x3ef917(_0x23d2b9);})[_0x6119('0x56')](function(_0x103b98){_0x19a9f(_0x103b98);});});}function getRecipients(_0x30cfa8){return new BPromise(function(_0x10c2ab,_0x3c65a8){var _0x44e8cc=[];var _0x213cce=[];_0x30cfa8['forEach'](function(_0x2769c2){var _0x12b50b=_[_0x6119('0x5b')](_0x2769c2['model'][_0x6119('0x44')]());if(_0x12b50b===_0x6119('0x5c')){_0x44e8cc=_[_0x6119('0x5d')](_0x44e8cc,_0x2769c2[_0x6119('0x5e')]);}else{if(_[_0x6119('0x42')](_0x12b50b,_0x6119('0x5f')))_0x12b50b=_0x12b50b[_0x6119('0x60')](_0x6119('0x5f'),_0x6119('0x61'));_0x2769c2[_0x6119('0x5e')][_0x6119('0x53')](function(_0x5a2531){_0x213cce[_0x6119('0x62')](getAgents(_0x12b50b,_0x5a2531));});}});return BPromise[_0x6119('0x63')](_0x213cce)[_0x6119('0x27')](function(_0x143a98){_0x44e8cc=_['union'](_0x44e8cc,_[_0x6119('0x64')](_0x143a98));_0x10c2ab(_0x44e8cc);})['catch'](function(_0x3c410c){_0x3c65a8(_0x3c410c);});});}function getAgents(_0x149b05,_0x13bf5b){return new BPromise(function(_0x394954,_0x2744f4){return db[_0x149b05][_0x6119('0x57')]({'where':{'id':_0x13bf5b}})['then'](function(_0x5110d4){return _0x5110d4[_0x6119('0x65')]({'attributes':['id'],'raw':!![]})[_0x6119('0x27')](function(_0x3238c2){var _0x1aaeb5=_['map'](_0x3238c2,'id');_0x394954(_0x1aaeb5);});})[_0x6119('0x56')](function(_0x4bcb10){_0x2744f4(_0x4bcb10);});});} \ No newline at end of file +var _0x69a5=['view','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','text','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','User','union','queue','replace','Queue','ids','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x69a5,0x145));var _0x569a=function(_0x2036df,_0x585cd4){_0x2036df=_0x2036df-0x0;var _0x111021=_0x69a5[_0x2036df];return _0x111021;};'use strict';var emlformat=require(_0x569a('0x0'));var rimraf=require(_0x569a('0x1'));var zipdir=require(_0x569a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x569a('0x3'));var moment=require(_0x569a('0x4'));var BPromise=require(_0x569a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x569a('0x6'));var sox=require(_0x569a('0x7'));var csv=require(_0x569a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x569a('0x9'));var _=require('lodash');var squel=require(_0x569a('0xa'));var crypto=require('crypto');var jsforce=require(_0x569a('0xb'));var deskjs=require(_0x569a('0xc'));var toCsv=require(_0x569a('0x8'));var querystring=require(_0x569a('0xd'));var Papa=require(_0x569a('0xe'));var Redis=require(_0x569a('0xf'));var authService=require(_0x569a('0x10'));var qs=require(_0x569a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x569a('0x12'));var logger=require('../../config/logger')(_0x569a('0x13'));var utils=require(_0x569a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x569a('0x15'))['db'];config[_0x569a('0x16')]=_[_0x569a('0x17')](config[_0x569a('0x16')],{'host':_0x569a('0x18'),'port':0x18eb});var socket=require(_0x569a('0x19'))(new Redis(config['redis']));require(_0x569a('0x1a'))[_0x569a('0x1b')](socket);function respondWithStatusCode(_0x4b4894,_0x5206b8){_0x5206b8=_0x5206b8||0xcc;return function(_0x3e8954){if(_0x3e8954){return _0x4b4894[_0x569a('0x1c')](_0x5206b8);}return _0x4b4894[_0x569a('0x1d')](_0x5206b8)[_0x569a('0x1e')]();};}function respondWithResult(_0x19262c,_0x1fd42c){_0x1fd42c=_0x1fd42c||0xc8;return function(_0x2c9410){if(_0x2c9410){return _0x19262c[_0x569a('0x1d')](_0x1fd42c)['json'](_0x2c9410);}};}function respondWithFilteredResult(_0x48e030,_0x1fb0ba){return function(_0x56c8da){if(_0x56c8da){var _0x9e3117=typeof _0x1fb0ba[_0x569a('0x1f')]==='undefined'&&typeof _0x1fb0ba['limit']===_0x569a('0x20');var _0xd4ee68=_0x56c8da[_0x569a('0x21')];var _0x4b543b=_0x9e3117?0x0:_0x1fb0ba[_0x569a('0x1f')];var _0x6400ba=_0x9e3117?_0x56c8da[_0x569a('0x21')]:_0x1fb0ba[_0x569a('0x1f')]+_0x1fb0ba[_0x569a('0x22')];var _0x22f174;if(_0x6400ba>=_0xd4ee68){_0x6400ba=_0xd4ee68;_0x22f174=0xc8;}else{_0x22f174=0xce;}_0x48e030[_0x569a('0x1d')](_0x22f174);return _0x48e030[_0x569a('0x23')]('Content-Range',_0x4b543b+'-'+_0x6400ba+'/'+_0xd4ee68)[_0x569a('0x24')](_0x56c8da);}return null;};}function patchUpdates(_0x249d06){return function(_0x1cb663){try{jsonpatch['apply'](_0x1cb663,_0x249d06,!![]);}catch(_0x5a264b){return BPromise['reject'](_0x5a264b);}return _0x1cb663[_0x569a('0x25')]();};}function saveUpdates(_0x47b631,_0x5619e9){return function(_0x20e509){if(_0x20e509){return _0x20e509[_0x569a('0x26')](_0x47b631)[_0x569a('0x27')](function(_0x33b061){return _0x33b061;});}return null;};}function removeEntity(_0x4e1fd3,_0x1bc061){return function(_0x4750c3){if(_0x4750c3){return _0x4750c3[_0x569a('0x28')]()['then'](function(){_0x4e1fd3['status'](0xcc)[_0x569a('0x1e')]();});}};}function handleEntityNotFound(_0x340195,_0x168c00){return function(_0x4b16a3){if(!_0x4b16a3){_0x340195[_0x569a('0x1c')](0x194);}return _0x4b16a3;};}function handleError(_0x5d6998,_0x1e6700){_0x1e6700=_0x1e6700||0x1f4;return function(_0x4d0125){logger[_0x569a('0x29')](_0x4d0125['stack']);if(_0x4d0125['name']){delete _0x4d0125[_0x569a('0x2a')];}_0x5d6998['status'](_0x1e6700)[_0x569a('0x2b')](_0x4d0125);};}exports[_0x569a('0x2c')]=function(_0x465ec2,_0x13e640,_0x1342fe){if(!_0x465ec2[_0x569a('0x2d')]['hasOwnProperty']('text')&&!_0x465ec2['body'][_0x569a('0x2e')](_0x569a('0x2f'))){throw new db[(_0x569a('0x30'))][(_0x569a('0x31'))](_0x569a('0x32'));}else{if(_0x465ec2[_0x569a('0x2d')][_0x569a('0x2e')](_0x569a('0x2f'))&&!_0x465ec2[_0x569a('0x2d')]['hasOwnProperty'](_0x569a('0x33'))){throw new db[(_0x569a('0x30'))][(_0x569a('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x465ec2['body'][_0x569a('0x2e')]('recipients')){throw new db[(_0x569a('0x30'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x24de37=JSON['parse'](_0x465ec2['body'][_0x569a('0x34')]);}catch(_0x3a2733){logger[_0x569a('0x29')](_0x3a2733);throw new db[(_0x569a('0x30'))]['ValidationError'](_0x569a('0x35'));}var _0x2d16e7=['chatqueue',_0x569a('0x36'),'mailqueue',_0x569a('0x37'),_0x569a('0x38'),'voicequeue',_0x569a('0x39'),_0x569a('0x3a'),_0x569a('0x3b')];if(_[_0x569a('0x3c')](_0x24de37,function(_0x1d8908){return!_[_0x569a('0x3d')](_0x2d16e7,_0x1d8908[_0x569a('0x3e')]['toLowerCase']());})){throw new db['Sequelize'][(_0x569a('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5e9a98={};_0x5e9a98[_0x569a('0x3f')]=_0x465ec2[_0x569a('0x2d')]['hasOwnProperty'](_0x569a('0x3f'))?_0x465ec2[_0x569a('0x2d')][_0x569a('0x3f')]:_0x465ec2[_0x569a('0x3b')][_0x569a('0x40')];_0x5e9a98[_0x569a('0x41')]=_[_0x569a('0x42')](_0x465ec2[_0x569a('0x2d')][_0x569a('0x41')])?null:_0x465ec2[_0x569a('0x2d')][_0x569a('0x41')];_0x5e9a98[_0x569a('0x43')]=_0x465ec2[_0x569a('0x2d')][_0x569a('0x43')]||![];_0x5e9a98['SenderId']=_0x465ec2[_0x569a('0x3b')]['id'];return getContent(_0x465ec2[_0x569a('0x2d')])['then'](function(_0x49bd77){_0x5e9a98[_0x569a('0x2d')]=_0x49bd77;return getRecipients(_0x24de37);})['then'](function(_0xb30b75){_0x5e9a98[_0x569a('0x44')]=_[_0x569a('0x45')](_0xb30b75)['join'](',');return db[_0x569a('0x46')][_0x569a('0x47')](function(_0x4e151a){return db[_0x569a('0x48')][_0x569a('0x49')](_0x5e9a98,{'raw':!![],'transaction':_0x4e151a})[_0x569a('0x27')](function(_0x4dbc36){var _0x5d09f9={'sender':_0x5e9a98[_0x569a('0x3f')],'description':_0x5e9a98[_0x569a('0x41')],'content':_0x5e9a98['body'],'beep':_0x5e9a98[_0x569a('0x43')]};_0xb30b75['forEach'](function(_0xdf00da){_0x5d09f9[_0x569a('0x4a')]=_0xdf00da;socket[_0x569a('0x4b')](_0x569a('0x4c'),_0x5d09f9);});return _0x4dbc36;});});})[_0x569a('0x27')](respondWithResult(_0x13e640,0xc9))[_0x569a('0x4d')](handleError(_0x13e640,null));};function getContent(_0x578dcb){return new BPromise(function(_0x3515fc,_0x4a49be){if(_0x578dcb['text']){_0x3515fc(_0x578dcb[_0x569a('0x4e')]);return;}return db['Template']['findOne']({'attributes':[_0x569a('0x4f')],'where':{'id':_0x578dcb['TemplateId']},'raw':!![]})[_0x569a('0x27')](function(_0x43afea){if(!_0x43afea)throw new db[(_0x569a('0x30'))][(_0x569a('0x31'))](_0x569a('0x50'));var _0xb4d132=Mustache[_0x569a('0x51')](_0x43afea[_0x569a('0x4f')],_0x578dcb['view']);_0x3515fc(_0xb4d132);})[_0x569a('0x4d')](function(_0x180b0c){_0x4a49be(_0x180b0c);});});}function getRecipients(_0x137176){return new BPromise(function(_0x2f7db4,_0x47cc75){var _0x2239cc=[];var _0x2e5831=[];_0x137176[_0x569a('0x52')](function(_0x227342){var _0x2ac5c2=_['startCase'](_0x227342[_0x569a('0x3e')]['toLowerCase']());if(_0x2ac5c2===_0x569a('0x53')){_0x2239cc=_[_0x569a('0x54')](_0x2239cc,_0x227342['ids']);}else{if(_[_0x569a('0x3d')](_0x2ac5c2,_0x569a('0x55')))_0x2ac5c2=_0x2ac5c2[_0x569a('0x56')]('queue',_0x569a('0x57'));_0x227342[_0x569a('0x58')]['forEach'](function(_0x1cfb54){_0x2e5831[_0x569a('0x59')](getAgents(_0x2ac5c2,_0x1cfb54));});}});return BPromise[_0x569a('0x5a')](_0x2e5831)['then'](function(_0x351a52){_0x2239cc=_['union'](_0x2239cc,_[_0x569a('0x5b')](_0x351a52));_0x2f7db4(_0x2239cc);})['catch'](function(_0x4abcf5){_0x47cc75(_0x4abcf5);});});}function getAgents(_0x7a1277,_0x507a2f){return new BPromise(function(_0x1ba39d,_0x7cab7d){return db[_0x7a1277]['findOne']({'where':{'id':_0x507a2f}})[_0x569a('0x27')](function(_0x566b88){return _0x566b88[_0x569a('0x5c')]({'attributes':['id'],'raw':!![]})[_0x569a('0x27')](function(_0x466975){var _0x2616c5=_[_0x569a('0x5d')](_0x466975,'id');_0x1ba39d(_0x2616c5);});})[_0x569a('0x4d')](function(_0x3fd35d){_0x7cab7d(_0x3fd35d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index dc890b6..afa1af5 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 _0x5234=['save','update','remove','emit','hook','events','UserNotification','setMaxListeners'];(function(_0xdb7db4,_0x11a7e5){var _0x26a4c3=function(_0x43ed97){while(--_0x43ed97){_0xdb7db4['push'](_0xdb7db4['shift']());}};_0x26a4c3(++_0x11a7e5);}(_0x5234,0x85));var _0x4523=function(_0x1840c1,_0x4d8bbf){_0x1840c1=_0x1840c1-0x0;var _0x41cf30=_0x5234[_0x1840c1];return _0x41cf30;};'use strict';var EventEmitter=require(_0x4523('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x4523('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4523('0x2')](0x0);var events={'afterCreate':_0x4523('0x3'),'afterUpdate':_0x4523('0x4'),'afterDestroy':_0x4523('0x5')};function emitEvent(_0xa40a4){return function(_0xe0b79e,_0x251b9e,_0x29fa7f){UserNotificationEvents['emit'](_0xa40a4+':'+_0xe0b79e['id'],_0xe0b79e);UserNotificationEvents[_0x4523('0x6')](_0xa40a4,_0xe0b79e);_0x29fa7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x4523('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x0d4b=['update','emit','hook','events','UserNotification','setMaxListeners'];(function(_0x5ad0c6,_0x56ee17){var _0x167958=function(_0x32dd81){while(--_0x32dd81){_0x5ad0c6['push'](_0x5ad0c6['shift']());}};_0x167958(++_0x56ee17);}(_0x0d4b,0xf9));var _0xb0d4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0d4b[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0xb0d4('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xb0d4('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb0d4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0d4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2c69c1){return function(_0x527d07,_0x3704a0,_0x12c158){UserNotificationEvents[_0xb0d4('0x4')](_0x2c69c1+':'+_0x527d07['id'],_0x527d07);UserNotificationEvents[_0xb0d4('0x4')](_0x2c69c1,_0x527d07);_0x12c158(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xb0d4('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 1d9c717..e105590 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 _0x9272=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2ff28a,_0x4222d5){var _0x57f43c=function(_0x1f1db6){while(--_0x1f1db6){_0x2ff28a['push'](_0x2ff28a['shift']());}};_0x57f43c(++_0x4222d5);}(_0x9272,0x153));var _0x2927=function(_0x5b3ded,_0x31eac6){_0x5b3ded=_0x5b3ded-0x0;var _0x443b=_0x9272[_0x5b3ded];return _0x443b;};'use strict';var _=require(_0x2927('0x0'));var util=require(_0x2927('0x1'));var logger=require(_0x2927('0x2'))('api');var moment=require(_0x2927('0x3'));var BPromise=require(_0x2927('0x4'));var rp=require(_0x2927('0x5'));var fs=require('fs');var path=require(_0x2927('0x6'));var rimraf=require(_0x2927('0x7'));var config=require(_0x2927('0x8'));var attributes=require('./userNotification.attributes');module[_0x2927('0x9')]=function(_0x4ac7a0,_0xa77a41){return _0x4ac7a0[_0x2927('0xa')]('UserNotification',attributes,{'tableName':_0x2927('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2927('0xc'),'collate':_0x2927('0xd')});}; \ No newline at end of file +var _0x1e5e=['define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports'];(function(_0x15c113,_0x444fc9){var _0x4f81d6=function(_0x235e24){while(--_0x235e24){_0x15c113['push'](_0x15c113['shift']());}};_0x4f81d6(++_0x444fc9);}(_0x1e5e,0x88));var _0xe1e5=function(_0xbbc0bb,_0x1ec934){_0xbbc0bb=_0xbbc0bb-0x0;var _0x47534d=_0x1e5e[_0xbbc0bb];return _0x47534d;};'use strict';var _=require(_0xe1e5('0x0'));var util=require(_0xe1e5('0x1'));var logger=require(_0xe1e5('0x2'))(_0xe1e5('0x3'));var moment=require(_0xe1e5('0x4'));var BPromise=require(_0xe1e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1e5('0x6'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0xe1e5('0x7')]=function(_0x54c601,_0x3eb1d2){return _0x54c601[_0xe1e5('0x8')](_0xe1e5('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe1e5('0xa'),'collate':_0xe1e5('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d1b5444..6a521f4 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 _0x4103=['stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x346fc2,_0x3d2ec1){var _0xd6ca61=function(_0x4087b3){while(--_0x4087b3){_0x346fc2['push'](_0x346fc2['shift']());}};_0xd6ca61(++_0x3d2ec1);}(_0x4103,0x1c1));var _0x3410=function(_0x2f3e84,_0x3633fe){_0x2f3e84=_0x2f3e84-0x0;var _0x59ba6d=_0x4103[_0x2f3e84];return _0x59ba6d;};'use strict';var _=require(_0x3410('0x0'));var util=require(_0x3410('0x1'));var moment=require('moment');var BPromise=require(_0x3410('0x2'));var rs=require(_0x3410('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3410('0x4'))['db'];var utils=require(_0x3410('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3410('0x6'));var client=jayson[_0x3410('0x7')][_0x3410('0x8')]({'port':0x232a});config[_0x3410('0x9')]=_[_0x3410('0xa')](config[_0x3410('0x9')],{'host':_0x3410('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3410('0x9')]));require(_0x3410('0xc'))['register'](socket);function respondWithRpcPromise(_0x28920d,_0x461bdb,_0x23e0a9){return new BPromise(function(_0x4b60bd,_0x39fba3){return client[_0x3410('0xd')](_0x28920d,_0x23e0a9)[_0x3410('0xe')](function(_0x153aaa){logger['info'](_0x3410('0xf'),_0x461bdb,_0x3410('0x10'));logger[_0x3410('0x11')](_0x3410('0x12'),_0x461bdb,_0x3410('0x10'),JSON[_0x3410('0x13')](_0x153aaa));if(_0x153aaa[_0x3410('0x14')]){if(_0x153aaa[_0x3410('0x14')][_0x3410('0x15')]===0x1f4){logger[_0x3410('0x14')](_0x3410('0xf'),_0x461bdb,_0x153aaa[_0x3410('0x14')][_0x3410('0x16')]);return _0x39fba3(_0x153aaa['error'][_0x3410('0x16')]);}logger[_0x3410('0x14')](_0x3410('0xf'),_0x461bdb,_0x153aaa[_0x3410('0x14')][_0x3410('0x16')]);return _0x4b60bd(_0x153aaa[_0x3410('0x14')][_0x3410('0x16')]);}else{logger[_0x3410('0x17')](_0x3410('0xf'),_0x461bdb,_0x3410('0x10'));_0x4b60bd(_0x153aaa[_0x3410('0x18')][_0x3410('0x16')]);}})[_0x3410('0x19')](function(_0x14c598){logger[_0x3410('0x14')](_0x3410('0xf'),_0x461bdb,_0x14c598);_0x39fba3(_0x14c598);});});} \ No newline at end of file +var _0x0485=['UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0485,0x1ad));var _0x5048=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x0485[_0x33c603];return _0xae96f4;};'use strict';var _=require(_0x5048('0x0'));var util=require(_0x5048('0x1'));var moment=require(_0x5048('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5048('0x3'));var db=require(_0x5048('0x4'))['db'];var utils=require(_0x5048('0x5'));var logger=require(_0x5048('0x6'))('rpc');var config=require(_0x5048('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5048('0x8')]({'port':0x232a});config[_0x5048('0x9')]=_[_0x5048('0xa')](config[_0x5048('0x9')],{'host':_0x5048('0xb'),'port':0x18eb});var socket=require(_0x5048('0xc'))(new Redis(config[_0x5048('0x9')]));require(_0x5048('0xd'))['register'](socket);function respondWithRpcPromise(_0x280983,_0x4e008d,_0x9803d9){return new BPromise(function(_0x1f2840,_0x585402){return client['request'](_0x280983,_0x9803d9)[_0x5048('0xe')](function(_0xb4a09b){logger[_0x5048('0xf')]('UserNotification,\x20%s,\x20%s',_0x4e008d,_0x5048('0x10'));logger['debug'](_0x5048('0x11'),_0x4e008d,_0x5048('0x10'),JSON[_0x5048('0x12')](_0xb4a09b));if(_0xb4a09b['error']){if(_0xb4a09b[_0x5048('0x13')][_0x5048('0x14')]===0x1f4){logger[_0x5048('0x13')](_0x5048('0x15'),_0x4e008d,_0xb4a09b[_0x5048('0x13')][_0x5048('0x16')]);return _0x585402(_0xb4a09b[_0x5048('0x13')][_0x5048('0x16')]);}logger[_0x5048('0x13')](_0x5048('0x15'),_0x4e008d,_0xb4a09b['error'][_0x5048('0x16')]);return _0x1f2840(_0xb4a09b[_0x5048('0x13')][_0x5048('0x16')]);}else{logger[_0x5048('0xf')](_0x5048('0x15'),_0x4e008d,_0x5048('0x10'));_0x1f2840(_0xb4a09b[_0x5048('0x17')]['message']);}})[_0x5048('0x18')](function(_0x4d01a9){logger['error'](_0x5048('0x15'),_0x4e008d,_0x4d01a9);_0x585402(_0x4d01a9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a50c1c9..1182065 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 _0xe90e=['update','emit','removeListener','length','userNotification:','remove'];(function(_0x357132,_0x352cf8){var _0x4dcbb6=function(_0x35982a){while(--_0x35982a){_0x357132['push'](_0x357132['shift']());}};_0x4dcbb6(++_0x352cf8);}(_0xe90e,0x11f));var _0xee90=function(_0x2aa0b0,_0x389e5a){_0x2aa0b0=_0x2aa0b0-0x0;var _0x5e63cf=_0xe90e[_0x2aa0b0];return _0x5e63cf;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0xee90('0x0'),_0xee90('0x1')];function createListener(_0x3293cb,_0x2c8f26){return function(_0x5da4b4){_0x2c8f26[_0xee90('0x2')](_0x3293cb,_0x5da4b4);};}function removeListener(_0x29cdb0,_0xfc4363){return function(){UserNotificationEvents[_0xee90('0x3')](_0x29cdb0,_0xfc4363);};}exports['register']=function(_0x3df862){for(var _0x31471e=0x0,_0x4db766=events[_0xee90('0x4')];_0x31471e<_0x4db766;_0x31471e++){var _0x34a994=events[_0x31471e];var _0x5e16eb=createListener(_0xee90('0x5')+_0x34a994,_0x3df862);UserNotificationEvents['on'](_0x34a994,_0x5e16eb);}}; \ No newline at end of file +var _0xecbe=['length','userNotification:','./userNotification.events','save','update','removeListener','register'];(function(_0x35e5aa,_0x4fed87){var _0x2f791b=function(_0x5a2935){while(--_0x5a2935){_0x35e5aa['push'](_0x35e5aa['shift']());}};_0x2f791b(++_0x4fed87);}(_0xecbe,0xd4));var _0xeecb=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xecbe[_0x55d829];return _0x52163b;};'use strict';var UserNotificationEvents=require(_0xeecb('0x0'));var events=[_0xeecb('0x1'),'remove',_0xeecb('0x2')];function createListener(_0xc358c3,_0x3daccd){return function(_0x4f901a){_0x3daccd['emit'](_0xc358c3,_0x4f901a);};}function removeListener(_0x1c1459,_0x1b52be){return function(){UserNotificationEvents[_0xeecb('0x3')](_0x1c1459,_0x1b52be);};}exports[_0xeecb('0x4')]=function(_0xf11b39){for(var _0x2be844=0x0,_0x32c0fb=events[_0xeecb('0x5')];_0x2be844<_0x32c0fb;_0x2be844++){var _0x29d06a=events[_0x2be844];var _0x38132f=createListener(_0xeecb('0x6')+_0x29d06a,_0xf11b39);UserNotificationEvents['on'](_0x29d06a,_0x38132f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 754c467..0647531 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(_0x208cb4,_0x89464c){var _0x21419b=function(_0x19000a){while(--_0x19000a){_0x208cb4['push'](_0x208cb4['shift']());}};_0x21419b(++_0x89464c);}(_0x70e0,0x17b));var _0x070e=function(_0x2c3a41,_0x5d30d4){_0x2c3a41=_0x2c3a41-0x0;var _0x214e93=_0x70e0[_0x2c3a41];return _0x214e93;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5f1e1c,_0x329fc6){var _0x5981f5=function(_0x2f1db5){while(--_0x2f1db5){_0x5f1e1c['push'](_0x5f1e1c['shift']());}};_0x5981f5(++_0x329fc6);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index cf8fbd5..f2b2559 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 _0xaa47=['INTEGER','sequelize'];(function(_0x48d6c2,_0x1ce5d2){var _0x39eeb1=function(_0xa992a7){while(--_0xa992a7){_0x48d6c2['push'](_0x48d6c2['shift']());}};_0x39eeb1(++_0x1ce5d2);}(_0xaa47,0x127));var _0x7aa4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaa47[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x7aa4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7aa4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8907=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8907,0x180));var _0x7890=function(_0x4ee12,_0x1a9bf7){_0x4ee12=_0x4ee12-0x0;var _0x178167=_0x8907[_0x4ee12];return _0x178167;};'use strict';var Sequelize=require('sequelize');module[_0x7890('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 06910da..09f5add 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 _0xd591=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0x12e161,_0x4feade){var _0xa925dc=function(_0x1735d9){while(--_0x1735d9){_0x12e161['push'](_0x12e161['shift']());}};_0xa925dc(++_0x4feade);}(_0xd591,0xda));var _0x1d59=function(_0x27565a,_0x3f7805){_0x27565a=_0x27565a-0x0;var _0x3cf118=_0xd591[_0x27565a];return _0x3cf118;};'use strict';var _=require(_0x1d59('0x0'));var util=require(_0x1d59('0x1'));var logger=require(_0x1d59('0x2'))(_0x1d59('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d59('0x4'));var fs=require('fs');var path=require(_0x1d59('0x5'));var rimraf=require(_0x1d59('0x6'));var config=require(_0x1d59('0x7'));var attributes=require(_0x1d59('0x8'));module['exports']=function(_0xf42de3,_0x32802e){return _0xf42de3[_0x1d59('0x9')](_0x1d59('0xa'),attributes,{'tableName':_0x1d59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b92=['define','util','../../config/logger','api','moment','request-promise','rimraf','./userOpenchannelQueue.attributes','exports'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x2b92,0x106));var _0x22b9=function(_0x478473,_0x4dc1bd){_0x478473=_0x478473-0x0;var _0x55a47=_0x2b92[_0x478473];return _0x55a47;};'use strict';var _=require('lodash');var util=require(_0x22b9('0x0'));var logger=require(_0x22b9('0x1'))(_0x22b9('0x2'));var moment=require(_0x22b9('0x3'));var BPromise=require('bluebird');var rp=require(_0x22b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22b9('0x5'));var config=require('../../config/environment');var attributes=require(_0x22b9('0x6'));module[_0x22b9('0x7')]=function(_0x5947f3,_0x3da0b7){return _0x5947f3[_0x22b9('0x8')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index aca738e..7802d39 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 _0x8276=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserOpenchannelQueue,\x20%s,\x20%s','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x8276,0xa7));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6827('0x0'));var util=require(_0x6827('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6827('0x2'));var fs=require('fs');var Redis=require(_0x6827('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6827('0x4'));var logger=require(_0x6827('0x5'))('rpc');var config=require(_0x6827('0x6'));var jayson=require(_0x6827('0x7'));var client=jayson[_0x6827('0x8')][_0x6827('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x461c14,_0x38c2e7,_0x17ac1b){return new BPromise(function(_0x2d8f3f,_0x21cdf0){return client['request'](_0x461c14,_0x17ac1b)[_0x6827('0xa')](function(_0x352cd5){logger[_0x6827('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x38c2e7,_0x6827('0xc'));logger[_0x6827('0xd')](_0x6827('0xe'),_0x38c2e7,'request\x20sent',JSON[_0x6827('0xf')](_0x352cd5));if(_0x352cd5[_0x6827('0x10')]){if(_0x352cd5[_0x6827('0x10')]['code']===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x38c2e7,_0x352cd5[_0x6827('0x10')][_0x6827('0x11')]);return _0x21cdf0(_0x352cd5[_0x6827('0x10')]['message']);}logger[_0x6827('0x10')](_0x6827('0x12'),_0x38c2e7,_0x352cd5['error']['message']);return _0x2d8f3f(_0x352cd5[_0x6827('0x10')][_0x6827('0x11')]);}else{logger[_0x6827('0xb')](_0x6827('0x12'),_0x38c2e7,_0x6827('0xc'));_0x2d8f3f(_0x352cd5['result']['message']);}})[_0x6827('0x13')](function(_0x447ede){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x38c2e7,_0x447ede);_0x21cdf0(_0x447ede);});});} \ No newline at end of file +var _0xa746=['info','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','message','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa746,0x145));var _0x6a74=function(_0x4e2804,_0x18056b){_0x4e2804=_0x4e2804-0x0;var _0x2aa5a1=_0xa746[_0x4e2804];return _0x2aa5a1;};'use strict';var _=require(_0x6a74('0x0'));var util=require(_0x6a74('0x1'));var moment=require(_0x6a74('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a74('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a74('0x4'));var logger=require(_0x6a74('0x5'))(_0x6a74('0x6'));var config=require(_0x6a74('0x7'));var jayson=require(_0x6a74('0x8'));var client=jayson[_0x6a74('0x9')][_0x6a74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28467,_0x357bfe,_0x9c5f0a){return new BPromise(function(_0x2a4131,_0x578171){return client[_0x6a74('0xb')](_0x28467,_0x9c5f0a)[_0x6a74('0xc')](function(_0x319db4){logger['info'](_0x6a74('0xd'),_0x357bfe,'request\x20sent');logger[_0x6a74('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x357bfe,_0x6a74('0xf'),JSON[_0x6a74('0x10')](_0x319db4));if(_0x319db4['error']){if(_0x319db4['error'][_0x6a74('0x11')]===0x1f4){logger['error'](_0x6a74('0xd'),_0x357bfe,_0x319db4['error'][_0x6a74('0x12')]);return _0x578171(_0x319db4[_0x6a74('0x13')][_0x6a74('0x12')]);}logger[_0x6a74('0x13')](_0x6a74('0xd'),_0x357bfe,_0x319db4['error'][_0x6a74('0x12')]);return _0x2a4131(_0x319db4[_0x6a74('0x13')]['message']);}else{logger[_0x6a74('0x14')](_0x6a74('0xd'),_0x357bfe,_0x6a74('0xf'));_0x2a4131(_0x319db4[_0x6a74('0x15')]['message']);}})[_0x6a74('0x16')](function(_0x29640e){logger[_0x6a74('0x13')](_0x6a74('0xd'),_0x357bfe,_0x29640e);_0x578171(_0x29640e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 1837366..1892797 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 _0x139a=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','removeSections','removeResources','exports','multer'];(function(_0x36e8e4,_0x213a61){var _0x491ac7=function(_0x2e9e78){while(--_0x2e9e78){_0x36e8e4['push'](_0x36e8e4['shift']());}};_0x491ac7(++_0x213a61);}(_0x139a,0xfb));var _0xa139=function(_0x4c66a7,_0x17b959){_0x4c66a7=_0x4c66a7-0x0;var _0x17270c=_0x139a[_0x4c66a7];return _0x17270c;};'use strict';var multer=require(_0xa139('0x0'));var util=require('util');var path=require(_0xa139('0x1'));var timeout=require(_0xa139('0x2'));var express=require(_0xa139('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa139('0x4'));var interaction=require(_0xa139('0x5'));var config=require('../../config/environment');var controller=require(_0xa139('0x6'));router[_0xa139('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa139('0x8'),auth[_0xa139('0x9')](),controller[_0xa139('0xa')]);router[_0xa139('0x7')](_0xa139('0xb'),auth[_0xa139('0x9')](),controller[_0xa139('0xc')]);router[_0xa139('0x7')](_0xa139('0xd'),auth[_0xa139('0x9')](),controller['getSections']);router['get']('/:id/resources',auth[_0xa139('0x9')](),controller[_0xa139('0xe')]);router[_0xa139('0xf')]('/',auth['isAuthenticated'](),controller[_0xa139('0x10')]);router[_0xa139('0xf')](_0xa139('0x11'),auth[_0xa139('0x9')](),controller[_0xa139('0x12')]);router[_0xa139('0xf')]('/:id/sections',auth[_0xa139('0x9')](),controller[_0xa139('0x13')]);router['post'](_0xa139('0x14'),auth[_0xa139('0x9')](),controller[_0xa139('0x15')]);router[_0xa139('0x16')](_0xa139('0xb'),auth[_0xa139('0x9')](),controller[_0xa139('0x17')]);router[_0xa139('0x18')](_0xa139('0xb'),auth[_0xa139('0x9')](),controller['destroy']);router[_0xa139('0x18')](_0xa139('0xd'),auth['isAuthenticated'](),controller[_0xa139('0x19')]);router[_0xa139('0x18')]('/:id/resources',auth['isAuthenticated'](),controller[_0xa139('0x1a')]);module[_0xa139('0x1b')]=router; \ No newline at end of file +var _0x376c=['removeSections','/:id/resources','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','getResources','post','create','/:id/clone','clone','addResources','update','delete','destroy','/:id/sections'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x376c,0xc0));var _0xc376=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x376c[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xc376('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc376('0x1'));var express=require(_0xc376('0x2'));var router=express['Router']();var fs_extra=require(_0xc376('0x3'));var auth=require(_0xc376('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc376('0x5'));router[_0xc376('0x6')]('/',auth[_0xc376('0x7')](),controller[_0xc376('0x8')]);router[_0xc376('0x6')](_0xc376('0x9'),auth[_0xc376('0x7')](),controller[_0xc376('0xa')]);router[_0xc376('0x6')](_0xc376('0xb'),auth[_0xc376('0x7')](),controller[_0xc376('0xc')]);router[_0xc376('0x6')]('/:id/sections',auth[_0xc376('0x7')](),controller[_0xc376('0xd')]);router['get']('/:id/resources',auth[_0xc376('0x7')](),controller[_0xc376('0xe')]);router[_0xc376('0xf')]('/',auth[_0xc376('0x7')](),controller[_0xc376('0x10')]);router[_0xc376('0xf')](_0xc376('0x11'),auth['isAuthenticated'](),controller[_0xc376('0x12')]);router['post']('/:id/sections',auth[_0xc376('0x7')](),controller['addSections']);router[_0xc376('0xf')]('/:id/resources',auth[_0xc376('0x7')](),controller[_0xc376('0x13')]);router['put']('/:id',auth[_0xc376('0x7')](),controller[_0xc376('0x14')]);router[_0xc376('0x15')](_0xc376('0xb'),auth[_0xc376('0x7')](),controller[_0xc376('0x16')]);router[_0xc376('0x15')](_0xc376('0x17'),auth[_0xc376('0x7')](),controller[_0xc376('0x18')]);router[_0xc376('0x15')](_0xc376('0x19'),auth[_0xc376('0x7')](),controller['removeResources']);module[_0xc376('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 6cbcc93..70e4e88 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 _0x54b7=['BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x179c13,_0x15e4c5){var _0x1ee81c=function(_0x172124){while(--_0x172124){_0x179c13['push'](_0x179c13['shift']());}};_0x1ee81c(++_0x15e4c5);}(_0x54b7,0xbe));var _0x754b=function(_0x2ef9cc,_0x321b9c){_0x2ef9cc=_0x2ef9cc-0x0;var _0x4386df=_0x54b7[_0x2ef9cc];return _0x4386df;};'use strict';var Sequelize=require('sequelize');module[_0x754b('0x0')]={'name':{'type':Sequelize[_0x754b('0x1')],'allowNull':![],'unique':_0x754b('0x2')},'crudPermissions':{'type':Sequelize[_0x754b('0x1')],'set':function(_0x32e5de){this[_0x754b('0x3')](_0x754b('0x4'),_0x32e5de?_0x32e5de[_0x754b('0x5')](''):[]);},'get':function(){return this[_0x754b('0x6')](_0x754b('0x4'))?this[_0x754b('0x6')](_0x754b('0x4'))[_0x754b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x754b('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x754b('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x754b('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x754b('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x754b('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x754b('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd25=['name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','STRING'];(function(_0x3622f5,_0x89137c){var _0x1204d4=function(_0x29cc77){while(--_0x29cc77){_0x3622f5['push'](_0x3622f5['shift']());}};_0x1204d4(++_0x89137c);}(_0xfd25,0x1e9));var _0x5fd2=function(_0x464f01,_0x44de3d){_0x464f01=_0x464f01-0x0;var _0x317a23=_0xfd25[_0x464f01];return _0x317a23;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5fd2('0x0')],'allowNull':![],'unique':_0x5fd2('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x331e86){this[_0x5fd2('0x2')](_0x5fd2('0x3'),_0x331e86?_0x331e86[_0x5fd2('0x4')](''):[]);},'get':function(){return this[_0x5fd2('0x5')]('crudPermissions')?this[_0x5fd2('0x5')](_0x5fd2('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x5fd2('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5fd2('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b7849c6..de33eb6 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 _0xb91a=['getSections','filter','sectionId','isEmpty','subsections','includes','enabled','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','localhost','./userProfile.socket','register','status','undefined','limit','count','offset','set','apply','save','then','destroy','sendStatus','name','send','index','UserProfile','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','find','body','get','omit','createdAt','updatedAt','crudPermissions','transaction','create','each','autoAssociation','userProfileId','Resources','UserProfileSection','UserProfileResource','update','describe','push','removeSections','ids'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb91a,0xe5));var _0xab91=function(_0x201140,_0x4c20a1){_0x201140=_0x201140-0x0;var _0x4f8990=_0xb91a[_0x201140];return _0x4f8990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab91('0x0'));var zipdir=require(_0xab91('0x1'));var jsonpatch=require(_0xab91('0x2'));var rp=require(_0xab91('0x3'));var moment=require('moment');var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require('util');var path=require(_0xab91('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab91('0x7'));var fs=require('fs');var fs_extra=require(_0xab91('0x8'));var _=require('lodash');var squel=require(_0xab91('0x9'));var crypto=require(_0xab91('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xab91('0xb'));var toCsv=require(_0xab91('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab91('0xd'));var qs=require(_0xab91('0xe'));var as=require(_0xab91('0xf'));var hardwareService=require(_0xab91('0x10'));var logger=require('../../config/logger')(_0xab91('0x11'));var utils=require(_0xab91('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xab91('0x13'));var db=require('../../mysqldb')['db'];config[_0xab91('0x14')]=_['defaults'](config['redis'],{'host':_0xab91('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab91('0x14')]));require(_0xab91('0x16'))[_0xab91('0x17')](socket);function respondWithStatusCode(_0x29fadc,_0x293193){_0x293193=_0x293193||0xcc;return function(_0x441121){if(_0x441121){return _0x29fadc['sendStatus'](_0x293193);}return _0x29fadc[_0xab91('0x18')](_0x293193)['end']();};}function respondWithResult(_0x23c3d8,_0xbf0ed8){_0xbf0ed8=_0xbf0ed8||0xc8;return function(_0x312a4e){if(_0x312a4e){return _0x23c3d8[_0xab91('0x18')](_0xbf0ed8)['json'](_0x312a4e);}};}function respondWithFilteredResult(_0x434dcd,_0xa63f1d){return function(_0x1ece47){if(_0x1ece47){var _0x5835e1=typeof _0xa63f1d['offset']===_0xab91('0x19')&&typeof _0xa63f1d[_0xab91('0x1a')]===_0xab91('0x19');var _0x1f9fa9=_0x1ece47[_0xab91('0x1b')];var _0x62aa5f=_0x5835e1?0x0:_0xa63f1d[_0xab91('0x1c')];var _0x26627c=_0x5835e1?_0x1ece47[_0xab91('0x1b')]:_0xa63f1d[_0xab91('0x1c')]+_0xa63f1d['limit'];var _0x25f2d3;if(_0x26627c>=_0x1f9fa9){_0x26627c=_0x1f9fa9;_0x25f2d3=0xc8;}else{_0x25f2d3=0xce;}_0x434dcd[_0xab91('0x18')](_0x25f2d3);return _0x434dcd[_0xab91('0x1d')]('Content-Range',_0x62aa5f+'-'+_0x26627c+'/'+_0x1f9fa9)['json'](_0x1ece47);}return null;};}function patchUpdates(_0xad9571){return function(_0x87358a){try{jsonpatch[_0xab91('0x1e')](_0x87358a,_0xad9571,!![]);}catch(_0x5995de){return BPromise['reject'](_0x5995de);}return _0x87358a[_0xab91('0x1f')]();};}function saveUpdates(_0x5b0c6a,_0x17967a){return function(_0x49d225){if(_0x49d225){return _0x49d225['update'](_0x5b0c6a)[_0xab91('0x20')](function(_0x43f334){return _0x43f334;});}return null;};}function removeEntity(_0x1a57e2,_0x2a1e5e){return function(_0x239542){if(_0x239542){return _0x239542[_0xab91('0x21')]()[_0xab91('0x20')](function(){_0x1a57e2[_0xab91('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d822d,_0x364b84){return function(_0x1a3f68){if(!_0x1a3f68){_0x3d822d[_0xab91('0x22')](0x194);}return _0x1a3f68;};}function handleError(_0x4e8f14,_0x1b68e6){_0x1b68e6=_0x1b68e6||0x1f4;return function(_0x284270){logger['error'](_0x284270['stack']);if(_0x284270[_0xab91('0x23')]){delete _0x284270[_0xab91('0x23')];}_0x4e8f14[_0xab91('0x18')](_0x1b68e6)[_0xab91('0x24')](_0x284270);};}exports[_0xab91('0x25')]=function(_0x475f97,_0x11cdd8){var _0x2e022d={},_0x19c9a5={},_0x1e4b6f={'count':0x0,'rows':[]};var _0x6852ca=_['map'](db[_0xab91('0x26')][_0xab91('0x27')],function(_0x548013){return{'name':_0x548013[_0xab91('0x28')],'type':_0x548013[_0xab91('0x29')][_0xab91('0x2a')]};});_0x19c9a5['model']=_[_0xab91('0x2b')](_0x6852ca,'name');_0x19c9a5[_0xab91('0x2c')]=_[_0xab91('0x2d')](_0x475f97['query']);_0x19c9a5[_0xab91('0x2e')]=_[_0xab91('0x2f')](_0x19c9a5['model'],_0x19c9a5[_0xab91('0x2c')]);_0x2e022d[_0xab91('0x30')]=_[_0xab91('0x2f')](_0x19c9a5['model'],qs[_0xab91('0x31')](_0x475f97[_0xab91('0x2c')]['fields']));_0x2e022d[_0xab91('0x30')]=_0x2e022d[_0xab91('0x30')][_0xab91('0x32')]?_0x2e022d['attributes']:_0x19c9a5['model'];if(!_0x475f97[_0xab91('0x2c')]['hasOwnProperty']('nolimit')){_0x2e022d[_0xab91('0x1a')]=qs[_0xab91('0x1a')](_0x475f97['query'][_0xab91('0x1a')]);_0x2e022d[_0xab91('0x1c')]=qs[_0xab91('0x1c')](_0x475f97[_0xab91('0x2c')][_0xab91('0x1c')]);}_0x2e022d[_0xab91('0x33')]=qs['sort'](_0x475f97[_0xab91('0x2c')][_0xab91('0x34')]);_0x2e022d[_0xab91('0x35')]=qs[_0xab91('0x2e')](_[_0xab91('0x36')](_0x475f97[_0xab91('0x2c')],_0x19c9a5[_0xab91('0x2e')]),_0x6852ca);if(_0x475f97['query']['filter']){_0x2e022d[_0xab91('0x35')]=_[_0xab91('0x37')](_0x2e022d['where'],{'$or':_['map'](_0x6852ca,function(_0x1d6dba){if(_0x1d6dba['type']!==_0xab91('0x38')){var _0x47c956={};_0x47c956[_0x1d6dba[_0xab91('0x23')]]={'$like':'%'+_0x475f97[_0xab91('0x2c')]['filter']+'%'};return _0x47c956;}})});}_0x2e022d=_['merge']({},_0x2e022d,_0x475f97[_0xab91('0x39')]);var _0x43793e={'where':_0x2e022d['where']};return db['UserProfile']['count'](_0x43793e)[_0xab91('0x20')](function(_0x2a2024){_0x1e4b6f[_0xab91('0x1b')]=_0x2a2024;if(_0x475f97['query'][_0xab91('0x3a')]){_0x2e022d[_0xab91('0x3b')]=[{'all':!![]}];}return db[_0xab91('0x26')][_0xab91('0x3c')](_0x2e022d);})[_0xab91('0x20')](function(_0x1a3bdf){_0x1e4b6f[_0xab91('0x3d')]=_0x1a3bdf;return _0x1e4b6f;})[_0xab91('0x20')](respondWithFilteredResult(_0x11cdd8,_0x2e022d))[_0xab91('0x3e')](handleError(_0x11cdd8,null));};exports[_0xab91('0x3f')]=function(_0x573bbf,_0x4f255d){var _0x2025e0={'raw':![],'where':{'id':_0x573bbf[_0xab91('0x40')]['id']}},_0x2033df={};_0x2033df[_0xab91('0x41')]=_[_0xab91('0x2d')](db[_0xab91('0x26')][_0xab91('0x27')]);_0x2033df[_0xab91('0x2c')]=_[_0xab91('0x2d')](_0x573bbf[_0xab91('0x2c')]);_0x2033df[_0xab91('0x2e')]=_[_0xab91('0x2f')](_0x2033df[_0xab91('0x41')],_0x2033df['query']);_0x2025e0[_0xab91('0x30')]=_['intersection'](_0x2033df['model'],qs[_0xab91('0x31')](_0x573bbf['query'][_0xab91('0x31')]));_0x2025e0[_0xab91('0x30')]=_0x2025e0[_0xab91('0x30')][_0xab91('0x32')]?_0x2025e0[_0xab91('0x30')]:_0x2033df[_0xab91('0x41')];if(_0x573bbf['query'][_0xab91('0x3a')]){_0x2025e0[_0xab91('0x3b')]=[{'all':!![]}];}_0x2025e0=_['merge']({},_0x2025e0,_0x573bbf[_0xab91('0x39')]);return db[_0xab91('0x26')][_0xab91('0x42')](_0x2025e0)[_0xab91('0x20')](handleEntityNotFound(_0x4f255d,null))[_0xab91('0x20')](respondWithResult(_0x4f255d,null))[_0xab91('0x3e')](handleError(_0x4f255d,null));};exports['create']=function(_0x5648ad,_0xb02842){return db[_0xab91('0x26')]['create'](_0x5648ad[_0xab91('0x43')],{})['then'](respondWithResult(_0xb02842,0xc9))[_0xab91('0x3e')](handleError(_0xb02842,null));};exports['clone']=function(_0x27c3b3,_0x26d754){var _0x2d2d09={'where':{'id':_0x27c3b3[_0xab91('0x40')]['id']}},_0x40e157={};_0x40e157[_0xab91('0x41')]=_[_0xab91('0x2d')](db[_0xab91('0x26')]['rawAttributes']);_0x2d2d09[_0xab91('0x30')]=_[_0xab91('0x2f')](_0x40e157[_0xab91('0x41')],qs['fields'](_0x27c3b3[_0xab91('0x2c')][_0xab91('0x31')]));_0x2d2d09[_0xab91('0x30')]=_0x2d2d09[_0xab91('0x30')][_0xab91('0x32')]?_0x2d2d09['attributes']:_0x40e157['model'];if(_0x27c3b3[_0xab91('0x2c')][_0xab91('0x3a')]){_0x2d2d09['include']=[{'all':!![]}];}_0x2d2d09=_[_0xab91('0x37')]({},_0x2d2d09,_0x27c3b3[_0xab91('0x39')]);return db[_0xab91('0x26')][_0xab91('0x42')](_0x2d2d09)[_0xab91('0x20')](handleEntityNotFound(_0x26d754,null))[_0xab91('0x20')](function(_0x5e3cd3){if(_0x5e3cd3){var _0x128934=_0x5e3cd3[_0xab91('0x44')]({'plain':!![]});_0x128934=qs[_0xab91('0x45')](_0x128934,['id',_0xab91('0x46'),_0xab91('0x47'),_0xab91('0x48')]);_0x27c3b3[_0xab91('0x43')]=_[_0xab91('0x45')](_0x27c3b3[_0xab91('0x43')],['id',_0xab91('0x46'),'updatedAt']);return db['sequelize'][_0xab91('0x49')](function(_0x3cec33){return db['UserProfile'][_0xab91('0x4a')](_[_0xab91('0x37')](_0x128934,_0x27c3b3['body']),{'include':_0x27c3b3[_0xab91('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3cec33})['then'](function(_0x151b0d){var _0x3fb19c=_0x151b0d['get']({'plain':!![]});return db['UserProfileSection'][_0xab91('0x3c')]({'where':{'userProfileId':_0x27c3b3[_0xab91('0x40')]['id']},'raw':!![]})[_0xab91('0x20')](function(_0x59af1f){if(_0x59af1f){return BPromise[_0xab91('0x4b')](_0x59af1f,function(_0x1be78f){return new BPromise(function(_0x31f90d,_0x1628f8){if(_0x1be78f[_0xab91('0x4c')]===null||_0x1be78f[_0xab91('0x4c')]===0x1)_0x31f90d(null);return db['UserProfileResource'][_0xab91('0x3c')]({'where':{'sectionId':_0x1be78f['id']},'raw':!![]})['then'](function(_0x3c2637){var _0x61d51f=_[_0xab91('0x2b')](_0x3c2637,function(_0xc90d7b){return qs[_0xab91('0x45')](_0xc90d7b,['id',_0xab91('0x46'),_0xab91('0x47'),'sectionId']);});_0x31f90d(_0x61d51f);})[_0xab91('0x3e')](function(_0x547e80){_0x1628f8(_0x547e80);});})[_0xab91('0x20')](function(_0x13f36e){var _0xbebd11=qs['omit'](_0x1be78f,['id','createdAt',_0xab91('0x47')]);_0xbebd11[_0xab91('0x4d')]=_0x3fb19c['id'];if(_0x13f36e)_0xbebd11[_0xab91('0x4e')]=_0x13f36e;return _0xbebd11;})[_0xab91('0x20')](function(_0x587308){return db[_0xab91('0x4f')]['create'](_0x587308,{'include':[{'model':db[_0xab91('0x50')],'as':_0xab91('0x4e')}],'raw':!![],'transaction':_0x3cec33});});})['then'](function(){return _0x3fb19c;});}});});});}})[_0xab91('0x20')](respondWithResult(_0x26d754,0xc9))[_0xab91('0x3e')](handleError(_0x26d754,null));};exports[_0xab91('0x51')]=function(_0x36a80b,_0x39e1ae){if(_0x36a80b[_0xab91('0x43')]['id']){delete _0x36a80b[_0xab91('0x43')]['id'];}return db[_0xab91('0x26')][_0xab91('0x42')]({'where':{'id':_0x36a80b[_0xab91('0x40')]['id']}})[_0xab91('0x20')](handleEntityNotFound(_0x39e1ae,null))['then'](saveUpdates(_0x36a80b[_0xab91('0x43')],null))[_0xab91('0x20')](respondWithResult(_0x39e1ae,null))[_0xab91('0x3e')](handleError(_0x39e1ae,null));};exports[_0xab91('0x21')]=function(_0x5eb7b7,_0x15c88f){return db[_0xab91('0x26')]['find']({'where':{'id':_0x5eb7b7[_0xab91('0x40')]['id']}})[_0xab91('0x20')](handleEntityNotFound(_0x15c88f,null))[_0xab91('0x20')](removeEntity(_0x15c88f,null))['catch'](handleError(_0x15c88f,null));};exports[_0xab91('0x52')]=function(_0x9eab34,_0x22f1a4){return db[_0xab91('0x26')][_0xab91('0x52')]()[_0xab91('0x20')](respondWithResult(_0x22f1a4,null))[_0xab91('0x3e')](handleError(_0x22f1a4,null));};exports['addSections']=function(_0x164bdd,_0x4ed860){var _0x12c23e=_0x164bdd['body'];return db[_0xab91('0x26')]['find']({'where':{'id':_0x164bdd[_0xab91('0x40')]['id']}})[_0xab91('0x20')](handleEntityNotFound(_0x4ed860,null))[_0xab91('0x20')](function(_0x48f469){if(_0x48f469){return db['sequelize'][_0xab91('0x49')](function(_0x29c565){return db[_0xab91('0x4f')][_0xab91('0x21')]({'where':{'userProfileId':_0x164bdd[_0xab91('0x40')]['id'],'sectionId':_[_0xab91('0x2b')](_0x12c23e,function(_0x4f6cd3){return _0x4f6cd3['sectionId'];})},'transaction':_0x29c565})[_0xab91('0x20')](function(){var _0x1a524b=_[_0xab91('0x2b')](_0x12c23e,function(_0x4b3f34){_0x4b3f34[_0xab91('0x4d')]=_0x164bdd[_0xab91('0x40')]['id'];return _0x4b3f34;});var _0x19939a=[];return BPromise[_0xab91('0x4b')](_0x1a524b,function(_0x36eefe){return db[_0xab91('0x4f')]['create'](_0x36eefe,{'include':[{'model':db['UserProfileResource'],'as':_0xab91('0x4e')}],'raw':!![],'transaction':_0x29c565})['then'](function(_0x1342a2){_0x19939a[_0xab91('0x53')](_0x1342a2[_0xab91('0x44')]({'plain':!![]}));});})[_0xab91('0x20')](function(){return _0x19939a;});});});}})['then'](function(_0x59fe78){return _0x59fe78;})['then'](respondWithResult(_0x4ed860,null))[_0xab91('0x3e')](handleError(_0x4ed860,null));};exports[_0xab91('0x54')]=function(_0x1aa9cc,_0x337d9b){var _0x362806;return db['UserProfile'][_0xab91('0x42')]({'where':{'id':_0x1aa9cc[_0xab91('0x40')]['id']},'attributes':['id',_0xab91('0x23')]})[_0xab91('0x20')](handleEntityNotFound(_0x337d9b,null))[_0xab91('0x20')](function(_0x1b54c4){if(_0x1b54c4){_0x362806=_0x1b54c4;return db[_0xab91('0x4f')]['destroy']({'where':{'userProfileId':_0x1aa9cc['params']['id'],'sectionId':_0x1aa9cc[_0xab91('0x2c')][_0xab91('0x55')]}});}})[_0xab91('0x20')](function(){return _0x362806;})['then'](respondWithStatusCode(_0x337d9b,null))[_0xab91('0x3e')](handleError(_0x337d9b,null));};exports[_0xab91('0x56')]=function(_0x19e5e1,_0x253cc1){var _0x3ecd2e=[];var _0x48edc7=[];return db[_0xab91('0x4f')][_0xab91('0x3c')]({'where':{'userProfileId':_0x19e5e1['params']['id']},'raw':!![]})[_0xab91('0x20')](function(_0x1c6004){_0x3ecd2e=_[_0xab91('0x57')](_0x1c6004,function(_0xe697be){return _0xe697be['enabled']===0x1||_['includes']([0x3eb,0x709],_0xe697be[_0xab91('0x58')]);});if(!_[_0xab91('0x59')](_0x3ecd2e)){return _['map'](_0x3ecd2e,function(_0xc9fa4e){return _0xc9fa4e[_0xab91('0x58')];});}else{return;}})['then'](function(_0x1757b8){if(_0x1757b8)_0x48edc7=_0x1757b8;if(_['includes'](_0x48edc7,0x64)){var _0x11760f=_[_0xab91('0x42')](_0x3ecd2e,{'sectionId':0x64});return hasDefaultDashboard(_0x11760f)[_0xab91('0x20')](function(_0x109d61){return _[_0xab91('0x2b')](_0x3ecd2e,function(_0x51d6bd){if(_0x51d6bd[_0xab91('0x58')]===0x64){_0x51d6bd[_0xab91('0x5a')]=_0x109d61;}return _0x51d6bd;});});}else{return;}})[_0xab91('0x20')](function(_0x342984){if(_0x342984)_0x3ecd2e=_0x342984;if(_[_0xab91('0x5b')](_0x48edc7,0x3eb)){var _0x1a1e93=_['find'](_0x3ecd2e,{'sectionId':0x3eb});return getCustomDashboards(_0x1a1e93)[_0xab91('0x20')](function(_0x4aa74c){return _[_0xab91('0x2b')](_0x3ecd2e,function(_0x423b92){if(_0x1a1e93['enabled']){if(_0x423b92['sectionId']===0x3eb){_0x423b92[_0xab91('0x5a')]=_0x4aa74c;}}else{if(_0x423b92[_0xab91('0x58')]===0x64){_0x423b92[_0xab91('0x5a')]=_0x4aa74c;}}return _0x423b92;});});}else{return;}})[_0xab91('0x20')](function(_0x5655ab){if(_0x5655ab)_0x3ecd2e=_0x5655ab;if(_[_0xab91('0x5b')](_0x48edc7,0x709)){var _0x15601b=_[_0xab91('0x42')](_0x3ecd2e,{'sectionId':0x709});return getPlugins(_0x15601b)[_0xab91('0x20')](function(_0x459cb9){if(_0x15601b[_0xab91('0x5c')]){return _[_0xab91('0x2b')](_0x3ecd2e,function(_0x50f27a){if(_0x50f27a[_0xab91('0x58')]===0x709){_0x50f27a['subsections']=_0x459cb9;}return _0x50f27a;});}else{var _0x4dab10={'sectionId':0x76c,'enabled':0x1,'subsections':_0x459cb9};var _0x28efca=_['map'](_0x3ecd2e);_0x28efca[_0xab91('0x53')](_0x4dab10);return _0x28efca;}});}else{return;}})[_0xab91('0x20')](function(_0x5e0061){if(_0x5e0061)_0x3ecd2e=_0x5e0061;return _[_0xab91('0x57')](_0x3ecd2e,[_0xab91('0x5c'),0x1]);})[_0xab91('0x20')](respondWithResult(_0x253cc1,null))[_0xab91('0x3e')](handleError(_0x253cc1,null));};function hasDefaultDashboard(_0x420505){var _0x38f84a=[0x65];return new BPromise(function(_0x134120,_0x1784ed){try{if(_0x420505[_0xab91('0x4c')]){_0x134120(_0x38f84a);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x420505['id']},'raw':!![]})[_0xab91('0x20')](function(_0x129c38){_0x129c38?_0x134120(_0x38f84a):_0x134120();});}}catch(_0x439b8d){_0x1784ed(_0x439b8d);}});}function getCustomDashboards(_0x1a682e){var _0x12d90a=[];return new BPromise(function(_0x3f7f95,_0x4d79e7){try{if(_0x1a682e[_0xab91('0x4c')]){return db[_0xab91('0x5d')][_0xab91('0x3c')]({'raw':!![]})[_0xab91('0x20')](function(_0x5aea94){_0x5aea94[_0xab91('0x5e')](function(_0x594f5c){_0x12d90a['push'](_0x594f5c['id']+0x1869f);});_0x3f7f95(_0x12d90a);});}else{return db[_0xab91('0x50')]['findAll']({'where':{'sectionId':_0x1a682e['id']},'raw':!![]})[_0xab91('0x20')](function(_0x259c0c){_0x259c0c['forEach'](function(_0x252ebb){_0x12d90a[_0xab91('0x53')](_0x252ebb[_0xab91('0x5f')]+0x1869f);});_0x3f7f95(_0x12d90a);});}}catch(_0x333072){_0x4d79e7(_0x333072);}});}function getPlugins(_0x496990){var _0x18dc4b=[];return new BPromise(function(_0x576682,_0x29594e){try{if(_0x496990[_0xab91('0x4c')]){return db[_0xab91('0x60')]['findAll']({'raw':!![]})[_0xab91('0x20')](function(_0x576efe){_0x576efe[_0xab91('0x5e')](function(_0x5c80e0){_0x18dc4b[_0xab91('0x53')](_0x5c80e0['id']+0x15b38);});_0x576682(_0x18dc4b);});}else{return db[_0xab91('0x50')][_0xab91('0x3c')]({'where':{'sectionId':_0x496990['id']},'raw':!![]})['then'](function(_0x390083){_0x390083[_0xab91('0x5e')](function(_0xcba1ef){_0x18dc4b[_0xab91('0x53')](_0xcba1ef[_0xab91('0x5f')]+0x15b38);});_0x576682(_0x18dc4b);});}}catch(_0x339fd6){_0x29594e(_0x339fd6);}});}exports[_0xab91('0x61')]=function(_0x985210,_0x5a2bb2){return db[_0xab91('0x26')][_0xab91('0x42')]({'where':{'id':_0x985210[_0xab91('0x40')]['id']}})[_0xab91('0x20')](handleEntityNotFound(_0x5a2bb2,null))[_0xab91('0x20')](function(_0x120088){if(_0x120088){return db['sequelize'][_0xab91('0x49')](function(_0x4676d0){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x985210[_0xab91('0x40')]['id']},'attributes':['id'],'raw':!![]})[_0xab91('0x20')](function(_0x3167f0){if(_0x3167f0){return db[_0xab91('0x4f')]['destroy']({'where':{'userProfileId':_0x985210[_0xab91('0x40')]['id'],'id':_[_0xab91('0x2b')](_0x3167f0,function(_0x2e0749){return _0x2e0749['id'];})},'transaction':_0x4676d0});}})[_0xab91('0x20')](function(_0x40d63b){var _0x20f30e=_[_0xab91('0x2b')](_0x985210[_0xab91('0x43')],function(_0x2339e1){_0x2339e1[_0xab91('0x4d')]=_0x985210[_0xab91('0x40')]['id'];return _0x2339e1;});return db[_0xab91('0x4f')]['bulkCreate'](_0x20f30e,{'raw':!![],'transaction':_0x4676d0});})[_0xab91('0x20')](function(_0x4b5993){var _0x5bc4f5=_[_0xab91('0x57')](_[_0xab91('0x2b')](_0x4b5993,function(_0x585b00){return _0x585b00['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5bc4f5){return db[_0xab91('0x4f')][_0xab91('0x3c')]({'where':{'userProfileId':_0x985210['params']['id'],'sectionId':_[_0xab91('0x2b')](_0x5bc4f5,function(_0x4ac5bd){return _0x4ac5bd[_0xab91('0x58')];})},'attributes':['id',_0xab91('0x58')],'raw':!![]})[_0xab91('0x20')](function(_0x5a8b1d){var _0x4a0ed6=_['map'](_0x985210[_0xab91('0x43')],function(_0x544ea8){_0x544ea8[_0xab91('0x4d')]=_0x985210[_0xab91('0x40')]['id'];return _0x544ea8;});return db['UserProfileResource']['bulkCreate'](_0x4a0ed6,{'raw':!![],'transaction':_0x4676d0});});}})['catch'](handleError(_0x5a2bb2,null));});}})[_0xab91('0x20')](function(_0x177968){var _0x506e58=_['map'](_0x177968,function(_0x25d7e9){return _0x25d7e9[_0xab91('0x44')]({'plain':!![]});});})[_0xab91('0x20')](respondWithResult(_0x5a2bb2,null))[_0xab91('0x3e')](handleError(_0x5a2bb2,null));};exports[_0xab91('0x62')]=function(_0x2b664e,_0x278971,_0x554db7){return db['UserProfile']['find']({'where':{'id':_0x2b664e[_0xab91('0x40')]['id']}})['then'](handleEntityNotFound(_0x278971,null))['then'](function(_0x51f9d0){if(_0x51f9d0){return _0x51f9d0['removeResources'](_0x2b664e['query'][_0xab91('0x55')]);}})[_0xab91('0x20')](respondWithStatusCode(_0x278971,null))[_0xab91('0x3e')](handleError(_0x278971,null));};exports['getResources']=function(_0x4fc2ad,_0x2b5ea9){var _0x1e3174={};if(!_0x4fc2ad[_0xab91('0x2c')][_0xab91('0x63')])throw new Error(_0xab91('0x64'));if(!_0x4fc2ad[_0xab91('0x2c')][_0xab91('0x65')](_0xab91('0x66'))){_0x1e3174[_0xab91('0x1a')]=qs[_0xab91('0x1a')](_0x4fc2ad[_0xab91('0x2c')][_0xab91('0x1a')]);_0x1e3174[_0xab91('0x1c')]=qs[_0xab91('0x1c')](_0x4fc2ad[_0xab91('0x2c')][_0xab91('0x1c')]);}return db[_0xab91('0x26')]['find']({'where':{'id':_0x4fc2ad['params']['id']}})[_0xab91('0x20')](function(_0x507a4e){if(!_0x507a4e)throw new Error(_0xab91('0x67')+_0x4fc2ad['params']['id']);return db[_0xab91('0x26')][_0xab91('0x68')](_0x4fc2ad);})['then'](respondWithFilteredResult(_0x2b5ea9,_0x1e3174))[_0xab91('0x3e')](handleError(_0x2b5ea9,null));}; \ No newline at end of file +var _0xa9fc=['Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','map','UserProfile','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','find','catch','create','clone','params','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','UserProfileResource','sectionId','userProfileId','Resources','addSections','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','autoAssociation','findOne','forEach','Plugin','resourceId','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x3d7a79,_0x3cebf9){var _0x5ddb1e=function(_0x407dd2){while(--_0x407dd2){_0x3d7a79['push'](_0x3d7a79['shift']());}};_0x5ddb1e(++_0x3cebf9);}(_0xa9fc,0x19f));var _0xca9f=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0xa9fc[_0x3aaf0a];return _0x33e6bc;};'use strict';var emlformat=require(_0xca9f('0x0'));var rimraf=require(_0xca9f('0x1'));var zipdir=require(_0xca9f('0x2'));var jsonpatch=require(_0xca9f('0x3'));var rp=require(_0xca9f('0x4'));var moment=require('moment');var BPromise=require(_0xca9f('0x5'));var Mustache=require('mustache');var util=require(_0xca9f('0x6'));var path=require(_0xca9f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca9f('0x8'));var _=require('lodash');var squel=require(_0xca9f('0x9'));var crypto=require(_0xca9f('0xa'));var jsforce=require(_0xca9f('0xb'));var deskjs=require(_0xca9f('0xc'));var toCsv=require(_0xca9f('0xd'));var querystring=require(_0xca9f('0xe'));var Papa=require(_0xca9f('0xf'));var Redis=require(_0xca9f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xca9f('0x11'));var as=require(_0xca9f('0x12'));var hardwareService=require(_0xca9f('0x13'));var logger=require(_0xca9f('0x14'))('api');var utils=require(_0xca9f('0x15'));var config=require(_0xca9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca9f('0x17'))['db'];config[_0xca9f('0x18')]=_[_0xca9f('0x19')](config[_0xca9f('0x18')],{'host':_0xca9f('0x1a'),'port':0x18eb});var socket=require(_0xca9f('0x1b'))(new Redis(config[_0xca9f('0x18')]));require(_0xca9f('0x1c'))[_0xca9f('0x1d')](socket);function respondWithStatusCode(_0x864d21,_0x593ed9){_0x593ed9=_0x593ed9||0xcc;return function(_0x536d65){if(_0x536d65){return _0x864d21[_0xca9f('0x1e')](_0x593ed9);}return _0x864d21['status'](_0x593ed9)['end']();};}function respondWithResult(_0xda6255,_0x2c4568){_0x2c4568=_0x2c4568||0xc8;return function(_0x55f50e){if(_0x55f50e){return _0xda6255[_0xca9f('0x1f')](_0x2c4568)['json'](_0x55f50e);}};}function respondWithFilteredResult(_0x22cdda,_0x5f515c){return function(_0x22c161){if(_0x22c161){var _0x2b3cfc=typeof _0x5f515c[_0xca9f('0x20')]===_0xca9f('0x21')&&typeof _0x5f515c[_0xca9f('0x22')]==='undefined';var _0x982806=_0x22c161['count'];var _0x14a7c3=_0x2b3cfc?0x0:_0x5f515c[_0xca9f('0x20')];var _0x42fe2f=_0x2b3cfc?_0x22c161[_0xca9f('0x23')]:_0x5f515c[_0xca9f('0x20')]+_0x5f515c['limit'];var _0x7246c7;if(_0x42fe2f>=_0x982806){_0x42fe2f=_0x982806;_0x7246c7=0xc8;}else{_0x7246c7=0xce;}_0x22cdda[_0xca9f('0x1f')](_0x7246c7);return _0x22cdda[_0xca9f('0x24')](_0xca9f('0x25'),_0x14a7c3+'-'+_0x42fe2f+'/'+_0x982806)[_0xca9f('0x26')](_0x22c161);}return null;};}function patchUpdates(_0x4f9e9c){return function(_0x47d86d){try{jsonpatch[_0xca9f('0x27')](_0x47d86d,_0x4f9e9c,!![]);}catch(_0x96b3ec){return BPromise[_0xca9f('0x28')](_0x96b3ec);}return _0x47d86d[_0xca9f('0x29')]();};}function saveUpdates(_0x319b3b,_0x558ecd){return function(_0x40ef71){if(_0x40ef71){return _0x40ef71[_0xca9f('0x2a')](_0x319b3b)[_0xca9f('0x2b')](function(_0x4d64eb){return _0x4d64eb;});}return null;};}function removeEntity(_0x390333,_0x235044){return function(_0x428825){if(_0x428825){return _0x428825[_0xca9f('0x2c')]()[_0xca9f('0x2b')](function(){_0x390333['status'](0xcc)[_0xca9f('0x2d')]();});}};}function handleEntityNotFound(_0x33efe0,_0x4297c8){return function(_0x460ed6){if(!_0x460ed6){_0x33efe0[_0xca9f('0x1e')](0x194);}return _0x460ed6;};}function handleError(_0x5c8aa0,_0x5a390e){_0x5a390e=_0x5a390e||0x1f4;return function(_0x3bcbed){logger['error'](_0x3bcbed[_0xca9f('0x2e')]);if(_0x3bcbed[_0xca9f('0x2f')]){delete _0x3bcbed[_0xca9f('0x2f')];}_0x5c8aa0[_0xca9f('0x1f')](_0x5a390e)['send'](_0x3bcbed);};}exports['index']=function(_0xf153c8,_0x4d903c){var _0x26b33d={},_0x54beae={},_0x2fa5e1={'count':0x0,'rows':[]};var _0xe0e25e=_[_0xca9f('0x30')](db[_0xca9f('0x31')][_0xca9f('0x32')],function(_0x1c9138){return{'name':_0x1c9138['fieldName'],'type':_0x1c9138['type'][_0xca9f('0x33')]};});_0x54beae['model']=_[_0xca9f('0x30')](_0xe0e25e,_0xca9f('0x2f'));_0x54beae[_0xca9f('0x34')]=_['keys'](_0xf153c8['query']);_0x54beae[_0xca9f('0x35')]=_[_0xca9f('0x36')](_0x54beae[_0xca9f('0x37')],_0x54beae['query']);_0x26b33d[_0xca9f('0x38')]=_[_0xca9f('0x36')](_0x54beae['model'],qs['fields'](_0xf153c8[_0xca9f('0x34')][_0xca9f('0x39')]));_0x26b33d[_0xca9f('0x38')]=_0x26b33d[_0xca9f('0x38')][_0xca9f('0x3a')]?_0x26b33d[_0xca9f('0x38')]:_0x54beae[_0xca9f('0x37')];if(!_0xf153c8[_0xca9f('0x34')][_0xca9f('0x3b')](_0xca9f('0x3c'))){_0x26b33d[_0xca9f('0x22')]=qs[_0xca9f('0x22')](_0xf153c8[_0xca9f('0x34')]['limit']);_0x26b33d[_0xca9f('0x20')]=qs['offset'](_0xf153c8[_0xca9f('0x34')][_0xca9f('0x20')]);}_0x26b33d['order']=qs[_0xca9f('0x3d')](_0xf153c8[_0xca9f('0x34')][_0xca9f('0x3d')]);_0x26b33d[_0xca9f('0x3e')]=qs[_0xca9f('0x35')](_['pick'](_0xf153c8['query'],_0x54beae['filters']),_0xe0e25e);if(_0xf153c8[_0xca9f('0x34')][_0xca9f('0x3f')]){_0x26b33d[_0xca9f('0x3e')]=_['merge'](_0x26b33d[_0xca9f('0x3e')],{'$or':_[_0xca9f('0x30')](_0xe0e25e,function(_0x55ad0b){if(_0x55ad0b[_0xca9f('0x40')]!==_0xca9f('0x41')){var _0x4f0e9b={};_0x4f0e9b[_0x55ad0b[_0xca9f('0x2f')]]={'$like':'%'+_0xf153c8[_0xca9f('0x34')][_0xca9f('0x3f')]+'%'};return _0x4f0e9b;}})});}_0x26b33d=_[_0xca9f('0x42')]({},_0x26b33d,_0xf153c8[_0xca9f('0x43')]);var _0x586399={'where':_0x26b33d[_0xca9f('0x3e')]};return db[_0xca9f('0x31')]['count'](_0x586399)[_0xca9f('0x2b')](function(_0x15d8be){_0x2fa5e1[_0xca9f('0x23')]=_0x15d8be;if(_0xf153c8[_0xca9f('0x34')][_0xca9f('0x44')]){_0x26b33d[_0xca9f('0x45')]=[{'all':!![]}];}return db[_0xca9f('0x31')][_0xca9f('0x46')](_0x26b33d);})[_0xca9f('0x2b')](function(_0x409fb0){_0x2fa5e1[_0xca9f('0x47')]=_0x409fb0;return _0x2fa5e1;})[_0xca9f('0x2b')](respondWithFilteredResult(_0x4d903c,_0x26b33d))['catch'](handleError(_0x4d903c,null));};exports[_0xca9f('0x48')]=function(_0x874947,_0x159b43){var _0x2e2bd2={'raw':![],'where':{'id':_0x874947['params']['id']}},_0x39e27d={};_0x39e27d['model']=_[_0xca9f('0x49')](db['UserProfile'][_0xca9f('0x32')]);_0x39e27d[_0xca9f('0x34')]=_[_0xca9f('0x49')](_0x874947[_0xca9f('0x34')]);_0x39e27d[_0xca9f('0x35')]=_[_0xca9f('0x36')](_0x39e27d['model'],_0x39e27d[_0xca9f('0x34')]);_0x2e2bd2[_0xca9f('0x38')]=_['intersection'](_0x39e27d[_0xca9f('0x37')],qs[_0xca9f('0x39')](_0x874947[_0xca9f('0x34')][_0xca9f('0x39')]));_0x2e2bd2['attributes']=_0x2e2bd2[_0xca9f('0x38')]['length']?_0x2e2bd2[_0xca9f('0x38')]:_0x39e27d[_0xca9f('0x37')];if(_0x874947[_0xca9f('0x34')][_0xca9f('0x44')]){_0x2e2bd2['include']=[{'all':!![]}];}_0x2e2bd2=_['merge']({},_0x2e2bd2,_0x874947['options']);return db[_0xca9f('0x31')][_0xca9f('0x4a')](_0x2e2bd2)[_0xca9f('0x2b')](handleEntityNotFound(_0x159b43,null))[_0xca9f('0x2b')](respondWithResult(_0x159b43,null))[_0xca9f('0x4b')](handleError(_0x159b43,null));};exports[_0xca9f('0x4c')]=function(_0x656430,_0x26b9f4){return db[_0xca9f('0x31')][_0xca9f('0x4c')](_0x656430['body'],{})[_0xca9f('0x2b')](respondWithResult(_0x26b9f4,0xc9))['catch'](handleError(_0x26b9f4,null));};exports[_0xca9f('0x4d')]=function(_0x20ee44,_0x4eb702){var _0x875e9f={'where':{'id':_0x20ee44[_0xca9f('0x4e')]['id']}},_0x34fcf1={};_0x34fcf1[_0xca9f('0x37')]=_[_0xca9f('0x49')](db[_0xca9f('0x31')][_0xca9f('0x32')]);_0x875e9f[_0xca9f('0x38')]=_['intersection'](_0x34fcf1['model'],qs[_0xca9f('0x39')](_0x20ee44[_0xca9f('0x34')][_0xca9f('0x39')]));_0x875e9f[_0xca9f('0x38')]=_0x875e9f[_0xca9f('0x38')][_0xca9f('0x3a')]?_0x875e9f['attributes']:_0x34fcf1[_0xca9f('0x37')];if(_0x20ee44[_0xca9f('0x34')][_0xca9f('0x44')]){_0x875e9f['include']=[{'all':!![]}];}_0x875e9f=_[_0xca9f('0x42')]({},_0x875e9f,_0x20ee44[_0xca9f('0x43')]);return db['UserProfile']['find'](_0x875e9f)[_0xca9f('0x2b')](handleEntityNotFound(_0x4eb702,null))[_0xca9f('0x2b')](function(_0x43e543){if(_0x43e543){var _0x468669=_0x43e543[_0xca9f('0x4f')]({'plain':!![]});_0x468669=qs[_0xca9f('0x50')](_0x468669,['id',_0xca9f('0x51'),_0xca9f('0x52'),_0xca9f('0x53')]);_0x20ee44[_0xca9f('0x54')]=_[_0xca9f('0x50')](_0x20ee44[_0xca9f('0x54')],['id',_0xca9f('0x51'),_0xca9f('0x52')]);return db[_0xca9f('0x55')][_0xca9f('0x56')](function(_0x35f4b8){return db[_0xca9f('0x31')]['create'](_[_0xca9f('0x42')](_0x468669,_0x20ee44[_0xca9f('0x54')]),{'include':_0x20ee44['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x35f4b8})[_0xca9f('0x2b')](function(_0x36512d){var _0xca2173=_0x36512d[_0xca9f('0x4f')]({'plain':!![]});return db[_0xca9f('0x57')][_0xca9f('0x46')]({'where':{'userProfileId':_0x20ee44[_0xca9f('0x4e')]['id']},'raw':!![]})[_0xca9f('0x2b')](function(_0xf769a8){if(_0xf769a8){return BPromise[_0xca9f('0x58')](_0xf769a8,function(_0x581879){return new BPromise(function(_0x470f14,_0x5e17ee){if(_0x581879['autoAssociation']===null||_0x581879['autoAssociation']===0x1)_0x470f14(null);return db[_0xca9f('0x59')][_0xca9f('0x46')]({'where':{'sectionId':_0x581879['id']},'raw':!![]})[_0xca9f('0x2b')](function(_0x4d700c){var _0x5f3666=_[_0xca9f('0x30')](_0x4d700c,function(_0x386bd1){return qs['omit'](_0x386bd1,['id','createdAt',_0xca9f('0x52'),_0xca9f('0x5a')]);});_0x470f14(_0x5f3666);})['catch'](function(_0x1ebcb8){_0x5e17ee(_0x1ebcb8);});})[_0xca9f('0x2b')](function(_0x5a9fb3){var _0x517eda=qs[_0xca9f('0x50')](_0x581879,['id',_0xca9f('0x51'),'updatedAt']);_0x517eda[_0xca9f('0x5b')]=_0xca2173['id'];if(_0x5a9fb3)_0x517eda['Resources']=_0x5a9fb3;return _0x517eda;})['then'](function(_0xb7f5ef){return db['UserProfileSection']['create'](_0xb7f5ef,{'include':[{'model':db[_0xca9f('0x59')],'as':_0xca9f('0x5c')}],'raw':!![],'transaction':_0x35f4b8});});})[_0xca9f('0x2b')](function(){return _0xca2173;});}});});});}})[_0xca9f('0x2b')](respondWithResult(_0x4eb702,0xc9))['catch'](handleError(_0x4eb702,null));};exports[_0xca9f('0x2a')]=function(_0x16d605,_0x5b105f){if(_0x16d605[_0xca9f('0x54')]['id']){delete _0x16d605[_0xca9f('0x54')]['id'];}return db[_0xca9f('0x31')]['find']({'where':{'id':_0x16d605[_0xca9f('0x4e')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x5b105f,null))[_0xca9f('0x2b')](saveUpdates(_0x16d605['body'],null))[_0xca9f('0x2b')](respondWithResult(_0x5b105f,null))[_0xca9f('0x4b')](handleError(_0x5b105f,null));};exports[_0xca9f('0x2c')]=function(_0x1c55bc,_0x1bd02e){return db[_0xca9f('0x31')][_0xca9f('0x4a')]({'where':{'id':_0x1c55bc['params']['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x1bd02e,null))['then'](removeEntity(_0x1bd02e,null))['catch'](handleError(_0x1bd02e,null));};exports['describe']=function(_0x527bb3,_0x4c3389){return db[_0xca9f('0x31')]['describe']()['then'](respondWithResult(_0x4c3389,null))['catch'](handleError(_0x4c3389,null));};exports[_0xca9f('0x5d')]=function(_0x5e960a,_0xfaf6af){var _0x504d4d=_0x5e960a['body'];return db[_0xca9f('0x31')]['find']({'where':{'id':_0x5e960a[_0xca9f('0x4e')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0xfaf6af,null))[_0xca9f('0x2b')](function(_0x2f5368){if(_0x2f5368){return db[_0xca9f('0x55')][_0xca9f('0x56')](function(_0x214c9c){return db[_0xca9f('0x57')][_0xca9f('0x2c')]({'where':{'userProfileId':_0x5e960a[_0xca9f('0x4e')]['id'],'sectionId':_[_0xca9f('0x30')](_0x504d4d,function(_0x217bbd){return _0x217bbd[_0xca9f('0x5a')];})},'transaction':_0x214c9c})[_0xca9f('0x2b')](function(){var _0x136e7c=_['map'](_0x504d4d,function(_0x17a592){_0x17a592['userProfileId']=_0x5e960a[_0xca9f('0x4e')]['id'];return _0x17a592;});var _0x39549f=[];return BPromise[_0xca9f('0x58')](_0x136e7c,function(_0x4a48a7){return db[_0xca9f('0x57')][_0xca9f('0x4c')](_0x4a48a7,{'include':[{'model':db[_0xca9f('0x59')],'as':_0xca9f('0x5c')}],'raw':!![],'transaction':_0x214c9c})[_0xca9f('0x2b')](function(_0x563595){_0x39549f[_0xca9f('0x5e')](_0x563595[_0xca9f('0x4f')]({'plain':!![]}));});})[_0xca9f('0x2b')](function(){return _0x39549f;});});});}})[_0xca9f('0x2b')](function(_0x3158dc){return _0x3158dc;})['then'](respondWithResult(_0xfaf6af,null))[_0xca9f('0x4b')](handleError(_0xfaf6af,null));};exports[_0xca9f('0x5f')]=function(_0x241ae2,_0x2121de){var _0x43a679;return db[_0xca9f('0x31')][_0xca9f('0x4a')]({'where':{'id':_0x241ae2[_0xca9f('0x4e')]['id']},'attributes':['id',_0xca9f('0x2f')]})[_0xca9f('0x2b')](handleEntityNotFound(_0x2121de,null))[_0xca9f('0x2b')](function(_0x5a11ba){if(_0x5a11ba){_0x43a679=_0x5a11ba;return db[_0xca9f('0x57')]['destroy']({'where':{'userProfileId':_0x241ae2[_0xca9f('0x4e')]['id'],'sectionId':_0x241ae2[_0xca9f('0x34')][_0xca9f('0x60')]}});}})[_0xca9f('0x2b')](function(){return _0x43a679;})[_0xca9f('0x2b')](respondWithStatusCode(_0x2121de,null))[_0xca9f('0x4b')](handleError(_0x2121de,null));};exports[_0xca9f('0x61')]=function(_0x395260,_0x184b04){var _0x3e3da8=[];var _0x1c42cf=[];return db['UserProfileSection'][_0xca9f('0x46')]({'where':{'userProfileId':_0x395260[_0xca9f('0x4e')]['id']},'raw':!![]})[_0xca9f('0x2b')](function(_0x2b1dc5){_0x3e3da8=_[_0xca9f('0x3f')](_0x2b1dc5,function(_0x17a007){return _0x17a007[_0xca9f('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x17a007[_0xca9f('0x5a')]);});if(!_[_0xca9f('0x63')](_0x3e3da8)){return _[_0xca9f('0x30')](_0x3e3da8,function(_0x872534){return _0x872534['sectionId'];});}else{return;}})[_0xca9f('0x2b')](function(_0x3904cd){if(_0x3904cd)_0x1c42cf=_0x3904cd;if(_['includes'](_0x1c42cf,0x64)){var _0xd980c4=_['find'](_0x3e3da8,{'sectionId':0x64});return hasDefaultDashboard(_0xd980c4)[_0xca9f('0x2b')](function(_0x501f03){return _[_0xca9f('0x30')](_0x3e3da8,function(_0x15129b){if(_0x15129b['sectionId']===0x64){_0x15129b['subsections']=_0x501f03;}return _0x15129b;});});}else{return;}})['then'](function(_0xbba6b5){if(_0xbba6b5)_0x3e3da8=_0xbba6b5;if(_[_0xca9f('0x64')](_0x1c42cf,0x3eb)){var _0x21e802=_[_0xca9f('0x4a')](_0x3e3da8,{'sectionId':0x3eb});return getCustomDashboards(_0x21e802)[_0xca9f('0x2b')](function(_0xe936f1){return _['map'](_0x3e3da8,function(_0x42187b){if(_0x21e802['enabled']){if(_0x42187b[_0xca9f('0x5a')]===0x3eb){_0x42187b[_0xca9f('0x65')]=_0xe936f1;}}else{if(_0x42187b[_0xca9f('0x5a')]===0x64){_0x42187b[_0xca9f('0x65')]=_0xe936f1;}}return _0x42187b;});});}else{return;}})[_0xca9f('0x2b')](function(_0x53e52b){if(_0x53e52b)_0x3e3da8=_0x53e52b;if(_[_0xca9f('0x64')](_0x1c42cf,0x709)){var _0x26e4c5=_[_0xca9f('0x4a')](_0x3e3da8,{'sectionId':0x709});return getPlugins(_0x26e4c5)[_0xca9f('0x2b')](function(_0x10df5c){if(_0x26e4c5[_0xca9f('0x62')]){return _[_0xca9f('0x30')](_0x3e3da8,function(_0x3a9e3c){if(_0x3a9e3c[_0xca9f('0x5a')]===0x709){_0x3a9e3c[_0xca9f('0x65')]=_0x10df5c;}return _0x3a9e3c;});}else{var _0x529853={'sectionId':0x76c,'enabled':0x1,'subsections':_0x10df5c};var _0x42dbaf=_[_0xca9f('0x30')](_0x3e3da8);_0x42dbaf['push'](_0x529853);return _0x42dbaf;}});}else{return;}})['then'](function(_0x24ee74){if(_0x24ee74)_0x3e3da8=_0x24ee74;return _[_0xca9f('0x3f')](_0x3e3da8,[_0xca9f('0x62'),0x1]);})['then'](respondWithResult(_0x184b04,null))[_0xca9f('0x4b')](handleError(_0x184b04,null));};function hasDefaultDashboard(_0x3fa36f){var _0x2bdb47=[0x65];return new BPromise(function(_0x46db44,_0x261eb4){try{if(_0x3fa36f[_0xca9f('0x66')]){_0x46db44(_0x2bdb47);}else{return db[_0xca9f('0x59')][_0xca9f('0x67')]({'where':{'sectionId':_0x3fa36f['id']},'raw':!![]})[_0xca9f('0x2b')](function(_0x20309c){_0x20309c?_0x46db44(_0x2bdb47):_0x46db44();});}}catch(_0x17da2c){_0x261eb4(_0x17da2c);}});}function getCustomDashboards(_0x2282ef){var _0x5d4193=[];return new BPromise(function(_0x2dfdf0,_0x4cbfc1){try{if(_0x2282ef['autoAssociation']){return db['Dashboard'][_0xca9f('0x46')]({'raw':!![]})['then'](function(_0x3ad789){_0x3ad789[_0xca9f('0x68')](function(_0x2816ba){_0x5d4193[_0xca9f('0x5e')](_0x2816ba['id']+0x1869f);});_0x2dfdf0(_0x5d4193);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2282ef['id']},'raw':!![]})['then'](function(_0x531291){_0x531291[_0xca9f('0x68')](function(_0x35f615){_0x5d4193[_0xca9f('0x5e')](_0x35f615['resourceId']+0x1869f);});_0x2dfdf0(_0x5d4193);});}}catch(_0x519999){_0x4cbfc1(_0x519999);}});}function getPlugins(_0xde4b27){var _0x4b151a=[];return new BPromise(function(_0x3ef0b4,_0x2a233e){try{if(_0xde4b27[_0xca9f('0x66')]){return db[_0xca9f('0x69')][_0xca9f('0x46')]({'raw':!![]})[_0xca9f('0x2b')](function(_0x53e379){_0x53e379[_0xca9f('0x68')](function(_0x128cab){_0x4b151a['push'](_0x128cab['id']+0x15b38);});_0x3ef0b4(_0x4b151a);});}else{return db[_0xca9f('0x59')][_0xca9f('0x46')]({'where':{'sectionId':_0xde4b27['id']},'raw':!![]})[_0xca9f('0x2b')](function(_0x18e8d1){_0x18e8d1[_0xca9f('0x68')](function(_0x3ee477){_0x4b151a[_0xca9f('0x5e')](_0x3ee477[_0xca9f('0x6a')]+0x15b38);});_0x3ef0b4(_0x4b151a);});}}catch(_0xd101ae){_0x2a233e(_0xd101ae);}});}exports[_0xca9f('0x6b')]=function(_0x303934,_0x26744e){return db[_0xca9f('0x31')][_0xca9f('0x4a')]({'where':{'id':_0x303934[_0xca9f('0x4e')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x26744e,null))['then'](function(_0x327b9f){if(_0x327b9f){return db[_0xca9f('0x55')][_0xca9f('0x56')](function(_0x41bd3a){return db[_0xca9f('0x57')]['findAll']({'where':{'userProfileId':_0x303934[_0xca9f('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0xca9f('0x2b')](function(_0x16940f){if(_0x16940f){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x303934['params']['id'],'id':_[_0xca9f('0x30')](_0x16940f,function(_0x5e6b73){return _0x5e6b73['id'];})},'transaction':_0x41bd3a});}})[_0xca9f('0x2b')](function(_0x2ac70d){var _0x397948=_[_0xca9f('0x30')](_0x303934[_0xca9f('0x54')],function(_0x5a2729){_0x5a2729[_0xca9f('0x5b')]=_0x303934[_0xca9f('0x4e')]['id'];return _0x5a2729;});return db[_0xca9f('0x57')]['bulkCreate'](_0x397948,{'raw':!![],'transaction':_0x41bd3a});})['then'](function(_0x303468){var _0x21df89=_[_0xca9f('0x3f')](_[_0xca9f('0x30')](_0x303468,function(_0x1aae75){return _0x1aae75[_0xca9f('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x21df89){return db[_0xca9f('0x57')][_0xca9f('0x46')]({'where':{'userProfileId':_0x303934[_0xca9f('0x4e')]['id'],'sectionId':_[_0xca9f('0x30')](_0x21df89,function(_0x44a171){return _0x44a171[_0xca9f('0x5a')];})},'attributes':['id',_0xca9f('0x5a')],'raw':!![]})[_0xca9f('0x2b')](function(_0x3b84f6){var _0x3567fc=_[_0xca9f('0x30')](_0x303934[_0xca9f('0x54')],function(_0x12d2d5){_0x12d2d5[_0xca9f('0x5b')]=_0x303934['params']['id'];return _0x12d2d5;});return db[_0xca9f('0x59')][_0xca9f('0x6c')](_0x3567fc,{'raw':!![],'transaction':_0x41bd3a});});}})['catch'](handleError(_0x26744e,null));});}})['then'](function(_0x4e57f0){var _0x375852=_['map'](_0x4e57f0,function(_0x20dd4b){return _0x20dd4b[_0xca9f('0x4f')]({'plain':!![]});});})[_0xca9f('0x2b')](respondWithResult(_0x26744e,null))[_0xca9f('0x4b')](handleError(_0x26744e,null));};exports['removeResources']=function(_0x558568,_0x5be9b3,_0x42de77){return db[_0xca9f('0x31')]['find']({'where':{'id':_0x558568[_0xca9f('0x4e')]['id']}})[_0xca9f('0x2b')](handleEntityNotFound(_0x5be9b3,null))[_0xca9f('0x2b')](function(_0x270c63){if(_0x270c63){return _0x270c63['removeResources'](_0x558568[_0xca9f('0x34')][_0xca9f('0x60')]);}})[_0xca9f('0x2b')](respondWithStatusCode(_0x5be9b3,null))[_0xca9f('0x4b')](handleError(_0x5be9b3,null));};exports[_0xca9f('0x6d')]=function(_0x363f2c,_0x1bc4f1){var _0x2db5a1={};if(!_0x363f2c['query'][_0xca9f('0x6e')])throw new Error(_0xca9f('0x6f'));if(!_0x363f2c[_0xca9f('0x34')][_0xca9f('0x3b')](_0xca9f('0x3c'))){_0x2db5a1['limit']=qs[_0xca9f('0x22')](_0x363f2c['query'][_0xca9f('0x22')]);_0x2db5a1['offset']=qs[_0xca9f('0x20')](_0x363f2c[_0xca9f('0x34')][_0xca9f('0x20')]);}return db['UserProfile']['find']({'where':{'id':_0x363f2c[_0xca9f('0x4e')]['id']}})['then'](function(_0x3a307a){if(!_0x3a307a)throw new Error(_0xca9f('0x70')+_0x363f2c[_0xca9f('0x4e')]['id']);return db[_0xca9f('0x31')][_0xca9f('0x6d')](_0x363f2c);})['then'](respondWithFilteredResult(_0x1bc4f1,_0x2db5a1))[_0xca9f('0x4b')](handleError(_0x1bc4f1,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b07d904..e300139 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 _0xdf55=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5a60aa,_0x3296f8){var _0x4962b5=function(_0x12147a){while(--_0x12147a){_0x5a60aa['push'](_0x5a60aa['shift']());}};_0x4962b5(++_0x3296f8);}(_0xdf55,0x83));var _0x5df5=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0xdf55[_0x479b99];return _0x1e7eb7;};'use strict';var EventEmitter=require(_0x5df5('0x0'));var UserProfile=require(_0x5df5('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5df5('0x2')](0x0);var events={'afterCreate':_0x5df5('0x3'),'afterUpdate':'update','afterDestroy':_0x5df5('0x4')};function emitEvent(_0x773e15){return function(_0x381a4c,_0x521007,_0x289af4){UserProfileEvents[_0x5df5('0x5')](_0x773e15+':'+_0x381a4c['id'],_0x381a4c);UserProfileEvents[_0x5df5('0x5')](_0x773e15,_0x381a4c);_0x289af4(null);};}for(var e in events){if(events[_0x5df5('0x6')](e)){var event=events[e];UserProfile[_0x5df5('0x7')](e,emitEvent(event));}}module[_0x5df5('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xc6ac=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x12d2da,_0x18d882){var _0x56d87f=function(_0x1d4053){while(--_0x1d4053){_0x12d2da['push'](_0x12d2da['shift']());}};_0x56d87f(++_0x18d882);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2121fa,_0x4dc357){_0x2121fa=_0x2121fa-0x0;var _0x3284e9=_0xc6ac[_0x2121fa];return _0x3284e9;};'use strict';var EventEmitter=require(_0xcc6a('0x0'));var UserProfile=require(_0xcc6a('0x1'))['db'][_0xcc6a('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcc6a('0x3')](0x0);var events={'afterCreate':_0xcc6a('0x4'),'afterUpdate':_0xcc6a('0x5'),'afterDestroy':_0xcc6a('0x6')};function emitEvent(_0x31bbcd){return function(_0x297643,_0x22ee99,_0x2f26ab){UserProfileEvents[_0xcc6a('0x7')](_0x31bbcd+':'+_0x297643['id'],_0x297643);UserProfileEvents[_0xcc6a('0x7')](_0x31bbcd,_0x297643);_0x2f26ab(null);};}for(var e in events){if(events[_0xcc6a('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xcc6a('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ed4582d..bd7a746 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 _0xd8fb=['CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','Trigger','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','mergeResources','length','UserProfileSection','find','all','ignore','isEmpty','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','foreignKey','autoAssociation','includeAll','include','forEach','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','associatedResources','map','field','model','findAll','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','ListId','lists'];(function(_0x135a85,_0x10bfd0){var _0x247047=function(_0x1f2143){while(--_0x1f2143){_0x135a85['push'](_0x135a85['shift']());}};_0x247047(++_0x10bfd0);}(_0xd8fb,0x99));var _0xbd8f=function(_0x40ab1e,_0x442e5b){_0x40ab1e=_0x40ab1e-0x0;var _0x253f6e=_0xd8fb[_0x40ab1e];return _0x253f6e;};'use strict';var _=require(_0xbd8f('0x0'));var attributes=require(_0xbd8f('0x1'));var qs=require(_0xbd8f('0x2'));var squel=require(_0xbd8f('0x3'));module['exports']=function(_0x5ea933){var _0x4e9545=_0x5ea933[_0xbd8f('0x4')];function _0x43d177(_0x53cccc,_0x400dfb){return new Promise(function(_0x2343bf,_0x5543b2){if(!_0x400dfb)return _0x2343bf(null);var _0x33d541=_0x400dfb['filter']?{[_0x400dfb[_0xbd8f('0x5')]['field']]:_0x400dfb[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x53cccc]['findAll']({'where':_0x33d541,'raw':!![]})['then'](function(_0x3caa93){_0x400dfb[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x3caa93,'id');_0x2343bf(_0x400dfb);})['catch'](function(_0x255af3){_0x5543b2(_0x255af3);});});}function _0x42ae20(_0x5b834b,_0x4ac253){return new Promise(function(_0x342bcb,_0x40a5bc){var _0x12dcac=_0x5b834b['filter']?{[_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x9')]]:_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x5b834b[_0xbd8f('0xa')]][_0xbd8f('0xb')]({'where':_0x12dcac,'raw':!![]})[_0xbd8f('0xc')](function(_0x29ffe8){_0x4ac253[_0xbd8f('0x7')]=_['map'](_0x29ffe8,function(_0x31573c){return _0x31573c[_0xbd8f('0xd')];});_0x342bcb(_0x4ac253);})[_0xbd8f('0xe')](function(_0x10d72e){_0x40a5bc(_0x10d72e);});});}function _0x4da96f(_0x174929,_0x63db18,_0x5ebf8b){if(!_0x63db18)return Promise[_0xbd8f('0xf')](null);return new Promise(function(_0xf5e7a,_0x504adb){return _0x4e9545[_0xbd8f('0x10')][_0xbd8f('0xb')]({'where':{'sectionId':_0x63db18['id']},'raw':!![]})['then'](function(_0x5a572b){if(_0x174929[_0xbd8f('0x9')]&&_0x174929['field']!=='id'){_0x63db18['associatedResources']=_[_0xbd8f('0x8')](_0x5a572b,function(_0x4b5fac){return _0x4b5fac[_0x174929[_0xbd8f('0x9')]];});}else{if(_0x5ebf8b===_0xbd8f('0x11')){_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0xdc11cc){return{'id':_0xdc11cc[_0xbd8f('0x12')],'type':_0xdc11cc[_0xbd8f('0x13')]};});}else{_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0x775acc){return _0x775acc[_0xbd8f('0x12')];});}}_0xf5e7a(_0x63db18);})[_0xbd8f('0xe')](function(_0x2f7c45){_0x504adb(_0x2f7c45);});});}function _0x15c4a9(_0x320ede,_0xd11ae){var _0x395b1b={'parentSections':[]};switch(_0x320ede['toLowerCase']()){case _0xbd8f('0x14'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x16');break;case _0xbd8f('0x17'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x18');break;case _0xbd8f('0x19'):_0x395b1b[_0xbd8f('0x15')]='SquareRecording';_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x1b'),'field':'name','foreignKey':_0xbd8f('0x1c')}];break;case'projects':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1d');break;case _0xbd8f('0x1e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1f');_0x395b1b[_0xbd8f('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0xbd8f('0x20')}];break;case _0xbd8f('0x21'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x22');break;case _0xbd8f('0x23'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x24');break;case'globalcustomfields':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x25');break;case _0xbd8f('0x26'):_0x395b1b[_0xbd8f('0x15')]='ChatQueue';break;case'chatwebsites':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x27');break;case _0xbd8f('0x28'):_0x395b1b[_0xbd8f('0x15')]='FaxQueue';break;case _0xbd8f('0x29'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2a');break;case _0xbd8f('0x2b'):case _0xbd8f('0x2c'):case'outboundroutes':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2d');break;case _0xbd8f('0x2e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2f');break;case'voicemails':_0x395b1b[_0xbd8f('0x15')]='VoiceMail';break;case _0xbd8f('0x30'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x31');_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x32'),'field':_0xbd8f('0xd'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xbd8f('0x33')]}},{'name':_0xbd8f('0x34'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x35'),'model':_0xbd8f('0x36'),'filter':{'field':_0xbd8f('0x37'),'value':[_0xbd8f('0x38')]}},{'name':_0xbd8f('0x39'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x3a'),'model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':[_0xbd8f('0x3c')]}},{'name':_0xbd8f('0x3d'),'field':_0xbd8f('0xd'),'foreignKey':'queue','model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':['outbound']}}];break;case _0xbd8f('0x3e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3f');break;case'chanspies':_0x395b1b[_0xbd8f('0x15')]='VoiceChanSpy';break;case _0xbd8f('0x40'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x41');break;case'ivrcampaigns':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x42');break;case _0xbd8f('0x43'):_0x395b1b['childModel']=_0xbd8f('0x44');break;case _0xbd8f('0x45'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x46');break;case _0xbd8f('0x47'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x48');break;case _0xbd8f('0x49'):_0x395b1b[_0xbd8f('0x15')]='OpenchannelQueue';break;case'openchannelaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4a');break;case _0xbd8f('0x4b'):_0x395b1b[_0xbd8f('0x15')]='SmsQueue';break;case _0xbd8f('0x4c'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4d');break;case _0xbd8f('0x4e'):_0x395b1b[_0xbd8f('0x15')]='WhatsappQueue';break;case'whatsappaccounts':_0x395b1b[_0xbd8f('0x15')]='WhatsappAccount';break;case _0xbd8f('0x4f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x50');break;case _0xbd8f('0x51'):case _0xbd8f('0x52'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3b');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':'VoiceQueues'},{'name':_0xbd8f('0x3d')}];}break;case _0xbd8f('0x53'):case _0xbd8f('0x54'):case _0xbd8f('0x55'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x36');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x56'),'filter':{'field':'role','value':[_0xbd8f('0x57'),_0xbd8f('0x58')]},'ignore':!![]},{'name':_0xbd8f('0x32')},{'name':_0xbd8f('0x34')}];}break;case _0xbd8f('0x59'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5a');break;case _0xbd8f('0x5b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5c');break;case _0xbd8f('0x5d'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5e');break;case _0xbd8f('0x5f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x60');break;case _0xbd8f('0x61'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x62');break;case'zohoaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x63');break;case _0xbd8f('0x64'):_0x395b1b[_0xbd8f('0x15')]='User';break;case _0xbd8f('0x65'):_0x395b1b['childModel']=_0xbd8f('0x66');break;case _0xbd8f('0x67'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x68');break;case'customdashboards':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x69');break;case _0xbd8f('0x6a'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6b');break;case _0xbd8f('0x6c'):_0x395b1b['childModel']=_0xbd8f('0x6d');break;case'scheduler':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6e');break;case _0xbd8f('0x6f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x70');break;case _0xbd8f('0x71'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x72');break;case _0xbd8f('0x73'):_0x395b1b['childModel']=_0xbd8f('0x74');break;case'triggers':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x75');break;case'trunks':_0x395b1b[_0xbd8f('0x15')]='Trunk';break;case'variables':_0x395b1b['childModel']='Variable';break;case _0xbd8f('0x76'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x77');break;case _0xbd8f('0x78'):_0x395b1b[_0xbd8f('0x15')]='AnalyticExtractedReport';_0x395b1b['parentSections']=[{'name':_0xbd8f('0x79'),'field':'id','foreignKey':_0xbd8f('0x7a')}];break;case _0xbd8f('0x7b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x7c');break;}return _0x395b1b;}function _0x576970(_0x4d2b28,_0x55a99b){var _0x9cf2d5=_0x4d2b28[_0xbd8f('0x7d')](0x0)[_0xbd8f('0x7e')]()+_0x4d2b28['slice'](0x1);var _0x3255be={'type':_0x4e9545[_0xbd8f('0x7f')][_0xbd8f('0x80')][_0xbd8f('0x81')],'raw':!![]};return new Promise(function(_0x50622d,_0x5327f2){var _0x388af8=squel['select']()[_0xbd8f('0x9')](_0xbd8f('0x82')+_0x9cf2d5+_0xbd8f('0x83'),'id')[_0xbd8f('0x9')]('ui.createdAt')['from'](_0xbd8f('0x84')+_0x4d2b28+_0xbd8f('0x85'),'ui')[_0xbd8f('0x86')](_0xbd8f('0x87'),_0x55a99b['id']);return _0x4e9545[_0xbd8f('0x88')][_0xbd8f('0x89')](_0x388af8[_0xbd8f('0x8a')](),_0x3255be)[_0xbd8f('0xc')](function(_0x2b9ba3){_0x55a99b[_0x9cf2d5+_0xbd8f('0x8b')]=_0x2b9ba3;_0x50622d(_0x2b9ba3);})[_0xbd8f('0xe')](function(_0x5c69c6){_0x5327f2(_0x5c69c6);});});}return _0x5ea933[_0xbd8f('0x8c')](_0xbd8f('0x8d'),attributes,{'tableName':_0xbd8f('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x12ee82){var _0x3b43f7={'raw':![],'where':{}};var _0xbbe096={};var _0x50e345={'count':0x0,'rows':[]};var _0x46c686=_0x12ee82[_0xbd8f('0x89')]['section'];var _0x5e18fc=_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x8f')]||![];var _0x109616=_0x15c4a9(_0x46c686,_0x5e18fc);if(!_0x109616['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x46c686+'\x27');var _0x118f1a=[{'name':_0x46c686}];if(!_['isEmpty'](_0x109616['parentSections']))_0x118f1a=_0x109616['parentSections'];var _0x5a858e=[];for(var _0x5b26eb=0x0;_0x5b26eb<_0x118f1a[_0xbd8f('0x90')];_0x5b26eb++){_0x5a858e['push'](_0x4e9545[_0xbd8f('0x91')][_0xbd8f('0x92')]({'where':{'userProfileId':_0x12ee82['params']['id'],'name':_0x118f1a[_0x5b26eb][_0xbd8f('0xd')]},'raw':!![]}));}return Promise[_0xbd8f('0x93')](_0x5a858e)[_0xbd8f('0xc')](function(_0xeabb79){var _0x199d7d=_['filter'](_0xeabb79,function(_0x583d7a){return _0x583d7a?_0x583d7a:undefined;});var _0x378e72=_[_0xbd8f('0x5')](_0x118f1a,[_0xbd8f('0x94'),!![]]);var _0x296794=_[_0xbd8f('0x95')](_0x199d7d)&&_[_0xbd8f('0x95')](_0x378e72)?null:_['union'](_0x378e72,_0x199d7d);if(!_0x296794)return null;var _0x4eddf2=[];for(var _0x467b0f=0x0;_0x467b0f<_0x296794[_0xbd8f('0x90')];_0x467b0f++){var _0x528b29=_[_0xbd8f('0x92')](_0x118f1a,function(_0x372386){return _0x296794[_0x467b0f]?_0x372386['name']===_0x296794[_0x467b0f][_0xbd8f('0xd')]:null;});if(_0x528b29){if(_0x296794[_0x467b0f][_0xbd8f('0x94')]){_0x4eddf2[_0xbd8f('0x96')](_0x43d177(_0x109616['childModel'],_0x296794[_0x467b0f]));}else{if(!_0x296794[_0x467b0f]['autoAssociation']){_0x4eddf2[_0xbd8f('0x96')](_0x4da96f(_0x528b29,_0x296794[_0x467b0f],_0x109616[_0xbd8f('0x15')]));}else{if(_0x528b29[_0xbd8f('0xa')]){_0x4eddf2[_0xbd8f('0x96')](_0x42ae20(_0x528b29,_0x296794[_0x467b0f]));}}}}}return Promise[_0xbd8f('0x93')](_0x4eddf2);})['then'](function(_0x200718){var _0x27ec14=_0x200718;var _0x400bf6=null;if(_0x27ec14){_0x400bf6=_0x27ec14[_0xbd8f('0x90')]===0x1?_0x27ec14[0x0]:null;}if(!_0x400bf6&&!_0x27ec14)return _0x50e345;var _0x1efdf4=_0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0x97')];_0xbbe096[_0xbd8f('0xa')]=_[_0xbd8f('0x98')](_0x1efdf4);_0xbbe096[_0xbd8f('0x89')]=_[_0xbd8f('0x98')](_0x12ee82[_0xbd8f('0x89')]);_0xbbe096[_0xbd8f('0x99')]=_[_0xbd8f('0x9a')](_0xbbe096[_0xbd8f('0xa')],_0xbbe096[_0xbd8f('0x89')]);_0x3b43f7[_0xbd8f('0x9b')]=_[_0xbd8f('0x9a')](_0xbbe096['model'],qs[_0xbd8f('0x9c')](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9c')]));_0x3b43f7[_0xbd8f('0x9b')]=_0x3b43f7[_0xbd8f('0x9b')][_0xbd8f('0x90')]?_0x3b43f7['attributes']:_0xbbe096['model'];if(!_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9d')]('nolimit')){_0x3b43f7[_0xbd8f('0x9e')]=qs['limit'](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9e')]);_0x3b43f7[_0xbd8f('0x9f')]=qs[_0xbd8f('0x9f')](_0x12ee82['query'][_0xbd8f('0x9f')]);}_0x3b43f7[_0xbd8f('0xa0')]=qs[_0xbd8f('0xa1')](_0x12ee82['query'][_0xbd8f('0xa1')]);_0x3b43f7[_0xbd8f('0x86')]=qs[_0xbd8f('0x99')](_[_0xbd8f('0xa2')](_0x12ee82['query'],_0xbbe096[_0xbd8f('0x99')]));if(_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$or':_[_0xbd8f('0x8')](_0x1efdf4,function(_0x3a320c){if(_0x3a320c['type'][_0xbd8f('0xa4')]!=='VIRTUAL'){var _0x3da31b={};_0x3da31b[_0x3a320c['field']]={'$like':'%'+_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]+'%'};return _0x3da31b;}})});}var _0x5465e5=[];var _0x3d015f=null;var _0x87191={};if(_0x400bf6){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x400bf6['name']]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};if(_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_['map'](_0x400bf6['associatedResources'],'id');}else{_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_0x400bf6[_0xbd8f('0x7')];}_0x5465e5[_0xbd8f('0x96')](_0x87191);}else{_0x3b43f7[_0xbd8f('0x86')]['id']=_0x400bf6[_0xbd8f('0x7')];}}else{for(var _0x53076d=0x0;_0x53076d<_0x27ec14[_0xbd8f('0x90')];_0x53076d++){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x27ec14[_0x53076d][_0xbd8f('0xd')]]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};_0x87191[_0x3d015f['foreignKey']]=_0x27ec14[_0x53076d]['associatedResources'];_0x5465e5['push'](_0x87191);}else{if(!_0x3b43f7[_0xbd8f('0x86')]['id'])_0x3b43f7['where']['id']=[];_0x27ec14[_0x53076d]['associatedResources']['forEach'](function(_0x63c20c){_0x3b43f7[_0xbd8f('0x86')]['id'][_0xbd8f('0x96')](_0x63c20c);});}}}if(!_[_0xbd8f('0x95')](_0x5465e5)){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$and':{'$or':_0x5465e5}});}_0x3b43f7=_[_0xbd8f('0xa3')]({},_0x3b43f7,_0x12ee82['options']);if(_0x400bf6&&!_0x400bf6[_0xbd8f('0xa6')]&&_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){if(_0x12ee82['query'][_0xbd8f('0xa7')]){_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}return _0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0xb')](_0x3b43f7)[_0xbd8f('0xc')](function(_0x44ee0d){var _0x1d3c63=[];_0x44ee0d[_0xbd8f('0xa9')](function(_0x3aa33a){var _0x9e2f8a;switch(_0x3aa33a['reportType']){case _0xbd8f('0xaa'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x5c9c3a){return _0x5c9c3a['id']===_0x3aa33a[_0xbd8f('0x7a')]&&_0x5c9c3a['type']===_0xbd8f('0xab');});break;case _0xbd8f('0xac'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x351caa){return _0x351caa['id']===_0x3aa33a['reportId']&&_0x351caa[_0xbd8f('0x13')]===_0xbd8f('0xad');});break;}if(_0x9e2f8a)_0x1d3c63[_0xbd8f('0x96')](_0x3aa33a);});_0x50e345[_0xbd8f('0xae')]=_0x1d3c63[_0xbd8f('0x90')];_0x50e345[_0xbd8f('0xaf')]=_0x1d3c63;return _0x50e345;});}else{return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xae')]({'where':_0x3b43f7[_0xbd8f('0x86')]})['then'](function(_0x49e15e){_0x50e345[_0xbd8f('0xae')]=_0x49e15e;if(_0x12ee82['query']['includeAll']){if(_0x109616['childModel']===_0xbd8f('0x1f')){_0x3b43f7[_0xbd8f('0xa8')]=[{'model':_0x4e9545[_0xbd8f('0x72')],'as':_0xbd8f('0xb0'),'attributes':['id','name',_0xbd8f('0xb1')],'required':_0x12ee82[_0xbd8f('0x89')]['tag']?!![]:![]},{'model':_0x4e9545['Tag'],'as':_0xbd8f('0xb2'),'attributes':['id','name',_0xbd8f('0xb1')],'through':_0x12ee82['query']['tag']?{'attributes':[],'where':{'TagId':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]||undefined}}:{},'required':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]?!![]:![]}];}else{_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}}return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xb')](_0x3b43f7);})[_0xbd8f('0xc')](function(_0x3a6ec4){_0x50e345['rows']=_0x3a6ec4;if(_0x46c686===_0xbd8f('0x32')&&_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb4')]===_0xbd8f('0xb5')){var _0x11fb11=[];for(var _0xc7a57c=0x0;_0xc7a57c<_0x50e345[_0xbd8f('0xaf')][_0xbd8f('0x90')];_0xc7a57c++){_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb6'),_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11['push'](_0x576970('sms',_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970('fax',_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb8'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb9'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970(_0xbd8f('0xba'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));}return Promise['all'](_0x11fb11)[_0xbd8f('0xc')](function(){return _0x50e345;});}return _0x50e345;});}});}}});}; \ No newline at end of file +var _0xd101=['chat','dataValues','sms','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceRecording','User','agent','Telephones','membername','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','teams','voicequeues','queuecampaigns','users','agents','Users','role','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','ignore','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','forEach','include','reportType','custom','CustomReports','count','rows','includeAll','Tags','color','tag','openTabs','true'];(function(_0x1db732,_0x30f014){var _0x5c86c3=function(_0x58ec26){while(--_0x58ec26){_0x1db732['push'](_0x1db732['shift']());}};_0x5c86c3(++_0x30f014);}(_0xd101,0xc1));var _0x1d10=function(_0x43d0cb,_0x58159a){_0x43d0cb=_0x43d0cb-0x0;var _0x50cce2=_0xd101[_0x43d0cb];return _0x50cce2;};'use strict';var _=require(_0x1d10('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x1d10('0x1'));var squel=require(_0x1d10('0x2'));module[_0x1d10('0x3')]=function(_0x21b32e){var _0xaa1d24=_0x21b32e[_0x1d10('0x4')];function _0x12c320(_0x1e83e0,_0x5c5c42){return new Promise(function(_0x42b6d2,_0x203072){if(!_0x5c5c42)return _0x42b6d2(null);var _0x2a4e2d=_0x5c5c42[_0x1d10('0x5')]?{[_0x5c5c42[_0x1d10('0x5')][_0x1d10('0x6')]]:_0x5c5c42[_0x1d10('0x5')][_0x1d10('0x7')]}:undefined;return _0xaa1d24[_0x1e83e0][_0x1d10('0x8')]({'where':_0x2a4e2d,'raw':!![]})[_0x1d10('0x9')](function(_0xf7926b){_0x5c5c42[_0x1d10('0xa')]=_[_0x1d10('0xb')](_0xf7926b,'id');_0x42b6d2(_0x5c5c42);})[_0x1d10('0xc')](function(_0x42efad){_0x203072(_0x42efad);});});}function _0x5ff1df(_0x450b22,_0x54face){return new Promise(function(_0x3a2050,_0x93cb59){var _0x322bf4=_0x450b22[_0x1d10('0x5')]?{[_0x450b22[_0x1d10('0x5')]['field']]:_0x450b22[_0x1d10('0x5')][_0x1d10('0x7')]}:undefined;return _0xaa1d24[_0x450b22[_0x1d10('0xd')]][_0x1d10('0x8')]({'where':_0x322bf4,'raw':!![]})[_0x1d10('0x9')](function(_0x183bc4){_0x54face['associatedResources']=_[_0x1d10('0xb')](_0x183bc4,function(_0x556f27){return _0x556f27[_0x1d10('0xe')];});_0x3a2050(_0x54face);})[_0x1d10('0xc')](function(_0x4f014a){_0x93cb59(_0x4f014a);});});}function _0x3aedf7(_0x3fe555,_0x41152c,_0x3f2f2b){if(!_0x41152c)return Promise[_0x1d10('0xf')](null);return new Promise(function(_0x382b37,_0x4528a6){return _0xaa1d24['UserProfileResource'][_0x1d10('0x8')]({'where':{'sectionId':_0x41152c['id']},'raw':!![]})[_0x1d10('0x9')](function(_0x4ca1e8){if(_0x3fe555[_0x1d10('0x6')]&&_0x3fe555[_0x1d10('0x6')]!=='id'){_0x41152c['associatedResources']=_['map'](_0x4ca1e8,function(_0x44a253){return _0x44a253[_0x3fe555['field']];});}else{if(_0x3f2f2b==='AnalyticExtractedReport'){_0x41152c['associatedResources']=_[_0x1d10('0xb')](_0x4ca1e8,function(_0x2496bc){return{'id':_0x2496bc[_0x1d10('0x10')],'type':_0x2496bc[_0x1d10('0x11')]};});}else{_0x41152c['associatedResources']=_['map'](_0x4ca1e8,function(_0x140147){return _0x140147['resourceId'];});}}_0x382b37(_0x41152c);})[_0x1d10('0xc')](function(_0x474321){_0x4528a6(_0x474321);});});}function _0x160802(_0x37f22d,_0x127b37){var _0x3601ba={'parentSections':[]};switch(_0x37f22d[_0x1d10('0x12')]()){case _0x1d10('0x13'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x15');break;case _0x1d10('0x16'):_0x3601ba['childModel']=_0x1d10('0x17');break;case _0x1d10('0x18'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x19');_0x3601ba[_0x1d10('0x1a')]=[{'name':_0x1d10('0x1b'),'field':_0x1d10('0xe'),'foreignKey':_0x1d10('0x1c')}];break;case'projects':_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x1d');break;case'contacts':_0x3601ba[_0x1d10('0x14')]='CmContact';_0x3601ba['parentSections']=[{'name':_0x1d10('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x1d10('0x1f'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x20');break;case _0x1d10('0x21'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x22');break;case'globalcustomfields':_0x3601ba['childModel']=_0x1d10('0x23');break;case _0x1d10('0x24'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x25');break;case _0x1d10('0x26'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x27');break;case _0x1d10('0x28'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x29');break;case'faxaccounts':_0x3601ba[_0x1d10('0x14')]='FaxAccount';break;case _0x1d10('0x2a'):case _0x1d10('0x2b'):case'outboundroutes':_0x3601ba[_0x1d10('0x14')]='VoiceExtension';break;case _0x1d10('0x2c'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x2d');break;case _0x1d10('0x2e'):_0x3601ba[_0x1d10('0x14')]='VoiceMail';break;case'voicerecordings':_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x2f');_0x3601ba[_0x1d10('0x1a')]=[{'name':'Agents','field':'name','foreignKey':'membername','model':_0x1d10('0x30'),'filter':{'field':'role','value':[_0x1d10('0x31')]}},{'name':_0x1d10('0x32'),'field':_0x1d10('0xe'),'foreignKey':_0x1d10('0x33'),'model':'User','filter':{'field':'role','value':[_0x1d10('0x34')]}},{'name':_0x1d10('0x35'),'field':_0x1d10('0xe'),'foreignKey':_0x1d10('0x36'),'model':'VoiceQueue','filter':{'field':_0x1d10('0x11'),'value':['inbound']}},{'name':_0x1d10('0x37'),'field':_0x1d10('0xe'),'foreignKey':_0x1d10('0x36'),'model':_0x1d10('0x38'),'filter':{'field':_0x1d10('0x11'),'value':[_0x1d10('0x39')]}}];break;case _0x1d10('0x3a'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x3b');break;case _0x1d10('0x3c'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x3d');break;case _0x1d10('0x3e'):_0x3601ba['childModel']='VoicePrefix';break;case _0x1d10('0x3f'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x40');break;case _0x1d10('0x41'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x42');break;case _0x1d10('0x43'):_0x3601ba['childModel']=_0x1d10('0x44');break;case _0x1d10('0x45'):_0x3601ba[_0x1d10('0x14')]='MailSubstatus';break;case _0x1d10('0x46'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x47');break;case'openchannelaccounts':_0x3601ba['childModel']=_0x1d10('0x48');break;case _0x1d10('0x49'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x4a');break;case _0x1d10('0x4b'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x4c');break;case'whatsappqueues':_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x4d');break;case'whatsappaccounts':_0x3601ba[_0x1d10('0x14')]='WhatsappAccount';break;case _0x1d10('0x4e'):_0x3601ba['childModel']='Team';break;case _0x1d10('0x4f'):case _0x1d10('0x50'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x38');if(_0x127b37){_0x3601ba[_0x1d10('0x1a')]=[{'name':_0x1d10('0x35')},{'name':_0x1d10('0x37')}];}break;case _0x1d10('0x51'):case _0x1d10('0x52'):case'telephones':_0x3601ba['childModel']=_0x1d10('0x30');if(_0x127b37){_0x3601ba[_0x1d10('0x1a')]=[{'name':_0x1d10('0x53'),'filter':{'field':_0x1d10('0x54'),'value':[_0x1d10('0x55'),_0x1d10('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x1d10('0x32')}];}break;case _0x1d10('0x57'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x58');break;case _0x1d10('0x59'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x5a');break;case _0x1d10('0x5b'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x5c');break;case _0x1d10('0x5d'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x5e');break;case _0x1d10('0x5f'):_0x3601ba['childModel']='DeskAccount';break;case _0x1d10('0x60'):_0x3601ba['childModel']='ZohoAccount';break;case _0x1d10('0x61'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x30');break;case _0x1d10('0x62'):_0x3601ba[_0x1d10('0x14')]='CannedAnswer';break;case'dispositions':_0x3601ba['childModel']='Disposition';break;case _0x1d10('0x63'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x64');break;case _0x1d10('0x65'):_0x3601ba['childModel']=_0x1d10('0x66');break;case _0x1d10('0x67'):_0x3601ba[_0x1d10('0x14')]='Pause';break;case _0x1d10('0x68'):_0x3601ba['childModel']=_0x1d10('0x69');break;case _0x1d10('0x6a'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x6b');break;case'tags':_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x6c');break;case _0x1d10('0x6d'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x6e');break;case _0x1d10('0x6f'):_0x3601ba['childModel']=_0x1d10('0x70');break;case'trunks':_0x3601ba[_0x1d10('0x14')]='Trunk';break;case _0x1d10('0x71'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x72');break;case _0x1d10('0x73'):_0x3601ba['childModel']=_0x1d10('0x74');break;case _0x1d10('0x75'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x76');_0x3601ba[_0x1d10('0x1a')]=[{'name':_0x1d10('0x77'),'field':'id','foreignKey':_0x1d10('0x78')}];break;case _0x1d10('0x79'):_0x3601ba[_0x1d10('0x14')]=_0x1d10('0x7a');break;}return _0x3601ba;}function _0x151ffb(_0x4be2c8,_0x1aa319){var _0x569097=_0x4be2c8[_0x1d10('0x7b')](0x0)[_0x1d10('0x7c')]()+_0x4be2c8[_0x1d10('0x7d')](0x1);var _0x23ffc0={'type':_0xaa1d24[_0x1d10('0x7e')][_0x1d10('0x7f')][_0x1d10('0x80')],'raw':!![]};return new Promise(function(_0x6d8ac2,_0x3dbe18){var _0x12e8b3=squel[_0x1d10('0x81')]()[_0x1d10('0x6')](_0x1d10('0x82')+_0x569097+_0x1d10('0x83'),'id')[_0x1d10('0x6')]('ui.createdAt')[_0x1d10('0x84')](_0x1d10('0x85')+_0x4be2c8+_0x1d10('0x86'),'ui')['where'](_0x1d10('0x87'),_0x1aa319['id']);return _0xaa1d24[_0x1d10('0x88')][_0x1d10('0x89')](_0x12e8b3[_0x1d10('0x8a')](),_0x23ffc0)[_0x1d10('0x9')](function(_0x453579){_0x1aa319[_0x569097+_0x1d10('0x8b')]=_0x453579;_0x6d8ac2(_0x453579);})[_0x1d10('0xc')](function(_0x43040b){_0x3dbe18(_0x43040b);});});}return _0x21b32e['define'](_0x1d10('0x8c'),attributes,{'tableName':_0x1d10('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x28ba70){var _0x3651a9={'raw':![],'where':{}};var _0x101b5c={};var _0x2ff701={'count':0x0,'rows':[]};var _0x7c500c=_0x28ba70['query'][_0x1d10('0x8e')];var _0x4d6546=_0x28ba70[_0x1d10('0x89')][_0x1d10('0x8f')]||![];var _0x2fd6d6=_0x160802(_0x7c500c,_0x4d6546);if(!_0x2fd6d6[_0x1d10('0x14')])throw new Error(_0x1d10('0x90')+_0x7c500c+'\x27');var _0xcdd850=[{'name':_0x7c500c}];if(!_[_0x1d10('0x91')](_0x2fd6d6['parentSections']))_0xcdd850=_0x2fd6d6['parentSections'];var _0x263962=[];for(var _0x5dce9d=0x0;_0x5dce9d<_0xcdd850[_0x1d10('0x92')];_0x5dce9d++){_0x263962[_0x1d10('0x93')](_0xaa1d24[_0x1d10('0x94')][_0x1d10('0x95')]({'where':{'userProfileId':_0x28ba70['params']['id'],'name':_0xcdd850[_0x5dce9d][_0x1d10('0xe')]},'raw':!![]}));}return Promise['all'](_0x263962)[_0x1d10('0x9')](function(_0x4745ee){var _0x1d02be=_[_0x1d10('0x5')](_0x4745ee,function(_0x55102c){return _0x55102c?_0x55102c:undefined;});var _0x51b0b6=_['filter'](_0xcdd850,['ignore',!![]]);var _0x441570=_[_0x1d10('0x91')](_0x1d02be)&&_['isEmpty'](_0x51b0b6)?null:_['union'](_0x51b0b6,_0x1d02be);if(!_0x441570)return null;var _0x5804ad=[];for(var _0x2672d3=0x0;_0x2672d3<_0x441570['length'];_0x2672d3++){var _0x1563f9=_[_0x1d10('0x95')](_0xcdd850,function(_0x5f44f4){return _0x441570[_0x2672d3]?_0x5f44f4[_0x1d10('0xe')]===_0x441570[_0x2672d3][_0x1d10('0xe')]:null;});if(_0x1563f9){if(_0x441570[_0x2672d3][_0x1d10('0x96')]){_0x5804ad[_0x1d10('0x93')](_0x12c320(_0x2fd6d6[_0x1d10('0x14')],_0x441570[_0x2672d3]));}else{if(!_0x441570[_0x2672d3][_0x1d10('0x97')]){_0x5804ad[_0x1d10('0x93')](_0x3aedf7(_0x1563f9,_0x441570[_0x2672d3],_0x2fd6d6['childModel']));}else{if(_0x1563f9['model']){_0x5804ad[_0x1d10('0x93')](_0x5ff1df(_0x1563f9,_0x441570[_0x2672d3]));}}}}}return Promise[_0x1d10('0x98')](_0x5804ad);})[_0x1d10('0x9')](function(_0x1b8ab0){var _0x421fc3=_0x1b8ab0;var _0x222232=null;if(_0x421fc3){_0x222232=_0x421fc3[_0x1d10('0x92')]===0x1?_0x421fc3[0x0]:null;}if(!_0x222232&&!_0x421fc3)return _0x2ff701;var _0xa38a42=_0xaa1d24[_0x2fd6d6[_0x1d10('0x14')]]['rawAttributes'];_0x101b5c[_0x1d10('0xd')]=_[_0x1d10('0x99')](_0xa38a42);_0x101b5c['query']=_[_0x1d10('0x99')](_0x28ba70[_0x1d10('0x89')]);_0x101b5c[_0x1d10('0x9a')]=_[_0x1d10('0x9b')](_0x101b5c[_0x1d10('0xd')],_0x101b5c[_0x1d10('0x89')]);_0x3651a9[_0x1d10('0x9c')]=_[_0x1d10('0x9b')](_0x101b5c[_0x1d10('0xd')],qs['fields'](_0x28ba70[_0x1d10('0x89')][_0x1d10('0x9d')]));_0x3651a9[_0x1d10('0x9c')]=_0x3651a9[_0x1d10('0x9c')]['length']?_0x3651a9[_0x1d10('0x9c')]:_0x101b5c[_0x1d10('0xd')];if(!_0x28ba70[_0x1d10('0x89')][_0x1d10('0x9e')](_0x1d10('0x9f'))){_0x3651a9[_0x1d10('0xa0')]=qs[_0x1d10('0xa0')](_0x28ba70[_0x1d10('0x89')][_0x1d10('0xa0')]);_0x3651a9['offset']=qs[_0x1d10('0xa1')](_0x28ba70['query']['offset']);}_0x3651a9[_0x1d10('0xa2')]=qs['sort'](_0x28ba70[_0x1d10('0x89')][_0x1d10('0xa3')]);_0x3651a9[_0x1d10('0xa4')]=qs[_0x1d10('0x9a')](_[_0x1d10('0xa5')](_0x28ba70[_0x1d10('0x89')],_0x101b5c[_0x1d10('0x9a')]));if(_0x28ba70[_0x1d10('0x89')][_0x1d10('0x5')]){_0x3651a9[_0x1d10('0xa4')]=_[_0x1d10('0xa6')](_0x3651a9[_0x1d10('0xa4')],{'$or':_['map'](_0xa38a42,function(_0x135755){if(_0x135755[_0x1d10('0x11')][_0x1d10('0xa7')]!==_0x1d10('0xa8')){var _0x3464a2={};_0x3464a2[_0x135755[_0x1d10('0x6')]]={'$like':'%'+_0x28ba70[_0x1d10('0x89')][_0x1d10('0x5')]+'%'};return _0x3464a2;}})});}var _0x132507=[];var _0x4c4881=null;var _0xbdde11={};if(_0x222232){_0x4c4881=_[_0x1d10('0x95')](_0xcdd850,[_0x1d10('0xe'),_0x222232[_0x1d10('0xe')]]);if(_0x4c4881[_0x1d10('0x6')]){_0xbdde11={};if(_0x2fd6d6[_0x1d10('0x14')]===_0x1d10('0x76')){_0xbdde11[_0x4c4881[_0x1d10('0xa9')]]=_['map'](_0x222232[_0x1d10('0xa')],'id');}else{_0xbdde11[_0x4c4881[_0x1d10('0xa9')]]=_0x222232[_0x1d10('0xa')];}_0x132507[_0x1d10('0x93')](_0xbdde11);}else{_0x3651a9[_0x1d10('0xa4')]['id']=_0x222232['associatedResources'];}}else{for(var _0x598de0=0x0;_0x598de0<_0x421fc3[_0x1d10('0x92')];_0x598de0++){_0x4c4881=_[_0x1d10('0x95')](_0xcdd850,[_0x1d10('0xe'),_0x421fc3[_0x598de0][_0x1d10('0xe')]]);if(_0x4c4881[_0x1d10('0x6')]){_0xbdde11={};_0xbdde11[_0x4c4881[_0x1d10('0xa9')]]=_0x421fc3[_0x598de0][_0x1d10('0xa')];_0x132507[_0x1d10('0x93')](_0xbdde11);}else{if(!_0x3651a9[_0x1d10('0xa4')]['id'])_0x3651a9['where']['id']=[];_0x421fc3[_0x598de0][_0x1d10('0xa')][_0x1d10('0xaa')](function(_0x5c23cf){_0x3651a9[_0x1d10('0xa4')]['id'][_0x1d10('0x93')](_0x5c23cf);});}}}if(!_[_0x1d10('0x91')](_0x132507)){_0x3651a9[_0x1d10('0xa4')]=_['merge'](_0x3651a9['where'],{'$and':{'$or':_0x132507}});}_0x3651a9=_[_0x1d10('0xa6')]({},_0x3651a9,_0x28ba70['options']);if(_0x222232&&!_0x222232['autoAssociation']&&_0x2fd6d6['childModel']===_0x1d10('0x76')){if(_0x28ba70[_0x1d10('0x89')]['includeAll']){_0x3651a9[_0x1d10('0xab')]=[{'all':!![]}];}return _0xaa1d24[_0x2fd6d6[_0x1d10('0x14')]][_0x1d10('0x8')](_0x3651a9)['then'](function(_0x128351){var _0x240995=[];_0x128351[_0x1d10('0xaa')](function(_0x14f062){var _0x2868bd;switch(_0x14f062[_0x1d10('0xac')]){case'default':_0x2868bd=_[_0x1d10('0x95')](_0x222232['associatedResources'],function(_0x4cfb75){return _0x4cfb75['id']===_0x14f062[_0x1d10('0x78')]&&_0x4cfb75[_0x1d10('0x11')]==='DefaultReports';});break;case _0x1d10('0xad'):_0x2868bd=_[_0x1d10('0x95')](_0x222232['associatedResources'],function(_0xa253b0){return _0xa253b0['id']===_0x14f062[_0x1d10('0x78')]&&_0xa253b0[_0x1d10('0x11')]===_0x1d10('0xae');});break;}if(_0x2868bd)_0x240995[_0x1d10('0x93')](_0x14f062);});_0x2ff701[_0x1d10('0xaf')]=_0x240995[_0x1d10('0x92')];_0x2ff701[_0x1d10('0xb0')]=_0x240995;return _0x2ff701;});}else{return _0xaa1d24[_0x2fd6d6[_0x1d10('0x14')]]['count']({'where':_0x3651a9[_0x1d10('0xa4')]})[_0x1d10('0x9')](function(_0x17e85d){_0x2ff701[_0x1d10('0xaf')]=_0x17e85d;if(_0x28ba70[_0x1d10('0x89')][_0x1d10('0xb1')]){if(_0x2fd6d6[_0x1d10('0x14')]==='CmContact'){_0x3651a9['include']=[{'model':_0xaa1d24[_0x1d10('0x6c')],'as':_0x1d10('0xb2'),'attributes':['id',_0x1d10('0xe'),_0x1d10('0xb3')],'required':_0x28ba70['query'][_0x1d10('0xb4')]?!![]:![]},{'model':_0xaa1d24[_0x1d10('0x6c')],'as':'ThroughTags','attributes':['id',_0x1d10('0xe'),_0x1d10('0xb3')],'through':_0x28ba70[_0x1d10('0x89')][_0x1d10('0xb4')]?{'attributes':[],'where':{'TagId':_0x28ba70[_0x1d10('0x89')][_0x1d10('0xb4')]||undefined}}:{},'required':_0x28ba70['query']['tag']?!![]:![]}];}else{_0x3651a9['include']=[{'all':!![]}];}}return _0xaa1d24[_0x2fd6d6[_0x1d10('0x14')]][_0x1d10('0x8')](_0x3651a9);})[_0x1d10('0x9')](function(_0x57cbc8){_0x2ff701['rows']=_0x57cbc8;if(_0x7c500c==='Agents'&&_0x28ba70[_0x1d10('0x89')][_0x1d10('0xb5')]===_0x1d10('0xb6')){var _0x465e9d=[];for(var _0x3a6f25=0x0;_0x3a6f25<_0x2ff701[_0x1d10('0xb0')][_0x1d10('0x92')];_0x3a6f25++){_0x465e9d[_0x1d10('0x93')](_0x151ffb(_0x1d10('0xb7'),_0x2ff701['rows'][_0x3a6f25][_0x1d10('0xb8')]));_0x465e9d[_0x1d10('0x93')](_0x151ffb(_0x1d10('0xb9'),_0x2ff701[_0x1d10('0xb0')][_0x3a6f25]['dataValues']));_0x465e9d['push'](_0x151ffb('fax',_0x2ff701[_0x1d10('0xb0')][_0x3a6f25][_0x1d10('0xb8')]));_0x465e9d['push'](_0x151ffb('mail',_0x2ff701[_0x1d10('0xb0')][_0x3a6f25]['dataValues']));_0x465e9d['push'](_0x151ffb(_0x1d10('0xba'),_0x2ff701[_0x1d10('0xb0')][_0x3a6f25][_0x1d10('0xb8')]));_0x465e9d[_0x1d10('0x93')](_0x151ffb(_0x1d10('0xbb'),_0x2ff701[_0x1d10('0xb0')][_0x3a6f25][_0x1d10('0xb8')]));}return Promise['all'](_0x465e9d)['then'](function(){return _0x2ff701;});}return _0x2ff701;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 25f56eb..5b0128e 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 _0xe08b=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x40b61c,_0x13015c){var _0x29ea9b=function(_0xfcadb6){while(--_0xfcadb6){_0x40b61c['push'](_0x40b61c['shift']());}};_0x29ea9b(++_0x13015c);}(_0xe08b,0x10e));var _0xbe08=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe08b[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xbe08('0x0'));var util=require('util');var moment=require(_0xbe08('0x1'));var BPromise=require(_0xbe08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe08('0x3'));var db=require(_0xbe08('0x4'))['db'];var utils=require(_0xbe08('0x5'));var logger=require(_0xbe08('0x6'))(_0xbe08('0x7'));var config=require(_0xbe08('0x8'));var jayson=require(_0xbe08('0x9'));var client=jayson[_0xbe08('0xa')][_0xbe08('0xb')]({'port':0x232a});config[_0xbe08('0xc')]=_[_0xbe08('0xd')](config[_0xbe08('0xc')],{'host':_0xbe08('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe08('0xc')]));require(_0xbe08('0xf'))['register'](socket);function respondWithRpcPromise(_0xb4e69a,_0xed8e0c,_0x47ca8d){return new BPromise(function(_0xc5824c,_0x202fec){return client['request'](_0xb4e69a,_0x47ca8d)[_0xbe08('0x10')](function(_0x133725){logger[_0xbe08('0x11')](_0xbe08('0x12'),_0xed8e0c,'request\x20sent');logger[_0xbe08('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'),JSON[_0xbe08('0x15')](_0x133725));if(_0x133725[_0xbe08('0x16')]){if(_0x133725[_0xbe08('0x16')][_0xbe08('0x17')]===0x1f4){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0x202fec(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0xc5824c(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}else{logger[_0xbe08('0x11')]('UserProfile,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'));_0xc5824c(_0x133725[_0xbe08('0x19')][_0xbe08('0x18')]);}})[_0xbe08('0x1a')](function(_0x1c9379){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x1c9379);_0x202fec(_0x1c9379);});});} \ No newline at end of file +var _0x10ad=['jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x10ad,0xf4));var _0xd10a=function(_0x1bf015,_0x340cc2){_0x1bf015=_0x1bf015-0x0;var _0x346543=_0x10ad[_0x1bf015];return _0x346543;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd10a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x1'));var db=require(_0xd10a('0x2'))['db'];var utils=require(_0xd10a('0x3'));var logger=require(_0xd10a('0x4'))('rpc');var config=require(_0xd10a('0x5'));var jayson=require(_0xd10a('0x6'));var client=jayson[_0xd10a('0x7')][_0xd10a('0x8')]({'port':0x232a});config[_0xd10a('0x9')]=_[_0xd10a('0xa')](config[_0xd10a('0x9')],{'host':_0xd10a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd10a('0xc'))['register'](socket);function respondWithRpcPromise(_0xd5a84c,_0x356373,_0x2ab9dd){return new BPromise(function(_0x1bce80,_0x57f843){return client[_0xd10a('0xd')](_0xd5a84c,_0x2ab9dd)[_0xd10a('0xe')](function(_0x187f4a){logger['info'](_0xd10a('0xf'),_0x356373,_0xd10a('0x10'));logger[_0xd10a('0x11')](_0xd10a('0x12'),_0x356373,_0xd10a('0x10'),JSON[_0xd10a('0x13')](_0x187f4a));if(_0x187f4a['error']){if(_0x187f4a['error'][_0xd10a('0x14')]===0x1f4){logger[_0xd10a('0x15')](_0xd10a('0xf'),_0x356373,_0x187f4a[_0xd10a('0x15')]['message']);return _0x57f843(_0x187f4a['error'][_0xd10a('0x16')]);}logger[_0xd10a('0x15')](_0xd10a('0xf'),_0x356373,_0x187f4a[_0xd10a('0x15')][_0xd10a('0x16')]);return _0x1bce80(_0x187f4a[_0xd10a('0x15')][_0xd10a('0x16')]);}else{logger[_0xd10a('0x17')](_0xd10a('0xf'),_0x356373,'request\x20sent');_0x1bce80(_0x187f4a['result'][_0xd10a('0x16')]);}})[_0xd10a('0x18')](function(_0x4a0220){logger['error']('UserProfile,\x20%s,\x20%s',_0x356373,_0x4a0220);_0x57f843(_0x4a0220);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index aee6c80..594c60b 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 _0xc810=['save','update','emit','removeListener','register','length','./userProfile.events'];(function(_0xe2ebaa,_0x138483){var _0x563838=function(_0x542a4c){while(--_0x542a4c){_0xe2ebaa['push'](_0xe2ebaa['shift']());}};_0x563838(++_0x138483);}(_0xc810,0x179));var _0x0c81=function(_0x32594a,_0x4a0c11){_0x32594a=_0x32594a-0x0;var _0x2f9c7a=_0xc810[_0x32594a];return _0x2f9c7a;};'use strict';var UserProfileEvents=require(_0x0c81('0x0'));var events=[_0x0c81('0x1'),'remove',_0x0c81('0x2')];function createListener(_0x3c9106,_0x471553){return function(_0x3e26cd){_0x471553[_0x0c81('0x3')](_0x3c9106,_0x3e26cd);};}function removeListener(_0x893625,_0x4dc0aa){return function(){UserProfileEvents[_0x0c81('0x4')](_0x893625,_0x4dc0aa);};}exports[_0x0c81('0x5')]=function(_0x12e79b){for(var _0x2151ff=0x0,_0x19266e=events[_0x0c81('0x6')];_0x2151ff<_0x19266e;_0x2151ff++){var _0x5ee6f3=events[_0x2151ff];var _0x4063ef=createListener('userProfile:'+_0x5ee6f3,_0x12e79b);UserProfileEvents['on'](_0x5ee6f3,_0x4063ef);}}; \ No newline at end of file +var _0x24b7=['removeListener','register','./userProfile.events','save','update','emit'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0x24b7,0x8c));var _0x724b=function(_0x3ba6fe,_0x111305){_0x3ba6fe=_0x3ba6fe-0x0;var _0x63f3b4=_0x24b7[_0x3ba6fe];return _0x63f3b4;};'use strict';var UserProfileEvents=require(_0x724b('0x0'));var events=[_0x724b('0x1'),'remove',_0x724b('0x2')];function createListener(_0x5779d6,_0x5ded58){return function(_0x35251c){_0x5ded58[_0x724b('0x3')](_0x5779d6,_0x35251c);};}function removeListener(_0x4f0abd,_0x5a01e1){return function(){UserProfileEvents[_0x724b('0x4')](_0x4f0abd,_0x5a01e1);};}exports[_0x724b('0x5')]=function(_0x485ab4){for(var _0x323335=0x0,_0x53ee6e=events['length'];_0x323335<_0x53ee6e;_0x323335++){var _0x46a779=events[_0x323335];var _0xfc8939=createListener('userProfile:'+_0x46a779,_0x485ab4);UserProfileEvents['on'](_0x46a779,_0xfc8939);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f398047..8bbd379 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 _0xbfab=['express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','connect-timeout'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xbfab,0x10d));var _0xbbfa=function(_0x11f0e3,_0x5170bc){_0x11f0e3=_0x11f0e3-0x0;var _0x2892e8=_0xbfab[_0x11f0e3];return _0x2892e8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbbfa('0x0'));var express=require(_0xbbfa('0x1'));var router=express[_0xbbfa('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbbfa('0x3'));var config=require(_0xbbfa('0x4'));var controller=require(_0xbbfa('0x5'));router[_0xbbfa('0x6')]('/',auth[_0xbbfa('0x7')](),controller['index']);router['get'](_0xbbfa('0x8'),auth['isAuthenticated'](),controller[_0xbbfa('0x9')]);router[_0xbbfa('0x6')](_0xbbfa('0xa'),auth[_0xbbfa('0x7')](),controller[_0xbbfa('0xb')]);router[_0xbbfa('0xc')]('/',auth[_0xbbfa('0x7')](),controller[_0xbbfa('0xd')]);router[_0xbbfa('0xe')]('/:id',auth[_0xbbfa('0x7')](),controller[_0xbbfa('0xf')]);router[_0xbbfa('0x10')](_0xbbfa('0xa'),auth[_0xbbfa('0x7')](),controller[_0xbbfa('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe0ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','post','create','update','multer','util','path'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xe0ae,0xb8));var _0xee0a=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0xe0ae[_0x547e20];return _0x359171;};'use strict';var multer=require(_0xee0a('0x0'));var util=require(_0xee0a('0x1'));var path=require(_0xee0a('0x2'));var timeout=require(_0xee0a('0x3'));var express=require(_0xee0a('0x4'));var router=express[_0xee0a('0x5')]();var fs_extra=require(_0xee0a('0x6'));var auth=require(_0xee0a('0x7'));var interaction=require(_0xee0a('0x8'));var config=require(_0xee0a('0x9'));var controller=require('./userProfileResource.controller');router[_0xee0a('0xa')]('/',auth[_0xee0a('0xb')](),controller['index']);router[_0xee0a('0xa')](_0xee0a('0xc'),auth[_0xee0a('0xb')](),controller['describe']);router['get'](_0xee0a('0xd'),auth[_0xee0a('0xb')](),controller['show']);router[_0xee0a('0xe')]('/',auth['isAuthenticated'](),controller[_0xee0a('0xf')]);router['put'](_0xee0a('0xd'),auth[_0xee0a('0xb')](),controller[_0xee0a('0x10')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index db509d4..d5cb9ac 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 _0x0740=['STRING','sequelize','exports'];(function(_0x41c0d8,_0x8f2a39){var _0x1f9589=function(_0x1dc8b4){while(--_0x1dc8b4){_0x41c0d8['push'](_0x41c0d8['shift']());}};_0x1f9589(++_0x8f2a39);}(_0x0740,0x13c));var _0x0074=function(_0x3c61ae,_0x8fd215){_0x3c61ae=_0x3c61ae-0x0;var _0x143a27=_0x0740[_0x3c61ae];return _0x143a27;};'use strict';var Sequelize=require(_0x0074('0x0'));module[_0x0074('0x1')]={'name':{'type':Sequelize[_0x0074('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x0074('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x714c=['exports','STRING','INTEGER','sequelize'];(function(_0xddef1e,_0x43b917){var _0x64b0fc=function(_0x1228e4){while(--_0x1228e4){_0xddef1e['push'](_0xddef1e['shift']());}};_0x64b0fc(++_0x43b917);}(_0x714c,0x9b));var _0xc714=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x714c[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0xc714('0x0'));module[_0xc714('0x1')]={'name':{'type':Sequelize[_0xc714('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc714('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc714('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index b3c6da2..c318fcc 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 _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x5ef80b,_0x4d2a07){var _0x2c9776=function(_0x3865da){while(--_0x3865da){_0x5ef80b['push'](_0x5ef80b['shift']());}};_0x2c9776(++_0x4d2a07);}(_0x57ca,0x108));var _0xa57c=function(_0x31c6e3,_0x2c0d67){_0x31c6e3=_0x31c6e3-0x0;var _0xe3771c=_0x57ca[_0x31c6e3];return _0xe3771c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));}; \ No newline at end of file +var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9536,0x179));var _0x6953=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x9536[_0x27dba4];return _0x35ec9d;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 301442b..c8179bd 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 _0x3326=['define','UserProfileResource','lodash','util','api','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports'];(function(_0x982c90,_0x239dd0){var _0x599a41=function(_0xf8edc3){while(--_0xf8edc3){_0x982c90['push'](_0x982c90['shift']());}};_0x599a41(++_0x239dd0);}(_0x3326,0x91));var _0x6332=function(_0xa98815,_0x1211a3){_0xa98815=_0xa98815-0x0;var _0x1f33d3=_0x3326[_0xa98815];return _0x1f33d3;};'use strict';var _=require(_0x6332('0x0'));var util=require(_0x6332('0x1'));var logger=require('../../config/logger')(_0x6332('0x2'));var moment=require('moment');var BPromise=require(_0x6332('0x3'));var rp=require(_0x6332('0x4'));var fs=require('fs');var path=require(_0x6332('0x5'));var rimraf=require(_0x6332('0x6'));var config=require('../../config/environment');var attributes=require(_0x6332('0x7'));module[_0x6332('0x8')]=function(_0x2bc47f,_0x3d4cff){return _0x2bc47f[_0x6332('0x9')](_0x6332('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7adc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','lodash','util','api'];(function(_0x621e2b,_0x5714ea){var _0x189c74=function(_0x5bb1fc){while(--_0x5bb1fc){_0x621e2b['push'](_0x621e2b['shift']());}};_0x189c74(++_0x5714ea);}(_0x7adc,0x138));var _0xc7ad=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0x7adc[_0x39780c];return _0x53c19b;};'use strict';var _=require(_0xc7ad('0x0'));var util=require(_0xc7ad('0x1'));var logger=require('../../config/logger')(_0xc7ad('0x2'));var moment=require(_0xc7ad('0x3'));var BPromise=require(_0xc7ad('0x4'));var rp=require(_0xc7ad('0x5'));var fs=require('fs');var path=require(_0xc7ad('0x6'));var rimraf=require(_0xc7ad('0x7'));var config=require(_0xc7ad('0x8'));var attributes=require(_0xc7ad('0x9'));module[_0xc7ad('0xa')]=function(_0x2c269c,_0x1bf483){return _0x2c269c[_0xc7ad('0xb')]('UserProfileResource',attributes,{'tableName':_0xc7ad('0xc'),'paranoid':![],'indexes':[{'name':_0xc7ad('0xd'),'fields':[_0xc7ad('0xe'),'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 5fb6f5f..14688cc 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 _0x12df=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x176e4e,_0x34196a){var _0x4c5439=function(_0x37e0af){while(--_0x37e0af){_0x176e4e['push'](_0x176e4e['shift']());}};_0x4c5439(++_0x34196a);}(_0x12df,0x135));var _0xf12d=function(_0x20f6e4,_0x5b3836){_0x20f6e4=_0x20f6e4-0x0;var _0x5dcb93=_0x12df[_0x20f6e4];return _0x5dcb93;};'use strict';var _=require('lodash');var util=require(_0xf12d('0x0'));var moment=require(_0xf12d('0x1'));var BPromise=require(_0xf12d('0x2'));var rs=require(_0xf12d('0x3'));var fs=require('fs');var Redis=require(_0xf12d('0x4'));var db=require(_0xf12d('0x5'))['db'];var utils=require(_0xf12d('0x6'));var logger=require(_0xf12d('0x7'))(_0xf12d('0x8'));var config=require(_0xf12d('0x9'));var jayson=require(_0xf12d('0xa'));var client=jayson[_0xf12d('0xb')][_0xf12d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a9ecd,_0x565be3,_0x1a2ddf){return new BPromise(function(_0x40e69c,_0x3e340a){return client['request'](_0x2a9ecd,_0x1a2ddf)[_0xf12d('0xd')](function(_0x4f64a6){logger[_0xf12d('0xe')](_0xf12d('0xf'),_0x565be3,_0xf12d('0x10'));logger['debug'](_0xf12d('0x11'),_0x565be3,'request\x20sent',JSON[_0xf12d('0x12')](_0x4f64a6));if(_0x4f64a6['error']){if(_0x4f64a6[_0xf12d('0x13')][_0xf12d('0x14')]===0x1f4){logger['error'](_0xf12d('0xf'),_0x565be3,_0x4f64a6[_0xf12d('0x13')][_0xf12d('0x15')]);return _0x3e340a(_0x4f64a6[_0xf12d('0x13')]['message']);}logger[_0xf12d('0x13')](_0xf12d('0xf'),_0x565be3,_0x4f64a6['error']['message']);return _0x40e69c(_0x4f64a6[_0xf12d('0x13')]['message']);}else{logger[_0xf12d('0xe')](_0xf12d('0xf'),_0x565be3,_0xf12d('0x10'));_0x40e69c(_0x4f64a6[_0xf12d('0x16')][_0xf12d('0x15')]);}})[_0xf12d('0x17')](function(_0x187975){logger['error'](_0xf12d('0xf'),_0x565be3,_0x187975);_0x3e340a(_0x187975);});});} \ No newline at end of file +var _0x3afd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x3afd,0xe2));var _0xd3af=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0x3afd[_0x90a39a];return _0x2b62f7;};'use strict';var _=require(_0xd3af('0x0'));var util=require('util');var moment=require(_0xd3af('0x1'));var BPromise=require(_0xd3af('0x2'));var rs=require(_0xd3af('0x3'));var fs=require('fs');var Redis=require(_0xd3af('0x4'));var db=require(_0xd3af('0x5'))['db'];var utils=require(_0xd3af('0x6'));var logger=require(_0xd3af('0x7'))(_0xd3af('0x8'));var config=require(_0xd3af('0x9'));var jayson=require(_0xd3af('0xa'));var client=jayson[_0xd3af('0xb')][_0xd3af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xca127a,_0x49ec90,_0x2b6f3a){return new BPromise(function(_0x32e267,_0x53717e){return client[_0xd3af('0xd')](_0xca127a,_0x2b6f3a)['then'](function(_0x2a3c0a){logger[_0xd3af('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x49ec90,_0xd3af('0xf'));logger['debug'](_0xd3af('0x10'),_0x49ec90,'request\x20sent',JSON[_0xd3af('0x11')](_0x2a3c0a));if(_0x2a3c0a[_0xd3af('0x12')]){if(_0x2a3c0a[_0xd3af('0x12')][_0xd3af('0x13')]===0x1f4){logger[_0xd3af('0x12')](_0xd3af('0x14'),_0x49ec90,_0x2a3c0a['error'][_0xd3af('0x15')]);return _0x53717e(_0x2a3c0a['error'][_0xd3af('0x15')]);}logger[_0xd3af('0x12')](_0xd3af('0x14'),_0x49ec90,_0x2a3c0a['error'][_0xd3af('0x15')]);return _0x32e267(_0x2a3c0a['error'][_0xd3af('0x15')]);}else{logger[_0xd3af('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x49ec90,_0xd3af('0xf'));_0x32e267(_0x2a3c0a[_0xd3af('0x16')][_0xd3af('0x15')]);}})['catch'](function(_0x6f9008){logger['error'](_0xd3af('0x14'),_0x49ec90,_0x6f9008);_0x53717e(_0x6f9008);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 59803cc..96d0161 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 _0x4475=['destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update'];(function(_0x25cf6f,_0x2a8dc5){var _0x1131ac=function(_0x9be10){while(--_0x9be10){_0x25cf6f['push'](_0x25cf6f['shift']());}};_0x1131ac(++_0x2a8dc5);}(_0x4475,0xef));var _0x5447=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4475[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x5447('0x0'));var util=require('util');var path=require(_0x5447('0x1'));var timeout=require(_0x5447('0x2'));var express=require('express');var router=express[_0x5447('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5447('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5447('0x5'));var controller=require(_0x5447('0x6'));router[_0x5447('0x7')]('/',auth[_0x5447('0x8')](),controller['index']);router['get'](_0x5447('0x9'),auth[_0x5447('0x8')](),controller['describe']);router[_0x5447('0x7')](_0x5447('0xa'),auth[_0x5447('0x8')](),controller[_0x5447('0xb')]);router[_0x5447('0xc')]('/',auth[_0x5447('0x8')](),controller[_0x5447('0xd')]);router[_0x5447('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5447('0xf')]);router['delete']('/:id',auth[_0x5447('0x8')](),controller[_0x5447('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa180=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','show','post','put','update','destroy','multer'];(function(_0x2e548a,_0x137ac5){var _0x11365c=function(_0x48aa7d){while(--_0x48aa7d){_0x2e548a['push'](_0x2e548a['shift']());}};_0x11365c(++_0x137ac5);}(_0xa180,0x179));var _0x0a18=function(_0x558d67,_0x2378e4){_0x558d67=_0x558d67-0x0;var _0x3562a7=_0xa180[_0x558d67];return _0x3562a7;};'use strict';var multer=require(_0x0a18('0x0'));var util=require(_0x0a18('0x1'));var path=require(_0x0a18('0x2'));var timeout=require(_0x0a18('0x3'));var express=require('express');var router=express[_0x0a18('0x4')]();var fs_extra=require(_0x0a18('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0a18('0x6'));var config=require('../../config/environment');var controller=require(_0x0a18('0x7'));router[_0x0a18('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a18('0x9')]);router[_0x0a18('0x8')](_0x0a18('0xa'),auth[_0x0a18('0xb')](),controller[_0x0a18('0xc')]);router['get']('/:id',auth[_0x0a18('0xb')](),controller[_0x0a18('0xd')]);router[_0x0a18('0xe')]('/',auth[_0x0a18('0xb')](),controller['create']);router[_0x0a18('0xf')]('/:id',auth[_0x0a18('0xb')](),controller[_0x0a18('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a18('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f61a24d..b0363f6 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 _0x93e9=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x41ea3b,_0x4fd6dc){var _0xec816f=function(_0x38c2e5){while(--_0x38c2e5){_0x41ea3b['push'](_0x41ea3b['shift']());}};_0xec816f(++_0x4fd6dc);}(_0x93e9,0xcc));var _0x993e=function(_0x213455,_0x242d3c){_0x213455=_0x213455-0x0;var _0x320d12=_0x93e9[_0x213455];return _0x320d12;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x993e('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55f739){this[_0x993e('0x5')](_0x993e('0x6'),_0x55f739?_0x55f739[_0x993e('0x7')](''):[]);},'get':function(){return this[_0x993e('0x8')](_0x993e('0x6'))?this[_0x993e('0x8')](_0x993e('0x6'))[_0x993e('0x9')](''):[];}}}; \ No newline at end of file +var _0x955f=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x4266e6,_0x26ce4b){var _0xa42c36=function(_0x5bb52b){while(--_0x5bb52b){_0x4266e6['push'](_0x4266e6['shift']());}};_0xa42c36(++_0x26ce4b);}(_0x955f,0x1eb));var _0xf955=function(_0x350ff5,_0x5a72c0){_0x350ff5=_0x350ff5-0x0;var _0x350e4a=_0x955f[_0x350ff5];return _0x350e4a;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'name':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xf955('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xf955('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5d0c95){this[_0xf955('0x5')]('crudPermissions',_0x5d0c95?_0x5d0c95[_0xf955('0x6')](''):[]);},'get':function(){return this[_0xf955('0x7')](_0xf955('0x8'))?this['getDataValue'](_0xf955('0x8'))[_0xf955('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 0769509..bc99b69 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 _0x36c9=['update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','params','model','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x140c30,_0x1ed22b){var _0x11d9db=function(_0x5cb8c3){while(--_0x5cb8c3){_0x140c30['push'](_0x140c30['shift']());}};_0x11d9db(++_0x1ed22b);}(_0x36c9,0x6e));var _0x936c=function(_0x4e79b8,_0x4dea29){_0x4e79b8=_0x4e79b8-0x0;var _0x5849ea=_0x36c9[_0x4e79b8];return _0x5849ea;};'use strict';var emlformat=require(_0x936c('0x0'));var rimraf=require(_0x936c('0x1'));var zipdir=require(_0x936c('0x2'));var jsonpatch=require(_0x936c('0x3'));var rp=require(_0x936c('0x4'));var moment=require(_0x936c('0x5'));var BPromise=require(_0x936c('0x6'));var Mustache=require(_0x936c('0x7'));var util=require('util');var path=require(_0x936c('0x8'));var sox=require('sox');var csv=require(_0x936c('0x9'));var ejs=require(_0x936c('0xa'));var fs=require('fs');var fs_extra=require(_0x936c('0xb'));var _=require('lodash');var squel=require(_0x936c('0xc'));var crypto=require(_0x936c('0xd'));var jsforce=require(_0x936c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x936c('0xf'));var Papa=require(_0x936c('0x10'));var Redis=require('ioredis');var authService=require(_0x936c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x936c('0x12'));var hardwareService=require(_0x936c('0x13'));var logger=require('../../config/logger')(_0x936c('0x14'));var utils=require(_0x936c('0x15'));var config=require(_0x936c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x936c('0x17'))['db'];function respondWithStatusCode(_0x2b8777,_0x38dff8){_0x38dff8=_0x38dff8||0xcc;return function(_0x5c53e2){if(_0x5c53e2){return _0x2b8777[_0x936c('0x18')](_0x38dff8);}return _0x2b8777[_0x936c('0x19')](_0x38dff8)[_0x936c('0x1a')]();};}function respondWithResult(_0x2096ce,_0x233cf3){_0x233cf3=_0x233cf3||0xc8;return function(_0xc97b37){if(_0xc97b37){return _0x2096ce[_0x936c('0x19')](_0x233cf3)['json'](_0xc97b37);}};}function respondWithFilteredResult(_0x56df37,_0x5efef5){return function(_0x46ad9c){if(_0x46ad9c){var _0x202476=typeof _0x5efef5[_0x936c('0x1b')]===_0x936c('0x1c')&&typeof _0x5efef5[_0x936c('0x1d')]===_0x936c('0x1c');var _0x4b7d92=_0x46ad9c[_0x936c('0x1e')];var _0x439593=_0x202476?0x0:_0x5efef5['offset'];var _0x1817ba=_0x202476?_0x46ad9c['count']:_0x5efef5[_0x936c('0x1b')]+_0x5efef5[_0x936c('0x1d')];var _0x3d59a2;if(_0x1817ba>=_0x4b7d92){_0x1817ba=_0x4b7d92;_0x3d59a2=0xc8;}else{_0x3d59a2=0xce;}_0x56df37[_0x936c('0x19')](_0x3d59a2);return _0x56df37[_0x936c('0x1f')](_0x936c('0x20'),_0x439593+'-'+_0x1817ba+'/'+_0x4b7d92)[_0x936c('0x21')](_0x46ad9c);}return null;};}function patchUpdates(_0x16cd12){return function(_0x3de980){try{jsonpatch[_0x936c('0x22')](_0x3de980,_0x16cd12,!![]);}catch(_0x3b5422){return BPromise[_0x936c('0x23')](_0x3b5422);}return _0x3de980['save']();};}function saveUpdates(_0x1ef848,_0x5f5d0a){return function(_0x4397f4){if(_0x4397f4){return _0x4397f4[_0x936c('0x24')](_0x1ef848)[_0x936c('0x25')](function(_0x523ed3){return _0x523ed3;});}return null;};}function removeEntity(_0x6e1c3f,_0x5d16a4){return function(_0x28626d){if(_0x28626d){return _0x28626d[_0x936c('0x26')]()[_0x936c('0x25')](function(){_0x6e1c3f[_0x936c('0x19')](0xcc)[_0x936c('0x1a')]();});}};}function handleEntityNotFound(_0x256f9c,_0x4a6e29){return function(_0x14753d){if(!_0x14753d){_0x256f9c[_0x936c('0x18')](0x194);}return _0x14753d;};}function handleError(_0x4e20de,_0x90a424){_0x90a424=_0x90a424||0x1f4;return function(_0x470cff){logger[_0x936c('0x27')](_0x470cff[_0x936c('0x28')]);if(_0x470cff[_0x936c('0x29')]){delete _0x470cff['name'];}_0x4e20de[_0x936c('0x19')](_0x90a424)[_0x936c('0x2a')](_0x470cff);};}exports[_0x936c('0x2b')]=function(_0x34fd75,_0x5507f6){var _0xeffb9d={},_0x256787={},_0x2cae24={'count':0x0,'rows':[]};var _0x5946ed=_[_0x936c('0x2c')](db[_0x936c('0x2d')][_0x936c('0x2e')],function(_0x8d715a){return{'name':_0x8d715a['fieldName'],'type':_0x8d715a[_0x936c('0x2f')][_0x936c('0x30')]};});_0x256787['model']=_[_0x936c('0x2c')](_0x5946ed,_0x936c('0x29'));_0x256787[_0x936c('0x31')]=_[_0x936c('0x32')](_0x34fd75['query']);_0x256787[_0x936c('0x33')]=_[_0x936c('0x34')](_0x256787['model'],_0x256787['query']);_0xeffb9d['attributes']=_[_0x936c('0x34')](_0x256787['model'],qs[_0x936c('0x35')](_0x34fd75[_0x936c('0x31')][_0x936c('0x35')]));_0xeffb9d['attributes']=_0xeffb9d['attributes'][_0x936c('0x36')]?_0xeffb9d[_0x936c('0x37')]:_0x256787['model'];if(!_0x34fd75[_0x936c('0x31')]['hasOwnProperty'](_0x936c('0x38'))){_0xeffb9d[_0x936c('0x1d')]=qs[_0x936c('0x1d')](_0x34fd75['query'][_0x936c('0x1d')]);_0xeffb9d[_0x936c('0x1b')]=qs['offset'](_0x34fd75[_0x936c('0x31')]['offset']);}_0xeffb9d[_0x936c('0x39')]=qs[_0x936c('0x3a')](_0x34fd75[_0x936c('0x31')][_0x936c('0x3a')]);_0xeffb9d[_0x936c('0x3b')]=qs['filters'](_['pick'](_0x34fd75[_0x936c('0x31')],_0x256787['filters']),_0x5946ed);if(_0x34fd75[_0x936c('0x31')][_0x936c('0x3c')]){_0xeffb9d['where']=_[_0x936c('0x3d')](_0xeffb9d[_0x936c('0x3b')],{'$or':_[_0x936c('0x2c')](_0x5946ed,function(_0x4af955){if(_0x4af955[_0x936c('0x2f')]!==_0x936c('0x3e')){var _0x46071b={};_0x46071b[_0x4af955[_0x936c('0x29')]]={'$like':'%'+_0x34fd75[_0x936c('0x31')][_0x936c('0x3c')]+'%'};return _0x46071b;}})});}_0xeffb9d=_[_0x936c('0x3d')]({},_0xeffb9d,_0x34fd75[_0x936c('0x3f')]);var _0x164f63={'where':_0xeffb9d[_0x936c('0x3b')]};return db['UserProfileSection'][_0x936c('0x1e')](_0x164f63)[_0x936c('0x25')](function(_0x56dd12){_0x2cae24[_0x936c('0x1e')]=_0x56dd12;if(_0x34fd75[_0x936c('0x31')]['includeAll']){_0xeffb9d[_0x936c('0x40')]=[{'all':!![]}];}return db[_0x936c('0x2d')]['findAll'](_0xeffb9d);})[_0x936c('0x25')](function(_0x5c1038){_0x2cae24[_0x936c('0x41')]=_0x5c1038;return _0x2cae24;})['then'](respondWithFilteredResult(_0x5507f6,_0xeffb9d))[_0x936c('0x42')](handleError(_0x5507f6,null));};exports['show']=function(_0x1129c7,_0x3fce08){var _0x18320f={'raw':![],'where':{'id':_0x1129c7[_0x936c('0x43')]['id']}},_0x14ab05={};_0x14ab05['model']=_['keys'](db[_0x936c('0x2d')][_0x936c('0x2e')]);_0x14ab05[_0x936c('0x31')]=_[_0x936c('0x32')](_0x1129c7['query']);_0x14ab05[_0x936c('0x33')]=_[_0x936c('0x34')](_0x14ab05[_0x936c('0x44')],_0x14ab05[_0x936c('0x31')]);_0x18320f['attributes']=_[_0x936c('0x34')](_0x14ab05['model'],qs['fields'](_0x1129c7[_0x936c('0x31')]['fields']));_0x18320f[_0x936c('0x37')]=_0x18320f[_0x936c('0x37')][_0x936c('0x36')]?_0x18320f['attributes']:_0x14ab05[_0x936c('0x44')];if(_0x1129c7[_0x936c('0x31')]['includeAll']){_0x18320f['include']=[{'all':!![]}];}_0x18320f=_[_0x936c('0x3d')]({},_0x18320f,_0x1129c7[_0x936c('0x3f')]);return db['UserProfileSection'][_0x936c('0x45')](_0x18320f)[_0x936c('0x25')](handleEntityNotFound(_0x3fce08,null))[_0x936c('0x25')](respondWithResult(_0x3fce08,null))['catch'](handleError(_0x3fce08,null));};exports[_0x936c('0x46')]=function(_0x450cde,_0x473d6a){return db[_0x936c('0x2d')][_0x936c('0x46')](_0x450cde[_0x936c('0x47')],{})[_0x936c('0x25')](respondWithResult(_0x473d6a,0xc9))[_0x936c('0x42')](handleError(_0x473d6a,null));};exports['update']=function(_0x1e68aa,_0x7757ca){if(_0x1e68aa[_0x936c('0x47')]['id']){delete _0x1e68aa[_0x936c('0x47')]['id'];}return db[_0x936c('0x2d')][_0x936c('0x45')]({'where':{'id':_0x1e68aa['params']['id']}})[_0x936c('0x25')](handleEntityNotFound(_0x7757ca,null))[_0x936c('0x25')](saveUpdates(_0x1e68aa['body'],null))[_0x936c('0x25')](respondWithResult(_0x7757ca,null))['catch'](handleError(_0x7757ca,null));};exports['destroy']=function(_0x13fa47,_0x1cfeae){return db[_0x936c('0x2d')]['find']({'where':{'id':_0x13fa47[_0x936c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1cfeae,null))['then'](removeEntity(_0x1cfeae,null))[_0x936c('0x42')](handleError(_0x1cfeae,null));};exports[_0x936c('0x48')]=function(_0x1fbf47,_0x3f1836){return db[_0x936c('0x2d')][_0x936c('0x48')]()['then'](respondWithResult(_0x3f1836,null))[_0x936c('0x42')](handleError(_0x3f1836,null));}; \ No newline at end of file +var _0xf0a4=['catch','show','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x30ba8b,_0x3fb4cf){var _0x45396a=function(_0x368041){while(--_0x368041){_0x30ba8b['push'](_0x30ba8b['shift']());}};_0x45396a(++_0x3fb4cf);}(_0xf0a4,0xed));var _0x4f0a=function(_0x17d7a7,_0x5cf357){_0x17d7a7=_0x17d7a7-0x0;var _0x29f3fe=_0xf0a4[_0x17d7a7];return _0x29f3fe;};'use strict';var emlformat=require(_0x4f0a('0x0'));var rimraf=require(_0x4f0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0a('0x2'));var moment=require(_0x4f0a('0x3'));var BPromise=require(_0x4f0a('0x4'));var Mustache=require('mustache');var util=require(_0x4f0a('0x5'));var path=require(_0x4f0a('0x6'));var sox=require(_0x4f0a('0x7'));var csv=require(_0x4f0a('0x8'));var ejs=require(_0x4f0a('0x9'));var fs=require('fs');var fs_extra=require(_0x4f0a('0xa'));var _=require(_0x4f0a('0xb'));var squel=require(_0x4f0a('0xc'));var crypto=require(_0x4f0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4f0a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4f0a('0xf'));var Redis=require(_0x4f0a('0x10'));var authService=require(_0x4f0a('0x11'));var qs=require(_0x4f0a('0x12'));var as=require(_0x4f0a('0x13'));var hardwareService=require(_0x4f0a('0x14'));var logger=require(_0x4f0a('0x15'))('api');var utils=require(_0x4f0a('0x16'));var config=require(_0x4f0a('0x17'));var licenseUtil=require(_0x4f0a('0x18'));var db=require(_0x4f0a('0x19'))['db'];function respondWithStatusCode(_0x237cb3,_0x3ceb68){_0x3ceb68=_0x3ceb68||0xcc;return function(_0x4dc909){if(_0x4dc909){return _0x237cb3[_0x4f0a('0x1a')](_0x3ceb68);}return _0x237cb3['status'](_0x3ceb68)[_0x4f0a('0x1b')]();};}function respondWithResult(_0x19001c,_0xf84b97){_0xf84b97=_0xf84b97||0xc8;return function(_0x584e97){if(_0x584e97){return _0x19001c['status'](_0xf84b97)[_0x4f0a('0x1c')](_0x584e97);}};}function respondWithFilteredResult(_0x22fef0,_0x1694ef){return function(_0x5ac8cc){if(_0x5ac8cc){var _0x1451c0=typeof _0x1694ef[_0x4f0a('0x1d')]===_0x4f0a('0x1e')&&typeof _0x1694ef[_0x4f0a('0x1f')]===_0x4f0a('0x1e');var _0x57ab9d=_0x5ac8cc[_0x4f0a('0x20')];var _0x2f0e9b=_0x1451c0?0x0:_0x1694ef[_0x4f0a('0x1d')];var _0x34caef=_0x1451c0?_0x5ac8cc[_0x4f0a('0x20')]:_0x1694ef[_0x4f0a('0x1d')]+_0x1694ef[_0x4f0a('0x1f')];var _0x3e7069;if(_0x34caef>=_0x57ab9d){_0x34caef=_0x57ab9d;_0x3e7069=0xc8;}else{_0x3e7069=0xce;}_0x22fef0[_0x4f0a('0x21')](_0x3e7069);return _0x22fef0[_0x4f0a('0x22')](_0x4f0a('0x23'),_0x2f0e9b+'-'+_0x34caef+'/'+_0x57ab9d)['json'](_0x5ac8cc);}return null;};}function patchUpdates(_0x1b40b6){return function(_0x96476b){try{jsonpatch[_0x4f0a('0x24')](_0x96476b,_0x1b40b6,!![]);}catch(_0x2f8fe2){return BPromise[_0x4f0a('0x25')](_0x2f8fe2);}return _0x96476b['save']();};}function saveUpdates(_0x4f2fda,_0x3730dc){return function(_0xfa84fd){if(_0xfa84fd){return _0xfa84fd['update'](_0x4f2fda)[_0x4f0a('0x26')](function(_0x9964bf){return _0x9964bf;});}return null;};}function removeEntity(_0x322348,_0x4b9b46){return function(_0x43d325){if(_0x43d325){return _0x43d325[_0x4f0a('0x27')]()[_0x4f0a('0x26')](function(){_0x322348[_0x4f0a('0x21')](0xcc)[_0x4f0a('0x1b')]();});}};}function handleEntityNotFound(_0xf17c6e,_0x4b7a28){return function(_0x3c83ec){if(!_0x3c83ec){_0xf17c6e[_0x4f0a('0x1a')](0x194);}return _0x3c83ec;};}function handleError(_0x40c374,_0x48dc6b){_0x48dc6b=_0x48dc6b||0x1f4;return function(_0x298b78){logger[_0x4f0a('0x28')](_0x298b78[_0x4f0a('0x29')]);if(_0x298b78[_0x4f0a('0x2a')]){delete _0x298b78['name'];}_0x40c374[_0x4f0a('0x21')](_0x48dc6b)[_0x4f0a('0x2b')](_0x298b78);};}exports[_0x4f0a('0x2c')]=function(_0x5912fb,_0x3cedff){var _0x1795b2={},_0x731c44={},_0x525b6b={'count':0x0,'rows':[]};var _0x519e9c=_['map'](db[_0x4f0a('0x2d')][_0x4f0a('0x2e')],function(_0x457728){return{'name':_0x457728[_0x4f0a('0x2f')],'type':_0x457728[_0x4f0a('0x30')][_0x4f0a('0x31')]};});_0x731c44['model']=_[_0x4f0a('0x32')](_0x519e9c,_0x4f0a('0x2a'));_0x731c44[_0x4f0a('0x33')]=_[_0x4f0a('0x34')](_0x5912fb['query']);_0x731c44[_0x4f0a('0x35')]=_['intersection'](_0x731c44[_0x4f0a('0x36')],_0x731c44[_0x4f0a('0x33')]);_0x1795b2[_0x4f0a('0x37')]=_[_0x4f0a('0x38')](_0x731c44[_0x4f0a('0x36')],qs[_0x4f0a('0x39')](_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x39')]));_0x1795b2[_0x4f0a('0x37')]=_0x1795b2[_0x4f0a('0x37')][_0x4f0a('0x3a')]?_0x1795b2['attributes']:_0x731c44[_0x4f0a('0x36')];if(!_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x3b')](_0x4f0a('0x3c'))){_0x1795b2[_0x4f0a('0x1f')]=qs[_0x4f0a('0x1f')](_0x5912fb[_0x4f0a('0x33')]['limit']);_0x1795b2['offset']=qs[_0x4f0a('0x1d')](_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x1d')]);}_0x1795b2['order']=qs['sort'](_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x3d')]);_0x1795b2['where']=qs[_0x4f0a('0x35')](_[_0x4f0a('0x3e')](_0x5912fb[_0x4f0a('0x33')],_0x731c44['filters']),_0x519e9c);if(_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x3f')]){_0x1795b2[_0x4f0a('0x40')]=_[_0x4f0a('0x41')](_0x1795b2[_0x4f0a('0x40')],{'$or':_[_0x4f0a('0x32')](_0x519e9c,function(_0x1f58f6){if(_0x1f58f6[_0x4f0a('0x30')]!==_0x4f0a('0x42')){var _0xe31251={};_0xe31251[_0x1f58f6['name']]={'$like':'%'+_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x3f')]+'%'};return _0xe31251;}})});}_0x1795b2=_['merge']({},_0x1795b2,_0x5912fb[_0x4f0a('0x43')]);var _0x488f27={'where':_0x1795b2['where']};return db[_0x4f0a('0x2d')][_0x4f0a('0x20')](_0x488f27)[_0x4f0a('0x26')](function(_0x130ee5){_0x525b6b['count']=_0x130ee5;if(_0x5912fb[_0x4f0a('0x33')][_0x4f0a('0x44')]){_0x1795b2[_0x4f0a('0x45')]=[{'all':!![]}];}return db[_0x4f0a('0x2d')]['findAll'](_0x1795b2);})[_0x4f0a('0x26')](function(_0x22f328){_0x525b6b[_0x4f0a('0x46')]=_0x22f328;return _0x525b6b;})[_0x4f0a('0x26')](respondWithFilteredResult(_0x3cedff,_0x1795b2))[_0x4f0a('0x47')](handleError(_0x3cedff,null));};exports[_0x4f0a('0x48')]=function(_0x25ca6c,_0x4c2275){var _0x1077e2={'raw':![],'where':{'id':_0x25ca6c['params']['id']}},_0x122f99={};_0x122f99['model']=_[_0x4f0a('0x34')](db[_0x4f0a('0x2d')][_0x4f0a('0x2e')]);_0x122f99[_0x4f0a('0x33')]=_[_0x4f0a('0x34')](_0x25ca6c[_0x4f0a('0x33')]);_0x122f99[_0x4f0a('0x35')]=_[_0x4f0a('0x38')](_0x122f99[_0x4f0a('0x36')],_0x122f99[_0x4f0a('0x33')]);_0x1077e2[_0x4f0a('0x37')]=_[_0x4f0a('0x38')](_0x122f99[_0x4f0a('0x36')],qs[_0x4f0a('0x39')](_0x25ca6c['query'][_0x4f0a('0x39')]));_0x1077e2['attributes']=_0x1077e2[_0x4f0a('0x37')][_0x4f0a('0x3a')]?_0x1077e2['attributes']:_0x122f99[_0x4f0a('0x36')];if(_0x25ca6c[_0x4f0a('0x33')][_0x4f0a('0x44')]){_0x1077e2[_0x4f0a('0x45')]=[{'all':!![]}];}_0x1077e2=_[_0x4f0a('0x41')]({},_0x1077e2,_0x25ca6c[_0x4f0a('0x43')]);return db[_0x4f0a('0x2d')]['find'](_0x1077e2)[_0x4f0a('0x26')](handleEntityNotFound(_0x4c2275,null))[_0x4f0a('0x26')](respondWithResult(_0x4c2275,null))[_0x4f0a('0x47')](handleError(_0x4c2275,null));};exports[_0x4f0a('0x49')]=function(_0x126e1f,_0x59557a){return db['UserProfileSection']['create'](_0x126e1f[_0x4f0a('0x4a')],{})[_0x4f0a('0x26')](respondWithResult(_0x59557a,0xc9))[_0x4f0a('0x47')](handleError(_0x59557a,null));};exports['update']=function(_0x461f5c,_0x3b13b6){if(_0x461f5c[_0x4f0a('0x4a')]['id']){delete _0x461f5c[_0x4f0a('0x4a')]['id'];}return db[_0x4f0a('0x2d')][_0x4f0a('0x4b')]({'where':{'id':_0x461f5c[_0x4f0a('0x4c')]['id']}})[_0x4f0a('0x26')](handleEntityNotFound(_0x3b13b6,null))[_0x4f0a('0x26')](saveUpdates(_0x461f5c[_0x4f0a('0x4a')],null))['then'](respondWithResult(_0x3b13b6,null))[_0x4f0a('0x47')](handleError(_0x3b13b6,null));};exports['destroy']=function(_0x28140a,_0xde0a55){return db[_0x4f0a('0x2d')][_0x4f0a('0x4b')]({'where':{'id':_0x28140a[_0x4f0a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xde0a55,null))[_0x4f0a('0x26')](removeEntity(_0xde0a55,null))[_0x4f0a('0x47')](handleError(_0xde0a55,null));};exports['describe']=function(_0x40bdba,_0x4429e1){return db['UserProfileSection']['describe']()[_0x4f0a('0x26')](respondWithResult(_0x4429e1,null))[_0x4f0a('0x47')](handleError(_0x4429e1,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0702ff1..61ac57d 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 _0x20da=['../../config/environment','./userProfileSection.attributes','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3f7e0b,_0x2da854){var _0x4e73a6=function(_0x2a63bf){while(--_0x2a63bf){_0x3f7e0b['push'](_0x3f7e0b['shift']());}};_0x4e73a6(++_0x2da854);}(_0x20da,0x1e2));var _0xa20d=function(_0x3dc910,_0x5cc668){_0x3dc910=_0x3dc910-0x0;var _0x3d7fdb=_0x20da[_0x3dc910];return _0x3d7fdb;};'use strict';var _=require(_0xa20d('0x0'));var util=require(_0xa20d('0x1'));var logger=require(_0xa20d('0x2'))(_0xa20d('0x3'));var moment=require('moment');var BPromise=require(_0xa20d('0x4'));var rp=require(_0xa20d('0x5'));var fs=require('fs');var path=require(_0xa20d('0x6'));var rimraf=require(_0xa20d('0x7'));var config=require(_0xa20d('0x8'));var attributes=require(_0xa20d('0x9'));module['exports']=function(_0x358986,_0xe8f24b){return _0x358986['define']('UserProfileSection',attributes,{'tableName':_0xa20d('0xa'),'paranoid':![],'indexes':[{'name':_0xa20d('0xb'),'fields':[_0xa20d('0xc'),_0xa20d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9051=['moment','request-promise','rimraf','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger'];(function(_0x3e6bfc,_0x2d946e){var _0x2ceaa2=function(_0x426f14){while(--_0x426f14){_0x3e6bfc['push'](_0x3e6bfc['shift']());}};_0x2ceaa2(++_0x2d946e);}(_0x9051,0xd6));var _0x1905=function(_0x1c7529,_0x24381a){_0x1c7529=_0x1c7529-0x0;var _0x41b266=_0x9051[_0x1c7529];return _0x41b266;};'use strict';var _=require('lodash');var util=require(_0x1905('0x0'));var logger=require(_0x1905('0x1'))('api');var moment=require(_0x1905('0x2'));var BPromise=require('bluebird');var rp=require(_0x1905('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1905('0x4'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x413412,_0x22f8c6){return _0x413412['define']('UserProfileSection',attributes,{'tableName':_0x1905('0x5'),'paranoid':![],'indexes':[{'name':_0x1905('0x6'),'fields':[_0x1905('0x7'),_0x1905('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 4ab934b..ce3e970 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 _0x6a8e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','bluebird','randomstring','../../mysqldb'];(function(_0x4ead9b,_0x5cffd0){var _0x36f7f6=function(_0x3de9b4){while(--_0x3de9b4){_0x4ead9b['push'](_0x4ead9b['shift']());}};_0x36f7f6(++_0x5cffd0);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x5b14d7,_0x10b373){_0x5b14d7=_0x5b14d7-0x0;var _0x1eb341=_0x6a8e[_0x5b14d7];return _0x1eb341;};'use strict';var _=require('lodash');var util=require(_0xe6a8('0x0'));var moment=require('moment');var BPromise=require(_0xe6a8('0x1'));var rs=require(_0xe6a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6a8('0x3'))['db'];var utils=require(_0xe6a8('0x4'));var logger=require(_0xe6a8('0x5'))(_0xe6a8('0x6'));var config=require(_0xe6a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe6a8('0x8')][_0xe6a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x199f74,_0x2e947d,_0x148cc9){return new BPromise(function(_0x118807,_0x536fd7){return client['request'](_0x199f74,_0x148cc9)[_0xe6a8('0xa')](function(_0x2732bd){logger['info'](_0xe6a8('0xb'),_0x2e947d,_0xe6a8('0xc'));logger[_0xe6a8('0xd')](_0xe6a8('0xe'),_0x2e947d,'request\x20sent',JSON[_0xe6a8('0xf')](_0x2732bd));if(_0x2732bd['error']){if(_0x2732bd[_0xe6a8('0x10')]['code']===0x1f4){logger['error'](_0xe6a8('0xb'),_0x2e947d,_0x2732bd[_0xe6a8('0x10')][_0xe6a8('0x11')]);return _0x536fd7(_0x2732bd['error'][_0xe6a8('0x11')]);}logger[_0xe6a8('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2e947d,_0x2732bd[_0xe6a8('0x10')][_0xe6a8('0x11')]);return _0x118807(_0x2732bd[_0xe6a8('0x10')]['message']);}else{logger[_0xe6a8('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x2e947d,_0xe6a8('0xc'));_0x118807(_0x2732bd[_0xe6a8('0x13')][_0xe6a8('0x11')]);}})['catch'](function(_0x1269b1){logger[_0xe6a8('0x10')](_0xe6a8('0xb'),_0x2e947d,_0x1269b1);_0x536fd7(_0x1269b1);});});} \ No newline at end of file +var _0x7003=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request'];(function(_0xb7202,_0x4aa500){var _0x6488bb=function(_0x27d9ec){while(--_0x27d9ec){_0xb7202['push'](_0xb7202['shift']());}};_0x6488bb(++_0x4aa500);}(_0x7003,0x1ad));var _0x3700=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0x7003[_0x4c630b];return _0x181259;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3700('0x0'));var rs=require(_0x3700('0x1'));var fs=require('fs');var Redis=require(_0x3700('0x2'));var db=require(_0x3700('0x3'))['db'];var utils=require(_0x3700('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3700('0x5'));var client=jayson[_0x3700('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x428414,_0x4041a6,_0x530589){return new BPromise(function(_0xf0f9c6,_0x40511c){return client[_0x3700('0x7')](_0x428414,_0x530589)[_0x3700('0x8')](function(_0xf7e17f){logger[_0x3700('0x9')](_0x3700('0xa'),_0x4041a6,_0x3700('0xb'));logger[_0x3700('0xc')](_0x3700('0xd'),_0x4041a6,_0x3700('0xb'),JSON[_0x3700('0xe')](_0xf7e17f));if(_0xf7e17f[_0x3700('0xf')]){if(_0xf7e17f[_0x3700('0xf')][_0x3700('0x10')]===0x1f4){logger[_0x3700('0xf')](_0x3700('0xa'),_0x4041a6,_0xf7e17f[_0x3700('0xf')][_0x3700('0x11')]);return _0x40511c(_0xf7e17f[_0x3700('0xf')][_0x3700('0x11')]);}logger[_0x3700('0xf')](_0x3700('0xa'),_0x4041a6,_0xf7e17f[_0x3700('0xf')][_0x3700('0x11')]);return _0xf0f9c6(_0xf7e17f[_0x3700('0xf')][_0x3700('0x11')]);}else{logger[_0x3700('0x9')](_0x3700('0xa'),_0x4041a6,'request\x20sent');_0xf0f9c6(_0xf7e17f['result'][_0x3700('0x11')]);}})[_0x3700('0x12')](function(_0x396f4e){logger[_0x3700('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x4041a6,_0x396f4e);_0x40511c(_0x396f4e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index eddd9b0..a49cbfd 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3a5dfd,_0x3c3c9a){var _0xfa37ab=function(_0x1b51d6){while(--_0x1b51d6){_0x3a5dfd['push'](_0x3a5dfd['shift']());}};_0xfa37ab(++_0x3c3c9a);}(_0x70e0,0x17b));var _0x070e=function(_0x508703,_0x523a2d){_0x508703=_0x508703-0x0;var _0x5655d5=_0x70e0[_0x508703];return _0x5655d5;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ed88e,_0x475618){var _0x32c1ae=function(_0x5b4338){while(--_0x5b4338){_0x4ed88e['push'](_0x4ed88e['shift']());}};_0x32c1ae(++_0x475618);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xcb91[_0x376db5];return _0x304c17;};'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 f684874..2891608 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 _0x234f=['exports','INTEGER','sequelize'];(function(_0x5c879e,_0xe58074){var _0x30942b=function(_0x535b57){while(--_0x535b57){_0x5c879e['push'](_0x5c879e['shift']());}};_0x30942b(++_0xe58074);}(_0x234f,0xb6));var _0xf234=function(_0x304e95,_0x1fd422){_0x304e95=_0x304e95-0x0;var _0x736146=_0x234f[_0x304e95];return _0x736146;};'use strict';var Sequelize=require(_0xf234('0x0'));module[_0xf234('0x1')]={'penalty':{'type':Sequelize[_0xf234('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x27f9=['exports','sequelize'];(function(_0x5cb726,_0x1b60fd){var _0x31589d=function(_0x407d99){while(--_0x407d99){_0x5cb726['push'](_0x5cb726['shift']());}};_0x31589d(++_0x1b60fd);}(_0x27f9,0x73));var _0x927f=function(_0x33dfb7,_0x47f4b0){_0x33dfb7=_0x33dfb7-0x0;var _0x402500=_0x27f9[_0x33dfb7];return _0x402500;};'use strict';var Sequelize=require(_0x927f('0x0'));module[_0x927f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 a78b715..aad03d1 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 _0x9b0d=['define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3f267c,_0x150415){var _0x124815=function(_0x1003e2){while(--_0x1003e2){_0x3f267c['push'](_0x3f267c['shift']());}};_0x124815(++_0x150415);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x6c21f8,_0x4d797d){_0x6c21f8=_0x6c21f8-0x0;var _0x269c7c=_0x9b0d[_0x6c21f8];return _0x269c7c;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var fs=require('fs');var path=require(_0xd9b0('0x5'));var rimraf=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xd9b0('0x8')]=function(_0x21798d,_0x41dad9){return _0x21798d[_0xd9b0('0x9')](_0xd9b0('0xa'),attributes,{'tableName':_0xd9b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8585ff,_0x9232d){var _0x3ff111=function(_0x1c40bc){while(--_0x1c40bc){_0x8585ff['push'](_0x8585ff['shift']());}};_0x3ff111(++_0x9232d);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'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 331d51f..834beed 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 _0x8f2b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x197837,_0x439ae2){var _0x3eed5f=function(_0x4cb7da){while(--_0x4cb7da){_0x197837['push'](_0x197837['shift']());}};_0x3eed5f(++_0x439ae2);}(_0x8f2b,0x180));var _0xb8f2=function(_0x254dc1,_0x141fc4){_0x254dc1=_0x254dc1-0x0;var _0x1aa9fc=_0x8f2b[_0x254dc1];return _0x1aa9fc;};'use strict';var _=require(_0xb8f2('0x0'));var util=require(_0xb8f2('0x1'));var moment=require(_0xb8f2('0x2'));var BPromise=require(_0xb8f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8f2('0x4'));var db=require(_0xb8f2('0x5'))['db'];var utils=require(_0xb8f2('0x6'));var logger=require(_0xb8f2('0x7'))(_0xb8f2('0x8'));var config=require(_0xb8f2('0x9'));var jayson=require(_0xb8f2('0xa'));var client=jayson[_0xb8f2('0xb')][_0xb8f2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b3bcf,_0x107896,_0x5ad783){return new BPromise(function(_0x1dc471,_0x593306){return client[_0xb8f2('0xd')](_0x4b3bcf,_0x5ad783)[_0xb8f2('0xe')](function(_0x564730){logger[_0xb8f2('0xf')](_0xb8f2('0x10'),_0x107896,_0xb8f2('0x11'));logger[_0xb8f2('0x12')](_0xb8f2('0x13'),_0x107896,_0xb8f2('0x11'),JSON[_0xb8f2('0x14')](_0x564730));if(_0x564730[_0xb8f2('0x15')]){if(_0x564730[_0xb8f2('0x15')][_0xb8f2('0x16')]===0x1f4){logger['error'](_0xb8f2('0x10'),_0x107896,_0x564730['error']['message']);return _0x593306(_0x564730[_0xb8f2('0x15')][_0xb8f2('0x17')]);}logger[_0xb8f2('0x15')](_0xb8f2('0x10'),_0x107896,_0x564730[_0xb8f2('0x15')][_0xb8f2('0x17')]);return _0x1dc471(_0x564730[_0xb8f2('0x15')]['message']);}else{logger[_0xb8f2('0xf')](_0xb8f2('0x10'),_0x107896,'request\x20sent');_0x1dc471(_0x564730[_0xb8f2('0x18')][_0xb8f2('0x17')]);}})[_0xb8f2('0x19')](function(_0x312a5c){logger[_0xb8f2('0x15')](_0xb8f2('0x10'),_0x107896,_0x312a5c);_0x593306(_0x312a5c);});});} \ No newline at end of file +var _0x782c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x2d1e04,_0x29c96c){var _0x28d055=function(_0x242c90){while(--_0x242c90){_0x2d1e04['push'](_0x2d1e04['shift']());}};_0x28d055(++_0x29c96c);}(_0x782c,0xf8));var _0xc782=function(_0x258229,_0x252de5){_0x258229=_0x258229-0x0;var _0x13075e=_0x782c[_0x258229];return _0x13075e;};'use strict';var _=require(_0xc782('0x0'));var util=require(_0xc782('0x1'));var moment=require(_0xc782('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc782('0x3'))['db'];var utils=require(_0xc782('0x4'));var logger=require(_0xc782('0x5'))(_0xc782('0x6'));var config=require(_0xc782('0x7'));var jayson=require(_0xc782('0x8'));var client=jayson[_0xc782('0x9')][_0xc782('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4304c0,_0x474b55,_0x3c8307){return new BPromise(function(_0x1e99c3,_0x35327b){return client['request'](_0x4304c0,_0x3c8307)[_0xc782('0xb')](function(_0xe396c){logger['info'](_0xc782('0xc'),_0x474b55,_0xc782('0xd'));logger[_0xc782('0xe')](_0xc782('0xf'),_0x474b55,'request\x20sent',JSON[_0xc782('0x10')](_0xe396c));if(_0xe396c[_0xc782('0x11')]){if(_0xe396c['error'][_0xc782('0x12')]===0x1f4){logger[_0xc782('0x11')](_0xc782('0xc'),_0x474b55,_0xe396c[_0xc782('0x11')][_0xc782('0x13')]);return _0x35327b(_0xe396c[_0xc782('0x11')][_0xc782('0x13')]);}logger[_0xc782('0x11')](_0xc782('0xc'),_0x474b55,_0xe396c[_0xc782('0x11')][_0xc782('0x13')]);return _0x1e99c3(_0xe396c['error']['message']);}else{logger[_0xc782('0x14')](_0xc782('0xc'),_0x474b55,'request\x20sent');_0x1e99c3(_0xe396c[_0xc782('0x15')][_0xc782('0x13')]);}})[_0xc782('0x16')](function(_0x46d600){logger['error'](_0xc782('0xc'),_0x474b55,_0x46d600);_0x35327b(_0x46d600);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ab64cfc..569e63d 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 _0xd4e2=['sequelize','exports','INTEGER'];(function(_0x5d1257,_0x3eeb2e){var _0x1a3372=function(_0x402994){while(--_0x402994){_0x5d1257['push'](_0x5d1257['shift']());}};_0x1a3372(++_0x3eeb2e);}(_0xd4e2,0x10e));var _0x2d4e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd4e2[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x2d4e('0x0'));module[_0x2d4e('0x1')]={'UserId':{'type':Sequelize[_0x2d4e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2d4e('0x2')]}}; \ No newline at end of file +var _0x6957=['sequelize','INTEGER'];(function(_0x4d89ee,_0x2dbe15){var _0x21ed37=function(_0x5e9c5a){while(--_0x5e9c5a){_0x4d89ee['push'](_0x4d89ee['shift']());}};_0x21ed37(++_0x2dbe15);}(_0x6957,0x78));var _0x7695=function(_0x2be925,_0x2a31d5){_0x2be925=_0x2be925-0x0;var _0x3591eb=_0x6957[_0x2be925];return _0x3591eb;};'use strict';var Sequelize=require(_0x7695('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x7695('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a034c58..644e8f8 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(_0xf31a41,_0x12fd1b){var _0x3f2b04=function(_0x1eeb5a){while(--_0x1eeb5a){_0xf31a41['push'](_0xf31a41['shift']());}};_0x3f2b04(++_0x12fd1b);}(_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':'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(_0x2c8200,_0x755e6a){var _0x24c9c9=function(_0xe18d8b){while(--_0xe18d8b){_0x2c8200['push'](_0x2c8200['shift']());}};_0x24c9c9(++_0x755e6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 aacf9d6..0f4a240 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c66d8,_0x16d85d){var _0xf1cc0a=function(_0x2d8ff4){while(--_0x2d8ff4){_0x1c66d8['push'](_0x1c66d8['shift']());}};_0xf1cc0a(++_0x16d85d);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c7a9f,_0x106e90){var _0x327c29=function(_0x5f3d6c){while(--_0x5f3d6c){_0x1c7a9f['push'](_0x1c7a9f['shift']());}};_0x327c29(++_0x106e90);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d80930d..e296141 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 _0xb777=['INTEGER','exports'];(function(_0x5604af,_0x4c5c5a){var _0xabdce4=function(_0x5e6449){while(--_0x5e6449){_0x5604af['push'](_0x5604af['shift']());}};_0xabdce4(++_0x4c5c5a);}(_0xb777,0x107));var _0x7b77=function(_0x426a37,_0x1d32df){_0x426a37=_0x426a37-0x0;var _0x4e9e28=_0xb777[_0x426a37];return _0x4e9e28;};'use strict';var Sequelize=require('sequelize');module[_0x7b77('0x0')]={'penalty':{'type':Sequelize[_0x7b77('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x526d=['sequelize'];(function(_0x291f48,_0x4f79e2){var _0x1fcaf7=function(_0x17c3f1){while(--_0x17c3f1){_0x291f48['push'](_0x291f48['shift']());}};_0x1fcaf7(++_0x4f79e2);}(_0x526d,0xce));var _0xd526=function(_0x102d81,_0x44778a){_0x102d81=_0x102d81-0x0;var _0x332328=_0x526d[_0x102d81];return _0x332328;};'use strict';var Sequelize=require(_0xd526('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 4aa5869..b8171df 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 _0x80af=['exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x80af,0x197));var _0xf80a=function(_0x8acdee,_0x495784){_0x8acdee=_0x8acdee-0x0;var _0x21cde1=_0x80af[_0x8acdee];return _0x21cde1;};'use strict';var _=require(_0xf80a('0x0'));var util=require(_0xf80a('0x1'));var logger=require(_0xf80a('0x2'))('api');var moment=require(_0xf80a('0x3'));var BPromise=require(_0xf80a('0x4'));var rp=require(_0xf80a('0x5'));var fs=require('fs');var path=require(_0xf80a('0x6'));var rimraf=require(_0xf80a('0x7'));var config=require(_0xf80a('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xf80a('0x9')]=function(_0x1be34f,_0x4498e7){return _0x1be34f[_0xf80a('0xa')](_0xf80a('0xb'),attributes,{'tableName':_0xf80a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaed0=['./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a240f,_0x412c9b){var _0x8d9144=function(_0x5ce5ea){while(--_0x5ce5ea){_0x5a240f['push'](_0x5a240f['shift']());}};_0x8d9144(++_0x412c9b);}(_0xaed0,0xba));var _0x0aed=function(_0x39f95b,_0x46d60a){_0x39f95b=_0x39f95b-0x0;var _0x384735=_0xaed0[_0x39f95b];return _0x384735;};'use strict';var _=require(_0x0aed('0x0'));var util=require(_0x0aed('0x1'));var logger=require(_0x0aed('0x2'))(_0x0aed('0x3'));var moment=require(_0x0aed('0x4'));var BPromise=require(_0x0aed('0x5'));var rp=require(_0x0aed('0x6'));var fs=require('fs');var path=require(_0x0aed('0x7'));var rimraf=require(_0x0aed('0x8'));var config=require(_0x0aed('0x9'));var attributes=require(_0x0aed('0xa'));module[_0x0aed('0xb')]=function(_0x55387b,_0x39b6f1){return _0x55387b['define'](_0x0aed('0xc'),attributes,{'tableName':_0x0aed('0xd'),'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 d225425..19e2f4f 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 _0x5078=['debug','stringify','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5078,0x167));var _0x8507=function(_0x154efd,_0x27c90d){_0x154efd=_0x154efd-0x0;var _0x331e99=_0x5078[_0x154efd];return _0x331e99;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8507('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8507('0x3'));var logger=require(_0x8507('0x4'))(_0x8507('0x5'));var config=require(_0x8507('0x6'));var jayson=require(_0x8507('0x7'));var client=jayson[_0x8507('0x8')][_0x8507('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b7c34,_0x27900b,_0x643a2a){return new BPromise(function(_0x21872e,_0x8a2ed){return client[_0x8507('0xa')](_0x5b7c34,_0x643a2a)[_0x8507('0xb')](function(_0x4c2532){logger[_0x8507('0xc')](_0x8507('0xd'),_0x27900b,_0x8507('0xe'));logger[_0x8507('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x27900b,_0x8507('0xe'),JSON[_0x8507('0x10')](_0x4c2532));if(_0x4c2532['error']){if(_0x4c2532[_0x8507('0x11')][_0x8507('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x27900b,_0x4c2532[_0x8507('0x11')]['message']);return _0x8a2ed(_0x4c2532[_0x8507('0x11')][_0x8507('0x13')]);}logger[_0x8507('0x11')](_0x8507('0xd'),_0x27900b,_0x4c2532['error']['message']);return _0x21872e(_0x4c2532[_0x8507('0x11')][_0x8507('0x13')]);}else{logger[_0x8507('0xc')](_0x8507('0xd'),_0x27900b,_0x8507('0xe'));_0x21872e(_0x4c2532[_0x8507('0x14')][_0x8507('0x13')]);}})[_0x8507('0x15')](function(_0xa07696){logger[_0x8507('0x11')](_0x8507('0xd'),_0x27900b,_0xa07696);_0x8a2ed(_0xa07696);});});} \ No newline at end of file +var _0x7e8d=['http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ba389,_0x1e2280){var _0x49ae20=function(_0x3cc758){while(--_0x3cc758){_0x1ba389['push'](_0x1ba389['shift']());}};_0x49ae20(++_0x1e2280);}(_0x7e8d,0x114));var _0xd7e8=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x7e8d[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xd7e8('0x0'));var util=require(_0xd7e8('0x1'));var moment=require(_0xd7e8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7e8('0x4'))['db'];var utils=require(_0xd7e8('0x5'));var logger=require('../../config/logger')(_0xd7e8('0x6'));var config=require(_0xd7e8('0x7'));var jayson=require(_0xd7e8('0x8'));var client=jayson[_0xd7e8('0x9')][_0xd7e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b955f,_0x2900b1,_0x5a541d){return new BPromise(function(_0x295018,_0x2becf1){return client['request'](_0x1b955f,_0x5a541d)[_0xd7e8('0xb')](function(_0x4a8bdd){logger['info'](_0xd7e8('0xc'),_0x2900b1,_0xd7e8('0xd'));logger[_0xd7e8('0xe')](_0xd7e8('0xf'),_0x2900b1,_0xd7e8('0xd'),JSON[_0xd7e8('0x10')](_0x4a8bdd));if(_0x4a8bdd['error']){if(_0x4a8bdd['error'][_0xd7e8('0x11')]===0x1f4){logger[_0xd7e8('0x12')](_0xd7e8('0xc'),_0x2900b1,_0x4a8bdd[_0xd7e8('0x12')][_0xd7e8('0x13')]);return _0x2becf1(_0x4a8bdd[_0xd7e8('0x12')][_0xd7e8('0x13')]);}logger[_0xd7e8('0x12')](_0xd7e8('0xc'),_0x2900b1,_0x4a8bdd['error']['message']);return _0x295018(_0x4a8bdd[_0xd7e8('0x12')][_0xd7e8('0x13')]);}else{logger[_0xd7e8('0x14')](_0xd7e8('0xc'),_0x2900b1,_0xd7e8('0xd'));_0x295018(_0x4a8bdd[_0xd7e8('0x15')]['message']);}})['catch'](function(_0xfe949f){logger[_0xd7e8('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2900b1,_0xfe949f);_0x2becf1(_0xfe949f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 727e18a..a59c0c3 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3d87e0,_0x27b839){var _0x1fc63c=function(_0xed497c){while(--_0xed497c){_0x3d87e0['push'](_0x3d87e0['shift']());}};_0x1fc63c(++_0x27b839);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xcb91[_0x79b649];return _0x1af9b1;};'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(_0x35ceb7,_0x3aad12){var _0x4ae086=function(_0x90a7db){while(--_0x90a7db){_0x35ceb7['push'](_0x35ceb7['shift']());}};_0x4ae086(++_0x3aad12);}(_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 5f2f2a6..59a5555 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 _0xeb24=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x15b50e,_0x398bda){var _0x9e8ffe=function(_0x38475d){while(--_0x38475d){_0x15b50e['push'](_0x15b50e['shift']());}};_0x9e8ffe(++_0x398bda);}(_0xeb24,0xd8));var _0x4eb2=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xeb24[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0x4eb2('0x0'));module[_0x4eb2('0x1')]={'uniqueid':{'type':Sequelize[_0x4eb2('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4eb2('0x3')},'membername':{'type':Sequelize[_0x4eb2('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4eb2('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x4eb2('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x4eb2('0x4')],'allowNull':![],'unique':_0x4eb2('0x5'),'comment':_0x4eb2('0x3')},'penalty':{'type':Sequelize[_0x4eb2('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4eb2('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x56a1=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x56a1,0x1b0));var _0x156a=function(_0x5dfee3,_0x5e3bbe){_0x5dfee3=_0x5dfee3-0x0;var _0x1e1785=_0x56a1[_0x5dfee3];return _0x1e1785;};'use strict';var Sequelize=require(_0x156a('0x0'));module[_0x156a('0x1')]={'uniqueid':{'type':Sequelize[_0x156a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x156a('0x3')},'membername':{'type':Sequelize[_0x156a('0x4')],'allowNull':![],'comment':_0x156a('0x3')},'UserId':{'type':Sequelize[_0x156a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x156a('0x4')],'allowNull':![],'unique':_0x156a('0x5'),'comment':_0x156a('0x3')},'VoiceQueueId':{'type':Sequelize[_0x156a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x156a('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x156a('0x3')},'penalty':{'type':Sequelize[_0x156a('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x156a('0x2')](0xb),'defaultValue':0x0,'comment':_0x156a('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8275a21..5c002e6 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 _0xe4b4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','update'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe4b4,0x137));var _0x4e4b=function(_0x35cbed,_0x369b7e){_0x35cbed=_0x35cbed-0x0;var _0x27017d=_0xe4b4[_0x35cbed];return _0x27017d;};'use strict';var EventEmitter=require(_0x4e4b('0x0'));var UserVoiceQueueRt=require(_0x4e4b('0x1'))['db'][_0x4e4b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e4b('0x3'),'afterDestroy':_0x4e4b('0x4')};function emitEvent(_0x787e76){return function(_0x47d04a,_0x1906ed,_0x1d5f55){UserVoiceQueueRtEvents[_0x4e4b('0x5')](_0x787e76+':'+_0x47d04a['id'],_0x47d04a);UserVoiceQueueRtEvents['emit'](_0x787e76,_0x47d04a);_0x1d5f55(null);};}for(var e in events){if(events[_0x4e4b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4e4b('0x7')](e,emitEvent(event));}}module[_0x4e4b('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x91a1=['save','update','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt'];(function(_0x26c689,_0x22d823){var _0x2af567=function(_0x5261b7){while(--_0x5261b7){_0x26c689['push'](_0x26c689['shift']());}};_0x2af567(++_0x22d823);}(_0x91a1,0xfa));var _0x191a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x91a1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x191a('0x0'))['db'][_0x191a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x191a('0x2'),'afterUpdate':_0x191a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x29ae80){return function(_0x119d6d,_0x5e8019,_0x4c5d09){UserVoiceQueueRtEvents[_0x191a('0x4')](_0x29ae80+':'+_0x119d6d['id'],_0x119d6d);UserVoiceQueueRtEvents[_0x191a('0x4')](_0x29ae80,_0x119d6d);_0x4c5d09(null);};}for(var e in events){if(events[_0x191a('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x191a('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 3733463..a0e3df8 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 _0x0e93=['path','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment','bluebird'];(function(_0x3b88a3,_0x59f361){var _0x27642d=function(_0x11f793){while(--_0x11f793){_0x3b88a3['push'](_0x3b88a3['shift']());}};_0x27642d(++_0x59f361);}(_0x0e93,0x10c));var _0x30e9=function(_0x570751,_0x4fe80e){_0x570751=_0x570751-0x0;var _0x369842=_0x0e93[_0x570751];return _0x369842;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x30e9('0x0'))(_0x30e9('0x1'));var moment=require(_0x30e9('0x2'));var BPromise=require(_0x30e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e9('0x4'));var rimraf=require('rimraf');var config=require(_0x30e9('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x3a302f,_0x32259a){return _0x3a302f['define'](_0x30e9('0x6'),attributes,{'tableName':_0x30e9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7d1=['UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','define'];(function(_0x288343,_0x106336){var _0x3d7c2a=function(_0x374b50){while(--_0x374b50){_0x288343['push'](_0x288343['shift']());}};_0x3d7c2a(++_0x106336);}(_0xa7d1,0x14c));var _0x1a7d=function(_0x1df5cd,_0x3dc641){_0x1df5cd=_0x1df5cd-0x0;var _0xf6df9b=_0xa7d1[_0x1df5cd];return _0xf6df9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a7d('0x0'))(_0x1a7d('0x1'));var moment=require(_0x1a7d('0x2'));var BPromise=require(_0x1a7d('0x3'));var rp=require(_0x1a7d('0x4'));var fs=require('fs');var path=require(_0x1a7d('0x5'));var rimraf=require(_0x1a7d('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a7d('0x7'));module['exports']=function(_0x180bda,_0x42499c){return _0x180bda[_0x1a7d('0x8')](_0x1a7d('0x9'),attributes,{'tableName':_0x1a7d('0xa'),'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 11e89e5..a2a0120 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 _0x7168=['outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','UserVoiceQueueRt','findAll','options','where','sequelize'];(function(_0x5e97a5,_0xdc2edd){var _0x2de787=function(_0x3a3a0a){while(--_0x3a3a0a){_0x5e97a5['push'](_0x5e97a5['shift']());}};_0x2de787(++_0xdc2edd);}(_0x7168,0x142));var _0x8716=function(_0x5a561a,_0x1a18dc){_0x5a561a=_0x5a561a-0x0;var _0x1f84e3=_0x7168[_0x5a561a];return _0x1f84e3;};'use strict';var _=require(_0x8716('0x0'));var util=require(_0x8716('0x1'));var moment=require(_0x8716('0x2'));var BPromise=require(_0x8716('0x3'));var rs=require(_0x8716('0x4'));var fs=require('fs');var Redis=require(_0x8716('0x5'));var db=require(_0x8716('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8716('0x7'))('rpc');var config=require(_0x8716('0x8'));var jayson=require(_0x8716('0x9'));var client=jayson[_0x8716('0xa')][_0x8716('0xb')]({'port':0x232a});config[_0x8716('0xc')]=_[_0x8716('0xd')](config[_0x8716('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8716('0xc')]));require('./userVoiceQueueRt.socket')[_0x8716('0xe')](socket);function respondWithRpcPromise(_0xb61d5d,_0x3f3045,_0x16d0b5){return new BPromise(function(_0x4a6c25,_0x306b99){return client[_0x8716('0xf')](_0xb61d5d,_0x16d0b5)[_0x8716('0x10')](function(_0x49f458){logger[_0x8716('0x11')](_0x8716('0x12'),_0x3f3045,_0x8716('0x13'));logger[_0x8716('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3f3045,_0x8716('0x13'),JSON['stringify'](_0x49f458));if(_0x49f458['error']){if(_0x49f458[_0x8716('0x15')][_0x8716('0x16')]===0x1f4){logger[_0x8716('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3f3045,_0x49f458['error']['message']);return _0x306b99(_0x49f458['error'][_0x8716('0x17')]);}logger['error'](_0x8716('0x12'),_0x3f3045,_0x49f458['error'][_0x8716('0x17')]);return _0x4a6c25(_0x49f458[_0x8716('0x15')][_0x8716('0x17')]);}else{logger[_0x8716('0x11')](_0x8716('0x12'),_0x3f3045,_0x8716('0x13'));_0x4a6c25(_0x49f458['result'][_0x8716('0x17')]);}})[_0x8716('0x18')](function(_0x29c54a){logger['error'](_0x8716('0x12'),_0x3f3045,_0x29c54a);_0x306b99(_0x29c54a);});});}exports['GetVoiceQueueRtPauses']=function(_0x58b5d1){var _0x2fd2e5=this;return new Promise(function(_0xa8c998,_0x228213){return db[_0x8716('0x19')][_0x8716('0x1a')]({'raw':_0x58b5d1[_0x8716('0x1b')]?_0x58b5d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x58b5d1[_0x8716('0x1b')]?_0x58b5d1[_0x8716('0x1b')][_0x8716('0x1c')]||null:null,'attributes':[[db[_0x8716('0x1d')]['fn']('COUNT',db[_0x8716('0x1d')]['fn']('IF',db[_0x8716('0x1d')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x8716('0x1e')]]})[_0x8716('0x10')](function(_0x3885f9){logger[_0x8716('0x11')](_0x8716('0x1f'),_0x58b5d1);logger[_0x8716('0x14')](_0x8716('0x1f'),_0x58b5d1,JSON['stringify'](_0x3885f9));_0xa8c998(_0x3885f9);})[_0x8716('0x18')](function(_0x98d722){logger[_0x8716('0x15')](_0x8716('0x1f'),_0x98d722[_0x8716('0x17')],_0x58b5d1);_0x228213(_0x2fd2e5[_0x8716('0x15')](0x1f4,_0x98d722[_0x8716('0x17')]));});});}; \ No newline at end of file +var _0x870d=['./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter'];(function(_0x3fdcf8,_0x34f2d2){var _0x17ef37=function(_0x487112){while(--_0x487112){_0x3fdcf8['push'](_0x3fdcf8['shift']());}};_0x17ef37(++_0x34f2d2);}(_0x870d,0x1c4));var _0xd870=function(_0x5e5279,_0xe3d23d){_0x5e5279=_0x5e5279-0x0;var _0x241821=_0x870d[_0x5e5279];return _0x241821;};'use strict';var _=require(_0xd870('0x0'));var util=require(_0xd870('0x1'));var moment=require(_0xd870('0x2'));var BPromise=require(_0xd870('0x3'));var rs=require(_0xd870('0x4'));var fs=require('fs');var Redis=require(_0xd870('0x5'));var db=require(_0xd870('0x6'))['db'];var utils=require(_0xd870('0x7'));var logger=require(_0xd870('0x8'))(_0xd870('0x9'));var config=require(_0xd870('0xa'));var jayson=require(_0xd870('0xb'));var client=jayson[_0xd870('0xc')]['http']({'port':0x232a});config[_0xd870('0xd')]=_[_0xd870('0xe')](config[_0xd870('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd870('0xf'))(new Redis(config[_0xd870('0xd')]));require(_0xd870('0x10'))[_0xd870('0x11')](socket);function respondWithRpcPromise(_0x3c1da6,_0x2b5511,_0x6b7bdb){return new BPromise(function(_0x1708d9,_0x2fdd15){return client[_0xd870('0x12')](_0x3c1da6,_0x6b7bdb)[_0xd870('0x13')](function(_0x5e3491){logger['info'](_0xd870('0x14'),_0x2b5511,_0xd870('0x15'));logger[_0xd870('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2b5511,_0xd870('0x15'),JSON[_0xd870('0x17')](_0x5e3491));if(_0x5e3491[_0xd870('0x18')]){if(_0x5e3491[_0xd870('0x18')][_0xd870('0x19')]===0x1f4){logger[_0xd870('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2b5511,_0x5e3491[_0xd870('0x18')]['message']);return _0x2fdd15(_0x5e3491[_0xd870('0x18')][_0xd870('0x1a')]);}logger['error'](_0xd870('0x14'),_0x2b5511,_0x5e3491[_0xd870('0x18')][_0xd870('0x1a')]);return _0x1708d9(_0x5e3491[_0xd870('0x18')][_0xd870('0x1a')]);}else{logger[_0xd870('0x1b')](_0xd870('0x14'),_0x2b5511,_0xd870('0x15'));_0x1708d9(_0x5e3491[_0xd870('0x1c')][_0xd870('0x1a')]);}})[_0xd870('0x1d')](function(_0x10fb6b){logger[_0xd870('0x18')](_0xd870('0x14'),_0x2b5511,_0x10fb6b);_0x2fdd15(_0x10fb6b);});});}exports[_0xd870('0x1e')]=function(_0x3bcb4b){var _0x38409f=this;return new Promise(function(_0x1fcfa4,_0x3db311){return db[_0xd870('0x1f')]['findAll']({'raw':_0x3bcb4b[_0xd870('0x20')]?_0x3bcb4b['options'][_0xd870('0x21')]===undefined?!![]:![]:!![],'where':_0x3bcb4b[_0xd870('0x20')]?_0x3bcb4b[_0xd870('0x20')][_0xd870('0x22')]||null:null,'attributes':[[db[_0xd870('0x23')]['fn'](_0xd870('0x24'),db[_0xd870('0x23')]['fn']('IF',db[_0xd870('0x23')][_0xd870('0x25')]('`paused`\x20=\x201,\x201,\x20null'))),_0xd870('0x26')]]})[_0xd870('0x13')](function(_0x583214){logger[_0xd870('0x1b')](_0xd870('0x1e'),_0x3bcb4b);logger[_0xd870('0x16')](_0xd870('0x1e'),_0x3bcb4b,JSON[_0xd870('0x17')](_0x583214));_0x1fcfa4(_0x583214);})[_0xd870('0x1d')](function(_0x46d41d){logger[_0xd870('0x18')]('GetVoiceQueueRtPauses',_0x46d41d['message'],_0x3bcb4b);_0x3db311(_0x38409f[_0xd870('0x18')](0x1f4,_0x46d41d[_0xd870('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 461c1ee..d3dd373 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 _0x82f8=['length','save','remove','emit','removeListener','register'];(function(_0xf47939,_0x124b6a){var _0x5f1ec1=function(_0x58f724){while(--_0x58f724){_0xf47939['push'](_0xf47939['shift']());}};_0x5f1ec1(++_0x124b6a);}(_0x82f8,0x157));var _0x882f=function(_0x114f6a,_0x42ee6a){_0x114f6a=_0x114f6a-0x0;var _0x239b34=_0x82f8[_0x114f6a];return _0x239b34;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x882f('0x0'),_0x882f('0x1'),'update'];function createListener(_0xac1624,_0x2ffd9c){return function(_0x106930){_0x2ffd9c[_0x882f('0x2')](_0xac1624,_0x106930);};}function removeListener(_0x2fad3e,_0x181655){return function(){UserVoiceQueueRtEvents[_0x882f('0x3')](_0x2fad3e,_0x181655);};}exports[_0x882f('0x4')]=function(_0x4efdc9){for(var _0x57fc29=0x0,_0x3c414d=events[_0x882f('0x5')];_0x57fc29<_0x3c414d;_0x57fc29++){var _0x3efa94=events[_0x57fc29];var _0x2e6f92=createListener('userVoiceQueueRt:'+_0x3efa94,_0x4efdc9);UserVoiceQueueRtEvents['on'](_0x3efa94,_0x2e6f92);}}; \ No newline at end of file +var _0xedf2=['save','remove','update','userVoiceQueueRt:'];(function(_0x265c5d,_0x4a0fc2){var _0x3e8fda=function(_0x3c02ec){while(--_0x3c02ec){_0x265c5d['push'](_0x265c5d['shift']());}};_0x3e8fda(++_0x4a0fc2);}(_0xedf2,0x1ac));var _0x2edf=function(_0xc1e7e3,_0x220fd6){_0xc1e7e3=_0xc1e7e3-0x0;var _0x22a246=_0xedf2[_0xc1e7e3];return _0x22a246;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x2edf('0x0'),_0x2edf('0x1'),_0x2edf('0x2')];function createListener(_0x4b454e,_0xce87f7){return function(_0x1ad605){_0xce87f7['emit'](_0x4b454e,_0x1ad605);};}function removeListener(_0x43611a,_0x2c1515){return function(){UserVoiceQueueRtEvents['removeListener'](_0x43611a,_0x2c1515);};}exports['register']=function(_0x3cfc52){for(var _0x3601aa=0x0,_0x5af8d9=events['length'];_0x3601aa<_0x5af8d9;_0x3601aa++){var _0x2b7b21=events[_0x3601aa];var _0x498c41=createListener(_0x2edf('0x3')+_0x2b7b21,_0x3cfc52);UserVoiceQueueRtEvents['on'](_0x2b7b21,_0x498c41);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 04766b8..3655dd0 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_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(_0x3a3a31,_0x3a6ac7){var _0x4e7062=function(_0x30aeb7){while(--_0x30aeb7){_0x3a3a31['push'](_0x3a3a31['shift']());}};_0x4e7062(++_0x3a6ac7);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index af27ce6..3f69349 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 _0xb99d=['sequelize','INTEGER'];(function(_0x126619,_0x2a06bb){var _0x5ee848=function(_0x27f4e1){while(--_0x27f4e1){_0x126619['push'](_0x126619['shift']());}};_0x5ee848(++_0x2a06bb);}(_0xb99d,0xb8));var _0xdb99=function(_0x22a89b,_0x3e370d){_0x22a89b=_0x22a89b-0x0;var _0x2597a8=_0xb99d[_0x22a89b];return _0x2597a8;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdb99('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d68=['exports','INTEGER','sequelize'];(function(_0x44d954,_0x39ff66){var _0x3f0b40=function(_0x4aec5c){while(--_0x4aec5c){_0x44d954['push'](_0x44d954['shift']());}};_0x3f0b40(++_0x39ff66);}(_0x3d68,0x107));var _0x83d6=function(_0x51690b,_0x15e3eb){_0x51690b=_0x51690b-0x0;var _0x1bac26=_0x3d68[_0x51690b];return _0x1bac26;};'use strict';var Sequelize=require(_0x83d6('0x0'));module[_0x83d6('0x1')]={'penalty':{'type':Sequelize[_0x83d6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 377e0b9..0a8eeb2 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 _0xf863=['./userWhatsappQueue.attributes','define','UserWhatsappQueue','lodash','util','api','moment','bluebird','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf863,0x1e9));var _0x3f86=function(_0x1a50f5,_0xe82f97){_0x1a50f5=_0x1a50f5-0x0;var _0x3cd23a=_0xf863[_0x1a50f5];return _0x3cd23a;};'use strict';var _=require(_0x3f86('0x0'));var util=require(_0x3f86('0x1'));var logger=require('../../config/logger')(_0x3f86('0x2'));var moment=require(_0x3f86('0x3'));var BPromise=require(_0x3f86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f86('0x5'));var config=require('../../config/environment');var attributes=require(_0x3f86('0x6'));module['exports']=function(_0x25efa4,_0x332d38){return _0x25efa4[_0x3f86('0x7')](_0x3f86('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f6b=['bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f6b,0xa3));var _0xb9f6=function(_0x3fd2c9,_0xadf24e){_0x3fd2c9=_0x3fd2c9-0x0;var _0x7eb67d=_0x9f6b[_0x3fd2c9];return _0x7eb67d;};'use strict';var _=require(_0xb9f6('0x0'));var util=require(_0xb9f6('0x1'));var logger=require(_0xb9f6('0x2'))(_0xb9f6('0x3'));var moment=require(_0xb9f6('0x4'));var BPromise=require(_0xb9f6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9f6('0x6'));var rimraf=require(_0xb9f6('0x7'));var config=require(_0xb9f6('0x8'));var attributes=require(_0xb9f6('0x9'));module[_0xb9f6('0xa')]=function(_0x35e8b3,_0x4aa374){return _0x35e8b3[_0xb9f6('0xb')](_0xb9f6('0xc'),attributes,{'tableName':_0xb9f6('0xd'),'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 b9bc273..66b63f8 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 _0xedf3=['http','request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4de958,_0x5b760e){var _0x6c13ff=function(_0x4a744e){while(--_0x4a744e){_0x4de958['push'](_0x4de958['shift']());}};_0x6c13ff(++_0x5b760e);}(_0xedf3,0x116));var _0x3edf=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xedf3[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x3edf('0x0'));var util=require('util');var moment=require(_0x3edf('0x1'));var BPromise=require('bluebird');var rs=require(_0x3edf('0x2'));var fs=require('fs');var Redis=require(_0x3edf('0x3'));var db=require(_0x3edf('0x4'))['db'];var utils=require(_0x3edf('0x5'));var logger=require(_0x3edf('0x6'))(_0x3edf('0x7'));var config=require(_0x3edf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3edf('0x9')][_0x3edf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x233f55,_0x9ee0ae,_0x379156){return new BPromise(function(_0x26cc40,_0x4373aa){return client[_0x3edf('0xb')](_0x233f55,_0x379156)[_0x3edf('0xc')](function(_0x272f46){logger[_0x3edf('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x9ee0ae,'request\x20sent');logger[_0x3edf('0xe')](_0x3edf('0xf'),_0x9ee0ae,_0x3edf('0x10'),JSON[_0x3edf('0x11')](_0x272f46));if(_0x272f46['error']){if(_0x272f46[_0x3edf('0x12')][_0x3edf('0x13')]===0x1f4){logger[_0x3edf('0x12')](_0x3edf('0x14'),_0x9ee0ae,_0x272f46[_0x3edf('0x12')][_0x3edf('0x15')]);return _0x4373aa(_0x272f46[_0x3edf('0x12')][_0x3edf('0x15')]);}logger[_0x3edf('0x12')](_0x3edf('0x14'),_0x9ee0ae,_0x272f46[_0x3edf('0x12')][_0x3edf('0x15')]);return _0x26cc40(_0x272f46[_0x3edf('0x12')]['message']);}else{logger['info'](_0x3edf('0x14'),_0x9ee0ae,_0x3edf('0x10'));_0x26cc40(_0x272f46[_0x3edf('0x16')][_0x3edf('0x15')]);}})[_0x3edf('0x17')](function(_0x2e13c2){logger['error'](_0x3edf('0x14'),_0x9ee0ae,_0x2e13c2);_0x4373aa(_0x2e13c2);});});} \ No newline at end of file +var _0x06bd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x4eb662,_0x540e40){var _0x2d7889=function(_0xbe80a7){while(--_0xbe80a7){_0x4eb662['push'](_0x4eb662['shift']());}};_0x2d7889(++_0x540e40);}(_0x06bd,0x1dd));var _0xd06b=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x06bd[_0x1f1e31];return _0x229b56;};'use strict';var _=require(_0xd06b('0x0'));var util=require(_0xd06b('0x1'));var moment=require('moment');var BPromise=require(_0xd06b('0x2'));var rs=require(_0xd06b('0x3'));var fs=require('fs');var Redis=require(_0xd06b('0x4'));var db=require(_0xd06b('0x5'))['db'];var utils=require(_0xd06b('0x6'));var logger=require(_0xd06b('0x7'))(_0xd06b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd06b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x563fb9,_0x7972fc,_0x51ca41){return new BPromise(function(_0x5ea46a,_0x5b0c94){return client['request'](_0x563fb9,_0x51ca41)['then'](function(_0x3f46eb){logger[_0xd06b('0xa')](_0xd06b('0xb'),_0x7972fc,_0xd06b('0xc'));logger[_0xd06b('0xd')](_0xd06b('0xe'),_0x7972fc,_0xd06b('0xc'),JSON[_0xd06b('0xf')](_0x3f46eb));if(_0x3f46eb[_0xd06b('0x10')]){if(_0x3f46eb['error'][_0xd06b('0x11')]===0x1f4){logger[_0xd06b('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x7972fc,_0x3f46eb[_0xd06b('0x10')][_0xd06b('0x12')]);return _0x5b0c94(_0x3f46eb[_0xd06b('0x10')]['message']);}logger[_0xd06b('0x10')](_0xd06b('0xb'),_0x7972fc,_0x3f46eb[_0xd06b('0x10')][_0xd06b('0x12')]);return _0x5ea46a(_0x3f46eb[_0xd06b('0x10')][_0xd06b('0x12')]);}else{logger[_0xd06b('0xa')](_0xd06b('0xb'),_0x7972fc,'request\x20sent');_0x5ea46a(_0x3f46eb[_0xd06b('0x13')][_0xd06b('0x12')]);}})['catch'](function(_0x549a70){logger[_0xd06b('0x10')](_0xd06b('0xb'),_0x7972fc,_0x549a70);_0x5b0c94(_0x549a70);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index bf4c179..71103c7 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 _0x39b3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','connect-timeout','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x39b3,0xc9));var _0x339b=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x39b3[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require(_0x339b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x339b('0x1'));var express=require('express');var router=express[_0x339b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x339b('0x3'));var interaction=require(_0x339b('0x4'));var config=require(_0x339b('0x5'));var controller=require(_0x339b('0x6'));router[_0x339b('0x7')]('/',auth[_0x339b('0x8')](),controller[_0x339b('0x9')]);router[_0x339b('0x7')](_0x339b('0xa'),auth[_0x339b('0x8')](),controller[_0x339b('0xb')]);router[_0x339b('0xc')]('/',auth[_0x339b('0x8')](),controller[_0x339b('0xd')]);router[_0x339b('0xe')](_0x339b('0xa'),auth[_0x339b('0x8')](),controller[_0x339b('0xf')]);router[_0x339b('0x10')](_0x339b('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb2ff=['show','post','create','update','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0xb2ff,0x123));var _0xfb2f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2ff[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2f('0x4'));var controller=require(_0xfb2f('0x5'));router[_0xfb2f('0x6')]('/',auth[_0xfb2f('0x7')](),controller['index']);router['get'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0x9')]);router[_0xfb2f('0xa')]('/',auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xb')]);router['put'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0xc')]);router['delete'](_0xfb2f('0x8'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xd')]);module[_0xfb2f('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 694d4c1..89975c3 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 _0xdbbc=['name','STRING','sequelize'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0xdbbc,0x19d));var _0xcdbb=function(_0x414b44,_0x3b95a0){_0x414b44=_0x414b44-0x0;var _0x32fa6b=_0xdbbc[_0x414b44];return _0x32fa6b;};'use strict';var Sequelize=require(_0xcdbb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcdbb('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcdbb('0x2')]}}; \ No newline at end of file +var _0xfdcb=['sequelize','exports','STRING','name'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xfdcb,0x134));var _0xbfdc=function(_0x506002,_0x17ad62){_0x506002=_0x506002-0x0;var _0x5a020c=_0xfdcb[_0x506002];return _0x5a020c;};'use strict';var Sequelize=require(_0xbfdc('0x0'));module[_0xbfdc('0x1')]={'name':{'type':Sequelize[_0xbfdc('0x2')],'unique':_0xbfdc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbfdc('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 6ed7546..6945114 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 _0x00ff=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','Variable','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','merge','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x00ff,0x14c));var _0xf00f=function(_0xa2e5db,_0x3c40c9){_0xa2e5db=_0xa2e5db-0x0;var _0x8b54a0=_0x00ff[_0xa2e5db];return _0x8b54a0;};'use strict';var emlformat=require(_0xf00f('0x0'));var rimraf=require(_0xf00f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf00f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf00f('0x3'));var Mustache=require(_0xf00f('0x4'));var util=require(_0xf00f('0x5'));var path=require(_0xf00f('0x6'));var sox=require(_0xf00f('0x7'));var csv=require('to-csv');var ejs=require(_0xf00f('0x8'));var fs=require('fs');var fs_extra=require(_0xf00f('0x9'));var _=require(_0xf00f('0xa'));var squel=require(_0xf00f('0xb'));var crypto=require(_0xf00f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf00f('0xd'));var querystring=require('querystring');var Papa=require(_0xf00f('0xe'));var Redis=require(_0xf00f('0xf'));var authService=require(_0xf00f('0x10'));var qs=require(_0xf00f('0x11'));var as=require(_0xf00f('0x12'));var hardwareService=require(_0xf00f('0x13'));var logger=require(_0xf00f('0x14'))(_0xf00f('0x15'));var utils=require(_0xf00f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf00f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaf508a,_0xb9db08){_0xb9db08=_0xb9db08||0xcc;return function(_0x3b6c2c){if(_0x3b6c2c){return _0xaf508a[_0xf00f('0x18')](_0xb9db08);}return _0xaf508a['status'](_0xb9db08)[_0xf00f('0x19')]();};}function respondWithResult(_0x396816,_0xd960b9){_0xd960b9=_0xd960b9||0xc8;return function(_0x3e4363){if(_0x3e4363){return _0x396816[_0xf00f('0x1a')](_0xd960b9)['json'](_0x3e4363);}};}function respondWithFilteredResult(_0x2451ec,_0x22c80d){return function(_0x182ed5){if(_0x182ed5){var _0x459dd7=typeof _0x22c80d[_0xf00f('0x1b')]===_0xf00f('0x1c')&&typeof _0x22c80d[_0xf00f('0x1d')]===_0xf00f('0x1c');var _0x472652=_0x182ed5[_0xf00f('0x1e')];var _0x3fc33d=_0x459dd7?0x0:_0x22c80d[_0xf00f('0x1b')];var _0x54bb2f=_0x459dd7?_0x182ed5[_0xf00f('0x1e')]:_0x22c80d[_0xf00f('0x1b')]+_0x22c80d[_0xf00f('0x1d')];var _0x4649b3;if(_0x54bb2f>=_0x472652){_0x54bb2f=_0x472652;_0x4649b3=0xc8;}else{_0x4649b3=0xce;}_0x2451ec[_0xf00f('0x1a')](_0x4649b3);return _0x2451ec[_0xf00f('0x1f')](_0xf00f('0x20'),_0x3fc33d+'-'+_0x54bb2f+'/'+_0x472652)['json'](_0x182ed5);}return null;};}function patchUpdates(_0x269a86){return function(_0x32c95f){try{jsonpatch[_0xf00f('0x21')](_0x32c95f,_0x269a86,!![]);}catch(_0x40424f){return BPromise['reject'](_0x40424f);}return _0x32c95f[_0xf00f('0x22')]();};}function saveUpdates(_0x3d120f,_0x2576ad){return function(_0x203416){if(_0x203416){return _0x203416[_0xf00f('0x23')](_0x3d120f)[_0xf00f('0x24')](function(_0x3f2519){return _0x3f2519;});}return null;};}function removeEntity(_0x3e7936,_0xf5c50f){return function(_0x570518){if(_0x570518){return _0x570518[_0xf00f('0x25')]()[_0xf00f('0x24')](function(){var _0x1cfd17=_0x570518[_0xf00f('0x26')]({'plain':!![]});var _0x23cf13='Variables';return db[_0xf00f('0x27')][_0xf00f('0x25')]({'where':{'type':_0x23cf13,'resourceId':_0x1cfd17['id']}})['then'](function(){return _0x570518;});})['then'](function(){_0x3e7936[_0xf00f('0x1a')](0xcc)[_0xf00f('0x19')]();});}};}function handleEntityNotFound(_0x5521b1,_0x2e338d){return function(_0x4eb1cb){if(!_0x4eb1cb){_0x5521b1[_0xf00f('0x18')](0x194);}return _0x4eb1cb;};}function handleError(_0x17e621,_0x35277e){_0x35277e=_0x35277e||0x1f4;return function(_0x38b852){logger[_0xf00f('0x28')](_0x38b852[_0xf00f('0x29')]);if(_0x38b852[_0xf00f('0x2a')]){delete _0x38b852[_0xf00f('0x2a')];}_0x17e621['status'](_0x35277e)['send'](_0x38b852);};}exports['index']=function(_0x33d752,_0xc7852){var _0x2c226c={},_0x36f605={},_0x3ae94f={'count':0x0,'rows':[]};var _0x497c39=_[_0xf00f('0x2b')](db[_0xf00f('0x2c')][_0xf00f('0x2d')],function(_0x37df2b){return{'name':_0x37df2b['fieldName'],'type':_0x37df2b[_0xf00f('0x2e')][_0xf00f('0x2f')]};});_0x36f605['model']=_[_0xf00f('0x2b')](_0x497c39,_0xf00f('0x2a'));_0x36f605['query']=_[_0xf00f('0x30')](_0x33d752[_0xf00f('0x31')]);_0x36f605[_0xf00f('0x32')]=_[_0xf00f('0x33')](_0x36f605['model'],_0x36f605[_0xf00f('0x31')]);_0x2c226c[_0xf00f('0x34')]=_[_0xf00f('0x33')](_0x36f605['model'],qs[_0xf00f('0x35')](_0x33d752[_0xf00f('0x31')][_0xf00f('0x35')]));_0x2c226c[_0xf00f('0x34')]=_0x2c226c['attributes'][_0xf00f('0x36')]?_0x2c226c[_0xf00f('0x34')]:_0x36f605[_0xf00f('0x37')];if(!_0x33d752[_0xf00f('0x31')][_0xf00f('0x38')]('nolimit')){_0x2c226c['limit']=qs[_0xf00f('0x1d')](_0x33d752['query'][_0xf00f('0x1d')]);_0x2c226c['offset']=qs[_0xf00f('0x1b')](_0x33d752[_0xf00f('0x31')][_0xf00f('0x1b')]);}_0x2c226c[_0xf00f('0x39')]=qs['sort'](_0x33d752[_0xf00f('0x31')][_0xf00f('0x3a')]);_0x2c226c['where']=qs['filters'](_[_0xf00f('0x3b')](_0x33d752[_0xf00f('0x31')],_0x36f605[_0xf00f('0x32')]),_0x497c39);if(_0x33d752['query'][_0xf00f('0x3c')]){_0x2c226c['where']=_[_0xf00f('0x3d')](_0x2c226c[_0xf00f('0x3e')],{'$or':_[_0xf00f('0x2b')](_0x497c39,function(_0xf054c7){if(_0xf054c7[_0xf00f('0x2e')]!==_0xf00f('0x3f')){var _0xccbe12={};_0xccbe12[_0xf054c7[_0xf00f('0x2a')]]={'$like':'%'+_0x33d752['query']['filter']+'%'};return _0xccbe12;}})});}_0x2c226c=_[_0xf00f('0x3d')]({},_0x2c226c,_0x33d752[_0xf00f('0x40')]);var _0x289a46={'where':_0x2c226c[_0xf00f('0x3e')]};return db['Variable'][_0xf00f('0x1e')](_0x289a46)['then'](function(_0x3c8ff4){_0x3ae94f[_0xf00f('0x1e')]=_0x3c8ff4;if(_0x33d752['query'][_0xf00f('0x41')]){_0x2c226c['include']=[{'all':!![]}];}return db[_0xf00f('0x2c')][_0xf00f('0x42')](_0x2c226c);})[_0xf00f('0x24')](function(_0xd10022){_0x3ae94f[_0xf00f('0x43')]=_0xd10022;return _0x3ae94f;})[_0xf00f('0x24')](respondWithFilteredResult(_0xc7852,_0x2c226c))[_0xf00f('0x44')](handleError(_0xc7852,null));};exports[_0xf00f('0x45')]=function(_0x544824,_0x1664ed){var _0x201757={'raw':!![],'where':{'id':_0x544824[_0xf00f('0x46')]['id']}},_0x5acb44={};_0x5acb44[_0xf00f('0x37')]=_[_0xf00f('0x30')](db[_0xf00f('0x2c')][_0xf00f('0x2d')]);_0x5acb44[_0xf00f('0x31')]=_[_0xf00f('0x30')](_0x544824[_0xf00f('0x31')]);_0x5acb44[_0xf00f('0x32')]=_['intersection'](_0x5acb44[_0xf00f('0x37')],_0x5acb44[_0xf00f('0x31')]);_0x201757[_0xf00f('0x34')]=_['intersection'](_0x5acb44[_0xf00f('0x37')],qs[_0xf00f('0x35')](_0x544824['query'][_0xf00f('0x35')]));_0x201757['attributes']=_0x201757[_0xf00f('0x34')]['length']?_0x201757[_0xf00f('0x34')]:_0x5acb44['model'];if(_0x544824[_0xf00f('0x31')][_0xf00f('0x41')]){_0x201757['include']=[{'all':!![]}];}_0x201757=_[_0xf00f('0x3d')]({},_0x201757,_0x544824[_0xf00f('0x40')]);return db[_0xf00f('0x2c')][_0xf00f('0x47')](_0x201757)[_0xf00f('0x24')](handleEntityNotFound(_0x1664ed,null))[_0xf00f('0x24')](respondWithResult(_0x1664ed,null))[_0xf00f('0x44')](handleError(_0x1664ed,null));};exports[_0xf00f('0x48')]=function(_0x14b13e,_0x44c092){return db[_0xf00f('0x2c')]['create'](_0x14b13e['body'],{})[_0xf00f('0x24')](function(_0x345256){var _0x4b5a4b=_0x14b13e[_0xf00f('0x49')][_0xf00f('0x26')]({'plain':!![]});if(!_0x4b5a4b)throw new Error(_0xf00f('0x4a'));if(_0x4b5a4b[_0xf00f('0x4b')]==='user'){var _0x375b93=_0x345256['get']({'plain':!![]});var _0x473304=_0xf00f('0x4c');return db['UserProfileSection'][_0xf00f('0x47')]({'where':{'name':_0x473304,'userProfileId':_0x4b5a4b['userProfileId']},'raw':!![]})[_0xf00f('0x24')](function(_0x44cda2){if(_0x44cda2&&_0x44cda2['autoAssociation']===0x0){return db[_0xf00f('0x27')]['create']({'name':_0x375b93[_0xf00f('0x2a')],'resourceId':_0x375b93['id'],'type':_0x44cda2['name'],'sectionId':_0x44cda2['id']},{})[_0xf00f('0x24')](function(){return _0x345256;});}else{return _0x345256;}})[_0xf00f('0x44')](function(_0x2b608a){logger['error'](_0xf00f('0x4d'),_0x2b608a);throw _0x2b608a;});}return _0x345256;})['then'](respondWithResult(_0x44c092,0xc9))[_0xf00f('0x44')](handleError(_0x44c092,null));};exports[_0xf00f('0x23')]=function(_0x174070,_0x3615ef){if(_0x174070[_0xf00f('0x4e')]['id']){delete _0x174070[_0xf00f('0x4e')]['id'];}return db['Variable']['find']({'where':{'id':_0x174070[_0xf00f('0x46')]['id']}})[_0xf00f('0x24')](handleEntityNotFound(_0x3615ef,null))[_0xf00f('0x24')](saveUpdates(_0x174070['body'],null))[_0xf00f('0x24')](respondWithResult(_0x3615ef,null))[_0xf00f('0x44')](handleError(_0x3615ef,null));};exports[_0xf00f('0x25')]=function(_0x50a37d,_0x2c4fe1){return db[_0xf00f('0x2c')][_0xf00f('0x47')]({'where':{'id':_0x50a37d['params']['id']}})[_0xf00f('0x24')](handleEntityNotFound(_0x2c4fe1,null))[_0xf00f('0x24')](removeEntity(_0x2c4fe1,null))[_0xf00f('0x44')](handleError(_0x2c4fe1,null));}; \ No newline at end of file +var _0x9b9c=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','catch','rawAttributes','includeAll','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','update','then','get','Variables','UserProfileResource','destroy','sendStatus','error','name','map','Variable','fieldName','type','key','query','keys'];(function(_0x42ce4a,_0x842af2){var _0x22d1f4=function(_0x3edacc){while(--_0x3edacc){_0x42ce4a['push'](_0x42ce4a['shift']());}};_0x22d1f4(++_0x842af2);}(_0x9b9c,0x165));var _0xc9b9=function(_0x451bb1,_0x4f2151){_0x451bb1=_0x451bb1-0x0;var _0xa2ffaa=_0x9b9c[_0x451bb1];return _0xa2ffaa;};'use strict';var emlformat=require(_0xc9b9('0x0'));var rimraf=require(_0xc9b9('0x1'));var zipdir=require(_0xc9b9('0x2'));var jsonpatch=require(_0xc9b9('0x3'));var rp=require(_0xc9b9('0x4'));var moment=require(_0xc9b9('0x5'));var BPromise=require(_0xc9b9('0x6'));var Mustache=require(_0xc9b9('0x7'));var util=require(_0xc9b9('0x8'));var path=require(_0xc9b9('0x9'));var sox=require(_0xc9b9('0xa'));var csv=require(_0xc9b9('0xb'));var ejs=require(_0xc9b9('0xc'));var fs=require('fs');var fs_extra=require(_0xc9b9('0xd'));var _=require('lodash');var squel=require(_0xc9b9('0xe'));var crypto=require(_0xc9b9('0xf'));var jsforce=require(_0xc9b9('0x10'));var deskjs=require(_0xc9b9('0x11'));var toCsv=require(_0xc9b9('0xb'));var querystring=require(_0xc9b9('0x12'));var Papa=require(_0xc9b9('0x13'));var Redis=require(_0xc9b9('0x14'));var authService=require(_0xc9b9('0x15'));var qs=require(_0xc9b9('0x16'));var as=require(_0xc9b9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9b9('0x18'))(_0xc9b9('0x19'));var utils=require('../../config/utils');var config=require(_0xc9b9('0x1a'));var licenseUtil=require(_0xc9b9('0x1b'));var db=require(_0xc9b9('0x1c'))['db'];function respondWithStatusCode(_0x2fb78b,_0x2ff3ce){_0x2ff3ce=_0x2ff3ce||0xcc;return function(_0x278b14){if(_0x278b14){return _0x2fb78b['sendStatus'](_0x2ff3ce);}return _0x2fb78b[_0xc9b9('0x1d')](_0x2ff3ce)[_0xc9b9('0x1e')]();};}function respondWithResult(_0x236fbc,_0x2245d8){_0x2245d8=_0x2245d8||0xc8;return function(_0x166386){if(_0x166386){return _0x236fbc[_0xc9b9('0x1d')](_0x2245d8)['json'](_0x166386);}};}function respondWithFilteredResult(_0x45e14d,_0x494344){return function(_0xa5e828){if(_0xa5e828){var _0x2936d5=typeof _0x494344[_0xc9b9('0x1f')]===_0xc9b9('0x20')&&typeof _0x494344[_0xc9b9('0x21')]===_0xc9b9('0x20');var _0x3ed904=_0xa5e828[_0xc9b9('0x22')];var _0x4d2e0e=_0x2936d5?0x0:_0x494344[_0xc9b9('0x1f')];var _0x2e8404=_0x2936d5?_0xa5e828[_0xc9b9('0x22')]:_0x494344['offset']+_0x494344[_0xc9b9('0x21')];var _0x18eda4;if(_0x2e8404>=_0x3ed904){_0x2e8404=_0x3ed904;_0x18eda4=0xc8;}else{_0x18eda4=0xce;}_0x45e14d[_0xc9b9('0x1d')](_0x18eda4);return _0x45e14d[_0xc9b9('0x23')]('Content-Range',_0x4d2e0e+'-'+_0x2e8404+'/'+_0x3ed904)['json'](_0xa5e828);}return null;};}function patchUpdates(_0x4bea3b){return function(_0x1a469e){try{jsonpatch['apply'](_0x1a469e,_0x4bea3b,!![]);}catch(_0x5d49f2){return BPromise[_0xc9b9('0x24')](_0x5d49f2);}return _0x1a469e['save']();};}function saveUpdates(_0x1bcfde,_0x3878f5){return function(_0x4d0ed5){if(_0x4d0ed5){return _0x4d0ed5[_0xc9b9('0x25')](_0x1bcfde)[_0xc9b9('0x26')](function(_0x166545){return _0x166545;});}return null;};}function removeEntity(_0x1d05bf,_0x4d27b6){return function(_0x12b9ba){if(_0x12b9ba){return _0x12b9ba['destroy']()['then'](function(){var _0x44a828=_0x12b9ba[_0xc9b9('0x27')]({'plain':!![]});var _0x10647e=_0xc9b9('0x28');return db[_0xc9b9('0x29')][_0xc9b9('0x2a')]({'where':{'type':_0x10647e,'resourceId':_0x44a828['id']}})[_0xc9b9('0x26')](function(){return _0x12b9ba;});})[_0xc9b9('0x26')](function(){_0x1d05bf['status'](0xcc)[_0xc9b9('0x1e')]();});}};}function handleEntityNotFound(_0x1c4c8f,_0x4b8a0f){return function(_0x31b7fd){if(!_0x31b7fd){_0x1c4c8f[_0xc9b9('0x2b')](0x194);}return _0x31b7fd;};}function handleError(_0xa7ced4,_0x1347cf){_0x1347cf=_0x1347cf||0x1f4;return function(_0x21b1dd){logger[_0xc9b9('0x2c')](_0x21b1dd['stack']);if(_0x21b1dd['name']){delete _0x21b1dd[_0xc9b9('0x2d')];}_0xa7ced4[_0xc9b9('0x1d')](_0x1347cf)['send'](_0x21b1dd);};}exports['index']=function(_0xe2bbbe,_0x2b9437){var _0x3a4ab3={},_0x54193d={},_0x29b292={'count':0x0,'rows':[]};var _0x2ee2ca=_[_0xc9b9('0x2e')](db[_0xc9b9('0x2f')]['rawAttributes'],function(_0x6678bf){return{'name':_0x6678bf[_0xc9b9('0x30')],'type':_0x6678bf[_0xc9b9('0x31')][_0xc9b9('0x32')]};});_0x54193d['model']=_[_0xc9b9('0x2e')](_0x2ee2ca,'name');_0x54193d[_0xc9b9('0x33')]=_[_0xc9b9('0x34')](_0xe2bbbe['query']);_0x54193d['filters']=_[_0xc9b9('0x35')](_0x54193d[_0xc9b9('0x36')],_0x54193d[_0xc9b9('0x33')]);_0x3a4ab3[_0xc9b9('0x37')]=_[_0xc9b9('0x35')](_0x54193d[_0xc9b9('0x36')],qs[_0xc9b9('0x38')](_0xe2bbbe[_0xc9b9('0x33')]['fields']));_0x3a4ab3[_0xc9b9('0x37')]=_0x3a4ab3[_0xc9b9('0x37')][_0xc9b9('0x39')]?_0x3a4ab3[_0xc9b9('0x37')]:_0x54193d[_0xc9b9('0x36')];if(!_0xe2bbbe[_0xc9b9('0x33')][_0xc9b9('0x3a')](_0xc9b9('0x3b'))){_0x3a4ab3[_0xc9b9('0x21')]=qs[_0xc9b9('0x21')](_0xe2bbbe[_0xc9b9('0x33')][_0xc9b9('0x21')]);_0x3a4ab3['offset']=qs[_0xc9b9('0x1f')](_0xe2bbbe[_0xc9b9('0x33')]['offset']);}_0x3a4ab3[_0xc9b9('0x3c')]=qs[_0xc9b9('0x3d')](_0xe2bbbe[_0xc9b9('0x33')][_0xc9b9('0x3d')]);_0x3a4ab3[_0xc9b9('0x3e')]=qs['filters'](_[_0xc9b9('0x3f')](_0xe2bbbe[_0xc9b9('0x33')],_0x54193d[_0xc9b9('0x40')]),_0x2ee2ca);if(_0xe2bbbe[_0xc9b9('0x33')][_0xc9b9('0x41')]){_0x3a4ab3[_0xc9b9('0x3e')]=_[_0xc9b9('0x42')](_0x3a4ab3[_0xc9b9('0x3e')],{'$or':_[_0xc9b9('0x2e')](_0x2ee2ca,function(_0x762121){if(_0x762121[_0xc9b9('0x31')]!=='VIRTUAL'){var _0x2b9873={};_0x2b9873[_0x762121[_0xc9b9('0x2d')]]={'$like':'%'+_0xe2bbbe['query'][_0xc9b9('0x41')]+'%'};return _0x2b9873;}})});}_0x3a4ab3=_[_0xc9b9('0x42')]({},_0x3a4ab3,_0xe2bbbe[_0xc9b9('0x43')]);var _0x215c84={'where':_0x3a4ab3['where']};return db['Variable'][_0xc9b9('0x22')](_0x215c84)[_0xc9b9('0x26')](function(_0x5c8dea){_0x29b292[_0xc9b9('0x22')]=_0x5c8dea;if(_0xe2bbbe[_0xc9b9('0x33')]['includeAll']){_0x3a4ab3[_0xc9b9('0x44')]=[{'all':!![]}];}return db[_0xc9b9('0x2f')]['findAll'](_0x3a4ab3);})[_0xc9b9('0x26')](function(_0x57727c){_0x29b292['rows']=_0x57727c;return _0x29b292;})[_0xc9b9('0x26')](respondWithFilteredResult(_0x2b9437,_0x3a4ab3))[_0xc9b9('0x45')](handleError(_0x2b9437,null));};exports['show']=function(_0x2a72ac,_0x565d06){var _0x36507b={'raw':!![],'where':{'id':_0x2a72ac['params']['id']}},_0x504b8a={};_0x504b8a['model']=_['keys'](db[_0xc9b9('0x2f')][_0xc9b9('0x46')]);_0x504b8a['query']=_[_0xc9b9('0x34')](_0x2a72ac[_0xc9b9('0x33')]);_0x504b8a['filters']=_['intersection'](_0x504b8a['model'],_0x504b8a[_0xc9b9('0x33')]);_0x36507b[_0xc9b9('0x37')]=_[_0xc9b9('0x35')](_0x504b8a['model'],qs[_0xc9b9('0x38')](_0x2a72ac[_0xc9b9('0x33')][_0xc9b9('0x38')]));_0x36507b['attributes']=_0x36507b[_0xc9b9('0x37')][_0xc9b9('0x39')]?_0x36507b[_0xc9b9('0x37')]:_0x504b8a[_0xc9b9('0x36')];if(_0x2a72ac[_0xc9b9('0x33')][_0xc9b9('0x47')]){_0x36507b['include']=[{'all':!![]}];}_0x36507b=_[_0xc9b9('0x42')]({},_0x36507b,_0x2a72ac[_0xc9b9('0x43')]);return db['Variable'][_0xc9b9('0x48')](_0x36507b)[_0xc9b9('0x26')](handleEntityNotFound(_0x565d06,null))[_0xc9b9('0x26')](respondWithResult(_0x565d06,null))['catch'](handleError(_0x565d06,null));};exports[_0xc9b9('0x49')]=function(_0x39439f,_0x2cc2e7){return db['Variable'][_0xc9b9('0x49')](_0x39439f['body'],{})[_0xc9b9('0x26')](function(_0x4929ba){var _0x1f8e48=_0x39439f[_0xc9b9('0x4a')][_0xc9b9('0x27')]({'plain':!![]});if(!_0x1f8e48)throw new Error(_0xc9b9('0x4b'));if(_0x1f8e48[_0xc9b9('0x4c')]===_0xc9b9('0x4a')){var _0x1638ed=_0x4929ba[_0xc9b9('0x27')]({'plain':!![]});var _0xd8253e=_0xc9b9('0x28');return db[_0xc9b9('0x4d')][_0xc9b9('0x48')]({'where':{'name':_0xd8253e,'userProfileId':_0x1f8e48[_0xc9b9('0x4e')]},'raw':!![]})['then'](function(_0x59e087){if(_0x59e087&&_0x59e087['autoAssociation']===0x0){return db[_0xc9b9('0x29')][_0xc9b9('0x49')]({'name':_0x1638ed['name'],'resourceId':_0x1638ed['id'],'type':_0x59e087['name'],'sectionId':_0x59e087['id']},{})[_0xc9b9('0x26')](function(){return _0x4929ba;});}else{return _0x4929ba;}})['catch'](function(_0x2db261){logger[_0xc9b9('0x2c')](_0xc9b9('0x4f'),_0x2db261);throw _0x2db261;});}return _0x4929ba;})[_0xc9b9('0x26')](respondWithResult(_0x2cc2e7,0xc9))[_0xc9b9('0x45')](handleError(_0x2cc2e7,null));};exports['update']=function(_0x43b245,_0x4d1f21){if(_0x43b245['body']['id']){delete _0x43b245[_0xc9b9('0x50')]['id'];}return db['Variable'][_0xc9b9('0x48')]({'where':{'id':_0x43b245[_0xc9b9('0x51')]['id']}})[_0xc9b9('0x26')](handleEntityNotFound(_0x4d1f21,null))[_0xc9b9('0x26')](saveUpdates(_0x43b245[_0xc9b9('0x50')],null))[_0xc9b9('0x26')](respondWithResult(_0x4d1f21,null))[_0xc9b9('0x45')](handleError(_0x4d1f21,null));};exports['destroy']=function(_0x40cabb,_0x37b8e0){return db[_0xc9b9('0x2f')]['find']({'where':{'id':_0x40cabb[_0xc9b9('0x51')]['id']}})[_0xc9b9('0x26')](handleEntityNotFound(_0x37b8e0,null))[_0xc9b9('0x26')](removeEntity(_0x37b8e0,null))[_0xc9b9('0x45')](handleError(_0x37b8e0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c873756..16ae749 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 _0xed95=['../../config/environment','./variable.attributes','exports','define','Variable','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0xed95,0x131));var _0x5ed9=function(_0x1c4795,_0x12958d){_0x1c4795=_0x1c4795-0x0;var _0x1c51d7=_0xed95[_0x1c4795];return _0x1c51d7;};'use strict';var _=require('lodash');var util=require(_0x5ed9('0x0'));var logger=require(_0x5ed9('0x1'))(_0x5ed9('0x2'));var moment=require(_0x5ed9('0x3'));var BPromise=require(_0x5ed9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ed9('0x5'));var rimraf=require(_0x5ed9('0x6'));var config=require(_0x5ed9('0x7'));var attributes=require(_0x5ed9('0x8'));module[_0x5ed9('0x9')]=function(_0x43adb2,_0x1202d9){return _0x43adb2[_0x5ed9('0xa')](_0x5ed9('0xb'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6541=['path','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1391c2,_0x1e4c67){var _0x3844ca=function(_0x30ba05){while(--_0x30ba05){_0x1391c2['push'](_0x1391c2['shift']());}};_0x3844ca(++_0x1e4c67);}(_0x6541,0x193));var _0x1654=function(_0x221165,_0x9a7211){_0x221165=_0x221165-0x0;var _0x573559=_0x6541[_0x221165];return _0x573559;};'use strict';var _=require(_0x1654('0x0'));var util=require('util');var logger=require(_0x1654('0x1'))(_0x1654('0x2'));var moment=require(_0x1654('0x3'));var BPromise=require(_0x1654('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1654('0x5'));var rimraf=require(_0x1654('0x6'));var config=require(_0x1654('0x7'));var attributes=require(_0x1654('0x8'));module[_0x1654('0x9')]=function(_0xa45910,_0x38fd66){return _0xa45910['define'](_0x1654('0xa'),attributes,{'tableName':_0x1654('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 e06c211..515926e 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x5fc3[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x1403d4,_0xc9f2f1){var _0x396479=function(_0x3b62c0){while(--_0x3b62c0){_0x1403d4['push'](_0x1403d4['shift']());}};_0x396479(++_0xc9f2f1);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c95c309..5e59653 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 _0x3afa=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','get','/restart','restart','/migrations','exports','Router','../../components/auth/service','./version.controller'];(function(_0x3087a5,_0x168a86){var _0x1241c1=function(_0x3fdaad){while(--_0x3fdaad){_0x3087a5['push'](_0x3087a5['shift']());}};_0x1241c1(++_0x168a86);}(_0x3afa,0x11d));var _0xa3af=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x3afa[_0x53afa6];return _0x51f86a;};'use strict';var express=require('express');var router=express[_0xa3af('0x0')]();var auth=require(_0xa3af('0x1'));var controller=require(_0xa3af('0x2'));router['get']('/',controller[_0xa3af('0x3')]);router['get'](_0xa3af('0x4'),auth[_0xa3af('0x5')](),auth[_0xa3af('0x6')](),controller[_0xa3af('0x7')]);router['get'](_0xa3af('0x8'),auth[_0xa3af('0x5')](),auth[_0xa3af('0x6')](),controller[_0xa3af('0x9')]);router['get'](_0xa3af('0xa'),auth[_0xa3af('0x5')](),auth[_0xa3af('0x6')](),controller['pull']);router[_0xa3af('0xb')](_0xa3af('0xc'),auth[_0xa3af('0x5')](),controller[_0xa3af('0xd')]);router[_0xa3af('0xb')](_0xa3af('0xe'),controller['migrations']);module[_0xa3af('0xf')]=router; \ No newline at end of file +var _0xc201=['./version.controller','/fetch','fetch','get','/reset','isAuthenticated','canUpdate','reset','/pull','/restart','restart','/migrations','exports','Router'];(function(_0x188945,_0x2aafa5){var _0x4959c2=function(_0x534f43){while(--_0x534f43){_0x188945['push'](_0x188945['shift']());}};_0x4959c2(++_0x2aafa5);}(_0xc201,0x133));var _0x1c20=function(_0x148516,_0x2c5333){_0x148516=_0x148516-0x0;var _0x4fbad3=_0xc201[_0x148516];return _0x4fbad3;};'use strict';var express=require('express');var router=express[_0x1c20('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x1c20('0x1'));router['get']('/',controller['index']);router['get'](_0x1c20('0x2'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1c20('0x3')]);router[_0x1c20('0x4')](_0x1c20('0x5'),auth[_0x1c20('0x6')](),auth[_0x1c20('0x7')](),controller[_0x1c20('0x8')]);router['get'](_0x1c20('0x9'),auth[_0x1c20('0x6')](),auth[_0x1c20('0x7')](),controller['pull']);router['get'](_0x1c20('0xa'),auth[_0x1c20('0x6')](),controller[_0x1c20('0xb')]);router['get'](_0x1c20('0xc'),controller['migrations']);module[_0x1c20('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 79006f7..8a57a9f 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 _0x7ced=['error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','then','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','server','migrations','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','lodash','version','compare-versions','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ced,0x1a5));var _0xd7ce=function(_0x501932,_0x432837){_0x501932=_0x501932-0x0;var _0x1fe5eb=_0x7ced[_0x501932];return _0x1fe5eb;};'use strict';var Umzug=require(_0xd7ce('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xd7ce('0x1'));var pkginfo=require('pkginfo')(module,_0xd7ce('0x2'));var compareVersions=require(_0xd7ce('0x3'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xd7ce('0x4'));var pm2=require('../../config/pm2');var logger=require(_0xd7ce('0x5'))(_0xd7ce('0x6'));var git=require(_0xd7ce('0x7'))(config[_0xd7ce('0x8')]);exports[_0xd7ce('0x9')]=function(_0x34329f,_0x182497){var _0x2661f6={'current':module[_0xd7ce('0xa')][_0xd7ce('0x2')],'phonebar':0x2};if(_0x34329f[_0xd7ce('0xb')]&&_0x34329f[_0xd7ce('0xb')]['latest']){return git[_0xd7ce('0xc')]()[_0xd7ce('0xd')](function(_0xe8945d,_0x1cea28){_0x2661f6[_0xd7ce('0xe')]=(_0xe8945d?module[_0xd7ce('0xa')][_0xd7ce('0x2')]:_0x1cea28[_0xd7ce('0xe')])||_0xd7ce('0xf');return _0x182497[_0xd7ce('0x10')](0xc8)['json'](_0x2661f6);});}else{return _0x182497[_0xd7ce('0x10')](0xc8)[_0xd7ce('0x11')](_0x2661f6);}};exports[_0xd7ce('0xc')]=function(_0x168600,_0x1941a2){return git[_0xd7ce('0xc')]([_0xd7ce('0x12'),_0xd7ce('0x13')],function(_0x28b076){if(_0x28b076){logger[_0xd7ce('0x14')](_0x28b076);return _0x1941a2['status'](0x1f4)['json'](_0x28b076);}logger[_0xd7ce('0x15')](_0xd7ce('0x16'));return _0x1941a2[_0xd7ce('0x10')](0xc8)[_0xd7ce('0x11')]({'output':_0xd7ce('0x17')});});};exports[_0xd7ce('0x18')]=function(_0x55030e,_0x39a4c3){return git[_0xd7ce('0x18')](['--hard','FETCH_HEAD'],function(_0x2b07c0){if(_0x2b07c0){logger['error'](_0x2b07c0);return _0x39a4c3[_0xd7ce('0x10')](0x1f4)[_0xd7ce('0x11')](_0x2b07c0);}logger['info'](_0xd7ce('0x19'));return _0x39a4c3[_0xd7ce('0x10')](0xc8)['json']({'output':_0xd7ce('0x1a')});});};exports[_0xd7ce('0x1b')]=function(_0x301a11,_0x1d9ad7){exec(_0xd7ce('0x1c'),function(_0xc162b1,_0x280513,_0x40d565){logger[_0xd7ce('0x15')](_0x280513);logger[_0xd7ce('0x15')](_0x40d565);if(_0xc162b1){logger[_0xd7ce('0x14')](_0xc162b1);return _0x1d9ad7[_0xd7ce('0x10')](0x1f4)[_0xd7ce('0x11')](_0xc162b1);}return _0x1d9ad7[_0xd7ce('0x10')](0xc8)[_0xd7ce('0x11')]({'output':_0x280513});});};exports['restart']=function(_0x5ccc2e,_0x536921){return pm2['restart']('motion2')[_0xd7ce('0x1d')](function(_0x544d08){logger[_0xd7ce('0x15')]('pm2\x20restart\x20motion\x20%s',_0x544d08);return _0x536921['status'](0xc8)[_0xd7ce('0x11')]({'output':_0xd7ce('0x1e')});})['catch'](function(_0x1eb835){logger['error'](_0x1eb835);return _0x536921[_0xd7ce('0x10')](0x1f4)[_0xd7ce('0x11')](_0x1eb835);});};exports['migrations']=function(_0x57dc62,_0x1fe09f){var _0x2c2687=fs[_0xd7ce('0x1f')](path[_0xd7ce('0x20')](config[_0xd7ce('0x8')],_0xd7ce('0x21'),_0xd7ce('0x22')));var _0x2ba1bf=[];for(var _0x1c08e0=0x0;_0x1c08e0<_0x2c2687[_0xd7ce('0x23')];_0x1c08e0++){var _0x41c583=_0x2c2687[_0x1c08e0][_0xd7ce('0x24')](_0xd7ce('0x25'),'');if(compareVersions(module['exports'][_0xd7ce('0x2')],_0x41c583)===-0x1){_0x2ba1bf[_0xd7ce('0x26')](_0x41c583);}}if(_0x2ba1bf['length']){var _0x310090=_0x2ba1bf[_0xd7ce('0x27')](compareVersions);var _0x3f7051=new Umzug({'storage':_0xd7ce('0x28'),'storageOptions':{'model':db[_0xd7ce('0x29')],'modelName':_0xd7ce('0x29'),'columnName':_0xd7ce('0x2')},'migrations':{'params':[db[_0xd7ce('0x28')][_0xd7ce('0x2a')](),db['sequelize'][_0xd7ce('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xd7ce('0x20')](config[_0xd7ce('0x8')],_0xd7ce('0x21'),'migrations'),'pattern':/\.js$/}});_0x3f7051['up']({'migrations':_[_0xd7ce('0x2c')](_0x310090,function(_0xcc9492){return _0xcc9492+'.js';})})[_0xd7ce('0x1d')](function(){return _0x1fe09f[_0xd7ce('0x10')](0xc8)[_0xd7ce('0x11')]({'output':_0xd7ce('0x2d')+module[_0xd7ce('0xa')][_0xd7ce('0x2')]+_0xd7ce('0x2e')+_[_0xd7ce('0x2f')](_0x310090),'migrations':_['join'](_0x310090)});})['catch'](function(_0x46df59){if(_0x46df59 instanceof db[_0xd7ce('0x28')][_0xd7ce('0x30')]){return _0x1fe09f[_0xd7ce('0x10')](0xc8)[_0xd7ce('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1fe09f[_0xd7ce('0x10')](0x1f4)[_0xd7ce('0x11')](_0x46df59);}});}else{return _0x1fe09f[_0xd7ce('0x10')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xc6fe=['length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','then','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','index','exports','latest','tags','2.0.0','json','status','fetch','origin','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','error','migrations','readdirSync','server'];(function(_0x27a231,_0x59e006){var _0xab4e27=function(_0x5e4a43){while(--_0x5e4a43){_0x27a231['push'](_0x27a231['shift']());}};_0xab4e27(++_0x59e006);}(_0xc6fe,0x77));var _0xec6f=function(_0x5cc232,_0x45214c){_0x5cc232=_0x5cc232-0x0;var _0x5bb57d=_0xc6fe[_0x5cc232];return _0x5bb57d;};'use strict';var Umzug=require(_0xec6f('0x0'));var path=require(_0xec6f('0x1'));var fs=require('fs');var _=require(_0xec6f('0x2'));var pkginfo=require('pkginfo')(module,_0xec6f('0x3'));var compareVersions=require(_0xec6f('0x4'));var exec=require('child_process')[_0xec6f('0x5')];var db=require(_0xec6f('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xec6f('0x7'));var logger=require(_0xec6f('0x8'))('update');var git=require(_0xec6f('0x9'))(config[_0xec6f('0xa')]);exports[_0xec6f('0xb')]=function(_0x2dfee6,_0x3c020e){var _0x2fd5cc={'current':module[_0xec6f('0xc')][_0xec6f('0x3')],'phonebar':0x2};if(_0x2dfee6['query']&&_0x2dfee6['query'][_0xec6f('0xd')]){return git['fetch']()[_0xec6f('0xe')](function(_0x39fd3b,_0x53cbd0){_0x2fd5cc[_0xec6f('0xd')]=(_0x39fd3b?module[_0xec6f('0xc')][_0xec6f('0x3')]:_0x53cbd0[_0xec6f('0xd')])||_0xec6f('0xf');return _0x3c020e['status'](0xc8)[_0xec6f('0x10')](_0x2fd5cc);});}else{return _0x3c020e[_0xec6f('0x11')](0xc8)['json'](_0x2fd5cc);}};exports[_0xec6f('0x12')]=function(_0x3ab8fc,_0x2a0abc){return git[_0xec6f('0x12')]([_0xec6f('0x13'),'master'],function(_0x58381e){if(_0x58381e){logger['error'](_0x58381e);return _0x2a0abc['status'](0x1f4)[_0xec6f('0x10')](_0x58381e);}logger[_0xec6f('0x14')](_0xec6f('0x15'));return _0x2a0abc[_0xec6f('0x11')](0xc8)['json']({'output':_0xec6f('0x16')});});};exports['reset']=function(_0xb91b29,_0x4acb6a){return git['reset']([_0xec6f('0x17'),_0xec6f('0x18')],function(_0x558444){if(_0x558444){logger['error'](_0x558444);return _0x4acb6a[_0xec6f('0x11')](0x1f4)[_0xec6f('0x10')](_0x558444);}logger['info'](_0xec6f('0x19'));return _0x4acb6a[_0xec6f('0x11')](0xc8)[_0xec6f('0x10')]({'output':_0xec6f('0x1a')});});};exports[_0xec6f('0x1b')]=function(_0x491411,_0x22a0d9){exec(_0xec6f('0x1c'),function(_0x117af8,_0xef67d6,_0x1c85e4){logger[_0xec6f('0x14')](_0xef67d6);logger[_0xec6f('0x14')](_0x1c85e4);if(_0x117af8){logger['error'](_0x117af8);return _0x22a0d9[_0xec6f('0x11')](0x1f4)['json'](_0x117af8);}return _0x22a0d9[_0xec6f('0x11')](0xc8)[_0xec6f('0x10')]({'output':_0xef67d6});});};exports['restart']=function(_0x5ae3a6,_0xdf2b9e){return pm2[_0xec6f('0x1d')](_0xec6f('0x1e'))['then'](function(_0x4a1954){logger[_0xec6f('0x14')](_0xec6f('0x1f'),_0x4a1954);return _0xdf2b9e[_0xec6f('0x11')](0xc8)[_0xec6f('0x10')]({'output':_0xec6f('0x20')});})['catch'](function(_0x34820e){logger[_0xec6f('0x21')](_0x34820e);return _0xdf2b9e[_0xec6f('0x11')](0x1f4)[_0xec6f('0x10')](_0x34820e);});};exports[_0xec6f('0x22')]=function(_0x3986f5,_0x8564ca){var _0x434d50=fs[_0xec6f('0x23')](path['join'](config[_0xec6f('0xa')],_0xec6f('0x24'),_0xec6f('0x22')));var _0x100ec9=[];for(var _0x47ab05=0x0;_0x47ab05<_0x434d50[_0xec6f('0x25')];_0x47ab05++){var _0x37a0ba=_0x434d50[_0x47ab05]['replace'](_0xec6f('0x26'),'');if(compareVersions(module[_0xec6f('0xc')]['version'],_0x37a0ba)===-0x1){_0x100ec9[_0xec6f('0x27')](_0x37a0ba);}}if(_0x100ec9['length']){var _0x193c5f=_0x100ec9[_0xec6f('0x28')](compareVersions);var _0x5d1a04=new Umzug({'storage':_0xec6f('0x29'),'storageOptions':{'model':db[_0xec6f('0x2a')],'modelName':_0xec6f('0x2a'),'columnName':_0xec6f('0x3')},'migrations':{'params':[db[_0xec6f('0x29')][_0xec6f('0x2b')](),db[_0xec6f('0x29')][_0xec6f('0x2c')],function(){throw new Error(_0xec6f('0x2d'));}],'path':path[_0xec6f('0x2e')](config[_0xec6f('0xa')],_0xec6f('0x24'),'migrations'),'pattern':/\.js$/}});_0x5d1a04['up']({'migrations':_['map'](_0x193c5f,function(_0x5061a7){return _0x5061a7+'.js';})})[_0xec6f('0x2f')](function(){return _0x8564ca[_0xec6f('0x11')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xec6f('0x3')]+_0xec6f('0x30')+_['last'](_0x193c5f),'migrations':_[_0xec6f('0x2e')](_0x193c5f)});})[_0xec6f('0x31')](function(_0x373934){if(_0x373934 instanceof db[_0xec6f('0x29')][_0xec6f('0x32')]){return _0x8564ca[_0xec6f('0x11')](0xc8)[_0xec6f('0x10')]({'output':_0xec6f('0x33')});}else{return _0x8564ca['status'](0x1f4)['json'](_0x373934);}});}else{return _0x8564ca[_0xec6f('0x11')](0xc8)[_0xec6f('0x10')]({'output':_0xec6f('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index a9b113b..f9d301e 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 _0x4592=['update','delete','/:id','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','post','create','put'];(function(_0x366e6a,_0x2caca5){var _0x1c2323=function(_0x384f49){while(--_0x384f49){_0x366e6a['push'](_0x366e6a['shift']());}};_0x1c2323(++_0x2caca5);}(_0x4592,0x194));var _0x2459=function(_0x2721f6,_0x19d39e){_0x2721f6=_0x2721f6-0x0;var _0x5b6bbe=_0x4592[_0x2721f6];return _0x5b6bbe;};'use strict';var multer=require(_0x2459('0x0'));var util=require(_0x2459('0x1'));var path=require(_0x2459('0x2'));var timeout=require('connect-timeout');var express=require(_0x2459('0x3'));var router=express['Router']();var fs_extra=require(_0x2459('0x4'));var auth=require(_0x2459('0x5'));var interaction=require(_0x2459('0x6'));var config=require(_0x2459('0x7'));var controller=require(_0x2459('0x8'));router[_0x2459('0x9')]('/',auth['isAuthenticated'](),controller[_0x2459('0xa')]);router[_0x2459('0x9')]('/describe',auth[_0x2459('0xb')](),controller[_0x2459('0xc')]);router[_0x2459('0x9')]('/:id',auth[_0x2459('0xb')](),controller['show']);router[_0x2459('0xd')]('/',auth[_0x2459('0xb')](),controller[_0x2459('0xe')]);router[_0x2459('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2459('0x10')]);router[_0x2459('0x11')](_0x2459('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x2459('0x13')]=router; \ No newline at end of file +var _0x181d=['put','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','post'];(function(_0x44389e,_0x32e17a){var _0x4e670f=function(_0x3eda92){while(--_0x3eda92){_0x44389e['push'](_0x44389e['shift']());}};_0x4e670f(++_0x32e17a);}(_0x181d,0x1f3));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd181('0x0'));var util=require(_0xd181('0x1'));var path=require('path');var timeout=require(_0xd181('0x2'));var express=require('express');var router=express[_0xd181('0x3')]();var fs_extra=require(_0xd181('0x4'));var auth=require(_0xd181('0x5'));var interaction=require(_0xd181('0x6'));var config=require(_0xd181('0x7'));var controller=require(_0xd181('0x8'));router[_0xd181('0x9')]('/',auth[_0xd181('0xa')](),controller['index']);router[_0xd181('0x9')](_0xd181('0xb'),auth[_0xd181('0xa')](),controller[_0xd181('0xc')]);router[_0xd181('0x9')]('/:id',auth[_0xd181('0xa')](),controller['show']);router[_0xd181('0xd')]('/',auth[_0xd181('0xa')](),controller['create']);router[_0xd181('0xe')](_0xd181('0xf'),auth['isAuthenticated'](),controller[_0xd181('0x10')]);router[_0xd181('0x11')](_0xd181('0xf'),auth[_0xd181('0xa')](),controller['destroy']);module[_0xd181('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 71d6a4c..54d5343 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 _0x1867=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x1cdabe,_0x54fee5){var _0x1ff40f=function(_0x11d75b){while(--_0x11d75b){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x1ff40f(++_0x54fee5);}(_0x1867,0xb5));var _0x7186=function(_0x50c24e,_0x6b28f0){_0x50c24e=_0x50c24e-0x0;var _0x4a9765=_0x1867[_0x50c24e];return _0x4a9765;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7186('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7186('0x2')]},'queue':{'type':Sequelize[_0x7186('0x2')]},'interface':{'type':Sequelize[_0x7186('0x2')]},'membername':{'type':Sequelize[_0x7186('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7186('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7186('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x7186('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x7186('0x3')]},'agentdumpAt':{'type':Sequelize[_0x7186('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7186('0x5')]},'agentacw':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7186('0x5')]},'reason':{'type':Sequelize[_0x7186('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7186('0x2')]},'channelstate':{'type':Sequelize[_0x7186('0x5')]},'channelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7186('0x2')]},'connectedlinename':{'type':Sequelize[_0x7186('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7186('0x2')]},'context':{'type':Sequelize[_0x7186('0x2')]},'exten':{'type':Sequelize[_0x7186('0x2')]},'priority':{'type':Sequelize[_0x7186('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7186('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7186('0x2')]},'destcalleridname':{'type':Sequelize[_0x7186('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7186('0x2')]},'destcontext':{'type':Sequelize[_0x7186('0x2')]},'destexten':{'type':Sequelize[_0x7186('0x2')]},'destpriority':{'type':Sequelize[_0x7186('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7186('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x7186('0x2')]},'transfer':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7186('0x2')],'comment':_0x7186('0x6')},'transferexten':{'type':Sequelize[_0x7186('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7186('0x2')]},'agententerreason':{'type':Sequelize[_0x7186('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6017=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x145463,_0x4d8502){var _0x334b40=function(_0x1d2b82){while(--_0x1d2b82){_0x145463['push'](_0x145463['shift']());}};_0x334b40(++_0x4d8502);}(_0x6017,0xae));var _0x7601=function(_0x522837,_0xfd6d59){_0x522837=_0x522837-0x0;var _0x32e4ce=_0x6017[_0x522837];return _0x32e4ce;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'type':{'type':Sequelize[_0x7601('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7601('0x2')]},'calleridname':{'type':Sequelize[_0x7601('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7601('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7601('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7601('0x3')]},'agentdumpAt':{'type':Sequelize[_0x7601('0x3')]},'holdtime':{'type':Sequelize[_0x7601('0x4')]},'agentcomplete':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7601('0x4')]},'reason':{'type':Sequelize[_0x7601('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7601('0x2')]},'channelstate':{'type':Sequelize[_0x7601('0x4')]},'channelstatedesc':{'type':Sequelize[_0x7601('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7601('0x2')]},'language':{'type':Sequelize[_0x7601('0x2')]},'accountcode':{'type':Sequelize[_0x7601('0x2')]},'context':{'type':Sequelize[_0x7601('0x2')]},'exten':{'type':Sequelize[_0x7601('0x2')]},'priority':{'type':Sequelize[_0x7601('0x2')]},'destchannel':{'type':Sequelize[_0x7601('0x2')]},'destchannelstate':{'type':Sequelize[_0x7601('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7601('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7601('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7601('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7601('0x2')]},'destaccountcode':{'type':Sequelize[_0x7601('0x2')]},'destcontext':{'type':Sequelize[_0x7601('0x2')]},'destexten':{'type':Sequelize[_0x7601('0x2')]},'destpriority':{'type':Sequelize[_0x7601('0x2')]},'destuniqueid':{'type':Sequelize[_0x7601('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7601('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x7601('0x2')]},'transfer':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x7601('0x6')},'transferexten':{'type':Sequelize[_0x7601('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x7601('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index e68ccac..33a3504 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 ab1f08a..13b7133 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 _0xd9ef=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','api','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x10cb36,_0x112fdd){var _0x4ecbf9=function(_0x1e5e54){while(--_0x1e5e54){_0x10cb36['push'](_0x10cb36['shift']());}};_0x4ecbf9(++_0x112fdd);}(_0xd9ef,0x95));var _0xfd9e=function(_0xe82b00,_0x57f718){_0xe82b00=_0xe82b00-0x0;var _0x5ed6aa=_0xd9ef[_0xe82b00];return _0x5ed6aa;};'use strict';var _=require(_0xfd9e('0x0'));var util=require(_0xfd9e('0x1'));var logger=require('../../config/logger')(_0xfd9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd9e('0x3'));var rimraf=require(_0xfd9e('0x4'));var config=require(_0xfd9e('0x5'));var attributes=require(_0xfd9e('0x6'));module[_0xfd9e('0x7')]=function(_0x178ceb,_0x2d549f){return _0x178ceb[_0xfd9e('0x8')](_0xfd9e('0x9'),attributes,{'tableName':_0xfd9e('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfd9e('0xb'),_0xfd9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16cc=['path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4db46b,_0x24938a){var _0x43a421=function(_0x290235){while(--_0x290235){_0x4db46b['push'](_0x4db46b['shift']());}};_0x43a421(++_0x24938a);}(_0x16cc,0x120));var _0xc16c=function(_0x5ba347,_0x45afd4){_0x5ba347=_0x5ba347-0x0;var _0x30c470=_0x16cc[_0x5ba347];return _0x30c470;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var logger=require(_0xc16c('0x1'))(_0xc16c('0x2'));var moment=require(_0xc16c('0x3'));var BPromise=require(_0xc16c('0x4'));var rp=require(_0xc16c('0x5'));var fs=require('fs');var path=require(_0xc16c('0x6'));var rimraf=require('rimraf');var config=require(_0xc16c('0x7'));var attributes=require(_0xc16c('0x8'));module[_0xc16c('0x9')]=function(_0x1019ec,_0x5ea82b){return _0x1019ec[_0xc16c('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xc16c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc16c('0xc'),_0xc16c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index cce33ac..9fd084e 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 _0xa11f=['options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport','where','attributes','limit','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message','result','create','body'];(function(_0x5ccb27,_0x75ff5a){var _0x4f6939=function(_0x5946d4){while(--_0x5946d4){_0x5ccb27['push'](_0x5ccb27['shift']());}};_0x4f6939(++_0x75ff5a);}(_0xa11f,0x13f));var _0xfa11=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0xa11f[_0x51d129];return _0x44c377;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa11('0x0'));var BPromise=require(_0xfa11('0x1'));var rs=require(_0xfa11('0x2'));var fs=require('fs');var Redis=require(_0xfa11('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa11('0x4'));var logger=require('../../config/logger')(_0xfa11('0x5'));var config=require(_0xfa11('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfa11('0x7')][_0xfa11('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc6e,_0x5684c9,_0x34550c){return new BPromise(function(_0x23536d,_0xdd7441){return client[_0xfa11('0x9')](_0x4bbc6e,_0x34550c)[_0xfa11('0xa')](function(_0x1225c2){logger[_0xfa11('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x5684c9,'request\x20sent');logger[_0xfa11('0xc')](_0xfa11('0xd'),_0x5684c9,_0xfa11('0xe'),JSON[_0xfa11('0xf')](_0x1225c2));if(_0x1225c2[_0xfa11('0x10')]){if(_0x1225c2[_0xfa11('0x10')]['code']===0x1f4){logger['error'](_0xfa11('0x11'),_0x5684c9,_0x1225c2[_0xfa11('0x10')][_0xfa11('0x12')]);return _0xdd7441(_0x1225c2[_0xfa11('0x10')][_0xfa11('0x12')]);}logger[_0xfa11('0x10')](_0xfa11('0x11'),_0x5684c9,_0x1225c2[_0xfa11('0x10')][_0xfa11('0x12')]);return _0x23536d(_0x1225c2[_0xfa11('0x10')][_0xfa11('0x12')]);}else{logger[_0xfa11('0xb')](_0xfa11('0x11'),_0x5684c9,_0xfa11('0xe'));_0x23536d(_0x1225c2[_0xfa11('0x13')][_0xfa11('0x12')]);}})['catch'](function(_0x4e1d59){logger[_0xfa11('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x5684c9,_0x4e1d59);_0xdd7441(_0x4e1d59);});});}exports['CreateVoiceAgentReport']=function(_0x530ad7){var _0x42a1f1=this;return new Promise(function(_0x27110b,_0xc90e39){return db['VoiceAgentReport'][_0xfa11('0x14')](_0x530ad7[_0xfa11('0x15')],{'raw':_0x530ad7['options']?_0x530ad7[_0xfa11('0x16')][_0xfa11('0x17')]===undefined?!![]:![]:!![]})[_0xfa11('0xa')](function(_0x2fa6e5){logger[_0xfa11('0xb')]('CreateVoiceAgentReport',_0x530ad7);logger[_0xfa11('0xc')](_0xfa11('0x18'),_0x530ad7,JSON[_0xfa11('0xf')](_0x2fa6e5));_0x27110b(_0x2fa6e5);})['catch'](function(_0x591ca6){logger[_0xfa11('0x10')](_0xfa11('0x18'),_0x591ca6[_0xfa11('0x12')],_0x530ad7);_0xc90e39(_0x42a1f1[_0xfa11('0x10')](0x1f4,_0x591ca6['message']));});});};exports[_0xfa11('0x19')]=function(_0x381cad){var _0x4ca1cf=this;return new Promise(function(_0xc73e92,_0x1143e6){return db[_0xfa11('0x1a')]['update'](_0x381cad[_0xfa11('0x15')],{'raw':_0x381cad[_0xfa11('0x16')]?_0x381cad[_0xfa11('0x16')][_0xfa11('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x381cad[_0xfa11('0x16')]?_0x381cad[_0xfa11('0x16')][_0xfa11('0x1b')]||null:null,'attributes':_0x381cad[_0xfa11('0x16')]?_0x381cad['options'][_0xfa11('0x1c')]||null:null,'limit':_0x381cad[_0xfa11('0x16')]?_0x381cad[_0xfa11('0x16')][_0xfa11('0x1d')]||null:null})[_0xfa11('0xa')](function(_0x22ad44){logger[_0xfa11('0xb')](_0xfa11('0x19'),_0x381cad);logger[_0xfa11('0xc')](_0xfa11('0x19'),_0x381cad,JSON['stringify'](_0x22ad44));_0xc73e92(_0x22ad44);})[_0xfa11('0x1e')](function(_0x39c8dd){logger[_0xfa11('0x10')](_0xfa11('0x19'),_0x39c8dd[_0xfa11('0x12')],_0x381cad);_0x1143e6(_0x4ca1cf[_0xfa11('0x10')](0x1f4,_0x39c8dd[_0xfa11('0x12')]));});});}; \ No newline at end of file +var _0xce85=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceAgentReport','create','body','options','raw','then','info','CreateVoiceAgentReport','catch','UpdateVoiceAgentReport','update','where','attributes','limit','moment','bluebird'];(function(_0x20eca9,_0x3323bb){var _0x1b6f68=function(_0x272e3a){while(--_0x272e3a){_0x20eca9['push'](_0x20eca9['shift']());}};_0x1b6f68(++_0x3323bb);}(_0xce85,0xc4));var _0x5ce8=function(_0x4d1421,_0x30e9c2){_0x4d1421=_0x4d1421-0x0;var _0x345037=_0xce85[_0x4d1421];return _0x345037;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce8('0x0'));var BPromise=require(_0x5ce8('0x1'));var rs=require(_0x5ce8('0x2'));var fs=require('fs');var Redis=require(_0x5ce8('0x3'));var db=require(_0x5ce8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ce8('0x5'))(_0x5ce8('0x6'));var config=require(_0x5ce8('0x7'));var jayson=require(_0x5ce8('0x8'));var client=jayson['client'][_0x5ce8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24f152,_0x2d1cca,_0x479933){return new BPromise(function(_0x4f19a0,_0x354cca){return client[_0x5ce8('0xa')](_0x24f152,_0x479933)['then'](function(_0x48a108){logger['info'](_0x5ce8('0xb'),_0x2d1cca,'request\x20sent');logger[_0x5ce8('0xc')](_0x5ce8('0xd'),_0x2d1cca,'request\x20sent',JSON[_0x5ce8('0xe')](_0x48a108));if(_0x48a108[_0x5ce8('0xf')]){if(_0x48a108[_0x5ce8('0xf')][_0x5ce8('0x10')]===0x1f4){logger[_0x5ce8('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x2d1cca,_0x48a108[_0x5ce8('0xf')][_0x5ce8('0x11')]);return _0x354cca(_0x48a108[_0x5ce8('0xf')][_0x5ce8('0x11')]);}logger[_0x5ce8('0xf')](_0x5ce8('0xb'),_0x2d1cca,_0x48a108['error'][_0x5ce8('0x11')]);return _0x4f19a0(_0x48a108['error']['message']);}else{logger['info'](_0x5ce8('0xb'),_0x2d1cca,'request\x20sent');_0x4f19a0(_0x48a108[_0x5ce8('0x12')][_0x5ce8('0x11')]);}})['catch'](function(_0x42f564){logger[_0x5ce8('0xf')](_0x5ce8('0xb'),_0x2d1cca,_0x42f564);_0x354cca(_0x42f564);});});}exports['CreateVoiceAgentReport']=function(_0x1d3e65){var _0x3863e6=this;return new Promise(function(_0x341dfc,_0x15623d){return db[_0x5ce8('0x13')][_0x5ce8('0x14')](_0x1d3e65[_0x5ce8('0x15')],{'raw':_0x1d3e65[_0x5ce8('0x16')]?_0x1d3e65[_0x5ce8('0x16')][_0x5ce8('0x17')]===undefined?!![]:![]:!![]})[_0x5ce8('0x18')](function(_0x466e92){logger[_0x5ce8('0x19')](_0x5ce8('0x1a'),_0x1d3e65);logger['debug'](_0x5ce8('0x1a'),_0x1d3e65,JSON['stringify'](_0x466e92));_0x341dfc(_0x466e92);})[_0x5ce8('0x1b')](function(_0x26d03d){logger[_0x5ce8('0xf')](_0x5ce8('0x1a'),_0x26d03d[_0x5ce8('0x11')],_0x1d3e65);_0x15623d(_0x3863e6[_0x5ce8('0xf')](0x1f4,_0x26d03d[_0x5ce8('0x11')]));});});};exports[_0x5ce8('0x1c')]=function(_0x24f5b1){var _0x519ce6=this;return new Promise(function(_0x581ed3,_0x298621){return db[_0x5ce8('0x13')][_0x5ce8('0x1d')](_0x24f5b1[_0x5ce8('0x15')],{'raw':_0x24f5b1[_0x5ce8('0x16')]?_0x24f5b1[_0x5ce8('0x16')][_0x5ce8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24f5b1['options']?_0x24f5b1[_0x5ce8('0x16')][_0x5ce8('0x1e')]||null:null,'attributes':_0x24f5b1['options']?_0x24f5b1['options'][_0x5ce8('0x1f')]||null:null,'limit':_0x24f5b1[_0x5ce8('0x16')]?_0x24f5b1[_0x5ce8('0x16')][_0x5ce8('0x20')]||null:null})['then'](function(_0x53b6c1){logger[_0x5ce8('0x19')](_0x5ce8('0x1c'),_0x24f5b1);logger['debug'](_0x5ce8('0x1c'),_0x24f5b1,JSON['stringify'](_0x53b6c1));_0x581ed3(_0x53b6c1);})[_0x5ce8('0x1b')](function(_0x41f1c1){logger['error']('UpdateVoiceAgentReport',_0x41f1c1[_0x5ce8('0x11')],_0x24f5b1);_0x298621(_0x519ce6[_0x5ce8('0xf')](0x1f4,_0x41f1c1['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d4bfd13..4abf5a9 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 _0x3435=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','exports','multer','util'];(function(_0x26ae75,_0x394cb8){var _0x406fff=function(_0x3c7380){while(--_0x3c7380){_0x26ae75['push'](_0x26ae75['shift']());}};_0x406fff(++_0x394cb8);}(_0x3435,0xfa));var _0x5343=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x3435[_0x342baa];return _0x1208f3;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5343('0x6'));var interaction=require(_0x5343('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0x5343('0x8')]('/',auth[_0x5343('0x9')](),controller['index']);router['get'](_0x5343('0xa'),auth[_0x5343('0x9')](),controller[_0x5343('0xb')]);router[_0x5343('0x8')](_0x5343('0xc'),auth['isAuthenticated'](),controller[_0x5343('0xd')]);router['post']('/',auth[_0x5343('0x9')](),controller[_0x5343('0xe')]);router[_0x5343('0xf')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['update']);router[_0x5343('0x10')](_0x5343('0xc'),auth[_0x5343('0x9')](),controller['destroy']);module[_0x5343('0x11')]=router; \ No newline at end of file +var _0xb4c7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x2355cb,_0x2caea6){var _0xe29468=function(_0x2b6e04){while(--_0x2b6e04){_0x2355cb['push'](_0x2355cb['shift']());}};_0xe29468(++_0x2caea6);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x505388,_0x5a06b3){_0x505388=_0x505388-0x0;var _0xf6514d=_0xb4c7[_0x505388];return _0xf6514d;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0x10')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router['delete']('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x14')]);module[_0x7b4c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index d299f98..641d2f3 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 _0x9b87=['INTEGER','sequelize','exports','inbound','internal','dialer','STRING','TEXT','DATE'];(function(_0x84a274,_0x298d82){var _0x11d8e4=function(_0xb5d258){while(--_0xb5d258){_0x84a274['push'](_0x84a274['shift']());}};_0x11d8e4(++_0x298d82);}(_0x9b87,0x7f));var _0x79b8=function(_0x36b8bb,_0x55506b){_0x36b8bb=_0x36b8bb-0x0;var _0x5c7c12=_0x9b87[_0x36b8bb];return _0x5c7c12;};'use strict';var Sequelize=require(_0x79b8('0x0'));module[_0x79b8('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x79b8('0x2'),_0x79b8('0x3'),'outbound','inbound-fax','outbound-fax',_0x79b8('0x4'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x79b8('0x5')]},'source':{'type':Sequelize[_0x79b8('0x5')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x79b8('0x5')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x79b8('0x5')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x79b8('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x79b8('0x7')]},'answertime':{'type':Sequelize[_0x79b8('0x7')]},'endtime':{'type':Sequelize[_0x79b8('0x7')]},'duration':{'type':Sequelize[_0x79b8('0x8')]},'billableseconds':{'type':Sequelize[_0x79b8('0x8')]},'mohtime':{'type':Sequelize[_0x79b8('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x79b8('0x5')]},'amaflags':{'type':Sequelize[_0x79b8('0x5')]},'userfield':{'type':Sequelize[_0x79b8('0x5')]},'userDisposition':{'type':Sequelize[_0x79b8('0x5')]},'userSecondDisposition':{'type':Sequelize[_0x79b8('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x79b8('0x5')]},'note':{'type':Sequelize[_0x79b8('0x5')]},'prefix':{'type':Sequelize[_0x79b8('0x5')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb286=['INTEGER','sequelize','exports','outbound-fax','dialer','STRING','DATE'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb286,0x151));var _0x6b28=function(_0x3167a1,_0xe02c84){_0x3167a1=_0x3167a1-0x0;var _0x37f32d=_0xb286[_0x3167a1];return _0x37f32d;};'use strict';var Sequelize=require(_0x6b28('0x0'));module[_0x6b28('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound','internal','outbound','inbound-fax',_0x6b28('0x2'),_0x6b28('0x3'))},'tag':{'type':Sequelize[_0x6b28('0x4')]},'accountcode':{'type':Sequelize[_0x6b28('0x4')]},'source':{'type':Sequelize[_0x6b28('0x4')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x6b28('0x4')]},'callerid':{'type':Sequelize[_0x6b28('0x4')]},'channel':{'type':Sequelize[_0x6b28('0x4')]},'destinationchannel':{'type':Sequelize[_0x6b28('0x4')]},'lastapplication':{'type':Sequelize[_0x6b28('0x4')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x6b28('0x5')]},'systemanswertime':{'type':Sequelize[_0x6b28('0x5')]},'answertime':{'type':Sequelize[_0x6b28('0x5')]},'endtime':{'type':Sequelize[_0x6b28('0x5')]},'duration':{'type':Sequelize[_0x6b28('0x6')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6b28('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6b28('0x4')]},'userDisposition':{'type':Sequelize[_0x6b28('0x4')]},'userSecondDisposition':{'type':Sequelize[_0x6b28('0x4')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6b28('0x4')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x6b28('0x6')]},'sipcallid':{'type':Sequelize[_0x6b28('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6bb56d4..7432391 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x28731d,_0x37fe3b){var _0x363f6c=function(_0x40cc92){while(--_0x40cc92){_0x28731d['push'](_0x28731d['shift']());}};_0x363f6c(++_0x37fe3b);}(_0xdb28,0x106));var _0x8db2=function(_0x54505d,_0x111b3d){_0x54505d=_0x54505d-0x0;var _0x29f16e=_0xdb28[_0x54505d];return _0x29f16e;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x551a9b,_0x1560ad){_0x551a9b=_0x551a9b-0x0;var _0x12177e=_0x2032[_0x551a9b];return _0x12177e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 764a060..91d7e29 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 _0x7d19=['define','VoiceCallReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x20784c,_0x4c4e2e){var _0x37da4c=function(_0x55d3ff){while(--_0x55d3ff){_0x20784c['push'](_0x20784c['shift']());}};_0x37da4c(++_0x4c4e2e);}(_0x7d19,0x9e));var _0x97d1=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0x7d19[_0x591d44];return _0x41dd26;};'use strict';var _=require(_0x97d1('0x0'));var util=require('util');var logger=require(_0x97d1('0x1'))(_0x97d1('0x2'));var moment=require(_0x97d1('0x3'));var BPromise=require(_0x97d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97d1('0x5'));var rimraf=require(_0x97d1('0x6'));var config=require(_0x97d1('0x7'));var attributes=require(_0x97d1('0x8'));module[_0x97d1('0x9')]=function(_0x23a154,_0x1b7ea5){return _0x23a154[_0x97d1('0xa')](_0x97d1('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d91=['rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x7d91,0x10f));var _0x17d9=function(_0xea7b6a,_0xe01444){_0xea7b6a=_0xea7b6a-0x0;var _0x12849f=_0x7d91[_0xea7b6a];return _0x12849f;};'use strict';var _=require('lodash');var util=require(_0x17d9('0x0'));var logger=require('../../config/logger')(_0x17d9('0x1'));var moment=require(_0x17d9('0x2'));var BPromise=require(_0x17d9('0x3'));var rp=require(_0x17d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17d9('0x5'));var config=require(_0x17d9('0x6'));var attributes=require(_0x17d9('0x7'));module['exports']=function(_0x5c7089,_0x4ffb6d){return _0x5c7089[_0x17d9('0x8')](_0x17d9('0x9'),attributes,{'tableName':_0x17d9('0xa'),'paranoid':![],'indexes':[{'fields':[_0x17d9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 144348b..234fcc1 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 _0xa411=['stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','GetVoiceCallReport','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','lodash','util','bluebird','randomstring','ioredis','rpc','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x4cb837,_0x313b56){var _0x1da252=function(_0x50a221){while(--_0x50a221){_0x4cb837['push'](_0x4cb837['shift']());}};_0x1da252(++_0x313b56);}(_0xa411,0x1af));var _0x1a41=function(_0x28b583,_0x401d78){_0x28b583=_0x28b583-0x0;var _0x316cfd=_0xa411[_0x28b583];return _0x316cfd;};'use strict';var _=require(_0x1a41('0x0'));var util=require(_0x1a41('0x1'));var moment=require('moment');var BPromise=require(_0x1a41('0x2'));var rs=require(_0x1a41('0x3'));var fs=require('fs');var Redis=require(_0x1a41('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a41('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf3ec14,_0x2b55f8,_0x3d4db0){return new BPromise(function(_0x584fe4,_0x42ad52){return client['request'](_0xf3ec14,_0x3d4db0)[_0x1a41('0x6')](function(_0x28a89b){logger[_0x1a41('0x7')](_0x1a41('0x8'),_0x2b55f8,_0x1a41('0x9'));logger['debug'](_0x1a41('0xa'),_0x2b55f8,_0x1a41('0x9'),JSON[_0x1a41('0xb')](_0x28a89b));if(_0x28a89b[_0x1a41('0xc')]){if(_0x28a89b[_0x1a41('0xc')][_0x1a41('0xd')]===0x1f4){logger['error'](_0x1a41('0x8'),_0x2b55f8,_0x28a89b[_0x1a41('0xc')][_0x1a41('0xe')]);return _0x42ad52(_0x28a89b[_0x1a41('0xc')][_0x1a41('0xe')]);}logger[_0x1a41('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x2b55f8,_0x28a89b[_0x1a41('0xc')][_0x1a41('0xe')]);return _0x584fe4(_0x28a89b[_0x1a41('0xc')]['message']);}else{logger[_0x1a41('0x7')](_0x1a41('0x8'),_0x2b55f8,'request\x20sent');_0x584fe4(_0x28a89b[_0x1a41('0xf')]['message']);}})[_0x1a41('0x10')](function(_0x1b02c3){logger[_0x1a41('0xc')](_0x1a41('0x8'),_0x2b55f8,_0x1b02c3);_0x42ad52(_0x1b02c3);});});}exports['GetVoiceCallReport']=function(_0x3f7f58){var _0x571012=this;return new Promise(function(_0x407286,_0xecad97){return db[_0x1a41('0x11')][_0x1a41('0x12')]({'raw':_0x3f7f58[_0x1a41('0x13')]?_0x3f7f58[_0x1a41('0x13')][_0x1a41('0x14')]===undefined?!![]:![]:!![],'where':_0x3f7f58[_0x1a41('0x13')]?_0x3f7f58[_0x1a41('0x13')][_0x1a41('0x15')]||null:null,'attributes':_0x3f7f58[_0x1a41('0x13')]?_0x3f7f58[_0x1a41('0x13')][_0x1a41('0x16')]||null:null,'limit':_0x3f7f58[_0x1a41('0x13')]?_0x3f7f58[_0x1a41('0x13')]['limit']||null:null,'include':_0x3f7f58[_0x1a41('0x13')]?_0x3f7f58[_0x1a41('0x13')]['include']?_['map'](_0x3f7f58[_0x1a41('0x13')][_0x1a41('0x17')],function(_0xd45cc){return{'model':db[_0xd45cc[_0x1a41('0x18')]],'as':_0xd45cc['as'],'attributes':_0xd45cc[_0x1a41('0x16')],'include':_0xd45cc[_0x1a41('0x17')]?_[_0x1a41('0x19')](_0xd45cc[_0x1a41('0x17')],function(_0x50e3cd){return{'model':db[_0x50e3cd[_0x1a41('0x18')]],'as':_0x50e3cd['as'],'attributes':_0x50e3cd['attributes'],'include':_0x50e3cd[_0x1a41('0x17')]?_['map'](_0x50e3cd[_0x1a41('0x17')],function(_0x3d52dd){return{'model':db[_0x3d52dd[_0x1a41('0x18')]],'as':_0x3d52dd['as'],'attributes':_0x3d52dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a41('0x6')](function(_0x2db702){logger['info'](_0x1a41('0x1a'),_0x3f7f58);logger[_0x1a41('0x1b')](_0x1a41('0x1a'),_0x3f7f58,JSON[_0x1a41('0xb')](_0x2db702));_0x407286(_0x2db702);})[_0x1a41('0x10')](function(_0x1fa63d){logger[_0x1a41('0xc')](_0x1a41('0x1a'),_0x1fa63d[_0x1a41('0xe')],_0x3f7f58);_0xecad97(_0x571012[_0x1a41('0xc')](0x1f4,_0x1fa63d[_0x1a41('0xe')]));});});};exports[_0x1a41('0x1c')]=function(_0x4ad3cc){var _0xb0b536=this;return new Promise(function(_0x246609,_0x286b09){return db['VoiceCallReport'][_0x1a41('0x1d')](_0x4ad3cc[_0x1a41('0x1e')],{'raw':_0x4ad3cc[_0x1a41('0x13')]?_0x4ad3cc[_0x1a41('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x1a41('0x6')](function(_0x1e550b){logger[_0x1a41('0x7')](_0x1a41('0x1c'),_0x4ad3cc);logger[_0x1a41('0x1b')]('CreateVoiceCallReport',_0x4ad3cc,JSON[_0x1a41('0xb')](_0x1e550b));_0x246609(_0x1e550b);})['catch'](function(_0x55123d){logger['error'](_0x1a41('0x1c'),_0x55123d[_0x1a41('0xe')],_0x4ad3cc);_0x286b09(_0xb0b536['error'](0x1f4,_0x55123d[_0x1a41('0xe')]));});});};exports[_0x1a41('0x1f')]=function(_0x576615){var _0x1d1339=this;return new Promise(function(_0x2df281,_0x5630ad){return db[_0x1a41('0x11')][_0x1a41('0x20')](_0x576615[_0x1a41('0x1e')],{'raw':_0x576615[_0x1a41('0x13')]?_0x576615[_0x1a41('0x13')][_0x1a41('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576615[_0x1a41('0x13')]?_0x576615[_0x1a41('0x13')][_0x1a41('0x15')]||null:null,'attributes':_0x576615[_0x1a41('0x13')]?_0x576615[_0x1a41('0x13')][_0x1a41('0x16')]||null:null,'limit':_0x576615[_0x1a41('0x13')]?_0x576615[_0x1a41('0x13')][_0x1a41('0x21')]||null:null})[_0x1a41('0x6')](function(_0x951520){logger[_0x1a41('0x7')]('UpdateVoiceCallReport',_0x576615);logger[_0x1a41('0x1b')](_0x1a41('0x1f'),_0x576615,JSON[_0x1a41('0xb')](_0x951520));_0x2df281(_0x951520);})[_0x1a41('0x10')](function(_0x4ae454){logger['error'](_0x1a41('0x1f'),_0x4ae454[_0x1a41('0xe')],_0x576615);_0x5630ad(_0x1d1339[_0x1a41('0xc')](0x1f4,_0x4ae454['message']));});});}; \ No newline at end of file +var _0x4ba6=['http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','include','attributes','map','model','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','where','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4ba6,0x11f));var _0x64ba=function(_0x47848c,_0x1c52f3){_0x47848c=_0x47848c-0x0;var _0x520324=_0x4ba6[_0x47848c];return _0x520324;};'use strict';var _=require(_0x64ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x64ba('0x1'));var fs=require('fs');var Redis=require(_0x64ba('0x2'));var db=require(_0x64ba('0x3'))['db'];var utils=require(_0x64ba('0x4'));var logger=require(_0x64ba('0x5'))(_0x64ba('0x6'));var config=require(_0x64ba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x64ba('0x8')][_0x64ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27db23,_0x16da84,_0x240e62){return new BPromise(function(_0x1bcc62,_0x1b3f72){return client[_0x64ba('0xa')](_0x27db23,_0x240e62)[_0x64ba('0xb')](function(_0x339844){logger[_0x64ba('0xc')](_0x64ba('0xd'),_0x16da84,_0x64ba('0xe'));logger[_0x64ba('0xf')](_0x64ba('0x10'),_0x16da84,_0x64ba('0xe'),JSON['stringify'](_0x339844));if(_0x339844['error']){if(_0x339844['error'][_0x64ba('0x11')]===0x1f4){logger[_0x64ba('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x16da84,_0x339844[_0x64ba('0x12')][_0x64ba('0x13')]);return _0x1b3f72(_0x339844['error'][_0x64ba('0x13')]);}logger['error'](_0x64ba('0xd'),_0x16da84,_0x339844['error'][_0x64ba('0x13')]);return _0x1bcc62(_0x339844[_0x64ba('0x12')][_0x64ba('0x13')]);}else{logger[_0x64ba('0xc')](_0x64ba('0xd'),_0x16da84,'request\x20sent');_0x1bcc62(_0x339844['result'][_0x64ba('0x13')]);}})[_0x64ba('0x14')](function(_0x536f61){logger[_0x64ba('0x12')](_0x64ba('0xd'),_0x16da84,_0x536f61);_0x1b3f72(_0x536f61);});});}exports[_0x64ba('0x15')]=function(_0x4b57b6){var _0x18c185=this;return new Promise(function(_0x214860,_0x248472){return db[_0x64ba('0x16')][_0x64ba('0x17')]({'raw':_0x4b57b6[_0x64ba('0x18')]?_0x4b57b6['options'][_0x64ba('0x19')]===undefined?!![]:![]:!![],'where':_0x4b57b6[_0x64ba('0x18')]?_0x4b57b6[_0x64ba('0x18')]['where']||null:null,'attributes':_0x4b57b6['options']?_0x4b57b6[_0x64ba('0x18')]['attributes']||null:null,'limit':_0x4b57b6[_0x64ba('0x18')]?_0x4b57b6[_0x64ba('0x18')]['limit']||null:null,'include':_0x4b57b6[_0x64ba('0x18')]?_0x4b57b6[_0x64ba('0x18')][_0x64ba('0x1a')]?_['map'](_0x4b57b6['options']['include'],function(_0x4b6736){return{'model':db[_0x4b6736['model']],'as':_0x4b6736['as'],'attributes':_0x4b6736[_0x64ba('0x1b')],'include':_0x4b6736[_0x64ba('0x1a')]?_[_0x64ba('0x1c')](_0x4b6736[_0x64ba('0x1a')],function(_0x42823e){return{'model':db[_0x42823e[_0x64ba('0x1d')]],'as':_0x42823e['as'],'attributes':_0x42823e[_0x64ba('0x1b')],'include':_0x42823e['include']?_[_0x64ba('0x1c')](_0x42823e[_0x64ba('0x1a')],function(_0x5b9154){return{'model':db[_0x5b9154['model']],'as':_0x5b9154['as'],'attributes':_0x5b9154[_0x64ba('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x64ba('0xb')](function(_0x3abaad){logger[_0x64ba('0xc')](_0x64ba('0x15'),_0x4b57b6);logger['debug'](_0x64ba('0x15'),_0x4b57b6,JSON[_0x64ba('0x1e')](_0x3abaad));_0x214860(_0x3abaad);})[_0x64ba('0x14')](function(_0x4a3e7e){logger[_0x64ba('0x12')](_0x64ba('0x15'),_0x4a3e7e[_0x64ba('0x13')],_0x4b57b6);_0x248472(_0x18c185[_0x64ba('0x12')](0x1f4,_0x4a3e7e[_0x64ba('0x13')]));});});};exports[_0x64ba('0x1f')]=function(_0x533afa){var _0x3283a1=this;return new Promise(function(_0x84c3d4,_0x52123f){return db['VoiceCallReport']['create'](_0x533afa[_0x64ba('0x20')],{'raw':_0x533afa['options']?_0x533afa[_0x64ba('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x64ba('0xb')](function(_0x490f13){logger[_0x64ba('0xc')](_0x64ba('0x1f'),_0x533afa);logger[_0x64ba('0xf')]('CreateVoiceCallReport',_0x533afa,JSON[_0x64ba('0x1e')](_0x490f13));_0x84c3d4(_0x490f13);})[_0x64ba('0x14')](function(_0x3e17e0){logger[_0x64ba('0x12')]('CreateVoiceCallReport',_0x3e17e0[_0x64ba('0x13')],_0x533afa);_0x52123f(_0x3283a1[_0x64ba('0x12')](0x1f4,_0x3e17e0[_0x64ba('0x13')]));});});};exports[_0x64ba('0x21')]=function(_0x5ad19f){var _0x1fa78=this;return new Promise(function(_0x77ea5f,_0x31952c){return db[_0x64ba('0x16')][_0x64ba('0x22')](_0x5ad19f['body'],{'raw':_0x5ad19f[_0x64ba('0x18')]?_0x5ad19f[_0x64ba('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ad19f[_0x64ba('0x18')]?_0x5ad19f['options'][_0x64ba('0x23')]||null:null,'attributes':_0x5ad19f[_0x64ba('0x18')]?_0x5ad19f['options'][_0x64ba('0x1b')]||null:null,'limit':_0x5ad19f[_0x64ba('0x18')]?_0x5ad19f[_0x64ba('0x18')][_0x64ba('0x24')]||null:null})[_0x64ba('0xb')](function(_0x17dde8){logger[_0x64ba('0xc')]('UpdateVoiceCallReport',_0x5ad19f);logger[_0x64ba('0xf')](_0x64ba('0x21'),_0x5ad19f,JSON[_0x64ba('0x1e')](_0x17dde8));_0x77ea5f(_0x17dde8);})['catch'](function(_0x4e69c3){logger[_0x64ba('0x12')]('UpdateVoiceCallReport',_0x4e69c3[_0x64ba('0x13')],_0x5ad19f);_0x31952c(_0x1fa78[_0x64ba('0x12')](0x1f4,_0x4e69c3[_0x64ba('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 30c56b1..9d8ce35 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 _0x43a0=['isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller'];(function(_0x4d62d8,_0x5c1fda){var _0x56cf09=function(_0x39f2ae){while(--_0x39f2ae){_0x4d62d8['push'](_0x4d62d8['shift']());}};_0x56cf09(++_0x5c1fda);}(_0x43a0,0x119));var _0x043a=function(_0x251792,_0x2866d9){_0x251792=_0x251792-0x0;var _0x2ec3f6=_0x43a0[_0x251792];return _0x2ec3f6;};'use strict';var multer=require(_0x043a('0x0'));var util=require(_0x043a('0x1'));var path=require(_0x043a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x043a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x043a('0x4'));var interaction=require(_0x043a('0x5'));var config=require('../../config/environment');var controller=require(_0x043a('0x6'));router['get']('/',auth[_0x043a('0x7')](),controller[_0x043a('0x8')]);router[_0x043a('0x9')](_0x043a('0xa'),auth[_0x043a('0x7')](),controller['show']);router[_0x043a('0xb')]('/',auth[_0x043a('0x7')](),controller[_0x043a('0xc')]);router[_0x043a('0xd')](_0x043a('0xa'),auth[_0x043a('0x7')](),controller[_0x043a('0xe')]);router[_0x043a('0xf')](_0x043a('0xa'),auth[_0x043a('0x7')](),controller[_0x043a('0x10')]);module[_0x043a('0x11')]=router; \ No newline at end of file +var _0x0bd3=['isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x10bf41,_0x27134d){var _0x31cd34=function(_0x526e17){while(--_0x526e17){_0x10bf41['push'](_0x10bf41['shift']());}};_0x31cd34(++_0x27134d);}(_0x0bd3,0x6f));var _0x30bd=function(_0x4d3835,_0x4f5f50){_0x4d3835=_0x4d3835-0x0;var _0x823439=_0x0bd3[_0x4d3835];return _0x823439;};'use strict';var multer=require(_0x30bd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x30bd('0x1'));var express=require(_0x30bd('0x2'));var router=express[_0x30bd('0x3')]();var fs_extra=require(_0x30bd('0x4'));var auth=require(_0x30bd('0x5'));var interaction=require(_0x30bd('0x6'));var config=require(_0x30bd('0x7'));var controller=require(_0x30bd('0x8'));router['get']('/',auth[_0x30bd('0x9')](),controller['index']);router[_0x30bd('0xa')](_0x30bd('0xb'),auth[_0x30bd('0x9')](),controller[_0x30bd('0xc')]);router[_0x30bd('0xd')]('/',auth[_0x30bd('0x9')](),controller[_0x30bd('0xe')]);router[_0x30bd('0xf')](_0x30bd('0xb'),auth[_0x30bd('0x9')](),controller[_0x30bd('0x10')]);router[_0x30bd('0x11')](_0x30bd('0xb'),auth[_0x30bd('0x9')](),controller[_0x30bd('0x12')]);module[_0x30bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index b81c46a..905c179 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 _0x5d3d=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0x26557a,_0x578d08){var _0x53d1fb=function(_0x165182){while(--_0x165182){_0x26557a['push'](_0x26557a['shift']());}};_0x53d1fb(++_0x578d08);}(_0x5d3d,0x8e));var _0xd5d3=function(_0x18743c,_0x47c9f4){_0x18743c=_0x18743c-0x0;var _0x5614e1=_0x5d3d[_0x18743c];return _0x5614e1;};'use strict';var Sequelize=require('sequelize');module[_0xd5d3('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xd5d3('0x1')],'unique':_0xd5d3('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xbe92ac){this[_0xd5d3('0x3')](_0xd5d3('0x4'),_0xbe92ac?_0xbe92ac['join'](''):[]);},'get':function(){return this[_0xd5d3('0x5')]('options')?this['getDataValue'](_0xd5d3('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xd5d3('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xd5d3('0x1')]},'record':{'type':Sequelize[_0xd5d3('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd5d3('0x1')]},'description':{'type':Sequelize[_0xd5d3('0x1')]}}; \ No newline at end of file +var _0x43fc=['name','setDataValue','getDataValue','options','exports','STRING'];(function(_0x367b2c,_0x1ba985){var _0x1c4aed=function(_0x7842b0){while(--_0x7842b0){_0x367b2c['push'](_0x367b2c['shift']());}};_0x1c4aed(++_0x1ba985);}(_0x43fc,0x7c));var _0xc43f=function(_0x536d90,_0x4543ae){_0x536d90=_0x536d90-0x0;var _0x3c3036=_0x43fc[_0x536d90];return _0x3c3036;};'use strict';var Sequelize=require('sequelize');module[_0xc43f('0x0')]={'name':{'type':Sequelize[_0xc43f('0x1')]},'prefix':{'type':Sequelize[_0xc43f('0x1')],'unique':_0xc43f('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xc43f('0x1')],'set':function(_0x1a7e48){this[_0xc43f('0x3')]('options',_0x1a7e48?_0x1a7e48['join'](''):[]);},'get':function(){return this[_0xc43f('0x4')](_0xc43f('0x5'))?this[_0xc43f('0x4')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xc43f('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc43f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index ebc626d..faa430c 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 _0xa3b9=['includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options'];(function(_0x3ef0be,_0xb1969c){var _0x26d065=function(_0x4bbe0e){while(--_0x4bbe0e){_0x3ef0be['push'](_0x3ef0be['shift']());}};_0x26d065(++_0xb1969c);}(_0xa3b9,0x112));var _0x9a3b=function(_0x1e2c52,_0xc4f659){_0x1e2c52=_0x1e2c52-0x0;var _0x87892f=_0xa3b9[_0x1e2c52];return _0x87892f;};'use strict';var emlformat=require(_0x9a3b('0x0'));var rimraf=require(_0x9a3b('0x1'));var zipdir=require(_0x9a3b('0x2'));var jsonpatch=require(_0x9a3b('0x3'));var rp=require(_0x9a3b('0x4'));var moment=require(_0x9a3b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a3b('0x6'));var util=require(_0x9a3b('0x7'));var path=require(_0x9a3b('0x8'));var sox=require(_0x9a3b('0x9'));var csv=require(_0x9a3b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a3b('0xb'));var squel=require(_0x9a3b('0xc'));var crypto=require(_0x9a3b('0xd'));var jsforce=require(_0x9a3b('0xe'));var deskjs=require(_0x9a3b('0xf'));var toCsv=require(_0x9a3b('0xa'));var querystring=require(_0x9a3b('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a3b('0x11'));var authService=require(_0x9a3b('0x12'));var qs=require(_0x9a3b('0x13'));var as=require(_0x9a3b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a3b('0x15'))(_0x9a3b('0x16'));var utils=require(_0x9a3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a3b('0x18'))['db'];function respondWithStatusCode(_0x4fa0f7,_0x57fd21){_0x57fd21=_0x57fd21||0xcc;return function(_0x86116e){if(_0x86116e){return _0x4fa0f7[_0x9a3b('0x19')](_0x57fd21);}return _0x4fa0f7['status'](_0x57fd21)[_0x9a3b('0x1a')]();};}function respondWithResult(_0x4ccc2b,_0x1d5aef){_0x1d5aef=_0x1d5aef||0xc8;return function(_0x16ff58){if(_0x16ff58){return _0x4ccc2b[_0x9a3b('0x1b')](_0x1d5aef)['json'](_0x16ff58);}};}function respondWithFilteredResult(_0x4803e5,_0x703e57){return function(_0x594395){if(_0x594395){var _0x2b6474=typeof _0x703e57[_0x9a3b('0x1c')]===_0x9a3b('0x1d')&&typeof _0x703e57[_0x9a3b('0x1e')]===_0x9a3b('0x1d');var _0x5b8f24=_0x594395['count'];var _0xa2975=_0x2b6474?0x0:_0x703e57[_0x9a3b('0x1c')];var _0x5c1af2=_0x2b6474?_0x594395[_0x9a3b('0x1f')]:_0x703e57[_0x9a3b('0x1c')]+_0x703e57[_0x9a3b('0x1e')];var _0x4bd9c6;if(_0x5c1af2>=_0x5b8f24){_0x5c1af2=_0x5b8f24;_0x4bd9c6=0xc8;}else{_0x4bd9c6=0xce;}_0x4803e5['status'](_0x4bd9c6);return _0x4803e5[_0x9a3b('0x20')]('Content-Range',_0xa2975+'-'+_0x5c1af2+'/'+_0x5b8f24)['json'](_0x594395);}return null;};}function patchUpdates(_0x34665e){return function(_0x6bd3af){try{jsonpatch[_0x9a3b('0x21')](_0x6bd3af,_0x34665e,!![]);}catch(_0x1c911e){return BPromise[_0x9a3b('0x22')](_0x1c911e);}return _0x6bd3af[_0x9a3b('0x23')]();};}function saveUpdates(_0x5da539,_0x448324){return function(_0x1cb2c0){if(_0x1cb2c0){return _0x1cb2c0[_0x9a3b('0x24')](_0x5da539)[_0x9a3b('0x25')](function(_0x420e5c){return _0x420e5c;});}return null;};}function removeEntity(_0x2d44b1,_0x3b32d8){return function(_0x375804){if(_0x375804){return _0x375804['destroy']()[_0x9a3b('0x25')](function(){var _0xff2a20=_0x375804['get']({'plain':!![]});var _0x58648d=_0x9a3b('0x26');return db[_0x9a3b('0x27')][_0x9a3b('0x28')]({'where':{'type':_0x58648d,'resourceId':_0xff2a20['id']}})[_0x9a3b('0x25')](function(){return _0x375804;});})['then'](function(){_0x2d44b1[_0x9a3b('0x1b')](0xcc)[_0x9a3b('0x1a')]();});}};}function handleEntityNotFound(_0x9daa08,_0x18c9b6){return function(_0x363f75){if(!_0x363f75){_0x9daa08[_0x9a3b('0x19')](0x194);}return _0x363f75;};}function handleError(_0x5eff3d,_0x4813ad){_0x4813ad=_0x4813ad||0x1f4;return function(_0x4eeb4b){logger[_0x9a3b('0x29')](_0x4eeb4b[_0x9a3b('0x2a')]);if(_0x4eeb4b[_0x9a3b('0x2b')]){delete _0x4eeb4b['name'];}_0x5eff3d[_0x9a3b('0x1b')](_0x4813ad)[_0x9a3b('0x2c')](_0x4eeb4b);};}exports[_0x9a3b('0x2d')]=function(_0x169366,_0x3093f1){var _0x38a10b={},_0x4f1abe={},_0x5772d1={'count':0x0,'rows':[]};var _0x2da054=_[_0x9a3b('0x2e')](db[_0x9a3b('0x2f')][_0x9a3b('0x30')],function(_0x1a7e7b){return{'name':_0x1a7e7b['fieldName'],'type':_0x1a7e7b['type']['key']};});_0x4f1abe[_0x9a3b('0x31')]=_[_0x9a3b('0x2e')](_0x2da054,'name');_0x4f1abe[_0x9a3b('0x32')]=_[_0x9a3b('0x33')](_0x169366[_0x9a3b('0x32')]);_0x4f1abe['filters']=_['intersection'](_0x4f1abe[_0x9a3b('0x31')],_0x4f1abe['query']);_0x38a10b[_0x9a3b('0x34')]=_['intersection'](_0x4f1abe[_0x9a3b('0x31')],qs['fields'](_0x169366[_0x9a3b('0x32')][_0x9a3b('0x35')]));_0x38a10b[_0x9a3b('0x34')]=_0x38a10b[_0x9a3b('0x34')][_0x9a3b('0x36')]?_0x38a10b['attributes']:_0x4f1abe[_0x9a3b('0x31')];if(!_0x169366['query'][_0x9a3b('0x37')](_0x9a3b('0x38'))){_0x38a10b[_0x9a3b('0x1e')]=qs[_0x9a3b('0x1e')](_0x169366[_0x9a3b('0x32')][_0x9a3b('0x1e')]);_0x38a10b['offset']=qs['offset'](_0x169366[_0x9a3b('0x32')][_0x9a3b('0x1c')]);}_0x38a10b[_0x9a3b('0x39')]=qs['sort'](_0x169366[_0x9a3b('0x32')]['sort']);_0x38a10b[_0x9a3b('0x3a')]=qs[_0x9a3b('0x3b')](_[_0x9a3b('0x3c')](_0x169366['query'],_0x4f1abe[_0x9a3b('0x3b')]),_0x2da054);if(_0x169366[_0x9a3b('0x32')][_0x9a3b('0x3d')]){_0x38a10b[_0x9a3b('0x3a')]=_[_0x9a3b('0x3e')](_0x38a10b[_0x9a3b('0x3a')],{'$or':_['map'](_0x2da054,function(_0x2193a0){if(_0x2193a0[_0x9a3b('0x3f')]!==_0x9a3b('0x40')){var _0x493632={};_0x493632[_0x2193a0[_0x9a3b('0x2b')]]={'$like':'%'+_0x169366[_0x9a3b('0x32')][_0x9a3b('0x3d')]+'%'};return _0x493632;}})});}_0x38a10b=_[_0x9a3b('0x3e')]({},_0x38a10b,_0x169366[_0x9a3b('0x41')]);var _0x311228={'where':_0x38a10b[_0x9a3b('0x3a')]};return db[_0x9a3b('0x2f')][_0x9a3b('0x1f')](_0x311228)['then'](function(_0xa13292){_0x5772d1[_0x9a3b('0x1f')]=_0xa13292;if(_0x169366[_0x9a3b('0x32')][_0x9a3b('0x42')]){_0x38a10b[_0x9a3b('0x43')]=[{'all':!![]}];}return db[_0x9a3b('0x2f')][_0x9a3b('0x44')](_0x38a10b);})[_0x9a3b('0x25')](function(_0x2872b1){_0x5772d1[_0x9a3b('0x45')]=_0x2872b1;return _0x5772d1;})[_0x9a3b('0x25')](respondWithFilteredResult(_0x3093f1,_0x38a10b))[_0x9a3b('0x46')](handleError(_0x3093f1,null));};exports[_0x9a3b('0x47')]=function(_0x27ee60,_0x1dcc61){var _0x366b4a={'raw':![],'where':{'id':_0x27ee60[_0x9a3b('0x48')]['id']}},_0x2694a4={};_0x2694a4[_0x9a3b('0x31')]=_[_0x9a3b('0x33')](db['VoiceChanSpy'][_0x9a3b('0x30')]);_0x2694a4[_0x9a3b('0x32')]=_[_0x9a3b('0x33')](_0x27ee60[_0x9a3b('0x32')]);_0x2694a4[_0x9a3b('0x3b')]=_[_0x9a3b('0x49')](_0x2694a4[_0x9a3b('0x31')],_0x2694a4[_0x9a3b('0x32')]);_0x366b4a[_0x9a3b('0x34')]=_[_0x9a3b('0x49')](_0x2694a4[_0x9a3b('0x31')],qs[_0x9a3b('0x35')](_0x27ee60[_0x9a3b('0x32')]['fields']));_0x366b4a[_0x9a3b('0x34')]=_0x366b4a[_0x9a3b('0x34')][_0x9a3b('0x36')]?_0x366b4a[_0x9a3b('0x34')]:_0x2694a4[_0x9a3b('0x31')];if(_0x27ee60[_0x9a3b('0x32')]['includeAll']){_0x366b4a['include']=[{'all':!![]}];}_0x366b4a=_[_0x9a3b('0x3e')]({},_0x366b4a,_0x27ee60['options']);return db[_0x9a3b('0x2f')][_0x9a3b('0x4a')](_0x366b4a)[_0x9a3b('0x25')](handleEntityNotFound(_0x1dcc61,null))[_0x9a3b('0x25')](respondWithResult(_0x1dcc61,null))[_0x9a3b('0x46')](handleError(_0x1dcc61,null));};exports[_0x9a3b('0x4b')]=function(_0x115f6b,_0x41389e){return db[_0x9a3b('0x2f')][_0x9a3b('0x4b')](_0x115f6b[_0x9a3b('0x4c')],{})[_0x9a3b('0x25')](function(_0xa71a71){var _0x27c747=_0x115f6b[_0x9a3b('0x4d')]['get']({'plain':!![]});if(!_0x27c747)throw new Error(_0x9a3b('0x4e'));if(_0x27c747[_0x9a3b('0x4f')]===_0x9a3b('0x4d')){var _0x5df82d=_0xa71a71[_0x9a3b('0x50')]({'plain':!![]});var _0x464c7e='ChanSpies';return db[_0x9a3b('0x51')][_0x9a3b('0x4a')]({'where':{'name':_0x464c7e,'userProfileId':_0x27c747[_0x9a3b('0x52')]},'raw':!![]})[_0x9a3b('0x25')](function(_0x3774ea){if(_0x3774ea&&_0x3774ea[_0x9a3b('0x53')]===0x0){return db[_0x9a3b('0x27')][_0x9a3b('0x4b')]({'name':_0x5df82d[_0x9a3b('0x2b')],'resourceId':_0x5df82d['id'],'type':_0x3774ea[_0x9a3b('0x2b')],'sectionId':_0x3774ea['id']},{})[_0x9a3b('0x25')](function(){return _0xa71a71;});}else{return _0xa71a71;}})[_0x9a3b('0x46')](function(_0x1576d7){logger[_0x9a3b('0x29')](_0x9a3b('0x54'),_0x1576d7);throw _0x1576d7;});}return _0xa71a71;})[_0x9a3b('0x25')](respondWithResult(_0x41389e,0xc9))[_0x9a3b('0x46')](handleError(_0x41389e,null));};exports[_0x9a3b('0x24')]=function(_0x1293b6,_0x5488de){if(_0x1293b6['body']['id']){delete _0x1293b6[_0x9a3b('0x4c')]['id'];}return db[_0x9a3b('0x2f')][_0x9a3b('0x4a')]({'where':{'id':_0x1293b6[_0x9a3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5488de,null))[_0x9a3b('0x25')](saveUpdates(_0x1293b6[_0x9a3b('0x4c')],null))['then'](respondWithResult(_0x5488de,null))[_0x9a3b('0x46')](handleError(_0x5488de,null));};exports[_0x9a3b('0x28')]=function(_0x5a370c,_0x4abe87){return db['VoiceChanSpy']['find']({'where':{'id':_0x5a370c['params']['id']}})['then'](handleEntityNotFound(_0x4abe87,null))[_0x9a3b('0x25')](removeEntity(_0x4abe87,null))[_0x9a3b('0x46')](handleError(_0x4abe87,null));}; \ No newline at end of file +var _0x7ec2=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','index','map','VoiceChanSpy','rawAttributes','type','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','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','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4ba2a4,_0x589440){var _0x23eed6=function(_0x29683a){while(--_0x29683a){_0x4ba2a4['push'](_0x4ba2a4['shift']());}};_0x23eed6(++_0x589440);}(_0x7ec2,0x15c));var _0x27ec=function(_0x530038,_0x190cee){_0x530038=_0x530038-0x0;var _0x4c9a85=_0x7ec2[_0x530038];return _0x4c9a85;};'use strict';var emlformat=require(_0x27ec('0x0'));var rimraf=require(_0x27ec('0x1'));var zipdir=require(_0x27ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27ec('0x3'));var moment=require(_0x27ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27ec('0x5'));var util=require(_0x27ec('0x6'));var path=require(_0x27ec('0x7'));var sox=require(_0x27ec('0x8'));var csv=require(_0x27ec('0x9'));var ejs=require(_0x27ec('0xa'));var fs=require('fs');var fs_extra=require(_0x27ec('0xb'));var _=require(_0x27ec('0xc'));var squel=require(_0x27ec('0xd'));var crypto=require(_0x27ec('0xe'));var jsforce=require(_0x27ec('0xf'));var deskjs=require(_0x27ec('0x10'));var toCsv=require(_0x27ec('0x9'));var querystring=require(_0x27ec('0x11'));var Papa=require(_0x27ec('0x12'));var Redis=require(_0x27ec('0x13'));var authService=require(_0x27ec('0x14'));var qs=require(_0x27ec('0x15'));var as=require(_0x27ec('0x16'));var hardwareService=require(_0x27ec('0x17'));var logger=require(_0x27ec('0x18'))('api');var utils=require(_0x27ec('0x19'));var config=require(_0x27ec('0x1a'));var licenseUtil=require(_0x27ec('0x1b'));var db=require(_0x27ec('0x1c'))['db'];function respondWithStatusCode(_0x5b3e08,_0x472020){_0x472020=_0x472020||0xcc;return function(_0x4efa3d){if(_0x4efa3d){return _0x5b3e08[_0x27ec('0x1d')](_0x472020);}return _0x5b3e08[_0x27ec('0x1e')](_0x472020)[_0x27ec('0x1f')]();};}function respondWithResult(_0x317d46,_0x29174c){_0x29174c=_0x29174c||0xc8;return function(_0x14cde9){if(_0x14cde9){return _0x317d46[_0x27ec('0x1e')](_0x29174c)['json'](_0x14cde9);}};}function respondWithFilteredResult(_0x7dbca5,_0x1d75b1){return function(_0x486dae){if(_0x486dae){var _0x56bf7d=typeof _0x1d75b1[_0x27ec('0x20')]==='undefined'&&typeof _0x1d75b1[_0x27ec('0x21')]===_0x27ec('0x22');var _0x4209c9=_0x486dae[_0x27ec('0x23')];var _0x54b2c9=_0x56bf7d?0x0:_0x1d75b1[_0x27ec('0x20')];var _0x389425=_0x56bf7d?_0x486dae[_0x27ec('0x23')]:_0x1d75b1['offset']+_0x1d75b1[_0x27ec('0x21')];var _0x16dc74;if(_0x389425>=_0x4209c9){_0x389425=_0x4209c9;_0x16dc74=0xc8;}else{_0x16dc74=0xce;}_0x7dbca5['status'](_0x16dc74);return _0x7dbca5[_0x27ec('0x24')](_0x27ec('0x25'),_0x54b2c9+'-'+_0x389425+'/'+_0x4209c9)['json'](_0x486dae);}return null;};}function patchUpdates(_0x582cec){return function(_0x2ad3be){try{jsonpatch[_0x27ec('0x26')](_0x2ad3be,_0x582cec,!![]);}catch(_0x24979d){return BPromise[_0x27ec('0x27')](_0x24979d);}return _0x2ad3be[_0x27ec('0x28')]();};}function saveUpdates(_0x4b7f24,_0x19fe3f){return function(_0x1ba9c8){if(_0x1ba9c8){return _0x1ba9c8[_0x27ec('0x29')](_0x4b7f24)[_0x27ec('0x2a')](function(_0x4e4532){return _0x4e4532;});}return null;};}function removeEntity(_0x4eba78,_0x217036){return function(_0x5d5fbe){if(_0x5d5fbe){return _0x5d5fbe[_0x27ec('0x2b')]()[_0x27ec('0x2a')](function(){var _0x4810ed=_0x5d5fbe[_0x27ec('0x2c')]({'plain':!![]});var _0xb958c0=_0x27ec('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0xb958c0,'resourceId':_0x4810ed['id']}})[_0x27ec('0x2a')](function(){return _0x5d5fbe;});})['then'](function(){_0x4eba78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4911f6,_0x44a2e4){return function(_0xf1ee48){if(!_0xf1ee48){_0x4911f6[_0x27ec('0x1d')](0x194);}return _0xf1ee48;};}function handleError(_0x299ecf,_0x3dfc07){_0x3dfc07=_0x3dfc07||0x1f4;return function(_0x23cfe3){logger[_0x27ec('0x2e')](_0x23cfe3[_0x27ec('0x2f')]);if(_0x23cfe3['name']){delete _0x23cfe3[_0x27ec('0x30')];}_0x299ecf[_0x27ec('0x1e')](_0x3dfc07)['send'](_0x23cfe3);};}exports[_0x27ec('0x31')]=function(_0x389389,_0x45d2df){var _0x34138d={},_0xf8c72={},_0x3a564a={'count':0x0,'rows':[]};var _0x2d879b=_[_0x27ec('0x32')](db[_0x27ec('0x33')][_0x27ec('0x34')],function(_0x1e5494){return{'name':_0x1e5494['fieldName'],'type':_0x1e5494[_0x27ec('0x35')]['key']};});_0xf8c72['model']=_[_0x27ec('0x32')](_0x2d879b,_0x27ec('0x30'));_0xf8c72['query']=_[_0x27ec('0x36')](_0x389389[_0x27ec('0x37')]);_0xf8c72['filters']=_['intersection'](_0xf8c72[_0x27ec('0x38')],_0xf8c72[_0x27ec('0x37')]);_0x34138d['attributes']=_[_0x27ec('0x39')](_0xf8c72['model'],qs[_0x27ec('0x3a')](_0x389389['query'][_0x27ec('0x3a')]));_0x34138d[_0x27ec('0x3b')]=_0x34138d['attributes'][_0x27ec('0x3c')]?_0x34138d['attributes']:_0xf8c72[_0x27ec('0x38')];if(!_0x389389[_0x27ec('0x37')][_0x27ec('0x3d')](_0x27ec('0x3e'))){_0x34138d[_0x27ec('0x21')]=qs[_0x27ec('0x21')](_0x389389[_0x27ec('0x37')]['limit']);_0x34138d[_0x27ec('0x20')]=qs[_0x27ec('0x20')](_0x389389[_0x27ec('0x37')][_0x27ec('0x20')]);}_0x34138d[_0x27ec('0x3f')]=qs[_0x27ec('0x40')](_0x389389[_0x27ec('0x37')][_0x27ec('0x40')]);_0x34138d[_0x27ec('0x41')]=qs[_0x27ec('0x42')](_[_0x27ec('0x43')](_0x389389[_0x27ec('0x37')],_0xf8c72[_0x27ec('0x42')]),_0x2d879b);if(_0x389389[_0x27ec('0x37')][_0x27ec('0x44')]){_0x34138d[_0x27ec('0x41')]=_['merge'](_0x34138d[_0x27ec('0x41')],{'$or':_['map'](_0x2d879b,function(_0x1c9764){if(_0x1c9764[_0x27ec('0x35')]!=='VIRTUAL'){var _0x5794dc={};_0x5794dc[_0x1c9764[_0x27ec('0x30')]]={'$like':'%'+_0x389389[_0x27ec('0x37')]['filter']+'%'};return _0x5794dc;}})});}_0x34138d=_[_0x27ec('0x45')]({},_0x34138d,_0x389389[_0x27ec('0x46')]);var _0x121899={'where':_0x34138d[_0x27ec('0x41')]};return db[_0x27ec('0x33')][_0x27ec('0x23')](_0x121899)[_0x27ec('0x2a')](function(_0x33d820){_0x3a564a[_0x27ec('0x23')]=_0x33d820;if(_0x389389[_0x27ec('0x37')][_0x27ec('0x47')]){_0x34138d[_0x27ec('0x48')]=[{'all':!![]}];}return db[_0x27ec('0x33')][_0x27ec('0x49')](_0x34138d);})['then'](function(_0x4ce322){_0x3a564a[_0x27ec('0x4a')]=_0x4ce322;return _0x3a564a;})['then'](respondWithFilteredResult(_0x45d2df,_0x34138d))[_0x27ec('0x4b')](handleError(_0x45d2df,null));};exports[_0x27ec('0x4c')]=function(_0x16e9a1,_0x1904e5){var _0xacdf99={'raw':![],'where':{'id':_0x16e9a1[_0x27ec('0x4d')]['id']}},_0x1b2869={};_0x1b2869[_0x27ec('0x38')]=_['keys'](db[_0x27ec('0x33')][_0x27ec('0x34')]);_0x1b2869[_0x27ec('0x37')]=_[_0x27ec('0x36')](_0x16e9a1[_0x27ec('0x37')]);_0x1b2869[_0x27ec('0x42')]=_['intersection'](_0x1b2869[_0x27ec('0x38')],_0x1b2869[_0x27ec('0x37')]);_0xacdf99[_0x27ec('0x3b')]=_['intersection'](_0x1b2869[_0x27ec('0x38')],qs[_0x27ec('0x3a')](_0x16e9a1[_0x27ec('0x37')][_0x27ec('0x3a')]));_0xacdf99['attributes']=_0xacdf99[_0x27ec('0x3b')][_0x27ec('0x3c')]?_0xacdf99['attributes']:_0x1b2869[_0x27ec('0x38')];if(_0x16e9a1[_0x27ec('0x37')]['includeAll']){_0xacdf99[_0x27ec('0x48')]=[{'all':!![]}];}_0xacdf99=_[_0x27ec('0x45')]({},_0xacdf99,_0x16e9a1[_0x27ec('0x46')]);return db[_0x27ec('0x33')][_0x27ec('0x4e')](_0xacdf99)[_0x27ec('0x2a')](handleEntityNotFound(_0x1904e5,null))[_0x27ec('0x2a')](respondWithResult(_0x1904e5,null))[_0x27ec('0x4b')](handleError(_0x1904e5,null));};exports[_0x27ec('0x4f')]=function(_0x3d7ab0,_0x59e890){return db[_0x27ec('0x33')][_0x27ec('0x4f')](_0x3d7ab0[_0x27ec('0x50')],{})[_0x27ec('0x2a')](function(_0x4697eb){var _0x414352=_0x3d7ab0[_0x27ec('0x51')][_0x27ec('0x2c')]({'plain':!![]});if(!_0x414352)throw new Error(_0x27ec('0x52'));if(_0x414352[_0x27ec('0x53')]===_0x27ec('0x51')){var _0x2aa0d8=_0x4697eb[_0x27ec('0x2c')]({'plain':!![]});var _0x4890a7=_0x27ec('0x2d');return db[_0x27ec('0x54')][_0x27ec('0x4e')]({'where':{'name':_0x4890a7,'userProfileId':_0x414352[_0x27ec('0x55')]},'raw':!![]})[_0x27ec('0x2a')](function(_0x3d9679){if(_0x3d9679&&_0x3d9679[_0x27ec('0x56')]===0x0){return db[_0x27ec('0x57')]['create']({'name':_0x2aa0d8['name'],'resourceId':_0x2aa0d8['id'],'type':_0x3d9679['name'],'sectionId':_0x3d9679['id']},{})['then'](function(){return _0x4697eb;});}else{return _0x4697eb;}})[_0x27ec('0x4b')](function(_0x4d0205){logger[_0x27ec('0x2e')](_0x27ec('0x58'),_0x4d0205);throw _0x4d0205;});}return _0x4697eb;})[_0x27ec('0x2a')](respondWithResult(_0x59e890,0xc9))[_0x27ec('0x4b')](handleError(_0x59e890,null));};exports[_0x27ec('0x29')]=function(_0x20977d,_0x247535){if(_0x20977d[_0x27ec('0x50')]['id']){delete _0x20977d[_0x27ec('0x50')]['id'];}return db[_0x27ec('0x33')][_0x27ec('0x4e')]({'where':{'id':_0x20977d['params']['id']}})[_0x27ec('0x2a')](handleEntityNotFound(_0x247535,null))[_0x27ec('0x2a')](saveUpdates(_0x20977d[_0x27ec('0x50')],null))[_0x27ec('0x2a')](respondWithResult(_0x247535,null))['catch'](handleError(_0x247535,null));};exports[_0x27ec('0x2b')]=function(_0x1d20c7,_0x4ff093){return db[_0x27ec('0x33')][_0x27ec('0x4e')]({'where':{'id':_0x1d20c7['params']['id']}})[_0x27ec('0x2a')](handleEntityNotFound(_0x4ff093,null))[_0x27ec('0x2a')](removeEntity(_0x4ff093,null))[_0x27ec('0x4b')](handleError(_0x4ff093,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 63e412c..db5b063 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 _0xcb7d=['auth','Authenticate','password','ChanSpy','join','record','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','recordingFormat'];(function(_0x4ada7b,_0x2684fb){var _0x3f05b3=function(_0x508612){while(--_0x508612){_0x4ada7b['push'](_0x4ada7b['shift']());}};_0x3f05b3(++_0x2684fb);}(_0xcb7d,0xef));var _0xdcb7=function(_0x287632,_0x324d4a){_0x287632=_0x287632-0x0;var _0x1c5d38=_0xcb7d[_0x287632];return _0x1c5d38;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xdcb7('0x0'));var attributes=require(_0xdcb7('0x1'));var getUserApplications=function(_0x4e26a2,_0x2f311f,_0x2cc23f){var _0x31ca31=0x1;var _0x4379b8=[];var _0x30a14a={'context':_0x2f311f[_0xdcb7('0x2')]||_0xdcb7('0x3'),'exten':util[_0xdcb7('0x4')](_0xdcb7('0x5'),_0x4e26a2[_0xdcb7('0x6')],_0x2cc23f),'type':_0xdcb7('0x7'),'isApp':![],'ChanSpyId':_0x4e26a2['id'],'UserId':_0x2f311f['id']};_0x4379b8[_0xdcb7('0x8')](_[_0xdcb7('0x9')]({'app':_0xdcb7('0xa'),'appdata':util[_0xdcb7('0x4')](_0xdcb7('0xb'),'chanspy'),'priority':_0x31ca31++},_0x30a14a));if(_0x4e26a2['record']){_0x4379b8[_0xdcb7('0x8')](_[_0xdcb7('0x9')]({'app':'MixMonitor','appdata':util[_0xdcb7('0x4')]('${UNIQUEID}.%s,a',_0x4e26a2[_0xdcb7('0xc')]),'priority':_0x31ca31++},_0x30a14a));}if(_0x4e26a2[_0xdcb7('0xd')]){_0x4379b8['push'](_[_0xdcb7('0x9')]({'app':_0xdcb7('0xe'),'appdata':_0x4e26a2[_0xdcb7('0xf')],'priority':_0x31ca31++},_0x30a14a));}_0x4379b8[_0xdcb7('0x8')](_[_0xdcb7('0x9')]({'app':_0xdcb7('0x10'),'appdata':util['format']('SIP/%s,%s',_0x2f311f['name'],_0x4e26a2['options']?_0x4e26a2['options'][_0xdcb7('0x11')](''):''),'priority':_0x31ca31++},_0x30a14a));if(_0x4e26a2[_0xdcb7('0x12')]){_0x4379b8['push'](_[_0xdcb7('0x9')]({'app':_0xdcb7('0x13'),'priority':_0x31ca31++},_0x30a14a));}return _0x4379b8;};var getChanSpyApplications=function(_0x5eba50,_0x36cab8){var _0x33048f=[];for(var _0x31b1d7=0x0,_0x3ad5dc=0x1;_0x31b1d7<_0x36cab8[_0xdcb7('0x14')];_0x31b1d7++,_0x3ad5dc=0x1){_0x33048f=_0x33048f[_0xdcb7('0x15')](getUserApplications(_0x5eba50,_0x36cab8[_0x31b1d7],_0x36cab8[_0x31b1d7][_0xdcb7('0x16')]));if(_0x36cab8[_0x31b1d7][_0xdcb7('0x16')]!=_0x36cab8[_0x31b1d7]['name']){_0x33048f=_0x33048f[_0xdcb7('0x15')](getUserApplications(_0x5eba50,_0x36cab8[_0x31b1d7],_0x36cab8[_0x31b1d7][_0xdcb7('0x17')]));}}return _0x33048f;};var getChanSpyPromise=function(_0x4716ea,_0x5cfad3){return new BPromise(function(_0x3c21ce,_0x115159){return _0x4716ea[_0xdcb7('0x18')][_0xdcb7('0x19')]({'attributes':['id','name',_0xdcb7('0x16')],'where':{'role':_0xdcb7('0x1a'),'chanspy':!![]},'raw':!![]})[_0xdcb7('0x1b')](function(_0xfc11c0){if(_0xfc11c0){return _0x3c21ce(getChanSpyApplications(_0x5cfad3,_0xfc11c0));}return _0x3c21ce([]);})[_0xdcb7('0x1c')](function(_0x40b706){_0x115159(_0x40b706);});});};module[_0xdcb7('0x1d')]=function(_0x18c183,_0x21bbbb){var _0xf98ae4=_0x18c183[_0xdcb7('0x1e')];return _0x18c183['define'](_0xdcb7('0x1f'),attributes,{'tableName':_0xdcb7('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f3ab9,_0x32d1de,_0x3cf38c){return getChanSpyPromise(_0xf98ae4,_0x4f3ab9)[_0xdcb7('0x1b')](function(_0x582573){if(_0x582573&&_0x582573[_0xdcb7('0x14')]){return _0xf98ae4[_0xdcb7('0x21')]['bulkCreate'](_0x582573);}})[_0xdcb7('0x1b')](function(){_0x3cf38c();})[_0xdcb7('0x1c')](function(_0x444464){_0x3cf38c(_0x444464);});},'afterUpdate':function(_0x288044,_0x4510be,_0x44e867){return _0xf98ae4[_0xdcb7('0x21')][_0xdcb7('0x22')]({'where':{'ChanSpyId':_0x288044['id']}})[_0xdcb7('0x1b')](function(){return getChanSpyPromise(_0xf98ae4,_0x288044);})['then'](function(_0x14e4b5){if(_0x14e4b5&&_0x14e4b5['length']){return _0xf98ae4[_0xdcb7('0x21')][_0xdcb7('0x23')](_0x14e4b5);}})[_0xdcb7('0x1b')](function(){_0x44e867();})['catch'](function(_0x213afa){_0x44e867(_0x213afa);});},'afterDestroy':function(_0x5c5700,_0x416e04,_0x3d5201){return _0xf98ae4['VoiceExtension'][_0xdcb7('0x22')]({'where':{'ChanSpyId':_0x5c5700['id']}})[_0xdcb7('0x1b')](function(){_0x3d5201();})['catch'](function(_0x2465fa){_0x3d5201(_0x2465fa);});}}});}; \ No newline at end of file +var _0x713d=['concat','internal','name','User','findAll','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','merge','format','record','MixMonitor','auth','Authenticate','password','SIP/%s,%s','options','join','StopMixMonitor','length'];(function(_0x147317,_0xff13c1){var _0x99c4ce=function(_0x300c13){while(--_0x300c13){_0x147317['push'](_0x147317['shift']());}};_0x99c4ce(++_0xff13c1);}(_0x713d,0x19a));var _0xd713=function(_0x55760e,_0xf9d982){_0x55760e=_0x55760e-0x0;var _0x13d5df=_0x713d[_0x55760e];return _0x13d5df;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require(_0xd713('0x0'));var getUserApplications=function(_0x71738b,_0xa5e8ca,_0x3d1b21){var _0x52f2a3=0x1;var _0x2b96dc=[];var _0x54699c={'context':_0xa5e8ca[_0xd713('0x1')]||_0xd713('0x2'),'exten':util['format'](_0xd713('0x3'),_0x71738b[_0xd713('0x4')],_0x3d1b21),'type':_0xd713('0x5'),'isApp':![],'ChanSpyId':_0x71738b['id'],'UserId':_0xa5e8ca['id']};_0x2b96dc[_0xd713('0x6')](_[_0xd713('0x7')]({'app':'Set','appdata':util[_0xd713('0x8')]('CDR(type)=%s','chanspy'),'priority':_0x52f2a3++},_0x54699c));if(_0x71738b[_0xd713('0x9')]){_0x2b96dc[_0xd713('0x6')](_[_0xd713('0x7')]({'app':_0xd713('0xa'),'appdata':util[_0xd713('0x8')]('${UNIQUEID}.%s,a',_0x71738b['recordingFormat']),'priority':_0x52f2a3++},_0x54699c));}if(_0x71738b[_0xd713('0xb')]){_0x2b96dc[_0xd713('0x6')](_['merge']({'app':_0xd713('0xc'),'appdata':_0x71738b[_0xd713('0xd')],'priority':_0x52f2a3++},_0x54699c));}_0x2b96dc[_0xd713('0x6')](_[_0xd713('0x7')]({'app':'ChanSpy','appdata':util['format'](_0xd713('0xe'),_0xa5e8ca['name'],_0x71738b['options']?_0x71738b[_0xd713('0xf')][_0xd713('0x10')](''):''),'priority':_0x52f2a3++},_0x54699c));if(_0x71738b[_0xd713('0x9')]){_0x2b96dc[_0xd713('0x6')](_[_0xd713('0x7')]({'app':_0xd713('0x11'),'priority':_0x52f2a3++},_0x54699c));}return _0x2b96dc;};var getChanSpyApplications=function(_0x581682,_0x3b1db5){var _0xe90bd3=[];for(var _0x4758bb=0x0,_0x2861e8=0x1;_0x4758bb<_0x3b1db5[_0xd713('0x12')];_0x4758bb++,_0x2861e8=0x1){_0xe90bd3=_0xe90bd3[_0xd713('0x13')](getUserApplications(_0x581682,_0x3b1db5[_0x4758bb],_0x3b1db5[_0x4758bb][_0xd713('0x14')]));if(_0x3b1db5[_0x4758bb][_0xd713('0x14')]!=_0x3b1db5[_0x4758bb][_0xd713('0x15')]){_0xe90bd3=_0xe90bd3['concat'](getUserApplications(_0x581682,_0x3b1db5[_0x4758bb],_0x3b1db5[_0x4758bb]['name']));}}return _0xe90bd3;};var getChanSpyPromise=function(_0x372895,_0x159afe){return new BPromise(function(_0x3fcf3d,_0x4bac41){return _0x372895[_0xd713('0x16')][_0xd713('0x17')]({'attributes':['id',_0xd713('0x15'),_0xd713('0x14')],'where':{'role':_0xd713('0x18'),'chanspy':!![]},'raw':!![]})[_0xd713('0x19')](function(_0x23d9af){if(_0x23d9af){return _0x3fcf3d(getChanSpyApplications(_0x159afe,_0x23d9af));}return _0x3fcf3d([]);})[_0xd713('0x1a')](function(_0x228f82){_0x4bac41(_0x228f82);});});};module[_0xd713('0x1b')]=function(_0x3d3f88,_0x523d24){var _0x56c52e=_0x3d3f88['models'];return _0x3d3f88['define'](_0xd713('0x1c'),attributes,{'tableName':_0xd713('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x407975,_0x351253,_0x311938){return getChanSpyPromise(_0x56c52e,_0x407975)[_0xd713('0x19')](function(_0x1a973a){if(_0x1a973a&&_0x1a973a[_0xd713('0x12')]){return _0x56c52e['VoiceExtension']['bulkCreate'](_0x1a973a);}})[_0xd713('0x19')](function(){_0x311938();})['catch'](function(_0x471c03){_0x311938(_0x471c03);});},'afterUpdate':function(_0x3c0e91,_0x1a06a9,_0x3eb791){return _0x56c52e['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x3c0e91['id']}})[_0xd713('0x19')](function(){return getChanSpyPromise(_0x56c52e,_0x3c0e91);})[_0xd713('0x19')](function(_0x4bdabd){if(_0x4bdabd&&_0x4bdabd[_0xd713('0x12')]){return _0x56c52e['VoiceExtension'][_0xd713('0x1e')](_0x4bdabd);}})[_0xd713('0x19')](function(){_0x3eb791();})[_0xd713('0x1a')](function(_0x5aedfd){_0x3eb791(_0x5aedfd);});},'afterDestroy':function(_0x6e3156,_0x4da7e8,_0x42082b){return _0x56c52e[_0xd713('0x1f')][_0xd713('0x20')]({'where':{'ChanSpyId':_0x6e3156['id']}})['then'](function(){_0x42082b();})[_0xd713('0x1a')](function(_0x15b3d7){_0x42082b(_0x15b3d7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6db606b..c849136 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x1fec23,_0x51de59){var _0x5cb3f6=function(_0x509b75){while(--_0x509b75){_0x1fec23['push'](_0x1fec23['shift']());}};_0x5cb3f6(++_0x51de59);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xcb91[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x073e=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','then','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0xd5640c,_0x3de931){var _0x24124f=function(_0xf7e41c){while(--_0xf7e41c){_0xd5640c['push'](_0xd5640c['shift']());}};_0x24124f(++_0x3de931);}(_0x073e,0x181));var _0xe073=function(_0x385a7c,_0x33d1ca){_0x385a7c=_0x385a7c-0x0;var _0x498819=_0x073e[_0x385a7c];return _0x498819;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var moment=require(_0xe073('0x2'));var BPromise=require(_0xe073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe073('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44092d,_0x1bcaae,_0x3b4fc7){return new BPromise(function(_0x373bf6,_0x1a93da){return client['request'](_0x44092d,_0x3b4fc7)[_0xe073('0x8')](function(_0x7a1f21){logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,'request\x20sent');logger[_0xe073('0xb')](_0xe073('0xc'),_0x1bcaae,_0xe073('0xd'),JSON[_0xe073('0xe')](_0x7a1f21));if(_0x7a1f21[_0xe073('0xf')]){if(_0x7a1f21[_0xe073('0xf')]['code']===0x1f4){logger[_0xe073('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x1bcaae,_0x7a1f21[_0xe073('0xf')]['message']);return _0x1a93da(_0x7a1f21[_0xe073('0xf')]['message']);}logger[_0xe073('0xf')](_0xe073('0xa'),_0x1bcaae,_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);return _0x373bf6(_0x7a1f21[_0xe073('0xf')][_0xe073('0x10')]);}else{logger[_0xe073('0x9')](_0xe073('0xa'),_0x1bcaae,_0xe073('0xd'));_0x373bf6(_0x7a1f21[_0xe073('0x11')][_0xe073('0x10')]);}})['catch'](function(_0x511ab2){logger['error'](_0xe073('0xa'),_0x1bcaae,_0x511ab2);_0x1a93da(_0x511ab2);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 651db9b..57daa30 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 _0x3af4=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x28c4db,_0x2ccd05){var _0x5907ed=function(_0x1d83c2){while(--_0x1d83c2){_0x28c4db['push'](_0x28c4db['shift']());}};_0x5907ed(++_0x2ccd05);}(_0x3af4,0x128));var _0x43af=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x3af4[_0x41c381];return _0x427981;};'use strict';var multer=require(_0x43af('0x0'));var util=require(_0x43af('0x1'));var path=require(_0x43af('0x2'));var timeout=require(_0x43af('0x3'));var express=require('express');var router=express[_0x43af('0x4')]();var fs_extra=require(_0x43af('0x5'));var auth=require(_0x43af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43af('0x7'));var controller=require(_0x43af('0x8'));router[_0x43af('0x9')]('/',auth['isAuthenticated'](),controller[_0x43af('0xa')]);router[_0x43af('0x9')]('/:id',auth[_0x43af('0xb')](),controller[_0x43af('0xc')]);router[_0x43af('0xd')]('/',auth['isAuthenticated'](),controller[_0x43af('0xe')]);router[_0x43af('0xf')](_0x43af('0x10'),auth[_0x43af('0xb')](),controller[_0x43af('0x11')]);router[_0x43af('0x12')](_0x43af('0x10'),auth[_0x43af('0xb')](),controller[_0x43af('0x13')]);module[_0x43af('0x14')]=router; \ No newline at end of file +var _0x5ace=['isAuthenticated','show','post','create','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get'];(function(_0x10c17f,_0x13a092){var _0x1f5f3e=function(_0x240a01){while(--_0x240a01){_0x10c17f['push'](_0x10c17f['shift']());}};_0x1f5f3e(++_0x13a092);}(_0x5ace,0x15d));var _0xe5ac=function(_0x4a0801,_0x55b298){_0x4a0801=_0x4a0801-0x0;var _0x47306d=_0x5ace[_0x4a0801];return _0x47306d;};'use strict';var multer=require(_0xe5ac('0x0'));var util=require(_0xe5ac('0x1'));var path=require(_0xe5ac('0x2'));var timeout=require(_0xe5ac('0x3'));var express=require(_0xe5ac('0x4'));var router=express[_0xe5ac('0x5')]();var fs_extra=require(_0xe5ac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe5ac('0x7'));var config=require(_0xe5ac('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe5ac('0x9')]);router[_0xe5ac('0xa')]('/:id',auth[_0xe5ac('0xb')](),controller[_0xe5ac('0xc')]);router[_0xe5ac('0xd')]('/',auth[_0xe5ac('0xb')](),controller[_0xe5ac('0xe')]);router['put'](_0xe5ac('0xf'),auth[_0xe5ac('0xb')](),controller['update']);router['delete'](_0xe5ac('0xf'),auth['isAuthenticated'](),controller[_0xe5ac('0x10')]);module[_0xe5ac('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c7410f3..229c0de 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 _0x0c02=['name','sequelize','exports','STRING'];(function(_0x5d7005,_0x41f35a){var _0x31ed20=function(_0x3624f8){while(--_0x3624f8){_0x5d7005['push'](_0x5d7005['shift']());}};_0x31ed20(++_0x41f35a);}(_0x0c02,0x185));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x20c0('0x0'));module[_0x20c0('0x1')]={'name':{'type':Sequelize[_0x20c0('0x2')],'unique':_0x20c0('0x3')},'description':{'type':Sequelize[_0x20c0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xee41=['sequelize','exports','BOOLEAN'];(function(_0x1b6f9d,_0x23efbc){var _0x14c8e1=function(_0x26dd43){while(--_0x26dd43){_0x1b6f9d['push'](_0x1b6f9d['shift']());}};_0x14c8e1(++_0x23efbc);}(_0xee41,0x189));var _0x1ee4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xee41[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x1ee4('0x0'));module[_0x1ee4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1ee4('0x2')],'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 44a1ff1..0541f05 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 _0xcffe=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','info','request\x20sent','debug','stringify','code','error','VoiceContext,\x20%s,\x20%s','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','end','sendStatus','stack','name','status','index','map','VoiceContext','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rawAttributes','find','create','body','readFileSync','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','fs-extra','lodash'];(function(_0x4d674e,_0xd22186){var _0xe75e4b=function(_0x267e9d){while(--_0x267e9d){_0x4d674e['push'](_0x4d674e['shift']());}};_0xe75e4b(++_0xd22186);}(_0xcffe,0x12b));var _0xecff=function(_0x44784c,_0x4498c1){_0x44784c=_0x44784c-0x0;var _0x4bbfb1=_0xcffe[_0x44784c];return _0x4bbfb1;};'use strict';var emlformat=require(_0xecff('0x0'));var rimraf=require(_0xecff('0x1'));var zipdir=require(_0xecff('0x2'));var jsonpatch=require(_0xecff('0x3'));var rp=require(_0xecff('0x4'));var moment=require('moment');var BPromise=require(_0xecff('0x5'));var Mustache=require('mustache');var util=require(_0xecff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xecff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecff('0x8'));var _=require(_0xecff('0x9'));var squel=require(_0xecff('0xa'));var crypto=require(_0xecff('0xb'));var jsforce=require(_0xecff('0xc'));var deskjs=require(_0xecff('0xd'));var toCsv=require(_0xecff('0x7'));var querystring=require(_0xecff('0xe'));var Papa=require(_0xecff('0xf'));var Redis=require(_0xecff('0x10'));var authService=require(_0xecff('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xecff('0x12'));var hardwareService=require(_0xecff('0x13'));var logger=require('../../config/logger')(_0xecff('0x14'));var utils=require(_0xecff('0x15'));var config=require(_0xecff('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xecff('0x17'))['db'];var jayson=require(_0xecff('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfcf87,_0x8fbd99,_0x3e8952,_0x4a4e36){return new BPromise(function(_0x1fef3c,_0x76a8ca){var _0x3a6080=_0x4a4e36||client;return _0x3a6080[_0xecff('0x19')](_0xfcf87,_0x3e8952)[_0xecff('0x1a')](function(_0x110203){logger[_0xecff('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x8fbd99,_0xecff('0x1c'));logger[_0xecff('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x8fbd99,_0xecff('0x1c'),JSON[_0xecff('0x1e')](_0x110203));if(_0x110203['error']){if(_0x110203['error'][_0xecff('0x1f')]===0x1f4){logger[_0xecff('0x20')](_0xecff('0x21'),_0x8fbd99,_0x110203[_0xecff('0x20')]['message']);return _0x76a8ca(_0x110203[_0xecff('0x20')][_0xecff('0x22')]);}logger[_0xecff('0x20')](_0xecff('0x21'),_0x8fbd99,_0x110203[_0xecff('0x20')]['message']);return _0x1fef3c(_0x110203[_0xecff('0x20')]['message']);}else{logger[_0xecff('0x1b')](_0xecff('0x21'),_0x8fbd99,_0xecff('0x1c'));_0x1fef3c(_0x110203[_0xecff('0x23')][_0xecff('0x22')]);}})[_0xecff('0x24')](function(_0x3b6eed){logger[_0xecff('0x20')](_0xecff('0x21'),_0x8fbd99,_0x3b6eed);_0x76a8ca(_0x3b6eed);});});}function respondWithStatusCode(_0x16c67f,_0x2a4187){_0x2a4187=_0x2a4187||0xcc;return function(_0x2041cf){if(_0x2041cf){return _0x16c67f['sendStatus'](_0x2a4187);}return _0x16c67f['status'](_0x2a4187)['end']();};}function respondWithResult(_0x2ff3d8,_0x3e08b){_0x3e08b=_0x3e08b||0xc8;return function(_0x4d92b2){if(_0x4d92b2){return _0x2ff3d8['status'](_0x3e08b)[_0xecff('0x25')](_0x4d92b2);}};}function respondWithFilteredResult(_0x589973,_0x1654e3){return function(_0x4090ed){if(_0x4090ed){var _0x153796=typeof _0x1654e3[_0xecff('0x26')]===_0xecff('0x27')&&typeof _0x1654e3[_0xecff('0x28')]===_0xecff('0x27');var _0x7e0753=_0x4090ed[_0xecff('0x29')];var _0x3a8838=_0x153796?0x0:_0x1654e3[_0xecff('0x26')];var _0x3b97b2=_0x153796?_0x4090ed[_0xecff('0x29')]:_0x1654e3[_0xecff('0x26')]+_0x1654e3[_0xecff('0x28')];var _0x43ecfd;if(_0x3b97b2>=_0x7e0753){_0x3b97b2=_0x7e0753;_0x43ecfd=0xc8;}else{_0x43ecfd=0xce;}_0x589973['status'](_0x43ecfd);return _0x589973[_0xecff('0x2a')](_0xecff('0x2b'),_0x3a8838+'-'+_0x3b97b2+'/'+_0x7e0753)['json'](_0x4090ed);}return null;};}function patchUpdates(_0x13c2a6){return function(_0x527402){try{jsonpatch['apply'](_0x527402,_0x13c2a6,!![]);}catch(_0x499d03){return BPromise['reject'](_0x499d03);}return _0x527402[_0xecff('0x2c')]();};}function saveUpdates(_0x404e7f,_0x553cd5){return function(_0x4777cf){if(_0x4777cf){return _0x4777cf[_0xecff('0x2d')](_0x404e7f)[_0xecff('0x1a')](function(_0x375c64){return _0x375c64;});}return null;};}function removeEntity(_0x5bc2af,_0x3c41df){return function(_0x278f8d){if(_0x278f8d){return _0x278f8d[_0xecff('0x2e')]()['then'](function(){var _0x3810a2=_0x278f8d[_0xecff('0x2f')]({'plain':!![]});var _0x58a37e='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x58a37e,'resourceId':_0x3810a2['id']}})['then'](function(){return _0x278f8d;});})[_0xecff('0x1a')](function(){_0x5bc2af['status'](0xcc)[_0xecff('0x30')]();});}};}function handleEntityNotFound(_0x4303c5,_0x60813a){return function(_0x1540de){if(!_0x1540de){_0x4303c5[_0xecff('0x31')](0x194);}return _0x1540de;};}function handleError(_0x5470fe,_0x400fdc){_0x400fdc=_0x400fdc||0x1f4;return function(_0x222a12){logger[_0xecff('0x20')](_0x222a12[_0xecff('0x32')]);if(_0x222a12[_0xecff('0x33')]){delete _0x222a12[_0xecff('0x33')];}_0x5470fe[_0xecff('0x34')](_0x400fdc)['send'](_0x222a12);};}exports[_0xecff('0x35')]=function(_0x1d75a6,_0x569b3c){var _0x99ab89={},_0x28c798={},_0x288561={'count':0x0,'rows':[]};var _0x1a1cae=_[_0xecff('0x36')](db[_0xecff('0x37')]['rawAttributes'],function(_0x236880){return{'name':_0x236880[_0xecff('0x38')],'type':_0x236880[_0xecff('0x39')][_0xecff('0x3a')]};});_0x28c798[_0xecff('0x3b')]=_['map'](_0x1a1cae,_0xecff('0x33'));_0x28c798['query']=_[_0xecff('0x3c')](_0x1d75a6[_0xecff('0x3d')]);_0x28c798[_0xecff('0x3e')]=_['intersection'](_0x28c798[_0xecff('0x3b')],_0x28c798[_0xecff('0x3d')]);_0x99ab89[_0xecff('0x3f')]=_[_0xecff('0x40')](_0x28c798[_0xecff('0x3b')],qs['fields'](_0x1d75a6[_0xecff('0x3d')][_0xecff('0x41')]));_0x99ab89[_0xecff('0x3f')]=_0x99ab89[_0xecff('0x3f')][_0xecff('0x42')]?_0x99ab89[_0xecff('0x3f')]:_0x28c798[_0xecff('0x3b')];if(!_0x1d75a6[_0xecff('0x3d')][_0xecff('0x43')](_0xecff('0x44'))){_0x99ab89['limit']=qs[_0xecff('0x28')](_0x1d75a6['query'][_0xecff('0x28')]);_0x99ab89[_0xecff('0x26')]=qs['offset'](_0x1d75a6[_0xecff('0x3d')][_0xecff('0x26')]);}_0x99ab89[_0xecff('0x45')]=qs[_0xecff('0x46')](_0x1d75a6[_0xecff('0x3d')][_0xecff('0x46')]);_0x99ab89[_0xecff('0x47')]=qs['filters'](_['pick'](_0x1d75a6[_0xecff('0x3d')],_0x28c798['filters']),_0x1a1cae);if(_0x1d75a6['query'][_0xecff('0x48')]){_0x99ab89[_0xecff('0x47')]=_[_0xecff('0x49')](_0x99ab89[_0xecff('0x47')],{'$or':_[_0xecff('0x36')](_0x1a1cae,function(_0x3269a2){if(_0x3269a2[_0xecff('0x39')]!==_0xecff('0x4a')){var _0x33a75a={};_0x33a75a[_0x3269a2[_0xecff('0x33')]]={'$like':'%'+_0x1d75a6['query'][_0xecff('0x48')]+'%'};return _0x33a75a;}})});}_0x99ab89=_[_0xecff('0x49')]({},_0x99ab89,_0x1d75a6[_0xecff('0x4b')]);var _0x123ee2={'where':_0x99ab89[_0xecff('0x47')]};return db[_0xecff('0x37')][_0xecff('0x29')](_0x123ee2)[_0xecff('0x1a')](function(_0x504ed5){_0x288561[_0xecff('0x29')]=_0x504ed5;if(_0x1d75a6['query'][_0xecff('0x4c')]){_0x99ab89[_0xecff('0x4d')]=[{'all':!![]}];}return db[_0xecff('0x37')][_0xecff('0x4e')](_0x99ab89);})[_0xecff('0x1a')](function(_0x47321c){_0x288561['rows']=_0x47321c;return _0x288561;})['then'](respondWithFilteredResult(_0x569b3c,_0x99ab89))[_0xecff('0x24')](handleError(_0x569b3c,null));};exports['show']=function(_0x13095c,_0x195913){var _0xd8f5ed={'raw':![],'where':{'id':_0x13095c['params']['id']}},_0x2ea181={};_0x2ea181[_0xecff('0x3b')]=_[_0xecff('0x3c')](db['VoiceContext'][_0xecff('0x4f')]);_0x2ea181[_0xecff('0x3d')]=_[_0xecff('0x3c')](_0x13095c['query']);_0x2ea181[_0xecff('0x3e')]=_[_0xecff('0x40')](_0x2ea181[_0xecff('0x3b')],_0x2ea181['query']);_0xd8f5ed['attributes']=_[_0xecff('0x40')](_0x2ea181[_0xecff('0x3b')],qs['fields'](_0x13095c[_0xecff('0x3d')]['fields']));_0xd8f5ed['attributes']=_0xd8f5ed['attributes'][_0xecff('0x42')]?_0xd8f5ed[_0xecff('0x3f')]:_0x2ea181[_0xecff('0x3b')];if(_0x13095c['query']['includeAll']){_0xd8f5ed[_0xecff('0x4d')]=[{'all':!![]}];}_0xd8f5ed=_[_0xecff('0x49')]({},_0xd8f5ed,_0x13095c[_0xecff('0x4b')]);return db[_0xecff('0x37')][_0xecff('0x50')](_0xd8f5ed)[_0xecff('0x1a')](handleEntityNotFound(_0x195913,null))[_0xecff('0x1a')](respondWithResult(_0x195913,null))[_0xecff('0x24')](handleError(_0x195913,null));};exports[_0xecff('0x51')]=function(_0x282f9f,_0x44f0ed,_0x1ec8ba){var _0x3026ed;return db['VoiceContext'][_0xecff('0x51')](_0x282f9f[_0xecff('0x52')],{'raw':!![]})[_0xecff('0x1a')](function(_0x4dfdc5){_0x3026ed=_0x4dfdc5;return db[_0xecff('0x37')][_0xecff('0x4e')]({'raw':!![]});})[_0xecff('0x1a')](function(_0x70f207){var _0x5c82fc=fs[_0xecff('0x53')](path['join'](config['root'],_0xecff('0x54')),'utf8');var _0xb83d44=ejs[_0xecff('0x55')](_0x5c82fc,{'contexts':_0x70f207||[]});fs[_0xecff('0x56')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xb83d44);})[_0xecff('0x1a')](function(){return respondWithRpcPromise(_0xecff('0x57'),_0xecff('0x51'),{'module':_0xecff('0x58')});})[_0xecff('0x1a')](function(){var _0x1945b9=_0x282f9f[_0xecff('0x59')][_0xecff('0x2f')]({'plain':!![]});if(!_0x1945b9)throw new Error(_0xecff('0x5a'));if(_0x1945b9[_0xecff('0x5b')]===_0xecff('0x59')){var _0x163f21=_0x3026ed['get']({'plain':!![]});return db[_0xecff('0x5c')]['find']({'where':{'name':_0xecff('0x5d'),'userProfileId':_0x1945b9[_0xecff('0x5e')]},'raw':!![]})[_0xecff('0x1a')](function(_0x3dac46){if(_0x3dac46&&_0x3dac46[_0xecff('0x5f')]===0x0){return db[_0xecff('0x60')][_0xecff('0x51')]({'name':_0x163f21[_0xecff('0x33')],'resourceId':_0x163f21['id'],'type':_0x3dac46[_0xecff('0x33')],'sectionId':_0x3dac46['id']},{})[_0xecff('0x1a')](function(){return _0x3026ed;});}else{return _0x3026ed;}})[_0xecff('0x24')](function(_0xc59974){logger[_0xecff('0x20')](_0xecff('0x61'),_0xc59974);throw _0xc59974;});}return _0x3026ed;})[_0xecff('0x1a')](respondWithResult(_0x44f0ed,0xc9))['catch'](handleError(_0x44f0ed,null));};exports[_0xecff('0x2d')]=function(_0x4b6ace,_0x1ecc73,_0x2e2738){var _0x537966;return db[_0xecff('0x37')][_0xecff('0x50')]({'where':{'id':_0x4b6ace[_0xecff('0x62')]['id']}})[_0xecff('0x1a')](handleEntityNotFound(_0x1ecc73,null))[_0xecff('0x1a')](saveUpdates(_0x4b6ace[_0xecff('0x52')],null))['then'](function(_0x36eb2f){if(_0x36eb2f){_0x537966=_0x36eb2f;return db[_0xecff('0x37')][_0xecff('0x4e')]({'raw':!![]});}})[_0xecff('0x1a')](function(_0x69f5f7){var _0xc74278=fs[_0xecff('0x53')](path[_0xecff('0x63')](config[_0xecff('0x64')],'server/files/templates/context.ejs'),_0xecff('0x65'));var _0x466def=ejs['render'](_0xc74278,{'contexts':_0x69f5f7||[]});fs['writeFileSync'](_0xecff('0x66'),_0x466def);})[_0xecff('0x1a')](function(){return respondWithRpcPromise(_0xecff('0x57'),'update',{'module':_0xecff('0x58')});})['then'](function(){return _0x537966;})[_0xecff('0x1a')](respondWithResult(_0x1ecc73,null))[_0xecff('0x24')](handleError(_0x1ecc73,null));};exports[_0xecff('0x2e')]=function(_0x500276,_0x5e2824,_0x5ee35b){var _0x24193b;return db['VoiceContext'][_0xecff('0x50')]({'where':{'id':_0x500276['params']['id']}})[_0xecff('0x1a')](handleEntityNotFound(_0x5e2824,null))['then'](removeEntity(_0x5e2824,null))[_0xecff('0x1a')](function(){return db[_0xecff('0x37')][_0xecff('0x4e')]({'raw':!![]});})[_0xecff('0x1a')](function(_0x3f606f){var _0x5dae07=fs[_0xecff('0x53')](path[_0xecff('0x63')](config[_0xecff('0x64')],_0xecff('0x54')),'utf8');var _0x399191=ejs[_0xecff('0x55')](_0x5dae07,{'contexts':_0x3f606f});fs[_0xecff('0x56')](_0xecff('0x66'),_0x399191);return respondWithRpcPromise('Reload',_0xecff('0x2e'),{'module':_0xecff('0x58')});})[_0xecff('0x24')](handleError(_0x5e2824,null));}; \ No newline at end of file +var _0xd78b=['http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','get','UserProfileResource','destroy','stack','name','index','map','VoiceContext','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','render','readFileSync','utf8','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client'];(function(_0x5c332d,_0x4abd2b){var _0x5da878=function(_0xad8bde){while(--_0xad8bde){_0x5c332d['push'](_0x5c332d['shift']());}};_0x5da878(++_0x4abd2b);}(_0xd78b,0x1d7));var _0xbd78=function(_0x48b6ef,_0x55bc21){_0x48b6ef=_0x48b6ef-0x0;var _0x4838cd=_0xd78b[_0x48b6ef];return _0x4838cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd78('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd78('0x1'));var rp=require(_0xbd78('0x2'));var moment=require(_0xbd78('0x3'));var BPromise=require(_0xbd78('0x4'));var Mustache=require(_0xbd78('0x5'));var util=require(_0xbd78('0x6'));var path=require('path');var sox=require(_0xbd78('0x7'));var csv=require(_0xbd78('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd78('0x9'));var _=require(_0xbd78('0xa'));var squel=require(_0xbd78('0xb'));var crypto=require(_0xbd78('0xc'));var jsforce=require(_0xbd78('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbd78('0xe'));var Papa=require(_0xbd78('0xf'));var Redis=require(_0xbd78('0x10'));var authService=require(_0xbd78('0x11'));var qs=require(_0xbd78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd78('0x13'))(_0xbd78('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbd78('0x15'))['db'];var jayson=require(_0xbd78('0x16'));var client=jayson[_0xbd78('0x17')][_0xbd78('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5d5ffd,_0x1e68e5,_0x2cec2d,_0x1065cb){return new BPromise(function(_0x2c7c60,_0x576f86){var _0x28824b=_0x1065cb||client;return _0x28824b[_0xbd78('0x19')](_0x5d5ffd,_0x2cec2d)[_0xbd78('0x1a')](function(_0x49834a){logger[_0xbd78('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x1e68e5,_0xbd78('0x1c'));logger[_0xbd78('0x1d')](_0xbd78('0x1e'),_0x1e68e5,_0xbd78('0x1c'),JSON['stringify'](_0x49834a));if(_0x49834a[_0xbd78('0x1f')]){if(_0x49834a['error'][_0xbd78('0x20')]===0x1f4){logger['error'](_0xbd78('0x21'),_0x1e68e5,_0x49834a[_0xbd78('0x1f')]['message']);return _0x576f86(_0x49834a[_0xbd78('0x1f')][_0xbd78('0x22')]);}logger['error'](_0xbd78('0x21'),_0x1e68e5,_0x49834a[_0xbd78('0x1f')][_0xbd78('0x22')]);return _0x2c7c60(_0x49834a[_0xbd78('0x1f')][_0xbd78('0x22')]);}else{logger[_0xbd78('0x1b')](_0xbd78('0x21'),_0x1e68e5,'request\x20sent');_0x2c7c60(_0x49834a['result'][_0xbd78('0x22')]);}})[_0xbd78('0x23')](function(_0x51a565){logger[_0xbd78('0x1f')](_0xbd78('0x21'),_0x1e68e5,_0x51a565);_0x576f86(_0x51a565);});});}function respondWithStatusCode(_0x2402e6,_0x5512d4){_0x5512d4=_0x5512d4||0xcc;return function(_0x522f0f){if(_0x522f0f){return _0x2402e6[_0xbd78('0x24')](_0x5512d4);}return _0x2402e6[_0xbd78('0x25')](_0x5512d4)[_0xbd78('0x26')]();};}function respondWithResult(_0x21c60b,_0x187860){_0x187860=_0x187860||0xc8;return function(_0x17305b){if(_0x17305b){return _0x21c60b[_0xbd78('0x25')](_0x187860)[_0xbd78('0x27')](_0x17305b);}};}function respondWithFilteredResult(_0x391bfd,_0x1ba273){return function(_0x4c2a96){if(_0x4c2a96){var _0x4f8ce6=typeof _0x1ba273[_0xbd78('0x28')]===_0xbd78('0x29')&&typeof _0x1ba273[_0xbd78('0x2a')]==='undefined';var _0x147370=_0x4c2a96['count'];var _0x5d3ee2=_0x4f8ce6?0x0:_0x1ba273[_0xbd78('0x28')];var _0x1e6524=_0x4f8ce6?_0x4c2a96[_0xbd78('0x2b')]:_0x1ba273[_0xbd78('0x28')]+_0x1ba273['limit'];var _0x5bf776;if(_0x1e6524>=_0x147370){_0x1e6524=_0x147370;_0x5bf776=0xc8;}else{_0x5bf776=0xce;}_0x391bfd[_0xbd78('0x25')](_0x5bf776);return _0x391bfd[_0xbd78('0x2c')]('Content-Range',_0x5d3ee2+'-'+_0x1e6524+'/'+_0x147370)['json'](_0x4c2a96);}return null;};}function patchUpdates(_0x1240cb){return function(_0x3894a0){try{jsonpatch[_0xbd78('0x2d')](_0x3894a0,_0x1240cb,!![]);}catch(_0x50bbc7){return BPromise[_0xbd78('0x2e')](_0x50bbc7);}return _0x3894a0[_0xbd78('0x2f')]();};}function saveUpdates(_0x4d69cf,_0x551c78){return function(_0x5591c6){if(_0x5591c6){return _0x5591c6[_0xbd78('0x30')](_0x4d69cf)[_0xbd78('0x1a')](function(_0x29c58b){return _0x29c58b;});}return null;};}function removeEntity(_0x236aa3,_0x586772){return function(_0x4e57c7){if(_0x4e57c7){return _0x4e57c7['destroy']()[_0xbd78('0x1a')](function(){var _0x3ee4f5=_0x4e57c7[_0xbd78('0x31')]({'plain':!![]});var _0x481de1='Contexts';return db[_0xbd78('0x32')][_0xbd78('0x33')]({'where':{'type':_0x481de1,'resourceId':_0x3ee4f5['id']}})['then'](function(){return _0x4e57c7;});})[_0xbd78('0x1a')](function(){_0x236aa3['status'](0xcc)[_0xbd78('0x26')]();});}};}function handleEntityNotFound(_0x54683b,_0x4e395e){return function(_0x45ddde){if(!_0x45ddde){_0x54683b[_0xbd78('0x24')](0x194);}return _0x45ddde;};}function handleError(_0x2f7bf2,_0x137aca){_0x137aca=_0x137aca||0x1f4;return function(_0x3f3a79){logger[_0xbd78('0x1f')](_0x3f3a79[_0xbd78('0x34')]);if(_0x3f3a79[_0xbd78('0x35')]){delete _0x3f3a79[_0xbd78('0x35')];}_0x2f7bf2[_0xbd78('0x25')](_0x137aca)['send'](_0x3f3a79);};}exports[_0xbd78('0x36')]=function(_0x23543b,_0x4ac79b){var _0x1983a2={},_0x56d9ca={},_0x162597={'count':0x0,'rows':[]};var _0x5ec635=_[_0xbd78('0x37')](db[_0xbd78('0x38')]['rawAttributes'],function(_0x3307ce){return{'name':_0x3307ce[_0xbd78('0x39')],'type':_0x3307ce[_0xbd78('0x3a')][_0xbd78('0x3b')]};});_0x56d9ca['model']=_['map'](_0x5ec635,'name');_0x56d9ca[_0xbd78('0x3c')]=_[_0xbd78('0x3d')](_0x23543b[_0xbd78('0x3c')]);_0x56d9ca['filters']=_[_0xbd78('0x3e')](_0x56d9ca[_0xbd78('0x3f')],_0x56d9ca[_0xbd78('0x3c')]);_0x1983a2[_0xbd78('0x40')]=_[_0xbd78('0x3e')](_0x56d9ca[_0xbd78('0x3f')],qs[_0xbd78('0x41')](_0x23543b[_0xbd78('0x3c')][_0xbd78('0x41')]));_0x1983a2[_0xbd78('0x40')]=_0x1983a2[_0xbd78('0x40')]['length']?_0x1983a2[_0xbd78('0x40')]:_0x56d9ca[_0xbd78('0x3f')];if(!_0x23543b[_0xbd78('0x3c')]['hasOwnProperty'](_0xbd78('0x42'))){_0x1983a2[_0xbd78('0x2a')]=qs[_0xbd78('0x2a')](_0x23543b[_0xbd78('0x3c')][_0xbd78('0x2a')]);_0x1983a2[_0xbd78('0x28')]=qs[_0xbd78('0x28')](_0x23543b[_0xbd78('0x3c')][_0xbd78('0x28')]);}_0x1983a2['order']=qs[_0xbd78('0x43')](_0x23543b[_0xbd78('0x3c')][_0xbd78('0x43')]);_0x1983a2[_0xbd78('0x44')]=qs[_0xbd78('0x45')](_[_0xbd78('0x46')](_0x23543b['query'],_0x56d9ca['filters']),_0x5ec635);if(_0x23543b[_0xbd78('0x3c')]['filter']){_0x1983a2[_0xbd78('0x44')]=_[_0xbd78('0x47')](_0x1983a2[_0xbd78('0x44')],{'$or':_['map'](_0x5ec635,function(_0x5175a2){if(_0x5175a2[_0xbd78('0x3a')]!==_0xbd78('0x48')){var _0xce35fc={};_0xce35fc[_0x5175a2[_0xbd78('0x35')]]={'$like':'%'+_0x23543b['query']['filter']+'%'};return _0xce35fc;}})});}_0x1983a2=_['merge']({},_0x1983a2,_0x23543b[_0xbd78('0x49')]);var _0x83daa7={'where':_0x1983a2[_0xbd78('0x44')]};return db[_0xbd78('0x38')][_0xbd78('0x2b')](_0x83daa7)['then'](function(_0x21c3e1){_0x162597[_0xbd78('0x2b')]=_0x21c3e1;if(_0x23543b[_0xbd78('0x3c')][_0xbd78('0x4a')]){_0x1983a2['include']=[{'all':!![]}];}return db[_0xbd78('0x38')][_0xbd78('0x4b')](_0x1983a2);})['then'](function(_0x4758cb){_0x162597[_0xbd78('0x4c')]=_0x4758cb;return _0x162597;})[_0xbd78('0x1a')](respondWithFilteredResult(_0x4ac79b,_0x1983a2))[_0xbd78('0x23')](handleError(_0x4ac79b,null));};exports[_0xbd78('0x4d')]=function(_0x29e2dc,_0x364a28){var _0x3ba5be={'raw':![],'where':{'id':_0x29e2dc[_0xbd78('0x4e')]['id']}},_0x5bf327={};_0x5bf327[_0xbd78('0x3f')]=_[_0xbd78('0x3d')](db['VoiceContext']['rawAttributes']);_0x5bf327['query']=_[_0xbd78('0x3d')](_0x29e2dc[_0xbd78('0x3c')]);_0x5bf327[_0xbd78('0x45')]=_[_0xbd78('0x3e')](_0x5bf327[_0xbd78('0x3f')],_0x5bf327[_0xbd78('0x3c')]);_0x3ba5be[_0xbd78('0x40')]=_['intersection'](_0x5bf327[_0xbd78('0x3f')],qs[_0xbd78('0x41')](_0x29e2dc[_0xbd78('0x3c')][_0xbd78('0x41')]));_0x3ba5be[_0xbd78('0x40')]=_0x3ba5be[_0xbd78('0x40')][_0xbd78('0x4f')]?_0x3ba5be[_0xbd78('0x40')]:_0x5bf327[_0xbd78('0x3f')];if(_0x29e2dc[_0xbd78('0x3c')][_0xbd78('0x4a')]){_0x3ba5be[_0xbd78('0x50')]=[{'all':!![]}];}_0x3ba5be=_[_0xbd78('0x47')]({},_0x3ba5be,_0x29e2dc[_0xbd78('0x49')]);return db[_0xbd78('0x38')][_0xbd78('0x51')](_0x3ba5be)['then'](handleEntityNotFound(_0x364a28,null))[_0xbd78('0x1a')](respondWithResult(_0x364a28,null))[_0xbd78('0x23')](handleError(_0x364a28,null));};exports[_0xbd78('0x52')]=function(_0x4a3bb4,_0x508bdc,_0x207eb6){var _0x4b03af;return db[_0xbd78('0x38')][_0xbd78('0x52')](_0x4a3bb4[_0xbd78('0x53')],{'raw':!![]})['then'](function(_0x2d010b){_0x4b03af=_0x2d010b;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xbd78('0x1a')](function(_0x193522){var _0x5ca116=fs['readFileSync'](path[_0xbd78('0x54')](config[_0xbd78('0x55')],_0xbd78('0x56')),'utf8');var _0x41db5e=ejs['render'](_0x5ca116,{'contexts':_0x193522||[]});fs[_0xbd78('0x57')](_0xbd78('0x58'),_0x41db5e);})['then'](function(){return respondWithRpcPromise(_0xbd78('0x59'),_0xbd78('0x52'),{'module':_0xbd78('0x5a')});})[_0xbd78('0x1a')](function(){var _0x5f0b07=_0x4a3bb4['user'][_0xbd78('0x31')]({'plain':!![]});if(!_0x5f0b07)throw new Error(_0xbd78('0x5b'));if(_0x5f0b07['role']===_0xbd78('0x5c')){var _0x31679e=_0x4b03af[_0xbd78('0x31')]({'plain':!![]});return db[_0xbd78('0x5d')][_0xbd78('0x51')]({'where':{'name':'Contexts','userProfileId':_0x5f0b07[_0xbd78('0x5e')]},'raw':!![]})[_0xbd78('0x1a')](function(_0x4e5fb6){if(_0x4e5fb6&&_0x4e5fb6[_0xbd78('0x5f')]===0x0){return db[_0xbd78('0x32')][_0xbd78('0x52')]({'name':_0x31679e['name'],'resourceId':_0x31679e['id'],'type':_0x4e5fb6['name'],'sectionId':_0x4e5fb6['id']},{})['then'](function(){return _0x4b03af;});}else{return _0x4b03af;}})['catch'](function(_0x1e22a5){logger[_0xbd78('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e22a5);throw _0x1e22a5;});}return _0x4b03af;})[_0xbd78('0x1a')](respondWithResult(_0x508bdc,0xc9))[_0xbd78('0x23')](handleError(_0x508bdc,null));};exports[_0xbd78('0x30')]=function(_0x4b9923,_0x3e1c46,_0x44bf34){var _0x12d11c;return db[_0xbd78('0x38')]['find']({'where':{'id':_0x4b9923[_0xbd78('0x4e')]['id']}})[_0xbd78('0x1a')](handleEntityNotFound(_0x3e1c46,null))[_0xbd78('0x1a')](saveUpdates(_0x4b9923['body'],null))[_0xbd78('0x1a')](function(_0x19b54b){if(_0x19b54b){_0x12d11c=_0x19b54b;return db[_0xbd78('0x38')][_0xbd78('0x4b')]({'raw':!![]});}})[_0xbd78('0x1a')](function(_0x335a51){var _0x43bb39=fs['readFileSync'](path[_0xbd78('0x54')](config[_0xbd78('0x55')],_0xbd78('0x56')),'utf8');var _0x1aa269=ejs[_0xbd78('0x60')](_0x43bb39,{'contexts':_0x335a51||[]});fs[_0xbd78('0x57')](_0xbd78('0x58'),_0x1aa269);})['then'](function(){return respondWithRpcPromise(_0xbd78('0x59'),_0xbd78('0x30'),{'module':_0xbd78('0x5a')});})[_0xbd78('0x1a')](function(){return _0x12d11c;})[_0xbd78('0x1a')](respondWithResult(_0x3e1c46,null))[_0xbd78('0x23')](handleError(_0x3e1c46,null));};exports['destroy']=function(_0x155643,_0x1b7d08,_0x281789){var _0x35c832;return db[_0xbd78('0x38')][_0xbd78('0x51')]({'where':{'id':_0x155643[_0xbd78('0x4e')]['id']}})[_0xbd78('0x1a')](handleEntityNotFound(_0x1b7d08,null))[_0xbd78('0x1a')](removeEntity(_0x1b7d08,null))[_0xbd78('0x1a')](function(){return db[_0xbd78('0x38')]['findAll']({'raw':!![]});})[_0xbd78('0x1a')](function(_0x4c48e6){var _0x3dc64d=fs[_0xbd78('0x61')](path[_0xbd78('0x54')](config[_0xbd78('0x55')],_0xbd78('0x56')),_0xbd78('0x62'));var _0x23270e=ejs[_0xbd78('0x60')](_0x3dc64d,{'contexts':_0x4c48e6});fs[_0xbd78('0x57')](_0xbd78('0x58'),_0x23270e);return respondWithRpcPromise(_0xbd78('0x59'),'destroy',{'module':_0xbd78('0x5a')});})[_0xbd78('0x23')](handleError(_0x1b7d08,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 8b0f0bc..f7ce9a3 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 _0x2076=['exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x4ad91e,_0x3e9ce7){var _0x2a37c2=function(_0x36d2e5){while(--_0x36d2e5){_0x4ad91e['push'](_0x4ad91e['shift']());}};_0x2a37c2(++_0x3e9ce7);}(_0x2076,0x13c));var _0x6207=function(_0x27c399,_0x39d39a){_0x27c399=_0x27c399-0x0;var _0x4d7f7f=_0x2076[_0x27c399];return _0x4d7f7f;};'use strict';var _=require(_0x6207('0x0'));var util=require('util');var logger=require(_0x6207('0x1'))('api');var moment=require(_0x6207('0x2'));var BPromise=require(_0x6207('0x3'));var rp=require(_0x6207('0x4'));var fs=require('fs');var path=require(_0x6207('0x5'));var rimraf=require(_0x6207('0x6'));var config=require(_0x6207('0x7'));var attributes=require(_0x6207('0x8'));module[_0x6207('0x9')]=function(_0x2eb6ba,_0x4d9e2b){return _0x2eb6ba[_0x6207('0xa')](_0x6207('0xb'),attributes,{'tableName':_0x6207('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30cc=['../../config/environment','./voiceContext.attributes','VoiceContext','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x30cc,0x81));var _0xc30c=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x30cc[_0x44c974];return _0x5214c6;};'use strict';var _=require(_0xc30c('0x0'));var util=require(_0xc30c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc30c('0x2'));var BPromise=require(_0xc30c('0x3'));var rp=require(_0xc30c('0x4'));var fs=require('fs');var path=require(_0xc30c('0x5'));var rimraf=require('rimraf');var config=require(_0xc30c('0x6'));var attributes=require(_0xc30c('0x7'));module['exports']=function(_0x25300f,_0x1cc91d){return _0x25300f['define'](_0xc30c('0x8'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 7bdb4fa..9f698f1 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 _0x7d06=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7d06,0x158));var _0x67d0=function(_0x3cc791,_0x1ee717){_0x3cc791=_0x3cc791-0x0;var _0x53efee=_0x7d06[_0x3cc791];return _0x53efee;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});} \ No newline at end of file +var _0x32e3=['then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x37eac0,_0x4d0f2d){var _0x308f5e=function(_0x4fb06e){while(--_0x4fb06e){_0x37eac0['push'](_0x37eac0['shift']());}};_0x308f5e(++_0x4d0f2d);}(_0x32e3,0x104));var _0x332e=function(_0x47655b,_0x38b639){_0x47655b=_0x47655b-0x0;var _0x3a8976=_0x32e3[_0x47655b];return _0x3a8976;};'use strict';var _=require('lodash');var util=require(_0x332e('0x0'));var moment=require(_0x332e('0x1'));var BPromise=require(_0x332e('0x2'));var rs=require(_0x332e('0x3'));var fs=require('fs');var Redis=require(_0x332e('0x4'));var db=require(_0x332e('0x5'))['db'];var utils=require(_0x332e('0x6'));var logger=require('../../config/logger')(_0x332e('0x7'));var config=require(_0x332e('0x8'));var jayson=require(_0x332e('0x9'));var client=jayson[_0x332e('0xa')][_0x332e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c1ee8,_0x2d4489,_0x575f38){return new BPromise(function(_0x25fa7d,_0x4a134a){return client[_0x332e('0xc')](_0x2c1ee8,_0x575f38)[_0x332e('0xd')](function(_0x33f3d9){logger['info']('VoiceContext,\x20%s,\x20%s',_0x2d4489,_0x332e('0xe'));logger[_0x332e('0xf')](_0x332e('0x10'),_0x2d4489,_0x332e('0xe'),JSON[_0x332e('0x11')](_0x33f3d9));if(_0x33f3d9[_0x332e('0x12')]){if(_0x33f3d9[_0x332e('0x12')]['code']===0x1f4){logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x33f3d9['error']['message']);return _0x4a134a(_0x33f3d9['error'][_0x332e('0x14')]);}logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x33f3d9[_0x332e('0x12')][_0x332e('0x14')]);return _0x25fa7d(_0x33f3d9[_0x332e('0x12')][_0x332e('0x14')]);}else{logger['info'](_0x332e('0x13'),_0x2d4489,'request\x20sent');_0x25fa7d(_0x33f3d9['result']['message']);}})['catch'](function(_0x6108e7){logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x6108e7);_0x4a134a(_0x6108e7);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 05dc483..eeae39c 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 _0x9b60=['fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5cb58f,_0x40165f){var _0x2e5cc5=function(_0x1429a4){while(--_0x1429a4){_0x5cb58f['push'](_0x5cb58f['shift']());}};_0x2e5cc5(++_0x40165f);}(_0x9b60,0x174));var _0x09b6=function(_0x5db9ef,_0xba690a){_0x5db9ef=_0x5db9ef-0x0;var _0x4ab649=_0x9b60[_0x5db9ef];return _0x4ab649;};'use strict';var multer=require(_0x09b6('0x0'));var util=require(_0x09b6('0x1'));var path=require(_0x09b6('0x2'));var timeout=require(_0x09b6('0x3'));var express=require(_0x09b6('0x4'));var router=express[_0x09b6('0x5')]();var fs_extra=require(_0x09b6('0x6'));var auth=require(_0x09b6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09b6('0x8'));router[_0x09b6('0x9')]('/',auth[_0x09b6('0xa')](),controller[_0x09b6('0xb')]);router[_0x09b6('0x9')](_0x09b6('0xc'),auth[_0x09b6('0xa')](),controller[_0x09b6('0xd')]);router[_0x09b6('0x9')](_0x09b6('0xe'),auth[_0x09b6('0xa')](),controller[_0x09b6('0xf')]);router[_0x09b6('0x10')]('/',auth[_0x09b6('0xa')](),controller['create']);router[_0x09b6('0x11')](_0x09b6('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x09b6('0x12')](_0x09b6('0xe'),auth[_0x09b6('0xa')](),controller[_0x09b6('0x13')]);module[_0x09b6('0x14')]=router; \ No newline at end of file +var _0xf8aa=['post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8aa,0x13b));var _0xaf8a=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf8aa[_0x5f3f88];return _0xd08119;};'use strict';var multer=require(_0xaf8a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf8a('0x1'));var express=require('express');var router=express[_0xaf8a('0x2')]();var fs_extra=require(_0xaf8a('0x3'));var auth=require(_0xaf8a('0x4'));var interaction=require(_0xaf8a('0x5'));var config=require(_0xaf8a('0x6'));var controller=require(_0xaf8a('0x7'));router[_0xaf8a('0x8')]('/',auth[_0xaf8a('0x9')](),controller[_0xaf8a('0xa')]);router[_0xaf8a('0x8')](_0xaf8a('0xb'),auth[_0xaf8a('0x9')](),controller[_0xaf8a('0xc')]);router[_0xaf8a('0x8')](_0xaf8a('0xd'),auth['isAuthenticated'](),controller[_0xaf8a('0xe')]);router[_0xaf8a('0xf')]('/',auth[_0xaf8a('0x9')](),controller[_0xaf8a('0x10')]);router[_0xaf8a('0x11')](_0xaf8a('0xd'),auth['isAuthenticated'](),controller[_0xaf8a('0x12')]);router[_0xaf8a('0x13')](_0xaf8a('0xd'),auth[_0xaf8a('0x9')](),controller[_0xaf8a('0x14')]);module[_0xaf8a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 23a82e3..6b23de0 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x525bcf,_0x428c0c){var _0x4c3486=function(_0xf87f2){while(--_0xf87f2){_0x525bcf['push'](_0x525bcf['shift']());}};_0x4c3486(++_0x428c0c);}(_0x9f62,0x154));var _0x29f6=function(_0x4fe087,_0x15d128){_0x4fe087=_0x4fe087-0x0;var _0x2601cf=_0x9f62[_0x4fe087];return _0x2601cf;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file +var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x5684b8,_0x4e2475){var _0xf7384b=function(_0x1adbfe){while(--_0x1adbfe){_0x5684b8['push'](_0x5684b8['shift']());}};_0xf7384b(++_0x4e2475);}(_0xedd9,0xfc));var _0x9edd=function(_0x1dcd79,_0x5f3d0c){_0x1dcd79=_0x1dcd79-0x0;var _0x99c1e6=_0xedd9[_0x1dcd79];return _0x99c1e6;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 593325e..f59c609 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 _0x2cfc=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','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','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys'];(function(_0x120212,_0x4451c5){var _0x2341f6=function(_0x47723f){while(--_0x47723f){_0x120212['push'](_0x120212['shift']());}};_0x2341f6(++_0x4451c5);}(_0x2cfc,0xf9));var _0xc2cf=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x2cfc[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2cf('0x1'));var BPromise=require(_0xc2cf('0x2'));var Mustache=require(_0xc2cf('0x3'));var util=require(_0xc2cf('0x4'));var path=require(_0xc2cf('0x5'));var sox=require(_0xc2cf('0x6'));var csv=require(_0xc2cf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2cf('0x8'));var squel=require(_0xc2cf('0x9'));var crypto=require(_0xc2cf('0xa'));var jsforce=require(_0xc2cf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc2cf('0x7'));var querystring=require(_0xc2cf('0xc'));var Papa=require(_0xc2cf('0xd'));var Redis=require(_0xc2cf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc2cf('0xf'));var as=require(_0xc2cf('0x10'));var hardwareService=require(_0xc2cf('0x11'));var logger=require(_0xc2cf('0x12'))(_0xc2cf('0x13'));var utils=require(_0xc2cf('0x14'));var config=require(_0xc2cf('0x15'));var licenseUtil=require(_0xc2cf('0x16'));var db=require(_0xc2cf('0x17'))['db'];function respondWithStatusCode(_0x3aafba,_0x5a7821){_0x5a7821=_0x5a7821||0xcc;return function(_0xe3449b){if(_0xe3449b){return _0x3aafba['sendStatus'](_0x5a7821);}return _0x3aafba[_0xc2cf('0x18')](_0x5a7821)[_0xc2cf('0x19')]();};}function respondWithResult(_0x544c4f,_0xf6c1b1){_0xf6c1b1=_0xf6c1b1||0xc8;return function(_0x5e1812){if(_0x5e1812){return _0x544c4f['status'](_0xf6c1b1)[_0xc2cf('0x1a')](_0x5e1812);}};}function respondWithFilteredResult(_0x1c6929,_0x238e6a){return function(_0xc95d78){if(_0xc95d78){var _0x13011e=typeof _0x238e6a[_0xc2cf('0x1b')]===_0xc2cf('0x1c')&&typeof _0x238e6a['limit']===_0xc2cf('0x1c');var _0x3b9845=_0xc95d78['count'];var _0x1de1b6=_0x13011e?0x0:_0x238e6a[_0xc2cf('0x1b')];var _0x339448=_0x13011e?_0xc95d78[_0xc2cf('0x1d')]:_0x238e6a[_0xc2cf('0x1b')]+_0x238e6a[_0xc2cf('0x1e')];var _0x3d3673;if(_0x339448>=_0x3b9845){_0x339448=_0x3b9845;_0x3d3673=0xc8;}else{_0x3d3673=0xce;}_0x1c6929['status'](_0x3d3673);return _0x1c6929['set'](_0xc2cf('0x1f'),_0x1de1b6+'-'+_0x339448+'/'+_0x3b9845)['json'](_0xc95d78);}return null;};}function patchUpdates(_0x3032d1){return function(_0x186d5c){try{jsonpatch[_0xc2cf('0x20')](_0x186d5c,_0x3032d1,!![]);}catch(_0x55c472){return BPromise[_0xc2cf('0x21')](_0x55c472);}return _0x186d5c[_0xc2cf('0x22')]();};}function saveUpdates(_0x2d6ea5,_0x3ced5d){return function(_0x3b099c){if(_0x3b099c){return _0x3b099c[_0xc2cf('0x23')](_0x2d6ea5)['then'](function(_0x197b66){return _0x197b66;});}return null;};}function removeEntity(_0x407d46,_0x32b163){return function(_0x5aa919){if(_0x5aa919){return _0x5aa919[_0xc2cf('0x24')]()[_0xc2cf('0x25')](function(){_0x407d46[_0xc2cf('0x18')](0xcc)[_0xc2cf('0x19')]();});}};}function handleEntityNotFound(_0x285846,_0x278971){return function(_0x43b259){if(!_0x43b259){_0x285846[_0xc2cf('0x26')](0x194);}return _0x43b259;};}function handleError(_0x42d012,_0x3fb82b){_0x3fb82b=_0x3fb82b||0x1f4;return function(_0x36ae20){logger[_0xc2cf('0x27')](_0x36ae20[_0xc2cf('0x28')]);if(_0x36ae20['name']){delete _0x36ae20[_0xc2cf('0x29')];}_0x42d012[_0xc2cf('0x18')](_0x3fb82b)[_0xc2cf('0x2a')](_0x36ae20);};}exports['index']=function(_0x10ddab,_0x130dd6){var _0x428a79={},_0x1cf4a0={},_0x5b349a={'count':0x0,'rows':[]};var _0x32a695=_[_0xc2cf('0x2b')](db[_0xc2cf('0x2c')][_0xc2cf('0x2d')],function(_0x2414cd){return{'name':_0x2414cd[_0xc2cf('0x2e')],'type':_0x2414cd[_0xc2cf('0x2f')][_0xc2cf('0x30')]};});_0x1cf4a0[_0xc2cf('0x31')]=_[_0xc2cf('0x2b')](_0x32a695,_0xc2cf('0x29'));_0x1cf4a0['query']=_[_0xc2cf('0x32')](_0x10ddab[_0xc2cf('0x33')]);_0x1cf4a0[_0xc2cf('0x34')]=_[_0xc2cf('0x35')](_0x1cf4a0[_0xc2cf('0x31')],_0x1cf4a0[_0xc2cf('0x33')]);_0x428a79[_0xc2cf('0x36')]=_[_0xc2cf('0x35')](_0x1cf4a0[_0xc2cf('0x31')],qs[_0xc2cf('0x37')](_0x10ddab[_0xc2cf('0x33')][_0xc2cf('0x37')]));_0x428a79[_0xc2cf('0x36')]=_0x428a79[_0xc2cf('0x36')][_0xc2cf('0x38')]?_0x428a79['attributes']:_0x1cf4a0['model'];if(!_0x10ddab[_0xc2cf('0x33')][_0xc2cf('0x39')]('nolimit')){_0x428a79[_0xc2cf('0x1e')]=qs[_0xc2cf('0x1e')](_0x10ddab['query']['limit']);_0x428a79['offset']=qs[_0xc2cf('0x1b')](_0x10ddab[_0xc2cf('0x33')][_0xc2cf('0x1b')]);}_0x428a79[_0xc2cf('0x3a')]=qs[_0xc2cf('0x3b')](_0x10ddab['query'][_0xc2cf('0x3b')]);_0x428a79[_0xc2cf('0x3c')]=qs[_0xc2cf('0x34')](_['pick'](_0x10ddab['query'],_0x1cf4a0[_0xc2cf('0x34')]),_0x32a695);if(_0x10ddab[_0xc2cf('0x33')][_0xc2cf('0x3d')]){_0x428a79['where']=_[_0xc2cf('0x3e')](_0x428a79[_0xc2cf('0x3c')],{'$or':_[_0xc2cf('0x2b')](_0x32a695,function(_0x30ecc3){if(_0x30ecc3[_0xc2cf('0x2f')]!==_0xc2cf('0x3f')){var _0x457c91={};_0x457c91[_0x30ecc3[_0xc2cf('0x29')]]={'$like':'%'+_0x10ddab['query'][_0xc2cf('0x3d')]+'%'};return _0x457c91;}})});}_0x428a79=_[_0xc2cf('0x3e')]({},_0x428a79,_0x10ddab[_0xc2cf('0x40')]);var _0x543667={'where':_0x428a79[_0xc2cf('0x3c')]};return db[_0xc2cf('0x2c')][_0xc2cf('0x1d')](_0x543667)['then'](function(_0x3f12a9){_0x5b349a[_0xc2cf('0x1d')]=_0x3f12a9;if(_0x10ddab[_0xc2cf('0x33')]['includeAll']){_0x428a79[_0xc2cf('0x41')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xc2cf('0x42')](_0x428a79);})[_0xc2cf('0x25')](function(_0x4c02a8){_0x5b349a['rows']=_0x4c02a8;return _0x5b349a;})[_0xc2cf('0x25')](respondWithFilteredResult(_0x130dd6,_0x428a79))[_0xc2cf('0x43')](handleError(_0x130dd6,null));};exports[_0xc2cf('0x44')]=function(_0x836d60,_0x2befa3){var _0xe12f64={'raw':!![],'where':{'id':_0x836d60[_0xc2cf('0x45')]['id']}},_0x49c2db={};_0x49c2db[_0xc2cf('0x31')]=_[_0xc2cf('0x32')](db[_0xc2cf('0x2c')][_0xc2cf('0x2d')]);_0x49c2db[_0xc2cf('0x33')]=_[_0xc2cf('0x32')](_0x836d60[_0xc2cf('0x33')]);_0x49c2db['filters']=_[_0xc2cf('0x35')](_0x49c2db[_0xc2cf('0x31')],_0x49c2db[_0xc2cf('0x33')]);_0xe12f64[_0xc2cf('0x36')]=_[_0xc2cf('0x35')](_0x49c2db[_0xc2cf('0x31')],qs[_0xc2cf('0x37')](_0x836d60[_0xc2cf('0x33')]['fields']));_0xe12f64[_0xc2cf('0x36')]=_0xe12f64[_0xc2cf('0x36')][_0xc2cf('0x38')]?_0xe12f64['attributes']:_0x49c2db[_0xc2cf('0x31')];if(_0x836d60[_0xc2cf('0x33')][_0xc2cf('0x46')]){_0xe12f64[_0xc2cf('0x41')]=[{'all':!![]}];}_0xe12f64=_['merge']({},_0xe12f64,_0x836d60[_0xc2cf('0x40')]);return db[_0xc2cf('0x2c')][_0xc2cf('0x47')](_0xe12f64)[_0xc2cf('0x25')](handleEntityNotFound(_0x2befa3,null))['then'](respondWithResult(_0x2befa3,null))[_0xc2cf('0x43')](handleError(_0x2befa3,null));};exports['create']=function(_0x14f1c3,_0xd37e19){return db['VoiceDialReport'][_0xc2cf('0x48')](_0x14f1c3[_0xc2cf('0x49')],{})[_0xc2cf('0x25')](respondWithResult(_0xd37e19,0xc9))[_0xc2cf('0x43')](handleError(_0xd37e19,null));};exports[_0xc2cf('0x23')]=function(_0x57e18e,_0x7f446e){if(_0x57e18e[_0xc2cf('0x49')]['id']){delete _0x57e18e['body']['id'];}return db[_0xc2cf('0x2c')][_0xc2cf('0x47')]({'where':{'id':_0x57e18e[_0xc2cf('0x45')]['id']}})[_0xc2cf('0x25')](handleEntityNotFound(_0x7f446e,null))['then'](saveUpdates(_0x57e18e[_0xc2cf('0x49')],null))[_0xc2cf('0x25')](respondWithResult(_0x7f446e,null))[_0xc2cf('0x43')](handleError(_0x7f446e,null));};exports[_0xc2cf('0x24')]=function(_0x16efcc,_0x5816b4){return db[_0xc2cf('0x2c')]['find']({'where':{'id':_0x16efcc[_0xc2cf('0x45')]['id']}})[_0xc2cf('0x25')](handleEntityNotFound(_0x5816b4,null))[_0xc2cf('0x25')](removeEntity(_0x5816b4,null))[_0xc2cf('0x43')](handleError(_0x5816b4,null));};exports[_0xc2cf('0x4a')]=function(_0x3c64be,_0x3135f2){return db[_0xc2cf('0x2c')]['describe']()[_0xc2cf('0x25')](respondWithResult(_0x3135f2,null))['catch'](handleError(_0x3135f2,null));}; \ No newline at end of file +var _0x1e94=['sendStatus','status','undefined','limit','count','offset','Content-Range','json','reject','save','then','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1e94,0x82));var _0x41e9=function(_0xbddfbf,_0x27b320){_0xbddfbf=_0xbddfbf-0x0;var _0x276844=_0x1e94[_0xbddfbf];return _0x276844;};'use strict';var emlformat=require(_0x41e9('0x0'));var rimraf=require(_0x41e9('0x1'));var zipdir=require(_0x41e9('0x2'));var jsonpatch=require(_0x41e9('0x3'));var rp=require(_0x41e9('0x4'));var moment=require(_0x41e9('0x5'));var BPromise=require(_0x41e9('0x6'));var Mustache=require(_0x41e9('0x7'));var util=require(_0x41e9('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x41e9('0x9'));var ejs=require(_0x41e9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41e9('0xb'));var squel=require(_0x41e9('0xc'));var crypto=require(_0x41e9('0xd'));var jsforce=require(_0x41e9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x41e9('0x9'));var querystring=require('querystring');var Papa=require(_0x41e9('0xf'));var Redis=require(_0x41e9('0x10'));var authService=require(_0x41e9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41e9('0x12'));var hardwareService=require(_0x41e9('0x13'));var logger=require(_0x41e9('0x14'))(_0x41e9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x41e9('0x16'));var db=require(_0x41e9('0x17'))['db'];function respondWithStatusCode(_0xe91da,_0x58df28){_0x58df28=_0x58df28||0xcc;return function(_0xbfbd2f){if(_0xbfbd2f){return _0xe91da[_0x41e9('0x18')](_0x58df28);}return _0xe91da['status'](_0x58df28)['end']();};}function respondWithResult(_0x322cbc,_0x47f8c8){_0x47f8c8=_0x47f8c8||0xc8;return function(_0x350078){if(_0x350078){return _0x322cbc[_0x41e9('0x19')](_0x47f8c8)['json'](_0x350078);}};}function respondWithFilteredResult(_0x31b530,_0x11bdc6){return function(_0x33dcaf){if(_0x33dcaf){var _0x49dbf9=typeof _0x11bdc6['offset']===_0x41e9('0x1a')&&typeof _0x11bdc6[_0x41e9('0x1b')]===_0x41e9('0x1a');var _0x376256=_0x33dcaf[_0x41e9('0x1c')];var _0x2bb86f=_0x49dbf9?0x0:_0x11bdc6[_0x41e9('0x1d')];var _0x17df73=_0x49dbf9?_0x33dcaf['count']:_0x11bdc6['offset']+_0x11bdc6[_0x41e9('0x1b')];var _0x23b137;if(_0x17df73>=_0x376256){_0x17df73=_0x376256;_0x23b137=0xc8;}else{_0x23b137=0xce;}_0x31b530[_0x41e9('0x19')](_0x23b137);return _0x31b530['set'](_0x41e9('0x1e'),_0x2bb86f+'-'+_0x17df73+'/'+_0x376256)[_0x41e9('0x1f')](_0x33dcaf);}return null;};}function patchUpdates(_0x4ea0b9){return function(_0x165f0f){try{jsonpatch['apply'](_0x165f0f,_0x4ea0b9,!![]);}catch(_0x380839){return BPromise[_0x41e9('0x20')](_0x380839);}return _0x165f0f[_0x41e9('0x21')]();};}function saveUpdates(_0x373993,_0x300512){return function(_0x30816a){if(_0x30816a){return _0x30816a['update'](_0x373993)[_0x41e9('0x22')](function(_0x2c2d86){return _0x2c2d86;});}return null;};}function removeEntity(_0x2525b7,_0x225c89){return function(_0x46f2b8){if(_0x46f2b8){return _0x46f2b8['destroy']()['then'](function(){_0x2525b7[_0x41e9('0x19')](0xcc)[_0x41e9('0x23')]();});}};}function handleEntityNotFound(_0x17eb9c,_0x3c5fee){return function(_0x331030){if(!_0x331030){_0x17eb9c[_0x41e9('0x18')](0x194);}return _0x331030;};}function handleError(_0x1212a8,_0x392e44){_0x392e44=_0x392e44||0x1f4;return function(_0x53fae0){logger[_0x41e9('0x24')](_0x53fae0[_0x41e9('0x25')]);if(_0x53fae0[_0x41e9('0x26')]){delete _0x53fae0[_0x41e9('0x26')];}_0x1212a8[_0x41e9('0x19')](_0x392e44)[_0x41e9('0x27')](_0x53fae0);};}exports[_0x41e9('0x28')]=function(_0x3db6d5,_0x4ff4c3){var _0x4275d7={},_0x391d0c={},_0x293ab3={'count':0x0,'rows':[]};var _0x307750=_[_0x41e9('0x29')](db[_0x41e9('0x2a')][_0x41e9('0x2b')],function(_0x5b3b63){return{'name':_0x5b3b63[_0x41e9('0x2c')],'type':_0x5b3b63[_0x41e9('0x2d')][_0x41e9('0x2e')]};});_0x391d0c['model']=_[_0x41e9('0x29')](_0x307750,_0x41e9('0x26'));_0x391d0c[_0x41e9('0x2f')]=_[_0x41e9('0x30')](_0x3db6d5['query']);_0x391d0c[_0x41e9('0x31')]=_[_0x41e9('0x32')](_0x391d0c['model'],_0x391d0c[_0x41e9('0x2f')]);_0x4275d7['attributes']=_[_0x41e9('0x32')](_0x391d0c[_0x41e9('0x33')],qs[_0x41e9('0x34')](_0x3db6d5[_0x41e9('0x2f')][_0x41e9('0x34')]));_0x4275d7[_0x41e9('0x35')]=_0x4275d7['attributes'][_0x41e9('0x36')]?_0x4275d7[_0x41e9('0x35')]:_0x391d0c[_0x41e9('0x33')];if(!_0x3db6d5[_0x41e9('0x2f')][_0x41e9('0x37')](_0x41e9('0x38'))){_0x4275d7[_0x41e9('0x1b')]=qs[_0x41e9('0x1b')](_0x3db6d5[_0x41e9('0x2f')][_0x41e9('0x1b')]);_0x4275d7[_0x41e9('0x1d')]=qs[_0x41e9('0x1d')](_0x3db6d5[_0x41e9('0x2f')][_0x41e9('0x1d')]);}_0x4275d7[_0x41e9('0x39')]=qs[_0x41e9('0x3a')](_0x3db6d5[_0x41e9('0x2f')]['sort']);_0x4275d7[_0x41e9('0x3b')]=qs[_0x41e9('0x31')](_['pick'](_0x3db6d5[_0x41e9('0x2f')],_0x391d0c[_0x41e9('0x31')]),_0x307750);if(_0x3db6d5['query'][_0x41e9('0x3c')]){_0x4275d7['where']=_['merge'](_0x4275d7['where'],{'$or':_[_0x41e9('0x29')](_0x307750,function(_0x1be534){if(_0x1be534['type']!==_0x41e9('0x3d')){var _0x197636={};_0x197636[_0x1be534['name']]={'$like':'%'+_0x3db6d5[_0x41e9('0x2f')]['filter']+'%'};return _0x197636;}})});}_0x4275d7=_[_0x41e9('0x3e')]({},_0x4275d7,_0x3db6d5[_0x41e9('0x3f')]);var _0x4724a5={'where':_0x4275d7['where']};return db[_0x41e9('0x2a')][_0x41e9('0x1c')](_0x4724a5)[_0x41e9('0x22')](function(_0x968ade){_0x293ab3['count']=_0x968ade;if(_0x3db6d5[_0x41e9('0x2f')][_0x41e9('0x40')]){_0x4275d7[_0x41e9('0x41')]=[{'all':!![]}];}return db[_0x41e9('0x2a')][_0x41e9('0x42')](_0x4275d7);})[_0x41e9('0x22')](function(_0x1dfd43){_0x293ab3[_0x41e9('0x43')]=_0x1dfd43;return _0x293ab3;})[_0x41e9('0x22')](respondWithFilteredResult(_0x4ff4c3,_0x4275d7))[_0x41e9('0x44')](handleError(_0x4ff4c3,null));};exports[_0x41e9('0x45')]=function(_0x5a73bd,_0x1b06d0){var _0x31070f={'raw':!![],'where':{'id':_0x5a73bd['params']['id']}},_0x5526d0={};_0x5526d0[_0x41e9('0x33')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x5526d0['query']=_[_0x41e9('0x30')](_0x5a73bd['query']);_0x5526d0[_0x41e9('0x31')]=_[_0x41e9('0x32')](_0x5526d0[_0x41e9('0x33')],_0x5526d0['query']);_0x31070f[_0x41e9('0x35')]=_['intersection'](_0x5526d0[_0x41e9('0x33')],qs['fields'](_0x5a73bd['query']['fields']));_0x31070f[_0x41e9('0x35')]=_0x31070f[_0x41e9('0x35')][_0x41e9('0x36')]?_0x31070f[_0x41e9('0x35')]:_0x5526d0[_0x41e9('0x33')];if(_0x5a73bd['query'][_0x41e9('0x40')]){_0x31070f['include']=[{'all':!![]}];}_0x31070f=_['merge']({},_0x31070f,_0x5a73bd[_0x41e9('0x3f')]);return db[_0x41e9('0x2a')][_0x41e9('0x46')](_0x31070f)['then'](handleEntityNotFound(_0x1b06d0,null))[_0x41e9('0x22')](respondWithResult(_0x1b06d0,null))[_0x41e9('0x44')](handleError(_0x1b06d0,null));};exports[_0x41e9('0x47')]=function(_0x58060b,_0x44290c){return db['VoiceDialReport'][_0x41e9('0x47')](_0x58060b['body'],{})[_0x41e9('0x22')](respondWithResult(_0x44290c,0xc9))[_0x41e9('0x44')](handleError(_0x44290c,null));};exports[_0x41e9('0x48')]=function(_0x41b8d6,_0x28b590){if(_0x41b8d6[_0x41e9('0x49')]['id']){delete _0x41b8d6['body']['id'];}return db[_0x41e9('0x2a')][_0x41e9('0x46')]({'where':{'id':_0x41b8d6[_0x41e9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28b590,null))[_0x41e9('0x22')](saveUpdates(_0x41b8d6[_0x41e9('0x49')],null))[_0x41e9('0x22')](respondWithResult(_0x28b590,null))[_0x41e9('0x44')](handleError(_0x28b590,null));};exports[_0x41e9('0x4b')]=function(_0x2b77d7,_0x463db8){return db[_0x41e9('0x2a')]['find']({'where':{'id':_0x2b77d7[_0x41e9('0x4a')]['id']}})[_0x41e9('0x22')](handleEntityNotFound(_0x463db8,null))[_0x41e9('0x22')](removeEntity(_0x463db8,null))[_0x41e9('0x44')](handleError(_0x463db8,null));};exports[_0x41e9('0x4c')]=function(_0x21c0ff,_0x470a8b){return db[_0x41e9('0x2a')][_0x41e9('0x4c')]()[_0x41e9('0x22')](respondWithResult(_0x470a8b,null))[_0x41e9('0x44')](handleError(_0x470a8b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 032e5a4..9e9cc47 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 _0x424f=['request-promise','path','exports','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c4db9,_0x1d01af){var _0x41948f=function(_0x2e31da){while(--_0x2e31da){_0x3c4db9['push'](_0x3c4db9['shift']());}};_0x41948f(++_0x1d01af);}(_0x424f,0x94));var _0xf424=function(_0x21168c,_0x54974f){_0x21168c=_0x21168c-0x0;var _0x90ddd9=_0x424f[_0x21168c];return _0x90ddd9;};'use strict';var _=require(_0xf424('0x0'));var util=require(_0xf424('0x1'));var logger=require(_0xf424('0x2'))(_0xf424('0x3'));var moment=require(_0xf424('0x4'));var BPromise=require(_0xf424('0x5'));var rp=require(_0xf424('0x6'));var fs=require('fs');var path=require(_0xf424('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xf424('0x8')]=function(_0x1b8131,_0x47e8e8){return _0x1b8131['define']('VoiceDialReport',attributes,{'tableName':_0xf424('0x9'),'paranoid':![],'indexes':[{'fields':[_0xf424('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x42ff=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x38d172,_0x65abba){var _0x592f58=function(_0x519c66){while(--_0x519c66){_0x38d172['push'](_0x38d172['shift']());}};_0x592f58(++_0x65abba);}(_0x42ff,0xa8));var _0xf42f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x42ff[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf42f('0x0'));var util=require(_0xf42f('0x1'));var logger=require(_0xf42f('0x2'))(_0xf42f('0x3'));var moment=require(_0xf42f('0x4'));var BPromise=require(_0xf42f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf42f('0x6'));var rimraf=require(_0xf42f('0x7'));var config=require('../../config/environment');var attributes=require(_0xf42f('0x8'));module[_0xf42f('0x9')]=function(_0x2d2c0e,_0x2e3b60){return _0x2d2c0e[_0xf42f('0xa')](_0xf42f('0xb'),attributes,{'tableName':_0xf42f('0xc'),'paranoid':![],'indexes':[{'fields':[_0xf42f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index e83f849..2ec06e4 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 _0x25d4=['options','raw','then','UpdateVoiceDialReport','update','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x5b40f6,_0x35c981){var _0x50fd3d=function(_0x243fd8){while(--_0x243fd8){_0x5b40f6['push'](_0x5b40f6['shift']());}};_0x50fd3d(++_0x35c981);}(_0x25d4,0x1ab));var _0x425d=function(_0x136532,_0x29b189){_0x136532=_0x136532-0x0;var _0x4659e8=_0x25d4[_0x136532];return _0x4659e8;};'use strict';var _=require(_0x425d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x425d('0x1'));var rs=require(_0x425d('0x2'));var fs=require('fs');var Redis=require(_0x425d('0x3'));var db=require(_0x425d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x425d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x425d('0x6'));var client=jayson[_0x425d('0x7')][_0x425d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2aeb57,_0x4c5af4,_0x1b3a0d){return new BPromise(function(_0x72d656,_0x3c6a7a){return client[_0x425d('0x9')](_0x2aeb57,_0x1b3a0d)['then'](function(_0x382194){logger[_0x425d('0xa')](_0x425d('0xb'),_0x4c5af4,_0x425d('0xc'));logger[_0x425d('0xd')](_0x425d('0xe'),_0x4c5af4,_0x425d('0xc'),JSON[_0x425d('0xf')](_0x382194));if(_0x382194[_0x425d('0x10')]){if(_0x382194[_0x425d('0x10')][_0x425d('0x11')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4c5af4,_0x382194[_0x425d('0x10')]['message']);return _0x3c6a7a(_0x382194[_0x425d('0x10')]['message']);}logger[_0x425d('0x10')](_0x425d('0xb'),_0x4c5af4,_0x382194['error']['message']);return _0x72d656(_0x382194['error']['message']);}else{logger[_0x425d('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x4c5af4,'request\x20sent');_0x72d656(_0x382194[_0x425d('0x12')][_0x425d('0x13')]);}})[_0x425d('0x14')](function(_0x292a38){logger[_0x425d('0x10')](_0x425d('0xb'),_0x4c5af4,_0x292a38);_0x3c6a7a(_0x292a38);});});}exports[_0x425d('0x15')]=function(_0x24a8ac){var _0x5ab75f=this;return new Promise(function(_0x1fdbcf,_0x390d34){return db[_0x425d('0x16')]['create'](_0x24a8ac['body'],{'raw':_0x24a8ac[_0x425d('0x17')]?_0x24a8ac[_0x425d('0x17')][_0x425d('0x18')]===undefined?!![]:![]:!![]})[_0x425d('0x19')](function(_0x32c3a8){logger[_0x425d('0xa')]('CreateVoiceDialReport',_0x24a8ac);logger[_0x425d('0xd')](_0x425d('0x15'),_0x24a8ac,JSON['stringify'](_0x32c3a8));_0x1fdbcf(_0x32c3a8);})[_0x425d('0x14')](function(_0x3e45a0){logger['error'](_0x425d('0x15'),_0x3e45a0[_0x425d('0x13')],_0x24a8ac);_0x390d34(_0x5ab75f['error'](0x1f4,_0x3e45a0[_0x425d('0x13')]));});});};exports[_0x425d('0x1a')]=function(_0x1fcbeb){var _0x5ed299=this;return new Promise(function(_0x45705a,_0x35d176){return db[_0x425d('0x16')][_0x425d('0x1b')](_0x1fcbeb['body'],{'raw':_0x1fcbeb[_0x425d('0x17')]?_0x1fcbeb[_0x425d('0x17')][_0x425d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fcbeb[_0x425d('0x17')]?_0x1fcbeb[_0x425d('0x17')]['where']||null:null,'attributes':_0x1fcbeb[_0x425d('0x17')]?_0x1fcbeb[_0x425d('0x17')][_0x425d('0x1c')]||null:null,'limit':_0x1fcbeb[_0x425d('0x17')]?_0x1fcbeb[_0x425d('0x17')][_0x425d('0x1d')]||null:null})[_0x425d('0x19')](function(_0x442f05){logger[_0x425d('0xa')](_0x425d('0x1a'),_0x1fcbeb);logger[_0x425d('0xd')]('UpdateVoiceDialReport',_0x1fcbeb,JSON[_0x425d('0xf')](_0x442f05));_0x45705a(_0x442f05);})[_0x425d('0x14')](function(_0x3f64b0){logger['error']('UpdateVoiceDialReport',_0x3f64b0[_0x425d('0x13')],_0x1fcbeb);_0x35d176(_0x5ed299[_0x425d('0x10')](0x1f4,_0x3f64b0[_0x425d('0x13')]));});});}; \ No newline at end of file +var _0xfb11=['attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','then','where'];(function(_0x30b709,_0x13f8c9){var _0x3bae5b=function(_0x2805f3){while(--_0x2805f3){_0x30b709['push'](_0x30b709['shift']());}};_0x3bae5b(++_0x13f8c9);}(_0xfb11,0x16b));var _0x1fb1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xfb11[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x1fb1('0x0'));var util=require(_0x1fb1('0x1'));var moment=require(_0x1fb1('0x2'));var BPromise=require(_0x1fb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fb1('0x4'))['db'];var utils=require(_0x1fb1('0x5'));var logger=require(_0x1fb1('0x6'))('rpc');var config=require(_0x1fb1('0x7'));var jayson=require(_0x1fb1('0x8'));var client=jayson['client'][_0x1fb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425f1d,_0x92be80,_0x728a9a){return new BPromise(function(_0x3644c4,_0x1aa708){return client[_0x1fb1('0xa')](_0x425f1d,_0x728a9a)['then'](function(_0x2c9897){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x92be80,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x92be80,_0x1fb1('0xd'),JSON[_0x1fb1('0xf')](_0x2c9897));if(_0x2c9897[_0x1fb1('0x10')]){if(_0x2c9897[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x92be80,_0x2c9897[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x1aa708(_0x2c9897[_0x1fb1('0x10')]['message']);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x92be80,_0x2c9897[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x3644c4(_0x2c9897[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x92be80,_0x1fb1('0xd'));_0x3644c4(_0x2c9897[_0x1fb1('0x13')][_0x1fb1('0x12')]);}})[_0x1fb1('0x14')](function(_0x5a5732){logger['error'](_0x1fb1('0xc'),_0x92be80,_0x5a5732);_0x1aa708(_0x5a5732);});});}exports[_0x1fb1('0x15')]=function(_0xf0d33b){var _0x1e04ba=this;return new Promise(function(_0x4ce623,_0x3a2712){return db[_0x1fb1('0x16')][_0x1fb1('0x17')](_0xf0d33b['body'],{'raw':_0xf0d33b[_0x1fb1('0x18')]?_0xf0d33b[_0x1fb1('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1fb1('0x19')](function(_0x2c9539){logger[_0x1fb1('0xb')]('CreateVoiceDialReport',_0xf0d33b);logger['debug'](_0x1fb1('0x15'),_0xf0d33b,JSON['stringify'](_0x2c9539));_0x4ce623(_0x2c9539);})[_0x1fb1('0x14')](function(_0x1bfbf7){logger[_0x1fb1('0x10')](_0x1fb1('0x15'),_0x1bfbf7[_0x1fb1('0x12')],_0xf0d33b);_0x3a2712(_0x1e04ba['error'](0x1f4,_0x1bfbf7['message']));});});};exports['UpdateVoiceDialReport']=function(_0x295f47){var _0x2ab336=this;return new Promise(function(_0x2ec5c8,_0x27cd1d){return db[_0x1fb1('0x16')]['update'](_0x295f47['body'],{'raw':_0x295f47[_0x1fb1('0x18')]?_0x295f47['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295f47[_0x1fb1('0x18')]?_0x295f47[_0x1fb1('0x18')][_0x1fb1('0x1a')]||null:null,'attributes':_0x295f47[_0x1fb1('0x18')]?_0x295f47[_0x1fb1('0x18')][_0x1fb1('0x1b')]||null:null,'limit':_0x295f47['options']?_0x295f47[_0x1fb1('0x18')][_0x1fb1('0x1c')]||null:null})[_0x1fb1('0x19')](function(_0x16fe23){logger[_0x1fb1('0xb')]('UpdateVoiceDialReport',_0x295f47);logger['debug']('UpdateVoiceDialReport',_0x295f47,JSON[_0x1fb1('0xf')](_0x16fe23));_0x2ec5c8(_0x16fe23);})[_0x1fb1('0x14')](function(_0x1c89f0){logger[_0x1fb1('0x10')](_0x1fb1('0x1d'),_0x1c89f0[_0x1fb1('0x12')],_0x295f47);_0x27cd1d(_0x2ab336[_0x1fb1('0x10')](0x1f4,_0x1c89f0[_0x1fb1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index aefcfbc..94c9265 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 _0x86d8=['/:id','destroy','multer','path','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','/:id/applications','addApplications','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86d8,0x92));var _0x886d=function(_0x4275fc,_0x5e7a0f){_0x4275fc=_0x4275fc-0x0;var _0x410a85=_0x86d8[_0x4275fc];return _0x410a85;};'use strict';var multer=require(_0x886d('0x0'));var util=require('util');var path=require(_0x886d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x886d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x886d('0x3'));var config=require(_0x886d('0x4'));var controller=require(_0x886d('0x5'));router[_0x886d('0x6')]('/',auth[_0x886d('0x7')](),controller[_0x886d('0x8')]);router[_0x886d('0x6')]('/:id',auth[_0x886d('0x7')](),controller[_0x886d('0x9')]);router[_0x886d('0xa')]('/',auth[_0x886d('0x7')](),controller['create']);router['post'](_0x886d('0xb'),auth[_0x886d('0x7')](),controller[_0x886d('0xc')]);router[_0x886d('0xd')](_0x886d('0xe'),auth[_0x886d('0x7')](),controller['update']);router['delete'](_0x886d('0xe'),auth[_0x886d('0x7')](),controller[_0x886d('0xf')]);module['exports']=router; \ No newline at end of file +var _0x31f0=['util','path','Router','fs-extra','../../config/environment','./voiceExtension.controller','isAuthenticated','get','/:id','create','post','/:id/applications','addApplications','update','delete','destroy','exports','multer'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x31f0,0x179));var _0x031f=function(_0x41ae91,_0x3873b8){_0x41ae91=_0x41ae91-0x0;var _0x3b0fac=_0x31f0[_0x41ae91];return _0x3b0fac;};'use strict';var multer=require(_0x031f('0x0'));var util=require(_0x031f('0x1'));var path=require(_0x031f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x5'));var controller=require(_0x031f('0x6'));router['get']('/',auth[_0x031f('0x7')](),controller['index']);router[_0x031f('0x8')](_0x031f('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x031f('0x7')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth[_0x031f('0x7')](),controller[_0x031f('0xd')]);router['put'](_0x031f('0x9'),auth[_0x031f('0x7')](),controller[_0x031f('0xe')]);router[_0x031f('0xf')](_0x031f('0x9'),auth[_0x031f('0x7')](),controller[_0x031f('0x10')]);module[_0x031f('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 b904ffe..e65fbea 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 _0xe5a7=['BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER'];(function(_0x31e6e0,_0x3a0b2f){var _0x1c17cf=function(_0x78705a){while(--_0x78705a){_0x31e6e0['push'](_0x31e6e0['shift']());}};_0x1c17cf(++_0x3a0b2f);}(_0xe5a7,0x190));var _0x7e5a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe5a7[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x7e5a('0x0'));module[_0x7e5a('0x1')]={'context':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7e5a('0x3')},'priority':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':![],'defaultValue':_0x7e5a('0x4')},'appdata':{'type':Sequelize[_0x7e5a('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7e5a('0x5')](_0x7e5a('0x6'),_0x7e5a('0x7'),_0x7e5a('0x8'),_0x7e5a('0x9'),_0x7e5a('0xa'),_0x7e5a('0xb'),_0x7e5a('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x7e5a('0x2')]},'interval':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x7e5a('0xd')]},'isApp':{'type':Sequelize[_0x7e5a('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7e5a('0xd')]},'recordingFormat':{'type':Sequelize[_0x7e5a('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7e5a('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7e5a('0xf')],'get':function(_0x254556){return this[_0x7e5a('0x10')](_0x7e5a('0x11'));}},'alias':{'type':Sequelize[_0x7e5a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2087=['outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x3efe7a,_0x30aba7){var _0x121ad6=function(_0x1f0139){while(--_0x1f0139){_0x3efe7a['push'](_0x3efe7a['shift']());}};_0x121ad6(++_0x30aba7);}(_0x2087,0x10a));var _0x7208=function(_0x236ac8,_0xa798d6){_0x236ac8=_0x236ac8-0x0;var _0x1ff538=_0x2087[_0x236ac8];return _0x1ff538;};'use strict';var Sequelize=require(_0x7208('0x0'));module['exports']={'context':{'type':Sequelize[_0x7208('0x1')],'allowNull':![],'unique':_0x7208('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7208('0x2')},'priority':{'type':Sequelize[_0x7208('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x7208('0x2')},'tag':{'type':Sequelize[_0x7208('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7208('0x3')},'appdata':{'type':Sequelize[_0x7208('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7208('0x4')](_0x7208('0x5'),_0x7208('0x6'),'internal',_0x7208('0x7'),_0x7208('0x8'),_0x7208('0x9'),_0x7208('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x7208('0x1')]},'interval':{'type':Sequelize[_0x7208('0x1')],'allowNull':![],'defaultValue':_0x7208('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x7208('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7208('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x7208('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7208('0xd')]},'recordingFormat':{'type':Sequelize[_0x7208('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7208('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b6ff4){return this[_0x7208('0xe')](_0x7208('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f4897f1..c84ad79 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 _0xfbb0=['update','pick','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','VoiceExtensionId','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','create','startsWith','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2217f9,_0x50efa5){var _0x2430b3=function(_0x267fb7){while(--_0x267fb7){_0x2217f9['push'](_0x2217f9['shift']());}};_0x2430b3(++_0x50efa5);}(_0xfbb0,0x1d1));var _0x0fbb=function(_0x8a990d,_0x170e02){_0x8a990d=_0x8a990d-0x0;var _0x250b83=_0xfbb0[_0x8a990d];return _0x250b83;};'use strict';var _=require(_0x0fbb('0x0'));var Redis=require(_0x0fbb('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x0fbb('0x2'))(_0x0fbb('0x3'));var config=require(_0x0fbb('0x4'));var db=require(_0x0fbb('0x5'))['db'];config[_0x0fbb('0x6')]=_[_0x0fbb('0x7')](config[_0x0fbb('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0x0fbb('0x8')](socket);function respondWithStatusCode(_0x534a79,_0x297029){_0x297029=_0x297029||0xcc;return function(_0xead4d4){if(_0xead4d4){return _0x534a79[_0x0fbb('0x9')](_0x297029);}return _0x534a79[_0x0fbb('0xa')](_0x297029)[_0x0fbb('0xb')]();};}function respondWithResult(_0x1898c5,_0x154be2){_0x154be2=_0x154be2||0xc8;return function(_0x3a701a){if(_0x3a701a){return _0x1898c5[_0x0fbb('0xa')](_0x154be2)['json'](_0x3a701a);}};}function respondWithFilteredResult(_0x138a8e,_0x4bbf7b){return function(_0xc71049){if(_0xc71049){var _0x55464c=typeof _0x4bbf7b[_0x0fbb('0xc')]===_0x0fbb('0xd')&&typeof _0x4bbf7b[_0x0fbb('0xe')]==='undefined';var _0x23d7ec=_0xc71049[_0x0fbb('0xf')];var _0x100cff=_0x55464c?0x0:_0x4bbf7b[_0x0fbb('0xc')];var _0x43b95d=_0x55464c?_0xc71049[_0x0fbb('0xf')]:_0x4bbf7b[_0x0fbb('0xc')]+_0x4bbf7b[_0x0fbb('0xe')];var _0x430e56;if(_0x43b95d>=_0x23d7ec){_0x43b95d=_0x23d7ec;_0x430e56=0xc8;}else{_0x430e56=0xce;}_0x138a8e[_0x0fbb('0xa')](_0x430e56);return _0x138a8e[_0x0fbb('0x10')](_0x0fbb('0x11'),_0x100cff+'-'+_0x43b95d+'/'+_0x23d7ec)['json'](_0xc71049);}return null;};}function removeEntity(_0xf8b50e){return function(_0xc24b67){if(_0xc24b67){return _0xc24b67[_0x0fbb('0x12')]()['then'](function(){var _0x5dd46d=_0xc24b67['get']({'plain':!![]});var _0x3dec87=[{'name':_0x0fbb('0x13'),'value':_0x0fbb('0x14'),'ignore':![]},{'name':_0x0fbb('0x15'),'value':_0x0fbb('0x16'),'ignore':![]},{'name':_0x0fbb('0x17'),'value':_0x0fbb('0x18'),'ignore':![]}];var _0xf86e69=_(_0x3dec87)[_0x0fbb('0x19')](_0x0fbb('0x1a'))[_0x0fbb('0x1b')](_0x0fbb('0x1c'))[_0x0fbb('0x1c')]();if(_[_0x0fbb('0x1d')](_0xf86e69,_0x5dd46d[_0x0fbb('0x1e')])){return;}var _0x243828=_[_0x0fbb('0x1f')](_0x3dec87,['value',_0x5dd46d['type']])[_0x0fbb('0x20')];return db[_0x0fbb('0x21')][_0x0fbb('0x12')]({'where':{'type':_0x243828,'resourceId':_0x5dd46d['id']}})['then'](function(){return _0xc24b67;});})['then'](function(){_0xf8b50e[_0x0fbb('0xa')](0xcc)[_0x0fbb('0xb')]();});}};}function handleEntityNotFound(_0x53a781){return function(_0x283a2e){if(!_0x283a2e){_0x53a781['sendStatus'](0x194);}return _0x283a2e;};}function handleError(_0x26e7c5,_0x5a4015){_0x5a4015=_0x5a4015||0x1f4;return function(_0x294d64){logger[_0x0fbb('0x22')](_0x294d64[_0x0fbb('0x23')]);if(_0x294d64[_0x0fbb('0x20')]){delete _0x294d64['name'];}_0x26e7c5[_0x0fbb('0xa')](_0x5a4015)['send'](_0x294d64);};}exports[_0x0fbb('0x24')]=function(_0x4f353e,_0x42ce74){var _0x55f3f2={},_0x391b70={},_0x5e0baa={'count':0x0,'rows':[]};var _0x24b231=_[_0x0fbb('0x1b')](db[_0x0fbb('0x25')][_0x0fbb('0x26')],function(_0x518b38){return{'name':_0x518b38[_0x0fbb('0x27')],'type':_0x518b38[_0x0fbb('0x1e')][_0x0fbb('0x28')]};});_0x391b70['model']=_[_0x0fbb('0x1b')](_0x24b231,_0x0fbb('0x20'));_0x391b70[_0x0fbb('0x29')]=_[_0x0fbb('0x2a')](_0x4f353e['query']);_0x391b70[_0x0fbb('0x2b')]=_[_0x0fbb('0x2c')](_0x391b70['model'],_0x391b70[_0x0fbb('0x29')]);_0x55f3f2[_0x0fbb('0x2d')]=_[_0x0fbb('0x2c')](_0x391b70['model'],qs[_0x0fbb('0x2e')](_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0x2e')]));_0x55f3f2[_0x0fbb('0x2d')]=_0x55f3f2[_0x0fbb('0x2d')]['length']?_0x55f3f2[_0x0fbb('0x2d')]:_0x391b70[_0x0fbb('0x2f')];if(!_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0x30')](_0x0fbb('0x31'))){_0x55f3f2[_0x0fbb('0xe')]=qs[_0x0fbb('0xe')](_0x4f353e[_0x0fbb('0x29')]['limit']);_0x55f3f2[_0x0fbb('0xc')]=qs['offset'](_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0xc')]);}_0x55f3f2[_0x0fbb('0x32')]=qs[_0x0fbb('0x33')](_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0x33')]);_0x55f3f2[_0x0fbb('0x34')]=qs[_0x0fbb('0x2b')](_['pick'](_0x4f353e['query'],_0x391b70['filters']),_0x24b231);if(_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0x19')]){_0x55f3f2[_0x0fbb('0x34')]=_[_0x0fbb('0x35')](_0x55f3f2[_0x0fbb('0x34')],{'$or':_[_0x0fbb('0x1b')](_0x24b231,function(_0x543366){if(_0x543366[_0x0fbb('0x1e')]!==_0x0fbb('0x36')){var _0x4cdfca={};_0x4cdfca[_0x543366['name']]={'$like':'%'+_0x4f353e['query'][_0x0fbb('0x19')]+'%'};return _0x4cdfca;}})});}_0x55f3f2=_['merge']({},_0x55f3f2,_0x4f353e[_0x0fbb('0x37')]);var _0x2f9208={'where':_0x55f3f2[_0x0fbb('0x34')]};return db['VoiceExtension'][_0x0fbb('0xf')](_0x2f9208)[_0x0fbb('0x38')](function(_0x296c1c){_0x5e0baa[_0x0fbb('0xf')]=_0x296c1c;if(_0x4f353e[_0x0fbb('0x29')][_0x0fbb('0x39')]){_0x55f3f2[_0x0fbb('0x3a')]=[{'all':!![]}];}return db[_0x0fbb('0x25')][_0x0fbb('0x3b')](_0x55f3f2);})[_0x0fbb('0x38')](function(_0x795eb7){_0x5e0baa['rows']=_0x795eb7;return _0x5e0baa;})[_0x0fbb('0x38')](respondWithFilteredResult(_0x42ce74,_0x55f3f2))[_0x0fbb('0x3c')](handleError(_0x42ce74,null));};exports[_0x0fbb('0x3d')]=function(_0xe48f01,_0x522ba2){var _0x461932={'raw':![],'where':{'id':_0xe48f01[_0x0fbb('0x3e')]['id']}},_0x1210d7={};_0x1210d7['model']=_['keys'](db[_0x0fbb('0x25')]['rawAttributes']);_0x1210d7[_0x0fbb('0x29')]=_[_0x0fbb('0x2a')](_0xe48f01[_0x0fbb('0x29')]);_0x1210d7[_0x0fbb('0x2b')]=_[_0x0fbb('0x2c')](_0x1210d7[_0x0fbb('0x2f')],_0x1210d7[_0x0fbb('0x29')]);_0x461932[_0x0fbb('0x2d')]=_[_0x0fbb('0x2c')](_0x1210d7[_0x0fbb('0x2f')],qs['fields'](_0xe48f01[_0x0fbb('0x29')][_0x0fbb('0x2e')]));_0x461932['attributes']=_0x461932[_0x0fbb('0x2d')]['length']?_0x461932['attributes']:_0x1210d7[_0x0fbb('0x2f')];if(_0xe48f01[_0x0fbb('0x29')][_0x0fbb('0x39')]){_0x461932[_0x0fbb('0x3a')]=[{'all':!![]}];}_0x461932=_[_0x0fbb('0x35')]({},_0x461932,_0xe48f01[_0x0fbb('0x37')]);return db[_0x0fbb('0x25')][_0x0fbb('0x1f')](_0x461932)[_0x0fbb('0x38')](handleEntityNotFound(_0x522ba2,null))[_0x0fbb('0x38')](respondWithResult(_0x522ba2,null))[_0x0fbb('0x3c')](handleError(_0x522ba2,null));};exports[_0x0fbb('0x12')]=function(_0x12ddf0,_0x52810b){return db[_0x0fbb('0x25')][_0x0fbb('0x1f')]({'where':{'id':_0x12ddf0[_0x0fbb('0x3e')]['id']}})[_0x0fbb('0x38')](handleEntityNotFound(_0x52810b,null))[_0x0fbb('0x38')](removeEntity(_0x52810b,null))[_0x0fbb('0x3c')](handleError(_0x52810b,null));};exports[_0x0fbb('0x3f')]=function(_0x32c19a,_0x2ca5f2){if(_0x32c19a['body']['type']===_0x0fbb('0x16')&&!_[_0x0fbb('0x40')](_0x32c19a[_0x0fbb('0x41')][_0x0fbb('0x42')],'_')){_0x32c19a[_0x0fbb('0x41')]['exten']='_'[_0x0fbb('0x43')](_0x32c19a[_0x0fbb('0x41')]['exten']);}return db[_0x0fbb('0x25')][_0x0fbb('0x3f')](_0x32c19a[_0x0fbb('0x41')],{'raw':![]})[_0x0fbb('0x38')](function(_0x12df46){var _0x160125=_0x32c19a[_0x0fbb('0x44')][_0x0fbb('0x45')]({'plain':!![]});if(!_0x160125)throw new Error(_0x0fbb('0x46'));if(_0x160125[_0x0fbb('0x47')]===_0x0fbb('0x44')){var _0x2b943a=_0x12df46[_0x0fbb('0x45')]({'plain':!![]});var _0x16f908=[{'name':_0x0fbb('0x13'),'value':_0x0fbb('0x14')},{'name':'OutboundRoutes','value':_0x0fbb('0x16')},{'name':'InternalRoutes','value':'internal'}];var _0x45b77c=_[_0x0fbb('0x1f')](_0x16f908,[_0x0fbb('0x1c'),_0x2b943a[_0x0fbb('0x1e')]])[_0x0fbb('0x20')];return db['UserProfileSection'][_0x0fbb('0x1f')]({'where':{'name':_0x45b77c,'userProfileId':_0x160125[_0x0fbb('0x48')]},'raw':!![]})[_0x0fbb('0x38')](function(_0x3f70bc){if(_0x3f70bc&&_0x3f70bc[_0x0fbb('0x49')]===0x0){return db['UserProfileResource'][_0x0fbb('0x3f')]({'name':_0x2b943a[_0x0fbb('0x20')],'resourceId':_0x2b943a['id'],'type':_0x3f70bc[_0x0fbb('0x20')],'sectionId':_0x3f70bc['id']},{})['then'](function(){return _0x12df46;});}else{return _0x12df46;}})[_0x0fbb('0x3c')](function(_0x1e66a0){logger[_0x0fbb('0x22')](_0x0fbb('0x4a'),_0x1e66a0);throw _0x1e66a0;});}return _0x12df46;})['then'](respondWithResult(_0x2ca5f2,0xc9))[_0x0fbb('0x3c')](handleError(_0x2ca5f2,null));};exports[_0x0fbb('0x4b')]=function(_0xe50253,_0x59c314){if(_0xe50253[_0x0fbb('0x41')]['id']){delete _0xe50253[_0x0fbb('0x41')]['id'];}return db[_0x0fbb('0x25')][_0x0fbb('0x1f')]({'where':{'id':_0xe50253[_0x0fbb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59c314,null))[_0x0fbb('0x38')](function(_0x558d2f){if(_0x558d2f){return db[_0x0fbb('0x25')][_0x0fbb('0x4b')](_[_0x0fbb('0x4c')](_0xe50253['body'],['exten',_0x0fbb('0x4d'),_0x0fbb('0x4e'),_0x0fbb('0x4f'),'cutdigits',_0x0fbb('0x50'),_0x0fbb('0x51')]),{'where':{'context':_0x558d2f[_0x0fbb('0x4d')],'exten':_0x558d2f['exten']},'individualHooks':!![]})['then'](function(_0x2b1444){return _0x2b1444;});}return null;})[_0x0fbb('0x38')](respondWithStatusCode(_0x59c314,null))['catch'](handleError(_0x59c314,null));};exports[_0x0fbb('0x52')]=function(_0x57a1fe,_0x527f21){return db[_0x0fbb('0x25')]['findOne']({'where':{'id':_0x57a1fe[_0x0fbb('0x3e')]['id']}})[_0x0fbb('0x38')](function(_0x2cf33b){if(_0x2cf33b){return db[_0x0fbb('0x53')][_0x0fbb('0x54')](function(_0x3f005e){return db[_0x0fbb('0x25')][_0x0fbb('0x12')]({'where':{'VoiceExtensionId':_0x57a1fe[_0x0fbb('0x3e')]['id']},'transaction':_0x3f005e})[_0x0fbb('0x38')](function(){var _0x4cf54b=_[_0x0fbb('0x1b')](_0x57a1fe[_0x0fbb('0x41')],function(_0xe5f0dd){_0xe5f0dd[_0x0fbb('0x55')]=_0x57a1fe[_0x0fbb('0x3e')]['id'];_0xe5f0dd['isApp']=!![];return _0xe5f0dd;});return _0x2cf33b[_0x0fbb('0x56')](_0x4cf54b);})['then'](function(_0x35259c){console[_0x0fbb('0x57')](_0x0fbb('0x58'),_0x35259c);return db[_0x0fbb('0x25')][_0x0fbb('0x59')](_0x35259c,{'transaction':_0x3f005e});});})[_0x0fbb('0x38')](function(){return db[_0x0fbb('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x57a1fe[_0x0fbb('0x3e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x527f21,null))[_0x0fbb('0x3c')](handleError(_0x527f21,null));}; \ No newline at end of file +var _0xb910=['include','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','map','value','includes','type','find','error','stack','name','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show'];(function(_0x123371,_0x6afb0d){var _0x2aaccb=function(_0x12657f){while(--_0x12657f){_0x123371['push'](_0x123371['shift']());}};_0x2aaccb(++_0x6afb0d);}(_0xb910,0x12b));var _0x0b91=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb910[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x0b91('0x0'));var Redis=require(_0x0b91('0x1'));var qs=require(_0x0b91('0x2'));var logger=require(_0x0b91('0x3'))(_0x0b91('0x4'));var config=require(_0x0b91('0x5'));var db=require(_0x0b91('0x6'))['db'];config[_0x0b91('0x7')]=_[_0x0b91('0x8')](config[_0x0b91('0x7')],{'host':_0x0b91('0x9'),'port':0x18eb});var socket=require(_0x0b91('0xa'))(new Redis(config[_0x0b91('0x7')]));require(_0x0b91('0xb'))['register'](socket);function respondWithStatusCode(_0x156fd1,_0xc65d86){_0xc65d86=_0xc65d86||0xcc;return function(_0x3e8800){if(_0x3e8800){return _0x156fd1[_0x0b91('0xc')](_0xc65d86);}return _0x156fd1[_0x0b91('0xd')](_0xc65d86)[_0x0b91('0xe')]();};}function respondWithResult(_0x4118b8,_0x13b9b7){_0x13b9b7=_0x13b9b7||0xc8;return function(_0x42e3dc){if(_0x42e3dc){return _0x4118b8['status'](_0x13b9b7)[_0x0b91('0xf')](_0x42e3dc);}};}function respondWithFilteredResult(_0x547a8b,_0x322ff0){return function(_0x5eb743){if(_0x5eb743){var _0x4ee548=typeof _0x322ff0[_0x0b91('0x10')]===_0x0b91('0x11')&&typeof _0x322ff0[_0x0b91('0x12')]===_0x0b91('0x11');var _0x5b6f36=_0x5eb743[_0x0b91('0x13')];var _0x2577a1=_0x4ee548?0x0:_0x322ff0[_0x0b91('0x10')];var _0x2ec488=_0x4ee548?_0x5eb743['count']:_0x322ff0[_0x0b91('0x10')]+_0x322ff0[_0x0b91('0x12')];var _0x1932a9;if(_0x2ec488>=_0x5b6f36){_0x2ec488=_0x5b6f36;_0x1932a9=0xc8;}else{_0x1932a9=0xce;}_0x547a8b[_0x0b91('0xd')](_0x1932a9);return _0x547a8b[_0x0b91('0x14')](_0x0b91('0x15'),_0x2577a1+'-'+_0x2ec488+'/'+_0x5b6f36)['json'](_0x5eb743);}return null;};}function removeEntity(_0x83ffe1){return function(_0x25e66a){if(_0x25e66a){return _0x25e66a[_0x0b91('0x16')]()[_0x0b91('0x17')](function(){var _0x106ec8=_0x25e66a[_0x0b91('0x18')]({'plain':!![]});var _0x1101c3=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a'),'ignore':![]},{'name':_0x0b91('0x1b'),'value':_0x0b91('0x1c'),'ignore':![]},{'name':_0x0b91('0x1d'),'value':'internal','ignore':![]}];var _0x2df818=_(_0x1101c3)['filter']('ignore')[_0x0b91('0x1e')](_0x0b91('0x1f'))[_0x0b91('0x1f')]();if(_[_0x0b91('0x20')](_0x2df818,_0x106ec8[_0x0b91('0x21')])){return;}var _0x5369c0=_[_0x0b91('0x22')](_0x1101c3,[_0x0b91('0x1f'),_0x106ec8[_0x0b91('0x21')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5369c0,'resourceId':_0x106ec8['id']}})['then'](function(){return _0x25e66a;});})[_0x0b91('0x17')](function(){_0x83ffe1[_0x0b91('0xd')](0xcc)[_0x0b91('0xe')]();});}};}function handleEntityNotFound(_0x24b98f){return function(_0x26d2e7){if(!_0x26d2e7){_0x24b98f[_0x0b91('0xc')](0x194);}return _0x26d2e7;};}function handleError(_0x119748,_0x2071c0){_0x2071c0=_0x2071c0||0x1f4;return function(_0x231327){logger[_0x0b91('0x23')](_0x231327[_0x0b91('0x24')]);if(_0x231327[_0x0b91('0x25')]){delete _0x231327['name'];}_0x119748[_0x0b91('0xd')](_0x2071c0)['send'](_0x231327);};}exports['index']=function(_0x1ea590,_0x5b6811){var _0x120ae2={},_0x4afbd1={},_0xb8cebf={'count':0x0,'rows':[]};var _0x15755c=_['map'](db[_0x0b91('0x26')][_0x0b91('0x27')],function(_0x493c5e){return{'name':_0x493c5e['fieldName'],'type':_0x493c5e['type'][_0x0b91('0x28')]};});_0x4afbd1[_0x0b91('0x29')]=_[_0x0b91('0x1e')](_0x15755c,_0x0b91('0x25'));_0x4afbd1[_0x0b91('0x2a')]=_[_0x0b91('0x2b')](_0x1ea590[_0x0b91('0x2a')]);_0x4afbd1[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x4afbd1[_0x0b91('0x29')],_0x4afbd1[_0x0b91('0x2a')]);_0x120ae2['attributes']=_['intersection'](_0x4afbd1[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x2e')]));_0x120ae2[_0x0b91('0x2f')]=_0x120ae2[_0x0b91('0x2f')]['length']?_0x120ae2[_0x0b91('0x2f')]:_0x4afbd1[_0x0b91('0x29')];if(!_0x1ea590['query']['hasOwnProperty'](_0x0b91('0x30'))){_0x120ae2[_0x0b91('0x12')]=qs[_0x0b91('0x12')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x12')]);_0x120ae2['offset']=qs['offset'](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x10')]);}_0x120ae2[_0x0b91('0x31')]=qs[_0x0b91('0x32')](_0x1ea590[_0x0b91('0x2a')]['sort']);_0x120ae2[_0x0b91('0x33')]=qs['filters'](_[_0x0b91('0x34')](_0x1ea590['query'],_0x4afbd1['filters']),_0x15755c);if(_0x1ea590['query'][_0x0b91('0x35')]){_0x120ae2[_0x0b91('0x33')]=_[_0x0b91('0x36')](_0x120ae2['where'],{'$or':_[_0x0b91('0x1e')](_0x15755c,function(_0x17388a){if(_0x17388a[_0x0b91('0x21')]!==_0x0b91('0x37')){var _0x4cd9ac={};_0x4cd9ac[_0x17388a[_0x0b91('0x25')]]={'$like':'%'+_0x1ea590['query'][_0x0b91('0x35')]+'%'};return _0x4cd9ac;}})});}_0x120ae2=_[_0x0b91('0x36')]({},_0x120ae2,_0x1ea590[_0x0b91('0x38')]);var _0x44c2d8={'where':_0x120ae2[_0x0b91('0x33')]};return db['VoiceExtension'][_0x0b91('0x13')](_0x44c2d8)[_0x0b91('0x17')](function(_0x5a7277){_0xb8cebf['count']=_0x5a7277;if(_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x39')]){_0x120ae2['include']=[{'all':!![]}];}return db[_0x0b91('0x26')][_0x0b91('0x3a')](_0x120ae2);})[_0x0b91('0x17')](function(_0x5e1f06){_0xb8cebf['rows']=_0x5e1f06;return _0xb8cebf;})[_0x0b91('0x17')](respondWithFilteredResult(_0x5b6811,_0x120ae2))[_0x0b91('0x3b')](handleError(_0x5b6811,null));};exports[_0x0b91('0x3c')]=function(_0x256887,_0x43b8ee){var _0x18065f={'raw':![],'where':{'id':_0x256887['params']['id']}},_0x1166cc={};_0x1166cc[_0x0b91('0x29')]=_[_0x0b91('0x2b')](db[_0x0b91('0x26')][_0x0b91('0x27')]);_0x1166cc['query']=_[_0x0b91('0x2b')](_0x256887[_0x0b91('0x2a')]);_0x1166cc[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],_0x1166cc[_0x0b91('0x2a')]);_0x18065f['attributes']=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x256887[_0x0b91('0x2a')]['fields']));_0x18065f[_0x0b91('0x2f')]=_0x18065f[_0x0b91('0x2f')]['length']?_0x18065f[_0x0b91('0x2f')]:_0x1166cc[_0x0b91('0x29')];if(_0x256887[_0x0b91('0x2a')]['includeAll']){_0x18065f[_0x0b91('0x3d')]=[{'all':!![]}];}_0x18065f=_[_0x0b91('0x36')]({},_0x18065f,_0x256887[_0x0b91('0x38')]);return db[_0x0b91('0x26')][_0x0b91('0x22')](_0x18065f)[_0x0b91('0x17')](handleEntityNotFound(_0x43b8ee,null))[_0x0b91('0x17')](respondWithResult(_0x43b8ee,null))[_0x0b91('0x3b')](handleError(_0x43b8ee,null));};exports[_0x0b91('0x16')]=function(_0x1a1f74,_0x2fa952){return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x1a1f74[_0x0b91('0x3e')]['id']}})[_0x0b91('0x17')](handleEntityNotFound(_0x2fa952,null))['then'](removeEntity(_0x2fa952,null))[_0x0b91('0x3b')](handleError(_0x2fa952,null));};exports[_0x0b91('0x3f')]=function(_0x2ea30f,_0x78e4db){if(_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x21')]===_0x0b91('0x1c')&&!_[_0x0b91('0x41')](_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')],'_')){_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')]='_'[_0x0b91('0x43')](_0x2ea30f['body']['exten']);}return db[_0x0b91('0x26')][_0x0b91('0x3f')](_0x2ea30f[_0x0b91('0x40')],{'raw':![]})['then'](function(_0x5c3cd7){var _0x1a367b=_0x2ea30f[_0x0b91('0x44')][_0x0b91('0x18')]({'plain':!![]});if(!_0x1a367b)throw new Error(_0x0b91('0x45'));if(_0x1a367b[_0x0b91('0x46')]===_0x0b91('0x44')){var _0x30b94a=_0x5c3cd7['get']({'plain':!![]});var _0x384266=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a')},{'name':_0x0b91('0x1b'),'value':'outbound'},{'name':_0x0b91('0x1d'),'value':_0x0b91('0x47')}];var _0x4f08c5=_[_0x0b91('0x22')](_0x384266,[_0x0b91('0x1f'),_0x30b94a[_0x0b91('0x21')]])[_0x0b91('0x25')];return db['UserProfileSection']['find']({'where':{'name':_0x4f08c5,'userProfileId':_0x1a367b[_0x0b91('0x48')]},'raw':!![]})[_0x0b91('0x17')](function(_0x1bfc77){if(_0x1bfc77&&_0x1bfc77[_0x0b91('0x49')]===0x0){return db[_0x0b91('0x4a')][_0x0b91('0x3f')]({'name':_0x30b94a['name'],'resourceId':_0x30b94a['id'],'type':_0x1bfc77[_0x0b91('0x25')],'sectionId':_0x1bfc77['id']},{})[_0x0b91('0x17')](function(){return _0x5c3cd7;});}else{return _0x5c3cd7;}})[_0x0b91('0x3b')](function(_0x55a664){logger[_0x0b91('0x23')](_0x0b91('0x4b'),_0x55a664);throw _0x55a664;});}return _0x5c3cd7;})[_0x0b91('0x17')](respondWithResult(_0x78e4db,0xc9))['catch'](handleError(_0x78e4db,null));};exports[_0x0b91('0x4c')]=function(_0x3229d7,_0x2b2263){if(_0x3229d7[_0x0b91('0x40')]['id']){delete _0x3229d7['body']['id'];}return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x3229d7[_0x0b91('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b2263,null))['then'](function(_0x3d5ad0){if(_0x3d5ad0){return db[_0x0b91('0x26')][_0x0b91('0x4c')](_[_0x0b91('0x34')](_0x3229d7[_0x0b91('0x40')],[_0x0b91('0x42'),'context','description',_0x0b91('0x4d'),'cutdigits',_0x0b91('0x4e'),_0x0b91('0x4f')]),{'where':{'context':_0x3d5ad0['context'],'exten':_0x3d5ad0[_0x0b91('0x42')]},'individualHooks':!![]})[_0x0b91('0x17')](function(_0x4460e6){return _0x4460e6;});}return null;})[_0x0b91('0x17')](respondWithStatusCode(_0x2b2263,null))['catch'](handleError(_0x2b2263,null));};exports[_0x0b91('0x50')]=function(_0x2f9d1b,_0x2eb38a){return db[_0x0b91('0x26')][_0x0b91('0x51')]({'where':{'id':_0x2f9d1b['params']['id']}})[_0x0b91('0x17')](function(_0x39fd3d){if(_0x39fd3d){return db[_0x0b91('0x52')][_0x0b91('0x53')](function(_0x5397df){return db['VoiceExtension'][_0x0b91('0x16')]({'where':{'VoiceExtensionId':_0x2f9d1b['params']['id']},'transaction':_0x5397df})['then'](function(){var _0x39689c=_['map'](_0x2f9d1b[_0x0b91('0x40')],function(_0x3071de){_0x3071de[_0x0b91('0x54')]=_0x2f9d1b['params']['id'];_0x3071de[_0x0b91('0x55')]=!![];return _0x3071de;});return _0x39fd3d[_0x0b91('0x56')](_0x39689c);})['then'](function(_0x224a90){console['log'](_0x0b91('0x57'),_0x224a90);return db[_0x0b91('0x26')][_0x0b91('0x58')](_0x224a90,{'transaction':_0x5397df});});})[_0x0b91('0x17')](function(){return db[_0x0b91('0x26')][_0x0b91('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f9d1b[_0x0b91('0x3e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x0b91('0x17')](respondWithResult(_0x2eb38a,null))['catch'](handleError(_0x2eb38a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 23922c9..98dd98d 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 _0xda08=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x3feb29,_0x24dae6){var _0x54699c=function(_0x22dca8){while(--_0x22dca8){_0x3feb29['push'](_0x3feb29['shift']());}};_0x54699c(++_0x24dae6);}(_0xda08,0xc6));var _0x8da0=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xda08[_0x45783c];return _0x1161da;};'use strict';var EventEmitter=require(_0x8da0('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8da0('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8da0('0x2')](0x0);var events={'afterCreate':_0x8da0('0x3'),'afterUpdate':_0x8da0('0x4'),'afterDestroy':_0x8da0('0x5')};function emitEvent(_0x2f5dac){return function(_0x326b4a,_0x2728a1,_0x37d22a){VoiceExtensionEvents['emit'](_0x2f5dac+':'+_0x326b4a['id'],_0x326b4a);VoiceExtensionEvents[_0x8da0('0x6')](_0x2f5dac,_0x326b4a);_0x37d22a(null);};}for(var e in events){if(events[_0x8da0('0x7')](e)){var event=events[e];VoiceExtension[_0x8da0('0x8')](e,emitEvent(event));}}module[_0x8da0('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x305b=['exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hook'];(function(_0x189058,_0x4a0313){var _0x1e6b64=function(_0x23aed7){while(--_0x23aed7){_0x189058['push'](_0x189058['shift']());}};_0x1e6b64(++_0x4a0313);}(_0x305b,0x1ba));var _0xb305=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0x305b[_0x3a3b9e];return _0x148103;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xb305('0x0'))['db'][_0xb305('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb305('0x2')](0x0);var events={'afterCreate':_0xb305('0x3'),'afterUpdate':_0xb305('0x4'),'afterDestroy':_0xb305('0x5')};function emitEvent(_0x518774){return function(_0x345665,_0x1964bc,_0x365466){VoiceExtensionEvents[_0xb305('0x6')](_0x518774+':'+_0x345665['id'],_0x345665);VoiceExtensionEvents['emit'](_0x518774,_0x345665);_0x365466(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xb305('0x7')](e,emitEvent(event));}}module[_0xb305('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 5af5fb6..5039b0a 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 _0x8569=['toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','playback','includes','app','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime','appType','outboundDial','appdata','priority','last','catch','define','voice_extensions','get','Hangup','exports','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','url','param','split','phone','prefix','${EXTEN:','${EXTEN}','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map'];(function(_0x3b095e,_0x5add27){var _0x3e2508=function(_0x5a4562){while(--_0x5a4562){_0x3b095e['push'](_0x3b095e['shift']());}};_0x3e2508(++_0x5add27);}(_0x8569,0x14d));var _0x9856=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x8569[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x9856('0x0')]=function(_0x11bdd7){var _0x35960d=_0x11bdd7['models'];function _0x3b2601(_0x2025b0){var _0x4ae486=0x2;var _0x172fbc=[{'type':_0x2025b0[_0x9856('0x1')],'app':_0x9856('0x2'),'appdata':_0x9856('0x3')+_0x2025b0[_0x9856('0x1')],'context':_0x2025b0[_0x9856('0x4')],'exten':_0x2025b0[_0x9856('0x5')],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']},{'type':_0x2025b0[_0x9856('0x1')],'app':_0x2025b0[_0x9856('0x6')]?_0x9856('0x2'):_0x9856('0x7'),'appdata':_0x2025b0[_0x9856('0x6')]?_0x9856('0x8')+_0x2025b0[_0x9856('0x6')]:_0x9856('0x9'),'context':_0x2025b0[_0x9856('0x4')],'exten':_0x2025b0[_0x9856('0x5')],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']}];if(_0x2025b0[_0x9856('0x1')]==='inbound'){_0x172fbc['push']({'type':_0x9856('0xa'),'app':_0x9856('0x2'),'appdata':_0x9856('0xb')+_0x2025b0['id'],'context':_0x2025b0['context'],'exten':_0x2025b0[_0x9856('0x5')],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']});}_0x172fbc[_0x9856('0xc')]({'type':_0x2025b0[_0x9856('0x1')],'app':_0x9856('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2025b0[_0x9856('0x4')],'exten':_0x2025b0['exten'],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']},{'type':_0x2025b0['type'],'app':'Set','appdata':_0x9856('0xd'),'context':_0x2025b0['context'],'exten':_0x2025b0[_0x9856('0x5')],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']},{'type':_0x2025b0[_0x9856('0x1')],'app':_0x9856('0x2'),'appdata':_0x9856('0xe'),'context':_0x2025b0[_0x9856('0x4')],'exten':_0x2025b0['exten'],'priority':_0x4ae486++,'VoiceExtensionId':_0x2025b0['id']});return _0x172fbc;}function _0x401f85(_0x16ba09){var _0x4d15fb=0x2;var _0x3f31c7=[{'type':_0x9856('0xf'),'app':_0x9856('0x2'),'appdata':_0x9856('0x10'),'context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09['exten'],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':_0x16ba09[_0x9856('0x6')]?'Set':_0x9856('0x7'),'appdata':_0x16ba09[_0x9856('0x6')]?_0x9856('0x8')+_0x16ba09[_0x9856('0x6')]:'No\x20alias\x20set','context':_0x16ba09['context'],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':_0x9856('0x2'),'appdata':_0x9856('0x11')+(_0x16ba09[_0x9856('0x12')]?'${EXTEN:'+_0x16ba09['cutdigits']+'}':'${EXTEN}'),'context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09['exten'],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':'Set','appdata':_0x9856('0xb')+_0x16ba09['id'],'context':_0x16ba09['context'],'exten':_0x16ba09['exten'],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':_0x9856('0x13'),'appdata':_0x9856('0x14')+(_0x4d15fb+0x2)+'):Goto('+(_0x4d15fb+0x1)+')','context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09['exten'],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':'outbound','app':'Set','appdata':_0x16ba09[_0x9856('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x16ba09[_0x9856('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x16ba09['context'],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':_0x9856('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09['exten'],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':_0x9856('0x2'),'appdata':_0x9856('0xd'),'context':_0x16ba09['context'],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':'Set','appdata':_0x9856('0xe'),'context':_0x16ba09['context'],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':_0x9856('0xf'),'app':'Set','appdata':_0x9856('0x15')+_0x16ba09['id'],'context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']}];if(_0x16ba09[_0x9856('0x16')](_0x9856('0x17'))&&_0x16ba09['recordingFormat']!=='none'){_0x3f31c7[_0x9856('0xc')]({'type':_0x9856('0xf'),'app':_0x9856('0x2'),'appdata':_0x9856('0x18'),'context':_0x16ba09['context'],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']},{'type':'outbound','app':_0x9856('0x2'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x16ba09[_0x9856('0x17')]||_0x9856('0x19'),'context':_0x16ba09[_0x9856('0x4')],'exten':_0x16ba09[_0x9856('0x5')],'priority':_0x4d15fb++,'VoiceExtensionId':_0x16ba09['id']});}return _0x3f31c7;}function _0x55014c(_0xca92d8,_0x42b57d){var _0x2582ec=[{'name':_0x9856('0x1a'),'param':0x0},{'name':_0x9856('0x1b'),'param':0x1},{'name':'options','param':0x2},{'name':_0x9856('0x1c'),'param':0x3}];var _0xb1ffeb={};var _0x304a21=_0x42b57d['split'](',');var _0x3697ce=[];for(var _0x271bbc=0x0;_0x271bbc<_0x2582ec['length'];_0x271bbc++){switch(_0x2582ec[_0x271bbc]['name']){case _0x9856('0x1a'):_0xb1ffeb[_0x9856('0x1a')]=_0x304a21[_0x2582ec[_0x271bbc][_0x9856('0x1d')]][_0x9856('0x1e')]('/')[0x1];_0xb1ffeb['phone']=_0x304a21[_0x2582ec[_0x271bbc][_0x9856('0x1d')]][_0x9856('0x1e')]('/')[0x2];_0xb1ffeb['prefix']=_0xb1ffeb[_0x9856('0x1f')]?_0xb1ffeb[_0x9856('0x1f')][_0x9856('0x1e')]('$')[0x0]:undefined;_0xb1ffeb['phone']=_0xca92d8['cutdigits']?(_0xb1ffeb[_0x9856('0x20')]||'')+_0x9856('0x21')+_0xca92d8[_0x9856('0x12')]+'}':(_0xb1ffeb[_0x9856('0x20')]||'')+_0x9856('0x22');_0x3697ce[_0x2582ec[_0x271bbc]['param']]=[_0x9856('0x23'),_0xb1ffeb[_0x9856('0x1a')],_0xb1ffeb[_0x9856('0x1f')]][_0x9856('0x24')]('/');break;case'options':_0xb1ffeb[_0x9856('0x25')]=_0x304a21[_0x2582ec[_0x271bbc][_0x9856('0x1d')]];if(_0xca92d8[_0x9856('0x17')]!==_0x9856('0x26')){if(_0xb1ffeb[_0x9856('0x25')][_0x9856('0x27')](_0x9856('0x28'))<0x0){_0xb1ffeb['options']+=_0x9856('0x28');}}else{_0xb1ffeb['options']=_0xb1ffeb['options'][_0x9856('0x29')](_0x9856('0x28'),'');}_0x3697ce[_0x2582ec[_0x271bbc][_0x9856('0x1d')]]=_0xb1ffeb['options'];break;default:_0x3697ce[_0x2582ec[_0x271bbc][_0x9856('0x1d')]]=_0x304a21[_0x2582ec[_0x271bbc]['param']];}}return _0x3697ce[_0x9856('0x24')](',');}function _0x24fd1b(_0x269d8b,_0x5dd416,_0x3f8554){return new Promise(function(_0x185473,_0x101ca7){var _0xd6dce9=[];if(_[_0x9856('0x2a')](_0x5dd416))return _0x185473(_0xd6dce9);_0x35960d[_0x9856('0x2b')][_0x9856('0x2c')]({'attributes':['id',_0x9856('0x2d'),_0x9856('0x2e')],'raw':!![]})[_0x9856('0x2f')](function(_0x7a86a4){for(var _0x35b3c3=0x0,_0x4e95c2=0x0;_0x35b3c3<_0x5dd416[_0x9856('0x30')];_0x35b3c3++,_0x4e95c2=0x0){var _0xc51c1c=_0x5dd416[_0x35b3c3];var _0x304ce3=[];var _0x204a54=[];delete _0xc51c1c['id'];if(_0xc51c1c[_0x9856('0x2d')]!==_0x9856('0x31')){_0xc51c1c[_0x9856('0x32')]=[_0xc51c1c[_0x9856('0x2d')]];}else{_0xc51c1c['intervals']=_0xc51c1c[_0x9856('0x2e')]?_[_0x9856('0x33')](_['filter'](_0x7a86a4,{'IntervalId':_0xc51c1c[_0x9856('0x2e')]}),'interval'):[];}_0xc51c1c[_0x9856('0x4')]=_0x269d8b[_0x9856('0x4')];_0xc51c1c['exten']=_0x269d8b[_0x9856('0x5')];if(_0xc51c1c[_0x9856('0x1')])_0xc51c1c[_0x9856('0x1')]=_0xc51c1c['type'][_0x9856('0x34')]();if(_0x269d8b[_0x9856('0x1')]===_0x9856('0xf')){if(_0xc51c1c['hasOwnProperty']('tag')&&_0xc51c1c[_0x9856('0x35')]&&_0xc51c1c['tag']!=='--'){_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c[_0x9856('0x1')][_0x9856('0x34')](),'app':_0x9856('0x2'),'appdata':_0x9856('0x36')+_0xc51c1c[_0x9856('0x35')],'context':_0x269d8b[_0x9856('0x4')],'exten':_0x269d8b['exten'],'priority':_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')]+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});}_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c[_0x9856('0x1')][_0x9856('0x34')](),'app':_0x9856('0x13'),'appdata':_0x9856('0x37')+(_0xc51c1c['callerID']?_0x9856('0x38')+_0xc51c1c['callerID']+')':_0x9856('0x39')),'context':_0x269d8b['context'],'exten':_0x269d8b['exten'],'priority':_0xc51c1c[_0x9856('0x32')]['length']+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});}else{if(_0xc51c1c[_0x9856('0x16')]('answer')){if(['queue',_0x9856('0x3a')][_0x9856('0x3b')](_0xc51c1c[_0x9856('0x3c')]['toLowerCase']())&&_0xc51c1c['appType']!=='custom'){if(_0xc51c1c[_0x9856('0x3d')]){_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c[_0x9856('0x1')]['toLowerCase'](),'app':_0x9856('0x13'),'appdata':_0x9856('0x3e'),'context':_0x269d8b['context'],'exten':_0x269d8b['exten'],'priority':_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')]+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c[_0x9856('0x1')]['toLowerCase'](),'app':_0x9856('0x2'),'appdata':_0x9856('0x3f'),'context':_0x269d8b[_0x9856('0x4')],'exten':_0x269d8b[_0x9856('0x5')],'priority':_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')]+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});}else{_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c['type'][_0x9856('0x34')](),'app':_0x9856('0x13'),'appdata':_0x9856('0x40'),'context':_0x269d8b[_0x9856('0x4')],'exten':_0x269d8b[_0x9856('0x5')],'priority':_0xc51c1c['intervals'][_0x9856('0x30')]+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});_0x304ce3[_0x9856('0xc')]({'type':_0xc51c1c[_0x9856('0x1')]['toLowerCase'](),'app':'Set','appdata':_0x9856('0x41'),'context':_0x269d8b['context'],'exten':_0x269d8b['exten'],'priority':_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')]+_0x3f8554+_0x4e95c2++,'VoiceExtensionId':_0x269d8b['id']});}}}}for(var _0x559928=0x0;_0x559928<_0xc51c1c[_0x9856('0x32')]['length'];_0x559928++){var _0xa7ba58=_0x3f8554+_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')];var _0x165bc6=_0x559928===_0xc51c1c[_0x9856('0x32')][_0x9856('0x30')]-0x1?_0x3f8554+_0x304ce3[_0x9856('0x30')]+_0x204a54[_0x9856('0x30')]+0x2:_0x3f8554+_0x559928+0x1;_0x304ce3['splice'](_0x559928,0x0,{'type':_0x269d8b[_0x9856('0x1')],'app':_0x9856('0x42'),'appdata':_0xc51c1c['intervals'][_0x559928]+'?'+_0x269d8b[_0x9856('0x4')]+',${EXTEN},'+_0xa7ba58+':'+_0x269d8b[_0x9856('0x4')]+',${EXTEN},'+_0x165bc6,'exten':_0x269d8b[_0x9856('0x5')],'context':_0x269d8b[_0x9856('0x4')],'priority':_0x3f8554+_0x559928,'VoiceExtensionId':_0x269d8b['id']});}if(_0xc51c1c[_0x9856('0x43')]===_0x9856('0x44'))_0xc51c1c[_0x9856('0x45')]=_0x55014c(_0x269d8b,_0xc51c1c[_0x9856('0x45')]);_0xc51c1c[_0x9856('0x46')]=_0x304ce3['length']?_[_0x9856('0x47')](_0x304ce3)[_0x9856('0x46')]+0x1:_0x3f8554;_0xd6dce9=_['concat'](_0xd6dce9,_0x304ce3,[_0xc51c1c],_0x204a54);_0x3f8554=_['last'](_0xd6dce9)[_0x9856('0x46')]+0x1;}return _0x185473(_0xd6dce9);})[_0x9856('0x48')](function(_0x217905){_0x101ca7(_0x217905);});});}return _0x11bdd7[_0x9856('0x49')]('VoiceExtension',attributes,{'tableName':_0x9856('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2157ec){var _0x252f35=this[_0x9856('0x4b')]({'plain':!![]});var _0x421dfd=_0x252f35['type']==='outbound'?_0x401f85(_0x252f35):_0x3b2601(_0x252f35);return _0x24fd1b(_0x252f35,_0x2157ec,_['last'](_0x421dfd)[_0x9856('0x46')]+0x1)[_0x9856('0x2f')](function(_0x2b08bf){var _0x48e715=_['concat'](_0x421dfd,_0x2b08bf);_0x48e715['push']({'type':_0x252f35[_0x9856('0x1')],'app':_0x9856('0x4c'),'exten':_0x252f35[_0x9856('0x5')],'context':_0x252f35['context'],'priority':_[_0x9856('0x47')](_0x48e715)[_0x9856('0x46')]+0x1,'VoiceExtensionId':_0x252f35['id']});return _0x48e715;});}}});}; \ No newline at end of file +var _0x43fd=['./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url','length','name','param','phone','split','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get'];(function(_0x559819,_0x4123f4){var _0x215be9=function(_0x2d4cab){while(--_0x2d4cab){_0x559819['push'](_0x559819['shift']());}};_0x215be9(++_0x4123f4);}(_0x43fd,0x1ec));var _0xd43f=function(_0x2d473c,_0x6e4368){_0x2d473c=_0x2d473c-0x0;var _0x2c272c=_0x43fd[_0x2d473c];return _0x2c272c;};'use strict';var _=require('lodash');var attributes=require(_0xd43f('0x0'));module['exports']=function(_0x4ec617){var _0x316ee5=_0x4ec617[_0xd43f('0x1')];function _0x484615(_0x3df2bd){var _0x48f953=0x2;var _0x3c2af1=[{'type':_0x3df2bd[_0xd43f('0x2')],'app':_0xd43f('0x3'),'appdata':_0xd43f('0x4')+_0x3df2bd['type'],'context':_0x3df2bd[_0xd43f('0x5')],'exten':_0x3df2bd[_0xd43f('0x6')],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']},{'type':_0x3df2bd[_0xd43f('0x2')],'app':_0x3df2bd[_0xd43f('0x7')]?'Set':_0xd43f('0x8'),'appdata':_0x3df2bd[_0xd43f('0x7')]?'CDR(routeAlias)='+_0x3df2bd[_0xd43f('0x7')]:_0xd43f('0x9'),'context':_0x3df2bd[_0xd43f('0x5')],'exten':_0x3df2bd[_0xd43f('0x6')],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']}];if(_0x3df2bd[_0xd43f('0x2')]==='inbound'){_0x3c2af1[_0xd43f('0xa')]({'type':_0xd43f('0xb'),'app':_0xd43f('0x3'),'appdata':_0xd43f('0xc')+_0x3df2bd['id'],'context':_0x3df2bd[_0xd43f('0x5')],'exten':_0x3df2bd[_0xd43f('0x6')],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']});}_0x3c2af1[_0xd43f('0xa')]({'type':_0x3df2bd[_0xd43f('0x2')],'app':_0xd43f('0x3'),'appdata':_0xd43f('0xd'),'context':_0x3df2bd[_0xd43f('0x5')],'exten':_0x3df2bd['exten'],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']},{'type':_0x3df2bd[_0xd43f('0x2')],'app':_0xd43f('0x3'),'appdata':_0xd43f('0xe'),'context':_0x3df2bd['context'],'exten':_0x3df2bd['exten'],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']},{'type':_0x3df2bd['type'],'app':_0xd43f('0x3'),'appdata':_0xd43f('0xf'),'context':_0x3df2bd['context'],'exten':_0x3df2bd[_0xd43f('0x6')],'priority':_0x48f953++,'VoiceExtensionId':_0x3df2bd['id']});return _0x3c2af1;}function _0x3647df(_0x57635e){var _0x5ced70=0x2;var _0x4fd639=[{'type':'outbound','app':_0xd43f('0x3'),'appdata':_0xd43f('0x10'),'context':_0x57635e['context'],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0x57635e[_0xd43f('0x7')]?_0xd43f('0x3'):'NoOp','appdata':_0x57635e[_0xd43f('0x7')]?_0xd43f('0x12')+_0x57635e[_0xd43f('0x7')]:'No\x20alias\x20set','context':_0x57635e['context'],'exten':_0x57635e['exten'],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x3'),'appdata':_0xd43f('0x13')+(_0x57635e[_0xd43f('0x14')]?_0xd43f('0x15')+_0x57635e[_0xd43f('0x14')]+'}':_0xd43f('0x16')),'context':_0x57635e['context'],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':'outbound','app':_0xd43f('0x3'),'appdata':'CDR(routeid)='+_0x57635e['id'],'context':_0x57635e['context'],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x17'),'appdata':_0xd43f('0x18')+(_0x5ced70+0x2)+_0xd43f('0x19')+(_0x5ced70+0x1)+')','context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x3'),'appdata':_0x57635e['cutdigits']?_0xd43f('0x1a')+_0x57635e[_0xd43f('0x14')]+'}':_0xd43f('0x1b'),'context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':'outbound','app':_0xd43f('0x3'),'appdata':_0xd43f('0xd'),'context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':'outbound','app':_0xd43f('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x57635e['context'],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x3'),'appdata':'outboundrouteid='+_0x57635e['id'],'context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']}];if(_0x57635e['hasOwnProperty']('recordingFormat')&&_0x57635e[_0xd43f('0x1c')]!==_0xd43f('0x1d')){_0x4fd639[_0xd43f('0xa')]({'type':_0xd43f('0x11'),'app':'Set','appdata':_0xd43f('0x1e'),'context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e[_0xd43f('0x6')],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']},{'type':_0xd43f('0x11'),'app':_0xd43f('0x3'),'appdata':_0xd43f('0x1f')+_0x57635e[_0xd43f('0x1c')]||'wav','context':_0x57635e[_0xd43f('0x5')],'exten':_0x57635e['exten'],'priority':_0x5ced70++,'VoiceExtensionId':_0x57635e['id']});}return _0x4fd639;}function _0xd75865(_0x645677,_0x2d91fc){var _0x51b765=[{'name':_0xd43f('0x20'),'param':0x0},{'name':_0xd43f('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0xd43f('0x22'),'param':0x3}];var _0x203072={};var _0x16c1f6=_0x2d91fc['split'](',');var _0x291f05=[];for(var _0x13f996=0x0;_0x13f996<_0x51b765[_0xd43f('0x23')];_0x13f996++){switch(_0x51b765[_0x13f996][_0xd43f('0x24')]){case _0xd43f('0x20'):_0x203072['trunk']=_0x16c1f6[_0x51b765[_0x13f996][_0xd43f('0x25')]]['split']('/')[0x1];_0x203072[_0xd43f('0x26')]=_0x16c1f6[_0x51b765[_0x13f996][_0xd43f('0x25')]][_0xd43f('0x27')]('/')[0x2];_0x203072['prefix']=_0x203072[_0xd43f('0x26')]?_0x203072[_0xd43f('0x26')]['split']('$')[0x0]:undefined;_0x203072[_0xd43f('0x26')]=_0x645677['cutdigits']?(_0x203072['prefix']||'')+_0xd43f('0x15')+_0x645677['cutdigits']+'}':(_0x203072['prefix']||'')+_0xd43f('0x16');_0x291f05[_0x51b765[_0x13f996]['param']]=['SIP',_0x203072[_0xd43f('0x20')],_0x203072[_0xd43f('0x26')]][_0xd43f('0x28')]('/');break;case _0xd43f('0x29'):_0x203072[_0xd43f('0x29')]=_0x16c1f6[_0x51b765[_0x13f996]['param']];if(_0x645677[_0xd43f('0x1c')]!==_0xd43f('0x1d')){if(_0x203072[_0xd43f('0x29')][_0xd43f('0x2a')](_0xd43f('0x2b'))<0x0){_0x203072[_0xd43f('0x29')]+=_0xd43f('0x2b');}}else{_0x203072[_0xd43f('0x29')]=_0x203072[_0xd43f('0x29')][_0xd43f('0x2c')](_0xd43f('0x2b'),'');}_0x291f05[_0x51b765[_0x13f996]['param']]=_0x203072[_0xd43f('0x29')];break;default:_0x291f05[_0x51b765[_0x13f996][_0xd43f('0x25')]]=_0x16c1f6[_0x51b765[_0x13f996]['param']];}}return _0x291f05['join'](',');}function _0x3fe872(_0x45bd76,_0x3af715,_0x5992f6){return new Promise(function(_0x2acf3b,_0x1f327f){var _0x24155c=[];if(_[_0xd43f('0x2d')](_0x3af715))return _0x2acf3b(_0x24155c);_0x316ee5['Interval']['findAll']({'attributes':['id',_0xd43f('0x2e'),_0xd43f('0x2f')],'raw':!![]})[_0xd43f('0x30')](function(_0x536da8){for(var _0x59143=0x0,_0x710b1e=0x0;_0x59143<_0x3af715[_0xd43f('0x23')];_0x59143++,_0x710b1e=0x0){var _0x425628=_0x3af715[_0x59143];var _0x33a644=[];var _0xc2a5a6=[];delete _0x425628['id'];if(_0x425628[_0xd43f('0x2e')]!==_0xd43f('0x31')){_0x425628['intervals']=[_0x425628[_0xd43f('0x2e')]];}else{_0x425628[_0xd43f('0x32')]=_0x425628[_0xd43f('0x2f')]?_[_0xd43f('0x33')](_[_0xd43f('0x34')](_0x536da8,{'IntervalId':_0x425628[_0xd43f('0x2f')]}),_0xd43f('0x2e')):[];}_0x425628[_0xd43f('0x5')]=_0x45bd76[_0xd43f('0x5')];_0x425628[_0xd43f('0x6')]=_0x45bd76[_0xd43f('0x6')];if(_0x425628['type'])_0x425628[_0xd43f('0x2')]=_0x425628[_0xd43f('0x2')][_0xd43f('0x35')]();if(_0x45bd76[_0xd43f('0x2')]===_0xd43f('0x11')){if(_0x425628[_0xd43f('0x36')]('tag')&&_0x425628[_0xd43f('0x37')]&&_0x425628['tag']!=='--'){_0x33a644[_0xd43f('0xa')]({'type':_0x425628['type'][_0xd43f('0x35')](),'app':_0xd43f('0x3'),'appdata':_0xd43f('0x38')+_0x425628[_0xd43f('0x37')],'context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76[_0xd43f('0x6')],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});}_0x33a644[_0xd43f('0xa')]({'type':_0x425628['type'][_0xd43f('0x35')](),'app':_0xd43f('0x17'),'appdata':_0xd43f('0x39')+(_0x425628[_0xd43f('0x3a')]?_0xd43f('0x3b')+_0x425628[_0xd43f('0x3a')]+')':_0xd43f('0x3c')),'context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76[_0xd43f('0x6')],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});}else{if(_0x425628['hasOwnProperty']('answer')){if([_0xd43f('0x3d'),_0xd43f('0x3e')][_0xd43f('0x3f')](_0x425628['app']['toLowerCase']())&&_0x425628[_0xd43f('0x40')]!==_0xd43f('0x41')){if(_0x425628[_0xd43f('0x42')]){_0x33a644[_0xd43f('0xa')]({'type':_0x425628[_0xd43f('0x2')]['toLowerCase'](),'app':_0xd43f('0x17'),'appdata':_0xd43f('0x43'),'context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76[_0xd43f('0x6')],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});_0x33a644['push']({'type':_0x425628[_0xd43f('0x2')][_0xd43f('0x35')](),'app':_0xd43f('0x3'),'appdata':_0xd43f('0x44'),'context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76[_0xd43f('0x6')],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});}else{_0x33a644['push']({'type':_0x425628[_0xd43f('0x2')][_0xd43f('0x35')](),'app':_0xd43f('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76[_0xd43f('0x6')],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});_0x33a644[_0xd43f('0xa')]({'type':_0x425628[_0xd43f('0x2')][_0xd43f('0x35')](),'app':_0xd43f('0x3'),'appdata':_0xd43f('0x45'),'context':_0x45bd76[_0xd43f('0x5')],'exten':_0x45bd76['exten'],'priority':_0x425628[_0xd43f('0x32')][_0xd43f('0x23')]+_0x5992f6+_0x710b1e++,'VoiceExtensionId':_0x45bd76['id']});}}}}for(var _0x52ac79=0x0;_0x52ac79<_0x425628[_0xd43f('0x32')][_0xd43f('0x23')];_0x52ac79++){var _0x2dec66=_0x5992f6+_0x425628['intervals'][_0xd43f('0x23')];var _0x598609=_0x52ac79===_0x425628[_0xd43f('0x32')]['length']-0x1?_0x5992f6+_0x33a644[_0xd43f('0x23')]+_0xc2a5a6['length']+0x2:_0x5992f6+_0x52ac79+0x1;_0x33a644[_0xd43f('0x46')](_0x52ac79,0x0,{'type':_0x45bd76[_0xd43f('0x2')],'app':_0xd43f('0x47'),'appdata':_0x425628['intervals'][_0x52ac79]+'?'+_0x45bd76['context']+_0xd43f('0x48')+_0x2dec66+':'+_0x45bd76[_0xd43f('0x5')]+',${EXTEN},'+_0x598609,'exten':_0x45bd76[_0xd43f('0x6')],'context':_0x45bd76[_0xd43f('0x5')],'priority':_0x5992f6+_0x52ac79,'VoiceExtensionId':_0x45bd76['id']});}if(_0x425628['appType']===_0xd43f('0x49'))_0x425628[_0xd43f('0x4a')]=_0xd75865(_0x45bd76,_0x425628[_0xd43f('0x4a')]);_0x425628[_0xd43f('0x4b')]=_0x33a644[_0xd43f('0x23')]?_[_0xd43f('0x4c')](_0x33a644)[_0xd43f('0x4b')]+0x1:_0x5992f6;_0x24155c=_['concat'](_0x24155c,_0x33a644,[_0x425628],_0xc2a5a6);_0x5992f6=_[_0xd43f('0x4c')](_0x24155c)[_0xd43f('0x4b')]+0x1;}return _0x2acf3b(_0x24155c);})[_0xd43f('0x4d')](function(_0x4206c3){_0x1f327f(_0x4206c3);});});}return _0x4ec617[_0xd43f('0x4e')](_0xd43f('0x4f'),attributes,{'tableName':_0xd43f('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x539a9b){var _0x466958=this[_0xd43f('0x51')]({'plain':!![]});var _0x4d157e=_0x466958[_0xd43f('0x2')]===_0xd43f('0x11')?_0x3647df(_0x466958):_0x484615(_0x466958);return _0x3fe872(_0x466958,_0x539a9b,_[_0xd43f('0x4c')](_0x4d157e)[_0xd43f('0x4b')]+0x1)[_0xd43f('0x30')](function(_0xd40a7b){var _0x459c43=_['concat'](_0x4d157e,_0xd40a7b);_0x459c43[_0xd43f('0xa')]({'type':_0x466958[_0xd43f('0x2')],'app':'Hangup','exten':_0x466958[_0xd43f('0x6')],'context':_0x466958['context'],'priority':_[_0xd43f('0x4c')](_0x459c43)[_0xd43f('0x4b')]+0x1,'VoiceExtensionId':_0x466958['id']});return _0x459c43;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3597791..7af148f 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 _0x446c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./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','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch'];(function(_0x20259d,_0x5c1a5b){var _0x5d8e23=function(_0x3f9c1d){while(--_0x3f9c1d){_0x20259d['push'](_0x20259d['shift']());}};_0x5d8e23(++_0x5c1a5b);}(_0x446c,0x156));var _0xc446=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x446c[_0x2074db];return _0x27324c;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var moment=require(_0xc446('0x2'));var BPromise=require(_0xc446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc446('0x4'));var db=require(_0xc446('0x5'))['db'];var utils=require(_0xc446('0x6'));var logger=require('../../config/logger')(_0xc446('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc446('0x8')][_0xc446('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc446('0xa')],{'host':_0xc446('0xb'),'port':0x18eb});var socket=require(_0xc446('0xc'))(new Redis(config[_0xc446('0xa')]));require(_0xc446('0xd'))['register'](socket);function respondWithRpcPromise(_0xa44393,_0x5f2136,_0xbbd769){return new BPromise(function(_0x3783d9,_0x5e225d){return client[_0xc446('0xe')](_0xa44393,_0xbbd769)[_0xc446('0xf')](function(_0x42857a){logger[_0xc446('0x10')](_0xc446('0x11'),_0x5f2136,_0xc446('0x12'));logger[_0xc446('0x13')](_0xc446('0x14'),_0x5f2136,_0xc446('0x12'),JSON[_0xc446('0x15')](_0x42857a));if(_0x42857a[_0xc446('0x16')]){if(_0x42857a[_0xc446('0x16')][_0xc446('0x17')]===0x1f4){logger[_0xc446('0x16')](_0xc446('0x11'),_0x5f2136,_0x42857a[_0xc446('0x16')][_0xc446('0x18')]);return _0x5e225d(_0x42857a[_0xc446('0x16')][_0xc446('0x18')]);}logger['error'](_0xc446('0x11'),_0x5f2136,_0x42857a[_0xc446('0x16')][_0xc446('0x18')]);return _0x3783d9(_0x42857a[_0xc446('0x16')][_0xc446('0x18')]);}else{logger[_0xc446('0x10')](_0xc446('0x11'),_0x5f2136,_0xc446('0x12'));_0x3783d9(_0x42857a[_0xc446('0x19')][_0xc446('0x18')]);}})['catch'](function(_0x19c4d8){logger[_0xc446('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x5f2136,_0x19c4d8);_0x5e225d(_0x19c4d8);});});}exports[_0xc446('0x1a')]=function(_0x16b806){var _0x42a338=this;return new Promise(function(_0x434c94,_0x409a8e){return db[_0xc446('0x1b')][_0xc446('0x1c')]({'raw':_0x16b806[_0xc446('0x1d')]?_0x16b806[_0xc446('0x1d')][_0xc446('0x1e')]===undefined?!![]:![]:!![],'where':_0x16b806['options']?_0x16b806[_0xc446('0x1d')][_0xc446('0x1f')]||null:null,'attributes':_0x16b806[_0xc446('0x1d')]?_0x16b806[_0xc446('0x1d')][_0xc446('0x20')]||null:null,'limit':_0x16b806[_0xc446('0x1d')]?_0x16b806[_0xc446('0x1d')][_0xc446('0x21')]||null:null,'include':_0x16b806[_0xc446('0x1d')]?_0x16b806[_0xc446('0x1d')][_0xc446('0x22')]?_[_0xc446('0x23')](_0x16b806[_0xc446('0x1d')][_0xc446('0x22')],function(_0x16133b){return{'model':db[_0x16133b[_0xc446('0x24')]],'as':_0x16133b['as'],'attributes':_0x16133b[_0xc446('0x20')],'include':_0x16133b['include']?_[_0xc446('0x23')](_0x16133b[_0xc446('0x22')],function(_0x3b0adf){return{'model':db[_0x3b0adf[_0xc446('0x24')]],'as':_0x3b0adf['as'],'attributes':_0x3b0adf[_0xc446('0x20')],'include':_0x3b0adf[_0xc446('0x22')]?_['map'](_0x3b0adf['include'],function(_0x37532c){return{'model':db[_0x37532c[_0xc446('0x24')]],'as':_0x37532c['as'],'attributes':_0x37532c[_0xc446('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc446('0xf')](function(_0x4ea05e){logger[_0xc446('0x10')](_0xc446('0x1a'),_0x16b806);logger[_0xc446('0x13')](_0xc446('0x1a'),_0x16b806,JSON[_0xc446('0x15')](_0x4ea05e));_0x434c94(_0x4ea05e);})[_0xc446('0x25')](function(_0x39302a){logger[_0xc446('0x16')](_0xc446('0x1a'),_0x39302a[_0xc446('0x18')],_0x16b806);_0x409a8e(_0x42a338['error'](0x1f4,_0x39302a['message']));});});}; \ No newline at end of file +var _0xc1fa=['then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x5a02e1,_0x3ace2c){var _0x41f67a=function(_0x52ce27){while(--_0x52ce27){_0x5a02e1['push'](_0x5a02e1['shift']());}};_0x41f67a(++_0x3ace2c);}(_0xc1fa,0x83));var _0xac1f=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xc1fa[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0xac1f('0x0'));var util=require(_0xac1f('0x1'));var moment=require(_0xac1f('0x2'));var BPromise=require(_0xac1f('0x3'));var rs=require(_0xac1f('0x4'));var fs=require('fs');var Redis=require(_0xac1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xac1f('0x6'));var logger=require(_0xac1f('0x7'))(_0xac1f('0x8'));var config=require(_0xac1f('0x9'));var jayson=require(_0xac1f('0xa'));var client=jayson[_0xac1f('0xb')][_0xac1f('0xc')]({'port':0x232a});config[_0xac1f('0xd')]=_[_0xac1f('0xe')](config[_0xac1f('0xd')],{'host':_0xac1f('0xf'),'port':0x18eb});var socket=require(_0xac1f('0x10'))(new Redis(config['redis']));require(_0xac1f('0x11'))[_0xac1f('0x12')](socket);function respondWithRpcPromise(_0x220214,_0x44d578,_0x221222){return new BPromise(function(_0x50fbcb,_0x572817){return client[_0xac1f('0x13')](_0x220214,_0x221222)['then'](function(_0x55a969){logger[_0xac1f('0x14')](_0xac1f('0x15'),_0x44d578,'request\x20sent');logger[_0xac1f('0x16')](_0xac1f('0x17'),_0x44d578,_0xac1f('0x18'),JSON[_0xac1f('0x19')](_0x55a969));if(_0x55a969[_0xac1f('0x1a')]){if(_0x55a969[_0xac1f('0x1a')][_0xac1f('0x1b')]===0x1f4){logger[_0xac1f('0x1a')](_0xac1f('0x15'),_0x44d578,_0x55a969[_0xac1f('0x1a')][_0xac1f('0x1c')]);return _0x572817(_0x55a969[_0xac1f('0x1a')][_0xac1f('0x1c')]);}logger['error'](_0xac1f('0x15'),_0x44d578,_0x55a969[_0xac1f('0x1a')][_0xac1f('0x1c')]);return _0x50fbcb(_0x55a969['error'][_0xac1f('0x1c')]);}else{logger['info'](_0xac1f('0x15'),_0x44d578,_0xac1f('0x18'));_0x50fbcb(_0x55a969[_0xac1f('0x1d')][_0xac1f('0x1c')]);}})['catch'](function(_0x1967a8){logger[_0xac1f('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x44d578,_0x1967a8);_0x572817(_0x1967a8);});});}exports[_0xac1f('0x1e')]=function(_0x4b5c14){var _0x342495=this;return new Promise(function(_0x3ce2fa,_0x374ad5){return db[_0xac1f('0x1f')][_0xac1f('0x20')]({'raw':_0x4b5c14[_0xac1f('0x21')]?_0x4b5c14[_0xac1f('0x21')][_0xac1f('0x22')]===undefined?!![]:![]:!![],'where':_0x4b5c14['options']?_0x4b5c14['options'][_0xac1f('0x23')]||null:null,'attributes':_0x4b5c14[_0xac1f('0x21')]?_0x4b5c14[_0xac1f('0x21')][_0xac1f('0x24')]||null:null,'limit':_0x4b5c14[_0xac1f('0x21')]?_0x4b5c14[_0xac1f('0x21')][_0xac1f('0x25')]||null:null,'include':_0x4b5c14['options']?_0x4b5c14[_0xac1f('0x21')][_0xac1f('0x26')]?_[_0xac1f('0x27')](_0x4b5c14['options']['include'],function(_0x25f1fd){return{'model':db[_0x25f1fd[_0xac1f('0x28')]],'as':_0x25f1fd['as'],'attributes':_0x25f1fd[_0xac1f('0x24')],'include':_0x25f1fd[_0xac1f('0x26')]?_[_0xac1f('0x27')](_0x25f1fd[_0xac1f('0x26')],function(_0x381046){return{'model':db[_0x381046[_0xac1f('0x28')]],'as':_0x381046['as'],'attributes':_0x381046[_0xac1f('0x24')],'include':_0x381046['include']?_[_0xac1f('0x27')](_0x381046[_0xac1f('0x26')],function(_0x2b5116){return{'model':db[_0x2b5116['model']],'as':_0x2b5116['as'],'attributes':_0x2b5116['attributes']};}):[]};}):[]};}):[]:[]})[_0xac1f('0x29')](function(_0x1edef1){logger[_0xac1f('0x14')]('GetVoiceExtension',_0x4b5c14);logger['debug'](_0xac1f('0x1e'),_0x4b5c14,JSON[_0xac1f('0x19')](_0x1edef1));_0x3ce2fa(_0x1edef1);})[_0xac1f('0x2a')](function(_0x1a0701){logger[_0xac1f('0x1a')](_0xac1f('0x1e'),_0x1a0701[_0xac1f('0x1c')],_0x4b5c14);_0x374ad5(_0x342495[_0xac1f('0x1a')](0x1f4,_0x1a0701[_0xac1f('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 02c7e20..5d3a3cf 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x863e3,_0x45bb06){var _0x52faeb=function(_0x594d06){while(--_0x594d06){_0x863e3['push'](_0x863e3['shift']());}};_0x52faeb(++_0x45bb06);}(_0xe14b,0x93));var _0xbe14=function(_0x4a715c,_0x57165f){_0x4a715c=_0x4a715c-0x0;var _0x168cfe=_0xe14b[_0x4a715c];return _0x168cfe;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x1aea6a,_0x15e0d4){var _0x50e350=function(_0x104dff){while(--_0x104dff){_0x1aea6a['push'](_0x1aea6a['shift']());}};_0x50e350(++_0x15e0d4);}(_0x1261,0x144));var _0x1126=function(_0xcd9ec8,_0x27699f){_0xcd9ec8=_0xcd9ec8-0x0;var _0x5aa31b=_0x1261[_0xcd9ec8];return _0x5aa31b;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 061d1a0..6d9207c 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 _0xd117=['./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5d618c,_0x5988e6){var _0x23a15b=function(_0x5d53a5){while(--_0x5d53a5){_0x5d618c['push'](_0x5d618c['shift']());}};_0x23a15b(++_0x5988e6);}(_0xd117,0x182));var _0x7d11=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xd117[_0x30bd4d];return _0x306915;};'use strict';var multer=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var path=require(_0x7d11('0x2'));var timeout=require(_0x7d11('0x3'));var express=require(_0x7d11('0x4'));var router=express[_0x7d11('0x5')]();var fs_extra=require(_0x7d11('0x6'));var auth=require(_0x7d11('0x7'));var interaction=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var controller=require(_0x7d11('0xa'));router[_0x7d11('0xb')]('/',auth[_0x7d11('0xc')](),controller[_0x7d11('0xd')]);router[_0x7d11('0xb')](_0x7d11('0xe'),auth['isAuthenticated'](),controller[_0x7d11('0xf')]);router[_0x7d11('0xb')](_0x7d11('0x10'),auth['isAuthenticated'](),controller[_0x7d11('0x11')]);router[_0x7d11('0x12')]('/',auth[_0x7d11('0xc')](),controller['create']);router[_0x7d11('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7d11('0x14')]);router['delete']('/:id',auth[_0x7d11('0xc')](),controller['destroy']);module[_0x7d11('0x15')]=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(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x2d72,0xa8));var _0x22d7=function(_0x5345c5,_0x50961b){_0x5345c5=_0x5345c5-0x0;var _0x106b1e=_0x2d72[_0x5345c5];return _0x106b1e;};'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 6bbfa49..f17a2bd 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 _0x4e00=['getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','INTEGER','VIRTUAL'];(function(_0x285035,_0x16257f){var _0x4a8747=function(_0x42ef8b){while(--_0x42ef8b){_0x285035['push'](_0x285035['shift']());}};_0x4a8747(++_0x16257f);}(_0x4e00,0xa6));var _0x04e0=function(_0xc0162c,_0x25a204){_0xc0162c=_0xc0162c-0x0;var _0x135883=_0x4e00[_0xc0162c];return _0x135883;};'use strict';var Sequelize=require(_0x04e0('0x0'));module[_0x04e0('0x1')]={'customer_id':{'type':Sequelize[_0x04e0('0x2')]},'context':{'type':Sequelize[_0x04e0('0x2')],'defaultValue':_0x04e0('0x3'),'unique':_0x04e0('0x4')},'mailbox':{'type':Sequelize[_0x04e0('0x2')],'defaultValue':'','allowNull':![],'unique':_0x04e0('0x4')},'password':{'type':Sequelize[_0x04e0('0x2')]},'fullname':{'type':Sequelize[_0x04e0('0x2')]},'email':{'type':Sequelize[_0x04e0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x196019){this[_0x04e0('0x5')](_0x04e0('0x6'),typeof _0x196019===_0x04e0('0x7')&&_0x196019['trim']()?_0x196019[_0x04e0('0x8')]():null);}},'pager':{'type':Sequelize[_0x04e0('0x2')]},'tz':{'type':Sequelize[_0x04e0('0x2')],'defaultValue':_0x04e0('0x9')},'attach':{'type':Sequelize['ENUM'](_0x04e0('0xa'),'no'),'defaultValue':_0x04e0('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x04e0('0xb')](_0x04e0('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x04e0('0x2')]},'review':{'type':Sequelize[_0x04e0('0xb')](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x04e0('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x04e0('0xb')](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x04e0('0xb')](_0x04e0('0xa'),'no'),'defaultValue':_0x04e0('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x04e0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x04e0('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x04e0('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x04e0('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x04e0('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x04e0('0xd')],'get':function(){return this[_0x04e0('0xe')](_0x04e0('0xf'))+_0x04e0('0x10')+this[_0x04e0('0xe')](_0x04e0('0x11'));}}}; \ No newline at end of file +var _0x0d3c=['contest_mailbox','STRING','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','sequelize','exports','from-voicemail'];(function(_0x480d78,_0x46790a){var _0x258a5b=function(_0x390d10){while(--_0x390d10){_0x480d78['push'](_0x480d78['shift']());}};_0x258a5b(++_0x46790a);}(_0x0d3c,0x74));var _0xc0d3=function(_0x4951a3,_0xc7bb2c){_0x4951a3=_0x4951a3-0x0;var _0x1566a1=_0x0d3c[_0x4951a3];return _0x1566a1;};'use strict';var Sequelize=require(_0xc0d3('0x0'));module[_0xc0d3('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xc0d3('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xc0d3('0x3')},'password':{'type':Sequelize[_0xc0d3('0x4')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc0d3('0x4')],'validate':{'isEmail':!![]},'set':function(_0x3fa76b){this[_0xc0d3('0x5')](_0xc0d3('0x6'),typeof _0x3fa76b===_0xc0d3('0x7')&&_0x3fa76b[_0xc0d3('0x8')]()?_0x3fa76b[_0xc0d3('0x8')]():null);}},'pager':{'type':Sequelize[_0xc0d3('0x4')]},'tz':{'type':Sequelize[_0xc0d3('0x4')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':_0xc0d3('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xc0d3('0x4')]},'review':{'type':Sequelize[_0xc0d3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc0d3('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc0d3('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':_0xc0d3('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc0d3('0x9')](_0xc0d3('0xa'),'no'),'defaultValue':_0xc0d3('0xa'),'allowNull':![]},'stamp':{'type':_0xc0d3('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc0d3('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc0d3('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc0d3('0xe')]('fullname')+_0xc0d3('0xf')+this[_0xc0d3('0xe')](_0xc0d3('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a29e98a..d0dc9e8 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 _0xa5fa=['includeAll','include','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','stack','name','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceMail'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x54a479,_0x1b321d){_0x54a479=_0x54a479-0x0;var _0x2474ab=_0xa5fa[_0x54a479];return _0x2474ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){var _0x32cd16=_0x5b9f0b[_0xaa5f('0x27')]({'plain':!![]});var _0x1f66c0=_0xaa5f('0x28');return db[_0xaa5f('0x29')][_0xaa5f('0x26')]({'where':{'type':_0x1f66c0,'resourceId':_0x32cd16['id']}})['then'](function(){return _0x5b9f0b;});})[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x5a7cf1,_0x3b17b6){return function(_0x269209){if(!_0x269209){_0x5a7cf1[_0xaa5f('0x17')](0x194);}return _0x269209;};}function handleError(_0x4e50ca,_0x5a90e5){_0x5a90e5=_0x5a90e5||0x1f4;return function(_0x479f29){logger['error'](_0x479f29[_0xaa5f('0x2a')]);if(_0x479f29['name']){delete _0x479f29[_0xaa5f('0x2b')];}_0x4e50ca['status'](_0x5a90e5)['send'](_0x479f29);};}exports['index']=function(_0x26a90d,_0x4ddebd){var _0x310828={},_0xc0bb03={},_0x555876={'count':0x0,'rows':[]};var _0x58f608=_[_0xaa5f('0x2c')](db['VoiceMail'][_0xaa5f('0x2d')],function(_0x36c306){return{'name':_0x36c306['fieldName'],'type':_0x36c306[_0xaa5f('0x2e')][_0xaa5f('0x2f')]};});_0xc0bb03[_0xaa5f('0x30')]=_['map'](_0x58f608,_0xaa5f('0x2b'));_0xc0bb03[_0xaa5f('0x31')]=_['keys'](_0x26a90d['query']);_0xc0bb03['filters']=_['intersection'](_0xc0bb03[_0xaa5f('0x30')],_0xc0bb03[_0xaa5f('0x31')]);_0x310828[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0xc0bb03[_0xaa5f('0x30')],qs[_0xaa5f('0x34')](_0x26a90d[_0xaa5f('0x31')]['fields']));_0x310828[_0xaa5f('0x32')]=_0x310828[_0xaa5f('0x32')][_0xaa5f('0x35')]?_0x310828[_0xaa5f('0x32')]:_0xc0bb03[_0xaa5f('0x30')];if(!_0x26a90d[_0xaa5f('0x31')]['hasOwnProperty'](_0xaa5f('0x36'))){_0x310828[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x1c')]);_0x310828['offset']=qs['offset'](_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x1a')]);}_0x310828[_0xaa5f('0x37')]=qs[_0xaa5f('0x38')](_0x26a90d['query'][_0xaa5f('0x38')]);_0x310828[_0xaa5f('0x39')]=qs[_0xaa5f('0x3a')](_[_0xaa5f('0x3b')](_0x26a90d[_0xaa5f('0x31')],_0xc0bb03[_0xaa5f('0x3a')]),_0x58f608);if(_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x3c')]){_0x310828[_0xaa5f('0x39')]=_[_0xaa5f('0x3d')](_0x310828[_0xaa5f('0x39')],{'$or':_['map'](_0x58f608,function(_0x42fc51){if(_0x42fc51[_0xaa5f('0x2e')]!==_0xaa5f('0x3e')){var _0x2dd9bb={};_0x2dd9bb[_0x42fc51[_0xaa5f('0x2b')]]={'$like':'%'+_0x26a90d[_0xaa5f('0x31')][_0xaa5f('0x3c')]+'%'};return _0x2dd9bb;}})});}_0x310828=_[_0xaa5f('0x3d')]({},_0x310828,_0x26a90d[_0xaa5f('0x3f')]);var _0x2dad6f={'where':_0x310828['where']};return db[_0xaa5f('0x40')]['count'](_0x2dad6f)[_0xaa5f('0x25')](function(_0x21f4bc){_0x555876[_0xaa5f('0x1d')]=_0x21f4bc;if(_0x26a90d['query'][_0xaa5f('0x41')]){_0x310828[_0xaa5f('0x42')]=[{'all':!![]}];}return db[_0xaa5f('0x40')]['findAll'](_0x310828);})[_0xaa5f('0x25')](function(_0x179be8){_0x555876[_0xaa5f('0x43')]=_0x179be8;return _0x555876;})[_0xaa5f('0x25')](respondWithFilteredResult(_0x4ddebd,_0x310828))['catch'](handleError(_0x4ddebd,null));};exports[_0xaa5f('0x44')]=function(_0x2b2b4c,_0x3aeded){var _0x38edcc={'raw':!![],'where':{'id':_0x2b2b4c[_0xaa5f('0x45')]['id']}},_0x311729={};_0x311729[_0xaa5f('0x30')]=_[_0xaa5f('0x46')](db['VoiceMail'][_0xaa5f('0x2d')]);_0x311729['query']=_[_0xaa5f('0x46')](_0x2b2b4c['query']);_0x311729[_0xaa5f('0x3a')]=_[_0xaa5f('0x33')](_0x311729['model'],_0x311729[_0xaa5f('0x31')]);_0x38edcc[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0x311729['model'],qs['fields'](_0x2b2b4c['query'][_0xaa5f('0x34')]));_0x38edcc['attributes']=_0x38edcc[_0xaa5f('0x32')][_0xaa5f('0x35')]?_0x38edcc[_0xaa5f('0x32')]:_0x311729[_0xaa5f('0x30')];if(_0x2b2b4c['query'][_0xaa5f('0x41')]){_0x38edcc[_0xaa5f('0x42')]=[{'all':!![]}];}_0x38edcc=_[_0xaa5f('0x3d')]({},_0x38edcc,_0x2b2b4c[_0xaa5f('0x3f')]);return db[_0xaa5f('0x40')][_0xaa5f('0x47')](_0x38edcc)[_0xaa5f('0x25')](handleEntityNotFound(_0x3aeded,null))[_0xaa5f('0x25')](respondWithResult(_0x3aeded,null))[_0xaa5f('0x48')](handleError(_0x3aeded,null));};exports[_0xaa5f('0x49')]=function(_0x3ea553,_0x2de737){return db[_0xaa5f('0x40')][_0xaa5f('0x49')](_0x3ea553[_0xaa5f('0x4a')],{})[_0xaa5f('0x25')](function(_0x554e6d){var _0x3412f8=_0x3ea553[_0xaa5f('0x4b')][_0xaa5f('0x27')]({'plain':!![]});if(!_0x3412f8)throw new Error(_0xaa5f('0x4c'));if(_0x3412f8[_0xaa5f('0x4d')]===_0xaa5f('0x4b')){var _0x32bbed=_0x554e6d['get']({'plain':!![]});var _0xf5a6b6=_0xaa5f('0x28');return db[_0xaa5f('0x4e')][_0xaa5f('0x47')]({'where':{'name':_0xf5a6b6,'userProfileId':_0x3412f8['userProfileId']},'raw':!![]})[_0xaa5f('0x25')](function(_0x186c64){if(_0x186c64&&_0x186c64[_0xaa5f('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x32bbed['name'],'resourceId':_0x32bbed['id'],'type':_0x186c64['name'],'sectionId':_0x186c64['id']},{})['then'](function(){return _0x554e6d;});}else{return _0x554e6d;}})['catch'](function(_0x1f47a0){logger[_0xaa5f('0x50')](_0xaa5f('0x51'),_0x1f47a0);throw _0x1f47a0;});}return _0x554e6d;})[_0xaa5f('0x25')](respondWithResult(_0x2de737,0xc9))[_0xaa5f('0x48')](handleError(_0x2de737,null));};exports[_0xaa5f('0x24')]=function(_0x48c473,_0x584a3d){if(_0x48c473[_0xaa5f('0x4a')]['id']){delete _0x48c473[_0xaa5f('0x4a')]['id'];}return db['VoiceMail'][_0xaa5f('0x47')]({'where':{'id':_0x48c473[_0xaa5f('0x45')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x584a3d,null))[_0xaa5f('0x25')](saveUpdates(_0x48c473[_0xaa5f('0x4a')],null))[_0xaa5f('0x25')](respondWithResult(_0x584a3d,null))[_0xaa5f('0x48')](handleError(_0x584a3d,null));};exports['destroy']=function(_0x47c00d,_0x1be4fa){return db[_0xaa5f('0x40')]['find']({'where':{'id':_0x47c00d['params']['id']}})['then'](handleEntityNotFound(_0x1be4fa,null))[_0xaa5f('0x25')](removeEntity(_0x1be4fa,null))['catch'](handleError(_0x1be4fa,null));};exports[_0xaa5f('0x52')]=function(_0x5afc3c,_0x4c5bf6,_0x29b323){return db[_0xaa5f('0x40')][_0xaa5f('0x53')]({'where':{'id':_0x5afc3c['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4c5bf6,null))[_0xaa5f('0x25')](function(_0x24bcf2){var _0x4fe60d;var _0x21d494={},_0x2fd00c={};_0x2fd00c['model']=_[_0xaa5f('0x46')](db[_0xaa5f('0x54')][_0xaa5f('0x2d')]);_0x2fd00c[_0xaa5f('0x31')]=_[_0xaa5f('0x46')](_0x5afc3c[_0xaa5f('0x31')]);_0x2fd00c[_0xaa5f('0x3a')]=_[_0xaa5f('0x33')](_0x2fd00c[_0xaa5f('0x30')],_0x2fd00c['query']);_0x21d494[_0xaa5f('0x32')]=_[_0xaa5f('0x33')](_0x2fd00c[_0xaa5f('0x30')],qs[_0xaa5f('0x34')](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x34')]));_0x21d494[_0xaa5f('0x32')]=_0x21d494[_0xaa5f('0x32')]['length']?_0x21d494[_0xaa5f('0x32')]:_0x2fd00c['model'];if(!_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x55')](_0xaa5f('0x36'))){_0x21d494[_0xaa5f('0x1c')]=qs['limit'](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x1c')]);_0x21d494[_0xaa5f('0x1a')]=qs['offset'](_0x5afc3c[_0xaa5f('0x31')]['offset']);}_0x21d494[_0xaa5f('0x37')]=qs['sort'](_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x38')]);_0x21d494[_0xaa5f('0x39')]=qs[_0xaa5f('0x3a')](_['pick'](_0x5afc3c[_0xaa5f('0x31')],_0x2fd00c[_0xaa5f('0x3a')]));if(_0x5afc3c['query']['filter']){_0x21d494[_0xaa5f('0x39')]=_[_0xaa5f('0x3d')](_0x21d494['where'],{'$or':_[_0xaa5f('0x2c')](_0x21d494[_0xaa5f('0x32')],function(_0x3047bd){var _0x4bb874={};_0x4bb874[_0x3047bd]={'$like':'%'+_0x5afc3c[_0xaa5f('0x31')][_0xaa5f('0x3c')]+'%'};return _0x4bb874;})});}_0x21d494['where']=_[_0xaa5f('0x3d')](_0x21d494[_0xaa5f('0x39')],{'mailboxuser':_0x24bcf2[_0xaa5f('0x56')]});_0x21d494=_['merge']({},_0x21d494,_0x5afc3c[_0xaa5f('0x3f')]);return db[_0xaa5f('0x54')]['findAndCountAll'](_0x21d494)[_0xaa5f('0x25')](respondWithFilteredResult(_0x4c5bf6,_0x21d494));})[_0xaa5f('0x48')](handleError(_0x4c5bf6,null));}; \ No newline at end of file +var _0x04b8=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2cea58,_0x153c15){var _0x192933=function(_0x4f1e9b){while(--_0x4f1e9b){_0x2cea58['push'](_0x2cea58['shift']());}};_0x192933(++_0x153c15);}(_0x04b8,0x159));var _0x804b=function(_0x129d38,_0x33eb62){_0x129d38=_0x129d38-0x0;var _0x1e7227=_0x04b8[_0x129d38];return _0x1e7227;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['VoiceMail'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['VoiceMail']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Voicemails';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};exports[_0x804b('0x55')]=function(_0x5a549f,_0x4f7cc4,_0x13fa81){return db[_0x804b('0x2d')][_0x804b('0x56')]({'where':{'id':_0x5a549f[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x4f7cc4,null))[_0x804b('0x24')](function(_0x24c9b0){var _0x3100aa;var _0x2c0ed4={},_0x3f0ca3={};_0x3f0ca3[_0x804b('0x31')]=_[_0x804b('0x33')](db[_0x804b('0x57')][_0x804b('0x2e')]);_0x3f0ca3[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5a549f['query']);_0x3f0ca3[_0x804b('0x34')]=_[_0x804b('0x35')](_0x3f0ca3['model'],_0x3f0ca3[_0x804b('0x32')]);_0x2c0ed4[_0x804b('0x36')]=_[_0x804b('0x35')](_0x3f0ca3[_0x804b('0x31')],qs['fields'](_0x5a549f[_0x804b('0x32')][_0x804b('0x37')]));_0x2c0ed4['attributes']=_0x2c0ed4[_0x804b('0x36')][_0x804b('0x38')]?_0x2c0ed4[_0x804b('0x36')]:_0x3f0ca3['model'];if(!_0x5a549f[_0x804b('0x32')][_0x804b('0x39')](_0x804b('0x58'))){_0x2c0ed4[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x5a549f['query'][_0x804b('0x1d')]);_0x2c0ed4[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x5a549f[_0x804b('0x32')]['offset']);}_0x2c0ed4['order']=qs[_0x804b('0x3b')](_0x5a549f['query'][_0x804b('0x3b')]);_0x2c0ed4[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x5a549f[_0x804b('0x32')],_0x3f0ca3['filters']));if(_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]){_0x2c0ed4[_0x804b('0x3c')]=_['merge'](_0x2c0ed4[_0x804b('0x3c')],{'$or':_[_0x804b('0x2c')](_0x2c0ed4['attributes'],function(_0xb9deae){var _0x481bcd={};_0x481bcd[_0xb9deae]={'$like':'%'+_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]+'%'};return _0x481bcd;})});}_0x2c0ed4['where']=_[_0x804b('0x3f')](_0x2c0ed4[_0x804b('0x3c')],{'mailboxuser':_0x24c9b0[_0x804b('0x59')]});_0x2c0ed4=_['merge']({},_0x2c0ed4,_0x5a549f[_0x804b('0x41')]);return db['VoiceMailMessage'][_0x804b('0x5a')](_0x2c0ed4)[_0x804b('0x24')](respondWithFilteredResult(_0x4f7cc4,_0x2c0ed4));})[_0x804b('0x46')](handleError(_0x4f7cc4,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9bba004..bdac873 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 _0x3997=['define','VoiceMail','mailbox','lodash','util','../../config/logger','api','bluebird','path','rimraf','./voiceMail.attributes','exports'];(function(_0x3afec1,_0x53d68b){var _0x10f8f7=function(_0x3f7d1b){while(--_0x3f7d1b){_0x3afec1['push'](_0x3afec1['shift']());}};_0x10f8f7(++_0x53d68b);}(_0x3997,0x1e3));var _0x7399=function(_0x5bdd0c,_0x1ae766){_0x5bdd0c=_0x5bdd0c-0x0;var _0x3c09ba=_0x3997[_0x5bdd0c];return _0x3c09ba;};'use strict';var _=require(_0x7399('0x0'));var util=require(_0x7399('0x1'));var logger=require(_0x7399('0x2'))(_0x7399('0x3'));var moment=require('moment');var BPromise=require(_0x7399('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7399('0x5'));var rimraf=require(_0x7399('0x6'));var config=require('../../config/environment');var attributes=require(_0x7399('0x7'));module[_0x7399('0x8')]=function(_0x2e503a,_0x31f9a1){return _0x2e503a[_0x7399('0x9')](_0x7399('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x7399('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x35c6=['VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceMail.attributes','define'];(function(_0x27a29a,_0x209b9a){var _0x2d03c5=function(_0x4dbed6){while(--_0x4dbed6){_0x27a29a['push'](_0x27a29a['shift']());}};_0x2d03c5(++_0x209b9a);}(_0x35c6,0x15f));var _0x635c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x35c6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x635c('0x0'));var util=require(_0x635c('0x1'));var logger=require(_0x635c('0x2'))(_0x635c('0x3'));var moment=require('moment');var BPromise=require(_0x635c('0x4'));var rp=require(_0x635c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x635c('0x6'));var attributes=require(_0x635c('0x7'));module['exports']=function(_0x50cc9f,_0x2ca99b){return _0x50cc9f[_0x635c('0x8')](_0x635c('0x9'),attributes,{'tableName':_0x635c('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x635c('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 51b3b78..1af3ba0 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 _0xbe2e=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x18edb3,_0x6411e4){var _0x3152ea=function(_0x4653c7){while(--_0x4653c7){_0x18edb3['push'](_0x18edb3['shift']());}};_0x3152ea(++_0x6411e4);}(_0xbe2e,0x114));var _0xebe2=function(_0x5ea0c8,_0x4c0af8){_0x5ea0c8=_0x5ea0c8-0x0;var _0x22b187=_0xbe2e[_0x5ea0c8];return _0x22b187;};'use strict';var _=require('lodash');var util=require(_0xebe2('0x0'));var moment=require('moment');var BPromise=require(_0xebe2('0x1'));var rs=require(_0xebe2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xebe2('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xebe2('0x4'));var jayson=require(_0xebe2('0x5'));var client=jayson[_0xebe2('0x6')][_0xebe2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf97a69,_0x5db5ee,_0x3ba1b1){return new BPromise(function(_0x12129a,_0x3d8d91){return client['request'](_0xf97a69,_0x3ba1b1)[_0xebe2('0x8')](function(_0x3bbf01){logger[_0xebe2('0x9')](_0xebe2('0xa'),_0x5db5ee,_0xebe2('0xb'));logger[_0xebe2('0xc')](_0xebe2('0xd'),_0x5db5ee,'request\x20sent',JSON[_0xebe2('0xe')](_0x3bbf01));if(_0x3bbf01[_0xebe2('0xf')]){if(_0x3bbf01[_0xebe2('0xf')]['code']===0x1f4){logger[_0xebe2('0xf')]('VoiceMail,\x20%s,\x20%s',_0x5db5ee,_0x3bbf01[_0xebe2('0xf')][_0xebe2('0x10')]);return _0x3d8d91(_0x3bbf01[_0xebe2('0xf')][_0xebe2('0x10')]);}logger[_0xebe2('0xf')](_0xebe2('0xa'),_0x5db5ee,_0x3bbf01[_0xebe2('0xf')]['message']);return _0x12129a(_0x3bbf01[_0xebe2('0xf')][_0xebe2('0x10')]);}else{logger['info'](_0xebe2('0xa'),_0x5db5ee,_0xebe2('0xb'));_0x12129a(_0x3bbf01['result'][_0xebe2('0x10')]);}})[_0xebe2('0x11')](function(_0x58801c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x5db5ee,_0x58801c);_0x3d8d91(_0x58801c);});});} \ No newline at end of file +var _0x61bf=['debug','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5c01de,_0x4b46e0){var _0x596caa=function(_0x49b17a){while(--_0x49b17a){_0x5c01de['push'](_0x5c01de['shift']());}};_0x596caa(++_0x4b46e0);}(_0x61bf,0xd6));var _0xf61b=function(_0x4432eb,_0x3c3027){_0x4432eb=_0x4432eb-0x0;var _0xc9175c=_0x61bf[_0x4432eb];return _0xc9175c;};'use strict';var _=require(_0xf61b('0x0'));var util=require('util');var moment=require(_0xf61b('0x1'));var BPromise=require(_0xf61b('0x2'));var rs=require(_0xf61b('0x3'));var fs=require('fs');var Redis=require(_0xf61b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf61b('0x5'));var logger=require(_0xf61b('0x6'))(_0xf61b('0x7'));var config=require(_0xf61b('0x8'));var jayson=require(_0xf61b('0x9'));var client=jayson[_0xf61b('0xa')][_0xf61b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb397ac,_0x5e3e9c,_0x115894){return new BPromise(function(_0x2cb52b,_0x4c0987){return client[_0xf61b('0xc')](_0xb397ac,_0x115894)[_0xf61b('0xd')](function(_0x289b9f){logger[_0xf61b('0xe')]('VoiceMail,\x20%s,\x20%s',_0x5e3e9c,_0xf61b('0xf'));logger[_0xf61b('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5e3e9c,_0xf61b('0xf'),JSON[_0xf61b('0x11')](_0x289b9f));if(_0x289b9f[_0xf61b('0x12')]){if(_0x289b9f[_0xf61b('0x12')]['code']===0x1f4){logger[_0xf61b('0x12')](_0xf61b('0x13'),_0x5e3e9c,_0x289b9f['error'][_0xf61b('0x14')]);return _0x4c0987(_0x289b9f[_0xf61b('0x12')][_0xf61b('0x14')]);}logger[_0xf61b('0x12')](_0xf61b('0x13'),_0x5e3e9c,_0x289b9f[_0xf61b('0x12')][_0xf61b('0x14')]);return _0x2cb52b(_0x289b9f[_0xf61b('0x12')][_0xf61b('0x14')]);}else{logger[_0xf61b('0xe')](_0xf61b('0x13'),_0x5e3e9c,_0xf61b('0xf'));_0x2cb52b(_0x289b9f[_0xf61b('0x15')][_0xf61b('0x14')]);}})[_0xf61b('0x16')](function(_0x41d4ab){logger[_0xf61b('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5e3e9c,_0x41d4ab);_0x4c0987(_0x41d4ab);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a8c5a19..4b0bb78 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 _0xf4fa=['/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x11c3a7,_0x4fc46b){var _0x249aa0=function(_0x1023f2){while(--_0x1023f2){_0x11c3a7['push'](_0x11c3a7['shift']());}};_0x249aa0(++_0x4fc46b);}(_0xf4fa,0xf7));var _0xaf4f=function(_0x47c5bd,_0x7605da){_0x47c5bd=_0x47c5bd-0x0;var _0x2447dc=_0xf4fa[_0x47c5bd];return _0x2447dc;};'use strict';var multer=require(_0xaf4f('0x0'));var util=require(_0xaf4f('0x1'));var path=require(_0xaf4f('0x2'));var timeout=require(_0xaf4f('0x3'));var express=require(_0xaf4f('0x4'));var router=express[_0xaf4f('0x5')]();var fs_extra=require(_0xaf4f('0x6'));var auth=require(_0xaf4f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaf4f('0x8'));var controller=require(_0xaf4f('0x9'));router[_0xaf4f('0xa')]('/',auth[_0xaf4f('0xb')](),controller[_0xaf4f('0xc')]);router[_0xaf4f('0xa')](_0xaf4f('0xd'),auth[_0xaf4f('0xb')](),controller['show']);router[_0xaf4f('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xaf4f('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf4f('0xf')]);router[_0xaf4f('0x10')](_0xaf4f('0xd'),auth[_0xaf4f('0xb')](),controller[_0xaf4f('0x11')]);router[_0xaf4f('0x12')](_0xaf4f('0xd'),auth[_0xaf4f('0xb')](),controller[_0xaf4f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc831=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc831,0xfd));var _0x1c83=function(_0xde2a95,_0x3f866d){_0xde2a95=_0xde2a95-0x0;var _0x29843b=_0xc831[_0xde2a95];return _0x29843b;};'use strict';var multer=require(_0x1c83('0x0'));var util=require(_0x1c83('0x1'));var path=require(_0x1c83('0x2'));var timeout=require(_0x1c83('0x3'));var express=require(_0x1c83('0x4'));var router=express['Router']();var fs_extra=require(_0x1c83('0x5'));var auth=require(_0x1c83('0x6'));var interaction=require(_0x1c83('0x7'));var config=require(_0x1c83('0x8'));var controller=require(_0x1c83('0x9'));router[_0x1c83('0xa')]('/',auth[_0x1c83('0xb')](),controller[_0x1c83('0xc')]);router[_0x1c83('0xa')](_0x1c83('0xd'),auth[_0x1c83('0xb')](),controller[_0x1c83('0xe')]);router[_0x1c83('0xa')](_0x1c83('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x1c83('0x10')]('/',auth[_0x1c83('0xb')](),controller[_0x1c83('0x11')]);router[_0x1c83('0x12')](_0x1c83('0xd'),auth[_0x1c83('0xb')](),controller[_0x1c83('0x13')]);router['delete'](_0x1c83('0xd'),auth[_0x1c83('0xb')](),controller[_0x1c83('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ced1181..c6349fb 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 _0x010a=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue','INTEGER','STRING','long','TIMESTAMP'];(function(_0x8a54b0,_0x593b82){var _0x358a4e=function(_0x539037){while(--_0x539037){_0x8a54b0['push'](_0x8a54b0['shift']());}};_0x358a4e(++_0x593b82);}(_0x010a,0xfd));var _0xa010=function(_0x10b37d,_0xd4b3b1){_0x10b37d=_0x10b37d-0x0;var _0x62a069=_0x010a[_0x10b37d];return _0x62a069;};'use strict';var Sequelize=require('sequelize');module[_0xa010('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38192d){return this[_0xa010('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xa010('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xa010('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa010('0x3')],'defaultValue':''},'stamp':{'type':_0xa010('0x5'),'defaultValue':Sequelize['literal'](_0xa010('0x6'))}}; \ No newline at end of file +var _0x43c5=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x43c5,0x19b));var _0x543c=function(_0x3c6c70,_0x247b05){_0x3c6c70=_0x3c6c70-0x0;var _0x324344=_0x43c5[_0x3c6c70];return _0x324344;};'use strict';var Sequelize=require(_0x543c('0x0'));module[_0x543c('0x1')]={'name':{'type':Sequelize[_0x543c('0x2')],'get':function(_0xb71b5a){return this[_0x543c('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x543c('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x543c('0x6')](_0x543c('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x543c('0x5')],'defaultValue':''},'stamp':{'type':_0x543c('0x8'),'defaultValue':Sequelize[_0x543c('0x9')](_0x543c('0xa'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c576fbd..c997a3e 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 _0xfd52=['model','differenceBy','map','query','filters','intersection','fields','length','attributes','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','update','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','VoiceMailMessage','rawAttributes','fieldName','type','key'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfd52,0x76));var _0x2fd5=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xfd52[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x2fd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2fd5('0x1'));var jsonpatch=require(_0x2fd5('0x2'));var rp=require(_0x2fd5('0x3'));var moment=require(_0x2fd5('0x4'));var BPromise=require(_0x2fd5('0x5'));var Mustache=require('mustache');var util=require(_0x2fd5('0x6'));var path=require(_0x2fd5('0x7'));var sox=require(_0x2fd5('0x8'));var csv=require(_0x2fd5('0x9'));var ejs=require(_0x2fd5('0xa'));var fs=require('fs');var fs_extra=require(_0x2fd5('0xb'));var _=require(_0x2fd5('0xc'));var squel=require(_0x2fd5('0xd'));var crypto=require('crypto');var jsforce=require(_0x2fd5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2fd5('0xf'));var Redis=require('ioredis');var authService=require(_0x2fd5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2fd5('0x11'));var hardwareService=require(_0x2fd5('0x12'));var logger=require(_0x2fd5('0x13'))('api');var utils=require(_0x2fd5('0x14'));var config=require(_0x2fd5('0x15'));var licenseUtil=require(_0x2fd5('0x16'));var db=require(_0x2fd5('0x17'))['db'];function respondWithStatusCode(_0x2a6873,_0x19f541){_0x19f541=_0x19f541||0xcc;return function(_0x1f4bb1){if(_0x1f4bb1){return _0x2a6873[_0x2fd5('0x18')](_0x19f541);}return _0x2a6873['status'](_0x19f541)[_0x2fd5('0x19')]();};}function respondWithResult(_0x2ca1c5,_0x375c53){_0x375c53=_0x375c53||0xc8;return function(_0x1e9907){if(_0x1e9907){return _0x2ca1c5[_0x2fd5('0x1a')](_0x375c53)['json'](_0x1e9907);}};}function respondWithFilteredResult(_0x25824b,_0x21378e){return function(_0x4814dd){if(_0x4814dd){var _0x20bf1a=typeof _0x21378e[_0x2fd5('0x1b')]===_0x2fd5('0x1c')&&typeof _0x21378e['limit']===_0x2fd5('0x1c');var _0x5746e2=_0x4814dd[_0x2fd5('0x1d')];var _0x536b18=_0x20bf1a?0x0:_0x21378e[_0x2fd5('0x1b')];var _0x254d47=_0x20bf1a?_0x4814dd[_0x2fd5('0x1d')]:_0x21378e[_0x2fd5('0x1b')]+_0x21378e['limit'];var _0x249d08;if(_0x254d47>=_0x5746e2){_0x254d47=_0x5746e2;_0x249d08=0xc8;}else{_0x249d08=0xce;}_0x25824b[_0x2fd5('0x1a')](_0x249d08);return _0x25824b['set'](_0x2fd5('0x1e'),_0x536b18+'-'+_0x254d47+'/'+_0x5746e2)['json'](_0x4814dd);}return null;};}function patchUpdates(_0x18b280){return function(_0x2bf994){try{jsonpatch[_0x2fd5('0x1f')](_0x2bf994,_0x18b280,!![]);}catch(_0x56f5c1){return BPromise[_0x2fd5('0x20')](_0x56f5c1);}return _0x2bf994[_0x2fd5('0x21')]();};}function saveUpdates(_0x360060,_0x766008){return function(_0x22c8c0){if(_0x22c8c0){return _0x22c8c0['update'](_0x360060)[_0x2fd5('0x22')](function(_0x4d3cda){return _0x4d3cda;});}return null;};}function removeEntity(_0x1851dc,_0x471e9c){return function(_0x26e14b){if(_0x26e14b){return _0x26e14b['destroy']()[_0x2fd5('0x22')](function(){_0x1851dc['status'](0xcc)[_0x2fd5('0x19')]();});}};}function handleEntityNotFound(_0x341d1c,_0x40046d){return function(_0x37e02c){if(!_0x37e02c){_0x341d1c['sendStatus'](0x194);}return _0x37e02c;};}function handleError(_0x2947df,_0x135120){_0x135120=_0x135120||0x1f4;return function(_0x510c07){logger[_0x2fd5('0x23')](_0x510c07[_0x2fd5('0x24')]);if(_0x510c07['name']){delete _0x510c07[_0x2fd5('0x25')];}_0x2947df[_0x2fd5('0x1a')](_0x135120)[_0x2fd5('0x26')](_0x510c07);};}exports['index']=function(_0x496876,_0x199b21){var _0x505db9={},_0x55aa0f={},_0x362efa={'count':0x0,'rows':[]};var _0x56f6e1=_['map'](db[_0x2fd5('0x27')][_0x2fd5('0x28')],function(_0x409013){return{'name':_0x409013[_0x2fd5('0x29')],'type':_0x409013[_0x2fd5('0x2a')][_0x2fd5('0x2b')]};});_0x55aa0f[_0x2fd5('0x2c')]=_[_0x2fd5('0x2d')](_[_0x2fd5('0x2e')](_0x56f6e1,'name'),['name']);_0x55aa0f[_0x2fd5('0x2f')]=_['keys'](_0x496876[_0x2fd5('0x2f')]);_0x55aa0f[_0x2fd5('0x30')]=_[_0x2fd5('0x31')](_0x55aa0f[_0x2fd5('0x2c')],_0x55aa0f[_0x2fd5('0x2f')]);_0x505db9['attributes']=_[_0x2fd5('0x31')](_0x55aa0f[_0x2fd5('0x2c')],qs[_0x2fd5('0x32')](_0x496876[_0x2fd5('0x2f')][_0x2fd5('0x32')]));_0x505db9['attributes']=_0x505db9['attributes'][_0x2fd5('0x33')]?_0x505db9[_0x2fd5('0x34')]:_0x55aa0f[_0x2fd5('0x2c')];if(!_0x496876[_0x2fd5('0x2f')]['hasOwnProperty'](_0x2fd5('0x35'))){_0x505db9[_0x2fd5('0x36')]=qs[_0x2fd5('0x36')](_0x496876[_0x2fd5('0x2f')][_0x2fd5('0x36')]);_0x505db9[_0x2fd5('0x1b')]=qs[_0x2fd5('0x1b')](_0x496876[_0x2fd5('0x2f')][_0x2fd5('0x1b')]);}_0x505db9[_0x2fd5('0x37')]=qs['sort'](_0x496876['query'][_0x2fd5('0x38')]);_0x505db9[_0x2fd5('0x39')]=qs['filters'](_['pick'](_0x496876[_0x2fd5('0x2f')],_0x55aa0f['filters']),_0x56f6e1);if(_0x496876[_0x2fd5('0x2f')][_0x2fd5('0x3a')]){_0x505db9['where']=_[_0x2fd5('0x3b')](_0x505db9['where'],{'$or':_['map'](_0x56f6e1,function(_0x224867){if(_0x224867[_0x2fd5('0x2a')]!==_0x2fd5('0x3c')){var _0x422da0={};_0x422da0[_0x224867[_0x2fd5('0x25')]]={'$like':'%'+_0x496876['query'][_0x2fd5('0x3a')]+'%'};return _0x422da0;}})});}_0x505db9=_[_0x2fd5('0x3b')]({},_0x505db9,_0x496876[_0x2fd5('0x3d')]);var _0x8853a5={'where':_0x505db9[_0x2fd5('0x39')]};return db['VoiceMailMessage'][_0x2fd5('0x1d')](_0x8853a5)[_0x2fd5('0x22')](function(_0xe9b09d){_0x362efa[_0x2fd5('0x1d')]=_0xe9b09d;if(_0x496876['query'][_0x2fd5('0x3e')]){_0x505db9[_0x2fd5('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x505db9);})[_0x2fd5('0x22')](function(_0x1e1ebe){_0x362efa['rows']=_0x1e1ebe;return _0x362efa;})[_0x2fd5('0x22')](respondWithFilteredResult(_0x199b21,_0x505db9))[_0x2fd5('0x40')](handleError(_0x199b21,null));};exports['show']=function(_0x5dec5f,_0x38cb56){var _0x3dcc93={'raw':!![],'where':{'id':_0x5dec5f[_0x2fd5('0x41')]['id']}},_0x3dc5b4={};_0x3dc5b4['model']=_['keys'](db[_0x2fd5('0x27')][_0x2fd5('0x28')]);_0x3dc5b4[_0x2fd5('0x2f')]=_[_0x2fd5('0x42')](_0x5dec5f[_0x2fd5('0x2f')]);_0x3dc5b4[_0x2fd5('0x30')]=_[_0x2fd5('0x31')](_0x3dc5b4['model'],_0x3dc5b4['query']);_0x3dcc93['attributes']=_[_0x2fd5('0x31')](_0x3dc5b4['model'],qs[_0x2fd5('0x32')](_0x5dec5f[_0x2fd5('0x2f')]['fields']));_0x3dcc93[_0x2fd5('0x34')]=_0x3dcc93[_0x2fd5('0x34')][_0x2fd5('0x33')]?_0x3dcc93['attributes']:_0x3dc5b4['model'];if(_0x5dec5f['query'][_0x2fd5('0x3e')]){_0x3dcc93['include']=[{'all':!![]}];}_0x3dcc93=_[_0x2fd5('0x3b')]({},_0x3dcc93,_0x5dec5f[_0x2fd5('0x3d')]);return db[_0x2fd5('0x27')][_0x2fd5('0x43')](_0x3dcc93)[_0x2fd5('0x22')](handleEntityNotFound(_0x38cb56,null))['then'](respondWithResult(_0x38cb56,null))['catch'](handleError(_0x38cb56,null));};exports['create']=function(_0xa18c0,_0x51d589){return db[_0x2fd5('0x27')][_0x2fd5('0x44')](_0xa18c0[_0x2fd5('0x45')],{})[_0x2fd5('0x22')](respondWithResult(_0x51d589,0xc9))[_0x2fd5('0x40')](handleError(_0x51d589,null));};exports[_0x2fd5('0x46')]=function(_0x174f3f,_0x3f207b){if(_0x174f3f['body']['id']){delete _0x174f3f['body']['id'];}return db['VoiceMailMessage'][_0x2fd5('0x43')]({'where':{'id':_0x174f3f[_0x2fd5('0x41')]['id']}})[_0x2fd5('0x22')](handleEntityNotFound(_0x3f207b,null))[_0x2fd5('0x22')](saveUpdates(_0x174f3f[_0x2fd5('0x45')],null))[_0x2fd5('0x22')](respondWithResult(_0x3f207b,null))[_0x2fd5('0x40')](handleError(_0x3f207b,null));};exports['destroy']=function(_0x27df68,_0x3cb12c){return db[_0x2fd5('0x27')][_0x2fd5('0x43')]({'where':{'id':_0x27df68[_0x2fd5('0x41')]['id']}})[_0x2fd5('0x22')](handleEntityNotFound(_0x3cb12c,null))[_0x2fd5('0x22')](removeEntity(_0x3cb12c,null))[_0x2fd5('0x40')](handleError(_0x3cb12c,null));};exports[_0x2fd5('0x47')]=function(_0x38fa69,_0x4b6f03,_0x2e4e8c){return db['VoiceMailMessage'][_0x2fd5('0x43')]({'where':{'id':_0x38fa69[_0x2fd5('0x41')]['id']},'attributes':['id',_0x2fd5('0x48'),_0x2fd5('0x49')]})[_0x2fd5('0x22')](handleEntityNotFound(_0x4b6f03,null))['then'](function(_0x425d36){if(_0x425d36){if(!_0x425d36[_0x2fd5('0x48')]){throw new db[(_0x2fd5('0x4a'))][(_0x2fd5('0x4b'))](_0x2fd5('0x4c'));}var _0x51eed3={'Content-Type':_0x2fd5('0x4d'),'Content-Disposition':_0x2fd5('0x4e')};if(_0x425d36[_0x2fd5('0x49')]){_0x51eed3['Content-Disposition']=_0x2fd5('0x4f')+_0x425d36[_0x2fd5('0x49')]+_0x2fd5('0x50');}_0x4b6f03['set'](_0x51eed3);return _0x4b6f03[_0x2fd5('0x26')](new Buffer(_0x425d36['recording']));}})[_0x2fd5('0x40')](handleError(_0x4b6f03,null));}; \ No newline at end of file +var _0x885a=['differenceBy','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','findAll','catch','show','params','include','find','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','VoiceMailMessage','key','model'];(function(_0x3513e2,_0x26f645){var _0x186e8f=function(_0xe8147b){while(--_0xe8147b){_0x3513e2['push'](_0x3513e2['shift']());}};_0x186e8f(++_0x26f645);}(_0x885a,0x1f4));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0xa885('0x0'));var rimraf=require(_0xa885('0x1'));var zipdir=require(_0xa885('0x2'));var jsonpatch=require(_0xa885('0x3'));var rp=require('request-promise');var moment=require(_0xa885('0x4'));var BPromise=require(_0xa885('0x5'));var Mustache=require(_0xa885('0x6'));var util=require('util');var path=require(_0xa885('0x7'));var sox=require(_0xa885('0x8'));var csv=require(_0xa885('0x9'));var ejs=require(_0xa885('0xa'));var fs=require('fs');var fs_extra=require(_0xa885('0xb'));var _=require(_0xa885('0xc'));var squel=require('squel');var crypto=require(_0xa885('0xd'));var jsforce=require(_0xa885('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa885('0x9'));var querystring=require(_0xa885('0xf'));var Papa=require(_0xa885('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa885('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa885('0x12'));var logger=require(_0xa885('0x13'))(_0xa885('0x14'));var utils=require(_0xa885('0x15'));var config=require(_0xa885('0x16'));var licenseUtil=require(_0xa885('0x17'));var db=require(_0xa885('0x18'))['db'];function respondWithStatusCode(_0x4e10bd,_0x44f695){_0x44f695=_0x44f695||0xcc;return function(_0x597584){if(_0x597584){return _0x4e10bd[_0xa885('0x19')](_0x44f695);}return _0x4e10bd[_0xa885('0x1a')](_0x44f695)['end']();};}function respondWithResult(_0x357417,_0x548856){_0x548856=_0x548856||0xc8;return function(_0x1331f7){if(_0x1331f7){return _0x357417[_0xa885('0x1a')](_0x548856)[_0xa885('0x1b')](_0x1331f7);}};}function respondWithFilteredResult(_0x2dad00,_0x4bf1d7){return function(_0x32715a){if(_0x32715a){var _0x471234=typeof _0x4bf1d7['offset']===_0xa885('0x1c')&&typeof _0x4bf1d7[_0xa885('0x1d')]===_0xa885('0x1c');var _0x38aee7=_0x32715a[_0xa885('0x1e')];var _0x4a9d32=_0x471234?0x0:_0x4bf1d7[_0xa885('0x1f')];var _0x184848=_0x471234?_0x32715a[_0xa885('0x1e')]:_0x4bf1d7[_0xa885('0x1f')]+_0x4bf1d7[_0xa885('0x1d')];var _0x3ba573;if(_0x184848>=_0x38aee7){_0x184848=_0x38aee7;_0x3ba573=0xc8;}else{_0x3ba573=0xce;}_0x2dad00[_0xa885('0x1a')](_0x3ba573);return _0x2dad00[_0xa885('0x20')](_0xa885('0x21'),_0x4a9d32+'-'+_0x184848+'/'+_0x38aee7)[_0xa885('0x1b')](_0x32715a);}return null;};}function patchUpdates(_0x5b2e26){return function(_0x50ccfd){try{jsonpatch[_0xa885('0x22')](_0x50ccfd,_0x5b2e26,!![]);}catch(_0x2c8d75){return BPromise['reject'](_0x2c8d75);}return _0x50ccfd[_0xa885('0x23')]();};}function saveUpdates(_0x32deb9,_0x3b5d06){return function(_0x41029c){if(_0x41029c){return _0x41029c[_0xa885('0x24')](_0x32deb9)['then'](function(_0x598ae4){return _0x598ae4;});}return null;};}function removeEntity(_0x578068,_0x38bdbb){return function(_0x5156ae){if(_0x5156ae){return _0x5156ae[_0xa885('0x25')]()[_0xa885('0x26')](function(){_0x578068[_0xa885('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25aecb,_0x16498e){return function(_0x3514af){if(!_0x3514af){_0x25aecb[_0xa885('0x19')](0x194);}return _0x3514af;};}function handleError(_0x54f14d,_0x2d5e02){_0x2d5e02=_0x2d5e02||0x1f4;return function(_0x284650){logger[_0xa885('0x27')](_0x284650['stack']);if(_0x284650[_0xa885('0x28')]){delete _0x284650[_0xa885('0x28')];}_0x54f14d[_0xa885('0x1a')](_0x2d5e02)[_0xa885('0x29')](_0x284650);};}exports[_0xa885('0x2a')]=function(_0x29c888,_0x18f39a){var _0x386eaa={},_0x9961b6={},_0x4d9eb7={'count':0x0,'rows':[]};var _0x19d508=_['map'](db[_0xa885('0x2b')]['rawAttributes'],function(_0x342f5c){return{'name':_0x342f5c['fieldName'],'type':_0x342f5c['type'][_0xa885('0x2c')]};});_0x9961b6[_0xa885('0x2d')]=_[_0xa885('0x2e')](_[_0xa885('0x2f')](_0x19d508,_0xa885('0x28')),[_0xa885('0x28')]);_0x9961b6['query']=_[_0xa885('0x30')](_0x29c888[_0xa885('0x31')]);_0x9961b6['filters']=_[_0xa885('0x32')](_0x9961b6[_0xa885('0x2d')],_0x9961b6[_0xa885('0x31')]);_0x386eaa[_0xa885('0x33')]=_[_0xa885('0x32')](_0x9961b6[_0xa885('0x2d')],qs[_0xa885('0x34')](_0x29c888[_0xa885('0x31')]['fields']));_0x386eaa[_0xa885('0x33')]=_0x386eaa[_0xa885('0x33')][_0xa885('0x35')]?_0x386eaa[_0xa885('0x33')]:_0x9961b6['model'];if(!_0x29c888[_0xa885('0x31')][_0xa885('0x36')](_0xa885('0x37'))){_0x386eaa[_0xa885('0x1d')]=qs[_0xa885('0x1d')](_0x29c888[_0xa885('0x31')][_0xa885('0x1d')]);_0x386eaa[_0xa885('0x1f')]=qs[_0xa885('0x1f')](_0x29c888['query'][_0xa885('0x1f')]);}_0x386eaa['order']=qs[_0xa885('0x38')](_0x29c888[_0xa885('0x31')][_0xa885('0x38')]);_0x386eaa[_0xa885('0x39')]=qs[_0xa885('0x3a')](_[_0xa885('0x3b')](_0x29c888[_0xa885('0x31')],_0x9961b6[_0xa885('0x3a')]),_0x19d508);if(_0x29c888[_0xa885('0x31')]['filter']){_0x386eaa['where']=_[_0xa885('0x3c')](_0x386eaa[_0xa885('0x39')],{'$or':_[_0xa885('0x2f')](_0x19d508,function(_0x272435){if(_0x272435['type']!=='VIRTUAL'){var _0x3e5b3e={};_0x3e5b3e[_0x272435[_0xa885('0x28')]]={'$like':'%'+_0x29c888[_0xa885('0x31')][_0xa885('0x3d')]+'%'};return _0x3e5b3e;}})});}_0x386eaa=_[_0xa885('0x3c')]({},_0x386eaa,_0x29c888[_0xa885('0x3e')]);var _0x159519={'where':_0x386eaa['where']};return db[_0xa885('0x2b')][_0xa885('0x1e')](_0x159519)['then'](function(_0x1ca3dd){_0x4d9eb7['count']=_0x1ca3dd;if(_0x29c888[_0xa885('0x31')][_0xa885('0x3f')]){_0x386eaa['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa885('0x40')](_0x386eaa);})[_0xa885('0x26')](function(_0x1fec39){_0x4d9eb7['rows']=_0x1fec39;return _0x4d9eb7;})['then'](respondWithFilteredResult(_0x18f39a,_0x386eaa))[_0xa885('0x41')](handleError(_0x18f39a,null));};exports[_0xa885('0x42')]=function(_0x215e31,_0x44cec7){var _0x2899a3={'raw':!![],'where':{'id':_0x215e31[_0xa885('0x43')]['id']}},_0x35c5d4={};_0x35c5d4[_0xa885('0x2d')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x35c5d4[_0xa885('0x31')]=_[_0xa885('0x30')](_0x215e31[_0xa885('0x31')]);_0x35c5d4[_0xa885('0x3a')]=_['intersection'](_0x35c5d4[_0xa885('0x2d')],_0x35c5d4[_0xa885('0x31')]);_0x2899a3[_0xa885('0x33')]=_['intersection'](_0x35c5d4[_0xa885('0x2d')],qs[_0xa885('0x34')](_0x215e31[_0xa885('0x31')][_0xa885('0x34')]));_0x2899a3[_0xa885('0x33')]=_0x2899a3[_0xa885('0x33')][_0xa885('0x35')]?_0x2899a3[_0xa885('0x33')]:_0x35c5d4[_0xa885('0x2d')];if(_0x215e31[_0xa885('0x31')][_0xa885('0x3f')]){_0x2899a3[_0xa885('0x44')]=[{'all':!![]}];}_0x2899a3=_[_0xa885('0x3c')]({},_0x2899a3,_0x215e31['options']);return db[_0xa885('0x2b')][_0xa885('0x45')](_0x2899a3)[_0xa885('0x26')](handleEntityNotFound(_0x44cec7,null))[_0xa885('0x26')](respondWithResult(_0x44cec7,null))[_0xa885('0x41')](handleError(_0x44cec7,null));};exports['create']=function(_0x646cee,_0x107648){return db[_0xa885('0x2b')]['create'](_0x646cee[_0xa885('0x46')],{})[_0xa885('0x26')](respondWithResult(_0x107648,0xc9))[_0xa885('0x41')](handleError(_0x107648,null));};exports[_0xa885('0x24')]=function(_0x5cb7b3,_0x5f2f67){if(_0x5cb7b3[_0xa885('0x46')]['id']){delete _0x5cb7b3[_0xa885('0x46')]['id'];}return db[_0xa885('0x2b')][_0xa885('0x45')]({'where':{'id':_0x5cb7b3[_0xa885('0x43')]['id']}})[_0xa885('0x26')](handleEntityNotFound(_0x5f2f67,null))[_0xa885('0x26')](saveUpdates(_0x5cb7b3[_0xa885('0x46')],null))['then'](respondWithResult(_0x5f2f67,null))[_0xa885('0x41')](handleError(_0x5f2f67,null));};exports['destroy']=function(_0x42efb6,_0x45adf1){return db[_0xa885('0x2b')]['find']({'where':{'id':_0x42efb6[_0xa885('0x43')]['id']}})[_0xa885('0x26')](handleEntityNotFound(_0x45adf1,null))['then'](removeEntity(_0x45adf1,null))[_0xa885('0x41')](handleError(_0x45adf1,null));};exports[_0xa885('0x47')]=function(_0x74e3f0,_0x36361c,_0xeb4d68){return db[_0xa885('0x2b')][_0xa885('0x45')]({'where':{'id':_0x74e3f0['params']['id']},'attributes':['id',_0xa885('0x48'),_0xa885('0x49')]})[_0xa885('0x26')](handleEntityNotFound(_0x36361c,null))[_0xa885('0x26')](function(_0x37bdfe){if(_0x37bdfe){if(!_0x37bdfe[_0xa885('0x48')]){throw new db[(_0xa885('0x4a'))]['ValidationError'](_0xa885('0x4b'));}var _0x28afce={'Content-Type':'audio/wav','Content-Disposition':_0xa885('0x4c')};if(_0x37bdfe[_0xa885('0x49')]){_0x28afce[_0xa885('0x4d')]='attachment;\x20filename=\x22'+_0x37bdfe[_0xa885('0x49')]+'.wav\x22';}_0x36361c[_0xa885('0x20')](_0x28afce);return _0x36361c['send'](new Buffer(_0x37bdfe[_0xa885('0x48')]));}})[_0xa885('0x41')](handleError(_0x36361c,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 7c21fc2..dcc5c67 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 _0xfc32=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x58df23,_0x3e9eb9){var _0x2fcd18=function(_0x5f4e06){while(--_0x5f4e06){_0x58df23['push'](_0x58df23['shift']());}};_0x2fcd18(++_0x3e9eb9);}(_0xfc32,0x17e));var _0x2fc3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xfc32[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x2fc3('0x0'));var util=require(_0x2fc3('0x1'));var logger=require(_0x2fc3('0x2'))('api');var moment=require(_0x2fc3('0x3'));var BPromise=require('bluebird');var rp=require(_0x2fc3('0x4'));var fs=require('fs');var path=require(_0x2fc3('0x5'));var rimraf=require(_0x2fc3('0x6'));var config=require(_0x2fc3('0x7'));var attributes=require(_0x2fc3('0x8'));module['exports']=function(_0xeeaae4,_0x32701b){return _0xeeaae4['define'](_0x2fc3('0x9'),attributes,{'tableName':_0x2fc3('0xa'),'paranoid':![],'indexes':[{'name':_0x2fc3('0xb'),'fields':[_0x2fc3('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x41c7=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2b838c,_0x772137){var _0x2dcdfc=function(_0x253612){while(--_0x253612){_0x2b838c['push'](_0x2b838c['shift']());}};_0x2dcdfc(++_0x772137);}(_0x41c7,0x199));var _0x741c=function(_0x590a0f,_0x3549b8){_0x590a0f=_0x590a0f-0x0;var _0x386658=_0x41c7[_0x590a0f];return _0x386658;};'use strict';var _=require(_0x741c('0x0'));var util=require('util');var logger=require(_0x741c('0x1'))('api');var moment=require(_0x741c('0x2'));var BPromise=require(_0x741c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x741c('0x4'));var rimraf=require(_0x741c('0x5'));var config=require(_0x741c('0x6'));var attributes=require(_0x741c('0x7'));module[_0x741c('0x8')]=function(_0x5ebb41,_0x38254d){return _0x5ebb41[_0x741c('0x9')](_0x741c('0xa'),attributes,{'tableName':_0x741c('0xb'),'paranoid':![],'indexes':[{'name':_0x741c('0xc'),'fields':[_0x741c('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d65de82..c9d4258 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 _0xcf7e=['then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x6effb3,_0x476f6b){var _0x27fc56=function(_0x5bd2cc){while(--_0x5bd2cc){_0x6effb3['push'](_0x6effb3['shift']());}};_0x27fc56(++_0x476f6b);}(_0xcf7e,0x112));var _0xecf7=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xcf7e[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xecf7('0x0'));var util=require(_0xecf7('0x1'));var moment=require(_0xecf7('0x2'));var BPromise=require(_0xecf7('0x3'));var rs=require(_0xecf7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecf7('0x5'))['db'];var utils=require(_0xecf7('0x6'));var logger=require(_0xecf7('0x7'))(_0xecf7('0x8'));var config=require(_0xecf7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xecf7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a857,_0x35b432,_0xf86d5){return new BPromise(function(_0x4592c8,_0x2b8b30){return client[_0xecf7('0xb')](_0x34a857,_0xf86d5)[_0xecf7('0xc')](function(_0x449a83){logger['info'](_0xecf7('0xd'),_0x35b432,_0xecf7('0xe'));logger['debug'](_0xecf7('0xf'),_0x35b432,_0xecf7('0xe'),JSON[_0xecf7('0x10')](_0x449a83));if(_0x449a83['error']){if(_0x449a83[_0xecf7('0x11')][_0xecf7('0x12')]===0x1f4){logger[_0xecf7('0x11')](_0xecf7('0xd'),_0x35b432,_0x449a83[_0xecf7('0x11')][_0xecf7('0x13')]);return _0x2b8b30(_0x449a83[_0xecf7('0x11')][_0xecf7('0x13')]);}logger[_0xecf7('0x11')](_0xecf7('0xd'),_0x35b432,_0x449a83[_0xecf7('0x11')][_0xecf7('0x13')]);return _0x4592c8(_0x449a83[_0xecf7('0x11')][_0xecf7('0x13')]);}else{logger[_0xecf7('0x14')](_0xecf7('0xd'),_0x35b432,_0xecf7('0xe'));_0x4592c8(_0x449a83['result'][_0xecf7('0x13')]);}})[_0xecf7('0x15')](function(_0x12ac30){logger[_0xecf7('0x11')](_0xecf7('0xd'),_0x35b432,_0x12ac30);_0x2b8b30(_0x12ac30);});});} \ No newline at end of file +var _0xef31=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','request\x20sent','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xef31,0x1ef));var _0x1ef3=function(_0x5d7367,_0x195416){_0x5d7367=_0x5d7367-0x0;var _0x2e3c63=_0xef31[_0x5d7367];return _0x2e3c63;};'use strict';var _=require('lodash');var util=require(_0x1ef3('0x0'));var moment=require(_0x1ef3('0x1'));var BPromise=require(_0x1ef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ef3('0x3'))['db'];var utils=require(_0x1ef3('0x4'));var logger=require(_0x1ef3('0x5'))('rpc');var config=require(_0x1ef3('0x6'));var jayson=require(_0x1ef3('0x7'));var client=jayson[_0x1ef3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18561f,_0x322bcb,_0x16c206){return new BPromise(function(_0x1454df,_0x297cb3){return client['request'](_0x18561f,_0x16c206)[_0x1ef3('0x9')](function(_0x1ddd4f){logger[_0x1ef3('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x322bcb,'request\x20sent');logger[_0x1ef3('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x322bcb,_0x1ef3('0xc'),JSON[_0x1ef3('0xd')](_0x1ddd4f));if(_0x1ddd4f[_0x1ef3('0xe')]){if(_0x1ddd4f[_0x1ef3('0xe')]['code']===0x1f4){logger[_0x1ef3('0xe')](_0x1ef3('0xf'),_0x322bcb,_0x1ddd4f[_0x1ef3('0xe')][_0x1ef3('0x10')]);return _0x297cb3(_0x1ddd4f['error']['message']);}logger[_0x1ef3('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x322bcb,_0x1ddd4f['error']['message']);return _0x1454df(_0x1ddd4f['error'][_0x1ef3('0x10')]);}else{logger['info'](_0x1ef3('0xf'),_0x322bcb,_0x1ef3('0xc'));_0x1454df(_0x1ddd4f[_0x1ef3('0x11')][_0x1ef3('0x10')]);}})[_0x1ef3('0x12')](function(_0x44cf21){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x322bcb,_0x44cf21);_0x297cb3(_0x44cf21);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0292dce..adda3c1 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 _0xbf68=['getSounds','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds'];(function(_0x95f8b4,_0x1899a2){var _0x2d1cee=function(_0xd8521e){while(--_0xd8521e){_0x95f8b4['push'](_0x95f8b4['shift']());}};_0x2d1cee(++_0x1899a2);}(_0xbf68,0xba));var _0x8bf6=function(_0x12d6cc,_0x155c63){_0x12d6cc=_0x12d6cc-0x0;var _0x4af7d3=_0xbf68[_0x12d6cc];return _0x4af7d3;};'use strict';var multer=require(_0x8bf6('0x0'));var util=require(_0x8bf6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8bf6('0x2'));var router=express[_0x8bf6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8bf6('0x4'));var interaction=require(_0x8bf6('0x5'));var config=require('../../config/environment');var controller=require(_0x8bf6('0x6'));router[_0x8bf6('0x7')]('/',auth[_0x8bf6('0x8')](),controller['index']);router['get'](_0x8bf6('0x9'),auth['isAuthenticated'](),controller[_0x8bf6('0xa')]);router['get'](_0x8bf6('0xb'),auth[_0x8bf6('0x8')](),controller[_0x8bf6('0xc')]);router[_0x8bf6('0xd')]('/',auth['isAuthenticated'](),controller[_0x8bf6('0xe')]);router[_0x8bf6('0xd')](_0x8bf6('0xb'),auth['isAuthenticated'](),controller[_0x8bf6('0xf')]);router['put'](_0x8bf6('0x9'),auth[_0x8bf6('0x8')](),controller[_0x8bf6('0x10')]);router[_0x8bf6('0x11')](_0x8bf6('0x9'),auth['isAuthenticated'](),controller[_0x8bf6('0x12')]);router[_0x8bf6('0x11')](_0x8bf6('0x13'),auth[_0x8bf6('0x8')](),controller[_0x8bf6('0x14')]);module[_0x8bf6('0x15')]=router; \ No newline at end of file +var _0x3fae=['delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','create','addSound','put'];(function(_0x4a1b18,_0x4cd57f){var _0x2a25b0=function(_0x2b6617){while(--_0x2b6617){_0x4a1b18['push'](_0x4a1b18['shift']());}};_0x2a25b0(++_0x4cd57f);}(_0x3fae,0xea));var _0xe3fa=function(_0x10a69d,_0x434d96){_0x10a69d=_0x10a69d-0x0;var _0x68fae4=_0x3fae[_0x10a69d];return _0x68fae4;};'use strict';var multer=require(_0xe3fa('0x0'));var util=require(_0xe3fa('0x1'));var path=require(_0xe3fa('0x2'));var timeout=require(_0xe3fa('0x3'));var express=require(_0xe3fa('0x4'));var router=express[_0xe3fa('0x5')]();var fs_extra=require(_0xe3fa('0x6'));var auth=require(_0xe3fa('0x7'));var interaction=require(_0xe3fa('0x8'));var config=require('../../config/environment');var controller=require(_0xe3fa('0x9'));router[_0xe3fa('0xa')]('/',auth[_0xe3fa('0xb')](),controller['index']);router[_0xe3fa('0xa')](_0xe3fa('0xc'),auth['isAuthenticated'](),controller[_0xe3fa('0xd')]);router[_0xe3fa('0xa')](_0xe3fa('0xe'),auth[_0xe3fa('0xb')](),controller[_0xe3fa('0xf')]);router['post']('/',auth[_0xe3fa('0xb')](),controller[_0xe3fa('0x10')]);router['post'](_0xe3fa('0xe'),auth[_0xe3fa('0xb')](),controller[_0xe3fa('0x11')]);router[_0xe3fa('0x12')](_0xe3fa('0xc'),auth[_0xe3fa('0xb')](),controller['update']);router[_0xe3fa('0x13')](_0xe3fa('0xc'),auth['isAuthenticated'](),controller[_0xe3fa('0x14')]);router['delete'](_0xe3fa('0x15'),auth[_0xe3fa('0xb')](),controller['removeSound']);module[_0xe3fa('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 20eb673..3a66d12 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 _0xa6ab=['TIMESTAMP','exports','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha'];(function(_0x31f5f2,_0x181ed9){var _0x37e059=function(_0x268cb2){while(--_0x268cb2){_0x31f5f2['push'](_0x31f5f2['shift']());}};_0x37e059(++_0x181ed9);}(_0xa6ab,0x1f0));var _0xba6a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa6ab[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xba6a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xba6a('0x1')](_0xba6a('0x2'),_0xba6a('0x3'),_0xba6a('0x4'),_0xba6a('0x5'),_0xba6a('0x6'),_0xba6a('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xba6a('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xba6a('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xba6a('0x8')],'allowNull':!![],'defaultValue':_0xba6a('0x9')},'format':{'type':Sequelize[_0xba6a('0x8')],'allowNull':!![]},'stamp':{'type':_0xba6a('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e1=['ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name'];(function(_0xde2046,_0x9f61bb){var _0x2c607c=function(_0x3bd8a6){while(--_0x3bd8a6){_0xde2046['push'](_0xde2046['shift']());}};_0x2c607c(++_0x9f61bb);}(_0xa9e1,0x89));var _0x1a9e=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0xa9e1[_0x602ca8];return _0x26e8ab;};'use strict';var Sequelize=require(_0x1a9e('0x0'));module[_0x1a9e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a9e('0x2')},'mode':{'type':Sequelize[_0x1a9e('0x3')](_0x1a9e('0x4'),_0x1a9e('0x5'),_0x1a9e('0x6'),_0x1a9e('0x7'),_0x1a9e('0x8'),_0x1a9e('0x9')),'allowNull':!![],'defaultValue':_0x1a9e('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x1a9e('0xa')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1a9e('0xa')],'allowNull':!![],'defaultValue':_0x1a9e('0xb')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x1a9e('0xc')},'defaultEntry':{'type':Sequelize[_0x1a9e('0xd')],'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 c07d56e..13ce353 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 _0xbe32=['sequelize','files','directory','join','server/files/moh','mode','mkdirSync','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','transaction','Sound','findOne','save_name','createdAt','root','server/files/sounds/converted','extname','converted_format','%s.%s','symlinkSync','Sequelize','removeSound','id2','format','getSounds','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','save','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','update','body','create'];(function(_0x2c9d22,_0x28f65a){var _0x160346=function(_0x14e429){while(--_0x14e429){_0x2c9d22['push'](_0x2c9d22['shift']());}};_0x160346(++_0x28f65a);}(_0xbe32,0x102));var _0x2be3=function(_0x110040,_0x52f667){_0x110040=_0x110040-0x0;var _0x531cb9=_0xbe32[_0x110040];return _0x531cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be3('0x0'));var zipdir=require(_0x2be3('0x1'));var jsonpatch=require(_0x2be3('0x2'));var rp=require('request-promise');var moment=require(_0x2be3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2be3('0x4'));var util=require(_0x2be3('0x5'));var path=require(_0x2be3('0x6'));var sox=require(_0x2be3('0x7'));var csv=require(_0x2be3('0x8'));var ejs=require(_0x2be3('0x9'));var fs=require('fs');var fs_extra=require(_0x2be3('0xa'));var _=require(_0x2be3('0xb'));var squel=require('squel');var crypto=require(_0x2be3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2be3('0xd'));var toCsv=require(_0x2be3('0x8'));var querystring=require('querystring');var Papa=require(_0x2be3('0xe'));var Redis=require(_0x2be3('0xf'));var authService=require(_0x2be3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2be3('0x11'));var hardwareService=require(_0x2be3('0x12'));var logger=require(_0x2be3('0x13'))(_0x2be3('0x14'));var utils=require(_0x2be3('0x15'));var config=require(_0x2be3('0x16'));var licenseUtil=require(_0x2be3('0x17'));var db=require(_0x2be3('0x18'))['db'];function respondWithStatusCode(_0x5c4db0,_0x196842){_0x196842=_0x196842||0xcc;return function(_0x299dbb){if(_0x299dbb){return _0x5c4db0[_0x2be3('0x19')](_0x196842);}return _0x5c4db0[_0x2be3('0x1a')](_0x196842)['end']();};}function respondWithResult(_0x3e5e79,_0x552a40){_0x552a40=_0x552a40||0xc8;return function(_0x321342){if(_0x321342){return _0x3e5e79['status'](_0x552a40)['json'](_0x321342);}};}function respondWithFilteredResult(_0x40bc0a,_0x1278fa){return function(_0x26f56a){if(_0x26f56a){var _0x338571=typeof _0x1278fa['offset']===_0x2be3('0x1b')&&typeof _0x1278fa[_0x2be3('0x1c')]===_0x2be3('0x1b');var _0x553151=_0x26f56a[_0x2be3('0x1d')];var _0x151571=_0x338571?0x0:_0x1278fa[_0x2be3('0x1e')];var _0x10947e=_0x338571?_0x26f56a[_0x2be3('0x1d')]:_0x1278fa[_0x2be3('0x1e')]+_0x1278fa[_0x2be3('0x1c')];var _0x1f2a3f;if(_0x10947e>=_0x553151){_0x10947e=_0x553151;_0x1f2a3f=0xc8;}else{_0x1f2a3f=0xce;}_0x40bc0a[_0x2be3('0x1a')](_0x1f2a3f);return _0x40bc0a[_0x2be3('0x1f')](_0x2be3('0x20'),_0x151571+'-'+_0x10947e+'/'+_0x553151)['json'](_0x26f56a);}return null;};}function patchUpdates(_0x5e9d69){return function(_0x1807e7){try{jsonpatch['apply'](_0x1807e7,_0x5e9d69,!![]);}catch(_0x304a93){return BPromise['reject'](_0x304a93);}return _0x1807e7[_0x2be3('0x21')]();};}function saveUpdates(_0x164b4e,_0x1ab698){return function(_0x31e0ba){if(_0x31e0ba){return _0x31e0ba['update'](_0x164b4e)[_0x2be3('0x22')](function(_0x58ef77){return _0x58ef77;});}return null;};}function removeEntity(_0x8e75dc,_0x475a25){return function(_0x41c0d8){if(_0x41c0d8){return _0x41c0d8[_0x2be3('0x23')]()[_0x2be3('0x22')](function(){var _0x5e5928=_0x41c0d8['get']({'plain':!![]});var _0x278882=_0x2be3('0x24');return db[_0x2be3('0x25')]['destroy']({'where':{'type':_0x278882,'resourceId':_0x5e5928['id']}})['then'](function(){return _0x41c0d8;});})[_0x2be3('0x22')](function(){_0x8e75dc[_0x2be3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e693e,_0x3384b1){return function(_0x2db27c){if(!_0x2db27c){_0x5e693e['sendStatus'](0x194);}return _0x2db27c;};}function handleError(_0x18f1cb,_0x36ff6d){_0x36ff6d=_0x36ff6d||0x1f4;return function(_0x2c460c){logger[_0x2be3('0x26')](_0x2c460c['stack']);if(_0x2c460c[_0x2be3('0x27')]){delete _0x2c460c[_0x2be3('0x27')];}_0x18f1cb[_0x2be3('0x1a')](_0x36ff6d)[_0x2be3('0x28')](_0x2c460c);};}exports[_0x2be3('0x29')]=function(_0x3c4b2f,_0x3fb66b){var _0x115b2e={},_0xd95016={},_0x46df2d={'count':0x0,'rows':[]};var _0x21879c=_[_0x2be3('0x2a')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x18b229){return{'name':_0x18b229[_0x2be3('0x2b')],'type':_0x18b229[_0x2be3('0x2c')]['key']};});_0xd95016[_0x2be3('0x2d')]=_['map'](_0x21879c,'name');_0xd95016[_0x2be3('0x2e')]=_['keys'](_0x3c4b2f[_0x2be3('0x2e')]);_0xd95016[_0x2be3('0x2f')]=_[_0x2be3('0x30')](_0xd95016['model'],_0xd95016[_0x2be3('0x2e')]);_0x115b2e[_0x2be3('0x31')]=_[_0x2be3('0x30')](_0xd95016[_0x2be3('0x2d')],qs['fields'](_0x3c4b2f['query']['fields']));_0x115b2e['attributes']=_0x115b2e[_0x2be3('0x31')][_0x2be3('0x32')]?_0x115b2e['attributes']:_0xd95016[_0x2be3('0x2d')];if(!_0x3c4b2f[_0x2be3('0x2e')][_0x2be3('0x33')](_0x2be3('0x34'))){_0x115b2e[_0x2be3('0x1c')]=qs[_0x2be3('0x1c')](_0x3c4b2f[_0x2be3('0x2e')][_0x2be3('0x1c')]);_0x115b2e['offset']=qs[_0x2be3('0x1e')](_0x3c4b2f[_0x2be3('0x2e')]['offset']);}_0x115b2e['order']=qs[_0x2be3('0x35')](_0x3c4b2f[_0x2be3('0x2e')][_0x2be3('0x35')]);delete _0x3c4b2f[_0x2be3('0x2e')]['sort'];_0x115b2e['where']=qs['filters'](_[_0x2be3('0x36')](_0x3c4b2f['query'],_0xd95016['filters']),_0x21879c);if(_0x3c4b2f[_0x2be3('0x2e')]['filter']){_0x115b2e[_0x2be3('0x37')]=_[_0x2be3('0x38')](_0x115b2e[_0x2be3('0x37')],{'$or':_[_0x2be3('0x2a')](_0x21879c,function(_0x261b53){if(_0x261b53[_0x2be3('0x2c')]!==_0x2be3('0x39')){var _0x147dd3={};_0x147dd3[_0x261b53[_0x2be3('0x27')]]={'$like':'%'+_0x3c4b2f[_0x2be3('0x2e')][_0x2be3('0x3a')]+'%'};return _0x147dd3;}})});}_0x115b2e=_[_0x2be3('0x38')]({},_0x115b2e,_0x3c4b2f[_0x2be3('0x3b')]);var _0x1de6fe={'where':_0x115b2e[_0x2be3('0x37')]};return db['VoiceMusicOnHold'][_0x2be3('0x1d')](_0x1de6fe)[_0x2be3('0x22')](function(_0x212d28){_0x46df2d[_0x2be3('0x1d')]=_0x212d28;if(_0x3c4b2f[_0x2be3('0x2e')][_0x2be3('0x3c')]){_0x115b2e[_0x2be3('0x3d')]=[{'all':!![]}];}return db[_0x2be3('0x3e')][_0x2be3('0x3f')](_0x115b2e);})[_0x2be3('0x22')](function(_0x2c433c){_0x46df2d[_0x2be3('0x40')]=_0x2c433c;return _0x46df2d;})[_0x2be3('0x22')](respondWithFilteredResult(_0x3fb66b,_0x115b2e))[_0x2be3('0x41')](handleError(_0x3fb66b,null));};exports[_0x2be3('0x42')]=function(_0x57c660,_0x3de81c){var _0x3a3411={'raw':![],'where':{'id':_0x57c660[_0x2be3('0x43')]['id']}},_0x297b40={};_0x297b40[_0x2be3('0x2d')]=_['keys'](db[_0x2be3('0x3e')][_0x2be3('0x44')]);_0x297b40[_0x2be3('0x2e')]=_[_0x2be3('0x45')](_0x57c660[_0x2be3('0x2e')]);_0x297b40[_0x2be3('0x2f')]=_[_0x2be3('0x30')](_0x297b40[_0x2be3('0x2d')],_0x297b40[_0x2be3('0x2e')]);_0x3a3411[_0x2be3('0x31')]=_['intersection'](_0x297b40[_0x2be3('0x2d')],qs[_0x2be3('0x46')](_0x57c660[_0x2be3('0x2e')][_0x2be3('0x46')]));_0x3a3411['attributes']=_0x3a3411[_0x2be3('0x31')][_0x2be3('0x32')]?_0x3a3411[_0x2be3('0x31')]:_0x297b40[_0x2be3('0x2d')];if(_0x57c660['query']['includeAll']){_0x3a3411[_0x2be3('0x3d')]=[{'all':!![]}];}_0x3a3411=_['merge']({},_0x3a3411,_0x57c660[_0x2be3('0x3b')]);return db[_0x2be3('0x3e')][_0x2be3('0x47')](_0x3a3411)[_0x2be3('0x22')](handleEntityNotFound(_0x3de81c,null))[_0x2be3('0x22')](respondWithResult(_0x3de81c,null))[_0x2be3('0x41')](handleError(_0x3de81c,null));};exports[_0x2be3('0x48')]=function(_0x20f45f,_0x3bff79){if(_0x20f45f[_0x2be3('0x49')]['id']){delete _0x20f45f[_0x2be3('0x49')]['id'];}return db[_0x2be3('0x3e')][_0x2be3('0x47')]({'where':{'id':_0x20f45f[_0x2be3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3bff79,null))[_0x2be3('0x22')](saveUpdates(_0x20f45f['body'],null))['then'](respondWithResult(_0x3bff79,null))[_0x2be3('0x41')](handleError(_0x3bff79,null));};exports[_0x2be3('0x4a')]=function(_0x885942,_0x340ac4,_0x22028f){return db[_0x2be3('0x4b')]['transaction'](function(_0x2e5849){if(_0x885942['body']['mode']===_0x2be3('0x4c')){_0x885942['body'][_0x2be3('0x4d')]=path[_0x2be3('0x4e')](config['root'],_0x2be3('0x4f'),_0x885942[_0x2be3('0x49')][_0x2be3('0x27')]);}return db['VoiceMusicOnHold'][_0x2be3('0x4a')](_0x885942[_0x2be3('0x49')],{'transaction':_0x2e5849})[_0x2be3('0x22')](function(_0x18c96e){if(_0x885942[_0x2be3('0x49')][_0x2be3('0x50')]===_0x2be3('0x4c')){fs[_0x2be3('0x51')](_0x18c96e['directory'],parseInt(_0x2be3('0x52'),0x8));}var _0x16a639=_0x885942['user'][_0x2be3('0x53')]({'plain':!![]});if(!_0x16a639)throw new Error(_0x2be3('0x54'));if(_0x16a639[_0x2be3('0x55')]==='user'){var _0x2c7e70=_0x18c96e[_0x2be3('0x53')]({'plain':!![]});return db['UserProfileSection'][_0x2be3('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x16a639[_0x2be3('0x56')]},'raw':!![]})[_0x2be3('0x22')](function(_0x4f4104){if(_0x4f4104&&_0x4f4104[_0x2be3('0x57')]===0x0){return db[_0x2be3('0x25')][_0x2be3('0x4a')]({'name':_0x2c7e70[_0x2be3('0x27')],'resourceId':_0x2c7e70['id'],'type':_0x4f4104[_0x2be3('0x27')],'sectionId':_0x4f4104['id']},{})[_0x2be3('0x22')](function(){return _0x18c96e;});}else{return _0x18c96e;}})[_0x2be3('0x41')](function(_0x27e743){logger[_0x2be3('0x26')](_0x2be3('0x58'),_0x27e743);});}return _0x18c96e;});})[_0x2be3('0x22')](respondWithResult(_0x340ac4,0xc9))[_0x2be3('0x41')](handleError(_0x340ac4,null));};exports[_0x2be3('0x23')]=function(_0xbc47ef,_0x2f516b,_0x5a6787){var _0x45068f;return db[_0x2be3('0x3e')][_0x2be3('0x47')]({'where':{'id':_0xbc47ef[_0x2be3('0x43')]['id']}})[_0x2be3('0x22')](function(_0xd9b7e6){if(_0xd9b7e6){return db[_0x2be3('0x4b')]['transaction'](function(_0x53d741){return _0xd9b7e6[_0x2be3('0x23')]({'transaction':_0x53d741,'raw':!![]})[_0x2be3('0x22')](function(_0x7cbed9){if(_0x7cbed9['directory']){fs[_0x2be3('0x59')](_0x7cbed9['directory'])[_0x2be3('0x5a')](function(_0x5f0f8a){fs[_0x2be3('0x5b')](path[_0x2be3('0x4e')](_0x7cbed9[_0x2be3('0x4d')],_0x5f0f8a));});fs[_0x2be3('0x5c')](_0x7cbed9['directory']);}return _0x7cbed9;});})['catch'](function(_0x268549){throw new db['Sequelize'][(_0x2be3('0x5d'))](_0x268549[_0x2be3('0x5e')]);});}})[_0x2be3('0x22')](handleEntityNotFound(_0x2f516b,null))[_0x2be3('0x22')](removeEntity(_0x2f516b,null))[_0x2be3('0x41')](handleError(_0x2f516b,null));};exports['addSound']=function(_0x240432,_0x51dac7,_0x23c586){return db[_0x2be3('0x4b')][_0x2be3('0x5f')](function(_0x3e339c){var _0x186336;return db['VoiceMusicOnHold'][_0x2be3('0x47')]({'where':{'id':_0x240432[_0x2be3('0x43')]['id']}})[_0x2be3('0x22')](function(_0xa0e66d){if(_0xa0e66d){_0x186336=_0xa0e66d;return _0xa0e66d['addSound'](_0x240432['body']['id'],{'transaction':_0x3e339c});}})['then'](function(_0x1902c1){if(_0x1902c1){return db[_0x2be3('0x60')][_0x2be3('0x61')]({'where':{'id':_0x240432['body']['id']},'attributes':['id',_0x2be3('0x27'),_0x2be3('0x62'),'converted_format',_0x2be3('0x63')],'raw':!![]});}})['then'](function(_0x1509f5){if(_0x1509f5){var _0x438c65=path[_0x2be3('0x4e')](config[_0x2be3('0x64')],_0x2be3('0x65'),util['format']('%s.%s',path['basename'](_0x1509f5['save_name'],path[_0x2be3('0x66')](_0x1509f5[_0x2be3('0x62')])),_0x1509f5[_0x2be3('0x67')]));var _0x135036=path[_0x2be3('0x4e')](config[_0x2be3('0x64')],_0x2be3('0x4f'),_0x186336[_0x2be3('0x27')],util['format'](_0x2be3('0x68'),_0x1509f5[_0x2be3('0x27')],_0x1509f5[_0x2be3('0x67')]));fs[_0x2be3('0x69')](_0x438c65,_0x135036);return _0x1509f5;}})[_0x2be3('0x41')](function(_0x360476){throw new db[(_0x2be3('0x6a'))][(_0x2be3('0x5d'))](_0x360476[_0x2be3('0x5e')]);});})[_0x2be3('0x22')](handleEntityNotFound(_0x51dac7,null))[_0x2be3('0x22')](respondWithResult(_0x51dac7,0xc9))[_0x2be3('0x41')](handleError(_0x51dac7,null));};exports[_0x2be3('0x6b')]=function(_0x4e092f,_0x16939c,_0x586f38){return db[_0x2be3('0x4b')][_0x2be3('0x5f')](function(_0x4e47d2){var _0x52f46f;return db[_0x2be3('0x3e')]['findOne']({'where':{'id':_0x4e092f['params']['id']}})[_0x2be3('0x22')](handleEntityNotFound(_0x16939c,null))[_0x2be3('0x22')](function(_0x27141e){if(_0x27141e){_0x52f46f=_0x27141e;return _0x27141e[_0x2be3('0x6b')](_0x4e092f[_0x2be3('0x43')]['id2']);}})['then'](function(_0x441792){if(_0x441792){return db[_0x2be3('0x60')][_0x2be3('0x61')]({'where':{'id':_0x4e092f['params'][_0x2be3('0x6c')]},'attributes':['id','name',_0x2be3('0x62'),'converted_format',_0x2be3('0x63')],'raw':!![]});}})[_0x2be3('0x22')](function(_0x3b8816){if(_0x3b8816){fs['unlinkSync'](path[_0x2be3('0x4e')](_0x52f46f['directory'],util[_0x2be3('0x6d')]('%s.%s',_0x3b8816[_0x2be3('0x27')],_0x3b8816['converted_format'])));return _0x3b8816;}})['catch'](function(_0x564b38){throw new db['Sequelize']['ValidationError'](_0x564b38['message']);});})[_0x2be3('0x22')](handleEntityNotFound(_0x16939c,null))[_0x2be3('0x22')](respondWithStatusCode(_0x16939c,0xcc))[_0x2be3('0x41')](handleError(_0x16939c,null));};exports[_0x2be3('0x6e')]=function(_0x173bd8,_0x24ae2e,_0x1e5f0e){var _0x208db8={};var _0x532523={};var _0x3217ac;var _0x54500b;return db[_0x2be3('0x3e')][_0x2be3('0x61')]({'where':{'id':_0x173bd8[_0x2be3('0x43')]['id']}})[_0x2be3('0x22')](handleEntityNotFound(_0x24ae2e,null))[_0x2be3('0x22')](function(_0xda1339){if(_0xda1339){_0x3217ac=_0xda1339;_0x532523[_0x2be3('0x2d')]=_[_0x2be3('0x45')](db[_0x2be3('0x60')][_0x2be3('0x44')]);_0x532523['query']=_[_0x2be3('0x45')](_0x173bd8[_0x2be3('0x2e')]);_0x532523[_0x2be3('0x2f')]=_[_0x2be3('0x30')](_0x532523[_0x2be3('0x2d')],_0x532523[_0x2be3('0x2e')]);_0x208db8[_0x2be3('0x31')]=_[_0x2be3('0x30')](_0x532523[_0x2be3('0x2d')],qs['fields'](_0x173bd8[_0x2be3('0x2e')]['fields']));_0x208db8[_0x2be3('0x31')]=_0x208db8[_0x2be3('0x31')][_0x2be3('0x32')]?_0x208db8['attributes']:_0x532523[_0x2be3('0x2d')];_0x208db8['order']=qs[_0x2be3('0x35')](_0x173bd8[_0x2be3('0x2e')][_0x2be3('0x35')]);_0x208db8['where']=qs[_0x2be3('0x2f')](_[_0x2be3('0x36')](_0x173bd8[_0x2be3('0x2e')],_0x532523['filters']));if(_0x173bd8['query'][_0x2be3('0x3a')]){_0x208db8[_0x2be3('0x37')]=_['merge'](_0x208db8[_0x2be3('0x37')],{'$or':_[_0x2be3('0x2a')](_0x208db8[_0x2be3('0x31')],function(_0x289603){var _0x2b4724={};_0x2b4724[_0x289603]={'$like':'%'+_0x173bd8[_0x2be3('0x2e')][_0x2be3('0x3a')]+'%'};return _0x2b4724;})});}_0x208db8=_['merge']({},_0x208db8,_0x173bd8[_0x2be3('0x3b')]);return _0x3217ac[_0x2be3('0x6e')](_0x208db8);}})[_0x2be3('0x22')](function(_0xa9f4a){if(_0xa9f4a){_0x54500b=_0xa9f4a[_0x2be3('0x32')];if(!_0x173bd8[_0x2be3('0x2e')]['hasOwnProperty'](_0x2be3('0x34'))){_0x208db8[_0x2be3('0x1c')]=qs['limit'](_0x173bd8[_0x2be3('0x2e')]['limit']);_0x208db8[_0x2be3('0x1e')]=qs[_0x2be3('0x1e')](_0x173bd8[_0x2be3('0x2e')][_0x2be3('0x1e')]);}return _0x3217ac['getSounds'](_0x208db8);}})[_0x2be3('0x22')](function(_0x11785f){if(_0x11785f){return _0x11785f?{'count':_0x54500b,'rows':_0x11785f}:null;}})[_0x2be3('0x22')](respondWithResult(_0x24ae2e,null))[_0x2be3('0x41')](handleError(_0x24ae2e,null));}; \ No newline at end of file +var _0xd648=['files','directory','join','root','server/files/moh','mkdirSync','0777','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','sequelize','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','symlinkSync','Sequelize','removeSound','findOne','id2','Sound','options','getSounds','hasOwnProperty','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','find','body','params','create','transaction','mode'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xd648,0x92));var _0x8d64=function(_0x13603f,_0x26bf41){_0x13603f=_0x13603f-0x0;var _0x428f22=_0xd648[_0x13603f];return _0x428f22;};'use strict';var emlformat=require(_0x8d64('0x0'));var rimraf=require(_0x8d64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d64('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8d64('0x3'));var util=require(_0x8d64('0x4'));var path=require(_0x8d64('0x5'));var sox=require(_0x8d64('0x6'));var csv=require(_0x8d64('0x7'));var ejs=require(_0x8d64('0x8'));var fs=require('fs');var fs_extra=require(_0x8d64('0x9'));var _=require(_0x8d64('0xa'));var squel=require(_0x8d64('0xb'));var crypto=require('crypto');var jsforce=require(_0x8d64('0xc'));var deskjs=require(_0x8d64('0xd'));var toCsv=require(_0x8d64('0x7'));var querystring=require(_0x8d64('0xe'));var Papa=require(_0x8d64('0xf'));var Redis=require(_0x8d64('0x10'));var authService=require(_0x8d64('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8d64('0x12'));var hardwareService=require(_0x8d64('0x13'));var logger=require(_0x8d64('0x14'))('api');var utils=require(_0x8d64('0x15'));var config=require(_0x8d64('0x16'));var licenseUtil=require(_0x8d64('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2963c6,_0x178f9d){_0x178f9d=_0x178f9d||0xcc;return function(_0x303174){if(_0x303174){return _0x2963c6[_0x8d64('0x18')](_0x178f9d);}return _0x2963c6[_0x8d64('0x19')](_0x178f9d)[_0x8d64('0x1a')]();};}function respondWithResult(_0x115e28,_0x56eee9){_0x56eee9=_0x56eee9||0xc8;return function(_0xb53cc3){if(_0xb53cc3){return _0x115e28[_0x8d64('0x19')](_0x56eee9)[_0x8d64('0x1b')](_0xb53cc3);}};}function respondWithFilteredResult(_0x15bfad,_0x3cb8ae){return function(_0x51d694){if(_0x51d694){var _0x526c37=typeof _0x3cb8ae[_0x8d64('0x1c')]===_0x8d64('0x1d')&&typeof _0x3cb8ae[_0x8d64('0x1e')]===_0x8d64('0x1d');var _0x2352a5=_0x51d694[_0x8d64('0x1f')];var _0x27ada4=_0x526c37?0x0:_0x3cb8ae[_0x8d64('0x1c')];var _0x5c064a=_0x526c37?_0x51d694['count']:_0x3cb8ae[_0x8d64('0x1c')]+_0x3cb8ae[_0x8d64('0x1e')];var _0x58110d;if(_0x5c064a>=_0x2352a5){_0x5c064a=_0x2352a5;_0x58110d=0xc8;}else{_0x58110d=0xce;}_0x15bfad['status'](_0x58110d);return _0x15bfad[_0x8d64('0x20')](_0x8d64('0x21'),_0x27ada4+'-'+_0x5c064a+'/'+_0x2352a5)[_0x8d64('0x1b')](_0x51d694);}return null;};}function patchUpdates(_0x6c07a3){return function(_0x53d1f9){try{jsonpatch['apply'](_0x53d1f9,_0x6c07a3,!![]);}catch(_0x43916a){return BPromise[_0x8d64('0x22')](_0x43916a);}return _0x53d1f9[_0x8d64('0x23')]();};}function saveUpdates(_0x4d812e,_0xb9a33f){return function(_0x5e1553){if(_0x5e1553){return _0x5e1553[_0x8d64('0x24')](_0x4d812e)[_0x8d64('0x25')](function(_0x303efc){return _0x303efc;});}return null;};}function removeEntity(_0x310ae0,_0x2017fd){return function(_0x2bbe37){if(_0x2bbe37){return _0x2bbe37['destroy']()[_0x8d64('0x25')](function(){var _0x908930=_0x2bbe37[_0x8d64('0x26')]({'plain':!![]});var _0x172357=_0x8d64('0x27');return db[_0x8d64('0x28')][_0x8d64('0x29')]({'where':{'type':_0x172357,'resourceId':_0x908930['id']}})[_0x8d64('0x25')](function(){return _0x2bbe37;});})['then'](function(){_0x310ae0[_0x8d64('0x19')](0xcc)[_0x8d64('0x1a')]();});}};}function handleEntityNotFound(_0x190df6,_0x2429e7){return function(_0x22662a){if(!_0x22662a){_0x190df6[_0x8d64('0x18')](0x194);}return _0x22662a;};}function handleError(_0x23fcec,_0x300d55){_0x300d55=_0x300d55||0x1f4;return function(_0x49c7fd){logger[_0x8d64('0x2a')](_0x49c7fd[_0x8d64('0x2b')]);if(_0x49c7fd[_0x8d64('0x2c')]){delete _0x49c7fd[_0x8d64('0x2c')];}_0x23fcec[_0x8d64('0x19')](_0x300d55)[_0x8d64('0x2d')](_0x49c7fd);};}exports['index']=function(_0x511a97,_0x4ef447){var _0x279461={},_0x39f431={},_0x5c840e={'count':0x0,'rows':[]};var _0x2d0bf1=_[_0x8d64('0x2e')](db[_0x8d64('0x2f')][_0x8d64('0x30')],function(_0x50ddaf){return{'name':_0x50ddaf['fieldName'],'type':_0x50ddaf[_0x8d64('0x31')][_0x8d64('0x32')]};});_0x39f431[_0x8d64('0x33')]=_[_0x8d64('0x2e')](_0x2d0bf1,_0x8d64('0x2c'));_0x39f431[_0x8d64('0x34')]=_[_0x8d64('0x35')](_0x511a97[_0x8d64('0x34')]);_0x39f431[_0x8d64('0x36')]=_[_0x8d64('0x37')](_0x39f431['model'],_0x39f431[_0x8d64('0x34')]);_0x279461[_0x8d64('0x38')]=_[_0x8d64('0x37')](_0x39f431['model'],qs[_0x8d64('0x39')](_0x511a97[_0x8d64('0x34')][_0x8d64('0x39')]));_0x279461[_0x8d64('0x38')]=_0x279461[_0x8d64('0x38')][_0x8d64('0x3a')]?_0x279461[_0x8d64('0x38')]:_0x39f431['model'];if(!_0x511a97[_0x8d64('0x34')]['hasOwnProperty'](_0x8d64('0x3b'))){_0x279461[_0x8d64('0x1e')]=qs['limit'](_0x511a97[_0x8d64('0x34')]['limit']);_0x279461[_0x8d64('0x1c')]=qs[_0x8d64('0x1c')](_0x511a97[_0x8d64('0x34')][_0x8d64('0x1c')]);}_0x279461[_0x8d64('0x3c')]=qs['sort'](_0x511a97[_0x8d64('0x34')]['sort']);delete _0x511a97[_0x8d64('0x34')][_0x8d64('0x3d')];_0x279461['where']=qs[_0x8d64('0x36')](_[_0x8d64('0x3e')](_0x511a97[_0x8d64('0x34')],_0x39f431[_0x8d64('0x36')]),_0x2d0bf1);if(_0x511a97[_0x8d64('0x34')]['filter']){_0x279461[_0x8d64('0x3f')]=_['merge'](_0x279461[_0x8d64('0x3f')],{'$or':_['map'](_0x2d0bf1,function(_0xfebb3c){if(_0xfebb3c[_0x8d64('0x31')]!==_0x8d64('0x40')){var _0x15eb9e={};_0x15eb9e[_0xfebb3c[_0x8d64('0x2c')]]={'$like':'%'+_0x511a97['query'][_0x8d64('0x41')]+'%'};return _0x15eb9e;}})});}_0x279461=_[_0x8d64('0x42')]({},_0x279461,_0x511a97['options']);var _0x5821fb={'where':_0x279461[_0x8d64('0x3f')]};return db[_0x8d64('0x2f')][_0x8d64('0x1f')](_0x5821fb)[_0x8d64('0x25')](function(_0x5d57ef){_0x5c840e['count']=_0x5d57ef;if(_0x511a97['query'][_0x8d64('0x43')]){_0x279461[_0x8d64('0x44')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x8d64('0x45')](_0x279461);})[_0x8d64('0x25')](function(_0x4296ae){_0x5c840e[_0x8d64('0x46')]=_0x4296ae;return _0x5c840e;})[_0x8d64('0x25')](respondWithFilteredResult(_0x4ef447,_0x279461))[_0x8d64('0x47')](handleError(_0x4ef447,null));};exports['show']=function(_0x27cf93,_0x10e376){var _0x2ebe78={'raw':![],'where':{'id':_0x27cf93['params']['id']}},_0x5da46d={};_0x5da46d[_0x8d64('0x33')]=_['keys'](db[_0x8d64('0x2f')][_0x8d64('0x30')]);_0x5da46d['query']=_[_0x8d64('0x35')](_0x27cf93['query']);_0x5da46d['filters']=_['intersection'](_0x5da46d[_0x8d64('0x33')],_0x5da46d['query']);_0x2ebe78['attributes']=_['intersection'](_0x5da46d[_0x8d64('0x33')],qs['fields'](_0x27cf93[_0x8d64('0x34')][_0x8d64('0x39')]));_0x2ebe78['attributes']=_0x2ebe78[_0x8d64('0x38')]['length']?_0x2ebe78['attributes']:_0x5da46d[_0x8d64('0x33')];if(_0x27cf93['query'][_0x8d64('0x43')]){_0x2ebe78['include']=[{'all':!![]}];}_0x2ebe78=_[_0x8d64('0x42')]({},_0x2ebe78,_0x27cf93['options']);return db[_0x8d64('0x2f')][_0x8d64('0x48')](_0x2ebe78)[_0x8d64('0x25')](handleEntityNotFound(_0x10e376,null))[_0x8d64('0x25')](respondWithResult(_0x10e376,null))[_0x8d64('0x47')](handleError(_0x10e376,null));};exports[_0x8d64('0x24')]=function(_0xd87fff,_0x6ce8d){if(_0xd87fff[_0x8d64('0x49')]['id']){delete _0xd87fff[_0x8d64('0x49')]['id'];}return db[_0x8d64('0x2f')][_0x8d64('0x48')]({'where':{'id':_0xd87fff[_0x8d64('0x4a')]['id']}})[_0x8d64('0x25')](handleEntityNotFound(_0x6ce8d,null))[_0x8d64('0x25')](saveUpdates(_0xd87fff[_0x8d64('0x49')],null))[_0x8d64('0x25')](respondWithResult(_0x6ce8d,null))[_0x8d64('0x47')](handleError(_0x6ce8d,null));};exports[_0x8d64('0x4b')]=function(_0x1e2865,_0x441de9,_0x372f55){return db['sequelize'][_0x8d64('0x4c')](function(_0x57302d){if(_0x1e2865[_0x8d64('0x49')][_0x8d64('0x4d')]===_0x8d64('0x4e')){_0x1e2865[_0x8d64('0x49')][_0x8d64('0x4f')]=path[_0x8d64('0x50')](config[_0x8d64('0x51')],_0x8d64('0x52'),_0x1e2865['body'][_0x8d64('0x2c')]);}return db[_0x8d64('0x2f')][_0x8d64('0x4b')](_0x1e2865[_0x8d64('0x49')],{'transaction':_0x57302d})[_0x8d64('0x25')](function(_0x17c6fa){if(_0x1e2865['body']['mode']===_0x8d64('0x4e')){fs[_0x8d64('0x53')](_0x17c6fa[_0x8d64('0x4f')],parseInt(_0x8d64('0x54'),0x8));}var _0x596ba6=_0x1e2865[_0x8d64('0x55')]['get']({'plain':!![]});if(!_0x596ba6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596ba6['role']===_0x8d64('0x55')){var _0x7743b9=_0x17c6fa[_0x8d64('0x26')]({'plain':!![]});return db[_0x8d64('0x56')][_0x8d64('0x48')]({'where':{'name':_0x8d64('0x27'),'userProfileId':_0x596ba6[_0x8d64('0x57')]},'raw':!![]})['then'](function(_0x534faf){if(_0x534faf&&_0x534faf['autoAssociation']===0x0){return db[_0x8d64('0x28')]['create']({'name':_0x7743b9[_0x8d64('0x2c')],'resourceId':_0x7743b9['id'],'type':_0x534faf[_0x8d64('0x2c')],'sectionId':_0x534faf['id']},{})['then'](function(){return _0x17c6fa;});}else{return _0x17c6fa;}})[_0x8d64('0x47')](function(_0x944838){logger[_0x8d64('0x2a')](_0x8d64('0x58'),_0x944838);});}return _0x17c6fa;});})[_0x8d64('0x25')](respondWithResult(_0x441de9,0xc9))[_0x8d64('0x47')](handleError(_0x441de9,null));};exports[_0x8d64('0x29')]=function(_0x25cd58,_0x312bb4,_0x241cc4){var _0x48d229;return db[_0x8d64('0x2f')][_0x8d64('0x48')]({'where':{'id':_0x25cd58[_0x8d64('0x4a')]['id']}})[_0x8d64('0x25')](function(_0x55c840){if(_0x55c840){return db['sequelize'][_0x8d64('0x4c')](function(_0x2d3105){return _0x55c840['destroy']({'transaction':_0x2d3105,'raw':!![]})[_0x8d64('0x25')](function(_0x3163a7){if(_0x3163a7['directory']){fs['readdirSync'](_0x3163a7[_0x8d64('0x4f')])[_0x8d64('0x59')](function(_0x50452e){fs[_0x8d64('0x5a')](path[_0x8d64('0x50')](_0x3163a7['directory'],_0x50452e));});fs[_0x8d64('0x5b')](_0x3163a7['directory']);}return _0x3163a7;});})['catch'](function(_0x30966a){throw new db['Sequelize'][(_0x8d64('0x5c'))](_0x30966a[_0x8d64('0x5d')]);});}})[_0x8d64('0x25')](handleEntityNotFound(_0x312bb4,null))[_0x8d64('0x25')](removeEntity(_0x312bb4,null))[_0x8d64('0x47')](handleError(_0x312bb4,null));};exports[_0x8d64('0x5e')]=function(_0x23b581,_0x52af27,_0x19e835){return db[_0x8d64('0x5f')]['transaction'](function(_0x22a7c8){var _0x31560b;return db[_0x8d64('0x2f')][_0x8d64('0x48')]({'where':{'id':_0x23b581[_0x8d64('0x4a')]['id']}})[_0x8d64('0x25')](function(_0x2fa402){if(_0x2fa402){_0x31560b=_0x2fa402;return _0x2fa402[_0x8d64('0x5e')](_0x23b581['body']['id'],{'transaction':_0x22a7c8});}})[_0x8d64('0x25')](function(_0x4bf936){if(_0x4bf936){return db['Sound']['findOne']({'where':{'id':_0x23b581[_0x8d64('0x49')]['id']},'attributes':['id',_0x8d64('0x2c'),'save_name',_0x8d64('0x60'),_0x8d64('0x61')],'raw':!![]});}})[_0x8d64('0x25')](function(_0x4302d8){if(_0x4302d8){var _0xd5a1f=path[_0x8d64('0x50')](config['root'],_0x8d64('0x62'),util[_0x8d64('0x63')](_0x8d64('0x64'),path[_0x8d64('0x65')](_0x4302d8[_0x8d64('0x66')],path['extname'](_0x4302d8[_0x8d64('0x66')])),_0x4302d8[_0x8d64('0x60')]));var _0x5144c1=path[_0x8d64('0x50')](config[_0x8d64('0x51')],_0x8d64('0x52'),_0x31560b[_0x8d64('0x2c')],util[_0x8d64('0x63')](_0x8d64('0x64'),_0x4302d8[_0x8d64('0x2c')],_0x4302d8[_0x8d64('0x60')]));fs[_0x8d64('0x67')](_0xd5a1f,_0x5144c1);return _0x4302d8;}})['catch'](function(_0x4c0461){throw new db[(_0x8d64('0x68'))]['ValidationError'](_0x4c0461[_0x8d64('0x5d')]);});})[_0x8d64('0x25')](handleEntityNotFound(_0x52af27,null))[_0x8d64('0x25')](respondWithResult(_0x52af27,0xc9))['catch'](handleError(_0x52af27,null));};exports[_0x8d64('0x69')]=function(_0x4d5c4f,_0x21b14d,_0x22a610){return db[_0x8d64('0x5f')][_0x8d64('0x4c')](function(_0x2dbb4f){var _0x18c6ce;return db[_0x8d64('0x2f')][_0x8d64('0x6a')]({'where':{'id':_0x4d5c4f['params']['id']}})[_0x8d64('0x25')](handleEntityNotFound(_0x21b14d,null))[_0x8d64('0x25')](function(_0x57cad4){if(_0x57cad4){_0x18c6ce=_0x57cad4;return _0x57cad4[_0x8d64('0x69')](_0x4d5c4f[_0x8d64('0x4a')][_0x8d64('0x6b')]);}})[_0x8d64('0x25')](function(_0x518b1a){if(_0x518b1a){return db[_0x8d64('0x6c')][_0x8d64('0x6a')]({'where':{'id':_0x4d5c4f['params'][_0x8d64('0x6b')]},'attributes':['id',_0x8d64('0x2c'),_0x8d64('0x66'),_0x8d64('0x60'),_0x8d64('0x61')],'raw':!![]});}})[_0x8d64('0x25')](function(_0x4fe399){if(_0x4fe399){fs['unlinkSync'](path['join'](_0x18c6ce[_0x8d64('0x4f')],util['format']('%s.%s',_0x4fe399['name'],_0x4fe399[_0x8d64('0x60')])));return _0x4fe399;}})[_0x8d64('0x47')](function(_0x2e24fd){throw new db[(_0x8d64('0x68'))][(_0x8d64('0x5c'))](_0x2e24fd[_0x8d64('0x5d')]);});})[_0x8d64('0x25')](handleEntityNotFound(_0x21b14d,null))[_0x8d64('0x25')](respondWithStatusCode(_0x21b14d,0xcc))[_0x8d64('0x47')](handleError(_0x21b14d,null));};exports['getSounds']=function(_0x57b2b9,_0x59acd9,_0x2d4033){var _0x324db6={};var _0x8102a8={};var _0x20f09a;var _0x40dd30;return db[_0x8d64('0x2f')][_0x8d64('0x6a')]({'where':{'id':_0x57b2b9[_0x8d64('0x4a')]['id']}})[_0x8d64('0x25')](handleEntityNotFound(_0x59acd9,null))[_0x8d64('0x25')](function(_0x2ca8b0){if(_0x2ca8b0){_0x20f09a=_0x2ca8b0;_0x8102a8[_0x8d64('0x33')]=_[_0x8d64('0x35')](db['Sound']['rawAttributes']);_0x8102a8[_0x8d64('0x34')]=_['keys'](_0x57b2b9[_0x8d64('0x34')]);_0x8102a8[_0x8d64('0x36')]=_['intersection'](_0x8102a8[_0x8d64('0x33')],_0x8102a8[_0x8d64('0x34')]);_0x324db6[_0x8d64('0x38')]=_[_0x8d64('0x37')](_0x8102a8[_0x8d64('0x33')],qs[_0x8d64('0x39')](_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x39')]));_0x324db6[_0x8d64('0x38')]=_0x324db6[_0x8d64('0x38')][_0x8d64('0x3a')]?_0x324db6[_0x8d64('0x38')]:_0x8102a8[_0x8d64('0x33')];_0x324db6['order']=qs[_0x8d64('0x3d')](_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x3d')]);_0x324db6['where']=qs[_0x8d64('0x36')](_['pick'](_0x57b2b9[_0x8d64('0x34')],_0x8102a8[_0x8d64('0x36')]));if(_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x41')]){_0x324db6['where']=_['merge'](_0x324db6[_0x8d64('0x3f')],{'$or':_[_0x8d64('0x2e')](_0x324db6[_0x8d64('0x38')],function(_0x3aeb14){var _0x313b58={};_0x313b58[_0x3aeb14]={'$like':'%'+_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x41')]+'%'};return _0x313b58;})});}_0x324db6=_[_0x8d64('0x42')]({},_0x324db6,_0x57b2b9[_0x8d64('0x6d')]);return _0x20f09a[_0x8d64('0x6e')](_0x324db6);}})['then'](function(_0xdfc7c3){if(_0xdfc7c3){_0x40dd30=_0xdfc7c3[_0x8d64('0x3a')];if(!_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x6f')](_0x8d64('0x3b'))){_0x324db6[_0x8d64('0x1e')]=qs['limit'](_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x1e')]);_0x324db6[_0x8d64('0x1c')]=qs[_0x8d64('0x1c')](_0x57b2b9[_0x8d64('0x34')][_0x8d64('0x1c')]);}return _0x20f09a['getSounds'](_0x324db6);}})[_0x8d64('0x25')](function(_0x8c9d70){if(_0x8c9d70){return _0x8c9d70?{'count':_0x40dd30,'rows':_0x8c9d70}:null;}})[_0x8d64('0x25')](respondWithResult(_0x59acd9,null))['catch'](handleError(_0x59acd9,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 950028b..0fff968 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 _0xbff2=['./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbff2,0xf3));var _0x2bff=function(_0x4c5048,_0x4b519a){_0x4c5048=_0x4c5048-0x0;var _0x22e1c7=_0xbff2[_0x4c5048];return _0x22e1c7;};'use strict';var _=require(_0x2bff('0x0'));var util=require('util');var logger=require(_0x2bff('0x1'))(_0x2bff('0x2'));var moment=require(_0x2bff('0x3'));var BPromise=require(_0x2bff('0x4'));var rp=require(_0x2bff('0x5'));var fs=require('fs');var path=require(_0x2bff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2bff('0x7'));module['exports']=function(_0x4f6701,_0x43096d){return _0x4f6701[_0x2bff('0x8')](_0x2bff('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2caa=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x83487c,_0x1104d8){var _0x25ce18=function(_0x5814dd){while(--_0x5814dd){_0x83487c['push'](_0x83487c['shift']());}};_0x25ce18(++_0x1104d8);}(_0x2caa,0x1d1));var _0xa2ca=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x2caa[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0xa2ca('0x0'));var util=require(_0xa2ca('0x1'));var logger=require(_0xa2ca('0x2'))(_0xa2ca('0x3'));var moment=require('moment');var BPromise=require(_0xa2ca('0x4'));var rp=require(_0xa2ca('0x5'));var fs=require('fs');var path=require(_0xa2ca('0x6'));var rimraf=require(_0xa2ca('0x7'));var config=require(_0xa2ca('0x8'));var attributes=require(_0xa2ca('0x9'));module[_0xa2ca('0xa')]=function(_0x9806db,_0x5c4828){return _0x9806db[_0xa2ca('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0xa2ca('0xc'),'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 bc5459f..58f8302 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1335cc,_0x1334c5){var _0x51ad4f=function(_0x6d6086){while(--_0x6d6086){_0x1335cc['push'](_0x1335cc['shift']());}};_0x51ad4f(++_0x1334c5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x380548,_0x93130c){var _0x2ef644=function(_0x309fac){while(--_0x309fac){_0x380548['push'](_0x380548['shift']());}};_0x2ef644(++_0x93130c);}(_0x70e0,0x17b));var _0x070e=function(_0x38a9fc,_0x4af67c){_0x38a9fc=_0x38a9fc-0x0;var _0x2924e6=_0x70e0[_0x38a9fc];return _0x2924e6;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6ba520f..40661b5 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 _0xa22a=['/describe','isAuthenticated','describe','/:id/users','getAgents','post','create','addAgents','/:id/teams','put','/:id','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa22a,0x153));var _0xaa22=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa22a[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xaa22('0x0'));var util=require(_0xaa22('0x1'));var path=require(_0xaa22('0x2'));var timeout=require(_0xaa22('0x3'));var express=require(_0xaa22('0x4'));var router=express['Router']();var fs_extra=require(_0xaa22('0x5'));var auth=require(_0xaa22('0x6'));var interaction=require(_0xaa22('0x7'));var config=require(_0xaa22('0x8'));var controller=require(_0xaa22('0x9'));router[_0xaa22('0xa')]('/',auth['isAuthenticated'](),controller[_0xaa22('0xb')]);router['get'](_0xaa22('0xc'),auth[_0xaa22('0xd')](),controller[_0xaa22('0xe')]);router[_0xaa22('0xa')]('/:id',auth[_0xaa22('0xd')](),controller['show']);router[_0xaa22('0xa')](_0xaa22('0xf'),auth['isAuthenticated'](),controller[_0xaa22('0x10')]);router['get']('/:id/teams',auth[_0xaa22('0xd')](),controller['getTeams']);router[_0xaa22('0x11')]('/',auth[_0xaa22('0xd')](),controller[_0xaa22('0x12')]);router[_0xaa22('0x11')](_0xaa22('0xf'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x13')]);router[_0xaa22('0x11')](_0xaa22('0x14'),auth[_0xaa22('0xd')](),controller['addTeams']);router[_0xaa22('0x15')](_0xaa22('0x16'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x17')]);router[_0xaa22('0x18')](_0xaa22('0x16'),auth['isAuthenticated'](),controller['destroy']);router[_0xaa22('0x18')](_0xaa22('0xf'),auth[_0xaa22('0xd')](),controller[_0xaa22('0x19')]);router[_0xaa22('0x18')](_0xaa22('0x14'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xaa22('0x1a')]=router; \ No newline at end of file +var _0x50d0=['create','addAgents','destroy','delete','removeAgents','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','/:id/users','/:id/teams','getTeams','post'];(function(_0xac2a8c,_0x3e0313){var _0x16c23f=function(_0x18cd35){while(--_0x18cd35){_0xac2a8c['push'](_0xac2a8c['shift']());}};_0x16c23f(++_0x3e0313);}(_0x50d0,0x101));var _0x050d=function(_0x235d61,_0x13e090){_0x235d61=_0x235d61-0x0;var _0x44d085=_0x50d0[_0x235d61];return _0x44d085;};'use strict';var multer=require(_0x050d('0x0'));var util=require('util');var path=require(_0x050d('0x1'));var timeout=require(_0x050d('0x2'));var express=require(_0x050d('0x3'));var router=express[_0x050d('0x4')]();var fs_extra=require(_0x050d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x050d('0x6'));var config=require(_0x050d('0x7'));var controller=require(_0x050d('0x8'));router[_0x050d('0x9')]('/',auth[_0x050d('0xa')](),controller[_0x050d('0xb')]);router[_0x050d('0x9')](_0x050d('0xc'),auth[_0x050d('0xa')](),controller['describe']);router[_0x050d('0x9')](_0x050d('0xd'),auth[_0x050d('0xa')](),controller['show']);router[_0x050d('0x9')](_0x050d('0xe'),auth[_0x050d('0xa')](),controller['getAgents']);router['get'](_0x050d('0xf'),auth[_0x050d('0xa')](),controller[_0x050d('0x10')]);router[_0x050d('0x11')]('/',auth[_0x050d('0xa')](),controller[_0x050d('0x12')]);router['post']('/:id/users',auth[_0x050d('0xa')](),controller[_0x050d('0x13')]);router[_0x050d('0x11')](_0x050d('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x050d('0xa')](),controller[_0x050d('0x14')]);router[_0x050d('0x15')](_0x050d('0xe'),auth[_0x050d('0xa')](),controller[_0x050d('0x16')]);router[_0x050d('0x15')](_0x050d('0xf'),auth[_0x050d('0xa')](),controller[_0x050d('0x17')]);module[_0x050d('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 8b1286b..6ae6c43 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 _0x8d96=['name','VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x8d96,0x1c0));var _0x68d9=function(_0x5257bf,_0xf39844){_0x5257bf=_0x5257bf-0x0;var _0x30f32b=_0x8d96[_0x5257bf];return _0x30f32b;};'use strict';var Sequelize=require(_0x68d9('0x0'));module[_0x68d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x68d9('0x2')},'prefix':{'type':Sequelize[_0x68d9('0x3')],'get':function(_0x393431){return'system-'+this[_0x68d9('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x68d9('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0d47=['name','INTEGER','sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0xeb3cdd,_0x321f27){var _0x2f6fce=function(_0x24660d){while(--_0x24660d){_0xeb3cdd['push'](_0xeb3cdd['shift']());}};_0x2f6fce(++_0x321f27);}(_0x0d47,0x72));var _0x70d4=function(_0x18e9b3,_0xd99a2a){_0x18e9b3=_0x18e9b3-0x0;var _0x880f2=_0x0d47[_0x18e9b3];return _0x880f2;};'use strict';var Sequelize=require(_0x70d4('0x0'));module[_0x70d4('0x1')]={'name':{'type':Sequelize[_0x70d4('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x70d4('0x3')],'get':function(_0x189217){return _0x70d4('0x4')+this[_0x70d4('0x5')](_0x70d4('0x6'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x70d4('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f864870..61a78b0 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x351d=['isEmpty','forEach','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','VoicePrefixes','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','VoicePrefix','findAll','catch','show','params','length','merge','options','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','CDR(prefix)=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x351d,0x90));var _0xd351=function(_0x5a0889,_0x53db46){_0x5a0889=_0x5a0889-0x0;var _0x5421f3=_0x351d[_0x5a0889];return _0x5421f3;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd351('0x13')]=_[_0xd351('0x14')](config[_0xd351('0x13')],{'host':_0xd351('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd351('0x13')]));require(_0xd351('0x16'))['register'](socket);function respondWithStatusCode(_0xc5a145,_0xb106ef){_0xb106ef=_0xb106ef||0xcc;return function(_0x3c2299){if(_0x3c2299){return _0xc5a145[_0xd351('0x17')](_0xb106ef);}return _0xc5a145[_0xd351('0x18')](_0xb106ef)['end']();};}function respondWithResult(_0x9f790f,_0x49d8bb){_0x49d8bb=_0x49d8bb||0xc8;return function(_0x5bdc03){if(_0x5bdc03){return _0x9f790f[_0xd351('0x18')](_0x49d8bb)['json'](_0x5bdc03);}};}function respondWithFilteredResult(_0x21e591,_0x1de35f){return function(_0x4e0164){if(_0x4e0164){var _0x4c6693=typeof _0x1de35f[_0xd351('0x19')]===_0xd351('0x1a')&&typeof _0x1de35f[_0xd351('0x1b')]===_0xd351('0x1a');var _0x51f265=_0x4e0164[_0xd351('0x1c')];var _0x4abbed=_0x4c6693?0x0:_0x1de35f['offset'];var _0x37d3ac=_0x4c6693?_0x4e0164['count']:_0x1de35f[_0xd351('0x19')]+_0x1de35f[_0xd351('0x1b')];var _0x3634c9;if(_0x37d3ac>=_0x51f265){_0x37d3ac=_0x51f265;_0x3634c9=0xc8;}else{_0x3634c9=0xce;}_0x21e591[_0xd351('0x18')](_0x3634c9);return _0x21e591[_0xd351('0x1d')]('Content-Range',_0x4abbed+'-'+_0x37d3ac+'/'+_0x51f265)[_0xd351('0x1e')](_0x4e0164);}return null;};}function patchUpdates(_0xbbc58){return function(_0x241265){try{jsonpatch['apply'](_0x241265,_0xbbc58,!![]);}catch(_0x1ce7f7){return BPromise[_0xd351('0x1f')](_0x1ce7f7);}return _0x241265[_0xd351('0x20')]();};}function saveUpdates(_0x59fb6d,_0x1ce279){return function(_0x34a5cb){if(_0x34a5cb){return _0x34a5cb[_0xd351('0x21')](_0x59fb6d)[_0xd351('0x22')](function(_0x489c9a){return _0x489c9a;});}return null;};}function removeEntity(_0x40f7f3,_0x483c92){return function(_0x358bff){if(_0x358bff){return _0x358bff[_0xd351('0x23')]()['then'](function(){var _0x2648d0=_0x358bff['get']({'plain':!![]});var _0x50d67e=_0xd351('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x50d67e,'resourceId':_0x2648d0['id']}})[_0xd351('0x22')](function(){return _0x358bff;});})['then'](function(){_0x40f7f3[_0xd351('0x18')](0xcc)[_0xd351('0x25')]();});}};}function handleEntityNotFound(_0x407b50,_0x4d3f48){return function(_0x71ce9c){if(!_0x71ce9c){_0x407b50['sendStatus'](0x194);}return _0x71ce9c;};}function handleError(_0x1c826b,_0x50039b){_0x50039b=_0x50039b||0x1f4;return function(_0x5f07b1){logger[_0xd351('0x26')](_0x5f07b1[_0xd351('0x27')]);if(_0x5f07b1[_0xd351('0x28')]){delete _0x5f07b1[_0xd351('0x28')];}_0x1c826b['status'](_0x50039b)[_0xd351('0x29')](_0x5f07b1);};}exports[_0xd351('0x2a')]=function(_0x38023c,_0x41da60){var _0x140591={},_0x205c79={},_0x103a7b={'count':0x0,'rows':[]};var _0x898949=_[_0xd351('0x2b')](db['VoicePrefix'][_0xd351('0x2c')],function(_0x453270){return{'name':_0x453270[_0xd351('0x2d')],'type':_0x453270[_0xd351('0x2e')]['key']};});_0x205c79[_0xd351('0x2f')]=_[_0xd351('0x2b')](_0x898949,_0xd351('0x28'));_0x205c79[_0xd351('0x30')]=_[_0xd351('0x31')](_0x38023c[_0xd351('0x30')]);_0x205c79[_0xd351('0x32')]=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],_0x205c79['query']);_0x140591['attributes']=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x38023c[_0xd351('0x30')][_0xd351('0x34')]));_0x140591[_0xd351('0x35')]=_0x140591['attributes']['length']?_0x140591[_0xd351('0x35')]:_0x205c79['model'];if(!_0x38023c[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x140591[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x38023c[_0xd351('0x30')][_0xd351('0x1b')]);_0x140591[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38023c[_0xd351('0x30')][_0xd351('0x19')]);}_0x140591['order']=qs[_0xd351('0x38')](_0x38023c['query'][_0xd351('0x38')]);_0x140591[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x38023c[_0xd351('0x30')],_0x205c79[_0xd351('0x32')]),_0x898949);if(_0x38023c['query'][_0xd351('0x3b')]){_0x140591[_0xd351('0x39')]=_['merge'](_0x140591[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x898949,function(_0x382f5b){if(_0x382f5b[_0xd351('0x2e')]!==_0xd351('0x3c')){var _0x5cc105={};_0x5cc105[_0x382f5b['name']]={'$like':'%'+_0x38023c[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x5cc105;}})});}_0x140591=_['merge']({},_0x140591,_0x38023c['options']);var _0x16677f={'where':_0x140591[_0xd351('0x39')]};return db['VoicePrefix']['count'](_0x16677f)[_0xd351('0x22')](function(_0x18f9d1){_0x103a7b[_0xd351('0x1c')]=_0x18f9d1;if(_0x38023c[_0xd351('0x30')][_0xd351('0x3d')]){_0x140591[_0xd351('0x3e')]=[{'all':!![]}];}return db[_0xd351('0x3f')][_0xd351('0x40')](_0x140591);})[_0xd351('0x22')](function(_0x553360){_0x103a7b['rows']=_0x553360;return _0x103a7b;})[_0xd351('0x22')](respondWithFilteredResult(_0x41da60,_0x140591))[_0xd351('0x41')](handleError(_0x41da60,null));};exports[_0xd351('0x42')]=function(_0x35f38f,_0x2bdd8f){var _0x4332e7={'raw':![],'where':{'id':_0x35f38f[_0xd351('0x43')]['id']}},_0xeaf4dc={};_0xeaf4dc[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x3f')][_0xd351('0x2c')]);_0xeaf4dc[_0xd351('0x30')]=_[_0xd351('0x31')](_0x35f38f[_0xd351('0x30')]);_0xeaf4dc[_0xd351('0x32')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],_0xeaf4dc[_0xd351('0x30')]);_0x4332e7[_0xd351('0x35')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x35f38f[_0xd351('0x30')][_0xd351('0x34')]));_0x4332e7[_0xd351('0x35')]=_0x4332e7['attributes'][_0xd351('0x44')]?_0x4332e7['attributes']:_0xeaf4dc[_0xd351('0x2f')];if(_0x35f38f[_0xd351('0x30')]['includeAll']){_0x4332e7['include']=[{'all':!![]}];}_0x4332e7=_[_0xd351('0x45')]({},_0x4332e7,_0x35f38f[_0xd351('0x46')]);return db[_0xd351('0x3f')]['find'](_0x4332e7)[_0xd351('0x22')](handleEntityNotFound(_0x2bdd8f,null))[_0xd351('0x22')](respondWithResult(_0x2bdd8f,null))['catch'](handleError(_0x2bdd8f,null));};exports[_0xd351('0x23')]=function(_0x53a2e8,_0x1eb5f3){return db[_0xd351('0x3f')]['find']({'where':{'id':_0x53a2e8['params']['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x1eb5f3,null))['then'](removeEntity(_0x1eb5f3,null))[_0xd351('0x41')](handleError(_0x1eb5f3,null));};exports[_0xd351('0x47')]=function(_0x9f1cd0,_0x4a27e3){return db[_0xd351('0x3f')]['describe']()['then'](respondWithResult(_0x4a27e3,null))['catch'](handleError(_0x4a27e3,null));};exports[_0xd351('0x48')]=function(_0x292af3,_0x334029){var _0x5a2e9b;return db['sequelize'][_0xd351('0x49')](function(_0x42f248){return db['VoicePrefix'][_0xd351('0x48')](_0x292af3[_0xd351('0x4a')],{'transaction':_0x42f248})['then'](function(_0x24ee0f){_0x5a2e9b=_0x24ee0f['get']({'plain':!![]});return db[_0xd351('0x4b')]['find']({'where':{'id':_0x5a2e9b[_0xd351('0x4c')]},'raw':!![]})[_0xd351('0x22')](function(_0x169ab1){return createVoicePrefixExtensions(_0x5a2e9b,_0x169ab1,_0x42f248);});});})[_0xd351('0x22')](function(){var _0xb5f3ee=_0x292af3[_0xd351('0x4d')][_0xd351('0x4e')]({'plain':!![]});if(!_0xb5f3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5f3ee['role']===_0xd351('0x4d')){var _0x624224=_0x5a2e9b;return db['UserProfileSection'][_0xd351('0x4f')]({'where':{'name':_0xd351('0x24'),'userProfileId':_0xb5f3ee[_0xd351('0x50')]},'raw':!![]})['then'](function(_0x169122){if(_0x169122&&_0x169122['autoAssociation']===0x0){return db['UserProfileResource'][_0xd351('0x48')]({'name':_0x624224[_0xd351('0x28')],'resourceId':_0x624224['id'],'type':_0x169122['name'],'sectionId':_0x169122['id']},{})[_0xd351('0x22')](function(){return _0x5a2e9b;});}else{return _0x5a2e9b;}})[_0xd351('0x41')](function(_0x2d9747){logger[_0xd351('0x26')](_0xd351('0x51'),_0x2d9747);throw _0x2d9747;});}return _0x5a2e9b;})[_0xd351('0x22')](respondWithResult(_0x334029,null))['catch'](handleError(_0x334029,null));};function Extension(_0x1e1173,_0x2a7390,_0x36fb5b,_0x8461b){this[_0xd351('0x52')]=_0xd351('0x53');this[_0xd351('0x54')]=_0x1e1173;this['app']=_0x36fb5b;this[_0xd351('0x2e')]='system';this[_0xd351('0x55')]=_0xd351('0x56');this[_0xd351('0x57')]=_0x2a7390;this[_0xd351('0x58')]=_0x8461b;}function createVoicePrefixExtensions(_0x70cdb,_0x4eaf18,_0x413931){return new BPromise(function(_0x4c8038,_0x4685fa){var _0x45bcc7=new Extension(formatPrefixName(_0x70cdb[_0xd351('0x59')]),0x1,_0xd351('0x5a'),_0xd351('0x5b'));_0x45bcc7['VoicePrefixId']=_0x70cdb['id'];return db['VoiceExtension'][_0xd351('0x48')](_0x45bcc7,{'transaction':_0x413931})[_0xd351('0x22')](function(_0x4b9367){var _0x2d2655=_0x4b9367[_0xd351('0x4e')]({'plain':!![]});var _0x2718e9=_['map'](addVoicePrefixExtensions(_0x70cdb,_0x4eaf18),function(_0x2b47ab){_0x2b47ab[_0xd351('0x4c')]=_0x2d2655['id'];_0x2b47ab[_0xd351('0x5c')]=_0x70cdb['id'];return _0x2b47ab;});return db[_0xd351('0x4b')]['bulkCreate'](_0x2718e9,{'transaction':_0x413931})['then'](function(_0x40c78b){if(!_0x40c78b){return _0x4685fa(_0xd351('0x5d'));}else{return _0x4c8038(_0x40c78b);}})[_0xd351('0x41')](function(_0xa000b4){return _0x4685fa(_0xa000b4);});});;});};function addVoicePrefixExtensions(_0x36b38f,_0x3b0993){var _0x2c83fe=[];var _0x5e2e06=formatPrefixName(_0x36b38f[_0xd351('0x59')]);_0x2c83fe['push'](new Extension(_0x5e2e06,0x2,'Set',_0xd351('0x5e')+_0x36b38f[_0xd351('0x28')]));if(_0x36b38f['callerIdAll']){_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,'Set','PREFIX-CALLERIDALL='+_0x36b38f['callerIdAll']));}else{_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,_0xd351('0x5a'),_0xd351('0x60')));}_0x2c83fe['push'](new Extension(_0x5e2e06,0x4,_0xd351('0x61'),_0x3b0993[_0xd351('0x52')]+','+_0xd351('0x62')+(0x8+_0x36b38f[_0xd351('0x28')][_0xd351('0x44')])+'}'+','+0x1));return _0x2c83fe;}function formatPrefixName(_0x475534){var _0x15fcab='_';for(var _0x6bf19c=0x0;_0x6bf19c<_0x475534[_0xd351('0x44')];_0x6bf19c++){if(_0x475534[_0xd351('0x63')](_0x6bf19c)=='-'){_0x15fcab+=_0x475534[_0xd351('0x63')](_0x6bf19c);}else{_0x15fcab+='['+_0x475534['charAt'](_0x6bf19c)+']';}}_0x15fcab+='.';return _0x15fcab;}exports[_0xd351('0x21')]=function(_0x2d59a5,_0x431e91,_0xcc7a10){var _0xf24a29=_0x2d59a5[_0xd351('0x4a')];_0xf24a29['prefix']=_0xd351('0x64')+_0xf24a29[_0xd351('0x28')]+'-';return db['sequelize']['transaction'](function(_0x436e1d){return db[_0xd351('0x3f')][_0xd351('0x21')](_0xf24a29,{'where':{'id':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x23')]({'where':{'VoicePrefixId':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x4f')]({'where':{'id':_0xf24a29['VoiceExtensionId']},'raw':!![]})[_0xd351('0x22')](function(_0x129623){return createVoicePrefixExtensions(_0xf24a29,_0x129623,_0x436e1d);});});});})['then'](function(){return db[_0xd351('0x3f')]['findById'](_0xf24a29['id']);})[_0xd351('0x22')](respondWithResult(_0x431e91,null))['catch'](handleError(_0x431e91,null));};exports[_0xd351('0x65')]=function(_0x406d8a,_0xbd31ca,_0x451445){return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x406d8a[_0xd351('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd31ca,null))[_0xd351('0x22')](function(_0x2558b4){if(_0x2558b4){return _0x2558b4[_0xd351('0x65')](_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')],_['omit'](_0x406d8a[_0xd351('0x4a')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x67')](function(_0x54b38c){for(var _0x38a3ec=0x0;_0x38a3ec<_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0xd351('0x44')];_0x38a3ec+=0x1){socket[_0xd351('0x68')](_0xd351('0x69'),{'UserId':Number(_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0x38a3ec]),'VoicePrefixId':Number(_0x406d8a[_0xd351('0x43')]['id'])});}return _0x54b38c;});}})['then'](respondWithResult(_0xbd31ca,null))[_0xd351('0x41')](handleError(_0xbd31ca,null));};exports[_0xd351('0x6a')]=function(_0x5036e6,_0x44df63,_0x4c1468){return db['VoicePrefix']['find']({'where':{'id':_0x5036e6[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x44df63,null))[_0xd351('0x22')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9[_0xd351('0x6a')](_0x5036e6['query'][_0xd351('0x66')])['then'](function(){if(_[_0xd351('0x6b')](_0x5036e6[_0xd351('0x30')][_0xd351('0x66')])){for(var _0x16dd16=0x0;_0x16dd16<_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0xd351('0x44')];_0x16dd16+=0x1){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0x16dd16]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}}else{socket['emit'](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}});}})[_0xd351('0x22')](respondWithStatusCode(_0x44df63,null))['catch'](handleError(_0x44df63,null));};exports[_0xd351('0x6d')]=function(_0x1e6c85,_0x2adab4,_0x2a1ea4){var _0x4a4b25={};var _0x1fda25={};var _0x36bbee;var _0x48b5ee;return db[_0xd351('0x3f')][_0xd351('0x6e')]({'where':{'id':_0x1e6c85[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x2adab4,null))['then'](function(_0x523895){if(_0x523895){_0x36bbee=_0x523895;_0x1fda25[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x6f')][_0xd351('0x2c')]);_0x1fda25['query']=_[_0xd351('0x31')](_0x1e6c85[_0xd351('0x30')]);_0x1fda25[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1fda25[_0xd351('0x2f')],_0x1fda25['query']);_0x4a4b25[_0xd351('0x35')]=_[_0xd351('0x33')](_0x1fda25['model'],qs[_0xd351('0x34')](_0x1e6c85[_0xd351('0x30')]['fields']));_0x4a4b25[_0xd351('0x35')]=_0x4a4b25['attributes'][_0xd351('0x44')]?_0x4a4b25['attributes']:_0x1fda25[_0xd351('0x2f')];_0x4a4b25[_0xd351('0x70')]=qs[_0xd351('0x38')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x38')]);_0x4a4b25[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x1e6c85[_0xd351('0x30')],_0x1fda25['filters']));if(_0x1e6c85[_0xd351('0x30')][_0xd351('0x3b')]){_0x4a4b25[_0xd351('0x39')]=_[_0xd351('0x45')](_0x4a4b25[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x4a4b25[_0xd351('0x35')],function(_0x54041b){var _0x56458b={};_0x56458b[_0x54041b]={'$like':'%'+_0x1e6c85[_0xd351('0x30')]['filter']+'%'};return _0x56458b;})});}_0x4a4b25=_[_0xd351('0x45')]({},_0x4a4b25,_0x1e6c85[_0xd351('0x46')]);return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x2d5e2b){if(_0x2d5e2b){_0x48b5ee=_0x2d5e2b['length'];if(!_0x1e6c85[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x4a4b25[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x1b')]);_0x4a4b25[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x19')]);}return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x4ddd65){if(_0x4ddd65){return _0x4ddd65?{'count':_0x48b5ee,'rows':_0x4ddd65}:null;}})['then'](respondWithResult(_0x2adab4,null))[_0xd351('0x41')](handleError(_0x2adab4,null));};exports['getTeams']=function(_0x5c202f,_0x426964,_0x4557ed){var _0x3f6826={};var _0x1a5e8e={};var _0x54fc9c;var _0x2443bd;return db['VoicePrefix']['findOne']({'where':{'id':_0x5c202f[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x426964,null))[_0xd351('0x22')](function(_0x15690b){if(_0x15690b){_0x54fc9c=_0x15690b;_0x1a5e8e[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x71')]['rawAttributes']);_0x1a5e8e[_0xd351('0x30')]=_[_0xd351('0x31')](_0x5c202f[_0xd351('0x30')]);_0x1a5e8e[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1a5e8e[_0xd351('0x2f')],_0x1a5e8e['query']);_0x3f6826['attributes']=_[_0xd351('0x33')](_0x1a5e8e['model'],qs[_0xd351('0x34')](_0x5c202f[_0xd351('0x30')]['fields']));_0x3f6826[_0xd351('0x35')]=_0x3f6826[_0xd351('0x35')][_0xd351('0x44')]?_0x3f6826[_0xd351('0x35')]:_0x1a5e8e[_0xd351('0x2f')];_0x3f6826['order']=qs[_0xd351('0x38')](_0x5c202f['query'][_0xd351('0x38')]);_0x3f6826[_0xd351('0x39')]=qs['filters'](_[_0xd351('0x3a')](_0x5c202f[_0xd351('0x30')],_0x1a5e8e[_0xd351('0x32')]));if(_0x5c202f[_0xd351('0x30')]['filter']){_0x3f6826['where']=_['merge'](_0x3f6826[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x3f6826[_0xd351('0x35')],function(_0x40740e){var _0x3606b1={};_0x3606b1[_0x40740e]={'$like':'%'+_0x5c202f[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x3606b1;})});}_0x3f6826=_['merge']({},_0x3f6826,_0x5c202f[_0xd351('0x46')]);return _0x54fc9c['getTeams'](_0x3f6826);}})[_0xd351('0x22')](function(_0x55d564){if(_0x55d564){_0x2443bd=_0x55d564['length'];if(!_0x5c202f[_0xd351('0x30')]['hasOwnProperty'](_0xd351('0x37'))){_0x3f6826[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x5c202f[_0xd351('0x30')][_0xd351('0x1b')]);_0x3f6826[_0xd351('0x19')]=qs['offset'](_0x5c202f['query'][_0xd351('0x19')]);}return _0x54fc9c[_0xd351('0x72')](_0x3f6826);}})['then'](function(_0x3d3cfa){if(_0x3d3cfa){return _0x3d3cfa?{'count':_0x2443bd,'rows':_0x3d3cfa}:null;}})['then'](respondWithResult(_0x426964,null))[_0xd351('0x41')](handleError(_0x426964,null));};exports[_0xd351('0x73')]=function(_0x6fd03b,_0x19d16a,_0x127bf9){var _0x4ab9b9=_0x6fd03b[_0xd351('0x4a')]['ids'];var _0x581e66;return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x4ab9b9},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':'Agents','attributes':['id','name',_0xd351('0x74'),_0xd351('0x75'),_0xd351('0x76')],'raw':!![]}]})[_0xd351('0x22')](function(_0x1ddacf){if(_0x1ddacf){_0x581e66=_0x1ddacf;var _0x4cadbe=_[_0xd351('0x77')](_0x1ddacf,function(_0x269bf6){var _0x3da123=_0x269bf6[_0xd351('0x4e')]({'plain':!![]});return _0x3da123['Agents'];});return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x6fd03b['params']['id']}})[_0xd351('0x22')](function(_0x46745f){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x37d882){return _0x46745f['addTeams'](_0x4ab9b9,{'transaction':_0x37d882})[_0xd351('0x22')](function(){return BPromise[_0xd351('0x79')](_0x581e66,function(_0x5ceda1){return db[_0xd351('0x7a')]['upsert']({'TeamId':_0x5ceda1['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},{'transaction':_0x37d882});});})[_0xd351('0x22')](function(){return BPromise['each'](_0x4cadbe,function(_0x1f0812){return db[_0xd351('0x7b')][_0xd351('0x7c')]({'where':{'UserId':_0x1f0812['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},'transaction':_0x37d882});});})[_0xd351('0x22')](function(){_0x4cadbe['forEach'](function(_0x23b2fe){socket['emit'](_0xd351('0x69'),{'UserId':_0x23b2fe['id'],'VoicePrefixId':_0x46745f['id']});});});});});}})[_0xd351('0x22')](respondWithStatusCode(_0x19d16a,null))[_0xd351('0x41')](handleError(_0x19d16a,null));};exports[_0xd351('0x7d')]=function(_0x160102,_0x24ac40,_0x3b2690){return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x160102['query'][_0xd351('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':_0xd351('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xd351('0x22')](handleEntityNotFound(_0x24ac40,null))['then'](function(_0x280220){var _0x4f8f00=_[_0xd351('0x2b')](_0x280220,'id');var _0x107886=[];var _0x3a3633=[];var _0x403312=squel[_0xd351('0x7f')]();_0x403312['field'](_0xd351('0x80'))[_0xd351('0x81')]('team_has_voice_prefixes','tq')['join'](_0xd351('0x82'),'ut',_0xd351('0x83'))[_0xd351('0x39')](_0xd351('0x84'),_0x160102[_0xd351('0x43')]['id']);for(var _0x1373c0=0x0;_0x1373c0<_0x280220[_0xd351('0x44')];_0x1373c0+=0x1){let _0x78b55c=_0x280220[_0x1373c0];for(var _0x2de03c=0x0;_0x2de03c<_0x78b55c[_0xd351('0x7e')][_0xd351('0x44')];_0x2de03c+=0x1){let _0x6f4c1e=_0x78b55c[_0xd351('0x7e')][_0x2de03c];var _0x56b88b=_0x403312['clone']();_0x56b88b[_0xd351('0x39')]('ut.UserId\x20=\x20?',_0x6f4c1e['id']);_0x3a3633[_0xd351('0x5f')](db[_0xd351('0x78')][_0xd351('0x30')](_0x56b88b[_0xd351('0x85')](),{'type':db[_0xd351('0x78')][_0xd351('0x86')]['SELECT']})[_0xd351('0x22')](function(_0x2725c4){if(_0x2725c4['length']===0x1){return _0x6f4c1e['id'];}else{var _0x31c1dc=_['every'](_['map'](_0x2725c4,_0xd351('0x87')),function(_0x2f188b){return _['includes'](_0x4f8f00,_0x2f188b);});if(_0x31c1dc){return _0x6f4c1e['id'];}}}));}}return BPromise[_0xd351('0x88')](_0x3a3633)[_0xd351('0x22')](function(_0x5126a1){_0x107886=_(_0x107886)[_0xd351('0x89')](_0x5126a1)[_0xd351('0x8a')]()[_0xd351('0x8b')]();return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x160102['params']['id']}})[_0xd351('0x22')](function(_0x1db9db){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x2ef116){return _0x1db9db[_0xd351('0x7d')](_0x160102[_0xd351('0x30')][_0xd351('0x66')],{'transaction':_0x2ef116})[_0xd351('0x22')](function(){if(!_[_0xd351('0x8c')](_0x107886)){return _0x1db9db[_0xd351('0x6a')](_0x107886,{'transaction':_0x2ef116});}})[_0xd351('0x22')](function(){_0x107886[_0xd351('0x8d')](function(_0x585e94){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':_0x585e94,'VoicePrefixId':_0x1db9db['id']});});});});});});})[_0xd351('0x22')](respondWithStatusCode(_0x24ac40,null))[_0xd351('0x41')](handleError(_0x24ac40,null));}; \ No newline at end of file +var _0x7d25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','findAll','catch','show','include','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','context','app','system','description','appdata','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','NoOp','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','params','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','addTeams','Agents','online','interface','each','upsert','forEach','removeTeams','Team','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3d63c0,_0x1bb673){var _0x3622ec=function(_0x1f2106){while(--_0x1f2106){_0x3d63c0['push'](_0x3d63c0['shift']());}};_0x3622ec(++_0x1bb673);}(_0x7d25,0x8a));var _0x57d2=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x7d25[_0x580647];return _0x5f0792;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];config[_0x57d2('0x17')]=_[_0x57d2('0x18')](config[_0x57d2('0x17')],{'host':_0x57d2('0x19'),'port':0x18eb});var socket=require(_0x57d2('0x1a'))(new Redis(config[_0x57d2('0x17')]));require(_0x57d2('0x1b'))[_0x57d2('0x1c')](socket);function respondWithStatusCode(_0x5382d9,_0x5b940e){_0x5b940e=_0x5b940e||0xcc;return function(_0x6fad35){if(_0x6fad35){return _0x5382d9[_0x57d2('0x1d')](_0x5b940e);}return _0x5382d9['status'](_0x5b940e)[_0x57d2('0x1e')]();};}function respondWithResult(_0x319489,_0x4bb8f7){_0x4bb8f7=_0x4bb8f7||0xc8;return function(_0x3e12c6){if(_0x3e12c6){return _0x319489['status'](_0x4bb8f7)[_0x57d2('0x1f')](_0x3e12c6);}};}function respondWithFilteredResult(_0x4b4fe0,_0x2ab5f0){return function(_0x7d4cf1){if(_0x7d4cf1){var _0x2ecfdf=typeof _0x2ab5f0['offset']==='undefined'&&typeof _0x2ab5f0[_0x57d2('0x20')]===_0x57d2('0x21');var _0x2662cd=_0x7d4cf1[_0x57d2('0x22')];var _0x5b1b9d=_0x2ecfdf?0x0:_0x2ab5f0[_0x57d2('0x23')];var _0xcf924f=_0x2ecfdf?_0x7d4cf1['count']:_0x2ab5f0['offset']+_0x2ab5f0[_0x57d2('0x20')];var _0x326d49;if(_0xcf924f>=_0x2662cd){_0xcf924f=_0x2662cd;_0x326d49=0xc8;}else{_0x326d49=0xce;}_0x4b4fe0[_0x57d2('0x24')](_0x326d49);return _0x4b4fe0[_0x57d2('0x25')](_0x57d2('0x26'),_0x5b1b9d+'-'+_0xcf924f+'/'+_0x2662cd)[_0x57d2('0x1f')](_0x7d4cf1);}return null;};}function patchUpdates(_0x32c7c8){return function(_0x31d2cf){try{jsonpatch[_0x57d2('0x27')](_0x31d2cf,_0x32c7c8,!![]);}catch(_0x26718e){return BPromise[_0x57d2('0x28')](_0x26718e);}return _0x31d2cf[_0x57d2('0x29')]();};}function saveUpdates(_0x12ff19,_0x473df2){return function(_0x5327ea){if(_0x5327ea){return _0x5327ea[_0x57d2('0x2a')](_0x12ff19)[_0x57d2('0x2b')](function(_0x3c7de8){return _0x3c7de8;});}return null;};}function removeEntity(_0x452d5e,_0x4363b3){return function(_0x5058be){if(_0x5058be){return _0x5058be[_0x57d2('0x2c')]()[_0x57d2('0x2b')](function(){var _0x995928=_0x5058be[_0x57d2('0x2d')]({'plain':!![]});var _0x18d500=_0x57d2('0x2e');return db[_0x57d2('0x2f')]['destroy']({'where':{'type':_0x18d500,'resourceId':_0x995928['id']}})[_0x57d2('0x2b')](function(){return _0x5058be;});})[_0x57d2('0x2b')](function(){_0x452d5e[_0x57d2('0x24')](0xcc)[_0x57d2('0x1e')]();});}};}function handleEntityNotFound(_0x1957a6,_0x7c33f3){return function(_0x1dd6cb){if(!_0x1dd6cb){_0x1957a6[_0x57d2('0x1d')](0x194);}return _0x1dd6cb;};}function handleError(_0x1d2bdb,_0x2cf9d9){_0x2cf9d9=_0x2cf9d9||0x1f4;return function(_0x574589){logger[_0x57d2('0x30')](_0x574589[_0x57d2('0x31')]);if(_0x574589[_0x57d2('0x32')]){delete _0x574589[_0x57d2('0x32')];}_0x1d2bdb['status'](_0x2cf9d9)[_0x57d2('0x33')](_0x574589);};}exports[_0x57d2('0x34')]=function(_0x21152e,_0x290c2d){var _0xb3051c={},_0x40f3f2={},_0x3cbc4b={'count':0x0,'rows':[]};var _0x36c0d7=_[_0x57d2('0x35')](db['VoicePrefix'][_0x57d2('0x36')],function(_0x213c99){return{'name':_0x213c99['fieldName'],'type':_0x213c99[_0x57d2('0x37')][_0x57d2('0x38')]};});_0x40f3f2['model']=_[_0x57d2('0x35')](_0x36c0d7,_0x57d2('0x32'));_0x40f3f2[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x21152e[_0x57d2('0x39')]);_0x40f3f2['filters']=_['intersection'](_0x40f3f2['model'],_0x40f3f2['query']);_0xb3051c[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x40f3f2[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x21152e[_0x57d2('0x39')]['fields']));_0xb3051c[_0x57d2('0x3b')]=_0xb3051c['attributes'][_0x57d2('0x3f')]?_0xb3051c[_0x57d2('0x3b')]:_0x40f3f2[_0x57d2('0x3d')];if(!_0x21152e['query'][_0x57d2('0x40')](_0x57d2('0x41'))){_0xb3051c['limit']=qs[_0x57d2('0x20')](_0x21152e[_0x57d2('0x39')][_0x57d2('0x20')]);_0xb3051c[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x21152e[_0x57d2('0x39')]['offset']);}_0xb3051c[_0x57d2('0x42')]=qs['sort'](_0x21152e[_0x57d2('0x39')][_0x57d2('0x43')]);_0xb3051c[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x21152e['query'],_0x40f3f2[_0x57d2('0x45')]),_0x36c0d7);if(_0x21152e[_0x57d2('0x39')]['filter']){_0xb3051c[_0x57d2('0x44')]=_[_0x57d2('0x47')](_0xb3051c[_0x57d2('0x44')],{'$or':_['map'](_0x36c0d7,function(_0x226e56){if(_0x226e56[_0x57d2('0x37')]!==_0x57d2('0x48')){var _0x3281c9={};_0x3281c9[_0x226e56['name']]={'$like':'%'+_0x21152e['query'][_0x57d2('0x49')]+'%'};return _0x3281c9;}})});}_0xb3051c=_[_0x57d2('0x47')]({},_0xb3051c,_0x21152e[_0x57d2('0x4a')]);var _0x5795e7={'where':_0xb3051c['where']};return db[_0x57d2('0x4b')]['count'](_0x5795e7)[_0x57d2('0x2b')](function(_0x1bb8ad){_0x3cbc4b[_0x57d2('0x22')]=_0x1bb8ad;if(_0x21152e[_0x57d2('0x39')][_0x57d2('0x4c')]){_0xb3051c['include']=[{'all':!![]}];}return db[_0x57d2('0x4b')][_0x57d2('0x4d')](_0xb3051c);})['then'](function(_0x775f8c){_0x3cbc4b['rows']=_0x775f8c;return _0x3cbc4b;})[_0x57d2('0x2b')](respondWithFilteredResult(_0x290c2d,_0xb3051c))[_0x57d2('0x4e')](handleError(_0x290c2d,null));};exports[_0x57d2('0x4f')]=function(_0x323273,_0x58aa4e){var _0x541772={'raw':![],'where':{'id':_0x323273['params']['id']}},_0x3d8256={};_0x3d8256['model']=_[_0x57d2('0x3a')](db['VoicePrefix']['rawAttributes']);_0x3d8256[_0x57d2('0x39')]=_['keys'](_0x323273[_0x57d2('0x39')]);_0x3d8256['filters']=_[_0x57d2('0x3c')](_0x3d8256['model'],_0x3d8256['query']);_0x541772[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x3d8256[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x323273[_0x57d2('0x39')][_0x57d2('0x3e')]));_0x541772['attributes']=_0x541772[_0x57d2('0x3b')][_0x57d2('0x3f')]?_0x541772[_0x57d2('0x3b')]:_0x3d8256[_0x57d2('0x3d')];if(_0x323273[_0x57d2('0x39')][_0x57d2('0x4c')]){_0x541772[_0x57d2('0x50')]=[{'all':!![]}];}_0x541772=_[_0x57d2('0x47')]({},_0x541772,_0x323273['options']);return db[_0x57d2('0x4b')][_0x57d2('0x51')](_0x541772)['then'](handleEntityNotFound(_0x58aa4e,null))[_0x57d2('0x2b')](respondWithResult(_0x58aa4e,null))['catch'](handleError(_0x58aa4e,null));};exports['destroy']=function(_0x1a1dc7,_0x31f404){return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x1a1dc7['params']['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x31f404,null))[_0x57d2('0x2b')](removeEntity(_0x31f404,null))['catch'](handleError(_0x31f404,null));};exports['describe']=function(_0xd7c79f,_0xb02f43){return db[_0x57d2('0x4b')][_0x57d2('0x52')]()[_0x57d2('0x2b')](respondWithResult(_0xb02f43,null))[_0x57d2('0x4e')](handleError(_0xb02f43,null));};exports['create']=function(_0x4b377f,_0x5a5edb){var _0x30482c;return db['sequelize'][_0x57d2('0x53')](function(_0x2ef710){return db['VoicePrefix'][_0x57d2('0x54')](_0x4b377f[_0x57d2('0x55')],{'transaction':_0x2ef710})[_0x57d2('0x2b')](function(_0x557f79){_0x30482c=_0x557f79[_0x57d2('0x2d')]({'plain':!![]});return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x30482c[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x2e90eb){return createVoicePrefixExtensions(_0x30482c,_0x2e90eb,_0x2ef710);});});})[_0x57d2('0x2b')](function(){var _0x2b93c4=_0x4b377f[_0x57d2('0x58')]['get']({'plain':!![]});if(!_0x2b93c4)throw new Error(_0x57d2('0x59'));if(_0x2b93c4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x5e3289=_0x30482c;return db[_0x57d2('0x5b')][_0x57d2('0x51')]({'where':{'name':_0x57d2('0x2e'),'userProfileId':_0x2b93c4['userProfileId']},'raw':!![]})['then'](function(_0x56ddfd){if(_0x56ddfd&&_0x56ddfd[_0x57d2('0x5c')]===0x0){return db['UserProfileResource'][_0x57d2('0x54')]({'name':_0x5e3289['name'],'resourceId':_0x5e3289['id'],'type':_0x56ddfd[_0x57d2('0x32')],'sectionId':_0x56ddfd['id']},{})['then'](function(){return _0x30482c;});}else{return _0x30482c;}})[_0x57d2('0x4e')](function(_0x430f85){logger[_0x57d2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430f85);throw _0x430f85;});}return _0x30482c;})['then'](respondWithResult(_0x5a5edb,null))[_0x57d2('0x4e')](handleError(_0x5a5edb,null));};function Extension(_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){this[_0x57d2('0x5d')]='from-sip';this['exten']=_0x2c1710;this[_0x57d2('0x5e')]=_0x227a02;this[_0x57d2('0x37')]=_0x57d2('0x5f');this[_0x57d2('0x60')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3b57fa;this[_0x57d2('0x61')]=_0x3e5d71;}function createVoicePrefixExtensions(_0x301e43,_0x4f6b8a,_0xad397){return new BPromise(function(_0x28fcdb,_0x15e3b6){var _0x472e5d=new Extension(formatPrefixName(_0x301e43['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x472e5d['VoicePrefixId']=_0x301e43['id'];return db[_0x57d2('0x56')][_0x57d2('0x54')](_0x472e5d,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0xa57b70){var _0xd13626=_0xa57b70[_0x57d2('0x2d')]({'plain':!![]});var _0x2737ab=_['map'](addVoicePrefixExtensions(_0x301e43,_0x4f6b8a),function(_0x35808a){_0x35808a['VoiceExtensionId']=_0xd13626['id'];_0x35808a[_0x57d2('0x62')]=_0x301e43['id'];return _0x35808a;});return db['VoiceExtension'][_0x57d2('0x63')](_0x2737ab,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0x453e6c){if(!_0x453e6c){return _0x15e3b6(_0x57d2('0x64'));}else{return _0x28fcdb(_0x453e6c);}})[_0x57d2('0x4e')](function(_0x145370){return _0x15e3b6(_0x145370);});});;});};function addVoicePrefixExtensions(_0x5e697c,_0x2a481c){var _0x24d3bf=[];var _0x27b27a=formatPrefixName(_0x5e697c[_0x57d2('0x65')]);_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x2,_0x57d2('0x67'),_0x57d2('0x68')+_0x5e697c[_0x57d2('0x32')]));if(_0x5e697c[_0x57d2('0x69')]){_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x67'),'PREFIX-CALLERIDALL='+_0x5e697c['callerIdAll']));}else{_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x6a'),'No\x20callerid\x20available'));}_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x4,_0x57d2('0x6b'),_0x2a481c['context']+','+_0x57d2('0x6c')+(0x8+_0x5e697c[_0x57d2('0x32')][_0x57d2('0x3f')])+'}'+','+0x1));return _0x24d3bf;}function formatPrefixName(_0x13741f){var _0x5eb7a3='_';for(var _0x3afeb9=0x0;_0x3afeb9<_0x13741f[_0x57d2('0x3f')];_0x3afeb9++){if(_0x13741f['charAt'](_0x3afeb9)=='-'){_0x5eb7a3+=_0x13741f['charAt'](_0x3afeb9);}else{_0x5eb7a3+='['+_0x13741f[_0x57d2('0x6d')](_0x3afeb9)+']';}}_0x5eb7a3+='.';return _0x5eb7a3;}exports[_0x57d2('0x2a')]=function(_0x481c6b,_0x46c7de,_0x5a1283){var _0x360ee0=_0x481c6b[_0x57d2('0x55')];_0x360ee0[_0x57d2('0x65')]=_0x57d2('0x6e')+_0x360ee0[_0x57d2('0x32')]+'-';return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x3bec6f){return db[_0x57d2('0x4b')][_0x57d2('0x2a')](_0x360ee0,{'where':{'id':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db['VoiceExtension'][_0x57d2('0x2c')]({'where':{'VoicePrefixId':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x360ee0[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x42666b){return createVoicePrefixExtensions(_0x360ee0,_0x42666b,_0x3bec6f);});});});})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x4b')][_0x57d2('0x70')](_0x360ee0['id']);})[_0x57d2('0x2b')](respondWithResult(_0x46c7de,null))[_0x57d2('0x4e')](handleError(_0x46c7de,null));};exports[_0x57d2('0x71')]=function(_0x26da1b,_0x1bf74a,_0x144229){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x26da1b[_0x57d2('0x72')]['id']}})['then'](handleEntityNotFound(_0x1bf74a,null))[_0x57d2('0x2b')](function(_0x17b3c1){if(_0x17b3c1){return _0x17b3c1[_0x57d2('0x71')](_0x26da1b[_0x57d2('0x55')]['ids'],_[_0x57d2('0x73')](_0x26da1b['body'],['ids','id'])||{})[_0x57d2('0x74')](function(_0x4f30e8){for(var _0x282457=0x0;_0x282457<_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x57d2('0x3f')];_0x282457+=0x1){socket['emit'](_0x57d2('0x76'),{'UserId':Number(_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x282457]),'VoicePrefixId':Number(_0x26da1b[_0x57d2('0x72')]['id'])});}return _0x4f30e8;});}})[_0x57d2('0x2b')](respondWithResult(_0x1bf74a,null))[_0x57d2('0x4e')](handleError(_0x1bf74a,null));};exports[_0x57d2('0x77')]=function(_0x41ca89,_0x1d147f,_0x261850){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x41ca89[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x1d147f,null))[_0x57d2('0x2b')](function(_0x468990){if(_0x468990){return _0x468990[_0x57d2('0x77')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])[_0x57d2('0x2b')](function(){if(_[_0x57d2('0x78')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])){for(var _0x54edaf=0x0;_0x54edaf<_0x41ca89['query'][_0x57d2('0x75')][_0x57d2('0x3f')];_0x54edaf+=0x1){socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')]['ids'][_0x54edaf]),'VoicePrefixId':Number(_0x41ca89['params']['id'])});}}else{socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')]),'VoicePrefixId':Number(_0x41ca89[_0x57d2('0x72')]['id'])});}});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x1d147f,null))['catch'](handleError(_0x1d147f,null));};exports[_0x57d2('0x7b')]=function(_0x2f5625,_0x5bb7cd,_0x4913c0){var _0x5ac6ee={};var _0x5b3cc6={};var _0xa557d6;var _0x4a7e00;return db[_0x57d2('0x4b')]['findOne']({'where':{'id':_0x2f5625[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x5bb7cd,null))[_0x57d2('0x2b')](function(_0x1dbe31){if(_0x1dbe31){_0xa557d6=_0x1dbe31;_0x5b3cc6[_0x57d2('0x3d')]=_['keys'](db[_0x57d2('0x7c')][_0x57d2('0x36')]);_0x5b3cc6[_0x57d2('0x39')]=_['keys'](_0x2f5625[_0x57d2('0x39')]);_0x5b3cc6[_0x57d2('0x45')]=_[_0x57d2('0x3c')](_0x5b3cc6[_0x57d2('0x3d')],_0x5b3cc6[_0x57d2('0x39')]);_0x5ac6ee[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x5b3cc6['model'],qs['fields'](_0x2f5625['query'][_0x57d2('0x3e')]));_0x5ac6ee[_0x57d2('0x3b')]=_0x5ac6ee[_0x57d2('0x3b')]['length']?_0x5ac6ee[_0x57d2('0x3b')]:_0x5b3cc6[_0x57d2('0x3d')];_0x5ac6ee[_0x57d2('0x42')]=qs[_0x57d2('0x43')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x43')]);_0x5ac6ee[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_['pick'](_0x2f5625[_0x57d2('0x39')],_0x5b3cc6[_0x57d2('0x45')]));if(_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]){_0x5ac6ee['where']=_['merge'](_0x5ac6ee[_0x57d2('0x44')],{'$or':_['map'](_0x5ac6ee[_0x57d2('0x3b')],function(_0x598d62){var _0x3a35d7={};_0x3a35d7[_0x598d62]={'$like':'%'+_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x3a35d7;})});}_0x5ac6ee=_['merge']({},_0x5ac6ee,_0x2f5625[_0x57d2('0x4a')]);return _0xa557d6['getAgents'](_0x5ac6ee);}})[_0x57d2('0x2b')](function(_0xe71357){if(_0xe71357){_0x4a7e00=_0xe71357[_0x57d2('0x3f')];if(!_0x2f5625[_0x57d2('0x39')][_0x57d2('0x40')](_0x57d2('0x41'))){_0x5ac6ee[_0x57d2('0x20')]=qs[_0x57d2('0x20')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x20')]);_0x5ac6ee[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x23')]);}return _0xa557d6[_0x57d2('0x7b')](_0x5ac6ee);}})['then'](function(_0x3a7d89){if(_0x3a7d89){return _0x3a7d89?{'count':_0x4a7e00,'rows':_0x3a7d89}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x5bb7cd,null))[_0x57d2('0x4e')](handleError(_0x5bb7cd,null));};exports[_0x57d2('0x7d')]=function(_0x4d83cf,_0x93bc52,_0x362b77){var _0x2728ba={};var _0x4f6585={};var _0x34f39a;var _0x1a90cb;return db[_0x57d2('0x4b')][_0x57d2('0x7e')]({'where':{'id':_0x4d83cf[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x93bc52,null))[_0x57d2('0x2b')](function(_0x1ba236){if(_0x1ba236){_0x34f39a=_0x1ba236;_0x4f6585[_0x57d2('0x3d')]=_[_0x57d2('0x3a')](db['Team']['rawAttributes']);_0x4f6585[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x4d83cf[_0x57d2('0x39')]);_0x4f6585[_0x57d2('0x45')]=_['intersection'](_0x4f6585[_0x57d2('0x3d')],_0x4f6585[_0x57d2('0x39')]);_0x2728ba[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x4f6585[_0x57d2('0x3d')],qs['fields'](_0x4d83cf['query']['fields']));_0x2728ba['attributes']=_0x2728ba['attributes'][_0x57d2('0x3f')]?_0x2728ba['attributes']:_0x4f6585[_0x57d2('0x3d')];_0x2728ba[_0x57d2('0x42')]=qs['sort'](_0x4d83cf[_0x57d2('0x39')]['sort']);_0x2728ba[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x4d83cf[_0x57d2('0x39')],_0x4f6585['filters']));if(_0x4d83cf[_0x57d2('0x39')]['filter']){_0x2728ba['where']=_[_0x57d2('0x47')](_0x2728ba[_0x57d2('0x44')],{'$or':_[_0x57d2('0x35')](_0x2728ba[_0x57d2('0x3b')],function(_0x127224){var _0x47ee55={};_0x47ee55[_0x127224]={'$like':'%'+_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x47ee55;})});}_0x2728ba=_[_0x57d2('0x47')]({},_0x2728ba,_0x4d83cf[_0x57d2('0x4a')]);return _0x34f39a[_0x57d2('0x7d')](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x4773a4){if(_0x4773a4){_0x1a90cb=_0x4773a4[_0x57d2('0x3f')];if(!_0x4d83cf['query']['hasOwnProperty'](_0x57d2('0x41'))){_0x2728ba['limit']=qs[_0x57d2('0x20')](_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x20')]);_0x2728ba[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x4d83cf['query'][_0x57d2('0x23')]);}return _0x34f39a['getTeams'](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x888a75){if(_0x888a75){return _0x888a75?{'count':_0x1a90cb,'rows':_0x888a75}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x93bc52,null))[_0x57d2('0x4e')](handleError(_0x93bc52,null));};exports[_0x57d2('0x7f')]=function(_0x37608b,_0x5cb4b6,_0xa4b4fd){var _0x3c9d18=_0x37608b[_0x57d2('0x55')][_0x57d2('0x75')];var _0x55f7df;return db['Team']['findAll']({'where':{'id':_0x3c9d18},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id',_0x57d2('0x32'),_0x57d2('0x81'),'voicePause',_0x57d2('0x82')],'raw':!![]}]})[_0x57d2('0x2b')](function(_0x178706){if(_0x178706){_0x55f7df=_0x178706;var _0xa92185=_['flatMap'](_0x178706,function(_0x3865c7){var _0x1d9c66=_0x3865c7[_0x57d2('0x2d')]({'plain':!![]});return _0x1d9c66[_0x57d2('0x80')];});return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x37608b['params']['id']}})['then'](function(_0x5a4689){return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x488dcd){return _0x5a4689['addTeams'](_0x3c9d18,{'transaction':_0x488dcd})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0x55f7df,function(_0x23a448){return db['TeamVoicePrefix'][_0x57d2('0x84')]({'TeamId':_0x23a448['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},{'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0xa92185,function(_0xa269b5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0xa269b5['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){_0xa92185[_0x57d2('0x85')](function(_0x434389){socket['emit'](_0x57d2('0x76'),{'UserId':_0x434389['id'],'VoicePrefixId':_0x5a4689['id']});});});});});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x5cb4b6,null))['catch'](handleError(_0x5cb4b6,null));};exports[_0x57d2('0x86')]=function(_0x29b37c,_0x531b42,_0x120e28){return db[_0x57d2('0x87')][_0x57d2('0x4d')]({'where':{'id':_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')]},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x531b42,null))[_0x57d2('0x2b')](function(_0x2809c1){var _0x5444bf=_[_0x57d2('0x35')](_0x2809c1,'id');var _0x3da7ba=[];var _0x2fc3b5=[];var _0x41ba89=squel['select']();_0x41ba89[_0x57d2('0x88')]('tq.TeamId')[_0x57d2('0x89')](_0x57d2('0x8a'),'tq')[_0x57d2('0x8b')](_0x57d2('0x8c'),'ut',_0x57d2('0x8d'))[_0x57d2('0x44')](_0x57d2('0x8e'),_0x29b37c[_0x57d2('0x72')]['id']);for(var _0x112218=0x0;_0x112218<_0x2809c1[_0x57d2('0x3f')];_0x112218+=0x1){let _0x57314b=_0x2809c1[_0x112218];for(var _0x3acffd=0x0;_0x3acffd<_0x57314b[_0x57d2('0x80')]['length'];_0x3acffd+=0x1){let _0x447051=_0x57314b[_0x57d2('0x80')][_0x3acffd];var _0x511494=_0x41ba89[_0x57d2('0x8f')]();_0x511494[_0x57d2('0x44')](_0x57d2('0x90'),_0x447051['id']);_0x2fc3b5[_0x57d2('0x66')](db['sequelize'][_0x57d2('0x39')](_0x511494[_0x57d2('0x91')](),{'type':db['sequelize'][_0x57d2('0x92')][_0x57d2('0x93')]})[_0x57d2('0x2b')](function(_0x13aec4){if(_0x13aec4[_0x57d2('0x3f')]===0x1){return _0x447051['id'];}else{var _0x4e3497=_[_0x57d2('0x94')](_[_0x57d2('0x35')](_0x13aec4,'TeamId'),function(_0xb122b9){return _[_0x57d2('0x95')](_0x5444bf,_0xb122b9);});if(_0x4e3497){return _0x447051['id'];}}}));}}return BPromise[_0x57d2('0x96')](_0x2fc3b5)['then'](function(_0xdc5333){_0x3da7ba=_(_0x3da7ba)[_0x57d2('0x97')](_0xdc5333)['compact']()[_0x57d2('0x98')]();return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x29b37c[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](function(_0x456ed3){return db['sequelize'][_0x57d2('0x53')](function(_0x376cea){return _0x456ed3[_0x57d2('0x86')](_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')],{'transaction':_0x376cea})[_0x57d2('0x2b')](function(){if(!_[_0x57d2('0x99')](_0x3da7ba)){return _0x456ed3[_0x57d2('0x77')](_0x3da7ba,{'transaction':_0x376cea});}})[_0x57d2('0x2b')](function(){_0x3da7ba['forEach'](function(_0x5b7f18){socket[_0x57d2('0x79')]('userVoicePrefix:remove',{'UserId':_0x5b7f18,'VoicePrefixId':_0x456ed3['id']});});});});});});})[_0x57d2('0x2b')](respondWithStatusCode(_0x531b42,null))['catch'](handleError(_0x531b42,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 2083b75..30b684a 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 _0x7f47=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x28fd82,_0x299ccb){var _0x144341=function(_0x1e1507){while(--_0x1e1507){_0x28fd82['push'](_0x28fd82['shift']());}};_0x144341(++_0x299ccb);}(_0x7f47,0x9a));var _0x77f4=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0x7f47[_0x392dc2];return _0x14150f;};'use strict';var EventEmitter=require(_0x77f4('0x0'));var VoicePrefix=require(_0x77f4('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x77f4('0x2')](0x0);var events={'afterCreate':_0x77f4('0x3'),'afterUpdate':_0x77f4('0x4'),'afterDestroy':_0x77f4('0x5')};function emitEvent(_0x533e61){return function(_0x253800,_0x4b788b,_0x3583bb){VoicePrefixEvents[_0x77f4('0x6')](_0x533e61+':'+_0x253800['id'],_0x253800);VoicePrefixEvents['emit'](_0x533e61,_0x253800);_0x3583bb(null);};}for(var e in events){if(events[_0x77f4('0x7')](e)){var event=events[e];VoicePrefix[_0x77f4('0x8')](e,emitEvent(event));}}module[_0x77f4('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x4766=['hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x393000,_0x45b998){var _0x20ba08=function(_0x404235){while(--_0x404235){_0x393000['push'](_0x393000['shift']());}};_0x20ba08(++_0x45b998);}(_0x4766,0x160));var _0x6476=function(_0x47a3c2,_0x2df47c){_0x47a3c2=_0x47a3c2-0x0;var _0xe88445=_0x4766[_0x47a3c2];return _0xe88445;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x6476('0x0'))['db'][_0x6476('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6476('0x2')](0x0);var events={'afterCreate':_0x6476('0x3'),'afterUpdate':_0x6476('0x4'),'afterDestroy':_0x6476('0x5')};function emitEvent(_0x13e10c){return function(_0x4f378e,_0x21d47a,_0x371325){VoicePrefixEvents['emit'](_0x13e10c+':'+_0x4f378e['id'],_0x4f378e);VoicePrefixEvents[_0x6476('0x6')](_0x13e10c,_0x4f378e);_0x371325(null);};}for(var e in events){if(events[_0x6476('0x7')](e)){var event=events[e];VoicePrefix[_0x6476('0x8')](e,emitEvent(event));}}module[_0x6476('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 0803c91..4f9ead9 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 _0xc169=['../../config/logger','api','bluebird','request-promise','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x3fcb41,_0x2f3ff2){var _0x37427d=function(_0x4ac1cd){while(--_0x4ac1cd){_0x3fcb41['push'](_0x3fcb41['shift']());}};_0x37427d(++_0x2f3ff2);}(_0xc169,0x1ee));var _0x9c16=function(_0x3bf4f0,_0x316456){_0x3bf4f0=_0x3bf4f0-0x0;var _0x2c6a5c=_0xc169[_0x3bf4f0];return _0x2c6a5c;};'use strict';var _=require(_0x9c16('0x0'));var util=require('util');var logger=require(_0x9c16('0x1'))(_0x9c16('0x2'));var moment=require('moment');var BPromise=require(_0x9c16('0x3'));var rp=require(_0x9c16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c16('0x5'));module['exports']=function(_0xd9756f,_0x152b8f){return _0xd9756f[_0x9c16('0x6')](_0x9c16('0x7'),attributes,{'tableName':_0x9c16('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x894a=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x473a2f,_0x5f24f8){var _0x419d1d=function(_0x216eca){while(--_0x216eca){_0x473a2f['push'](_0x473a2f['shift']());}};_0x419d1d(++_0x5f24f8);}(_0x894a,0x119));var _0xa894=function(_0x5dcabf,_0x124da1){_0x5dcabf=_0x5dcabf-0x0;var _0x4e24a5=_0x894a[_0x5dcabf];return _0x4e24a5;};'use strict';var _=require('lodash');var util=require(_0xa894('0x0'));var logger=require(_0xa894('0x1'))('api');var moment=require(_0xa894('0x2'));var BPromise=require('bluebird');var rp=require(_0xa894('0x3'));var fs=require('fs');var path=require(_0xa894('0x4'));var rimraf=require(_0xa894('0x5'));var config=require(_0xa894('0x6'));var attributes=require(_0xa894('0x7'));module[_0xa894('0x8')]=function(_0x5d4699,_0x1cbfa1){return _0x5d4699[_0xa894('0x9')](_0xa894('0xa'),attributes,{'tableName':_0xa894('0xb'),'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 cb52d5e..56bea58 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 _0xcdd2=['./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x333137,_0x120ff3){var _0x3343be=function(_0x325efb){while(--_0x325efb){_0x333137['push'](_0x333137['shift']());}};_0x3343be(++_0x120ff3);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var moment=require(_0x2cdd('0x2'));var BPromise=require(_0x2cdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cdd('0x4'));var db=require(_0x2cdd('0x5'))['db'];var utils=require(_0x2cdd('0x6'));var logger=require(_0x2cdd('0x7'))('rpc');var config=require(_0x2cdd('0x8'));var jayson=require(_0x2cdd('0x9'));var client=jayson['client'][_0x2cdd('0xa')]({'port':0x232a});config[_0x2cdd('0xb')]=_[_0x2cdd('0xc')](config[_0x2cdd('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2cdd('0xd'))['register'](socket);function respondWithRpcPromise(_0x12cdca,_0x3e3cf0,_0x370b33){return new BPromise(function(_0x555ba7,_0x3feff9){return client[_0x2cdd('0xe')](_0x12cdca,_0x370b33)[_0x2cdd('0xf')](function(_0x20ab30){logger[_0x2cdd('0x10')](_0x2cdd('0x11'),_0x3e3cf0,'request\x20sent');logger['debug'](_0x2cdd('0x12'),_0x3e3cf0,_0x2cdd('0x13'),JSON['stringify'](_0x20ab30));if(_0x20ab30[_0x2cdd('0x14')]){if(_0x20ab30[_0x2cdd('0x14')][_0x2cdd('0x15')]===0x1f4){logger[_0x2cdd('0x14')](_0x2cdd('0x11'),_0x3e3cf0,_0x20ab30['error'][_0x2cdd('0x16')]);return _0x3feff9(_0x20ab30[_0x2cdd('0x14')]['message']);}logger[_0x2cdd('0x14')](_0x2cdd('0x11'),_0x3e3cf0,_0x20ab30[_0x2cdd('0x14')][_0x2cdd('0x16')]);return _0x555ba7(_0x20ab30[_0x2cdd('0x14')][_0x2cdd('0x16')]);}else{logger['info'](_0x2cdd('0x11'),_0x3e3cf0,_0x2cdd('0x13'));_0x555ba7(_0x20ab30[_0x2cdd('0x17')][_0x2cdd('0x16')]);}})['catch'](function(_0x23f7a6){logger[_0x2cdd('0x14')](_0x2cdd('0x11'),_0x3e3cf0,_0x23f7a6);_0x3feff9(_0x23f7a6);});});} \ No newline at end of file +var _0x297f=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','randomstring','ioredis'];(function(_0x444244,_0x18a014){var _0x1a9422=function(_0x328cfc){while(--_0x328cfc){_0x444244['push'](_0x444244['shift']());}};_0x1a9422(++_0x18a014);}(_0x297f,0x1f0));var _0xf297=function(_0x372567,_0x2db9d8){_0x372567=_0x372567-0x0;var _0x2b35f2=_0x297f[_0x372567];return _0x2b35f2;};'use strict';var _=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf297('0x2'));var fs=require('fs');var Redis=require(_0xf297('0x3'));var db=require(_0xf297('0x4'))['db'];var utils=require(_0xf297('0x5'));var logger=require('../../config/logger')(_0xf297('0x6'));var config=require('../../config/environment');var jayson=require(_0xf297('0x7'));var client=jayson[_0xf297('0x8')][_0xf297('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf297('0xa')],{'host':_0xf297('0xb'),'port':0x18eb});var socket=require(_0xf297('0xc'))(new Redis(config['redis']));require(_0xf297('0xd'))[_0xf297('0xe')](socket);function respondWithRpcPromise(_0x581c1a,_0x2babd0,_0x481d0d){return new BPromise(function(_0x42a905,_0x372df7){return client[_0xf297('0xf')](_0x581c1a,_0x481d0d)['then'](function(_0x3ac61c){logger['info'](_0xf297('0x10'),_0x2babd0,'request\x20sent');logger['debug'](_0xf297('0x11'),_0x2babd0,_0xf297('0x12'),JSON[_0xf297('0x13')](_0x3ac61c));if(_0x3ac61c[_0xf297('0x14')]){if(_0x3ac61c[_0xf297('0x14')][_0xf297('0x15')]===0x1f4){logger['error'](_0xf297('0x10'),_0x2babd0,_0x3ac61c[_0xf297('0x14')]['message']);return _0x372df7(_0x3ac61c[_0xf297('0x14')]['message']);}logger[_0xf297('0x14')](_0xf297('0x10'),_0x2babd0,_0x3ac61c[_0xf297('0x14')]['message']);return _0x42a905(_0x3ac61c['error'][_0xf297('0x16')]);}else{logger[_0xf297('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2babd0,'request\x20sent');_0x42a905(_0x3ac61c[_0xf297('0x18')][_0xf297('0x16')]);}})['catch'](function(_0x178eb6){logger[_0xf297('0x14')](_0xf297('0x10'),_0x2babd0,_0x178eb6);_0x372df7(_0x178eb6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f206998..80d1212 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 _0xbca8=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','register'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0xbca8,0xcc));var _0x8bca=function(_0x1d79ef,_0x4e2a94){_0x1d79ef=_0x1d79ef-0x0;var _0x20001c=_0xbca8[_0x1d79ef];return _0x20001c;};'use strict';var VoicePrefixEvents=require(_0x8bca('0x0'));var events=[_0x8bca('0x1'),_0x8bca('0x2'),_0x8bca('0x3')];function createListener(_0x17db5b,_0x51da56){return function(_0x129f58){_0x51da56[_0x8bca('0x4')](_0x17db5b,_0x129f58);};}function removeListener(_0x34d392,_0x5cafc7){return function(){VoicePrefixEvents['removeListener'](_0x34d392,_0x5cafc7);};}exports[_0x8bca('0x5')]=function(_0x2ecf60){for(var _0x318474=0x0,_0x348ddd=events['length'];_0x318474<_0x348ddd;_0x318474++){var _0x3fdccf=events[_0x318474];var _0x38e241=createListener(_0x8bca('0x6')+_0x3fdccf,_0x2ecf60);VoicePrefixEvents['on'](_0x3fdccf,_0x38e241);}}; \ No newline at end of file +var _0x50c1=['./voicePrefix.events','remove','emit','removeListener','length','voicePrefix:'];(function(_0xbd5095,_0x4a3b86){var _0x102019=function(_0x22c5d3){while(--_0x22c5d3){_0xbd5095['push'](_0xbd5095['shift']());}};_0x102019(++_0x4a3b86);}(_0x50c1,0x1b6));var _0x150c=function(_0x527d8b,_0x336b66){_0x527d8b=_0x527d8b-0x0;var _0x3c4db4=_0x50c1[_0x527d8b];return _0x3c4db4;};'use strict';var VoicePrefixEvents=require(_0x150c('0x0'));var events=['save',_0x150c('0x1'),'update'];function createListener(_0x42ba13,_0x786960){return function(_0x4fdcdf){_0x786960[_0x150c('0x2')](_0x42ba13,_0x4fdcdf);};}function removeListener(_0x1293c7,_0x2f43b9){return function(){VoicePrefixEvents[_0x150c('0x3')](_0x1293c7,_0x2f43b9);};}exports['register']=function(_0x807f0f){for(var _0x11317c=0x0,_0x4ae5a9=events[_0x150c('0x4')];_0x11317c<_0x4ae5a9;_0x11317c++){var _0x19abd2=events[_0x11317c];var _0x316817=createListener(_0x150c('0x5')+_0x19abd2,_0x807f0f);VoicePrefixEvents['on'](_0x19abd2,_0x316817);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 321d709..1d9afe0 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xb10b,0x12a));var _0xbb10=function(_0x47c901,_0x16799f){_0x47c901=_0x47c901-0x0;var _0x5f15c8=_0xb10b[_0x47c901];return _0x5f15c8;};'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(_0x517e22,_0x213046){var _0x7ea868=function(_0x503d6e){while(--_0x503d6e){_0x517e22['push'](_0x517e22['shift']());}};_0x7ea868(++_0x213046);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 c1f3d6e..ee32b90 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 _0x2bc5=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','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','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','random','rrmemory','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2bc5,0x111));var _0x52bc=function(_0xc0374e,_0x2de1fc){_0xc0374e=_0xc0374e-0x0;var _0x3cabe1=_0x2bc5[_0xc0374e];return _0x3cabe1;};'use strict';var Sequelize=require(_0x52bc('0x0'));module[_0x52bc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x3'),_0x52bc('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':_0x52bc('0x6')},'announce':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x52bc('0x2')]('rr',_0x52bc('0x7'),_0x52bc('0x8'),'fewestcalls',_0x52bc('0x9'),_0x52bc('0xa'),'linear',_0x52bc('0xb'),_0x52bc('0xc')),'allowNull':![],'defaultValue':_0x52bc('0x7'),'set':function(_0x4cd147){this[_0x52bc('0xd')]('strategy',_0x4cd147?_0x4cd147:_0x52bc('0xa'));},'get':function(){var _0xf94ca4=this[_0x52bc('0xe')](_0x52bc('0xf'));var _0x4758bd=this[_0x52bc('0xe')](_0x52bc('0x10'));var _0x4d7650=this[_0x52bc('0xe')](_0x52bc('0x11'));if(_0xf94ca4==='inbound'){return _0x4d7650;}if(_0x4758bd===_0x52bc('0x12')&&_0x4d7650==='rrmemory'||_0x4758bd===_0x52bc('0x12')&&_0x4d7650===_0x52bc('0x13')){return _0x4d7650;}if(_0x4758bd==='progressive'||_0x4758bd===_0x52bc('0x14')||_0x4758bd===_0x52bc('0x15')){return _0x4d7650;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x52bc('0x16')](0xb)},'timeout':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x52bc('0x5')]},'weight':{'type':Sequelize[_0x52bc('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no',_0x52bc('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x52bc('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x52bc('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':_0x52bc('0x17')},'announce_holdtime':{'type':Sequelize[_0x52bc('0x2')]('yes','no',_0x52bc('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x52bc('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x52bc('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x52bc('0x5')]},'queue_youarenext':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x52bc('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x52bc('0x5')]},'periodic_announce':{'type':Sequelize[_0x52bc('0x1a')],'set':function(_0x52f5e0){this['setDataValue'](_0x52bc('0x1b'),_0x52f5e0?_0x52f5e0[_0x52bc('0x1c')](','):[]);},'get':function(){return this[_0x52bc('0xe')](_0x52bc('0x1b'))?this[_0x52bc('0xe')](_0x52bc('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':_0x52bc('0x17'),'set':function(_0x6387ad){this['setDataValue'](_0x52bc('0x1d'),_0x6387ad?_0x6387ad[_0x52bc('0x1c')](','):undefined);},'get':function(){return this[_0x52bc('0xe')]('joinempty')?this[_0x52bc('0xe')]('joinempty')[_0x52bc('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':'no','set':function(_0x3a2e0a){this['setDataValue'](_0x52bc('0x1f'),_0x3a2e0a?_0x3a2e0a[_0x52bc('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x52bc('0x1f'))?this[_0x52bc('0xe')](_0x52bc('0x1f'))[_0x52bc('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x52bc('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x52bc('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x52bc('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1941db){this[_0x52bc('0xd')](_0x52bc('0x20'),_0x1941db);if(_0x1941db){if(this[_0x52bc('0xe')](_0x52bc('0x21'))<0x2){this[_0x52bc('0xd')](_0x52bc('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x52bc('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':0x0,'comment':_0x52bc('0x23')},'dialMethod':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x24'),_0x52bc('0x25'),_0x52bc('0x15'),_0x52bc('0x14'),_0x52bc('0x12')),'defaultValue':'progressive','comment':_0x52bc('0x26')},'dialLimitChannel':{'type':Sequelize[_0x52bc('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x52bc('0x16')](0x4)[_0x52bc('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x52bc('0x28')](0x2)[_0x52bc('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x52bc('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x2a'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x52bc('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x52bc('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x52bc('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':_0x52bc('0x2d'),'comment':_0x52bc('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x2f')},'dialQueueProject':{'type':Sequelize[_0x52bc('0x5')],'comment':_0x52bc('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x52bc('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)[_0x52bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x52bc('0x37')},'dialTimezone':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x52bc('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x38'),_0x52bc('0x39'),_0x52bc('0x3a')),'defaultValue':_0x52bc('0x38')},'dialAMDActive':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x52bc('0x16')](0x9)[_0x52bc('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x52bc('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x52bc('0x16')](0x9)[_0x52bc('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x52bc('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x52bc('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x52bc('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x52bc('0x16')](0x9)[_0x52bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52bc('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x52bc('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x52bc('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x52bc('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x52bc('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x52bc('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x52bc('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x52bc('0x16')](0x5)[_0x52bc('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x52bc('0x16')](0x9)[_0x52bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52bc('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x52bc('0x16')](0x5)[_0x52bc('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x52bc('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x52bc('0x2')](_0x52bc('0x44'),_0x52bc('0x45')),'defaultValue':_0x52bc('0x44')},'dialQueueProject2':{'type':Sequelize[_0x52bc('0x5')],'comment':_0x52bc('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x52bc('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x52bc('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52bc('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)[_0x52bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x52bc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52bc('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x52bc('0x16')](0x5)[_0x52bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52bc('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x52bc('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':![],'comment':_0x52bc('0x50'),'set':function(_0x216f0c){if(!_0x216f0c)this[_0x52bc('0xd')](_0x52bc('0x51'),null);this[_0x52bc('0xd')]('mandatoryDisposition',_0x216f0c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x52bc('0x16')](0x3)[_0x52bc('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x52bc('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x52bc('0x22')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd858=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','name','inbound','STRING','default','ENUM','ringall','leastrecent','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','roundrobin','progressive','power','INTEGER','yes','all','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','predictive','booked','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xd858,0xb7));var _0x8d85=function(_0x431fd3,_0x2cb79b){_0x431fd3=_0x431fd3-0x0;var _0x51811f=_0xd858[_0x431fd3];return _0x51811f;};'use strict';var Sequelize=require(_0x8d85('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8d85('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8d85('0x2'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':_0x8d85('0x4')},'announce':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8d85('0x5')]('rr',_0x8d85('0x6'),_0x8d85('0x7'),'fewestcalls',_0x8d85('0x8'),'rrmemory',_0x8d85('0x9'),_0x8d85('0xa'),_0x8d85('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2abbdf){this[_0x8d85('0xc')](_0x8d85('0xd'),_0x2abbdf?_0x2abbdf:_0x8d85('0xe'));},'get':function(){var _0x13df5d=this[_0x8d85('0xf')](_0x8d85('0x10'));var _0x4fe3e5=this[_0x8d85('0xf')](_0x8d85('0x11'));var _0x2ae350=this[_0x8d85('0xf')](_0x8d85('0xd'));if(_0x13df5d===_0x8d85('0x2')){return _0x2ae350;}if(_0x4fe3e5==='booked'&&_0x2ae350===_0x8d85('0xe')||_0x4fe3e5==='booked'&&_0x2ae350===_0x8d85('0x12')){return _0x2ae350;}if(_0x4fe3e5===_0x8d85('0x13')||_0x4fe3e5==='predictive'||_0x4fe3e5===_0x8d85('0x14')){return _0x2ae350;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8d85('0x3')]},'weight':{'type':Sequelize[_0x8d85('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8d85('0x5')]('yes','no'),'defaultValue':_0x8d85('0x16')},'autopause':{'type':Sequelize[_0x8d85('0x5')]('yes','no',_0x8d85('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8d85('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x8d85('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x8d85('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8d85('0x5')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defaultValue':_0x8d85('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x8d85('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x8d85('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8d85('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8d85('0x3')]},'queue_youarenext':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8d85('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8d85('0x3')]},'queue_quantity1':{'type':Sequelize[_0x8d85('0x3')]},'queue_quantity2':{'type':Sequelize[_0x8d85('0x3')]},'queue_periodic_announce':{'type':Sequelize[_0x8d85('0x3')]},'queue_less_than':{'type':Sequelize[_0x8d85('0x3')]},'periodic_announce':{'type':Sequelize[_0x8d85('0x18')],'set':function(_0x3437c0){this['setDataValue'](_0x8d85('0x19'),_0x3437c0?_0x3437c0[_0x8d85('0x1a')](','):[]);},'get':function(){return this[_0x8d85('0xf')]('periodic_announce')?this['getDataValue'](_0x8d85('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':'yes','set':function(_0x1df80a){this[_0x8d85('0xc')](_0x8d85('0x1b'),_0x1df80a?_0x1df80a[_0x8d85('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x8d85('0x1b'))?this[_0x8d85('0xf')]('joinempty')[_0x8d85('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':'no','set':function(_0x250a73){this[_0x8d85('0xc')](_0x8d85('0x1d'),_0x250a73?_0x250a73[_0x8d85('0x1a')](','):undefined);},'get':function(){return this[_0x8d85('0xf')](_0x8d85('0x1d'))?this[_0x8d85('0xf')](_0x8d85('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8d85('0x5')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8d85('0x5')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8d85('0x3')]},'description':{'type':Sequelize[_0x8d85('0x3')]},'acw':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':0x0,'set':function(_0x1f934e){this['setDataValue'](_0x8d85('0x1f'),_0x1f934e);if(_0x1f934e){if(this[_0x8d85('0xf')](_0x8d85('0x20'))<0x2){this['setDataValue'](_0x8d85('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8d85('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x21'),_0x8d85('0x13'),_0x8d85('0x14'),_0x8d85('0x22'),_0x8d85('0x23')),'defaultValue':_0x8d85('0x13'),'comment':_0x8d85('0x24')},'dialLimitChannel':{'type':Sequelize[_0x8d85('0x15')](0x4)[_0x8d85('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x8d85('0x15')](0x4)[_0x8d85('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x8d85('0x26')](0x2)[_0x8d85('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8d85('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x28'),_0x8d85('0x29')),'defaultValue':'dropRate','comment':_0x8d85('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8d85('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8d85('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8d85('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x8d85('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x8d85('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x8d85('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x2e')},'dialQueueProject':{'type':Sequelize[_0x8d85('0x3')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'comment':_0x8d85('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8d85('0x34')},'dialTimezone':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x8d85('0x35')},'dialPrefix':{'type':Sequelize[_0x8d85('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8d85('0x5')](_0x8d85('0x36'),_0x8d85('0x37'),_0x8d85('0x38')),'defaultValue':_0x8d85('0x36')},'dialAMDActive':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8d85('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8d85('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8d85('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8d85('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8d85('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8d85('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8d85('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8d85('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8d85('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8d85('0x15')](0x9)[_0x8d85('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8d85('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':0x0,'comment':_0x8d85('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8d85('0x5')]('DESC',_0x8d85('0x42')),'defaultValue':_0x8d85('0x43')},'dialQueueProject2':{'type':Sequelize[_0x8d85('0x3')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8d85('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8d85('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8d85('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8d85('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8d85('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8d85('0x15')](0x3)[_0x8d85('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8d85('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8d85('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8d85('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x8d85('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':![],'comment':_0x8d85('0x4e'),'set':function(_0x466bab){if(!_0x466bab)this[_0x8d85('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8d85('0x4f'),_0x466bab);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8d85('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x8d85('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8d85('0x1e')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 975c108..5f74721 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 _0x5a4c=['create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','findOne','CmHopper','findAll','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','format','getAgents','getMembers','getLists','CmList','addLists','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20NOT\x20IN\x20(?)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','includeAll','rows','catch','params','length','include'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x5a4c,0x120));var _0xc5a4=function(_0x29eb5e,_0x2c205d){_0x29eb5e=_0x29eb5e-0x0;var _0x2ee0f9=_0x5a4c[_0x29eb5e];return _0x2ee0f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5a4('0x0'));var zipdir=require(_0xc5a4('0x1'));var jsonpatch=require(_0xc5a4('0x2'));var rp=require('request-promise');var moment=require(_0xc5a4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc5a4('0x4'));var path=require(_0xc5a4('0x5'));var sox=require(_0xc5a4('0x6'));var csv=require(_0xc5a4('0x7'));var ejs=require(_0xc5a4('0x8'));var fs=require('fs');var fs_extra=require(_0xc5a4('0x9'));var _=require(_0xc5a4('0xa'));var squel=require(_0xc5a4('0xb'));var crypto=require(_0xc5a4('0xc'));var jsforce=require(_0xc5a4('0xd'));var deskjs=require(_0xc5a4('0xe'));var toCsv=require(_0xc5a4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc5a4('0xf'));var authService=require(_0xc5a4('0x10'));var qs=require(_0xc5a4('0x11'));var as=require(_0xc5a4('0x12'));var hardwareService=require(_0xc5a4('0x13'));var logger=require(_0xc5a4('0x14'))('api');var utils=require(_0xc5a4('0x15'));var config=require(_0xc5a4('0x16'));var licenseUtil=require(_0xc5a4('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5a4('0x18')]=_[_0xc5a4('0x19')](config[_0xc5a4('0x18')],{'host':_0xc5a4('0x1a'),'port':0x18eb});var socket=require(_0xc5a4('0x1b'))(new Redis(config['redis']));require(_0xc5a4('0x1c'))[_0xc5a4('0x1d')](socket);function respondWithStatusCode(_0x228e15,_0x244435){_0x244435=_0x244435||0xcc;return function(_0x588d05){if(_0x588d05){return _0x228e15[_0xc5a4('0x1e')](_0x244435);}return _0x228e15['status'](_0x244435)[_0xc5a4('0x1f')]();};}function respondWithResult(_0xa82ae7,_0x4eb04e){_0x4eb04e=_0x4eb04e||0xc8;return function(_0x1b4594){if(_0x1b4594){return _0xa82ae7[_0xc5a4('0x20')](_0x4eb04e)[_0xc5a4('0x21')](_0x1b4594);}};}function respondWithFilteredResult(_0x3c933e,_0xa0b080){return function(_0x1d8d50){if(_0x1d8d50){var _0x2855d1=typeof _0xa0b080[_0xc5a4('0x22')]==='undefined'&&typeof _0xa0b080[_0xc5a4('0x23')]===_0xc5a4('0x24');var _0x460878=_0x1d8d50[_0xc5a4('0x25')];var _0x2a87d0=_0x2855d1?0x0:_0xa0b080[_0xc5a4('0x22')];var _0x26d05c=_0x2855d1?_0x1d8d50['count']:_0xa0b080[_0xc5a4('0x22')]+_0xa0b080['limit'];var _0x3a93ee;if(_0x26d05c>=_0x460878){_0x26d05c=_0x460878;_0x3a93ee=0xc8;}else{_0x3a93ee=0xce;}_0x3c933e['status'](_0x3a93ee);return _0x3c933e[_0xc5a4('0x26')](_0xc5a4('0x27'),_0x2a87d0+'-'+_0x26d05c+'/'+_0x460878)['json'](_0x1d8d50);}return null;};}function patchUpdates(_0x5a75e8){return function(_0x302172){try{jsonpatch[_0xc5a4('0x28')](_0x302172,_0x5a75e8,!![]);}catch(_0x3c8ba7){return BPromise['reject'](_0x3c8ba7);}return _0x302172[_0xc5a4('0x29')]();};}function saveUpdates(_0x5d6f71,_0x2a0243){return function(_0xa93592){if(_0xa93592){return _0xa93592['update'](_0x5d6f71)[_0xc5a4('0x2a')](function(_0x3e8c32){return _0x3e8c32;});}return null;};}function removeEntity(_0x30936a,_0xe6378f){return function(_0x52b9b2){if(_0x52b9b2){return _0x52b9b2[_0xc5a4('0x2b')]()['then'](function(){var _0x4a6e64=_0x52b9b2[_0xc5a4('0x2c')]({'plain':!![]});var _0x2deb43=[{'name':_0xc5a4('0x2d'),'value':_0xc5a4('0x2e'),'ignore':![]},{'name':_0xc5a4('0x2f'),'value':_0xc5a4('0x30'),'ignore':![]}];var _0x34780a=_(_0x2deb43)[_0xc5a4('0x31')]('ignore')[_0xc5a4('0x32')](_0xc5a4('0x33'))[_0xc5a4('0x33')]();if(_['includes'](_0x34780a,_0x4a6e64['type'])){return;}var _0x581abd=_[_0xc5a4('0x34')](_0x2deb43,['value',_0x4a6e64['type']])[_0xc5a4('0x35')];return db['UserProfileResource'][_0xc5a4('0x2b')]({'where':{'type':_0x581abd,'resourceId':_0x4a6e64['id']}})[_0xc5a4('0x2a')](function(){return _0x52b9b2;});})[_0xc5a4('0x2a')](function(){_0x30936a[_0xc5a4('0x20')](0xcc)[_0xc5a4('0x1f')]();});}};}function handleEntityNotFound(_0x364db6,_0x2d9dd0){return function(_0x41c33a){if(!_0x41c33a){_0x364db6[_0xc5a4('0x1e')](0x194);}return _0x41c33a;};}function handleError(_0x1bd914,_0x19dc45){_0x19dc45=_0x19dc45||0x1f4;return function(_0x26b1b9){logger[_0xc5a4('0x36')](_0x26b1b9[_0xc5a4('0x37')]);if(_0x26b1b9['name']){delete _0x26b1b9[_0xc5a4('0x35')];}_0x1bd914['status'](_0x19dc45)[_0xc5a4('0x38')](_0x26b1b9);};}exports[_0xc5a4('0x39')]=function(_0x43820f,_0x37e9b){var _0x69bebc={},_0x45b1da={},_0x3bdafd={'count':0x0,'rows':[]};var _0x3219d7=_[_0xc5a4('0x32')](db[_0xc5a4('0x3a')][_0xc5a4('0x3b')],function(_0x480b31){return{'name':_0x480b31[_0xc5a4('0x3c')],'type':_0x480b31[_0xc5a4('0x3d')][_0xc5a4('0x3e')]};});_0x45b1da['model']=_[_0xc5a4('0x32')](_0x3219d7,_0xc5a4('0x35'));_0x45b1da[_0xc5a4('0x3f')]=_[_0xc5a4('0x40')](_0x43820f[_0xc5a4('0x3f')]);_0x45b1da['filters']=_[_0xc5a4('0x41')](_0x45b1da[_0xc5a4('0x42')],_0x45b1da[_0xc5a4('0x3f')]);_0x69bebc[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x45b1da[_0xc5a4('0x42')],qs['fields'](_0x43820f[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x69bebc[_0xc5a4('0x43')]=_0x69bebc[_0xc5a4('0x43')]['length']?_0x69bebc[_0xc5a4('0x43')]:_0x45b1da[_0xc5a4('0x42')];if(!_0x43820f['query'][_0xc5a4('0x45')](_0xc5a4('0x46'))){_0x69bebc[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x43820f[_0xc5a4('0x3f')][_0xc5a4('0x23')]);_0x69bebc[_0xc5a4('0x22')]=qs[_0xc5a4('0x22')](_0x43820f[_0xc5a4('0x3f')]['offset']);}_0x69bebc[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0x43820f[_0xc5a4('0x3f')]['sort']);_0x69bebc[_0xc5a4('0x49')]=qs['filters'](_[_0xc5a4('0x4a')](_0x43820f[_0xc5a4('0x3f')],_0x45b1da[_0xc5a4('0x4b')]),_0x3219d7);if(_0x43820f[_0xc5a4('0x3f')][_0xc5a4('0x31')]){_0x69bebc['where']=_[_0xc5a4('0x4c')](_0x69bebc[_0xc5a4('0x49')],{'$or':_['map'](_0x3219d7,function(_0x1411b6){if(_0x1411b6[_0xc5a4('0x3d')]!=='VIRTUAL'){var _0x5742cc={};_0x5742cc[_0x1411b6[_0xc5a4('0x35')]]={'$like':'%'+_0x43820f[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0x5742cc;}})});}_0x69bebc=_[_0xc5a4('0x4c')]({},_0x69bebc,_0x43820f[_0xc5a4('0x4d')]);var _0x1dd13f={'where':_0x69bebc[_0xc5a4('0x49')]};return db['VoiceQueue'][_0xc5a4('0x25')](_0x1dd13f)['then'](function(_0x24635f){_0x3bdafd['count']=_0x24635f;if(_0x43820f['query'][_0xc5a4('0x4e')]){_0x69bebc['include']=[{'all':!![]}];}return db[_0xc5a4('0x3a')]['findAll'](_0x69bebc);})[_0xc5a4('0x2a')](function(_0x4ac8c9){_0x3bdafd[_0xc5a4('0x4f')]=_0x4ac8c9;return _0x3bdafd;})[_0xc5a4('0x2a')](respondWithFilteredResult(_0x37e9b,_0x69bebc))[_0xc5a4('0x50')](handleError(_0x37e9b,null));};exports['show']=function(_0xcbc39c,_0x2ea459){var _0x39e6b5={'raw':![],'where':{'id':_0xcbc39c[_0xc5a4('0x51')]['id']}},_0x429ecc={};_0x429ecc[_0xc5a4('0x42')]=_[_0xc5a4('0x40')](db['VoiceQueue'][_0xc5a4('0x3b')]);_0x429ecc[_0xc5a4('0x3f')]=_['keys'](_0xcbc39c[_0xc5a4('0x3f')]);_0x429ecc[_0xc5a4('0x4b')]=_['intersection'](_0x429ecc[_0xc5a4('0x42')],_0x429ecc[_0xc5a4('0x3f')]);_0x39e6b5[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x429ecc['model'],qs[_0xc5a4('0x44')](_0xcbc39c[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x39e6b5[_0xc5a4('0x43')]=_0x39e6b5[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x39e6b5[_0xc5a4('0x43')]:_0x429ecc['model'];if(_0xcbc39c[_0xc5a4('0x3f')][_0xc5a4('0x4e')]){_0x39e6b5[_0xc5a4('0x53')]=[{'all':!![]}];}_0x39e6b5=_[_0xc5a4('0x4c')]({},_0x39e6b5,_0xcbc39c[_0xc5a4('0x4d')]);return db['VoiceQueue'][_0xc5a4('0x34')](_0x39e6b5)[_0xc5a4('0x2a')](handleEntityNotFound(_0x2ea459,null))[_0xc5a4('0x2a')](respondWithResult(_0x2ea459,null))['catch'](handleError(_0x2ea459,null));};exports[_0xc5a4('0x54')]=function(_0x39d004,_0x1cd5b3){return db[_0xc5a4('0x3a')][_0xc5a4('0x54')](_0x39d004['body'],{})[_0xc5a4('0x2a')](function(_0x5591a1){var _0x2dd3f1=_0x39d004['user']['get']({'plain':!![]});if(!_0x2dd3f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dd3f1['role']===_0xc5a4('0x55')){var _0x26b5de=_0x5591a1[_0xc5a4('0x2c')]({'plain':!![]});var _0x3e1de6=[{'name':'VoiceQueues','value':_0xc5a4('0x2e')},{'name':_0xc5a4('0x2f'),'value':_0xc5a4('0x30')}];var _0x5b3c14=_['find'](_0x3e1de6,[_0xc5a4('0x33'),_0x26b5de[_0xc5a4('0x3d')]])[_0xc5a4('0x35')];return db[_0xc5a4('0x56')][_0xc5a4('0x34')]({'where':{'name':_0x5b3c14,'userProfileId':_0x2dd3f1[_0xc5a4('0x57')]},'raw':!![]})['then'](function(_0x3884fe){if(_0x3884fe&&_0x3884fe[_0xc5a4('0x58')]===0x0){return db[_0xc5a4('0x59')][_0xc5a4('0x54')]({'name':_0x26b5de['name'],'resourceId':_0x26b5de['id'],'type':_0x3884fe[_0xc5a4('0x35')],'sectionId':_0x3884fe['id']},{})[_0xc5a4('0x2a')](function(){return _0x5591a1;});}else{return _0x5591a1;}})[_0xc5a4('0x50')](function(_0x37d330){logger[_0xc5a4('0x36')](_0xc5a4('0x5a'),_0x37d330);throw _0x37d330;});}return _0x5591a1;})['then'](respondWithResult(_0x1cd5b3,0xc9))[_0xc5a4('0x50')](handleError(_0x1cd5b3,null));};exports[_0xc5a4('0x5b')]=function(_0x59ca6e,_0x2ffff2){var _0x324f24={'where':{'id':_0x59ca6e[_0xc5a4('0x51')]['id']}},_0x1f9b21={};_0x1f9b21[_0xc5a4('0x42')]=_[_0xc5a4('0x40')](db[_0xc5a4('0x3a')]['rawAttributes']);_0x324f24[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x1f9b21[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x59ca6e[_0xc5a4('0x3f')]['fields']));_0x324f24[_0xc5a4('0x43')]=_0x324f24[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x324f24[_0xc5a4('0x43')]:_0x1f9b21[_0xc5a4('0x42')];if(_0x59ca6e[_0xc5a4('0x3f')][_0xc5a4('0x4e')]){_0x324f24[_0xc5a4('0x53')]=[{'all':!![]}];}_0x324f24=_['merge']({},_0x324f24,_0x59ca6e[_0xc5a4('0x4d')]);return db[_0xc5a4('0x3a')][_0xc5a4('0x34')](_0x324f24)[_0xc5a4('0x2a')](handleEntityNotFound(_0x2ffff2,null))[_0xc5a4('0x2a')](function(_0x1e4361){if(_0x1e4361){var _0x5d6868=_0x1e4361[_0xc5a4('0x2c')]({'plain':!![]});_0x5d6868=qs['omit'](_0x5d6868,['id','createdAt',_0xc5a4('0x5c')]);_0x59ca6e[_0xc5a4('0x5d')]=_['omit'](_0x59ca6e['body'],['id',_0xc5a4('0x5e'),_0xc5a4('0x5c')]);return db[_0xc5a4('0x3a')][_0xc5a4('0x54')](_[_0xc5a4('0x4c')](_0x5d6868,_0x59ca6e[_0xc5a4('0x5d')]),{'include':_0x59ca6e[_0xc5a4('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0xc5a4('0x2a')](function(_0x589c3f){var _0x4c1b95=_0x59ca6e[_0xc5a4('0x55')][_0xc5a4('0x2c')]({'plain':!![]});if(!_0x4c1b95)throw new Error(_0xc5a4('0x5f'));if(_0x4c1b95[_0xc5a4('0x60')]===_0xc5a4('0x55')){var _0x4e9ec1=_0x589c3f[_0xc5a4('0x2c')]({'plain':!![]});var _0xfa08e4=[{'name':_0xc5a4('0x2d'),'value':_0xc5a4('0x2e')},{'name':'QueueCampaigns','value':'outbound'}];var _0xc74682=_['find'](_0xfa08e4,[_0xc5a4('0x33'),_0x4e9ec1[_0xc5a4('0x3d')]])['name'];return db[_0xc5a4('0x56')][_0xc5a4('0x34')]({'where':{'name':_0xc74682,'userProfileId':_0x4c1b95[_0xc5a4('0x57')]},'raw':!![]})[_0xc5a4('0x2a')](function(_0x100baa){if(_0x100baa&&_0x100baa[_0xc5a4('0x58')]===0x0){return db[_0xc5a4('0x59')][_0xc5a4('0x54')]({'name':_0x4e9ec1[_0xc5a4('0x35')],'resourceId':_0x4e9ec1['id'],'type':_0x100baa['name'],'sectionId':_0x100baa['id']},{})[_0xc5a4('0x2a')](function(){return _0x589c3f;});}else{return _0x589c3f;}})[_0xc5a4('0x50')](function(_0x53e00b){logger[_0xc5a4('0x36')](_0xc5a4('0x5a'),_0x53e00b);throw _0x53e00b;});}return _0x589c3f;});}})[_0xc5a4('0x2a')](respondWithResult(_0x2ffff2,0xc9))['catch'](handleError(_0x2ffff2,null));};exports['update']=function(_0x340c93,_0x4e0b00){if(_0x340c93['body']['id']){delete _0x340c93[_0xc5a4('0x5d')]['id'];}return db[_0xc5a4('0x3a')]['find']({'where':{'id':_0x340c93[_0xc5a4('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e0b00,null))[_0xc5a4('0x2a')](saveUpdates(_0x340c93['body'],null))[_0xc5a4('0x2a')](respondWithResult(_0x4e0b00,null))[_0xc5a4('0x50')](handleError(_0x4e0b00,null));};exports[_0xc5a4('0x2b')]=function(_0x559533,_0x58e0b9){return db[_0xc5a4('0x3a')][_0xc5a4('0x34')]({'where':{'id':_0x559533['params']['id']}})['then'](handleEntityNotFound(_0x58e0b9,null))[_0xc5a4('0x2a')](removeEntity(_0x58e0b9,null))[_0xc5a4('0x50')](handleError(_0x58e0b9,null));};exports['getHoppers']=function(_0x1d8427,_0x4067a1,_0xa5138f){var _0x63b85={'raw':![],'where':{}};var _0x3d2d93={};var _0x80b987={'count':0x0,'rows':[]};return db[_0xc5a4('0x3a')][_0xc5a4('0x61')]({'where':{'id':_0x1d8427[_0xc5a4('0x51')]['id']}})['then'](handleEntityNotFound(_0x4067a1,null))[_0xc5a4('0x2a')](function(_0x4a5997){if(_0x4a5997){_0x3d2d93[_0xc5a4('0x42')]=_['keys'](db[_0xc5a4('0x62')]['rawAttributes']);_0x3d2d93[_0xc5a4('0x3f')]=_['keys'](_0x1d8427[_0xc5a4('0x3f')]);_0x3d2d93[_0xc5a4('0x4b')]=_['intersection'](_0x3d2d93['model'],_0x3d2d93[_0xc5a4('0x3f')]);_0x63b85['attributes']=_[_0xc5a4('0x41')](_0x3d2d93[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x1d8427[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x63b85['attributes']=_0x63b85[_0xc5a4('0x43')]['length']?_0x63b85['attributes']:_0x3d2d93[_0xc5a4('0x42')];if(!_0x1d8427[_0xc5a4('0x3f')][_0xc5a4('0x45')]('nolimit')){_0x63b85['limit']=qs[_0xc5a4('0x23')](_0x1d8427[_0xc5a4('0x3f')][_0xc5a4('0x23')]);_0x63b85['offset']=qs[_0xc5a4('0x22')](_0x1d8427['query']['offset']);}_0x63b85['order']=qs['sort'](_0x1d8427[_0xc5a4('0x3f')][_0xc5a4('0x48')]);_0x63b85['where']=qs[_0xc5a4('0x4b')](_['pick'](_0x1d8427[_0xc5a4('0x3f')],_0x3d2d93[_0xc5a4('0x4b')]));_0x63b85['where']['VoiceQueueId']=_0x4a5997['id'];if(_0x1d8427['query'][_0xc5a4('0x31')]){_0x63b85[_0xc5a4('0x49')]=_['merge'](_0x63b85[_0xc5a4('0x49')],{'$or':_[_0xc5a4('0x32')](_0x63b85['attributes'],function(_0x4b8933){var _0x56506c={};_0x56506c[_0x4b8933]={'$like':'%'+_0x1d8427['query']['filter']+'%'};return _0x56506c;})});}_0x63b85=_[_0xc5a4('0x4c')]({},_0x63b85,_0x1d8427[_0xc5a4('0x4d')]);return db[_0xc5a4('0x62')][_0xc5a4('0x25')]({'where':_0x63b85[_0xc5a4('0x49')]})['then'](function(_0x59ad22){_0x80b987[_0xc5a4('0x25')]=_0x59ad22;if(_0x1d8427[_0xc5a4('0x3f')][_0xc5a4('0x4e')]){_0x63b85[_0xc5a4('0x53')]=[{'all':!![]}];}return db[_0xc5a4('0x62')][_0xc5a4('0x63')](_0x63b85);})[_0xc5a4('0x2a')](function(_0x5675e5){_0x80b987[_0xc5a4('0x4f')]=_0x5675e5;return _0x80b987;});}})[_0xc5a4('0x2a')](respondWithFilteredResult(_0x4067a1,_0x63b85))[_0xc5a4('0x50')](handleError(_0x4067a1,null));};exports['getHopperHistories']=function(_0xf4f91c,_0x19c238,_0x44de89){var _0x6f3a79={'raw':!![],'where':{}};var _0x5702d7={};var _0x22d78f={'count':0x0,'rows':[]};return db[_0xc5a4('0x3a')][_0xc5a4('0x61')]({'where':{'id':_0xf4f91c['params']['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x19c238,null))[_0xc5a4('0x2a')](function(_0x584648){if(_0x584648){_0x5702d7[_0xc5a4('0x42')]=_[_0xc5a4('0x40')](db['CmHopperHistory'][_0xc5a4('0x3b')]);_0x5702d7[_0xc5a4('0x3f')]=_[_0xc5a4('0x40')](_0xf4f91c[_0xc5a4('0x3f')]);_0x5702d7[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x5702d7[_0xc5a4('0x42')],_0x5702d7['query']);_0x6f3a79['attributes']=_[_0xc5a4('0x41')](_0x5702d7[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0xf4f91c[_0xc5a4('0x3f')]['fields']));_0x6f3a79[_0xc5a4('0x43')]=_0x6f3a79[_0xc5a4('0x43')]['length']?_0x6f3a79[_0xc5a4('0x43')]:_0x5702d7[_0xc5a4('0x42')];if(!_0xf4f91c[_0xc5a4('0x3f')][_0xc5a4('0x45')]('nolimit')){_0x6f3a79[_0xc5a4('0x23')]=qs['limit'](_0xf4f91c[_0xc5a4('0x3f')]['limit']);_0x6f3a79[_0xc5a4('0x22')]=qs[_0xc5a4('0x22')](_0xf4f91c[_0xc5a4('0x3f')][_0xc5a4('0x22')]);}_0x6f3a79[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0xf4f91c['query'][_0xc5a4('0x48')]);_0x6f3a79[_0xc5a4('0x49')]=qs['filters'](_[_0xc5a4('0x4a')](_0xf4f91c[_0xc5a4('0x3f')],_0x5702d7[_0xc5a4('0x4b')]));_0x6f3a79[_0xc5a4('0x49')][_0xc5a4('0x64')]=_0x584648['id'];if(_0xf4f91c[_0xc5a4('0x3f')][_0xc5a4('0x31')]){_0x6f3a79[_0xc5a4('0x49')]=_[_0xc5a4('0x4c')](_0x6f3a79[_0xc5a4('0x49')],{'$or':_['map'](_0x6f3a79['attributes'],function(_0x29b344){var _0xd7ace5={};_0xd7ace5[_0x29b344]={'$like':'%'+_0xf4f91c[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0xd7ace5;})});}_0x6f3a79=_[_0xc5a4('0x4c')]({},_0x6f3a79,_0xf4f91c[_0xc5a4('0x4d')]);return db[_0xc5a4('0x65')][_0xc5a4('0x25')]({'where':_0x6f3a79['where']})[_0xc5a4('0x2a')](function(_0x31d9ee){_0x22d78f[_0xc5a4('0x25')]=_0x31d9ee;if(_0xf4f91c[_0xc5a4('0x3f')]['includeAll']){_0x6f3a79[_0xc5a4('0x53')]=[{'all':!![]}];}return db[_0xc5a4('0x65')]['findAll'](_0x6f3a79);})[_0xc5a4('0x2a')](function(_0x38a70d){_0x22d78f['rows']=_0x38a70d;return _0x22d78f;});}})[_0xc5a4('0x2a')](respondWithFilteredResult(_0x19c238,_0x6f3a79))[_0xc5a4('0x50')](handleError(_0x19c238,null));};exports[_0xc5a4('0x66')]=function(_0x55d381,_0x1a7f62,_0x8e7de4){var _0x83119e={'raw':!![],'where':{}};var _0x1de1d0={};var _0xd3bd1d={'count':0x0,'rows':[]};return db[_0xc5a4('0x3a')]['findOne']({'where':{'id':_0x55d381[_0xc5a4('0x51')]['id']}})['then'](handleEntityNotFound(_0x1a7f62,null))[_0xc5a4('0x2a')](function(_0x38bcfd){if(_0x38bcfd){_0x1de1d0[_0xc5a4('0x42')]=_['keys'](db[_0xc5a4('0x67')][_0xc5a4('0x3b')]);_0x1de1d0[_0xc5a4('0x3f')]=_['keys'](_0x55d381[_0xc5a4('0x3f')]);_0x1de1d0[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x1de1d0[_0xc5a4('0x42')],_0x1de1d0[_0xc5a4('0x3f')]);_0x83119e[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x1de1d0[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x55d381[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x83119e['attributes']=_0x83119e[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x83119e['attributes']:_0x1de1d0[_0xc5a4('0x42')];if(!_0x55d381[_0xc5a4('0x3f')]['hasOwnProperty'](_0xc5a4('0x46'))){_0x83119e['limit']=qs[_0xc5a4('0x23')](_0x55d381[_0xc5a4('0x3f')]['limit']);_0x83119e[_0xc5a4('0x22')]=qs[_0xc5a4('0x22')](_0x55d381['query']['offset']);}_0x83119e[_0xc5a4('0x47')]=qs['sort'](_0x55d381[_0xc5a4('0x3f')]['sort']);_0x83119e['where']=qs['filters'](_[_0xc5a4('0x4a')](_0x55d381['query'],_0x1de1d0[_0xc5a4('0x4b')]));_0x83119e[_0xc5a4('0x49')][_0xc5a4('0x64')]=_0x38bcfd['id'];if(_0x55d381['query'][_0xc5a4('0x31')]){_0x83119e[_0xc5a4('0x49')]=_['merge'](_0x83119e[_0xc5a4('0x49')],{'$or':_[_0xc5a4('0x32')](_0x83119e[_0xc5a4('0x43')],function(_0x473d4c){var _0x22b9f7={};_0x22b9f7[_0x473d4c]={'$like':'%'+_0x55d381[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0x22b9f7;})});}_0x83119e=_[_0xc5a4('0x4c')]({},_0x83119e,_0x55d381[_0xc5a4('0x4d')]);return db[_0xc5a4('0x67')][_0xc5a4('0x25')]({'where':_0x83119e[_0xc5a4('0x49')]})[_0xc5a4('0x2a')](function(_0x120782){_0xd3bd1d[_0xc5a4('0x25')]=_0x120782;if(_0x55d381[_0xc5a4('0x3f')][_0xc5a4('0x4e')]){_0x83119e['include']=[{'all':!![]}];}return db[_0xc5a4('0x67')][_0xc5a4('0x63')](_0x83119e);})[_0xc5a4('0x2a')](function(_0x4ed9c3){_0xd3bd1d[_0xc5a4('0x4f')]=_0x4ed9c3;return _0xd3bd1d;});}})[_0xc5a4('0x2a')](respondWithFilteredResult(_0x1a7f62,_0x83119e))['catch'](handleError(_0x1a7f62,null));};exports[_0xc5a4('0x68')]=function(_0xca1c7,_0x323cfa,_0x4c1b56){var _0x562d7b={'raw':!![],'where':{}};var _0x3041e0={};var _0x27dd4d={'count':0x0,'rows':[]};return db[_0xc5a4('0x3a')]['findOne']({'where':{'id':_0xca1c7[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x323cfa,null))['then'](function(_0x2e1af1){if(_0x2e1af1){_0x3041e0['model']=_['keys'](db['CmHopperBlack'][_0xc5a4('0x3b')]);_0x3041e0[_0xc5a4('0x3f')]=_['keys'](_0xca1c7[_0xc5a4('0x3f')]);_0x3041e0[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x3041e0[_0xc5a4('0x42')],_0x3041e0['query']);_0x562d7b[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x3041e0['model'],qs['fields'](_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x562d7b[_0xc5a4('0x43')]=_0x562d7b[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x562d7b[_0xc5a4('0x43')]:_0x3041e0['model'];if(!_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x45')](_0xc5a4('0x46'))){_0x562d7b[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x23')]);_0x562d7b['offset']=qs[_0xc5a4('0x22')](_0xca1c7[_0xc5a4('0x3f')]['offset']);}_0x562d7b[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x48')]);_0x562d7b['where']=qs[_0xc5a4('0x4b')](_[_0xc5a4('0x4a')](_0xca1c7['query'],_0x3041e0[_0xc5a4('0x4b')]));_0x562d7b[_0xc5a4('0x49')][_0xc5a4('0x64')]=_0x2e1af1['id'];if(_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x31')]){_0x562d7b[_0xc5a4('0x49')]=_[_0xc5a4('0x4c')](_0x562d7b['where'],{'$or':_['map'](_0x562d7b['attributes'],function(_0x193e29){var _0x2e5307={};_0x2e5307[_0x193e29]={'$like':'%'+_0xca1c7[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0x2e5307;})});}_0x562d7b=_[_0xc5a4('0x4c')]({},_0x562d7b,_0xca1c7[_0xc5a4('0x4d')]);return db[_0xc5a4('0x69')][_0xc5a4('0x25')]({'where':_0x562d7b[_0xc5a4('0x49')]})['then'](function(_0x2b3b11){_0x27dd4d[_0xc5a4('0x25')]=_0x2b3b11;if(_0xca1c7[_0xc5a4('0x3f')]['includeAll']){_0x562d7b['include']=[{'all':!![]}];}return db[_0xc5a4('0x69')][_0xc5a4('0x63')](_0x562d7b);})[_0xc5a4('0x2a')](function(_0x96d4f5){_0x27dd4d[_0xc5a4('0x4f')]=_0x96d4f5;return _0x27dd4d;});}})[_0xc5a4('0x2a')](respondWithFilteredResult(_0x323cfa,_0x562d7b))[_0xc5a4('0x50')](handleError(_0x323cfa,null));};exports['getTeams']=function(_0x124b24,_0x5a48fe,_0x1f77fa){var _0x3df59f={};var _0x5e1b0a={};var _0x31b0f6;var _0x48c6b8;return db[_0xc5a4('0x3a')][_0xc5a4('0x61')]({'where':{'id':_0x124b24[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x5a48fe,null))[_0xc5a4('0x2a')](function(_0x356dbd){if(_0x356dbd){_0x31b0f6=_0x356dbd;_0x5e1b0a[_0xc5a4('0x42')]=_['keys'](db[_0xc5a4('0x6a')][_0xc5a4('0x3b')]);_0x5e1b0a['query']=_[_0xc5a4('0x40')](_0x124b24[_0xc5a4('0x3f')]);_0x5e1b0a[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x5e1b0a['model'],_0x5e1b0a[_0xc5a4('0x3f')]);_0x3df59f[_0xc5a4('0x43')]=_['intersection'](_0x5e1b0a[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x124b24['query'][_0xc5a4('0x44')]));_0x3df59f[_0xc5a4('0x43')]=_0x3df59f[_0xc5a4('0x43')]['length']?_0x3df59f['attributes']:_0x5e1b0a['model'];_0x3df59f[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0x124b24[_0xc5a4('0x3f')]['sort']);_0x3df59f[_0xc5a4('0x49')]=qs['filters'](_[_0xc5a4('0x4a')](_0x124b24[_0xc5a4('0x3f')],_0x5e1b0a['filters']));if(_0x124b24['query'][_0xc5a4('0x31')]){_0x3df59f['where']=_['merge'](_0x3df59f[_0xc5a4('0x49')],{'$or':_['map'](_0x3df59f[_0xc5a4('0x43')],function(_0xf20bc){var _0x5455b9={};_0x5455b9[_0xf20bc]={'$like':'%'+_0x124b24['query'][_0xc5a4('0x31')]+'%'};return _0x5455b9;})});}_0x3df59f=_[_0xc5a4('0x4c')]({},_0x3df59f,_0x124b24[_0xc5a4('0x4d')]);return _0x31b0f6[_0xc5a4('0x6b')](_0x3df59f);}})[_0xc5a4('0x2a')](function(_0x4373a7){if(_0x4373a7){_0x48c6b8=_0x4373a7[_0xc5a4('0x52')];if(!_0x124b24[_0xc5a4('0x3f')]['hasOwnProperty'](_0xc5a4('0x46'))){_0x3df59f[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x124b24['query']['limit']);_0x3df59f[_0xc5a4('0x22')]=qs[_0xc5a4('0x22')](_0x124b24[_0xc5a4('0x3f')][_0xc5a4('0x22')]);}return _0x31b0f6[_0xc5a4('0x6b')](_0x3df59f);}})[_0xc5a4('0x2a')](function(_0x22d0b1){if(_0x22d0b1){return _0x22d0b1?{'count':_0x48c6b8,'rows':_0x22d0b1}:null;}})[_0xc5a4('0x2a')](respondWithResult(_0x5a48fe,null))['catch'](handleError(_0x5a48fe,null));};exports[_0xc5a4('0x6c')]=function(_0x7007ea,_0x1908dc,_0x41cc3b){var _0xd4b008=_0x7007ea[_0xc5a4('0x5d')][_0xc5a4('0x6d')];var _0x380961=_[_0xc5a4('0x32')](_0xd4b008,'id');return db[_0xc5a4('0x6a')][_0xc5a4('0x63')]({'where':{'id':_0x380961},'attributes':['id'],'include':[{'model':db[_0xc5a4('0x6e')],'as':'Agents','attributes':['id',_0xc5a4('0x35'),_0xc5a4('0x6f'),'voicePause',_0xc5a4('0x70')],'raw':!![]}]})['then'](function(_0x41ed2d){if(_0x41ed2d){var _0x1cad95=_[_0xc5a4('0x71')](_0x41ed2d,function(_0x316a1e){var _0x1c73e4=_0x316a1e['get']({'plain':!![]});_0x1c73e4[_0xc5a4('0x72')][_0xc5a4('0x73')](function(_0x10dc2e){_0x10dc2e[_0xc5a4('0x74')]=_['find'](_0xd4b008,{'id':_0x1c73e4['id']})['penalty'];});return _0x1c73e4[_0xc5a4('0x72')];});return db['VoiceQueue'][_0xc5a4('0x34')]({'where':{'id':_0x7007ea[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](function(_0x53e12a){return db[_0xc5a4('0x75')][_0xc5a4('0x76')](function(_0x2b2e85){return _0x53e12a[_0xc5a4('0x6c')](_0x380961,{'transaction':_0x2b2e85})[_0xc5a4('0x2a')](function(){return BPromise['each'](_0xd4b008,function(_0x54af48){return db[_0xc5a4('0x77')][_0xc5a4('0x78')]({'TeamId':_0x54af48['id'],'VoiceQueueId':_0x7007ea[_0xc5a4('0x51')]['id'],'penalty':_0x54af48['penalty']},{'transaction':_0x2b2e85});});})[_0xc5a4('0x2a')](function(){return BPromise[_0xc5a4('0x79')](_0x1cad95,function(_0x36cdf9){return db[_0xc5a4('0x7a')][_0xc5a4('0x7b')]({'where':{'UserId':_0x36cdf9['id'],'VoiceQueueId':_0x7007ea['params']['id']},'defaults':{'penalty':_0x36cdf9[_0xc5a4('0x74')]},'transaction':_0x2b2e85});});})[_0xc5a4('0x2a')](function(){return BPromise[_0xc5a4('0x79')](_[_0xc5a4('0x31')](_0x1cad95,{'online':!![]}),function(_0x31c007){return db[_0xc5a4('0x7c')]['upsert']({'membername':_0x31c007[_0xc5a4('0x35')],'UserId':_0x31c007['id'],'queue_name':_0x53e12a[_0xc5a4('0x35')],'VoiceQueueId':_0x53e12a['id'],'interface':_[_0xc5a4('0x7d')](_0x31c007[_0xc5a4('0x70')])?util['format'](_0xc5a4('0x7e'),_0x31c007[_0xc5a4('0x35')]):_0x31c007[_0xc5a4('0x70')],'paused':_0x31c007[_0xc5a4('0x7f')]||![],'penalty':_0x31c007[_0xc5a4('0x74')]},{'transaction':_0x2b2e85});});})['then'](function(){_0x1cad95['forEach'](function(_0x2e83f7){socket['emit'](_0xc5a4('0x80'),{'UserId':_0x2e83f7['id'],'VoiceQueueId':_0x53e12a['id']});});});});});}})[_0xc5a4('0x2a')](respondWithStatusCode(_0x1908dc,null))[_0xc5a4('0x50')](handleError(_0x1908dc,null));};exports[_0xc5a4('0x81')]=function(_0x4ee3db,_0x675ad,_0x2922cf){return db[_0xc5a4('0x6a')]['findAll']({'where':{'id':_0x4ee3db[_0xc5a4('0x3f')][_0xc5a4('0x82')]},'attributes':['id'],'include':[{'model':db[_0xc5a4('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5a4('0x2a')](handleEntityNotFound(_0x675ad,null))[_0xc5a4('0x2a')](function(_0x527507){var _0x8307cf=_[_0xc5a4('0x32')](_0x527507,'id');var _0x4fe39e=[];var _0x570c69=[];var _0x3e02c7=squel[_0xc5a4('0x83')]();_0x3e02c7[_0xc5a4('0x84')](_0xc5a4('0x85'))['from']('team_has_voice_queues','tq')['join'](_0xc5a4('0x86'),'ut',_0xc5a4('0x87'))[_0xc5a4('0x49')](_0xc5a4('0x88'),_0x4ee3db[_0xc5a4('0x51')]['id']);for(var _0x15742b=0x0;_0x15742b<_0x527507[_0xc5a4('0x52')];_0x15742b+=0x1){let _0x4f5ef1=_0x527507[_0x15742b];for(var _0x2d59f4=0x0;_0x2d59f4<_0x4f5ef1['Agents'][_0xc5a4('0x52')];_0x2d59f4+=0x1){let _0x509311=_0x4f5ef1[_0xc5a4('0x72')][_0x2d59f4];var _0x376263=_0x3e02c7[_0xc5a4('0x5b')]();_0x376263[_0xc5a4('0x49')](_0xc5a4('0x89'),_0x509311['id']);_0x570c69[_0xc5a4('0x8a')](db[_0xc5a4('0x75')][_0xc5a4('0x3f')](_0x376263[_0xc5a4('0x8b')](),{'type':db[_0xc5a4('0x75')]['QueryTypes']['SELECT']})[_0xc5a4('0x2a')](function(_0x22806c){if(_0x22806c['length']===0x1){return _0x509311['id'];}else{var _0x113784=_[_0xc5a4('0x8c')](_[_0xc5a4('0x32')](_0x22806c,_0xc5a4('0x8d')),function(_0x112635){return _[_0xc5a4('0x8e')](_0x8307cf,_0x112635);});if(_0x113784){return _0x509311['id'];}}}));}}return BPromise[_0xc5a4('0x8f')](_0x570c69)['then'](function(_0x3f767c){_0x4fe39e=_(_0x4fe39e)[_0xc5a4('0x90')](_0x3f767c)[_0xc5a4('0x91')]()[_0xc5a4('0x33')]();return db[_0xc5a4('0x3a')][_0xc5a4('0x34')]({'where':{'id':_0x4ee3db[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](function(_0x20ec4c){return db[_0xc5a4('0x75')][_0xc5a4('0x76')](function(_0xabe0d7){return _0x20ec4c[_0xc5a4('0x81')](_0x4ee3db['query']['ids'],{'transaction':_0xabe0d7})['then'](function(){if(!_[_0xc5a4('0x92')](_0x4fe39e)){return _0x20ec4c[_0xc5a4('0x93')](_0x4fe39e,{'transaction':_0xabe0d7})[_0xc5a4('0x2a')](function(){return db[_0xc5a4('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x4ee3db[_0xc5a4('0x51')]['id'],'UserId':_0x4fe39e},'transaction':_0xabe0d7});});}})[_0xc5a4('0x2a')](function(){_0x4fe39e[_0xc5a4('0x73')](function(_0x4bea23){socket[_0xc5a4('0x94')](_0xc5a4('0x95'),{'UserId':_0x4bea23,'VoiceQueueId':_0x20ec4c['id']});});});});});});})[_0xc5a4('0x2a')](respondWithStatusCode(_0x675ad,null))[_0xc5a4('0x50')](handleError(_0x675ad,null));};exports[_0xc5a4('0x96')]=function(_0x11a5a3,_0x8db1bb,_0x215e90){var _0x2a8b30,_0x23c7cb;return db['VoiceQueue'][_0xc5a4('0x34')]({'where':{'id':_0x11a5a3[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x8db1bb,null))['then'](function(_0x251c4e){if(_0x251c4e){_0x23c7cb=_0x251c4e;return _0x251c4e[_0xc5a4('0x96')](_0x11a5a3['body']['ids'],_['omit'](_0x11a5a3[_0xc5a4('0x5d')],[_0xc5a4('0x82'),'id'])||{})['spread'](function(_0x2e7149){for(var _0x20d20f=0x0;_0x20d20f<_0x11a5a3[_0xc5a4('0x5d')]['ids'][_0xc5a4('0x52')];_0x20d20f+=0x1){socket[_0xc5a4('0x94')](_0xc5a4('0x80'),{'UserId':Number(_0x11a5a3[_0xc5a4('0x5d')][_0xc5a4('0x82')][_0x20d20f]),'VoiceQueueId':Number(_0x11a5a3[_0xc5a4('0x51')]['id'])});}return _0x2e7149;});}})[_0xc5a4('0x2a')](function(_0x26d3ea){_0x2a8b30=_0x26d3ea||[];if(_0x23c7cb){return db[_0xc5a4('0x6e')][_0xc5a4('0x63')]({'where':{'id':_0x11a5a3[_0xc5a4('0x5d')][_0xc5a4('0x82')]},'attributes':['id','name',_0xc5a4('0x6f'),_0xc5a4('0x7f'),_0xc5a4('0x70')],'raw':!![]});}})[_0xc5a4('0x2a')](function(_0x333fb4){if(!_[_0xc5a4('0x92')](_0x333fb4)){var _0x365213=[];for(var _0x332340=0x0;_0x332340<_0x333fb4[_0xc5a4('0x52')];_0x332340++){if(_0x333fb4[_0x332340]['online']){_0x365213[_0xc5a4('0x8a')](db[_0xc5a4('0x7c')]['upsert']({'membername':_0x333fb4[_0x332340]['name'],'UserId':_0x333fb4[_0x332340]['id'],'queue_name':_0x23c7cb[_0xc5a4('0x35')],'VoiceQueueId':_0x23c7cb['id'],'interface':_[_0xc5a4('0x7d')](_0x333fb4[_0x332340][_0xc5a4('0x70')])?util[_0xc5a4('0x97')](_0xc5a4('0x7e'),_0x333fb4[_0x332340][_0xc5a4('0x35')]):_0x333fb4[_0x332340][_0xc5a4('0x70')],'paused':_0x333fb4[_0x332340][_0xc5a4('0x7f')]||![],'penalty':_0x11a5a3[_0xc5a4('0x5d')][_0xc5a4('0x74')]||0x0}));}}return BPromise[_0xc5a4('0x8f')](_0x365213);}})[_0xc5a4('0x2a')](function(){return _0x2a8b30;})[_0xc5a4('0x2a')](respondWithResult(_0x8db1bb,null))[_0xc5a4('0x50')](handleError(_0x8db1bb,null));};exports[_0xc5a4('0x93')]=function(_0x888e04,_0x4f15d7,_0x44612a){return db['VoiceQueue'][_0xc5a4('0x34')]({'where':{'id':_0x888e04[_0xc5a4('0x51')]['id']}})['then'](handleEntityNotFound(_0x4f15d7,null))['then'](function(_0x169ac2){if(_0x169ac2){return _0x169ac2[_0xc5a4('0x93')](_0x888e04[_0xc5a4('0x3f')]['ids'])[_0xc5a4('0x2a')](function(){if(_['isArray'](_0x888e04[_0xc5a4('0x3f')][_0xc5a4('0x82')])){for(var _0x20fd75=0x0;_0x20fd75<_0x888e04[_0xc5a4('0x3f')]['ids'][_0xc5a4('0x52')];_0x20fd75+=0x1){socket['emit'](_0xc5a4('0x95'),{'UserId':Number(_0x888e04[_0xc5a4('0x3f')][_0xc5a4('0x82')][_0x20fd75]),'VoiceQueueId':Number(_0x888e04[_0xc5a4('0x51')]['id'])});}}else{socket[_0xc5a4('0x94')](_0xc5a4('0x95'),{'UserId':Number(_0x888e04[_0xc5a4('0x3f')]['ids']),'VoiceQueueId':Number(_0x888e04[_0xc5a4('0x51')]['id'])});}});}})[_0xc5a4('0x2a')](function(_0xd6f461){return db[_0xc5a4('0x7c')][_0xc5a4('0x2b')]({'where':{'VoiceQueueId':_0x888e04['params']['id'],'UserId':_0x888e04[_0xc5a4('0x3f')][_0xc5a4('0x82')]}})[_0xc5a4('0x2a')](function(){return _0xd6f461;});})[_0xc5a4('0x2a')](respondWithStatusCode(_0x4f15d7,null))['catch'](handleError(_0x4f15d7,null));};exports['getAgents']=function(_0x4b620e,_0x433eb0,_0x3603da){var _0x976cef={};var _0x3920f6={};var _0x176161;var _0x57a839;return db[_0xc5a4('0x3a')]['findOne']({'where':{'id':_0x4b620e[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x433eb0,null))[_0xc5a4('0x2a')](function(_0x283ccb){if(_0x283ccb){_0x176161=_0x283ccb;_0x3920f6[_0xc5a4('0x42')]=_['keys'](db['User'][_0xc5a4('0x3b')]);_0x3920f6[_0xc5a4('0x3f')]=_[_0xc5a4('0x40')](_0x4b620e[_0xc5a4('0x3f')]);_0x3920f6[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x3920f6[_0xc5a4('0x42')],_0x3920f6[_0xc5a4('0x3f')]);_0x976cef[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x3920f6[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x4b620e[_0xc5a4('0x3f')]['fields']));_0x976cef[_0xc5a4('0x43')]=_0x976cef[_0xc5a4('0x43')]['length']?_0x976cef[_0xc5a4('0x43')]:_0x3920f6[_0xc5a4('0x42')];_0x976cef['order']=qs['sort'](_0x4b620e[_0xc5a4('0x3f')]['sort']);_0x976cef[_0xc5a4('0x49')]=qs[_0xc5a4('0x4b')](_[_0xc5a4('0x4a')](_0x4b620e[_0xc5a4('0x3f')],_0x3920f6['filters']));if(_0x4b620e[_0xc5a4('0x3f')][_0xc5a4('0x31')]){_0x976cef[_0xc5a4('0x49')]=_[_0xc5a4('0x4c')](_0x976cef[_0xc5a4('0x49')],{'$or':_['map'](_0x976cef[_0xc5a4('0x43')],function(_0x4be006){var _0x50e91a={};_0x50e91a[_0x4be006]={'$like':'%'+_0x4b620e['query']['filter']+'%'};return _0x50e91a;})});}_0x976cef=_[_0xc5a4('0x4c')]({},_0x976cef,_0x4b620e[_0xc5a4('0x4d')]);return _0x176161[_0xc5a4('0x98')](_0x976cef);}})[_0xc5a4('0x2a')](function(_0xaf3b3c){if(_0xaf3b3c){_0x57a839=_0xaf3b3c[_0xc5a4('0x52')];if(!_0x4b620e[_0xc5a4('0x3f')][_0xc5a4('0x45')](_0xc5a4('0x46'))){_0x976cef[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x4b620e['query']['limit']);_0x976cef['offset']=qs[_0xc5a4('0x22')](_0x4b620e[_0xc5a4('0x3f')]['offset']);}return _0x176161[_0xc5a4('0x98')](_0x976cef);}})[_0xc5a4('0x2a')](function(_0x40cdf5){if(_0x40cdf5){return _0x40cdf5?{'count':_0x57a839,'rows':_0x40cdf5}:null;}})['then'](respondWithResult(_0x433eb0,null))[_0xc5a4('0x50')](handleError(_0x433eb0,null));};exports[_0xc5a4('0x99')]=function(_0x3011e1,_0x3351b7,_0x4825c1){var _0x48a857={};var _0x29547d={};var _0x588eeb;var _0x81df4a;return db['VoiceQueue'][_0xc5a4('0x61')]({'where':{'id':_0x3011e1[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x3351b7,null))['then'](function(_0x2c85c4){if(_0x2c85c4){_0x588eeb=_0x2c85c4;_0x29547d['model']=_[_0xc5a4('0x40')](db[_0xc5a4('0x7c')]['rawAttributes']);_0x29547d[_0xc5a4('0x3f')]=_['keys'](_0x3011e1['query']);_0x29547d[_0xc5a4('0x4b')]=_[_0xc5a4('0x41')](_0x29547d[_0xc5a4('0x42')],_0x29547d[_0xc5a4('0x3f')]);_0x48a857['attributes']=_[_0xc5a4('0x41')](_0x29547d[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x3011e1[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x48a857[_0xc5a4('0x43')]=_0x48a857[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x48a857[_0xc5a4('0x43')]:_0x29547d[_0xc5a4('0x42')];_0x48a857['order']=qs[_0xc5a4('0x48')](_0x3011e1[_0xc5a4('0x3f')][_0xc5a4('0x48')]);_0x48a857[_0xc5a4('0x49')]=qs[_0xc5a4('0x4b')](_['pick'](_0x3011e1[_0xc5a4('0x3f')],_0x29547d[_0xc5a4('0x4b')]));if(_0x3011e1['query'][_0xc5a4('0x31')]){_0x48a857['where']=_[_0xc5a4('0x4c')](_0x48a857['where'],{'$or':_['map'](_0x48a857[_0xc5a4('0x43')],function(_0x201efa){var _0x537341={};_0x537341[_0x201efa]={'$like':'%'+_0x3011e1[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0x537341;})});}_0x48a857=_['merge']({},_0x48a857,_0x3011e1[_0xc5a4('0x4d')]);return _0x588eeb[_0xc5a4('0x99')](_0x48a857);}})[_0xc5a4('0x2a')](function(_0x4d023a){if(_0x4d023a){_0x81df4a=_0x4d023a[_0xc5a4('0x52')];if(!_0x3011e1[_0xc5a4('0x3f')][_0xc5a4('0x45')](_0xc5a4('0x46'))){_0x48a857[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x3011e1[_0xc5a4('0x3f')][_0xc5a4('0x23')]);_0x48a857[_0xc5a4('0x22')]=qs[_0xc5a4('0x22')](_0x3011e1[_0xc5a4('0x3f')]['offset']);}return _0x588eeb[_0xc5a4('0x99')](_0x48a857);}})[_0xc5a4('0x2a')](function(_0xb56d63){return _0xb56d63?{'count':_0x81df4a,'rows':_0xb56d63}:null;})[_0xc5a4('0x2a')](respondWithResult(_0x3351b7,null))[_0xc5a4('0x50')](handleError(_0x3351b7,null));};exports[_0xc5a4('0x9a')]=function(_0x52329a,_0x4995db,_0x18b577){var _0x4223c5={};var _0x3bbf2c={};var _0x1a7bb1;var _0x5d111b;return db[_0xc5a4('0x3a')]['findOne']({'where':{'id':_0x52329a['params']['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x4995db,null))[_0xc5a4('0x2a')](function(_0x4abe47){if(_0x4abe47){_0x1a7bb1=_0x4abe47;_0x3bbf2c[_0xc5a4('0x42')]=_['keys'](db[_0xc5a4('0x9b')]['rawAttributes']);_0x3bbf2c['query']=_[_0xc5a4('0x40')](_0x52329a[_0xc5a4('0x3f')]);_0x3bbf2c[_0xc5a4('0x4b')]=_['intersection'](_0x3bbf2c['model'],_0x3bbf2c[_0xc5a4('0x3f')]);_0x4223c5[_0xc5a4('0x43')]=_[_0xc5a4('0x41')](_0x3bbf2c['model'],qs['fields'](_0x52329a[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x4223c5[_0xc5a4('0x43')]=_0x4223c5[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x4223c5[_0xc5a4('0x43')]:_0x3bbf2c[_0xc5a4('0x42')];_0x4223c5[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0x52329a[_0xc5a4('0x3f')][_0xc5a4('0x48')]);_0x4223c5[_0xc5a4('0x49')]=qs[_0xc5a4('0x4b')](_[_0xc5a4('0x4a')](_0x52329a[_0xc5a4('0x3f')],_0x3bbf2c[_0xc5a4('0x4b')]));if(_0x52329a[_0xc5a4('0x3f')]['filter']){_0x4223c5['where']=_['merge'](_0x4223c5[_0xc5a4('0x49')],{'$or':_['map'](_0x4223c5[_0xc5a4('0x43')],function(_0x9aa819){var _0x326d73={};_0x326d73[_0x9aa819]={'$like':'%'+_0x52329a[_0xc5a4('0x3f')][_0xc5a4('0x31')]+'%'};return _0x326d73;})});}_0x4223c5=_[_0xc5a4('0x4c')]({},_0x4223c5,_0x52329a[_0xc5a4('0x4d')]);return _0x1a7bb1[_0xc5a4('0x9a')](_0x4223c5);}})[_0xc5a4('0x2a')](function(_0x3f5eec){if(_0x3f5eec){_0x5d111b=_0x3f5eec['length'];if(!_0x52329a['query']['hasOwnProperty'](_0xc5a4('0x46'))){_0x4223c5[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x52329a['query']['limit']);_0x4223c5[_0xc5a4('0x22')]=qs['offset'](_0x52329a['query'][_0xc5a4('0x22')]);}return _0x1a7bb1['getLists'](_0x4223c5);}})[_0xc5a4('0x2a')](function(_0x519382){if(_0x519382){return _0x519382?{'count':_0x5d111b,'rows':_0x519382}:null;}})[_0xc5a4('0x2a')](respondWithResult(_0x4995db,null))['catch'](handleError(_0x4995db,null));};exports[_0xc5a4('0x9c')]=function(_0xb6cbf8,_0x9811f9,_0x1a8922){var _0x39bb0f,_0x2eb9e1;return db[_0xc5a4('0x3a')]['find']({'where':{'id':_0xb6cbf8['params']['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x9811f9,null))['then'](function(_0x10e8f9){if(_0x10e8f9){_0x2eb9e1=_0x10e8f9;return _0x10e8f9[_0xc5a4('0x9c')](_0xb6cbf8[_0xc5a4('0x5d')]['ids'],_[_0xc5a4('0x9d')](_0xb6cbf8[_0xc5a4('0x5d')],['ids','id'])||{});}return null;})[_0xc5a4('0x9e')](function(_0x587682){var _0x1b7f5a;_0x39bb0f=_0x587682||[];var _0x5c9e25=[];if(_0x587682){for(var _0x22ccba=0x0;_0x22ccba<_0x587682[_0xc5a4('0x52')];_0x22ccba+=0x1){var _0xff3ce7=_0x587682[_0x22ccba][_0xc5a4('0x2c')]({'plain':!![]});_0x2eb9e1['dialCheckDuplicateType']=_0xb6cbf8['body'][_0xc5a4('0x9f')]?_0xb6cbf8['body'][_0xc5a4('0x9f')]:_0x2eb9e1[_0xc5a4('0x9f')];switch(_0x2eb9e1[_0xc5a4('0x9f')]){case _0xc5a4('0xa0'):_0x1b7f5a=squel[_0xc5a4('0xa1')]()[_0xc5a4('0xa2')](_0xc5a4('0xa3'))[_0xc5a4('0xa4')]([_0xc5a4('0xa5'),_0xc5a4('0xa6'),_0xc5a4('0xa7'),'ListId',_0xc5a4('0x64'),_0xc5a4('0x5e'),_0xc5a4('0x5c')],squel['select']()[_0xc5a4('0x84')](_0xc5a4('0xa5'),_0xc5a4('0xa5'))[_0xc5a4('0x84')](_0xc5a4('0xa8'),'scheduledAt')['field']('id','ContactId')[_0xc5a4('0x84')](_0xff3ce7['CmListId'][_0xc5a4('0x8b')](),_0xc5a4('0xa9'))[_0xc5a4('0x84')](_0xb6cbf8['params']['id'][_0xc5a4('0x8b')](),_0xc5a4('0x64'))['field']('NOW()',_0xc5a4('0x5e'))[_0xc5a4('0x84')]('NOW()',_0xc5a4('0x5c'))[_0xc5a4('0xaa')](_0xc5a4('0xab'))[_0xc5a4('0x49')](_0xc5a4('0xac'))['where'](_0xc5a4('0xad'),_0xff3ce7[_0xc5a4('0xae')][_0xc5a4('0x8b')]())['where'](_0xc5a4('0xaf'))[_0xc5a4('0x49')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xc5a4('0xb0'))[_0xc5a4('0xaa')](_0xc5a4('0xb1'))[_0xc5a4('0x49')]('VoiceQueueId\x20=\x20?',_0xb6cbf8[_0xc5a4('0x51')]['id'][_0xc5a4('0x8b')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xc5a4('0x83')]()['field'](_0xc5a4('0xb2'))['from']('cm_hopper')[_0xc5a4('0x49')](_0xc5a4('0x88'),_0xb6cbf8['params']['id'][_0xc5a4('0x8b')]())))['toString']();break;case _0xc5a4('0xb3'):_0x1b7f5a=squel[_0xc5a4('0xa1')]()['into'](_0xc5a4('0xa3'))[_0xc5a4('0xa4')]([_0xc5a4('0xa5'),_0xc5a4('0xa6'),_0xc5a4('0xa7'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel['select']()[_0xc5a4('0x84')](_0xc5a4('0xa5'),'phone')[_0xc5a4('0x84')](_0xc5a4('0xa8'),'scheduledAt')[_0xc5a4('0x84')]('id',_0xc5a4('0xa7'))[_0xc5a4('0x84')](_0xff3ce7[_0xc5a4('0xae')][_0xc5a4('0x8b')](),_0xc5a4('0xa9'))['field'](_0xb6cbf8[_0xc5a4('0x51')]['id'][_0xc5a4('0x8b')](),_0xc5a4('0x64'))[_0xc5a4('0x84')](_0xc5a4('0xa8'),'createdAt')[_0xc5a4('0x84')]('NOW()','updatedAt')[_0xc5a4('0xaa')](_0xc5a4('0xab'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xc5a4('0xad'),_0xff3ce7[_0xc5a4('0xae')][_0xc5a4('0x8b')]())[_0xc5a4('0x49')](_0xc5a4('0xaf'))[_0xc5a4('0x49')](_0xc5a4('0xb4'),squel['select']()[_0xc5a4('0x84')]('COALESCE(phone,\x27\x27)')[_0xc5a4('0xaa')](_0xc5a4('0xa3'))['where'](_0xc5a4('0x88'),_0xb6cbf8[_0xc5a4('0x51')]['id'][_0xc5a4('0x8b')]())))[_0xc5a4('0x8b')]();break;default:_0x1b7f5a=squel[_0xc5a4('0xa1')]()[_0xc5a4('0xa2')](_0xc5a4('0xa3'))[_0xc5a4('0xa4')]([_0xc5a4('0xa5'),_0xc5a4('0xa6'),_0xc5a4('0xa7'),_0xc5a4('0xa9'),_0xc5a4('0x64'),'createdAt',_0xc5a4('0x5c')],squel[_0xc5a4('0x83')]()[_0xc5a4('0x84')](_0xc5a4('0xa5'),_0xc5a4('0xa5'))[_0xc5a4('0x84')](_0xc5a4('0xa8'),_0xc5a4('0xa6'))[_0xc5a4('0x84')]('id',_0xc5a4('0xa7'))[_0xc5a4('0x84')](_0xff3ce7[_0xc5a4('0xae')][_0xc5a4('0x8b')](),'ListId')[_0xc5a4('0x84')](_0xb6cbf8[_0xc5a4('0x51')]['id'][_0xc5a4('0x8b')](),'VoiceQueueId')[_0xc5a4('0x84')](_0xc5a4('0xa8'),_0xc5a4('0x5e'))[_0xc5a4('0x84')](_0xc5a4('0xa8'),'updatedAt')[_0xc5a4('0xaa')]('cm_contacts')[_0xc5a4('0x49')](_0xc5a4('0xac'))[_0xc5a4('0x49')](_0xc5a4('0xad'),_0xff3ce7['CmListId'][_0xc5a4('0x8b')]())[_0xc5a4('0x49')](_0xc5a4('0xaf')))[_0xc5a4('0x8b')]();}_0x5c9e25[_0xc5a4('0x8a')](db['sequelize'][_0xc5a4('0x3f')](_0x1b7f5a));}return BPromise[_0xc5a4('0x8f')](_0x5c9e25);}})[_0xc5a4('0x2a')](function(){return _0x39bb0f;})[_0xc5a4('0x2a')](respondWithResult(_0x9811f9,null))[_0xc5a4('0x50')](handleError(_0x9811f9,null));};exports[_0xc5a4('0xb5')]=function(_0x57bb0c,_0x1a1a06,_0x492c92){return db[_0xc5a4('0x3a')][_0xc5a4('0x34')]({'where':{'id':_0x57bb0c['params']['id']}})['then'](handleEntityNotFound(_0x1a1a06,null))[_0xc5a4('0x2a')](function(_0x2d0eb4){if(_0x2d0eb4){return _0x2d0eb4['removeLists'](_0x57bb0c['query']['ids']);}})['then'](function(_0xae6ab8){if(_0xae6ab8){return db[_0xc5a4('0x62')][_0xc5a4('0x2b')]({'where':{'ListId':_0x57bb0c[_0xc5a4('0x3f')][_0xc5a4('0x82')],'VoiceQueueId':_0x57bb0c[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](function(){return _0xae6ab8;});}})[_0xc5a4('0x2a')](respondWithStatusCode(_0x1a1a06,null))[_0xc5a4('0x50')](handleError(_0x1a1a06,null));};exports[_0xc5a4('0xb6')]=function(_0x3751bf,_0x34675c,_0x1a1524){var _0x372c37={};var _0x1ac612={};var _0x562cef;var _0x4b000f;return db[_0xc5a4('0x3a')][_0xc5a4('0x61')]({'where':{'id':_0x3751bf['params']['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x34675c,null))[_0xc5a4('0x2a')](function(_0x142361){if(_0x142361){_0x562cef=_0x142361;_0x1ac612[_0xc5a4('0x42')]=_[_0xc5a4('0x40')](db[_0xc5a4('0x9b')][_0xc5a4('0x3b')]);_0x1ac612[_0xc5a4('0x3f')]=_[_0xc5a4('0x40')](_0x3751bf[_0xc5a4('0x3f')]);_0x1ac612['filters']=_[_0xc5a4('0x41')](_0x1ac612[_0xc5a4('0x42')],_0x1ac612['query']);_0x372c37[_0xc5a4('0x43')]=_['intersection'](_0x1ac612[_0xc5a4('0x42')],qs[_0xc5a4('0x44')](_0x3751bf[_0xc5a4('0x3f')][_0xc5a4('0x44')]));_0x372c37['attributes']=_0x372c37[_0xc5a4('0x43')][_0xc5a4('0x52')]?_0x372c37['attributes']:_0x1ac612['model'];_0x372c37[_0xc5a4('0x47')]=qs[_0xc5a4('0x48')](_0x3751bf[_0xc5a4('0x3f')][_0xc5a4('0x48')]);_0x372c37['where']=qs[_0xc5a4('0x4b')](_[_0xc5a4('0x4a')](_0x3751bf[_0xc5a4('0x3f')],_0x1ac612['filters']));if(_0x3751bf['query'][_0xc5a4('0x31')]){_0x372c37[_0xc5a4('0x49')]=_[_0xc5a4('0x4c')](_0x372c37[_0xc5a4('0x49')],{'$or':_[_0xc5a4('0x32')](_0x372c37[_0xc5a4('0x43')],function(_0x39e300){var _0x18ed42={};_0x18ed42[_0x39e300]={'$like':'%'+_0x3751bf['query'][_0xc5a4('0x31')]+'%'};return _0x18ed42;})});}_0x372c37=_[_0xc5a4('0x4c')]({},_0x372c37,_0x3751bf[_0xc5a4('0x4d')]);return _0x562cef[_0xc5a4('0xb6')](_0x372c37);}})[_0xc5a4('0x2a')](function(_0x4c2a00){if(_0x4c2a00){_0x4b000f=_0x4c2a00['length'];if(!_0x3751bf[_0xc5a4('0x3f')][_0xc5a4('0x45')](_0xc5a4('0x46'))){_0x372c37[_0xc5a4('0x23')]=qs[_0xc5a4('0x23')](_0x3751bf[_0xc5a4('0x3f')][_0xc5a4('0x23')]);_0x372c37['offset']=qs['offset'](_0x3751bf[_0xc5a4('0x3f')][_0xc5a4('0x22')]);}return _0x562cef[_0xc5a4('0xb6')](_0x372c37);}})['then'](function(_0x2c6ebb){if(_0x2c6ebb){return _0x2c6ebb?{'count':_0x4b000f,'rows':_0x2c6ebb}:null;}})[_0xc5a4('0x2a')](respondWithResult(_0x34675c,null))[_0xc5a4('0x50')](handleError(_0x34675c,null));};exports[_0xc5a4('0xb7')]=function(_0x463eae,_0x4bf8c1,_0x256c14){var _0x428d55,_0x5f2171;return db[_0xc5a4('0x3a')]['find']({'where':{'id':_0x463eae[_0xc5a4('0x51')]['id']}})['then'](handleEntityNotFound(_0x4bf8c1,null))[_0xc5a4('0x2a')](function(_0x2c54a8){if(_0x2c54a8){_0x5f2171=_0x2c54a8;return _0x2c54a8[_0xc5a4('0xb7')](_0x463eae[_0xc5a4('0x5d')][_0xc5a4('0x82')],_[_0xc5a4('0x9d')](_0x463eae[_0xc5a4('0x5d')],[_0xc5a4('0x82'),'id'])||{});}return null;})['spread'](function(_0x6cff7d){var _0x5549a4;_0x428d55=_0x6cff7d||[];var _0x10500d=[];if(_0x6cff7d){for(var _0x1f7bab=0x0;_0x1f7bab<_0x6cff7d[_0xc5a4('0x52')];_0x1f7bab+=0x1){var _0x47815a=_0x6cff7d[_0x1f7bab][_0xc5a4('0x2c')]({'plain':!![]});_0x5549a4=squel[_0xc5a4('0xa1')]()[_0xc5a4('0xa2')](_0xc5a4('0xb8'))['fromQuery']([_0xc5a4('0xa5'),_0xc5a4('0xa7'),'ListId','VoiceQueueId',_0xc5a4('0x5e'),_0xc5a4('0x5c')],squel[_0xc5a4('0x83')]()[_0xc5a4('0x84')]('phone','phone')[_0xc5a4('0x84')]('id',_0xc5a4('0xa7'))[_0xc5a4('0x84')](_0x47815a[_0xc5a4('0xae')]['toString'](),_0xc5a4('0xa9'))[_0xc5a4('0x84')](_0x463eae[_0xc5a4('0x51')]['id'][_0xc5a4('0x8b')](),'VoiceQueueId')[_0xc5a4('0x84')]('NOW()','createdAt')[_0xc5a4('0x84')](_0xc5a4('0xa8'),'updatedAt')[_0xc5a4('0xaa')](_0xc5a4('0xab'))[_0xc5a4('0x49')](_0xc5a4('0xac'))[_0xc5a4('0x49')](_0xc5a4('0xad'),_0x47815a[_0xc5a4('0xae')]['toString']())[_0xc5a4('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xc5a4('0x8b')]();_0x10500d[_0xc5a4('0x8a')](db[_0xc5a4('0x75')][_0xc5a4('0x3f')](_0x5549a4));}return BPromise[_0xc5a4('0x8f')](_0x10500d);}})[_0xc5a4('0x2a')](function(){return _0x428d55;})[_0xc5a4('0x2a')](respondWithResult(_0x4bf8c1,null))[_0xc5a4('0x50')](handleError(_0x4bf8c1,null));};exports[_0xc5a4('0xb9')]=function(_0x4fda03,_0x2fb5a6,_0x1fd5c8){return db[_0xc5a4('0x3a')][_0xc5a4('0x34')]({'where':{'id':_0x4fda03['params']['id']}})[_0xc5a4('0x2a')](handleEntityNotFound(_0x2fb5a6,null))['then'](function(_0x54e340){if(_0x54e340){return _0x54e340[_0xc5a4('0xb9')](_0x4fda03[_0xc5a4('0x3f')][_0xc5a4('0x82')]);}})[_0xc5a4('0x2a')](function(_0x2fb4b2){if(_0x2fb4b2){return db[_0xc5a4('0x69')][_0xc5a4('0x2b')]({'where':{'ListId':_0x4fda03[_0xc5a4('0x3f')][_0xc5a4('0x82')],'VoiceQueueId':_0x4fda03[_0xc5a4('0x51')]['id']}})[_0xc5a4('0x2a')](function(){return _0x2fb4b2;});}})[_0xc5a4('0x2a')](respondWithStatusCode(_0x2fb5a6,null))[_0xc5a4('0x50')](handleError(_0x2fb5a6,null));}; \ No newline at end of file +var _0x1fba=['getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','sendStatus','end','status','json','offset','undefined','count','apply','reject','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','VoiceQueue','rawAttributes','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','filter','options','includeAll','include','findAll','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','body','getHoppers','findOne','pick','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack'];(function(_0x28ad8b,_0x47975a){var _0x30d0b9=function(_0xa859a5){while(--_0xa859a5){_0x28ad8b['push'](_0x28ad8b['shift']());}};_0x30d0b9(++_0x47975a);}(_0x1fba,0x1bd));var _0xa1fb=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x1fba[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0xa1fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1fb('0x1'));var jsonpatch=require(_0xa1fb('0x2'));var rp=require(_0xa1fb('0x3'));var moment=require('moment');var BPromise=require(_0xa1fb('0x4'));var Mustache=require(_0xa1fb('0x5'));var util=require(_0xa1fb('0x6'));var path=require(_0xa1fb('0x7'));var sox=require('sox');var csv=require(_0xa1fb('0x8'));var ejs=require(_0xa1fb('0x9'));var fs=require('fs');var fs_extra=require(_0xa1fb('0xa'));var _=require(_0xa1fb('0xb'));var squel=require(_0xa1fb('0xc'));var crypto=require(_0xa1fb('0xd'));var jsforce=require(_0xa1fb('0xe'));var deskjs=require(_0xa1fb('0xf'));var toCsv=require(_0xa1fb('0x8'));var querystring=require(_0xa1fb('0x10'));var Papa=require(_0xa1fb('0x11'));var Redis=require(_0xa1fb('0x12'));var authService=require(_0xa1fb('0x13'));var qs=require(_0xa1fb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1fb('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa1fb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa1fb('0x17'));var db=require(_0xa1fb('0x18'))['db'];config[_0xa1fb('0x19')]=_['defaults'](config[_0xa1fb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1fb('0x19')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x596c19,_0x2b4c4f){_0x2b4c4f=_0x2b4c4f||0xcc;return function(_0x4ca48a){if(_0x4ca48a){return _0x596c19[_0xa1fb('0x1a')](_0x2b4c4f);}return _0x596c19['status'](_0x2b4c4f)[_0xa1fb('0x1b')]();};}function respondWithResult(_0xfd1fe9,_0x10dae6){_0x10dae6=_0x10dae6||0xc8;return function(_0xaff7c8){if(_0xaff7c8){return _0xfd1fe9[_0xa1fb('0x1c')](_0x10dae6)[_0xa1fb('0x1d')](_0xaff7c8);}};}function respondWithFilteredResult(_0x57cba9,_0x5347f5){return function(_0x3a6a2a){if(_0x3a6a2a){var _0x41df2b=typeof _0x5347f5[_0xa1fb('0x1e')]===_0xa1fb('0x1f')&&typeof _0x5347f5['limit']===_0xa1fb('0x1f');var _0x3d5d5d=_0x3a6a2a[_0xa1fb('0x20')];var _0x1f0102=_0x41df2b?0x0:_0x5347f5[_0xa1fb('0x1e')];var _0x1659a5=_0x41df2b?_0x3a6a2a[_0xa1fb('0x20')]:_0x5347f5[_0xa1fb('0x1e')]+_0x5347f5['limit'];var _0x1f933f;if(_0x1659a5>=_0x3d5d5d){_0x1659a5=_0x3d5d5d;_0x1f933f=0xc8;}else{_0x1f933f=0xce;}_0x57cba9['status'](_0x1f933f);return _0x57cba9['set']('Content-Range',_0x1f0102+'-'+_0x1659a5+'/'+_0x3d5d5d)[_0xa1fb('0x1d')](_0x3a6a2a);}return null;};}function patchUpdates(_0x2647c7){return function(_0xd96491){try{jsonpatch[_0xa1fb('0x21')](_0xd96491,_0x2647c7,!![]);}catch(_0x35213c){return BPromise[_0xa1fb('0x22')](_0x35213c);}return _0xd96491['save']();};}function saveUpdates(_0x5bdaed,_0x379318){return function(_0x322b9b){if(_0x322b9b){return _0x322b9b[_0xa1fb('0x23')](_0x5bdaed)[_0xa1fb('0x24')](function(_0x357dd7){return _0x357dd7;});}return null;};}function removeEntity(_0x124542,_0x4aabe6){return function(_0x304d6c){if(_0x304d6c){return _0x304d6c[_0xa1fb('0x25')]()['then'](function(){var _0xc87349=_0x304d6c[_0xa1fb('0x26')]({'plain':!![]});var _0x1742ef=[{'name':_0xa1fb('0x27'),'value':_0xa1fb('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xa1fb('0x29'),'ignore':![]}];var _0x45f0d3=_(_0x1742ef)['filter'](_0xa1fb('0x2a'))[_0xa1fb('0x2b')]('value')[_0xa1fb('0x2c')]();if(_[_0xa1fb('0x2d')](_0x45f0d3,_0xc87349[_0xa1fb('0x2e')])){return;}var _0x562770=_[_0xa1fb('0x2f')](_0x1742ef,[_0xa1fb('0x2c'),_0xc87349[_0xa1fb('0x2e')]])[_0xa1fb('0x30')];return db[_0xa1fb('0x31')]['destroy']({'where':{'type':_0x562770,'resourceId':_0xc87349['id']}})[_0xa1fb('0x24')](function(){return _0x304d6c;});})['then'](function(){_0x124542[_0xa1fb('0x1c')](0xcc)[_0xa1fb('0x1b')]();});}};}function handleEntityNotFound(_0x12b698,_0x4fe460){return function(_0xc5332f){if(!_0xc5332f){_0x12b698['sendStatus'](0x194);}return _0xc5332f;};}function handleError(_0x1f9c39,_0x819c0c){_0x819c0c=_0x819c0c||0x1f4;return function(_0x345b10){logger[_0xa1fb('0x32')](_0x345b10[_0xa1fb('0x33')]);if(_0x345b10[_0xa1fb('0x30')]){delete _0x345b10[_0xa1fb('0x30')];}_0x1f9c39[_0xa1fb('0x1c')](_0x819c0c)[_0xa1fb('0x34')](_0x345b10);};}exports['index']=function(_0x1aa2b1,_0x1664ed){var _0x4a65db={},_0x27d519={},_0x1e943e={'count':0x0,'rows':[]};var _0x11a9da=_[_0xa1fb('0x2b')](db[_0xa1fb('0x35')][_0xa1fb('0x36')],function(_0x2bf7d1){return{'name':_0x2bf7d1['fieldName'],'type':_0x2bf7d1[_0xa1fb('0x2e')][_0xa1fb('0x37')]};});_0x27d519[_0xa1fb('0x38')]=_[_0xa1fb('0x2b')](_0x11a9da,_0xa1fb('0x30'));_0x27d519[_0xa1fb('0x39')]=_['keys'](_0x1aa2b1[_0xa1fb('0x39')]);_0x27d519['filters']=_['intersection'](_0x27d519[_0xa1fb('0x38')],_0x27d519[_0xa1fb('0x39')]);_0x4a65db[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x27d519[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x1aa2b1[_0xa1fb('0x39')][_0xa1fb('0x3c')]));_0x4a65db[_0xa1fb('0x3a')]=_0x4a65db['attributes'][_0xa1fb('0x3d')]?_0x4a65db[_0xa1fb('0x3a')]:_0x27d519[_0xa1fb('0x38')];if(!_0x1aa2b1['query'][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x4a65db['limit']=qs['limit'](_0x1aa2b1[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x4a65db[_0xa1fb('0x1e')]=qs[_0xa1fb('0x1e')](_0x1aa2b1[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}_0x4a65db[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x1aa2b1[_0xa1fb('0x39')]['sort']);_0x4a65db[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_['pick'](_0x1aa2b1['query'],_0x27d519[_0xa1fb('0x44')]),_0x11a9da);if(_0x1aa2b1['query']['filter']){_0x4a65db[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x4a65db['where'],{'$or':_[_0xa1fb('0x2b')](_0x11a9da,function(_0x558bdf){if(_0x558bdf[_0xa1fb('0x2e')]!=='VIRTUAL'){var _0x37ae39={};_0x37ae39[_0x558bdf[_0xa1fb('0x30')]]={'$like':'%'+_0x1aa2b1['query'][_0xa1fb('0x46')]+'%'};return _0x37ae39;}})});}_0x4a65db=_[_0xa1fb('0x45')]({},_0x4a65db,_0x1aa2b1[_0xa1fb('0x47')]);var _0xe3b2cb={'where':_0x4a65db[_0xa1fb('0x43')]};return db[_0xa1fb('0x35')][_0xa1fb('0x20')](_0xe3b2cb)[_0xa1fb('0x24')](function(_0x211bef){_0x1e943e['count']=_0x211bef;if(_0x1aa2b1[_0xa1fb('0x39')][_0xa1fb('0x48')]){_0x4a65db[_0xa1fb('0x49')]=[{'all':!![]}];}return db[_0xa1fb('0x35')][_0xa1fb('0x4a')](_0x4a65db);})[_0xa1fb('0x24')](function(_0x3ee1e8){_0x1e943e['rows']=_0x3ee1e8;return _0x1e943e;})[_0xa1fb('0x24')](respondWithFilteredResult(_0x1664ed,_0x4a65db))[_0xa1fb('0x4b')](handleError(_0x1664ed,null));};exports[_0xa1fb('0x4c')]=function(_0xc07dea,_0x293ed2){var _0xc4d663={'raw':![],'where':{'id':_0xc07dea[_0xa1fb('0x4d')]['id']}},_0x488984={};_0x488984[_0xa1fb('0x38')]=_[_0xa1fb('0x4e')](db[_0xa1fb('0x35')][_0xa1fb('0x36')]);_0x488984[_0xa1fb('0x39')]=_['keys'](_0xc07dea[_0xa1fb('0x39')]);_0x488984[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x488984[_0xa1fb('0x38')],_0x488984[_0xa1fb('0x39')]);_0xc4d663[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x488984[_0xa1fb('0x38')],qs['fields'](_0xc07dea['query']['fields']));_0xc4d663[_0xa1fb('0x3a')]=_0xc4d663[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0xc4d663[_0xa1fb('0x3a')]:_0x488984['model'];if(_0xc07dea[_0xa1fb('0x39')]['includeAll']){_0xc4d663[_0xa1fb('0x49')]=[{'all':!![]}];}_0xc4d663=_[_0xa1fb('0x45')]({},_0xc4d663,_0xc07dea[_0xa1fb('0x47')]);return db[_0xa1fb('0x35')][_0xa1fb('0x2f')](_0xc4d663)[_0xa1fb('0x24')](handleEntityNotFound(_0x293ed2,null))[_0xa1fb('0x24')](respondWithResult(_0x293ed2,null))[_0xa1fb('0x4b')](handleError(_0x293ed2,null));};exports[_0xa1fb('0x4f')]=function(_0x116d36,_0x1a1674){return db[_0xa1fb('0x35')][_0xa1fb('0x4f')](_0x116d36['body'],{})[_0xa1fb('0x24')](function(_0x2efb7b){var _0xf9b5df=_0x116d36[_0xa1fb('0x50')]['get']({'plain':!![]});if(!_0xf9b5df)throw new Error(_0xa1fb('0x51'));if(_0xf9b5df[_0xa1fb('0x52')]===_0xa1fb('0x50')){var _0x2f440e=_0x2efb7b[_0xa1fb('0x26')]({'plain':!![]});var _0x1be080=[{'name':_0xa1fb('0x27'),'value':_0xa1fb('0x28')},{'name':_0xa1fb('0x53'),'value':_0xa1fb('0x29')}];var _0x19279b=_[_0xa1fb('0x2f')](_0x1be080,[_0xa1fb('0x2c'),_0x2f440e['type']])[_0xa1fb('0x30')];return db[_0xa1fb('0x54')]['find']({'where':{'name':_0x19279b,'userProfileId':_0xf9b5df[_0xa1fb('0x55')]},'raw':!![]})[_0xa1fb('0x24')](function(_0x350b17){if(_0x350b17&&_0x350b17[_0xa1fb('0x56')]===0x0){return db['UserProfileResource'][_0xa1fb('0x4f')]({'name':_0x2f440e['name'],'resourceId':_0x2f440e['id'],'type':_0x350b17[_0xa1fb('0x30')],'sectionId':_0x350b17['id']},{})[_0xa1fb('0x24')](function(){return _0x2efb7b;});}else{return _0x2efb7b;}})['catch'](function(_0x520bb8){logger['error'](_0xa1fb('0x57'),_0x520bb8);throw _0x520bb8;});}return _0x2efb7b;})['then'](respondWithResult(_0x1a1674,0xc9))[_0xa1fb('0x4b')](handleError(_0x1a1674,null));};exports[_0xa1fb('0x58')]=function(_0x513076,_0x18efca){var _0x5d0809={'where':{'id':_0x513076[_0xa1fb('0x4d')]['id']}},_0xf86841={};_0xf86841[_0xa1fb('0x38')]=_['keys'](db[_0xa1fb('0x35')][_0xa1fb('0x36')]);_0x5d0809['attributes']=_[_0xa1fb('0x3b')](_0xf86841[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x513076['query']['fields']));_0x5d0809[_0xa1fb('0x3a')]=_0x5d0809[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x5d0809[_0xa1fb('0x3a')]:_0xf86841[_0xa1fb('0x38')];if(_0x513076['query'][_0xa1fb('0x48')]){_0x5d0809[_0xa1fb('0x49')]=[{'all':!![]}];}_0x5d0809=_[_0xa1fb('0x45')]({},_0x5d0809,_0x513076['options']);return db[_0xa1fb('0x35')][_0xa1fb('0x2f')](_0x5d0809)[_0xa1fb('0x24')](handleEntityNotFound(_0x18efca,null))[_0xa1fb('0x24')](function(_0x4a9053){if(_0x4a9053){var _0x2171ad=_0x4a9053[_0xa1fb('0x26')]({'plain':!![]});_0x2171ad=qs['omit'](_0x2171ad,['id',_0xa1fb('0x59'),_0xa1fb('0x5a')]);_0x513076['body']=_[_0xa1fb('0x5b')](_0x513076[_0xa1fb('0x5c')],['id',_0xa1fb('0x59'),_0xa1fb('0x5a')]);return db[_0xa1fb('0x35')][_0xa1fb('0x4f')](_[_0xa1fb('0x45')](_0x2171ad,_0x513076[_0xa1fb('0x5c')]),{'include':_0x513076[_0xa1fb('0x39')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1145ca){var _0x42369f=_0x513076[_0xa1fb('0x50')][_0xa1fb('0x26')]({'plain':!![]});if(!_0x42369f)throw new Error(_0xa1fb('0x51'));if(_0x42369f[_0xa1fb('0x52')]===_0xa1fb('0x50')){var _0x17d969=_0x1145ca[_0xa1fb('0x26')]({'plain':!![]});var _0x1a7588=[{'name':'VoiceQueues','value':_0xa1fb('0x28')},{'name':_0xa1fb('0x53'),'value':'outbound'}];var _0xafca05=_[_0xa1fb('0x2f')](_0x1a7588,[_0xa1fb('0x2c'),_0x17d969['type']])['name'];return db[_0xa1fb('0x54')][_0xa1fb('0x2f')]({'where':{'name':_0xafca05,'userProfileId':_0x42369f[_0xa1fb('0x55')]},'raw':!![]})[_0xa1fb('0x24')](function(_0x84bac1){if(_0x84bac1&&_0x84bac1['autoAssociation']===0x0){return db[_0xa1fb('0x31')][_0xa1fb('0x4f')]({'name':_0x17d969[_0xa1fb('0x30')],'resourceId':_0x17d969['id'],'type':_0x84bac1['name'],'sectionId':_0x84bac1['id']},{})[_0xa1fb('0x24')](function(){return _0x1145ca;});}else{return _0x1145ca;}})['catch'](function(_0x2cc5f6){logger[_0xa1fb('0x32')](_0xa1fb('0x57'),_0x2cc5f6);throw _0x2cc5f6;});}return _0x1145ca;});}})[_0xa1fb('0x24')](respondWithResult(_0x18efca,0xc9))['catch'](handleError(_0x18efca,null));};exports[_0xa1fb('0x23')]=function(_0xdb51cf,_0x1ce9a4){if(_0xdb51cf[_0xa1fb('0x5c')]['id']){delete _0xdb51cf[_0xa1fb('0x5c')]['id'];}return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0xdb51cf[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x1ce9a4,null))[_0xa1fb('0x24')](saveUpdates(_0xdb51cf[_0xa1fb('0x5c')],null))[_0xa1fb('0x24')](respondWithResult(_0x1ce9a4,null))[_0xa1fb('0x4b')](handleError(_0x1ce9a4,null));};exports[_0xa1fb('0x25')]=function(_0x415a16,_0x42a7e6){return db['VoiceQueue'][_0xa1fb('0x2f')]({'where':{'id':_0x415a16[_0xa1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42a7e6,null))['then'](removeEntity(_0x42a7e6,null))[_0xa1fb('0x4b')](handleError(_0x42a7e6,null));};exports[_0xa1fb('0x5d')]=function(_0x48ae4b,_0x29939c,_0xb8aebb){var _0x4db303={'raw':![],'where':{}};var _0x2e3483={};var _0x4a48f7={'count':0x0,'rows':[]};return db[_0xa1fb('0x35')][_0xa1fb('0x5e')]({'where':{'id':_0x48ae4b[_0xa1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29939c,null))[_0xa1fb('0x24')](function(_0x30f5d3){if(_0x30f5d3){_0x2e3483[_0xa1fb('0x38')]=_['keys'](db['CmHopper'][_0xa1fb('0x36')]);_0x2e3483[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x48ae4b[_0xa1fb('0x39')]);_0x2e3483[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x2e3483[_0xa1fb('0x38')],_0x2e3483[_0xa1fb('0x39')]);_0x4db303[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x2e3483[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x48ae4b[_0xa1fb('0x39')]['fields']));_0x4db303[_0xa1fb('0x3a')]=_0x4db303[_0xa1fb('0x3a')]['length']?_0x4db303[_0xa1fb('0x3a')]:_0x2e3483['model'];if(!_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x4db303['limit']=qs[_0xa1fb('0x40')](_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x4db303['offset']=qs[_0xa1fb('0x1e')](_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}_0x4db303[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x48ae4b[_0xa1fb('0x39')]['sort']);_0x4db303['where']=qs['filters'](_[_0xa1fb('0x5f')](_0x48ae4b[_0xa1fb('0x39')],_0x2e3483[_0xa1fb('0x44')]));_0x4db303['where'][_0xa1fb('0x60')]=_0x30f5d3['id'];if(_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x4db303[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x4db303['where'],{'$or':_[_0xa1fb('0x2b')](_0x4db303[_0xa1fb('0x3a')],function(_0x39b393){var _0x4cead4={};_0x4cead4[_0x39b393]={'$like':'%'+_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x4cead4;})});}_0x4db303=_[_0xa1fb('0x45')]({},_0x4db303,_0x48ae4b[_0xa1fb('0x47')]);return db['CmHopper']['count']({'where':_0x4db303['where']})[_0xa1fb('0x24')](function(_0x25020b){_0x4a48f7[_0xa1fb('0x20')]=_0x25020b;if(_0x48ae4b[_0xa1fb('0x39')][_0xa1fb('0x48')]){_0x4db303[_0xa1fb('0x49')]=[{'all':!![]}];}return db[_0xa1fb('0x61')][_0xa1fb('0x4a')](_0x4db303);})[_0xa1fb('0x24')](function(_0x38a687){_0x4a48f7[_0xa1fb('0x62')]=_0x38a687;return _0x4a48f7;});}})['then'](respondWithFilteredResult(_0x29939c,_0x4db303))[_0xa1fb('0x4b')](handleError(_0x29939c,null));};exports[_0xa1fb('0x63')]=function(_0x109549,_0xad55dd,_0x306bee){var _0x13ae53={'raw':!![],'where':{}};var _0x3d8fc7={};var _0x5d19e7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa1fb('0x5e')]({'where':{'id':_0x109549[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0xad55dd,null))[_0xa1fb('0x24')](function(_0x32f299){if(_0x32f299){_0x3d8fc7['model']=_[_0xa1fb('0x4e')](db[_0xa1fb('0x64')]['rawAttributes']);_0x3d8fc7[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x109549[_0xa1fb('0x39')]);_0x3d8fc7[_0xa1fb('0x44')]=_['intersection'](_0x3d8fc7['model'],_0x3d8fc7[_0xa1fb('0x39')]);_0x13ae53[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x3d8fc7[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x109549['query'][_0xa1fb('0x3c')]));_0x13ae53[_0xa1fb('0x3a')]=_0x13ae53[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x13ae53['attributes']:_0x3d8fc7[_0xa1fb('0x38')];if(!_0x109549[_0xa1fb('0x39')][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x13ae53[_0xa1fb('0x40')]=qs['limit'](_0x109549[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x13ae53[_0xa1fb('0x1e')]=qs['offset'](_0x109549[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}_0x13ae53['order']=qs[_0xa1fb('0x42')](_0x109549[_0xa1fb('0x39')][_0xa1fb('0x42')]);_0x13ae53[_0xa1fb('0x43')]=qs['filters'](_[_0xa1fb('0x5f')](_0x109549[_0xa1fb('0x39')],_0x3d8fc7[_0xa1fb('0x44')]));_0x13ae53[_0xa1fb('0x43')]['VoiceQueueId']=_0x32f299['id'];if(_0x109549[_0xa1fb('0x39')]['filter']){_0x13ae53['where']=_['merge'](_0x13ae53[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x13ae53[_0xa1fb('0x3a')],function(_0xfd948e){var _0x2dfe26={};_0x2dfe26[_0xfd948e]={'$like':'%'+_0x109549[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x2dfe26;})});}_0x13ae53=_['merge']({},_0x13ae53,_0x109549[_0xa1fb('0x47')]);return db[_0xa1fb('0x64')][_0xa1fb('0x20')]({'where':_0x13ae53[_0xa1fb('0x43')]})[_0xa1fb('0x24')](function(_0x2bd979){_0x5d19e7[_0xa1fb('0x20')]=_0x2bd979;if(_0x109549['query'][_0xa1fb('0x48')]){_0x13ae53[_0xa1fb('0x49')]=[{'all':!![]}];}return db[_0xa1fb('0x64')][_0xa1fb('0x4a')](_0x13ae53);})[_0xa1fb('0x24')](function(_0x55ac1c){_0x5d19e7[_0xa1fb('0x62')]=_0x55ac1c;return _0x5d19e7;});}})[_0xa1fb('0x24')](respondWithFilteredResult(_0xad55dd,_0x13ae53))[_0xa1fb('0x4b')](handleError(_0xad55dd,null));};exports[_0xa1fb('0x65')]=function(_0x3a684e,_0xf7ddac,_0x481ef6){var _0x592e98={'raw':!![],'where':{}};var _0x581888={};var _0x31d9c5={'count':0x0,'rows':[]};return db[_0xa1fb('0x35')][_0xa1fb('0x5e')]({'where':{'id':_0x3a684e[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0xf7ddac,null))[_0xa1fb('0x24')](function(_0x2d1353){if(_0x2d1353){_0x581888['model']=_['keys'](db['CmHopperFinal'][_0xa1fb('0x36')]);_0x581888['query']=_[_0xa1fb('0x4e')](_0x3a684e[_0xa1fb('0x39')]);_0x581888[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x581888[_0xa1fb('0x38')],_0x581888[_0xa1fb('0x39')]);_0x592e98[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x581888[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x3a684e['query'][_0xa1fb('0x3c')]));_0x592e98[_0xa1fb('0x3a')]=_0x592e98[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x592e98[_0xa1fb('0x3a')]:_0x581888[_0xa1fb('0x38')];if(!_0x3a684e[_0xa1fb('0x39')][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x592e98[_0xa1fb('0x40')]=qs['limit'](_0x3a684e[_0xa1fb('0x39')]['limit']);_0x592e98[_0xa1fb('0x1e')]=qs[_0xa1fb('0x1e')](_0x3a684e[_0xa1fb('0x39')]['offset']);}_0x592e98[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x3a684e[_0xa1fb('0x39')][_0xa1fb('0x42')]);_0x592e98[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_[_0xa1fb('0x5f')](_0x3a684e[_0xa1fb('0x39')],_0x581888['filters']));_0x592e98['where'][_0xa1fb('0x60')]=_0x2d1353['id'];if(_0x3a684e[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x592e98[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x592e98['where'],{'$or':_['map'](_0x592e98[_0xa1fb('0x3a')],function(_0x2a97d1){var _0x6c43a6={};_0x6c43a6[_0x2a97d1]={'$like':'%'+_0x3a684e[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x6c43a6;})});}_0x592e98=_['merge']({},_0x592e98,_0x3a684e['options']);return db['CmHopperFinal'][_0xa1fb('0x20')]({'where':_0x592e98['where']})[_0xa1fb('0x24')](function(_0x2ed981){_0x31d9c5[_0xa1fb('0x20')]=_0x2ed981;if(_0x3a684e[_0xa1fb('0x39')]['includeAll']){_0x592e98[_0xa1fb('0x49')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x592e98);})[_0xa1fb('0x24')](function(_0x34a38c){_0x31d9c5[_0xa1fb('0x62')]=_0x34a38c;return _0x31d9c5;});}})[_0xa1fb('0x24')](respondWithFilteredResult(_0xf7ddac,_0x592e98))[_0xa1fb('0x4b')](handleError(_0xf7ddac,null));};exports[_0xa1fb('0x66')]=function(_0x171760,_0xc5a6a2,_0xe58ec2){var _0x16a340={'raw':!![],'where':{}};var _0x2ac0bb={};var _0x2dfa9d={'count':0x0,'rows':[]};return db[_0xa1fb('0x35')][_0xa1fb('0x5e')]({'where':{'id':_0x171760['params']['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0xc5a6a2,null))[_0xa1fb('0x24')](function(_0x19f971){if(_0x19f971){_0x2ac0bb[_0xa1fb('0x38')]=_[_0xa1fb('0x4e')](db[_0xa1fb('0x67')][_0xa1fb('0x36')]);_0x2ac0bb[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x171760[_0xa1fb('0x39')]);_0x2ac0bb[_0xa1fb('0x44')]=_['intersection'](_0x2ac0bb['model'],_0x2ac0bb[_0xa1fb('0x39')]);_0x16a340[_0xa1fb('0x3a')]=_['intersection'](_0x2ac0bb['model'],qs[_0xa1fb('0x3c')](_0x171760[_0xa1fb('0x39')][_0xa1fb('0x3c')]));_0x16a340[_0xa1fb('0x3a')]=_0x16a340[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x16a340['attributes']:_0x2ac0bb[_0xa1fb('0x38')];if(!_0x171760['query'][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x16a340[_0xa1fb('0x40')]=qs[_0xa1fb('0x40')](_0x171760[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x16a340[_0xa1fb('0x1e')]=qs[_0xa1fb('0x1e')](_0x171760[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}_0x16a340[_0xa1fb('0x41')]=qs['sort'](_0x171760[_0xa1fb('0x39')][_0xa1fb('0x42')]);_0x16a340['where']=qs['filters'](_[_0xa1fb('0x5f')](_0x171760['query'],_0x2ac0bb[_0xa1fb('0x44')]));_0x16a340[_0xa1fb('0x43')][_0xa1fb('0x60')]=_0x19f971['id'];if(_0x171760[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x16a340[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x16a340[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x16a340[_0xa1fb('0x3a')],function(_0x57e375){var _0xf288a5={};_0xf288a5[_0x57e375]={'$like':'%'+_0x171760['query'][_0xa1fb('0x46')]+'%'};return _0xf288a5;})});}_0x16a340=_[_0xa1fb('0x45')]({},_0x16a340,_0x171760[_0xa1fb('0x47')]);return db[_0xa1fb('0x67')][_0xa1fb('0x20')]({'where':_0x16a340[_0xa1fb('0x43')]})['then'](function(_0x252bb5){_0x2dfa9d[_0xa1fb('0x20')]=_0x252bb5;if(_0x171760[_0xa1fb('0x39')]['includeAll']){_0x16a340[_0xa1fb('0x49')]=[{'all':!![]}];}return db[_0xa1fb('0x67')][_0xa1fb('0x4a')](_0x16a340);})['then'](function(_0x525094){_0x2dfa9d[_0xa1fb('0x62')]=_0x525094;return _0x2dfa9d;});}})['then'](respondWithFilteredResult(_0xc5a6a2,_0x16a340))[_0xa1fb('0x4b')](handleError(_0xc5a6a2,null));};exports[_0xa1fb('0x68')]=function(_0x3b50ab,_0x100dd8,_0x4c8721){var _0x3f5a2f={};var _0x21bf07={};var _0x1e4e0e;var _0x2e791e;return db[_0xa1fb('0x35')][_0xa1fb('0x5e')]({'where':{'id':_0x3b50ab[_0xa1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x100dd8,null))[_0xa1fb('0x24')](function(_0x1e2616){if(_0x1e2616){_0x1e4e0e=_0x1e2616;_0x21bf07[_0xa1fb('0x38')]=_[_0xa1fb('0x4e')](db[_0xa1fb('0x69')][_0xa1fb('0x36')]);_0x21bf07[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x3b50ab[_0xa1fb('0x39')]);_0x21bf07[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x21bf07[_0xa1fb('0x38')],_0x21bf07[_0xa1fb('0x39')]);_0x3f5a2f[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x21bf07[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x3b50ab[_0xa1fb('0x39')][_0xa1fb('0x3c')]));_0x3f5a2f[_0xa1fb('0x3a')]=_0x3f5a2f['attributes'][_0xa1fb('0x3d')]?_0x3f5a2f[_0xa1fb('0x3a')]:_0x21bf07[_0xa1fb('0x38')];_0x3f5a2f[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x3b50ab['query']['sort']);_0x3f5a2f['where']=qs[_0xa1fb('0x44')](_[_0xa1fb('0x5f')](_0x3b50ab[_0xa1fb('0x39')],_0x21bf07[_0xa1fb('0x44')]));if(_0x3b50ab[_0xa1fb('0x39')]['filter']){_0x3f5a2f[_0xa1fb('0x43')]=_['merge'](_0x3f5a2f[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x3f5a2f[_0xa1fb('0x3a')],function(_0x2b4757){var _0x3e12d0={};_0x3e12d0[_0x2b4757]={'$like':'%'+_0x3b50ab[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x3e12d0;})});}_0x3f5a2f=_['merge']({},_0x3f5a2f,_0x3b50ab[_0xa1fb('0x47')]);return _0x1e4e0e['getTeams'](_0x3f5a2f);}})[_0xa1fb('0x24')](function(_0x3583f8){if(_0x3583f8){_0x2e791e=_0x3583f8['length'];if(!_0x3b50ab[_0xa1fb('0x39')][_0xa1fb('0x3e')]('nolimit')){_0x3f5a2f[_0xa1fb('0x40')]=qs[_0xa1fb('0x40')](_0x3b50ab[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x3f5a2f[_0xa1fb('0x1e')]=qs[_0xa1fb('0x1e')](_0x3b50ab[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}return _0x1e4e0e[_0xa1fb('0x68')](_0x3f5a2f);}})[_0xa1fb('0x24')](function(_0x58e659){if(_0x58e659){return _0x58e659?{'count':_0x2e791e,'rows':_0x58e659}:null;}})[_0xa1fb('0x24')](respondWithResult(_0x100dd8,null))['catch'](handleError(_0x100dd8,null));};exports[_0xa1fb('0x6a')]=function(_0x348809,_0x11aead,_0x31151f){var _0x23238b=_0x348809[_0xa1fb('0x5c')][_0xa1fb('0x6b')];var _0x858069=_[_0xa1fb('0x2b')](_0x23238b,'id');return db[_0xa1fb('0x69')][_0xa1fb('0x4a')]({'where':{'id':_0x858069},'attributes':['id'],'include':[{'model':db[_0xa1fb('0x6c')],'as':'Agents','attributes':['id',_0xa1fb('0x30'),_0xa1fb('0x6d'),_0xa1fb('0x6e'),_0xa1fb('0x6f')],'raw':!![]}]})['then'](function(_0x196ad8){if(_0x196ad8){var _0x24d0b3=_[_0xa1fb('0x70')](_0x196ad8,function(_0x248f85){var _0xd931e2=_0x248f85[_0xa1fb('0x26')]({'plain':!![]});_0xd931e2[_0xa1fb('0x71')][_0xa1fb('0x72')](function(_0x173de4){_0x173de4[_0xa1fb('0x73')]=_[_0xa1fb('0x2f')](_0x23238b,{'id':_0xd931e2['id']})[_0xa1fb('0x73')];});return _0xd931e2[_0xa1fb('0x71')];});return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x348809['params']['id']}})['then'](function(_0x30da45){return db[_0xa1fb('0x74')]['transaction'](function(_0x29cb08){return _0x30da45[_0xa1fb('0x6a')](_0x858069,{'transaction':_0x29cb08})[_0xa1fb('0x24')](function(){return BPromise[_0xa1fb('0x75')](_0x23238b,function(_0x2a12d8){return db[_0xa1fb('0x76')]['upsert']({'TeamId':_0x2a12d8['id'],'VoiceQueueId':_0x348809[_0xa1fb('0x4d')]['id'],'penalty':_0x2a12d8[_0xa1fb('0x73')]},{'transaction':_0x29cb08});});})[_0xa1fb('0x24')](function(){return BPromise[_0xa1fb('0x75')](_0x24d0b3,function(_0x31babb){return db[_0xa1fb('0x77')][_0xa1fb('0x78')]({'where':{'UserId':_0x31babb['id'],'VoiceQueueId':_0x348809[_0xa1fb('0x4d')]['id']},'defaults':{'penalty':_0x31babb[_0xa1fb('0x73')]},'transaction':_0x29cb08});});})[_0xa1fb('0x24')](function(){return BPromise['each'](_[_0xa1fb('0x46')](_0x24d0b3,{'online':!![]}),function(_0xb3cffe){return db[_0xa1fb('0x79')][_0xa1fb('0x7a')]({'membername':_0xb3cffe[_0xa1fb('0x30')],'UserId':_0xb3cffe['id'],'queue_name':_0x30da45['name'],'VoiceQueueId':_0x30da45['id'],'interface':_[_0xa1fb('0x7b')](_0xb3cffe[_0xa1fb('0x6f')])?util[_0xa1fb('0x7c')](_0xa1fb('0x7d'),_0xb3cffe[_0xa1fb('0x30')]):_0xb3cffe[_0xa1fb('0x6f')],'paused':_0xb3cffe[_0xa1fb('0x6e')]||![],'penalty':_0xb3cffe[_0xa1fb('0x73')]},{'transaction':_0x29cb08});});})[_0xa1fb('0x24')](function(){_0x24d0b3[_0xa1fb('0x72')](function(_0x251e62){socket[_0xa1fb('0x7e')]('userVoiceQueue:save',{'UserId':_0x251e62['id'],'VoiceQueueId':_0x30da45['id']});});});});});}})[_0xa1fb('0x24')](respondWithStatusCode(_0x11aead,null))[_0xa1fb('0x4b')](handleError(_0x11aead,null));};exports[_0xa1fb('0x7f')]=function(_0x53fdb9,_0x21e02c,_0xd75701){return db['Team'][_0xa1fb('0x4a')]({'where':{'id':_0x53fdb9[_0xa1fb('0x39')][_0xa1fb('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21e02c,null))[_0xa1fb('0x24')](function(_0x595fef){var _0x5abfb4=_[_0xa1fb('0x2b')](_0x595fef,'id');var _0x7180d8=[];var _0x4b8d92=[];var _0x3631fb=squel[_0xa1fb('0x81')]();_0x3631fb[_0xa1fb('0x82')](_0xa1fb('0x83'))[_0xa1fb('0x84')](_0xa1fb('0x85'),'tq')[_0xa1fb('0x86')](_0xa1fb('0x87'),'ut',_0xa1fb('0x88'))['where']('VoiceQueueId\x20=\x20?',_0x53fdb9[_0xa1fb('0x4d')]['id']);for(var _0x510f87=0x0;_0x510f87<_0x595fef[_0xa1fb('0x3d')];_0x510f87+=0x1){let _0x23d2de=_0x595fef[_0x510f87];for(var _0x3084ce=0x0;_0x3084ce<_0x23d2de[_0xa1fb('0x71')][_0xa1fb('0x3d')];_0x3084ce+=0x1){let _0xe4374=_0x23d2de[_0xa1fb('0x71')][_0x3084ce];var _0x24e742=_0x3631fb[_0xa1fb('0x58')]();_0x24e742[_0xa1fb('0x43')](_0xa1fb('0x89'),_0xe4374['id']);_0x4b8d92['push'](db[_0xa1fb('0x74')][_0xa1fb('0x39')](_0x24e742[_0xa1fb('0x8a')](),{'type':db[_0xa1fb('0x74')][_0xa1fb('0x8b')][_0xa1fb('0x8c')]})[_0xa1fb('0x24')](function(_0x12f95a){if(_0x12f95a[_0xa1fb('0x3d')]===0x1){return _0xe4374['id'];}else{var _0x266099=_[_0xa1fb('0x8d')](_[_0xa1fb('0x2b')](_0x12f95a,_0xa1fb('0x8e')),function(_0x58d134){return _[_0xa1fb('0x2d')](_0x5abfb4,_0x58d134);});if(_0x266099){return _0xe4374['id'];}}}));}}return BPromise[_0xa1fb('0x8f')](_0x4b8d92)[_0xa1fb('0x24')](function(_0x32445f){_0x7180d8=_(_0x7180d8)['union'](_0x32445f)[_0xa1fb('0x90')]()[_0xa1fb('0x2c')]();return db['VoiceQueue']['find']({'where':{'id':_0x53fdb9[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](function(_0x558463){return db[_0xa1fb('0x74')]['transaction'](function(_0x1d22a8){return _0x558463['removeTeams'](_0x53fdb9[_0xa1fb('0x39')][_0xa1fb('0x80')],{'transaction':_0x1d22a8})[_0xa1fb('0x24')](function(){if(!_[_0xa1fb('0x91')](_0x7180d8)){return _0x558463[_0xa1fb('0x92')](_0x7180d8,{'transaction':_0x1d22a8})['then'](function(){return db[_0xa1fb('0x79')][_0xa1fb('0x25')]({'where':{'VoiceQueueId':_0x53fdb9[_0xa1fb('0x4d')]['id'],'UserId':_0x7180d8},'transaction':_0x1d22a8});});}})['then'](function(){_0x7180d8[_0xa1fb('0x72')](function(_0x26d3dd){socket[_0xa1fb('0x7e')]('userVoiceQueue:remove',{'UserId':_0x26d3dd,'VoiceQueueId':_0x558463['id']});});});});});});})[_0xa1fb('0x24')](respondWithStatusCode(_0x21e02c,null))[_0xa1fb('0x4b')](handleError(_0x21e02c,null));};exports[_0xa1fb('0x93')]=function(_0x37c2b3,_0x47c2c5,_0x5dac01){var _0x2e85c0,_0x3f042b;return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x37c2b3[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x47c2c5,null))[_0xa1fb('0x24')](function(_0x5136a2){if(_0x5136a2){_0x3f042b=_0x5136a2;return _0x5136a2[_0xa1fb('0x93')](_0x37c2b3[_0xa1fb('0x5c')][_0xa1fb('0x80')],_[_0xa1fb('0x5b')](_0x37c2b3[_0xa1fb('0x5c')],['ids','id'])||{})[_0xa1fb('0x94')](function(_0x2f0c3d){for(var _0x332fdf=0x0;_0x332fdf<_0x37c2b3['body'][_0xa1fb('0x80')][_0xa1fb('0x3d')];_0x332fdf+=0x1){socket['emit'](_0xa1fb('0x95'),{'UserId':Number(_0x37c2b3['body'][_0xa1fb('0x80')][_0x332fdf]),'VoiceQueueId':Number(_0x37c2b3[_0xa1fb('0x4d')]['id'])});}return _0x2f0c3d;});}})[_0xa1fb('0x24')](function(_0x41c33b){_0x2e85c0=_0x41c33b||[];if(_0x3f042b){return db[_0xa1fb('0x6c')][_0xa1fb('0x4a')]({'where':{'id':_0x37c2b3[_0xa1fb('0x5c')][_0xa1fb('0x80')]},'attributes':['id',_0xa1fb('0x30'),_0xa1fb('0x6d'),_0xa1fb('0x6e'),'interface'],'raw':!![]});}})[_0xa1fb('0x24')](function(_0x4fc834){if(!_[_0xa1fb('0x91')](_0x4fc834)){var _0x23aa6a=[];for(var _0x42c5a4=0x0;_0x42c5a4<_0x4fc834[_0xa1fb('0x3d')];_0x42c5a4++){if(_0x4fc834[_0x42c5a4]['online']){_0x23aa6a[_0xa1fb('0x96')](db['UserVoiceQueueRt'][_0xa1fb('0x7a')]({'membername':_0x4fc834[_0x42c5a4][_0xa1fb('0x30')],'UserId':_0x4fc834[_0x42c5a4]['id'],'queue_name':_0x3f042b['name'],'VoiceQueueId':_0x3f042b['id'],'interface':_[_0xa1fb('0x7b')](_0x4fc834[_0x42c5a4][_0xa1fb('0x6f')])?util[_0xa1fb('0x7c')](_0xa1fb('0x7d'),_0x4fc834[_0x42c5a4]['name']):_0x4fc834[_0x42c5a4][_0xa1fb('0x6f')],'paused':_0x4fc834[_0x42c5a4]['voicePause']||![],'penalty':_0x37c2b3[_0xa1fb('0x5c')][_0xa1fb('0x73')]||0x0}));}}return BPromise[_0xa1fb('0x8f')](_0x23aa6a);}})[_0xa1fb('0x24')](function(){return _0x2e85c0;})['then'](respondWithResult(_0x47c2c5,null))[_0xa1fb('0x4b')](handleError(_0x47c2c5,null));};exports[_0xa1fb('0x92')]=function(_0x4e7b2c,_0x2124b9,_0x23d09b){return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x4e7b2c['params']['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x2124b9,null))['then'](function(_0x5a9e4b){if(_0x5a9e4b){return _0x5a9e4b[_0xa1fb('0x92')](_0x4e7b2c[_0xa1fb('0x39')]['ids'])[_0xa1fb('0x24')](function(){if(_[_0xa1fb('0x97')](_0x4e7b2c['query'][_0xa1fb('0x80')])){for(var _0x5123be=0x0;_0x5123be<_0x4e7b2c[_0xa1fb('0x39')][_0xa1fb('0x80')][_0xa1fb('0x3d')];_0x5123be+=0x1){socket[_0xa1fb('0x7e')](_0xa1fb('0x98'),{'UserId':Number(_0x4e7b2c[_0xa1fb('0x39')][_0xa1fb('0x80')][_0x5123be]),'VoiceQueueId':Number(_0x4e7b2c[_0xa1fb('0x4d')]['id'])});}}else{socket[_0xa1fb('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x4e7b2c[_0xa1fb('0x39')]['ids']),'VoiceQueueId':Number(_0x4e7b2c[_0xa1fb('0x4d')]['id'])});}});}})[_0xa1fb('0x24')](function(_0x301d8e){return db[_0xa1fb('0x79')][_0xa1fb('0x25')]({'where':{'VoiceQueueId':_0x4e7b2c['params']['id'],'UserId':_0x4e7b2c[_0xa1fb('0x39')]['ids']}})[_0xa1fb('0x24')](function(){return _0x301d8e;});})[_0xa1fb('0x24')](respondWithStatusCode(_0x2124b9,null))[_0xa1fb('0x4b')](handleError(_0x2124b9,null));};exports[_0xa1fb('0x99')]=function(_0x14a10c,_0x112cb5,_0x5827c7){var _0x2bfb94={};var _0x350842={};var _0x19606f;var _0x2b5f2b;return db['VoiceQueue']['findOne']({'where':{'id':_0x14a10c[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x112cb5,null))['then'](function(_0x4050cf){if(_0x4050cf){_0x19606f=_0x4050cf;_0x350842['model']=_[_0xa1fb('0x4e')](db[_0xa1fb('0x6c')][_0xa1fb('0x36')]);_0x350842[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x14a10c['query']);_0x350842[_0xa1fb('0x44')]=_['intersection'](_0x350842[_0xa1fb('0x38')],_0x350842[_0xa1fb('0x39')]);_0x2bfb94[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x350842[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x14a10c['query']['fields']));_0x2bfb94['attributes']=_0x2bfb94[_0xa1fb('0x3a')]['length']?_0x2bfb94[_0xa1fb('0x3a')]:_0x350842[_0xa1fb('0x38')];_0x2bfb94['order']=qs[_0xa1fb('0x42')](_0x14a10c['query']['sort']);_0x2bfb94[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_['pick'](_0x14a10c[_0xa1fb('0x39')],_0x350842['filters']));if(_0x14a10c['query']['filter']){_0x2bfb94[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x2bfb94['where'],{'$or':_[_0xa1fb('0x2b')](_0x2bfb94[_0xa1fb('0x3a')],function(_0x394918){var _0x536436={};_0x536436[_0x394918]={'$like':'%'+_0x14a10c[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x536436;})});}_0x2bfb94=_[_0xa1fb('0x45')]({},_0x2bfb94,_0x14a10c[_0xa1fb('0x47')]);return _0x19606f['getAgents'](_0x2bfb94);}})[_0xa1fb('0x24')](function(_0x552f9a){if(_0x552f9a){_0x2b5f2b=_0x552f9a[_0xa1fb('0x3d')];if(!_0x14a10c[_0xa1fb('0x39')]['hasOwnProperty']('nolimit')){_0x2bfb94[_0xa1fb('0x40')]=qs['limit'](_0x14a10c[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x2bfb94[_0xa1fb('0x1e')]=qs[_0xa1fb('0x1e')](_0x14a10c[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}return _0x19606f[_0xa1fb('0x99')](_0x2bfb94);}})[_0xa1fb('0x24')](function(_0x100642){if(_0x100642){return _0x100642?{'count':_0x2b5f2b,'rows':_0x100642}:null;}})[_0xa1fb('0x24')](respondWithResult(_0x112cb5,null))['catch'](handleError(_0x112cb5,null));};exports[_0xa1fb('0x9a')]=function(_0x5bef30,_0x340080,_0x1fe692){var _0x34636e={};var _0x56c6d7={};var _0x4b6884;var _0x4f721b;return db[_0xa1fb('0x35')]['findOne']({'where':{'id':_0x5bef30['params']['id']}})['then'](handleEntityNotFound(_0x340080,null))['then'](function(_0x5ce70b){if(_0x5ce70b){_0x4b6884=_0x5ce70b;_0x56c6d7[_0xa1fb('0x38')]=_[_0xa1fb('0x4e')](db[_0xa1fb('0x79')][_0xa1fb('0x36')]);_0x56c6d7[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x5bef30[_0xa1fb('0x39')]);_0x56c6d7['filters']=_[_0xa1fb('0x3b')](_0x56c6d7[_0xa1fb('0x38')],_0x56c6d7['query']);_0x34636e[_0xa1fb('0x3a')]=_[_0xa1fb('0x3b')](_0x56c6d7['model'],qs['fields'](_0x5bef30[_0xa1fb('0x39')][_0xa1fb('0x3c')]));_0x34636e[_0xa1fb('0x3a')]=_0x34636e[_0xa1fb('0x3a')]['length']?_0x34636e[_0xa1fb('0x3a')]:_0x56c6d7[_0xa1fb('0x38')];_0x34636e[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x5bef30[_0xa1fb('0x39')]['sort']);_0x34636e[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_[_0xa1fb('0x5f')](_0x5bef30[_0xa1fb('0x39')],_0x56c6d7[_0xa1fb('0x44')]));if(_0x5bef30[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x34636e[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x34636e[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x34636e['attributes'],function(_0x383fd4){var _0x3173a5={};_0x3173a5[_0x383fd4]={'$like':'%'+_0x5bef30[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x3173a5;})});}_0x34636e=_['merge']({},_0x34636e,_0x5bef30[_0xa1fb('0x47')]);return _0x4b6884[_0xa1fb('0x9a')](_0x34636e);}})['then'](function(_0x4f0e1f){if(_0x4f0e1f){_0x4f721b=_0x4f0e1f[_0xa1fb('0x3d')];if(!_0x5bef30['query'][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x34636e[_0xa1fb('0x40')]=qs[_0xa1fb('0x40')](_0x5bef30[_0xa1fb('0x39')]['limit']);_0x34636e['offset']=qs[_0xa1fb('0x1e')](_0x5bef30['query'][_0xa1fb('0x1e')]);}return _0x4b6884[_0xa1fb('0x9a')](_0x34636e);}})[_0xa1fb('0x24')](function(_0x46402e){return _0x46402e?{'count':_0x4f721b,'rows':_0x46402e}:null;})[_0xa1fb('0x24')](respondWithResult(_0x340080,null))[_0xa1fb('0x4b')](handleError(_0x340080,null));};exports[_0xa1fb('0x9b')]=function(_0x4466ac,_0x222e14,_0x2cee9c){var _0x1a1b5b={};var _0x34bb09={};var _0x3ce7d0;var _0xd42541;return db[_0xa1fb('0x35')][_0xa1fb('0x5e')]({'where':{'id':_0x4466ac[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x222e14,null))['then'](function(_0x28a221){if(_0x28a221){_0x3ce7d0=_0x28a221;_0x34bb09[_0xa1fb('0x38')]=_[_0xa1fb('0x4e')](db[_0xa1fb('0x9c')][_0xa1fb('0x36')]);_0x34bb09[_0xa1fb('0x39')]=_[_0xa1fb('0x4e')](_0x4466ac[_0xa1fb('0x39')]);_0x34bb09[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x34bb09[_0xa1fb('0x38')],_0x34bb09[_0xa1fb('0x39')]);_0x1a1b5b['attributes']=_[_0xa1fb('0x3b')](_0x34bb09[_0xa1fb('0x38')],qs[_0xa1fb('0x3c')](_0x4466ac['query']['fields']));_0x1a1b5b[_0xa1fb('0x3a')]=_0x1a1b5b[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x1a1b5b[_0xa1fb('0x3a')]:_0x34bb09[_0xa1fb('0x38')];_0x1a1b5b['order']=qs['sort'](_0x4466ac['query'][_0xa1fb('0x42')]);_0x1a1b5b[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_[_0xa1fb('0x5f')](_0x4466ac['query'],_0x34bb09['filters']));if(_0x4466ac[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x1a1b5b[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x1a1b5b[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x1a1b5b['attributes'],function(_0x5a7129){var _0x447234={};_0x447234[_0x5a7129]={'$like':'%'+_0x4466ac[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x447234;})});}_0x1a1b5b=_[_0xa1fb('0x45')]({},_0x1a1b5b,_0x4466ac[_0xa1fb('0x47')]);return _0x3ce7d0[_0xa1fb('0x9b')](_0x1a1b5b);}})[_0xa1fb('0x24')](function(_0x40fa36){if(_0x40fa36){_0xd42541=_0x40fa36[_0xa1fb('0x3d')];if(!_0x4466ac[_0xa1fb('0x39')][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x1a1b5b[_0xa1fb('0x40')]=qs[_0xa1fb('0x40')](_0x4466ac[_0xa1fb('0x39')]['limit']);_0x1a1b5b[_0xa1fb('0x1e')]=qs['offset'](_0x4466ac[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}return _0x3ce7d0['getLists'](_0x1a1b5b);}})[_0xa1fb('0x24')](function(_0x3d2a25){if(_0x3d2a25){return _0x3d2a25?{'count':_0xd42541,'rows':_0x3d2a25}:null;}})[_0xa1fb('0x24')](respondWithResult(_0x222e14,null))[_0xa1fb('0x4b')](handleError(_0x222e14,null));};exports[_0xa1fb('0x9d')]=function(_0x150b11,_0x1329d8,_0x2c6e45){var _0x4cb878,_0xd73e9d;return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x150b11[_0xa1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1329d8,null))[_0xa1fb('0x24')](function(_0x9b067){if(_0x9b067){_0xd73e9d=_0x9b067;return _0x9b067['addLists'](_0x150b11['body'][_0xa1fb('0x80')],_[_0xa1fb('0x5b')](_0x150b11[_0xa1fb('0x5c')],[_0xa1fb('0x80'),'id'])||{});}return null;})[_0xa1fb('0x94')](function(_0x45ba0e){var _0x56aa1c;_0x4cb878=_0x45ba0e||[];var _0x3d867d=[];if(_0x45ba0e){for(var _0x2d0eed=0x0;_0x2d0eed<_0x45ba0e['length'];_0x2d0eed+=0x1){var _0x5aeb85=_0x45ba0e[_0x2d0eed][_0xa1fb('0x26')]({'plain':!![]});_0xd73e9d[_0xa1fb('0x9e')]=_0x150b11[_0xa1fb('0x5c')][_0xa1fb('0x9e')]?_0x150b11[_0xa1fb('0x5c')][_0xa1fb('0x9e')]:_0xd73e9d['dialCheckDuplicateType'];switch(_0xd73e9d[_0xa1fb('0x9e')]){case'always':_0x56aa1c=squel[_0xa1fb('0x9f')]()['into'](_0xa1fb('0xa0'))[_0xa1fb('0xa1')](['phone',_0xa1fb('0xa2'),_0xa1fb('0xa3'),_0xa1fb('0xa4'),_0xa1fb('0x60'),_0xa1fb('0x59'),_0xa1fb('0x5a')],squel[_0xa1fb('0x81')]()['field'](_0xa1fb('0xa5'),'phone')[_0xa1fb('0x82')](_0xa1fb('0xa6'),'scheduledAt')[_0xa1fb('0x82')]('id',_0xa1fb('0xa3'))[_0xa1fb('0x82')](_0x5aeb85[_0xa1fb('0xa7')][_0xa1fb('0x8a')](),_0xa1fb('0xa4'))[_0xa1fb('0x82')](_0x150b11[_0xa1fb('0x4d')]['id'][_0xa1fb('0x8a')](),_0xa1fb('0x60'))[_0xa1fb('0x82')](_0xa1fb('0xa6'),_0xa1fb('0x59'))['field']('NOW()',_0xa1fb('0x5a'))[_0xa1fb('0x84')](_0xa1fb('0xa8'))[_0xa1fb('0x43')](_0xa1fb('0xa9'))['where'](_0xa1fb('0xaa'),_0x5aeb85[_0xa1fb('0xa7')][_0xa1fb('0x8a')]())[_0xa1fb('0x43')](_0xa1fb('0xab'))[_0xa1fb('0x43')](_0xa1fb('0xac'),squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')]('COALESCE(calleridnum,\x27\x27)')[_0xa1fb('0x84')](_0xa1fb('0xad'))[_0xa1fb('0x43')](_0xa1fb('0xae'),_0x150b11[_0xa1fb('0x4d')]['id'][_0xa1fb('0x8a')]()))[_0xa1fb('0x43')](_0xa1fb('0xac'),squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')]('COALESCE(phone,\x27\x27)')[_0xa1fb('0x84')]('cm_hopper')[_0xa1fb('0x43')](_0xa1fb('0xae'),_0x150b11[_0xa1fb('0x4d')]['id'][_0xa1fb('0x8a')]())))[_0xa1fb('0x8a')]();break;case _0xa1fb('0xaf'):_0x56aa1c=squel[_0xa1fb('0x9f')]()['into']('cm_hopper')[_0xa1fb('0xa1')]([_0xa1fb('0xa5'),_0xa1fb('0xa2'),_0xa1fb('0xa3'),_0xa1fb('0xa4'),_0xa1fb('0x60'),'createdAt','updatedAt'],squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')]('phone',_0xa1fb('0xa5'))[_0xa1fb('0x82')](_0xa1fb('0xa6'),_0xa1fb('0xa2'))[_0xa1fb('0x82')]('id',_0xa1fb('0xa3'))['field'](_0x5aeb85[_0xa1fb('0xa7')]['toString'](),'ListId')[_0xa1fb('0x82')](_0x150b11[_0xa1fb('0x4d')]['id'][_0xa1fb('0x8a')](),_0xa1fb('0x60'))['field'](_0xa1fb('0xa6'),_0xa1fb('0x59'))[_0xa1fb('0x82')](_0xa1fb('0xa6'),_0xa1fb('0x5a'))['from']('cm_contacts')[_0xa1fb('0x43')](_0xa1fb('0xa9'))[_0xa1fb('0x43')](_0xa1fb('0xaa'),_0x5aeb85[_0xa1fb('0xa7')][_0xa1fb('0x8a')]())[_0xa1fb('0x43')](_0xa1fb('0xab'))[_0xa1fb('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')](_0xa1fb('0xb0'))[_0xa1fb('0x84')]('cm_hopper')[_0xa1fb('0x43')](_0xa1fb('0xae'),_0x150b11[_0xa1fb('0x4d')]['id'][_0xa1fb('0x8a')]())))[_0xa1fb('0x8a')]();break;default:_0x56aa1c=squel[_0xa1fb('0x9f')]()[_0xa1fb('0xb1')](_0xa1fb('0xa0'))[_0xa1fb('0xa1')]([_0xa1fb('0xa5'),_0xa1fb('0xa2'),_0xa1fb('0xa3'),_0xa1fb('0xa4'),_0xa1fb('0x60'),_0xa1fb('0x59'),_0xa1fb('0x5a')],squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')](_0xa1fb('0xa5'),_0xa1fb('0xa5'))['field'](_0xa1fb('0xa6'),_0xa1fb('0xa2'))[_0xa1fb('0x82')]('id',_0xa1fb('0xa3'))[_0xa1fb('0x82')](_0x5aeb85[_0xa1fb('0xa7')]['toString'](),'ListId')[_0xa1fb('0x82')](_0x150b11['params']['id'][_0xa1fb('0x8a')](),_0xa1fb('0x60'))[_0xa1fb('0x82')]('NOW()','createdAt')[_0xa1fb('0x82')](_0xa1fb('0xa6'),'updatedAt')['from'](_0xa1fb('0xa8'))['where'](_0xa1fb('0xa9'))[_0xa1fb('0x43')](_0xa1fb('0xaa'),_0x5aeb85['CmListId'][_0xa1fb('0x8a')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3d867d[_0xa1fb('0x96')](db[_0xa1fb('0x74')][_0xa1fb('0x39')](_0x56aa1c));}return BPromise[_0xa1fb('0x8f')](_0x3d867d);}})[_0xa1fb('0x24')](function(){return _0x4cb878;})[_0xa1fb('0x24')](respondWithResult(_0x1329d8,null))[_0xa1fb('0x4b')](handleError(_0x1329d8,null));};exports[_0xa1fb('0xb2')]=function(_0x145478,_0x1dc607,_0x5e9d10){return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x145478['params']['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x1dc607,null))[_0xa1fb('0x24')](function(_0x39dc3c){if(_0x39dc3c){return _0x39dc3c[_0xa1fb('0xb2')](_0x145478[_0xa1fb('0x39')]['ids']);}})[_0xa1fb('0x24')](function(_0x36f039){if(_0x36f039){return db[_0xa1fb('0x61')][_0xa1fb('0x25')]({'where':{'ListId':_0x145478[_0xa1fb('0x39')][_0xa1fb('0x80')],'VoiceQueueId':_0x145478[_0xa1fb('0x4d')]['id']}})['then'](function(){return _0x36f039;});}})[_0xa1fb('0x24')](respondWithStatusCode(_0x1dc607,null))['catch'](handleError(_0x1dc607,null));};exports[_0xa1fb('0xb3')]=function(_0x41ea5d,_0x5e41f3,_0x398e9a){var _0x41e9ac={};var _0x4b7956={};var _0xd9e365;var _0x45064f;return db['VoiceQueue'][_0xa1fb('0x5e')]({'where':{'id':_0x41ea5d[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x5e41f3,null))[_0xa1fb('0x24')](function(_0x219f74){if(_0x219f74){_0xd9e365=_0x219f74;_0x4b7956[_0xa1fb('0x38')]=_['keys'](db[_0xa1fb('0x9c')]['rawAttributes']);_0x4b7956['query']=_[_0xa1fb('0x4e')](_0x41ea5d[_0xa1fb('0x39')]);_0x4b7956[_0xa1fb('0x44')]=_[_0xa1fb('0x3b')](_0x4b7956[_0xa1fb('0x38')],_0x4b7956[_0xa1fb('0x39')]);_0x41e9ac[_0xa1fb('0x3a')]=_['intersection'](_0x4b7956[_0xa1fb('0x38')],qs['fields'](_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x3c')]));_0x41e9ac['attributes']=_0x41e9ac[_0xa1fb('0x3a')][_0xa1fb('0x3d')]?_0x41e9ac[_0xa1fb('0x3a')]:_0x4b7956[_0xa1fb('0x38')];_0x41e9ac[_0xa1fb('0x41')]=qs[_0xa1fb('0x42')](_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x42')]);_0x41e9ac[_0xa1fb('0x43')]=qs[_0xa1fb('0x44')](_['pick'](_0x41ea5d[_0xa1fb('0x39')],_0x4b7956[_0xa1fb('0x44')]));if(_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x46')]){_0x41e9ac[_0xa1fb('0x43')]=_[_0xa1fb('0x45')](_0x41e9ac[_0xa1fb('0x43')],{'$or':_[_0xa1fb('0x2b')](_0x41e9ac[_0xa1fb('0x3a')],function(_0x64f375){var _0x48404f={};_0x48404f[_0x64f375]={'$like':'%'+_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x46')]+'%'};return _0x48404f;})});}_0x41e9ac=_[_0xa1fb('0x45')]({},_0x41e9ac,_0x41ea5d[_0xa1fb('0x47')]);return _0xd9e365[_0xa1fb('0xb3')](_0x41e9ac);}})[_0xa1fb('0x24')](function(_0xf64728){if(_0xf64728){_0x45064f=_0xf64728['length'];if(!_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x3e')](_0xa1fb('0x3f'))){_0x41e9ac[_0xa1fb('0x40')]=qs['limit'](_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x40')]);_0x41e9ac['offset']=qs[_0xa1fb('0x1e')](_0x41ea5d[_0xa1fb('0x39')][_0xa1fb('0x1e')]);}return _0xd9e365[_0xa1fb('0xb3')](_0x41e9ac);}})['then'](function(_0x39642d){if(_0x39642d){return _0x39642d?{'count':_0x45064f,'rows':_0x39642d}:null;}})['then'](respondWithResult(_0x5e41f3,null))[_0xa1fb('0x4b')](handleError(_0x5e41f3,null));};exports['addBlackLists']=function(_0x49a1f7,_0x26c412,_0x233e49){var _0x58fef6,_0x55ee6f;return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x49a1f7[_0xa1fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x26c412,null))[_0xa1fb('0x24')](function(_0x123646){if(_0x123646){_0x55ee6f=_0x123646;return _0x123646[_0xa1fb('0xb4')](_0x49a1f7[_0xa1fb('0x5c')]['ids'],_['omit'](_0x49a1f7[_0xa1fb('0x5c')],[_0xa1fb('0x80'),'id'])||{});}return null;})[_0xa1fb('0x94')](function(_0x286ac6){var _0x35cde8;_0x58fef6=_0x286ac6||[];var _0x17430f=[];if(_0x286ac6){for(var _0x3dcb1b=0x0;_0x3dcb1b<_0x286ac6['length'];_0x3dcb1b+=0x1){var _0x45ebb5=_0x286ac6[_0x3dcb1b]['get']({'plain':!![]});_0x35cde8=squel[_0xa1fb('0x9f')]()[_0xa1fb('0xb1')](_0xa1fb('0xb5'))[_0xa1fb('0xa1')]([_0xa1fb('0xa5'),_0xa1fb('0xa3'),_0xa1fb('0xa4'),_0xa1fb('0x60'),'createdAt','updatedAt'],squel[_0xa1fb('0x81')]()[_0xa1fb('0x82')]('phone','phone')[_0xa1fb('0x82')]('id',_0xa1fb('0xa3'))[_0xa1fb('0x82')](_0x45ebb5['CmListId']['toString'](),'ListId')[_0xa1fb('0x82')](_0x49a1f7[_0xa1fb('0x4d')]['id']['toString'](),_0xa1fb('0x60'))[_0xa1fb('0x82')](_0xa1fb('0xa6'),_0xa1fb('0x59'))[_0xa1fb('0x82')](_0xa1fb('0xa6'),_0xa1fb('0x5a'))['from'](_0xa1fb('0xa8'))[_0xa1fb('0x43')](_0xa1fb('0xa9'))[_0xa1fb('0x43')](_0xa1fb('0xaa'),_0x45ebb5['CmListId'][_0xa1fb('0x8a')]())[_0xa1fb('0x43')](_0xa1fb('0xab')))['toString']();_0x17430f['push'](db[_0xa1fb('0x74')]['query'](_0x35cde8));}return BPromise[_0xa1fb('0x8f')](_0x17430f);}})['then'](function(){return _0x58fef6;})[_0xa1fb('0x24')](respondWithResult(_0x26c412,null))[_0xa1fb('0x4b')](handleError(_0x26c412,null));};exports[_0xa1fb('0xb6')]=function(_0x2be86,_0x255295,_0x12b1f1){return db[_0xa1fb('0x35')][_0xa1fb('0x2f')]({'where':{'id':_0x2be86[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](handleEntityNotFound(_0x255295,null))['then'](function(_0x55f686){if(_0x55f686){return _0x55f686[_0xa1fb('0xb6')](_0x2be86[_0xa1fb('0x39')]['ids']);}})['then'](function(_0x1c252c){if(_0x1c252c){return db[_0xa1fb('0x67')][_0xa1fb('0x25')]({'where':{'ListId':_0x2be86[_0xa1fb('0x39')]['ids'],'VoiceQueueId':_0x2be86[_0xa1fb('0x4d')]['id']}})[_0xa1fb('0x24')](function(){return _0x1c252c;});}})['then'](respondWithStatusCode(_0x255295,null))[_0xa1fb('0x4b')](handleError(_0x255295,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a87c9ec..8f28f08 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 _0x6af0=['VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x12ebfe,_0x4a71c4){var _0x15d2d2=function(_0x4c62f4){while(--_0x4c62f4){_0x12ebfe['push'](_0x12ebfe['shift']());}};_0x15d2d2(++_0x4a71c4);}(_0x6af0,0x154));var _0x06af=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6af0[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x06af('0x0'));var VoiceQueue=require(_0x06af('0x1'))['db'][_0x06af('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x06af('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x06af('0x4'),'afterDestroy':_0x06af('0x5')};function emitEvent(_0x1987b9){return function(_0x402e10,_0x23d97e,_0x4cec44){VoiceQueueEvents[_0x06af('0x6')](_0x1987b9+':'+_0x402e10['id'],_0x402e10);VoiceQueueEvents['emit'](_0x1987b9,_0x402e10);_0x4cec44(null);};}for(var e in events){if(events[_0x06af('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x06af('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x2c27=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2c27,0xce));var _0x72c2=function(_0x1a4160,_0x3ed261){_0x1a4160=_0x1a4160-0x0;var _0x3915d2=_0x2c27[_0x1a4160];return _0x3915d2;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x72c2('0x0'))['db'][_0x72c2('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x72c2('0x2')](0x0);var events={'afterCreate':_0x72c2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x190e8d){return function(_0x598b5f,_0x11568c,_0x20eeb6){VoiceQueueEvents['emit'](_0x190e8d+':'+_0x598b5f['id'],_0x598b5f);VoiceQueueEvents[_0x72c2('0x4')](_0x190e8d,_0x598b5f);_0x20eeb6(null);};}for(var e in events){if(events[_0x72c2('0x5')](e)){var event=events[e];VoiceQueue[_0x72c2('0x6')](e,emitEvent(event));}}module[_0x72c2('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index f79b242..fbca019 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0x3e74,0x175));var _0x43e7=function(_0x1988df,_0x39ee1f){_0x1988df=_0x1988df-0x0;var _0x376164=_0x3e74[_0x1988df];return _0x376164;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x4d31c0,_0x4bf043){var _0x52439b=function(_0x1b54df){while(--_0x1b54df){_0x4d31c0['push'](_0x4d31c0['shift']());}};_0x52439b(++_0x4bf043);}(_0x70e0,0x17b));var _0x070e=function(_0x2836d4,_0x38742d){_0x2836d4=_0x2836d4-0x0;var _0x158e07=_0x70e0[_0x2836d4];return _0x158e07;};'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']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 28a33a5..57e18eb 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 _0xc4f9=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceQueue','stringify','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0xc4f9,0x19c));var _0x9c4f=function(_0x23eef7,_0x23590e){_0x23eef7=_0x23eef7-0x0;var _0x11536e=_0xc4f9[_0x23eef7];return _0x11536e;};'use strict';var _=require(_0x9c4f('0x0'));var util=require(_0x9c4f('0x1'));var moment=require(_0x9c4f('0x2'));var BPromise=require(_0x9c4f('0x3'));var rs=require(_0x9c4f('0x4'));var fs=require('fs');var Redis=require(_0x9c4f('0x5'));var db=require(_0x9c4f('0x6'))['db'];var utils=require(_0x9c4f('0x7'));var logger=require(_0x9c4f('0x8'))('rpc');var config=require(_0x9c4f('0x9'));var jayson=require(_0x9c4f('0xa'));var client=jayson[_0x9c4f('0xb')][_0x9c4f('0xc')]({'port':0x232a});config[_0x9c4f('0xd')]=_[_0x9c4f('0xe')](config[_0x9c4f('0xd')],{'host':_0x9c4f('0xf'),'port':0x18eb});var socket=require(_0x9c4f('0x10'))(new Redis(config[_0x9c4f('0xd')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2390b7,_0x3d5839,_0x53699a){return new BPromise(function(_0x30112c,_0x164bfa){return client[_0x9c4f('0x11')](_0x2390b7,_0x53699a)[_0x9c4f('0x12')](function(_0x335d4c){logger[_0x9c4f('0x13')](_0x9c4f('0x14'),_0x3d5839,_0x9c4f('0x15'));logger[_0x9c4f('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3d5839,_0x9c4f('0x15'),JSON['stringify'](_0x335d4c));if(_0x335d4c['error']){if(_0x335d4c[_0x9c4f('0x17')][_0x9c4f('0x18')]===0x1f4){logger[_0x9c4f('0x17')](_0x9c4f('0x14'),_0x3d5839,_0x335d4c[_0x9c4f('0x17')][_0x9c4f('0x19')]);return _0x164bfa(_0x335d4c['error'][_0x9c4f('0x19')]);}logger[_0x9c4f('0x17')](_0x9c4f('0x14'),_0x3d5839,_0x335d4c[_0x9c4f('0x17')][_0x9c4f('0x19')]);return _0x30112c(_0x335d4c[_0x9c4f('0x17')]['message']);}else{logger[_0x9c4f('0x13')](_0x9c4f('0x14'),_0x3d5839,_0x9c4f('0x15'));_0x30112c(_0x335d4c[_0x9c4f('0x1a')][_0x9c4f('0x19')]);}})[_0x9c4f('0x1b')](function(_0x557ecd){logger[_0x9c4f('0x17')](_0x9c4f('0x14'),_0x3d5839,_0x557ecd);_0x164bfa(_0x557ecd);});});}exports['GetVoiceQueue']=function(_0x54321f){var _0x3d29d9=this;return new Promise(function(_0x45af70,_0x5e5294){return db['VoiceQueue'][_0x9c4f('0x1c')]({'raw':_0x54321f[_0x9c4f('0x1d')]?_0x54321f[_0x9c4f('0x1d')][_0x9c4f('0x1e')]===undefined?!![]:![]:!![],'where':_0x54321f[_0x9c4f('0x1d')]?_0x54321f[_0x9c4f('0x1d')][_0x9c4f('0x1f')]||null:null,'attributes':_0x54321f[_0x9c4f('0x1d')]?_0x54321f[_0x9c4f('0x1d')][_0x9c4f('0x20')]||null:null,'limit':_0x54321f['options']?_0x54321f['options'][_0x9c4f('0x21')]||null:null,'include':_0x54321f['options']?_0x54321f[_0x9c4f('0x1d')]['include']?_[_0x9c4f('0x22')](_0x54321f[_0x9c4f('0x1d')][_0x9c4f('0x23')],function(_0x511b91){return{'model':db[_0x511b91['model']],'as':_0x511b91['as'],'attributes':_0x511b91[_0x9c4f('0x20')],'include':_0x511b91[_0x9c4f('0x23')]?_[_0x9c4f('0x22')](_0x511b91['include'],function(_0x18790d){return{'model':db[_0x18790d[_0x9c4f('0x24')]],'as':_0x18790d['as'],'attributes':_0x18790d[_0x9c4f('0x20')],'include':_0x18790d[_0x9c4f('0x23')]?_['map'](_0x18790d[_0x9c4f('0x23')],function(_0xad46c){return{'model':db[_0xad46c['model']],'as':_0xad46c['as'],'attributes':_0xad46c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a92fe){logger[_0x9c4f('0x13')](_0x9c4f('0x25'),_0x54321f);logger['debug'](_0x9c4f('0x25'),_0x54321f,JSON[_0x9c4f('0x26')](_0x1a92fe));_0x45af70(_0x1a92fe);})[_0x9c4f('0x1b')](function(_0x1f41a3){logger[_0x9c4f('0x17')](_0x9c4f('0x25'),_0x1f41a3[_0x9c4f('0x19')],_0x54321f);_0x5e5294(_0x3d29d9['error'](0x1f4,_0x1f41a3[_0x9c4f('0x19')]));});});};exports[_0x9c4f('0x27')]=function(_0xc31982){var _0x2e2879=this;return new Promise(function(_0x5b4aec,_0x372629){return db[_0x9c4f('0x28')][_0x9c4f('0x29')]({'raw':_0xc31982[_0x9c4f('0x1d')]?_0xc31982[_0x9c4f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xc31982[_0x9c4f('0x1d')]?_0xc31982[_0x9c4f('0x1d')]['where']||null:null,'attributes':_0xc31982[_0x9c4f('0x1d')]?_0xc31982['options'][_0x9c4f('0x20')]||null:null,'include':_0xc31982[_0x9c4f('0x1d')]?_0xc31982['options'][_0x9c4f('0x23')]?_['map'](_0xc31982['options'][_0x9c4f('0x23')],function(_0x17a22f){return{'model':db[_0x17a22f[_0x9c4f('0x24')]],'as':_0x17a22f['as'],'attributes':_0x17a22f['attributes'],'include':_0x17a22f[_0x9c4f('0x23')]?_[_0x9c4f('0x22')](_0x17a22f[_0x9c4f('0x23')],function(_0x3f89f2){return{'model':db[_0x3f89f2['model']],'as':_0x3f89f2['as'],'attributes':_0x3f89f2[_0x9c4f('0x20')],'include':_0x3f89f2['include']?_[_0x9c4f('0x22')](_0x3f89f2['include'],function(_0x2d2a15){return{'model':db[_0x2d2a15[_0x9c4f('0x24')]],'as':_0x2d2a15['as'],'attributes':_0x2d2a15[_0x9c4f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x359cbd){logger[_0x9c4f('0x13')](_0x9c4f('0x27'),_0xc31982);logger['debug'](_0x9c4f('0x27'),_0xc31982,JSON[_0x9c4f('0x26')](_0x359cbd));_0x5b4aec(_0x359cbd);})[_0x9c4f('0x1b')](function(_0x83fead){logger[_0x9c4f('0x17')](_0x9c4f('0x27'),_0x83fead[_0x9c4f('0x19')],_0xc31982);_0x372629(_0x2e2879[_0x9c4f('0x17')](0x1f4,_0x83fead[_0x9c4f('0x19')]));});});}; \ No newline at end of file +var _0x0329=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','then','info','ShowVoiceQueue','lodash','util','moment'];(function(_0x49bd65,_0x4285dc){var _0x4f08b0=function(_0x4fc9a1){while(--_0x4fc9a1){_0x49bd65['push'](_0x49bd65['shift']());}};_0x4f08b0(++_0x4285dc);}(_0x0329,0x81));var _0x9032=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x0329[_0x4697fa];return _0x390950;};'use strict';var _=require(_0x9032('0x0'));var util=require(_0x9032('0x1'));var moment=require(_0x9032('0x2'));var BPromise=require(_0x9032('0x3'));var rs=require(_0x9032('0x4'));var fs=require('fs');var Redis=require(_0x9032('0x5'));var db=require(_0x9032('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9032('0x7'))(_0x9032('0x8'));var config=require('../../config/environment');var jayson=require(_0x9032('0x9'));var client=jayson[_0x9032('0xa')][_0x9032('0xb')]({'port':0x232a});config['redis']=_[_0x9032('0xc')](config[_0x9032('0xd')],{'host':_0x9032('0xe'),'port':0x18eb});var socket=require(_0x9032('0xf'))(new Redis(config[_0x9032('0xd')]));require(_0x9032('0x10'))[_0x9032('0x11')](socket);function respondWithRpcPromise(_0x461c45,_0x5f1716,_0x149796){return new BPromise(function(_0x55e229,_0x226bbb){return client[_0x9032('0x12')](_0x461c45,_0x149796)['then'](function(_0x4fb569){logger['info'](_0x9032('0x13'),_0x5f1716,'request\x20sent');logger[_0x9032('0x14')](_0x9032('0x15'),_0x5f1716,_0x9032('0x16'),JSON[_0x9032('0x17')](_0x4fb569));if(_0x4fb569[_0x9032('0x18')]){if(_0x4fb569[_0x9032('0x18')][_0x9032('0x19')]===0x1f4){logger[_0x9032('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x5f1716,_0x4fb569[_0x9032('0x18')][_0x9032('0x1a')]);return _0x226bbb(_0x4fb569[_0x9032('0x18')][_0x9032('0x1a')]);}logger[_0x9032('0x18')](_0x9032('0x13'),_0x5f1716,_0x4fb569[_0x9032('0x18')][_0x9032('0x1a')]);return _0x55e229(_0x4fb569[_0x9032('0x18')][_0x9032('0x1a')]);}else{logger['info'](_0x9032('0x13'),_0x5f1716,_0x9032('0x16'));_0x55e229(_0x4fb569[_0x9032('0x1b')][_0x9032('0x1a')]);}})[_0x9032('0x1c')](function(_0xf9d8c9){logger[_0x9032('0x18')](_0x9032('0x13'),_0x5f1716,_0xf9d8c9);_0x226bbb(_0xf9d8c9);});});}exports[_0x9032('0x1d')]=function(_0x5e4c78){var _0x113e99=this;return new Promise(function(_0x242ddf,_0x3a63b8){return db[_0x9032('0x1e')][_0x9032('0x1f')]({'raw':_0x5e4c78[_0x9032('0x20')]?_0x5e4c78[_0x9032('0x20')][_0x9032('0x21')]===undefined?!![]:![]:!![],'where':_0x5e4c78[_0x9032('0x20')]?_0x5e4c78[_0x9032('0x20')]['where']||null:null,'attributes':_0x5e4c78[_0x9032('0x20')]?_0x5e4c78[_0x9032('0x20')][_0x9032('0x22')]||null:null,'limit':_0x5e4c78[_0x9032('0x20')]?_0x5e4c78['options'][_0x9032('0x23')]||null:null,'include':_0x5e4c78['options']?_0x5e4c78[_0x9032('0x20')][_0x9032('0x24')]?_[_0x9032('0x25')](_0x5e4c78[_0x9032('0x20')][_0x9032('0x24')],function(_0x28b2e4){return{'model':db[_0x28b2e4['model']],'as':_0x28b2e4['as'],'attributes':_0x28b2e4[_0x9032('0x22')],'include':_0x28b2e4[_0x9032('0x24')]?_[_0x9032('0x25')](_0x28b2e4[_0x9032('0x24')],function(_0x248fff){return{'model':db[_0x248fff[_0x9032('0x26')]],'as':_0x248fff['as'],'attributes':_0x248fff['attributes'],'include':_0x248fff[_0x9032('0x24')]?_[_0x9032('0x25')](_0x248fff[_0x9032('0x24')],function(_0x190fae){return{'model':db[_0x190fae[_0x9032('0x26')]],'as':_0x190fae['as'],'attributes':_0x190fae[_0x9032('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e4c13){logger['info'](_0x9032('0x1d'),_0x5e4c78);logger[_0x9032('0x14')](_0x9032('0x1d'),_0x5e4c78,JSON[_0x9032('0x17')](_0x2e4c13));_0x242ddf(_0x2e4c13);})[_0x9032('0x1c')](function(_0x7b48d1){logger['error'](_0x9032('0x1d'),_0x7b48d1[_0x9032('0x1a')],_0x5e4c78);_0x3a63b8(_0x113e99['error'](0x1f4,_0x7b48d1['message']));});});};exports['ShowVoiceQueue']=function(_0x4c3863){var _0x5d8603=this;return new Promise(function(_0xc1e089,_0x38fb4b){return db['VoiceQueue'][_0x9032('0x27')]({'raw':_0x4c3863['options']?_0x4c3863[_0x9032('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4c3863[_0x9032('0x20')]?_0x4c3863[_0x9032('0x20')][_0x9032('0x28')]||null:null,'attributes':_0x4c3863['options']?_0x4c3863[_0x9032('0x20')][_0x9032('0x22')]||null:null,'include':_0x4c3863[_0x9032('0x20')]?_0x4c3863[_0x9032('0x20')]['include']?_[_0x9032('0x25')](_0x4c3863[_0x9032('0x20')]['include'],function(_0x3c3cb4){return{'model':db[_0x3c3cb4[_0x9032('0x26')]],'as':_0x3c3cb4['as'],'attributes':_0x3c3cb4[_0x9032('0x22')],'include':_0x3c3cb4[_0x9032('0x24')]?_[_0x9032('0x25')](_0x3c3cb4[_0x9032('0x24')],function(_0xbc45ed){return{'model':db[_0xbc45ed[_0x9032('0x26')]],'as':_0xbc45ed['as'],'attributes':_0xbc45ed[_0x9032('0x22')],'include':_0xbc45ed[_0x9032('0x24')]?_[_0x9032('0x25')](_0xbc45ed[_0x9032('0x24')],function(_0x242306){return{'model':db[_0x242306['model']],'as':_0x242306['as'],'attributes':_0x242306['attributes']};}):[]};}):[]};}):[]:[]})[_0x9032('0x29')](function(_0x2ef6ff){logger[_0x9032('0x2a')]('ShowVoiceQueue',_0x4c3863);logger[_0x9032('0x14')](_0x9032('0x2b'),_0x4c3863,JSON[_0x9032('0x17')](_0x2ef6ff));_0xc1e089(_0x2ef6ff);})[_0x9032('0x1c')](function(_0x49d53f){logger[_0x9032('0x18')](_0x9032('0x2b'),_0x49d53f[_0x9032('0x1a')],_0x4c3863);_0x38fb4b(_0x5d8603['error'](0x1f4,_0x49d53f[_0x9032('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2320a35..9ec489c 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 _0x64d0=['update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x42a14d,_0xf9447c){var _0x4abece=function(_0x3b62a1){while(--_0x3b62a1){_0x42a14d['push'](_0x42a14d['shift']());}};_0x4abece(++_0xf9447c);}(_0x64d0,0x1eb));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x064d('0x0'));var events=['save','remove',_0x064d('0x1')];function createListener(_0x3fda4b,_0x256f23){return function(_0x57385b){_0x256f23[_0x064d('0x2')](_0x3fda4b,_0x57385b);};}function removeListener(_0x1f695f,_0x5c14c3){return function(){VoiceQueueEvents[_0x064d('0x3')](_0x1f695f,_0x5c14c3);};}exports[_0x064d('0x4')]=function(_0x467e5d){for(var _0x5ce0fe=0x0,_0x3cd676=events['length'];_0x5ce0fe<_0x3cd676;_0x5ce0fe++){var _0x4366d7=events[_0x5ce0fe];var _0x204f81=createListener(_0x064d('0x5')+_0x4366d7,_0x467e5d);VoiceQueueEvents['on'](_0x4366d7,_0x204f81);}}; \ No newline at end of file +var _0x9d96=['./voiceQueue.events','update','emit','removeListener','length'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x9d96,0xff));var _0x69d9=function(_0xc4483f,_0x160f2e){_0xc4483f=_0xc4483f-0x0;var _0xf791d4=_0x9d96[_0xc4483f];return _0xf791d4;};'use strict';var VoiceQueueEvents=require(_0x69d9('0x0'));var events=['save','remove',_0x69d9('0x1')];function createListener(_0x114fac,_0x508cd1){return function(_0x5698ec){_0x508cd1[_0x69d9('0x2')](_0x114fac,_0x5698ec);};}function removeListener(_0x5b7fe6,_0x103369){return function(){VoiceQueueEvents[_0x69d9('0x3')](_0x5b7fe6,_0x103369);};}exports['register']=function(_0x247e63){for(var _0x1d38d5=0x0,_0x2c637c=events[_0x69d9('0x4')];_0x1d38d5<_0x2c637c;_0x1d38d5++){var _0x59acbb=events[_0x1d38d5];var _0x25f951=createListener('voiceQueue:'+_0x59acbb,_0x247e63);VoiceQueueEvents['on'](_0x59acbb,_0x25f951);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b643ccc..bfbce27 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 _0xb9fa=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0x4c66a3,_0x1440f9){var _0x5c2980=function(_0x4dd15a){while(--_0x4dd15a){_0x4c66a3['push'](_0x4c66a3['shift']());}};_0x5c2980(++_0x1440f9);}(_0xb9fa,0x1bb));var _0xab9f=function(_0x3f3a90,_0x4d2d54){_0x3f3a90=_0x3f3a90-0x0;var _0x40f42d=_0xb9fa[_0x3f3a90];return _0x40f42d;};'use strict';var multer=require(_0xab9f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xab9f('0x1'));var express=require(_0xab9f('0x2'));var router=express[_0xab9f('0x3')]();var fs_extra=require(_0xab9f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab9f('0x5'));var controller=require(_0xab9f('0x6'));router[_0xab9f('0x7')]('/',auth[_0xab9f('0x8')](),controller['index']);router['get']('/describe',auth[_0xab9f('0x8')](),controller[_0xab9f('0x9')]);router[_0xab9f('0x7')](_0xab9f('0xa'),auth['isAuthenticated'](),controller[_0xab9f('0xb')]);router[_0xab9f('0x7')](_0xab9f('0xc'),auth['isAuthenticated'](),controller[_0xab9f('0xd')]);router[_0xab9f('0xe')]('/',auth[_0xab9f('0x8')](),controller[_0xab9f('0xf')]);router[_0xab9f('0x10')](_0xab9f('0xc'),auth['isAuthenticated'](),controller[_0xab9f('0x11')]);router[_0xab9f('0x12')](_0xab9f('0xc'),auth[_0xab9f('0x8')](),controller[_0xab9f('0x13')]);module[_0xab9f('0x14')]=router; \ No newline at end of file +var _0x401e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x159862,_0x545ba6){var _0x41a962=function(_0x32b900){while(--_0x32b900){_0x159862['push'](_0x159862['shift']());}};_0x41a962(++_0x545ba6);}(_0x401e,0x67));var _0xe401=function(_0x1ee86c,_0x43cbce){_0x1ee86c=_0x1ee86c-0x0;var _0x60e92e=_0x401e[_0x1ee86c];return _0x60e92e;};'use strict';var multer=require(_0xe401('0x0'));var util=require(_0xe401('0x1'));var path=require('path');var timeout=require(_0xe401('0x2'));var express=require('express');var router=express[_0xe401('0x3')]();var fs_extra=require(_0xe401('0x4'));var auth=require(_0xe401('0x5'));var interaction=require(_0xe401('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xe401('0x7')]('/',auth[_0xe401('0x8')](),controller[_0xe401('0x9')]);router[_0xe401('0x7')](_0xe401('0xa'),auth[_0xe401('0x8')](),controller[_0xe401('0xb')]);router[_0xe401('0x7')]('/index',auth[_0xe401('0x8')](),controller[_0xe401('0xc')]);router[_0xe401('0x7')](_0xe401('0xd'),auth[_0xe401('0x8')](),controller[_0xe401('0xe')]);router[_0xe401('0xf')]('/',auth['isAuthenticated'](),controller[_0xe401('0x10')]);router[_0xe401('0x11')](_0xe401('0xd'),auth[_0xe401('0x8')](),controller[_0xe401('0x12')]);router[_0xe401('0x13')](_0xe401('0xd'),auth[_0xe401('0x8')](),controller['destroy']);module[_0xe401('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 941e81a..413e564 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 _0x95fe=['moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x43192c,_0x23995a){var _0x1c11df=function(_0x1360c6){while(--_0x1360c6){_0x43192c['push'](_0x43192c['shift']());}};_0x1c11df(++_0x23995a);}(_0x95fe,0x149));var _0xe95f=function(_0x49e66,_0x43f4b9){_0x49e66=_0x49e66-0x0;var _0x545549=_0x95fe[_0x49e66];return _0x545549;};'use strict';var Sequelize=require(_0xe95f('0x0'));var moment=require(_0xe95f('0x1'));module['exports']={'type':{'type':Sequelize[_0xe95f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe95f('0x2')]},'calleridname':{'type':Sequelize[_0xe95f('0x2')]},'queue':{'type':Sequelize[_0xe95f('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe95f('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2900c7){var _0x39989f=moment(_0x2900c7);var _0x15cfc7=moment(this[_0xe95f('0x4')](_0xe95f('0x5')))[_0xe95f('0x6')](_0xe95f('0x7'));var _0x365e24=_0x39989f[_0xe95f('0x8')](_0x15cfc7,_0xe95f('0x9'));this[_0xe95f('0xa')]('queuecallerleaveAt',_0x2900c7);this[_0xe95f('0xa')]('holdtime',_0x365e24||null);}},'position':{'type':Sequelize[_0xe95f('0xb')]},'count':{'type':Sequelize[_0xe95f('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xe95f('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe95f('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe95f('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe95f('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xe95f('0x2')],'comment':_0xe95f('0xd')},'originalposition':{'type':Sequelize[_0xe95f('0xb')]},'channel':{'type':Sequelize[_0xe95f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe95f('0x2')]},'accountcode':{'type':Sequelize[_0xe95f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe95f('0x2')]},'holdtime':{'type':Sequelize[_0xe95f('0xb')]},'mohtime':{'type':Sequelize[_0xe95f('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe95f('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe95f('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe95f('0x2')],'comment':_0xe95f('0xe')},'transferexten':{'type':Sequelize[_0xe95f('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe95f('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe95f('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xe95f('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x382a=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','seconds'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x382a,0x1d8));var _0xa382=function(_0x31c68e,_0x5f0385){_0x31c68e=_0x31c68e-0x0;var _0x159e5d=_0x382a[_0x31c68e];return _0x159e5d;};'use strict';var Sequelize=require(_0xa382('0x0'));var moment=require(_0xa382('0x1'));module[_0xa382('0x2')]={'type':{'type':Sequelize[_0xa382('0x3')]},'uniqueid':{'type':Sequelize[_0xa382('0x3')]},'calleridnum':{'type':Sequelize[_0xa382('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa382('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xa382('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xa382('0x4')],'set':function(_0x39f097){var _0x379956=moment(_0x39f097);var _0x2f9a2f=moment(this['getDataValue'](_0xa382('0x5')))[_0xa382('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x33e736=_0x379956['diff'](_0x2f9a2f,_0xa382('0x7'));this[_0xa382('0x8')](_0xa382('0x9'),_0x39f097);this[_0xa382('0x8')](_0xa382('0xa'),_0x33e736||null);}},'position':{'type':Sequelize[_0xa382('0xb')]},'count':{'type':Sequelize[_0xa382('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xa382('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa382('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa382('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xa382('0xd')},'originalposition':{'type':Sequelize[_0xa382('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa382('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa382('0x3')]},'context':{'type':Sequelize[_0xa382('0x3')]},'exten':{'type':Sequelize[_0xa382('0x3')]},'priority':{'type':Sequelize[_0xa382('0x3')]},'holdtime':{'type':Sequelize[_0xa382('0xb')]},'mohtime':{'type':Sequelize[_0xa382('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa382('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa382('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xa382('0xe')},'transferexten':{'type':Sequelize[_0xa382('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa382('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa382('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d550b2b..d3ed439 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 _0x646b=['update','then','destroy','end','error','name','send','map','VoiceQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','describe','length','order','pick','getVoiceQueuesReport','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x41b8c3,_0x5b3bf4){var _0x1ce77c=function(_0x410784){while(--_0x410784){_0x41b8c3['push'](_0x41b8c3['shift']());}};_0x1ce77c(++_0x5b3bf4);}(_0x646b,0x1a9));var _0xb646=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x646b[_0x90f34f];return _0x4b18cf;};'use strict';var emlformat=require(_0xb646('0x0'));var rimraf=require(_0xb646('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb646('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb646('0x3'));var util=require(_0xb646('0x4'));var path=require(_0xb646('0x5'));var sox=require(_0xb646('0x6'));var csv=require(_0xb646('0x7'));var ejs=require(_0xb646('0x8'));var fs=require('fs');var fs_extra=require(_0xb646('0x9'));var _=require(_0xb646('0xa'));var squel=require(_0xb646('0xb'));var crypto=require(_0xb646('0xc'));var jsforce=require(_0xb646('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb646('0x7'));var querystring=require(_0xb646('0xe'));var Papa=require('papaparse');var Redis=require(_0xb646('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb646('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb646('0x11'));var logger=require('../../config/logger')(_0xb646('0x12'));var utils=require('../../config/utils');var config=require(_0xb646('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb646('0x14'))['db'];config[_0xb646('0x15')]=_['defaults'](config[_0xb646('0x15')],{'host':_0xb646('0x16'),'port':0x18eb});var socket=require(_0xb646('0x17'))(new Redis(config[_0xb646('0x15')]));require(_0xb646('0x18'))[_0xb646('0x19')](socket);function respondWithStatusCode(_0x35e08f,_0xd88f1e){_0xd88f1e=_0xd88f1e||0xcc;return function(_0x4ace7c){if(_0x4ace7c){return _0x35e08f['sendStatus'](_0xd88f1e);}return _0x35e08f['status'](_0xd88f1e)['end']();};}function respondWithResult(_0x42a125,_0x343ab1){_0x343ab1=_0x343ab1||0xc8;return function(_0x2fb15a){if(_0x2fb15a){return _0x42a125[_0xb646('0x1a')](_0x343ab1)[_0xb646('0x1b')](_0x2fb15a);}};}function respondWithFilteredResult(_0x4c93be,_0x232852){return function(_0x508356){if(_0x508356){var _0x3f7977=typeof _0x232852[_0xb646('0x1c')]===_0xb646('0x1d')&&typeof _0x232852[_0xb646('0x1e')]===_0xb646('0x1d');var _0x57e572=_0x508356['count'];var _0x4f58e1=_0x3f7977?0x0:_0x232852[_0xb646('0x1c')];var _0x2a80fd=_0x3f7977?_0x508356[_0xb646('0x1f')]:_0x232852[_0xb646('0x1c')]+_0x232852[_0xb646('0x1e')];var _0x26629a;if(_0x2a80fd>=_0x57e572){_0x2a80fd=_0x57e572;_0x26629a=0xc8;}else{_0x26629a=0xce;}_0x4c93be[_0xb646('0x1a')](_0x26629a);return _0x4c93be[_0xb646('0x20')](_0xb646('0x21'),_0x4f58e1+'-'+_0x2a80fd+'/'+_0x57e572)[_0xb646('0x1b')](_0x508356);}return null;};}function patchUpdates(_0x2b4c04){return function(_0x702bd6){try{jsonpatch[_0xb646('0x22')](_0x702bd6,_0x2b4c04,!![]);}catch(_0xa8f794){return BPromise[_0xb646('0x23')](_0xa8f794);}return _0x702bd6[_0xb646('0x24')]();};}function saveUpdates(_0x1345aa,_0x5f3b23){return function(_0x2a906f){if(_0x2a906f){return _0x2a906f[_0xb646('0x25')](_0x1345aa)[_0xb646('0x26')](function(_0x9a4ce7){return _0x9a4ce7;});}return null;};}function removeEntity(_0x2d2a0c,_0x35a9a1){return function(_0x289059){if(_0x289059){return _0x289059[_0xb646('0x27')]()[_0xb646('0x26')](function(){_0x2d2a0c[_0xb646('0x1a')](0xcc)[_0xb646('0x28')]();});}};}function handleEntityNotFound(_0x5e039e,_0x1c491b){return function(_0x41adc1){if(!_0x41adc1){_0x5e039e['sendStatus'](0x194);}return _0x41adc1;};}function handleError(_0x1b6cab,_0x517714){_0x517714=_0x517714||0x1f4;return function(_0x4e458a){logger[_0xb646('0x29')](_0x4e458a['stack']);if(_0x4e458a[_0xb646('0x2a')]){delete _0x4e458a[_0xb646('0x2a')];}_0x1b6cab[_0xb646('0x1a')](_0x517714)[_0xb646('0x2b')](_0x4e458a);};}exports['index']=function(_0x472d21,_0x26300d){var _0x2e7090={},_0x504f71={},_0x14f8fc={'count':0x0,'rows':[]};var _0x4e22d9=_[_0xb646('0x2c')](db[_0xb646('0x2d')][_0xb646('0x2e')],function(_0x1faf93){return{'name':_0x1faf93['fieldName'],'type':_0x1faf93[_0xb646('0x2f')][_0xb646('0x30')]};});_0x504f71['model']=_[_0xb646('0x2c')](_0x4e22d9,'name');_0x504f71[_0xb646('0x31')]=_[_0xb646('0x32')](_0x472d21[_0xb646('0x31')]);_0x504f71[_0xb646('0x33')]=_[_0xb646('0x34')](_0x504f71[_0xb646('0x35')],_0x504f71[_0xb646('0x31')]);_0x2e7090[_0xb646('0x36')]=_[_0xb646('0x34')](_0x504f71['model'],qs['fields'](_0x472d21['query']['fields']));_0x2e7090[_0xb646('0x36')]=_0x2e7090['attributes']['length']?_0x2e7090[_0xb646('0x36')]:_0x504f71[_0xb646('0x35')];if(!_0x472d21[_0xb646('0x31')][_0xb646('0x37')](_0xb646('0x38'))){_0x2e7090[_0xb646('0x1e')]=qs[_0xb646('0x1e')](_0x472d21[_0xb646('0x31')][_0xb646('0x1e')]);_0x2e7090[_0xb646('0x1c')]=qs[_0xb646('0x1c')](_0x472d21[_0xb646('0x31')][_0xb646('0x1c')]);}_0x2e7090['order']=qs[_0xb646('0x39')](_0x472d21[_0xb646('0x31')][_0xb646('0x39')]);_0x2e7090['where']=qs[_0xb646('0x33')](_['pick'](_0x472d21[_0xb646('0x31')],_0x504f71[_0xb646('0x33')]),_0x4e22d9);if(_0x472d21[_0xb646('0x31')]['filter']){_0x2e7090[_0xb646('0x3a')]=_[_0xb646('0x3b')](_0x2e7090[_0xb646('0x3a')],{'$or':_[_0xb646('0x2c')](_0x4e22d9,function(_0x2cf027){if(_0x2cf027[_0xb646('0x2f')]!=='VIRTUAL'){var _0x57b596={};_0x57b596[_0x2cf027[_0xb646('0x2a')]]={'$like':'%'+_0x472d21[_0xb646('0x31')][_0xb646('0x3c')]+'%'};return _0x57b596;}})});}_0x2e7090=_[_0xb646('0x3b')]({},_0x2e7090,_0x472d21[_0xb646('0x3d')]);var _0x183e2e={'where':_0x2e7090['where']};return db[_0xb646('0x2d')][_0xb646('0x1f')](_0x183e2e)[_0xb646('0x26')](function(_0x343ca6){_0x14f8fc[_0xb646('0x1f')]=_0x343ca6;if(_0x472d21[_0xb646('0x31')][_0xb646('0x3e')]){_0x2e7090[_0xb646('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xb646('0x40')](_0x2e7090);})['then'](function(_0x409e89){_0x14f8fc[_0xb646('0x41')]=_0x409e89;return _0x14f8fc;})[_0xb646('0x26')](respondWithFilteredResult(_0x26300d,_0x2e7090))[_0xb646('0x42')](handleError(_0x26300d,null));};exports['show']=function(_0x529327,_0x1f4a5b){var _0x4cab39={'raw':![],'where':{'id':_0x529327[_0xb646('0x43')]['id']}},_0x212f6d={};_0x212f6d['model']=_['keys'](db[_0xb646('0x2d')][_0xb646('0x2e')]);_0x212f6d[_0xb646('0x31')]=_[_0xb646('0x32')](_0x529327['query']);_0x212f6d[_0xb646('0x33')]=_['intersection'](_0x212f6d['model'],_0x212f6d[_0xb646('0x31')]);_0x4cab39[_0xb646('0x36')]=_[_0xb646('0x34')](_0x212f6d[_0xb646('0x35')],qs[_0xb646('0x44')](_0x529327['query'][_0xb646('0x44')]));_0x4cab39[_0xb646('0x36')]=_0x4cab39[_0xb646('0x36')]['length']?_0x4cab39[_0xb646('0x36')]:_0x212f6d['model'];if(_0x529327[_0xb646('0x31')][_0xb646('0x3e')]){_0x4cab39[_0xb646('0x3f')]=[{'all':!![]}];}_0x4cab39=_[_0xb646('0x3b')]({},_0x4cab39,_0x529327[_0xb646('0x3d')]);return db[_0xb646('0x2d')][_0xb646('0x45')](_0x4cab39)[_0xb646('0x26')](handleEntityNotFound(_0x1f4a5b,null))[_0xb646('0x26')](respondWithResult(_0x1f4a5b,null))[_0xb646('0x42')](handleError(_0x1f4a5b,null));};exports[_0xb646('0x46')]=function(_0x28d548,_0x2e0299){return db[_0xb646('0x2d')][_0xb646('0x46')](_0x28d548[_0xb646('0x47')],{})[_0xb646('0x26')](respondWithResult(_0x2e0299,0xc9))[_0xb646('0x42')](handleError(_0x2e0299,null));};exports[_0xb646('0x25')]=function(_0x5a2562,_0x504e11){if(_0x5a2562[_0xb646('0x47')]['id']){delete _0x5a2562[_0xb646('0x47')]['id'];}return db[_0xb646('0x2d')][_0xb646('0x45')]({'where':{'id':_0x5a2562['params']['id']}})[_0xb646('0x26')](handleEntityNotFound(_0x504e11,null))['then'](saveUpdates(_0x5a2562['body'],null))[_0xb646('0x26')](respondWithResult(_0x504e11,null))[_0xb646('0x42')](handleError(_0x504e11,null));};exports[_0xb646('0x27')]=function(_0x4e9380,_0x7b89a8){return db['VoiceQueueReport'][_0xb646('0x45')]({'where':{'id':_0x4e9380[_0xb646('0x43')]['id']}})[_0xb646('0x26')](handleEntityNotFound(_0x7b89a8,null))[_0xb646('0x26')](removeEntity(_0x7b89a8,null))[_0xb646('0x42')](handleError(_0x7b89a8,null));};exports['describe']=function(_0x263e8f,_0x46ad25){return db[_0xb646('0x2d')][_0xb646('0x48')]()[_0xb646('0x26')](respondWithResult(_0x46ad25,null))[_0xb646('0x42')](handleError(_0x46ad25,null));};exports['getVoiceQueuesReport']=function(_0x10482d,_0x4459f2){var _0x5f4302={},_0x47f526={},_0x5b05d0={'count':0x0,'rows':[]};_0x47f526[_0xb646('0x35')]=_['keys'](db[_0xb646('0x2d')][_0xb646('0x2e')]);_0x47f526[_0xb646('0x31')]=_['keys'](_0x10482d[_0xb646('0x31')]);_0x47f526[_0xb646('0x33')]=_[_0xb646('0x34')](_0x47f526['model'],_0x47f526[_0xb646('0x31')]);_0x5f4302[_0xb646('0x36')]=_[_0xb646('0x34')](_0x47f526['model'],qs[_0xb646('0x44')](_0x10482d[_0xb646('0x31')]['fields']));_0x5f4302['attributes']=_0x5f4302[_0xb646('0x36')][_0xb646('0x49')]?_0x5f4302[_0xb646('0x36')]:_0x47f526[_0xb646('0x35')];if(!_0x10482d[_0xb646('0x31')][_0xb646('0x37')](_0xb646('0x38'))){_0x5f4302[_0xb646('0x1e')]=qs[_0xb646('0x1e')](_0x10482d['query']['limit']);_0x5f4302['offset']=qs['offset'](_0x10482d[_0xb646('0x31')][_0xb646('0x1c')]);}_0x5f4302[_0xb646('0x4a')]=qs[_0xb646('0x39')](_0x10482d['query'][_0xb646('0x39')]);_0x5f4302[_0xb646('0x3a')]=qs[_0xb646('0x33')](_[_0xb646('0x4b')](_0x10482d[_0xb646('0x31')],_0x47f526[_0xb646('0x33')]));if(_0x10482d['query'][_0xb646('0x3c')]){_0x5f4302['where']=_[_0xb646('0x3b')](_0x5f4302['where'],{'$or':_[_0xb646('0x2c')](_0x5f4302[_0xb646('0x36')],function(_0x2ce978){var _0x2f0191={};_0x2f0191[_0x2ce978]={'$like':'%'+_0x10482d[_0xb646('0x31')][_0xb646('0x3c')]+'%'};return _0x2f0191;})});}_0x5f4302=_['merge']({},_0x5f4302,_0x10482d[_0xb646('0x3d')]);var _0x3502ee={'where':_0x5f4302[_0xb646('0x3a')]};return db[_0xb646('0x2d')]['count'](_0x3502ee)[_0xb646('0x26')](function(_0x21f6a0){_0x5b05d0[_0xb646('0x1f')]=_0x21f6a0;if(_0x10482d[_0xb646('0x31')][_0xb646('0x3e')]){_0x5f4302[_0xb646('0x3f')]=[{'all':!![]}];}return db[_0xb646('0x2d')]['findAll'](_0x5f4302);})['then'](function(_0x4590e3){_0x5b05d0[_0xb646('0x41')]=_0x4590e3;return _0x5b05d0;})['then'](respondWithFilteredResult(_0x4459f2,_0x5f4302,'getVoiceQueuesReport'))[_0xb646('0x42')](handleError(_0x4459f2,null,_0xb646('0x4c')));}; \ No newline at end of file +var _0x9af2=['json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VoiceQueueReport','count','include','findAll','show','params','keys','includeAll','find','catch','create','body','describe','rawAttributes','filters','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end'];(function(_0x1d4210,_0x4ca518){var _0x3cfe6d=function(_0x176a2e){while(--_0x176a2e){_0x1d4210['push'](_0x1d4210['shift']());}};_0x3cfe6d(++_0x4ca518);}(_0x9af2,0x16e));var _0x29af=function(_0x5e2359,_0x5783ba){_0x5e2359=_0x5e2359-0x0;var _0x3d7144=_0x9af2[_0x5e2359];return _0x3d7144;};'use strict';var emlformat=require(_0x29af('0x0'));var rimraf=require(_0x29af('0x1'));var zipdir=require(_0x29af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29af('0x3'));var moment=require(_0x29af('0x4'));var BPromise=require(_0x29af('0x5'));var Mustache=require('mustache');var util=require(_0x29af('0x6'));var path=require('path');var sox=require(_0x29af('0x7'));var csv=require('to-csv');var ejs=require(_0x29af('0x8'));var fs=require('fs');var fs_extra=require(_0x29af('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x29af('0xa'));var jsforce=require(_0x29af('0xb'));var deskjs=require(_0x29af('0xc'));var toCsv=require(_0x29af('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29af('0xe'));var authService=require(_0x29af('0xf'));var qs=require(_0x29af('0x10'));var as=require(_0x29af('0x11'));var hardwareService=require(_0x29af('0x12'));var logger=require(_0x29af('0x13'))(_0x29af('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x29af('0x15'));var db=require(_0x29af('0x16'))['db'];config[_0x29af('0x17')]=_[_0x29af('0x18')](config[_0x29af('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x29af('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x29af('0x1a')](socket);function respondWithStatusCode(_0xc2c6e6,_0x469623){_0x469623=_0x469623||0xcc;return function(_0x431868){if(_0x431868){return _0xc2c6e6['sendStatus'](_0x469623);}return _0xc2c6e6[_0x29af('0x1b')](_0x469623)[_0x29af('0x1c')]();};}function respondWithResult(_0xad61b4,_0x59f74e){_0x59f74e=_0x59f74e||0xc8;return function(_0xae89aa){if(_0xae89aa){return _0xad61b4[_0x29af('0x1b')](_0x59f74e)[_0x29af('0x1d')](_0xae89aa);}};}function respondWithFilteredResult(_0x4307a8,_0x3c0c1c){return function(_0x493556){if(_0x493556){var _0x541e78=typeof _0x3c0c1c[_0x29af('0x1e')]===_0x29af('0x1f')&&typeof _0x3c0c1c[_0x29af('0x20')]==='undefined';var _0x4a6ba5=_0x493556['count'];var _0x15b0e4=_0x541e78?0x0:_0x3c0c1c['offset'];var _0x167e47=_0x541e78?_0x493556['count']:_0x3c0c1c[_0x29af('0x1e')]+_0x3c0c1c[_0x29af('0x20')];var _0x515fda;if(_0x167e47>=_0x4a6ba5){_0x167e47=_0x4a6ba5;_0x515fda=0xc8;}else{_0x515fda=0xce;}_0x4307a8['status'](_0x515fda);return _0x4307a8[_0x29af('0x21')](_0x29af('0x22'),_0x15b0e4+'-'+_0x167e47+'/'+_0x4a6ba5)['json'](_0x493556);}return null;};}function patchUpdates(_0xe2a93b){return function(_0x313ee4){try{jsonpatch['apply'](_0x313ee4,_0xe2a93b,!![]);}catch(_0x258370){return BPromise['reject'](_0x258370);}return _0x313ee4[_0x29af('0x23')]();};}function saveUpdates(_0x220a34,_0x5209f5){return function(_0x449797){if(_0x449797){return _0x449797[_0x29af('0x24')](_0x220a34)[_0x29af('0x25')](function(_0x4a5d36){return _0x4a5d36;});}return null;};}function removeEntity(_0x57293f,_0x1da49e){return function(_0x25c47e){if(_0x25c47e){return _0x25c47e[_0x29af('0x26')]()[_0x29af('0x25')](function(){_0x57293f[_0x29af('0x1b')](0xcc)[_0x29af('0x1c')]();});}};}function handleEntityNotFound(_0x2f4072,_0xf6c53a){return function(_0x5b825b){if(!_0x5b825b){_0x2f4072[_0x29af('0x27')](0x194);}return _0x5b825b;};}function handleError(_0xb55477,_0x4c58eb){_0x4c58eb=_0x4c58eb||0x1f4;return function(_0x2c31e8){logger[_0x29af('0x28')](_0x2c31e8['stack']);if(_0x2c31e8[_0x29af('0x29')]){delete _0x2c31e8['name'];}_0xb55477[_0x29af('0x1b')](_0x4c58eb)[_0x29af('0x2a')](_0x2c31e8);};}exports[_0x29af('0x2b')]=function(_0x2377df,_0x4587c1){var _0x577b74={},_0x40d8b6={},_0x2af974={'count':0x0,'rows':[]};var _0x5f06d1=_[_0x29af('0x2c')](db['VoiceQueueReport']['rawAttributes'],function(_0x31b5fd){return{'name':_0x31b5fd[_0x29af('0x2d')],'type':_0x31b5fd['type'][_0x29af('0x2e')]};});_0x40d8b6['model']=_['map'](_0x5f06d1,_0x29af('0x29'));_0x40d8b6[_0x29af('0x2f')]=_['keys'](_0x2377df['query']);_0x40d8b6['filters']=_[_0x29af('0x30')](_0x40d8b6[_0x29af('0x31')],_0x40d8b6[_0x29af('0x2f')]);_0x577b74[_0x29af('0x32')]=_['intersection'](_0x40d8b6[_0x29af('0x31')],qs['fields'](_0x2377df[_0x29af('0x2f')][_0x29af('0x33')]));_0x577b74[_0x29af('0x32')]=_0x577b74[_0x29af('0x32')][_0x29af('0x34')]?_0x577b74[_0x29af('0x32')]:_0x40d8b6[_0x29af('0x31')];if(!_0x2377df['query']['hasOwnProperty'](_0x29af('0x35'))){_0x577b74[_0x29af('0x20')]=qs[_0x29af('0x20')](_0x2377df[_0x29af('0x2f')]['limit']);_0x577b74[_0x29af('0x1e')]=qs[_0x29af('0x1e')](_0x2377df['query'][_0x29af('0x1e')]);}_0x577b74[_0x29af('0x36')]=qs[_0x29af('0x37')](_0x2377df[_0x29af('0x2f')]['sort']);_0x577b74[_0x29af('0x38')]=qs['filters'](_[_0x29af('0x39')](_0x2377df['query'],_0x40d8b6['filters']),_0x5f06d1);if(_0x2377df[_0x29af('0x2f')][_0x29af('0x3a')]){_0x577b74[_0x29af('0x38')]=_['merge'](_0x577b74[_0x29af('0x38')],{'$or':_['map'](_0x5f06d1,function(_0x460d1e){if(_0x460d1e[_0x29af('0x3b')]!==_0x29af('0x3c')){var _0x397d0b={};_0x397d0b[_0x460d1e[_0x29af('0x29')]]={'$like':'%'+_0x2377df[_0x29af('0x2f')][_0x29af('0x3a')]+'%'};return _0x397d0b;}})});}_0x577b74=_[_0x29af('0x3d')]({},_0x577b74,_0x2377df[_0x29af('0x3e')]);var _0x377923={'where':_0x577b74[_0x29af('0x38')]};return db[_0x29af('0x3f')][_0x29af('0x40')](_0x377923)[_0x29af('0x25')](function(_0x2c7eba){_0x2af974[_0x29af('0x40')]=_0x2c7eba;if(_0x2377df['query']['includeAll']){_0x577b74[_0x29af('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x29af('0x42')](_0x577b74);})[_0x29af('0x25')](function(_0x29ca2c){_0x2af974['rows']=_0x29ca2c;return _0x2af974;})[_0x29af('0x25')](respondWithFilteredResult(_0x4587c1,_0x577b74))['catch'](handleError(_0x4587c1,null));};exports[_0x29af('0x43')]=function(_0xb64ae5,_0x1808eb){var _0xbaa7e8={'raw':![],'where':{'id':_0xb64ae5[_0x29af('0x44')]['id']}},_0x4230b2={};_0x4230b2[_0x29af('0x31')]=_[_0x29af('0x45')](db[_0x29af('0x3f')]['rawAttributes']);_0x4230b2[_0x29af('0x2f')]=_[_0x29af('0x45')](_0xb64ae5['query']);_0x4230b2['filters']=_[_0x29af('0x30')](_0x4230b2[_0x29af('0x31')],_0x4230b2[_0x29af('0x2f')]);_0xbaa7e8[_0x29af('0x32')]=_[_0x29af('0x30')](_0x4230b2['model'],qs[_0x29af('0x33')](_0xb64ae5['query'][_0x29af('0x33')]));_0xbaa7e8[_0x29af('0x32')]=_0xbaa7e8[_0x29af('0x32')]['length']?_0xbaa7e8[_0x29af('0x32')]:_0x4230b2[_0x29af('0x31')];if(_0xb64ae5[_0x29af('0x2f')][_0x29af('0x46')]){_0xbaa7e8['include']=[{'all':!![]}];}_0xbaa7e8=_[_0x29af('0x3d')]({},_0xbaa7e8,_0xb64ae5[_0x29af('0x3e')]);return db[_0x29af('0x3f')][_0x29af('0x47')](_0xbaa7e8)[_0x29af('0x25')](handleEntityNotFound(_0x1808eb,null))['then'](respondWithResult(_0x1808eb,null))[_0x29af('0x48')](handleError(_0x1808eb,null));};exports['create']=function(_0x3ee5c7,_0x5ee60d){return db[_0x29af('0x3f')][_0x29af('0x49')](_0x3ee5c7[_0x29af('0x4a')],{})['then'](respondWithResult(_0x5ee60d,0xc9))['catch'](handleError(_0x5ee60d,null));};exports[_0x29af('0x24')]=function(_0x16314b,_0x498a08){if(_0x16314b[_0x29af('0x4a')]['id']){delete _0x16314b['body']['id'];}return db[_0x29af('0x3f')][_0x29af('0x47')]({'where':{'id':_0x16314b['params']['id']}})[_0x29af('0x25')](handleEntityNotFound(_0x498a08,null))['then'](saveUpdates(_0x16314b[_0x29af('0x4a')],null))[_0x29af('0x25')](respondWithResult(_0x498a08,null))[_0x29af('0x48')](handleError(_0x498a08,null));};exports[_0x29af('0x26')]=function(_0x3cab7b,_0x9c559a){return db[_0x29af('0x3f')][_0x29af('0x47')]({'where':{'id':_0x3cab7b[_0x29af('0x44')]['id']}})[_0x29af('0x25')](handleEntityNotFound(_0x9c559a,null))[_0x29af('0x25')](removeEntity(_0x9c559a,null))[_0x29af('0x48')](handleError(_0x9c559a,null));};exports[_0x29af('0x4b')]=function(_0x14c6c8,_0x20cb83){return db[_0x29af('0x3f')][_0x29af('0x4b')]()[_0x29af('0x25')](respondWithResult(_0x20cb83,null))[_0x29af('0x48')](handleError(_0x20cb83,null));};exports['getVoiceQueuesReport']=function(_0x198b2b,_0x32368a){var _0x451ed9={},_0x189822={},_0x5ef811={'count':0x0,'rows':[]};_0x189822['model']=_['keys'](db[_0x29af('0x3f')][_0x29af('0x4c')]);_0x189822[_0x29af('0x2f')]=_[_0x29af('0x45')](_0x198b2b[_0x29af('0x2f')]);_0x189822['filters']=_[_0x29af('0x30')](_0x189822['model'],_0x189822[_0x29af('0x2f')]);_0x451ed9[_0x29af('0x32')]=_['intersection'](_0x189822[_0x29af('0x31')],qs['fields'](_0x198b2b[_0x29af('0x2f')][_0x29af('0x33')]));_0x451ed9[_0x29af('0x32')]=_0x451ed9[_0x29af('0x32')]['length']?_0x451ed9['attributes']:_0x189822[_0x29af('0x31')];if(!_0x198b2b[_0x29af('0x2f')]['hasOwnProperty'](_0x29af('0x35'))){_0x451ed9[_0x29af('0x20')]=qs[_0x29af('0x20')](_0x198b2b[_0x29af('0x2f')][_0x29af('0x20')]);_0x451ed9['offset']=qs[_0x29af('0x1e')](_0x198b2b['query'][_0x29af('0x1e')]);}_0x451ed9[_0x29af('0x36')]=qs[_0x29af('0x37')](_0x198b2b[_0x29af('0x2f')][_0x29af('0x37')]);_0x451ed9[_0x29af('0x38')]=qs['filters'](_[_0x29af('0x39')](_0x198b2b[_0x29af('0x2f')],_0x189822[_0x29af('0x4d')]));if(_0x198b2b[_0x29af('0x2f')]['filter']){_0x451ed9[_0x29af('0x38')]=_[_0x29af('0x3d')](_0x451ed9[_0x29af('0x38')],{'$or':_[_0x29af('0x2c')](_0x451ed9['attributes'],function(_0x2a7f34){var _0x21206a={};_0x21206a[_0x2a7f34]={'$like':'%'+_0x198b2b[_0x29af('0x2f')][_0x29af('0x3a')]+'%'};return _0x21206a;})});}_0x451ed9=_[_0x29af('0x3d')]({},_0x451ed9,_0x198b2b[_0x29af('0x3e')]);var _0x1a94fd={'where':_0x451ed9[_0x29af('0x38')]};return db[_0x29af('0x3f')][_0x29af('0x40')](_0x1a94fd)[_0x29af('0x25')](function(_0x4e9401){_0x5ef811[_0x29af('0x40')]=_0x4e9401;if(_0x198b2b[_0x29af('0x2f')]['includeAll']){_0x451ed9[_0x29af('0x41')]=[{'all':!![]}];}return db[_0x29af('0x3f')][_0x29af('0x42')](_0x451ed9);})[_0x29af('0x25')](function(_0x1b9dd7){_0x5ef811[_0x29af('0x4e')]=_0x1b9dd7;return _0x5ef811;})[_0x29af('0x25')](respondWithFilteredResult(_0x32368a,_0x451ed9,'getVoiceQueuesReport'))[_0x29af('0x48')](handleError(_0x32368a,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2fcb160..4682f1b 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 _0x8fed=['remove','emit','hook','events','../../mysqldb','VoiceQueueReport'];(function(_0x58cfe6,_0x457d17){var _0x3d18c6=function(_0x457fe0){while(--_0x457fe0){_0x58cfe6['push'](_0x58cfe6['shift']());}};_0x3d18c6(++_0x457d17);}(_0x8fed,0x147));var _0xd8fe=function(_0x34ed35,_0x3d00ed){_0x34ed35=_0x34ed35-0x0;var _0x14d0de=_0x8fed[_0x34ed35];return _0x14d0de;};'use strict';var EventEmitter=require(_0xd8fe('0x0'));var VoiceQueueReport=require(_0xd8fe('0x1'))['db'][_0xd8fe('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd8fe('0x3')};function emitEvent(_0x30f8ee){return function(_0x274615,_0xa7a116,_0xeb9a67){VoiceQueueReportEvents[_0xd8fe('0x4')](_0x30f8ee+':'+_0x274615['id'],_0x274615);VoiceQueueReportEvents[_0xd8fe('0x4')](_0x30f8ee,_0x274615);_0xeb9a67(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xd8fe('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xa908=['../../mysqldb','VoiceQueueReport','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x519838,_0x4c018b){var _0x4a402d=function(_0x31b771){while(--_0x31b771){_0x519838['push'](_0x519838['shift']());}};_0x4a402d(++_0x4c018b);}(_0xa908,0x17f));var _0x8a90=function(_0x5185c6,_0x4e7c65){_0x5185c6=_0x5185c6-0x0;var _0x1a9c19=_0xa908[_0x5185c6];return _0x1a9c19;};'use strict';var EventEmitter=require(_0x8a90('0x0'));var VoiceQueueReport=require(_0x8a90('0x1'))['db'][_0x8a90('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8a90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x20dd8c){return function(_0x1c033c,_0x3284ce,_0x4ed8a7){VoiceQueueReportEvents[_0x8a90('0x4')](_0x20dd8c+':'+_0x1c033c['id'],_0x1c033c);VoiceQueueReportEvents[_0x8a90('0x4')](_0x20dd8c,_0x1c033c);_0x4ed8a7(null);};}for(var e in events){if(events[_0x8a90('0x5')](e)){var event=events[e];VoiceQueueReport[_0x8a90('0x6')](e,emitEvent(event));}}module[_0x8a90('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6dbf2db..9eb337c 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 _0x7215=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x15a63e,_0x2e3c99){var _0x42bedb=function(_0x3dbbb7){while(--_0x3dbbb7){_0x15a63e['push'](_0x15a63e['shift']());}};_0x42bedb(++_0x2e3c99);}(_0x7215,0xb0));var _0x5721=function(_0x171ac7,_0x339c8d){_0x171ac7=_0x171ac7-0x0;var _0x94478d=_0x7215[_0x171ac7];return _0x94478d;};'use strict';var _=require(_0x5721('0x0'));var util=require(_0x5721('0x1'));var logger=require(_0x5721('0x2'))(_0x5721('0x3'));var moment=require(_0x5721('0x4'));var BPromise=require(_0x5721('0x5'));var rp=require(_0x5721('0x6'));var fs=require('fs');var path=require(_0x5721('0x7'));var rimraf=require(_0x5721('0x8'));var config=require(_0x5721('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x5721('0xa')]=function(_0x2ea52e,_0x8e7c4a){return _0x2ea52e['define'](_0x5721('0xb'),attributes,{'tableName':_0x5721('0xc'),'paranoid':![],'indexes':[{'fields':[_0x5721('0xd')]},{'fields':[_0x5721('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc40a=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','util','../../config/logger'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0xc40a,0x66));var _0xac40=function(_0x586d0b,_0x45774b){_0x586d0b=_0x586d0b-0x0;var _0x2264d3=_0xc40a[_0x586d0b];return _0x2264d3;};'use strict';var _=require('lodash');var util=require(_0xac40('0x0'));var logger=require(_0xac40('0x1'))(_0xac40('0x2'));var moment=require(_0xac40('0x3'));var BPromise=require(_0xac40('0x4'));var rp=require(_0xac40('0x5'));var fs=require('fs');var path=require(_0xac40('0x6'));var rimraf=require('rimraf');var config=require(_0xac40('0x7'));var attributes=require(_0xac40('0x8'));module['exports']=function(_0x47166c,_0x31c0af){return _0x47166c[_0xac40('0x9')](_0xac40('0xa'),attributes,{'tableName':_0xac40('0xb'),'paranoid':![],'indexes':[{'fields':[_0xac40('0xc')]},{'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 642aa23..4b5454d 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 _0xb2f7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x31b756,_0x2a6fed){var _0xbadd58=function(_0x1b1abf){while(--_0x1b1abf){_0x31b756['push'](_0x31b756['shift']());}};_0xbadd58(++_0x2a6fed);}(_0xb2f7,0x162));var _0x7b2f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb2f7[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x7b2f('0x0'));var util=require(_0x7b2f('0x1'));var moment=require(_0x7b2f('0x2'));var BPromise=require(_0x7b2f('0x3'));var rs=require(_0x7b2f('0x4'));var fs=require('fs');var Redis=require(_0x7b2f('0x5'));var db=require(_0x7b2f('0x6'))['db'];var utils=require(_0x7b2f('0x7'));var logger=require(_0x7b2f('0x8'))(_0x7b2f('0x9'));var config=require(_0x7b2f('0xa'));var jayson=require(_0x7b2f('0xb'));var client=jayson['client'][_0x7b2f('0xc')]({'port':0x232a});config[_0x7b2f('0xd')]=_[_0x7b2f('0xe')](config[_0x7b2f('0xd')],{'host':_0x7b2f('0xf'),'port':0x18eb});var socket=require(_0x7b2f('0x10'))(new Redis(config['redis']));require(_0x7b2f('0x11'))[_0x7b2f('0x12')](socket);function respondWithRpcPromise(_0x5f112c,_0x40c721,_0x1abb19){return new BPromise(function(_0x481378,_0x556430){return client[_0x7b2f('0x13')](_0x5f112c,_0x1abb19)[_0x7b2f('0x14')](function(_0x318f56){logger[_0x7b2f('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x40c721,_0x7b2f('0x16'));logger['debug'](_0x7b2f('0x17'),_0x40c721,_0x7b2f('0x16'),JSON['stringify'](_0x318f56));if(_0x318f56[_0x7b2f('0x18')]){if(_0x318f56['error'][_0x7b2f('0x19')]===0x1f4){logger[_0x7b2f('0x18')](_0x7b2f('0x1a'),_0x40c721,_0x318f56[_0x7b2f('0x18')][_0x7b2f('0x1b')]);return _0x556430(_0x318f56[_0x7b2f('0x18')]['message']);}logger[_0x7b2f('0x18')](_0x7b2f('0x1a'),_0x40c721,_0x318f56[_0x7b2f('0x18')][_0x7b2f('0x1b')]);return _0x481378(_0x318f56[_0x7b2f('0x18')][_0x7b2f('0x1b')]);}else{logger['info'](_0x7b2f('0x1a'),_0x40c721,_0x7b2f('0x16'));_0x481378(_0x318f56[_0x7b2f('0x1c')]['message']);}})[_0x7b2f('0x1d')](function(_0x315a22){logger[_0x7b2f('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x40c721,_0x315a22);_0x556430(_0x315a22);});});}exports[_0x7b2f('0x1e')]=function(_0x5448cf){var _0x191b0b=this;return new Promise(function(_0x2c7ccd,_0x2469a8){return db[_0x7b2f('0x1f')][_0x7b2f('0x20')]({'raw':_0x5448cf[_0x7b2f('0x21')]?_0x5448cf[_0x7b2f('0x21')][_0x7b2f('0x22')]===undefined?!![]:![]:!![],'where':_0x5448cf[_0x7b2f('0x21')]?_0x5448cf[_0x7b2f('0x21')][_0x7b2f('0x23')]||null:null,'attributes':_0x5448cf['options']?_0x5448cf['options'][_0x7b2f('0x24')]||null:null,'limit':_0x5448cf[_0x7b2f('0x21')]?_0x5448cf[_0x7b2f('0x21')][_0x7b2f('0x25')]||null:null,'include':_0x5448cf[_0x7b2f('0x21')]?_0x5448cf[_0x7b2f('0x21')][_0x7b2f('0x26')]?_[_0x7b2f('0x27')](_0x5448cf['options'][_0x7b2f('0x26')],function(_0x3e9686){return{'model':db[_0x3e9686[_0x7b2f('0x28')]],'as':_0x3e9686['as'],'attributes':_0x3e9686[_0x7b2f('0x24')],'include':_0x3e9686[_0x7b2f('0x26')]?_[_0x7b2f('0x27')](_0x3e9686[_0x7b2f('0x26')],function(_0x28901d){return{'model':db[_0x28901d[_0x7b2f('0x28')]],'as':_0x28901d['as'],'attributes':_0x28901d[_0x7b2f('0x24')],'include':_0x28901d[_0x7b2f('0x26')]?_[_0x7b2f('0x27')](_0x28901d['include'],function(_0x56c8cb){return{'model':db[_0x56c8cb[_0x7b2f('0x28')]],'as':_0x56c8cb['as'],'attributes':_0x56c8cb[_0x7b2f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7b2f('0x14')](function(_0x57e087){logger[_0x7b2f('0x15')](_0x7b2f('0x1e'),_0x5448cf);logger[_0x7b2f('0x29')](_0x7b2f('0x1e'),_0x5448cf,JSON[_0x7b2f('0x2a')](_0x57e087));_0x2c7ccd(_0x57e087);})[_0x7b2f('0x1d')](function(_0x220c21){logger[_0x7b2f('0x18')](_0x7b2f('0x1e'),_0x220c21[_0x7b2f('0x1b')],_0x5448cf);_0x2469a8(_0x191b0b['error'](0x1f4,_0x220c21[_0x7b2f('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0x35e09c){var _0x56292c=this;return new Promise(function(_0x4a24e7,_0x51b7d7){return db['VoiceQueueReport']['create'](_0x35e09c[_0x7b2f('0x2b')],{'raw':_0x35e09c['options']?_0x35e09c[_0x7b2f('0x21')][_0x7b2f('0x22')]===undefined?!![]:![]:!![]})[_0x7b2f('0x14')](function(_0x4a15d9){logger['info']('CreateVoiceQueueReport',_0x35e09c);logger[_0x7b2f('0x29')]('CreateVoiceQueueReport',_0x35e09c,JSON['stringify'](_0x4a15d9));_0x4a24e7(_0x4a15d9);})[_0x7b2f('0x1d')](function(_0x2add91){logger[_0x7b2f('0x18')]('CreateVoiceQueueReport',_0x2add91['message'],_0x35e09c);_0x51b7d7(_0x56292c[_0x7b2f('0x18')](0x1f4,_0x2add91[_0x7b2f('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x52cc43){var _0x15f581=this;return new Promise(function(_0x472fd5,_0x11b1f2){return db['VoiceQueueReport']['update'](_0x52cc43['body'],{'raw':_0x52cc43[_0x7b2f('0x21')]?_0x52cc43[_0x7b2f('0x21')][_0x7b2f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52cc43[_0x7b2f('0x21')]?_0x52cc43[_0x7b2f('0x21')][_0x7b2f('0x23')]||null:null,'attributes':_0x52cc43['options']?_0x52cc43[_0x7b2f('0x21')][_0x7b2f('0x24')]||null:null,'limit':_0x52cc43[_0x7b2f('0x21')]?_0x52cc43[_0x7b2f('0x21')]['limit']||null:null})[_0x7b2f('0x14')](function(_0x2f6666){logger[_0x7b2f('0x15')]('UpdateVoiceQueueReport',_0x52cc43);logger[_0x7b2f('0x29')](_0x7b2f('0x2c'),_0x52cc43,JSON[_0x7b2f('0x2a')](_0x2f6666));_0x472fd5(_0x2f6666);})[_0x7b2f('0x1d')](function(_0x493e39){logger['error'](_0x7b2f('0x2c'),_0x493e39[_0x7b2f('0x1b')],_0x52cc43);_0x11b1f2(_0x15f581[_0x7b2f('0x18')](0x1f4,_0x493e39[_0x7b2f('0x1b')]));});});}; \ No newline at end of file +var _0x3684=['error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','update','body','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x95184b,_0x6fa6ce){var _0x849bfb=function(_0xb116ae){while(--_0xb116ae){_0x95184b['push'](_0x95184b['shift']());}};_0x849bfb(++_0x6fa6ce);}(_0x3684,0x97));var _0x4368=function(_0x30a173,_0x189509){_0x30a173=_0x30a173-0x0;var _0x53604e=_0x3684[_0x30a173];return _0x53604e;};'use strict';var _=require(_0x4368('0x0'));var util=require(_0x4368('0x1'));var moment=require('moment');var BPromise=require(_0x4368('0x2'));var rs=require(_0x4368('0x3'));var fs=require('fs');var Redis=require(_0x4368('0x4'));var db=require(_0x4368('0x5'))['db'];var utils=require(_0x4368('0x6'));var logger=require(_0x4368('0x7'))(_0x4368('0x8'));var config=require(_0x4368('0x9'));var jayson=require(_0x4368('0xa'));var client=jayson[_0x4368('0xb')][_0x4368('0xc')]({'port':0x232a});config[_0x4368('0xd')]=_[_0x4368('0xe')](config[_0x4368('0xd')],{'host':_0x4368('0xf'),'port':0x18eb});var socket=require(_0x4368('0x10'))(new Redis(config['redis']));require(_0x4368('0x11'))[_0x4368('0x12')](socket);function respondWithRpcPromise(_0x42f3e8,_0x16113b,_0x1d9c0f){return new BPromise(function(_0x545c98,_0x52c1f2){return client[_0x4368('0x13')](_0x42f3e8,_0x1d9c0f)[_0x4368('0x14')](function(_0x3d5eae){logger[_0x4368('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x16113b,_0x4368('0x16'));logger[_0x4368('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x16113b,_0x4368('0x16'),JSON[_0x4368('0x18')](_0x3d5eae));if(_0x3d5eae[_0x4368('0x19')]){if(_0x3d5eae[_0x4368('0x19')][_0x4368('0x1a')]===0x1f4){logger['error'](_0x4368('0x1b'),_0x16113b,_0x3d5eae[_0x4368('0x19')][_0x4368('0x1c')]);return _0x52c1f2(_0x3d5eae[_0x4368('0x19')]['message']);}logger[_0x4368('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x16113b,_0x3d5eae[_0x4368('0x19')][_0x4368('0x1c')]);return _0x545c98(_0x3d5eae[_0x4368('0x19')]['message']);}else{logger[_0x4368('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x16113b,_0x4368('0x16'));_0x545c98(_0x3d5eae['result']['message']);}})[_0x4368('0x1d')](function(_0x136ac1){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x16113b,_0x136ac1);_0x52c1f2(_0x136ac1);});});}exports[_0x4368('0x1e')]=function(_0x226755){var _0xf2201=this;return new Promise(function(_0x4da01b,_0x217601){return db[_0x4368('0x1f')]['findAll']({'raw':_0x226755[_0x4368('0x20')]?_0x226755[_0x4368('0x20')][_0x4368('0x21')]===undefined?!![]:![]:!![],'where':_0x226755[_0x4368('0x20')]?_0x226755[_0x4368('0x20')][_0x4368('0x22')]||null:null,'attributes':_0x226755[_0x4368('0x20')]?_0x226755['options'][_0x4368('0x23')]||null:null,'limit':_0x226755[_0x4368('0x20')]?_0x226755[_0x4368('0x20')][_0x4368('0x24')]||null:null,'include':_0x226755[_0x4368('0x20')]?_0x226755[_0x4368('0x20')][_0x4368('0x25')]?_[_0x4368('0x26')](_0x226755[_0x4368('0x20')][_0x4368('0x25')],function(_0x555bcd){return{'model':db[_0x555bcd[_0x4368('0x27')]],'as':_0x555bcd['as'],'attributes':_0x555bcd[_0x4368('0x23')],'include':_0x555bcd[_0x4368('0x25')]?_[_0x4368('0x26')](_0x555bcd[_0x4368('0x25')],function(_0x5ebd9b){return{'model':db[_0x5ebd9b[_0x4368('0x27')]],'as':_0x5ebd9b['as'],'attributes':_0x5ebd9b[_0x4368('0x23')],'include':_0x5ebd9b['include']?_[_0x4368('0x26')](_0x5ebd9b[_0x4368('0x25')],function(_0x1f1ca4){return{'model':db[_0x1f1ca4[_0x4368('0x27')]],'as':_0x1f1ca4['as'],'attributes':_0x1f1ca4['attributes']};}):[]};}):[]};}):[]:[]})[_0x4368('0x14')](function(_0x2037c2){logger[_0x4368('0x15')]('GetVoiceQueueReport',_0x226755);logger[_0x4368('0x17')](_0x4368('0x1e'),_0x226755,JSON['stringify'](_0x2037c2));_0x4da01b(_0x2037c2);})[_0x4368('0x1d')](function(_0x54f7eb){logger[_0x4368('0x19')]('GetVoiceQueueReport',_0x54f7eb['message'],_0x226755);_0x217601(_0xf2201[_0x4368('0x19')](0x1f4,_0x54f7eb[_0x4368('0x1c')]));});});};exports[_0x4368('0x28')]=function(_0x40ac72){var _0x60f1b9=this;return new Promise(function(_0x582bf9,_0x1f6b23){return db['VoiceQueueReport']['create'](_0x40ac72['body'],{'raw':_0x40ac72[_0x4368('0x20')]?_0x40ac72[_0x4368('0x20')][_0x4368('0x21')]===undefined?!![]:![]:!![]})[_0x4368('0x14')](function(_0x36e7e4){logger[_0x4368('0x15')](_0x4368('0x28'),_0x40ac72);logger[_0x4368('0x17')](_0x4368('0x28'),_0x40ac72,JSON['stringify'](_0x36e7e4));_0x582bf9(_0x36e7e4);})[_0x4368('0x1d')](function(_0x1ee7c5){logger[_0x4368('0x19')](_0x4368('0x28'),_0x1ee7c5[_0x4368('0x1c')],_0x40ac72);_0x1f6b23(_0x60f1b9[_0x4368('0x19')](0x1f4,_0x1ee7c5[_0x4368('0x1c')]));});});};exports['UpdateVoiceQueueReport']=function(_0x291559){var _0x342e5b=this;return new Promise(function(_0x3e8b47,_0x574993){return db[_0x4368('0x1f')][_0x4368('0x29')](_0x291559[_0x4368('0x2a')],{'raw':_0x291559[_0x4368('0x20')]?_0x291559[_0x4368('0x20')][_0x4368('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291559['options']?_0x291559[_0x4368('0x20')][_0x4368('0x22')]||null:null,'attributes':_0x291559['options']?_0x291559[_0x4368('0x20')][_0x4368('0x23')]||null:null,'limit':_0x291559[_0x4368('0x20')]?_0x291559[_0x4368('0x20')][_0x4368('0x24')]||null:null})[_0x4368('0x14')](function(_0x216729){logger[_0x4368('0x15')](_0x4368('0x2b'),_0x291559);logger[_0x4368('0x17')](_0x4368('0x2b'),_0x291559,JSON[_0x4368('0x18')](_0x216729));_0x3e8b47(_0x216729);})[_0x4368('0x1d')](function(_0x2de60d){logger['error'](_0x4368('0x2b'),_0x2de60d[_0x4368('0x1c')],_0x291559);_0x574993(_0x342e5b['error'](0x1f4,_0x2de60d[_0x4368('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 92c78d6..3ff7187 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 _0xb7a7=['remove','update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x22250c,_0x5be6a5){_0x22250c=_0x22250c-0x0;var _0x316429=_0xb7a7[_0x22250c];return _0x316429;};'use strict';var VoiceQueueReportEvents=require(_0x7b7a('0x0'));var events=[_0x7b7a('0x1'),_0x7b7a('0x2'),_0x7b7a('0x3')];function createListener(_0xdc2ef1,_0x517dd4){return function(_0x51de97){_0x517dd4[_0x7b7a('0x4')](_0xdc2ef1,_0x51de97);};}function removeListener(_0x290959,_0x42d678){return function(){VoiceQueueReportEvents['removeListener'](_0x290959,_0x42d678);};}exports[_0x7b7a('0x5')]=function(_0x6e7b3c){for(var _0x3739f9=0x0,_0xf003bc=events[_0x7b7a('0x6')];_0x3739f9<_0xf003bc;_0x3739f9++){var _0x1ef0f3=events[_0x3739f9];var _0x27e956=createListener(_0x7b7a('0x7')+_0x1ef0f3,_0x6e7b3c);VoiceQueueReportEvents['on'](_0x1ef0f3,_0x27e956);}}; \ No newline at end of file +var _0x8893=['update','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x4b083e,_0x310639){var _0x2bc48e=function(_0x2025ab){while(--_0x2025ab){_0x4b083e['push'](_0x4b083e['shift']());}};_0x2bc48e(++_0x310639);}(_0x8893,0x1a8));var _0x3889=function(_0x12e8d5,_0x5cc297){_0x12e8d5=_0x12e8d5-0x0;var _0x1dc087=_0x8893[_0x12e8d5];return _0x1dc087;};'use strict';var VoiceQueueReportEvents=require(_0x3889('0x0'));var events=[_0x3889('0x1'),_0x3889('0x2'),_0x3889('0x3')];function createListener(_0x1e9808,_0x6761d3){return function(_0x11134f){_0x6761d3['emit'](_0x1e9808,_0x11134f);};}function removeListener(_0x24eaa8,_0x1c97de){return function(){VoiceQueueReportEvents[_0x3889('0x4')](_0x24eaa8,_0x1c97de);};}exports['register']=function(_0x182d99){for(var _0x3fcd9d=0x0,_0x5ad385=events[_0x3889('0x5')];_0x3fcd9d<_0x5ad385;_0x3fcd9d++){var _0x33c5da=events[_0x3fcd9d];var _0x36e13e=createListener(_0x3889('0x6')+_0x33c5da,_0x182d99);VoiceQueueReportEvents['on'](_0x33c5da,_0x36e13e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0f7d30b..6eb97df 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 _0x5d93=['create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x15aceb,_0x599bbd){var _0x6f2947=function(_0x17f49e){while(--_0x17f49e){_0x15aceb['push'](_0x15aceb['shift']());}};_0x6f2947(++_0x599bbd);}(_0x5d93,0x15b));var _0x35d9=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x5d93[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require(_0x35d9('0x0'));var util=require(_0x35d9('0x1'));var path=require('path');var timeout=require(_0x35d9('0x2'));var express=require(_0x35d9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x35d9('0x5'));var controller=require(_0x35d9('0x6'));router[_0x35d9('0x7')]('/',auth[_0x35d9('0x8')](),controller[_0x35d9('0x9')]);router[_0x35d9('0x7')](_0x35d9('0xa'),auth[_0x35d9('0x8')](),controller[_0x35d9('0xb')]);router[_0x35d9('0xc')]('/',auth[_0x35d9('0x8')](),controller[_0x35d9('0xd')]);router[_0x35d9('0xe')]('/:id',auth[_0x35d9('0x8')](),controller[_0x35d9('0xf')]);router[_0x35d9('0x10')](_0x35d9('0xa'),auth[_0x35d9('0x8')](),controller['destroy']);module[_0x35d9('0x11')]=router; \ No newline at end of file +var _0x3ac6=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get'];(function(_0x574a06,_0xe0078e){var _0x34905a=function(_0x27bb13){while(--_0x27bb13){_0x574a06['push'](_0x574a06['shift']());}};_0x34905a(++_0xe0078e);}(_0x3ac6,0xeb));var _0x63ac=function(_0xb3e4a2,_0x542cff){_0xb3e4a2=_0xb3e4a2-0x0;var _0x36a15e=_0x3ac6[_0xb3e4a2];return _0x36a15e;};'use strict';var multer=require(_0x63ac('0x0'));var util=require(_0x63ac('0x1'));var path=require(_0x63ac('0x2'));var timeout=require(_0x63ac('0x3'));var express=require(_0x63ac('0x4'));var router=express[_0x63ac('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x63ac('0x6'));var interaction=require(_0x63ac('0x7'));var config=require(_0x63ac('0x8'));var controller=require(_0x63ac('0x9'));router['get']('/',auth[_0x63ac('0xa')](),controller['index']);router[_0x63ac('0xb')]('/:id',auth[_0x63ac('0xa')](),controller[_0x63ac('0xc')]);router[_0x63ac('0xd')]('/',auth['isAuthenticated'](),controller[_0x63ac('0xe')]);router[_0x63ac('0xf')](_0x63ac('0x10'),auth[_0x63ac('0xa')](),controller[_0x63ac('0x11')]);router['delete'](_0x63ac('0x10'),auth[_0x63ac('0xa')](),controller[_0x63ac('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 1d7f1ea..d076d68 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 _0x14f5=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x43b784,_0x120eeb){var _0x35c724=function(_0x5f048a){while(--_0x5f048a){_0x43b784['push'](_0x43b784['shift']());}};_0x35c724(++_0x120eeb);}(_0x14f5,0xae));var _0x514f=function(_0x214c18,_0x4a7b79){_0x214c18=_0x214c18-0x0;var _0x1db402=_0x14f5[_0x214c18];return _0x1db402;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x514f('0x0'));module['exports']={'time':{'type':Sequelize[_0x514f('0x1')]},'callid':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x514f('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x514f('0x2')],'allowNull':![],'defaultValue':moment()[_0x514f('0x3')](_0x514f('0x4'))}}; \ No newline at end of file +var _0xb955=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x182455,_0x162dfe){var _0x1b4bd6=function(_0x18bb58){while(--_0x18bb58){_0x182455['push'](_0x182455['shift']());}};_0x1b4bd6(++_0x162dfe);}(_0xb955,0x123));var _0x5b95=function(_0x2300ed,_0x1500a3){_0x2300ed=_0x2300ed-0x0;var _0x48b748=_0xb955[_0x2300ed];return _0x48b748;};'use strict';var Sequelize=require(_0x5b95('0x0'));var moment=require(_0x5b95('0x1'));module[_0x5b95('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5b95('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5b95('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x5b95('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e1ab774..f70feb2 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 _0x6b19=['where','filters','filter','options','include','findAll','rows','catch','show','params','intersection','includeAll','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0x18c));var _0x96b1=function(_0x1450c6,_0x564698){_0x1450c6=_0x1450c6-0x0;var _0x52bef5=_0x6b19[_0x1450c6];return _0x52bef5;};'use strict';var emlformat=require(_0x96b1('0x0'));var rimraf=require(_0x96b1('0x1'));var zipdir=require(_0x96b1('0x2'));var jsonpatch=require(_0x96b1('0x3'));var rp=require('request-promise');var moment=require(_0x96b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96b1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x96b1('0x6'));var csv=require(_0x96b1('0x7'));var ejs=require(_0x96b1('0x8'));var fs=require('fs');var fs_extra=require(_0x96b1('0x9'));var _=require(_0x96b1('0xa'));var squel=require(_0x96b1('0xb'));var crypto=require('crypto');var jsforce=require(_0x96b1('0xc'));var deskjs=require(_0x96b1('0xd'));var toCsv=require(_0x96b1('0x7'));var querystring=require(_0x96b1('0xe'));var Papa=require(_0x96b1('0xf'));var Redis=require(_0x96b1('0x10'));var authService=require(_0x96b1('0x11'));var qs=require(_0x96b1('0x12'));var as=require(_0x96b1('0x13'));var hardwareService=require(_0x96b1('0x14'));var logger=require(_0x96b1('0x15'))(_0x96b1('0x16'));var utils=require(_0x96b1('0x17'));var config=require(_0x96b1('0x18'));var licenseUtil=require(_0x96b1('0x19'));var db=require(_0x96b1('0x1a'))['db'];function respondWithStatusCode(_0x688f2c,_0xd0a304){_0xd0a304=_0xd0a304||0xcc;return function(_0x2725eb){if(_0x2725eb){return _0x688f2c[_0x96b1('0x1b')](_0xd0a304);}return _0x688f2c['status'](_0xd0a304)['end']();};}function respondWithResult(_0x815dd,_0xe07526){_0xe07526=_0xe07526||0xc8;return function(_0x172044){if(_0x172044){return _0x815dd['status'](_0xe07526)['json'](_0x172044);}};}function respondWithFilteredResult(_0x1065d1,_0x518e0a){return function(_0x109dc1){if(_0x109dc1){var _0x1ab03d=typeof _0x518e0a[_0x96b1('0x1c')]===_0x96b1('0x1d')&&typeof _0x518e0a[_0x96b1('0x1e')]===_0x96b1('0x1d');var _0x2a88e7=_0x109dc1[_0x96b1('0x1f')];var _0x5a16e6=_0x1ab03d?0x0:_0x518e0a['offset'];var _0x1e21b0=_0x1ab03d?_0x109dc1['count']:_0x518e0a['offset']+_0x518e0a[_0x96b1('0x1e')];var _0x52c049;if(_0x1e21b0>=_0x2a88e7){_0x1e21b0=_0x2a88e7;_0x52c049=0xc8;}else{_0x52c049=0xce;}_0x1065d1[_0x96b1('0x20')](_0x52c049);return _0x1065d1['set'](_0x96b1('0x21'),_0x5a16e6+'-'+_0x1e21b0+'/'+_0x2a88e7)[_0x96b1('0x22')](_0x109dc1);}return null;};}function patchUpdates(_0x573a9c){return function(_0x56b488){try{jsonpatch[_0x96b1('0x23')](_0x56b488,_0x573a9c,!![]);}catch(_0x56b633){return BPromise[_0x96b1('0x24')](_0x56b633);}return _0x56b488['save']();};}function saveUpdates(_0x312b9e,_0x5e3faf){return function(_0x384b2d){if(_0x384b2d){return _0x384b2d[_0x96b1('0x25')](_0x312b9e)[_0x96b1('0x26')](function(_0x4ed4c2){return _0x4ed4c2;});}return null;};}function removeEntity(_0x32cedc,_0x2ac647){return function(_0x2a28ce){if(_0x2a28ce){return _0x2a28ce[_0x96b1('0x27')]()['then'](function(){_0x32cedc[_0x96b1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d175e,_0x2ec649){return function(_0x3b880c){if(!_0x3b880c){_0x2d175e[_0x96b1('0x1b')](0x194);}return _0x3b880c;};}function handleError(_0x2b30ee,_0x2a97a6){_0x2a97a6=_0x2a97a6||0x1f4;return function(_0x2d69d4){logger[_0x96b1('0x28')](_0x2d69d4['stack']);if(_0x2d69d4['name']){delete _0x2d69d4[_0x96b1('0x29')];}_0x2b30ee[_0x96b1('0x20')](_0x2a97a6)[_0x96b1('0x2a')](_0x2d69d4);};}exports[_0x96b1('0x2b')]=function(_0xdb6cab,_0x641d41){var _0x1c7988={},_0x1555ef={},_0x16be64={'count':0x0,'rows':[]};var _0x252fba=_[_0x96b1('0x2c')](db[_0x96b1('0x2d')][_0x96b1('0x2e')],function(_0x2ca48b){return{'name':_0x2ca48b[_0x96b1('0x2f')],'type':_0x2ca48b[_0x96b1('0x30')][_0x96b1('0x31')]};});_0x1555ef['model']=_[_0x96b1('0x2c')](_0x252fba,'name');_0x1555ef['query']=_[_0x96b1('0x32')](_0xdb6cab[_0x96b1('0x33')]);_0x1555ef['filters']=_['intersection'](_0x1555ef[_0x96b1('0x34')],_0x1555ef[_0x96b1('0x33')]);_0x1c7988[_0x96b1('0x35')]=_['intersection'](_0x1555ef[_0x96b1('0x34')],qs[_0x96b1('0x36')](_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x36')]));_0x1c7988[_0x96b1('0x35')]=_0x1c7988['attributes'][_0x96b1('0x37')]?_0x1c7988[_0x96b1('0x35')]:_0x1555ef[_0x96b1('0x34')];if(!_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x38')](_0x96b1('0x39'))){_0x1c7988[_0x96b1('0x1e')]=qs[_0x96b1('0x1e')](_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x1e')]);_0x1c7988[_0x96b1('0x1c')]=qs[_0x96b1('0x1c')](_0xdb6cab[_0x96b1('0x33')]['offset']);}_0x1c7988[_0x96b1('0x3a')]=qs[_0x96b1('0x3b')](_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x3b')]);_0x1c7988[_0x96b1('0x3c')]=qs[_0x96b1('0x3d')](_['pick'](_0xdb6cab[_0x96b1('0x33')],_0x1555ef['filters']),_0x252fba);if(_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x3e')]){_0x1c7988['where']=_['merge'](_0x1c7988[_0x96b1('0x3c')],{'$or':_['map'](_0x252fba,function(_0x32fc2c){if(_0x32fc2c[_0x96b1('0x30')]!=='VIRTUAL'){var _0x5157bd={};_0x5157bd[_0x32fc2c[_0x96b1('0x29')]]={'$like':'%'+_0xdb6cab[_0x96b1('0x33')][_0x96b1('0x3e')]+'%'};return _0x5157bd;}})});}_0x1c7988=_['merge']({},_0x1c7988,_0xdb6cab[_0x96b1('0x3f')]);var _0x2455bf={'where':_0x1c7988[_0x96b1('0x3c')]};return db[_0x96b1('0x2d')]['count'](_0x2455bf)[_0x96b1('0x26')](function(_0x436468){_0x16be64[_0x96b1('0x1f')]=_0x436468;if(_0xdb6cab[_0x96b1('0x33')]['includeAll']){_0x1c7988[_0x96b1('0x40')]=[{'all':!![]}];}return db[_0x96b1('0x2d')][_0x96b1('0x41')](_0x1c7988);})[_0x96b1('0x26')](function(_0x47bac6){_0x16be64[_0x96b1('0x42')]=_0x47bac6;return _0x16be64;})[_0x96b1('0x26')](respondWithFilteredResult(_0x641d41,_0x1c7988))[_0x96b1('0x43')](handleError(_0x641d41,null));};exports[_0x96b1('0x44')]=function(_0x1f430,_0x165a28){var _0x40ae72={'raw':!![],'where':{'id':_0x1f430[_0x96b1('0x45')]['id']}},_0x3b47c3={};_0x3b47c3[_0x96b1('0x34')]=_[_0x96b1('0x32')](db[_0x96b1('0x2d')]['rawAttributes']);_0x3b47c3[_0x96b1('0x33')]=_['keys'](_0x1f430['query']);_0x3b47c3[_0x96b1('0x3d')]=_[_0x96b1('0x46')](_0x3b47c3[_0x96b1('0x34')],_0x3b47c3[_0x96b1('0x33')]);_0x40ae72['attributes']=_[_0x96b1('0x46')](_0x3b47c3[_0x96b1('0x34')],qs[_0x96b1('0x36')](_0x1f430[_0x96b1('0x33')][_0x96b1('0x36')]));_0x40ae72[_0x96b1('0x35')]=_0x40ae72[_0x96b1('0x35')][_0x96b1('0x37')]?_0x40ae72['attributes']:_0x3b47c3[_0x96b1('0x34')];if(_0x1f430[_0x96b1('0x33')][_0x96b1('0x47')]){_0x40ae72[_0x96b1('0x40')]=[{'all':!![]}];}_0x40ae72=_[_0x96b1('0x48')]({},_0x40ae72,_0x1f430[_0x96b1('0x3f')]);return db[_0x96b1('0x2d')]['find'](_0x40ae72)['then'](handleEntityNotFound(_0x165a28,null))['then'](respondWithResult(_0x165a28,null))['catch'](handleError(_0x165a28,null));};exports[_0x96b1('0x49')]=function(_0x520580,_0x2f69ca){return db[_0x96b1('0x2d')][_0x96b1('0x49')](_0x520580['body'],{})['then'](respondWithResult(_0x2f69ca,0xc9))[_0x96b1('0x43')](handleError(_0x2f69ca,null));};exports[_0x96b1('0x25')]=function(_0x27076e,_0x512537){if(_0x27076e[_0x96b1('0x4a')]['id']){delete _0x27076e[_0x96b1('0x4a')]['id'];}return db[_0x96b1('0x2d')][_0x96b1('0x4b')]({'where':{'id':_0x27076e[_0x96b1('0x45')]['id']}})[_0x96b1('0x26')](handleEntityNotFound(_0x512537,null))[_0x96b1('0x26')](saveUpdates(_0x27076e['body'],null))['then'](respondWithResult(_0x512537,null))[_0x96b1('0x43')](handleError(_0x512537,null));};exports[_0x96b1('0x27')]=function(_0x13792d,_0x5529e8){return db[_0x96b1('0x2d')][_0x96b1('0x4b')]({'where':{'id':_0x13792d[_0x96b1('0x45')]['id']}})[_0x96b1('0x26')](handleEntityNotFound(_0x5529e8,null))[_0x96b1('0x26')](removeEntity(_0x5529e8,null))[_0x96b1('0x43')](handleError(_0x5529e8,null));}; \ No newline at end of file +var _0xa61e=['bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','fast-json-patch','request-promise','moment'];(function(_0x173158,_0x1609cf){var _0x4ad038=function(_0x2922d7){while(--_0x2922d7){_0x173158['push'](_0x173158['shift']());}};_0x4ad038(++_0x1609cf);}(_0xa61e,0x16f));var _0xea61=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa61e[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea61('0x0'));var rp=require(_0xea61('0x1'));var moment=require(_0xea61('0x2'));var BPromise=require(_0xea61('0x3'));var Mustache=require(_0xea61('0x4'));var util=require('util');var path=require(_0xea61('0x5'));var sox=require(_0xea61('0x6'));var csv=require(_0xea61('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea61('0x8'));var _=require(_0xea61('0x9'));var squel=require(_0xea61('0xa'));var crypto=require(_0xea61('0xb'));var jsforce=require(_0xea61('0xc'));var deskjs=require(_0xea61('0xd'));var toCsv=require(_0xea61('0x7'));var querystring=require('querystring');var Papa=require(_0xea61('0xe'));var Redis=require(_0xea61('0xf'));var authService=require(_0xea61('0x10'));var qs=require(_0xea61('0x11'));var as=require(_0xea61('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea61('0x13'));var utils=require(_0xea61('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xea61('0x15'));var db=require(_0xea61('0x16'))['db'];function respondWithStatusCode(_0x38c71c,_0x2c76d7){_0x2c76d7=_0x2c76d7||0xcc;return function(_0x4efe6a){if(_0x4efe6a){return _0x38c71c[_0xea61('0x17')](_0x2c76d7);}return _0x38c71c['status'](_0x2c76d7)[_0xea61('0x18')]();};}function respondWithResult(_0xd5b95,_0x9f738f){_0x9f738f=_0x9f738f||0xc8;return function(_0x55e299){if(_0x55e299){return _0xd5b95[_0xea61('0x19')](_0x9f738f)['json'](_0x55e299);}};}function respondWithFilteredResult(_0x31cc67,_0x433148){return function(_0x2cb14d){if(_0x2cb14d){var _0x407afc=typeof _0x433148['offset']===_0xea61('0x1a')&&typeof _0x433148['limit']===_0xea61('0x1a');var _0xa1c9fa=_0x2cb14d[_0xea61('0x1b')];var _0x4b4402=_0x407afc?0x0:_0x433148[_0xea61('0x1c')];var _0x1aa3c0=_0x407afc?_0x2cb14d[_0xea61('0x1b')]:_0x433148[_0xea61('0x1c')]+_0x433148[_0xea61('0x1d')];var _0x4394c2;if(_0x1aa3c0>=_0xa1c9fa){_0x1aa3c0=_0xa1c9fa;_0x4394c2=0xc8;}else{_0x4394c2=0xce;}_0x31cc67[_0xea61('0x19')](_0x4394c2);return _0x31cc67[_0xea61('0x1e')](_0xea61('0x1f'),_0x4b4402+'-'+_0x1aa3c0+'/'+_0xa1c9fa)[_0xea61('0x20')](_0x2cb14d);}return null;};}function patchUpdates(_0x242569){return function(_0x550773){try{jsonpatch[_0xea61('0x21')](_0x550773,_0x242569,!![]);}catch(_0x34a9b5){return BPromise['reject'](_0x34a9b5);}return _0x550773[_0xea61('0x22')]();};}function saveUpdates(_0x39bca4,_0x439e9c){return function(_0x4e42e3){if(_0x4e42e3){return _0x4e42e3[_0xea61('0x23')](_0x39bca4)[_0xea61('0x24')](function(_0x51d9c7){return _0x51d9c7;});}return null;};}function removeEntity(_0x25a30f,_0x1f4339){return function(_0x14d0ef){if(_0x14d0ef){return _0x14d0ef[_0xea61('0x25')]()[_0xea61('0x24')](function(){_0x25a30f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5256c2,_0x35fb93){return function(_0x2377de){if(!_0x2377de){_0x5256c2['sendStatus'](0x194);}return _0x2377de;};}function handleError(_0x69822d,_0x355797){_0x355797=_0x355797||0x1f4;return function(_0x1680ab){logger[_0xea61('0x26')](_0x1680ab[_0xea61('0x27')]);if(_0x1680ab[_0xea61('0x28')]){delete _0x1680ab['name'];}_0x69822d[_0xea61('0x19')](_0x355797)[_0xea61('0x29')](_0x1680ab);};}exports[_0xea61('0x2a')]=function(_0x5a758e,_0xc1489e){var _0x394c20={},_0x31536d={},_0x173493={'count':0x0,'rows':[]};var _0x29508d=_['map'](db[_0xea61('0x2b')][_0xea61('0x2c')],function(_0xc64636){return{'name':_0xc64636[_0xea61('0x2d')],'type':_0xc64636[_0xea61('0x2e')]['key']};});_0x31536d[_0xea61('0x2f')]=_[_0xea61('0x30')](_0x29508d,'name');_0x31536d[_0xea61('0x31')]=_[_0xea61('0x32')](_0x5a758e[_0xea61('0x31')]);_0x31536d[_0xea61('0x33')]=_['intersection'](_0x31536d[_0xea61('0x2f')],_0x31536d[_0xea61('0x31')]);_0x394c20['attributes']=_['intersection'](_0x31536d[_0xea61('0x2f')],qs['fields'](_0x5a758e[_0xea61('0x31')][_0xea61('0x34')]));_0x394c20[_0xea61('0x35')]=_0x394c20[_0xea61('0x35')][_0xea61('0x36')]?_0x394c20[_0xea61('0x35')]:_0x31536d[_0xea61('0x2f')];if(!_0x5a758e[_0xea61('0x31')][_0xea61('0x37')](_0xea61('0x38'))){_0x394c20[_0xea61('0x1d')]=qs[_0xea61('0x1d')](_0x5a758e['query'][_0xea61('0x1d')]);_0x394c20[_0xea61('0x1c')]=qs[_0xea61('0x1c')](_0x5a758e[_0xea61('0x31')][_0xea61('0x1c')]);}_0x394c20['order']=qs[_0xea61('0x39')](_0x5a758e[_0xea61('0x31')][_0xea61('0x39')]);_0x394c20[_0xea61('0x3a')]=qs[_0xea61('0x33')](_[_0xea61('0x3b')](_0x5a758e[_0xea61('0x31')],_0x31536d[_0xea61('0x33')]),_0x29508d);if(_0x5a758e[_0xea61('0x31')]['filter']){_0x394c20[_0xea61('0x3a')]=_[_0xea61('0x3c')](_0x394c20['where'],{'$or':_[_0xea61('0x30')](_0x29508d,function(_0x40c554){if(_0x40c554[_0xea61('0x2e')]!==_0xea61('0x3d')){var _0x38b7f6={};_0x38b7f6[_0x40c554['name']]={'$like':'%'+_0x5a758e[_0xea61('0x31')][_0xea61('0x3e')]+'%'};return _0x38b7f6;}})});}_0x394c20=_['merge']({},_0x394c20,_0x5a758e[_0xea61('0x3f')]);var _0x3ad458={'where':_0x394c20['where']};return db[_0xea61('0x2b')][_0xea61('0x1b')](_0x3ad458)[_0xea61('0x24')](function(_0xf931fb){_0x173493[_0xea61('0x1b')]=_0xf931fb;if(_0x5a758e[_0xea61('0x31')][_0xea61('0x40')]){_0x394c20['include']=[{'all':!![]}];}return db[_0xea61('0x2b')][_0xea61('0x41')](_0x394c20);})[_0xea61('0x24')](function(_0x43bd4c){_0x173493[_0xea61('0x42')]=_0x43bd4c;return _0x173493;})[_0xea61('0x24')](respondWithFilteredResult(_0xc1489e,_0x394c20))[_0xea61('0x43')](handleError(_0xc1489e,null));};exports[_0xea61('0x44')]=function(_0x589104,_0x39f70b){var _0x27e460={'raw':!![],'where':{'id':_0x589104['params']['id']}},_0x47a5a0={};_0x47a5a0[_0xea61('0x2f')]=_['keys'](db[_0xea61('0x2b')][_0xea61('0x2c')]);_0x47a5a0[_0xea61('0x31')]=_[_0xea61('0x32')](_0x589104[_0xea61('0x31')]);_0x47a5a0[_0xea61('0x33')]=_[_0xea61('0x45')](_0x47a5a0['model'],_0x47a5a0[_0xea61('0x31')]);_0x27e460[_0xea61('0x35')]=_[_0xea61('0x45')](_0x47a5a0['model'],qs[_0xea61('0x34')](_0x589104[_0xea61('0x31')][_0xea61('0x34')]));_0x27e460['attributes']=_0x27e460[_0xea61('0x35')][_0xea61('0x36')]?_0x27e460[_0xea61('0x35')]:_0x47a5a0['model'];if(_0x589104[_0xea61('0x31')][_0xea61('0x40')]){_0x27e460[_0xea61('0x46')]=[{'all':!![]}];}_0x27e460=_['merge']({},_0x27e460,_0x589104[_0xea61('0x3f')]);return db['VoiceQueuesLog'][_0xea61('0x47')](_0x27e460)[_0xea61('0x24')](handleEntityNotFound(_0x39f70b,null))[_0xea61('0x24')](respondWithResult(_0x39f70b,null))['catch'](handleError(_0x39f70b,null));};exports[_0xea61('0x48')]=function(_0x2b22cc,_0x1b8e92){return db[_0xea61('0x2b')][_0xea61('0x48')](_0x2b22cc[_0xea61('0x49')],{})[_0xea61('0x24')](respondWithResult(_0x1b8e92,0xc9))[_0xea61('0x43')](handleError(_0x1b8e92,null));};exports[_0xea61('0x23')]=function(_0x46539b,_0x1b49c8){if(_0x46539b['body']['id']){delete _0x46539b[_0xea61('0x49')]['id'];}return db['VoiceQueuesLog'][_0xea61('0x47')]({'where':{'id':_0x46539b['params']['id']}})[_0xea61('0x24')](handleEntityNotFound(_0x1b49c8,null))[_0xea61('0x24')](saveUpdates(_0x46539b['body'],null))['then'](respondWithResult(_0x1b49c8,null))[_0xea61('0x43')](handleError(_0x1b49c8,null));};exports[_0xea61('0x25')]=function(_0x326696,_0x2abfe7){return db[_0xea61('0x2b')][_0xea61('0x47')]({'where':{'id':_0x326696['params']['id']}})['then'](handleEntityNotFound(_0x2abfe7,null))[_0xea61('0x24')](removeEntity(_0x2abfe7,null))[_0xea61('0x43')](handleError(_0x2abfe7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index abf2e93..cdc9ec3 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 _0x0fd8=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util'];(function(_0x1516b3,_0x53c54f){var _0x168473=function(_0x23f443){while(--_0x23f443){_0x1516b3['push'](_0x1516b3['shift']());}};_0x168473(++_0x53c54f);}(_0x0fd8,0x94));var _0x80fd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0fd8[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x80fd('0x0'));var util=require(_0x80fd('0x1'));var logger=require(_0x80fd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x80fd('0x3'));var rp=require(_0x80fd('0x4'));var fs=require('fs');var path=require(_0x80fd('0x5'));var rimraf=require(_0x80fd('0x6'));var config=require(_0x80fd('0x7'));var attributes=require(_0x80fd('0x8'));module[_0x80fd('0x9')]=function(_0x297d37,_0x29773f){return _0x297d37[_0x80fd('0xa')](_0x80fd('0xb'),attributes,{'tableName':_0x80fd('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x80fd('0xd'),_0x80fd('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6b64=['../../config/logger','api','path','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x6b64,0x6a));var _0x46b6=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x6b64[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x46b6('0x0'));var util=require(_0x46b6('0x1'));var logger=require(_0x46b6('0x2'))(_0x46b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46b6('0x4'));var rimraf=require('rimraf');var config=require(_0x46b6('0x5'));var attributes=require(_0x46b6('0x6'));module['exports']=function(_0x2f170e,_0x4b0197){return _0x2f170e[_0x46b6('0x7')](_0x46b6('0x8'),attributes,{'tableName':_0x46b6('0x9'),'paranoid':![],'indexes':[{'name':_0x46b6('0xa'),'fields':['event',_0x46b6('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 4e388f6..55f2b7d 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 _0x05bf=['client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51c1a4,_0x1df858){var _0xfddb8a=function(_0x279900){while(--_0x279900){_0x51c1a4['push'](_0x51c1a4['shift']());}};_0xfddb8a(++_0x1df858);}(_0x05bf,0x77));var _0xf05b=function(_0x4606cf,_0xdf3546){_0x4606cf=_0x4606cf-0x0;var _0x1cb4ad=_0x05bf[_0x4606cf];return _0x1cb4ad;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var moment=require(_0xf05b('0x2'));var BPromise=require(_0xf05b('0x3'));var rs=require(_0xf05b('0x4'));var fs=require('fs');var Redis=require(_0xf05b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf05b('0x6'));var logger=require(_0xf05b('0x7'))(_0xf05b('0x8'));var config=require(_0xf05b('0x9'));var jayson=require(_0xf05b('0xa'));var client=jayson[_0xf05b('0xb')][_0xf05b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574ba2,_0x3e4938,_0x50d2f8){return new BPromise(function(_0x3be213,_0x55353d){return client[_0xf05b('0xd')](_0x574ba2,_0x50d2f8)[_0xf05b('0xe')](function(_0x811024){logger[_0xf05b('0xf')](_0xf05b('0x10'),_0x3e4938,_0xf05b('0x11'));logger[_0xf05b('0x12')](_0xf05b('0x13'),_0x3e4938,_0xf05b('0x11'),JSON[_0xf05b('0x14')](_0x811024));if(_0x811024[_0xf05b('0x15')]){if(_0x811024[_0xf05b('0x15')][_0xf05b('0x16')]===0x1f4){logger[_0xf05b('0x15')](_0xf05b('0x10'),_0x3e4938,_0x811024[_0xf05b('0x15')][_0xf05b('0x17')]);return _0x55353d(_0x811024[_0xf05b('0x15')][_0xf05b('0x17')]);}logger[_0xf05b('0x15')](_0xf05b('0x10'),_0x3e4938,_0x811024['error'][_0xf05b('0x17')]);return _0x3be213(_0x811024[_0xf05b('0x15')][_0xf05b('0x17')]);}else{logger[_0xf05b('0xf')](_0xf05b('0x10'),_0x3e4938,_0xf05b('0x11'));_0x3be213(_0x811024[_0xf05b('0x18')][_0xf05b('0x17')]);}})[_0xf05b('0x19')](function(_0x31c1e2){logger[_0xf05b('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3e4938,_0x31c1e2);_0x55353d(_0x31c1e2);});});} \ No newline at end of file +var _0x4cc4=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message'];(function(_0x2d3edc,_0x4feda3){var _0x23a1c6=function(_0x18017c){while(--_0x18017c){_0x2d3edc['push'](_0x2d3edc['shift']());}};_0x23a1c6(++_0x4feda3);}(_0x4cc4,0x6f));var _0x44cc=function(_0x2668c9,_0xfec1e9){_0x2668c9=_0x2668c9-0x0;var _0xcbac8d=_0x4cc4[_0x2668c9];return _0xcbac8d;};'use strict';var _=require('lodash');var util=require(_0x44cc('0x0'));var moment=require(_0x44cc('0x1'));var BPromise=require(_0x44cc('0x2'));var rs=require(_0x44cc('0x3'));var fs=require('fs');var Redis=require(_0x44cc('0x4'));var db=require(_0x44cc('0x5'))['db'];var utils=require(_0x44cc('0x6'));var logger=require(_0x44cc('0x7'))(_0x44cc('0x8'));var config=require(_0x44cc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x44cc('0xa')][_0x44cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x936ff8,_0x28b04b,_0x26e496){return new BPromise(function(_0x201a6e,_0x1ff819){return client[_0x44cc('0xc')](_0x936ff8,_0x26e496)['then'](function(_0x301abe){logger[_0x44cc('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28b04b,_0x44cc('0xe'));logger[_0x44cc('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x28b04b,'request\x20sent',JSON[_0x44cc('0x10')](_0x301abe));if(_0x301abe['error']){if(_0x301abe[_0x44cc('0x11')][_0x44cc('0x12')]===0x1f4){logger[_0x44cc('0x11')](_0x44cc('0x13'),_0x28b04b,_0x301abe[_0x44cc('0x11')][_0x44cc('0x14')]);return _0x1ff819(_0x301abe[_0x44cc('0x11')][_0x44cc('0x14')]);}logger[_0x44cc('0x11')](_0x44cc('0x13'),_0x28b04b,_0x301abe[_0x44cc('0x11')][_0x44cc('0x14')]);return _0x201a6e(_0x301abe[_0x44cc('0x11')]['message']);}else{logger[_0x44cc('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28b04b,_0x44cc('0xe'));_0x201a6e(_0x301abe['result'][_0x44cc('0x14')]);}})[_0x44cc('0x15')](function(_0x3440ae){logger[_0x44cc('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x28b04b,_0x3440ae);_0x1ff819(_0x3440ae);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index bc23541..99f8a49 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 _0xe815=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','/:id'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0xe815,0x1cc));var _0x5e81=function(_0x488c16,_0x31dcf2){_0x488c16=_0x488c16-0x0;var _0x849fa9=_0xe815[_0x488c16];return _0x849fa9;};'use strict';var multer=require(_0x5e81('0x0'));var util=require('util');var path=require(_0x5e81('0x1'));var timeout=require(_0x5e81('0x2'));var express=require(_0x5e81('0x3'));var router=express['Router']();var fs_extra=require(_0x5e81('0x4'));var auth=require(_0x5e81('0x5'));var interaction=require(_0x5e81('0x6'));var config=require(_0x5e81('0x7'));var controller=require(_0x5e81('0x8'));router['get']('/',auth[_0x5e81('0x9')](),controller[_0x5e81('0xa')]);router[_0x5e81('0xb')](_0x5e81('0xc'),auth[_0x5e81('0x9')](),controller['describe']);router[_0x5e81('0xb')]('/:id',auth[_0x5e81('0x9')](),controller[_0x5e81('0xd')]);router[_0x5e81('0xb')](_0x5e81('0xe'),auth[_0x5e81('0x9')](),controller[_0x5e81('0xf')]);router['get'](_0x5e81('0x10'),controller['downloads']);router[_0x5e81('0xb')](_0x5e81('0x11'),auth[_0x5e81('0x9')](),controller[_0x5e81('0x12')]);router[_0x5e81('0x13')]('/',auth[_0x5e81('0x9')](),controller[_0x5e81('0x14')]);router['post'](_0x5e81('0x11'),auth[_0x5e81('0x9')](),controller[_0x5e81('0x15')]);router[_0x5e81('0x16')]('/:id',auth[_0x5e81('0x9')](),controller[_0x5e81('0x17')]);router[_0x5e81('0x18')](_0x5e81('0x19'),auth[_0x5e81('0x9')](),controller[_0x5e81('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x69f4=['downloadTranscribe','post','runTranscribe','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../config/environment','./voiceRecording.controller','index','isAuthenticated','describe','get','/:id','/:id/download','download','/:id/downloads'];(function(_0x18c1bd,_0x3d87f5){var _0x435aa8=function(_0x5645d8){while(--_0x5645d8){_0x18c1bd['push'](_0x18c1bd['shift']());}};_0x435aa8(++_0x3d87f5);}(_0x69f4,0x1eb));var _0x469f=function(_0x32e57a,_0x3d5c3d){_0x32e57a=_0x32e57a-0x0;var _0x493891=_0x69f4[_0x32e57a];return _0x493891;};'use strict';var multer=require(_0x469f('0x0'));var util=require(_0x469f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x469f('0x2'));var router=express[_0x469f('0x3')]();var fs_extra=require(_0x469f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x469f('0x5'));var controller=require(_0x469f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x469f('0x7')]);router['get']('/describe',auth[_0x469f('0x8')](),controller[_0x469f('0x9')]);router[_0x469f('0xa')](_0x469f('0xb'),auth[_0x469f('0x8')](),controller['show']);router['get'](_0x469f('0xc'),auth['isAuthenticated'](),controller[_0x469f('0xd')]);router[_0x469f('0xa')](_0x469f('0xe'),controller['downloads']);router[_0x469f('0xa')]('/:id/transcribe',auth[_0x469f('0x8')](),controller[_0x469f('0xf')]);router[_0x469f('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x469f('0x10')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x469f('0x11')]);router[_0x469f('0x12')](_0x469f('0xb'),auth['isAuthenticated'](),controller[_0x469f('0x13')]);router[_0x469f('0x14')](_0x469f('0xb'),auth[_0x469f('0x8')](),controller[_0x469f('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 814ad19..6201451 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 203fbba..2fe1664 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 _0xa92d=['push','recording','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','sentiment','language','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','runSentiment','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','save','update','then','destroy','error','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','filters','model','attributes','intersection','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','secrets','value','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','downloads','sequelize','MD5','col','token'];(function(_0xc889e1,_0x438415){var _0x17ab9e=function(_0x1ae369){while(--_0x1ae369){_0xc889e1['push'](_0xc889e1['shift']());}};_0x17ab9e(++_0x438415);}(_0xa92d,0x1ef));var _0xda92=function(_0x36852e,_0x4a95d8){_0x36852e=_0x36852e-0x0;var _0x6a859a=_0xa92d[_0x36852e];return _0x6a859a;};'use strict';var emlformat=require(_0xda92('0x0'));var rimraf=require(_0xda92('0x1'));var zipdir=require(_0xda92('0x2'));var jsonpatch=require(_0xda92('0x3'));var rp=require(_0xda92('0x4'));var moment=require(_0xda92('0x5'));var BPromise=require(_0xda92('0x6'));var Mustache=require('mustache');var util=require(_0xda92('0x7'));var path=require('path');var sox=require(_0xda92('0x8'));var csv=require(_0xda92('0x9'));var ejs=require(_0xda92('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda92('0xb'));var squel=require(_0xda92('0xc'));var crypto=require(_0xda92('0xd'));var jsforce=require(_0xda92('0xe'));var deskjs=require(_0xda92('0xf'));var toCsv=require(_0xda92('0x9'));var querystring=require(_0xda92('0x10'));var Papa=require(_0xda92('0x11'));var AWS=require(_0xda92('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0xda92('0x13'));var authService=require(_0xda92('0x14'));var qs=require(_0xda92('0x15'));var as=require(_0xda92('0x16'));var hardwareService=require(_0xda92('0x17'));var logger=require(_0xda92('0x18'))(_0xda92('0x19'));var utils=require('../../config/utils');var config=require(_0xda92('0x1a'));var licenseUtil=require(_0xda92('0x1b'));var db=require(_0xda92('0x1c'))['db'];function respondWithStatusCode(_0xadd77a,_0x151622){_0x151622=_0x151622||0xcc;return function(_0x424b74){if(_0x424b74){return _0xadd77a[_0xda92('0x1d')](_0x151622);}return _0xadd77a[_0xda92('0x1e')](_0x151622)[_0xda92('0x1f')]();};}function respondWithResult(_0x2b8513,_0x43472a){_0x43472a=_0x43472a||0xc8;return function(_0x44cf1e){if(_0x44cf1e){return _0x2b8513[_0xda92('0x1e')](_0x43472a)[_0xda92('0x20')](_0x44cf1e);}};}function respondWithFilteredResult(_0x286ad6,_0x5cfbaa){return function(_0x364dea){if(_0x364dea){var _0xd44493=typeof _0x5cfbaa['offset']==='undefined'&&typeof _0x5cfbaa[_0xda92('0x21')]===_0xda92('0x22');var _0x294241=_0x364dea['count'];var _0x4bf8bd=_0xd44493?0x0:_0x5cfbaa[_0xda92('0x23')];var _0x4cebc2=_0xd44493?_0x364dea[_0xda92('0x24')]:_0x5cfbaa[_0xda92('0x23')]+_0x5cfbaa[_0xda92('0x21')];var _0x3f7a2b;if(_0x4cebc2>=_0x294241){_0x4cebc2=_0x294241;_0x3f7a2b=0xc8;}else{_0x3f7a2b=0xce;}_0x286ad6['status'](_0x3f7a2b);return _0x286ad6[_0xda92('0x25')]('Content-Range',_0x4bf8bd+'-'+_0x4cebc2+'/'+_0x294241)[_0xda92('0x20')](_0x364dea);}return null;};}function patchUpdates(_0x5709ef){return function(_0x1bd649){try{jsonpatch[_0xda92('0x26')](_0x1bd649,_0x5709ef,!![]);}catch(_0x4c5a7c){return BPromise['reject'](_0x4c5a7c);}return _0x1bd649[_0xda92('0x27')]();};}function saveUpdates(_0x5854d5,_0x5653ef){return function(_0x479587){if(_0x479587){return _0x479587[_0xda92('0x28')](_0x5854d5)[_0xda92('0x29')](function(_0x4a848d){return _0x4a848d;});}return null;};}function removeEntity(_0x29ac45,_0x2dea10){return function(_0x37bbe2){if(_0x37bbe2){return _0x37bbe2[_0xda92('0x2a')]()[_0xda92('0x29')](function(){_0x29ac45[_0xda92('0x1e')](0xcc)[_0xda92('0x1f')]();});}};}function handleEntityNotFound(_0xc80458,_0x4391ea){return function(_0x10cc79){if(!_0x10cc79){_0xc80458['sendStatus'](0x194);}return _0x10cc79;};}function handleError(_0x56ec1f,_0x1139f2){_0x1139f2=_0x1139f2||0x1f4;return function(_0x493e35){logger[_0xda92('0x2b')](_0x493e35['stack']);if(_0x493e35[_0xda92('0x2c')]){delete _0x493e35[_0xda92('0x2c')];}_0x56ec1f[_0xda92('0x1e')](_0x1139f2)['send'](_0x493e35);};}exports[_0xda92('0x2d')]=function(_0x105a16,_0x46fdb7){var _0x50adf9={},_0x35b92b={},_0x5625f4={'count':0x0,'rows':[]};var _0x8cce1c=_[_0xda92('0x2e')](db[_0xda92('0x2f')][_0xda92('0x30')],function(_0x130f90){return{'name':_0x130f90[_0xda92('0x31')],'type':_0x130f90[_0xda92('0x32')][_0xda92('0x33')]};});_0x35b92b['model']=_[_0xda92('0x34')](_['map'](_0x8cce1c,_0xda92('0x2c')),[_0xda92('0x35')]);_0x35b92b['query']=_['keys'](_0x105a16[_0xda92('0x36')]);_0x35b92b[_0xda92('0x37')]=_['intersection'](_0x35b92b[_0xda92('0x38')],_0x35b92b[_0xda92('0x36')]);_0x50adf9[_0xda92('0x39')]=_[_0xda92('0x3a')](_0x35b92b[_0xda92('0x38')],qs[_0xda92('0x3b')](_0x105a16[_0xda92('0x36')][_0xda92('0x3b')]));_0x50adf9[_0xda92('0x39')]=_0x50adf9[_0xda92('0x39')]['length']?_0x50adf9[_0xda92('0x39')]:_0x35b92b['model'];if(!_0x105a16['query']['hasOwnProperty'](_0xda92('0x3c'))){_0x50adf9['limit']=qs[_0xda92('0x21')](_0x105a16[_0xda92('0x36')]['limit']);_0x50adf9[_0xda92('0x23')]=qs[_0xda92('0x23')](_0x105a16[_0xda92('0x36')]['offset']);}_0x50adf9['order']=qs[_0xda92('0x3d')](_0x105a16[_0xda92('0x36')][_0xda92('0x3d')]);_0x50adf9['where']=qs['filters'](_[_0xda92('0x3e')](_0x105a16[_0xda92('0x36')],_0x35b92b[_0xda92('0x37')]),_0x8cce1c);if(_0x105a16['query']['filter']){_0x50adf9[_0xda92('0x3f')]=_[_0xda92('0x40')](_0x50adf9['where'],{'$or':_[_0xda92('0x2e')](_0x8cce1c,function(_0x2a0039){if(_0x2a0039[_0xda92('0x32')]!==_0xda92('0x41')){var _0x5b6f38={};_0x5b6f38[_0x2a0039[_0xda92('0x2c')]]={'$like':'%'+_0x105a16[_0xda92('0x36')][_0xda92('0x42')]+'%'};return _0x5b6f38;}})});}_0x50adf9=_['merge']({},_0x50adf9,_0x105a16[_0xda92('0x43')]);var _0x2e17f4={'where':_0x50adf9[_0xda92('0x3f')]};return db[_0xda92('0x2f')][_0xda92('0x24')](_0x2e17f4)[_0xda92('0x29')](function(_0x327175){_0x5625f4[_0xda92('0x24')]=_0x327175;if(_0x105a16[_0xda92('0x36')][_0xda92('0x44')]){_0x50adf9[_0xda92('0x45')]=[{'all':!![]}];}return db[_0xda92('0x2f')][_0xda92('0x46')](_0x50adf9);})[_0xda92('0x29')](function(_0x1be43b){_0x5625f4[_0xda92('0x47')]=_0x1be43b;return _0x5625f4;})[_0xda92('0x29')](respondWithFilteredResult(_0x46fdb7,_0x50adf9))['catch'](handleError(_0x46fdb7,null));};exports[_0xda92('0x48')]=function(_0x557a69,_0x5ba38f){var _0xba3702={'raw':![],'where':{'id':_0x557a69[_0xda92('0x49')]['id']}},_0x2edd71={};_0x2edd71[_0xda92('0x38')]=_[_0xda92('0x4a')](db['VoiceRecording']['rawAttributes']);_0x2edd71['query']=_['keys'](_0x557a69[_0xda92('0x36')]);_0x2edd71['filters']=_['intersection'](_0x2edd71[_0xda92('0x38')],_0x2edd71[_0xda92('0x36')]);_0xba3702[_0xda92('0x39')]=_[_0xda92('0x3a')](_0x2edd71[_0xda92('0x38')],qs[_0xda92('0x3b')](_0x557a69[_0xda92('0x36')][_0xda92('0x3b')]));_0xba3702[_0xda92('0x39')]=_0xba3702[_0xda92('0x39')][_0xda92('0x4b')]?_0xba3702[_0xda92('0x39')]:_0x2edd71['model'];if(_0x557a69[_0xda92('0x36')]['includeAll']){_0xba3702[_0xda92('0x45')]=[{'all':!![]}];}_0xba3702=_[_0xda92('0x40')]({},_0xba3702,_0x557a69[_0xda92('0x43')]);return db[_0xda92('0x2f')][_0xda92('0x4c')](_0xba3702)[_0xda92('0x29')](handleEntityNotFound(_0x5ba38f,null))[_0xda92('0x29')](respondWithResult(_0x5ba38f,null))[_0xda92('0x4d')](handleError(_0x5ba38f,null));};exports[_0xda92('0x4e')]=function(_0x5d8e62,_0x4a0a8e){return db[_0xda92('0x2f')][_0xda92('0x4e')](_0x5d8e62[_0xda92('0x4f')],{})[_0xda92('0x29')](respondWithResult(_0x4a0a8e,0xc9))[_0xda92('0x4d')](handleError(_0x4a0a8e,null));};exports[_0xda92('0x28')]=function(_0x3cb866,_0x30da5e){if(_0x3cb866[_0xda92('0x4f')]['id']){delete _0x3cb866['body']['id'];}return db[_0xda92('0x2f')][_0xda92('0x4c')]({'where':{'id':_0x3cb866[_0xda92('0x49')]['id']}})['then'](handleEntityNotFound(_0x30da5e,null))['then'](saveUpdates(_0x3cb866[_0xda92('0x4f')],null))[_0xda92('0x29')](respondWithResult(_0x30da5e,null))[_0xda92('0x4d')](handleError(_0x30da5e,null));};exports[_0xda92('0x50')]=function(_0x2f90a2,_0x171c4a){return db[_0xda92('0x2f')][_0xda92('0x50')]()[_0xda92('0x29')](respondWithResult(_0x171c4a,null))[_0xda92('0x4d')](handleError(_0x171c4a,null));};exports[_0xda92('0x51')]=function(_0x33a8aa,_0x34846b,_0x1aaec3){var _0x1b1a42=require(_0xda92('0x52'));var _0x5cdfae=![];var _0x3e63f0={};if(_0x33a8aa[_0xda92('0x36')]['type']&&_0x33a8aa['query'][_0xda92('0x32')]==='uniqueid'){_0x3e63f0[_0xda92('0x53')]=_0x33a8aa[_0xda92('0x49')]['id'];}else{_0x3e63f0['id']=_0x33a8aa['params']['id'];}return db[_0xda92('0x2f')][_0xda92('0x4c')]({'where':_0x3e63f0,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x34846b,null))['then'](function(_0xafc2d3){if(_0xafc2d3){var _0x54f01a=_0xafc2d3['value'];var _0xb32079=util[_0xda92('0x35')](_0xda92('0x54'),_0x54f01a);if(fs[_0xda92('0x55')](_0xb32079)){_0x5cdfae=!![];return _0x1b1a42[_0xda92('0x56')](_0xb32079,_0x54f01a,config[_0xda92('0x57')]['recording'])[_0xda92('0x29')](function(){return _0xafc2d3;});}return _0xafc2d3;}})['then'](function(_0x1cf034){if(_0x1cf034){var _0x25e62d=_0x1cf034[_0xda92('0x58')];if(!fs[_0xda92('0x55')](_0x25e62d)){throw new db['Sequelize'][(_0xda92('0x59'))](_0xda92('0x5a'));}if(_0x1cf034['filename']){return _0x34846b[_0xda92('0x51')](_0x25e62d,_0x1cf034[_0xda92('0x5b')]+path[_0xda92('0x5c')](_0x25e62d),function(){if(_0x5cdfae){fs[_0xda92('0x5d')](_0x25e62d);}});}else{return _0x34846b[_0xda92('0x51')](_0x25e62d,function(_0x3b24fa){if(_0x5cdfae){fs[_0xda92('0x5d')](_0x25e62d);}});}}})[_0xda92('0x4d')](function(_0x418cb1){if(_0x418cb1['message']==='VoiceRecording\x20not\x20found'){_0x34846b[_0xda92('0x1e')](0x194)[_0xda92('0x5e')](_0xda92('0x5f'));}else{return handleError(_0x34846b,null);}});};exports[_0xda92('0x60')]=function(_0x275c28,_0x32680e,_0x2c8d48){var _0x2ff546=require('../../components/encryptor');var _0x2ae11a=![];var _0x2cb07e={'$and':[db[_0xda92('0x61')][_0xda92('0x3f')](db[_0xda92('0x61')]['fn'](_0xda92('0x62'),db['sequelize'][_0xda92('0x63')]('uniqueid')),_0x275c28[_0xda92('0x36')][_0xda92('0x64')])]};if(_0x275c28[_0xda92('0x36')][_0xda92('0x32')]&&_0x275c28[_0xda92('0x36')][_0xda92('0x32')]===_0xda92('0x53')){_0x2cb07e['$and'][_0xda92('0x65')]({'uniqueid':_0x275c28['params']['id']});}else{_0x2cb07e['$and'][_0xda92('0x65')]({'id':_0x275c28['params']['id']});}return db['VoiceRecording'][_0xda92('0x4c')]({'where':_0x2cb07e,'attributes':['id',_0xda92('0x58')],'raw':!![]})[_0xda92('0x29')](handleEntityNotFound(_0x32680e,null))['then'](function(_0x43d07a){if(_0x43d07a){var _0x236ea0=util['format'](_0xda92('0x54'),_0x43d07a[_0xda92('0x58')]);if(fs['existsSync'](_0x236ea0)){_0x2ae11a=!![];return _0x2ff546[_0xda92('0x56')](_0x236ea0,_0x43d07a[_0xda92('0x58')],config['secrets'][_0xda92('0x66')])[_0xda92('0x29')](function(){return _0x43d07a;});}return _0x43d07a;}})[_0xda92('0x29')](function(_0x44891d){if(_0x44891d){if(!fs['existsSync'](_0x44891d[_0xda92('0x58')])){throw new db[(_0xda92('0x67'))][(_0xda92('0x59'))](_0xda92('0x5a'));}if(_0x44891d[_0xda92('0x5b')]){return _0x32680e[_0xda92('0x51')](_0x44891d[_0xda92('0x58')],_0x44891d[_0xda92('0x5b')]+path['extname'](_0x44891d['value']),function(){if(_0x2ae11a){fs[_0xda92('0x5d')](_0x44891d[_0xda92('0x58')]);}});}else{return _0x32680e[_0xda92('0x51')](_0x44891d[_0xda92('0x58')],function(_0x24cad7){if(_0x2ae11a){fs[_0xda92('0x5d')](_0x44891d[_0xda92('0x58')]);}});}}})[_0xda92('0x4d')](handleError(_0x32680e,null));};exports['destroy']=function(_0x161b73,_0x25ba15){return db['VoiceRecording'][_0xda92('0x4c')]({'where':{'id':_0x161b73[_0xda92('0x49')]['id']}})[_0xda92('0x29')](function(_0x68c55e){if(_[_0xda92('0x68')](_0x68c55e)){throw new ReferenceError(_0xda92('0x69'));}return _0x68c55e;})['then'](function(_0x531437){var _0x4f2585=_0x531437[_0xda92('0x58')];logger[_0xda92('0x6a')](_0xda92('0x6b'),_0x4f2585);if(!_[_0xda92('0x68')](_0x531437[_0xda92('0x58')])&&fs[_0xda92('0x55')](_0x4f2585)){logger[_0xda92('0x6a')](_0xda92('0x6c')+_0x4f2585+_0xda92('0x6d'));fs['unlinkSync'](_0x4f2585);}_0x4f2585=_0x4f2585+_0xda92('0x6e');if(!_[_0xda92('0x68')](_0x531437[_0xda92('0x58')])&&fs['existsSync'](_0x4f2585)){logger[_0xda92('0x6a')]('File:\x20\x22'+_0x4f2585+_0xda92('0x6d'));fs[_0xda92('0x6f')](_0x4f2585);}return _0x531437;})[_0xda92('0x29')](function(_0x487c8d){if(!_0x487c8d)throw new InternalError();return _0x487c8d[_0xda92('0x2a')]();})[_0xda92('0x29')](function(){_0x25ba15[_0xda92('0x1e')](0xcc)[_0xda92('0x1f')]();})[_0xda92('0x4d')](handleError(_0x25ba15,null));};function getBucketslist(_0x526175,_0x434ec8,_0xc98405){return new Promise(function(_0x4eae7e,_0x5245dc){var _0x2360ce=new AWS['S3']({'accessKeyId':_0x434ec8,'secretAccessKey':_0x526175,'region':_0xc98405});_0x2360ce[_0xda92('0x70')]({},function(_0x350c16,_0x577f94){if(_0x350c16){return _0x5245dc(_0x350c16);}else{return _0x4eae7e(_0x577f94);}});});}function createBucket(_0x3c6ba2,_0x38fca9,_0x38f71c,_0x23d7ca){return new Promise(function(_0x29a63a,_0x2e0435){var _0x4da37b=new AWS['S3']({'accessKeyId':_0x38fca9,'secretAccessKey':_0x3c6ba2,'region':_0x38f71c});_0x4da37b[_0xda92('0x71')]({'Bucket':_0x23d7ca},function(_0x557734,_0x3067aa){if(_0x557734){return _0x2e0435(_0x557734);}else{return _0x29a63a(_0x3067aa);}});});}function uploadFile(_0x46fd8b,_0x1f7422,_0x5f16d8,_0x3c2eff,_0x6343d8,_0x5c576a){return new Promise(function(_0x2b683e,_0x81b9b9){var _0x2163a8=new AWS['S3']({'accessKeyId':_0x1f7422,'secretAccessKey':_0x46fd8b,'region':_0x5f16d8});_0x2163a8[_0xda92('0x72')]({'Bucket':_0x3c2eff,'Key':_0x6343d8,'Body':_0x5c576a},function(_0xea7470,_0x20fb69){if(_0xea7470){return _0x81b9b9(_0xea7470);}else{return _0x2b683e(_0x20fb69);}});});}function startTranscribe(_0x35ce17,_0x59e2bf,_0x4001c,_0x14872d,_0x30ca9b,_0x3518ba){return new Promise(function(_0x597025,_0x22f619){var _0x3734b2=new AWS['TranscribeService']({'accessKeyId':_0x59e2bf,'secretAccessKey':_0x35ce17,'region':_0x4001c});_0x3734b2['startTranscriptionJob']({'TranscriptionJobName':_0x14872d,'LanguageCode':_0x30ca9b,'Media':{'MediaFileUri':_0x3518ba}},function(_0x5aebe0,_0x4be2e0){if(_0x5aebe0){return _0x22f619(_0x5aebe0);}else{return _0x597025(_0x4be2e0);}});});}function transcribe(_0x2ffb9a,_0x4d8044,_0x44bc09,_0x503edc,_0x30171a,_0xefee55,_0x4c53eb){return new Promise(function(_0x542dcc,_0xd54c23){var _0xf2f185={};logger[_0xda92('0x6a')](util[_0xda92('0x35')](_0xda92('0x73'),_0x2ffb9a,_0x30171a));return uploadFile(_0x4d8044,_0x44bc09,_0x503edc,_0x30171a,path[_0xda92('0x74')](_0xefee55),fs[_0xda92('0x75')](_0xefee55))[_0xda92('0x29')](function(_0xfa7572){logger[_0xda92('0x6a')](util[_0xda92('0x35')](_0xda92('0x76'),_0x2ffb9a,_0x30171a,_0xfa7572[_0xda92('0x77')]));_0xf2f185[_0xda92('0x78')]=_0xfa7572['Bucket'];_0xf2f185[_0xda92('0x79')]=_0xfa7572[_0xda92('0x77')];logger[_0xda92('0x6a')](util[_0xda92('0x35')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2ffb9a));return startTranscribe(_0x4d8044,_0x44bc09,_0x503edc,uuidv4(),_0x4c53eb,_0xfa7572[_0xda92('0x77')]);})[_0xda92('0x29')](function(_0x912ac5){logger[_0xda92('0x6a')](util[_0xda92('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2ffb9a,_0x912ac5[_0xda92('0x7a')][_0xda92('0x7b')]));_0xf2f185[_0xda92('0x7c')]=_0x912ac5[_0xda92('0x7a')][_0xda92('0x7b')];_0xf2f185[_0xda92('0x7d')]=_0x912ac5[_0xda92('0x7a')]['TranscriptionJobStatus'];return _0x542dcc(_0xf2f185);})[_0xda92('0x4d')](function(_0x45d4b6){return _0xd54c23(_0x45d4b6);});});}exports['runTranscribe']=function(_0x145c70,_0x3e8e11,_0x2e588e){var _0x5dc2b9;var _0xf2e400;var _0x32423b;var _0x371cf3=require(_0xda92('0x52'));return db[_0xda92('0x2f')][_0xda92('0x7e')]({'where':{'id':_0x145c70[_0xda92('0x49')]['id']}})['then'](function(_0x8824df){if(_0x8824df){var _0x294d3c=util[_0xda92('0x35')](_0xda92('0x54'),_0x8824df[_0xda92('0x58')]);if(fs[_0xda92('0x55')](_0x294d3c)){cypher=!![];return _0x371cf3['decryptFile'](_0x294d3c,_0x8824df[_0xda92('0x58')],config[_0xda92('0x57')][_0xda92('0x66')])['then'](function(){return _0x8824df;});}return _0x8824df;}})['then'](function(_0x4e19ad){if(!_0x4e19ad){throw new db[(_0xda92('0x67'))][(_0xda92('0x59'))](_0xda92('0x7f'));}_0xf2e400=_0x4e19ad;return db[_0xda92('0x80')]['findOne']({'where':{'id':0x1}});})[_0xda92('0x29')](handleEntityNotFound(_0x3e8e11,null))[_0xda92('0x29')](function(_0x21db74){if(_0x21db74){_0x5dc2b9=_0x21db74;if(!_0x5dc2b9[_0xda92('0x81')]||!_0x5dc2b9[_0xda92('0x82')]||!_0x5dc2b9[_0xda92('0x83')]||!_0x5dc2b9['language']||!_0x5dc2b9['bucket']){throw new db[(_0xda92('0x67'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x145c70[_0xda92('0x4f')]['runSentiment']&&(!_0x5dc2b9[_0xda92('0x84')]||!_0x5dc2b9['sentimentAccountId']||!_0x5dc2b9['sentimentRegion']||!_0x5dc2b9[_0xda92('0x85')]||!_0x5dc2b9[_0xda92('0x78')])){throw new db[(_0xda92('0x67'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x5dc2b9[_0xda92('0x82')]}});}})[_0xda92('0x29')](function(_0xa73078){if(!_0xa73078){throw new db[(_0xda92('0x67'))][(_0xda92('0x59'))](_0xda92('0x86'));}if(!_0xa73078[_0xda92('0x87')]||!_0xa73078['data2']){throw new db[(_0xda92('0x67'))][(_0xda92('0x59'))](_0xda92('0x88'));}_0x32423b=_0xa73078;return getBucketslist(_0x32423b[_0xda92('0x87')],_0x32423b[_0xda92('0x89')],_0x5dc2b9[_0xda92('0x83')]);})[_0xda92('0x29')](function(_0x25dc78){if(_0x25dc78&&_0x25dc78[_0xda92('0x8a')]){var _0xa67a24=_[_0xda92('0x4c')](_0x25dc78[_0xda92('0x8a')],function(_0x1c8c29){return _0x1c8c29[_0xda92('0x8b')]===_0x5dc2b9[_0xda92('0x78')];});if(!_0xa67a24){logger[_0xda92('0x6a')](util[_0xda92('0x35')](_0xda92('0x8c'),_0x145c70[_0xda92('0x49')]['id'],_0x5dc2b9['bucket']));return createBucket(_0x32423b[_0xda92('0x87')],_0x32423b[_0xda92('0x89')],_0x5dc2b9[_0xda92('0x83')],_0x5dc2b9['bucket']);}logger['info'](util[_0xda92('0x35')](_0xda92('0x8d'),_0x145c70['params']['id'],_0x5dc2b9[_0xda92('0x78')]));return;}})[_0xda92('0x29')](function(_0x1e598a){if(_0xf2e400[_0xda92('0x7d')]===_0xda92('0x8e')){return transcribe(_0x145c70[_0xda92('0x49')]['id'],_0x32423b[_0xda92('0x87')],_0x32423b[_0xda92('0x89')],_0x5dc2b9['transcribeRegion'],_0x5dc2b9[_0xda92('0x78')],_0xf2e400[_0xda92('0x58')],_0x5dc2b9[_0xda92('0x85')]);}else{logger[_0xda92('0x6a')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x145c70[_0xda92('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x51bc52){if(_0x51bc52){_0x51bc52[_0xda92('0x8f')]=_0x145c70[_0xda92('0x4f')][_0xda92('0x90')];return _0xf2e400['updateAttributes'](_0x51bc52);}})['then'](respondWithResult(_0x3e8e11,null))[_0xda92('0x4d')](handleError(_0x3e8e11,null));};function writeFile(_0x58deb6,_0x2c294a){return new Promise(function(_0x33b09c,_0x5a01c0){fs['writeFile'](_0x2c294a,_0x58deb6,function(_0x302f45,_0x24074b){if(_0x302f45){return _0x5a01c0(_0x302f45);}else{return _0x33b09c(_0x24074b);}});});}exports[_0xda92('0x91')]=function(_0x1e46d7,_0x52336c,_0x277440){return db[_0xda92('0x2f')][_0xda92('0x7e')]({'where':{'id':_0x1e46d7[_0xda92('0x49')]['id']}})[_0xda92('0x29')](handleEntityNotFound(_0x52336c))['then'](function(_0x13aab6){if(_0x13aab6&&_0x13aab6['fileText']){var _0x326988=_0x13aab6[_0xda92('0x92')];var _0x4165cf=config['root']+_0xda92('0x93')+_0x13aab6['id']+_0xda92('0x94');if(fs[_0xda92('0x55')](_0x4165cf)){return _0x4165cf;}return writeFile(_0x326988,_0x4165cf)[_0xda92('0x29')](function(){return _0x4165cf;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})[_0xda92('0x29')](function(_0x4adde6){return _0x52336c[_0xda92('0x51')](_0x4adde6);})[_0xda92('0x4d')](handleError(_0x52336c));}; \ No newline at end of file +var _0x64d3=['transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','key','differenceBy','format','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','catch','create','body','update','find','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','sequelize','MD5','col','token','push','$and','%s.cypher','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe'];(function(_0x5c3a05,_0x22066b){var _0x351a2c=function(_0x152543){while(--_0x152543){_0x5c3a05['push'](_0x5c3a05['shift']());}};_0x351a2c(++_0x22066b);}(_0x64d3,0x1ec));var _0x364d=function(_0xae9ac6,_0x671ba3){_0xae9ac6=_0xae9ac6-0x0;var _0x139f34=_0x64d3[_0xae9ac6];return _0x139f34;};'use strict';var emlformat=require(_0x364d('0x0'));var rimraf=require(_0x364d('0x1'));var zipdir=require(_0x364d('0x2'));var jsonpatch=require(_0x364d('0x3'));var rp=require(_0x364d('0x4'));var moment=require(_0x364d('0x5'));var BPromise=require(_0x364d('0x6'));var Mustache=require(_0x364d('0x7'));var util=require(_0x364d('0x8'));var path=require(_0x364d('0x9'));var sox=require(_0x364d('0xa'));var csv=require(_0x364d('0xb'));var ejs=require(_0x364d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x364d('0xd'));var crypto=require('crypto');var jsforce=require(_0x364d('0xe'));var deskjs=require(_0x364d('0xf'));var toCsv=require(_0x364d('0xb'));var querystring=require(_0x364d('0x10'));var Papa=require(_0x364d('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0x364d('0x12'));var Redis=require(_0x364d('0x13'));var authService=require(_0x364d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x364d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x364d('0x16'));var utils=require(_0x364d('0x17'));var config=require(_0x364d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x364d('0x19'))['db'];function respondWithStatusCode(_0x2d65d9,_0x3cffc7){_0x3cffc7=_0x3cffc7||0xcc;return function(_0x2dd9e0){if(_0x2dd9e0){return _0x2d65d9['sendStatus'](_0x3cffc7);}return _0x2d65d9['status'](_0x3cffc7)['end']();};}function respondWithResult(_0x351123,_0x276fed){_0x276fed=_0x276fed||0xc8;return function(_0x251273){if(_0x251273){return _0x351123[_0x364d('0x1a')](_0x276fed)[_0x364d('0x1b')](_0x251273);}};}function respondWithFilteredResult(_0x579d70,_0x22556c){return function(_0x338420){if(_0x338420){var _0x2552c6=typeof _0x22556c[_0x364d('0x1c')]===_0x364d('0x1d')&&typeof _0x22556c['limit']==='undefined';var _0x3266d5=_0x338420['count'];var _0x28d8c8=_0x2552c6?0x0:_0x22556c['offset'];var _0x4552ee=_0x2552c6?_0x338420['count']:_0x22556c[_0x364d('0x1c')]+_0x22556c[_0x364d('0x1e')];var _0x3293d1;if(_0x4552ee>=_0x3266d5){_0x4552ee=_0x3266d5;_0x3293d1=0xc8;}else{_0x3293d1=0xce;}_0x579d70[_0x364d('0x1a')](_0x3293d1);return _0x579d70[_0x364d('0x1f')](_0x364d('0x20'),_0x28d8c8+'-'+_0x4552ee+'/'+_0x3266d5)[_0x364d('0x1b')](_0x338420);}return null;};}function patchUpdates(_0x246dfc){return function(_0x60836d){try{jsonpatch['apply'](_0x60836d,_0x246dfc,!![]);}catch(_0x38df87){return BPromise[_0x364d('0x21')](_0x38df87);}return _0x60836d[_0x364d('0x22')]();};}function saveUpdates(_0xd298d1,_0x1732fd){return function(_0x500a78){if(_0x500a78){return _0x500a78['update'](_0xd298d1)[_0x364d('0x23')](function(_0x41fedb){return _0x41fedb;});}return null;};}function removeEntity(_0x132603,_0xab676e){return function(_0x1da076){if(_0x1da076){return _0x1da076['destroy']()[_0x364d('0x23')](function(){_0x132603['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d47fc,_0x40fade){return function(_0x356ef7){if(!_0x356ef7){_0x2d47fc['sendStatus'](0x194);}return _0x356ef7;};}function handleError(_0x22ab04,_0x16e2fa){_0x16e2fa=_0x16e2fa||0x1f4;return function(_0x388e61){logger[_0x364d('0x24')](_0x388e61[_0x364d('0x25')]);if(_0x388e61[_0x364d('0x26')]){delete _0x388e61['name'];}_0x22ab04[_0x364d('0x1a')](_0x16e2fa)['send'](_0x388e61);};}exports[_0x364d('0x27')]=function(_0xacf553,_0x43d3e4){var _0x460297={},_0x4cc761={},_0xfb4519={'count':0x0,'rows':[]};var _0x347016=_[_0x364d('0x28')](db[_0x364d('0x29')][_0x364d('0x2a')],function(_0xdf0950){return{'name':_0xdf0950[_0x364d('0x2b')],'type':_0xdf0950['type'][_0x364d('0x2c')]};});_0x4cc761['model']=_[_0x364d('0x2d')](_[_0x364d('0x28')](_0x347016,_0x364d('0x26')),[_0x364d('0x2e')]);_0x4cc761[_0x364d('0x2f')]=_['keys'](_0xacf553[_0x364d('0x2f')]);_0x4cc761[_0x364d('0x30')]=_[_0x364d('0x31')](_0x4cc761[_0x364d('0x32')],_0x4cc761[_0x364d('0x2f')]);_0x460297[_0x364d('0x33')]=_['intersection'](_0x4cc761['model'],qs[_0x364d('0x34')](_0xacf553[_0x364d('0x2f')][_0x364d('0x34')]));_0x460297[_0x364d('0x33')]=_0x460297[_0x364d('0x33')][_0x364d('0x35')]?_0x460297[_0x364d('0x33')]:_0x4cc761[_0x364d('0x32')];if(!_0xacf553['query'][_0x364d('0x36')](_0x364d('0x37'))){_0x460297[_0x364d('0x1e')]=qs[_0x364d('0x1e')](_0xacf553['query']['limit']);_0x460297[_0x364d('0x1c')]=qs[_0x364d('0x1c')](_0xacf553[_0x364d('0x2f')][_0x364d('0x1c')]);}_0x460297[_0x364d('0x38')]=qs['sort'](_0xacf553[_0x364d('0x2f')][_0x364d('0x39')]);_0x460297[_0x364d('0x3a')]=qs[_0x364d('0x30')](_['pick'](_0xacf553['query'],_0x4cc761['filters']),_0x347016);if(_0xacf553['query']['filter']){_0x460297[_0x364d('0x3a')]=_[_0x364d('0x3b')](_0x460297[_0x364d('0x3a')],{'$or':_['map'](_0x347016,function(_0x354584){if(_0x354584[_0x364d('0x3c')]!==_0x364d('0x3d')){var _0x553134={};_0x553134[_0x354584[_0x364d('0x26')]]={'$like':'%'+_0xacf553[_0x364d('0x2f')][_0x364d('0x3e')]+'%'};return _0x553134;}})});}_0x460297=_[_0x364d('0x3b')]({},_0x460297,_0xacf553[_0x364d('0x3f')]);var _0x37964f={'where':_0x460297[_0x364d('0x3a')]};return db[_0x364d('0x29')][_0x364d('0x40')](_0x37964f)[_0x364d('0x23')](function(_0x22a0b2){_0xfb4519[_0x364d('0x40')]=_0x22a0b2;if(_0xacf553[_0x364d('0x2f')][_0x364d('0x41')]){_0x460297[_0x364d('0x42')]=[{'all':!![]}];}return db[_0x364d('0x29')][_0x364d('0x43')](_0x460297);})[_0x364d('0x23')](function(_0x3091ed){_0xfb4519[_0x364d('0x44')]=_0x3091ed;return _0xfb4519;})[_0x364d('0x23')](respondWithFilteredResult(_0x43d3e4,_0x460297))['catch'](handleError(_0x43d3e4,null));};exports[_0x364d('0x45')]=function(_0x4be249,_0x450bfe){var _0x1b48f2={'raw':![],'where':{'id':_0x4be249[_0x364d('0x46')]['id']}},_0x3607cf={};_0x3607cf[_0x364d('0x32')]=_[_0x364d('0x47')](db[_0x364d('0x29')][_0x364d('0x2a')]);_0x3607cf[_0x364d('0x2f')]=_[_0x364d('0x47')](_0x4be249[_0x364d('0x2f')]);_0x3607cf['filters']=_[_0x364d('0x31')](_0x3607cf[_0x364d('0x32')],_0x3607cf[_0x364d('0x2f')]);_0x1b48f2[_0x364d('0x33')]=_[_0x364d('0x31')](_0x3607cf[_0x364d('0x32')],qs[_0x364d('0x34')](_0x4be249[_0x364d('0x2f')][_0x364d('0x34')]));_0x1b48f2[_0x364d('0x33')]=_0x1b48f2[_0x364d('0x33')][_0x364d('0x35')]?_0x1b48f2[_0x364d('0x33')]:_0x3607cf[_0x364d('0x32')];if(_0x4be249[_0x364d('0x2f')][_0x364d('0x41')]){_0x1b48f2['include']=[{'all':!![]}];}_0x1b48f2=_[_0x364d('0x3b')]({},_0x1b48f2,_0x4be249[_0x364d('0x3f')]);return db[_0x364d('0x29')]['find'](_0x1b48f2)[_0x364d('0x23')](handleEntityNotFound(_0x450bfe,null))[_0x364d('0x23')](respondWithResult(_0x450bfe,null))[_0x364d('0x48')](handleError(_0x450bfe,null));};exports[_0x364d('0x49')]=function(_0x34111f,_0x4964af){return db[_0x364d('0x29')][_0x364d('0x49')](_0x34111f[_0x364d('0x4a')],{})[_0x364d('0x23')](respondWithResult(_0x4964af,0xc9))[_0x364d('0x48')](handleError(_0x4964af,null));};exports[_0x364d('0x4b')]=function(_0x1b1dc9,_0x18e72a){if(_0x1b1dc9[_0x364d('0x4a')]['id']){delete _0x1b1dc9['body']['id'];}return db[_0x364d('0x29')][_0x364d('0x4c')]({'where':{'id':_0x1b1dc9[_0x364d('0x46')]['id']}})[_0x364d('0x23')](handleEntityNotFound(_0x18e72a,null))[_0x364d('0x23')](saveUpdates(_0x1b1dc9[_0x364d('0x4a')],null))[_0x364d('0x23')](respondWithResult(_0x18e72a,null))[_0x364d('0x48')](handleError(_0x18e72a,null));};exports['describe']=function(_0x45d0e5,_0x2868ff){return db[_0x364d('0x29')][_0x364d('0x4d')]()[_0x364d('0x23')](respondWithResult(_0x2868ff,null))['catch'](handleError(_0x2868ff,null));};exports[_0x364d('0x4e')]=function(_0xa57278,_0x2ed650,_0x205a46){var _0x1e9e60=require(_0x364d('0x4f'));var _0x500974=![];var _0x523d13={};if(_0xa57278[_0x364d('0x2f')][_0x364d('0x3c')]&&_0xa57278[_0x364d('0x2f')][_0x364d('0x3c')]==='uniqueid'){_0x523d13[_0x364d('0x50')]=_0xa57278[_0x364d('0x46')]['id'];}else{_0x523d13['id']=_0xa57278[_0x364d('0x46')]['id'];}return db[_0x364d('0x29')][_0x364d('0x4c')]({'where':_0x523d13,'attributes':['id','value'],'raw':!![]})[_0x364d('0x23')](handleEntityNotFound(_0x2ed650,null))[_0x364d('0x23')](function(_0x103ab2){if(_0x103ab2){var _0x2bbbcc=_0x103ab2[_0x364d('0x51')];var _0x278339=util[_0x364d('0x2e')]('%s.cypher',_0x2bbbcc);if(fs[_0x364d('0x52')](_0x278339)){_0x500974=!![];return _0x1e9e60[_0x364d('0x53')](_0x278339,_0x2bbbcc,config[_0x364d('0x54')][_0x364d('0x55')])[_0x364d('0x23')](function(){return _0x103ab2;});}return _0x103ab2;}})[_0x364d('0x23')](function(_0x3a27f2){if(_0x3a27f2){var _0x17ae75=_0x3a27f2['value'];if(!fs[_0x364d('0x52')](_0x17ae75)){throw new db[(_0x364d('0x56'))][(_0x364d('0x57'))](_0x364d('0x58'));}if(_0x3a27f2[_0x364d('0x59')]){return _0x2ed650[_0x364d('0x4e')](_0x17ae75,_0x3a27f2[_0x364d('0x59')]+path[_0x364d('0x5a')](_0x17ae75),function(){if(_0x500974){fs[_0x364d('0x5b')](_0x17ae75);}});}else{return _0x2ed650['download'](_0x17ae75,function(_0x1fc739){if(_0x500974){fs['unlink'](_0x17ae75);}});}}})[_0x364d('0x48')](function(_0x5ab509){if(_0x5ab509[_0x364d('0x5c')]===_0x364d('0x58')){_0x2ed650['status'](0x194)[_0x364d('0x5d')](_0x364d('0x5e'));}else{return handleError(_0x2ed650,null);}});};exports['downloads']=function(_0x58e097,_0x343c34,_0x3849b5){var _0x3d9392=require('../../components/encryptor');var _0x3cbafa=![];var _0x246014={'$and':[db[_0x364d('0x5f')][_0x364d('0x3a')](db[_0x364d('0x5f')]['fn'](_0x364d('0x60'),db['sequelize'][_0x364d('0x61')]('uniqueid')),_0x58e097[_0x364d('0x2f')][_0x364d('0x62')])]};if(_0x58e097[_0x364d('0x2f')]['type']&&_0x58e097[_0x364d('0x2f')][_0x364d('0x3c')]===_0x364d('0x50')){_0x246014['$and'][_0x364d('0x63')]({'uniqueid':_0x58e097['params']['id']});}else{_0x246014[_0x364d('0x64')]['push']({'id':_0x58e097['params']['id']});}return db[_0x364d('0x29')][_0x364d('0x4c')]({'where':_0x246014,'attributes':['id',_0x364d('0x51')],'raw':!![]})[_0x364d('0x23')](handleEntityNotFound(_0x343c34,null))[_0x364d('0x23')](function(_0x3ba538){if(_0x3ba538){var _0x346916=util[_0x364d('0x2e')](_0x364d('0x65'),_0x3ba538['value']);if(fs[_0x364d('0x52')](_0x346916)){_0x3cbafa=!![];return _0x3d9392[_0x364d('0x53')](_0x346916,_0x3ba538[_0x364d('0x51')],config[_0x364d('0x54')]['recording'])['then'](function(){return _0x3ba538;});}return _0x3ba538;}})[_0x364d('0x23')](function(_0x396df0){if(_0x396df0){if(!fs['existsSync'](_0x396df0[_0x364d('0x51')])){throw new db[(_0x364d('0x56'))][(_0x364d('0x57'))](_0x364d('0x58'));}if(_0x396df0[_0x364d('0x59')]){return _0x343c34[_0x364d('0x4e')](_0x396df0['value'],_0x396df0[_0x364d('0x59')]+path[_0x364d('0x5a')](_0x396df0[_0x364d('0x51')]),function(){if(_0x3cbafa){fs[_0x364d('0x5b')](_0x396df0[_0x364d('0x51')]);}});}else{return _0x343c34[_0x364d('0x4e')](_0x396df0['value'],function(_0x1eb9ad){if(_0x3cbafa){fs[_0x364d('0x5b')](_0x396df0[_0x364d('0x51')]);}});}}})['catch'](handleError(_0x343c34,null));};exports[_0x364d('0x66')]=function(_0x460c14,_0x496cd6){return db[_0x364d('0x29')][_0x364d('0x4c')]({'where':{'id':_0x460c14[_0x364d('0x46')]['id']}})[_0x364d('0x23')](function(_0x3b5fb6){if(_[_0x364d('0x67')](_0x3b5fb6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3b5fb6;})[_0x364d('0x23')](function(_0x291943){var _0x443856=_0x291943['value'];logger[_0x364d('0x68')](_0x364d('0x69'),_0x443856);if(!_['isNil'](_0x291943[_0x364d('0x51')])&&fs[_0x364d('0x52')](_0x443856)){logger[_0x364d('0x68')](_0x364d('0x6a')+_0x443856+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x364d('0x6b')](_0x443856);}_0x443856=_0x443856+_0x364d('0x6c');if(!_[_0x364d('0x67')](_0x291943[_0x364d('0x51')])&&fs[_0x364d('0x52')](_0x443856)){logger[_0x364d('0x68')](_0x364d('0x6a')+_0x443856+_0x364d('0x6d'));fs['unlinkSync'](_0x443856);}return _0x291943;})['then'](function(_0x2459c9){if(!_0x2459c9)throw new InternalError();return _0x2459c9['destroy']();})[_0x364d('0x23')](function(){_0x496cd6[_0x364d('0x1a')](0xcc)[_0x364d('0x6e')]();})[_0x364d('0x48')](handleError(_0x496cd6,null));};function getBucketslist(_0x22e5f9,_0x3dbcad,_0x3554ca){return new Promise(function(_0x3f0964,_0x3f1670){var _0x3c9700=new AWS['S3']({'accessKeyId':_0x3dbcad,'secretAccessKey':_0x22e5f9,'region':_0x3554ca});_0x3c9700[_0x364d('0x6f')]({},function(_0x41df62,_0x41ed0e){if(_0x41df62){return _0x3f1670(_0x41df62);}else{return _0x3f0964(_0x41ed0e);}});});}function createBucket(_0x59ab84,_0x11b96a,_0x649c37,_0x257983){return new Promise(function(_0x277e70,_0x4a0510){var _0xa19cac=new AWS['S3']({'accessKeyId':_0x11b96a,'secretAccessKey':_0x59ab84,'region':_0x649c37});_0xa19cac[_0x364d('0x70')]({'Bucket':_0x257983},function(_0x53f678,_0x1a8b69){if(_0x53f678){return _0x4a0510(_0x53f678);}else{return _0x277e70(_0x1a8b69);}});});}function uploadFile(_0x48b2cb,_0x46ae27,_0xb0cb54,_0x54b252,_0x32a3d7,_0x2942e3){return new Promise(function(_0x1d834f,_0x203558){var _0x2b7466=new AWS['S3']({'accessKeyId':_0x46ae27,'secretAccessKey':_0x48b2cb,'region':_0xb0cb54});_0x2b7466[_0x364d('0x71')]({'Bucket':_0x54b252,'Key':_0x32a3d7,'Body':_0x2942e3},function(_0x30e0f8,_0x23fa69){if(_0x30e0f8){return _0x203558(_0x30e0f8);}else{return _0x1d834f(_0x23fa69);}});});}function startTranscribe(_0x5ad64b,_0x2ae969,_0x23b04d,_0x4ecfa7,_0x49d8b3,_0x7326a){return new Promise(function(_0x453f57,_0x366c9a){var _0x2a40c3=new AWS[(_0x364d('0x72'))]({'accessKeyId':_0x2ae969,'secretAccessKey':_0x5ad64b,'region':_0x23b04d});_0x2a40c3[_0x364d('0x73')]({'TranscriptionJobName':_0x4ecfa7,'LanguageCode':_0x49d8b3,'Media':{'MediaFileUri':_0x7326a}},function(_0x1b0531,_0xe7f6ec){if(_0x1b0531){return _0x366c9a(_0x1b0531);}else{return _0x453f57(_0xe7f6ec);}});});}function transcribe(_0x343bb3,_0x54c2cd,_0x374214,_0x165936,_0x2f68db,_0x23c4fe,_0x5210ad){return new Promise(function(_0x140b1a,_0x21330c){var _0x990292={};logger['info'](util[_0x364d('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x343bb3,_0x2f68db));return uploadFile(_0x54c2cd,_0x374214,_0x165936,_0x2f68db,path[_0x364d('0x74')](_0x23c4fe),fs[_0x364d('0x75')](_0x23c4fe))[_0x364d('0x23')](function(_0x5b25ef){logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x76'),_0x343bb3,_0x2f68db,_0x5b25ef[_0x364d('0x77')]));_0x990292[_0x364d('0x78')]=_0x5b25ef['Bucket'];_0x990292[_0x364d('0x79')]=_0x5b25ef[_0x364d('0x77')];logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x7a'),_0x343bb3));return startTranscribe(_0x54c2cd,_0x374214,_0x165936,uuidv4(),_0x5210ad,_0x5b25ef[_0x364d('0x77')]);})[_0x364d('0x23')](function(_0x1c8846){logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x7b'),_0x343bb3,_0x1c8846[_0x364d('0x7c')][_0x364d('0x7d')]));_0x990292['transcribeName']=_0x1c8846[_0x364d('0x7c')][_0x364d('0x7d')];_0x990292['transcribeStatus']=_0x1c8846[_0x364d('0x7c')][_0x364d('0x7e')];return _0x140b1a(_0x990292);})['catch'](function(_0x3fdfef){return _0x21330c(_0x3fdfef);});});}exports[_0x364d('0x7f')]=function(_0x12e85a,_0x2a8e0f,_0x550d2c){var _0x4345c4;var _0x1abdb0;var _0x4b34d2;var _0x921bed=require(_0x364d('0x4f'));return db[_0x364d('0x29')][_0x364d('0x80')]({'where':{'id':_0x12e85a[_0x364d('0x46')]['id']}})[_0x364d('0x23')](function(_0x3d9c62){if(_0x3d9c62){var _0x31ce56=util[_0x364d('0x2e')](_0x364d('0x65'),_0x3d9c62[_0x364d('0x51')]);if(fs[_0x364d('0x52')](_0x31ce56)){cypher=!![];return _0x921bed['decryptFile'](_0x31ce56,_0x3d9c62[_0x364d('0x51')],config[_0x364d('0x54')][_0x364d('0x55')])[_0x364d('0x23')](function(){return _0x3d9c62;});}return _0x3d9c62;}})['then'](function(_0x423b78){if(!_0x423b78){throw new db['Sequelize'][(_0x364d('0x57'))](_0x364d('0x81'));}_0x1abdb0=_0x423b78;return db[_0x364d('0x82')][_0x364d('0x80')]({'where':{'id':0x1}});})[_0x364d('0x23')](handleEntityNotFound(_0x2a8e0f,null))[_0x364d('0x23')](function(_0x4085a6){if(_0x4085a6){_0x4345c4=_0x4085a6;if(!_0x4345c4[_0x364d('0x83')]||!_0x4345c4['transcribeAccountId']||!_0x4345c4[_0x364d('0x84')]||!_0x4345c4[_0x364d('0x85')]||!_0x4345c4[_0x364d('0x78')]){throw new db[(_0x364d('0x56'))][(_0x364d('0x57'))](_0x364d('0x86'));}if(_0x12e85a[_0x364d('0x4a')][_0x364d('0x87')]&&(!_0x4345c4[_0x364d('0x88')]||!_0x4345c4['sentimentAccountId']||!_0x4345c4[_0x364d('0x89')]||!_0x4345c4[_0x364d('0x85')]||!_0x4345c4[_0x364d('0x78')])){throw new db[(_0x364d('0x56'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x364d('0x80')]({'where':{'id':_0x4345c4['transcribeAccountId']}});}})[_0x364d('0x23')](function(_0x13a850){if(!_0x13a850){throw new db[(_0x364d('0x56'))]['ValidationError'](_0x364d('0x8a'));}if(!_0x13a850[_0x364d('0x8b')]||!_0x13a850[_0x364d('0x8c')]){throw new db[(_0x364d('0x56'))][(_0x364d('0x57'))](_0x364d('0x8d'));}_0x4b34d2=_0x13a850;return getBucketslist(_0x4b34d2['data1'],_0x4b34d2[_0x364d('0x8c')],_0x4345c4[_0x364d('0x84')]);})['then'](function(_0xb22060){if(_0xb22060&&_0xb22060['Buckets']){var _0x442b8f=_[_0x364d('0x4c')](_0xb22060[_0x364d('0x8e')],function(_0x43ebea){return _0x43ebea[_0x364d('0x8f')]===_0x4345c4[_0x364d('0x78')];});if(!_0x442b8f){logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x90'),_0x12e85a['params']['id'],_0x4345c4[_0x364d('0x78')]));return createBucket(_0x4b34d2['data1'],_0x4b34d2['data2'],_0x4345c4[_0x364d('0x84')],_0x4345c4[_0x364d('0x78')]);}logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x91'),_0x12e85a[_0x364d('0x46')]['id'],_0x4345c4['bucket']));return;}})[_0x364d('0x23')](function(_0x3ddae5){if(_0x1abdb0[_0x364d('0x92')]===_0x364d('0x93')){return transcribe(_0x12e85a['params']['id'],_0x4b34d2[_0x364d('0x8b')],_0x4b34d2[_0x364d('0x8c')],_0x4345c4[_0x364d('0x84')],_0x4345c4[_0x364d('0x78')],_0x1abdb0['value'],_0x4345c4[_0x364d('0x85')]);}else{logger[_0x364d('0x68')](util[_0x364d('0x2e')](_0x364d('0x94'),_0x12e85a['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x364d('0x23')](function(_0x2d2209){if(_0x2d2209){_0x2d2209[_0x364d('0x95')]=_0x12e85a['body'][_0x364d('0x87')];return _0x1abdb0[_0x364d('0x96')](_0x2d2209);}})[_0x364d('0x23')](respondWithResult(_0x2a8e0f,null))[_0x364d('0x48')](handleError(_0x2a8e0f,null));};function writeFile(_0x3e02dd,_0x28e4ac){return new Promise(function(_0x4e9372,_0x52254c){fs[_0x364d('0x97')](_0x28e4ac,_0x3e02dd,function(_0xfbf0eb,_0x6255e5){if(_0xfbf0eb){return _0x52254c(_0xfbf0eb);}else{return _0x4e9372(_0x6255e5);}});});}exports['downloadTranscribe']=function(_0x1828fb,_0x4ccdb8,_0x5efc9b){return db[_0x364d('0x29')][_0x364d('0x80')]({'where':{'id':_0x1828fb[_0x364d('0x46')]['id']}})[_0x364d('0x23')](handleEntityNotFound(_0x4ccdb8))['then'](function(_0x23f8a5){if(_0x23f8a5&&_0x23f8a5[_0x364d('0x98')]){var _0x429d5a=_0x23f8a5[_0x364d('0x98')];var _0x215887=config[_0x364d('0x99')]+_0x364d('0x9a')+_0x23f8a5['id']+_0x364d('0x9b');if(fs['existsSync'](_0x215887)){return _0x215887;}return writeFile(_0x429d5a,_0x215887)['then'](function(){return _0x215887;});}else{throw new db[(_0x364d('0x56'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x364d('0x23')](function(_0x31f0c4){return _0x4ccdb8['download'](_0x31f0c4);})[_0x364d('0x48')](handleError(_0x4ccdb8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index fd0620b..de7588a 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 _0x056d=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','util'];(function(_0x2af29a,_0x4f44bc){var _0x5ef02f=function(_0x4349ef){while(--_0x4349ef){_0x2af29a['push'](_0x2af29a['shift']());}};_0x5ef02f(++_0x4f44bc);}(_0x056d,0xa6));var _0xd056=function(_0x1838cf,_0x1f10a1){_0x1838cf=_0x1838cf-0x0;var _0x1cb9e4=_0x056d[_0x1838cf];return _0x1cb9e4;};'use strict';var _=require(_0xd056('0x0'));var util=require(_0xd056('0x1'));var logger=require(_0xd056('0x2'))(_0xd056('0x3'));var moment=require(_0xd056('0x4'));var BPromise=require(_0xd056('0x5'));var rp=require(_0xd056('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd056('0x7'));var attributes=require(_0xd056('0x8'));module[_0xd056('0x9')]=function(_0x34fdd4,_0x16097c){return _0x34fdd4['define']('VoiceRecording',attributes,{'tableName':_0xd056('0xa'),'paranoid':![],'indexes':[{'name':_0xd056('0xb'),'fields':[_0xd056('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f23=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f23,0x1ef));var _0x37f2=function(_0x5c8c2e,_0x2f1628){_0x5c8c2e=_0x5c8c2e-0x0;var _0x2001b2=_0x7f23[_0x5c8c2e];return _0x2001b2;};'use strict';var _=require(_0x37f2('0x0'));var util=require(_0x37f2('0x1'));var logger=require(_0x37f2('0x2'))(_0x37f2('0x3'));var moment=require(_0x37f2('0x4'));var BPromise=require('bluebird');var rp=require(_0x37f2('0x5'));var fs=require('fs');var path=require(_0x37f2('0x6'));var rimraf=require(_0x37f2('0x7'));var config=require(_0x37f2('0x8'));var attributes=require(_0x37f2('0x9'));module[_0x37f2('0xa')]=function(_0x5534d1,_0x369454){return _0x5534d1[_0x37f2('0xb')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x37f2('0xc'),'fields':[_0x37f2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 619e568..7a27b69 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 _0x5464=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','unlink','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x592238,_0xc8ff1e){var _0x4bdf33=function(_0x525784){while(--_0x525784){_0x592238['push'](_0x592238['shift']());}};_0x4bdf33(++_0xc8ff1e);}(_0x5464,0x15d));var _0x4546=function(_0x1115f3,_0x436430){_0x1115f3=_0x1115f3-0x0;var _0x1f28e8=_0x5464[_0x1115f3];return _0x1f28e8;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'attributes':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1b')]||null:null,'limit':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1c')]||null:null})[_0x4546('0xa')](function(_0x2f065d){logger[_0x4546('0xb')](_0x4546('0x14'),_0x57d8de);logger['debug'](_0x4546('0x14'),_0x57d8de,JSON[_0x4546('0x1d')](_0x2f065d));_0x5780a7(_0x2f065d);})['catch'](function(_0x824698){logger[_0x4546('0x10')](_0x4546('0x14'),_0x824698[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x824698['message']));});});};exports[_0x4546('0x1e')]=function(_0x3796fe){var _0x831fa5=this;return new Promise(function(_0x48fc36,_0x4c1dad){var _0x43740e=require(_0x4546('0x1f'));var _0x15611c;return db[_0x4546('0x20')][_0x4546('0x21')]({'attributes':['id',_0x4546('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4546('0xa')](function(_0x586ff1){_0x15611c=_0x586ff1;return db[_0x4546('0x15')]['create'](_0x3796fe[_0x4546('0x17')]);})[_0x4546('0xa')](function(_0x5396c5){if(_0x15611c['callRecordingEncryption']&&fs[_0x4546('0x23')](_0x5396c5['value'])){var _0x3c7c7d=util[_0x4546('0x24')]('%s.cypher',_0x5396c5['value']);return _0x43740e[_0x4546('0x25')](_0x5396c5[_0x4546('0x26')],_0x3c7c7d,config[_0x4546('0x27')]['recording'])[_0x4546('0xa')](function(){fs[_0x4546('0x28')](_0x5396c5['value']);logger[_0x4546('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x5396c5;});}return _0x5396c5;})[_0x4546('0xa')](function(_0x44f604){logger[_0x4546('0xb')](_0x4546('0x1e'),_0x3796fe);logger['debug'](_0x4546('0x1e'),_0x3796fe,JSON[_0x4546('0x1d')](_0x44f604));_0x48fc36(_0x44f604);})[_0x4546('0x13')](function(_0x298bef){logger[_0x4546('0x10')](_0x4546('0x1e'),_0x298bef['message'],_0x3796fe);_0x4c1dad(_0x831fa5[_0x4546('0x10')](0x1f4,_0x298bef[_0x4546('0x12')]));});});}; \ No newline at end of file +var _0xfcf0=['request\x20sent','stringify','error','message','result','UpdateVoiceRecording','update','body','options','attributes','limit','then','catch','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xfcf0[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});}exports[_0x0fcf('0x15')]=function(_0x19cfbd){var _0x567320=this;return new Promise(function(_0x18ea32,_0x1a8f58){return db['VoiceRecording'][_0x0fcf('0x16')](_0x19cfbd[_0x0fcf('0x17')],{'raw':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')]['where']||null:null,'attributes':_0x19cfbd[_0x0fcf('0x18')]?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x19')]||null:null,'limit':_0x19cfbd['options']?_0x19cfbd[_0x0fcf('0x18')][_0x0fcf('0x1a')]||null:null})[_0x0fcf('0x1b')](function(_0x41b20b){logger[_0x0fcf('0xd')](_0x0fcf('0x15'),_0x19cfbd);logger['debug'](_0x0fcf('0x15'),_0x19cfbd,JSON[_0x0fcf('0x11')](_0x41b20b));_0x18ea32(_0x41b20b);})[_0x0fcf('0x1c')](function(_0xd6f8b5){logger[_0x0fcf('0x12')](_0x0fcf('0x15'),_0xd6f8b5[_0x0fcf('0x13')],_0x19cfbd);_0x1a8f58(_0x567320[_0x0fcf('0x12')](0x1f4,_0xd6f8b5[_0x0fcf('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x18965e){var _0xc107a=this;return new Promise(function(_0x41b7a2,_0x2f198b){var _0x3876ed=require(_0x0fcf('0x1d'));var _0x2730b0;return db['Setting'][_0x0fcf('0x1e')]({'attributes':['id',_0x0fcf('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x0fcf('0x1b')](function(_0x35180d){_0x2730b0=_0x35180d;return db['VoiceRecording']['create'](_0x18965e['body']);})[_0x0fcf('0x1b')](function(_0x50b7df){if(_0x2730b0[_0x0fcf('0x1f')]&&fs[_0x0fcf('0x20')](_0x50b7df['value'])){var _0xdfd3ec=util[_0x0fcf('0x21')](_0x0fcf('0x22'),_0x50b7df[_0x0fcf('0x23')]);return _0x3876ed[_0x0fcf('0x24')](_0x50b7df[_0x0fcf('0x23')],_0xdfd3ec,config['secrets'][_0x0fcf('0x25')])[_0x0fcf('0x1b')](function(){fs[_0x0fcf('0x26')](_0x50b7df[_0x0fcf('0x23')]);logger[_0x0fcf('0xd')](_0x0fcf('0x27'));return _0x50b7df;});}return _0x50b7df;})['then'](function(_0x208433){logger[_0x0fcf('0xd')](_0x0fcf('0x28'),_0x18965e);logger[_0x0fcf('0xf')](_0x0fcf('0x28'),_0x18965e,JSON[_0x0fcf('0x11')](_0x208433));_0x41b7a2(_0x208433);})[_0x0fcf('0x1c')](function(_0x344957){logger[_0x0fcf('0x12')](_0x0fcf('0x28'),_0x344957[_0x0fcf('0x13')],_0x18965e);_0x2f198b(_0xc107a[_0x0fcf('0x12')](0x1f4,_0x344957[_0x0fcf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6681410..c15b2bb 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 _0xbb0d=['../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb0d,0x94));var _0xdbb0=function(_0x407078,_0x22d065){_0x407078=_0x407078-0x0;var _0x44ae63=_0xbb0d[_0x407078];return _0x44ae63;};'use strict';var multer=require(_0xdbb0('0x0'));var util=require(_0xdbb0('0x1'));var path=require(_0xdbb0('0x2'));var timeout=require('connect-timeout');var express=require(_0xdbb0('0x3'));var router=express[_0xdbb0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbb0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdbb0('0x6'));router[_0xdbb0('0x7')]('/',auth[_0xdbb0('0x8')](),controller[_0xdbb0('0x9')]);router[_0xdbb0('0x7')](_0xdbb0('0xa'),auth[_0xdbb0('0x8')](),controller[_0xdbb0('0xb')]);router['get'](_0xdbb0('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdbb0('0xd')](_0xdbb0('0xc'),auth[_0xdbb0('0x8')](),controller['update']);router[_0xdbb0('0xe')](_0xdbb0('0xc'),auth['isAuthenticated'](),controller[_0xdbb0('0xf')]);module[_0xdbb0('0x10')]=router; \ No newline at end of file +var _0xdf18=['isAuthenticated','/describe','/:id','show','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get'];(function(_0x2072f3,_0x21e2fe){var _0x5e20d6=function(_0x25543c){while(--_0x25543c){_0x2072f3['push'](_0x2072f3['shift']());}};_0x5e20d6(++_0x21e2fe);}(_0xdf18,0x127));var _0x8df1=function(_0x64f59a,_0x549247){_0x64f59a=_0x64f59a-0x0;var _0x54ff1d=_0xdf18[_0x64f59a];return _0x54ff1d;};'use strict';var multer=require(_0x8df1('0x0'));var util=require(_0x8df1('0x1'));var path=require(_0x8df1('0x2'));var timeout=require(_0x8df1('0x3'));var express=require(_0x8df1('0x4'));var router=express[_0x8df1('0x5')]();var fs_extra=require(_0x8df1('0x6'));var auth=require(_0x8df1('0x7'));var interaction=require(_0x8df1('0x8'));var config=require('../../config/environment');var controller=require(_0x8df1('0x9'));router[_0x8df1('0xa')]('/',auth[_0x8df1('0xb')](),controller['index']);router['get'](_0x8df1('0xc'),auth[_0x8df1('0xb')](),controller['describe']);router[_0x8df1('0xa')](_0x8df1('0xd'),auth['isAuthenticated'](),controller[_0x8df1('0xe')]);router['post']('/',auth[_0x8df1('0xb')](),controller['create']);router[_0x8df1('0xf')](_0x8df1('0xd'),auth[_0x8df1('0xb')](),controller[_0x8df1('0x10')]);router[_0x8df1('0x11')](_0x8df1('0xd'),auth[_0x8df1('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 719caaf..59049d6 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 _0xf0ab=['blind','attended','STRING','sequelize','moment','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0ab,0x1ca));var _0xbf0a=function(_0x42dd53,_0x48aa95){_0x42dd53=_0x42dd53-0x0;var _0x4be107=_0xf0ab[_0x42dd53];return _0x4be107;};'use strict';var Sequelize=require(_0xbf0a('0x0'));var moment=require(_0xbf0a('0x1'));module[_0xbf0a('0x2')]={'type':{'type':Sequelize[_0xbf0a('0x3')](_0xbf0a('0x4'),_0xbf0a('0x5'))},'result':{'type':Sequelize[_0xbf0a('0x6')]},'transfererchannel':{'type':Sequelize[_0xbf0a('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xbf0a('0x6')]},'transferercalleridname':{'type':Sequelize[_0xbf0a('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xbf0a('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xbf0a('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xbf0a('0x6')]},'transferercontext':{'type':Sequelize[_0xbf0a('0x6')]},'transfererexten':{'type':Sequelize[_0xbf0a('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xbf0a('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xbf0a('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xbf0a('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xbf0a('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xbf0a('0x6')]},'transfereecontext':{'type':Sequelize[_0xbf0a('0x6')]},'transfereeexten':{'type':Sequelize[_0xbf0a('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xbf0a('0x6')]},'isexternal':{'type':Sequelize[_0xbf0a('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xbf0a('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34b4=['ENUM','attended','STRING','Yes','moment','exports'];(function(_0x292d4e,_0x242403){var _0x2f17c0=function(_0x4b2b5b){while(--_0x4b2b5b){_0x292d4e['push'](_0x292d4e['shift']());}};_0x2f17c0(++_0x242403);}(_0x34b4,0x64));var _0x434b=function(_0x366e82,_0x5436d2){_0x366e82=_0x366e82-0x0;var _0xc946b9=_0x34b4[_0x366e82];return _0xc946b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x434b('0x0'));module[_0x434b('0x1')]={'type':{'type':Sequelize[_0x434b('0x2')]('blind',_0x434b('0x3'))},'result':{'type':Sequelize[_0x434b('0x4')]},'transfererchannel':{'type':Sequelize[_0x434b('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x434b('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x434b('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x434b('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x434b('0x4')]},'transferercontext':{'type':Sequelize[_0x434b('0x4')]},'transfererexten':{'type':Sequelize[_0x434b('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x434b('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x434b('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x434b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x434b('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x434b('0x4')]},'transfereeexten':{'type':Sequelize[_0x434b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x434b('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x434b('0x5'),'No')},'context':{'type':Sequelize[_0x434b('0x4')]},'extension':{'type':Sequelize[_0x434b('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 2b30e84..73af522 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 _0x389e=['params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','include','rows','show','includeAll','find','catch','create','update','body'];(function(_0x1085db,_0x41e087){var _0x392a60=function(_0xc7f75d){while(--_0xc7f75d){_0x1085db['push'](_0x1085db['shift']());}};_0x392a60(++_0x41e087);}(_0x389e,0x12e));var _0xe389=function(_0x4cfc23,_0x3b556c){_0x4cfc23=_0x4cfc23-0x0;var _0x126147=_0x389e[_0x4cfc23];return _0x126147;};'use strict';var emlformat=require(_0xe389('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe389('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe389('0x2'));var moment=require(_0xe389('0x3'));var BPromise=require(_0xe389('0x4'));var Mustache=require(_0xe389('0x5'));var util=require('util');var path=require(_0xe389('0x6'));var sox=require(_0xe389('0x7'));var csv=require(_0xe389('0x8'));var ejs=require(_0xe389('0x9'));var fs=require('fs');var fs_extra=require(_0xe389('0xa'));var _=require(_0xe389('0xb'));var squel=require(_0xe389('0xc'));var crypto=require(_0xe389('0xd'));var jsforce=require(_0xe389('0xe'));var deskjs=require(_0xe389('0xf'));var toCsv=require(_0xe389('0x8'));var querystring=require(_0xe389('0x10'));var Papa=require(_0xe389('0x11'));var Redis=require(_0xe389('0x12'));var authService=require(_0xe389('0x13'));var qs=require(_0xe389('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe389('0x15'));var logger=require('../../config/logger')(_0xe389('0x16'));var utils=require(_0xe389('0x17'));var config=require(_0xe389('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe389('0x19'))['db'];function respondWithStatusCode(_0x1c14e8,_0x5ec6fd){_0x5ec6fd=_0x5ec6fd||0xcc;return function(_0x1858ff){if(_0x1858ff){return _0x1c14e8['sendStatus'](_0x5ec6fd);}return _0x1c14e8[_0xe389('0x1a')](_0x5ec6fd)[_0xe389('0x1b')]();};}function respondWithResult(_0x10e29b,_0x439fbf){_0x439fbf=_0x439fbf||0xc8;return function(_0x935dff){if(_0x935dff){return _0x10e29b[_0xe389('0x1a')](_0x439fbf)[_0xe389('0x1c')](_0x935dff);}};}function respondWithFilteredResult(_0x4fecca,_0x40565c){return function(_0x4fed74){if(_0x4fed74){var _0x19c8dc=typeof _0x40565c[_0xe389('0x1d')]==='undefined'&&typeof _0x40565c[_0xe389('0x1e')]===_0xe389('0x1f');var _0x2fb050=_0x4fed74[_0xe389('0x20')];var _0x1f6332=_0x19c8dc?0x0:_0x40565c['offset'];var _0x2d8dcf=_0x19c8dc?_0x4fed74[_0xe389('0x20')]:_0x40565c[_0xe389('0x1d')]+_0x40565c[_0xe389('0x1e')];var _0xb1159;if(_0x2d8dcf>=_0x2fb050){_0x2d8dcf=_0x2fb050;_0xb1159=0xc8;}else{_0xb1159=0xce;}_0x4fecca[_0xe389('0x1a')](_0xb1159);return _0x4fecca['set'](_0xe389('0x21'),_0x1f6332+'-'+_0x2d8dcf+'/'+_0x2fb050)[_0xe389('0x1c')](_0x4fed74);}return null;};}function patchUpdates(_0x5cb28d){return function(_0xb50a6f){try{jsonpatch['apply'](_0xb50a6f,_0x5cb28d,!![]);}catch(_0x1476e3){return BPromise[_0xe389('0x22')](_0x1476e3);}return _0xb50a6f['save']();};}function saveUpdates(_0x1e75f8,_0x16389d){return function(_0x66eefa){if(_0x66eefa){return _0x66eefa['update'](_0x1e75f8)[_0xe389('0x23')](function(_0x122bb3){return _0x122bb3;});}return null;};}function removeEntity(_0x560865,_0x4d2013){return function(_0x37d597){if(_0x37d597){return _0x37d597[_0xe389('0x24')]()[_0xe389('0x23')](function(){_0x560865[_0xe389('0x1a')](0xcc)[_0xe389('0x1b')]();});}};}function handleEntityNotFound(_0x4f3173,_0x5dd67b){return function(_0x449c57){if(!_0x449c57){_0x4f3173['sendStatus'](0x194);}return _0x449c57;};}function handleError(_0x2d439c,_0x535c11){_0x535c11=_0x535c11||0x1f4;return function(_0x4b0eea){logger[_0xe389('0x25')](_0x4b0eea[_0xe389('0x26')]);if(_0x4b0eea[_0xe389('0x27')]){delete _0x4b0eea[_0xe389('0x27')];}_0x2d439c[_0xe389('0x1a')](_0x535c11)[_0xe389('0x28')](_0x4b0eea);};}exports[_0xe389('0x29')]=function(_0x19872c,_0x37407e){var _0x55c7ea={},_0xdf1480={},_0x5b0695={'count':0x0,'rows':[]};var _0x1226e8=_[_0xe389('0x2a')](db[_0xe389('0x2b')][_0xe389('0x2c')],function(_0x522e5a){return{'name':_0x522e5a[_0xe389('0x2d')],'type':_0x522e5a[_0xe389('0x2e')][_0xe389('0x2f')]};});_0xdf1480[_0xe389('0x30')]=_[_0xe389('0x2a')](_0x1226e8,_0xe389('0x27'));_0xdf1480[_0xe389('0x31')]=_[_0xe389('0x32')](_0x19872c[_0xe389('0x31')]);_0xdf1480[_0xe389('0x33')]=_['intersection'](_0xdf1480[_0xe389('0x30')],_0xdf1480[_0xe389('0x31')]);_0x55c7ea[_0xe389('0x34')]=_[_0xe389('0x35')](_0xdf1480[_0xe389('0x30')],qs[_0xe389('0x36')](_0x19872c[_0xe389('0x31')]['fields']));_0x55c7ea[_0xe389('0x34')]=_0x55c7ea['attributes'][_0xe389('0x37')]?_0x55c7ea['attributes']:_0xdf1480[_0xe389('0x30')];if(!_0x19872c['query'][_0xe389('0x38')](_0xe389('0x39'))){_0x55c7ea[_0xe389('0x1e')]=qs[_0xe389('0x1e')](_0x19872c[_0xe389('0x31')][_0xe389('0x1e')]);_0x55c7ea[_0xe389('0x1d')]=qs[_0xe389('0x1d')](_0x19872c[_0xe389('0x31')]['offset']);}_0x55c7ea[_0xe389('0x3a')]=qs[_0xe389('0x3b')](_0x19872c[_0xe389('0x31')][_0xe389('0x3b')]);_0x55c7ea['where']=qs[_0xe389('0x33')](_['pick'](_0x19872c[_0xe389('0x31')],_0xdf1480[_0xe389('0x33')]),_0x1226e8);if(_0x19872c['query']['filter']){_0x55c7ea[_0xe389('0x3c')]=_['merge'](_0x55c7ea[_0xe389('0x3c')],{'$or':_[_0xe389('0x2a')](_0x1226e8,function(_0x5195fb){if(_0x5195fb[_0xe389('0x2e')]!==_0xe389('0x3d')){var _0x4ecf11={};_0x4ecf11[_0x5195fb[_0xe389('0x27')]]={'$like':'%'+_0x19872c[_0xe389('0x31')]['filter']+'%'};return _0x4ecf11;}})});}_0x55c7ea=_[_0xe389('0x3e')]({},_0x55c7ea,_0x19872c[_0xe389('0x3f')]);var _0x3170b4={'where':_0x55c7ea[_0xe389('0x3c')]};return db[_0xe389('0x2b')][_0xe389('0x20')](_0x3170b4)[_0xe389('0x23')](function(_0x340517){_0x5b0695['count']=_0x340517;if(_0x19872c[_0xe389('0x31')]['includeAll']){_0x55c7ea[_0xe389('0x40')]=[{'all':!![]}];}return db[_0xe389('0x2b')]['findAll'](_0x55c7ea);})[_0xe389('0x23')](function(_0x184952){_0x5b0695[_0xe389('0x41')]=_0x184952;return _0x5b0695;})[_0xe389('0x23')](respondWithFilteredResult(_0x37407e,_0x55c7ea))['catch'](handleError(_0x37407e,null));};exports[_0xe389('0x42')]=function(_0x33177f,_0x95069c){var _0x362ff3={'raw':!![],'where':{'id':_0x33177f['params']['id']}},_0x2dc4d9={};_0x2dc4d9['model']=_['keys'](db[_0xe389('0x2b')][_0xe389('0x2c')]);_0x2dc4d9[_0xe389('0x31')]=_['keys'](_0x33177f[_0xe389('0x31')]);_0x2dc4d9[_0xe389('0x33')]=_['intersection'](_0x2dc4d9['model'],_0x2dc4d9['query']);_0x362ff3[_0xe389('0x34')]=_[_0xe389('0x35')](_0x2dc4d9['model'],qs['fields'](_0x33177f['query']['fields']));_0x362ff3[_0xe389('0x34')]=_0x362ff3[_0xe389('0x34')][_0xe389('0x37')]?_0x362ff3[_0xe389('0x34')]:_0x2dc4d9[_0xe389('0x30')];if(_0x33177f[_0xe389('0x31')][_0xe389('0x43')]){_0x362ff3[_0xe389('0x40')]=[{'all':!![]}];}_0x362ff3=_['merge']({},_0x362ff3,_0x33177f[_0xe389('0x3f')]);return db[_0xe389('0x2b')][_0xe389('0x44')](_0x362ff3)[_0xe389('0x23')](handleEntityNotFound(_0x95069c,null))[_0xe389('0x23')](respondWithResult(_0x95069c,null))[_0xe389('0x45')](handleError(_0x95069c,null));};exports[_0xe389('0x46')]=function(_0x569b24,_0x283a90){return db[_0xe389('0x2b')][_0xe389('0x46')](_0x569b24['body'],{})[_0xe389('0x23')](respondWithResult(_0x283a90,0xc9))[_0xe389('0x45')](handleError(_0x283a90,null));};exports[_0xe389('0x47')]=function(_0x30a32c,_0x2ff6d8){if(_0x30a32c[_0xe389('0x48')]['id']){delete _0x30a32c[_0xe389('0x48')]['id'];}return db[_0xe389('0x2b')][_0xe389('0x44')]({'where':{'id':_0x30a32c[_0xe389('0x49')]['id']}})[_0xe389('0x23')](handleEntityNotFound(_0x2ff6d8,null))[_0xe389('0x23')](saveUpdates(_0x30a32c['body'],null))[_0xe389('0x23')](respondWithResult(_0x2ff6d8,null))['catch'](handleError(_0x2ff6d8,null));};exports[_0xe389('0x24')]=function(_0x55e987,_0x5da623){return db['VoiceTransferReport']['find']({'where':{'id':_0x55e987[_0xe389('0x49')]['id']}})[_0xe389('0x23')](handleEntityNotFound(_0x5da623,null))[_0xe389('0x23')](removeEntity(_0x5da623,null))[_0xe389('0x45')](handleError(_0x5da623,null));};exports[_0xe389('0x4a')]=function(_0x1cabde,_0x387a8a){return db[_0xe389('0x2b')][_0xe389('0x4a')]()[_0xe389('0x23')](respondWithResult(_0x387a8a,null))[_0xe389('0x45')](handleError(_0x387a8a,null));}; \ No newline at end of file +var _0x7657=['findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x7657,0x1d1));var _0x7765=function(_0xb9c5c4,_0x20c232){_0xb9c5c4=_0xb9c5c4-0x0;var _0x384b4e=_0x7657[_0xb9c5c4];return _0x384b4e;};'use strict';var emlformat=require(_0x7765('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7765('0x1'));var jsonpatch=require(_0x7765('0x2'));var rp=require(_0x7765('0x3'));var moment=require('moment');var BPromise=require(_0x7765('0x4'));var Mustache=require(_0x7765('0x5'));var util=require('util');var path=require(_0x7765('0x6'));var sox=require('sox');var csv=require(_0x7765('0x7'));var ejs=require(_0x7765('0x8'));var fs=require('fs');var fs_extra=require(_0x7765('0x9'));var _=require(_0x7765('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7765('0xb'));var toCsv=require(_0x7765('0x7'));var querystring=require(_0x7765('0xc'));var Papa=require(_0x7765('0xd'));var Redis=require('ioredis');var authService=require(_0x7765('0xe'));var qs=require(_0x7765('0xf'));var as=require(_0x7765('0x10'));var hardwareService=require(_0x7765('0x11'));var logger=require(_0x7765('0x12'))(_0x7765('0x13'));var utils=require('../../config/utils');var config=require(_0x7765('0x14'));var licenseUtil=require(_0x7765('0x15'));var db=require(_0x7765('0x16'))['db'];function respondWithStatusCode(_0x9ccbe9,_0x6b9f5a){_0x6b9f5a=_0x6b9f5a||0xcc;return function(_0x553a0e){if(_0x553a0e){return _0x9ccbe9[_0x7765('0x17')](_0x6b9f5a);}return _0x9ccbe9[_0x7765('0x18')](_0x6b9f5a)['end']();};}function respondWithResult(_0x2c73c8,_0x4ce20b){_0x4ce20b=_0x4ce20b||0xc8;return function(_0x58c41a){if(_0x58c41a){return _0x2c73c8[_0x7765('0x18')](_0x4ce20b)['json'](_0x58c41a);}};}function respondWithFilteredResult(_0x5f0fcb,_0x4f4ae2){return function(_0x4bf5f6){if(_0x4bf5f6){var _0x5d7e32=typeof _0x4f4ae2[_0x7765('0x19')]===_0x7765('0x1a')&&typeof _0x4f4ae2[_0x7765('0x1b')]===_0x7765('0x1a');var _0x5a8b4d=_0x4bf5f6[_0x7765('0x1c')];var _0x1b3038=_0x5d7e32?0x0:_0x4f4ae2['offset'];var _0x3b554b=_0x5d7e32?_0x4bf5f6['count']:_0x4f4ae2[_0x7765('0x19')]+_0x4f4ae2[_0x7765('0x1b')];var _0x2edcf7;if(_0x3b554b>=_0x5a8b4d){_0x3b554b=_0x5a8b4d;_0x2edcf7=0xc8;}else{_0x2edcf7=0xce;}_0x5f0fcb[_0x7765('0x18')](_0x2edcf7);return _0x5f0fcb[_0x7765('0x1d')](_0x7765('0x1e'),_0x1b3038+'-'+_0x3b554b+'/'+_0x5a8b4d)[_0x7765('0x1f')](_0x4bf5f6);}return null;};}function patchUpdates(_0x370ca5){return function(_0x3a46c2){try{jsonpatch[_0x7765('0x20')](_0x3a46c2,_0x370ca5,!![]);}catch(_0x11d5cb){return BPromise['reject'](_0x11d5cb);}return _0x3a46c2[_0x7765('0x21')]();};}function saveUpdates(_0x142a90,_0x5846bc){return function(_0x46ac8a){if(_0x46ac8a){return _0x46ac8a[_0x7765('0x22')](_0x142a90)[_0x7765('0x23')](function(_0xe6e6c7){return _0xe6e6c7;});}return null;};}function removeEntity(_0x228ac6,_0x107b96){return function(_0x4188f8){if(_0x4188f8){return _0x4188f8[_0x7765('0x24')]()[_0x7765('0x23')](function(){_0x228ac6[_0x7765('0x18')](0xcc)[_0x7765('0x25')]();});}};}function handleEntityNotFound(_0x4d7200,_0x5aa361){return function(_0x50b13e){if(!_0x50b13e){_0x4d7200[_0x7765('0x17')](0x194);}return _0x50b13e;};}function handleError(_0x45d39b,_0x25fc8c){_0x25fc8c=_0x25fc8c||0x1f4;return function(_0x324e12){logger[_0x7765('0x26')](_0x324e12[_0x7765('0x27')]);if(_0x324e12[_0x7765('0x28')]){delete _0x324e12[_0x7765('0x28')];}_0x45d39b[_0x7765('0x18')](_0x25fc8c)['send'](_0x324e12);};}exports['index']=function(_0x638bc7,_0xac0782){var _0x5b0b8f={},_0x463534={},_0x22b6cd={'count':0x0,'rows':[]};var _0x582550=_[_0x7765('0x29')](db[_0x7765('0x2a')][_0x7765('0x2b')],function(_0x3a8ec8){return{'name':_0x3a8ec8[_0x7765('0x2c')],'type':_0x3a8ec8[_0x7765('0x2d')][_0x7765('0x2e')]};});_0x463534[_0x7765('0x2f')]=_[_0x7765('0x29')](_0x582550,_0x7765('0x28'));_0x463534[_0x7765('0x30')]=_[_0x7765('0x31')](_0x638bc7['query']);_0x463534[_0x7765('0x32')]=_[_0x7765('0x33')](_0x463534['model'],_0x463534[_0x7765('0x30')]);_0x5b0b8f[_0x7765('0x34')]=_[_0x7765('0x33')](_0x463534[_0x7765('0x2f')],qs[_0x7765('0x35')](_0x638bc7[_0x7765('0x30')]['fields']));_0x5b0b8f[_0x7765('0x34')]=_0x5b0b8f[_0x7765('0x34')][_0x7765('0x36')]?_0x5b0b8f[_0x7765('0x34')]:_0x463534[_0x7765('0x2f')];if(!_0x638bc7[_0x7765('0x30')][_0x7765('0x37')](_0x7765('0x38'))){_0x5b0b8f[_0x7765('0x1b')]=qs[_0x7765('0x1b')](_0x638bc7['query'][_0x7765('0x1b')]);_0x5b0b8f['offset']=qs[_0x7765('0x19')](_0x638bc7[_0x7765('0x30')][_0x7765('0x19')]);}_0x5b0b8f[_0x7765('0x39')]=qs[_0x7765('0x3a')](_0x638bc7[_0x7765('0x30')][_0x7765('0x3a')]);_0x5b0b8f[_0x7765('0x3b')]=qs['filters'](_[_0x7765('0x3c')](_0x638bc7[_0x7765('0x30')],_0x463534[_0x7765('0x32')]),_0x582550);if(_0x638bc7['query'][_0x7765('0x3d')]){_0x5b0b8f[_0x7765('0x3b')]=_[_0x7765('0x3e')](_0x5b0b8f[_0x7765('0x3b')],{'$or':_[_0x7765('0x29')](_0x582550,function(_0x4f7d84){if(_0x4f7d84[_0x7765('0x2d')]!==_0x7765('0x3f')){var _0x44898d={};_0x44898d[_0x4f7d84[_0x7765('0x28')]]={'$like':'%'+_0x638bc7[_0x7765('0x30')][_0x7765('0x3d')]+'%'};return _0x44898d;}})});}_0x5b0b8f=_[_0x7765('0x3e')]({},_0x5b0b8f,_0x638bc7[_0x7765('0x40')]);var _0x2481b5={'where':_0x5b0b8f['where']};return db[_0x7765('0x2a')][_0x7765('0x1c')](_0x2481b5)[_0x7765('0x23')](function(_0x1f3fc4){_0x22b6cd['count']=_0x1f3fc4;if(_0x638bc7['query'][_0x7765('0x41')]){_0x5b0b8f[_0x7765('0x42')]=[{'all':!![]}];}return db[_0x7765('0x2a')][_0x7765('0x43')](_0x5b0b8f);})[_0x7765('0x23')](function(_0x48c935){_0x22b6cd[_0x7765('0x44')]=_0x48c935;return _0x22b6cd;})[_0x7765('0x23')](respondWithFilteredResult(_0xac0782,_0x5b0b8f))['catch'](handleError(_0xac0782,null));};exports[_0x7765('0x45')]=function(_0xaf8bab,_0x5a30e7){var _0x274b06={'raw':!![],'where':{'id':_0xaf8bab[_0x7765('0x46')]['id']}},_0x44b6f2={};_0x44b6f2[_0x7765('0x2f')]=_[_0x7765('0x31')](db['VoiceTransferReport'][_0x7765('0x2b')]);_0x44b6f2[_0x7765('0x30')]=_[_0x7765('0x31')](_0xaf8bab['query']);_0x44b6f2[_0x7765('0x32')]=_['intersection'](_0x44b6f2['model'],_0x44b6f2[_0x7765('0x30')]);_0x274b06[_0x7765('0x34')]=_[_0x7765('0x33')](_0x44b6f2['model'],qs[_0x7765('0x35')](_0xaf8bab[_0x7765('0x30')][_0x7765('0x35')]));_0x274b06[_0x7765('0x34')]=_0x274b06[_0x7765('0x34')][_0x7765('0x36')]?_0x274b06[_0x7765('0x34')]:_0x44b6f2['model'];if(_0xaf8bab[_0x7765('0x30')][_0x7765('0x41')]){_0x274b06[_0x7765('0x42')]=[{'all':!![]}];}_0x274b06=_[_0x7765('0x3e')]({},_0x274b06,_0xaf8bab[_0x7765('0x40')]);return db[_0x7765('0x2a')][_0x7765('0x47')](_0x274b06)[_0x7765('0x23')](handleEntityNotFound(_0x5a30e7,null))[_0x7765('0x23')](respondWithResult(_0x5a30e7,null))[_0x7765('0x48')](handleError(_0x5a30e7,null));};exports[_0x7765('0x49')]=function(_0x4abad9,_0xbb6f7a){return db['VoiceTransferReport'][_0x7765('0x49')](_0x4abad9[_0x7765('0x4a')],{})[_0x7765('0x23')](respondWithResult(_0xbb6f7a,0xc9))[_0x7765('0x48')](handleError(_0xbb6f7a,null));};exports[_0x7765('0x22')]=function(_0x1d483f,_0x370bd8){if(_0x1d483f[_0x7765('0x4a')]['id']){delete _0x1d483f[_0x7765('0x4a')]['id'];}return db[_0x7765('0x2a')]['find']({'where':{'id':_0x1d483f['params']['id']}})[_0x7765('0x23')](handleEntityNotFound(_0x370bd8,null))['then'](saveUpdates(_0x1d483f[_0x7765('0x4a')],null))[_0x7765('0x23')](respondWithResult(_0x370bd8,null))[_0x7765('0x48')](handleError(_0x370bd8,null));};exports[_0x7765('0x24')]=function(_0x42e368,_0x2908a2){return db['VoiceTransferReport'][_0x7765('0x47')]({'where':{'id':_0x42e368[_0x7765('0x46')]['id']}})['then'](handleEntityNotFound(_0x2908a2,null))[_0x7765('0x23')](removeEntity(_0x2908a2,null))['catch'](handleError(_0x2908a2,null));};exports[_0x7765('0x4b')]=function(_0x1ad786,_0x50f7ff){return db[_0x7765('0x2a')][_0x7765('0x4b')]()[_0x7765('0x23')](respondWithResult(_0x50f7ff,null))['catch'](handleError(_0x50f7ff,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 34ef284..b4b1f45 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 _0x91aa=['../../config/logger','api','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x91aa,0x98));var _0xa91a=function(_0x1f1e89,_0x1b054a){_0x1f1e89=_0x1f1e89-0x0;var _0x3e1c99=_0x91aa[_0x1f1e89];return _0x3e1c99;};'use strict';var _=require(_0xa91a('0x0'));var util=require(_0xa91a('0x1'));var logger=require(_0xa91a('0x2'))(_0xa91a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa91a('0x4'));var rimraf=require(_0xa91a('0x5'));var config=require(_0xa91a('0x6'));var attributes=require(_0xa91a('0x7'));module[_0xa91a('0x8')]=function(_0x5dd341,_0x1fb10a){return _0x5dd341[_0xa91a('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xa91a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util'];(function(_0x49841c,_0x4e0459){var _0x251324=function(_0x1e0445){while(--_0x1e0445){_0x49841c['push'](_0x49841c['shift']());}};_0x251324(++_0x4e0459);}(_0xd8ef,0x74));var _0xfd8e=function(_0x3ed99f,_0x3bad0b){_0x3ed99f=_0x3ed99f-0x0;var _0x52de2f=_0xd8ef[_0x3ed99f];return _0x52de2f;};'use strict';var _=require('lodash');var util=require(_0xfd8e('0x0'));var logger=require(_0xfd8e('0x1'))('api');var moment=require(_0xfd8e('0x2'));var BPromise=require(_0xfd8e('0x3'));var rp=require(_0xfd8e('0x4'));var fs=require('fs');var path=require(_0xfd8e('0x5'));var rimraf=require(_0xfd8e('0x6'));var config=require(_0xfd8e('0x7'));var attributes=require(_0xfd8e('0x8'));module[_0xfd8e('0x9')]=function(_0x573021,_0xcb1f44){return _0x573021[_0xfd8e('0xa')](_0xfd8e('0xb'),attributes,{'tableName':_0xfd8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index da3ba7f..45c97ea 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 _0x2eeb=['message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2eeb,0x1ae));var _0xb2ee=function(_0x2387c5,_0xfcc74c){_0x2387c5=_0x2387c5-0x0;var _0x2c414c=_0x2eeb[_0x2387c5];return _0x2c414c;};'use strict';var _=require(_0xb2ee('0x0'));var util=require(_0xb2ee('0x1'));var moment=require(_0xb2ee('0x2'));var BPromise=require(_0xb2ee('0x3'));var rs=require(_0xb2ee('0x4'));var fs=require('fs');var Redis=require(_0xb2ee('0x5'));var db=require(_0xb2ee('0x6'))['db'];var utils=require(_0xb2ee('0x7'));var logger=require(_0xb2ee('0x8'))('rpc');var config=require(_0xb2ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb2ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x225bc7,_0x1a3ca4,_0x39c180){return new BPromise(function(_0x218566,_0x10e687){return client[_0xb2ee('0xb')](_0x225bc7,_0x39c180)[_0xb2ee('0xc')](function(_0x3b3bf5){logger[_0xb2ee('0xd')](_0xb2ee('0xe'),_0x1a3ca4,'request\x20sent');logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1a3ca4,_0xb2ee('0xf'),JSON['stringify'](_0x3b3bf5));if(_0x3b3bf5[_0xb2ee('0x10')]){if(_0x3b3bf5[_0xb2ee('0x10')][_0xb2ee('0x11')]===0x1f4){logger[_0xb2ee('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x1a3ca4,_0x3b3bf5['error'][_0xb2ee('0x12')]);return _0x10e687(_0x3b3bf5[_0xb2ee('0x10')]['message']);}logger[_0xb2ee('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x1a3ca4,_0x3b3bf5['error'][_0xb2ee('0x12')]);return _0x218566(_0x3b3bf5[_0xb2ee('0x10')][_0xb2ee('0x12')]);}else{logger[_0xb2ee('0xd')](_0xb2ee('0xe'),_0x1a3ca4,_0xb2ee('0xf'));_0x218566(_0x3b3bf5[_0xb2ee('0x13')][_0xb2ee('0x12')]);}})[_0xb2ee('0x14')](function(_0x8ecedb){logger[_0xb2ee('0x10')](_0xb2ee('0xe'),_0x1a3ca4,_0x8ecedb);_0x10e687(_0x8ecedb);});});}exports[_0xb2ee('0x15')]=function(_0x31c299){var _0x12f8b7=this;return new Promise(function(_0x2fc89e,_0x113371){return db[_0xb2ee('0x16')][_0xb2ee('0x17')](_0x31c299['body'],{'raw':_0x31c299[_0xb2ee('0x18')]?_0x31c299[_0xb2ee('0x18')][_0xb2ee('0x19')]===undefined?!![]:![]:!![]})[_0xb2ee('0xc')](function(_0x5b26e0){logger[_0xb2ee('0xd')](_0xb2ee('0x15'),_0x31c299);logger[_0xb2ee('0x1a')]('CreateVoiceTransferReport',_0x31c299,JSON[_0xb2ee('0x1b')](_0x5b26e0));_0x2fc89e(_0x5b26e0);})[_0xb2ee('0x14')](function(_0x46bbe3){logger[_0xb2ee('0x10')](_0xb2ee('0x15'),_0x46bbe3[_0xb2ee('0x12')],_0x31c299);_0x113371(_0x12f8b7[_0xb2ee('0x10')](0x1f4,_0x46bbe3['message']));});});}; \ No newline at end of file +var _0xc509=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','moment','bluebird','randomstring','ioredis'];(function(_0x55b409,_0x1815df){var _0x2ab6c4=function(_0x1aa4d7){while(--_0x1aa4d7){_0x55b409['push'](_0x55b409['shift']());}};_0x2ab6c4(++_0x1815df);}(_0xc509,0x192));var _0x9c50=function(_0x3f3998,_0x26cbb7){_0x3f3998=_0x3f3998-0x0;var _0x40e0c1=_0xc509[_0x3f3998];return _0x40e0c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c50('0x0'));var BPromise=require(_0x9c50('0x1'));var rs=require(_0x9c50('0x2'));var fs=require('fs');var Redis=require(_0x9c50('0x3'));var db=require(_0x9c50('0x4'))['db'];var utils=require(_0x9c50('0x5'));var logger=require(_0x9c50('0x6'))(_0x9c50('0x7'));var config=require(_0x9c50('0x8'));var jayson=require(_0x9c50('0x9'));var client=jayson['client'][_0x9c50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x904908,_0x5a8a50,_0x170f70){return new BPromise(function(_0x36dd9b,_0x2d5a6){return client[_0x9c50('0xb')](_0x904908,_0x170f70)[_0x9c50('0xc')](function(_0x27b2b6){logger[_0x9c50('0xd')](_0x9c50('0xe'),_0x5a8a50,_0x9c50('0xf'));logger[_0x9c50('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5a8a50,_0x9c50('0xf'),JSON[_0x9c50('0x11')](_0x27b2b6));if(_0x27b2b6[_0x9c50('0x12')]){if(_0x27b2b6['error'][_0x9c50('0x13')]===0x1f4){logger[_0x9c50('0x12')](_0x9c50('0xe'),_0x5a8a50,_0x27b2b6[_0x9c50('0x12')][_0x9c50('0x14')]);return _0x2d5a6(_0x27b2b6[_0x9c50('0x12')][_0x9c50('0x14')]);}logger[_0x9c50('0x12')](_0x9c50('0xe'),_0x5a8a50,_0x27b2b6['error']['message']);return _0x36dd9b(_0x27b2b6['error']['message']);}else{logger[_0x9c50('0xd')](_0x9c50('0xe'),_0x5a8a50,'request\x20sent');_0x36dd9b(_0x27b2b6[_0x9c50('0x15')][_0x9c50('0x14')]);}})[_0x9c50('0x16')](function(_0x362b2e){logger['error'](_0x9c50('0xe'),_0x5a8a50,_0x362b2e);_0x2d5a6(_0x362b2e);});});}exports[_0x9c50('0x17')]=function(_0x255a3c){var _0x3c63b9=this;return new Promise(function(_0x4667db,_0x2e534e){return db[_0x9c50('0x18')][_0x9c50('0x19')](_0x255a3c[_0x9c50('0x1a')],{'raw':_0x255a3c['options']?_0x255a3c[_0x9c50('0x1b')][_0x9c50('0x1c')]===undefined?!![]:![]:!![]})[_0x9c50('0xc')](function(_0x2939b8){logger['info'](_0x9c50('0x17'),_0x255a3c);logger[_0x9c50('0x10')](_0x9c50('0x17'),_0x255a3c,JSON[_0x9c50('0x11')](_0x2939b8));_0x4667db(_0x2939b8);})[_0x9c50('0x16')](function(_0x2ad12c){logger['error']('CreateVoiceTransferReport',_0x2ad12c[_0x9c50('0x14')],_0x255a3c);_0x2e534e(_0x3c63b9[_0x9c50('0x12')](0x1f4,_0x2ad12c['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 58bd363..fb11bcb 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 _0x4cfa=['post','/originate','isAuthenticated','canUpdate','originate','/hold','hold','/unhold','calls','/transfer','transfer','exports','express','Router','./webbar.controller'];(function(_0x388146,_0x3daa4a){var _0x5edd1f=function(_0x456af9){while(--_0x456af9){_0x388146['push'](_0x388146['shift']());}};_0x5edd1f(++_0x3daa4a);}(_0x4cfa,0x1ec));var _0xa4cf=function(_0x4095ca,_0x4ffe94){_0x4095ca=_0x4095ca-0x0;var _0xdf539=_0x4cfa[_0x4095ca];return _0xdf539;};'use strict';var express=require(_0xa4cf('0x0'));var router=express[_0xa4cf('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa4cf('0x2'));router[_0xa4cf('0x3')](_0xa4cf('0x4'),auth[_0xa4cf('0x5')](),auth[_0xa4cf('0x6')](),controller[_0xa4cf('0x7')]);router[_0xa4cf('0x3')]('/hangup',auth[_0xa4cf('0x5')](),auth[_0xa4cf('0x6')](),controller['hangup']);router[_0xa4cf('0x3')]('/answer',auth['isAuthenticated'](),auth[_0xa4cf('0x6')](),controller['answer']);router[_0xa4cf('0x3')](_0xa4cf('0x8'),auth[_0xa4cf('0x5')](),auth[_0xa4cf('0x6')](),controller[_0xa4cf('0x9')]);router[_0xa4cf('0x3')](_0xa4cf('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller['unhold']);router[_0xa4cf('0x3')]('/calls',auth[_0xa4cf('0x5')](),auth['canUpdate'](),controller[_0xa4cf('0xb')]);router[_0xa4cf('0x3')](_0xa4cf('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa4cf('0xd')]);module[_0xa4cf('0xe')]=router; \ No newline at end of file +var _0x43f9=['Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','/answer','answer','/hold','/unhold','/calls','calls','/transfer','exports','express'];(function(_0x5497bd,_0x2329b4){var _0x2df361=function(_0x11ded5){while(--_0x11ded5){_0x5497bd['push'](_0x5497bd['shift']());}};_0x2df361(++_0x2329b4);}(_0x43f9,0x6f));var _0x943f=function(_0x5db6b6,_0x543fc8){_0x5db6b6=_0x5db6b6-0x0;var _0x520e15=_0x43f9[_0x5db6b6];return _0x520e15;};'use strict';var express=require(_0x943f('0x0'));var router=express[_0x943f('0x1')]();var auth=require(_0x943f('0x2'));var controller=require(_0x943f('0x3'));router[_0x943f('0x4')](_0x943f('0x5'),auth[_0x943f('0x6')](),auth['canUpdate'](),controller['originate']);router[_0x943f('0x4')]('/hangup',auth[_0x943f('0x6')](),auth[_0x943f('0x7')](),controller['hangup']);router[_0x943f('0x4')](_0x943f('0x8'),auth[_0x943f('0x6')](),auth[_0x943f('0x7')](),controller[_0x943f('0x9')]);router[_0x943f('0x4')](_0x943f('0xa'),auth[_0x943f('0x6')](),auth[_0x943f('0x7')](),controller['hold']);router[_0x943f('0x4')](_0x943f('0xb'),auth[_0x943f('0x6')](),auth[_0x943f('0x7')](),controller['unhold']);router[_0x943f('0x4')](_0x943f('0xc'),auth['isAuthenticated'](),auth[_0x943f('0x7')](),controller[_0x943f('0xd')]);router[_0x943f('0x4')](_0x943f('0xe'),auth['isAuthenticated'](),auth['canUpdate'](),controller['transfer']);module[_0x943f('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index f5d27a3..afee22c 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 _0x22fb=['../../mysqldb','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','request','then','message','result','findOne','agent','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20executed!','calls','VoiceChannels','UserId','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!'];(function(_0x183049,_0x4b279){var _0xbea4b8=function(_0x107785){while(--_0x107785){_0x183049['push'](_0x183049['shift']());}};_0xbea4b8(++_0x4b279);}(_0x22fb,0x192));var _0xb22f=function(_0x21c1d5,_0x19585b){_0x21c1d5=_0x21c1d5-0x0;var _0x47ba78=_0x22fb[_0x21c1d5];return _0x47ba78;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xb22f('0x0'))['db'];var config=require('../../config/environment');var util=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var jayson=require(_0xb22f('0x3'));var amiClient=jayson[_0xb22f('0x4')][_0xb22f('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0xb22f('0x6'));var Redis=require(_0xb22f('0x7'));config[_0xb22f('0x8')]=_[_0xb22f('0x9')](config[_0xb22f('0x8')],{'host':_0xb22f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb22f('0x8')]));var Schema=require(_0xb22f('0xb'));var originateValidation=new Schema({'userId':{'type':_0xb22f('0xc'),'required':[!![],_0xb22f('0xd')]},'callNumber':{'type':_0xb22f('0xe'),'required':[!![],_0xb22f('0xf')]},'callerId':{'type':_0xb22f('0xe')},'callbackUrl':{'type':_0xb22f('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xb22f('0xc'),'required':[!![],_0xb22f('0xd')]},'sessionId':{'type':_0xb22f('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb22f('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xb22f('0xe'),'required':[!![],_0xb22f('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xb22f('0xc'),'required':[!![],_0xb22f('0xd')]},'sessionId':{'type':_0xb22f('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb22f('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb22f('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb22f('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb22f('0xd')]}});function emit(_0x514a8f,_0x160417,_0xc36af4){logger[_0xb22f('0x11')](_0x514a8f,_0x160417,JSON['stringify'](_0xc36af4));io['to'](_0x514a8f)[_0xb22f('0x12')](_0x160417,_0xc36af4);}function handleError(_0x53a59b){return function(_0x252742){console[_0xb22f('0x13')](_0xb22f('0x14'),_0x252742,_0x252742 instanceof RangeError);logger[_0xb22f('0x15')](_0x252742[_0xb22f('0x16')]);if(_0x252742 instanceof RangeError){if(_0x252742[_0xb22f('0x17')]){delete _0x252742['name'];}_0x53a59b[_0xb22f('0x18')](0x194)['send'](_0x252742);}else{if(_0x252742[_0xb22f('0x17')]){delete _0x252742[_0xb22f('0x17')];}_0x53a59b[_0xb22f('0x18')](0x1f4)[_0xb22f('0x19')](_0x252742);}};}function checkError(){return function(_0x493a63){if(!_0x493a63){throw new RangeError('NotFound');}return _0x493a63;};}function respondWithRpcPromise(_0x47d5cf,_0x3da442){return new BPromise(function(_0x19e480,_0xf34e0d){var _0x16e465=amiClient;return _0x16e465[_0xb22f('0x1a')](_0x47d5cf,_0x3da442)[_0xb22f('0x1b')](function(_0x201764){if(_0x201764[_0xb22f('0x15')]){if(_0x201764['error']['code']===0x1f4){return _0xf34e0d(_0x201764[_0xb22f('0x15')][_0xb22f('0x1c')]);}return _0x19e480(_0x201764['error'][_0xb22f('0x1c')]);}else{_0x19e480(_0x201764[_0xb22f('0x1d')]);}})['catch'](function(_0x4687f2){_0xf34e0d(_0x4687f2);});});}function getAgent(_0x2918be){return db['User'][_0xb22f('0x1e')]({'where':{'id':_0x2918be,'role':_0xb22f('0x1f')}})[_0xb22f('0x1b')](checkError());}function getAgentCheckSession(_0xec047c,_0x3bf205){return new BPromise(function(_0x246a0c,_0x439fc2){var _0x2ae6d4=respondWithRpcPromise('VoiceChannels');var _0x483cc3=getAgent(_0xec047c);Promise['all']([_0x2ae6d4,_0x483cc3])[_0xb22f('0x1b')](function(_0x557d96){var _0x327200=_0x557d96[0x0];var _0xc7f33b=_0x557d96[0x1];var _0xf268f4=_[_0xb22f('0x20')](_0x327200[_0xb22f('0x21')],function(_0x5b2a42){return _0x5b2a42['UserId']==_0xc7f33b['id']&&_0x5b2a42[_0xb22f('0x22')]==_0x3bf205;});if(_0xf268f4[_0xb22f('0x23')]==0x1){_0x246a0c(_0xc7f33b);}else{_0x439fc2(new RangeError(_0xb22f('0x24')+_0x3bf205+_0xb22f('0x25')));}});});}exports['originate']=function(_0x176133,_0x29ad43){logger['info'](_0xb22f('0x26'),_0x176133[_0xb22f('0x27')]);var _0x308ecd=originateValidation[_0xb22f('0xb')](_0x176133[_0xb22f('0x27')]);if(_0x308ecd['length']>0x0){return _0x29ad43['status'](0x190)[_0xb22f('0x28')](_0x308ecd);}var _0x2082d5=_0x176133[_0xb22f('0x27')][_0xb22f('0x29')];var _0x2e1758=_0x176133[_0xb22f('0x27')][_0xb22f('0x2a')];var _0x3a2186=_0x176133[_0xb22f('0x27')]['callerId'];var _0xab153b=_0x176133['body']['callbackUrl'];return getAgent(_0x2082d5)[_0xb22f('0x1b')](function(_0x27d03d){logger[_0xb22f('0x11')](_0xb22f('0x2b'),_0x27d03d[_0xb22f('0x17')]);emit(util[_0xb22f('0x2c')](_0xb22f('0x2d'),_0x27d03d[_0xb22f('0x17')]),_0xb22f('0x2e'),{'callNumber':_0x2e1758,'callerId':_0x3a2186,'callbackUrl':_0xab153b});return _0x29ad43[_0xb22f('0x18')](0xc8)[_0xb22f('0x28')]({'error':![],'message':_0xb22f('0x2f')});})[_0xb22f('0x30')](handleError(_0x29ad43));};exports['hangup']=function(_0x519eb4,_0x3e5ade){logger[_0xb22f('0x11')](_0xb22f('0x31'),_0x519eb4['body']);var _0xea3cc8=hangupValidation[_0xb22f('0xb')](_0x519eb4['body']);if(_0xea3cc8['length']>0x0){return _0x3e5ade[_0xb22f('0x18')](0x190)['json'](_0xea3cc8);}var _0x234d17=_0x519eb4['body'][_0xb22f('0x29')];var _0x43976d=_0x519eb4[_0xb22f('0x27')]['sessionId'];return getAgent(_0x234d17)[_0xb22f('0x1b')](function(_0x2d265c){logger[_0xb22f('0x11')]('entityFound:',_0x2d265c[_0xb22f('0x17')]);emit(util[_0xb22f('0x2c')](_0xb22f('0x2d'),_0x2d265c[_0xb22f('0x17')]),_0xb22f('0x32'),{'sessionId':_0x43976d});return _0x3e5ade[_0xb22f('0x18')](0xc8)[_0xb22f('0x28')]({'error':![],'message':_0xb22f('0x33')});})[_0xb22f('0x30')](handleError(_0x3e5ade));};exports[_0xb22f('0x34')]=function(_0x58db7e,_0x37817a){logger[_0xb22f('0x11')]('answer\x20fired:',_0x58db7e[_0xb22f('0x27')]);var _0x4be0de=answerValidation['validate'](_0x58db7e[_0xb22f('0x27')]);if(_0x4be0de[_0xb22f('0x23')]>0x0){return _0x37817a[_0xb22f('0x18')](0x190)[_0xb22f('0x28')](_0x4be0de);}var _0x563740=_0x58db7e[_0xb22f('0x27')]['userId'];var _0xddfda6=_0x58db7e[_0xb22f('0x27')][_0xb22f('0x22')];return getAgent(_0x563740)[_0xb22f('0x1b')](function(_0x364a76){logger[_0xb22f('0x11')]('entityFound:',_0x364a76[_0xb22f('0x17')]);emit(util['format'](_0xb22f('0x2d'),_0x364a76[_0xb22f('0x17')]),'webbar:answer',{'sessionId':_0xddfda6});return _0x37817a[_0xb22f('0x18')](0xc8)[_0xb22f('0x28')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x37817a));};exports[_0xb22f('0x35')]=function(_0x577416,_0x217e60){logger[_0xb22f('0x11')](_0xb22f('0x36'),_0x577416[_0xb22f('0x27')]);var _0x490536=holdValidation[_0xb22f('0xb')](_0x577416[_0xb22f('0x27')]);if(_0x490536['length']>0x0){return _0x217e60[_0xb22f('0x18')](0x190)[_0xb22f('0x28')](_0x490536);}var _0x411723=_0x577416[_0xb22f('0x27')][_0xb22f('0x29')];var _0x589e82=_0x577416[_0xb22f('0x27')]['sessionId'];return getAgent(_0x411723)['then'](function(_0x3fb0ac){logger[_0xb22f('0x11')](_0xb22f('0x2b'),_0x3fb0ac[_0xb22f('0x17')]);emit(util[_0xb22f('0x2c')]('user:%s',_0x3fb0ac[_0xb22f('0x17')]),'webbar:hold',{'sessionId':_0x589e82});return _0x217e60[_0xb22f('0x18')](0xc8)['json']({'error':![],'message':_0xb22f('0x37')});})[_0xb22f('0x30')](handleError(_0x217e60));};exports[_0xb22f('0x38')]=function(_0x58cd19,_0x299156){logger[_0xb22f('0x11')]('unhold\x20fired:',_0x58cd19[_0xb22f('0x27')]);var _0x463773=unholdValidation['validate'](_0x58cd19['body']);if(_0x463773[_0xb22f('0x23')]>0x0){return _0x299156[_0xb22f('0x18')](0x190)['json'](_0x463773);}var _0xba9da8=_0x58cd19[_0xb22f('0x27')]['userId'];var _0x5a7927=_0x58cd19[_0xb22f('0x27')][_0xb22f('0x22')];return getAgent(_0xba9da8)['then'](function(_0x13ac40){logger[_0xb22f('0x11')](_0xb22f('0x2b'),_0x13ac40[_0xb22f('0x17')]);emit(util['format'](_0xb22f('0x2d'),_0x13ac40[_0xb22f('0x17')]),'webbar:unhold',{'sessionId':_0x5a7927});return _0x299156['status'](0xc8)[_0xb22f('0x28')]({'error':![],'message':_0xb22f('0x39')});})[_0xb22f('0x30')](handleError(_0x299156));};exports[_0xb22f('0x3a')]=function(_0x4ec174,_0x29523c){logger[_0xb22f('0x11')]('calls\x20fired:',_0x29523c[_0xb22f('0x27')]);var _0x34e0f0=callsValidation[_0xb22f('0xb')](_0x4ec174[_0xb22f('0x27')]);if(_0x34e0f0[_0xb22f('0x23')]>0x0){return _0x29523c[_0xb22f('0x18')](0x190)[_0xb22f('0x28')](_0x34e0f0);}var _0x502c7f=_0x4ec174[_0xb22f('0x27')][_0xb22f('0x29')];var _0x34e2d4=respondWithRpcPromise(_0xb22f('0x3b'));var _0x395659=getAgent(_0x502c7f);return Promise['all']([_0x34e2d4,_0x395659])['then'](function(_0x287c10){var _0x390b75=_0x287c10[0x0];var _0x14df74=_0x287c10[0x1];var _0x4fbc63=_[_0xb22f('0x20')](_0x390b75[_0xb22f('0x21')],function(_0x453b9b){return _0x453b9b[_0xb22f('0x3c')]==_0x14df74['id'];});return _0x29523c[_0xb22f('0x18')](0xc8)[_0xb22f('0x28')]({'count':_0x4fbc63[_0xb22f('0x23')],'rows':_0x4fbc63});})[_0xb22f('0x30')](handleError(_0x29523c));};exports['conference']=function(_0x552624,_0x35320e){logger[_0xb22f('0x11')]('conference\x20fired:',_0x552624['body']);var _0x83957a=conferenceValidation[_0xb22f('0xb')](_0x552624['body']);if(_0x83957a['length']>0x0){return _0x35320e[_0xb22f('0x18')](0x190)['json'](_0x83957a);}var _0x8d2b3e=_0x552624[_0xb22f('0x27')][_0xb22f('0x29')];return getAgent(_0x8d2b3e)['then'](function(_0x5469f7){logger[_0xb22f('0x11')]('entityFound:',_0x5469f7[_0xb22f('0x17')]);emit(util[_0xb22f('0x2c')](_0xb22f('0x2d'),_0x5469f7['name']),'webbar:conference');return _0x35320e[_0xb22f('0x18')](0xc8)['json']({'error':![],'message':_0xb22f('0x3d')});})[_0xb22f('0x30')](handleError(_0x35320e));};exports[_0xb22f('0x3e')]=function(_0x4d5074,_0x4464bd){logger['info'](_0xb22f('0x3f'),_0x4d5074[_0xb22f('0x27')]);var _0x30c305=transferValidation[_0xb22f('0xb')](_0x4d5074[_0xb22f('0x27')]);if(_0x30c305[_0xb22f('0x23')]>0x0){return _0x4464bd[_0xb22f('0x18')](0x190)[_0xb22f('0x28')](_0x30c305);}var _0x22eaa5=_0x4d5074['body'][_0xb22f('0x29')];var _0x1487e7=_0x4d5074[_0xb22f('0x27')]['sessionId'];var _0x18d55b=_0x4d5074[_0xb22f('0x27')][_0xb22f('0x40')];return getAgent(_0x22eaa5)[_0xb22f('0x1b')](function(_0x492280){logger['info'](_0xb22f('0x2b'),_0x492280['name']);emit(util[_0xb22f('0x2c')](_0xb22f('0x2d'),_0x492280[_0xb22f('0x17')]),_0xb22f('0x41'),{'sessionId':_0x1487e7,'transferNumber':_0x18d55b});return _0x4464bd[_0xb22f('0x18')](0xc8)[_0xb22f('0x28')]({'error':![],'message':_0xb22f('0x42')});})[_0xb22f('0x30')](handleError(_0x4464bd));}; \ No newline at end of file +var _0xf109=['message','result','catch','then','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','info','emit','log','error','name','send','status','NotFound','request'];(function(_0x2afb96,_0xf0f67e){var _0x37d3f2=function(_0x24087c){while(--_0x24087c){_0x2afb96['push'](_0x2afb96['shift']());}};_0x37d3f2(++_0xf0f67e);}(_0xf109,0xce));var _0x9f10=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf109[_0x342baa];return _0x1208f3;};'use strict';var path=require(_0x9f10('0x0'));var fs=require('fs');var _=require(_0x9f10('0x1'));var db=require(_0x9f10('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x9f10('0x3'));var amiClient=jayson[_0x9f10('0x4')][_0x9f10('0x5')]({'port':0x232a});var logger=require(_0x9f10('0x6'))(_0x9f10('0x7'));var Redis=require(_0x9f10('0x8'));config[_0x9f10('0x9')]=_[_0x9f10('0xa')](config[_0x9f10('0x9')],{'host':_0x9f10('0xb'),'port':0x18eb});var io=require(_0x9f10('0xc'))(new Redis(config['redis']));var Schema=require(_0x9f10('0xd'));var originateValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'callNumber':{'type':_0x9f10('0x10'),'required':[!![],_0x9f10('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9f10('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9f10('0xf')]},'sessionId':{'type':_0x9f10('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9f10('0x10'),'required':[!![],_0x9f10('0x12')]},'transferNumber':{'type':_0x9f10('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9f10('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x11154b,_0x5ae255,_0x14d3fe){logger[_0x9f10('0x13')](_0x11154b,_0x5ae255,JSON['stringify'](_0x14d3fe));io['to'](_0x11154b)[_0x9f10('0x14')](_0x5ae255,_0x14d3fe);}function handleError(_0xd2950c){return function(_0x509fba){console[_0x9f10('0x15')]('handleError:',_0x509fba,_0x509fba instanceof RangeError);logger[_0x9f10('0x16')](_0x509fba['stack']);if(_0x509fba instanceof RangeError){if(_0x509fba[_0x9f10('0x17')]){delete _0x509fba['name'];}_0xd2950c['status'](0x194)[_0x9f10('0x18')](_0x509fba);}else{if(_0x509fba[_0x9f10('0x17')]){delete _0x509fba[_0x9f10('0x17')];}_0xd2950c[_0x9f10('0x19')](0x1f4)[_0x9f10('0x18')](_0x509fba);}};}function checkError(){return function(_0x332575){if(!_0x332575){throw new RangeError(_0x9f10('0x1a'));}return _0x332575;};}function respondWithRpcPromise(_0x4cdc00,_0x366044){return new BPromise(function(_0x58e6ba,_0x293990){var _0x36ace4=amiClient;return _0x36ace4[_0x9f10('0x1b')](_0x4cdc00,_0x366044)['then'](function(_0x2f31fb){if(_0x2f31fb[_0x9f10('0x16')]){if(_0x2f31fb[_0x9f10('0x16')]['code']===0x1f4){return _0x293990(_0x2f31fb[_0x9f10('0x16')][_0x9f10('0x1c')]);}return _0x58e6ba(_0x2f31fb[_0x9f10('0x16')]['message']);}else{_0x58e6ba(_0x2f31fb[_0x9f10('0x1d')]);}})[_0x9f10('0x1e')](function(_0x11cae7){_0x293990(_0x11cae7);});});}function getAgent(_0x1647c0){return db['User']['findOne']({'where':{'id':_0x1647c0,'role':'agent'}})[_0x9f10('0x1f')](checkError());}function getAgentCheckSession(_0x4a0407,_0x314794){return new BPromise(function(_0x1de75a,_0x45fffc){var _0x2ed95b=respondWithRpcPromise(_0x9f10('0x20'));var _0x4f6b0c=getAgent(_0x4a0407);Promise[_0x9f10('0x21')]([_0x2ed95b,_0x4f6b0c])[_0x9f10('0x1f')](function(_0x40f96b){var _0xfbb37f=_0x40f96b[0x0];var _0x181aec=_0x40f96b[0x1];var _0x2c4373=_['filter'](_0xfbb37f[_0x9f10('0x22')],function(_0x501ee){return _0x501ee[_0x9f10('0x23')]==_0x181aec['id']&&_0x501ee[_0x9f10('0x24')]==_0x314794;});if(_0x2c4373['length']==0x1){_0x1de75a(_0x181aec);}else{_0x45fffc(new RangeError(_0x9f10('0x25')+_0x314794+_0x9f10('0x26')));}});});}exports[_0x9f10('0x27')]=function(_0x5dd404,_0x434128){logger['info'](_0x9f10('0x28'),_0x5dd404[_0x9f10('0x29')]);var _0x13532b=originateValidation['validate'](_0x5dd404[_0x9f10('0x29')]);if(_0x13532b[_0x9f10('0x2a')]>0x0){return _0x434128[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x13532b);}var _0x148a5b=_0x5dd404['body'][_0x9f10('0x2c')];var _0x4b54b7=_0x5dd404[_0x9f10('0x29')][_0x9f10('0x2d')];var _0x1990da=_0x5dd404[_0x9f10('0x29')][_0x9f10('0x2e')];var _0x12c486=_0x5dd404['body'][_0x9f10('0x2f')];return getAgent(_0x148a5b)[_0x9f10('0x1f')](function(_0x1b8018){logger['info'](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x17')]);emit(util['format'](_0x9f10('0x31'),_0x1b8018['name']),_0x9f10('0x32'),{'callNumber':_0x4b54b7,'callerId':_0x1990da,'callbackUrl':_0x12c486});return _0x434128[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x33')});})[_0x9f10('0x1e')](handleError(_0x434128));};exports[_0x9f10('0x34')]=function(_0x12036c,_0x1db955){logger['info'](_0x9f10('0x35'),_0x12036c[_0x9f10('0x29')]);var _0x2fa4bf=hangupValidation['validate'](_0x12036c[_0x9f10('0x29')]);if(_0x2fa4bf[_0x9f10('0x2a')]>0x0){return _0x1db955['status'](0x190)[_0x9f10('0x2b')](_0x2fa4bf);}var _0x26f0ba=_0x12036c[_0x9f10('0x29')]['userId'];var _0x5c516c=_0x12036c[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x26f0ba)[_0x9f10('0x1f')](function(_0x433e70){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x433e70[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x433e70[_0x9f10('0x17')]),_0x9f10('0x37'),{'sessionId':_0x5c516c});return _0x1db955[_0x9f10('0x19')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x1db955));};exports[_0x9f10('0x38')]=function(_0x5c8c44,_0x420027){logger[_0x9f10('0x13')](_0x9f10('0x39'),_0x5c8c44['body']);var _0x3cfce6=answerValidation[_0x9f10('0xd')](_0x5c8c44[_0x9f10('0x29')]);if(_0x3cfce6[_0x9f10('0x2a')]>0x0){return _0x420027[_0x9f10('0x19')](0x190)['json'](_0x3cfce6);}var _0x578368=_0x5c8c44['body'][_0x9f10('0x2c')];var _0x5d08fb=_0x5c8c44[_0x9f10('0x29')]['sessionId'];return getAgent(_0x578368)[_0x9f10('0x1f')](function(_0x3e8d3c){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x3e8d3c['name']);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x3e8d3c['name']),_0x9f10('0x3a'),{'sessionId':_0x5d08fb});return _0x420027[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x3b')});})[_0x9f10('0x1e')](handleError(_0x420027));};exports[_0x9f10('0x3c')]=function(_0x4bedbe,_0x281da4){logger[_0x9f10('0x13')](_0x9f10('0x3d'),_0x4bedbe['body']);var _0x181eab=holdValidation[_0x9f10('0xd')](_0x4bedbe['body']);if(_0x181eab[_0x9f10('0x2a')]>0x0){return _0x281da4[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x181eab);}var _0x1807b3=_0x4bedbe['body'][_0x9f10('0x2c')];var _0x2ae710=_0x4bedbe[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x1807b3)[_0x9f10('0x1f')](function(_0x43cb31){logger['info'](_0x9f10('0x30'),_0x43cb31[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x43cb31[_0x9f10('0x17')]),_0x9f10('0x3e'),{'sessionId':_0x2ae710});return _0x281da4['status'](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x3f')});})[_0x9f10('0x1e')](handleError(_0x281da4));};exports[_0x9f10('0x40')]=function(_0x39dae3,_0x15d676){logger[_0x9f10('0x13')](_0x9f10('0x41'),_0x39dae3['body']);var _0xd1da11=unholdValidation['validate'](_0x39dae3[_0x9f10('0x29')]);if(_0xd1da11['length']>0x0){return _0x15d676[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0xd1da11);}var _0x30fad9=_0x39dae3[_0x9f10('0x29')][_0x9f10('0x2c')];var _0x497260=_0x39dae3[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x30fad9)[_0x9f10('0x1f')](function(_0x3818dc){logger['info']('entityFound:',_0x3818dc[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')]('user:%s',_0x3818dc['name']),_0x9f10('0x42'),{'sessionId':_0x497260});return _0x15d676[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':'unhold\x20executed!'});})[_0x9f10('0x1e')](handleError(_0x15d676));};exports[_0x9f10('0x43')]=function(_0x7611e8,_0x4c3d18){logger[_0x9f10('0x13')](_0x9f10('0x44'),_0x4c3d18[_0x9f10('0x29')]);var _0x48a76e=callsValidation[_0x9f10('0xd')](_0x7611e8[_0x9f10('0x29')]);if(_0x48a76e['length']>0x0){return _0x4c3d18[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x48a76e);}var _0xcd8ae7=_0x7611e8[_0x9f10('0x29')][_0x9f10('0x2c')];var _0x55cb99=respondWithRpcPromise(_0x9f10('0x20'));var _0x53c384=getAgent(_0xcd8ae7);return Promise['all']([_0x55cb99,_0x53c384])[_0x9f10('0x1f')](function(_0x19b489){var _0x1f109a=_0x19b489[0x0];var _0x277a86=_0x19b489[0x1];var _0x2ed385=_[_0x9f10('0x45')](_0x1f109a[_0x9f10('0x22')],function(_0x4ef6c3){return _0x4ef6c3['UserId']==_0x277a86['id'];});return _0x4c3d18[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'count':_0x2ed385[_0x9f10('0x2a')],'rows':_0x2ed385});})[_0x9f10('0x1e')](handleError(_0x4c3d18));};exports[_0x9f10('0x46')]=function(_0x2094c9,_0x35460a){logger['info'](_0x9f10('0x47'),_0x2094c9[_0x9f10('0x29')]);var _0x5a777a=conferenceValidation[_0x9f10('0xd')](_0x2094c9[_0x9f10('0x29')]);if(_0x5a777a['length']>0x0){return _0x35460a[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x5a777a);}var _0x58b3b4=_0x2094c9[_0x9f10('0x29')]['userId'];return getAgent(_0x58b3b4)[_0x9f10('0x1f')](function(_0x2325aa){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x2325aa[_0x9f10('0x17')]);emit(util['format'](_0x9f10('0x31'),_0x2325aa[_0x9f10('0x17')]),_0x9f10('0x48'));return _0x35460a['status'](0xc8)['json']({'error':![],'message':_0x9f10('0x49')});})[_0x9f10('0x1e')](handleError(_0x35460a));};exports[_0x9f10('0x4a')]=function(_0x20045f,_0xd627a2){logger[_0x9f10('0x13')](_0x9f10('0x4b'),_0x20045f['body']);var _0x3635f9=transferValidation[_0x9f10('0xd')](_0x20045f['body']);if(_0x3635f9[_0x9f10('0x2a')]>0x0){return _0xd627a2['status'](0x190)[_0x9f10('0x2b')](_0x3635f9);}var _0x354220=_0x20045f['body'][_0x9f10('0x2c')];var _0x4cbe80=_0x20045f[_0x9f10('0x29')][_0x9f10('0x24')];var _0x163165=_0x20045f['body'][_0x9f10('0x4c')];return getAgent(_0x354220)['then'](function(_0x2d704b){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x2d704b['name']);emit(util[_0x9f10('0x36')]('user:%s',_0x2d704b['name']),_0x9f10('0x4d'),{'sessionId':_0x4cbe80,'transferNumber':_0x163165});return _0xd627a2[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':'transfer\x20executed!'});})[_0x9f10('0x1e')](handleError(_0xd627a2));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 85f1e28..26852a0 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 _0xf4f4=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f4f85,_0x17bbea){var _0x30251a=function(_0x2176b1){while(--_0x2176b1){_0x4f4f85['push'](_0x4f4f85['shift']());}};_0x30251a(++_0x17bbea);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x545795,_0x176bcf){_0x545795=_0x545795-0x0;var _0x4ad27f=_0xf4f4[_0x545795];return _0x4ad27f;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./whatsappAccount.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4f4f('0x8')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x8')](_0x4f4f('0x13'),auth['isAuthenticated'](),controller[_0x4f4f('0x14')]);router['post']('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x15')]);router[_0x4f4f('0x16')](_0x4f4f('0xe'),auth['isAuthenticated'](),controller[_0x4f4f('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x16')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x19')]);router[_0x4f4f('0x16')](_0x4f4f('0x13'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1a')]);router[_0x4f4f('0x16')](_0x4f4f('0x1b'),controller[_0x4f4f('0x1c')]);router['post'](_0x4f4f('0x1d'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1e')]);router[_0x4f4f('0x1f')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x21')]);router[_0x4f4f('0x22')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x23')]);router[_0x4f4f('0x22')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x24')]);router['delete'](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x25')]);module[_0x4f4f('0x26')]=router; \ No newline at end of file +var _0xef0f=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeAnswers','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xef0f,0x168));var _0xfef0=function(_0x74ec1a,_0x3cfb86){_0x74ec1a=_0x74ec1a-0x0;var _0x4ceae7=_0xef0f[_0x74ec1a];return _0x4ceae7;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0x8')](_0xfef0('0xf'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x8')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x8')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller['getAgents']);router[_0xfef0('0x8')](_0xfef0('0x14'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x15')]);router[_0xfef0('0x16')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x17')]);router['post'](_0xfef0('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x18')]);router[_0xfef0('0x16')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x19')]);router[_0xfef0('0x16')]('/:id/applications',auth[_0xfef0('0x9')](),controller[_0xfef0('0x1a')]);router[_0xfef0('0x16')](_0xfef0('0x1b'),controller[_0xfef0('0x1c')]);router['post'](_0xfef0('0x1d'),auth['isAuthenticated'](),controller[_0xfef0('0x1e')]);router[_0xfef0('0x1f')](_0xfef0('0xd'),auth['isAuthenticated'](),controller[_0xfef0('0x20')]);router['delete'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfef0('0x9')](),controller['removeDispositions']);router[_0xfef0('0x21')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x22')]);router[_0xfef0('0x21')](_0xfef0('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfef0('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 768f528..0d41df5 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 _0xebef=['randomstring','exports','STRING','name','generate','twilio','sinch','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize'];(function(_0x3c9010,_0x970251){var _0x373e8a=function(_0x3a8a9e){while(--_0x3a8a9e){_0x3c9010['push'](_0x3c9010['shift']());}};_0x373e8a(++_0x970251);}(_0xebef,0xc5));var _0xfebe=function(_0x1187e0,_0x50b858){_0x1187e0=_0x1187e0-0x0;var _0x1563ff=_0xebef[_0x1187e0];return _0x1563ff;};'use strict';var Sequelize=require(_0xfebe('0x0'));var rs=require(_0xfebe('0x1'));module[_0xfebe('0x2')]={'name':{'type':Sequelize[_0xfebe('0x3')],'unique':_0xfebe('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xfebe('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xfebe('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xfebe('0x3')],'defaultValue':function(){return rs[_0xfebe('0x5')]();}},'phone':{'type':Sequelize[_0xfebe('0x3')]},'type':{'type':Sequelize['ENUM'](_0xfebe('0x6'),_0xfebe('0x7'))},'accountSid':{'type':Sequelize[_0xfebe('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfebe('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfebe('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfebe('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfebe('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfebe('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfebe('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfebe('0x9')],'comment':_0xfebe('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b4077){if(!_0x1b4077){this['setDataValue']('mandatoryDispositionPauseId',null);}this['setDataValue']('mandatoryDisposition',_0x1b4077);}},'description':{'type':Sequelize[_0xfebe('0x3')]}}; \ No newline at end of file +var _0xb648=['sequelize','randomstring','STRING','name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x3a6299,_0x5641ea){var _0x4d02a5=function(_0x3615d9){while(--_0x3615d9){_0x3a6299['push'](_0x3a6299['shift']());}};_0x4d02a5(++_0x5641ea);}(_0xb648,0x14a));var _0x8b64=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0xb648[_0x4c80d7];return _0x3c5095;};'use strict';var Sequelize=require(_0x8b64('0x0'));var rs=require(_0x8b64('0x1'));module['exports']={'name':{'type':Sequelize[_0x8b64('0x2')],'unique':_0x8b64('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8b64('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x8b64('0x2')],'defaultValue':function(){return rs[_0x8b64('0x4')]();}},'phone':{'type':Sequelize[_0x8b64('0x2')]},'type':{'type':Sequelize['ENUM'](_0x8b64('0x5'),_0x8b64('0x6'))},'accountSid':{'type':Sequelize[_0x8b64('0x2')]},'baseUrl':{'type':Sequelize[_0x8b64('0x2')]},'authToken':{'type':Sequelize[_0x8b64('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8b64('0x7')],'defaultValue':function(){return _0x8b64('0x8');}},'notificationSound':{'type':Sequelize[_0x8b64('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b64('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8b64('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b64('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8b64('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b64('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b64('0xa')],'comment':_0x8b64('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x8b64('0x9')],'defaultValue':![],'comment':_0x8b64('0xc'),'set':function(_0x18c4c2){if(!_0x18c4c2){this[_0x8b64('0xd')](_0x8b64('0xe'),null);}this[_0x8b64('0xd')]('mandatoryDisposition',_0x18c4c2);}},'description':{'type':Sequelize[_0x8b64('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index bfcfec5..dc44a3b 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 _0xf259=['account','sinch','statuses','state','read','WhatsappMessage','update','timestamp','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','from','From','whatsapp:','Body','MessageSid','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','ListId','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','applications','push','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','WhatsappAccounts','stack','name','send','mandatoryDispositionPause','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','WhatsappAccount','includeAll','include','findAll','show','Pause','length','options','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','Disposition','getDispositions','findOne','WhatsappAccountId','rows','removeDispositions','ids','CannedAnswer','rawAttributes','removeAnswers','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','User','getAgents','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','Applications'];(function(_0x41e2b4,_0x281aae){var _0x53805a=function(_0x2fa1c8){while(--_0x2fa1c8){_0x41e2b4['push'](_0x41e2b4['shift']());}};_0x53805a(++_0x281aae);}(_0xf259,0x1bc));var _0x9f25=function(_0x460c24,_0x441515){_0x460c24=_0x460c24-0x0;var _0x1c5701=_0xf259[_0x460c24];return _0x1c5701;};'use strict';var emlformat=require(_0x9f25('0x0'));var rimraf=require(_0x9f25('0x1'));var zipdir=require(_0x9f25('0x2'));var jsonpatch=require(_0x9f25('0x3'));var rp=require(_0x9f25('0x4'));var moment=require(_0x9f25('0x5'));var BPromise=require(_0x9f25('0x6'));var Mustache=require(_0x9f25('0x7'));var util=require(_0x9f25('0x8'));var path=require(_0x9f25('0x9'));var sox=require(_0x9f25('0xa'));var csv=require(_0x9f25('0xb'));var ejs=require(_0x9f25('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f25('0xd'));var squel=require(_0x9f25('0xe'));var crypto=require('crypto');var jsforce=require(_0x9f25('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9f25('0xb'));var querystring=require(_0x9f25('0x10'));var Papa=require(_0x9f25('0x11'));var Redis=require(_0x9f25('0x12'));var authService=require(_0x9f25('0x13'));var qs=require(_0x9f25('0x14'));var as=require(_0x9f25('0x15'));var hardwareService=require(_0x9f25('0x16'));var logger=require(_0x9f25('0x17'))('api');var utils=require(_0x9f25('0x18'));var config=require(_0x9f25('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9f25('0x1a')]=_[_0x9f25('0x1b')](config[_0x9f25('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f25('0x1c'))(new Redis(config[_0x9f25('0x1a')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x9f25('0x1d'));var client=jayson[_0x9f25('0x1e')][_0x9f25('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x4b317a,_0x37befa,_0x51a16b,_0x5bc810){return new BPromise(function(_0x2771fa,_0x1c82c7){var _0x14ac67=_0x5bc810||client;return _0x14ac67[_0x9f25('0x20')](_0x4b317a,_0x51a16b)['then'](function(_0x2d18f2){logger[_0x9f25('0x21')](_0x9f25('0x22'),_0x37befa,_0x9f25('0x23'));logger['debug'](_0x9f25('0x24'),_0x37befa,_0x9f25('0x23'),JSON[_0x9f25('0x25')](_0x2d18f2));if(_0x2d18f2[_0x9f25('0x26')]){if(_0x2d18f2[_0x9f25('0x26')][_0x9f25('0x27')]===0x1f4){logger[_0x9f25('0x26')](_0x9f25('0x22'),_0x37befa,_0x2d18f2['error']['message']);return _0x1c82c7(_0x2d18f2[_0x9f25('0x26')][_0x9f25('0x28')]);}logger[_0x9f25('0x26')](_0x9f25('0x22'),_0x37befa,_0x2d18f2[_0x9f25('0x26')][_0x9f25('0x28')]);return _0x2771fa(_0x2d18f2['error'][_0x9f25('0x28')]);}else{logger['info'](_0x9f25('0x22'),_0x37befa,_0x9f25('0x23'));_0x2771fa(_0x2d18f2['result']['message']);}})[_0x9f25('0x29')](function(_0x55226a){logger[_0x9f25('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x37befa,_0x55226a);_0x1c82c7(_0x55226a);});});}function respondWithStatusCode(_0x5bad05,_0x1553ae){_0x1553ae=_0x1553ae||0xcc;return function(_0x3e36fd){if(_0x3e36fd){return _0x5bad05[_0x9f25('0x2a')](_0x1553ae);}return _0x5bad05[_0x9f25('0x2b')](_0x1553ae)[_0x9f25('0x2c')]();};}function respondWithResult(_0x3e0ed4,_0x23b26b){_0x23b26b=_0x23b26b||0xc8;return function(_0x3a74be){if(_0x3a74be){return _0x3e0ed4[_0x9f25('0x2b')](_0x23b26b)[_0x9f25('0x2d')](_0x3a74be);}};}function respondWithFilteredResult(_0x2d185e,_0x80d85d){return function(_0x5d1b7d){if(_0x5d1b7d){var _0x25e598=typeof _0x80d85d[_0x9f25('0x2e')]===_0x9f25('0x2f')&&typeof _0x80d85d[_0x9f25('0x30')]===_0x9f25('0x2f');var _0x4892b6=_0x5d1b7d[_0x9f25('0x31')];var _0x33cfd8=_0x25e598?0x0:_0x80d85d[_0x9f25('0x2e')];var _0x213ab6=_0x25e598?_0x5d1b7d[_0x9f25('0x31')]:_0x80d85d[_0x9f25('0x2e')]+_0x80d85d[_0x9f25('0x30')];var _0x45e36a;if(_0x213ab6>=_0x4892b6){_0x213ab6=_0x4892b6;_0x45e36a=0xc8;}else{_0x45e36a=0xce;}_0x2d185e[_0x9f25('0x2b')](_0x45e36a);return _0x2d185e[_0x9f25('0x32')](_0x9f25('0x33'),_0x33cfd8+'-'+_0x213ab6+'/'+_0x4892b6)[_0x9f25('0x2d')](_0x5d1b7d);}return null;};}function patchUpdates(_0x4cd278){return function(_0x35637b){try{jsonpatch[_0x9f25('0x34')](_0x35637b,_0x4cd278,!![]);}catch(_0x2e1fd1){return BPromise[_0x9f25('0x35')](_0x2e1fd1);}return _0x35637b[_0x9f25('0x36')]();};}function saveUpdates(_0x126139,_0x2bb6ef){return function(_0x46518c){if(_0x46518c){return _0x46518c['update'](_0x126139)['then'](function(_0x16b9c2){return _0x16b9c2;});}return null;};}function removeEntity(_0x90160a,_0x520679){return function(_0x492f89){if(_0x492f89){return _0x492f89[_0x9f25('0x37')]()[_0x9f25('0x38')](function(){var _0x2ea88e=_0x492f89[_0x9f25('0x39')]({'plain':!![]});var _0x51dc12=_0x9f25('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x51dc12,'resourceId':_0x2ea88e['id']}})[_0x9f25('0x38')](function(){return _0x492f89;});})[_0x9f25('0x38')](function(){_0x90160a[_0x9f25('0x2b')](0xcc)[_0x9f25('0x2c')]();});}};}function handleEntityNotFound(_0x5c2461,_0x3e81ed){return function(_0x219d4e){if(!_0x219d4e){_0x5c2461['sendStatus'](0x194);}return _0x219d4e;};}function handleError(_0x1658f1,_0x1b5c22){_0x1b5c22=_0x1b5c22||0x1f4;return function(_0x3fbb0c){logger['error'](_0x3fbb0c[_0x9f25('0x3b')]);if(_0x3fbb0c[_0x9f25('0x3c')]){delete _0x3fbb0c[_0x9f25('0x3c')];}_0x1658f1[_0x9f25('0x2b')](_0x1b5c22)[_0x9f25('0x3d')](_0x3fbb0c);};}exports['index']=function(_0x4adf9a,_0x4179da){var _0x391723={'include':[{'model':db['Pause'],'as':_0x9f25('0x3e')}]},_0x3560fb={},_0x1dbdf9={'count':0x0,'rows':[]};var _0x23f49f=_[_0x9f25('0x3f')](db['WhatsappAccount']['rawAttributes'],function(_0x40f480){return{'name':_0x40f480[_0x9f25('0x40')],'type':_0x40f480[_0x9f25('0x41')][_0x9f25('0x42')]};});_0x3560fb[_0x9f25('0x43')]=_[_0x9f25('0x3f')](_0x23f49f,_0x9f25('0x3c'));_0x3560fb['query']=_[_0x9f25('0x44')](_0x4adf9a[_0x9f25('0x45')]);_0x3560fb[_0x9f25('0x46')]=_[_0x9f25('0x47')](_0x3560fb[_0x9f25('0x43')],_0x3560fb['query']);_0x391723['attributes']=_['intersection'](_0x3560fb[_0x9f25('0x43')],qs[_0x9f25('0x48')](_0x4adf9a['query']['fields']));_0x391723['attributes']=_0x391723[_0x9f25('0x49')]['length']?_0x391723[_0x9f25('0x49')]:_0x3560fb['model'];if(!_0x4adf9a['query'][_0x9f25('0x4a')](_0x9f25('0x4b'))){_0x391723[_0x9f25('0x30')]=qs[_0x9f25('0x30')](_0x4adf9a[_0x9f25('0x45')][_0x9f25('0x30')]);_0x391723['offset']=qs['offset'](_0x4adf9a[_0x9f25('0x45')][_0x9f25('0x2e')]);}_0x391723[_0x9f25('0x4c')]=qs[_0x9f25('0x4d')](_0x4adf9a[_0x9f25('0x45')][_0x9f25('0x4d')]);_0x391723['where']=qs[_0x9f25('0x46')](_[_0x9f25('0x4e')](_0x4adf9a[_0x9f25('0x45')],_0x3560fb['filters']),_0x23f49f);if(_0x4adf9a[_0x9f25('0x45')][_0x9f25('0x4f')]){_0x391723[_0x9f25('0x50')]=_[_0x9f25('0x51')](_0x391723[_0x9f25('0x50')],{'$or':_[_0x9f25('0x3f')](_0x23f49f,function(_0x2776a2){if(_0x2776a2[_0x9f25('0x41')]!==_0x9f25('0x52')){var _0x29c6f3={};_0x29c6f3[_0x2776a2[_0x9f25('0x3c')]]={'$like':'%'+_0x4adf9a[_0x9f25('0x45')]['filter']+'%'};return _0x29c6f3;}})});}_0x391723=_[_0x9f25('0x51')]({},_0x391723,_0x4adf9a['options']);var _0x489c29={'where':_0x391723['where']};return db[_0x9f25('0x53')][_0x9f25('0x31')](_0x489c29)[_0x9f25('0x38')](function(_0x349fe6){_0x1dbdf9[_0x9f25('0x31')]=_0x349fe6;if(_0x4adf9a[_0x9f25('0x45')][_0x9f25('0x54')]){_0x391723[_0x9f25('0x55')]=[{'all':!![]}];}return db[_0x9f25('0x53')][_0x9f25('0x56')](_0x391723);})['then'](function(_0x5dd050){_0x1dbdf9['rows']=_0x5dd050;return _0x1dbdf9;})[_0x9f25('0x38')](respondWithFilteredResult(_0x4179da,_0x391723))[_0x9f25('0x29')](handleError(_0x4179da,null));};exports[_0x9f25('0x57')]=function(_0x29a4af,_0x1d7bdb){var _0x525869={'raw':![],'where':{'id':_0x29a4af['params']['id']},'include':[{'model':db[_0x9f25('0x58')],'as':'mandatoryDispositionPause'}]},_0x1e1ab9={};_0x1e1ab9[_0x9f25('0x43')]=_[_0x9f25('0x44')](db['WhatsappAccount']['rawAttributes']);_0x1e1ab9[_0x9f25('0x45')]=_['keys'](_0x29a4af[_0x9f25('0x45')]);_0x1e1ab9[_0x9f25('0x46')]=_[_0x9f25('0x47')](_0x1e1ab9[_0x9f25('0x43')],_0x1e1ab9[_0x9f25('0x45')]);_0x525869[_0x9f25('0x49')]=_[_0x9f25('0x47')](_0x1e1ab9[_0x9f25('0x43')],qs[_0x9f25('0x48')](_0x29a4af[_0x9f25('0x45')][_0x9f25('0x48')]));_0x525869[_0x9f25('0x49')]=_0x525869[_0x9f25('0x49')][_0x9f25('0x59')]?_0x525869['attributes']:_0x1e1ab9['model'];if(_0x29a4af[_0x9f25('0x45')][_0x9f25('0x54')]){_0x525869[_0x9f25('0x55')]=[{'all':!![]}];}_0x525869=_[_0x9f25('0x51')]({},_0x525869,_0x29a4af[_0x9f25('0x5a')]);return db['WhatsappAccount']['find'](_0x525869)[_0x9f25('0x38')](handleEntityNotFound(_0x1d7bdb,null))[_0x9f25('0x38')](respondWithResult(_0x1d7bdb,null))[_0x9f25('0x29')](handleError(_0x1d7bdb,null));};exports[_0x9f25('0x5b')]=function(_0x4ffa21,_0x3b6b3c){return db[_0x9f25('0x53')][_0x9f25('0x5b')](_0x4ffa21[_0x9f25('0x5c')],{})[_0x9f25('0x38')](function(_0x19fbee){var _0x124ae5=_0x4ffa21['user'][_0x9f25('0x39')]({'plain':!![]});if(!_0x124ae5)throw new Error(_0x9f25('0x5d'));if(_0x124ae5[_0x9f25('0x5e')]===_0x9f25('0x5f')){var _0x5224eb=_0x19fbee['get']({'plain':!![]});var _0x4ae5c2=_0x9f25('0x3a');return db[_0x9f25('0x60')][_0x9f25('0x61')]({'where':{'name':_0x4ae5c2,'userProfileId':_0x124ae5[_0x9f25('0x62')]},'raw':!![]})[_0x9f25('0x38')](function(_0x50bb57){if(_0x50bb57&&_0x50bb57['autoAssociation']===0x0){return db[_0x9f25('0x63')][_0x9f25('0x5b')]({'name':_0x5224eb[_0x9f25('0x3c')],'resourceId':_0x5224eb['id'],'type':_0x50bb57['name'],'sectionId':_0x50bb57['id']},{})[_0x9f25('0x38')](function(){return _0x19fbee;});}else{return _0x19fbee;}})[_0x9f25('0x29')](function(_0x2188b0){logger[_0x9f25('0x26')](_0x9f25('0x64'),_0x2188b0);throw _0x2188b0;});}return _0x19fbee;})[_0x9f25('0x38')](respondWithResult(_0x3b6b3c,0xc9))['catch'](handleError(_0x3b6b3c,null));};exports['update']=function(_0x5742ed,_0x21554f){if(_0x5742ed[_0x9f25('0x5c')]['id']){delete _0x5742ed['body']['id'];}return db[_0x9f25('0x53')][_0x9f25('0x61')]({'where':{'id':_0x5742ed['params']['id']},'include':[{'model':db[_0x9f25('0x58')],'as':'mandatoryDispositionPause'}]})[_0x9f25('0x38')](handleEntityNotFound(_0x21554f,null))[_0x9f25('0x38')](saveUpdates(_0x5742ed[_0x9f25('0x5c')],null))[_0x9f25('0x38')](respondWithResult(_0x21554f,null))['catch'](handleError(_0x21554f,null));};exports[_0x9f25('0x37')]=function(_0x314b39,_0x214a49){return db[_0x9f25('0x53')]['find']({'where':{'id':_0x314b39[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x214a49,null))[_0x9f25('0x38')](removeEntity(_0x214a49,null))['catch'](handleError(_0x214a49,null));};exports[_0x9f25('0x66')]=function(_0x309c3d,_0x5752a5){return db[_0x9f25('0x53')][_0x9f25('0x66')]()[_0x9f25('0x38')](respondWithResult(_0x5752a5,null))[_0x9f25('0x29')](handleError(_0x5752a5,null));};exports[_0x9f25('0x67')]=function(_0x2af783,_0x126b17,_0x1c3c37){if(_0x2af783['body']['id']){delete _0x2af783[_0x9f25('0x5c')]['id'];}return db[_0x9f25('0x53')][_0x9f25('0x61')]({'where':{'id':_0x2af783[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x126b17,null))[_0x9f25('0x38')](function(_0x333258){if(_0x333258){_0x2af783[_0x9f25('0x5c')]['WhatsappAccountId']=_0x333258['id'];return db[_0x9f25('0x68')][_0x9f25('0x5b')](_0x2af783[_0x9f25('0x5c')]);}})[_0x9f25('0x38')](respondWithResult(_0x126b17,null))['catch'](handleError(_0x126b17,null));};exports[_0x9f25('0x69')]=function(_0x3713cb,_0x3b144d,_0x5bc6e7){var _0x8e0ad7={'raw':![],'where':{}};var _0x4361a3={};var _0x4fd792={'count':0x0,'rows':[]};return db[_0x9f25('0x53')][_0x9f25('0x6a')]({'where':{'id':_0x3713cb[_0x9f25('0x65')]['id']}})['then'](handleEntityNotFound(_0x3b144d,null))[_0x9f25('0x38')](function(_0x56bb9a){if(_0x56bb9a){_0x4361a3[_0x9f25('0x43')]=_[_0x9f25('0x44')](db[_0x9f25('0x68')]['rawAttributes']);_0x4361a3['query']=_[_0x9f25('0x44')](_0x3713cb['query']);_0x4361a3[_0x9f25('0x46')]=_[_0x9f25('0x47')](_0x4361a3[_0x9f25('0x43')],_0x4361a3['query']);_0x8e0ad7[_0x9f25('0x49')]=_[_0x9f25('0x47')](_0x4361a3[_0x9f25('0x43')],qs[_0x9f25('0x48')](_0x3713cb['query'][_0x9f25('0x48')]));_0x8e0ad7[_0x9f25('0x49')]=_0x8e0ad7['attributes']['length']?_0x8e0ad7[_0x9f25('0x49')]:_0x4361a3[_0x9f25('0x43')];if(!_0x3713cb['query'][_0x9f25('0x4a')]('nolimit')){_0x8e0ad7['limit']=qs[_0x9f25('0x30')](_0x3713cb[_0x9f25('0x45')][_0x9f25('0x30')]);_0x8e0ad7[_0x9f25('0x2e')]=qs[_0x9f25('0x2e')](_0x3713cb[_0x9f25('0x45')]['offset']);}_0x8e0ad7['order']=qs[_0x9f25('0x4d')](_0x3713cb[_0x9f25('0x45')][_0x9f25('0x4d')]);_0x8e0ad7[_0x9f25('0x50')]=qs[_0x9f25('0x46')](_[_0x9f25('0x4e')](_0x3713cb[_0x9f25('0x45')],_0x4361a3[_0x9f25('0x46')]));_0x8e0ad7[_0x9f25('0x50')][_0x9f25('0x6b')]=_0x56bb9a['id'];if(_0x3713cb[_0x9f25('0x45')]['filter']){_0x8e0ad7['where']=_['merge'](_0x8e0ad7['where'],{'$or':_[_0x9f25('0x3f')](_0x8e0ad7[_0x9f25('0x49')],function(_0x3321c2){var _0x41520f={};_0x41520f[_0x3321c2]={'$like':'%'+_0x3713cb[_0x9f25('0x45')][_0x9f25('0x4f')]+'%'};return _0x41520f;})});}_0x8e0ad7=_[_0x9f25('0x51')]({},_0x8e0ad7,_0x3713cb['options']);return db['Disposition']['count']({'where':_0x8e0ad7[_0x9f25('0x50')]})[_0x9f25('0x38')](function(_0x168709){_0x4fd792[_0x9f25('0x31')]=_0x168709;if(_0x3713cb[_0x9f25('0x45')][_0x9f25('0x54')]){_0x8e0ad7[_0x9f25('0x55')]=[{'all':!![]}];}return db[_0x9f25('0x68')]['findAll'](_0x8e0ad7);})[_0x9f25('0x38')](function(_0x3db726){_0x4fd792[_0x9f25('0x6c')]=_0x3db726;return _0x4fd792;});}})[_0x9f25('0x38')](respondWithFilteredResult(_0x3b144d,_0x8e0ad7))[_0x9f25('0x29')](handleError(_0x3b144d,null));};exports[_0x9f25('0x6d')]=function(_0x1072de,_0x2d9ded,_0x2b99de){return db[_0x9f25('0x53')]['find']({'where':{'id':_0x1072de[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x2d9ded,null))[_0x9f25('0x38')](function(_0x200d79){if(_0x200d79){return _0x200d79['removeDispositions'](_0x1072de[_0x9f25('0x45')][_0x9f25('0x6e')]);}})['then'](respondWithStatusCode(_0x2d9ded,null))[_0x9f25('0x29')](handleError(_0x2d9ded,null));};exports['addAnswer']=function(_0x2f2827,_0x14ccbb,_0x168875){if(_0x2f2827['body']['id']){delete _0x2f2827[_0x9f25('0x5c')]['id'];}return db[_0x9f25('0x53')]['find']({'where':{'id':_0x2f2827[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x14ccbb,null))[_0x9f25('0x38')](function(_0x1d70d4){if(_0x1d70d4){_0x2f2827[_0x9f25('0x5c')][_0x9f25('0x6b')]=_0x1d70d4['id'];return db[_0x9f25('0x6f')][_0x9f25('0x5b')](_0x2f2827[_0x9f25('0x5c')]);}})[_0x9f25('0x38')](respondWithResult(_0x14ccbb,null))[_0x9f25('0x29')](handleError(_0x14ccbb,null));};exports['getAnswers']=function(_0x5ba849,_0x3bb032,_0x4a71ce){var _0x1b2d94={'raw':![],'where':{}};var _0x35c2b6={};var _0x5c3626={'count':0x0,'rows':[]};return db[_0x9f25('0x53')][_0x9f25('0x6a')]({'where':{'id':_0x5ba849[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x3bb032,null))[_0x9f25('0x38')](function(_0x369f44){if(_0x369f44){_0x35c2b6[_0x9f25('0x43')]=_[_0x9f25('0x44')](db[_0x9f25('0x6f')][_0x9f25('0x70')]);_0x35c2b6[_0x9f25('0x45')]=_[_0x9f25('0x44')](_0x5ba849[_0x9f25('0x45')]);_0x35c2b6[_0x9f25('0x46')]=_[_0x9f25('0x47')](_0x35c2b6[_0x9f25('0x43')],_0x35c2b6[_0x9f25('0x45')]);_0x1b2d94[_0x9f25('0x49')]=_[_0x9f25('0x47')](_0x35c2b6[_0x9f25('0x43')],qs['fields'](_0x5ba849[_0x9f25('0x45')][_0x9f25('0x48')]));_0x1b2d94[_0x9f25('0x49')]=_0x1b2d94[_0x9f25('0x49')][_0x9f25('0x59')]?_0x1b2d94[_0x9f25('0x49')]:_0x35c2b6[_0x9f25('0x43')];if(!_0x5ba849['query'][_0x9f25('0x4a')]('nolimit')){_0x1b2d94[_0x9f25('0x30')]=qs[_0x9f25('0x30')](_0x5ba849[_0x9f25('0x45')][_0x9f25('0x30')]);_0x1b2d94[_0x9f25('0x2e')]=qs[_0x9f25('0x2e')](_0x5ba849[_0x9f25('0x45')][_0x9f25('0x2e')]);}_0x1b2d94['order']=qs[_0x9f25('0x4d')](_0x5ba849[_0x9f25('0x45')][_0x9f25('0x4d')]);_0x1b2d94[_0x9f25('0x50')]=qs[_0x9f25('0x46')](_[_0x9f25('0x4e')](_0x5ba849[_0x9f25('0x45')],_0x35c2b6['filters']));_0x1b2d94[_0x9f25('0x50')][_0x9f25('0x6b')]=_0x369f44['id'];if(_0x5ba849[_0x9f25('0x45')]['filter']){_0x1b2d94[_0x9f25('0x50')]=_['merge'](_0x1b2d94[_0x9f25('0x50')],{'$or':_[_0x9f25('0x3f')](_0x1b2d94[_0x9f25('0x49')],function(_0x551f60){var _0xc28065={};_0xc28065[_0x551f60]={'$like':'%'+_0x5ba849[_0x9f25('0x45')]['filter']+'%'};return _0xc28065;})});}_0x1b2d94=_[_0x9f25('0x51')]({},_0x1b2d94,_0x5ba849[_0x9f25('0x5a')]);return db[_0x9f25('0x6f')][_0x9f25('0x31')]({'where':_0x1b2d94[_0x9f25('0x50')]})['then'](function(_0x53d388){_0x5c3626[_0x9f25('0x31')]=_0x53d388;if(_0x5ba849[_0x9f25('0x45')]['includeAll']){_0x1b2d94['include']=[{'all':!![]}];}return db[_0x9f25('0x6f')][_0x9f25('0x56')](_0x1b2d94);})[_0x9f25('0x38')](function(_0x441de2){_0x5c3626['rows']=_0x441de2;return _0x5c3626;});}})[_0x9f25('0x38')](respondWithFilteredResult(_0x3bb032,_0x1b2d94))[_0x9f25('0x29')](handleError(_0x3bb032,null));};exports['removeAnswers']=function(_0x2cdb93,_0x19542e,_0x29372a){return db[_0x9f25('0x53')][_0x9f25('0x61')]({'where':{'id':_0x2cdb93[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x19542e,null))['then'](function(_0x58a3b3){if(_0x58a3b3){return _0x58a3b3[_0x9f25('0x71')](_0x2cdb93[_0x9f25('0x45')][_0x9f25('0x6e')]);}})[_0x9f25('0x38')](respondWithStatusCode(_0x19542e,null))['catch'](handleError(_0x19542e,null));};exports[_0x9f25('0x72')]=function(_0x3d3bc1,_0x503f54,_0x54f61a){return db[_0x9f25('0x53')][_0x9f25('0x61')]({'where':{'id':_0x3d3bc1[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x503f54,null))['then'](function(_0x1670c2){if(_0x1670c2){return _0x1670c2[_0x9f25('0x72')](_0x3d3bc1['body'][_0x9f25('0x6e')],_[_0x9f25('0x73')](_0x3d3bc1[_0x9f25('0x5c')],[_0x9f25('0x6e'),'id'])||{})['spread'](function(_0x559c1d){for(var _0x4d5273=0x0;_0x4d5273<_0x3d3bc1[_0x9f25('0x5c')][_0x9f25('0x6e')][_0x9f25('0x59')];_0x4d5273+=0x1){socket['emit'](_0x9f25('0x74'),{'UserId':Number(_0x3d3bc1[_0x9f25('0x5c')]['ids'][_0x4d5273]),'WhatsappAccountId':Number(_0x3d3bc1[_0x9f25('0x65')]['id'])});}return _0x559c1d;});}})[_0x9f25('0x38')](respondWithResult(_0x503f54,null))[_0x9f25('0x29')](handleError(_0x503f54,null));};exports[_0x9f25('0x75')]=function(_0x21919b,_0x52ac8a,_0x371d0a){return db['WhatsappAccount'][_0x9f25('0x61')]({'where':{'id':_0x21919b[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0x52ac8a,null))[_0x9f25('0x38')](function(_0xefadc7){if(_0xefadc7){return _0xefadc7[_0x9f25('0x75')](_0x21919b[_0x9f25('0x45')][_0x9f25('0x6e')])[_0x9f25('0x38')](function(){if(_[_0x9f25('0x76')](_0x21919b[_0x9f25('0x45')][_0x9f25('0x6e')])){for(var _0x594a14=0x0;_0x594a14<_0x21919b[_0x9f25('0x45')][_0x9f25('0x6e')][_0x9f25('0x59')];_0x594a14+=0x1){socket[_0x9f25('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x21919b[_0x9f25('0x45')][_0x9f25('0x6e')][_0x594a14]),'WhatsappAccountId':Number(_0x21919b[_0x9f25('0x65')]['id'])});}}else{socket[_0x9f25('0x77')](_0x9f25('0x78'),{'UserId':Number(_0x21919b['query'][_0x9f25('0x6e')]),'WhatsappAccountId':Number(_0x21919b['params']['id'])});}});}})[_0x9f25('0x38')](respondWithStatusCode(_0x52ac8a,null))[_0x9f25('0x29')](handleError(_0x52ac8a,null));};exports['getAgents']=function(_0x11688e,_0x4a2809,_0x4e9d24){var _0x2da1d1={};var _0x3b38fc={};var _0x7f3aa5;var _0x2b638c;return db['WhatsappAccount']['findOne']({'where':{'id':_0x11688e[_0x9f25('0x65')]['id']}})['then'](handleEntityNotFound(_0x4a2809,null))[_0x9f25('0x38')](function(_0x38bf85){if(_0x38bf85){_0x7f3aa5=_0x38bf85;_0x3b38fc[_0x9f25('0x43')]=_[_0x9f25('0x44')](db[_0x9f25('0x79')][_0x9f25('0x70')]);_0x3b38fc['query']=_['keys'](_0x11688e['query']);_0x3b38fc[_0x9f25('0x46')]=_['intersection'](_0x3b38fc[_0x9f25('0x43')],_0x3b38fc[_0x9f25('0x45')]);_0x2da1d1[_0x9f25('0x49')]=_['intersection'](_0x3b38fc[_0x9f25('0x43')],qs[_0x9f25('0x48')](_0x11688e['query']['fields']));_0x2da1d1[_0x9f25('0x49')]=_0x2da1d1['attributes'][_0x9f25('0x59')]?_0x2da1d1[_0x9f25('0x49')]:_0x3b38fc[_0x9f25('0x43')];_0x2da1d1[_0x9f25('0x4c')]=qs[_0x9f25('0x4d')](_0x11688e[_0x9f25('0x45')]['sort']);_0x2da1d1['where']=qs[_0x9f25('0x46')](_[_0x9f25('0x4e')](_0x11688e['query'],_0x3b38fc['filters']));if(_0x11688e[_0x9f25('0x45')][_0x9f25('0x4f')]){_0x2da1d1[_0x9f25('0x50')]=_[_0x9f25('0x51')](_0x2da1d1[_0x9f25('0x50')],{'$or':_[_0x9f25('0x3f')](_0x2da1d1[_0x9f25('0x49')],function(_0x7a2a8f){var _0x5d50d1={};_0x5d50d1[_0x7a2a8f]={'$like':'%'+_0x11688e[_0x9f25('0x45')][_0x9f25('0x4f')]+'%'};return _0x5d50d1;})});}_0x2da1d1=_[_0x9f25('0x51')]({},_0x2da1d1,_0x11688e[_0x9f25('0x5a')]);return _0x7f3aa5[_0x9f25('0x7a')](_0x2da1d1);}})[_0x9f25('0x38')](function(_0x4b824a){if(_0x4b824a){_0x2b638c=_0x4b824a[_0x9f25('0x59')];if(!_0x11688e['query'][_0x9f25('0x4a')](_0x9f25('0x4b'))){_0x2da1d1[_0x9f25('0x30')]=qs[_0x9f25('0x30')](_0x11688e[_0x9f25('0x45')][_0x9f25('0x30')]);_0x2da1d1[_0x9f25('0x2e')]=qs[_0x9f25('0x2e')](_0x11688e[_0x9f25('0x45')][_0x9f25('0x2e')]);}return _0x7f3aa5[_0x9f25('0x7a')](_0x2da1d1);}})[_0x9f25('0x38')](function(_0x59e2d8){if(_0x59e2d8){return _0x59e2d8?{'count':_0x2b638c,'rows':_0x59e2d8}:null;}})[_0x9f25('0x38')](respondWithResult(_0x4a2809,null))[_0x9f25('0x29')](handleError(_0x4a2809,null));};exports['addApplications']=function(_0x3a7f7e,_0xbabc7f,_0x4d9f62){return db[_0x9f25('0x53')]['findOne']({'where':{'id':_0x3a7f7e[_0x9f25('0x65')]['id']}})['then'](handleEntityNotFound(_0xbabc7f,null))['then'](function(_0x51d627){if(_0x51d627){return db['sequelize']['transaction'](function(_0x1eeac0){return db[_0x9f25('0x7b')][_0x9f25('0x37')]({'where':{'WhatsappAccountId':_0x3a7f7e[_0x9f25('0x65')]['id']},'transaction':_0x1eeac0})[_0x9f25('0x38')](function(_0x231220){var _0x4fdb0f=_[_0x9f25('0x3f')](_0x3a7f7e['body'],function(_0x3b5eb2){_0x3b5eb2[_0x9f25('0x6b')]=_0x3a7f7e[_0x9f25('0x65')]['id'];return _0x3b5eb2;});return db['WhatsappApplication'][_0x9f25('0x7c')](_0x4fdb0f,{'transaction':_0x1eeac0});});})[_0x9f25('0x38')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x3a7f7e[_0x9f25('0x65')]['id']},'order':_0x9f25('0x7d')});});}})[_0x9f25('0x38')](respondWithResult(_0xbabc7f,null))['catch'](handleError(_0xbabc7f,null));};exports['getApplications']=function(_0x2d552e,_0xd8876f,_0x339b09){var _0xbefe20={};var _0x5b23af={};var _0x8c54e1;var _0x468bea;return db[_0x9f25('0x53')]['findOne']({'where':{'id':_0x2d552e[_0x9f25('0x65')]['id']}})[_0x9f25('0x38')](handleEntityNotFound(_0xd8876f,null))[_0x9f25('0x38')](function(_0x3a02d1){if(_0x3a02d1){_0x8c54e1=_0x3a02d1;_0x5b23af[_0x9f25('0x43')]=_[_0x9f25('0x44')](db[_0x9f25('0x7b')][_0x9f25('0x70')]);_0x5b23af[_0x9f25('0x45')]=_[_0x9f25('0x44')](_0x2d552e[_0x9f25('0x45')]);_0x5b23af[_0x9f25('0x46')]=_[_0x9f25('0x47')](_0x5b23af[_0x9f25('0x43')],_0x5b23af[_0x9f25('0x45')]);_0xbefe20['attributes']=_[_0x9f25('0x47')](_0x5b23af['model'],qs['fields'](_0x2d552e[_0x9f25('0x45')]['fields']));_0xbefe20[_0x9f25('0x49')]=_0xbefe20[_0x9f25('0x49')][_0x9f25('0x59')]?_0xbefe20['attributes']:_0x5b23af[_0x9f25('0x43')];_0xbefe20['order']=qs[_0x9f25('0x4d')](_0x2d552e[_0x9f25('0x45')][_0x9f25('0x4d')]);_0xbefe20[_0x9f25('0x50')]=qs['filters'](_[_0x9f25('0x4e')](_0x2d552e[_0x9f25('0x45')],_0x5b23af[_0x9f25('0x46')]));if(_0x2d552e[_0x9f25('0x45')]['filter']){_0xbefe20[_0x9f25('0x50')]=_[_0x9f25('0x51')](_0xbefe20[_0x9f25('0x50')],{'$or':_[_0x9f25('0x3f')](_0xbefe20[_0x9f25('0x49')],function(_0x5abc65){var _0x1e043c={};_0x1e043c[_0x5abc65]={'$like':'%'+_0x2d552e[_0x9f25('0x45')]['filter']+'%'};return _0x1e043c;})});}_0xbefe20=_[_0x9f25('0x51')]({},_0xbefe20,_0x2d552e[_0x9f25('0x5a')]);return _0x8c54e1[_0x9f25('0x7e')](_0xbefe20);}})[_0x9f25('0x38')](function(_0x19d824){if(_0x19d824){_0x468bea=_0x19d824[_0x9f25('0x59')];if(!_0x2d552e[_0x9f25('0x45')][_0x9f25('0x4a')]('nolimit')){_0xbefe20[_0x9f25('0x30')]=qs[_0x9f25('0x30')](_0x2d552e[_0x9f25('0x45')][_0x9f25('0x30')]);_0xbefe20[_0x9f25('0x2e')]=qs[_0x9f25('0x2e')](_0x2d552e[_0x9f25('0x45')][_0x9f25('0x2e')]);}return _0x8c54e1[_0x9f25('0x7e')](_0xbefe20);}})[_0x9f25('0x38')](function(_0x551120){if(_0x551120){return _0x551120?{'count':_0x468bea,'rows':_0x551120}:null;}})[_0x9f25('0x38')](respondWithResult(_0xd8876f,null))[_0x9f25('0x29')](handleError(_0xd8876f,null));};exports['notify']=function(_0x1ee066,_0x3c0363,_0x52f66c){var _0xc6fcb0={'channel':_0x9f25('0x7f')};var _0x2fa143=[];var _0x2bde8a=[];var _0x3b3fe4={};return db['WhatsappAccount']['find']({'where':{'id':_0x1ee066['params']['id']},'include':[{'model':db[_0x9f25('0x7b')],'as':_0x9f25('0x80')}]})['then'](handleEntityNotFound(_0x3c0363,null))[_0x9f25('0x38')](function(_0x24127a){_0xc6fcb0[_0x9f25('0x81')]=_0x24127a;if(_0xc6fcb0['account']&&_0xc6fcb0['account'][_0x9f25('0x41')]===_0x9f25('0x82')&&_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x83')]){if(_0x1ee066[_0x9f25('0x5c')]['statuses'][_0x9f25('0x59')]===0x0)return;if(_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x83')][0x0][_0x9f25('0x84')]!==_0x9f25('0x85'))return;return db[_0x9f25('0x86')][_0x9f25('0x87')]({'read':!![],'readAt':_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x83')][0x0][_0x9f25('0x88')]},{'where':{'messageId':_0x1ee066[_0x9f25('0x5c')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x9f25('0x38')](function(_0x111ab2){return _0x3c0363[_0x9f25('0x2b')](0xc8)[_0x9f25('0x2d')](_0x111ab2);});}_0xc6fcb0['applications']=_[_0x9f25('0x89')](_0x24127a['Applications'],[_0x9f25('0x7d')],[_0x9f25('0x8a')]);if(_0xc6fcb0[_0x9f25('0x81')][_0x9f25('0x80')]){delete _0xc6fcb0[_0x9f25('0x81')][_0x9f25('0x80')];}return db[_0x9f25('0x8b')][_0x9f25('0x66')]()[_0x9f25('0x38')](function(_0x26a265){if(!_0x26a265){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))](_0x9f25('0x8e'));}_0x2fa143=_[_0x9f25('0x8f')](_['keys'](_0x26a265),[_0x9f25('0x90'),_0x9f25('0x91')]);_0x2bde8a=_[_0x9f25('0x8f')](_[_0x9f25('0x44')](_0x26a265),[_0x9f25('0x90'),_0x9f25('0x91'),'CompanyId','ListId']);_0xc6fcb0[_0x9f25('0x5c')]={'mapKey':_0x9f25('0x92')};if(_0xc6fcb0[_0x9f25('0x81')]&&_0xc6fcb0['account']['type']==='twilio'){_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')]=_0x1ee066['body'][_0x9f25('0x94')]['replace'](_0x9f25('0x95'),'');_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x5c')]=_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x96')];_0xc6fcb0[_0x9f25('0x5c')]['messageId']=_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x97')];}if(_0xc6fcb0[_0x9f25('0x81')]&&_0xc6fcb0['account'][_0x9f25('0x41')]==='sinch'){_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')]=_0x1ee066['body'][_0x9f25('0x98')][0x0][_0x9f25('0x93')];_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x5c')]=_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x98')][0x0][_0x9f25('0x28')]['body'];_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x99')]=_0x1ee066[_0x9f25('0x5c')][_0x9f25('0x98')][0x0]['message_id'];}if(_0xc6fcb0['body']['id']){delete _0xc6fcb0['body']['id'];}if(_[_0x9f25('0x9a')](_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')])){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))](_0x9f25('0x9b'));}if(_[_0x9f25('0x9a')](_0xc6fcb0['body'][_0x9f25('0x5c')])||_0xc6fcb0['body'][_0x9f25('0x5c')]===''){throw new db[(_0x9f25('0x8c'))]['ValidationError'](_0x9f25('0x9c'));}if(_[_0x9f25('0x9a')](_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x9d')])){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bde8a);}if(!_[_0x9f25('0x9e')](_0x2bde8a,_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x9d')])){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bde8a);}_0x3b3fe4[_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x9d')]]=_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')];return db['CmList']['find']({'where':{'id':_0xc6fcb0[_0x9f25('0x81')][_0x9f25('0x9f')]},'include':[{'model':db[_0x9f25('0x8b')],'as':'Contacts','where':_0x3b3fe4,'limit':0x1,'order':[[_0x9f25('0x91'),'DESC']]}]});})[_0x9f25('0x38')](handleEntityNotFound(_0x3c0363,null))[_0x9f25('0x38')](function(_0x15f80e){if(_0x15f80e){_0xc6fcb0[_0x9f25('0xa0')]=_[_0x9f25('0x73')](_0x15f80e,[_0x9f25('0xa1')]);if(_0x15f80e['Contacts']['length']){return _0x15f80e['Contacts'][0x0];}var _0x54f1d2=_[_0x9f25('0x1b')](_0xc6fcb0['body'],{'firstName':_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')],'ListId':_0x15f80e['id']});_0x54f1d2[_0xc6fcb0['body'][_0x9f25('0x9d')]]=_0xc6fcb0['body'][_0x9f25('0x93')];return db[_0x9f25('0x8b')]['create'](_0x54f1d2,{'fields':_0x2fa143,'raw':!![]});}})['then'](handleEntityNotFound(_0x3c0363,null))[_0x9f25('0x38')](function(_0x2784a5){if(_0x2784a5){_0xc6fcb0[_0x9f25('0xa2')]=_0x2784a5;var _0x5858f3={'ContactId':_0x2784a5['id'],'phone':_0xc6fcb0['body'][_0x9f25('0x93')],'WhatsappAccountId':_0x1ee066[_0x9f25('0x65')]['id']};var _0x5cf3a4={'ContactId':_0x2784a5['id'],'WhatsappAccountId':_0x1ee066[_0x9f25('0x65')]['id'],'closed':![]};return db[_0x9f25('0xa3')][_0x9f25('0x61')]({'where':_0x5cf3a4})[_0x9f25('0x38')](function(_0x3081e7){if(_0x3081e7){return[_0x3081e7,![]];}return db[_0x9f25('0xa3')][_0x9f25('0x5b')](_0x5858f3)[_0x9f25('0x38')](function(_0x960031){return[_0x960031,!![]];});});}})[_0x9f25('0xa4')](function(_0xefe7ad,_0x5e1459){_0xc6fcb0['interaction']=_0xefe7ad['get']({'plain':!![]});_0xc6fcb0[_0x9f25('0xa5')][_0x9f25('0xa6')]=![];if(_0x5e1459){if(_0xc6fcb0[_0x9f25('0x81')]['autoclose']){_0xc6fcb0[_0x9f25('0xa7')][_0x9f25('0xa8')]({'id':0x0,'priority':_0xc6fcb0['applications']['length']+0x1,'app':'close','appdata':_0x9f25('0xa9'),'interval':_0x9f25('0xaa')});}_0xc6fcb0[_0x9f25('0xa5')]['created']=!![];}return db[_0x9f25('0x86')]['create']({'phone':_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x93')],'messageId':_0xc6fcb0[_0x9f25('0x5c')][_0x9f25('0x99')],'body':_0xc6fcb0['body'][_0x9f25('0x5c')],'WhatsappAccountId':_0x1ee066[_0x9f25('0x65')]['id'],'WhatsappInteractionId':_0xefe7ad['id'],'direction':'in','ContactId':_0xefe7ad[_0x9f25('0xab')],'AttachmentId':_0xc6fcb0[_0x9f25('0x5c')]['AttachmentId']});})['then'](function(_0x4db4c4){_0xc6fcb0[_0x9f25('0x28')]=_0x4db4c4;if(_0xc6fcb0['interaction'][_0x9f25('0xac')]){return db[_0x9f25('0x79')][_0x9f25('0x61')]({'attributes':['id',_0x9f25('0x3c')],'where':{'id':_0xc6fcb0[_0x9f25('0xa5')][_0x9f25('0xac')]}})['then'](function(_0x13c399){if(_0x13c399){_0xc6fcb0[_0x9f25('0xa7')][_0x9f25('0xad')]({'id':0x0,'priority':0x0,'app':_0x9f25('0xae'),'appdata':_0x13c399[_0x9f25('0x3c')]+','+(_0xc6fcb0[_0x9f25('0x81')][_0x9f25('0xaf')]||0xa),'interval':_0x9f25('0xaa')});}return respondWithRpcPromise('Start',_0x9f25('0xb0'),_0xc6fcb0);});}return respondWithRpcPromise(_0x9f25('0xb1'),_0x9f25('0xb0'),_0xc6fcb0);})[_0x9f25('0x38')](function(_0x3c8bee){if(_0x3c8bee){var _0x71780f=0xc8;var _0xe5880f='receiveMessage';logger[_0x9f25('0x21')](_0x9f25('0x24'),_0xe5880f,_0x71780f,_0x9f25('0xb2'));logger[_0x9f25('0xb3')](_0x9f25('0xb4'),_0xe5880f,_0x71780f,_0x9f25('0xb2'),JSON[_0x9f25('0x25')](_0x3c8bee));if(_0xc6fcb0[_0x9f25('0x81')][_0x9f25('0x41')]===_0x9f25('0xb5')){return _0x3c0363['status'](_0x71780f)[_0x9f25('0x32')](_0x9f25('0xb6'),_0x9f25('0xb7'))['send'](_0x9f25('0xb8'));}else{return _0x3c0363['status'](_0x71780f)[_0x9f25('0x2d')](_0x3c8bee);}}});})[_0x9f25('0x29')](handleError(_0x3c0363,null));};exports['send']=function(_0x4b5dd9,_0x40abae,_0x13417a){var _0xa1ae31,_0x4758ef,_0x5d4f8d;if(_[_0x9f25('0x9a')](_0x4b5dd9[_0x9f25('0x5c')][_0x9f25('0x5c')])||_0x4b5dd9[_0x9f25('0x5c')][_0x9f25('0x5c')]===''){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))](_0x9f25('0x9c'));}if(_[_0x9f25('0x9a')](_0x4b5dd9[_0x9f25('0x5c')]['to'])){throw new db[(_0x9f25('0x8c'))][(_0x9f25('0x8d'))](_0x9f25('0xb9'));}_0xa1ae31=_0x4b5dd9['body']['to'];return db[_0x9f25('0x53')][_0x9f25('0x61')]({'where':{'id':_0x4b5dd9[_0x9f25('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0x9f25('0xba'),'include':[{'model':db['CmContact'],'as':_0x9f25('0xa1'),'where':{'mobile':_0xa1ae31},'limit':0x1,'order':[[_0x9f25('0x91'),_0x9f25('0xbb')]]}]}]})[_0x9f25('0x38')](handleEntityNotFound(_0x40abae,null))[_0x9f25('0x38')](function(_0xab0dfb){if(_0xab0dfb&&_0xab0dfb[_0x9f25('0xba')]){_0x4758ef=_0xab0dfb[_0x9f25('0x39')]({'plain':!![]});if(_0x4758ef[_0x9f25('0xba')]&&_0x4758ef[_0x9f25('0xba')][_0x9f25('0xa1')][_0x9f25('0x59')]){return _0x4758ef[_0x9f25('0xba')][_0x9f25('0xa1')][0x0];}return db[_0x9f25('0x8b')][_0x9f25('0x5b')](_[_0x9f25('0x1b')](_0x4b5dd9[_0x9f25('0x5c')],{'firstName':_0xa1ae31,'mobile':_0xa1ae31,'phone':_0xa1ae31,'ListId':_0x4758ef['ListId']}));}})[_0x9f25('0x38')](handleEntityNotFound(_0x40abae,null))['then'](function(_0x257f70){if(_0x257f70){_0x5d4f8d=_0x257f70;return db[_0x9f25('0xa3')][_0x9f25('0x61')]({'where':{'ContactId':_0x5d4f8d['id'],'closed':![],'WhatsappAccountId':_0x4758ef['id']}})[_0x9f25('0x38')](function(_0x44745b){if(_0x44745b){return[_0x44745b,![]];}return db[_0x9f25('0xa3')]['create']({'UserId':_0x4b5dd9[_0x9f25('0x5f')]['id'],'ContactId':_0x5d4f8d['id'],'WhatsappAccountId':_0x4758ef['id'],'phone':_0xa1ae31,'firstMsgDirection':_0x9f25('0xbc'),'Messages':[_[_0x9f25('0x51')](_0x4b5dd9[_0x9f25('0x5c')],{'read':![],'body':_0x4b5dd9[_0x9f25('0x5c')]['body'],'phone':_0xa1ae31,'WhatsappAccountId':_0x4758ef['id'],'UserId':_0x4b5dd9['user']['id'],'ContactId':_0x5d4f8d['id']})]},{'include':[{'model':db[_0x9f25('0x86')],'as':_0x9f25('0xbd')}]})[_0x9f25('0x38')](function(_0x17c407){return[_0x17c407,!![]];});});}})[_0x9f25('0xa4')](function(_0x4cb70b,_0x43ebbc){if(_0x43ebbc){return _0x4cb70b;}return db['WhatsappMessage'][_0x9f25('0x5b')](_[_0x9f25('0x51')](_0x4b5dd9[_0x9f25('0x5c')],{'read':![],'body':_0x4b5dd9[_0x9f25('0x5c')][_0x9f25('0x5c')],'phone':_0xa1ae31,'WhatsappAccountId':_0x4758ef['id'],'WhatsappInteractionId':_0x4cb70b['id'],'UserId':_0x4b5dd9['user']['id'],'ContactId':_0x5d4f8d['id']}))[_0x9f25('0x38')](function(_0x3a28a6){_0x4cb70b[_0x9f25('0xbe')][_0x9f25('0xbd')]=[];_0x4cb70b[_0x9f25('0xbe')][_0x9f25('0xbd')]['push'](_0x3a28a6['dataValues']);return _0x4cb70b;});})[_0x9f25('0x38')](respondWithResult(_0x40abae,null))[_0x9f25('0x29')](handleError(_0x40abae,null));}; \ No newline at end of file +var _0xa6ad=['Body','messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','Contacts','contact','WhatsappInteraction','interaction','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappAccount.socket','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','get','WhatsappAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','filter','where','merge','options','includeAll','findAll','rows','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','Disposition','pick','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','findOne','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','account','state','statuses','timestamp','message_id','applications','orderBy','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','From','replace','whatsapp:'];(function(_0x46f6fc,_0x5c1f05){var _0x2f7194=function(_0x1f4622){while(--_0x1f4622){_0x46f6fc['push'](_0x46f6fc['shift']());}};_0x2f7194(++_0x5c1f05);}(_0xa6ad,0xeb));var _0xda6a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa6ad[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xda6a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda6a('0x1'));var rp=require(_0xda6a('0x2'));var moment=require(_0xda6a('0x3'));var BPromise=require(_0xda6a('0x4'));var Mustache=require(_0xda6a('0x5'));var util=require(_0xda6a('0x6'));var path=require(_0xda6a('0x7'));var sox=require(_0xda6a('0x8'));var csv=require(_0xda6a('0x9'));var ejs=require(_0xda6a('0xa'));var fs=require('fs');var fs_extra=require(_0xda6a('0xb'));var _=require(_0xda6a('0xc'));var squel=require(_0xda6a('0xd'));var crypto=require(_0xda6a('0xe'));var jsforce=require(_0xda6a('0xf'));var deskjs=require(_0xda6a('0x10'));var toCsv=require(_0xda6a('0x9'));var querystring=require('querystring');var Papa=require(_0xda6a('0x11'));var Redis=require(_0xda6a('0x12'));var authService=require(_0xda6a('0x13'));var qs=require(_0xda6a('0x14'));var as=require(_0xda6a('0x15'));var hardwareService=require(_0xda6a('0x16'));var logger=require(_0xda6a('0x17'))('api');var utils=require(_0xda6a('0x18'));var config=require(_0xda6a('0x19'));var licenseUtil=require(_0xda6a('0x1a'));var db=require('../../mysqldb')['db'];config[_0xda6a('0x1b')]=_[_0xda6a('0x1c')](config[_0xda6a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda6a('0x1b')]));require(_0xda6a('0x1d'))[_0xda6a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xda6a('0x1f')][_0xda6a('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3446ad,_0x848bfb,_0x4abc52,_0x50453c){return new BPromise(function(_0x49c3e7,_0x50178e){var _0xb25e83=_0x50453c||client;return _0xb25e83[_0xda6a('0x21')](_0x3446ad,_0x4abc52)[_0xda6a('0x22')](function(_0x28d2ac){logger[_0xda6a('0x23')](_0xda6a('0x24'),_0x848bfb,_0xda6a('0x25'));logger[_0xda6a('0x26')](_0xda6a('0x27'),_0x848bfb,'request\x20sent',JSON['stringify'](_0x28d2ac));if(_0x28d2ac['error']){if(_0x28d2ac['error'][_0xda6a('0x28')]===0x1f4){logger[_0xda6a('0x29')](_0xda6a('0x24'),_0x848bfb,_0x28d2ac[_0xda6a('0x29')][_0xda6a('0x2a')]);return _0x50178e(_0x28d2ac[_0xda6a('0x29')]['message']);}logger['error'](_0xda6a('0x24'),_0x848bfb,_0x28d2ac[_0xda6a('0x29')][_0xda6a('0x2a')]);return _0x49c3e7(_0x28d2ac['error'][_0xda6a('0x2a')]);}else{logger[_0xda6a('0x23')](_0xda6a('0x24'),_0x848bfb,_0xda6a('0x25'));_0x49c3e7(_0x28d2ac[_0xda6a('0x2b')]['message']);}})[_0xda6a('0x2c')](function(_0x2c1cdd){logger[_0xda6a('0x29')](_0xda6a('0x24'),_0x848bfb,_0x2c1cdd);_0x50178e(_0x2c1cdd);});});}function respondWithStatusCode(_0x15f4df,_0x5f1383){_0x5f1383=_0x5f1383||0xcc;return function(_0x2d8f9a){if(_0x2d8f9a){return _0x15f4df['sendStatus'](_0x5f1383);}return _0x15f4df[_0xda6a('0x2d')](_0x5f1383)[_0xda6a('0x2e')]();};}function respondWithResult(_0x373742,_0x185f2b){_0x185f2b=_0x185f2b||0xc8;return function(_0x413e55){if(_0x413e55){return _0x373742[_0xda6a('0x2d')](_0x185f2b)['json'](_0x413e55);}};}function respondWithFilteredResult(_0x5e473c,_0x1217ce){return function(_0x411f01){if(_0x411f01){var _0x2e0e67=typeof _0x1217ce['offset']===_0xda6a('0x2f')&&typeof _0x1217ce[_0xda6a('0x30')]===_0xda6a('0x2f');var _0x497b0d=_0x411f01['count'];var _0x581c92=_0x2e0e67?0x0:_0x1217ce['offset'];var _0x2cd6c6=_0x2e0e67?_0x411f01[_0xda6a('0x31')]:_0x1217ce['offset']+_0x1217ce[_0xda6a('0x30')];var _0x12e639;if(_0x2cd6c6>=_0x497b0d){_0x2cd6c6=_0x497b0d;_0x12e639=0xc8;}else{_0x12e639=0xce;}_0x5e473c['status'](_0x12e639);return _0x5e473c[_0xda6a('0x32')](_0xda6a('0x33'),_0x581c92+'-'+_0x2cd6c6+'/'+_0x497b0d)[_0xda6a('0x34')](_0x411f01);}return null;};}function patchUpdates(_0x3922b8){return function(_0x4a4afd){try{jsonpatch[_0xda6a('0x35')](_0x4a4afd,_0x3922b8,!![]);}catch(_0x36c617){return BPromise[_0xda6a('0x36')](_0x36c617);}return _0x4a4afd['save']();};}function saveUpdates(_0x5a6f19,_0x5b58d0){return function(_0x4d7561){if(_0x4d7561){return _0x4d7561[_0xda6a('0x37')](_0x5a6f19)[_0xda6a('0x22')](function(_0x43aad2){return _0x43aad2;});}return null;};}function removeEntity(_0x5230df,_0x5c2355){return function(_0x25112a){if(_0x25112a){return _0x25112a[_0xda6a('0x38')]()[_0xda6a('0x22')](function(){var _0x135c88=_0x25112a[_0xda6a('0x39')]({'plain':!![]});var _0x54eb49=_0xda6a('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x54eb49,'resourceId':_0x135c88['id']}})[_0xda6a('0x22')](function(){return _0x25112a;});})[_0xda6a('0x22')](function(){_0x5230df[_0xda6a('0x2d')](0xcc)[_0xda6a('0x2e')]();});}};}function handleEntityNotFound(_0x12ce50,_0x225855){return function(_0x312651){if(!_0x312651){_0x12ce50[_0xda6a('0x3b')](0x194);}return _0x312651;};}function handleError(_0x383f39,_0x5f2f19){_0x5f2f19=_0x5f2f19||0x1f4;return function(_0x4b1717){logger[_0xda6a('0x29')](_0x4b1717[_0xda6a('0x3c')]);if(_0x4b1717['name']){delete _0x4b1717[_0xda6a('0x3d')];}_0x383f39[_0xda6a('0x2d')](_0x5f2f19)[_0xda6a('0x3e')](_0x4b1717);};}exports[_0xda6a('0x3f')]=function(_0x1860d6,_0x4c9192){var _0x419efd={'include':[{'model':db[_0xda6a('0x40')],'as':_0xda6a('0x41')}]},_0x2870e7={},_0x55eaab={'count':0x0,'rows':[]};var _0x348f36=_[_0xda6a('0x42')](db[_0xda6a('0x43')][_0xda6a('0x44')],function(_0x31361a){return{'name':_0x31361a[_0xda6a('0x45')],'type':_0x31361a[_0xda6a('0x46')][_0xda6a('0x47')]};});_0x2870e7[_0xda6a('0x48')]=_[_0xda6a('0x42')](_0x348f36,_0xda6a('0x3d'));_0x2870e7[_0xda6a('0x49')]=_[_0xda6a('0x4a')](_0x1860d6[_0xda6a('0x49')]);_0x2870e7['filters']=_[_0xda6a('0x4b')](_0x2870e7[_0xda6a('0x48')],_0x2870e7['query']);_0x419efd[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0x2870e7[_0xda6a('0x48')],qs[_0xda6a('0x4d')](_0x1860d6[_0xda6a('0x49')][_0xda6a('0x4d')]));_0x419efd[_0xda6a('0x4c')]=_0x419efd['attributes'][_0xda6a('0x4e')]?_0x419efd['attributes']:_0x2870e7['model'];if(!_0x1860d6[_0xda6a('0x49')][_0xda6a('0x4f')](_0xda6a('0x50'))){_0x419efd[_0xda6a('0x30')]=qs['limit'](_0x1860d6[_0xda6a('0x49')][_0xda6a('0x30')]);_0x419efd[_0xda6a('0x51')]=qs[_0xda6a('0x51')](_0x1860d6[_0xda6a('0x49')][_0xda6a('0x51')]);}_0x419efd[_0xda6a('0x52')]=qs[_0xda6a('0x53')](_0x1860d6['query']['sort']);_0x419efd['where']=qs['filters'](_['pick'](_0x1860d6[_0xda6a('0x49')],_0x2870e7[_0xda6a('0x54')]),_0x348f36);if(_0x1860d6[_0xda6a('0x49')][_0xda6a('0x55')]){_0x419efd[_0xda6a('0x56')]=_[_0xda6a('0x57')](_0x419efd[_0xda6a('0x56')],{'$or':_[_0xda6a('0x42')](_0x348f36,function(_0x441a4d){if(_0x441a4d['type']!=='VIRTUAL'){var _0x488956={};_0x488956[_0x441a4d[_0xda6a('0x3d')]]={'$like':'%'+_0x1860d6[_0xda6a('0x49')][_0xda6a('0x55')]+'%'};return _0x488956;}})});}_0x419efd=_['merge']({},_0x419efd,_0x1860d6[_0xda6a('0x58')]);var _0x52456c={'where':_0x419efd[_0xda6a('0x56')]};return db[_0xda6a('0x43')][_0xda6a('0x31')](_0x52456c)[_0xda6a('0x22')](function(_0x582c8e){_0x55eaab['count']=_0x582c8e;if(_0x1860d6[_0xda6a('0x49')][_0xda6a('0x59')]){_0x419efd['include']=[{'all':!![]}];}return db[_0xda6a('0x43')][_0xda6a('0x5a')](_0x419efd);})[_0xda6a('0x22')](function(_0x25fc6b){_0x55eaab[_0xda6a('0x5b')]=_0x25fc6b;return _0x55eaab;})[_0xda6a('0x22')](respondWithFilteredResult(_0x4c9192,_0x419efd))[_0xda6a('0x2c')](handleError(_0x4c9192,null));};exports[_0xda6a('0x5c')]=function(_0x4c4aac,_0x20628c){var _0x1f15f1={'raw':![],'where':{'id':_0x4c4aac[_0xda6a('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xda6a('0x41')}]},_0x5eedef={};_0x5eedef[_0xda6a('0x48')]=_[_0xda6a('0x4a')](db[_0xda6a('0x43')][_0xda6a('0x44')]);_0x5eedef[_0xda6a('0x49')]=_['keys'](_0x4c4aac[_0xda6a('0x49')]);_0x5eedef[_0xda6a('0x54')]=_[_0xda6a('0x4b')](_0x5eedef['model'],_0x5eedef[_0xda6a('0x49')]);_0x1f15f1[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0x5eedef[_0xda6a('0x48')],qs[_0xda6a('0x4d')](_0x4c4aac['query'][_0xda6a('0x4d')]));_0x1f15f1[_0xda6a('0x4c')]=_0x1f15f1['attributes']['length']?_0x1f15f1['attributes']:_0x5eedef['model'];if(_0x4c4aac[_0xda6a('0x49')][_0xda6a('0x59')]){_0x1f15f1[_0xda6a('0x5e')]=[{'all':!![]}];}_0x1f15f1=_['merge']({},_0x1f15f1,_0x4c4aac['options']);return db[_0xda6a('0x43')]['find'](_0x1f15f1)[_0xda6a('0x22')](handleEntityNotFound(_0x20628c,null))[_0xda6a('0x22')](respondWithResult(_0x20628c,null))[_0xda6a('0x2c')](handleError(_0x20628c,null));};exports['create']=function(_0x2f9e7b,_0x5918eb){return db[_0xda6a('0x43')][_0xda6a('0x5f')](_0x2f9e7b[_0xda6a('0x60')],{})[_0xda6a('0x22')](function(_0x4844d5){var _0x29c391=_0x2f9e7b[_0xda6a('0x61')][_0xda6a('0x39')]({'plain':!![]});if(!_0x29c391)throw new Error(_0xda6a('0x62'));if(_0x29c391[_0xda6a('0x63')]==='user'){var _0x2bc5a0=_0x4844d5['get']({'plain':!![]});var _0x2afaf9='WhatsappAccounts';return db[_0xda6a('0x64')][_0xda6a('0x65')]({'where':{'name':_0x2afaf9,'userProfileId':_0x29c391[_0xda6a('0x66')]},'raw':!![]})[_0xda6a('0x22')](function(_0xbdd154){if(_0xbdd154&&_0xbdd154[_0xda6a('0x67')]===0x0){return db[_0xda6a('0x68')][_0xda6a('0x5f')]({'name':_0x2bc5a0[_0xda6a('0x3d')],'resourceId':_0x2bc5a0['id'],'type':_0xbdd154[_0xda6a('0x3d')],'sectionId':_0xbdd154['id']},{})[_0xda6a('0x22')](function(){return _0x4844d5;});}else{return _0x4844d5;}})[_0xda6a('0x2c')](function(_0x208287){logger[_0xda6a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x208287);throw _0x208287;});}return _0x4844d5;})[_0xda6a('0x22')](respondWithResult(_0x5918eb,0xc9))['catch'](handleError(_0x5918eb,null));};exports[_0xda6a('0x37')]=function(_0x223ff4,_0x326b96){if(_0x223ff4[_0xda6a('0x60')]['id']){delete _0x223ff4['body']['id'];}return db[_0xda6a('0x43')][_0xda6a('0x65')]({'where':{'id':_0x223ff4[_0xda6a('0x5d')]['id']},'include':[{'model':db[_0xda6a('0x40')],'as':_0xda6a('0x41')}]})[_0xda6a('0x22')](handleEntityNotFound(_0x326b96,null))['then'](saveUpdates(_0x223ff4[_0xda6a('0x60')],null))['then'](respondWithResult(_0x326b96,null))[_0xda6a('0x2c')](handleError(_0x326b96,null));};exports[_0xda6a('0x38')]=function(_0x2250af,_0x4ddc72){return db['WhatsappAccount'][_0xda6a('0x65')]({'where':{'id':_0x2250af[_0xda6a('0x5d')]['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0x4ddc72,null))[_0xda6a('0x22')](removeEntity(_0x4ddc72,null))[_0xda6a('0x2c')](handleError(_0x4ddc72,null));};exports[_0xda6a('0x69')]=function(_0x1b17f0,_0x7a67de){return db[_0xda6a('0x43')]['describe']()[_0xda6a('0x22')](respondWithResult(_0x7a67de,null))[_0xda6a('0x2c')](handleError(_0x7a67de,null));};exports['addDisposition']=function(_0x47756f,_0x5e0c83,_0x2cb034){if(_0x47756f[_0xda6a('0x60')]['id']){delete _0x47756f['body']['id'];}return db[_0xda6a('0x43')]['find']({'where':{'id':_0x47756f['params']['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0x5e0c83,null))['then'](function(_0x1d9327){if(_0x1d9327){_0x47756f[_0xda6a('0x60')]['WhatsappAccountId']=_0x1d9327['id'];return db[_0xda6a('0x6a')][_0xda6a('0x5f')](_0x47756f[_0xda6a('0x60')]);}})[_0xda6a('0x22')](respondWithResult(_0x5e0c83,null))[_0xda6a('0x2c')](handleError(_0x5e0c83,null));};exports['getDispositions']=function(_0x18ed74,_0x1c79db,_0x573e8e){var _0x376adb={'raw':![],'where':{}};var _0x12db5a={};var _0x1b653b={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x18ed74[_0xda6a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1c79db,null))[_0xda6a('0x22')](function(_0x5196ff){if(_0x5196ff){_0x12db5a['model']=_[_0xda6a('0x4a')](db[_0xda6a('0x6a')][_0xda6a('0x44')]);_0x12db5a[_0xda6a('0x49')]=_[_0xda6a('0x4a')](_0x18ed74['query']);_0x12db5a[_0xda6a('0x54')]=_['intersection'](_0x12db5a[_0xda6a('0x48')],_0x12db5a[_0xda6a('0x49')]);_0x376adb[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0x12db5a[_0xda6a('0x48')],qs['fields'](_0x18ed74['query'][_0xda6a('0x4d')]));_0x376adb['attributes']=_0x376adb[_0xda6a('0x4c')][_0xda6a('0x4e')]?_0x376adb[_0xda6a('0x4c')]:_0x12db5a[_0xda6a('0x48')];if(!_0x18ed74[_0xda6a('0x49')][_0xda6a('0x4f')](_0xda6a('0x50'))){_0x376adb['limit']=qs['limit'](_0x18ed74[_0xda6a('0x49')]['limit']);_0x376adb['offset']=qs[_0xda6a('0x51')](_0x18ed74['query']['offset']);}_0x376adb['order']=qs[_0xda6a('0x53')](_0x18ed74[_0xda6a('0x49')][_0xda6a('0x53')]);_0x376adb[_0xda6a('0x56')]=qs[_0xda6a('0x54')](_[_0xda6a('0x6b')](_0x18ed74[_0xda6a('0x49')],_0x12db5a[_0xda6a('0x54')]));_0x376adb['where'][_0xda6a('0x6c')]=_0x5196ff['id'];if(_0x18ed74[_0xda6a('0x49')]['filter']){_0x376adb[_0xda6a('0x56')]=_[_0xda6a('0x57')](_0x376adb[_0xda6a('0x56')],{'$or':_[_0xda6a('0x42')](_0x376adb[_0xda6a('0x4c')],function(_0x509f67){var _0xf8c606={};_0xf8c606[_0x509f67]={'$like':'%'+_0x18ed74[_0xda6a('0x49')]['filter']+'%'};return _0xf8c606;})});}_0x376adb=_[_0xda6a('0x57')]({},_0x376adb,_0x18ed74['options']);return db[_0xda6a('0x6a')][_0xda6a('0x31')]({'where':_0x376adb['where']})['then'](function(_0x4d4422){_0x1b653b[_0xda6a('0x31')]=_0x4d4422;if(_0x18ed74['query'][_0xda6a('0x59')]){_0x376adb[_0xda6a('0x5e')]=[{'all':!![]}];}return db['Disposition'][_0xda6a('0x5a')](_0x376adb);})[_0xda6a('0x22')](function(_0x3666ff){_0x1b653b['rows']=_0x3666ff;return _0x1b653b;});}})[_0xda6a('0x22')](respondWithFilteredResult(_0x1c79db,_0x376adb))[_0xda6a('0x2c')](handleError(_0x1c79db,null));};exports[_0xda6a('0x6d')]=function(_0x382d73,_0x38a15c,_0x3b1cb7){return db[_0xda6a('0x43')]['find']({'where':{'id':_0x382d73['params']['id']}})['then'](handleEntityNotFound(_0x38a15c,null))[_0xda6a('0x22')](function(_0x222c05){if(_0x222c05){return _0x222c05[_0xda6a('0x6d')](_0x382d73['query'][_0xda6a('0x6e')]);}})[_0xda6a('0x22')](respondWithStatusCode(_0x38a15c,null))[_0xda6a('0x2c')](handleError(_0x38a15c,null));};exports[_0xda6a('0x6f')]=function(_0x2ee54d,_0x3e29ae,_0x4494c1){if(_0x2ee54d[_0xda6a('0x60')]['id']){delete _0x2ee54d[_0xda6a('0x60')]['id'];}return db['WhatsappAccount'][_0xda6a('0x65')]({'where':{'id':_0x2ee54d[_0xda6a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e29ae,null))[_0xda6a('0x22')](function(_0x50f83e){if(_0x50f83e){_0x2ee54d[_0xda6a('0x60')][_0xda6a('0x6c')]=_0x50f83e['id'];return db['CannedAnswer'][_0xda6a('0x5f')](_0x2ee54d['body']);}})[_0xda6a('0x22')](respondWithResult(_0x3e29ae,null))['catch'](handleError(_0x3e29ae,null));};exports['getAnswers']=function(_0x4b12e9,_0x1fa2cf,_0x50eb4a){var _0x41b4e3={'raw':![],'where':{}};var _0x2e9ae9={};var _0x2339aa={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4b12e9['params']['id']}})['then'](handleEntityNotFound(_0x1fa2cf,null))[_0xda6a('0x22')](function(_0x1ff7a5){if(_0x1ff7a5){_0x2e9ae9[_0xda6a('0x48')]=_[_0xda6a('0x4a')](db[_0xda6a('0x70')][_0xda6a('0x44')]);_0x2e9ae9['query']=_[_0xda6a('0x4a')](_0x4b12e9[_0xda6a('0x49')]);_0x2e9ae9[_0xda6a('0x54')]=_['intersection'](_0x2e9ae9['model'],_0x2e9ae9[_0xda6a('0x49')]);_0x41b4e3[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0x2e9ae9[_0xda6a('0x48')],qs[_0xda6a('0x4d')](_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x4d')]));_0x41b4e3[_0xda6a('0x4c')]=_0x41b4e3['attributes'][_0xda6a('0x4e')]?_0x41b4e3[_0xda6a('0x4c')]:_0x2e9ae9[_0xda6a('0x48')];if(!_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x4f')](_0xda6a('0x50'))){_0x41b4e3[_0xda6a('0x30')]=qs[_0xda6a('0x30')](_0x4b12e9['query'][_0xda6a('0x30')]);_0x41b4e3[_0xda6a('0x51')]=qs[_0xda6a('0x51')](_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x51')]);}_0x41b4e3[_0xda6a('0x52')]=qs[_0xda6a('0x53')](_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x53')]);_0x41b4e3[_0xda6a('0x56')]=qs[_0xda6a('0x54')](_[_0xda6a('0x6b')](_0x4b12e9[_0xda6a('0x49')],_0x2e9ae9[_0xda6a('0x54')]));_0x41b4e3[_0xda6a('0x56')][_0xda6a('0x6c')]=_0x1ff7a5['id'];if(_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x55')]){_0x41b4e3[_0xda6a('0x56')]=_['merge'](_0x41b4e3[_0xda6a('0x56')],{'$or':_[_0xda6a('0x42')](_0x41b4e3['attributes'],function(_0x56b931){var _0x562208={};_0x562208[_0x56b931]={'$like':'%'+_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x55')]+'%'};return _0x562208;})});}_0x41b4e3=_[_0xda6a('0x57')]({},_0x41b4e3,_0x4b12e9[_0xda6a('0x58')]);return db[_0xda6a('0x70')][_0xda6a('0x31')]({'where':_0x41b4e3[_0xda6a('0x56')]})[_0xda6a('0x22')](function(_0x37e033){_0x2339aa[_0xda6a('0x31')]=_0x37e033;if(_0x4b12e9[_0xda6a('0x49')][_0xda6a('0x59')]){_0x41b4e3[_0xda6a('0x5e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x41b4e3);})['then'](function(_0xec56ed){_0x2339aa[_0xda6a('0x5b')]=_0xec56ed;return _0x2339aa;});}})[_0xda6a('0x22')](respondWithFilteredResult(_0x1fa2cf,_0x41b4e3))[_0xda6a('0x2c')](handleError(_0x1fa2cf,null));};exports[_0xda6a('0x71')]=function(_0xda77aa,_0x5e49c3,_0x1bf4b8){return db[_0xda6a('0x43')][_0xda6a('0x65')]({'where':{'id':_0xda77aa[_0xda6a('0x5d')]['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0x5e49c3,null))[_0xda6a('0x22')](function(_0x4b6ed6){if(_0x4b6ed6){return _0x4b6ed6[_0xda6a('0x71')](_0xda77aa['query'][_0xda6a('0x6e')]);}})[_0xda6a('0x22')](respondWithStatusCode(_0x5e49c3,null))[_0xda6a('0x2c')](handleError(_0x5e49c3,null));};exports[_0xda6a('0x72')]=function(_0x42034f,_0x604cd,_0x2a1464){return db[_0xda6a('0x43')][_0xda6a('0x65')]({'where':{'id':_0x42034f['params']['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0x604cd,null))[_0xda6a('0x22')](function(_0x1c4460){if(_0x1c4460){return _0x1c4460[_0xda6a('0x72')](_0x42034f[_0xda6a('0x60')][_0xda6a('0x6e')],_[_0xda6a('0x73')](_0x42034f[_0xda6a('0x60')],['ids','id'])||{})['spread'](function(_0x12dc2b){for(var _0x29f5eb=0x0;_0x29f5eb<_0x42034f[_0xda6a('0x60')][_0xda6a('0x6e')][_0xda6a('0x4e')];_0x29f5eb+=0x1){socket[_0xda6a('0x74')]('userWhatsappAccount:save',{'UserId':Number(_0x42034f['body']['ids'][_0x29f5eb]),'WhatsappAccountId':Number(_0x42034f['params']['id'])});}return _0x12dc2b;});}})[_0xda6a('0x22')](respondWithResult(_0x604cd,null))[_0xda6a('0x2c')](handleError(_0x604cd,null));};exports['removeAgents']=function(_0x9860e4,_0x3e3472,_0x5d126a){return db[_0xda6a('0x43')][_0xda6a('0x65')]({'where':{'id':_0x9860e4[_0xda6a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e3472,null))[_0xda6a('0x22')](function(_0x9d16f0){if(_0x9d16f0){return _0x9d16f0[_0xda6a('0x75')](_0x9860e4['query'][_0xda6a('0x6e')])['then'](function(){if(_[_0xda6a('0x76')](_0x9860e4[_0xda6a('0x49')][_0xda6a('0x6e')])){for(var _0x13b17d=0x0;_0x13b17d<_0x9860e4['query'][_0xda6a('0x6e')]['length'];_0x13b17d+=0x1){socket[_0xda6a('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x9860e4[_0xda6a('0x49')][_0xda6a('0x6e')][_0x13b17d]),'WhatsappAccountId':Number(_0x9860e4['params']['id'])});}}else{socket[_0xda6a('0x74')](_0xda6a('0x77'),{'UserId':Number(_0x9860e4[_0xda6a('0x49')]['ids']),'WhatsappAccountId':Number(_0x9860e4[_0xda6a('0x5d')]['id'])});}});}})[_0xda6a('0x22')](respondWithStatusCode(_0x3e3472,null))[_0xda6a('0x2c')](handleError(_0x3e3472,null));};exports[_0xda6a('0x78')]=function(_0x58e167,_0x42d0e0,_0x7b0d47){var _0x3798e5={};var _0xad6f54={};var _0x12f813;var _0x32c5fc;return db[_0xda6a('0x43')][_0xda6a('0x79')]({'where':{'id':_0x58e167['params']['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0x42d0e0,null))[_0xda6a('0x22')](function(_0x1fffce){if(_0x1fffce){_0x12f813=_0x1fffce;_0xad6f54[_0xda6a('0x48')]=_[_0xda6a('0x4a')](db['User']['rawAttributes']);_0xad6f54[_0xda6a('0x49')]=_['keys'](_0x58e167[_0xda6a('0x49')]);_0xad6f54[_0xda6a('0x54')]=_[_0xda6a('0x4b')](_0xad6f54['model'],_0xad6f54['query']);_0x3798e5[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0xad6f54[_0xda6a('0x48')],qs['fields'](_0x58e167['query'][_0xda6a('0x4d')]));_0x3798e5['attributes']=_0x3798e5[_0xda6a('0x4c')][_0xda6a('0x4e')]?_0x3798e5[_0xda6a('0x4c')]:_0xad6f54[_0xda6a('0x48')];_0x3798e5['order']=qs[_0xda6a('0x53')](_0x58e167[_0xda6a('0x49')][_0xda6a('0x53')]);_0x3798e5['where']=qs[_0xda6a('0x54')](_[_0xda6a('0x6b')](_0x58e167['query'],_0xad6f54[_0xda6a('0x54')]));if(_0x58e167['query'][_0xda6a('0x55')]){_0x3798e5[_0xda6a('0x56')]=_[_0xda6a('0x57')](_0x3798e5['where'],{'$or':_[_0xda6a('0x42')](_0x3798e5['attributes'],function(_0x387a26){var _0x95b5bf={};_0x95b5bf[_0x387a26]={'$like':'%'+_0x58e167['query'][_0xda6a('0x55')]+'%'};return _0x95b5bf;})});}_0x3798e5=_[_0xda6a('0x57')]({},_0x3798e5,_0x58e167[_0xda6a('0x58')]);return _0x12f813[_0xda6a('0x78')](_0x3798e5);}})[_0xda6a('0x22')](function(_0x2daac5){if(_0x2daac5){_0x32c5fc=_0x2daac5[_0xda6a('0x4e')];if(!_0x58e167[_0xda6a('0x49')][_0xda6a('0x4f')](_0xda6a('0x50'))){_0x3798e5['limit']=qs[_0xda6a('0x30')](_0x58e167[_0xda6a('0x49')][_0xda6a('0x30')]);_0x3798e5[_0xda6a('0x51')]=qs[_0xda6a('0x51')](_0x58e167[_0xda6a('0x49')]['offset']);}return _0x12f813[_0xda6a('0x78')](_0x3798e5);}})[_0xda6a('0x22')](function(_0x2a3063){if(_0x2a3063){return _0x2a3063?{'count':_0x32c5fc,'rows':_0x2a3063}:null;}})[_0xda6a('0x22')](respondWithResult(_0x42d0e0,null))[_0xda6a('0x2c')](handleError(_0x42d0e0,null));};exports[_0xda6a('0x7a')]=function(_0x114299,_0x1103f5,_0x167e06){return db[_0xda6a('0x43')][_0xda6a('0x79')]({'where':{'id':_0x114299[_0xda6a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1103f5,null))[_0xda6a('0x22')](function(_0xa60b34){if(_0xa60b34){return db[_0xda6a('0x7b')]['transaction'](function(_0xafca45){return db[_0xda6a('0x7c')][_0xda6a('0x38')]({'where':{'WhatsappAccountId':_0x114299[_0xda6a('0x5d')]['id']},'transaction':_0xafca45})[_0xda6a('0x22')](function(_0x4fef2a){var _0x1a7939=_[_0xda6a('0x42')](_0x114299[_0xda6a('0x60')],function(_0x3b6e5e){_0x3b6e5e[_0xda6a('0x6c')]=_0x114299[_0xda6a('0x5d')]['id'];return _0x3b6e5e;});return db[_0xda6a('0x7c')][_0xda6a('0x7d')](_0x1a7939,{'transaction':_0xafca45});});})[_0xda6a('0x22')](function(){return db[_0xda6a('0x7c')][_0xda6a('0x7e')]({'where':{'WhatsappAccountId':_0x114299[_0xda6a('0x5d')]['id']},'order':_0xda6a('0x7f')});});}})['then'](respondWithResult(_0x1103f5,null))[_0xda6a('0x2c')](handleError(_0x1103f5,null));};exports[_0xda6a('0x80')]=function(_0xc0dadc,_0xb8ad8e,_0x31b5ff){var _0x32963c={};var _0x362483={};var _0x516845;var _0x546782;return db['WhatsappAccount']['findOne']({'where':{'id':_0xc0dadc[_0xda6a('0x5d')]['id']}})[_0xda6a('0x22')](handleEntityNotFound(_0xb8ad8e,null))[_0xda6a('0x22')](function(_0x11d0a6){if(_0x11d0a6){_0x516845=_0x11d0a6;_0x362483[_0xda6a('0x48')]=_['keys'](db[_0xda6a('0x7c')][_0xda6a('0x44')]);_0x362483['query']=_[_0xda6a('0x4a')](_0xc0dadc[_0xda6a('0x49')]);_0x362483[_0xda6a('0x54')]=_['intersection'](_0x362483['model'],_0x362483[_0xda6a('0x49')]);_0x32963c[_0xda6a('0x4c')]=_[_0xda6a('0x4b')](_0x362483['model'],qs[_0xda6a('0x4d')](_0xc0dadc['query'][_0xda6a('0x4d')]));_0x32963c[_0xda6a('0x4c')]=_0x32963c[_0xda6a('0x4c')][_0xda6a('0x4e')]?_0x32963c[_0xda6a('0x4c')]:_0x362483['model'];_0x32963c[_0xda6a('0x52')]=qs[_0xda6a('0x53')](_0xc0dadc[_0xda6a('0x49')]['sort']);_0x32963c[_0xda6a('0x56')]=qs['filters'](_[_0xda6a('0x6b')](_0xc0dadc[_0xda6a('0x49')],_0x362483[_0xda6a('0x54')]));if(_0xc0dadc[_0xda6a('0x49')][_0xda6a('0x55')]){_0x32963c[_0xda6a('0x56')]=_[_0xda6a('0x57')](_0x32963c['where'],{'$or':_[_0xda6a('0x42')](_0x32963c[_0xda6a('0x4c')],function(_0x30008f){var _0x567820={};_0x567820[_0x30008f]={'$like':'%'+_0xc0dadc['query'][_0xda6a('0x55')]+'%'};return _0x567820;})});}_0x32963c=_[_0xda6a('0x57')]({},_0x32963c,_0xc0dadc['options']);return _0x516845[_0xda6a('0x80')](_0x32963c);}})[_0xda6a('0x22')](function(_0x256a4a){if(_0x256a4a){_0x546782=_0x256a4a[_0xda6a('0x4e')];if(!_0xc0dadc[_0xda6a('0x49')]['hasOwnProperty'](_0xda6a('0x50'))){_0x32963c[_0xda6a('0x30')]=qs[_0xda6a('0x30')](_0xc0dadc[_0xda6a('0x49')][_0xda6a('0x30')]);_0x32963c['offset']=qs['offset'](_0xc0dadc[_0xda6a('0x49')][_0xda6a('0x51')]);}return _0x516845[_0xda6a('0x80')](_0x32963c);}})[_0xda6a('0x22')](function(_0x455680){if(_0x455680){return _0x455680?{'count':_0x546782,'rows':_0x455680}:null;}})[_0xda6a('0x22')](respondWithResult(_0xb8ad8e,null))['catch'](handleError(_0xb8ad8e,null));};exports[_0xda6a('0x81')]=function(_0x494ff1,_0x3b3ee6,_0x29144b){var _0x3203e0={'channel':_0xda6a('0x82')};var _0x58b627=[];var _0x4c0f1d=[];var _0x14c258={};return db[_0xda6a('0x43')][_0xda6a('0x65')]({'where':{'id':_0x494ff1['params']['id']},'include':[{'model':db[_0xda6a('0x7c')],'as':'Applications'}]})[_0xda6a('0x22')](handleEntityNotFound(_0x3b3ee6,null))[_0xda6a('0x22')](function(_0xeb7cc8){_0x3203e0[_0xda6a('0x83')]=_0xeb7cc8;if(_0x3203e0[_0xda6a('0x83')]&&_0x3203e0[_0xda6a('0x83')][_0xda6a('0x46')]==='sinch'&&_0x494ff1[_0xda6a('0x60')]['statuses']){if(_0x494ff1[_0xda6a('0x60')]['statuses'][_0xda6a('0x4e')]===0x0)return;if(_0x494ff1[_0xda6a('0x60')]['statuses'][0x0][_0xda6a('0x84')]!=='read')return;return db['WhatsappMessage'][_0xda6a('0x37')]({'read':!![],'readAt':_0x494ff1[_0xda6a('0x60')][_0xda6a('0x85')][0x0][_0xda6a('0x86')]},{'where':{'messageId':_0x494ff1[_0xda6a('0x60')]['statuses'][0x0][_0xda6a('0x87')]},'individualHooks':!![]})[_0xda6a('0x22')](function(_0x32a66d){return _0x3b3ee6[_0xda6a('0x2d')](0xc8)[_0xda6a('0x34')](_0x32a66d);});}_0x3203e0[_0xda6a('0x88')]=_[_0xda6a('0x89')](_0xeb7cc8['Applications'],['priority'],[_0xda6a('0x8a')]);if(_0x3203e0[_0xda6a('0x83')][_0xda6a('0x8b')]){delete _0x3203e0[_0xda6a('0x83')][_0xda6a('0x8b')];}return db[_0xda6a('0x8c')][_0xda6a('0x69')]()[_0xda6a('0x22')](function(_0x216d26){if(!_0x216d26){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))](_0xda6a('0x8f'));}_0x58b627=_[_0xda6a('0x90')](_['keys'](_0x216d26),[_0xda6a('0x91'),_0xda6a('0x92')]);_0x4c0f1d=_['difference'](_[_0xda6a('0x4a')](_0x216d26),['createdAt',_0xda6a('0x92'),_0xda6a('0x93'),'ListId']);_0x3203e0[_0xda6a('0x60')]={'mapKey':'mobile'};if(_0x3203e0[_0xda6a('0x83')]&&_0x3203e0[_0xda6a('0x83')][_0xda6a('0x46')]===_0xda6a('0x94')){_0x3203e0[_0xda6a('0x60')][_0xda6a('0x95')]=_0x494ff1[_0xda6a('0x60')][_0xda6a('0x96')][_0xda6a('0x97')](_0xda6a('0x98'),'');_0x3203e0[_0xda6a('0x60')][_0xda6a('0x60')]=_0x494ff1['body'][_0xda6a('0x99')];_0x3203e0[_0xda6a('0x60')][_0xda6a('0x9a')]=_0x494ff1['body'][_0xda6a('0x9b')];}if(_0x3203e0['account']&&_0x3203e0[_0xda6a('0x83')]['type']===_0xda6a('0x9c')){_0x3203e0[_0xda6a('0x60')][_0xda6a('0x95')]=_0x494ff1[_0xda6a('0x60')]['notifications'][0x0][_0xda6a('0x95')];_0x3203e0[_0xda6a('0x60')][_0xda6a('0x60')]=_0x494ff1[_0xda6a('0x60')][_0xda6a('0x9d')][0x0][_0xda6a('0x2a')][_0xda6a('0x60')];_0x3203e0['body'][_0xda6a('0x9a')]=_0x494ff1[_0xda6a('0x60')][_0xda6a('0x9d')][0x0][_0xda6a('0x87')];}if(_0x3203e0[_0xda6a('0x60')]['id']){delete _0x3203e0['body']['id'];}if(_[_0xda6a('0x9e')](_0x3203e0['body'][_0xda6a('0x95')])){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))](_0xda6a('0x9f'));}if(_['isNil'](_0x3203e0[_0xda6a('0x60')][_0xda6a('0x60')])||_0x3203e0[_0xda6a('0x60')][_0xda6a('0x60')]===''){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))](_0xda6a('0xa0'));}if(_[_0xda6a('0x9e')](_0x3203e0[_0xda6a('0x60')][_0xda6a('0xa1')])){throw new db['Sequelize'][(_0xda6a('0x8e'))](_0xda6a('0xa2')+_0x4c0f1d);}if(!_['includes'](_0x4c0f1d,_0x3203e0['body'][_0xda6a('0xa1')])){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c0f1d);}_0x14c258[_0x3203e0[_0xda6a('0x60')]['mapKey']]=_0x3203e0['body'][_0xda6a('0x95')];return db[_0xda6a('0xa3')][_0xda6a('0x65')]({'where':{'id':_0x3203e0[_0xda6a('0x83')][_0xda6a('0xa4')]},'include':[{'model':db[_0xda6a('0x8c')],'as':'Contacts','where':_0x14c258,'limit':0x1,'order':[[_0xda6a('0x92'),_0xda6a('0xa5')]]}]});})[_0xda6a('0x22')](handleEntityNotFound(_0x3b3ee6,null))[_0xda6a('0x22')](function(_0x4ca885){if(_0x4ca885){_0x3203e0[_0xda6a('0xa6')]=_[_0xda6a('0x73')](_0x4ca885,['Contacts']);if(_0x4ca885['Contacts'][_0xda6a('0x4e')]){return _0x4ca885[_0xda6a('0xa7')][0x0];}var _0x1cc7e3=_['defaults'](_0x3203e0['body'],{'firstName':_0x3203e0[_0xda6a('0x60')][_0xda6a('0x95')],'ListId':_0x4ca885['id']});_0x1cc7e3[_0x3203e0['body'][_0xda6a('0xa1')]]=_0x3203e0[_0xda6a('0x60')]['from'];return db[_0xda6a('0x8c')][_0xda6a('0x5f')](_0x1cc7e3,{'fields':_0x58b627,'raw':!![]});}})[_0xda6a('0x22')](handleEntityNotFound(_0x3b3ee6,null))[_0xda6a('0x22')](function(_0x481632){if(_0x481632){_0x3203e0[_0xda6a('0xa8')]=_0x481632;var _0x1b1d69={'ContactId':_0x481632['id'],'phone':_0x3203e0[_0xda6a('0x60')][_0xda6a('0x95')],'WhatsappAccountId':_0x494ff1['params']['id']};var _0x5b6844={'ContactId':_0x481632['id'],'WhatsappAccountId':_0x494ff1[_0xda6a('0x5d')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x5b6844})[_0xda6a('0x22')](function(_0xaed1ff){if(_0xaed1ff){return[_0xaed1ff,![]];}return db[_0xda6a('0xa9')]['create'](_0x1b1d69)[_0xda6a('0x22')](function(_0x171ae3){return[_0x171ae3,!![]];});});}})['spread'](function(_0x232a58,_0x11b518){_0x3203e0[_0xda6a('0xaa')]=_0x232a58['get']({'plain':!![]});_0x3203e0[_0xda6a('0xaa')]['created']=![];if(_0x11b518){if(_0x3203e0[_0xda6a('0x83')]['autoclose']){_0x3203e0['applications'][_0xda6a('0xab')]({'id':0x0,'priority':_0x3203e0[_0xda6a('0x88')]['length']+0x1,'app':'close','appdata':_0xda6a('0xac'),'interval':_0xda6a('0xad')});}_0x3203e0['interaction'][_0xda6a('0xae')]=!![];}return db['WhatsappMessage'][_0xda6a('0x5f')]({'phone':_0x3203e0[_0xda6a('0x60')][_0xda6a('0x95')],'messageId':_0x3203e0[_0xda6a('0x60')][_0xda6a('0x9a')],'body':_0x3203e0[_0xda6a('0x60')][_0xda6a('0x60')],'WhatsappAccountId':_0x494ff1['params']['id'],'WhatsappInteractionId':_0x232a58['id'],'direction':'in','ContactId':_0x232a58[_0xda6a('0xaf')],'AttachmentId':_0x3203e0['body'][_0xda6a('0xb0')]});})[_0xda6a('0x22')](function(_0x59c9f3){_0x3203e0['message']=_0x59c9f3;if(_0x3203e0[_0xda6a('0xaa')][_0xda6a('0xb1')]){return db[_0xda6a('0xb2')][_0xda6a('0x65')]({'attributes':['id',_0xda6a('0x3d')],'where':{'id':_0x3203e0[_0xda6a('0xaa')]['UserId']}})[_0xda6a('0x22')](function(_0x20c0dc){if(_0x20c0dc){_0x3203e0['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20c0dc[_0xda6a('0x3d')]+','+(_0x3203e0[_0xda6a('0x83')][_0xda6a('0xb3')]||0xa),'interval':_0xda6a('0xad')});}return respondWithRpcPromise(_0xda6a('0xb4'),'startRouting',_0x3203e0);});}return respondWithRpcPromise('Start',_0xda6a('0xb5'),_0x3203e0);})[_0xda6a('0x22')](function(_0xfd7461){if(_0xfd7461){var _0x5546eb=0xc8;var _0x447282=_0xda6a('0xb6');logger[_0xda6a('0x23')](_0xda6a('0x27'),_0x447282,_0x5546eb,_0xda6a('0xb7'));logger['debug'](_0xda6a('0xb8'),_0x447282,_0x5546eb,_0xda6a('0xb7'),JSON[_0xda6a('0xb9')](_0xfd7461));if(_0x3203e0[_0xda6a('0x83')][_0xda6a('0x46')]===_0xda6a('0x94')){return _0x3b3ee6[_0xda6a('0x2d')](_0x5546eb)[_0xda6a('0x32')]('Content-Type',_0xda6a('0xba'))[_0xda6a('0x3e')](_0xda6a('0xbb'));}else{return _0x3b3ee6['status'](_0x5546eb)[_0xda6a('0x34')](_0xfd7461);}}});})[_0xda6a('0x2c')](handleError(_0x3b3ee6,null));};exports[_0xda6a('0x3e')]=function(_0x16aca7,_0x13ae83,_0x26ad31){var _0x5668f8,_0x45719e,_0x24cad4;if(_[_0xda6a('0x9e')](_0x16aca7[_0xda6a('0x60')]['body'])||_0x16aca7[_0xda6a('0x60')][_0xda6a('0x60')]===''){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xda6a('0x9e')](_0x16aca7[_0xda6a('0x60')]['to'])){throw new db[(_0xda6a('0x8d'))][(_0xda6a('0x8e'))](_0xda6a('0xbc'));}_0x5668f8=_0x16aca7['body']['to'];return db[_0xda6a('0x43')]['find']({'where':{'id':_0x16aca7[_0xda6a('0x5d')]['id']},'include':[{'model':db[_0xda6a('0xa3')],'as':'List','include':[{'model':db['CmContact'],'as':_0xda6a('0xa7'),'where':{'mobile':_0x5668f8},'limit':0x1,'order':[['updatedAt',_0xda6a('0xa5')]]}]}]})[_0xda6a('0x22')](handleEntityNotFound(_0x13ae83,null))[_0xda6a('0x22')](function(_0x57646){if(_0x57646&&_0x57646[_0xda6a('0xbd')]){_0x45719e=_0x57646[_0xda6a('0x39')]({'plain':!![]});if(_0x45719e[_0xda6a('0xbd')]&&_0x45719e[_0xda6a('0xbd')]['Contacts'][_0xda6a('0x4e')]){return _0x45719e[_0xda6a('0xbd')][_0xda6a('0xa7')][0x0];}return db[_0xda6a('0x8c')][_0xda6a('0x5f')](_[_0xda6a('0x1c')](_0x16aca7[_0xda6a('0x60')],{'firstName':_0x5668f8,'mobile':_0x5668f8,'phone':_0x5668f8,'ListId':_0x45719e[_0xda6a('0xa4')]}));}})['then'](handleEntityNotFound(_0x13ae83,null))[_0xda6a('0x22')](function(_0x354f27){if(_0x354f27){_0x24cad4=_0x354f27;return db[_0xda6a('0xa9')]['find']({'where':{'ContactId':_0x24cad4['id'],'closed':![],'WhatsappAccountId':_0x45719e['id']}})[_0xda6a('0x22')](function(_0x119062){if(_0x119062){return[_0x119062,![]];}return db[_0xda6a('0xa9')]['create']({'UserId':_0x16aca7[_0xda6a('0x61')]['id'],'ContactId':_0x24cad4['id'],'WhatsappAccountId':_0x45719e['id'],'phone':_0x5668f8,'firstMsgDirection':_0xda6a('0xbe'),'Messages':[_[_0xda6a('0x57')](_0x16aca7['body'],{'read':![],'body':_0x16aca7['body'][_0xda6a('0x60')],'phone':_0x5668f8,'WhatsappAccountId':_0x45719e['id'],'UserId':_0x16aca7[_0xda6a('0x61')]['id'],'ContactId':_0x24cad4['id']})]},{'include':[{'model':db[_0xda6a('0xbf')],'as':_0xda6a('0xc0')}]})['then'](function(_0x64619c){return[_0x64619c,!![]];});});}})['spread'](function(_0xb6c354,_0x8d07ec){if(_0x8d07ec){return _0xb6c354;}return db[_0xda6a('0xbf')][_0xda6a('0x5f')](_[_0xda6a('0x57')](_0x16aca7['body'],{'read':![],'body':_0x16aca7[_0xda6a('0x60')]['body'],'phone':_0x5668f8,'WhatsappAccountId':_0x45719e['id'],'WhatsappInteractionId':_0xb6c354['id'],'UserId':_0x16aca7['user']['id'],'ContactId':_0x24cad4['id']}))[_0xda6a('0x22')](function(_0x3eaef0){_0xb6c354[_0xda6a('0xc1')]['Messages']=[];_0xb6c354[_0xda6a('0xc1')][_0xda6a('0xc0')][_0xda6a('0xab')](_0x3eaef0[_0xda6a('0xc1')]);return _0xb6c354;});})[_0xda6a('0x22')](respondWithResult(_0x13ae83,null))[_0xda6a('0x2c')](handleError(_0x13ae83,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f0056df..852a039 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 _0xfc80=['save','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x3ea150,_0x1cac32){var _0x10242d=function(_0x3b1ce9){while(--_0x3b1ce9){_0x3ea150['push'](_0x3ea150['shift']());}};_0x10242d(++_0x1cac32);}(_0xfc80,0x74));var _0x0fc8=function(_0x3607c1,_0x3a2a9a){_0x3607c1=_0x3607c1-0x0;var _0x364b0b=_0xfc80[_0x3607c1];return _0x364b0b;};'use strict';var EventEmitter=require(_0x0fc8('0x0'));var WhatsappAccount=require(_0x0fc8('0x1'))['db'][_0x0fc8('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0fc8('0x3')](0x0);var events={'afterCreate':_0x0fc8('0x4'),'afterUpdate':_0x0fc8('0x5'),'afterDestroy':_0x0fc8('0x6')};function emitEvent(_0x3d5c03){return function(_0x87b7ad,_0x225290,_0x165cc2){WhatsappAccountEvents[_0x0fc8('0x7')](_0x3d5c03+':'+_0x87b7ad['id'],_0x87b7ad);WhatsappAccountEvents[_0x0fc8('0x7')](_0x3d5c03,_0x87b7ad);_0x165cc2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x0fc8('0x8')](e,emitEvent(event));}}module[_0x0fc8('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x5794=['remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x5add35,_0x5ea6bb){var _0x35d277=function(_0x2b1496){while(--_0x2b1496){_0x5add35['push'](_0x5add35['shift']());}};_0x35d277(++_0x5ea6bb);}(_0x5794,0x16c));var _0x4579=function(_0x2f86ee,_0x25ae73){_0x2f86ee=_0x2f86ee-0x0;var _0xf4ee92=_0x5794[_0x2f86ee];return _0xf4ee92;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x4579('0x0'))['db'][_0x4579('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4579('0x2')](0x0);var events={'afterCreate':_0x4579('0x3'),'afterUpdate':'update','afterDestroy':_0x4579('0x4')};function emitEvent(_0x3976c1){return function(_0x332fc6,_0x363fb8,_0x399ab4){WhatsappAccountEvents[_0x4579('0x5')](_0x3976c1+':'+_0x332fc6['id'],_0x332fc6);WhatsappAccountEvents[_0x4579('0x5')](_0x3976c1,_0x332fc6);_0x399ab4(null);};}for(var e in events){if(events[_0x4579('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x4579('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index b63aa3c..91a5e9f 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 _0xf5ab=['../../config/environment','exports','define','WhatsappAccount','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x17de40,_0x564903){var _0x233e21=function(_0x370c9f){while(--_0x370c9f){_0x17de40['push'](_0x17de40['shift']());}};_0x233e21(++_0x564903);}(_0xf5ab,0x1c6));var _0xbf5a=function(_0x34c08e,_0x19a2d3){_0x34c08e=_0x34c08e-0x0;var _0x4bc4c0=_0xf5ab[_0x34c08e];return _0x4bc4c0;};'use strict';var _=require(_0xbf5a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbf5a('0x1'));var BPromise=require(_0xbf5a('0x2'));var rp=require(_0xbf5a('0x3'));var fs=require('fs');var path=require(_0xbf5a('0x4'));var rimraf=require(_0xbf5a('0x5'));var config=require(_0xbf5a('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xbf5a('0x7')]=function(_0x4f1d99,_0x22575e){return _0x4f1d99[_0xbf5a('0x8')](_0xbf5a('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa322=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa322,0xce));var _0x2a32=function(_0x37bcc7,_0x45db37){_0x37bcc7=_0x37bcc7-0x0;var _0x51a69d=_0xa322[_0x37bcc7];return _0x51a69d;};'use strict';var _=require(_0x2a32('0x0'));var util=require('util');var logger=require(_0x2a32('0x1'))(_0x2a32('0x2'));var moment=require(_0x2a32('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a32('0x4'));var fs=require('fs');var path=require(_0x2a32('0x5'));var rimraf=require(_0x2a32('0x6'));var config=require(_0x2a32('0x7'));var attributes=require(_0x2a32('0x8'));module[_0x2a32('0x9')]=function(_0x509ca1,_0x573855){return _0x509ca1[_0x2a32('0xa')](_0x2a32('0xb'),attributes,{'tableName':_0x2a32('0xc'),'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 7b3f6d2..8528f66 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 _0xbdc4=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','WhatsappAccount,\x20%s,\x20%s','message','error','result','catch','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','util','moment','bluebird','randomstring','../../config/logger'];(function(_0x37febe,_0x12d212){var _0x2dbde4=function(_0x51a773){while(--_0x51a773){_0x37febe['push'](_0x37febe['shift']());}};_0x2dbde4(++_0x12d212);}(_0xbdc4,0xaa));var _0x4bdc=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xbdc4[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var util=require(_0x4bdc('0x0'));var moment=require(_0x4bdc('0x1'));var BPromise=require(_0x4bdc('0x2'));var rs=require(_0x4bdc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4bdc('0x4'))(_0x4bdc('0x5'));var config=require(_0x4bdc('0x6'));var jayson=require(_0x4bdc('0x7'));var client=jayson[_0x4bdc('0x8')][_0x4bdc('0x9')]({'port':0x232a});config[_0x4bdc('0xa')]=_['defaults'](config[_0x4bdc('0xa')],{'host':_0x4bdc('0xb'),'port':0x18eb});var socket=require(_0x4bdc('0xc'))(new Redis(config[_0x4bdc('0xa')]));require('./whatsappAccount.socket')[_0x4bdc('0xd')](socket);function respondWithRpcPromise(_0xff78b5,_0x38c993,_0x336642){return new BPromise(function(_0x276a9a,_0x13f9e9){return client[_0x4bdc('0xe')](_0xff78b5,_0x336642)[_0x4bdc('0xf')](function(_0x7ad524){logger[_0x4bdc('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x38c993,_0x4bdc('0x11'));logger[_0x4bdc('0x12')](_0x4bdc('0x13'),_0x38c993,_0x4bdc('0x11'),JSON[_0x4bdc('0x14')](_0x7ad524));if(_0x7ad524['error']){if(_0x7ad524['error'][_0x4bdc('0x15')]===0x1f4){logger['error'](_0x4bdc('0x16'),_0x38c993,_0x7ad524['error'][_0x4bdc('0x17')]);return _0x13f9e9(_0x7ad524[_0x4bdc('0x18')]['message']);}logger[_0x4bdc('0x18')](_0x4bdc('0x16'),_0x38c993,_0x7ad524[_0x4bdc('0x18')][_0x4bdc('0x17')]);return _0x276a9a(_0x7ad524[_0x4bdc('0x18')][_0x4bdc('0x17')]);}else{logger[_0x4bdc('0x10')](_0x4bdc('0x16'),_0x38c993,_0x4bdc('0x11'));_0x276a9a(_0x7ad524[_0x4bdc('0x19')][_0x4bdc('0x17')]);}})[_0x4bdc('0x1a')](function(_0x3658ea){logger[_0x4bdc('0x18')](_0x4bdc('0x16'),_0x38c993,_0x3658ea);_0x13f9e9(_0x3658ea);});});}exports['ShowWhatsappAccount']=function(_0x42eab4){var _0x185a73=this;return new Promise(function(_0x4ac142,_0x589c26){return db['WhatsappAccount']['find']({'raw':_0x42eab4[_0x4bdc('0x1b')]?_0x42eab4['options'][_0x4bdc('0x1c')]===undefined?!![]:![]:!![],'where':_0x42eab4['options']?_0x42eab4[_0x4bdc('0x1b')][_0x4bdc('0x1d')]||null:null,'attributes':_0x42eab4[_0x4bdc('0x1b')]?_0x42eab4[_0x4bdc('0x1b')]['attributes']||null:null,'include':_0x42eab4[_0x4bdc('0x1b')]?_0x42eab4[_0x4bdc('0x1b')][_0x4bdc('0x1e')]?_[_0x4bdc('0x1f')](_0x42eab4[_0x4bdc('0x1b')][_0x4bdc('0x1e')],function(_0x5a120f){return{'model':db[_0x5a120f[_0x4bdc('0x20')]],'as':_0x5a120f['as'],'attributes':_0x5a120f[_0x4bdc('0x21')],'include':_0x5a120f['include']?_[_0x4bdc('0x1f')](_0x5a120f[_0x4bdc('0x1e')],function(_0x3dfff8){return{'model':db[_0x3dfff8[_0x4bdc('0x20')]],'as':_0x3dfff8['as'],'attributes':_0x3dfff8[_0x4bdc('0x21')],'include':_0x3dfff8[_0x4bdc('0x1e')]?_[_0x4bdc('0x1f')](_0x3dfff8[_0x4bdc('0x1e')],function(_0x3d63b9){return{'model':db[_0x3d63b9[_0x4bdc('0x20')]],'as':_0x3d63b9['as'],'attributes':_0x3d63b9[_0x4bdc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4bdc('0xf')](function(_0x472681){logger['info'](_0x4bdc('0x22'),_0x42eab4);logger[_0x4bdc('0x12')](_0x4bdc('0x22'),_0x42eab4,JSON[_0x4bdc('0x14')](_0x472681));_0x4ac142(_0x472681);})['catch'](function(_0x514394){logger['error'](_0x4bdc('0x22'),_0x514394['message'],_0x42eab4);_0x589c26(_0x185a73['error'](0x1f4,_0x514394[_0x4bdc('0x17')]));});});}; \ No newline at end of file +var _0x44d5=['WhatsappAccount','find','options','raw','include','attributes','model','map','ShowWhatsappAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x586770,_0xd04ca3){var _0x5ea8d9=function(_0x76ff68){while(--_0x76ff68){_0x586770['push'](_0x586770['shift']());}};_0x5ea8d9(++_0xd04ca3);}(_0x44d5,0xa1));var _0x544d=function(_0x383875,_0x45b02b){_0x383875=_0x383875-0x0;var _0x128fc2=_0x44d5[_0x383875];return _0x128fc2;};'use strict';var _=require(_0x544d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x544d('0x1'));var rs=require(_0x544d('0x2'));var fs=require('fs');var Redis=require(_0x544d('0x3'));var db=require(_0x544d('0x4'))['db'];var utils=require(_0x544d('0x5'));var logger=require(_0x544d('0x6'))('rpc');var config=require(_0x544d('0x7'));var jayson=require(_0x544d('0x8'));var client=jayson[_0x544d('0x9')][_0x544d('0xa')]({'port':0x232a});config[_0x544d('0xb')]=_[_0x544d('0xc')](config[_0x544d('0xb')],{'host':_0x544d('0xd'),'port':0x18eb});var socket=require(_0x544d('0xe'))(new Redis(config['redis']));require(_0x544d('0xf'))[_0x544d('0x10')](socket);function respondWithRpcPromise(_0x7b9787,_0x57b0f9,_0x51e0cf){return new BPromise(function(_0x332f07,_0x27c67d){return client['request'](_0x7b9787,_0x51e0cf)[_0x544d('0x11')](function(_0x13b19f){logger[_0x544d('0x12')](_0x544d('0x13'),_0x57b0f9,'request\x20sent');logger[_0x544d('0x14')](_0x544d('0x15'),_0x57b0f9,_0x544d('0x16'),JSON[_0x544d('0x17')](_0x13b19f));if(_0x13b19f[_0x544d('0x18')]){if(_0x13b19f[_0x544d('0x18')][_0x544d('0x19')]===0x1f4){logger[_0x544d('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x57b0f9,_0x13b19f[_0x544d('0x18')][_0x544d('0x1a')]);return _0x27c67d(_0x13b19f[_0x544d('0x18')][_0x544d('0x1a')]);}logger[_0x544d('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x57b0f9,_0x13b19f[_0x544d('0x18')][_0x544d('0x1a')]);return _0x332f07(_0x13b19f[_0x544d('0x18')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x57b0f9,_0x544d('0x16'));_0x332f07(_0x13b19f[_0x544d('0x1b')][_0x544d('0x1a')]);}})[_0x544d('0x1c')](function(_0x3922d9){logger['error'](_0x544d('0x13'),_0x57b0f9,_0x3922d9);_0x27c67d(_0x3922d9);});});}exports['ShowWhatsappAccount']=function(_0x58df9e){var _0x16f3af=this;return new Promise(function(_0x472589,_0x3d847d){return db[_0x544d('0x1d')][_0x544d('0x1e')]({'raw':_0x58df9e[_0x544d('0x1f')]?_0x58df9e[_0x544d('0x1f')][_0x544d('0x20')]===undefined?!![]:![]:!![],'where':_0x58df9e['options']?_0x58df9e[_0x544d('0x1f')]['where']||null:null,'attributes':_0x58df9e[_0x544d('0x1f')]?_0x58df9e['options']['attributes']||null:null,'include':_0x58df9e[_0x544d('0x1f')]?_0x58df9e['options']['include']?_['map'](_0x58df9e[_0x544d('0x1f')][_0x544d('0x21')],function(_0x4617a0){return{'model':db[_0x4617a0['model']],'as':_0x4617a0['as'],'attributes':_0x4617a0[_0x544d('0x22')],'include':_0x4617a0[_0x544d('0x21')]?_['map'](_0x4617a0[_0x544d('0x21')],function(_0x2ce3d9){return{'model':db[_0x2ce3d9[_0x544d('0x23')]],'as':_0x2ce3d9['as'],'attributes':_0x2ce3d9[_0x544d('0x22')],'include':_0x2ce3d9[_0x544d('0x21')]?_[_0x544d('0x24')](_0x2ce3d9[_0x544d('0x21')],function(_0x47c2e5){return{'model':db[_0x47c2e5[_0x544d('0x23')]],'as':_0x47c2e5['as'],'attributes':_0x47c2e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x544d('0x11')](function(_0x52b869){logger[_0x544d('0x12')](_0x544d('0x25'),_0x58df9e);logger[_0x544d('0x14')](_0x544d('0x25'),_0x58df9e,JSON[_0x544d('0x17')](_0x52b869));_0x472589(_0x52b869);})[_0x544d('0x1c')](function(_0x4f6011){logger[_0x544d('0x18')](_0x544d('0x25'),_0x4f6011['message'],_0x58df9e);_0x3d847d(_0x16f3af[_0x544d('0x18')](0x1f4,_0x4f6011['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 4fb0f04..489c7a5 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 _0x9600=['remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x9600,0x10a));var _0x0960=function(_0x2e8ada,_0x687325){_0x2e8ada=_0x2e8ada-0x0;var _0x27a2f6=_0x9600[_0x2e8ada];return _0x27a2f6;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x0960('0x0'),_0x0960('0x1')];function createListener(_0x3d2f0c,_0x3aad53){return function(_0x23d820){_0x3aad53[_0x0960('0x2')](_0x3d2f0c,_0x23d820);};}function removeListener(_0x1c10a2,_0x2c7002){return function(){WhatsappAccountEvents[_0x0960('0x3')](_0x1c10a2,_0x2c7002);};}exports[_0x0960('0x4')]=function(_0x36853f){for(var _0x10e95b=0x0,_0x4763a9=events[_0x0960('0x5')];_0x10e95b<_0x4763a9;_0x10e95b++){var _0x2f306d=events[_0x10e95b];var _0x555f02=createListener(_0x0960('0x6')+_0x2f306d,_0x36853f);WhatsappAccountEvents['on'](_0x2f306d,_0x555f02);}}; \ No newline at end of file +var _0x9675=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9675,0x81));var _0x5967=function(_0x46436d,_0x1db1e9){_0x46436d=_0x46436d-0x0;var _0x4a5118=_0x9675[_0x46436d];return _0x4a5118;};'use strict';var WhatsappAccountEvents=require(_0x5967('0x0'));var events=[_0x5967('0x1'),_0x5967('0x2'),_0x5967('0x3')];function createListener(_0x231f80,_0x499f1c){return function(_0x413e4f){_0x499f1c[_0x5967('0x4')](_0x231f80,_0x413e4f);};}function removeListener(_0x4e40b0,_0x157153){return function(){WhatsappAccountEvents[_0x5967('0x5')](_0x4e40b0,_0x157153);};}exports[_0x5967('0x6')]=function(_0x3e276c){for(var _0x5788e8=0x0,_0x16083f=events[_0x5967('0x7')];_0x5788e8<_0x16083f;_0x5788e8++){var _0x477a18=events[_0x5788e8];var _0x435b8a=createListener(_0x5967('0x8')+_0x477a18,_0x3e276c);WhatsappAccountEvents['on'](_0x477a18,_0x435b8a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 2ba1870..4850b61 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 _0x3d18=['index','/:id','show','create','put','update','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x5714e0,_0xbf4ccd){var _0x348053=function(_0x32e904){while(--_0x32e904){_0x5714e0['push'](_0x5714e0['shift']());}};_0x348053(++_0xbf4ccd);}(_0x3d18,0xd4));var _0x83d1=function(_0x2371d0,_0x286b09){_0x2371d0=_0x2371d0-0x0;var _0x5f3a71=_0x3d18[_0x2371d0];return _0x5f3a71;};'use strict';var multer=require(_0x83d1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x83d1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x83d1('0x2'));var auth=require(_0x83d1('0x3'));var interaction=require(_0x83d1('0x4'));var config=require(_0x83d1('0x5'));var controller=require(_0x83d1('0x6'));router[_0x83d1('0x7')]('/',auth[_0x83d1('0x8')](),controller[_0x83d1('0x9')]);router[_0x83d1('0x7')](_0x83d1('0xa'),auth[_0x83d1('0x8')](),controller[_0x83d1('0xb')]);router['post']('/',auth[_0x83d1('0x8')](),controller[_0x83d1('0xc')]);router[_0x83d1('0xd')](_0x83d1('0xa'),auth[_0x83d1('0x8')](),controller[_0x83d1('0xe')]);router[_0x83d1('0xf')]('/:id',auth[_0x83d1('0x8')](),controller[_0x83d1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9913=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x9913,0x9e));var _0x3991=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x9913[_0x233716];return _0x302298;};'use strict';var multer=require(_0x3991('0x0'));var util=require(_0x3991('0x1'));var path=require(_0x3991('0x2'));var timeout=require(_0x3991('0x3'));var express=require(_0x3991('0x4'));var router=express[_0x3991('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3991('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3991('0x7'));var controller=require(_0x3991('0x8'));router[_0x3991('0x9')]('/',auth[_0x3991('0xa')](),controller[_0x3991('0xb')]);router[_0x3991('0x9')]('/:id',auth[_0x3991('0xa')](),controller[_0x3991('0xc')]);router[_0x3991('0xd')]('/',auth['isAuthenticated'](),controller[_0x3991('0xe')]);router[_0x3991('0xf')](_0x3991('0x10'),auth['isAuthenticated'](),controller[_0x3991('0x11')]);router[_0x3991('0x12')](_0x3991('0x10'),auth[_0x3991('0xa')](),controller[_0x3991('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 b1335c7..9d3e635 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 _0x0a99=['INTEGER','STRING','sequelize','exports'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x0a99,0xaa));var _0x90a9=function(_0x2f0aa9,_0xb27998){_0x2f0aa9=_0x2f0aa9-0x0;var _0x2de989=_0x0a99[_0x2f0aa9];return _0x2de989;};'use strict';var Sequelize=require(_0x90a9('0x0'));module[_0x90a9('0x1')]={'priority':{'type':Sequelize[_0x90a9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x90a9('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc553=['STRING','TEXT','sequelize','exports'];(function(_0x54f703,_0x2fb71e){var _0x3ebd7d=function(_0x22d46b){while(--_0x22d46b){_0x54f703['push'](_0x54f703['shift']());}};_0x3ebd7d(++_0x2fb71e);}(_0xc553,0x172));var _0x3c55=function(_0x484caf,_0x1195dd){_0x484caf=_0x484caf-0x0;var _0x36ab86=_0xc553[_0x484caf];return _0x36ab86;};'use strict';var Sequelize=require(_0x3c55('0x0'));module[_0x3c55('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3c55('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3c55('0x3')]()},'description':{'type':Sequelize[_0x3c55('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 02b5e16..5cf701e 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 _0x5d59=['moment','bluebird','util','to-csv','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/license/util','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','save','update','then','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x42d2ed,_0x25feae){var _0x5ab750=function(_0x47796d){while(--_0x47796d){_0x42d2ed['push'](_0x42d2ed['shift']());}};_0x5ab750(++_0x25feae);}(_0x5d59,0x15f));var _0x95d5=function(_0x587577,_0x53a237){_0x587577=_0x587577-0x0;var _0x75d167=_0x5d59[_0x587577];return _0x75d167;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95d5('0x0'));var zipdir=require(_0x95d5('0x1'));var jsonpatch=require(_0x95d5('0x2'));var rp=require(_0x95d5('0x3'));var moment=require(_0x95d5('0x4'));var BPromise=require(_0x95d5('0x5'));var Mustache=require('mustache');var util=require(_0x95d5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x95d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d5('0x8'));var squel=require(_0x95d5('0x9'));var crypto=require(_0x95d5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x95d5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x95d5('0xc'));var Papa=require('papaparse');var Redis=require(_0x95d5('0xd'));var authService=require(_0x95d5('0xe'));var qs=require(_0x95d5('0xf'));var as=require(_0x95d5('0x10'));var hardwareService=require(_0x95d5('0x11'));var logger=require(_0x95d5('0x12'))(_0x95d5('0x13'));var utils=require(_0x95d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x95d5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47fb16,_0x12b0ff){_0x12b0ff=_0x12b0ff||0xcc;return function(_0x30ad51){if(_0x30ad51){return _0x47fb16[_0x95d5('0x16')](_0x12b0ff);}return _0x47fb16[_0x95d5('0x17')](_0x12b0ff)['end']();};}function respondWithResult(_0x33d769,_0x2ce559){_0x2ce559=_0x2ce559||0xc8;return function(_0x3c0c3e){if(_0x3c0c3e){return _0x33d769[_0x95d5('0x17')](_0x2ce559)[_0x95d5('0x18')](_0x3c0c3e);}};}function respondWithFilteredResult(_0x3a59df,_0x3d8de7){return function(_0x1f03eb){if(_0x1f03eb){var _0x14d8a9=typeof _0x3d8de7['offset']==='undefined'&&typeof _0x3d8de7[_0x95d5('0x19')]==='undefined';var _0x34a382=_0x1f03eb[_0x95d5('0x1a')];var _0x5bdf14=_0x14d8a9?0x0:_0x3d8de7[_0x95d5('0x1b')];var _0x3793eb=_0x14d8a9?_0x1f03eb[_0x95d5('0x1a')]:_0x3d8de7[_0x95d5('0x1b')]+_0x3d8de7[_0x95d5('0x19')];var _0x11e905;if(_0x3793eb>=_0x34a382){_0x3793eb=_0x34a382;_0x11e905=0xc8;}else{_0x11e905=0xce;}_0x3a59df['status'](_0x11e905);return _0x3a59df[_0x95d5('0x1c')](_0x95d5('0x1d'),_0x5bdf14+'-'+_0x3793eb+'/'+_0x34a382)[_0x95d5('0x18')](_0x1f03eb);}return null;};}function patchUpdates(_0x5bd58d){return function(_0x5e8a19){try{jsonpatch[_0x95d5('0x1e')](_0x5e8a19,_0x5bd58d,!![]);}catch(_0x4023d3){return BPromise['reject'](_0x4023d3);}return _0x5e8a19[_0x95d5('0x1f')]();};}function saveUpdates(_0x2557e7,_0x2ca4b6){return function(_0x51ba73){if(_0x51ba73){return _0x51ba73[_0x95d5('0x20')](_0x2557e7)['then'](function(_0x5a5a7e){return _0x5a5a7e;});}return null;};}function removeEntity(_0x4f64ac,_0x554f4d){return function(_0x588825){if(_0x588825){return _0x588825['destroy']()[_0x95d5('0x21')](function(){_0x4f64ac[_0x95d5('0x17')](0xcc)[_0x95d5('0x22')]();});}};}function handleEntityNotFound(_0x260582,_0x54f64c){return function(_0x3fe6ef){if(!_0x3fe6ef){_0x260582[_0x95d5('0x16')](0x194);}return _0x3fe6ef;};}function handleError(_0x316d19,_0x1b8d73){_0x1b8d73=_0x1b8d73||0x1f4;return function(_0xe12a95){logger[_0x95d5('0x23')](_0xe12a95[_0x95d5('0x24')]);if(_0xe12a95[_0x95d5('0x25')]){delete _0xe12a95[_0x95d5('0x25')];}_0x316d19[_0x95d5('0x17')](_0x1b8d73)['send'](_0xe12a95);};}exports['index']=function(_0xd9b81c,_0x18121f){var _0x256727={},_0x5dfe00={},_0x1c8626={'count':0x0,'rows':[]};var _0x4e6f3b=_[_0x95d5('0x26')](db['WhatsappApplication'][_0x95d5('0x27')],function(_0x14b058){return{'name':_0x14b058[_0x95d5('0x28')],'type':_0x14b058[_0x95d5('0x29')][_0x95d5('0x2a')]};});_0x5dfe00[_0x95d5('0x2b')]=_[_0x95d5('0x26')](_0x4e6f3b,_0x95d5('0x25'));_0x5dfe00['query']=_['keys'](_0xd9b81c['query']);_0x5dfe00[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x5dfe00[_0x95d5('0x2b')],_0x5dfe00[_0x95d5('0x2e')]);_0x256727[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x5dfe00['model'],qs[_0x95d5('0x30')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x256727[_0x95d5('0x2f')]=_0x256727[_0x95d5('0x2f')][_0x95d5('0x31')]?_0x256727[_0x95d5('0x2f')]:_0x5dfe00[_0x95d5('0x2b')];if(!_0xd9b81c[_0x95d5('0x2e')]['hasOwnProperty']('nolimit')){_0x256727[_0x95d5('0x19')]=qs[_0x95d5('0x19')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x19')]);_0x256727['offset']=qs[_0x95d5('0x1b')](_0xd9b81c['query'][_0x95d5('0x1b')]);}_0x256727[_0x95d5('0x32')]=qs[_0x95d5('0x33')](_0xd9b81c['query'][_0x95d5('0x33')]);_0x256727[_0x95d5('0x34')]=qs[_0x95d5('0x2c')](_[_0x95d5('0x35')](_0xd9b81c[_0x95d5('0x2e')],_0x5dfe00[_0x95d5('0x2c')]),_0x4e6f3b);if(_0xd9b81c['query'][_0x95d5('0x36')]){_0x256727[_0x95d5('0x34')]=_[_0x95d5('0x37')](_0x256727[_0x95d5('0x34')],{'$or':_[_0x95d5('0x26')](_0x4e6f3b,function(_0x236e98){if(_0x236e98[_0x95d5('0x29')]!==_0x95d5('0x38')){var _0x172396={};_0x172396[_0x236e98[_0x95d5('0x25')]]={'$like':'%'+_0xd9b81c['query']['filter']+'%'};return _0x172396;}})});}_0x256727=_[_0x95d5('0x37')]({},_0x256727,_0xd9b81c[_0x95d5('0x39')]);var _0x28a05e={'where':_0x256727[_0x95d5('0x34')]};return db[_0x95d5('0x3a')]['count'](_0x28a05e)[_0x95d5('0x21')](function(_0xc7b674){_0x1c8626[_0x95d5('0x1a')]=_0xc7b674;if(_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x256727[_0x95d5('0x3c')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x95d5('0x3d')](_0x256727);})[_0x95d5('0x21')](function(_0xb00cd0){_0x1c8626[_0x95d5('0x3e')]=_0xb00cd0;return _0x1c8626;})[_0x95d5('0x21')](respondWithFilteredResult(_0x18121f,_0x256727))[_0x95d5('0x3f')](handleError(_0x18121f,null));};exports[_0x95d5('0x40')]=function(_0x344d4f,_0x2baab8){var _0x5bc9c8={'raw':!![],'where':{'id':_0x344d4f[_0x95d5('0x41')]['id']}},_0x37238b={};_0x37238b[_0x95d5('0x2b')]=_[_0x95d5('0x42')](db['WhatsappApplication'][_0x95d5('0x27')]);_0x37238b['query']=_[_0x95d5('0x42')](_0x344d4f[_0x95d5('0x2e')]);_0x37238b[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],_0x37238b['query']);_0x5bc9c8[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],qs[_0x95d5('0x30')](_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x5bc9c8[_0x95d5('0x2f')]=_0x5bc9c8[_0x95d5('0x2f')]['length']?_0x5bc9c8['attributes']:_0x37238b[_0x95d5('0x2b')];if(_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x5bc9c8['include']=[{'all':!![]}];}_0x5bc9c8=_[_0x95d5('0x37')]({},_0x5bc9c8,_0x344d4f[_0x95d5('0x39')]);return db['WhatsappApplication'][_0x95d5('0x43')](_0x5bc9c8)['then'](handleEntityNotFound(_0x2baab8,null))[_0x95d5('0x21')](respondWithResult(_0x2baab8,null))[_0x95d5('0x3f')](handleError(_0x2baab8,null));};exports[_0x95d5('0x44')]=function(_0x13419e,_0x2ebc44){return db[_0x95d5('0x3a')][_0x95d5('0x44')](_0x13419e[_0x95d5('0x45')],{})['then'](respondWithResult(_0x2ebc44,0xc9))['catch'](handleError(_0x2ebc44,null));};exports[_0x95d5('0x20')]=function(_0x1d24e8,_0x1f7efd){if(_0x1d24e8[_0x95d5('0x45')]['id']){delete _0x1d24e8[_0x95d5('0x45')]['id'];}return db['WhatsappApplication'][_0x95d5('0x43')]({'where':{'id':_0x1d24e8[_0x95d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f7efd,null))[_0x95d5('0x21')](saveUpdates(_0x1d24e8[_0x95d5('0x45')],null))['then'](respondWithResult(_0x1f7efd,null))[_0x95d5('0x3f')](handleError(_0x1f7efd,null));};exports[_0x95d5('0x46')]=function(_0x170116,_0x4cceae){return db[_0x95d5('0x3a')][_0x95d5('0x43')]({'where':{'id':_0x170116['params']['id']}})[_0x95d5('0x21')](handleEntityNotFound(_0x4cceae,null))[_0x95d5('0x21')](removeEntity(_0x4cceae,null))['catch'](handleError(_0x4cceae,null));}; \ No newline at end of file +var _0xd481=['where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','WhatsappApplication','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x346f5a,_0x33de62){var _0x2c1254=function(_0x20c734){while(--_0x20c734){_0x346f5a['push'](_0x346f5a['shift']());}};_0x2c1254(++_0x33de62);}(_0xd481,0x1e4));var _0x1d48=function(_0x40d077,_0x173490){_0x40d077=_0x40d077-0x0;var _0x3e01e9=_0xd481[_0x40d077];return _0x3e01e9;};'use strict';var emlformat=require(_0x1d48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d48('0x1'));var jsonpatch=require(_0x1d48('0x2'));var rp=require('request-promise');var moment=require(_0x1d48('0x3'));var BPromise=require(_0x1d48('0x4'));var Mustache=require(_0x1d48('0x5'));var util=require('util');var path=require(_0x1d48('0x6'));var sox=require('sox');var csv=require(_0x1d48('0x7'));var ejs=require(_0x1d48('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d48('0x9'));var squel=require(_0x1d48('0xa'));var crypto=require(_0x1d48('0xb'));var jsforce=require(_0x1d48('0xc'));var deskjs=require(_0x1d48('0xd'));var toCsv=require(_0x1d48('0x7'));var querystring=require(_0x1d48('0xe'));var Papa=require(_0x1d48('0xf'));var Redis=require(_0x1d48('0x10'));var authService=require(_0x1d48('0x11'));var qs=require(_0x1d48('0x12'));var as=require(_0x1d48('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d48('0x14'))(_0x1d48('0x15'));var utils=require(_0x1d48('0x16'));var config=require(_0x1d48('0x17'));var licenseUtil=require(_0x1d48('0x18'));var db=require(_0x1d48('0x19'))['db'];function respondWithStatusCode(_0xa1246f,_0x33b907){_0x33b907=_0x33b907||0xcc;return function(_0x2ac3e9){if(_0x2ac3e9){return _0xa1246f[_0x1d48('0x1a')](_0x33b907);}return _0xa1246f['status'](_0x33b907)[_0x1d48('0x1b')]();};}function respondWithResult(_0x5f1ad8,_0x1c7f51){_0x1c7f51=_0x1c7f51||0xc8;return function(_0x2ccc5e){if(_0x2ccc5e){return _0x5f1ad8[_0x1d48('0x1c')](_0x1c7f51)[_0x1d48('0x1d')](_0x2ccc5e);}};}function respondWithFilteredResult(_0x4f9f04,_0x1845bd){return function(_0x2e2748){if(_0x2e2748){var _0x27fd35=typeof _0x1845bd['offset']===_0x1d48('0x1e')&&typeof _0x1845bd[_0x1d48('0x1f')]===_0x1d48('0x1e');var _0x1b60d4=_0x2e2748[_0x1d48('0x20')];var _0x2a007c=_0x27fd35?0x0:_0x1845bd[_0x1d48('0x21')];var _0x258c7a=_0x27fd35?_0x2e2748[_0x1d48('0x20')]:_0x1845bd['offset']+_0x1845bd['limit'];var _0xb5f9d2;if(_0x258c7a>=_0x1b60d4){_0x258c7a=_0x1b60d4;_0xb5f9d2=0xc8;}else{_0xb5f9d2=0xce;}_0x4f9f04[_0x1d48('0x1c')](_0xb5f9d2);return _0x4f9f04[_0x1d48('0x22')](_0x1d48('0x23'),_0x2a007c+'-'+_0x258c7a+'/'+_0x1b60d4)[_0x1d48('0x1d')](_0x2e2748);}return null;};}function patchUpdates(_0x93521d){return function(_0x341cdf){try{jsonpatch[_0x1d48('0x24')](_0x341cdf,_0x93521d,!![]);}catch(_0x5df7ac){return BPromise[_0x1d48('0x25')](_0x5df7ac);}return _0x341cdf[_0x1d48('0x26')]();};}function saveUpdates(_0x5a6035,_0x559d7a){return function(_0x1bb115){if(_0x1bb115){return _0x1bb115[_0x1d48('0x27')](_0x5a6035)[_0x1d48('0x28')](function(_0x20699a){return _0x20699a;});}return null;};}function removeEntity(_0x14b6c9,_0x20a9ba){return function(_0xef15b5){if(_0xef15b5){return _0xef15b5[_0x1d48('0x29')]()[_0x1d48('0x28')](function(){_0x14b6c9[_0x1d48('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e44eb,_0x137194){return function(_0x2c2b65){if(!_0x2c2b65){_0x4e44eb[_0x1d48('0x1a')](0x194);}return _0x2c2b65;};}function handleError(_0x2bf773,_0x228276){_0x228276=_0x228276||0x1f4;return function(_0x7631b4){logger['error'](_0x7631b4['stack']);if(_0x7631b4[_0x1d48('0x2a')]){delete _0x7631b4[_0x1d48('0x2a')];}_0x2bf773['status'](_0x228276)[_0x1d48('0x2b')](_0x7631b4);};}exports[_0x1d48('0x2c')]=function(_0xb4d9c7,_0xccc388){var _0x5a3ed5={},_0x4cac26={},_0x3b0b52={'count':0x0,'rows':[]};var _0x1ac161=_[_0x1d48('0x2d')](db[_0x1d48('0x2e')]['rawAttributes'],function(_0x405cca){return{'name':_0x405cca[_0x1d48('0x2f')],'type':_0x405cca[_0x1d48('0x30')][_0x1d48('0x31')]};});_0x4cac26[_0x1d48('0x32')]=_['map'](_0x1ac161,_0x1d48('0x2a'));_0x4cac26[_0x1d48('0x33')]=_[_0x1d48('0x34')](_0xb4d9c7['query']);_0x4cac26[_0x1d48('0x35')]=_['intersection'](_0x4cac26['model'],_0x4cac26[_0x1d48('0x33')]);_0x5a3ed5[_0x1d48('0x36')]=_[_0x1d48('0x37')](_0x4cac26['model'],qs[_0x1d48('0x38')](_0xb4d9c7[_0x1d48('0x33')]['fields']));_0x5a3ed5[_0x1d48('0x36')]=_0x5a3ed5[_0x1d48('0x36')][_0x1d48('0x39')]?_0x5a3ed5['attributes']:_0x4cac26[_0x1d48('0x32')];if(!_0xb4d9c7['query'][_0x1d48('0x3a')](_0x1d48('0x3b'))){_0x5a3ed5[_0x1d48('0x1f')]=qs['limit'](_0xb4d9c7['query'][_0x1d48('0x1f')]);_0x5a3ed5[_0x1d48('0x21')]=qs[_0x1d48('0x21')](_0xb4d9c7[_0x1d48('0x33')][_0x1d48('0x21')]);}_0x5a3ed5[_0x1d48('0x3c')]=qs[_0x1d48('0x3d')](_0xb4d9c7[_0x1d48('0x33')][_0x1d48('0x3d')]);_0x5a3ed5[_0x1d48('0x3e')]=qs[_0x1d48('0x35')](_[_0x1d48('0x3f')](_0xb4d9c7[_0x1d48('0x33')],_0x4cac26[_0x1d48('0x35')]),_0x1ac161);if(_0xb4d9c7[_0x1d48('0x33')][_0x1d48('0x40')]){_0x5a3ed5[_0x1d48('0x3e')]=_[_0x1d48('0x41')](_0x5a3ed5[_0x1d48('0x3e')],{'$or':_[_0x1d48('0x2d')](_0x1ac161,function(_0x7785cf){if(_0x7785cf[_0x1d48('0x30')]!==_0x1d48('0x42')){var _0x78ca07={};_0x78ca07[_0x7785cf[_0x1d48('0x2a')]]={'$like':'%'+_0xb4d9c7[_0x1d48('0x33')][_0x1d48('0x40')]+'%'};return _0x78ca07;}})});}_0x5a3ed5=_[_0x1d48('0x41')]({},_0x5a3ed5,_0xb4d9c7['options']);var _0x29f95f={'where':_0x5a3ed5['where']};return db[_0x1d48('0x2e')][_0x1d48('0x20')](_0x29f95f)['then'](function(_0x20c089){_0x3b0b52[_0x1d48('0x20')]=_0x20c089;if(_0xb4d9c7[_0x1d48('0x33')][_0x1d48('0x43')]){_0x5a3ed5[_0x1d48('0x44')]=[{'all':!![]}];}return db[_0x1d48('0x2e')]['findAll'](_0x5a3ed5);})['then'](function(_0x49beaf){_0x3b0b52[_0x1d48('0x45')]=_0x49beaf;return _0x3b0b52;})[_0x1d48('0x28')](respondWithFilteredResult(_0xccc388,_0x5a3ed5))['catch'](handleError(_0xccc388,null));};exports[_0x1d48('0x46')]=function(_0x4310e0,_0x5bf24a){var _0x28e32a={'raw':!![],'where':{'id':_0x4310e0[_0x1d48('0x47')]['id']}},_0x36db82={};_0x36db82['model']=_['keys'](db[_0x1d48('0x2e')][_0x1d48('0x48')]);_0x36db82[_0x1d48('0x33')]=_['keys'](_0x4310e0[_0x1d48('0x33')]);_0x36db82['filters']=_[_0x1d48('0x37')](_0x36db82[_0x1d48('0x32')],_0x36db82[_0x1d48('0x33')]);_0x28e32a[_0x1d48('0x36')]=_[_0x1d48('0x37')](_0x36db82[_0x1d48('0x32')],qs['fields'](_0x4310e0[_0x1d48('0x33')][_0x1d48('0x38')]));_0x28e32a[_0x1d48('0x36')]=_0x28e32a[_0x1d48('0x36')][_0x1d48('0x39')]?_0x28e32a[_0x1d48('0x36')]:_0x36db82[_0x1d48('0x32')];if(_0x4310e0[_0x1d48('0x33')][_0x1d48('0x43')]){_0x28e32a[_0x1d48('0x44')]=[{'all':!![]}];}_0x28e32a=_[_0x1d48('0x41')]({},_0x28e32a,_0x4310e0[_0x1d48('0x49')]);return db['WhatsappApplication'][_0x1d48('0x4a')](_0x28e32a)['then'](handleEntityNotFound(_0x5bf24a,null))[_0x1d48('0x28')](respondWithResult(_0x5bf24a,null))[_0x1d48('0x4b')](handleError(_0x5bf24a,null));};exports[_0x1d48('0x4c')]=function(_0x484e4d,_0x53f2aa){return db[_0x1d48('0x2e')][_0x1d48('0x4c')](_0x484e4d['body'],{})[_0x1d48('0x28')](respondWithResult(_0x53f2aa,0xc9))[_0x1d48('0x4b')](handleError(_0x53f2aa,null));};exports[_0x1d48('0x27')]=function(_0x16d84f,_0x15a6d7){if(_0x16d84f[_0x1d48('0x4d')]['id']){delete _0x16d84f['body']['id'];}return db[_0x1d48('0x2e')][_0x1d48('0x4a')]({'where':{'id':_0x16d84f[_0x1d48('0x47')]['id']}})['then'](handleEntityNotFound(_0x15a6d7,null))[_0x1d48('0x28')](saveUpdates(_0x16d84f[_0x1d48('0x4d')],null))[_0x1d48('0x28')](respondWithResult(_0x15a6d7,null))[_0x1d48('0x4b')](handleError(_0x15a6d7,null));};exports[_0x1d48('0x29')]=function(_0x3c0724,_0x3d3feb){return db['WhatsappApplication']['find']({'where':{'id':_0x3c0724[_0x1d48('0x47')]['id']}})[_0x1d48('0x28')](handleEntityNotFound(_0x3d3feb,null))[_0x1d48('0x28')](removeEntity(_0x3d3feb,null))['catch'](handleError(_0x3d3feb,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ddd8624..d00fa27 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 _0x423b=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication'];(function(_0x5aa74e,_0x10aba8){var _0x5630c1=function(_0x211bbc){while(--_0x211bbc){_0x5aa74e['push'](_0x5aa74e['shift']());}};_0x5630c1(++_0x10aba8);}(_0x423b,0x12b));var _0xb423=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x423b[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xb423('0x0'));var logger=require('../../config/logger')(_0xb423('0x1'));var moment=require('moment');var BPromise=require(_0xb423('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb423('0x3'));var attributes=require(_0xb423('0x4'));module['exports']=function(_0x1be92e,_0x3e6b18){return _0x1be92e[_0xb423('0x5')](_0xb423('0x6'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb423('0x7'),'collate':_0xb423('0x8')});}; \ No newline at end of file +var _0x9879=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x47888a,_0x7d2f3a){var _0x2b15a4=function(_0x12a3e9){while(--_0x12a3e9){_0x47888a['push'](_0x47888a['shift']());}};_0x2b15a4(++_0x7d2f3a);}(_0x9879,0x98));var _0x9987=function(_0x2e56fe,_0x12807a){_0x2e56fe=_0x2e56fe-0x0;var _0x346860=_0x9879[_0x2e56fe];return _0x346860;};'use strict';var _=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var logger=require(_0x9987('0x2'))('api');var moment=require(_0x9987('0x3'));var BPromise=require('bluebird');var rp=require(_0x9987('0x4'));var fs=require('fs');var path=require(_0x9987('0x5'));var rimraf=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var attributes=require(_0x9987('0x8'));module[_0x9987('0x9')]=function(_0x4258df,_0x4d479d){return _0x4258df[_0x9987('0xa')]('WhatsappApplication',attributes,{'tableName':_0x9987('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9987('0xc'),'collate':_0x9987('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1c93c6a..0574ba9 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 _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x1f418e,_0x431877){var _0x4795fb=function(_0x39df23){while(--_0x39df23){_0x1f418e['push'](_0x1f418e['shift']());}};_0x4795fb(++_0x431877);}(_0x24ca,0x1bc));var _0xa24c=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x24ca[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3ae8d5,_0x9f39e5){var _0x447214=function(_0x3a51fa){while(--_0x3a51fa){_0x3ae8d5['push'](_0x3ae8d5['shift']());}};_0x447214(++_0x9f39e5);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2735a1,_0x3d0af0){_0x2735a1=_0x2735a1-0x0;var _0x580014=_0x4c4e[_0x2735a1];return _0x580014;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index d2764e1..0036b76 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 _0xafb9=['update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','tracked','whatsappinteraction:update'];(function(_0x515bf9,_0x4bd9a2){var _0x1ec4bb=function(_0x271b32){while(--_0x271b32){_0x515bf9['push'](_0x515bf9['shift']());}};_0x1ec4bb(++_0x4bd9a2);}(_0xafb9,0x68));var _0x9afb=function(_0x5834d0,_0x477dc5){_0x5834d0=_0x5834d0-0x0;var _0x39f5b2=_0xafb9[_0x5834d0];return _0x39f5b2;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0x9')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller['getMessages']);router['get'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);router[_0x9afb('0x11')]('/',auth[_0x9afb('0xb')](),controller[_0x9afb('0x12')]);router[_0x9afb('0x11')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x13')]);router['post'](_0x9afb('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x9afb('0x15'),_0x9afb('0x16')),controller[_0x9afb('0x17')]);router[_0x9afb('0x18')](_0x9afb('0x19'),auth[_0x9afb('0xb')](),interaction[_0x9afb('0x1a')]('whatsapp',_0x9afb('0x1b')),controller[_0x9afb('0x1c')]);router[_0x9afb('0x1d')](_0x9afb('0x19'),auth[_0x9afb('0xb')](),interaction['tracked'](_0x9afb('0x15'),'whatsappinteraction:destroy'),controller[_0x9afb('0x1e')]);router[_0x9afb('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9afb('0x1f')]);module[_0x9afb('0x20')]=router; \ No newline at end of file +var _0x7c09=['whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x7c09,0x102));var _0x97c0=function(_0x522ca1,_0x1612a4){_0x522ca1=_0x522ca1-0x0;var _0x2676c3=_0x7c09[_0x522ca1];return _0x2676c3;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id',auth[_0x97c0('0xb')](),controller['show']);router[_0x97c0('0x9')](_0x97c0('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x97c0('0x9')](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0x11')]);router[_0x97c0('0x10')](_0x97c0('0xd'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x12')]);router[_0x97c0('0x10')](_0x97c0('0x13'),auth['isAuthenticated'](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x16')),controller['addTags']);router[_0x97c0('0x17')](_0x97c0('0x18'),auth[_0x97c0('0xb')](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x19')),controller['update']);router[_0x97c0('0x1a')](_0x97c0('0x18'),auth['isAuthenticated'](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x1b')),controller[_0x97c0('0x1c')]);router[_0x97c0('0x1a')](_0x97c0('0x13'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x1d')]);module[_0x97c0('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 5ac2c19..4339015 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 _0x0619=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x51de21,_0x2143bb){var _0x11e461=function(_0x1b17e8){while(--_0x1b17e8){_0x51de21['push'](_0x51de21['shift']());}};_0x11e461(++_0x2143bb);}(_0x0619,0x90));var _0x9061=function(_0x402080,_0x1597bd){_0x402080=_0x402080-0x0;var _0x21ee6e=_0x0619[_0x402080];return _0x21ee6e;};'use strict';var Sequelize=require(_0x9061('0x0'));var moment=require(_0x9061('0x1'));module[_0x9061('0x2')]={'closed':{'type':Sequelize[_0x9061('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9061('0x4')]},'secondDisposition':{'type':Sequelize[_0x9061('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9061('0x4')]},'note':{'type':Sequelize[_0x9061('0x4')]},'phone':{'type':Sequelize[_0x9061('0x4')]},'read1stAt':{'type':Sequelize[_0x9061('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x9061('0x6')]('in',_0x9061('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9061('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x9061('0x6')]('in',_0x9061('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3edc=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x3edc[_0x45313f];return _0x402910;};'use strict';var Sequelize=require(_0xc3ed('0x0'));var moment=require(_0xc3ed('0x1'));module[_0xc3ed('0x2')]={'closed':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc3ed('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc3ed('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc3ed('0x5')]},'phone':{'type':Sequelize[_0xc3ed('0x5')]},'read1stAt':{'type':Sequelize[_0xc3ed('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc3ed('0x6')]('in',_0xc3ed('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc3ed('0x6')]('in',_0xc3ed('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc3ed('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a6ce2ff..614db7f 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 _0xad36=['describe','addMessage','WhatsappMessage','ids','getMessages','format','findAll','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','Contact','Attachment','Messages','direction','secret','WhatsappAccount','Account','get','Whatsapp','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','basename','existsSync','createReadStream','out','System','firstName','lastName','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','status','end','offset','undefined','limit','count','set','json','apply','reject','destroy','then','error','name','send','Users','fullname','Tags','split','forEach','push','TagIds','catch','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','WhatsappAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','merge','fields','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','includeAll','include','options','create','body','update'];(function(_0x4da9e8,_0x3ae811){var _0x440d41=function(_0x490f87){while(--_0x490f87){_0x4da9e8['push'](_0x4da9e8['shift']());}};_0x440d41(++_0x3ae811);}(_0xad36,0x11c));var _0x6ad3=function(_0x19914b,_0x10b590){_0x19914b=_0x19914b-0x0;var _0x1c4dae=_0xad36[_0x19914b];return _0x1c4dae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ad3('0x0'));var zipdir=require(_0x6ad3('0x1'));var jsonpatch=require(_0x6ad3('0x2'));var rp=require(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require(_0x6ad3('0x5'));var Mustache=require(_0x6ad3('0x6'));var util=require(_0x6ad3('0x7'));var path=require(_0x6ad3('0x8'));var sox=require('sox');var csv=require(_0x6ad3('0x9'));var ejs=require(_0x6ad3('0xa'));var fs=require('fs');var fs_extra=require(_0x6ad3('0xb'));var _=require(_0x6ad3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ad3('0x9'));var querystring=require(_0x6ad3('0xd'));var Papa=require(_0x6ad3('0xe'));var Redis=require(_0x6ad3('0xf'));var authService=require(_0x6ad3('0x10'));var qs=require(_0x6ad3('0x11'));var as=require(_0x6ad3('0x12'));var pdf=require(_0x6ad3('0x13'));var hardwareService=require(_0x6ad3('0x14'));var logger=require('../../config/logger')(_0x6ad3('0x15'));var utils=require(_0x6ad3('0x16'));var config=require(_0x6ad3('0x17'));var licenseUtil=require(_0x6ad3('0x18'));var db=require(_0x6ad3('0x19'))['db'];config[_0x6ad3('0x1a')]=_[_0x6ad3('0x1b')](config[_0x6ad3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ad3('0x1c'))(new Redis(config['redis']));require(_0x6ad3('0x1d'))[_0x6ad3('0x1e')](socket);function respondWithStatusCode(_0x2d6623,_0x66e82e){_0x66e82e=_0x66e82e||0xcc;return function(_0x2e1ba0){if(_0x2e1ba0){return _0x2d6623['sendStatus'](_0x66e82e);}return _0x2d6623[_0x6ad3('0x1f')](_0x66e82e)[_0x6ad3('0x20')]();};}function respondWithResult(_0xf81b3,_0x4c52c2){_0x4c52c2=_0x4c52c2||0xc8;return function(_0x5479b8){if(_0x5479b8){return _0xf81b3['status'](_0x4c52c2)['json'](_0x5479b8);}};}function respondWithFilteredResult(_0x2c6f96,_0x4d031b){return function(_0x358243){if(_0x358243){var _0x52d10c=typeof _0x4d031b[_0x6ad3('0x21')]===_0x6ad3('0x22')&&typeof _0x4d031b[_0x6ad3('0x23')]===_0x6ad3('0x22');var _0x5b20b1=_0x358243['count'];var _0x295184=_0x52d10c?0x0:_0x4d031b[_0x6ad3('0x21')];var _0x1fad6e=_0x52d10c?_0x358243[_0x6ad3('0x24')]:_0x4d031b[_0x6ad3('0x21')]+_0x4d031b[_0x6ad3('0x23')];var _0x19ff5e;if(_0x1fad6e>=_0x5b20b1){_0x1fad6e=_0x5b20b1;_0x19ff5e=0xc8;}else{_0x19ff5e=0xce;}_0x2c6f96[_0x6ad3('0x1f')](_0x19ff5e);return _0x2c6f96[_0x6ad3('0x25')]('Content-Range',_0x295184+'-'+_0x1fad6e+'/'+_0x5b20b1)[_0x6ad3('0x26')](_0x358243);}return null;};}function patchUpdates(_0x261053){return function(_0x449030){try{jsonpatch[_0x6ad3('0x27')](_0x449030,_0x261053,!![]);}catch(_0x220887){return BPromise[_0x6ad3('0x28')](_0x220887);}return _0x449030['save']();};}function saveUpdates(_0x1942d4,_0x1e224f){return function(_0x65a104){if(_0x65a104){return _0x65a104['update'](_0x1942d4)['then'](function(_0xec24c5){return _0xec24c5;});}return null;};}function removeEntity(_0x13bff5,_0x508bb1){return function(_0x5523d1){if(_0x5523d1){return _0x5523d1[_0x6ad3('0x29')]()[_0x6ad3('0x2a')](function(){_0x13bff5[_0x6ad3('0x1f')](0xcc)[_0x6ad3('0x20')]();});}};}function handleEntityNotFound(_0x467512,_0x3a8774){return function(_0x4f692d){if(!_0x4f692d){_0x467512['sendStatus'](0x194);}return _0x4f692d;};}function handleError(_0x3df91f,_0x3e8d2a){_0x3e8d2a=_0x3e8d2a||0x1f4;return function(_0x3f1351){logger[_0x6ad3('0x2b')](_0x3f1351['stack']);if(_0x3f1351[_0x6ad3('0x2c')]){delete _0x3f1351[_0x6ad3('0x2c')];}_0x3df91f[_0x6ad3('0x1f')](_0x3e8d2a)[_0x6ad3('0x2d')](_0x3f1351);};}function getInteractionUsers(_0x18d3e6,_0x1602df){return new BPromise(function(_0x3bd305,_0x214765){try{if(_0x1602df[_0x18d3e6['id']]){_0x18d3e6[_0x6ad3('0x2e')]=_['map'](_0x1602df[_0x18d3e6['id']],function(_0x3d770d){return{'id':_0x3d770d['id'],'fullname':_0x3d770d[_0x6ad3('0x2f')]};});}}catch(_0x4fe3e9){_0x214765(_0x4fe3e9);}_0x3bd305(_0x18d3e6);});}function getInteractionTags(_0x298476,_0x1ca730){return new BPromise(function(_0x2588af,_0x623012){try{if(_0x298476['TagIds']){_0x298476[_0x6ad3('0x30')]=[];_0x298476['TagIds'][_0x6ad3('0x31')](',')[_0x6ad3('0x32')](function(_0x80163){_0x298476[_0x6ad3('0x30')][_0x6ad3('0x33')](_0x1ca730[_0x80163]);});}delete _0x298476[_0x6ad3('0x34')];}catch(_0x4e12ef){_0x623012(_0x4e12ef);}_0x2588af(_0x298476);});}function updateWhatsappInteraction(_0x20fd6b,_0x335e88,_0x11c4a8){return new BPromise(function(_0x12767b,_0x2d650e){return getInteractionUsers(_0x20fd6b,_0x11c4a8)['then'](function(_0x3950e7){return getInteractionTags(_0x3950e7,_0x335e88);})['then'](function(_0x19b4cb){_0x12767b(_0x19b4cb);})[_0x6ad3('0x35')](function(_0x268f9a){_0x2d650e(_0x268f9a);});});}exports[_0x6ad3('0x36')]=function(_0x33e095,_0x21c194){var _0x1d79ce={},_0x1c3f74={},_0x23617f={'count':0x0,'rows':[]};var _0x49ef39=_[_0x6ad3('0x37')](db[_0x6ad3('0x38')][_0x6ad3('0x39')],function(_0x2264e9){return{'name':_0x2264e9[_0x6ad3('0x3a')],'type':_0x2264e9[_0x6ad3('0x3b')][_0x6ad3('0x3c')]};});_0x1c3f74['model']=_['map'](_0x49ef39,_0x6ad3('0x2c'));_0x1c3f74[_0x6ad3('0x3d')]=_[_0x6ad3('0x3e')](_0x33e095[_0x6ad3('0x3d')]);_0x1c3f74[_0x6ad3('0x3f')]=_[_0x6ad3('0x40')](_0x1c3f74[_0x6ad3('0x41')],_0x1c3f74['query']);_0x1d79ce[_0x6ad3('0x42')]=_[_0x6ad3('0x40')](_0x1c3f74[_0x6ad3('0x41')],qs['fields'](_0x33e095[_0x6ad3('0x3d')]['fields']));_0x1d79ce['attributes']=_0x1d79ce[_0x6ad3('0x42')]['length']?_0x1d79ce[_0x6ad3('0x42')]:_0x1c3f74[_0x6ad3('0x41')];if(!_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x43')](_0x6ad3('0x44'))){_0x1d79ce[_0x6ad3('0x23')]=qs[_0x6ad3('0x23')](_0x33e095['query'][_0x6ad3('0x23')]);_0x1d79ce[_0x6ad3('0x21')]=qs[_0x6ad3('0x21')](_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x21')]);}_0x1d79ce[_0x6ad3('0x45')]=qs[_0x6ad3('0x46')](_0x33e095['query'][_0x6ad3('0x46')]);_0x1d79ce[_0x6ad3('0x47')]=qs[_0x6ad3('0x3f')](_[_0x6ad3('0x48')](_0x33e095[_0x6ad3('0x3d')],_0x1c3f74[_0x6ad3('0x3f')]),_0x49ef39);var _0x38ef02=[];var _0x3618c4=squel[_0x6ad3('0x49')]()[_0x6ad3('0x4a')]('id')[_0x6ad3('0x4a')]('name')[_0x6ad3('0x4a')](_0x6ad3('0x4b'))[_0x6ad3('0x4c')](_0x6ad3('0x4d'));var _0x1c45f3=squel['select']()['field']('u.id')['field'](_0x6ad3('0x4e'))[_0x6ad3('0x4a')](_0x6ad3('0x4f'))[_0x6ad3('0x4c')](_0x6ad3('0x50'),'ui')[_0x6ad3('0x51')](_0x6ad3('0x52'),'u',_0x6ad3('0x53'));var _0x8ebb90=squel['select']()[_0x6ad3('0x4c')](_0x6ad3('0x54'),'i')['left_join']('cm_contacts','c',_0x6ad3('0x55'))[_0x6ad3('0x51')]('users','o',_0x6ad3('0x56'))[_0x6ad3('0x51')](_0x6ad3('0x57'),'a',_0x6ad3('0x58'))[_0x6ad3('0x51')]('whatsapp_messages','me',_0x6ad3('0x59'))['left_join'](_0x6ad3('0x5a'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x6ad3('0x51')](_0x6ad3('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x519d60=squel[_0x6ad3('0x5b')]();var _0x2820ad=[];var _0x263376=squel[_0x6ad3('0x5b')]();var _0x253a96;if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x5c')]){_0x253a96=as[_0x6ad3('0x5d')](_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x5c')]);var _0x38b373=_0x253a96[_0x6ad3('0x5e')];for(var _0x4930ba=0x0;_0x4930ba<_0x253a96[_0x6ad3('0x5f')][_0x6ad3('0x60')];_0x4930ba++){var _0x5b9889=_0x253a96['conditions'][_0x4930ba];var _0x2f71e4='i';var _0x24c857=_[_0x6ad3('0x61')](_0x49ef39,[_0x6ad3('0x2c'),_0x5b9889['field']]);if(!_0x24c857){switch(_0x5b9889[_0x6ad3('0x4a')]){case _0x6ad3('0x62'):if(_0x5b9889[_0x6ad3('0x63')]==0x1){_0x8ebb90[_0x6ad3('0x64')]('`'+_0x5b9889['field']+'`\x20=\x200');}else{_0x8ebb90[_0x6ad3('0x64')]('`'+_0x5b9889[_0x6ad3('0x4a')]+_0x6ad3('0x65'));}break;case'Contact':if(_0x5b9889[_0x6ad3('0x66')]===_0x6ad3('0x67')){if(_0x5b9889['value'][_0x6ad3('0x31')]('\x20')[_0x6ad3('0x60')]>0x1){_0x519d60[_0x38b373](_0x6ad3('0x68'),qs[_0x6ad3('0x69')](_0x5b9889[_0x6ad3('0x63')]),null);}else{var _0x1979fd='%'+_0x5b9889[_0x6ad3('0x63')]+'%';_0x519d60[_0x38b373]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1979fd,_0x1979fd,_0x1979fd);}}else{_0x24c857=_['find'](_0x49ef39,['name',_0x6ad3('0x6a')]);_0x5b9889['field']=_0x6ad3('0x6a');_0x237485=as[_0x6ad3('0x6b')](_0x2f71e4,_0x24c857[_0x6ad3('0x3b')],_0x5b9889);_0x519d60[_0x38b373](_0x237485[_0x6ad3('0x6c')],_0x237485[_0x6ad3('0x63')][_0x6ad3('0x6d')],_0x237485['value']['end']);}break;case _0x6ad3('0x6e'):var _0x48416a=_0x5b9889[_0x6ad3('0x63')][_0x6ad3('0x31')](',')[_0x6ad3('0x37')](function(_0x25d028){return Number(_0x25d028);});_0x48416a[_0x6ad3('0x32')](function(_0x1a72b9){_0x263376['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1a72b9+',%');});_0x2820ad=_['union'](_0x2820ad,_0x48416a);break;case _0x6ad3('0x6f'):if(_0x5b9889[_0x6ad3('0x66')]==='$substring'){_0x519d60[_0x38b373](_0x6ad3('0x70'),'%'+_0x5b9889[_0x6ad3('0x63')]+'%',null);}else{_0x24c857=_[_0x6ad3('0x61')](_0x49ef39,['name','UserId']);_0x5b9889[_0x6ad3('0x4a')]='UserId';_0x237485=as[_0x6ad3('0x6b')](_0x2f71e4,_0x24c857[_0x6ad3('0x3b')],_0x5b9889);_0x519d60[_0x38b373](_0x237485[_0x6ad3('0x6c')],_0x237485[_0x6ad3('0x63')]['start'],_0x237485[_0x6ad3('0x63')][_0x6ad3('0x20')]);}break;case'body':_0x237485=as[_0x6ad3('0x6b')]('me',null,_0x5b9889);_0x519d60[_0x38b373](_0x237485[_0x6ad3('0x6c')],_0x237485[_0x6ad3('0x63')][_0x6ad3('0x6d')],_0x237485[_0x6ad3('0x63')]['end']);break;}}else{var _0x237485=as['buildExpression'](_0x2f71e4,_0x24c857[_0x6ad3('0x3b')],_0x5b9889);_0x519d60[_0x38b373](_0x237485[_0x6ad3('0x6c')],_0x237485[_0x6ad3('0x63')][_0x6ad3('0x6d')],_0x237485[_0x6ad3('0x63')][_0x6ad3('0x20')]);}}}else{var _0x577562=_(_0x33e095['query'])['keys']()['map'](function(_0x24812d){return _[_0x6ad3('0x71')](_0x49ef39,[_0x6ad3('0x2c'),_0x24812d])?_0x24812d:undefined;})[_0x6ad3('0x72')]()['value']();if(!_[_0x6ad3('0x73')](_0x577562)){_0x577562['forEach'](function(_0x3f9a3a){if(_0x3f9a3a===_0x6ad3('0x74')){_0x8ebb90[_0x6ad3('0x47')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x33e095[_0x6ad3('0x3d')][_0x3f9a3a]));}else if(_0x3f9a3a===_0x6ad3('0x75')){var _0x2ed539=JSON[_0x6ad3('0x76')](_0x33e095['query'][_0x3f9a3a])[_0x6ad3('0x77')];var _0x420080=JSON[_0x6ad3('0x76')](_0x33e095[_0x6ad3('0x3d')][_0x3f9a3a])[_0x6ad3('0x78')];_0x8ebb90[_0x6ad3('0x47')](_0x6ad3('0x79'),_0x2ed539,_0x420080);}else{if(_0x33e095['query'][_0x3f9a3a]===_0x6ad3('0x7a')){_0x8ebb90[_0x6ad3('0x47')]('i.'+_0x3f9a3a+'\x20IS\x20NULL');}else{_0x8ebb90[_0x6ad3('0x47')]('i.'+_0x3f9a3a+_0x6ad3('0x7b'),_0x33e095[_0x6ad3('0x3d')][_0x3f9a3a]);}}});}if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x7c')]){if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x7c')]==0x1){_0x8ebb90['having'](_0x6ad3('0x7d'));}else{_0x8ebb90['having'](_0x6ad3('0x7e'));}}if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x7f')]){_0x2820ad=_[_0x6ad3('0x80')](_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x7f')])?_0x33e095[_0x6ad3('0x3d')]['tag']:new Array(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x7f')]);_0x2820ad[_0x6ad3('0x32')](function(_0x468df1){_0x263376['or'](_0x6ad3('0x81'),'%,'+_0x468df1+',%');});}if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x82')]){var _0x108e61=_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x82')]['replace']('\x5c','\x5c\x5c')[_0x6ad3('0x83')](/'/g,'\x27\x27');if(qs[_0x6ad3('0x84')](_0x108e61)){_0x519d60['or'](_0x6ad3('0x85'),_0x108e61+'%')['or'](_0x6ad3('0x86'),_0x108e61+'%');}else{_0x519d60['or'](_0x6ad3('0x87'),qs[_0x6ad3('0x69')](_0x108e61))['or'](_0x6ad3('0x88'),_0x108e61+'%');}}}_0x8ebb90[_0x6ad3('0x47')](_0x519d60);_0x8ebb90[_0x6ad3('0x89')]('i.id');var _0x262fd5={'type':db[_0x6ad3('0x8a')][_0x6ad3('0x8b')][_0x6ad3('0x8c')],'raw':!![]};var _0x49e366=_0x8ebb90[_0x6ad3('0x8d')]();_0x49e366[_0x6ad3('0x4a')](_0x6ad3('0x8e'));_0x49e366['field'](_0x6ad3('0x8f'),_0x6ad3('0x62'));if(_0x1d79ce[_0x6ad3('0x45')]){_0x1d79ce[_0x6ad3('0x45')][_0x6ad3('0x32')](function(_0x4920cc){var _0x14a366=_0x4920cc[0x0]===_0x6ad3('0x90')?_0x4920cc[0x0]:'i.'+_0x4920cc[0x0];_0x8ebb90[_0x6ad3('0x45')](_0x14a366,_0x4920cc[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2820ad)){_0x8ebb90[_0x6ad3('0x64')](_0x263376);_0x49e366['where'](_0x6ad3('0x91'),_0x2820ad);}BPromise[_0x6ad3('0x92')]()[_0x6ad3('0x2a')](function(){if(!_0x253a96){if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x74')])return;_0x49e366[_0x6ad3('0x47')](_0x6ad3('0x93'));_0x8ebb90[_0x6ad3('0x47')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x33e095[_0x6ad3('0x94')][_0x6ad3('0x95')]!==_0x6ad3('0x96'))return;return _0x33e095[_0x6ad3('0x94')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x6ad3('0x2a')](function(_0x4570ae){if(_[_0x6ad3('0x73')](_0x4570ae)){_0x49e366[_0x6ad3('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');_0x8ebb90[_0x6ad3('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x49e366[_0x6ad3('0x47')](_0x6ad3('0x97'),_[_0x6ad3('0x37')](_0x4570ae,'id'));_0x8ebb90[_0x6ad3('0x47')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x4570ae,'id'));}});})[_0x6ad3('0x2a')](function(){if(_0x33e095[_0x6ad3('0x94')][_0x6ad3('0x95')]===_0x6ad3('0x96')&&!_0x253a96&&!_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x74')])return[];return db[_0x6ad3('0x98')]['query'](_0x49e366['toString'](),_0x262fd5);})[_0x6ad3('0x2a')](function(_0x26f0f8){_0x23617f[_0x6ad3('0x24')]=_0x26f0f8[_0x6ad3('0x60')];if(_0x23617f[_0x6ad3('0x24')]===0x0)return[];return db[_0x6ad3('0x98')][_0x6ad3('0x3d')](_0x3618c4[_0x6ad3('0x99')](),_0x262fd5)[_0x6ad3('0x2a')](function(_0x5c62b0){_0x38ef02=_['keyBy'](_0x5c62b0,'id');_0x262fd5=_[_0x6ad3('0x9a')](_0x262fd5,{'model':db[_0x6ad3('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x33e095[_0x6ad3('0x3d')][_0x6ad3('0x9b')]){_0x1d79ce[_0x6ad3('0x42')]['forEach'](function(_0x2f9ae7){_0x8ebb90[_0x6ad3('0x4a')]('i.'+_0x2f9ae7);});}else{_0x8ebb90[_0x6ad3('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0x9c'),_0x6ad3('0x9d'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0x9e'),'Account.mandatoryDisposition');_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0x9f'),'contactName');_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xa0'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xa1'),_0x6ad3('0xa2'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xa3'),_0x6ad3('0xa4'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xa5'),'Contact.email');_0x8ebb90['field'](_0x6ad3('0xa6'),_0x6ad3('0xa7'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xa8'),_0x6ad3('0xa9'));_0x8ebb90[_0x6ad3('0x4a')]('c.fax',_0x6ad3('0xaa'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xab'),_0x6ad3('0xac'));_0x8ebb90['field'](_0x6ad3('0xad'),_0x6ad3('0xae'));_0x8ebb90[_0x6ad3('0x4a')](_0x6ad3('0xaf'),_0x6ad3('0x34'));}if(_0x1d79ce[_0x6ad3('0x23')])_0x8ebb90[_0x6ad3('0x23')](_0x1d79ce[_0x6ad3('0x23')]);if(_0x1d79ce[_0x6ad3('0x21')])_0x8ebb90[_0x6ad3('0x21')](_0x1d79ce[_0x6ad3('0x21')]);return db[_0x6ad3('0x98')][_0x6ad3('0x3d')](_0x8ebb90[_0x6ad3('0x99')](),_0x262fd5);})[_0x6ad3('0x2a')](function(_0x30cd3a){if(_0x30cd3a['length']>0x0)_0x1c45f3[_0x6ad3('0x47')](_0x6ad3('0xb0'),_['map'](_0x30cd3a,'id'));return db[_0x6ad3('0x98')][_0x6ad3('0x3d')](_0x1c45f3[_0x6ad3('0x99')](),_0x262fd5)[_0x6ad3('0x2a')](function(_0x533410){var _0x1981e0=_['groupBy'](_0x533410,_0x6ad3('0xb1'));var _0x5de808=[];_0x30cd3a[_0x6ad3('0x32')](function(_0x39e07e){_0x5de808['push'](updateWhatsappInteraction(_0x39e07e,_0x38ef02,_0x1981e0));});return BPromise[_0x6ad3('0xb2')](_0x5de808);});});})[_0x6ad3('0x2a')](function(_0x4207f2){_0x23617f[_0x6ad3('0xb3')]=_0x4207f2;return _0x23617f;})[_0x6ad3('0x2a')](respondWithFilteredResult(_0x21c194,_0x1d79ce))[_0x6ad3('0x35')](handleError(_0x21c194,null));};exports[_0x6ad3('0xb4')]=function(_0xfd2824,_0x4150d5){var _0xdad6bb={'raw':![],'where':{'id':_0xfd2824[_0x6ad3('0xb5')]['id']}},_0x580c0c={};_0x580c0c['model']=_[_0x6ad3('0x3e')](db[_0x6ad3('0x38')]['rawAttributes']);_0x580c0c[_0x6ad3('0x3d')]=_[_0x6ad3('0x3e')](_0xfd2824[_0x6ad3('0x3d')]);_0x580c0c['filters']=_[_0x6ad3('0x40')](_0x580c0c[_0x6ad3('0x41')],_0x580c0c[_0x6ad3('0x3d')]);_0xdad6bb[_0x6ad3('0x42')]=_[_0x6ad3('0x40')](_0x580c0c[_0x6ad3('0x41')],qs[_0x6ad3('0x9b')](_0xfd2824[_0x6ad3('0x3d')][_0x6ad3('0x9b')]));_0xdad6bb[_0x6ad3('0x42')]=_0xdad6bb[_0x6ad3('0x42')][_0x6ad3('0x60')]?_0xdad6bb[_0x6ad3('0x42')]:_0x580c0c[_0x6ad3('0x41')];if(_0xfd2824['query'][_0x6ad3('0xb6')]){_0xdad6bb[_0x6ad3('0xb7')]=[{'all':!![]}];}_0xdad6bb=_['merge']({},_0xdad6bb,_0xfd2824[_0x6ad3('0xb8')]);return db[_0x6ad3('0x38')]['find'](_0xdad6bb)['then'](handleEntityNotFound(_0x4150d5,null))[_0x6ad3('0x2a')](respondWithResult(_0x4150d5,null))[_0x6ad3('0x35')](handleError(_0x4150d5,null));};exports[_0x6ad3('0xb9')]=function(_0x3ceb2a,_0x29acc2){return db[_0x6ad3('0x38')][_0x6ad3('0xb9')](_0x3ceb2a[_0x6ad3('0xba')],{})['then'](respondWithResult(_0x29acc2,0xc9))[_0x6ad3('0x35')](handleError(_0x29acc2,null));};exports[_0x6ad3('0xbb')]=function(_0x3f67d1,_0x5667b9){if(_0x3f67d1['body']['id']){delete _0x3f67d1['body']['id'];}return db['WhatsappInteraction'][_0x6ad3('0x61')]({'where':{'id':_0x3f67d1[_0x6ad3('0xb5')]['id']}})[_0x6ad3('0x2a')](handleEntityNotFound(_0x5667b9,null))['then'](saveUpdates(_0x3f67d1[_0x6ad3('0xba')],null))[_0x6ad3('0x2a')](respondWithResult(_0x5667b9,null))[_0x6ad3('0x35')](handleError(_0x5667b9,null));};exports[_0x6ad3('0x29')]=function(_0xe2bf24,_0x2594c2){return db[_0x6ad3('0x38')][_0x6ad3('0x61')]({'where':{'id':_0xe2bf24[_0x6ad3('0xb5')]['id']}})[_0x6ad3('0x2a')](handleEntityNotFound(_0x2594c2,null))[_0x6ad3('0x2a')](removeEntity(_0x2594c2,null))[_0x6ad3('0x35')](handleError(_0x2594c2,null));};exports['describe']=function(_0x49caac,_0x59cada){return db[_0x6ad3('0x38')][_0x6ad3('0xbc')]()[_0x6ad3('0x2a')](respondWithResult(_0x59cada,null))[_0x6ad3('0x35')](handleError(_0x59cada,null));};exports[_0x6ad3('0xbd')]=function(_0xa5bbc7,_0x202872,_0x38bc80){return db[_0x6ad3('0xbe')][_0x6ad3('0x61')]({'where':{'id':_0xa5bbc7[_0x6ad3('0xb5')]['id']}})[_0x6ad3('0x2a')](handleEntityNotFound(_0x202872,null))[_0x6ad3('0x2a')](function(_0x299101){if(_0x299101){return _0x299101[_0x6ad3('0xbd')](_0xa5bbc7[_0x6ad3('0xba')][_0x6ad3('0xbf')],_['omit'](_0xa5bbc7[_0x6ad3('0xba')],[_0x6ad3('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x202872,null))['catch'](handleError(_0x202872,null));};exports[_0x6ad3('0xc0')]=function(_0x1f42f0,_0x40030f,_0x4950b7){var _0x53af21={'raw':![],'where':{}};var _0x14c1a1={};var _0x3fb53c={'count':0x0,'rows':[]};return db[_0x6ad3('0x38')]['findOne']({'where':{'id':_0x1f42f0[_0x6ad3('0xb5')]['id']}})['then'](handleEntityNotFound(_0x40030f,null))[_0x6ad3('0x2a')](function(_0x48d7da){if(_0x48d7da){_0x14c1a1['model']=_[_0x6ad3('0x3e')](db[_0x6ad3('0xbe')]['rawAttributes']);_0x14c1a1[_0x6ad3('0x3d')]=_[_0x6ad3('0x3e')](_0x1f42f0[_0x6ad3('0x3d')]);_0x14c1a1[_0x6ad3('0x3f')]=_[_0x6ad3('0x40')](_0x14c1a1[_0x6ad3('0x41')],_0x14c1a1[_0x6ad3('0x3d')]);_0x53af21[_0x6ad3('0x42')]=_[_0x6ad3('0x40')](_0x14c1a1[_0x6ad3('0x41')],qs[_0x6ad3('0x9b')](_0x1f42f0[_0x6ad3('0x3d')][_0x6ad3('0x9b')]));_0x53af21[_0x6ad3('0x42')]=_0x53af21[_0x6ad3('0x42')][_0x6ad3('0x60')]?_0x53af21[_0x6ad3('0x42')]:_0x14c1a1[_0x6ad3('0x41')];if(!_0x1f42f0[_0x6ad3('0x3d')][_0x6ad3('0x43')](_0x6ad3('0x44'))){_0x53af21[_0x6ad3('0x23')]=qs['limit'](_0x1f42f0[_0x6ad3('0x3d')][_0x6ad3('0x23')]);_0x53af21[_0x6ad3('0x21')]=qs[_0x6ad3('0x21')](_0x1f42f0[_0x6ad3('0x3d')][_0x6ad3('0x21')]);}_0x53af21[_0x6ad3('0x45')]=qs[_0x6ad3('0x46')](_0x1f42f0[_0x6ad3('0x3d')]['sort']);_0x53af21[_0x6ad3('0x47')]=qs[_0x6ad3('0x3f')](_['pick'](_0x1f42f0['query'],_0x14c1a1[_0x6ad3('0x3f')]));_0x53af21['where'][_0x6ad3('0xb1')]=_0x48d7da['id'];if(_0x1f42f0['query'][_0x6ad3('0x82')]){_0x53af21[_0x6ad3('0x47')]=_[_0x6ad3('0x9a')](_0x53af21[_0x6ad3('0x47')],{'$or':_[_0x6ad3('0x37')](_0x53af21[_0x6ad3('0x42')],function(_0x311e07){var _0x13001d={};_0x13001d[_0x311e07]={'$like':'%'+_0x1f42f0[_0x6ad3('0x3d')][_0x6ad3('0x82')]+'%'};return _0x13001d;})});}if(_0x1f42f0['query'][_0x6ad3('0x77')]){var _0x4ae0c1=_0x1f42f0[_0x6ad3('0x3d')]['$gte'][_0x6ad3('0x31')](',');var _0x377f81={};_0x377f81[_0x4ae0c1[0x0]]={'$gte':moment(_0x4ae0c1[0x1])[_0x6ad3('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53af21[_0x6ad3('0x47')]=_['merge'](_0x53af21[_0x6ad3('0x47')],_0x377f81);}_0x53af21=_[_0x6ad3('0x9a')]({},_0x53af21,_0x1f42f0[_0x6ad3('0xb8')]);return db['WhatsappMessage']['count']({'where':_0x53af21[_0x6ad3('0x47')]})['then'](function(_0x4791dc){_0x3fb53c[_0x6ad3('0x24')]=_0x4791dc;if(_0x1f42f0['query']['includeAll']){_0x53af21[_0x6ad3('0xb7')]=[{'all':!![]}];}return db[_0x6ad3('0xbe')][_0x6ad3('0xc2')](_0x53af21);})[_0x6ad3('0x2a')](function(_0x555c32){_0x3fb53c[_0x6ad3('0xb3')]=_0x555c32;return _0x3fb53c;});}})[_0x6ad3('0x2a')](respondWithFilteredResult(_0x40030f,_0x53af21))[_0x6ad3('0x35')](handleError(_0x40030f,null));};exports[_0x6ad3('0xc3')]=function(_0x269b40,_0xd5eaa0,_0x121e66){return db[_0x6ad3('0x38')][_0x6ad3('0x61')]({'where':{'id':_0x269b40[_0x6ad3('0xb5')]['id']}})[_0x6ad3('0x2a')](handleEntityNotFound(_0xd5eaa0,null))[_0x6ad3('0x2a')](function(_0x527fe9){if(_0x527fe9){return _0x527fe9[_0x6ad3('0xc4')](_0x269b40[_0x6ad3('0xba')]['ids'],_[_0x6ad3('0xc5')](_0x269b40[_0x6ad3('0xba')],[_0x6ad3('0xbf'),'id'])||{})[_0x6ad3('0xc6')](function(){return db[_0x6ad3('0x6e')][_0x6ad3('0xc2')]({'attributes':['id','name',_0x6ad3('0x4b')],'where':{'id':_0x269b40['body'][_0x6ad3('0xbf')]}});})[_0x6ad3('0x2a')](function(_0x3a6057){socket[_0x6ad3('0xc7')](_0x6ad3('0xc8'),{'id':Number(_0x269b40[_0x6ad3('0xb5')]['id']),'tags':_0x3a6057||[]});return{'id':Number(_0x269b40['params']['id']),'tags':_0x3a6057||[]};});}})[_0x6ad3('0x2a')](respondWithResult(_0xd5eaa0,null))[_0x6ad3('0x35')](handleError(_0xd5eaa0,null));};exports['removeTags']=function(_0x5a266e,_0x350156,_0x3946dc){return db[_0x6ad3('0x38')][_0x6ad3('0x61')]({'where':{'id':_0x5a266e[_0x6ad3('0xb5')]['id']}})['then'](handleEntityNotFound(_0x350156,null))[_0x6ad3('0x2a')](function(_0x105f20){if(_0x105f20){return _0x105f20[_0x6ad3('0xc9')](_0x5a266e['query']['ids']);}})[_0x6ad3('0x2a')](respondWithStatusCode(_0x350156,null))['catch'](handleError(_0x350156,null));};exports[_0x6ad3('0xca')]=function(_0x396ad6,_0x97ad83){var _0x393536=moment()[_0x6ad3('0xcb')]()[_0x6ad3('0x99')]();var _0x28c3e6=path[_0x6ad3('0xcc')](config[_0x6ad3('0xcd')],_0x6ad3('0xce'),_0x6ad3('0xcf'),_0x6ad3('0xd0'));var _0x16e3b6=path['join'](config[_0x6ad3('0xcd')],_0x6ad3('0xce'),'files',_0x6ad3('0xd1'));var _0x414c8b=path['join'](_0x28c3e6,_0x393536);var _0x50d625=util['format']('transcript-%d-%s.zip',_0x396ad6['params']['id'],_0x393536);var _0x4dc0b0=path[_0x6ad3('0xcc')](_0x28c3e6,_0x50d625);var _0x489c77=[];_0x489c77['push']({'model':db[_0x6ad3('0x6f')],'as':_0x6ad3('0x6f'),'attributes':['id',_0x6ad3('0x2f')],'raw':!![]});_0x489c77[_0x6ad3('0x33')]({'model':db['CmContact'],'as':_0x6ad3('0xd2'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x396ad6[_0x6ad3('0x3d')][_0x6ad3('0xd1')]){_0x489c77[_0x6ad3('0x33')]({'model':db[_0x6ad3('0xd3')],'as':_0x6ad3('0xd3'),'raw':!![]});}var _0x2ec8ea=[{'model':db[_0x6ad3('0xbe')],'as':_0x6ad3('0xd4'),'attributes':['id',_0x6ad3('0xba'),_0x6ad3('0x75'),_0x6ad3('0xd5'),_0x6ad3('0xd6'),_0x6ad3('0x7c')],'include':_0x489c77}];_0x2ec8ea[_0x6ad3('0x33')]({'model':db[_0x6ad3('0xd7')],'as':_0x6ad3('0xd8'),'attributes':['id',_0x6ad3('0x2c')]});_0x2ec8ea[_0x6ad3('0x33')]({'model':db[_0x6ad3('0x6f')],'as':'Owner','attributes':['id',_0x6ad3('0x2f')]});return db['WhatsappInteraction'][_0x6ad3('0x61')]({'where':{'id':_0x396ad6[_0x6ad3('0xb5')]['id']},'include':_0x2ec8ea})[_0x6ad3('0x2a')](handleEntityNotFound(_0x97ad83,null))[_0x6ad3('0x2a')](function(_0x15bc3a){if(_0x15bc3a){var _0x230a83=_0x15bc3a[_0x6ad3('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x414c8b);var _0x41720c={'channel':_0x6ad3('0xda'),'account':_0x230a83[_0x6ad3('0xd8')][_0x6ad3('0x2c')],'agent':_0x230a83[_0x6ad3('0xdb')]?_0x230a83[_0x6ad3('0xdb')][_0x6ad3('0x2f')]:_0x6ad3('0xdc'),'createdAt':moment(_0x230a83[_0x6ad3('0x75')])[_0x6ad3('0xc1')](_0x6ad3('0xdd'))[_0x6ad3('0x99')](),'closedAt':_0x230a83['closed']?moment(_0x230a83[_0x6ad3('0xde')])[_0x6ad3('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6ad3('0x99')]():'','disposition':_0x230a83['disposition'],'messages':_(_0x230a83[_0x6ad3('0xd4')])[_0x6ad3('0x82')]({'secret':![]})[_0x6ad3('0x37')](function(_0x2f2720){if(_0x2f2720[_0x6ad3('0xd3')]){var _0x193e0a=path[_0x6ad3('0xcc')](_0x16e3b6,_0x2f2720[_0x6ad3('0xd3')][_0x6ad3('0xdf')]);if(fs[_0x6ad3('0xe0')](_0x193e0a)){fs[_0x6ad3('0xe1')](_0x193e0a)['pipe'](fs['createWriteStream'](path[_0x6ad3('0xcc')](_0x414c8b,_0x2f2720[_0x6ad3('0xd3')][_0x6ad3('0xdf')])));}}return{'date':moment(_0x2f2720[_0x6ad3('0x75')])[_0x6ad3('0xc1')](_0x6ad3('0xdd'))[_0x6ad3('0x99')](),'sender':_0x2f2720['direction']===_0x6ad3('0xe2')?_0x2f2720[_0x6ad3('0x6f')]?_0x2f2720['User'][_0x6ad3('0x2f')]:_0x6ad3('0xe3'):_0x2f2720[_0x6ad3('0xd2')][_0x6ad3('0xe4')]+(_0x2f2720['Contact']['lastName']?'\x20'+_0x2f2720['Contact'][_0x6ad3('0xe5')]:''),'body':_0x2f2720['Attachment']?_0x2f2720[_0x6ad3('0xd3')][_0x6ad3('0xdf')]:_0x2f2720['body'],'direction':_0x2f2720['direction']===_0x6ad3('0xe2')?'A':'C','secret':_0x2f2720[_0x6ad3('0xd6')],'read':_0x2f2720[_0x6ad3('0x7c')],'attachment':_0x2f2720[_0x6ad3('0xd3')]};})[_0x6ad3('0x63')]()};return ejs['renderFile'](path[_0x6ad3('0xcc')](config[_0x6ad3('0xcd')],'server',_0x6ad3('0xe6'),_0x6ad3('0xe7')),{'interaction':_0x41720c})[_0x6ad3('0x2a')](function(_0x4bd359){var _0x28ab07=path[_0x6ad3('0xcc')](_0x414c8b,'transcript-'+_0x230a83['id']+'-'+_0x393536+'.pdf');var _0x589639={'path':_0x28ab07,'channel':_0x6ad3('0xda'),'interactionId':_0x230a83['id']};return pdf[_0x6ad3('0xe8')](_0x4bd359,_0x589639);})[_0x6ad3('0x2a')](function(){return new BPromise(function(_0x51ba16,_0xac7294){zipdir(_0x414c8b,{'saveTo':_0x4dc0b0},function(_0x4028a4,_0x185b55){if(_0x4028a4)return _0xac7294(_0x4028a4);return _0x51ba16(_0x185b55);});})['then'](function(){return new BPromise(function(_0x2efba4,_0x553773){rimraf(_0x414c8b,function(_0x150976){if(_0x150976)_0x553773(_0x150976);return _0x2efba4();});});})['then'](function(){return _0x97ad83[_0x6ad3('0xca')](_0x4dc0b0,_0x50d625,function(_0x129a5c){if(_0x129a5c){console['log'](_0x6ad3('0xe9'),_0x129a5c);}else{fs[_0x6ad3('0xea')](_0x4dc0b0);}});});});}else{return _0x97ad83[_0x6ad3('0xeb')](0xc8);}})['catch'](handleError(_0x97ad83,null));}; \ No newline at end of file +var _0x61a5=['downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','send','map','fullname','Tags','TagIds','split','forEach','push','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','body','buildExpression','compact','isEmpty','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','where','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','intersection','includeAll','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','User','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','closed','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','firstName','views'];(function(_0x340cb5,_0x27dc88){var _0x10b5ea=function(_0x9c9ca2){while(--_0x9c9ca2){_0x340cb5['push'](_0x340cb5['shift']());}};_0x10b5ea(++_0x27dc88);}(_0x61a5,0xf0));var _0x561a=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x61a5[_0x53c256];return _0x25feb6;};'use strict';var emlformat=require(_0x561a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x561a('0x1'));var jsonpatch=require(_0x561a('0x2'));var rp=require(_0x561a('0x3'));var moment=require(_0x561a('0x4'));var BPromise=require(_0x561a('0x5'));var Mustache=require('mustache');var util=require(_0x561a('0x6'));var path=require(_0x561a('0x7'));var sox=require('sox');var csv=require(_0x561a('0x8'));var ejs=require(_0x561a('0x9'));var fs=require('fs');var fs_extra=require(_0x561a('0xa'));var _=require(_0x561a('0xb'));var squel=require(_0x561a('0xc'));var crypto=require(_0x561a('0xd'));var jsforce=require(_0x561a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x561a('0x8'));var querystring=require('querystring');var Papa=require(_0x561a('0xf'));var Redis=require(_0x561a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x561a('0x11'));var as=require(_0x561a('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x561a('0x13'));var logger=require('../../config/logger')(_0x561a('0x14'));var utils=require(_0x561a('0x15'));var config=require(_0x561a('0x16'));var licenseUtil=require(_0x561a('0x17'));var db=require(_0x561a('0x18'))['db'];config[_0x561a('0x19')]=_[_0x561a('0x1a')](config[_0x561a('0x19')],{'host':_0x561a('0x1b'),'port':0x18eb});var socket=require(_0x561a('0x1c'))(new Redis(config[_0x561a('0x19')]));require(_0x561a('0x1d'))['register'](socket);function respondWithStatusCode(_0x4037a9,_0x64498a){_0x64498a=_0x64498a||0xcc;return function(_0x1ab5ae){if(_0x1ab5ae){return _0x4037a9[_0x561a('0x1e')](_0x64498a);}return _0x4037a9[_0x561a('0x1f')](_0x64498a)[_0x561a('0x20')]();};}function respondWithResult(_0x3d91be,_0x14f141){_0x14f141=_0x14f141||0xc8;return function(_0x2690d9){if(_0x2690d9){return _0x3d91be[_0x561a('0x1f')](_0x14f141)[_0x561a('0x21')](_0x2690d9);}};}function respondWithFilteredResult(_0x48df6a,_0x43c5aa){return function(_0x190057){if(_0x190057){var _0x533d95=typeof _0x43c5aa[_0x561a('0x22')]===_0x561a('0x23')&&typeof _0x43c5aa['limit']===_0x561a('0x23');var _0x567399=_0x190057['count'];var _0x3b0f12=_0x533d95?0x0:_0x43c5aa[_0x561a('0x22')];var _0x5ca8e9=_0x533d95?_0x190057[_0x561a('0x24')]:_0x43c5aa[_0x561a('0x22')]+_0x43c5aa[_0x561a('0x25')];var _0x3cf6c8;if(_0x5ca8e9>=_0x567399){_0x5ca8e9=_0x567399;_0x3cf6c8=0xc8;}else{_0x3cf6c8=0xce;}_0x48df6a[_0x561a('0x1f')](_0x3cf6c8);return _0x48df6a[_0x561a('0x26')]('Content-Range',_0x3b0f12+'-'+_0x5ca8e9+'/'+_0x567399)[_0x561a('0x21')](_0x190057);}return null;};}function patchUpdates(_0x4480d8){return function(_0x46ede7){try{jsonpatch['apply'](_0x46ede7,_0x4480d8,!![]);}catch(_0x58c32f){return BPromise[_0x561a('0x27')](_0x58c32f);}return _0x46ede7[_0x561a('0x28')]();};}function saveUpdates(_0x27afb3,_0x1bbb57){return function(_0x234771){if(_0x234771){return _0x234771[_0x561a('0x29')](_0x27afb3)[_0x561a('0x2a')](function(_0x326c1e){return _0x326c1e;});}return null;};}function removeEntity(_0x5bf2fa,_0x4c2752){return function(_0x27f42){if(_0x27f42){return _0x27f42[_0x561a('0x2b')]()[_0x561a('0x2a')](function(){_0x5bf2fa[_0x561a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186862,_0x3f0789){return function(_0x44c851){if(!_0x44c851){_0x186862[_0x561a('0x1e')](0x194);}return _0x44c851;};}function handleError(_0x3bdfa9,_0x47f93a){_0x47f93a=_0x47f93a||0x1f4;return function(_0x42053f){logger[_0x561a('0x2c')](_0x42053f['stack']);if(_0x42053f[_0x561a('0x2d')]){delete _0x42053f[_0x561a('0x2d')];}_0x3bdfa9['status'](_0x47f93a)[_0x561a('0x2e')](_0x42053f);};}function getInteractionUsers(_0x591737,_0x54a47a){return new BPromise(function(_0x3633d2,_0x3d3cc8){try{if(_0x54a47a[_0x591737['id']]){_0x591737['Users']=_[_0x561a('0x2f')](_0x54a47a[_0x591737['id']],function(_0x1bc44c){return{'id':_0x1bc44c['id'],'fullname':_0x1bc44c[_0x561a('0x30')]};});}}catch(_0x278c7e){_0x3d3cc8(_0x278c7e);}_0x3633d2(_0x591737);});}function getInteractionTags(_0x169243,_0xbb2ae8){return new BPromise(function(_0x33b2fc,_0x1e0cd5){try{if(_0x169243['TagIds']){_0x169243[_0x561a('0x31')]=[];_0x169243[_0x561a('0x32')][_0x561a('0x33')](',')[_0x561a('0x34')](function(_0xceddfc){_0x169243['Tags'][_0x561a('0x35')](_0xbb2ae8[_0xceddfc]);});}delete _0x169243[_0x561a('0x32')];}catch(_0x2d0063){_0x1e0cd5(_0x2d0063);}_0x33b2fc(_0x169243);});}function updateWhatsappInteraction(_0x3e87b0,_0x57809f,_0x9ea469){return new BPromise(function(_0x30521e,_0x2a7c6d){return getInteractionUsers(_0x3e87b0,_0x9ea469)['then'](function(_0x47df2c){return getInteractionTags(_0x47df2c,_0x57809f);})[_0x561a('0x2a')](function(_0x47a277){_0x30521e(_0x47a277);})['catch'](function(_0x4d2b3b){_0x2a7c6d(_0x4d2b3b);});});}exports[_0x561a('0x36')]=function(_0x2a2479,_0x448ad6){var _0x1637b2={},_0x42dc71={},_0x1e6417={'count':0x0,'rows':[]};var _0x520f8b=_['map'](db[_0x561a('0x37')][_0x561a('0x38')],function(_0x2e4770){return{'name':_0x2e4770[_0x561a('0x39')],'type':_0x2e4770[_0x561a('0x3a')][_0x561a('0x3b')]};});_0x42dc71[_0x561a('0x3c')]=_[_0x561a('0x2f')](_0x520f8b,'name');_0x42dc71[_0x561a('0x3d')]=_[_0x561a('0x3e')](_0x2a2479[_0x561a('0x3d')]);_0x42dc71[_0x561a('0x3f')]=_['intersection'](_0x42dc71[_0x561a('0x3c')],_0x42dc71[_0x561a('0x3d')]);_0x1637b2[_0x561a('0x40')]=_['intersection'](_0x42dc71[_0x561a('0x3c')],qs[_0x561a('0x41')](_0x2a2479[_0x561a('0x3d')][_0x561a('0x41')]));_0x1637b2[_0x561a('0x40')]=_0x1637b2[_0x561a('0x40')][_0x561a('0x42')]?_0x1637b2['attributes']:_0x42dc71[_0x561a('0x3c')];if(!_0x2a2479[_0x561a('0x3d')][_0x561a('0x43')](_0x561a('0x44'))){_0x1637b2[_0x561a('0x25')]=qs[_0x561a('0x25')](_0x2a2479['query'][_0x561a('0x25')]);_0x1637b2[_0x561a('0x22')]=qs[_0x561a('0x22')](_0x2a2479[_0x561a('0x3d')][_0x561a('0x22')]);}_0x1637b2[_0x561a('0x45')]=qs[_0x561a('0x46')](_0x2a2479[_0x561a('0x3d')][_0x561a('0x46')]);_0x1637b2['where']=qs[_0x561a('0x3f')](_[_0x561a('0x47')](_0x2a2479['query'],_0x42dc71[_0x561a('0x3f')]),_0x520f8b);var _0x4b8a16=[];var _0x141971=squel[_0x561a('0x48')]()[_0x561a('0x49')]('id')[_0x561a('0x49')](_0x561a('0x2d'))['field'](_0x561a('0x4a'))[_0x561a('0x4b')](_0x561a('0x4c'));var _0x15fc9e=squel[_0x561a('0x48')]()[_0x561a('0x49')]('u.id')['field'](_0x561a('0x4d'))['field']('ui.WhatsappInteractionId')['from']('user_has_whatsapp_interactions','ui')['left_join'](_0x561a('0x4e'),'u',_0x561a('0x4f'));var _0x21858b=squel['select']()[_0x561a('0x4b')]('whatsapp_interactions','i')['left_join'](_0x561a('0x50'),'c',_0x561a('0x51'))[_0x561a('0x52')]('users','o',_0x561a('0x53'))['left_join'](_0x561a('0x54'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x561a('0x52')](_0x561a('0x55'),'me',_0x561a('0x56'))[_0x561a('0x52')](_0x561a('0x57'),'it',_0x561a('0x58'))[_0x561a('0x52')](_0x561a('0x4c'),'t',_0x561a('0x59'));var _0x5124a7=squel[_0x561a('0x5a')]();var _0x2c4fbe=[];var _0x331d11=squel['expr']();var _0x14fe1b;if(_0x2a2479[_0x561a('0x3d')]['search']){_0x14fe1b=as[_0x561a('0x5b')](_0x2a2479[_0x561a('0x3d')][_0x561a('0x5c')]);var _0x535335=_0x14fe1b[_0x561a('0x5d')];for(var _0x2a050c=0x0;_0x2a050c<_0x14fe1b[_0x561a('0x5e')][_0x561a('0x42')];_0x2a050c++){var _0xf1fa19=_0x14fe1b[_0x561a('0x5e')][_0x2a050c];var _0x3d9b63='i';var _0x4ebb99=_[_0x561a('0x5f')](_0x520f8b,[_0x561a('0x2d'),_0xf1fa19[_0x561a('0x49')]]);if(!_0x4ebb99){switch(_0xf1fa19[_0x561a('0x49')]){case _0x561a('0x60'):if(_0xf1fa19[_0x561a('0x61')]==0x1){_0x21858b[_0x561a('0x62')]('`'+_0xf1fa19['field']+_0x561a('0x63'));}else{_0x21858b[_0x561a('0x62')]('`'+_0xf1fa19[_0x561a('0x49')]+'`\x20>\x200');}break;case _0x561a('0x64'):if(_0xf1fa19['operator']===_0x561a('0x65')){if(_0xf1fa19[_0x561a('0x61')][_0x561a('0x33')]('\x20')[_0x561a('0x42')]>0x1){_0x5124a7[_0x535335](_0x561a('0x66'),qs[_0x561a('0x67')](_0xf1fa19[_0x561a('0x61')]),null);}else{var _0x4cad70='%'+_0xf1fa19['value']+'%';_0x5124a7[_0x535335](_0x561a('0x68'),_0x4cad70,_0x4cad70,_0x4cad70);}}else{_0x4ebb99=_[_0x561a('0x5f')](_0x520f8b,[_0x561a('0x2d'),_0x561a('0x69')]);_0xf1fa19[_0x561a('0x49')]=_0x561a('0x69');_0x4a904c=as['buildExpression'](_0x3d9b63,_0x4ebb99[_0x561a('0x3a')],_0xf1fa19);_0x5124a7[_0x535335](_0x4a904c[_0x561a('0x6a')],_0x4a904c['value'][_0x561a('0x6b')],_0x4a904c['value'][_0x561a('0x20')]);}break;case _0x561a('0x6c'):var _0x16daeb=_0xf1fa19[_0x561a('0x61')][_0x561a('0x33')](',')['map'](function(_0x2106bc){return Number(_0x2106bc);});_0x16daeb['forEach'](function(_0x361f3b){_0x331d11['or'](_0x561a('0x6d'),'%,'+_0x361f3b+',%');});_0x2c4fbe=_[_0x561a('0x6e')](_0x2c4fbe,_0x16daeb);break;case'User':if(_0xf1fa19['operator']==='$substring'){_0x5124a7[_0x535335]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xf1fa19[_0x561a('0x61')]+'%',null);}else{_0x4ebb99=_[_0x561a('0x5f')](_0x520f8b,['name',_0x561a('0x6f')]);_0xf1fa19[_0x561a('0x49')]=_0x561a('0x6f');_0x4a904c=as['buildExpression'](_0x3d9b63,_0x4ebb99[_0x561a('0x3a')],_0xf1fa19);_0x5124a7[_0x535335](_0x4a904c[_0x561a('0x6a')],_0x4a904c[_0x561a('0x61')][_0x561a('0x6b')],_0x4a904c[_0x561a('0x61')][_0x561a('0x20')]);}break;case _0x561a('0x70'):_0x4a904c=as[_0x561a('0x71')]('me',null,_0xf1fa19);_0x5124a7[_0x535335](_0x4a904c[_0x561a('0x6a')],_0x4a904c[_0x561a('0x61')][_0x561a('0x6b')],_0x4a904c['value'][_0x561a('0x20')]);break;}}else{var _0x4a904c=as['buildExpression'](_0x3d9b63,_0x4ebb99['type'],_0xf1fa19);_0x5124a7[_0x535335](_0x4a904c[_0x561a('0x6a')],_0x4a904c[_0x561a('0x61')]['start'],_0x4a904c[_0x561a('0x61')][_0x561a('0x20')]);}}}else{var _0x174483=_(_0x2a2479[_0x561a('0x3d')])[_0x561a('0x3e')]()[_0x561a('0x2f')](function(_0x51219f){return _['some'](_0x520f8b,[_0x561a('0x2d'),_0x51219f])?_0x51219f:undefined;})[_0x561a('0x72')]()[_0x561a('0x61')]();if(!_[_0x561a('0x73')](_0x174483)){_0x174483[_0x561a('0x34')](function(_0x1656b){if(_0x1656b==='WhatsappAccountId'){_0x21858b['where']('i.WhatsappAccountId\x20IN\x20?',[][_0x561a('0x74')](_0x2a2479[_0x561a('0x3d')][_0x1656b]));}else if(_0x1656b===_0x561a('0x75')){var _0x57bffc=JSON['parse'](_0x2a2479['query'][_0x1656b])['$gte'];var _0x3ebb6d=JSON[_0x561a('0x76')](_0x2a2479['query'][_0x1656b])[_0x561a('0x77')];_0x21858b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x57bffc,_0x3ebb6d);}else{if(_0x2a2479[_0x561a('0x3d')][_0x1656b]===_0x561a('0x78')){_0x21858b['where']('i.'+_0x1656b+_0x561a('0x79'));}else{_0x21858b['where']('i.'+_0x1656b+_0x561a('0x7a'),_0x2a2479[_0x561a('0x3d')][_0x1656b]);}}});}if(_0x2a2479[_0x561a('0x3d')][_0x561a('0x7b')]){if(_0x2a2479[_0x561a('0x3d')][_0x561a('0x7b')]==0x1){_0x21858b[_0x561a('0x62')]('`unreadMessages`\x20=\x200');}else{_0x21858b['having'](_0x561a('0x7c'));}}if(_0x2a2479[_0x561a('0x3d')]['tag']){_0x2c4fbe=_[_0x561a('0x7d')](_0x2a2479[_0x561a('0x3d')]['tag'])?_0x2a2479[_0x561a('0x3d')][_0x561a('0x7e')]:new Array(_0x2a2479[_0x561a('0x3d')]['tag']);_0x2c4fbe[_0x561a('0x34')](function(_0x322017){_0x331d11['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x322017+',%');});}if(_0x2a2479[_0x561a('0x3d')]['filter']){var _0x5f0900=_0x2a2479[_0x561a('0x3d')][_0x561a('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x561a('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5f0900)){_0x5124a7['or'](_0x561a('0x81'),_0x5f0900+'%')['or']('i.phone\x20LIKE\x20?',_0x5f0900+'%');}else{_0x5124a7['or'](_0x561a('0x82'),qs[_0x561a('0x67')](_0x5f0900))['or'](_0x561a('0x83'),_0x5f0900+'%');}}}_0x21858b[_0x561a('0x84')](_0x5124a7);_0x21858b[_0x561a('0x85')](_0x561a('0x86'));var _0x4dcb3a={'type':db['Sequelize'][_0x561a('0x87')][_0x561a('0x88')],'raw':!![]};var _0x5153f0=_0x21858b[_0x561a('0x89')]();_0x5153f0[_0x561a('0x49')](_0x561a('0x86'));_0x5153f0[_0x561a('0x49')](_0x561a('0x8a'),_0x561a('0x60'));if(_0x1637b2[_0x561a('0x45')]){_0x1637b2[_0x561a('0x45')][_0x561a('0x34')](function(_0x45df37){var _0x10e72c=_0x45df37[0x0]===_0x561a('0x8b')?_0x45df37[0x0]:'i.'+_0x45df37[0x0];_0x21858b[_0x561a('0x45')](_0x10e72c,_0x45df37[0x1]==='DESC'?![]:!![]);});}if(!_[_0x561a('0x73')](_0x2c4fbe)){_0x21858b[_0x561a('0x62')](_0x331d11);_0x5153f0[_0x561a('0x84')]('t.id\x20IN\x20?',_0x2c4fbe);}BPromise[_0x561a('0x8c')]()[_0x561a('0x2a')](function(){if(!_0x14fe1b){if(_0x2a2479[_0x561a('0x3d')][_0x561a('0x8d')])return;_0x5153f0['where'](_0x561a('0x8e'));_0x21858b[_0x561a('0x84')](_0x561a('0x8e'));return;}if(_0x2a2479[_0x561a('0x8f')][_0x561a('0x90')]!==_0x561a('0x91'))return;return _0x2a2479[_0x561a('0x8f')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x19eafc){if(_[_0x561a('0x73')](_0x19eafc)){_0x5153f0['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x21858b['where'](_0x561a('0x92'));}else{_0x5153f0[_0x561a('0x84')](_0x561a('0x93'),_['map'](_0x19eafc,'id'));_0x21858b['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x561a('0x2f')](_0x19eafc,'id'));}});})[_0x561a('0x2a')](function(){if(_0x2a2479[_0x561a('0x8f')][_0x561a('0x90')]==='agent'&&!_0x14fe1b&&!_0x2a2479[_0x561a('0x3d')][_0x561a('0x8d')])return[];return db[_0x561a('0x94')][_0x561a('0x3d')](_0x5153f0[_0x561a('0x95')](),_0x4dcb3a);})['then'](function(_0x59a5d0){_0x1e6417[_0x561a('0x24')]=_0x59a5d0[_0x561a('0x42')];if(_0x1e6417[_0x561a('0x24')]===0x0)return[];return db[_0x561a('0x94')][_0x561a('0x3d')](_0x141971[_0x561a('0x95')](),_0x4dcb3a)['then'](function(_0x2d5d77){_0x4b8a16=_[_0x561a('0x96')](_0x2d5d77,'id');_0x4dcb3a=_[_0x561a('0x97')](_0x4dcb3a,{'model':db[_0x561a('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a2479[_0x561a('0x3d')]['fields']){_0x1637b2[_0x561a('0x40')][_0x561a('0x34')](function(_0x295166){_0x21858b[_0x561a('0x49')]('i.'+_0x295166);});}else{_0x21858b[_0x561a('0x49')](_0x561a('0x8a'),_0x561a('0x60'));_0x21858b[_0x561a('0x49')](_0x561a('0x98'),'Account.key');_0x21858b[_0x561a('0x49')](_0x561a('0x99'),_0x561a('0x9a'));_0x21858b[_0x561a('0x49')](_0x561a('0x9b'),_0x561a('0x8b'));_0x21858b[_0x561a('0x49')]('i.*');_0x21858b[_0x561a('0x49')](_0x561a('0x9c'),'Contact.firstName');_0x21858b[_0x561a('0x49')](_0x561a('0x9d'),_0x561a('0x9e'));_0x21858b[_0x561a('0x49')]('c.email',_0x561a('0x9f'));_0x21858b[_0x561a('0x49')](_0x561a('0xa0'),_0x561a('0xa1'));_0x21858b[_0x561a('0x49')](_0x561a('0xa2'),_0x561a('0xa3'));_0x21858b[_0x561a('0x49')]('c.fax','Contact.fax');_0x21858b[_0x561a('0x49')]('o.fullname',_0x561a('0xa4'));_0x21858b[_0x561a('0x49')](_0x561a('0xa5'),'Owner.internal');_0x21858b[_0x561a('0x49')](_0x561a('0xa6'),_0x561a('0x32'));}if(_0x1637b2[_0x561a('0x25')])_0x21858b['limit'](_0x1637b2[_0x561a('0x25')]);if(_0x1637b2[_0x561a('0x22')])_0x21858b['offset'](_0x1637b2['offset']);return db['sequelize']['query'](_0x21858b[_0x561a('0x95')](),_0x4dcb3a);})[_0x561a('0x2a')](function(_0x51e404){if(_0x51e404[_0x561a('0x42')]>0x0)_0x15fc9e[_0x561a('0x84')](_0x561a('0xa7'),_[_0x561a('0x2f')](_0x51e404,'id'));return db[_0x561a('0x94')][_0x561a('0x3d')](_0x15fc9e[_0x561a('0x95')](),_0x4dcb3a)[_0x561a('0x2a')](function(_0x1b8388){var _0x5f3f4c=_[_0x561a('0xa8')](_0x1b8388,_0x561a('0xa9'));var _0x507273=[];_0x51e404[_0x561a('0x34')](function(_0x23ebe6){_0x507273[_0x561a('0x35')](updateWhatsappInteraction(_0x23ebe6,_0x4b8a16,_0x5f3f4c));});return BPromise[_0x561a('0xaa')](_0x507273);});});})[_0x561a('0x2a')](function(_0x54756f){_0x1e6417[_0x561a('0xab')]=_0x54756f;return _0x1e6417;})[_0x561a('0x2a')](respondWithFilteredResult(_0x448ad6,_0x1637b2))[_0x561a('0xac')](handleError(_0x448ad6,null));};exports[_0x561a('0xad')]=function(_0x3098d8,_0x2be528){var _0x1251bf={'raw':![],'where':{'id':_0x3098d8[_0x561a('0xae')]['id']}},_0x565ed5={};_0x565ed5[_0x561a('0x3c')]=_[_0x561a('0x3e')](db['WhatsappInteraction']['rawAttributes']);_0x565ed5[_0x561a('0x3d')]=_['keys'](_0x3098d8[_0x561a('0x3d')]);_0x565ed5[_0x561a('0x3f')]=_[_0x561a('0xaf')](_0x565ed5[_0x561a('0x3c')],_0x565ed5['query']);_0x1251bf[_0x561a('0x40')]=_[_0x561a('0xaf')](_0x565ed5[_0x561a('0x3c')],qs[_0x561a('0x41')](_0x3098d8[_0x561a('0x3d')][_0x561a('0x41')]));_0x1251bf['attributes']=_0x1251bf[_0x561a('0x40')][_0x561a('0x42')]?_0x1251bf[_0x561a('0x40')]:_0x565ed5['model'];if(_0x3098d8[_0x561a('0x3d')][_0x561a('0xb0')]){_0x1251bf[_0x561a('0xb1')]=[{'all':!![]}];}_0x1251bf=_[_0x561a('0x97')]({},_0x1251bf,_0x3098d8[_0x561a('0xb2')]);return db[_0x561a('0x37')][_0x561a('0x5f')](_0x1251bf)[_0x561a('0x2a')](handleEntityNotFound(_0x2be528,null))['then'](respondWithResult(_0x2be528,null))['catch'](handleError(_0x2be528,null));};exports[_0x561a('0xb3')]=function(_0x40b270,_0x3cb45f){return db[_0x561a('0x37')][_0x561a('0xb3')](_0x40b270[_0x561a('0x70')],{})[_0x561a('0x2a')](respondWithResult(_0x3cb45f,0xc9))[_0x561a('0xac')](handleError(_0x3cb45f,null));};exports[_0x561a('0x29')]=function(_0xf3351c,_0x5517c0){if(_0xf3351c[_0x561a('0x70')]['id']){delete _0xf3351c[_0x561a('0x70')]['id'];}return db[_0x561a('0x37')][_0x561a('0x5f')]({'where':{'id':_0xf3351c[_0x561a('0xae')]['id']}})['then'](handleEntityNotFound(_0x5517c0,null))[_0x561a('0x2a')](saveUpdates(_0xf3351c[_0x561a('0x70')],null))[_0x561a('0x2a')](respondWithResult(_0x5517c0,null))[_0x561a('0xac')](handleError(_0x5517c0,null));};exports['destroy']=function(_0x1f807d,_0x4c1a68){return db['WhatsappInteraction']['find']({'where':{'id':_0x1f807d[_0x561a('0xae')]['id']}})[_0x561a('0x2a')](handleEntityNotFound(_0x4c1a68,null))[_0x561a('0x2a')](removeEntity(_0x4c1a68,null))[_0x561a('0xac')](handleError(_0x4c1a68,null));};exports[_0x561a('0xb4')]=function(_0x1990eb,_0x38b363){return db[_0x561a('0x37')][_0x561a('0xb4')]()[_0x561a('0x2a')](respondWithResult(_0x38b363,null))[_0x561a('0xac')](handleError(_0x38b363,null));};exports[_0x561a('0xb5')]=function(_0x45839e,_0x33172e,_0x432dd4){return db[_0x561a('0xb6')][_0x561a('0x5f')]({'where':{'id':_0x45839e[_0x561a('0xae')]['id']}})[_0x561a('0x2a')](handleEntityNotFound(_0x33172e,null))[_0x561a('0x2a')](function(_0x4ef20a){if(_0x4ef20a){return _0x4ef20a[_0x561a('0xb5')](_0x45839e[_0x561a('0x70')][_0x561a('0xb7')],_[_0x561a('0xb8')](_0x45839e[_0x561a('0x70')],[_0x561a('0xb7'),'id'])||{});}})[_0x561a('0x2a')](respondWithResult(_0x33172e,null))[_0x561a('0xac')](handleError(_0x33172e,null));};exports['getMessages']=function(_0x350b43,_0xc23457,_0x5079a8){var _0x1ffbd5={'raw':![],'where':{}};var _0x46ff06={};var _0x3845b1={'count':0x0,'rows':[]};return db[_0x561a('0x37')][_0x561a('0xb9')]({'where':{'id':_0x350b43[_0x561a('0xae')]['id']}})['then'](handleEntityNotFound(_0xc23457,null))[_0x561a('0x2a')](function(_0x20fc12){if(_0x20fc12){_0x46ff06[_0x561a('0x3c')]=_['keys'](db[_0x561a('0xb6')][_0x561a('0x38')]);_0x46ff06[_0x561a('0x3d')]=_[_0x561a('0x3e')](_0x350b43[_0x561a('0x3d')]);_0x46ff06[_0x561a('0x3f')]=_[_0x561a('0xaf')](_0x46ff06[_0x561a('0x3c')],_0x46ff06[_0x561a('0x3d')]);_0x1ffbd5[_0x561a('0x40')]=_[_0x561a('0xaf')](_0x46ff06[_0x561a('0x3c')],qs[_0x561a('0x41')](_0x350b43[_0x561a('0x3d')][_0x561a('0x41')]));_0x1ffbd5[_0x561a('0x40')]=_0x1ffbd5[_0x561a('0x40')][_0x561a('0x42')]?_0x1ffbd5[_0x561a('0x40')]:_0x46ff06[_0x561a('0x3c')];if(!_0x350b43[_0x561a('0x3d')][_0x561a('0x43')](_0x561a('0x44'))){_0x1ffbd5['limit']=qs[_0x561a('0x25')](_0x350b43[_0x561a('0x3d')][_0x561a('0x25')]);_0x1ffbd5[_0x561a('0x22')]=qs[_0x561a('0x22')](_0x350b43['query'][_0x561a('0x22')]);}_0x1ffbd5[_0x561a('0x45')]=qs[_0x561a('0x46')](_0x350b43[_0x561a('0x3d')]['sort']);_0x1ffbd5['where']=qs[_0x561a('0x3f')](_[_0x561a('0x47')](_0x350b43[_0x561a('0x3d')],_0x46ff06['filters']));_0x1ffbd5[_0x561a('0x84')]['WhatsappInteractionId']=_0x20fc12['id'];if(_0x350b43['query']['filter']){_0x1ffbd5[_0x561a('0x84')]=_['merge'](_0x1ffbd5['where'],{'$or':_['map'](_0x1ffbd5['attributes'],function(_0x3b765d){var _0x335b0e={};_0x335b0e[_0x3b765d]={'$like':'%'+_0x350b43[_0x561a('0x3d')][_0x561a('0x7f')]+'%'};return _0x335b0e;})});}if(_0x350b43[_0x561a('0x3d')][_0x561a('0xba')]){var _0x5f7644=_0x350b43['query'][_0x561a('0xba')]['split'](',');var _0xbc1f0d={};_0xbc1f0d[_0x5f7644[0x0]]={'$gte':moment(_0x5f7644[0x1])[_0x561a('0xbb')](_0x561a('0xbc'))};_0x1ffbd5[_0x561a('0x84')]=_[_0x561a('0x97')](_0x1ffbd5['where'],_0xbc1f0d);}_0x1ffbd5=_[_0x561a('0x97')]({},_0x1ffbd5,_0x350b43[_0x561a('0xb2')]);return db['WhatsappMessage'][_0x561a('0x24')]({'where':_0x1ffbd5[_0x561a('0x84')]})['then'](function(_0x544cd7){_0x3845b1['count']=_0x544cd7;if(_0x350b43[_0x561a('0x3d')][_0x561a('0xb0')]){_0x1ffbd5['include']=[{'all':!![]}];}return db[_0x561a('0xb6')][_0x561a('0xbd')](_0x1ffbd5);})[_0x561a('0x2a')](function(_0x3f32fa){_0x3845b1[_0x561a('0xab')]=_0x3f32fa;return _0x3845b1;});}})[_0x561a('0x2a')](respondWithFilteredResult(_0xc23457,_0x1ffbd5))[_0x561a('0xac')](handleError(_0xc23457,null));};exports[_0x561a('0xbe')]=function(_0x6be5bd,_0x411ae4,_0x2f9de7){return db[_0x561a('0x37')][_0x561a('0x5f')]({'where':{'id':_0x6be5bd[_0x561a('0xae')]['id']}})[_0x561a('0x2a')](handleEntityNotFound(_0x411ae4,null))[_0x561a('0x2a')](function(_0x228057){if(_0x228057){return _0x228057[_0x561a('0xbf')](_0x6be5bd[_0x561a('0x70')]['ids'],_[_0x561a('0xb8')](_0x6be5bd['body'],[_0x561a('0xb7'),'id'])||{})['spread'](function(){return db[_0x561a('0x6c')][_0x561a('0xbd')]({'attributes':['id','name',_0x561a('0x4a')],'where':{'id':_0x6be5bd[_0x561a('0x70')][_0x561a('0xb7')]}});})['then'](function(_0x41c849){socket[_0x561a('0xc0')](_0x561a('0xc1'),{'id':Number(_0x6be5bd[_0x561a('0xae')]['id']),'tags':_0x41c849||[]});return{'id':Number(_0x6be5bd['params']['id']),'tags':_0x41c849||[]};});}})['then'](respondWithResult(_0x411ae4,null))['catch'](handleError(_0x411ae4,null));};exports[_0x561a('0xc2')]=function(_0x478d3b,_0x3e12eb,_0x55789c){return db['WhatsappInteraction'][_0x561a('0x5f')]({'where':{'id':_0x478d3b[_0x561a('0xae')]['id']}})[_0x561a('0x2a')](handleEntityNotFound(_0x3e12eb,null))[_0x561a('0x2a')](function(_0x57b6c3){if(_0x57b6c3){return _0x57b6c3[_0x561a('0xc2')](_0x478d3b['query'][_0x561a('0xb7')]);}})[_0x561a('0x2a')](respondWithStatusCode(_0x3e12eb,null))[_0x561a('0xac')](handleError(_0x3e12eb,null));};exports[_0x561a('0xc3')]=function(_0x243950,_0x901c02){var _0x2c52ed=moment()['unix']()['toString']();var _0x2c62ff=path[_0x561a('0xc4')](config[_0x561a('0xc5')],_0x561a('0xc6'),'files',_0x561a('0xc7'));var _0x5deabe=path[_0x561a('0xc4')](config[_0x561a('0xc5')],'server',_0x561a('0xc8'),_0x561a('0xc9'));var _0x4b15d4=path[_0x561a('0xc4')](_0x2c62ff,_0x2c52ed);var _0x513522=util[_0x561a('0xbb')](_0x561a('0xca'),_0x243950[_0x561a('0xae')]['id'],_0x2c52ed);var _0x571180=path['join'](_0x2c62ff,_0x513522);var _0x5e4c3e=[];_0x5e4c3e['push']({'model':db[_0x561a('0xcb')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5e4c3e[_0x561a('0x35')]({'model':db['CmContact'],'as':_0x561a('0x64'),'attributes':['id','firstName',_0x561a('0xcc')],'raw':!![]});if(_0x243950[_0x561a('0x3d')][_0x561a('0xc9')]){_0x5e4c3e[_0x561a('0x35')]({'model':db[_0x561a('0xcd')],'as':_0x561a('0xcd'),'raw':!![]});}var _0x899305=[{'model':db[_0x561a('0xb6')],'as':_0x561a('0xce'),'attributes':['id',_0x561a('0x70'),_0x561a('0x75'),'direction',_0x561a('0xcf'),_0x561a('0x7b')],'include':_0x5e4c3e}];_0x899305[_0x561a('0x35')]({'model':db[_0x561a('0xd0')],'as':_0x561a('0xd1'),'attributes':['id',_0x561a('0x2d')]});_0x899305[_0x561a('0x35')]({'model':db[_0x561a('0xcb')],'as':_0x561a('0xd2'),'attributes':['id',_0x561a('0x30')]});return db[_0x561a('0x37')][_0x561a('0x5f')]({'where':{'id':_0x243950['params']['id']},'include':_0x899305})[_0x561a('0x2a')](handleEntityNotFound(_0x901c02,null))['then'](function(_0x46166d){if(_0x46166d){var _0x2fa215=_0x46166d[_0x561a('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x4b15d4);var _0x1e4c32={'channel':_0x561a('0xd4'),'account':_0x2fa215['Account']['name'],'agent':_0x2fa215[_0x561a('0xd2')]?_0x2fa215[_0x561a('0xd2')][_0x561a('0x30')]:_0x561a('0xd5'),'createdAt':moment(_0x2fa215[_0x561a('0x75')])[_0x561a('0xbb')](_0x561a('0xbc'))[_0x561a('0x95')](),'closedAt':_0x2fa215[_0x561a('0xd6')]?moment(_0x2fa215[_0x561a('0xd7')])[_0x561a('0xbb')](_0x561a('0xbc'))[_0x561a('0x95')]():'','disposition':_0x2fa215[_0x561a('0xd8')],'messages':_(_0x2fa215[_0x561a('0xce')])[_0x561a('0x7f')]({'secret':![]})[_0x561a('0x2f')](function(_0x14089e){if(_0x14089e[_0x561a('0xcd')]){var _0xb858=path[_0x561a('0xc4')](_0x5deabe,_0x14089e[_0x561a('0xcd')]['basename']);if(fs[_0x561a('0xd9')](_0xb858)){fs[_0x561a('0xda')](_0xb858)[_0x561a('0xdb')](fs[_0x561a('0xdc')](path[_0x561a('0xc4')](_0x4b15d4,_0x14089e[_0x561a('0xcd')][_0x561a('0xdd')])));}}return{'date':moment(_0x14089e[_0x561a('0x75')])[_0x561a('0xbb')](_0x561a('0xbc'))[_0x561a('0x95')](),'sender':_0x14089e[_0x561a('0xde')]===_0x561a('0xdf')?_0x14089e['User']?_0x14089e[_0x561a('0xcb')][_0x561a('0x30')]:'System':_0x14089e[_0x561a('0x64')][_0x561a('0xe0')]+(_0x14089e[_0x561a('0x64')][_0x561a('0xcc')]?'\x20'+_0x14089e['Contact'][_0x561a('0xcc')]:''),'body':_0x14089e[_0x561a('0xcd')]?_0x14089e[_0x561a('0xcd')][_0x561a('0xdd')]:_0x14089e[_0x561a('0x70')],'direction':_0x14089e[_0x561a('0xde')]===_0x561a('0xdf')?'A':'C','secret':_0x14089e[_0x561a('0xcf')],'read':_0x14089e[_0x561a('0x7b')],'attachment':_0x14089e['Attachment']};})[_0x561a('0x61')]()};return ejs['renderFile'](path[_0x561a('0xc4')](config[_0x561a('0xc5')],_0x561a('0xc6'),_0x561a('0xe1'),_0x561a('0xe2')),{'interaction':_0x1e4c32})[_0x561a('0x2a')](function(_0x58c698){var _0x48744e=path[_0x561a('0xc4')](_0x4b15d4,_0x561a('0xe3')+_0x2fa215['id']+'-'+_0x2c52ed+_0x561a('0xe4'));var _0x28af50={'path':_0x48744e,'channel':'Whatsapp','interactionId':_0x2fa215['id']};return pdf[_0x561a('0xe5')](_0x58c698,_0x28af50);})[_0x561a('0x2a')](function(){return new BPromise(function(_0x4a6bc9,_0x444be3){zipdir(_0x4b15d4,{'saveTo':_0x571180},function(_0x1ff6db,_0x41f28a){if(_0x1ff6db)return _0x444be3(_0x1ff6db);return _0x4a6bc9(_0x41f28a);});})[_0x561a('0x2a')](function(){return new BPromise(function(_0x4fbb66,_0x4d2e9d){rimraf(_0x4b15d4,function(_0x1b1719){if(_0x1b1719)_0x4d2e9d(_0x1b1719);return _0x4fbb66();});});})[_0x561a('0x2a')](function(){return _0x901c02[_0x561a('0xc3')](_0x571180,_0x513522,function(_0x5c45a5){if(_0x5c45a5){console[_0x561a('0xe6')](_0x561a('0xe7'),_0x5c45a5);}else{fs[_0x561a('0xe8')](_0x571180);}});});});}else{return _0x901c02['sendStatus'](0xc8);}})['catch'](handleError(_0x901c02,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index c571487..9d5c49c 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 _0x8cc8=['WhatsappMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','length','emit','catch','hook','exports','events','../../mysqldb','WhatsappInteraction'];(function(_0x31692e,_0x255798){var _0x5a6289=function(_0x547178){while(--_0x547178){_0x31692e['push'](_0x31692e['shift']());}};_0x5a6289(++_0x255798);}(_0x8cc8,0x177));var _0x88cc=function(_0x45f50f,_0x3a1574){_0x45f50f=_0x45f50f-0x0;var _0x5d3974=_0x8cc8[_0x45f50f];return _0x5d3974;};'use strict';var EventEmitter=require(_0x88cc('0x0'));var WhatsappInteraction=require(_0x88cc('0x1'))['db'][_0x88cc('0x2')];var WhatsappMessage=require(_0x88cc('0x1'))['db'][_0x88cc('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x88cc('0x4')](0x0);var events={'afterCreate':_0x88cc('0x5'),'afterUpdate':_0x88cc('0x6'),'afterDestroy':_0x88cc('0x7')};function emitEvent(_0xce4dc7){return function(_0x1c943a,_0x88dfa3,_0x1683f9){_0x1c943a['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3d35ed){_0x1c943a[_0x88cc('0x8')](_0x88cc('0x9'),_0x3d35ed[_0x88cc('0xa')](function(_0x4b61a1){return{'id':_0x4b61a1['id']};}));return WhatsappMessage[_0x88cc('0xb')]({'where':{'WhatsappInteractionId':_0x1c943a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x88cc('0xc')](function(_0x574946){_0x1c943a[_0x88cc('0x8')]('unreadMessages',_0x574946[_0x88cc('0xd')]);WhatsappInteractionEvents[_0x88cc('0xe')](_0xce4dc7+':'+_0x1c943a['id'],_0x1c943a);WhatsappInteractionEvents[_0x88cc('0xe')](_0xce4dc7,_0x1c943a);_0x1683f9(null);})[_0x88cc('0xf')](_0x1683f9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x88cc('0x10')](e,emitEvent(event));}}module[_0x88cc('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xe5fb=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x2f0645,_0x462d1d){var _0x5d760f=function(_0xfceec2){while(--_0xfceec2){_0x2f0645['push'](_0x2f0645['shift']());}};_0x5d760f(++_0x462d1d);}(_0xe5fb,0xce));var _0xbe5f=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0xe5fb[_0x397f37];return _0x31cae6;};'use strict';var EventEmitter=require(_0xbe5f('0x0'));var WhatsappInteraction=require(_0xbe5f('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xbe5f('0x1'))['db'][_0xbe5f('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbe5f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe5f('0x4'),'afterDestroy':_0xbe5f('0x5')};function emitEvent(_0x49c724){return function(_0x3bb9d5,_0x2b1a47,_0x5b0452){_0x3bb9d5[_0xbe5f('0x6')]({'attributes':['id'],'raw':!![]})[_0xbe5f('0x7')](function(_0x2fc62b){_0x3bb9d5[_0xbe5f('0x8')](_0xbe5f('0x9'),_0x2fc62b[_0xbe5f('0xa')](function(_0x4fdce1){return{'id':_0x4fdce1['id']};}));return WhatsappMessage[_0xbe5f('0xb')]({'where':{'WhatsappInteractionId':_0x3bb9d5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbe5f('0x7')](function(_0x2df3d9){_0x3bb9d5[_0xbe5f('0x8')](_0xbe5f('0xc'),_0x2df3d9[_0xbe5f('0xd')]);WhatsappInteractionEvents[_0xbe5f('0xe')](_0x49c724+':'+_0x3bb9d5['id'],_0x3bb9d5);WhatsappInteractionEvents[_0xbe5f('0xe')](_0x49c724,_0x3bb9d5);_0x5b0452(null);})[_0xbe5f('0xf')](_0x5b0452(null));};}for(var e in events){if(events[_0xbe5f('0x10')](e)){var event=events[e];WhatsappInteraction[_0xbe5f('0x11')](e,emitEvent(event));}}module[_0xbe5f('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index c7e3d7b..a7c17b6 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 _0x1a3e=['define','WhatsappInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x26411a,_0x2e74e5){var _0x4f6d4f=function(_0x51ae37){while(--_0x51ae37){_0x26411a['push'](_0x26411a['shift']());}};_0x4f6d4f(++_0x2e74e5);}(_0x1a3e,0xad));var _0xe1a3=function(_0x3ba0f5,_0x3a9a9d){_0x3ba0f5=_0x3ba0f5-0x0;var _0x5c9249=_0x1a3e[_0x3ba0f5];return _0x5c9249;};'use strict';var _=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var logger=require(_0xe1a3('0x2'))(_0xe1a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe1a3('0x4'));var fs=require('fs');var path=require(_0xe1a3('0x5'));var rimraf=require(_0xe1a3('0x6'));var config=require(_0xe1a3('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xe1a3('0x8')]=function(_0x399c17,_0x3d706f){return _0x399c17[_0xe1a3('0x9')](_0xe1a3('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc970cb,_0x2a2690,_0x966acd){if(_0xc970cb[_0xe1a3('0xb')]('closed')){_0xc970cb['closedAt']=moment()[_0xe1a3('0xc')](_0xe1a3('0xd'));}_0x966acd(null,_0xc970cb);}}});}; \ No newline at end of file +var _0x2678=['../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x14662d,_0x5a4f31){var _0x215d19=function(_0x59e42d){while(--_0x59e42d){_0x14662d['push'](_0x14662d['shift']());}};_0x215d19(++_0x5a4f31);}(_0x2678,0x13b));var _0x8267=function(_0x5337d7,_0xdbea80){_0x5337d7=_0x5337d7-0x0;var _0x221bf9=_0x2678[_0x5337d7];return _0x221bf9;};'use strict';var _=require(_0x8267('0x0'));var util=require(_0x8267('0x1'));var logger=require(_0x8267('0x2'))(_0x8267('0x3'));var moment=require(_0x8267('0x4'));var BPromise=require(_0x8267('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8267('0x6'));var rimraf=require(_0x8267('0x7'));var config=require(_0x8267('0x8'));var attributes=require(_0x8267('0x9'));module[_0x8267('0xa')]=function(_0x56f7cf,_0x768e25){return _0x56f7cf[_0x8267('0xb')](_0x8267('0xc'),attributes,{'tableName':_0x8267('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b087,_0x39540c,_0x6337){if(_0x42b087[_0x8267('0xe')]('closed')){_0x42b087[_0x8267('0xf')]=moment()['format'](_0x8267('0x10'));}_0x6337(null,_0x42b087);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 84784d1..464bb8f 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 _0x60e1=['catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','limit','debug','AddTagsToWhatsappInteraction','find','where','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x15b668,_0x5baa72){var _0x137778=function(_0x5a9941){while(--_0x5a9941){_0x15b668['push'](_0x15b668['shift']());}};_0x137778(++_0x5baa72);}(_0x60e1,0x14c));var _0x160e=function(_0x254804,_0x301eae){_0x254804=_0x254804-0x0;var _0x5c032e=_0x60e1[_0x254804];return _0x5c032e;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require(_0x160e('0x3'));var fs=require('fs');var Redis=require(_0x160e('0x4'));var db=require(_0x160e('0x5'))['db'];var utils=require(_0x160e('0x6'));var logger=require(_0x160e('0x7'))(_0x160e('0x8'));var config=require(_0x160e('0x9'));var jayson=require(_0x160e('0xa'));var client=jayson['client'][_0x160e('0xb')]({'port':0x232a});config['redis']=_[_0x160e('0xc')](config[_0x160e('0xd')],{'host':_0x160e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x160e('0xd')]));require(_0x160e('0xf'))[_0x160e('0x10')](socket);function respondWithRpcPromise(_0x2b44c4,_0x148fd1,_0x84e873){return new BPromise(function(_0x54deb2,_0x367f7c){return client[_0x160e('0x11')](_0x2b44c4,_0x84e873)[_0x160e('0x12')](function(_0x13c050){logger[_0x160e('0x13')](_0x160e('0x14'),_0x148fd1,_0x160e('0x15'));logger['debug'](_0x160e('0x16'),_0x148fd1,_0x160e('0x15'),JSON[_0x160e('0x17')](_0x13c050));if(_0x13c050[_0x160e('0x18')]){if(_0x13c050['error'][_0x160e('0x19')]===0x1f4){logger[_0x160e('0x18')](_0x160e('0x14'),_0x148fd1,_0x13c050[_0x160e('0x18')]['message']);return _0x367f7c(_0x13c050['error']['message']);}logger['error'](_0x160e('0x14'),_0x148fd1,_0x13c050[_0x160e('0x18')][_0x160e('0x1a')]);return _0x54deb2(_0x13c050[_0x160e('0x18')][_0x160e('0x1a')]);}else{logger[_0x160e('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x148fd1,_0x160e('0x15'));_0x54deb2(_0x13c050[_0x160e('0x1b')]['message']);}})[_0x160e('0x1c')](function(_0x17ce24){logger[_0x160e('0x18')](_0x160e('0x14'),_0x148fd1,_0x17ce24);_0x367f7c(_0x17ce24);});});}exports[_0x160e('0x1d')]=function(_0x28a58e){var _0x47e82c=this;return new Promise(function(_0x120ca9,_0x4ca9d4){return db[_0x160e('0x1e')][_0x160e('0x1f')](_0x28a58e['body'],{'raw':_0x28a58e[_0x160e('0x20')]?_0x28a58e['options'][_0x160e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a58e['options']?_0x28a58e[_0x160e('0x20')]['where']||null:null,'attributes':_0x28a58e[_0x160e('0x20')]?_0x28a58e[_0x160e('0x20')]['attributes']||null:null,'limit':_0x28a58e[_0x160e('0x20')]?_0x28a58e['options'][_0x160e('0x22')]||null:null})['then'](function(_0x228754){logger['info']('UpdateWhatsappInteraction',_0x28a58e);logger[_0x160e('0x23')](_0x160e('0x1d'),_0x28a58e,JSON[_0x160e('0x17')](_0x228754));_0x120ca9(_0x228754);})[_0x160e('0x1c')](function(_0x3e8856){logger[_0x160e('0x18')](_0x160e('0x1d'),_0x3e8856[_0x160e('0x1a')],_0x28a58e);_0x4ca9d4(_0x47e82c[_0x160e('0x18')](0x1f4,_0x3e8856[_0x160e('0x1a')]));});});};exports[_0x160e('0x24')]=function(_0x3bbc77){return new Promise(function(_0x4f5bf2,_0x57d37e){return db['WhatsappInteraction'][_0x160e('0x25')]({'where':_0x3bbc77[_0x160e('0x20')]?_0x3bbc77[_0x160e('0x20')][_0x160e('0x26')]||null:null})[_0x160e('0x12')](function(_0x8623e0){if(_0x8623e0){return _0x8623e0[_0x160e('0x27')](_0x3bbc77[_0x160e('0x28')][_0x160e('0x29')],_[_0x160e('0x2a')](_0x3bbc77[_0x160e('0x28')],[_0x160e('0x29'),'id'])||{});}})[_0x160e('0x2b')](function(_0x57a557){logger[_0x160e('0x13')](_0x160e('0x2c'),_0x3bbc77);logger[_0x160e('0x23')]('AddTags',_0x3bbc77,JSON[_0x160e('0x17')](_0x57a557));_0x4f5bf2(_0x57a557);})[_0x160e('0x1c')](function(_0x75845c){logger[_0x160e('0x18')](_0x160e('0x2c'),_0x75845c[_0x160e('0x1a')],_0x3bbc77);_0x57d37e(_this['error'](0x1f4,_0x75845c[_0x160e('0x1a')]));});});}; \ No newline at end of file +var _0xe6ab=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','spread','AddTags','lodash','util'];(function(_0x2e1821,_0x51f1be){var _0x53188c=function(_0x4fc2c6){while(--_0x4fc2c6){_0x2e1821['push'](_0x2e1821['shift']());}};_0x53188c(++_0x51f1be);}(_0xe6ab,0xe2));var _0xbe6a=function(_0x38ac40,_0x409185){_0x38ac40=_0x38ac40-0x0;var _0x585497=_0xe6ab[_0x38ac40];return _0x585497;};'use strict';var _=require(_0xbe6a('0x0'));var util=require(_0xbe6a('0x1'));var moment=require('moment');var BPromise=require(_0xbe6a('0x2'));var rs=require(_0xbe6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe6a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe6a('0x5'));var config=require(_0xbe6a('0x6'));var jayson=require(_0xbe6a('0x7'));var client=jayson['client'][_0xbe6a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbe6a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe6a('0xa'))(new Redis(config[_0xbe6a('0x9')]));require(_0xbe6a('0xb'))['register'](socket);function respondWithRpcPromise(_0x18d88b,_0x264b8a,_0x353eb0){return new BPromise(function(_0x21d9fe,_0x598a42){return client[_0xbe6a('0xc')](_0x18d88b,_0x353eb0)[_0xbe6a('0xd')](function(_0x61dbac){logger['info'](_0xbe6a('0xe'),_0x264b8a,_0xbe6a('0xf'));logger[_0xbe6a('0x10')](_0xbe6a('0x11'),_0x264b8a,_0xbe6a('0xf'),JSON[_0xbe6a('0x12')](_0x61dbac));if(_0x61dbac['error']){if(_0x61dbac[_0xbe6a('0x13')][_0xbe6a('0x14')]===0x1f4){logger[_0xbe6a('0x13')](_0xbe6a('0xe'),_0x264b8a,_0x61dbac[_0xbe6a('0x13')][_0xbe6a('0x15')]);return _0x598a42(_0x61dbac['error'][_0xbe6a('0x15')]);}logger[_0xbe6a('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x264b8a,_0x61dbac[_0xbe6a('0x13')]['message']);return _0x21d9fe(_0x61dbac[_0xbe6a('0x13')][_0xbe6a('0x15')]);}else{logger[_0xbe6a('0x16')](_0xbe6a('0xe'),_0x264b8a,_0xbe6a('0xf'));_0x21d9fe(_0x61dbac['result'][_0xbe6a('0x15')]);}})[_0xbe6a('0x17')](function(_0x1d406c){logger[_0xbe6a('0x13')](_0xbe6a('0xe'),_0x264b8a,_0x1d406c);_0x598a42(_0x1d406c);});});}exports[_0xbe6a('0x18')]=function(_0x331eae){var _0x29cd16=this;return new Promise(function(_0x36731a,_0x233bbf){return db[_0xbe6a('0x19')][_0xbe6a('0x1a')](_0x331eae[_0xbe6a('0x1b')],{'raw':_0x331eae['options']?_0x331eae[_0xbe6a('0x1c')][_0xbe6a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331eae[_0xbe6a('0x1c')]?_0x331eae[_0xbe6a('0x1c')][_0xbe6a('0x1e')]||null:null,'attributes':_0x331eae[_0xbe6a('0x1c')]?_0x331eae[_0xbe6a('0x1c')][_0xbe6a('0x1f')]||null:null,'limit':_0x331eae[_0xbe6a('0x1c')]?_0x331eae['options'][_0xbe6a('0x20')]||null:null})[_0xbe6a('0xd')](function(_0x4c92be){logger[_0xbe6a('0x16')](_0xbe6a('0x18'),_0x331eae);logger[_0xbe6a('0x10')]('UpdateWhatsappInteraction',_0x331eae,JSON['stringify'](_0x4c92be));_0x36731a(_0x4c92be);})[_0xbe6a('0x17')](function(_0x1be346){logger[_0xbe6a('0x13')]('UpdateWhatsappInteraction',_0x1be346[_0xbe6a('0x15')],_0x331eae);_0x233bbf(_0x29cd16[_0xbe6a('0x13')](0x1f4,_0x1be346[_0xbe6a('0x15')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x40ad24){return new Promise(function(_0x383a35,_0x596341){return db[_0xbe6a('0x19')][_0xbe6a('0x21')]({'where':_0x40ad24[_0xbe6a('0x1c')]?_0x40ad24[_0xbe6a('0x1c')][_0xbe6a('0x1e')]||null:null})[_0xbe6a('0xd')](function(_0x453920){if(_0x453920){return _0x453920[_0xbe6a('0x22')](_0x40ad24[_0xbe6a('0x1b')][_0xbe6a('0x23')],_['omit'](_0x40ad24[_0xbe6a('0x1b')],[_0xbe6a('0x23'),'id'])||{});}})[_0xbe6a('0x24')](function(_0x49df40){logger[_0xbe6a('0x16')](_0xbe6a('0x25'),_0x40ad24);logger[_0xbe6a('0x10')](_0xbe6a('0x25'),_0x40ad24,JSON[_0xbe6a('0x12')](_0x49df40));_0x383a35(_0x49df40);})[_0xbe6a('0x17')](function(_0x2c1546){logger[_0xbe6a('0x13')](_0xbe6a('0x25'),_0x2c1546['message'],_0x40ad24);_0x596341(_this['error'](0x1f4,_0x2c1546[_0xbe6a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f1f4211..39cf288 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 _0x7e92=['removeListener','register','length','./whatsappInteraction.events','remove','update','emit'];(function(_0x53c83b,_0x3dd79a){var _0x2c142b=function(_0x447fbd){while(--_0x447fbd){_0x53c83b['push'](_0x53c83b['shift']());}};_0x2c142b(++_0x3dd79a);}(_0x7e92,0xe3));var _0x27e9=function(_0x1d4918,_0x55a1e8){_0x1d4918=_0x1d4918-0x0;var _0x2af55e=_0x7e92[_0x1d4918];return _0x2af55e;};'use strict';var WhatsappInteractionEvents=require(_0x27e9('0x0'));var events=['save',_0x27e9('0x1'),_0x27e9('0x2')];function createListener(_0x3b69f2,_0x503d84){return function(_0x5164f9){_0x503d84[_0x27e9('0x3')](_0x3b69f2,_0x5164f9);};}function removeListener(_0x4cf421,_0x321cca){return function(){WhatsappInteractionEvents[_0x27e9('0x4')](_0x4cf421,_0x321cca);};}exports[_0x27e9('0x5')]=function(_0x1d3e2e){for(var _0x364eff=0x0,_0x3015ca=events[_0x27e9('0x6')];_0x364eff<_0x3015ca;_0x364eff++){var _0x39a3a8=events[_0x364eff];var _0x3729a=createListener('whatsappInteraction:'+_0x39a3a8,_0x1d3e2e);WhatsappInteractionEvents['on'](_0x39a3a8,_0x3729a);}}; \ No newline at end of file +var _0x69fb=['length','whatsappInteraction:','./whatsappInteraction.events','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69fb,0x98));var _0xb69f=function(_0x316d5f,_0x1b1286){_0x316d5f=_0x316d5f-0x0;var _0x4220c0=_0x69fb[_0x316d5f];return _0x4220c0;};'use strict';var WhatsappInteractionEvents=require(_0xb69f('0x0'));var events=[_0xb69f('0x1'),'remove','update'];function createListener(_0x26798a,_0x2cb227){return function(_0x2d6dca){_0x2cb227[_0xb69f('0x2')](_0x26798a,_0x2d6dca);};}function removeListener(_0x5ef97a,_0x371397){return function(){WhatsappInteractionEvents['removeListener'](_0x5ef97a,_0x371397);};}exports['register']=function(_0x37954a){for(var _0x1be6a0=0x0,_0x189efc=events[_0xb69f('0x3')];_0x1be6a0<_0x189efc;_0x1be6a0++){var _0x37cfd5=events[_0x1be6a0];var _0x230c35=createListener(_0xb69f('0x4')+_0x37cfd5,_0x37954a);WhatsappInteractionEvents['on'](_0x37cfd5,_0x230c35);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c11e5e7..a074846 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 _0xf5d6=['whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','/:id','post','tracked'];(function(_0x589ead,_0x506927){var _0x41db46=function(_0x13ccda){while(--_0x13ccda){_0x589ead['push'](_0x589ead['shift']());}};_0x41db46(++_0x506927);}(_0xf5d6,0x73));var _0x6f5d=function(_0x4c8a0f,_0x139a9b){_0x4c8a0f=_0x4c8a0f-0x0;var _0x384b8f=_0xf5d6[_0x4c8a0f];return _0x384b8f;};'use strict';var multer=require(_0x6f5d('0x0'));var util=require(_0x6f5d('0x1'));var path=require(_0x6f5d('0x2'));var timeout=require(_0x6f5d('0x3'));var express=require(_0x6f5d('0x4'));var router=express['Router']();var fs_extra=require(_0x6f5d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f5d('0x6'));var controller=require(_0x6f5d('0x7'));router['get']('/',auth[_0x6f5d('0x8')](),controller[_0x6f5d('0x9')]);router[_0x6f5d('0xa')](_0x6f5d('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6f5d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6f5d('0xd')]('/',auth['isAuthenticated'](),interaction[_0x6f5d('0xe')](_0x6f5d('0xf'),_0x6f5d('0x10')),controller[_0x6f5d('0x11')]);router[_0x6f5d('0xd')](_0x6f5d('0x12'),controller[_0x6f5d('0x13')]);router[_0x6f5d('0x14')]('/:id',auth[_0x6f5d('0x8')](),controller[_0x6f5d('0x15')]);router[_0x6f5d('0x14')](_0x6f5d('0x16'),auth['isAuthenticated'](),controller[_0x6f5d('0x17')]);router['put'](_0x6f5d('0x18'),auth[_0x6f5d('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x6f5d('0x8')](),controller[_0x6f5d('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7499=['status','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status'];(function(_0xf9fdd,_0x42e576){var _0x40546e=function(_0x4b6456){while(--_0x4b6456){_0xf9fdd['push'](_0xf9fdd['shift']());}};_0x40546e(++_0x42e576);}(_0x7499,0x1d3));var _0x9749=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x7499[_0xb0de07];return _0x4633d8;};'use strict';var multer=require(_0x9749('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9749('0x1'));var express=require(_0x9749('0x2'));var router=express[_0x9749('0x3')]();var fs_extra=require(_0x9749('0x4'));var auth=require(_0x9749('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x9749('0x6')]('/',auth[_0x9749('0x7')](),controller[_0x9749('0x8')]);router[_0x9749('0x6')](_0x9749('0x9'),auth[_0x9749('0x7')](),controller[_0x9749('0xa')]);router['get'](_0x9749('0xb'),auth[_0x9749('0x7')](),controller[_0x9749('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x9749('0xd')](_0x9749('0xe'),_0x9749('0xf')),controller[_0x9749('0x10')]);router[_0x9749('0x11')](_0x9749('0x12'),controller[_0x9749('0x13')]);router[_0x9749('0x14')]('/:id',auth[_0x9749('0x7')](),controller[_0x9749('0x15')]);router[_0x9749('0x14')](_0x9749('0x16'),auth['isAuthenticated'](),controller[_0x9749('0x17')]);router[_0x9749('0x14')](_0x9749('0x18'),auth[_0x9749('0x7')](),controller[_0x9749('0x19')]);router[_0x9749('0x1a')](_0x9749('0xb'),auth[_0x9749('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 2308a4a..695abca 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 _0x3665=['exports','TEXT','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x42207a,_0x433c2c){var _0x3346ca=function(_0x429d10){while(--_0x429d10){_0x42207a['push'](_0x42207a['shift']());}};_0x3346ca(++_0x433c2c);}(_0x3665,0x1d7));var _0x5366=function(_0x30ecbe,_0x23aa7c){_0x30ecbe=_0x30ecbe-0x0;var _0x17827a=_0x3665[_0x30ecbe];return _0x17827a;};'use strict';var Sequelize=require(_0x5366('0x0'));module[_0x5366('0x1')]={'body':{'type':Sequelize[_0x5366('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5366('0x3')]('in',_0x5366('0x4')),'defaultValue':_0x5366('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5366('0x5')](0xbe)},'phone':{'type':Sequelize[_0x5366('0x5')]},'readAt':{'type':Sequelize[_0x5366('0x6')]},'secret':{'type':Sequelize[_0x5366('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5366('0x5')]},'providerResponse':{'type':Sequelize[_0x5366('0x2')]}}; \ No newline at end of file +var _0xc4a1=['medium','BOOLEAN','out','STRING','DATE','sequelize','TEXT'];(function(_0x4daccd,_0x38116b){var _0x2d0c40=function(_0xfff040){while(--_0xfff040){_0x4daccd['push'](_0x4daccd['shift']());}};_0x2d0c40(++_0x38116b);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x2a8805,_0x35492b){_0x2a8805=_0x2a8805-0x0;var _0x1d77f4=_0xc4a1[_0x2a8805];return _0x1d77f4;};'use strict';var Sequelize=require(_0x1c4a('0x0'));module['exports']={'body':{'type':Sequelize[_0x1c4a('0x1')](_0x1c4a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1c4a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1c4a('0x4')),'defaultValue':_0x1c4a('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1c4a('0x5')](0xbe)},'phone':{'type':Sequelize[_0x1c4a('0x5')]},'readAt':{'type':Sequelize[_0x1c4a('0x6')]},'secret':{'type':Sequelize[_0x1c4a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c4a('0x5')]},'providerResponse':{'type':Sequelize[_0x1c4a('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 5122ba2..591fb1d 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 _0x8ed9=['stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','agent','manual','interface','channel','motionChannel','acceptmessage','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','contact','SIP/%s','event','EventManager','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28ed9e,_0x5315e8){var _0x26a394=function(_0x2e0b68){while(--_0x2e0b68){_0x28ed9e['push'](_0x28ed9e['shift']());}};_0x26a394(++_0x5315e8);}(_0x8ed9,0x191));var _0x98ed=function(_0x1ee8cb,_0x4d1c68){_0x1ee8cb=_0x1ee8cb-0x0;var _0x21f29b=_0x8ed9[_0x1ee8cb];return _0x21f29b;};'use strict';var emlformat=require(_0x98ed('0x0'));var rimraf=require(_0x98ed('0x1'));var zipdir=require(_0x98ed('0x2'));var jsonpatch=require(_0x98ed('0x3'));var rp=require(_0x98ed('0x4'));var moment=require(_0x98ed('0x5'));var BPromise=require(_0x98ed('0x6'));var Mustache=require(_0x98ed('0x7'));var util=require(_0x98ed('0x8'));var path=require(_0x98ed('0x9'));var sox=require(_0x98ed('0xa'));var csv=require('to-csv');var ejs=require(_0x98ed('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98ed('0xc'));var squel=require(_0x98ed('0xd'));var crypto=require(_0x98ed('0xe'));var jsforce=require(_0x98ed('0xf'));var deskjs=require(_0x98ed('0x10'));var toCsv=require(_0x98ed('0x11'));var querystring=require('querystring');var Papa=require(_0x98ed('0x12'));var Redis=require('ioredis');var authService=require(_0x98ed('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x98ed('0x14'));var hardwareService=require(_0x98ed('0x15'));var logger=require('../../config/logger')(_0x98ed('0x16'));var utils=require('../../config/utils');var config=require(_0x98ed('0x17'));var licenseUtil=require(_0x98ed('0x18'));var db=require(_0x98ed('0x19'))['db'];config[_0x98ed('0x1a')]=_['defaults'](config[_0x98ed('0x1a')],{'host':_0x98ed('0x1b'),'port':0x18eb});var socket=require(_0x98ed('0x1c'))(new Redis(config[_0x98ed('0x1a')]));require(_0x98ed('0x1d'))[_0x98ed('0x1e')](socket);var jayson=require(_0x98ed('0x1f'));var client=jayson[_0x98ed('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x98ed('0x20')][_0x98ed('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x579d09,_0x4fce7a,_0xc76f45,_0x2f59cb){return new BPromise(function(_0x2ce108,_0x3fe5fe){var _0x1c0ed8=_0x2f59cb||client;return _0x1c0ed8[_0x98ed('0x22')](_0x579d09,_0xc76f45)[_0x98ed('0x23')](function(_0xaac9a0){logger[_0x98ed('0x24')](_0x98ed('0x25'),_0x4fce7a,_0x98ed('0x26'));logger[_0x98ed('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4fce7a,'request\x20sent',JSON[_0x98ed('0x28')](_0xaac9a0));if(_0xaac9a0[_0x98ed('0x29')]){if(_0xaac9a0[_0x98ed('0x29')][_0x98ed('0x2a')]===0x1f4){logger['error'](_0x98ed('0x25'),_0x4fce7a,_0xaac9a0['error']['message']);return _0x3fe5fe(_0xaac9a0['error']['message']);}logger[_0x98ed('0x29')](_0x98ed('0x25'),_0x4fce7a,_0xaac9a0[_0x98ed('0x29')][_0x98ed('0x2b')]);return _0x2ce108(_0xaac9a0[_0x98ed('0x29')]['message']);}else{logger[_0x98ed('0x24')](_0x98ed('0x25'),_0x4fce7a,'request\x20sent');_0x2ce108(_0xaac9a0[_0x98ed('0x2c')][_0x98ed('0x2b')]);}})[_0x98ed('0x2d')](function(_0x6b8e42){logger[_0x98ed('0x29')](_0x98ed('0x25'),_0x4fce7a,_0x6b8e42);_0x3fe5fe(_0x6b8e42);});});}function respondWithStatusCode(_0xc4a139,_0x202f68){_0x202f68=_0x202f68||0xcc;return function(_0x33df41){if(_0x33df41){return _0xc4a139['sendStatus'](_0x202f68);}return _0xc4a139[_0x98ed('0x2e')](_0x202f68)[_0x98ed('0x2f')]();};}function respondWithResult(_0x5e65ca,_0x193772){_0x193772=_0x193772||0xc8;return function(_0x3b38d0){if(_0x3b38d0){return _0x5e65ca[_0x98ed('0x2e')](_0x193772)[_0x98ed('0x30')](_0x3b38d0);}};}function respondWithFilteredResult(_0x2fe837,_0x3efed3){return function(_0x1dc882){if(_0x1dc882){var _0x52f13e=typeof _0x3efed3[_0x98ed('0x31')]===_0x98ed('0x32')&&typeof _0x3efed3[_0x98ed('0x33')]===_0x98ed('0x32');var _0x5132bc=_0x1dc882[_0x98ed('0x34')];var _0x4ff621=_0x52f13e?0x0:_0x3efed3[_0x98ed('0x31')];var _0x2f5415=_0x52f13e?_0x1dc882[_0x98ed('0x34')]:_0x3efed3['offset']+_0x3efed3[_0x98ed('0x33')];var _0x3b7e4b;if(_0x2f5415>=_0x5132bc){_0x2f5415=_0x5132bc;_0x3b7e4b=0xc8;}else{_0x3b7e4b=0xce;}_0x2fe837[_0x98ed('0x2e')](_0x3b7e4b);return _0x2fe837[_0x98ed('0x35')](_0x98ed('0x36'),_0x4ff621+'-'+_0x2f5415+'/'+_0x5132bc)[_0x98ed('0x30')](_0x1dc882);}return null;};}function patchUpdates(_0x56ff69){return function(_0xec87b){try{jsonpatch['apply'](_0xec87b,_0x56ff69,!![]);}catch(_0x2e9881){return BPromise[_0x98ed('0x37')](_0x2e9881);}return _0xec87b[_0x98ed('0x38')]();};}function saveUpdates(_0x3ff0cd,_0x14aca1){return function(_0x4ca1d0){if(_0x4ca1d0){return _0x4ca1d0[_0x98ed('0x39')](_0x3ff0cd)[_0x98ed('0x23')](function(_0x447cd8){return _0x447cd8;});}return null;};}function removeEntity(_0x4f29dc,_0x28eb29){return function(_0x1e23c6){if(_0x1e23c6){return _0x1e23c6[_0x98ed('0x3a')]()['then'](function(){_0x4f29dc[_0x98ed('0x2e')](0xcc)[_0x98ed('0x2f')]();});}};}function handleEntityNotFound(_0x5cada0,_0x2fea6f){return function(_0x354711){if(!_0x354711){_0x5cada0['sendStatus'](0x194);}return _0x354711;};}function handleError(_0x168bb4,_0x4ad78c){_0x4ad78c=_0x4ad78c||0x1f4;return function(_0x1b2d15){logger[_0x98ed('0x29')](_0x1b2d15[_0x98ed('0x3b')]);if(_0x1b2d15[_0x98ed('0x3c')]){delete _0x1b2d15[_0x98ed('0x3c')];}_0x168bb4[_0x98ed('0x2e')](_0x4ad78c)[_0x98ed('0x3d')](_0x1b2d15);};}exports[_0x98ed('0x3e')]=function(_0x524572,_0x4b0fb1){var _0x4beb9d={},_0x41d571={},_0x1ea31d={'count':0x0,'rows':[]};var _0x54a9a3=_[_0x98ed('0x3f')](db['WhatsappMessage'][_0x98ed('0x40')],function(_0xd46b22){return{'name':_0xd46b22[_0x98ed('0x41')],'type':_0xd46b22[_0x98ed('0x42')][_0x98ed('0x43')]};});_0x41d571[_0x98ed('0x44')]=_[_0x98ed('0x3f')](_0x54a9a3,_0x98ed('0x3c'));_0x41d571[_0x98ed('0x45')]=_[_0x98ed('0x46')](_0x524572[_0x98ed('0x45')]);_0x41d571['filters']=_[_0x98ed('0x47')](_0x41d571['model'],_0x41d571[_0x98ed('0x45')]);_0x4beb9d['attributes']=_[_0x98ed('0x47')](_0x41d571[_0x98ed('0x44')],qs['fields'](_0x524572[_0x98ed('0x45')][_0x98ed('0x48')]));_0x4beb9d['attributes']=_0x4beb9d[_0x98ed('0x49')][_0x98ed('0x4a')]?_0x4beb9d[_0x98ed('0x49')]:_0x41d571[_0x98ed('0x44')];if(!_0x524572['query'][_0x98ed('0x4b')](_0x98ed('0x4c'))){_0x4beb9d['limit']=qs[_0x98ed('0x33')](_0x524572[_0x98ed('0x45')]['limit']);_0x4beb9d['offset']=qs[_0x98ed('0x31')](_0x524572[_0x98ed('0x45')]['offset']);}_0x4beb9d[_0x98ed('0x4d')]=qs[_0x98ed('0x4e')](_0x524572[_0x98ed('0x45')][_0x98ed('0x4e')]);_0x4beb9d[_0x98ed('0x4f')]=qs[_0x98ed('0x50')](_[_0x98ed('0x51')](_0x524572[_0x98ed('0x45')],_0x41d571['filters']),_0x54a9a3);if(_0x524572[_0x98ed('0x45')][_0x98ed('0x52')]){_0x4beb9d['where']=_[_0x98ed('0x53')](_0x4beb9d[_0x98ed('0x4f')],{'$or':_[_0x98ed('0x3f')](_0x54a9a3,function(_0x18d7f9){if(_0x18d7f9[_0x98ed('0x42')]!==_0x98ed('0x54')){var _0x12160d={};_0x12160d[_0x18d7f9['name']]={'$like':'%'+_0x524572['query'][_0x98ed('0x52')]+'%'};return _0x12160d;}})});}_0x4beb9d=_[_0x98ed('0x53')]({},_0x4beb9d,_0x524572[_0x98ed('0x55')]);var _0x372e49={'where':_0x4beb9d[_0x98ed('0x4f')]};return db[_0x98ed('0x56')][_0x98ed('0x34')](_0x372e49)[_0x98ed('0x23')](function(_0x5ebbee){_0x1ea31d[_0x98ed('0x34')]=_0x5ebbee;if(_0x524572[_0x98ed('0x45')][_0x98ed('0x57')]){_0x4beb9d[_0x98ed('0x58')]=[{'all':!![]}];}return db[_0x98ed('0x56')][_0x98ed('0x59')](_0x4beb9d);})['then'](function(_0x1c13ee){_0x1ea31d[_0x98ed('0x5a')]=_0x1c13ee;return _0x1ea31d;})[_0x98ed('0x23')](respondWithFilteredResult(_0x4b0fb1,_0x4beb9d))['catch'](handleError(_0x4b0fb1,null));};exports[_0x98ed('0x5b')]=function(_0x3eac07,_0x43f6ba){var _0x5970fc={'raw':!![],'where':{'id':_0x3eac07[_0x98ed('0x5c')]['id']}},_0x303d56={};_0x303d56['model']=_['keys'](db[_0x98ed('0x56')][_0x98ed('0x40')]);_0x303d56[_0x98ed('0x45')]=_[_0x98ed('0x46')](_0x3eac07['query']);_0x303d56[_0x98ed('0x50')]=_[_0x98ed('0x47')](_0x303d56['model'],_0x303d56[_0x98ed('0x45')]);_0x5970fc[_0x98ed('0x49')]=_[_0x98ed('0x47')](_0x303d56['model'],qs[_0x98ed('0x48')](_0x3eac07[_0x98ed('0x45')][_0x98ed('0x48')]));_0x5970fc[_0x98ed('0x49')]=_0x5970fc['attributes'][_0x98ed('0x4a')]?_0x5970fc[_0x98ed('0x49')]:_0x303d56[_0x98ed('0x44')];if(_0x3eac07[_0x98ed('0x45')]['includeAll']){_0x5970fc[_0x98ed('0x58')]=[{'all':!![]}];}_0x5970fc=_[_0x98ed('0x53')]({},_0x5970fc,_0x3eac07[_0x98ed('0x55')]);return db['WhatsappMessage'][_0x98ed('0x5d')](_0x5970fc)['then'](handleEntityNotFound(_0x43f6ba,null))[_0x98ed('0x23')](respondWithResult(_0x43f6ba,null))[_0x98ed('0x2d')](handleError(_0x43f6ba,null));};exports[_0x98ed('0x5e')]=function(_0x3d8c3a,_0x35f71b){return db['WhatsappMessage']['create'](_0x3d8c3a['body'],{})['then'](respondWithResult(_0x35f71b,0xc9))[_0x98ed('0x2d')](handleError(_0x35f71b,null));};exports[_0x98ed('0x39')]=function(_0x43f842,_0x30ec5c){if(_0x43f842[_0x98ed('0x5f')]['id']){delete _0x43f842['body']['id'];}return db[_0x98ed('0x56')][_0x98ed('0x5d')]({'where':{'id':_0x43f842['params']['id']}})[_0x98ed('0x23')](handleEntityNotFound(_0x30ec5c,null))['then'](saveUpdates(_0x43f842[_0x98ed('0x5f')],null))[_0x98ed('0x23')](respondWithResult(_0x30ec5c,null))[_0x98ed('0x2d')](handleError(_0x30ec5c,null));};exports[_0x98ed('0x3a')]=function(_0x5d0062,_0x47250b){return db[_0x98ed('0x56')]['find']({'where':{'id':_0x5d0062[_0x98ed('0x5c')]['id']}})[_0x98ed('0x23')](handleEntityNotFound(_0x47250b,null))[_0x98ed('0x23')](removeEntity(_0x47250b,null))[_0x98ed('0x2d')](handleError(_0x47250b,null));};exports[_0x98ed('0x60')]=function(_0x1cab29,_0x2edd34){return db[_0x98ed('0x56')][_0x98ed('0x60')]()[_0x98ed('0x23')](respondWithResult(_0x2edd34,null))[_0x98ed('0x2d')](handleError(_0x2edd34,null));};var interaction_log=require(_0x98ed('0x61'))(_0x98ed('0x62'));exports[_0x98ed('0x63')]=function(_0x4eb4e1,_0x2a10b8,_0x4df1ac){var _0x2daae7={'agent':{},'channel':_0x98ed('0x64')};if(_0x4eb4e1[_0x98ed('0x5f')]['id']){delete _0x4eb4e1[_0x98ed('0x5f')]['id'];}_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x65')]=!![];_0x4eb4e1['body'][_0x98ed('0x66')]=moment()[_0x98ed('0x67')](_0x98ed('0x68'));_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x69')]=_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x69')]||_0x4eb4e1[_0x98ed('0x6a')]['id'];_0x2daae7['agent']['id']=_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x69')];return db[_0x98ed('0x56')][_0x98ed('0x5d')]({'where':{'id':_0x4eb4e1[_0x98ed('0x5c')]['id'],'UserId':null}})[_0x98ed('0x23')](handleEntityNotFound(_0x2a10b8,null))[_0x98ed('0x23')](saveUpdates(_0x4eb4e1[_0x98ed('0x5f')],null))[_0x98ed('0x23')](function(_0x12c7c9){if(_0x12c7c9){_0x2daae7['message']=_0x12c7c9[_0x98ed('0x6b')]({'plain':!![]});return db['WhatsappInteraction'][_0x98ed('0x5d')]({'where':{'id':_0x12c7c9['WhatsappInteractionId']}});}return null;})[_0x98ed('0x23')](handleEntityNotFound(_0x2a10b8,null))[_0x98ed('0x23')](function(_0xc993ed){if(_0xc993ed){return _0xc993ed[_0x98ed('0x39')]({'UserId':_0x4eb4e1['body']['UserId'],'read1stAt':_[_0x98ed('0x6c')](_0xc993ed['read1stAt'])?moment()[_0x98ed('0x67')](_0x98ed('0x68')):undefined});}return null;})[_0x98ed('0x23')](function(_0x56552a){if(_0x56552a){_0x2daae7['interaction']=_0x56552a[_0x98ed('0x6b')]({'plain':!![]});interaction_log[_0x98ed('0x24')](_0x98ed('0x6d'),_0x4eb4e1[_0x98ed('0x6a')]['id'],_0x4eb4e1[_0x98ed('0x6a')][_0x98ed('0x3c')],_0x4eb4e1[_0x98ed('0x6a')][_0x98ed('0x6e')],_0x2daae7[_0x98ed('0x6f')]['id'],_0x4eb4e1[_0x98ed('0x5f')]?JSON[_0x98ed('0x28')](_0x4eb4e1['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x98ed('0x70'),_0x2daae7);}return null;})[_0x98ed('0x23')](function(_0x4269a3){var _0x3eaa15=_0x98ed('0x71')+_0x4269a3[_0x98ed('0x2b')][_0x98ed('0x72')];return db[_0x98ed('0x73')]['query'](_0x3eaa15,{'type':db[_0x98ed('0x74')][_0x98ed('0x75')]['SELECT'],'raw':!![]})[_0x98ed('0x23')](function(_0x4dfa73){return _0x4dfa73;});})[_0x98ed('0x23')](function(_0x4ce9bf){if(_0x4ce9bf){_0x2daae7[_0x98ed('0x2b')]['contact']=_0x4ce9bf[0x0];if(!_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x69')])return;return db[_0x98ed('0x76')][_0x98ed('0x5d')]({'where':{'id':_0x4eb4e1['body'][_0x98ed('0x69')],'role':'agent'},'attributes':['id',_0x98ed('0x3c'),_0x98ed('0x77'),_0x98ed('0x78'),_0x98ed('0x79')],'raw':!![]});}return null;})[_0x98ed('0x23')](function(_0xb8b0bb){if(!_0xb8b0bb)return null;_0x2daae7[_0x98ed('0x2b')][_0x98ed('0x7a')]=_0xb8b0bb;return _0x2daae7;})['then'](function(_0x5a9ce4){if(_0x5a9ce4){if(_0x4eb4e1[_0x98ed('0x5f')][_0x98ed('0x7b')]){_0x2daae7[_0x98ed('0x2b')][_0x98ed('0x7c')]=util[_0x98ed('0x67')]('SIP/%s',_0x4eb4e1[_0x98ed('0x6a')][_0x98ed('0x3c')]);_0x2daae7['message'][_0x98ed('0x7d')]=_0x2daae7[_0x98ed('0x7d')];_0x2daae7[_0x98ed('0x2b')][_0x98ed('0x7e')]=_0x2daae7['channel'];_0x2daae7[_0x98ed('0x2b')]['event']=_0x98ed('0x63');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x98ed('0x7f'),'message':_0x2daae7[_0x98ed('0x2b')]},client9002)['then'](function(){return _0x2daae7;});}return _0x2daae7;}return null;})[_0x98ed('0x23')](respondWithResult(_0x2a10b8,null))['catch'](handleError(_0x2a10b8,null));};var interaction_log=require('../../config/logger')(_0x98ed('0x62'));exports['reject']=function(_0x298b5b,_0x39b3c3,_0x11b8b7){var _0x759509={'agent':{},'channel':_0x98ed('0x64')};if(_0x298b5b[_0x98ed('0x5f')]['id']){delete _0x298b5b[_0x98ed('0x5f')]['id'];}_0x298b5b[_0x98ed('0x5f')][_0x98ed('0x69')]=_0x298b5b[_0x98ed('0x5f')][_0x98ed('0x69')]||_0x298b5b[_0x98ed('0x6a')]['id'];_0x759509[_0x98ed('0x7a')]['id']=_0x298b5b[_0x98ed('0x5f')][_0x98ed('0x69')];return db['WhatsappMessage']['find']({'where':{'id':_0x298b5b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x39b3c3,null))[_0x98ed('0x23')](function(_0x5c1d0f){if(_0x5c1d0f){_0x759509[_0x98ed('0x2b')]=_0x5c1d0f['get']({'plain':!![]});return db[_0x98ed('0x80')][_0x98ed('0x5d')]({'where':{'id':_0x5c1d0f[_0x98ed('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x39b3c3,null))['then'](function(_0x544ca){if(_0x544ca){_0x759509[_0x98ed('0x6f')]=_0x544ca[_0x98ed('0x6b')]({'plain':!![]});interaction_log[_0x98ed('0x24')](_0x98ed('0x82'),_0x298b5b[_0x98ed('0x6a')]['id'],_0x298b5b['user'][_0x98ed('0x3c')],_0x298b5b[_0x98ed('0x6a')][_0x98ed('0x6e')],_0x759509[_0x98ed('0x6f')]['id'],_0x298b5b['body']?JSON['stringify'](_0x298b5b[_0x98ed('0x5f')]):_0x98ed('0x83'));return respondWithRpcPromise(_0x98ed('0x84'),_0x98ed('0x85'),_0x759509);}return null;})[_0x98ed('0x23')](function(_0x1a710f){var _0x4e8f1b=_0x98ed('0x71')+_0x1a710f[_0x98ed('0x2b')][_0x98ed('0x72')];return db[_0x98ed('0x73')][_0x98ed('0x45')](_0x4e8f1b,{'type':db[_0x98ed('0x74')][_0x98ed('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x40fe7e){return _0x40fe7e;});})[_0x98ed('0x23')](function(_0x1705e8){if(_0x1705e8){_0x759509[_0x98ed('0x2b')][_0x98ed('0x86')]=_0x1705e8[0x0];if(!_0x298b5b[_0x98ed('0x5f')][_0x98ed('0x69')])return;return db['User'][_0x98ed('0x5d')]({'where':{'id':_0x298b5b[_0x98ed('0x5f')][_0x98ed('0x69')],'role':'agent'},'attributes':['id','name',_0x98ed('0x77'),_0x98ed('0x78'),_0x98ed('0x79')],'raw':!![]});}return null;})[_0x98ed('0x23')](function(_0x2beb5d){if(!_0x2beb5d)return null;_0x759509[_0x98ed('0x2b')]['agent']=_0x2beb5d;return _0x759509;})[_0x98ed('0x23')](function(_0x5fa1ea){if(_0x5fa1ea){_0x5fa1ea[_0x98ed('0x2b')][_0x98ed('0x7c')]=util[_0x98ed('0x67')](_0x98ed('0x87'),_0x298b5b[_0x98ed('0x6a')][_0x98ed('0x3c')]);_0x5fa1ea[_0x98ed('0x2b')][_0x98ed('0x7d')]=_0x759509['channel'];_0x5fa1ea[_0x98ed('0x2b')][_0x98ed('0x7e')]=_0x759509[_0x98ed('0x7d')];_0x5fa1ea[_0x98ed('0x2b')][_0x98ed('0x88')]='reject';respondWithRpcPromise(_0x98ed('0x89'),_0x98ed('0x89'),{'event':_0x98ed('0x8a'),'message':_0x5fa1ea[_0x98ed('0x2b')]},client9002);return _0x759509;}return null;})[_0x98ed('0x23')](respondWithResult(_0x39b3c3,null))[_0x98ed('0x2d')](handleError(_0x39b3c3,null));};exports[_0x98ed('0x2e')]=function(_0x369f6f,_0x38f136,_0x35b206){if(_0x369f6f[_0x98ed('0x5f')]['id']){delete _0x369f6f[_0x98ed('0x5f')]['id'];}var _0x562bcd;return db['WhatsappMessage'][_0x98ed('0x5d')]({'where':{'id':_0x369f6f['params']['id']}})[_0x98ed('0x23')](handleEntityNotFound(_0x38f136,null))[_0x98ed('0x23')](function(_0x3f6910){if(_0x3f6910){_0x562bcd=_0x3f6910;return db['WhatsappAccount'][_0x98ed('0x5d')]({'where':{'id':_0x3f6910['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x38f136,null))[_0x98ed('0x23')](function(_0x251cfd){if(_0x251cfd){logger[_0x98ed('0x27')](_0x98ed('0x8b'),_0x98ed('0x2e'),_0x98ed('0x8c'),_0x251cfd[_0x98ed('0x42')],util[_0x98ed('0x8d')](_0x369f6f[_0x98ed('0x5f')],{'showHidden':![],'depth':null}));switch(_0x251cfd['type']){case _0x98ed('0x8e'):if(_0x369f6f[_0x98ed('0x5f')]['MessageSid']&&_0x369f6f[_0x98ed('0x5f')][_0x98ed('0x8f')]===_0x562bcd[_0x98ed('0x90')]&&_0x369f6f[_0x98ed('0x5f')][_0x98ed('0x91')]&&_0x369f6f[_0x98ed('0x5f')][_0x98ed('0x91')]===_0x98ed('0x65')){return _0x562bcd['update']({'read':!![]});}else{logger[_0x98ed('0x29')](_0x98ed('0x92'),_0x98ed('0x2e'),_0x98ed('0x8e'),util[_0x98ed('0x8d')](_0x369f6f[_0x98ed('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x562bcd;}})['then'](respondWithResult(_0x38f136,null))[_0x98ed('0x2d')](handleError(_0x38f136,null));}; \ No newline at end of file +var _0xe0d2=['messageId','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','options','findAll','show','params','keys','includeAll','include','merge','find','create','body','describe','whatsapp-interactions','accept','format','UserId','user','agent','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','sequelize','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','twilio','MessageSid'];(function(_0xa37a56,_0x3f104a){var _0x25c89b=function(_0x59eb38){while(--_0x59eb38){_0xa37a56['push'](_0xa37a56['shift']());}};_0x25c89b(++_0x3f104a);}(_0xe0d2,0x105));var _0x2e0d=function(_0xa5fc76,_0x16dc68){_0xa5fc76=_0xa5fc76-0x0;var _0x306259=_0xe0d2[_0xa5fc76];return _0x306259;};'use strict';var emlformat=require(_0x2e0d('0x0'));var rimraf=require(_0x2e0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2e0d('0x2'));var moment=require(_0x2e0d('0x3'));var BPromise=require(_0x2e0d('0x4'));var Mustache=require(_0x2e0d('0x5'));var util=require('util');var path=require(_0x2e0d('0x6'));var sox=require(_0x2e0d('0x7'));var csv=require('to-csv');var ejs=require(_0x2e0d('0x8'));var fs=require('fs');var fs_extra=require(_0x2e0d('0x9'));var _=require('lodash');var squel=require(_0x2e0d('0xa'));var crypto=require(_0x2e0d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e0d('0xc'));var querystring=require(_0x2e0d('0xd'));var Papa=require(_0x2e0d('0xe'));var Redis=require('ioredis');var authService=require(_0x2e0d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e0d('0x10'));var logger=require(_0x2e0d('0x11'))(_0x2e0d('0x12'));var utils=require(_0x2e0d('0x13'));var config=require(_0x2e0d('0x14'));var licenseUtil=require(_0x2e0d('0x15'));var db=require(_0x2e0d('0x16'))['db'];config['redis']=_[_0x2e0d('0x17')](config[_0x2e0d('0x18')],{'host':_0x2e0d('0x19'),'port':0x18eb});var socket=require(_0x2e0d('0x1a'))(new Redis(config[_0x2e0d('0x18')]));require(_0x2e0d('0x1b'))[_0x2e0d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2e0d('0x1d')][_0x2e0d('0x1e')]({'port':0x232c});var client9002=jayson[_0x2e0d('0x1d')][_0x2e0d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x12b41b,_0xdc2bdb,_0x46aabb,_0x3fd2ef){return new BPromise(function(_0xd3648f,_0x2f93db){var _0x2330ec=_0x3fd2ef||client;return _0x2330ec['request'](_0x12b41b,_0x46aabb)[_0x2e0d('0x1f')](function(_0x1a560a){logger['info'](_0x2e0d('0x20'),_0xdc2bdb,_0x2e0d('0x21'));logger['debug'](_0x2e0d('0x22'),_0xdc2bdb,'request\x20sent',JSON['stringify'](_0x1a560a));if(_0x1a560a[_0x2e0d('0x23')]){if(_0x1a560a[_0x2e0d('0x23')][_0x2e0d('0x24')]===0x1f4){logger[_0x2e0d('0x23')](_0x2e0d('0x20'),_0xdc2bdb,_0x1a560a[_0x2e0d('0x23')][_0x2e0d('0x25')]);return _0x2f93db(_0x1a560a[_0x2e0d('0x23')][_0x2e0d('0x25')]);}logger[_0x2e0d('0x23')](_0x2e0d('0x20'),_0xdc2bdb,_0x1a560a[_0x2e0d('0x23')][_0x2e0d('0x25')]);return _0xd3648f(_0x1a560a[_0x2e0d('0x23')]['message']);}else{logger[_0x2e0d('0x26')](_0x2e0d('0x20'),_0xdc2bdb,_0x2e0d('0x21'));_0xd3648f(_0x1a560a['result'][_0x2e0d('0x25')]);}})[_0x2e0d('0x27')](function(_0x3ab33e){logger['error'](_0x2e0d('0x20'),_0xdc2bdb,_0x3ab33e);_0x2f93db(_0x3ab33e);});});}function respondWithStatusCode(_0x40ee59,_0x549d1e){_0x549d1e=_0x549d1e||0xcc;return function(_0x5f2e44){if(_0x5f2e44){return _0x40ee59[_0x2e0d('0x28')](_0x549d1e);}return _0x40ee59['status'](_0x549d1e)[_0x2e0d('0x29')]();};}function respondWithResult(_0x7e1c0a,_0x1706f5){_0x1706f5=_0x1706f5||0xc8;return function(_0x52967c){if(_0x52967c){return _0x7e1c0a[_0x2e0d('0x2a')](_0x1706f5)['json'](_0x52967c);}};}function respondWithFilteredResult(_0x509ba8,_0x300d11){return function(_0x353853){if(_0x353853){var _0x3b33b5=typeof _0x300d11['offset']===_0x2e0d('0x2b')&&typeof _0x300d11[_0x2e0d('0x2c')]===_0x2e0d('0x2b');var _0x4dec3f=_0x353853[_0x2e0d('0x2d')];var _0x31a284=_0x3b33b5?0x0:_0x300d11[_0x2e0d('0x2e')];var _0x419f32=_0x3b33b5?_0x353853[_0x2e0d('0x2d')]:_0x300d11[_0x2e0d('0x2e')]+_0x300d11['limit'];var _0x8a3f91;if(_0x419f32>=_0x4dec3f){_0x419f32=_0x4dec3f;_0x8a3f91=0xc8;}else{_0x8a3f91=0xce;}_0x509ba8[_0x2e0d('0x2a')](_0x8a3f91);return _0x509ba8[_0x2e0d('0x2f')](_0x2e0d('0x30'),_0x31a284+'-'+_0x419f32+'/'+_0x4dec3f)[_0x2e0d('0x31')](_0x353853);}return null;};}function patchUpdates(_0x6c86b1){return function(_0x40b374){try{jsonpatch['apply'](_0x40b374,_0x6c86b1,!![]);}catch(_0x354444){return BPromise[_0x2e0d('0x32')](_0x354444);}return _0x40b374[_0x2e0d('0x33')]();};}function saveUpdates(_0x5db6a1,_0x5a1f2e){return function(_0x1688a5){if(_0x1688a5){return _0x1688a5[_0x2e0d('0x34')](_0x5db6a1)[_0x2e0d('0x1f')](function(_0x22d5cf){return _0x22d5cf;});}return null;};}function removeEntity(_0x327b39,_0x161130){return function(_0x348120){if(_0x348120){return _0x348120['destroy']()['then'](function(){_0x327b39[_0x2e0d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31912b,_0x2eab81){return function(_0x102386){if(!_0x102386){_0x31912b['sendStatus'](0x194);}return _0x102386;};}function handleError(_0x209cbc,_0x3a3d86){_0x3a3d86=_0x3a3d86||0x1f4;return function(_0x4ebaa1){logger[_0x2e0d('0x23')](_0x4ebaa1[_0x2e0d('0x35')]);if(_0x4ebaa1[_0x2e0d('0x36')]){delete _0x4ebaa1[_0x2e0d('0x36')];}_0x209cbc[_0x2e0d('0x2a')](_0x3a3d86)[_0x2e0d('0x37')](_0x4ebaa1);};}exports[_0x2e0d('0x38')]=function(_0x69ba6f,_0x4bd2cb){var _0x49a72e={},_0x3e7eba={},_0x4287ae={'count':0x0,'rows':[]};var _0x4268b3=_[_0x2e0d('0x39')](db[_0x2e0d('0x3a')][_0x2e0d('0x3b')],function(_0x5be685){return{'name':_0x5be685[_0x2e0d('0x3c')],'type':_0x5be685[_0x2e0d('0x3d')]['key']};});_0x3e7eba['model']=_[_0x2e0d('0x39')](_0x4268b3,_0x2e0d('0x36'));_0x3e7eba[_0x2e0d('0x3e')]=_['keys'](_0x69ba6f[_0x2e0d('0x3e')]);_0x3e7eba[_0x2e0d('0x3f')]=_[_0x2e0d('0x40')](_0x3e7eba[_0x2e0d('0x41')],_0x3e7eba[_0x2e0d('0x3e')]);_0x49a72e['attributes']=_['intersection'](_0x3e7eba['model'],qs['fields'](_0x69ba6f[_0x2e0d('0x3e')][_0x2e0d('0x42')]));_0x49a72e[_0x2e0d('0x43')]=_0x49a72e[_0x2e0d('0x43')][_0x2e0d('0x44')]?_0x49a72e[_0x2e0d('0x43')]:_0x3e7eba[_0x2e0d('0x41')];if(!_0x69ba6f[_0x2e0d('0x3e')][_0x2e0d('0x45')](_0x2e0d('0x46'))){_0x49a72e[_0x2e0d('0x2c')]=qs[_0x2e0d('0x2c')](_0x69ba6f[_0x2e0d('0x3e')][_0x2e0d('0x2c')]);_0x49a72e[_0x2e0d('0x2e')]=qs[_0x2e0d('0x2e')](_0x69ba6f[_0x2e0d('0x3e')]['offset']);}_0x49a72e['order']=qs[_0x2e0d('0x47')](_0x69ba6f[_0x2e0d('0x3e')]['sort']);_0x49a72e[_0x2e0d('0x48')]=qs[_0x2e0d('0x3f')](_['pick'](_0x69ba6f[_0x2e0d('0x3e')],_0x3e7eba[_0x2e0d('0x3f')]),_0x4268b3);if(_0x69ba6f[_0x2e0d('0x3e')][_0x2e0d('0x49')]){_0x49a72e['where']=_['merge'](_0x49a72e[_0x2e0d('0x48')],{'$or':_[_0x2e0d('0x39')](_0x4268b3,function(_0x441947){if(_0x441947[_0x2e0d('0x3d')]!=='VIRTUAL'){var _0x1cd50f={};_0x1cd50f[_0x441947[_0x2e0d('0x36')]]={'$like':'%'+_0x69ba6f[_0x2e0d('0x3e')][_0x2e0d('0x49')]+'%'};return _0x1cd50f;}})});}_0x49a72e=_['merge']({},_0x49a72e,_0x69ba6f[_0x2e0d('0x4a')]);var _0x40af5f={'where':_0x49a72e[_0x2e0d('0x48')]};return db[_0x2e0d('0x3a')]['count'](_0x40af5f)[_0x2e0d('0x1f')](function(_0x14652f){_0x4287ae['count']=_0x14652f;if(_0x69ba6f['query']['includeAll']){_0x49a72e['include']=[{'all':!![]}];}return db[_0x2e0d('0x3a')][_0x2e0d('0x4b')](_0x49a72e);})['then'](function(_0xd35a18){_0x4287ae['rows']=_0xd35a18;return _0x4287ae;})[_0x2e0d('0x1f')](respondWithFilteredResult(_0x4bd2cb,_0x49a72e))[_0x2e0d('0x27')](handleError(_0x4bd2cb,null));};exports[_0x2e0d('0x4c')]=function(_0x4ae784,_0x139fdc){var _0x178ad9={'raw':!![],'where':{'id':_0x4ae784[_0x2e0d('0x4d')]['id']}},_0x1298c3={};_0x1298c3[_0x2e0d('0x41')]=_[_0x2e0d('0x4e')](db[_0x2e0d('0x3a')][_0x2e0d('0x3b')]);_0x1298c3['query']=_[_0x2e0d('0x4e')](_0x4ae784['query']);_0x1298c3[_0x2e0d('0x3f')]=_[_0x2e0d('0x40')](_0x1298c3[_0x2e0d('0x41')],_0x1298c3['query']);_0x178ad9['attributes']=_['intersection'](_0x1298c3[_0x2e0d('0x41')],qs['fields'](_0x4ae784[_0x2e0d('0x3e')]['fields']));_0x178ad9[_0x2e0d('0x43')]=_0x178ad9[_0x2e0d('0x43')]['length']?_0x178ad9[_0x2e0d('0x43')]:_0x1298c3[_0x2e0d('0x41')];if(_0x4ae784[_0x2e0d('0x3e')][_0x2e0d('0x4f')]){_0x178ad9[_0x2e0d('0x50')]=[{'all':!![]}];}_0x178ad9=_[_0x2e0d('0x51')]({},_0x178ad9,_0x4ae784[_0x2e0d('0x4a')]);return db[_0x2e0d('0x3a')][_0x2e0d('0x52')](_0x178ad9)['then'](handleEntityNotFound(_0x139fdc,null))[_0x2e0d('0x1f')](respondWithResult(_0x139fdc,null))[_0x2e0d('0x27')](handleError(_0x139fdc,null));};exports[_0x2e0d('0x53')]=function(_0x2979ae,_0x3747a9){return db['WhatsappMessage'][_0x2e0d('0x53')](_0x2979ae[_0x2e0d('0x54')],{})[_0x2e0d('0x1f')](respondWithResult(_0x3747a9,0xc9))[_0x2e0d('0x27')](handleError(_0x3747a9,null));};exports[_0x2e0d('0x34')]=function(_0x4f679e,_0x2dc618){if(_0x4f679e[_0x2e0d('0x54')]['id']){delete _0x4f679e[_0x2e0d('0x54')]['id'];}return db[_0x2e0d('0x3a')][_0x2e0d('0x52')]({'where':{'id':_0x4f679e[_0x2e0d('0x4d')]['id']}})[_0x2e0d('0x1f')](handleEntityNotFound(_0x2dc618,null))[_0x2e0d('0x1f')](saveUpdates(_0x4f679e[_0x2e0d('0x54')],null))[_0x2e0d('0x1f')](respondWithResult(_0x2dc618,null))[_0x2e0d('0x27')](handleError(_0x2dc618,null));};exports['destroy']=function(_0x49dd33,_0x31a295){return db['WhatsappMessage'][_0x2e0d('0x52')]({'where':{'id':_0x49dd33[_0x2e0d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31a295,null))['then'](removeEntity(_0x31a295,null))[_0x2e0d('0x27')](handleError(_0x31a295,null));};exports[_0x2e0d('0x55')]=function(_0x1d7d90,_0x748cc4){return db[_0x2e0d('0x3a')][_0x2e0d('0x55')]()[_0x2e0d('0x1f')](respondWithResult(_0x748cc4,null))[_0x2e0d('0x27')](handleError(_0x748cc4,null));};var interaction_log=require(_0x2e0d('0x11'))(_0x2e0d('0x56'));exports[_0x2e0d('0x57')]=function(_0x46b494,_0x520364,_0x14826c){var _0xd4b851={'agent':{},'channel':'whatsapp'};if(_0x46b494['body']['id']){delete _0x46b494['body']['id'];}_0x46b494[_0x2e0d('0x54')]['read']=!![];_0x46b494[_0x2e0d('0x54')]['readAt']=moment()[_0x2e0d('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x59')]=_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x59')]||_0x46b494[_0x2e0d('0x5a')]['id'];_0xd4b851[_0x2e0d('0x5b')]['id']=_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x59')];return db[_0x2e0d('0x3a')]['find']({'where':{'id':_0x46b494[_0x2e0d('0x4d')]['id'],'UserId':null}})[_0x2e0d('0x1f')](handleEntityNotFound(_0x520364,null))[_0x2e0d('0x1f')](saveUpdates(_0x46b494[_0x2e0d('0x54')],null))[_0x2e0d('0x1f')](function(_0x5e3001){if(_0x5e3001){_0xd4b851[_0x2e0d('0x25')]=_0x5e3001['get']({'plain':!![]});return db['WhatsappInteraction'][_0x2e0d('0x52')]({'where':{'id':_0x5e3001['WhatsappInteractionId']}});}return null;})[_0x2e0d('0x1f')](handleEntityNotFound(_0x520364,null))['then'](function(_0x368462){if(_0x368462){return _0x368462['update']({'UserId':_0x46b494['body'][_0x2e0d('0x59')],'read1stAt':_['isNil'](_0x368462[_0x2e0d('0x5c')])?moment()[_0x2e0d('0x58')](_0x2e0d('0x5d')):undefined});}return null;})[_0x2e0d('0x1f')](function(_0x26223a){if(_0x26223a){_0xd4b851[_0x2e0d('0x5e')]=_0x26223a[_0x2e0d('0x5f')]({'plain':!![]});interaction_log[_0x2e0d('0x26')](_0x2e0d('0x60'),_0x46b494[_0x2e0d('0x5a')]['id'],_0x46b494['user']['name'],_0x46b494[_0x2e0d('0x5a')]['role'],_0xd4b851['interaction']['id'],_0x46b494[_0x2e0d('0x54')]?JSON[_0x2e0d('0x61')](_0x46b494[_0x2e0d('0x54')]):_0x2e0d('0x62'));return respondWithRpcPromise(_0x2e0d('0x63'),_0x2e0d('0x64'),_0xd4b851);}return null;})[_0x2e0d('0x1f')](function(_0x3c925e){var _0x252b5b=_0x2e0d('0x65')+_0x3c925e[_0x2e0d('0x25')][_0x2e0d('0x66')];return db['sequelize'][_0x2e0d('0x3e')](_0x252b5b,{'type':db[_0x2e0d('0x67')]['QueryTypes'][_0x2e0d('0x68')],'raw':!![]})[_0x2e0d('0x1f')](function(_0xa42681){return _0xa42681;});})[_0x2e0d('0x1f')](function(_0x598758){if(_0x598758){_0xd4b851['message']['contact']=_0x598758[0x0];if(!_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x59')])return;return db[_0x2e0d('0x69')][_0x2e0d('0x52')]({'where':{'id':_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x59')],'role':_0x2e0d('0x5b')},'attributes':['id',_0x2e0d('0x36'),_0x2e0d('0x6a'),'email','internal'],'raw':!![]});}return null;})[_0x2e0d('0x1f')](function(_0x2b270c){if(!_0x2b270c)return null;_0xd4b851[_0x2e0d('0x25')]['agent']=_0x2b270c;return _0xd4b851;})[_0x2e0d('0x1f')](function(_0x4b6b5b){if(_0x4b6b5b){if(_0x46b494[_0x2e0d('0x54')][_0x2e0d('0x6b')]){_0xd4b851[_0x2e0d('0x25')][_0x2e0d('0x6c')]=util[_0x2e0d('0x58')](_0x2e0d('0x6d'),_0x46b494[_0x2e0d('0x5a')][_0x2e0d('0x36')]);_0xd4b851[_0x2e0d('0x25')][_0x2e0d('0x6e')]=_0xd4b851[_0x2e0d('0x6e')];_0xd4b851[_0x2e0d('0x25')][_0x2e0d('0x6f')]=_0xd4b851[_0x2e0d('0x6e')];_0xd4b851['message'][_0x2e0d('0x70')]=_0x2e0d('0x57');return respondWithRpcPromise(_0x2e0d('0x71'),_0x2e0d('0x71'),{'event':_0x2e0d('0x72'),'message':_0xd4b851[_0x2e0d('0x25')]},client9002)[_0x2e0d('0x1f')](function(){return _0xd4b851;});}return _0xd4b851;}return null;})[_0x2e0d('0x1f')](respondWithResult(_0x520364,null))[_0x2e0d('0x27')](handleError(_0x520364,null));};var interaction_log=require(_0x2e0d('0x11'))(_0x2e0d('0x56'));exports[_0x2e0d('0x32')]=function(_0x44f850,_0x200932,_0x527529){var _0x10817c={'agent':{},'channel':_0x2e0d('0x73')};if(_0x44f850[_0x2e0d('0x54')]['id']){delete _0x44f850['body']['id'];}_0x44f850[_0x2e0d('0x54')][_0x2e0d('0x59')]=_0x44f850[_0x2e0d('0x54')][_0x2e0d('0x59')]||_0x44f850['user']['id'];_0x10817c[_0x2e0d('0x5b')]['id']=_0x44f850[_0x2e0d('0x54')][_0x2e0d('0x59')];return db[_0x2e0d('0x3a')][_0x2e0d('0x52')]({'where':{'id':_0x44f850[_0x2e0d('0x4d')]['id'],'UserId':null}})[_0x2e0d('0x1f')](handleEntityNotFound(_0x200932,null))[_0x2e0d('0x1f')](function(_0x54fdf4){if(_0x54fdf4){_0x10817c[_0x2e0d('0x25')]=_0x54fdf4[_0x2e0d('0x5f')]({'plain':!![]});return db[_0x2e0d('0x74')][_0x2e0d('0x52')]({'where':{'id':_0x54fdf4[_0x2e0d('0x75')]}});}return null;})['then'](handleEntityNotFound(_0x200932,null))[_0x2e0d('0x1f')](function(_0xb8c19a){if(_0xb8c19a){_0x10817c[_0x2e0d('0x5e')]=_0xb8c19a[_0x2e0d('0x5f')]({'plain':!![]});interaction_log[_0x2e0d('0x26')](_0x2e0d('0x76'),_0x44f850[_0x2e0d('0x5a')]['id'],_0x44f850[_0x2e0d('0x5a')]['name'],_0x44f850[_0x2e0d('0x5a')][_0x2e0d('0x77')],_0x10817c[_0x2e0d('0x5e')]['id'],_0x44f850['body']?JSON[_0x2e0d('0x61')](_0x44f850[_0x2e0d('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0x2e0d('0x78'),_0x10817c);}return null;})[_0x2e0d('0x1f')](function(_0x336956){var _0x5aa026=_0x2e0d('0x65')+_0x336956[_0x2e0d('0x25')][_0x2e0d('0x66')];return db[_0x2e0d('0x79')][_0x2e0d('0x3e')](_0x5aa026,{'type':db[_0x2e0d('0x67')]['QueryTypes'][_0x2e0d('0x68')],'raw':!![]})['then'](function(_0x1d0107){return _0x1d0107;});})[_0x2e0d('0x1f')](function(_0x46c5a0){if(_0x46c5a0){_0x10817c[_0x2e0d('0x25')]['contact']=_0x46c5a0[0x0];if(!_0x44f850[_0x2e0d('0x54')][_0x2e0d('0x59')])return;return db[_0x2e0d('0x69')][_0x2e0d('0x52')]({'where':{'id':_0x44f850[_0x2e0d('0x54')][_0x2e0d('0x59')],'role':_0x2e0d('0x5b')},'attributes':['id',_0x2e0d('0x36'),_0x2e0d('0x6a'),'email','internal'],'raw':!![]});}return null;})[_0x2e0d('0x1f')](function(_0x471085){if(!_0x471085)return null;_0x10817c[_0x2e0d('0x25')][_0x2e0d('0x5b')]=_0x471085;return _0x10817c;})['then'](function(_0x420efb){if(_0x420efb){_0x420efb[_0x2e0d('0x25')][_0x2e0d('0x6c')]=util[_0x2e0d('0x58')](_0x2e0d('0x6d'),_0x44f850['user'][_0x2e0d('0x36')]);_0x420efb[_0x2e0d('0x25')][_0x2e0d('0x6e')]=_0x10817c[_0x2e0d('0x6e')];_0x420efb[_0x2e0d('0x25')][_0x2e0d('0x6f')]=_0x10817c[_0x2e0d('0x6e')];_0x420efb[_0x2e0d('0x25')]['event']=_0x2e0d('0x32');respondWithRpcPromise(_0x2e0d('0x71'),'EventManager',{'event':_0x2e0d('0x7a'),'message':_0x420efb[_0x2e0d('0x25')]},client9002);return _0x10817c;}return null;})['then'](respondWithResult(_0x200932,null))['catch'](handleError(_0x200932,null));};exports[_0x2e0d('0x2a')]=function(_0x145ba2,_0x4adf6f,_0x2b5601){if(_0x145ba2[_0x2e0d('0x54')]['id']){delete _0x145ba2[_0x2e0d('0x54')]['id'];}var _0x12e849;return db[_0x2e0d('0x3a')][_0x2e0d('0x52')]({'where':{'id':_0x145ba2[_0x2e0d('0x4d')]['id']}})[_0x2e0d('0x1f')](handleEntityNotFound(_0x4adf6f,null))['then'](function(_0x5381fd){if(_0x5381fd){_0x12e849=_0x5381fd;return db[_0x2e0d('0x7b')][_0x2e0d('0x52')]({'where':{'id':_0x5381fd[_0x2e0d('0x7c')]}});}})['then'](handleEntityNotFound(_0x4adf6f,null))[_0x2e0d('0x1f')](function(_0x596338){if(_0x596338){logger[_0x2e0d('0x7d')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x2e0d('0x2a'),_0x2e0d('0x7e'),_0x596338[_0x2e0d('0x3d')],util['inspect'](_0x145ba2['body'],{'showHidden':![],'depth':null}));switch(_0x596338[_0x2e0d('0x3d')]){case _0x2e0d('0x7f'):if(_0x145ba2[_0x2e0d('0x54')][_0x2e0d('0x80')]&&_0x145ba2[_0x2e0d('0x54')][_0x2e0d('0x80')]===_0x12e849[_0x2e0d('0x81')]&&_0x145ba2['body']['MessageStatus']&&_0x145ba2[_0x2e0d('0x54')]['MessageStatus']==='read'){return _0x12e849[_0x2e0d('0x34')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2e0d('0x2a'),_0x2e0d('0x7f'),util['inspect'](_0x145ba2[_0x2e0d('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x12e849;}})[_0x2e0d('0x1f')](respondWithResult(_0x4adf6f,null))[_0x2e0d('0x27')](handleError(_0x4adf6f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 78b747c..17708c1 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 _0x9348=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0xe0a91d,_0x7e8612){var _0x22d42b=function(_0x3ccce1){while(--_0x3ccce1){_0xe0a91d['push'](_0xe0a91d['shift']());}};_0x22d42b(++_0x7e8612);}(_0x9348,0x10d));var _0x8934=function(_0xd53fc0,_0xd7b394){_0xd53fc0=_0xd53fc0-0x0;var _0x44b9b5=_0x9348[_0xd53fc0];return _0x44b9b5;};'use strict';var EventEmitter=require(_0x8934('0x0'));var WhatsappMessage=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){WhatsappMessageEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);WhatsappMessageEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];WhatsappMessage[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xae60=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','save','update'];(function(_0x568e00,_0x1aa062){var _0x1c40bd=function(_0x512f8b){while(--_0x512f8b){_0x568e00['push'](_0x568e00['shift']());}};_0x1c40bd(++_0x1aa062);}(_0xae60,0x1c7));var _0x0ae6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xae60[_0x24f31b];return _0x488401;};'use strict';var EventEmitter=require(_0x0ae6('0x0'));var WhatsappMessage=require(_0x0ae6('0x1'))['db'][_0x0ae6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ae6('0x3'),'afterUpdate':_0x0ae6('0x4'),'afterDestroy':_0x0ae6('0x5')};function emitEvent(_0x568a7f){return function(_0x4c014f,_0x470e83,_0x47c9e0){WhatsappMessageEvents[_0x0ae6('0x6')](_0x568a7f+':'+_0x4c014f['id'],_0x4c014f);WhatsappMessageEvents[_0x0ae6('0x6')](_0x568a7f,_0x4c014f);_0x47c9e0(null);};}for(var e in events){if(events[_0x0ae6('0x7')](e)){var event=events[e];WhatsappMessage[_0x0ae6('0x8')](e,emitEvent(event));}}module[_0x0ae6('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7680cc0..2ce56a9 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 _0x9ac9=['then','update','createdAt','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','baseUrl','/whatsapp/v1/','/messages/','Bearer\x20','application/json','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','findOne','WhatsappInteractionId'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x9ac9,0x1b9));var _0x99ac=function(_0x5dc4b1,_0x428e4d){_0x5dc4b1=_0x5dc4b1-0x0;var _0x578ca5=_0x9ac9[_0x5dc4b1];return _0x578ca5;};'use strict';var _=require(_0x99ac('0x0'));var util=require('util');var logger=require(_0x99ac('0x1'))(_0x99ac('0x2'));var moment=require(_0x99ac('0x3'));var BPromise=require(_0x99ac('0x4'));var rp=require('request-promise');var fetch=require(_0x99ac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99ac('0x6'));var config=require(_0x99ac('0x7'));var attributes=require(_0x99ac('0x8'));module[_0x99ac('0x9')]=function(_0x2cfb38,_0x1811ea){return _0x2cfb38[_0x99ac('0xa')]('WhatsappMessage',attributes,{'tableName':_0x99ac('0xb'),'paranoid':![],'indexes':[{'name':_0x99ac('0xc'),'fields':[_0x99ac('0xc')]},{'name':_0x99ac('0xd'),'fields':[_0x99ac('0xe')],'type':_0x99ac('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58032a,_0x1b2fc5,_0x570899){var _0x2f7f90=_0x2cfb38[_0x99ac('0x10')];var _0x579ee4=_0x58032a['get']({'plain':!![]});if(_0x579ee4[_0x99ac('0x11')][_0x99ac('0x12')]()==='in'||_0x579ee4['direction'][_0x99ac('0x12')]()===_0x99ac('0x13')&&!_0x579ee4['secret']&&!_[_0x99ac('0x14')](_0x579ee4['UserId'])){_0x2f7f90['WhatsappInteraction'][_0x99ac('0x15')]({'where':{'id':_0x579ee4[_0x99ac('0x16')]}})[_0x99ac('0x17')](function(_0x5210e5){if(_0x5210e5){_0x5210e5[_0x99ac('0x18')]({'lastMsgAt':_0x579ee4[_0x99ac('0x19')],'lastMsgDirection':_0x579ee4['direction']['toLowerCase']()});}})['catch'](function(_0x1a2032){console['error'](_0x1a2032);});}if(_0x579ee4['direction']==='out'&&!_0x579ee4['secret']){var _0xf33478;_0x2f7f90[_0x99ac('0x1a')]['find']({'where':{'id':_0x579ee4[_0x99ac('0x1b')]},'raw':!![]})['then'](function(_0x3b390b){_0xf33478=_0x3b390b;if(_0xf33478&&_0xf33478[_0x99ac('0x1c')]){switch(_0xf33478['type']){case _0x99ac('0x1d'):var _0x1e2087=require(_0x99ac('0x1d'));if(_0xf33478['accountSid']&&_0xf33478[_0x99ac('0x1e')]&&_0xf33478[_0x99ac('0x1f')]){var _0x25c7eb=new _0x1e2087(_0xf33478['accountSid'],_0xf33478[_0x99ac('0x1e')]);_0x25c7eb[_0x99ac('0x20')][_0x99ac('0x21')]({'body':_0x579ee4[_0x99ac('0xe')],'to':_0x99ac('0x22')+_0x579ee4[_0x99ac('0x1f')],'from':'whatsapp:'+_0xf33478[_0x99ac('0x1f')],'statusCallback':_0xf33478[_0x99ac('0x23')]+_0x99ac('0x24')+_0x579ee4['id']+_0x99ac('0x25')+_0xf33478[_0x99ac('0x26')]})[_0x99ac('0x17')](function(_0x4c4f0d){if(_0x4c4f0d[_0x99ac('0x27')]){return _0x58032a['update']({'messageId':_0x4c4f0d[_0x99ac('0x27')]});}})[_0x99ac('0x28')](function(_0x3c8b14){logger[_0x99ac('0x29')](_0x99ac('0x2a'),_0x99ac('0x2b'),_0x99ac('0x1d'),util[_0x99ac('0x2c')](_0x3c8b14,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x99ac('0x2a'),_0x99ac('0x2b'),'twilio',_0x99ac('0x2d'));}break;case _0x99ac('0x2e'):var _0x266a79=_0xf33478[_0x99ac('0x2f')];var _0x204c3c=_0xf33478['authToken'];var _0x47ab9c=_0xf33478[_0x99ac('0x30')]+_0x99ac('0x31')+_0x266a79+_0x99ac('0x32');var _0x4fcb7c={'to':[_0x579ee4['phone']],'message':{'type':'text','text':_0x579ee4[_0x99ac('0xe')]}};var _0x5b35ae={'method':'POST','uri':_0x47ab9c,'headers':{'Authorization':_0x99ac('0x33')+_0x204c3c,'Content-Type':_0x99ac('0x34')},'body':_0x4fcb7c,'json':!![]};rp(_0x5b35ae)[_0x99ac('0x17')](function(_0x536c60){if(_0x536c60[_0x99ac('0x35')][0x0]['message_id']){return _0x58032a['update']({'messageId':_0x536c60['statuses'][0x0]['message_id']});}})[_0x99ac('0x28')](function(_0x151e38){logger[_0x99ac('0x36')](_0x99ac('0x37'),_0x151e38);});break;}}})[_0x99ac('0x38')](function(){_0x570899();});}else{_0x570899();}}},'charset':_0x99ac('0x39'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1420=['path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/status?token=','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch'];(function(_0x22be2d,_0x1d136e){var _0x5ef601=function(_0xfd4c09){while(--_0xfd4c09){_0x22be2d['push'](_0x22be2d['shift']());}};_0x5ef601(++_0x1d136e);}(_0x1420,0xb0));var _0x0142=function(_0x2e608c,_0x4a804d){_0x2e608c=_0x2e608c-0x0;var _0x259bf3=_0x1420[_0x2e608c];return _0x259bf3;};'use strict';var _=require('lodash');var util=require(_0x0142('0x0'));var logger=require(_0x0142('0x1'))(_0x0142('0x2'));var moment=require(_0x0142('0x3'));var BPromise=require(_0x0142('0x4'));var rp=require(_0x0142('0x5'));var fetch=require(_0x0142('0x6'));var fs=require('fs');var path=require(_0x0142('0x7'));var rimraf=require(_0x0142('0x8'));var config=require(_0x0142('0x9'));var attributes=require(_0x0142('0xa'));module['exports']=function(_0x3fd25e,_0x5a1f8b){return _0x3fd25e[_0x0142('0xb')](_0x0142('0xc'),attributes,{'tableName':_0x0142('0xd'),'paranoid':![],'indexes':[{'name':_0x0142('0xe'),'fields':[_0x0142('0xe')]},{'name':_0x0142('0xf'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4af365,_0x241201,_0x4c5e7b){var _0x28a32c=_0x3fd25e[_0x0142('0x10')];var _0x396f77=_0x4af365[_0x0142('0x11')]({'plain':!![]});if(_0x396f77['direction'][_0x0142('0x12')]()==='in'||_0x396f77[_0x0142('0x13')][_0x0142('0x12')]()===_0x0142('0x14')&&!_0x396f77[_0x0142('0x15')]&&!_[_0x0142('0x16')](_0x396f77[_0x0142('0x17')])){_0x28a32c[_0x0142('0x18')][_0x0142('0x19')]({'where':{'id':_0x396f77[_0x0142('0x1a')]}})['then'](function(_0x4d78da){if(_0x4d78da){_0x4d78da[_0x0142('0x1b')]({'lastMsgAt':_0x396f77[_0x0142('0x1c')],'lastMsgDirection':_0x396f77[_0x0142('0x13')]['toLowerCase']()});}})[_0x0142('0x1d')](function(_0x42a367){console[_0x0142('0x1e')](_0x42a367);});}if(_0x396f77[_0x0142('0x13')]===_0x0142('0x14')&&!_0x396f77[_0x0142('0x15')]){var _0x5bd6ec;_0x28a32c[_0x0142('0x1f')][_0x0142('0x20')]({'where':{'id':_0x396f77[_0x0142('0x21')]},'raw':!![]})['then'](function(_0x2a8c56){_0x5bd6ec=_0x2a8c56;if(_0x5bd6ec&&_0x5bd6ec['type']){switch(_0x5bd6ec[_0x0142('0x22')]){case'twilio':var _0xf6bc12=require(_0x0142('0x23'));if(_0x5bd6ec[_0x0142('0x24')]&&_0x5bd6ec[_0x0142('0x25')]&&_0x5bd6ec[_0x0142('0x26')]){var _0x42210a=new _0xf6bc12(_0x5bd6ec[_0x0142('0x24')],_0x5bd6ec[_0x0142('0x25')]);_0x42210a[_0x0142('0x27')]['create']({'body':_0x396f77[_0x0142('0x28')],'to':'whatsapp:'+_0x396f77[_0x0142('0x26')],'from':_0x0142('0x29')+_0x5bd6ec['phone'],'statusCallback':_0x5bd6ec[_0x0142('0x2a')]+'/api/whatsapp/messages/'+_0x396f77['id']+_0x0142('0x2b')+_0x5bd6ec[_0x0142('0x2c')]})[_0x0142('0x2d')](function(_0x912d43){if(_0x912d43[_0x0142('0x2e')]){return _0x4af365[_0x0142('0x1b')]({'messageId':_0x912d43[_0x0142('0x2e')]});}})['catch'](function(_0x302ecb){logger[_0x0142('0x1e')](_0x0142('0x2f'),_0x0142('0x30'),_0x0142('0x23'),util[_0x0142('0x31')](_0x302ecb,{'showHidden':![],'depth':null}));});}else{logger[_0x0142('0x1e')](_0x0142('0x2f'),_0x0142('0x30'),_0x0142('0x23'),_0x0142('0x32'));}break;case'sinch':var _0x2f996c=_0x5bd6ec[_0x0142('0x24')];var _0x8099e8=_0x5bd6ec[_0x0142('0x25')];var _0x41bbf9=_0x5bd6ec['baseUrl']+'/whatsapp/v1/'+_0x2f996c+_0x0142('0x33');var _0x4e3499={'to':[_0x396f77[_0x0142('0x26')]],'message':{'type':_0x0142('0x34'),'text':_0x396f77[_0x0142('0x28')]}};var _0x4db49b={'method':_0x0142('0x35'),'uri':_0x41bbf9,'headers':{'Authorization':_0x0142('0x36')+_0x8099e8,'Content-Type':_0x0142('0x37')},'body':_0x4e3499,'json':!![]};rp(_0x4db49b)[_0x0142('0x2d')](function(_0x1d3739){if(_0x1d3739[_0x0142('0x38')][0x0][_0x0142('0x39')]){return _0x4af365['update']({'messageId':_0x1d3739['statuses'][0x0][_0x0142('0x39')]});}})[_0x0142('0x1d')](function(_0x2d5b49){logger[_0x0142('0x3a')](_0x0142('0x3b'),_0x2d5b49);});break;}}})['finally'](function(){_0x4c5e7b();});}else{_0x4c5e7b();}}},'charset':_0x0142('0x3c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index fb42744..76a0956 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 _0x7137=['CreateWhatsappMessage','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7137,0x155));var _0x7713=function(_0xf403e0,_0x186e0d){_0xf403e0=_0xf403e0-0x0;var _0x3c959c=_0x7137[_0xf403e0];return _0x3c959c;};'use strict';var _=require(_0x7713('0x0'));var util=require(_0x7713('0x1'));var moment=require(_0x7713('0x2'));var BPromise=require('bluebird');var rs=require(_0x7713('0x3'));var fs=require('fs');var Redis=require(_0x7713('0x4'));var db=require(_0x7713('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7713('0x6'))(_0x7713('0x7'));var config=require('../../config/environment');var jayson=require(_0x7713('0x8'));var client=jayson[_0x7713('0x9')]['http']({'port':0x232a});config[_0x7713('0xa')]=_['defaults'](config[_0x7713('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7713('0xb'))(new Redis(config[_0x7713('0xa')]));require(_0x7713('0xc'))['register'](socket);function respondWithRpcPromise(_0x4921c6,_0x18b7d1,_0x27e9a8){return new BPromise(function(_0x49878d,_0x518429){return client[_0x7713('0xd')](_0x4921c6,_0x27e9a8)[_0x7713('0xe')](function(_0x5e908b){logger[_0x7713('0xf')](_0x7713('0x10'),_0x18b7d1,'request\x20sent');logger['debug'](_0x7713('0x11'),_0x18b7d1,'request\x20sent',JSON['stringify'](_0x5e908b));if(_0x5e908b[_0x7713('0x12')]){if(_0x5e908b[_0x7713('0x12')][_0x7713('0x13')]===0x1f4){logger[_0x7713('0x12')](_0x7713('0x10'),_0x18b7d1,_0x5e908b[_0x7713('0x12')][_0x7713('0x14')]);return _0x518429(_0x5e908b['error']['message']);}logger['error'](_0x7713('0x10'),_0x18b7d1,_0x5e908b[_0x7713('0x12')][_0x7713('0x14')]);return _0x49878d(_0x5e908b[_0x7713('0x12')]['message']);}else{logger[_0x7713('0xf')](_0x7713('0x10'),_0x18b7d1,_0x7713('0x15'));_0x49878d(_0x5e908b['result'][_0x7713('0x14')]);}})[_0x7713('0x16')](function(_0x57c2d4){logger['error'](_0x7713('0x10'),_0x18b7d1,_0x57c2d4);_0x518429(_0x57c2d4);});});}exports[_0x7713('0x17')]=function(_0x287b11){var _0x3f8211=this;return new Promise(function(_0x316440,_0x1564c0){return db['WhatsappMessage'][_0x7713('0x18')](_0x287b11[_0x7713('0x19')],{'raw':_0x287b11[_0x7713('0x1a')]?_0x287b11[_0x7713('0x1a')][_0x7713('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1993da){logger[_0x7713('0xf')](_0x7713('0x17'),_0x287b11);logger['debug']('CreateWhatsappMessage',_0x287b11,JSON['stringify'](_0x1993da));_0x316440(_0x1993da);})[_0x7713('0x16')](function(_0x1f5f3b){logger[_0x7713('0x12')](_0x7713('0x17'),_0x1f5f3b[_0x7713('0x14')],_0x287b11);_0x1564c0(_0x3f8211['error'](0x1f4,_0x1f5f3b['message']));});});}; \ No newline at end of file +var _0xd5ec=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateWhatsappMessage','body','options','raw','util','moment','randomstring','ioredis','rpc'];(function(_0x5c2218,_0x389976){var _0x54758e=function(_0x161ce7){while(--_0x161ce7){_0x5c2218['push'](_0x5c2218['shift']());}};_0x54758e(++_0x389976);}(_0xd5ec,0x12f));var _0xcd5e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xd5ec[_0x386c3e];return _0x4b8e13;};'use strict';var _=require('lodash');var util=require(_0xcd5e('0x0'));var moment=require(_0xcd5e('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd5e('0x2'));var fs=require('fs');var Redis=require(_0xcd5e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd5e('0x4'));var config=require('../../config/environment');var jayson=require(_0xcd5e('0x5'));var client=jayson[_0xcd5e('0x6')][_0xcd5e('0x7')]({'port':0x232a});config[_0xcd5e('0x8')]=_[_0xcd5e('0x9')](config[_0xcd5e('0x8')],{'host':_0xcd5e('0xa'),'port':0x18eb});var socket=require(_0xcd5e('0xb'))(new Redis(config['redis']));require(_0xcd5e('0xc'))[_0xcd5e('0xd')](socket);function respondWithRpcPromise(_0x4513cc,_0x5ec9de,_0x3122e7){return new BPromise(function(_0x8f8e12,_0x198198){return client[_0xcd5e('0xe')](_0x4513cc,_0x3122e7)[_0xcd5e('0xf')](function(_0x5cc63d){logger[_0xcd5e('0x10')](_0xcd5e('0x11'),_0x5ec9de,_0xcd5e('0x12'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5ec9de,_0xcd5e('0x12'),JSON['stringify'](_0x5cc63d));if(_0x5cc63d['error']){if(_0x5cc63d[_0xcd5e('0x13')][_0xcd5e('0x14')]===0x1f4){logger['error'](_0xcd5e('0x11'),_0x5ec9de,_0x5cc63d['error'][_0xcd5e('0x15')]);return _0x198198(_0x5cc63d[_0xcd5e('0x13')][_0xcd5e('0x15')]);}logger['error'](_0xcd5e('0x11'),_0x5ec9de,_0x5cc63d['error']['message']);return _0x8f8e12(_0x5cc63d[_0xcd5e('0x13')][_0xcd5e('0x15')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5ec9de,'request\x20sent');_0x8f8e12(_0x5cc63d[_0xcd5e('0x16')][_0xcd5e('0x15')]);}})[_0xcd5e('0x17')](function(_0x5e8674){logger[_0xcd5e('0x13')](_0xcd5e('0x11'),_0x5ec9de,_0x5e8674);_0x198198(_0x5e8674);});});}exports[_0xcd5e('0x18')]=function(_0x2afc49){var _0x5f587d=this;return new Promise(function(_0xc0078b,_0x50f58a){return db['WhatsappMessage']['create'](_0x2afc49[_0xcd5e('0x19')],{'raw':_0x2afc49['options']?_0x2afc49[_0xcd5e('0x1a')][_0xcd5e('0x1b')]===undefined?!![]:![]:!![]})[_0xcd5e('0xf')](function(_0x277f3d){logger['info'](_0xcd5e('0x18'),_0x2afc49);logger['debug'](_0xcd5e('0x18'),_0x2afc49,JSON['stringify'](_0x277f3d));_0xc0078b(_0x277f3d);})['catch'](function(_0x2c6a0f){logger[_0xcd5e('0x13')](_0xcd5e('0x18'),_0x2c6a0f[_0xcd5e('0x15')],_0x2afc49);_0x50f58a(_0x5f587d[_0xcd5e('0x13')](0x1f4,_0x2c6a0f[_0xcd5e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 3288566..293123a 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 _0xc73a=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','update'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0xc73a,0x155));var _0xac73=function(_0x336b95,_0x1f88aa){_0x336b95=_0x336b95-0x0;var _0x3e1c3d=_0xc73a[_0x336b95];return _0x3e1c3d;};'use strict';var WhatsappMessageEvents=require(_0xac73('0x0'));var events=[_0xac73('0x1'),'remove',_0xac73('0x2')];function createListener(_0xe626b9,_0x5ab288){return function(_0x72df12){_0x5ab288[_0xac73('0x3')](_0xe626b9,_0x72df12);};}function removeListener(_0x3ea726,_0x27eda4){return function(){WhatsappMessageEvents[_0xac73('0x4')](_0x3ea726,_0x27eda4);};}exports[_0xac73('0x5')]=function(_0x133556){for(var _0x39a3fa=0x0,_0x2dc0ea=events[_0xac73('0x6')];_0x39a3fa<_0x2dc0ea;_0x39a3fa++){var _0x46810d=events[_0x39a3fa];var _0x35475a=createListener(_0xac73('0x7')+_0x46810d,_0x133556);WhatsappMessageEvents['on'](_0x46810d,_0x35475a);}}; \ No newline at end of file +var _0x38e6=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x40617f,_0xa6db){var _0x3a62da=function(_0x5dde42){while(--_0x5dde42){_0x40617f['push'](_0x40617f['shift']());}};_0x3a62da(++_0xa6db);}(_0x38e6,0x89));var _0x638e=function(_0x2bd02c,_0x3f708c){_0x2bd02c=_0x2bd02c-0x0;var _0xa4ed4=_0x38e6[_0x2bd02c];return _0xa4ed4;};'use strict';var WhatsappMessageEvents=require(_0x638e('0x0'));var events=[_0x638e('0x1'),_0x638e('0x2'),'update'];function createListener(_0x598d49,_0x4fbbfe){return function(_0x2d3005){_0x4fbbfe['emit'](_0x598d49,_0x2d3005);};}function removeListener(_0x4f3b9f,_0x2269b4){return function(){WhatsappMessageEvents[_0x638e('0x3')](_0x4f3b9f,_0x2269b4);};}exports[_0x638e('0x4')]=function(_0xa9091d){for(var _0x2bc82c=0x0,_0x4f8c6f=events[_0x638e('0x5')];_0x2bc82c<_0x4f8c6f;_0x2bc82c++){var _0x5ee5d3=events[_0x2bc82c];var _0x3e2971=createListener(_0x638e('0x6')+_0x5ee5d3,_0xa9091d);WhatsappMessageEvents['on'](_0x5ee5d3,_0x3e2971);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b56d4da..c98b197 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 _0xa4e2=['delete','removeTeams','removeAgents','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','destroy'];(function(_0x5a17a8,_0x4314c3){var _0x414682=function(_0x5bf08f){while(--_0x5bf08f){_0x5a17a8['push'](_0x5a17a8['shift']());}};_0x414682(++_0x4314c3);}(_0xa4e2,0x1c3));var _0x2a4e=function(_0x1c7005,_0x22c793){_0x1c7005=_0x1c7005-0x0;var _0x1d5753=_0xa4e2[_0x1c7005];return _0x1d5753;};'use strict';var multer=require(_0x2a4e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a4e('0x1'));var express=require(_0x2a4e('0x2'));var router=express[_0x2a4e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2a4e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2a4e('0x5'));var controller=require(_0x2a4e('0x6'));router[_0x2a4e('0x7')]('/',auth['isAuthenticated'](),controller[_0x2a4e('0x8')]);router[_0x2a4e('0x7')](_0x2a4e('0x9'),auth['isAuthenticated'](),controller[_0x2a4e('0xa')]);router[_0x2a4e('0x7')](_0x2a4e('0xb'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0xd')]);router[_0x2a4e('0x7')]('/:id/members',auth[_0x2a4e('0xc')](),controller[_0x2a4e('0xe')]);router[_0x2a4e('0x7')](_0x2a4e('0xf'),auth['isAuthenticated'](),controller[_0x2a4e('0x10')]);router[_0x2a4e('0x7')](_0x2a4e('0x11'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x12')]);router['post']('/',auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x13')]);router[_0x2a4e('0x14')]('/:id/teams',auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x15')]);router[_0x2a4e('0x14')](_0x2a4e('0x11'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x16')]);router['put'](_0x2a4e('0xb'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x17')]);router['delete'](_0x2a4e('0xb'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x18')]);router[_0x2a4e('0x19')](_0x2a4e('0xf'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x1a')]);router['delete'](_0x2a4e('0x11'),auth[_0x2a4e('0xc')](),controller[_0x2a4e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x7784=['delete','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','update','destroy'];(function(_0x48d557,_0x5b7af0){var _0x5b8824=function(_0x55930f){while(--_0x55930f){_0x48d557['push'](_0x48d557['shift']());}};_0x5b8824(++_0x5b7af0);}(_0x7784,0xd4));var _0x4778=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7784[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x4778('0x0'));var path=require('path');var timeout=require(_0x4778('0x1'));var express=require(_0x4778('0x2'));var router=express[_0x4778('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4778('0x4'));var interaction=require(_0x4778('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4778('0x6')](_0x4778('0x7'),auth[_0x4778('0x8')](),controller[_0x4778('0x9')]);router[_0x4778('0x6')](_0x4778('0xa'),auth['isAuthenticated'](),controller[_0x4778('0xb')]);router[_0x4778('0x6')](_0x4778('0xc'),auth[_0x4778('0x8')](),controller[_0x4778('0xd')]);router[_0x4778('0x6')](_0x4778('0xe'),auth[_0x4778('0x8')](),controller[_0x4778('0xf')]);router['get'](_0x4778('0x10'),auth[_0x4778('0x8')](),controller[_0x4778('0x11')]);router[_0x4778('0x12')]('/',auth[_0x4778('0x8')](),controller['create']);router['post'](_0x4778('0xe'),auth[_0x4778('0x8')](),controller['addTeams']);router[_0x4778('0x12')](_0x4778('0x10'),auth[_0x4778('0x8')](),controller['addAgents']);router[_0x4778('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4778('0x14')]);router['delete'](_0x4778('0xa'),auth[_0x4778('0x8')](),controller[_0x4778('0x15')]);router[_0x4778('0x16')](_0x4778('0xe'),auth[_0x4778('0x8')](),controller[_0x4778('0x17')]);router[_0x4778('0x16')](_0x4778('0x10'),auth[_0x4778('0x8')](),controller[_0x4778('0x18')]);module[_0x4778('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 751ec60..59f19b4 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 _0x0bb5=['sequelize','exports','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0bb5,0x148));var _0x50bb=function(_0x4ed6b4,_0x435f95){_0x4ed6b4=_0x4ed6b4-0x0;var _0xfea0e8=_0x0bb5[_0x4ed6b4];return _0xfea0e8;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x50bb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x50bb('0x3')](_0x50bb('0x4'),_0x50bb('0x5'),_0x50bb('0x6'))},'description':{'type':Sequelize[_0x50bb('0x7')]}}; \ No newline at end of file +var _0x31c2=['INTEGER','rrmemory','beepall','roundrobin','STRING','sequelize','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x31c2,0x98));var _0x231c=function(_0x18b7ab,_0x51ae03){_0x18b7ab=_0x18b7ab-0x0;var _0x7f6092=_0x31c2[_0x18b7ab];return _0x7f6092;};'use strict';var Sequelize=require(_0x231c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x231c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x231c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x231c('0x3'),_0x231c('0x4'),_0x231c('0x5'))},'description':{'type':Sequelize[_0x231c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index cf3dbee..3a00108 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 _0x97f7=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','User','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','WhatsappQueues','UserProfileResource','then','stack','name','send','index','map','WhatsappQueue','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x97f7,0x16f));var _0x797f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97f7[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x797f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x797f('0x1'));var rp=require(_0x797f('0x2'));var moment=require(_0x797f('0x3'));var BPromise=require(_0x797f('0x4'));var Mustache=require(_0x797f('0x5'));var util=require(_0x797f('0x6'));var path=require(_0x797f('0x7'));var sox=require(_0x797f('0x8'));var csv=require(_0x797f('0x9'));var ejs=require(_0x797f('0xa'));var fs=require('fs');var fs_extra=require(_0x797f('0xb'));var _=require(_0x797f('0xc'));var squel=require(_0x797f('0xd'));var crypto=require(_0x797f('0xe'));var jsforce=require(_0x797f('0xf'));var deskjs=require(_0x797f('0x10'));var toCsv=require(_0x797f('0x9'));var querystring=require(_0x797f('0x11'));var Papa=require(_0x797f('0x12'));var Redis=require(_0x797f('0x13'));var authService=require(_0x797f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x797f('0x15'));var hardwareService=require(_0x797f('0x16'));var logger=require(_0x797f('0x17'))(_0x797f('0x18'));var utils=require('../../config/utils');var config=require(_0x797f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x797f('0x1a'))['db'];config[_0x797f('0x1b')]=_[_0x797f('0x1c')](config[_0x797f('0x1b')],{'host':_0x797f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x797f('0x1e'))[_0x797f('0x1f')](socket);function respondWithStatusCode(_0x321206,_0x437ff9){_0x437ff9=_0x437ff9||0xcc;return function(_0x4fe57a){if(_0x4fe57a){return _0x321206[_0x797f('0x20')](_0x437ff9);}return _0x321206[_0x797f('0x21')](_0x437ff9)[_0x797f('0x22')]();};}function respondWithResult(_0x43c5ea,_0x36f278){_0x36f278=_0x36f278||0xc8;return function(_0x4dc1e1){if(_0x4dc1e1){return _0x43c5ea[_0x797f('0x21')](_0x36f278)[_0x797f('0x23')](_0x4dc1e1);}};}function respondWithFilteredResult(_0x3964f9,_0x228c99){return function(_0x53527b){if(_0x53527b){var _0x5b60e5=typeof _0x228c99[_0x797f('0x24')]==='undefined'&&typeof _0x228c99[_0x797f('0x25')]===_0x797f('0x26');var _0x40e4a0=_0x53527b[_0x797f('0x27')];var _0x30852b=_0x5b60e5?0x0:_0x228c99[_0x797f('0x24')];var _0x2a334c=_0x5b60e5?_0x53527b['count']:_0x228c99[_0x797f('0x24')]+_0x228c99['limit'];var _0x53c2b8;if(_0x2a334c>=_0x40e4a0){_0x2a334c=_0x40e4a0;_0x53c2b8=0xc8;}else{_0x53c2b8=0xce;}_0x3964f9[_0x797f('0x21')](_0x53c2b8);return _0x3964f9[_0x797f('0x28')](_0x797f('0x29'),_0x30852b+'-'+_0x2a334c+'/'+_0x40e4a0)[_0x797f('0x23')](_0x53527b);}return null;};}function patchUpdates(_0x21d534){return function(_0x4ac062){try{jsonpatch['apply'](_0x4ac062,_0x21d534,!![]);}catch(_0x5ee999){return BPromise[_0x797f('0x2a')](_0x5ee999);}return _0x4ac062[_0x797f('0x2b')]();};}function saveUpdates(_0x3ba503,_0x372437){return function(_0x474b92){if(_0x474b92){return _0x474b92[_0x797f('0x2c')](_0x3ba503)['then'](function(_0x2bb7a6){return _0x2bb7a6;});}return null;};}function removeEntity(_0x4ba3fe,_0x129394){return function(_0x460494){if(_0x460494){return _0x460494[_0x797f('0x2d')]()['then'](function(){var _0x137406=_0x460494[_0x797f('0x2e')]({'plain':!![]});var _0x5e5c64=_0x797f('0x2f');return db[_0x797f('0x30')][_0x797f('0x2d')]({'where':{'type':_0x5e5c64,'resourceId':_0x137406['id']}})[_0x797f('0x31')](function(){return _0x460494;});})['then'](function(){_0x4ba3fe[_0x797f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a690,_0x4c77b1){return function(_0x54a785){if(!_0x54a785){_0x25a690[_0x797f('0x20')](0x194);}return _0x54a785;};}function handleError(_0x1f8beb,_0x524750){_0x524750=_0x524750||0x1f4;return function(_0x1b0e15){logger['error'](_0x1b0e15[_0x797f('0x32')]);if(_0x1b0e15['name']){delete _0x1b0e15[_0x797f('0x33')];}_0x1f8beb['status'](_0x524750)[_0x797f('0x34')](_0x1b0e15);};}exports[_0x797f('0x35')]=function(_0x1fd9dc,_0x5546db){var _0x129d15={},_0x4993f6={},_0x52102d={'count':0x0,'rows':[]};var _0x4e26ee=_[_0x797f('0x36')](db[_0x797f('0x37')]['rawAttributes'],function(_0x3a1809){return{'name':_0x3a1809['fieldName'],'type':_0x3a1809[_0x797f('0x38')][_0x797f('0x39')]};});_0x4993f6[_0x797f('0x3a')]=_[_0x797f('0x36')](_0x4e26ee,_0x797f('0x33'));_0x4993f6[_0x797f('0x3b')]=_[_0x797f('0x3c')](_0x1fd9dc[_0x797f('0x3b')]);_0x4993f6[_0x797f('0x3d')]=_[_0x797f('0x3e')](_0x4993f6[_0x797f('0x3a')],_0x4993f6[_0x797f('0x3b')]);_0x129d15['attributes']=_['intersection'](_0x4993f6[_0x797f('0x3a')],qs['fields'](_0x1fd9dc['query'][_0x797f('0x3f')]));_0x129d15[_0x797f('0x40')]=_0x129d15[_0x797f('0x40')]['length']?_0x129d15[_0x797f('0x40')]:_0x4993f6['model'];if(!_0x1fd9dc[_0x797f('0x3b')][_0x797f('0x41')](_0x797f('0x42'))){_0x129d15[_0x797f('0x25')]=qs[_0x797f('0x25')](_0x1fd9dc['query']['limit']);_0x129d15['offset']=qs['offset'](_0x1fd9dc['query']['offset']);}_0x129d15[_0x797f('0x43')]=qs[_0x797f('0x44')](_0x1fd9dc['query'][_0x797f('0x44')]);_0x129d15[_0x797f('0x45')]=qs[_0x797f('0x3d')](_[_0x797f('0x46')](_0x1fd9dc[_0x797f('0x3b')],_0x4993f6[_0x797f('0x3d')]),_0x4e26ee);if(_0x1fd9dc[_0x797f('0x3b')][_0x797f('0x47')]){_0x129d15['where']=_[_0x797f('0x48')](_0x129d15[_0x797f('0x45')],{'$or':_[_0x797f('0x36')](_0x4e26ee,function(_0x4cee1e){if(_0x4cee1e[_0x797f('0x38')]!==_0x797f('0x49')){var _0x3ef69c={};_0x3ef69c[_0x4cee1e['name']]={'$like':'%'+_0x1fd9dc[_0x797f('0x3b')][_0x797f('0x47')]+'%'};return _0x3ef69c;}})});}_0x129d15=_[_0x797f('0x48')]({},_0x129d15,_0x1fd9dc[_0x797f('0x4a')]);var _0x171250={'where':_0x129d15[_0x797f('0x45')]};return db[_0x797f('0x37')][_0x797f('0x27')](_0x171250)['then'](function(_0x56aa2b){_0x52102d['count']=_0x56aa2b;if(_0x1fd9dc['query']['includeAll']){_0x129d15[_0x797f('0x4b')]=[{'all':!![]}];}return db[_0x797f('0x37')][_0x797f('0x4c')](_0x129d15);})[_0x797f('0x31')](function(_0x5f2289){_0x52102d[_0x797f('0x4d')]=_0x5f2289;return _0x52102d;})[_0x797f('0x31')](respondWithFilteredResult(_0x5546db,_0x129d15))[_0x797f('0x4e')](handleError(_0x5546db,null));};exports[_0x797f('0x4f')]=function(_0x3bf52d,_0x11b540){var _0x52caf4={'raw':!![],'where':{'id':_0x3bf52d[_0x797f('0x50')]['id']}},_0x3756b0={};_0x3756b0['model']=_[_0x797f('0x3c')](db[_0x797f('0x37')][_0x797f('0x51')]);_0x3756b0['query']=_[_0x797f('0x3c')](_0x3bf52d[_0x797f('0x3b')]);_0x3756b0['filters']=_[_0x797f('0x3e')](_0x3756b0[_0x797f('0x3a')],_0x3756b0[_0x797f('0x3b')]);_0x52caf4['attributes']=_[_0x797f('0x3e')](_0x3756b0[_0x797f('0x3a')],qs[_0x797f('0x3f')](_0x3bf52d[_0x797f('0x3b')][_0x797f('0x3f')]));_0x52caf4[_0x797f('0x40')]=_0x52caf4['attributes'][_0x797f('0x52')]?_0x52caf4['attributes']:_0x3756b0[_0x797f('0x3a')];if(_0x3bf52d['query'][_0x797f('0x53')]){_0x52caf4['include']=[{'all':!![]}];}_0x52caf4=_[_0x797f('0x48')]({},_0x52caf4,_0x3bf52d['options']);return db[_0x797f('0x37')][_0x797f('0x54')](_0x52caf4)[_0x797f('0x31')](handleEntityNotFound(_0x11b540,null))['then'](respondWithResult(_0x11b540,null))['catch'](handleError(_0x11b540,null));};exports[_0x797f('0x55')]=function(_0x2c02f7,_0x4eedf6){return db[_0x797f('0x37')][_0x797f('0x55')](_0x2c02f7[_0x797f('0x56')],{})[_0x797f('0x31')](function(_0x35700c){var _0x4ff594=_0x2c02f7[_0x797f('0x57')][_0x797f('0x2e')]({'plain':!![]});if(!_0x4ff594)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ff594[_0x797f('0x58')]===_0x797f('0x57')){var _0x5dd1f3=_0x35700c[_0x797f('0x2e')]({'plain':!![]});var _0x5328aa=_0x797f('0x2f');return db[_0x797f('0x59')][_0x797f('0x54')]({'where':{'name':_0x5328aa,'userProfileId':_0x4ff594[_0x797f('0x5a')]},'raw':!![]})[_0x797f('0x31')](function(_0x32aa2f){if(_0x32aa2f&&_0x32aa2f[_0x797f('0x5b')]===0x0){return db[_0x797f('0x30')][_0x797f('0x55')]({'name':_0x5dd1f3[_0x797f('0x33')],'resourceId':_0x5dd1f3['id'],'type':_0x32aa2f[_0x797f('0x33')],'sectionId':_0x32aa2f['id']},{})['then'](function(){return _0x35700c;});}else{return _0x35700c;}})['catch'](function(_0x1ef7d2){logger[_0x797f('0x5c')](_0x797f('0x5d'),_0x1ef7d2);throw _0x1ef7d2;});}return _0x35700c;})['then'](respondWithResult(_0x4eedf6,0xc9))[_0x797f('0x4e')](handleError(_0x4eedf6,null));};exports[_0x797f('0x2c')]=function(_0x24407a,_0x1daa2a){if(_0x24407a[_0x797f('0x56')]['id']){delete _0x24407a['body']['id'];}return db[_0x797f('0x37')][_0x797f('0x54')]({'where':{'id':_0x24407a[_0x797f('0x50')]['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x1daa2a,null))['then'](saveUpdates(_0x24407a[_0x797f('0x56')],null))[_0x797f('0x31')](respondWithResult(_0x1daa2a,null))[_0x797f('0x4e')](handleError(_0x1daa2a,null));};exports[_0x797f('0x2d')]=function(_0x593a65,_0x4fa627){return db[_0x797f('0x37')][_0x797f('0x54')]({'where':{'id':_0x593a65[_0x797f('0x50')]['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x4fa627,null))[_0x797f('0x31')](removeEntity(_0x4fa627,null))[_0x797f('0x4e')](handleError(_0x4fa627,null));};exports['describe']=function(_0x27f188,_0x1fcf08){return db[_0x797f('0x37')]['describe']()[_0x797f('0x31')](respondWithResult(_0x1fcf08,null))[_0x797f('0x4e')](handleError(_0x1fcf08,null));};exports[_0x797f('0x5e')]=function(_0x309746,_0x5e17fe,_0xcf26f5){var _0x4815b3={'raw':!![],'where':{}},_0x21eaf3={},_0x53cbae;return db[_0x797f('0x37')][_0x797f('0x5f')]({'where':{'id':_0x309746[_0x797f('0x50')]['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x5e17fe,null))[_0x797f('0x31')](function(_0x5959e3){if(_0x5959e3){_0x53cbae=_0x5959e3['get']({'plain':!![]});_0x21eaf3[_0x797f('0x3a')]=_['keys'](db[_0x797f('0x60')]['rawAttributes']);_0x21eaf3['query']=_[_0x797f('0x3c')](_0x309746[_0x797f('0x3b')]);_0x21eaf3[_0x797f('0x3d')]=_[_0x797f('0x3e')](_0x21eaf3[_0x797f('0x3a')],_0x21eaf3[_0x797f('0x3b')]);_0x4815b3['attributes']=_['intersection'](_0x21eaf3[_0x797f('0x3a')],qs[_0x797f('0x3f')](_0x309746[_0x797f('0x3b')][_0x797f('0x3f')]));_0x4815b3[_0x797f('0x40')]=_0x4815b3[_0x797f('0x40')][_0x797f('0x52')]?_0x4815b3[_0x797f('0x40')]:_0x21eaf3[_0x797f('0x3a')];if(!_0x309746[_0x797f('0x3b')]['hasOwnProperty']('nolimit')){_0x4815b3[_0x797f('0x25')]=qs['limit'](_0x309746[_0x797f('0x3b')][_0x797f('0x25')]);_0x4815b3['offset']=qs['offset'](_0x309746[_0x797f('0x3b')][_0x797f('0x24')]);}_0x4815b3[_0x797f('0x43')]=qs[_0x797f('0x44')](_0x309746[_0x797f('0x3b')][_0x797f('0x44')]);_0x4815b3['where']=qs[_0x797f('0x3d')](_[_0x797f('0x46')](_0x309746[_0x797f('0x3b')],_0x21eaf3[_0x797f('0x3d')]));_0x4815b3[_0x797f('0x45')][_0x797f('0x61')]=_0x5959e3['id'];if(_0x309746[_0x797f('0x3b')][_0x797f('0x47')]){_0x4815b3['where']=_[_0x797f('0x48')](_0x4815b3['where'],{'$or':_[_0x797f('0x36')](_0x4815b3[_0x797f('0x40')],function(_0x5275d6){var _0x5d9306={};_0x5d9306[_0x5275d6]={'$like':'%'+_0x309746['query'][_0x797f('0x47')]+'%'};return _0x5d9306;})});}_0x4815b3=_[_0x797f('0x48')]({},_0x4815b3,_0x309746[_0x797f('0x4a')]);return db[_0x797f('0x60')][_0x797f('0x4c')](_0x4815b3);}})[_0x797f('0x31')](function(_0x35972f){if(_0x35972f){return db['User'][_0x797f('0x62')]({'where':{'id':_['map'](_0x35972f,_0x797f('0x63')),'role':_0x797f('0x64')},'attributes':['id','name',_0x797f('0x65'),_0x797f('0x66'),_0x797f('0x67')]});}})['then'](function(_0x66c870){if(_0x66c870){return{'count':_0x66c870[_0x797f('0x27')],'rows':_[_0x797f('0x36')](_0x66c870[_0x797f('0x4d')],function(_0x589889){return{'membername':_0x589889[_0x797f('0x33')],'UserId':_0x589889['id'],'queue_name':_0x53cbae[_0x797f('0x33')],'WhatsappQueueId':_0x53cbae['id'],'interface':util['format']('%s/%s',_0x797f('0x68'),_0x589889[_0x797f('0x33')]),'penalty':0x0,'paused':_0x589889['whatsappPause'],'createdAt':_0x589889[_0x797f('0x67')],'updatedAt':_0x589889[_0x797f('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x797f('0x31')](respondWithFilteredResult(_0x5e17fe,_0x4815b3))[_0x797f('0x4e')](handleError(_0x5e17fe,null));};exports[_0x797f('0x69')]=function(_0x1f96ef,_0x229614,_0x329ac8){var _0x964ce9={};var _0x5eb975={};var _0x3aaf8a;var _0x52d449;return db[_0x797f('0x37')]['findOne']({'where':{'id':_0x1f96ef['params']['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x229614,null))[_0x797f('0x31')](function(_0x1ef6fa){if(_0x1ef6fa){_0x3aaf8a=_0x1ef6fa;_0x5eb975[_0x797f('0x3a')]=_[_0x797f('0x3c')](db[_0x797f('0x6a')]['rawAttributes']);_0x5eb975[_0x797f('0x3b')]=_[_0x797f('0x3c')](_0x1f96ef[_0x797f('0x3b')]);_0x5eb975[_0x797f('0x3d')]=_[_0x797f('0x3e')](_0x5eb975[_0x797f('0x3a')],_0x5eb975[_0x797f('0x3b')]);_0x964ce9['attributes']=_[_0x797f('0x3e')](_0x5eb975[_0x797f('0x3a')],qs['fields'](_0x1f96ef[_0x797f('0x3b')][_0x797f('0x3f')]));_0x964ce9[_0x797f('0x40')]=_0x964ce9[_0x797f('0x40')]['length']?_0x964ce9[_0x797f('0x40')]:_0x5eb975[_0x797f('0x3a')];_0x964ce9[_0x797f('0x43')]=qs[_0x797f('0x44')](_0x1f96ef[_0x797f('0x3b')][_0x797f('0x44')]);_0x964ce9[_0x797f('0x45')]=qs['filters'](_[_0x797f('0x46')](_0x1f96ef[_0x797f('0x3b')],_0x5eb975['filters']));if(_0x1f96ef[_0x797f('0x3b')]['filter']){_0x964ce9['where']=_[_0x797f('0x48')](_0x964ce9['where'],{'$or':_[_0x797f('0x36')](_0x964ce9['attributes'],function(_0x40fdf1){var _0x2bcc80={};_0x2bcc80[_0x40fdf1]={'$like':'%'+_0x1f96ef[_0x797f('0x3b')]['filter']+'%'};return _0x2bcc80;})});}_0x964ce9=_[_0x797f('0x48')]({},_0x964ce9,_0x1f96ef['options']);return _0x3aaf8a[_0x797f('0x69')](_0x964ce9);}})[_0x797f('0x31')](function(_0x58f9ad){if(_0x58f9ad){_0x52d449=_0x58f9ad[_0x797f('0x52')];if(!_0x1f96ef[_0x797f('0x3b')]['hasOwnProperty'](_0x797f('0x42'))){_0x964ce9[_0x797f('0x25')]=qs[_0x797f('0x25')](_0x1f96ef[_0x797f('0x3b')][_0x797f('0x25')]);_0x964ce9[_0x797f('0x24')]=qs[_0x797f('0x24')](_0x1f96ef[_0x797f('0x3b')][_0x797f('0x24')]);}return _0x3aaf8a['getTeams'](_0x964ce9);}})[_0x797f('0x31')](function(_0x2c41be){if(_0x2c41be){return _0x2c41be?{'count':_0x52d449,'rows':_0x2c41be}:null;}})[_0x797f('0x31')](respondWithResult(_0x229614,null))[_0x797f('0x4e')](handleError(_0x229614,null));};exports[_0x797f('0x6b')]=function(_0x47b36c,_0x746033,_0x39608c){var _0x48cddd=_0x47b36c['body'][_0x797f('0x6c')];return db[_0x797f('0x6a')]['findAll']({'where':{'id':_0x48cddd},'attributes':['id'],'include':[{'model':db['User'],'as':_0x797f('0x6d'),'attributes':['id',_0x797f('0x33'),'online',_0x797f('0x6e'),_0x797f('0x6f')],'raw':!![]}]})[_0x797f('0x31')](function(_0x4118d6){if(_0x4118d6){var _0x23340e=_[_0x797f('0x70')](_0x4118d6,function(_0x4166fb){var _0x3c9491=_0x4166fb['get']({'plain':!![]});return _0x3c9491[_0x797f('0x6d')];});return db[_0x797f('0x37')]['find']({'where':{'id':_0x47b36c['params']['id']}})['then'](function(_0x51ea0a){return db[_0x797f('0x71')][_0x797f('0x72')](function(_0x330a06){return _0x51ea0a['addTeams'](_0x48cddd,{'transaction':_0x330a06})['then'](function(){return BPromise[_0x797f('0x73')](_0x23340e,function(_0x648493){return db[_0x797f('0x60')][_0x797f('0x74')]({'where':{'UserId':_0x648493['id'],'WhatsappQueueId':_0x47b36c[_0x797f('0x50')]['id']},'transaction':_0x330a06});});})[_0x797f('0x31')](function(){_0x23340e[_0x797f('0x75')](function(_0x578d53){socket[_0x797f('0x76')](_0x797f('0x77'),{'UserId':_0x578d53['id'],'WhatsappQueueId':_0x51ea0a['id']});});});});});}})[_0x797f('0x31')](respondWithStatusCode(_0x746033,null))['catch'](handleError(_0x746033,null));};exports[_0x797f('0x78')]=function(_0x95b326,_0x508f49,_0x295852){return db[_0x797f('0x6a')]['findAll']({'where':{'id':_0x95b326['query'][_0x797f('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x797f('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x797f('0x31')](handleEntityNotFound(_0x508f49,null))[_0x797f('0x31')](function(_0x3363c9){var _0x28ba48=_[_0x797f('0x36')](_0x3363c9,'id');var _0x1a5948=[];var _0x36a9f6=[];var _0x7fe076=squel['select']();_0x7fe076[_0x797f('0x7a')](_0x797f('0x7b'))[_0x797f('0x7c')](_0x797f('0x7d'),'tq')[_0x797f('0x7e')]('user_has_teams','ut',_0x797f('0x7f'))['where'](_0x797f('0x80'),_0x95b326[_0x797f('0x50')]['id']);for(var _0x453340=0x0;_0x453340<_0x3363c9[_0x797f('0x52')];_0x453340+=0x1){let _0x72a189=_0x3363c9[_0x453340];for(var _0x12aa5b=0x0;_0x12aa5b<_0x72a189[_0x797f('0x6d')]['length'];_0x12aa5b+=0x1){let _0x50bf3f=_0x72a189[_0x797f('0x6d')][_0x12aa5b];var _0x3966f5=_0x7fe076[_0x797f('0x81')]();_0x3966f5[_0x797f('0x45')](_0x797f('0x82'),_0x50bf3f['id']);_0x36a9f6['push'](db[_0x797f('0x71')][_0x797f('0x3b')](_0x3966f5[_0x797f('0x83')](),{'type':db[_0x797f('0x71')]['QueryTypes'][_0x797f('0x84')]})[_0x797f('0x31')](function(_0x1fb726){if(_0x1fb726[_0x797f('0x52')]===0x1){return _0x50bf3f['id'];}else{var _0xac99=_[_0x797f('0x85')](_[_0x797f('0x36')](_0x1fb726,_0x797f('0x86')),function(_0x1399b3){return _['includes'](_0x28ba48,_0x1399b3);});if(_0xac99){return _0x50bf3f['id'];}}}));}}return BPromise[_0x797f('0x87')](_0x36a9f6)[_0x797f('0x31')](function(_0x1a24dc){_0x1a5948=_(_0x1a5948)[_0x797f('0x88')](_0x1a24dc)['compact']()['value']();return db['WhatsappQueue'][_0x797f('0x54')]({'where':{'id':_0x95b326['params']['id']}})[_0x797f('0x31')](function(_0x165030){return db['sequelize'][_0x797f('0x72')](function(_0x7d2740){return _0x165030[_0x797f('0x78')](_0x95b326[_0x797f('0x3b')][_0x797f('0x6c')],{'transaction':_0x7d2740})[_0x797f('0x31')](function(){if(!_['isEmpty'](_0x1a5948)){return _0x165030['removeAgents'](_0x1a5948,{'transaction':_0x7d2740});}})['then'](function(){_0x1a5948[_0x797f('0x75')](function(_0x1d7ba4){socket[_0x797f('0x76')](_0x797f('0x89'),{'UserId':_0x1d7ba4,'WhatsappQueueId':_0x165030['id']});});});});});});})[_0x797f('0x31')](respondWithStatusCode(_0x508f49,null))[_0x797f('0x4e')](handleError(_0x508f49,null));};exports[_0x797f('0x8a')]=function(_0x385655,_0x238a07,_0x13240){return db[_0x797f('0x37')]['find']({'where':{'id':_0x385655[_0x797f('0x50')]['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x238a07,null))[_0x797f('0x31')](function(_0x5651b0){if(_0x5651b0){return _0x5651b0[_0x797f('0x8a')](_0x385655[_0x797f('0x56')][_0x797f('0x6c')],_[_0x797f('0x8b')](_0x385655[_0x797f('0x56')],[_0x797f('0x6c'),'id'])||{})[_0x797f('0x8c')](function(_0x2b2354){for(var _0x24b65c=0x0;_0x24b65c<_0x385655[_0x797f('0x56')]['ids'][_0x797f('0x52')];_0x24b65c+=0x1){socket['emit'](_0x797f('0x77'),{'UserId':Number(_0x385655['body'][_0x797f('0x6c')][_0x24b65c]),'WhatsappQueueId':Number(_0x385655['params']['id'])});}return _0x2b2354;});}})[_0x797f('0x31')](respondWithResult(_0x238a07,null))['catch'](handleError(_0x238a07,null));};exports[_0x797f('0x8d')]=function(_0x2253c5,_0x4247c6,_0x17760c){return db[_0x797f('0x37')][_0x797f('0x54')]({'where':{'id':_0x2253c5['params']['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x4247c6,null))[_0x797f('0x31')](function(_0x3a0ea7){if(_0x3a0ea7){return _0x3a0ea7[_0x797f('0x8d')](_0x2253c5[_0x797f('0x3b')]['ids'])[_0x797f('0x31')](function(){if(_[_0x797f('0x8e')](_0x2253c5[_0x797f('0x3b')]['ids'])){for(var _0x31d16b=0x0;_0x31d16b<_0x2253c5[_0x797f('0x3b')][_0x797f('0x6c')]['length'];_0x31d16b+=0x1){socket[_0x797f('0x76')]('userWhatsappQueue:remove',{'UserId':Number(_0x2253c5[_0x797f('0x3b')][_0x797f('0x6c')][_0x31d16b]),'WhatsappQueueId':Number(_0x2253c5[_0x797f('0x50')]['id'])});}}else{socket['emit'](_0x797f('0x89'),{'UserId':Number(_0x2253c5[_0x797f('0x3b')][_0x797f('0x6c')]),'WhatsappQueueId':Number(_0x2253c5[_0x797f('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x4247c6,null))['catch'](handleError(_0x4247c6,null));};exports['getAgents']=function(_0x21892c,_0x4b79aa,_0x45e98f){var _0x13ebbc={};var _0x38d0a4={};var _0x524a77;var _0x52eb2a;return db[_0x797f('0x37')][_0x797f('0x5f')]({'where':{'id':_0x21892c[_0x797f('0x50')]['id']}})[_0x797f('0x31')](handleEntityNotFound(_0x4b79aa,null))[_0x797f('0x31')](function(_0x330b11){if(_0x330b11){_0x524a77=_0x330b11;_0x38d0a4['model']=_[_0x797f('0x3c')](db[_0x797f('0x79')]['rawAttributes']);_0x38d0a4[_0x797f('0x3b')]=_['keys'](_0x21892c[_0x797f('0x3b')]);_0x38d0a4[_0x797f('0x3d')]=_[_0x797f('0x3e')](_0x38d0a4[_0x797f('0x3a')],_0x38d0a4[_0x797f('0x3b')]);_0x13ebbc[_0x797f('0x40')]=_[_0x797f('0x3e')](_0x38d0a4[_0x797f('0x3a')],qs[_0x797f('0x3f')](_0x21892c[_0x797f('0x3b')]['fields']));_0x13ebbc[_0x797f('0x40')]=_0x13ebbc[_0x797f('0x40')][_0x797f('0x52')]?_0x13ebbc[_0x797f('0x40')]:_0x38d0a4[_0x797f('0x3a')];_0x13ebbc[_0x797f('0x43')]=qs[_0x797f('0x44')](_0x21892c[_0x797f('0x3b')][_0x797f('0x44')]);_0x13ebbc[_0x797f('0x45')]=qs[_0x797f('0x3d')](_[_0x797f('0x46')](_0x21892c[_0x797f('0x3b')],_0x38d0a4['filters']));if(_0x21892c[_0x797f('0x3b')][_0x797f('0x47')]){_0x13ebbc[_0x797f('0x45')]=_[_0x797f('0x48')](_0x13ebbc['where'],{'$or':_[_0x797f('0x36')](_0x13ebbc[_0x797f('0x40')],function(_0x3b8519){var _0x122348={};_0x122348[_0x3b8519]={'$like':'%'+_0x21892c[_0x797f('0x3b')]['filter']+'%'};return _0x122348;})});}_0x13ebbc=_[_0x797f('0x48')]({},_0x13ebbc,_0x21892c[_0x797f('0x4a')]);return _0x524a77[_0x797f('0x8f')](_0x13ebbc);}})[_0x797f('0x31')](function(_0x268522){if(_0x268522){_0x52eb2a=_0x268522[_0x797f('0x52')];if(!_0x21892c['query'][_0x797f('0x41')](_0x797f('0x42'))){_0x13ebbc[_0x797f('0x25')]=qs[_0x797f('0x25')](_0x21892c['query']['limit']);_0x13ebbc['offset']=qs[_0x797f('0x24')](_0x21892c[_0x797f('0x3b')][_0x797f('0x24')]);}return _0x524a77[_0x797f('0x8f')](_0x13ebbc);}})['then'](function(_0x57e59a){if(_0x57e59a){return _0x57e59a?{'count':_0x52eb2a,'rows':_0x57e59a}:null;}})[_0x797f('0x31')](respondWithResult(_0x4b79aa,null))[_0x797f('0x4e')](handleError(_0x4b79aa,null));}; \ No newline at end of file +var _0xb6a8=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','map','WhatsappQueue','rawAttributes','query','keys','model','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserWhatsappQueue','nolimit','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','findOne','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','transaction','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x58ca7d,_0x27f5ea){var _0x152c4c=function(_0x1b9c99){while(--_0x1b9c99){_0x58ca7d['push'](_0x58ca7d['shift']());}};_0x152c4c(++_0x27f5ea);}(_0xb6a8,0x1a0));var _0x8b6a=function(_0x2c738c,_0x51dc9c){_0x2c738c=_0x2c738c-0x0;var _0x3f6287=_0xb6a8[_0x2c738c];return _0x3f6287;};'use strict';var emlformat=require(_0x8b6a('0x0'));var rimraf=require(_0x8b6a('0x1'));var zipdir=require(_0x8b6a('0x2'));var jsonpatch=require(_0x8b6a('0x3'));var rp=require('request-promise');var moment=require(_0x8b6a('0x4'));var BPromise=require(_0x8b6a('0x5'));var Mustache=require(_0x8b6a('0x6'));var util=require('util');var path=require(_0x8b6a('0x7'));var sox=require(_0x8b6a('0x8'));var csv=require('to-csv');var ejs=require(_0x8b6a('0x9'));var fs=require('fs');var fs_extra=require(_0x8b6a('0xa'));var _=require(_0x8b6a('0xb'));var squel=require(_0x8b6a('0xc'));var crypto=require(_0x8b6a('0xd'));var jsforce=require(_0x8b6a('0xe'));var deskjs=require(_0x8b6a('0xf'));var toCsv=require(_0x8b6a('0x10'));var querystring=require(_0x8b6a('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b6a('0x12'));var authService=require(_0x8b6a('0x13'));var qs=require(_0x8b6a('0x14'));var as=require(_0x8b6a('0x15'));var hardwareService=require(_0x8b6a('0x16'));var logger=require('../../config/logger')(_0x8b6a('0x17'));var utils=require('../../config/utils');var config=require(_0x8b6a('0x18'));var licenseUtil=require(_0x8b6a('0x19'));var db=require(_0x8b6a('0x1a'))['db'];config[_0x8b6a('0x1b')]=_[_0x8b6a('0x1c')](config[_0x8b6a('0x1b')],{'host':_0x8b6a('0x1d'),'port':0x18eb});var socket=require(_0x8b6a('0x1e'))(new Redis(config[_0x8b6a('0x1b')]));require(_0x8b6a('0x1f'))[_0x8b6a('0x20')](socket);function respondWithStatusCode(_0x81c149,_0x25f924){_0x25f924=_0x25f924||0xcc;return function(_0x6b85ce){if(_0x6b85ce){return _0x81c149[_0x8b6a('0x21')](_0x25f924);}return _0x81c149[_0x8b6a('0x22')](_0x25f924)[_0x8b6a('0x23')]();};}function respondWithResult(_0x6566ca,_0x2191c7){_0x2191c7=_0x2191c7||0xc8;return function(_0x507e62){if(_0x507e62){return _0x6566ca[_0x8b6a('0x22')](_0x2191c7)[_0x8b6a('0x24')](_0x507e62);}};}function respondWithFilteredResult(_0x16c3a7,_0x6d08b4){return function(_0x5db80b){if(_0x5db80b){var _0x3401bd=typeof _0x6d08b4[_0x8b6a('0x25')]==='undefined'&&typeof _0x6d08b4[_0x8b6a('0x26')]===_0x8b6a('0x27');var _0x2cb994=_0x5db80b[_0x8b6a('0x28')];var _0x5004fd=_0x3401bd?0x0:_0x6d08b4[_0x8b6a('0x25')];var _0x3a6109=_0x3401bd?_0x5db80b['count']:_0x6d08b4[_0x8b6a('0x25')]+_0x6d08b4[_0x8b6a('0x26')];var _0xf72f85;if(_0x3a6109>=_0x2cb994){_0x3a6109=_0x2cb994;_0xf72f85=0xc8;}else{_0xf72f85=0xce;}_0x16c3a7['status'](_0xf72f85);return _0x16c3a7['set'](_0x8b6a('0x29'),_0x5004fd+'-'+_0x3a6109+'/'+_0x2cb994)[_0x8b6a('0x24')](_0x5db80b);}return null;};}function patchUpdates(_0x5084f3){return function(_0x5b8ea5){try{jsonpatch['apply'](_0x5b8ea5,_0x5084f3,!![]);}catch(_0x34e048){return BPromise[_0x8b6a('0x2a')](_0x34e048);}return _0x5b8ea5[_0x8b6a('0x2b')]();};}function saveUpdates(_0x2d2272,_0x2c6fa3){return function(_0x312ef3){if(_0x312ef3){return _0x312ef3[_0x8b6a('0x2c')](_0x2d2272)[_0x8b6a('0x2d')](function(_0x1adf73){return _0x1adf73;});}return null;};}function removeEntity(_0x17b02c,_0x409ae3){return function(_0x389c84){if(_0x389c84){return _0x389c84[_0x8b6a('0x2e')]()[_0x8b6a('0x2d')](function(){var _0x3d9029=_0x389c84[_0x8b6a('0x2f')]({'plain':!![]});var _0x2f633f=_0x8b6a('0x30');return db[_0x8b6a('0x31')]['destroy']({'where':{'type':_0x2f633f,'resourceId':_0x3d9029['id']}})[_0x8b6a('0x2d')](function(){return _0x389c84;});})['then'](function(){_0x17b02c['status'](0xcc)[_0x8b6a('0x23')]();});}};}function handleEntityNotFound(_0x260191,_0x4ed1ce){return function(_0x2ea6be){if(!_0x2ea6be){_0x260191[_0x8b6a('0x21')](0x194);}return _0x2ea6be;};}function handleError(_0x42093f,_0x4aa3b8){_0x4aa3b8=_0x4aa3b8||0x1f4;return function(_0x4f6dd4){logger[_0x8b6a('0x32')](_0x4f6dd4[_0x8b6a('0x33')]);if(_0x4f6dd4[_0x8b6a('0x34')]){delete _0x4f6dd4[_0x8b6a('0x34')];}_0x42093f[_0x8b6a('0x22')](_0x4aa3b8)['send'](_0x4f6dd4);};}exports[_0x8b6a('0x35')]=function(_0x1e288b,_0x5dc3e3){var _0x20671f={},_0x5def37={},_0x4f58a6={'count':0x0,'rows':[]};var _0x23525d=_[_0x8b6a('0x36')](db[_0x8b6a('0x37')][_0x8b6a('0x38')],function(_0x267bc7){return{'name':_0x267bc7['fieldName'],'type':_0x267bc7['type']['key']};});_0x5def37['model']=_[_0x8b6a('0x36')](_0x23525d,_0x8b6a('0x34'));_0x5def37[_0x8b6a('0x39')]=_[_0x8b6a('0x3a')](_0x1e288b[_0x8b6a('0x39')]);_0x5def37['filters']=_['intersection'](_0x5def37[_0x8b6a('0x3b')],_0x5def37[_0x8b6a('0x39')]);_0x20671f[_0x8b6a('0x3c')]=_[_0x8b6a('0x3d')](_0x5def37[_0x8b6a('0x3b')],qs['fields'](_0x1e288b[_0x8b6a('0x39')]['fields']));_0x20671f[_0x8b6a('0x3c')]=_0x20671f['attributes'][_0x8b6a('0x3e')]?_0x20671f[_0x8b6a('0x3c')]:_0x5def37[_0x8b6a('0x3b')];if(!_0x1e288b[_0x8b6a('0x39')][_0x8b6a('0x3f')]('nolimit')){_0x20671f[_0x8b6a('0x26')]=qs[_0x8b6a('0x26')](_0x1e288b[_0x8b6a('0x39')]['limit']);_0x20671f['offset']=qs['offset'](_0x1e288b['query'][_0x8b6a('0x25')]);}_0x20671f[_0x8b6a('0x40')]=qs['sort'](_0x1e288b['query'][_0x8b6a('0x41')]);_0x20671f[_0x8b6a('0x42')]=qs[_0x8b6a('0x43')](_[_0x8b6a('0x44')](_0x1e288b[_0x8b6a('0x39')],_0x5def37[_0x8b6a('0x43')]),_0x23525d);if(_0x1e288b[_0x8b6a('0x39')][_0x8b6a('0x45')]){_0x20671f[_0x8b6a('0x42')]=_[_0x8b6a('0x46')](_0x20671f[_0x8b6a('0x42')],{'$or':_['map'](_0x23525d,function(_0xd7a62a){if(_0xd7a62a[_0x8b6a('0x47')]!==_0x8b6a('0x48')){var _0x1c222f={};_0x1c222f[_0xd7a62a[_0x8b6a('0x34')]]={'$like':'%'+_0x1e288b[_0x8b6a('0x39')][_0x8b6a('0x45')]+'%'};return _0x1c222f;}})});}_0x20671f=_[_0x8b6a('0x46')]({},_0x20671f,_0x1e288b[_0x8b6a('0x49')]);var _0x3b5a9a={'where':_0x20671f[_0x8b6a('0x42')]};return db['WhatsappQueue']['count'](_0x3b5a9a)[_0x8b6a('0x2d')](function(_0x2d5b80){_0x4f58a6[_0x8b6a('0x28')]=_0x2d5b80;if(_0x1e288b[_0x8b6a('0x39')]['includeAll']){_0x20671f[_0x8b6a('0x4a')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x8b6a('0x4b')](_0x20671f);})['then'](function(_0x2aad2b){_0x4f58a6[_0x8b6a('0x4c')]=_0x2aad2b;return _0x4f58a6;})[_0x8b6a('0x2d')](respondWithFilteredResult(_0x5dc3e3,_0x20671f))[_0x8b6a('0x4d')](handleError(_0x5dc3e3,null));};exports[_0x8b6a('0x4e')]=function(_0x5451e0,_0x2df141){var _0x12df9b={'raw':!![],'where':{'id':_0x5451e0['params']['id']}},_0x1e1b87={};_0x1e1b87['model']=_[_0x8b6a('0x3a')](db[_0x8b6a('0x37')][_0x8b6a('0x38')]);_0x1e1b87['query']=_[_0x8b6a('0x3a')](_0x5451e0['query']);_0x1e1b87[_0x8b6a('0x43')]=_[_0x8b6a('0x3d')](_0x1e1b87[_0x8b6a('0x3b')],_0x1e1b87[_0x8b6a('0x39')]);_0x12df9b['attributes']=_[_0x8b6a('0x3d')](_0x1e1b87['model'],qs[_0x8b6a('0x4f')](_0x5451e0[_0x8b6a('0x39')][_0x8b6a('0x4f')]));_0x12df9b[_0x8b6a('0x3c')]=_0x12df9b[_0x8b6a('0x3c')][_0x8b6a('0x3e')]?_0x12df9b[_0x8b6a('0x3c')]:_0x1e1b87[_0x8b6a('0x3b')];if(_0x5451e0[_0x8b6a('0x39')]['includeAll']){_0x12df9b[_0x8b6a('0x4a')]=[{'all':!![]}];}_0x12df9b=_['merge']({},_0x12df9b,_0x5451e0[_0x8b6a('0x49')]);return db[_0x8b6a('0x37')][_0x8b6a('0x50')](_0x12df9b)[_0x8b6a('0x2d')](handleEntityNotFound(_0x2df141,null))[_0x8b6a('0x2d')](respondWithResult(_0x2df141,null))[_0x8b6a('0x4d')](handleError(_0x2df141,null));};exports[_0x8b6a('0x51')]=function(_0x560d6c,_0x385780){return db[_0x8b6a('0x37')][_0x8b6a('0x51')](_0x560d6c['body'],{})['then'](function(_0xd63067){var _0x5124d5=_0x560d6c[_0x8b6a('0x52')][_0x8b6a('0x2f')]({'plain':!![]});if(!_0x5124d5)throw new Error(_0x8b6a('0x53'));if(_0x5124d5[_0x8b6a('0x54')]===_0x8b6a('0x52')){var _0x3238fb=_0xd63067['get']({'plain':!![]});var _0xc0aeb=_0x8b6a('0x30');return db[_0x8b6a('0x55')]['find']({'where':{'name':_0xc0aeb,'userProfileId':_0x5124d5[_0x8b6a('0x56')]},'raw':!![]})[_0x8b6a('0x2d')](function(_0xc2e0c3){if(_0xc2e0c3&&_0xc2e0c3[_0x8b6a('0x57')]===0x0){return db[_0x8b6a('0x31')][_0x8b6a('0x51')]({'name':_0x3238fb[_0x8b6a('0x34')],'resourceId':_0x3238fb['id'],'type':_0xc2e0c3['name'],'sectionId':_0xc2e0c3['id']},{})[_0x8b6a('0x2d')](function(){return _0xd63067;});}else{return _0xd63067;}})[_0x8b6a('0x4d')](function(_0xf2c9c3){logger[_0x8b6a('0x32')](_0x8b6a('0x58'),_0xf2c9c3);throw _0xf2c9c3;});}return _0xd63067;})[_0x8b6a('0x2d')](respondWithResult(_0x385780,0xc9))[_0x8b6a('0x4d')](handleError(_0x385780,null));};exports['update']=function(_0xff093a,_0x587863){if(_0xff093a[_0x8b6a('0x59')]['id']){delete _0xff093a[_0x8b6a('0x59')]['id'];}return db[_0x8b6a('0x37')]['find']({'where':{'id':_0xff093a[_0x8b6a('0x5a')]['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x587863,null))[_0x8b6a('0x2d')](saveUpdates(_0xff093a[_0x8b6a('0x59')],null))[_0x8b6a('0x2d')](respondWithResult(_0x587863,null))['catch'](handleError(_0x587863,null));};exports['destroy']=function(_0x2bb2dc,_0x4e4206){return db[_0x8b6a('0x37')][_0x8b6a('0x50')]({'where':{'id':_0x2bb2dc['params']['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x4e4206,null))[_0x8b6a('0x2d')](removeEntity(_0x4e4206,null))[_0x8b6a('0x4d')](handleError(_0x4e4206,null));};exports[_0x8b6a('0x5b')]=function(_0xdbe1ad,_0x6f4178){return db[_0x8b6a('0x37')][_0x8b6a('0x5b')]()[_0x8b6a('0x2d')](respondWithResult(_0x6f4178,null))[_0x8b6a('0x4d')](handleError(_0x6f4178,null));};exports[_0x8b6a('0x5c')]=function(_0x5c525c,_0x21069e,_0x23e5af){var _0x5ba499={'raw':!![],'where':{}},_0x242484={},_0x188bea;return db[_0x8b6a('0x37')]['findOne']({'where':{'id':_0x5c525c[_0x8b6a('0x5a')]['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x21069e,null))[_0x8b6a('0x2d')](function(_0x4feccb){if(_0x4feccb){_0x188bea=_0x4feccb[_0x8b6a('0x2f')]({'plain':!![]});_0x242484[_0x8b6a('0x3b')]=_[_0x8b6a('0x3a')](db[_0x8b6a('0x5d')][_0x8b6a('0x38')]);_0x242484[_0x8b6a('0x39')]=_['keys'](_0x5c525c[_0x8b6a('0x39')]);_0x242484['filters']=_['intersection'](_0x242484[_0x8b6a('0x3b')],_0x242484[_0x8b6a('0x39')]);_0x5ba499[_0x8b6a('0x3c')]=_[_0x8b6a('0x3d')](_0x242484[_0x8b6a('0x3b')],qs[_0x8b6a('0x4f')](_0x5c525c[_0x8b6a('0x39')][_0x8b6a('0x4f')]));_0x5ba499[_0x8b6a('0x3c')]=_0x5ba499[_0x8b6a('0x3c')][_0x8b6a('0x3e')]?_0x5ba499['attributes']:_0x242484['model'];if(!_0x5c525c['query'][_0x8b6a('0x3f')](_0x8b6a('0x5e'))){_0x5ba499[_0x8b6a('0x26')]=qs[_0x8b6a('0x26')](_0x5c525c['query'][_0x8b6a('0x26')]);_0x5ba499[_0x8b6a('0x25')]=qs[_0x8b6a('0x25')](_0x5c525c[_0x8b6a('0x39')][_0x8b6a('0x25')]);}_0x5ba499[_0x8b6a('0x40')]=qs[_0x8b6a('0x41')](_0x5c525c['query'][_0x8b6a('0x41')]);_0x5ba499[_0x8b6a('0x42')]=qs[_0x8b6a('0x43')](_[_0x8b6a('0x44')](_0x5c525c[_0x8b6a('0x39')],_0x242484[_0x8b6a('0x43')]));_0x5ba499[_0x8b6a('0x42')]['WhatsappQueueId']=_0x4feccb['id'];if(_0x5c525c[_0x8b6a('0x39')][_0x8b6a('0x45')]){_0x5ba499['where']=_[_0x8b6a('0x46')](_0x5ba499[_0x8b6a('0x42')],{'$or':_[_0x8b6a('0x36')](_0x5ba499[_0x8b6a('0x3c')],function(_0x4e31a1){var _0x33e403={};_0x33e403[_0x4e31a1]={'$like':'%'+_0x5c525c[_0x8b6a('0x39')][_0x8b6a('0x45')]+'%'};return _0x33e403;})});}_0x5ba499=_[_0x8b6a('0x46')]({},_0x5ba499,_0x5c525c['options']);return db[_0x8b6a('0x5d')]['findAll'](_0x5ba499);}})[_0x8b6a('0x2d')](function(_0x4c099c){if(_0x4c099c){return db[_0x8b6a('0x5f')][_0x8b6a('0x60')]({'where':{'id':_['map'](_0x4c099c,_0x8b6a('0x61')),'role':_0x8b6a('0x62')},'attributes':['id',_0x8b6a('0x34'),_0x8b6a('0x63'),_0x8b6a('0x64'),_0x8b6a('0x65')]});}})[_0x8b6a('0x2d')](function(_0x29a89f){if(_0x29a89f){return{'count':_0x29a89f[_0x8b6a('0x28')],'rows':_[_0x8b6a('0x36')](_0x29a89f[_0x8b6a('0x4c')],function(_0x222d0d){return{'membername':_0x222d0d['name'],'UserId':_0x222d0d['id'],'queue_name':_0x188bea[_0x8b6a('0x34')],'WhatsappQueueId':_0x188bea['id'],'interface':util[_0x8b6a('0x66')]('%s/%s',_0x8b6a('0x67'),_0x222d0d[_0x8b6a('0x34')]),'penalty':0x0,'paused':_0x222d0d[_0x8b6a('0x63')],'createdAt':_0x222d0d[_0x8b6a('0x65')],'updatedAt':_0x222d0d[_0x8b6a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8b6a('0x2d')](respondWithFilteredResult(_0x21069e,_0x5ba499))['catch'](handleError(_0x21069e,null));};exports['getTeams']=function(_0x29c29b,_0x555c6c,_0x1e52ff){var _0x3f5602={};var _0x28c8ce={};var _0x5b01c2;var _0x227875;return db['WhatsappQueue'][_0x8b6a('0x68')]({'where':{'id':_0x29c29b[_0x8b6a('0x5a')]['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x555c6c,null))['then'](function(_0x3ab37c){if(_0x3ab37c){_0x5b01c2=_0x3ab37c;_0x28c8ce[_0x8b6a('0x3b')]=_['keys'](db['Team'][_0x8b6a('0x38')]);_0x28c8ce['query']=_[_0x8b6a('0x3a')](_0x29c29b[_0x8b6a('0x39')]);_0x28c8ce['filters']=_['intersection'](_0x28c8ce[_0x8b6a('0x3b')],_0x28c8ce['query']);_0x3f5602[_0x8b6a('0x3c')]=_['intersection'](_0x28c8ce[_0x8b6a('0x3b')],qs[_0x8b6a('0x4f')](_0x29c29b['query']['fields']));_0x3f5602['attributes']=_0x3f5602[_0x8b6a('0x3c')][_0x8b6a('0x3e')]?_0x3f5602[_0x8b6a('0x3c')]:_0x28c8ce[_0x8b6a('0x3b')];_0x3f5602[_0x8b6a('0x40')]=qs[_0x8b6a('0x41')](_0x29c29b[_0x8b6a('0x39')][_0x8b6a('0x41')]);_0x3f5602[_0x8b6a('0x42')]=qs[_0x8b6a('0x43')](_[_0x8b6a('0x44')](_0x29c29b[_0x8b6a('0x39')],_0x28c8ce['filters']));if(_0x29c29b['query'][_0x8b6a('0x45')]){_0x3f5602[_0x8b6a('0x42')]=_['merge'](_0x3f5602[_0x8b6a('0x42')],{'$or':_[_0x8b6a('0x36')](_0x3f5602[_0x8b6a('0x3c')],function(_0x3e8d95){var _0x106df8={};_0x106df8[_0x3e8d95]={'$like':'%'+_0x29c29b[_0x8b6a('0x39')][_0x8b6a('0x45')]+'%'};return _0x106df8;})});}_0x3f5602=_[_0x8b6a('0x46')]({},_0x3f5602,_0x29c29b[_0x8b6a('0x49')]);return _0x5b01c2[_0x8b6a('0x69')](_0x3f5602);}})[_0x8b6a('0x2d')](function(_0x282743){if(_0x282743){_0x227875=_0x282743[_0x8b6a('0x3e')];if(!_0x29c29b[_0x8b6a('0x39')][_0x8b6a('0x3f')](_0x8b6a('0x5e'))){_0x3f5602['limit']=qs[_0x8b6a('0x26')](_0x29c29b[_0x8b6a('0x39')][_0x8b6a('0x26')]);_0x3f5602['offset']=qs[_0x8b6a('0x25')](_0x29c29b[_0x8b6a('0x39')][_0x8b6a('0x25')]);}return _0x5b01c2['getTeams'](_0x3f5602);}})[_0x8b6a('0x2d')](function(_0x355f3a){if(_0x355f3a){return _0x355f3a?{'count':_0x227875,'rows':_0x355f3a}:null;}})['then'](respondWithResult(_0x555c6c,null))[_0x8b6a('0x4d')](handleError(_0x555c6c,null));};exports[_0x8b6a('0x6a')]=function(_0x3d698b,_0x5ada23,_0x261594){var _0x3f6570=_0x3d698b[_0x8b6a('0x59')][_0x8b6a('0x6b')];return db[_0x8b6a('0x6c')]['findAll']({'where':{'id':_0x3f6570},'attributes':['id'],'include':[{'model':db[_0x8b6a('0x5f')],'as':_0x8b6a('0x6d'),'attributes':['id','name','online',_0x8b6a('0x6e'),'interface'],'raw':!![]}]})[_0x8b6a('0x2d')](function(_0x1b0ca3){if(_0x1b0ca3){var _0x31d9d1=_[_0x8b6a('0x6f')](_0x1b0ca3,function(_0x14de1d){var _0x4b1771=_0x14de1d['get']({'plain':!![]});return _0x4b1771[_0x8b6a('0x6d')];});return db[_0x8b6a('0x37')]['find']({'where':{'id':_0x3d698b[_0x8b6a('0x5a')]['id']}})[_0x8b6a('0x2d')](function(_0x5c4aa8){return db[_0x8b6a('0x70')]['transaction'](function(_0x20ad12){return _0x5c4aa8[_0x8b6a('0x6a')](_0x3f6570,{'transaction':_0x20ad12})[_0x8b6a('0x2d')](function(){return BPromise['each'](_0x31d9d1,function(_0x699e1b){return db[_0x8b6a('0x5d')][_0x8b6a('0x71')]({'where':{'UserId':_0x699e1b['id'],'WhatsappQueueId':_0x3d698b[_0x8b6a('0x5a')]['id']},'transaction':_0x20ad12});});})[_0x8b6a('0x2d')](function(){_0x31d9d1['forEach'](function(_0x3069a9){socket[_0x8b6a('0x72')](_0x8b6a('0x73'),{'UserId':_0x3069a9['id'],'WhatsappQueueId':_0x5c4aa8['id']});});});});});}})[_0x8b6a('0x2d')](respondWithStatusCode(_0x5ada23,null))[_0x8b6a('0x4d')](handleError(_0x5ada23,null));};exports[_0x8b6a('0x74')]=function(_0x3e1014,_0x408b20,_0x3789c1){return db[_0x8b6a('0x6c')][_0x8b6a('0x4b')]({'where':{'id':_0x3e1014[_0x8b6a('0x39')][_0x8b6a('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8b6a('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x8b6a('0x2d')](handleEntityNotFound(_0x408b20,null))[_0x8b6a('0x2d')](function(_0x421b5b){var _0x13ad9a=_[_0x8b6a('0x36')](_0x421b5b,'id');var _0xb03fdc=[];var _0x38cbaf=[];var _0x504db8=squel[_0x8b6a('0x75')]();_0x504db8[_0x8b6a('0x76')]('tq.TeamId')['from'](_0x8b6a('0x77'),'tq')[_0x8b6a('0x78')](_0x8b6a('0x79'),'ut',_0x8b6a('0x7a'))[_0x8b6a('0x42')](_0x8b6a('0x7b'),_0x3e1014[_0x8b6a('0x5a')]['id']);for(var _0x213e9b=0x0;_0x213e9b<_0x421b5b[_0x8b6a('0x3e')];_0x213e9b+=0x1){let _0xaafb12=_0x421b5b[_0x213e9b];for(var _0x1e9ef3=0x0;_0x1e9ef3<_0xaafb12['Agents'][_0x8b6a('0x3e')];_0x1e9ef3+=0x1){let _0x4b8153=_0xaafb12[_0x8b6a('0x6d')][_0x1e9ef3];var _0x5cd2a3=_0x504db8[_0x8b6a('0x7c')]();_0x5cd2a3[_0x8b6a('0x42')](_0x8b6a('0x7d'),_0x4b8153['id']);_0x38cbaf[_0x8b6a('0x7e')](db[_0x8b6a('0x70')][_0x8b6a('0x39')](_0x5cd2a3[_0x8b6a('0x7f')](),{'type':db[_0x8b6a('0x70')][_0x8b6a('0x80')][_0x8b6a('0x81')]})['then'](function(_0x1f7a22){if(_0x1f7a22[_0x8b6a('0x3e')]===0x1){return _0x4b8153['id'];}else{var _0x3e69b2=_[_0x8b6a('0x82')](_['map'](_0x1f7a22,_0x8b6a('0x83')),function(_0x4fc4bd){return _['includes'](_0x13ad9a,_0x4fc4bd);});if(_0x3e69b2){return _0x4b8153['id'];}}}));}}return BPromise['all'](_0x38cbaf)[_0x8b6a('0x2d')](function(_0x59d2b0){_0xb03fdc=_(_0xb03fdc)[_0x8b6a('0x84')](_0x59d2b0)[_0x8b6a('0x85')]()['value']();return db[_0x8b6a('0x37')][_0x8b6a('0x50')]({'where':{'id':_0x3e1014['params']['id']}})[_0x8b6a('0x2d')](function(_0x4a4225){return db[_0x8b6a('0x70')][_0x8b6a('0x86')](function(_0x52c762){return _0x4a4225[_0x8b6a('0x74')](_0x3e1014[_0x8b6a('0x39')][_0x8b6a('0x6b')],{'transaction':_0x52c762})[_0x8b6a('0x2d')](function(){if(!_[_0x8b6a('0x87')](_0xb03fdc)){return _0x4a4225[_0x8b6a('0x88')](_0xb03fdc,{'transaction':_0x52c762});}})[_0x8b6a('0x2d')](function(){_0xb03fdc[_0x8b6a('0x89')](function(_0x2917cd){socket[_0x8b6a('0x72')](_0x8b6a('0x8a'),{'UserId':_0x2917cd,'WhatsappQueueId':_0x4a4225['id']});});});});});});})[_0x8b6a('0x2d')](respondWithStatusCode(_0x408b20,null))[_0x8b6a('0x4d')](handleError(_0x408b20,null));};exports[_0x8b6a('0x8b')]=function(_0x1c16d9,_0x22c8a6,_0x927046){return db[_0x8b6a('0x37')][_0x8b6a('0x50')]({'where':{'id':_0x1c16d9[_0x8b6a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x22c8a6,null))[_0x8b6a('0x2d')](function(_0x57dcc5){if(_0x57dcc5){return _0x57dcc5[_0x8b6a('0x8b')](_0x1c16d9[_0x8b6a('0x59')]['ids'],_[_0x8b6a('0x8c')](_0x1c16d9[_0x8b6a('0x59')],[_0x8b6a('0x6b'),'id'])||{})[_0x8b6a('0x8d')](function(_0x15b92f){for(var _0x4bbf1c=0x0;_0x4bbf1c<_0x1c16d9[_0x8b6a('0x59')][_0x8b6a('0x6b')][_0x8b6a('0x3e')];_0x4bbf1c+=0x1){socket[_0x8b6a('0x72')]('userWhatsappQueue:save',{'UserId':Number(_0x1c16d9[_0x8b6a('0x59')][_0x8b6a('0x6b')][_0x4bbf1c]),'WhatsappQueueId':Number(_0x1c16d9[_0x8b6a('0x5a')]['id'])});}return _0x15b92f;});}})['then'](respondWithResult(_0x22c8a6,null))[_0x8b6a('0x4d')](handleError(_0x22c8a6,null));};exports[_0x8b6a('0x88')]=function(_0xad7b13,_0x37014f,_0xaaad79){return db[_0x8b6a('0x37')]['find']({'where':{'id':_0xad7b13['params']['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x37014f,null))[_0x8b6a('0x2d')](function(_0x231615){if(_0x231615){return _0x231615[_0x8b6a('0x88')](_0xad7b13['query'][_0x8b6a('0x6b')])[_0x8b6a('0x2d')](function(){if(_[_0x8b6a('0x8e')](_0xad7b13[_0x8b6a('0x39')][_0x8b6a('0x6b')])){for(var _0x4edf0f=0x0;_0x4edf0f<_0xad7b13[_0x8b6a('0x39')][_0x8b6a('0x6b')][_0x8b6a('0x3e')];_0x4edf0f+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0xad7b13[_0x8b6a('0x39')][_0x8b6a('0x6b')][_0x4edf0f]),'WhatsappQueueId':Number(_0xad7b13['params']['id'])});}}else{socket[_0x8b6a('0x72')]('userWhatsappQueue:remove',{'UserId':Number(_0xad7b13['query']['ids']),'WhatsappQueueId':Number(_0xad7b13[_0x8b6a('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x37014f,null))[_0x8b6a('0x4d')](handleError(_0x37014f,null));};exports[_0x8b6a('0x8f')]=function(_0x4e1821,_0x37d8f6,_0x110257){var _0x531371={};var _0xf99a44={};var _0x177bb9;var _0x3629e8;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4e1821[_0x8b6a('0x5a')]['id']}})[_0x8b6a('0x2d')](handleEntityNotFound(_0x37d8f6,null))['then'](function(_0x556189){if(_0x556189){_0x177bb9=_0x556189;_0xf99a44[_0x8b6a('0x3b')]=_[_0x8b6a('0x3a')](db[_0x8b6a('0x5f')][_0x8b6a('0x38')]);_0xf99a44[_0x8b6a('0x39')]=_['keys'](_0x4e1821['query']);_0xf99a44['filters']=_[_0x8b6a('0x3d')](_0xf99a44[_0x8b6a('0x3b')],_0xf99a44[_0x8b6a('0x39')]);_0x531371[_0x8b6a('0x3c')]=_[_0x8b6a('0x3d')](_0xf99a44[_0x8b6a('0x3b')],qs['fields'](_0x4e1821[_0x8b6a('0x39')]['fields']));_0x531371[_0x8b6a('0x3c')]=_0x531371[_0x8b6a('0x3c')]['length']?_0x531371[_0x8b6a('0x3c')]:_0xf99a44[_0x8b6a('0x3b')];_0x531371['order']=qs[_0x8b6a('0x41')](_0x4e1821[_0x8b6a('0x39')]['sort']);_0x531371['where']=qs[_0x8b6a('0x43')](_[_0x8b6a('0x44')](_0x4e1821[_0x8b6a('0x39')],_0xf99a44[_0x8b6a('0x43')]));if(_0x4e1821['query'][_0x8b6a('0x45')]){_0x531371[_0x8b6a('0x42')]=_['merge'](_0x531371['where'],{'$or':_[_0x8b6a('0x36')](_0x531371[_0x8b6a('0x3c')],function(_0x554790){var _0x215bde={};_0x215bde[_0x554790]={'$like':'%'+_0x4e1821['query'][_0x8b6a('0x45')]+'%'};return _0x215bde;})});}_0x531371=_[_0x8b6a('0x46')]({},_0x531371,_0x4e1821[_0x8b6a('0x49')]);return _0x177bb9[_0x8b6a('0x8f')](_0x531371);}})[_0x8b6a('0x2d')](function(_0x4b0f28){if(_0x4b0f28){_0x3629e8=_0x4b0f28[_0x8b6a('0x3e')];if(!_0x4e1821[_0x8b6a('0x39')]['hasOwnProperty'](_0x8b6a('0x5e'))){_0x531371[_0x8b6a('0x26')]=qs['limit'](_0x4e1821[_0x8b6a('0x39')][_0x8b6a('0x26')]);_0x531371[_0x8b6a('0x25')]=qs[_0x8b6a('0x25')](_0x4e1821[_0x8b6a('0x39')]['offset']);}return _0x177bb9[_0x8b6a('0x8f')](_0x531371);}})['then'](function(_0x54a777){if(_0x54a777){return _0x54a777?{'count':_0x3629e8,'rows':_0x54a777}:null;}})[_0x8b6a('0x2d')](respondWithResult(_0x37d8f6,null))[_0x8b6a('0x4d')](handleError(_0x37d8f6,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 77cff2b..093ab60 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 _0xc51e=['update','remove','emit','hasOwnProperty','hook','WhatsappQueue','setMaxListeners','save'];(function(_0x16ef09,_0x47abcc){var _0x4406cb=function(_0x43e2c9){while(--_0x43e2c9){_0x16ef09['push'](_0x16ef09['shift']());}};_0x4406cb(++_0x47abcc);}(_0xc51e,0x18d));var _0xec51=function(_0x32bb6b,_0x1a5fbe){_0x32bb6b=_0x32bb6b-0x0;var _0x58dcb4=_0xc51e[_0x32bb6b];return _0x58dcb4;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0xec51('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xec51('0x1')](0x0);var events={'afterCreate':_0xec51('0x2'),'afterUpdate':_0xec51('0x3'),'afterDestroy':_0xec51('0x4')};function emitEvent(_0x4fb8bc){return function(_0x9c9f9a,_0x4e0ced,_0x4528f3){WhatsappQueueEvents[_0xec51('0x5')](_0x4fb8bc+':'+_0x9c9f9a['id'],_0x9c9f9a);WhatsappQueueEvents[_0xec51('0x5')](_0x4fb8bc,_0x9c9f9a);_0x4528f3(null);};}for(var e in events){if(events[_0xec51('0x6')](e)){var event=events[e];WhatsappQueue[_0xec51('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xcd36=['emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','update','remove'];(function(_0x51bc8b,_0x3d644e){var _0x31eabf=function(_0xcbcd7b){while(--_0xcbcd7b){_0x51bc8b['push'](_0x51bc8b['shift']());}};_0x31eabf(++_0x3d644e);}(_0xcd36,0x1e3));var _0x6cd3=function(_0x5f074c,_0x583049){_0x5f074c=_0x5f074c-0x0;var _0x3eb455=_0xcd36[_0x5f074c];return _0x3eb455;};'use strict';var EventEmitter=require(_0x6cd3('0x0'));var WhatsappQueue=require(_0x6cd3('0x1'))['db'][_0x6cd3('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6cd3('0x3'),'afterDestroy':_0x6cd3('0x4')};function emitEvent(_0x468ea2){return function(_0x218bd8,_0x4dc438,_0x462744){WhatsappQueueEvents['emit'](_0x468ea2+':'+_0x218bd8['id'],_0x218bd8);WhatsappQueueEvents[_0x6cd3('0x5')](_0x468ea2,_0x218bd8);_0x462744(null);};}for(var e in events){if(events[_0x6cd3('0x6')](e)){var event=events[e];WhatsappQueue[_0x6cd3('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 16b3d06..b8a3673 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 _0x9269=['path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2eb402,_0x9c289e){var _0x21c80d=function(_0x73c558){while(--_0x73c558){_0x2eb402['push'](_0x2eb402['shift']());}};_0x21c80d(++_0x9c289e);}(_0x9269,0x133));var _0x9926=function(_0x9ac89b,_0x25b61d){_0x9ac89b=_0x9ac89b-0x0;var _0x40da74=_0x9269[_0x9ac89b];return _0x40da74;};'use strict';var _=require(_0x9926('0x0'));var util=require(_0x9926('0x1'));var logger=require(_0x9926('0x2'))('api');var moment=require(_0x9926('0x3'));var BPromise=require(_0x9926('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9926('0x5'));var rimraf=require('rimraf');var config=require(_0x9926('0x6'));var attributes=require(_0x9926('0x7'));module[_0x9926('0x8')]=function(_0x1e1b5b,_0x137ae7){return _0x1e1b5b[_0x9926('0x9')](_0x9926('0xa'),attributes,{'tableName':_0x9926('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e93=['whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0e93,0xfd));var _0x30e9=function(_0x35f1b6,_0x85f196){_0x35f1b6=_0x35f1b6-0x0;var _0x3496b3=_0x0e93[_0x35f1b6];return _0x3496b3;};'use strict';var _=require(_0x30e9('0x0'));var util=require('util');var logger=require(_0x30e9('0x1'))(_0x30e9('0x2'));var moment=require(_0x30e9('0x3'));var BPromise=require(_0x30e9('0x4'));var rp=require(_0x30e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30e9('0x6'));var config=require(_0x30e9('0x7'));var attributes=require(_0x30e9('0x8'));module[_0x30e9('0x9')]=function(_0x717be6,_0x3ef36a){return _0x717be6[_0x30e9('0xa')]('WhatsappQueue',attributes,{'tableName':_0x30e9('0xb'),'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 f9c9947..63fad27 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 _0xde30=['model','ShowWhatsappQueue','WhatsappQueue','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0xde30,0x10d));var _0x0de3=function(_0x186271,_0x319e22){_0x186271=_0x186271-0x0;var _0xfa9042=_0xde30[_0x186271];return _0xfa9042;};'use strict';var _=require('lodash');var util=require(_0x0de3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0de3('0x1'))['db'];var utils=require(_0x0de3('0x2'));var logger=require(_0x0de3('0x3'))(_0x0de3('0x4'));var config=require(_0x0de3('0x5'));var jayson=require(_0x0de3('0x6'));var client=jayson['client'][_0x0de3('0x7')]({'port':0x232a});config['redis']=_[_0x0de3('0x8')](config['redis'],{'host':_0x0de3('0x9'),'port':0x18eb});var socket=require(_0x0de3('0xa'))(new Redis(config[_0x0de3('0xb')]));require('./whatsappQueue.socket')[_0x0de3('0xc')](socket);function respondWithRpcPromise(_0x5ecd42,_0x2f9241,_0x1788a9){return new BPromise(function(_0x4ddde5,_0x3504ef){return client[_0x0de3('0xd')](_0x5ecd42,_0x1788a9)[_0x0de3('0xe')](function(_0x46c30a){logger[_0x0de3('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x2f9241,_0x0de3('0x10'));logger[_0x0de3('0x11')](_0x0de3('0x12'),_0x2f9241,_0x0de3('0x10'),JSON[_0x0de3('0x13')](_0x46c30a));if(_0x46c30a[_0x0de3('0x14')]){if(_0x46c30a['error'][_0x0de3('0x15')]===0x1f4){logger[_0x0de3('0x14')](_0x0de3('0x16'),_0x2f9241,_0x46c30a[_0x0de3('0x14')][_0x0de3('0x17')]);return _0x3504ef(_0x46c30a[_0x0de3('0x14')]['message']);}logger[_0x0de3('0x14')](_0x0de3('0x16'),_0x2f9241,_0x46c30a[_0x0de3('0x14')][_0x0de3('0x17')]);return _0x4ddde5(_0x46c30a[_0x0de3('0x14')][_0x0de3('0x17')]);}else{logger[_0x0de3('0xf')](_0x0de3('0x16'),_0x2f9241,_0x0de3('0x10'));_0x4ddde5(_0x46c30a[_0x0de3('0x18')][_0x0de3('0x17')]);}})[_0x0de3('0x19')](function(_0x42b3d5){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2f9241,_0x42b3d5);_0x3504ef(_0x42b3d5);});});}exports[_0x0de3('0x1a')]=function(_0x177024){var _0x1827a1=this;return new Promise(function(_0x14a8de,_0x2e3f8e){return db['WhatsappQueue'][_0x0de3('0x1b')]({'raw':_0x177024[_0x0de3('0x1c')]?_0x177024['options'][_0x0de3('0x1d')]===undefined?!![]:![]:!![],'where':_0x177024['options']?_0x177024['options'][_0x0de3('0x1e')]||null:null,'attributes':_0x177024['options']?_0x177024[_0x0de3('0x1c')][_0x0de3('0x1f')]||null:null,'limit':_0x177024[_0x0de3('0x1c')]?_0x177024[_0x0de3('0x1c')][_0x0de3('0x20')]||null:null,'include':_0x177024[_0x0de3('0x1c')]?_0x177024[_0x0de3('0x1c')]['include']?_[_0x0de3('0x21')](_0x177024[_0x0de3('0x1c')][_0x0de3('0x22')],function(_0x3df864){return{'model':db[_0x3df864[_0x0de3('0x23')]],'as':_0x3df864['as'],'attributes':_0x3df864[_0x0de3('0x1f')],'include':_0x3df864['include']?_[_0x0de3('0x21')](_0x3df864[_0x0de3('0x22')],function(_0x12e3d){return{'model':db[_0x12e3d[_0x0de3('0x23')]],'as':_0x12e3d['as'],'attributes':_0x12e3d[_0x0de3('0x1f')],'include':_0x12e3d[_0x0de3('0x22')]?_[_0x0de3('0x21')](_0x12e3d[_0x0de3('0x22')],function(_0x549f66){return{'model':db[_0x549f66[_0x0de3('0x23')]],'as':_0x549f66['as'],'attributes':_0x549f66['attributes']};}):[]};}):[]};}):[]:[]})[_0x0de3('0xe')](function(_0x4c004f){logger[_0x0de3('0xf')]('GetWhatsappQueue',_0x177024);logger['debug'](_0x0de3('0x1a'),_0x177024,JSON[_0x0de3('0x13')](_0x4c004f));_0x14a8de(_0x4c004f);})[_0x0de3('0x19')](function(_0x4c4bcb){logger[_0x0de3('0x14')](_0x0de3('0x1a'),_0x4c4bcb['message'],_0x177024);_0x2e3f8e(_0x1827a1[_0x0de3('0x14')](0x1f4,_0x4c4bcb['message']));});});};exports[_0x0de3('0x24')]=function(_0x1678b3){var _0x3fdfcb=this;return new Promise(function(_0x5429f4,_0x4b4e66){return db[_0x0de3('0x25')]['find']({'raw':_0x1678b3[_0x0de3('0x1c')]?_0x1678b3['options'][_0x0de3('0x1d')]===undefined?!![]:![]:!![],'where':_0x1678b3[_0x0de3('0x1c')]?_0x1678b3[_0x0de3('0x1c')]['where']||null:null,'attributes':_0x1678b3[_0x0de3('0x1c')]?_0x1678b3[_0x0de3('0x1c')][_0x0de3('0x1f')]||null:null,'include':_0x1678b3[_0x0de3('0x1c')]?_0x1678b3['options'][_0x0de3('0x22')]?_[_0x0de3('0x21')](_0x1678b3[_0x0de3('0x1c')][_0x0de3('0x22')],function(_0x3c6b49){return{'model':db[_0x3c6b49[_0x0de3('0x23')]],'as':_0x3c6b49['as'],'attributes':_0x3c6b49['attributes'],'include':_0x3c6b49[_0x0de3('0x22')]?_[_0x0de3('0x21')](_0x3c6b49[_0x0de3('0x22')],function(_0x183d99){return{'model':db[_0x183d99['model']],'as':_0x183d99['as'],'attributes':_0x183d99[_0x0de3('0x1f')],'include':_0x183d99[_0x0de3('0x22')]?_[_0x0de3('0x21')](_0x183d99[_0x0de3('0x22')],function(_0xda7271){return{'model':db[_0xda7271[_0x0de3('0x23')]],'as':_0xda7271['as'],'attributes':_0xda7271['attributes']};}):[]};}):[]};}):[]:[]})[_0x0de3('0xe')](function(_0x1d1b84){logger[_0x0de3('0xf')](_0x0de3('0x24'),_0x1678b3);logger[_0x0de3('0x11')](_0x0de3('0x24'),_0x1678b3,JSON[_0x0de3('0x13')](_0x1d1b84));_0x5429f4(_0x1d1b84);})['catch'](function(_0x10ba79){logger[_0x0de3('0x14')]('ShowWhatsappQueue',_0x10ba79[_0x0de3('0x17')],_0x1678b3);_0x4b4e66(_0x3fdfcb['error'](0x1f4,_0x10ba79[_0x0de3('0x17')]));});});}; \ No newline at end of file +var _0x8186=['debug','request\x20sent','stringify','error','code','message','info','catch','findAll','options','where','attributes','map','include','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s'];(function(_0x51bdf4,_0x498236){var _0x324ba6=function(_0x584186){while(--_0x584186){_0x51bdf4['push'](_0x51bdf4['shift']());}};_0x324ba6(++_0x498236);}(_0x8186,0xe6));var _0x6818=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x8186[_0x58a4ac];return _0x545810;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6818('0x0'));var BPromise=require('bluebird');var rs=require(_0x6818('0x1'));var fs=require('fs');var Redis=require(_0x6818('0x2'));var db=require(_0x6818('0x3'))['db'];var utils=require(_0x6818('0x4'));var logger=require('../../config/logger')(_0x6818('0x5'));var config=require('../../config/environment');var jayson=require(_0x6818('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x6818('0x7')]=_[_0x6818('0x8')](config[_0x6818('0x7')],{'host':_0x6818('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6818('0xa'))[_0x6818('0xb')](socket);function respondWithRpcPromise(_0x3e856c,_0x1628f4,_0x269a29){return new BPromise(function(_0x5d032a,_0x13cace){return client[_0x6818('0xc')](_0x3e856c,_0x269a29)[_0x6818('0xd')](function(_0x33d71c){logger['info'](_0x6818('0xe'),_0x1628f4,'request\x20sent');logger[_0x6818('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1628f4,_0x6818('0x10'),JSON[_0x6818('0x11')](_0x33d71c));if(_0x33d71c[_0x6818('0x12')]){if(_0x33d71c[_0x6818('0x12')][_0x6818('0x13')]===0x1f4){logger[_0x6818('0x12')](_0x6818('0xe'),_0x1628f4,_0x33d71c[_0x6818('0x12')][_0x6818('0x14')]);return _0x13cace(_0x33d71c[_0x6818('0x12')][_0x6818('0x14')]);}logger['error'](_0x6818('0xe'),_0x1628f4,_0x33d71c['error'][_0x6818('0x14')]);return _0x5d032a(_0x33d71c['error'][_0x6818('0x14')]);}else{logger[_0x6818('0x15')](_0x6818('0xe'),_0x1628f4,'request\x20sent');_0x5d032a(_0x33d71c['result'][_0x6818('0x14')]);}})[_0x6818('0x16')](function(_0x40e700){logger[_0x6818('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x1628f4,_0x40e700);_0x13cace(_0x40e700);});});}exports['GetWhatsappQueue']=function(_0x2eb9fa){var _0x4a12ba=this;return new Promise(function(_0x1c0db7,_0x403e70){return db['WhatsappQueue'][_0x6818('0x17')]({'raw':_0x2eb9fa[_0x6818('0x18')]?_0x2eb9fa[_0x6818('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2eb9fa[_0x6818('0x18')]?_0x2eb9fa[_0x6818('0x18')][_0x6818('0x19')]||null:null,'attributes':_0x2eb9fa[_0x6818('0x18')]?_0x2eb9fa[_0x6818('0x18')][_0x6818('0x1a')]||null:null,'limit':_0x2eb9fa['options']?_0x2eb9fa[_0x6818('0x18')]['limit']||null:null,'include':_0x2eb9fa['options']?_0x2eb9fa[_0x6818('0x18')]['include']?_[_0x6818('0x1b')](_0x2eb9fa[_0x6818('0x18')]['include'],function(_0x4d7e40){return{'model':db[_0x4d7e40['model']],'as':_0x4d7e40['as'],'attributes':_0x4d7e40[_0x6818('0x1a')],'include':_0x4d7e40[_0x6818('0x1c')]?_[_0x6818('0x1b')](_0x4d7e40[_0x6818('0x1c')],function(_0x4e1c71){return{'model':db[_0x4e1c71[_0x6818('0x1d')]],'as':_0x4e1c71['as'],'attributes':_0x4e1c71[_0x6818('0x1a')],'include':_0x4e1c71[_0x6818('0x1c')]?_[_0x6818('0x1b')](_0x4e1c71[_0x6818('0x1c')],function(_0x4d72a0){return{'model':db[_0x4d72a0[_0x6818('0x1d')]],'as':_0x4d72a0['as'],'attributes':_0x4d72a0[_0x6818('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1aac2a){logger[_0x6818('0x15')]('GetWhatsappQueue',_0x2eb9fa);logger[_0x6818('0xf')](_0x6818('0x1e'),_0x2eb9fa,JSON[_0x6818('0x11')](_0x1aac2a));_0x1c0db7(_0x1aac2a);})['catch'](function(_0x13354b){logger[_0x6818('0x12')](_0x6818('0x1e'),_0x13354b[_0x6818('0x14')],_0x2eb9fa);_0x403e70(_0x4a12ba[_0x6818('0x12')](0x1f4,_0x13354b[_0x6818('0x14')]));});});};exports[_0x6818('0x1f')]=function(_0x9786c9){var _0x507530=this;return new Promise(function(_0x22eb31,_0x46cd3a){return db[_0x6818('0x20')][_0x6818('0x21')]({'raw':_0x9786c9[_0x6818('0x18')]?_0x9786c9['options'][_0x6818('0x22')]===undefined?!![]:![]:!![],'where':_0x9786c9[_0x6818('0x18')]?_0x9786c9[_0x6818('0x18')][_0x6818('0x19')]||null:null,'attributes':_0x9786c9[_0x6818('0x18')]?_0x9786c9[_0x6818('0x18')]['attributes']||null:null,'include':_0x9786c9[_0x6818('0x18')]?_0x9786c9[_0x6818('0x18')][_0x6818('0x1c')]?_[_0x6818('0x1b')](_0x9786c9[_0x6818('0x18')][_0x6818('0x1c')],function(_0x1cf548){return{'model':db[_0x1cf548['model']],'as':_0x1cf548['as'],'attributes':_0x1cf548[_0x6818('0x1a')],'include':_0x1cf548[_0x6818('0x1c')]?_[_0x6818('0x1b')](_0x1cf548[_0x6818('0x1c')],function(_0x45bfc7){return{'model':db[_0x45bfc7[_0x6818('0x1d')]],'as':_0x45bfc7['as'],'attributes':_0x45bfc7['attributes'],'include':_0x45bfc7[_0x6818('0x1c')]?_[_0x6818('0x1b')](_0x45bfc7[_0x6818('0x1c')],function(_0x31d8f4){return{'model':db[_0x31d8f4[_0x6818('0x1d')]],'as':_0x31d8f4['as'],'attributes':_0x31d8f4[_0x6818('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6818('0xd')](function(_0x439c70){logger[_0x6818('0x15')](_0x6818('0x1f'),_0x9786c9);logger[_0x6818('0xf')](_0x6818('0x1f'),_0x9786c9,JSON[_0x6818('0x11')](_0x439c70));_0x22eb31(_0x439c70);})[_0x6818('0x16')](function(_0x99ba30){logger[_0x6818('0x12')](_0x6818('0x1f'),_0x99ba30[_0x6818('0x14')],_0x9786c9);_0x46cd3a(_0x507530['error'](0x1f4,_0x99ba30[_0x6818('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index b9945c3..ebe9c13 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 _0x0199=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x652091,_0x5443b6){var _0x1cadc3=function(_0x559f89){while(--_0x559f89){_0x652091['push'](_0x652091['shift']());}};_0x1cadc3(++_0x5443b6);}(_0x0199,0x195));var _0x9019=function(_0xe49016,_0x3b636e){_0xe49016=_0xe49016-0x0;var _0x5858ef=_0x0199[_0xe49016];return _0x5858ef;};'use strict';var WhatsappQueueEvents=require(_0x9019('0x0'));var events=[_0x9019('0x1'),_0x9019('0x2'),_0x9019('0x3')];function createListener(_0x4eeb83,_0x5c056d){return function(_0xcd506f){_0x5c056d[_0x9019('0x4')](_0x4eeb83,_0xcd506f);};}function removeListener(_0x2f90b2,_0x496a38){return function(){WhatsappQueueEvents[_0x9019('0x5')](_0x2f90b2,_0x496a38);};}exports[_0x9019('0x6')]=function(_0x5110e1){for(var _0x48bd45=0x0,_0x3f2e6c=events[_0x9019('0x7')];_0x48bd45<_0x3f2e6c;_0x48bd45++){var _0x34519a=events[_0x48bd45];var _0x33dad8=createListener(_0x9019('0x8')+_0x34519a,_0x5110e1);WhatsappQueueEvents['on'](_0x34519a,_0x33dad8);}}; \ No newline at end of file +var _0x7053=['emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','update'];(function(_0x47c6f2,_0x400550){var _0x2e9c12=function(_0x315152){while(--_0x315152){_0x47c6f2['push'](_0x47c6f2['shift']());}};_0x2e9c12(++_0x400550);}(_0x7053,0x1cd));var _0x3705=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x7053[_0x1168a1];return _0xcc5ad8;};'use strict';var WhatsappQueueEvents=require(_0x3705('0x0'));var events=[_0x3705('0x1'),'remove',_0x3705('0x2')];function createListener(_0x52d239,_0x256ef5){return function(_0x2b5031){_0x256ef5[_0x3705('0x3')](_0x52d239,_0x2b5031);};}function removeListener(_0x46cc98,_0x2579df){return function(){WhatsappQueueEvents[_0x3705('0x4')](_0x46cc98,_0x2579df);};}exports[_0x3705('0x5')]=function(_0x12479a){for(var _0x21afae=0x0,_0x22c14c=events[_0x3705('0x6')];_0x21afae<_0x22c14c;_0x21afae++){var _0x6de404=events[_0x21afae];var _0x5a8ece=createListener(_0x3705('0x7')+_0x6de404,_0x12479a);WhatsappQueueEvents['on'](_0x6de404,_0x5a8ece);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2e0bc40..8f65ac4 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 _0x1252=['describe','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2ce410,_0x2c24ed){var _0x567518=function(_0x1302bd){while(--_0x1302bd){_0x2ce410['push'](_0x2ce410['shift']());}};_0x567518(++_0x2c24ed);}(_0x1252,0xfe));var _0x2125=function(_0x372772,_0x3ae051){_0x372772=_0x372772-0x0;var _0x1bad94=_0x1252[_0x372772];return _0x1bad94;};'use strict';var multer=require(_0x2125('0x0'));var util=require(_0x2125('0x1'));var path=require(_0x2125('0x2'));var timeout=require(_0x2125('0x3'));var express=require('express');var router=express[_0x2125('0x4')]();var fs_extra=require(_0x2125('0x5'));var auth=require(_0x2125('0x6'));var interaction=require(_0x2125('0x7'));var config=require(_0x2125('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0x2125('0x9')]('/',auth[_0x2125('0xa')](),controller[_0x2125('0xb')]);router[_0x2125('0x9')]('/describe',auth[_0x2125('0xa')](),controller[_0x2125('0xc')]);router[_0x2125('0x9')](_0x2125('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2125('0xe')]('/',auth[_0x2125('0xa')](),controller[_0x2125('0xf')]);router[_0x2125('0x10')](_0x2125('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2125('0x11')](_0x2125('0xd'),auth[_0x2125('0xa')](),controller[_0x2125('0x12')]);module['exports']=router; \ No newline at end of file +var _0x38bb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x378ebb,_0x5b1e4b){var _0x58ad36=function(_0x12b58c){while(--_0x12b58c){_0x378ebb['push'](_0x378ebb['shift']());}};_0x58ad36(++_0x5b1e4b);}(_0x38bb,0xcc));var _0xb38b=function(_0x1838de,_0x483ea5){_0x1838de=_0x1838de-0x0;var _0x21338f=_0x38bb[_0x1838de];return _0x21338f;};'use strict';var multer=require(_0xb38b('0x0'));var util=require(_0xb38b('0x1'));var path=require(_0xb38b('0x2'));var timeout=require(_0xb38b('0x3'));var express=require(_0xb38b('0x4'));var router=express[_0xb38b('0x5')]();var fs_extra=require(_0xb38b('0x6'));var auth=require(_0xb38b('0x7'));var interaction=require(_0xb38b('0x8'));var config=require(_0xb38b('0x9'));var controller=require(_0xb38b('0xa'));router[_0xb38b('0xb')]('/',auth[_0xb38b('0xc')](),controller[_0xb38b('0xd')]);router[_0xb38b('0xb')](_0xb38b('0xe'),auth[_0xb38b('0xc')](),controller['describe']);router['get']('/:id',auth[_0xb38b('0xc')](),controller[_0xb38b('0xf')]);router[_0xb38b('0x10')]('/',auth[_0xb38b('0xc')](),controller[_0xb38b('0x11')]);router['put'](_0xb38b('0x12'),auth[_0xb38b('0xc')](),controller[_0xb38b('0x13')]);router[_0xb38b('0x14')](_0xb38b('0x12'),auth[_0xb38b('0xc')](),controller[_0xb38b('0x15')]);module[_0xb38b('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 4b872c2..14d156a 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(_0x2b5f71,_0xf9bbe1){var _0x1b1fe2=function(_0x83a472){while(--_0x83a472){_0x2b5f71['push'](_0x2b5f71['shift']());}};_0x1b1fe2(++_0xf9bbe1);}(_0x7a54,0x106));var _0x47a5=function(_0x1f2582,_0x549f88){_0x1f2582=_0x1f2582-0x0;var _0x4d6f1c=_0x7a54[_0x1f2582];return _0x4d6f1c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1391f5,_0x2b52e5){var _0x8ff28c=function(_0x302d29){while(--_0x302d29){_0x1391f5['push'](_0x1391f5['shift']());}};_0x8ff28c(++_0x2b52e5);}(_0x7a54,0x106));var _0x47a5=function(_0x5591ee,_0x5b41a6){_0x5591ee=_0x5591ee-0x0;var _0x55c27a=_0x7a54[_0x5591ee];return _0x55c27a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e300cab..8c9356f 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 _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file +var _0x63a5=['filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x24a4aa,_0x5bd7a8){var _0x2b4465=function(_0xbfb97d){while(--_0xbfb97d){_0x24a4aa['push'](_0x24a4aa['shift']());}};_0x2b4465(++_0x5bd7a8);}(_0x63a5,0x18e));var _0x563a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x63a5[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0x1682ee,_0x3642b3){return function(_0x173990){if(!_0x173990){_0x1682ee['sendStatus'](0x194);}return _0x173990;};}function handleError(_0x146ea0,_0x2b688e){_0x2b688e=_0x2b688e||0x1f4;return function(_0x2311f2){logger[_0x563a('0x28')](_0x2311f2[_0x563a('0x29')]);if(_0x2311f2[_0x563a('0x2a')]){delete _0x2311f2[_0x563a('0x2a')];}_0x146ea0[_0x563a('0x1a')](_0x2b688e)[_0x563a('0x2b')](_0x2311f2);};}exports[_0x563a('0x2c')]=function(_0x1a69d5,_0x24d1a8){var _0x1bdfb0={},_0x7696c2={},_0x579cb5={'count':0x0,'rows':[]};var _0x43379c=_[_0x563a('0x2d')](db[_0x563a('0x2e')]['rawAttributes'],function(_0x1e8d43){return{'name':_0x1e8d43[_0x563a('0x2f')],'type':_0x1e8d43[_0x563a('0x30')][_0x563a('0x31')]};});_0x7696c2[_0x563a('0x32')]=_[_0x563a('0x2d')](_0x43379c,_0x563a('0x2a'));_0x7696c2['query']=_[_0x563a('0x33')](_0x1a69d5[_0x563a('0x34')]);_0x7696c2[_0x563a('0x35')]=_[_0x563a('0x36')](_0x7696c2[_0x563a('0x32')],_0x7696c2['query']);_0x1bdfb0['attributes']=_['intersection'](_0x7696c2['model'],qs[_0x563a('0x37')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x37')]));_0x1bdfb0[_0x563a('0x38')]=_0x1bdfb0[_0x563a('0x38')][_0x563a('0x39')]?_0x1bdfb0['attributes']:_0x7696c2['model'];if(!_0x1a69d5[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x1bdfb0[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1e')]);_0x1bdfb0[_0x563a('0x1f')]=qs[_0x563a('0x1f')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1f')]);}_0x1bdfb0[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x3d')]);_0x1bdfb0[_0x563a('0x3e')]=qs['filters'](_[_0x563a('0x3f')](_0x1a69d5[_0x563a('0x34')],_0x7696c2[_0x563a('0x35')]),_0x43379c);if(_0x1a69d5['query'][_0x563a('0x40')]){_0x1bdfb0['where']=_[_0x563a('0x41')](_0x1bdfb0[_0x563a('0x3e')],{'$or':_['map'](_0x43379c,function(_0x52e4a2){if(_0x52e4a2[_0x563a('0x30')]!=='VIRTUAL'){var _0x13b795={};_0x13b795[_0x52e4a2[_0x563a('0x2a')]]={'$like':'%'+_0x1a69d5[_0x563a('0x34')][_0x563a('0x40')]+'%'};return _0x13b795;}})});}_0x1bdfb0=_['merge']({},_0x1bdfb0,_0x1a69d5['options']);var _0x615d2e={'where':_0x1bdfb0['where']};return db[_0x563a('0x2e')][_0x563a('0x20')](_0x615d2e)[_0x563a('0x26')](function(_0x9c392c){_0x579cb5[_0x563a('0x20')]=_0x9c392c;if(_0x1a69d5[_0x563a('0x34')][_0x563a('0x42')]){_0x1bdfb0[_0x563a('0x43')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x563a('0x44')](_0x1bdfb0);})['then'](function(_0x20c142){_0x579cb5[_0x563a('0x45')]=_0x20c142;return _0x579cb5;})[_0x563a('0x26')](respondWithFilteredResult(_0x24d1a8,_0x1bdfb0))[_0x563a('0x46')](handleError(_0x24d1a8,null));};exports['show']=function(_0x4b3d38,_0x54ac1e){var _0x2221d4={'raw':!![],'where':{'id':_0x4b3d38[_0x563a('0x47')]['id']}},_0x1255da={};_0x1255da[_0x563a('0x32')]=_[_0x563a('0x33')](db[_0x563a('0x2e')][_0x563a('0x48')]);_0x1255da[_0x563a('0x34')]=_[_0x563a('0x33')](_0x4b3d38[_0x563a('0x34')]);_0x1255da[_0x563a('0x35')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],_0x1255da[_0x563a('0x34')]);_0x2221d4[_0x563a('0x38')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],qs[_0x563a('0x37')](_0x4b3d38[_0x563a('0x34')]['fields']));_0x2221d4['attributes']=_0x2221d4[_0x563a('0x38')][_0x563a('0x39')]?_0x2221d4[_0x563a('0x38')]:_0x1255da[_0x563a('0x32')];if(_0x4b3d38[_0x563a('0x34')][_0x563a('0x42')]){_0x2221d4[_0x563a('0x43')]=[{'all':!![]}];}_0x2221d4=_[_0x563a('0x41')]({},_0x2221d4,_0x4b3d38['options']);return db['WhatsappQueueReport'][_0x563a('0x49')](_0x2221d4)[_0x563a('0x26')](handleEntityNotFound(_0x54ac1e,null))[_0x563a('0x26')](respondWithResult(_0x54ac1e,null))[_0x563a('0x46')](handleError(_0x54ac1e,null));};exports[_0x563a('0x4a')]=function(_0x3f2c5d,_0x2689b5){return db[_0x563a('0x2e')]['create'](_0x3f2c5d[_0x563a('0x4b')],{})[_0x563a('0x26')](respondWithResult(_0x2689b5,0xc9))['catch'](handleError(_0x2689b5,null));};exports[_0x563a('0x25')]=function(_0x5a063a,_0x3ea787){if(_0x5a063a[_0x563a('0x4b')]['id']){delete _0x5a063a[_0x563a('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x563a('0x49')]({'where':{'id':_0x5a063a[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3ea787,null))[_0x563a('0x26')](saveUpdates(_0x5a063a[_0x563a('0x4b')],null))[_0x563a('0x26')](respondWithResult(_0x3ea787,null))[_0x563a('0x46')](handleError(_0x3ea787,null));};exports[_0x563a('0x27')]=function(_0x277d54,_0x2008d4){return db[_0x563a('0x2e')][_0x563a('0x49')]({'where':{'id':_0x277d54[_0x563a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2008d4,null))['then'](removeEntity(_0x2008d4,null))[_0x563a('0x46')](handleError(_0x2008d4,null));};exports[_0x563a('0x4c')]=function(_0x143daa,_0x4a807f){return db['WhatsappQueueReport'][_0x563a('0x4c')]()[_0x563a('0x26')](respondWithResult(_0x4a807f,null))['catch'](handleError(_0x4a807f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 76801b3..275a1f0 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 _0xbfd2=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x3d48d7,_0x1c7049){var _0x3f0470=function(_0x47bcbf){while(--_0x47bcbf){_0x3d48d7['push'](_0x3d48d7['shift']());}};_0x3f0470(++_0x1c7049);}(_0xbfd2,0x82));var _0x2bfd=function(_0x726661,_0x16b87c){_0x726661=_0x726661-0x0;var _0x471c6b=_0xbfd2[_0x726661];return _0x471c6b;};'use strict';var _=require(_0x2bfd('0x0'));var util=require(_0x2bfd('0x1'));var logger=require(_0x2bfd('0x2'))(_0x2bfd('0x3'));var moment=require('moment');var BPromise=require(_0x2bfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bfd('0x5'));var rimraf=require('rimraf');var config=require(_0x2bfd('0x6'));var attributes=require(_0x2bfd('0x7'));module[_0x2bfd('0x8')]=function(_0x3e6610,_0x1a2935){return _0x3e6610[_0x2bfd('0x9')](_0x2bfd('0xa'),attributes,{'tableName':_0x2bfd('0xb'),'paranoid':![],'indexes':[{'name':_0x2bfd('0xc'),'fields':[_0x2bfd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25bb=['uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x418100,_0x452af7){var _0x3bbf71=function(_0x22568a){while(--_0x22568a){_0x418100['push'](_0x418100['shift']());}};_0x3bbf71(++_0x452af7);}(_0x25bb,0x10b));var _0xb25b=function(_0x515254,_0xd480a8){_0x515254=_0x515254-0x0;var _0x3ca863=_0x25bb[_0x515254];return _0x3ca863;};'use strict';var _=require(_0xb25b('0x0'));var util=require(_0xb25b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb25b('0x2'));var BPromise=require(_0xb25b('0x3'));var rp=require(_0xb25b('0x4'));var fs=require('fs');var path=require(_0xb25b('0x5'));var rimraf=require(_0xb25b('0x6'));var config=require(_0xb25b('0x7'));var attributes=require(_0xb25b('0x8'));module[_0xb25b('0x9')]=function(_0x4ee0da,_0x316ad4){return _0x4ee0da[_0xb25b('0xa')](_0xb25b('0xb'),attributes,{'tableName':_0xb25b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb25b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index fb652e6..1e2f569 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 _0x07d7=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','debug','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','then','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x07d7,0x1cc));var _0x707d=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x07d7[_0x4aa4e6];return _0x322588;};'use strict';var _=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var moment=require('moment');var BPromise=require(_0x707d('0x2'));var rs=require(_0x707d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x707d('0x4'))['db'];var utils=require(_0x707d('0x5'));var logger=require(_0x707d('0x6'))(_0x707d('0x7'));var config=require('../../config/environment');var jayson=require(_0x707d('0x8'));var client=jayson[_0x707d('0x9')][_0x707d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b497,_0x30b21d,_0x35a2d5){return new BPromise(function(_0x1a39f7,_0x3f0394){return client['request'](_0x34b497,_0x35a2d5)['then'](function(_0x1f7e5f){logger[_0x707d('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x30b21d,_0x707d('0xc'));logger['debug'](_0x707d('0xd'),_0x30b21d,_0x707d('0xc'),JSON[_0x707d('0xe')](_0x1f7e5f));if(_0x1f7e5f['error']){if(_0x1f7e5f[_0x707d('0xf')][_0x707d('0x10')]===0x1f4){logger[_0x707d('0xf')](_0x707d('0x11'),_0x30b21d,_0x1f7e5f[_0x707d('0xf')][_0x707d('0x12')]);return _0x3f0394(_0x1f7e5f['error']['message']);}logger['error'](_0x707d('0x11'),_0x30b21d,_0x1f7e5f[_0x707d('0xf')][_0x707d('0x12')]);return _0x1a39f7(_0x1f7e5f[_0x707d('0xf')]['message']);}else{logger['info'](_0x707d('0x11'),_0x30b21d,_0x707d('0xc'));_0x1a39f7(_0x1f7e5f[_0x707d('0x13')][_0x707d('0x12')]);}})[_0x707d('0x14')](function(_0x32884a){logger['error'](_0x707d('0x11'),_0x30b21d,_0x32884a);_0x3f0394(_0x32884a);});});}exports[_0x707d('0x15')]=function(_0x405b37){var _0xe728f8=this;return new Promise(function(_0x8c1e3a,_0x2802bf){return db[_0x707d('0x16')][_0x707d('0x17')](_0x405b37['body'],{'raw':_0x405b37[_0x707d('0x18')]?_0x405b37[_0x707d('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x131625){logger['info'](_0x707d('0x15'),_0x405b37);logger[_0x707d('0x19')](_0x707d('0x15'),_0x405b37,JSON[_0x707d('0xe')](_0x131625));_0x8c1e3a(_0x131625);})['catch'](function(_0x1c8e41){logger[_0x707d('0xf')]('CreateWhatsappQueueReport',_0x1c8e41['message'],_0x405b37);_0x2802bf(_0xe728f8[_0x707d('0xf')](0x1f4,_0x1c8e41[_0x707d('0x12')]));});});};exports[_0x707d('0x1a')]=function(_0x5e1d81){var _0x3c1c69=this;return new Promise(function(_0x41e37b,_0x13ac8a){return db[_0x707d('0x16')][_0x707d('0x1b')](_0x5e1d81['body'],{'raw':_0x5e1d81['options']?_0x5e1d81[_0x707d('0x18')][_0x707d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1d81[_0x707d('0x18')]?_0x5e1d81[_0x707d('0x18')][_0x707d('0x1d')]||null:null,'attributes':_0x5e1d81[_0x707d('0x18')]?_0x5e1d81[_0x707d('0x18')][_0x707d('0x1e')]||null:null,'limit':_0x5e1d81[_0x707d('0x18')]?_0x5e1d81[_0x707d('0x18')][_0x707d('0x1f')]||null:null})[_0x707d('0x20')](function(_0x3887d5){logger[_0x707d('0xb')](_0x707d('0x1a'),_0x5e1d81);logger[_0x707d('0x19')]('UpdateWhatsappQueueReport',_0x5e1d81,JSON[_0x707d('0xe')](_0x3887d5));_0x41e37b(_0x3887d5);})[_0x707d('0x14')](function(_0x24fdc5){logger[_0x707d('0xf')](_0x707d('0x1a'),_0x24fdc5['message'],_0x5e1d81);_0x13ac8a(_0x3c1c69[_0x707d('0xf')](0x1f4,_0x24fdc5[_0x707d('0x12')]));});});}; \ No newline at end of file +var _0xfb44=['client','http','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0xfb44,0x97));var _0x4fb4=function(_0x55b135,_0x5a0658){_0x55b135=_0x55b135-0x0;var _0x44f5b8=_0xfb44[_0x55b135];return _0x44f5b8;};'use strict';var _=require(_0x4fb4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fb4('0x1'));var rs=require(_0x4fb4('0x2'));var fs=require('fs');var Redis=require(_0x4fb4('0x3'));var db=require(_0x4fb4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fb4('0x5'))(_0x4fb4('0x6'));var config=require(_0x4fb4('0x7'));var jayson=require(_0x4fb4('0x8'));var client=jayson[_0x4fb4('0x9')][_0x4fb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537cf4,_0x5a3eca,_0x1e0b44){return new BPromise(function(_0x1a8190,_0x385094){return client['request'](_0x537cf4,_0x1e0b44)['then'](function(_0x59557f){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x5a3eca,_0x4fb4('0xb'));logger[_0x4fb4('0xc')](_0x4fb4('0xd'),_0x5a3eca,_0x4fb4('0xb'),JSON[_0x4fb4('0xe')](_0x59557f));if(_0x59557f[_0x4fb4('0xf')]){if(_0x59557f['error'][_0x4fb4('0x10')]===0x1f4){logger[_0x4fb4('0xf')](_0x4fb4('0x11'),_0x5a3eca,_0x59557f[_0x4fb4('0xf')][_0x4fb4('0x12')]);return _0x385094(_0x59557f[_0x4fb4('0xf')]['message']);}logger['error'](_0x4fb4('0x11'),_0x5a3eca,_0x59557f[_0x4fb4('0xf')]['message']);return _0x1a8190(_0x59557f[_0x4fb4('0xf')]['message']);}else{logger[_0x4fb4('0x13')](_0x4fb4('0x11'),_0x5a3eca,'request\x20sent');_0x1a8190(_0x59557f['result'][_0x4fb4('0x12')]);}})[_0x4fb4('0x14')](function(_0x3a3914){logger[_0x4fb4('0xf')](_0x4fb4('0x11'),_0x5a3eca,_0x3a3914);_0x385094(_0x3a3914);});});}exports[_0x4fb4('0x15')]=function(_0x10f0f2){var _0xdb1183=this;return new Promise(function(_0x5421b5,_0x425445){return db[_0x4fb4('0x16')][_0x4fb4('0x17')](_0x10f0f2[_0x4fb4('0x18')],{'raw':_0x10f0f2[_0x4fb4('0x19')]?_0x10f0f2['options'][_0x4fb4('0x1a')]===undefined?!![]:![]:!![]})[_0x4fb4('0x1b')](function(_0x3c396a){logger[_0x4fb4('0x13')](_0x4fb4('0x15'),_0x10f0f2);logger[_0x4fb4('0xc')](_0x4fb4('0x15'),_0x10f0f2,JSON[_0x4fb4('0xe')](_0x3c396a));_0x5421b5(_0x3c396a);})[_0x4fb4('0x14')](function(_0x1cd045){logger[_0x4fb4('0xf')]('CreateWhatsappQueueReport',_0x1cd045[_0x4fb4('0x12')],_0x10f0f2);_0x425445(_0xdb1183['error'](0x1f4,_0x1cd045[_0x4fb4('0x12')]));});});};exports[_0x4fb4('0x1c')]=function(_0x294589){var _0x5ca33c=this;return new Promise(function(_0x20d8d7,_0xf66f3d){return db[_0x4fb4('0x16')]['update'](_0x294589['body'],{'raw':_0x294589[_0x4fb4('0x19')]?_0x294589[_0x4fb4('0x19')][_0x4fb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294589[_0x4fb4('0x19')]?_0x294589[_0x4fb4('0x19')][_0x4fb4('0x1d')]||null:null,'attributes':_0x294589['options']?_0x294589[_0x4fb4('0x19')][_0x4fb4('0x1e')]||null:null,'limit':_0x294589[_0x4fb4('0x19')]?_0x294589[_0x4fb4('0x19')][_0x4fb4('0x1f')]||null:null})[_0x4fb4('0x1b')](function(_0x23b156){logger[_0x4fb4('0x13')](_0x4fb4('0x1c'),_0x294589);logger['debug'](_0x4fb4('0x1c'),_0x294589,JSON[_0x4fb4('0xe')](_0x23b156));_0x20d8d7(_0x23b156);})[_0x4fb4('0x14')](function(_0x593202){logger[_0x4fb4('0xf')]('UpdateWhatsappQueueReport',_0x593202[_0x4fb4('0x12')],_0x294589);_0xf66f3d(_0x5ca33c[_0x4fb4('0xf')](0x1f4,_0x593202['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f2d7ddf..732f788 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 _0x944e=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports'];(function(_0x2f875d,_0x712152){var _0x1d1bee=function(_0x37c001){while(--_0x37c001){_0x2f875d['push'](_0x2f875d['shift']());}};_0x1d1bee(++_0x712152);}(_0x944e,0xf7));var _0xe944=function(_0x5bc6ce,_0x204885){_0x5bc6ce=_0x5bc6ce-0x0;var _0x2a0e88=_0x944e[_0x5bc6ce];return _0x2a0e88;};'use strict';var multer=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe944('0x2'));var router=express[_0xe944('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe944('0x4'));var interaction=require(_0xe944('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xe944('0x6')]('/',auth['isAuthenticated'](),controller[_0xe944('0x7')]);router[_0xe944('0x6')](_0xe944('0x8'),auth['isAuthenticated'](),controller[_0xe944('0x9')]);router[_0xe944('0x6')](_0xe944('0xa'),auth['isAuthenticated'](),controller[_0xe944('0xb')]);router[_0xe944('0xc')]('/',auth[_0xe944('0xd')](),controller[_0xe944('0xe')]);router['put'](_0xe944('0xa'),auth[_0xe944('0xd')](),controller[_0xe944('0xf')]);router[_0xe944('0x10')](_0xe944('0xa'),auth[_0xe944('0xd')](),controller[_0xe944('0x11')]);module[_0xe944('0x12')]=router; \ No newline at end of file +var _0x4b13=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x57779a,_0x4b2276){var _0x4030d2=function(_0x2269af){while(--_0x2269af){_0x57779a['push'](_0x57779a['shift']());}};_0x4030d2(++_0x4b2276);}(_0x4b13,0x72));var _0x34b1=function(_0x581f35,_0x46695d){_0x581f35=_0x581f35-0x0;var _0x2121f1=_0x4b13[_0x581f35];return _0x2121f1;};'use strict';var multer=require(_0x34b1('0x0'));var util=require(_0x34b1('0x1'));var path=require(_0x34b1('0x2'));var timeout=require(_0x34b1('0x3'));var express=require(_0x34b1('0x4'));var router=express[_0x34b1('0x5')]();var fs_extra=require(_0x34b1('0x6'));var auth=require(_0x34b1('0x7'));var interaction=require(_0x34b1('0x8'));var config=require('../../config/environment');var controller=require(_0x34b1('0x9'));router[_0x34b1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x34b1('0xb'),auth[_0x34b1('0xc')](),controller[_0x34b1('0xd')]);router[_0x34b1('0xa')]('/:id',auth[_0x34b1('0xc')](),controller[_0x34b1('0xe')]);router[_0x34b1('0xf')]('/',auth[_0x34b1('0xc')](),controller[_0x34b1('0x10')]);router[_0x34b1('0x11')](_0x34b1('0x12'),auth[_0x34b1('0xc')](),controller[_0x34b1('0x13')]);router[_0x34b1('0x14')](_0x34b1('0x12'),auth[_0x34b1('0xc')](),controller[_0x34b1('0x15')]);module[_0x34b1('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 8931b52..b9e2f9d 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 _0xdf4d=['STRING','account','agent','queue','DATE','exports'];(function(_0x592416,_0x2c75e9){var _0x3005fa=function(_0x21d0dd){while(--_0x21d0dd){_0x592416['push'](_0x592416['shift']());}};_0x3005fa(++_0x2c75e9);}(_0xdf4d,0xcb));var _0xddf4=function(_0x16decf,_0x5efedd){_0x16decf=_0x16decf-0x0;var _0x4829f1=_0xdf4d[_0x16decf];return _0x4829f1;};'use strict';var Sequelize=require('sequelize');module[_0xddf4('0x0')]={'uniqueid':{'type':Sequelize[_0xddf4('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xddf4('0x2'),_0xddf4('0x3'),_0xddf4('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xddf4('0x5')]}}; \ No newline at end of file +var _0xc5df=['STRING','ENUM','queue','DATE'];(function(_0x4e23a8,_0x3d421d){var _0x5089d6=function(_0x336a19){while(--_0x336a19){_0x4e23a8['push'](_0x4e23a8['shift']());}};_0x5089d6(++_0x3d421d);}(_0xc5df,0x80));var _0xfc5d=function(_0x8f04b8,_0x6e6dd4){_0x8f04b8=_0x8f04b8-0x0;var _0x3eb441=_0xc5df[_0x8f04b8];return _0x3eb441;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xfc5d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xfc5d('0x1')]('account','agent',_0xfc5d('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfc5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 87a3307..26d0d3f 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 _0x0c33=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappTransferReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format'];(function(_0x7fb377,_0x2357b5){var _0x4770a5=function(_0x381d8c){while(--_0x381d8c){_0x7fb377['push'](_0x7fb377['shift']());}};_0x4770a5(++_0x2357b5);}(_0x0c33,0x180));var _0x30c3=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x0c33[_0x3c5f8d];return _0x3b7beb;};'use strict';var emlformat=require(_0x30c3('0x0'));var rimraf=require(_0x30c3('0x1'));var zipdir=require(_0x30c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30c3('0x3'));var moment=require(_0x30c3('0x4'));var BPromise=require(_0x30c3('0x5'));var Mustache=require(_0x30c3('0x6'));var util=require(_0x30c3('0x7'));var path=require(_0x30c3('0x8'));var sox=require('sox');var csv=require(_0x30c3('0x9'));var ejs=require(_0x30c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30c3('0xb'));var squel=require(_0x30c3('0xc'));var crypto=require(_0x30c3('0xd'));var jsforce=require(_0x30c3('0xe'));var deskjs=require(_0x30c3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x30c3('0x10'));var Redis=require(_0x30c3('0x11'));var authService=require(_0x30c3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x30c3('0x13'));var hardwareService=require(_0x30c3('0x14'));var logger=require(_0x30c3('0x15'))(_0x30c3('0x16'));var utils=require(_0x30c3('0x17'));var config=require(_0x30c3('0x18'));var licenseUtil=require(_0x30c3('0x19'));var db=require(_0x30c3('0x1a'))['db'];function respondWithStatusCode(_0x5dbe54,_0x2c21d5){_0x2c21d5=_0x2c21d5||0xcc;return function(_0x3f7b82){if(_0x3f7b82){return _0x5dbe54['sendStatus'](_0x2c21d5);}return _0x5dbe54[_0x30c3('0x1b')](_0x2c21d5)[_0x30c3('0x1c')]();};}function respondWithResult(_0x2e1811,_0x26239f){_0x26239f=_0x26239f||0xc8;return function(_0x216575){if(_0x216575){return _0x2e1811[_0x30c3('0x1b')](_0x26239f)[_0x30c3('0x1d')](_0x216575);}};}function respondWithFilteredResult(_0x5852f7,_0x14f8b6){return function(_0x144fe8){if(_0x144fe8){var _0x340611=typeof _0x14f8b6[_0x30c3('0x1e')]===_0x30c3('0x1f')&&typeof _0x14f8b6[_0x30c3('0x20')]==='undefined';var _0x4d41e8=_0x144fe8['count'];var _0x48e3ed=_0x340611?0x0:_0x14f8b6[_0x30c3('0x1e')];var _0x4c58d0=_0x340611?_0x144fe8[_0x30c3('0x21')]:_0x14f8b6[_0x30c3('0x1e')]+_0x14f8b6['limit'];var _0x10faf0;if(_0x4c58d0>=_0x4d41e8){_0x4c58d0=_0x4d41e8;_0x10faf0=0xc8;}else{_0x10faf0=0xce;}_0x5852f7['status'](_0x10faf0);return _0x5852f7['set']('Content-Range',_0x48e3ed+'-'+_0x4c58d0+'/'+_0x4d41e8)[_0x30c3('0x1d')](_0x144fe8);}return null;};}function patchUpdates(_0x2e2e8c){return function(_0x4c92a0){try{jsonpatch['apply'](_0x4c92a0,_0x2e2e8c,!![]);}catch(_0x715009){return BPromise[_0x30c3('0x22')](_0x715009);}return _0x4c92a0[_0x30c3('0x23')]();};}function saveUpdates(_0x486be6,_0x2f1ef1){return function(_0x5246c0){if(_0x5246c0){return _0x5246c0[_0x30c3('0x24')](_0x486be6)[_0x30c3('0x25')](function(_0x2881f0){return _0x2881f0;});}return null;};}function removeEntity(_0xe1cead,_0xd679fa){return function(_0x48227b){if(_0x48227b){return _0x48227b[_0x30c3('0x26')]()['then'](function(){_0xe1cead[_0x30c3('0x1b')](0xcc)[_0x30c3('0x1c')]();});}};}function handleEntityNotFound(_0x3d6240,_0x285171){return function(_0x20deb6){if(!_0x20deb6){_0x3d6240['sendStatus'](0x194);}return _0x20deb6;};}function handleError(_0x516854,_0x44ae97){_0x44ae97=_0x44ae97||0x1f4;return function(_0x3afad2){logger['error'](_0x3afad2[_0x30c3('0x27')]);if(_0x3afad2[_0x30c3('0x28')]){delete _0x3afad2[_0x30c3('0x28')];}_0x516854[_0x30c3('0x1b')](_0x44ae97)[_0x30c3('0x29')](_0x3afad2);};}exports[_0x30c3('0x2a')]=function(_0x44e40f,_0x5ca938){var _0x4e55b9={},_0x4dfa8d={},_0x22b916={'count':0x0,'rows':[]};var _0xc950e5=_[_0x30c3('0x2b')](db[_0x30c3('0x2c')]['rawAttributes'],function(_0x58c05f){return{'name':_0x58c05f[_0x30c3('0x2d')],'type':_0x58c05f['type'][_0x30c3('0x2e')]};});_0x4dfa8d['model']=_[_0x30c3('0x2b')](_0xc950e5,_0x30c3('0x28'));_0x4dfa8d[_0x30c3('0x2f')]=_[_0x30c3('0x30')](_0x44e40f[_0x30c3('0x2f')]);_0x4dfa8d[_0x30c3('0x31')]=_[_0x30c3('0x32')](_0x4dfa8d[_0x30c3('0x33')],_0x4dfa8d[_0x30c3('0x2f')]);_0x4e55b9[_0x30c3('0x34')]=_['intersection'](_0x4dfa8d['model'],qs[_0x30c3('0x35')](_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x35')]));_0x4e55b9[_0x30c3('0x34')]=_0x4e55b9[_0x30c3('0x34')][_0x30c3('0x36')]?_0x4e55b9[_0x30c3('0x34')]:_0x4dfa8d[_0x30c3('0x33')];if(!_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x37')](_0x30c3('0x38'))){_0x4e55b9[_0x30c3('0x20')]=qs[_0x30c3('0x20')](_0x44e40f['query'][_0x30c3('0x20')]);_0x4e55b9[_0x30c3('0x1e')]=qs[_0x30c3('0x1e')](_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x1e')]);}_0x4e55b9[_0x30c3('0x39')]=qs[_0x30c3('0x3a')](_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x3a')]);_0x4e55b9[_0x30c3('0x3b')]=qs[_0x30c3('0x31')](_['pick'](_0x44e40f[_0x30c3('0x2f')],_0x4dfa8d['filters']),_0xc950e5);if(_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x3c')]){_0x4e55b9[_0x30c3('0x3b')]=_['merge'](_0x4e55b9['where'],{'$or':_[_0x30c3('0x2b')](_0xc950e5,function(_0x4de0e5){if(_0x4de0e5[_0x30c3('0x3d')]!==_0x30c3('0x3e')){var _0x5076a6={};_0x5076a6[_0x4de0e5['name']]={'$like':'%'+_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x3c')]+'%'};return _0x5076a6;}})});}_0x4e55b9=_[_0x30c3('0x3f')]({},_0x4e55b9,_0x44e40f['options']);var _0x22e827={'where':_0x4e55b9['where']};return db[_0x30c3('0x2c')][_0x30c3('0x21')](_0x22e827)[_0x30c3('0x25')](function(_0x1a0c74){_0x22b916[_0x30c3('0x21')]=_0x1a0c74;if(_0x44e40f[_0x30c3('0x2f')][_0x30c3('0x40')]){_0x4e55b9[_0x30c3('0x41')]=[{'all':!![]}];}return db[_0x30c3('0x2c')][_0x30c3('0x42')](_0x4e55b9);})[_0x30c3('0x25')](function(_0x31fb6a){_0x22b916[_0x30c3('0x43')]=_0x31fb6a;return _0x22b916;})[_0x30c3('0x25')](respondWithFilteredResult(_0x5ca938,_0x4e55b9))[_0x30c3('0x44')](handleError(_0x5ca938,null));};exports[_0x30c3('0x45')]=function(_0x5681c5,_0x83a2a0){var _0xdf38d2={'raw':!![],'where':{'id':_0x5681c5[_0x30c3('0x46')]['id']}},_0x568ff6={};_0x568ff6[_0x30c3('0x33')]=_[_0x30c3('0x30')](db[_0x30c3('0x2c')][_0x30c3('0x47')]);_0x568ff6['query']=_[_0x30c3('0x30')](_0x5681c5['query']);_0x568ff6[_0x30c3('0x31')]=_[_0x30c3('0x32')](_0x568ff6[_0x30c3('0x33')],_0x568ff6[_0x30c3('0x2f')]);_0xdf38d2[_0x30c3('0x34')]=_[_0x30c3('0x32')](_0x568ff6[_0x30c3('0x33')],qs['fields'](_0x5681c5[_0x30c3('0x2f')]['fields']));_0xdf38d2[_0x30c3('0x34')]=_0xdf38d2[_0x30c3('0x34')][_0x30c3('0x36')]?_0xdf38d2[_0x30c3('0x34')]:_0x568ff6[_0x30c3('0x33')];if(_0x5681c5['query']['includeAll']){_0xdf38d2[_0x30c3('0x41')]=[{'all':!![]}];}_0xdf38d2=_['merge']({},_0xdf38d2,_0x5681c5[_0x30c3('0x48')]);return db[_0x30c3('0x2c')][_0x30c3('0x49')](_0xdf38d2)[_0x30c3('0x25')](handleEntityNotFound(_0x83a2a0,null))[_0x30c3('0x25')](respondWithResult(_0x83a2a0,null))[_0x30c3('0x44')](handleError(_0x83a2a0,null));};exports[_0x30c3('0x4a')]=function(_0x5c7ca9,_0x4d673d){return db[_0x30c3('0x2c')][_0x30c3('0x4a')](_0x5c7ca9[_0x30c3('0x4b')],{})['then'](respondWithResult(_0x4d673d,0xc9))[_0x30c3('0x44')](handleError(_0x4d673d,null));};exports[_0x30c3('0x24')]=function(_0x19f05b,_0x5c531f){if(_0x19f05b[_0x30c3('0x4b')]['id']){delete _0x19f05b[_0x30c3('0x4b')]['id'];}return db[_0x30c3('0x2c')][_0x30c3('0x49')]({'where':{'id':_0x19f05b[_0x30c3('0x46')]['id']}})[_0x30c3('0x25')](handleEntityNotFound(_0x5c531f,null))[_0x30c3('0x25')](saveUpdates(_0x19f05b[_0x30c3('0x4b')],null))[_0x30c3('0x25')](respondWithResult(_0x5c531f,null))[_0x30c3('0x44')](handleError(_0x5c531f,null));};exports['destroy']=function(_0x3964ae,_0x548cfc){return db[_0x30c3('0x2c')]['find']({'where':{'id':_0x3964ae[_0x30c3('0x46')]['id']}})[_0x30c3('0x25')](handleEntityNotFound(_0x548cfc,null))['then'](removeEntity(_0x548cfc,null))['catch'](handleError(_0x548cfc,null));};exports[_0x30c3('0x4c')]=function(_0x26e6bf,_0x5cedc5){return db[_0x30c3('0x2c')][_0x30c3('0x4c')]()[_0x30c3('0x25')](respondWithResult(_0x5cedc5,null))[_0x30c3('0x44')](handleError(_0x5cedc5,null));}; \ No newline at end of file +var _0x17a6=['nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5bf639,_0x5b6d7c){var _0x37dd50=function(_0x499297){while(--_0x499297){_0x5bf639['push'](_0x5bf639['shift']());}};_0x37dd50(++_0x5b6d7c);}(_0x17a6,0x64));var _0x617a=function(_0x514669,_0x345f3e){_0x514669=_0x514669-0x0;var _0x4cb383=_0x17a6[_0x514669];return _0x4cb383;};'use strict';var emlformat=require(_0x617a('0x0'));var rimraf=require(_0x617a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x617a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x617a('0x3'));var Mustache=require(_0x617a('0x4'));var util=require(_0x617a('0x5'));var path=require(_0x617a('0x6'));var sox=require(_0x617a('0x7'));var csv=require(_0x617a('0x8'));var ejs=require(_0x617a('0x9'));var fs=require('fs');var fs_extra=require(_0x617a('0xa'));var _=require(_0x617a('0xb'));var squel=require(_0x617a('0xc'));var crypto=require(_0x617a('0xd'));var jsforce=require(_0x617a('0xe'));var deskjs=require(_0x617a('0xf'));var toCsv=require(_0x617a('0x8'));var querystring=require(_0x617a('0x10'));var Papa=require(_0x617a('0x11'));var Redis=require(_0x617a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x617a('0x13'));var as=require(_0x617a('0x14'));var hardwareService=require(_0x617a('0x15'));var logger=require(_0x617a('0x16'))(_0x617a('0x17'));var utils=require(_0x617a('0x18'));var config=require(_0x617a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x617a('0x1a'))['db'];function respondWithStatusCode(_0x7db56c,_0x1f51e7){_0x1f51e7=_0x1f51e7||0xcc;return function(_0x10c9ff){if(_0x10c9ff){return _0x7db56c[_0x617a('0x1b')](_0x1f51e7);}return _0x7db56c[_0x617a('0x1c')](_0x1f51e7)[_0x617a('0x1d')]();};}function respondWithResult(_0xb99de3,_0x27a892){_0x27a892=_0x27a892||0xc8;return function(_0x3dae7){if(_0x3dae7){return _0xb99de3[_0x617a('0x1c')](_0x27a892)['json'](_0x3dae7);}};}function respondWithFilteredResult(_0x580d43,_0x260440){return function(_0x3c046b){if(_0x3c046b){var _0x3c39b4=typeof _0x260440[_0x617a('0x1e')]===_0x617a('0x1f')&&typeof _0x260440[_0x617a('0x20')]==='undefined';var _0x4f3430=_0x3c046b[_0x617a('0x21')];var _0x1cb642=_0x3c39b4?0x0:_0x260440[_0x617a('0x1e')];var _0x5654ab=_0x3c39b4?_0x3c046b[_0x617a('0x21')]:_0x260440['offset']+_0x260440[_0x617a('0x20')];var _0xa06f29;if(_0x5654ab>=_0x4f3430){_0x5654ab=_0x4f3430;_0xa06f29=0xc8;}else{_0xa06f29=0xce;}_0x580d43[_0x617a('0x1c')](_0xa06f29);return _0x580d43[_0x617a('0x22')](_0x617a('0x23'),_0x1cb642+'-'+_0x5654ab+'/'+_0x4f3430)[_0x617a('0x24')](_0x3c046b);}return null;};}function patchUpdates(_0x53ef16){return function(_0x2a02cb){try{jsonpatch[_0x617a('0x25')](_0x2a02cb,_0x53ef16,!![]);}catch(_0x362157){return BPromise[_0x617a('0x26')](_0x362157);}return _0x2a02cb[_0x617a('0x27')]();};}function saveUpdates(_0x45be58,_0x45c2cd){return function(_0x3d15d1){if(_0x3d15d1){return _0x3d15d1[_0x617a('0x28')](_0x45be58)[_0x617a('0x29')](function(_0x4043f3){return _0x4043f3;});}return null;};}function removeEntity(_0x2c7540,_0x5a1400){return function(_0x19300b){if(_0x19300b){return _0x19300b['destroy']()[_0x617a('0x29')](function(){_0x2c7540[_0x617a('0x1c')](0xcc)[_0x617a('0x1d')]();});}};}function handleEntityNotFound(_0x422445,_0x3bc579){return function(_0x21c595){if(!_0x21c595){_0x422445[_0x617a('0x1b')](0x194);}return _0x21c595;};}function handleError(_0x52044c,_0x598ed1){_0x598ed1=_0x598ed1||0x1f4;return function(_0xf2eaed){logger[_0x617a('0x2a')](_0xf2eaed[_0x617a('0x2b')]);if(_0xf2eaed['name']){delete _0xf2eaed[_0x617a('0x2c')];}_0x52044c[_0x617a('0x1c')](_0x598ed1)[_0x617a('0x2d')](_0xf2eaed);};}exports[_0x617a('0x2e')]=function(_0x27285c,_0x34bc04){var _0x531a8c={},_0x169be7={},_0x53bc07={'count':0x0,'rows':[]};var _0x7d9a24=_['map'](db[_0x617a('0x2f')][_0x617a('0x30')],function(_0x5bc2c5){return{'name':_0x5bc2c5[_0x617a('0x31')],'type':_0x5bc2c5[_0x617a('0x32')][_0x617a('0x33')]};});_0x169be7[_0x617a('0x34')]=_[_0x617a('0x35')](_0x7d9a24,_0x617a('0x2c'));_0x169be7[_0x617a('0x36')]=_['keys'](_0x27285c[_0x617a('0x36')]);_0x169be7['filters']=_[_0x617a('0x37')](_0x169be7[_0x617a('0x34')],_0x169be7[_0x617a('0x36')]);_0x531a8c[_0x617a('0x38')]=_[_0x617a('0x37')](_0x169be7[_0x617a('0x34')],qs[_0x617a('0x39')](_0x27285c[_0x617a('0x36')][_0x617a('0x39')]));_0x531a8c[_0x617a('0x38')]=_0x531a8c['attributes'][_0x617a('0x3a')]?_0x531a8c[_0x617a('0x38')]:_0x169be7[_0x617a('0x34')];if(!_0x27285c[_0x617a('0x36')][_0x617a('0x3b')](_0x617a('0x3c'))){_0x531a8c[_0x617a('0x20')]=qs[_0x617a('0x20')](_0x27285c[_0x617a('0x36')]['limit']);_0x531a8c['offset']=qs[_0x617a('0x1e')](_0x27285c[_0x617a('0x36')][_0x617a('0x1e')]);}_0x531a8c[_0x617a('0x3d')]=qs['sort'](_0x27285c[_0x617a('0x36')][_0x617a('0x3e')]);_0x531a8c[_0x617a('0x3f')]=qs[_0x617a('0x40')](_[_0x617a('0x41')](_0x27285c['query'],_0x169be7['filters']),_0x7d9a24);if(_0x27285c[_0x617a('0x36')][_0x617a('0x42')]){_0x531a8c[_0x617a('0x3f')]=_[_0x617a('0x43')](_0x531a8c[_0x617a('0x3f')],{'$or':_[_0x617a('0x35')](_0x7d9a24,function(_0x5346a1){if(_0x5346a1['type']!=='VIRTUAL'){var _0xb8b472={};_0xb8b472[_0x5346a1[_0x617a('0x2c')]]={'$like':'%'+_0x27285c['query'][_0x617a('0x42')]+'%'};return _0xb8b472;}})});}_0x531a8c=_[_0x617a('0x43')]({},_0x531a8c,_0x27285c[_0x617a('0x44')]);var _0x4df584={'where':_0x531a8c[_0x617a('0x3f')]};return db['WhatsappTransferReport'][_0x617a('0x21')](_0x4df584)[_0x617a('0x29')](function(_0x4827eb){_0x53bc07['count']=_0x4827eb;if(_0x27285c[_0x617a('0x36')][_0x617a('0x45')]){_0x531a8c[_0x617a('0x46')]=[{'all':!![]}];}return db[_0x617a('0x2f')]['findAll'](_0x531a8c);})[_0x617a('0x29')](function(_0x3c0b9a){_0x53bc07[_0x617a('0x47')]=_0x3c0b9a;return _0x53bc07;})[_0x617a('0x29')](respondWithFilteredResult(_0x34bc04,_0x531a8c))[_0x617a('0x48')](handleError(_0x34bc04,null));};exports[_0x617a('0x49')]=function(_0x43289a,_0x3143bc){var _0x2f6c46={'raw':!![],'where':{'id':_0x43289a[_0x617a('0x4a')]['id']}},_0x83d175={};_0x83d175[_0x617a('0x34')]=_[_0x617a('0x4b')](db[_0x617a('0x2f')]['rawAttributes']);_0x83d175['query']=_[_0x617a('0x4b')](_0x43289a[_0x617a('0x36')]);_0x83d175[_0x617a('0x40')]=_[_0x617a('0x37')](_0x83d175[_0x617a('0x34')],_0x83d175[_0x617a('0x36')]);_0x2f6c46[_0x617a('0x38')]=_[_0x617a('0x37')](_0x83d175[_0x617a('0x34')],qs[_0x617a('0x39')](_0x43289a[_0x617a('0x36')][_0x617a('0x39')]));_0x2f6c46['attributes']=_0x2f6c46['attributes'][_0x617a('0x3a')]?_0x2f6c46[_0x617a('0x38')]:_0x83d175[_0x617a('0x34')];if(_0x43289a['query'][_0x617a('0x45')]){_0x2f6c46[_0x617a('0x46')]=[{'all':!![]}];}_0x2f6c46=_[_0x617a('0x43')]({},_0x2f6c46,_0x43289a['options']);return db[_0x617a('0x2f')]['find'](_0x2f6c46)[_0x617a('0x29')](handleEntityNotFound(_0x3143bc,null))[_0x617a('0x29')](respondWithResult(_0x3143bc,null))[_0x617a('0x48')](handleError(_0x3143bc,null));};exports[_0x617a('0x4c')]=function(_0xe905,_0x454f4b){return db[_0x617a('0x2f')][_0x617a('0x4c')](_0xe905[_0x617a('0x4d')],{})['then'](respondWithResult(_0x454f4b,0xc9))[_0x617a('0x48')](handleError(_0x454f4b,null));};exports[_0x617a('0x28')]=function(_0x587625,_0x57ee00){if(_0x587625['body']['id']){delete _0x587625[_0x617a('0x4d')]['id'];}return db[_0x617a('0x2f')][_0x617a('0x4e')]({'where':{'id':_0x587625[_0x617a('0x4a')]['id']}})[_0x617a('0x29')](handleEntityNotFound(_0x57ee00,null))[_0x617a('0x29')](saveUpdates(_0x587625['body'],null))[_0x617a('0x29')](respondWithResult(_0x57ee00,null))['catch'](handleError(_0x57ee00,null));};exports[_0x617a('0x4f')]=function(_0x3559af,_0x5c5ad6){return db[_0x617a('0x2f')]['find']({'where':{'id':_0x3559af[_0x617a('0x4a')]['id']}})[_0x617a('0x29')](handleEntityNotFound(_0x5c5ad6,null))[_0x617a('0x29')](removeEntity(_0x5c5ad6,null))[_0x617a('0x48')](handleError(_0x5c5ad6,null));};exports['describe']=function(_0x1523af,_0x34f9ad){return db[_0x617a('0x2f')]['describe']()[_0x617a('0x29')](respondWithResult(_0x34f9ad,null))['catch'](handleError(_0x34f9ad,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index de4f9d4..bbee455 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 _0x0d92=['rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','bluebird','request-promise'];(function(_0x5eebe0,_0x13e01d){var _0x3c07e1=function(_0x2266c8){while(--_0x2266c8){_0x5eebe0['push'](_0x5eebe0['shift']());}};_0x3c07e1(++_0x13e01d);}(_0x0d92,0x1d5));var _0x20d9=function(_0x1144b9,_0x3f2b03){_0x1144b9=_0x1144b9-0x0;var _0x329b12=_0x0d92[_0x1144b9];return _0x329b12;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x20d9('0x0'))(_0x20d9('0x1'));var moment=require('moment');var BPromise=require(_0x20d9('0x2'));var rp=require(_0x20d9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20d9('0x4'));var config=require(_0x20d9('0x5'));var attributes=require(_0x20d9('0x6'));module['exports']=function(_0x383404,_0x455682){return _0x383404[_0x20d9('0x7')](_0x20d9('0x8'),attributes,{'tableName':_0x20d9('0x9'),'paranoid':![],'indexes':[{'name':_0x20d9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x84b5=['request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x84b5,0x1dc));var _0x584b=function(_0x3d8c0a,_0x5693dd){_0x3d8c0a=_0x3d8c0a-0x0;var _0x44df10=_0x84b5[_0x3d8c0a];return _0x44df10;};'use strict';var _=require(_0x584b('0x0'));var util=require('util');var logger=require(_0x584b('0x1'))(_0x584b('0x2'));var moment=require(_0x584b('0x3'));var BPromise=require(_0x584b('0x4'));var rp=require(_0x584b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x584b('0x6'));var config=require(_0x584b('0x7'));var attributes=require(_0x584b('0x8'));module[_0x584b('0x9')]=function(_0x59aba0,_0x3293d2){return _0x59aba0[_0x584b('0xa')](_0x584b('0xb'),attributes,{'tableName':_0x584b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 1cbca69..f715c6d 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 _0x2e8e=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x398481,_0x3de964){var _0x3a4d22=function(_0x359ad4){while(--_0x359ad4){_0x398481['push'](_0x398481['shift']());}};_0x3a4d22(++_0x3de964);}(_0x2e8e,0x81));var _0xe2e8=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x2e8e[_0x3f8a03];return _0x147fb2;};'use strict';var _=require(_0xe2e8('0x0'));var util=require(_0xe2e8('0x1'));var moment=require(_0xe2e8('0x2'));var BPromise=require(_0xe2e8('0x3'));var rs=require(_0xe2e8('0x4'));var fs=require('fs');var Redis=require(_0xe2e8('0x5'));var db=require(_0xe2e8('0x6'))['db'];var utils=require(_0xe2e8('0x7'));var logger=require(_0xe2e8('0x8'))(_0xe2e8('0x9'));var config=require('../../config/environment');var jayson=require(_0xe2e8('0xa'));var client=jayson[_0xe2e8('0xb')][_0xe2e8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5222,_0x5a986a,_0x524b94){return new BPromise(function(_0x5ca3fe,_0x5d0eec){return client[_0xe2e8('0xd')](_0x5c5222,_0x524b94)[_0xe2e8('0xe')](function(_0x55298d){logger[_0xe2e8('0xf')](_0xe2e8('0x10'),_0x5a986a,_0xe2e8('0x11'));logger['debug'](_0xe2e8('0x12'),_0x5a986a,_0xe2e8('0x11'),JSON['stringify'](_0x55298d));if(_0x55298d[_0xe2e8('0x13')]){if(_0x55298d[_0xe2e8('0x13')][_0xe2e8('0x14')]===0x1f4){logger[_0xe2e8('0x13')](_0xe2e8('0x10'),_0x5a986a,_0x55298d[_0xe2e8('0x13')]['message']);return _0x5d0eec(_0x55298d[_0xe2e8('0x13')]['message']);}logger[_0xe2e8('0x13')](_0xe2e8('0x10'),_0x5a986a,_0x55298d[_0xe2e8('0x13')][_0xe2e8('0x15')]);return _0x5ca3fe(_0x55298d[_0xe2e8('0x13')][_0xe2e8('0x15')]);}else{logger[_0xe2e8('0xf')](_0xe2e8('0x10'),_0x5a986a,_0xe2e8('0x11'));_0x5ca3fe(_0x55298d[_0xe2e8('0x16')][_0xe2e8('0x15')]);}})[_0xe2e8('0x17')](function(_0x58902f){logger[_0xe2e8('0x13')](_0xe2e8('0x10'),_0x5a986a,_0x58902f);_0x5d0eec(_0x58902f);});});} \ No newline at end of file +var _0xa42b=['jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3b2397,_0x4d52e8){var _0x4a81ea=function(_0xf92c9e){while(--_0xf92c9e){_0x3b2397['push'](_0x3b2397['shift']());}};_0x4a81ea(++_0x4d52e8);}(_0xa42b,0xcf));var _0xba42=function(_0xe0a771,_0x243437){_0xe0a771=_0xe0a771-0x0;var _0x4742f8=_0xa42b[_0xe0a771];return _0x4742f8;};'use strict';var _=require(_0xba42('0x0'));var util=require(_0xba42('0x1'));var moment=require(_0xba42('0x2'));var BPromise=require(_0xba42('0x3'));var rs=require(_0xba42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba42('0x6'))(_0xba42('0x7'));var config=require(_0xba42('0x8'));var jayson=require(_0xba42('0x9'));var client=jayson[_0xba42('0xa')][_0xba42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463296,_0x5bd90d,_0x3444ea){return new BPromise(function(_0x3300f5,_0x11e3a2){return client['request'](_0x463296,_0x3444ea)[_0xba42('0xc')](function(_0x52d817){logger[_0xba42('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5bd90d,_0xba42('0xe'));logger[_0xba42('0xf')](_0xba42('0x10'),_0x5bd90d,'request\x20sent',JSON[_0xba42('0x11')](_0x52d817));if(_0x52d817[_0xba42('0x12')]){if(_0x52d817[_0xba42('0x12')][_0xba42('0x13')]===0x1f4){logger['error'](_0xba42('0x14'),_0x5bd90d,_0x52d817[_0xba42('0x12')][_0xba42('0x15')]);return _0x11e3a2(_0x52d817[_0xba42('0x12')][_0xba42('0x15')]);}logger[_0xba42('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5bd90d,_0x52d817['error']['message']);return _0x3300f5(_0x52d817['error'][_0xba42('0x15')]);}else{logger['info'](_0xba42('0x14'),_0x5bd90d,_0xba42('0xe'));_0x3300f5(_0x52d817[_0xba42('0x16')]['message']);}})[_0xba42('0x17')](function(_0x4cbfd7){logger[_0xba42('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5bd90d,_0x4cbfd7);_0x11e3a2(_0x4cbfd7);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 5b56de5..6c68fc7 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dd4=['./config/seedDB','./config/license','default','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','then','start','info','Online\x20apps:','online','name','join','Offline\x20apps:','map','filter','status','None'];(function(_0x20509e,_0x17e2f8){var _0x592db8=function(_0x47484f){while(--_0x47484f){_0x20509e['push'](_0x20509e['shift']());}};_0x592db8(++_0x17e2f8);}(_0x7dd4,0x1b3));var _0x47dd=function(_0x243cb1,_0x598244){_0x243cb1=_0x243cb1-0x0;var _0x4f17ef=_0x7dd4[_0x243cb1];return _0x4f17ef;};'use strict';var _=require(_0x47dd('0x0'));var mysqldb=require(_0x47dd('0x1'));var rpc=require(_0x47dd('0x2'));var config=require(_0x47dd('0x3'));var logger=require(_0x47dd('0x4'))(_0x47dd('0x5'));var pm2=require(_0x47dd('0x6'));var pm2Config=require(_0x47dd('0x7'));var schedule=require(_0x47dd('0x8'));var chat=require(_0x47dd('0x9'));var whatsapp=require(_0x47dd('0xa'));var transcribe=require(_0x47dd('0xb'));function main(){return mysqldb['db'][_0x47dd('0xc')][_0x47dd('0xd')]()['then'](function(){return rpc[_0x47dd('0xe')]();})[_0x47dd('0xf')](function(_0x2ed232){logger['info'](_0x2ed232);return chat[_0x47dd('0x10')]();})[_0x47dd('0xf')](function(){return whatsapp[_0x47dd('0x10')]();})[_0x47dd('0xf')](function(){return schedule[_0x47dd('0x10')]();})[_0x47dd('0xf')](function(){return transcribe['start']();})[_0x47dd('0xf')](function(_0x3bd3ea){logger['info'](_0x3bd3ea);return pm2['start'](pm2Config);})[_0x47dd('0xf')](function(_0x1f638e){logger[_0x47dd('0x11')](_0x47dd('0x12'),_['map'](_['filter'](_0x1f638e,{'status':_0x47dd('0x13')}),_0x47dd('0x14'))[_0x47dd('0x15')]());logger['info'](_0x47dd('0x16'),_[_0x47dd('0x17')](_[_0x47dd('0x18')](_0x1f638e,function(_0x472c31){return _0x472c31[_0x47dd('0x19')]!==_0x47dd('0x13');}),_0x47dd('0x14'))['join']()||_0x47dd('0x1a'));config['seedDB']&&require(_0x47dd('0x1b'))['default']();require(_0x47dd('0x1c'))[_0x47dd('0x1d')]();})[_0x47dd('0x1e')](function(_0x3704be){logger[_0x47dd('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3704be);process[_0x47dd('0x20')](0x1);});}main(); \ No newline at end of file +var _0xfc97=['default','catch','exit','lodash','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sync','listen','then','start','info','Online\x20apps:','map','filter','online','name','join','status','seedDB','./config/seedDB'];(function(_0x13afc1,_0x53e8fd){var _0x1b97e0=function(_0x48eb82){while(--_0x48eb82){_0x13afc1['push'](_0x13afc1['shift']());}};_0x1b97e0(++_0x53e8fd);}(_0xfc97,0x148));var _0x7fc9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfc97[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7fc9('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x7fc9('0x1'));var config=require(_0x7fc9('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0x7fc9('0x3'));var pm2Config=require(_0x7fc9('0x4'));var schedule=require(_0x7fc9('0x5'));var chat=require(_0x7fc9('0x6'));var whatsapp=require(_0x7fc9('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x7fc9('0x8')]()['then'](function(){return rpc[_0x7fc9('0x9')]();})[_0x7fc9('0xa')](function(_0x3f346f){logger['info'](_0x3f346f);return chat[_0x7fc9('0xb')]();})[_0x7fc9('0xa')](function(){return whatsapp[_0x7fc9('0xb')]();})[_0x7fc9('0xa')](function(){return schedule[_0x7fc9('0xb')]();})[_0x7fc9('0xa')](function(){return transcribe['start']();})[_0x7fc9('0xa')](function(_0x14e3fe){logger[_0x7fc9('0xc')](_0x14e3fe);return pm2['start'](pm2Config);})[_0x7fc9('0xa')](function(_0x5d1f8d){logger[_0x7fc9('0xc')](_0x7fc9('0xd'),_[_0x7fc9('0xe')](_[_0x7fc9('0xf')](_0x5d1f8d,{'status':_0x7fc9('0x10')}),_0x7fc9('0x11'))[_0x7fc9('0x12')]());logger['info']('Offline\x20apps:',_[_0x7fc9('0xe')](_[_0x7fc9('0xf')](_0x5d1f8d,function(_0x208417){return _0x208417[_0x7fc9('0x13')]!==_0x7fc9('0x10');}),'name')['join']()||'None');config[_0x7fc9('0x14')]&&require(_0x7fc9('0x15'))[_0x7fc9('0x16')]();require('./config/license')[_0x7fc9('0x16')]();})[_0x7fc9('0x17')](function(_0x252467){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x252467);process[_0x7fc9('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 2cc1da4..f650c0b 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 _0x132f=['lastPauseAt','crudPermissions','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','findOne','params','disposition','closed','status','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','authorization','Basic','User','find','then','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','json','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','util','moment','secrets','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','pauseType','showWebBar','lastLoginAt'];(function(_0x124ccf,_0x56f83b){var _0x59b051=function(_0x29e98a){while(--_0x29e98a){_0x124ccf['push'](_0x124ccf['shift']());}};_0x59b051(++_0x56f83b);}(_0x132f,0x68));var _0xf132=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x132f[_0x195c21];return _0x3576a8;};'use strict';var db=require(_0xf132('0x0'))['db'];var config=require(_0xf132('0x1'));var hardwareConf=require(_0xf132('0x2'));var licenseUtil=require(_0xf132('0x3'));var encryptor=require(_0xf132('0x4'));var _=require('lodash');var jwt=require(_0xf132('0x5'));var expressJwt=require(_0xf132('0x6'));var compose=require(_0xf132('0x7'));var basicAuth=require(_0xf132('0x8'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0xf132('0x9'));var moment=require(_0xf132('0xa'));var validateJwt=expressJwt({'secret':config[_0xf132('0xb')][_0xf132('0xc')]});var userAttributes=['id',_0xf132('0xd'),'fullname',_0xf132('0xe'),_0xf132('0xf'),_0xf132('0x10'),_0xf132('0x11'),_0xf132('0x12'),_0xf132('0x13'),_0xf132('0x14'),'chatPause',_0xf132('0x15'),_0xf132('0x16'),'smsPause','openchannelPause',_0xf132('0x17'),_0xf132('0x18'),_0xf132('0x19'),_0xf132('0x1a'),_0xf132('0x1b'),'allowmessenger',_0xf132('0x1c'),'alias',_0xf132('0x1d'),_0xf132('0x1e'),_0xf132('0x1f'),'phoneBarEnableRecording',_0xf132('0x20'),'phoneBarEnableSettings',_0xf132('0x21'),_0xf132('0x22'),_0xf132('0x23'),'phoneBarRemoteControlPort',_0xf132('0x24'),_0xf132('0x25'),_0xf132('0x26'),_0xf132('0x27'),'settingsEnabled',_0xf132('0x28'),'downloadVoiceRecordings',_0xf132('0x29'),_0xf132('0x2a'),_0xf132('0x2b'),_0xf132('0x2c')];exports[_0xf132('0x2d')]=function(){return this[_0xf132('0x2e')](!![])['use'](function(_0x506caa,_0x523048,_0x5ae3af){if(_0x506caa[_0xf132('0x2f')]){_0x5ae3af();}else{return db['ChatInteraction'][_0xf132('0x30')]({'where':{'id':_0x506caa[_0xf132('0x31')]['id']},'attributes':['id','closed',_0xf132('0x32')],'raw':!![]})['then'](function(_0x5222d2){if(_0x5222d2&&_0x5222d2[_0xf132('0x33')]){return _0x523048[_0xf132('0x34')](_0x5222d2[_0xf132('0x32')]===_0xf132('0x35')?0x195:0x193)['json']({'message':_0x5222d2['disposition']===_0xf132('0x35')?_0xf132('0x36'):_0xf132('0x37')});}else{_0x5ae3af();}})[_0xf132('0x38')](function(_0x1f6973){_0x5ae3af(_0x1f6973);});}});};exports[_0xf132('0x2e')]=function isAuthenticated(_0x1de9fa){return compose()[_0xf132('0x39')](function(_0x5d2b87,_0x301173,_0x505ed3){var _0x4bd370;if(_0x5d2b87[_0xf132('0x3a')][_0xf132('0x3b')]){if(_['startsWith'](_0x5d2b87[_0xf132('0x3a')][_0xf132('0x3b')],_0xf132('0x3c'))){var _0x2a215e=basicAuth(_0x5d2b87);db[_0xf132('0x3d')][_0xf132('0x3e')]({'where':{'name':_0x2a215e[_0xf132('0xe')]}})[_0xf132('0x3f')](function(_0x1e9dd7){if(!_0x1e9dd7||!_0x1e9dd7[_0xf132('0x40')](_0x2a215e[_0xf132('0x41')])){return _0x301173[_0xf132('0x34')](0x191)['json']({'message':_0xf132('0x42')});}_0x5d2b87[_0xf132('0x2f')]={'id':_0x1e9dd7['id']};_0x505ed3();})[_0xf132('0x38')](function(_0x5295cc){_0x505ed3(_0x5295cc);});}else if(_[_0xf132('0x43')](_0x5d2b87['headers'][_0xf132('0x3b')],_0xf132('0x44'))){validateJwt(_0x5d2b87,_0x301173,_0x505ed3);}else{if(_0x1de9fa){_0x505ed3();}else{return _0x301173[_0xf132('0x34')](0x193)['json']({'message':_0xf132('0x45')});}}}else if(_0x5d2b87['query'][_0xf132('0x46')]){try{var _0x5051df={'audience':hardwareConf[_0xf132('0x47')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5d2b87[_0xf132('0x48')][_0xf132('0x46')],_0x5051df)['then'](function(_0x329fb9){return db[_0xf132('0x3d')]['find']({'where':{'id':_0x329fb9[_0xf132('0x49')]}})[_0xf132('0x3f')](function(_0x2df45b){_0x4bd370=_0x2df45b;return db[_0xf132('0x4a')][_0xf132('0x30')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf132('0x4b')],'raw':!![]});})[_0xf132('0x3f')](function(_0x4ca95b){if(!_0x4bd370||!_[_0xf132('0x4c')](_0x4bd370[_0xf132('0x4d')],_0x329fb9[_0xf132('0x4e')])){return _0x301173[_0xf132('0x34')](0x191)['json']({'message':_0xf132('0x4f')});}if(_0x4bd370[_0xf132('0x50')]){return _0x301173['status'](0x191)[_0xf132('0x51')]({'message':_0xf132('0x52')});}if(_0x4bd370[_0xf132('0x53')]){if(_0x4ca95b[_0xf132('0x4b')]>0x0){if(moment(_0x4bd370[_0xf132('0x54')])[_0xf132('0x55')](_0x4ca95b[_0xf132('0x4b')],'minutes')>moment()){return _0x301173[_0xf132('0x34')](0x191)['json']({'message':_0xf132('0x52')});}}else{return _0x301173[_0xf132('0x34')](0x191)[_0xf132('0x51')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x5d2b87[_0xf132('0x2f')]={'id':_0x4bd370['id']};_0x505ed3();});})[_0xf132('0x38')](function(){return _0x301173[_0xf132('0x34')](0x191)[_0xf132('0x51')]({'message':_0xf132('0x52')});});}catch(_0x3f7dcd){_0x505ed3(_0x3f7dcd);}}else if(_0x1de9fa){_0x505ed3();}else{return _0x301173[_0xf132('0x34')](0x193)[_0xf132('0x51')]({'message':_0xf132('0x45')});}})[_0xf132('0x39')](function(_0x4d9433,_0x5373c0,_0x13cc41){if(_0x4d9433['user']){db[_0xf132('0x3d')][_0xf132('0x3e')]({'where':{'id':_0x4d9433[_0xf132('0x2f')]['id']},'attributes':userAttributes})[_0xf132('0x3f')](function(_0x56dae3){if(!_0x56dae3){return _0x5373c0['status'](0x194)[_0xf132('0x51')]({'message':'User\x20not\x20found.'});}_0x4d9433[_0xf132('0x2f')]=_0x56dae3;_0x13cc41();})[_0xf132('0x38')](function(_0x56fb5c){_0x13cc41(_0x56fb5c);});}else if(_0x1de9fa){_0x13cc41();}else{return _0x5373c0[_0xf132('0x34')](0x194)[_0xf132('0x51')]({'message':_0xf132('0x56')});}});};exports[_0xf132('0x57')]=function canUpdate(){return compose()[_0xf132('0x39')](function(_0x31ecd2,_0x2f3971,_0x4dc2b3){return licenseUtil[_0xf132('0x58')]()[_0xf132('0x3f')](function(_0x35749e){if(_0x35749e[_0xf132('0x59')]){_0x4dc2b3();}else{return _0x2f3971[_0xf132('0x34')](0x193)[_0xf132('0x51')]({'message':_0xf132('0x5a')});}})['catch'](function(_0x595fb3){_0x4dc2b3(_0x595fb3);});});};exports[_0xf132('0x5b')]=function(_0x3bbdef,_0x480039,_0x235853){_0x3bbdef[_0xf132('0x5b')]=!![];return _0x235853();};exports['signToken']=function signToken(_0x5aeda9){return signJwt(_0x5aeda9);};exports[_0xf132('0x5c')]=function(_0x91038d,_0x9f81cc){if(!_0x91038d[_0xf132('0x2f')]){return _0x9f81cc[_0xf132('0x34')](0x194)[_0xf132('0x51')]({'message':_0xf132('0x5d')});}var _0x348567={'payload':{'id':_0x91038d[_0xf132('0x2f')]['id'],'role':_0x91038d[_0xf132('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x348567)['then'](function(_0x34352a){_0x9f81cc[_0xf132('0x5e')](_0xf132('0x5f'),_0x34352a);_0x9f81cc['redirect'](_0xf132('0x60'));})['catch'](function(_0x4389b2){return _0x9f81cc[_0xf132('0x34')](0x1f4)[_0xf132('0x61')](_0x4389b2);});};exports[_0xf132('0x62')]=function(_0x3bdd2e){if(_[_0xf132('0x63')](_0x3bdd2e['apiKeyNonce'])||_[_0xf132('0x63')](_0x3bdd2e[_0xf132('0x64')])){return null;}else{return createJwt(_0x3bdd2e);}};exports[_0xf132('0x65')]=function(_0x416e49){_0x416e49[_0xf132('0x4d')]=generateNonce();_0x416e49[_0xf132('0x64')]=generateIssuedAt();return createJwt(_0x416e49);};exports[_0xf132('0x66')]=function(_0x5dd65e,_0x1dac6c){var _0x555027=_0x5dd65e['query'][_0xf132('0x46')];if(_0x555027){var _0x4fe6cb={'nonce':_0x1dac6c[_0xf132('0x4d')],'iat':_0x1dac6c[_0xf132('0x64')],'audience':hardwareConf[_0xf132('0x47')](),'issuer':hardwareConf[_0xf132('0x47')]()};return verifyJwt(_0x555027,_0x4fe6cb)['then'](function(){return generateApiKey(_0x1dac6c);});}else{throw{'message':_0xf132('0x67')};}};exports[_0xf132('0x68')]=function(_0x2a8c4a){var _0x211797=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x211797[_0xf132('0x69')](_0x2a8c4a))throw new db[(_0xf132('0x6a'))][(_0xf132('0x6b'))](_0xf132('0x6c'));return;};exports['validatePasswordHistory']=function(_0x5742a4,_0x1e9e1d,_0x2d12e5){var _0x189803=encryptor[_0xf132('0x6d')](_0x1e9e1d)[_0xf132('0x6e')](',');for(var _0x4b1514=0x0;_0x4b1514<_0x2d12e5;_0x4b1514++){if(!_0x189803[_0x4b1514])break;if(_0x5742a4[_0xf132('0x6f')]()===_0x189803[_0x4b1514][_0xf132('0x6f')]()){var _0x1db95f=util[_0xf132('0x70')](_0xf132('0x71'),_0x2d12e5);if(_0x2d12e5===0x1){_0x1db95f='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf132('0x6a'))][(_0xf132('0x6b'))](_0x1db95f);}}return;};exports[_0xf132('0x72')]=function(_0x247a77,_0xfca5ff){var _0x7d8be7=_0xfca5ff?encryptor[_0xf132('0x6d')](_0xfca5ff)[_0xf132('0x6e')](','):[];if(_0x7d8be7[_0xf132('0x73')]===0x5){_0x7d8be7[_0xf132('0x74')](-0x1,0x1);}_0x7d8be7['unshift'](_0x247a77);return encryptor[_0xf132('0x75')](_0x7d8be7[_0xf132('0x76')](','));};function signJwt(_0x28585c){var _0x433ac6=BPromise[_0xf132('0x77')](jwt[_0xf132('0x78')],{'context':jwt});var _0xccc351=_0x28585c[_0xf132('0x79')]||config[_0xf132('0xb')][_0xf132('0xc')];return new BPromise(function(_0xa6022d,_0x10e5f2){_0x433ac6(_0x28585c[_0xf132('0x7a')],_0xccc351,_0x28585c[_0xf132('0x7b')])['then'](function(_0x5030a5){_0xa6022d(_0x5030a5);})[_0xf132('0x38')](function(_0x1bff44){_0x10e5f2(_0x1bff44);});});}function verifyJwt(_0x5a1ece,_0x20c55e,_0x3eb3fc){var _0x1526c4=BPromise['promisify'](jwt[_0xf132('0x7c')],{'context':jwt});var _0x131e4d=_0x3eb3fc||config[_0xf132('0xb')][_0xf132('0xc')];return new BPromise(function(_0x35da1f,_0x36c577){_0x1526c4(_0x5a1ece,_0x131e4d,_0x20c55e)[_0xf132('0x3f')](function(_0x3bdac7){_0x35da1f(_0x3bdac7);})['catch'](function(_0x31faff){_0x36c577(_0x31faff);});});}function generateNonce(){return crypto[_0xf132('0x7d')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xf132('0x7e')](Date[_0xf132('0x7f')]()/0x3e8)[_0xf132('0x80')]();}function createJwt(_0x325e71){var _0x1ff3c9={'payload':{'iat':_0x325e71['apiKeyIat'],'nonce':_0x325e71[_0xf132('0x4d')]},'options':{'algorithm':_0xf132('0x81'),'subject':_0x325e71['id'][_0xf132('0x80')](),'issuer':hardwareConf[_0xf132('0x47')](),'audience':hardwareConf[_0xf132('0x47')]()}};return signJwt(_0x1ff3c9)[_0xf132('0x3f')](function(_0x3a1336){return{'iat':_0x325e71[_0xf132('0x64')],'nonce':_0x325e71['apiKeyNonce'],'token':_0x3a1336};});} \ No newline at end of file +var _0xa5ef=['authenticate','pass','json','startsWith','Bearer','query','apikey','User','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','getUuid','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','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','decryptString','split','splice','encryptString','promisify','sign','payload','options','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','status','unmanaged','catch','headers','authorization','Basic','find'];(function(_0x3bf86e,_0x4cca66){var _0xfc90c9=function(_0x54cc50){while(--_0x54cc50){_0x3bf86e['push'](_0x3bf86e['shift']());}};_0xfc90c9(++_0x4cca66);}(_0xa5ef,0xbf));var _0xfa5e=function(_0x5bd3f2,_0x49f10b){_0x5bd3f2=_0x5bd3f2-0x0;var _0x444bfb=_0xa5ef[_0x5bd3f2];return _0x444bfb;};'use strict';var db=require(_0xfa5e('0x0'))['db'];var config=require(_0xfa5e('0x1'));var hardwareConf=require(_0xfa5e('0x2'));var licenseUtil=require(_0xfa5e('0x3'));var encryptor=require(_0xfa5e('0x4'));var _=require(_0xfa5e('0x5'));var jwt=require(_0xfa5e('0x6'));var expressJwt=require(_0xfa5e('0x7'));var compose=require(_0xfa5e('0x8'));var basicAuth=require(_0xfa5e('0x9'));var crypto=require(_0xfa5e('0xa'));var BPromise=require('bluebird');var util=require(_0xfa5e('0xb'));var moment=require(_0xfa5e('0xc'));var validateJwt=expressJwt({'secret':config[_0xfa5e('0xd')][_0xfa5e('0xe')]});var userAttributes=['id',_0xfa5e('0xf'),_0xfa5e('0x10'),_0xfa5e('0x11'),_0xfa5e('0x12'),_0xfa5e('0x13'),_0xfa5e('0x14'),_0xfa5e('0x15'),_0xfa5e('0x16'),_0xfa5e('0x17'),_0xfa5e('0x18'),_0xfa5e('0x19'),_0xfa5e('0x1a'),'smsPause',_0xfa5e('0x1b'),_0xfa5e('0x1c'),_0xfa5e('0x1d'),_0xfa5e('0x1e'),_0xfa5e('0x1f'),_0xfa5e('0x20'),_0xfa5e('0x21'),_0xfa5e('0x22'),'alias',_0xfa5e('0x23'),'phoneBarAutoAnswerDelay',_0xfa5e('0x24'),'phoneBarEnableRecording',_0xfa5e('0x25'),_0xfa5e('0x26'),_0xfa5e('0x27'),_0xfa5e('0x28'),_0xfa5e('0x29'),_0xfa5e('0x2a'),_0xfa5e('0x2b'),_0xfa5e('0x2c'),'userProfileId',_0xfa5e('0x2d'),'settingsEnabled','wssPort',_0xfa5e('0x2e'),_0xfa5e('0x2f'),_0xfa5e('0x30'),'ignorePauseForPreviewCalls',_0xfa5e('0x31')];exports[_0xfa5e('0x32')]=function(){return this[_0xfa5e('0x33')](!![])[_0xfa5e('0x34')](function(_0x473ae2,_0x4013b0,_0x5a4936){if(_0x473ae2[_0xfa5e('0x35')]){_0x5a4936();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x473ae2[_0xfa5e('0x36')]['id']},'attributes':['id',_0xfa5e('0x37'),_0xfa5e('0x38')],'raw':!![]})[_0xfa5e('0x39')](function(_0x4ace1d){if(_0x4ace1d&&_0x4ace1d['closed']){return _0x4013b0[_0xfa5e('0x3a')](_0x4ace1d[_0xfa5e('0x38')]===_0xfa5e('0x3b')?0x195:0x193)['json']({'message':_0x4ace1d[_0xfa5e('0x38')]===_0xfa5e('0x3b')?'Unmanaged.':'Forbidden.'});}else{_0x5a4936();}})[_0xfa5e('0x3c')](function(_0x38ba0c){_0x5a4936(_0x38ba0c);});}});};exports[_0xfa5e('0x33')]=function isAuthenticated(_0x1d06ea){return compose()['use'](function(_0x19ac95,_0x38ffe4,_0x5b781f){var _0x157725;if(_0x19ac95[_0xfa5e('0x3d')]['authorization']){if(_['startsWith'](_0x19ac95['headers'][_0xfa5e('0x3e')],_0xfa5e('0x3f'))){var _0x3b7ece=basicAuth(_0x19ac95);db['User'][_0xfa5e('0x40')]({'where':{'name':_0x3b7ece['name']}})['then'](function(_0x35f0f0){if(!_0x35f0f0||!_0x35f0f0[_0xfa5e('0x41')](_0x3b7ece[_0xfa5e('0x42')])){return _0x38ffe4[_0xfa5e('0x3a')](0x191)[_0xfa5e('0x43')]({'message':'Wrong\x20credentials.'});}_0x19ac95[_0xfa5e('0x35')]={'id':_0x35f0f0['id']};_0x5b781f();})[_0xfa5e('0x3c')](function(_0x37f3af){_0x5b781f(_0x37f3af);});}else if(_[_0xfa5e('0x44')](_0x19ac95[_0xfa5e('0x3d')][_0xfa5e('0x3e')],_0xfa5e('0x45'))){validateJwt(_0x19ac95,_0x38ffe4,_0x5b781f);}else{if(_0x1d06ea){_0x5b781f();}else{return _0x38ffe4[_0xfa5e('0x3a')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x19ac95[_0xfa5e('0x46')][_0xfa5e('0x47')]){try{var _0x4d114e={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x19ac95['query']['apikey'],_0x4d114e)[_0xfa5e('0x39')](function(_0x427f26){return db[_0xfa5e('0x48')]['find']({'where':{'id':_0x427f26[_0xfa5e('0x49')]}})[_0xfa5e('0x39')](function(_0x2b62fa){_0x157725=_0x2b62fa;return db[_0xfa5e('0x4a')][_0xfa5e('0x4b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfa5e('0x4c')],'raw':!![]});})[_0xfa5e('0x39')](function(_0x254a5b){if(!_0x157725||!_[_0xfa5e('0x4d')](_0x157725[_0xfa5e('0x4e')],_0x427f26[_0xfa5e('0x4f')])){return _0x38ffe4['status'](0x191)[_0xfa5e('0x43')]({'message':_0xfa5e('0x50')});}if(_0x157725[_0xfa5e('0x51')]){return _0x38ffe4['status'](0x191)[_0xfa5e('0x43')]({'message':_0xfa5e('0x52')});}if(_0x157725[_0xfa5e('0x53')]){if(_0x254a5b[_0xfa5e('0x4c')]>0x0){if(moment(_0x157725[_0xfa5e('0x54')])['add'](_0x254a5b[_0xfa5e('0x4c')],_0xfa5e('0x55'))>moment()){return _0x38ffe4[_0xfa5e('0x3a')](0x191)[_0xfa5e('0x43')]({'message':_0xfa5e('0x52')});}}else{return _0x38ffe4[_0xfa5e('0x3a')](0x191)[_0xfa5e('0x43')]({'message':_0xfa5e('0x52')});}}_0x19ac95[_0xfa5e('0x35')]={'id':_0x157725['id']};_0x5b781f();});})['catch'](function(){return _0x38ffe4['status'](0x191)['json']({'message':_0xfa5e('0x52')});});}catch(_0x3ebfd2){_0x5b781f(_0x3ebfd2);}}else if(_0x1d06ea){_0x5b781f();}else{return _0x38ffe4[_0xfa5e('0x3a')](0x193)[_0xfa5e('0x43')]({'message':_0xfa5e('0x56')});}})[_0xfa5e('0x34')](function(_0x51ec6b,_0x24590f,_0x54bf58){if(_0x51ec6b[_0xfa5e('0x35')]){db[_0xfa5e('0x48')]['find']({'where':{'id':_0x51ec6b[_0xfa5e('0x35')]['id']},'attributes':userAttributes})[_0xfa5e('0x39')](function(_0x535230){if(!_0x535230){return _0x24590f[_0xfa5e('0x3a')](0x194)[_0xfa5e('0x43')]({'message':_0xfa5e('0x57')});}_0x51ec6b[_0xfa5e('0x35')]=_0x535230;_0x54bf58();})[_0xfa5e('0x3c')](function(_0x25512c){_0x54bf58(_0x25512c);});}else if(_0x1d06ea){_0x54bf58();}else{return _0x24590f['status'](0x194)[_0xfa5e('0x43')]({'message':_0xfa5e('0x58')});}});};exports[_0xfa5e('0x59')]=function canUpdate(){return compose()[_0xfa5e('0x34')](function(_0x45fdb9,_0x39a937,_0x7c9242){return licenseUtil[_0xfa5e('0x5a')]()['then'](function(_0x7c7b92){if(_0x7c7b92['update']){_0x7c9242();}else{return _0x39a937[_0xfa5e('0x3a')](0x193)[_0xfa5e('0x43')]({'message':'Forbidden'});}})['catch'](function(_0x4166e1){_0x7c9242(_0x4166e1);});});};exports['isMiddleware']=function(_0x390ffa,_0x1bf58c,_0x23ca83){_0x390ffa['isMiddleware']=!![];return _0x23ca83();};exports[_0xfa5e('0x5b')]=function signToken(_0x5301dc){return signJwt(_0x5301dc);};exports[_0xfa5e('0x5c')]=function(_0x4e7feb,_0x414626){if(!_0x4e7feb[_0xfa5e('0x35')]){return _0x414626[_0xfa5e('0x3a')](0x194)[_0xfa5e('0x43')]({'message':_0xfa5e('0x5d')});}var _0x1c9601={'payload':{'id':_0x4e7feb[_0xfa5e('0x35')]['id'],'role':_0x4e7feb['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x1c9601)[_0xfa5e('0x39')](function(_0x331596){_0x414626[_0xfa5e('0x5e')](_0xfa5e('0x5f'),_0x331596);_0x414626[_0xfa5e('0x60')]('/dashboards/general');})['catch'](function(_0x3c1abd){return _0x414626[_0xfa5e('0x3a')](0x1f4)[_0xfa5e('0x61')](_0x3c1abd);});};exports['retrieveApiKey']=function(_0x44afce){if(_[_0xfa5e('0x62')](_0x44afce['apiKeyNonce'])||_[_0xfa5e('0x62')](_0x44afce[_0xfa5e('0x63')])){return null;}else{return createJwt(_0x44afce);}};exports[_0xfa5e('0x64')]=function(_0x3320d1){_0x3320d1[_0xfa5e('0x4e')]=generateNonce();_0x3320d1[_0xfa5e('0x63')]=generateIssuedAt();return createJwt(_0x3320d1);};exports[_0xfa5e('0x65')]=function(_0x18b028,_0xf87a79){var _0x2a9b44=_0x18b028['query'][_0xfa5e('0x47')];if(_0x2a9b44){var _0x241031={'nonce':_0xf87a79[_0xfa5e('0x4e')],'iat':_0xf87a79[_0xfa5e('0x63')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfa5e('0x66')]()};return verifyJwt(_0x2a9b44,_0x241031)[_0xfa5e('0x39')](function(){return generateApiKey(_0xf87a79);});}else{throw{'message':_0xfa5e('0x67')};}};exports[_0xfa5e('0x68')]=function(_0x5f2ae2){var _0x5dd5bf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5dd5bf[_0xfa5e('0x69')](_0x5f2ae2))throw new db[(_0xfa5e('0x6a'))][(_0xfa5e('0x6b'))](_0xfa5e('0x6c'));return;};exports[_0xfa5e('0x6d')]=function(_0x45f276,_0x3b054f,_0x3a1a8f){var _0x2a72e5=encryptor['decryptString'](_0x3b054f)['split'](',');for(var _0x4471de=0x0;_0x4471de<_0x3a1a8f;_0x4471de++){if(!_0x2a72e5[_0x4471de])break;if(_0x45f276[_0xfa5e('0x6e')]()===_0x2a72e5[_0x4471de]['toLowerCase']()){var _0x1418ee=util[_0xfa5e('0x6f')](_0xfa5e('0x70'),_0x3a1a8f);if(_0x3a1a8f===0x1){_0x1418ee=_0xfa5e('0x71');}throw new db['Sequelize']['ValidationError'](_0x1418ee);}}return;};exports[_0xfa5e('0x72')]=function(_0x1b6f88,_0x3c0172){var _0x3c1321=_0x3c0172?encryptor[_0xfa5e('0x73')](_0x3c0172)[_0xfa5e('0x74')](','):[];if(_0x3c1321['length']===0x5){_0x3c1321[_0xfa5e('0x75')](-0x1,0x1);}_0x3c1321['unshift'](_0x1b6f88);return encryptor[_0xfa5e('0x76')](_0x3c1321['join'](','));};function signJwt(_0x543dba){var _0x2921f2=BPromise[_0xfa5e('0x77')](jwt[_0xfa5e('0x78')],{'context':jwt});var _0x2d6898=_0x543dba['secret']||config['secrets'][_0xfa5e('0xe')];return new BPromise(function(_0x5317a1,_0x2bfa06){_0x2921f2(_0x543dba[_0xfa5e('0x79')],_0x2d6898,_0x543dba[_0xfa5e('0x7a')])['then'](function(_0x589c45){_0x5317a1(_0x589c45);})[_0xfa5e('0x3c')](function(_0x5896ea){_0x2bfa06(_0x5896ea);});});}function verifyJwt(_0x377596,_0x190b7b,_0x2f0bf8){var _0x4b8996=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x1460f1=_0x2f0bf8||config['secrets'][_0xfa5e('0xe')];return new BPromise(function(_0x715e1a,_0x4220c5){_0x4b8996(_0x377596,_0x1460f1,_0x190b7b)[_0xfa5e('0x39')](function(_0x4082b6){_0x715e1a(_0x4082b6);})[_0xfa5e('0x3c')](function(_0x561bc9){_0x4220c5(_0x561bc9);});});}function generateNonce(){return crypto[_0xfa5e('0x7b')](0x10)[_0xfa5e('0x7c')](_0xfa5e('0x7d'));}function generateIssuedAt(){return Math[_0xfa5e('0x7e')](Date[_0xfa5e('0x7f')]()/0x3e8)['toString']();}function createJwt(_0x40079e){var _0x2707da={'payload':{'iat':_0x40079e[_0xfa5e('0x63')],'nonce':_0x40079e[_0xfa5e('0x4e')]},'options':{'algorithm':'HS512','subject':_0x40079e['id'][_0xfa5e('0x7c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xfa5e('0x66')]()}};return signJwt(_0x2707da)[_0xfa5e('0x39')](function(_0x2bdcbd){return{'iat':_0x40079e[_0xfa5e('0x63')],'nonce':_0x40079e[_0xfa5e('0x4e')],'token':_0x2bdcbd};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 217694f..a8d9d92 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 _0xd5c2=['createDecipher','crypto','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','data','update','binary','write','end','final','close','decryptFile','createReadStream','createWriteStream','unlink','encryptString','createCipher','utf8','base64','secret'];(function(_0x17bcce,_0x39ec4a){var _0x47fccb=function(_0x4cd19b){while(--_0x4cd19b){_0x17bcce['push'](_0x17bcce['shift']());}};_0x47fccb(++_0x39ec4a);}(_0xd5c2,0x101));var _0x2d5c=function(_0x4f4a70,_0x1a3948){_0x4f4a70=_0x4f4a70-0x0;var _0x3f65bf=_0xd5c2[_0x4f4a70];return _0x3f65bf;};'use strict';var crypto=require(_0x2d5c('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x2d5c('0x1'));var logger=require(_0x2d5c('0x2'))(_0x2d5c('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2d5c('0x4')],'algorithm':_0x2d5c('0x5')};const fileOptions={'algorithm':_0x2d5c('0x6')};if(config[_0x2d5c('0x7')]&&config[_0x2d5c('0x7')][_0x2d5c('0x8')]){var isSupported=isAlgorithmSupported(config[_0x2d5c('0x7')][_0x2d5c('0x8')]);if(isSupported){fileOptions[_0x2d5c('0x8')]=config[_0x2d5c('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2d5c('0x9')](',\x20');logger['error'](config[_0x2d5c('0x7')][_0x2d5c('0x8')],_0x2d5c('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x47feae){return AES_SUPPORTED_RX[_0x2d5c('0xb')](_0x47feae);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2d5c('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x6b2d5d){return getSupportedCiphers()['indexOf'](_0x6b2d5d)>-0x1;}function combineOptions(_0x5ad7a2){var _0x48ee20={};for(var _0x40a3b5 in fileOptions){if(fileOptions[_0x2d5c('0xd')](_0x40a3b5)){_0x48ee20[_0x40a3b5]=fileOptions[_0x40a3b5];}}if(_0x5ad7a2){for(var _0x123e02 in _0x5ad7a2){if(_0x5ad7a2[_0x2d5c('0xd')](_0x123e02)){_0x48ee20[_0x123e02]=_0x5ad7a2[_0x123e02];}}}return _0x48ee20;}exports[_0x2d5c('0xe')]=function(_0x1d9aad,_0x457fcd,_0x2055f2,_0x4bcdff){return new BPromise(function(_0x4109bb,_0x3302c1){_0x4bcdff=combineOptions(_0x4bcdff);var _0x5c1e41=new Buffer(_0x2055f2);var _0x252cb5=fs['createReadStream'](_0x1d9aad);var _0x23b14d=fs['createWriteStream'](_0x457fcd);var _0x47d741=crypto['createCipher'](_0x4bcdff[_0x2d5c('0x8')],_0x5c1e41);_0x252cb5['on'](_0x2d5c('0xf'),function(_0x2fdde9){var _0x393cac=new Buffer(_0x47d741[_0x2d5c('0x10')](_0x2fdde9),_0x2d5c('0x11'));_0x23b14d[_0x2d5c('0x12')](_0x393cac);});_0x252cb5['on'](_0x2d5c('0x13'),function(){try{var _0xe77b3e=new Buffer(_0x47d741[_0x2d5c('0x14')]('binary'),_0x2d5c('0x11'));_0x23b14d['write'](_0xe77b3e);_0x23b14d['end']();_0x23b14d['on'](_0x2d5c('0x15'),function(){return _0x4109bb(_0x457fcd);});}catch(_0x1a7984){fs['unlink'](_0x457fcd);return _0x3302c1(_0x1a7984);}});});};exports[_0x2d5c('0x16')]=function(_0x1048a4,_0x51f2ff,_0x58daf1,_0x4bdcec){return new BPromise(function(_0x328824,_0x886bec){_0x4bdcec=combineOptions(_0x4bdcec);var _0x20c605=new Buffer(_0x58daf1);var _0x102e8f=fs[_0x2d5c('0x17')](_0x1048a4);var _0x23e8fe=fs[_0x2d5c('0x18')](_0x51f2ff);var _0x5bbb14=crypto['createDecipher'](_0x4bdcec[_0x2d5c('0x8')],_0x20c605);_0x102e8f['on'](_0x2d5c('0xf'),function(_0x5acfff){var _0x35063d=new Buffer(_0x5bbb14[_0x2d5c('0x10')](_0x5acfff),'binary');_0x23e8fe[_0x2d5c('0x12')](_0x35063d);});_0x102e8f['on'](_0x2d5c('0x13'),function(){try{var _0x5347e5=new Buffer(_0x5bbb14[_0x2d5c('0x14')](_0x2d5c('0x11')),'binary');_0x23e8fe[_0x2d5c('0x12')](_0x5347e5);_0x23e8fe[_0x2d5c('0x13')]();_0x23e8fe['on'](_0x2d5c('0x15'),function(){return _0x328824(_0x51f2ff);});}catch(_0x5c7fe6){fs[_0x2d5c('0x19')](_0x51f2ff);return _0x886bec(_0x5c7fe6);}});});};exports[_0x2d5c('0x1a')]=function(_0xb2b6cb,_0x353d06,_0x3e31e8){var _0x21f384=_0x3e31e8||stringOptions[_0x2d5c('0x8')];var _0x381999=_0x353d06||stringOptions['secret'];var _0x1bdb9c=crypto[_0x2d5c('0x1b')](_0x21f384,_0x381999);var _0xc0ba24=_0x1bdb9c[_0x2d5c('0x10')](_0xb2b6cb,_0x2d5c('0x1c'),_0x2d5c('0x1d'));_0xc0ba24+=_0x1bdb9c[_0x2d5c('0x14')](_0x2d5c('0x1d'));return _0xc0ba24;};exports['decryptString']=function(_0x10491b,_0x167e17,_0x864ec4){var _0xa44f71=_0x864ec4||stringOptions['algorithm'];var _0x208955=_0x167e17||stringOptions[_0x2d5c('0x1e')];var _0x1d3d57=crypto[_0x2d5c('0x1f')](_0xa44f71,_0x208955);var _0x1f1df1=_0x1d3d57['update'](_0x10491b,_0x2d5c('0x1d'),_0x2d5c('0x1c'));_0x1f1df1+=_0x1d3d57['final']('utf8');return _0x1f1df1;}; \ No newline at end of file +var _0xf844=['../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','data','secret','createCipher','utf8','base64','crypto','bluebird','lodash'];(function(_0x2a37b2,_0x25224f){var _0xcec68b=function(_0x53521f){while(--_0x53521f){_0x2a37b2['push'](_0x2a37b2['shift']());}};_0xcec68b(++_0x25224f);}(_0xf844,0x105));var _0x4f84=function(_0x2a4190,_0x5ae88b){_0x2a4190=_0x2a4190-0x0;var _0x7b774c=_0xf844[_0x2a4190];return _0x7b774c;};'use strict';var crypto=require(_0x4f84('0x0'));var fs=require('fs');var BPromise=require(_0x4f84('0x1'));var _=require(_0x4f84('0x2'));var config=require(_0x4f84('0x3'));var logger=require('../../config/logger')(_0x4f84('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4f84('0x5')][_0x4f84('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x4f84('0x7')};if(config['encrypt']&&config[_0x4f84('0x8')][_0x4f84('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x4f84('0x9')]=config[_0x4f84('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4f84('0xa')](',\x20');logger['error'](config['encrypt']['algorithm'],_0x4f84('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0xc63658){return AES_SUPPORTED_RX['test'](_0xc63658);}function getSupportedCiphers(){return crypto[_0x4f84('0xc')]()[_0x4f84('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x169a26){return getSupportedCiphers()[_0x4f84('0xe')](_0x169a26)>-0x1;}function combineOptions(_0xab5657){var _0xb17d84={};for(var _0x4de060 in fileOptions){if(fileOptions[_0x4f84('0xf')](_0x4de060)){_0xb17d84[_0x4de060]=fileOptions[_0x4de060];}}if(_0xab5657){for(var _0x5bc2bd in _0xab5657){if(_0xab5657[_0x4f84('0xf')](_0x5bc2bd)){_0xb17d84[_0x5bc2bd]=_0xab5657[_0x5bc2bd];}}}return _0xb17d84;}exports[_0x4f84('0x10')]=function(_0xc57a8c,_0x1b0f66,_0x311702,_0x51ed38){return new BPromise(function(_0x401323,_0x252908){_0x51ed38=combineOptions(_0x51ed38);var _0x24eb4f=new Buffer(_0x311702);var _0x53f2ee=fs[_0x4f84('0x11')](_0xc57a8c);var _0x440806=fs[_0x4f84('0x12')](_0x1b0f66);var _0x50f405=crypto['createCipher'](_0x51ed38['algorithm'],_0x24eb4f);_0x53f2ee['on']('data',function(_0x366ea0){var _0x422f7e=new Buffer(_0x50f405[_0x4f84('0x13')](_0x366ea0),_0x4f84('0x14'));_0x440806[_0x4f84('0x15')](_0x422f7e);});_0x53f2ee['on'](_0x4f84('0x16'),function(){try{var _0x289889=new Buffer(_0x50f405[_0x4f84('0x17')](_0x4f84('0x14')),_0x4f84('0x14'));_0x440806[_0x4f84('0x15')](_0x289889);_0x440806[_0x4f84('0x16')]();_0x440806['on'](_0x4f84('0x18'),function(){return _0x401323(_0x1b0f66);});}catch(_0x36a38b){fs[_0x4f84('0x19')](_0x1b0f66);return _0x252908(_0x36a38b);}});});};exports[_0x4f84('0x1a')]=function(_0x1ebd77,_0x370aa6,_0x52a4c9,_0x5bb579){return new BPromise(function(_0x14b082,_0x2204fd){_0x5bb579=combineOptions(_0x5bb579);var _0x1bb563=new Buffer(_0x52a4c9);var _0x2202d8=fs[_0x4f84('0x11')](_0x1ebd77);var _0x551c17=fs['createWriteStream'](_0x370aa6);var _0xe34ad8=crypto[_0x4f84('0x1b')](_0x5bb579[_0x4f84('0x9')],_0x1bb563);_0x2202d8['on'](_0x4f84('0x1c'),function(_0x3a92ee){var _0x46176a=new Buffer(_0xe34ad8['update'](_0x3a92ee),_0x4f84('0x14'));_0x551c17[_0x4f84('0x15')](_0x46176a);});_0x2202d8['on']('end',function(){try{var _0x5bfae0=new Buffer(_0xe34ad8[_0x4f84('0x17')](_0x4f84('0x14')),_0x4f84('0x14'));_0x551c17[_0x4f84('0x15')](_0x5bfae0);_0x551c17[_0x4f84('0x16')]();_0x551c17['on'](_0x4f84('0x18'),function(){return _0x14b082(_0x370aa6);});}catch(_0x1cdfb2){fs[_0x4f84('0x19')](_0x370aa6);return _0x2204fd(_0x1cdfb2);}});});};exports['encryptString']=function(_0x21406a,_0x8de1b,_0x1604c2){var _0x1d505b=_0x1604c2||stringOptions['algorithm'];var _0xf5c44=_0x8de1b||stringOptions[_0x4f84('0x1d')];var _0x42dc31=crypto[_0x4f84('0x1e')](_0x1d505b,_0xf5c44);var _0x203e9e=_0x42dc31[_0x4f84('0x13')](_0x21406a,_0x4f84('0x1f'),_0x4f84('0x20'));_0x203e9e+=_0x42dc31['final'](_0x4f84('0x20'));return _0x203e9e;};exports['decryptString']=function(_0x443643,_0x48b0ab,_0x18d952){var _0x133895=_0x18d952||stringOptions[_0x4f84('0x9')];var _0x2e1068=_0x48b0ab||stringOptions[_0x4f84('0x1d')];var _0x2d11d6=crypto[_0x4f84('0x1b')](_0x133895,_0x2e1068);var _0x22a3ae=_0x2d11d6['update'](_0x443643,_0x4f84('0x20'),'utf8');_0x22a3ae+=_0x2d11d6['final'](_0x4f84('0x1f'));return _0x22a3ae;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 58fe3da..e1d5783 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 _0x7b55=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','forEach','push','query','sequelize','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','each','length','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Completed','catch','inspect','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','argv','update'];(function(_0x5af906,_0x102c71){var _0x425197=function(_0x11524a){while(--_0x11524a){_0x5af906['push'](_0x5af906['shift']());}};_0x425197(++_0x102c71);}(_0x7b55,0xd7));var _0x57b5=function(_0x155e10,_0x106cc2){_0x155e10=_0x155e10-0x0;var _0x48579f=_0x7b55[_0x155e10];return _0x48579f;};'use strict';var util=require(_0x57b5('0x0'));var path=require(_0x57b5('0x1'));var _=require(_0x57b5('0x2'));var csv=require(_0x57b5('0x3'));var fs=require('fs');var BPromise=require(_0x57b5('0x4'));var zipdir=require(_0x57b5('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x57b5('0x6'))['dbH'];var logger=require(_0x57b5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x57b5('0x8')][0x2]);var QUERY=process[_0x57b5('0x8')][0x3];var PATH=process[_0x57b5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x306715,_0x1eebed){var _0x55e97e={'status':_0x306715};var _0x55a1bb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1eebed){_0x55e97e['savename']=_0x1eebed;}return db['AnalyticExtractedReport'][_0x57b5('0x9')](_0x55e97e,_0x55a1bb);}function main(){var _0x5767ec=0x1388;var _0xbfa929;logger['info'](util['format'](_0x57b5('0xa'),EXTRACTED_REPORT_ID,_0x57b5('0xb')));return db[_0x57b5('0xc')][_0x57b5('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x57b5('0xe'),_0x57b5('0xf')]})['then'](function(_0x2ab595){if(_0x2ab595){_0xbfa929=_0x2ab595;_0x5767ec=_0xbfa929['splitSizeCsv']||0x1388;}})[_0x57b5('0x10')](function(){return dbH['sequelize']['query'](util[_0x57b5('0x11')](_0x57b5('0x12'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x57b5('0x13')]});})[_0x57b5('0x10')](function(_0x32f079){if(!_0x32f079[0x0][_0x57b5('0x14')]){return analyticExtractedReport(_0x57b5('0x15'));}var _0x2a4ccf=[];var _0x1b5abf=0x0;if(_0xbfa929[_0x57b5('0xe')]){if(_0x32f079&&_0x32f079['length']){var _0x34417a=_[_0x57b5('0x16')](_0x32f079[0x0][_0x57b5('0x14')]/_0x5767ec);var _0x5e5b0c=Number['isInteger'](_0x32f079[0x0]['num']/_0x5767ec)?_0x32f079[0x0][_0x57b5('0x14')]%_0x5767ec:0x0;_0x34417a[_0x57b5('0x17')](function(_0x52e953){if(_0x52e953>0x0){_0x1b5abf+=_0x5767ec;}_0x2a4ccf[_0x57b5('0x18')](dbH['sequelize'][_0x57b5('0x19')](util[_0x57b5('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5767ec,_0x1b5abf),{'type':dbH[_0x57b5('0x1a')][_0x57b5('0x1b')]['SELECT']}));});if(_0x5e5b0c>0x0){_0x1b5abf+=_0x5767ec;_0x2a4ccf[_0x57b5('0x18')](dbH[_0x57b5('0x1a')][_0x57b5('0x19')](util['format'](_0x57b5('0x1c'),QUERY,_0x5e5b0c,_0x1b5abf),{'type':dbH[_0x57b5('0x1a')]['QueryTypes'][_0x57b5('0x13')]}));}}}else{_0x2a4ccf[_0x57b5('0x18')](dbH['sequelize'][_0x57b5('0x19')](QUERY,{'type':dbH[_0x57b5('0x1a')][_0x57b5('0x1b')][_0x57b5('0x13')]}));}var _0x2154f9=path['dirname'](PATH);var _0x5bf328=path[_0x57b5('0x1d')](PATH,'.csv');var _0x2fd705=_0xbfa929[_0x57b5('0xe')]&&_0x2a4ccf['length']>0x1;var _0xa22069=[];if(!fs[_0x57b5('0x1e')](path[_0x57b5('0x1f')](_0x2154f9,_0x5bf328))&&_0x2fd705){fs['mkdirSync'](path[_0x57b5('0x1f')](_0x2154f9,_0x5bf328));}return BPromise[_0x57b5('0x20')](_0x2a4ccf,function(_0x552413){_0xa22069['push'](_0x552413);})['then'](function(){for(var _0x238887=0x0;_0x238887<_0xa22069[_0x57b5('0x21')];_0x238887+=0x1){var _0x53cbbf;var _0x588767=_0xa22069[_0x238887];if(_0x2fd705){_0x53cbbf=path[_0x57b5('0x1f')](_0x2154f9,_0x5bf328,util[_0x57b5('0x11')](_0x57b5('0x22'),_0x5bf328,_0x238887,_0x57b5('0x23')));}else{_0x53cbbf=path[_0x57b5('0x1f')](_0x2154f9,util['format']('%s.%s',_0x5bf328,_0x57b5('0x23')));}fs['writeFileSync'](_0x53cbbf,csv(_0x588767));}})[_0x57b5('0x10')](function(){if(_0x2fd705){return new Promise(function(_0x2ae233){zipdir(path[_0x57b5('0x1f')](_0x2154f9,_0x5bf328),{'saveTo':path['join'](_0x2154f9,util[_0x57b5('0x11')](_0x57b5('0x24'),_0x5bf328,_0x57b5('0x25')))},function(_0x3c69c1,_0x5e43db){rimraf(path[_0x57b5('0x1f')](_0x2154f9,_0x5bf328),function(){});_0x2ae233(_0x57b5('0x26'));});});}})[_0x57b5('0x10')](function(){logger[_0x57b5('0x27')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x57b5('0xb')));return analyticExtractedReport(_0x57b5('0x28'),_0x2fd705?util['format'](_0x57b5('0x24'),_0x5bf328,_0x2fd705?_0x57b5('0x25'):_0x57b5('0x23')):null);});})[_0x57b5('0x29')](function(_0x3f0ea6){logger[_0x57b5('0x27')](util[_0x57b5('0x11')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x57b5('0xb')),util[_0x57b5('0x2a')](_0x3f0ea6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x57b5('0x2b')](function(){process[_0x57b5('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xacf0=['%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','find','splitSizeCsv','then','sequelize','QueryTypes','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','query','dirname','basename','.csv','split','existsSync','mkdirSync','join','each'];(function(_0x6863d6,_0x8aa718){var _0x469d56=function(_0x1577ad){while(--_0x1577ad){_0x6863d6['push'](_0x6863d6['shift']());}};_0x469d56(++_0x8aa718);}(_0xacf0,0xcb));var _0x0acf=function(_0x51851c,_0x1a7c28){_0x51851c=_0x51851c-0x0;var _0x2a585b=_0xacf0[_0x51851c];return _0x2a585b;};'use strict';var util=require('util');var path=require(_0x0acf('0x0'));var _=require(_0x0acf('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x0acf('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x0acf('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0acf('0x4'))['dbH'];var logger=require(_0x0acf('0x5'))(_0x0acf('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0acf('0x7')][0x2]);var QUERY=process[_0x0acf('0x7')][0x3];var PATH=process[_0x0acf('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3abe1f,_0x5d4b2d){var _0x176549={'status':_0x3abe1f};var _0x5cb6f7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d4b2d){_0x176549[_0x0acf('0x8')]=_0x5d4b2d;}return db[_0x0acf('0x9')][_0x0acf('0xa')](_0x176549,_0x5cb6f7);}function main(){var _0x419fe0=0x1388;var _0x30e23f;logger[_0x0acf('0xb')](util[_0x0acf('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x0acf('0xd')][_0x0acf('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0acf('0xf')]})[_0x0acf('0x10')](function(_0x2cd060){if(_0x2cd060){_0x30e23f=_0x2cd060;_0x419fe0=_0x30e23f['splitSizeCsv']||0x1388;}})[_0x0acf('0x10')](function(){return dbH['sequelize']['query'](util[_0x0acf('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0acf('0x11')][_0x0acf('0x12')]['SELECT']});})[_0x0acf('0x10')](function(_0x5c30c9){if(!_0x5c30c9[0x0][_0x0acf('0x13')]){return analyticExtractedReport(_0x0acf('0x14'));}var _0x741c47=[];var _0x4f3695=0x0;if(_0x30e23f['split']){if(_0x5c30c9&&_0x5c30c9[_0x0acf('0x15')]){var _0x54d8ae=_[_0x0acf('0x16')](_0x5c30c9[0x0][_0x0acf('0x13')]/_0x419fe0);var _0x43e235=Number[_0x0acf('0x17')](_0x5c30c9[0x0][_0x0acf('0x13')]/_0x419fe0)?_0x5c30c9[0x0]['num']%_0x419fe0:0x0;_0x54d8ae[_0x0acf('0x18')](function(_0x14de67){if(_0x14de67>0x0){_0x4f3695+=_0x419fe0;}_0x741c47['push'](dbH['sequelize']['query'](util['format'](_0x0acf('0x19'),QUERY,_0x419fe0,_0x4f3695),{'type':dbH[_0x0acf('0x11')][_0x0acf('0x12')][_0x0acf('0x1a')]}));});if(_0x43e235>0x0){_0x4f3695+=_0x419fe0;_0x741c47[_0x0acf('0x1b')](dbH[_0x0acf('0x11')][_0x0acf('0x1c')](util[_0x0acf('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x43e235,_0x4f3695),{'type':dbH['sequelize']['QueryTypes'][_0x0acf('0x1a')]}));}}}else{_0x741c47[_0x0acf('0x1b')](dbH[_0x0acf('0x11')][_0x0acf('0x1c')](QUERY,{'type':dbH['sequelize'][_0x0acf('0x12')][_0x0acf('0x1a')]}));}var _0x39c9d9=path[_0x0acf('0x1d')](PATH);var _0x2ffae2=path[_0x0acf('0x1e')](PATH,_0x0acf('0x1f'));var _0x7055a9=_0x30e23f[_0x0acf('0x20')]&&_0x741c47[_0x0acf('0x15')]>0x1;var _0x3ad96c=[];if(!fs[_0x0acf('0x21')](path['join'](_0x39c9d9,_0x2ffae2))&&_0x7055a9){fs[_0x0acf('0x22')](path[_0x0acf('0x23')](_0x39c9d9,_0x2ffae2));}return BPromise[_0x0acf('0x24')](_0x741c47,function(_0xb7e7cb){_0x3ad96c[_0x0acf('0x1b')](_0xb7e7cb);})[_0x0acf('0x10')](function(){for(var _0x2f61be=0x0;_0x2f61be<_0x3ad96c[_0x0acf('0x15')];_0x2f61be+=0x1){var _0x49403d;var _0x57e836=_0x3ad96c[_0x2f61be];if(_0x7055a9){_0x49403d=path[_0x0acf('0x23')](_0x39c9d9,_0x2ffae2,util[_0x0acf('0xc')]('%s%d.%s',_0x2ffae2,_0x2f61be,'csv'));}else{_0x49403d=path[_0x0acf('0x23')](_0x39c9d9,util['format'](_0x0acf('0x25'),_0x2ffae2,'csv'));}fs[_0x0acf('0x26')](_0x49403d,csv(_0x57e836));}})[_0x0acf('0x10')](function(){if(_0x7055a9){return new Promise(function(_0x2be736){zipdir(path[_0x0acf('0x23')](_0x39c9d9,_0x2ffae2),{'saveTo':path['join'](_0x39c9d9,util[_0x0acf('0xc')](_0x0acf('0x25'),_0x2ffae2,_0x0acf('0x27')))},function(_0x5b3cec,_0x1d559c){rimraf(path[_0x0acf('0x23')](_0x39c9d9,_0x2ffae2),function(){});_0x2be736('zip\x20finished');});});}})['then'](function(){logger[_0x0acf('0xb')](util[_0x0acf('0xc')](_0x0acf('0x28'),EXTRACTED_REPORT_ID,_0x0acf('0x29')));return analyticExtractedReport('Completed',_0x7055a9?util[_0x0acf('0xc')](_0x0acf('0x25'),_0x2ffae2,_0x7055a9?_0x0acf('0x27'):_0x0acf('0x2a')):null);});})[_0x0acf('0x2b')](function(_0x433316){logger['info'](util[_0x0acf('0xc')](_0x0acf('0x2c'),EXTRACTED_REPORT_ID,_0x0acf('0x29')),util[_0x0acf('0x2d')](_0x433316,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0acf('0x2e'));})[_0x0acf('0x2f')](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 64d230b..3a27771 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 _0xcb0c=['join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','before','margin','landscape','toString','Arial','black','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync'];(function(_0x2b76c9,_0x46eaee){var _0x230b98=function(_0x27b704){while(--_0x27b704){_0x2b76c9['push'](_0x2b76c9['shift']());}};_0x230b98(++_0x46eaee);}(_0xcb0c,0x81));var _0xccb0=function(_0x21a0cb,_0x5a4cc5){_0x21a0cb=_0x21a0cb-0x0;var _0x2e9bb4=_0xcb0c[_0x21a0cb];return _0x2e9bb4;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xccb0('0x0'));var path=require(_0xccb0('0x1'));var moment=require(_0xccb0('0x2'));var htmlToPdfmake=require(_0xccb0('0x3'));var PdfPrinter=require(_0xccb0('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xccb0('0x5'));var JSDOM=require(_0xccb0('0x6'))['JSDOM'];var window=new JSDOM('')[_0xccb0('0x7')];var BPromise=require(_0xccb0('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xccb0('0x9'))['dbH'];var logger=require(_0xccb0('0xa'))(_0xccb0('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xccb0('0xc')][0x2]);var QUERY=process[_0xccb0('0xc')][0x3];var PATH=process[_0xccb0('0xc')][0x4];var NAME=process[_0xccb0('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x486ecb,_0x4d735a){var _0x3098d7={'status':_0x486ecb};var _0x4d108c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d735a){_0x3098d7['savename']=_0x4d735a;}return db[_0xccb0('0xd')][_0xccb0('0xe')](_0x3098d7,_0x4d108c);}function getHeaders(_0x47d75d){return _[_0xccb0('0xf')](_0x47d75d,function(_0x3182c9){return{'text':_0x3182c9,'style':_0xccb0('0x10')};});}function getRows(_0xa3f99b,_0x575422){return _[_0xccb0('0xf')](_0x575422,function(_0x24c91d){return _(_0x24c91d)[_0xccb0('0x11')](_0xa3f99b)[_0xccb0('0xf')](function(_0x4a6550){return _0x4a6550?_['toString'](_0x4a6550):'';})[_0xccb0('0x12')]();});}function createTable(_0x4ea780,_0x520ff0){var _0x43a4f5={'widths':_[_0xccb0('0x13')](Array(_0x4ea780[_0xccb0('0x14')]),0x91),'heights':function(_0x48fbde){return _0x48fbde===0x0?_0xccb0('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4f75b3=getHeaders(_0x4ea780);_0x43a4f5[_0xccb0('0x16')][_0xccb0('0x17')](_0x4f75b3);var _0x607e8c=getRows(_0x4ea780,_0x520ff0);_0x43a4f5[_0xccb0('0x16')]=_0x43a4f5[_0xccb0('0x16')][_0xccb0('0x18')](_0x607e8c);return _0x43a4f5;}function createTables(_0x5a456f){var _0x35722a=[];var _0x2db9dc=_[_0xccb0('0x19')](Object[_0xccb0('0x1a')](_0x5a456f[0x0]),0x5);_0x2db9dc[_0xccb0('0x1b')](function(_0x1d810e){_0x35722a[_0xccb0('0x17')](createTable(_0x1d810e,_0x5a456f));});return _0x35722a;}function getPDFDocDefinition(_0x3e563a){var _0x15d6a8=util['format'](_0xccb0('0x1c'),NAME,EXTRACTED_REPORT[_0xccb0('0x1d')],moment(EXTRACTED_REPORT[_0xccb0('0x1e')])[_0xccb0('0x1f')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x444686=[];for(var _0x359c49=0x0;_0x359c49<_0x3e563a['length'];_0x359c49++){var _0x5781fe=[];if(_0x359c49===0x0){_0x5781fe['push']({'text':_0x15d6a8,'style':_0xccb0('0x20')});}var _0x35ef2e={'table':_0x3e563a[_0x359c49]};if(_0x359c49>0x0){_0x35ef2e['pageBreak']=_0xccb0('0x21');_0x35ef2e[_0xccb0('0x22')]=[0x0,0x46,0x0,0x0];}_0x5781fe['push'](_0x35ef2e);_0x444686['push'](_0x5781fe);}return{'pageSize':'A4','pageOrientation':_0xccb0('0x23'),'content':_0x444686,'footer':function(_0x973f39,_0x3d7c5c){return{'text':_0x973f39[_0xccb0('0x24')]()+'\x20/\x20'+_0x3d7c5c,'style':'footer'};},'defaultStyle':{'font':_0xccb0('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xccb0('0x26')},'footer':{'alignment':_0xccb0('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2c6ad9){var _0x2ec55c=0x1388;var _0x57e337;if(!_0x2c6ad9[0x0][_0xccb0('0x28')]){return analyticExtractedReport('Empty');}return db[_0xccb0('0x29')][_0xccb0('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xccb0('0x2b'),_0xccb0('0x2c')]})[_0xccb0('0x2d')](function(_0x4c5f8c){if(_0x4c5f8c){_0x57e337=_0x4c5f8c;_0x2ec55c=_0x57e337[_0xccb0('0x2c')]||0x3e8;}})[_0xccb0('0x2d')](function(){var _0x5c4d1a=[];var _0x55534a=0x0;if(_0x57e337[_0xccb0('0x2b')]){if(_0x2c6ad9&&_0x2c6ad9[_0xccb0('0x14')]){var _0x4f20ba=_[_0xccb0('0x2e')](_0x2c6ad9[0x0]['num']/_0x2ec55c);var _0x32f028=Number[_0xccb0('0x2f')](_0x2c6ad9[0x0][_0xccb0('0x28')]/_0x2ec55c)?_0x2c6ad9[0x0][_0xccb0('0x28')]%_0x2ec55c:0x0;_0x4f20ba['forEach'](function(_0x392742){if(_0x392742>0x0){_0x55534a+=_0x2ec55c;}_0x5c4d1a[_0xccb0('0x17')](dbH[_0xccb0('0x30')][_0xccb0('0x31')](util[_0xccb0('0x1f')](_0xccb0('0x32'),QUERY,_0x2ec55c,_0x55534a),{'type':dbH[_0xccb0('0x30')][_0xccb0('0x33')][_0xccb0('0x34')]}));});if(_0x32f028>0x0){_0x55534a+=_0x2ec55c;_0x5c4d1a[_0xccb0('0x17')](dbH['sequelize'][_0xccb0('0x31')](util[_0xccb0('0x1f')](_0xccb0('0x32'),QUERY,_0x32f028,_0x55534a),{'type':dbH['sequelize'][_0xccb0('0x33')][_0xccb0('0x34')]}));}}}else{_0x5c4d1a[_0xccb0('0x17')](dbH[_0xccb0('0x30')][_0xccb0('0x31')](QUERY,{'type':dbH[_0xccb0('0x30')][_0xccb0('0x33')][_0xccb0('0x34')]}));}var _0xb58a63=path[_0xccb0('0x35')](PATH);var _0x4a4343=path[_0xccb0('0x36')](PATH,_0xccb0('0x37'));var _0x2f393c=_0x57e337[_0xccb0('0x2b')]&&_0x5c4d1a[_0xccb0('0x14')]>0x1;var _0x554af0=[];if(!fs[_0xccb0('0x38')](path[_0xccb0('0x39')](_0xb58a63,_0x4a4343))&&_0x2f393c){fs[_0xccb0('0x3a')](path[_0xccb0('0x39')](_0xb58a63,_0x4a4343));}return BPromise[_0xccb0('0x3b')](_0x5c4d1a,function(_0x32e64e){_0x554af0[_0xccb0('0x17')](_0x32e64e);})['then'](function(){var _0x50bc34=[];for(var _0x12cdfa=0x0;_0x12cdfa<_0x554af0['length'];_0x12cdfa+=0x1){var _0x24c0e6=_0x554af0[_0x12cdfa];var _0xdbc0ce=createTables(_[_0xccb0('0x3c')](_0x24c0e6));var _0x48d85e;var _0x497725=getPDFDocDefinition(_0xdbc0ce);var _0x5f14d9=getPDFPrinter();var _0x39f7b0=_0x5f14d9[_0xccb0('0x3d')](_0x497725);if(_0x2f393c){_0x48d85e=path[_0xccb0('0x39')](_0xb58a63,_0x4a4343,util[_0xccb0('0x1f')]('%s%d.%s',_0x4a4343,_0x12cdfa,_0xccb0('0x3e')));}else{_0x48d85e=path[_0xccb0('0x39')](_0xb58a63,util[_0xccb0('0x1f')](_0xccb0('0x3f'),_0x4a4343,'pdf'));}_0x50bc34['push'](writePDFDocument(_0x39f7b0,_0x48d85e));}return Promise[_0xccb0('0x40')](_0x50bc34);})[_0xccb0('0x2d')](function(){if(_0x2f393c){return new Promise(function(_0x11cbed){zipdir(path[_0xccb0('0x39')](_0xb58a63,_0x4a4343),{'saveTo':path[_0xccb0('0x39')](_0xb58a63,util[_0xccb0('0x1f')](_0xccb0('0x3f'),_0x4a4343,_0xccb0('0x41')))},function(){rimraf(path['join'](_0xb58a63,_0x4a4343),function(){});_0x11cbed(_0xccb0('0x42'));});});}})['then'](function(){if(!_0x2f393c)return;rimraf(path['join'](_0xb58a63,_0x4a4343),function(){});})[_0xccb0('0x2d')](function(){logger[_0xccb0('0x43')](util[_0xccb0('0x1f')](_0xccb0('0x44'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xccb0('0x45'),_0x2f393c?util['format'](_0xccb0('0x3f'),_0x4a4343,_0x2f393c?_0xccb0('0x41'):_0xccb0('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xccb0('0x43')](util[_0xccb0('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xccb0('0x46')));return db['AnalyticExtractedReport'][_0xccb0('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x42613b){EXTRACTED_REPORT=_0x42613b;return dbH[_0xccb0('0x30')][_0xccb0('0x31')](util['format'](_0xccb0('0x48'),QUERY),{'type':dbH[_0xccb0('0x30')][_0xccb0('0x33')]['SELECT']});})['then'](extractReport)[_0xccb0('0x49')](function(_0x4cca9a){logger[_0xccb0('0x43')](util['format'](_0xccb0('0x4a'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x4cca9a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xccb0('0x4b'));})['finally'](function(){process[_0xccb0('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1e5f50=new PdfPrinter({'Arial':{'normal':__dirname+_0xccb0('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xccb0('0x4e'),'bolditalics':__dirname+_0xccb0('0x4f')}});return _0x1e5f50;}function getPDFDocDefinitionFromHTML(_0x3e9b50,_0x1fdbfb){var _0x4cd50a=util[_0xccb0('0x1f')](_0xccb0('0x50'),_0x1fdbfb[_0xccb0('0x51')],_0x1fdbfb[_0xccb0('0x52')]);var _0x1e127e=moment()[_0xccb0('0x1f')](_0xccb0('0x53'))[_0xccb0('0x24')]();var _0x5c0d9c=htmlToPdfmake(_0x3e9b50,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5c0d9c],'defaultStyle':{'font':_0xccb0('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xccb0('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xccb0('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xccb0('0x54')}},'header':function(){return[{'text':_0xccb0('0x55'),'style':_0xccb0('0x20')}];},'footer':function(_0x2549ce,_0x2fb084){return[{'text':util[_0xccb0('0x1f')](_0xccb0('0x56'),_0x4cd50a,_0x2549ce,_0x2fb084,_0x1e127e),'style':'footer'}];}};}function writePDFDocument(_0x429b41,_0x1c066c){return new Promise(function(_0x397266,_0x1fa87d){var _0xdc1c98=_0x429b41[_0xccb0('0x57')](fs[_0xccb0('0x58')](_0x1c066c));_0xdc1c98['on'](_0xccb0('0x59'),function(){_0x397266('finish');});_0xdc1c98['on'](_0xccb0('0x5a'),function(_0x36703f){_0x1fa87d(_0x36703f);});_0x429b41[_0xccb0('0x5b')]();});}exports[_0xccb0('0x5c')]=function(_0x5d7ea5,_0x1f0d23){var _0x4cf5b2=getPDFPrinter();var _0x5d9233=getPDFDocDefinitionFromHTML(_0x5d7ea5,_0x1f0d23);var _0x1c57dd=_0x4cf5b2['createPdfKitDocument'](_0x5d9233);return writePDFDocument(_0x1c57dd,_0x1f0d23[_0xccb0('0x1')])['catch'](function(_0x5522cb){throw _0x5522cb;});}; \ No newline at end of file +var _0x594d=['pdf','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','createPdfKitDocument','path','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','margin','Arial','right','num','Empty','Setting','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','split','existsSync','join','each','%s.%s','all','zip','info','PDF','Completed'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x594d,0x1e1));var _0xd594=function(_0x40aaa4,_0xb7bbfb){_0x40aaa4=_0x40aaa4-0x0;var _0x7ede85=_0x594d[_0x40aaa4];return _0x7ede85;};'use strict';var _=require(_0xd594('0x0'));var fs=require('fs');var util=require(_0xd594('0x1'));var path=require('path');var moment=require(_0xd594('0x2'));var htmlToPdfmake=require(_0xd594('0x3'));var PdfPrinter=require(_0xd594('0x4'));var zipdir=require(_0xd594('0x5'));var rimraf=require(_0xd594('0x6'));var JSDOM=require(_0xd594('0x7'))[_0xd594('0x8')];var window=new JSDOM('')[_0xd594('0x9')];var BPromise=require(_0xd594('0xa'));var db=require(_0xd594('0xb'))['db'];var dbH=require('../../mysqldb')[_0xd594('0xc')];var logger=require('../../config/logger')(_0xd594('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xd594('0xe')][0x2]);var QUERY=process[_0xd594('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd594('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x94be28,_0x2b755c){var _0x14dd4b={'status':_0x94be28};var _0x1a49c2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b755c){_0x14dd4b[_0xd594('0x10')]=_0x2b755c;}return db[_0xd594('0x11')]['update'](_0x14dd4b,_0x1a49c2);}function getHeaders(_0x37ca69){return _[_0xd594('0x12')](_0x37ca69,function(_0x56caa6){return{'text':_0x56caa6,'style':_0xd594('0x13')};});}function getRows(_0x578700,_0x412821){return _['map'](_0x412821,function(_0xd008c7){return _(_0xd008c7)[_0xd594('0x14')](_0x578700)[_0xd594('0x12')](function(_0x343333){return _0x343333?_[_0xd594('0x15')](_0x343333):'';})[_0xd594('0x16')]();});}function createTable(_0x43a95c,_0x59c67c){var _0x47aa58={'widths':_[_0xd594('0x17')](Array(_0x43a95c[_0xd594('0x18')]),0x91),'heights':function(_0x329c02){return _0x329c02===0x0?_0xd594('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x486f97=getHeaders(_0x43a95c);_0x47aa58[_0xd594('0x1a')][_0xd594('0x1b')](_0x486f97);var _0x78594e=getRows(_0x43a95c,_0x59c67c);_0x47aa58[_0xd594('0x1a')]=_0x47aa58[_0xd594('0x1a')][_0xd594('0x1c')](_0x78594e);return _0x47aa58;}function createTables(_0x3776bb){var _0x5ed841=[];var _0x156acd=_[_0xd594('0x1d')](Object[_0xd594('0x1e')](_0x3776bb[0x0]),0x5);_0x156acd[_0xd594('0x1f')](function(_0x43d87d){_0x5ed841[_0xd594('0x1b')](createTable(_0x43d87d,_0x3776bb));});return _0x5ed841;}function getPDFDocDefinition(_0x706ba9){var _0x3fbdfd=util['format'](_0xd594('0x20'),NAME,EXTRACTED_REPORT[_0xd594('0x21')],moment(EXTRACTED_REPORT[_0xd594('0x22')])[_0xd594('0x23')](FORMAT),moment(EXTRACTED_REPORT[_0xd594('0x24')])[_0xd594('0x23')](FORMAT));var _0x5ca7ba=[];for(var _0x427834=0x0;_0x427834<_0x706ba9[_0xd594('0x18')];_0x427834++){var _0x3bb9e7=[];if(_0x427834===0x0){_0x3bb9e7['push']({'text':_0x3fbdfd,'style':_0xd594('0x25')});}var _0x11959e={'table':_0x706ba9[_0x427834]};if(_0x427834>0x0){_0x11959e['pageBreak']='before';_0x11959e[_0xd594('0x26')]=[0x0,0x46,0x0,0x0];}_0x3bb9e7[_0xd594('0x1b')](_0x11959e);_0x5ca7ba[_0xd594('0x1b')](_0x3bb9e7);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5ca7ba,'footer':function(_0x1bbf92,_0x2e3fe9){return{'text':_0x1bbf92[_0xd594('0x15')]()+'\x20/\x20'+_0x2e3fe9,'style':'footer'};},'defaultStyle':{'font':_0xd594('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xd594('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x180040){var _0x56250f=0x1388;var _0xbbda70;if(!_0x180040[0x0][_0xd594('0x29')]){return analyticExtractedReport(_0xd594('0x2a'));}return db[_0xd594('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd594('0x2c')]})[_0xd594('0x2d')](function(_0x22138b){if(_0x22138b){_0xbbda70=_0x22138b;_0x56250f=_0xbbda70[_0xd594('0x2c')]||0x3e8;}})[_0xd594('0x2d')](function(){var _0x51bcfe=[];var _0x1e7002=0x0;if(_0xbbda70['split']){if(_0x180040&&_0x180040[_0xd594('0x18')]){var _0x23cb1d=_[_0xd594('0x2e')](_0x180040[0x0][_0xd594('0x29')]/_0x56250f);var _0x44d0dd=Number[_0xd594('0x2f')](_0x180040[0x0][_0xd594('0x29')]/_0x56250f)?_0x180040[0x0]['num']%_0x56250f:0x0;_0x23cb1d[_0xd594('0x1f')](function(_0x647b){if(_0x647b>0x0){_0x1e7002+=_0x56250f;}_0x51bcfe[_0xd594('0x1b')](dbH[_0xd594('0x30')][_0xd594('0x31')](util['format'](_0xd594('0x32'),QUERY,_0x56250f,_0x1e7002),{'type':dbH['sequelize'][_0xd594('0x33')]['SELECT']}));});if(_0x44d0dd>0x0){_0x1e7002+=_0x56250f;_0x51bcfe[_0xd594('0x1b')](dbH['sequelize'][_0xd594('0x31')](util[_0xd594('0x23')](_0xd594('0x32'),QUERY,_0x44d0dd,_0x1e7002),{'type':dbH[_0xd594('0x30')][_0xd594('0x33')][_0xd594('0x34')]}));}}}else{_0x51bcfe['push'](dbH[_0xd594('0x30')][_0xd594('0x31')](QUERY,{'type':dbH[_0xd594('0x30')]['QueryTypes'][_0xd594('0x34')]}));}var _0x21f869=path[_0xd594('0x35')](PATH);var _0x28e1eb=path['basename'](PATH,_0xd594('0x36'));var _0x5af78e=_0xbbda70[_0xd594('0x37')]&&_0x51bcfe[_0xd594('0x18')]>0x1;var _0x29f549=[];if(!fs[_0xd594('0x38')](path[_0xd594('0x39')](_0x21f869,_0x28e1eb))&&_0x5af78e){fs['mkdirSync'](path[_0xd594('0x39')](_0x21f869,_0x28e1eb));}return BPromise[_0xd594('0x3a')](_0x51bcfe,function(_0x3f506e){_0x29f549[_0xd594('0x1b')](_0x3f506e);})[_0xd594('0x2d')](function(){var _0x540a53=[];for(var _0x353836=0x0;_0x353836<_0x29f549[_0xd594('0x18')];_0x353836+=0x1){var _0x2b62ea=_0x29f549[_0x353836];var _0x21a931=createTables(_['flatten'](_0x2b62ea));var _0x2a9354;var _0x317126=getPDFDocDefinition(_0x21a931);var _0x2389da=getPDFPrinter();var _0x1aacf6=_0x2389da['createPdfKitDocument'](_0x317126);if(_0x5af78e){_0x2a9354=path[_0xd594('0x39')](_0x21f869,_0x28e1eb,util[_0xd594('0x23')]('%s%d.%s',_0x28e1eb,_0x353836,'pdf'));}else{_0x2a9354=path[_0xd594('0x39')](_0x21f869,util[_0xd594('0x23')](_0xd594('0x3b'),_0x28e1eb,'pdf'));}_0x540a53['push'](writePDFDocument(_0x1aacf6,_0x2a9354));}return Promise[_0xd594('0x3c')](_0x540a53);})[_0xd594('0x2d')](function(){if(_0x5af78e){return new Promise(function(_0x38e0e5){zipdir(path[_0xd594('0x39')](_0x21f869,_0x28e1eb),{'saveTo':path['join'](_0x21f869,util['format'](_0xd594('0x3b'),_0x28e1eb,_0xd594('0x3d')))},function(){rimraf(path[_0xd594('0x39')](_0x21f869,_0x28e1eb),function(){});_0x38e0e5('zip\x20finished');});});}})[_0xd594('0x2d')](function(){if(!_0x5af78e)return;rimraf(path[_0xd594('0x39')](_0x21f869,_0x28e1eb),function(){});})[_0xd594('0x2d')](function(){logger[_0xd594('0x3e')](util[_0xd594('0x23')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd594('0x3f')));return analyticExtractedReport(_0xd594('0x40'),_0x5af78e?util[_0xd594('0x23')](_0xd594('0x3b'),_0x28e1eb,_0x5af78e?'zip':_0xd594('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd594('0x3e')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd594('0x3f')));return db['AnalyticExtractedReport'][_0xd594('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd594('0x2d')](function(_0xbf02b2){EXTRACTED_REPORT=_0xbf02b2;return dbH[_0xd594('0x30')][_0xd594('0x31')](util[_0xd594('0x23')](_0xd594('0x43'),QUERY),{'type':dbH[_0xd594('0x30')]['QueryTypes'][_0xd594('0x34')]});})['then'](extractReport)[_0xd594('0x44')](function(_0x150cdf){logger[_0xd594('0x3e')](util[_0xd594('0x23')](_0xd594('0x45'),EXTRACTED_REPORT_ID,_0xd594('0x3f')),util[_0xd594('0x46')](_0x150cdf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd594('0x47'));})[_0xd594('0x48')](function(){process[_0xd594('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x58f46a=new PdfPrinter({'Arial':{'normal':__dirname+_0xd594('0x4a'),'bold':__dirname+_0xd594('0x4b'),'italics':__dirname+_0xd594('0x4c'),'bolditalics':__dirname+_0xd594('0x4d')}});return _0x58f46a;}function getPDFDocDefinitionFromHTML(_0x1c5995,_0x76f10a){var _0x5d24f6=util[_0xd594('0x23')](_0xd594('0x4e'),_0x76f10a[_0xd594('0x4f')],_0x76f10a[_0xd594('0x50')]);var _0x13764a=moment()[_0xd594('0x23')](_0xd594('0x51'))['toString']();var _0x3ca427=htmlToPdfmake(_0x1c5995,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3ca427],'defaultStyle':{'font':_0xd594('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd594('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd594('0x52')}},'header':function(){return[{'text':_0xd594('0x53'),'style':_0xd594('0x25')}];},'footer':function(_0xf9a634,_0x3a5daa){return[{'text':util['format'](_0xd594('0x54'),_0x5d24f6,_0xf9a634,_0x3a5daa,_0x13764a),'style':_0xd594('0x55')}];}};}function writePDFDocument(_0xf7337a,_0x301f20){return new Promise(function(_0x309802,_0x894034){var _0x2e20dd=_0xf7337a['pipe'](fs[_0xd594('0x56')](_0x301f20));_0x2e20dd['on'](_0xd594('0x57'),function(){_0x309802(_0xd594('0x57'));});_0x2e20dd['on'](_0xd594('0x58'),function(_0x973187){_0x894034(_0x973187);});_0xf7337a['end']();});}exports['createPdfFromHTML']=function(_0x3efdc5,_0xf7837e){var _0x2a3f0c=getPDFPrinter();var _0x3f075e=getPDFDocDefinitionFromHTML(_0x3efdc5,_0xf7837e);var _0x4a205e=_0x2a3f0c[_0xd594('0x59')](_0x3f075e);return writePDFDocument(_0x4a205e,_0xf7837e[_0xd594('0x5a')])[_0xd594('0x44')](function(_0x29f8a3){throw _0x29f8a3;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e07d814..0f37d2a 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 _0x8988=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','json2xls','bluebird','zip-dir','rimraf','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','range','forEach','push'];(function(_0x2c8d4b,_0x2f7da9){var _0x19f41f=function(_0x591d08){while(--_0x591d08){_0x2c8d4b['push'](_0x2c8d4b['shift']());}};_0x19f41f(++_0x2f7da9);}(_0x8988,0xcf));var _0x8898=function(_0x52d062,_0x4b6ab8){_0x52d062=_0x52d062-0x0;var _0x450b40=_0x8988[_0x52d062];return _0x450b40;};'use strict';var util=require(_0x8898('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x8898('0x1'));var BPromise=require(_0x8898('0x2'));var zipdir=require(_0x8898('0x3'));var rimraf=require(_0x8898('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x8898('0x5')];var logger=require('../../config/logger')(_0x8898('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8898('0x7')][0x3];var PATH=process[_0x8898('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d9f6e,_0x38d76d){var _0x51ab3b={'status':_0x4d9f6e};var _0x301c4f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38d76d){_0x51ab3b['savename']=_0x38d76d;}return db[_0x8898('0x8')][_0x8898('0x9')](_0x51ab3b,_0x301c4f);}function main(){var _0x2aecb8=0x1388;var _0x401250;logger[_0x8898('0xa')](util[_0x8898('0xb')](_0x8898('0xc'),EXTRACTED_REPORT_ID,_0x8898('0xd')));return db[_0x8898('0xe')][_0x8898('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8898('0x10'),_0x8898('0x11')]})[_0x8898('0x12')](function(_0x2b13a9){if(_0x2b13a9){_0x401250=_0x2b13a9;_0x2aecb8=_0x401250[_0x8898('0x11')]||0x1388;}})['then'](function(){return dbH[_0x8898('0x13')][_0x8898('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8898('0x13')][_0x8898('0x15')][_0x8898('0x16')]});})[_0x8898('0x12')](function(_0x2bdfb8){if(!_0x2bdfb8[0x0][_0x8898('0x17')]){return analyticExtractedReport(_0x8898('0x18'));}var _0x36b779=[];var _0x5700c9=0x0;if(_0x401250['split']){if(_0x2bdfb8&&_0x2bdfb8['length']){var _0x2ea6b5=_[_0x8898('0x19')](_0x2bdfb8[0x0][_0x8898('0x17')]/_0x2aecb8);var _0x29ec26=Number['isInteger'](_0x2bdfb8[0x0][_0x8898('0x17')]/_0x2aecb8)?_0x2bdfb8[0x0][_0x8898('0x17')]%_0x2aecb8:0x0;_0x2ea6b5[_0x8898('0x1a')](function(_0x2d39a9){if(_0x2d39a9>0x0){_0x5700c9+=_0x2aecb8;}_0x36b779[_0x8898('0x1b')](dbH['sequelize'][_0x8898('0x14')](util[_0x8898('0xb')](_0x8898('0x1c'),QUERY,_0x2aecb8,_0x5700c9),{'type':dbH[_0x8898('0x13')]['QueryTypes'][_0x8898('0x16')]}));});if(_0x29ec26>0x0){_0x5700c9+=_0x2aecb8;_0x36b779[_0x8898('0x1b')](dbH[_0x8898('0x13')]['query'](util[_0x8898('0xb')](_0x8898('0x1c'),QUERY,_0x29ec26,_0x5700c9),{'type':dbH[_0x8898('0x13')][_0x8898('0x15')][_0x8898('0x16')]}));}}}else{_0x36b779[_0x8898('0x1b')](dbH[_0x8898('0x13')][_0x8898('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x8898('0x16')]}));}var _0xc0ce3c=path[_0x8898('0x1d')](PATH);var _0x33b52e=path['basename'](PATH,_0x8898('0x1e'));var _0x11525d=_0x401250['split']&&_0x36b779[_0x8898('0x1f')]>0x1;var _0x1c854e=[];if(!fs[_0x8898('0x20')](path[_0x8898('0x21')](_0xc0ce3c,_0x33b52e))&&_0x11525d){fs[_0x8898('0x22')](path['join'](_0xc0ce3c,_0x33b52e));}return BPromise[_0x8898('0x23')](_0x36b779,function(_0x393067){_0x1c854e['push'](_0x393067);})[_0x8898('0x12')](function(){for(var _0x2be414=0x0;_0x2be414<_0x1c854e['length'];_0x2be414+=0x1){var _0x3425b9;var _0x17c765=_0x1c854e[_0x2be414];if(_0x11525d){_0x3425b9=path['join'](_0xc0ce3c,_0x33b52e,util[_0x8898('0xb')](_0x8898('0x24'),_0x33b52e,_0x2be414,_0x8898('0x25')));}else{_0x3425b9=path[_0x8898('0x21')](_0xc0ce3c,util['format'](_0x8898('0x26'),_0x33b52e,'xlsx'));}fs[_0x8898('0x27')](_0x3425b9,json2xls(_0x17c765),'binary');}})['then'](function(){if(_0x11525d){return new Promise(function(_0x65211e){zipdir(path[_0x8898('0x21')](_0xc0ce3c,_0x33b52e),{'saveTo':path[_0x8898('0x21')](_0xc0ce3c,util[_0x8898('0xb')](_0x8898('0x26'),_0x33b52e,_0x8898('0x28')))},function(_0x3ed538,_0x2b8db5){rimraf(path['join'](_0xc0ce3c,_0x33b52e),function(){});_0x65211e(_0x8898('0x29'));});});}})[_0x8898('0x12')](function(){logger[_0x8898('0xa')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8898('0xd')));return analyticExtractedReport(_0x8898('0x2a'),_0x11525d?util[_0x8898('0xb')](_0x8898('0x26'),_0x33b52e,_0x11525d?_0x8898('0x28'):_0x8898('0x25')):null);});})[_0x8898('0x2b')](function(_0x26cea6){logger['info'](util['format'](_0x8898('0x2c'),EXTRACTED_REPORT_ID,_0x8898('0xd')),util['inspect'](_0x26cea6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8898('0x2d')](function(){process[_0x8898('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4689=['Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','existsSync','join','xlsx','writeFileSync','binary','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','zip','catch','inspect','Failed','exit','util','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num'];(function(_0x27a55c,_0x39cc4f){var _0x50ccc2=function(_0x6e5aed){while(--_0x6e5aed){_0x27a55c['push'](_0x27a55c['shift']());}};_0x50ccc2(++_0x39cc4f);}(_0x4689,0xf9));var _0x9468=function(_0x23268a,_0x3b6b29){_0x23268a=_0x23268a-0x0;var _0x4623ad=_0x4689[_0x23268a];return _0x4623ad;};'use strict';var util=require(_0x9468('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x9468('0x1'));var BPromise=require(_0x9468('0x2'));var zipdir=require(_0x9468('0x3'));var rimraf=require('rimraf');var db=require(_0x9468('0x4'))['db'];var dbH=require(_0x9468('0x4'))['dbH'];var logger=require(_0x9468('0x5'))(_0x9468('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x9468('0x7')][0x2]);var QUERY=process[_0x9468('0x7')][0x3];var PATH=process[_0x9468('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x444f7d,_0xca7842){var _0x3b04e7={'status':_0x444f7d};var _0x576549={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xca7842){_0x3b04e7[_0x9468('0x8')]=_0xca7842;}return db['AnalyticExtractedReport'][_0x9468('0x9')](_0x3b04e7,_0x576549);}function main(){var _0x27e50c=0x1388;var _0x21fe13;logger['info'](util[_0x9468('0xa')](_0x9468('0xb'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9468('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9468('0xd'),_0x9468('0xe')]})[_0x9468('0xf')](function(_0x52950f){if(_0x52950f){_0x21fe13=_0x52950f;_0x27e50c=_0x21fe13['splitSizeXlsx']||0x1388;}})[_0x9468('0xf')](function(){return dbH[_0x9468('0x10')][_0x9468('0x11')](util[_0x9468('0xa')](_0x9468('0x12'),QUERY),{'type':dbH[_0x9468('0x10')][_0x9468('0x13')]['SELECT']});})[_0x9468('0xf')](function(_0x378a12){if(!_0x378a12[0x0][_0x9468('0x14')]){return analyticExtractedReport(_0x9468('0x15'));}var _0x58fa9a=[];var _0x345957=0x0;if(_0x21fe13['split']){if(_0x378a12&&_0x378a12[_0x9468('0x16')]){var _0x390713=_[_0x9468('0x17')](_0x378a12[0x0][_0x9468('0x14')]/_0x27e50c);var _0x1911eb=Number[_0x9468('0x18')](_0x378a12[0x0]['num']/_0x27e50c)?_0x378a12[0x0]['num']%_0x27e50c:0x0;_0x390713['forEach'](function(_0x50e8ce){if(_0x50e8ce>0x0){_0x345957+=_0x27e50c;}_0x58fa9a[_0x9468('0x19')](dbH[_0x9468('0x10')]['query'](util['format'](_0x9468('0x1a'),QUERY,_0x27e50c,_0x345957),{'type':dbH[_0x9468('0x10')][_0x9468('0x13')][_0x9468('0x1b')]}));});if(_0x1911eb>0x0){_0x345957+=_0x27e50c;_0x58fa9a[_0x9468('0x19')](dbH[_0x9468('0x10')]['query'](util[_0x9468('0xa')](_0x9468('0x1a'),QUERY,_0x1911eb,_0x345957),{'type':dbH[_0x9468('0x10')][_0x9468('0x13')][_0x9468('0x1b')]}));}}}else{_0x58fa9a[_0x9468('0x19')](dbH['sequelize'][_0x9468('0x11')](QUERY,{'type':dbH[_0x9468('0x10')]['QueryTypes'][_0x9468('0x1b')]}));}var _0x252372=path[_0x9468('0x1c')](PATH);var _0x3b8844=path['basename'](PATH,_0x9468('0x1d'));var _0x2f349c=_0x21fe13[_0x9468('0xd')]&&_0x58fa9a[_0x9468('0x16')]>0x1;var _0x3abd82=[];if(!fs[_0x9468('0x1e')](path['join'](_0x252372,_0x3b8844))&&_0x2f349c){fs['mkdirSync'](path[_0x9468('0x1f')](_0x252372,_0x3b8844));}return BPromise['each'](_0x58fa9a,function(_0x4066fa){_0x3abd82['push'](_0x4066fa);})[_0x9468('0xf')](function(){for(var _0x45a81b=0x0;_0x45a81b<_0x3abd82['length'];_0x45a81b+=0x1){var _0xe67df0;var _0x4f954f=_0x3abd82[_0x45a81b];if(_0x2f349c){_0xe67df0=path[_0x9468('0x1f')](_0x252372,_0x3b8844,util[_0x9468('0xa')]('%s%d.%s',_0x3b8844,_0x45a81b,'xlsx'));}else{_0xe67df0=path[_0x9468('0x1f')](_0x252372,util['format']('%s.%s',_0x3b8844,_0x9468('0x20')));}fs[_0x9468('0x21')](_0xe67df0,json2xls(_0x4f954f),_0x9468('0x22'));}})['then'](function(){if(_0x2f349c){return new Promise(function(_0x3418b1){zipdir(path[_0x9468('0x1f')](_0x252372,_0x3b8844),{'saveTo':path[_0x9468('0x1f')](_0x252372,util[_0x9468('0xa')](_0x9468('0x23'),_0x3b8844,'zip'))},function(_0x4f1165,_0x1b0cac){rimraf(path['join'](_0x252372,_0x3b8844),function(){});_0x3418b1(_0x9468('0x24'));});});}})[_0x9468('0xf')](function(){logger[_0x9468('0x25')](util[_0x9468('0xa')](_0x9468('0x26'),EXTRACTED_REPORT_ID,_0x9468('0x27')));return analyticExtractedReport('Completed',_0x2f349c?util[_0x9468('0xa')](_0x9468('0x23'),_0x3b8844,_0x2f349c?_0x9468('0x28'):'xlsx'):null);});})[_0x9468('0x29')](function(_0x38df9a){logger[_0x9468('0x25')](util[_0x9468('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9468('0x27')),util[_0x9468('0x2a')](_0x38df9a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9468('0x2b'));})['finally'](function(){process[_0x9468('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 452ba0d..920233a 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 _0x0268=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','lodash','util','models','findAll','then','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','push','type','Set','format','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x0268,0x12d));var _0x8026=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0268[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8026('0x0'));var util=require(_0x8026('0x1'));function rewrite(_0xb53400,_0x3cb7f3){var _0xdd843d=this;return _0xb53400[_0x8026('0x2')]['Interval'][_0x8026('0x3')]({'raw':!![]})[_0x8026('0x4')](function(_0x42cdcf){_0xdd843d['intervals']=_0x42cdcf;return _0xb53400[_0x8026('0x2')]['VoiceExtension'][_0x8026('0x3')]({'where':{'IntervalId':_0x3cb7f3[_0x8026('0x5')]},'raw':!![]});})['then'](function(_0x5c2a1b){return _0xb53400['models'][_0x8026('0x6')][_0x8026('0x3')]({'where':{'exten':{'$in':_[_0x8026('0x7')](_[_0x8026('0x8')](_0x5c2a1b,_0x8026('0x9')))}},'order':[{'raw':_0x8026('0xa')}],'raw':!![]});})[_0x8026('0x4')](function(_0x2bc26d){var _0x1505bb=_[_0x8026('0xb')](_0x2bc26d,{'priority':'1'});var _0x1412da=_[_0x8026('0xb')](_0x2bc26d,{'isApp':0x1});var _0x553843=_[_0x8026('0xc')](_0x1412da,_0x8026('0x9'));var _0x4520a1=[_0x8026('0xd'),_0x8026('0xe')];var _0x36f1f2=[];var _0x28d225=[];for(var _0x15d814 in _0x553843){if(_0x553843['hasOwnProperty'](_0x15d814)){_0xdd843d[_0x8026('0xf')]=0x2;_0xdd843d['extensions']=[];_0xdd843d['extension']=_['find'](_0x1505bb,{'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')]});_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':util[_0x8026('0x14')](_0x8026('0x15'),_0x553843[_0x15d814][0x0][_0x8026('0x12')]),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});if(_0x553843[_0x15d814][0x0][_0x8026('0x12')]===_0x8026('0x17')){_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':'Set','appdata':_0x8026('0x18')+_0x553843[_0x15d814][0x0][_0x8026('0x19')],'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});}else if(_0x553843[_0x15d814][0x0][_0x8026('0x12')]===_0x8026('0x1a')){if(_0xdd843d[_0x8026('0x1b')]){_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':'Set','appdata':_0x8026('0x1c')+(_0xdd843d[_0x8026('0x1b')][_0x8026('0x1d')]?'${EXTEN:'+_0xdd843d[_0x8026('0x1b')][_0x8026('0x1d')]+'}':_0x8026('0x1e')),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});}_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':'CDR(routeid)='+_0x553843[_0x15d814][0x0][_0x8026('0x19')],'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});var _0x3c7b96=_0xdd843d[_0x8026('0xf')]++;_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0]['type'],'app':_0x8026('0x1f'),'appdata':_0x8026('0x20')+(_0x3c7b96+0x2)+_0x8026('0x21')+(_0x3c7b96+0x1)+')','context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0]['exten'],'priority':_0x3c7b96,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});if(_0xdd843d['extension']){_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':_0xdd843d[_0x8026('0x1b')][_0x8026('0x1d')]?_0x8026('0x22')+_0xdd843d['extension'][_0x8026('0x1d')]+'}':_0x8026('0x23'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d['priority']++,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});}_0xdd843d['extensions']['push']({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':_0x8026('0x24')+_0x553843[_0x15d814][0x0][_0x8026('0x19')],'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});if(_0xdd843d[_0x8026('0x1b')]&&_0xdd843d[_0x8026('0x1b')][_0x8026('0x25')](_0x8026('0x26'))&&_0xdd843d[_0x8026('0x1b')][_0x8026('0x26')]!=='none'){_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':_0x8026('0x27'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xdd843d[_0x8026('0x1b')][_0x8026('0x26')]||_0x8026('0x28'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d['priority']++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});}}_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':_0x8026('0x29'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});_0xdd843d['extensions'][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':'Set','appdata':_0x8026('0x2a'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0]['exten'],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x13'),'appdata':_0x8026('0x2b'),'context':_0x553843[_0x15d814][0x0][_0x8026('0x16')],'exten':_0x553843[_0x15d814][0x0]['exten'],'priority':_0xdd843d[_0x8026('0xf')]++,'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});for(var _0xadae52=0x0,_0xf7e724=0x0;_0xadae52<_0x553843[_0x15d814]['length'];_0xadae52+=0x1,_0xf7e724=0x0){var _0x4ef19d=_0x553843[_0x15d814][_0xadae52];if(_0x4ef19d[_0x8026('0x12')]){_0x4ef19d[_0x8026('0x12')]=_0x4ef19d['type'][_0x8026('0x2c')]();}var _0x595863=[];var _0x3f95c2=[];delete _0x4ef19d['id'];delete _0x4ef19d[_0x8026('0x2d')];delete _0x4ef19d[_0x8026('0x2e')];var _0xe721ef=_0x4ef19d[_0x8026('0x2f')]!==_0x8026('0x30')?[_0x4ef19d[_0x8026('0x2f')]]:_0x4ef19d[_0x8026('0x5')]?_[_0x8026('0x8')](_[_0x8026('0xb')](_0xdd843d[_0x8026('0x31')],{'IntervalId':_0x4ef19d[_0x8026('0x5')]}),_0x8026('0x2f')):[];if(_0x4ef19d['hasOwnProperty']('tag')){if(_0x4ef19d[_0x8026('0x32')]&&_0x4ef19d[_0x8026('0x32')]!=='--'){_0x595863[_0x8026('0x11')]({'type':_0x4ef19d['type'],'app':_0x8026('0x13'),'appdata':'CDR(tag)='+_0x4ef19d['tag'],'context':_0x4ef19d['context'],'exten':_0x4ef19d[_0x8026('0x9')],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d['priority']+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});}}if(_0x4ef19d[_0x8026('0x12')]==='outbound'&&_0x4ef19d[_0x8026('0x25')](_0x8026('0x34'))){if(_0x4ef19d[_0x8026('0x34')]){_0x595863['push']({'type':_0x4ef19d[_0x8026('0x12')],'app':'ExecIf','appdata':_0x8026('0x35')+_0x4ef19d[_0x8026('0x34')]+')','context':_0x4ef19d[_0x8026('0x16')],'exten':_0x4ef19d['exten'],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d[_0x8026('0xf')]+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});}else{_0x595863['push']({'type':_0x4ef19d[_0x8026('0x12')],'app':_0x8026('0x1f'),'appdata':_0x8026('0x36'),'context':_0x4ef19d[_0x8026('0x16')],'exten':_0x4ef19d['exten'],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d[_0x8026('0xf')]+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});}}if(_0x4ef19d[_0x8026('0x25')]('answer')){if(_0x4520a1[_0x8026('0x37')](_0x4ef19d[_0x8026('0x38')]['toLowerCase']())>=0x0&&_0x4ef19d[_0x8026('0x39')]!==_0x8026('0x3a')){if(_0x4ef19d['answer']){_0x595863[_0x8026('0x11')]({'type':_0x4ef19d[_0x8026('0x12')],'app':'ExecIf','appdata':_0x8026('0x3b'),'context':_0x4ef19d[_0x8026('0x16')],'exten':_0x4ef19d['exten'],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d[_0x8026('0xf')]+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});_0x595863[_0x8026('0x11')]({'type':_0x4ef19d['type'],'app':_0x8026('0x13'),'appdata':_0x8026('0x3c'),'context':_0x4ef19d[_0x8026('0x16')],'exten':_0x4ef19d[_0x8026('0x9')],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d[_0x8026('0xf')]+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});}else{_0x595863[_0x8026('0x11')]({'type':_0x4ef19d['type'],'app':_0x8026('0x1f'),'appdata':_0x8026('0x3d'),'context':_0x4ef19d['context'],'exten':_0x4ef19d[_0x8026('0x9')],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d[_0x8026('0xf')]+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});_0x595863[_0x8026('0x11')]({'type':_0x4ef19d['type'],'app':_0x8026('0x13'),'appdata':_0x8026('0x3e'),'context':_0x4ef19d['context'],'exten':_0x4ef19d[_0x8026('0x9')],'priority':_0xe721ef[_0x8026('0x33')]+_0xdd843d['priority']+_0xf7e724++,'VoiceExtensionId':_0x4ef19d[_0x8026('0x19')]});}}}for(var _0x55e5a7=0x0;_0x55e5a7<_0xe721ef['length'];_0x55e5a7+=0x1){var _0x59d0a2=_0xdd843d['priority']+_0xe721ef[_0x8026('0x33')];var _0x3ff9fe=_0x55e5a7===_0xe721ef[_0x8026('0x33')]-0x1?_0xdd843d['priority']+_0x595863[_0x8026('0x33')]+_0x3f95c2[_0x8026('0x33')]+0x2:_0xdd843d[_0x8026('0xf')]+_0x55e5a7+0x1;_0x595863[_0x8026('0x3f')](_0x55e5a7,0x0,{'type':_0x4ef19d[_0x8026('0x12')],'app':'GotoIfTime','appdata':_0xe721ef[_0x55e5a7]+'?'+_0x4ef19d[_0x8026('0x16')]+_0x8026('0x40')+_0x59d0a2+':'+_0x4ef19d[_0x8026('0x16')]+_0x8026('0x40')+_0x3ff9fe,'exten':_0x4ef19d[_0x8026('0x9')],'context':_0x4ef19d['context'],'priority':_0xdd843d[_0x8026('0xf')]+_0x55e5a7,'VoiceExtensionId':_0x553843[_0x15d814][0x0]['VoiceExtensionId']});}_0x4ef19d['priority']=_0x595863['length']?_[_0x8026('0x41')](_0x595863)[_0x8026('0xf')]+0x1:_0xdd843d[_0x8026('0xf')];_0xdd843d['priority']=(_0x3f95c2['length']?_['last'](_0x3f95c2)[_0x8026('0xf')]:_0x4ef19d[_0x8026('0xf')])+0x1;_0xdd843d[_0x8026('0x10')]=_[_0x8026('0x42')](_0xdd843d[_0x8026('0x10')],_0x595863,[_0x4ef19d],_0x3f95c2);}_0xdd843d[_0x8026('0x10')][_0x8026('0x11')]({'type':_0x553843[_0x15d814][0x0][_0x8026('0x12')],'app':_0x8026('0x43'),'exten':_0x553843[_0x15d814][0x0][_0x8026('0x9')],'context':_0x553843[_0x15d814][0x0]['context'],'priority':_0xdd843d[_0x8026('0xf')],'VoiceExtensionId':_0x553843[_0x15d814][0x0][_0x8026('0x19')]});_0x36f1f2[_0x8026('0x11')](_0x553843[_0x15d814][0x0][_0x8026('0x19')]);_0x28d225=_[_0x8026('0x42')](_0x28d225,_0xdd843d[_0x8026('0x10')]);}}return _0xb53400[_0x8026('0x44')](function(_0x2c9cc1){return _0xb53400[_0x8026('0x2')]['VoiceExtension'][_0x8026('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x36f1f2}},'transaction':_0x2c9cc1})[_0x8026('0x4')](function(_0x4a3148){return _0xb53400['models'][_0x8026('0x6')][_0x8026('0x46')](_[_0x8026('0x47')](_0x28d225,_0x8026('0xf')),{'transaction':_0x2c9cc1});});});})['catch'](function(_0x4a95c2){console['error'](_0x4a95c2);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xfcef=['destroy','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','intervals','models','VoiceExtension','IntervalId','then','exten','filter','groupBy','queue','hasOwnProperty','extensions','extension','find','type','Set','context','VoiceExtensionId','inbound','push','CDR(routeid)=','priority','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction'];(function(_0x374af3,_0x7ed8f1){var _0x1dc982=function(_0x530538){while(--_0x530538){_0x374af3['push'](_0x374af3['shift']());}};_0x1dc982(++_0x7ed8f1);}(_0xfcef,0xda));var _0xffce=function(_0x29ae48,_0x36e307){_0x29ae48=_0x29ae48-0x0;var _0x24cc76=_0xfcef[_0x29ae48];return _0x24cc76;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));function rewrite(_0x586b60,_0x25b7b8){var _0x386b89=this;return _0x586b60['models'][_0xffce('0x2')][_0xffce('0x3')]({'raw':!![]})['then'](function(_0x2f2fa0){_0x386b89[_0xffce('0x4')]=_0x2f2fa0;return _0x586b60[_0xffce('0x5')][_0xffce('0x6')][_0xffce('0x3')]({'where':{'IntervalId':_0x25b7b8[_0xffce('0x7')]},'raw':!![]});})[_0xffce('0x8')](function(_0x5d1313){return _0x586b60[_0xffce('0x5')][_0xffce('0x6')][_0xffce('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x5d1313,_0xffce('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xffce('0x8')](function(_0x59518e){var _0x823093=_[_0xffce('0xa')](_0x59518e,{'priority':'1'});var _0x4284ef=_[_0xffce('0xa')](_0x59518e,{'isApp':0x1});var _0xd45b9c=_[_0xffce('0xb')](_0x4284ef,_0xffce('0x9'));var _0x8b5c13=[_0xffce('0xc'),'playback'];var _0x291832=[];var _0x3b0ab6=[];for(var _0x427723 in _0xd45b9c){if(_0xd45b9c[_0xffce('0xd')](_0x427723)){_0x386b89['priority']=0x2;_0x386b89[_0xffce('0xe')]=[];_0x386b89[_0xffce('0xf')]=_[_0xffce('0x10')](_0x823093,{'exten':_0xd45b9c[_0x427723][0x0]['exten']});_0x386b89['extensions']['push']({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':util['format']('CDR(type)=%s',_0xd45b9c[_0x427723][0x0]['type']),'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89['priority']++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});if(_0xd45b9c[_0x427723][0x0][_0xffce('0x11')]===_0xffce('0x15')){_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x17')+_0xd45b9c[_0x427723][0x0]['VoiceExtensionId'],'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0]['exten'],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});}else if(_0xd45b9c[_0x427723][0x0]['type']===_0xffce('0x19')){if(_0x386b89[_0xffce('0xf')]){_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0]['type'],'app':_0xffce('0x12'),'appdata':_0xffce('0x1a')+(_0x386b89[_0xffce('0xf')][_0xffce('0x1b')]?_0xffce('0x1c')+_0x386b89['extension'][_0xffce('0x1b')]+'}':_0xffce('0x1d')),'context':_0xd45b9c[_0x427723][0x0]['context'],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});}_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x17')+_0xd45b9c[_0x427723][0x0]['VoiceExtensionId'],'context':_0xd45b9c[_0x427723][0x0]['context'],'exten':_0xd45b9c[_0x427723][0x0]['exten'],'priority':_0x386b89['priority']++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});var _0x2d186b=_0x386b89['priority']++;_0x386b89[_0xffce('0xe')]['push']({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x1e'),'appdata':_0xffce('0x1f')+(_0x2d186b+0x2)+'):Goto('+(_0x2d186b+0x1)+')','context':_0xd45b9c[_0x427723][0x0]['context'],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x2d186b,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});if(_0x386b89[_0xffce('0xf')]){_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0x386b89['extension']['cutdigits']?_0xffce('0x20')+_0x386b89[_0xffce('0xf')][_0xffce('0x1b')]+'}':_0xffce('0x21'),'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89['priority']++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});}_0x386b89['extensions'][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x22')+_0xd45b9c[_0x427723][0x0][_0xffce('0x14')],'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});if(_0x386b89[_0xffce('0xf')]&&_0x386b89['extension'][_0xffce('0xd')](_0xffce('0x23'))&&_0x386b89['extension'][_0xffce('0x23')]!==_0xffce('0x24')){_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0]['exten'],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x25')+_0x386b89[_0xffce('0xf')][_0xffce('0x23')]||_0xffce('0x26'),'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0]['VoiceExtensionId']});}}_0x386b89[_0xffce('0xe')]['push']({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x27'),'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0]['exten'],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x28'),'context':_0xd45b9c[_0x427723][0x0]['context'],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});_0x386b89[_0xffce('0xe')][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':'Set','appdata':_0xffce('0x29'),'context':_0xd45b9c[_0x427723][0x0][_0xffce('0x13')],'exten':_0xd45b9c[_0x427723][0x0][_0xffce('0x9')],'priority':_0x386b89[_0xffce('0x18')]++,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});for(var _0x32b798=0x0,_0x588f81=0x0;_0x32b798<_0xd45b9c[_0x427723][_0xffce('0x2a')];_0x32b798+=0x1,_0x588f81=0x0){var _0x19346a=_0xd45b9c[_0x427723][_0x32b798];if(_0x19346a[_0xffce('0x11')]){_0x19346a[_0xffce('0x11')]=_0x19346a['type']['toLowerCase']();}var _0xe367d4=[];var _0x3afdcc=[];delete _0x19346a['id'];delete _0x19346a[_0xffce('0x2b')];delete _0x19346a['updatedAt'];var _0x264b26=_0x19346a[_0xffce('0x2c')]!=='*,*,*,*'?[_0x19346a[_0xffce('0x2c')]]:_0x19346a['IntervalId']?_[_0xffce('0x2d')](_[_0xffce('0xa')](_0x386b89[_0xffce('0x4')],{'IntervalId':_0x19346a[_0xffce('0x7')]}),'interval'):[];if(_0x19346a['hasOwnProperty'](_0xffce('0x2e'))){if(_0x19346a[_0xffce('0x2e')]&&_0x19346a[_0xffce('0x2e')]!=='--'){_0xe367d4['push']({'type':_0x19346a[_0xffce('0x11')],'app':'Set','appdata':_0xffce('0x2f')+_0x19346a['tag'],'context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a[_0xffce('0x9')],'priority':_0x264b26[_0xffce('0x2a')]+_0x386b89[_0xffce('0x18')]+_0x588f81++,'VoiceExtensionId':_0x19346a[_0xffce('0x14')]});}}if(_0x19346a[_0xffce('0x11')]==='outbound'&&_0x19346a['hasOwnProperty'](_0xffce('0x30'))){if(_0x19346a[_0xffce('0x30')]){_0xe367d4[_0xffce('0x16')]({'type':_0x19346a[_0xffce('0x11')],'app':_0xffce('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x19346a[_0xffce('0x30')]+')','context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a['exten'],'priority':_0x264b26['length']+_0x386b89['priority']+_0x588f81++,'VoiceExtensionId':_0x19346a['VoiceExtensionId']});}else{_0xe367d4[_0xffce('0x16')]({'type':_0x19346a[_0xffce('0x11')],'app':'ExecIf','appdata':_0xffce('0x31'),'context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a[_0xffce('0x9')],'priority':_0x264b26[_0xffce('0x2a')]+_0x386b89[_0xffce('0x18')]+_0x588f81++,'VoiceExtensionId':_0x19346a[_0xffce('0x14')]});}}if(_0x19346a['hasOwnProperty'](_0xffce('0x32'))){if(_0x8b5c13[_0xffce('0x33')](_0x19346a[_0xffce('0x34')][_0xffce('0x35')]())>=0x0&&_0x19346a[_0xffce('0x36')]!==_0xffce('0x37')){if(_0x19346a[_0xffce('0x32')]){_0xe367d4[_0xffce('0x16')]({'type':_0x19346a[_0xffce('0x11')],'app':_0xffce('0x1e'),'appdata':_0xffce('0x38'),'context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a['exten'],'priority':_0x264b26[_0xffce('0x2a')]+_0x386b89['priority']+_0x588f81++,'VoiceExtensionId':_0x19346a[_0xffce('0x14')]});_0xe367d4[_0xffce('0x16')]({'type':_0x19346a[_0xffce('0x11')],'app':_0xffce('0x12'),'appdata':_0xffce('0x39'),'context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a[_0xffce('0x9')],'priority':_0x264b26['length']+_0x386b89['priority']+_0x588f81++,'VoiceExtensionId':_0x19346a['VoiceExtensionId']});}else{_0xe367d4[_0xffce('0x16')]({'type':_0x19346a['type'],'app':_0xffce('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a[_0xffce('0x9')],'priority':_0x264b26[_0xffce('0x2a')]+_0x386b89['priority']+_0x588f81++,'VoiceExtensionId':_0x19346a[_0xffce('0x14')]});_0xe367d4['push']({'type':_0x19346a[_0xffce('0x11')],'app':'Set','appdata':_0xffce('0x3a'),'context':_0x19346a[_0xffce('0x13')],'exten':_0x19346a[_0xffce('0x9')],'priority':_0x264b26[_0xffce('0x2a')]+_0x386b89[_0xffce('0x18')]+_0x588f81++,'VoiceExtensionId':_0x19346a['VoiceExtensionId']});}}}for(var _0x6ff28d=0x0;_0x6ff28d<_0x264b26['length'];_0x6ff28d+=0x1){var _0x128d50=_0x386b89['priority']+_0x264b26['length'];var _0x36b6ac=_0x6ff28d===_0x264b26[_0xffce('0x2a')]-0x1?_0x386b89[_0xffce('0x18')]+_0xe367d4[_0xffce('0x2a')]+_0x3afdcc[_0xffce('0x2a')]+0x2:_0x386b89[_0xffce('0x18')]+_0x6ff28d+0x1;_0xe367d4[_0xffce('0x3b')](_0x6ff28d,0x0,{'type':_0x19346a[_0xffce('0x11')],'app':_0xffce('0x3c'),'appdata':_0x264b26[_0x6ff28d]+'?'+_0x19346a[_0xffce('0x13')]+_0xffce('0x3d')+_0x128d50+':'+_0x19346a['context']+_0xffce('0x3d')+_0x36b6ac,'exten':_0x19346a[_0xffce('0x9')],'context':_0x19346a[_0xffce('0x13')],'priority':_0x386b89[_0xffce('0x18')]+_0x6ff28d,'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});}_0x19346a['priority']=_0xe367d4['length']?_[_0xffce('0x3e')](_0xe367d4)['priority']+0x1:_0x386b89[_0xffce('0x18')];_0x386b89['priority']=(_0x3afdcc[_0xffce('0x2a')]?_[_0xffce('0x3e')](_0x3afdcc)[_0xffce('0x18')]:_0x19346a[_0xffce('0x18')])+0x1;_0x386b89[_0xffce('0xe')]=_[_0xffce('0x3f')](_0x386b89[_0xffce('0xe')],_0xe367d4,[_0x19346a],_0x3afdcc);}_0x386b89['extensions'][_0xffce('0x16')]({'type':_0xd45b9c[_0x427723][0x0][_0xffce('0x11')],'app':_0xffce('0x40'),'exten':_0xd45b9c[_0x427723][0x0]['exten'],'context':_0xd45b9c[_0x427723][0x0]['context'],'priority':_0x386b89['priority'],'VoiceExtensionId':_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]});_0x291832[_0xffce('0x16')](_0xd45b9c[_0x427723][0x0][_0xffce('0x14')]);_0x3b0ab6=_[_0xffce('0x3f')](_0x3b0ab6,_0x386b89[_0xffce('0xe')]);}}return _0x586b60[_0xffce('0x41')](function(_0x3f12f6){return _0x586b60['models'][_0xffce('0x6')][_0xffce('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x291832}},'transaction':_0x3f12f6})[_0xffce('0x8')](function(_0x137260){return _0x586b60[_0xffce('0x5')][_0xffce('0x6')]['bulkCreate'](_[_0xffce('0x43')](_0x3b0ab6,_0xffce('0x18')),{'transaction':_0x3f12f6});});});})[_0xffce('0x44')](function(_0x2bf384){console[_0xffce('0x45')](_0x2bf384);});}exports[_0xffce('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e44dc1f..7834a4e 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 _0x1d0c=['info','CSV\x20import\x20process\x20stopped!','resolve','CmContact','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','stringify','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','split','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','into','deletedAt\x20IS\x20NULL','str','cm_hopper_final','select','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','onlyIfOpen','query','all','BlackLists','Campaign','always','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x1d0c,0xe8));var _0xc1d0=function(_0x2b6a01,_0x1bbbc5){_0x2b6a01=_0x2b6a01-0x0;var _0x58b638=_0x1d0c[_0x2b6a01];return _0x58b638;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xc1d0('0x0'));var fs=require('fs');var squel=require(_0xc1d0('0x1'));var Papa=require(_0xc1d0('0x2'));var Redis=require('ioredis');var db=require(_0xc1d0('0x3'))['db'];var config=require(_0xc1d0('0x4'));var logger=require(_0xc1d0('0x5'))('api');config[_0xc1d0('0x6')]=_[_0xc1d0('0x7')](config[_0xc1d0('0x6')],{'host':_0xc1d0('0x8'),'port':0x18eb});var socket=require(_0xc1d0('0x9'))(new Redis(config[_0xc1d0('0x6')]));require(_0xc1d0('0xa'))[_0xc1d0('0xb')](socket);try{if(!process['argv'][0x2]||process[_0xc1d0('0xc')][0x2]===_0xc1d0('0xd')||process['argv'][0x2]===_0xc1d0('0xe')){throw new Error(_0xc1d0('0xf'));}var FILEPATH=process[_0xc1d0('0xc')][0x2];if(!process[_0xc1d0('0xc')][0x3]||process['argv'][0x3]===_0xc1d0('0xd')||process[_0xc1d0('0xc')][0x3]===_0xc1d0('0xe')||!process[_0xc1d0('0xc')][0x4]||process['argv'][0x4]===_0xc1d0('0xd')||process[_0xc1d0('0xc')][0x4]===_0xc1d0('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0xc1d0('0xc')][0x3][_0xc1d0('0x10')](','),process[_0xc1d0('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xc1d0('0xd')||process[_0xc1d0('0xc')][0x5]===_0xc1d0('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xc1d0('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xc1d0('0xc')][0x6]!==_0xc1d0('0xd')&&process['argv'][0x6]!=='null'?process[_0xc1d0('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xc1d0('0xc')][0x7]!==_0xc1d0('0xd')&&process[_0xc1d0('0xc')][0x7]!=='null'?process[_0xc1d0('0xc')][0x7]:null;if(!process[_0xc1d0('0xc')][0x8]||process[_0xc1d0('0xc')][0x8]===_0xc1d0('0xd')||process[_0xc1d0('0xc')][0x8]===_0xc1d0('0xe')){throw new Error(_0xc1d0('0x11'));}var SOCKET_TIMESTAMP=process[_0xc1d0('0xc')][0x8];}catch(_0x3caacc){logger['error'](_0x3caacc);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(_0x1c5a9b,_0x8d4a1b,_0x461107,_0x429021){var _0x66a77={'message':_0x8d4a1b};_0x66a77[_0x1c5a9b]=!![];if(_0x461107){_0x66a77[_0xc1d0('0x12')]=_0x461107;}if(_0x429021){_0x66a77[_0xc1d0('0x13')]=_0x429021;}return _0x66a77;}function isEmail(_0x335d23){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))*$/[_0xc1d0('0x14')](_0x335d23);}function checkRow(_0xfd07f1,_0xc8ca3c,_0x377d99){return new BPromise(function(_0x18e4d7,_0x2fba78){if(_[_0xc1d0('0x15')](_0xfd07f1)){return _0x2fba78(handleCheckRowError(_0xc1d0('0x16'),_0xc1d0('0x17'),null,_0x377d99));}if(_0xfd07f1[_0xc1d0('0x18')]&&_0xfd07f1[_0xc1d0('0x18')][_0xc1d0('0x19')]){var _0x21e0dd=_[_0xc1d0('0x1a')](_0xfd07f1['errors'],_0xc1d0('0x1b'))[_0xc1d0('0x1c')](';');return _0x2fba78(handleCheckRowError(_0xc1d0('0x16'),_0x21e0dd,null,_0x377d99));}var _0x33d280={};for(var _0x389966 in FIELDS){if(FIELDS['hasOwnProperty'](_0x389966)&&FIELDS[_0x389966]){_0x33d280[_0x389966]=_0xfd07f1[_0xc1d0('0x1d')][0x0][FIELDS[_0x389966]]||_0xfd07f1[_0xc1d0('0x1d')][0x0]['\ufeff'+FIELDS[_0x389966]];}}if(!_0x33d280[_0xc1d0('0x1e')]){return _0x2fba78(handleCheckRowError(_0xc1d0('0x16'),_0xc1d0('0x1f'),null,_0x377d99));}if(!_0x33d280[_0xc1d0('0x20')]){return _0x2fba78(handleCheckRowError('error',_0xc1d0('0x21'),null,_0x377d99));}if(_0x33d280['birthDate']){var _0x2d480b=moment(_0x33d280[_0xc1d0('0x22')],_0xc1d0('0x23'));if(!_0x2d480b[_0xc1d0('0x24')]()){return _0x2fba78(handleCheckRowError('error',_0xc1d0('0x25'),null,_0x377d99));}}if(_0x33d280[_0xc1d0('0x26')]){if(!isEmail(_0x33d280[_0xc1d0('0x26')])){return _0x2fba78(handleCheckRowError(_0xc1d0('0x16'),_0xc1d0('0x27'),null,_0x377d99));}}_0x33d280[_0xc1d0('0x28')]=LISTID;_0x33d280[_0xc1d0('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc1d0('0x19')]&&_0xc8ca3c){var _0x24787f={};for(var _0x23ff62=0x0,_0x571ddf=DUPLICATES[_0xc1d0('0x19')];_0x23ff62<_0x571ddf;_0x23ff62+=0x1){_0x24787f[DUPLICATES[_0x23ff62]]=_0x33d280[DUPLICATES[_0x23ff62]];}var _0x59a36d=_[_0xc1d0('0x2a')](_0xc8ca3c,_0x24787f);if(_0x59a36d){return _0x2fba78(handleCheckRowError('duplicate',_0xc1d0('0x2b'),_0x59a36d,_0x377d99));}}return db['CmContact'][_0xc1d0('0x2c')](_0x33d280,{'raw':!![],'hooks':![],'fields':_[_0xc1d0('0x2d')](_0x33d280)})[_0xc1d0('0x2e')](function(_0x4df7f9){if(DUPLICATES&&DUPLICATES[_0xc1d0('0x19')]&&_0xc8ca3c){_0xc8ca3c[_0xc1d0('0x2f')](_[_0xc1d0('0x30')](_0x33d280,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4df7f9['id'];return _0x18e4d7();})[_0xc1d0('0x31')](function(_0x288562){return _0x2fba78(handleCheckRowError(_0xc1d0('0x16'),_0xc1d0('0x32')+(_0x288562['message']||JSON['stringify'](_0x288562)),null,_0x377d99));});});}function checkHopper(){function _0x5af4b6(){return function(_0x1b4570){logger[_0xc1d0('0x16')](_0xc1d0('0x33'),_0xc1d0('0x34'),util[_0xc1d0('0x35')](_0x1b4570,{'showHidden':![],'depth':null}));};}var _0x3bd038=function(_0x26acec,_0x38a9ff){var _0x622b96=squel[_0xc1d0('0x36')]()['into'](_0xc1d0('0x37'))[_0xc1d0('0x38')](['phone',_0xc1d0('0x39'),_0xc1d0('0x3a'),'ListId',_0x38a9ff,_0xc1d0('0x3b'),_0xc1d0('0x3c')],squel['select']()[_0xc1d0('0x3d')]('phone',_0xc1d0('0x20'))[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x39'))['field']('id',_0xc1d0('0x3a'))[_0xc1d0('0x3d')](LISTID[_0xc1d0('0x3f')](),'ListId')['field'](_0x26acec['id']['toString'](),_0x38a9ff)[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x3b'))[_0xc1d0('0x3d')](_0xc1d0('0x3e'),'updatedAt')['from'](_0xc1d0('0x40'))[_0xc1d0('0x41')]('deletedAt\x20IS\x20NULL')[_0xc1d0('0x41')](_0xc1d0('0x42'),LISTID[_0xc1d0('0x3f')]())[_0xc1d0('0x41')](_0xc1d0('0x43'))[_0xc1d0('0x41')](_0xc1d0('0x44'),squel['select']()[_0xc1d0('0x3d')]('phone')[_0xc1d0('0x45')](_0xc1d0('0x37'))[_0xc1d0('0x41')](_0x38a9ff+_0xc1d0('0x46'),_0x26acec['id']['toString']())))[_0xc1d0('0x3f')]();return _0x622b96;};var _0xa02b7e=function(_0x4be310,_0x453bbe){var _0x3d97f3=squel['insert']()[_0xc1d0('0x47')](_0xc1d0('0x37'))[_0xc1d0('0x38')](['phone','scheduledAt',_0xc1d0('0x3a'),_0xc1d0('0x28'),_0x453bbe,'createdAt','updatedAt'],squel['select']()['field'](_0xc1d0('0x20'),'phone')[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x39'))['field']('id',_0xc1d0('0x3a'))[_0xc1d0('0x3d')](LISTID['toString'](),_0xc1d0('0x28'))[_0xc1d0('0x3d')](_0x4be310['id']['toString'](),_0x453bbe)[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x3b'))[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x3c'))[_0xc1d0('0x45')]('cm_contacts')[_0xc1d0('0x41')](_0xc1d0('0x48'))[_0xc1d0('0x41')](_0xc1d0('0x42'),LISTID[_0xc1d0('0x3f')]())[_0xc1d0('0x41')]('id\x20IN\x20?',squel[_0xc1d0('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xc1d0('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('calleridnum')[_0xc1d0('0x45')](_0xc1d0('0x4a'))[_0xc1d0('0x41')](_0x453bbe+_0xc1d0('0x46'),_0x4be310['id']['toString']()))[_0xc1d0('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc1d0('0x4b')]()['field'](_0xc1d0('0x20'))[_0xc1d0('0x45')](_0xc1d0('0x37'))[_0xc1d0('0x41')](_0x453bbe+_0xc1d0('0x46'),_0x4be310['id'][_0xc1d0('0x3f')]())))[_0xc1d0('0x3f')]();return _0x3d97f3;};function _0x2e0512(_0x220532,_0x39c337){var _0x559a7d=squel[_0xc1d0('0x36')]()[_0xc1d0('0x47')](_0xc1d0('0x37'))[_0xc1d0('0x38')]([_0xc1d0('0x20'),_0xc1d0('0x39'),_0xc1d0('0x3a'),_0xc1d0('0x28'),_0x39c337,_0xc1d0('0x3b'),_0xc1d0('0x3c')],squel['select']()[_0xc1d0('0x3d')]('phone','phone')[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x39'))[_0xc1d0('0x3d')]('id',_0xc1d0('0x3a'))['field'](LISTID[_0xc1d0('0x3f')](),_0xc1d0('0x28'))[_0xc1d0('0x3d')](_0x220532['id'][_0xc1d0('0x3f')](),_0x39c337)[_0xc1d0('0x3d')](_0xc1d0('0x3e'),_0xc1d0('0x3b'))['field'](_0xc1d0('0x3e'),_0xc1d0('0x3c'))[_0xc1d0('0x45')](_0xc1d0('0x40'))[_0xc1d0('0x41')](_0xc1d0('0x48'))[_0xc1d0('0x41')](_0xc1d0('0x42'),LISTID[_0xc1d0('0x3f')]())[_0xc1d0('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xc1d0('0x41')](_0xc1d0('0x43')))[_0xc1d0('0x3f')]();return _0x559a7d;}function _0x48d805(_0xc8e2e2,_0x268562){var _0x606861=squel[_0xc1d0('0x36')]()[_0xc1d0('0x47')](_0xc1d0('0x4c'))[_0xc1d0('0x38')]([_0xc1d0('0x20'),_0xc1d0('0x3a'),'ListId',_0x268562,_0xc1d0('0x3b'),_0xc1d0('0x3c')],squel[_0xc1d0('0x4b')]()[_0xc1d0('0x3d')](_0xc1d0('0x20'),'phone')[_0xc1d0('0x3d')]('id','ContactId')[_0xc1d0('0x3d')](LISTID[_0xc1d0('0x3f')](),_0xc1d0('0x28'))['field'](_0xc8e2e2['id'][_0xc1d0('0x3f')](),_0x268562)['field']('NOW()',_0xc1d0('0x3b'))[_0xc1d0('0x3d')](_0xc1d0('0x3e'),'updatedAt')[_0xc1d0('0x45')](_0xc1d0('0x40'))[_0xc1d0('0x41')](_0xc1d0('0x48'))['where'](_0xc1d0('0x42'),LISTID[_0xc1d0('0x3f')]())[_0xc1d0('0x41')](_0xc1d0('0x4d'),squel[_0xc1d0('0x49')](hopperContacts))[_0xc1d0('0x41')](_0xc1d0('0x43')))[_0xc1d0('0x3f')]();return _0x606861;}return db[_0xc1d0('0x4e')][_0xc1d0('0x4f')]({'where':{'type':_0xc1d0('0x50')},'attributes':['id',_0xc1d0('0x51')],'include':[{'model':db[_0xc1d0('0x52')],'as':_0xc1d0('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x5bec9a){var _0x414fa9=[];if(_0x5bec9a){var _0x44a96a;for(var _0x4d6be7=0x0,_0x451fca;_0x4d6be7<_0x5bec9a['length'];_0x4d6be7+=0x1){_0x451fca=_0x5bec9a[_0x4d6be7][_0xc1d0('0x54')]({'plain':!![]});switch(_0x451fca[_0xc1d0('0x51')]){case'always':_0x414fa9[_0xc1d0('0x2f')](db[_0xc1d0('0x55')]['query'](_0xa02b7e(_0x451fca,'VoiceQueueId'))[_0xc1d0('0x2e')](function(){})['catch'](_0x5af4b6()));break;case _0xc1d0('0x56'):_0x414fa9[_0xc1d0('0x2f')](db['sequelize'][_0xc1d0('0x57')](_0x3bd038(_0x451fca,'VoiceQueueId'))[_0xc1d0('0x2e')](function(){})[_0xc1d0('0x31')](_0x5af4b6()));break;default:_0x414fa9[_0xc1d0('0x2f')](db[_0xc1d0('0x55')]['query'](_0x2e0512(_0x451fca,'VoiceQueueId'))[_0xc1d0('0x2e')](function(){})['catch'](_0x5af4b6()));}}}return _0x414fa9;})[_0xc1d0('0x58')]()[_0xc1d0('0x2e')](function(){return db[_0xc1d0('0x4e')][_0xc1d0('0x4f')]({'where':{'type':_0xc1d0('0x50')},'attributes':['id'],'include':[{'model':db[_0xc1d0('0x52')],'as':_0xc1d0('0x59'),'where':{'id':LISTID}}]})[_0xc1d0('0x2e')](function(_0x92d95b){var _0x5bd5b4=[];if(_0x92d95b){var _0x5bdbac;for(var _0x1e4e34=0x0,_0x29c301;_0x1e4e34<_0x92d95b[_0xc1d0('0x19')];_0x1e4e34+=0x1){_0x29c301=_0x92d95b[_0x1e4e34][_0xc1d0('0x54')]({'plain':!![]});_0x5bd5b4['push'](db[_0xc1d0('0x55')][_0xc1d0('0x57')](_0x48d805(_0x29c301,'VoiceQueueId'))[_0xc1d0('0x2e')](function(){})[_0xc1d0('0x31')](_0x5af4b6()));}}return _0x5bd5b4;})[_0xc1d0('0x58')]();})[_0xc1d0('0x2e')](function(){return db[_0xc1d0('0x5a')][_0xc1d0('0x4f')]({'attributes':['id',_0xc1d0('0x51')],'include':[{'model':db[_0xc1d0('0x52')],'as':_0xc1d0('0x53'),'where':{'id':LISTID}}]})[_0xc1d0('0x2e')](function(_0x55af9a){var _0x27629e=[];if(_0x55af9a){for(var _0x5d4230=0x0,_0x4f79c5;_0x5d4230<_0x55af9a[_0xc1d0('0x19')];_0x5d4230+=0x1){_0x4f79c5=_0x55af9a[_0x5d4230][_0xc1d0('0x54')]({'plain':!![]});switch(_0x4f79c5[_0xc1d0('0x51')]){case _0xc1d0('0x5b'):_0x27629e[_0xc1d0('0x2f')](db['sequelize'][_0xc1d0('0x57')](_0xa02b7e(_0x4f79c5,_0xc1d0('0x5c')))[_0xc1d0('0x2e')](function(){})['catch'](_0x5af4b6()));break;case _0xc1d0('0x56'):_0x27629e['push'](db[_0xc1d0('0x55')]['query'](_0x3bd038(_0x4f79c5,_0xc1d0('0x5c')))[_0xc1d0('0x2e')](function(){})[_0xc1d0('0x31')](_0x5af4b6()));break;default:_0x27629e[_0xc1d0('0x2f')](db['sequelize'][_0xc1d0('0x57')](_0x2e0512(_0x4f79c5,'CampaignId'))[_0xc1d0('0x2e')](function(){})['catch'](_0x5af4b6()));}}}return _0x27629e;})[_0xc1d0('0x58')]();})[_0xc1d0('0x2e')](function(){return db[_0xc1d0('0x5a')][_0xc1d0('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xc1d0('0x52')],'as':_0xc1d0('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x1114d6){var _0x2219d2=[];if(_0x1114d6){for(var _0x4976dc=0x0,_0x5b806c;_0x4976dc<_0x1114d6[_0xc1d0('0x19')];_0x4976dc+=0x1){_0x5b806c=_0x1114d6[_0x4976dc]['get']({'plain':!![]});_0x2219d2[_0xc1d0('0x2f')](db[_0xc1d0('0x55')][_0xc1d0('0x57')](_0x48d805(_0x5b806c,_0xc1d0('0x5c')))['then'](function(){})[_0xc1d0('0x31')](_0x5af4b6()));}}return _0x2219d2;})[_0xc1d0('0x58')]();})[_0xc1d0('0x31')](function(_0x4f636d){logger[_0xc1d0('0x16')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x4f636d[_0xc1d0('0x1b')]);});}var processPromises=function(_0x3767f8){return BPromise[_0xc1d0('0x58')](promises)['then'](function(_0x1b6f6d){})[_0xc1d0('0x31')](function(_0x159d7a){logger[_0xc1d0('0x16')](_0xc1d0('0x5d'),JSON['stringify'](_0x159d7a));})[_0xc1d0('0x5e')](function(){socket[_0xc1d0('0x5f')](_0xc1d0('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3767f8){return _0x3767f8[_0xc1d0('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xc1d0('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xc1d0('0x5f')](_0xc1d0('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc1d0('0x62')](FILEPATH);}catch(_0x371f9e){logger[_0xc1d0('0x16')](_0xc1d0('0x63'),JSON['stringify'](_0x371f9e));}finally{process[_0xc1d0('0x64')](0x0);}});};process['on']('SIGINT',function(){logger[_0xc1d0('0x65')](_0xc1d0('0x66'));endCsv();});function main(){return BPromise[_0xc1d0('0x67')]()[_0xc1d0('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc1d0('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc1d0('0x2e')](function(_0x19ec1f){var _0x14079f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc1d0('0x69')](_0x14079f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1855ba,_0x5bd6e0){total+=0x1;var _0x246328=total;promises[_0xc1d0('0x2f')](checkRow(_0x1855ba,_0x19ec1f,_0x246328)[_0xc1d0('0x2e')](function(){success+=0x1;})[_0xc1d0('0x31')](function(_0x530f54){if(_0x530f54['error']){errors+=0x1;delete _0x530f54[_0xc1d0('0x16')];}else if(_0x530f54[_0xc1d0('0x6a')]){duplicates+=0x1;delete _0x530f54[_0xc1d0('0x6a')];}rows[_0xc1d0('0x2f')](_0x530f54);}));if(total%0xc8===0x0){_0x5bd6e0[_0xc1d0('0x6b')]();return processPromises(_0x5bd6e0);}},'complete':function(){return processPromises()[_0xc1d0('0x2e')](function(){logger['info'](_0xc1d0('0x6c'));endCsv();});},'error':function(_0xcce8cc,_0x4bc14b){logger[_0xc1d0('0x65')](_0xc1d0('0x6d'),JSON[_0xc1d0('0x6e')](_0xcce8cc));endCsv();}});})[_0xc1d0('0x31')](function(_0x362d12){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc1d0('0x6e')](_0x362d12));});}main(); \ No newline at end of file +var _0xa810=['CampaignId','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','phone','NOW()','toString','updatedAt','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_black','cm_contacts','findAll','dialCheckDuplicateType','Lists','then','always','sequelize','query','onlyIfOpen','all','VoiceQueue','outbound','CmList','BlackLists','get','Campaign'];(function(_0x2ed876,_0x181166){var _0x5ef7af=function(_0x206dd7){while(--_0x206dd7){_0x2ed876['push'](_0x2ed876['shift']());}};_0x5ef7af(++_0x181166);}(_0xa810,0x1c9));var _0x0a81=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xa810[_0x5e2cb4];return _0x282902;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x0a81('0x0'));var fs=require('fs');var squel=require(_0x0a81('0x1'));var Papa=require(_0x0a81('0x2'));var Redis=require(_0x0a81('0x3'));var db=require(_0x0a81('0x4'))['db'];var config=require(_0x0a81('0x5'));var logger=require(_0x0a81('0x6'))(_0x0a81('0x7'));config[_0x0a81('0x8')]=_[_0x0a81('0x9')](config[_0x0a81('0x8')],{'host':_0x0a81('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a81('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x0a81('0xb')](socket);try{if(!process[_0x0a81('0xc')][0x2]||process['argv'][0x2]===_0x0a81('0xd')||process[_0x0a81('0xc')][0x2]===_0x0a81('0xe')){throw new Error(_0x0a81('0xf'));}var FILEPATH=process[_0x0a81('0xc')][0x2];if(!process[_0x0a81('0xc')][0x3]||process[_0x0a81('0xc')][0x3]===_0x0a81('0xd')||process[_0x0a81('0xc')][0x3]===_0x0a81('0xe')||!process[_0x0a81('0xc')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0x0a81('0xe')){throw new Error(_0x0a81('0x10'));}var FIELDS=_[_0x0a81('0x11')](process[_0x0a81('0xc')][0x3][_0x0a81('0x12')](','),process[_0x0a81('0xc')][0x4][_0x0a81('0x12')](','));if(!process[_0x0a81('0xc')][0x5]||process[_0x0a81('0xc')][0x5]===_0x0a81('0xd')||process[_0x0a81('0xc')][0x5]===_0x0a81('0xe')){throw new Error(_0x0a81('0x13'));}var LISTID=process[_0x0a81('0xc')][0x5];var COMPANYID=process[_0x0a81('0xc')][0x6]&&process[_0x0a81('0xc')][0x6]!==_0x0a81('0xd')&&process['argv'][0x6]!==_0x0a81('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a81('0xc')][0x7]&&process[_0x0a81('0xc')][0x7]!==_0x0a81('0xd')&&process[_0x0a81('0xc')][0x7]!==_0x0a81('0xe')?process[_0x0a81('0xc')][0x7]:null;if(!process[_0x0a81('0xc')][0x8]||process[_0x0a81('0xc')][0x8]==='undefined'||process[_0x0a81('0xc')][0x8]==='null'){throw new Error(_0x0a81('0x14'));}var SOCKET_TIMESTAMP=process[_0x0a81('0xc')][0x8];}catch(_0x5c81d9){logger['error'](_0x5c81d9);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(_0x3d9fc1,_0x27e2c2,_0x2a2f51,_0x59695c){var _0x2f4e46={'message':_0x27e2c2};_0x2f4e46[_0x3d9fc1]=!![];if(_0x2a2f51){_0x2f4e46['contact']=_0x2a2f51;}if(_0x59695c){_0x2f4e46['index']=_0x59695c;}return _0x2f4e46;}function isEmail(_0x19e311){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))*$/[_0x0a81('0x15')](_0x19e311);}function checkRow(_0x1cbf7c,_0x2e6e8c,_0x518414){return new BPromise(function(_0x133261,_0xa35e4f){if(_[_0x0a81('0x16')](_0x1cbf7c)){return _0xa35e4f(handleCheckRowError('error',_0x0a81('0x17'),null,_0x518414));}if(_0x1cbf7c[_0x0a81('0x18')]&&_0x1cbf7c[_0x0a81('0x18')][_0x0a81('0x19')]){var _0x1dccd6=_[_0x0a81('0x1a')](_0x1cbf7c[_0x0a81('0x18')],_0x0a81('0x1b'))[_0x0a81('0x1c')](';');return _0xa35e4f(handleCheckRowError(_0x0a81('0x1d'),_0x1dccd6,null,_0x518414));}var _0x3fed61={};for(var _0x885b99 in FIELDS){if(FIELDS[_0x0a81('0x1e')](_0x885b99)&&FIELDS[_0x885b99]){_0x3fed61[_0x885b99]=_0x1cbf7c[_0x0a81('0x1f')][0x0][FIELDS[_0x885b99]]||_0x1cbf7c['data'][0x0]['\ufeff'+FIELDS[_0x885b99]];}}if(!_0x3fed61[_0x0a81('0x20')]){return _0xa35e4f(handleCheckRowError(_0x0a81('0x1d'),_0x0a81('0x21'),null,_0x518414));}if(!_0x3fed61['phone']){return _0xa35e4f(handleCheckRowError(_0x0a81('0x1d'),_0x0a81('0x22'),null,_0x518414));}if(_0x3fed61[_0x0a81('0x23')]){var _0x5b8ddc=moment(_0x3fed61[_0x0a81('0x23')],'YYYY-MM-DD');if(!_0x5b8ddc['isValid']()){return _0xa35e4f(handleCheckRowError(_0x0a81('0x1d'),_0x0a81('0x24'),null,_0x518414));}}if(_0x3fed61[_0x0a81('0x25')]){if(!isEmail(_0x3fed61['email'])){return _0xa35e4f(handleCheckRowError(_0x0a81('0x1d'),_0x0a81('0x26'),null,_0x518414));}}_0x3fed61[_0x0a81('0x27')]=LISTID;_0x3fed61[_0x0a81('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2e6e8c){var _0x31f6c8={};for(var _0x3ef59e=0x0,_0x135a46=DUPLICATES[_0x0a81('0x19')];_0x3ef59e<_0x135a46;_0x3ef59e+=0x1){_0x31f6c8[DUPLICATES[_0x3ef59e]]=_0x3fed61[DUPLICATES[_0x3ef59e]];}var _0x301820=_[_0x0a81('0x29')](_0x2e6e8c,_0x31f6c8);if(_0x301820){return _0xa35e4f(handleCheckRowError(_0x0a81('0x2a'),_0x0a81('0x2b'),_0x301820,_0x518414));}}return db[_0x0a81('0x2c')][_0x0a81('0x2d')](_0x3fed61,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3fed61)})['then'](function(_0x4db30c){if(DUPLICATES&&DUPLICATES[_0x0a81('0x19')]&&_0x2e6e8c){_0x2e6e8c[_0x0a81('0x2e')](_['pick'](_0x3fed61,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4db30c['id'];return _0x133261();})[_0x0a81('0x2f')](function(_0x29236d){return _0xa35e4f(handleCheckRowError('error',_0x0a81('0x30')+(_0x29236d['message']||JSON[_0x0a81('0x31')](_0x29236d)),null,_0x518414));});});}function checkHopper(){function _0x2636a5(){return function(_0x2b728c){logger['error'](_0x0a81('0x32'),_0x0a81('0x33'),util[_0x0a81('0x34')](_0x2b728c,{'showHidden':![],'depth':null}));};}var _0x1032c9=function(_0x1b06aa,_0x37adb4){var _0x1dd45f=squel[_0x0a81('0x35')]()[_0x0a81('0x36')](_0x0a81('0x37'))[_0x0a81('0x38')](['phone',_0x0a81('0x39'),_0x0a81('0x3a'),_0x0a81('0x27'),_0x37adb4,_0x0a81('0x3b'),'updatedAt'],squel[_0x0a81('0x3c')]()[_0x0a81('0x3d')]('phone',_0x0a81('0x3e'))[_0x0a81('0x3d')](_0x0a81('0x3f'),_0x0a81('0x39'))['field']('id',_0x0a81('0x3a'))['field'](LISTID['toString'](),_0x0a81('0x27'))['field'](_0x1b06aa['id'][_0x0a81('0x40')](),_0x37adb4)[_0x0a81('0x3d')]('NOW()',_0x0a81('0x3b'))[_0x0a81('0x3d')]('NOW()',_0x0a81('0x41'))[_0x0a81('0x42')]('cm_contacts')['where'](_0x0a81('0x43'))[_0x0a81('0x44')](_0x0a81('0x45'),LISTID['toString']())[_0x0a81('0x44')](_0x0a81('0x46'))[_0x0a81('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a81('0x3d')]('phone')[_0x0a81('0x42')]('cm_hopper')[_0x0a81('0x44')](_0x37adb4+_0x0a81('0x47'),_0x1b06aa['id'][_0x0a81('0x40')]())))[_0x0a81('0x40')]();return _0x1dd45f;};var _0x54f7f9=function(_0x48afca,_0x42ce2b){var _0x4b8a99=squel[_0x0a81('0x35')]()['into'](_0x0a81('0x37'))[_0x0a81('0x38')]([_0x0a81('0x3e'),'scheduledAt',_0x0a81('0x3a'),_0x0a81('0x27'),_0x42ce2b,_0x0a81('0x3b'),_0x0a81('0x41')],squel[_0x0a81('0x3c')]()[_0x0a81('0x3d')](_0x0a81('0x3e'),'phone')['field'](_0x0a81('0x3f'),_0x0a81('0x39'))[_0x0a81('0x3d')]('id','ContactId')['field'](LISTID[_0x0a81('0x40')](),_0x0a81('0x27'))[_0x0a81('0x3d')](_0x48afca['id'][_0x0a81('0x40')](),_0x42ce2b)['field'](_0x0a81('0x3f'),'createdAt')[_0x0a81('0x3d')](_0x0a81('0x3f'),_0x0a81('0x41'))[_0x0a81('0x42')]('cm_contacts')[_0x0a81('0x44')](_0x0a81('0x43'))[_0x0a81('0x44')](_0x0a81('0x45'),LISTID[_0x0a81('0x40')]())[_0x0a81('0x44')](_0x0a81('0x48'),squel[_0x0a81('0x49')](hopperContacts))[_0x0a81('0x44')](_0x0a81('0x46'))[_0x0a81('0x44')](_0x0a81('0x4a'),squel[_0x0a81('0x3c')]()[_0x0a81('0x3d')](_0x0a81('0x4b'))[_0x0a81('0x42')]('cm_hopper_final')[_0x0a81('0x44')](_0x42ce2b+'\x20=\x20?',_0x48afca['id'][_0x0a81('0x40')]()))[_0x0a81('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a81('0x3c')]()['field'](_0x0a81('0x3e'))[_0x0a81('0x42')](_0x0a81('0x37'))[_0x0a81('0x44')](_0x42ce2b+_0x0a81('0x47'),_0x48afca['id'][_0x0a81('0x40')]())))[_0x0a81('0x40')]();return _0x4b8a99;};function _0x2c11d9(_0x2f5d52,_0x20f939){var _0x1cb5ca=squel['insert']()[_0x0a81('0x36')](_0x0a81('0x37'))[_0x0a81('0x38')]([_0x0a81('0x3e'),'scheduledAt',_0x0a81('0x3a'),'ListId',_0x20f939,'createdAt',_0x0a81('0x41')],squel[_0x0a81('0x3c')]()[_0x0a81('0x3d')]('phone',_0x0a81('0x3e'))[_0x0a81('0x3d')]('NOW()',_0x0a81('0x39'))[_0x0a81('0x3d')]('id',_0x0a81('0x3a'))[_0x0a81('0x3d')](LISTID['toString'](),'ListId')[_0x0a81('0x3d')](_0x2f5d52['id'][_0x0a81('0x40')](),_0x20f939)[_0x0a81('0x3d')](_0x0a81('0x3f'),_0x0a81('0x3b'))['field'](_0x0a81('0x3f'),_0x0a81('0x41'))[_0x0a81('0x42')]('cm_contacts')[_0x0a81('0x44')](_0x0a81('0x43'))['where']('ListId\x20=\x20?',LISTID[_0x0a81('0x40')]())[_0x0a81('0x44')]('id\x20IN\x20?',squel[_0x0a81('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0a81('0x40')]();return _0x1cb5ca;}function _0x532070(_0x479990,_0x145de9){var _0x1ddb6b=squel[_0x0a81('0x35')]()[_0x0a81('0x36')](_0x0a81('0x4c'))[_0x0a81('0x38')]([_0x0a81('0x3e'),_0x0a81('0x3a'),_0x0a81('0x27'),_0x145de9,_0x0a81('0x3b'),_0x0a81('0x41')],squel[_0x0a81('0x3c')]()[_0x0a81('0x3d')]('phone',_0x0a81('0x3e'))[_0x0a81('0x3d')]('id','ContactId')[_0x0a81('0x3d')](LISTID[_0x0a81('0x40')](),'ListId')['field'](_0x479990['id']['toString'](),_0x145de9)['field'](_0x0a81('0x3f'),_0x0a81('0x3b'))['field']('NOW()','updatedAt')[_0x0a81('0x42')](_0x0a81('0x4d'))[_0x0a81('0x44')]('deletedAt\x20IS\x20NULL')[_0x0a81('0x44')](_0x0a81('0x45'),LISTID[_0x0a81('0x40')]())['where'](_0x0a81('0x48'),squel[_0x0a81('0x49')](hopperContacts))[_0x0a81('0x44')](_0x0a81('0x46')))[_0x0a81('0x40')]();return _0x1ddb6b;}return db['VoiceQueue'][_0x0a81('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0x0a81('0x4f')],'include':[{'model':db['CmList'],'as':_0x0a81('0x50'),'where':{'id':LISTID}}]})[_0x0a81('0x51')](function(_0x3938c3){var _0x285829=[];if(_0x3938c3){var _0x27b498;for(var _0x4d7fdb=0x0,_0x43c555;_0x4d7fdb<_0x3938c3[_0x0a81('0x19')];_0x4d7fdb+=0x1){_0x43c555=_0x3938c3[_0x4d7fdb]['get']({'plain':!![]});switch(_0x43c555['dialCheckDuplicateType']){case _0x0a81('0x52'):_0x285829[_0x0a81('0x2e')](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x54f7f9(_0x43c555,'VoiceQueueId'))[_0x0a81('0x51')](function(){})[_0x0a81('0x2f')](_0x2636a5()));break;case _0x0a81('0x55'):_0x285829['push'](db[_0x0a81('0x53')]['query'](_0x1032c9(_0x43c555,'VoiceQueueId'))['then'](function(){})[_0x0a81('0x2f')](_0x2636a5()));break;default:_0x285829[_0x0a81('0x2e')](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x2c11d9(_0x43c555,'VoiceQueueId'))['then'](function(){})[_0x0a81('0x2f')](_0x2636a5()));}}}return _0x285829;})[_0x0a81('0x56')]()[_0x0a81('0x51')](function(){return db[_0x0a81('0x57')][_0x0a81('0x4e')]({'where':{'type':_0x0a81('0x58')},'attributes':['id'],'include':[{'model':db[_0x0a81('0x59')],'as':_0x0a81('0x5a'),'where':{'id':LISTID}}]})[_0x0a81('0x51')](function(_0x115e71){var _0x59038e=[];if(_0x115e71){var _0x4f17e7;for(var _0x43e26d=0x0,_0x350409;_0x43e26d<_0x115e71[_0x0a81('0x19')];_0x43e26d+=0x1){_0x350409=_0x115e71[_0x43e26d][_0x0a81('0x5b')]({'plain':!![]});_0x59038e['push'](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x532070(_0x350409,'VoiceQueueId'))[_0x0a81('0x51')](function(){})[_0x0a81('0x2f')](_0x2636a5()));}}return _0x59038e;})['all']();})[_0x0a81('0x51')](function(){return db[_0x0a81('0x5c')][_0x0a81('0x4e')]({'attributes':['id',_0x0a81('0x4f')],'include':[{'model':db[_0x0a81('0x59')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a81('0x51')](function(_0x4dafb3){var _0x1f9981=[];if(_0x4dafb3){for(var _0x1076c8=0x0,_0xec1bc9;_0x1076c8<_0x4dafb3[_0x0a81('0x19')];_0x1076c8+=0x1){_0xec1bc9=_0x4dafb3[_0x1076c8][_0x0a81('0x5b')]({'plain':!![]});switch(_0xec1bc9['dialCheckDuplicateType']){case _0x0a81('0x52'):_0x1f9981[_0x0a81('0x2e')](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x54f7f9(_0xec1bc9,_0x0a81('0x5d')))[_0x0a81('0x51')](function(){})['catch'](_0x2636a5()));break;case'onlyIfOpen':_0x1f9981[_0x0a81('0x2e')](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x1032c9(_0xec1bc9,'CampaignId'))[_0x0a81('0x51')](function(){})['catch'](_0x2636a5()));break;default:_0x1f9981['push'](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x2c11d9(_0xec1bc9,'CampaignId'))[_0x0a81('0x51')](function(){})[_0x0a81('0x2f')](_0x2636a5()));}}}return _0x1f9981;})['all']();})['then'](function(){return db['Campaign'][_0x0a81('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x0a81('0x59')],'as':_0x0a81('0x5a'),'where':{'id':LISTID}}]})[_0x0a81('0x51')](function(_0x5b3702){var _0x1a6c6b=[];if(_0x5b3702){for(var _0x1a508e=0x0,_0x146a76;_0x1a508e<_0x5b3702[_0x0a81('0x19')];_0x1a508e+=0x1){_0x146a76=_0x5b3702[_0x1a508e][_0x0a81('0x5b')]({'plain':!![]});_0x1a6c6b[_0x0a81('0x2e')](db[_0x0a81('0x53')][_0x0a81('0x54')](_0x532070(_0x146a76,_0x0a81('0x5d')))[_0x0a81('0x51')](function(){})[_0x0a81('0x2f')](_0x2636a5()));}}return _0x1a6c6b;})[_0x0a81('0x56')]();})[_0x0a81('0x2f')](function(_0x196c3b){logger[_0x0a81('0x1d')]('cmContact,\x20%s,\x20%s',_0x0a81('0x5e'),_0x196c3b[_0x0a81('0x1b')]);});}var processPromises=function(_0x4d31ef){return BPromise[_0x0a81('0x56')](promises)[_0x0a81('0x51')](function(_0x40e897){})['catch'](function(_0x18e7c8){logger[_0x0a81('0x1d')]('Error\x20processing\x20rows\x20block:',JSON[_0x0a81('0x31')](_0x18e7c8));})[_0x0a81('0x5f')](function(){socket[_0x0a81('0x60')](_0x0a81('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4d31ef){return _0x4d31ef[_0x0a81('0x62')]();}});};var endCsv=function(){return BPromise[_0x0a81('0x63')]()[_0x0a81('0x51')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x0a81('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a81('0x64')](FILEPATH);}catch(_0x535737){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a81('0x31')](_0x535737));}finally{process[_0x0a81('0x65')](0x0);}});};process['on'](_0x0a81('0x66'),function(){logger[_0x0a81('0x67')](_0x0a81('0x68'));endCsv();});function main(){return BPromise[_0x0a81('0x63')]()[_0x0a81('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a81('0x12')](',');return db[_0x0a81('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x26d2d0){var _0x1f21a4=fs[_0x0a81('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x1f21a4,{'header':!![],'skipEmptyLines':!![],'step':function(_0x10a7a9,_0x4a5a58){total+=0x1;var _0xbbcaef=total;promises['push'](checkRow(_0x10a7a9,_0x26d2d0,_0xbbcaef)[_0x0a81('0x51')](function(){success+=0x1;})[_0x0a81('0x2f')](function(_0x3e15f8){if(_0x3e15f8[_0x0a81('0x1d')]){errors+=0x1;delete _0x3e15f8[_0x0a81('0x1d')];}else if(_0x3e15f8['duplicate']){duplicates+=0x1;delete _0x3e15f8[_0x0a81('0x2a')];}rows[_0x0a81('0x2e')](_0x3e15f8);}));if(total%0xc8===0x0){_0x4a5a58[_0x0a81('0x6a')]();return processPromises(_0x4a5a58);}},'complete':function(){return processPromises()[_0x0a81('0x51')](function(){logger['info'](_0x0a81('0x6b'));endCsv();});},'error':function(_0x5daad9,_0x44e21a){logger[_0x0a81('0x67')](_0x0a81('0x6c'),JSON[_0x0a81('0x31')](_0x5daad9));endCsv();}});})[_0x0a81('0x2f')](function(_0x56d67f){logger['error'](_0x0a81('0x6d'),JSON['stringify'](_0x56d67f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 87b966b..1e55deb 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 _0x9653=['insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','cm_contacts.ListId\x20=\x20','.CmListId','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','push','code','message','sequelize','query','spread','catch','error','main','start','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','data','length','rows','errors','hasOwnProperty','trim','replace','scheduledat','isValid','isNaN','isNumber','includes','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','where','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId'];(function(_0x58322a,_0x2c5e39){var _0x2e4a0c=function(_0xbf77d5){while(--_0xbf77d5){_0x58322a['push'](_0x58322a['shift']());}};_0x2e4a0c(++_0x2c5e39);}(_0x9653,0x17d));var _0x3965=function(_0x2b4d7f,_0x45f7aa){_0x2b4d7f=_0x2b4d7f-0x0;var _0x3fceaa=_0x9653[_0x2b4d7f];return _0x3fceaa;};'use strict';var fs=require('fs');var path=require(_0x3965('0x0'));var _=require(_0x3965('0x1'));var Papa=require(_0x3965('0x2'));var util=require(_0x3965('0x3'));var BPromise=require(_0x3965('0x4'));var moment=require(_0x3965('0x5'));var squel=require('squel');var Redis=require(_0x3965('0x6'));var db=require(_0x3965('0x7'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config['redis']=_[_0x3965('0x8')](config[_0x3965('0x9')],{'host':_0x3965('0xa'),'port':0x18eb});var socket=require(_0x3965('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3965('0xc')](_0x3965('0xd'));function isEmail(_0x5a9149){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x5a9149);}function selectNotIn(_0x3aaeab,_0x34739e,_0x5379f7,_0x91da,_0x1563bf){return squel['select']()[_0x3965('0xe')](_0x3965('0xf'))[_0x3965('0x10')](_0x91da)[_0x3965('0x11')](_0x34739e,null,_0x34739e+_0x3965('0x12')+_0x91da+'.'+_0x5379f7)[_0x3965('0x13')](_0x91da+'.'+_0x5379f7+'\x20=\x20'+_0x3aaeab+'.'+_0x5379f7)[_0x3965('0x13')](_0x34739e+'.dialCheckDuplicateType\x20IN\x20('+_0x1563bf[_0x3965('0x11')]()+')');}function insertCmHopper(_0x1cb943,_0x96bc,_0x476c2d,_0x338826,_0x34a9ed){var _0x1e5b45=['cm_contacts.phone',_0x3965('0x14'),_0x3965('0x15'),_0x3965('0x16'),_0x96bc+'.'+_0x338826,_0x3965('0x17'),_0x3965('0x18'),_0x3965('0x19'),_0x3965('0x1a'),'\x22'+_0x34a9ed+'\x22'];return squel[_0x3965('0x1b')]()[_0x3965('0x1c')]('cm_hopper')[_0x3965('0x1d')]([_0x3965('0xf'),'scheduledat',_0x3965('0x1e'),_0x3965('0x1f'),_0x338826,_0x3965('0x20'),_0x3965('0x21'),_0x3965('0x22'),_0x3965('0x23'),_0x3965('0x24')],squel[_0x3965('0x25')]()[_0x3965('0x26')](_0x1e5b45)[_0x3965('0x10')](_0x96bc)[_0x3965('0x11')](_0x3965('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x96bc+'.CmListId')['join'](_0x476c2d,null,_0x476c2d+_0x3965('0x12')+_0x96bc+'.'+_0x338826)[_0x3965('0x13')](_0x96bc+_0x3965('0x28'),_0x1cb943)[_0x3965('0x13')](_0x3965('0x29'),NOW)[_0x3965('0x13')](_0x3965('0x2a'),selectNotIn(_0x96bc,_0x476c2d,_0x338826,_0x3965('0x2b'),['\x22always\x22',_0x3965('0x2c')]))[_0x3965('0x13')](_0x3965('0x2a'),selectNotIn(_0x96bc,_0x476c2d,_0x338826,'cm_hopper',[_0x3965('0x2d')])))[_0x3965('0x2e')]();}function insertCmHopperBlack(_0x3d0d6d,_0x3bd08b,_0x542a09,_0x42eb2f){var _0x4dc850=[_0x3965('0x2f'),'cm_contacts.id','cm_contacts.ListId',_0x3bd08b+'.'+_0x42eb2f,_0x3965('0x17'),'cm_contacts.updatedAt'];return squel['insert']()[_0x3965('0x1c')]('cm_hopper_black')[_0x3965('0x1d')]([_0x3965('0xf'),_0x3965('0x1e'),'ListId',_0x42eb2f,_0x3965('0x20'),_0x3965('0x21')],squel[_0x3965('0x25')]()[_0x3965('0x26')](_0x4dc850)['from'](_0x3bd08b)[_0x3965('0x11')]('cm_contacts',null,_0x3965('0x30')+_0x3bd08b+_0x3965('0x31'))[_0x3965('0x11')](_0x542a09,null,_0x542a09+'.id\x20=\x20'+_0x3bd08b+'.'+_0x42eb2f)['where'](_0x3bd08b+'.CmListId\x20=\x20?',_0x3d0d6d)[_0x3965('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3965('0x13')](_0x3965('0x2a'),squel['select']()['field'](_0x3965('0xf'))['from'](_0x3965('0x32'))[_0x3965('0x13')](_0x3965('0x33'),_0x3d0d6d)[_0x3965('0x13')](_0x42eb2f+_0x3965('0x34'),_0x3bd08b+'.'+_0x42eb2f)))[_0x3965('0x2e')]();}function insertCmContact(_0x30b4ab,_0xfcddf3,_0x7c4ea7,_0x45ea3c){var _0x507c99=_[_0x3965('0x35')](_[_0x3965('0x36')](_0x45ea3c),[_0x3965('0x1f'),_0x3965('0x37'),_0x3965('0x20'),_0x3965('0x21')]);return squel['insert']()[_0x3965('0x1c')]('cm_contacts')[_0x3965('0x1d')](_0x507c99,squel['select']()[_0x3965('0x26')](_0x507c99)[_0x3965('0x10')](_0xfcddf3)[_0x3965('0x13')]('('+_0x7c4ea7[_0x3965('0x11')](',')+_0x3965('0x38'),squel[_0x3965('0x25')]()['fields'](_0x7c4ea7)[_0x3965('0x10')](_0x3965('0x27'))[_0x3965('0x13')](_0x3965('0x33'),_0x30b4ab)[_0x3965('0x13')](_0x3965('0x39')))['where'](_0x3965('0x3a'),squel[_0x3965('0x25')]()[_0x3965('0xe')](_0x3965('0x3b'),_0x3965('0x3c'))[_0x3965('0x10')](_0xfcddf3)['group'](_0x7c4ea7[_0x3965('0x11')](','))))[_0x3965('0x2e')]();}function handleStop(){logger[_0x3965('0x3d')](_0x3965('0x3e'));stopped=!![];}function handleUncaughtException(_0x57931f){logger['error'](_0x57931f['message']);process[_0x3965('0x3f')](0x1);}function handleError(_0x62bfd,_0x599bc2){stats['errors'][_0x3965('0x40')]({'name':_0x599bc2[_0x3965('0x41')],'message':_0x599bc2[_0x3965('0x42')],'row':_0x62bfd});}function handleQuery(_0x4b04aa){logger['info'](_0x4b04aa);return db[_0x3965('0x43')][_0x3965('0x44')](_0x4b04aa)[_0x3965('0x45')](function(_0x27b086){results['push'](_0x27b086);})[_0x3965('0x46')](function(_0x2f188f){logger[_0x3965('0x47')](_0x2f188f[_0x3965('0x42')]);});}function main(_0x4b6be8,_0x24eb3c,_0x1909df,_0x4d487f){logger[_0x3965('0x3d')](_0x3965('0x48'),_0x4b6be8,JSON['stringify'](_0x24eb3c));process['send'](_0x3965('0x49'));var _0x4c9f72=_0x24eb3c['binding'];var _0x4c156b=_0x24eb3c[_0x3965('0x4a')];var _0x1c50a3=path[_0x3965('0x11')](config[_0x3965('0x4b')],_0x3965('0x4c'),_0x4c156b+_0x3965('0x4d'));var _0x286673=_[_0x3965('0x36')](_0x4c9f72)['join']();logger[_0x3965('0x3d')](_0x3965('0x4e'),_0x286673);fs[_0x3965('0x4f')](_0x1c50a3,_0x286673+'\x0a');Papa[_0x3965('0x50')](fs['createReadStream'](_0x4b6be8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x14b257,_0x48e520){try{for(var _0x2bdc67=0x0,_0x3831e7=[];_0x2bdc67<_0x14b257[_0x3965('0x51')][_0x3965('0x52')];_0x2bdc67++){stats[_0x3965('0x53')]+=0x1;if(_0x14b257[_0x3965('0x54')][_0x2bdc67]){handleError(_0x14b257['data'][_0x2bdc67],_0x14b257[_0x3965('0x54')][_0x2bdc67]);}else{var _0x3846fc=[];for(var _0x2eec06 in _0x4c9f72){if(_0x4c9f72[_0x3965('0x55')](_0x2eec06)){if(_0x14b257[_0x3965('0x51')][_0x2bdc67][_0x4c9f72[_0x2eec06]]){var _0x2e328b=_[_0x3965('0x56')](_0x14b257['data'][_0x2bdc67][_0x4c9f72[_0x2eec06]][_0x3965('0x57')](/"/g,'\x27'));switch(_0x2eec06){case _0x3965('0x58'):var _0x4203df=moment(_0x2e328b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4203df[_0x3965('0x59')]()){_0x3831e7['push']('\x22'+_0x2e328b+'\x22');}else{_0x3846fc[_0x3965('0x40')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3965('0x22'):var _0x5d8452=parseInt(_0x2e328b);_0x2e328b=_[_0x3965('0x5a')](_0x5d8452)||_0x5d8452<0x0||_0x5d8452>0x4?_0x4d487f?0x3:0x2:_0x5d8452;_0x3831e7[_0x3965('0x40')]('\x22'+_0x2e328b+'\x22');break;case'UserId':var _0x19c976=parseInt(_0x2e328b);if(_[_0x3965('0x5b')](_0x19c976)&&_[_0x3965('0x5c')](_0x1909df,_0x19c976)){_0x3831e7[_0x3965('0x40')]('\x22'+_0x19c976+'\x22');}else{_0x3846fc['push']('agent\x20not\x20exists');}break;case _0x3965('0x5d'):if(isEmail(_0x2e328b)){_0x3831e7['push']('\x22'+_0x2e328b+'\x22');}else{_0x3846fc[_0x3965('0x40')](_0x3965('0x5e'));}break;case'dateOfBirth':var _0x92235=moment(_0x2e328b,_0x3965('0x5f'),!![]);if(_0x92235[_0x3965('0x59')]()){_0x3831e7[_0x3965('0x40')]('\x22'+_0x2e328b+'\x22');}else{_0x3846fc[_0x3965('0x40')](_0x3965('0x60'));}break;default:_0x3831e7[_0x3965('0x40')]('\x22'+_0x2e328b+'\x22');}}else{switch(_0x2eec06){case _0x3965('0x61'):case _0x3965('0xf'):_0x3846fc[_0x3965('0x40')](_0x2eec06+_0x3965('0x62'));break;default:_0x3831e7['push']('\x22\x22');}}}}if(_0x3846fc[_0x3965('0x52')]){handleError(_0x14b257[_0x3965('0x51')][_0x2bdc67],{'code':'SystemRow','message':_0x3846fc[_0x3965('0x11')]()});}else{fs[_0x3965('0x63')](_0x1c50a3,_0x3831e7[_0x3965('0x11')]()+'\x0a');}_0x3831e7=[];}if(!(stats[_0x3965('0x53')]%0xc8)){socket[_0x3965('0x64')](_0x3965('0x65')+_0x4c156b,stats);stats[_0x3965('0x54')]=[];}}if(stopped){logger[_0x3965('0x3d')](_0x3965('0x66'));_0x48e520[_0x3965('0x67')]();}}catch(_0x3ec53a){handleError(_0x14b257['data'][_0x2bdc67],{'code':_0x3965('0x68'),'message':_0x3ec53a[_0x3965('0x42')]});logger[_0x3965('0x47')](_0x3965('0x69'),_0x3ec53a[_0x3965('0x42')]);}},'complete':function(){try{var _0x4f48ce=[];var _0x37e067=_0x3965('0x27');if(_0x24eb3c[_0x3965('0x6a')]&&_0x24eb3c[_0x3965('0x6a')]['length']){_0x37e067=_0x3965('0x6b')+_0x4c156b;_0x4f48ce[_0x3965('0x40')](_0x3965('0x6c')+_0x37e067+_0x3965('0x6d'));}var _0x2c0179=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1c50a3,_0x37e067,_0x286673,_0x24eb3c[_0x3965('0x1f')],_0x24eb3c[_0x3965('0x37')]||null,NOW,NOW);if(_[_0x3965('0x6e')](_0x4c9f72[_0x3965('0x58')])){_0x2c0179+=',\x20scheduledAt\x20=\x20NOW()';}_0x4f48ce[_0x3965('0x40')](_0x2c0179);if(_0x24eb3c[_0x3965('0x6a')]&&_0x24eb3c['duplicates'][_0x3965('0x52')]){_0x4f48ce['push'](insertCmContact(_0x24eb3c['ListId'],_0x37e067,_0x24eb3c[_0x3965('0x6a')],_0x4c9f72));_0x4f48ce[_0x3965('0x40')](_0x3965('0x6f')+_0x37e067+';');}_0x4f48ce[_0x3965('0x40')](insertCmHopper(_0x24eb3c[_0x3965('0x1f')],_0x3965('0x70'),_0x3965('0x71'),_0x3965('0x72'),_0x4d487f));_0x4f48ce[_0x3965('0x40')](insertCmHopperBlack(_0x24eb3c[_0x3965('0x1f')],_0x3965('0x73'),_0x3965('0x71'),_0x3965('0x72')));_0x4f48ce[_0x3965('0x40')](insertCmHopper(_0x24eb3c['ListId'],_0x3965('0x74'),_0x3965('0x75'),'CampaignId',_0x4d487f));_0x4f48ce[_0x3965('0x40')](insertCmHopperBlack(_0x24eb3c['ListId'],_0x3965('0x76'),'campaigns',_0x3965('0x77')));BPromise[_0x3965('0x78')](_0x4f48ce,handleQuery)[_0x3965('0x79')](function(_0x3ebe80){stats['finish']=!![];stats[_0x3965('0x7a')]=_0x24eb3c[_0x3965('0x6a')]&&_0x24eb3c['duplicates'][_0x3965('0x52')]?results[0x2][_0x3965('0x7a')]:results[0x0][_0x3965('0x7a')];socket[_0x3965('0x64')]('contact:import:'+_0x4c156b,stats);fs[_0x3965('0x7b')](_0x4b6be8);fs[_0x3965('0x7b')](_0x1c50a3);process[_0x3965('0x3f')](0x0);})[_0x3965('0x46')](function(_0x6d580d){logger[_0x3965('0x47')](_0x6d580d[_0x3965('0x42')]);process[_0x3965('0x3f')](0x1);});}catch(_0x3f24f7){logger[_0x3965('0x47')](_0x3965('0x7c'),_0x3f24f7[_0x3965('0x42')]);process[_0x3965('0x3f')](0x1);}},'error':function(_0x3250f8,_0x3040c2,_0x21ca6f,_0x3b33c1){throw new Error(_0x3b33c1);}});}function validate(){if(process[_0x3965('0x7d')]&&process['argv']['length']<0x4){throw new Error(_0x3965('0x7e'));}var _0x237ebc=path[_0x3965('0x11')](config['root'],_0x3965('0x4c'),process[_0x3965('0x7d')][0x2]);if(!fs[_0x3965('0x7f')](_0x237ebc)){throw new Error(_0x3965('0x80'));}var _0x4fb7fc={};try{_0x4fb7fc=JSON[_0x3965('0x50')](process[_0x3965('0x7d')][0x3]);if(!_0x4fb7fc[_0x3965('0x81')]){throw new Error(_0x3965('0x82'));}if(!_0x4fb7fc[_0x3965('0x81')][_0x3965('0xf')]){throw new Error(_0x3965('0x83'));}if(!_0x4fb7fc[_0x3965('0x81')][_0x3965('0x61')]){throw new Error(_0x3965('0x84'));}var _0x1e84c7=0x0;if(_0x4fb7fc[_0x3965('0x81')][_0x3965('0x23')]){_0x1e84c7=0x1;}if(!_0x4fb7fc['ListId']){throw new Error(_0x3965('0x85'));}}catch(_0x6d8e35){throw new Error(_0x3965('0x86'));}var _0x42d287=[];try{_0x42d287=_[_0x3965('0x87')](JSON[_0x3965('0x50')](process[_0x3965('0x7d')][0x4]),'id');}catch(_0x4f2494){logger[_0x3965('0x3d')]('No\x20agent\x20available');}main(_0x237ebc,_0x4fb7fc,_0x42d287,_0x1e84c7);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xa0cd=['emit','contact:import:','Abort\x20parser','abort','step','duplicates','length','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','moment','squel','../../../mysqldb','../../../config/environment','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ContactId','ListId','createdAt','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_hopper','toString','cm_contacts.id','cm_contacts.updatedAt','updatedAt','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','CompanyId','fromQuery',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','push','sequelize','query','spread','catch','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','errors','data','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','agent\x20not\x20exists','dateOfBirth','firstName','SystemRow','appendFileSync','rows'];(function(_0xf06e54,_0x574f7c){var _0x12d08f=function(_0x3aff8e){while(--_0x3aff8e){_0xf06e54['push'](_0xf06e54['shift']());}};_0x12d08f(++_0x574f7c);}(_0xa0cd,0xa1));var _0xda0c=function(_0x132a0e,_0x3956fc){_0x132a0e=_0x132a0e-0x0;var _0x5bea3b=_0xa0cd[_0x132a0e];return _0x5bea3b;};'use strict';var fs=require('fs');var path=require(_0xda0c('0x0'));var _=require(_0xda0c('0x1'));var Papa=require('papaparse');var util=require(_0xda0c('0x2'));var BPromise=require('bluebird');var moment=require(_0xda0c('0x3'));var squel=require(_0xda0c('0x4'));var Redis=require('ioredis');var db=require(_0xda0c('0x5'))['db'];var config=require(_0xda0c('0x6'));var logger=require('../../../config/logger')(_0xda0c('0x7'));config['redis']=_['defaults'](config[_0xda0c('0x8')],{'host':_0xda0c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda0c('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xda0c('0xa')](_0xda0c('0xb'));function isEmail(_0x2ea747){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))*$/[_0xda0c('0xc')](_0x2ea747);}function selectNotIn(_0x30447e,_0x20cfdb,_0x14bfb3,_0x33ddc7,_0x4fb97d){return squel[_0xda0c('0xd')]()[_0xda0c('0xe')](_0xda0c('0xf'))[_0xda0c('0x10')](_0x33ddc7)[_0xda0c('0x11')](_0x20cfdb,null,_0x20cfdb+_0xda0c('0x12')+_0x33ddc7+'.'+_0x14bfb3)['where'](_0x33ddc7+'.'+_0x14bfb3+_0xda0c('0x13')+_0x30447e+'.'+_0x14bfb3)[_0xda0c('0x14')](_0x20cfdb+_0xda0c('0x15')+_0x4fb97d['join']()+')');}function insertCmHopper(_0x199efa,_0x4bf388,_0x2fa668,_0x1827d4,_0x1bfb06){var _0x34ae3f=[_0xda0c('0x16'),_0xda0c('0x17'),'cm_contacts.id',_0xda0c('0x18'),_0x4bf388+'.'+_0x1827d4,_0xda0c('0x19'),'cm_contacts.updatedAt',_0xda0c('0x1a'),_0xda0c('0x1b'),'\x22'+_0x1bfb06+'\x22'];return squel[_0xda0c('0x1c')]()[_0xda0c('0x1d')]('cm_hopper')['fromQuery']([_0xda0c('0xf'),_0xda0c('0x1e'),_0xda0c('0x1f'),_0xda0c('0x20'),_0x1827d4,_0xda0c('0x21'),'updatedAt','priority','UserId','recallme'],squel[_0xda0c('0xd')]()[_0xda0c('0x22')](_0x34ae3f)['from'](_0x4bf388)[_0xda0c('0x11')](_0xda0c('0x23'),null,_0xda0c('0x24')+_0x4bf388+'.CmListId')[_0xda0c('0x11')](_0x2fa668,null,_0x2fa668+_0xda0c('0x12')+_0x4bf388+'.'+_0x1827d4)[_0xda0c('0x14')](_0x4bf388+_0xda0c('0x25'),_0x199efa)[_0xda0c('0x14')](_0xda0c('0x26'),NOW)[_0xda0c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4bf388,_0x2fa668,_0x1827d4,'cm_hopper',[_0xda0c('0x27'),'\x22onlyIfOpen\x22']))[_0xda0c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4bf388,_0x2fa668,_0x1827d4,_0xda0c('0x28'),['\x22always\x22'])))[_0xda0c('0x29')]();}function insertCmHopperBlack(_0x3c2727,_0x532b47,_0x55c9df,_0x3b5ccd){var _0x1a0b22=[_0xda0c('0x16'),_0xda0c('0x2a'),_0xda0c('0x18'),_0x532b47+'.'+_0x3b5ccd,_0xda0c('0x19'),_0xda0c('0x2b')];return squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0xda0c('0xf'),'ContactId',_0xda0c('0x20'),_0x3b5ccd,_0xda0c('0x21'),_0xda0c('0x2c')],squel['select']()['fields'](_0x1a0b22)[_0xda0c('0x10')](_0x532b47)[_0xda0c('0x11')](_0xda0c('0x23'),null,_0xda0c('0x24')+_0x532b47+'.CmListId')[_0xda0c('0x11')](_0x55c9df,null,_0x55c9df+_0xda0c('0x12')+_0x532b47+'.'+_0x3b5ccd)[_0xda0c('0x14')](_0x532b47+_0xda0c('0x25'),_0x3c2727)[_0xda0c('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xda0c('0x2d'),squel[_0xda0c('0xd')]()['field'](_0xda0c('0xf'))['from'](_0xda0c('0x2e'))['where'](_0xda0c('0x2f'),_0x3c2727)[_0xda0c('0x14')](_0x3b5ccd+_0xda0c('0x30'),_0x532b47+'.'+_0x3b5ccd)))[_0xda0c('0x29')]();}function insertCmContact(_0x53daf8,_0x110eb8,_0x5ac72b,_0x48cb72){var _0xa9a176=_['concat'](_['keys'](_0x48cb72),[_0xda0c('0x20'),_0xda0c('0x31'),'createdAt',_0xda0c('0x2c')]);return squel[_0xda0c('0x1c')]()['into'](_0xda0c('0x23'))[_0xda0c('0x32')](_0xa9a176,squel[_0xda0c('0xd')]()[_0xda0c('0x22')](_0xa9a176)['from'](_0x110eb8)['where']('('+_0x5ac72b[_0xda0c('0x11')](',')+_0xda0c('0x33'),squel[_0xda0c('0xd')]()[_0xda0c('0x22')](_0x5ac72b)[_0xda0c('0x10')](_0xda0c('0x23'))[_0xda0c('0x14')](_0xda0c('0x2f'),_0x53daf8)[_0xda0c('0x14')](_0xda0c('0x34')))[_0xda0c('0x14')](_0xda0c('0x35'),squel[_0xda0c('0xd')]()['field']('MIN(id)',_0xda0c('0x36'))[_0xda0c('0x10')](_0x110eb8)[_0xda0c('0x37')](_0x5ac72b[_0xda0c('0x11')](','))))[_0xda0c('0x29')]();}function handleStop(){logger[_0xda0c('0x38')](_0xda0c('0x39'));stopped=!![];}function handleUncaughtException(_0x547e11){logger[_0xda0c('0x3a')](_0x547e11[_0xda0c('0x3b')]);process[_0xda0c('0x3c')](0x1);}function handleError(_0x38a18e,_0x294214){stats['errors'][_0xda0c('0x3d')]({'name':_0x294214['code'],'message':_0x294214[_0xda0c('0x3b')],'row':_0x38a18e});}function handleQuery(_0x5f0b47){logger['info'](_0x5f0b47);return db[_0xda0c('0x3e')][_0xda0c('0x3f')](_0x5f0b47)[_0xda0c('0x40')](function(_0x3582e4){results[_0xda0c('0x3d')](_0x3582e4);})[_0xda0c('0x41')](function(_0x3b8705){logger[_0xda0c('0x3a')](_0x3b8705['message']);});}function main(_0x1bc79c,_0x3ee030,_0x1c1064,_0x3271b6){logger[_0xda0c('0x38')](_0xda0c('0x42'),_0x1bc79c,JSON[_0xda0c('0x43')](_0x3ee030));process[_0xda0c('0x44')](_0xda0c('0x45'));var _0x5d35e6=_0x3ee030[_0xda0c('0x46')];var _0x16bae5=_0x3ee030[_0xda0c('0x47')];var _0x59963a=path[_0xda0c('0x11')](config[_0xda0c('0x48')],_0xda0c('0x49'),_0x16bae5+_0xda0c('0x4a'));var _0x4d2888=_[_0xda0c('0x4b')](_0x5d35e6)[_0xda0c('0x11')]();logger[_0xda0c('0x38')](_0xda0c('0x4c'),_0x4d2888);fs[_0xda0c('0x4d')](_0x59963a,_0x4d2888+'\x0a');Papa[_0xda0c('0x4e')](fs[_0xda0c('0x4f')](_0x1bc79c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x24072e,_0x330941){try{for(var _0x3cf394=0x0,_0x123898=[];_0x3cf394<_0x24072e['data']['length'];_0x3cf394++){stats['rows']+=0x1;if(_0x24072e[_0xda0c('0x50')][_0x3cf394]){handleError(_0x24072e[_0xda0c('0x51')][_0x3cf394],_0x24072e[_0xda0c('0x50')][_0x3cf394]);}else{var _0x2ce3a5=[];for(var _0x26cea7 in _0x5d35e6){if(_0x5d35e6['hasOwnProperty'](_0x26cea7)){if(_0x24072e[_0xda0c('0x51')][_0x3cf394][_0x5d35e6[_0x26cea7]]){var _0x105084=_[_0xda0c('0x52')](_0x24072e[_0xda0c('0x51')][_0x3cf394][_0x5d35e6[_0x26cea7]]['replace'](/"/g,'\x27'));switch(_0x26cea7){case'scheduledat':var _0x21705c=moment(_0x105084,_0xda0c('0xb'),!![]);if(_0x21705c[_0xda0c('0x53')]()){_0x123898[_0xda0c('0x3d')]('\x22'+_0x105084+'\x22');}else{_0x2ce3a5['push'](_0xda0c('0x54'));}break;case _0xda0c('0x55'):var _0x1c6f7c=parseInt(_0x105084);_0x105084=_[_0xda0c('0x56')](_0x1c6f7c)||_0x1c6f7c<0x0||_0x1c6f7c>0x4?_0x3271b6?0x3:0x2:_0x1c6f7c;_0x123898['push']('\x22'+_0x105084+'\x22');break;case _0xda0c('0x57'):var _0x265d48=parseInt(_0x105084);if(_[_0xda0c('0x58')](_0x265d48)&&_['includes'](_0x1c1064,_0x265d48)){_0x123898[_0xda0c('0x3d')]('\x22'+_0x265d48+'\x22');}else{_0x2ce3a5[_0xda0c('0x3d')](_0xda0c('0x59'));}break;case'email':if(isEmail(_0x105084)){_0x123898['push']('\x22'+_0x105084+'\x22');}else{_0x2ce3a5[_0xda0c('0x3d')]('email\x20wrong\x20format');}break;case _0xda0c('0x5a'):var _0xb776ab=moment(_0x105084,'YYYY-MM-DD',!![]);if(_0xb776ab[_0xda0c('0x53')]()){_0x123898['push']('\x22'+_0x105084+'\x22');}else{_0x2ce3a5['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x123898[_0xda0c('0x3d')]('\x22'+_0x105084+'\x22');}}else{switch(_0x26cea7){case _0xda0c('0x5b'):case _0xda0c('0xf'):_0x2ce3a5['push'](_0x26cea7+'\x20not\x20specified');break;default:_0x123898[_0xda0c('0x3d')]('\x22\x22');}}}}if(_0x2ce3a5['length']){handleError(_0x24072e[_0xda0c('0x51')][_0x3cf394],{'code':_0xda0c('0x5c'),'message':_0x2ce3a5[_0xda0c('0x11')]()});}else{fs[_0xda0c('0x5d')](_0x59963a,_0x123898[_0xda0c('0x11')]()+'\x0a');}_0x123898=[];}if(!(stats[_0xda0c('0x5e')]%0xc8)){socket[_0xda0c('0x5f')](_0xda0c('0x60')+_0x16bae5,stats);stats[_0xda0c('0x50')]=[];}}if(stopped){logger[_0xda0c('0x38')](_0xda0c('0x61'));_0x330941[_0xda0c('0x62')]();}}catch(_0x1e3ab5){handleError(_0x24072e[_0xda0c('0x51')][_0x3cf394],{'code':'SystemError','message':_0x1e3ab5[_0xda0c('0x3b')]});logger[_0xda0c('0x3a')](_0xda0c('0x63'),_0x1e3ab5[_0xda0c('0x3b')]);}},'complete':function(){try{var _0x1b1bb9=[];var _0x2ad925='cm_contacts';if(_0x3ee030[_0xda0c('0x64')]&&_0x3ee030[_0xda0c('0x64')][_0xda0c('0x65')]){_0x2ad925='cm_contacts_'+_0x16bae5;_0x1b1bb9[_0xda0c('0x3d')](_0xda0c('0x66')+_0x2ad925+_0xda0c('0x67'));}var _0x400070=util[_0xda0c('0xa')]('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',_0x59963a,_0x2ad925,_0x4d2888,_0x3ee030[_0xda0c('0x20')],_0x3ee030[_0xda0c('0x31')]||null,NOW,NOW);if(_['isNil'](_0x5d35e6[_0xda0c('0x1e')])){_0x400070+=_0xda0c('0x68');}_0x1b1bb9[_0xda0c('0x3d')](_0x400070);if(_0x3ee030['duplicates']&&_0x3ee030[_0xda0c('0x64')][_0xda0c('0x65')]){_0x1b1bb9['push'](insertCmContact(_0x3ee030[_0xda0c('0x20')],_0x2ad925,_0x3ee030[_0xda0c('0x64')],_0x5d35e6));_0x1b1bb9[_0xda0c('0x3d')](_0xda0c('0x69')+_0x2ad925+';');}_0x1b1bb9[_0xda0c('0x3d')](insertCmHopper(_0x3ee030[_0xda0c('0x20')],_0xda0c('0x6a'),_0xda0c('0x6b'),_0xda0c('0x6c'),_0x3271b6));_0x1b1bb9[_0xda0c('0x3d')](insertCmHopperBlack(_0x3ee030[_0xda0c('0x20')],'voice_queues_has_cm_blacklists',_0xda0c('0x6b'),_0xda0c('0x6c')));_0x1b1bb9[_0xda0c('0x3d')](insertCmHopper(_0x3ee030[_0xda0c('0x20')],_0xda0c('0x6d'),_0xda0c('0x6e'),_0xda0c('0x6f'),_0x3271b6));_0x1b1bb9[_0xda0c('0x3d')](insertCmHopperBlack(_0x3ee030[_0xda0c('0x20')],_0xda0c('0x70'),_0xda0c('0x6e'),_0xda0c('0x6f')));BPromise[_0xda0c('0x71')](_0x1b1bb9,handleQuery)[_0xda0c('0x72')](function(_0x17025d){stats[_0xda0c('0x73')]=!![];stats[_0xda0c('0x74')]=_0x3ee030[_0xda0c('0x64')]&&_0x3ee030[_0xda0c('0x64')][_0xda0c('0x65')]?results[0x2][_0xda0c('0x74')]:results[0x0][_0xda0c('0x74')];socket[_0xda0c('0x5f')]('contact:import:'+_0x16bae5,stats);fs[_0xda0c('0x75')](_0x1bc79c);fs['unlink'](_0x59963a);process[_0xda0c('0x3c')](0x0);})[_0xda0c('0x41')](function(_0x49bf25){logger[_0xda0c('0x3a')](_0x49bf25[_0xda0c('0x3b')]);process['exit'](0x1);});}catch(_0x337829){logger[_0xda0c('0x3a')](_0xda0c('0x76'),_0x337829[_0xda0c('0x3b')]);process[_0xda0c('0x3c')](0x1);}},'error':function(_0x39360a,_0x185092,_0x414a75,_0x17bbd7){throw new Error(_0x17bbd7);}});}function validate(){if(process[_0xda0c('0x77')]&&process[_0xda0c('0x77')][_0xda0c('0x65')]<0x4){throw new Error(_0xda0c('0x78'));}var _0x181104=path[_0xda0c('0x11')](config[_0xda0c('0x48')],_0xda0c('0x49'),process['argv'][0x2]);if(!fs['existsSync'](_0x181104)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x544495={};try{_0x544495=JSON[_0xda0c('0x4e')](process['argv'][0x3]);if(!_0x544495['binding']){throw new Error(_0xda0c('0x79'));}if(!_0x544495[_0xda0c('0x46')][_0xda0c('0xf')]){throw new Error(_0xda0c('0x7a'));}if(!_0x544495[_0xda0c('0x46')][_0xda0c('0x5b')]){throw new Error('firstName\x20is\x20mandatory');}var _0x10a243=0x0;if(_0x544495[_0xda0c('0x46')][_0xda0c('0x57')]){_0x10a243=0x1;}if(!_0x544495[_0xda0c('0x20')]){throw new Error(_0xda0c('0x7b'));}}catch(_0x1a46ab){throw new Error('body\x20id\x20mandatory');}var _0xc2447=[];try{_0xc2447=_[_0xda0c('0x7c')](JSON[_0xda0c('0x4e')](process[_0xda0c('0x77')][0x4]),'id');}catch(_0x28d2e5){logger['info'](_0xda0c('0x7d'));}main(_0x181104,_0x544495,_0xc2447,_0x10a243);}validate();process['on'](_0xda0c('0x7e'),handleStop);process['on'](_0xda0c('0x7f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index cbbedb5..cf5c47b 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 _0x1728=['calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','membername','Answer\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue'];(function(_0x218778,_0x239f0a){var _0x182f75=function(_0x50c115){while(--_0x50c115){_0x218778['push'](_0x218778['shift']());}};_0x182f75(++_0x239f0a);}(_0x1728,0x147));var _0x8172=function(_0x229d38,_0x80fd22){_0x229d38=_0x229d38-0x0;var _0x2451fd=_0x1728[_0x229d38];return _0x2451fd;};'use strict';exports[_0x8172('0x0')]=function(_0x122249,_0x298a58){var _0x2c5869=[{'type':_0x8172('0x1'),'content':_0x8172('0x2'),'variableName':null}];switch(_0x122249[_0x8172('0x3')]()){case _0x8172('0x4'):switch(_0x298a58[_0x8172('0x3')]()){case _0x8172('0x5'):_0x2c5869[_0x8172('0x6')]({'type':_0x8172('0x7'),'content':'','variableName':_0x8172('0x8')});_0x2c5869[_0x8172('0x6')]({'type':_0x8172('0x7'),'content':'','variableName':_0x8172('0x9')});break;case _0x8172('0xa'):_0x2c5869['push']({'type':'string','content':_0x8172('0xb'),'variableName':null});_0x2c5869[_0x8172('0x6')]({'type':_0x8172('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x2c5869;};exports[_0x8172('0xc')]=function(_0x4123df,_0x3772ea){var _0x2fad78=[];switch(_0x4123df[_0x8172('0x3')]()){case _0x8172('0x4'):switch(_0x3772ea['toLowerCase']()){case _0x8172('0x5'):_0x2fad78=[{'type':_0x8172('0x1'),'content':_0x8172('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8172('0xe'),'content':'','key':'Caller\x20Number','keyType':_0x8172('0x7'),'variableName':_0x8172('0x9')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0xf'),'keyType':_0x8172('0x7'),'variableName':_0x8172('0x10')},{'type':'keyValue','content':'','key':_0x8172('0x11'),'keyType':_0x8172('0x7'),'variableName':_0x8172('0x12')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x13'),'keyType':_0x8172('0x7'),'variableName':_0x8172('0x8')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x14'),'keyType':_0x8172('0x7'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x8172('0x15'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x8172('0x1'),'content':_0x8172('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x17'),'keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x8172('0x7'),'variableName':_0x8172('0x18')},{'type':_0x8172('0x1'),'content':_0x8172('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x1a'),'keyType':_0x8172('0x7'),'variableName':_0x8172('0x1b')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x1c'),'keyType':_0x8172('0x7'),'variableName':_0x8172('0x1d')},{'type':_0x8172('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x8172('0x7'),'variableName':_0x8172('0x1e')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x1f'),'keyType':'variable','variableName':_0x8172('0x20')},{'type':_0x8172('0xe'),'content':'','key':'Talk\x20Time','keyType':_0x8172('0x7'),'variableName':_0x8172('0x21')}];break;case _0x8172('0xa'):_0x2fad78=[{'type':'string','content':_0x8172('0xd'),'variableName':null},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x22'),'keyType':_0x8172('0x7'),'keyContent':'','variableName':_0x8172('0x18')},{'type':'keyValue','content':'','key':_0x8172('0x23'),'keyType':_0x8172('0x7'),'keyContent':'','variableName':_0x8172('0x24')},{'type':_0x8172('0xe'),'content':'','key':'UniqueId','keyType':_0x8172('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x8172('0x15'),'keyType':_0x8172('0x7'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x8172('0x19')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x25'),'keyType':_0x8172('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0x8172('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x8172('0x7'),'keyContent':'','variableName':_0x8172('0x26')},{'type':_0x8172('0xe'),'content':'','key':'Duration','keyType':_0x8172('0x7'),'keyContent':'','variableName':_0x8172('0x27')},{'type':_0x8172('0xe'),'content':'','key':_0x8172('0x28'),'keyType':_0x8172('0x7'),'keyContent':'','variableName':_0x8172('0x29')}];break;}}return _0x2fad78;}; \ No newline at end of file +var _0x22ab=['Caller\x20Name','calleridname','destexten','Queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','talktime','outbound','***\x20Call\x20Info\x20***','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','Outbound\x20Call','destcalleridnum','getDescriptions','string','keyValue','Caller\x20Number'];(function(_0x53be25,_0x5702c0){var _0x2cedd8=function(_0x93375b){while(--_0x93375b){_0x53be25['push'](_0x53be25['shift']());}};_0x2cedd8(++_0x5702c0);}(_0x22ab,0x9b));var _0xb22a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x22ab[_0x53ccf2];return _0x5a2964;};'use strict';exports[_0xb22a('0x0')]=function(_0x581f52,_0x20d657){var _0x16611d=[{'type':'string','content':_0xb22a('0x1'),'variableName':null}];switch(_0x581f52['toLowerCase']()){case _0xb22a('0x2'):switch(_0x20d657[_0xb22a('0x3')]()){case _0xb22a('0x4'):_0x16611d[_0xb22a('0x5')]({'type':_0xb22a('0x6'),'content':'','variableName':'queue'});_0x16611d[_0xb22a('0x5')]({'type':_0xb22a('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x16611d['push']({'type':'string','content':_0xb22a('0x7'),'variableName':null});_0x16611d['push']({'type':_0xb22a('0x6'),'content':'','variableName':_0xb22a('0x8')});break;}}return _0x16611d;};exports[_0xb22a('0x9')]=function(_0x5bb654,_0x8cef8b){var _0xc46aff=[];switch(_0x5bb654[_0xb22a('0x3')]()){case'voice':switch(_0x8cef8b['toLowerCase']()){case _0xb22a('0x4'):_0xc46aff=[{'type':_0xb22a('0xa'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0xc'),'keyType':_0xb22a('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xb22a('0xd'),'keyType':_0xb22a('0x6'),'variableName':_0xb22a('0xe')},{'type':_0xb22a('0xb'),'content':'','key':'Call\x20To','keyType':_0xb22a('0x6'),'variableName':_0xb22a('0xf')},{'type':'keyValue','content':'','key':_0xb22a('0x10'),'keyType':_0xb22a('0x6'),'variableName':'queue'},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x11'),'keyType':'variable','variableName':_0xb22a('0x12')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x13'),'keyType':_0xb22a('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':_0xb22a('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb22a('0x15'),'keyType':_0xb22a('0x6'),'variableName':_0xb22a('0x16')},{'type':'keyValue','content':'','key':_0xb22a('0x17'),'keyType':_0xb22a('0x6'),'variableName':_0xb22a('0x8')},{'type':_0xb22a('0xa'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x18'),'keyType':_0xb22a('0x6'),'variableName':_0xb22a('0x19')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x1a'),'keyType':_0xb22a('0x6'),'variableName':_0xb22a('0x1b')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x1c'),'keyType':_0xb22a('0x6'),'variableName':'agentcompleteAt'},{'type':_0xb22a('0xb'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0xb22a('0x1d')},{'type':_0xb22a('0xb'),'content':'','key':'Talk\x20Time','keyType':_0xb22a('0x6'),'variableName':_0xb22a('0x1e')}];break;case _0xb22a('0x1f'):_0xc46aff=[{'type':_0xb22a('0xa'),'content':_0xb22a('0x20'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0xb22a('0x8')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x21'),'keyType':_0xb22a('0x6'),'keyContent':'','variableName':_0xb22a('0x22')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x11'),'keyType':_0xb22a('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xb22a('0x13'),'keyType':'variable','keyContent':'','variableName':_0xb22a('0x23')},{'type':'string','content':_0xb22a('0x24')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x25'),'keyType':_0xb22a('0x6'),'keyContent':'','variableName':_0xb22a('0x26')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xb22a('0x6'),'keyContent':'','variableName':_0xb22a('0x27')},{'type':_0xb22a('0xb'),'content':'','key':_0xb22a('0x28'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xb22a('0x29'),'keyType':_0xb22a('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0xc46aff;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 54066bb..91d2729 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 _0x325c=['toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','update','catch','query','omit','body','html','fax','mobile','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x325c,0x15f));var _0xc325=function(_0x2d5363,_0x3eaa24){_0x2d5363=_0x2d5363-0x0;var _0xa676e4=_0x325c[_0x2d5363];return _0xa676e4;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xc325('0x0')),'mail':require(_0xc325('0x1'))('mail-interactions'),'fax':require(_0xc325('0x1'))(_0xc325('0x2')),'sms':require(_0xc325('0x1'))(_0xc325('0x3')),'chat':require('../../config/logger')(_0xc325('0x4')),'whatsapp':require(_0xc325('0x1'))(_0xc325('0x5'))};function getInteractionId(_0x17ec19,_0x14c1a4,_0xf19c44){if(_0x17ec19&&_0x17ec19[_[_0xc325('0x6')](_0xf19c44)+_0xc325('0x7')]){return _0x17ec19[_[_0xc325('0x6')](_0xf19c44)+'InteractionId'];}else if(_0x17ec19&&_0x17ec19['id']){return _0x17ec19['id'];}else if(_0x14c1a4&&_0x14c1a4['id']){return _0x14c1a4['id'];}else{return _0xc325('0x8');}}function log(_0xc5f08d,_0x561289,_0x58a53f,_0x5679bd,_0x460aab,_0x3b58ce){loggers[_0x460aab[_0xc325('0x9')]()][_0xc5f08d](_0xc325('0xa'),_0x3b58ce['toUpperCase'](),_0x561289?_0x561289['id']:null,_0x561289?_0x561289[_0xc325('0xb')]:null,_0x561289?_0x561289[_0xc325('0xc')]:null,getInteractionId(_0x58a53f,_0x5679bd,_0x460aab),_0x58a53f?JSON[_0xc325('0xd')](_0x58a53f):_0xc325('0xe'));}function updateUser(_0x4e619d,_0x4c05f3,_0x6bdaf5,_0x2978c1,_0x2e71c0){db[_['upperFirst'](_0x2978c1)+'Interaction'][_0xc325('0xf')]({'where':{'id':getInteractionId(_0x4c05f3,_0x6bdaf5,_0x2978c1)}})['then'](function(_0x4b9d87){if(_0x4b9d87){return _0x4b9d87[_0xc325('0x10')]({'UserId':_0x4e619d?_0x4e619d['id']:null});}})['then'](function(_0xecc3ca){if(_0xecc3ca){log('info',_0x4e619d,_0x4c05f3,_0x6bdaf5,_0x2978c1,_0x2e71c0);}})[_0xc325('0x11')](function(){log('error',_0x4e619d,_0x4c05f3,_0x6bdaf5,_0x2978c1,_0x2e71c0);});}exports['tracked']=function(_0x4549f9,_0x31f33a){return function(_0x50eda4,_0x480769,_0x3c410e){var _0x23f63c=_0x50eda4['user'];var _0x2ec660={};var _0x3fd231=_0x50eda4[_0xc325('0x12')];if(_0x2ec660){_0x2ec660=_['clone'](_0x50eda4['body']);_0x2ec660=_[_0xc325('0x13')](_0x2ec660,[_0xc325('0x14'),_0xc325('0x15'),'phone',_0xc325('0x16'),_0xc325('0x17')]);}updateUser(_0x23f63c,_0x2ec660,_0x3fd231,_0x4549f9,_0x31f33a);_0x3c410e(null);};}; \ No newline at end of file +var _0x2c67=['findOne','then','info','catch','error','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','toUpperCase','name','Interaction'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x2c67,0x70));var _0x72c6=function(_0x3c9cd1,_0x555129){_0x3c9cd1=_0x3c9cd1-0x0;var _0x4820a9=_0x2c67[_0x3c9cd1];return _0x4820a9;};'use strict';var _=require(_0x72c6('0x0'));var db=require(_0x72c6('0x1'))['db'];var loggers={'openchannel':require(_0x72c6('0x2'))('openchannel-interactions'),'mail':require(_0x72c6('0x2'))(_0x72c6('0x3')),'fax':require('../../config/logger')(_0x72c6('0x4')),'sms':require('../../config/logger')(_0x72c6('0x5')),'chat':require(_0x72c6('0x2'))(_0x72c6('0x6')),'whatsapp':require(_0x72c6('0x2'))('whatsapp-interactions')};function getInteractionId(_0x48fd7f,_0x97b8ed,_0x54d6db){if(_0x48fd7f&&_0x48fd7f[_[_0x72c6('0x7')](_0x54d6db)+_0x72c6('0x8')]){return _0x48fd7f[_['upperFirst'](_0x54d6db)+_0x72c6('0x8')];}else if(_0x48fd7f&&_0x48fd7f['id']){return _0x48fd7f['id'];}else if(_0x97b8ed&&_0x97b8ed['id']){return _0x97b8ed['id'];}else{return'unknown';}}function log(_0x326e58,_0x552ed5,_0x343185,_0x2cbf0a,_0x5694c8,_0x307854){loggers[_0x5694c8[_0x72c6('0x9')]()][_0x326e58]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x307854[_0x72c6('0xa')](),_0x552ed5?_0x552ed5['id']:null,_0x552ed5?_0x552ed5[_0x72c6('0xb')]:null,_0x552ed5?_0x552ed5['role']:null,getInteractionId(_0x343185,_0x2cbf0a,_0x5694c8),_0x343185?JSON['stringify'](_0x343185):'null');}function updateUser(_0x5d4676,_0x670e51,_0x5d00d2,_0x6d8034,_0x2f9397){db[_['upperFirst'](_0x6d8034)+_0x72c6('0xc')][_0x72c6('0xd')]({'where':{'id':getInteractionId(_0x670e51,_0x5d00d2,_0x6d8034)}})[_0x72c6('0xe')](function(_0x4be7ab){if(_0x4be7ab){return _0x4be7ab['update']({'UserId':_0x5d4676?_0x5d4676['id']:null});}})[_0x72c6('0xe')](function(_0x3c3341){if(_0x3c3341){log(_0x72c6('0xf'),_0x5d4676,_0x670e51,_0x5d00d2,_0x6d8034,_0x2f9397);}})[_0x72c6('0x10')](function(){log(_0x72c6('0x11'),_0x5d4676,_0x670e51,_0x5d00d2,_0x6d8034,_0x2f9397);});}exports['tracked']=function(_0x11b589,_0xec062a){return function(_0x3b5e88,_0x245c42,_0x3c3846){var _0x2cf2e4=_0x3b5e88[_0x72c6('0x12')];var _0x349e9f={};var _0x130174=_0x3b5e88['query'];if(_0x349e9f){_0x349e9f=_[_0x72c6('0x13')](_0x3b5e88[_0x72c6('0x14')]);_0x349e9f=_[_0x72c6('0x15')](_0x349e9f,[_0x72c6('0x14'),_0x72c6('0x16'),_0x72c6('0x17'),_0x72c6('0x18'),'mobile']);}updateUser(_0x2cf2e4,_0x349e9f,_0x130174,_0x11b589,_0xec062a);_0x3c3846(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 84b9722..08295cd 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 _0xcf1e=['split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license'];(function(_0x5d28cf,_0x147bda){var _0x28a9d6=function(_0x494aa6){while(--_0x494aa6){_0x5d28cf['push'](_0x5d28cf['shift']());}};_0x28a9d6(++_0x147bda);}(_0xcf1e,0x1a3));var _0xecf1=function(_0x1ee4c0,_0x971f2a){_0x1ee4c0=_0x1ee4c0-0x0;var _0x59273a=_0xcf1e[_0x1ee4c0];return _0x59273a;};'use strict';var crypto=require('crypto');var util=require(_0xecf1('0x0'));var compose=require(_0xecf1('0x1'));var db=require(_0xecf1('0x2'))['db'];var config=require(_0xecf1('0x3'));function getValueFromLicense(_0x141226,_0x1be45d){if(_0x141226&&_0x1be45d){if(_0x1be45d[_0xecf1('0x4')]&&_0x1be45d[_0xecf1('0x5')]){var _0x25ced7=_0x1be45d[_0xecf1('0x4')];var _0x5ad0f5=_0x1be45d[_0xecf1('0x5')];var _0x3b1900=_0x25ced7[_0xecf1('0x6')]('-')[0x4];var _0x577f70=_0x25ced7['split']('-')[0x0];var _0x3614bc=crypto[_0xecf1('0x7')](_0xecf1('0x8'),util[_0xecf1('0x9')](_0xecf1('0xa'),_0x3b1900,_0x25ced7,_0x577f70));var _0x1cb540=_0x3614bc[_0xecf1('0xb')](_0x5ad0f5,_0xecf1('0xc'),_0xecf1('0xd'));_0x1cb540+=_0x3614bc['final'](_0xecf1('0xd'));var _0x40c96a=JSON[_0xecf1('0xe')](_0x1cb540);return _0x40c96a[_0xecf1('0xf')](_0x141226)?_0x40c96a[_0x141226]:null;}}return null;}function isLimit(_0x5ce853,_0x532728,_0x440a68,_0x1ce972){var _0xad1f0e=_0x532728;return compose()['use'](function(_0x3fdaf6,_0x52b7b9,_0x583371){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xecf1('0x10')](function(_0x194671){var _0x5509fd=getValueFromLicense(_0x5ce853,_0x194671);return _0x5509fd?_0x5509fd:_0xad1f0e;})['then'](function(_0x23ad87){_0xad1f0e=_0x23ad87;return _0x440a68[_0xecf1('0x11')](_0x1ce972);})[_0xecf1('0x10')](function(_0x4cc2af){if(_0x4cc2af>=_0xad1f0e){return _0x52b7b9[_0xecf1('0x12')](0x193)['json']({'message':util[_0xecf1('0x9')](_0xecf1('0x13'),_0x5ce853)});}_0x583371();})['catch'](function(_0x344427){_0x583371(_0x344427);});});}function isUserLimit(){return isLimit(_0xecf1('0x14'),0x1,db[_0xecf1('0x15')],{'where':{'$or':[{'role':_0xecf1('0x16')},{'role':_0xecf1('0x17')}]}});}exports[_0xecf1('0x18')]=isUserLimit; \ No newline at end of file +var _0x712d=['isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x712d,0xbe));var _0xd712=function(_0x3eefcc,_0x3c7a1d){_0x3eefcc=_0x3eefcc-0x0;var _0x3d7bb6=_0x712d[_0x3eefcc];return _0x3d7bb6;};'use strict';var crypto=require(_0xd712('0x0'));var util=require(_0xd712('0x1'));var compose=require(_0xd712('0x2'));var db=require(_0xd712('0x3'))['db'];var config=require(_0xd712('0x4'));function getValueFromLicense(_0x1848f8,_0x2a0a86){if(_0x1848f8&&_0x2a0a86){if(_0x2a0a86[_0xd712('0x5')]&&_0x2a0a86[_0xd712('0x6')]){var _0x202955=_0x2a0a86[_0xd712('0x5')];var _0x5e9508=_0x2a0a86[_0xd712('0x6')];var _0x2aa6ca=_0x202955[_0xd712('0x7')]('-')[0x4];var _0x55e584=_0x202955[_0xd712('0x7')]('-')[0x0];var _0x482190=crypto[_0xd712('0x8')](_0xd712('0x9'),util[_0xd712('0xa')](_0xd712('0xb'),_0x2aa6ca,_0x202955,_0x55e584));var _0x5cb772=_0x482190[_0xd712('0xc')](_0x5e9508,'base64','utf8');_0x5cb772+=_0x482190[_0xd712('0xd')](_0xd712('0xe'));var _0x49820d=JSON[_0xd712('0xf')](_0x5cb772);return _0x49820d[_0xd712('0x10')](_0x1848f8)?_0x49820d[_0x1848f8]:null;}}return null;}function isLimit(_0x3b4b90,_0xe0f356,_0x24e5e0,_0x385345){var _0x4f5cdc=_0xe0f356;return compose()['use'](function(_0x5a4abd,_0x514fc8,_0x182f87){return db['License'][_0xd712('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xd712('0x12')](function(_0x115a97){var _0x36f0ba=getValueFromLicense(_0x3b4b90,_0x115a97);return _0x36f0ba?_0x36f0ba:_0x4f5cdc;})[_0xd712('0x12')](function(_0x34836e){_0x4f5cdc=_0x34836e;return _0x24e5e0[_0xd712('0x13')](_0x385345);})['then'](function(_0x54f4b2){if(_0x54f4b2>=_0x4f5cdc){return _0x514fc8['status'](0x193)[_0xd712('0x14')]({'message':util[_0xd712('0xa')](_0xd712('0x15'),_0x3b4b90)});}_0x182f87();})[_0xd712('0x16')](function(_0x3b2408){_0x182f87(_0x3b2408);});});}function isUserLimit(){return isLimit(_0xd712('0x17'),0x1,db[_0xd712('0x18')],{'where':{'$or':[{'role':_0xd712('0x19')},{'role':'user'}]}});}exports[_0xd712('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 26c6613..c0c1230 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 _0x7e13=['forEach','shift','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','includes','$lte','add','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','<\x20?','$gt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','DATE','utcOffset','minutes','seconds','format','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split'];(function(_0x2e1caf,_0x22222c){var _0x81d348=function(_0xc373e1){while(--_0xc373e1){_0x2e1caf['push'](_0x2e1caf['shift']());}};_0x81d348(++_0x22222c);}(_0x7e13,0x165));var _0x37e1=function(_0x4a4397,_0x37cdb8){_0x4a4397=_0x4a4397-0x0;var _0x584cea=_0x7e13[_0x4a4397];return _0x584cea;};'use strict';var _=require('lodash');var moment=require(_0x37e1('0x0'));exports[_0x37e1('0x1')]=function(_0x37f180){var _0x1a037e={'conditions':[]};_0x1a037e[_0x37e1('0x2')]=_[_0x37e1('0x3')](_0x37f180,_0x37e1('0x4'))?'or':'and';var _0x92de9d=_0x37f180[_0x37e1('0x5')]('[$and]','')[_0x37e1('0x5')](_0x37e1('0x4'),'')['split']('||');for(var _0x49ad88=0x0;_0x49ad88<_0x92de9d['length'];_0x49ad88++){var _0x102459=_0x92de9d[_0x49ad88][_0x37e1('0x6')](':=');var _0x4be60f=_0x102459[0x0];var _0x5b0d24=_0x102459['slice'](0x1);_0x5b0d24[_0x37e1('0x7')](function(_0x43acce){var _0x3ac9e1=_0x43acce[_0x37e1('0x6')]('[')[_0x37e1('0x8')]();var _0x497d2e=_0x43acce['match'](/\[(.*?)\]/g);_0x497d2e[_0x37e1('0x7')](function(_0x3406d4){var _0x1572f8=_0x3406d4[_0x37e1('0x6')]('[')[_0x37e1('0x9')](function(_0x5a019b){return _0x5a019b[_0x37e1('0xa')](']')>-0x1;})[_0x37e1('0xb')](function(_0x16d366){return _0x16d366[_0x37e1('0x6')](']')[0x0];})[0x0];_0x1a037e[_0x37e1('0xc')][_0x37e1('0xd')]({'field':_0x4be60f,'operator':_0x3ac9e1,'value':_0x1572f8});});});}return _0x1a037e;};exports[_0x37e1('0xe')]=function(_0x10485d,_0x30fe57,_0x535c6e){var _0xf28b0e={};if(_0x30fe57==='DATE'){if(_0x535c6e[_0x37e1('0xf')]===_0x37e1('0x10')){_0x535c6e[_0x37e1('0xf')]=_0x37e1('0x11');_0x535c6e[_0x37e1('0x12')]+=','+_0x535c6e[_0x37e1('0x12')];}else if(_[_0x37e1('0x13')](['$gt',_0x37e1('0x14')],_0x535c6e[_0x37e1('0xf')])){_0x535c6e[_0x37e1('0x12')]=moment(_0x535c6e[_0x37e1('0x12')])[_0x37e1('0x15')](0x1,'days')['format'](_0x37e1('0x16'));}}if(_0x535c6e[_0x37e1('0x17')]){_0x30fe57=_0x535c6e['castTo'];_0xf28b0e[_0x37e1('0x18')]=_0x37e1('0x19')+_0x10485d+'.'+_0x535c6e[_0x37e1('0x1a')]+'\x20AS\x20'+_0x535c6e[_0x37e1('0x17')]+')\x20'+parseOperator(_0x535c6e[_0x37e1('0xf')]);}else{_0xf28b0e[_0x37e1('0x18')]=_0x10485d+'.'+_0x535c6e['field']+'\x20'+parseOperator(_0x535c6e[_0x37e1('0xf')]);}if(_[_0x37e1('0x13')]([_0x37e1('0x1b'),_0x37e1('0x1c')],_0x535c6e[_0x37e1('0xf')]))_0xf28b0e[_0x37e1('0x18')]='('+_0xf28b0e[_0x37e1('0x18')]+_0x37e1('0x1d')+_0x10485d+'.'+_0x535c6e['field']+_0x37e1('0x1e');_0xf28b0e[_0x37e1('0x12')]=parseValue(_0x30fe57,_0x535c6e[_0x37e1('0xf')],_0x535c6e[_0x37e1('0x12')]);return _0xf28b0e;};function parseOperator(_0x2c8c37){var _0x562be7;switch(_0x2c8c37){case _0x37e1('0x1f'):_0x562be7='IN\x20?';break;case _0x37e1('0x1c'):_0x562be7=_0x37e1('0x20');break;case _0x37e1('0x10'):_0x562be7=_0x37e1('0x21');break;case _0x37e1('0x1b'):_0x562be7=_0x37e1('0x22');break;case _0x37e1('0x23'):case _0x37e1('0x24'):case'$endsWith':_0x562be7=_0x37e1('0x25');break;case'$lt':_0x562be7=_0x37e1('0x26');break;case _0x37e1('0x27'):_0x562be7=_0x37e1('0x28');break;case _0x37e1('0x14'):_0x562be7=_0x37e1('0x29');break;case _0x37e1('0x2a'):_0x562be7='>=\x20?';break;case _0x37e1('0x11'):_0x562be7=_0x37e1('0x2b');break;}return _0x562be7;}function parseValue(_0x12bef2,_0xb643f0,_0x5d0355){var _0x4b7f87={'start':undefined,'end':undefined};switch(_0xb643f0){case _0x37e1('0x1f'):case _0x37e1('0x1c'):_0x4b7f87[_0x37e1('0x2c')]=_0x5d0355['split'](',');break;case _0x37e1('0x23'):_0x4b7f87[_0x37e1('0x2c')]='%'+_0x5d0355+'%';break;case _0x37e1('0x24'):_0x4b7f87['start']=_0x5d0355+'%';break;case _0x37e1('0x2d'):_0x4b7f87[_0x37e1('0x2c')]='%'+_0x5d0355;break;case _0x37e1('0x11'):var _0x31d2a3=_0x5d0355[_0x37e1('0x6')](',');var _0x5d0355=_0x31d2a3[_0x37e1('0x8')]();var _0x109a06=_0x31d2a3[_0x37e1('0x2e')]();if(_0x12bef2===_0x37e1('0x2f')){_0x5d0355=moment(_0x5d0355)[_0x37e1('0x30')](0x0,!![])['format']();_0x109a06=moment(_0x109a06)[_0x37e1('0x30')](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x37e1('0x31'))[_0x37e1('0x15')](0x3b,_0x37e1('0x32'))[_0x37e1('0x33')]();}_0x4b7f87={'start':_0x5d0355,'end':_0x109a06};break;default:_0x4b7f87[_0x37e1('0x2c')]=_0x5d0355;break;}return _0x4b7f87;} \ No newline at end of file +var _0xc587=['split','forEach','shift','match','filter','indexOf','conditions','buildExpression','DATE','operator','$between','value','includes','$lte','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$eq','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','format','add','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','length'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xc587,0x9c));var _0x7c58=function(_0xdacf0c,_0x110309){_0xdacf0c=_0xdacf0c-0x0;var _0xc89500=_0xc587[_0xdacf0c];return _0xc89500;};'use strict';var _=require(_0x7c58('0x0'));var moment=require(_0x7c58('0x1'));exports[_0x7c58('0x2')]=function(_0x546fc1){var _0x22fe3e={'conditions':[]};_0x22fe3e[_0x7c58('0x3')]=_[_0x7c58('0x4')](_0x546fc1,_0x7c58('0x5'))?'or':'and';var _0x29c0a0=_0x546fc1[_0x7c58('0x6')](_0x7c58('0x7'),'')['replace'](_0x7c58('0x5'),'')['split']('||');for(var _0x12003a=0x0;_0x12003a<_0x29c0a0[_0x7c58('0x8')];_0x12003a++){var _0x57e7a7=_0x29c0a0[_0x12003a][_0x7c58('0x9')](':=');var _0x54d444=_0x57e7a7[0x0];var _0x31a31a=_0x57e7a7['slice'](0x1);_0x31a31a[_0x7c58('0xa')](function(_0x25b8b2){var _0x22a230=_0x25b8b2[_0x7c58('0x9')]('[')[_0x7c58('0xb')]();var _0x35f641=_0x25b8b2[_0x7c58('0xc')](/\[(.*?)\]/g);_0x35f641[_0x7c58('0xa')](function(_0x4bd1d4){var _0x4bc724=_0x4bd1d4[_0x7c58('0x9')]('[')[_0x7c58('0xd')](function(_0x2dae92){return _0x2dae92[_0x7c58('0xe')](']')>-0x1;})['map'](function(_0x191b7f){return _0x191b7f[_0x7c58('0x9')](']')[0x0];})[0x0];_0x22fe3e[_0x7c58('0xf')]['push']({'field':_0x54d444,'operator':_0x22a230,'value':_0x4bc724});});});}return _0x22fe3e;};exports[_0x7c58('0x10')]=function(_0x47b1aa,_0x327820,_0x592e69){var _0x179189={};if(_0x327820===_0x7c58('0x11')){if(_0x592e69[_0x7c58('0x12')]==='$eq'){_0x592e69[_0x7c58('0x12')]=_0x7c58('0x13');_0x592e69[_0x7c58('0x14')]+=','+_0x592e69['value'];}else if(_[_0x7c58('0x15')](['$gt',_0x7c58('0x16')],_0x592e69[_0x7c58('0x12')])){_0x592e69['value']=moment(_0x592e69[_0x7c58('0x14')])['add'](0x1,_0x7c58('0x17'))['format'](_0x7c58('0x18'));}}if(_0x592e69['castTo']){_0x327820=_0x592e69[_0x7c58('0x19')];_0x179189[_0x7c58('0x1a')]=_0x7c58('0x1b')+_0x47b1aa+'.'+_0x592e69['field']+_0x7c58('0x1c')+_0x592e69[_0x7c58('0x19')]+')\x20'+parseOperator(_0x592e69[_0x7c58('0x12')]);}else{_0x179189[_0x7c58('0x1a')]=_0x47b1aa+'.'+_0x592e69[_0x7c58('0x1d')]+'\x20'+parseOperator(_0x592e69[_0x7c58('0x12')]);}if(_[_0x7c58('0x15')]([_0x7c58('0x1e'),_0x7c58('0x1f')],_0x592e69[_0x7c58('0x12')]))_0x179189[_0x7c58('0x1a')]='('+_0x179189[_0x7c58('0x1a')]+_0x7c58('0x20')+_0x47b1aa+'.'+_0x592e69[_0x7c58('0x1d')]+'\x20IS\x20NULL)';_0x179189['value']=parseValue(_0x327820,_0x592e69[_0x7c58('0x12')],_0x592e69[_0x7c58('0x14')]);return _0x179189;};function parseOperator(_0x27e888){var _0x1fc971;switch(_0x27e888){case _0x7c58('0x21'):_0x1fc971=_0x7c58('0x22');break;case _0x7c58('0x1f'):_0x1fc971=_0x7c58('0x23');break;case _0x7c58('0x24'):_0x1fc971='=\x20?';break;case _0x7c58('0x1e'):_0x1fc971='<>\x20?';break;case _0x7c58('0x25'):case _0x7c58('0x26'):case _0x7c58('0x27'):_0x1fc971=_0x7c58('0x28');break;case _0x7c58('0x29'):_0x1fc971=_0x7c58('0x2a');break;case _0x7c58('0x2b'):_0x1fc971='>\x20?';break;case _0x7c58('0x16'):_0x1fc971=_0x7c58('0x2c');break;case _0x7c58('0x2d'):_0x1fc971=_0x7c58('0x2e');break;case _0x7c58('0x13'):_0x1fc971=_0x7c58('0x2f');break;}return _0x1fc971;}function parseValue(_0x5cb735,_0x5c3759,_0x5ebe7a){var _0x3f5bd7={'start':undefined,'end':undefined};switch(_0x5c3759){case _0x7c58('0x21'):case _0x7c58('0x1f'):_0x3f5bd7[_0x7c58('0x30')]=_0x5ebe7a[_0x7c58('0x9')](',');break;case'$substring':_0x3f5bd7[_0x7c58('0x30')]='%'+_0x5ebe7a+'%';break;case'$startsWith':_0x3f5bd7['start']=_0x5ebe7a+'%';break;case'$endsWith':_0x3f5bd7[_0x7c58('0x30')]='%'+_0x5ebe7a;break;case _0x7c58('0x13'):var _0x18f0be=_0x5ebe7a[_0x7c58('0x9')](',');var _0x5ebe7a=_0x18f0be[_0x7c58('0xb')]();var _0x26b4bd=_0x18f0be[_0x7c58('0x31')]();if(_0x5cb735===_0x7c58('0x11')){_0x5ebe7a=moment(_0x5ebe7a)[_0x7c58('0x32')](0x0,!![])[_0x7c58('0x33')]();_0x26b4bd=moment(_0x26b4bd)[_0x7c58('0x32')](0x0,!![])[_0x7c58('0x34')](0x17,_0x7c58('0x35'))['add'](0x3b,'minutes')[_0x7c58('0x34')](0x3b,_0x7c58('0x36'))[_0x7c58('0x33')]();}_0x3f5bd7={'start':_0x5ebe7a,'end':_0x26b4bd};break;default:_0x3f5bd7[_0x7c58('0x30')]=_0x5ebe7a;break;}return _0x3f5bd7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a99d888..5d44d4e 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 _0x5aa7=['subtract','name','uniqueid','isArray','limit','sort','priority','cast','unsigned','substr','DESC','col','ASC','omit','isString','length','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','push','join','query','$id','model','map','intersection','attributes','nolimit','offset','where','pick','filter','columns','value','merge','lower','options','sequelize','keys','includes','parse','fields','split','filters','isEmpty','forOwn','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte'];(function(_0x505b9d,_0x14bcf4){var _0x491990=function(_0x4c544){while(--_0x4c544){_0x505b9d['push'](_0x505b9d['shift']());}};_0x491990(++_0x14bcf4);}(_0x5aa7,0xcc));var _0x75aa=function(_0x2e683f,_0x46105a){_0x2e683f=_0x2e683f-0x0;var _0x3262d8=_0x5aa7[_0x2e683f];return _0x3262d8;};'use strict';var _=require('lodash');var sequelize=require(_0x75aa('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4716b8){var _0x547c7f=['ne'];try{var _0x3fb235=JSON['parse'](_0x4716b8);var _0x1f599e=Object[_0x75aa('0x1')](_0x3fb235)[0x0];return _0x547c7f[_0x75aa('0x2')](_0x1f599e);}catch(_0x5a7a8e){return![];}}function getOperatorValue(_0x5695ab){var _0x14a6fa=JSON[_0x75aa('0x3')](_0x5695ab);var _0x2103f7=Object['keys'](_0x14a6fa)[0x0];var _0x167ac4=_0x14a6fa[_0x2103f7];return{['$'+_0x2103f7]:_0x167ac4};}exports[_0x75aa('0x4')]=function(_0x5e3128){var _0x3c5a24=null;if(_0x5e3128){_0x3c5a24=_0x5e3128[_0x75aa('0x5')](',');}return _0x3c5a24;};exports[_0x75aa('0x6')]=function(_0xc0548c,_0x504f00){var _0x4b6a16={};if(!_[_0x75aa('0x7')](_0xc0548c)){_[_0x75aa('0x8')](_0xc0548c,function(_0x3936c1,_0x1b2ebc){try{if(_0x504f00){var _0x7855b2=_['find'](_0x504f00,{'name':_0x1b2ebc})||{};if(hasSequelizeOperator(_0x3936c1)){_0x4b6a16[_0x1b2ebc]=getOperatorValue(_0x3936c1);}else if(_0x7855b2[_0x75aa('0x9')]==='DATE'&&_[_0x75aa('0xa')](_0x3936c1)){var _0x35a737=JSON[_0x75aa('0x3')](_0x3936c1);var _0x579f34={'$gte':moment(moment(_0x35a737[_0x75aa('0xb')])[_0x75aa('0xc')](_0x75aa('0xd')))[_0x75aa('0xe')]()[_0x75aa('0xc')](),'$lte':moment(moment(_0x35a737[_0x75aa('0xf')])['format'](_0x75aa('0xd')))[_0x75aa('0xe')]()[_0x75aa('0x10')](0x1,'s')[_0x75aa('0xc')]()};_0x4b6a16[_0x1b2ebc]=_0x579f34;}else if(_0x7855b2[_0x75aa('0x11')]===_0x75aa('0x12')){_0x4b6a16[_0x1b2ebc]=_0x3936c1;}else{_0x4b6a16[_0x1b2ebc]=_[_0x75aa('0x13')](_0x3936c1)?_0x3936c1:JSON['parse'](_0x3936c1);}}else{_0x4b6a16[_0x1b2ebc]=_[_0x75aa('0x13')](_0x3936c1)?_0x3936c1:JSON[_0x75aa('0x3')](_0x3936c1);}}catch(_0x4298c5){_0x4b6a16[_0x1b2ebc]=_0x3936c1[_0x75aa('0x5')](',');}});}return _0x4b6a16;};exports[_0x75aa('0x14')]=function(_0x247c7f){_0x247c7f=parseInt(_0x247c7f,0xa);if(!_0x247c7f||_0x247c7f<0x0){_0x247c7f=LIMIT_VALUE;}return _0x247c7f;};exports['offset']=function(_0x15db5c){_0x15db5c=parseInt(_0x15db5c,0xa);if(!_0x15db5c||_0x15db5c<0x0){_0x15db5c=0x0;}return _0x15db5c;};exports[_0x75aa('0x15')]=function(_0x5a5766){var _0x300871,_0x4c1640=null;if(_0x5a5766){_0x300871=_0x5a5766[_0x75aa('0x5')](',');_0x4c1640=_['map'](_0x300871,function(_0x9d257b){if(_0x9d257b['indexOf']('-')===0x0){return[_0x9d257b===_0x75aa('0x16')?sequelize[_0x75aa('0x17')](sequelize['col'](_0x75aa('0x16')),_0x75aa('0x18')):_0x9d257b[_0x75aa('0x19')](0x1),_0x75aa('0x1a')];}else{return[_0x9d257b===_0x75aa('0x16')?sequelize[_0x75aa('0x17')](sequelize[_0x75aa('0x1b')](_0x75aa('0x16')),_0x75aa('0x18')):_0x9d257b,_0x75aa('0x1c')];}});}return _0x4c1640;};exports['omit']=function(_0x260225,_0x1ea283){if(_[_0x75aa('0x7')](_0x260225)){return _0x260225;}if(_[_0x75aa('0x13')](_0x260225)){for(var _0x117b0b=0x0;_0x117b0b<_0x260225['length'];_0x117b0b+=0x1){_0x260225[_0x117b0b]=this[_0x75aa('0x1d')](_0x260225[_0x117b0b],_0x1ea283);}return _0x260225;}if(!_['isObject'](_0x260225)){return _0x260225;}if(_[_0x75aa('0x1e')](_0x1ea283)){_0x1ea283=[_0x1ea283];}if(!_[_0x75aa('0x13')](_0x1ea283)){return _0x260225;}for(var _0x2cccc2=0x0;_0x2cccc2<_0x1ea283[_0x75aa('0x1f')];_0x2cccc2+=0x1){_['unset'](_0x260225,_0x1ea283[_0x2cccc2]);}for(var _0x213c40 in _0x260225){if(_0x260225['hasOwnProperty'](_0x213c40)){_0x260225[_0x213c40]=this[_0x75aa('0x1d')](_0x260225[_0x213c40],_0x1ea283);}}return _0x260225;};exports['isNumeric']=function(_0x1fd992){return _0x1fd992[_0x75aa('0x20')](RegExp(_0x75aa('0x21')))?!![]:![];};exports[_0x75aa('0x22')]=function(_0x37a56f){return _0x37a56f[_0x75aa('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x75aa('0x23')]=function(_0x155372){var _0x1f4194=[];_0x155372[_0x75aa('0x5')](/[ ,]+/)['forEach'](function(_0x3ed1af){_0x3ed1af=_0x3ed1af[_0x75aa('0x24')](/([^:]")"+/g,'$1');_0x3ed1af='+'+_0x3ed1af+'*';if(_0x3ed1af[_0x75aa('0x2')]('@'))_0x3ed1af='\x22'+_0x3ed1af+'\x22';_0x1f4194[_0x75aa('0x25')](_0x3ed1af);});return _0x1f4194[_0x75aa('0x26')]('\x20');};exports['getOptions']=function(_0x21bd00,_0x1eb267,_0x1f738a){var _0xcce918={},_0x61fff6={};if(_0x1eb267[_0x75aa('0x27')][_0x75aa('0x28')]){_0x1eb267[_0x75aa('0x27')]['id']=_0x1eb267[_0x75aa('0x27')][_0x75aa('0x28')];delete _0x1eb267[_0x75aa('0x27')][_0x75aa('0x28')];}_0xcce918[_0x75aa('0x29')]=_[_0x75aa('0x2a')](_0x21bd00,_0x75aa('0x11'));_0xcce918[_0x75aa('0x27')]=_[_0x75aa('0x1')](_0x1eb267['query']);_0xcce918[_0x75aa('0x6')]=_['intersection'](_0xcce918[_0x75aa('0x29')],_0xcce918['query']);_0x61fff6['attributes']=_[_0x75aa('0x2b')](_0xcce918['model'],this['fields'](_0x1eb267[_0x75aa('0x27')][_0x75aa('0x4')]));_0x61fff6[_0x75aa('0x2c')]=_0x61fff6[_0x75aa('0x2c')]['length']?_0x61fff6['attributes']:_0xcce918[_0x75aa('0x29')];if(!_0x1eb267[_0x75aa('0x27')]['hasOwnProperty'](_0x75aa('0x2d'))){_0x61fff6[_0x75aa('0x14')]=this[_0x75aa('0x14')](_0x1eb267['query'][_0x75aa('0x14')]);_0x61fff6[_0x75aa('0x2e')]=this[_0x75aa('0x2e')](_0x1eb267[_0x75aa('0x27')][_0x75aa('0x2e')]);}_0x61fff6['order']=this['sort'](_0x1eb267[_0x75aa('0x27')][_0x75aa('0x15')]);_0x61fff6[_0x75aa('0x2f')]=this['filters'](_[_0x75aa('0x30')](_0x1eb267['query'],_0xcce918['filters']),_0x21bd00);if(_0x1eb267[_0x75aa('0x27')][_0x75aa('0x31')]){var _0x178a6f=_0x21bd00;var _0x5bdde5=_0x1eb267[_0x75aa('0x27')]['filter'];if(typeof _0x5bdde5==='object'){_0x178a6f=_[_0x75aa('0x31')](_0x21bd00,function(_0x2a7d19){return _[_0x75aa('0x2')](_0x5bdde5[_0x75aa('0x32')],_0x2a7d19[_0x75aa('0x11')]);});_0x5bdde5=_0x5bdde5[_0x75aa('0x33')];}_0x61fff6[_0x75aa('0x2f')]=_[_0x75aa('0x34')](_0x61fff6[_0x75aa('0x2f')],{'$or':_[_0x75aa('0x2a')](_0x178a6f,function(_0x4d8acf){if(_0x4d8acf['type']!=='VIRTUAL'){if(_0x1f738a){return sequelize['where'](sequelize['fn'](_0x75aa('0x35'),sequelize[_0x75aa('0x1b')](_0x4d8acf[_0x75aa('0x11')])),{'$like':sequelize['fn'](_0x75aa('0x35'),'%'+_0x1eb267[_0x75aa('0x27')][_0x75aa('0x31')]+'%')});}else{var _0x95a4c2={};_0x95a4c2[_0x4d8acf[_0x75aa('0x11')]]={'$like':'%'+_0x1eb267['query'][_0x75aa('0x31')]+'%'};return _0x95a4c2;}}})});}_0x61fff6=_['merge']({},_0x61fff6,_0x1eb267[_0x75aa('0x36')]);return _0x61fff6;}; \ No newline at end of file +var _0x7624=['offset','order','where','filter','object','columns','value','merge','type','VIRTUAL','lower','options','lodash','sequelize','moment','keys','fields','split','filters','forOwn','find','isPlainObject','parse','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','limit','sort','indexOf','cast','priority','unsigned','substr','DESC','col','ASC','omit','isEmpty','isString','length','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','includes','push','join','query','$id','model','map','name','intersection','attributes','nolimit'];(function(_0x4111d1,_0x30642e){var _0x27612b=function(_0x1a95c4){while(--_0x1a95c4){_0x4111d1['push'](_0x4111d1['shift']());}};_0x27612b(++_0x30642e);}(_0x7624,0x18c));var _0x4762=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7624[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4762('0x0'));var sequelize=require(_0x4762('0x1'));var moment=require(_0x4762('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xa5ade9){var _0x2f77cb=['ne'];try{var _0x177af0=JSON['parse'](_0xa5ade9);var _0x132dc8=Object[_0x4762('0x3')](_0x177af0)[0x0];return _0x2f77cb['includes'](_0x132dc8);}catch(_0x3c95e5){return![];}}function getOperatorValue(_0x948a3a){var _0x2b0125=JSON['parse'](_0x948a3a);var _0x1bd806=Object[_0x4762('0x3')](_0x2b0125)[0x0];var _0x449a60=_0x2b0125[_0x1bd806];return{['$'+_0x1bd806]:_0x449a60};}exports[_0x4762('0x4')]=function(_0x18a227){var _0x43af9c=null;if(_0x18a227){_0x43af9c=_0x18a227[_0x4762('0x5')](',');}return _0x43af9c;};exports[_0x4762('0x6')]=function(_0x937ffd,_0x57f829){var _0x9f1408={};if(!_['isEmpty'](_0x937ffd)){_[_0x4762('0x7')](_0x937ffd,function(_0x4f19d4,_0x1e3e74){try{if(_0x57f829){var _0x31a910=_[_0x4762('0x8')](_0x57f829,{'name':_0x1e3e74})||{};if(hasSequelizeOperator(_0x4f19d4)){_0x9f1408[_0x1e3e74]=getOperatorValue(_0x4f19d4);}else if(_0x31a910['type']==='DATE'&&_[_0x4762('0x9')](_0x4f19d4)){var _0x261d73=JSON[_0x4762('0xa')](_0x4f19d4);var _0x1546b1={'$gte':moment(moment(_0x261d73[_0x4762('0xb')])['format'](_0x4762('0xc')))[_0x4762('0xd')]()[_0x4762('0xe')](),'$lte':moment(moment(_0x261d73[_0x4762('0xf')])['format'](_0x4762('0xc')))[_0x4762('0xd')]()[_0x4762('0x10')](0x1,'s')[_0x4762('0xe')]()};_0x9f1408[_0x1e3e74]=_0x1546b1;}else if(_0x31a910['name']===_0x4762('0x11')){_0x9f1408[_0x1e3e74]=_0x4f19d4;}else{_0x9f1408[_0x1e3e74]=_[_0x4762('0x12')](_0x4f19d4)?_0x4f19d4:JSON[_0x4762('0xa')](_0x4f19d4);}}else{_0x9f1408[_0x1e3e74]=_[_0x4762('0x12')](_0x4f19d4)?_0x4f19d4:JSON['parse'](_0x4f19d4);}}catch(_0x297978){_0x9f1408[_0x1e3e74]=_0x4f19d4[_0x4762('0x5')](',');}});}return _0x9f1408;};exports[_0x4762('0x13')]=function(_0x1dfac3){_0x1dfac3=parseInt(_0x1dfac3,0xa);if(!_0x1dfac3||_0x1dfac3<0x0){_0x1dfac3=LIMIT_VALUE;}return _0x1dfac3;};exports['offset']=function(_0x115563){_0x115563=parseInt(_0x115563,0xa);if(!_0x115563||_0x115563<0x0){_0x115563=0x0;}return _0x115563;};exports[_0x4762('0x14')]=function(_0x8f870c){var _0x1d1cdf,_0x66e5df=null;if(_0x8f870c){_0x1d1cdf=_0x8f870c[_0x4762('0x5')](',');_0x66e5df=_['map'](_0x1d1cdf,function(_0x2911c4){if(_0x2911c4[_0x4762('0x15')]('-')===0x0){return[_0x2911c4==='priority'?sequelize[_0x4762('0x16')](sequelize['col'](_0x4762('0x17')),_0x4762('0x18')):_0x2911c4[_0x4762('0x19')](0x1),_0x4762('0x1a')];}else{return[_0x2911c4==='priority'?sequelize[_0x4762('0x16')](sequelize[_0x4762('0x1b')](_0x4762('0x17')),_0x4762('0x18')):_0x2911c4,_0x4762('0x1c')];}});}return _0x66e5df;};exports[_0x4762('0x1d')]=function(_0x179a70,_0x318c29){if(_[_0x4762('0x1e')](_0x179a70)){return _0x179a70;}if(_[_0x4762('0x12')](_0x179a70)){for(var _0x1d5a58=0x0;_0x1d5a58<_0x179a70['length'];_0x1d5a58+=0x1){_0x179a70[_0x1d5a58]=this[_0x4762('0x1d')](_0x179a70[_0x1d5a58],_0x318c29);}return _0x179a70;}if(!_['isObject'](_0x179a70)){return _0x179a70;}if(_[_0x4762('0x1f')](_0x318c29)){_0x318c29=[_0x318c29];}if(!_[_0x4762('0x12')](_0x318c29)){return _0x179a70;}for(var _0x3627e0=0x0;_0x3627e0<_0x318c29[_0x4762('0x20')];_0x3627e0+=0x1){_[_0x4762('0x21')](_0x179a70,_0x318c29[_0x3627e0]);}for(var _0x4bf82c in _0x179a70){if(_0x179a70[_0x4762('0x22')](_0x4bf82c)){_0x179a70[_0x4bf82c]=this['omit'](_0x179a70[_0x4bf82c],_0x318c29);}}return _0x179a70;};exports['isNumeric']=function(_0x5b9351){return _0x5b9351['match'](RegExp(_0x4762('0x23')))?!![]:![];};exports[_0x4762('0x24')]=function(_0x1464ed){return _0x1464ed[_0x4762('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x4762('0x26')]=function(_0x34a267){var _0x2b3515=[];_0x34a267[_0x4762('0x5')](/[ ,]+/)[_0x4762('0x27')](function(_0x1db781){_0x1db781=_0x1db781[_0x4762('0x28')](/([^:]")"+/g,'$1');_0x1db781='+'+_0x1db781+'*';if(_0x1db781[_0x4762('0x29')]('@'))_0x1db781='\x22'+_0x1db781+'\x22';_0x2b3515[_0x4762('0x2a')](_0x1db781);});return _0x2b3515[_0x4762('0x2b')]('\x20');};exports['getOptions']=function(_0x470d7a,_0x5686e4,_0x4f4033){var _0x508960={},_0x2e1fce={};if(_0x5686e4[_0x4762('0x2c')][_0x4762('0x2d')]){_0x5686e4['query']['id']=_0x5686e4[_0x4762('0x2c')][_0x4762('0x2d')];delete _0x5686e4[_0x4762('0x2c')]['$id'];}_0x508960[_0x4762('0x2e')]=_[_0x4762('0x2f')](_0x470d7a,_0x4762('0x30'));_0x508960['query']=_['keys'](_0x5686e4[_0x4762('0x2c')]);_0x508960[_0x4762('0x6')]=_[_0x4762('0x31')](_0x508960[_0x4762('0x2e')],_0x508960['query']);_0x2e1fce[_0x4762('0x32')]=_['intersection'](_0x508960[_0x4762('0x2e')],this[_0x4762('0x4')](_0x5686e4[_0x4762('0x2c')][_0x4762('0x4')]));_0x2e1fce[_0x4762('0x32')]=_0x2e1fce[_0x4762('0x32')][_0x4762('0x20')]?_0x2e1fce[_0x4762('0x32')]:_0x508960[_0x4762('0x2e')];if(!_0x5686e4[_0x4762('0x2c')]['hasOwnProperty'](_0x4762('0x33'))){_0x2e1fce[_0x4762('0x13')]=this[_0x4762('0x13')](_0x5686e4['query'][_0x4762('0x13')]);_0x2e1fce[_0x4762('0x34')]=this[_0x4762('0x34')](_0x5686e4[_0x4762('0x2c')][_0x4762('0x34')]);}_0x2e1fce[_0x4762('0x35')]=this[_0x4762('0x14')](_0x5686e4['query'][_0x4762('0x14')]);_0x2e1fce[_0x4762('0x36')]=this[_0x4762('0x6')](_['pick'](_0x5686e4['query'],_0x508960[_0x4762('0x6')]),_0x470d7a);if(_0x5686e4['query'][_0x4762('0x37')]){var _0x538cb7=_0x470d7a;var _0x184762=_0x5686e4[_0x4762('0x2c')][_0x4762('0x37')];if(typeof _0x184762===_0x4762('0x38')){_0x538cb7=_[_0x4762('0x37')](_0x470d7a,function(_0x4ebe9f){return _[_0x4762('0x29')](_0x184762[_0x4762('0x39')],_0x4ebe9f[_0x4762('0x30')]);});_0x184762=_0x184762[_0x4762('0x3a')];}_0x2e1fce[_0x4762('0x36')]=_[_0x4762('0x3b')](_0x2e1fce[_0x4762('0x36')],{'$or':_[_0x4762('0x2f')](_0x538cb7,function(_0x194a61){if(_0x194a61[_0x4762('0x3c')]!==_0x4762('0x3d')){if(_0x4f4033){return sequelize['where'](sequelize['fn'](_0x4762('0x3e'),sequelize['col'](_0x194a61[_0x4762('0x30')])),{'$like':sequelize['fn'](_0x4762('0x3e'),'%'+_0x5686e4[_0x4762('0x2c')][_0x4762('0x37')]+'%')});}else{var _0x14f417={};_0x14f417[_0x194a61[_0x4762('0x30')]]={'$like':'%'+_0x5686e4['query'][_0x4762('0x37')]+'%'};return _0x14f417;}}})});}_0x2e1fce=_['merge']({},_0x2e1fce,_0x5686e4[_0x4762('0x3f')]);return _0x2e1fce;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 95cfe6c..6e29810 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dc9=['root','development','test','client','use','json\x20replacer','toISOString','split','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','default','get','env','production','set','appPath','join'];(function(_0x4648ff,_0x582172){var _0x26070b=function(_0x370de5){while(--_0x370de5){_0x4648ff['push'](_0x4648ff['shift']());}};_0x26070b(++_0x582172);}(_0x4dc9,0xe4));var _0x94dc=function(_0x255bcc,_0x53cf02){_0x255bcc=_0x255bcc-0x0;var _0x2797cf=_0x4dc9[_0x255bcc];return _0x2797cf;};'use strict';var express=require(_0x94dc('0x0'));var favicon=require(_0x94dc('0x1'));var bodyParser=require(_0x94dc('0x2'));var methodOverride=require(_0x94dc('0x3'));var cookieParser=require(_0x94dc('0x4'));var errorHandler=require(_0x94dc('0x5'));var path=require(_0x94dc('0x6'));var passport=require(_0x94dc('0x7'));var cors=require(_0x94dc('0x8'));var moment=require(_0x94dc('0x9'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0x94dc('0xa')]=function(_0x147ac5){var _0x3bb95a=_0x147ac5[_0x94dc('0xb')](_0x94dc('0xc'));if(_0x3bb95a===_0x94dc('0xd')){_0x147ac5[_0x94dc('0xe')](_0x94dc('0xf'),path[_0x94dc('0x10')](config[_0x94dc('0x11')],'public'));}if(_0x3bb95a===_0x94dc('0x12')||_0x3bb95a===_0x94dc('0x13')){_0x147ac5[_0x94dc('0xe')](_0x94dc('0xf'),path[_0x94dc('0x10')](config[_0x94dc('0x11')],_0x94dc('0x14')));_0x147ac5[_0x94dc('0x15')](errorHandler());}_0x147ac5[_0x94dc('0xe')](_0x94dc('0x16'),function(_0x48e8f8,_0x4ef38b){if(this[_0x48e8f8]instanceof Date){_0x4ef38b=this[_0x48e8f8][_0x94dc('0x17')]()[_0x94dc('0x18')]('.')[0x0]+'Z';}return _0x4ef38b;});_0x147ac5[_0x94dc('0x15')](express['static'](_0x147ac5[_0x94dc('0xb')](_0x94dc('0xf'))));_0x147ac5[_0x94dc('0xe')](_0x94dc('0x19'),config['root']+_0x94dc('0x1a'));_0x147ac5[_0x94dc('0x1b')](_0x94dc('0x1c'),require(_0x94dc('0x1d'))[_0x94dc('0x1e')]);_0x147ac5[_0x94dc('0xe')](_0x94dc('0x1f'),_0x94dc('0x1c'));_0x147ac5[_0x94dc('0x15')](bodyParser[_0x94dc('0x20')]({'limit':_0x94dc('0x21'),'extended':!![]}));_0x147ac5[_0x94dc('0x15')](bodyParser['json']({'limit':_0x94dc('0x21')}));_0x147ac5[_0x94dc('0x15')](cors());_0x147ac5['use'](methodOverride());_0x147ac5[_0x94dc('0x15')](cookieParser());_0x147ac5[_0x94dc('0x15')](passport[_0x94dc('0x22')]());}; \ No newline at end of file +var _0xf890=['toISOString','split','static','appPath','/server/views','engine','view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','cors','../mysqldb','default','production','root','public','development','test','set','join','client','use','json\x20replacer'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xf890,0x1b0));var _0x0f89=function(_0x1cab82,_0x4bc7c8){_0x1cab82=_0x1cab82-0x0;var _0x5c5c4b=_0xf890[_0x1cab82];return _0x5c5c4b;};'use strict';var express=require(_0x0f89('0x0'));var favicon=require(_0x0f89('0x1'));var bodyParser=require(_0x0f89('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x0f89('0x3'));var errorHandler=require(_0x0f89('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0x0f89('0x5'));var moment=require('moment');var config=require('./environment');var db=require(_0x0f89('0x6'))['db'];exports[_0x0f89('0x7')]=function(_0x4d55a5){var _0x417202=_0x4d55a5['get']('env');if(_0x417202===_0x0f89('0x8')){_0x4d55a5['set']('appPath',path['join'](config[_0x0f89('0x9')],_0x0f89('0xa')));}if(_0x417202===_0x0f89('0xb')||_0x417202===_0x0f89('0xc')){_0x4d55a5[_0x0f89('0xd')]('appPath',path[_0x0f89('0xe')](config[_0x0f89('0x9')],_0x0f89('0xf')));_0x4d55a5[_0x0f89('0x10')](errorHandler());}_0x4d55a5[_0x0f89('0xd')](_0x0f89('0x11'),function(_0x22d2d6,_0x26215c){if(this[_0x22d2d6]instanceof Date){_0x26215c=this[_0x22d2d6][_0x0f89('0x12')]()[_0x0f89('0x13')]('.')[0x0]+'Z';}return _0x26215c;});_0x4d55a5[_0x0f89('0x10')](express[_0x0f89('0x14')](_0x4d55a5['get'](_0x0f89('0x15'))));_0x4d55a5['set']('views',config['root']+_0x0f89('0x16'));_0x4d55a5[_0x0f89('0x17')]('html',require('ejs')['renderFile']);_0x4d55a5['set'](_0x0f89('0x18'),_0x0f89('0x19'));_0x4d55a5[_0x0f89('0x10')](bodyParser[_0x0f89('0x1a')]({'limit':_0x0f89('0x1b'),'extended':!![]}));_0x4d55a5[_0x0f89('0x10')](bodyParser[_0x0f89('0x1c')]({'limit':_0x0f89('0x1b')}));_0x4d55a5[_0x0f89('0x10')](cors());_0x4d55a5[_0x0f89('0x10')](methodOverride());_0x4d55a5['use'](cookieParser());_0x4d55a5[_0x0f89('0x10')](passport[_0x0f89('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e1aeef9..5b9ec1f 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 _0x3dc7=['127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','digest','substring','lodash','crypto','child_process','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3dc7,0x163));var _0x73dc=function(_0x5a6cdb,_0x5bf25a){_0x5a6cdb=_0x5a6cdb-0x0;var _0x32a56f=_0x3dc7[_0x5a6cdb];return _0x32a56f;};'use strict';var _=require(_0x73dc('0x0'));var os=require('os');var crypto=require(_0x73dc('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x73dc('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x48fecc=[];var _0x15f496=os[_0x73dc('0x3')]();var _0x144e4=_[_0x73dc('0x4')](_[_0x73dc('0x5')](_0x15f496));for(var _0x83e8c9=0x0;_0x83e8c9<_0x144e4[_0x73dc('0x6')];_0x83e8c9++){var _0x154e06=_0x15f496[_0x144e4[_0x83e8c9]][_0x73dc('0x7')](function(_0x34f549){return _0x34f549[_0x73dc('0x8')]===_0x73dc('0x9')&&_0x34f549['internal']===![];});_0x48fecc=_0x48fecc[_0x73dc('0xa')](_0x154e06);}return _0x48fecc;}function getFirstInterface(){var _0x2f4f12=_[_0x73dc('0xb')](getInterfaces());return{'macAddress':_0x2f4f12&&_0x2f4f12[_0x73dc('0xc')]?_0x2f4f12[_0x73dc('0xc')]:_0x73dc('0xd'),'ipAddress':_0x2f4f12&&_0x2f4f12[_0x73dc('0xe')]?_0x2f4f12[_0x73dc('0xe')]:_0x73dc('0xf')};}exports[_0x73dc('0x10')]=getFirstInterface;function getCPUhash(){var _0x57ce38=_[_0x73dc('0x4')](os[_0x73dc('0x11')]()[_0x73dc('0x12')](function(_0xf56ecc){return _0xf56ecc[_0x73dc('0x13')];}))[_0x73dc('0x14')](':');return crypto[_0x73dc('0x15')](_0x73dc('0x16'))[_0x73dc('0x17')](_0x57ce38)['digest'](_0x73dc('0x18'));}exports[_0x73dc('0x19')]=function(){var _0x56abc0=os[_0x73dc('0x1a')]();var _0x4d0453=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4d0453[_0x73dc('0x1b')](config[_0x73dc('0x1c')])){return config[_0x73dc('0x1c')];}else if(_0x56abc0===_0x73dc('0x1d')){return exec(_0x73dc('0x1e'),{'encoding':_0x73dc('0x1f')})[_0x73dc('0x20')]('\x0d\x0a','');}else{var _0x44cdae=getFirstInterface();var _0x1f21c4=getCPUhash();var _0x467439=_0x1f21c4+'|'+os[_0x73dc('0x21')]()+'|'+_0x44cdae[_0x73dc('0x22')]+'|'+_0x44cdae['ipAddress'];var _0x1c84ee=crypto[_0x73dc('0x15')](_0x73dc('0x16'))[_0x73dc('0x17')](_0x467439)[_0x73dc('0x23')](_0x73dc('0x18'));return _0x1c84ee[_0x73dc('0x24')](0x0,0x8)+'-'+_0x1c84ee[_0x73dc('0x24')](0x8,0xc)+'-'+_0x1c84ee['substring'](0xc,0x10)+'-'+_0x1c84ee['substring'](0x10,0x14)+'-'+_0x1c84ee[_0x73dc('0x24')](0x14);}}; \ No newline at end of file +var _0x6103=['substring','lodash','crypto','execSync','../environment','orderBy','keys','length','filter','family','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','digest','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','md5','update','hex'];(function(_0x33cb6c,_0x160f6e){var _0x5c0ab7=function(_0x564ca3){while(--_0x564ca3){_0x33cb6c['push'](_0x33cb6c['shift']());}};_0x5c0ab7(++_0x160f6e);}(_0x6103,0xd3));var _0x3610=function(_0x42a80c,_0x2c53d7){_0x42a80c=_0x42a80c-0x0;var _0x55d557=_0x6103[_0x42a80c];return _0x55d557;};'use strict';var _=require(_0x3610('0x0'));var os=require('os');var crypto=require(_0x3610('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x3610('0x2')];var config=require(_0x3610('0x3'));function getInterfaces(){var _0x26c282=[];var _0x21f531=os['networkInterfaces']();var _0x5b8778=_[_0x3610('0x4')](_[_0x3610('0x5')](_0x21f531));for(var _0x348302=0x0;_0x348302<_0x5b8778[_0x3610('0x6')];_0x348302++){var _0x56dfea=_0x21f531[_0x5b8778[_0x348302]][_0x3610('0x7')](function(_0x1e8bda){return _0x1e8bda[_0x3610('0x8')]==='IPv4'&&_0x1e8bda['internal']===![];});_0x26c282=_0x26c282[_0x3610('0x9')](_0x56dfea);}return _0x26c282;}function getFirstInterface(){var _0xee28bb=_[_0x3610('0xa')](getInterfaces());return{'macAddress':_0xee28bb&&_0xee28bb['mac']?_0xee28bb[_0x3610('0xb')]:_0x3610('0xc'),'ipAddress':_0xee28bb&&_0xee28bb[_0x3610('0xd')]?_0xee28bb[_0x3610('0xd')]:_0x3610('0xe')};}exports[_0x3610('0xf')]=getFirstInterface;function getCPUhash(){var _0x74ae8f=_[_0x3610('0x4')](os[_0x3610('0x10')]()[_0x3610('0x11')](function(_0x1c599f){return _0x1c599f[_0x3610('0x12')];}))[_0x3610('0x13')](':');return crypto[_0x3610('0x14')]('md5')['update'](_0x74ae8f)[_0x3610('0x15')]('hex');}exports[_0x3610('0x16')]=function(){var _0x3e43e2=os[_0x3610('0x17')]();var _0x4453a2=/[0-9a-f-]{36}/;if(config[_0x3610('0x18')]&&_0x4453a2['test'](config[_0x3610('0x18')])){return config[_0x3610('0x18')];}else if(_0x3e43e2===_0x3610('0x19')){return exec(_0x3610('0x1a'),{'encoding':'utf8'})[_0x3610('0x1b')]('\x0d\x0a','');}else{var _0x37fbce=getFirstInterface();var _0x1f36cd=getCPUhash();var _0x2be6d9=_0x1f36cd+'|'+os[_0x3610('0x1c')]()+'|'+_0x37fbce[_0x3610('0x1d')]+'|'+_0x37fbce[_0x3610('0x1e')];var _0x48ce8b=crypto[_0x3610('0x14')](_0x3610('0x1f'))[_0x3610('0x20')](_0x2be6d9)['digest'](_0x3610('0x21'));return _0x48ce8b[_0x3610('0x22')](0x0,0x8)+'-'+_0x48ce8b['substring'](0x8,0xc)+'-'+_0x48ce8b[_0x3610('0x22')](0xc,0x10)+'-'+_0x48ce8b[_0x3610('0x22')](0x10,0x14)+'-'+_0x48ce8b['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 42382e3..e4a2aff 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 _0x3c9a=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','moment','request-promise','pkginfo','../../mysqldb','../../components/encryptor','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','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','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x4f1c38,_0x382f04){var _0x1dddfb=function(_0x4dbe81){while(--_0x4dbe81){_0x4f1c38['push'](_0x4f1c38['shift']());}};_0x1dddfb(++_0x382f04);}(_0x3c9a,0x182));var _0xa3c9=function(_0x3915e6,_0x5039e9){_0x3915e6=_0x3915e6-0x0;var _0x1afb59=_0x3c9a[_0x3915e6];return _0x1afb59;};'use strict';var util=require('util');var moment=require(_0xa3c9('0x0'));var rp=require(_0xa3c9('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xa3c9('0x2'))(module,'version');var db=require(_0xa3c9('0x3'))['db'];var encryptor=require(_0xa3c9('0x4'));var hardware=require('./hardware');var logger=require('../logger')(_0xa3c9('0x5'));var HOST=_0xa3c9('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1b4690){return new BPromise(function(_0xc0b8cc,_0x24fde5){var _0x18fdae=util[_0xa3c9('0x7')](_0xa3c9('0x8'),HOST,_0x1b4690,module[_0xa3c9('0x9')][_0xa3c9('0xa')]);if(oldToken){_0x18fdae=util[_0xa3c9('0x7')](_0xa3c9('0xb'),HOST,_0x1b4690,module[_0xa3c9('0x9')][_0xa3c9('0xa')],oldToken);}var _0x3f3ac5={'uri':_0x18fdae,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3f3ac5)[_0xa3c9('0xc')](function(_0x59dd9c){_0xc0b8cc(_0x59dd9c);})[_0xa3c9('0xd')](function(_0x370b9d){_0x24fde5(_0x370b9d);});});}function manageLicense(_0x17a734,_0x18b066){var _0x576b04=_0x18b066['get']({'plain':!![]});if(!isOldTokenSent&&_0x576b04[_0xa3c9('0xe')]!==_0x17a734&&!_0x576b04[_0xa3c9('0xf')]){oldToken=_0x576b04[_0xa3c9('0xe')];}httpRequest(_0x17a734)['then'](function(_0x2e30cd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2e30cd[_0xa3c9('0x10')]){isOldTokenSent=![];if(!_0x576b04[_0xa3c9('0x5')]&&_0x576b04[_0xa3c9('0x5')]!=_0x2e30cd[_0xa3c9('0x5')]||_0x576b04['license']&&_0x576b04[_0xa3c9('0xf')]){logger[_0xa3c9('0x11')](_0xa3c9('0x12'));}if(_0x576b04[_0xa3c9('0x5')]&&!_0x576b04[_0xa3c9('0xf')]&&_0x576b04['license']!=_0x2e30cd[_0xa3c9('0x5')]){logger[_0xa3c9('0x11')](_0xa3c9('0x13'));}if(_0x576b04[_0xa3c9('0x5')]&&!_0x576b04[_0xa3c9('0xf')]&&_0x576b04[_0xa3c9('0x5')]==_0x2e30cd[_0xa3c9('0x5')]){return _0x18b066;}return _0x18b066[_0xa3c9('0x14')]({'data1':_0x17a734,'data2':null,'license':_0x2e30cd[_0xa3c9('0x5')]});}else{if(_0x2e30cd['license']||_0x576b04[_0xa3c9('0x5')]){if(!_0x576b04[_0xa3c9('0xf')]){if(_0x576b04['data1']==_0x17a734){GRAY_PERIOD_REASON=_0xa3c9('0x15');logger['info'](_0xa3c9('0x16'));}else{GRAY_PERIOD_REASON=_0xa3c9('0x17');logger[_0xa3c9('0x11')](_0xa3c9('0x18'),_0x576b04[_0xa3c9('0xe')],_0x17a734);}logger[_0xa3c9('0x11')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xa3c9('0x19')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x18b066[_0xa3c9('0x14')]({'data2':encryptor[_0xa3c9('0x1a')](moment()[_0xa3c9('0x7')](_0xa3c9('0x1b')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x576b04['data2']),_0xa3c9('0x1c'))>DAYS){logger[_0xa3c9('0x11')](_0xa3c9('0x1d'),moment()[_0xa3c9('0x7')](_0xa3c9('0x1b')));isOldTokenSent=![];return _0x18b066[_0xa3c9('0x14')]({'data1':_0x17a734,'data2':null,'license':null});}}}else{if(_0x576b04[_0xa3c9('0xe')]!=_0x17a734){logger['info'](_0xa3c9('0x18'),_0x576b04[_0xa3c9('0xe')],_0x17a734);return _0x18b066['update']({'data1':_0x17a734,'data2':null,'license':null});}}}return _0x18b066;})[_0xa3c9('0xc')](function(_0x5e1c8c){_0x18b066=_0x5e1c8c;})[_0xa3c9('0xd')](function(_0x45f347){logger[_0xa3c9('0x1e')](_0x45f347[_0xa3c9('0x1f')]);})[_0xa3c9('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xa3c9('0x21')](),_0x18b066);},TIME);});}function defaultLicense(){var _0x4523d7=hardware['getUuid']();if(_0x4523d7){return db[_0xa3c9('0x22')][_0xa3c9('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x4523d7}})[_0xa3c9('0x24')](function(_0x16a9ee,_0x4ed480){logger[_0xa3c9('0x11')](_0xa3c9('0x25'),_0x4523d7);manageLicense(_0x4523d7,_0x16a9ee);})[_0xa3c9('0xd')](function(_0x625345){logger[_0xa3c9('0x1e')](_0x625345[_0xa3c9('0x1f')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x44f0=['update','encryptString','diff','decryptString','days','error','message','finally','getUuid','License','findOrCreate','spread','default','util','moment','request-promise','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','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','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x44f0,0x1b1));var _0x044f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x44f0[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x044f('0x0'));var moment=require(_0x044f('0x1'));var rp=require(_0x044f('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x044f('0x3'))(module,'version');var db=require(_0x044f('0x4'))['db'];var encryptor=require(_0x044f('0x5'));var hardware=require(_0x044f('0x6'));var logger=require('../logger')(_0x044f('0x7'));var HOST=_0x044f('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1d4641){return new BPromise(function(_0x159052,_0x105f87){var _0x380335=util[_0x044f('0x9')](_0x044f('0xa'),HOST,_0x1d4641,module['exports'][_0x044f('0xb')]);if(oldToken){_0x380335=util[_0x044f('0x9')](_0x044f('0xc'),HOST,_0x1d4641,module[_0x044f('0xd')]['version'],oldToken);}var _0x4df7f0={'uri':_0x380335,'method':_0x044f('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x4df7f0)[_0x044f('0xf')](function(_0x52c2a4){_0x159052(_0x52c2a4);})[_0x044f('0x10')](function(_0x16efbb){_0x105f87(_0x16efbb);});});}function manageLicense(_0x472607,_0x4c8355){var _0x130852=_0x4c8355[_0x044f('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x130852[_0x044f('0x12')]!==_0x472607&&!_0x130852['data2']){oldToken=_0x130852['data1'];}httpRequest(_0x472607)[_0x044f('0xf')](function(_0x37df8b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37df8b['active']){isOldTokenSent=![];if(!_0x130852[_0x044f('0x7')]&&_0x130852[_0x044f('0x7')]!=_0x37df8b['license']||_0x130852[_0x044f('0x7')]&&_0x130852[_0x044f('0x13')]){logger[_0x044f('0x14')](_0x044f('0x15'));}if(_0x130852[_0x044f('0x7')]&&!_0x130852[_0x044f('0x13')]&&_0x130852[_0x044f('0x7')]!=_0x37df8b['license']){logger[_0x044f('0x14')](_0x044f('0x16'));}if(_0x130852[_0x044f('0x7')]&&!_0x130852[_0x044f('0x13')]&&_0x130852[_0x044f('0x7')]==_0x37df8b[_0x044f('0x7')]){return _0x4c8355;}return _0x4c8355['update']({'data1':_0x472607,'data2':null,'license':_0x37df8b[_0x044f('0x7')]});}else{if(_0x37df8b[_0x044f('0x7')]||_0x130852[_0x044f('0x7')]){if(!_0x130852[_0x044f('0x13')]){if(_0x130852['data1']==_0x472607){GRAY_PERIOD_REASON=_0x044f('0x17');logger['info'](_0x044f('0x18'));}else{GRAY_PERIOD_REASON=_0x044f('0x19');logger[_0x044f('0x14')](_0x044f('0x1a'),_0x130852[_0x044f('0x12')],_0x472607);}logger[_0x044f('0x14')](_0x044f('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x044f('0x9')](_0x044f('0x1c')));return _0x4c8355[_0x044f('0x1d')]({'data2':encryptor[_0x044f('0x1e')](moment()[_0x044f('0x9')](_0x044f('0x1c')))});}else{if(moment()[_0x044f('0x1f')](encryptor[_0x044f('0x20')](_0x130852['data2']),_0x044f('0x21'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x044f('0x9')](_0x044f('0x1c')));isOldTokenSent=![];return _0x4c8355[_0x044f('0x1d')]({'data1':_0x472607,'data2':null,'license':null});}}}else{if(_0x130852[_0x044f('0x12')]!=_0x472607){logger['info'](_0x044f('0x1a'),_0x130852[_0x044f('0x12')],_0x472607);return _0x4c8355[_0x044f('0x1d')]({'data1':_0x472607,'data2':null,'license':null});}}}return _0x4c8355;})['then'](function(_0x59e7be){_0x4c8355=_0x59e7be;})[_0x044f('0x10')](function(_0x5681b0){logger[_0x044f('0x22')](_0x5681b0[_0x044f('0x23')]);})[_0x044f('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x044f('0x25')](),_0x4c8355);},TIME);});}function defaultLicense(){var _0x57fd5b=hardware[_0x044f('0x25')]();if(_0x57fd5b){return db[_0x044f('0x26')][_0x044f('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x57fd5b}})[_0x044f('0x28')](function(_0x2bc05f,_0x3aa4cc){logger[_0x044f('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x57fd5b);manageLicense(_0x57fd5b,_0x2bc05f);})[_0x044f('0x10')](function(_0x557dcf){logger[_0x044f('0x22')](_0x557dcf[_0x044f('0x23')]);});}}exports[_0x044f('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9a82a5e..bb797bd 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 _0xb684=['then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','days','machineUuid','changed','disabled','message','User','findAll','sequelize','COUNT','col','role','admin','telephone','users','telephones','forEach','user','count','pick','countBy','util','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','defaults'];(function(_0x36daf3,_0x2ea0dd){var _0x3e4e26=function(_0x31999a){while(--_0x31999a){_0x36daf3['push'](_0x36daf3['shift']());}};_0x3e4e26(++_0x2ea0dd);}(_0xb684,0x12b));var _0x4b68=function(_0x352da8,_0x4d9054){_0x352da8=_0x352da8-0x0;var _0x2cdeae=_0xb684[_0x352da8];return _0x2cdeae;};'use strict';var util=require(_0x4b68('0x0'));var _=require('lodash');var moment=require(_0x4b68('0x1'));var BPromise=require(_0x4b68('0x2'));var hardware=require(_0x4b68('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b68('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x4b68('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b68('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4b68('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x539628){return new BPromise(function(_0x46a827,_0x421b67){return db['License'][_0x4b68('0x7')](_[_0x4b68('0x8')](_0x539628,{'raw':!![],'where':{'id':0x1}}))[_0x4b68('0x9')](function(_0x2c76a7){return checkLicense(_0x2c76a7,null);})['then'](function(_0x1d0eaa){_0x46a827(_0x1d0eaa);return;})[_0x4b68('0xa')](function(_0x8bbd3d){_0x421b67(_0x8bbd3d);});});}function checkLicense(_0x3270c6,_0x42f41d){if(!_0x3270c6){demoLicense[_0x4b68('0xb')]=_0x3270c6[_0x4b68('0xc')];return demoLicense;}try{var _0x404e48=_0x42f41d||_0x3270c6[_0x4b68('0xd')];if(_[_0x4b68('0xe')](_0x404e48)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x157381=_0x3270c6[_0x4b68('0xc')];var _0x23663a=_0x3270c6[_0x4b68('0xf')];var _0x172544=_0x157381[_0x4b68('0x10')]('-')[0x4];var _0x4c6fe6=_0x157381[_0x4b68('0x10')]('-')[0x0];var _0x2cf725=encryptor[_0x4b68('0x11')](_0x404e48,util[_0x4b68('0x12')](_0x4b68('0x13'),_0x172544,_0x157381,_0x4c6fe6));var _0x3bc5a9=JSON[_0x4b68('0x14')](_0x2cf725);_0x3bc5a9[_0x4b68('0x15')]=![];_0x3bc5a9[_0x4b68('0xb')]=_0x157381;_0x3bc5a9['machineUuid']=hardware[_0x4b68('0x5')]();if(_0x23663a){var _0x5aa5bf=encryptor[_0x4b68('0x11')](_0x23663a);_0x3bc5a9[_0x4b68('0x16')]=_0x5aa5bf;_0x3bc5a9[_0x4b68('0x17')]=moment(_0x5aa5bf)['add'](0x7,_0x4b68('0x18'))[_0x4b68('0x12')]();_0x3bc5a9['grayReason']=_0x3bc5a9[_0x4b68('0xb')]!=_0x3bc5a9[_0x4b68('0x19')]?_0x4b68('0x1a'):_0x4b68('0x1b');}return _0x3bc5a9;}catch(_0x4b1f15){breakingLicense[_0x4b68('0xb')]=_0x3270c6[_0x4b68('0xc')];breakingLicense[_0x4b68('0x1c')]=_0x4b1f15[_0x4b68('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2c14a2,_0x518be3){getLicense()[_0x4b68('0x9')](function(_0x190535){return db[_0x4b68('0x1d')][_0x4b68('0x1e')]({'attributes':['role',[db[_0x4b68('0x1f')]['fn'](_0x4b68('0x20'),db[_0x4b68('0x1f')][_0x4b68('0x21')](_0x4b68('0x22'))),'count']],'group':_0x4b68('0x22'),'where':{'role':{'$or':[_0x4b68('0x23'),'user',_0x4b68('0x24')]}},'raw':!![]})['then'](function(_0x51e87b){var _0x1ab221={'user':_0x190535[_0x4b68('0x25')]||0x0,'telephone':_0x190535[_0x4b68('0x26')]||0x0};_0x51e87b[_0x4b68('0x27')](function(_0x53667a){var _0x38084c=_0x53667a[_0x4b68('0x22')]===_0x4b68('0x23')?_0x4b68('0x28'):_0x53667a['role'];_0x1ab221[_0x38084c]-=_0x53667a[_0x4b68('0x29')];if(_0x1ab221[_0x38084c]<0x0)_0x1ab221[_0x38084c]=0x0;});_0x2c14a2(_0x1ab221);return;});})[_0x4b68('0xa')](function(_0x4176a2){_0x518be3(_0x4176a2);});});}function checkUserLimits(_0x3d43bb){return new BPromise(function(_0x1225c7,_0x36b77d){getLimits()[_0x4b68('0x9')](function(_0x5091aa){var _0x3e4631=_[_0x4b68('0x2a')](_[_0x4b68('0x2b')](_0x3d43bb,_0x4b68('0x22')),[_0x4b68('0x23'),'user',_0x4b68('0x24')]);var _0x12ea4f=(_0x3e4631[_0x4b68('0x23')]||0x0)+(_0x3e4631['user']||0x0);var _0x4ceb1e=_0x3e4631[_0x4b68('0x24')]||0x0;if(_0x12ea4f>_0x5091aa[_0x4b68('0x28')])return _0x36b77d('License\x20limit\x20reached\x20for\x20users');if(_0x4ceb1e>_0x5091aa['telephone'])return _0x36b77d('License\x20limit\x20reached\x20for\x20telephones');return _0x1225c7();})[_0x4b68('0xa')](function(_0x505f8e){_0x36b77d(_0x505f8e);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb14e=['message','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','format','%s:%s:%s','machineUuid','add','days'];(function(_0x32b9c5,_0xaa9456){var _0x3deede=function(_0x536437){while(--_0x536437){_0x32b9c5['push'](_0x32b9c5['shift']());}};_0x3deede(++_0xaa9456);}(_0xb14e,0xb1));var _0xeb14=function(_0x488897,_0x4880b7){_0x488897=_0x488897-0x0;var _0x12b378=_0xb14e[_0x488897];return _0x12b378;};'use strict';var util=require('util');var _=require(_0xeb14('0x0'));var moment=require(_0xeb14('0x1'));var BPromise=require(_0xeb14('0x2'));var hardware=require(_0xeb14('0x3'));var encryptor=require(_0xeb14('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeb14('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xeb14('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeb14('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xeb14('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xd6dccc){return new BPromise(function(_0x12edce,_0x8a5ebd){return db['License'][_0xeb14('0x8')](_['defaults'](_0xd6dccc,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3b6e90){return checkLicense(_0x3b6e90,null);})[_0xeb14('0x9')](function(_0x5c6b59){_0x12edce(_0x5c6b59);return;})[_0xeb14('0xa')](function(_0x421075){_0x8a5ebd(_0x421075);});});}function checkLicense(_0x2f574c,_0x3e3d6f){if(!_0x2f574c){demoLicense[_0xeb14('0xb')]=_0x2f574c['data1'];return demoLicense;}try{var _0x162f31=_0x3e3d6f||_0x2f574c[_0xeb14('0xc')];if(_[_0xeb14('0xd')](_0x162f31)){throw new Error(_0xeb14('0xe'));}var _0x1446b9=_0x2f574c[_0xeb14('0xf')];var _0x4c5eae=_0x2f574c[_0xeb14('0x10')];var _0x1f5999=_0x1446b9[_0xeb14('0x11')]('-')[0x4];var _0x71cfd6=_0x1446b9[_0xeb14('0x11')]('-')[0x0];var _0x3ec113=encryptor['decryptString'](_0x162f31,util[_0xeb14('0x12')](_0xeb14('0x13'),_0x1f5999,_0x1446b9,_0x71cfd6));var _0x390e36=JSON['parse'](_0x3ec113);_0x390e36['demo']=![];_0x390e36['uuid']=_0x1446b9;_0x390e36[_0xeb14('0x14')]=hardware[_0xeb14('0x6')]();if(_0x4c5eae){var _0x3ec68b=encryptor['decryptString'](_0x4c5eae);_0x390e36['gray']=_0x3ec68b;_0x390e36['deadline']=moment(_0x3ec68b)[_0xeb14('0x15')](0x7,_0xeb14('0x16'))[_0xeb14('0x12')]();_0x390e36['grayReason']=_0x390e36[_0xeb14('0xb')]!=_0x390e36[_0xeb14('0x14')]?'changed':'disabled';}return _0x390e36;}catch(_0x2df245){breakingLicense['uuid']=_0x2f574c[_0xeb14('0xf')];breakingLicense[_0xeb14('0x17')]=_0x2df245[_0xeb14('0x17')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xc929d2,_0x1cdda6){getLicense()['then'](function(_0x4ab4a2){return db[_0xeb14('0x18')][_0xeb14('0x19')]({'attributes':['role',[db[_0xeb14('0x1a')]['fn'](_0xeb14('0x1b'),db['sequelize'][_0xeb14('0x1c')](_0xeb14('0x1d'))),_0xeb14('0x1e')]],'group':'role','where':{'role':{'$or':[_0xeb14('0x1f'),_0xeb14('0x20'),_0xeb14('0x21')]}},'raw':!![]})[_0xeb14('0x9')](function(_0x4cfa33){var _0x4db13b={'user':_0x4ab4a2[_0xeb14('0x22')]||0x0,'telephone':_0x4ab4a2[_0xeb14('0x23')]||0x0};_0x4cfa33[_0xeb14('0x24')](function(_0x5b72b7){var _0xa929b6=_0x5b72b7[_0xeb14('0x1d')]==='admin'?'user':_0x5b72b7['role'];_0x4db13b[_0xa929b6]-=_0x5b72b7['count'];if(_0x4db13b[_0xa929b6]<0x0)_0x4db13b[_0xa929b6]=0x0;});_0xc929d2(_0x4db13b);return;});})[_0xeb14('0xa')](function(_0xc140c3){_0x1cdda6(_0xc140c3);});});}function checkUserLimits(_0x2f43f7){return new BPromise(function(_0x4dcaf4,_0x4a834e){getLimits()[_0xeb14('0x9')](function(_0x123f2b){var _0x4376c6=_['pick'](_[_0xeb14('0x25')](_0x2f43f7,_0xeb14('0x1d')),[_0xeb14('0x1f'),_0xeb14('0x20'),_0xeb14('0x21')]);var _0xa72d5c=(_0x4376c6['admin']||0x0)+(_0x4376c6[_0xeb14('0x20')]||0x0);var _0x16be2f=_0x4376c6[_0xeb14('0x21')]||0x0;if(_0xa72d5c>_0x123f2b[_0xeb14('0x20')])return _0x4a834e(_0xeb14('0x26'));if(_0x16be2f>_0x123f2b['telephone'])return _0x4a834e('License\x20limit\x20reached\x20for\x20telephones');return _0x4dcaf4();})['catch'](function(_0x593498){_0x4a834e(_0x593498);});});}module[_0xeb14('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index c09af6d..c1a7dba 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 _0x896e=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x217884,_0x317700){var _0xecd9c2=function(_0x5914f9){while(--_0x5914f9){_0x217884['push'](_0x217884['shift']());}};_0xecd9c2(++_0x317700);}(_0x896e,0x1e9));var _0xe896=function(_0x16d101,_0x2b570f){_0x16d101=_0x16d101-0x0;var _0x5e4c92=_0x896e[_0x16d101];return _0x5e4c92;};'use strict';module[_0xe896('0x0')]={'DOMAIN':_0xe896('0x1'),'SESSION_SECRET':_0xe896('0x2'),'GOOGLE_ID':_0xe896('0x3'),'GOOGLE_SECRET':_0xe896('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xdd4f=['exports','secret'];(function(_0x3f3a3a,_0x2dceb0){var _0x509e89=function(_0x5c2877){while(--_0x5c2877){_0x3f3a3a['push'](_0x3f3a3a['shift']());}};_0x509e89(++_0x2dceb0);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1dd5ab,_0x51339f){_0x1dd5ab=_0x1dd5ab-0x0;var _0x2ffe9f=_0xdd4f[_0x1dd5ab];return _0x2ffe9f;};'use strict';module[_0xfdd4('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfdd4('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9ac3518..71fb8ce 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa53b=['level','Logger','transports','%s-%s','error','info','Console','env','debugLevel','winston','util','xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a5f9c,_0xc934b){var _0x4b3fad=function(_0x97f422){while(--_0x97f422){_0x2a5f9c['push'](_0x2a5f9c['shift']());}};_0x4b3fad(++_0xc934b);}(_0xa53b,0x81));var _0xba53=function(_0x574bb6,_0x2d3e3b){_0x574bb6=_0x574bb6-0x0;var _0x2da8db=_0xa53b[_0x574bb6];return _0x2da8db;};'use strict';var moment=require('moment');var winston=require(_0xba53('0x0'));var util=require(_0xba53('0x1'));var path=require('path');var debugLevel='INFO';function filename(_0x54dc46,_0x204cd8){return path['join']('/var','log',_0xba53('0x2'),util[_0xba53('0x3')](_0xba53('0x4'),_0x54dc46,_0x204cd8));}function formatter(_0x33826a,_0x7114ce){_0x7114ce[_0xba53('0x5')]=_0x7114ce['message']['replace'](/@@{/g,_0xba53('0x6'))[_0xba53('0x7')](/}@@/g,_0xba53('0x8'))['replace'](/@{/g,'{{')[_0xba53('0x7')](/}@/g,'}}');return util[_0xba53('0x3')](_0xba53('0x9'),moment()[_0xba53('0x3')](_0xba53('0xa')),_0x7114ce[_0xba53('0xb')]['toUpperCase'](),_0x33826a,_0x7114ce[_0xba53('0x5')]);}module['exports']=function(_0x2deddd){return new winston[(_0xba53('0xc'))]({'transports':[new winston[(_0xba53('0xd'))]['File']({'name':util['format'](_0xba53('0xe'),_0x2deddd,'error'),'filename':filename(_0x2deddd,'error'),'level':_0xba53('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29ae73){return formatter(_0x2deddd,_0x29ae73);}}),new winston[(_0xba53('0xd'))]['File']({'name':util[_0xba53('0x3')](_0xba53('0xe'),_0x2deddd,'info'),'filename':filename(_0x2deddd,_0xba53('0x10')),'level':_0xba53('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3b60b0){return formatter(_0x2deddd,_0x3b60b0);}}),new winston[(_0xba53('0xd'))][(_0xba53('0x11'))]({'level':process[_0xba53('0x12')][_0xba53('0x13')]||debugLevel,'json':![],'formatter':function(_0x572949){return formatter(_0x2deddd,_0x572949);}})]});}; \ No newline at end of file +var _0xd2c6=['Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','path','join','/var','message','replace','format','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0xd2c6,0x171));var _0x6d2c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd2c6[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0x6d2c('0x0'));var winston=require(_0x6d2c('0x1'));var util=require('util');var path=require(_0x6d2c('0x2'));var debugLevel='INFO';function filename(_0x4d0ac6,_0x2768e1){return path[_0x6d2c('0x3')](_0x6d2c('0x4'),'log','xcally',util['format']('%s-%s.log',_0x4d0ac6,_0x2768e1));}function formatter(_0x551cea,_0x5280dd){_0x5280dd[_0x6d2c('0x5')]=_0x5280dd[_0x6d2c('0x5')][_0x6d2c('0x6')](/@@{/g,'{{{')[_0x6d2c('0x6')](/}@@/g,'}}}')[_0x6d2c('0x6')](/@{/g,'{{')[_0x6d2c('0x6')](/}@/g,'}}');return util[_0x6d2c('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x6d2c('0x7')](_0x6d2c('0x8')),_0x5280dd['level'][_0x6d2c('0x9')](),_0x551cea,_0x5280dd['message']);}module[_0x6d2c('0xa')]=function(_0x5cd226){return new winston[(_0x6d2c('0xb'))]({'transports':[new winston[(_0x6d2c('0xc'))][(_0x6d2c('0xd'))]({'name':util[_0x6d2c('0x7')](_0x6d2c('0xe'),_0x5cd226,_0x6d2c('0xf')),'filename':filename(_0x5cd226,_0x6d2c('0xf')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14b2c2){return formatter(_0x5cd226,_0x14b2c2);}}),new winston[(_0x6d2c('0xc'))][(_0x6d2c('0xd'))]({'name':util[_0x6d2c('0x7')](_0x6d2c('0xe'),_0x5cd226,_0x6d2c('0x10')),'filename':filename(_0x5cd226,'info'),'level':_0x6d2c('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x215ca0){return formatter(_0x5cd226,_0x215ca0);}}),new winston['transports'][(_0x6d2c('0x11'))]({'level':process[_0x6d2c('0x12')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x403d2a){return formatter(_0x5cd226,_0x403d2a);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9f1f03b..2114857 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 _0x39d8=['path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x39d8,0x10a));var _0x839d=function(_0x406053,_0x3366c7){_0x406053=_0x406053-0x0;var _0x2d1875=_0x39d8[_0x406053];return _0x2d1875;};'use strict';var path=require(_0x839d('0x0'));var os=require('os');var config={'apps':[{'name':_0x839d('0x1'),'script':path[_0x839d('0x2')](__dirname,_0x839d('0x3'))},{'name':_0x839d('0x4'),'script':path[_0x839d('0x2')](__dirname,_0x839d('0x5'))},{'name':_0x839d('0x6'),'script':path[_0x839d('0x2')](__dirname,_0x839d('0x7'))},{'name':_0x839d('0x8'),'script':path[_0x839d('0x2')](__dirname,_0x839d('0x9'))},{'name':_0x839d('0xa'),'script':path[_0x839d('0x2')](__dirname,_0x839d('0xb'))},{'name':_0x839d('0xc'),'script':path['join'](__dirname,_0x839d('0xd'))}]};module['exports']=config; \ No newline at end of file +var _0x0445=['exports','path','../../services/express/index.js','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','xdr','../../services/xdr/index.js'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x0445,0xfb));var _0x5044=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x0445[_0x2c1114];return _0x2b877c;};'use strict';var path=require(_0x5044('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x5044('0x1'))},{'name':'ami','script':path[_0x5044('0x2')](__dirname,_0x5044('0x3'))},{'name':'agi','script':path[_0x5044('0x2')](__dirname,_0x5044('0x4'))},{'name':_0x5044('0x5'),'script':path[_0x5044('0x2')](__dirname,_0x5044('0x6'))},{'name':'routing','script':path[_0x5044('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x5044('0x7'),'script':path[_0x5044('0x2')](__dirname,_0x5044('0x8'))}]};module[_0x5044('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 6a78099..f79739b 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 _0x0fa1=['list','describe','delete','dump','saved','bluebird','./config','connect','connected','start','then','disconnect','restart'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x0fa1,0x1d9));var _0x10fa=function(_0x1e9790,_0x5a0687){_0x1e9790=_0x1e9790-0x0;var _0x4224a2=_0x0fa1[_0x1e9790];return _0x4224a2;};'use strict';var pm2=require('pm2');var BPromise=require(_0x10fa('0x0'));var config=require(_0x10fa('0x1'));function connect(){return new BPromise(function(_0x98e3db,_0x173966){return pm2[_0x10fa('0x2')](function(_0x4a3683){if(_0x4a3683){return _0x173966(_0x4a3683);}return _0x98e3db(_0x10fa('0x3'));});});};exports[_0x10fa('0x4')]=function(_0xb99271){return connect()['then'](function(){return new BPromise(function(_0x3288f3,_0x6803a2){return pm2[_0x10fa('0x4')](_0xb99271,function(_0x47a020,_0x339669){if(_0x47a020){return _0x6803a2(_0x47a020);}pm2['disconnect']();return _0x3288f3(_0x339669);});});});};exports['stop']=function(_0x46512e){return connect()[_0x10fa('0x5')](function(){return new BPromise(function(_0x523175,_0x15a072){return pm2['stop'](_0x46512e,function(_0x29628a,_0x5b9efd){if(_0x29628a){return _0x15a072(_0x29628a);}pm2[_0x10fa('0x6')]();return _0x523175(_0x5b9efd);});});});};exports[_0x10fa('0x7')]=function(_0x5bd6c2){return connect()[_0x10fa('0x5')](function(){return new BPromise(function(_0x4393cd,_0x22e494){return pm2[_0x10fa('0x7')](_0x5bd6c2,function(_0x27cd79,_0x37d324){if(_0x27cd79){return _0x22e494(_0x27cd79);}pm2[_0x10fa('0x6')]();return _0x4393cd(_0x37d324);});});});};exports[_0x10fa('0x8')]=function(){return connect()[_0x10fa('0x5')](function(){return new BPromise(function(_0x2e7952,_0x35b862){return pm2[_0x10fa('0x8')](function(_0x3e07f8,_0x2c6524){if(_0x3e07f8){return _0x35b862(_0x3e07f8);}pm2['disconnect']();return _0x2e7952(_0x2c6524);});});});};exports[_0x10fa('0x9')]=function(_0x28a8c9){return connect()['then'](function(){return new BPromise(function(_0x1345d6,_0x482ebb){return pm2[_0x10fa('0x9')](_0x28a8c9,function(_0x266b1a,_0x5314d7){if(_0x266b1a){return _0x482ebb(_0x266b1a);}pm2['disconnect']();return _0x1345d6(_0x5314d7);});});});};exports[_0x10fa('0xa')]=function(_0x169cf6){return connect()['then'](function(){return new BPromise(function(_0xb653ab,_0xdede1f){return pm2[_0x10fa('0xa')](_0x169cf6,function(_0x1d5c76,_0x2e5c69){if(_0x1d5c76){return _0xdede1f(_0x1d5c76);}pm2[_0x10fa('0x6')]();return _0xb653ab(_0x2e5c69);});});});};exports[_0x10fa('0xb')]=function(){return connect()[_0x10fa('0x5')](function(){return new BPromise(function(_0x2a7376,_0x3090af){return pm2[_0x10fa('0xb')](function(_0x6a8bca){if(_0x6a8bca){return _0x3090af(_0x6a8bca);}return _0x2a7376(_0x10fa('0xc'));});});});}; \ No newline at end of file +var _0x4a1e=['delete','dump','saved','pm2','bluebird','./config','connected','then','disconnect','stop','restart','list','describe'];(function(_0x372f7c,_0x2951fc){var _0x4ac601=function(_0x15a636){while(--_0x15a636){_0x372f7c['push'](_0x372f7c['shift']());}};_0x4ac601(++_0x2951fc);}(_0x4a1e,0x85));var _0xe4a1=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0x4a1e[_0x28578d];return _0x524826;};'use strict';var pm2=require(_0xe4a1('0x0'));var BPromise=require(_0xe4a1('0x1'));var config=require(_0xe4a1('0x2'));function connect(){return new BPromise(function(_0x4d3f31,_0x50d01a){return pm2['connect'](function(_0x1322c2){if(_0x1322c2){return _0x50d01a(_0x1322c2);}return _0x4d3f31(_0xe4a1('0x3'));});});};exports['start']=function(_0x18aa6e){return connect()[_0xe4a1('0x4')](function(){return new BPromise(function(_0x187504,_0x2e1377){return pm2['start'](_0x18aa6e,function(_0x3c7c81,_0x3338a8){if(_0x3c7c81){return _0x2e1377(_0x3c7c81);}pm2[_0xe4a1('0x5')]();return _0x187504(_0x3338a8);});});});};exports['stop']=function(_0x4ca7a7){return connect()['then'](function(){return new BPromise(function(_0x172e11,_0x4de75a){return pm2[_0xe4a1('0x6')](_0x4ca7a7,function(_0x3ba5e8,_0x1508c9){if(_0x3ba5e8){return _0x4de75a(_0x3ba5e8);}pm2[_0xe4a1('0x5')]();return _0x172e11(_0x1508c9);});});});};exports[_0xe4a1('0x7')]=function(_0x2f9c9c){return connect()[_0xe4a1('0x4')](function(){return new BPromise(function(_0x55ade2,_0x5b52b9){return pm2[_0xe4a1('0x7')](_0x2f9c9c,function(_0x2c7aad,_0x49b357){if(_0x2c7aad){return _0x5b52b9(_0x2c7aad);}pm2[_0xe4a1('0x5')]();return _0x55ade2(_0x49b357);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x31e08a,_0x173f26){return pm2[_0xe4a1('0x8')](function(_0x49ca63,_0x3718f5){if(_0x49ca63){return _0x173f26(_0x49ca63);}pm2[_0xe4a1('0x5')]();return _0x31e08a(_0x3718f5);});});});};exports['describe']=function(_0x4750d2){return connect()[_0xe4a1('0x4')](function(){return new BPromise(function(_0x1a1235,_0x10e255){return pm2[_0xe4a1('0x9')](_0x4750d2,function(_0xe2ce59,_0x569b28){if(_0xe2ce59){return _0x10e255(_0xe2ce59);}pm2[_0xe4a1('0x5')]();return _0x1a1235(_0x569b28);});});});};exports[_0xe4a1('0xa')]=function(_0x35c775){return connect()[_0xe4a1('0x4')](function(){return new BPromise(function(_0x5511de,_0xf867ca){return pm2[_0xe4a1('0xa')](_0x35c775,function(_0x30e0ec,_0x140770){if(_0x30e0ec){return _0xf867ca(_0x30e0ec);}pm2[_0xe4a1('0x5')]();return _0x5511de(_0x140770);});});});};exports[_0xe4a1('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x43fa69,_0x10be50){return pm2[_0xe4a1('0xb')](function(_0x349884){if(_0x349884){return _0x10be50(_0x349884);}return _0x43fa69(_0xe4a1('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 09d0e66..08554cb 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 _0x1755=['emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','localhost','redis','Setting','then','findAll','subtract','chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1755,0xee));var _0x5175=function(_0x73aa6b,_0x114afd){_0x73aa6b=_0x73aa6b-0x0;var _0x4ef125=_0x1755[_0x73aa6b];return _0x4ef125;};'use strict';var _=require(_0x5175('0x0'));var moment=require(_0x5175('0x1'));var Redis=require(_0x5175('0x2'));var util=require(_0x5175('0x3'));var config=require(_0x5175('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x5175('0x5'))(_0x5175('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x5175('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5175('0x8')]));function closeInteractions(){var _0x48c8ae=0x0;var _0x4f756d=[];return db[_0x5175('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x5175('0xa')](function(_0x2c1bc8){_0x48c8ae=_0x2c1bc8['chatTimeout'];if(_0x48c8ae){return db['ChatInteraction'][_0x5175('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5175('0xc')](_0x2c1bc8[_0x5175('0xd')],_0x5175('0xe'))}}});}else{return[];}})[_0x5175('0xa')](function(_0x1f72ae){if(_0x1f72ae&&_0x1f72ae['length']){_0x4f756d=_[_0x5175('0xf')](_0x1f72ae||[],'id');logger[_0x5175('0x10')](_0x5175('0x11'),_0x4f756d[_0x5175('0x12')]());return db['ChatInteraction'][_0x5175('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x5175('0x14')](_0x5175('0x15'))},{'where':{'id':_0x4f756d}});}})[_0x5175('0xa')](function(){if(_0x4f756d&&_0x4f756d[_0x5175('0x16')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4f756d['join']());for(var _0x5dcb32=0x0;_0x5dcb32<_0x4f756d[_0x5175('0x16')];_0x5dcb32++){io[_0x5175('0x17')](_0x5175('0x18'),{'id':_0x4f756d[_0x5dcb32],'closed':!![]});}}})[_0x5175('0x19')](function(_0x517f22){logger['error'](_0x5175('0x1a'),_0x517f22?util[_0x5175('0x1b')](_0x517f22,{'showHidden':![],'depth':null}):'');});}exports[_0x5175('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x28a7=['start','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','lastMsgAt','subtract','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x458dda,_0x143f58){var _0x23ea30=function(_0x23da64){while(--_0x23da64){_0x458dda['push'](_0x458dda['shift']());}};_0x23ea30(++_0x143f58);}(_0x28a7,0xd9));var _0x728a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x28a7[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0x728a('0x0'))['db'];var logger=require(_0x728a('0x1'))(_0x728a('0x2'));config[_0x728a('0x3')]=_['defaults'](config[_0x728a('0x3')],{'host':_0x728a('0x4'),'port':0x18eb});var io=require(_0x728a('0x5'))(new Redis(config[_0x728a('0x3')]));function closeInteractions(){var _0x354fa1=0x0;var _0x1e73b7=[];return db[_0x728a('0x6')][_0x728a('0x7')]({'raw':!![],'attributes':['id',_0x728a('0x8')],'where':{'id':0x1}})[_0x728a('0x9')](function(_0x12f78b){_0x354fa1=_0x12f78b[_0x728a('0x8')];if(_0x354fa1){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x728a('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x728a('0xb')](_0x12f78b[_0x728a('0x8')],_0x728a('0xc'))}}});}else{return[];}})[_0x728a('0x9')](function(_0x541231){if(_0x541231&&_0x541231[_0x728a('0xd')]){_0x1e73b7=_['map'](_0x541231||[],'id');logger['info'](_0x728a('0xe'),_0x1e73b7[_0x728a('0xf')]());return db[_0x728a('0x10')][_0x728a('0x11')]({'closeReason':_0x728a('0x12'),'disposition':_0x728a('0x13'),'closed':!![],'closedAt':moment()[_0x728a('0x14')](_0x728a('0x15'))},{'where':{'id':_0x1e73b7}});}})[_0x728a('0x9')](function(){if(_0x1e73b7&&_0x1e73b7[_0x728a('0xd')]){logger['info'](_0x728a('0x16'),_0x1e73b7['join']());for(var _0x57a0a6=0x0;_0x57a0a6<_0x1e73b7['length'];_0x57a0a6++){io[_0x728a('0x17')]('chatInteraction:update',{'id':_0x1e73b7[_0x57a0a6],'closed':!![]});}}})[_0x728a('0x18')](function(_0x56183a){logger['error'](_0x728a('0x19'),_0x56183a?util['inspect'](_0x56183a,{'showHidden':![],'depth':null}):'');});}exports[_0x728a('0x1a')]=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 21dee98..ef8b2b2 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 _0x9e19=['stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','Smtp','service','MailAccount','host','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','join','../../files/reports','%s.%s','basename','savename','extname','zip','message','attachments','text','format','stringify','existsSync','status','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','Schedule','MailServerOut','jobs','map','keyBy','toString','difference','length','exists'];(function(_0x3bb25c,_0x282a26){var _0x257814=function(_0xdd355c){while(--_0xdd355c){_0x3bb25c['push'](_0x3bb25c['shift']());}};_0x257814(++_0x282a26);}(_0x9e19,0x66));var _0x99e1=function(_0x4c217f,_0x82a1ae){_0x4c217f=_0x4c217f-0x0;var _0x4033b2=_0x9e19[_0x4c217f];return _0x4033b2;};'use strict';var fs=require('fs');var util=require(_0x99e1('0x0'));var path=require(_0x99e1('0x1'));var _=require(_0x99e1('0x2'));var moment=require(_0x99e1('0x3'));var CronJobManager=require(_0x99e1('0x4'));var jayson=require(_0x99e1('0x5'));var BPromise=require(_0x99e1('0x6'));var logger=require(_0x99e1('0x7'))(_0x99e1('0x8'));var db=require(_0x99e1('0x9'))['db'];var analyticCustomReportController=require(_0x99e1('0xa'));var analyticDefaultReportController=require(_0x99e1('0xb'));var client=jayson[_0x99e1('0xc')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4756ab,_0x5512cd){return function(){logger[_0x99e1('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4756ab[_0x99e1('0xe')]);var _0x1e1eac=!![];var _0x170980={'tls':{'rejectUnauthorized':![]}};if(_0x4756ab['MailAccount'][_0x99e1('0xf')]['service']){_0x170980[_0x99e1('0x10')]=_0x4756ab[_0x99e1('0x11')]['Smtp'][_0x99e1('0x10')];}else{_0x170980['host']=_0x4756ab[_0x99e1('0x11')][_0x99e1('0xf')][_0x99e1('0x12')];_0x170980['port']=_0x4756ab[_0x99e1('0x11')][_0x99e1('0xf')]['port'];_0x170980['secure']=_0x4756ab['MailAccount'][_0x99e1('0xf')][_0x99e1('0x13')];}if(_0x4756ab['MailAccount']['Smtp'][_0x99e1('0x14')]){_0x170980[_0x99e1('0x15')]={'user':_0x4756ab[_0x99e1('0x11')][_0x99e1('0xf')][_0x99e1('0x16')],'pass':_0x4756ab[_0x99e1('0x11')][_0x99e1('0xf')][_0x99e1('0x17')]};}var _0x2b5d15={'account':_0x170980,'message':{'from':util['format'](_0x99e1('0x18'),_0x4756ab[_0x99e1('0x11')][_0x99e1('0x19')],_0x4756ab[_0x99e1('0x11')][_0x99e1('0xe')]||_0x4756ab['MailAccount'][_0x99e1('0xf')][_0x99e1('0x16')]),'to':_0x4756ab[_0x99e1('0xe')],'cc':_0x4756ab['cc'],'bcc':_0x4756ab['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x5512cd['name'],_0x4756ab['subtractNumber'],_0x4756ab['subtractUnit'])}};var _0x30cdd0=path[_0x99e1('0x1a')](__dirname,_0x99e1('0x1b'));var _0x43bf56=_0x5512cd['savename'];var _0x33910e=util['format'](_0x99e1('0x1c'),path[_0x99e1('0x1d')](_0x5512cd[_0x99e1('0x1e')],path[_0x99e1('0x1f')](_0x5512cd[_0x99e1('0x1e')])),_0x99e1('0x20'));var _0xdd519c=path['join'](_0x30cdd0,_0x43bf56);var _0x244cb3=path[_0x99e1('0x1a')](_0x30cdd0,_0x33910e);if(fs['existsSync'](_0xdd519c)){_0x5512cd['status']='Sent';_0x2b5d15[_0x99e1('0x21')][_0x99e1('0x22')]=[{'filename':_0x43bf56,'path':_0xdd519c}];_0x2b5d15[_0x99e1('0x21')][_0x99e1('0x23')]=util[_0x99e1('0x24')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x99e1('0x25')](_0x5512cd,null,0x2));}else if(fs[_0x99e1('0x26')](_0x244cb3)){_0x5512cd[_0x99e1('0x27')]='Sent';_0x2b5d15[_0x99e1('0x21')][_0x99e1('0x22')]=[{'filename':_0x33910e,'path':_0x244cb3}];}else{_0x2b5d15[_0x99e1('0x21')][_0x99e1('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4756ab[_0x99e1('0x28')]){_0x1e1eac=![];logger[_0x99e1('0xd')](_0x99e1('0x29'));}}if(_0x1e1eac){return client[_0x99e1('0x2a')](_0x99e1('0x2b'),_0x2b5d15)[_0x99e1('0x2c')](function(_0x5d8dbe){if(_0x5d8dbe[_0x99e1('0x2d')]){return logger[_0x99e1('0x2d')](_0x99e1('0x2e'),JSON['stringify'](_0x5d8dbe));}return logger[_0x99e1('0xd')]('email\x20sent');})[_0x99e1('0x2f')](function(_0x27b480){return logger[_0x99e1('0x2d')]('error\x20mail',JSON[_0x99e1('0x25')](_0x27b480));});}};}function handleError(){return function(_0x277f75){return logger[_0x99e1('0x2d')](JSON[_0x99e1('0x25')](_0x277f75));};}function handleResult(_0x1044be){return function(_0x237eb8){logger[_0x99e1('0xd')](_0x99e1('0x30'),JSON[_0x99e1('0x25')](_0x237eb8));if(_0x1044be[_0x99e1('0x11')]&&_0x1044be['MailAccount']['Smtp']&&!_['isNil'](_0x1044be[_0x99e1('0xe')])){setTimeout(handleSendEmail(_0x1044be,_0x237eb8),0x3c*0x3e8);}};}function handleJob(_0xa3735c){return function(){try{if(_[_0x99e1('0x31')](_0xa3735c['subtractNumber'])){return logger[_0x99e1('0xd')](_0x99e1('0x32'));}if(_[_0x99e1('0x31')](_0xa3735c[_0x99e1('0x33')])){return logger[_0x99e1('0xd')](_0x99e1('0x34'));}var _0x1d7428={'startDate':moment()[_0x99e1('0x35')](_0xa3735c['subtractNumber'],_0xa3735c['subtractUnit'])[_0x99e1('0x24')](_0x99e1('0x36')),'endDate':moment()[_0x99e1('0x24')](_0x99e1('0x36')),'type':'scheduled','output':_0xa3735c[_0x99e1('0x37')],'name':_0xa3735c['name']};if(!_[_0x99e1('0x31')](_0xa3735c[_0x99e1('0x38')])){logger[_0x99e1('0xd')](_0x99e1('0x39'),_0xa3735c[_0x99e1('0x38')]);return analyticDefaultReportController['runReport']({'id':_0xa3735c['DefaultReportId']},_0x1d7428)['then'](handleResult(_0xa3735c))['catch'](handleError());}if(!_[_0x99e1('0x31')](_0xa3735c[_0x99e1('0x3a')])){logger[_0x99e1('0xd')]('exec\x20custom\x20report\x20id:%s',_0xa3735c['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0xa3735c[_0x99e1('0x3a')]},_0x1d7428)[_0x99e1('0x2c')](handleResult(_0xa3735c))[_0x99e1('0x2f')](handleError());}}catch(_0x2668a1){logger[_0x99e1('0x2d')](JSON['stringify'](_0x2668a1));}return logger[_0x99e1('0xd')]('no\x20report\x20id');};}function getJobs(_0x5a628a){var _0x57d081={};if(_0x5a628a){_0x57d081['id']=_0x5a628a;}return db[_0x99e1('0x3b')]['findAll']({'where':_0x57d081,'include':[{'model':db[_0x99e1('0x11')],'attributes':['id',_0x99e1('0x19'),_0x99e1('0xe')],'include':[{'model':db[_0x99e1('0x3c')],'as':_0x99e1('0xf')}]}]})[_0x99e1('0x2c')](function(_0x164670){var _0x559fe1=_['keys'](manager[_0x99e1('0x3d')]);var _0x1111ed=_[_0x99e1('0x3e')](_0x164670,function(_0x5a723f){return _0x5a723f['id']['toString']();});var _0x5a0dbb=_[_0x99e1('0x3f')](_0x164670,function(_0x2d0905){return _0x2d0905['id'][_0x99e1('0x40')]();});var _0x1704e1=_0x5a628a?_0x1111ed:_[_0x99e1('0x41')](_0x1111ed,_0x559fe1);var _0xc8a629=_['intersection'](_0x1111ed,_0x559fe1);var _0x29ce4d=_['difference'](_0x559fe1,_0x1111ed);var _0xe8a0df;var _0x3e542d;for(_0xe8a0df=0x0;_0xe8a0df<_0x29ce4d[_0x99e1('0x42')]&&!_0x5a628a;_0xe8a0df+=0x1){_0x3e542d=_0x29ce4d[_0xe8a0df]['toString']();if(manager[_0x99e1('0x43')](_0x3e542d)){manager[_0x99e1('0x44')](_0x3e542d);manager[_0x99e1('0x45')](_0x3e542d);logger[_0x99e1('0xd')]('delete\x20cron',_0x3e542d);}}logger[_0x99e1('0xd')](_0x99e1('0x46'),JSON[_0x99e1('0x25')](_0x1704e1));for(_0xe8a0df=0x0;_0xe8a0df<_0x1704e1[_0x99e1('0x42')];_0xe8a0df+=0x1){_0x3e542d=_0x1704e1[_0xe8a0df][_0x99e1('0x40')]();logger[_0x99e1('0xd')](_0x99e1('0x47'),_0x3e542d);if(_0x5a628a){logger[_0x99e1('0xd')](_0x99e1('0x48'),_0x5a628a);logger['info'](JSON[_0x99e1('0x25')](_0x5a0dbb[_0x3e542d]));BPromise[_0x99e1('0x49')]()[_0x99e1('0x2c')](handleJob(_0x5a0dbb[_0x3e542d]));logger[_0x99e1('0xd')](_0x99e1('0x4a'),_0x5a0dbb[_0x3e542d]['name'],_0x5a0dbb[_0x3e542d]['cron']);}else if(_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')]&&_0x5a0dbb[_0x3e542d][_0x99e1('0x4c')]&&moment()[_0x99e1('0x4d')](_0x5a0dbb[_0x3e542d][_0x99e1('0x4e')],_0x5a0dbb[_0x3e542d][_0x99e1('0x4f')])){manager[_0x99e1('0x50')](_0x3e542d,_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')],handleJob(_0x5a0dbb[_0x3e542d]));manager['start'](_0x3e542d);logger[_0x99e1('0xd')](_0x99e1('0x51'),_0x5a0dbb[_0x3e542d][_0x99e1('0x19')],_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')]);}else if(manager['exists'](_0x3e542d)){manager[_0x99e1('0x44')](_0x3e542d);manager[_0x99e1('0x45')](_0x3e542d);logger[_0x99e1('0xd')](_0x99e1('0x52'),_0x5a0dbb[_0x3e542d][_0x99e1('0x19')],_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')]);}}for(_0xe8a0df=0x0,_0x3e542d;_0xe8a0df<_0xc8a629[_0x99e1('0x42')]&&!_0x5a628a;_0xe8a0df+=0x1){_0x3e542d=_0xc8a629[_0xe8a0df][_0x99e1('0x40')]();if(manager[_0x99e1('0x43')](_0x3e542d)){if(_0x5a0dbb[_0x3e542d]['cron']&&_0x5a0dbb[_0x3e542d][_0x99e1('0x4c')]&&moment()[_0x99e1('0x4d')](_0x5a0dbb[_0x3e542d][_0x99e1('0x4e')],_0x5a0dbb[_0x3e542d][_0x99e1('0x4f')])){manager['update'](_0x3e542d,_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')],handleJob(_0x5a0dbb[_0x3e542d]));logger[_0x99e1('0xd')]('update\x20cron',_0x5a0dbb[_0x3e542d][_0x99e1('0x19')],_0x5a0dbb[_0x3e542d][_0x99e1('0x4b')]);}else{manager[_0x99e1('0x44')](_0x3e542d);manager['deleteJob'](_0x3e542d);logger[_0x99e1('0xd')]('stop\x20cron',_0x5a0dbb[_0x3e542d][_0x99e1('0x19')],_0x5a0dbb[_0x3e542d]['cron']);}}}})['catch'](function(_0x33084b){logger[_0x99e1('0x2d')](JSON[_0x99e1('0x25')](_0x33084b));});}exports[_0x99e1('0x53')]=function(_0x8fd790){return getJobs(_0x8fd790);};exports[_0x99e1('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x10c3=['subtract','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','Schedule','findAll','map','toString','keyBy','intersection','difference','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','exists','stop','deleteJob','stop\x20cron','length','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','\x22%s\x22\x20<%s>','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','message','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','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined'];(function(_0x3fc5a4,_0x115ed3){var _0x50ce7a=function(_0x3d59d6){while(--_0x3d59d6){_0x3fc5a4['push'](_0x3fc5a4['shift']());}};_0x50ce7a(++_0x115ed3);}(_0x10c3,0xd6));var _0x310c=function(_0x4555fa,_0xe8a5c7){_0x4555fa=_0x4555fa-0x0;var _0x2026a5=_0x10c3[_0x4555fa];return _0x2026a5;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x310c('0x0'));var _=require(_0x310c('0x1'));var moment=require(_0x310c('0x2'));var CronJobManager=require(_0x310c('0x3'));var jayson=require(_0x310c('0x4'));var BPromise=require(_0x310c('0x5'));var logger=require('../logger')(_0x310c('0x6'));var db=require(_0x310c('0x7'))['db'];var analyticCustomReportController=require(_0x310c('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x310c('0x9')][_0x310c('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x281eb4,_0x8caa4f){return function(){logger['info'](_0x310c('0xb'),_0x281eb4[_0x310c('0xc')]);var _0x53ff0d=!![];var _0x96f976={'tls':{'rejectUnauthorized':![]}};if(_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0xf')]){_0x96f976[_0x310c('0xf')]=_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0xf')];}else{_0x96f976['host']=_0x281eb4[_0x310c('0xd')]['Smtp'][_0x310c('0x10')];_0x96f976[_0x310c('0x11')]=_0x281eb4[_0x310c('0xd')][_0x310c('0xe')]['port'];_0x96f976[_0x310c('0x12')]=_0x281eb4['MailAccount'][_0x310c('0xe')][_0x310c('0x12')];}if(_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0x13')]){_0x96f976['auth']={'user':_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0x14')],'pass':_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0x15')]};}var _0x1b29f0={'account':_0x96f976,'message':{'from':util['format'](_0x310c('0x16'),_0x281eb4[_0x310c('0xd')]['name'],_0x281eb4[_0x310c('0xd')]['email']||_0x281eb4[_0x310c('0xd')][_0x310c('0xe')][_0x310c('0x14')]),'to':_0x281eb4[_0x310c('0xc')],'cc':_0x281eb4['cc'],'bcc':_0x281eb4[_0x310c('0x17')],'subject':util[_0x310c('0x18')](_0x310c('0x19'),_0x8caa4f[_0x310c('0x1a')],_0x281eb4[_0x310c('0x1b')],_0x281eb4[_0x310c('0x1c')])}};var _0x2efb68=path[_0x310c('0x1d')](__dirname,_0x310c('0x1e'));var _0xd4b80e=_0x8caa4f['savename'];var _0x59adf2=util[_0x310c('0x18')](_0x310c('0x1f'),path[_0x310c('0x20')](_0x8caa4f[_0x310c('0x21')],path[_0x310c('0x22')](_0x8caa4f[_0x310c('0x21')])),_0x310c('0x23'));var _0x39da1b=path[_0x310c('0x1d')](_0x2efb68,_0xd4b80e);var _0x43f9ba=path[_0x310c('0x1d')](_0x2efb68,_0x59adf2);if(fs[_0x310c('0x24')](_0x39da1b)){_0x8caa4f[_0x310c('0x25')]=_0x310c('0x26');_0x1b29f0['message'][_0x310c('0x27')]=[{'filename':_0xd4b80e,'path':_0x39da1b}];_0x1b29f0['message'][_0x310c('0x28')]=util[_0x310c('0x18')](_0x310c('0x29'),JSON[_0x310c('0x2a')](_0x8caa4f,null,0x2));}else if(fs[_0x310c('0x24')](_0x43f9ba)){_0x8caa4f[_0x310c('0x25')]='Sent';_0x1b29f0[_0x310c('0x2b')][_0x310c('0x27')]=[{'filename':_0x59adf2,'path':_0x43f9ba}];}else{_0x1b29f0[_0x310c('0x2b')][_0x310c('0x28')]=_0x310c('0x2c');if(!_0x281eb4[_0x310c('0x2d')]){_0x53ff0d=![];logger[_0x310c('0x2e')](_0x310c('0x2f'));}}if(_0x53ff0d){return client['request']('SendMail',_0x1b29f0)[_0x310c('0x30')](function(_0x1a9bc4){if(_0x1a9bc4[_0x310c('0x31')]){return logger['error'](_0x310c('0x32'),JSON['stringify'](_0x1a9bc4));}return logger[_0x310c('0x2e')](_0x310c('0x33'));})[_0x310c('0x34')](function(_0x1274cc){return logger[_0x310c('0x31')](_0x310c('0x32'),JSON[_0x310c('0x2a')](_0x1274cc));});}};}function handleError(){return function(_0x1fc18b){return logger['error'](JSON[_0x310c('0x2a')](_0x1fc18b));};}function handleResult(_0x5a7be8){return function(_0x3684fa){logger[_0x310c('0x2e')](_0x310c('0x35'),JSON['stringify'](_0x3684fa));if(_0x5a7be8['MailAccount']&&_0x5a7be8[_0x310c('0xd')][_0x310c('0xe')]&&!_[_0x310c('0x36')](_0x5a7be8['email'])){setTimeout(handleSendEmail(_0x5a7be8,_0x3684fa),0x3c*0x3e8);}};}function handleJob(_0x34b935){return function(){try{if(_['isNil'](_0x34b935[_0x310c('0x1b')])){return logger[_0x310c('0x2e')](_0x310c('0x37'));}if(_[_0x310c('0x36')](_0x34b935[_0x310c('0x1c')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0xa93549={'startDate':moment()[_0x310c('0x38')](_0x34b935[_0x310c('0x1b')],_0x34b935[_0x310c('0x1c')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x34b935[_0x310c('0x39')],'name':_0x34b935['name']};if(!_[_0x310c('0x36')](_0x34b935[_0x310c('0x3a')])){logger[_0x310c('0x2e')](_0x310c('0x3b'),_0x34b935[_0x310c('0x3a')]);return analyticDefaultReportController['runReport']({'id':_0x34b935['DefaultReportId']},_0xa93549)[_0x310c('0x30')](handleResult(_0x34b935))[_0x310c('0x34')](handleError());}if(!_['isNil'](_0x34b935[_0x310c('0x3c')])){logger['info'](_0x310c('0x3d'),_0x34b935['CustomReportId']);return analyticCustomReportController[_0x310c('0x3e')]({'id':_0x34b935['CustomReportId']},_0xa93549)['then'](handleResult(_0x34b935))[_0x310c('0x34')](handleError());}}catch(_0x50f1bc){logger['error'](JSON[_0x310c('0x2a')](_0x50f1bc));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5ac972){var _0x5c1b50={};if(_0x5ac972){_0x5c1b50['id']=_0x5ac972;}return db[_0x310c('0x3f')][_0x310c('0x40')]({'where':_0x5c1b50,'include':[{'model':db['MailAccount'],'attributes':['id',_0x310c('0x1a'),_0x310c('0xc')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x310c('0x30')](function(_0x69bdc){var _0x5c4dc6=_['keys'](manager['jobs']);var _0xe5f616=_[_0x310c('0x41')](_0x69bdc,function(_0x14c843){return _0x14c843['id'][_0x310c('0x42')]();});var _0xfd649a=_[_0x310c('0x43')](_0x69bdc,function(_0x62fb){return _0x62fb['id'][_0x310c('0x42')]();});var _0x4a0ed1=_0x5ac972?_0xe5f616:_['difference'](_0xe5f616,_0x5c4dc6);var _0x2c7b2e=_[_0x310c('0x44')](_0xe5f616,_0x5c4dc6);var _0x1b86c8=_[_0x310c('0x45')](_0x5c4dc6,_0xe5f616);var _0x49e9aa;var _0x18c7b5;for(_0x49e9aa=0x0;_0x49e9aa<_0x1b86c8['length']&&!_0x5ac972;_0x49e9aa+=0x1){_0x18c7b5=_0x1b86c8[_0x49e9aa][_0x310c('0x42')]();if(manager['exists'](_0x18c7b5)){manager['stop'](_0x18c7b5);manager['deleteJob'](_0x18c7b5);logger[_0x310c('0x2e')](_0x310c('0x46'),_0x18c7b5);}}logger[_0x310c('0x2e')](_0x310c('0x47'),JSON[_0x310c('0x2a')](_0x4a0ed1));for(_0x49e9aa=0x0;_0x49e9aa<_0x4a0ed1['length'];_0x49e9aa+=0x1){_0x18c7b5=_0x4a0ed1[_0x49e9aa][_0x310c('0x42')]();logger[_0x310c('0x2e')](_0x310c('0x48'),_0x18c7b5);if(_0x5ac972){logger[_0x310c('0x2e')](_0x310c('0x49'),_0x5ac972);logger[_0x310c('0x2e')](JSON[_0x310c('0x2a')](_0xfd649a[_0x18c7b5]));BPromise[_0x310c('0x4a')]()[_0x310c('0x30')](handleJob(_0xfd649a[_0x18c7b5]));logger['info']('run\x20job',_0xfd649a[_0x18c7b5][_0x310c('0x1a')],_0xfd649a[_0x18c7b5][_0x310c('0x4b')]);}else if(_0xfd649a[_0x18c7b5][_0x310c('0x4b')]&&_0xfd649a[_0x18c7b5][_0x310c('0x4c')]&&moment()[_0x310c('0x4d')](_0xfd649a[_0x18c7b5][_0x310c('0x4e')],_0xfd649a[_0x18c7b5][_0x310c('0x4f')])){manager[_0x310c('0x50')](_0x18c7b5,_0xfd649a[_0x18c7b5][_0x310c('0x4b')],handleJob(_0xfd649a[_0x18c7b5]));manager[_0x310c('0x51')](_0x18c7b5);logger['info'](_0x310c('0x52'),_0xfd649a[_0x18c7b5]['name'],_0xfd649a[_0x18c7b5]['cron']);}else if(manager[_0x310c('0x53')](_0x18c7b5)){manager[_0x310c('0x54')](_0x18c7b5);manager[_0x310c('0x55')](_0x18c7b5);logger[_0x310c('0x2e')](_0x310c('0x56'),_0xfd649a[_0x18c7b5][_0x310c('0x1a')],_0xfd649a[_0x18c7b5]['cron']);}}for(_0x49e9aa=0x0,_0x18c7b5;_0x49e9aa<_0x2c7b2e[_0x310c('0x57')]&&!_0x5ac972;_0x49e9aa+=0x1){_0x18c7b5=_0x2c7b2e[_0x49e9aa]['toString']();if(manager[_0x310c('0x53')](_0x18c7b5)){if(_0xfd649a[_0x18c7b5][_0x310c('0x4b')]&&_0xfd649a[_0x18c7b5][_0x310c('0x4c')]&&moment()['isBetween'](_0xfd649a[_0x18c7b5][_0x310c('0x4e')],_0xfd649a[_0x18c7b5]['endAt'])){manager['update'](_0x18c7b5,_0xfd649a[_0x18c7b5]['cron'],handleJob(_0xfd649a[_0x18c7b5]));logger[_0x310c('0x2e')](_0x310c('0x58'),_0xfd649a[_0x18c7b5][_0x310c('0x1a')],_0xfd649a[_0x18c7b5][_0x310c('0x4b')]);}else{manager[_0x310c('0x54')](_0x18c7b5);manager[_0x310c('0x55')](_0x18c7b5);logger[_0x310c('0x2e')](_0x310c('0x56'),_0xfd649a[_0x18c7b5][_0x310c('0x1a')],_0xfd649a[_0x18c7b5][_0x310c('0x4b')]);}}}})[_0x310c('0x34')](function(_0x367687){logger[_0x310c('0x31')](JSON['stringify'](_0x367687));});}exports[_0x310c('0x59')]=function(_0x830bd0){return getJobs(_0x830bd0);};exports['start']=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 7096e9c..afa46bb 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 _0x5523=['name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','all','SequelizeValidationError','inspect','start','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','CloudProvider','Cloud\x20Provider\x20not\x20configured','sentimentRegion','catch'];(function(_0x32deda,_0x59fc42){var _0x4ede15=function(_0x8e0d15){while(--_0x8e0d15){_0x32deda['push'](_0x32deda['shift']());}};_0x4ede15(++_0x59fc42);}(_0x5523,0x137));var _0x3552=function(_0x5d917e,_0x230e54){_0x5d917e=_0x5d917e-0x0;var _0x54468e=_0x5523[_0x5d917e];return _0x54468e;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x3552('0x0'));var util=require(_0x3552('0x1'));var BPromise=require(_0x3552('0x2'));var db=require(_0x3552('0x3'))['db'];var logger=require(_0x3552('0x4'))(_0x3552('0x5'));function getTranscriptionJob(_0x2d602c,_0x3de607,_0x113032,_0xe94944){return new Promise(function(_0x3225aa,_0x58385b){var _0x5d2dc8=new AWS['TranscribeService']({'accessKeyId':_0x3de607,'secretAccessKey':_0x2d602c,'region':_0x113032});_0x5d2dc8[_0x3552('0x6')]({'TranscriptionJobName':_0xe94944},function(_0x4825be,_0x4332b1){if(_0x4825be){return _0x58385b(_0x4825be);}else{return _0x3225aa(_0x4332b1);}});});}function sentiment(_0x2dee37,_0xefb0d8,_0x518eba,_0x4829fd,_0xeaac69){return new Promise(function(_0x13bcae,_0x1b6ce8){var _0x6c32e5=new AWS[(_0x3552('0x7'))]({'accessKeyId':_0xefb0d8,'secretAccessKey':_0x2dee37,'region':_0x518eba});_0x6c32e5[_0x3552('0x8')]({'Text':_0x4829fd,'LanguageCode':_0xeaac69[_0x3552('0x9')](0x0,0x2)},function(_0x346f6d,_0x12659a){if(_0x346f6d){return _0x1b6ce8(_0x346f6d);}else{return _0x13bcae(_0x12659a);}});});}function checkTranscribeJob(_0x8fc5be,_0xae728b,_0x549df0){var _0x295d0d;return new BPromise(function(_0x2afb0b,_0x981fa5){logger['info'](util['format'](_0x3552('0xa'),_0x8fc5be['id'],_0x8fc5be[_0x3552('0xb')]));return getTranscriptionJob(_0x549df0[_0x3552('0xc')],_0x549df0[_0x3552('0xd')],_0xae728b['transcribeRegion'],_0x8fc5be[_0x3552('0xb')])[_0x3552('0xe')](function(_0x31dd12){logger[_0x3552('0xf')](util['format'](_0x3552('0x10'),_0x8fc5be['id'],_0x8fc5be[_0x3552('0xb')],_0x31dd12[_0x3552('0x11')]['TranscriptionJobStatus']));if(!_0x8fc5be[_0x3552('0x12')]){switch(_0x31dd12[_0x3552('0x11')]['TranscriptionJobStatus']){case _0x3552('0x13'):var _0xca6641={'transcribeStatus':_0x31dd12[_0x3552('0x11')][_0x3552('0x14')],'fileUri':_0x31dd12['TranscriptionJob'][_0x3552('0x15')][_0x3552('0x16')]};logger['info'](util[_0x3552('0x17')](_0x3552('0x18'),_0x8fc5be['id']));return rp({'uri':_0x31dd12[_0x3552('0x11')][_0x3552('0x15')][_0x3552('0x16')],'json':!![]})['then'](function(_0x2fe62c){logger['info'](util[_0x3552('0x17')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x8fc5be['id']));if(_0x2fe62c&&_0x2fe62c[_0x3552('0x19')]&&_0x2fe62c[_0x3552('0x19')]['transcripts']&&_0x2fe62c[_0x3552('0x19')]['transcripts'][_0x3552('0x1a')]){_0xca6641['fileText']='';for(var _0x1972b7=0x0;_0x1972b7<_0x2fe62c['results'][_0x3552('0x1b')][_0x3552('0x1a')];_0x1972b7++){_0xca6641[_0x3552('0x12')]+=_0x2fe62c[_0x3552('0x19')][_0x3552('0x1b')][_0x1972b7][_0x3552('0x1c')]+'';}}return _0x8fc5be[_0x3552('0x1d')](_0xca6641);})[_0x3552('0xe')](function(){logger['info'](util['format'](_0x3552('0x1e'),_0x8fc5be['id']));if(!_0x8fc5be['tempSentiment']){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x21'));}if(!_0xae728b[_0x3552('0x22')]||!_0xae728b[_0x3552('0x23')]||!_0xae728b['sentimentRegion']||!_0xae728b[_0x3552('0x24')]||!_0xae728b[_0x3552('0x25')]){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x26'));}if(!_0xca6641['fileText']){throw new Error(_0x3552('0x27'));}if(_0xae728b[_0x3552('0x23')]===_0x549df0['id']){return _0x549df0;}else{return db['CloudProvider'][_0x3552('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1cd291){if(!_0x1cd291){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x29'));}if(!_0x1cd291[_0x3552('0xc')]||!_0x1cd291[_0x3552('0xd')]){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x295d0d=_0x1cd291;logger['info'](util['format'](_0x3552('0x2a'),_0x8fc5be['id']));return sentiment(_0x295d0d[_0x3552('0xc')],_0x295d0d['data2'],_0xae728b['sentimentRegion'],_0xca6641[_0x3552('0x12')],_0xae728b[_0x3552('0x24')]);})[_0x3552('0xe')](function(_0x2abe59){logger[_0x3552('0xf')](util[_0x3552('0x17')](_0x3552('0x2b'),_0x8fc5be['id']));return _0x8fc5be['update']({'sentiment':_0x2abe59[_0x3552('0x2c')],'sPositive':_0x2abe59[_0x3552('0x2d')][_0x3552('0x2e')],'sNegative':_0x2abe59[_0x3552('0x2d')][_0x3552('0x2f')],'sMixed':_0x2abe59['SentimentScore'][_0x3552('0x30')],'sNeutral':_0x2abe59['SentimentScore'][_0x3552('0x31')]});})['then'](function(){logger[_0x3552('0xf')](util[_0x3552('0x17')](_0x3552('0x1e'),_0x8fc5be['id']));_0x2afb0b();});case _0x3552('0x32'):return _0x8fc5be[_0x3552('0x1d')]({'transcribeStatus':_0x3552('0x32'),'failureReason':_0x31dd12[_0x3552('0x11')][_0x3552('0x33')]})[_0x3552('0xe')](function(){logger[_0x3552('0xf')](util[_0x3552('0x17')](_0x3552('0x1e'),_0x8fc5be['id']));_0x2afb0b();});default:logger['info'](util[_0x3552('0x17')](_0x3552('0x34'),_0x8fc5be['id']));break;}}else{return BPromise[_0x3552('0x35')]()[_0x3552('0xe')](function(){if(!_0x8fc5be[_0x3552('0x36')]){throw new db['Sequelize'][(_0x3552('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xae728b[_0x3552('0x22')]||!_0xae728b[_0x3552('0x23')]||!_0xae728b['sentimentRegion']||!_0xae728b[_0x3552('0x24')]||!_0xae728b[_0x3552('0x25')]){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x26'));}if(!_0x8fc5be[_0x3552('0x12')]){throw new Error(_0x3552('0x27'));}if(_0xae728b[_0x3552('0x23')]===_0x549df0['id']){return _0x549df0;}else{return db[_0x3552('0x37')][_0x3552('0x28')]({'where':{'id':_settings[_0x3552('0x23')]}});}})[_0x3552('0xe')](function(_0x4fd496){if(!_0x4fd496){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x29'));}if(!_0x4fd496[_0x3552('0xc')]||!_0x4fd496[_0x3552('0xd')]){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x38'));}_0x295d0d=_0x4fd496;logger['info'](util[_0x3552('0x17')](_0x3552('0x2a'),_0x8fc5be['id']));return sentiment(_0x295d0d[_0x3552('0xc')],_0x295d0d[_0x3552('0xd')],_0xae728b[_0x3552('0x39')],_0x8fc5be[_0x3552('0x12')],_0xae728b[_0x3552('0x24')]);})['then'](function(_0xbfdd0b){logger[_0x3552('0xf')](util[_0x3552('0x17')](_0x3552('0x2b'),_0x8fc5be['id']));return _0x8fc5be[_0x3552('0x1d')]({'sentiment':_0xbfdd0b[_0x3552('0x2c')],'sPositive':_0xbfdd0b[_0x3552('0x2d')][_0x3552('0x2e')],'sNegative':_0xbfdd0b['SentimentScore'][_0x3552('0x2f')],'sMixed':_0xbfdd0b[_0x3552('0x2d')][_0x3552('0x30')],'sNeutral':_0xbfdd0b[_0x3552('0x2d')][_0x3552('0x31')],'transcribeStatus':_0x3552('0x13')});})[_0x3552('0xe')](function(){logger[_0x3552('0xf')](util[_0x3552('0x17')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x8fc5be['id']));_0x2afb0b();});}})[_0x3552('0x3a')](function(_0x502517){if(_0x502517){if(!_0x502517[_0x3552('0x3b')]||_0x502517[_0x3552('0x3b')]!=='SequelizeValidationError'){logger['error'](util[_0x3552('0x17')](_0x3552('0x3c'),_0x8fc5be['id']),util['inspect'](_0x502517,{'showHidden':![],'depth':null}));}}_0x2afb0b();});});}function checkTranscribe(){var _0x24c85b;var _0xd38a86;var _0x68222b;return db[_0x3552('0x3d')][_0x3552('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x3552('0xe')](function(_0xcb2977){if(!_0xcb2977||!_0xcb2977[_0x3552('0x1a')]){throw new db['Sequelize'][(_0x3552('0x20'))](_0x3552('0x3f'));}_0x24c85b=_0xcb2977;return db[_0x3552('0x40')][_0x3552('0x28')]({'where':{'id':0x1}});})[_0x3552('0xe')](function(_0x2f94e4){if(!_0x2f94e4){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x41'));}_0xd38a86=_0x2f94e4;if(!_0xd38a86[_0x3552('0x5')]||!_0xd38a86[_0x3552('0x42')]||!_0xd38a86[_0x3552('0x43')]||!_0xd38a86['language']||!_0xd38a86[_0x3552('0x25')]){throw new db[(_0x3552('0x1f'))][(_0x3552('0x20'))](_0x3552('0x44'));}return db[_0x3552('0x37')]['findOne']({'where':{'id':_0xd38a86['transcribeAccountId']}});})[_0x3552('0xe')](function(_0x42c63d){if(!_0x42c63d){throw new db[(_0x3552('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x42c63d['data1']||!_0x42c63d[_0x3552('0xd')]){throw new db['Sequelize']['ValidationError'](_0x3552('0x38'));}_0x68222b=_0x42c63d;var _0x2e43eb=[];_0x24c85b[_0x3552('0x45')](function(_0x4455a6){_0x2e43eb['push'](checkTranscribeJob(_0x4455a6,_0xd38a86,_0x68222b));});return BPromise[_0x3552('0x46')](_0x2e43eb);})[_0x3552('0x3a')](function(_0x26ef9e){if(_0x26ef9e){if(!_0x26ef9e[_0x3552('0x3b')]||_0x26ef9e[_0x3552('0x3b')]!==_0x3552('0x47')){logger['error'](util[_0x3552('0x48')](_0x26ef9e,{'showHidden':![],'depth':null}));}}});}exports[_0x3552('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x5825=['[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','then'];(function(_0x22d9f5,_0x410e3a){var _0x2f824e=function(_0x54c705){while(--_0x54c705){_0x22d9f5['push'](_0x22d9f5['shift']());}};_0x2f824e(++_0x410e3a);}(_0x5825,0x78));var _0x5582=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5825[_0x4a9fb1];return _0x348672;};var _=require(_0x5582('0x0'));var AWS=require(_0x5582('0x1'));var rp=require(_0x5582('0x2'));var util=require(_0x5582('0x3'));var BPromise=require('bluebird');var db=require(_0x5582('0x4'))['db'];var logger=require('../../config/logger')(_0x5582('0x5'));function getTranscriptionJob(_0x2dbcea,_0x3713d6,_0x2d2e03,_0xeba364){return new Promise(function(_0x11eb87,_0x17a897){var _0x5d618a=new AWS[(_0x5582('0x6'))]({'accessKeyId':_0x3713d6,'secretAccessKey':_0x2dbcea,'region':_0x2d2e03});_0x5d618a[_0x5582('0x7')]({'TranscriptionJobName':_0xeba364},function(_0x39b66,_0x5fa603){if(_0x39b66){return _0x17a897(_0x39b66);}else{return _0x11eb87(_0x5fa603);}});});}function sentiment(_0x5e8681,_0x2904ad,_0x3aa455,_0x24413f,_0x4eacaa){return new Promise(function(_0x40215a,_0xd1cc57){var _0x1fb98c=new AWS['Comprehend']({'accessKeyId':_0x2904ad,'secretAccessKey':_0x5e8681,'region':_0x3aa455});_0x1fb98c[_0x5582('0x8')]({'Text':_0x24413f,'LanguageCode':_0x4eacaa[_0x5582('0x9')](0x0,0x2)},function(_0x542179,_0x421f72){if(_0x542179){return _0xd1cc57(_0x542179);}else{return _0x40215a(_0x421f72);}});});}function checkTranscribeJob(_0xac1c6b,_0x4798d6,_0x5a9a4e){var _0x132be7;return new BPromise(function(_0x4fb9a5,_0x583fb7){logger[_0x5582('0xa')](util[_0x5582('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xac1c6b['id'],_0xac1c6b[_0x5582('0xc')]));return getTranscriptionJob(_0x5a9a4e[_0x5582('0xd')],_0x5a9a4e['data2'],_0x4798d6[_0x5582('0xe')],_0xac1c6b[_0x5582('0xc')])['then'](function(_0x511268){logger[_0x5582('0xa')](util['format'](_0x5582('0xf'),_0xac1c6b['id'],_0xac1c6b[_0x5582('0xc')],_0x511268[_0x5582('0x10')][_0x5582('0x11')]));if(!_0xac1c6b[_0x5582('0x12')]){switch(_0x511268[_0x5582('0x10')][_0x5582('0x11')]){case _0x5582('0x13'):var _0x563ac0={'transcribeStatus':_0x511268[_0x5582('0x10')][_0x5582('0x11')],'fileUri':_0x511268[_0x5582('0x10')][_0x5582('0x14')]['TranscriptFileUri']};logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x15'),_0xac1c6b['id']));return rp({'uri':_0x511268[_0x5582('0x10')][_0x5582('0x14')][_0x5582('0x16')],'json':!![]})[_0x5582('0x17')](function(_0x3efcfb){logger[_0x5582('0xa')](util['format'](_0x5582('0x18'),_0xac1c6b['id']));if(_0x3efcfb&&_0x3efcfb['results']&&_0x3efcfb[_0x5582('0x19')]['transcripts']&&_0x3efcfb[_0x5582('0x19')]['transcripts']['length']){_0x563ac0[_0x5582('0x12')]='';for(var _0xbd8cb4=0x0;_0xbd8cb4<_0x3efcfb[_0x5582('0x19')][_0x5582('0x1a')][_0x5582('0x1b')];_0xbd8cb4++){_0x563ac0[_0x5582('0x12')]+=_0x3efcfb['results'][_0x5582('0x1a')][_0xbd8cb4]['transcript']+'';}}return _0xac1c6b[_0x5582('0x1c')](_0x563ac0);})[_0x5582('0x17')](function(){logger['info'](util[_0x5582('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xac1c6b['id']));if(!_0xac1c6b[_0x5582('0x1d')]){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x20'));}if(!_0x4798d6[_0x5582('0x21')]||!_0x4798d6[_0x5582('0x22')]||!_0x4798d6[_0x5582('0x23')]||!_0x4798d6[_0x5582('0x24')]||!_0x4798d6[_0x5582('0x25')]){throw new db['Sequelize'][(_0x5582('0x1f'))](_0x5582('0x26'));}if(!_0x563ac0[_0x5582('0x12')]){throw new Error(_0x5582('0x27'));}if(_0x4798d6[_0x5582('0x22')]===_0x5a9a4e['id']){return _0x5a9a4e;}else{return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_settings[_0x5582('0x22')]}});}})['then'](function(_0xa4b2ca){if(!_0xa4b2ca){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x2a'));}if(!_0xa4b2ca['data1']||!_0xa4b2ca[_0x5582('0x2b')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x2c'));}_0x132be7=_0xa4b2ca;logger['info'](util[_0x5582('0xb')](_0x5582('0x2d'),_0xac1c6b['id']));return sentiment(_0x132be7['data1'],_0x132be7[_0x5582('0x2b')],_0x4798d6[_0x5582('0x23')],_0x563ac0[_0x5582('0x12')],_0x4798d6[_0x5582('0x24')]);})[_0x5582('0x17')](function(_0x8fec59){logger[_0x5582('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xac1c6b['id']));return _0xac1c6b[_0x5582('0x1c')]({'sentiment':_0x8fec59[_0x5582('0x2e')],'sPositive':_0x8fec59[_0x5582('0x2f')]['Positive'],'sNegative':_0x8fec59['SentimentScore']['Negative'],'sMixed':_0x8fec59['SentimentScore'][_0x5582('0x30')],'sNeutral':_0x8fec59[_0x5582('0x2f')][_0x5582('0x31')]});})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xac1c6b['id']));_0x4fb9a5();});case'FAILED':return _0xac1c6b[_0x5582('0x1c')]({'transcribeStatus':_0x5582('0x32'),'failureReason':_0x511268[_0x5582('0x10')][_0x5582('0x33')]})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x34'),_0xac1c6b['id']));_0x4fb9a5();});default:logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x35'),_0xac1c6b['id']));break;}}else{return BPromise[_0x5582('0x36')]()['then'](function(){if(!_0xac1c6b[_0x5582('0x1d')]){throw new db['Sequelize']['ValidationError'](_0x5582('0x20'));}if(!_0x4798d6['sentiment']||!_0x4798d6[_0x5582('0x22')]||!_0x4798d6[_0x5582('0x23')]||!_0x4798d6[_0x5582('0x24')]||!_0x4798d6[_0x5582('0x25')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x26'));}if(!_0xac1c6b[_0x5582('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x4798d6[_0x5582('0x22')]===_0x5a9a4e['id']){return _0x5a9a4e;}else{return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x5582('0x17')](function(_0x2f394f){if(!_0x2f394f){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x2a'));}if(!_0x2f394f[_0x5582('0xd')]||!_0x2f394f[_0x5582('0x2b')]){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x132be7=_0x2f394f;logger['info'](util['format'](_0x5582('0x2d'),_0xac1c6b['id']));return sentiment(_0x132be7['data1'],_0x132be7['data2'],_0x4798d6['sentimentRegion'],_0xac1c6b[_0x5582('0x12')],_0x4798d6[_0x5582('0x24')]);})[_0x5582('0x17')](function(_0x323cb6){logger[_0x5582('0xa')](util['format'](_0x5582('0x37'),_0xac1c6b['id']));return _0xac1c6b[_0x5582('0x1c')]({'sentiment':_0x323cb6[_0x5582('0x2e')],'sPositive':_0x323cb6[_0x5582('0x2f')][_0x5582('0x38')],'sNegative':_0x323cb6[_0x5582('0x2f')]['Negative'],'sMixed':_0x323cb6[_0x5582('0x2f')][_0x5582('0x30')],'sNeutral':_0x323cb6[_0x5582('0x2f')][_0x5582('0x31')],'transcribeStatus':_0x5582('0x13')});})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x34'),_0xac1c6b['id']));_0x4fb9a5();});}})[_0x5582('0x39')](function(_0x154a12){if(_0x154a12){if(!_0x154a12[_0x5582('0x3a')]||_0x154a12['name']!==_0x5582('0x3b')){logger[_0x5582('0x3c')](util[_0x5582('0xb')](_0x5582('0x3d'),_0xac1c6b['id']),util[_0x5582('0x3e')](_0x154a12,{'showHidden':![],'depth':null}));}}_0x4fb9a5();});});}function checkTranscribe(){var _0x2ac99a;var _0x3eb692;var _0x5632ed;return db['VoiceRecording'][_0x5582('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x5582('0x17')](function(_0xdff3a0){if(!_0xdff3a0||!_0xdff3a0[_0x5582('0x1b')]){throw new db['Sequelize'][(_0x5582('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x2ac99a=_0xdff3a0;return db[_0x5582('0x40')]['findOne']({'where':{'id':0x1}});})[_0x5582('0x17')](function(_0x201bd7){if(!_0x201bd7){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x41'));}_0x3eb692=_0x201bd7;if(!_0x3eb692[_0x5582('0x5')]||!_0x3eb692['transcribeAccountId']||!_0x3eb692[_0x5582('0xe')]||!_0x3eb692[_0x5582('0x24')]||!_0x3eb692[_0x5582('0x25')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x42'));}return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_0x3eb692[_0x5582('0x43')]}});})[_0x5582('0x17')](function(_0x4c23cb){if(!_0x4c23cb){throw new db['Sequelize']['ValidationError'](_0x5582('0x2a'));}if(!_0x4c23cb['data1']||!_0x4c23cb[_0x5582('0x2b')]){throw new db['Sequelize'][(_0x5582('0x1f'))](_0x5582('0x2c'));}_0x5632ed=_0x4c23cb;var _0x178575=[];_0x2ac99a[_0x5582('0x44')](function(_0x3d12b4){_0x178575[_0x5582('0x45')](checkTranscribeJob(_0x3d12b4,_0x3eb692,_0x5632ed));});return BPromise[_0x5582('0x46')](_0x178575);})[_0x5582('0x39')](function(_0x1cc436){if(_0x1cc436){if(!_0x1cc436[_0x5582('0x3a')]||_0x1cc436[_0x5582('0x3a')]!=='SequelizeValidationError'){logger[_0x5582('0x3c')](util['inspect'](_0x1cc436,{'showHidden':![],'depth':null}));}}});}exports[_0x5582('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 9767902..1e8a2be 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 _0x6fb7=['localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults'];(function(_0x1c246a,_0x136c91){var _0x5538f1=function(_0x19a5b2){while(--_0x19a5b2){_0x1c246a['push'](_0x1c246a['shift']());}};_0x5538f1(++_0x136c91);}(_0x6fb7,0x13c));var _0x76fb=function(_0x48c5b8,_0x21ca76){_0x48c5b8=_0x48c5b8-0x0;var _0x4a5f74=_0x6fb7[_0x48c5b8];return _0x4a5f74;};'use strict';var _=require(_0x76fb('0x0'));var moment=require('moment');var Redis=require(_0x76fb('0x1'));var util=require(_0x76fb('0x2'));var config=require(_0x76fb('0x3'));var db=require(_0x76fb('0x4'))['db'];var logger=require('../logger')(_0x76fb('0x5'));config[_0x76fb('0x6')]=_[_0x76fb('0x7')](config[_0x76fb('0x6')],{'host':_0x76fb('0x8'),'port':0x18eb});var io=require(_0x76fb('0x9'))(new Redis(config[_0x76fb('0x6')]));function closeInteractions(){var _0x50dda7=[];return db[_0x76fb('0xa')][_0x76fb('0xb')]({'raw':!![],'attributes':['id',_0x76fb('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x76fb('0xd'))}}})[_0x76fb('0xe')](function(_0x29369f){if(_0x29369f&&_0x29369f['length']){_0x50dda7=_[_0x76fb('0xf')](_0x29369f||[],'id');logger[_0x76fb('0x10')](_0x76fb('0x11'),_0x50dda7[_0x76fb('0x12')]());return db[_0x76fb('0xa')]['update']({'closeReason':_0x76fb('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x76fb('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x50dda7}});}})[_0x76fb('0xe')](function(){if(_0x50dda7&&_0x50dda7['length']){logger[_0x76fb('0x10')](_0x76fb('0x15'),_0x50dda7[_0x76fb('0x12')]());for(var _0x1a48f3=0x0;_0x1a48f3<_0x50dda7['length'];_0x1a48f3++){io[_0x76fb('0x16')](_0x76fb('0x17'),{'id':_0x50dda7[_0x1a48f3],'closed':!![]});}}})[_0x76fb('0x18')](function(_0x1262b5){logger['error'](_0x76fb('0x19'),_0x1262b5?util['inspect'](_0x1262b5,{'showHidden':![],'depth':null}):'');});}exports[_0x76fb('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xca8a=['moment','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash'];(function(_0x3d573b,_0x3ffbff){var _0x3924e1=function(_0x1d1799){while(--_0x1d1799){_0x3d573b['push'](_0x3d573b['shift']());}};_0x3924e1(++_0x3ffbff);}(_0xca8a,0xca));var _0xaca8=function(_0x58b57a,_0x1bb3d5){_0x58b57a=_0x58b57a-0x0;var _0x23a667=_0xca8a[_0x58b57a];return _0x23a667;};'use strict';var _=require(_0xaca8('0x0'));var moment=require(_0xaca8('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xaca8('0x2'));var db=require(_0xaca8('0x3'))['db'];var logger=require(_0xaca8('0x4'))(_0xaca8('0x5'));config[_0xaca8('0x6')]=_[_0xaca8('0x7')](config[_0xaca8('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xaca8('0x8'))(new Redis(config[_0xaca8('0x6')]));function closeInteractions(){var _0x3de899=[];return db[_0xaca8('0x9')][_0xaca8('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xaca8('0xb')](0x18,_0xaca8('0xc'))}}})[_0xaca8('0xd')](function(_0x2c640f){if(_0x2c640f&&_0x2c640f['length']){_0x3de899=_[_0xaca8('0xe')](_0x2c640f||[],'id');logger[_0xaca8('0xf')](_0xaca8('0x10'),_0x3de899[_0xaca8('0x11')]());return db[_0xaca8('0x9')][_0xaca8('0x12')]({'closeReason':_0xaca8('0x13'),'disposition':_0xaca8('0x14'),'closed':!![],'closedAt':moment()[_0xaca8('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3de899}});}})['then'](function(){if(_0x3de899&&_0x3de899[_0xaca8('0x16')]){logger[_0xaca8('0xf')](_0xaca8('0x17'),_0x3de899[_0xaca8('0x11')]());for(var _0x4c2101=0x0;_0x4c2101<_0x3de899[_0xaca8('0x16')];_0x4c2101++){io[_0xaca8('0x18')](_0xaca8('0x19'),{'id':_0x3de899[_0x4c2101],'closed':!![]});}}})[_0xaca8('0x1a')](function(_0x202d54){logger['error'](_0xaca8('0x1b'),_0x202d54?util[_0xaca8('0x1c')](_0x202d54,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 554e768..348c9c5 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e17=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','CmHopper','finished\x20populating','hopper1','contacts2','bulkCreate','hopper2','catch'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x2e17,0x1a2));var _0x72e1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x2e17[_0x1b5aea];return _0x15cfc6;};'use strict';var util=require(_0x72e1('0x0'));var db=require(_0x72e1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x72e1('0x2')]({'id':i,'firstName':_0x72e1('0x3')+i,'lastName':_0x72e1('0x4')+i,'phone':0xf879fb460+i,'email':_0x72e1('0x5')+i+_0x72e1('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x72e1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x72e1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x72e1('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x72e1('0x2')]({'id':i,'firstName':_0x72e1('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x72e1('0x5')+i+_0x72e1('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x72e1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x72e1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x72e1('0x7')](),'updatedAt':Date[_0x72e1('0x7')]()});}db[_0x72e1('0x8')][_0x72e1('0x9')]({'where':{}})[_0x72e1('0xa')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x72e1('0xa')](function(){console[_0x72e1('0xb')]('finished\x20populating','contacts1');return db[_0x72e1('0xc')][_0x72e1('0x9')]({'where':{}});})[_0x72e1('0xa')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x72e1('0xa')](function(){console[_0x72e1('0xb')](_0x72e1('0xd'),_0x72e1('0xe'));return db[_0x72e1('0x8')]['bulkCreate'](contacts2);})[_0x72e1('0xa')](function(){console['log'](_0x72e1('0xd'),_0x72e1('0xf'));return db[_0x72e1('0xc')][_0x72e1('0x10')](hopper2);})[_0x72e1('0xa')](function(){console[_0x72e1('0xb')](_0x72e1('0xd'),_0x72e1('0x11'));})[_0x72e1('0x12')](function(_0x3720a8){console[_0x72e1('0xb')](_0x3720a8);}); \ No newline at end of file +var _0x596a=['Biondo','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','util','../mysqldb','push','Innocenzo','@xcally.com','now'];(function(_0x4dfdfa,_0x2bdc02){var _0xb918fe=function(_0x511784){while(--_0x511784){_0x4dfdfa['push'](_0x4dfdfa['shift']());}};_0xb918fe(++_0x2bdc02);}(_0x596a,0x16a));var _0xa596=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x596a[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0xa596('0x0'));var db=require(_0xa596('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa596('0x2')]({'id':i,'firstName':_0xa596('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xa596('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa596('0x2')]({'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[_0xa596('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa596('0x2')]({'id':i,'firstName':_0xa596('0x3')+i,'lastName':_0xa596('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xa596('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa596('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa596('0x5')](),'updatedAt':Date[_0xa596('0x5')]()});}db['CmContact'][_0xa596('0x7')]({'where':{}})[_0xa596('0x8')](function(){return db[_0xa596('0x9')][_0xa596('0xa')](contacts);})[_0xa596('0x8')](function(){console[_0xa596('0xb')](_0xa596('0xc'),_0xa596('0xd'));return db['CmHopper'][_0xa596('0x7')]({'where':{}});})['then'](function(){return db[_0xa596('0xe')][_0xa596('0xa')](hopper);})[_0xa596('0x8')](function(){console[_0xa596('0xb')](_0xa596('0xc'),_0xa596('0xf'));return db[_0xa596('0x9')][_0xa596('0xa')](contacts2);})[_0xa596('0x8')](function(){console[_0xa596('0xb')]('finished\x20populating','contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0xa596('0x8')](function(){console[_0xa596('0xb')]('finished\x20populating','hopper2');})['catch'](function(_0x1af69c){console[_0xa596('0xb')](_0x1af69c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1c58bdd..39f1070 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11e7=['User','then','log','add\x20user','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x11cf19,_0x549192){var _0x2cb81e=function(_0x268639){while(--_0x268639){_0x11cf19['push'](_0x11cf19['shift']());}};_0x2cb81e(++_0x549192);}(_0x11e7,0x82));var _0x711e=function(_0xc1290f,_0x3cb220){_0xc1290f=_0xc1290f-0x0;var _0x295919=_0x11e7[_0xc1290f];return _0x295919;};'use strict';var util=require('util');var db=require(_0x711e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x711e('0x1')]({'name':util[_0x711e('0x2')](_0x711e('0x3'),_0x711e('0x4'),i),'fullname':util['format']('%s%s','agent',i),'email':util['format'](_0x711e('0x5'),'agent',i),'role':_0x711e('0x4'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x711e('0x6'),'ws',_0x711e('0x7')],'disallow':[_0x711e('0x8')],'allow':['ulaw'],'defaultuser':util[_0x711e('0x2')]('%s%s','agent',i),'encryption':_0x711e('0x9'),'avpf':_0x711e('0x9'),'force_avp':'yes','icesupport':_0x711e('0x9'),'dtlsenable':_0x711e('0x9'),'dtlsverify':'no','dtlscertfile':_0x711e('0xa'),'dtlsprivatekey':_0x711e('0xb'),'dtlssetup':_0x711e('0xc'),'callerid':util[_0x711e('0x2')](_0x711e('0xd'),util[_0x711e('0x2')](_0x711e('0x3'),_0x711e('0x4'),i),0xfa0+i)});}db[_0x711e('0xe')]['bulkCreate'](users)[_0x711e('0xf')](function(){console[_0x711e('0x10')](_0x711e('0x11'));})['catch'](function(_0x163b28){console[_0x711e('0x10')](_0x163b28);}); \ No newline at end of file +var _0x6206=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','yes'];(function(_0xf6b6d6,_0x3f4867){var _0x110fd6=function(_0x3281ad){while(--_0x3281ad){_0xf6b6d6['push'](_0xf6b6d6['shift']());}};_0x110fd6(++_0x3f4867);}(_0x6206,0x1e2));var _0x6620=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x6206[_0x2080a3];return _0x8d7d17;};'use strict';var util=require(_0x6620('0x0'));var db=require(_0x6620('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6620('0x2')]({'name':util[_0x6620('0x3')](_0x6620('0x4'),_0x6620('0x5'),i),'fullname':util[_0x6620('0x3')](_0x6620('0x4'),_0x6620('0x5'),i),'email':util[_0x6620('0x3')](_0x6620('0x6'),_0x6620('0x5'),i),'role':_0x6620('0x5'),'password':'password','internal':0xfa0+i,'type':_0x6620('0x7'),'transport':[_0x6620('0x8'),'ws','wss'],'disallow':[_0x6620('0x9')],'allow':['ulaw'],'defaultuser':util[_0x6620('0x3')](_0x6620('0x4'),'agent',i),'encryption':'yes','avpf':_0x6620('0xa'),'force_avp':'yes','icesupport':_0x6620('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x6620('0x3')](_0x6620('0xb'),util[_0x6620('0x3')]('%s%s',_0x6620('0x5'),i),0xfa0+i)});}db[_0x6620('0xc')][_0x6620('0xd')](users)[_0x6620('0xe')](function(){console[_0x6620('0xf')](_0x6620('0x10'));})['catch'](function(_0x2b55e5){console['log'](_0x2b55e5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index eeaa384..2fea8ca 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8fa=['chat','fax','sms','openchannel','whatsapp','telephone:%s','campaign:%s:%s','type','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','nsp','CONNECTED','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','ivr','format','length','user:%s','query','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','WhatsappQueue','userProfileId','MailQueue','OpenchannelQueue','Trunk','getVoiceQueues','getMailQueues','all','voice'];(function(_0xdc4d0f,_0x10c41a){var _0x18eafc=function(_0x170c60){while(--_0x170c60){_0xdc4d0f['push'](_0xdc4d0f['shift']());}};_0x18eafc(++_0x10c41a);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x19dfcb,_0x3fb2c2){_0x19dfcb=_0x19dfcb-0x0;var _0x5a28c9=_0xf8fa[_0x19dfcb];return _0x5a28c9;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var BPromise=require(_0xaf8f('0x1'));var db=require(_0xaf8f('0x2'))['db'];var config=require(_0xaf8f('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xaf8f('0x4'),'model':db['User'],'attributes':['id',_0xaf8f('0x5'),_0xaf8f('0x6')],'raw':!![],'where':{'role':_0xaf8f('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xaf8f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xaf8f('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xaf8f('0x5')],'where':{'role':_0xaf8f('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xaf8f('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x47d99c,_0x18276b,_0x3fe291){return db[_0xaf8f('0x9')][_0xaf8f('0xa')]({'where':{'name':_0x47d99c,'userProfileId':_0x18276b},'raw':!![]})[_0xaf8f('0xb')](function(_0x328c7b){if(_0x328c7b){if(_0x328c7b[_0xaf8f('0xc')]){switch(_0x47d99c){case _0xaf8f('0xd'):case'ChatQueues':case _0xaf8f('0xe'):case _0xaf8f('0xf'):case _0xaf8f('0x10'):case _0xaf8f('0x11'):case _0xaf8f('0x12'):return db[_0x3fe291][_0xaf8f('0x13')](queryQueues);case _0xaf8f('0x14'):return db[_0x3fe291][_0xaf8f('0x13')](queryTelephones);case'Trunks':return db[_0x3fe291]['findAll'](queryTrunks);case _0xaf8f('0x15'):return db[_0x3fe291][_0xaf8f('0x13')](queryCampaigns);}}else{return db[_0xaf8f('0x16')][_0xaf8f('0x13')]({'attributes':[_0xaf8f('0x17')],'where':{'sectionId':_0x328c7b['id']},'raw':!![]})[_0xaf8f('0xb')](function(_0xef4965){if(_0xef4965){var _0x6d09b5={'where':{'id':_[_0xaf8f('0x18')](_0xef4965,_0xaf8f('0x17'))},'raw':!![]};switch(_0x3fe291){case _0xaf8f('0x19'):_0x6d09b5['where'][_0xaf8f('0x6')]='telephone';break;case _0xaf8f('0x1a'):_0x6d09b5[_0xaf8f('0x1b')]['type']=_0xaf8f('0x1c');break;}return db[_0x3fe291][_0xaf8f('0x13')](_0x6d09b5);}else{return[];}});}}else{return[];}})[_0xaf8f('0xb')](function(_0x3a03da){return _0x3a03da;});}function joinOrLeaveQueues(_0xe0f9e2,_0x5b400d,_0x1b8f7d,_0xa9c349){_0xe0f9e2[_0x5b400d](util[_0xaf8f('0x1d')]('%s:queue:%s',_0x1b8f7d,_0xa9c349[_0xaf8f('0x5')]));if(_0xa9c349[_0xaf8f('0x4')]){for(var _0x121894=0x0;_0x121894<_0xa9c349[_0xaf8f('0x4')][_0xaf8f('0x1e')];_0x121894+=0x1){_0xe0f9e2[_0x5b400d](util[_0xaf8f('0x1d')](_0xaf8f('0x1f'),_0xa9c349['Agents'][_0x121894][_0xaf8f('0x5')]));}}}function joinOrLeave(_0x1bd99c,_0x37a91c,_0x304d45){var _0x4782e6;if(_0x1bd99c['handshake'][_0xaf8f('0x20')]['id']){db[_0xaf8f('0x19')]['find']({'attributes':['id',_0xaf8f('0x5'),'role','userProfileId'],'where':{'id':_0x1bd99c[_0xaf8f('0x21')]['query']['id']},'include':[{'model':db[_0xaf8f('0x22')],'as':_0xaf8f('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xaf8f('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xaf8f('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xaf8f('0x26')],'as':_0xaf8f('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xaf8f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xaf8f('0x29')],'as':_0xaf8f('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xaf8f('0xb')](function(_0x5ba3a7){if(_0x5ba3a7){_0x4782e6=_0x5ba3a7;_0x1bd99c[_0x37a91c](util[_0xaf8f('0x1d')](_0xaf8f('0x1f'),_0x5ba3a7[_0xaf8f('0x5')]));var _0x52041a=[];switch(_0x5ba3a7['role']){case _0xaf8f('0x2b'):_0x1bd99c[_0x37a91c](_0xaf8f('0x2c'));_0x1bd99c[_0x37a91c](_0xaf8f('0x2d'));if(queryQueues[_0xaf8f('0x2e')]('include')){delete queryQueues[_0xaf8f('0x2f')];}_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x31')][_0xaf8f('0x13')](queryQueues));_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x32')][_0xaf8f('0x13')](queryQueues));_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x33')][_0xaf8f('0x13')](queryQueues));_0x52041a['push'](db[_0xaf8f('0x34')][_0xaf8f('0x13')](queryQueues));_0x52041a[_0xaf8f('0x30')](db['MailQueue'][_0xaf8f('0x13')](queryQueues));_0x52041a[_0xaf8f('0x30')](db['OpenchannelQueue'][_0xaf8f('0x13')](queryQueues));_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x35')][_0xaf8f('0x13')](queryQueues));_0x52041a['push'](db[_0xaf8f('0x19')]['findAll'](queryTelephones));_0x52041a[_0xaf8f('0x30')](db['Trunk']['findAll'](queryTrunks));_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x1a')]['findAll'](queryCampaigns));_0x52041a['push'](db[_0xaf8f('0x19')]['findAll'](queryAgents));break;case'user':_0x1bd99c[_0x37a91c](_0xaf8f('0x2c'));_0x1bd99c[_0x37a91c]('voice:outbound');_0x52041a[_0xaf8f('0x30')](getAssociatedResources(_0xaf8f('0xd'),_0x5ba3a7['userProfileId'],_0xaf8f('0x31')));_0x52041a['push'](getAssociatedResources('ChatQueues',_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x32')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources('FaxQueues',_0x5ba3a7[_0xaf8f('0x36')],'FaxQueue'));_0x52041a[_0xaf8f('0x30')](getAssociatedResources('SmsQueues',_0x5ba3a7['userProfileId'],_0xaf8f('0x34')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources('MailQueues',_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x37')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources(_0xaf8f('0x11'),_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x38')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources(_0xaf8f('0x12'),_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x35')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources(_0xaf8f('0x14'),_0x5ba3a7[_0xaf8f('0x36')],'User'));_0x52041a[_0xaf8f('0x30')](getAssociatedResources('Trunks',_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x39')));_0x52041a[_0xaf8f('0x30')](getAssociatedResources(_0xaf8f('0x15'),_0x5ba3a7[_0xaf8f('0x36')],_0xaf8f('0x1a')));_0x52041a[_0xaf8f('0x30')](db[_0xaf8f('0x19')][_0xaf8f('0x13')](queryAgents));break;case _0xaf8f('0x7'):_0x1bd99c[_0x37a91c](_0xaf8f('0x2c'));_0x1bd99c[_0x37a91c](_0xaf8f('0x2d'));_0x52041a[_0xaf8f('0x30')](_0x5ba3a7[_0xaf8f('0x3a')]({'attributes':['id',_0xaf8f('0x5')]}));_0x52041a['push'](_0x5ba3a7['getChatQueues']({'attributes':['id','name']}));_0x52041a['push'](_0x5ba3a7['getFaxQueues']({'attributes':['id',_0xaf8f('0x5')]}));_0x52041a[_0xaf8f('0x30')](_0x5ba3a7['getSmsQueues']({'attributes':['id',_0xaf8f('0x5')]}));_0x52041a['push'](_0x5ba3a7[_0xaf8f('0x3b')]({'attributes':['id',_0xaf8f('0x5')]}));_0x52041a[_0xaf8f('0x30')](_0x5ba3a7['getOpenchannelQueues']({'attributes':['id',_0xaf8f('0x5')]}));_0x52041a[_0xaf8f('0x30')](_0x5ba3a7['getWhatsappQueues']({'attributes':['id',_0xaf8f('0x5')]}));break;}return BPromise[_0xaf8f('0x3c')](_0x52041a);}})[_0xaf8f('0xb')](function(_0x447939){if(_0x447939&&_0x447939[_0xaf8f('0x1e')]){for(var _0x3b8bb6=0x0;_0x3b8bb6<_0x447939[_0xaf8f('0x1e')];_0x3b8bb6+=0x1){for(var _0x408bc6=0x0;_0x408bc6<_0x447939[_0x3b8bb6]['length'];_0x408bc6+=0x1){switch(_0x3b8bb6){case 0x0:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x3d'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x1:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x3e'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x2:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x3f'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x3:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x40'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x4:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,'mail',_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x5:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x41'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x6:joinOrLeaveQueues(_0x1bd99c,_0x37a91c,_0xaf8f('0x42'),_0x447939[_0x3b8bb6][_0x408bc6]);break;case 0x7:if(_0x4782e6[_0xaf8f('0x6')]!=='agent')_0x1bd99c[_0x37a91c](util[_0xaf8f('0x1d')](_0xaf8f('0x43'),_0x447939[_0x3b8bb6][_0x408bc6]['name']));break;case 0x8:if(_0x4782e6[_0xaf8f('0x6')]!=='agent')_0x1bd99c[_0x37a91c](util['format']('trunk:%s',_0x447939[_0x3b8bb6][_0x408bc6][_0xaf8f('0x5')]));break;case 0x9:if(_0x4782e6[_0xaf8f('0x6')]!==_0xaf8f('0x7'))_0x1bd99c[_0x37a91c](util[_0xaf8f('0x1d')](_0xaf8f('0x44'),_0x447939[_0x3b8bb6][_0x408bc6][_0xaf8f('0x45')],_0x447939[_0x3b8bb6][_0x408bc6]['name']));break;case 0xa:_0x1bd99c[_0x37a91c](util[_0xaf8f('0x1d')](_0xaf8f('0x1f'),_0x447939[_0x3b8bb6][_0x408bc6][_0xaf8f('0x5')]));break;}}}}})[_0xaf8f('0xb')](function(){if(_0x37a91c==='leave'){var _0x4aa3ff=_[_0xaf8f('0x18')](_0x4782e6[_0xaf8f('0x23')],'id');return _0x4782e6['removeChatInteractions'](_0x4aa3ff)[_0xaf8f('0xb')](function(){for(var _0x520b78=0x0;_0x520b78<_0x4aa3ff[_0xaf8f('0x1e')];_0x520b78+=0x1){_0x304d45[_0xaf8f('0x46')](_0xaf8f('0x47'),{'ChatInteractionId':Number(_0x4aa3ff[_0x520b78]),'UserId':Number(_0x4782e6['id'])});}});}})[_0xaf8f('0xb')](function(){if(_0x37a91c===_0xaf8f('0x48')){var _0x5d313e=_[_0xaf8f('0x18')](_0x4782e6['MailInteractions'],'id');return _0x4782e6[_0xaf8f('0x49')](_0x5d313e)['then'](function(){for(var _0x5f09d5=0x0;_0x5f09d5<_0x5d313e[_0xaf8f('0x1e')];_0x5f09d5+=0x1){_0x304d45[_0xaf8f('0x46')](_0xaf8f('0x4a'),{'MailInteractionId':Number(_0x5d313e[_0x5f09d5]),'UserId':Number(_0x4782e6['id'])});}});}})['then'](function(){if(_0x37a91c===_0xaf8f('0x48')){var _0x1fbda9=_[_0xaf8f('0x18')](_0x4782e6[_0xaf8f('0x4b')],'id');return _0x4782e6[_0xaf8f('0x4c')](_0x1fbda9)[_0xaf8f('0xb')](function(){for(var _0x2636eb=0x0;_0x2636eb<_0x1fbda9['length'];_0x2636eb+=0x1){_0x304d45[_0xaf8f('0x46')](_0xaf8f('0x4d'),{'FaxInteractionId':Number(_0x1fbda9[_0x2636eb]),'UserId':Number(_0x4782e6['id'])});}});}})['then'](function(){if(_0x37a91c===_0xaf8f('0x48')){var _0x1cca8e=_[_0xaf8f('0x18')](_0x4782e6['SmsInteractions'],'id');return _0x4782e6['removeSmsInteractions'](_0x1cca8e)[_0xaf8f('0xb')](function(){for(var _0x3ce5fa=0x0;_0x3ce5fa<_0x1cca8e[_0xaf8f('0x1e')];_0x3ce5fa+=0x1){_0x304d45[_0xaf8f('0x46')](_0xaf8f('0x4e'),{'SmsInteractionId':Number(_0x1cca8e[_0x3ce5fa]),'UserId':Number(_0x4782e6['id'])});}});}})['then'](function(){if(_0x37a91c==='leave'){var _0x2cd2fd=_[_0xaf8f('0x18')](_0x4782e6['OpenchannelInteractions'],'id');return _0x4782e6[_0xaf8f('0x4f')](_0x2cd2fd)['then'](function(){for(var _0x579e76=0x0;_0x579e76<_0x2cd2fd[_0xaf8f('0x1e')];_0x579e76+=0x1){_0x304d45[_0xaf8f('0x46')](_0xaf8f('0x50'),{'OpenchannelInteractionId':Number(_0x2cd2fd[_0x579e76]),'UserId':Number(_0x4782e6['id'])});}});}})['then'](function(){if(_0x37a91c===_0xaf8f('0x48')){var _0x49098a=_[_0xaf8f('0x18')](_0x4782e6['WhatsappInteractions'],'id');return _0x4782e6['removeWhatsappInteractions'](_0x49098a)[_0xaf8f('0xb')](function(){for(var _0x46889c=0x0;_0x46889c<_0x49098a[_0xaf8f('0x1e')];_0x46889c+=0x1){_0x304d45['emit'](_0xaf8f('0x51'),{'WhatsappInteractionId':Number(_0x49098a[_0x46889c]),'UserId':Number(_0x4782e6['id'])});}});}})[_0xaf8f('0x52')](function(_0x151f74){_0x1bd99c['log'](_0x151f74);});}}function onDisconnect(_0x514cb3,_0x14952e){joinOrLeave(_0x514cb3,_0xaf8f('0x48'),_0x14952e);}function onConnect(_0x5c08be){joinOrLeave(_0x5c08be,_0xaf8f('0x53'));}exports[_0xaf8f('0x54')]=function(_0xac5716){_0xac5716['on'](_0xaf8f('0x55'),function(_0x54470f){_0x54470f[_0xaf8f('0x56')](0x0);_0x54470f[_0xaf8f('0x57')]=_0x54470f[_0xaf8f('0x58')]['connection'][_0xaf8f('0x59')]+':'+_0x54470f[_0xaf8f('0x58')][_0xaf8f('0x55')][_0xaf8f('0x5a')];_0x54470f[_0xaf8f('0x5b')]=new Date();_0x54470f[_0xaf8f('0x5c')]=function(_0x353040){console[_0xaf8f('0x5c')]('SocketIO\x20'+_0x54470f[_0xaf8f('0x5d')][_0xaf8f('0x5')]+'['+_0x54470f[_0xaf8f('0x57')]+']',_0x353040);};_0x54470f['on']('disconnect',function(){onDisconnect(_0x54470f,_0xac5716);_0x54470f['log']('DISCONNECTED');});onConnect(_0x54470f);_0x54470f[_0xaf8f('0x5c')](_0xaf8f('0x5e'));});}; \ No newline at end of file +var _0xcaf2=['user','ChatQueues','ChatQueue','FaxQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','connection','setMaxListeners','address','remoteAddress','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','format','length','user:%s','handshake','query','User','find','role','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xcaf2,0x8a));var _0x2caf=function(_0x5ca82d,_0x7d11a0){_0x5ca82d=_0x5ca82d-0x0;var _0x397661=_0xcaf2[_0x5ca82d];return _0x397661;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var BPromise=require(_0x2caf('0x1'));var db=require(_0x2caf('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x2caf('0x3')],'include':[{'as':_0x2caf('0x4'),'model':db['User'],'attributes':['id',_0x2caf('0x3'),'role'],'raw':!![],'where':{'role':_0x2caf('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2caf('0x3')],'where':{'role':_0x2caf('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x2caf('0x3')],'where':{'role':_0x2caf('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2caf('0x3'),_0x2caf('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4050ab,_0xb56cd1,_0x45e520){return db[_0x2caf('0x8')][_0x2caf('0x9')]({'where':{'name':_0x4050ab,'userProfileId':_0xb56cd1},'raw':!![]})[_0x2caf('0xa')](function(_0x1b20e3){if(_0x1b20e3){if(_0x1b20e3[_0x2caf('0xb')]){switch(_0x4050ab){case _0x2caf('0xc'):case'ChatQueues':case _0x2caf('0xd'):case _0x2caf('0xe'):case _0x2caf('0xf'):case _0x2caf('0x10'):case _0x2caf('0x11'):return db[_0x45e520][_0x2caf('0x12')](queryQueues);case _0x2caf('0x13'):return db[_0x45e520][_0x2caf('0x12')](queryTelephones);case'Trunks':return db[_0x45e520][_0x2caf('0x12')](queryTrunks);case _0x2caf('0x14'):return db[_0x45e520]['findAll'](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x2caf('0x15')],'where':{'sectionId':_0x1b20e3['id']},'raw':!![]})['then'](function(_0x388e05){if(_0x388e05){var _0xa75896={'where':{'id':_[_0x2caf('0x16')](_0x388e05,_0x2caf('0x15'))},'raw':!![]};switch(_0x45e520){case'User':_0xa75896[_0x2caf('0x17')]['role']=_0x2caf('0x6');break;case'Campaign':_0xa75896['where'][_0x2caf('0x7')]='ivr';break;}return db[_0x45e520][_0x2caf('0x12')](_0xa75896);}else{return[];}});}}else{return[];}})[_0x2caf('0xa')](function(_0x5c5d98){return _0x5c5d98;});}function joinOrLeaveQueues(_0x12624b,_0x1eeb76,_0x6b3778,_0x255c08){_0x12624b[_0x1eeb76](util[_0x2caf('0x18')]('%s:queue:%s',_0x6b3778,_0x255c08[_0x2caf('0x3')]));if(_0x255c08[_0x2caf('0x4')]){for(var _0x2b4d16=0x0;_0x2b4d16<_0x255c08[_0x2caf('0x4')][_0x2caf('0x19')];_0x2b4d16+=0x1){_0x12624b[_0x1eeb76](util[_0x2caf('0x18')](_0x2caf('0x1a'),_0x255c08[_0x2caf('0x4')][_0x2b4d16][_0x2caf('0x3')]));}}}function joinOrLeave(_0xb60d47,_0x6814bc,_0x5231fc){var _0x296305;if(_0xb60d47[_0x2caf('0x1b')][_0x2caf('0x1c')]['id']){db[_0x2caf('0x1d')][_0x2caf('0x1e')]({'attributes':['id',_0x2caf('0x3'),_0x2caf('0x1f'),_0x2caf('0x20')],'where':{'id':_0xb60d47[_0x2caf('0x1b')][_0x2caf('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x2caf('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x2caf('0x22')],'as':_0x2caf('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2caf('0x24')],'as':_0x2caf('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2caf('0x26')],'as':_0x2caf('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2caf('0x28')],'as':_0x2caf('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x2caf('0x2a')],'as':_0x2caf('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x2caf('0xa')](function(_0x158d60){if(_0x158d60){_0x296305=_0x158d60;_0xb60d47[_0x6814bc](util['format'](_0x2caf('0x1a'),_0x158d60[_0x2caf('0x3')]));var _0xea9297=[];switch(_0x158d60[_0x2caf('0x1f')]){case _0x2caf('0x2c'):_0xb60d47[_0x6814bc](_0x2caf('0x2d'));_0xb60d47[_0x6814bc](_0x2caf('0x2e'));if(queryQueues['hasOwnProperty'](_0x2caf('0x2f'))){delete queryQueues[_0x2caf('0x2f')];}_0xea9297['push'](db[_0x2caf('0x30')][_0x2caf('0x12')](queryQueues));_0xea9297[_0x2caf('0x31')](db['ChatQueue'][_0x2caf('0x12')](queryQueues));_0xea9297['push'](db['FaxQueue'][_0x2caf('0x12')](queryQueues));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x32')][_0x2caf('0x12')](queryQueues));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x33')][_0x2caf('0x12')](queryQueues));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x34')]['findAll'](queryQueues));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x35')][_0x2caf('0x12')](queryQueues));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x1d')][_0x2caf('0x12')](queryTelephones));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x36')][_0x2caf('0x12')](queryTrunks));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x37')][_0x2caf('0x12')](queryCampaigns));_0xea9297['push'](db['User'][_0x2caf('0x12')](queryAgents));break;case _0x2caf('0x38'):_0xb60d47[_0x6814bc](_0x2caf('0x2d'));_0xb60d47[_0x6814bc](_0x2caf('0x2e'));_0xea9297['push'](getAssociatedResources(_0x2caf('0xc'),_0x158d60[_0x2caf('0x20')],_0x2caf('0x30')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0x39'),_0x158d60[_0x2caf('0x20')],_0x2caf('0x3a')));_0xea9297[_0x2caf('0x31')](getAssociatedResources('FaxQueues',_0x158d60['userProfileId'],_0x2caf('0x3b')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0xe'),_0x158d60[_0x2caf('0x20')],_0x2caf('0x32')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0xf'),_0x158d60[_0x2caf('0x20')],_0x2caf('0x33')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0x10'),_0x158d60['userProfileId'],_0x2caf('0x34')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0x11'),_0x158d60['userProfileId'],_0x2caf('0x35')));_0xea9297[_0x2caf('0x31')](getAssociatedResources(_0x2caf('0x13'),_0x158d60['userProfileId'],_0x2caf('0x1d')));_0xea9297[_0x2caf('0x31')](getAssociatedResources('Trunks',_0x158d60[_0x2caf('0x20')],_0x2caf('0x36')));_0xea9297['push'](getAssociatedResources(_0x2caf('0x14'),_0x158d60[_0x2caf('0x20')],_0x2caf('0x37')));_0xea9297[_0x2caf('0x31')](db[_0x2caf('0x1d')][_0x2caf('0x12')](queryAgents));break;case _0x2caf('0x5'):_0xb60d47[_0x6814bc](_0x2caf('0x2d'));_0xb60d47[_0x6814bc]('voice:outbound');_0xea9297[_0x2caf('0x31')](_0x158d60['getVoiceQueues']({'attributes':['id',_0x2caf('0x3')]}));_0xea9297[_0x2caf('0x31')](_0x158d60[_0x2caf('0x3c')]({'attributes':['id','name']}));_0xea9297['push'](_0x158d60[_0x2caf('0x3d')]({'attributes':['id','name']}));_0xea9297[_0x2caf('0x31')](_0x158d60[_0x2caf('0x3e')]({'attributes':['id',_0x2caf('0x3')]}));_0xea9297[_0x2caf('0x31')](_0x158d60[_0x2caf('0x3f')]({'attributes':['id',_0x2caf('0x3')]}));_0xea9297[_0x2caf('0x31')](_0x158d60[_0x2caf('0x40')]({'attributes':['id',_0x2caf('0x3')]}));_0xea9297[_0x2caf('0x31')](_0x158d60[_0x2caf('0x41')]({'attributes':['id',_0x2caf('0x3')]}));break;}return BPromise[_0x2caf('0x42')](_0xea9297);}})[_0x2caf('0xa')](function(_0x14950b){if(_0x14950b&&_0x14950b[_0x2caf('0x19')]){for(var _0x123bab=0x0;_0x123bab<_0x14950b[_0x2caf('0x19')];_0x123bab+=0x1){for(var _0x36fb19=0x0;_0x36fb19<_0x14950b[_0x123bab][_0x2caf('0x19')];_0x36fb19+=0x1){switch(_0x123bab){case 0x0:joinOrLeaveQueues(_0xb60d47,_0x6814bc,_0x2caf('0x43'),_0x14950b[_0x123bab][_0x36fb19]);break;case 0x1:joinOrLeaveQueues(_0xb60d47,_0x6814bc,'chat',_0x14950b[_0x123bab][_0x36fb19]);break;case 0x2:joinOrLeaveQueues(_0xb60d47,_0x6814bc,_0x2caf('0x44'),_0x14950b[_0x123bab][_0x36fb19]);break;case 0x3:joinOrLeaveQueues(_0xb60d47,_0x6814bc,_0x2caf('0x45'),_0x14950b[_0x123bab][_0x36fb19]);break;case 0x4:joinOrLeaveQueues(_0xb60d47,_0x6814bc,'mail',_0x14950b[_0x123bab][_0x36fb19]);break;case 0x5:joinOrLeaveQueues(_0xb60d47,_0x6814bc,'openchannel',_0x14950b[_0x123bab][_0x36fb19]);break;case 0x6:joinOrLeaveQueues(_0xb60d47,_0x6814bc,_0x2caf('0x46'),_0x14950b[_0x123bab][_0x36fb19]);break;case 0x7:if(_0x296305[_0x2caf('0x1f')]!=='agent')_0xb60d47[_0x6814bc](util[_0x2caf('0x18')](_0x2caf('0x47'),_0x14950b[_0x123bab][_0x36fb19][_0x2caf('0x3')]));break;case 0x8:if(_0x296305[_0x2caf('0x1f')]!==_0x2caf('0x5'))_0xb60d47[_0x6814bc](util[_0x2caf('0x18')](_0x2caf('0x48'),_0x14950b[_0x123bab][_0x36fb19][_0x2caf('0x3')]));break;case 0x9:if(_0x296305[_0x2caf('0x1f')]!==_0x2caf('0x5'))_0xb60d47[_0x6814bc](util[_0x2caf('0x18')](_0x2caf('0x49'),_0x14950b[_0x123bab][_0x36fb19][_0x2caf('0x7')],_0x14950b[_0x123bab][_0x36fb19]['name']));break;case 0xa:_0xb60d47[_0x6814bc](util[_0x2caf('0x18')](_0x2caf('0x1a'),_0x14950b[_0x123bab][_0x36fb19][_0x2caf('0x3')]));break;}}}}})['then'](function(){if(_0x6814bc===_0x2caf('0x4a')){var _0x4188f6=_[_0x2caf('0x16')](_0x296305[_0x2caf('0x21')],'id');return _0x296305[_0x2caf('0x4b')](_0x4188f6)[_0x2caf('0xa')](function(){for(var _0x464768=0x0;_0x464768<_0x4188f6[_0x2caf('0x19')];_0x464768+=0x1){_0x5231fc[_0x2caf('0x4c')](_0x2caf('0x4d'),{'ChatInteractionId':Number(_0x4188f6[_0x464768]),'UserId':Number(_0x296305['id'])});}});}})['then'](function(){if(_0x6814bc===_0x2caf('0x4a')){var _0x106930=_[_0x2caf('0x16')](_0x296305['MailInteractions'],'id');return _0x296305[_0x2caf('0x4e')](_0x106930)[_0x2caf('0xa')](function(){for(var _0x84f5c1=0x0;_0x84f5c1<_0x106930['length'];_0x84f5c1+=0x1){_0x5231fc[_0x2caf('0x4c')](_0x2caf('0x4f'),{'MailInteractionId':Number(_0x106930[_0x84f5c1]),'UserId':Number(_0x296305['id'])});}});}})[_0x2caf('0xa')](function(){if(_0x6814bc===_0x2caf('0x4a')){var _0x4a2760=_[_0x2caf('0x16')](_0x296305[_0x2caf('0x25')],'id');return _0x296305[_0x2caf('0x50')](_0x4a2760)['then'](function(){for(var _0x377111=0x0;_0x377111<_0x4a2760[_0x2caf('0x19')];_0x377111+=0x1){_0x5231fc['emit'](_0x2caf('0x51'),{'FaxInteractionId':Number(_0x4a2760[_0x377111]),'UserId':Number(_0x296305['id'])});}});}})[_0x2caf('0xa')](function(){if(_0x6814bc===_0x2caf('0x4a')){var _0x593593=_[_0x2caf('0x16')](_0x296305['SmsInteractions'],'id');return _0x296305[_0x2caf('0x52')](_0x593593)[_0x2caf('0xa')](function(){for(var _0x5b0e2e=0x0;_0x5b0e2e<_0x593593['length'];_0x5b0e2e+=0x1){_0x5231fc[_0x2caf('0x4c')](_0x2caf('0x53'),{'SmsInteractionId':Number(_0x593593[_0x5b0e2e]),'UserId':Number(_0x296305['id'])});}});}})[_0x2caf('0xa')](function(){if(_0x6814bc===_0x2caf('0x4a')){var _0xb3d0c=_['map'](_0x296305[_0x2caf('0x29')],'id');return _0x296305[_0x2caf('0x54')](_0xb3d0c)['then'](function(){for(var _0x3c7eed=0x0;_0x3c7eed<_0xb3d0c[_0x2caf('0x19')];_0x3c7eed+=0x1){_0x5231fc['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xb3d0c[_0x3c7eed]),'UserId':Number(_0x296305['id'])});}});}})[_0x2caf('0xa')](function(){if(_0x6814bc==='leave'){var _0x2e8de2=_[_0x2caf('0x16')](_0x296305[_0x2caf('0x2b')],'id');return _0x296305[_0x2caf('0x55')](_0x2e8de2)[_0x2caf('0xa')](function(){for(var _0x47aa69=0x0;_0x47aa69<_0x2e8de2[_0x2caf('0x19')];_0x47aa69+=0x1){_0x5231fc['emit'](_0x2caf('0x56'),{'WhatsappInteractionId':Number(_0x2e8de2[_0x47aa69]),'UserId':Number(_0x296305['id'])});}});}})['catch'](function(_0x4241cd){_0xb60d47['log'](_0x4241cd);});}}function onDisconnect(_0x571852,_0x30f79e){joinOrLeave(_0x571852,'leave',_0x30f79e);}function onConnect(_0x4419fc){joinOrLeave(_0x4419fc,'join');}exports['default']=function(_0x44ad75){_0x44ad75['on'](_0x2caf('0x57'),function(_0x380c2e){_0x380c2e[_0x2caf('0x58')](0x0);_0x380c2e[_0x2caf('0x59')]=_0x380c2e['request'][_0x2caf('0x57')][_0x2caf('0x5a')]+':'+_0x380c2e['request'][_0x2caf('0x57')]['remotePort'];_0x380c2e[_0x2caf('0x5b')]=new Date();_0x380c2e[_0x2caf('0x5c')]=function(_0x4399ec){console[_0x2caf('0x5c')](_0x2caf('0x5d')+_0x380c2e['nsp']['name']+'['+_0x380c2e[_0x2caf('0x59')]+']',_0x4399ec);};_0x380c2e['on'](_0x2caf('0x5e'),function(){onDisconnect(_0x380c2e,_0x44ad75);_0x380c2e[_0x2caf('0x5c')](_0x2caf('0x5f'));});onConnect(_0x380c2e);_0x380c2e[_0x2caf('0x5c')](_0x2caf('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 6b546ad..e61c262 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 _0x3d32=['SELECT','contact','UserId','interface','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','QueryTypes','format','name','AfterCreate','closed','changed','substatus','Sequelize','SIP/%s','User','find','fullname','email','internal','default','hasOwnProperty','model','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','afterUpdate','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','motionChannel','event','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x3d32,0x134));var _0x23d3=function(_0x3c7f74,_0x160082){_0x3c7f74=_0x3c7f74-0x0;var _0xa4b996=_0x3d32[_0x3c7f74];return _0xa4b996;};'use strict';var util=require('util');var db=require(_0x23d3('0x0'))['db'];var jayson=require(_0x23d3('0x1'));var logger=require(_0x23d3('0x2'))(_0x23d3('0x3'));var client=jayson[_0x23d3('0x4')][_0x23d3('0x5')]({'port':0x232a});var triggers=[{'channel':_0x23d3('0x6'),'model':_0x23d3('0x7'),'event':_0x23d3('0x8'),'condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0x6'),'model':_0x23d3('0x7'),'event':'afterUpdate','condition':_0x23d3('0xa'),'callback':afterUpdate},{'channel':_0x23d3('0x6'),'model':_0x23d3('0xb'),'event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage},{'channel':_0x23d3('0xd'),'model':_0x23d3('0xe'),'event':'afterCreate','condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0xd'),'model':_0x23d3('0xe'),'event':_0x23d3('0xf'),'condition':_0x23d3('0xa'),'callback':afterUpdate},{'channel':_0x23d3('0xd'),'model':'SmsMessage','event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage},{'channel':_0x23d3('0x10'),'model':'WhatsappInteraction','event':_0x23d3('0x8'),'condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0x10'),'model':_0x23d3('0x11'),'event':_0x23d3('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x23d3('0x10'),'model':'WhatsappMessage','event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage},{'channel':_0x23d3('0x12'),'model':_0x23d3('0x13'),'event':_0x23d3('0x8'),'condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0x12'),'model':_0x23d3('0x13'),'event':_0x23d3('0xf'),'condition':_0x23d3('0xa'),'callback':afterUpdate},{'channel':_0x23d3('0x12'),'model':_0x23d3('0x14'),'event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage},{'channel':_0x23d3('0x15'),'model':_0x23d3('0x16'),'event':_0x23d3('0x8'),'condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0x15'),'model':'MailInteraction','event':'afterUpdate','condition':_0x23d3('0xa'),'callback':afterUpdate},{'channel':'Mail','model':_0x23d3('0x17'),'event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x23d3('0x18'),'event':_0x23d3('0x8'),'condition':_0x23d3('0x9'),'callback':afterCreate},{'channel':_0x23d3('0x19'),'model':_0x23d3('0x18'),'event':_0x23d3('0xf'),'condition':_0x23d3('0xa'),'callback':afterUpdate},{'channel':_0x23d3('0x19'),'model':'OpenchannelMessage','event':_0x23d3('0x8'),'condition':_0x23d3('0xc'),'callback':afterCreateMessage}];function request(_0x2f70fc){return client['request'](_0x23d3('0x1a'),_0x2f70fc)[_0x23d3('0x1b')](function(_0x3fd40f){logger[_0x23d3('0x1c')](_0x23d3('0x1d'),'EventManager',_0x3fd40f);if(_0x3fd40f[_0x23d3('0x1e')]){if(_0x3fd40f[_0x23d3('0x1e')][_0x23d3('0x1f')]===0x1f4){logger[_0x23d3('0x1e')](_0x23d3('0x1d'),_0x23d3('0x1a'),_0x3fd40f[_0x23d3('0x1e')]);}}})[_0x23d3('0x20')](function(_0xfd63de){logger['error'](_0x23d3('0x1d'),_0x23d3('0x1a'),_0xfd63de);});}function afterCreateMessage(_0xce4bf1){return function(_0x5b8120){_0x5b8120=_0x5b8120[_0x23d3('0x21')]({'plain':!![]});_0x5b8120['channel']=_0xce4bf1;_0x5b8120[_0x23d3('0x22')]=_0xce4bf1;_0x5b8120[_0x23d3('0x23')]=_0x5b8120['direction'];Promise[_0x23d3('0x24')]()[_0x23d3('0x1b')](function(){if(typeof _0x5b8120[_0x23d3('0x25')]===_0x23d3('0x26'))return null;var _0x5e4157=_0x23d3('0x27')+_0x5b8120[_0x23d3('0x25')];return db[_0x23d3('0x28')][_0x23d3('0x29')](_0x5e4157,{'type':db['Sequelize']['QueryTypes'][_0x23d3('0x2a')],'raw':!![]});})['then'](function(_0x36d4b8){if(_0x36d4b8){_0x5b8120[_0x23d3('0x2b')]=_0x36d4b8[0x0];}if(typeof _0x5b8120[_0x23d3('0x2c')]==='undefined')return;return getAgent(_0x5b8120[_0x23d3('0x2c')]);})['then'](function(_0x1740a7){if(_0x1740a7){_0x5b8120[_0x23d3('0x2d')]=util['format']('SIP/%s',_0x1740a7['name']);_0x5b8120[_0x23d3('0x2e')]=_0x1740a7;_0x5b8120[_0x23d3('0x2f')]=_0xce4bf1;return request({'event':_0x23d3('0x30'),'message':_0x5b8120});}else{return request({'event':_0x23d3('0x31'),'message':_0x5b8120});}})[_0x23d3('0x20')](function(_0x1beb0e){logger['error'](_0x23d3('0x1d'),_0x23d3('0x32'),_0x1beb0e);});};}function afterCreate(_0x13a012,_0x2b268b){return function(_0x5603c4){_0x5603c4=_0x5603c4[_0x23d3('0x21')]({'plain':!![]});_0x5603c4[_0x23d3('0x2f')]=_0x13a012;_0x5603c4['motionChannel']=_0x13a012;_0x5603c4[_0x23d3('0x23')]='opened';Promise['resolve']()[_0x23d3('0x1b')](function(){var _0x388e08=_0x23d3('0x27')+_0x5603c4['ContactId'];return db[_0x23d3('0x28')][_0x23d3('0x29')](_0x388e08,{'type':db['Sequelize'][_0x23d3('0x33')][_0x23d3('0x2a')],'raw':!![]});})['then'](function(_0x203caf){if(_0x203caf){_0x5603c4[_0x23d3('0x2b')]=_0x203caf[0x0];}if(typeof _0x5603c4[_0x23d3('0x2c')]===_0x23d3('0x26'))return;return getAgent(_0x5603c4[_0x23d3('0x2c')]);})[_0x23d3('0x1b')](function(_0x2020aa){if(_0x2020aa){_0x5603c4[_0x23d3('0x2d')]=util[_0x23d3('0x34')]('SIP/%s',_0x2020aa[_0x23d3('0x35')]);_0x5603c4['agent']=_0x2020aa;}return request({'event':_0x2b268b,'message':_0x5603c4});})[_0x23d3('0x20')](function(_0x4198e9){logger[_0x23d3('0x1e')](_0x23d3('0x1d'),_0x23d3('0x36'),_0x4198e9);});};}function afterUpdate(_0xb76f3a){return function(_0x560757){var _0x5da404=_0x560757['changed'](_0x23d3('0x37'))&&_0x560757[_0x23d3('0x37')];var _0x4df827=_0x560757[_0x23d3('0x38')](_0x23d3('0x39'));if(_0x5da404||_0x4df827){var _0x2aa517=_0x5da404?'closedinteraction':'substatus';var _0x229b5e=_0x560757[_0x23d3('0x21')]({'plain':!![]});_0x229b5e[_0x23d3('0x2f')]=_0xb76f3a;_0x229b5e[_0x23d3('0x22')]=_0xb76f3a;_0x229b5e[_0x23d3('0x23')]=_0x5da404?'closed':'substatus';var _0x389fe8=_0x23d3('0x27')+_0x229b5e['ContactId'];return db[_0x23d3('0x28')][_0x23d3('0x29')](_0x389fe8,{'type':db[_0x23d3('0x3a')][_0x23d3('0x33')]['SELECT'],'raw':!![]})[_0x23d3('0x1b')](function(_0x4b1d72){if(_0x4b1d72){_0x229b5e['contact']=_0x4b1d72[0x0];}if(typeof _0x229b5e[_0x23d3('0x2c')]==='undefined')return;return getAgent(_0x229b5e['UserId']);})[_0x23d3('0x1b')](function(_0x2f072d){if(_0x2f072d){_0x229b5e[_0x23d3('0x2d')]=util[_0x23d3('0x34')](_0x23d3('0x3b'),_0x2f072d['name']);_0x229b5e[_0x23d3('0x2e')]=_0x2f072d;}return request({'event':_0x2aa517,'message':_0x229b5e});})[_0x23d3('0x20')](function(_0x305bc9){logger['error'](_0x23d3('0x1d'),'AfterUpdate',_0x305bc9);});}};}function getAgent(_0x5054df){return db[_0x23d3('0x3c')][_0x23d3('0x3d')]({'where':{'id':_0x5054df},'attributes':['id',_0x23d3('0x35'),_0x23d3('0x3e'),_0x23d3('0x3f'),_0x23d3('0x40')],'raw':!![]})['then'](function(_0x10182f){return _0x10182f;});}exports[_0x23d3('0x41')]=function(){for(var _0x4437c8=0x0;_0x4437c8=_0x3b8ecd[_0x6bc7('0x13')]){throw Error(_0x6bc7('0x14'));}_0x274594(_0x31fe87);})[_0x6bc7('0x15')](function(_0x8a71cf){_0x219095(_0x8a71cf);});});}; \ No newline at end of file +var _0xe31f=['fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','agent','User','count','then','agents','catch','lodash','../mysqldb','voice','mail','chat'];(function(_0x62c2b8,_0x1210e6){var _0x37810f=function(_0x424096){while(--_0x424096){_0x62c2b8['push'](_0x62c2b8['shift']());}};_0x37810f(++_0x1210e6);}(_0xe31f,0xe1));var _0xfe31=function(_0x194164,_0x4bafa7){_0x194164=_0x194164-0x0;var _0x2c6564=_0xe31f[_0x194164];return _0x2c6564;};'use strict';var _=require(_0xfe31('0x0'));var BPromise=require('bluebird');var db=require(_0xfe31('0x1'))['db'];var util=require('./license/util');var channels=[_0xfe31('0x2'),_0xfe31('0x3'),_0xfe31('0x4'),_0xfe31('0x5'),_0xfe31('0x6'),_0xfe31('0x7'),_0xfe31('0x8')];exports[_0xfe31('0x9')]=function(){return channels;};exports[_0xfe31('0xa')]=function(_0x464e45){_0x464e45=_0x464e45[_0xfe31('0xb')]();return _[_0xfe31('0xc')](channels,_0x464e45);};exports[_0xfe31('0xd')]=function(_0x4728ac,_0xea3f41,_0x5e2688,_0x44d753){var _0x28fd03={'loginAttempts':_0xea3f41,'blocked':_0x5e2688};if(!_[_0xfe31('0xe')](_0x44d753)){_0x28fd03[_0xfe31('0xf')]=_0x44d753;}return _0x4728ac['updateAttributes'](_0x28fd03);};exports[_0xfe31('0x10')]=function(_0x2deef5){return new BPromise(function(_0x15987d,_0x43512e){var _0x90d70c=0x0;if(_0x2deef5['role']!==_0xfe31('0x11')){_0x15987d(_0x2deef5);}db[_0xfe31('0x12')][_0xfe31('0x13')]({'where':{'role':_0xfe31('0x11'),'online':!![],'id':{'$ne':_0x2deef5['id']}}})[_0xfe31('0x14')](function(_0x3ae8f7){_0x90d70c=_0x3ae8f7;return util['getLicense']();})[_0xfe31('0x14')](function(_0x2c8890){if(_0x2c8890&&_0x2c8890[_0xfe31('0x15')]&&_0x90d70c>=_0x2c8890[_0xfe31('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x15987d(_0x2deef5);})[_0xfe31('0x16')](function(_0xb10870){_0x43512e(_0xb10870);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c893b68..7f09640 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49ce=['render','json','404','status'];(function(_0x5c7820,_0xe48ef2){var _0x3be846=function(_0x44ad36){while(--_0x44ad36){_0x5c7820['push'](_0x5c7820['shift']());}};_0x3be846(++_0xe48ef2);}(_0x49ce,0x116));var _0xe49c=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x49ce[_0x9dfc10];return _0x4f938a;};'use strict';module['exports'][0x194]=function pageNotFound(_0xdcf4ac,_0x19cb90){var _0x40235b=_0xe49c('0x0');var _0x4e7a6b=0x194;var _0x29d21d={'status':_0x4e7a6b};_0x19cb90[_0xe49c('0x1')](_0x29d21d[_0xe49c('0x1')]);_0x19cb90[_0xe49c('0x2')](_0x40235b,{},function(_0x1d1206,_0x44e4ac){if(_0x1d1206){return _0x19cb90[_0xe49c('0x1')](_0x29d21d[_0xe49c('0x1')])[_0xe49c('0x3')](_0x29d21d);}_0x19cb90['send'](_0x44e4ac);});}; \ No newline at end of file +var _0x6208=['json','send','404','status','render'];(function(_0x372f58,_0x58ff51){var _0x25256f=function(_0x52ba98){while(--_0x52ba98){_0x372f58['push'](_0x372f58['shift']());}};_0x25256f(++_0x58ff51);}(_0x6208,0x192));var _0x8620=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x6208[_0x24259d];return _0x5a701;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1a624c,_0x43d174){var _0x465a01=_0x8620('0x0');var _0x3c4829=0x194;var _0x1a2279={'status':_0x3c4829};_0x43d174[_0x8620('0x1')](_0x1a2279[_0x8620('0x1')]);_0x43d174[_0x8620('0x2')](_0x465a01,{},function(_0x42c3e9,_0x47a088){if(_0x42c3e9){return _0x43d174[_0x8620('0x1')](_0x1a2279[_0x8620('0x1')])[_0x8620('0x3')](_0x1a2279);}_0x43d174[_0x8620('0x4')](_0x47a088);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index e080f80..1042707 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','Hoppers','HopperFinals','VoiceQueueId','CmHopperHistory','TrunkId','belongsTo','TrunkBackup','Interval','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','MailServerOut','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','List','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Dashboard','Items','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Users','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','Owner','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','mandatoryDispositionPause','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','Attachments','Website','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Agent','OwnerId','CampaignId','All','Any','AutomationId','Extensions','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','Field','Variable','Configurations','DeskField','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','VtigerConfiguration','VtigerAccount','ServicenowAccount','Dynamics365Field','FromId','ToId','SessionId','ProjectId','JscriptyAnswerReport','user_has_teams','TeamVoiceQueue','VoiceQueues','team_has_chat_queues','WhatsappQueues','HopperHistories','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','CmCustomField','Queues','UserProfileSections','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network'];(function(_0x3f577f,_0x1394ed){var _0x3aa47d=function(_0x680ea0){while(--_0x680ea0){_0x3f577f['push'](_0x3f577f['shift']());}};_0x3aa47d(++_0x1394ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['Trigger']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['Variable']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/variable/variable.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['AnalyticExtractedReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticMetric']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['SalesforceField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['DeskField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['ZohoAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['VtigerAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['ServicenowAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['Dynamics365Field']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x8c'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db['JscriptyAnswerReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['SquareReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['SquareProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareMessage']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/team/team.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Migration']=db['sequelize'][_0x0a9e('0x12')]('../api/migration/migration.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/attachment/attachment.model');db['Plugin']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/plugin/plugin.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['OpenchannelTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['UserProfileSection']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userNotification/userNotification.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappQueue/whatsappQueue.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['TeamVoiceQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x11')][_0x0a9e('0x105')](db['VoiceMail'],{'as':_0x0a9e('0x106'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x108')});db['User'][_0x0a9e('0x109')](db[_0x0a9e('0x10a')],{'as':_0x0a9e('0x10b'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x10c'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['CmHopperHistory'],{'as':_0x0a9e('0x10d'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x10e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x10f'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x110'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')]['hasMany'](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db['WhatsappInteraction'],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x11')][_0x0a9e('0x109')](db[_0x0a9e('0xf2')],{'as':_0x0a9e('0x116'),'foreignKey':_0x0a9e('0x117')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xee')],{'as':_0x0a9e('0xee'),'foreignKey':_0x0a9e('0x118')});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x11a'),'through':_0x0a9e('0x11b')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x11e')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x120')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':'user_has_teams'});db[_0x0a9e('0x11')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':_0x0a9e('0x121')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x64')],{'as':'ChatInteractions','through':_0x0a9e('0x122')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'through':'user_has_fax_interactions'});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x110'),'through':'user_has_sms_interactions'});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','through':_0x0a9e('0x123')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['WhatsappInteraction'],{'as':_0x0a9e('0x115'),'through':_0x0a9e('0x124')});db[_0x0a9e('0x11')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xec')],{'as':'VoicePrefixes','through':_0x0a9e('0x103'),'required':![]});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x3c')],{'as':_0x0a9e('0x125'),'through':'UserMailQueue','required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x67')],{'as':'ChatQueues','through':_0x0a9e('0x126'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x119')](db['FaxQueue'],{'as':_0x0a9e('0x127'),'through':'UserFaxQueue','required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x128'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['OpenchannelQueue'],{'as':_0x0a9e('0x129'),'through':_0x0a9e('0x35'),'required':![]});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0xfd')],{'as':'WhatsappQueues','through':_0x0a9e('0x37'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['CmList'],{'through':_0x0a9e('0x120')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x12a'),'through':_0x0a9e('0x12b')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x12c'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x12d'),'through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0x59')],{'as':'OpenchannelAccounts','through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db['SmsAccount'],{'as':_0x0a9e('0x130'),'through':_0x0a9e('0x131')});db[_0x0a9e('0x11')][_0x0a9e('0x119')](db[_0x0a9e('0xf3')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x133')});db['User'][_0x0a9e('0x119')](db[_0x0a9e('0x134')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x136')});db[_0x0a9e('0x13')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x0a9e('0x137')});db[_0x0a9e('0x138')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x16')][_0x0a9e('0x109')](db['VoiceExtension'],{'as':_0x0a9e('0x139'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x18')][_0x0a9e('0x119')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db['VoiceQueue'][_0x0a9e('0x109')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x13c'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':'HopperHistories','foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')][_0x0a9e('0x109')](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':_0x0a9e('0x13f')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0xcc')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x13f')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x0a9e('0x28'),'foreignKey':_0x0a9e('0x141')});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x143'),'foreignKey':'TrunkBackupId'});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x1a')][_0x0a9e('0x142')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['VoiceQueue'][_0x0a9e('0x119')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x147')});db[_0x0a9e('0x1a')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x0a9e('0x119')](db['Team'],{'as':_0x0a9e('0x149'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x0a9e('0x119')](db['CmList'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x14b')});db[_0x0a9e('0x10a')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db['ScreenRecording']['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x106')][_0x0a9e('0x109')](db[_0x0a9e('0x1f')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x14d'),'sourceKey':_0x0a9e('0x14e')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0x0a9e('0x14d'),'targetKey':_0x0a9e('0x14e')});db[_0x0a9e('0x14f')][_0x0a9e('0x109')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x150'),'foreignKey':_0x0a9e('0x151'),'constraints':![]});db[_0x0a9e('0x14f')]['hasMany'](db['VoiceAgentReport'],{'as':_0x0a9e('0x152'),'foreignKey':_0x0a9e('0x151'),'constraints':![]});db['VoiceCallReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x14f')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x39')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':'MailAccount','foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x156')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x105')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x157'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3b')]['hasOne'](db['MailServerOut'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x155'),'onDelete':'cascade'});db[_0x0a9e('0x3b')]['hasMany'](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x3e')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x3b')][_0x0a9e('0x109')](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x139')});db['MailAccount']['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':'ListId'});db['MailAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x88'),'foreignKey':'TemplateId'});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['MailAccount'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':'user_has_mail_accounts'});db[_0x0a9e('0x3c')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x160'),'as':_0x0a9e('0x149')});db[_0x0a9e('0x113')][_0x0a9e('0x109')](db[_0x0a9e('0x3e')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x113')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x113')]['belongsTo'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x113')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['MailInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x163'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x113')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x163'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x113')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x121'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x3e')][_0x0a9e('0x109')](db[_0x0a9e('0xe1')],{'as':'Attachments','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x3e')]['belongsTo'](db['User'],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x113')],{'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x155')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x60'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x3e')][_0x0a9e('0x142')](db[_0x0a9e('0x66')],{'as':'ChatOfflineMessage','foreignKey':_0x0a9e('0x168')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')]['belongsTo'](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x0a9e('0x15e')][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['MailQueueReport'][_0x0a9e('0x142')](db['MailAccount'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['CmList'],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['MailQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':'Contact','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db[_0x0a9e('0x113')],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['MailMessage'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db['User'],{});db[_0x0a9e('0x16b')][_0x0a9e('0x142')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x16d')][_0x0a9e('0x109')](db[_0x0a9e('0x43')],{'as':_0x0a9e('0x16e'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0a9e('0x16f'),'onDelete':_0x0a9e('0x107')});db['FaxAccount']['hasMany'](db[_0x0a9e('0x15b')],{'as':'Answers','foreignKey':_0x0a9e('0x16f')});db[_0x0a9e('0x45')][_0x0a9e('0x109')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x139')});db['FaxAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x170'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x45')][_0x0a9e('0x109')](db[_0x0a9e('0x4a')],{'as':'Messages'});db[_0x0a9e('0x45')]['belongsTo'](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x28')});db['FaxAccount'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c')});db['FaxAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db['FaxAccount'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x171')});db[_0x0a9e('0x47')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':'restrict'});db['FaxApplication'][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['FaxInteraction'][_0x0a9e('0x109')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x162'),'foreignKey':'FaxAccountId'});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x111')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db['Tag'],{'through':_0x0a9e('0x173'),'as':'Tags'});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x111')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x175'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x11')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db[_0x0a9e('0x4a')][_0x0a9e('0x142')](db[_0x0a9e('0xe1')],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db['FaxMessage'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x162'),'foreignKey':'FaxAccountId'});db[_0x0a9e('0x4c')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x177'),'as':_0x0a9e('0x149')});db['FaxQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{});db['FaxQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':'ListId'});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x111')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db['FaxMessage'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db['User'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{});db['SmsAccount']['hasMany'](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x50')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x0a9e('0x109')](db['SmsMessage'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x178')});db[_0x0a9e('0x50')][_0x0a9e('0x109')](db['SmsInteraction'],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x52')],{'as':'Applications'});db[_0x0a9e('0x50')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0x50')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x146')});db[_0x0a9e('0x50')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x131')});db[_0x0a9e('0x52')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db[_0x0a9e('0x57')],{'onDelete':'restrict'});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x0a9e('0x52')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x52')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db['SmsInteraction'][_0x0a9e('0x109')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x178')});db[_0x0a9e('0x53')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x53')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x108')});db['SmsInteraction']['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x164')});db['SmsInteraction']['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x17a'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x53')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x17c')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db['SmsMessage']['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':'cascade','as':_0x0a9e('0x153')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x17c')});db[_0x0a9e('0x55')][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x178')});db['SmsQueue'][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x34'),'foreignKey':'SmsQueueId'});db[_0x0a9e('0x57')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x17d'),'as':_0x0a9e('0x149')});db[_0x0a9e('0x59')]['hasMany'](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':_0x0a9e('0x17e'),'onDelete':'cascade'});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':'Answers','foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x15d'),'foreignKey':_0x0a9e('0x17e')});db['OpenchannelAccount']['hasMany'](db[_0x0a9e('0x5e')],{'as':_0x0a9e('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x0a9e('0x59')][_0x0a9e('0x109')](db[_0x0a9e('0x5b')],{'as':_0x0a9e('0x139'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x59')]['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['OpenchannelAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db['OpenchannelAccount']['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x12f')});db['OpenchannelApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x5b')][_0x0a9e('0x142')](db[_0x0a9e('0x180')],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x181')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x0a9e('0x5b')]['belongsTo'](db[_0x0a9e('0x144')],{'onDelete':_0x0a9e('0x169'),'foreignKey':'IntervalId'});db[_0x0a9e('0x5b')][_0x0a9e('0x142')](db['Tag'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0x5d')][_0x0a9e('0x109')](db[_0x0a9e('0x5e')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x5d')][_0x0a9e('0x142')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['OpenchannelInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x182'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x5d')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x182'),'as':_0x0a9e('0x165')});db['OpenchannelInteraction']['belongsToMany'](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x123'),'foreignKey':_0x0a9e('0x183')});db[_0x0a9e('0x5e')][_0x0a9e('0x142')](db['User'],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x11')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db['OpenchannelMessage'][_0x0a9e('0x142')](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x183')});db[_0x0a9e('0x5e')]['belongsTo'](db['Attachment'],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db[_0x0a9e('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x17e')});db[_0x0a9e('0x180')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x180')][_0x0a9e('0x119')](db['Team'],{'through':_0x0a9e('0x184'),'as':'Teams'});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'ChatWebsiteId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x185')],{'as':'ProactiveActions'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x15d')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x139')});db[_0x0a9e('0x60')][_0x0a9e('0x109')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x14c')});db['ChatWebsite'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0x60')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':'IntervalId'});db[_0x0a9e('0x60')][_0x0a9e('0x142')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x60')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db['ChatWebsite'][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x12b')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x59')],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db['OpenchannelQueueReport'][_0x0a9e('0x142')](db['OpenchannelInteraction'],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0x5e')],{});db[_0x0a9e('0x62')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')]['belongsTo'](db[_0x0a9e('0x180')],{});db['ChatApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Agent','foreignKey':_0x0a9e('0x108'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x63')][_0x0a9e('0x142')](db['ChatQueue'],{'as':_0x0a9e('0x186'),'foreignKey':_0x0a9e('0x187'),'onDelete':'restrict'});db[_0x0a9e('0x63')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0a9e('0x167'),'onDelete':_0x0a9e('0x169')});db['ChatApplication'][_0x0a9e('0x142')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0x64')][_0x0a9e('0x109')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x188')});db['ChatInteraction'][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x64')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db[_0x0a9e('0x64')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x189'),'as':_0x0a9e('0x164')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x189'),'as':_0x0a9e('0x165')});db[_0x0a9e('0x64')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x122'),'foreignKey':'ChatInteractionId'});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':'cascade','as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db['ChatInteraction'],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x65')]['belongsTo'](db['Attachment'],{'as':_0x0a9e('0xe1'),'foreignKey':_0x0a9e('0x176')});db[_0x0a9e('0x65')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x66')][_0x0a9e('0x109')](db[_0x0a9e('0xe1')],{'as':_0x0a9e('0x18a'),'foreignKey':_0x0a9e('0x168'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x66')]['belongsTo'](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x67')][_0x0a9e('0x119')](db['User'],{'as':'Agents','through':_0x0a9e('0x126'),'hooks':!![]});db[_0x0a9e('0x67')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':'team_has_chat_queues','as':_0x0a9e('0x149')});db[_0x0a9e('0x68')][_0x0a9e('0x109')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x14c'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x0a9e('0x68')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x13c'),'through':_0x0a9e('0x11b')});db[_0x0a9e('0x185')][_0x0a9e('0x142')](db['ChatWebsite'],{'as':_0x0a9e('0x18b'),'foreignKey':_0x0a9e('0x167')});db[_0x0a9e('0x18c')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':_0x0a9e('0x154')});db['CmContact']['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x140')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x154')});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0xcc')],{'as':_0x0a9e('0x18e'),'foreignKey':'ContactId'});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')]['hasMany'](db['ChatInteraction'],{'as':_0x0a9e('0x10f'),'foreignKey':_0x0a9e('0x154'),'onDelete':'restrict'});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x169')});db['CmContact'][_0x0a9e('0x109')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')][_0x0a9e('0x109')](db['MailInteraction'],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x11c')][_0x0a9e('0x142')](db[_0x0a9e('0x18c')],{'as':_0x0a9e('0x18f'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x11c')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db['CmContact'][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x11e')});db['CmContact']['belongsToMany'](db[_0x0a9e('0x86')],{'as':'Tags','through':_0x0a9e('0x190')});db[_0x0a9e('0x11c')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x190'),'as':'ThroughTags'});db[_0x0a9e('0x6d')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db['CmList'],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x191'),'foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x186'),'foreignKey':'VoiceQueueId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')][_0x0a9e('0x142')](db[_0x0a9e('0xdf')],{'as':_0x0a9e('0xdf'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6d')]['belongsTo'](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x192')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db['VoiceQueue'],{'as':_0x0a9e('0x186'),'foreignKey':_0x0a9e('0x13f'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x6f')][_0x0a9e('0x142')](db[_0x0a9e('0xdf')],{'as':_0x0a9e('0xdf'),'foreignKey':_0x0a9e('0x193'),'onDelete':'cascade'});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0x0a9e('0x194'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')][_0x0a9e('0x109')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x195'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x76')][_0x0a9e('0x109')](db[_0x0a9e('0x74')],{'as':'Actions','foreignKey':_0x0a9e('0x196'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x159')][_0x0a9e('0x109')](db[_0x0a9e('0x159')],{'as':_0x0a9e('0x15a'),'foreignKey':'ParentId','onDelete':_0x0a9e('0x107')});db['Interval']['hasMany'](db[_0x0a9e('0x144')],{'as':'Intervals','foreignKey':_0x0a9e('0x145'),'onDelete':_0x0a9e('0x107'),'hooks':!![],'required':![]});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x197'),'foreignKey':_0x0a9e('0x145'),'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x144')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x198'),'foreignKey':'IntervalId'});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x199'),'foreignKey':'IntervalId'});db[_0x0a9e('0x144')][_0x0a9e('0x109')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x19a'),'foreignKey':_0x0a9e('0x145')});db['Interval']['hasMany'](db[_0x0a9e('0x52')],{'as':'SmsApplications','foreignKey':_0x0a9e('0x145')});db['Schedule'][_0x0a9e('0x142')](db['MailAccount'],{});db[_0x0a9e('0x82')]['belongsTo'](db[_0x0a9e('0x90')],{'foreignKey':_0x0a9e('0x19b')});db[_0x0a9e('0x82')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x19c')});db['Sound'][_0x0a9e('0x119')](db['VoiceMusicOnHold'],{'as':_0x0a9e('0x19d'),'through':'moh_has_sounds','onDelete':_0x0a9e('0x169')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x11c')],{'through':_0x0a9e('0x190')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x64')],{'through':_0x0a9e('0x189')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x113')],{'through':'mail_interaction_has_tags'});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x17a')});db[_0x0a9e('0x86')]['belongsToMany'](db['FaxInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x119')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x182')});db[_0x0a9e('0x86')][_0x0a9e('0x119')](db[_0x0a9e('0xf5')],{'through':_0x0a9e('0x19e')});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x0a9e('0x1a0')},'foreignKey':_0x0a9e('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db[_0x0a9e('0x7a')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x19f')][_0x0a9e('0x109')](db[_0x0a9e('0x74')],{'as':'Actions','foreignKey':_0x0a9e('0x1a2'),'onDelete':_0x0a9e('0x107'),'hooks':!![]});db[_0x0a9e('0x8e')]['hasMany'](db[_0x0a9e('0x94')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x0a9e('0x19c'),'hooks':!![]});db[_0x0a9e('0x90')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x0a9e('0x1a3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x19b')});db['AnalyticMetric'][_0x0a9e('0x109')](db[_0x0a9e('0x94')],{'as':_0x0a9e('0x1a3'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x0a9e('0x94')][_0x0a9e('0x142')](db[_0x0a9e('0x1a4')],{'foreignKey':_0x0a9e('0x1a5')});db['SalesforceAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x99')],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x99')]['hasMany'](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0x99')][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x99')][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x99')][_0x0a9e('0x142')](db[_0x0a9e('0x98')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1a7')]['hasMany'](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['SalesforceField'][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db['SalesforceField'][_0x0a9e('0x109')](db[_0x0a9e('0x1a7')],{'as':'Field','foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1a7')][_0x0a9e('0x142')](db['Variable'],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0x9c')][_0x0a9e('0x109')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x9e')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1a8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')][_0x0a9e('0x109')](db[_0x0a9e('0xa0')],{'as':'Descriptions','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x9e')]['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db['SugarcrmConfiguration']['belongsTo'](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0x0a9e('0x109')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa0')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1ae'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xa0')][_0x0a9e('0x109')](db['SugarcrmField'],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xa0')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['DeskAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xa2')][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1b3')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['DeskConfiguration'][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':'Fields','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xa2')][_0x0a9e('0x142')](db[_0x0a9e('0xa1')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xa2')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db[_0x0a9e('0x1b3')][_0x0a9e('0x109')](db['DeskField'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['DeskField'][_0x0a9e('0x109')](db[_0x0a9e('0x1b3')],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db['DeskField'][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0x1b4')]['hasMany'](db[_0x0a9e('0xa6')],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':'AccountId'});db[_0x0a9e('0xa6')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xa6')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x142')](db[_0x0a9e('0x1b4')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x109')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xa8')]['hasMany'](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':'FieldId'});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':'Variable','foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xaa')][_0x0a9e('0x109')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xac')]['hasMany'](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1a8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xac')][_0x0a9e('0x109')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xac')][_0x0a9e('0x109')](db['ZendeskField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xac')][_0x0a9e('0x142')](db['ZendeskAccount'],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xac')][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0xae')][_0x0a9e('0x109')](db['ZendeskField'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xae')]['hasMany'](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xae')][_0x0a9e('0x109')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xae')][_0x0a9e('0x142')](db['Variable'],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xaf')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1b6')][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1a8'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db['FreshdeskConfiguration'][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':'Descriptions','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['FreshdeskConfiguration']['hasMany'](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0xaf')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x0a9e('0x119')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x0a9e('0x109')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['FreshdeskField'][_0x0a9e('0x109')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb2')][_0x0a9e('0x109')](db['FreshdeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x0a9e('0xb2')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['VtigerAccount'][_0x0a9e('0x109')](db[_0x0a9e('0x1b7')],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1b7')]['hasMany'](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0x1b7')][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x1b7')][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0x1b7')][_0x0a9e('0x142')](db[_0x0a9e('0x1b8')],{'as':_0x0a9e('0x162'),'foreignKey':_0x0a9e('0x1a6')});db['VtigerField'][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['VtigerField'][_0x0a9e('0x109')](db[_0x0a9e('0xb5')],{'as':'Description','foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb5')]['hasMany'](db[_0x0a9e('0xb5')],{'as':'Field','foreignKey':_0x0a9e('0x1ac')});db['VtigerField'][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['ServicenowAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xb8')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1aa'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0xb8')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xb8')][_0x0a9e('0x142')](db[_0x0a9e('0x1b9')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xb9')][_0x0a9e('0x109')](db['ServicenowField'],{'as':_0x0a9e('0x1ad'),'foreignKey':'SubjectId'});db[_0x0a9e('0xb9')][_0x0a9e('0x109')](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db['ServicenowField'][_0x0a9e('0x109')](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xb9')]['belongsTo'](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['Dynamics365Account'][_0x0a9e('0x109')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x0a9e('0x107'),'foreignKey':'AccountId'});db[_0x0a9e('0xbc')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':'Subjects','onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xbc')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1aa'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ab')});db['Dynamics365Configuration'][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1a3'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1ac')});db['Dynamics365Configuration']['belongsTo'](db[_0x0a9e('0xba')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0x1ba')]['hasMany'](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x1a9')});db['Dynamics365Field'][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x1ab')});db[_0x0a9e('0x1ba')][_0x0a9e('0x109')](db[_0x0a9e('0x1ba')],{'as':_0x0a9e('0x1b0'),'foreignKey':'FieldId'});db[_0x0a9e('0x1ba')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db['FreshsalesAccount'][_0x0a9e('0x109')](db['FreshsalesConfiguration'],{'as':_0x0a9e('0x1b2'),'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1a6')});db['FreshsalesConfiguration'][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1a8'),'foreignKey':_0x0a9e('0x1a9')});db[_0x0a9e('0xbf')][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1aa'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xbf')][_0x0a9e('0x109')](db['FreshsalesField'],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1ac')});db[_0x0a9e('0xbf')]['belongsTo'](db[_0x0a9e('0xbe')],{'as':'Account','foreignKey':_0x0a9e('0x1a6')});db[_0x0a9e('0xc1')]['hasMany'](db['FreshsalesField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xc1')][_0x0a9e('0x109')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ae'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc1')]['hasMany'](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1b0'),'foreignKey':'FieldId'});db[_0x0a9e('0xc1')][_0x0a9e('0x142')](db[_0x0a9e('0x1b1')],{'as':_0x0a9e('0x1b1'),'foreignKey':_0x0a9e('0x1af')});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db['ChatWebsite'],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0x64')],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xc5')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x67')],{});db[_0x0a9e('0xc7')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1bb')});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x107'),'foreignKey':_0x0a9e('0x1bc')});db[_0x0a9e('0xcc')][_0x0a9e('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x0a9e('0x1bd'),'onDelete':'cascade'});db[_0x0a9e('0xcc')][_0x0a9e('0x109')](db['JscriptyAnswerReport'],{'foreignKey':_0x0a9e('0x1bd'),'onDelete':'cascade'});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db['SmsAccount'],{});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':'List','foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db['SmsQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xcd')][_0x0a9e('0x142')](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xcd')]['belongsTo'](db['SmsQueue'],{});db[_0x0a9e('0xd2')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x0a9e('0x1be')});db[_0x0a9e('0xd2')]['hasMany'](db[_0x0a9e('0xca')],{'foreignKey':_0x0a9e('0x1be')});db[_0x0a9e('0xd2')][_0x0a9e('0x109')](db[_0x0a9e('0x1bf')],{'foreignKey':'ProjectId'});db[_0x0a9e('0x134')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x136')});db[_0x0a9e('0xdc')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x1c0')});db[_0x0a9e('0xdc')]['belongsToMany'](db['VoiceQueue'],{'through':_0x0a9e('0x1c1'),'as':_0x0a9e('0x1c2')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x160'),'as':_0x0a9e('0x125')});db[_0x0a9e('0xdc')][_0x0a9e('0x119')](db['ChatQueue'],{'through':_0x0a9e('0x1c3'),'as':'ChatQueues'});db['Team'][_0x0a9e('0x119')](db['FaxQueue'],{'through':_0x0a9e('0x177'),'as':'FaxQueues'});db[_0x0a9e('0xdc')]['belongsToMany'](db['SmsQueue'],{'through':_0x0a9e('0x17d'),'as':_0x0a9e('0x128')});db[_0x0a9e('0xdc')]['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x0a9e('0x129')});db[_0x0a9e('0xdc')]['belongsToMany'](db[_0x0a9e('0xfd')],{'through':'team_has_whatsapp_queues','as':_0x0a9e('0x1c4')});db['Team'][_0x0a9e('0x119')](db[_0x0a9e('0xec')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db['Campaign'][_0x0a9e('0x109')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x13d'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x109')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':_0x0a9e('0x1c5'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')]['hasMany'](db['CmHopperBlack'],{'as':_0x0a9e('0x1c6'),'foreignKey':_0x0a9e('0x193')});db[_0x0a9e('0xdf')][_0x0a9e('0x142')](db['Trunk'],{'as':_0x0a9e('0x28'),'foreignKey':'TrunkId'});db[_0x0a9e('0xdf')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x0a9e('0xdf')][_0x0a9e('0x142')](db[_0x0a9e('0x144')],{'as':_0x0a9e('0x144'),'foreignKey':'IntervalId'});db['Campaign'][_0x0a9e('0x142')](db['SquareProject'],{'as':_0x0a9e('0x134'),'foreignKey':_0x0a9e('0x1c7')});db['Campaign'][_0x0a9e('0x119')](db['CmList'],{'as':_0x0a9e('0x11f'),'through':_0x0a9e('0x1c8')});db[_0x0a9e('0xdf')][_0x0a9e('0x119')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x1c9')});db[_0x0a9e('0xe1')][_0x0a9e('0x142')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x168')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x3e')],{});db[_0x0a9e('0xe2')]['belongsTo'](db[_0x0a9e('0x113')],{});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db['MailAccount'],{'foreignKey':_0x0a9e('0x1ca'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe2')][_0x0a9e('0x142')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':_0x0a9e('0x1cf')});db['MailTransferReport']['belongsTo'](db[_0x0a9e('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x0a9e('0x1d0')});db['ChatTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe4')]['belongsTo'](db[_0x0a9e('0x64')],{});db['ChatTransferReport']['belongsTo'](db[_0x0a9e('0x60')],{'foreignKey':_0x0a9e('0x1d1'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1d2'),'as':_0x0a9e('0x1cf')});db[_0x0a9e('0xe4')][_0x0a9e('0x142')](db[_0x0a9e('0x60')],{'foreignKey':_0x0a9e('0x1d3'),'as':_0x0a9e('0x1d0')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x4a')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x111')],{});db[_0x0a9e('0xe6')]['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1d4'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':_0x0a9e('0x1d5')});db[_0x0a9e('0xe6')][_0x0a9e('0x142')](db[_0x0a9e('0x4c')],{'foreignKey':_0x0a9e('0x1d6'),'as':'ToQueue'});db['FaxTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1d7'),'as':_0x0a9e('0x1d0')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x5e')],{});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x5d')],{});db['OpenchannelTransferReport'][_0x0a9e('0x142')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1cb')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1d5')});db[_0x0a9e('0x1d8')][_0x0a9e('0x142')](db['OpenchannelQueue'],{'foreignKey':_0x0a9e('0x1d9'),'as':_0x0a9e('0x1cf')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x0a9e('0x1d0')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x55')],{});db['SmsTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xe8')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x0a9e('0x1da'),'as':_0x0a9e('0x1cb')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':'ToAgent'});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1cf')});db[_0x0a9e('0xe8')][_0x0a9e('0x142')](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1db'),'as':'ToAccount'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'ListId','onDelete':'cascade'});db['CmList'][_0x0a9e('0x109')](db[_0x0a9e('0x1dc')],{'as':'CustomFields','foreignKey':'ListId'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db['CmHopperFinal'],{'as':_0x0a9e('0x13e'),'foreignKey':_0x0a9e('0x16c')});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x140')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x0a9e('0xea')][_0x0a9e('0x109')](db[_0x0a9e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x1dd'),'through':_0x0a9e('0x147')});db[_0x0a9e('0xea')][_0x0a9e('0x119')](db['User'],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x120')});db[_0x0a9e('0xec')][_0x0a9e('0x109')](db[_0x0a9e('0x16')],{'as':'Extensions','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xec')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':'UserVoicePrefix'});db[_0x0a9e('0xec')][_0x0a9e('0x119')](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x0a9e('0xee')][_0x0a9e('0x109')](db['User'],{'as':_0x0a9e('0x174'),'foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db['UserProfileSection'],{'as':_0x0a9e('0x1de'),'foreignKey':_0x0a9e('0x118'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0x1df')][_0x0a9e('0x109')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x1e0'),'foreignKey':_0x0a9e('0x1e1'),'onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db['Disposition'],{'as':_0x0a9e('0x15a'),'foreignKey':'WhatsappAccountId','onDelete':_0x0a9e('0x107')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db[_0x0a9e('0x15b')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x1e2')});db[_0x0a9e('0xf3')][_0x0a9e('0x109')](db[_0x0a9e('0xf7')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x15d')});db['WhatsappAccount'][_0x0a9e('0x109')](db[_0x0a9e('0xf4')],{'as':_0x0a9e('0x139')});db['WhatsappAccount'][_0x0a9e('0x142')](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['WhatsappAccount'][_0x0a9e('0x142')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x17f'),'foreignKey':_0x0a9e('0x146')});db[_0x0a9e('0xf3')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x133')});db[_0x0a9e('0xf4')]['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0xf4')]['belongsTo'](db[_0x0a9e('0xfd')],{'onDelete':_0x0a9e('0x169')});db[_0x0a9e('0xf4')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'onDelete':_0x0a9e('0x169')});db['WhatsappApplication'][_0x0a9e('0x142')](db['Interval'],{'onDelete':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0xf4')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x16a')});db[_0x0a9e('0xf5')][_0x0a9e('0x109')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x14c'),'onDelete':_0x0a9e('0x107'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xf5')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'as':_0x0a9e('0x162'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf5')][_0x0a9e('0x142')](db['CmContact'],{'as':_0x0a9e('0x153'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf5')]['belongsTo'](db[_0x0a9e('0x11')],{'as':'Owner','foreignKey':_0x0a9e('0x108')});db['WhatsappInteraction'][_0x0a9e('0x119')](db[_0x0a9e('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0x0a9e('0x164')});db[_0x0a9e('0xf5')][_0x0a9e('0x119')](db['Tag'],{'through':_0x0a9e('0x19e'),'as':'ThroughTags'});db[_0x0a9e('0xf5')][_0x0a9e('0x119')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x124'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0x11c')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x153')});db[_0x0a9e('0xf7')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{'onDelete':_0x0a9e('0x107'),'as':_0x0a9e('0x166'),'foreignKey':_0x0a9e('0x1e3')});db[_0x0a9e('0xf7')]['belongsTo'](db[_0x0a9e('0xf3')],{'as':'Account','foreignKey':_0x0a9e('0x1e2')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0xf3')],{});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0xea')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x16c')});db['WhatsappQueueReport'][_0x0a9e('0x142')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xfd')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0xf7')],{});db[_0x0a9e('0xf9')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf7')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf5')],{});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'foreignKey':'FromWhatsappAccountId','as':_0x0a9e('0x1cb')});db['WhatsappTransferReport'][_0x0a9e('0x142')](db[_0x0a9e('0xf3')],{'foreignKey':_0x0a9e('0x1e4'),'as':'ToAccount'});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0xfd')],{'foreignKey':'ToQueueId','as':_0x0a9e('0x1cf')});db[_0x0a9e('0xfb')][_0x0a9e('0x142')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1cc'),'as':_0x0a9e('0x1cd')});db[_0x0a9e('0xfb')]['belongsTo'](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ce'),'as':_0x0a9e('0x1d5')});db['WhatsappQueue']['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0xfd')][_0x0a9e('0x119')](db[_0x0a9e('0xdc')],{'through':_0x0a9e('0x1e5'),'as':_0x0a9e('0x149')});module[_0x0a9e('0x1e6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4483=['../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../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','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','hasOne','Imap','Smtp','Dispositions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','Dashboard','Items','Disposition','FaxAccountId','Answers','Interactions','FaxApplication','mandatoryDispositionPause','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','user_has_fax_interactions','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','Users','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','user_has_chat_websites','ChatApplication','Agent','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','AutomationAnyId','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceConfiguration','Descriptions','DescriptionId','Description','Field','FieldId','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','SugarcrmAccount','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','campaigns_has_cm_lists','MailTransferReport','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ChatTransferReport','FromUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromAccount','ToFaxQueueId','ToQueue','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','UserVoicePrefix','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_interactions','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../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/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication'];(function(_0x49e250,_0x59ea2b){var _0x365e15=function(_0x1b60cb){while(--_0x1b60cb){_0x49e250['push'](_0x49e250['shift']());}};_0x365e15(++_0x59ea2b);}(_0x4483,0x1a3));var _0x3448=function(_0x5e29d3,_0x967b8e){_0x5e29d3=_0x5e29d3-0x0;var _0x3c38a7=_0x4483[_0x5e29d3];return _0x3c38a7;};'use strict';var config=require(_0x3448('0x0'));var Sequelize=require(_0x3448('0x1'));var _=require(_0x3448('0x2'));var jstz=require('jstz');var timezone=jstz[_0x3448('0x3')]();config[_0x3448('0x1')]=_[_0x3448('0x4')](config[_0x3448('0x1')],{'database':_0x3448('0x5'),'username':'xcall','password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});config[_0x3448('0xd')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x3448('0x5'),'username':_0x3448('0xe'),'password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0x1')][_0x3448('0xf')],config['sequelize']['username'],config[_0x3448('0x1')][_0x3448('0x10')],config['sequelize'][_0x3448('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0xd')][_0x3448('0xf')],config['sequelizeHistory'][_0x3448('0x12')],config[_0x3448('0xd')]['password'],config[_0x3448('0xd')][_0x3448('0x11')])};db[_0x3448('0x13')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x15'));db[_0x3448('0x16')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x17'));db[_0x3448('0x18')]=db[_0x3448('0x1')]['import'](_0x3448('0x19'));db['VoiceExtension']=db['sequelize']['import'](_0x3448('0x1a'));db[_0x3448('0x1b')]=db[_0x3448('0x1')]['import'](_0x3448('0x1c'));db[_0x3448('0x1d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x1e'));db[_0x3448('0x1f')]=db['sequelize']['import']('../api/voiceRecording/voiceRecording.model');db[_0x3448('0x20')]=db[_0x3448('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x3448('0x21')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x22'));db[_0x3448('0x23')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x24'));db[_0x3448('0x25')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x3448('0x26')]=db[_0x3448('0x1')]['import'](_0x3448('0x27'));db[_0x3448('0x28')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x29'));db[_0x3448('0x2a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x3448('0x2b')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/memberReport/memberReport.model');db[_0x3448('0x2c')]=db['sequelize']['import']('../api/trunk/trunk.model');db[_0x3448('0x2d')]=db[_0x3448('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3448('0x2e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x2f'));db['UserVoiceQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x30'));db['UserChatQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x31'));db[_0x3448('0x32')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x33'));db[_0x3448('0x34')]=db[_0x3448('0x1')]['import'](_0x3448('0x35'));db[_0x3448('0x36')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x37'));db[_0x3448('0x38')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x39'));db[_0x3448('0x3a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x3448('0x1')]['import'](_0x3448('0x3b'));db[_0x3448('0x3c')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailAccount/mailAccount.model');db[_0x3448('0x3d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x3e'));db[_0x3448('0x3f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x40'));db[_0x3448('0x41')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x42'));db[_0x3448('0x43')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailMessage/mailMessage.model');db[_0x3448('0x44')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x45'));db[_0x3448('0x46')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x47'));db['Dashboard']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x48'));db['DashboardItem']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x49'));db[_0x3448('0x4a')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4b'));db['FaxApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4c'));db[_0x3448('0x4d')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x3448('0x4e')]=db['sequelize']['import'](_0x3448('0x4f'));db[_0x3448('0x50')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x51'));db['FaxQueueReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3448('0x52')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x53'));db[_0x3448('0x54')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x55'));db[_0x3448('0x56')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x57'));db[_0x3448('0x58')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsQueue/smsQueue.model');db[_0x3448('0x59')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x5a'));db['OpenchannelApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5b'));db[_0x3448('0x5c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5d'));db['OpenchannelMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5e'));db[_0x3448('0x5f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x60'));db['ChatApplication']=db['sequelize']['import'](_0x3448('0x61'));db[_0x3448('0x62')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x63'));db['ChatMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/chatMessage/chatMessage.model');db[_0x3448('0x64')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x65'));db[_0x3448('0x66')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x67'));db[_0x3448('0x68')]=db['sequelize'][_0x3448('0x14')]('../api/chatGroup/chatGroup.model');db[_0x3448('0x69')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6a'));db[_0x3448('0x6b')]=db[_0x3448('0x1')]['import'](_0x3448('0x6c'));db['CmContact']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6d'));db[_0x3448('0x6e')]=db[_0x3448('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x3448('0x6f')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x3448('0x70')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x71'));db[_0x3448('0x72')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x73'));db[_0x3448('0x74')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x75'));db[_0x3448('0x76')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x77'));db[_0x3448('0x78')]=db[_0x3448('0x1')]['import'](_0x3448('0x79'));db['Automation']=db[_0x3448('0x1')]['import'](_0x3448('0x7a'));db[_0x3448('0x7b')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x7c'));db['Disposition']=db['sequelize'][_0x3448('0x14')]('../api/disposition/disposition.model');db['Condition']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7d'));db[_0x3448('0x7e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7f'));db[_0x3448('0x80')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x81'));db[_0x3448('0x82')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x3448('0x83')]=db[_0x3448('0x1')]['import'](_0x3448('0x84'));db[_0x3448('0x85')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x86'));db[_0x3448('0x87')]=db['sequelize']['import'](_0x3448('0x88'));db['Template']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x89'));db['Trigger']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8a'));db['Variable']=db['sequelize'][_0x3448('0x14')](_0x3448('0x8b'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db['IntegrationReport']=db[_0x3448('0x1')]['import'](_0x3448('0x8e'));db[_0x3448('0x8f')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x90'));db['AnalyticDefaultReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0x91'));db[_0x3448('0x92')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x93'));db[_0x3448('0x94')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x95'));db[_0x3448('0x96')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x97'));db[_0x3448('0x98')]=db[_0x3448('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x3448('0x99')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x9a'));db['SalesforceConfiguration']=db[_0x3448('0x1')]['import'](_0x3448('0x9b'));db[_0x3448('0x9c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9d'));db['SugarcrmAccount']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9e'));db['SugarcrmConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9f'));db['SugarcrmField']=db[_0x3448('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x3448('0xa0')]=db['sequelize'][_0x3448('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x3448('0xa1')]=db[_0x3448('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3448('0xa2')]=db[_0x3448('0x1')]['import'](_0x3448('0xa3'));db[_0x3448('0xa4')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xa5'));db[_0x3448('0xa6')]=db[_0x3448('0x1')]['import'](_0x3448('0xa7'));db['ZohoField']=db[_0x3448('0x1')]['import'](_0x3448('0xa8'));db[_0x3448('0xa9')]=db[_0x3448('0x1')]['import'](_0x3448('0xaa'));db[_0x3448('0xab')]=db['sequelize'][_0x3448('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x3448('0x1')]['import'](_0x3448('0xac'));db[_0x3448('0xad')]=db[_0x3448('0x1')]['import'](_0x3448('0xae'));db[_0x3448('0xaf')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb0'));db[_0x3448('0xb1')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb2'));db[_0x3448('0xb3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb4'));db['VtigerConfiguration']=db['sequelize']['import'](_0x3448('0xb5'));db['VtigerField']=db['sequelize'][_0x3448('0x14')](_0x3448('0xb6'));db[_0x3448('0xb7')]=db[_0x3448('0x1')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x3448('0xb8')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x3448('0xb9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xba'));db['Dynamics365Account']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbb'));db['Dynamics365Field']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbc'));db[_0x3448('0xbd')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xbe'));db['FreshsalesConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbf'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db[_0x3448('0xc0')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/network/network.model');db[_0x3448('0xc1')]=db['sequelize'][_0x3448('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3448('0xc2')]=db[_0x3448('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc3'));db['JscriptyQuestionReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc4'));db[_0x3448('0xc5')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc6'));db[_0x3448('0xc7')]=db[_0x3448('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x3448('0xc8')]=db['sequelize'][_0x3448('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x3448('0xc9')]=db[_0x3448('0x1')]['import'](_0x3448('0xca'));db[_0x3448('0xcb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xcc'));db[_0x3448('0xcd')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xce'));db[_0x3448('0xcf')]=db[_0x3448('0x1')]['import'](_0x3448('0xd0'));db[_0x3448('0xd1')]=db[_0x3448('0x1')]['import'](_0x3448('0xd2'));db[_0x3448('0xd3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd4'));db[_0x3448('0xd5')]=db['sequelize']['import'](_0x3448('0xd6'));db[_0x3448('0xd7')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd8'));db[_0x3448('0xd9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xda'));db[_0x3448('0xdb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdc'));db[_0x3448('0xdd')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x3448('0xde')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdf'));db['MailTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe0'));db['ChatTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe1'));db[_0x3448('0xe2')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe3'));db[_0x3448('0xe4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe5'));db['SmsTransferReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0xe6'));db[_0x3448('0xe7')]=db[_0x3448('0x1')]['import'](_0x3448('0xe8'));db[_0x3448('0xe9')]=db[_0x3448('0x1')]['import'](_0x3448('0xea'));db['UserProfile']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xeb'));db['UserProfileSection']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xec'));db[_0x3448('0xed')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xee'));db[_0x3448('0xef')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf0'));db[_0x3448('0xf1')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf2'));db['WhatsappInteraction']=db['sequelize'][_0x3448('0x14')](_0x3448('0xf3'));db[_0x3448('0xf4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf5'));db[_0x3448('0xf6')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf7'));db[_0x3448('0xf8')]=db[_0x3448('0x1')]['import'](_0x3448('0xf9'));db[_0x3448('0xfa')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfb'));db[_0x3448('0xfc')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfd'));db[_0x3448('0xfe')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xff'));db['UserVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x100'));db['User']['hasOne'](db[_0x3448('0x21')],{'as':_0x3448('0x21'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x1f')],{'as':_0x3448('0x104'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x2e')],{'as':_0x3448('0x105'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Extensions','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':'UserId'});db['User'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')]['hasMany'](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':_0x3448('0x10d'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0xef')],{'as':'UserNotifications','foreignKey':_0x3448('0x111')});db['User'][_0x3448('0x112')](db[_0x3448('0x113')],{'as':'UserProfile','foreignKey':_0x3448('0x114')});db['User'][_0x3448('0x115')](db[_0x3448('0x68')],{'as':'Groups','through':_0x3448('0x116')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'through':_0x3448('0x119')});db['User']['belongsToMany'](db[_0x3448('0xe7')],{'as':_0x3448('0x11a'),'through':_0x3448('0x11b')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x11c')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'through':_0x3448('0x11d')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'through':_0x3448('0x11e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4d')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10b')],{'as':'SmsInteractions','through':_0x3448('0x11f')});db['User'][_0x3448('0x115')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'through':_0x3448('0x120')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'through':'user_has_whatsapp_interactions'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'VoiceQueues','through':_0x3448('0x121'),'required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xe9')],{'as':_0x3448('0x122'),'through':'UserVoicePrefix','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x3d')],{'as':_0x3448('0x123'),'through':_0x3448('0x124'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x66')],{'as':_0x3448('0x125'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x115')](db['FaxQueue'],{'as':_0x3448('0x126'),'through':'UserFaxQueue','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x58')],{'as':_0x3448('0x127'),'through':_0x3448('0x34'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x128')],{'as':_0x3448('0x129'),'through':_0x3448('0x36'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xfa')],{'as':_0x3448('0x12a'),'through':_0x3448('0x38'),'required':![]});db['User'][_0x3448('0x115')](db['CmList'],{'through':_0x3448('0x11b')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x12b')],{'as':_0x3448('0x12c'),'through':'user_has_chat_websites'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4a')],{'as':_0x3448('0x12d'),'through':_0x3448('0x12e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x3c')],{'as':_0x3448('0x12f'),'through':_0x3448('0x130')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x59')],{'as':_0x3448('0x131'),'through':_0x3448('0x132')});db['User'][_0x3448('0x115')](db['SmsAccount'],{'as':_0x3448('0x133'),'through':_0x3448('0x134')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xf1')],{'as':_0x3448('0x135'),'through':_0x3448('0x136')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xcf')],{'as':_0x3448('0x137'),'through':_0x3448('0x138')});db[_0x3448('0x16')]['hasMany'](db[_0x3448('0x106')],{'as':_0x3448('0x139'),'onDelete':'cascade','foreignKey':_0x3448('0x13a')});db['VoiceContext'][_0x3448('0x103')](db['VoiceExtension'],{'onDelete':_0x3448('0x101')});db[_0x3448('0x106')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x13b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x1b')][_0x3448('0x115')](db[_0x3448('0x85')],{'as':_0x3448('0x13c'),'through':_0x3448('0x13d')});db[_0x3448('0x1d')][_0x3448('0x103')](db['UserVoiceQueueRt'],{'as':_0x3448('0x13e'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db['CmHopper'],{'as':_0x3448('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x140')});db['VoiceQueue']['hasMany'](db[_0x3448('0x6f')],{'as':'HopperBlacks','foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x2c'),'foreignKey':_0x3448('0x144')});db[_0x3448('0x1d')]['belongsTo'](db['Trunk'],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x147')],{'as':'Interval','foreignKey':_0x3448('0x148')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0xe7')],{'as':'Lists','through':_0x3448('0x149')});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x121')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'as':_0x3448('0x14b'),'through':_0x3448('0xfe')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':_0x3448('0x14c'),'through':'voice_queues_has_cm_blacklists'});db[_0x3448('0x1f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x20')][_0x3448('0x112')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x21')][_0x3448('0x103')](db['VoiceMailMessage'],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':_0x3448('0x14e'),'sourceKey':_0x3448('0x14f')});db['VoiceMailMessage'][_0x3448('0x112')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x3448('0x14f')});db[_0x3448('0x25')][_0x3448('0x103')](db[_0x3448('0x2a')],{'as':_0x3448('0x150'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x103')](db['VoiceAgentReport'],{'as':_0x3448('0x152'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x3a')][_0x3448('0x112')](db['MailAccount'],{'as':_0x3448('0x3c'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x155')](db[_0x3448('0x3a')],{'as':_0x3448('0x156'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x155')](db['MailServerOut'],{'as':_0x3448('0x157'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x103')](db['Disposition'],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x154'),'onDelete':'cascade'});db['MailAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':'Interactions'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':'Applications'});db['MailAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0x3c')]['belongsTo'](db[_0x3448('0x15b')],{'as':_0x3448('0x15b'),'foreignKey':_0x3448('0x15c')});db[_0x3448('0x3c')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0x3c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x130')});db['MailQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserMailQueue'});db[_0x3448('0x3d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'team_has_mail_queues','as':_0x3448('0x14b')});db[_0x3448('0x41')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x41')]['belongsTo'](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x41')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x161'),'as':'Tags'});db['MailInteraction'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x161'),'as':_0x3448('0x162')});db[_0x3448('0x41')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x11d'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x103')](db['Attachment'],{'as':'Attachments','onDelete':_0x3448('0x101')});db['MailMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x41')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x43')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x12b'),'foreignKey':_0x3448('0x165')});db['MailMessage'][_0x3448('0x112')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x3448('0x166')});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db['MailApplication'][_0x3448('0x112')](db[_0x3448('0x3d')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')][_0x3448('0x112')](db['MailAccount'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')]['belongsTo'](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':'IntervalId'});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x3c')],{});db[_0x3448('0x46')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['MailQueueReport'][_0x3448('0x112')](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x46')][_0x3448('0x112')](db['MailInteraction'],{});db['MailQueueReport'][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x46')][_0x3448('0x112')](db['MailQueue'],{});db[_0x3448('0x168')][_0x3448('0x103')](db['DashboardItem'],{'as':_0x3448('0x169'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x16b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'FaxAccountId'});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x4d')],{'as':_0x3448('0x16d')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16e')],{'as':_0x3448('0x13b')});db['FaxAccount'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Exntensions','onDelete':_0x3448('0x101')});db['FaxAccount'][_0x3448('0x103')](db['FaxMessage'],{'as':'Messages'});db[_0x3448('0x4a')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':'Trunk'});db['FaxAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':'List','foreignKey':'ListId'});db[_0x3448('0x4a')]['belongsTo'](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db['FaxAccount'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_fax_accounts'});db[_0x3448('0x16e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x50')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x170')});db[_0x3448('0x4d')][_0x3448('0x103')](db[_0x3448('0x4e')],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x171')});db['FaxInteraction']['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x3448('0x4d')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['FaxInteraction'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x4d')][_0x3448('0x115')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x3448('0x172')});db['FaxInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x173'),'as':'ThroughTags'});db[_0x3448('0x4d')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x174'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')][_0x3448('0x112')](db['User'],{'onDelete':'cascade','as':_0x3448('0x13')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x4d')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db['FaxMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x3448('0x4e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x16b')});db[_0x3448('0x50')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':_0x3448('0x32')});db['FaxQueue'][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x175'),'as':_0x3448('0x14b')});db['FaxQueueReport'][_0x3448('0x112')](db['FaxAccount'],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a')});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x176')]['belongsTo'](db['FaxInteraction'],{});db[_0x3448('0x176')][_0x3448('0x112')](db['FaxMessage'],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x50')],{});db[_0x3448('0x52')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x177'),'onDelete':_0x3448('0x101')});db[_0x3448('0x52')][_0x3448('0x103')](db['CannedAnswer'],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')]['hasMany'](db['SmsInteraction'],{'as':_0x3448('0x16d')});db[_0x3448('0x52')][_0x3448('0x103')](db['SmsApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x52')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['SmsAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x52')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_sms_accounts'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x58')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db['SmsApplication'][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10b')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x52')],{'as':'Account','foreignKey':_0x3448('0x177')});db['SmsInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':'UserId'});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'sms_interaction_has_tags','as':_0x3448('0x172')});db[_0x3448('0x10b')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x178'),'as':_0x3448('0x162')});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11f'),'foreignKey':'SmsInteractionId'});db[_0x3448('0x56')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x13')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x163')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x10b')],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17a')});db['SmsMessage'][_0x3448('0x112')](db[_0x3448('0x52')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x58')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x34'),'foreignKey':'SmsQueueId'});db[_0x3448('0x58')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x17b'),'as':_0x3448('0x14b')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x17c'),'onDelete':_0x3448('0x101')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x5c')],{'as':_0x3448('0x16d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x17e')],{'as':_0x3448('0x13b'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['OpenchannelAccount'][_0x3448('0x112')](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x59')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x132')});db[_0x3448('0x17e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db['OpenchannelApplication'][_0x3448('0x112')](db[_0x3448('0x128')],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x17e')]['belongsTo'](db['Interval'],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x17e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':'restrict','foreignKey':_0x3448('0x170')});db[_0x3448('0x5c')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x5c')][_0x3448('0x112')](db['OpenchannelAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x5c')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x5c')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x5c')][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x180'),'as':_0x3448('0x172')});db[_0x3448('0x5c')]['belongsToMany'](db[_0x3448('0x87')],{'through':'openchannel_interaction_has_tags','as':_0x3448('0x162')});db[_0x3448('0x5c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x17d')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0x59')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x128')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserOpenchannelQueue','foreignKey':_0x3448('0x182')});db['OpenchannelQueue']['belongsToMany'](db[_0x3448('0xd5')],{'through':_0x3448('0x183'),'as':'Teams'});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':'ChatWebsiteId','onDelete':_0x3448('0x101')});db['ChatWebsite'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x165')});db[_0x3448('0x12b')]['hasMany'](db['ChatProactiveAction'],{'as':_0x3448('0x184')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':'Interactions'});db[_0x3448('0x12b')]['hasMany'](db['ChatApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x185')],{'as':_0x3448('0x14d')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db['ChatWebsite'][_0x3448('0x112')](db['Interval'],{'as':_0x3448('0x147'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db['ChatWebsite']['belongsTo'](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x12b')][_0x3448('0x115')](db['User'],{'as':_0x3448('0x14a'),'through':_0x3448('0x186')});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x59')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db[_0x3448('0x5f')]['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x5f')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x128')],{});db[_0x3448('0x187')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102'),'onDelete':_0x3448('0x167')});db['ChatApplication'][_0x3448('0x112')](db[_0x3448('0x66')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x3448('0x187')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x189'),'foreignKey':_0x3448('0x165'),'onDelete':_0x3448('0x167')});db[_0x3448('0x187')]['belongsTo'](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db['ChatInteraction'][_0x3448('0x103')](db['ChatMessage'],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x62')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x165')});db['ChatInteraction']['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x62')]['belongsTo'](db[_0x3448('0x13')],{'as':'Owner','foreignKey':_0x3448('0x102')});db[_0x3448('0x62')]['belongsToMany'](db[_0x3448('0x87')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x18b'),'as':_0x3448('0x162')});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11e'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x62')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':'ChatWebsiteId'});db[_0x3448('0x64')][_0x3448('0x103')](db[_0x3448('0xdd')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x3448('0x101'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x3448('0x101'),'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x64')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':'Account','foreignKey':_0x3448('0x165')});db['ChatQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x18c'),'hooks':!![]});db[_0x3448('0x66')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x18d'),'as':_0x3448('0x14b')});db[_0x3448('0x68')][_0x3448('0x103')](db[_0x3448('0xc2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x3448('0x68')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x13e'),'through':'chat_group_has_users'});db[_0x3448('0x69')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x3448('0x165')});db[_0x3448('0x6b')]['hasMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'foreignKey':_0x3448('0x18e')});db[_0x3448('0x117')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x153')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':'ContactId','onDelete':_0x3448('0x167')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':'FaxInteractions','foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x41')],{'as':'MailInteractions','foreignKey':_0x3448('0x153'),'onDelete':'restrict'});db[_0x3448('0x117')]['belongsTo'](db[_0x3448('0x6b')],{'as':_0x3448('0x18f'),'foreignKey':'CompanyId'});db[_0x3448('0x117')][_0x3448('0x112')](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x119')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x87')],{'as':_0x3448('0x172'),'through':'cm_contact_has_tags'});db['CmContact'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x190'),'as':_0x3448('0x162')});db['CmHopper'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopper']['belongsTo'](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x193')});db[_0x3448('0x6f')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopperBlack'][_0x3448('0x112')](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x194')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x196'),'singular':_0x3448('0x197')},'foreignKey':_0x3448('0x198'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x194')]['hasMany'](db[_0x3448('0x195')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x3448('0x199'),'onDelete':_0x3448('0x101'),'hooks':!![]});db['Automation'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':_0x3448('0x19a'),'foreignKey':'AutomationId','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x16a')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x19b'),'onDelete':'cascade'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x147')],{'as':_0x3448('0x19c'),'foreignKey':_0x3448('0x148'),'onDelete':_0x3448('0x101'),'hooks':!![],'required':![]});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'foreignKey':_0x3448('0x148'),'onDelete':'restrict'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':_0x3448('0x19e'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x187')],{'as':_0x3448('0x19f'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x3448('0x148')});db['Interval']['hasMany'](db['SmsApplication'],{'as':_0x3448('0x1a0'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x3448('0x3c')],{});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x1a1')],{'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x8f')],{'foreignKey':_0x3448('0x1a3')});db[_0x3448('0x85')][_0x3448('0x115')](db[_0x3448('0x1b')],{'as':_0x3448('0x1a4'),'through':'moh_has_sounds','onDelete':_0x3448('0x167')});db[_0x3448('0x87')][_0x3448('0x115')](db['CmContact'],{'through':_0x3448('0x190')});db['Tag'][_0x3448('0x115')](db[_0x3448('0x62')],{'through':_0x3448('0x18b')});db['Tag'][_0x3448('0x115')](db['MailInteraction'],{'through':_0x3448('0x161')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10b')],{'through':_0x3448('0x178')});db[_0x3448('0x87')]['belongsToMany'](db['FaxInteraction'],{'through':_0x3448('0x173')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x5c')],{'through':_0x3448('0x180')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10f')],{'through':_0x3448('0x1a5')});db[_0x3448('0x1a6')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1a7'),'singular':_0x3448('0x1a8')},'foreignKey':_0x3448('0x1a9'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1aa'),'singular':_0x3448('0x1ab')},'foreignKey':'TriggerAnyId','onDelete':_0x3448('0x101'),'hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':'Actions','foreignKey':_0x3448('0x1ac'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x8f')][_0x3448('0x103')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a3'),'hooks':!![]});db[_0x3448('0x1a1')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x94')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x3448('0x96')][_0x3448('0x112')](db['AnalyticMetric'],{'foreignKey':_0x3448('0x1ae')});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1b3')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x3448('0x112')](db[_0x3448('0x99')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x9c')]['hasMany'](db[_0x3448('0x9c')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db[_0x3448('0x9c')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db['SalesforceField'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['SalesforceField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':_0x3448('0x1ba')});db['SugarcrmAccount'][_0x3448('0x103')](db[_0x3448('0x1bb')],{'as':_0x3448('0x1af'),'onDelete':'cascade','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1bb')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subjects','onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1bb')][_0x3448('0x112')](db[_0x3448('0x1bd')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1bc')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa0')][_0x3448('0x103')](db[_0x3448('0xa1')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa1')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db[_0x3448('0xa1')][_0x3448('0x103')](db['DeskField'],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa1')]['hasMany'](db['DeskField'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':'FieldId'});db[_0x3448('0xa1')][_0x3448('0x112')](db[_0x3448('0xa0')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['DeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1be')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x3448('0xa2')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa2')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa4')][_0x3448('0x103')](db[_0x3448('0xa6')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa6')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa6')]['hasMany'](db[_0x3448('0x1c0')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa6')][_0x3448('0x112')](db[_0x3448('0xa4')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1c0')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0x1c0')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xa9')][_0x3448('0x103')](db['ZendeskConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xab')][_0x3448('0x103')](db['ZendeskField'],{'as':_0x3448('0x1b4'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1ad'),'foreignKey':'FieldId'});db[_0x3448('0xab')][_0x3448('0x112')](db['ZendeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['ZendeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c2')});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['ZendeskField'][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x3448('0x103')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xaf')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xaf')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':'AccountId'});db[_0x3448('0xaf')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c3')});db[_0x3448('0xb1')][_0x3448('0x103')](db['FreshdeskField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0xb1')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xb1')]['hasMany'](db[_0x3448('0xb1')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0xb1')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xb3')][_0x3448('0x103')](db['VtigerConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db['VtigerConfiguration'][_0x3448('0x103')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c4')][_0x3448('0x112')](db[_0x3448('0xb3')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c5')][_0x3448('0x103')](db['VtigerField'],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['VtigerField']['hasMany'](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c5')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c5')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x3448('0x103')](db[_0x3448('0xb8')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb8')]['hasMany'](db['ServicenowField'],{'as':_0x3448('0x1b1'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb8')][_0x3448('0x112')](db[_0x3448('0xb7')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb9')]['hasMany'](db[_0x3448('0xb9')],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['ServicenowField'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0xb9')][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb9')][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0x1c6')][_0x3448('0x103')](db[_0x3448('0x1c7')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c7')]['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db['Dynamics365Configuration'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c7')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c7')][_0x3448('0x112')](db['Dynamics365Account'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['Dynamics365Field'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b6'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c8')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c8')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x3448('0x103')](db[_0x3448('0x1c9')],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c9')]['hasMany'](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1c9')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b4'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x3448('0x103')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x3448('0x1b8')});db['FreshsalesConfiguration'][_0x3448('0x112')](db[_0x3448('0xbd')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1ca')][_0x3448('0x103')](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1ca')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x12b')],{});db['ChatQueueReport'][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['ChatQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['User'],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cb')});db[_0x3448('0xc2')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cc')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cf')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xc5')]['belongsTo'](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x10b')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x58')],{});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x142')],{'foreignKey':'ProjectId'});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1d0')});db['JscriptyProject']['hasMany'](db[_0x3448('0x1cf')],{'foreignKey':'ProjectId'});db[_0x3448('0xcf')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x138')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11c')});db['Team'][_0x3448('0x115')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x3448('0x1d1')});db[_0x3448('0xd5')][_0x3448('0x115')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x3448('0x123')});db['Team'][_0x3448('0x115')](db['ChatQueue'],{'through':_0x3448('0x18d'),'as':_0x3448('0x125')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x50')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x3448('0x58')],{'through':_0x3448('0x17b'),'as':_0x3448('0x127')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x128')],{'through':_0x3448('0x183'),'as':_0x3448('0x129')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0xfa')],{'through':_0x3448('0x1d2'),'as':_0x3448('0x12a')});db['Team'][_0x3448('0x115')](db[_0x3448('0xe9')],{'through':_0x3448('0x1d3'),'as':_0x3448('0x122')});db['Campaign'][_0x3448('0x103')](db[_0x3448('0x6e')],{'as':_0x3448('0x13f'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db[_0x3448('0x6f')],{'as':_0x3448('0x1d4'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x2c')],{'as':'Trunk','foreignKey':_0x3448('0x144')});db['Campaign'][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x147')],{'as':_0x3448('0x147'),'foreignKey':'IntervalId'});db['Campaign'][_0x3448('0x112')](db[_0x3448('0xcf')],{'as':_0x3448('0xcf'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0x3448('0x11a'),'through':_0x3448('0x1d5')});db['Campaign'][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment']['belongsTo'](db[_0x3448('0x64')],{'as':_0x3448('0x64'),'foreignKey':_0x3448('0x166')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x1d6')][_0x3448('0x112')](db['MailInteraction'],{});db[_0x3448('0x1d6')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db['MailTransferReport'][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x3d')],{'foreignKey':_0x3448('0x1da'),'as':'ToQueue'});db[_0x3448('0x1d6')]['belongsTo'](db[_0x3448('0x3c')],{'foreignKey':_0x3448('0x1db'),'as':'ToAccount'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x12b')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x3448('0x1dc')]['belongsTo'](db['User'],{'foreignKey':_0x3448('0x1dd'),'as':'FromAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x66')],{'foreignKey':_0x3448('0x1de'),'as':'ToQueue'});db[_0x3448('0x1dc')][_0x3448('0x112')](db['ChatWebsite'],{'foreignKey':_0x3448('0x1df'),'as':_0x3448('0x1e0')});db['FaxTransferReport'][_0x3448('0x112')](db[_0x3448('0x4e')],{});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e1'),'as':_0x3448('0x1e2')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db[_0x3448('0xe2')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x50')],{'foreignKey':_0x3448('0x1e3'),'as':_0x3448('0x1e4')});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e5'),'as':'ToAccount'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x17d')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x5c')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db['OpenchannelAccount'],{'foreignKey':_0x3448('0x1e6'),'as':_0x3448('0x1e2')});db[_0x3448('0xe4')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':_0x3448('0x1d9')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x128')],{'foreignKey':_0x3448('0x1e7'),'as':'ToQueue'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x56')],{});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x10b')],{});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x52')],{'foreignKey':_0x3448('0x1e9'),'as':_0x3448('0x1e2')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x58')],{'foreignKey':_0x3448('0x1ea'),'as':_0x3448('0x1e4')});db[_0x3448('0x1e8')][_0x3448('0x112')](db['SmsAccount'],{'foreignKey':_0x3448('0x1eb'),'as':'ToAccount'});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db['CmList'][_0x3448('0x103')](db[_0x3448('0x76')],{'as':'CustomFields','foreignKey':_0x3448('0x15a')});db['CmList'][_0x3448('0x103')](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'Queues','through':_0x3448('0x149')});db[_0x3448('0xe7')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11b')});db[_0x3448('0xe9')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'onDelete':_0x3448('0x101')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x1ec')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x3448('0x113')][_0x3448('0x103')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'foreignKey':_0x3448('0x114')});db['UserProfile'][_0x3448('0x103')](db[_0x3448('0x1ed')],{'as':_0x3448('0x1ee'),'foreignKey':_0x3448('0x114'),'onDelete':_0x3448('0x101')});db['UserProfileSection'][_0x3448('0x103')](db[_0x3448('0xed')],{'as':_0x3448('0x1ef'),'foreignKey':_0x3448('0x1f0'),'onDelete':'cascade'});db[_0x3448('0xf1')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x1f1'),'onDelete':_0x3448('0x101')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':_0x3448('0x1f1')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0xf4')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x1f1')});db['WhatsappAccount']['hasMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x16d')});db[_0x3448('0xf1')][_0x3448('0x103')](db[_0x3448('0x1f2')],{'as':_0x3448('0x13b')});db[_0x3448('0xf1')]['belongsTo'](db[_0x3448('0xe7')],{'as':'List','foreignKey':_0x3448('0x15a')});db['WhatsappAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0xf1')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x136')});db[_0x3448('0x1f2')]['belongsTo'](db['User'],{'onDelete':_0x3448('0x167')});db['WhatsappApplication'][_0x3448('0x112')](db[_0x3448('0xfa')],{'onDelete':'restrict'});db[_0x3448('0x1f2')]['belongsTo'](db[_0x3448('0xf1')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10f')][_0x3448('0x103')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0x3448('0xf1')],{'as':_0x3448('0x15f'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1a5'),'as':_0x3448('0x172')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x3448('0x10f')]['belongsToMany'](db['User'],{'as':_0x3448('0x179'),'through':_0x3448('0x1f3'),'foreignKey':_0x3448('0x1f4')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':'Contact'});db['WhatsappMessage'][_0x3448('0x112')](db[_0x3448('0x10f')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'WhatsappInteractionId'});db[_0x3448('0xf4')][_0x3448('0x112')](db['WhatsappAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1f1')});db[_0x3448('0xf6')]['belongsTo'](db[_0x3448('0xf1')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x10f')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xfa')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db['WhatsappTransferReport'][_0x3448('0x112')](db[_0x3448('0x10f')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db['WhatsappAccount'],{'foreignKey':_0x3448('0x1f5'),'as':_0x3448('0x1e2')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf1')],{'foreignKey':_0x3448('0x1f6'),'as':_0x3448('0x1e0')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xfa')],{'foreignKey':_0x3448('0x1f7'),'as':_0x3448('0x1e4')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xf8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db['WhatsappQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x3448('0xfa')][_0x3448('0x115')](db['Team'],{'through':_0x3448('0x1d2'),'as':_0x3448('0x14b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6c8f689..398eab0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd01a=['./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/license','/api/campaigns','/api/migrations','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./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/queues','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','/apidoc','static','join','/www','root','/demo','/snippet','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','street','phone','mobile','email','clientSecret','securityToken','code','tenantId','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','privateKey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isString','replace','@@{','}@@','includes','lodash','express','express-winston','./errors','./config/environment','./config/logger','auth','./safe-template','safeTemplate','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/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/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd01a,0x1ae));var _0xad01=function(_0x33c23a,_0x454c7b){_0x33c23a=_0x33c23a-0x0;var _0x5cec46=_0xd01a[_0x33c23a];return _0x5cec46;};'use strict';var _=require(_0xad01('0x0'));var path=require('path');var express=require(_0xad01('0x1'));var ewinston=require(_0xad01('0x2'));var util=require('util');var errors=require(_0xad01('0x3'));var config=require(_0xad01('0x4'));var logger=require(_0xad01('0x5'))('api');var authLogger=require('./config/logger')(_0xad01('0x6'));var safeTemplate=require(_0xad01('0x7'))[_0xad01('0x8')];exports['default']=function(_0x539c9e){_0x539c9e[_0xad01('0x9')](ewinston[_0xad01('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x30add1,_0x1ce11d){var _0x346da4=_0xad01('0xb');if(!_['isEmpty'](_0x30add1[_0xad01('0xc')])){_0x346da4+=_0xad01('0xd');var _0x5c2399=_0x30add1[_0xad01('0xc')];maskSensitiveData(_0x5c2399);}return safeTemplate(util[_0xad01('0xe')](_0x346da4,_0x30add1[_0xad01('0xf')],_0x30add1[_0xad01('0x10')][_0xad01('0x11')]?_0x30add1[_0xad01('0x10')][_0xad01('0x11')]:_0x30add1[_0xad01('0x12')]['remoteAddress']||_0x30add1['ip'],_0x30add1[_0xad01('0x13')],_0x1ce11d[_0xad01('0x14')],_0x1ce11d[_0xad01('0x15')],_0x30add1[_0xad01('0x16')]?_0x30add1[_0xad01('0x16')]['id']:null,_0x30add1[_0xad01('0x16')]?_0x30add1['user'][_0xad01('0x17')]:null,_0x30add1[_0xad01('0x16')]?_0x30add1[_0xad01('0x16')]['role']:null,_0x5c2399?util[_0xad01('0x18')](_0x5c2399,![],null):''));}}));_0x539c9e['use'](ewinston[_0xad01('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xd86f85,_0x33d7ac){var _0x588f85='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xd86f85[_0xad01('0xc')]&&_0xd86f85[_0xad01('0xc')][_0xad01('0x19')]&&_0xd86f85[_0xad01('0xc')][_0xad01('0x1a')]){_0x588f85=_0xad01('0x1b');}return util[_0xad01('0xe')](_0x588f85,_0xd86f85['method'],_0xd86f85[_0xad01('0x10')]['x-forwarded-for']?_0xd86f85[_0xad01('0x10')][_0xad01('0x11')]:_0xd86f85[_0xad01('0x12')]['remoteAddress']||_0xd86f85['ip'],_0xd86f85[_0xad01('0x13')],_0x33d7ac[_0xad01('0x14')],_0x33d7ac[_0xad01('0x15')],_0xd86f85['user']?_0xd86f85[_0xad01('0x16')]['id']:null,_0xd86f85[_0xad01('0x16')]?_0xd86f85[_0xad01('0x16')][_0xad01('0x17')]:null,_0xd86f85[_0xad01('0x16')]?_0xd86f85[_0xad01('0x16')]['role']:null,_0xd86f85['body']&&_0xd86f85[_0xad01('0xc')][_0xad01('0x19')]?_0xd86f85[_0xad01('0xc')]['device']:_0xad01('0x1c'),_0xd86f85[_0xad01('0xc')]&&_0xd86f85[_0xad01('0xc')][_0xad01('0x1a')]?_0xd86f85[_0xad01('0xc')]['agent_id']:'',_0xd86f85[_0xad01('0xc')]&&_0xd86f85[_0xad01('0xc')]['agent_name']?_0xd86f85[_0xad01('0xc')]['agent_name']:'');},'ignoreRoute':function(_0x446b4f){var _0x24c9cd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x24c9cd[_0xad01('0x1d')](_0x446b4f[_0xad01('0x13')]);}}));_0x539c9e[_0xad01('0x9')](_0xad01('0x1e'),require(_0xad01('0x1f')));_0x539c9e[_0xad01('0x9')]('/api/voice/chanspy',require(_0xad01('0x20')));_0x539c9e[_0xad01('0x9')](_0xad01('0x21'),require(_0xad01('0x22')));_0x539c9e[_0xad01('0x9')](_0xad01('0x23'),require(_0xad01('0x24')));_0x539c9e['use'](_0xad01('0x25'),require(_0xad01('0x26')));_0x539c9e[_0xad01('0x9')](_0xad01('0x27'),require(_0xad01('0x28')));_0x539c9e[_0xad01('0x9')](_0xad01('0x29'),require(_0xad01('0x2a')));_0x539c9e['use']('/api/screen/recordings',require(_0xad01('0x2b')));_0x539c9e['use'](_0xad01('0x2c'),require(_0xad01('0x2d')));_0x539c9e[_0xad01('0x9')](_0xad01('0x2e'),require('./api/voiceMailMessage'));_0x539c9e[_0xad01('0x9')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x2f'),require(_0xad01('0x30')));_0x539c9e[_0xad01('0x9')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x31'),require(_0xad01('0x32')));_0x539c9e[_0xad01('0x9')](_0xad01('0x33'),require(_0xad01('0x34')));_0x539c9e[_0xad01('0x9')](_0xad01('0x35'),require('./api/trunk'));_0x539c9e[_0xad01('0x9')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x36'),require(_0xad01('0x37')));_0x539c9e['use']('/api/mail/accounts',require('./api/mailAccount'));_0x539c9e[_0xad01('0x9')](_0xad01('0x38'),require('./api/mailQueue'));_0x539c9e['use'](_0xad01('0x39'),require(_0xad01('0x3a')));_0x539c9e[_0xad01('0x9')](_0xad01('0x3b'),require(_0xad01('0x3c')));_0x539c9e['use']('/api/mail/messages',require(_0xad01('0x3d')));_0x539c9e[_0xad01('0x9')](_0xad01('0x3e'),require('./api/mailApplication'));_0x539c9e['use']('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x3f'),require('./api/dashboard'));_0x539c9e[_0xad01('0x9')]('/api/dashboards/items',require(_0xad01('0x40')));_0x539c9e[_0xad01('0x9')](_0xad01('0x41'),require(_0xad01('0x42')));_0x539c9e[_0xad01('0x9')](_0xad01('0x43'),require(_0xad01('0x44')));_0x539c9e['use'](_0xad01('0x45'),require('./api/faxInteraction'));_0x539c9e[_0xad01('0x9')](_0xad01('0x46'),require(_0xad01('0x47')));_0x539c9e[_0xad01('0x9')]('/api/fax/queues',require(_0xad01('0x48')));_0x539c9e[_0xad01('0x9')]('/api/fax/reports/queue',require(_0xad01('0x49')));_0x539c9e[_0xad01('0x9')]('/api/sms/accounts',require(_0xad01('0x4a')));_0x539c9e['use'](_0xad01('0x4b'),require(_0xad01('0x4c')));_0x539c9e['use'](_0xad01('0x4d'),require(_0xad01('0x4e')));_0x539c9e['use'](_0xad01('0x4f'),require(_0xad01('0x50')));_0x539c9e[_0xad01('0x9')](_0xad01('0x51'),require(_0xad01('0x52')));_0x539c9e[_0xad01('0x9')](_0xad01('0x53'),require(_0xad01('0x54')));_0x539c9e[_0xad01('0x9')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x539c9e[_0xad01('0x9')](_0xad01('0x55'),require(_0xad01('0x56')));_0x539c9e['use'](_0xad01('0x57'),require(_0xad01('0x58')));_0x539c9e['use']('/api/openchannel/queues',require(_0xad01('0x59')));_0x539c9e[_0xad01('0x9')](_0xad01('0x5a'),require('./api/chatWebsite'));_0x539c9e[_0xad01('0x9')](_0xad01('0x5b'),require(_0xad01('0x5c')));_0x539c9e[_0xad01('0x9')](_0xad01('0x5d'),require(_0xad01('0x5e')));_0x539c9e[_0xad01('0x9')](_0xad01('0x5f'),require('./api/chatInteraction'));_0x539c9e[_0xad01('0x9')](_0xad01('0x60'),require(_0xad01('0x61')));_0x539c9e[_0xad01('0x9')](_0xad01('0x62'),require(_0xad01('0x63')));_0x539c9e[_0xad01('0x9')](_0xad01('0x64'),require('./api/chatQueue'));_0x539c9e[_0xad01('0x9')](_0xad01('0x65'),require(_0xad01('0x66')));_0x539c9e[_0xad01('0x9')](_0xad01('0x67'),require('./api/chatProactiveAction'));_0x539c9e[_0xad01('0x9')]('/api/cm/companies',require('./api/cmCompany'));_0x539c9e[_0xad01('0x9')](_0xad01('0x68'),require('./api/cmContact'));_0x539c9e[_0xad01('0x9')](_0xad01('0x69'),require('./api/cmHopper'));_0x539c9e[_0xad01('0x9')](_0xad01('0x6a'),require(_0xad01('0x6b')));_0x539c9e[_0xad01('0x9')](_0xad01('0x6c'),require(_0xad01('0x6d')));_0x539c9e[_0xad01('0x9')](_0xad01('0x6e'),require('./api/cmHopperHistory'));_0x539c9e[_0xad01('0x9')](_0xad01('0x6f'),require(_0xad01('0x70')));_0x539c9e[_0xad01('0x9')](_0xad01('0x71'),require(_0xad01('0x72')));_0x539c9e[_0xad01('0x9')](_0xad01('0x73'),require(_0xad01('0x74')));_0x539c9e[_0xad01('0x9')](_0xad01('0x75'),require('./api/cannedAnswer'));_0x539c9e['use'](_0xad01('0x76'),require(_0xad01('0x77')));_0x539c9e[_0xad01('0x9')]('/api/conditions',require(_0xad01('0x78')));_0x539c9e[_0xad01('0x9')]('/api/intervals',require(_0xad01('0x79')));_0x539c9e[_0xad01('0x9')](_0xad01('0x7a'),require(_0xad01('0x7b')));_0x539c9e[_0xad01('0x9')](_0xad01('0x7c'),require(_0xad01('0x7d')));_0x539c9e[_0xad01('0x9')](_0xad01('0x7e'),require('./api/voiceQueuesLog'));_0x539c9e[_0xad01('0x9')](_0xad01('0x7f'),require('./api/schedule'));_0x539c9e[_0xad01('0x9')](_0xad01('0x80'),require(_0xad01('0x81')));_0x539c9e[_0xad01('0x9')](_0xad01('0x82'),require(_0xad01('0x83')));_0x539c9e['use']('/api/templates',require(_0xad01('0x84')));_0x539c9e[_0xad01('0x9')](_0xad01('0x85'),require(_0xad01('0x86')));_0x539c9e[_0xad01('0x9')]('/api/variables',require(_0xad01('0x87')));_0x539c9e[_0xad01('0x9')](_0xad01('0x88'),require(_0xad01('0x89')));_0x539c9e[_0xad01('0x9')]('/api/integrations/reports',require('./api/integrationReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x8a'),require('./api/analyticCustomReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x8b'),require('./api/analyticDefaultReport'));_0x539c9e[_0xad01('0x9')]('/api/analytics/extracted_reports',require(_0xad01('0x8c')));_0x539c9e['use']('/api/analytics/metrics',require(_0xad01('0x8d')));_0x539c9e[_0xad01('0x9')](_0xad01('0x8e'),require('./api/analyticFieldReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0x8f'),require(_0xad01('0x90')));_0x539c9e['use'](_0xad01('0x91'),require(_0xad01('0x92')));_0x539c9e[_0xad01('0x9')]('/api/integrations/salesforce/configurations',require(_0xad01('0x93')));_0x539c9e[_0xad01('0x9')](_0xad01('0x94'),require(_0xad01('0x95')));_0x539c9e[_0xad01('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x539c9e['use'](_0xad01('0x96'),require(_0xad01('0x97')));_0x539c9e[_0xad01('0x9')](_0xad01('0x98'),require('./api/intSugarcrmField'));_0x539c9e[_0xad01('0x9')](_0xad01('0x99'),require(_0xad01('0x9a')));_0x539c9e[_0xad01('0x9')](_0xad01('0x9b'),require(_0xad01('0x9c')));_0x539c9e[_0xad01('0x9')](_0xad01('0x9d'),require(_0xad01('0x9e')));_0x539c9e[_0xad01('0x9')](_0xad01('0x9f'),require('./api/intZohoAccount'));_0x539c9e[_0xad01('0x9')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x539c9e[_0xad01('0x9')](_0xad01('0xa0'),require(_0xad01('0xa1')));_0x539c9e[_0xad01('0x9')]('/api/integrations/zendesk/accounts',require(_0xad01('0xa2')));_0x539c9e[_0xad01('0x9')](_0xad01('0xa3'),require(_0xad01('0xa4')));_0x539c9e['use'](_0xad01('0xa5'),require(_0xad01('0xa6')));_0x539c9e[_0xad01('0x9')](_0xad01('0xa7'),require(_0xad01('0xa8')));_0x539c9e['use'](_0xad01('0xa9'),require(_0xad01('0xaa')));_0x539c9e['use'](_0xad01('0xab'),require(_0xad01('0xac')));_0x539c9e[_0xad01('0x9')](_0xad01('0xad'),require('./api/intVtigerAccount'));_0x539c9e[_0xad01('0x9')]('/api/integrations/vtiger/configurations',require(_0xad01('0xae')));_0x539c9e[_0xad01('0x9')](_0xad01('0xaf'),require(_0xad01('0xb0')));_0x539c9e[_0xad01('0x9')](_0xad01('0xb1'),require(_0xad01('0xb2')));_0x539c9e[_0xad01('0x9')](_0xad01('0xb3'),require(_0xad01('0xb4')));_0x539c9e[_0xad01('0x9')](_0xad01('0xb5'),require(_0xad01('0xb6')));_0x539c9e[_0xad01('0x9')]('/api/integrations/dynamics365/accounts',require(_0xad01('0xb7')));_0x539c9e[_0xad01('0x9')](_0xad01('0xb8'),require('./api/intDynamics365Configuration'));_0x539c9e[_0xad01('0x9')](_0xad01('0xb9'),require(_0xad01('0xba')));_0x539c9e[_0xad01('0x9')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x539c9e[_0xad01('0x9')](_0xad01('0xbb'),require('./api/intFreshsalesConfiguration'));_0x539c9e['use'](_0xad01('0xbc'),require(_0xad01('0xbd')));_0x539c9e[_0xad01('0x9')]('/api/networks',require(_0xad01('0xbe')));_0x539c9e[_0xad01('0x9')]('/api/chat/reports/queue',require(_0xad01('0xbf')));_0x539c9e[_0xad01('0x9')](_0xad01('0xc0'),require(_0xad01('0xc1')));_0x539c9e[_0xad01('0x9')](_0xad01('0xc2'),require('./api/jscriptyAnswerReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0xc3'),require(_0xad01('0xc4')));_0x539c9e[_0xad01('0x9')](_0xad01('0xc5'),require('./api/jscriptySessionReport'));_0x539c9e['use'](_0xad01('0xc6'),require(_0xad01('0xc7')));_0x539c9e[_0xad01('0x9')](_0xad01('0xc8'),require(_0xad01('0xc9')));_0x539c9e[_0xad01('0x9')](_0xad01('0xca'),require(_0xad01('0xcb')));_0x539c9e[_0xad01('0x9')](_0xad01('0xcc'),require('./api/jscriptyProject'));_0x539c9e[_0xad01('0x9')](_0xad01('0xcd'),require(_0xad01('0xce')));_0x539c9e['use']('/api/square/odbc',require(_0xad01('0xcf')));_0x539c9e['use'](_0xad01('0xd0'),require(_0xad01('0xd1')));_0x539c9e[_0xad01('0x9')](_0xad01('0xd2'),require(_0xad01('0xd3')));_0x539c9e[_0xad01('0x9')](_0xad01('0xd4'),require('./api/squareMessage'));_0x539c9e[_0xad01('0x9')]('/api/teams',require('./api/team'));_0x539c9e[_0xad01('0x9')]('/api/license',require(_0xad01('0xd5')));_0x539c9e[_0xad01('0x9')](_0xad01('0xd6'),require('./api/campaign'));_0x539c9e[_0xad01('0x9')](_0xad01('0xd7'),require('./api/migration'));_0x539c9e['use']('/api/attachments',require(_0xad01('0xd8')));_0x539c9e[_0xad01('0x9')](_0xad01('0xd9'),require(_0xad01('0xda')));_0x539c9e[_0xad01('0x9')](_0xad01('0xdb'),require(_0xad01('0xdc')));_0x539c9e[_0xad01('0x9')]('/api/chat/reports/transfer',require(_0xad01('0xdd')));_0x539c9e[_0xad01('0x9')](_0xad01('0xde'),require(_0xad01('0xdf')));_0x539c9e[_0xad01('0x9')](_0xad01('0xe0'),require('./api/openchannelTransferReport'));_0x539c9e[_0xad01('0x9')](_0xad01('0xe1'),require(_0xad01('0xe2')));_0x539c9e['use'](_0xad01('0xe3'),require(_0xad01('0xe4')));_0x539c9e[_0xad01('0x9')]('/api/voice/prefixes',require(_0xad01('0xe5')));_0x539c9e['use']('/api/userProfiles',require(_0xad01('0xe6')));_0x539c9e[_0xad01('0x9')](_0xad01('0xe7'),require(_0xad01('0xe8')));_0x539c9e[_0xad01('0x9')]('/api/userProfile/resources',require(_0xad01('0xe9')));_0x539c9e['use'](_0xad01('0xea'),require('./api/userNotification'));_0x539c9e['use']('/api/whatsapp/accounts',require(_0xad01('0xeb')));_0x539c9e['use'](_0xad01('0xec'),require(_0xad01('0xed')));_0x539c9e[_0xad01('0x9')](_0xad01('0xee'),require(_0xad01('0xef')));_0x539c9e[_0xad01('0x9')](_0xad01('0xf0'),require(_0xad01('0xf1')));_0x539c9e[_0xad01('0x9')](_0xad01('0xf2'),require(_0xad01('0xf3')));_0x539c9e[_0xad01('0x9')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x539c9e['use'](_0xad01('0xf4'),require('./api/whatsappQueue'));_0x539c9e['use']('/api/cloudProviders',require(_0xad01('0xf5')));_0x539c9e[_0xad01('0x9')](_0xad01('0xf6'),require(_0xad01('0xf7')));_0x539c9e['use'](_0xad01('0xf8'),require(_0xad01('0xf9')));_0x539c9e[_0xad01('0x9')](_0xad01('0xfa'),require(_0xad01('0xfb')));_0x539c9e['use'](_0xad01('0xfc'),require(_0xad01('0xfd')));_0x539c9e[_0xad01('0x9')](_0xad01('0xfe'),require(_0xad01('0xff')));_0x539c9e[_0xad01('0x9')](_0xad01('0x100'),require(_0xad01('0x101')));_0x539c9e[_0xad01('0x9')](_0xad01('0x102'),require(_0xad01('0x103')));_0x539c9e[_0xad01('0x9')](_0xad01('0x104'),require('./api/pm2'));_0x539c9e[_0xad01('0x9')](_0xad01('0x105'),require('./api/webbar'));_0x539c9e[_0xad01('0x9')](_0xad01('0x106'),express[_0xad01('0x107')](path[_0xad01('0x108')](config['root'],_0xad01('0x106'))));_0x539c9e[_0xad01('0x9')](_0xad01('0x109'),express['static'](path['join'](config[_0xad01('0x10a')],_0xad01('0x109'))));_0x539c9e[_0xad01('0x9')](_0xad01('0x10b'),express[_0xad01('0x107')](path[_0xad01('0x108')](config[_0xad01('0x10a')],'/demo')));_0x539c9e[_0xad01('0x9')](_0xad01('0x10c'),express[_0xad01('0x107')](path[_0xad01('0x108')](config['root'],'snippet','3.0.0')));_0x539c9e[_0xad01('0x9')]('/plugins',express[_0xad01('0x107')](path[_0xad01('0x108')](config[_0xad01('0x10a')],'/server/files/plugins')));_0x539c9e['route'](_0xad01('0x10d'))[_0xad01('0x10e')](errors[0x194]);_0x539c9e[_0xad01('0x10f')]('/*')[_0xad01('0x10e')](function(_0x50b9a2,_0x191a07){_0x191a07[_0xad01('0x110')](path[_0xad01('0x111')](_0x539c9e['get'](_0xad01('0x112'))+_0xad01('0x113')));});};var sensitiveFields=[_0xad01('0x114'),_0xad01('0x115'),_0xad01('0x116'),_0xad01('0x117'),_0xad01('0x118'),'lastName',_0xad01('0x119'),_0xad01('0x11a'),_0xad01('0x11b'),'fax',_0xad01('0x11c'),'clientId',_0xad01('0x11d'),_0xad01('0x11e'),_0xad01('0x11f'),'accessKey',_0xad01('0x120'),'token','channelSecret',_0xad01('0x121'),_0xad01('0x122'),_0xad01('0x123'),_0xad01('0x124'),_0xad01('0x125'),_0xad01('0x126'),_0xad01('0x127'),'calleridnum',_0xad01('0x128'),'vidaooApiKey',_0xad01('0x129'),_0xad01('0x12a'),'accesskeyid','secretaccesskey','key',_0xad01('0x16'),'pass','accountSid',_0xad01('0x12b'),_0xad01('0x12c'),_0xad01('0x12d'),_0xad01('0x12e'),_0xad01('0x12f')];function maskSensitiveData(_0x55fa59){var _0x35f23b=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x55fa59))return;for(var _0x211510 in _0x55fa59){if(_['isArray'](_0x55fa59[_0x211510])){for(var _0x2ac527=0x0;_0x2ac527<_0x55fa59[_0x211510]['length'];_0x2ac527++){maskSensitiveData(_0x55fa59[_0x211510][_0x2ac527]);}}else if(_[_0xad01('0x130')](_0x55fa59[_0x211510])){maskSensitiveData(_0x55fa59[_0x211510]);}else if(_[_0xad01('0x131')](_0x55fa59[_0x211510])){_0x55fa59[_0x211510]=_0x55fa59[_0x211510][_0xad01('0x132')](/{{{/g,_0xad01('0x133'))['replace'](/}}}/g,_0xad01('0x134'))[_0xad01('0x132')](/{{/g,'@{')[_0xad01('0x132')](/}}/g,'}@');if(_[_0xad01('0x135')](sensitiveFields,_0x211510)){_0x55fa59[_0x211510]=_0x55fa59[_0x211510]['replace'](_0x35f23b,'*');}}}} \ No newline at end of file +var _0x6d6f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','express-winston','util','./errors','./config/logger','auth','safeTemplate','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','use','%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)','remoteAddress','url','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','/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/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/google','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','/www','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','username','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret'];(function(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0x6d6f,0x159));var _0xf6d6=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x6d6f[_0x1428d9];return _0x438019;};'use strict';var _=require('lodash');var path=require('path');var express=require('express');var ewinston=require(_0xf6d6('0x0'));var util=require(_0xf6d6('0x1'));var errors=require(_0xf6d6('0x2'));var config=require('./config/environment');var logger=require(_0xf6d6('0x3'))('api');var authLogger=require('./config/logger')(_0xf6d6('0x4'));var safeTemplate=require('./safe-template')[_0xf6d6('0x5')];exports['default']=function(_0x48c40e){_0x48c40e['use'](ewinston[_0xf6d6('0x6')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x564e47,_0x12d595){var _0x23653b=_0xf6d6('0x7');if(!_[_0xf6d6('0x8')](_0x564e47[_0xf6d6('0x9')])){_0x23653b+=_0xf6d6('0xa');var _0x411773=_0x564e47['body'];maskSensitiveData(_0x411773);}return safeTemplate(util[_0xf6d6('0xb')](_0x23653b,_0x564e47[_0xf6d6('0xc')],_0x564e47[_0xf6d6('0xd')][_0xf6d6('0xe')]?_0x564e47[_0xf6d6('0xd')]['x-forwarded-for']:_0x564e47[_0xf6d6('0xf')]['remoteAddress']||_0x564e47['ip'],_0x564e47['url'],_0x12d595[_0xf6d6('0x10')],_0x12d595[_0xf6d6('0x11')],_0x564e47[_0xf6d6('0x12')]?_0x564e47[_0xf6d6('0x12')]['id']:null,_0x564e47['user']?_0x564e47['user'][_0xf6d6('0x13')]:null,_0x564e47[_0xf6d6('0x12')]?_0x564e47[_0xf6d6('0x12')][_0xf6d6('0x14')]:null,_0x411773?util['inspect'](_0x411773,![],null):''));}}));_0x48c40e[_0xf6d6('0x15')](ewinston[_0xf6d6('0x6')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x53380c,_0x4e0438){var _0x48b980=_0xf6d6('0x16');if(_0x53380c[_0xf6d6('0x9')]&&_0x53380c[_0xf6d6('0x9')][_0xf6d6('0x17')]&&_0x53380c[_0xf6d6('0x9')][_0xf6d6('0x18')]){_0x48b980=_0xf6d6('0x19');}return util[_0xf6d6('0xb')](_0x48b980,_0x53380c[_0xf6d6('0xc')],_0x53380c[_0xf6d6('0xd')][_0xf6d6('0xe')]?_0x53380c[_0xf6d6('0xd')][_0xf6d6('0xe')]:_0x53380c[_0xf6d6('0xf')][_0xf6d6('0x1a')]||_0x53380c['ip'],_0x53380c[_0xf6d6('0x1b')],_0x4e0438[_0xf6d6('0x10')],_0x4e0438[_0xf6d6('0x11')],_0x53380c[_0xf6d6('0x12')]?_0x53380c[_0xf6d6('0x12')]['id']:null,_0x53380c[_0xf6d6('0x12')]?_0x53380c[_0xf6d6('0x12')][_0xf6d6('0x13')]:null,_0x53380c['user']?_0x53380c[_0xf6d6('0x12')][_0xf6d6('0x14')]:null,_0x53380c[_0xf6d6('0x9')]&&_0x53380c['body'][_0xf6d6('0x17')]?_0x53380c[_0xf6d6('0x9')]['device']:_0xf6d6('0x1c'),_0x53380c[_0xf6d6('0x9')]&&_0x53380c['body'][_0xf6d6('0x18')]?_0x53380c[_0xf6d6('0x9')][_0xf6d6('0x18')]:'',_0x53380c[_0xf6d6('0x9')]&&_0x53380c[_0xf6d6('0x9')][_0xf6d6('0x1d')]?_0x53380c[_0xf6d6('0x9')][_0xf6d6('0x1d')]:'');},'ignoreRoute':function(_0x55d78b){var _0x46a969=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x46a969[_0xf6d6('0x1e')](_0x55d78b[_0xf6d6('0x1b')]);}}));_0x48c40e['use'](_0xf6d6('0x1f'),require('./api/user'));_0x48c40e['use'](_0xf6d6('0x20'),require(_0xf6d6('0x21')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x22'),require(_0xf6d6('0x23')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x24'),require(_0xf6d6('0x25')));_0x48c40e[_0xf6d6('0x15')]('/api/voice/mohs',require(_0xf6d6('0x26')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x27'),require('./api/voiceQueue'));_0x48c40e[_0xf6d6('0x15')]('/api/voice/recordings',require('./api/voiceRecording'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x28'),require('./api/screenRecording'));_0x48c40e['use'](_0xf6d6('0x29'),require('./api/voiceMail'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x2a'),require(_0xf6d6('0x2b')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x2c'),require(_0xf6d6('0x2d')));_0x48c40e[_0xf6d6('0x15')]('/api/voice/dials/reports',require(_0xf6d6('0x2e')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x2f'),require('./api/voiceAgentReport'));_0x48c40e['use'](_0xf6d6('0x30'),require(_0xf6d6('0x31')));_0x48c40e['use']('/api/members/reports',require(_0xf6d6('0x32')));_0x48c40e[_0xf6d6('0x15')]('/api/trunks',require('./api/trunk'));_0x48c40e['use'](_0xf6d6('0x33'),require('./api/voiceTransferReport'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x34'),require(_0xf6d6('0x35')));_0x48c40e[_0xf6d6('0x15')]('/api/mail/accounts',require(_0xf6d6('0x36')));_0x48c40e['use'](_0xf6d6('0x37'),require(_0xf6d6('0x38')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x39'),require('./api/mailSubstatus'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x3a'),require(_0xf6d6('0x3b')));_0x48c40e['use']('/api/mail/messages',require(_0xf6d6('0x3c')));_0x48c40e[_0xf6d6('0x15')]('/api/mail/applications',require(_0xf6d6('0x3d')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x3e'),require(_0xf6d6('0x3f')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x40'),require('./api/dashboard'));_0x48c40e['use'](_0xf6d6('0x41'),require(_0xf6d6('0x42')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x43'),require('./api/faxAccount'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x44'),require(_0xf6d6('0x45')));_0x48c40e['use']('/api/fax/interactions',require(_0xf6d6('0x46')));_0x48c40e[_0xf6d6('0x15')]('/api/fax/messages',require(_0xf6d6('0x47')));_0x48c40e['use']('/api/fax/queues',require('./api/faxQueue'));_0x48c40e['use'](_0xf6d6('0x48'),require(_0xf6d6('0x49')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x4a'),require('./api/smsAccount'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x4b'),require('./api/smsApplication'));_0x48c40e['use'](_0xf6d6('0x4c'),require(_0xf6d6('0x4d')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x4e'),require(_0xf6d6('0x4f')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x50'),require(_0xf6d6('0x51')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x52'),require(_0xf6d6('0x53')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x54'),require('./api/openchannelApplication'));_0x48c40e['use'](_0xf6d6('0x55'),require(_0xf6d6('0x56')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x57'),require(_0xf6d6('0x58')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x59'),require(_0xf6d6('0x5a')));_0x48c40e['use'](_0xf6d6('0x5b'),require('./api/chatWebsite'));_0x48c40e['use'](_0xf6d6('0x5c'),require(_0xf6d6('0x5d')));_0x48c40e[_0xf6d6('0x15')]('/api/chat/applications',require(_0xf6d6('0x5e')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x5f'),require('./api/chatInteraction'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x60'),require('./api/chatMessage'));_0x48c40e[_0xf6d6('0x15')]('/api/chat/offline_messages',require(_0xf6d6('0x61')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x62'),require(_0xf6d6('0x63')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x64'),require(_0xf6d6('0x65')));_0x48c40e[_0xf6d6('0x15')]('/api/chat/proactive_actions',require(_0xf6d6('0x66')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x67'),require(_0xf6d6('0x68')));_0x48c40e[_0xf6d6('0x15')]('/api/cm/contacts',require(_0xf6d6('0x69')));_0x48c40e['use'](_0xf6d6('0x6a'),require(_0xf6d6('0x6b')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x6c'),require(_0xf6d6('0x6d')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x6e'),require(_0xf6d6('0x6f')));_0x48c40e['use'](_0xf6d6('0x70'),require('./api/cmHopperHistory'));_0x48c40e['use'](_0xf6d6('0x71'),require(_0xf6d6('0x72')));_0x48c40e['use'](_0xf6d6('0x73'),require('./api/action'));_0x48c40e[_0xf6d6('0x15')]('/api/automations',require(_0xf6d6('0x74')));_0x48c40e['use'](_0xf6d6('0x75'),require(_0xf6d6('0x76')));_0x48c40e['use']('/api/dispositions',require('./api/disposition'));_0x48c40e['use']('/api/conditions',require(_0xf6d6('0x77')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x78'),require(_0xf6d6('0x79')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x7a'),require(_0xf6d6('0x7b')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x7c'),require(_0xf6d6('0x7d')));_0x48c40e['use'](_0xf6d6('0x7e'),require(_0xf6d6('0x7f')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x80'),require('./api/schedule'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x81'),require('./api/sound'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x82'),require(_0xf6d6('0x83')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x84'),require(_0xf6d6('0x85')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x86'),require(_0xf6d6('0x87')));_0x48c40e[_0xf6d6('0x15')]('/api/variables',require('./api/variable'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x88'),require(_0xf6d6('0x89')));_0x48c40e['use'](_0xf6d6('0x8a'),require('./api/integrationReport'));_0x48c40e[_0xf6d6('0x15')]('/api/analytics/custom_reports',require(_0xf6d6('0x8b')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x8c'),require(_0xf6d6('0x8d')));_0x48c40e['use']('/api/analytics/extracted_reports',require(_0xf6d6('0x8e')));_0x48c40e['use'](_0xf6d6('0x8f'),require('./api/analyticMetric'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x90'),require(_0xf6d6('0x91')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x92'),require(_0xf6d6('0x93')));_0x48c40e['use']('/api/integrations/salesforce/accounts',require(_0xf6d6('0x94')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x95'),require(_0xf6d6('0x96')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x97'),require('./api/intSalesforceField'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x98'),require(_0xf6d6('0x99')));_0x48c40e['use'](_0xf6d6('0x9a'),require(_0xf6d6('0x9b')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x9c'),require('./api/intSugarcrmField'));_0x48c40e['use'](_0xf6d6('0x9d'),require(_0xf6d6('0x9e')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x9f'),require('./api/intDeskConfiguration'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xa0'),require('./api/intDeskField'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xa1'),require(_0xf6d6('0xa2')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xa3'),require(_0xf6d6('0xa4')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xa5'),require(_0xf6d6('0xa6')));_0x48c40e['use'](_0xf6d6('0xa7'),require(_0xf6d6('0xa8')));_0x48c40e['use']('/api/integrations/zendesk/configurations',require(_0xf6d6('0xa9')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xaa'),require(_0xf6d6('0xab')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xac'),require(_0xf6d6('0xad')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xae'),require(_0xf6d6('0xaf')));_0x48c40e['use'](_0xf6d6('0xb0'),require(_0xf6d6('0xb1')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xb2'),require(_0xf6d6('0xb3')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xb4'),require(_0xf6d6('0xb5')));_0x48c40e['use']('/api/integrations/vtiger/fields',require(_0xf6d6('0xb6')));_0x48c40e['use'](_0xf6d6('0xb7'),require('./api/intServicenowAccount'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xb8'),require('./api/intServicenowConfiguration'));_0x48c40e['use'](_0xf6d6('0xb9'),require(_0xf6d6('0xba')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xbb'),require(_0xf6d6('0xbc')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xbd'),require(_0xf6d6('0xbe')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xbf'),require('./api/intDynamics365Field'));_0x48c40e[_0xf6d6('0x15')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xc0'),require(_0xf6d6('0xc1')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xc2'),require(_0xf6d6('0xc3')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xc4'),require(_0xf6d6('0xc5')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xc6'),require(_0xf6d6('0xc7')));_0x48c40e['use'](_0xf6d6('0xc8'),require('./api/chatInternalMessage'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xc9'),require('./api/jscriptyAnswerReport'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xca'),require(_0xf6d6('0xcb')));_0x48c40e['use'](_0xf6d6('0xcc'),require(_0xf6d6('0xcd')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xce'),require('./api/smsQueueReport'));_0x48c40e['use']('/api/square/reports',require(_0xf6d6('0xcf')));_0x48c40e['use'](_0xf6d6('0xd0'),require(_0xf6d6('0xd1')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xd2'),require(_0xf6d6('0xd3')));_0x48c40e[_0xf6d6('0x15')]('/api/settings',require(_0xf6d6('0xd4')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xd5'),require('./api/squareOdbc'));_0x48c40e['use'](_0xf6d6('0xd6'),require(_0xf6d6('0xd7')));_0x48c40e[_0xf6d6('0x15')]('/api/square/recordings',require(_0xf6d6('0xd8')));_0x48c40e['use'](_0xf6d6('0xd9'),require(_0xf6d6('0xda')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xdb'),require(_0xf6d6('0xdc')));_0x48c40e['use'](_0xf6d6('0xdd'),require(_0xf6d6('0xde')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xdf'),require(_0xf6d6('0xe0')));_0x48c40e[_0xf6d6('0x15')]('/api/migrations',require(_0xf6d6('0xe1')));_0x48c40e[_0xf6d6('0x15')]('/api/attachments',require(_0xf6d6('0xe2')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xe3'),require(_0xf6d6('0xe4')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xe5'),require(_0xf6d6('0xe6')));_0x48c40e['use'](_0xf6d6('0xe7'),require(_0xf6d6('0xe8')));_0x48c40e[_0xf6d6('0x15')]('/api/fax/reports/transfer',require(_0xf6d6('0xe9')));_0x48c40e['use']('/api/openchannel/reports/transfer',require(_0xf6d6('0xea')));_0x48c40e['use'](_0xf6d6('0xeb'),require(_0xf6d6('0xec')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xed'),require('./api/cmList'));_0x48c40e['use'](_0xf6d6('0xee'),require('./api/voicePrefix'));_0x48c40e[_0xf6d6('0x15')]('/api/userProfiles',require(_0xf6d6('0xef')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xf0'),require(_0xf6d6('0xf1')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xf2'),require('./api/userProfileResource'));_0x48c40e['use']('/api/userNotifications',require('./api/userNotification'));_0x48c40e[_0xf6d6('0x15')]('/api/whatsapp/accounts',require(_0xf6d6('0xf3')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xf4'),require('./api/whatsappApplication'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xf5'),require(_0xf6d6('0xf6')));_0x48c40e['use'](_0xf6d6('0xf7'),require(_0xf6d6('0xf8')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xf9'),require(_0xf6d6('0xfa')));_0x48c40e['use'](_0xf6d6('0xfb'),require(_0xf6d6('0xfc')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xfd'),require(_0xf6d6('0xfe')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0xff'),require(_0xf6d6('0x100')));_0x48c40e['use']('/api/realtime',require(_0xf6d6('0x101')));_0x48c40e[_0xf6d6('0x15')]('/api/auth/local',require('./api/authLocal'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x102'),require('./api/authGoogle'));_0x48c40e[_0xf6d6('0x15')]('/api/jira',require('./api/jira'));_0x48c40e['use'](_0xf6d6('0x103'),require(_0xf6d6('0x104')));_0x48c40e['use'](_0xf6d6('0x105'),require(_0xf6d6('0x106')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x107'),require(_0xf6d6('0x108')));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x109'),require('./api/pm2'));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x10a'),require(_0xf6d6('0x10b')));_0x48c40e['use'](_0xf6d6('0x10c'),express[_0xf6d6('0x10d')](path['join'](config['root'],_0xf6d6('0x10c'))));_0x48c40e['use'](_0xf6d6('0x10e'),express[_0xf6d6('0x10d')](path[_0xf6d6('0x10f')](config[_0xf6d6('0x110')],_0xf6d6('0x10e'))));_0x48c40e['use']('/demo',express[_0xf6d6('0x10d')](path[_0xf6d6('0x10f')](config[_0xf6d6('0x110')],_0xf6d6('0x111'))));_0x48c40e[_0xf6d6('0x15')](_0xf6d6('0x112'),express[_0xf6d6('0x10d')](path[_0xf6d6('0x10f')](config[_0xf6d6('0x110')],_0xf6d6('0x113'),_0xf6d6('0x114'))));_0x48c40e['use'](_0xf6d6('0x115'),express[_0xf6d6('0x10d')](path[_0xf6d6('0x10f')](config['root'],_0xf6d6('0x116'))));_0x48c40e[_0xf6d6('0x117')](_0xf6d6('0x118'))[_0xf6d6('0x119')](errors[0x194]);_0x48c40e[_0xf6d6('0x117')]('/*')['get'](function(_0x5e743d,_0x4301ed){_0x4301ed[_0xf6d6('0x11a')](path[_0xf6d6('0x11b')](_0x48c40e['get']('appPath')+_0xf6d6('0x11c')));});};var sensitiveFields=[_0xf6d6('0x11d'),_0xf6d6('0x11e'),'newPassword',_0xf6d6('0x11f'),_0xf6d6('0x120'),_0xf6d6('0x121'),_0xf6d6('0x122'),_0xf6d6('0x123'),_0xf6d6('0x124'),_0xf6d6('0x125'),_0xf6d6('0x126'),_0xf6d6('0x127'),_0xf6d6('0x128'),'securityToken','code','accessKey',_0xf6d6('0x129'),_0xf6d6('0x12a'),_0xf6d6('0x12b'),'accessToken',_0xf6d6('0x12c'),_0xf6d6('0x12d'),_0xf6d6('0x12e'),'consumerSecret','membername','calleridname',_0xf6d6('0x12f'),_0xf6d6('0x130'),_0xf6d6('0x131'),'clientEmail',_0xf6d6('0x132'),_0xf6d6('0x133'),_0xf6d6('0x134'),'key',_0xf6d6('0x12'),_0xf6d6('0x135'),_0xf6d6('0x136'),_0xf6d6('0x137'),_0xf6d6('0x138'),'secret',_0xf6d6('0x139'),_0xf6d6('0x13a')];function maskSensitiveData(_0x134b32){var _0x1557bc=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x134b32))return;for(var _0x4db826 in _0x134b32){if(_['isArray'](_0x134b32[_0x4db826])){for(var _0x133fc8=0x0;_0x133fc8<_0x134b32[_0x4db826][_0xf6d6('0x13b')];_0x133fc8++){maskSensitiveData(_0x134b32[_0x4db826][_0x133fc8]);}}else if(_[_0xf6d6('0x13c')](_0x134b32[_0x4db826])){maskSensitiveData(_0x134b32[_0x4db826]);}else if(_[_0xf6d6('0x13d')](_0x134b32[_0x4db826])){_0x134b32[_0x4db826]=_0x134b32[_0x4db826][_0xf6d6('0x13e')](/{{{/g,_0xf6d6('0x13f'))[_0xf6d6('0x13e')](/}}}/g,_0xf6d6('0x140'))[_0xf6d6('0x13e')](/{{/g,'@{')[_0xf6d6('0x13e')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x4db826)){_0x134b32[_0x4db826]=_0x134b32[_0x4db826][_0xf6d6('0x13e')](_0x1557bc,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 18d79b0..b6b7b58 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32a5=['../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.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/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../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/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird'];(function(_0x2b04a1,_0x9f391e){var _0x5e2dc9=function(_0x54e67e){while(--_0x54e67e){_0x2b04a1['push'](_0x2b04a1['shift']());}};_0x5e2dc9(++_0x9f391e);}(_0x32a5,0xe8));var _0x532a=function(_0x5568f3,_0x9bdfe2){_0x5568f3=_0x5568f3-0x0;var _0x25a4ec=_0x32a5[_0x5568f3];return _0x25a4ec;};'use strict';var jayson=require(_0x532a('0x0'));var BPromise=require(_0x532a('0x1'));var _=require('lodash');var config=require(_0x532a('0x2'));exports[_0x532a('0x3')]=function(){return new BPromise(function(_0x57f1a6,_0xc5644b){var _0x303817={};_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x5')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x6')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x7')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x8')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x9')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0xa')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0xb')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0xc')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0xd')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0xe')));_0x303817=_['merge'](_0x303817,require(_0x532a('0xf')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x10')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x11')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x12')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x13')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x14')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x15')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x16')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x17')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x18')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/faxApplication/faxApplication.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x19')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x1a')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/faxQueue/faxQueue.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x1b')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x1c')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x1d')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/smsQueue/smsQueue.rpc'));_0x303817=_['merge'](_0x303817,require(_0x532a('0x1e')));_0x303817=_['merge'](_0x303817,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x303817=_['merge'](_0x303817,require(_0x532a('0x1f')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x20')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x21')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x22')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x23')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x24')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x25')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x26')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x27')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x28')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x29')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x2a')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x2b')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/template/template.rpc'));_0x303817=_['merge'](_0x303817,require(_0x532a('0x2c')));_0x303817=_['merge'](_0x303817,require('../api/variable/variable.rpc'));_0x303817=_['merge'](_0x303817,require(_0x532a('0x2d')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x2e')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x2f')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x30')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x31')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x32')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x33')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x34')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x35')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x36')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/squareReport/squareReport.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x37')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x38')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x39')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x3a')));_0x303817=_['merge'](_0x303817,require(_0x532a('0x3b')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x3c')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/campaign/campaign.rpc'));_0x303817=_['merge'](_0x303817,require(_0x532a('0x3d')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x3e')));_0x303817=_[_0x532a('0x4')](_0x303817,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x3f')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x40')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x41')));_0x303817=_[_0x532a('0x4')](_0x303817,require(_0x532a('0x42')));var _0x68baf7=jayson[_0x532a('0x43')](_0x303817)[_0x532a('0x44')]();var _0x10146c=config[_0x532a('0x45')][_0x532a('0x46')]||config[_0x532a('0x46')]+0x1;var _0x126d2e=config['rpc']['ip']||_0x532a('0x47');_0x68baf7['on'](_0x532a('0x48'),function(_0x15914d){return _0xc5644b(_0x15914d);});_0x68baf7[_0x532a('0x3')](_0x10146c,_0x126d2e,function(){console[_0x532a('0x49')](_0x532a('0x4a'),_0x126d2e,_0x10146c);require(_0x532a('0x4b'))[_0x532a('0x4c')]();return _0x57f1a6(_0x532a('0x4d')+_0x126d2e+':'+_0x10146c);});});}; \ No newline at end of file +var _0xb732=['../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','merge','../api/voiceExtension/voiceExtension.rpc'];(function(_0x5c2798,_0x29aa93){var _0x9c9a8e=function(_0x4fd3e0){while(--_0x4fd3e0){_0x5c2798['push'](_0x5c2798['shift']());}};_0x9c9a8e(++_0x29aa93);}(_0xb732,0x16d));var _0x2b73=function(_0x559473,_0x40cae5){_0x559473=_0x559473-0x0;var _0x34926f=_0xb732[_0x559473];return _0x34926f;};'use strict';var jayson=require(_0x2b73('0x0'));var BPromise=require(_0x2b73('0x1'));var _=require(_0x2b73('0x2'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x254ee5,_0x3023a9){var _0x53e7ca={};_0x53e7ca=_['merge'](_0x53e7ca,require('../api/user/user.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x4')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x5')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x6')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x7')));_0x53e7ca=_['merge'](_0x53e7ca,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x8')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x9')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0xa')));_0x53e7ca=_['merge'](_0x53e7ca,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0xb')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0xc')));_0x53e7ca=_['merge'](_0x53e7ca,require('../api/mailQueue/mailQueue.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0xd')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0xe')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0xf')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x10')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x11')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x12')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x13')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x14')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x15')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x16')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/smsAccount/smsAccount.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x17')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x18')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x19')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x1a')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x1b')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x1c')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x1d')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/chatInteraction/chatInteraction.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x1e')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x1f')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/cmContact/cmContact.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x20')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x21')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x22')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x23')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x24')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x25')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x26')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x27')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x28')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x29')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2a')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2b')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2c')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2d')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2e')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x2f')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x30')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x31')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x32')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x33')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x34')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x35')));_0x53e7ca=_['merge'](_0x53e7ca,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x36')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x37')));_0x53e7ca=_['merge'](_0x53e7ca,require('../api/squareProject/squareProject.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require('../api/squareRecording/squareRecording.rpc'));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x38')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x39')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x3a')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x3b')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x3c')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x3d')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x3e')));_0x53e7ca=_[_0x2b73('0x3')](_0x53e7ca,require(_0x2b73('0x3f')));_0x53e7ca=_['merge'](_0x53e7ca,require(_0x2b73('0x40')));var _0x5ed943=jayson['server'](_0x53e7ca)[_0x2b73('0x41')]();var _0x14d9e6=config[_0x2b73('0x42')]['port']||config['port']+0x1;var _0x357d45=config[_0x2b73('0x42')]['ip']||_0x2b73('0x43');_0x5ed943['on'](_0x2b73('0x44'),function(_0x537e2f){return _0x3023a9(_0x537e2f);});_0x5ed943[_0x2b73('0x45')](_0x14d9e6,_0x357d45,function(){console[_0x2b73('0x46')](_0x2b73('0x47'),_0x357d45,_0x14d9e6);require(_0x2b73('0x48'))['default']();return _0x254ee5(_0x2b73('0x49')+_0x357d45+':'+_0x14d9e6);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 6b5e5a2..1e0ec06 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0x5ad030,_0x5746f9){var _0x52d885=function(_0x6e5461){while(--_0x6e5461){_0x5ad030['push'](_0x5ad030['shift']());}};_0x52d885(++_0x5746f9);}(_0x9354,0x96));var _0x4935=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x9354[_0x4fbb86];return _0xb141fe;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42d9d9){return _0x42d9d9==='{{'?_0x4935('0x0'):'\x20}\x20}';}function safeTemplate(_0x263dd5){var _0x2a4993=_0x263dd5;if(typeof _0x263dd5===_0x4935('0x1')){_0x2a4993=_0x263dd5[_0x4935('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x263dd5)){_0x2a4993=_0x263dd5[_0x4935('0x3')](function(_0x2d509b){return safeTemplate(_0x2d509b);});}else if(_[_0x4935('0x4')](_0x263dd5)){_0x2a4993=Object[_0x4935('0x5')](_0x263dd5)[_0x4935('0x6')](function(_0x2e47bd,_0x118d36){_0x2e47bd[_0x118d36]=safeTemplate(_0x263dd5[_0x118d36]);return _0x2e47bd;},{});}return _0x2a4993;}module[_0x4935('0x7')][_0x4935('0x8')]=safeTemplate; \ No newline at end of file +var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x27bd8b,_0x42088f){var _0x496541=function(_0x33f4f6){while(--_0x33f4f6){_0x27bd8b['push'](_0x27bd8b['shift']());}};_0x496541(++_0x42088f);}(_0x8f4c,0x113));var _0xc8f4=function(_0x510ee9,_0xfd8b59){_0x510ee9=_0x510ee9-0x0;var _0xc4e23=_0x8f4c[_0x510ee9];return _0xc4e23;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 07cab46..232cb06 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 _0x281e=['search','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','answer','sendRequest','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20PRIORITY\x20%s','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','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x281e,0x168));var _0xe281=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x281e[_0x3d42d8];return _0x27fc41;};'use strict';var util=require(_0xe281('0x0'));var _=require(_0xe281('0x1'));var EventEmitter=require(_0xe281('0x2'))[_0xe281('0x3')];var AGIReply=require(_0xe281('0x4'));var AGIError=require(_0xe281('0x5'));function AGIChannel(_0x3a45da){var _0x44ec5f=this,_0x54e0d1=new AGIReply(),_0x4a5b43=![],_0x1239eb={};EventEmitter['call'](_0x44ec5f);_0x3a45da[_0xe281('0x6')](_0xe281('0x7'));_0x3a45da['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x54e0d1['setEncoding'](_0xe281('0x7'));_0x54e0d1['on'](_0xe281('0x8'),function(_0x28ce2f){for(var _0x47475e in _0x28ce2f){_0x44ec5f[_0x47475e]=_0x28ce2f[_0x47475e];}_0x44ec5f[_0xe281('0x9')](_0xe281('0xa'));});_0x54e0d1['on'](_0xe281('0xb'),function(_0x19de9d){if(_0x19de9d['toLowerCase']()==_0xe281('0xc')){_0x44ec5f['emit'](_0xe281('0xc'));return;}if(_0x19de9d[_0xe281('0xd')](0x0,0xb)==_0xe281('0xe')){_0x4a5b43=!![];}if(_0x4a5b43){_0x1239eb['rx']+=_0x19de9d+'\x0a';if(_0x19de9d[_0xe281('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x4a5b43=![];}}else{_0x1239eb['rx']=_0x19de9d;}if(_0x4a5b43){return;}if(typeof _0x1239eb['cb']=='function'){var _0x48626f=_0x1239eb['rx'][_0xe281('0xd')](0x0,0x3),_0xc86d91=null,_0x2bea71=null;_0x48626f=parseInt(_0x48626f);if(isNaN(_0x48626f)){_0x1239eb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe281('0x10')});return;}if(_0x48626f!=0xc8){_0x1239eb['cb'](null,{'code':_0x48626f,'result':-0x1,'extra':'KO'});return;}_0xc86d91=_0x1239eb['rx'][_0xe281('0xd')](0x4)[_0xe281('0x11')]('result=','');if(_0xc86d91[_0xe281('0x12')]('\x20')!=-0x1){_0xc86d91=_0xc86d91[_0xe281('0x13')](0x0,_0xc86d91[_0xe281('0x12')]('\x20'));}if(_[_0xe281('0x14')](_0xc86d91,'-1')){_0xc86d91=parseInt(_0xc86d91);}_0x2bea71=_0x1239eb['rx'][_0xe281('0x15')]('\x20');if(_0x2bea71[_0xe281('0x16')]==0x3){_0x2bea71=_0x2bea71[0x2]['substring'](0x1,_0x2bea71[0x2]['length']-0x1);}else if(_0x2bea71[_0xe281('0x16')]>0x3){var _0x5bb8af=/\((.+)\)/;var _0x50b676=_0x1239eb['rx'][_0xe281('0x17')](_0x5bb8af);if(_0x50b676){_0x2bea71=_0x50b676[0x1];}else{_0x2bea71=null;}}else{_0x2bea71=null;}_0x1239eb['cb'](null,{'code':_0x48626f,'result':_0xc86d91,'extra':_0x2bea71});}});_0x3a45da['on'](_0xe281('0x18'),function(_0x567f85){_0x44ec5f[_0xe281('0x9')](_0xe281('0x18'),new AGIError(_0xe281('0x19'),_0x567f85[_0xe281('0x1a')]));});_0x3a45da['on']('close',function(){_0x44ec5f[_0xe281('0x9')](_0xe281('0x1b'),new AGIError(_0xe281('0x1c')));});_0x3a45da['on'](_0xe281('0x1d'),function(){_0x44ec5f[_0xe281('0x9')]('timeout',new AGIError(_0xe281('0x1e')));_0x3a45da[_0xe281('0x1f')]();});_0x3a45da[_0xe281('0x20')](_0x54e0d1);this['command']=function(_0x157c52,_0x36f960){var _0x157c52=_0x157c52||'',_0x36f960=typeof _0x36f960==_0xe281('0x21')?_0x36f960:new Function();_0x1239eb={'tx':_0x157c52,'rx':'','cb':_0x36f960};_0x3a45da[_0xe281('0x22')](_0x157c52+'\x0a');},this[_0xe281('0x1b')]=function(){_0x3a45da[_0xe281('0x1f')]();};}util[_0xe281('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xe281('0x24')]['sendRequest']=function(_0xaccb2f){return this['command']['sync'](this,_0xaccb2f);};AGIChannel[_0xe281('0x24')][_0xe281('0x25')]=function(){return this[_0xe281('0x26')](_0xe281('0x27'));};AGIChannel['prototype']['getData']=function(_0x29b026,_0x1b2475,_0x10d93b){_0x29b026=_0x29b026===undefined?'beep':_0x29b026;_0x1b2475=_0x1b2475===undefined?'5':_0x1b2475;_0x10d93b=_0x10d93b===undefined?'1':_0x10d93b;return this['sendRequest'](util['format'](_0xe281('0x28'),_0x29b026,_0x1b2475*0x3e8,_0x10d93b));};AGIChannel[_0xe281('0x24')][_0xe281('0x29')]=function(_0x183743){_0x183743=_0x183743||_0xe281('0x2a');return this[_0xe281('0x26')](util[_0xe281('0x2b')]('VERBOSE\x20\x22%s\x22',_0x183743));};AGIChannel[_0xe281('0x24')][_0xe281('0x2c')]=function(_0xefd597,_0x460ac6){if(_['isArray'](_0x460ac6)){return this[_0xe281('0x26')](util[_0xe281('0x2b')](_0xe281('0x2d'),_0xefd597,_0x460ac6[_0xe281('0x2e')](',')));}return this['sendRequest'](util[_0xe281('0x2b')](_0xe281('0x2d'),_0xefd597,_0x460ac6));};AGIChannel[_0xe281('0x24')][_0xe281('0x2f')]=function(_0x25d65b){return this['sendRequest'](util[_0xe281('0x2b')]('SET\x20CONTEXT\x20%s',_0x25d65b));};AGIChannel[_0xe281('0x24')][_0xe281('0x30')]=function(_0x19015f){return this['sendRequest'](util[_0xe281('0x2b')]('SET\x20EXTENSION\x20%s',_0x19015f));};AGIChannel[_0xe281('0x24')]['setPriority']=function(_0x2496e5){return this[_0xe281('0x26')](util[_0xe281('0x2b')](_0xe281('0x31'),_0x2496e5));};AGIChannel[_0xe281('0x24')]['hangup']=function(){return this[_0xe281('0x26')]('HANGUP');};AGIChannel[_0xe281('0x24')][_0xe281('0x32')]=function(_0x51108e,_0x3ccc40){var _0x4fb60a=_[_0xe281('0x33')](_0x3ccc40)||_[_0xe281('0x34')](_0x3ccc40)?_0x3ccc40[_0xe281('0x35')]():_0x3ccc40;return this[_0xe281('0x26')](util[_0xe281('0x2b')](_0xe281('0x36'),_0x51108e,_0x4fb60a?_0x4fb60a[_0xe281('0x35')]()[_0xe281('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe281('0x24')][_0xe281('0x37')]=function(_0x4aff4a,_0x2cdb96){return this[_0xe281('0x26')](util[_0xe281('0x2b')](_0xe281('0x38'),_0x4aff4a,_0x2cdb96));};AGIChannel[_0xe281('0x24')][_0xe281('0x39')]=function(_0x4dd822,_0x22d49a){return this['sendRequest'](util[_0xe281('0x2b')](_0xe281('0x3a'),_0x4dd822,_0x22d49a));};AGIChannel[_0xe281('0x24')][_0xe281('0x3b')]=function(_0x387186,_0x180603){return this['sendRequest'](util[_0xe281('0x2b')](_0xe281('0x3c'),_0x387186,_0x180603));};AGIChannel[_0xe281('0x24')][_0xe281('0x3d')]=function(_0x4493a0,_0x39dbe6,_0x24efcd){_0x39dbe6=_0x39dbe6||this[_0xe281('0x3e')];_0x24efcd=_0x24efcd||0x1;this[_0xe281('0x2f')](_0x4493a0);this[_0xe281('0x30')](_0x39dbe6);this[_0xe281('0x3f')](_0x24efcd);return this['noop'](util[_0xe281('0x2b')](_0xe281('0x40'),_0x4493a0,_0x39dbe6,_0x24efcd));};AGIChannel[_0xe281('0x24')][_0xe281('0x41')]=function(_0x45c7f3){return this[_0xe281('0x26')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x45c7f3));};AGIChannel[_0xe281('0x24')][_0xe281('0x42')]=function(_0x4d73e0,_0x4bdfc1,_0x5f1e7b,_0xfd0db6,_0x15d8dc,_0x5ed0d6){_0x4bdfc1=_0x4bdfc1||'wav';_0x5f1e7b=_0x5f1e7b||'';_0xfd0db6=_0xfd0db6===undefined?-0x1:_0xfd0db6==='-1'?-0x1:_0xfd0db6*0x3e8;_0x15d8dc=_0x15d8dc===undefined?'':'s='+_0x15d8dc;_0x5ed0d6=_0x5ed0d6?_0xe281('0x43'):'';return this['sendRequest'](util['format'](_0xe281('0x44'),_0x4d73e0,_0x4bdfc1,_0x5f1e7b,_0xfd0db6,_0x5ed0d6,_0x15d8dc));};AGIChannel[_0xe281('0x24')][_0xe281('0x45')]=function(_0xd7cf48,_0x9c53aa){_0x9c53aa=_0x9c53aa||'';return this[_0xe281('0x26')](util[_0xe281('0x2b')](_0xe281('0x46'),_0xd7cf48,_0x9c53aa));};AGIChannel['prototype'][_0xe281('0x47')]=function(_0x9a0e6e){return this[_0xe281('0x2c')](_0xe281('0x48'),_0x9a0e6e);};AGIChannel[_0xe281('0x24')]['wait']=function(_0x32a77a){return this[_0xe281('0x2c')](_0xe281('0x49'),_0x32a77a);};AGIChannel[_0xe281('0x24')][_0xe281('0x18')]=function(_0x4b560f,_0x5cfbc6){this['noop'](util[_0xe281('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4b560f['id'],_0x4b560f['label'],_0x5cfbc6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe281('0x4a')]=AGIChannel; \ No newline at end of file +var _0xdae6=['destroy','pipe','command','inherits','prototype','sendRequest','answer','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout'];(function(_0x597885,_0x325acf){var _0x119c0c=function(_0x1ac92a){while(--_0x1ac92a){_0x597885['push'](_0x597885['shift']());}};_0x119c0c(++_0x325acf);}(_0xdae6,0x1a8));var _0x6dae=function(_0x41dcb4,_0x4653d3){_0x41dcb4=_0x41dcb4-0x0;var _0x1db7a3=_0xdae6[_0x41dcb4];return _0x1db7a3;};'use strict';var util=require('util');var _=require(_0x6dae('0x0'));var EventEmitter=require(_0x6dae('0x1'))[_0x6dae('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x6dae('0x3'));function AGIChannel(_0x38557c){var _0x5f5398=this,_0x3b77b0=new AGIReply(),_0x242df8=![],_0x231853={};EventEmitter[_0x6dae('0x4')](_0x5f5398);_0x38557c[_0x6dae('0x5')](_0x6dae('0x6'));_0x38557c['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3b77b0[_0x6dae('0x5')]('utf8');_0x3b77b0['on'](_0x6dae('0x7'),function(_0x4b2acd){for(var _0x1bfb89 in _0x4b2acd){_0x5f5398[_0x1bfb89]=_0x4b2acd[_0x1bfb89];}_0x5f5398[_0x6dae('0x8')](_0x6dae('0x9'));});_0x3b77b0['on']('line',function(_0x1b93b2){if(_0x1b93b2[_0x6dae('0xa')]()==_0x6dae('0xb')){_0x5f5398[_0x6dae('0x8')](_0x6dae('0xb'));return;}if(_0x1b93b2['substring'](0x0,0xb)==_0x6dae('0xc')){_0x242df8=!![];}if(_0x242df8){_0x231853['rx']+=_0x1b93b2+'\x0a';if(_0x1b93b2[_0x6dae('0xd')](_0x6dae('0xe'))!=-0x1){_0x242df8=![];}}else{_0x231853['rx']=_0x1b93b2;}if(_0x242df8){return;}if(typeof _0x231853['cb']==_0x6dae('0xf')){var _0x149b8f=_0x231853['rx'][_0x6dae('0x10')](0x0,0x3),_0x91d3da=null,_0x3db2f3=null;_0x149b8f=parseInt(_0x149b8f);if(isNaN(_0x149b8f)){_0x231853['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6dae('0x11')});return;}if(_0x149b8f!=0xc8){_0x231853['cb'](null,{'code':_0x149b8f,'result':-0x1,'extra':'KO'});return;}_0x91d3da=_0x231853['rx'][_0x6dae('0x10')](0x4)[_0x6dae('0x12')](_0x6dae('0x13'),'');if(_0x91d3da[_0x6dae('0x14')]('\x20')!=-0x1){_0x91d3da=_0x91d3da[_0x6dae('0x15')](0x0,_0x91d3da['indexOf']('\x20'));}if(_[_0x6dae('0x16')](_0x91d3da,'-1')){_0x91d3da=parseInt(_0x91d3da);}_0x3db2f3=_0x231853['rx'][_0x6dae('0x17')]('\x20');if(_0x3db2f3[_0x6dae('0x18')]==0x3){_0x3db2f3=_0x3db2f3[0x2]['substring'](0x1,_0x3db2f3[0x2][_0x6dae('0x18')]-0x1);}else if(_0x3db2f3[_0x6dae('0x18')]>0x3){var _0x37f817=/\((.+)\)/;var _0xb06858=_0x231853['rx'][_0x6dae('0x19')](_0x37f817);if(_0xb06858){_0x3db2f3=_0xb06858[0x1];}else{_0x3db2f3=null;}}else{_0x3db2f3=null;}_0x231853['cb'](null,{'code':_0x149b8f,'result':_0x91d3da,'extra':_0x3db2f3});}});_0x38557c['on'](_0x6dae('0x1a'),function(_0x4e6517){_0x5f5398[_0x6dae('0x8')](_0x6dae('0x1a'),new AGIError(_0x6dae('0x1b'),_0x4e6517[_0x6dae('0x1c')]));});_0x38557c['on'](_0x6dae('0x1d'),function(){_0x5f5398[_0x6dae('0x8')]('close',new AGIError(_0x6dae('0x1e')));});_0x38557c['on'](_0x6dae('0x1f'),function(){_0x5f5398[_0x6dae('0x8')](_0x6dae('0x1f'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x38557c[_0x6dae('0x20')]();});_0x38557c[_0x6dae('0x21')](_0x3b77b0);this[_0x6dae('0x22')]=function(_0x492d40,_0x48b4d8){var _0x492d40=_0x492d40||'',_0x48b4d8=typeof _0x48b4d8=='function'?_0x48b4d8:new Function();_0x231853={'tx':_0x492d40,'rx':'','cb':_0x48b4d8};_0x38557c['write'](_0x492d40+'\x0a');},this['close']=function(){_0x38557c['destroy']();};}util[_0x6dae('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x6dae('0x24')][_0x6dae('0x25')]=function(_0x1cbaa7){return this[_0x6dae('0x22')]['sync'](this,_0x1cbaa7);};AGIChannel['prototype'][_0x6dae('0x26')]=function(){return this[_0x6dae('0x25')]('ANSWER');};AGIChannel[_0x6dae('0x24')][_0x6dae('0x27')]=function(_0x1d3a4e,_0x13e73d,_0x11c91c){_0x1d3a4e=_0x1d3a4e===undefined?_0x6dae('0x28'):_0x1d3a4e;_0x13e73d=_0x13e73d===undefined?'5':_0x13e73d;_0x11c91c=_0x11c91c===undefined?'1':_0x11c91c;return this[_0x6dae('0x25')](util['format'](_0x6dae('0x29'),_0x1d3a4e,_0x13e73d*0x3e8,_0x11c91c));};AGIChannel[_0x6dae('0x24')]['noop']=function(_0x47ef80){_0x47ef80=_0x47ef80||_0x6dae('0x2a');return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x2c'),_0x47ef80));};AGIChannel['prototype'][_0x6dae('0x2d')]=function(_0x3c69a0,_0x2bf815){if(_[_0x6dae('0x2e')](_0x2bf815)){return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x2f'),_0x3c69a0,_0x2bf815[_0x6dae('0x30')](',')));}return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x2f'),_0x3c69a0,_0x2bf815));};AGIChannel['prototype']['setContext']=function(_0x339662){return this[_0x6dae('0x25')](util['format'](_0x6dae('0x31'),_0x339662));};AGIChannel[_0x6dae('0x24')]['setExtension']=function(_0x15b200){return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x32'),_0x15b200));};AGIChannel[_0x6dae('0x24')][_0x6dae('0x33')]=function(_0x562ac9){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x562ac9));};AGIChannel['prototype'][_0x6dae('0xb')]=function(){return this[_0x6dae('0x25')](_0x6dae('0x34'));};AGIChannel[_0x6dae('0x24')][_0x6dae('0x35')]=function(_0x218446,_0x52d5af){var _0x39a852=_[_0x6dae('0x36')](_0x52d5af)||_['isNumber'](_0x52d5af)?_0x52d5af[_0x6dae('0x37')]():_0x52d5af;return this['sendRequest'](util[_0x6dae('0x2b')](_0x6dae('0x38'),_0x218446,_0x39a852?_0x39a852['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0xe8d371,_0x1b0403){return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x39'),_0xe8d371,_0x1b0403));};AGIChannel[_0x6dae('0x24')][_0x6dae('0x3a')]=function(_0xd7371e,_0x127a0f){return this[_0x6dae('0x25')](util[_0x6dae('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0xd7371e,_0x127a0f));};AGIChannel['prototype'][_0x6dae('0x3b')]=function(_0x3ecd07,_0x349972){return this['sendRequest'](util['format'](_0x6dae('0x3c'),_0x3ecd07,_0x349972));};AGIChannel['prototype']['continueAt']=function(_0x2b2e75,_0x50cc74,_0x398b3f){_0x50cc74=_0x50cc74||this[_0x6dae('0x3d')];_0x398b3f=_0x398b3f||0x1;this['setContext'](_0x2b2e75);this[_0x6dae('0x3e')](_0x50cc74);this['setPriority'](_0x398b3f);return this[_0x6dae('0x3f')](util[_0x6dae('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x2b2e75,_0x50cc74,_0x398b3f));};AGIChannel[_0x6dae('0x24')][_0x6dae('0x40')]=function(_0x270b8f){return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x41'),_0x270b8f));};AGIChannel[_0x6dae('0x24')][_0x6dae('0x42')]=function(_0x4665a1,_0x18e29f,_0x21a907,_0x38bf49,_0x1b123d,_0x20eead){_0x18e29f=_0x18e29f||_0x6dae('0x43');_0x21a907=_0x21a907||'';_0x38bf49=_0x38bf49===undefined?-0x1:_0x38bf49==='-1'?-0x1:_0x38bf49*0x3e8;_0x1b123d=_0x1b123d===undefined?'':'s='+_0x1b123d;_0x20eead=_0x20eead?_0x6dae('0x44'):'';return this[_0x6dae('0x25')](util[_0x6dae('0x2b')](_0x6dae('0x45'),_0x4665a1,_0x18e29f,_0x21a907,_0x38bf49,_0x20eead,_0x1b123d));};AGIChannel['prototype'][_0x6dae('0x46')]=function(_0x22319b,_0x159981){_0x159981=_0x159981||'';return this[_0x6dae('0x25')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x22319b,_0x159981));};AGIChannel['prototype'][_0x6dae('0x47')]=function(_0x281891){return this[_0x6dae('0x2d')](_0x6dae('0x48'),_0x281891);};AGIChannel[_0x6dae('0x24')]['wait']=function(_0x3ee11f){return this[_0x6dae('0x2d')]('WAIT',_0x3ee11f);};AGIChannel[_0x6dae('0x24')][_0x6dae('0x1a')]=function(_0x1cdbb5,_0x1e47de){this['noop'](util[_0x6dae('0x2b')](_0x6dae('0x49'),_0x1cdbb5['id'],_0x1cdbb5[_0x6dae('0x4a')],_0x1e47de));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6dae('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 64c5e11..ea41b75 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 _0x8b72=['exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','message'];(function(_0x3ea64e,_0x46b01d){var _0x4cc02a=function(_0x24d28e){while(--_0x24d28e){_0x3ea64e['push'](_0x3ea64e['shift']());}};_0x4cc02a(++_0x46b01d);}(_0x8b72,0x1c1));var _0x28b7=function(_0x11a64a,_0x38ee41){_0x11a64a=_0x11a64a-0x0;var _0x5ac99d=_0x8b72[_0x11a64a];return _0x5ac99d;};'use strict';var util=require(_0x28b7('0x0'));var error={'E_AGI_UNDEFINED':_0x28b7('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x28b7('0x2'),'E_AGI_SERVER_CLOSE':_0x28b7('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x28b7('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x28b7('0x5'),'E_AGI_SOCKET_ERROR':_0x28b7('0x6'),'E_AGI_SOCKET_CLOSE':_0x28b7('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x28b7('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x28b7('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4ed9af){var _0x4ed9af=_0x4ed9af||null,_0x2156c8=_0x2156c8||[],_0x529a05=0x1,_0x72f061='';if(!error[_0x4ed9af]){_0x4ed9af='E_AGI_UNDEFINED';}_0x2156c8[_0x28b7('0xa')](error[_0x4ed9af]);while(arguments[_0x529a05]){_0x2156c8[_0x28b7('0xa')](arguments[_0x529a05]);_0x529a05++;}_0x72f061=util[_0x28b7('0xb')]['apply'](util,_0x2156c8);this[_0x28b7('0xc')]=_0x72f061;this['name']=_0x4ed9af;}module[_0x28b7('0xd')]=AGIError; \ No newline at end of file +var _0x5ff2=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','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.'];(function(_0x2405de,_0x548637){var _0xeadb6e=function(_0x4ad187){while(--_0x4ad187){_0x2405de['push'](_0x2405de['shift']());}};_0xeadb6e(++_0x548637);}(_0x5ff2,0x77));var _0x25ff=function(_0x1a71ef,_0x31ed01){_0x1a71ef=_0x1a71ef-0x0;var _0x1899f7=_0x5ff2[_0x1a71ef];return _0x1899f7;};'use strict';var util=require(_0x25ff('0x0'));var error={'E_AGI_UNDEFINED':_0x25ff('0x1'),'E_AGI_ARGUMENT_PORT':_0x25ff('0x2'),'E_AGI_SERVER_ERROR':_0x25ff('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x25ff('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x25ff('0x5'),'E_AGI_SOCKET_ERROR':_0x25ff('0x6'),'E_AGI_SOCKET_CLOSE':_0x25ff('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x25ff('0x8'),'E_AGI_COMMAND_EMPTY':_0x25ff('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x25ff('0xa'),'E_AGI_IVR_ENTRY':_0x25ff('0xb')};function AGIError(_0x2c2986){var _0x2c2986=_0x2c2986||null,_0x3fdf64=_0x3fdf64||[],_0x4f8cc7=0x1,_0x258186='';if(!error[_0x2c2986]){_0x2c2986=_0x25ff('0xc');}_0x3fdf64[_0x25ff('0xd')](error[_0x2c2986]);while(arguments[_0x4f8cc7]){_0x3fdf64['push'](arguments[_0x4f8cc7]);_0x4f8cc7++;}_0x258186=util[_0x25ff('0xe')]['apply'](util,_0x3fdf64);this[_0x25ff('0xf')]=_0x258186;this[_0x25ff('0x10')]=_0x2c2986;}module[_0x25ff('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 8b5f7c2..039eed1 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 _0xbd7b=['exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found'];(function(_0x378108,_0x494439){var _0x5862fa=function(_0x4e882f){while(--_0x4e882f){_0x378108['push'](_0x378108['shift']());}};_0x5862fa(++_0x494439);}(_0xbd7b,0x156));var _0xbbd7=function(_0x402845,_0x34addd){_0x402845=_0x402845-0x0;var _0x47fd8f=_0xbd7b[_0x402845];return _0x47fd8f;};'use strict';var _=require(_0xbbd7('0x0'));var logger=require(_0xbbd7('0x1'))('agi');var verticesWithRetry=[_0xbbd7('0x2'),_0xbbd7('0x3'),_0xbbd7('0x4')];var Graph=function(){this['vertices']={};this[_0xbbd7('0x5')]={};this[_0xbbd7('0x6')]=0x0;};Graph[_0xbbd7('0x7')][_0xbbd7('0x8')]=function(_0x58044e){this['vertices'][_0x58044e['id']]=_0x58044e;this['edges'][_0x58044e['id']]=[];};Graph['prototype'][_0xbbd7('0x9')]=function(_0x24b9d3,_0x51627a,_0x3e9c1f){this[_0xbbd7('0x5')][_0x24b9d3][_0xbbd7('0xa')]({'target':_0x51627a,'condition':_0x3e9c1f});this[_0xbbd7('0x6')]+=0x1;};Graph[_0xbbd7('0x7')][_0xbbd7('0xb')]=function(){return _[_0xbbd7('0xb')](this[_0xbbd7('0xc')]);};Graph[_0xbbd7('0x7')][_0xbbd7('0xd')]=function(){return this['numberOfEdges'];};Graph[_0xbbd7('0x7')][_0xbbd7('0xe')]=function(_0x4f076f){return this[_0xbbd7('0xc')][_0x4f076f];};Graph[_0xbbd7('0x7')]['traverseBFS']=function(_0x33046b,_0x92d76d){if(!this[_0xbbd7('0xc')][_0x33046b]){return logger[_0xbbd7('0xf')](_0xbbd7('0x10'));}var _0x5320fb=_0x92d76d(this[_0xbbd7('0xc')][_0x33046b]);if(!_0x5320fb){return logger[_0xbbd7('0xf')](_0xbbd7('0x11'));}if(this['edges'][_0x33046b][_0xbbd7('0x12')]===0x0){return logger[_0xbbd7('0xf')](_0xbbd7('0x13'));}for(var _0x3ac70c=0x0,_0x16ff5c=[],_0x5f436f=![];_0x3ac70c\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','sync','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','traverseBFS','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','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','vertex','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','xml2json','lodash','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','127.0.0.1','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','name','message','error','[%s]\x20%s','[ERROR]\x20%s','info','arg_1','calleridname','callerid','uniqueid','format','dnid','evtHangup','toJson','mxGraphModel','hasOwnProperty','retry','addVertex','mxCell','length','source','addEdge','target'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x12f2,0x129));var _0x212f=function(_0x1b327e,_0x9de5d){_0x1b327e=_0x1b327e-0x0;var _0x495bc2=_0x12f2[_0x1b327e];return _0x495bc2;};'use strict';var parser=require(_0x212f('0x0'));var _=require(_0x212f('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0x212f('0x2'));var config=require('../../config/environment');var logger=require(_0x212f('0x3'))(_0x212f('0x4'));var utilLicense=require(_0x212f('0x5'));var rpc=require(_0x212f('0x6'));var mailRpc=require(_0x212f('0x7'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x212f('0x4')]=_['defaults'](config['agi'],{'ip':_0x212f('0x8'),'port':0x11dd});function connectionHandler(_0x284b4a){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x284b4a);agiHandler(_0x284b4a);}catch(_0x9328ad){logger['error'](_0x9328ad[_0x212f('0x9')]);}});});}function listeningHandler(){console['log'](_0x212f('0xa'),config['agi'][_0x212f('0xb')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi'][_0x212f('0xb')]));}function errorHandler(_0x1bfb49){if(_0x1bfb49&&_0x1bfb49[_0x212f('0xc')]&&_0x1bfb49[_0x212f('0xd')]){logger[_0x212f('0xe')](util['format'](_0x212f('0xf'),_0x1bfb49[_0x212f('0xc')],_0x1bfb49[_0x212f('0xd')]));}else{logger['error'](util['format'](_0x212f('0x10'),_0x1bfb49[_0x212f('0x9')]));}}function closeHandler(){logger[_0x212f('0x11')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x212f('0x12')],this[_0x212f('0x13')],this[_0x212f('0x14')],this['dnid'],this[_0x212f('0x15')]));try{createSquareReport(this);}catch(_0x116af5){logger[_0x212f('0xe')](_0x116af5['stack']);}}function timeoutHandler(){logger[_0x212f('0x11')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x212f('0x12')],this[_0x212f('0x13')],this[_0x212f('0x14')],this['dnid'],this[_0x212f('0x15')]));}function hangupHandler(){logger[_0x212f('0x11')](util[_0x212f('0x16')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x212f('0x12')],this['calleridname'],this['callerid'],this[_0x212f('0x17')],this[_0x212f('0x15')]));this[_0x212f('0x18')]=!![];}function getRoot(_0x352bb4){return parser[_0x212f('0x19')](_0x352bb4,{'object':!![]})[_0x212f('0x1a')]['root'];}function addVertex(_0x44ddbc,_0x542f25,_0x5e1b7a){_0x542f25['agicommand']=_0x5e1b7a;if(_0x542f25[_0x212f('0x1b')](_0x212f('0x1c'))){_0x542f25['maxRetry']=parseInt(_0x542f25[_0x212f('0x1c')],0xa);}_0x44ddbc[_0x212f('0x1d')](_['omit'](_0x542f25,_0x212f('0x1e')));}function initGraph(_0x47adc4,_0x43a81f){var _0x5e9d74=new Graph();for(var _0x4995ab in _0x47adc4){if(_0x47adc4[_0x212f('0x1b')](_0x4995ab)){if(_['isArray'](_0x47adc4[_0x4995ab])){for(var _0x8c3a0c=0x0;_0x8c3a0c<_0x47adc4[_0x4995ab][_0x212f('0x1f')];_0x8c3a0c+=0x1){addVertex(_0x5e9d74,_0x47adc4[_0x4995ab][_0x8c3a0c],_0x4995ab);}}else{addVertex(_0x5e9d74,_0x47adc4[_0x4995ab],_0x4995ab);}}}for(var _0x47a0a8=0x0;_0x47a0a8<_0x43a81f[_0x212f('0x1f')];_0x47a0a8+=0x1){if(_0x43a81f[_0x47a0a8][_0x212f('0x20')]&&_0x43a81f[_0x47a0a8]['target']){_0x5e9d74[_0x212f('0x21')](_0x43a81f[_0x47a0a8]['source'],_0x43a81f[_0x47a0a8][_0x212f('0x22')],_0x43a81f[_0x47a0a8][_0x212f('0x23')]);}}return _0x5e9d74;}function getSquareProject(_0x228863,_0x1b93cc){rpc['getSquareProject'](_0x228863)[_0x212f('0x24')](function(_0x3445f8){_0x1b93cc(null,_0x3445f8);})[_0x212f('0x25')](function(_0x2ec572){_0x1b93cc(null,_0x2ec572);});}function createSquareReport(_0x2f1421,_0x2576e4){rpc[_0x212f('0x26')](_0x2f1421)[_0x212f('0x24')](function(_0x507807){if(_0x2576e4){_0x2576e4(null,_0x507807);}})[_0x212f('0x25')](function(_0x5f0bc9){if(_0x2576e4){_0x2576e4(null,_0x5f0bc9);}});}function setChannelVariables(_0x3c768c){for(var _0x588070 in _0x3c768c){if(_0x3c768c[_0x212f('0x1b')](_0x588070)){if(_0x588070[_0x212f('0x27')](_0x212f('0x28'))===0x0){_0x3c768c[_0x588070[_0x212f('0x29')](0x4)]=_0x3c768c[_0x588070];delete _0x3c768c[_0x588070];}}}}function getLogFromObject(_0x4af5f6){return util[_0x212f('0x2a')](_0x4af5f6,{'showHidden':![],'depth':null});}function agiHandler(_0x27970e){var _0x895e13,_0x110941,_0x281c05,_0xc245fc,_0x382b09;logger[_0x212f('0x2b')](_0x212f('0x2c'),JSON[_0x212f('0x2d')](_0x27970e,null,0x2));logger[_0x212f('0x11')](util[_0x212f('0x16')](_0x212f('0x2e'),_0x27970e['arg_1'],_0x27970e[_0x212f('0x13')],_0x27970e[_0x212f('0x14')],_0x27970e[_0x212f('0x17')],_0x27970e[_0x212f('0x15')]));_0x27970e['on'](_0x212f('0xe'),errorHandler);_0x27970e['on']('close',closeHandler);_0x27970e['on'](_0x212f('0x2f'),timeoutHandler);_0x27970e[_0x212f('0x18')]=![];_0x27970e['on']('hangup',hangupHandler);var _0x18019a=getSquareProject[_0x212f('0x30')](null,_0x27970e[_0x212f('0x12')]);if(_0x18019a){if(_0x18019a['production']){_0x895e13=getRoot(_0x18019a['production']);if(_0x895e13&&_0x895e13[_0x212f('0x31')]){logger[_0x212f('0x2b')](_0x212f('0x32'),JSON[_0x212f('0x2d')](_0x895e13,null,0x2));_0x27970e[_0x212f('0x33')]=moment()['format'](_0x212f('0x34'));_0x110941=initGraph(_[_0x212f('0x35')](_0x895e13,_0x212f('0x1e')),_0x895e13['mxCell']);_0x281c05=new Vertices(_0x27970e,rpc,mailRpc);logger['info'](util[_0x212f('0x16')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27970e[_0x212f('0x12')],_0x27970e[_0x212f('0x13')],_0x27970e['callerid'],_0x27970e[_0x212f('0x17')],_0x27970e[_0x212f('0x15')]));_0x110941[_0x212f('0x36')](_0x895e13[_0x212f('0x31')]['id'],function(_0xa6bd63){try{_0xa6bd63=_0x281c05[_0x212f('0x37')](_0xa6bd63);logger['debug']('vertex',JSON['stringify'](_0xa6bd63,null,0x2));if(_0xa6bd63[_0x212f('0x38')]===_0x212f('0x39')){logger['info'](_0x212f('0x3a'));_0x27970e['context']=_0xa6bd63[_0x212f('0x3b')]||_0x27970e['context'];_0x27970e[_0x212f('0x3c')]=_0xa6bd63[_0x212f('0x3c')];_0x27970e[_0x212f('0x3d')]=_0xa6bd63[_0x212f('0x3d')]?_0xa6bd63[_0x212f('0x3d')]-0x1:0x1;return null;}else if(_0xa6bd63&&_0x281c05[_0xa6bd63[_0x212f('0x38')]]){_0x382b09=_0x281c05[_0xa6bd63[_0x212f('0x38')]](_0xa6bd63);logger[_0x212f('0x11')](_0x212f('0x3e'),JSON[_0x212f('0x2d')](_0x382b09,null,0x2));if(_0x382b09&&_0x382b09[_0x212f('0x3f')]===AGI_CODE_SUCCESS&&_0x382b09[_0x212f('0x40')]!==AGI_RESULT_ERROR&&!_0x27970e[_0x212f('0x18')]){logger['debug'](_0x212f('0x3e'),getLogFromObject(_0x382b09));return _['isUndefined'](_0x382b09['result'])?null:_0x382b09[_0x212f('0x40')][_0x212f('0x41')]();}else{logger[_0x212f('0xe')](_0x212f('0x3e'),getLogFromObject(_0x382b09));return null;}}else{logger['error'](_0x212f('0x42'));return null;}}catch(_0x5cd8ca){logger[_0x212f('0xe')](_0x5cd8ca[_0x212f('0x9')]);return null;}});if(_0x895e13['finally']){logger[_0x212f('0x11')](util[_0x212f('0x16')](_0x212f('0x43'),_0x27970e[_0x212f('0x12')],_0x27970e[_0x212f('0x13')],_0x27970e['callerid'],_0x27970e[_0x212f('0x17')],_0x27970e[_0x212f('0x15')]));_0x110941['traverseBFS'](_0x895e13[_0x212f('0x44')]['id'],function(_0xc6d50e){try{_0xc6d50e=_0x281c05['clear'](_0xc6d50e);logger[_0x212f('0x2b')](_0x212f('0x45'),JSON[_0x212f('0x2d')](_0xc6d50e,null,0x2));if(_0xc6d50e&&_0x281c05[_0xc6d50e[_0x212f('0x38')]]){_0x382b09=_0x281c05[_0xc6d50e['agicommand']](_0xc6d50e);if(_0x382b09){logger[_0x212f('0x2b')](_0x212f('0x3e'),getLogFromObject(_0x382b09));return _[_0x212f('0x46')](_0x382b09[_0x212f('0x40')])?null:_0x382b09[_0x212f('0x40')][_0x212f('0x41')]();}else{logger[_0x212f('0xe')](_0x212f('0x3e'),getLogFromObject(_0x382b09));return null;}}else{logger[_0x212f('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x5073fb){logger[_0x212f('0xe')](_0x5073fb['stack']);return null;}});}logger[_0x212f('0x11')](util[_0x212f('0x16')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27970e['arg_1'],_0x27970e[_0x212f('0x13')],_0x27970e[_0x212f('0x14')],_0x27970e[_0x212f('0x17')],_0x27970e['uniqueid']));logger[_0x212f('0x11')](util[_0x212f('0x16')](_0x212f('0x47'),_0x27970e['context'],_0x27970e[_0x212f('0x3c')],parseInt(_0x27970e[_0x212f('0x3d')],0xa)+0x1));_0x27970e[_0x212f('0x48')](_0x27970e[_0x212f('0x3b')],_0x27970e['extension'],parseInt(_0x27970e[_0x212f('0x3d')],0xa)+0x1);_0x27970e[_0x212f('0x49')]();}}else{logger[_0x212f('0xe')](util[_0x212f('0x16')](_0x212f('0x4a'),_0x27970e[_0x212f('0x12')]));_0x27970e[_0x212f('0x48')](_0x27970e[_0x212f('0x3b')],_0x27970e['extension'],parseInt(_0x27970e[_0x212f('0x3d')],0xa)+0x1);_0x27970e[_0x212f('0x49')]();}}else{logger[_0x212f('0xe')](util['format'](_0x212f('0x4b'),_0x27970e[_0x212f('0x12')]));_0x27970e[_0x212f('0x48')](_0x27970e['context'],_0x27970e[_0x212f('0x3c')],parseInt(_0x27970e[_0x212f('0x3d')],0xa)+0x1);_0x27970e['close']();}}function main(){var _0x23ac21;return utilLicense['getLicense']()[_0x212f('0x24')](function(_0x3f8a12){if(_0x3f8a12){if(_0x3f8a12[_0x212f('0x4c')]){if(_0x3f8a12[_0x212f('0x4d')]&&_0x3f8a12[_0x212f('0x4d')]>0x0){logger[_0x212f('0x11')](util[_0x212f('0x16')](_0x212f('0x4e'),_0x3f8a12[_0x212f('0x4d')]));_0x23ac21=_0x3f8a12[_0x212f('0x4d')];}else{logger[_0x212f('0x11')](_0x212f('0x4f'));}}else{logger[_0x212f('0x11')](_0x212f('0x50'));_0x23ac21=-0x1;}}})[_0x212f('0x25')](function(_0x3feb2f){logger[_0x212f('0xe')]('[LICENSE]',_0x3feb2f['stack']);})[_0x212f('0x44')](function(){var _0x576c0c=require(_0x212f('0x51'))(config['agi'][_0x212f('0xb')],config[_0x212f('0x4')]['ip'],_0x23ac21);_0x576c0c['on']('error',errorHandler);_0x576c0c['on'](_0x212f('0x52'),listeningHandler);_0x576c0c['on']('connection',connectionHandler);_0x576c0c['on'](_0x212f('0x49'),closeHandler);});}main(); \ No newline at end of file +var _0xd929=['sync','production','start','stringify','joinAt','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','connection','xml2json','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','error','[%s]\x20%s','[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','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','target','value','getSquareProject','catch','agi_','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup'];(function(_0x3b2675,_0x1423a4){var _0x2e92ae=function(_0x2268a0){while(--_0x2268a0){_0x3b2675['push'](_0x3b2675['shift']());}};_0x2e92ae(++_0x1423a4);}(_0xd929,0x183));var _0x9d92=function(_0x1bb530,_0x476795){_0x1bb530=_0x1bb530-0x0;var _0x4de102=_0xd929[_0x1bb530];return _0x4de102;};'use strict';var parser=require(_0x9d92('0x0'));var _=require('lodash');var syncho=require(_0x9d92('0x1'));var util=require('util');var moment=require(_0x9d92('0x2'));var config=require(_0x9d92('0x3'));var logger=require(_0x9d92('0x4'))(_0x9d92('0x5'));var utilLicense=require(_0x9d92('0x6'));var rpc=require(_0x9d92('0x7'));var mailRpc=require(_0x9d92('0x8'));var Graph=require(_0x9d92('0x9'));var Vertices=require(_0x9d92('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9d92('0x5')]=_[_0x9d92('0xb')](config[_0x9d92('0x5')],{'ip':_0x9d92('0xc'),'port':0x11dd});function connectionHandler(_0x36bd06){process[_0x9d92('0xd')](function(){syncho(function(){try{setChannelVariables(_0x36bd06);agiHandler(_0x36bd06);}catch(_0x5c688d){logger['error'](_0x5c688d['stack']);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9d92('0x5')]['port']);logger[_0x9d92('0xe')](util[_0x9d92('0xf')](_0x9d92('0x10'),config[_0x9d92('0x5')]['ip'],config['agi'][_0x9d92('0x11')]));}function errorHandler(_0x37a91a){if(_0x37a91a&&_0x37a91a[_0x9d92('0x12')]&&_0x37a91a[_0x9d92('0x13')]){logger[_0x9d92('0x14')](util['format'](_0x9d92('0x15'),_0x37a91a['name'],_0x37a91a['message']));}else{logger['error'](util[_0x9d92('0xf')](_0x9d92('0x16'),_0x37a91a[_0x9d92('0x17')]));}}function closeHandler(){logger['info'](util['format'](_0x9d92('0x18'),this[_0x9d92('0x19')],this[_0x9d92('0x1a')],this[_0x9d92('0x1b')],this[_0x9d92('0x1c')],this[_0x9d92('0x1d')]));try{createSquareReport(this);}catch(_0x5095b0){logger[_0x9d92('0x14')](_0x5095b0['stack']);}}function timeoutHandler(){logger[_0x9d92('0xe')](util[_0x9d92('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9d92('0x19')],this[_0x9d92('0x1a')],this['callerid'],this[_0x9d92('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0x9d92('0xe')](util[_0x9d92('0xf')](_0x9d92('0x1e'),this[_0x9d92('0x19')],this['calleridname'],this[_0x9d92('0x1b')],this[_0x9d92('0x1c')],this[_0x9d92('0x1d')]));this[_0x9d92('0x1f')]=!![];}function getRoot(_0x235ef5){return parser[_0x9d92('0x20')](_0x235ef5,{'object':!![]})['mxGraphModel'][_0x9d92('0x21')];}function addVertex(_0x1e8d4c,_0x569d50,_0x109286){_0x569d50[_0x9d92('0x22')]=_0x109286;if(_0x569d50[_0x9d92('0x23')](_0x9d92('0x24'))){_0x569d50[_0x9d92('0x25')]=parseInt(_0x569d50[_0x9d92('0x24')],0xa);}_0x1e8d4c[_0x9d92('0x26')](_['omit'](_0x569d50,'mxCell'));}function initGraph(_0x525e9b,_0x5d4016){var _0x3cf308=new Graph();for(var _0x3f9946 in _0x525e9b){if(_0x525e9b[_0x9d92('0x23')](_0x3f9946)){if(_[_0x9d92('0x27')](_0x525e9b[_0x3f9946])){for(var _0x40cb13=0x0;_0x40cb13<_0x525e9b[_0x3f9946][_0x9d92('0x28')];_0x40cb13+=0x1){addVertex(_0x3cf308,_0x525e9b[_0x3f9946][_0x40cb13],_0x3f9946);}}else{addVertex(_0x3cf308,_0x525e9b[_0x3f9946],_0x3f9946);}}}for(var _0x458fa5=0x0;_0x458fa5<_0x5d4016[_0x9d92('0x28')];_0x458fa5+=0x1){if(_0x5d4016[_0x458fa5][_0x9d92('0x29')]&&_0x5d4016[_0x458fa5][_0x9d92('0x2a')]){_0x3cf308['addEdge'](_0x5d4016[_0x458fa5][_0x9d92('0x29')],_0x5d4016[_0x458fa5][_0x9d92('0x2a')],_0x5d4016[_0x458fa5][_0x9d92('0x2b')]);}}return _0x3cf308;}function getSquareProject(_0x22fa2f,_0x1b40ac){rpc[_0x9d92('0x2c')](_0x22fa2f)['then'](function(_0x140279){_0x1b40ac(null,_0x140279);})[_0x9d92('0x2d')](function(_0x1e0f43){_0x1b40ac(null,_0x1e0f43);});}function createSquareReport(_0x4daaa7,_0x4afbf4){rpc['createSquareReport'](_0x4daaa7)['then'](function(_0x1537bc){if(_0x4afbf4){_0x4afbf4(null,_0x1537bc);}})[_0x9d92('0x2d')](function(_0x1fddab){if(_0x4afbf4){_0x4afbf4(null,_0x1fddab);}});}function setChannelVariables(_0x37d107){for(var _0x38cde7 in _0x37d107){if(_0x37d107[_0x9d92('0x23')](_0x38cde7)){if(_0x38cde7['indexOf'](_0x9d92('0x2e'))===0x0){_0x37d107[_0x38cde7['substring'](0x4)]=_0x37d107[_0x38cde7];delete _0x37d107[_0x38cde7];}}}}function getLogFromObject(_0x4a6a23){return util[_0x9d92('0x2f')](_0x4a6a23,{'showHidden':![],'depth':null});}function agiHandler(_0x59165f){var _0x838a40,_0x26510a,_0xc67515,_0x1303e3,_0x58743b;logger[_0x9d92('0x30')](_0x9d92('0x31'),JSON['stringify'](_0x59165f,null,0x2));logger[_0x9d92('0xe')](util[_0x9d92('0xf')](_0x9d92('0x32'),_0x59165f[_0x9d92('0x19')],_0x59165f[_0x9d92('0x1a')],_0x59165f[_0x9d92('0x1b')],_0x59165f['dnid'],_0x59165f[_0x9d92('0x1d')]));_0x59165f['on'](_0x9d92('0x14'),errorHandler);_0x59165f['on']('close',closeHandler);_0x59165f['on'](_0x9d92('0x33'),timeoutHandler);_0x59165f[_0x9d92('0x1f')]=![];_0x59165f['on'](_0x9d92('0x34'),hangupHandler);var _0x282111=getSquareProject[_0x9d92('0x35')](null,_0x59165f['arg_1']);if(_0x282111){if(_0x282111[_0x9d92('0x36')]){_0x838a40=getRoot(_0x282111[_0x9d92('0x36')]);if(_0x838a40&&_0x838a40[_0x9d92('0x37')]){logger[_0x9d92('0x30')](_0x9d92('0x21'),JSON[_0x9d92('0x38')](_0x838a40,null,0x2));_0x59165f[_0x9d92('0x39')]=moment()[_0x9d92('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x26510a=initGraph(_['omit'](_0x838a40,_0x9d92('0x3a')),_0x838a40[_0x9d92('0x3a')]);_0xc67515=new Vertices(_0x59165f,rpc,mailRpc);logger[_0x9d92('0xe')](util[_0x9d92('0xf')](_0x9d92('0x3b'),_0x59165f[_0x9d92('0x19')],_0x59165f[_0x9d92('0x1a')],_0x59165f[_0x9d92('0x1b')],_0x59165f[_0x9d92('0x1c')],_0x59165f[_0x9d92('0x1d')]));_0x26510a[_0x9d92('0x3c')](_0x838a40[_0x9d92('0x37')]['id'],function(_0x3fcc13){try{_0x3fcc13=_0xc67515['clear'](_0x3fcc13);logger[_0x9d92('0x30')](_0x9d92('0x3d'),JSON[_0x9d92('0x38')](_0x3fcc13,null,0x2));if(_0x3fcc13['agicommand']===_0x9d92('0x3e')){logger[_0x9d92('0xe')](_0x9d92('0x3f'));_0x59165f[_0x9d92('0x40')]=_0x3fcc13['context']||_0x59165f[_0x9d92('0x40')];_0x59165f[_0x9d92('0x41')]=_0x3fcc13[_0x9d92('0x41')];_0x59165f[_0x9d92('0x42')]=_0x3fcc13[_0x9d92('0x42')]?_0x3fcc13[_0x9d92('0x42')]-0x1:0x1;return null;}else if(_0x3fcc13&&_0xc67515[_0x3fcc13[_0x9d92('0x22')]]){_0x58743b=_0xc67515[_0x3fcc13[_0x9d92('0x22')]](_0x3fcc13);logger['info']('response',JSON[_0x9d92('0x38')](_0x58743b,null,0x2));if(_0x58743b&&_0x58743b[_0x9d92('0x43')]===AGI_CODE_SUCCESS&&_0x58743b[_0x9d92('0x44')]!==AGI_RESULT_ERROR&&!_0x59165f[_0x9d92('0x1f')]){logger['debug'](_0x9d92('0x45'),getLogFromObject(_0x58743b));return _[_0x9d92('0x46')](_0x58743b[_0x9d92('0x44')])?null:_0x58743b['result'][_0x9d92('0x47')]();}else{logger['error'](_0x9d92('0x45'),getLogFromObject(_0x58743b));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x553314){logger['error'](_0x553314[_0x9d92('0x17')]);return null;}});if(_0x838a40['finally']){logger[_0x9d92('0xe')](util[_0x9d92('0xf')](_0x9d92('0x48'),_0x59165f[_0x9d92('0x19')],_0x59165f[_0x9d92('0x1a')],_0x59165f['callerid'],_0x59165f[_0x9d92('0x1c')],_0x59165f['uniqueid']));_0x26510a['traverseBFS'](_0x838a40['finally']['id'],function(_0x327ded){try{_0x327ded=_0xc67515[_0x9d92('0x49')](_0x327ded);logger['debug']('vertex',JSON[_0x9d92('0x38')](_0x327ded,null,0x2));if(_0x327ded&&_0xc67515[_0x327ded[_0x9d92('0x22')]]){_0x58743b=_0xc67515[_0x327ded[_0x9d92('0x22')]](_0x327ded);if(_0x58743b){logger[_0x9d92('0x30')](_0x9d92('0x45'),getLogFromObject(_0x58743b));return _['isUndefined'](_0x58743b['result'])?null:_0x58743b[_0x9d92('0x44')][_0x9d92('0x47')]();}else{logger[_0x9d92('0x14')]('response',getLogFromObject(_0x58743b));return null;}}else{logger[_0x9d92('0x14')](_0x9d92('0x4a'));return null;}}catch(_0x5b0c3f){logger[_0x9d92('0x14')](_0x5b0c3f[_0x9d92('0x17')]);return null;}});}logger['info'](util['format'](_0x9d92('0x4b'),_0x59165f[_0x9d92('0x19')],_0x59165f['calleridname'],_0x59165f['callerid'],_0x59165f[_0x9d92('0x1c')],_0x59165f['uniqueid']));logger['info'](util[_0x9d92('0xf')](_0x9d92('0x4c'),_0x59165f[_0x9d92('0x40')],_0x59165f['extension'],parseInt(_0x59165f[_0x9d92('0x42')],0xa)+0x1));_0x59165f[_0x9d92('0x4d')](_0x59165f[_0x9d92('0x40')],_0x59165f[_0x9d92('0x41')],parseInt(_0x59165f[_0x9d92('0x42')],0xa)+0x1);_0x59165f[_0x9d92('0x4e')]();}}else{logger['error'](util[_0x9d92('0xf')](_0x9d92('0x4f'),_0x59165f[_0x9d92('0x19')]));_0x59165f[_0x9d92('0x4d')](_0x59165f[_0x9d92('0x40')],_0x59165f[_0x9d92('0x41')],parseInt(_0x59165f[_0x9d92('0x42')],0xa)+0x1);_0x59165f['close']();}}else{logger[_0x9d92('0x14')](util[_0x9d92('0xf')](_0x9d92('0x50'),_0x59165f[_0x9d92('0x19')]));_0x59165f[_0x9d92('0x4d')](_0x59165f[_0x9d92('0x40')],_0x59165f[_0x9d92('0x41')],parseInt(_0x59165f[_0x9d92('0x42')],0xa)+0x1);_0x59165f['close']();}}function main(){var _0x2e408f;return utilLicense[_0x9d92('0x51')]()[_0x9d92('0x52')](function(_0x3e14d3){if(_0x3e14d3){if(_0x3e14d3[_0x9d92('0x53')]){if(_0x3e14d3[_0x9d92('0x54')]&&_0x3e14d3['callysquare']>0x0){logger[_0x9d92('0xe')](util[_0x9d92('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3e14d3[_0x9d92('0x54')]));_0x2e408f=_0x3e14d3[_0x9d92('0x54')];}else{logger['info'](_0x9d92('0x55'));}}else{logger[_0x9d92('0xe')](_0x9d92('0x56'));_0x2e408f=-0x1;}}})[_0x9d92('0x2d')](function(_0x29b20e){logger[_0x9d92('0x14')]('[LICENSE]',_0x29b20e[_0x9d92('0x17')]);})['finally'](function(){var _0x249e41=require('./server')(config['agi'][_0x9d92('0x11')],config[_0x9d92('0x5')]['ip'],_0x2e408f);_0x249e41['on']('error',errorHandler);_0x249e41['on']('listening',listeningHandler);_0x249e41['on'](_0x9d92('0x57'),connectionHandler);_0x249e41['on'](_0x9d92('0x4e'),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 7496737..8f82f92 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 _0x704c=['error','message','result','sendMailMessage','bluebird','client','http','request','then'];(function(_0xb24c7f,_0x9d3908){var _0x3968b2=function(_0x5f5320){while(--_0x5f5320){_0xb24c7f['push'](_0xb24c7f['shift']());}};_0x3968b2(++_0x9d3908);}(_0x704c,0x1d8));var _0xc704=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x704c[_0x40bffc];return _0x3007e9;};'use strict';var BPromise=require(_0xc704('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xc704('0x1')][_0xc704('0x2')]({'port':0x232b});function request(_0x1b17dd,_0x567097){return new BPromise(function(_0x13baad,_0xe57655){return client[_0xc704('0x3')](_0x1b17dd,_0x567097)[_0xc704('0x4')](function(_0x39bac5){if(_0x39bac5[_0xc704('0x5')]){return _0xe57655(_0x39bac5[_0xc704('0x5')][_0xc704('0x6')]);}else{return _0x13baad(_0x39bac5[_0xc704('0x7')]);}})['catch'](function(_0x3cb79d){return _0xe57655(_0x3cb79d);});});}exports[_0xc704('0x8')]=function(_0x1ba35b,_0x12167c){return request('SendMail',{'account':_0x1ba35b,'message':_0x12167c});}; \ No newline at end of file +var _0x5c48=['error','result','catch','bluebird','jayson/promise','then'];(function(_0x19c28e,_0x3a491c){var _0x329f0a=function(_0x55ab5d){while(--_0x55ab5d){_0x19c28e['push'](_0x19c28e['shift']());}};_0x329f0a(++_0x3a491c);}(_0x5c48,0x135));var _0x85c4=function(_0x26eeda,_0x3f0927){_0x26eeda=_0x26eeda-0x0;var _0x28a137=_0x5c48[_0x26eeda];return _0x28a137;};'use strict';var BPromise=require(_0x85c4('0x0'));var jayson=require(_0x85c4('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x43a253,_0x1e5e0d){return new BPromise(function(_0x56bab9,_0x239e23){return client['request'](_0x43a253,_0x1e5e0d)[_0x85c4('0x2')](function(_0x54877f){if(_0x54877f[_0x85c4('0x3')]){return _0x239e23(_0x54877f['error']['message']);}else{return _0x56bab9(_0x54877f[_0x85c4('0x4')]);}})[_0x85c4('0x5')](function(_0x789cff){return _0x239e23(_0x789cff);});});}exports['sendMailMessage']=function(_0x67e1de,_0xfe749){return request('SendMail',{'account':_0x67e1de,'message':_0xfe749});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 5397c1e..5fb965c 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 _0x0689=['Transform','call','_localBuffer','_inBody','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','headers','line','exports','util'];(function(_0x141104,_0x27051a){var _0x5a084a=function(_0x2baba6){while(--_0x2baba6){_0x141104['push'](_0x141104['shift']());}};_0x5a084a(++_0x27051a);}(_0x0689,0x10f));var _0x9068=function(_0x4b7e56,_0x1fec9a){_0x4b7e56=_0x4b7e56-0x0;var _0x1db082=_0x0689[_0x4b7e56];return _0x1db082;};'use strict';var util=require(_0x9068('0x0'));var Transform=require('stream')[_0x9068('0x1')];function AGIReply(_0x582c6d){Transform[_0x9068('0x2')](this,_0x582c6d);this[_0x9068('0x3')]='';this[_0x9068('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x9068('0x5')]['_transform']=function(_0x24c6da,_0x35a057,_0x1a2140){var _0x5dac0b='\x0a',_0x554a90=['\x0a\x0a',_0x9068('0x6')],_0xea1f21=-0x1,_0x3a7c67=-0x1,_0x34e96b='',_0x1169e6=0x0,_0x1f3efc='',_0x53299a='';this[_0x9068('0x3')]+=_0x24c6da[_0x9068('0x7')]();_0x1f3efc=this[_0x9068('0x3')];if(!this[_0x9068('0x4')]){_0x1169e6=0x0;while(_0x554a90[_0x1169e6]){while((_0x3a7c67=_0x1f3efc[_0x9068('0x8')](_0x554a90[_0x1169e6]))!=-0x1){_0x34e96b=_0x554a90[_0x1169e6];_0x53299a=_0x1f3efc[_0x9068('0x9')](0x0,_0x3a7c67);_0x1f3efc=_0x1f3efc[_0x9068('0x9')](_0x3a7c67+_0x34e96b[_0x9068('0xa')]);var _0x29f343=_0x53299a['split'](_0x5dac0b),_0x582223=0x0,_0x22ade9={},_0x15abc6='',_0xea5afb='',_0x49c05a=-0x1;while(_0x29f343[_0x582223]){_0x49c05a=_0x29f343[_0x582223][_0x9068('0x8')](':');if(_0x49c05a!=-0x1){_0x15abc6=_0x29f343[_0x582223][_0x9068('0xb')](0x0,_0x49c05a)[_0x9068('0xc')]();_0xea5afb=_0x29f343[_0x582223][_0x9068('0xb')](_0x49c05a+0x1)[_0x9068('0xc')]();if(_0x15abc6[_0x9068('0xa')]>0x0){_0x22ade9[_0x15abc6]=_0xea5afb;}}else{}_0x582223++;}this[_0x9068('0xd')](_0x9068('0xe'),_0x22ade9);this[_0x9068('0x4')]=!![];}_0x1169e6++;}this[_0x9068('0x3')]=_0x1f3efc;}else{while((_0xea1f21=_0x1f3efc['indexOf'](_0x5dac0b))!=-0x1){_0x53299a=_0x1f3efc[_0x9068('0x9')](0x0,_0xea1f21);this[_0x9068('0xd')](_0x9068('0xf'),_0x53299a);_0x1f3efc=_0x1f3efc['substring'](_0xea1f21+_0x5dac0b['length']);}this[_0x9068('0x3')]=_0x1f3efc;}_0x1a2140();};module[_0x9068('0x10')]=AGIReply; \ No newline at end of file +var _0xc00c=['split','slice','length','emit','headers','substring','exports','Transform','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','indexOf'];(function(_0x14cc27,_0x39061f){var _0x28e5ac=function(_0xc7ccf8){while(--_0xc7ccf8){_0x14cc27['push'](_0x14cc27['shift']());}};_0x28e5ac(++_0x39061f);}(_0xc00c,0x97));var _0xcc00=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xc00c[_0x3305de];return _0x3b5a84;};'use strict';var util=require('util');var Transform=require('stream')[_0xcc00('0x0')];function AGIReply(_0x1595a2){Transform['call'](this,_0x1595a2);this['_localBuffer']='';this['_inBody']=![];}util[_0xcc00('0x1')](AGIReply,Transform);AGIReply[_0xcc00('0x2')][_0xcc00('0x3')]=function(_0x93bec7,_0x325b26,_0x13df32){var _0x482f73='\x0a',_0x3281d5=['\x0a\x0a',_0xcc00('0x4')],_0x10137a=-0x1,_0xf5bf0=-0x1,_0x1d3707='',_0x23b76d=0x0,_0xafafcc='',_0x1d7c7e='';this[_0xcc00('0x5')]+=_0x93bec7[_0xcc00('0x6')]();_0xafafcc=this['_localBuffer'];if(!this[_0xcc00('0x7')]){_0x23b76d=0x0;while(_0x3281d5[_0x23b76d]){while((_0xf5bf0=_0xafafcc[_0xcc00('0x8')](_0x3281d5[_0x23b76d]))!=-0x1){_0x1d3707=_0x3281d5[_0x23b76d];_0x1d7c7e=_0xafafcc['substring'](0x0,_0xf5bf0);_0xafafcc=_0xafafcc['substring'](_0xf5bf0+_0x1d3707['length']);var _0x559a3e=_0x1d7c7e[_0xcc00('0x9')](_0x482f73),_0xecb04e=0x0,_0xa39bfa={},_0x30541d='',_0x1e533d='',_0x365676=-0x1;while(_0x559a3e[_0xecb04e]){_0x365676=_0x559a3e[_0xecb04e][_0xcc00('0x8')](':');if(_0x365676!=-0x1){_0x30541d=_0x559a3e[_0xecb04e]['slice'](0x0,_0x365676)['trim']();_0x1e533d=_0x559a3e[_0xecb04e][_0xcc00('0xa')](_0x365676+0x1)['trim']();if(_0x30541d[_0xcc00('0xb')]>0x0){_0xa39bfa[_0x30541d]=_0x1e533d;}}else{}_0xecb04e++;}this[_0xcc00('0xc')](_0xcc00('0xd'),_0xa39bfa);this[_0xcc00('0x7')]=!![];}_0x23b76d++;}this[_0xcc00('0x5')]=_0xafafcc;}else{while((_0x10137a=_0xafafcc[_0xcc00('0x8')](_0x482f73))!=-0x1){_0x1d7c7e=_0xafafcc[_0xcc00('0xe')](0x0,_0x10137a);this['emit']('line',_0x1d7c7e);_0xafafcc=_0xafafcc['substring'](_0x10137a+_0x482f73[_0xcc00('0xb')]);}this['_localBuffer']=_0xafafcc;}_0x13df32();};module[_0xcc00('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f1e98f9..d894f05 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 _0xcb36=['then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createCmContact','phone','ListId'];(function(_0x1cfbe3,_0x2f2892){var _0x2dd91f=function(_0x157e52){while(--_0x157e52){_0x1cfbe3['push'](_0x1cfbe3['shift']());}};_0x2dd91f(++_0x2f2892);}(_0xcb36,0xb9));var _0x6cb3=function(_0x158301,_0x395636){_0x158301=_0x158301-0x0;var _0xc17cc1=_0xcb36[_0x158301];return _0xc17cc1;};'use strict';var BPromise=require(_0x6cb3('0x0'));var moment=require(_0x6cb3('0x1'));var _=require(_0x6cb3('0x2'));var util=require(_0x6cb3('0x3'));var jayson=require(_0x6cb3('0x4'));var client=jayson[_0x6cb3('0x5')][_0x6cb3('0x6')]({'port':0x2329});function request(_0x5734d3,_0x2260f2){return new BPromise(function(_0x541892,_0x185a45){return client['request'](_0x5734d3,_0x2260f2)['then'](function(_0xccd82b){if(_0xccd82b[_0x6cb3('0x7')]){return _0x185a45(_0xccd82b[_0x6cb3('0x7')][_0x6cb3('0x8')]);}else{return _0x541892(_0xccd82b[_0x6cb3('0x9')]);}})[_0x6cb3('0xa')](function(_0x2c5333){return _0x185a45(_0x2c5333);});});}exports[_0x6cb3('0xb')]=function(_0x2455ad){return request(_0x6cb3('0xc'),{'options':{'raw':![],'where':{'name':_0x2455ad},'attributes':[_0x6cb3('0xd')]}});};exports[_0x6cb3('0xe')]=function(_0x5138ab){return request(_0x6cb3('0xf'),{'options':{'raw':![],'where':{'id':_0x5138ab},'include':[{'model':_0x6cb3('0x10'),'as':_0x6cb3('0x11')}],'attributes':['id',_0x6cb3('0x12'),_0x6cb3('0x13')]}});};exports[_0x6cb3('0x14')]=function(_0x51deab){return request(_0x6cb3('0xc'),{'options':{'where':{'id':_0x51deab},'attributes':['name']}});};exports[_0x6cb3('0x15')]=function(_0x8cb6cd){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x8cb6cd},'attributes':[_0x6cb3('0x12')]}});};exports[_0x6cb3('0x16')]=function(_0x568676){return request(_0x6cb3('0x17'),{'options':{'where':{'id':_0x568676},'attributes':[_0x6cb3('0x12')]}});};exports[_0x6cb3('0x18')]=function(_0x3af208){return request(_0x6cb3('0x19'),{'options':{'where':{'id':_0x3af208},'attributes':[_0x6cb3('0x1a')]}});};exports[_0x6cb3('0x1b')]=function(_0x446aa8){return request(_0x6cb3('0x1c'),{'options':{'where':{'id':_0x446aa8},'attributes':[_0x6cb3('0x12')]}});};exports[_0x6cb3('0x1d')]=function(_0x195e73){return request(_0x6cb3('0x1e'),{'options':{'where':{'id':_0x195e73},'attributes':[_0x6cb3('0x12')]}});};exports[_0x6cb3('0x1f')]=function(_0x1aa20a){return request(_0x6cb3('0x20'),{'options':{'where':{'id':_0x1aa20a},'attributes':[_0x6cb3('0x21')]}});};exports[_0x6cb3('0x22')]=function(_0x4d5679){return request(_0x6cb3('0x23'),{'options':{'raw':![],'where':{'id':_0x4d5679},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x5356dc){return request(_0x6cb3('0x24'),{'options':{'where':{'id':_0x5356dc},'attributes':['id',_0x6cb3('0x12')]}});};exports[_0x6cb3('0x25')]=function(_0x3cc155){return request('CreateSmsMessage',{'body':_0x3cc155});};exports[_0x6cb3('0x26')]=function(_0x4a04f7){return request(_0x6cb3('0x27'),{'body':_0x4a04f7});};exports[_0x6cb3('0x28')]=function(_0x184327){return request(_0x6cb3('0x29'),{'body':_[_0x6cb3('0x2a')](_0x184327,{'project_name':_0x184327['arg_1'],'prev_project_name':_0x184327['arg_2']||'','is_subproject':_0x184327[_0x6cb3('0x2b')]?!![]:![],'leaveAt':moment()[_0x6cb3('0x2c')](_0x6cb3('0x2d'))})});};exports[_0x6cb3('0x2e')]=function(_0x17cacc){return request(_0x6cb3('0x2f'),{'body':_0x17cacc});};exports['createSquareMessage']=function(_0x40bba4){return request('CreateSquareMessage',{'body':_0x40bba4});};exports[_0x6cb3('0x30')]=function(_0xa5f84f){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xa5f84f[_0x6cb3('0x31')],'ListId':_0xa5f84f[_0x6cb3('0x32')]}}})[_0x6cb3('0x33')](function(_0x45ae66){if(_0x45ae66){return _0x45ae66;}return request(_0x6cb3('0x34'),{'body':_0xa5f84f});});};exports[_0x6cb3('0x35')]=function(_0x86f41b){return request('ShowPause',{'options':{'where':{'id':_0x86f41b},'attributes':['name']}});};exports[_0x6cb3('0x36')]=function(_0x112005,_0x200d15){return request(_0x6cb3('0x37'),{'body':{'interface':_0x200d15},'options':{'where':_0x112005}});};exports[_0x6cb3('0x38')]=function(_0x54353b,_0x1341e9,_0x5024ce){return request('PauseUser',{'body':{'type':_0x1341e9,'uniqueid':_0x5024ce},'options':{'where':_0x54353b}});};exports['agentUnpause']=function(_0x3ed15f){return request(_0x6cb3('0x39'),{'body':{},'options':{'where':_0x3ed15f}});};exports['agentLogout']=function(_0x3d80e9){return request(_0x6cb3('0x3a'),{'body':{},'options':{'where':_0x3d80e9}});}; \ No newline at end of file +var _0x55f6=['getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','util','client','http','request','then','error','message','result','production','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById'];(function(_0xdbe4c0,_0x342213){var _0x533c3c=function(_0x1d4995){while(--_0x1d4995){_0xdbe4c0['push'](_0xdbe4c0['shift']());}};_0x533c3c(++_0x342213);}(_0x55f6,0xf3));var _0x655f=function(_0x41768c,_0x1b2884){_0x41768c=_0x41768c-0x0;var _0x3ab8c0=_0x55f6[_0x41768c];return _0x3ab8c0;};'use strict';var BPromise=require(_0x655f('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0x655f('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x655f('0x2')][_0x655f('0x3')]({'port':0x2329});function request(_0x4329b5,_0x38d877){return new BPromise(function(_0x452772,_0xbdf4d2){return client[_0x655f('0x4')](_0x4329b5,_0x38d877)[_0x655f('0x5')](function(_0xde18a9){if(_0xde18a9[_0x655f('0x6')]){return _0xbdf4d2(_0xde18a9[_0x655f('0x6')][_0x655f('0x7')]);}else{return _0x452772(_0xde18a9[_0x655f('0x8')]);}})['catch'](function(_0x3ee238){return _0xbdf4d2(_0x3ee238);});});}exports['getSquareProject']=function(_0x3108bb){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3108bb},'attributes':[_0x655f('0x9')]}});};exports['getMailAccountById']=function(_0x57d96b){return request(_0x655f('0xa'),{'options':{'raw':![],'where':{'id':_0x57d96b},'include':[{'model':'MailServerOut','as':_0x655f('0xb')}],'attributes':['id',_0x655f('0xc'),_0x655f('0xd')]}});};exports[_0x655f('0xe')]=function(_0x1485e9){return request(_0x655f('0xf'),{'options':{'where':{'id':_0x1485e9},'attributes':['name']}});};exports[_0x655f('0x10')]=function(_0x567d08){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x567d08},'attributes':['name']}});};exports[_0x655f('0x11')]=function(_0x1339bc){return request(_0x655f('0x12'),{'options':{'where':{'id':_0x1339bc},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x2018ee){return request(_0x655f('0x13'),{'options':{'where':{'id':_0x2018ee},'attributes':[_0x655f('0x14')]}});};exports[_0x655f('0x15')]=function(_0x1942a4){return request(_0x655f('0x16'),{'options':{'where':{'id':_0x1942a4},'attributes':[_0x655f('0xc')]}});};exports[_0x655f('0x17')]=function(_0x1b9318){return request(_0x655f('0x18'),{'options':{'where':{'id':_0x1b9318},'attributes':[_0x655f('0xc')]}});};exports[_0x655f('0x19')]=function(_0x1ce89e){return request(_0x655f('0x1a'),{'options':{'where':{'id':_0x1ce89e},'attributes':[_0x655f('0x1b')]}});};exports[_0x655f('0x1c')]=function(_0x367eb6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x367eb6},'include':[{'model':_0x655f('0x1d'),'as':_0x655f('0x1e')}]}});};exports[_0x655f('0x1f')]=function(_0x55a6d4){return request('ShowSmsAccount',{'options':{'where':{'id':_0x55a6d4},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x500f3e){return request('CreateSmsMessage',{'body':_0x500f3e});};exports[_0x655f('0x20')]=function(_0x246fe5){return request('CreateSquareDetailsReport',{'body':_0x246fe5});};exports['createSquareReport']=function(_0x31b475){return request(_0x655f('0x21'),{'body':_[_0x655f('0x22')](_0x31b475,{'project_name':_0x31b475[_0x655f('0x23')],'prev_project_name':_0x31b475[_0x655f('0x24')]||'','is_subproject':_0x31b475[_0x655f('0x24')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x655f('0x25')]=function(_0x3bd62e){return request(_0x655f('0x26'),{'body':_0x3bd62e});};exports[_0x655f('0x27')]=function(_0x1c3d82){return request(_0x655f('0x28'),{'body':_0x1c3d82});};exports[_0x655f('0x29')]=function(_0x160244){return request(_0x655f('0x2a'),{'options':{'raw':![],'where':{'phone':_0x160244[_0x655f('0x2b')],'ListId':_0x160244['ListId']}}})[_0x655f('0x5')](function(_0x3d2aa6){if(_0x3d2aa6){return _0x3d2aa6;}return request('CreateCmContact',{'body':_0x160244});});};exports['getPauseById']=function(_0x3f2dd2){return request(_0x655f('0x2c'),{'options':{'where':{'id':_0x3f2dd2},'attributes':[_0x655f('0xc')]}});};exports[_0x655f('0x2d')]=function(_0x1516f2,_0x57e0a0){return request(_0x655f('0x2e'),{'body':{'interface':_0x57e0a0},'options':{'where':_0x1516f2}});};exports[_0x655f('0x2f')]=function(_0x20f10e,_0x164fdf,_0x1f933f){return request(_0x655f('0x30'),{'body':{'type':_0x164fdf,'uniqueid':_0x1f933f},'options':{'where':_0x20f10e}});};exports['agentUnpause']=function(_0x8af804){return request(_0x655f('0x31'),{'body':{},'options':{'where':_0x8af804}});};exports[_0x655f('0x32')]=function(_0x41c274){return request(_0x655f('0x33'),{'body':{},'options':{'where':_0x41c274}});}; \ 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 a84774d..3a71bf5 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 _0xee4a=['./polly','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xee4a,0x9e));var _0xaee4=function(_0x3e0db4,_0x3b109f){_0x3e0db4=_0x3e0db4-0x0;var _0x5a04a3=_0xee4a[_0x3e0db4];return _0x5a04a3;};var polly=require(_0xaee4('0x0'));var lex=require('./lex');module[_0xaee4('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x78b7=['./polly','./lex'];(function(_0x1b51f2,_0x417ba1){var _0x32587d=function(_0x6d690){while(--_0x6d690){_0x1b51f2['push'](_0x1b51f2['shift']());}};_0x32587d(++_0x417ba1);}(_0x78b7,0x194));var _0x778b=function(_0x13b623,_0x483f69){_0x13b623=_0x13b623-0x0;var _0x56f9e9=_0x78b7[_0x13b623];return _0x56f9e9;};var polly=require(_0x778b('0x0'));var lex=require(_0x778b('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 da33d44..92367de 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 _0xe706=['exports','./lib/api'];(function(_0x3192b6,_0x23aeb5){var _0x3697cb=function(_0x261d94){while(--_0x261d94){_0x3192b6['push'](_0x3192b6['shift']());}};_0x3697cb(++_0x23aeb5);}(_0xe706,0xa3));var _0x6e70=function(_0x3c7152,_0x302b29){_0x3c7152=_0x3c7152-0x0;var _0x43aea5=_0xe706[_0x3c7152];return _0x43aea5;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ No newline at end of file +var _0x3c81=['./lib/api','exports'];(function(_0x574d78,_0x595c99){var _0x5dddd6=function(_0x41df35){while(--_0x41df35){_0x574d78['push'](_0x574d78['shift']());}};_0x5dddd6(++_0x595c99);}(_0x3c81,0x102));var _0x13c8=function(_0x2ca793,_0x352355){_0x2ca793=_0x2ca793-0x0;var _0x34f02e=_0x3c81[_0x2ca793];return _0x34f02e;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ 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 cc4a0e4..c94ea56 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(_0x45a837,_0x46c595){var _0x36cfd7=function(_0x22d0fa){while(--_0x22d0fa){_0x45a837['push'](_0x45a837['shift']());}};_0x36cfd7(++_0x46c595);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x2b59a8,_0x1357b8){var _0x7ed94d=function(_0xe54811){while(--_0xe54811){_0x2b59a8['push'](_0x2b59a8['shift']());}};_0x7ed94d(++_0x1357b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 05979e5..bb88860 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 _0x3e92=['exports','./lib/api'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x3e92,0xbb));var _0x23e9=function(_0x13cfe8,_0x446310){_0x13cfe8=_0x13cfe8-0x0;var _0x2830b6=_0x3e92[_0x13cfe8];return _0x2830b6;};'use strict';var polly=require(_0x23e9('0x0'));module[_0x23e9('0x1')]=function(_0x29e6f4,_0x88910c,_0x2e6e01,_0x4c72e6,_0x5b2abc,_0x201837,_0x56ab3e){return polly(_0x29e6f4,_0x88910c,_0x2e6e01,_0x4c72e6,_0x5b2abc,_0x201837,_0x56ab3e);}; \ No newline at end of file +var _0x11ab=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11ab,0x14c));var _0xb11a=function(_0x2ecbff,_0x10c710){_0x2ecbff=_0x2ecbff-0x0;var _0x4e12d2=_0x11ab[_0x2ecbff];return _0x4e12d2;};'use strict';var polly=require('./lib/api');module[_0xb11a('0x0')]=function(_0x2dcaa5,_0x4f2768,_0x2ebc42,_0x1815c0,_0x3bf8ad,_0x2eb616,_0x484544){return polly(_0x2dcaa5,_0x4f2768,_0x2ebc42,_0x1815c0,_0x3bf8ad,_0x2eb616,_0x484544);}; \ 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 432db61..e6a0359 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 _0x9445=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','path','bluebird','aws-sdk'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x9445,0x185));var _0x5944=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9445[_0x57b54c];return _0x59cc19;};'use strict';var fs=require('fs');var path=require(_0x5944('0x0'));var BPromise=require(_0x5944('0x1'));var rs=require('randomstring');var AWS=require(_0x5944('0x2'));function pollyResult(_0x40f1d3,_0x10f987,_0x386713){return new BPromise(function(_0x12ef14,_0x421f7b){_0x40f1d3['synthesizeSpeech'](_0x10f987,function(_0x44e55c,_0x2c16e1){if(_0x44e55c){_0x421f7b(_0x44e55c);}else if(_0x2c16e1){if(_0x2c16e1['AudioStream']instanceof Buffer){fs['writeFile'](_0x386713,_0x2c16e1[_0x5944('0x3')],function(_0x101076){if(_0x101076){_0x421f7b(_0x101076);}else{_0x12ef14();}});}else{_0x421f7b(new Error(_0x5944('0x4')));}}else{_0x421f7b(new Error(_0x5944('0x5')));}});});}module['exports']=function(_0x6d1c07,_0xe82363,_0x1167d3,_0x35e749,_0x154ec7,_0x2fd5ba,_0xbbfa98){var _0x2e7e26=new AWS[(_0x5944('0x6'))]({'accessKeyId':_0x6d1c07,'secretAccessKey':_0xe82363,'region':_0x1167d3});var _0x2826ee={'Text':_0x154ec7,'TextType':_0x2fd5ba||'text','OutputFormat':_0x5944('0x7'),'VoiceId':_0x35e749};return pollyResult(_0x2e7e26,_0x2826ee,_0xbbfa98);}; \ No newline at end of file +var _0x6346=['randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0xceab18,_0x5368e3){var _0x32c31c=function(_0x1f85be){while(--_0x1f85be){_0xceab18['push'](_0xceab18['shift']());}};_0x32c31c(++_0x5368e3);}(_0x6346,0xe5));var _0x6634=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x6346[_0xaa1b3e];return _0x454d7d;};'use strict';var fs=require('fs');var path=require(_0x6634('0x0'));var BPromise=require('bluebird');var rs=require(_0x6634('0x1'));var AWS=require(_0x6634('0x2'));function pollyResult(_0x5707d7,_0x483131,_0x4f7fdb){return new BPromise(function(_0x1c5398,_0x3be351){_0x5707d7['synthesizeSpeech'](_0x483131,function(_0x525949,_0x4ec8cc){if(_0x525949){_0x3be351(_0x525949);}else if(_0x4ec8cc){if(_0x4ec8cc[_0x6634('0x3')]instanceof Buffer){fs[_0x6634('0x4')](_0x4f7fdb,_0x4ec8cc[_0x6634('0x3')],function(_0x134fb2){if(_0x134fb2){_0x3be351(_0x134fb2);}else{_0x1c5398();}});}else{_0x3be351(new Error(_0x6634('0x5')));}}else{_0x3be351(new Error(_0x6634('0x6')));}});});}module[_0x6634('0x7')]=function(_0x30b994,_0xa39f06,_0x569a56,_0x75cc01,_0x26b6b8,_0xc27b9c,_0x2456e4){var _0x4520a4=new AWS[(_0x6634('0x8'))]({'accessKeyId':_0x30b994,'secretAccessKey':_0xa39f06,'region':_0x569a56});var _0x284185={'Text':_0x26b6b8,'TextType':_0xc27b9c||'text','OutputFormat':_0x6634('0x9'),'VoiceId':_0x75cc01};return pollyResult(_0x4520a4,_0x284185,_0x2456e4);}; \ 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 58232b7..013932c 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 _0xa354=['exports','./lib/api'];(function(_0x33141f,_0x361351){var _0x3298fe=function(_0x5dd972){while(--_0x5dd972){_0x33141f['push'](_0x33141f['shift']());}};_0x3298fe(++_0x361351);}(_0xa354,0x189));var _0x4a35=function(_0x115970,_0x4e288e){_0x115970=_0x115970-0x0;var _0x109e06=_0xa354[_0x115970];return _0x109e06;};'use strict';var asr=require(_0x4a35('0x0'));module[_0x4a35('0x1')]=function(_0x4664fb,_0x8b30dc,_0x5683dd,_0x25ebbe){return asr(_0x4664fb,_0x8b30dc,_0x5683dd);}; \ No newline at end of file +var _0xdd0b=['./lib/api','exports'];(function(_0x46fe39,_0x3ff866){var _0x3dca40=function(_0x57b392){while(--_0x57b392){_0x46fe39['push'](_0x46fe39['shift']());}};_0x3dca40(++_0x3ff866);}(_0xdd0b,0x18a));var _0xbdd0=function(_0x38b3b4,_0x2bd779){_0x38b3b4=_0x38b3b4-0x0;var _0x5555c3=_0xdd0b[_0x38b3b4];return _0x5555c3;};'use strict';var asr=require(_0xbdd0('0x0'));module[_0xbdd0('0x1')]=function(_0x4e9ace,_0x58909d,_0x20eecd,_0x3c42e1){return asr(_0x4e9ace,_0x58909d,_0x20eecd);}; \ 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 735eacf..0fee082 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 _0xcab6=['base64','POST','/v1/speech:recognize?key=','LINEAR16','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','toString'];(function(_0x23e887,_0x464368){var _0x5b4fb1=function(_0x33a947){while(--_0x33a947){_0x23e887['push'](_0x23e887['shift']());}};_0x5b4fb1(++_0x464368);}(_0xcab6,0xd4));var _0x6cab=function(_0x2c652d,_0x36197f){_0x2c652d=_0x2c652d-0x0;var _0x37c32f=_0xcab6[_0x2c652d];return _0x37c32f;};'use strict';var url=require(_0x6cab('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6cab('0x1');module[_0x6cab('0x2')]=function(_0x1ff0cd,_0x1b8153,_0xae3b53){return new BPromise(function(_0x129d57,_0x5ea2d8){var _0xa8b534;if(typeof _0x1ff0cd!=='string'||_0x1ff0cd[_0x6cab('0x3')]===0x0){return _0x5ea2d8(_0x6cab('0x4'));}if(typeof _0x1b8153!==_0x6cab('0x5')||_0x1b8153['length']===0x0){return _0x5ea2d8(_0x6cab('0x6'));}if(typeof _0xae3b53!==_0x6cab('0x7')&&(typeof _0xae3b53!==_0x6cab('0x5')||_0xae3b53[_0x6cab('0x3')]===0x0)){return _0x5ea2d8('lang\x20should\x20be\x20a\x20string');}try{_0xa8b534=fs['readFileSync'](_0x1ff0cd)[_0x6cab('0x8')](_0x6cab('0x9'));}catch(_0x2aa304){return _0x5ea2d8(_0x2aa304);}return _0x129d57({'method':_0x6cab('0xa'),'uri':host+_0x6cab('0xb')+_0x1b8153,'body':{'config':{'encoding':_0x6cab('0xc'),'sampleRateHertz':'8000','languageCode':_0xae3b53},'audio':{'content':_0xa8b534}},'json':!![]});});}; \ No newline at end of file +var _0x9567=['string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x5fbba4,_0xb9afab){var _0x2c91ed=function(_0x60223c){while(--_0x60223c){_0x5fbba4['push'](_0x5fbba4['shift']());}};_0x2c91ed(++_0xb9afab);}(_0x9567,0xdc));var _0x7956=function(_0x3039ff,_0x56f86b){_0x3039ff=_0x3039ff-0x0;var _0x44cc91=_0x9567[_0x3039ff];return _0x44cc91;};'use strict';var url=require(_0x7956('0x0'));var BPromise=require(_0x7956('0x1'));var fs=require('fs');var host=_0x7956('0x2');module[_0x7956('0x3')]=function(_0x4459ae,_0x50169f,_0x4da79a){return new BPromise(function(_0x1f51a7,_0x27b00b){var _0x5cd0f8;if(typeof _0x4459ae!==_0x7956('0x4')||_0x4459ae['length']===0x0){return _0x27b00b(_0x7956('0x5'));}if(typeof _0x50169f!=='string'||_0x50169f[_0x7956('0x6')]===0x0){return _0x27b00b(_0x7956('0x7'));}if(typeof _0x4da79a!=='undefined'&&(typeof _0x4da79a!==_0x7956('0x4')||_0x4da79a['length']===0x0)){return _0x27b00b(_0x7956('0x8'));}try{_0x5cd0f8=fs[_0x7956('0x9')](_0x4459ae)['toString'](_0x7956('0xa'));}catch(_0xe825){return _0x27b00b(_0xe825);}return _0x1f51a7({'method':'POST','uri':host+_0x7956('0xb')+_0x50169f,'body':{'config':{'encoding':_0x7956('0xc'),'sampleRateHertz':_0x7956('0xd'),'languageCode':_0x4da79a},'audio':{'content':_0x5cd0f8}},'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 732def8..a77b307 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 _0x623f=['exports','./asr'];(function(_0x2a40bf,_0x3de4be){var _0x524bee=function(_0x41cba4){while(--_0x41cba4){_0x2a40bf['push'](_0x2a40bf['shift']());}};_0x524bee(++_0x3de4be);}(_0x623f,0x17b));var _0xf623=function(_0x37d7da,_0xe209a0){_0x37d7da=_0x37d7da-0x0;var _0x26a0d9=_0x623f[_0x37d7da];return _0x26a0d9;};var asr=require(_0xf623('0x0'));module[_0xf623('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7272=['exports','./asr'];(function(_0x58927a,_0x2a7f90){var _0x4c55f4=function(_0x1f4d09){while(--_0x1f4d09){_0x58927a['push'](_0x58927a['shift']());}};_0x4c55f4(++_0x2a7f90);}(_0x7272,0x1b1));var _0x2727=function(_0x229f3c,_0x35bc1e){_0x229f3c=_0x229f3c-0x0;var _0x278df8=_0x7272[_0x229f3c];return _0x278df8;};var asr=require(_0x2727('0x0'));module[_0x2727('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 edd812e..33fbd0d 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 _0x0159=['actionIncomplete','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','fields','diagnosticInfo','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','error','download\x20error','pipe','end','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','then','unlink','777','split','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','POST','.mp3','audioContent','writeFile','chmodSync','generate','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','result','source','action'];(function(_0x4a5293,_0x6000d7){var _0x3699df=function(_0x4d37b7){while(--_0x4d37b7){_0x4a5293['push'](_0x4a5293['shift']());}};_0x3699df(++_0x6000d7);}(_0x0159,0xaf));var _0x9015=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0159[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require(_0x9015('0x0'));var BPromise=require(_0x9015('0x1'));var dialogflow=require(_0x9015('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x9015('0x3'));var path=require(_0x9015('0x4'));var querystring=require(_0x9015('0x5'));var rp=require(_0x9015('0x6'));var rs=require('randomstring');var sox=require(_0x9015('0x7'));var tts=require(_0x9015('0x8'));var urlParse=require(_0x9015('0x9'))[_0x9015('0xa')];var util=require(_0x9015('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x9015('0xc'));var logger=require(_0x9015('0xd'))(_0x9015('0xe'));var ISPEECH_API=_0x9015('0xf');function downloadFile(_0x3fccc7,_0x46d35b){return new BPromise(function(_0x1f7b52,_0x3475d8){var _0x4fc8d7=urlParse(_0x3fccc7);var _0x26817a=_0x4fc8d7[_0x9015('0x10')]==='https:'?https:http;var _0x2ec8b7={'host':_0x4fc8d7['host'],'path':_0x4fc8d7['path'],'headers':{'user-agent':_0x9015('0x11')}};_0x26817a[_0x9015('0x12')](_0x2ec8b7,function(_0x3171d0){if(_0x3171d0[_0x9015('0x13')]!==0xc8){logger['error']('request\x20to\x20'+_0x3fccc7+'\x20failed,\x20status\x20code\x20=\x20'+_0x3171d0['statusCode']+'\x20('+_0x3171d0[_0x9015('0x14')]+')');_0x3475d8(new Error(_0x9015('0x15')+_0x3fccc7+_0x9015('0x16')+_0x3171d0['statusCode']+'\x20('+_0x3171d0['statusMessage']+')'));return;}var _0xa0a5f1=fs[_0x9015('0x17')](_0x46d35b);_0xa0a5f1['on'](_0x9015('0x18'),function(){logger[_0x9015('0x19')]('finish\x20download\x20file');_0xa0a5f1[_0x9015('0x1a')](_0x1f7b52);});_0xa0a5f1['on'](_0x9015('0x1b'),function(_0x528985){fs['unlink'](_0x46d35b);logger[_0x9015('0x1b')](_0x9015('0x1c'),_0x528985);_0x3475d8(_0x528985);});_0x3171d0[_0x9015('0x1d')](_0xa0a5f1);})['on'](_0x9015('0x1b'),function(_0x3b8340){logger['error'](_0x3b8340);_0x3475d8(_0x3b8340);})[_0x9015('0x1e')]();});}function uploadFile(_0x464a4c){return new BPromise(function(_0x17d9cd,_0x17f167){var _0x210968=urlParse(_0x464a4c);var _0x57b087=_0x210968[_0x9015('0x10')]==='https:'?https:http;var _0x40427e={'host':_0x210968['host'],'path':_0x210968[_0x9015('0x4')],'headers':{'user-agent':_0x9015('0x11')}};_0x57b087[_0x9015('0x12')](_0x40427e,function(_0x3cf5d4){if(_0x3cf5d4[_0x9015('0x13')]!==0xc8){_0x17f167(new Error(_0x9015('0x15')+_0x464a4c+_0x9015('0x16')+_0x3cf5d4[_0x9015('0x13')]+'\x20('+_0x3cf5d4[_0x9015('0x14')]+')'));return;}var _0x5243b5='';_0x3cf5d4['on'](_0x9015('0x1f'),function(_0x76237f){_0x5243b5+=_0x76237f;});_0x3cf5d4['on'](_0x9015('0x1e'),function(){_0x17d9cd(_0x5243b5);});})['on'](_0x9015('0x1b'),function(_0xd478ac){_0x17f167(_0xd478ac);})[_0x9015('0x1e')]();});}function convertFile(_0x17e184,_0x3e3d72){return new BPromise(function(_0x569f83,_0x4b72b1){var _0x563708=sox[_0x9015('0x20')](_0x17e184,_0x3e3d72,{'sampleRate':0x1f40,'format':_0x9015('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x563708['on'](_0x9015('0x1b'),function(_0x1c56ab){logger['error']('error\x20convert',_0x1c56ab);_0x4b72b1(_0x1c56ab);});_0x563708['on'](_0x9015('0x1e'),function(){logger[_0x9015('0x19')](_0x9015('0x22'));_0x569f83();});_0x563708[_0x9015('0x23')]();});}function base64Decode(_0x3b1294,_0x4bea58){var _0x1c94a1=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs['generate'](0x4)+_0x9015('0x26'));fs[_0x9015('0x27')](_0x1c94a1,_0x3b1294,'base64');return convertFile(_0x1c94a1,_0x4bea58)[_0x9015('0x28')](function(){try{fs[_0x9015('0x29')](_0x1c94a1);fs['chmodSync'](_0x4bea58,_0x9015('0x2a'));}catch(_0x399c8c){logger[_0x9015('0x1b')](_0x399c8c);}return _0x4bea58[_0x9015('0x2b')]('.')[0x0];});}function base64Encode(_0x9f9d69){var _0x1bcd42=fs['readFileSync'](_0x9f9d69);return new Buffer(_0x1bcd42)['toString'](_0x9015('0x2c'));}exports[_0x9015('0x2d')]=function(_0x12dba1,_0x1d03df,_0x4606d0,_0x1752b8,_0x27387f,_0x383955){var _0x2226d1,_0x463ad0;var _0x31ed4a=_0x9015('0x2e');var _0x1d13c1=_0x9015('0x2f')+_0x12dba1;var _0x5938f8={};if(_0x1d03df===_0x9015('0x30')){_0x5938f8[_0x9015('0x31')]={'ssml':_0x4606d0};}else{_0x5938f8['input']={'text':_0x4606d0};};_0x5938f8[_0x9015('0x32')]={'languageCode':_0x1752b8,'ssmlGender':_0x27387f};_0x5938f8[_0x9015('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0xb792b0={'url':_0x31ed4a+'text:synthesize'+_0x1d13c1,'method':_0x9015('0x34'),'json':!![],'body':_0x5938f8};return rp(_0xb792b0)['then'](function(_0x50792f){return new BPromise(function(_0x59163e,_0x5790b4){_0x2226d1=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs['generate'](0x4)+_0x9015('0x35'));var _0x3c1ecc=Buffer['from'](_0x50792f[_0x9015('0x36')],_0x9015('0x2c'));return fs[_0x9015('0x37')](_0x2226d1,_0x3c1ecc,function(_0x2117b8){_0x5790b4(_0x2117b8);},function(_0x5a143d){fs[_0x9015('0x38')](_0x2226d1,_0x9015('0x2a'));_0x59163e(_0x5a143d);});});})[_0x9015('0x28')](function(_0x58d58b){_0x463ad0=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x26'));return convertFile(_0x2226d1,_0x463ad0);})[_0x9015('0x28')](function(){try{fs[_0x9015('0x29')](_0x2226d1);fs['chmodSync'](_0x463ad0,_0x9015('0x2a'));}catch(_0x44c6b8){logger[_0x9015('0x1b')](_0x44c6b8);}logger[_0x9015('0x19')](_0x9015('0x3a'),_0x463ad0[_0x9015('0x2b')]('.')[0x0]);return _0x463ad0[_0x9015('0x2b')]('.')[0x0];});};exports[_0x9015('0x3b')]=function(_0xd6870d,_0x55efa5){var _0x38f8a8=_0x9015('0x3c');var _0x5bde4b,_0x5999cd;var _0x309604;var _0x5e58d3={'encoding':_0x9015('0x3d'),'method':_0x9015('0x34'),'timeout':0x2710,'url':_0x38f8a8,'headers':{'Content-Type':_0x9015('0x3e')},'body':_0x9015('0x3f')+encodeURIComponent(JSON[_0x9015('0x40')]([[[_0x9015('0x41'),JSON[_0x9015('0x40')]([_0xd6870d,_0x55efa5||'en',![],'null']),null,_0x9015('0x42')]]]))};return rp(_0x5e58d3)[_0x9015('0x28')](function(_0x22be31){try{_0x309604=eval(_0x22be31['slice'](0x5))[0x0][0x2];}catch(_0x46ecff){throw new Error('parse\x20response\x20failed:\x0a'+_0x22be31[_0x9015('0x1f')]);}if(!_0x309604){if(_0xd6870d[_0x9015('0x43')]>0xc8){throw new Error(_0x9015('0x44'));}else{throw new Error('lang\x20\x22'+_0x55efa5+_0x9015('0x45'));}}try{_0x309604=eval(_0x309604)[0x0];}catch(_0x4a7364){throw new Error(_0x9015('0x46')+res['data']);}const _0x1fef0c=_0x309604;_0x5bde4b=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x35'));fs[_0x9015('0x27')](_0x5bde4b,_0x309604,{'encoding':'base64'});_0x5999cd=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+'.wav');return convertFile(_0x5bde4b,_0x5999cd);})['then'](function(){try{fs[_0x9015('0x29')](_0x5bde4b);fs[_0x9015('0x38')](_0x5999cd,_0x9015('0x2a'));}catch(_0x456a04){logger[_0x9015('0x1b')](_0x456a04);}logger['info']('goggleTTS\x20path',_0x5999cd[_0x9015('0x2b')]('.')[0x0]);return _0x5999cd[_0x9015('0x2b')]('.')[0x0];});};exports[_0x9015('0x47')]=function(_0x2856be,_0x57970a,_0x31f1d3){return google[_0x9015('0x48')](_0x2856be,_0x57970a,_0x31f1d3)[_0x9015('0x28')](function(_0x17975c){logger['info'](_0x17975c[_0x9015('0x49')]);return rp(_0x17975c);})['then'](function(_0x50cd13){var _0x24c454='';var _0x460cbe=0x0;try{fs[_0x9015('0x29')](_0x2856be);}catch(_0x1e24fe){logger[_0x9015('0x1b')](_0x1e24fe);}if(_0x50cd13&&_0x50cd13[_0x9015('0x4a')]){_0x24c454=_0x50cd13[_0x9015('0x4a')][_0x9015('0x4b')](function(_0x52dc48){return _0x52dc48&&_0x52dc48[_0x9015('0x4c')][0x0]&&_0x52dc48[_0x9015('0x4c')][0x0][_0x9015('0x4d')]?_0x52dc48['alternatives'][0x0]['transcript']:'';})[_0x9015('0x4e')]('\x0a');_0x460cbe=_0x50cd13[_0x9015('0x4a')]['map'](function(_0x1613cc){return _0x1613cc&&_0x1613cc[_0x9015('0x4c')][0x0]&&_0x1613cc[_0x9015('0x4c')][0x0][_0x9015('0x4f')]?_0x1613cc['alternatives'][0x0][_0x9015('0x4f')]:0x0;})[_0x9015('0x4e')]('\x0a');}logger['info'](_0x9015('0x50'),_0x24c454);logger['info'](_0x9015('0x51'),_0x460cbe);return{'transcript':_0x24c454,'confidence':_0x460cbe};})[_0x9015('0x52')](function(_0x5dc947){logger[_0x9015('0x1b')](_0x9015('0x53'),_0x5dc947[_0x9015('0x13')],_0x5dc947[_0x9015('0x54')],_0x5dc947[_0x9015('0x55')]);});};exports['googleDialogflow']=function(_0x43626a,_0xf25765,_0x1d11a7,_0x4feae3){var _0x13c678=apiai(_0xf25765,{'language':_0x4feae3||'en'});return _0x13c678['textRequest'](_0x1d11a7,{'sessionId':md5(_0x43626a)})['then'](function(_0xc6c1b2){logger[_0x9015('0x19')](JSON[_0x9015('0x40')](_0xc6c1b2));return{'source':_0xc6c1b2[_0x9015('0x56')][_0x9015('0x57')],'resolvedQuery':_0xc6c1b2[_0x9015('0x56')]['resolvedQuery'],'action':_0xc6c1b2[_0x9015('0x56')][_0x9015('0x58')],'actionIncomplete':_0xc6c1b2[_0x9015('0x56')][_0x9015('0x59')],'speech':_0xc6c1b2[_0x9015('0x56')]['fulfillment'][_0x9015('0x5a')],'score':_0xc6c1b2[_0x9015('0x56')][_0x9015('0x5b')],'statusCode':_0xc6c1b2[_0x9015('0x5c')][_0x9015('0x5d')],'endConversation':_0xc6c1b2[_0x9015('0x56')]['metadata']['endConversation']||![],'isFallbackIntent':_0xc6c1b2['result'][_0x9015('0x5e')][_0x9015('0x5f')]};});};exports[_0x9015('0x60')]=function(_0x2f7fe5,_0x2b0b9b,_0x5594cb,_0x5646f9,_0x44315d,_0x43e63a){var _0x1f4d21=_0x5646f9[_0x9015('0x61')](/\\n/g,'\x0a');var _0xaf8faa={'credentials':{'private_key':_0x1f4d21,'client_email':_0x5594cb}};var _0x5b7963=new dialogflow[(_0x9015('0x62'))](_0xaf8faa);var _0x148812=_0x5b7963[_0x9015('0x63')](_0x2b0b9b,md5(_0x2f7fe5));var _0x1b81f4={'session':_0x148812,'queryInput':{'text':{'text':_0x44315d,'languageCode':_0x43e63a}}};return _0x5b7963[_0x9015('0x64')](_0x1b81f4)[_0x9015('0x28')](function(_0x494a44){if(_0x494a44&&_0x494a44['length']){logger[_0x9015('0x19')](_0x9015('0x65'),JSON[_0x9015('0x40')](_0x494a44));var _0x681d62=_0x494a44[0x0];if(_0x681d62){var _0x25de44={'action':_0x681d62[_0x9015('0x66')][_0x9015('0x58')],'allRequiredParamsPresent':_0x681d62[_0x9015('0x66')]['allRequiredParamsPresent'],'endConversation':_0x681d62[_0x9015('0x66')]['diagnosticInfo']&&_0x681d62[_0x9015('0x66')]['diagnosticInfo'][_0x9015('0x67')]?_0x681d62[_0x9015('0x66')][_0x9015('0x68')][_0x9015('0x67')]['end_conversation'][_0x9015('0x69')]:![],'fulfillmentText':_0x681d62[_0x9015('0x66')][_0x9015('0x6a')],'intentName':_0x681d62[_0x9015('0x66')][_0x9015('0x6b')][_0x9015('0x54')],'intentDisplayName':_0x681d62[_0x9015('0x66')][_0x9015('0x6b')][_0x9015('0x6c')],'isFallbackIntent':_0x681d62[_0x9015('0x66')][_0x9015('0x6b')][_0x9015('0x6d')],'languageCode':_0x681d62['queryResult'][_0x9015('0x6e')],'queryText':_0x681d62[_0x9015('0x66')][_0x9015('0x6f')],'responseId':_0x681d62[_0x9015('0x70')],'score':_0x681d62[_0x9015('0x66')]['intentDetectionConfidence'],'speech':_0x681d62['queryResult'][_0x9015('0x6a')],'providerResponse':JSON[_0x9015('0x40')](_0x494a44)};return _0x25de44;}}});};exports[_0x9015('0x71')]=function(_0x9e086c,_0x18c58e,_0x1735d0,_0x53f06d){return tilde['asr'](_0x9e086c,_0x18c58e,_0x1735d0,_0x53f06d)[_0x9015('0x28')](function(_0x470f11){try{fs[_0x9015('0x29')](_0x9e086c);}catch(_0x5b80d2){logger[_0x9015('0x1b')](_0x5b80d2);}logger['info'](_0x9015('0x72'),_0x470f11[_0x9015('0x4d')]);logger[_0x9015('0x19')]('Tilde\x20ASR\x20confidence',_0x470f11[_0x9015('0x4f')]);return _0x470f11;});};exports[_0x9015('0x73')]=function(_0x3d3e3b,_0x15b7dd,_0x3497a5,_0x1c471b,_0x4f73aa,_0x36f716){var _0x3831e0=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x35'));var _0x1bb72a;return aws['polly'](_0x3d3e3b,_0x15b7dd,_0x3497a5,_0x1c471b,_0x4f73aa,_0x36f716,_0x3831e0)['then'](function(){_0x1bb72a=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x26'));return convertFile(_0x3831e0,_0x1bb72a);})[_0x9015('0x28')](function(){try{fs[_0x9015('0x29')](_0x3831e0);fs['chmodSync'](_0x1bb72a,_0x9015('0x2a'));}catch(_0x1bfed3){logger[_0x9015('0x1b')](_0x1bfed3);}return _0x1bb72a['split']('.')[0x0];});};exports[_0x9015('0x74')]=function(_0x4f5c3d,_0x3346fc,_0x9b6029,_0xbd1c22,_0x4a7932,_0x2decb4){return aws[_0x9015('0x75')](_0x4f5c3d,_0x3346fc,_0x9b6029,_0xbd1c22,_0x4a7932,_0x2decb4)[_0x9015('0x28')](function(_0x1961a2){logger['info'](JSON[_0x9015('0x40')](_0x1961a2));return _0x1961a2;});};exports['ispeechTTS']=function(_0x221082,_0x4fbdb8,_0x1182d2,_0x280e65){var _0x4aa3a0=util[_0x9015('0x76')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x221082,encodeURIComponent(_0x4fbdb8),_0x1182d2,_0x280e65);var _0x384f59=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs['generate'](0x4)+'.mp3');var _0x3b9321;return downloadFile(_0x4aa3a0,_0x384f59)[_0x9015('0x28')](function(){_0x3b9321=path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x26'));return convertFile(_0x384f59,_0x3b9321);})[_0x9015('0x28')](function(){try{fs[_0x9015('0x29')](_0x384f59);fs['chmodSync'](_0x3b9321,_0x9015('0x2a'));}catch(_0x4e6eb8){logger[_0x9015('0x1b')](_0x4e6eb8);}return _0x3b9321[_0x9015('0x2b')]('.')[0x0];});};exports[_0x9015('0x77')]=function(_0x4ff17d,_0xf36c5b,_0x12008a,_0x2b22cc){var _0x24a9e7=util['format'](_0x9015('0x78'),ISPEECH_API,_0xf36c5b,_0x12008a,base64Encode(_0x4ff17d),_0x2b22cc?util[_0x9015('0x76')](_0x9015('0x79'),encodeURIComponent(_0x2b22cc)):_0x9015('0x7a'));return uploadFile(_0x24a9e7)[_0x9015('0x28')](function(_0xe0b623){return querystring[_0x9015('0xa')](_0xe0b623);});};exports[_0x9015('0x7b')]=function(_0x2048ef,_0x439795){return sestek[_0x9015('0x7c')](_0x2048ef,_0x439795)[_0x9015('0x28')](function(_0x573cd7){logger[_0x9015('0x19')](JSON['stringify'](_0x573cd7));var _0x3860a1={'speech':_0x573cd7[_0x9015('0x7d')],'action':_0x573cd7[_0x9015('0x7e')]?_0x573cd7[_0x9015('0x7e')][_0x9015('0x7f')]:undefined,'actiondata':_0x573cd7[_0x9015('0x7e')]?_0x573cd7['channelData'][_0x9015('0x80')]:undefined};if(_0x573cd7['channelData']&&_0x573cd7[_0x9015('0x7e')][_0x9015('0x81')]){return base64Decode(_0x573cd7['channelData']['AudioFromTts'][_0x9015('0x82')],path[_0x9015('0x24')](__dirname,_0x9015('0x25'),rs[_0x9015('0x39')](0x4)+_0x9015('0x26')))['then'](function(_0x5e2425){_0x3860a1[_0x9015('0x83')]=_0x5e2425;return _0x3860a1;});}return _0x3860a1;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x0a78=['fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','bluebird','http','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','download\x20error','end','host','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','unlink','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','tmp','from','audioContent','googleCloudTTS\x20path','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','chmodSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','message','textRequest','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue'];(function(_0x54fd45,_0x4c87ab){var _0x27f13e=function(_0x98169a){while(--_0x98169a){_0x54fd45['push'](_0x54fd45['shift']());}};_0x27f13e(++_0x4c87ab);}(_0x0a78,0x9c));var _0x80a7=function(_0x446f87,_0x55a7f2){_0x446f87=_0x446f87-0x0;var _0x33a571=_0x0a78[_0x446f87];return _0x33a571;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x80a7('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x80a7('0x1'));var https=require(_0x80a7('0x2'));var md5=require(_0x80a7('0x3'));var path=require(_0x80a7('0x4'));var querystring=require(_0x80a7('0x5'));var rp=require(_0x80a7('0x6'));var rs=require(_0x80a7('0x7'));var sox=require('sox');var tts=require(_0x80a7('0x8'));var urlParse=require(_0x80a7('0x9'))['parse'];var util=require('util');var aws=require(_0x80a7('0xa'));var google=require('./google');var sestek=require(_0x80a7('0xb'));var tilde=require('./tilde');var logger=require(_0x80a7('0xc'))(_0x80a7('0xd'));var ISPEECH_API=_0x80a7('0xe');function downloadFile(_0x1d4da6,_0x37cab0){return new BPromise(function(_0x56ae93,_0x1fb111){var _0x53390f=urlParse(_0x1d4da6);var _0x584f52=_0x53390f[_0x80a7('0xf')]==='https:'?https:http;var _0x2d648d={'host':_0x53390f['host'],'path':_0x53390f[_0x80a7('0x4')],'headers':{'user-agent':_0x80a7('0x10')}};_0x584f52[_0x80a7('0x11')](_0x2d648d,function(_0x596d19){if(_0x596d19[_0x80a7('0x12')]!==0xc8){logger[_0x80a7('0x13')](_0x80a7('0x14')+_0x1d4da6+_0x80a7('0x15')+_0x596d19[_0x80a7('0x12')]+'\x20('+_0x596d19['statusMessage']+')');_0x1fb111(new Error(_0x80a7('0x14')+_0x1d4da6+_0x80a7('0x15')+_0x596d19[_0x80a7('0x12')]+'\x20('+_0x596d19[_0x80a7('0x16')]+')'));return;}var _0x22671b=fs[_0x80a7('0x17')](_0x37cab0);_0x22671b['on']('finish',function(){logger[_0x80a7('0x18')](_0x80a7('0x19'));_0x22671b[_0x80a7('0x1a')](_0x56ae93);});_0x22671b['on'](_0x80a7('0x13'),function(_0x518907){fs['unlink'](_0x37cab0);logger[_0x80a7('0x13')](_0x80a7('0x1b'),_0x518907);_0x1fb111(_0x518907);});_0x596d19['pipe'](_0x22671b);})['on']('error',function(_0x15c257){logger[_0x80a7('0x13')](_0x15c257);_0x1fb111(_0x15c257);})[_0x80a7('0x1c')]();});}function uploadFile(_0x7c40ba){return new BPromise(function(_0x5af463,_0xd4a0e4){var _0x13fe63=urlParse(_0x7c40ba);var _0xf6dacf=_0x13fe63[_0x80a7('0xf')]==='https:'?https:http;var _0x27f454={'host':_0x13fe63[_0x80a7('0x1d')],'path':_0x13fe63[_0x80a7('0x4')],'headers':{'user-agent':_0x80a7('0x10')}};_0xf6dacf[_0x80a7('0x11')](_0x27f454,function(_0x54134a){if(_0x54134a['statusCode']!==0xc8){_0xd4a0e4(new Error('request\x20to\x20'+_0x7c40ba+_0x80a7('0x15')+_0x54134a[_0x80a7('0x12')]+'\x20('+_0x54134a[_0x80a7('0x16')]+')'));return;}var _0x4c8635='';_0x54134a['on'](_0x80a7('0x1e'),function(_0x2de2c1){_0x4c8635+=_0x2de2c1;});_0x54134a['on'](_0x80a7('0x1c'),function(){_0x5af463(_0x4c8635);});})['on'](_0x80a7('0x13'),function(_0x16a789){_0xd4a0e4(_0x16a789);})['end']();});}function convertFile(_0x261f1e,_0x5bc91d){return new BPromise(function(_0x2fcf35,_0x17d1bd){var _0x40659d=sox[_0x80a7('0x1f')](_0x261f1e,_0x5bc91d,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x40659d['on'](_0x80a7('0x13'),function(_0x45fa30){logger[_0x80a7('0x13')](_0x80a7('0x20'),_0x45fa30);_0x17d1bd(_0x45fa30);});_0x40659d['on'](_0x80a7('0x1c'),function(){logger[_0x80a7('0x18')](_0x80a7('0x21'));_0x2fcf35();});_0x40659d[_0x80a7('0x22')]();});}function base64Decode(_0x56dcd1,_0x2939b0){var _0x3a0da4=path[_0x80a7('0x23')](__dirname,'tmp',rs[_0x80a7('0x24')](0x4)+_0x80a7('0x25'));fs[_0x80a7('0x26')](_0x3a0da4,_0x56dcd1,_0x80a7('0x27'));return convertFile(_0x3a0da4,_0x2939b0)[_0x80a7('0x28')](function(){try{fs[_0x80a7('0x29')](_0x3a0da4);fs['chmodSync'](_0x2939b0,_0x80a7('0x2a'));}catch(_0x9de7ec){logger[_0x80a7('0x13')](_0x9de7ec);}return _0x2939b0[_0x80a7('0x2b')]('.')[0x0];});}function base64Encode(_0xa411b){var _0x118e47=fs[_0x80a7('0x2c')](_0xa411b);return new Buffer(_0x118e47)[_0x80a7('0x2d')](_0x80a7('0x27'));}exports[_0x80a7('0x2e')]=function(_0x34845c,_0x54a6c4,_0x1de39b,_0x3e41ba,_0x4c617c,_0x41d8fe){var _0x403fb7,_0x56900f;var _0x481c9c='https://texttospeech.googleapis.com/v1/';var _0x466f1b=_0x80a7('0x2f')+_0x34845c;var _0x446c88={};if(_0x54a6c4===_0x80a7('0x30')){_0x446c88[_0x80a7('0x31')]={'ssml':_0x1de39b};}else{_0x446c88[_0x80a7('0x31')]={'text':_0x1de39b};};_0x446c88[_0x80a7('0x32')]={'languageCode':_0x3e41ba,'ssmlGender':_0x4c617c};_0x446c88[_0x80a7('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x56a482={'url':_0x481c9c+_0x80a7('0x34')+_0x466f1b,'method':_0x80a7('0x35'),'json':!![],'body':_0x446c88};return rp(_0x56a482)[_0x80a7('0x28')](function(_0x5048f1){return new BPromise(function(_0x43c9a3,_0x3197b6){_0x403fb7=path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+'.mp3');var _0x5167df=Buffer[_0x80a7('0x37')](_0x5048f1[_0x80a7('0x38')],'base64');return fs['writeFile'](_0x403fb7,_0x5167df,function(_0x110b3d){_0x3197b6(_0x110b3d);},function(_0x3741f4){fs['chmodSync'](_0x403fb7,'777');_0x43c9a3(_0x3741f4);});});})[_0x80a7('0x28')](function(_0x708f48){_0x56900f=path['resolve'](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+'.wav');return convertFile(_0x403fb7,_0x56900f);})['then'](function(){try{fs[_0x80a7('0x29')](_0x403fb7);fs['chmodSync'](_0x56900f,'777');}catch(_0x29fddb){logger[_0x80a7('0x13')](_0x29fddb);}logger[_0x80a7('0x18')](_0x80a7('0x39'),_0x56900f['split']('.')[0x0]);return _0x56900f[_0x80a7('0x2b')]('.')[0x0];});};exports['googleTTS']=function(_0x42c4ab,_0x2b7c19){var _0x380993='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x4192e4,_0x3f84d7;var _0x3864e4;var _0x27c259={'encoding':_0x80a7('0x3a'),'method':'POST','timeout':0x2710,'url':_0x380993,'headers':{'Content-Type':_0x80a7('0x3b')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x80a7('0x3c'),JSON[_0x80a7('0x3d')]([_0x42c4ab,_0x2b7c19||'en',![],_0x80a7('0x3e')]),null,'generic']]]))};return rp(_0x27c259)[_0x80a7('0x28')](function(_0xd839ae){try{_0x3864e4=eval(_0xd839ae[_0x80a7('0x3f')](0x5))[0x0][0x2];}catch(_0x43db76){throw new Error('parse\x20response\x20failed:\x0a'+_0xd839ae['data']);}if(!_0x3864e4){if(_0x42c4ab[_0x80a7('0x40')]>0xc8){throw new Error(_0x80a7('0x41'));}else{throw new Error(_0x80a7('0x42')+_0x2b7c19+_0x80a7('0x43'));}}try{_0x3864e4=eval(_0x3864e4)[0x0];}catch(_0x4764d2){throw new Error(_0x80a7('0x44')+res[_0x80a7('0x1e')]);}const _0x443453=_0x3864e4;_0x4192e4=path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+_0x80a7('0x45'));fs['writeFileSync'](_0x4192e4,_0x3864e4,{'encoding':_0x80a7('0x27')});_0x3f84d7=path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+_0x80a7('0x25'));return convertFile(_0x4192e4,_0x3f84d7);})['then'](function(){try{fs[_0x80a7('0x29')](_0x4192e4);fs[_0x80a7('0x46')](_0x3f84d7,_0x80a7('0x2a'));}catch(_0x27d5d2){logger[_0x80a7('0x13')](_0x27d5d2);}logger[_0x80a7('0x18')](_0x80a7('0x47'),_0x3f84d7[_0x80a7('0x2b')]('.')[0x0]);return _0x3f84d7[_0x80a7('0x2b')]('.')[0x0];});};exports[_0x80a7('0x48')]=function(_0x77f87c,_0x8935e7,_0x4a913f){return google['asr'](_0x77f87c,_0x8935e7,_0x4a913f)[_0x80a7('0x28')](function(_0x464758){logger[_0x80a7('0x18')](_0x464758[_0x80a7('0x49')]);return rp(_0x464758);})['then'](function(_0x3694e9){var _0x2bba8='';var _0x24060e=0x0;try{fs[_0x80a7('0x29')](_0x77f87c);}catch(_0x507178){logger[_0x80a7('0x13')](_0x507178);}if(_0x3694e9&&_0x3694e9[_0x80a7('0x4a')]){_0x2bba8=_0x3694e9[_0x80a7('0x4a')][_0x80a7('0x4b')](function(_0x219bd2){return _0x219bd2&&_0x219bd2[_0x80a7('0x4c')][0x0]&&_0x219bd2[_0x80a7('0x4c')][0x0][_0x80a7('0x4d')]?_0x219bd2[_0x80a7('0x4c')][0x0][_0x80a7('0x4d')]:'';})[_0x80a7('0x4e')]('\x0a');_0x24060e=_0x3694e9[_0x80a7('0x4a')][_0x80a7('0x4b')](function(_0x9005a2){return _0x9005a2&&_0x9005a2[_0x80a7('0x4c')][0x0]&&_0x9005a2[_0x80a7('0x4c')][0x0][_0x80a7('0x4f')]?_0x9005a2[_0x80a7('0x4c')][0x0][_0x80a7('0x4f')]:0x0;})[_0x80a7('0x4e')]('\x0a');}logger[_0x80a7('0x18')](_0x80a7('0x50'),_0x2bba8);logger[_0x80a7('0x18')](_0x80a7('0x51'),_0x24060e);return{'transcript':_0x2bba8,'confidence':_0x24060e};})['catch'](function(_0x1e0e52){logger[_0x80a7('0x13')]('[%s]\x20%s:%s',_0x1e0e52[_0x80a7('0x12')],_0x1e0e52[_0x80a7('0x52')],_0x1e0e52[_0x80a7('0x53')]);});};exports['googleDialogflow']=function(_0x3b35c2,_0x147a32,_0x5deabd,_0x5f03bd){var _0x56f473=apiai(_0x147a32,{'language':_0x5f03bd||'en'});return _0x56f473[_0x80a7('0x54')](_0x5deabd,{'sessionId':md5(_0x3b35c2)})[_0x80a7('0x28')](function(_0x4f2fd1){logger[_0x80a7('0x18')](JSON[_0x80a7('0x3d')](_0x4f2fd1));return{'source':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x56')],'resolvedQuery':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x57')],'action':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x58')],'actionIncomplete':_0x4f2fd1[_0x80a7('0x55')]['actionIncomplete'],'speech':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x59')]['speech'],'score':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x5a')],'statusCode':_0x4f2fd1[_0x80a7('0x5b')][_0x80a7('0x5c')],'endConversation':_0x4f2fd1[_0x80a7('0x55')][_0x80a7('0x5d')]['endConversation']||![],'isFallbackIntent':_0x4f2fd1['result']['metadata'][_0x80a7('0x5e')]};});};exports['googleDialogflowV2']=function(_0x47a597,_0x2ed9c2,_0x2e5bbd,_0x1ed80b,_0x131d6e,_0x433739){var _0xa4d3b7=_0x1ed80b[_0x80a7('0x5f')](/\\n/g,'\x0a');var _0x1eec97={'credentials':{'private_key':_0xa4d3b7,'client_email':_0x2e5bbd}};var _0x50bbb8=new dialogflow[(_0x80a7('0x60'))](_0x1eec97);var _0x5ee8be=_0x50bbb8[_0x80a7('0x61')](_0x2ed9c2,md5(_0x47a597));var _0x595016={'session':_0x5ee8be,'queryInput':{'text':{'text':_0x131d6e,'languageCode':_0x433739}}};return _0x50bbb8['detectIntent'](_0x595016)[_0x80a7('0x28')](function(_0x4c8ae6){if(_0x4c8ae6&&_0x4c8ae6[_0x80a7('0x40')]){logger[_0x80a7('0x18')](_0x80a7('0x62'),JSON[_0x80a7('0x3d')](_0x4c8ae6));var _0x4b7d20=_0x4c8ae6[0x0];if(_0x4b7d20){var _0x3d0882={'action':_0x4b7d20['queryResult'][_0x80a7('0x58')],'allRequiredParamsPresent':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x64')],'endConversation':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x65')]&&_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x65')]['fields']?_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x65')]['fields'][_0x80a7('0x66')][_0x80a7('0x67')]:![],'fulfillmentText':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x68')],'intentName':_0x4b7d20['queryResult'][_0x80a7('0x69')][_0x80a7('0x52')],'intentDisplayName':_0x4b7d20[_0x80a7('0x63')]['intent'][_0x80a7('0x6a')],'isFallbackIntent':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x69')][_0x80a7('0x6b')],'languageCode':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x6c')],'queryText':_0x4b7d20[_0x80a7('0x63')]['queryText'],'responseId':_0x4b7d20[_0x80a7('0x6d')],'score':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x6e')],'speech':_0x4b7d20[_0x80a7('0x63')][_0x80a7('0x68')],'providerResponse':JSON['stringify'](_0x4c8ae6)};return _0x3d0882;}}});};exports['tildeASR']=function(_0x7da8af,_0x235ffb,_0x2f0a18,_0x2bee63){return tilde['asr'](_0x7da8af,_0x235ffb,_0x2f0a18,_0x2bee63)[_0x80a7('0x28')](function(_0x1bf4a1){try{fs[_0x80a7('0x29')](_0x7da8af);}catch(_0x4b8e48){logger[_0x80a7('0x13')](_0x4b8e48);}logger['info']('Tilde\x20ASR\x20transcription',_0x1bf4a1[_0x80a7('0x4d')]);logger['info'](_0x80a7('0x6f'),_0x1bf4a1[_0x80a7('0x4f')]);return _0x1bf4a1;});};exports[_0x80a7('0x70')]=function(_0x5540f4,_0x5da1f7,_0x20d416,_0x2168a0,_0x12d440,_0x27e8aa){var _0x356a7f=path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs['generate'](0x4)+_0x80a7('0x45'));var _0x2bdc11;return aws[_0x80a7('0x71')](_0x5540f4,_0x5da1f7,_0x20d416,_0x2168a0,_0x12d440,_0x27e8aa,_0x356a7f)[_0x80a7('0x28')](function(){_0x2bdc11=path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+_0x80a7('0x25'));return convertFile(_0x356a7f,_0x2bdc11);})[_0x80a7('0x28')](function(){try{fs[_0x80a7('0x29')](_0x356a7f);fs[_0x80a7('0x46')](_0x2bdc11,_0x80a7('0x2a'));}catch(_0x339c33){logger[_0x80a7('0x13')](_0x339c33);}return _0x2bdc11[_0x80a7('0x2b')]('.')[0x0];});};exports['awsLex']=function(_0x512769,_0x53cd28,_0x24e0e9,_0x304110,_0x11c582,_0x517ae2){return aws[_0x80a7('0x72')](_0x512769,_0x53cd28,_0x24e0e9,_0x304110,_0x11c582,_0x517ae2)['then'](function(_0x590560){logger[_0x80a7('0x18')](JSON['stringify'](_0x590560));return _0x590560;});};exports['ispeechTTS']=function(_0x5e74f4,_0x218bd3,_0x58d8c4,_0x47c48f){var _0x4af142=util[_0x80a7('0x73')](_0x80a7('0x74'),ISPEECH_API,_0x5e74f4,encodeURIComponent(_0x218bd3),_0x58d8c4,_0x47c48f);var _0x1963d0=path[_0x80a7('0x23')](__dirname,'tmp',rs[_0x80a7('0x24')](0x4)+_0x80a7('0x45'));var _0x2efe91;return downloadFile(_0x4af142,_0x1963d0)[_0x80a7('0x28')](function(){_0x2efe91=path[_0x80a7('0x23')](__dirname,'tmp',rs[_0x80a7('0x24')](0x4)+_0x80a7('0x25'));return convertFile(_0x1963d0,_0x2efe91);})[_0x80a7('0x28')](function(){try{fs[_0x80a7('0x29')](_0x1963d0);fs['chmodSync'](_0x2efe91,_0x80a7('0x2a'));}catch(_0x4e16aa){logger[_0x80a7('0x13')](_0x4e16aa);}return _0x2efe91[_0x80a7('0x2b')]('.')[0x0];});};exports[_0x80a7('0x75')]=function(_0x5a1c3f,_0x1fc129,_0x1ea549,_0x35e8c3){var _0x4924c9=util[_0x80a7('0x73')](_0x80a7('0x76'),ISPEECH_API,_0x1fc129,_0x1ea549,base64Encode(_0x5a1c3f),_0x35e8c3?util[_0x80a7('0x73')](_0x80a7('0x77'),encodeURIComponent(_0x35e8c3)):_0x80a7('0x78'));return uploadFile(_0x4924c9)[_0x80a7('0x28')](function(_0xf627b0){return querystring[_0x80a7('0x79')](_0xf627b0);});};exports[_0x80a7('0x7a')]=function(_0x4df25a,_0x22a5f1){return sestek['nda'](_0x4df25a,_0x22a5f1)[_0x80a7('0x28')](function(_0x406ad1){logger['info'](JSON[_0x80a7('0x3d')](_0x406ad1));var _0x20b11d={'speech':_0x406ad1[_0x80a7('0x7b')],'action':_0x406ad1[_0x80a7('0x7c')]?_0x406ad1['channelData'][_0x80a7('0x7d')]:undefined,'actiondata':_0x406ad1[_0x80a7('0x7c')]?_0x406ad1[_0x80a7('0x7c')][_0x80a7('0x7e')]:undefined};if(_0x406ad1[_0x80a7('0x7c')]&&_0x406ad1[_0x80a7('0x7c')][_0x80a7('0x7f')]){return base64Decode(_0x406ad1[_0x80a7('0x7c')]['AudioFromTts'][_0x80a7('0x80')],path[_0x80a7('0x23')](__dirname,_0x80a7('0x36'),rs[_0x80a7('0x24')](0x4)+_0x80a7('0x25')))['then'](function(_0x5d5226){_0x20b11d['audiofile']=_0x5d5226;return _0x20b11d;});}return _0x20b11d;});};exports[_0x80a7('0x81')]=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 af4d2d1..77a4b41 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 _0x3d73=['./nda','exports'];(function(_0x5367c5,_0x439de4){var _0x22c25e=function(_0x54317c){while(--_0x54317c){_0x5367c5['push'](_0x5367c5['shift']());}};_0x22c25e(++_0x439de4);}(_0x3d73,0xe6));var _0x33d7=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x3d73[_0x88cd7b];return _0x56fcc8;};var nda=require(_0x33d7('0x0'));module[_0x33d7('0x1')]={'nda':nda}; \ No newline at end of file +var _0xd121=['./nda','exports'];(function(_0x403da0,_0x1ef4f9){var _0xb582a3=function(_0x22214c){while(--_0x22214c){_0x403da0['push'](_0x403da0['shift']());}};_0xb582a3(++_0x1ef4f9);}(_0xd121,0x10c));var _0x1d12=function(_0x1fbe80,_0x3a39eb){_0x1fbe80=_0x1fbe80-0x0;var _0xc6269f=_0xd121[_0x1fbe80];return _0xc6269f;};var nda=require(_0x1d12('0x0'));module[_0x1d12('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 52907cd..5175b5b 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 _0xe205=['info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData'];(function(_0x26e563,_0x13ed08){var _0x487a60=function(_0x37a1da){while(--_0x37a1da){_0x26e563['push'](_0x26e563['shift']());}};_0x487a60(++_0x13ed08);}(_0xe205,0xa7));var _0x5e20=function(_0x3a7530,_0x14ed7f){_0x3a7530=_0x3a7530-0x0;var _0x2ac8df=_0xe205[_0x3a7530];return _0x2ac8df;};'use strict';var rp=require(_0x5e20('0x0'));var url=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));module[_0x5e20('0x4')]=function(_0x1620fb,_0x13bace){var _0x30f606={'method':_0x5e20('0x5'),'uri':url['resolve'](_0x13bace[_0x5e20('0x6')],_0x5e20('0x7')),'form':{'grant_type':_0x5e20('0x8'),'username':_0x13bace[_0x5e20('0x9')],'password':_0x13bace['password']},'json':!![]};return rp(_0x30f606)['then'](function(_0x3a382f){var _0x4c9332={'method':'POST','uri':url[_0x5e20('0xa')](_0x13bace[_0x5e20('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x13bace[_0x5e20('0xc')]||_0x5e20('0xd'),'channelId':_0x5e20('0xe'),'conversation':{'id':_0x1620fb[_0x5e20('0xf')]},'from':{'id':_0x1620fb['callerid'],'name':_0x1620fb[_0x5e20('0x10')]},'recipient':{'id':_0x1620fb[_0x5e20('0x11')],'name':_0x1620fb[_0x5e20('0x12')]},'text':_0x13bace[_0x5e20('0x13')],'channelData':{}},'headers':{'Authorization':_0x5e20('0x14')+_0x3a382f[_0x5e20('0x15')]},'json':!![]};if(_0x13bace['project']){_0x4c9332[_0x5e20('0x16')][_0x5e20('0x17')][_0x5e20('0x18')]=_0x13bace['project'];}if(_0x13bace[_0x5e20('0x19')]=='1'){_0x4c9332['body'][_0x5e20('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5e20('0x1a')};}if(_0x13bace[_0x5e20('0x1b')]){_0x4c9332[_0x5e20('0x16')][_0x5e20('0x17')][_0x5e20('0x1c')]=_0x13bace['custom_action'];if(_0x13bace[_0x5e20('0x1d')]){_0x4c9332[_0x5e20('0x16')][_0x5e20('0x17')][_0x5e20('0x1e')]=_0x13bace[_0x5e20('0x1d')];}}logger[_0x5e20('0x1f')](JSON[_0x5e20('0x20')](_0x4c9332));return rp(_0x4c9332);});}; \ No newline at end of file +var _0x1c8a=['stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1c8a,0x140));var _0xa1c8=function(_0x3bbf4e,_0x3cdbf2){_0x3bbf4e=_0x3bbf4e-0x0;var _0xa6898e=_0x1c8a[_0x3bbf4e];return _0xa6898e;};'use strict';var rp=require(_0xa1c8('0x0'));var url=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))(_0xa1c8('0x3'));module[_0xa1c8('0x4')]=function(_0x50af02,_0x250aa9){var _0x530257={'method':_0xa1c8('0x5'),'uri':url[_0xa1c8('0x6')](_0x250aa9[_0xa1c8('0x7')],'/token'),'form':{'grant_type':_0xa1c8('0x8'),'username':_0x250aa9[_0xa1c8('0x9')],'password':_0x250aa9[_0xa1c8('0x8')]},'json':!![]};return rp(_0x530257)['then'](function(_0x32993e){var _0xf93962={'method':_0xa1c8('0x5'),'uri':url['resolve'](_0x250aa9[_0xa1c8('0xa')],_0xa1c8('0xb')),'body':{'type':_0x250aa9[_0xa1c8('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x50af02[_0xa1c8('0xd')]},'from':{'id':_0x50af02['callerid'],'name':_0x50af02[_0xa1c8('0xe')]},'recipient':{'id':_0x50af02['dnid'],'name':_0x50af02['extension']},'text':_0x250aa9['text'],'channelData':{}},'headers':{'Authorization':_0xa1c8('0xf')+_0x32993e[_0xa1c8('0x10')]},'json':!![]};if(_0x250aa9[_0xa1c8('0x11')]){_0xf93962[_0xa1c8('0x12')][_0xa1c8('0x13')][_0xa1c8('0x14')]=_0x250aa9['project'];}if(_0x250aa9[_0xa1c8('0x15')]=='1'){_0xf93962[_0xa1c8('0x12')][_0xa1c8('0x13')][_0xa1c8('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa1c8('0x17')};}if(_0x250aa9[_0xa1c8('0x18')]){_0xf93962['body'][_0xa1c8('0x13')][_0xa1c8('0x19')]=_0x250aa9[_0xa1c8('0x18')];if(_0x250aa9[_0xa1c8('0x1a')]){_0xf93962[_0xa1c8('0x12')]['channelData'][_0xa1c8('0x1b')]=_0x250aa9['custom_action_data'];}}logger['info'](JSON[_0xa1c8('0x1c')](_0xf93962));return rp(_0xf93962);});}; \ 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 babe014..c15c805 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 _0x6923=['exports'];(function(_0xcfd4ae,_0x94892f){var _0x196069=function(_0x47b15f){while(--_0x47b15f){_0xcfd4ae['push'](_0xcfd4ae['shift']());}};_0x196069(++_0x94892f);}(_0x6923,0x165));var _0x3692=function(_0x47899f,_0x3891){_0x47899f=_0x47899f-0x0;var _0x1a57c0=_0x6923[_0x47899f];return _0x1a57c0;};'use strict';var asr=require('./lib/api');module[_0x3692('0x0')]=function(_0x1d9c6e,_0x23307f,_0x6366ba,_0x476711){return asr(_0x1d9c6e,_0x23307f,_0x6366ba,_0x476711);}; \ No newline at end of file +var _0x3d95=['./lib/api','exports'];(function(_0x276e0e,_0x1fc13c){var _0x13803f=function(_0x4921e1){while(--_0x4921e1){_0x276e0e['push'](_0x276e0e['shift']());}};_0x13803f(++_0x1fc13c);}(_0x3d95,0xcc));var _0x53d9=function(_0x57ecd8,_0x26b1a7){_0x57ecd8=_0x57ecd8-0x0;var _0x57a34b=_0x3d95[_0x57ecd8];return _0x57a34b;};'use strict';var asr=require(_0x53d9('0x0'));module[_0x53d9('0x1')]=function(_0x5c5d98,_0x504825,_0x1a8ebe,_0xc78dfc){return asr(_0x5c5d98,_0x504825,_0x1a8ebe,_0xc78dfc);}; \ 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 f2815e8..eeb92d7 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 _0xbedc=['Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','close','EOS','error','terminate','parse','result','final','hypotheses','transcript','likelihood','Success.'];(function(_0x14017d,_0x346fdf){var _0x37d4aa=function(_0x3112a8){while(--_0x3112a8){_0x14017d['push'](_0x14017d['shift']());}};_0x37d4aa(++_0x346fdf);}(_0xbedc,0x190));var _0xcbed=function(_0x1ebd91,_0x599217){_0x1ebd91=_0x1ebd91-0x0;var _0xf16c8=_0xbedc[_0x1ebd91];return _0xf16c8;};'use strict';var BPromise=require(_0xcbed('0x0'));var _=require(_0xcbed('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcbed('0x2'));var crypto=require(_0xcbed('0x3'));var logger=require(_0xcbed('0x4'))(_0xcbed('0x5'));module['exports']=function(_0x3bd722,_0x286edd,_0x2327ff,_0x134ef8){return new BPromise(function(_0x1af5ca,_0x54b514){logger[_0xcbed('0x6')](_0xcbed('0x7'),_0x134ef8||_0xcbed('0x8'));var _0x1aa5cb=new WebSocket(_0x134ef8||_0xcbed('0x8'),{'perMessageDeflate':![]});var _0x727890='';var _0x50b726='0';var _0x317629='1';var _0x504c1c=_0xcbed('0x9');function _0x2a3796(_0x2b87ce){var _0x1da0a1=crypto[_0xcbed('0xa')](_0xcbed('0xb'));_0x1da0a1[_0xcbed('0xc')](_0x2b87ce);return _0x1da0a1['digest'](_0xcbed('0xd'));}function _0x5675e5(){try{logger['info'](_0xcbed('0xe'));var _0x280e2a=moment()[_0xcbed('0xf')]();var _0x14901c=_0x2a3796(_0x280e2a+_0x286edd+_0x2327ff);_0x1aa5cb[_0xcbed('0x10')](JSON[_0xcbed('0x11')]({'appID':_0x286edd,'timestamp':_0x280e2a,'appKey':_0x14901c}));var _0x43260b=fs['createReadStream'](_0x3bd722);_0x43260b['on']('data',function(_0x4809fe){_0x1aa5cb['send'](_0x4809fe);});_0x43260b['on'](_0xcbed('0x12'),function(){_0x1aa5cb[_0xcbed('0x10')](_0xcbed('0x13'));});}catch(_0xf94b4e){logger[_0xcbed('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0xcbed('0x11')](_0xf94b4e));_0x1aa5cb[_0xcbed('0x15')]();}}function _0xff9b85(_0x12d52c){try{if(_0x12d52c){var _0x1a1217=JSON[_0xcbed('0x16')](_0x12d52c);switch(_0x1a1217['status']){case 0x0:if(_0x1a1217['result']){if(_0x1a1217[_0xcbed('0x17')][_0xcbed('0x18')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x1a1217[_0xcbed('0x17')]['hypotheses']));_0x727890=_0x1a1217[_0xcbed('0x17')][_0xcbed('0x19')][0x0][_0xcbed('0x1a')];_0x50b726=_0x1a1217['result'][_0xcbed('0x19')][0x0][_0xcbed('0x1b')];_0x317629='0';_0x504c1c=_0xcbed('0x1c');_0x1aa5cb[_0xcbed('0x15')]();}}break;case 0x1:logger[_0xcbed('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x317629='1';_0x504c1c=_0xcbed('0x9');break;case 0x2:logger[_0xcbed('0x6')](_0xcbed('0x1d'));_0x317629='2';_0x504c1c=_0xcbed('0x1d');break;case 0x9:logger[_0xcbed('0x6')](_0xcbed('0x1e'));_0x317629='9';_0x504c1c='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xcbed('0x6')](_0xcbed('0x1f'));_0x317629='10';_0x504c1c='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x317629='11';_0x504c1c=_0xcbed('0x20');}}}catch(_0x4fab80){logger[_0xcbed('0x14')](_0xcbed('0x21'),JSON[_0xcbed('0x11')](_0x4fab80));_0x1aa5cb[_0xcbed('0x15')]();}}function _0x28a575(){logger[_0xcbed('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x1af5ca({'transcript':_0x727890,'confidence':_0x50b726,'status':_0x317629,'status_message':_0x504c1c});}function _0x17fb65(_0x1c7b5b){logger[_0xcbed('0x14')](_0xcbed('0x22'));if(!_[_0xcbed('0x23')](_0x1c7b5b)){logger[_0xcbed('0x14')](_[_0xcbed('0x24')](_0x1c7b5b)?JSON[_0xcbed('0x11')](_0x1c7b5b):_0x1c7b5b);}}_0x1aa5cb['on'](_0xcbed('0x25'),_0x5675e5);_0x1aa5cb['on'](_0xcbed('0x26'),_0xff9b85);_0x1aa5cb['on']('close',_0x28a575);_0x1aa5cb['on'](_0xcbed('0x14'),_0x17fb65);});}; \ No newline at end of file +var _0x3977=['final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3977,0x1b1));var _0x7397=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3977[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var _=require(_0x7397('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7397('0x1'));var crypto=require(_0x7397('0x2'));var logger=require(_0x7397('0x3'))(_0x7397('0x4'));module[_0x7397('0x5')]=function(_0xe4374a,_0x36d1d6,_0x3ea4d6,_0x5f0db5){return new BPromise(function(_0x1b0391,_0x667ca9){logger[_0x7397('0x6')]('Tilde\x20URI',_0x5f0db5||_0x7397('0x7'));var _0x2989cf=new WebSocket(_0x5f0db5||_0x7397('0x7'),{'perMessageDeflate':![]});var _0x53c262='';var _0x294bf1='0';var _0x2ccfad='1';var _0x31ccef=_0x7397('0x8');function _0x38d071(_0x553dac){var _0x492286=crypto[_0x7397('0x9')](_0x7397('0xa'));_0x492286['update'](_0x553dac);return _0x492286['digest']('hex');}function _0x29b4af(){try{logger[_0x7397('0x6')](_0x7397('0xb'));var _0x182213=moment()[_0x7397('0xc')]();var _0xa341c0=_0x38d071(_0x182213+_0x36d1d6+_0x3ea4d6);_0x2989cf[_0x7397('0xd')](JSON[_0x7397('0xe')]({'appID':_0x36d1d6,'timestamp':_0x182213,'appKey':_0xa341c0}));var _0xc3b5ce=fs['createReadStream'](_0xe4374a);_0xc3b5ce['on']('data',function(_0x1fc398){_0x2989cf[_0x7397('0xd')](_0x1fc398);});_0xc3b5ce['on'](_0x7397('0xf'),function(){_0x2989cf[_0x7397('0xd')](_0x7397('0x10'));});}catch(_0x50ac37){logger[_0x7397('0x11')](_0x7397('0x12'),JSON[_0x7397('0xe')](_0x50ac37));_0x2989cf[_0x7397('0x13')]();}}function _0x4c7849(_0x327e45){try{if(_0x327e45){var _0x14549e=JSON[_0x7397('0x14')](_0x327e45);switch(_0x14549e[_0x7397('0x15')]){case 0x0:if(_0x14549e[_0x7397('0x16')]){if(_0x14549e[_0x7397('0x16')][_0x7397('0x17')]){logger['info'](_0x7397('0x18'),JSON[_0x7397('0xe')](_0x14549e[_0x7397('0x16')]['hypotheses']));_0x53c262=_0x14549e[_0x7397('0x16')][_0x7397('0x19')][0x0][_0x7397('0x1a')];_0x294bf1=_0x14549e['result'][_0x7397('0x19')][0x0][_0x7397('0x1b')];_0x2ccfad='0';_0x31ccef=_0x7397('0x1c');_0x2989cf['terminate']();}}break;case 0x1:logger[_0x7397('0x6')](_0x7397('0x8'));_0x2ccfad='1';_0x31ccef=_0x7397('0x8');break;case 0x2:logger[_0x7397('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2ccfad='2';_0x31ccef=_0x7397('0x1d');break;case 0x9:logger['info'](_0x7397('0x1e'));_0x2ccfad='9';_0x31ccef=_0x7397('0x1e');break;case 0xa:logger[_0x7397('0x6')](_0x7397('0x1f'));_0x2ccfad='10';_0x31ccef=_0x7397('0x1f');break;case 0xb:logger['info'](_0x7397('0x20'));_0x2ccfad='11';_0x31ccef=_0x7397('0x20');}}}catch(_0x455f55){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x455f55));_0x2989cf[_0x7397('0x13')]();}}function _0x1a03ea(){logger[_0x7397('0x6')](_0x7397('0x21'));_0x1b0391({'transcript':_0x53c262,'confidence':_0x294bf1,'status':_0x2ccfad,'status_message':_0x31ccef});}function _0x41c000(_0xdd2c6){logger[_0x7397('0x11')](_0x7397('0x22'));if(!_[_0x7397('0x23')](_0xdd2c6)){logger[_0x7397('0x11')](_[_0x7397('0x24')](_0xdd2c6)?JSON['stringify'](_0xdd2c6):_0xdd2c6);}}_0x2989cf['on'](_0x7397('0x25'),_0x29b4af);_0x2989cf['on']('message',_0x4c7849);_0x2989cf['on'](_0x7397('0xf'),_0x1a03ea);_0x2989cf['on'](_0x7397('0x11'),_0x41c000);});}; \ 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 82d0b08..6e81c86 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 _0x447f=['exports','./asr'];(function(_0x32f5be,_0x3e56ab){var _0x223208=function(_0x17704e){while(--_0x17704e){_0x32f5be['push'](_0x32f5be['shift']());}};_0x223208(++_0x3e56ab);}(_0x447f,0x1f3));var _0xf447=function(_0x1e8858,_0x4fe3fb){_0x1e8858=_0x1e8858-0x0;var _0x2392bf=_0x447f[_0x1e8858];return _0x2392bf;};var asr=require(_0xf447('0x0'));module[_0xf447('0x1')]={'asr':asr}; \ No newline at end of file +var _0x1b22=['./asr'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x1b22,0x109));var _0x21b2=function(_0x12bb8b,_0x204d03){_0x12bb8b=_0x12bb8b-0x0;var _0x58c9f3=_0x1b22[_0x12bb8b];return _0x58c9f3;};var asr=require(_0x21b2('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 238fc98..7cbad58 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 _0x2170=['listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x4887ef,_0xf947c1){var _0x44dd61=function(_0x22e6e9){while(--_0x22e6e9){_0x4887ef['push'](_0x4887ef['shift']());}};_0x44dd61(++_0xf947c1);}(_0x2170,0xb7));var _0x0217=function(_0x4903f3,_0x11cc64){_0x4903f3=_0x4903f3-0x0;var _0x58deb4=_0x2170[_0x4903f3];return _0x58deb4;};'use strict';var util=require('util');var net=require(_0x0217('0x0'));var EventEmitter=require(_0x0217('0x1'))['EventEmitter'];var AGIError=require(_0x0217('0x2'));var AGIChannel=require(_0x0217('0x3'));var AGIServer=function(_0x4ce02f,_0x5e9645,_0x57b434){var _0x270b2d=this,_0x4ce02f=_0x4ce02f||0x11dd,_0x5e9645=_0x5e9645||_0x0217('0x4'),_0x4468c1=null,_0x3407f0=0x0;EventEmitter[_0x0217('0x5')](_0x270b2d);function _0x94da1a(){if(!_0x4ce02f){_0x270b2d[_0x0217('0x6')](_0x0217('0x7'),new AGIError(_0x0217('0x8')));return![];}_0x4468c1=net['createServer']();_0x4468c1[_0x0217('0x9')](_0x4ce02f,_0x5e9645);_0x4468c1['on'](_0x0217('0xa'),function(){_0x270b2d[_0x0217('0x6')](_0x0217('0xa'));});_0x4468c1['on'](_0x0217('0xb'),function(_0x5e49cf){_0x4468c1[_0x0217('0xc')](function(_0x462f5d,_0x512a9c){if(_0x462f5d){_0x270b2d[_0x0217('0x6')]('error',new AGIError(_0x0217('0xd'),_0x462f5d));}else if(_0x57b434&&_0x57b434<0x0){_0x270b2d[_0x0217('0x6')](_0x0217('0x7'),new AGIError(_0x0217('0xe')));_0x5e49cf[_0x0217('0xf')]();}else if(_0x57b434&&_0x57b434>0x0&&_0x57b434<_0x512a9c){_0x3407f0+=0x1;_0x270b2d[_0x0217('0x6')](_0x0217('0x7'),new AGIError(_0x0217('0x10'),_0x3407f0));_0x5e49cf[_0x0217('0xf')]();}else{var _0x6a6592=new AGIChannel(_0x5e49cf);_0x6a6592['on'](_0x0217('0x11'),function(){_0x270b2d[_0x0217('0x6')]('connection',_0x6a6592);});}});});_0x4468c1['on'](_0x0217('0x7'),function(_0x25eeed){_0x270b2d['emit'](_0x0217('0x7'),new AGIError(_0x0217('0xd'),_0x25eeed[_0x0217('0x12')]));});_0x4468c1['on'](_0x0217('0x13'),function(){_0x270b2d[_0x0217('0x6')](_0x0217('0x13'),new AGIError(_0x0217('0x14')));});}process[_0x0217('0x15')](function(){_0x94da1a();});};util[_0x0217('0x16')](AGIServer,EventEmitter);module[_0x0217('0x17')]=function(_0x151777,_0x803d41,_0x3f17fd){return new AGIServer(_0x151777,_0x803d41,_0x3f17fd);}; \ No newline at end of file +var _0x60c8=['error','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','E_AGI_SERVER_CLOSE','inherits','util','net','events','./error','./channel','127.0.0.1','call'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x60c8,0x19b));var _0x860c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60c8[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x860c('0x0'));var net=require(_0x860c('0x1'));var EventEmitter=require(_0x860c('0x2'))['EventEmitter'];var AGIError=require(_0x860c('0x3'));var AGIChannel=require(_0x860c('0x4'));var AGIServer=function(_0x12fd7f,_0xd0ea66,_0x59e746){var _0x1be31e=this,_0x12fd7f=_0x12fd7f||0x11dd,_0xd0ea66=_0xd0ea66||_0x860c('0x5'),_0x1cae0b=null,_0x565e73=0x0;EventEmitter[_0x860c('0x6')](_0x1be31e);function _0x615109(){if(!_0x12fd7f){_0x1be31e['emit'](_0x860c('0x7'),new AGIError(_0x860c('0x8')));return![];}_0x1cae0b=net[_0x860c('0x9')]();_0x1cae0b['listen'](_0x12fd7f,_0xd0ea66);_0x1cae0b['on'](_0x860c('0xa'),function(){_0x1be31e['emit'](_0x860c('0xa'));});_0x1cae0b['on']('connection',function(_0x3eb790){_0x1cae0b[_0x860c('0xb')](function(_0x450e52,_0x2d41e0){if(_0x450e52){_0x1be31e[_0x860c('0xc')](_0x860c('0x7'),new AGIError(_0x860c('0xd'),_0x450e52));}else if(_0x59e746&&_0x59e746<0x0){_0x1be31e[_0x860c('0xc')](_0x860c('0x7'),new AGIError(_0x860c('0xe')));_0x3eb790[_0x860c('0xf')]();}else if(_0x59e746&&_0x59e746>0x0&&_0x59e746<_0x2d41e0){_0x565e73+=0x1;_0x1be31e[_0x860c('0xc')](_0x860c('0x7'),new AGIError(_0x860c('0x10'),_0x565e73));_0x3eb790[_0x860c('0xf')]();}else{var _0x14b4e8=new AGIChannel(_0x3eb790);_0x14b4e8['on'](_0x860c('0x11'),function(){_0x1be31e[_0x860c('0xc')](_0x860c('0x12'),_0x14b4e8);});}});});_0x1cae0b['on'](_0x860c('0x7'),function(_0x127969){_0x1be31e['emit'](_0x860c('0x7'),new AGIError(_0x860c('0xd'),_0x127969[_0x860c('0x13')]));});_0x1cae0b['on']('close',function(){_0x1be31e['emit']('close',new AGIError(_0x860c('0x14')));});}process['nextTick'](function(){_0x615109();});};util[_0x860c('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x442317,_0x9d6dcc,_0x14eac7){return new AGIServer(_0x442317,_0x9d6dcc,_0x14eac7);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 09fe3d0..4bdfb47 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 _0xfa7e=['grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','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','no\x20list\x20selected','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','odbc_id','replace','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','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','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','failure','playback','PLAYBACK','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','service','host','port','secure','auth','user','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','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','arg_1','system','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','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','VOICEMAIL','mailbox','vswitch','join','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','rpc','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getSound','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','format','getQueryOdbc','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xfa7e,0x11a));var _0xefa7=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xfa7e[_0x47b58b];return _0x46bebe;};'use strict';var fs=require('fs');var path=require(_0xefa7('0x0'));var util=require(_0xefa7('0x1'));var _=require(_0xefa7('0x2'));var sh=require(_0xefa7('0x3'));var odbc=require(_0xefa7('0x4'))();var rs=require(_0xefa7('0x5'));var moment=require(_0xefa7('0x6'));var Mustache=require(_0xefa7('0x7'));var rp=require(_0xefa7('0x8'));var logger=require('../../config/logger')('agi');var config=require(_0xefa7('0x9'));var scripts=require(_0xefa7('0xa'));var FILES_PATH=_0xefa7('0xb');var recursiveMapAttributes=[_0xefa7('0xc'),'rawBody'];var verticesWithRetry=['menu',_0xefa7('0xd'),'getsecretdigits'];var AGIVertices=function(_0xca8dee,_0xc198df,_0x3bc8ea){this[_0xefa7('0xe')]=_0xca8dee;this['rpc']=_0xc198df;this[_0xefa7('0xf')]=_0x3bc8ea;};AGIVertices[_0xefa7('0x10')][_0xefa7('0x11')]=function(_0x27644b,_0x53f442){this['rpc'][_0xefa7('0x12')](_0x27644b)[_0xefa7('0x13')](function(_0xe2798){_0x53f442(null,_0xe2798?_0xe2798[_0xefa7('0x14')]:![]);})['catch'](function(_0x430404){_0x53f442(_0x430404);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x15')]=function(_0x313845,_0x5d58b0){this[_0xefa7('0x16')][_0xefa7('0x17')](_0x313845)['then'](function(_0x5b6a2a){_0x5d58b0(null,_0x5b6a2a?_0x5b6a2a['name']:![]);})[_0xefa7('0x18')](function(_0x5ee2fd){_0x5d58b0(_0x5ee2fd);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x19')]=function(_0x57108,_0x5a213d){this[_0xefa7('0x16')][_0xefa7('0x1a')](_0x57108)[_0xefa7('0x13')](function(_0x461def){_0x5a213d(null,_0x461def?_0x461def[_0xefa7('0x14')]:![]);})[_0xefa7('0x18')](function(_0x579129){_0x5a213d(_0x579129);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1b')]=function(_0x4f1f33,_0x1ed987){this[_0xefa7('0x16')]['getSquareOdbcById'](_0x4f1f33)[_0xefa7('0x13')](function(_0x2f7a26){_0x1ed987(null,_0x2f7a26?_0x2f7a26[_0xefa7('0x1c')]:![]);})[_0xefa7('0x18')](function(_0x1c708f){_0x1ed987(_0x1c708f);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1d')]=function(_0x49ba0d,_0x5ca085){this[_0xefa7('0x16')][_0xefa7('0x1e')](_0x49ba0d)[_0xefa7('0x13')](function(_0x560cf0){_0x5ca085(null,_0x560cf0?_0x560cf0[_0xefa7('0x14')]:![]);})[_0xefa7('0x18')](function(_0x353be6){_0x5ca085(_0x353be6);});};AGIVertices['prototype']['getTrunk']=function(_0xf47da1,_0x208121){this[_0xefa7('0x16')]['getTrunkById'](_0xf47da1)['then'](function(_0x381f7e){_0x208121(null,_0x381f7e?_0x381f7e['name']:![]);})[_0xefa7('0x18')](function(_0x4a1820){_0x208121(_0x4a1820);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1f')]=function(_0x527bb7,_0xa05b56){var _0x4aaee3=this;this[_0xefa7('0x16')][_0xefa7('0x20')](_0x527bb7)[_0xefa7('0x13')](function(_0x57a32b){_0xa05b56(null,_0x57a32b?_0x4aaee3['getSoundPath'](_0x57a32b['save_name']):![]);})['catch'](function(_0x3be0f3){_0xa05b56(_0x3be0f3);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x21')]=function(_0x35696f,_0x40d8b4){this['rpc'][_0xefa7('0x22')](_0x35696f)['then'](function(_0x31c262){_0x40d8b4(null,_0x31c262?_0x31c262:![]);})['catch'](function(_0x5c7d79){_0x40d8b4(_0x5c7d79);});};AGIVertices[_0xefa7('0x10')]['sendMailMessage']=function(_0x28497e,_0xa778cb,_0x54f4e1){this[_0xefa7('0xf')][_0xefa7('0x23')](_0x28497e,_0xa778cb)['then'](function(){_0x54f4e1(null);})[_0xefa7('0x18')](function(_0x2f21de){_0x54f4e1(_0x2f21de);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x24')]=function(_0x24a5b1,_0x34d7d6){this[_0xefa7('0x16')][_0xefa7('0x25')](_0x24a5b1)[_0xefa7('0x13')](function(_0x55d10e){if(_0x55d10e){if(_0x55d10e[_0xefa7('0x26')]){_0x34d7d6(null,[_0x55d10e['interval']]);}else{_0x34d7d6(null,_['map'](_0x55d10e[_0xefa7('0x27')],_0xefa7('0x28')));}}else{_0x34d7d6(null,![]);}})[_0xefa7('0x18')](function(_0x5ceef2){_0x34d7d6(_0x5ceef2);});};AGIVertices['prototype']['getSoundPath']=function(_0xbc4418){return util[_0xefa7('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0xbc4418);};AGIVertices['prototype'][_0xefa7('0x2a')]=function(_0x34e730,_0x515305,_0x1f964f){odbc['open'](_0x34e730,function(_0x2cfe3b){if(_0x2cfe3b){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2cfe3b);_0x1f964f(_0x2cfe3b);}else{logger[_0xefa7('0x2b')](_0xefa7('0x2c'));odbc[_0xefa7('0x2d')](_0x515305,function(_0x416d76,_0x23bba9){if(_0x416d76){logger[_0xefa7('0x2b')]('Error\x20executing\x20query\x20%s',_0x515305);_0x1f964f(_0x416d76);}else{logger[_0xefa7('0x2b')](_0xefa7('0x2e'),_0x515305);odbc[_0xefa7('0x2f')](function(_0x3214bd){if(_0x3214bd){logger[_0xefa7('0x30')](_0xefa7('0x31'),_0x3214bd);}_0x1f964f(null,_0x23bba9);});}});}});};AGIVertices[_0xefa7('0x10')]['getSmsAccount']=function(_0x5b59f4,_0x51beab){this['rpc']['getSmsAccountById'](_0x5b59f4)[_0xefa7('0x13')](function(_0x268d3d){_0x51beab(null,_0x268d3d?_0x268d3d:![]);})[_0xefa7('0x18')](function(_0x1b39fb){_0x51beab(_0x1b39fb);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x32')]=function(_0xfe7f15,_0x2133a5){this[_0xefa7('0x16')][_0xefa7('0x32')](_0xfe7f15)[_0xefa7('0x13')](function(_0x5d4290){_0x2133a5(null,_0x5d4290);})[_0xefa7('0x18')](function(_0x3f1f3){_0x2133a5(_0x3f1f3);});};AGIVertices[_0xefa7('0x10')]['createSquareDetailsReport']=function(_0x2db0d6,_0xa7eab9,_0x47411f){this[_0xefa7('0x16')][_0xefa7('0x33')]({'uniqueid':this[_0xefa7('0xe')]['uniqueid'],'node':_0x2db0d6[_0xefa7('0x34')],'application':_0x2db0d6[_0xefa7('0x35')],'data':_0xa7eab9||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xefa7('0xe')][_0xefa7('0x36')]})[_0xefa7('0x13')](function(_0x1d8558){if(_0x47411f){_0x47411f(null,_0x1d8558);}})[_0xefa7('0x18')](function(_0x13b2ed){if(_0x47411f){_0x47411f(_0x13b2ed);}});};AGIVertices[_0xefa7('0x10')]['createSquareRecording']=function(_0x52dfca,_0x5a21f1,_0x586491,_0x48c194){this[_0xefa7('0x16')][_0xefa7('0x37')]({'uniqueid':this[_0xefa7('0xe')][_0xefa7('0x38')],'callerid':this[_0xefa7('0xe')][_0xefa7('0x36')],'calleridname':this[_0xefa7('0xe')][_0xefa7('0x39')],'context':this['channel']['context'],'extension':this['channel'][_0xefa7('0x3a')],'priority':this[_0xefa7('0xe')][_0xefa7('0x3b')],'accountcode':this[_0xefa7('0xe')][_0xefa7('0x3c')],'dnid':this['channel'][_0xefa7('0x3d')],'projectName':this[_0xefa7('0xe')]['arg_1'],'saveName':_0x5a21f1,'filename':_0x52dfca[_0xefa7('0x3e')]||_0x5a21f1,'savePath':_0x586491})[_0xefa7('0x13')](function(_0x1bf300){_0x48c194(null,_0x1bf300);})[_0xefa7('0x18')](function(_0x514e73){_0x48c194(_0x514e73);});};AGIVertices['prototype']['createSquareMessage']=function(_0x292be8,_0x34ef7e,_0x396a02,_0x2e871b,_0x363572){this[_0xefa7('0x16')][_0xefa7('0x3f')]({'uniqueid':this[_0xefa7('0xe')]['uniqueid'],'body':_0x292be8,'direction':_0x34ef7e,'providerName':_0x396a02,'providerResponse':_0x2e871b})[_0xefa7('0x13')](function(_0x490055){if(_0x363572){_0x363572(null,_0x490055);}})[_0xefa7('0x18')](function(_0x152e97){if(_0x363572){_0x363572(_0x152e97);}});};AGIVertices['prototype'][_0xefa7('0x40')]=function(_0x544606,_0x41a2ee){this['rpc'][_0xefa7('0x40')]({'firstName':_[_0xefa7('0x41')](_0x544606['name'])||_[_0xefa7('0x42')](_0x544606[_0xefa7('0x14')])?_0xefa7('0x43')+Math[_0xefa7('0x44')]():_0x544606[_0xefa7('0x14')],'lastName':_['isEmpty'](_0x544606['lastName'])||_[_0xefa7('0x42')](_0x544606[_0xefa7('0x45')])?null:_0x544606[_0xefa7('0x45')],'phone':_0x544606['phone'],'ListId':_0x544606[_0xefa7('0x46')],'scheduledat':_0x544606[_0xefa7('0x47')],'callbackUniqueid':this[_0xefa7('0xe')][_0xefa7('0x38')],'tags':_0xefa7('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x544606[_0xefa7('0x47')][_0xefa7('0x49')](),'priority':_0x544606[_0xefa7('0x4a')]})['then'](function(_0x37f78a){_0x41a2ee(null,_0x37f78a);})[_0xefa7('0x18')](function(_0x44c52d){_0x41a2ee(_0x44c52d);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x4b')]=function(_0x37ff2e,_0x55740a){this['rpc']['getPauseById'](_0x37ff2e)['then'](function(_0x45098f){_0x55740a(null,_0x45098f?_0x45098f[_0xefa7('0x14')]:![]);})[_0xefa7('0x18')](function(_0x1a79cd){_0x55740a(_0x1a79cd);});};AGIVertices['prototype'][_0xefa7('0x4c')]=function(_0xaa088e,_0x5c84fc,_0x508591){var _0x10e5ef={'role':'agent'};_0x10e5ef[_0xaa088e]=this[_0xefa7('0xe')][_0xefa7('0x36')];this['rpc'][_0xefa7('0x4c')](_0x10e5ef,_0x5c84fc,this['channel'][_0xefa7('0x38')])[_0xefa7('0x13')](function(_0x381c5b){_0x508591(null,_[_0xefa7('0x42')](_0x381c5b)?![]:!![]);})[_0xefa7('0x18')](function(_0x1d2d37){logger[_0xefa7('0x30')](_0x1d2d37);_0x508591(null,![]);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x4d')]=function(_0x45fc20,_0x511c2a){var _0x57e50b={'role':_0xefa7('0x4e')};_0x57e50b[_0x45fc20]=this[_0xefa7('0xe')][_0xefa7('0x36')];this[_0xefa7('0x16')]['agentUnpause'](_0x57e50b)[_0xefa7('0x13')](function(_0x2d0157){_0x511c2a(null,_['isNil'](_0x2d0157)?![]:!![]);})[_0xefa7('0x18')](function(_0x21f628){logger['error'](_0x21f628);_0x511c2a(null,![]);});};AGIVertices['prototype'][_0xefa7('0x4f')]=function(_0x52c8a4,_0x2c71cf){var _0x3335a9={'role':_0xefa7('0x4e')};_0x3335a9[_0x52c8a4]=this['channel'][_0xefa7('0x36')];this[_0xefa7('0x16')][_0xefa7('0x4f')](_0x3335a9)[_0xefa7('0x13')](function(_0x43d118){_0x2c71cf(null,_[_0xefa7('0x42')](_0x43d118)?![]:!![]);})['catch'](function(_0xb1fce3){logger[_0xefa7('0x30')](_0xb1fce3);_0x2c71cf(null,![]);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x50')]=function(_0x34009d,_0x562075){var _0x4f8ef2={'role':'agent'};_0x4f8ef2[_0x34009d]=this[_0xefa7('0xe')][_0xefa7('0x36')];var _0x12ccd8=_0x34009d!=_0xefa7('0x51')?util[_0xefa7('0x29')]('%s/%s@from-sip/n','LOCAL',this['channel'][_0xefa7('0x36')]):undefined;this[_0xefa7('0x16')][_0xefa7('0x50')](_0x4f8ef2,_0x12ccd8)[_0xefa7('0x13')](function(_0x4df532){_0x562075(null,_['isNil'](_0x4df532)?![]:!![]);})[_0xefa7('0x18')](function(_0x23ea8c){logger[_0xefa7('0x30')](_0x23ea8c);_0x562075(null,![]);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x52')]=function(_0x26d8b3,_0x1b164b){sh[_0xefa7('0x53')](_[_0xefa7('0x54')](_0x26d8b3),function(_0x26c0b1,_0x2a4606){var _0x2eae2c=_0x2a4606['replace'](/(\r\n|\n|\r)/gm,'');_0x1b164b(null,_0x2eae2c);});};AGIVertices[_0xefa7('0x10')]['googleCloudTTS']=function(_0x430c54,_0x1f8d34){scripts[_0xefa7('0x55')](_0x430c54[_0xefa7('0x56')],_0x430c54[_0xefa7('0x57')]||_0xefa7('0x58'),_0x430c54[_0xefa7('0x58')],_0x430c54[_0xefa7('0x59')]||_0xefa7('0x5a'),_0x430c54['ssmlGender']||_0xefa7('0x5b'),_0x430c54[_0xefa7('0x5c')]||'MP3')[_0xefa7('0x13')](function(_0x5a4209){_0x1f8d34(null,_0x5a4209);})['catch'](function(_0x26ea36){_0x1f8d34(_0x26ea36);});};AGIVertices[_0xefa7('0x10')]['googleTTS']=function(_0x15b5d5,_0x201566){scripts[_0xefa7('0x5d')](_0x15b5d5['text'],_0x15b5d5[_0xefa7('0x5e')]||'en',0x1)[_0xefa7('0x13')](function(_0x55de4c){_0x201566(null,_0x55de4c);})[_0xefa7('0x18')](function(_0xf1c0b3){_0x201566(_0xf1c0b3);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x5f')]=function(_0x1153f7,_0x3d0a8c){var _0x4a189e={'uri':_0x1153f7[_0xefa7('0x60')],'method':_0x1153f7['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1153f7[_0xefa7('0x61')])===_0xefa7('0x62')&&parseInt(_0x1153f7[_0xefa7('0x61')])>=0x1?parseInt(_0x1153f7[_0xefa7('0x61')])*0x3e8:0x5*0x3e8};if(_[_0xefa7('0x63')]([_0xefa7('0x64'),_0xefa7('0x65')],_0x4a189e[_0xefa7('0x66')][_0xefa7('0x67')]())){try{_0x4a189e[_0xefa7('0x68')]=_0x1153f7[_0xefa7('0x69')]?JSON[_0xefa7('0x6a')](_0x1153f7[_0xefa7('0x69')]):{};}catch(_0x52557a){logger[_0xefa7('0x30')](_0xefa7('0x6b'),_0x52557a);}}try{_0x4a189e[_0xefa7('0x6c')]=_0x1153f7[_0xefa7('0xc')]?JSON[_0xefa7('0x6a')](_0x1153f7[_0xefa7('0xc')]):{};}catch(_0x4a3344){logger[_0xefa7('0x30')](_0xefa7('0x6d'),_0x4a3344);}if(_0x1153f7[_0xefa7('0x6e')]){try{var _0x40956c=require(_0x1153f7[_0xefa7('0x6e')])[_0xefa7('0x6f')](this,_0x4a189e);_0x4a189e[_0xefa7('0x70')]=Mustache[_0xefa7('0x71')](_0x1153f7[_0xefa7('0x60')],_0x40956c,{},['$$','$$']);if(_0x4a189e[_0xefa7('0x6c')]){_0x4a189e[_0xefa7('0x6c')]=JSON[_0xefa7('0x6a')](Mustache[_0xefa7('0x71')](JSON['stringify'](_0x4a189e[_0xefa7('0x6c')]),_0x40956c,{},['$$','$$']));}if(_0x4a189e[_0xefa7('0x68')]){_0x4a189e[_0xefa7('0x68')]=JSON[_0xefa7('0x6a')](Mustache['render'](JSON[_0xefa7('0x72')](_0x4a189e[_0xefa7('0x68')]),_0x40956c,{},['$$','$$']));}}catch(_0x20560a){logger[_0xefa7('0x30')](_0xefa7('0x73'),_0x20560a);}}rp(_0x4a189e)[_0xefa7('0x13')](function(_0x31a0ab){var _0x25909={'statusCode':_0x31a0ab[_0xefa7('0x74')]||0xc8,'statusMessage':_0x31a0ab[_0xefa7('0x75')]||'OK','headers':_0x31a0ab[_0xefa7('0x6c')]||{},'body':_0x31a0ab[_0xefa7('0x68')]||{}};_0x3d0a8c(null,_0x25909);})['catch'](function(_0x44cfeb){var _0x5ba996={'statusCode':_0x44cfeb[_0xefa7('0x74')]||0x1f4,'statusMessage':_0x44cfeb[_0xefa7('0x76')]||_0xefa7('0x77'),'headers':_0x44cfeb[_0xefa7('0x78')][_0xefa7('0x6c')]||{},'body':_0x44cfeb['options'][_0xefa7('0x68')]||{}};_0x3d0a8c(null,_0x5ba996);});};AGIVertices['prototype'][_0xefa7('0x79')]=function(_0x5b2175,_0x5a6085){scripts[_0xefa7('0x79')](this[_0xefa7('0xe')]['uniqueid'],_0x5b2175['key'],_0x5b2175['text'],_0x5b2175[_0xefa7('0x7a')]||'en')['then'](function(_0x372365){_0x5a6085(null,_0x372365);})[_0xefa7('0x18')](function(_0x4d1811){_0x5a6085(_0x4d1811);});};AGIVertices[_0xefa7('0x10')]['googleDialogflowV2']=function(_0x88fbde,_0x45ee96){scripts[_0xefa7('0x7b')](this[_0xefa7('0xe')][_0xefa7('0x38')],_0x88fbde['dialogflowV2_project_id'],_0x88fbde[_0xefa7('0x7c')],_0x88fbde[_0xefa7('0x7d')],_0x88fbde[_0xefa7('0x58')],_0x88fbde[_0xefa7('0x7e')]||'en')['then'](function(_0x2eba7c){_0x45ee96(null,_0x2eba7c);})[_0xefa7('0x18')](function(_0x5e940f){_0x45ee96(_0x5e940f);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x7f')]=function(_0x2d6514,_0x40d331){scripts[_0xefa7('0x7f')](this[_0xefa7('0xe')],_0x2d6514)[_0xefa7('0x13')](function(_0x2ca64e){_0x40d331(null,_0x2ca64e);})['catch'](function(_0x254f53){_0x40d331(_0x254f53);});};AGIVertices[_0xefa7('0x10')]['ispeechTTS']=function(_0x13ffad,_0x58c16f){scripts[_0xefa7('0x80')](_0x13ffad['key'],_0x13ffad[_0xefa7('0x58')],_0x13ffad['ispeech_tts_language']||_0xefa7('0x5a'),_0x13ffad[_0xefa7('0x81')])[_0xefa7('0x13')](function(_0x1b4797){_0x58c16f(null,_0x1b4797);})[_0xefa7('0x18')](function(_0x434e20){_0x58c16f(_0x434e20);});};AGIVertices[_0xefa7('0x10')]['ispeechASR']=function(_0x4e90f2,_0x13a3ff,_0x301d89){scripts[_0xefa7('0x82')](_0x13a3ff,_0x4e90f2[_0xefa7('0x83')],_0x4e90f2[_0xefa7('0x84')]||_0xefa7('0x5a'),this[_0xefa7('0x85')](_0x4e90f2[_0xefa7('0x86')])?_0x4e90f2[_0xefa7('0x86')]:undefined)['then'](function(_0x28c141){_0x301d89(null,_0x28c141);})[_0xefa7('0x18')](function(_0x2e10b8){_0x301d89(_0x2e10b8);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x87')]=function(_0x2625a9,_0x1ecd6b){scripts['awsPolly'](_0x2625a9[_0xefa7('0x88')],_0x2625a9['aws_secret_access_key'],_0x2625a9[_0xefa7('0x89')],_0x2625a9[_0xefa7('0x8a')]||_0xefa7('0x8b'),_0x2625a9[_0xefa7('0x58')],_0x2625a9['aws_text_type']||_0xefa7('0x58'))[_0xefa7('0x13')](function(_0x58383f){_0x1ecd6b(null,_0x58383f);})[_0xefa7('0x18')](function(_0x361b16){_0x1ecd6b(_0x361b16);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x8c')]=function(_0x5030be,_0x5b1364){scripts[_0xefa7('0x8c')](this[_0xefa7('0xe')][_0xefa7('0x38')],_0x5030be[_0xefa7('0x88')],_0x5030be['aws_secret_access_key'],_0x5030be[_0xefa7('0x8d')],_0x5030be[_0xefa7('0x58')],_0x5030be[_0xefa7('0x8e')])[_0xefa7('0x13')](function(_0x1ccd21){_0x5b1364(null,_0x1ccd21);})[_0xefa7('0x18')](function(_0x32d025){_0x5b1364(_0x32d025);});};AGIVertices[_0xefa7('0x10')][_0xefa7('0x8f')]=function(_0x392fb6,_0x19dba0,_0x5e5ce5){scripts['googleASR'](_0x19dba0,_0x392fb6[_0xefa7('0x83')],_0x392fb6[_0xefa7('0x90')]||_0xefa7('0x5a'))[_0xefa7('0x13')](function(_0x4c0bbd){_0x5e5ce5(null,_0x4c0bbd);})[_0xefa7('0x18')](function(_0x3c3a8a){_0x5e5ce5(_0x3c3a8a);});};AGIVertices['prototype'][_0xefa7('0x91')]=function(_0x51c04a,_0x30bde5,_0x122385){scripts[_0xefa7('0x91')](_0x30bde5,_0x51c04a['appid'],_0x51c04a[_0xefa7('0x92')],_0x51c04a['uri'])[_0xefa7('0x13')](function(_0x514dd7){_0x122385(null,_0x514dd7);})[_0xefa7('0x18')](function(_0x28fb62){_0x122385(_0x28fb62);});};AGIVertices['prototype'][_0xefa7('0x93')]=function(_0xbe2ab){var _0x28f35e=_[_0xefa7('0x63')](verticesWithRetry,_0xbe2ab[_0xefa7('0x35')])?_0xbe2ab:_[_0xefa7('0x94')](_0xbe2ab);for(var _0x29a3e7 in _0x28f35e){if(_0x28f35e[_0xefa7('0x95')](_0x29a3e7)){if(_0x28f35e[_0x29a3e7]&&_[_0xefa7('0x96')](_0x28f35e[_0x29a3e7])){if(_[_0xefa7('0x63')](recursiveMapAttributes,_0x29a3e7)){_0x28f35e[_0x29a3e7]=this[_0xefa7('0x97')](_0x28f35e[_0x29a3e7]);}else{_0x28f35e[_0x29a3e7]=this[_0xefa7('0x98')](_0x28f35e[_0x29a3e7]);}}}}return _0x28f35e;};AGIVertices['prototype'][_0xefa7('0x99')]=function(_0x11de90){for(var _0x457dad in _0x11de90){if(_0x11de90['hasOwnProperty'](_0x457dad)){if(_['isPlainObject'](_0x11de90[_0x457dad])){this[_0xefa7('0x99')](_0x11de90[_0x457dad]);}else if(_[_0xefa7('0x9a')](_0x11de90[_0x457dad])){for(var _0x15b207=0x0;_0x15b207<_0x11de90[_0x457dad][_0xefa7('0x9b')];_0x15b207++){this['recursiveNodeIndex'](_0x11de90[_0x457dad][_0x15b207]);}}else if(_[_0xefa7('0x96')](_0x11de90[_0x457dad])){_0x11de90[_0x457dad]=this[_0xefa7('0x98')](_0x11de90[_0x457dad]);}}}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x9c')]=function(_0x468765,_0x5df937){for(var _0x5c43d2 in _0x468765){if(_0x468765[_0xefa7('0x95')](_0x5c43d2)){if(_[_0xefa7('0x9d')](_0x468765[_0x5c43d2])){if(!_[_0xefa7('0x41')](_0x468765[_0x5c43d2])){this['saveRestApiResult'](_0x468765[_0x5c43d2],util[_0xefa7('0x29')](_0xefa7('0x9e'),_0x5df937,_0x5c43d2));}}else if(_[_0xefa7('0x9a')](_0x468765[_0x5c43d2])){for(var _0x302ebd=0x0;_0x302ebd<_0x468765[_0x5c43d2][_0xefa7('0x9b')];_0x302ebd++){this[_0xefa7('0x9c')](_0x468765[_0x5c43d2][_0x302ebd],util['format']('%s.%s',_0x5df937,_0x5c43d2+'['+_0x302ebd+']'));}}else{if(!_[_0xefa7('0x42')](_0x468765[_0x5c43d2])){this[_0xefa7('0xe')]['setVariable'](util[_0xefa7('0x29')](_0xefa7('0x9e'),_0x5df937,_0x5c43d2),_0x468765[_0x5c43d2]);}}}}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x97')]=function(_0x12d04a){try{var _0x158eea=JSON[_0xefa7('0x6a')](_0x12d04a);this[_0xefa7('0x99')](_0x158eea);return JSON[_0xefa7('0x72')](_0x158eea);}catch(_0x4e15a0){return this[_0xefa7('0x98')](_0x12d04a);}};AGIVertices[_0xefa7('0x10')]['replaceAllVariables']=function(_0x3cf5a0){var _0x4bfd65=_0x3cf5a0[_0xefa7('0x9f')]('{');for(var _0x48f946=0x1;_0x48f946<_0x4bfd65[_0xefa7('0x9b')];_0x48f946+=0x1){var _0x4fb26f=_0x4bfd65[_0x48f946][_0xefa7('0x9f')]('}');if(_0x4fb26f[_0xefa7('0x9b')]>0x1){_0x3cf5a0=_0x3cf5a0[_0xefa7('0xa0')]('{'+_0x4fb26f[0x0]+'}',this[_0xefa7('0xe')][_0xefa7('0x11')](_0x4fb26f[0x0])[_0xefa7('0xa1')]||_0x4fb26f[0x0]);}}if(_0x4bfd65[_0xefa7('0x9b')]===0x1){return _0x3cf5a0['toString']();}return this[_0xefa7('0x98')](_0x3cf5a0);};AGIVertices[_0xefa7('0x10')][_0xefa7('0xa2')]=function(_0x33416e,_0x5373cf){var _0x32ec21=this[_0xefa7('0xe')]['getVariable'](_0x33416e);if(_0x32ec21[_0xefa7('0xa3')]===-0x1){return _0x32ec21;}logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xa4'),_0x5373cf,_0x32ec21[_0xefa7('0xa1')]));return this[_0xefa7('0xe')][_0xefa7('0xa5')](_0x5373cf,_0x32ec21[_0xefa7('0xa1')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x85')]=function(_0x2f39bf){return _0x2f39bf&&_0x2f39bf!=='0'&&_0x2f39bf!=='-1'&&_0x2f39bf!=='';};AGIVertices[_0xefa7('0x10')][_0xefa7('0xa6')]=function(_0x248930){this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x248930,'-');_0x248930[_0xefa7('0xa7')]=_0x248930[_0xefa7('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xefa7('0x10')]['mrcpsynth']=function(_0x30700a){logger['info'](util[_0xefa7('0x29')](_0xefa7('0xa8'),_0x30700a[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x30700a[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}var _0x55dea6='\x22'+_0x30700a[_0xefa7('0x58')]+'\x22';if(this[_0xefa7('0x85')](_0x30700a[_0xefa7('0x78')])){_0x55dea6+=','+_0x30700a['options'];}var _0x6f6446=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xab'),_0x55dea6);if(_0x6f6446[_0xefa7('0xa3')]===-0x1){return _0x6f6446;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0xac'),_0x55dea6));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xad')]=function(_0x1b5583){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xae'),_0x1b5583[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x1b5583[_0xefa7('0xaf')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xb0'));}var _0x4ea265=_0x1b5583[_0xefa7('0xaf')];if(this['isConfigured'](_0x1b5583[_0xefa7('0x78')])){_0x4ea265+=','+_0x1b5583[_0xefa7('0x78')];}var _0xe4e1a2=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xb1'),_0x4ea265);if(_0xe4e1a2[_0xefa7('0xa3')]===-0x1){return _0xe4e1a2;}var _0x2b7bf3=this['getAndSetVariable'](_0xefa7('0xb2'),_0xefa7('0xb3'));if(_0x2b7bf3[_0xefa7('0xa3')]===-0x1){return _0x2b7bf3;}var _0x18b78d=this['getAndSetVariable'](_0xefa7('0xb4'),_0xefa7('0xb5'));if(_0x18b78d['result']===-0x1){return _0x18b78d;}var _0x1414ec=this[_0xefa7('0xa2')](_0xefa7('0xb6'),_0xefa7('0xb7'));if(_0x1414ec[_0xefa7('0xa3')]===-0x1){return _0x1414ec;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0xb8'),_0x4ea265));};AGIVertices['prototype'][_0xefa7('0xb9')]=function(_0x36dbf8){logger['info'](util[_0xefa7('0x29')](_0xefa7('0xba'),_0x36dbf8['label']));return this[_0xefa7('0xe')][_0xefa7('0xb9')]([_0x36dbf8[_0xefa7('0xbb')],_0x36dbf8[_0xefa7('0xbc')]]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0xbd')]=function(_0x2ea24a){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xbe'),_0x2ea24a['label']));if(this[_0xefa7('0x85')](_0x2ea24a['timeout'])){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0xbf'),_0x2ea24a[_0xefa7('0x61')]));var _0x4e197a=this[_0xefa7('0xe')]['wait'](_0x2ea24a[_0xefa7('0x61')]);if(_0x4e197a['result']===-0x1){return _0x4e197a;}}return this[_0xefa7('0xe')][_0xefa7('0xbd')]();};AGIVertices[_0xefa7('0x10')][_0xefa7('0x48')]=function(_0x124653){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0xc0'),_0x124653['label']));if(!this[_0xefa7('0x85')](_0x124653[_0xefa7('0x46')])){return this['channel'][_0xefa7('0x30')](_0x124653,_0xefa7('0xc1'));}_0x124653['scheduledAt']=moment();if(this[_0xefa7('0x85')](_0x124653['delay'])){_0x124653[_0xefa7('0x47')]=moment()['add'](_0x124653['delay'],_0xefa7('0xc2'));}if(!this['isConfigured'](_0x124653[_0xefa7('0x4a')])){_0x124653[_0xefa7('0x4a')]=0x2;}this[_0xefa7('0x40')][_0xefa7('0x6f')](this,_0x124653);return this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xc3'),_0x124653[_0xefa7('0xc4')],_0x124653['list_id'],_0x124653[_0xefa7('0x47')]));};AGIVertices['prototype'][_0xefa7('0xc5')]=function(_0x22af92){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xc6'),_0x22af92['label']));var _0x7697b1=this[_0xefa7('0xe')][_0xefa7('0x53')](_0x22af92[_0xefa7('0xc7')],_0x22af92[_0xefa7('0x78')]);if(_0x7697b1[_0xefa7('0xa3')]===-0x1){return _0x7697b1;}return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')]('Executed\x20command\x20%s\x20%s',_0x22af92[_0xefa7('0xc7')],_0x22af92[_0xefa7('0x78')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x122a42){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xc8'),_0x122a42['label']));if(!this[_0xefa7('0x85')](_0x122a42[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}var _0x215f2a='\x22'+_0x122a42[_0xefa7('0x58')]+'\x22';if(this[_0xefa7('0x85')](_0x122a42['options'])){_0x215f2a+=','+_0x122a42[_0xefa7('0x78')];}var _0x4fab90=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xab'),_0x215f2a);if(_0x4fab90[_0xefa7('0xa3')]===-0x1){return _0x4fab90;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xac'),_0x215f2a));};AGIVertices[_0xefa7('0x10')]['sestektts']=function(_0x18de9f){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xc9'),_0x18de9f[_0xefa7('0x34')]));if(!this['isConfigured'](_0x18de9f[_0xefa7('0x58')])){return this['channel'][_0xefa7('0xa9')](_0xefa7('0xaa'));}var _0x38f07c='\x22'+_0x18de9f[_0xefa7('0x58')]+'\x22';if(this[_0xefa7('0x85')](_0x18de9f['options'])){_0x38f07c+=','+_0x18de9f[_0xefa7('0x78')];}var _0x5eab8f=this['channel']['exec'](_0xefa7('0xab'),_0x38f07c);if(_0x5eab8f[_0xefa7('0xa3')]===-0x1){return _0x5eab8f;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xac'),_0x38f07c));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xca')]=function(_0x35eb86){logger['info'](util['format'](_0xefa7('0xcb'),_0x35eb86[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x35eb86['grammar'])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xb0'));}var _0x5cf2da=_0x35eb86['grammar'];if(this['isConfigured'](_0x35eb86['options'])){_0x5cf2da+=','+_0x35eb86[_0xefa7('0x78')];}var _0x14d382=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xb1'),_0x5cf2da);if(_0x14d382[_0xefa7('0xa3')]===-0x1){return _0x14d382;}var _0x418f5e=this[_0xefa7('0xa2')]('RECOG_CONFIDENCE()',_0xefa7('0xcc'));if(_0x418f5e[_0xefa7('0xa3')]===-0x1){return _0x418f5e;}var _0x16d4fa=this[_0xefa7('0xa2')](_0xefa7('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x16d4fa['result']===-0x1){return _0x16d4fa;}var _0x5ef620=this['getAndSetVariable'](_0xefa7('0xb6'),_0xefa7('0xcd'));if(_0x5ef620[_0xefa7('0xa3')]===-0x1){return _0x5ef620;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0xb8'),_0x5cf2da));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xce')]=function(_0x14c829){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x14c829['label']));if(!this[_0xefa7('0x85')](_0x14c829[_0xefa7('0xaf')])){return this['channel'][_0xefa7('0xa9')](_0xefa7('0xb0'));}var _0x179192=_0x14c829[_0xefa7('0xaf')];if(this[_0xefa7('0x85')](_0x14c829[_0xefa7('0x78')])){_0x179192+=','+_0x14c829[_0xefa7('0x78')];}var _0x5aa0f0=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xb1'),_0x179192);if(_0x5aa0f0['result']===-0x1){return _0x5aa0f0;}var _0x463b7c=this[_0xefa7('0xa2')](_0xefa7('0xb2'),_0xefa7('0xcf'));if(_0x463b7c['result']===-0x1){return _0x463b7c;}var _0x517123=this['getAndSetVariable'](_0xefa7('0xb4'),_0xefa7('0xd0'));if(_0x517123[_0xefa7('0xa3')]===-0x1){return _0x517123;}var _0x386e24=this['getAndSetVariable']('RECOG_INSTANCE()',_0xefa7('0xd1'));if(_0x386e24[_0xefa7('0xa3')]===-0x1){return _0x386e24;}return this['channel'][_0xefa7('0xa9')](util['format'](_0xefa7('0xb8'),_0x179192));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xd2')]=function(_0x28185f){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x28185f[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x28185f['odbc_id'])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x28185f,_0xefa7('0xd3'));}var _0x2360c8=this[_0xefa7('0x1b')][_0xefa7('0x6f')](this,_0x28185f[_0xefa7('0xd4')]);if(!_0x2360c8){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x28185f,'no\x20odbc\x20database\x20found');}if(!this[_0xefa7('0x85')](_0x28185f[_0xefa7('0x2d')])){return this['channel'][_0xefa7('0x30')](_0x28185f,'no\x20query\x20configured');}var _0x5c8493=_0x28185f[_0xefa7('0x2d')][_0xefa7('0xd5')](/(\r\n|\n|\r)/gm,'\x20');this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xd6'),_0x5c8493));var _0x24763a=this[_0xefa7('0x2a')][_0xefa7('0x6f')](this,_0x2360c8,_0x5c8493);this[_0xefa7('0x33')]['sync'](this,_0x28185f,_0x5c8493);if(!this[_0xefa7('0x85')](_0x28185f[_0xefa7('0xd7')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1c1226=this[_0xefa7('0x11')][_0xefa7('0x6f')](this,_0x28185f[_0xefa7('0xd7')]);if(!_0x1c1226){return this[_0xefa7('0xe')]['error'](_0x28185f,'no\x20variable\x20found');}var _0x2dea06=this;_0x24763a[_0xefa7('0xd8')](function(_0x4e1255,_0xcdabec){Object[_0xefa7('0xd9')](_0x4e1255)[_0xefa7('0xd8')](function(_0x1141ad){_0x2dea06['channel'][_0xefa7('0xa5')](util[_0xefa7('0x29')](_0xefa7('0xda'),_0x1c1226,_0xcdabec,_0x1141ad),_0x4e1255[_0x1141ad]);});});this[_0xefa7('0xe')]['setVariable'](util[_0xefa7('0x29')](_0xefa7('0xdb'),_0x1c1226),_0x24763a[_0xefa7('0x9b')]);return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0xdc'),_0x1c1226));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xdd')]=function(_0x428138){logger[_0xefa7('0xde')](util['format'](_0xefa7('0xdf'),_0x428138[_0xefa7('0x34')]));if(!this['isConfigured'](_0x428138[_0xefa7('0xe0')])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x428138,_0xefa7('0xe1'));}var _0x522c9a=this['getUser'][_0xefa7('0x6f')](this,_0x428138[_0xefa7('0xe0')]);if(!_0x522c9a){return this[_0xefa7('0xe')]['error'](_0x428138,'no\x20user\x20found');}var _0x5a0761=this['channel']['exec'](_0xefa7('0xe2'),[util['format']('SIP/%s',_0x522c9a),_0x428138['timeout'],_0x428138[_0xefa7('0xe3')],_0x428138[_0xefa7('0x60')]]);if(_0x5a0761[_0xefa7('0xa3')]===-0x1){return _0x5a0761;}return this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xe4'),_0xefa7('0xe2')));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xe5')]=function(_0x198b42){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xe6'),_0x198b42[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x198b42['key'])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0xe7'));}if(!this[_0xefa7('0x85')](_0x198b42[_0xefa7('0x58')])){return this[_0xefa7('0xe')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0xefa7('0x33')](_0x198b42);this[_0xefa7('0x3f')](_0x198b42['text'],'in','','');this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0xe8'),_0x198b42['text']));var _0x47c665=this[_0xefa7('0x79')][_0xefa7('0x6f')](this,_0x198b42);if(_0x47c665){for(var _0x11eaab in _0x47c665){if(_0x47c665[_0xefa7('0x95')](_0x11eaab)){this[_0xefa7('0xe')][_0xefa7('0xa5')](util[_0xefa7('0x29')](_0xefa7('0xe9'),_0x11eaab['toUpperCase']()),_0x47c665[_0x11eaab]);}}this[_0xefa7('0x3f')](_0x47c665[_0xefa7('0xea')],_0xefa7('0xeb'),_0xefa7('0xe5'),'');return this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xec'),_0x47c665['speech']));}return this[_0xefa7('0xe')]['error'](_0x198b42,_0xefa7('0xed'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xee')]=function(_0x50f548){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0xef'),_0x50f548[_0xefa7('0x34')]));if(!this['isConfigured'](_0x50f548[_0xefa7('0xf0')])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0xf1'));}if(!this[_0xefa7('0x85')](_0x50f548[_0xefa7('0x7c')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x50f548[_0xefa7('0x7d')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xf2'));}if(!this[_0xefa7('0x85')](_0x50f548['dialogflowV2_language'])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xf3'));}if(!this[_0xefa7('0x85')](_0x50f548[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}this[_0xefa7('0xe')][_0xefa7('0xf4')]=!![];this[_0xefa7('0x33')](_0x50f548);this[_0xefa7('0x3f')](_0x50f548[_0xefa7('0x58')],'in','','');this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0xf5'),_0x50f548[_0xefa7('0x58')]));var _0x23d658=this[_0xefa7('0x7b')][_0xefa7('0x6f')](this,_0x50f548);if(_0x23d658){for(var _0x5bcec5 in _0x23d658){if(_0x23d658['hasOwnProperty'](_0x5bcec5)){if(_0x5bcec5!==_0xefa7('0xf6')){this['channel']['setVariable'](util[_0xefa7('0x29')]('DIALOGFLOW_%s',_0x5bcec5[_0xefa7('0x67')]()),_0x23d658[_0x5bcec5]);}}}this[_0xefa7('0x3f')](_0x23d658[_0xefa7('0xea')],_0xefa7('0xeb'),_0xefa7('0xee'),_0x23d658[_0xefa7('0xf6')]);return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0xf7'),_0x23d658[_0xefa7('0xea')]));}return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x50f548,_0xefa7('0xf8'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0xf9')]=function(_0x303bdc){logger['info'](util[_0xefa7('0x29')](_0xefa7('0xfa'),_0x303bdc[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x303bdc[_0xefa7('0xfb')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xefa7('0x85')](_0x303bdc['username'])){return this['channel'][_0xefa7('0xa9')](_0xefa7('0xfc'));}if(!this['isConfigured'](_0x303bdc[_0xefa7('0xfd')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xfe'));}if(!this[_0xefa7('0x85')](_0x303bdc[_0xefa7('0xff')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20text\x20configured');}this[_0xefa7('0xe')][_0xefa7('0xf4')]=!![];this[_0xefa7('0x33')](_0x303bdc);this[_0xefa7('0x3f')](_0x303bdc[_0xefa7('0x58')],'in','','');this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format']('Trying\x20SestekNDA:\x20%s',_0x303bdc[_0xefa7('0x58')]));var _0x41e1a7=this['sestekNDA']['sync'](this,_0x303bdc);if(_0x41e1a7){for(var _0x3387bc in _0x41e1a7){if(_0x41e1a7[_0xefa7('0x95')](_0x3387bc)){this['channel'][_0xefa7('0xa5')](util[_0xefa7('0x29')](_0xefa7('0x100'),_0x3387bc[_0xefa7('0x67')]()),_0x41e1a7[_0x3387bc]);}}this[_0xefa7('0x3f')](_0x41e1a7['speech'],'out',_0xefa7('0xf9'),'');if(_0x41e1a7[_0xefa7('0x101')]){this['channel']['noop'](util[_0xefa7('0x29')](_0xefa7('0x102'),_0x41e1a7[_0xefa7('0x101')]));var _0x19463a=this[_0xefa7('0xe')][_0xefa7('0x103')](_0x41e1a7['audiofile']);try{fs[_0xefa7('0x104')](_0x41e1a7[_0xefa7('0x101')]+_0xefa7('0x105'));}catch(_0x4911cd){logger[_0xefa7('0x30')](_0x4911cd);}return _0x19463a;}else{return this['channel']['noop'](util[_0xefa7('0x29')]('SestekNDA\x20Result\x20%s',_0x41e1a7[_0xefa7('0xea')]));}}return this['channel'][_0xefa7('0x30')](_0x303bdc,_0xefa7('0x106'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x107')]=function(_0x33e261){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x108'),_0x33e261['label']));return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x107'));};AGIVertices[_0xefa7('0x10')]['ext_dial']=function(_0xe86b2b){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x109'),_0xe86b2b['label']));var _0x58e7ac='';if(_0xe86b2b[_0xefa7('0x10a')]){if(!this[_0xefa7('0x85')](_0xe86b2b[_0xefa7('0x10a')])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0xe86b2b,_0xefa7('0x10b'));}else{var _0x3c7fb1=parseInt(_0xe86b2b[_0xefa7('0x10a')],0xa);if(isNaN(_0x3c7fb1)){_0x58e7ac=_0xe86b2b[_0xefa7('0x10a')];}else{_0x58e7ac=this[_0xefa7('0x10c')][_0xefa7('0x6f')](this,_0xe86b2b[_0xefa7('0x10a')]);if(!_0x58e7ac){return this['channel'][_0xefa7('0x30')](_0xe86b2b,_0xefa7('0x10d'));}}}}else if(_0xe86b2b['trunk_name']){_0x58e7ac=_0xe86b2b['trunk_name'];}else{return this[_0xefa7('0xe')][_0xefa7('0x30')](_0xe86b2b,_0xefa7('0x10b'));}var _0x22f571=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0xe2'),[util[_0xefa7('0x29')](_0xefa7('0x10e'),_0x58e7ac,_0xe86b2b[_0xefa7('0xc4')]),_0xe86b2b['timeout'],_0xe86b2b[_0xefa7('0xe3')],_0xe86b2b[_0xefa7('0x60')]]);if(_0x22f571[_0xefa7('0xa3')]===-0x1){return _0x22f571;}return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0xe4'),_0xefa7('0xe2')));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x10f')]=function(_0x207d01){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x110'),_0x207d01[_0xefa7('0x34')]));return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x10f'));};AGIVertices[_0xefa7('0x10')]['getdigits']=function(_0x190655){logger['info'](util['format'](_0xefa7('0x111'),_0x190655['label']));if(_0x190655[_0xefa7('0xa7')]===0x0){return this['maxRetry'](_0x190655);}_0x190655[_0xefa7('0xa7')]-=0x1;if(!this[_0xefa7('0x85')](_0x190655['file_id'])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x190655,'no\x20file\x20audio\x20selected');}var _0x405fcc=this[_0xefa7('0x1f')][_0xefa7('0x6f')](this,_0x190655[_0xefa7('0x112')]);if(!_0x405fcc){return this[_0xefa7('0xe')]['error'](_0x190655,_0xefa7('0x113'));}if(!this[_0xefa7('0x85')](_0x190655['variable_id'])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0xefa7('0x114'));}var _0x47fea5=this[_0xefa7('0xe')][_0xefa7('0x115')](_0x405fcc,_0x190655[_0xefa7('0x116')],_0x190655[_0xefa7('0x117')]);var _0x48fa17=_0x47fea5['result']?_0x47fea5['result'][_0xefa7('0x49')]():'';logger['info'](_0xefa7('0x118'),JSON[_0xefa7('0x72')](_0x47fea5));if(_0x47fea5[_0xefa7('0xa3')]===-0x1){this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x190655,_0x48fa17);return _0x47fea5;}else if(_0x47fea5[_0xefa7('0xa1')]==='timeout'){_0x47fea5['result']=_0x48fa17[_0xefa7('0x9b')]>=parseInt(_0x190655['mindigit'])?'x':'i';}else{_0x47fea5['result']=_0x48fa17[_0xefa7('0x9b')]>=parseInt(_0x190655[_0xefa7('0x119')])&&_0x48fa17[_0xefa7('0x9b')]<=parseInt(_0x190655[_0xefa7('0x117')])?'x':'i';}var _0x34121e=this[_0xefa7('0x11')][_0xefa7('0x6f')](this,_0x190655['variable_id']);if(!_0x34121e){return this['channel']['error'](_0x190655,_0xefa7('0x11a'));}this[_0xefa7('0xe')]['setVariable'](_0x34121e,_0x48fa17);if(this['isConfigured'](_0x190655[_0xefa7('0x11b')])){var _0x19d200=parseInt(_0x190655[_0xefa7('0x11b')],0xa);var _0x46c9c4=rs[_0xefa7('0x11c')]({'charset':'*','length':_0x19d200});var _0x1e037a=_0x48fa17[_0xefa7('0x9b')];if(_0x1e037a>0x0){if(_0x1e037a>_0x19d200){this[_0xefa7('0x33')]['sync'](this,_0x190655,_0x190655[_0xefa7('0x11d')]===_0xefa7('0x11e')?_0x46c9c4+_0x48fa17[_0xefa7('0x11f')](_0x19d200):_0x48fa17[_0xefa7('0x11f')](0x0,_0x1e037a-_0x19d200)+_0x46c9c4);}else{this['createSquareDetailsReport'][_0xefa7('0x6f')](this,_0x190655,rs[_0xefa7('0x11c')]({'charset':'*','length':_0x1e037a}));}}else{this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x190655,'');}}else{this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x190655,_0x48fa17);}return _0x47fea5;};AGIVertices[_0xefa7('0x10')][_0xefa7('0x120')]=function(_0x1741be){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x121'),_0x1741be[_0xefa7('0x34')]));return this[_0xefa7('0xd')](_0x1741be);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x122')]=function(_0x5f44c7){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x123'),_0x5f44c7[_0xefa7('0x34')]));this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x5f44c7,_0x5f44c7['goalname']);return this['channel']['noop'](util['format']('GOAL\x20%s',_0x5f44c7[_0xefa7('0x124')]));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x125')]=function(_0x24ad71){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x126'),_0x24ad71['label']));if(!this[_0xefa7('0x85')](_0x24ad71[_0xefa7('0x88')])||!this['isConfigured'](_0x24ad71[_0xefa7('0x127')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x128'));}if(!this[_0xefa7('0x85')](_0x24ad71[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x129'),_0x24ad71['text']));var _0x466208=this[_0xefa7('0x87')][_0xefa7('0x6f')](this,_0x24ad71);if(_0x466208){this[_0xefa7('0xe')]['noop'](util['format'](_0xefa7('0x12a'),_0x466208));var _0x438d72=this[_0xefa7('0xe')][_0xefa7('0x103')](_0x466208);try{fs[_0xefa7('0x104')](_0x466208+_0xefa7('0x105'));}catch(_0x37e96e){logger['error'](_0x37e96e);}return _0x438d72;}return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x24ad71,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xefa7('0x10')][_0xefa7('0x12b')]=function(_0x43d747){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x43d747[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x43d747[_0xefa7('0x88')])||!this[_0xefa7('0x85')](_0x43d747[_0xefa7('0x127')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x128'));}if(!this['isConfigured'](_0x43d747[_0xefa7('0x8e')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x12c'));}if(!this[_0xefa7('0x85')](_0x43d747[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}this['channel'][_0xefa7('0xf4')]=!![];this['createSquareDetailsReport'](_0x43d747);this[_0xefa7('0x3f')](_0x43d747['text'],'in','','');this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x43d747[_0xefa7('0x58')]));var _0x2ee6ba=this['awsLex'][_0xefa7('0x6f')](this,_0x43d747);if(_0x2ee6ba){for(var _0x4a03c7 in _0x2ee6ba){if(_0x2ee6ba[_0xefa7('0x95')](_0x4a03c7)&&_['isString'](_0x2ee6ba[_0x4a03c7])){this[_0xefa7('0xe')][_0xefa7('0xa5')](util['format'](_0xefa7('0x12d'),_0x4a03c7[_0xefa7('0x67')]()),_0x2ee6ba[_0x4a03c7]);}}if(_[_0xefa7('0x42')](_0x2ee6ba[_0xefa7('0x76')])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0x12e'));}else{this['createSquareMessage'](_0x2ee6ba[_0xefa7('0x76')],_0xefa7('0xeb'),'amazonlex','');return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x12f'),_0x2ee6ba[_0xefa7('0x76')]));}}return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x43d747,_0xefa7('0x130'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x131')]=function(_0x3cdf01){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x132'),_0x3cdf01['label'],_0x3cdf01['timeout']));if(!this['isConfigured'](_0x3cdf01[_0xefa7('0x83')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xe7'));}var _0xeafc17=_0xefa7('0x133');var _0x151be8=util[_0xefa7('0x29')](_0xefa7('0x134'),FILES_PATH,rs['generate'](0x4));var _0x3b9780=util[_0xefa7('0x29')](_0xefa7('0x9e'),_0x151be8,_0xeafc17);var _0x453e4d=!![];if(_0x3cdf01[_0xefa7('0x135')]===_0xefa7('0x136')){_0x453e4d=![];}var _0x2c41a9=this[_0xefa7('0xe')][_0xefa7('0x137')](_0x151be8,_0xeafc17,_0x3cdf01[_0xefa7('0x138')],_0x3cdf01[_0xefa7('0x61')],undefined,_0x453e4d);if(_0x2c41a9[_0xefa7('0xa3')]!==-0x1){this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')]('google\x20%s\x20file\x20created',_0x3b9780));var _0x4d7935=this['googleASR'][_0xefa7('0x6f')](this,_0x3cdf01,_0x3b9780);if(_0x4d7935){for(var _0x24a315 in _0x4d7935){if(_0x4d7935['hasOwnProperty'](_0x24a315)){this['channel'][_0xefa7('0xa5')](util['format']('GOOGLE_ASR_%s',_0x24a315[_0xefa7('0x67')]()),_0x4d7935[_0x24a315]);}}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0x139'),JSON[_0xefa7('0x72')](_0x4d7935)));}}return _0x2c41a9;};AGIVertices['prototype'][_0xefa7('0x13a')]=function(_0x3c229b){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3c229b[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x3c229b[_0xefa7('0x13b')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20appid\x20configured');}if(!this[_0xefa7('0x85')](_0x3c229b[_0xefa7('0x92')])){return this['channel'][_0xefa7('0xa9')](_0xefa7('0x13c'));}var _0x2cde39=_0xefa7('0x133');var _0x36d5cb=util[_0xefa7('0x29')](_0xefa7('0x134'),FILES_PATH,rs['generate'](0x4));var _0x5c375c=util[_0xefa7('0x29')](_0xefa7('0x9e'),_0x36d5cb,_0x2cde39);var _0x1eb065=!![];if(_0x3c229b[_0xefa7('0x135')]==='NOBEEP'){_0x1eb065=![];}var _0xf06d9a=this[_0xefa7('0xe')][_0xefa7('0x137')](_0x36d5cb,_0x2cde39,_0x3c229b[_0xefa7('0x138')],_0x3c229b[_0xefa7('0x61')],undefined,_0x1eb065);if(_0xf06d9a[_0xefa7('0xa3')]!==-0x1){this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x13d'),_0x5c375c));var _0x5287ff=this[_0xefa7('0x91')][_0xefa7('0x6f')](this,_0x3c229b,_0x5c375c);if(_0x5287ff){for(var _0x2bad76 in _0x5287ff){if(_0x5287ff['hasOwnProperty'](_0x2bad76)){this['channel'][_0xefa7('0xa5')](util['format']('TILDE_ASR_%s',_0x2bad76[_0xefa7('0x67')]()),_0x5287ff[_0x2bad76]);}}return this[_0xefa7('0xe')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0xefa7('0x72')](_0x5287ff)));}}return _0xf06d9a;};AGIVertices['prototype'][_0xefa7('0x13e')]=function(_0x2c219b){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x13f'),_0x2c219b[_0xefa7('0x34')]));return this['channel']['continueAt'](_0x2c219b[_0xefa7('0x140')],_0x2c219b['extension'],_0x2c219b[_0xefa7('0x3b')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x141')]=function(_0x4f553a){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x142'),_0x4f553a['label']));if(!this[_0xefa7('0x85')](_0x4f553a[_0xefa7('0x143')])){return this['channel'][_0xefa7('0x30')](_0x4f553a,'no\x20condition\x20configured');}try{var _0x19127a=eval(_0x4f553a[_0xefa7('0x143')])?_0xefa7('0x144'):_0xefa7('0x145');this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x146'),_0x4f553a[_0xefa7('0x143')],_0x19127a));return{'code':0xc8,'result':_0x19127a};}catch(_0x4b51ac){return{'code':0xc8,'result':_0xefa7('0x145')};}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x147')]=function(_0x1fbd36){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x148'),_0x1fbd36[_0xefa7('0x34')]));if(!this['isConfigured'](_0x1fbd36[_0xefa7('0x149')])){return this[_0xefa7('0xe')]['error'](_0x1fbd36,_0xefa7('0x14a'));}var _0x405b14=this[_0xefa7('0x24')]['sync'](this,_0x1fbd36['interval_id']);if(!_0x405b14){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x1fbd36,_0xefa7('0x14b'));}for(var _0x394dec=0x0;_0x394dec<_0x405b14['length'];_0x394dec+=0x1){var _0x28efc7=this['channel'][_0xefa7('0x11')](util[_0xefa7('0x29')](_0xefa7('0x14c'),_0x405b14[_0x394dec]));if(_0x28efc7[_0xefa7('0xa3')]===-0x1){return _0x28efc7;}logger['info'](util[_0xefa7('0x29')](_0xefa7('0x14d'),_0x405b14[_0x394dec],_0x28efc7[_0xefa7('0xa1')]));if(_0x28efc7['extra']===_0xefa7('0x144')){logger[_0xefa7('0x2b')](util['format']('IFTIME\x20%s\x20%s',_0x405b14[_0x394dec],_0xefa7('0x144')));this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x14d'),_0x405b14[_0x394dec],'true'));return{'code':0xc8,'result':_0xefa7('0x144')};}else{logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x14d'),_0x405b14[_0x394dec],'false'));this[_0xefa7('0xe')]['noop'](util['format'](_0xefa7('0x14d'),_0x405b14[_0x394dec],_0xefa7('0x145')));}}return{'code':0xc8,'result':_0xefa7('0x145')};};AGIVertices[_0xefa7('0x10')][_0xefa7('0x14e')]=function(_0x3380c7){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x14f'),_0x3380c7[_0xefa7('0x34')]));return this[_0xefa7('0xe')][_0xefa7('0x14e')]();};AGIVertices['prototype']['ispeechasr']=function(_0x160e67){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x150'),_0x160e67[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x160e67[_0xefa7('0x83')])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0xe7'));}var _0x2a720e='wav';var _0x2e62c3=util[_0xefa7('0x29')](_0xefa7('0x134'),FILES_PATH,rs[_0xefa7('0x11c')](0x4));var _0x307237=util[_0xefa7('0x29')](_0xefa7('0x9e'),_0x2e62c3,_0x2a720e);var _0x8ba634=!![];if(_0x160e67[_0xefa7('0x135')]===_0xefa7('0x136')){_0x8ba634=![];}var _0x5d70ec=this[_0xefa7('0xe')]['recordFile'](_0x2e62c3,_0x2a720e,_0x160e67[_0xefa7('0x138')],_0x160e67['timeout'],undefined,_0x8ba634);if(_0x5d70ec[_0xefa7('0xa3')]!==-0x1){this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x151'),_0x307237));var _0x149b90=this[_0xefa7('0x82')][_0xefa7('0x6f')](this,_0x160e67,_0x307237);if(_0x149b90){for(var _0x39e24b in _0x149b90){if(_0x149b90[_0xefa7('0x95')](_0x39e24b)){this[_0xefa7('0xe')][_0xefa7('0xa5')](util[_0xefa7('0x29')](_0xefa7('0x152'),_0x39e24b[_0xefa7('0x67')]()),_0x149b90[_0x39e24b]);}}return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x149b90)));}}return _0x5d70ec;};AGIVertices[_0xefa7('0x10')]['ispeechtts']=function(_0x452043){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x153'),_0x452043[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x452043[_0xefa7('0x83')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xe7'));}if(!this[_0xefa7('0x85')](_0x452043[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20text\x20configured');}this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x154'),_0x452043[_0xefa7('0x58')]));var _0x350ab4=this[_0xefa7('0x80')][_0xefa7('0x6f')](this,_0x452043);if(_0x350ab4){this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x151'),_0x350ab4));var _0x52719c=this['channel'][_0xefa7('0x103')](_0x350ab4,_0x452043['intKey']);try{fs[_0xefa7('0x104')](_0x350ab4+'.wav');}catch(_0x242f64){logger[_0xefa7('0x30')](_0x242f64);}return _0x52719c;}return this[_0xefa7('0xe')]['error'](_0x452043,_0xefa7('0x155'));};AGIVertices['prototype'][_0xefa7('0x156')]=function(_0x34edea){logger['info'](util[_0xefa7('0x29')](_0xefa7('0x157'),_0x34edea['label']));if(!this[_0xefa7('0x85')](_0x34edea[_0xefa7('0x158')])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x34edea,'no\x20find\x20by\x20configured');}logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x159'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x34edea[_0xefa7('0x158')]));var _0x2731b8=this[_0xefa7('0x50')][_0xefa7('0x6f')](this,_0x34edea['findBy']);if(_0x2731b8){logger['info'](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x34edea['findBy']));this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x34edea[_0xefa7('0x158')]));return{'code':0xc8,'result':_0xefa7('0x15b')};}else{logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x15c'),this['channel'][_0xefa7('0x36')],_0x34edea[_0xefa7('0x158')]));this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x15c'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x34edea['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xefa7('0x10')]['logout']=function(_0x1e52f4){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x15d'),_0x1e52f4[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x1e52f4[_0xefa7('0x158')])){return this[_0xefa7('0xe')]['error'](_0x1e52f4,_0xefa7('0x15e'));}logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x159'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1e52f4[_0xefa7('0x158')]));var _0x1b572b=this[_0xefa7('0x4f')][_0xefa7('0x6f')](this,_0x1e52f4[_0xefa7('0x158')]);if(_0x1b572b){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1e52f4[_0xefa7('0x158')]));this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0x15a'),this['channel'][_0xefa7('0x36')],_0x1e52f4['findBy']));return{'code':0xc8,'result':_0xefa7('0x15b')};}else{logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x15c'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1e52f4[_0xefa7('0x158')]));this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1e52f4[_0xefa7('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x15f')]=function(_0x3bcfdd){logger['info'](util[_0xefa7('0x29')](_0xefa7('0x160'),_0x3bcfdd[_0xefa7('0x34')]));if(!this['isConfigured'](_0x3bcfdd[_0xefa7('0x161')])){return this[_0xefa7('0xe')]['error'](_0x3bcfdd,_0xefa7('0x162'));}this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0x163'),_0x3bcfdd[_0xefa7('0x161')]));var _0x4356e6=eval(_0x3bcfdd[_0xefa7('0x161')]);if(!this['isConfigured'](_0x3bcfdd[_0xefa7('0xd7')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2a8167=this['getVariable'][_0xefa7('0x6f')](this,_0x3bcfdd[_0xefa7('0xd7')]);if(!_0x2a8167){return this['channel'][_0xefa7('0x30')](_0x3bcfdd,_0xefa7('0x11a'));}if(_[_0xefa7('0x9a')](_0x4356e6)){var _0x2ed8ab=this;_0x4356e6[_0xefa7('0xd8')](function(_0x400a27,_0x1e1de1){_0x2ed8ab[_0xefa7('0xe')]['setVariable'](util[_0xefa7('0x29')]('%s[%s]',_0x2a8167,_0x1e1de1),_0x400a27);});return this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')]('variable\x20%s[key]\x20set',_0x2a8167));}else{return this[_0xefa7('0xe')][_0xefa7('0xa5')](_0x2a8167,_0x4356e6);}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x164')]=function(_0x58e712){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x165'),_0x58e712[_0xefa7('0x34')]));if(_0x58e712[_0xefa7('0xa7')]===0x0){return this['maxRetry'](_0x58e712);}_0x58e712[_0xefa7('0xa7')]-=0x1;if(!this[_0xefa7('0x85')](_0x58e712[_0xefa7('0x112')])){return this['channel']['error'](_0x58e712,_0xefa7('0x166'));}var _0x30e56c=this[_0xefa7('0x1f')]['sync'](this,_0x58e712[_0xefa7('0x112')]);if(!_0x30e56c){return this[_0xefa7('0xe')]['error'](_0x58e712,_0xefa7('0x113'));}var _0x20fded=this[_0xefa7('0xe')][_0xefa7('0x115')](_0x30e56c,_0x58e712[_0xefa7('0x116')],_0x58e712[_0xefa7('0x167')]);var _0x320530=_0x20fded[_0xefa7('0xa3')];if(_0x20fded[_0xefa7('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x58e712,'-1');return _0x20fded;}else if(_0x20fded['extra']===_0xefa7('0x61')){_0x20fded[_0xefa7('0xa3')]=_0x20fded[_0xefa7('0xa3')][_0xefa7('0x9b')]>0x0?_0x20fded[_0xefa7('0xa3')]:'t';}else if(_[_0xefa7('0x41')](_0x20fded[_0xefa7('0xa3')])){_0x20fded[_0xefa7('0xa3')]='#';_0x320530='#';}if(!this['isConfigured'](_0x58e712[_0xefa7('0xd7')])){this[_0xefa7('0xe')]['noop'](_0xefa7('0x114'));}else{var _0x4370d7=this[_0xefa7('0x11')][_0xefa7('0x6f')](this,_0x58e712[_0xefa7('0xd7')]);if(!_0x4370d7){return this['channel'][_0xefa7('0x30')](_0x58e712,_0xefa7('0x11a'));}this[_0xefa7('0xe')]['setVariable'](_0x4370d7,_0x320530);}this[_0xefa7('0x33')]['sync'](this,_0x58e712,_0x320530);return _0x20fded;};AGIVertices[_0xefa7('0x10')][_0xefa7('0xa9')]=function(_0x57fe03){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x57fe03[_0xefa7('0x34')]));return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0x57fe03[_0xefa7('0x168')]||_0x57fe03[_0xefa7('0x34')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x169')]=function(_0x1bd651){logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x16a'),_0x1bd651[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x1bd651[_0xefa7('0x158')])){return this['channel']['error'](_0x1bd651,'no\x20find\x20by\x20configured');}logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x159'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1bd651[_0xefa7('0x158')]));var _0x513c25=this['getPause']['sync'](this,_0x1bd651[_0xefa7('0x16b')]);var _0x443187=this[_0xefa7('0x4c')][_0xefa7('0x6f')](this,_0x1bd651[_0xefa7('0x158')],_0x513c25);if(_0x443187){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1bd651[_0xefa7('0x158')]));this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1bd651[_0xefa7('0x158')]));return{'code':0xc8,'result':_0xefa7('0x15b')};}else{logger[_0xefa7('0x2b')](util['format'](_0xefa7('0x15c'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x1bd651['findBy']));this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1bd651[_0xefa7('0x158')]));return{'code':0xc8,'result':_0xefa7('0x16c')};}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x16d')]=function(_0x3a9051){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3a9051['label']));if(!this['isConfigured'](_0x3a9051[_0xefa7('0x112')])){return this['channel'][_0xefa7('0x30')](_0x3a9051,_0xefa7('0x166'));}var _0x397261=this[_0xefa7('0x1f')][_0xefa7('0x6f')](this,_0x3a9051[_0xefa7('0x112')]);if(!_0x397261){return this['channel'][_0xefa7('0x30')](_0x3a9051,_0xefa7('0x113'));}var _0x4026b=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0x16e'),[_0x397261,_0x3a9051[_0xefa7('0xe3')]]);if(_0x4026b[_0xefa7('0xa3')]===-0x1){return _0x4026b;}return this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')]('Executed\x20command\x20%s\x20%s',_0xefa7('0x16e'),_0x397261));};AGIVertices[_0xefa7('0x10')]['queue']=function(_0xfcd2b){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xfcd2b[_0xefa7('0x34')]));if(!this['isConfigured'](_0xfcd2b['queue_id'])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0xfcd2b,_0xefa7('0x16f'));}var _0xfdba32='';var _0x59d1f1=parseInt(_0xfcd2b['queue_id'],0xa);if(isNaN(_0x59d1f1)){_0xfdba32=_0xfcd2b[_0xefa7('0x170')];}else{_0xfdba32=this[_0xefa7('0x15')][_0xefa7('0x6f')](this,_0xfcd2b[_0xefa7('0x170')]);if(!_0xfdba32){return this[_0xefa7('0xe')]['error'](_0xfcd2b,_0xefa7('0x171'));}}var _0x479e18='';if(this[_0xefa7('0x85')](_0xfcd2b[_0xefa7('0x112')])){var _0x10d3e3=this[_0xefa7('0x1f')][_0xefa7('0x6f')](this,_0xfcd2b[_0xefa7('0x112')]);if(_0x10d3e3){_0x479e18=_0x10d3e3;}}this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0xfcd2b,_0xfdba32);if(_0xfcd2b[_0xefa7('0xe3')][_0xefa7('0x172')]('x')<0x0){_0xfcd2b['opts']+='x';}if(_0xfcd2b[_0xefa7('0xe3')][_0xefa7('0x172')]('X')<0x0){_0xfcd2b[_0xefa7('0xe3')]+='X';}this[_0xefa7('0xe')]['setVariable'](_0xefa7('0x173'),_0xfdba32?_0xfdba32[_0xefa7('0x174')]():'');var _0x50e882=this[_0xefa7('0xe')]['exec'](_0xefa7('0x175'),[_0xfdba32,_0xfcd2b[_0xefa7('0xe3')],_0xfcd2b[_0xefa7('0x60')],_0x479e18,_0xfcd2b[_0xefa7('0x61')],_0xfcd2b[_0xefa7('0xb9')],_0xfcd2b[_0xefa7('0x176')],_0xfcd2b[_0xefa7('0x177')],'',_0xfcd2b[_0xefa7('0x178')]]);if(_0x50e882[_0xefa7('0xa3')]===-0x1){return _0x50e882;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x179'),_0xefa7('0x175'),_0xfdba32));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x17a')]=function(_0x50f157){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x17b'),_0x50f157[_0xefa7('0x34')]));var _0x121f6b=_0x50f157['recordingFormat']||_0xefa7('0x133');var _0x3ad358=util[_0xefa7('0x29')](_0xefa7('0x17c'),this['channel'][_0xefa7('0x38')],rs['generate'](0x5));var _0x3c0e66=util[_0xefa7('0x29')](_0xefa7('0x17d'),FILES_PATH,_0x3ad358,_0x121f6b);var _0x55e083=util[_0xefa7('0x29')](_0xefa7('0x134'),FILES_PATH,_0x3ad358);this['createSquareRecording']['sync'](this,_0x50f157,_0x3ad358,_0x3c0e66);this[_0xefa7('0xe')][_0xefa7('0xa5')](_0xefa7('0x17e'),_0x3ad358);logger['info'](_0xefa7('0x17f'),_0x55e083,_0x121f6b,_0x50f157[_0xefa7('0x180')],_0x50f157[_0xefa7('0x61')]);return this[_0xefa7('0xe')][_0xefa7('0x137')](_0x55e083,_0x121f6b,_0x50f157[_0xefa7('0x180')],_0x50f157['timeout'],undefined,!![]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x181')]=function(_0x109535){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x182'),_0x109535['label']));if(!this['isConfigured'](_0x109535[_0xefa7('0x60')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x183'));}var _0x5de881=this['restAPI']['sync'](this,_0x109535);logger['info'](util['format'](_0xefa7('0x184'),util['inspect'](_0x5de881,{'showHidden':![],'depth':null})));if(!this[_0xefa7('0x85')](_0x109535[_0xefa7('0xd7')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x185'));}var _0x3e02a2=this['getVariable']['sync'](this,_0x109535[_0xefa7('0xd7')]);if(!_0x3e02a2){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x109535,_0xefa7('0x11a'));}this[_0xefa7('0xe')]['setVariable'](util['format']('%s_STATUS_CODE',_0x3e02a2),_0x5de881['statusCode']?_0x5de881['statusCode']:_0xefa7('0x186'));this[_0xefa7('0xe')][_0xefa7('0xa5')](util[_0xefa7('0x29')](_0xefa7('0x187'),_0x3e02a2),_0x5de881[_0xefa7('0x75')]?_0x5de881[_0xefa7('0x75')]:'OK');if(_0x5de881[_0xefa7('0x68')]){try{this[_0xefa7('0x9c')](_0x5de881['body'],_0x3e02a2);}catch(_0x33dbb5){logger[_0xefa7('0x30')](util[_0xefa7('0x29')](_0xefa7('0x188'),_0x3e02a2));}}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0xdc'),_0x3e02a2));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x189')]=function(_0x348167){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x348167[_0xefa7('0x34')]));return this[_0xefa7('0xe')][_0xefa7('0x18a')](_0x348167[_0xefa7('0x18b')][_0xefa7('0xd5')](/\s+/g,''),_0x348167[_0xefa7('0x180')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x18c')]=function(_0x5097c0){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x18d'),_0x5097c0[_0xefa7('0x34')]));return this[_0xefa7('0xe')][_0xefa7('0x18e')](_0x5097c0[_0xefa7('0x62')][_0xefa7('0xd5')](/\s+/g,''),_0x5097c0[_0xefa7('0x180')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x18f')]=function(_0x121ca3){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x121ca3[_0xefa7('0x34')]));return this['channel']['sayPhonetic'](_0x121ca3['text'],_0x121ca3[_0xefa7('0x180')]);};AGIVertices[_0xefa7('0x10')][_0xefa7('0x190')]=function(_0x2d59bb){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x191'),_0x2d59bb[_0xefa7('0x34')]));if(!this['isConfigured'](_0x2d59bb[_0xefa7('0x192')])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0x193'));}var _0x16aae5=this[_0xefa7('0x21')][_0xefa7('0x6f')](this,_0x2d59bb[_0xefa7('0x192')]);if(!_0x16aae5||!_0x16aae5[_0xefa7('0x194')]){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x2d59bb,_0xefa7('0x195'));}var _0xede9a0={'from':util[_0xefa7('0x29')](_0xefa7('0x196'),_0x16aae5[_0xefa7('0x14')],_0x16aae5['email']||_0x16aae5[_0xefa7('0x194')]['user']),'to':_0x2d59bb['to']||'','cc':_0x2d59bb['cc']||'','bcc':_0x2d59bb['bcc']||'','subject':_0x2d59bb['subject'],'html':_0x2d59bb['text'],'text':_0x2d59bb[_0xefa7('0x58')]};var _0x1a6f60={'tls':{'rejectUnauthorized':![]}};if(_0x16aae5[_0xefa7('0x194')]['service']){_0x1a6f60[_0xefa7('0x197')]=_0x16aae5['Smtp'][_0xefa7('0x197')];}else{_0x1a6f60[_0xefa7('0x198')]=_0x16aae5[_0xefa7('0x194')][_0xefa7('0x198')];_0x1a6f60[_0xefa7('0x199')]=_0x16aae5[_0xefa7('0x194')][_0xefa7('0x199')];_0x1a6f60[_0xefa7('0x19a')]=_0x16aae5[_0xefa7('0x194')][_0xefa7('0x19a')];}if(_0x16aae5['Smtp']['authentication']){_0x1a6f60[_0xefa7('0x19b')]={'user':_0x16aae5['Smtp'][_0xefa7('0x19c')],'pass':_0x16aae5[_0xefa7('0x194')]['pass']};}if(this[_0xefa7('0x85')](_0x2d59bb[_0xefa7('0x19d')])){}logger[_0xefa7('0xde')](_0xefa7('0x19e'),JSON[_0xefa7('0x72')](_0xede9a0));this[_0xefa7('0x33')]['sync'](this,_0x2d59bb,_0x2d59bb[_0xefa7('0x192')]);this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x19f'),_0x16aae5[_0xefa7('0x14')]));this['sendMailMessage'][_0xefa7('0x6f')](this,_0x1a6f60,_0xede9a0);return this[_0xefa7('0xe')]['noop'](_0xefa7('0x1a0'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1a1')]=function(_0x537db1){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x1a2'),_0x537db1['label']));return this[_0xefa7('0xe')]['noop'](_0xefa7('0x1a3'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1a4')]=function(_0x5c0ec4){logger['info'](util[_0xefa7('0x29')](_0xefa7('0x1a5'),_0x5c0ec4[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x5c0ec4[_0xefa7('0x1a6')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x1a7'));}var _0xea7212=this[_0xefa7('0x1a8')][_0xefa7('0x6f')](this,_0x5c0ec4['sms_account_id']);if(!_0xea7212){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x5c0ec4,_0xefa7('0x1a9'));}var _0x32fe24={'body':_0x5c0ec4['sms_text'],'phone':_0x5c0ec4['to']||'','SmsAccountId':_0xea7212['id']};logger['debug'](_0xefa7('0x1aa'),JSON[_0xefa7('0x72')](_0x32fe24));this[_0xefa7('0x33')]['sync'](this,_0x5c0ec4,_0x5c0ec4[_0xefa7('0x1a6')]);this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0x1ab'),_0xea7212[_0xefa7('0x14')]));this[_0xefa7('0x32')][_0xefa7('0x6f')](this,_0x32fe24);return this['channel'][_0xefa7('0xa9')](_0xefa7('0x1ac'));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1ad')]=function(_0x30689a){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x1ae'),_0x30689a[_0xefa7('0x34')]));if(!this['isConfigured'](_0x30689a[_0xefa7('0xd7')])){return this[_0xefa7('0xe')]['error'](_0x30689a,'no\x20variable\x20selected');}var _0x106867=this[_0xefa7('0x11')]['sync'](this,_0x30689a[_0xefa7('0xd7')]);if(!_0x106867){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x30689a,_0xefa7('0x11a'));}return this[_0xefa7('0xe')][_0xefa7('0xa5')](_0x106867,_0x30689a['variable_value']);};AGIVertices['prototype'][_0xefa7('0x1af')]=function(_0x531b26){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20START\x20(%s)\x20block',_0x531b26[_0xefa7('0x34')]));this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x1b0'));if(_0x531b26['answer']===_0xefa7('0x1b1')){this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0x1b2'));return this[_0xefa7('0xe')]['answer']();}return this[_0xefa7('0xe')][_0xefa7('0xa9')]('Skipped\x20Answer');};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1b3')]=function(_0x2ffa12){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')](_0xefa7('0x1b4'),_0x2ffa12[_0xefa7('0x34')]));if(!this['isConfigured'](_0x2ffa12[_0xefa7('0x1b5')])){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x2ffa12,'no\x20subproject\x20selected');}var _0x1a872b=this['getSquareProject']['sync'](this,_0x2ffa12['project_id']);if(!this['isConfigured'](_0x1a872b)){return this['channel'][_0xefa7('0x30')](_0x2ffa12,util[_0xefa7('0x29')](_0xefa7('0x1b6'),_0x2ffa12[_0xefa7('0x1b5')]));}if(_0x1a872b===this['channel']['arg_1']){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x2ffa12,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x2ffa12,_0x1a872b);var _0x999bb2=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0x1b7'),util[_0xefa7('0x29')](_0xefa7('0x1b8'),config[_0xefa7('0xb9')][_0xefa7('0x198')]||'127.0.0.1',_0x1a872b,this['channel'][_0xefa7('0x1b9')]));if(_0x999bb2[_0xefa7('0xa3')]===-0x1){return _0x999bb2;}return this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x179'),_0xefa7('0x1b7'),_0x1a872b));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1ba')]=function(_0x52a8f6){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x52a8f6[_0xefa7('0x34')]));var _0x58d26e=this['shellCommand'][_0xefa7('0x6f')](this,_0x52a8f6[_0xefa7('0xbb')]);this[_0xefa7('0x33')][_0xefa7('0x6f')](this,_0x52a8f6,_0x52a8f6[_0xefa7('0xbb')]);if(this[_0xefa7('0x85')](_0x52a8f6[_0xefa7('0xd7')])){var _0x113a2f=this[_0xefa7('0x11')][_0xefa7('0x6f')](this,_0x52a8f6[_0xefa7('0xd7')]);if(_0x113a2f){this['channel'][_0xefa7('0xa5')](_0x113a2f,_0x58d26e);return this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0x1bb'),_0x52a8f6[_0xefa7('0xbb')],_0x113a2f));}}return this['channel'][_0xefa7('0xa9')](util['format'](_0xefa7('0x1bc'),_0x52a8f6['command']));};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1bd')]=function(_0x2a608f){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2a608f['label']));_0x2a608f[_0xefa7('0x58')]=_0x2a608f[_0xefa7('0x58')][_0xefa7('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xefa7('0x85')](_0x2a608f[_0xefa7('0x56')])){return this[_0xefa7('0xe')]['noop'](_0xefa7('0x1be'));}if(!this[_0xefa7('0x85')](_0x2a608f[_0xefa7('0x58')])){return this[_0xefa7('0xe')][_0xefa7('0xa9')](_0xefa7('0xaa'));}this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x1bf'),_0x2a608f[_0xefa7('0x58')]));var _0xbb0fd6=this[_0xefa7('0x55')]['sync'](this,_0x2a608f);if(_0xbb0fd6){this[_0xefa7('0xe')][_0xefa7('0xa9')](util['format'](_0xefa7('0x1c0'),_0xbb0fd6));var _0x3e8771=this[_0xefa7('0xe')]['streamFile'](_0xbb0fd6);try{fs[_0xefa7('0x104')](_0xbb0fd6+_0xefa7('0x105'));}catch(_0x5e9e5a){logger['error'](_0x5e9e5a);}return _0x3e8771;}return this['channel'][_0xefa7('0x30')](_0x2a608f,_0xefa7('0x1c1'));};AGIVertices[_0xefa7('0x10')]['tts']=function(_0x1752eb){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1752eb[_0xefa7('0x34')]));_0x1752eb[_0xefa7('0x58')]=_0x1752eb['text'][_0xefa7('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xefa7('0x85')](_0x1752eb[_0xefa7('0x58')])){return this[_0xefa7('0xe')]['noop']('no\x20text\x20configured');}this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x1752eb[_0xefa7('0x58')]));var _0x416527=this[_0xefa7('0x5d')]['sync'](this,_0x1752eb);if(_0x416527){this['channel']['noop'](util[_0xefa7('0x29')](_0xefa7('0x1c2'),_0x416527));var _0x3514a3=this[_0xefa7('0xe')][_0xefa7('0x103')](_0x416527);try{fs[_0xefa7('0x104')](_0x416527+_0xefa7('0x105'));}catch(_0x544d66){logger['error'](_0x544d66);}return _0x3514a3;}return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x1752eb,_0xefa7('0x1c3'));};AGIVertices[_0xefa7('0x10')]['unpause']=function(_0x16bd38){logger[_0xefa7('0x2b')](util[_0xefa7('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16bd38[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x16bd38[_0xefa7('0x158')])){return this['channel']['error'](_0x16bd38,_0xefa7('0x15e'));}logger['info'](util[_0xefa7('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xefa7('0xe')]['callerid'],_0x16bd38['findBy']));var _0x5d1db2=this[_0xefa7('0x4d')][_0xefa7('0x6f')](this,_0x16bd38['findBy']);if(_0x5d1db2){logger['info'](util[_0xefa7('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xefa7('0x36')],_0x16bd38[_0xefa7('0x158')]));this[_0xefa7('0xe')]['noop'](util[_0xefa7('0x29')](_0xefa7('0x15a'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x16bd38[_0xefa7('0x158')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xefa7('0x29')](_0xefa7('0x15c'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x16bd38['findBy']));this[_0xefa7('0xe')][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x15c'),this[_0xefa7('0xe')][_0xefa7('0x36')],_0x16bd38[_0xefa7('0x158')]));return{'code':0xc8,'result':_0xefa7('0x16c')};}};AGIVertices[_0xefa7('0x10')][_0xefa7('0x1c4')]=function(_0x217b51){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x217b51[_0xefa7('0x34')]));var _0x5acb9b=this[_0xefa7('0xe')][_0xefa7('0x53')](_0xefa7('0x1c5'),[_0x217b51[_0xefa7('0x1c6')],_0x217b51[_0xefa7('0x78')]]);if(_0x5acb9b[_0xefa7('0xa3')]===-0x1){return _0x5acb9b;}return this['channel'][_0xefa7('0xa9')](util[_0xefa7('0x29')](_0xefa7('0x179'),_0xefa7('0x1c5'),_0x217b51['mailbox']));};AGIVertices['prototype'][_0xefa7('0x1c7')]=function(_0x133c1c){logger['info'](util[_0xefa7('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x133c1c[_0xefa7('0x34')]));if(!this[_0xefa7('0x85')](_0x133c1c[_0xefa7('0xd7')])){return this['channel'][_0xefa7('0x30')](_0x133c1c,'no\x20variable\x20selected');}var _0x56362e=this[_0xefa7('0x11')][_0xefa7('0x6f')](this,_0x133c1c[_0xefa7('0xd7')]);if(!_0x56362e){return this[_0xefa7('0xe')][_0xefa7('0x30')](_0x133c1c,_0xefa7('0x11a'));}var _0x4e3db9=this[_0xefa7('0xe')]['getVariable'](_0x56362e);return{'code':0xc8,'result':_0x4e3db9[_0xefa7('0xa1')]?_0x4e3db9[_0xefa7('0xa1')]:'-'};};String[_0xefa7('0x10')][_0xefa7('0xa0')]=function(_0x299314,_0x2bc8e7){return this['split'](_0x299314)[_0xefa7('0x1c8')](_0x2bc8e7);};module['exports']=AGIVertices; \ No newline at end of file +var _0x4329=['aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','opts','url','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','SestekNDA\x20Result\x20%s','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','pass','sendMailMessage','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','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','join','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agentUnpause','agentLogout','agent','agentLogin','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MP3','googleTTS','google_tts_language','restAPI','method','number','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','awsLex','aws_secret_access_key','aws_lex_region'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x4329,0x13b));var _0x9432=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x4329[_0x3054be];return _0x3df150;};'use strict';var fs=require('fs');var path=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var _=require(_0x9432('0x2'));var sh=require(_0x9432('0x3'));var odbc=require(_0x9432('0x4'))();var rs=require(_0x9432('0x5'));var moment=require(_0x9432('0x6'));var Mustache=require(_0x9432('0x7'));var rp=require(_0x9432('0x8'));var logger=require(_0x9432('0x9'))(_0x9432('0xa'));var config=require(_0x9432('0xb'));var scripts=require(_0x9432('0xc'));var FILES_PATH=_0x9432('0xd');var recursiveMapAttributes=['rawHeaders',_0x9432('0xe')];var verticesWithRetry=['menu',_0x9432('0xf'),_0x9432('0x10')];var AGIVertices=function(_0x4eba63,_0xae38e1,_0x2b06c7){this[_0x9432('0x11')]=_0x4eba63;this[_0x9432('0x12')]=_0xae38e1;this[_0x9432('0x13')]=_0x2b06c7;};AGIVertices['prototype'][_0x9432('0x14')]=function(_0xaf17ce,_0x52ad58){this['rpc'][_0x9432('0x15')](_0xaf17ce)[_0x9432('0x16')](function(_0x1dffe6){_0x52ad58(null,_0x1dffe6?_0x1dffe6[_0x9432('0x17')]:![]);})['catch'](function(_0x1d8ca4){_0x52ad58(_0x1d8ca4);});};AGIVertices[_0x9432('0x18')][_0x9432('0x19')]=function(_0x2210d2,_0x4a9793){this['rpc'][_0x9432('0x1a')](_0x2210d2)[_0x9432('0x16')](function(_0x59f896){_0x4a9793(null,_0x59f896?_0x59f896[_0x9432('0x17')]:![]);})[_0x9432('0x1b')](function(_0x5678c4){_0x4a9793(_0x5678c4);});};AGIVertices[_0x9432('0x18')][_0x9432('0x1c')]=function(_0x5334fe,_0x5c4360){this['rpc']['getSquareProjectById'](_0x5334fe)['then'](function(_0x2eabe3){_0x5c4360(null,_0x2eabe3?_0x2eabe3[_0x9432('0x17')]:![]);})[_0x9432('0x1b')](function(_0x486cd6){_0x5c4360(_0x486cd6);});};AGIVertices[_0x9432('0x18')]['getSquareOdbc']=function(_0x18fd9d,_0x2f52a6){this[_0x9432('0x12')]['getSquareOdbcById'](_0x18fd9d)[_0x9432('0x16')](function(_0x1122ee){_0x2f52a6(null,_0x1122ee?_0x1122ee[_0x9432('0x1d')]:![]);})[_0x9432('0x1b')](function(_0xf62a59){_0x2f52a6(_0xf62a59);});};AGIVertices[_0x9432('0x18')][_0x9432('0x1e')]=function(_0x57721f,_0x47c4aa){this['rpc'][_0x9432('0x1f')](_0x57721f)[_0x9432('0x16')](function(_0xf1b400){_0x47c4aa(null,_0xf1b400?_0xf1b400[_0x9432('0x17')]:![]);})['catch'](function(_0x243225){_0x47c4aa(_0x243225);});};AGIVertices['prototype'][_0x9432('0x20')]=function(_0x68dc5c,_0x2de890){this[_0x9432('0x12')][_0x9432('0x21')](_0x68dc5c)[_0x9432('0x16')](function(_0x121cb9){_0x2de890(null,_0x121cb9?_0x121cb9[_0x9432('0x17')]:![]);})[_0x9432('0x1b')](function(_0x14627b){_0x2de890(_0x14627b);});};AGIVertices['prototype']['getSound']=function(_0x3bd58b,_0x4ba316){var _0x58c056=this;this[_0x9432('0x12')]['getSoundById'](_0x3bd58b)['then'](function(_0x3c8992){_0x4ba316(null,_0x3c8992?_0x58c056[_0x9432('0x22')](_0x3c8992[_0x9432('0x23')]):![]);})[_0x9432('0x1b')](function(_0x5d4f68){_0x4ba316(_0x5d4f68);});};AGIVertices['prototype'][_0x9432('0x24')]=function(_0x3d7504,_0x45f6ca){this[_0x9432('0x12')][_0x9432('0x25')](_0x3d7504)[_0x9432('0x16')](function(_0x2241d9){_0x45f6ca(null,_0x2241d9?_0x2241d9:![]);})[_0x9432('0x1b')](function(_0x27e078){_0x45f6ca(_0x27e078);});};AGIVertices['prototype']['sendMailMessage']=function(_0x522bdf,_0x6b6710,_0x3563ea){this['mailRpc']['sendMailMessage'](_0x522bdf,_0x6b6710)[_0x9432('0x16')](function(){_0x3563ea(null);})[_0x9432('0x1b')](function(_0x115155){_0x3563ea(_0x115155);});};AGIVertices['prototype'][_0x9432('0x26')]=function(_0x271e53,_0x354f47){this['rpc'][_0x9432('0x27')](_0x271e53)['then'](function(_0xbb02d2){if(_0xbb02d2){if(_0xbb02d2[_0x9432('0x28')]){_0x354f47(null,[_0xbb02d2['interval']]);}else{_0x354f47(null,_[_0x9432('0x29')](_0xbb02d2[_0x9432('0x2a')],_0x9432('0x2b')));}}else{_0x354f47(null,![]);}})[_0x9432('0x1b')](function(_0x5e1bbd){_0x354f47(_0x5e1bbd);});};AGIVertices[_0x9432('0x18')][_0x9432('0x22')]=function(_0x223984){return util[_0x9432('0x2c')](_0x9432('0x2d'),FILES_PATH,_0x223984);};AGIVertices['prototype']['getQueryOdbc']=function(_0x2a8df1,_0x39bffe,_0xfa7e38){odbc[_0x9432('0x2e')](_0x2a8df1,function(_0x2a16e0){if(_0x2a16e0){logger[_0x9432('0x2f')](_0x9432('0x30'),_0x2a16e0);_0xfa7e38(_0x2a16e0);}else{logger[_0x9432('0x31')]('ODBC\x20connection\x20successfully');odbc[_0x9432('0x32')](_0x39bffe,function(_0x157ca6,_0x3d064c){if(_0x157ca6){logger['info'](_0x9432('0x33'),_0x39bffe);_0xfa7e38(_0x157ca6);}else{logger['info'](_0x9432('0x34'),_0x39bffe);odbc['close'](function(_0x22c27b){if(_0x22c27b){logger['error'](_0x9432('0x35'),_0x22c27b);}_0xfa7e38(null,_0x3d064c);});}});}});};AGIVertices[_0x9432('0x18')][_0x9432('0x36')]=function(_0x5f5473,_0x32f10c){this[_0x9432('0x12')]['getSmsAccountById'](_0x5f5473)['then'](function(_0x189d62){_0x32f10c(null,_0x189d62?_0x189d62:![]);})[_0x9432('0x1b')](function(_0x3f6809){_0x32f10c(_0x3f6809);});};AGIVertices[_0x9432('0x18')][_0x9432('0x37')]=function(_0x4ecfc1,_0xa2ada0){this[_0x9432('0x12')]['createSmsMessage'](_0x4ecfc1)[_0x9432('0x16')](function(_0x110e87){_0xa2ada0(null,_0x110e87);})[_0x9432('0x1b')](function(_0x345dc9){_0xa2ada0(_0x345dc9);});};AGIVertices[_0x9432('0x18')][_0x9432('0x38')]=function(_0xc59ab,_0x2d44ca,_0x234258){this['rpc'][_0x9432('0x38')]({'uniqueid':this[_0x9432('0x11')][_0x9432('0x39')],'node':_0xc59ab[_0x9432('0x3a')],'application':_0xc59ab['agicommand'],'data':_0x2d44ca||null,'project_name':this['channel'][_0x9432('0x3b')],'callerid':this[_0x9432('0x11')][_0x9432('0x3c')]})[_0x9432('0x16')](function(_0x49a818){if(_0x234258){_0x234258(null,_0x49a818);}})[_0x9432('0x1b')](function(_0x403042){if(_0x234258){_0x234258(_0x403042);}});};AGIVertices[_0x9432('0x18')][_0x9432('0x3d')]=function(_0x2556c0,_0x405db3,_0x2ac6ae,_0x56558b){this[_0x9432('0x12')][_0x9432('0x3d')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x9432('0x11')][_0x9432('0x3c')],'calleridname':this['channel'][_0x9432('0x3e')],'context':this['channel'][_0x9432('0x3f')],'extension':this[_0x9432('0x11')][_0x9432('0x40')],'priority':this['channel']['priority'],'accountcode':this[_0x9432('0x11')]['accountcode'],'dnid':this[_0x9432('0x11')]['dnid'],'projectName':this['channel']['arg_1'],'saveName':_0x405db3,'filename':_0x2556c0[_0x9432('0x41')]||_0x405db3,'savePath':_0x2ac6ae})[_0x9432('0x16')](function(_0x51e2a3){_0x56558b(null,_0x51e2a3);})[_0x9432('0x1b')](function(_0x1f3d8f){_0x56558b(_0x1f3d8f);});};AGIVertices[_0x9432('0x18')][_0x9432('0x42')]=function(_0x1536b7,_0x5047f0,_0x2fcf4f,_0x52bc37,_0x22cebd){this[_0x9432('0x12')][_0x9432('0x42')]({'uniqueid':this[_0x9432('0x11')][_0x9432('0x39')],'body':_0x1536b7,'direction':_0x5047f0,'providerName':_0x2fcf4f,'providerResponse':_0x52bc37})[_0x9432('0x16')](function(_0x47c19e){if(_0x22cebd){_0x22cebd(null,_0x47c19e);}})[_0x9432('0x1b')](function(_0x2f6546){if(_0x22cebd){_0x22cebd(_0x2f6546);}});};AGIVertices[_0x9432('0x18')][_0x9432('0x43')]=function(_0x2e7757,_0x34ebe7){this['rpc'][_0x9432('0x43')]({'firstName':_[_0x9432('0x44')](_0x2e7757[_0x9432('0x17')])||_[_0x9432('0x45')](_0x2e7757['name'])?'callback_'+Math[_0x9432('0x46')]():_0x2e7757['name'],'lastName':_[_0x9432('0x44')](_0x2e7757['lastName'])||_['isNil'](_0x2e7757[_0x9432('0x47')])?null:_0x2e7757[_0x9432('0x47')],'phone':_0x2e7757[_0x9432('0x48')],'ListId':_0x2e7757[_0x9432('0x49')],'scheduledat':_0x2e7757[_0x9432('0x4a')],'callbackUniqueid':this['channel'][_0x9432('0x39')],'tags':'callback','description':_0x9432('0x4b')+_0x2e7757['scheduledAt'][_0x9432('0x4c')](),'priority':_0x2e7757['callback_priority']})[_0x9432('0x16')](function(_0x64306){_0x34ebe7(null,_0x64306);})[_0x9432('0x1b')](function(_0x46634d){_0x34ebe7(_0x46634d);});};AGIVertices['prototype'][_0x9432('0x4d')]=function(_0x4f9eb3,_0x3feddb){this[_0x9432('0x12')][_0x9432('0x4e')](_0x4f9eb3)['then'](function(_0x211fb7){_0x3feddb(null,_0x211fb7?_0x211fb7[_0x9432('0x17')]:![]);})[_0x9432('0x1b')](function(_0x126fa6){_0x3feddb(_0x126fa6);});};AGIVertices['prototype'][_0x9432('0x4f')]=function(_0x40733f,_0x43c7ad,_0x583a06){var _0x54062c={'role':'agent'};_0x54062c[_0x40733f]=this['channel'][_0x9432('0x3c')];this[_0x9432('0x12')][_0x9432('0x4f')](_0x54062c,_0x43c7ad,this[_0x9432('0x11')]['uniqueid'])[_0x9432('0x16')](function(_0xaef7a7){_0x583a06(null,_['isNil'](_0xaef7a7)?![]:!![]);})['catch'](function(_0x38fd9a){logger[_0x9432('0x2f')](_0x38fd9a);_0x583a06(null,![]);});};AGIVertices[_0x9432('0x18')][_0x9432('0x50')]=function(_0x225804,_0x283cdf){var _0x3724fc={'role':'agent'};_0x3724fc[_0x225804]=this[_0x9432('0x11')][_0x9432('0x3c')];this[_0x9432('0x12')]['agentUnpause'](_0x3724fc)['then'](function(_0x2eaec8){_0x283cdf(null,_[_0x9432('0x45')](_0x2eaec8)?![]:!![]);})['catch'](function(_0x3ab0f4){logger[_0x9432('0x2f')](_0x3ab0f4);_0x283cdf(null,![]);});};AGIVertices[_0x9432('0x18')][_0x9432('0x51')]=function(_0xedc81c,_0xe59a30){var _0xb146e2={'role':_0x9432('0x52')};_0xb146e2[_0xedc81c]=this[_0x9432('0x11')]['callerid'];this['rpc'][_0x9432('0x51')](_0xb146e2)[_0x9432('0x16')](function(_0x9e86ec){_0xe59a30(null,_[_0x9432('0x45')](_0x9e86ec)?![]:!![]);})[_0x9432('0x1b')](function(_0x1cd419){logger[_0x9432('0x2f')](_0x1cd419);_0xe59a30(null,![]);});};AGIVertices['prototype'][_0x9432('0x53')]=function(_0x43bbe8,_0x4c42e8){var _0x4ade28={'role':_0x9432('0x52')};_0x4ade28[_0x43bbe8]=this[_0x9432('0x11')][_0x9432('0x3c')];var _0x4e1020=_0x43bbe8!='internal'?util[_0x9432('0x2c')](_0x9432('0x54'),'LOCAL',this[_0x9432('0x11')][_0x9432('0x3c')]):undefined;this[_0x9432('0x12')][_0x9432('0x53')](_0x4ade28,_0x4e1020)[_0x9432('0x16')](function(_0x494224){_0x4c42e8(null,_[_0x9432('0x45')](_0x494224)?![]:!![]);})[_0x9432('0x1b')](function(_0x565324){logger[_0x9432('0x2f')](_0x565324);_0x4c42e8(null,![]);});};AGIVertices[_0x9432('0x18')]['shellCommand']=function(_0x1db52c,_0x4f5591){sh[_0x9432('0x55')](_[_0x9432('0x56')](_0x1db52c),function(_0x58db4d,_0x23fbb9){var _0x589d22=_0x23fbb9[_0x9432('0x57')](/(\r\n|\n|\r)/gm,'');_0x4f5591(null,_0x589d22);});};AGIVertices[_0x9432('0x18')][_0x9432('0x58')]=function(_0x5056ab,_0x1db20d){scripts[_0x9432('0x58')](_0x5056ab[_0x9432('0x59')],_0x5056ab['google_cloud_tts_text_type']||_0x9432('0x5a'),_0x5056ab['text'],_0x5056ab[_0x9432('0x5b')]||_0x9432('0x5c'),_0x5056ab[_0x9432('0x5d')]||'MALE',_0x5056ab['audioEncoding']||_0x9432('0x5e'))['then'](function(_0x1ba8ad){_0x1db20d(null,_0x1ba8ad);})['catch'](function(_0x52c4c6){_0x1db20d(_0x52c4c6);});};AGIVertices[_0x9432('0x18')][_0x9432('0x5f')]=function(_0x21901d,_0x5517aa){scripts[_0x9432('0x5f')](_0x21901d[_0x9432('0x5a')],_0x21901d[_0x9432('0x60')]||'en',0x1)[_0x9432('0x16')](function(_0x594ecc){_0x5517aa(null,_0x594ecc);})[_0x9432('0x1b')](function(_0x1de7e6){_0x5517aa(_0x1de7e6);});};AGIVertices['prototype'][_0x9432('0x61')]=function(_0x6eec0e,_0x4ba04c){var _0x214185={'uri':_0x6eec0e['url'],'method':_0x6eec0e[_0x9432('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x6eec0e['timeout'])===_0x9432('0x63')&&parseInt(_0x6eec0e[_0x9432('0x64')])>=0x1?parseInt(_0x6eec0e[_0x9432('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x9432('0x65')]([_0x9432('0x66'),_0x9432('0x67')],_0x214185[_0x9432('0x62')]['toUpperCase']())){try{_0x214185[_0x9432('0x68')]=_0x6eec0e[_0x9432('0xe')]?JSON[_0x9432('0x69')](_0x6eec0e[_0x9432('0xe')]):{};}catch(_0x24de57){logger[_0x9432('0x2f')](_0x9432('0x6a'),_0x24de57);}}try{_0x214185[_0x9432('0x6b')]=_0x6eec0e[_0x9432('0x6c')]?JSON['parse'](_0x6eec0e[_0x9432('0x6c')]):{};}catch(_0x2958b9){logger[_0x9432('0x2f')](_0x9432('0x6d'),_0x2958b9);}if(_0x6eec0e['computedVariables']){try{var _0xbd739f=require(_0x6eec0e[_0x9432('0x6e')])[_0x9432('0x6f')](this,_0x214185);_0x214185['uri']=Mustache[_0x9432('0x70')](_0x6eec0e['url'],_0xbd739f,{},['$$','$$']);if(_0x214185[_0x9432('0x6b')]){_0x214185[_0x9432('0x6b')]=JSON[_0x9432('0x69')](Mustache['render'](JSON[_0x9432('0x71')](_0x214185[_0x9432('0x6b')]),_0xbd739f,{},['$$','$$']));}if(_0x214185[_0x9432('0x68')]){_0x214185[_0x9432('0x68')]=JSON[_0x9432('0x69')](Mustache[_0x9432('0x70')](JSON[_0x9432('0x71')](_0x214185[_0x9432('0x68')]),_0xbd739f,{},['$$','$$']));}}catch(_0x446235){logger[_0x9432('0x2f')](_0x9432('0x72'),_0x446235);}}rp(_0x214185)[_0x9432('0x16')](function(_0x3b25e9){var _0x1e7f3b={'statusCode':_0x3b25e9[_0x9432('0x73')]||0xc8,'statusMessage':_0x3b25e9['statusMessage']||'OK','headers':_0x3b25e9[_0x9432('0x6b')]||{},'body':_0x3b25e9['body']||{}};_0x4ba04c(null,_0x1e7f3b);})[_0x9432('0x1b')](function(_0x372ee5){var _0x3a3272={'statusCode':_0x372ee5[_0x9432('0x73')]||0x1f4,'statusMessage':_0x372ee5['message']||_0x9432('0x74'),'headers':_0x372ee5[_0x9432('0x75')][_0x9432('0x6b')]||{},'body':_0x372ee5[_0x9432('0x75')][_0x9432('0x68')]||{}};_0x4ba04c(null,_0x3a3272);});};AGIVertices[_0x9432('0x18')]['googleDialogflow']=function(_0xcbb331,_0x5e83aa){scripts[_0x9432('0x76')](this[_0x9432('0x11')][_0x9432('0x39')],_0xcbb331[_0x9432('0x77')],_0xcbb331[_0x9432('0x5a')],_0xcbb331[_0x9432('0x78')]||'en')[_0x9432('0x16')](function(_0x14beaa){_0x5e83aa(null,_0x14beaa);})[_0x9432('0x1b')](function(_0x4fb65d){_0x5e83aa(_0x4fb65d);});};AGIVertices[_0x9432('0x18')][_0x9432('0x79')]=function(_0x433514,_0x49e171){scripts['googleDialogflowV2'](this[_0x9432('0x11')][_0x9432('0x39')],_0x433514[_0x9432('0x7a')],_0x433514[_0x9432('0x7b')],_0x433514['private_key'],_0x433514[_0x9432('0x5a')],_0x433514[_0x9432('0x7c')]||'en')['then'](function(_0xbc447f){_0x49e171(null,_0xbc447f);})['catch'](function(_0x2b9a45){_0x49e171(_0x2b9a45);});};AGIVertices[_0x9432('0x18')]['sestekNDA']=function(_0x11ba41,_0x5ee21b){scripts[_0x9432('0x7d')](this[_0x9432('0x11')],_0x11ba41)['then'](function(_0x1f018f){_0x5ee21b(null,_0x1f018f);})[_0x9432('0x1b')](function(_0x373f48){_0x5ee21b(_0x373f48);});};AGIVertices[_0x9432('0x18')][_0x9432('0x7e')]=function(_0x13ea90,_0x382a0e){scripts[_0x9432('0x7e')](_0x13ea90[_0x9432('0x77')],_0x13ea90[_0x9432('0x5a')],_0x13ea90['ispeech_tts_language']||_0x9432('0x5c'),_0x13ea90['speed'])['then'](function(_0x5ae6a2){_0x382a0e(null,_0x5ae6a2);})['catch'](function(_0x138931){_0x382a0e(_0x138931);});};AGIVertices[_0x9432('0x18')][_0x9432('0x7f')]=function(_0x3b310b,_0x494662,_0xe7528e){scripts['ispeechASR'](_0x494662,_0x3b310b[_0x9432('0x77')],_0x3b310b[_0x9432('0x80')]||'en-US',this['isConfigured'](_0x3b310b[_0x9432('0x81')])?_0x3b310b[_0x9432('0x81')]:undefined)[_0x9432('0x16')](function(_0x440513){_0xe7528e(null,_0x440513);})['catch'](function(_0x3d97b0){_0xe7528e(_0x3d97b0);});};AGIVertices['prototype'][_0x9432('0x82')]=function(_0x43b6e3,_0x1196c3){scripts[_0x9432('0x82')](_0x43b6e3[_0x9432('0x83')],_0x43b6e3['aws_secret_access_key'],_0x43b6e3[_0x9432('0x84')],_0x43b6e3['aws_polly_voice']||_0x9432('0x85'),_0x43b6e3[_0x9432('0x5a')],_0x43b6e3['aws_text_type']||_0x9432('0x5a'))[_0x9432('0x16')](function(_0x11f204){_0x1196c3(null,_0x11f204);})[_0x9432('0x1b')](function(_0x28d43c){_0x1196c3(_0x28d43c);});};AGIVertices[_0x9432('0x18')]['awsLex']=function(_0x44374a,_0x16e40c){scripts[_0x9432('0x86')](this[_0x9432('0x11')][_0x9432('0x39')],_0x44374a['aws_access_key_id'],_0x44374a[_0x9432('0x87')],_0x44374a[_0x9432('0x88')],_0x44374a['text'],_0x44374a[_0x9432('0x89')])[_0x9432('0x16')](function(_0x2d4bb5){_0x16e40c(null,_0x2d4bb5);})[_0x9432('0x1b')](function(_0x5e255d){_0x16e40c(_0x5e255d);});};AGIVertices[_0x9432('0x18')][_0x9432('0x8a')]=function(_0x9e5dcd,_0x14a9f4,_0x2c5291){scripts[_0x9432('0x8a')](_0x14a9f4,_0x9e5dcd['key'],_0x9e5dcd[_0x9432('0x8b')]||_0x9432('0x5c'))[_0x9432('0x16')](function(_0xb585ab){_0x2c5291(null,_0xb585ab);})[_0x9432('0x1b')](function(_0x14c4aa){_0x2c5291(_0x14c4aa);});};AGIVertices[_0x9432('0x18')][_0x9432('0x8c')]=function(_0x2943b5,_0xe1583f,_0x2c34c5){scripts[_0x9432('0x8c')](_0xe1583f,_0x2943b5[_0x9432('0x8d')],_0x2943b5[_0x9432('0x8e')],_0x2943b5[_0x9432('0x8f')])[_0x9432('0x16')](function(_0x3094cc){_0x2c34c5(null,_0x3094cc);})['catch'](function(_0x5bc361){_0x2c34c5(_0x5bc361);});};AGIVertices[_0x9432('0x18')][_0x9432('0x90')]=function(_0x3aba0b){var _0x3c85f8=_['includes'](verticesWithRetry,_0x3aba0b[_0x9432('0x91')])?_0x3aba0b:_[_0x9432('0x92')](_0x3aba0b);for(var _0x5a968d in _0x3c85f8){if(_0x3c85f8[_0x9432('0x93')](_0x5a968d)){if(_0x3c85f8[_0x5a968d]&&_['isString'](_0x3c85f8[_0x5a968d])){if(_['includes'](recursiveMapAttributes,_0x5a968d)){_0x3c85f8[_0x5a968d]=this[_0x9432('0x94')](_0x3c85f8[_0x5a968d]);}else{_0x3c85f8[_0x5a968d]=this[_0x9432('0x95')](_0x3c85f8[_0x5a968d]);}}}}return _0x3c85f8;};AGIVertices[_0x9432('0x18')][_0x9432('0x96')]=function(_0x24f7a3){for(var _0x3b681a in _0x24f7a3){if(_0x24f7a3[_0x9432('0x93')](_0x3b681a)){if(_[_0x9432('0x97')](_0x24f7a3[_0x3b681a])){this[_0x9432('0x96')](_0x24f7a3[_0x3b681a]);}else if(_[_0x9432('0x98')](_0x24f7a3[_0x3b681a])){for(var _0x51c667=0x0;_0x51c667<_0x24f7a3[_0x3b681a][_0x9432('0x99')];_0x51c667++){this[_0x9432('0x96')](_0x24f7a3[_0x3b681a][_0x51c667]);}}else if(_[_0x9432('0x9a')](_0x24f7a3[_0x3b681a])){_0x24f7a3[_0x3b681a]=this['replaceAllVariables'](_0x24f7a3[_0x3b681a]);}}}};AGIVertices[_0x9432('0x18')][_0x9432('0x9b')]=function(_0x4dc6a7,_0x3733fa){for(var _0xdfdbdd in _0x4dc6a7){if(_0x4dc6a7[_0x9432('0x93')](_0xdfdbdd)){if(_[_0x9432('0x97')](_0x4dc6a7[_0xdfdbdd])){if(!_[_0x9432('0x44')](_0x4dc6a7[_0xdfdbdd])){this['saveRestApiResult'](_0x4dc6a7[_0xdfdbdd],util[_0x9432('0x2c')](_0x9432('0x9c'),_0x3733fa,_0xdfdbdd));}}else if(_[_0x9432('0x98')](_0x4dc6a7[_0xdfdbdd])){for(var _0xc378f8=0x0;_0xc378f8<_0x4dc6a7[_0xdfdbdd][_0x9432('0x99')];_0xc378f8++){this[_0x9432('0x9b')](_0x4dc6a7[_0xdfdbdd][_0xc378f8],util[_0x9432('0x2c')](_0x9432('0x9c'),_0x3733fa,_0xdfdbdd+'['+_0xc378f8+']'));}}else{if(!_['isNil'](_0x4dc6a7[_0xdfdbdd])){this[_0x9432('0x11')][_0x9432('0x9d')](util['format'](_0x9432('0x9c'),_0x3733fa,_0xdfdbdd),_0x4dc6a7[_0xdfdbdd]);}}}}};AGIVertices[_0x9432('0x18')][_0x9432('0x94')]=function(_0xcebe68){try{var _0x34fdc6=JSON[_0x9432('0x69')](_0xcebe68);this['recursiveNodeIndex'](_0x34fdc6);return JSON[_0x9432('0x71')](_0x34fdc6);}catch(_0x7a19b9){return this[_0x9432('0x95')](_0xcebe68);}};AGIVertices[_0x9432('0x18')][_0x9432('0x95')]=function(_0x431777){var _0x59b4ec=_0x431777[_0x9432('0x9e')]('{');for(var _0x17fab7=0x1;_0x17fab7<_0x59b4ec[_0x9432('0x99')];_0x17fab7+=0x1){var _0xd6158f=_0x59b4ec[_0x17fab7][_0x9432('0x9e')]('}');if(_0xd6158f['length']>0x1){_0x431777=_0x431777[_0x9432('0x9f')]('{'+_0xd6158f[0x0]+'}',this[_0x9432('0x11')][_0x9432('0x14')](_0xd6158f[0x0])[_0x9432('0xa0')]||_0xd6158f[0x0]);}}if(_0x59b4ec[_0x9432('0x99')]===0x1){return _0x431777[_0x9432('0x4c')]();}return this['replaceAllVariables'](_0x431777);};AGIVertices[_0x9432('0x18')][_0x9432('0xa1')]=function(_0x3ec254,_0x5ab4ba){var _0x2f11fc=this[_0x9432('0x11')][_0x9432('0x14')](_0x3ec254);if(_0x2f11fc['result']===-0x1){return _0x2f11fc;}logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0xa2'),_0x5ab4ba,_0x2f11fc[_0x9432('0xa0')]));return this[_0x9432('0x11')][_0x9432('0x9d')](_0x5ab4ba,_0x2f11fc[_0x9432('0xa0')]);};AGIVertices[_0x9432('0x18')][_0x9432('0xa3')]=function(_0x437eb0){return _0x437eb0&&_0x437eb0!=='0'&&_0x437eb0!=='-1'&&_0x437eb0!=='';};AGIVertices[_0x9432('0x18')][_0x9432('0xa4')]=function(_0x1f637b){this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x1f637b,'-');_0x1f637b['retry']=_0x1f637b[_0x9432('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9432('0x18')][_0x9432('0xa5')]=function(_0x47db2e){logger['info'](util[_0x9432('0x2c')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x47db2e[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x47db2e[_0x9432('0x5a')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xa7'));}var _0x10a375='\x22'+_0x47db2e[_0x9432('0x5a')]+'\x22';if(this[_0x9432('0xa3')](_0x47db2e[_0x9432('0x75')])){_0x10a375+=','+_0x47db2e[_0x9432('0x75')];}var _0x232692=this[_0x9432('0x11')][_0x9432('0x55')](_0x9432('0xa8'),_0x10a375);if(_0x232692['result']===-0x1){return _0x232692;}return this['channel'][_0x9432('0xa6')](util[_0x9432('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x10a375));};AGIVertices[_0x9432('0x18')][_0x9432('0xa9')]=function(_0x1e8fd6){logger['info'](util[_0x9432('0x2c')](_0x9432('0xaa'),_0x1e8fd6['label']));if(!this['isConfigured'](_0x1e8fd6['grammar'])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xab'));}var _0x43532d=_0x1e8fd6['grammar'];if(this['isConfigured'](_0x1e8fd6['options'])){_0x43532d+=','+_0x1e8fd6['options'];}var _0x4e9815=this[_0x9432('0x11')][_0x9432('0x55')](_0x9432('0xac'),_0x43532d);if(_0x4e9815[_0x9432('0xad')]===-0x1){return _0x4e9815;}var _0x466f65=this[_0x9432('0xa1')](_0x9432('0xae'),_0x9432('0xaf'));if(_0x466f65[_0x9432('0xad')]===-0x1){return _0x466f65;}var _0x2205b9=this['getAndSetVariable'](_0x9432('0xb0'),_0x9432('0xb1'));if(_0x2205b9['result']===-0x1){return _0x2205b9;}var _0x592fff=this['getAndSetVariable'](_0x9432('0xb2'),_0x9432('0xb3'));if(_0x592fff[_0x9432('0xad')]===-0x1){return _0x592fff;}return this[_0x9432('0x11')][_0x9432('0xa6')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x43532d));};AGIVertices[_0x9432('0x18')][_0x9432('0xa')]=function(_0x4e5efd){logger['info'](util[_0x9432('0x2c')](_0x9432('0xb4'),_0x4e5efd[_0x9432('0x3a')]));return this[_0x9432('0x11')][_0x9432('0xa')]([_0x4e5efd[_0x9432('0xb5')],_0x4e5efd[_0x9432('0xb6')]]);};AGIVertices[_0x9432('0x18')]['answer']=function(_0x26afa5){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0xb7'),_0x26afa5[_0x9432('0x3a')]));if(this['isConfigured'](_0x26afa5[_0x9432('0x64')])){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0xb8'),_0x26afa5['timeout']));var _0x2f5484=this[_0x9432('0x11')][_0x9432('0xb9')](_0x26afa5['timeout']);if(_0x2f5484[_0x9432('0xad')]===-0x1){return _0x2f5484;}}return this[_0x9432('0x11')][_0x9432('0xba')]();};AGIVertices[_0x9432('0x18')]['callback']=function(_0xe6a573){logger['info'](util[_0x9432('0x2c')](_0x9432('0xbb'),_0xe6a573[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0xe6a573[_0x9432('0x49')])){return this['channel']['error'](_0xe6a573,_0x9432('0xbc'));}_0xe6a573['scheduledAt']=moment();if(this[_0x9432('0xa3')](_0xe6a573[_0x9432('0xbd')])){_0xe6a573['scheduledAt']=moment()['add'](_0xe6a573[_0x9432('0xbd')],_0x9432('0xbe'));}if(!this[_0x9432('0xa3')](_0xe6a573[_0x9432('0xbf')])){_0xe6a573[_0x9432('0xbf')]=0x2;}this['createCmContact'][_0x9432('0x6f')](this,_0xe6a573);return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xc0'),_0xe6a573[_0x9432('0x48')],_0xe6a573[_0x9432('0x49')],_0xe6a573['scheduledAt']));};AGIVertices['prototype']['custom_app']=function(_0x5f14a1){logger['info'](util[_0x9432('0x2c')](_0x9432('0xc1'),_0x5f14a1['label']));var _0x1aca7a=this[_0x9432('0x11')][_0x9432('0x55')](_0x5f14a1['application'],_0x5f14a1['options']);if(_0x1aca7a['result']===-0x1){return _0x1aca7a;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('Executed\x20command\x20%s\x20%s',_0x5f14a1[_0x9432('0xc2')],_0x5f14a1['options']));};AGIVertices[_0x9432('0x18')][_0x9432('0xc3')]=function(_0x187a6b){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0xc4'),_0x187a6b[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x187a6b[_0x9432('0x5a')])){return this['channel']['noop'](_0x9432('0xa7'));}var _0x4cdd1b='\x22'+_0x187a6b['text']+'\x22';if(this['isConfigured'](_0x187a6b[_0x9432('0x75')])){_0x4cdd1b+=','+_0x187a6b['options'];}var _0x35a0b2=this[_0x9432('0x11')]['exec']('MRCPSynth',_0x4cdd1b);if(_0x35a0b2[_0x9432('0xad')]===-0x1){return _0x35a0b2;}return this['channel'][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xc5'),_0x4cdd1b));};AGIVertices[_0x9432('0x18')][_0x9432('0xc6')]=function(_0x54ad87){logger[_0x9432('0x31')](util['format'](_0x9432('0xc7'),_0x54ad87['label']));if(!this[_0x9432('0xa3')](_0x54ad87[_0x9432('0x5a')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xa7'));}var _0x1f30dc='\x22'+_0x54ad87[_0x9432('0x5a')]+'\x22';if(this[_0x9432('0xa3')](_0x54ad87[_0x9432('0x75')])){_0x1f30dc+=','+_0x54ad87[_0x9432('0x75')];}var _0x31cf51=this['channel'][_0x9432('0x55')]('MRCPSynth',_0x1f30dc);if(_0x31cf51['result']===-0x1){return _0x31cf51;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xc5'),_0x1f30dc));};AGIVertices['prototype'][_0x9432('0xc8')]=function(_0x586a3c){logger[_0x9432('0x31')](util['format'](_0x9432('0xc9'),_0x586a3c['label']));if(!this['isConfigured'](_0x586a3c[_0x9432('0xca')])){return this['channel'][_0x9432('0xa6')](_0x9432('0xab'));}var _0x2905a9=_0x586a3c[_0x9432('0xca')];if(this[_0x9432('0xa3')](_0x586a3c['options'])){_0x2905a9+=','+_0x586a3c[_0x9432('0x75')];}var _0x46d6f2=this[_0x9432('0x11')]['exec'](_0x9432('0xac'),_0x2905a9);if(_0x46d6f2['result']===-0x1){return _0x46d6f2;}var _0x3d3357=this[_0x9432('0xa1')](_0x9432('0xae'),_0x9432('0xcb'));if(_0x3d3357[_0x9432('0xad')]===-0x1){return _0x3d3357;}var _0x52036b=this[_0x9432('0xa1')](_0x9432('0xb0'),_0x9432('0xcc'));if(_0x52036b[_0x9432('0xad')]===-0x1){return _0x52036b;}var _0x3cebeb=this['getAndSetVariable'](_0x9432('0xb2'),'LUMENVOX_ASR_INSTANCE');if(_0x3cebeb[_0x9432('0xad')]===-0x1){return _0x3cebeb;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xcd'),_0x2905a9));};AGIVertices[_0x9432('0x18')][_0x9432('0xce')]=function(_0x51f975){logger[_0x9432('0x31')](util['format'](_0x9432('0xcf'),_0x51f975[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x51f975[_0x9432('0xca')])){return this['channel']['noop'](_0x9432('0xab'));}var _0xfce5c7=_0x51f975[_0x9432('0xca')];if(this[_0x9432('0xa3')](_0x51f975['options'])){_0xfce5c7+=','+_0x51f975['options'];}var _0x23c662=this[_0x9432('0x11')][_0x9432('0x55')]('MRCPRecog',_0xfce5c7);if(_0x23c662[_0x9432('0xad')]===-0x1){return _0x23c662;}var _0x33b205=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9432('0xd0'));if(_0x33b205['result']===-0x1){return _0x33b205;}var _0x3ebf0c=this[_0x9432('0xa1')](_0x9432('0xb0'),_0x9432('0xd1'));if(_0x3ebf0c['result']===-0x1){return _0x3ebf0c;}var _0x3d9e98=this[_0x9432('0xa1')](_0x9432('0xb2'),_0x9432('0xd2'));if(_0x3d9e98['result']===-0x1){return _0x3d9e98;}return this[_0x9432('0x11')][_0x9432('0xa6')](util['format'](_0x9432('0xcd'),_0xfce5c7));};AGIVertices[_0x9432('0x18')]['database']=function(_0xc78d97){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0xc78d97[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0xc78d97[_0x9432('0xd3')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0xc78d97,'no\x20database\x20selected');}var _0x4b44c0=this[_0x9432('0xd4')][_0x9432('0x6f')](this,_0xc78d97[_0x9432('0xd3')]);if(!_0x4b44c0){return this['channel'][_0x9432('0x2f')](_0xc78d97,_0x9432('0xd5'));}if(!this[_0x9432('0xa3')](_0xc78d97['query'])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0xc78d97,_0x9432('0xd6'));}var _0x8aeecf=_0xc78d97[_0x9432('0x32')][_0x9432('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('query:\x20%s',_0x8aeecf));var _0x352008=this[_0x9432('0xd7')][_0x9432('0x6f')](this,_0x4b44c0,_0x8aeecf);this[_0x9432('0x38')][_0x9432('0x6f')](this,_0xc78d97,_0x8aeecf);if(!this[_0x9432('0xa3')](_0xc78d97[_0x9432('0xd8')])){return this['channel'][_0x9432('0xa6')](_0x9432('0xd9'));}var _0x1c48dd=this[_0x9432('0x14')][_0x9432('0x6f')](this,_0xc78d97[_0x9432('0xd8')]);if(!_0x1c48dd){return this[_0x9432('0x11')]['error'](_0xc78d97,_0x9432('0xda'));}var _0x225fe1=this;_0x352008[_0x9432('0xdb')](function(_0x26549b,_0x55e33a){Object[_0x9432('0xdc')](_0x26549b)['forEach'](function(_0x42ce2b){_0x225fe1[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')](_0x9432('0xdd'),_0x1c48dd,_0x55e33a,_0x42ce2b),_0x26549b[_0x42ce2b]);});});this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')](_0x9432('0xde'),_0x1c48dd),_0x352008[_0x9432('0x99')]);return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('variable\x20%s\x20set',_0x1c48dd));};AGIVertices[_0x9432('0x18')]['dial']=function(_0x5cf0a6){logger[_0x9432('0xdf')](util[_0x9432('0x2c')](_0x9432('0xe0'),_0x5cf0a6[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x5cf0a6[_0x9432('0xe1')])){return this[_0x9432('0x11')]['error'](_0x5cf0a6,'no\x20user\x20selected');}var _0x48b593=this[_0x9432('0x1e')][_0x9432('0x6f')](this,_0x5cf0a6['sip_id']);if(!_0x48b593){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x5cf0a6,_0x9432('0xe2'));}var _0x7c8551=this[_0x9432('0x11')][_0x9432('0x55')]('DIAL',[util[_0x9432('0x2c')]('SIP/%s',_0x48b593),_0x5cf0a6[_0x9432('0x64')],_0x5cf0a6[_0x9432('0xe3')],_0x5cf0a6[_0x9432('0xe4')]]);if(_0x7c8551['result']===-0x1){return _0x7c8551;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xe5'),_0x9432('0xe6')));};AGIVertices[_0x9432('0x18')][_0x9432('0xe7')]=function(_0x4779c2){logger[_0x9432('0x31')](util['format'](_0x9432('0xe8'),_0x4779c2[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x4779c2[_0x9432('0x77')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xe9'));}if(!this[_0x9432('0xa3')](_0x4779c2[_0x9432('0x5a')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xa7'));}this[_0x9432('0x11')][_0x9432('0xea')]=!![];this['createSquareDetailsReport'](_0x4779c2);this[_0x9432('0x42')](_0x4779c2[_0x9432('0x5a')],'in','','');this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')](_0x9432('0xeb'),_0x4779c2[_0x9432('0x5a')]));var _0x50ec84=this[_0x9432('0x76')]['sync'](this,_0x4779c2);if(_0x50ec84){for(var _0x303f4a in _0x50ec84){if(_0x50ec84[_0x9432('0x93')](_0x303f4a)){this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')](_0x9432('0xec'),_0x303f4a[_0x9432('0xed')]()),_0x50ec84[_0x303f4a]);}}this[_0x9432('0x42')](_0x50ec84[_0x9432('0xee')],_0x9432('0xef'),'dialogflow','');return this[_0x9432('0x11')]['noop'](util['format'](_0x9432('0xf0'),_0x50ec84[_0x9432('0xee')]));}return this['channel'][_0x9432('0x2f')](_0x4779c2,_0x9432('0xf1'));};AGIVertices['prototype']['dialogflowV2']=function(_0x14b932){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x14b932['label']));if(!this[_0x9432('0xa3')](_0x14b932['dialogflowV2_project_id'])){return this['channel'][_0x9432('0xa6')](_0x9432('0xf2'));}if(!this[_0x9432('0xa3')](_0x14b932[_0x9432('0x7b')])){return this['channel'][_0x9432('0xa6')](_0x9432('0xf3'));}if(!this[_0x9432('0xa3')](_0x14b932[_0x9432('0xf4')])){return this['channel'][_0x9432('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x9432('0xa3')](_0x14b932['dialogflowV2_language'])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xf5'));}if(!this[_0x9432('0xa3')](_0x14b932[_0x9432('0x5a')])){return this[_0x9432('0x11')]['noop'](_0x9432('0xa7'));}this[_0x9432('0x11')]['bot']=!![];this[_0x9432('0x38')](_0x14b932);this['createSquareMessage'](_0x14b932[_0x9432('0x5a')],'in','','');this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('Trying\x20DialogflowV2:\x20%s',_0x14b932['text']));var _0x16d332=this['googleDialogflowV2'][_0x9432('0x6f')](this,_0x14b932);if(_0x16d332){for(var _0x314093 in _0x16d332){if(_0x16d332['hasOwnProperty'](_0x314093)){if(_0x314093!==_0x9432('0xf6')){this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')]('DIALOGFLOW_%s',_0x314093[_0x9432('0xed')]()),_0x16d332[_0x314093]);}}}this[_0x9432('0x42')](_0x16d332[_0x9432('0xee')],_0x9432('0xef'),_0x9432('0xf7'),_0x16d332[_0x9432('0xf6')]);return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0xf8'),_0x16d332[_0x9432('0xee')]));}return this['channel'][_0x9432('0x2f')](_0x14b932,_0x9432('0xf9'));};AGIVertices[_0x9432('0x18')][_0x9432('0xfa')]=function(_0x5e7d2b){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0xfb'),_0x5e7d2b[_0x9432('0x3a')]));if(!this['isConfigured'](_0x5e7d2b['ndauth_url'])){return this[_0x9432('0x11')]['noop'](_0x9432('0xfc'));}if(!this['isConfigured'](_0x5e7d2b[_0x9432('0xfd')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xfe'));}if(!this['isConfigured'](_0x5e7d2b['password'])){return this[_0x9432('0x11')][_0x9432('0xa6')]('no\x20password\x20configured');}if(!this[_0x9432('0xa3')](_0x5e7d2b[_0x9432('0xff')])){return this['channel']['noop'](_0x9432('0xa7'));}this['channel'][_0x9432('0xea')]=!![];this['createSquareDetailsReport'](_0x5e7d2b);this[_0x9432('0x42')](_0x5e7d2b[_0x9432('0x5a')],'in','','');this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x100'),_0x5e7d2b[_0x9432('0x5a')]));var _0x28a5b1=this[_0x9432('0x7d')][_0x9432('0x6f')](this,_0x5e7d2b);if(_0x28a5b1){for(var _0x4235e9 in _0x28a5b1){if(_0x28a5b1[_0x9432('0x93')](_0x4235e9)){this[_0x9432('0x11')]['setVariable'](util[_0x9432('0x2c')](_0x9432('0x101'),_0x4235e9['toUpperCase']()),_0x28a5b1[_0x4235e9]);}}this[_0x9432('0x42')](_0x28a5b1[_0x9432('0xee')],_0x9432('0xef'),'sesteknda','');if(_0x28a5b1['audiofile']){this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')](_0x9432('0x102'),_0x28a5b1['audiofile']));var _0x5836e5=this[_0x9432('0x11')]['streamFile'](_0x28a5b1[_0x9432('0x103')]);try{fs[_0x9432('0x104')](_0x28a5b1[_0x9432('0x103')]+'.wav');}catch(_0x1eac4b){logger[_0x9432('0x2f')](_0x1eac4b);}return _0x5836e5;}else{return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x105'),_0x28a5b1[_0x9432('0xee')]));}}return this[_0x9432('0x11')][_0x9432('0x2f')](_0x5e7d2b,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x9432('0x18')][_0x9432('0x106')]=function(_0x59f6e1){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x59f6e1[_0x9432('0x3a')]));return this[_0x9432('0x11')]['noop']('end');};AGIVertices[_0x9432('0x18')]['ext_dial']=function(_0x10bb39){logger[_0x9432('0x31')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x10bb39[_0x9432('0x3a')]));var _0x6ede5='';if(_0x10bb39[_0x9432('0x107')]){if(!this[_0x9432('0xa3')](_0x10bb39['trunk_id'])){return this[_0x9432('0x11')]['error'](_0x10bb39,_0x9432('0x108'));}else{var _0x72b5ac=parseInt(_0x10bb39[_0x9432('0x107')],0xa);if(isNaN(_0x72b5ac)){_0x6ede5=_0x10bb39[_0x9432('0x107')];}else{_0x6ede5=this['getTrunk'][_0x9432('0x6f')](this,_0x10bb39[_0x9432('0x107')]);if(!_0x6ede5){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x10bb39,_0x9432('0x109'));}}}}else if(_0x10bb39[_0x9432('0x10a')]){_0x6ede5=_0x10bb39['trunk_name'];}else{return this[_0x9432('0x11')][_0x9432('0x2f')](_0x10bb39,_0x9432('0x108'));}var _0x259325=this[_0x9432('0x11')][_0x9432('0x55')]('DIAL',[util[_0x9432('0x2c')](_0x9432('0x10b'),_0x6ede5,_0x10bb39[_0x9432('0x48')]),_0x10bb39[_0x9432('0x64')],_0x10bb39[_0x9432('0xe3')],_0x10bb39[_0x9432('0xe4')]]);if(_0x259325[_0x9432('0xad')]===-0x1){return _0x259325;}return this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')](_0x9432('0xe5'),'DIAL'));};AGIVertices[_0x9432('0x18')][_0x9432('0x10c')]=function(_0x4fe340){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x10d'),_0x4fe340[_0x9432('0x3a')]));return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x10c'));};AGIVertices[_0x9432('0x18')]['getdigits']=function(_0x2e5b3a){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x10e'),_0x2e5b3a[_0x9432('0x3a')]));if(_0x2e5b3a['retry']===0x0){return this[_0x9432('0xa4')](_0x2e5b3a);}_0x2e5b3a[_0x9432('0x10f')]-=0x1;if(!this[_0x9432('0xa3')](_0x2e5b3a[_0x9432('0x110')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2e5b3a,_0x9432('0x111'));}var _0xc5f69a=this[_0x9432('0x112')][_0x9432('0x6f')](this,_0x2e5b3a[_0x9432('0x110')]);if(!_0xc5f69a){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2e5b3a,_0x9432('0x113'));}if(!this[_0x9432('0xa3')](_0x2e5b3a['variable_id'])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x9432('0xd9'));}var _0x6ec7a9=this[_0x9432('0x11')]['getData'](_0xc5f69a,_0x2e5b3a['response'],_0x2e5b3a[_0x9432('0x114')]);var _0x34a277=_0x6ec7a9[_0x9432('0xad')]?_0x6ec7a9[_0x9432('0xad')][_0x9432('0x4c')]():'';logger[_0x9432('0x31')]('test',JSON['stringify'](_0x6ec7a9));if(_0x6ec7a9[_0x9432('0xad')]===-0x1){this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2e5b3a,_0x34a277);return _0x6ec7a9;}else if(_0x6ec7a9[_0x9432('0xa0')]===_0x9432('0x64')){_0x6ec7a9[_0x9432('0xad')]=_0x34a277[_0x9432('0x99')]>=parseInt(_0x2e5b3a[_0x9432('0x115')])?'x':'i';}else{_0x6ec7a9[_0x9432('0xad')]=_0x34a277[_0x9432('0x99')]>=parseInt(_0x2e5b3a[_0x9432('0x115')])&&_0x34a277[_0x9432('0x99')]<=parseInt(_0x2e5b3a[_0x9432('0x114')])?'x':'i';}var _0x4eac02=this[_0x9432('0x14')]['sync'](this,_0x2e5b3a[_0x9432('0xd8')]);if(!_0x4eac02){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2e5b3a,_0x9432('0xda'));}this[_0x9432('0x11')]['setVariable'](_0x4eac02,_0x34a277);if(this[_0x9432('0xa3')](_0x2e5b3a[_0x9432('0x116')])){var _0x1ba6c0=parseInt(_0x2e5b3a[_0x9432('0x116')],0xa);var _0x2354c7=rs[_0x9432('0x117')]({'charset':'*','length':_0x1ba6c0});var _0x1cfa94=_0x34a277[_0x9432('0x99')];if(_0x1cfa94>0x0){if(_0x1cfa94>_0x1ba6c0){this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2e5b3a,_0x2e5b3a[_0x9432('0x118')]==='first'?_0x2354c7+_0x34a277[_0x9432('0x119')](_0x1ba6c0):_0x34a277['substr'](0x0,_0x1cfa94-_0x1ba6c0)+_0x2354c7);}else{this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2e5b3a,rs['generate']({'charset':'*','length':_0x1cfa94}));}}else{this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2e5b3a,'');}}else{this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2e5b3a,_0x34a277);}return _0x6ec7a9;};AGIVertices['prototype']['getsecretdigits']=function(_0x41ab02){logger[_0x9432('0x31')](util['format'](_0x9432('0x11a'),_0x41ab02[_0x9432('0x3a')]));return this[_0x9432('0xf')](_0x41ab02);};AGIVertices[_0x9432('0x18')][_0x9432('0x11b')]=function(_0x42e572){logger['info'](util[_0x9432('0x2c')](_0x9432('0x11c'),_0x42e572[_0x9432('0x3a')]));this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x42e572,_0x42e572[_0x9432('0x11d')]);return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x11e'),_0x42e572[_0x9432('0x11d')]));};AGIVertices[_0x9432('0x18')][_0x9432('0x11f')]=function(_0x1f0a93){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1f0a93[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x1f0a93[_0x9432('0x83')])||!this[_0x9432('0xa3')](_0x1f0a93[_0x9432('0x87')])){return this['channel'][_0x9432('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x1f0a93[_0x9432('0x5a')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xa7'));}this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x120'),_0x1f0a93[_0x9432('0x5a')]));var _0xfa2f04=this[_0x9432('0x82')][_0x9432('0x6f')](this,_0x1f0a93);if(_0xfa2f04){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x121'),_0xfa2f04));var _0x3d7d6a=this[_0x9432('0x11')][_0x9432('0x122')](_0xfa2f04);try{fs[_0x9432('0x104')](_0xfa2f04+_0x9432('0x123'));}catch(_0x68b5eb){logger[_0x9432('0x2f')](_0x68b5eb);}return _0x3d7d6a;}return this['channel'][_0x9432('0x2f')](_0x1f0a93,_0x9432('0x124'));};AGIVertices[_0x9432('0x18')][_0x9432('0x125')]=function(_0x2e163c){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x126'),_0x2e163c[_0x9432('0x3a')]));if(!this['isConfigured'](_0x2e163c[_0x9432('0x83')])||!this[_0x9432('0xa3')](_0x2e163c['aws_secret_access_key'])){return this[_0x9432('0x11')]['noop'](_0x9432('0x127'));}if(!this[_0x9432('0xa3')](_0x2e163c['aws_bot_name'])){return this[_0x9432('0x11')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x9432('0xa3')](_0x2e163c[_0x9432('0x5a')])){return this[_0x9432('0x11')]['noop']('no\x20text\x20configured');}this[_0x9432('0x11')]['bot']=!![];this[_0x9432('0x38')](_0x2e163c);this[_0x9432('0x42')](_0x2e163c[_0x9432('0x5a')],'in','','');this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')](_0x9432('0x128'),_0x2e163c[_0x9432('0x5a')]));var _0x234c52=this[_0x9432('0x86')][_0x9432('0x6f')](this,_0x2e163c);if(_0x234c52){for(var _0x2badbb in _0x234c52){if(_0x234c52[_0x9432('0x93')](_0x2badbb)&&_['isString'](_0x234c52[_0x2badbb])){this[_0x9432('0x11')]['setVariable'](util[_0x9432('0x2c')](_0x9432('0x129'),_0x2badbb[_0x9432('0xed')]()),_0x234c52[_0x2badbb]);}}if(_[_0x9432('0x45')](_0x234c52['message'])){return this[_0x9432('0x11')][_0x9432('0xa6')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x9432('0x42')](_0x234c52[_0x9432('0x12a')],_0x9432('0xef'),'amazonlex','');return this['channel'][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x12b'),_0x234c52[_0x9432('0x12a')]));}}return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2e163c,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9432('0x18')][_0x9432('0x12c')]=function(_0xfa52a7){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x12d'),_0xfa52a7[_0x9432('0x3a')],_0xfa52a7[_0x9432('0x64')]));if(!this[_0x9432('0xa3')](_0xfa52a7[_0x9432('0x77')])){return this[_0x9432('0x11')]['noop'](_0x9432('0xe9'));}var _0x24c154=_0x9432('0x12e');var _0xb8239=util[_0x9432('0x2c')](_0x9432('0x12f'),FILES_PATH,rs[_0x9432('0x117')](0x4));var _0x1f3c6c=util['format'](_0x9432('0x9c'),_0xb8239,_0x24c154);var _0x169235=!![];if(_0xfa52a7[_0x9432('0x130')]===_0x9432('0x131')){_0x169235=![];}var _0x50a71f=this[_0x9432('0x11')][_0x9432('0x132')](_0xb8239,_0x24c154,_0xfa52a7[_0x9432('0x133')],_0xfa52a7[_0x9432('0x64')],undefined,_0x169235);if(_0x50a71f[_0x9432('0xad')]!==-0x1){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x134'),_0x1f3c6c));var _0xd7cf9a=this[_0x9432('0x8a')][_0x9432('0x6f')](this,_0xfa52a7,_0x1f3c6c);if(_0xd7cf9a){for(var _0xb860fb in _0xd7cf9a){if(_0xd7cf9a['hasOwnProperty'](_0xb860fb)){this['channel'][_0x9432('0x9d')](util[_0x9432('0x2c')](_0x9432('0x135'),_0xb860fb[_0x9432('0xed')]()),_0xd7cf9a[_0xb860fb]);}}return this['channel']['noop'](util[_0x9432('0x2c')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0xd7cf9a)));}}return _0x50a71f;};AGIVertices[_0x9432('0x18')][_0x9432('0x136')]=function(_0x127b49){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x127b49[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x127b49['appid'])){return this[_0x9432('0x11')]['noop']('no\x20appid\x20configured');}if(!this[_0x9432('0xa3')](_0x127b49[_0x9432('0x8e')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x137'));}var _0x4ec100=_0x9432('0x12e');var _0x58e497=util['format'](_0x9432('0x12f'),FILES_PATH,rs[_0x9432('0x117')](0x4));var _0x394a79=util[_0x9432('0x2c')]('%s.%s',_0x58e497,_0x4ec100);var _0x2e52ed=!![];if(_0x127b49[_0x9432('0x130')]===_0x9432('0x131')){_0x2e52ed=![];}var _0x33eb5d=this['channel'][_0x9432('0x132')](_0x58e497,_0x4ec100,_0x127b49[_0x9432('0x133')],_0x127b49[_0x9432('0x64')],undefined,_0x2e52ed);if(_0x33eb5d[_0x9432('0xad')]!==-0x1){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x138'),_0x394a79));var _0x1f6fde=this['tildeASR']['sync'](this,_0x127b49,_0x394a79);if(_0x1f6fde){for(var _0x27dce2 in _0x1f6fde){if(_0x1f6fde['hasOwnProperty'](_0x27dce2)){this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')]('TILDE_ASR_%s',_0x27dce2[_0x9432('0xed')]()),_0x1f6fde[_0x27dce2]);}}return this[_0x9432('0x11')]['noop'](util['format'](_0x9432('0x139'),JSON[_0x9432('0x71')](_0x1f6fde)));}}return _0x33eb5d;};AGIVertices[_0x9432('0x18')]['gotoc']=function(_0x2f1cde){logger['info'](util[_0x9432('0x2c')](_0x9432('0x13a'),_0x2f1cde[_0x9432('0x3a')]));return this[_0x9432('0x11')][_0x9432('0x13b')](_0x2f1cde['context'],_0x2f1cde[_0x9432('0x40')],_0x2f1cde[_0x9432('0x13c')]);};AGIVertices[_0x9432('0x18')][_0x9432('0x13d')]=function(_0x5ab006){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x13e'),_0x5ab006[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x5ab006[_0x9432('0x13f')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x5ab006,_0x9432('0x140'));}try{var _0x5dbd56=eval(_0x5ab006[_0x9432('0x13f')])?_0x9432('0x141'):_0x9432('0x142');this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x143'),_0x5ab006['condition'],_0x5dbd56));return{'code':0xc8,'result':_0x5dbd56};}catch(_0x1b4aa6){return{'code':0xc8,'result':_0x9432('0x142')};}};AGIVertices[_0x9432('0x18')]['gotoiftime']=function(_0x4a8abb){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x144'),_0x4a8abb[_0x9432('0x3a')]));if(!this['isConfigured'](_0x4a8abb['interval_id'])){return this['channel'][_0x9432('0x2f')](_0x4a8abb,'no\x20interval\x20configured');}var _0x10153a=this[_0x9432('0x26')][_0x9432('0x6f')](this,_0x4a8abb['interval_id']);if(!_0x10153a){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x4a8abb,_0x9432('0x145'));}for(var _0x591242=0x0;_0x591242<_0x10153a['length'];_0x591242+=0x1){var _0x214d9d=this['channel'][_0x9432('0x14')](util[_0x9432('0x2c')](_0x9432('0x146'),_0x10153a[_0x591242]));if(_0x214d9d[_0x9432('0xad')]===-0x1){return _0x214d9d;}logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x147'),_0x10153a[_0x591242],_0x214d9d[_0x9432('0xa0')]));if(_0x214d9d[_0x9432('0xa0')]===_0x9432('0x141')){logger[_0x9432('0x31')](util['format'](_0x9432('0x147'),_0x10153a[_0x591242],_0x9432('0x141')));this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('IFTIME\x20%s\x20%s',_0x10153a[_0x591242],_0x9432('0x141')));return{'code':0xc8,'result':_0x9432('0x141')};}else{logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x147'),_0x10153a[_0x591242],_0x9432('0x142')));this['channel'][_0x9432('0xa6')](util['format'](_0x9432('0x147'),_0x10153a[_0x591242],'false'));}}return{'code':0xc8,'result':_0x9432('0x142')};};AGIVertices[_0x9432('0x18')][_0x9432('0x148')]=function(_0x397259){logger['info'](util[_0x9432('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x397259[_0x9432('0x3a')]));return this[_0x9432('0x11')][_0x9432('0x148')]();};AGIVertices[_0x9432('0x18')]['ispeechasr']=function(_0x3a8131){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x149'),_0x3a8131[_0x9432('0x3a')]));if(!this['isConfigured'](_0x3a8131[_0x9432('0x77')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xe9'));}var _0x19797e=_0x9432('0x12e');var _0xfcfdda=util[_0x9432('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x9432('0x117')](0x4));var _0x28ea16=util[_0x9432('0x2c')](_0x9432('0x9c'),_0xfcfdda,_0x19797e);var _0x520eae=!![];if(_0x3a8131[_0x9432('0x130')]==='NOBEEP'){_0x520eae=![];}var _0x11815=this['channel'][_0x9432('0x132')](_0xfcfdda,_0x19797e,_0x3a8131[_0x9432('0x133')],_0x3a8131[_0x9432('0x64')],undefined,_0x520eae);if(_0x11815[_0x9432('0xad')]!==-0x1){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x14a'),_0x28ea16));var _0x46bbb0=this[_0x9432('0x7f')][_0x9432('0x6f')](this,_0x3a8131,_0x28ea16);if(_0x46bbb0){for(var _0x41b8de in _0x46bbb0){if(_0x46bbb0[_0x9432('0x93')](_0x41b8de)){this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')]('ISPEECH_ASR_%s',_0x41b8de[_0x9432('0xed')]()),_0x46bbb0[_0x41b8de]);}}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x14b'),JSON[_0x9432('0x71')](_0x46bbb0)));}}return _0x11815;};AGIVertices['prototype']['ispeechtts']=function(_0x3ae2d7){logger['info'](util[_0x9432('0x2c')](_0x9432('0x14c'),_0x3ae2d7[_0x9432('0x3a')]));if(!this['isConfigured'](_0x3ae2d7[_0x9432('0x77')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xe9'));}if(!this[_0x9432('0xa3')](_0x3ae2d7[_0x9432('0x5a')])){return this['channel']['noop'](_0x9432('0xa7'));}this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x14d'),_0x3ae2d7['text']));var _0x6895af=this[_0x9432('0x7e')][_0x9432('0x6f')](this,_0x3ae2d7);if(_0x6895af){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x14a'),_0x6895af));var _0x331a78=this['channel'][_0x9432('0x122')](_0x6895af,_0x3ae2d7['intKey']);try{fs[_0x9432('0x104')](_0x6895af+'.wav');}catch(_0x23431e){logger[_0x9432('0x2f')](_0x23431e);}return _0x331a78;}return this['channel']['error'](_0x3ae2d7,_0x9432('0x14e'));};AGIVertices[_0x9432('0x18')][_0x9432('0x14f')]=function(_0x39e7c4){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x39e7c4[_0x9432('0x3a')]));if(!this['isConfigured'](_0x39e7c4[_0x9432('0x150')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x39e7c4,'no\x20find\x20by\x20configured');}logger['info'](util[_0x9432('0x2c')](_0x9432('0x151'),this['channel'][_0x9432('0x3c')],_0x39e7c4[_0x9432('0x150')]));var _0x2099fe=this[_0x9432('0x53')][_0x9432('0x6f')](this,_0x39e7c4[_0x9432('0x150')]);if(_0x2099fe){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x152'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x39e7c4['findBy']));this[_0x9432('0x11')]['noop'](util['format'](_0x9432('0x152'),this[_0x9432('0x11')]['callerid'],_0x39e7c4[_0x9432('0x150')]));return{'code':0xc8,'result':_0x9432('0x153')};}else{logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x154'),this['channel'][_0x9432('0x3c')],_0x39e7c4[_0x9432('0x150')]));this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x39e7c4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x5b5f86){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5b5f86[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x5b5f86[_0x9432('0x150')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x5b5f86,'no\x20find\x20by\x20configured');}logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x151'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x5b5f86['findBy']));var _0x2ab2d1=this[_0x9432('0x51')][_0x9432('0x6f')](this,_0x5b5f86[_0x9432('0x150')]);if(_0x2ab2d1){logger['info'](util[_0x9432('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9432('0x11')][_0x9432('0x3c')],_0x5b5f86['findBy']));this[_0x9432('0x11')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9432('0x11')]['callerid'],_0x5b5f86['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x9432('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x9432('0x3c')],_0x5b5f86['findBy']));this[_0x9432('0x11')][_0x9432('0xa6')](util['format'](_0x9432('0x154'),this['channel']['callerid'],_0x5b5f86['findBy']));return{'code':0xc8,'result':_0x9432('0x155')};}};AGIVertices['prototype'][_0x9432('0x156')]=function(_0x6ebe0c){logger['info'](util[_0x9432('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x6ebe0c[_0x9432('0x3a')]));if(!this['isConfigured'](_0x6ebe0c[_0x9432('0x157')])){return this['channel'][_0x9432('0x2f')](_0x6ebe0c,_0x9432('0x158'));}this['channel'][_0x9432('0xa6')](util['format'](_0x9432('0x159'),_0x6ebe0c[_0x9432('0x157')]));var _0x31dedf=eval(_0x6ebe0c[_0x9432('0x157')]);if(!this['isConfigured'](_0x6ebe0c[_0x9432('0xd8')])){return this['channel'][_0x9432('0xa6')](_0x9432('0xd9'));}var _0xdbcdc5=this[_0x9432('0x14')][_0x9432('0x6f')](this,_0x6ebe0c[_0x9432('0xd8')]);if(!_0xdbcdc5){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x6ebe0c,_0x9432('0xda'));}if(_[_0x9432('0x98')](_0x31dedf)){var _0x3785c7=this;_0x31dedf[_0x9432('0xdb')](function(_0x5e57dd,_0x401a89){_0x3785c7[_0x9432('0x11')]['setVariable'](util[_0x9432('0x2c')](_0x9432('0x15a'),_0xdbcdc5,_0x401a89),_0x5e57dd);});return this[_0x9432('0x11')][_0x9432('0xa6')](util['format']('variable\x20%s[key]\x20set',_0xdbcdc5));}else{return this['channel'][_0x9432('0x9d')](_0xdbcdc5,_0x31dedf);}};AGIVertices[_0x9432('0x18')][_0x9432('0x15b')]=function(_0x2bf089){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2bf089['label']));if(_0x2bf089['retry']===0x0){return this[_0x9432('0xa4')](_0x2bf089);}_0x2bf089[_0x9432('0x10f')]-=0x1;if(!this[_0x9432('0xa3')](_0x2bf089[_0x9432('0x110')])){return this[_0x9432('0x11')]['error'](_0x2bf089,'no\x20file\x20audio\x20selected');}var _0x4cf24e=this['getSound'][_0x9432('0x6f')](this,_0x2bf089[_0x9432('0x110')]);if(!_0x4cf24e){return this[_0x9432('0x11')]['error'](_0x2bf089,_0x9432('0x113'));}var _0x55beb9=this[_0x9432('0x11')]['getData'](_0x4cf24e,_0x2bf089['response'],_0x2bf089[_0x9432('0x15c')]);var _0x5cf704=_0x55beb9[_0x9432('0xad')];if(_0x55beb9[_0x9432('0xad')]===-0x1){this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2bf089,'-1');return _0x55beb9;}else if(_0x55beb9['extra']==='timeout'){_0x55beb9[_0x9432('0xad')]=_0x55beb9[_0x9432('0xad')][_0x9432('0x99')]>0x0?_0x55beb9['result']:'t';}else if(_[_0x9432('0x44')](_0x55beb9[_0x9432('0xad')])){_0x55beb9[_0x9432('0xad')]='#';_0x5cf704='#';}if(!this[_0x9432('0xa3')](_0x2bf089[_0x9432('0xd8')])){this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0xd9'));}else{var _0x3a1497=this[_0x9432('0x14')][_0x9432('0x6f')](this,_0x2bf089[_0x9432('0xd8')]);if(!_0x3a1497){return this['channel']['error'](_0x2bf089,_0x9432('0xda'));}this['channel'][_0x9432('0x9d')](_0x3a1497,_0x5cf704);}this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x2bf089,_0x5cf704);return _0x55beb9;};AGIVertices['prototype'][_0x9432('0xa6')]=function(_0x46caec){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x15d'),_0x46caec[_0x9432('0x3a')]));return this[_0x9432('0x11')]['noop'](_0x46caec['output']||_0x46caec[_0x9432('0x3a')]);};AGIVertices[_0x9432('0x18')][_0x9432('0x15e')]=function(_0x30e419){logger['info'](util[_0x9432('0x2c')](_0x9432('0x15f'),_0x30e419[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x30e419[_0x9432('0x150')])){return this['channel'][_0x9432('0x2f')](_0x30e419,'no\x20find\x20by\x20configured');}logger[_0x9432('0x31')](util['format'](_0x9432('0x151'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x30e419[_0x9432('0x150')]));var _0x29530a=this[_0x9432('0x4d')]['sync'](this,_0x30e419['pause_id']);var _0x49db25=this[_0x9432('0x4f')][_0x9432('0x6f')](this,_0x30e419[_0x9432('0x150')],_0x29530a);if(_0x49db25){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9432('0x11')][_0x9432('0x3c')],_0x30e419[_0x9432('0x150')]));this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x152'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x30e419['findBy']));return{'code':0xc8,'result':_0x9432('0x153')};}else{logger[_0x9432('0x31')](util[_0x9432('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9432('0x11')][_0x9432('0x3c')],_0x30e419[_0x9432('0x150')]));this['channel'][_0x9432('0xa6')](util['format'](_0x9432('0x152'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x30e419[_0x9432('0x150')]));return{'code':0xc8,'result':_0x9432('0x155')};}};AGIVertices[_0x9432('0x18')]['playback']=function(_0x1d6917){logger['info'](util[_0x9432('0x2c')](_0x9432('0x160'),_0x1d6917[_0x9432('0x3a')]));if(!this['isConfigured'](_0x1d6917[_0x9432('0x110')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x1d6917,_0x9432('0x111'));}var _0x149322=this[_0x9432('0x112')][_0x9432('0x6f')](this,_0x1d6917[_0x9432('0x110')]);if(!_0x149322){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x1d6917,'no\x20file\x20audio\x20found');}var _0xf00bf2=this['channel'][_0x9432('0x55')]('PLAYBACK',[_0x149322,_0x1d6917[_0x9432('0xe3')]]);if(_0xf00bf2['result']===-0x1){return _0xf00bf2;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x161'),_0x9432('0x162'),_0x149322));};AGIVertices['prototype'][_0x9432('0x163')]=function(_0x2b2bf2){logger[_0x9432('0x31')](util['format'](_0x9432('0x164'),_0x2b2bf2[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x2b2bf2['queue_id'])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2b2bf2,_0x9432('0x165'));}var _0x328ad3='';var _0x3cac6c=parseInt(_0x2b2bf2[_0x9432('0x166')],0xa);if(isNaN(_0x3cac6c)){_0x328ad3=_0x2b2bf2['queue_id'];}else{_0x328ad3=this[_0x9432('0x19')][_0x9432('0x6f')](this,_0x2b2bf2['queue_id']);if(!_0x328ad3){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x2b2bf2,_0x9432('0x167'));}}var _0xfd9a32='';if(this['isConfigured'](_0x2b2bf2[_0x9432('0x110')])){var _0x56c300=this[_0x9432('0x112')]['sync'](this,_0x2b2bf2[_0x9432('0x110')]);if(_0x56c300){_0xfd9a32=_0x56c300;}}this[_0x9432('0x38')]['sync'](this,_0x2b2bf2,_0x328ad3);if(_0x2b2bf2[_0x9432('0xe3')][_0x9432('0x168')]('x')<0x0){_0x2b2bf2[_0x9432('0xe3')]+='x';}if(_0x2b2bf2[_0x9432('0xe3')][_0x9432('0x168')]('X')<0x0){_0x2b2bf2[_0x9432('0xe3')]+='X';}this[_0x9432('0x11')][_0x9432('0x9d')](_0x9432('0x169'),_0x328ad3?_0x328ad3[_0x9432('0x16a')]():'');var _0x48d441=this[_0x9432('0x11')][_0x9432('0x55')](_0x9432('0x16b'),[_0x328ad3,_0x2b2bf2[_0x9432('0xe3')],_0x2b2bf2[_0x9432('0xe4')],_0xfd9a32,_0x2b2bf2[_0x9432('0x64')],_0x2b2bf2['agi'],_0x2b2bf2['macro'],_0x2b2bf2[_0x9432('0x16c')],'',_0x2b2bf2['position']]);if(_0x48d441['result']===-0x1){return _0x48d441;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x161'),_0x9432('0x16b'),_0x328ad3));};AGIVertices[_0x9432('0x18')][_0x9432('0x16d')]=function(_0x7c1625){logger[_0x9432('0x31')](util['format'](_0x9432('0x16e'),_0x7c1625[_0x9432('0x3a')]));var _0x18ea9f=_0x7c1625[_0x9432('0x16f')]||'wav';var _0x289c42=util[_0x9432('0x2c')]('%s_%s',this[_0x9432('0x11')][_0x9432('0x39')],rs[_0x9432('0x117')](0x5));var _0xfd690e=util[_0x9432('0x2c')](_0x9432('0x170'),FILES_PATH,_0x289c42,_0x18ea9f);var _0x466565=util[_0x9432('0x2c')](_0x9432('0x12f'),FILES_PATH,_0x289c42);this['createSquareRecording'][_0x9432('0x6f')](this,_0x7c1625,_0x289c42,_0xfd690e);this[_0x9432('0x11')][_0x9432('0x9d')](_0x9432('0x171'),_0x289c42);logger['info'](_0x9432('0x172'),_0x466565,_0x18ea9f,_0x7c1625[_0x9432('0x173')],_0x7c1625[_0x9432('0x64')]);return this[_0x9432('0x11')][_0x9432('0x132')](_0x466565,_0x18ea9f,_0x7c1625[_0x9432('0x173')],_0x7c1625[_0x9432('0x64')],undefined,!![]);};AGIVertices[_0x9432('0x18')][_0x9432('0x174')]=function(_0x27f18b){logger['info'](util[_0x9432('0x2c')](_0x9432('0x175'),_0x27f18b['label']));if(!this[_0x9432('0xa3')](_0x27f18b[_0x9432('0xe4')])){return this[_0x9432('0x11')]['noop']('no\x20url\x20configured');}var _0x170726=this['restAPI'][_0x9432('0x6f')](this,_0x27f18b);logger[_0x9432('0x31')](util['format'](_0x9432('0x176'),util[_0x9432('0x177')](_0x170726,{'showHidden':![],'depth':null})));if(!this[_0x9432('0xa3')](_0x27f18b[_0x9432('0xd8')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x178'));}var _0x4c1b05=this[_0x9432('0x14')]['sync'](this,_0x27f18b['variable_id']);if(!_0x4c1b05){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x27f18b,_0x9432('0xda'));}this['channel'][_0x9432('0x9d')](util['format'](_0x9432('0x179'),_0x4c1b05),_0x170726[_0x9432('0x73')]?_0x170726[_0x9432('0x73')]:_0x9432('0x17a'));this[_0x9432('0x11')][_0x9432('0x9d')](util[_0x9432('0x2c')](_0x9432('0x17b'),_0x4c1b05),_0x170726['statusMessage']?_0x170726[_0x9432('0x17c')]:'OK');if(_0x170726[_0x9432('0x68')]){try{this[_0x9432('0x9b')](_0x170726[_0x9432('0x68')],_0x4c1b05);}catch(_0x1fc8f1){logger['error'](util[_0x9432('0x2c')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4c1b05));}}return this['channel']['noop'](util[_0x9432('0x2c')](_0x9432('0x17d'),_0x4c1b05));};AGIVertices[_0x9432('0x18')][_0x9432('0x17e')]=function(_0x5c3ce3){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x17f'),_0x5c3ce3[_0x9432('0x3a')]));return this['channel'][_0x9432('0x180')](_0x5c3ce3[_0x9432('0x181')][_0x9432('0x57')](/\s+/g,''),_0x5c3ce3['escape_digits']);};AGIVertices[_0x9432('0x18')][_0x9432('0x182')]=function(_0xef4436){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xef4436[_0x9432('0x3a')]));return this['channel'][_0x9432('0x183')](_0xef4436['number']['replace'](/\s+/g,''),_0xef4436[_0x9432('0x173')]);};AGIVertices['prototype']['sayphonetic']=function(_0x51484c){logger[_0x9432('0x31')](util['format'](_0x9432('0x184'),_0x51484c[_0x9432('0x3a')]));return this['channel'][_0x9432('0x185')](_0x51484c[_0x9432('0x5a')],_0x51484c['escape_digits']);};AGIVertices[_0x9432('0x18')]['sendMail']=function(_0x4fb016){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x186'),_0x4fb016[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x4fb016[_0x9432('0x187')])){return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x188'));}var _0x3776f3=this[_0x9432('0x24')][_0x9432('0x6f')](this,_0x4fb016['account_id']);if(!_0x3776f3||!_0x3776f3[_0x9432('0x189')]){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x4fb016,'no\x20mail\x20account\x20found');}var _0x4ff582={'from':util['format'](_0x9432('0x18a'),_0x3776f3['name'],_0x3776f3[_0x9432('0x18b')]||_0x3776f3[_0x9432('0x189')][_0x9432('0x18c')]),'to':_0x4fb016['to']||'','cc':_0x4fb016['cc']||'','bcc':_0x4fb016['bcc']||'','subject':_0x4fb016[_0x9432('0x18d')],'html':_0x4fb016['text'],'text':_0x4fb016[_0x9432('0x5a')]};var _0x87a3a8={'tls':{'rejectUnauthorized':![]}};if(_0x3776f3[_0x9432('0x189')]['service']){_0x87a3a8['service']=_0x3776f3[_0x9432('0x189')][_0x9432('0x18e')];}else{_0x87a3a8[_0x9432('0x18f')]=_0x3776f3[_0x9432('0x189')]['host'];_0x87a3a8[_0x9432('0x190')]=_0x3776f3[_0x9432('0x189')][_0x9432('0x190')];_0x87a3a8[_0x9432('0x191')]=_0x3776f3[_0x9432('0x189')][_0x9432('0x191')];}if(_0x3776f3[_0x9432('0x189')][_0x9432('0x192')]){_0x87a3a8[_0x9432('0x193')]={'user':_0x3776f3['Smtp'][_0x9432('0x18c')],'pass':_0x3776f3[_0x9432('0x189')][_0x9432('0x194')]};}if(this[_0x9432('0xa3')](_0x4fb016['template_id'])){}logger[_0x9432('0xdf')]('sendMail\x20message',JSON['stringify'](_0x4ff582));this[_0x9432('0x38')]['sync'](this,_0x4fb016,_0x4fb016[_0x9432('0x187')]);this[_0x9432('0x11')]['noop'](util[_0x9432('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3776f3[_0x9432('0x17')]));this[_0x9432('0x195')][_0x9432('0x6f')](this,_0x87a3a8,_0x4ff582);return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x196'));};AGIVertices[_0x9432('0x18')][_0x9432('0x197')]=function(_0x26ce41){logger[_0x9432('0x31')](util['format'](_0x9432('0x198'),_0x26ce41['label']));return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x199'));};AGIVertices['prototype'][_0x9432('0x19a')]=function(_0x166570){logger[_0x9432('0x31')](util['format'](_0x9432('0x19b'),_0x166570[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x166570[_0x9432('0x19c')])){return this['channel'][_0x9432('0xa6')](_0x9432('0x19d'));}var _0x3e185a=this[_0x9432('0x36')][_0x9432('0x6f')](this,_0x166570[_0x9432('0x19c')]);if(!_0x3e185a){return this[_0x9432('0x11')]['error'](_0x166570,_0x9432('0x19e'));}var _0x517ae6={'body':_0x166570[_0x9432('0x19f')],'phone':_0x166570['to']||'','SmsAccountId':_0x3e185a['id']};logger[_0x9432('0xdf')]('sendSMS\x20message',JSON['stringify'](_0x517ae6));this['createSquareDetailsReport'][_0x9432('0x6f')](this,_0x166570,_0x166570['sms_account_id']);this[_0x9432('0x11')]['noop'](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3e185a[_0x9432('0x17')]));this[_0x9432('0x37')]['sync'](this,_0x517ae6);return this['channel'][_0x9432('0xa6')](_0x9432('0x1a0'));};AGIVertices['prototype']['set']=function(_0x388915){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x1a1'),_0x388915[_0x9432('0x3a')]));if(!this['isConfigured'](_0x388915[_0x9432('0xd8')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x388915,_0x9432('0x1a2'));}var _0x2633a8=this[_0x9432('0x14')][_0x9432('0x6f')](this,_0x388915[_0x9432('0xd8')]);if(!_0x2633a8){return this['channel'][_0x9432('0x2f')](_0x388915,'no\x20variable\x20found');}return this['channel'][_0x9432('0x9d')](_0x2633a8,_0x388915[_0x9432('0x1a3')]);};AGIVertices[_0x9432('0x18')]['start']=function(_0x4dac17){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x1a4'),_0x4dac17[_0x9432('0x3a')]));this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x1a5'));if(_0x4dac17[_0x9432('0xba')]===_0x9432('0x1a6')){this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x1a7'));return this[_0x9432('0x11')][_0x9432('0xba')]();}return this[_0x9432('0x11')][_0x9432('0xa6')](_0x9432('0x1a8'));};AGIVertices['prototype'][_0x9432('0x1a9')]=function(_0x1c5a8f){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1c5a8f[_0x9432('0x3a')]));if(!this['isConfigured'](_0x1c5a8f[_0x9432('0x1aa')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x1c5a8f,_0x9432('0x1ab'));}var _0x5f534e=this[_0x9432('0x1c')][_0x9432('0x6f')](this,_0x1c5a8f['project_id']);if(!this['isConfigured'](_0x5f534e)){return this['channel'][_0x9432('0x2f')](_0x1c5a8f,util[_0x9432('0x2c')](_0x9432('0x1ac'),_0x1c5a8f['project_id']));}if(_0x5f534e===this['channel'][_0x9432('0x3b')]){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x1c5a8f,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x1c5a8f,_0x5f534e);var _0x2776d2=this[_0x9432('0x11')][_0x9432('0x55')]('AGI',util['format'](_0x9432('0x1ad'),config[_0x9432('0xa')]['host']||_0x9432('0x1ae'),_0x5f534e,this[_0x9432('0x11')][_0x9432('0x3b')]));if(_0x2776d2[_0x9432('0xad')]===-0x1){return _0x2776d2;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('Executed\x20command\x20%s\x20%s','AGI',_0x5f534e));};AGIVertices[_0x9432('0x18')][_0x9432('0x1af')]=function(_0x56654a){logger[_0x9432('0x31')](util['format'](_0x9432('0x1b0'),_0x56654a[_0x9432('0x3a')]));var _0x547dcc=this[_0x9432('0x1b1')][_0x9432('0x6f')](this,_0x56654a['command']);this[_0x9432('0x38')][_0x9432('0x6f')](this,_0x56654a,_0x56654a['command']);if(this[_0x9432('0xa3')](_0x56654a['variable_id'])){var _0x56ab6a=this['getVariable']['sync'](this,_0x56654a['variable_id']);if(_0x56ab6a){this[_0x9432('0x11')][_0x9432('0x9d')](_0x56ab6a,_0x547dcc);return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x1b2'),_0x56654a[_0x9432('0xb5')],_0x56ab6a));}}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x56654a[_0x9432('0xb5')]));};AGIVertices[_0x9432('0x18')][_0x9432('0x1b3')]=function(_0x579181){logger['info'](util[_0x9432('0x2c')](_0x9432('0x1b4'),_0x579181[_0x9432('0x3a')]));_0x579181['text']=_0x579181[_0x9432('0x5a')][_0x9432('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9432('0xa3')](_0x579181[_0x9432('0x59')])){return this['channel']['noop'](_0x9432('0x1b5'));}if(!this[_0x9432('0xa3')](_0x579181[_0x9432('0x5a')])){return this[_0x9432('0x11')]['noop']('no\x20text\x20configured');}this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x1b6'),_0x579181['text']));var _0x102d33=this[_0x9432('0x58')][_0x9432('0x6f')](this,_0x579181);if(_0x102d33){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x1b7'),_0x102d33));var _0x503d50=this['channel'][_0x9432('0x122')](_0x102d33);try{fs['unlink'](_0x102d33+'.wav');}catch(_0x355bf7){logger[_0x9432('0x2f')](_0x355bf7);}return _0x503d50;}return this[_0x9432('0x11')]['error'](_0x579181,_0x9432('0x1b8'));};AGIVertices['prototype'][_0x9432('0x1b9')]=function(_0x419c44){logger[_0x9432('0x31')](util[_0x9432('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x419c44[_0x9432('0x3a')]));_0x419c44[_0x9432('0x5a')]=_0x419c44['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x419c44[_0x9432('0x5a')])){return this[_0x9432('0x11')]['noop'](_0x9432('0xa7'));}this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x1ba'),_0x419c44['text']));var _0xea78d8=this[_0x9432('0x5f')][_0x9432('0x6f')](this,_0x419c44);if(_0xea78d8){this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')](_0x9432('0x1bb'),_0xea78d8));var _0x3eba26=this[_0x9432('0x11')][_0x9432('0x122')](_0xea78d8);try{fs['unlink'](_0xea78d8+_0x9432('0x123'));}catch(_0x25e0ed){logger[_0x9432('0x2f')](_0x25e0ed);}return _0x3eba26;}return this['channel'][_0x9432('0x2f')](_0x419c44,_0x9432('0x1bc'));};AGIVertices[_0x9432('0x18')][_0x9432('0x1bd')]=function(_0x511667){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x1be'),_0x511667['label']));if(!this[_0x9432('0xa3')](_0x511667[_0x9432('0x150')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x511667,_0x9432('0x1bf'));}logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x151'),this['channel'][_0x9432('0x3c')],_0x511667[_0x9432('0x150')]));var _0x26d249=this[_0x9432('0x50')][_0x9432('0x6f')](this,_0x511667[_0x9432('0x150')]);if(_0x26d249){logger[_0x9432('0x31')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x9432('0x3c')],_0x511667[_0x9432('0x150')]));this['channel']['noop'](util['format'](_0x9432('0x152'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x511667['findBy']));return{'code':0xc8,'result':_0x9432('0x153')};}else{logger[_0x9432('0x31')](util['format'](_0x9432('0x154'),this[_0x9432('0x11')]['callerid'],_0x511667[_0x9432('0x150')]));this['channel'][_0x9432('0xa6')](util['format'](_0x9432('0x154'),this[_0x9432('0x11')][_0x9432('0x3c')],_0x511667[_0x9432('0x150')]));return{'code':0xc8,'result':_0x9432('0x155')};}};AGIVertices[_0x9432('0x18')][_0x9432('0x1c0')]=function(_0x5b42bb){logger[_0x9432('0x31')](util[_0x9432('0x2c')](_0x9432('0x1c1'),_0x5b42bb['label']));var _0x282c17=this[_0x9432('0x11')][_0x9432('0x55')](_0x9432('0x1c2'),[_0x5b42bb['mailbox'],_0x5b42bb[_0x9432('0x75')]]);if(_0x282c17['result']===-0x1){return _0x282c17;}return this[_0x9432('0x11')][_0x9432('0xa6')](util[_0x9432('0x2c')]('Executed\x20command\x20%s\x20%s',_0x9432('0x1c2'),_0x5b42bb['mailbox']));};AGIVertices[_0x9432('0x18')]['vswitch']=function(_0x4fb8a7){logger['info'](util[_0x9432('0x2c')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4fb8a7[_0x9432('0x3a')]));if(!this[_0x9432('0xa3')](_0x4fb8a7[_0x9432('0xd8')])){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x4fb8a7,_0x9432('0x1a2'));}var _0x3333ae=this[_0x9432('0x14')][_0x9432('0x6f')](this,_0x4fb8a7[_0x9432('0xd8')]);if(!_0x3333ae){return this[_0x9432('0x11')][_0x9432('0x2f')](_0x4fb8a7,_0x9432('0xda'));}var _0x111b3e=this[_0x9432('0x11')]['getVariable'](_0x3333ae);return{'code':0xc8,'result':_0x111b3e[_0x9432('0xa0')]?_0x111b3e['extra']:'-'};};String[_0x9432('0x18')][_0x9432('0x9f')]=function(_0x25546f,_0x11ee25){return this[_0x9432('0x9e')](_0x25546f)[_0x9432('0x1c3')](_0x11ee25);};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 3682346..4d6cdb2 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 _0x010a=['[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','bind','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]'];(function(_0x775862,_0x9b4a1f){var _0x272b43=function(_0x14c73d){while(--_0x14c73d){_0x775862['push'](_0x775862['shift']());}};_0x272b43(++_0x9b4a1f);}(_0x010a,0x116));var _0xa010=function(_0x508cc5,_0x16183a){_0x508cc5=_0x508cc5-0x0;var _0x4f3dbe=_0x010a[_0x508cc5];return _0x4f3dbe;};'use strict';var util=require('util');var _=require(_0xa010('0x0'));var moment=require(_0xa010('0x1'));var ami=require('../ami');var logger=require(_0xa010('0x2'))(_0xa010('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xa010('0x4'));function Acw(_0x39db99){this[_0xa010('0x5')]=_0x39db99[_0xa010('0x5')];this[_0xa010('0x6')]=_0x39db99[_0xa010('0x6')];this[_0xa010('0x7')]=_0x39db99[_0xa010('0x7')];this[_0xa010('0x8')]={};ami['on'](_0xa010('0x9'),this[_0xa010('0xa')]['bind'](this));ami['on'](_0xa010('0xb'),this['syncHangupRequest'][_0xa010('0xc')](this));ami['on'](_0xa010('0xd'),this['syncHangup'][_0xa010('0xc')](this));ami['on']('agentringnoanswer',this[_0xa010('0xe')][_0xa010('0xc')](this));ami['on'](_0xa010('0xf'),this[_0xa010('0x10')][_0xa010('0xc')](this));ami['on'](_0xa010('0x11'),this[_0xa010('0x12')][_0xa010('0xc')](this));ami['on'](_0xa010('0x13'),this['syncAgentConnectPreview'][_0xa010('0xc')](this));}function getDiff(_0x4a5519){var _0x244dfd=moment()[_0xa010('0x14')](0x0);var _0x361c70=moment(_0x4a5519)[_0xa010('0x14')](0x0);return _0x244dfd[_0xa010('0x15')](_0x361c70,_0xa010('0x16'));}Acw[_0xa010('0x17')][_0xa010('0x18')]=function(_0x376113){try{var _0x3804a4=this;var _0x186cdb=this[_0xa010('0x8')][_0x376113]['interface'];var _0x63a18=this[_0xa010('0x8')][_0x376113][_0xa010('0x19')];var _0x3b7ee0=this[_0xa010('0x5')][_0x63a18];var _0x54cae2=![];var _0x9603e8=_0xa010('0x1a');if(_0x3b7ee0['mandatoryDisposition']){if(_0x3b7ee0[_0xa010('0x1b')][_0xa010('0x1c')]){_0x54cae2=!![];_0x9603e8=_0x3b7ee0[_0xa010('0x1b')][_0xa010('0x1c')];}}ami['Action']({'action':_0xa010('0x1d'),'interface':_0x186cdb,'paused':!![],'reason':_0x9603e8})[_0xa010('0x1e')](function(_0x3cd9fe){if(_0x3804a4[_0xa010('0x6')][_0x186cdb]){return RpcUser[_0xa010('0x1f')](_0x3804a4['agents'][_0x186cdb]['id'])[_0xa010('0x1e')](function(_0x21f490){if(_0x21f490&&!_0x21f490[_0xa010('0x20')]){logger[_0xa010('0x21')](_0xa010('0x22'),_0x376113,_0x186cdb,_0x63a18);var _0x50f77a=_0x3804a4[_0xa010('0x8')][_0x376113][_0xa010('0x23')]&&_0x3804a4[_0xa010('0x8')][_0x376113][_0xa010('0x24')]?_0x3804a4[_0xa010('0x8')][_0x376113][_0xa010('0x24')]:_0x376113;return RpcUser['savePause'](_0x3804a4[_0xa010('0x6')][_0x186cdb],_0x9603e8,_0x50f77a)[_0xa010('0x1e')](function(_0x208964){if(!_0x54cae2){_0x3804a4[_0xa010('0x7')][_0x186cdb]={};logger['info'](_0xa010('0x25'),_0x376113,_0x3804a4[_0xa010('0x5')][_0x63a18][_0xa010('0x26')],_0x186cdb,_0x63a18);_0x3804a4[_0xa010('0x7')][_0x186cdb][_0xa010('0x27')]=setTimeout(_0x3804a4[_0xa010('0x28')][_0xa010('0xc')](_0x3804a4,_0x186cdb),_0x3804a4[_0xa010('0x5')][_0x63a18][_0xa010('0x26')]*0x3e8);_0x3804a4['timers'][_0x186cdb][_0xa010('0x29')]=moment()[_0xa010('0x2a')](_0xa010('0x2b'));_0x3804a4['timers'][_0x186cdb][_0xa010('0x2c')]=_0x376113;_0x3804a4[_0xa010('0x7')][_0x186cdb][_0xa010('0x19')]=_0x63a18;_0x3804a4['timers'][_0x186cdb][_0xa010('0x2d')]=function(){var _0x2fb5cb=getDiff(_0x3804a4['timers'][_0x186cdb]['lastPauseAt']);clearTimeout(_0x3804a4[_0xa010('0x7')][_0x186cdb][_0xa010('0x27')]);_0x3804a4[_0xa010('0x7')][_0x186cdb][_0xa010('0x27')]=![];RpcVoiceAgentReport[_0xa010('0x2e')]({'acwtime':_0x2fb5cb},_0x3804a4[_0xa010('0x7')][_0x186cdb][_0xa010('0x2c')],_0x186cdb)['then'](function(_0x1e264c){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x376113,_0x2fb5cb,_0x1e264c);})[_0xa010('0x2f')](function(_0x998513){logger[_0xa010('0x30')](_0xa010('0x31'),_0x376113,_0x998513);});delete _0x3804a4[_0xa010('0x7')][_0x186cdb];};}});}else{logger[_0xa010('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x376113,_0x186cdb,_0x63a18);}});}})[_0xa010('0x2f')](function(_0xbad8bd){logger[_0xa010('0x30')](_0xa010('0x25'),_0x376113,_0x3804a4['voiceQueues'][_0x63a18][_0xa010('0x26')],_0x186cdb,_0x63a18);})[_0xa010('0x32')](function(){delete _0x3804a4[_0xa010('0x8')][_0x376113];});}catch(_0x1d7a41){logger[_0xa010('0x30')]('[ACW][START]\x20%s',_0x1d7a41[_0xa010('0x33')]);}};Acw[_0xa010('0x17')]['stopAcw']=function(_0x11b2a9){try{var _0xe2503c=this;if(_0xe2503c['timers'][_0x11b2a9]){_0xe2503c[_0xa010('0x7')][_0x11b2a9]['timer']=![];var _0xcd970b=_0xe2503c[_0xa010('0x7')][_0x11b2a9][_0xa010('0x2c')];var _0x36bad9=_0xe2503c[_0xa010('0x7')][_0x11b2a9][_0xa010('0x19')];var _0x1143ea=_0xe2503c[_0xa010('0x5')][_0x36bad9][_0xa010('0x26')];logger['info'](_0xa010('0x34'),_0xcd970b,_0x11b2a9);RpcUser[_0xa010('0x35')](this[_0xa010('0x6')][_0x11b2a9]);RpcVoiceAgentReport[_0xa010('0x2e')]({'acwtime':_0x1143ea,'agentacw':!![]},_0xcd970b,_0x11b2a9)[_0xa010('0x1e')](function(_0x22deb5){logger[_0xa010('0x21')](_0xa010('0x36'),_0xcd970b,_0x1143ea,_0x22deb5);})[_0xa010('0x2f')](function(_0x1749d6){logger[_0xa010('0x30')](_0xa010('0x31'),_0xcd970b,_0x1749d6);});}else{logger[_0xa010('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x11b2a9);if(_0xe2503c[_0xa010('0x7')]){logger['info'](_0xa010('0x37'),JSON['stringify'](_0xe2503c[_0xa010('0x7')]));}}}catch(_0x16bdd9){logger[_0xa010('0x30')](_0xa010('0x38'),_0x16bdd9[_0xa010('0x33')]);}};Acw[_0xa010('0x17')][_0xa010('0xa')]=function(_0x22af1b){try{if(this[_0xa010('0x5')][_0x22af1b['queue']]&&(this[_0xa010('0x5')][_0x22af1b[_0xa010('0x19')]][_0xa010('0x3')]||this[_0xa010('0x5')][_0x22af1b[_0xa010('0x19')]][_0xa010('0x39')])){if(this[_0xa010('0x6')][_0x22af1b[_0xa010('0x3a')]]){this[_0xa010('0x8')][_0x22af1b[_0xa010('0x2c')]]={'queue':_0x22af1b[_0xa010('0x19')],'interface':_0x22af1b[_0xa010('0x3a')],'destlinkedid':_0x22af1b[_0xa010('0x24')]};}}}catch(_0x283f95){logger['error'](_0xa010('0x3b'),_0x283f95[_0xa010('0x33')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x2fe04a){try{if(this['voiceQueues'][_0x2fe04a[_0xa010('0x19')]]&&(this[_0xa010('0x5')][_0x2fe04a['queue']][_0xa010('0x3')]||this['voiceQueues'][_0x2fe04a['queue']][_0xa010('0x39')])){if(this[_0xa010('0x6')][_0x2fe04a[_0xa010('0x3a')]]){this[_0xa010('0x8')][_0x2fe04a[_0xa010('0x2c')]]={'queue':_0x2fe04a['queue'],'interface':_0x2fe04a[_0xa010('0x3a')]};}}}catch(_0x4f06b2){logger[_0xa010('0x30')](_0xa010('0x3c'),_0x4f06b2[_0xa010('0x33')]);}};Acw[_0xa010('0x17')][_0xa010('0x3d')]=function(_0x184ed0){try{if(this[_0xa010('0x8')][_0x184ed0[_0xa010('0x2c')]]&&_['isUndefined'](this['channels'][_0x184ed0[_0xa010('0x2c')]][_0xa010('0x23')])){logger[_0xa010('0x21')](_0xa010('0x3e'),_0x184ed0[_0xa010('0x2c')]);this[_0xa010('0x18')](_0x184ed0[_0xa010('0x2c')]);}else if(this[_0xa010('0x8')][_0x184ed0[_0xa010('0x3f')]]&&_[_0xa010('0x40')](this[_0xa010('0x8')][_0x184ed0['linkedid']]['attended'])){logger['info'](_0xa010('0x41'),_0x184ed0[_0xa010('0x3f')]);this[_0xa010('0x18')](_0x184ed0['linkedid']);}}catch(_0x2fe75e){logger[_0xa010('0x30')](_0xa010('0x42'),_0x2fe75e[_0xa010('0x33')]);}};Acw[_0xa010('0x17')]['syncHangup']=function(_0x537c86){try{if(this[_0xa010('0x8')][_0x537c86[_0xa010('0x2c')]]&&this[_0xa010('0x8')][_0x537c86[_0xa010('0x2c')]]['attended']){logger[_0xa010('0x21')](_0xa010('0x43'),_0x537c86[_0xa010('0x2c')]);this[_0xa010('0x18')](_0x537c86['uniqueid']);}else if(this[_0xa010('0x8')][_0x537c86[_0xa010('0x3f')]]&&this[_0xa010('0x8')][_0x537c86[_0xa010('0x3f')]][_0xa010('0x23')]){logger[_0xa010('0x21')](_0xa010('0x44'),_0x537c86['linkedid']);this[_0xa010('0x18')](_0x537c86[_0xa010('0x3f')]);}}catch(_0x2addc6){logger[_0xa010('0x30')](_0xa010('0x45'),_0x2addc6[_0xa010('0x33')]);}};Acw['prototype'][_0xa010('0x10')]=function(_0x181461){try{if(!_[_0xa010('0x46')](this['channels'][_0x181461[_0xa010('0x47')]])){this[_0xa010('0x18')](_0x181461[_0xa010('0x47')]);if(this[_0xa010('0x8')][_0x181461[_0xa010('0x48')]]){this[_0xa010('0x8')][_0x181461['secondtransfereruniqueid']][_0xa010('0x23')]=!![];this[_0xa010('0x8')][_0x181461['transfertargetuniqueid']]=this[_0xa010('0x8')][_0x181461['secondtransfereruniqueid']];delete this[_0xa010('0x8')][_0x181461[_0xa010('0x48')]];}}else if(!_[_0xa010('0x46')](this['channels'][_0x181461[_0xa010('0x49')]])){this[_0xa010('0x18')](_0x181461[_0xa010('0x49')]);if(this[_0xa010('0x8')][_0x181461[_0xa010('0x4a')]]){this[_0xa010('0x8')][_0x181461['origtransfereruniqueid']][_0xa010('0x23')]=!![];this[_0xa010('0x8')][_0x181461[_0xa010('0x47')]]=this[_0xa010('0x8')][_0x181461[_0xa010('0x4a')]];delete this[_0xa010('0x8')][_0x181461[_0xa010('0x4a')]];}}}catch(_0x485577){logger[_0xa010('0x30')](_0xa010('0x4b'),_0x485577[_0xa010('0x33')]);}};Acw[_0xa010('0x17')]['syncBlindTransfer']=function(_0x4d7807){try{if(this[_0xa010('0x8')][_0x4d7807[_0xa010('0x4c')]]){logger[_0xa010('0x21')](_0xa010('0x4d'),JSON[_0xa010('0x4e')](_0x4d7807['transfereruniqueid']));this[_0xa010('0x18')](_0x4d7807[_0xa010('0x4c')]);}else if(this[_0xa010('0x8')][_0x4d7807[_0xa010('0x4f')]]){logger[_0xa010('0x21')](_0xa010('0x50'),JSON[_0xa010('0x4e')](_0x4d7807[_0xa010('0x4f')]));this[_0xa010('0x18')](_0x4d7807[_0xa010('0x4f')]);}}catch(_0xef3ac){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0xef3ac[_0xa010('0x33')]);}};Acw[_0xa010('0x17')][_0xa010('0xe')]=function(_0x22b30d){try{if(this[_0xa010('0x5')][_0x22b30d['queue']]&&this[_0xa010('0x5')][_0x22b30d[_0xa010('0x19')]][_0xa010('0x51')]==='all'){if(this['agents'][_0x22b30d['interface']]){logger[_0xa010('0x21')](_0xa010('0x52'),_0x22b30d['uniqueid'],_0x22b30d['interface'],_0x22b30d[_0xa010('0x19')]);return RpcUser[_0xa010('0x53')](this[_0xa010('0x6')][_0x22b30d[_0xa010('0x3a')]],_0xa010('0x54'),_0x22b30d[_0xa010('0x2c')]);}}}catch(_0x12d6ef){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x12d6ef['message']);}};module[_0xa010('0x55')]=Acw; \ No newline at end of file +var _0xc642=['name','QueuePause','agents','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDispositionPause'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc642,0xf4));var _0x2c64=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc642[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0x2c64('0x0'));var _=require(_0x2c64('0x1'));var moment=require(_0x2c64('0x2'));var ami=require(_0x2c64('0x3'));var logger=require(_0x2c64('0x4'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x2c64('0x5'));function Acw(_0x31ed71){this[_0x2c64('0x6')]=_0x31ed71['voiceQueues'];this['agents']=_0x31ed71['agents'];this[_0x2c64('0x7')]=_0x31ed71['timers'];this[_0x2c64('0x8')]={};ami['on'](_0x2c64('0x9'),this['syncAgentConnect'][_0x2c64('0xa')](this));ami['on'](_0x2c64('0xb'),this['syncHangupRequest'][_0x2c64('0xa')](this));ami['on'](_0x2c64('0xc'),this[_0x2c64('0xd')][_0x2c64('0xa')](this));ami['on'](_0x2c64('0xe'),this[_0x2c64('0xf')][_0x2c64('0xa')](this));ami['on'](_0x2c64('0x10'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x2c64('0x11'),this[_0x2c64('0x12')][_0x2c64('0xa')](this));ami['on'](_0x2c64('0x13'),this[_0x2c64('0x14')][_0x2c64('0xa')](this));}function getDiff(_0x2dc15a){var _0x5e8796=moment()[_0x2c64('0x15')](0x0);var _0x315923=moment(_0x2dc15a)[_0x2c64('0x15')](0x0);return _0x5e8796[_0x2c64('0x16')](_0x315923,_0x2c64('0x17'));}Acw[_0x2c64('0x18')][_0x2c64('0x19')]=function(_0x536d91){try{var _0x4cda95=this;var _0x2b9ed3=this[_0x2c64('0x8')][_0x536d91]['interface'];var _0x8ef42d=this[_0x2c64('0x8')][_0x536d91][_0x2c64('0x1a')];var _0x3f689e=this[_0x2c64('0x6')][_0x8ef42d];var _0x595e0d=![];var _0x40a27d=_0x2c64('0x1b');if(_0x3f689e['mandatoryDisposition']){if(_0x3f689e[_0x2c64('0x1c')][_0x2c64('0x1d')]){_0x595e0d=!![];_0x40a27d=_0x3f689e[_0x2c64('0x1c')][_0x2c64('0x1d')];}}ami['Action']({'action':_0x2c64('0x1e'),'interface':_0x2b9ed3,'paused':!![],'reason':_0x40a27d})['then'](function(_0x124193){if(_0x4cda95[_0x2c64('0x1f')][_0x2b9ed3]){return RpcUser['getAgent'](_0x4cda95[_0x2c64('0x1f')][_0x2b9ed3]['id'])[_0x2c64('0x20')](function(_0x222c01){if(_0x222c01&&!_0x222c01[_0x2c64('0x21')]){logger[_0x2c64('0x22')](_0x2c64('0x23'),_0x536d91,_0x2b9ed3,_0x8ef42d);var _0x5dabc9=_0x4cda95[_0x2c64('0x8')][_0x536d91][_0x2c64('0x24')]&&_0x4cda95[_0x2c64('0x8')][_0x536d91]['destlinkedid']?_0x4cda95[_0x2c64('0x8')][_0x536d91][_0x2c64('0x25')]:_0x536d91;return RpcUser[_0x2c64('0x26')](_0x4cda95['agents'][_0x2b9ed3],_0x40a27d,_0x5dabc9)[_0x2c64('0x20')](function(_0x2380a4){if(!_0x595e0d){_0x4cda95[_0x2c64('0x7')][_0x2b9ed3]={};logger[_0x2c64('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x536d91,_0x4cda95[_0x2c64('0x6')][_0x8ef42d]['acwTimeout'],_0x2b9ed3,_0x8ef42d);_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x27')]=setTimeout(_0x4cda95[_0x2c64('0x28')][_0x2c64('0xa')](_0x4cda95,_0x2b9ed3),_0x4cda95[_0x2c64('0x6')][_0x8ef42d]['acwTimeout']*0x3e8);_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x29')]=moment()[_0x2c64('0x2a')](_0x2c64('0x2b'));_0x4cda95[_0x2c64('0x7')][_0x2b9ed3]['uniqueid']=_0x536d91;_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x1a')]=_0x8ef42d;_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x2c')]=function(){var _0x3b2800=getDiff(_0x4cda95['timers'][_0x2b9ed3][_0x2c64('0x29')]);clearTimeout(_0x4cda95['timers'][_0x2b9ed3][_0x2c64('0x27')]);_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x3b2800},_0x4cda95[_0x2c64('0x7')][_0x2b9ed3][_0x2c64('0x2d')],_0x2b9ed3)[_0x2c64('0x20')](function(_0x236fee){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x536d91,_0x3b2800,_0x236fee);})[_0x2c64('0x2e')](function(_0xafece1){logger[_0x2c64('0x2f')](_0x2c64('0x30'),_0x536d91,_0xafece1);});delete _0x4cda95['timers'][_0x2b9ed3];};}});}else{logger[_0x2c64('0x22')](_0x2c64('0x31'),_0x536d91,_0x2b9ed3,_0x8ef42d);}});}})[_0x2c64('0x2e')](function(_0x4e9d1c){logger[_0x2c64('0x2f')](_0x2c64('0x32'),_0x536d91,_0x4cda95[_0x2c64('0x6')][_0x8ef42d][_0x2c64('0x33')],_0x2b9ed3,_0x8ef42d);})['finally'](function(){delete _0x4cda95['channels'][_0x536d91];});}catch(_0x298d46){logger[_0x2c64('0x2f')](_0x2c64('0x34'),_0x298d46[_0x2c64('0x35')]);}};Acw[_0x2c64('0x18')][_0x2c64('0x28')]=function(_0x3b6eae){try{var _0x4be2ed=this;if(_0x4be2ed[_0x2c64('0x7')][_0x3b6eae]){_0x4be2ed[_0x2c64('0x7')][_0x3b6eae][_0x2c64('0x27')]=![];var _0x422c06=_0x4be2ed[_0x2c64('0x7')][_0x3b6eae][_0x2c64('0x2d')];var _0x39e95b=_0x4be2ed[_0x2c64('0x7')][_0x3b6eae][_0x2c64('0x1a')];var _0x2b6e0c=_0x4be2ed[_0x2c64('0x6')][_0x39e95b][_0x2c64('0x33')];logger['info'](_0x2c64('0x36'),_0x422c06,_0x3b6eae);RpcUser['saveUnpause'](this[_0x2c64('0x1f')][_0x3b6eae]);RpcVoiceAgentReport[_0x2c64('0x37')]({'acwtime':_0x2b6e0c,'agentacw':!![]},_0x422c06,_0x3b6eae)[_0x2c64('0x20')](function(_0x4945ee){logger[_0x2c64('0x22')](_0x2c64('0x38'),_0x422c06,_0x2b6e0c,_0x4945ee);})[_0x2c64('0x2e')](function(_0x253a6d){logger[_0x2c64('0x2f')](_0x2c64('0x30'),_0x422c06,_0x253a6d);});}else{logger['error'](_0x2c64('0x39'),_0x3b6eae);if(_0x4be2ed[_0x2c64('0x7')]){logger['info'](_0x2c64('0x3a'),JSON[_0x2c64('0x3b')](_0x4be2ed['timers']));}}}catch(_0x589139){logger['error'](_0x2c64('0x3c'),_0x589139['message']);}};Acw['prototype'][_0x2c64('0x3d')]=function(_0x2c1ee1){try{if(this['voiceQueues'][_0x2c1ee1['queue']]&&(this[_0x2c64('0x6')][_0x2c1ee1[_0x2c64('0x1a')]][_0x2c64('0x3e')]||this[_0x2c64('0x6')][_0x2c1ee1[_0x2c64('0x1a')]][_0x2c64('0x3f')])){if(this[_0x2c64('0x1f')][_0x2c1ee1[_0x2c64('0x40')]]){this[_0x2c64('0x8')][_0x2c1ee1[_0x2c64('0x2d')]]={'queue':_0x2c1ee1[_0x2c64('0x1a')],'interface':_0x2c1ee1[_0x2c64('0x40')],'destlinkedid':_0x2c1ee1[_0x2c64('0x25')]};}}}catch(_0x3258dc){logger[_0x2c64('0x2f')](_0x2c64('0x41'),_0x3258dc[_0x2c64('0x35')]);}};Acw[_0x2c64('0x18')][_0x2c64('0x14')]=function(_0x3f324c){try{if(this[_0x2c64('0x6')][_0x3f324c[_0x2c64('0x1a')]]&&(this[_0x2c64('0x6')][_0x3f324c[_0x2c64('0x1a')]][_0x2c64('0x3e')]||this[_0x2c64('0x6')][_0x3f324c[_0x2c64('0x1a')]][_0x2c64('0x3f')])){if(this[_0x2c64('0x1f')][_0x3f324c[_0x2c64('0x40')]]){this[_0x2c64('0x8')][_0x3f324c[_0x2c64('0x2d')]]={'queue':_0x3f324c['queue'],'interface':_0x3f324c[_0x2c64('0x40')]};}}}catch(_0x25c151){logger[_0x2c64('0x2f')](_0x2c64('0x42'),_0x25c151['message']);}};Acw[_0x2c64('0x18')][_0x2c64('0x43')]=function(_0x434d4c){try{if(this[_0x2c64('0x8')][_0x434d4c[_0x2c64('0x2d')]]&&_['isUndefined'](this['channels'][_0x434d4c[_0x2c64('0x2d')]]['attended'])){logger[_0x2c64('0x22')](_0x2c64('0x44'),_0x434d4c[_0x2c64('0x2d')]);this[_0x2c64('0x19')](_0x434d4c[_0x2c64('0x2d')]);}else if(this[_0x2c64('0x8')][_0x434d4c[_0x2c64('0x45')]]&&_['isUndefined'](this['channels'][_0x434d4c[_0x2c64('0x45')]][_0x2c64('0x24')])){logger[_0x2c64('0x22')](_0x2c64('0x46'),_0x434d4c[_0x2c64('0x45')]);this[_0x2c64('0x19')](_0x434d4c[_0x2c64('0x45')]);}}catch(_0x5d1b30){logger[_0x2c64('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x5d1b30['message']);}};Acw[_0x2c64('0x18')][_0x2c64('0xd')]=function(_0x4c9236){try{if(this[_0x2c64('0x8')][_0x4c9236[_0x2c64('0x2d')]]&&this[_0x2c64('0x8')][_0x4c9236['uniqueid']]['attended']){logger[_0x2c64('0x22')](_0x2c64('0x47'),_0x4c9236[_0x2c64('0x2d')]);this[_0x2c64('0x19')](_0x4c9236['uniqueid']);}else if(this[_0x2c64('0x8')][_0x4c9236['linkedid']]&&this['channels'][_0x4c9236[_0x2c64('0x45')]][_0x2c64('0x24')]){logger[_0x2c64('0x22')](_0x2c64('0x48'),_0x4c9236['linkedid']);this[_0x2c64('0x19')](_0x4c9236['linkedid']);}}catch(_0x3364fb){logger[_0x2c64('0x2f')](_0x2c64('0x49'),_0x3364fb['message']);}};Acw['prototype'][_0x2c64('0x4a')]=function(_0x39e04a){try{if(!_[_0x2c64('0x4b')](this[_0x2c64('0x8')][_0x39e04a[_0x2c64('0x4c')]])){this[_0x2c64('0x19')](_0x39e04a[_0x2c64('0x4c')]);if(this['channels'][_0x39e04a[_0x2c64('0x4d')]]){this[_0x2c64('0x8')][_0x39e04a[_0x2c64('0x4d')]]['attended']=!![];this['channels'][_0x39e04a[_0x2c64('0x4e')]]=this['channels'][_0x39e04a[_0x2c64('0x4d')]];delete this[_0x2c64('0x8')][_0x39e04a['secondtransfereruniqueid']];}}else if(!_[_0x2c64('0x4b')](this['channels'][_0x39e04a[_0x2c64('0x4e')]])){this['startAcw'](_0x39e04a['transfertargetuniqueid']);if(this[_0x2c64('0x8')][_0x39e04a['origtransfereruniqueid']]){this[_0x2c64('0x8')][_0x39e04a[_0x2c64('0x4f')]][_0x2c64('0x24')]=!![];this[_0x2c64('0x8')][_0x39e04a[_0x2c64('0x4c')]]=this['channels'][_0x39e04a[_0x2c64('0x4f')]];delete this[_0x2c64('0x8')][_0x39e04a[_0x2c64('0x4f')]];}}}catch(_0xd73742){logger[_0x2c64('0x2f')](_0x2c64('0x50'),_0xd73742[_0x2c64('0x35')]);}};Acw[_0x2c64('0x18')][_0x2c64('0x12')]=function(_0x20332e){try{if(this[_0x2c64('0x8')][_0x20332e[_0x2c64('0x51')]]){logger['info'](_0x2c64('0x52'),JSON[_0x2c64('0x3b')](_0x20332e[_0x2c64('0x51')]));this['startAcw'](_0x20332e['transfereruniqueid']);}else if(this[_0x2c64('0x8')][_0x20332e[_0x2c64('0x53')]]){logger['info'](_0x2c64('0x54'),JSON[_0x2c64('0x3b')](_0x20332e['transfererlinkedid']));this[_0x2c64('0x19')](_0x20332e['transfererlinkedid']);}}catch(_0x1bfd38){logger['error'](_0x2c64('0x55'),_0x1bfd38[_0x2c64('0x35')]);}};Acw[_0x2c64('0x18')][_0x2c64('0xf')]=function(_0x1d45cc){try{if(this[_0x2c64('0x6')][_0x1d45cc['queue']]&&this[_0x2c64('0x6')][_0x1d45cc['queue']][_0x2c64('0x56')]===_0x2c64('0x57')){if(this[_0x2c64('0x1f')][_0x1d45cc['interface']]){logger[_0x2c64('0x22')](_0x2c64('0x58'),_0x1d45cc['uniqueid'],_0x1d45cc[_0x2c64('0x40')],_0x1d45cc[_0x2c64('0x1a')]);return RpcUser[_0x2c64('0x26')](this[_0x2c64('0x1f')][_0x1d45cc[_0x2c64('0x40')]],_0x2c64('0x59'),_0x1d45cc[_0x2c64('0x2d')]);}}}catch(_0x508cac){logger['error'](_0x2c64('0x5a'),_0x508cac['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2aeb3b4..a15a2c8 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x1e38ff,_0x58c936){_0x1e38ff=_0x1e38ff-0x0;var _0x4f6a83=_0x2032[_0x1e38ff];return _0x4f6a83;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _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(_0x340bf9,_0x21f692){var _0x3b8724=function(_0x105e7f){while(--_0x105e7f){_0x340bf9['push'](_0x340bf9['shift']());}};_0x3b8724(++_0x21f692);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 941f5a9..8395e24 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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x13d821,_0x19ce86){var _0x229f75=function(_0x4aca84){while(--_0x4aca84){_0x13d821['push'](_0x13d821['shift']());}};_0x229f75(++_0x19ce86);}(_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 +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb91[_0x43f881];return _0x365c14;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f6672ea..81644b4 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 _0xa8fd=['originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','firstName','number','Contact','phone','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xa8fd,0xe4));var _0xda8f=function(_0xd10d51,_0x37eb56){_0xd10d51=_0xd10d51-0x0;var _0x5e7b61=_0xa8fd[_0xd10d51];return _0x5e7b61;};'use strict';var util=require(_0xda8f('0x0'));var _=require(_0xda8f('0x1'));var moment=require(_0xda8f('0x2'));function checkNameSurname(_0x11ea82,_0x1c079a,_0x4a8c50){var _0x3cb92e='';if(!_['isNil'](_0x1c079a)&&_0xda8f('0x3')===typeof _0x1c079a){_0x3cb92e+=_0x1c079a;}if(!_[_0xda8f('0x4')](_0x4a8c50)&&_0xda8f('0x3')===typeof _0x4a8c50){_0x3cb92e+='\x20'+_0x4a8c50;}if(_0x3cb92e!==''){return _0x3cb92e;}return _0x11ea82;}function Action(_0x428f61,_0x144da1,_0x27a9dd){this[_0xda8f('0x5')]=_0x428f61;this[_0xda8f('0x6')]=_0x27a9dd||undefined;this[_0xda8f('0x7')]=checkNameSurname(_0x144da1['Contact']['phone'],_0x144da1['Contact'][_0xda8f('0x8')],_0x144da1['Contact']['lastName']);this[_0xda8f('0x9')]=_0x144da1[_0xda8f('0xa')][_0xda8f('0xb')];this[_0xda8f('0xc')]=_0x428f61[_0xda8f('0x7')];this['active']=_0x144da1['active']||![];this['type']=_0x428f61[_0xda8f('0xd')];this['dialQueueTimeout']=_0x428f61[_0xda8f('0xe')]||0x3;this[_0xda8f('0xf')]=_0x144da1[_0xda8f('0xf')];this[_0xda8f('0x10')]=_0x144da1['countbusyretry'];this[_0xda8f('0x11')]=_0x144da1[_0xda8f('0x11')];this[_0xda8f('0x12')]=_0x144da1[_0xda8f('0x12')];this[_0xda8f('0x13')]=_0x144da1[_0xda8f('0x13')];this[_0xda8f('0x14')]=_0x144da1[_0xda8f('0x14')];this[_0xda8f('0x15')]=_0x144da1['countabandonedretry'];this['countmachineretry']=_0x144da1[_0xda8f('0x16')];this['countagentrejectretry']=_0x144da1[_0xda8f('0x17')];this[_0xda8f('0x18')]=_0x144da1[_0xda8f('0x18')];this[_0xda8f('0x19')]=_0x144da1[_0xda8f('0x19')];this[_0xda8f('0x1a')]=_0x144da1[_0xda8f('0x1a')];this[_0xda8f('0x1b')]=_0x144da1['VoiceQueueId'];this['CampaignId']=_0x144da1[_0xda8f('0x1c')];this[_0xda8f('0x1d')]=_0x144da1['id'];this['ContactFirstName']=_0x144da1[_0xda8f('0xa')]['firstName']||'';this[_0xda8f('0x1e')]=moment()['format'](_0xda8f('0x1f'));this[_0xda8f('0x20')]=_0x144da1['callback'];this[_0xda8f('0x21')]=_0x144da1[_0xda8f('0x21')];this[_0xda8f('0x22')]=_0x144da1[_0xda8f('0x22')];this['recallme']=_0x144da1[_0xda8f('0x23')];this[_0xda8f('0x24')]='';this[_0xda8f('0x25')]='';}Action[_0xda8f('0x26')][_0xda8f('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xda8f('0x7')],this[_0xda8f('0x5')][_0xda8f('0x28')]>0x0?this[_0xda8f('0x9')][_0xda8f('0x29')](this[_0xda8f('0x5')][_0xda8f('0x28')]):this[_0xda8f('0x9')]);};Action[_0xda8f('0x26')][_0xda8f('0x2a')]=function(){return this[_0xda8f('0xc')];};module[_0xda8f('0x2b')]=Action; \ No newline at end of file +var _0x0c68=['Contact','phone','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','queue','util','lodash','moment','string','isNil','uniqueid','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0c68,0x1f1));var _0x80c6=function(_0x1c14b5,_0x1e2e5d){_0x1c14b5=_0x1c14b5-0x0;var _0x4ba6da=_0x0c68[_0x1c14b5];return _0x4ba6da;};'use strict';var util=require(_0x80c6('0x0'));var _=require(_0x80c6('0x1'));var moment=require(_0x80c6('0x2'));function checkNameSurname(_0x543c22,_0x21e1b5,_0x25fca1){var _0x4c2cf8='';if(!_['isNil'](_0x21e1b5)&&_0x80c6('0x3')===typeof _0x21e1b5){_0x4c2cf8+=_0x21e1b5;}if(!_[_0x80c6('0x4')](_0x25fca1)&&'string'===typeof _0x25fca1){_0x4c2cf8+='\x20'+_0x25fca1;}if(_0x4c2cf8!==''){return _0x4c2cf8;}return _0x543c22;}function Action(_0x35c06c,_0x31d125,_0x2adf33){this['voiceQueue']=_0x35c06c;this[_0x80c6('0x5')]=_0x2adf33||undefined;this[_0x80c6('0x6')]=checkNameSurname(_0x31d125[_0x80c6('0x7')][_0x80c6('0x8')],_0x31d125[_0x80c6('0x7')]['firstName'],_0x31d125[_0x80c6('0x7')]['lastName']);this[_0x80c6('0x9')]=_0x31d125[_0x80c6('0x7')][_0x80c6('0x8')];this['queue']=_0x35c06c[_0x80c6('0x6')];this[_0x80c6('0xa')]=_0x31d125[_0x80c6('0xa')]||![];this[_0x80c6('0xb')]=_0x35c06c['type'];this[_0x80c6('0xc')]=_0x35c06c[_0x80c6('0xc')]||0x3;this[_0x80c6('0xd')]=_0x31d125[_0x80c6('0xd')];this[_0x80c6('0xe')]=_0x31d125[_0x80c6('0xe')];this['countcongestionretry']=_0x31d125[_0x80c6('0xf')];this['countnoanswerretry']=_0x31d125[_0x80c6('0x10')];this['countnosuchnumberretry']=_0x31d125[_0x80c6('0x11')];this[_0x80c6('0x12')]=_0x31d125[_0x80c6('0x12')];this[_0x80c6('0x13')]=_0x31d125['countabandonedretry'];this[_0x80c6('0x14')]=_0x31d125['countmachineretry'];this[_0x80c6('0x15')]=_0x31d125[_0x80c6('0x15')];this[_0x80c6('0x16')]=_0x31d125[_0x80c6('0x16')];this['ListId']=_0x31d125[_0x80c6('0x17')];this[_0x80c6('0x18')]=_0x31d125[_0x80c6('0x18')];this['VoiceQueueId']=_0x31d125[_0x80c6('0x19')];this[_0x80c6('0x1a')]=_0x31d125[_0x80c6('0x1a')];this[_0x80c6('0x1b')]=_0x31d125['id'];this[_0x80c6('0x1c')]=_0x31d125[_0x80c6('0x7')]['firstName']||'';this['starttime']=moment()[_0x80c6('0x1d')](_0x80c6('0x1e'));this['callback']=_0x31d125['callback'];this['callbackuniqueid']=_0x31d125[_0x80c6('0x1f')];this[_0x80c6('0x20')]=_0x31d125[_0x80c6('0x20')];this['recallme']=_0x31d125['recallme'];this[_0x80c6('0x21')]='';this[_0x80c6('0x22')]='';}Action[_0x80c6('0x23')][_0x80c6('0x24')]=function(){return util[_0x80c6('0x1d')](_0x80c6('0x25'),this[_0x80c6('0x6')],this[_0x80c6('0x26')][_0x80c6('0x27')]>0x0?this[_0x80c6('0x9')][_0x80c6('0x28')](this[_0x80c6('0x26')][_0x80c6('0x27')]):this[_0x80c6('0x9')]);};Action['prototype']['getQueue']=function(){return this[_0x80c6('0x29')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b63c9aa..9c5044a 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 _0xbe9b=['starttime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','exports','util','lodash','moment','milliseconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x39a75d,_0x4fbe57){var _0x4352bf=function(_0x5ce3fe){while(--_0x5ce3fe){_0x39a75d['push'](_0x39a75d['shift']());}};_0x4352bf(++_0x4fbe57);}(_0xbe9b,0x19b));var _0xbbe9=function(_0x2c07cf,_0x5f3fed){_0x2c07cf=_0x2c07cf-0x0;var _0x52f445=_0xbe9b[_0x2c07cf];return _0x52f445;};'use strict';var util=require(_0xbbe9('0x0'));var _=require(_0xbbe9('0x1'));var moment=require(_0xbbe9('0x2'));function getSeconds(_0x3d5757,_0x233236){var _0x16c168=moment(_0x3d5757)[_0xbbe9('0x3')](0x0);var _0x1c76e0=moment(_0x233236)[_0xbbe9('0x3')](0x0);return _0x16c168['diff'](_0x1c76e0,'seconds');}function AgentComplete(_0xa26a3b,_0x27b0c1){this[_0xbbe9('0x4')]=0x4;this[_0xbbe9('0x5')]=_0xbbe9('0x6');this['scheduledat']=_0xa26a3b[_0xbbe9('0x7')];this[_0xbbe9('0x8')]=_0xa26a3b[_0xbbe9('0x8')];this[_0xbbe9('0x9')]=_0xa26a3b[_0xbbe9('0x8')]===_0xbbe9('0xa')?_0xbbe9('0xb'):_0xa26a3b[_0xbbe9('0x8')];this[_0xbbe9('0xc')]=_0xa26a3b[_0xbbe9('0xc')];this[_0xbbe9('0xd')]=_0xa26a3b[_0xbbe9('0xd')];this['countnoanswerretry']=_0xa26a3b[_0xbbe9('0xe')];this[_0xbbe9('0xf')]=_0xa26a3b[_0xbbe9('0xc')]+_0xa26a3b[_0xbbe9('0xd')]+_0xa26a3b[_0xbbe9('0xe')]+_0xa26a3b[_0xbbe9('0x10')]+_0xa26a3b[_0xbbe9('0x11')]+_0xa26a3b['countabandonedretry']+_0xa26a3b[_0xbbe9('0x12')]+_0xa26a3b[_0xbbe9('0x13')];this[_0xbbe9('0x10')]=_0xa26a3b[_0xbbe9('0x10')];this[_0xbbe9('0x11')]=_0xa26a3b[_0xbbe9('0x11')];this[_0xbbe9('0x14')]=_0xa26a3b['countabandonedretry'];this[_0xbbe9('0x12')]=_0xa26a3b[_0xbbe9('0x12')];this[_0xbbe9('0x13')]=_0xa26a3b[_0xbbe9('0x13')];this[_0xbbe9('0x15')]=_0x27b0c1[_0xbbe9('0x15')];this[_0xbbe9('0x16')]=_0xa26a3b['name'];this['calleridnum']=_0xa26a3b[_0xbbe9('0x17')];this['starttime']=_0xa26a3b['starttime'];this[_0xbbe9('0x18')]=_0xa26a3b[_0xbbe9('0x18')];this['answertime']=_0xa26a3b[_0xbbe9('0x19')];this['endtime']=moment()[_0xbbe9('0x1a')](_0xbbe9('0x1b'));this[_0xbbe9('0x1c')]=getSeconds(_0xa26a3b[_0xbbe9('0x18')],_0xa26a3b[_0xbbe9('0x1d')]);this[_0xbbe9('0x1e')]=getSeconds(_0xa26a3b[_0xbbe9('0x19')],_0xa26a3b[_0xbbe9('0x18')]);this[_0xbbe9('0x1f')]=getSeconds(this['endtime'],_0xa26a3b[_0xbbe9('0x19')]);this[_0xbbe9('0xb')]=_0x27b0c1[_0xbbe9('0xb')];this[_0xbbe9('0x20')]=_0x27b0c1['membername'];this[_0xbbe9('0x21')]=_0x27b0c1[_0xbbe9('0x21')];this['callback']=_0xa26a3b[_0xbbe9('0x22')];this['callbackuniqueid']=_0xa26a3b[_0xbbe9('0x23')];this['callbackat']=_0xa26a3b[_0xbbe9('0x24')];this[_0xbbe9('0x25')]=_0xa26a3b[_0xbbe9('0x25')];this[_0xbbe9('0x26')]=_0xa26a3b[_0xbbe9('0x26')];this['ListId']=_0xa26a3b[_0xbbe9('0x27')];this['UserId']=_0xa26a3b[_0xbbe9('0x28')];this[_0xbbe9('0x29')]=_0xa26a3b[_0xbbe9('0x29')];this['CampaignId']=_0xa26a3b['CampaignId'];this['originatecalleridnum']=_0xa26a3b['originatecalleridnum']||'';this[_0xbbe9('0x2a')]=_0xa26a3b['originatecalleridname']||'';}module[_0xbbe9('0x2b')]=AgentComplete; \ No newline at end of file +var _0x0456=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x5356a0,_0x180097){var _0x1adf3f=function(_0x1364d9){while(--_0x1364d9){_0x5356a0['push'](_0x5356a0['shift']());}};_0x1adf3f(++_0x180097);}(_0x0456,0x1b6));var _0x6045=function(_0x7d493d,_0x2bc34d){_0x7d493d=_0x7d493d-0x0;var _0x2a7393=_0x0456[_0x7d493d];return _0x2a7393;};'use strict';var util=require(_0x6045('0x0'));var _=require(_0x6045('0x1'));var moment=require('moment');function getSeconds(_0x1de3fc,_0x2e1d4e){var _0x8df9e5=moment(_0x1de3fc)[_0x6045('0x2')](0x0);var _0x440979=moment(_0x2e1d4e)[_0x6045('0x2')](0x0);return _0x8df9e5[_0x6045('0x3')](_0x440979,_0x6045('0x4'));}function AgentComplete(_0x7f5e58,_0xd7aaa){this[_0x6045('0x5')]=0x4;this[_0x6045('0x6')]=_0x6045('0x7');this[_0x6045('0x8')]=_0x7f5e58[_0x6045('0x8')];this[_0x6045('0x9')]=_0x7f5e58[_0x6045('0x9')];this[_0x6045('0xa')]=_0x7f5e58['type']===_0x6045('0xb')?_0x6045('0xc'):_0x7f5e58[_0x6045('0x9')];this[_0x6045('0xd')]=_0x7f5e58['countbusyretry'];this[_0x6045('0xe')]=_0x7f5e58['countcongestionretry'];this['countnoanswerretry']=_0x7f5e58[_0x6045('0xf')];this[_0x6045('0x10')]=_0x7f5e58['countbusyretry']+_0x7f5e58[_0x6045('0xe')]+_0x7f5e58[_0x6045('0xf')]+_0x7f5e58[_0x6045('0x11')]+_0x7f5e58[_0x6045('0x12')]+_0x7f5e58[_0x6045('0x13')]+_0x7f5e58['countmachineretry']+_0x7f5e58[_0x6045('0x14')];this['countnosuchnumberretry']=_0x7f5e58['countnosuchnumberretry'];this['countdropretry']=_0x7f5e58[_0x6045('0x12')];this[_0x6045('0x13')]=_0x7f5e58[_0x6045('0x13')];this[_0x6045('0x15')]=_0x7f5e58[_0x6045('0x15')];this['countagentrejectretry']=_0x7f5e58[_0x6045('0x14')];this[_0x6045('0x16')]=_0xd7aaa[_0x6045('0x16')];this[_0x6045('0x17')]=_0x7f5e58[_0x6045('0x18')];this[_0x6045('0x19')]=_0x7f5e58[_0x6045('0x1a')];this[_0x6045('0x1b')]=_0x7f5e58[_0x6045('0x1b')];this[_0x6045('0x1c')]=_0x7f5e58['responsetime'];this[_0x6045('0x1d')]=_0x7f5e58[_0x6045('0x1d')];this['endtime']=moment()['format'](_0x6045('0x1e'));this[_0x6045('0x1f')]=getSeconds(_0x7f5e58['responsetime'],_0x7f5e58[_0x6045('0x1b')]);this['holdtime']=getSeconds(_0x7f5e58[_0x6045('0x1d')],_0x7f5e58[_0x6045('0x1c')]);this[_0x6045('0x20')]=getSeconds(this[_0x6045('0x21')],_0x7f5e58['answertime']);this[_0x6045('0xc')]=_0xd7aaa['queue'];this[_0x6045('0x22')]=_0xd7aaa[_0x6045('0x22')];this['reason']=_0xd7aaa[_0x6045('0x23')];this['callback']=_0x7f5e58['callback'];this['callbackuniqueid']=_0x7f5e58[_0x6045('0x24')];this[_0x6045('0x25')]=_0x7f5e58['callbackat'];this[_0x6045('0x26')]=_0x7f5e58['recallme'];this['ContactId']=_0x7f5e58[_0x6045('0x27')];this[_0x6045('0x28')]=_0x7f5e58[_0x6045('0x28')];this[_0x6045('0x29')]=_0x7f5e58[_0x6045('0x29')];this[_0x6045('0x2a')]=_0x7f5e58[_0x6045('0x2a')];this[_0x6045('0x2b')]=_0x7f5e58[_0x6045('0x2b')];this[_0x6045('0x2c')]=_0x7f5e58[_0x6045('0x2c')]||'';this[_0x6045('0x2d')]=_0x7f5e58[_0x6045('0x2d')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index f11415d..12d89cb 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 _0x0bde=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','starttime','responsetime'];(function(_0x418fa2,_0x4ad076){var _0x9fba5f=function(_0x4e1e9c){while(--_0x4e1e9c){_0x418fa2['push'](_0x418fa2['shift']());}};_0x9fba5f(++_0x4ad076);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0xe0bd('0x0'));var moment=require('moment');function getSeconds(_0x3fb344,_0x3dc984){var _0x1d8922=moment(_0x3fb344)[_0xe0bd('0x1')](0x0);var _0x2da4bd=moment(_0x3dc984)['milliseconds'](0x0);return _0x1d8922[_0xe0bd('0x2')](_0x2da4bd,_0xe0bd('0x3'));}function Final(_0x2b9812){this[_0xe0bd('0x4')]=_0x2b9812[_0xe0bd('0x4')];this[_0xe0bd('0x5')]=_0x2b9812[_0xe0bd('0x5')];this['type']=_0x2b9812[_0xe0bd('0x6')];this[_0xe0bd('0x7')]=_0x2b9812[_0xe0bd('0x6')]===_0xe0bd('0x8')?_0xe0bd('0x9'):_0x2b9812[_0xe0bd('0x6')];this[_0xe0bd('0xa')]=_0x2b9812[_0xe0bd('0xa')];this['countcongestionretry']=_0x2b9812['countcongestionretry'];this['countnoanswerretry']=_0x2b9812[_0xe0bd('0xb')];this['countglobal']=_0x2b9812['countbusyretry']+_0x2b9812[_0xe0bd('0xc')]+_0x2b9812[_0xe0bd('0xb')]+_0x2b9812['countnosuchnumberretry']+_0x2b9812[_0xe0bd('0xd')]+_0x2b9812['countabandonedretry']+_0x2b9812[_0xe0bd('0xe')]+_0x2b9812[_0xe0bd('0xf')];this[_0xe0bd('0x10')]=_0x2b9812[_0xe0bd('0x10')];this[_0xe0bd('0xd')]=_0x2b9812[_0xe0bd('0xd')];this[_0xe0bd('0x11')]=_0x2b9812[_0xe0bd('0x11')];this['countmachineretry']=_0x2b9812['countmachineretry'];this['countagentrejectretry']=_0x2b9812[_0xe0bd('0xf')];this[_0xe0bd('0x9')]=_0x2b9812[_0xe0bd('0x9')];this[_0xe0bd('0x12')]=_0x2b9812[_0xe0bd('0x12')];this['calleridnum']=_0x2b9812['calleridnum'];this[_0xe0bd('0x13')]=_0x2b9812['starttime'];this[_0xe0bd('0x14')]=_0x2b9812[_0xe0bd('0x14')];this[_0xe0bd('0x15')]=_0x2b9812[_0xe0bd('0x14')];this['ringtime']=_0x2b9812[_0xe0bd('0x16')]||0x0;this[_0xe0bd('0x17')]=_0x2b9812[_0xe0bd('0x17')]||0x0;this['talktime']=_0x2b9812[_0xe0bd('0x18')]||0x0;this[_0xe0bd('0x19')]=_0x2b9812[_0xe0bd('0x19')];this['callbackuniqueid']=_0x2b9812[_0xe0bd('0x1a')];this[_0xe0bd('0x1b')]=_0x2b9812[_0xe0bd('0x1b')];this['recallme']=_0x2b9812[_0xe0bd('0x1c')];this['ContactId']=_0x2b9812[_0xe0bd('0x1d')];this[_0xe0bd('0x1e')]=_0x2b9812['ListId'];this[_0xe0bd('0x1f')]=_0x2b9812[_0xe0bd('0x1f')];this[_0xe0bd('0x20')]=_0x2b9812[_0xe0bd('0x20')];this[_0xe0bd('0x21')]=_0x2b9812[_0xe0bd('0x21')];this[_0xe0bd('0x22')]=_0x2b9812[_0xe0bd('0x22')]||'';this['originatecalleridname']=_0x2b9812['originatecalleridname']||'';}module[_0xe0bd('0x23')]=Final; \ No newline at end of file +var _0xe5b3=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback'];(function(_0x465303,_0x7d0b38){var _0x4c98ec=function(_0x12733e){while(--_0x12733e){_0x465303['push'](_0x465303['shift']());}};_0x4c98ec(++_0x7d0b38);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2dc81d,_0x2e2c29){_0x2dc81d=_0x2dc81d-0x0;var _0x24a539=_0xe5b3[_0x2dc81d];return _0x24a539;};'use strict';var util=require('util');var _=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));function getSeconds(_0x243fe0,_0x1c38ed){var _0x2a71ef=moment(_0x243fe0)[_0x3e5b('0x2')](0x0);var _0x7f1cc0=moment(_0x1c38ed)[_0x3e5b('0x2')](0x0);return _0x2a71ef[_0x3e5b('0x3')](_0x7f1cc0,_0x3e5b('0x4'));}function Final(_0x36e319){this['uniqueid']=_0x36e319[_0x3e5b('0x5')];this[_0x3e5b('0x6')]=_0x36e319['scheduledat'];this[_0x3e5b('0x7')]=_0x36e319[_0x3e5b('0x7')];this[_0x3e5b('0x8')]=_0x36e319[_0x3e5b('0x7')]==='outbound'?'queue':_0x36e319[_0x3e5b('0x7')];this[_0x3e5b('0x9')]=_0x36e319[_0x3e5b('0x9')];this[_0x3e5b('0xa')]=_0x36e319[_0x3e5b('0xa')];this['countnoanswerretry']=_0x36e319[_0x3e5b('0xb')];this['countglobal']=_0x36e319[_0x3e5b('0x9')]+_0x36e319[_0x3e5b('0xa')]+_0x36e319[_0x3e5b('0xb')]+_0x36e319[_0x3e5b('0xc')]+_0x36e319[_0x3e5b('0xd')]+_0x36e319[_0x3e5b('0xe')]+_0x36e319[_0x3e5b('0xf')]+_0x36e319['countagentrejectretry'];this[_0x3e5b('0xc')]=_0x36e319['countnosuchnumberretry'];this['countdropretry']=_0x36e319['countdropretry'];this[_0x3e5b('0xe')]=_0x36e319[_0x3e5b('0xe')];this[_0x3e5b('0xf')]=_0x36e319['countmachineretry'];this[_0x3e5b('0x10')]=_0x36e319['countagentrejectretry'];this['queue']=_0x36e319[_0x3e5b('0x11')];this[_0x3e5b('0x12')]=_0x36e319['calleridname'];this[_0x3e5b('0x13')]=_0x36e319[_0x3e5b('0x13')];this['starttime']=_0x36e319[_0x3e5b('0x14')];this[_0x3e5b('0x15')]=_0x36e319['responsetime'];this['endtime']=_0x36e319[_0x3e5b('0x15')];this[_0x3e5b('0x16')]=_0x36e319[_0x3e5b('0x16')]||0x0;this[_0x3e5b('0x17')]=_0x36e319[_0x3e5b('0x17')]||0x0;this[_0x3e5b('0x18')]=_0x36e319[_0x3e5b('0x18')]||0x0;this[_0x3e5b('0x19')]=_0x36e319[_0x3e5b('0x19')];this[_0x3e5b('0x1a')]=_0x36e319[_0x3e5b('0x1a')];this[_0x3e5b('0x1b')]=_0x36e319[_0x3e5b('0x1b')];this[_0x3e5b('0x1c')]=_0x36e319['recallme'];this[_0x3e5b('0x1d')]=_0x36e319[_0x3e5b('0x1d')];this[_0x3e5b('0x1e')]=_0x36e319[_0x3e5b('0x1e')];this['UserId']=_0x36e319[_0x3e5b('0x1f')];this['VoiceQueueId']=_0x36e319[_0x3e5b('0x20')];this[_0x3e5b('0x21')]=_0x36e319['CampaignId'];this[_0x3e5b('0x22')]=_0x36e319[_0x3e5b('0x22')]||'';this[_0x3e5b('0x23')]=_0x36e319[_0x3e5b('0x23')]||'';}module[_0x3e5b('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index c2233fd..c7ada66 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 _0x9a8c=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','name','calleridnum','number','endtime','YYYY-MM-DD\x20HH:mm:ss','responsetime','starttime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0x452a85,_0x235749){var _0x295134=function(_0x41625d){while(--_0x41625d){_0x452a85['push'](_0x452a85['shift']());}};_0x295134(++_0x235749);}(_0x9a8c,0x1a5));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc9a8('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5f43a4,_0x54df77){var _0x2538ca=moment(_0x5f43a4)[_0xc9a8('0x1')](0x0);var _0x5c28c4=moment(_0x54df77)[_0xc9a8('0x1')](0x0);return _0x2538ca['diff'](_0x5c28c4,_0xc9a8('0x2'));}function Hangup(_0x3dbf3c,_0x2bb8ce){this['state']=0x4;this[_0xc9a8('0x3')]=_0xc9a8('0x4');this[_0xc9a8('0x5')]=_0x3dbf3c[_0xc9a8('0x5')];this[_0xc9a8('0x6')]=_0x3dbf3c['type'];this[_0xc9a8('0x7')]=_0x3dbf3c[_0xc9a8('0x6')]==='outbound'?_0xc9a8('0x8'):_0x3dbf3c['type'];this[_0xc9a8('0x9')]=_0x3dbf3c['countbusyretry'];this[_0xc9a8('0xa')]=_0x3dbf3c[_0xc9a8('0xa')];this[_0xc9a8('0xb')]=_0x3dbf3c[_0xc9a8('0xb')];this['countglobal']=_0x3dbf3c[_0xc9a8('0x9')]+_0x3dbf3c['countcongestionretry']+_0x3dbf3c[_0xc9a8('0xb')]+_0x3dbf3c['countnosuchnumberretry']+_0x3dbf3c['countdropretry']+_0x3dbf3c[_0xc9a8('0xc')]+_0x3dbf3c[_0xc9a8('0xd')]+_0x3dbf3c[_0xc9a8('0xe')];this['countnosuchnumberretry']=_0x3dbf3c[_0xc9a8('0xf')];this['countdropretry']=_0x3dbf3c[_0xc9a8('0x10')];this['countabandonedretry']=_0x3dbf3c[_0xc9a8('0xc')];this[_0xc9a8('0xd')]=_0x3dbf3c[_0xc9a8('0xd')];this['countagentrejectretry']=_0x3dbf3c[_0xc9a8('0xe')];this[_0xc9a8('0x11')]=_0x2bb8ce[_0xc9a8('0x11')];this['calleridname']=_0x3dbf3c[_0xc9a8('0x12')];this[_0xc9a8('0x13')]=_0x3dbf3c[_0xc9a8('0x14')];this['starttime']=_0x3dbf3c['starttime'];this['responsetime']=_0x3dbf3c['responsetime'];this[_0xc9a8('0x15')]=moment()['format'](_0xc9a8('0x16'));this['ringtime']=getSeconds(_0x3dbf3c[_0xc9a8('0x17')],_0x3dbf3c[_0xc9a8('0x18')]);this['holdtime']=0x0;this[_0xc9a8('0x19')]=getSeconds(this['endtime'],_0x3dbf3c[_0xc9a8('0x17')]);this[_0xc9a8('0x8')]=_0x3dbf3c[_0xc9a8('0x8')];this[_0xc9a8('0x1a')]=_0xc9a8('0x1b');this['reason']=_0x2bb8ce[_0xc9a8('0x1c')];this[_0xc9a8('0x1d')]=_0x3dbf3c[_0xc9a8('0x1d')];this[_0xc9a8('0x1e')]=_0x3dbf3c[_0xc9a8('0x1e')];this[_0xc9a8('0x1f')]=_0x3dbf3c[_0xc9a8('0x1f')];this[_0xc9a8('0x20')]=_0x3dbf3c[_0xc9a8('0x20')];this[_0xc9a8('0x21')]=_0x3dbf3c[_0xc9a8('0x21')];this[_0xc9a8('0x22')]=_0x3dbf3c[_0xc9a8('0x22')];this[_0xc9a8('0x23')]=_0x3dbf3c[_0xc9a8('0x23')];this['VoiceQueueId']=_0x3dbf3c[_0xc9a8('0x24')];this[_0xc9a8('0x25')]=_0x3dbf3c[_0xc9a8('0x25')];}module[_0xc9a8('0x26')]=Hangup; \ No newline at end of file +var _0x564c=['ringtime','membername','IVR','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x564c,0x1bb));var _0xc564=function(_0x4e0f5e,_0x4168c4){_0x4e0f5e=_0x4e0f5e-0x0;var _0x45de30=_0x564c[_0x4e0f5e];return _0x45de30;};'use strict';var util=require(_0xc564('0x0'));var _=require('lodash');var moment=require(_0xc564('0x1'));function getSeconds(_0x441c7b,_0x5e289f){var _0x30878c=moment(_0x441c7b)[_0xc564('0x2')](0x0);var _0x2a8199=moment(_0x5e289f)[_0xc564('0x2')](0x0);return _0x30878c['diff'](_0x2a8199,_0xc564('0x3'));}function Hangup(_0x179f86,_0x4faea2){this[_0xc564('0x4')]=0x4;this[_0xc564('0x5')]=_0xc564('0x6');this[_0xc564('0x7')]=_0x179f86[_0xc564('0x7')];this[_0xc564('0x8')]=_0x179f86[_0xc564('0x8')];this['campaigntype']=_0x179f86[_0xc564('0x8')]===_0xc564('0x9')?_0xc564('0xa'):_0x179f86[_0xc564('0x8')];this[_0xc564('0xb')]=_0x179f86[_0xc564('0xb')];this['countcongestionretry']=_0x179f86['countcongestionretry'];this[_0xc564('0xc')]=_0x179f86['countnoanswerretry'];this[_0xc564('0xd')]=_0x179f86['countbusyretry']+_0x179f86['countcongestionretry']+_0x179f86[_0xc564('0xc')]+_0x179f86[_0xc564('0xe')]+_0x179f86[_0xc564('0xf')]+_0x179f86[_0xc564('0x10')]+_0x179f86['countmachineretry']+_0x179f86['countagentrejectretry'];this['countnosuchnumberretry']=_0x179f86[_0xc564('0xe')];this[_0xc564('0xf')]=_0x179f86['countdropretry'];this['countabandonedretry']=_0x179f86['countabandonedretry'];this['countmachineretry']=_0x179f86[_0xc564('0x11')];this['countagentrejectretry']=_0x179f86[_0xc564('0x12')];this[_0xc564('0x13')]=_0x4faea2[_0xc564('0x13')];this['calleridname']=_0x179f86['name'];this[_0xc564('0x14')]=_0x179f86['number'];this['starttime']=_0x179f86[_0xc564('0x15')];this[_0xc564('0x16')]=_0x179f86['responsetime'];this[_0xc564('0x17')]=moment()['format'](_0xc564('0x18'));this[_0xc564('0x19')]=getSeconds(_0x179f86[_0xc564('0x16')],_0x179f86['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0xc564('0x17')],_0x179f86[_0xc564('0x16')]);this[_0xc564('0xa')]=_0x179f86['queue'];this[_0xc564('0x1a')]=_0xc564('0x1b');this['reason']=_0x4faea2[_0xc564('0x1c')];this['callback']=_0x179f86['callback'];this[_0xc564('0x1d')]=_0x179f86[_0xc564('0x1d')];this[_0xc564('0x1e')]=_0x179f86['callbackat'];this[_0xc564('0x1f')]=_0x179f86[_0xc564('0x1f')];this['ContactId']=_0x179f86[_0xc564('0x20')];this[_0xc564('0x21')]=_0x179f86[_0xc564('0x21')];this['UserId']=_0x179f86['UserId'];this[_0xc564('0x22')]=_0x179f86['VoiceQueueId'];this[_0xc564('0x23')]=_0x179f86['CampaignId'];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index d105a7d..301867a 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 _0x0f2a=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','outbound','queue'];(function(_0x25083a,_0x1f5f08){var _0x35246e=function(_0x21d2e2){while(--_0x21d2e2){_0x25083a['push'](_0x25083a['shift']());}};_0x35246e(++_0x1f5f08);}(_0x0f2a,0x12e));var _0xa0f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f2a[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xa0f2('0x0'));var _=require(_0xa0f2('0x1'));var moment=require(_0xa0f2('0x2'));function getSeconds(_0xc6cb26,_0x1f6f53){var _0x327a2f=moment(_0xc6cb26)[_0xa0f2('0x3')](0x0);var _0x487fbb=moment(_0x1f6f53)[_0xa0f2('0x3')](0x0);return _0x327a2f[_0xa0f2('0x4')](_0x487fbb,_0xa0f2('0x5'));}function History(_0x56a16e){this[_0xa0f2('0x6')]=_0x56a16e[_0xa0f2('0x6')];this['scheduledat']=_0x56a16e['scheduledat']||undefined;this[_0xa0f2('0x7')]=_0x56a16e[_0xa0f2('0x7')];this['campaigntype']=_0x56a16e[_0xa0f2('0x7')]===_0xa0f2('0x8')?_0xa0f2('0x9'):_0x56a16e[_0xa0f2('0x7')];this[_0xa0f2('0xa')]=_0x56a16e[_0xa0f2('0xa')];this[_0xa0f2('0xb')]=_0x56a16e[_0xa0f2('0xb')];this['countnoanswerretry']=_0x56a16e[_0xa0f2('0xc')];this[_0xa0f2('0xd')]=_0x56a16e[_0xa0f2('0xa')]+_0x56a16e['countcongestionretry']+_0x56a16e[_0xa0f2('0xc')]+_0x56a16e[_0xa0f2('0xe')]+_0x56a16e[_0xa0f2('0xf')]+_0x56a16e[_0xa0f2('0x10')]+_0x56a16e[_0xa0f2('0x11')]+_0x56a16e[_0xa0f2('0x12')];this['countnosuchnumberretry']=_0x56a16e[_0xa0f2('0xe')];this[_0xa0f2('0xf')]=_0x56a16e[_0xa0f2('0xf')];this[_0xa0f2('0x10')]=_0x56a16e['countabandonedretry'];this[_0xa0f2('0x11')]=_0x56a16e[_0xa0f2('0x11')];this[_0xa0f2('0x12')]=_0x56a16e[_0xa0f2('0x12')];this['queue']=_0x56a16e[_0xa0f2('0x9')];this[_0xa0f2('0x13')]=_0x56a16e['name'];this[_0xa0f2('0x14')]=_0x56a16e[_0xa0f2('0x15')];this['starttime']=_0x56a16e[_0xa0f2('0x16')];this[_0xa0f2('0x17')]=_0x56a16e[_0xa0f2('0x17')];this[_0xa0f2('0x18')]=_0x56a16e[_0xa0f2('0x17')];this[_0xa0f2('0x19')]=getSeconds(_0x56a16e[_0xa0f2('0x17')],_0x56a16e[_0xa0f2('0x16')]);this[_0xa0f2('0x1a')]=0x0;this['talktime']=0x0;this[_0xa0f2('0x1b')]=_0x56a16e[_0xa0f2('0x1b')];this[_0xa0f2('0x1c')]=_0x56a16e['callbackuniqueid'];this[_0xa0f2('0x1d')]=_0x56a16e['callbackat'];this[_0xa0f2('0x1e')]=_0x56a16e['recallme'];this[_0xa0f2('0x1f')]=_0x56a16e[_0xa0f2('0x1f')];this[_0xa0f2('0x20')]=_0x56a16e[_0xa0f2('0x20')];this[_0xa0f2('0x21')]=_0x56a16e['UserId'];this[_0xa0f2('0x22')]=_0x56a16e[_0xa0f2('0x22')];this[_0xa0f2('0x23')]=_0x56a16e[_0xa0f2('0x23')];this[_0xa0f2('0x24')]=_0x56a16e[_0xa0f2('0x24')]||'';this[_0xa0f2('0x25')]=_0x56a16e[_0xa0f2('0x25')]||'';}module[_0xa0f2('0x26')]=History; \ No newline at end of file +var _0xb155=['originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x30990e,_0x4fbebe){var _0x4a9b6d=function(_0x14b6cc){while(--_0x14b6cc){_0x30990e['push'](_0x30990e['shift']());}};_0x4a9b6d(++_0x4fbebe);}(_0xb155,0x1a5));var _0x5b15=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0xb155[_0x15e6fe];return _0x34894d;};'use strict';var util=require('util');var _=require(_0x5b15('0x0'));var moment=require('moment');function getSeconds(_0x3592e1,_0x3efede){var _0x3a3168=moment(_0x3592e1)['milliseconds'](0x0);var _0x424c65=moment(_0x3efede)[_0x5b15('0x1')](0x0);return _0x3a3168[_0x5b15('0x2')](_0x424c65,_0x5b15('0x3'));}function History(_0x43e820){this[_0x5b15('0x4')]=_0x43e820[_0x5b15('0x4')];this[_0x5b15('0x5')]=_0x43e820['scheduledat']||undefined;this['type']=_0x43e820['type'];this[_0x5b15('0x6')]=_0x43e820[_0x5b15('0x7')]===_0x5b15('0x8')?'queue':_0x43e820[_0x5b15('0x7')];this['countbusyretry']=_0x43e820[_0x5b15('0x9')];this[_0x5b15('0xa')]=_0x43e820['countcongestionretry'];this[_0x5b15('0xb')]=_0x43e820[_0x5b15('0xb')];this[_0x5b15('0xc')]=_0x43e820[_0x5b15('0x9')]+_0x43e820[_0x5b15('0xa')]+_0x43e820[_0x5b15('0xb')]+_0x43e820[_0x5b15('0xd')]+_0x43e820['countdropretry']+_0x43e820[_0x5b15('0xe')]+_0x43e820[_0x5b15('0xf')]+_0x43e820[_0x5b15('0x10')];this[_0x5b15('0xd')]=_0x43e820[_0x5b15('0xd')];this['countdropretry']=_0x43e820[_0x5b15('0x11')];this[_0x5b15('0xe')]=_0x43e820['countabandonedretry'];this[_0x5b15('0xf')]=_0x43e820[_0x5b15('0xf')];this[_0x5b15('0x10')]=_0x43e820['countagentrejectretry'];this[_0x5b15('0x12')]=_0x43e820['queue'];this[_0x5b15('0x13')]=_0x43e820[_0x5b15('0x14')];this[_0x5b15('0x15')]=_0x43e820['number'];this['starttime']=_0x43e820[_0x5b15('0x16')];this[_0x5b15('0x17')]=_0x43e820[_0x5b15('0x17')];this['endtime']=_0x43e820[_0x5b15('0x17')];this[_0x5b15('0x18')]=getSeconds(_0x43e820[_0x5b15('0x17')],_0x43e820[_0x5b15('0x16')]);this[_0x5b15('0x19')]=0x0;this['talktime']=0x0;this[_0x5b15('0x1a')]=_0x43e820[_0x5b15('0x1a')];this[_0x5b15('0x1b')]=_0x43e820[_0x5b15('0x1b')];this[_0x5b15('0x1c')]=_0x43e820[_0x5b15('0x1c')];this[_0x5b15('0x1d')]=_0x43e820[_0x5b15('0x1d')];this[_0x5b15('0x1e')]=_0x43e820[_0x5b15('0x1e')];this[_0x5b15('0x1f')]=_0x43e820[_0x5b15('0x1f')];this[_0x5b15('0x20')]=_0x43e820[_0x5b15('0x20')];this[_0x5b15('0x21')]=_0x43e820[_0x5b15('0x21')];this[_0x5b15('0x22')]=_0x43e820[_0x5b15('0x22')];this[_0x5b15('0x23')]=_0x43e820[_0x5b15('0x23')]||'';this[_0x5b15('0x24')]=_0x43e820[_0x5b15('0x24')]||'';}module[_0x5b15('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0ec4b82..7b15eda 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 _0xda55=['[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','dialPredictiveOptimization','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','booked','predictive','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','milliseconds','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','stringify','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','state','starttime','clearZombieChannels','[uniqueid]','actions','[actions]','prototype','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','active','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialMachineMaxRetry','createStateFinal','ListId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','droptime','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','Drop','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','countglobal','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','paused','stateinterface','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','true','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\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','dialQueueTimeout','ACTIVE','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','[originateError]:\x20%s','[originate][error]','responsetime','getQueue','isSuccess','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x1f7f9f,_0x330b00){var _0x5d999f=function(_0x472b4b){while(--_0x472b4b){_0x1f7f9f['push'](_0x1f7f9f['shift']());}};_0x5d999f(++_0x330b00);}(_0xda55,0x6d));var _0x5da5=function(_0x4adbbc,_0x2b98ce){_0x4adbbc=_0x4adbbc-0x0;var _0x3b9187=_0xda55[_0x4adbbc];return _0x3b9187;};'use strict';var util=require(_0x5da5('0x0'));var _=require(_0x5da5('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x5da5('0x2'));var rr=require('rr');var md5=require(_0x5da5('0x3'));var Redis=require(_0x5da5('0x4'));var ut=require(_0x5da5('0x5'));var config=require(_0x5da5('0x6'));var logger=require('../../../config/logger')(_0x5da5('0x7'));var loggerBooked=require('../../../config/logger')(_0x5da5('0x8'));var loggerPredictive=require('../../../config/logger')(_0x5da5('0x9'));var loggerPredictiveCalls=require(_0x5da5('0xa'))(_0x5da5('0xb'));var loggerSyncQueueSummary=require(_0x5da5('0xa'))(_0x5da5('0xc'));var ami=require(_0x5da5('0xd'));config[_0x5da5('0xe')]=_[_0x5da5('0xf')](config['redis'],{'host':_0x5da5('0x10'),'port':0x18eb});var io=require(_0x5da5('0x11'))(new Redis(config[_0x5da5('0xe')]));var cmHopper=require(_0x5da5('0x12'));var cmHopperHistory=require(_0x5da5('0x13'));var cmHopperBlack=require(_0x5da5('0x14'));var voiceQueueRt=require(_0x5da5('0x15'));var Action=require('./action');var History=require(_0x5da5('0x16'));var Final=require(_0x5da5('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x5da5('0x18'));var Hangup=require(_0x5da5('0x19'));var ipAgi=process[_0x5da5('0x1a')][_0x5da5('0x1b')]||_0x5da5('0x1c');var strategy={'rrmemory':_0x5da5('0x1d'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4267cd){this[_0x5da5('0x1e')]=this[_0x5da5('0x1e')]?this[_0x5da5('0x1e')][_0x5da5('0x1f')](_0x4267cd):_0x4267cd();};function Dialer(_0x134afa,_0x3aff51){this['sequence']=new Sequence();this[_0x5da5('0x20')]=_0x3aff51;this[_0x5da5('0x21')]=_0x134afa[_0x5da5('0x21')];this[_0x5da5('0x22')]=_0x134afa[_0x5da5('0x22')];this[_0x5da5('0x23')]=_0x134afa['agents'];this[_0x5da5('0x24')]=_0x134afa[_0x5da5('0x24')];this[_0x5da5('0x25')]=config[_0x5da5('0x25')]||0x2;this[_0x5da5('0x26')]={};this['actions']={};this[_0x5da5('0x27')]={};this[_0x5da5('0x28')]={};this[_0x5da5('0x29')]={};this['startPredictive']={};this[_0x5da5('0x2a')]={};this[_0x5da5('0x2b')]={};this[_0x5da5('0x2c')]={};this[_0x5da5('0x2d')]={};ami['on'](_0x5da5('0x2e'),this[_0x5da5('0x2f')]['bind'](this));ami['on'](_0x5da5('0x30'),this['syncQueueCallerAbandon'][_0x5da5('0x31')](this));ami['on'](_0x5da5('0x32'),this[_0x5da5('0x33')]['bind'](this));ami['on'](_0x5da5('0x34'),this[_0x5da5('0x35')][_0x5da5('0x31')](this));ami['on'](_0x5da5('0x36'),this['syncQueueSummary']['bind'](this));ami['on']('hangup',this[_0x5da5('0x37')]['bind'](this));ami['on']('newexten',this[_0x5da5('0x38')][_0x5da5('0x31')](this));ami['on']('varset',this[_0x5da5('0x39')][_0x5da5('0x31')](this));ami['on']('queuemember',this[_0x5da5('0x3a')][_0x5da5('0x31')](this));ami['on'](_0x5da5('0x3b'),this[_0x5da5('0x3c')][_0x5da5('0x31')](this));this['loopCampaigns']();this[_0x5da5('0x3d')]();}function isNotNull(_0x2e3c5d){return _0x2e3c5d!==null&&!_[_0x5da5('0x3e')](_0x2e3c5d);}function checkIsLoggedIn(_0x15a0c0,_0x55e2bf){return function(){if(_0x55e2bf<=0x0){_0x15a0c0['message']='AGENTS_NOT_LOGGED';throw _0x15a0c0[_0x5da5('0x3f')]+_0x5da5('0x40');}};}function isActive(_0x15344b){return _0x15344b;}function checkIsActive(_0x338de0,_0x51b712){return function(){if(!isActive(_0x51b712)){_0x338de0['message']=_0x5da5('0x41');throw _0x338de0['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x2dd4b6){return function(){if(!isNotNull(_0x2dd4b6['Interval'])){_0x2dd4b6[_0x5da5('0x42')]=_0x5da5('0x43');throw _0x2dd4b6[_0x5da5('0x3f')]+_0x5da5('0x44');}if(!isNotNull(_0x2dd4b6[_0x5da5('0x45')][_0x5da5('0x46')])){_0x2dd4b6[_0x5da5('0x42')]=_0x5da5('0x43');throw _0x2dd4b6['name']+_0x5da5('0x44');}if(!isNotNull(_['isEmpty'](_0x2dd4b6[_0x5da5('0x45')][_0x5da5('0x46')]))){_0x2dd4b6[_0x5da5('0x42')]=_0x5da5('0x43');throw _0x2dd4b6[_0x5da5('0x3f')]+_0x5da5('0x44');}};}function msgResponse(_0x325ccd,_0x117610,_0xf6c5c9){return{'action':_0x325ccd,'response':_0x117610,'message':_0xf6c5c9,'stack':_0xf6c5c9};}function myreject(_0x1828e9){return function(_0x44f35d){return _0x1828e9(msgResponse(_0x5da5('0x47'),_0x5da5('0x48'),JSON['stringify'](_0x44f35d)));};}function getSeconds(_0x43686c,_0x4cf3ad){var _0x2d6280=moment(_0x43686c)[_0x5da5('0x49')](0x0);var _0x29d6aa=moment(_0x4cf3ad)[_0x5da5('0x49')](0x0);return _0x2d6280['diff'](_0x29d6aa,_0x5da5('0x4a'));}function emit(_0x2f2596,_0x22e26a,_0x56fd57){io['to'](_0x2f2596)[_0x5da5('0x4b')](_0x22e26a,_0x56fd57);}function emitVoiceQueueSummary(_0x2e5107){if(_0x2e5107['type']===_0x5da5('0x4c')){var _0xa90d5={'id':_0x2e5107['id'],'name':_0x2e5107[_0x5da5('0x3f')],'strategy':_0x2e5107[_0x5da5('0x4d')],'answered':_0x2e5107[_0x5da5('0x4e')],'available':_0x2e5107[_0x5da5('0x4f')],'loggedIn':_0x2e5107['loggedIn'],'pTalking':_0x2e5107[_0x5da5('0x50')],'sumBillable':_0x2e5107[_0x5da5('0x51')],'sumDuration':_0x2e5107[_0x5da5('0x52')],'sumHoldTime':_0x2e5107[_0x5da5('0x53')]||0x0,'talking':_0x2e5107[_0x5da5('0x54')],'total':_0x2e5107['total'],'type':_0x2e5107[_0x5da5('0x55')],'unmanaged':_0x2e5107[_0x5da5('0x56')],'abandoned':_0x2e5107['abandoned'],'waiting':_0x2e5107[_0x5da5('0x57')],'loggedInDb':_0x2e5107['loggedInDb'],'dialActive':_0x2e5107['dialActive'],'dialMethod':_0x2e5107[_0x5da5('0x58')],'dialOriginateCallerIdName':_0x2e5107[_0x5da5('0x59')],'dialOriginateCallerIdNumber':_0x2e5107[_0x5da5('0x5a')],'dialOriginateTimeout':_0x2e5107[_0x5da5('0x5b')],'dialPrefix':_0x2e5107[_0x5da5('0x5c')],'outboundAnswerAgiCallsDay':_0x2e5107[_0x5da5('0x5d')],'outboundAnswerCallsDay':_0x2e5107[_0x5da5('0x5e')],'outboundBlacklistCallsDay':_0x2e5107[_0x5da5('0x5f')],'outboundBusyCallsDay':_0x2e5107[_0x5da5('0x60')],'outboundCongestionCallsDay':_0x2e5107[_0x5da5('0x61')],'outboundDropCallsDayACS':_0x2e5107[_0x5da5('0x62')],'outboundDropCallsDayCallersExit':_0x2e5107[_0x5da5('0x63')],'outboundDropCallsDayTimeout':_0x2e5107[_0x5da5('0x64')],'outboundNoAnswerCallsDay':_0x2e5107[_0x5da5('0x65')],'outboundNoSuchCallsDay':_0x2e5107[_0x5da5('0x66')],'outboundOriginateFailureCallsDay':_0x2e5107[_0x5da5('0x67')],'outboundReCallsDay':_0x2e5107[_0x5da5('0x68')],'outboundRejectCallsDay':_0x2e5107[_0x5da5('0x69')],'outboundUnknownCallsDay':_0x2e5107[_0x5da5('0x6a')],'predictiveIntervalAnsweredCalls':_0x2e5107[_0x5da5('0x6b')],'predictiveIntervalAvgHoldtime':_0x2e5107['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2e5107['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2e5107[_0x5da5('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x2e5107[_0x5da5('0x6d')],'predictiveIntervalErlangCalls':_0x2e5107['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x2e5107[_0x5da5('0x6e')],'predictiveIntervalHitRate':_0x2e5107[_0x5da5('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x2e5107[_0x5da5('0x70')],'predictiveIntervalPauses':_0x2e5107[_0x5da5('0x71')],'predictiveIntervalAvailable':_0x2e5107[_0x5da5('0x72')],'predictiveIntervalTotalCalls':_0x2e5107[_0x5da5('0x73')],'message':_0x2e5107[_0x5da5('0x42')],'originated':_0x2e5107[_0x5da5('0x74')],'erlangCalls':_0x2e5107[_0x5da5('0x75')],'erlangCallToSecond':_0x2e5107[_0x5da5('0x76')],'erlangAbandonmentRate':_0x2e5107['erlangAbandonmentRate'],'erlangBusyFactor':_0x2e5107[_0x5da5('0x77')],'startPredictive':_0x2e5107['startPredictive'],'startProgressive':_0x2e5107['startProgressive']};if(_0x2e5107[_0x5da5('0x78')]){_0xa90d5[_0x5da5('0x78')]={'id':_0x2e5107[_0x5da5('0x78')]['id'],'name':_0x2e5107[_0x5da5('0x78')][_0x5da5('0x3f')],'active':_0x2e5107[_0x5da5('0x78')]['active'],'callerid':_0x2e5107[_0x5da5('0x78')]['callerid']};}if(_0x2e5107['Interval']){_0xa90d5[_0x5da5('0x45')]={'id':_0x2e5107[_0x5da5('0x45')]['id'],'name':_0x2e5107['Interval'][_0x5da5('0x3f')]};}var _0x322b08=md5(JSON[_0x5da5('0x79')](_0xa90d5));if(_0x2e5107[_0x5da5('0x3')]!==_0x322b08){_0x2e5107[_0x5da5('0x3')]=_0x322b08;emit(util['format'](_0x5da5('0x7a'),_0xa90d5['name']),'voice_queue:save',_0xa90d5);}}}function emitCampaignSummary(_0x361f5f){if(_0x361f5f['type']===_0x5da5('0x7b')){emit(util[_0x5da5('0x7c')](_0x5da5('0x7d'),_0x361f5f[_0x5da5('0x3f')]),_0x5da5('0x7e'),_0x361f5f);}}function checkGetDataPredictive(_0xceea44){if(isNotNull(_0xceea44)&&!_['isEmpty'](_0xceea44)){loggerPredictive['info'](_0x5da5('0x7f'));loggerPredictive[_0x5da5('0x80')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xceea44['predictiveIntervalTotalCalls']);loggerPredictive[_0x5da5('0x80')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xceea44[_0x5da5('0x6b')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xceea44[_0x5da5('0x6d')]);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x81'),_0xceea44[_0x5da5('0x6c')]);loggerPredictive['info'](_0x5da5('0x82'),_0xceea44[_0x5da5('0x83')]);loggerPredictive[_0x5da5('0x80')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xceea44[_0x5da5('0x84')]);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x85'));if(_0xceea44[_0x5da5('0x73')]>0x0){if(!_[_0x5da5('0x3e')](_0xceea44[_0x5da5('0x84')])&&_0xceea44[_0x5da5('0x84')]>0x0){return!![];}loggerPredictive[_0x5da5('0x80')](_0x5da5('0x86'));if(!_[_0x5da5('0x3e')](_0xceea44[_0x5da5('0x83')])&&_0xceea44[_0x5da5('0x83')]>0x0){return!![];}loggerPredictive[_0x5da5('0x80')](_0x5da5('0x87'));}else{loggerPredictive[_0x5da5('0x80')](_0x5da5('0x88'));}}else{loggerPredictive[_0x5da5('0x80')](_0x5da5('0x89'));}return![];}function mergeDataErlangB(_0x191691){return function(_0x303ab4){loggerPredictive[_0x5da5('0x80')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5da5('0x80')](_0x5da5('0x8a'),_0x303ab4['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x303ab4[_0x5da5('0x76')]);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x8b'),_0x303ab4['erlangAbandonmentRate']);loggerPredictive['info'](_0x5da5('0x8c'),_0x303ab4[_0x5da5('0x77')]);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x8b'),_0x303ab4['erlangAbandonmentRate']);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x85'));_[_0x5da5('0x8d')](_0x191691,_0x303ab4);};}function getDiff(_0x4e4ffa){var _0x2d6e0f=moment()['milliseconds'](0x0);var _0x107211=moment(_0x4e4ffa)[_0x5da5('0x49')](0x0);return _0x2d6e0f[_0x5da5('0x8e')](_0x107211,_0x5da5('0x4a'));}function ifInterval(_0x12c983,_0x182189){if(_[_0x5da5('0x3e')](_0x182189)){return![];}return getDiff(_0x182189)<_0x12c983*0x3c;}function freeVariablesPredictive(_0x2c13f1){if(isNotNull(_0x2c13f1)){if(!_[_0x5da5('0x3e')](_0x2c13f1[_0x5da5('0x2a')])){_0x2c13f1[_0x5da5('0x2a')]=undefined;loggerPredictive[_0x5da5('0x80')](_0x2c13f1[_0x5da5('0x3f')],_0x5da5('0x8f'));}if(!_[_0x5da5('0x3e')](_0x2c13f1[_0x5da5('0x90')])){_0x2c13f1[_0x5da5('0x90')]=undefined;loggerPredictive[_0x5da5('0x80')](_0x2c13f1[_0x5da5('0x3f')],_0x5da5('0x91'));}if(!_[_0x5da5('0x3e')](_0x2c13f1['handlePredictive'])){clearInterval(_0x2c13f1['handlePredictive']);_0x2c13f1[_0x5da5('0x92')]=undefined;loggerPredictive[_0x5da5('0x80')](_0x2c13f1[_0x5da5('0x3f')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x2ca7b9,_0x4520ea){if(_0x4520ea===0x0){return 0x0;}var _0x43b55e=0x1;for(var _0x23af39=0x1;_0x23af39<=_0x4520ea;_0x23af39+=0x1){_0x43b55e=0x1+_0x43b55e*_0x23af39/_0x2ca7b9;}return 0x1/_0x43b55e;}function isVoiceQueueOutbound(_0x50331b){return _0x50331b===_0x5da5('0x4c');}function isNotPreview(_0x5f3753){return _0x5f3753!==_0x5da5('0x20');}function isCampaignIvr(_0x5f862f){return _0x5f862f===_0x5da5('0x7b');}function getCallerId(_0x53cb6a,_0x57966d,_0x41e3a6){if(!_[_0x5da5('0x3e')](_0x41e3a6)&&typeof _0x41e3a6==='string'&&!_['isEmpty'](_0x41e3a6)){if(!_['isUndefined'](_0x57966d)&&typeof _0x57966d===_0x5da5('0x93')&&!_[_0x5da5('0x94')](_0x57966d)){return util[_0x5da5('0x7c')](_0x5da5('0x95'),_0x57966d,_0x41e3a6);}return util[_0x5da5('0x7c')](_0x5da5('0x95'),_0x41e3a6,_0x41e3a6);}if(!_[_0x5da5('0x3e')](_0x53cb6a)&&typeof _0x53cb6a===_0x5da5('0x93')&&!_['isEmpty'](_0x53cb6a)){return _0x53cb6a;}return _0x5da5('0x96');}function loggerCatchQueueSummary(_0x444b99,_0x592866){return function(_0x4dc0ab){freeVariablesPredictive(_0x592866);emitVoiceQueueSummary(_0x592866);emitCampaignSummary(_0x592866);loggerSyncQueueSummary[_0x5da5('0x97')](_0x444b99,util['inspect'](_0x4dc0ab,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1cca6c,_0x4f7e64){return function(_0x2adeab){loggerPredictive[_0x5da5('0x97')](_0x4f7e64[_0x5da5('0x3f')],_0x1cca6c);loggerPredictive[_0x5da5('0x97')](_0x2adeab[_0x5da5('0x98')]);freeVariablesPredictive(_0x4f7e64);};}function loggerCatch(_0x9f6467){return function(_0x3b35a4){logger[_0x5da5('0x97')](_0x9f6467,util[_0x5da5('0x99')](_0x3b35a4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x20c1e7){return _0x20c1e7&&!_[_0x5da5('0x3e')](_0x20c1e7)&&_0x20c1e7[_0x5da5('0x9a')]>0x0;}function decremetOriginate(_0x4f97a3){if(!_['isUndefined'](_0x4f97a3)&&_0x4f97a3!==null){if(typeof _0x4f97a3[_0x5da5('0x74')]!==_0x5da5('0x9b')){if(_0x4f97a3[_0x5da5('0x74')]>0x0){_0x4f97a3[_0x5da5('0x74')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x5da5('0x9c'));}}function checkContactLowerLimitOriginate(_0x3833ac,_0x1fa0f5,_0x8f66c1){if(_0x1fa0f5>_0x8f66c1){for(var _0x1cc973=0x0;_0x1cc973<_0x1fa0f5-_0x8f66c1;_0x1cc973+=0x1){decremetOriginate(_0x3833ac);}}}function loggerGetContactDialer(_0x74801a,_0x245a85,_0x3c0e6d){return function(_0x1c8283){checkContactLowerLimitOriginate(_0x245a85,_0x3c0e6d,0x0);logger[_0x5da5('0x97')](_0x74801a,util[_0x5da5('0x99')](_0x1c8283,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x11055a){return function(_0xcdf5bc){if(isNotNull(_0xcdf5bc)&&isNotNull(_0xcdf5bc[0x0])){if(_0xcdf5bc[0x0][_0x5da5('0x9d')]>0x0){_0x11055a[_0x5da5('0x42')]=_0x5da5('0x9e');logger[_0x5da5('0x80')](_0x5da5('0x9f')+_0x11055a[_0x5da5('0x3f')],_0xcdf5bc[0x0][_0x5da5('0x9d')],_0x5da5('0xa0'));}else{_0x11055a['message']=_0x5da5('0xa1');logger[_0x5da5('0x80')](_0x5da5('0xa2')+_0x11055a[_0x5da5('0x3f')]);}}};}function notSendMessagesQueue(_0x4d38cb){if(_0x4d38cb['sendMessageOneNotActive']){freeVariablesPredictive(_0x4d38cb);if(_0x4d38cb[_0x5da5('0x74')]===0x0&&_0x4d38cb['talking']===0x0&&_0x4d38cb[_0x5da5('0x57')]===0x0&&(_0x4d38cb[_0x5da5('0x50')]||0x0)===0x0){_0x4d38cb[_0x5da5('0xa3')]=![];_0x4d38cb[_0x5da5('0x4f')]=0x0;_0x4d38cb[_0x5da5('0x42')]=_0x5da5('0x41');loggerSyncQueueSummary[_0x5da5('0x97')](_0x5da5('0xa4'),_0x4d38cb[_0x5da5('0x3f')],'is\x20not\x20active');}else{_0x4d38cb[_0x5da5('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x5da5('0x97')](_0x5da5('0xa4'),_0x4d38cb['name'],_0x5da5('0xa5'));}emitVoiceQueueSummary(_0x4d38cb);}}function notSendMessagesCampaign(_0x5d3436){if(_0x5d3436[_0x5da5('0xa3')]){if(_0x5d3436['originated']===0x0){_0x5d3436[_0x5da5('0xa3')]=![];_0x5d3436[_0x5da5('0x42')]=_0x5da5('0x41');loggerSyncQueueSummary[_0x5da5('0x97')](_0x5da5('0xa6'),_0x5d3436[_0x5da5('0x3f')],_0x5da5('0xa7'));}else{_0x5d3436[_0x5da5('0x42')]=_0x5da5('0xa8');loggerSyncQueueSummary['error'](_0x5da5('0xa6'),_0x5d3436[_0x5da5('0x3f')],'is\x20disactive');}emitCampaignSummary(_0x5d3436);}}function createObjHistory(_0x5b6353,_0x10c0bc,_0x1addd6,_0x246560,_0xcc15e9){_0x5b6353['message']=_0x1addd6;var _0x1ba732=new Action(_0x5b6353,_0x10c0bc);var _0x5322b2=new History(_0x1ba732);_0x5322b2[_0x5da5('0xa9')]=_0x246560;_0x5322b2['statedesc']=_0xcc15e9;_0x5322b2['endtime']=_0x1ba732[_0x5da5('0xaa')];return _0x5322b2;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x156e7f=this;setInterval(function(){_0x156e7f[_0x5da5('0xab')](_0x156e7f[_0x5da5('0x28')],_0x5da5('0xac'));_0x156e7f[_0x5da5('0xab')](_0x156e7f[_0x5da5('0xad')],_0x5da5('0xae'));},0x32c8);};Dialer[_0x5da5('0xaf')]['clearZombieChannels']=function(_0x3e994c,_0x308e64){var _0x3fb2e9=this;for(var _0x363622 in _0x3e994c){if(typeof _0x3e994c[_0x363622]!==_0x5da5('0x9b')){this[_0x5da5('0xb0')][_0x5da5('0xb1')](function(){if(!_[_0x5da5('0xb2')](_0x3e994c[_0x363622])){return ami[_0x5da5('0xb3')]({'action':_0x5da5('0xb4'),'channel':_0x3e994c[_0x363622][_0x5da5('0xb5')]})[_0x5da5('0xb6')](function(_0x104ae6){if(_0x104ae6[_0x5da5('0x42')]===_0x5da5('0xb7')){setTimeout(function(){if(_0x3e994c[_0x363622]&&_0x3e994c[_0x363622][_0x5da5('0x55')]!==_0x5da5('0x7b')){_0x3fb2e9[_0x5da5('0xb8')](_0x3fb2e9[_0x5da5('0x21')][_0x3e994c[_0x363622][_0x5da5('0xb9')]]);logger[_0x5da5('0x97')](_0x5da5('0xba'),_0x308e64,_0x363622,_0x3e994c[_0x363622][_0x5da5('0xb9')]);delete _0x3e994c[_0x363622];}if(_0x3e994c[_0x363622]&&_0x3e994c[_0x363622][_0x5da5('0x55')]==='ivr'){_0x3fb2e9[_0x5da5('0xb8')](_0x3fb2e9[_0x5da5('0x22')][_0x3e994c[_0x363622]['queue']]);logger[_0x5da5('0x97')]('[Dialer][checkChannel][ivr]',_0x308e64,_0x363622,_0x3e994c[_0x363622][_0x5da5('0xb9')]);delete _0x3e994c[_0x363622];}},0x2328);}});}});}}};Dialer[_0x5da5('0xaf')][_0x5da5('0xbb')]=function(_0x41efd4){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopper['countReScheduled'](_0x41efd4))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xbe')));};Dialer['prototype'][_0x5da5('0xbf')]=function(_0x558c89){return BPromise['resolve']()[_0x5da5('0xbd')](cmHopperBlack[_0x5da5('0xbf')](_0x558c89))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xc0')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xc1')]=function(_0x3d134f){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopperBlack[_0x5da5('0xc1')](_0x3d134f))['catch'](loggerCatch(_0x5da5('0xc2')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xc3')]=function(_0x23c2a7){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopperHistory[_0x5da5('0xc4')](_0x23c2a7))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x5da5('0xaf')]['rescheduleContact']=function(_0x5c8ec0){return BPromise[_0x5da5('0xbc')]()['then'](cmHopper[_0x5da5('0xc5')](_0x5c8ec0))['catch'](loggerCatch(_0x5da5('0xc6')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xc7')]=function(_0x3b834f,_0x551bd0,_0xd9dbcf){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopper[_0x5da5('0xc7')](_0x3b834f,_0x551bd0,_0xd9dbcf))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xc8')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xc9')]=function(_0x5d7458,_0x414254,_0x195479,_0x539878,_0x375612){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopper[_0x5da5('0xc9')](_0x5d7458,_0x414254,_0x195479,_0x539878))['catch'](function(_0x4ed1ae){_0x375612[_0x5da5('0xca')]-=_0x195479;_0x375612[_0x5da5('0xca')]=_0x375612[_0x5da5('0xca')]>0x0?_0x375612[_0x5da5('0xca')]:0x0;loggerCatch(_0x5da5('0xcb'))(_0x4ed1ae);});};Dialer['prototype'][_0x5da5('0xcc')]=function(_0x1851a3,_0x1c7ec4,_0x2b74d2,_0x4e0ef7){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopper[_0x5da5('0xcc')](_0x1851a3,_0x1c7ec4,_0x2b74d2))[_0x5da5('0xb6')](function(_0x1da53d){_0x4e0ef7[_0x5da5('0xca')]-=_0x1c7ec4;_0x4e0ef7[_0x5da5('0xca')]=_0x4e0ef7[_0x5da5('0xca')]>0x0?_0x4e0ef7[_0x5da5('0xca')]:0x0;loggerCatch(_0x5da5('0xcd'))(_0x1da53d);});};Dialer[_0x5da5('0xaf')][_0x5da5('0xce')]=function(_0x2004ab){return BPromise[_0x5da5('0xbc')]()['then'](voiceQueueRt[_0x5da5('0xce')](_0x2004ab))['catch'](loggerCatch(_0x5da5('0xcf')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xd0')]=function(_0x1fe6a0){return BPromise[_0x5da5('0xbc')]()['then'](cmHopper[_0x5da5('0xd0')](_0x1fe6a0))[_0x5da5('0xb6')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x5da5('0xd1')]=function(_0x50cd17){return BPromise[_0x5da5('0xbc')]()[_0x5da5('0xbd')](cmHopperHistory[_0x5da5('0xd1')](_0x50cd17))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xd2')));};Dialer[_0x5da5('0xaf')][_0x5da5('0xb8')]=function(_0x4c16f3){if(!_['isUndefined'](_0x4c16f3)&&_0x4c16f3!==null){if(typeof _0x4c16f3['originated']!==_0x5da5('0x9b')){if(_0x4c16f3[_0x5da5('0x74')]>0x0){_0x4c16f3[_0x5da5('0x74')]-=0x1;}else{logger['error'](_0x5da5('0xd3'));}}}else{logger[_0x5da5('0x97')](_0x5da5('0xd4'));}};Dialer[_0x5da5('0xaf')][_0x5da5('0xd5')]=function(_0xd56fa3,_0x51a597){var _0x1e092d=this;return function(_0x1cb69e){_0x1e092d[_0x5da5('0xb8')](_0x51a597);logger['error'](_0xd56fa3,util['inspect'](_0x1cb69e,{'showHidden':![],'depth':null}));};};Dialer[_0x5da5('0xaf')][_0x5da5('0xd6')]=function(_0x53f6c2,_0x3bd227,_0x1a1158){var _0x495d0c={'state':0x19,'statedesc':_0x5da5('0xd7')};this['updateOriginated'](_0x3bd227);this['saveInDb'](_[_0x5da5('0x8d')](_0x495d0c,_['pick'](_0x1a1158,[_0x5da5('0xd8'),'ListId',_0x5da5('0xd9'),_0x5da5('0xda'),'CampaignId'])),_0x5da5('0xdb'),_0x5da5('0xdc'));logger[_0x5da5('0x97')](_0x53f6c2);};Dialer[_0x5da5('0xaf')]['isSuccess']=function(_0x4e3b22){return _0x4e3b22===_0x5da5('0xdd');};Dialer[_0x5da5('0xaf')][_0x5da5('0xde')]=function(_0x416ddd){return!_[_0x5da5('0x3e')](_0x416ddd)&&_0x416ddd&&!_[_0x5da5('0x3e')](_0x416ddd['name'])&&!_[_0x5da5('0x3e')](_0x416ddd[_0x5da5('0xdf')])&&_0x416ddd[_0x5da5('0xdf')]&&(this[_0x5da5('0x24')][util['format']('SIP/%s',_0x416ddd[_0x5da5('0x3f')])][_0x5da5('0xb4')]===_0x5da5('0xe0')||this['trunks'][util['format'](_0x5da5('0xe1'),_0x416ddd[_0x5da5('0x3f')])][_0x5da5('0xb4')]===_0x5da5('0xe2'));};Dialer['prototype']['saveInDb']=function(_0x56cc8e,_0x6cf2ac,_0x4d9218){this[_0x5da5('0xd1')](_0x56cc8e)[_0x5da5('0xb6')](loggerCatch(_0x6cf2ac));this[_0x5da5('0xd0')](_0x56cc8e)[_0x5da5('0xb6')](loggerCatch(_0x4d9218));};Dialer[_0x5da5('0xaf')][_0x5da5('0x39')]=function(_0x480e3c){var _0x21296c=this[_0x5da5('0x28')][_0x480e3c[_0x5da5('0xe3')]];var _0x2212b1;if(!_[_0x5da5('0xb2')](_0x480e3c)&&!_['isNil'](_0x480e3c[_0x5da5('0xe4')])&&!_[_0x5da5('0xb2')](_0x480e3c['variable'][_0x5da5('0xe5')])&&_0x480e3c[_0x5da5('0xe6')]===_0x5da5('0xe7')&&_0x21296c){if(_0x21296c[_0x5da5('0x55')]!==_0x5da5('0x7b')&&this[_0x5da5('0x21')][_0x21296c[_0x5da5('0xb9')]][_0x5da5('0xe8')]&&_0x480e3c[_0x5da5('0xe9')]===_0x5da5('0xea')){delete this['uniqueId'][_0x480e3c[_0x5da5('0xe3')]];this[_0x5da5('0xb8')](this[_0x5da5('0x21')][_0x21296c['queue']]);this[_0x5da5('0x21')][_0x21296c['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x21296c[_0x5da5('0xb9')]][_0x5da5('0x5d')]+=0x1;_0x2212b1=new Hangup(_0x21296c,_0x480e3c);_0x2212b1[_0x5da5('0xa9')]=0x12;_0x2212b1[_0x5da5('0xeb')]='HangupInAMD';_0x2212b1[_0x5da5('0xec')]=_0x5da5('0xed');ami[_0x5da5('0x4b')](_0x5da5('0xee'),ut[_0x5da5('0xef')](_0x2212b1,_0x5da5('0xf0')));this[_0x5da5('0xf1')](_0x2212b1,'[syncHangupInAMD][createHistory]',_0x5da5('0xf2'));}if(_0x21296c[_0x5da5('0x55')]!==_0x5da5('0x7b')&&this[_0x5da5('0x21')][_0x21296c['queue']][_0x5da5('0xe8')]&&_0x480e3c[_0x5da5('0xe9')]==='MACHINE'){var _0x556f0e=this;return new BPromise(function(_0x358692,_0x2f6ad1){delete _0x556f0e[_0x5da5('0x28')][_0x480e3c['uniqueid']];_0x556f0e['updateOriginated'](_0x556f0e[_0x5da5('0x21')][_0x21296c[_0x5da5('0xb9')]]);_0x556f0e[_0x5da5('0x21')][_0x21296c['queue']][_0x5da5('0x5e')]+=0x1;_0x556f0e['voiceQueues'][_0x21296c['queue']][_0x5da5('0x5d')]+=0x1;var _0x32a4bc=_0x556f0e[_0x5da5('0x21')][_0x21296c['queue']];var _0x2d0013=new Hangup(_0x21296c,_0x480e3c);_0x2d0013['state']=0x13;_0x2d0013['statedesc']=_0x5da5('0xf3');_0x2d0013[_0x5da5('0xec')]=_0x5da5('0xed');_0x2d0013['countmachineretry']+=0x1;_0x2d0013['countglobal']+=0x1;_0x2d0013[_0x5da5('0xf0')]=!![];ami[_0x5da5('0x4b')]('custom:amd',ut['buildObj'](_0x2d0013,_0x5da5('0xf0')));_0x556f0e['createHistory'](_0x2d0013)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xf4')));if(_0x2d0013[_0x5da5('0xf5')]+_0x2d0013[_0x5da5('0xf6')]+_0x2d0013[_0x5da5('0xf7')]+_0x2d0013[_0x5da5('0xf8')]+_0x2d0013[_0x5da5('0xf9')]+_0x2d0013[_0x5da5('0xfa')]+_0x2d0013[_0x5da5('0xfb')]+_0x2d0013[_0x5da5('0xfc')]>=_0x32a4bc[_0x5da5('0xfd')]){_0x556f0e[_0x5da5('0xfe')](_0x2d0013,_0x358692,_0x2f6ad1,_0x5da5('0xff'));}else{if(_0x2d0013[_0x5da5('0xfb')]>=_0x32a4bc['dialMachineMaxRetry']){_0x556f0e['createStateFinal'](_0x2d0013,_0x358692,_0x2f6ad1,_0x5da5('0x100'));}else{_0x556f0e[_0x5da5('0xc5')]({'active':![],'countmachineretry':_0x2d0013[_0x5da5('0xfb')],'scheduledat':moment()[_0x5da5('0x101')](_0x32a4bc[_0x5da5('0x102')],'minutes')[_0x5da5('0x7c')](_0x5da5('0x103')),'ContactId':_0x2d0013[_0x5da5('0xd8')],'ListId':_0x2d0013['ListId'],'VoiceQueueId':_0x2d0013[_0x5da5('0xda')]||undefined,'CampaignId':_0x2d0013[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x105')));_0x358692({'reschedule':0x1});}}});}if(_0x21296c[_0x5da5('0x55')]===_0x5da5('0x7b')&&this[_0x5da5('0x22')][_0x21296c[_0x5da5('0xb9')]][_0x5da5('0xe8')]&&_0x480e3c[_0x5da5('0xe9')]===_0x5da5('0xea')){delete this['uniqueId'][_0x480e3c[_0x5da5('0xe3')]];this[_0x5da5('0xb8')](this[_0x5da5('0x22')][_0x21296c['queue']]);_0x2212b1=new Hangup(_0x21296c,_0x480e3c);_0x2212b1[_0x5da5('0xa9')]=0x12;_0x2212b1['statedesc']=_0x5da5('0x106');_0x2212b1[_0x5da5('0xec')]=_0x5da5('0xed');ami['emit']('custom:amd',ut[_0x5da5('0xef')](_0x2212b1,_0x5da5('0xf0')));this[_0x5da5('0xf1')](_0x2212b1,_0x5da5('0x107'),_0x5da5('0x108'));}if(_0x21296c[_0x5da5('0x55')]==='ivr'&&this[_0x5da5('0x22')][_0x21296c['queue']][_0x5da5('0xe8')]&&_0x480e3c[_0x5da5('0xe9')]===_0x5da5('0x109')){var _0x556f0e=this;return new BPromise(function(_0x4dea82,_0x2b1c54){delete _0x556f0e[_0x5da5('0x28')][_0x480e3c[_0x5da5('0xe3')]];_0x556f0e[_0x5da5('0xb8')](_0x556f0e[_0x5da5('0x22')][_0x21296c['queue']]);_0x556f0e['campaigns'][_0x21296c[_0x5da5('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x556f0e[_0x5da5('0x22')][_0x21296c[_0x5da5('0xb9')]][_0x5da5('0x5d')]+=0x1;var _0x3aeac8=_0x556f0e[_0x5da5('0x22')][_0x21296c[_0x5da5('0xb9')]];var _0x4847f7=new Hangup(_0x21296c,_0x480e3c);_0x4847f7['state']=0x13;_0x4847f7[_0x5da5('0xeb')]=_0x5da5('0xf3');_0x4847f7[_0x5da5('0xec')]=_0x5da5('0xed');_0x4847f7[_0x5da5('0xfb')]+=0x1;_0x4847f7['countglobal']+=0x1;_0x4847f7[_0x5da5('0xf0')]=!![];ami[_0x5da5('0x4b')](_0x5da5('0xee'),ut[_0x5da5('0xef')](_0x4847f7,_0x5da5('0xf0')));_0x556f0e['createHistory'](_0x4847f7)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xf4')));if(_0x4847f7['countbusyretry']+_0x4847f7['countcongestionretry']+_0x4847f7['countnoanswerretry']+_0x4847f7[_0x5da5('0xf8')]+_0x4847f7[_0x5da5('0xf9')]+_0x4847f7[_0x5da5('0xfa')]+_0x4847f7['countmachineretry']+_0x4847f7[_0x5da5('0xfc')]>=_0x3aeac8[_0x5da5('0xfd')]){_0x556f0e['stateGlobal'](_0x4847f7,_0x4dea82,_0x2b1c54,_0x5da5('0xff'));}else{if(_0x4847f7[_0x5da5('0xfb')]>=_0x3aeac8[_0x5da5('0x10a')]){_0x556f0e[_0x5da5('0x10b')](_0x4847f7,_0x4dea82,_0x2b1c54,'reason\x2019\x20machine....');}else{_0x556f0e[_0x5da5('0xc5')]({'active':![],'countmachineretry':_0x4847f7['countmachineretry'],'scheduledat':moment()[_0x5da5('0x101')](_0x3aeac8[_0x5da5('0x102')],'minutes')[_0x5da5('0x7c')](_0x5da5('0x103')),'ContactId':_0x4847f7[_0x5da5('0xd8')],'ListId':_0x4847f7[_0x5da5('0x10c')],'VoiceQueueId':_0x4847f7[_0x5da5('0xda')]||undefined,'CampaignId':_0x4847f7[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x105')));_0x4dea82({'reschedule':0x1});}}});}}};Dialer[_0x5da5('0xaf')][_0x5da5('0x37')]=function(_0x1c3d57){var _0x1732d2=this[_0x5da5('0x28')][_0x1c3d57[_0x5da5('0xe3')]];var _0x14ce87=this;var _0x1e6621;if(_0x1732d2&&_0x1732d2[_0x5da5('0x55')]===_0x5da5('0x7b')){delete this[_0x5da5('0x28')][_0x1c3d57[_0x5da5('0xe3')]];this[_0x5da5('0xb8')](this[_0x5da5('0x22')][_0x1732d2[_0x5da5('0xb9')]]);this[_0x5da5('0x22')][_0x1732d2[_0x5da5('0xb9')]][_0x5da5('0x10d')]+=0x1;_0x1e6621=new Hangup(_0x1732d2,_0x1c3d57);this[_0x5da5('0xd1')](_0x1e6621)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x10e')));this[_0x5da5('0xd0')](_0x1e6621)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x10f')));}if(_0x1732d2&&_0x1732d2[_0x5da5('0x55')]!==_0x5da5('0x7b')&&isNotNull(this[_0x5da5('0x21')][_0x1732d2[_0x5da5('0xb9')]][_0x5da5('0x110')])){delete this[_0x5da5('0x28')][_0x1c3d57[_0x5da5('0xe3')]];this[_0x5da5('0xb8')](this['voiceQueues'][_0x1732d2['queue']]);this[_0x5da5('0x21')][_0x1732d2[_0x5da5('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x1732d2[_0x5da5('0xb9')]][_0x5da5('0x5d')]+=0x1;_0x1e6621=new Hangup(_0x1732d2,_0x1c3d57);_0x1e6621[_0x5da5('0xa9')]=0x10;_0x1e6621[_0x5da5('0xeb')]=_0x5da5('0x111');_0x1e6621[_0x5da5('0xec')]=_0x5da5('0x112');this['createHistory'](_0x1e6621)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x10e')));this[_0x5da5('0xd0')](_0x1e6621)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x10f')));}if(_0x1732d2&&_0x1732d2['type']!=='ivr'&&!isNotNull(this[_0x5da5('0x21')][_0x1732d2[_0x5da5('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x1c3d57[_0x5da5('0xe3')]];this[_0x5da5('0xb8')](this[_0x5da5('0x21')][_0x1732d2['queue']]);this[_0x5da5('0x21')][_0x1732d2[_0x5da5('0xb9')]]['outboundUnknownCallsDay']+=0x1;_0x1e6621=new Hangup(_0x1732d2,_0x1c3d57);_0x1e6621['state']=0xc;_0x1e6621[_0x5da5('0xeb')]=_0x1c3d57[_0x5da5('0x113')];_0x1e6621[_0x5da5('0xec')]=_0x5da5('0x114');this[_0x5da5('0xd1')](_0x1e6621)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x10e')));this['moveContactManagedDialer'](_0x1e6621)[_0x5da5('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x5da5('0xaf')][_0x5da5('0x35')]=function(_0x169200){var _0x4250ca=this[_0x5da5('0x28')][_0x169200[_0x5da5('0xe3')]];var _0x8cdf91=this;if(this[_0x5da5('0x21')][_0x169200[_0x5da5('0xb9')]]){if(_0x4250ca&&_0x4250ca[_0x5da5('0x55')]!==_0x5da5('0x7b')){delete this['uniqueId'][_0x169200[_0x5da5('0xe3')]];this[_0x5da5('0x21')][_0x169200[_0x5da5('0xb9')]]['outboundAnswerCallsDay']+=0x1;var _0x118647=new AgentComplete(_0x4250ca,_0x169200);if(_0x169200[_0x5da5('0x115')]===_0x5da5('0x116')){_0x118647[_0x5da5('0x117')]=this[_0x5da5('0x21')][_0x169200[_0x5da5('0xb9')]][_0x5da5('0x118')]&&this['voiceQueues'][_0x169200['queue']][_0x5da5('0x119')]?moment()[_0x5da5('0x7c')](_0x5da5('0x103')):undefined;}this[_0x5da5('0xd1')](_0x118647)['catch'](loggerCatch(_0x5da5('0x11a')));this[_0x5da5('0xd0')](_0x118647)['catch'](loggerCatch(_0x5da5('0x11b')));}}};Dialer[_0x5da5('0xaf')][_0x5da5('0x2f')]=function(_0x5c2ae8){if(this[_0x5da5('0x21')][_0x5c2ae8[_0x5da5('0xb9')]]){if(this['uniqueId'][_0x5c2ae8[_0x5da5('0xe3')]]&&this[_0x5da5('0x28')][_0x5c2ae8[_0x5da5('0xe3')]][_0x5da5('0x55')]!==_0x5da5('0x7b')){this['updateOriginated'](this[_0x5da5('0x21')][_0x5c2ae8[_0x5da5('0xb9')]]);this[_0x5da5('0x28')][_0x5c2ae8[_0x5da5('0xe3')]][_0x5da5('0x11c')]=moment()[_0x5da5('0x7c')](_0x5da5('0x103'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x55b42a){this[_0x5da5('0xd1')](_0x55b42a)[_0x5da5('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5da5('0xd0')](_0x55b42a)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x5da5('0xaf')]['syncQueueCallerAbandon']=function(_0x3c44d6){var _0x5cc6ef=this[_0x5da5('0x28')][_0x3c44d6[_0x5da5('0xe3')]];var _0x4e10ca=this;if(this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]]){if(_0x5cc6ef&&_0x5cc6ef[_0x5da5('0x55')]!==_0x5da5('0x7b')){delete this[_0x5da5('0x28')][_0x3c44d6[_0x5da5('0xe3')]];this['updateOriginated'](this['voiceQueues'][_0x3c44d6[_0x5da5('0xb9')]]);_0x5cc6ef[_0x5da5('0x11d')]=moment()['format'](_0x5da5('0x103'));var _0x302b0c=new QueueCallerAbandon(_0x5cc6ef,_0x3c44d6);if(getSeconds(_0x5cc6ef[_0x5da5('0x11d')],_0x5cc6ef['responsetime'])>=_0x5cc6ef['dialQueueTimeout']){this['voiceQueues'][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x6d')]+=0x1;this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x6e')]+=0x1;_0x302b0c[_0x5da5('0xa9')]=0xa;_0x302b0c['statedesc']='Drop';_0x302b0c[_0x5da5('0x11e')]=_0x5da5('0x11f');_0x302b0c[_0x5da5('0x117')]=this['voiceQueues'][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x118')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x302b0c[_0x5da5('0xf9')]+=0x1;_0x302b0c['countglobal']+=0x1;if(_0x302b0c[_0x5da5('0xf9')]>=this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x120')]){this['queueCallerAbandonCreateState'](_0x302b0c);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x302b0c[_0x5da5('0xf9')],'scheduledat':moment()[_0x5da5('0x101')](this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x121')],_0x5da5('0x122'))[_0x5da5('0x7c')](_0x5da5('0x103')),'ContactId':_0x5cc6ef['ContactId'],'ListId':_0x5cc6ef[_0x5da5('0x10c')],'VoiceQueueId':_0x5cc6ef[_0x5da5('0xda')]||undefined,'CampaignId':_0x5cc6ef['CampaignId']||undefined})['catch'](loggerCatch(_0x5da5('0x123')));var _0x39349d=new History(_0x302b0c);_0x39349d['state']=0xa;_0x39349d[_0x5da5('0xeb')]=_0x5da5('0x124');_0x39349d['starttime']=moment()[_0x5da5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x39349d[_0x5da5('0x125')]=_0x39349d[_0x5da5('0xaa')];_0x39349d[_0x5da5('0x126')]=_0x302b0c[_0x5da5('0x126')];_0x39349d['calleridnum']=_0x302b0c[_0x5da5('0x127')];this[_0x5da5('0xd1')](_0x39349d)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x128')));}}else{this['voiceQueues'][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x6c')]+=0x1;this['voiceQueues'][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x63')]+=0x1;_0x302b0c[_0x5da5('0xa9')]=0xb;_0x302b0c[_0x5da5('0xeb')]=_0x5da5('0x129');_0x302b0c[_0x5da5('0x11e')]=_0x5da5('0x12a');_0x302b0c[_0x5da5('0xfa')]+=0x1;_0x302b0c[_0x5da5('0x12b')]+=0x1;if(_0x302b0c[_0x5da5('0xfa')]>=this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]][_0x5da5('0x12c')]){this['queueCallerAbandonCreateState'](_0x302b0c);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x302b0c['countabandonedretry'],'scheduledat':moment()['add'](this[_0x5da5('0x21')][_0x3c44d6[_0x5da5('0xb9')]]['dialAbandonedRetryFrequency'],'minutes')[_0x5da5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5cc6ef[_0x5da5('0xd8')],'ListId':_0x5cc6ef[_0x5da5('0x10c')],'VoiceQueueId':_0x5cc6ef['VoiceQueueId']||undefined,'CampaignId':_0x5cc6ef[_0x5da5('0x104')]||undefined})['catch'](loggerCatch(_0x5da5('0x12d')));var _0x39349d=new History(_0x302b0c);_0x39349d[_0x5da5('0xa9')]=0xb;_0x39349d['statedesc']='Abandoned';_0x39349d[_0x5da5('0xaa')]=moment()[_0x5da5('0x7c')](_0x5da5('0x103'));_0x39349d[_0x5da5('0x125')]=_0x39349d[_0x5da5('0xaa')];_0x39349d[_0x5da5('0x126')]=_0x302b0c[_0x5da5('0x126')];_0x39349d[_0x5da5('0x127')]=_0x302b0c[_0x5da5('0x127')];this[_0x5da5('0xd1')](_0x39349d)['catch'](loggerCatch(_0x5da5('0x12e')));}}}}};Dialer[_0x5da5('0xaf')][_0x5da5('0x38')]=function(_0x5c84dc){if(this[_0x5da5('0xad')][_0x5c84dc[_0x5da5('0xe3')]]){this['actions'][_0x5c84dc[_0x5da5('0xe3')]]['channel']=_0x5c84dc[_0x5da5('0xb5')];}if(this[_0x5da5('0x28')][_0x5c84dc[_0x5da5('0xe3')]]){this[_0x5da5('0x28')][_0x5c84dc[_0x5da5('0xe3')]][_0x5da5('0xb5')]=_0x5c84dc['channel'];}};Dialer['prototype'][_0x5da5('0x3a')]=function(_0x306cf8){if(strategy[this['voiceQueues'][this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]][_0x5da5('0xb9')]]['strategy']]===_0x5da5('0x130')){if(this['actions'][_0x306cf8['actionid']]&&_[_0x5da5('0xb2')](this[_0x5da5('0xad')][_0x306cf8['actionid']][_0x5da5('0x131')])&&_0x306cf8['status']==='1'&&_0x306cf8[_0x5da5('0x132')]==='0'){if(this[_0x5da5('0x23')][_0x306cf8[_0x5da5('0x133')]]){if(!this[_0x5da5('0x23')][_0x306cf8['stateinterface']][_0x5da5('0x131')]){this[_0x5da5('0x23')][_0x306cf8[_0x5da5('0x133')]][_0x5da5('0x131')]=!![];this[_0x5da5('0xad')][_0x306cf8['actionid']][_0x5da5('0x131')]=!![];this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]][_0x5da5('0x133')]=_0x306cf8[_0x5da5('0x133')];}}}}else if((strategy[this['voiceQueues'][this[_0x5da5('0xad')][_0x306cf8['actionid']]['queue']][_0x5da5('0x4d')]]||'rrmemory')===_0x5da5('0x1d')){if(this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]]){if(this[_0x5da5('0x23')][_0x306cf8[_0x5da5('0x133')]]){this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]][_0x5da5('0x133')]=_0x306cf8[_0x5da5('0x133')];if(_[_0x5da5('0xb2')](this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]]['queue']])){this['queueBooked'][this['actions'][_0x306cf8[_0x5da5('0x12f')]][_0x5da5('0xb9')]]=[];}this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]]['queue']][_0x5da5('0x134')](_[_0x5da5('0x8d')](_[_0x5da5('0x135')](this[_0x5da5('0xad')][_0x306cf8[_0x5da5('0x12f')]],['idHopper',_0x5da5('0x133')]),{'status':_0x306cf8[_0x5da5('0xb4')],'paused':_0x306cf8[_0x5da5('0x132')]}));}}}};function unlockQueueStatus(_0x42d231,_0x4dcd0a){setTimeout(function(){if(_[_0x5da5('0x3e')](_0x42d231[_0x5da5('0x136')])){loggerBooked[_0x5da5('0x97')](_0x5da5('0x137'),_0x4dcd0a);}_0x42d231['queueStatusComplete']=!![];loggerBooked[_0x5da5('0x80')](_0x5da5('0x138'),_0x4dcd0a,JSON['stringify'](_[_0x5da5('0x135')](_0x42d231,[_0x5da5('0x3f'),_0x5da5('0x136')])));},0x1f3);}Dialer[_0x5da5('0xaf')]['syncQueueStatusComplete']=function(_0x37a6aa){var _0x29c8a0=this;var _0x3e2619=_0x29c8a0[_0x5da5('0x21')][_0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]];if(strategy[this[_0x5da5('0x21')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]][_0x5da5('0x4d')]]===_0x5da5('0x130')){if(this['actions'][_0x37a6aa[_0x5da5('0x12f')]]&&this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x133')]){this[_0x5da5('0x20')][_0x5da5('0x139')](this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x13a')],this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x133')])[_0x5da5('0xb6')](function(_0x169177){logger[_0x5da5('0x97')](_0x5da5('0x13b'),util[_0x5da5('0x99')](_0x169177,{'showHidden':![],'depth':null}));})[_0x5da5('0x1f')](function(){_0x29c8a0[_0x5da5('0xb8')](_0x29c8a0[_0x5da5('0x21')][_0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]]);_0x29c8a0[_0x5da5('0x23')][_0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x133')]][_0x5da5('0x131')]=![];delete _0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]];unlockQueueStatus(_0x3e2619);});}else{this['updateOriginated'](this[_0x5da5('0x21')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]]['queue']]);this[_0x5da5('0xc5')]({'active':![],'ContactId':this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]]['ContactId'],'ListId':this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x10c')],'VoiceQueueId':this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xda')]||undefined,'CampaignId':this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0x104')]||undefined})['catch'](loggerCatch(_0x5da5('0x13c')));delete this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]];unlockQueueStatus(_0x3e2619);}}else if((strategy[this[_0x5da5('0x21')][this['actions'][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]][_0x5da5('0x4d')]]||_0x5da5('0x1d'))===_0x5da5('0x1d')){var _0x4779c3;if(this['actions'][_0x37a6aa['actionid']]&&!_[_0x5da5('0x94')](this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x37a6aa['actionid']][_0x5da5('0xb9')]])){if(this[_0x5da5('0x2d')][_0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]]){this[_0x5da5('0x2d')][_0x29c8a0[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]]=this[_0x5da5('0x2d')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]]?this[_0x5da5('0x2d')][this[_0x5da5('0xad')][_0x37a6aa['actionid']][_0x5da5('0xb9')]]:this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]]['queue']]?this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]]['queue']][_0x5da5('0x13d')]||0x0:0x0;}this[_0x5da5('0x2c')][this[_0x5da5('0xad')][_0x37a6aa['actionid']][_0x5da5('0xb9')]]['_rr']=this[_0x5da5('0x2d')][this[_0x5da5('0xad')][_0x37a6aa[_0x5da5('0x12f')]][_0x5da5('0xb9')]];for(var _0x4bf65c=0x0;_0x4bf65c=0x0;})[_0x5da5('0xb6')](myreject(_0x11973c)));}}else{_0x52a000['push'](ami[_0x5da5('0xb3')]({'action':_0x5da5('0x152'),'command':util['format'](_0x5da5('0x153'),_0x2b5379,!_['isUndefined'](config[_0x5da5('0x14f')][_0x1ab980])?_0x1ab980:'')})[_0x5da5('0xbd')](function(_0x29774f){return _0x29774f['content'][_0x5da5('0x156')](_0x5da5('0x157'))>=0x0;})[_0x5da5('0xb6')](myreject(_0x11973c)));}BPromise['all'](_0x52a000)['then'](function(_0x4f5408){var _0x3a0695=_['some'](_0x4f5408);if(_0x3a0695){return _0x496bab(_0x3a0695);}else{_0x34a578[_0x5da5('0x42')]=_0x2d6114?'GLOBAL_INTERVAL_IS_OVERTIME':_0x5da5('0x158');return _0x11973c(msgResponse(_0x5da5('0x159'),_0x5da5('0x14c'),_0x5da5('0x15a')+_0x2d6114+'\x20'+_0x2fa522+'\x20Interval\x20is\x20overtime:\x20'+util[_0x5da5('0x99')](_0x2b5379,{'showHidden':![],'depth':null})+_0x5da5('0x15b')+_0x1ab980));}})['catch'](function(_0x109fe1){return _0x11973c(msgResponse(_0x5da5('0x14b'),_0x5da5('0x14c'),JSON[_0x5da5('0x79')](_0x109fe1)));});});};Dialer['prototype'][_0x5da5('0x15c')]=function(_0x123e68){var _0x5c4113=this;return function(){switch(_0x123e68[_0x5da5('0x58')]){case _0x5da5('0x15d'):freeVariablesPredictive(_0x123e68);_0x5c4113[_0x5da5('0x15e')](_0x123e68,0x1);break;case _0x5da5('0x15f'):freeVariablesPredictive(_0x123e68);_0x5c4113[_0x5da5('0x15e')](_0x123e68,_0x123e68[_0x5da5('0x160')]);break;case _0x5da5('0x9'):_0x5c4113[_0x5da5('0x9')](_0x123e68);break;case _0x5da5('0x8'):freeVariablesPredictive(_0x123e68);_0x5c4113[_0x5da5('0x15e')](_0x123e68,0x1);break;default:freeVariablesPredictive(_0x123e68);logger[_0x5da5('0x97')]('Queue',_0x123e68['name'],_0x5da5('0x161'));}};};Dialer[_0x5da5('0xaf')][_0x5da5('0x162')]=function(_0x4650b6){var _0x83ca0=this;return function(){_0x83ca0[_0x5da5('0x163')](_0x4650b6);};};Dialer[_0x5da5('0xaf')][_0x5da5('0xc')]=function(_0x2af9f7){var _0x25da49=this;if(isNotPreview(_0x2af9f7[_0x5da5('0x58')])){if(isVoiceQueueOutbound(_0x2af9f7[_0x5da5('0x55')])&&isActive(_0x2af9f7[_0x5da5('0x164')])){_0x2af9f7['sendMessageOneNotActive']=!![];BPromise[_0x5da5('0xbc')]()['then'](checkIsLoggedIn(_0x2af9f7,_0x2af9f7[_0x5da5('0x165')]))['then'](checkIsActive(_0x2af9f7,_0x2af9f7['dialActive']))['then'](checkInterval(_0x2af9f7))[_0x5da5('0xbd')](_0x25da49[_0x5da5('0x146')](_0x2af9f7))[_0x5da5('0xbd')](_0x25da49[_0x5da5('0x14a')](_0x2af9f7[_0x5da5('0x166')],_0x2af9f7[_0x5da5('0x167')],_0x2af9f7[_0x5da5('0x3f')],_0x2af9f7))[_0x5da5('0xbd')](_0x25da49[_0x5da5('0x168')](_0x2af9f7['Interval'],_0x2af9f7['dialTimezone'],_0x2af9f7[_0x5da5('0x3f')],_0x2af9f7))[_0x5da5('0xbd')](_0x25da49[_0x5da5('0x15c')](_0x2af9f7))[_0x5da5('0xb6')](loggerCatchQueueSummary(_0x5da5('0x169'),_0x2af9f7));}else{notSendMessagesQueue(_0x2af9f7);}}else{freeVariablesPredictive(_0x2af9f7);}};Dialer[_0x5da5('0xaf')][_0x5da5('0x145')]=function(){var _0xcb15b3=this;var _0x3c5d7a;for(var _0xc65edc in this[_0x5da5('0x22')]){if(typeof this[_0x5da5('0x22')][_0xc65edc]!=='undefined'){_0x3c5d7a=this['campaigns'][_0xc65edc];if(isCampaignIvr(_0x3c5d7a[_0x5da5('0x55')])&&isActive(_0x3c5d7a['active'])){_0x3c5d7a[_0x5da5('0xa3')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x3c5d7a,_0x3c5d7a[_0x5da5('0xdf')]))[_0x5da5('0xbd')](checkInterval(_0x3c5d7a))[_0x5da5('0xbd')](_0xcb15b3[_0x5da5('0x146')](_0x3c5d7a))[_0x5da5('0xbd')](_0xcb15b3[_0x5da5('0x14a')](_0x3c5d7a[_0x5da5('0x166')],_0x3c5d7a[_0x5da5('0x167')],_0x3c5d7a[_0x5da5('0x3f')],_0x3c5d7a))[_0x5da5('0xbd')](_0xcb15b3[_0x5da5('0x168')](_0x3c5d7a[_0x5da5('0x45')],_0x3c5d7a[_0x5da5('0x167')],_0x3c5d7a[_0x5da5('0x3f')],_0x3c5d7a))[_0x5da5('0xbd')](_0xcb15b3[_0x5da5('0x162')](_0x3c5d7a))[_0x5da5('0xb6')](loggerCatchQueueSummary(_0x5da5('0x16a'),_0x3c5d7a));}else{notSendMessagesCampaign(_0x3c5d7a);}}}};function getCallerIdRandom(_0x1e98fb,_0xfd50df){var _0x45839f;var _0x41e030;var _0xbaaee;if(_0xfd50df<=0x0){_0xfd50df=0x1;}_0x45839f=new RegExp(_0x5da5('0x16b')+_0xfd50df+'}$');_0x41e030=Math[_0x5da5('0x16c')](0xa,_0xfd50df-0x1);_0xbaaee=Math[_0x5da5('0x16c')](0xa,_0xfd50df)-0x1;return util[_0x5da5('0x7c')]('%s',_[_0x5da5('0x16d')](_0x1e98fb,_0x45839f,_[_0x5da5('0x16e')](_0x41e030,_0xbaaee)));}function extractCalleridName(_0x4527c4){var _0x123e14=_0x4527c4['match'](/"(.*?)"/);return _0x123e14?_0x123e14[0x1]:_0x4527c4;}function extractCalleridNumber(_0x58f1cd){var _0x40af37=_0x58f1cd[_0x5da5('0x16f')](/<(.*?)>/);return _0x40af37?_0x40af37[0x1]:_0x58f1cd;}Dialer[_0x5da5('0xaf')][_0x5da5('0x170')]=function(_0x2f332a,_0x571086){var _0x50a39d=this;var _0x3b5818=uuid['v4']();this[_0x5da5('0xad')][_0x3b5818]=new Action(_0x2f332a,_0x571086,_0x3b5818);return new BPromise(function(_0x45dbb9,_0x3756cf){if(_[_0x5da5('0x3e')](_0x2f332a)&&typeof _0x2f332a!==_0x5da5('0x171')){return _0x3756cf(msgResponse(_0x5da5('0x172'),_0x5da5('0x14c'),_0x5da5('0x173')));}if(_['isUndefined'](_0x571086[_0x5da5('0x174')][_0x5da5('0x175')])||_0x571086[_0x5da5('0x174')]['phone']===null){return _0x3756cf(msgResponse('originate',_0x5da5('0x14c'),_0x5da5('0x176')));}var _0x2560df={'XMD-CALLERID':_0x50a39d[_0x5da5('0xad')][_0x3b5818][_0x5da5('0x177')](),'XMD-AGI':_0x2f332a[_0x5da5('0x110')]?util[_0x5da5('0x7c')](_0x5da5('0x178'),ipAgi,_0x2f332a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x2f332a[_0x5da5('0x118')]?util[_0x5da5('0x7c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2f332a[_0x5da5('0x118')]):'NONE','XMD-QUEUE':_0x2f332a[_0x5da5('0x55')]==='outbound'?util[_0x5da5('0x7c')](_0x5da5('0x179'),_0x2f332a[_0x5da5('0x3f')],_0x2f332a['dialQueueOptions']||'',_0x2f332a['dialAgiAfterHangupAgent']?'c':'',_0x2f332a[_0x5da5('0x17a')]||0x3):'NONE','XMD-CONTACTID':_0x571086['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x50a39d[_0x5da5('0xad')][_0x3b5818][_0x5da5('0x177')](),'XMD-AMD':_0x2f332a[_0x5da5('0xe8')]?_0x5da5('0x17b'):_0x5da5('0x17c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x2f332a[_0x5da5('0xe8')]){_0x2560df[_0x5da5('0x17d')]=_0x2f332a[_0x5da5('0x17e')]||0x9c4;_0x2560df[_0x5da5('0x17f')]=_0x2f332a[_0x5da5('0x180')]||0x5dc;_0x2560df[_0x5da5('0x181')]=_0x2f332a['dialAMDAfterGreetingSilence']||0x320;_0x2560df[_0x5da5('0x182')]=_0x2f332a[_0x5da5('0x183')]||0x1388;_0x2560df[_0x5da5('0x184')]=_0x2f332a[_0x5da5('0x185')]||0x64;_0x2560df[_0x5da5('0x186')]=_0x2f332a[_0x5da5('0x187')]||0x32;_0x2560df[_0x5da5('0x188')]=_0x2f332a[_0x5da5('0x189')]||0x3;_0x2560df[_0x5da5('0x18a')]=_0x2f332a[_0x5da5('0x18b')]||0x100;_0x2560df[_0x5da5('0x18c')]=_0x2f332a[_0x5da5('0x18d')]||0x1388;}if(_0x2f332a['type']==='outbound'){_0x2560df[_0x5da5('0x18e')]=_0x571086['VoiceQueueId'];}else{_0x2560df[_0x5da5('0x18f')]=_0x571086[_0x5da5('0x104')];}for(var _0x27f954 in _0x571086['Contact']){if(typeof _0x571086['Contact'][_0x27f954]!==_0x5da5('0x9b')){if(isNotNull(_0x571086[_0x5da5('0x174')][_0x27f954])&&_0x27f954!=='id'&&_0x27f954!==_0x5da5('0x190')&&_0x27f954!==_0x5da5('0x191')&&_0x27f954!==_0x5da5('0x192')){_0x2560df[util['format'](_0x5da5('0x193'),_0x5da5('0x194'),_[_0x5da5('0x195')](_0x27f954))]=_0x571086['Contact'][_0x27f954];}}}var _0x1e67f7=_0x50a39d[_0x5da5('0xde')](_0x2f332a[_0x5da5('0x78')])?getCallerId(_0x2f332a[_0x5da5('0x78')][_0x5da5('0x196')],_0x2f332a['dialOriginateCallerIdName'],_0x2f332a[_0x5da5('0x197')]>0x0?getCallerIdRandom(_0x2f332a[_0x5da5('0x5a')],_0x2f332a[_0x5da5('0x197')]):_0x2f332a[_0x5da5('0x5a')]):getCallerId(_[_0x5da5('0xb2')](_0x2f332a[_0x5da5('0x147')])?_0x2f332a[_0x5da5('0x78')][_0x5da5('0x196')]:_0x2f332a['TrunkBackup']['callerid'],_0x2f332a[_0x5da5('0x59')],_0x2f332a[_0x5da5('0x197')]>0x0?getCallerIdRandom(_0x2f332a['dialOriginateCallerIdNumber'],_0x2f332a[_0x5da5('0x197')]):_0x2f332a[_0x5da5('0x5a')]);if(_0x1e67f7){_0x2560df[_0x5da5('0x198')]=_0x50a39d[_0x5da5('0xad')][_0x3b5818][_0x5da5('0x199')]=extractCalleridName(_0x1e67f7);_0x2560df[_0x5da5('0x19a')]=_0x50a39d['actions'][_0x3b5818]['originatecalleridnum']=extractCalleridNumber(_0x1e67f7);}return ami[_0x5da5('0xb3')]({'actionid':_0x3b5818,'action':_0x5da5('0x172'),'channel':_0x50a39d['isTrunkReachable'](_0x2f332a['Trunk'])?util[_0x5da5('0x7c')]('SIP/%s/%s%s',_0x2f332a[_0x5da5('0x78')]['name'],isNotNull(_0x2f332a[_0x5da5('0x5c')])?_0x2f332a[_0x5da5('0x5c')]['trim']()||'':'',_0x2f332a[_0x5da5('0x19b')]>0x0?_0x571086[_0x5da5('0x174')]['phone'][_0x5da5('0x19c')](_0x2f332a[_0x5da5('0x19b')]):_0x571086[_0x5da5('0x174')][_0x5da5('0x175')]):util[_0x5da5('0x7c')](_0x5da5('0x19d'),_['isNil'](_0x2f332a[_0x5da5('0x147')])?_0x2f332a[_0x5da5('0x78')][_0x5da5('0x3f')]:_0x2f332a['TrunkBackup'][_0x5da5('0x3f')],isNotNull(_0x2f332a[_0x5da5('0x5c')])?_0x2f332a['dialPrefix'][_0x5da5('0x19e')]()||'':'',_0x2f332a[_0x5da5('0x19b')]>0x0?_0x571086[_0x5da5('0x174')][_0x5da5('0x175')][_0x5da5('0x19c')](_0x2f332a[_0x5da5('0x19b')]):_0x571086[_0x5da5('0x174')][_0x5da5('0x175')]),'callerid':_0x1e67f7,'Exten':_0x5da5('0xe7'),'Context':_0x5da5('0x19f'),'Priority':'1','variable':_0x2560df,'timeout':(_0x2f332a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3b5818})[_0x5da5('0xbd')](function(_0x491eff){return _0x45dbb9(_0x491eff);})[_0x5da5('0xb6')](function(_0x1ae4db){_0x2f332a[_0x5da5('0x67')]+=0x1;var _0x5463ea=new History(_0x50a39d['actions'][_0x3b5818]);logger[_0x5da5('0x97')](util[_0x5da5('0x7c')](_0x5da5('0x1a0'),JSON[_0x5da5('0x79')](_0x1ae4db)));_0x5463ea[_0x5da5('0xa9')]=0xe;_0x5463ea[_0x5da5('0xeb')]='OriginateError';_0x5463ea['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5463ea[_0x5da5('0x125')]=_0x5463ea[_0x5da5('0xaa')];_0x50a39d[_0x5da5('0xd1')](_0x5463ea)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1a1')));_0x50a39d[_0x5da5('0xd0')](_0x5463ea)['catch'](loggerCatch(_0x5da5('0x1a1')))[_0x5da5('0x1f')](function(){delete _0x50a39d[_0x5da5('0xad')][_0x3b5818];return _0x3756cf(msgResponse(_0x5da5('0x172'),_0x5da5('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0x5da5('0xaf')][_0x5da5('0x33')]=function(_0x21302c){var _0x5827e0=this[_0x5da5('0xad')][_0x21302c[_0x5da5('0x12f')]];if(_0x5827e0){delete this[_0x5da5('0xad')][_0x21302c[_0x5da5('0x12f')]];_0x5827e0[_0x5da5('0x1a2')]=moment()[_0x5da5('0x7c')](_0x5da5('0x103'));var _0x4ad965=_0x5827e0[_0x5da5('0x55')]===_0x5da5('0x7b')?this[_0x5da5('0x22')][_0x5827e0[_0x5da5('0xb9')]]:this['voiceQueues'][_0x5827e0[_0x5da5('0x1a3')]()];if(!this[_0x5da5('0x1a4')](_0x21302c[_0x5da5('0x1a5')])){this['updateOriginated'](_0x4ad965);return this[_0x5da5('0x1a6')](_0x5827e0,_0x4ad965,_0x21302c)[_0x5da5('0xb6')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x5da5('0x28')][_0x21302c['uniqueid']]=_0x5827e0;}};Dialer['prototype']['checkRetriveMax']=function(_0x44e324,_0x368e9e,_0x476466){var _0x47c253=new History(_0x368e9e);if(_0x47c253['countbusyretry']+_0x47c253['countcongestionretry']+_0x47c253['countnoanswerretry']+_0x47c253[_0x5da5('0xf8')]+_0x47c253['countdropretry']+_0x47c253[_0x5da5('0xfa')]+_0x47c253[_0x5da5('0xfb')]+_0x47c253[_0x5da5('0xfc')]>=_0x476466[_0x5da5('0xfd')]-0x1){return!![];}switch(_0x44e324){case 0x3:if(_0x47c253[_0x5da5('0xf7')]>=_0x476466[_0x5da5('0x1a7')]-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countnoanswerretry':_0x47c253[_0x5da5('0xf7')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1a8')],_0x5da5('0x122'))[_0x5da5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253['ListId'],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1a9')));break;case 0x5:if(_0x47c253[_0x5da5('0xf5')]>=_0x476466['dialBusyMaxRetry']-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countbusyretry':_0x47c253[_0x5da5('0xf5')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1aa')],_0x5da5('0x122'))[_0x5da5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253['ListId'],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1ab')));break;case 0x8:if(_0x47c253[_0x5da5('0xf6')]>=_0x476466['dialCongestionMaxRetry']-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countcongestionretry':_0x47c253[_0x5da5('0xf6')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1ac')],'minutes')['format'](_0x5da5('0x103')),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253[_0x5da5('0x10c')],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253['CampaignId']||undefined})[_0x5da5('0xb6')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x47c253[_0x5da5('0xf8')]>=_0x476466[_0x5da5('0x1ad')]-0x1){return!![];}else{this[_0x5da5('0xc5')]({'active':![],'countnosuchnumberretry':_0x47c253[_0x5da5('0xf8')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1ae')],_0x5da5('0x122'))['format'](_0x5da5('0x103')),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253['ListId'],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1af')));}break;case 0xa:if(_0x47c253[_0x5da5('0xf9')]>=_0x476466['dialDropMaxRetry']-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countdropretry':_0x47c253[_0x5da5('0xf9')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466['dialDropRetryFrequency'],'minutes')['format'](_0x5da5('0x103')),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253['ListId'],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253['CampaignId']||undefined})[_0x5da5('0xb6')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x47c253[_0x5da5('0xfa')]>=_0x476466[_0x5da5('0x12c')]-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countabandonedretry':_0x47c253[_0x5da5('0xfa')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1b0')],_0x5da5('0x122'))['format'](_0x5da5('0x103')),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253[_0x5da5('0x10c')],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x47c253['countmachineretry']>=_0x476466[_0x5da5('0x10a')]-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countmachineretry':_0x47c253[_0x5da5('0xfb')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x102')],_0x5da5('0x122'))[_0x5da5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x47c253[_0x5da5('0xd8')],'ListId':_0x47c253[_0x5da5('0x10c')],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x105')));break;case 0x14:if(_0x47c253[_0x5da5('0xfc')]>=_0x476466[_0x5da5('0x1b1')]-0x1){return!![];}this[_0x5da5('0xc5')]({'active':![],'countagentrejectretry':_0x47c253[_0x5da5('0xfc')]+=0x1,'scheduledat':moment()[_0x5da5('0x101')](_0x476466[_0x5da5('0x1b2')],_0x5da5('0x122'))[_0x5da5('0x7c')](_0x5da5('0x103')),'ContactId':_0x47c253['ContactId'],'ListId':_0x47c253[_0x5da5('0x10c')],'VoiceQueueId':_0x47c253[_0x5da5('0xda')]||undefined,'CampaignId':_0x47c253[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1b3')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x5e9901,_0x3ff8b7,_0x234e0c){var _0x238266=this;var _0x2eadfc=new History(_0x5e9901);return new BPromise(function(_0x831c4d,_0x52992b){if(_[_0x5da5('0x3e')](_0x3ff8b7)&&typeof _0x3ff8b7!=='object'){return _0x52992b(msgResponse(_0x5da5('0x1b4'),'Failure',_0x5da5('0x1b5')));}if(_[_0x5da5('0x3e')](_0x234e0c)&&typeof _0x234e0c!=='object'){return _0x52992b(msgResponse(_0x5da5('0x1b4'),'Failure',_0x5da5('0x1b6')));}switch(_0x234e0c[_0x5da5('0x115')]){case'0':_0x3ff8b7['outboundNoSuchCallsDay']+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0x0;_0x2eadfc[_0x5da5('0xeb')]=_0x5da5('0x1b7');_0x2eadfc[_0x5da5('0xf8')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;ami[_0x5da5('0x4b')](_0x5da5('0x1b8'),ut['buildObj'](_0x5e9901,_0x5da5('0x1b9')));_0x238266[_0x5da5('0xd1')](_0x2eadfc)[_0x5da5('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x238266[_0x5da5('0x1ba')](0x0,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc[_0x5da5('0xf8')]>=_0x3ff8b7[_0x5da5('0x1ad')]){_0x238266[_0x5da5('0x10b')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1bb'));}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1bb'));}}break;case'3':_0x3ff8b7[_0x5da5('0x65')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0x3;_0x2eadfc['statedesc']='NoAnswer';_0x2eadfc[_0x5da5('0xf7')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;ami[_0x5da5('0x4b')](_0x5da5('0x1bc'),ut['buildObj'](_0x5e9901,_0x5da5('0x1bd')));_0x238266[_0x5da5('0xd1')](_0x2eadfc)['catch'](loggerCatch(_0x5da5('0x1be')));if(_0x238266[_0x5da5('0x1ba')](0x3,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc[_0x5da5('0xf7')]>=_0x3ff8b7[_0x5da5('0x1a7')]){_0x238266['createStateFinal'](_0x2eadfc,_0x831c4d,_0x52992b,'reason\x203\x20ringing\x20no\x20answer');}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1bf'));}}break;case'5':_0x3ff8b7[_0x5da5('0x60')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0x5;_0x2eadfc[_0x5da5('0xeb')]=_0x5da5('0x1c0');_0x2eadfc[_0x5da5('0xf5')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;ami[_0x5da5('0x4b')]('custom:agentbusy',ut['buildObj'](_0x5e9901,_0x5da5('0x1c1')));_0x238266[_0x5da5('0xd1')](_0x2eadfc)[_0x5da5('0xb6')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x238266['checkRetriveMax'](0x5,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc['countbusyretry']>=_0x3ff8b7[_0x5da5('0x1c2')]){_0x238266[_0x5da5('0x10b')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1c3'));}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,'reason\x205\x20busy');}}break;case'8':_0x3ff8b7[_0x5da5('0x61')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0x8;_0x2eadfc[_0x5da5('0xeb')]=_0x5da5('0x1c4');_0x2eadfc[_0x5da5('0xf6')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;ami[_0x5da5('0x4b')](_0x5da5('0x1c5'),ut[_0x5da5('0xef')](_0x5e9901,_0x5da5('0x1c6')));_0x238266['createHistory'](_0x2eadfc)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x238266[_0x5da5('0x1ba')](0x8,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc[_0x5da5('0xf6')]>=_0x3ff8b7['dialCongestionMaxRetry']){_0x238266[_0x5da5('0x10b')](_0x2eadfc,_0x831c4d,_0x52992b,'reason\x208\x20congestion');}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1c7'));}}break;case'11':_0x3ff8b7[_0x5da5('0x1c8')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0xb;_0x2eadfc['statedesc']=_0x5da5('0x129');_0x2eadfc[_0x5da5('0xfa')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;_0x238266[_0x5da5('0xd1')](_0x2eadfc)[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x12e')));if(_0x238266[_0x5da5('0x1ba')](0xb,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc[_0x5da5('0xfa')]>=_0x3ff8b7[_0x5da5('0x12c')]){_0x238266[_0x5da5('0x10b')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1c9'));}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1c9'));}}break;case'20':_0x3ff8b7[_0x5da5('0x69')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0x14;_0x2eadfc[_0x5da5('0xeb')]=_0x5da5('0x1ca');_0x2eadfc[_0x5da5('0xfc')]+=0x1;_0x2eadfc[_0x5da5('0x12b')]+=0x1;ami[_0x5da5('0x4b')](_0x5da5('0x1cb'),ut[_0x5da5('0xef')](_0x5e9901,'agentreject'));_0x238266[_0x5da5('0xd1')](_0x2eadfc)['catch'](loggerCatch(_0x5da5('0x1cc')));if(_0x238266[_0x5da5('0x1ba')](0x14,_0x5e9901,_0x3ff8b7)){if(_0x2eadfc['countagentrejectretry']>=_0x3ff8b7['dialAgentRejectMaxRetry']){_0x238266['createStateFinal'](_0x2eadfc,_0x831c4d,_0x52992b,_0x5da5('0x1cd'));}else{_0x238266[_0x5da5('0xfe')](_0x2eadfc,_0x831c4d,_0x52992b,'reason\x2020\x20agentreject');}}break;default:_0x3ff8b7[_0x5da5('0x6a')]+=0x1;_0x2eadfc[_0x5da5('0xa9')]=0xc;_0x2eadfc['statedesc']=_0x234e0c[_0x5da5('0x115')];_0x238266[_0x5da5('0xd1')](_0x2eadfc)[_0x5da5('0xb6')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x238266[_0x5da5('0x1ba')](_0x234e0c['reason'],_0x5e9901,_0x3ff8b7)){if(_0x2eadfc['countbusyretry']+_0x2eadfc[_0x5da5('0xf6')]+_0x2eadfc['countnoanswerretry']+_0x2eadfc[_0x5da5('0xf8')]+_0x2eadfc[_0x5da5('0xf9')]+_0x2eadfc[_0x5da5('0xfa')]+_0x2eadfc[_0x5da5('0xfb')]+_0x2eadfc[_0x5da5('0xfc')]>=_0x3ff8b7[_0x5da5('0xfd')]){_0x238266['stateGlobal'](_0x2eadfc,_0x831c4d,_0x52992b,_0x234e0c[_0x5da5('0x115')]);}else{_0x238266[_0x5da5('0x10b')](_0x2eadfc,_0x831c4d,_0x52992b,_0x234e0c[_0x5da5('0x115')]);}}}});};Dialer[_0x5da5('0xaf')][_0x5da5('0xfe')]=function(_0x39e3f7,_0x2a4321,_0x30f4c6,_0x5199ea){var _0x15dcdf=new Final(_0x39e3f7);_0x15dcdf[_0x5da5('0xa9')]=0xf;_0x15dcdf[_0x5da5('0xeb')]='Global';this['createStateFinal'](_0x15dcdf,_0x2a4321,_0x30f4c6,_0x5199ea);};Dialer[_0x5da5('0xaf')][_0x5da5('0x10b')]=function(_0x5b3a30,_0x3039bd,_0x30b8e6,_0x1f6a72){this[_0x5da5('0xd0')](_0x5b3a30)[_0x5da5('0xbd')](function(){return _0x3039bd(msgResponse(_0x5da5('0x1b4'),_0x5da5('0xdd'),_0x1f6a72));})['catch'](function(){return _0x30b8e6(msgResponse(_0x5da5('0x1ce'),_0x5da5('0x14c'),_0x5da5('0x1cf')));});};Dialer[_0x5da5('0xaf')]['predictive']=function(_0xcb5d0f){var _0x50ff49=_0xcb5d0f[_0x5da5('0x1d0')]/0x64;var _0xbf7098=_0xcb5d0f[_0x5da5('0x64')]/(_0xcb5d0f[_0x5da5('0x64')]+_0xcb5d0f[_0x5da5('0x5e')]);var _0x426480=Math['round'](_0xcb5d0f[_0x5da5('0x72')]*(_0xcb5d0f[_0x5da5('0x1d1')]/0x64));var _0x3943a5=Math['round'](_0xcb5d0f[_0x5da5('0x72')]*(_0xcb5d0f[_0x5da5('0x1d2')]/0x64));var _0x32227d=_0xcb5d0f[_0x5da5('0x4f')]+_0xcb5d0f[_0x5da5('0x54')];var _0x13daa0=Math[_0x5da5('0x1d3')](_0xcb5d0f['erlangCalls']*_0xcb5d0f['erlangAbandonmentRate']*_0xcb5d0f[_0x5da5('0x6f')]*_0xcb5d0f[_0x5da5('0x70')]);if(_[_0x5da5('0x3e')](_0xcb5d0f[_0x5da5('0x2a')])){if(!_['isUndefined'](_0xcb5d0f[_0x5da5('0x90')])){_0xcb5d0f['startPredictive']=undefined;loggerPredictive[_0x5da5('0x97')](_0x5da5('0x1d4'),_0x5da5('0x1d5'));}if(!_[_0x5da5('0x3e')](_0xcb5d0f[_0x5da5('0x92')])){loggerPredictive[_0x5da5('0x97')](_0x5da5('0x1d4'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xcb5d0f['handlePredictive']);_0xcb5d0f[_0x5da5('0x92')]=undefined;}_0xcb5d0f[_0x5da5('0x2a')]=moment()['format'](_0x5da5('0x103'));loggerPredictive[_0x5da5('0x80')](_0xcb5d0f[_0x5da5('0x3f')],'collection\x20data\x20in\x20progressive\x20at',_0xcb5d0f[_0x5da5('0x2a')]);this[_0x5da5('0x15e')](_0xcb5d0f,0x1);}else if(ifInterval(_0xcb5d0f['dialPredictiveInterval'],_0xcb5d0f['startProgressive'])){this[_0x5da5('0x15e')](_0xcb5d0f,0x1);loggerPredictiveCalls[_0x5da5('0x80')]('[startMethodPredictive][StartProgressive][Loop]',_0xcb5d0f[_0x5da5('0x2a')],_0xcb5d0f[_0x5da5('0x3f')]);_0xcb5d0f[_0x5da5('0x75')]=0x0;_0xcb5d0f[_0x5da5('0x6e')]=0x0;}else if(_0x50ff49<_0xbf7098&&_0xcb5d0f['dialPredictiveOptimization']===_0x5da5('0x1d6')){freeVariablesPredictive(_0xcb5d0f);loggerPredictive['info'](_0x5da5('0x1d7'),'Dropped\x20calls\x20day',_0xbf7098,_0x5da5('0x2a'),_0xcb5d0f[_0x5da5('0x3f')]);}else if(_0x13daa0<_0xcb5d0f[_0x5da5('0x6e')]&&_0xcb5d0f['dialPredictiveOptimization']===_0x5da5('0x1d6')){freeVariablesPredictive(_0xcb5d0f);loggerPredictive[_0x5da5('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5da5('0x1d8'),_0x13daa0,_0x5da5('0x1d9'),_0xcb5d0f[_0x5da5('0x6e')],_0x5da5('0x2a'),_0xcb5d0f[_0x5da5('0x3f')]);}else if(!ifInterval(_0xcb5d0f[_0x5da5('0x1da')],_0xcb5d0f['startProgressive'])&&_[_0x5da5('0x3e')](_0xcb5d0f[_0x5da5('0x90')])&&!_['isUndefined'](_0xcb5d0f[_0x5da5('0x2a')])){_0xcb5d0f[_0x5da5('0x90')]=moment()[_0x5da5('0x7c')](_0x5da5('0x103'));loggerPredictive['info'](_0xcb5d0f[_0x5da5('0x3f')],_0x5da5('0x1db'),_0xcb5d0f[_0x5da5('0x90')]);this[_0x5da5('0xc3')](_0xcb5d0f['dialPredictiveInterval'])[_0x5da5('0xbd')](this[_0x5da5('0x1dc')](_0xcb5d0f))[_0x5da5('0xbd')](mergeDataErlangB(_0xcb5d0f))['then'](this[_0x5da5('0x1dd')](_0xcb5d0f))[_0x5da5('0xb6')](loggerCatchPredictive(_0x5da5('0x1de'),_0xcb5d0f));}else if(!ifInterval(_0xcb5d0f[_0x5da5('0x1da')],_0xcb5d0f[_0x5da5('0x90')])){_0xcb5d0f[_0x5da5('0x6e')]=0x0;_0xcb5d0f[_0x5da5('0x90')]=moment()[_0x5da5('0x7c')](_0x5da5('0x103'));loggerPredictive['info'](_0xcb5d0f[_0x5da5('0x3f')],_0x5da5('0x1df'),_0xcb5d0f['startPredictive']);clearInterval(_0xcb5d0f['handlePredictive']);_0xcb5d0f[_0x5da5('0x92')]=undefined;this[_0x5da5('0xc3')](_0xcb5d0f['dialPredictiveInterval'])[_0x5da5('0xbd')](this['getDataPredictive'](_0xcb5d0f))[_0x5da5('0xbd')](mergeDataErlangB(_0xcb5d0f))['then'](this['startMethodPredictive'](_0xcb5d0f))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xcb5d0f));}else if(_0xcb5d0f[_0x5da5('0x72')]&&_0x32227d<_0xcb5d0f[_0x5da5('0x72')]-_0x3943a5){freeVariablesPredictive(_0xcb5d0f);loggerPredictive['info'](_0xcb5d0f[_0x5da5('0x3f')],_0x5da5('0x1e0'),_0x32227d,')\x20are\x20less\x20than\x20threshold\x20(',_0xcb5d0f[_0x5da5('0x72')],'-',_0x3943a5,'=',_0xcb5d0f['predictiveIntervalAvailable']-_0x3943a5,')');}else if(_0xcb5d0f[_0x5da5('0x72')]&&_0x32227d>_0xcb5d0f[_0x5da5('0x72')]+_0x426480){freeVariablesPredictive(_0xcb5d0f);loggerPredictive[_0x5da5('0x80')](_0xcb5d0f['name'],_0x5da5('0x1e0'),_0x32227d,_0x5da5('0x1e1'),_0xcb5d0f[_0x5da5('0x72')],'+',_0x426480,'=',_0xcb5d0f[_0x5da5('0x72')]+_0x426480,')');}};Dialer[_0x5da5('0xaf')][_0x5da5('0x1dc')]=function(_0x57e637){var _0xc6aabc=this;return function(_0x1bed42){return new BPromise(function(_0x52805e,_0x53f005){_[_0x5da5('0x8d')](_0x57e637,_0x1bed42[0x0]);if(checkGetDataPredictive(_0x1bed42[0x0])){var _0x7aa443=_0x57e637[_0x5da5('0x72')]=_0x57e637[_0x5da5('0x54')]+_0x57e637['available'];var _0x4d2e16=_0x57e637[_0x5da5('0x1da')]*0x3c;var _0x2a0130=_0x1bed42[0x0][_0x5da5('0x84')]+_0x1bed42[0x0][_0x5da5('0x83')];var _0x48daa4=(_0x1bed42[0x0][_0x5da5('0x6b')]+_0x1bed42[0x0][_0x5da5('0x6d')]+_0x1bed42[0x0][_0x5da5('0x6c')])/_0x1bed42[0x0][_0x5da5('0x73')];_0x57e637['predictiveIntervalHitRate']=_0x48daa4>0x0?_0x48daa4:0x1;switch(_0x57e637['dialPredictiveOptimization']){case _0x5da5('0x1d6'):var _0x45b43b=_0x57e637['dialPredictiveOptimizationPercentage']/0x64;return _0xc6aabc[_0x5da5('0x1e2')](_0x7aa443,_0x4d2e16,_0x2a0130,_0x48daa4,_0x45b43b)[_0x5da5('0xbd')](function(_0x2322a7){return _0x52805e(_0x2322a7);});case _0x5da5('0x1e3'):var _0x4f8785=_0x57e637[_0x5da5('0x1d0')]/0x64;return _0xc6aabc[_0x5da5('0x1e4')](_0x7aa443,_0x4d2e16,_0x2a0130,_0x48daa4,_0x4f8785)[_0x5da5('0xbd')](function(_0x56e626){return _0x52805e(_0x56e626);});default:return _0x53f005(msgResponse(_0x5da5('0x1e5'),_0x5da5('0x14c'),_0x5da5('0x1e6')));}}else{return _0x53f005(msgResponse(_0x5da5('0x1e5'),_0x5da5('0x14c'),'check\x20failure'));}});};};Dialer[_0x5da5('0xaf')][_0x5da5('0x1e7')]=function(_0x333812){var _0x3ed270=this;return function(_0x3f6a0f){return new BPromise(function(_0x147e7b,_0x3c4801){_[_0x5da5('0x8d')](_0x333812,_0x3f6a0f[0x0]);if(checkGetDataPredictive(_0x3f6a0f[0x0])){loggerPredictive[_0x5da5('0x80')](JSON[_0x5da5('0x79')](_0x3f6a0f[0x0]));if(_0x333812[_0x5da5('0x1e8')]===_0x5da5('0x1d6')){return _0x3ed270[_0x5da5('0xce')](_0x333812['id'])[_0x5da5('0xbd')](function(_0x47112b){var _0xcb10da=_0x333812['loggedIn']-_0x47112b[0x0][_0x5da5('0x1e9')];var _0x1b1907=_0x333812[_0x5da5('0x1da')]*0x3c;var _0x2a46fa=_0x3f6a0f[0x0][_0x5da5('0x84')]+_0x3f6a0f[0x0][_0x5da5('0x83')];var _0x228d29=(_0x3f6a0f[0x0]['predictiveIntervalAnsweredCalls']+_0x3f6a0f[0x0][_0x5da5('0x6d')]+_0x3f6a0f[0x0][_0x5da5('0x6c')])/_0x3f6a0f[0x0][_0x5da5('0x73')];var _0x45a466=_0x333812[_0x5da5('0x1d0')]/0x64;_0x333812[_0x5da5('0x71')]=_0x47112b[0x0]['outboundQueuePauses']||0x0;_0x333812[_0x5da5('0x6f')]=_0x228d29>0x0?_0x228d29:0x1;return _0x3ed270[_0x5da5('0x1e2')](_0xcb10da,_0x1b1907,_0x2a46fa,_0x228d29,_0x45a466);})[_0x5da5('0xbd')](function(_0xa1358f){return _0x147e7b(_0xa1358f);})['catch'](function(_0x156b6e){return _0x3c4801(msgResponse(_0x5da5('0x1ea'),_0x5da5('0x14c'),JSON[_0x5da5('0x79')](_0x156b6e)));});}if(_0x333812[_0x5da5('0x1e8')]==='agentBusyFactor'){return _0x3ed270[_0x5da5('0xce')](_0x333812['id'])[_0x5da5('0xbd')](function(_0x5680bd){var _0x63cf0a=_0x333812['loggedIn']-_0x5680bd[0x0]['outboundQueuePauses'];var _0x36ca94=_0x333812['dialPredictiveInterval']*0x3c;var _0x364f39=_0x3f6a0f[0x0][_0x5da5('0x84')]+_0x3f6a0f[0x0][_0x5da5('0x83')];var _0x1bfd47=(_0x3f6a0f[0x0]['predictiveIntervalAnsweredCalls']+_0x3f6a0f[0x0][_0x5da5('0x6d')]+_0x3f6a0f[0x0][_0x5da5('0x6c')])/_0x3f6a0f[0x0][_0x5da5('0x73')];var _0xb674fa=_0x333812[_0x5da5('0x1d0')]/0x64;_0x333812[_0x5da5('0x71')]=_0x5680bd[0x0][_0x5da5('0x1e9')]||0x0;_0x333812[_0x5da5('0x6f')]=_0x1bfd47>0x0?_0x1bfd47:0x1;return _0x3ed270[_0x5da5('0x1e4')](_0x63cf0a,_0x36ca94,_0x364f39,_0x1bfd47,_0xb674fa);})[_0x5da5('0xbd')](function(_0x33e3e9){return _0x147e7b(_0x33e3e9);})['catch'](function(_0x1e7c66){return _0x3c4801(msgResponse(_0x5da5('0x1ea'),_0x5da5('0x14c'),JSON[_0x5da5('0x79')](_0x1e7c66)));});}}else{return _0x3c4801(msgResponse(_0x5da5('0x1e5'),_0x5da5('0x14c'),'check\x20failure'));}});};};Dialer[_0x5da5('0xaf')]['startMethodPredictive']=function(_0x339833){var _0x5b663f=this;return function(){var _0x432775=0x0;var _0x4c0359=Math['floor'](_0x339833[_0x5da5('0x76')]*0x3e8);if(_0x4c0359>0x0){_0x4c0359=_0x4c0359<0x64?0x64:_0x4c0359;loggerPredictive[_0x5da5('0x80')](_0x339833[_0x5da5('0x3f')],_0x5da5('0x1eb'),_0x4c0359,_0x5da5('0x49'));_0x339833[_0x5da5('0x92')]=setInterval(function(){_0x5b663f[_0x5da5('0x92')](_0x339833);loggerPredictiveCalls[_0x5da5('0x80')]('[handlePredictive]',_0x432775+=0x1);},_0x4c0359);}else{loggerPredictive[_0x5da5('0x80')](_0x339833[_0x5da5('0x3f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x5da5('0x1ec')]=function(_0x1587e0,_0x4e902b){var _0x303b5d=this;return function(_0x7d24ca){if(_[_0x5da5('0x94')](_0x7d24ca)){if(_[_0x5da5('0xb2')](_0x4e902b['UserId'])||!_0x4e902b['recallme']){if(_0x1587e0[_0x5da5('0x58')]===_0x5da5('0x8')){_0x1587e0[_0x5da5('0x136')]=_[_0x5da5('0x3e')](_0x1587e0['queueStatusComplete'])?!![]:_0x1587e0[_0x5da5('0x136')];var _0x5a3305=uuid['v4']();_0x303b5d[_0x5da5('0xad')][_0x5a3305]=new Action(_0x1587e0,_0x4e902b,_0x5a3305);loggerBooked['info'](_0x5da5('0x1ed'),_0x5a3305,_0x5da5('0x1ee'),JSON[_0x5da5('0x79')](_0x1587e0[_0x5da5('0x136')]),_0x5da5('0x1ef'),_0x1587e0[_0x5da5('0x3f')]);if(_0x1587e0['queueStatusComplete']){_0x1587e0[_0x5da5('0x136')]=![];_0x303b5d[_0x5da5('0x2c')][_0x303b5d[_0x5da5('0xad')][_0x5a3305][_0x5da5('0xb9')]]=[];ami[_0x5da5('0xb3')]({'actionid':_0x5a3305,'action':_0x5da5('0x1f0'),'queue':_0x1587e0[_0x5da5('0x3f')]})['catch'](function(){_0x303b5d['updateOriginated'](_0x1587e0);_0x303b5d[_0x5da5('0xc5')]({'active':![],'ContactId':_0x303b5d[_0x5da5('0xad')][_0x5a3305][_0x5da5('0xd8')],'ListId':_0x303b5d[_0x5da5('0xad')][_0x5a3305]['ListId'],'VoiceQueueId':_0x303b5d[_0x5da5('0xad')][_0x5a3305]['VoiceQueueId']||undefined,'CampaignId':_0x303b5d[_0x5da5('0xad')][_0x5a3305][_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x303b5d[_0x5da5('0xad')][_0x5a3305];});}else{loggerBooked[_0x5da5('0x80')](_0x5da5('0x1f1'),JSON['stringify'](_0x1587e0[_0x5da5('0x136')]),_0x5da5('0x1ef'),_0x1587e0[_0x5da5('0x3f')]);_0x303b5d[_0x5da5('0xb8')](_0x1587e0);_0x303b5d[_0x5da5('0xc5')]({'active':![],'ContactId':_0x303b5d[_0x5da5('0xad')][_0x5a3305]['ContactId'],'ListId':_0x303b5d[_0x5da5('0xad')][_0x5a3305]['ListId'],'VoiceQueueId':_0x303b5d[_0x5da5('0xad')][_0x5a3305][_0x5da5('0xda')]||undefined,'CampaignId':_0x303b5d['actions'][_0x5a3305][_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1f2')));delete _0x303b5d[_0x5da5('0xad')][_0x5a3305];}}else{return _0x303b5d[_0x5da5('0x170')](_0x1587e0,_0x4e902b);}}else{if(getDiff(_0x4e902b[_0x5da5('0x1f3')])<_0x1587e0['dialRecallMeTimeout']*0x3c){if(_0x4e902b[_0x5da5('0x1f4')]&&!_0x4e902b[_0x5da5('0x1f4')][_0x5da5('0x1f5')]){_0x303b5d[_0x5da5('0x20')]['run'](_0x4e902b['id'])[_0x5da5('0x1f')](function(){_0x303b5d[_0x5da5('0xb8')](_0x1587e0);});}else{_0x303b5d[_0x5da5('0xc7')]({'active':![]},_0x4e902b['id'],0x1)[_0x5da5('0x1f')](function(){_0x303b5d['updateOriginated'](_0x1587e0);});}}else{_0x1587e0[_0x5da5('0x68')]+=0x1;_0x303b5d[_0x5da5('0xb8')](_0x1587e0);if(_0x1587e0['dialRecallInQueue']){_0x303b5d[_0x5da5('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e902b[_0x5da5('0xd8')],'ListId':_0x4e902b['ListId'],'VoiceQueueId':_0x4e902b[_0x5da5('0xda')]||undefined,'CampaignId':_0x4e902b[_0x5da5('0x104')]||undefined})[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1f6')));_0x303b5d[_0x5da5('0xd1')](createObjHistory(_0x1587e0,_0x4e902b,_0x5da5('0x1f7'),0x17,_0x5da5('0x1f8')))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0x1f9')));}else{_0x303b5d[_0x5da5('0xf1')](createObjHistory(_0x1587e0,_0x4e902b,_0x5da5('0x1fa'),0x16,_0x5da5('0x1fb')),_0x5da5('0x1fc'),_0x5da5('0x1fd'));}}}}else{_0x1587e0[_0x5da5('0x5f')]+=0x1;_0x303b5d['saveInDb'](createObjHistory(_0x1587e0,_0x4e902b,'BLACKLIST',0xd,_0x5da5('0x1fe')),_0x5da5('0x1ff'),_0x5da5('0x200'));throw'inBlackList';}};};Dialer[_0x5da5('0xaf')][_0x5da5('0x163')]=function(_0x4f6b7b){var _0x177eae=this;var _0x280395=_0x4f6b7b[_0x5da5('0x201')]-_0x4f6b7b['originated']-_0x4f6b7b['temp'];emitCampaignSummary(_0x4f6b7b);if(_0x280395>0x0){if(_0x280395>this[_0x5da5('0x25')]){_0x280395=this[_0x5da5('0x25')];}_0x4f6b7b[_0x5da5('0xca')]+=_0x280395;this[_0x5da5('0xcc')](_0x4f6b7b['id'],_0x280395,_0x4f6b7b[_0x5da5('0x202')],_0x4f6b7b)[_0x5da5('0xbd')](function(_0x4f21b4){_0x4f6b7b['temp']-=_0x280395;_0x4f6b7b[_0x5da5('0xca')]=_0x4f6b7b[_0x5da5('0xca')]>0x0?_0x4f6b7b[_0x5da5('0xca')]:0x0;if(!checkContactEmpty(_0x4f21b4)){_0x4f6b7b[_0x5da5('0x42')]=_0x5da5('0xa1');logger[_0x5da5('0x80')](_0x5da5('0x203')+_0x4f6b7b[_0x5da5('0x3f')]);}else{_0x4f6b7b[_0x5da5('0x74')]+=_0x4f21b4[_0x5da5('0x9a')];_0x4f6b7b[_0x5da5('0x42')]=_0x5da5('0x204');for(var _0x126950=0x0;_0x126950<_0x4f21b4['length'];_0x126950+=0x1){_0x4f6b7b[_0x5da5('0x205')]+=0x1;if(_[_0x5da5('0xb2')](_0x4f21b4[_0x126950])||_[_0x5da5('0xb2')](_0x4f21b4[_0x126950][_0x5da5('0x174')])||_[_0x5da5('0xb2')](_0x4f21b4[_0x126950][_0x5da5('0x174')]['phone'])){_0x177eae['emptyContact'](_0x5da5('0x206'),_0x4f6b7b,_0x4f21b4[_0x126950]);}else{_0x177eae[_0x5da5('0xc1')](_[_0x5da5('0x135')](_0x4f21b4[_0x126950],['CampaignId',_0x5da5('0x207')]))['then'](_0x177eae[_0x5da5('0x1ec')](_0x4f6b7b,_0x4f21b4[_0x126950]))['catch'](_0x177eae[_0x5da5('0xd5')](_0x5da5('0x208'),_0x4f6b7b));}}}})['catch'](loggerGetContactDialer(_0x5da5('0x209'),_0x4f6b7b,_0x280395));}};Dialer[_0x5da5('0xaf')][_0x5da5('0x15e')]=function(_0x4394f6,_0x2ea91b){var _0x21474a=this;var _0x2b797a=[];var _0x326041=_0x2ea91b>=0x1?_0x2ea91b:0x1;if(_0x4394f6[_0x5da5('0x58')]===_0x5da5('0x8')){_0x326041=0x1;}var _0x51b7da=Math[_0x5da5('0x1d3')](_0x4394f6[_0x5da5('0x4f')]*_0x326041)-_0x4394f6[_0x5da5('0x74')]-_0x4394f6['temp'];emitVoiceQueueSummary(_0x4394f6);if(_0x4394f6[_0x5da5('0x20a')]>0x0){var _0x48e3fb=_0x4394f6[_0x5da5('0x20a')]-_0x4394f6['originated']-_0x4394f6[_0x5da5('0x54')]-_0x4394f6[_0x5da5('0xca')]-_0x4394f6[_0x5da5('0x50')];if(_0x51b7da>_0x48e3fb){_0x51b7da=_0x48e3fb;}}if(_0x51b7da>0x0){if(_0x4394f6[_0x5da5('0x58')]===_0x5da5('0x8')){_0x51b7da=0x1;}if(_0x51b7da>this['maxNumberOriginate']){_0x51b7da=this['maxNumberOriginate'];}_0x4394f6[_0x5da5('0xca')]+=_0x51b7da;for(var _0x10198e in this[_0x5da5('0x23')]){if(typeof this[_0x5da5('0x23')][_0x10198e]!==_0x5da5('0x9b')){if(this[_0x5da5('0x23')][_0x10198e][_0x5da5('0xa9')]==='not_inuse'&&this[_0x5da5('0x23')][_0x10198e][_0x5da5('0xb4')]===_0x5da5('0xe0')){_0x2b797a[_0x5da5('0x134')](this['agents'][_0x10198e]['id']);}}}this[_0x5da5('0xc9')](_0x4394f6['id'],_0x2b797a,_0x51b7da,_0x4394f6['dialOrderByScheduledAt'],_0x4394f6)[_0x5da5('0xbd')](function(_0x606a27){_0x4394f6['temp']-=_0x51b7da;_0x4394f6['temp']=_0x4394f6['temp']>0x0?_0x4394f6['temp']:0x0;if(!checkContactEmpty(_0x606a27)){_0x21474a[_0x5da5('0xbb')](_0x4394f6)[_0x5da5('0xbd')](sendMessageReschedule(_0x4394f6))['catch'](loggerCatch(_0x5da5('0xbe')));}else{_0x4394f6['originated']+=_0x606a27[_0x5da5('0x9a')];_0x4394f6[_0x5da5('0x42')]=_0x4394f6['dialMethod']==='booked'?'ACTIVE':'RUNNING';for(var _0x216658=0x0;_0x216658<_0x606a27[_0x5da5('0x9a')];_0x216658+=0x1){if(_[_0x5da5('0xb2')](_0x606a27[_0x216658])||_[_0x5da5('0xb2')](_0x606a27[_0x216658][_0x5da5('0x174')])||_[_0x5da5('0xb2')](_0x606a27[_0x216658][_0x5da5('0x174')]['phone'])){_0x21474a[_0x5da5('0xd6')](_0x5da5('0x206'),_0x4394f6,_0x606a27[_0x216658]);}else{_0x21474a[_0x5da5('0xbf')](_[_0x5da5('0x135')](_0x606a27[_0x216658],[_0x5da5('0xda'),_0x5da5('0x207')]))['then'](_0x21474a[_0x5da5('0x1ec')](_0x4394f6,_0x606a27[_0x216658]))[_0x5da5('0xb6')](_0x21474a[_0x5da5('0xd5')](_0x5da5('0x206'),_0x4394f6));}}}})[_0x5da5('0xb6')](loggerGetContactDialer(_0x5da5('0x20b'),_0x4394f6,_0x51b7da));}};Dialer[_0x5da5('0xaf')][_0x5da5('0x92')]=function(_0x3cbd72){if(_0x3cbd72['dialLimitQueue']>0x0){var _0x28300b=_0x3cbd72[_0x5da5('0x20a')]-_0x3cbd72['originated']-_0x3cbd72['talking'];if(_0x28300b>0x0){this['tryOriginatePredictive'](_0x3cbd72);}else{loggerPredictiveCalls['info'](_0x5da5('0x20c'));}}else{this[_0x5da5('0x20d')](_0x3cbd72);}};Dialer[_0x5da5('0xaf')][_0x5da5('0x20d')]=function(_0xb00840){var _0x1a4349=this;var _0x4cea02=[];_0xb00840[_0x5da5('0x74')]+=0x1;for(var _0xdc3d7e in this[_0x5da5('0x23')]){if(typeof this[_0x5da5('0x23')][_0xdc3d7e]!=='undefined'){if(this[_0x5da5('0x23')][_0xdc3d7e][_0x5da5('0xa9')]===_0x5da5('0x20e')&&this[_0x5da5('0x23')][_0xdc3d7e]['status']===_0x5da5('0xe0')){_0x4cea02[_0x5da5('0x134')](this['agents'][_0xdc3d7e]['id']);}}}this[_0x5da5('0xc9')](_0xb00840['id'],_0x4cea02,0x1,_0xb00840['dialOrderByScheduledAt'],_0xb00840)['then'](function(_0x548fe4){if(!checkContactEmpty(_0x548fe4)){checkContactLowerLimitOriginate(_0xb00840,0x1,0x0);_0x1a4349[_0x5da5('0xbb')](_0xb00840)[_0x5da5('0xbd')](sendMessageReschedule(_0xb00840))[_0x5da5('0xb6')](loggerCatch(_0x5da5('0xbe')));}else{_0xb00840[_0x5da5('0x42')]=_0x5da5('0x204');if(_[_0x5da5('0xb2')](_0x548fe4[0x0])||_[_0x5da5('0xb2')](_0x548fe4[0x0][_0x5da5('0x174')])||_['isNil'](_0x548fe4[0x0]['Contact'][_0x5da5('0x175')])){_0x1a4349[_0x5da5('0xd6')]('[actionOriginate]\x20',_0xb00840,_0x548fe4[0x0]);}else{_0x1a4349[_0x5da5('0xbf')](_[_0x5da5('0x135')](_0x548fe4[0x0],['VoiceQueueId',_0x5da5('0x207')]))[_0x5da5('0xbd')](_0x1a4349['checkContactBlack'](_0xb00840,_0x548fe4[0x0]))['catch'](_0x1a4349[_0x5da5('0xd5')]('[actionOriginatePredictive]\x20',_0xb00840));}}})[_0x5da5('0xb6')](loggerGetContactDialer(_0x5da5('0x20f'),_0xb00840,0x1));emitVoiceQueueSummary(_0xb00840);};Dialer[_0x5da5('0xaf')][_0x5da5('0x1e2')]=function(_0x59d5c0,_0x560c6c,_0x3a2911,_0x211a7d,_0x3af686,_0x2b9522){loggerPredictive[_0x5da5('0x80')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x5da5('0x80')](_0x5da5('0x210'),_0x59d5c0);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x211'),_0x560c6c);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x212'),_0x3a2911);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x213'),_0x211a7d);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x214'),_0x3af686);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x85'));return new BPromise(function(_0x129a24,_0x2429af){if(_0x59d5c0<=0x0||isNaN(_0x59d5c0)){return _0x2429af(msgResponse('[abandonmentRate]',_0x5da5('0x48'),_0x5da5('0x215')+_0x59d5c0));}if(_0x3a2911<=0x0||isNaN(_0x3a2911)){return _0x2429af(msgResponse(_0x5da5('0x216'),_0x5da5('0x48'),_0x5da5('0x217')+_0x3a2911));}if(_0x211a7d<=0x0||isNaN(_0x211a7d)){return _0x2429af(msgResponse('[abandonmentRate]','Error',_0x5da5('0x218')+_0x211a7d));}if(_0x560c6c<=0x0||isNaN(_0x560c6c)){return _0x2429af(msgResponse('[abandonmentRate]',_0x5da5('0x48'),_0x5da5('0x219')+_0x560c6c));}if(_0x3af686<=0x0||isNaN(_0x3af686)){return _0x2429af(msgResponse(_0x5da5('0x216'),_0x5da5('0x48'),_0x5da5('0x21a')+_0x3af686));}_0x2b9522=_0x2b9522||0x0;var _0x4595e8=0x1/_0x3a2911;var _0x4c7864=0x0;var _0x5bd285=0x0;var _0x1e8340=0x0;var _0x337527=0x0;for(var _0x261086=0x0;_0x1e8340<_0x3af686;_0x261086+=0x1){_0x5bd285=_0x261086/_0x560c6c;_0x4c7864=(_0x211a7d*_0x5bd285+_0x2b9522)/_0x4595e8;_0x1e8340=erlangb(_0x4c7864,_0x59d5c0);_0x337527=_0x4c7864/_0x59d5c0*(0x1-erlangb(_0x4c7864,_0x59d5c0));}return _0x129a24({'erlangCalls':_0x261086,'erlangCallToSecond':_0x560c6c/_0x261086,'erlangAbandonmentRate':_0x1e8340,'erlangBusyFactor':_0x337527});});};Dialer[_0x5da5('0xaf')][_0x5da5('0x1e4')]=function(_0x56266c,_0x94d5a7,_0xf0c3f4,_0x16df42,_0xf66be1,_0xbdf26b){loggerPredictive['info'](_0x5da5('0x21b'));loggerPredictive['info'](_0x5da5('0x210'),_0x56266c);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x211'),_0x94d5a7);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x212'),_0xf0c3f4);loggerPredictive['info'](_0x5da5('0x213'),_0x16df42);loggerPredictive[_0x5da5('0x80')](_0x5da5('0x21c'),_0xf66be1);loggerPredictive[_0x5da5('0x80')]('---------------------------');return new BPromise(function(_0x19a7a3,_0x282f6d){if(_0x56266c<=0x0||isNaN(_0x56266c)){return _0x282f6d(msgResponse(_0x5da5('0x21d'),'Error',_0x5da5('0x215')+_0x56266c));}if(_0xf0c3f4<=0x0||isNaN(_0xf0c3f4)){return _0x282f6d(msgResponse(_0x5da5('0x21d'),_0x5da5('0x48'),_0x5da5('0x217')+_0xf0c3f4));}if(_0x16df42<=0x0||isNaN(_0x16df42)){return _0x282f6d(msgResponse(_0x5da5('0x21d'),_0x5da5('0x48'),_0x5da5('0x218')+_0x16df42));}if(_0x94d5a7<=0x0||isNaN(_0x94d5a7)){return _0x282f6d(msgResponse(_0x5da5('0x21d'),'Error','interval\x20=\x20'+_0x94d5a7));}if(_0xf66be1<=0x0||isNaN(_0xf66be1)){return _0x282f6d(msgResponse(_0x5da5('0x21d'),_0x5da5('0x48'),_0x5da5('0x21e')+_0xf66be1));}_0xbdf26b=_0xbdf26b||0x0;var _0x29b683=0x1/_0xf0c3f4;var _0x466ea0=0x0;var _0x40cd21=0x0;var _0x14c0ca=0x0;var _0x2ca26d=0x0;for(var _0x38c43c=0x0;_0x2ca26d<_0xf66be1;_0x38c43c+=0x1){_0x40cd21=_0x38c43c/_0x94d5a7;_0x466ea0=(_0x16df42*_0x40cd21+_0xbdf26b)/_0x29b683;_0x14c0ca=erlangb(_0x466ea0,_0x56266c);_0x2ca26d=_0x466ea0/_0x56266c*(0x1-erlangb(_0x466ea0,_0x56266c));}return _0x19a7a3({'erlangCalls':_0x38c43c,'erlangCallToSecond':_0x94d5a7/_0x38c43c,'erlangAbandonmentRate':_0x14c0ca,'erlangBusyFactor':_0x2ca26d});});};module[_0x5da5('0x21f')]=Dialer; \ No newline at end of file +var _0x9c44=['sendMessageOneNotActive','state','statedesc','endtime','clearZombieChannels','isNil','Action','catch','updateOriginated','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','createHistory','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','dialAMDActive','countglobal','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','rescheduleContact','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countdropretry','dialGlobalMaxRetry','dialMachineMaxRetry','add','minutes','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','status','paused','stateinterface','locked','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','content','indexOf','true','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','\x5cw{0,','pow','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[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]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','dialOrderByScheduledAt','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','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','bluebird','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./history','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','bind','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','syncHangup','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','voice:queue:%s','voice_queue:save','format','campaign:save','info','-----\x20Stats\x20Predictive\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','Dropped\x20Exit:\x20\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---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive'];(function(_0x5ec84c,_0xa6b2b1){var _0x4d86d7=function(_0x2ae982){while(--_0x2ae982){_0x5ec84c['push'](_0x5ec84c['shift']());}};_0x4d86d7(++_0xa6b2b1);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x49c4('0x0'));var uuid=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var rr=require('rr');var md5=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var ut=require(_0x49c4('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x49c4('0x6'));var loggerBooked=require('../../../config/logger')(_0x49c4('0x7'));var loggerPredictive=require(_0x49c4('0x8'))(_0x49c4('0x9'));var loggerPredictiveCalls=require(_0x49c4('0x8'))(_0x49c4('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x49c4('0xb'));var ami=require(_0x49c4('0xc'));config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0xf'))(new Redis(config[_0x49c4('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x49c4('0x10'));var cmHopperBlack=require(_0x49c4('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x49c4('0x12'));var Final=require(_0x49c4('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x49c4('0x14'));var Hangup=require(_0x49c4('0x15'));var ipAgi=process['env'][_0x49c4('0x16')]||_0x49c4('0x17');var strategy={'rrmemory':_0x49c4('0x18'),'roundrobin':_0x49c4('0x19')};var Sequence=function(){};Sequence[_0x49c4('0x1a')][_0x49c4('0x1b')]=function(_0x75ea8){this[_0x49c4('0x1c')]=this['tail']?this[_0x49c4('0x1c')][_0x49c4('0x1d')](_0x75ea8):_0x75ea8();};function Dialer(_0x13a2db,_0x81e831){this[_0x49c4('0x1e')]=new Sequence();this['preview']=_0x81e831;this[_0x49c4('0x1f')]=_0x13a2db[_0x49c4('0x1f')];this['campaigns']=_0x13a2db['campaigns'];this[_0x49c4('0x20')]=_0x13a2db[_0x49c4('0x20')];this[_0x49c4('0x21')]=_0x13a2db['trunks'];this[_0x49c4('0x22')]=config['maxNumberOriginate']||0x2;this[_0x49c4('0x23')]={};this[_0x49c4('0x24')]={};this[_0x49c4('0x25')]={};this[_0x49c4('0x26')]={};this[_0x49c4('0x27')]={};this[_0x49c4('0x28')]={};this[_0x49c4('0x29')]={};this[_0x49c4('0x2a')]={};this[_0x49c4('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this['syncAgentConnect'][_0x49c4('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x2d'),this[_0x49c4('0x2e')][_0x49c4('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x2f'),this['syncQueueSummary'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x30'),this[_0x49c4('0x31')][_0x49c4('0x2c')](this));ami['on']('newexten',this['syncNewExten'][_0x49c4('0x2c')](this));ami['on']('varset',this[_0x49c4('0x32')][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x33'),this[_0x49c4('0x34')]['bind'](this));ami['on'](_0x49c4('0x35'),this[_0x49c4('0x36')][_0x49c4('0x2c')](this));this[_0x49c4('0x37')]();this[_0x49c4('0x38')]();}function isNotNull(_0x29f835){return _0x29f835!==null&&!_[_0x49c4('0x39')](_0x29f835);}function checkIsLoggedIn(_0x427b26,_0x17b50f){return function(){if(_0x17b50f<=0x0){_0x427b26[_0x49c4('0x3a')]=_0x49c4('0x3b');throw _0x427b26['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x59eb84){return _0x59eb84;}function checkIsActive(_0x134928,_0x7ee704){return function(){if(!isActive(_0x7ee704)){_0x134928[_0x49c4('0x3a')]=_0x49c4('0x3c');throw _0x134928[_0x49c4('0x3d')]+'\x20NOT\x20Active';}};}function checkInterval(_0x38ad77){return function(){if(!isNotNull(_0x38ad77[_0x49c4('0x3e')])){_0x38ad77[_0x49c4('0x3a')]=_0x49c4('0x3f');throw _0x38ad77['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x38ad77[_0x49c4('0x3e')][_0x49c4('0x40')])){_0x38ad77[_0x49c4('0x3a')]=_0x49c4('0x3f');throw _0x38ad77[_0x49c4('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x49c4('0x41')](_0x38ad77[_0x49c4('0x3e')][_0x49c4('0x40')]))){_0x38ad77['message']='INTERVAL_IS_NULL';throw _0x38ad77[_0x49c4('0x3d')]+_0x49c4('0x42');}};}function msgResponse(_0x3bec0a,_0x1238c0,_0x2b45a1){return{'action':_0x3bec0a,'response':_0x1238c0,'message':_0x2b45a1,'stack':_0x2b45a1};}function myreject(_0x2cf897){return function(_0x1d1557){return _0x2cf897(msgResponse(_0x49c4('0x43'),_0x49c4('0x44'),JSON['stringify'](_0x1d1557)));};}function getSeconds(_0x2d34ca,_0x5b96df){var _0xdda586=moment(_0x2d34ca)[_0x49c4('0x45')](0x0);var _0x2625a6=moment(_0x5b96df)[_0x49c4('0x45')](0x0);return _0xdda586['diff'](_0x2625a6,_0x49c4('0x46'));}function emit(_0x31f3ff,_0x1c910a,_0x4e913a){io['to'](_0x31f3ff)[_0x49c4('0x47')](_0x1c910a,_0x4e913a);}function emitVoiceQueueSummary(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x48')]===_0x49c4('0x49')){var _0x1ba7a0={'id':_0x21d8c7['id'],'name':_0x21d8c7[_0x49c4('0x3d')],'strategy':_0x21d8c7[_0x49c4('0x4a')],'answered':_0x21d8c7[_0x49c4('0x4b')],'available':_0x21d8c7[_0x49c4('0x4c')],'loggedIn':_0x21d8c7[_0x49c4('0x4d')],'pTalking':_0x21d8c7[_0x49c4('0x4e')],'sumBillable':_0x21d8c7['sumBillable'],'sumDuration':_0x21d8c7[_0x49c4('0x4f')],'sumHoldTime':_0x21d8c7[_0x49c4('0x50')]||0x0,'talking':_0x21d8c7[_0x49c4('0x51')],'total':_0x21d8c7[_0x49c4('0x52')],'type':_0x21d8c7[_0x49c4('0x48')],'unmanaged':_0x21d8c7[_0x49c4('0x53')],'abandoned':_0x21d8c7[_0x49c4('0x54')],'waiting':_0x21d8c7[_0x49c4('0x55')],'loggedInDb':_0x21d8c7[_0x49c4('0x56')],'dialActive':_0x21d8c7[_0x49c4('0x57')],'dialMethod':_0x21d8c7[_0x49c4('0x58')],'dialOriginateCallerIdName':_0x21d8c7[_0x49c4('0x59')],'dialOriginateCallerIdNumber':_0x21d8c7[_0x49c4('0x5a')],'dialOriginateTimeout':_0x21d8c7['dialOriginateTimeout'],'dialPrefix':_0x21d8c7[_0x49c4('0x5b')],'outboundAnswerAgiCallsDay':_0x21d8c7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x21d8c7[_0x49c4('0x5c')],'outboundBlacklistCallsDay':_0x21d8c7[_0x49c4('0x5d')],'outboundBusyCallsDay':_0x21d8c7[_0x49c4('0x5e')],'outboundCongestionCallsDay':_0x21d8c7[_0x49c4('0x5f')],'outboundDropCallsDayACS':_0x21d8c7[_0x49c4('0x60')],'outboundDropCallsDayCallersExit':_0x21d8c7[_0x49c4('0x61')],'outboundDropCallsDayTimeout':_0x21d8c7['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x21d8c7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x21d8c7[_0x49c4('0x62')],'outboundOriginateFailureCallsDay':_0x21d8c7[_0x49c4('0x63')],'outboundReCallsDay':_0x21d8c7[_0x49c4('0x64')],'outboundRejectCallsDay':_0x21d8c7[_0x49c4('0x65')],'outboundUnknownCallsDay':_0x21d8c7['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x21d8c7[_0x49c4('0x66')],'predictiveIntervalAvgHoldtime':_0x21d8c7[_0x49c4('0x67')],'predictiveIntervalAvgTalktime':_0x21d8c7[_0x49c4('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x21d8c7[_0x49c4('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x21d8c7[_0x49c4('0x6a')],'predictiveIntervalErlangCalls':_0x21d8c7[_0x49c4('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x21d8c7[_0x49c4('0x6c')],'predictiveIntervalHitRate':_0x21d8c7[_0x49c4('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x21d8c7[_0x49c4('0x6e')],'predictiveIntervalPauses':_0x21d8c7['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x21d8c7[_0x49c4('0x6f')],'predictiveIntervalTotalCalls':_0x21d8c7['predictiveIntervalTotalCalls'],'message':_0x21d8c7[_0x49c4('0x3a')],'originated':_0x21d8c7[_0x49c4('0x70')],'erlangCalls':_0x21d8c7[_0x49c4('0x71')],'erlangCallToSecond':_0x21d8c7[_0x49c4('0x72')],'erlangAbandonmentRate':_0x21d8c7[_0x49c4('0x73')],'erlangBusyFactor':_0x21d8c7['erlangBusyFactor'],'startPredictive':_0x21d8c7[_0x49c4('0x28')],'startProgressive':_0x21d8c7[_0x49c4('0x29')]};if(_0x21d8c7[_0x49c4('0x74')]){_0x1ba7a0[_0x49c4('0x74')]={'id':_0x21d8c7[_0x49c4('0x74')]['id'],'name':_0x21d8c7[_0x49c4('0x74')][_0x49c4('0x3d')],'active':_0x21d8c7['Trunk'][_0x49c4('0x75')],'callerid':_0x21d8c7['Trunk'][_0x49c4('0x76')]};}if(_0x21d8c7[_0x49c4('0x3e')]){_0x1ba7a0[_0x49c4('0x3e')]={'id':_0x21d8c7[_0x49c4('0x3e')]['id'],'name':_0x21d8c7[_0x49c4('0x3e')][_0x49c4('0x3d')]};}var _0x2c6be1=md5(JSON['stringify'](_0x1ba7a0));if(_0x21d8c7[_0x49c4('0x3')]!==_0x2c6be1){_0x21d8c7[_0x49c4('0x3')]=_0x2c6be1;emit(util['format'](_0x49c4('0x77'),_0x1ba7a0[_0x49c4('0x3d')]),_0x49c4('0x78'),_0x1ba7a0);}}}function emitCampaignSummary(_0x242afc){if(_0x242afc['type']==='ivr'){emit(util[_0x49c4('0x79')]('campaign:ivr:%s',_0x242afc[_0x49c4('0x3d')]),_0x49c4('0x7a'),_0x242afc);}}function checkGetDataPredictive(_0x3811b2){if(isNotNull(_0x3811b2)&&!_[_0x49c4('0x41')](_0x3811b2)){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7c'));loggerPredictive[_0x49c4('0x7b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2[_0x49c4('0x7d')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7e'),_0x3811b2[_0x49c4('0x66')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7f'),_0x3811b2[_0x49c4('0x6a')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x80'),_0x3811b2[_0x49c4('0x69')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2[_0x49c4('0x67')]);loggerPredictive[_0x49c4('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2['predictiveIntervalAvgTalktime']);loggerPredictive[_0x49c4('0x7b')]('---------------------------');if(_0x3811b2['predictiveIntervalTotalCalls']>0x0){if(!_[_0x49c4('0x39')](_0x3811b2[_0x49c4('0x68')])&&_0x3811b2[_0x49c4('0x68')]>0x0){return!![];}loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x81'));if(!_[_0x49c4('0x39')](_0x3811b2[_0x49c4('0x67')])&&_0x3811b2['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x82'));}else{loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x83'));}}else{loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x84'));}return![];}function mergeDataErlangB(_0x5d24f3){return function(_0x5c7ddd){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x85'));loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x86'),_0x5c7ddd[_0x49c4('0x71')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x87'),_0x5c7ddd['erlangCallToSecond']);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x88'),_0x5c7ddd['erlangAbandonmentRate']);loggerPredictive[_0x49c4('0x7b')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c7ddd[_0x49c4('0x89')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x88'),_0x5c7ddd[_0x49c4('0x73')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));_[_0x49c4('0x8b')](_0x5d24f3,_0x5c7ddd);};}function getDiff(_0x2f520f){var _0x483770=moment()[_0x49c4('0x45')](0x0);var _0x27b9c2=moment(_0x2f520f)['milliseconds'](0x0);return _0x483770[_0x49c4('0x8c')](_0x27b9c2,_0x49c4('0x46'));}function ifInterval(_0x4fefbd,_0x39c455){if(_[_0x49c4('0x39')](_0x39c455)){return![];}return getDiff(_0x39c455)<_0x4fefbd*0x3c;}function freeVariablesPredictive(_0x4f50bf){if(isNotNull(_0x4f50bf)){if(!_['isUndefined'](_0x4f50bf['startProgressive'])){_0x4f50bf['startProgressive']=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf['name'],_0x49c4('0x8d'));}if(!_[_0x49c4('0x39')](_0x4f50bf['startPredictive'])){_0x4f50bf[_0x49c4('0x28')]=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf['name'],_0x49c4('0x8e'));}if(!_[_0x49c4('0x39')](_0x4f50bf[_0x49c4('0x8f')])){clearInterval(_0x4f50bf[_0x49c4('0x8f')]);_0x4f50bf['handlePredictive']=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf[_0x49c4('0x3d')],_0x49c4('0x90'));}}}function erlangb(_0x20e97d,_0x5d3375){if(_0x5d3375===0x0){return 0x0;}var _0x617e2f=0x1;for(var _0x4a93bc=0x1;_0x4a93bc<=_0x5d3375;_0x4a93bc+=0x1){_0x617e2f=0x1+_0x617e2f*_0x4a93bc/_0x20e97d;}return 0x1/_0x617e2f;}function isVoiceQueueOutbound(_0x568457){return _0x568457==='outbound';}function isNotPreview(_0x5d6de0){return _0x5d6de0!==_0x49c4('0x91');}function isCampaignIvr(_0x32eaef){return _0x32eaef===_0x49c4('0x92');}function getCallerId(_0x28bbf3,_0x5b056e,_0x4daa6d){if(!_[_0x49c4('0x39')](_0x4daa6d)&&typeof _0x4daa6d===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x4daa6d)){if(!_[_0x49c4('0x39')](_0x5b056e)&&typeof _0x5b056e===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x5b056e)){return util[_0x49c4('0x79')](_0x49c4('0x94'),_0x5b056e,_0x4daa6d);}return util['format'](_0x49c4('0x94'),_0x4daa6d,_0x4daa6d);}if(!_['isUndefined'](_0x28bbf3)&&typeof _0x28bbf3===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x28bbf3)){return _0x28bbf3;}return _0x49c4('0x95');}function loggerCatchQueueSummary(_0x1ea1b4,_0x3a1c81){return function(_0x2e062f){freeVariablesPredictive(_0x3a1c81);emitVoiceQueueSummary(_0x3a1c81);emitCampaignSummary(_0x3a1c81);loggerSyncQueueSummary[_0x49c4('0x96')](_0x1ea1b4,util[_0x49c4('0x97')](_0x2e062f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x13d951,_0x1743d0){return function(_0x1e3911){loggerPredictive[_0x49c4('0x96')](_0x1743d0[_0x49c4('0x3d')],_0x13d951);loggerPredictive[_0x49c4('0x96')](_0x1e3911[_0x49c4('0x98')]);freeVariablesPredictive(_0x1743d0);};}function loggerCatch(_0x453cf2){return function(_0x371e49){logger[_0x49c4('0x96')](_0x453cf2,util['inspect'](_0x371e49,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5ec201){return _0x5ec201&&!_[_0x49c4('0x39')](_0x5ec201)&&_0x5ec201[_0x49c4('0x99')]>0x0;}function decremetOriginate(_0x4af680){if(!_[_0x49c4('0x39')](_0x4af680)&&_0x4af680!==null){if(typeof _0x4af680[_0x49c4('0x70')]!==_0x49c4('0x9a')){if(_0x4af680[_0x49c4('0x70')]>0x0){_0x4af680['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x49c4('0x96')](_0x49c4('0x9b'));}}function checkContactLowerLimitOriginate(_0x1b912a,_0x2f4289,_0x118fc4){if(_0x2f4289>_0x118fc4){for(var _0x146706=0x0;_0x146706<_0x2f4289-_0x118fc4;_0x146706+=0x1){decremetOriginate(_0x1b912a);}}}function loggerGetContactDialer(_0x191afb,_0x3692a4,_0x2cac74){return function(_0x54dea5){checkContactLowerLimitOriginate(_0x3692a4,_0x2cac74,0x0);logger[_0x49c4('0x96')](_0x191afb,util[_0x49c4('0x97')](_0x54dea5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x342f8f){return function(_0x4b759b){if(isNotNull(_0x4b759b)&&isNotNull(_0x4b759b[0x0])){if(_0x4b759b[0x0][_0x49c4('0x9c')]>0x0){_0x342f8f[_0x49c4('0x3a')]=_0x49c4('0x9d');logger[_0x49c4('0x7b')](_0x49c4('0x9e')+_0x342f8f[_0x49c4('0x3d')],_0x4b759b[0x0][_0x49c4('0x9c')],_0x49c4('0x9f'));}else{_0x342f8f['message']=_0x49c4('0xa0');logger[_0x49c4('0x7b')](_0x49c4('0xa1')+_0x342f8f[_0x49c4('0x3d')]);}}};}function notSendMessagesQueue(_0x1e948a){if(_0x1e948a['sendMessageOneNotActive']){freeVariablesPredictive(_0x1e948a);if(_0x1e948a['originated']===0x0&&_0x1e948a[_0x49c4('0x51')]===0x0&&_0x1e948a['waiting']===0x0&&(_0x1e948a[_0x49c4('0x4e')]||0x0)===0x0){_0x1e948a['sendMessageOneNotActive']=![];_0x1e948a[_0x49c4('0x4c')]=0x0;_0x1e948a[_0x49c4('0x3a')]=_0x49c4('0x3c');loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1e948a[_0x49c4('0x3d')],_0x49c4('0xa2'));}else{_0x1e948a[_0x49c4('0x3a')]=_0x49c4('0xa3');loggerSyncQueueSummary[_0x49c4('0x96')](_0x49c4('0xa4'),_0x1e948a[_0x49c4('0x3d')],_0x49c4('0xa5'));}emitVoiceQueueSummary(_0x1e948a);}}function notSendMessagesCampaign(_0x46477f){if(_0x46477f[_0x49c4('0xa6')]){if(_0x46477f['originated']===0x0){_0x46477f[_0x49c4('0xa6')]=![];_0x46477f[_0x49c4('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x46477f[_0x49c4('0x3d')],_0x49c4('0xa2'));}else{_0x46477f[_0x49c4('0x3a')]=_0x49c4('0xa3');loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x46477f[_0x49c4('0x3d')],_0x49c4('0xa5'));}emitCampaignSummary(_0x46477f);}}function createObjHistory(_0x596a9e,_0x2b5136,_0x167e41,_0x4eb72a,_0xbd12b9){_0x596a9e[_0x49c4('0x3a')]=_0x167e41;var _0x57b137=new Action(_0x596a9e,_0x2b5136);var _0x37fef1=new History(_0x57b137);_0x37fef1[_0x49c4('0xa7')]=_0x4eb72a;_0x37fef1[_0x49c4('0xa8')]=_0xbd12b9;_0x37fef1[_0x49c4('0xa9')]=_0x57b137['starttime'];return _0x37fef1;}Dialer[_0x49c4('0x1a')][_0x49c4('0x38')]=function(){var _0x4c2fed=this;setInterval(function(){_0x4c2fed[_0x49c4('0xaa')](_0x4c2fed['uniqueId'],'[uniqueid]');_0x4c2fed[_0x49c4('0xaa')](_0x4c2fed['actions'],'[actions]');},0x32c8);};Dialer[_0x49c4('0x1a')][_0x49c4('0xaa')]=function(_0x5daa58,_0x23e684){var _0x5c3509=this;for(var _0x578f4b in _0x5daa58){if(typeof _0x5daa58[_0x578f4b]!=='undefined'){this[_0x49c4('0x1e')][_0x49c4('0x1b')](function(){if(!_[_0x49c4('0xab')](_0x5daa58[_0x578f4b])){return ami[_0x49c4('0xac')]({'action':'status','channel':_0x5daa58[_0x578f4b]['channel']})[_0x49c4('0xad')](function(_0x48705c){if(_0x48705c[_0x49c4('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5daa58[_0x578f4b]&&_0x5daa58[_0x578f4b][_0x49c4('0x48')]!==_0x49c4('0x92')){_0x5c3509[_0x49c4('0xae')](_0x5c3509[_0x49c4('0x1f')][_0x5daa58[_0x578f4b][_0x49c4('0xaf')]]);logger[_0x49c4('0x96')](_0x49c4('0xb0'),_0x23e684,_0x578f4b,_0x5daa58[_0x578f4b]['queue']);delete _0x5daa58[_0x578f4b];}if(_0x5daa58[_0x578f4b]&&_0x5daa58[_0x578f4b][_0x49c4('0x48')]===_0x49c4('0x92')){_0x5c3509[_0x49c4('0xae')](_0x5c3509[_0x49c4('0xb1')][_0x5daa58[_0x578f4b][_0x49c4('0xaf')]]);logger['error'](_0x49c4('0xb2'),_0x23e684,_0x578f4b,_0x5daa58[_0x578f4b][_0x49c4('0xaf')]);delete _0x5daa58[_0x578f4b];}},0x2328);}});}});}}};Dialer[_0x49c4('0x1a')]['countReScheduled']=function(_0x530ff2){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xb5')](_0x530ff2))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xb6')));};Dialer['prototype'][_0x49c4('0xb7')]=function(_0x1a20f4){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopperBlack['checkIsBlackList'](_0x1a20f4))['catch'](loggerCatch(_0x49c4('0xb8')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xb9')]=function(_0x294ba0){return BPromise[_0x49c4('0xb3')]()['then'](cmHopperBlack[_0x49c4('0xb9')](_0x294ba0))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xba')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xbb')]=function(_0x8f37e5){return BPromise['resolve']()[_0x49c4('0xb4')](cmHopperHistory[_0x49c4('0xbc')](_0x8f37e5))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xbd')));};Dialer['prototype']['rescheduleContact']=function(_0xa96f53){return BPromise['resolve']()[_0x49c4('0xb4')](cmHopper['rescheduleContact'](_0xa96f53))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xbe')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xbf')]=function(_0x4eebc9,_0x4ad966,_0x2e352e){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper['unlockContact'](_0x4eebc9,_0x4ad966,_0x2e352e))['catch'](loggerCatch(_0x49c4('0xc0')));};Dialer['prototype']['getContactDialer']=function(_0x1b9473,_0x5a2858,_0x22668b,_0x3cfa95,_0x4fc419){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper['getContactDialer'](_0x1b9473,_0x5a2858,_0x22668b,_0x3cfa95))['catch'](function(_0xdb9820){_0x4fc419['temp']-=_0x22668b;_0x4fc419[_0x49c4('0xc1')]=_0x4fc419[_0x49c4('0xc1')]>0x0?_0x4fc419[_0x49c4('0xc1')]:0x0;loggerCatch(_0x49c4('0xc2'))(_0xdb9820);});};Dialer[_0x49c4('0x1a')][_0x49c4('0xc3')]=function(_0x2ecc6d,_0x5f07fa,_0x30878d,_0x12afa1){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xc3')](_0x2ecc6d,_0x5f07fa,_0x30878d))['catch'](function(_0x39ea40){_0x12afa1['temp']-=_0x5f07fa;_0x12afa1[_0x49c4('0xc1')]=_0x12afa1[_0x49c4('0xc1')]>0x0?_0x12afa1[_0x49c4('0xc1')]:0x0;loggerCatch(_0x49c4('0xc4'))(_0x39ea40);});};Dialer['prototype'][_0x49c4('0xc5')]=function(_0x139696){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](voiceQueueRt[_0x49c4('0xc5')](_0x139696))[_0x49c4('0xad')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x49c4('0x1a')]['moveContactManagedDialer']=function(_0xac53ad){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xc6')](_0xac53ad))['catch'](loggerCatch(_0x49c4('0xc7')));};Dialer[_0x49c4('0x1a')]['createHistory']=function(_0x1e0b7d){return BPromise[_0x49c4('0xb3')]()['then'](cmHopperHistory['createHistory'](_0x1e0b7d))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xc8')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xae')]=function(_0x32afd4){if(!_[_0x49c4('0x39')](_0x32afd4)&&_0x32afd4!==null){if(typeof _0x32afd4[_0x49c4('0x70')]!==_0x49c4('0x9a')){if(_0x32afd4[_0x49c4('0x70')]>0x0){_0x32afd4[_0x49c4('0x70')]-=0x1;}else{logger[_0x49c4('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x49c4('0xc9'));}};Dialer[_0x49c4('0x1a')][_0x49c4('0xca')]=function(_0x5be042,_0x1276bf){var _0x326ca8=this;return function(_0x5ca87e){_0x326ca8[_0x49c4('0xae')](_0x1276bf);logger['error'](_0x5be042,util[_0x49c4('0x97')](_0x5ca87e,{'showHidden':![],'depth':null}));};};Dialer[_0x49c4('0x1a')][_0x49c4('0xcb')]=function(_0x941b9d,_0x572433,_0x2456a0){var _0x44a9e2={'state':0x19,'statedesc':_0x49c4('0xcc')};this[_0x49c4('0xae')](_0x572433);this[_0x49c4('0xcd')](_['merge'](_0x44a9e2,_['pick'](_0x2456a0,['ContactId',_0x49c4('0xce'),_0x49c4('0xcf'),_0x49c4('0xd0'),_0x49c4('0xd1')])),_0x49c4('0xd2'),'[emptyContact]');logger[_0x49c4('0x96')](_0x941b9d);};Dialer[_0x49c4('0x1a')][_0x49c4('0xd3')]=function(_0x39a085){return _0x39a085==='Success';};Dialer[_0x49c4('0x1a')][_0x49c4('0xd4')]=function(_0x10fa42){return!_[_0x49c4('0x39')](_0x10fa42)&&_0x10fa42&&!_[_0x49c4('0x39')](_0x10fa42['name'])&&!_[_0x49c4('0x39')](_0x10fa42[_0x49c4('0x75')])&&_0x10fa42[_0x49c4('0x75')]&&(this['trunks'][util[_0x49c4('0x79')](_0x49c4('0xd5'),_0x10fa42[_0x49c4('0x3d')])]['status']===_0x49c4('0xd6')||this['trunks'][util['format'](_0x49c4('0xd5'),_0x10fa42[_0x49c4('0x3d')])]['status']===_0x49c4('0xd7'));};Dialer[_0x49c4('0x1a')][_0x49c4('0xcd')]=function(_0x1ffc9a,_0x10f5fc,_0x3a7559){this[_0x49c4('0xd8')](_0x1ffc9a)[_0x49c4('0xad')](loggerCatch(_0x10f5fc));this['moveContactManagedDialer'](_0x1ffc9a)['catch'](loggerCatch(_0x3a7559));};Dialer[_0x49c4('0x1a')][_0x49c4('0x32')]=function(_0x42f2db){var _0x5f04f2=this['uniqueId'][_0x42f2db[_0x49c4('0xd9')]];var _0x3222ec;if(!_[_0x49c4('0xab')](_0x42f2db)&&!_[_0x49c4('0xab')](_0x42f2db[_0x49c4('0xda')])&&!_[_0x49c4('0xab')](_0x42f2db[_0x49c4('0xda')][_0x49c4('0xdb')])&&_0x42f2db[_0x49c4('0xdc')]===_0x49c4('0xdd')&&_0x5f04f2){if(_0x5f04f2[_0x49c4('0x48')]!==_0x49c4('0x92')&&this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]]['dialAMDActive']&&_0x42f2db[_0x49c4('0xde')]===_0x49c4('0xdf')){delete this[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];this['updateOriginated'](this['voiceQueues'][_0x5f04f2[_0x49c4('0xaf')]]);this['voiceQueues'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;_0x3222ec=new Hangup(_0x5f04f2,_0x42f2db);_0x3222ec[_0x49c4('0xa7')]=0x12;_0x3222ec[_0x49c4('0xa8')]=_0x49c4('0xe1');_0x3222ec[_0x49c4('0xe2')]=_0x49c4('0xe3');ami[_0x49c4('0x47')](_0x49c4('0xe4'),ut['buildObj'](_0x3222ec,_0x49c4('0xe5')));this[_0x49c4('0xcd')](_0x3222ec,_0x49c4('0xe6'),'[syncHangupInAMD]');}if(_0x5f04f2[_0x49c4('0x48')]!=='ivr'&&this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe7')]&&_0x42f2db[_0x49c4('0xde')]==='MACHINE'){var _0x777777=this;return new BPromise(function(_0x479747,_0x4a8720){delete _0x777777[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];_0x777777[_0x49c4('0xae')](_0x777777['voiceQueues'][_0x5f04f2['queue']]);_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;var _0x2dafd9=_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]];var _0x54421b=new Hangup(_0x5f04f2,_0x42f2db);_0x54421b[_0x49c4('0xa7')]=0x13;_0x54421b[_0x49c4('0xa8')]='Machine';_0x54421b['membername']=_0x49c4('0xe3');_0x54421b['countmachineretry']+=0x1;_0x54421b[_0x49c4('0xe8')]+=0x1;_0x54421b['amd']=!![];ami[_0x49c4('0x47')]('custom:amd',ut[_0x49c4('0xe9')](_0x54421b,_0x49c4('0xe5')));_0x777777[_0x49c4('0xd8')](_0x54421b)[_0x49c4('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54421b['countbusyretry']+_0x54421b[_0x49c4('0xea')]+_0x54421b[_0x49c4('0xeb')]+_0x54421b[_0x49c4('0xec')]+_0x54421b['countdropretry']+_0x54421b[_0x49c4('0xed')]+_0x54421b[_0x49c4('0xee')]+_0x54421b['countagentrejectretry']>=_0x2dafd9['dialGlobalMaxRetry']){_0x777777[_0x49c4('0xef')](_0x54421b,_0x479747,_0x4a8720,_0x49c4('0xf0'));}else{if(_0x54421b[_0x49c4('0xee')]>=_0x2dafd9['dialMachineMaxRetry']){_0x777777[_0x49c4('0xf1')](_0x54421b,_0x479747,_0x4a8720,_0x49c4('0xf2'));}else{_0x777777[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x54421b[_0x49c4('0xee')],'scheduledat':moment()['add'](_0x2dafd9[_0x49c4('0xf4')],'minutes')['format'](_0x49c4('0xf5')),'ContactId':_0x54421b[_0x49c4('0xf6')],'ListId':_0x54421b[_0x49c4('0xce')],'VoiceQueueId':_0x54421b[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54421b['CampaignId']||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0xf7')));_0x479747({'reschedule':0x1});}}});}if(_0x5f04f2[_0x49c4('0x48')]===_0x49c4('0x92')&&this['campaigns'][_0x5f04f2[_0x49c4('0xaf')]]['dialAMDActive']&&_0x42f2db['value']===_0x49c4('0xdf')){delete this[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];this['updateOriginated'](this[_0x49c4('0xb1')][_0x5f04f2['queue']]);_0x3222ec=new Hangup(_0x5f04f2,_0x42f2db);_0x3222ec[_0x49c4('0xa7')]=0x12;_0x3222ec[_0x49c4('0xa8')]=_0x49c4('0xe1');_0x3222ec[_0x49c4('0xe2')]=_0x49c4('0xe3');ami[_0x49c4('0x47')](_0x49c4('0xe4'),ut['buildObj'](_0x3222ec,_0x49c4('0xe5')));this[_0x49c4('0xcd')](_0x3222ec,_0x49c4('0xf8'),_0x49c4('0xf9'));}if(_0x5f04f2['type']==='ivr'&&this['campaigns'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe7')]&&_0x42f2db[_0x49c4('0xde')]===_0x49c4('0xfa')){var _0x777777=this;return new BPromise(function(_0x40c7ab,_0x372038){delete _0x777777['uniqueId'][_0x42f2db[_0x49c4('0xd9')]];_0x777777[_0x49c4('0xae')](_0x777777['campaigns'][_0x5f04f2['queue']]);_0x777777['campaigns'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;_0x777777[_0x49c4('0xb1')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;var _0x1480d3=_0x777777[_0x49c4('0xb1')][_0x5f04f2['queue']];var _0x83440b=new Hangup(_0x5f04f2,_0x42f2db);_0x83440b[_0x49c4('0xa7')]=0x13;_0x83440b[_0x49c4('0xa8')]=_0x49c4('0xfb');_0x83440b['membername']=_0x49c4('0xe3');_0x83440b[_0x49c4('0xee')]+=0x1;_0x83440b[_0x49c4('0xe8')]+=0x1;_0x83440b[_0x49c4('0xe5')]=!![];ami[_0x49c4('0x47')]('custom:amd',ut[_0x49c4('0xe9')](_0x83440b,'amd'));_0x777777['createHistory'](_0x83440b)[_0x49c4('0xad')](loggerCatch(_0x49c4('0xfc')));if(_0x83440b[_0x49c4('0xfd')]+_0x83440b[_0x49c4('0xea')]+_0x83440b[_0x49c4('0xeb')]+_0x83440b['countnosuchnumberretry']+_0x83440b[_0x49c4('0xfe')]+_0x83440b[_0x49c4('0xed')]+_0x83440b[_0x49c4('0xee')]+_0x83440b['countagentrejectretry']>=_0x1480d3[_0x49c4('0xff')]){_0x777777[_0x49c4('0xef')](_0x83440b,_0x40c7ab,_0x372038,'reason19\x20machine....');}else{if(_0x83440b[_0x49c4('0xee')]>=_0x1480d3[_0x49c4('0x100')]){_0x777777[_0x49c4('0xf1')](_0x83440b,_0x40c7ab,_0x372038,_0x49c4('0xf2'));}else{_0x777777[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x83440b[_0x49c4('0xee')],'scheduledat':moment()[_0x49c4('0x101')](_0x1480d3['dialMachineRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x83440b[_0x49c4('0xf6')],'ListId':_0x83440b[_0x49c4('0xce')],'VoiceQueueId':_0x83440b['VoiceQueueId']||undefined,'CampaignId':_0x83440b[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0xf7')));_0x40c7ab({'reschedule':0x1});}}});}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x31')]=function(_0x50423b){var _0x2582e3=this[_0x49c4('0x26')][_0x50423b[_0x49c4('0xd9')]];var _0x254402=this;var _0x44e286;if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]===_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x50423b[_0x49c4('0xd9')]];this[_0x49c4('0xae')](this['campaigns'][_0x2582e3[_0x49c4('0xaf')]]);this[_0x49c4('0xb1')][_0x2582e3[_0x49c4('0xaf')]][_0x49c4('0x103')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);this[_0x49c4('0xd8')](_0x44e286)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x49c4('0xc6')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x104')));}if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]!==_0x49c4('0x92')&&isNotNull(this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0x105')])){delete this[_0x49c4('0x26')][_0x50423b['uniqueid']];this[_0x49c4('0xae')](this['voiceQueues'][_0x2582e3[_0x49c4('0xaf')]]);this[_0x49c4('0x1f')][_0x2582e3[_0x49c4('0xaf')]]['outboundAnswerCallsDay']+=0x1;this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0xe0')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);_0x44e286['state']=0x10;_0x44e286['statedesc']=_0x49c4('0x106');_0x44e286[_0x49c4('0xe2')]=_0x49c4('0x107');this[_0x49c4('0xd8')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x108')));this['moveContactManagedDialer'](_0x44e286)['catch'](loggerCatch(_0x49c4('0x104')));}if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]!==_0x49c4('0x92')&&!isNotNull(this[_0x49c4('0x1f')][_0x2582e3[_0x49c4('0xaf')]][_0x49c4('0x105')])){delete this[_0x49c4('0x26')][_0x50423b['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2582e3['queue']]);this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0x109')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);_0x44e286[_0x49c4('0xa7')]=0xc;_0x44e286[_0x49c4('0xa8')]=_0x50423b['cause-txt'];_0x44e286['membername']=_0x49c4('0x10a');this[_0x49c4('0xd8')](_0x44e286)['catch'](loggerCatch(_0x49c4('0x108')));this[_0x49c4('0xc6')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x104')));}};Dialer[_0x49c4('0x1a')][_0x49c4('0x10b')]=function(_0x582222){var _0x1bded3=this[_0x49c4('0x26')][_0x582222[_0x49c4('0xd9')]];var _0x5730aa=this;if(this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]){if(_0x1bded3&&_0x1bded3[_0x49c4('0x48')]!==_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x582222[_0x49c4('0xd9')]];this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]['outboundAnswerCallsDay']+=0x1;var _0x2fc500=new AgentComplete(_0x1bded3,_0x582222);if(_0x582222[_0x49c4('0x10c')]===_0x49c4('0x10d')){_0x2fc500[_0x49c4('0x10e')]=this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]['dialQueueProject2']&&this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]][_0x49c4('0x10f')]?moment()[_0x49c4('0x79')](_0x49c4('0xf5')):undefined;}this[_0x49c4('0xd8')](_0x2fc500)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x110')));this[_0x49c4('0xc6')](_0x2fc500)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x111')));}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x112')]=function(_0x43bd6e){if(this['voiceQueues'][_0x43bd6e['queue']]){if(this[_0x49c4('0x26')][_0x43bd6e[_0x49c4('0xd9')]]&&this['uniqueId'][_0x43bd6e['uniqueid']][_0x49c4('0x48')]!=='ivr'){this[_0x49c4('0xae')](this[_0x49c4('0x1f')][_0x43bd6e[_0x49c4('0xaf')]]);this[_0x49c4('0x26')][_0x43bd6e[_0x49c4('0xd9')]][_0x49c4('0x113')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));}}};Dialer['prototype'][_0x49c4('0x114')]=function(_0x2542ed){this[_0x49c4('0xd8')](_0x2542ed)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x110')));this['moveContactManagedDialer'](_0x2542ed)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x115')));};Dialer['prototype'][_0x49c4('0x116')]=function(_0x40c42f){var _0x54eacb=this[_0x49c4('0x26')][_0x40c42f[_0x49c4('0xd9')]];var _0x107f65=this;if(this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]]){if(_0x54eacb&&_0x54eacb[_0x49c4('0x48')]!==_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x40c42f['uniqueid']];this[_0x49c4('0xae')](this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]]);_0x54eacb[_0x49c4('0x117')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));var _0x5a28cc=new QueueCallerAbandon(_0x54eacb,_0x40c42f);if(getSeconds(_0x54eacb[_0x49c4('0x117')],_0x54eacb[_0x49c4('0x118')])>=_0x54eacb[_0x49c4('0x119')]){this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x6a')]+=0x1;this['voiceQueues'][_0x40c42f['queue']][_0x49c4('0x11a')]+=0x1;this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x6c')]+=0x1;_0x5a28cc[_0x49c4('0xa7')]=0xa;_0x5a28cc[_0x49c4('0xa8')]=_0x49c4('0x11b');_0x5a28cc[_0x49c4('0x11c')]=_0x49c4('0x11d');_0x5a28cc[_0x49c4('0x10e')]=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]]['dialQueueProject2']?moment()[_0x49c4('0x79')](_0x49c4('0xf5')):undefined;_0x5a28cc['countdropretry']+=0x1;_0x5a28cc[_0x49c4('0xe8')]+=0x1;if(_0x5a28cc['countdropretry']>=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]]['dialDropMaxRetry']){this[_0x49c4('0x114')](_0x5a28cc);}else{this[_0x49c4('0xf3')]({'active':![],'countdropretry':_0x5a28cc[_0x49c4('0xfe')],'scheduledat':moment()[_0x49c4('0x101')](this[_0x49c4('0x1f')][_0x40c42f['queue']][_0x49c4('0x11e')],'minutes')[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x54eacb[_0x49c4('0xf6')],'ListId':_0x54eacb['ListId'],'VoiceQueueId':_0x54eacb[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54eacb[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][Drop]'));var _0x4427ba=new History(_0x5a28cc);_0x4427ba[_0x49c4('0xa7')]=0xa;_0x4427ba[_0x49c4('0xa8')]=_0x49c4('0x11b');_0x4427ba[_0x49c4('0x11f')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));_0x4427ba['endtime']=_0x4427ba['starttime'];_0x4427ba['calleridname']=_0x5a28cc[_0x49c4('0x120')];_0x4427ba[_0x49c4('0x121')]=_0x5a28cc[_0x49c4('0x121')];this[_0x49c4('0xd8')](_0x4427ba)['catch'](loggerCatch(_0x49c4('0x122')));}}else{this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x69')]+=0x1;this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x61')]+=0x1;_0x5a28cc[_0x49c4('0xa7')]=0xb;_0x5a28cc[_0x49c4('0xa8')]=_0x49c4('0x123');_0x5a28cc[_0x49c4('0x11c')]='CALLEREXIT';_0x5a28cc[_0x49c4('0xed')]+=0x1;_0x5a28cc['countglobal']+=0x1;if(_0x5a28cc[_0x49c4('0xed')]>=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x124')]){this['queueCallerAbandonCreateState'](_0x5a28cc);}else{this[_0x49c4('0xf3')]({'active':![],'countabandonedretry':_0x5a28cc['countabandonedretry'],'scheduledat':moment()['add'](this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x125')],_0x49c4('0x102'))['format'](_0x49c4('0xf5')),'ContactId':_0x54eacb['ContactId'],'ListId':_0x54eacb[_0x49c4('0xce')],'VoiceQueueId':_0x54eacb[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54eacb[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x126')));var _0x4427ba=new History(_0x5a28cc);_0x4427ba[_0x49c4('0xa7')]=0xb;_0x4427ba[_0x49c4('0xa8')]=_0x49c4('0x123');_0x4427ba['starttime']=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));_0x4427ba[_0x49c4('0xa9')]=_0x4427ba[_0x49c4('0x11f')];_0x4427ba['calleridname']=_0x5a28cc['calleridname'];_0x4427ba[_0x49c4('0x121')]=_0x5a28cc[_0x49c4('0x121')];this['createHistory'](_0x4427ba)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x127')));}}}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x128')]=function(_0x512d87){if(this[_0x49c4('0x24')][_0x512d87[_0x49c4('0xd9')]]){this['actions'][_0x512d87['uniqueid']][_0x49c4('0x129')]=_0x512d87[_0x49c4('0x129')];}if(this[_0x49c4('0x26')][_0x512d87[_0x49c4('0xd9')]]){this[_0x49c4('0x26')][_0x512d87['uniqueid']][_0x49c4('0x129')]=_0x512d87['channel'];}};Dialer[_0x49c4('0x1a')][_0x49c4('0x34')]=function(_0x3c6044){if(strategy[this[_0x49c4('0x1f')][this['actions'][_0x3c6044['actionid']]['queue']][_0x49c4('0x4a')]]===_0x49c4('0x19')){if(this[_0x49c4('0x24')][_0x3c6044[_0x49c4('0x12a')]]&&_['isNil'](this['actions'][_0x3c6044[_0x49c4('0x12a')]]['locked'])&&_0x3c6044[_0x49c4('0x12b')]==='1'&&_0x3c6044[_0x49c4('0x12c')]==='0'){if(this['agents'][_0x3c6044[_0x49c4('0x12d')]]){if(!this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]]['locked']){this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]][_0x49c4('0x12e')]=!![];this['actions'][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0x12e')]=!![];this['actions'][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0x12d')]=_0x3c6044['stateinterface'];}}}}else if((strategy[this[_0x49c4('0x1f')][this[_0x49c4('0x24')][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x4a')]]||'rrmemory')===_0x49c4('0x18')){if(this[_0x49c4('0x24')][_0x3c6044['actionid']]){if(this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]]){this[_0x49c4('0x24')][_0x3c6044['actionid']][_0x49c4('0x12d')]=_0x3c6044['stateinterface'];if(_[_0x49c4('0xab')](this[_0x49c4('0x2b')][this['actions'][_0x3c6044[_0x49c4('0x12a')]]['queue']])){this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x3c6044['actionid']][_0x49c4('0xaf')]]=[];}this[_0x49c4('0x2b')][this['actions'][_0x3c6044['actionid']][_0x49c4('0xaf')]][_0x49c4('0x12f')](_[_0x49c4('0x8b')](_[_0x49c4('0x130')](this[_0x49c4('0x24')][_0x3c6044['actionid']],[_0x49c4('0x131'),_0x49c4('0x12d')]),{'status':_0x3c6044[_0x49c4('0x12b')],'paused':_0x3c6044[_0x49c4('0x12c')]}));}}}};function unlockQueueStatus(_0x28899f,_0x4ff046){setTimeout(function(){if(_[_0x49c4('0x39')](_0x28899f[_0x49c4('0x132')])){loggerBooked[_0x49c4('0x96')](_0x49c4('0x133'),_0x4ff046);}_0x28899f[_0x49c4('0x132')]=!![];loggerBooked[_0x49c4('0x7b')](_0x49c4('0x134'),_0x4ff046,JSON[_0x49c4('0x135')](_['pick'](_0x28899f,[_0x49c4('0x3d'),_0x49c4('0x132')])));},0x1f3);}Dialer[_0x49c4('0x1a')]['syncQueueStatusComplete']=function(_0x5db4e4){var _0xe90f3c=this;var _0x4f93e0=_0xe90f3c[_0x49c4('0x1f')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]];if(strategy[this['voiceQueues'][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x4a')]]==='roundrobin'){if(this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]]&&this['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x12d')]){this[_0x49c4('0x91')][_0x49c4('0x136')](this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x131')],this[_0x49c4('0x24')][_0x5db4e4['actionid']]['stateinterface'])['catch'](function(_0x128027){logger[_0x49c4('0x96')](_0x49c4('0x137'),util[_0x49c4('0x97')](_0x128027,{'showHidden':![],'depth':null}));})[_0x49c4('0x1d')](function(){_0xe90f3c['updateOriginated'](_0xe90f3c[_0x49c4('0x1f')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]);_0xe90f3c['agents'][_0xe90f3c['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x12d')]][_0x49c4('0x12e')]=![];delete _0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]];unlockQueueStatus(_0x4f93e0);});}else{this[_0x49c4('0xae')](this['voiceQueues'][this['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]);this[_0x49c4('0xf3')]({'active':![],'ContactId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]]['ContactId'],'ListId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xce')],'VoiceQueueId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xd0')]||undefined,'CampaignId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x138')));delete this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]];unlockQueueStatus(_0x4f93e0);}}else if((strategy[this[_0x49c4('0x1f')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]][_0x49c4('0x4a')]]||'rrmemory')===_0x49c4('0x18')){var _0x586857;if(this[_0x49c4('0x24')][_0x5db4e4['actionid']]&&!_[_0x49c4('0x41')](this[_0x49c4('0x2b')][this['actions'][_0x5db4e4[_0x49c4('0x12a')]]['queue']])){if(this[_0x49c4('0x139')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]){this[_0x49c4('0x139')][_0xe90f3c['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]=this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]?this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]]:this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]?this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x13a')]||0x0:0x0;}this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]]['_rr']=this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]];for(var _0x14ba43=0x0;_0x14ba43=0x0;})['catch'](myreject(_0x780a93)));}}else{_0x3483c9[_0x49c4('0x12f')](ami[_0x49c4('0xac')]({'action':_0x49c4('0x14d'),'command':util[_0x49c4('0x79')]('iftime\x20%s,%s',_0x2f5ad1,!_[_0x49c4('0x39')](config[_0x49c4('0x14a')][_0x44d293])?_0x44d293:'')})['then'](function(_0x5af4e6){return _0x5af4e6[_0x49c4('0x14f')]['indexOf'](_0x49c4('0x151'))>=0x0;})[_0x49c4('0xad')](myreject(_0x780a93)));}BPromise['all'](_0x3483c9)['then'](function(_0x458d07){var _0x49f732=_['some'](_0x458d07);if(_0x49f732){return _0x4726e3(_0x49f732);}else{_0x2705d3[_0x49c4('0x3a')]=_0x44e7ca?'GLOBAL_INTERVAL_IS_OVERTIME':_0x49c4('0x152');return _0x780a93(msgResponse(_0x49c4('0x153'),_0x49c4('0x149'),_0x49c4('0x154')+_0x44e7ca+'\x20'+_0x474488+_0x49c4('0x155')+util[_0x49c4('0x97')](_0x2f5ad1,{'showHidden':![],'depth':null})+_0x49c4('0x156')+_0x44d293));}})[_0x49c4('0xad')](function(_0x57a85f){return _0x780a93(msgResponse(_0x49c4('0x146'),'Failure',JSON['stringify'](_0x57a85f)));});});};Dialer[_0x49c4('0x1a')][_0x49c4('0x157')]=function(_0x456307){var _0xfcf36d=this;return function(){switch(_0x456307[_0x49c4('0x58')]){case'progressive':freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,0x1);break;case _0x49c4('0x159'):freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,_0x456307['dialPowerLevel']);break;case _0x49c4('0x9'):_0xfcf36d[_0x49c4('0x9')](_0x456307);break;case _0x49c4('0x7'):freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,0x1);break;default:freeVariablesPredictive(_0x456307);logger['error'](_0x49c4('0x15a'),_0x456307[_0x49c4('0x3d')],_0x49c4('0x15b'));}};};Dialer[_0x49c4('0x1a')][_0x49c4('0x15c')]=function(_0x26e2c2){var _0x1f76e6=this;return function(){_0x1f76e6[_0x49c4('0x15d')](_0x26e2c2);};};Dialer[_0x49c4('0x1a')]['syncQueueSummary']=function(_0x44a7e1){var _0x2c4ae5=this;if(isNotPreview(_0x44a7e1[_0x49c4('0x58')])){if(isVoiceQueueOutbound(_0x44a7e1[_0x49c4('0x48')])&&isActive(_0x44a7e1[_0x49c4('0x57')])){_0x44a7e1[_0x49c4('0xa6')]=!![];BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](checkIsLoggedIn(_0x44a7e1,_0x44a7e1['loggedIn']))[_0x49c4('0xb4')](checkIsActive(_0x44a7e1,_0x44a7e1[_0x49c4('0x57')]))[_0x49c4('0xb4')](checkInterval(_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5[_0x49c4('0x15e')](_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5[_0x49c4('0x145')](_0x44a7e1[_0x49c4('0x15f')],_0x44a7e1['dialTimezone'],_0x44a7e1[_0x49c4('0x3d')],_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5['checkIfTimeIntervals'](_0x44a7e1[_0x49c4('0x3e')],_0x44a7e1[_0x49c4('0x160')],_0x44a7e1[_0x49c4('0x3d')],_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5['checkDialMethod'](_0x44a7e1))[_0x49c4('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x44a7e1));}else{notSendMessagesQueue(_0x44a7e1);}}else{freeVariablesPredictive(_0x44a7e1);}};Dialer[_0x49c4('0x1a')]['syncCampaigns']=function(){var _0xc1f0eb=this;var _0x12f947;for(var _0x467370 in this[_0x49c4('0xb1')]){if(typeof this[_0x49c4('0xb1')][_0x467370]!==_0x49c4('0x9a')){_0x12f947=this[_0x49c4('0xb1')][_0x467370];if(isCampaignIvr(_0x12f947[_0x49c4('0x48')])&&isActive(_0x12f947[_0x49c4('0x75')])){_0x12f947[_0x49c4('0xa6')]=!![];BPromise[_0x49c4('0xb3')]()['then'](checkIsActive(_0x12f947,_0x12f947[_0x49c4('0x75')]))['then'](checkInterval(_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x15e')](_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x145')](_0x12f947[_0x49c4('0x15f')],_0x12f947[_0x49c4('0x160')],_0x12f947[_0x49c4('0x3d')],_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x147')](_0x12f947[_0x49c4('0x3e')],_0x12f947[_0x49c4('0x160')],_0x12f947[_0x49c4('0x3d')],_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x15c')](_0x12f947))[_0x49c4('0xad')](loggerCatchQueueSummary('[syncCampaigns]',_0x12f947));}else{notSendMessagesCampaign(_0x12f947);}}}};function getCallerIdRandom(_0xa5a9a1,_0x5c0f35){var _0x59583d;var _0x56004c;var _0x2764ea;if(_0x5c0f35<=0x0){_0x5c0f35=0x1;}_0x59583d=new RegExp(_0x49c4('0x161')+_0x5c0f35+'}$');_0x56004c=Math[_0x49c4('0x162')](0xa,_0x5c0f35-0x1);_0x2764ea=Math[_0x49c4('0x162')](0xa,_0x5c0f35)-0x1;return util[_0x49c4('0x79')]('%s',_['replace'](_0xa5a9a1,_0x59583d,_['random'](_0x56004c,_0x2764ea)));}function extractCalleridName(_0x1455ef){var _0xd0faf2=_0x1455ef['match'](/"(.*?)"/);return _0xd0faf2?_0xd0faf2[0x1]:_0x1455ef;}function extractCalleridNumber(_0x17e278){var _0xf0c5c4=_0x17e278[_0x49c4('0x163')](/<(.*?)>/);return _0xf0c5c4?_0xf0c5c4[0x1]:_0x17e278;}Dialer[_0x49c4('0x1a')][_0x49c4('0x164')]=function(_0x29ed3c,_0x41070f){var _0x341ec1=this;var _0x3247e4=uuid['v4']();this[_0x49c4('0x24')][_0x3247e4]=new Action(_0x29ed3c,_0x41070f,_0x3247e4);return new BPromise(function(_0x35e162,_0x4ef607){if(_[_0x49c4('0x39')](_0x29ed3c)&&typeof _0x29ed3c!==_0x49c4('0x165')){return _0x4ef607(msgResponse('originate',_0x49c4('0x149'),_0x49c4('0x166')));}if(_[_0x49c4('0x39')](_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')])||_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]===null){return _0x4ef607(msgResponse(_0x49c4('0x169'),_0x49c4('0x149'),_0x49c4('0x16a')));}var _0x3fd525={'XMD-CALLERID':_0x341ec1[_0x49c4('0x24')][_0x3247e4][_0x49c4('0x16b')](),'XMD-AGI':_0x29ed3c[_0x49c4('0x105')]?util[_0x49c4('0x79')](_0x49c4('0x16c'),ipAgi,_0x29ed3c['dialQueueProject']):_0x49c4('0x16d'),'XMD-AGIAFTER':_0x29ed3c['dialQueueProject2']?util[_0x49c4('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x29ed3c[_0x49c4('0x16e')]):_0x49c4('0x16d'),'XMD-QUEUE':_0x29ed3c['type']==='outbound'?util[_0x49c4('0x79')](_0x49c4('0x16f'),_0x29ed3c['name'],_0x29ed3c[_0x49c4('0x170')]||'',_0x29ed3c[_0x49c4('0x10f')]?'c':'',_0x29ed3c[_0x49c4('0x119')]||0x3):'NONE','XMD-CONTACTID':_0x41070f[_0x49c4('0xf6')],'XMD-CDRTYPE':_0x49c4('0x6'),'CALLERID(all)':_0x341ec1[_0x49c4('0x24')][_0x3247e4]['getCaller'](),'XMD-AMD':_0x29ed3c[_0x49c4('0xe7')]?'ACTIVE':_0x49c4('0x16d'),'XMD-DESTINATION':_0x49c4('0xdd')};if(_0x29ed3c[_0x49c4('0xe7')]){_0x3fd525[_0x49c4('0x171')]=_0x29ed3c[_0x49c4('0x172')]||0x9c4;_0x3fd525[_0x49c4('0x173')]=_0x29ed3c[_0x49c4('0x174')]||0x5dc;_0x3fd525[_0x49c4('0x175')]=_0x29ed3c[_0x49c4('0x176')]||0x320;_0x3fd525[_0x49c4('0x177')]=_0x29ed3c['dialAMDTotalAnalysisTime']||0x1388;_0x3fd525['XMD-AMDMINWORDLENGTH']=_0x29ed3c[_0x49c4('0x178')]||0x64;_0x3fd525[_0x49c4('0x179')]=_0x29ed3c[_0x49c4('0x17a')]||0x32;_0x3fd525[_0x49c4('0x17b')]=_0x29ed3c[_0x49c4('0x17c')]||0x3;_0x3fd525[_0x49c4('0x17d')]=_0x29ed3c['dialAMDSilenceThreshold']||0x100;_0x3fd525[_0x49c4('0x17e')]=_0x29ed3c['dialAMDMaximumWordLength']||0x1388;}if(_0x29ed3c[_0x49c4('0x48')]===_0x49c4('0x49')){_0x3fd525[_0x49c4('0x17f')]=_0x41070f[_0x49c4('0xd0')];}else{_0x3fd525['XMD-CAMPAIGNID']=_0x41070f[_0x49c4('0xd1')];}for(var _0x3d1237 in _0x41070f['Contact']){if(typeof _0x41070f[_0x49c4('0x167')][_0x3d1237]!==_0x49c4('0x9a')){if(isNotNull(_0x41070f['Contact'][_0x3d1237])&&_0x3d1237!=='id'&&_0x3d1237!=='tags'&&_0x3d1237!=='createdAt'&&_0x3d1237!==_0x49c4('0x180')){_0x3fd525[util[_0x49c4('0x79')](_0x49c4('0x181'),_0x49c4('0x182'),_['toUpper'](_0x3d1237))]=_0x41070f[_0x49c4('0x167')][_0x3d1237];}}}var _0x5e7232=_0x341ec1[_0x49c4('0xd4')](_0x29ed3c[_0x49c4('0x74')])?getCallerId(_0x29ed3c[_0x49c4('0x74')][_0x49c4('0x76')],_0x29ed3c[_0x49c4('0x59')],_0x29ed3c[_0x49c4('0x183')]>0x0?getCallerIdRandom(_0x29ed3c['dialOriginateCallerIdNumber'],_0x29ed3c['dialRandomLastDigitCallerIdNumber']):_0x29ed3c[_0x49c4('0x5a')]):getCallerId(_[_0x49c4('0xab')](_0x29ed3c['TrunkBackup'])?_0x29ed3c['Trunk'][_0x49c4('0x76')]:_0x29ed3c[_0x49c4('0x184')][_0x49c4('0x76')],_0x29ed3c[_0x49c4('0x59')],_0x29ed3c[_0x49c4('0x183')]>0x0?getCallerIdRandom(_0x29ed3c[_0x49c4('0x5a')],_0x29ed3c['dialRandomLastDigitCallerIdNumber']):_0x29ed3c[_0x49c4('0x5a')]);if(_0x5e7232){_0x3fd525[_0x49c4('0x185')]=_0x341ec1['actions'][_0x3247e4][_0x49c4('0x186')]=extractCalleridName(_0x5e7232);_0x3fd525[_0x49c4('0x187')]=_0x341ec1['actions'][_0x3247e4][_0x49c4('0x188')]=extractCalleridNumber(_0x5e7232);}return ami[_0x49c4('0xac')]({'actionid':_0x3247e4,'action':'originate','channel':_0x341ec1[_0x49c4('0xd4')](_0x29ed3c[_0x49c4('0x74')])?util['format'](_0x49c4('0x189'),_0x29ed3c[_0x49c4('0x74')]['name'],isNotNull(_0x29ed3c[_0x49c4('0x5b')])?_0x29ed3c[_0x49c4('0x5b')][_0x49c4('0x18a')]()||'':'',_0x29ed3c[_0x49c4('0x18b')]>0x0?_0x41070f['Contact'][_0x49c4('0x168')][_0x49c4('0x18c')](_0x29ed3c[_0x49c4('0x18b')]):_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]):util['format']('SIP/%s/%s%s',_['isNil'](_0x29ed3c[_0x49c4('0x184')])?_0x29ed3c[_0x49c4('0x74')][_0x49c4('0x3d')]:_0x29ed3c[_0x49c4('0x184')][_0x49c4('0x3d')],isNotNull(_0x29ed3c[_0x49c4('0x5b')])?_0x29ed3c[_0x49c4('0x5b')][_0x49c4('0x18a')]()||'':'',_0x29ed3c[_0x49c4('0x18b')]>0x0?_0x41070f[_0x49c4('0x167')]['phone'][_0x49c4('0x18c')](_0x29ed3c[_0x49c4('0x18b')]):_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]),'callerid':_0x5e7232,'Exten':_0x49c4('0xdd'),'Context':_0x49c4('0x18d'),'Priority':'1','variable':_0x3fd525,'timeout':(_0x29ed3c[_0x49c4('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3247e4})[_0x49c4('0xb4')](function(_0x232304){return _0x35e162(_0x232304);})[_0x49c4('0xad')](function(_0x345381){_0x29ed3c['outboundOriginateFailureCallsDay']+=0x1;var _0x42aff6=new History(_0x341ec1[_0x49c4('0x24')][_0x3247e4]);logger['error'](util['format'](_0x49c4('0x18f'),JSON[_0x49c4('0x135')](_0x345381)));_0x42aff6[_0x49c4('0xa7')]=0xe;_0x42aff6[_0x49c4('0xa8')]='OriginateError';_0x42aff6[_0x49c4('0x11f')]=moment()['format'](_0x49c4('0xf5'));_0x42aff6[_0x49c4('0xa9')]=_0x42aff6[_0x49c4('0x11f')];_0x341ec1[_0x49c4('0xd8')](_0x42aff6)[_0x49c4('0xad')](loggerCatch('[originate][error]'));_0x341ec1['moveContactManagedDialer'](_0x42aff6)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x190')))['finally'](function(){delete _0x341ec1['actions'][_0x3247e4];return _0x4ef607(msgResponse('originate',_0x49c4('0x44'),_0x49c4('0x191')));});});});};Dialer[_0x49c4('0x1a')]['syncOriginateResponse']=function(_0xb273b4){var _0x2ee4ff=this[_0x49c4('0x24')][_0xb273b4[_0x49c4('0x12a')]];if(_0x2ee4ff){delete this[_0x49c4('0x24')][_0xb273b4['actionid']];_0x2ee4ff[_0x49c4('0x118')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));var _0x4b0742=_0x2ee4ff[_0x49c4('0x48')]===_0x49c4('0x92')?this[_0x49c4('0xb1')][_0x2ee4ff[_0x49c4('0xaf')]]:this['voiceQueues'][_0x2ee4ff[_0x49c4('0x192')]()];if(!this[_0x49c4('0xd3')](_0xb273b4[_0x49c4('0x193')])){this['updateOriginated'](_0x4b0742);return this[_0x49c4('0x194')](_0x2ee4ff,_0x4b0742,_0xb273b4)['catch'](loggerCatch(_0x49c4('0x195')));}this['uniqueId'][_0xb273b4[_0x49c4('0xd9')]]=_0x2ee4ff;}};Dialer[_0x49c4('0x1a')][_0x49c4('0x196')]=function(_0x5a7eed,_0x21d59c,_0x5cd015){var _0x50ac60=new History(_0x21d59c);if(_0x50ac60['countbusyretry']+_0x50ac60[_0x49c4('0xea')]+_0x50ac60[_0x49c4('0xeb')]+_0x50ac60['countnosuchnumberretry']+_0x50ac60[_0x49c4('0xfe')]+_0x50ac60[_0x49c4('0xed')]+_0x50ac60['countmachineretry']+_0x50ac60[_0x49c4('0x197')]>=_0x5cd015[_0x49c4('0xff')]-0x1){return!![];}switch(_0x5a7eed){case 0x3:if(_0x50ac60[_0x49c4('0xeb')]>=_0x5cd015[_0x49c4('0x198')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countnoanswerretry':_0x50ac60[_0x49c4('0xeb')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x199')],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x50ac60[_0x49c4('0xfd')]>=_0x5cd015[_0x49c4('0x19a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x50ac60[_0x49c4('0xfd')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x19b')],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60['ListId'],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x19c')));break;case 0x8:if(_0x50ac60[_0x49c4('0xea')]>=_0x5cd015[_0x49c4('0x19d')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countcongestionretry':_0x50ac60[_0x49c4('0xea')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialCongestionRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x19e')));break;case 0x0:if(_0x50ac60['countnosuchnumberretry']>=_0x5cd015[_0x49c4('0x19f')]-0x1){return!![];}else{this[_0x49c4('0xf3')]({'active':![],'countnosuchnumberretry':_0x50ac60[_0x49c4('0xec')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x1a0')],_0x49c4('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x50ac60['countdropretry']>=_0x5cd015[_0x49c4('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x50ac60[_0x49c4('0xfe')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialDropRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x1a2')));break;case 0xb:if(_0x50ac60[_0x49c4('0xed')]>=_0x5cd015[_0x49c4('0x124')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countabandonedretry':_0x50ac60[_0x49c4('0xed')]+=0x1,'scheduledat':moment()['add'](_0x5cd015[_0x49c4('0x125')],_0x49c4('0x102'))[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x126')));break;case 0x13:if(_0x50ac60['countmachineretry']>=_0x5cd015[_0x49c4('0x100')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x50ac60[_0x49c4('0xee')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialMachineRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x50ac60[_0x49c4('0x197')]>=_0x5cd015[_0x49c4('0x1a3')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countagentrejectretry':_0x50ac60['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x1a4')],'minutes')[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1a5')));break;default:return!![];}};Dialer[_0x49c4('0x1a')][_0x49c4('0x194')]=function(_0x198a69,_0x556d0a,_0x491626){var _0x34c7ab=this;var _0x54d6e5=new History(_0x198a69);return new BPromise(function(_0x2343a8,_0x16c6f5){if(_[_0x49c4('0x39')](_0x556d0a)&&typeof _0x556d0a!==_0x49c4('0x165')){return _0x16c6f5(msgResponse('[callProgressDetecting]',_0x49c4('0x149'),_0x49c4('0x1a6')));}if(_[_0x49c4('0x39')](_0x491626)&&typeof _0x491626!==_0x49c4('0x165')){return _0x16c6f5(msgResponse(_0x49c4('0x1a7'),_0x49c4('0x149'),_0x49c4('0x1a8')));}switch(_0x491626['reason']){case'0':_0x556d0a['outboundNoSuchCallsDay']+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x0;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1a9');_0x54d6e5[_0x49c4('0xec')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1aa'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1ab')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch(_0x49c4('0xfc')));if(_0x34c7ab[_0x49c4('0x196')](0x0,_0x198a69,_0x556d0a)){if(_0x54d6e5['countnosuchnumberretry']>=_0x556d0a[_0x49c4('0x19f')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ac'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ac'));}}break;case'3':_0x556d0a[_0x49c4('0x1ad')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x3;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1ae');_0x54d6e5[_0x49c4('0xeb')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1af'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1b0')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1b1')));if(_0x34c7ab[_0x49c4('0x196')](0x3,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xeb')]>=_0x556d0a[_0x49c4('0x198')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b2'));}else{_0x34c7ab['stateGlobal'](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x556d0a[_0x49c4('0x5e')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x5;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1b3');_0x54d6e5[_0x49c4('0xfd')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1b4'),ut['buildObj'](_0x198a69,'busy'));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1b5')));if(_0x34c7ab[_0x49c4('0x196')](0x5,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xfd')]>=_0x556d0a[_0x49c4('0x19a')]){_0x34c7ab['createStateFinal'](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b6'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b6'));}}break;case'8':_0x556d0a['outboundCongestionCallsDay']+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x8;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1b7');_0x54d6e5[_0x49c4('0xea')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')]('custom:agentcongestion',ut[_0x49c4('0xe9')](_0x198a69,'congestion'));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x34c7ab['checkRetriveMax'](0x8,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xea')]>=_0x556d0a['dialCongestionMaxRetry']){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b8'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b8'));}}break;case'11':_0x556d0a[_0x49c4('0x1b9')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0xb;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x123');_0x54d6e5[_0x49c4('0xed')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x127')));if(_0x34c7ab[_0x49c4('0x196')](0xb,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xed')]>=_0x556d0a['dialAbandonedMaxRetry']){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ba'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2011\x20abandoned');}}break;case'20':_0x556d0a['outboundRejectCallsDay']+=0x1;_0x54d6e5['state']=0x14;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1bb');_0x54d6e5[_0x49c4('0x197')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami['emit'](_0x49c4('0x1bc'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1bd')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1be')));if(_0x34c7ab[_0x49c4('0x196')](0x14,_0x198a69,_0x556d0a)){if(_0x54d6e5['countagentrejectretry']>=_0x556d0a[_0x49c4('0x1a3')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2020\x20agentreject');}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2020\x20agentreject');}}break;default:_0x556d0a[_0x49c4('0x109')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0xc;_0x54d6e5[_0x49c4('0xa8')]=_0x491626[_0x49c4('0x10c')];_0x34c7ab['createHistory'](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1bf')));if(_0x34c7ab['checkRetriveMax'](_0x491626['reason'],_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xfd')]+_0x54d6e5[_0x49c4('0xea')]+_0x54d6e5[_0x49c4('0xeb')]+_0x54d6e5[_0x49c4('0xec')]+_0x54d6e5[_0x49c4('0xfe')]+_0x54d6e5['countabandonedretry']+_0x54d6e5['countmachineretry']+_0x54d6e5[_0x49c4('0x197')]>=_0x556d0a[_0x49c4('0xff')]){_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x491626['reason']);}else{_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x491626[_0x49c4('0x10c')]);}}}});};Dialer['prototype'][_0x49c4('0xef')]=function(_0x10e94b,_0x49ab6a,_0x29c532,_0x39a125){var _0x2a059f=new Final(_0x10e94b);_0x2a059f['state']=0xf;_0x2a059f[_0x49c4('0xa8')]='Global';this[_0x49c4('0xf1')](_0x2a059f,_0x49ab6a,_0x29c532,_0x39a125);};Dialer[_0x49c4('0x1a')]['createStateFinal']=function(_0x26581d,_0xba82e4,_0x38a1d2,_0x3bf117){this['moveContactManagedDialer'](_0x26581d)[_0x49c4('0xb4')](function(){return _0xba82e4(msgResponse('[callProgressDetecting]',_0x49c4('0x1c0'),_0x3bf117));})[_0x49c4('0xad')](function(){return _0x38a1d2(msgResponse(_0x49c4('0x1c1'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x49c4('0x1a')][_0x49c4('0x9')]=function(_0x4788b1){var _0x2fa4fb=_0x4788b1[_0x49c4('0x1c2')]/0x64;var _0x1043d2=_0x4788b1[_0x49c4('0x11a')]/(_0x4788b1['outboundDropCallsDayTimeout']+_0x4788b1['outboundAnswerCallsDay']);var _0x58274f=Math[_0x49c4('0x1c3')](_0x4788b1[_0x49c4('0x6f')]*(_0x4788b1[_0x49c4('0x1c4')]/0x64));var _0x23623d=Math[_0x49c4('0x1c3')](_0x4788b1[_0x49c4('0x6f')]*(_0x4788b1[_0x49c4('0x1c5')]/0x64));var _0x107bcb=_0x4788b1[_0x49c4('0x4c')]+_0x4788b1[_0x49c4('0x51')];var _0x44ee3f=Math[_0x49c4('0x1c6')](_0x4788b1[_0x49c4('0x71')]*_0x4788b1[_0x49c4('0x73')]*_0x4788b1[_0x49c4('0x6d')]*_0x4788b1[_0x49c4('0x6e')]);if(_[_0x49c4('0x39')](_0x4788b1['startProgressive'])){if(!_['isUndefined'](_0x4788b1[_0x49c4('0x28')])){_0x4788b1[_0x49c4('0x28')]=undefined;loggerPredictive['error'](_0x49c4('0x1c7'),_0x49c4('0x1c8'));}if(!_[_0x49c4('0x39')](_0x4788b1[_0x49c4('0x8f')])){loggerPredictive[_0x49c4('0x96')](_0x49c4('0x1c7'),_0x49c4('0x1c9'));clearInterval(_0x4788b1[_0x49c4('0x8f')]);_0x4788b1['handlePredictive']=undefined;}_0x4788b1[_0x49c4('0x29')]=moment()[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x49c4('0x7b')](_0x4788b1['name'],_0x49c4('0x1ca'),_0x4788b1[_0x49c4('0x29')]);this[_0x49c4('0x158')](_0x4788b1,0x1);}else if(ifInterval(_0x4788b1[_0x49c4('0x1cb')],_0x4788b1[_0x49c4('0x29')])){this[_0x49c4('0x158')](_0x4788b1,0x1);loggerPredictiveCalls['info'](_0x49c4('0x1cc'),_0x4788b1[_0x49c4('0x29')],_0x4788b1['name']);_0x4788b1['erlangCalls']=0x0;_0x4788b1[_0x49c4('0x6c')]=0x0;}else if(_0x2fa4fb<_0x1043d2&&_0x4788b1[_0x49c4('0x1cd')]===_0x49c4('0x1ce')){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x1cf'),_0x49c4('0x1d0'),_0x1043d2,'startProgressive',_0x4788b1[_0x49c4('0x3d')]);}else if(_0x44ee3f<_0x4788b1[_0x49c4('0x6c')]&&_0x4788b1['dialPredictiveOptimization']===_0x49c4('0x1ce')){freeVariablesPredictive(_0x4788b1);loggerPredictive['info'](_0x49c4('0x1d1'),_0x49c4('0x1d2'),_0x44ee3f,_0x49c4('0x1d3'),_0x4788b1['predictiveIntervalErlangCallsDroppedCalls'],_0x49c4('0x29'),_0x4788b1[_0x49c4('0x3d')]);}else if(!ifInterval(_0x4788b1[_0x49c4('0x1cb')],_0x4788b1[_0x49c4('0x29')])&&_[_0x49c4('0x39')](_0x4788b1[_0x49c4('0x28')])&&!_[_0x49c4('0x39')](_0x4788b1['startProgressive'])){_0x4788b1[_0x49c4('0x28')]=moment()['format'](_0x49c4('0xf5'));loggerPredictive[_0x49c4('0x7b')](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d4'),_0x4788b1[_0x49c4('0x28')]);this[_0x49c4('0xbb')](_0x4788b1['dialPredictiveInterval'])[_0x49c4('0xb4')](this['getDataPredictive'](_0x4788b1))[_0x49c4('0xb4')](mergeDataErlangB(_0x4788b1))[_0x49c4('0xb4')](this[_0x49c4('0x1d5')](_0x4788b1))['catch'](loggerCatchPredictive(_0x49c4('0x1d6'),_0x4788b1));}else if(!ifInterval(_0x4788b1['dialPredictiveInterval'],_0x4788b1[_0x49c4('0x28')])){_0x4788b1[_0x49c4('0x6c')]=0x0;_0x4788b1['startPredictive']=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));loggerPredictive['info'](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d7'),_0x4788b1[_0x49c4('0x28')]);clearInterval(_0x4788b1[_0x49c4('0x8f')]);_0x4788b1[_0x49c4('0x8f')]=undefined;this[_0x49c4('0xbb')](_0x4788b1[_0x49c4('0x1cb')])['then'](this[_0x49c4('0x1d8')](_0x4788b1))[_0x49c4('0xb4')](mergeDataErlangB(_0x4788b1))['then'](this['startMethodPredictive'](_0x4788b1))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4788b1));}else if(_0x4788b1[_0x49c4('0x6f')]&&_0x107bcb<_0x4788b1[_0x49c4('0x6f')]-_0x23623d){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d9'),_0x107bcb,')\x20are\x20less\x20than\x20threshold\x20(',_0x4788b1[_0x49c4('0x6f')],'-',_0x23623d,'=',_0x4788b1['predictiveIntervalAvailable']-_0x23623d,')');}else if(_0x4788b1[_0x49c4('0x6f')]&&_0x107bcb>_0x4788b1[_0x49c4('0x6f')]+_0x58274f){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x4788b1['name'],_0x49c4('0x1d9'),_0x107bcb,_0x49c4('0x1da'),_0x4788b1[_0x49c4('0x6f')],'+',_0x58274f,'=',_0x4788b1[_0x49c4('0x6f')]+_0x58274f,')');}};Dialer[_0x49c4('0x1a')][_0x49c4('0x1d8')]=function(_0x213fe8){var _0x2272b1=this;return function(_0x5a84dc){return new BPromise(function(_0x215003,_0x37e415){_['merge'](_0x213fe8,_0x5a84dc[0x0]);if(checkGetDataPredictive(_0x5a84dc[0x0])){var _0x1dc0dc=_0x213fe8['predictiveIntervalAvailable']=_0x213fe8['talking']+_0x213fe8[_0x49c4('0x4c')];var _0x1b669a=_0x213fe8['dialPredictiveInterval']*0x3c;var _0xaab952=_0x5a84dc[0x0][_0x49c4('0x68')]+_0x5a84dc[0x0][_0x49c4('0x67')];var _0x3e6dad=(_0x5a84dc[0x0][_0x49c4('0x66')]+_0x5a84dc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5a84dc[0x0][_0x49c4('0x69')])/_0x5a84dc[0x0][_0x49c4('0x7d')];_0x213fe8[_0x49c4('0x6d')]=_0x3e6dad>0x0?_0x3e6dad:0x1;switch(_0x213fe8['dialPredictiveOptimization']){case'dropRate':var _0x507d23=_0x213fe8[_0x49c4('0x1c2')]/0x64;return _0x2272b1['abandonmentRate'](_0x1dc0dc,_0x1b669a,_0xaab952,_0x3e6dad,_0x507d23)['then'](function(_0x5d96df){return _0x215003(_0x5d96df);});case _0x49c4('0x1db'):var _0x3f9b8d=_0x213fe8[_0x49c4('0x1c2')]/0x64;return _0x2272b1[_0x49c4('0x1dc')](_0x1dc0dc,_0x1b669a,_0xaab952,_0x3e6dad,_0x3f9b8d)[_0x49c4('0xb4')](function(_0x5623cc){return _0x215003(_0x5623cc);});default:return _0x37e415(msgResponse(_0x49c4('0x1dd'),_0x49c4('0x149'),_0x49c4('0x1de')));}}else{return _0x37e415(msgResponse(_0x49c4('0x1dd'),_0x49c4('0x149'),_0x49c4('0x1df')));}});};};Dialer[_0x49c4('0x1a')][_0x49c4('0x1e0')]=function(_0x5b6a88){var _0x343912=this;return function(_0x31ac1c){return new BPromise(function(_0x16a69b,_0x3dc262){_[_0x49c4('0x8b')](_0x5b6a88,_0x31ac1c[0x0]);if(checkGetDataPredictive(_0x31ac1c[0x0])){loggerPredictive['info'](JSON[_0x49c4('0x135')](_0x31ac1c[0x0]));if(_0x5b6a88[_0x49c4('0x1cd')]===_0x49c4('0x1ce')){return _0x343912['getVoiceQueueRtPauses'](_0x5b6a88['id'])[_0x49c4('0xb4')](function(_0x3da361){var _0x3e2b95=_0x5b6a88[_0x49c4('0x4d')]-_0x3da361[0x0][_0x49c4('0x1e1')];var _0x38a8d0=_0x5b6a88[_0x49c4('0x1cb')]*0x3c;var _0x28e828=_0x31ac1c[0x0][_0x49c4('0x68')]+_0x31ac1c[0x0][_0x49c4('0x67')];var _0x59305a=(_0x31ac1c[0x0][_0x49c4('0x66')]+_0x31ac1c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31ac1c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31ac1c[0x0][_0x49c4('0x7d')];var _0x1eb68f=_0x5b6a88[_0x49c4('0x1c2')]/0x64;_0x5b6a88[_0x49c4('0x1e2')]=_0x3da361[0x0][_0x49c4('0x1e1')]||0x0;_0x5b6a88['predictiveIntervalHitRate']=_0x59305a>0x0?_0x59305a:0x1;return _0x343912[_0x49c4('0x1e3')](_0x3e2b95,_0x38a8d0,_0x28e828,_0x59305a,_0x1eb68f);})['then'](function(_0x159452){return _0x16a69b(_0x159452);})['catch'](function(_0x451c1c){return _0x3dc262(msgResponse('[CatchErlangB]',_0x49c4('0x149'),JSON['stringify'](_0x451c1c)));});}if(_0x5b6a88[_0x49c4('0x1cd')]===_0x49c4('0x1db')){return _0x343912[_0x49c4('0xc5')](_0x5b6a88['id'])[_0x49c4('0xb4')](function(_0x3e9f3c){var _0x12ecf5=_0x5b6a88['loggedIn']-_0x3e9f3c[0x0][_0x49c4('0x1e1')];var _0x1c8cff=_0x5b6a88[_0x49c4('0x1cb')]*0x3c;var _0x5ae56c=_0x31ac1c[0x0][_0x49c4('0x68')]+_0x31ac1c[0x0][_0x49c4('0x67')];var _0x53a657=(_0x31ac1c[0x0][_0x49c4('0x66')]+_0x31ac1c[0x0][_0x49c4('0x6a')]+_0x31ac1c[0x0][_0x49c4('0x69')])/_0x31ac1c[0x0][_0x49c4('0x7d')];var _0x1efebc=_0x5b6a88[_0x49c4('0x1c2')]/0x64;_0x5b6a88[_0x49c4('0x1e2')]=_0x3e9f3c[0x0][_0x49c4('0x1e1')]||0x0;_0x5b6a88['predictiveIntervalHitRate']=_0x53a657>0x0?_0x53a657:0x1;return _0x343912['busyFactor'](_0x12ecf5,_0x1c8cff,_0x5ae56c,_0x53a657,_0x1efebc);})['then'](function(_0x1c3bdd){return _0x16a69b(_0x1c3bdd);})[_0x49c4('0xad')](function(_0x1f04ba){return _0x3dc262(msgResponse(_0x49c4('0x1e4'),_0x49c4('0x149'),JSON[_0x49c4('0x135')](_0x1f04ba)));});}}else{return _0x3dc262(msgResponse('[getDataPredictive]',_0x49c4('0x149'),'check\x20failure'));}});};};Dialer['prototype'][_0x49c4('0x1d5')]=function(_0x3d8ec3){var _0xf12c51=this;return function(){var _0x24407f=0x0;var _0x22712d=Math['floor'](_0x3d8ec3[_0x49c4('0x72')]*0x3e8);if(_0x22712d>0x0){_0x22712d=_0x22712d<0x64?0x64:_0x22712d;loggerPredictive['info'](_0x3d8ec3[_0x49c4('0x3d')],_0x49c4('0x1e5'),_0x22712d,_0x49c4('0x45'));_0x3d8ec3[_0x49c4('0x8f')]=setInterval(function(){_0xf12c51[_0x49c4('0x8f')](_0x3d8ec3);loggerPredictiveCalls[_0x49c4('0x7b')](_0x49c4('0x1e6'),_0x24407f+=0x1);},_0x22712d);}else{loggerPredictive[_0x49c4('0x7b')](_0x3d8ec3[_0x49c4('0x3d')],_0x49c4('0x1e7'));}};};Dialer[_0x49c4('0x1a')][_0x49c4('0x1e8')]=function(_0x5004b3,_0x4f7ec5){var _0x4734c2=this;return function(_0x5541b8){if(_['isEmpty'](_0x5541b8)){if(_[_0x49c4('0xab')](_0x4f7ec5[_0x49c4('0xcf')])||!_0x4f7ec5[_0x49c4('0x1e9')]){if(_0x5004b3[_0x49c4('0x58')]===_0x49c4('0x7')){_0x5004b3[_0x49c4('0x132')]=_[_0x49c4('0x39')](_0x5004b3[_0x49c4('0x132')])?!![]:_0x5004b3[_0x49c4('0x132')];var _0x5ef232=uuid['v4']();_0x4734c2['actions'][_0x5ef232]=new Action(_0x5004b3,_0x4f7ec5,_0x5ef232);loggerBooked[_0x49c4('0x7b')](_0x49c4('0x1ea'),_0x5ef232,_0x49c4('0x1eb'),JSON[_0x49c4('0x135')](_0x5004b3[_0x49c4('0x132')]),_0x49c4('0x1ec'),_0x5004b3[_0x49c4('0x3d')]);if(_0x5004b3[_0x49c4('0x132')]){_0x5004b3['queueStatusComplete']=![];_0x4734c2[_0x49c4('0x2b')][_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xaf')]]=[];ami['Action']({'actionid':_0x5ef232,'action':_0x49c4('0x1ed'),'queue':_0x5004b3['name']})[_0x49c4('0xad')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);_0x4734c2[_0x49c4('0xf3')]({'active':![],'ContactId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xf6')],'ListId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xce')],'VoiceQueueId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd0')]||undefined,'CampaignId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1ee')));delete _0x4734c2['actions'][_0x5ef232];});}else{loggerBooked[_0x49c4('0x7b')](_0x49c4('0x1ef'),JSON[_0x49c4('0x135')](_0x5004b3['queueStatusComplete']),'Queue:\x20',_0x5004b3[_0x49c4('0x3d')]);_0x4734c2[_0x49c4('0xae')](_0x5004b3);_0x4734c2[_0x49c4('0xf3')]({'active':![],'ContactId':_0x4734c2[_0x49c4('0x24')][_0x5ef232]['ContactId'],'ListId':_0x4734c2[_0x49c4('0x24')][_0x5ef232]['ListId'],'VoiceQueueId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd0')]||undefined,'CampaignId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1ee')));delete _0x4734c2[_0x49c4('0x24')][_0x5ef232];}}else{return _0x4734c2[_0x49c4('0x164')](_0x5004b3,_0x4f7ec5);}}else{if(getDiff(_0x4f7ec5[_0x49c4('0x1f0')])<_0x5004b3[_0x49c4('0x1f1')]*0x3c){if(_0x4f7ec5[_0x49c4('0x1f2')]&&!_0x4f7ec5[_0x49c4('0x1f2')][_0x49c4('0x1f3')]){_0x4734c2[_0x49c4('0x91')][_0x49c4('0x136')](_0x4f7ec5['id'])[_0x49c4('0x1d')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);});}else{_0x4734c2[_0x49c4('0xbf')]({'active':![]},_0x4f7ec5['id'],0x1)[_0x49c4('0x1d')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);});}}else{_0x5004b3['outboundReCallsDay']+=0x1;_0x4734c2[_0x49c4('0xae')](_0x5004b3);if(_0x5004b3[_0x49c4('0x1f4')]){_0x4734c2[_0x49c4('0xf3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4f7ec5[_0x49c4('0xf6')],'ListId':_0x4f7ec5[_0x49c4('0xce')],'VoiceQueueId':_0x4f7ec5[_0x49c4('0xd0')]||undefined,'CampaignId':_0x4f7ec5[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1f5')));_0x4734c2[_0x49c4('0xd8')](createObjHistory(_0x5004b3,_0x4f7ec5,_0x49c4('0x1f6'),0x17,'RecallInQueue'))[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1f7')));}else{_0x4734c2['saveInDb'](createObjHistory(_0x5004b3,_0x4f7ec5,_0x49c4('0x1f8'),0x16,_0x49c4('0x1f9')),_0x49c4('0x1fa'),_0x49c4('0x1fb'));}}}}else{_0x5004b3[_0x49c4('0x5d')]+=0x1;_0x4734c2[_0x49c4('0xcd')](createObjHistory(_0x5004b3,_0x4f7ec5,'BLACKLIST',0xd,'Blacklist'),_0x49c4('0x1fc'),_0x49c4('0x1fd'));throw _0x49c4('0x1fe');}};};Dialer['prototype'][_0x49c4('0x15d')]=function(_0x208dc6){var _0x4e5137=this;var _0x496b39=_0x208dc6[_0x49c4('0x1ff')]-_0x208dc6[_0x49c4('0x70')]-_0x208dc6[_0x49c4('0xc1')];emitCampaignSummary(_0x208dc6);if(_0x496b39>0x0){if(_0x496b39>this['maxNumberOriginate']){_0x496b39=this[_0x49c4('0x22')];}_0x208dc6[_0x49c4('0xc1')]+=_0x496b39;this[_0x49c4('0xc3')](_0x208dc6['id'],_0x496b39,_0x208dc6['dialOrderByScheduledAt'],_0x208dc6)[_0x49c4('0xb4')](function(_0x3409c1){_0x208dc6[_0x49c4('0xc1')]-=_0x496b39;_0x208dc6[_0x49c4('0xc1')]=_0x208dc6[_0x49c4('0xc1')]>0x0?_0x208dc6[_0x49c4('0xc1')]:0x0;if(!checkContactEmpty(_0x3409c1)){_0x208dc6[_0x49c4('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x49c4('0x7b')]('[getContactCampaign2][Empty]'+_0x208dc6[_0x49c4('0x3d')]);}else{_0x208dc6[_0x49c4('0x70')]+=_0x3409c1[_0x49c4('0x99')];_0x208dc6[_0x49c4('0x3a')]='RUNNING';for(var _0x22afcd=0x0;_0x22afcd<_0x3409c1['length'];_0x22afcd+=0x1){_0x208dc6[_0x49c4('0x200')]+=0x1;if(_[_0x49c4('0xab')](_0x3409c1[_0x22afcd])||_[_0x49c4('0xab')](_0x3409c1[_0x22afcd][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x3409c1[_0x22afcd][_0x49c4('0x167')]['phone'])){_0x4e5137[_0x49c4('0xcb')](_0x49c4('0x201'),_0x208dc6,_0x3409c1[_0x22afcd]);}else{_0x4e5137[_0x49c4('0xb9')](_[_0x49c4('0x130')](_0x3409c1[_0x22afcd],[_0x49c4('0xd1'),'Contact.phone']))[_0x49c4('0xb4')](_0x4e5137[_0x49c4('0x1e8')](_0x208dc6,_0x3409c1[_0x22afcd]))[_0x49c4('0xad')](_0x4e5137[_0x49c4('0xca')](_0x49c4('0x202'),_0x208dc6));}}}})[_0x49c4('0xad')](loggerGetContactDialer(_0x49c4('0x203'),_0x208dc6,_0x496b39));}};Dialer[_0x49c4('0x1a')]['handlePower']=function(_0x300805,_0x43f1f0){var _0x22cfa6=this;var _0x440cf1=[];var _0x366a49=_0x43f1f0>=0x1?_0x43f1f0:0x1;if(_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')){_0x366a49=0x1;}var _0x386c9e=Math[_0x49c4('0x1c6')](_0x300805[_0x49c4('0x4c')]*_0x366a49)-_0x300805[_0x49c4('0x70')]-_0x300805[_0x49c4('0xc1')];emitVoiceQueueSummary(_0x300805);if(_0x300805[_0x49c4('0x204')]>0x0){var _0x4db680=_0x300805[_0x49c4('0x204')]-_0x300805['originated']-_0x300805[_0x49c4('0x51')]-_0x300805[_0x49c4('0xc1')]-_0x300805[_0x49c4('0x4e')];if(_0x386c9e>_0x4db680){_0x386c9e=_0x4db680;}}if(_0x386c9e>0x0){if(_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')){_0x386c9e=0x1;}if(_0x386c9e>this['maxNumberOriginate']){_0x386c9e=this[_0x49c4('0x22')];}_0x300805[_0x49c4('0xc1')]+=_0x386c9e;for(var _0x1c2d60 in this['agents']){if(typeof this[_0x49c4('0x20')][_0x1c2d60]!=='undefined'){if(this[_0x49c4('0x20')][_0x1c2d60][_0x49c4('0xa7')]==='not_inuse'&&this[_0x49c4('0x20')][_0x1c2d60][_0x49c4('0x12b')]===_0x49c4('0xd6')){_0x440cf1[_0x49c4('0x12f')](this[_0x49c4('0x20')][_0x1c2d60]['id']);}}}this[_0x49c4('0x205')](_0x300805['id'],_0x440cf1,_0x386c9e,_0x300805['dialOrderByScheduledAt'],_0x300805)[_0x49c4('0xb4')](function(_0x1dad6e){_0x300805['temp']-=_0x386c9e;_0x300805[_0x49c4('0xc1')]=_0x300805[_0x49c4('0xc1')]>0x0?_0x300805[_0x49c4('0xc1')]:0x0;if(!checkContactEmpty(_0x1dad6e)){_0x22cfa6[_0x49c4('0xb5')](_0x300805)[_0x49c4('0xb4')](sendMessageReschedule(_0x300805))[_0x49c4('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x300805[_0x49c4('0x70')]+=_0x1dad6e[_0x49c4('0x99')];_0x300805[_0x49c4('0x3a')]=_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')?'ACTIVE':'RUNNING';for(var _0x32b89a=0x0;_0x32b89a<_0x1dad6e['length'];_0x32b89a+=0x1){if(_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a])||_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a][_0x49c4('0x167')][_0x49c4('0x168')])){_0x22cfa6[_0x49c4('0xcb')]('[actionOriginate]\x20',_0x300805,_0x1dad6e[_0x32b89a]);}else{_0x22cfa6['checkIsBlackList'](_[_0x49c4('0x130')](_0x1dad6e[_0x32b89a],[_0x49c4('0xd0'),_0x49c4('0x206')]))[_0x49c4('0xb4')](_0x22cfa6['checkContactBlack'](_0x300805,_0x1dad6e[_0x32b89a]))[_0x49c4('0xad')](_0x22cfa6[_0x49c4('0xca')](_0x49c4('0x201'),_0x300805));}}}})[_0x49c4('0xad')](loggerGetContactDialer(_0x49c4('0x207'),_0x300805,_0x386c9e));}};Dialer[_0x49c4('0x1a')]['handlePredictive']=function(_0x33a829){if(_0x33a829[_0x49c4('0x204')]>0x0){var _0x73e425=_0x33a829[_0x49c4('0x204')]-_0x33a829[_0x49c4('0x70')]-_0x33a829[_0x49c4('0x51')];if(_0x73e425>0x0){this[_0x49c4('0x208')](_0x33a829);}else{loggerPredictiveCalls['info'](_0x49c4('0x209'));}}else{this[_0x49c4('0x208')](_0x33a829);}};Dialer[_0x49c4('0x1a')][_0x49c4('0x208')]=function(_0x1d513e){var _0x2d2315=this;var _0x5f26a2=[];_0x1d513e[_0x49c4('0x70')]+=0x1;for(var _0x37b6b6 in this[_0x49c4('0x20')]){if(typeof this[_0x49c4('0x20')][_0x37b6b6]!=='undefined'){if(this[_0x49c4('0x20')][_0x37b6b6][_0x49c4('0xa7')]===_0x49c4('0x20a')&&this[_0x49c4('0x20')][_0x37b6b6]['status']==='reachable'){_0x5f26a2[_0x49c4('0x12f')](this[_0x49c4('0x20')][_0x37b6b6]['id']);}}}this['getContactDialer'](_0x1d513e['id'],_0x5f26a2,0x1,_0x1d513e[_0x49c4('0x20b')],_0x1d513e)[_0x49c4('0xb4')](function(_0x185927){if(!checkContactEmpty(_0x185927)){checkContactLowerLimitOriginate(_0x1d513e,0x1,0x0);_0x2d2315[_0x49c4('0xb5')](_0x1d513e)[_0x49c4('0xb4')](sendMessageReschedule(_0x1d513e))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xb6')));}else{_0x1d513e['message']=_0x49c4('0x20c');if(_[_0x49c4('0xab')](_0x185927[0x0])||_[_0x49c4('0xab')](_0x185927[0x0][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x185927[0x0][_0x49c4('0x167')]['phone'])){_0x2d2315[_0x49c4('0xcb')](_0x49c4('0x201'),_0x1d513e,_0x185927[0x0]);}else{_0x2d2315[_0x49c4('0xb7')](_['pick'](_0x185927[0x0],[_0x49c4('0xd0'),'Contact.phone']))[_0x49c4('0xb4')](_0x2d2315[_0x49c4('0x1e8')](_0x1d513e,_0x185927[0x0]))[_0x49c4('0xad')](_0x2d2315['loggerHandler'](_0x49c4('0x20d'),_0x1d513e));}}})['catch'](loggerGetContactDialer(_0x49c4('0x20e'),_0x1d513e,0x1));emitVoiceQueueSummary(_0x1d513e);};Dialer[_0x49c4('0x1a')]['abandonmentRate']=function(_0x1e9465,_0x3a4e83,_0x3b3b95,_0x3e5cd9,_0x482eea,_0x8cc12c){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x20f'));loggerPredictive['info'](_0x49c4('0x210'),_0x1e9465);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x211'),_0x3a4e83);loggerPredictive['info'](_0x49c4('0x212'),_0x3b3b95);loggerPredictive['info']('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',_0x3e5cd9);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x213'),_0x482eea);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));return new BPromise(function(_0xba7a3a,_0x5b7ac5){if(_0x1e9465<=0x0||isNaN(_0x1e9465)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),'m\x20=\x20'+_0x1e9465));}if(_0x3b3b95<=0x0||isNaN(_0x3b3b95)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x215')+_0x3b3b95));}if(_0x3e5cd9<=0x0||isNaN(_0x3e5cd9)){return _0x5b7ac5(msgResponse('[abandonmentRate]',_0x49c4('0x44'),_0x49c4('0x216')+_0x3e5cd9));}if(_0x3a4e83<=0x0||isNaN(_0x3a4e83)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x217')+_0x3a4e83));}if(_0x482eea<=0x0||isNaN(_0x482eea)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x218')+_0x482eea));}_0x8cc12c=_0x8cc12c||0x0;var _0x55a301=0x1/_0x3b3b95;var _0x5576e4=0x0;var _0x594d02=0x0;var _0x31fd27=0x0;var _0x35111b=0x0;for(var _0x181b2d=0x0;_0x31fd27<_0x482eea;_0x181b2d+=0x1){_0x594d02=_0x181b2d/_0x3a4e83;_0x5576e4=(_0x3e5cd9*_0x594d02+_0x8cc12c)/_0x55a301;_0x31fd27=erlangb(_0x5576e4,_0x1e9465);_0x35111b=_0x5576e4/_0x1e9465*(0x1-erlangb(_0x5576e4,_0x1e9465));}return _0xba7a3a({'erlangCalls':_0x181b2d,'erlangCallToSecond':_0x3a4e83/_0x181b2d,'erlangAbandonmentRate':_0x31fd27,'erlangBusyFactor':_0x35111b});});};Dialer[_0x49c4('0x1a')][_0x49c4('0x1dc')]=function(_0x1b267b,_0x8f1a39,_0x35ed46,_0x48ea23,_0x32ae5d,_0x1cca54){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x49c4('0x7b')]('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',_0x1b267b);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x211'),_0x8f1a39);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35ed46);loggerPredictive[_0x49c4('0x7b')]('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',_0x48ea23);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x219'),_0x32ae5d);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));return new BPromise(function(_0x5c4fca,_0x486e44){if(_0x1b267b<=0x0||isNaN(_0x1b267b)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x21b')+_0x1b267b));}if(_0x35ed46<=0x0||isNaN(_0x35ed46)){return _0x486e44(msgResponse(_0x49c4('0x21a'),'Error',_0x49c4('0x215')+_0x35ed46));}if(_0x48ea23<=0x0||isNaN(_0x48ea23)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x216')+_0x48ea23));}if(_0x8f1a39<=0x0||isNaN(_0x8f1a39)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x217')+_0x8f1a39));}if(_0x32ae5d<=0x0||isNaN(_0x32ae5d)){return _0x486e44(msgResponse(_0x49c4('0x21a'),'Error',_0x49c4('0x21c')+_0x32ae5d));}_0x1cca54=_0x1cca54||0x0;var _0x331875=0x1/_0x35ed46;var _0x45d437=0x0;var _0x4a08e7=0x0;var _0x1237f1=0x0;var _0x34a3c7=0x0;for(var _0x3eb36f=0x0;_0x34a3c7<_0x32ae5d;_0x3eb36f+=0x1){_0x4a08e7=_0x3eb36f/_0x8f1a39;_0x45d437=(_0x48ea23*_0x4a08e7+_0x1cca54)/_0x331875;_0x1237f1=erlangb(_0x45d437,_0x1b267b);_0x34a3c7=_0x45d437/_0x1b267b*(0x1-erlangb(_0x45d437,_0x1b267b));}return _0x5c4fca({'erlangCalls':_0x3eb36f,'erlangCallToSecond':_0x8f1a39/_0x3eb36f,'erlangAbandonmentRate':_0x1237f1,'erlangBusyFactor':_0x34a3c7});});};module[_0x49c4('0x21d')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 3beab5a..613bab6 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 _0x63a0=['calleridnum','starttime','droptime','endtime','ringtime','responsetime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name'];(function(_0x30d485,_0x216b62){var _0x1683ad=function(_0x48c8a6){while(--_0x48c8a6){_0x30d485['push'](_0x30d485['shift']());}};_0x1683ad(++_0x216b62);}(_0x63a0,0xe1));var _0x063a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x63a0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x063a('0x0'));var _=require(_0x063a('0x1'));var moment=require(_0x063a('0x2'));function getSeconds(_0x392cb7,_0x5dff4a){var _0x1c9e73=moment(_0x392cb7)[_0x063a('0x3')](0x0);var _0x5421b0=moment(_0x5dff4a)[_0x063a('0x3')](0x0);return _0x1c9e73[_0x063a('0x4')](_0x5421b0,_0x063a('0x5'));}function QueueCallerAbandon(_0x2a7da6,_0x12745b){this[_0x063a('0x6')]=_0x2a7da6[_0x063a('0x6')];this[_0x063a('0x7')]=_0x2a7da6[_0x063a('0x7')];this[_0x063a('0x8')]=_0x2a7da6[_0x063a('0x7')]==='outbound'?_0x063a('0x9'):_0x2a7da6[_0x063a('0x7')];this[_0x063a('0xa')]=_0x2a7da6['countbusyretry'];this[_0x063a('0xb')]=_0x2a7da6[_0x063a('0xb')];this[_0x063a('0xc')]=_0x2a7da6[_0x063a('0xc')];this[_0x063a('0xd')]=_0x2a7da6[_0x063a('0xa')]+_0x2a7da6[_0x063a('0xb')]+_0x2a7da6[_0x063a('0xc')]+_0x2a7da6[_0x063a('0xe')]+_0x2a7da6['countdropretry']+_0x2a7da6[_0x063a('0xf')]+_0x2a7da6[_0x063a('0x10')]+_0x2a7da6[_0x063a('0x11')];this[_0x063a('0xe')]=_0x2a7da6[_0x063a('0xe')];this[_0x063a('0x12')]=_0x2a7da6[_0x063a('0x12')];this[_0x063a('0xf')]=_0x2a7da6[_0x063a('0xf')];this['countmachineretry']=_0x2a7da6[_0x063a('0x10')];this[_0x063a('0x11')]=_0x2a7da6[_0x063a('0x11')];this['uniqueid']=_0x12745b['uniqueid'];this[_0x063a('0x13')]=_0x2a7da6[_0x063a('0x14')];this[_0x063a('0x15')]=_0x2a7da6['number'];this['starttime']=_0x2a7da6[_0x063a('0x16')];this['responsetime']=_0x2a7da6['responsetime'];this[_0x063a('0x17')]=_0x2a7da6[_0x063a('0x17')];this[_0x063a('0x18')]=this['droptime'];this[_0x063a('0x19')]=getSeconds(_0x2a7da6[_0x063a('0x1a')],_0x2a7da6[_0x063a('0x16')]);this['holdtime']=getSeconds(this[_0x063a('0x17')],_0x2a7da6[_0x063a('0x1a')]);this[_0x063a('0x1b')]=0x0;this[_0x063a('0x9')]=_0x12745b[_0x063a('0x9')];this['membername']=_0x12745b[_0x063a('0x1c')];this['reason']=_0x12745b[_0x063a('0x1d')];this['callback']=_0x2a7da6[_0x063a('0x1e')];this[_0x063a('0x1f')]=_0x2a7da6[_0x063a('0x1f')];this[_0x063a('0x20')]=_0x2a7da6[_0x063a('0x20')];this[_0x063a('0x21')]=_0x2a7da6[_0x063a('0x21')];this[_0x063a('0x22')]=_0x2a7da6['ContactId'];this[_0x063a('0x23')]=_0x2a7da6[_0x063a('0x23')];this[_0x063a('0x24')]=_0x2a7da6[_0x063a('0x24')];this[_0x063a('0x25')]=_0x2a7da6[_0x063a('0x25')];this[_0x063a('0x26')]=_0x2a7da6[_0x063a('0x26')];this[_0x063a('0x27')]=_0x2a7da6[_0x063a('0x27')]||'';this[_0x063a('0x28')]=_0x2a7da6[_0x063a('0x28')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xb25f=['originatecalleridname','exports','util','lodash','moment','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xb25f,0xf2));var _0xfb25=function(_0x5b9d0a,_0xc988f1){_0x5b9d0a=_0x5b9d0a-0x0;var _0x21b36d=_0xb25f[_0x5b9d0a];return _0x21b36d;};'use strict';var util=require(_0xfb25('0x0'));var _=require(_0xfb25('0x1'));var moment=require(_0xfb25('0x2'));function getSeconds(_0x3bb53d,_0x30832b){var _0x154d16=moment(_0x3bb53d)['milliseconds'](0x0);var _0x4fe381=moment(_0x30832b)['milliseconds'](0x0);return _0x154d16[_0xfb25('0x3')](_0x4fe381,'seconds');}function QueueCallerAbandon(_0x3d33f4,_0x3074b8){this['scheduledat']=_0x3d33f4[_0xfb25('0x4')];this[_0xfb25('0x5')]=_0x3d33f4[_0xfb25('0x5')];this[_0xfb25('0x6')]=_0x3d33f4['type']===_0xfb25('0x7')?_0xfb25('0x8'):_0x3d33f4[_0xfb25('0x5')];this[_0xfb25('0x9')]=_0x3d33f4[_0xfb25('0x9')];this[_0xfb25('0xa')]=_0x3d33f4[_0xfb25('0xa')];this[_0xfb25('0xb')]=_0x3d33f4[_0xfb25('0xb')];this['countglobal']=_0x3d33f4[_0xfb25('0x9')]+_0x3d33f4[_0xfb25('0xa')]+_0x3d33f4[_0xfb25('0xb')]+_0x3d33f4[_0xfb25('0xc')]+_0x3d33f4[_0xfb25('0xd')]+_0x3d33f4[_0xfb25('0xe')]+_0x3d33f4[_0xfb25('0xf')]+_0x3d33f4[_0xfb25('0x10')];this[_0xfb25('0xc')]=_0x3d33f4[_0xfb25('0xc')];this[_0xfb25('0xd')]=_0x3d33f4[_0xfb25('0xd')];this[_0xfb25('0xe')]=_0x3d33f4['countabandonedretry'];this[_0xfb25('0xf')]=_0x3d33f4['countmachineretry'];this[_0xfb25('0x10')]=_0x3d33f4[_0xfb25('0x10')];this[_0xfb25('0x11')]=_0x3074b8[_0xfb25('0x11')];this[_0xfb25('0x12')]=_0x3d33f4[_0xfb25('0x13')];this[_0xfb25('0x14')]=_0x3d33f4[_0xfb25('0x15')];this[_0xfb25('0x16')]=_0x3d33f4['starttime'];this[_0xfb25('0x17')]=_0x3d33f4[_0xfb25('0x17')];this[_0xfb25('0x18')]=_0x3d33f4[_0xfb25('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x3d33f4[_0xfb25('0x17')],_0x3d33f4['starttime']);this['holdtime']=getSeconds(this[_0xfb25('0x18')],_0x3d33f4[_0xfb25('0x17')]);this[_0xfb25('0x19')]=0x0;this[_0xfb25('0x8')]=_0x3074b8[_0xfb25('0x8')];this[_0xfb25('0x1a')]=_0x3074b8[_0xfb25('0x1b')];this[_0xfb25('0x1c')]=_0x3074b8['reason'];this[_0xfb25('0x1d')]=_0x3d33f4[_0xfb25('0x1d')];this[_0xfb25('0x1e')]=_0x3d33f4[_0xfb25('0x1e')];this[_0xfb25('0x1f')]=_0x3d33f4[_0xfb25('0x1f')];this[_0xfb25('0x20')]=_0x3d33f4[_0xfb25('0x20')];this[_0xfb25('0x21')]=_0x3d33f4[_0xfb25('0x21')];this[_0xfb25('0x22')]=_0x3d33f4[_0xfb25('0x22')];this[_0xfb25('0x23')]=_0x3d33f4['UserId'];this['VoiceQueueId']=_0x3d33f4['VoiceQueueId'];this[_0xfb25('0x24')]=_0x3d33f4[_0xfb25('0x24')];this[_0xfb25('0x25')]=_0x3d33f4[_0xfb25('0x25')]||'';this[_0xfb25('0x26')]=_0x3d33f4[_0xfb25('0x26')]||'';}module[_0xfb25('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 31198cc..c433666 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(_0x220b08,_0x584bc5){var _0x549f9f=function(_0x5acb00){while(--_0x5acb00){_0x220b08['push'](_0x220b08['shift']());}};_0x549f9f(++_0x584bc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x444ae7,_0x3162e8){var _0xe49939=function(_0x22b17a){while(--_0x22b17a){_0x444ae7['push'](_0x444ae7['shift']());}};_0xe49939(++_0x3162e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 a5afacc..59a5b6a 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 _0x7334=['SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','checkAfterSend','checkTrunk','FaxAccountId','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','exports','util','lodash','bluebird','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','prototype','syncVarSet','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7334,0x184));var _0x4733=function(_0x153314,_0x39d917){_0x153314=_0x153314-0x0;var _0x56ab34=_0x7334[_0x153314];return _0x56ab34;};'use strict';var util=require(_0x4733('0x0'));var _=require(_0x4733('0x1'));var BPromise=require(_0x4733('0x2'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x4733('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var ami=require(_0x4733('0x7'));var rpcDb=require(_0x4733('0x8'));var Channel=require(_0x4733('0x9'));var ut=require(_0x4733('0xa'));var Action=require(_0x4733('0xb'));var faxAccount=require(_0x4733('0xc'));var attachment=require(_0x4733('0xd'));var faxMessage=require(_0x4733('0xe'));function Fax(_0x3562b7){this[_0x4733('0xf')]={};this[_0x4733('0x10')]=_0x3562b7[_0x4733('0x10')];this[_0x4733('0x11')]=_0x3562b7[_0x4733('0x11')];this['actions']={};ami['on'](_0x4733('0x12'),this[_0x4733('0x13')]['bind'](this));ami['on'](_0x4733('0x14'),this['syncVarSet'][_0x4733('0x15')](this));ami['on'](_0x4733('0x16'),this[_0x4733('0x17')][_0x4733('0x15')](this));ami['on'](_0x4733('0x18'),this[_0x4733('0x19')][_0x4733('0x15')](this));ami['on']('faxstatus',this[_0x4733('0x1a')]['bind'](this));ami['on'](_0x4733('0x1b'),this[_0x4733('0x1c')][_0x4733('0x15')](this));ami['on'](_0x4733('0x1d'),this[_0x4733('0x1e')][_0x4733('0x15')](this));ami['on'](_0x4733('0x1f'),this[_0x4733('0x20')][_0x4733('0x15')](this));}Fax['prototype'][_0x4733('0x13')]=function(_0x71e96c){if(_0x71e96c['context']===_0x4733('0x21')){for(var _0x1d2fb6 in this[_0x4733('0x10')]){if(this[_0x4733('0x10')]['hasOwnProperty'](_0x1d2fb6)){if(_0x71e96c['exten']===this[_0x4733('0x10')][_0x1d2fb6][_0x4733('0x22')]){this['channels'][_0x71e96c[_0x4733('0x23')]]={};this[_0x4733('0xf')][_0x71e96c[_0x4733('0x23')]][_0x4733('0x24')]=_0x71e96c['channel'];this[_0x4733('0xf')][_0x71e96c[_0x4733('0x23')]]['id']=this['faxAccounts'][_0x1d2fb6]['id'];this[_0x4733('0xf')][_0x71e96c[_0x4733('0x23')]]['name']=this[_0x4733('0x10')][_0x1d2fb6][_0x4733('0x25')];logger[_0x4733('0x26')](_0x71e96c[_0x4733('0x23')],_0x4733('0x27'));}}}}if(this[_0x4733('0x28')][_0x71e96c[_0x4733('0x23')]]){this[_0x4733('0xf')][_0x71e96c['uniqueid']]={};this[_0x4733('0xf')][_0x71e96c[_0x4733('0x23')]][_0x4733('0x24')]=_0x71e96c[_0x4733('0x24')];logger[_0x4733('0x26')](_0x71e96c[_0x4733('0x23')],_0x4733('0x27'));}};Fax[_0x4733('0x29')][_0x4733('0x2a')]=function(_0x23fe6c){if(this['channels'][_0x23fe6c[_0x4733('0x23')]]){for(var _0x4c91bc in _0x23fe6c['variable']){if(_0x23fe6c[_0x4733('0x2b')]['hasOwnProperty'](_0x4c91bc)){this[_0x4733('0xf')][_0x23fe6c['uniqueid']][_0x4c91bc]=_0x23fe6c['value'];}}}};Fax['prototype'][_0x4733('0x17')]=function(_0x3bfe53){if(this[_0x4733('0xf')][_0x3bfe53[_0x4733('0x23')]]){this['channels'][_0x3bfe53['uniqueid']]['channelstate']=_0x3bfe53[_0x4733('0x2c')];this['channels'][_0x3bfe53['uniqueid']][_0x4733('0x2d')]=_0x3bfe53[_0x4733('0x2d')];}};Fax[_0x4733('0x29')]['syncNewExten']=function(_0x523c61){if(this[_0x4733('0xf')][_0x523c61[_0x4733('0x23')]]){for(var _0x22d38a in _0x523c61[_0x4733('0x2b')]){if(_0x523c61[_0x4733('0x2b')]['hasOwnProperty'](_0x22d38a)){this[_0x4733('0xf')][_0x523c61[_0x4733('0x23')]][_0x22d38a]=_0x523c61[_0x4733('0x2e')];}}}};Fax[_0x4733('0x29')][_0x4733('0x1a')]=function(_0x4b133f){if(this['channels'][_0x4b133f[_0x4733('0x23')]]){this[_0x4733('0xf')][_0x4b133f[_0x4733('0x23')]][_0x4733('0x2f')]=_0x4b133f[_0x4733('0x2f')];this['channels'][_0x4b133f[_0x4733('0x23')]][_0x4733('0x30')]=_0x4b133f[_0x4733('0x30')];this['channels'][_0x4b133f[_0x4733('0x23')]][_0x4733('0x22')]=_0x4b133f[_0x4733('0x22')];this[_0x4733('0xf')][_0x4b133f[_0x4733('0x23')]][_0x4733('0x31')]=_0x4b133f[_0x4733('0x31')];logger[_0x4733('0x26')](_0x4b133f['uniqueid'],_0x4733('0x32'));}};Fax['prototype'][_0x4733('0x1c')]=function(_0x29db03){var _0x381fa8=this;if(this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]]){var _0x1a8b50=this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]]['id'];this['channels'][_0x29db03[_0x4733('0x23')]][_0x4733('0x33')]=_0x29db03['remotestationid'];this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]]['pagestransferred']=_0x29db03[_0x4733('0x34')];this['channels'][_0x29db03[_0x4733('0x23')]]['localstationid']=_0x29db03[_0x4733('0x22')];this[_0x4733('0xf')][_0x29db03['uniqueid']]['resolution']=_0x29db03[_0x4733('0x35')];this[_0x4733('0xf')][_0x29db03['uniqueid']][_0x4733('0x36')]=_0x29db03[_0x4733('0x36')];this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]][_0x4733('0x31')]=_0x29db03[_0x4733('0x31')];this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]][_0x4733('0x37')]=_0x29db03[_0x4733('0x37')];if(this[_0x4733('0xf')][_0x29db03[_0x4733('0x23')]][_0x4733('0x34')]>0x0){tiff2pdf(_0x29db03[_0x4733('0x31')],_0x4733('0x38'),function(_0x540cb8){logger[_0x4733('0x26')](_0x29db03[_0x4733('0x23')],'\x20result\x20conversion\x20file\x20',_0x540cb8[_0x4733('0x39')]);attachment[_0x4733('0x3a')]({'name':path[_0x4733('0x3b')](_0x29db03[_0x4733('0x31')])[_0x4733('0x25')],'basename':path[_0x4733('0x3b')](_0x29db03[_0x4733('0x31')])[_0x4733('0x25')]+_0x4733('0x3c'),'type':_0x4733('0x3d')})[_0x4733('0x3e')](function(_0x1a50f5){faxAccount[_0x4733('0x3f')](_0x1a8b50,{'from':_0x29db03[_0x4733('0x37')],'mapKey':'fax','body':path['parse'](_0x29db03[_0x4733('0x31')])[_0x4733('0x25')]+_0x4733('0x3c'),'AttachmentId':_0x1a50f5['id']})[_0x4733('0x40')](function(_0x81a314){logger[_0x4733('0x41')](_0x29db03[_0x4733('0x23')],_0x4733('0x42'),JSON[_0x4733('0x43')](_0x81a314));});})[_0x4733('0x40')](function(_0x4d8301){logger['error'](_0x29db03['uniqueid'],'\x20receiveFax\x20',JSON[_0x4733('0x43')](_0x4d8301));});});}logger[_0x4733('0x26')](_0x29db03[_0x4733('0x23')],_0x4733('0x44'));}};Fax[_0x4733('0x29')][_0x4733('0x20')]=function(_0x1c6abf){if(this[_0x4733('0x28')][_0x1c6abf[_0x4733('0x23')]]){_[_0x4733('0x45')](this['channels'][_0x1c6abf['uniqueid']],_[_0x4733('0x46')](_0x1c6abf,['response',_0x4733('0x47')]));}};function updateStatus(_0x17e686){if(_0x17e686[_0x4733('0x48')]){faxMessage['update'](_0x17e686[_0x4733('0x48')],{'failMessage':_0x4733('0x49')})[_0x4733('0x3e')](function(_0x114464){ut[_0x4733('0x4a')](_0x4733('0x4b'),_0x114464);})[_0x4733('0x40')](function(_0x2da475){ut[_0x4733('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0x2da475);});}else{ut[_0x4733('0x4a')](_0x4733('0x4c'));}}Fax[_0x4733('0x29')]['updateStatus']=function(_0x2effd2,_0x130aee,_0xafb3f8){var _0x4a7fa=this;var _0x59344b={};if(_0x130aee){_0x59344b={'read':_0x130aee};}else{_0x59344b={'failMessage':_0xafb3f8};}if(this[_0x4733('0x28')][_0x2effd2]['AttachmentId']){faxMessage[_0x4733('0x4d')](this[_0x4733('0x28')][_0x2effd2][_0x4733('0x48')],_0x59344b)[_0x4733('0x3e')](function(_0x53321d){ut['logger'](_0x4733('0x4e'),_0x53321d);})[_0x4733('0x40')](function(_0x5e4668){ut['logger'](_0x4733('0x4f'),_0x5e4668);})[_0x4733('0x50')](function(){delete _0x4a7fa[_0x4733('0xf')][_0x2effd2];delete _0x4a7fa[_0x4733('0x28')][_0x2effd2];});}else{ut[_0x4733('0x4a')](_0x4733('0x51'));delete this[_0x4733('0xf')][_0x2effd2];delete this[_0x4733('0x28')][_0x2effd2];}};Fax['prototype']['syncHangup']=function(_0x3b7f06){var _0x5d45c5=this;if(this[_0x4733('0xf')][_0x3b7f06[_0x4733('0x23')]]){if(this[_0x4733('0x28')][_0x3b7f06['uniqueid']]){this['channels'][_0x3b7f06['uniqueid']]['id']=this[_0x4733('0x28')][_0x3b7f06[_0x4733('0x23')]]['id'];this[_0x4733('0xf')][_0x3b7f06['uniqueid']][_0x4733('0x25')]=this[_0x4733('0x28')][_0x3b7f06[_0x4733('0x23')]][_0x4733('0x25')];}logger[_0x4733('0x26')](_0x3b7f06[_0x4733('0x23')],this[_0x4733('0x28')][_0x3b7f06['uniqueid']]?_0x4733('0x52'):_0x4733('0x53'),JSON['stringify'](this['channels'][_0x3b7f06[_0x4733('0x23')]]));if(this[_0x4733('0x28')][_0x3b7f06[_0x4733('0x23')]]){if(this[_0x4733('0xf')][_0x3b7f06[_0x4733('0x23')]][_0x4733('0x54')]>0x0&&this[_0x4733('0xf')][_0x3b7f06[_0x4733('0x23')]][_0x4733('0x55')]==='SUCCESS'){this[_0x4733('0x56')](_0x3b7f06[_0x4733('0x23')],!![]);}else{this[_0x4733('0x56')](_0x3b7f06['uniqueid'],![],this[_0x4733('0xf')][_0x3b7f06['uniqueid']][_0x4733('0x57')]?_0x4733('0x58')+this[_0x4733('0xf')][_0x3b7f06[_0x4733('0x23')]][_0x4733('0x57')]:_0x4733('0x59'));}}}};Fax['prototype'][_0x4733('0x5a')]=function(_0x574787){var _0x15552d=this;return new BPromise(function(_0x12997e,_0x54326d){_0x15552d[_0x4733('0x5b')](_0x574787,_0x15552d['faxAccounts'][_0x574787['FaxAccountId']])[_0x4733('0x3e')](function(_0x28a04f){ut[_0x4733('0x4a')](_0x4733('0x5c'),_0x28a04f);_0x12997e(ut[_0x4733('0x39')](_0x4733('0x5d')));})[_0x4733('0x40')](function(_0x181b34){ut[_0x4733('0x4a')]('[Fax][execOriginate][failure]',_0x181b34);updateStatus(_0x574787);_0x54326d(ut['message']('Fax\x20failed'));});});};Fax[_0x4733('0x29')][_0x4733('0x5e')]=function(_0x24f51d){var _0xa087d9=this;return new BPromise(function(_0x520936,_0x2c224d){var _0x1a743e=_0xa087d9[_0x4733('0x5f')](_0xa087d9['faxAccounts'][_0x24f51d[_0x4733('0x60')]]['Trunk'],_0x24f51d);if(_0x1a743e[_0x4733('0x61')]){_0x520936(ut['message']('Trunk\x20Reachable'));}else{_0x2c224d(ut[_0x4733('0x39')](_0x1a743e['message']));}});};function originate(_0x20f867,_0x523498,_0x4e835b){return new BPromise(function(_0x1a7baf,_0x5c6083){if(_0x4e835b){var _0x54bf73=util[_0x4733('0x62')](_0x4733('0x63'),path[_0x4733('0x3b')](_0x20f867['path'])[_0x4733('0x25')],_0x20f867[_0x4733('0x3')]);gs[_0x4733('0x64')](_0x54bf73)[_0x4733('0x3e')](function(){_0x20f867[_0x4733('0x3')]=util[_0x4733('0x62')]('%s/%s.tif',path[_0x4733('0x3b')](_0x20f867[_0x4733('0x3')])[_0x4733('0x65')],path['parse'](_0x20f867[_0x4733('0x3')])[_0x4733('0x25')]);_0x523498[_0x4733('0x66')]=_0x20f867[_0x4733('0x3')];ut[_0x4733('0x4a')](_0x4733('0x67'),'');ami[_0x4733('0x68')](ut[_0x4733('0x69')](_0x20f867,_0x523498))['then'](function(_0x583e6d){_0x1a7baf(_0x583e6d);})[_0x4733('0x40')](function(_0x4fac10){_0x5c6083(_0x4fac10);});})['catch'](function(_0x1f52ff){_0x5c6083(_0x1f52ff);});}else{ami[_0x4733('0x68')](ut[_0x4733('0x69')](_0x20f867,_0x523498))[_0x4733('0x3e')](function(_0x4830b4){_0x1a7baf(_0x4830b4);})[_0x4733('0x40')](function(_0x55450a){_0x5c6083(_0x55450a);});}});}Fax[_0x4733('0x29')]['execOriginate']=function(_0x542397,_0x129cc2){var _0x567faa=this;return new BPromise(function(_0x487408,_0x58d5ba){var _0x416e3f=uuid['v4']();var _0x4b172b=ut[_0x4733('0x6a')](_0x542397,_0x129cc2);_0x567faa[_0x4733('0x28')][_0x416e3f]=new Action(_0x416e3f,_0x129cc2,_0x542397);var _0x59cc5b=_0x567faa[_0x4733('0x28')][_0x416e3f];if(path['parse'](_0x542397['path'])[_0x4733('0x6b')]===_0x4733('0x3c')){originate(_0x59cc5b,_0x4b172b,!![])[_0x4733('0x3e')](function(_0x5a067b){_0x487408(_0x5a067b);})['catch'](function(_0x6179db){_0x58d5ba(_0x6179db);});}else{originate(_0x59cc5b,_0x4b172b,![])['then'](function(_0x3fd347){_0x487408(_0x3fd347);})[_0x4733('0x40')](function(_0x1e9f9a){_0x58d5ba(_0x1e9f9a);});}});};Fax[_0x4733('0x29')][_0x4733('0x6c')]=function(_0x27494c){return!_['isNil'](_0x27494c)&&!_[_0x4733('0x6d')](_0x27494c[_0x4733('0x25')])&&!_[_0x4733('0x6d')](_0x27494c[_0x4733('0x6e')])&&_0x27494c['active']&&!_['isNil'](this[_0x4733('0x11')][util['format'](_0x4733('0x6f'),_0x27494c[_0x4733('0x25')])])&&!_[_0x4733('0x6d')](this[_0x4733('0x11')][util[_0x4733('0x62')](_0x4733('0x6f'),_0x27494c[_0x4733('0x25')])]['status'])&&(this[_0x4733('0x11')][util[_0x4733('0x62')]('SIP/%s',_0x27494c['name'])][_0x4733('0x30')]==='reachable'||this[_0x4733('0x11')][util['format']('SIP/%s',_0x27494c[_0x4733('0x25')])][_0x4733('0x30')]===_0x4733('0x70'));};Fax[_0x4733('0x29')][_0x4733('0x5f')]=function(_0x56729d,_0x3a68d7){if(!this[_0x4733('0x6c')](_0x56729d)){ut[_0x4733('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x56729d)?'':_0x56729d['name']+_0x4733('0x71'));return{'isValid':![],'message':_0x4733('0x72')};}if(_[_0x4733('0x6d')](_0x3a68d7[_0x4733('0x6')])){ut[_0x4733('0x4a')](_0x4733('0x73'),JSON['stringify'](_0x3a68d7));return{'isValid':![],'message':_0x4733('0x74')};}if(_[_0x4733('0x6d')](_0x3a68d7[_0x4733('0x3')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x3a68d7));return{'isValid':![],'message':_0x4733('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x4733('0x76')]=Fax; \ No newline at end of file +var _0xf7b4=['../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','path','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','util','uuid','moment','./util/gs'];(function(_0x141afa,_0x58cb2b){var _0x7c6fb0=function(_0x56d76f){while(--_0x56d76f){_0x141afa['push'](_0x141afa['shift']());}};_0x7c6fb0(++_0x58cb2b);}(_0xf7b4,0x152));var _0x4f7b=function(_0x538ffd,_0x145008){_0x538ffd=_0x538ffd-0x0;var _0x5b5aaa=_0xf7b4[_0x538ffd];return _0x5b5aaa;};'use strict';var util=require(_0x4f7b('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var ami=require(_0x4f7b('0x6'));var rpcDb=require(_0x4f7b('0x7'));var Channel=require(_0x4f7b('0x8'));var ut=require(_0x4f7b('0x9'));var Action=require(_0x4f7b('0xa'));var faxAccount=require(_0x4f7b('0xb'));var attachment=require(_0x4f7b('0xc'));var faxMessage=require(_0x4f7b('0xd'));function Fax(_0x3ef6e1){this[_0x4f7b('0xe')]={};this['faxAccounts']=_0x3ef6e1[_0x4f7b('0xf')];this[_0x4f7b('0x10')]=_0x3ef6e1['trunks'];this[_0x4f7b('0x11')]={};ami['on'](_0x4f7b('0x12'),this[_0x4f7b('0x13')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x15'),this['syncVarSet'][_0x4f7b('0x14')](this));ami['on']('newstate',this['syncNewState'][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x16'),this[_0x4f7b('0x17')][_0x4f7b('0x14')](this));ami['on']('faxstatus',this[_0x4f7b('0x18')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x19'),this[_0x4f7b('0x1a')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x1b'),this[_0x4f7b('0x1c')][_0x4f7b('0x14')](this));ami['on'](_0x4f7b('0x1d'),this[_0x4f7b('0x1e')][_0x4f7b('0x14')](this));}Fax[_0x4f7b('0x1f')]['syncNewchannel']=function(_0x372ea5){if(_0x372ea5['context']==='from-voip-provider'){for(var _0x24e5cf in this[_0x4f7b('0xf')]){if(this['faxAccounts'][_0x4f7b('0x20')](_0x24e5cf)){if(_0x372ea5[_0x4f7b('0x21')]===this[_0x4f7b('0xf')][_0x24e5cf][_0x4f7b('0x22')]){this['channels'][_0x372ea5[_0x4f7b('0x23')]]={};this['channels'][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x24')]=_0x372ea5[_0x4f7b('0x24')];this[_0x4f7b('0xe')][_0x372ea5[_0x4f7b('0x23')]]['id']=this[_0x4f7b('0xf')][_0x24e5cf]['id'];this[_0x4f7b('0xe')][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x25')]=this['faxAccounts'][_0x24e5cf][_0x4f7b('0x25')];logger[_0x4f7b('0x26')](_0x372ea5[_0x4f7b('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0x4f7b('0x11')][_0x372ea5[_0x4f7b('0x23')]]){this['channels'][_0x372ea5[_0x4f7b('0x23')]]={};this['channels'][_0x372ea5[_0x4f7b('0x23')]][_0x4f7b('0x24')]=_0x372ea5[_0x4f7b('0x24')];logger[_0x4f7b('0x26')](_0x372ea5[_0x4f7b('0x23')],_0x4f7b('0x27'));}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x28')]=function(_0x4ec9a3){if(this[_0x4f7b('0xe')][_0x4ec9a3[_0x4f7b('0x23')]]){for(var _0x311675 in _0x4ec9a3['variable']){if(_0x4ec9a3[_0x4f7b('0x29')][_0x4f7b('0x20')](_0x311675)){this[_0x4f7b('0xe')][_0x4ec9a3[_0x4f7b('0x23')]][_0x311675]=_0x4ec9a3[_0x4f7b('0x2a')];}}}};Fax['prototype'][_0x4f7b('0x2b')]=function(_0x3331b2){if(this[_0x4f7b('0xe')][_0x3331b2['uniqueid']]){this[_0x4f7b('0xe')][_0x3331b2['uniqueid']]['channelstate']=_0x3331b2[_0x4f7b('0x2c')];this['channels'][_0x3331b2[_0x4f7b('0x23')]][_0x4f7b('0x2d')]=_0x3331b2[_0x4f7b('0x2d')];}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x17')]=function(_0x4e5862){if(this[_0x4f7b('0xe')][_0x4e5862[_0x4f7b('0x23')]]){for(var _0xba46b8 in _0x4e5862[_0x4f7b('0x29')]){if(_0x4e5862[_0x4f7b('0x29')][_0x4f7b('0x20')](_0xba46b8)){this[_0x4f7b('0xe')][_0x4e5862[_0x4f7b('0x23')]][_0xba46b8]=_0x4e5862[_0x4f7b('0x2a')];}}}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x18')]=function(_0x42bf33){if(this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]]){this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]]['operation']=_0x42bf33[_0x4f7b('0x2e')];this['channels'][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x2f')]=_0x42bf33['status'];this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x22')]=_0x42bf33['localstationid'];this[_0x4f7b('0xe')][_0x42bf33[_0x4f7b('0x23')]][_0x4f7b('0x30')]=_0x42bf33[_0x4f7b('0x30')];logger[_0x4f7b('0x26')](_0x42bf33[_0x4f7b('0x23')],_0x4f7b('0x31'));}};Fax['prototype'][_0x4f7b('0x1a')]=function(_0x486187){var _0x26fe5b=this;if(this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]]){var _0x593ec2=this[_0x4f7b('0xe')][_0x486187['uniqueid']]['id'];this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]]['remotestationid']=_0x486187['remotestationid'];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x32')]=_0x486187[_0x4f7b('0x32')];this['channels'][_0x486187[_0x4f7b('0x23')]]['localstationid']=_0x486187['localstationid'];this['channels'][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x33')]=_0x486187[_0x4f7b('0x33')];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x34')]=_0x486187['transferrate'];this[_0x4f7b('0xe')][_0x486187['uniqueid']][_0x4f7b('0x30')]=_0x486187['filename'];this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x35')]=_0x486187[_0x4f7b('0x35')];if(this[_0x4f7b('0xe')][_0x486187[_0x4f7b('0x23')]][_0x4f7b('0x32')]>0x0){tiff2pdf(_0x486187[_0x4f7b('0x30')],_0x4f7b('0x36'),function(_0x1ed520){logger[_0x4f7b('0x26')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x37'),_0x1ed520[_0x4f7b('0x38')]);attachment[_0x4f7b('0x39')]({'name':path[_0x4f7b('0x3a')](_0x486187[_0x4f7b('0x30')])[_0x4f7b('0x25')],'basename':path['parse'](_0x486187['filename'])[_0x4f7b('0x25')]+_0x4f7b('0x3b'),'type':_0x4f7b('0x3c')})[_0x4f7b('0x3d')](function(_0x5bd517){faxAccount['notify'](_0x593ec2,{'from':_0x486187[_0x4f7b('0x35')],'mapKey':_0x4f7b('0x5'),'body':path[_0x4f7b('0x3a')](_0x486187[_0x4f7b('0x30')])['name']+'.pdf','AttachmentId':_0x5bd517['id']})[_0x4f7b('0x3e')](function(_0x201c2e){logger[_0x4f7b('0x3f')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x40'),JSON['stringify'](_0x201c2e));});})[_0x4f7b('0x3e')](function(_0x186e47){logger[_0x4f7b('0x3f')](_0x486187['uniqueid'],_0x4f7b('0x41'),JSON[_0x4f7b('0x42')](_0x186e47));});});}logger[_0x4f7b('0x26')](_0x486187[_0x4f7b('0x23')],_0x4f7b('0x41'));}};Fax[_0x4f7b('0x1f')][_0x4f7b('0x1e')]=function(_0x2e563f){if(this[_0x4f7b('0x11')][_0x2e563f[_0x4f7b('0x23')]]){_['merge'](this[_0x4f7b('0xe')][_0x2e563f[_0x4f7b('0x23')]],_[_0x4f7b('0x43')](_0x2e563f,['response',_0x4f7b('0x44')]));}};function updateStatus(_0x3faadf){if(_0x3faadf[_0x4f7b('0x45')]){faxMessage[_0x4f7b('0x46')](_0x3faadf[_0x4f7b('0x45')],{'failMessage':_0x4f7b('0x47')})[_0x4f7b('0x3d')](function(_0x141897){ut[_0x4f7b('0x48')](_0x4f7b('0x49'),_0x141897);})['catch'](function(_0x21fa9c){ut[_0x4f7b('0x48')](_0x4f7b('0x4a'),_0x21fa9c);});}else{ut['logger'](_0x4f7b('0x4b'));}}Fax[_0x4f7b('0x1f')][_0x4f7b('0x4c')]=function(_0xb92819,_0x3437a8,_0x819fb3){var _0x551c74=this;var _0x2de413={};if(_0x3437a8){_0x2de413={'read':_0x3437a8};}else{_0x2de413={'failMessage':_0x819fb3};}if(this[_0x4f7b('0x11')][_0xb92819][_0x4f7b('0x45')]){faxMessage['update'](this[_0x4f7b('0x11')][_0xb92819][_0x4f7b('0x45')],_0x2de413)[_0x4f7b('0x3d')](function(_0x3fb0d5){ut[_0x4f7b('0x48')](_0x4f7b('0x4d'),_0x3fb0d5);})['catch'](function(_0x13bb98){ut['logger']('[Fax][Message][NoUpdate1]',_0x13bb98);})['finally'](function(){delete _0x551c74[_0x4f7b('0xe')][_0xb92819];delete _0x551c74[_0x4f7b('0x11')][_0xb92819];});}else{ut[_0x4f7b('0x48')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0xb92819];delete this[_0x4f7b('0x11')][_0xb92819];}};Fax[_0x4f7b('0x1f')]['syncHangup']=function(_0xf957ca){var _0x3b0633=this;if(this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]){if(this['actions'][_0xf957ca[_0x4f7b('0x23')]]){this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['id']=this[_0x4f7b('0x11')][_0xf957ca[_0x4f7b('0x23')]]['id'];this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['name']=this['actions'][_0xf957ca['uniqueid']][_0x4f7b('0x25')];}logger['info'](_0xf957ca['uniqueid'],this['actions'][_0xf957ca['uniqueid']]?_0x4f7b('0x4e'):_0x4f7b('0x4f'),JSON[_0x4f7b('0x42')](this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]));if(this[_0x4f7b('0x11')][_0xf957ca[_0x4f7b('0x23')]]){if(this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x50')]>0x0&&this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x51')]===_0x4f7b('0x52')){this[_0x4f7b('0x4c')](_0xf957ca[_0x4f7b('0x23')],!![]);}else{this[_0x4f7b('0x4c')](_0xf957ca[_0x4f7b('0x23')],![],this['channels'][_0xf957ca[_0x4f7b('0x23')]][_0x4f7b('0x53')]?_0x4f7b('0x54')+this[_0x4f7b('0xe')][_0xf957ca[_0x4f7b('0x23')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x4f7b('0x1f')]['send']=function(_0x457ac5){var _0x384a08=this;return new BPromise(function(_0x167e9,_0x7509ab){_0x384a08['execOriginate'](_0x457ac5,_0x384a08[_0x4f7b('0xf')][_0x457ac5[_0x4f7b('0x55')]])[_0x4f7b('0x3d')](function(_0x58baa5){ut['logger']('[Fax][execOriginate][success]',_0x58baa5);_0x167e9(ut[_0x4f7b('0x38')]('Fax\x20received'));})['catch'](function(_0x4b33f5){ut[_0x4f7b('0x48')](_0x4f7b('0x56'),_0x4b33f5);updateStatus(_0x457ac5);_0x7509ab(ut[_0x4f7b('0x38')]('Fax\x20failed'));});});};Fax[_0x4f7b('0x1f')][_0x4f7b('0x57')]=function(_0x56b3c7){var _0x57874c=this;return new BPromise(function(_0x1911e1,_0x431857){var _0xa2017d=_0x57874c[_0x4f7b('0x58')](_0x57874c['faxAccounts'][_0x56b3c7[_0x4f7b('0x55')]][_0x4f7b('0x59')],_0x56b3c7);if(_0xa2017d[_0x4f7b('0x5a')]){_0x1911e1(ut[_0x4f7b('0x38')](_0x4f7b('0x5b')));}else{_0x431857(ut[_0x4f7b('0x38')](_0xa2017d['message']));}});};function originate(_0x1fa0fd,_0x79deaa,_0xa10c21){return new BPromise(function(_0x220f21,_0x1ca442){if(_0xa10c21){var _0x509763=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x25')],_0x1fa0fd[_0x4f7b('0x5c')]);gs[_0x4f7b('0x5d')](_0x509763)['then'](function(){_0x1fa0fd[_0x4f7b('0x5c')]=util[_0x4f7b('0x5e')](_0x4f7b('0x5f'),path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x60')],path[_0x4f7b('0x3a')](_0x1fa0fd[_0x4f7b('0x5c')])[_0x4f7b('0x25')]);_0x79deaa[_0x4f7b('0x61')]=_0x1fa0fd[_0x4f7b('0x5c')];ut[_0x4f7b('0x48')](_0x4f7b('0x62'),'');ami[_0x4f7b('0x63')](ut[_0x4f7b('0x64')](_0x1fa0fd,_0x79deaa))[_0x4f7b('0x3d')](function(_0xcb5f7e){_0x220f21(_0xcb5f7e);})[_0x4f7b('0x3e')](function(_0x531da6){_0x1ca442(_0x531da6);});})['catch'](function(_0x228029){_0x1ca442(_0x228029);});}else{ami[_0x4f7b('0x63')](ut[_0x4f7b('0x64')](_0x1fa0fd,_0x79deaa))[_0x4f7b('0x3d')](function(_0x503464){_0x220f21(_0x503464);})[_0x4f7b('0x3e')](function(_0x246aa6){_0x1ca442(_0x246aa6);});}});}Fax[_0x4f7b('0x1f')][_0x4f7b('0x65')]=function(_0x6989d1,_0x378587){var _0x3f4f5c=this;return new BPromise(function(_0x35d18a,_0x3ddd33){var _0x13f190=uuid['v4']();var _0x1ccec2=ut[_0x4f7b('0x66')](_0x6989d1,_0x378587);_0x3f4f5c[_0x4f7b('0x11')][_0x13f190]=new Action(_0x13f190,_0x378587,_0x6989d1);var _0x278d72=_0x3f4f5c[_0x4f7b('0x11')][_0x13f190];if(path['parse'](_0x6989d1[_0x4f7b('0x5c')])[_0x4f7b('0x67')]==='.pdf'){originate(_0x278d72,_0x1ccec2,!![])['then'](function(_0x45aced){_0x35d18a(_0x45aced);})[_0x4f7b('0x3e')](function(_0x3d25a6){_0x3ddd33(_0x3d25a6);});}else{originate(_0x278d72,_0x1ccec2,![])[_0x4f7b('0x3d')](function(_0x40e009){_0x35d18a(_0x40e009);})[_0x4f7b('0x3e')](function(_0x1f7692){_0x3ddd33(_0x1f7692);});}});};Fax['prototype']['isTrunkReachable']=function(_0x42bd6b){return!_[_0x4f7b('0x68')](_0x42bd6b)&&!_[_0x4f7b('0x68')](_0x42bd6b[_0x4f7b('0x25')])&&!_['isNil'](_0x42bd6b[_0x4f7b('0x69')])&&_0x42bd6b[_0x4f7b('0x69')]&&!_['isNil'](this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')]('SIP/%s',_0x42bd6b['name'])])&&!_[_0x4f7b('0x68')](this['trunks'][util['format']('SIP/%s',_0x42bd6b[_0x4f7b('0x25')])]['status'])&&(this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')](_0x4f7b('0x6a'),_0x42bd6b[_0x4f7b('0x25')])][_0x4f7b('0x2f')]===_0x4f7b('0x6b')||this[_0x4f7b('0x10')][util[_0x4f7b('0x5e')](_0x4f7b('0x6a'),_0x42bd6b['name'])][_0x4f7b('0x2f')]===_0x4f7b('0x6c'));};Fax[_0x4f7b('0x1f')][_0x4f7b('0x58')]=function(_0x3c36ce,_0x154343){if(!this[_0x4f7b('0x6d')](_0x3c36ce)){ut[_0x4f7b('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4f7b('0x68')](_0x3c36ce)?'':_0x3c36ce[_0x4f7b('0x25')]+_0x4f7b('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x4f7b('0x68')](_0x154343['fax'])){ut[_0x4f7b('0x48')](_0x4f7b('0x6f'),JSON['stringify'](_0x154343));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x4f7b('0x68')](_0x154343['path'])){ut[_0x4f7b('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x4f7b('0x42')](_0x154343));return{'isValid':![],'message':_0x4f7b('0x70')};}return{'isValid':!![],'message':_0x4f7b('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 53c9d71..59f867f 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 _0x6681=['resolve','then','catch','bluebird','lodash','../rpc/faxAccount','inspect','notify'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6681,0x193));var _0x1668=function(_0xb6937,_0x1df15d){_0xb6937=_0xb6937-0x0;var _0x18f663=_0x6681[_0xb6937];return _0x18f663;};'use strict';var util=require('util');var BPromise=require(_0x1668('0x0'));var logger=require('../../../config/logger')('preview');var _=require(_0x1668('0x1'));var faxAccount=require(_0x1668('0x2'));function loggerCatch(_0x4d2041){return function(_0x31e691){logger['error'](_0x4d2041,util[_0x1668('0x3')](_0x31e691,{'showHidden':![],'depth':null}));};}exports[_0x1668('0x4')]=function(_0x13ff80,_0x1c76b3){return BPromise[_0x1668('0x5')]()[_0x1668('0x6')](faxAccount[_0x1668('0x4')](_0x13ff80,_0x1c76b3))[_0x1668('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x8ae8=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','then','catch','[Notify]\x20','util'];(function(_0x1562df,_0x246fa8){var _0x30747c=function(_0x41f64b){while(--_0x41f64b){_0x1562df['push'](_0x1562df['shift']());}};_0x30747c(++_0x246fa8);}(_0x8ae8,0xc5));var _0x88ae=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x8ae8[_0x3fd3a3];return _0xa3e4d5;};'use strict';var util=require(_0x88ae('0x0'));var BPromise=require(_0x88ae('0x1'));var logger=require(_0x88ae('0x2'))(_0x88ae('0x3'));var _=require(_0x88ae('0x4'));var faxAccount=require(_0x88ae('0x5'));function loggerCatch(_0x4feac2){return function(_0x2ff144){logger[_0x88ae('0x6')](_0x4feac2,util[_0x88ae('0x7')](_0x2ff144,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x364f7f,_0x19a5c9){return BPromise['resolve']()[_0x88ae('0x8')](faxAccount['notify'](_0x364f7f,_0x19a5c9))[_0x88ae('0x9')](loggerCatch(_0x88ae('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index a3ae7e0..b028d8e 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 _0xc184=['child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x4a0395,_0x4d9d68){var _0x3c6c18=function(_0x1957b6){while(--_0x1957b6){_0x4a0395['push'](_0x4a0395['shift']());}};_0x3c6c18(++_0x4d9d68);}(_0xc184,0x1e9));var _0x4c18=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc184[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x4c18('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0x4c18('0x1'))['exec'];exports[_0x4c18('0x2')]=function(_0x15e2f5){return new BPromise(function(_0x353742,_0x66a75a){exec(_0x15e2f5,function(_0x59db6d,_0x4b0ea8,_0x24deda){logger[_0x4c18('0x3')](_0x4c18('0x4'),_0x4b0ea8);if(_0x59db6d){logger[_0x4c18('0x3')]('Exec\x20gs',_0x4c18('0x5'),util[_0x4c18('0x6')](_0x59db6d,{'showHidden':![],'depth':null}),_0x4b0ea8,_0x24deda);_0x66a75a(_0x59db6d);}_0x353742(_0x4b0ea8);});});}; \ No newline at end of file +var _0x77b9=['Exec\x20gs','\x20Error\x20:','inspect','util','fax','child_process','exec','info'];(function(_0x5051a5,_0x2f9368){var _0x8361f2=function(_0x1e7862){while(--_0x1e7862){_0x5051a5['push'](_0x5051a5['shift']());}};_0x8361f2(++_0x2f9368);}(_0x77b9,0x1eb));var _0x977b=function(_0x410f5c,_0x17b8e0){_0x410f5c=_0x410f5c-0x0;var _0x1c3476=_0x77b9[_0x410f5c];return _0x1c3476;};'use strict';var util=require(_0x977b('0x0'));var logger=require('../../../../config/logger')(_0x977b('0x1'));var BPromise=require('bluebird');var exec=require(_0x977b('0x2'))[_0x977b('0x3')];exports['execute']=function(_0x55aded){return new BPromise(function(_0xcc8a7d,_0x508797){exec(_0x55aded,function(_0x2c79a4,_0x392c5c,_0x3425bf){logger[_0x977b('0x4')](_0x977b('0x5'),_0x392c5c);if(_0x2c79a4){logger[_0x977b('0x4')]('Exec\x20gs',_0x977b('0x6'),util[_0x977b('0x7')](_0x2c79a4,{'showHidden':![],'depth':null}),_0x392c5c,_0x3425bf);_0x508797(_0x2c79a4);}_0xcc8a7d(_0x392c5c);});});}; \ 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 0b7fe71..b484673 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 _0x8536=['from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','logger','addVariables','ecm','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','xcally-motion-fax'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x8536,0xb3));var _0x6853=function(_0xcc0a45,_0x46bfd8){_0xcc0a45=_0xcc0a45-0x0;var _0x2ccf8a=_0x8536[_0xcc0a45];return _0x2ccf8a;};'use strict';var util=require(_0x6853('0x0'));var _=require(_0x6853('0x1'));var moment=require(_0x6853('0x2'));var logger=require(_0x6853('0x3'))('fax');exports['message']=function(_0x4a4d00){return{'message':_0x4a4d00};};exports[_0x6853('0x4')]=function(_0x5eb389,_0x204c3e){logger['info'](_0x5eb389,util['inspect'](_0x204c3e,{'showHidden':![],'depth':null}));};exports[_0x6853('0x5')]=function(_0x5ac643,_0x36a57f){var _0x283d3d={'XMF-ECM':_0x36a57f[_0x6853('0x6')],'XMF-HEADERINFO':_0x36a57f['headerinfo'],'XMF-MINRATE':_0x36a57f['minrate'],'XMF-MAXRATE':_0x36a57f[_0x6853('0x7')],'XMF-MODEM':util[_0x6853('0x8')](_0x6853('0x9'),_0x36a57f[_0x6853('0xa')]),'XMF-GATEWAY':_0x36a57f[_0x6853('0xb')],'XMF-FAXDETECT':_0x36a57f[_0x6853('0xc')],'XMF-T38TIMEOUT':_0x36a57f[_0x6853('0xd')],'XMF-LOCALSTATIONID':_0x36a57f[_0x6853('0xe')],'XMF-PATH':_0x5ac643[_0x6853('0xf')]};return _0x283d3d;};exports[_0x6853('0x10')]=function(_0x29daab,_0xc5c4e5){return{'actionid':_0x29daab[_0x6853('0x11')],'action':'originate','channel':_0x29daab['channel'],'Exten':_0x6853('0x12'),'Context':_0x6853('0x13'),'Priority':'1','callerid':util[_0x6853('0x8')](_0x6853('0x14'),_0x29daab[_0x6853('0x15')]?_0x29daab[_0x6853('0x15')]:'',_0x29daab[_0x6853('0xe')]),'variable':_0xc5c4e5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x29daab['uniqueid']};}; \ No newline at end of file +var _0x168d=['xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','originate','channel'];(function(_0x16f715,_0x4ad436){var _0x12c65e=function(_0x788a68){while(--_0x788a68){_0x16f715['push'](_0x16f715['shift']());}};_0x12c65e(++_0x4ad436);}(_0x168d,0x124));var _0xd168=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x168d[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xd168('0x0'));var _=require(_0xd168('0x1'));var moment=require('moment');var logger=require(_0xd168('0x2'))(_0xd168('0x3'));exports[_0xd168('0x4')]=function(_0x29907f){return{'message':_0x29907f};};exports[_0xd168('0x5')]=function(_0x1693aa,_0x18d176){logger[_0xd168('0x6')](_0x1693aa,util[_0xd168('0x7')](_0x18d176,{'showHidden':![],'depth':null}));};exports[_0xd168('0x8')]=function(_0x359063,_0x16e920){var _0x47a54f={'XMF-ECM':_0x16e920[_0xd168('0x9')],'XMF-HEADERINFO':_0x16e920['headerinfo'],'XMF-MINRATE':_0x16e920[_0xd168('0xa')],'XMF-MAXRATE':_0x16e920[_0xd168('0xb')],'XMF-MODEM':util[_0xd168('0xc')]('\x22%s\x22',_0x16e920[_0xd168('0xd')]),'XMF-GATEWAY':_0x16e920['gateway'],'XMF-FAXDETECT':_0x16e920[_0xd168('0xe')],'XMF-T38TIMEOUT':_0x16e920[_0xd168('0xf')],'XMF-LOCALSTATIONID':_0x16e920[_0xd168('0x10')],'XMF-PATH':_0x359063[_0xd168('0x11')]};return _0x47a54f;};exports['variablesAction']=function(_0x34cdee,_0x54597a){return{'actionid':_0x34cdee['uniqueid'],'action':_0xd168('0x12'),'channel':_0x34cdee[_0xd168('0x13')],'Exten':_0xd168('0x14'),'Context':_0xd168('0x15'),'Priority':'1','callerid':util['format'](_0xd168('0x16'),_0x34cdee['headerinfo']?_0x34cdee['headerinfo']:'',_0x34cdee[_0xd168('0x10')]),'variable':_0x54597a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x34cdee[_0xd168('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 41bb404..888125a 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 _0xcf10=['./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview'];(function(_0x32e80f,_0x3b1b92){var _0x8972df=function(_0x29767d){while(--_0x29767d){_0x32e80f['push'](_0x32e80f['shift']());}};_0x8972df(++_0x3b1b92);}(_0xcf10,0x164));var _0x0cf1=function(_0x2e47c1,_0x1bed12){_0x2e47c1=_0x2e47c1-0x0;var _0x1a0364=_0xcf10[_0x2e47c1];return _0x1a0364;};'use strict';var BPromise=require(_0x0cf1('0x0'));var util=require(_0x0cf1('0x1'));var moment=require('moment');var server=require(_0x0cf1('0x2'));var Realtime=require(_0x0cf1('0x3'));var Report=require(_0x0cf1('0x4'));var Acw=require(_0x0cf1('0x5'));var Trigger=require(_0x0cf1('0x6'));var Dialer=require(_0x0cf1('0x7'));var Preview=require(_0x0cf1('0x8'));var Fax=require(_0x0cf1('0x9'));var user=require('./rpc/user');var voiceQueue=require(_0x0cf1('0xa'));var voiceQueueReport=require(_0x0cf1('0xb'));var voiceCallReport=require(_0x0cf1('0xc'));var trunk=require(_0x0cf1('0xd'));var trigger=require(_0x0cf1('0xe'));var template=require(_0x0cf1('0xf'));var cmHopperHistory=require(_0x0cf1('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x0cf1('0x11'));var zendesk=require(_0x0cf1('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x0cf1('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0cf1('0x14'));var zoho=require(_0x0cf1('0x15'));var vtiger=require(_0x0cf1('0x16'));var freshsales=require(_0x0cf1('0x17'));var servicenow=require(_0x0cf1('0x18'));var dynamics365=require(_0x0cf1('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x0cf1('0x1a'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0cf1('0x1b')](_0x0cf1('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0cf1('0x1b')](_0x0cf1('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0cf1('0x1d')]()[_0x0cf1('0x1e')](user[_0x0cf1('0x1f')]())[_0x0cf1('0x1e')](realtime['initAgents']())['then'](user[_0x0cf1('0x20')]())[_0x0cf1('0x1e')](realtime['initTelephones']())['then'](trunk[_0x0cf1('0x21')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x22')]())[_0x0cf1('0x1e')](voiceQueue[_0x0cf1('0x23')]())[_0x0cf1('0x1e')](realtime['initVoiceQueues']())[_0x0cf1('0x1e')](trigger[_0x0cf1('0x24')]())['then'](realtime['initTriggers']())[_0x0cf1('0x1e')](template[_0x0cf1('0x25')]())[_0x0cf1('0x1e')](realtime['initTemplates']())[_0x0cf1('0x1e')](zendesk[_0x0cf1('0x26')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x27')]())['then'](salesforce[_0x0cf1('0x28')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x29')]())[_0x0cf1('0x1e')](sugarcrm[_0x0cf1('0x2a')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x2b')]())[_0x0cf1('0x1e')](freshdesk[_0x0cf1('0x2c')]())['then'](realtime[_0x0cf1('0x2d')]())[_0x0cf1('0x1e')](desk[_0x0cf1('0x2e')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x2f')]())[_0x0cf1('0x1e')](zoho[_0x0cf1('0x30')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x31')]())[_0x0cf1('0x1e')](vtiger[_0x0cf1('0x32')]())[_0x0cf1('0x1e')](realtime['initVtigerAccounts']())[_0x0cf1('0x1e')](freshsales[_0x0cf1('0x33')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x34')]())[_0x0cf1('0x1e')](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x0cf1('0x35')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x36')]())['then'](campaign[_0x0cf1('0x37')]())[_0x0cf1('0x1e')](realtime['initCampaigns']())['then'](voiceExtension[_0x0cf1('0x38')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x39')]())[_0x0cf1('0x1e')](faxAccount[_0x0cf1('0x3a')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x3b')]())[_0x0cf1('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x0cf1('0x1d')]()[_0x0cf1('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0x0cf1('0x1e')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x0cf1('0x3c')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x3d')]())[_0x0cf1('0x1e')](cmHopperHistory[_0x0cf1('0x3e')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x3f')]())[_0x0cf1('0x1e')](voiceCallReport[_0x0cf1('0x40')]())[_0x0cf1('0x1e')](realtime[_0x0cf1('0x41')]())[_0x0cf1('0x42')](function(_0x5850a4){logger['error'](_0x0cf1('0x43'),util[_0x0cf1('0x44')](_0x5850a4,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0cf1('0x45')](realtime,preview,fax)['then'](function(_0xb29606){return initRealtime();})[_0x0cf1('0x1e')](function(){return initParams();})[_0x0cf1('0x1e')](function(){report[_0x0cf1('0x46')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x21e91e){logger[_0x0cf1('0x47')](_0x0cf1('0x48'),util[_0x0cf1('0x44')](_0x21e91e,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe385=['getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xe385,0x1eb));var _0x5e38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe385[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x5e38('0x0'));var server=require('./server');var Realtime=require(_0x5e38('0x1'));var Report=require('./report');var Acw=require(_0x5e38('0x2'));var Trigger=require(_0x5e38('0x3'));var Dialer=require(_0x5e38('0x4'));var Preview=require(_0x5e38('0x5'));var Fax=require('./fax');var user=require(_0x5e38('0x6'));var voiceQueue=require(_0x5e38('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5e38('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0x5e38('0x9'));var template=require(_0x5e38('0xa'));var cmHopperHistory=require(_0x5e38('0xb'));var campaign=require(_0x5e38('0xc'));var voiceExtension=require(_0x5e38('0xd'));var faxAccount=require(_0x5e38('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5e38('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x5e38('0x10'));var vtiger=require(_0x5e38('0x11'));var freshsales=require(_0x5e38('0x12'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x5e38('0x13'));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(_0x5e38('0x14'))(_0x5e38('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5e38('0x16')](_0x5e38('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5e38('0x18')]()[_0x5e38('0x19')](user['getAgents']())[_0x5e38('0x19')](realtime[_0x5e38('0x1a')]())[_0x5e38('0x19')](user[_0x5e38('0x1b')]())['then'](realtime[_0x5e38('0x1c')]())['then'](trunk[_0x5e38('0x1d')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x5e38('0x1e')]())[_0x5e38('0x19')](realtime[_0x5e38('0x1f')]())[_0x5e38('0x19')](trigger[_0x5e38('0x20')]())['then'](realtime[_0x5e38('0x21')]())[_0x5e38('0x19')](template['getTemplates']())[_0x5e38('0x19')](realtime['initTemplates']())[_0x5e38('0x19')](zendesk[_0x5e38('0x22')]())[_0x5e38('0x19')](realtime['initZendeskAccounts']())[_0x5e38('0x19')](salesforce[_0x5e38('0x23')]())['then'](realtime[_0x5e38('0x24')]())['then'](sugarcrm[_0x5e38('0x25')]())[_0x5e38('0x19')](realtime[_0x5e38('0x26')]())[_0x5e38('0x19')](freshdesk['getFreshdeskAccounts']())[_0x5e38('0x19')](realtime[_0x5e38('0x27')]())[_0x5e38('0x19')](desk['getDeskAccounts']())[_0x5e38('0x19')](realtime[_0x5e38('0x28')]())['then'](zoho[_0x5e38('0x29')]())[_0x5e38('0x19')](realtime['initZohoAccounts']())[_0x5e38('0x19')](vtiger[_0x5e38('0x2a')]())[_0x5e38('0x19')](realtime[_0x5e38('0x2b')]())[_0x5e38('0x19')](freshsales['getFreshsalesAccounts']())[_0x5e38('0x19')](realtime['initFreshsalesAccounts']())[_0x5e38('0x19')](servicenow[_0x5e38('0x2c')]())[_0x5e38('0x19')](realtime[_0x5e38('0x2d')]())['then'](dynamics365[_0x5e38('0x2e')]())[_0x5e38('0x19')](realtime['initDynamics365Accounts']())[_0x5e38('0x19')](campaign[_0x5e38('0x2f')]())[_0x5e38('0x19')](realtime[_0x5e38('0x30')]())['then'](voiceExtension[_0x5e38('0x31')]())[_0x5e38('0x19')](realtime[_0x5e38('0x32')]())['then'](faxAccount[_0x5e38('0x33')]())[_0x5e38('0x19')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x5e38('0x18')]()['then'](voiceQueueReport[_0x5e38('0x34')]())[_0x5e38('0x19')](realtime[_0x5e38('0x35')]())['then'](cmHopperHistory[_0x5e38('0x36')]())[_0x5e38('0x19')](realtime[_0x5e38('0x37')]())['then'](cmHopperHistory[_0x5e38('0x38')]())[_0x5e38('0x19')](realtime['initCampaignHopperHistory']())[_0x5e38('0x19')](voiceCallReport[_0x5e38('0x39')]())[_0x5e38('0x19')](realtime[_0x5e38('0x3a')]())[_0x5e38('0x3b')](function(_0x51f7e7){logger[_0x5e38('0x3c')](_0x5e38('0x3d'),util[_0x5e38('0x3e')](_0x51f7e7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5e38('0x3f')](realtime,preview,fax)[_0x5e38('0x19')](function(_0x433601){return initRealtime();})[_0x5e38('0x19')](function(){return initParams();})['then'](function(){report[_0x5e38('0x40')]();setInterval(initRealtime,0x1388);})[_0x5e38('0x3b')](function(_0x24feae){logger[_0x5e38('0x3c')](_0x5e38('0x41'),util['inspect'](_0x24feae,{'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 dedf99d..e38a345 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x336708,_0x19d236){var _0x21a92f=function(_0x4e2faf){while(--_0x4e2faf){_0x336708['push'](_0x336708['shift']());}};_0x21a92f(++_0x19d236);}(_0x70e0,0x17b));var _0x070e=function(_0x5d7fa6,_0x26faa6){_0x5d7fa6=_0x5d7fa6-0x0;var _0x5ef826=_0x70e0[_0x5d7fa6];return _0x5ef826;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _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(_0x17f85f,_0x5c6ff9){var _0x38100a=function(_0x1dca1f){while(--_0x1dca1f){_0x17f85f['push'](_0x17f85f['shift']());}};_0x38100a(++_0x5c6ff9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 9848ce8..26b45ac 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 _0x6ec4=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','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','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','dialQueueProject','SquareProject'];(function(_0xd75b98,_0x15ad99){var _0xdd720e=function(_0x326b38){while(--_0x326b38){_0xd75b98['push'](_0xd75b98['shift']());}};_0xdd720e(++_0x15ad99);}(_0x6ec4,0x1cd));var _0x46ec=function(_0x3ae69f,_0x5c6d6e){_0x3ae69f=_0x3ae69f-0x0;var _0x9175bc=_0x6ec4[_0x3ae69f];return _0x9175bc;};'use strict';function Campaign(_0x5b90d8){this['id']=_0x5b90d8['id']||0x0;this[_0x46ec('0x0')]=_0x5b90d8[_0x46ec('0x0')]||'';this[_0x46ec('0x1')]=_0x5b90d8[_0x46ec('0x1')]||_0x46ec('0x2');this[_0x46ec('0x3')]=0x0;this[_0x46ec('0x4')]=0x0;this[_0x46ec('0x5')]=0x0;this[_0x46ec('0x6')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x46ec('0x7')]=_0x5b90d8['active'];this[_0x46ec('0x8')]=_0x5b90d8[_0x46ec('0x8')];this['dialTimezone']=_0x5b90d8[_0x46ec('0x9')]||null;this[_0x46ec('0xa')]=_0x5b90d8[_0x46ec('0xa')]?_0x5b90d8['dialGlobalInterval']:null;this[_0x46ec('0xb')]=_0x5b90d8[_0x46ec('0xb')];this[_0x46ec('0xc')]=_0x5b90d8[_0x46ec('0xc')];this[_0x46ec('0xd')]=_0x5b90d8['dialOriginateTimeout']||0x1e;this[_0x46ec('0xe')]=_0x5b90d8[_0x46ec('0xe')];this[_0x46ec('0xf')]=_0x5b90d8[_0x46ec('0xf')];this[_0x46ec('0x10')]=_0x5b90d8[_0x46ec('0x10')];this[_0x46ec('0x11')]=_0x5b90d8[_0x46ec('0x11')];this[_0x46ec('0x12')]=_0x5b90d8['dialNoAnswerMaxRetry'];this[_0x46ec('0x13')]=_0x5b90d8[_0x46ec('0x13')];this[_0x46ec('0x14')]=_0x5b90d8[_0x46ec('0x14')];this[_0x46ec('0x15')]=_0x5b90d8[_0x46ec('0x15')]||0x3;this[_0x46ec('0x16')]=_0x5b90d8[_0x46ec('0x16')]||0x96;this[_0x46ec('0x17')]=_0x5b90d8['dialDropMaxRetry']||0x3;this[_0x46ec('0x18')]=_0x5b90d8[_0x46ec('0x18')]||0x96;this[_0x46ec('0x19')]=_0x5b90d8['dialAbandonedMaxRetry']||0x3;this[_0x46ec('0x1a')]=_0x5b90d8[_0x46ec('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x5b90d8[_0x46ec('0x1b')]||0x3;this[_0x46ec('0x1c')]=_0x5b90d8[_0x46ec('0x1c')]||0x96;this[_0x46ec('0x1d')]=_0x5b90d8[_0x46ec('0x1d')]||0x3;this[_0x46ec('0x1e')]=_0x5b90d8['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x5b90d8[_0x46ec('0x1f')]||'DESC';this['dialPrefix']=_0x5b90d8['dialPrefix']||undefined;this[_0x46ec('0x20')]=_0x5b90d8['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x5b90d8[_0x46ec('0x21')]||undefined;this[_0x46ec('0x22')]=_0x5b90d8[_0x46ec('0x22')]?_0x5b90d8[_0x46ec('0x22')]:undefined;this['Trunk']=_0x5b90d8[_0x46ec('0x23')]?_0x5b90d8['Trunk']:undefined;this['Interval']=_0x5b90d8[_0x46ec('0x24')]?_0x5b90d8[_0x46ec('0x24')]:undefined;this['SquareProject']=_0x5b90d8['SquareProject']?_0x5b90d8['SquareProject']:undefined;this[_0x46ec('0x25')]=_0x5b90d8[_0x46ec('0x26')]?_0x5b90d8[_0x46ec('0x26')]['name']:undefined;this[_0x46ec('0x27')]=_0x5b90d8[_0x46ec('0x27')]||![];this[_0x46ec('0x28')]=_0x5b90d8[_0x46ec('0x28')];this[_0x46ec('0x29')]=_0x5b90d8[_0x46ec('0x29')];this[_0x46ec('0x2a')]=_0x5b90d8[_0x46ec('0x2a')];this[_0x46ec('0x2b')]=_0x5b90d8[_0x46ec('0x2b')];this[_0x46ec('0x2c')]=_0x5b90d8['dialAMDMinWordLength'];this[_0x46ec('0x2d')]=_0x5b90d8[_0x46ec('0x2d')];this[_0x46ec('0x2e')]=_0x5b90d8[_0x46ec('0x2e')];this[_0x46ec('0x2f')]=_0x5b90d8[_0x46ec('0x2f')];this[_0x46ec('0x30')]=_0x5b90d8[_0x46ec('0x30')];}module[_0x46ec('0x31')]=Campaign; \ No newline at end of file +var _0x7ffd=['dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x579a55,_0x40ea75){var _0x4c6fd2=function(_0xfdaf9d){while(--_0xfdaf9d){_0x579a55['push'](_0x579a55['shift']());}};_0x4c6fd2(++_0x40ea75);}(_0x7ffd,0x80));var _0xd7ff=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7ffd[_0x4f9b18];return _0x29f20c;};'use strict';function Campaign(_0x8d09f9){this['id']=_0x8d09f9['id']||0x0;this[_0xd7ff('0x0')]=_0x8d09f9[_0xd7ff('0x0')]||'';this[_0xd7ff('0x1')]=_0x8d09f9[_0xd7ff('0x1')]||'campaign';this['originated']=0x0;this[_0xd7ff('0x2')]=0x0;this[_0xd7ff('0x3')]=0x0;this[_0xd7ff('0x4')]=0x0;this[_0xd7ff('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xd7ff('0x6')]=_0x8d09f9['active'];this[_0xd7ff('0x7')]=_0x8d09f9['limitCalls'];this[_0xd7ff('0x8')]=_0x8d09f9['dialTimezone']||null;this[_0xd7ff('0x9')]=_0x8d09f9[_0xd7ff('0x9')]?_0x8d09f9[_0xd7ff('0x9')]:null;this[_0xd7ff('0xa')]=_0x8d09f9[_0xd7ff('0xa')];this[_0xd7ff('0xb')]=_0x8d09f9['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x8d09f9[_0xd7ff('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x8d09f9['dialCongestionMaxRetry'];this[_0xd7ff('0xd')]=_0x8d09f9[_0xd7ff('0xd')];this['dialBusyMaxRetry']=_0x8d09f9['dialBusyMaxRetry'];this[_0xd7ff('0xe')]=_0x8d09f9[_0xd7ff('0xe')];this[_0xd7ff('0xf')]=_0x8d09f9['dialNoAnswerMaxRetry'];this[_0xd7ff('0x10')]=_0x8d09f9[_0xd7ff('0x10')];this[_0xd7ff('0x11')]=_0x8d09f9[_0xd7ff('0x11')];this[_0xd7ff('0x12')]=_0x8d09f9[_0xd7ff('0x12')]||0x3;this[_0xd7ff('0x13')]=_0x8d09f9[_0xd7ff('0x13')]||0x96;this['dialDropMaxRetry']=_0x8d09f9[_0xd7ff('0x14')]||0x3;this['dialDropRetryFrequency']=_0x8d09f9['dialDropRetryFrequency']||0x96;this[_0xd7ff('0x15')]=_0x8d09f9[_0xd7ff('0x15')]||0x3;this[_0xd7ff('0x16')]=_0x8d09f9[_0xd7ff('0x16')]||0x96;this[_0xd7ff('0x17')]=_0x8d09f9[_0xd7ff('0x17')]||0x3;this['dialMachineRetryFrequency']=_0x8d09f9[_0xd7ff('0x18')]||0x96;this[_0xd7ff('0x19')]=_0x8d09f9[_0xd7ff('0x19')]||0x3;this[_0xd7ff('0x1a')]=_0x8d09f9[_0xd7ff('0x1a')]||0x96;this['dialOrderByScheduledAt']=_0x8d09f9[_0xd7ff('0x1b')]||'DESC';this[_0xd7ff('0x1c')]=_0x8d09f9['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x8d09f9[_0xd7ff('0x1d')]||undefined;this[_0xd7ff('0x1e')]=_0x8d09f9[_0xd7ff('0x1e')]||undefined;this['TrunkBackup']=_0x8d09f9[_0xd7ff('0x1f')]?_0x8d09f9[_0xd7ff('0x1f')]:undefined;this[_0xd7ff('0x20')]=_0x8d09f9[_0xd7ff('0x20')]?_0x8d09f9['Trunk']:undefined;this[_0xd7ff('0x21')]=_0x8d09f9['Interval']?_0x8d09f9[_0xd7ff('0x21')]:undefined;this[_0xd7ff('0x22')]=_0x8d09f9[_0xd7ff('0x22')]?_0x8d09f9[_0xd7ff('0x22')]:undefined;this[_0xd7ff('0x23')]=_0x8d09f9[_0xd7ff('0x22')]?_0x8d09f9[_0xd7ff('0x22')][_0xd7ff('0x0')]:undefined;this[_0xd7ff('0x24')]=_0x8d09f9[_0xd7ff('0x24')]||![];this['dialAMDInitialSilence']=_0x8d09f9[_0xd7ff('0x25')];this[_0xd7ff('0x26')]=_0x8d09f9[_0xd7ff('0x26')];this[_0xd7ff('0x27')]=_0x8d09f9['dialAMDAfterGreetingSilence'];this[_0xd7ff('0x28')]=_0x8d09f9[_0xd7ff('0x28')];this[_0xd7ff('0x29')]=_0x8d09f9['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x8d09f9[_0xd7ff('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x8d09f9[_0xd7ff('0x2b')];this[_0xd7ff('0x2c')]=_0x8d09f9['dialAMDSilenceThreshold'];this[_0xd7ff('0x2d')]=_0x8d09f9[_0xd7ff('0x2d')];}module[_0xd7ff('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 5477fd1..6506b44 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 _0xd004=['monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','exten','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor'];(function(_0x243ed0,_0x416419){var _0x551a9b=function(_0x2c08ae){while(--_0x2c08ae){_0x243ed0['push'](_0x243ed0['shift']());}};_0x551a9b(++_0x416419);}(_0xd004,0x181));var _0x4d00=function(_0x3c7869,_0x207240){_0x3c7869=_0x3c7869-0x0;var _0x23bc0b=_0xd004[_0x3c7869];return _0x23bc0b;};'use strict';function Channel(){this[_0x4d00('0x0')]=null;this[_0x4d00('0x1')]='';this[_0x4d00('0x2')]='';this[_0x4d00('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x4d00('0x4')]=undefined;this[_0x4d00('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x4d00('0x6')]=0x0;this['answered']=![];this['answertime']=null;this[_0x4d00('0x7')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x4d00('0x8')]='';this[_0x4d00('0x9')]='';this[_0x4d00('0xa')]=0x0;this[_0x4d00('0xb')]=0x0;this[_0x4d00('0xc')]=0x0;this['type']=null;this[_0x4d00('0xd')]=null;this['disposition']=null;this[_0x4d00('0xe')]=![];this[_0x4d00('0xf')]=null;this['queue']=null;this[_0x4d00('0x10')]=[];this[_0x4d00('0x11')]=undefined;this[_0x4d00('0x12')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x4d00('0x13')]=Channel; \ No newline at end of file +var _0xd6cb=['linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','duration','type','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x39dbc3,_0x5adc70){var _0x28b160=function(_0x5b1e8d){while(--_0x5b1e8d){_0x39dbc3['push'](_0x39dbc3['shift']());}};_0x28b160(++_0x5adc70);}(_0xd6cb,0x1cb));var _0xbd6c=function(_0x45b9bd,_0x42b7e0){_0x45b9bd=_0x45b9bd-0x0;var _0x6b5a3b=_0xd6cb[_0x45b9bd];return _0x6b5a3b;};'use strict';function Channel(){this[_0xbd6c('0x0')]=null;this[_0xbd6c('0x1')]='';this[_0xbd6c('0x2')]='';this[_0xbd6c('0x3')]=0x0;this[_0xbd6c('0x4')]='';this[_0xbd6c('0x5')]=undefined;this[_0xbd6c('0x6')]=undefined;this[_0xbd6c('0x7')]=0x0;this[_0xbd6c('0x8')]='';this['uniqueid']=0x0;this[_0xbd6c('0x9')]=0x0;this[_0xbd6c('0xa')]=0x0;this[_0xbd6c('0xb')]=![];this[_0xbd6c('0xc')]=null;this[_0xbd6c('0xd')]=null;this[_0xbd6c('0xe')]=![];this['abandoned']=![];this[_0xbd6c('0xf')]='';this['lastdata']='';this[_0xbd6c('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xbd6c('0x11')]=null;this['tag']=null;this[_0xbd6c('0x12')]=null;this[_0xbd6c('0x13')]=![];this[_0xbd6c('0x14')]=null;this['queue']=null;this[_0xbd6c('0x15')]=[];this[_0xbd6c('0x16')]=undefined;this[_0xbd6c('0x17')]=undefined;this['transferType']=undefined;this[_0xbd6c('0x18')]=0x0;}module[_0xbd6c('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 02099e7..ecfcf6c 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 _0x2a41=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x824626,_0x590cd4){var _0x7247cb=function(_0x18b0b9){while(--_0x18b0b9){_0x824626['push'](_0x824626['shift']());}};_0x7247cb(++_0x590cd4);}(_0x2a41,0x17b));var _0x12a4=function(_0x5c9f7f,_0x1c0566){_0x5c9f7f=_0x5c9f7f-0x0;var _0x40a79b=_0x2a41[_0x5c9f7f];return _0x40a79b;};'use strict';function DeskAccount(_0x1b1a53){this['id']=_0x1b1a53['id']||0x0;this[_0x12a4('0x0')]=_0x1b1a53[_0x12a4('0x0')]||'';this[_0x12a4('0x1')]=_0x1b1a53[_0x12a4('0x1')]||'';this[_0x12a4('0x2')]=_0x1b1a53[_0x12a4('0x2')]||'';this['authType']=_0x1b1a53[_0x12a4('0x3')]||'';this[_0x12a4('0x4')]=_0x1b1a53[_0x12a4('0x4')]||'';this[_0x12a4('0x5')]=_0x1b1a53['consumerKey']||'';this[_0x12a4('0x6')]=_0x1b1a53[_0x12a4('0x6')]||'';this[_0x12a4('0x7')]=_0x1b1a53[_0x12a4('0x7')]||'';this[_0x12a4('0x8')]=_0x1b1a53['tokenSecret']||'';this[_0x12a4('0x9')]=_0x1b1a53[_0x12a4('0x9')]||'';this[_0x12a4('0xa')]=_0x1b1a53[_0x12a4('0xa')]||'';this[_0x12a4('0xb')]=_0x1b1a53[_0x12a4('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xd8e2=['Configurations','exports','name','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xd8e2,0x1ca));var _0x2d8e=function(_0x2bde9f,_0x3ccd1b){_0x2bde9f=_0x2bde9f-0x0;var _0x3e8886=_0xd8e2[_0x2bde9f];return _0x3e8886;};'use strict';function DeskAccount(_0x50c717){this['id']=_0x50c717['id']||0x0;this[_0x2d8e('0x0')]=_0x50c717[_0x2d8e('0x0')]||'';this[_0x2d8e('0x1')]=_0x50c717[_0x2d8e('0x1')]||'';this['remoteUri']=_0x50c717['remoteUri']||'';this[_0x2d8e('0x2')]=_0x50c717[_0x2d8e('0x2')]||'';this[_0x2d8e('0x3')]=_0x50c717['password']||'';this[_0x2d8e('0x4')]=_0x50c717[_0x2d8e('0x4')]||'';this[_0x2d8e('0x5')]=_0x50c717[_0x2d8e('0x5')]||'';this['token']=_0x50c717[_0x2d8e('0x6')]||'';this['tokenSecret']=_0x50c717[_0x2d8e('0x7')]||'';this[_0x2d8e('0x8')]=_0x50c717[_0x2d8e('0x8')]||'';this[_0x2d8e('0x9')]=_0x50c717['serverUrl']||'';this[_0x2d8e('0xa')]=_0x50c717[_0x2d8e('0xa')]||{};}module[_0x2d8e('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 03a11db..37aaeb8 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 _0x087b=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x2c4b84,_0x389b25){var _0x611001=function(_0x4bdc58){while(--_0x4bdc58){_0x2c4b84['push'](_0x2c4b84['shift']());}};_0x611001(++_0x389b25);}(_0x087b,0x11a));var _0xb087=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x087b[_0x263a74];return _0x2aa86c;};'use strict';function Dynamics365Account(_0x534915){this['id']=_0x534915['id']||0x0;this[_0xb087('0x0')]=_0x534915['name']||'';this['username']=_0x534915[_0xb087('0x1')]||'';this['password']=_0x534915[_0xb087('0x2')]||'';this[_0xb087('0x3')]=_0x534915[_0xb087('0x3')]||'';this[_0xb087('0x4')]=_0x534915[_0xb087('0x4')]||'';this[_0xb087('0x5')]=_0x534915[_0xb087('0x5')]||'';this[_0xb087('0x6')]=_0x534915[_0xb087('0x6')]||{};this[_0xb087('0x7')]=_0x534915[_0xb087('0x7')]||'';this[_0xb087('0x8')]=_0x534915[_0xb087('0x8')]||{};}module[_0xb087('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x6e6c=['clientSecret','serverUrl','Configurations','name','username','remoteUri','tenantId','clientId'];(function(_0x4a6d0,_0x3341a2){var _0x5346b6=function(_0x5be87a){while(--_0x5be87a){_0x4a6d0['push'](_0x4a6d0['shift']());}};_0x5346b6(++_0x3341a2);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6e6c[_0x397e5f];return _0x5302b8;};'use strict';function Dynamics365Account(_0xc51915){this['id']=_0xc51915['id']||0x0;this[_0xc6e6('0x0')]=_0xc51915['name']||'';this[_0xc6e6('0x1')]=_0xc51915[_0xc6e6('0x1')]||'';this['password']=_0xc51915['password']||'';this[_0xc6e6('0x2')]=_0xc51915['remoteUri']||'';this[_0xc6e6('0x3')]=_0xc51915['tenantId']||'';this[_0xc6e6('0x4')]=_0xc51915[_0xc6e6('0x4')]||'';this['clientSecret']=_0xc51915[_0xc6e6('0x5')]||{};this[_0xc6e6('0x6')]=_0xc51915['serverUrl']||'';this[_0xc6e6('0x7')]=_0xc51915[_0xc6e6('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 7dd5d87..88583cf 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 _0xbd67=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbd67,0x113));var _0x7bd6=function(_0x5edafc,_0x22002c){_0x5edafc=_0x5edafc-0x0;var _0x1fa600=_0xbd67[_0x5edafc];return _0x1fa600;};'use strict';function FaxAccount(_0x45f1f5){this['id']=_0x45f1f5['id']||0x0;this['name']=_0x45f1f5[_0x7bd6('0x0')]||'';this[_0x7bd6('0x1')]=_0x45f1f5[_0x7bd6('0x1')];this[_0x7bd6('0x2')]=_0x45f1f5[_0x7bd6('0x2')];this[_0x7bd6('0x3')]=_0x45f1f5[_0x7bd6('0x3')];this[_0x7bd6('0x4')]=_0x45f1f5[_0x7bd6('0x4')];this[_0x7bd6('0x5')]=_0x45f1f5[_0x7bd6('0x5')]||0x960;this['maxrate']=_0x45f1f5[_0x7bd6('0x6')]||0x3840;this[_0x7bd6('0x7')]=_0x45f1f5['modem']||_0x7bd6('0x8');this[_0x7bd6('0x9')]=_0x45f1f5[_0x7bd6('0x9')]||'no';this[_0x7bd6('0xa')]=_0x45f1f5['faxdetect']||'no';this[_0x7bd6('0xb')]=_0x45f1f5[_0x7bd6('0xb')]||0x1388;this[_0x7bd6('0xc')]=_0x45f1f5[_0x7bd6('0xc')]||_0x7bd6('0xd');this[_0x7bd6('0xe')]=_0x45f1f5['Trunk']?_0x45f1f5[_0x7bd6('0xe')]:undefined;this[_0x7bd6('0xf')]=_0x45f1f5['ListId'];this[_0x7bd6('0x10')]=_0x45f1f5[_0x7bd6('0x10')];}module[_0x7bd6('0x11')]=FaxAccount; \ No newline at end of file +var _0x3eab=['key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x51aa6c,_0xbc0c5c){var _0x17e875=function(_0xfa43){while(--_0xfa43){_0x51aa6c['push'](_0x51aa6c['shift']());}};_0x17e875(++_0xbc0c5c);}(_0x3eab,0x102));var _0xb3ea=function(_0x4a3649,_0xd1dd6){_0x4a3649=_0x4a3649-0x0;var _0x563f9e=_0x3eab[_0x4a3649];return _0x563f9e;};'use strict';function FaxAccount(_0x24968e){this['id']=_0x24968e['id']||0x0;this[_0xb3ea('0x0')]=_0x24968e[_0xb3ea('0x0')]||'';this['description']=_0x24968e['description'];this['ecm']=_0x24968e[_0xb3ea('0x1')];this['headerinfo']=_0x24968e[_0xb3ea('0x2')];this[_0xb3ea('0x3')]=_0x24968e['localstationid'];this['minrate']=_0x24968e[_0xb3ea('0x4')]||0x960;this[_0xb3ea('0x5')]=_0x24968e[_0xb3ea('0x5')]||0x3840;this[_0xb3ea('0x6')]=_0x24968e[_0xb3ea('0x6')]||'v17,v27,v29';this[_0xb3ea('0x7')]=_0x24968e[_0xb3ea('0x7')]||'no';this['faxdetect']=_0x24968e[_0xb3ea('0x8')]||'no';this[_0xb3ea('0x9')]=_0x24968e['t38timeout']||0x1388;this[_0xb3ea('0xa')]=_0x24968e['tech']||_0xb3ea('0xb');this[_0xb3ea('0xc')]=_0x24968e['Trunk']?_0x24968e[_0xb3ea('0xc')]:undefined;this[_0xb3ea('0xd')]=_0x24968e[_0xb3ea('0xd')];this[_0xb3ea('0xe')]=_0x24968e[_0xb3ea('0xe')];}module[_0xb3ea('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fcca609..ae242bf 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 _0xe5ff=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xe5ff,0x87));var _0xfe5f=function(_0x23cfaf,_0x1d8545){_0x23cfaf=_0x23cfaf-0x0;var _0xf8af44=_0xe5ff[_0x23cfaf];return _0xf8af44;};'use strict';function FreshdeskAccount(_0x2ed425){this['id']=_0x2ed425['id']||0x0;this['name']=_0x2ed425[_0xfe5f('0x0')]||'';this[_0xfe5f('0x1')]=_0x2ed425[_0xfe5f('0x1')]||'';this[_0xfe5f('0x2')]=_0x2ed425[_0xfe5f('0x3')]||'';this[_0xfe5f('0x4')]=_0x2ed425[_0xfe5f('0x4')]||'';this[_0xfe5f('0x5')]=_0x2ed425[_0xfe5f('0x5')]||'';this[_0xfe5f('0x6')]=_0x2ed425[_0xfe5f('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x90d4=['remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x90d4,0x123));var _0x490d=function(_0x20d826,_0x4555a2){_0x20d826=_0x20d826-0x0;var _0x4ddae5=_0x90d4[_0x20d826];return _0x4ddae5;};'use strict';function FreshdeskAccount(_0x427d9f){this['id']=_0x427d9f['id']||0x0;this[_0x490d('0x0')]=_0x427d9f[_0x490d('0x0')]||'';this[_0x490d('0x1')]=_0x427d9f[_0x490d('0x1')]||'';this[_0x490d('0x2')]=_0x427d9f['token']||'';this[_0x490d('0x3')]=_0x427d9f[_0x490d('0x3')]||'';this['serverUrl']=_0x427d9f[_0x490d('0x4')]||'';this['Configurations']=_0x427d9f['Configurations']||{};}module[_0x490d('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index ccc8fe9..b3117c8 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 _0x1c75=['serverUrl','Configurations','exports','username','apiKey','token','remoteUri'];(function(_0x1be10a,_0x28b117){var _0x398e43=function(_0x4ec4f2){while(--_0x4ec4f2){_0x1be10a['push'](_0x1be10a['shift']());}};_0x398e43(++_0x28b117);}(_0x1c75,0xce));var _0x51c7=function(_0x35201e,_0x34341b){_0x35201e=_0x35201e-0x0;var _0x4bc5b7=_0x1c75[_0x35201e];return _0x4bc5b7;};'use strict';function FreshsalesAccount(_0x2f5319){this['id']=_0x2f5319['id']||0x0;this['name']=_0x2f5319['name']||'';this['username']=_0x2f5319[_0x51c7('0x0')]||'';this[_0x51c7('0x1')]=_0x2f5319[_0x51c7('0x2')]||'';this[_0x51c7('0x3')]=_0x2f5319[_0x51c7('0x3')]||'';this[_0x51c7('0x4')]=_0x2f5319[_0x51c7('0x4')]||'';this[_0x51c7('0x5')]=_0x2f5319[_0x51c7('0x5')]||{};}module[_0x51c7('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xd3e3=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x40a061,_0x196a92){_0x40a061=_0x40a061-0x0;var _0x1ebafc=_0xd3e3[_0x40a061];return _0x1ebafc;};'use strict';function FreshsalesAccount(_0x41fc16){this['id']=_0x41fc16['id']||0x0;this[_0x3d3e('0x0')]=_0x41fc16[_0x3d3e('0x0')]||'';this[_0x3d3e('0x1')]=_0x41fc16['username']||'';this[_0x3d3e('0x2')]=_0x41fc16[_0x3d3e('0x3')]||'';this['remoteUri']=_0x41fc16[_0x3d3e('0x4')]||'';this[_0x3d3e('0x5')]=_0x41fc16['serverUrl']||'';this[_0x3d3e('0x6')]=_0x41fc16[_0x3d3e('0x6')]||{};}module[_0x3d3e('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 34481d4..aab227e 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 _0x1601=['assigned','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime'];(function(_0x120cf2,_0x4d24a5){var _0x4bdd6c=function(_0x4e86c3){while(--_0x4e86c3){_0x120cf2['push'](_0x120cf2['shift']());}};_0x4bdd6c(++_0x4d24a5);}(_0x1601,0x1cf));var _0x1160=function(_0x49c640,_0x548ccf){_0x49c640=_0x49c640-0x0;var _0xb21b73=_0x1601[_0x49c640];return _0xb21b73;};'use strict';function QueueReport(){this[_0x1160('0x0')]=_0x1160('0x1');this[_0x1160('0x2')]='';this['calleridnum']='';this[_0x1160('0x3')]='';this[_0x1160('0x4')]='';this[_0x1160('0x5')]=null;this[_0x1160('0x6')]=null;this[_0x1160('0x7')]=0x1;this[_0x1160('0x8')]=0x1;this[_0x1160('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x1160('0xa')]=![];this[_0x1160('0xb')]=null;this[_0x1160('0xc')]=![];this[_0x1160('0xd')]=null;this['originalposition']=0x1;this[_0x1160('0xe')]='';this[_0x1160('0xf')]='';this[_0x1160('0x10')]='';this[_0x1160('0x11')]='';this[_0x1160('0x12')]='';this['exten']='';this[_0x1160('0x13')]='';this[_0x1160('0x14')]=0x0;this[_0x1160('0x15')]=![];this['lastAssignedTo']='';this['motionChannel']='voice';this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x95cc=['mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','lastAssignedTo'];(function(_0x16affa,_0x4b64f2){var _0x50ce36=function(_0x8db4){while(--_0x8db4){_0x16affa['push'](_0x16affa['shift']());}};_0x50ce36(++_0x4b64f2);}(_0x95cc,0x178));var _0xc95c=function(_0x398f31,_0x2e7b98){_0x398f31=_0x398f31-0x0;var _0x38a6cd=_0x95cc[_0x398f31];return _0x38a6cd;};'use strict';function QueueReport(){this[_0xc95c('0x0')]=_0xc95c('0x1');this[_0xc95c('0x2')]='';this[_0xc95c('0x3')]='';this[_0xc95c('0x4')]='';this['queue']='';this[_0xc95c('0x5')]=null;this[_0xc95c('0x6')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xc95c('0x7')]=null;this[_0xc95c('0x8')]=![];this[_0xc95c('0x9')]=null;this['queuecallerexit']=![];this[_0xc95c('0xa')]=null;this[_0xc95c('0xb')]=0x1;this[_0xc95c('0xc')]='';this[_0xc95c('0xd')]='';this['connectedlinename']='';this[_0xc95c('0xe')]='';this[_0xc95c('0xf')]='';this[_0xc95c('0x10')]='';this[_0xc95c('0x11')]='';this[_0xc95c('0x12')]=0x0;this['assigned']=![];this[_0xc95c('0x13')]='';this['motionChannel']='voice';this[_0xc95c('0x14')]=0x0;this['variables']={};}module[_0xc95c('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 41217c1..36f318c 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 _0x4adb=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x200361,_0x303662){var _0x36ccc0=function(_0x54888a){while(--_0x54888a){_0x200361['push'](_0x200361['shift']());}};_0x36ccc0(++_0x303662);}(_0x4adb,0x169));var _0xb4ad=function(_0x17d462,_0x4c45d7){_0x17d462=_0x17d462-0x0;var _0x4ec953=_0x4adb[_0x17d462];return _0x4ec953;};'use strict';function SalesforceAccount(_0x9c1a76){this['id']=_0x9c1a76['id']||0x0;this[_0xb4ad('0x0')]=_0x9c1a76[_0xb4ad('0x0')]||'';this['username']=_0x9c1a76[_0xb4ad('0x1')]||'';this['remoteUri']=_0x9c1a76[_0xb4ad('0x2')]||'';this[_0xb4ad('0x3')]=_0x9c1a76['password']||'';this[_0xb4ad('0x4')]=_0x9c1a76[_0xb4ad('0x4')]||'';this[_0xb4ad('0x5')]=_0x9c1a76[_0xb4ad('0x5')]||'';this[_0xb4ad('0x6')]=_0x9c1a76[_0xb4ad('0x6')]||'';this[_0xb4ad('0x7')]=_0x9c1a76['type']||_0xb4ad('0x8');this['serverUrl']=_0x9c1a76[_0xb4ad('0x9')]||'';this[_0xb4ad('0xa')]=_0x9c1a76[_0xb4ad('0xa')]||{};}module[_0xb4ad('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x56c0=['name','username','password','clientId','clientSecret','securityToken','type','Configurations'];(function(_0x305f1c,_0xd99a33){var _0x178f45=function(_0xbb152){while(--_0xbb152){_0x305f1c['push'](_0x305f1c['shift']());}};_0x178f45(++_0xd99a33);}(_0x56c0,0x68));var _0x056c=function(_0x41fcea,_0x83311b){_0x41fcea=_0x41fcea-0x0;var _0x465542=_0x56c0[_0x41fcea];return _0x465542;};'use strict';function SalesforceAccount(_0x2957df){this['id']=_0x2957df['id']||0x0;this[_0x056c('0x0')]=_0x2957df['name']||'';this[_0x056c('0x1')]=_0x2957df['username']||'';this['remoteUri']=_0x2957df['remoteUri']||'';this[_0x056c('0x2')]=_0x2957df[_0x056c('0x2')]||'';this['clientId']=_0x2957df[_0x056c('0x3')]||'';this['clientSecret']=_0x2957df[_0x056c('0x4')]||'';this[_0x056c('0x5')]=_0x2957df[_0x056c('0x5')]||'';this[_0x056c('0x6')]=_0x2957df[_0x056c('0x6')]||'integrationTab';this['serverUrl']=_0x2957df['serverUrl']||'';this['Configurations']=_0x2957df[_0x056c('0x7')]||{};}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 cf9e926..dce8c1d 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 _0x8d26=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x3eaa91,_0x41d1f3){var _0x1aa5f5=function(_0x58e61a){while(--_0x58e61a){_0x3eaa91['push'](_0x3eaa91['shift']());}};_0x1aa5f5(++_0x41d1f3);}(_0x8d26,0xa3));var _0x68d2=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x8d26[_0x343090];return _0x3ff3e8;};'use strict';function ServicenowAccount(_0x36161a){this['id']=_0x36161a['id']||0x0;this[_0x68d2('0x0')]=_0x36161a['name']||'';this['username']=_0x36161a[_0x68d2('0x1')]||'';this['password']=_0x36161a[_0x68d2('0x2')]||'';this[_0x68d2('0x3')]=_0x36161a['remoteUri']||'';this[_0x68d2('0x4')]=_0x36161a[_0x68d2('0x4')]||'';this[_0x68d2('0x5')]=_0x36161a[_0x68d2('0x5')]||{};}module[_0x68d2('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x3839=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4beb21,_0x515cd4){var _0x11def6=function(_0x149134){while(--_0x149134){_0x4beb21['push'](_0x4beb21['shift']());}};_0x11def6(++_0x515cd4);}(_0x3839,0x14c));var _0x9383=function(_0x44a9f3,_0xc691f5){_0x44a9f3=_0x44a9f3-0x0;var _0x5e4548=_0x3839[_0x44a9f3];return _0x5e4548;};'use strict';function ServicenowAccount(_0x3ca7f2){this['id']=_0x3ca7f2['id']||0x0;this[_0x9383('0x0')]=_0x3ca7f2[_0x9383('0x0')]||'';this['username']=_0x3ca7f2[_0x9383('0x1')]||'';this['password']=_0x3ca7f2[_0x9383('0x2')]||'';this[_0x9383('0x3')]=_0x3ca7f2[_0x9383('0x3')]||'';this[_0x9383('0x4')]=_0x3ca7f2[_0x9383('0x4')]||'';this[_0x9383('0x5')]=_0x3ca7f2['Configurations']||{};}module[_0x9383('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 4ff9ade..4ec0623 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 _0xa40b=['serverUrl','Configurations','username','password','remoteUri'];(function(_0x1c0e7a,_0x1f92dd){var _0xb96f7f=function(_0x4d3497){while(--_0x4d3497){_0x1c0e7a['push'](_0x1c0e7a['shift']());}};_0xb96f7f(++_0x1f92dd);}(_0xa40b,0x147));var _0xba40=function(_0x43217e,_0x57b23f){_0x43217e=_0x43217e-0x0;var _0x41e042=_0xa40b[_0x43217e];return _0x41e042;};'use strict';function SugarcrmAccount(_0xec5b21){this['id']=_0xec5b21['id']||0x0;this['name']=_0xec5b21['name']||'';this[_0xba40('0x0')]=_0xec5b21[_0xba40('0x0')]||'';this[_0xba40('0x1')]=_0xec5b21['password']||'';this[_0xba40('0x2')]=_0xec5b21[_0xba40('0x2')]||'';this[_0xba40('0x3')]=_0xec5b21[_0xba40('0x3')]||'';this['Configurations']=_0xec5b21[_0xba40('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x6bfc=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x24c1c8,_0x414f30){var _0x38aae7=function(_0x2be9de){while(--_0x2be9de){_0x24c1c8['push'](_0x24c1c8['shift']());}};_0x38aae7(++_0x414f30);}(_0x6bfc,0xac));var _0xc6bf=function(_0x213142,_0x6f0aa6){_0x213142=_0x213142-0x0;var _0x428267=_0x6bfc[_0x213142];return _0x428267;};'use strict';function SugarcrmAccount(_0xe8df6d){this['id']=_0xe8df6d['id']||0x0;this[_0xc6bf('0x0')]=_0xe8df6d[_0xc6bf('0x0')]||'';this[_0xc6bf('0x1')]=_0xe8df6d['username']||'';this[_0xc6bf('0x2')]=_0xe8df6d['password']||'';this[_0xc6bf('0x3')]=_0xe8df6d[_0xc6bf('0x3')]||'';this[_0xc6bf('0x4')]=_0xe8df6d[_0xc6bf('0x4')]||'';this[_0xc6bf('0x5')]=_0xe8df6d[_0xc6bf('0x5')]||{};}module[_0xc6bf('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 3069f02..6b40e18 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 _0x5525=['accountcode','state','unknown','status','exports','name'];(function(_0x2223f8,_0x298c34){var _0x17dd25=function(_0x28b3d1){while(--_0x28b3d1){_0x2223f8['push'](_0x2223f8['shift']());}};_0x17dd25(++_0x298c34);}(_0x5525,0xd1));var _0x5552=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5525[_0x122ef9];return _0x42fba0;};'use strict';function Telephone(_0xc036cc){this['id']=_0xc036cc['id']||0x0;this[_0x5552('0x0')]=_0xc036cc[_0x5552('0x0')]||'';this[_0x5552('0x1')]=_0xc036cc[_0x5552('0x1')]||'';this[_0x5552('0x2')]=_0x5552('0x3');this['stateTime']=0x0;this[_0x5552('0x4')]=_0x5552('0x3');this['address']='';}module[_0x5552('0x5')]=Telephone; \ No newline at end of file +var _0x96cc=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x96cc,0x16c));var _0xc96c=function(_0x2e1ac8,_0x4bb931){_0x2e1ac8=_0x2e1ac8-0x0;var _0x342e6a=_0x96cc[_0x2e1ac8];return _0x342e6a;};'use strict';function Telephone(_0x540e05){this['id']=_0x540e05['id']||0x0;this['name']=_0x540e05[_0xc96c('0x0')]||'';this['accountcode']=_0x540e05[_0xc96c('0x1')]||'';this[_0xc96c('0x2')]=_0xc96c('0x3');this[_0xc96c('0x4')]=0x0;this[_0xc96c('0x5')]=_0xc96c('0x3');this[_0xc96c('0x6')]='';}module[_0xc96c('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index f6ed73a..3a4658e 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(_0xd4dc0c,_0x244e72){var _0x57ca4d=function(_0x244e46){while(--_0x244e46){_0xd4dc0c['push'](_0xd4dc0c['shift']());}};_0x57ca4d(++_0x244e72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x51ae3f,_0x257dd2){var _0x50c23=function(_0x22f32f){while(--_0x22f32f){_0x51ae3f['push'](_0x51ae3f['shift']());}};_0x50c23(++_0x257dd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index d2c8333..53b5500 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x1a27d4,_0x531075){var _0x1ea35c=function(_0x43ce93){while(--_0x43ce93){_0x1a27d4['push'](_0x1a27d4['shift']());}};_0x1ea35c(++_0x531075);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0xb10b[_0x4d394d];return _0x4f0003;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x55843d,_0x2e85c6){var _0x1efb07=function(_0x324e85){while(--_0x324e85){_0x55843d['push'](_0x55843d['shift']());}};_0x1efb07(++_0x2e85c6);}(_0x2032,0xd9));var _0x2203=function(_0x39fc1d,_0x431e9c){_0x39fc1d=_0x39fc1d-0x0;var _0x141606=_0x2032[_0x39fc1d];return _0x141606;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b73e1cb..e873de0 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 _0x17e5=['address','defaultuser','exports','active','name','unknown','stateTime','registry','split','host','domain','domainport','refresh'];(function(_0x56565c,_0x1109a7){var _0x3e7667=function(_0x26b620){while(--_0x26b620){_0x56565c['push'](_0x56565c['shift']());}};_0x3e7667(++_0x1109a7);}(_0x17e5,0x16f));var _0x517e=function(_0x26360b,_0x2a23dd){_0x26360b=_0x26360b-0x0;var _0xc0c81e=_0x17e5[_0x26360b];return _0xc0c81e;};'use strict';function Trunk(_0x4c9bae){this['id']=_0x4c9bae['id']||0x0;this[_0x517e('0x0')]=_0x4c9bae[_0x517e('0x0')]||![];this[_0x517e('0x1')]=_0x4c9bae['name']||'';this['state']=_0x517e('0x2');this[_0x517e('0x3')]=0x0;this['status']=_0x517e('0x2');this[_0x517e('0x4')]=_0x4c9bae['registry']&&_0x4c9bae[_0x517e('0x4')]['indexOf'](':')?_0x4c9bae[_0x517e('0x4')][_0x517e('0x5')](':')[0x0]:'';this[_0x517e('0x6')]='';this['port']='';this[_0x517e('0x7')]='';this[_0x517e('0x8')]='';this[_0x517e('0x9')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0x517e('0xa')]='';this[_0x517e('0xb')]=_0x4c9bae[_0x517e('0xb')]||'';}module[_0x517e('0xc')]=Trunk; \ No newline at end of file +var _0x8d3f=['active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domainport','refresh','stateRegistry','address','defaultuser','exports'];(function(_0x3d823b,_0x245c0d){var _0x1c23cd=function(_0x179b18){while(--_0x179b18){_0x3d823b['push'](_0x3d823b['shift']());}};_0x1c23cd(++_0x245c0d);}(_0x8d3f,0x1c0));var _0xf8d3=function(_0x3fc884,_0x48bdb3){_0x3fc884=_0x3fc884-0x0;var _0x15d19d=_0x8d3f[_0x3fc884];return _0x15d19d;};'use strict';function Trunk(_0x21ea9d){this['id']=_0x21ea9d['id']||0x0;this[_0xf8d3('0x0')]=_0x21ea9d[_0xf8d3('0x0')]||![];this[_0xf8d3('0x1')]=_0x21ea9d[_0xf8d3('0x1')]||'';this['state']=_0xf8d3('0x2');this[_0xf8d3('0x3')]=0x0;this[_0xf8d3('0x4')]='unknown';this[_0xf8d3('0x5')]=_0x21ea9d['registry']&&_0x21ea9d['registry'][_0xf8d3('0x6')](':')?_0x21ea9d['registry'][_0xf8d3('0x7')](':')[0x0]:'';this[_0xf8d3('0x8')]='';this[_0xf8d3('0x9')]='';this['domain']='';this[_0xf8d3('0xa')]='';this[_0xf8d3('0xb')]='';this[_0xf8d3('0xc')]=_0xf8d3('0x2');this['registrationtime']='';this[_0xf8d3('0xd')]='';this[_0xf8d3('0xe')]=_0x21ea9d[_0xf8d3('0xe')]||'';}module[_0xf8d3('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 9c9a8e1..589a489 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 _0xa646=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x3b8950,_0x58325c){var _0x20baa0=function(_0x1ea2b3){while(--_0x1ea2b3){_0x3b8950['push'](_0x3b8950['shift']());}};_0x20baa0(++_0x58325c);}(_0xa646,0xe5));var _0x6a64=function(_0x3e5d8e,_0x4fe2fb){_0x3e5d8e=_0x3e5d8e-0x0;var _0x314396=_0xa646[_0x3e5d8e];return _0x314396;};'use strict';function voiceExtension(_0x1ed938){this['id']=_0x1ed938['id']||0x0;this[_0x6a64('0x0')]=_0x1ed938[_0x6a64('0x0')]||'';this[_0x6a64('0x1')]=_0x1ed938[_0x6a64('0x1')]||_0x6a64('0x2');this['mandatoryDisposition']=_0x1ed938[_0x6a64('0x3')]||![];}module[_0x6a64('0x4')]=voiceExtension; \ No newline at end of file +var _0x62d4=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x62d4,0x1f0));var _0x462d=function(_0x4cc351,_0x2d0ac4){_0x4cc351=_0x4cc351-0x0;var _0x4f9bb0=_0x62d4[_0x4cc351];return _0x4f9bb0;};'use strict';function voiceExtension(_0x82b8df){this['id']=_0x82b8df['id']||0x0;this[_0x462d('0x0')]=_0x82b8df[_0x462d('0x0')]||'';this['recordingFormat']=_0x82b8df[_0x462d('0x1')]||_0x462d('0x2');this[_0x462d('0x3')]=_0x82b8df['mandatoryDisposition']||![];}module[_0x462d('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 06149c3..5cd1a4b 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 _0x25a9=['dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','gsm','name','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive'];(function(_0x3682ba,_0x521cae){var _0x5033cd=function(_0x43479f){while(--_0x43479f){_0x3682ba['push'](_0x3682ba['shift']());}};_0x5033cd(++_0x521cae);}(_0x25a9,0x1bc));var _0x925a=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0x25a9[_0xd839e7];return _0xc3cf23;};'use strict';var statusDesc=['unknown',_0x925a('0x0'),_0x925a('0x1'),_0x925a('0x2'),'invalid',_0x925a('0x3'),_0x925a('0x4'),_0x925a('0x5'),_0x925a('0x6')];var monitorFormat={'wav':_0x925a('0x7'),'wav49':'wav49','gsm':_0x925a('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x50b94f){this['id']=_0x50b94f['id']||0x0;this[_0x925a('0x9')]=_0x50b94f[_0x925a('0x9')]||'';this[_0x925a('0xa')]=_0x50b94f[_0x925a('0xa')]||'';this[_0x925a('0xb')]=_0x50b94f[_0x925a('0xb')]||_0x925a('0xc');this[_0x925a('0xd')]=0x0;this['talking']=0x0;this[_0x925a('0xe')]=0x0;this['answered']=0x0;this[_0x925a('0xf')]=0x0;this[_0x925a('0x10')]=0x0;this[_0x925a('0x11')]=0x0;this[_0x925a('0x12')]=0x0;this[_0x925a('0x13')]=0x0;this[_0x925a('0x14')]=0x0;this[_0x925a('0x15')]=0x0;this[_0x925a('0x16')]=_0x50b94f[_0x925a('0x16')]||![];this[_0x925a('0x17')]=_0x50b94f[_0x925a('0x17')]||0xa;this[_0x925a('0x18')]=_0x50b94f['autopause']||'no';this[_0x925a('0x19')]=!![];this[_0x925a('0x1a')]='';this[_0x925a('0x1b')]=0x0;this[_0x925a('0x1c')]=0x0;this[_0x925a('0x1d')]=_0x50b94f[_0x925a('0x1d')]||null;this[_0x925a('0x1e')]=_0x50b94f[_0x925a('0x1e')]?_0x50b94f[_0x925a('0x1e')]:null;this[_0x925a('0x1f')]=_0x50b94f['dialActive'];this[_0x925a('0x20')]=_0x50b94f[_0x925a('0x20')]||_0x925a('0x21');this[_0x925a('0x22')]=_0x50b94f['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x50b94f[_0x925a('0x23')]||0x0;this[_0x925a('0x24')]=_0x50b94f[_0x925a('0x24')]||0x1;this[_0x925a('0x25')]=_0x50b94f[_0x925a('0x25')]||_0x925a('0x26');this[_0x925a('0x27')]=_0x50b94f['dialPredictiveOptimizationPercentage']||0.03;this[_0x925a('0x28')]=_0x50b94f[_0x925a('0x28')]||0x258;this['dialOriginateCallerIdName']=_0x50b94f['dialOriginateCallerIdName']||_0x925a('0x29');this[_0x925a('0x2a')]=_0x50b94f[_0x925a('0x2a')]||'anonymous';this[_0x925a('0x2b')]=_0x50b94f[_0x925a('0x2b')]||0x1e;this['dialQueueOptions']=_0x50b94f[_0x925a('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x50b94f[_0x925a('0x2d')]||0x3;this[_0x925a('0x2e')]=_0x50b94f[_0x925a('0x2e')]||undefined;this[_0x925a('0x2f')]=_0x50b94f[_0x925a('0x2f')]||0x3;this[_0x925a('0x30')]=_0x50b94f[_0x925a('0x30')]||0x96;this['dialBusyMaxRetry']=_0x50b94f[_0x925a('0x31')]||0x3;this[_0x925a('0x32')]=_0x50b94f[_0x925a('0x32')]||0x96;this[_0x925a('0x33')]=_0x50b94f['dialNoAnswerMaxRetry']||0x3;this[_0x925a('0x34')]=_0x50b94f['dialNoAnswerRetryFrequency']||0x96;this[_0x925a('0x35')]=_0x50b94f[_0x925a('0x35')]||0x3;this[_0x925a('0x36')]=_0x50b94f[_0x925a('0x36')]||0x96;this[_0x925a('0x37')]=_0x50b94f['dialDropMaxRetry']||0x3;this[_0x925a('0x38')]=_0x50b94f[_0x925a('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x50b94f[_0x925a('0x39')]||0x3;this[_0x925a('0x3a')]=_0x50b94f[_0x925a('0x3a')]||0x96;this[_0x925a('0x3b')]=_0x50b94f[_0x925a('0x3b')]||0x3;this[_0x925a('0x3c')]=_0x50b94f[_0x925a('0x3c')]||0x96;this[_0x925a('0x3d')]=_0x50b94f['dialAgentRejectMaxRetry']||0x3;this[_0x925a('0x3e')]=_0x50b94f[_0x925a('0x3e')]||0x96;this[_0x925a('0x3f')]=_0x50b94f[_0x925a('0x3f')]||0x4;this[_0x925a('0x40')]=_0x50b94f[_0x925a('0x40')]?_0x50b94f[_0x925a('0x40')]:undefined;this[_0x925a('0x41')]=_0x50b94f[_0x925a('0x41')]?_0x50b94f[_0x925a('0x41')]:undefined;this[_0x925a('0x42')]=_0x50b94f[_0x925a('0x42')]||undefined;this[_0x925a('0x43')]=_0x50b94f[_0x925a('0x43')]?_0x50b94f[_0x925a('0x43')]:undefined;this[_0x925a('0x44')]=_0x50b94f[_0x925a('0x44')]||_0x925a('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x50b94f[_0x925a('0x46')]||undefined;this[_0x925a('0x47')]=_0x50b94f[_0x925a('0x47')]||undefined;this[_0x925a('0x48')]=strategy[_0x50b94f[_0x925a('0x48')]]||_0x925a('0x49');this[_0x925a('0x4a')]=!![];this[_0x925a('0x4b')]=_0x50b94f[_0x925a('0x4b')]||![];this[_0x925a('0x4c')]=_0x50b94f[_0x925a('0x4c')];this[_0x925a('0x4d')]=_0x50b94f[_0x925a('0x4d')];this[_0x925a('0x4e')]=_0x50b94f['dialAMDAfterGreetingSilence'];this[_0x925a('0x4f')]=_0x50b94f['dialAMDTotalAnalysisTime'];this[_0x925a('0x50')]=_0x50b94f['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x50b94f[_0x925a('0x51')];this[_0x925a('0x52')]=_0x50b94f[_0x925a('0x52')];this[_0x925a('0x53')]=_0x50b94f[_0x925a('0x53')];this[_0x925a('0x54')]=_0x50b94f[_0x925a('0x54')];this[_0x925a('0x55')]=0x0;this[_0x925a('0x56')]=0x0;this[_0x925a('0x57')]=_0x50b94f[_0x925a('0x57')];this[_0x925a('0x58')]=0x0;this[_0x925a('0x59')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x925a('0x5a')]=0x0;this[_0x925a('0x5b')]=0x0;this[_0x925a('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x925a('0x5d')]=0x0;this[_0x925a('0x5e')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x925a('0x5f')]=undefined;this[_0x925a('0x60')]=undefined;this['handlePredictive']=undefined;this[_0x925a('0x61')]=1.05;this[_0x925a('0x62')]=0x0;this[_0x925a('0x63')]=0x0;this[_0x925a('0x64')]=0x0;this[_0x925a('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x925a('0x66')]=0x0;this[_0x925a('0x67')]=0x0;this[_0x925a('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x50b94f[_0x925a('0x69')]||0x14;this[_0x925a('0x6a')]=_0x50b94f['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x925a('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x925a('0x6c')]=0x0;this[_0x925a('0x6d')]=0x0;this[_0x925a('0x6e')]=0x0;this[_0x925a('0x6f')]=_0x50b94f[_0x925a('0x6f')]||0x1e;this['dialRecallInQueue']=_0x50b94f[_0x925a('0x70')]||![];this[_0x925a('0x71')]=!!_0x50b94f['dialPreviewAutoRecallMe']||![];this[_0x925a('0x72')]=_0x50b94f[_0x925a('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x50b94f[_0x925a('0x73')]||![];this[_0x925a('0x74')]=_0x50b94f[_0x925a('0x74')]||![];this['monitor_format']=monitorFormat[_0x50b94f['monitor_format']]?monitorFormat[_0x50b94f[_0x925a('0xa')]]:undefined;this[_0x925a('0x75')]=_0x50b94f[_0x925a('0x75')]||![];this[_0x925a('0x76')]=_0x50b94f[_0x925a('0x76')]?_0x50b94f[_0x925a('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xdef7=['dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acwTimeout','autopause','originated','temp','dialTimezone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdef7,0xcf));var _0x7def=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdef7[_0x3dd15e];return _0x231fd0;};'use strict';var statusDesc=[_0x7def('0x0'),_0x7def('0x1'),'inuse',_0x7def('0x2'),_0x7def('0x3'),_0x7def('0x4'),_0x7def('0x5'),'ringinuse',_0x7def('0x6')];var monitorFormat={'wav':_0x7def('0x7'),'wav49':_0x7def('0x8'),'gsm':_0x7def('0x9')};var strategy={'rrmemory':_0x7def('0xa'),'roundrobin':_0x7def('0xb')};function VoiceQueue(_0xc90f5f){this['id']=_0xc90f5f['id']||0x0;this[_0x7def('0xc')]=_0xc90f5f['name']||'';this['monitor_format']=_0xc90f5f['monitor_format']||'';this['type']=_0xc90f5f[_0x7def('0xd')]||'inbound';this[_0x7def('0xe')]=0x0;this[_0x7def('0xf')]=0x0;this[_0x7def('0x10')]=0x0;this[_0x7def('0x11')]=0x0;this[_0x7def('0x12')]=0x0;this[_0x7def('0x13')]=0x0;this[_0x7def('0x14')]=0x0;this[_0x7def('0x15')]=0x0;this[_0x7def('0x16')]=0x0;this['loggedIn']=0x0;this[_0x7def('0x17')]=0x0;this['acw']=_0xc90f5f['acw']||![];this[_0x7def('0x18')]=_0xc90f5f[_0x7def('0x18')]||0xa;this[_0x7def('0x19')]=_0xc90f5f[_0x7def('0x19')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x7def('0x1a')]=0x0;this[_0x7def('0x1b')]=0x0;this[_0x7def('0x1c')]=_0xc90f5f[_0x7def('0x1c')]||null;this[_0x7def('0x1d')]=_0xc90f5f[_0x7def('0x1d')]?_0xc90f5f[_0x7def('0x1d')]:null;this['dialActive']=_0xc90f5f[_0x7def('0x1e')];this['dialMethod']=_0xc90f5f[_0x7def('0x1f')]||_0x7def('0x20');this[_0x7def('0x21')]=_0xc90f5f[_0x7def('0x21')]||0x0;this[_0x7def('0x22')]=_0xc90f5f[_0x7def('0x22')]||0x0;this[_0x7def('0x23')]=_0xc90f5f['dialPowerLevel']||0x1;this[_0x7def('0x24')]=_0xc90f5f[_0x7def('0x24')]||_0x7def('0x25');this[_0x7def('0x26')]=_0xc90f5f[_0x7def('0x26')]||0.03;this[_0x7def('0x27')]=_0xc90f5f['dialPredictiveInterval']||0x258;this[_0x7def('0x28')]=_0xc90f5f[_0x7def('0x28')]||_0x7def('0x29');this[_0x7def('0x2a')]=_0xc90f5f[_0x7def('0x2a')]||_0x7def('0x29');this[_0x7def('0x2b')]=_0xc90f5f[_0x7def('0x2b')]||0x1e;this[_0x7def('0x2c')]=_0xc90f5f[_0x7def('0x2c')]||'tTxX';this['dialQueueTimeout']=_0xc90f5f['dialQueueTimeout']||0x3;this[_0x7def('0x2d')]=_0xc90f5f[_0x7def('0x2d')]||undefined;this[_0x7def('0x2e')]=_0xc90f5f[_0x7def('0x2e')]||0x3;this[_0x7def('0x2f')]=_0xc90f5f[_0x7def('0x2f')]||0x96;this['dialBusyMaxRetry']=_0xc90f5f[_0x7def('0x30')]||0x3;this[_0x7def('0x31')]=_0xc90f5f['dialBusyRetryFrequency']||0x96;this[_0x7def('0x32')]=_0xc90f5f[_0x7def('0x32')]||0x3;this[_0x7def('0x33')]=_0xc90f5f['dialNoAnswerRetryFrequency']||0x96;this[_0x7def('0x34')]=_0xc90f5f[_0x7def('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xc90f5f[_0x7def('0x35')]||0x96;this[_0x7def('0x36')]=_0xc90f5f['dialDropMaxRetry']||0x3;this[_0x7def('0x37')]=_0xc90f5f[_0x7def('0x37')]||0x96;this['dialAbandonedMaxRetry']=_0xc90f5f[_0x7def('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0xc90f5f[_0x7def('0x39')]||0x96;this['dialMachineMaxRetry']=_0xc90f5f[_0x7def('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0xc90f5f['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0xc90f5f['dialAgentRejectMaxRetry']||0x3;this[_0x7def('0x3b')]=_0xc90f5f[_0x7def('0x3b')]||0x96;this['dialGlobalMaxRetry']=_0xc90f5f['dialGlobalMaxRetry']||0x4;this[_0x7def('0x3c')]=_0xc90f5f[_0x7def('0x3c')]?_0xc90f5f[_0x7def('0x3c')]:undefined;this[_0x7def('0x3d')]=_0xc90f5f[_0x7def('0x3d')]?_0xc90f5f['TrunkBackup']:undefined;this[_0x7def('0x3e')]=_0xc90f5f[_0x7def('0x3e')]||undefined;this['Interval']=_0xc90f5f[_0x7def('0x3f')]?_0xc90f5f[_0x7def('0x3f')]:undefined;this[_0x7def('0x40')]=_0xc90f5f[_0x7def('0x40')]||_0x7def('0x41');this[_0x7def('0x42')]=_0xc90f5f[_0x7def('0x42')]||undefined;this[_0x7def('0x43')]=_0xc90f5f[_0x7def('0x43')]||undefined;this[_0x7def('0x44')]=strategy[_0xc90f5f['strategy']]||_0x7def('0xa');this[_0x7def('0x45')]=!![];this[_0x7def('0x46')]=_0xc90f5f['dialAMDActive']||![];this[_0x7def('0x47')]=_0xc90f5f[_0x7def('0x47')];this[_0x7def('0x48')]=_0xc90f5f[_0x7def('0x48')];this[_0x7def('0x49')]=_0xc90f5f['dialAMDAfterGreetingSilence'];this[_0x7def('0x4a')]=_0xc90f5f[_0x7def('0x4a')];this[_0x7def('0x4b')]=_0xc90f5f[_0x7def('0x4b')];this[_0x7def('0x4c')]=_0xc90f5f[_0x7def('0x4c')];this['dialAMDMaximumNumberOfWords']=_0xc90f5f['dialAMDMaximumNumberOfWords'];this[_0x7def('0x4d')]=_0xc90f5f['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xc90f5f['dialAMDMaximumWordLength'];this[_0x7def('0x4e')]=0x0;this[_0x7def('0x4f')]=0x0;this[_0x7def('0x50')]=_0xc90f5f[_0x7def('0x50')];this[_0x7def('0x51')]=0x0;this[_0x7def('0x52')]=0x0;this[_0x7def('0x53')]=0x0;this[_0x7def('0x54')]=0x0;this[_0x7def('0x55')]=0x0;this[_0x7def('0x56')]=0x0;this[_0x7def('0x57')]=0x0;this[_0x7def('0x58')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7def('0x59')]=0x0;this[_0x7def('0x5a')]=0x0;this[_0x7def('0x5b')]=0x0;this[_0x7def('0x5c')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x7def('0x5d')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x7def('0x5e')]=1.05;this[_0x7def('0x5f')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x7def('0x60')]=0x0;this[_0x7def('0x61')]=0x0;this[_0x7def('0x62')]=0x0;this[_0x7def('0x63')]=0x0;this[_0x7def('0x64')]=_0xc90f5f[_0x7def('0x65')]||0x14;this[_0x7def('0x66')]=_0xc90f5f['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x7def('0x67')]=0x0;this[_0x7def('0x68')]=0x1;this[_0x7def('0x69')]=0x0;this[_0x7def('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x7def('0x6b')]=0x0;this[_0x7def('0x6c')]=_0xc90f5f[_0x7def('0x6c')]||0x1e;this[_0x7def('0x6d')]=_0xc90f5f[_0x7def('0x6d')]||![];this[_0x7def('0x6e')]=!!_0xc90f5f[_0x7def('0x6e')]||![];this[_0x7def('0x6f')]=_0xc90f5f[_0x7def('0x6f')]||undefined;this[_0x7def('0x70')]=_0xc90f5f[_0x7def('0x70')]||![];this[_0x7def('0x71')]=_0xc90f5f[_0x7def('0x71')]||![];this['monitor_format']=monitorFormat[_0xc90f5f[_0x7def('0x72')]]?monitorFormat[_0xc90f5f[_0x7def('0x72')]]:undefined;this[_0x7def('0x73')]=_0xc90f5f[_0x7def('0x73')]||![];this['mandatoryDispositionPause']=_0xc90f5f[_0x7def('0x74')]?_0xc90f5f['mandatoryDispositionPause']:undefined;}module[_0x7def('0x75')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c7973e0..a5e6f36 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 _0x1e32=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x487774,_0x28a7ab){var _0x2433ed=function(_0x3b0b94){while(--_0x3b0b94){_0x487774['push'](_0x487774['shift']());}};_0x2433ed(++_0x28a7ab);}(_0x1e32,0xe7));var _0x21e3=function(_0x6490c4,_0x2b2190){_0x6490c4=_0x6490c4-0x0;var _0x1cccdc=_0x1e32[_0x6490c4];return _0x1cccdc;};'use strict';function VtigerAccount(_0x56350a){this['id']=_0x56350a['id']||0x0;this[_0x21e3('0x0')]=_0x56350a['name']||'';this['username']=_0x56350a[_0x21e3('0x1')]||'';this[_0x21e3('0x2')]=_0x56350a[_0x21e3('0x2')]||'';this[_0x21e3('0x3')]=_0x56350a[_0x21e3('0x3')]||'';this[_0x21e3('0x4')]=_0x56350a[_0x21e3('0x4')]||'';this[_0x21e3('0x5')]=_0x56350a[_0x21e3('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x5480=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0x5480,0x15b));var _0x0548=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5480[_0x513aa5];return _0x1a1a7c;};'use strict';function VtigerAccount(_0x1c1220){this['id']=_0x1c1220['id']||0x0;this[_0x0548('0x0')]=_0x1c1220[_0x0548('0x0')]||'';this[_0x0548('0x1')]=_0x1c1220[_0x0548('0x1')]||'';this[_0x0548('0x2')]=_0x1c1220['accessKey']||'';this['remoteUri']=_0x1c1220[_0x0548('0x3')]||'';this[_0x0548('0x4')]=_0x1c1220[_0x0548('0x4')]||'';this[_0x0548('0x5')]=_0x1c1220[_0x0548('0x5')]||{};}module[_0x0548('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 132fb76..14499b7 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 _0x261e=['password','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0xada69a,_0x249731){var _0x3aeb84=function(_0x3173e7){while(--_0x3173e7){_0xada69a['push'](_0xada69a['shift']());}};_0x3aeb84(++_0x249731);}(_0x261e,0xf8));var _0xe261=function(_0x1fad78,_0x4e550e){_0x1fad78=_0x1fad78-0x0;var _0x2bfda3=_0x261e[_0x1fad78];return _0x2bfda3;};'use strict';function ZendeskAccount(_0xe1c63e){this['id']=_0xe1c63e['id']||0x0;this[_0xe261('0x0')]=_0xe1c63e['name']||'';this[_0xe261('0x1')]=_0xe1c63e[_0xe261('0x1')]||'';this[_0xe261('0x2')]=_0xe1c63e[_0xe261('0x2')]||'';this['token']=_0xe1c63e['token']||'';this[_0xe261('0x3')]=_0xe1c63e[_0xe261('0x3')]||'';this[_0xe261('0x4')]=_0xe1c63e[_0xe261('0x4')]||'';this[_0xe261('0x5')]=_0xe1c63e[_0xe261('0x5')]||_0xe261('0x6');this[_0xe261('0x7')]=_0xe1c63e[_0xe261('0x7')]||'';this[_0xe261('0x8')]=_0xe1c63e[_0xe261('0x8')]||{};}module[_0xe261('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x1774=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x1774,0x15b));var _0x4177=function(_0x40b29b,_0x24ce28){_0x40b29b=_0x40b29b-0x0;var _0x568b8b=_0x1774[_0x40b29b];return _0x568b8b;};'use strict';function ZendeskAccount(_0x2a3a11){this['id']=_0x2a3a11['id']||0x0;this[_0x4177('0x0')]=_0x2a3a11[_0x4177('0x0')]||'';this[_0x4177('0x1')]=_0x2a3a11[_0x4177('0x1')]||'';this[_0x4177('0x2')]=_0x2a3a11['password']||'';this['token']=_0x2a3a11[_0x4177('0x3')]||'';this['remoteUri']=_0x2a3a11[_0x4177('0x4')]||'';this[_0x4177('0x5')]=_0x2a3a11[_0x4177('0x5')]||'';this['type']=_0x2a3a11[_0x4177('0x6')]||_0x4177('0x7');this[_0x4177('0x8')]=_0x2a3a11[_0x4177('0x8')]||'';this[_0x4177('0x9')]=_0x2a3a11[_0x4177('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 2d85a7f..6f881d6 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 _0x2e09=['zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x251cc5,_0xf58eea){var _0x142e6a=function(_0x483f79){while(--_0x483f79){_0x251cc5['push'](_0x251cc5['shift']());}};_0x142e6a(++_0xf58eea);}(_0x2e09,0x129));var _0x92e0=function(_0x17d7e4,_0x4885c1){_0x17d7e4=_0x17d7e4-0x0;var _0x12a90e=_0x2e09[_0x17d7e4];return _0x12a90e;};'use strict';function ZohoAccount(_0x5a4785){this['id']=_0x5a4785['id']||0x0;this[_0x92e0('0x0')]=_0x5a4785[_0x92e0('0x0')]||'';this[_0x92e0('0x1')]=_0x5a4785[_0x92e0('0x1')]||'';this[_0x92e0('0x2')]=_0x5a4785[_0x92e0('0x2')]||'';this[_0x92e0('0x3')]=_0x5a4785[_0x92e0('0x3')]||'';this[_0x92e0('0x4')]=_0x5a4785[_0x92e0('0x4')]||'';this['clientSecret']=_0x5a4785['clientSecret']||'';this[_0x92e0('0x5')]=_0x5a4785[_0x92e0('0x5')]||'';this[_0x92e0('0x6')]=_0x5a4785[_0x92e0('0x6')]||'';this[_0x92e0('0x7')]=_0x5a4785[_0x92e0('0x7')]||'';this[_0x92e0('0x8')]=_0x5a4785['Configurations']||{};}module[_0x92e0('0x9')]=ZohoAccount; \ No newline at end of file +var _0x306f=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x1c1f9b,_0x46e75e){var _0x3e51d9=function(_0x75e15b){while(--_0x75e15b){_0x1c1f9b['push'](_0x1c1f9b['shift']());}};_0x3e51d9(++_0x46e75e);}(_0x306f,0x10b));var _0xf306=function(_0x110596,_0x1faae7){_0x110596=_0x110596-0x0;var _0x51fef2=_0x306f[_0x110596];return _0x51fef2;};'use strict';function ZohoAccount(_0x1af471){this['id']=_0x1af471['id']||0x0;this[_0xf306('0x0')]=_0x1af471[_0xf306('0x0')]||'';this[_0xf306('0x1')]=_0x1af471[_0xf306('0x1')]||'';this[_0xf306('0x2')]=_0x1af471[_0xf306('0x2')]||'';this[_0xf306('0x3')]=_0x1af471[_0xf306('0x3')]||'';this[_0xf306('0x4')]=_0x1af471[_0xf306('0x4')]||'';this[_0xf306('0x5')]=_0x1af471[_0xf306('0x5')]||'';this[_0xf306('0x6')]=_0x1af471[_0xf306('0x6')]||'';this[_0xf306('0x7')]=_0x1af471[_0xf306('0x7')]||'';this['refreshToken']=_0x1af471[_0xf306('0x8')]||'';this[_0xf306('0x9')]=_0x1af471[_0xf306('0x9')]||{};}module[_0xf306('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index ae8329b..2481617 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 _0xe27b=['util','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','calleridname','Contact','phone','firstName','active','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports'];(function(_0x119f61,_0x5e33ad){var _0x4966d5=function(_0x4964a4){while(--_0x4964a4){_0x119f61['push'](_0x119f61['shift']());}};_0x4966d5(++_0x5e33ad);}(_0xe27b,0xd2));var _0xbe27=function(_0x3a5a9b,_0xc9d2c8){_0x3a5a9b=_0x3a5a9b-0x0;var _0x87a616=_0xe27b[_0x3a5a9b];return _0x87a616;};'use strict';var util=require(_0xbe27('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x401fb6,_0x20df71,_0x55e1c2){var _0x474478='';if(!_[_0xbe27('0x1')](_0x20df71)&&_0xbe27('0x2')===typeof _0x20df71){_0x474478+=_0x20df71;}if(!_['isNil'](_0x55e1c2)&&_0xbe27('0x2')===typeof _0x55e1c2){_0x474478+='\x20'+_0x55e1c2;}if(_0x474478!==''){return _0x474478;}return _0x401fb6;}function Action(_0x452262,_0x1f76cd,_0x24c116,_0x36e5ca,_0x310a3e){this[_0xbe27('0x3')]=_0x24c116||undefined;this[_0xbe27('0x4')]=_0x452262['id'];this[_0xbe27('0x5')]=_0x1f76cd['name'];this[_0xbe27('0x6')]=_0x1f76cd[_0xbe27('0x6')];this[_0xbe27('0x7')]=_0xbe27('0x5');this[_0xbe27('0x8')]=![];this[_0xbe27('0x9')]=_[_0xbe27('0x1')](_0x452262[_0xbe27('0xa')])?undefined:_0x452262[_0xbe27('0xa')][_0xbe27('0xb')];this[_0xbe27('0xc')]=this[_0xbe27('0x9')]?util['format']('SIP/%s',this[_0xbe27('0x9')]):_0x36e5ca||undefined;this[_0xbe27('0xd')]=checkNameSurname(_0x452262[_0xbe27('0xe')][_0xbe27('0xf')],_0x452262[_0xbe27('0xe')][_0xbe27('0x10')],_0x452262['Contact']['lastName']);this[_0xbe27('0x11')]=_0x452262[_0xbe27('0x11')]||![];this['calleridnum']=_0x452262[_0xbe27('0xe')][_0xbe27('0xf')];this['scheduledat']=_0x452262[_0xbe27('0x12')];this[_0xbe27('0x13')]=_0x452262[_0xbe27('0x13')]||0x0;this[_0xbe27('0x14')]=_0x452262[_0xbe27('0x14')]||0x0;this['countnoanswerretry']=_0x452262['countnoanswerretry']||0x0;this[_0xbe27('0x15')]=(_0x452262[_0xbe27('0x13')]||0x0)+(_0x452262['countcongestionretry']||0x0)+(_0x452262[_0xbe27('0x16')]||0x0)+(_0x452262[_0xbe27('0x17')]||0x0)+(_0x452262[_0xbe27('0x18')]||0x0)+(_0x452262[_0xbe27('0x19')]||0x0)+(_0x452262[_0xbe27('0x1a')]||0x0)+(_0x452262['countagentrejectretry']||0x0);this[_0xbe27('0x17')]=_0x452262[_0xbe27('0x17')]||0x0;this[_0xbe27('0x18')]=_0x452262['countdropretry']||0x0;this[_0xbe27('0x19')]=_0x452262[_0xbe27('0x19')]||0x0;this[_0xbe27('0x1a')]=_0x452262[_0xbe27('0x1a')]||0x0;this[_0xbe27('0x1b')]=_0x452262[_0xbe27('0x1b')]||0x0;this[_0xbe27('0x1c')]=_0x452262[_0xbe27('0x1c')];this[_0xbe27('0x1d')]=_0x452262[_0xbe27('0x1d')];this[_0xbe27('0x1e')]=_0x452262[_0xbe27('0x1e')];this[_0xbe27('0x1f')]=_0x452262[_0xbe27('0x1f')];this[_0xbe27('0x20')]=_0x452262['ContactId'];this[_0xbe27('0x21')]=_0x452262[_0xbe27('0x21')];this['UserId']=_['isNil'](_0x452262['Agent'])?_0x452262[_0xbe27('0x22')]:_0x452262[_0xbe27('0xa')]['id'];this[_0xbe27('0x23')]=_0x452262[_0xbe27('0x23')];this[_0xbe27('0x24')]='';this['originatecalleridname']='';}Action[_0xbe27('0x25')][_0xbe27('0x26')]=function(){return util['format'](_0xbe27('0x27'),this[_0xbe27('0xd')],this[_0xbe27('0x28')]);};module[_0xbe27('0x29')]=Action; \ No newline at end of file +var _0x5cd8=['membername','Agent','format','SIP/%s','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer'];(function(_0x7fbd64,_0x287ad1){var _0x39b1ce=function(_0x2df390){while(--_0x2df390){_0x7fbd64['push'](_0x7fbd64['shift']());}};_0x39b1ce(++_0x287ad1);}(_0x5cd8,0x11c));var _0x85cd=function(_0x46c93e,_0x51e179){_0x46c93e=_0x46c93e-0x0;var _0x1fbd53=_0x5cd8[_0x46c93e];return _0x1fbd53;};'use strict';var util=require(_0x85cd('0x0'));var _=require(_0x85cd('0x1'));var moment=require(_0x85cd('0x2'));function checkNameSurname(_0x525f14,_0x491c42,_0x4c7409){var _0x2b5733='';if(!_[_0x85cd('0x3')](_0x491c42)&&'string'===typeof _0x491c42){_0x2b5733+=_0x491c42;}if(!_['isNil'](_0x4c7409)&&'string'===typeof _0x4c7409){_0x2b5733+='\x20'+_0x4c7409;}if(_0x2b5733!==''){return _0x2b5733;}return _0x525f14;}function Action(_0x24fd3c,_0x2b83f8,_0x183147,_0x4c1519,_0x54bba8){this[_0x85cd('0x4')]=_0x183147||undefined;this['idContact']=_0x24fd3c['id'];this[_0x85cd('0x5')]=_0x2b83f8[_0x85cd('0x6')];this[_0x85cd('0x7')]=_0x2b83f8[_0x85cd('0x7')];this[_0x85cd('0x8')]=_0x85cd('0x5');this[_0x85cd('0x9')]=![];this[_0x85cd('0xa')]=_[_0x85cd('0x3')](_0x24fd3c['Agent'])?undefined:_0x24fd3c[_0x85cd('0xb')]['name'];this['channelAgent']=this[_0x85cd('0xa')]?util[_0x85cd('0xc')](_0x85cd('0xd'),this['membername']):_0x4c1519||undefined;this[_0x85cd('0xe')]=checkNameSurname(_0x24fd3c[_0x85cd('0xf')][_0x85cd('0x10')],_0x24fd3c[_0x85cd('0xf')]['firstName'],_0x24fd3c[_0x85cd('0xf')]['lastName']);this[_0x85cd('0x11')]=_0x24fd3c[_0x85cd('0x11')]||![];this['calleridnum']=_0x24fd3c[_0x85cd('0xf')][_0x85cd('0x10')];this[_0x85cd('0x12')]=_0x24fd3c[_0x85cd('0x12')];this[_0x85cd('0x13')]=_0x24fd3c[_0x85cd('0x13')]||0x0;this[_0x85cd('0x14')]=_0x24fd3c['countcongestionretry']||0x0;this[_0x85cd('0x15')]=_0x24fd3c[_0x85cd('0x15')]||0x0;this[_0x85cd('0x16')]=(_0x24fd3c[_0x85cd('0x13')]||0x0)+(_0x24fd3c[_0x85cd('0x14')]||0x0)+(_0x24fd3c[_0x85cd('0x15')]||0x0)+(_0x24fd3c['countnosuchnumberretry']||0x0)+(_0x24fd3c['countdropretry']||0x0)+(_0x24fd3c[_0x85cd('0x17')]||0x0)+(_0x24fd3c[_0x85cd('0x18')]||0x0)+(_0x24fd3c[_0x85cd('0x19')]||0x0);this[_0x85cd('0x1a')]=_0x24fd3c[_0x85cd('0x1a')]||0x0;this[_0x85cd('0x1b')]=_0x24fd3c['countdropretry']||0x0;this[_0x85cd('0x17')]=_0x24fd3c[_0x85cd('0x17')]||0x0;this[_0x85cd('0x18')]=_0x24fd3c[_0x85cd('0x18')]||0x0;this[_0x85cd('0x19')]=_0x24fd3c[_0x85cd('0x19')]||0x0;this[_0x85cd('0x1c')]=_0x24fd3c[_0x85cd('0x1c')];this['callbackuniqueid']=_0x24fd3c[_0x85cd('0x1d')];this['callbackat']=_0x24fd3c[_0x85cd('0x1e')];this[_0x85cd('0x1f')]=_0x24fd3c['recallme'];this[_0x85cd('0x20')]=_0x24fd3c[_0x85cd('0x20')];this[_0x85cd('0x21')]=_0x24fd3c[_0x85cd('0x21')];this[_0x85cd('0x22')]=_[_0x85cd('0x3')](_0x24fd3c[_0x85cd('0xb')])?_0x24fd3c[_0x85cd('0x22')]:_0x24fd3c['Agent']['id'];this[_0x85cd('0x23')]=_0x24fd3c[_0x85cd('0x23')];this[_0x85cd('0x24')]='';this[_0x85cd('0x25')]='';}Action['prototype'][_0x85cd('0x26')]=function(){return util[_0x85cd('0xc')](_0x85cd('0x27'),this[_0x85cd('0xe')],this[_0x85cd('0x28')]);};module[_0x85cd('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 5216ef0..47b5ff6 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 _0x7dfd=['[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','logAgent','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','unlock','unlockContact','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','Action','variablesAction','[originated][increment]','OriginateError','actionid','logLookAgent','isFailure','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','ListId','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','responsetime','uniqueid','\x20Queue','connect','acw','buildAcw','custom:agentcomplete','complete','Answer','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd7df('0x0'));var _=require(_0xd7df('0x1'));var BPromise=require(_0xd7df('0x2'));var uuid=require(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var md5=require(_0xd7df('0x5'));var Redis=require(_0xd7df('0x6'));var config=require(_0xd7df('0x7'));var logger=require(_0xd7df('0x8'))(_0xd7df('0x9'));var loggerAction=require(_0xd7df('0x8'))(_0xd7df('0xa'));var ami=require(_0xd7df('0xb'));var rpcDb=require(_0xd7df('0xc'));var Action=require(_0xd7df('0xd'));var ut=require(_0xd7df('0xe'));config[_0xd7df('0xf')]=_['defaults'](config[_0xd7df('0xf')],{'host':_0xd7df('0x10'),'port':0x18eb});var io=require(_0xd7df('0x11'))(new Redis(config[_0xd7df('0xf')]));var Sequence=function(){};Sequence['prototype'][_0xd7df('0x12')]=function(_0x532c14){this[_0xd7df('0x13')]=this['tail']?this[_0xd7df('0x13')][_0xd7df('0x14')](_0x532c14):_0x532c14();};function Preview(_0x28d358){this[_0xd7df('0x15')]=new Sequence();this[_0xd7df('0x16')]=_0x28d358[_0xd7df('0x17')];this[_0xd7df('0x18')]=_0x28d358[_0xd7df('0x18')];this[_0xd7df('0x19')]={};this[_0xd7df('0x1a')]=_0x28d358[_0xd7df('0x1a')];this[_0xd7df('0x1b')]=0x0;ami['on'](_0xd7df('0x1c'),this[_0xd7df('0x1d')][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x1f'),this[_0xd7df('0x20')]['bind'](this));ami['on'](_0xd7df('0x21'),this[_0xd7df('0x22')]['bind'](this));ami['on'](_0xd7df('0x23'),this[_0xd7df('0x24')]['bind'](this));ami['on'](_0xd7df('0x25'),this[_0xd7df('0x26')][_0xd7df('0x1e')](this));ami['on']('varset',this[_0xd7df('0x27')][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x28'),this['syncAttendedTransfer'][_0xd7df('0x1e')](this));ami['on'](_0xd7df('0x29'),this[_0xd7df('0x2a')]['bind'](this));this[_0xd7df('0x2b')](this['campaignsPreview']);}function emit(_0x225e33,_0x5ab737,_0x3ae7c3){io['to'](_0x225e33)[_0xd7df('0x2c')](_0x5ab737,_0x3ae7c3);}function emitCampaignPreview(_0x4eabb8){if(_0x4eabb8['type']===_0xd7df('0x2d')){var _0x502ae8={'id':_0x4eabb8['id'],'name':_0x4eabb8[_0xd7df('0x2e')],'strategy':_0x4eabb8[_0xd7df('0x2f')],'answered':_0x4eabb8[_0xd7df('0x30')],'available':_0x4eabb8[_0xd7df('0x31')],'loggedIn':_0x4eabb8[_0xd7df('0x32')],'pTalking':_0x4eabb8[_0xd7df('0x33')],'sumBillable':_0x4eabb8[_0xd7df('0x34')],'sumDuration':_0x4eabb8['sumDuration'],'sumHoldTime':_0x4eabb8['sumHoldTime']||0x0,'talking':_0x4eabb8[_0xd7df('0x35')],'total':_0x4eabb8[_0xd7df('0x36')],'type':_0x4eabb8[_0xd7df('0x37')],'unmanaged':_0x4eabb8[_0xd7df('0x38')],'abandoned':_0x4eabb8[_0xd7df('0x39')],'waiting':_0x4eabb8[_0xd7df('0x3a')],'loggedInDb':_0x4eabb8[_0xd7df('0x3b')],'dialActive':_0x4eabb8[_0xd7df('0x3c')],'dialMethod':_0x4eabb8[_0xd7df('0x3d')],'dialOriginateCallerIdName':_0x4eabb8['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4eabb8[_0xd7df('0x3e')],'dialOriginateTimeout':_0x4eabb8[_0xd7df('0x3f')],'dialPrefix':_0x4eabb8[_0xd7df('0x40')],'outboundAnswerAgiCallsDay':_0x4eabb8[_0xd7df('0x41')],'outboundAnswerCallsDay':_0x4eabb8[_0xd7df('0x42')],'outboundBlacklistCallsDay':_0x4eabb8[_0xd7df('0x43')],'outboundBusyCallsDay':_0x4eabb8[_0xd7df('0x44')],'outboundCongestionCallsDay':_0x4eabb8[_0xd7df('0x45')],'outboundDropCallsDayACS':_0x4eabb8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4eabb8['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4eabb8['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4eabb8['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4eabb8['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4eabb8[_0xd7df('0x46')],'outboundReCallsDay':_0x4eabb8['outboundReCallsDay'],'outboundRejectCallsDay':_0x4eabb8[_0xd7df('0x47')],'outboundUnknownCallsDay':_0x4eabb8[_0xd7df('0x48')],'outboundAbandonedCallsDay':_0x4eabb8['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4eabb8[_0xd7df('0x49')],'predictiveIntervalAvgHoldtime':_0x4eabb8[_0xd7df('0x4a')],'predictiveIntervalAvgTalktime':_0x4eabb8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4eabb8[_0xd7df('0x4b')],'predictiveIntervalDroppedCallsTimeout':_0x4eabb8[_0xd7df('0x4c')],'predictiveIntervalErlangCalls':_0x4eabb8[_0xd7df('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0x4eabb8[_0xd7df('0x4e')],'predictiveIntervalHitRate':_0x4eabb8[_0xd7df('0x4f')],'predictiveIntervalMultiplicativeFactor':_0x4eabb8[_0xd7df('0x50')],'predictiveIntervalPauses':_0x4eabb8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4eabb8[_0xd7df('0x51')],'predictiveIntervalTotalCalls':_0x4eabb8[_0xd7df('0x52')],'message':_0x4eabb8[_0xd7df('0x53')],'originated':_0x4eabb8[_0xd7df('0x54')],'erlangCalls':_0x4eabb8[_0xd7df('0x55')],'erlangCallToSecond':_0x4eabb8[_0xd7df('0x56')],'erlangAbandonmentRate':_0x4eabb8[_0xd7df('0x57')],'erlangBusyFactor':_0x4eabb8[_0xd7df('0x58')],'startPredictive':_0x4eabb8[_0xd7df('0x59')],'startProgressive':_0x4eabb8[_0xd7df('0x5a')]};if(_0x4eabb8[_0xd7df('0x5b')]){_0x502ae8['Trunk']={'id':_0x4eabb8['Trunk']['id'],'name':_0x4eabb8[_0xd7df('0x5b')]['name'],'active':_0x4eabb8[_0xd7df('0x5b')][_0xd7df('0x5c')],'callerid':_0x4eabb8[_0xd7df('0x5b')][_0xd7df('0x5d')]};}if(_0x4eabb8['Interval']){_0x502ae8['Interval']={'id':_0x4eabb8['Interval']['id'],'name':_0x4eabb8[_0xd7df('0x5e')][_0xd7df('0x2e')]};}var _0x55c43f=md5(JSON[_0xd7df('0x5f')](_0x502ae8));if(_0x4eabb8[_0xd7df('0x5')]!==_0x55c43f){_0x4eabb8[_0xd7df('0x5')]=_0x55c43f;emit(util[_0xd7df('0x60')]('voice:queue:%s',_0x502ae8[_0xd7df('0x2e')]),_0xd7df('0x61'),_0x502ae8);}}}function emitVoiceQueueChannelRemove(_0x5f0a6d){logger[_0xd7df('0x62')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd7df('0x5f')](_0x5f0a6d));emit(util[_0xd7df('0x60')](_0xd7df('0x63'),_0x5f0a6d['name']),_0xd7df('0x64'),_0x5f0a6d);io[_0xd7df('0x2c')](_0xd7df('0x65'),_0x5f0a6d);}function notSendMessagesQueue(_0x379e32){if(_0x379e32['sendMessageOneNotActive']){if(_0x379e32[_0xd7df('0x54')]===0x0&&_0x379e32[_0xd7df('0x33')]===0x0){_0x379e32[_0xd7df('0x66')]=![];_0x379e32['available']=0x0;_0x379e32[_0xd7df('0x67')]=0x0;_0x379e32[_0xd7df('0x53')]=_0xd7df('0x68');ut['logger'](_0xd7df('0x69'),_0x379e32[_0xd7df('0x2e')]+'\x20is\x20not\x20active');}else{_0x379e32['message']=_0xd7df('0x6a');ut[_0xd7df('0x6b')](_0xd7df('0x69'),_0x379e32['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x379e32);}}Preview[_0xd7df('0x6c')]['loopCampaigns']=function(){var _0xe606f4=this;setInterval(function(){_0xe606f4['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xd7df('0x6d')]=function(){var _0x579d0f=this[_0xd7df('0x16')];this[_0xd7df('0x1b')]+=0x1;for(var _0xad2d69 in _0x579d0f){if(_0x579d0f[_0xd7df('0x6e')](_0xad2d69)&&(_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x9')||_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x6f'))&&_0x579d0f[_0xad2d69][_0xd7df('0x37')]==='outbound'){if(this[_0xd7df('0x1b')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xd7df('0x70')]();}}if(_0x579d0f[_0xd7df('0x6e')](_0xad2d69)&&_0x579d0f[_0xad2d69][_0xd7df('0x3d')]===_0xd7df('0x9')&&_0x579d0f[_0xad2d69][_0xd7df('0x37')]===_0xd7df('0x2d')){if(_0x579d0f[_0xad2d69][_0xd7df('0x3c')]){this[_0xd7df('0x71')](_0x579d0f[_0xad2d69]);if(_0x579d0f[_0xad2d69][_0xd7df('0x72')])this['recallMe'](_0x579d0f[_0xad2d69]);}else{notSendMessagesQueue(_0x579d0f[_0xad2d69]);}}}};Preview[_0xd7df('0x6c')][_0xd7df('0x73')]=function(_0x49085b){var _0x4af751=this;this[_0xd7df('0x15')][_0xd7df('0x12')](function(){if(!_[_0xd7df('0x74')](_0x4af751['actions'][_0x49085b])){loggerAction['info'](_0xd7df('0x75'),_0x49085b,'Queue',_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')],_0xd7df('0x77'),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]][_0xd7df('0x54')]),_0xd7df('0x78'),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b]['queue']][_0xd7df('0x33')]),JSON[_0xd7df('0x5f')](_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x79')]),JSON[_0xd7df('0x5f')](_['pick'](_0x4af751[_0xd7df('0x19')][_0x49085b],[_0xd7df('0x7a'),_0xd7df('0x7b'),'VoiceQueueId',_0xd7df('0x7c')])));return ami['Action']({'action':_0xd7df('0x7d'),'channel':_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x7e')]})[_0xd7df('0x7f')](function(_0xc4a51b){if(_0xc4a51b['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x4af751['actions'][_0x49085b]){ut[_0xd7df('0x80')](_0x4af751['campaignsPreview'][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]],_0xd7df('0x81'));if(_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x79')]===!![]){ut[_0xd7df('0x82')](_0x4af751[_0xd7df('0x16')][_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]],_0xd7df('0x81'));ut[_0xd7df('0x83')](_0xd7df('0x84')+_0x49085b,_0x4af751[_0xd7df('0x19')][_0x49085b][_0xd7df('0x76')]);}ut[_0xd7df('0x83')](_0xd7df('0x85')+_0x49085b,_0x4af751['actions'][_0x49085b][_0xd7df('0x76')]);delete _0x4af751[_0xd7df('0x19')][_0x49085b];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x238e3c=this;loggerAction['info'](_0xd7df('0x86'),_['size'](this[_0xd7df('0x19')]));for(var _0x28151a in this[_0xd7df('0x19')]){if(_0x238e3c['actions']['hasOwnProperty'](_0x28151a)){_0x238e3c['clearZombieChannel'](_0x28151a);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x87')]=function(_0x19c387){var _0x527b6f=this;rpcDb[_0xd7df('0x88')](_0x19c387['id'],ut[_0xd7df('0x89')](this['agents']))[_0xd7df('0x8a')](function(_0x3570c4){if(!_[_0xd7df('0x74')](_0x3570c4)){for(var _0x25d187=0x0;_0x25d187<_0x3570c4[_0xd7df('0x8b')];_0x25d187+=0x1){if(ut[_0xd7df('0x8c')](_0x3570c4[_0x25d187][_0xd7df('0x8d')])<_0x19c387[_0xd7df('0x8e')]*0x3c){if(_0x3570c4[_0x25d187][_0xd7df('0x8f')]&&!_0x3570c4[_0x25d187][_0xd7df('0x8f')][_0xd7df('0x90')]){_0x527b6f[_0xd7df('0x91')](_0x3570c4[_0x25d187]['id'])[_0xd7df('0x8a')](ut[_0xd7df('0x92')](_0xd7df('0x93')))[_0xd7df('0x7f')](ut[_0xd7df('0x92')](_0xd7df('0x93')));}else{rpcDb[_0xd7df('0x94')](_0x3570c4[_0x25d187]['id']);}}else{var _0x1e6277=new Action(_0x3570c4[_0x25d187],_0x19c387);_0x1e6277[_0xd7df('0x95')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));_0x19c387[_0xd7df('0x97')]+=0x1;ut[_0xd7df('0x98')](_0x1e6277,0x17,_0xd7df('0x99'));if(_0x19c387['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xd7df('0x9a')](_0x3570c4[_0x25d187]));rpcDb[_0xd7df('0x9b')](_0x1e6277,_0xd7df('0x9c'));}else{ut['logCustomer'](_0x1e6277,0x16,_0xd7df('0x9d'));rpcDb[_0xd7df('0x9b')](_0x1e6277,_0xd7df('0x9e'));rpcDb[_0xd7df('0x9f')](_0x1e6277,'[HistoryRecallClose]');}}}}})[_0xd7df('0x7f')](ut[_0xd7df('0x92')](_0xd7df('0xa0')));};Preview[_0xd7df('0x6c')][_0xd7df('0x71')]=function(_0x2fbc53){_0x2fbc53[_0xd7df('0x66')]=!![];if(ut[_0xd7df('0xa1')](_0x2fbc53['loggedIn'])){_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa2');}else if(!ut['isActive'](_0x2fbc53['dialActive'])){_0x2fbc53['message']=_0xd7df('0x68');}else if(!this[_0xd7df('0xa3')](_0x2fbc53[_0xd7df('0x5b')])){if(!this[_0xd7df('0xa3')](_0x2fbc53['TrunkBackup'])){_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa4');}else{_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa5');}}else{_0x2fbc53[_0xd7df('0x53')]=_0xd7df('0xa5');}emitCampaignPreview(_0x2fbc53);};Preview[_0xd7df('0x6c')]['callProgressDetectingCustomer']=function(_0x535925,_0x40d5c9,_0x5c1e68){var _0x588537=this;var _0x332fb3=this[_0xd7df('0x19')][_0x40d5c9];var _0x55b859=this['campaignsPreview'][_0x332fb3[_0xd7df('0x76')]];var _0x44d824;if(_0x55b859){switch(_0x5c1e68){case'1':_0x55b859['outboundNoSuchCallsDay']+=0x1;_0x332fb3[_0xd7df('0xa6')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x0,_0xd7df('0xa8'));ami['emit'](_0xd7df('0xa9'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xab')));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xac'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x332fb3[_0xd7df('0xa6')]>=_0x55b859[_0xd7df('0xb1')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xb2'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xa6'),_0x55b859[_0xd7df('0xb5')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3['activeContact']);}}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;case'ANSWER':var _0xb80762=moment()[_0xd7df('0x60')](_0xd7df('0x96'));_0x332fb3[_0xd7df('0xb8')]=_0xb80762;_0x332fb3['answertime']=_0xb80762;_0x332fb3['dialAnswer']=!![];_0x55b859['pTalking']+=0x1;logger[_0xd7df('0x62')]('[syncHangup][talking][increment]',_0x332fb3[_0xd7df('0xb9')],_0xd7df('0xba'),_0x55b859[_0xd7df('0x2e')],_0xd7df('0x78'),_0x55b859[_0xd7df('0x33')]);ami[_0xd7df('0x2c')]('custom:agentconnect',ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xbb'),this[_0xd7df('0x16')][_0x332fb3['queue']]));if(_0x55b859[_0xd7df('0xbc')]){ami[_0xd7df('0x2c')]('custom:agentConnectPreview',ut[_0xd7df('0xbd')](_0x332fb3));}break;case'16':ami[_0xd7df('0x2c')](_0xd7df('0xbe'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xbf'),this[_0xd7df('0x16')][_0x332fb3[_0xd7df('0x76')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x332fb3,_0xd7df('0xbf')));_0x55b859[_0xd7df('0x42')]+=0x1;_0x55b859[_0xd7df('0x36')]+=0x1;_0x55b859[_0xd7df('0x30')]+=0x1;ut['decrementTalkink'](_0x55b859,'[16]');_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x4,_0xd7df('0xc0'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xd7df('0x9f')](_0x332fb3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x332fb3);_0x55b859[_0xd7df('0xc1')]+=_0x332fb3[_0xd7df('0xc2')];_0x55b859[_0xd7df('0x34')]+=_0x332fb3[_0xd7df('0xc2')];logger[_0xd7df('0x62')](_0xd7df('0xc3'),_0x332fb3['uniqueid'],'\x20Queue',_0x55b859[_0xd7df('0x2e')],_0xd7df('0x78'),_0x55b859[_0xd7df('0x33')]);delete this[_0xd7df('0x19')][_0x535925['linkedid']];break;case _0xd7df('0xc4'):_0x55b859['outboundBusyCallsDay']+=0x1;_0x332fb3[_0xd7df('0xc5')]+=0x1;_0x332fb3['countglobal']=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x5,_0xd7df('0xc6'));ami[_0xd7df('0x2c')](_0xd7df('0xc7'),ut[_0xd7df('0xaa')](_0x332fb3,'busy'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xc8'));}else{if(_0x332fb3[_0xd7df('0xc5')]>=_0x55b859[_0xd7df('0xc9')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xca'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xc5'),_0x55b859[_0xd7df('0xcb')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xcd'):_0x55b859['outboundNoAnswerCallsDay']+=0x1;_0x332fb3[_0xd7df('0xce')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut['logCustomer'](_0x332fb3,0x3,'NoAnswer');ami[_0xd7df('0x2c')](_0xd7df('0xcf'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xd0')));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xd1'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xd2'));}else{if(_0x332fb3[_0xd7df('0xce')]>=_0x55b859[_0xd7df('0xd3')]){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xd1'));}else{rpcDb[_0xd7df('0xb3')](ut['scheduledAt'](_0x332fb3,'countnoanswerretry',_0x55b859[_0xd7df('0xd4')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xd5'):_0x55b859[_0xd7df('0x45')]+=0x1;_0x332fb3['countcongestionretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x8,_0xd7df('0xd6'));ami[_0xd7df('0x2c')](_0xd7df('0xd7'),ut[_0xd7df('0xaa')](_0x332fb3,'congestion'));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xd8'));}else{if(_0x332fb3['countcongestionretry']>=_0x55b859['dialCongestionMaxRetry']){rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xd9'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xda'),_0x55b859['dialBusyRetryFrequency']),_0x332fb3['unlockAgent'],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xdb'):_0x55b859[_0xd7df('0x47')]+=0x1;_0x332fb3[_0xd7df('0xdc')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x14,_0xd7df('0xdd'));ami[_0xd7df('0x2c')](_0xd7df('0xde'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xdf')));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[syncHangupRequest][logAgentReject]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0x14,'AgentReject');rpcDb[_0xd7df('0x9f')](_0x44d824,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x332fb3[_0xd7df('0xdc')]>=_0x55b859[_0xd7df('0xe0')]){rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xe1'));}else{rpcDb[_0xd7df('0xb3')](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xdc'),_0x55b859[_0xd7df('0xe2')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case _0xd7df('0xe3'):_0x55b859[_0xd7df('0xe4')]+=0x1;_0x332fb3['countabandonedretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut['logCustomer'](_0x332fb3,0xb,'Abandoned');rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xe5'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb[_0xd7df('0x9f')](_0x44d824,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x332fb3[_0xd7df('0xe6')]>=_0x55b859[_0xd7df('0xe7')]){rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0xd7df('0xb4')](_0x332fb3,_0xd7df('0xe8'),_0x55b859[_0xd7df('0xe9')]),_0x332fb3[_0xd7df('0xb6')],_0x332fb3[_0xd7df('0xcc')]);}}break;case'18':_0x55b859[_0xd7df('0x48')]+=0x1;_0x332fb3['countmachineretry']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x12,_0x535925[_0xd7df('0xea')]||_0x535925[_0xd7df('0xeb')]);ami[_0xd7df('0x2c')](_0xd7df('0xec'),ut[_0xd7df('0xaa')](_0x332fb3,_0xd7df('0xed')));rpcDb[_0xd7df('0x9b')](_0x332fb3,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859['dialGlobalMaxRetry']){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb[_0xd7df('0x9f')](_0x44d824,_0xd7df('0xee'));}else{rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xee'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;case'19':_0x55b859[_0xd7df('0x48')]+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut[_0xd7df('0xad')](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0x13,_0x535925[_0xd7df('0xea')]||_0x535925['dialstatus']);ami[_0xd7df('0x2c')]('custom:amd',ut['buildObj'](_0x332fb3,'amd'));rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xef'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859[_0xd7df('0xae')]){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xef'));}else{rpcDb[_0xd7df('0x9f')](_0x332fb3,_0xd7df('0xef'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];break;default:if(_0x332fb3[_0xd7df('0x79')]){ut['decrementTalkink'](_0x55b859,_0xd7df('0xf0'));ut['loggerError'](_0xd7df('0xf1')+_0x55b859[_0xd7df('0x2e')],_0x535925);}_0x55b859['outboundUnknownCallsDay']+=0x1;_0x332fb3[_0xd7df('0xa7')]=ut['totalGlobal'](_0x332fb3);ut[_0xd7df('0x98')](_0x332fb3,0xc,_0x535925[_0xd7df('0xea')]||_0x535925[_0xd7df('0xeb')]);rpcDb[_0xd7df('0x9b')](_0x332fb3,_0xd7df('0xf2'));if(ut[_0xd7df('0xad')](_0x332fb3)>=_0x55b859['dialGlobalMaxRetry']){_0x44d824=ut[_0xd7df('0xaf')](_0x332fb3,0xf,_0xd7df('0xb0'));rpcDb['createCustomerFinal'](_0x44d824,_0xd7df('0xf3'));}else{rpcDb['createCustomerFinal'](_0x332fb3,_0xd7df('0xf3'));}delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];}if(!(_0x332fb3[_0xd7df('0x79')]&&_0x5c1e68==='16')){ut[_0xd7df('0x80')](_0x55b859,'[callProgressDetectingCustomer]');logger[_0xd7df('0x62')](_0xd7df('0xf4'),_0x332fb3[_0xd7df('0xb9')],_0xd7df('0xba'),_0x55b859[_0xd7df('0x2e')],_0xd7df('0x77'),_0x55b859[_0xd7df('0x54')]);}if(_0x5c1e68!=='ANSWER'){delete this[_0xd7df('0x19')][_0x535925[_0xd7df('0xb7')]];delete this[_0xd7df('0x19')][_0x535925['destlinkedid']];}}};Preview['prototype'][_0xd7df('0xf5')]=function(_0x5275f3,_0x244ac3,_0x5c5af5){if(_[_0xd7df('0xf6')](_0x244ac3)&&_0xd7df('0xf7')!==typeof _0x244ac3){return;}if(_[_0xd7df('0xf6')](_0x5c5af5)&&'object'!==typeof _0x5c5af5){return;}switch(_0x5c5af5['reason']){case'0':ut[_0xd7df('0xf8')](_0x5275f3,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x5275f3,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x5275f3,0x3,_0xd7df('0xf9'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfb'));break;case'5':ut[_0xd7df('0xf8')](_0x5275f3,0x5,_0xd7df('0xc6'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfc'));break;case'8':ut[_0xd7df('0xf8')](_0x5275f3,0x8,_0xd7df('0xd6'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xfd'));break;case'22':ut[_0xd7df('0xf8')](_0x5275f3,0x16,_0xd7df('0xfe'));rpcDb[_0xd7df('0xfa')](_0x5275f3,_0xd7df('0xff'));break;default:ut[_0xd7df('0xf8')](_0x5275f3,0xc,_0x5c5af5['reason']);rpcDb[_0xd7df('0xfa')](_0x5275f3,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd7df('0x80')](_0x244ac3,_0xd7df('0x100'));logger[_0xd7df('0x62')]('[originated][decrement][callProgressDetectingAgent]',_0x5275f3['uniqueid'],_0xd7df('0xba'),_0x244ac3[_0xd7df('0x2e')],_0xd7df('0x77'),_0x244ac3['originated']);delete this[_0xd7df('0x19')][_0x5275f3[_0xd7df('0xb9')]];};Preview['prototype'][_0xd7df('0x101')]=function(_0x3494e8,_0x5dc0ed,_0x2c94db,_0x52a8d8,_0x5e7f75){var _0x4e8ce0=this;return new BPromise(function(_0x40c32a,_0x1b90a3){if(_['isNil'](_0x5dc0ed)||_[_0xd7df('0x74')](_0x5dc0ed['Contact'])||_[_0xd7df('0x74')](_0x5dc0ed[_0xd7df('0x102')][_0xd7df('0x103')])||_['isNil'](_0x5dc0ed[_0xd7df('0x104')])){_0x1b90a3(ut[_0xd7df('0x53')](_0xd7df('0x105'),_0x52a8d8,_0x5e7f75));return;}var _0x246b97=uuid['v4']();var _0x45fbb1=_0x4e8ce0[_0xd7df('0x16')][_0x5dc0ed[_0xd7df('0x106')][_0xd7df('0x2e')]];var _0x488607=_0x2c94db?_0x4e8ce0['agents'][_0x2c94db]['id']:undefined;_0x4e8ce0[_0xd7df('0x19')][_0x246b97]=new Action(_0x5dc0ed,_0x45fbb1,_0x246b97,_0x2c94db,_0x488607);var _0x4e6e77=_0x4e8ce0['actions'][_0x246b97];_0x4e6e77[_0xd7df('0xb6')]=_0x52a8d8;_0x4e6e77[_0xd7df('0xcc')]=_0x5e7f75;_0x4e6e77[_0xd7df('0x107')]=_0x2c94db;if(_[_0xd7df('0x108')](_0x3494e8)){_0x4e8ce0[_0xd7df('0x109')](_0x4e6e77,_0x45fbb1,_0x5dc0ed,_0x2c94db)['then'](function(_0x2b5791){logger[_0xd7df('0x62')](_0xd7df('0x10a'),_0xd7df('0x10b')+_0x4e6e77[_0xd7df('0x76')]+_0xd7df('0x10c')+_0x4e6e77[_0xd7df('0x10d')],JSON[_0xd7df('0x5f')](_0x2b5791));ami['emit'](_0xd7df('0x10e'),ut[_0xd7df('0xaa')](_0x4e6e77,_0xd7df('0x10f'),_0x4e8ce0[_0xd7df('0x16')][_0x4e6e77['queue']]));_0x40c32a(ut['message'](_0xd7df('0x110')));})[_0xd7df('0x7f')](function(_0x4af3bc){ut['logger'](_0xd7df('0x111'),_0x4af3bc);_0x1b90a3(ut['message'](_0xd7df('0x112'),_0x52a8d8,_0x5e7f75));});}else{_0x45fbb1[_0xd7df('0x43')]+=0x1;ut['logBlacklist'](_0x4e6e77);rpcDb[_0xd7df('0x113')](_0x4e6e77,'[Blacklist][error]');delete _0x4e8ce0[_0xd7df('0x19')][_0x246b97];_0x1b90a3(ut[_0xd7df('0x53')](_0xd7df('0x114'),_0x52a8d8,_0x5e7f75));}});};Preview[_0xd7df('0x6c')][_0xd7df('0xa3')]=function(_0x1fe4be){return!_[_0xd7df('0x74')](_0x1fe4be)&&!_[_0xd7df('0x74')](_0x1fe4be['name'])&&!_['isNil'](_0x1fe4be[_0xd7df('0x5c')])&&_0x1fe4be[_0xd7df('0x5c')]&&!_[_0xd7df('0x74')](this['trunks'][util['format'](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])])&&!_[_0xd7df('0x74')](this['trunks'][util[_0xd7df('0x60')](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])]['status'])&&(this[_0xd7df('0x18')][util[_0xd7df('0x60')](_0xd7df('0x115'),_0x1fe4be[_0xd7df('0x2e')])][_0xd7df('0x7d')]===_0xd7df('0x116')||this['trunks'][util['format']('SIP/%s',_0x1fe4be[_0xd7df('0x2e')])][_0xd7df('0x7d')]===_0xd7df('0x117'));};Preview[_0xd7df('0x6c')]['run']=function(_0x32b24c,_0x249f4c){var _0x5edd49=this;return new BPromise(function(_0x9dfc27,_0x57e2f9){_0x5edd49[_0xd7df('0x118')](_0x32b24c,_0x249f4c)[_0xd7df('0x8a')](function(_0x191ab8){_0x9dfc27(_[_0xd7df('0x119')](_0x191ab8,[_0xd7df('0x53')]));})['catch'](function(_0x48183e){if(_0x48183e[_0xd7df('0x11a')]){rpcDb[_0xd7df('0x11b')](_0x32b24c);}if(_0x48183e[_0xd7df('0x5c')]){rpcDb['disableContact'](_0x32b24c);}_0x57e2f9(_[_0xd7df('0x119')](_0x48183e,[_0xd7df('0x53')]));});});};Preview[_0xd7df('0x6c')][_0xd7df('0x118')]=function(_0x5479dc,_0x1c2dad){var _0x32df94=this;return new BPromise(function(_0x5e69ae,_0x2e7b75){var _0x139b57,_0x51e16e;rpcDb['getContactPreview'](_0x5479dc)['then'](function(_0x3a47c2){if(!_[_0xd7df('0x74')](_0x3a47c2[0x0])){_0x51e16e=_0x3a47c2[0x0][_0xd7df('0x11c')]?![]:!![];_0x139b57=_0x3a47c2[0x0][_0xd7df('0x11c')]?!![]:![];_0x139b57=_0x1c2dad?!![]:_0x139b57;}var _0x38389f=_0x32df94[_0xd7df('0x11d')](_0x3a47c2);if(_0x38389f[_0xd7df('0x11e')]){rpcDb['checkIsBlackList'](_['pick'](_0x3a47c2[0x0],['VoiceQueueId',_0xd7df('0x11f')]))['then'](function(_0x188610){_0x32df94[_0xd7df('0x101')](_0x188610,_0x3a47c2[0x0],_0x1c2dad,_0x51e16e,_0x139b57)['then'](function(_0x3d058a){_0x5e69ae(_0x3d058a);})[_0xd7df('0x7f')](function(_0xafcb26){_0x2e7b75(_0xafcb26);});})[_0xd7df('0x7f')](function(_0x472d0d){ut['logger'](_0xd7df('0x120'),_0x472d0d);_0x2e7b75(ut['message']('Call\x20unsuccessful',_0x51e16e,_0x139b57));});}else{_0x2e7b75(ut[_0xd7df('0x53')](_0x38389f['message'],_0x51e16e,_0x139b57));}})['catch'](function(_0x36d991){ut['logger'](_0xd7df('0x121'),_0x36d991);_0x2e7b75(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd7df('0x6c')]['validateContact']=function(_0x36f7d4){if(_[_0xd7df('0x74')](_0x36f7d4)||_['isEmpty'](_0x36f7d4)||!_[_0xd7df('0x74')](_0x36f7d4[0x0][_0xd7df('0x8f')])&&_[_0xd7df('0x74')](_0x36f7d4[0x0][_0xd7df('0x8f')]['name'])){ut[_0xd7df('0x6b')](_0xd7df('0x122'),_0x36f7d4);return{'isValid':![],'message':_0xd7df('0x123')};}var _0x53508f=this['campaignsPreview'][_0x36f7d4[0x0][_0xd7df('0x106')]['name']];_0x53508f[_0xd7df('0x53')]=_0xd7df('0xa5');if(_[_0xd7df('0x74')](_0x53508f)){ut['logger'](_0xd7df('0x124'),_0x53508f);return{'isValid':![],'message':_0xd7df('0x125')};}if(!this[_0xd7df('0xa3')](_0x53508f[_0xd7df('0x5b')])){ut['logger'](_0xd7df('0x126'),_0xd7df('0x127')+_0x53508f[_0xd7df('0x2e')]+_0xd7df('0x128'));if(!this[_0xd7df('0xa3')](_0x53508f[_0xd7df('0x129')])){ut['logger'](_0xd7df('0x126'),_0x53508f['name']+_0xd7df('0x12a'));return{'isValid':![],'message':_0xd7df('0x12b')};}}if(!ut[_0xd7df('0x12c')](_0x53508f['dialActive'])){ut[_0xd7df('0x6b')](_0xd7df('0x12d'),_0x53508f['name']+_0xd7df('0x12e'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53508f[_0xd7df('0x2e')]+_0xd7df('0x12e')};}return{'isValid':!![],'message':_0xd7df('0x12f')};};Preview[_0xd7df('0x6c')][_0xd7df('0x109')]=function(_0x3f19a2,_0x95dd5,_0x26b10c,_0x51c4c4){var _0x5a1549=this;return new BPromise(function(_0xee4852,_0x5ada9d){var _0x53b350=_0x3f19a2['uniqueid'];var _0x4c1334=_0x5a1549[_0xd7df('0xa3')](_0x95dd5[_0xd7df('0x5b')])?util[_0xd7df('0x60')](_0xd7df('0x130'),_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x2e')],_[_0xd7df('0x74')](_0x95dd5['dialPrefix'])?'':_0x95dd5[_0xd7df('0x40')][_0xd7df('0x131')]()||'',_0x95dd5[_0xd7df('0x132')]>0x0?_0x26b10c[_0xd7df('0x102')][_0xd7df('0x103')][_0xd7df('0x133')](_0x95dd5[_0xd7df('0x132')]):_0x26b10c['Contact'][_0xd7df('0x103')]):util[_0xd7df('0x60')](_0xd7df('0x130'),_['isNil'](_0x95dd5[_0xd7df('0x129')])?_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x2e')]:_0x95dd5[_0xd7df('0x129')]['name'],_[_0xd7df('0x74')](_0x95dd5['dialPrefix'])?'':_0x95dd5[_0xd7df('0x40')][_0xd7df('0x131')]()||'',_0x95dd5[_0xd7df('0x132')]>0x0?_0x26b10c['Contact'][_0xd7df('0x103')][_0xd7df('0x133')](_0x95dd5[_0xd7df('0x132')]):_0x26b10c[_0xd7df('0x102')]['phone']);var _0x1e4346=_0x5a1549['isTrunkReachable'](_0x95dd5[_0xd7df('0x5b')])?ut[_0xd7df('0x134')](_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x5d')],_0x95dd5[_0xd7df('0x135')],_0x95dd5['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd7df('0x136')](_0x95dd5['dialOriginateCallerIdNumber'],_0x95dd5[_0xd7df('0x137')]):_0x95dd5[_0xd7df('0x3e')]):ut[_0xd7df('0x134')](_[_0xd7df('0x74')](_0x95dd5['TrunkBackup'])?_0x95dd5[_0xd7df('0x5b')][_0xd7df('0x5d')]:_0x95dd5[_0xd7df('0x129')][_0xd7df('0x5d')],_0x95dd5['dialOriginateCallerIdName'],_0x95dd5[_0xd7df('0x137')]>0x0?ut[_0xd7df('0x136')](_0x95dd5[_0xd7df('0x3e')],_0x95dd5[_0xd7df('0x137')]):_0x95dd5[_0xd7df('0x3e')]);if(_0x1e4346){_0x3f19a2[_0xd7df('0x138')]=ut[_0xd7df('0x139')](_0x1e4346);_0x3f19a2[_0xd7df('0x13a')]=ut[_0xd7df('0x13b')](_0x1e4346);}var _0x27627f=ut['addVariables'](_0x95dd5,_0x26b10c,_0x4c1334,_0x1e4346,_0x53b350,_0x3f19a2);_[_0xd7df('0x13c')](_0x3f19a2,ut['toLowerVariables'](_0x27627f));_0x3f19a2[_0xd7df('0x95')]=moment()[_0xd7df('0x60')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xd7df('0x13d')](ut[_0xd7df('0x13e')](_0x3f19a2,_0x95dd5,_0x27627f,_0x3f19a2[_0xd7df('0xcc')],_0x51c4c4))[_0xd7df('0x8a')](function(_0x719c95){_0x95dd5[_0xd7df('0x54')]+=0x1;logger[_0xd7df('0x62')](_0xd7df('0x13f'),_0x53b350,_0xd7df('0xba'),_0x95dd5['name'],_0xd7df('0x77'),_0x95dd5[_0xd7df('0x54')]);_0xee4852(_0x719c95);})[_0xd7df('0x7f')](function(_0x514186){ut[_0xd7df('0xf8')](_0x3f19a2,0xe,_0xd7df('0x140'));rpcDb['createAgentHistory'](_0x3f19a2,'[originateFailure][logOriginateFailure]');_0x5ada9d(_0x514186);});});};Preview[_0xd7df('0x6c')][_0xd7df('0x26')]=function(_0x14f37b){if(this[_0xd7df('0x19')][_0x14f37b[_0xd7df('0xb7')]]){this[_0xd7df('0x19')][_0x14f37b['linkedid']][_0xd7df('0x7e')]=_0x14f37b[_0xd7df('0x7e')];}};Preview[_0xd7df('0x6c')][_0xd7df('0x1d')]=function(_0x304119){var _0x145af8=this;var _0x2934f2=this[_0xd7df('0x19')][_0x304119[_0xd7df('0x141')]];if(_0x2934f2){if(_0x2934f2[_0xd7df('0x107')]&&this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]]){ut[_0xd7df('0x142')](_0x2934f2,this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]][_0xd7df('0x2e')],this[_0xd7df('0x1a')][_0x2934f2[_0xd7df('0x107')]]['id']);}var _0x486a6b=_['clone'](_0x2934f2);_0x486a6b[_0xd7df('0xb8')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));var _0x9369a8=_0x145af8[_0xd7df('0x16')][_0x2934f2['queue']];if(ut[_0xd7df('0x143')](_0x304119['response'])){if(_0x2934f2[_0xd7df('0xb6')]){rpcDb[_0xd7df('0x11b')](_0x2934f2['idContact']);}if(_0x2934f2[_0xd7df('0xcc')]){rpcDb[_0xd7df('0x94')](_0x2934f2['idContact']);}ami[_0xd7df('0x2c')]('custom:agentringnoanswer',ut[_0xd7df('0xaa')](_0x2934f2,'rejected',this[_0xd7df('0x16')][_0x2934f2[_0xd7df('0x76')]]));this[_0xd7df('0xf5')](_0x486a6b,_0x9369a8,_0x304119);}else{_0x2934f2[_0xd7df('0x95')]=moment()[_0xd7df('0x60')](_0xd7df('0x96'));ut[_0xd7df('0xf8')](_0x486a6b,0x4,_0xd7df('0xc0'));rpcDb['createAgentHistory'](_0x486a6b,_0xd7df('0x144'));}}};Preview[_0xd7df('0x6c')]['syncHangup']=function(_0x329a10){var _0x5c5546=this;var _0x2fa4c0=this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]];var _0x4264a9;if(_0x2fa4c0){_0x4264a9=this[_0xd7df('0x16')][_0x2fa4c0['queue']];logger['info']('[syncHangup][talking]',_0x329a10[_0xd7df('0xb7')],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);}if(this['actions'][_0x329a10['linkedid']]&&_0x329a10[_0xd7df('0xb7')]!==_0x329a10['uniqueid']){if(_0x329a10[_0xd7df('0x145')]==='16'&&this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]]['dialAnswer']){this[_0xd7df('0x146')](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')]);}else if(this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]]['dialAnswer']){logger['info'](_0xd7df('0x147'),_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);this[_0xd7df('0x146')](_0x329a10,_0x329a10['linkedid'],_0x329a10[_0xd7df('0x145')]);}}else if(_0x2fa4c0&&_['isNil'](_0x2fa4c0[_0xd7df('0x148')])&&_0x4264a9[_0xd7df('0x149')]&&_0x329a10[_0xd7df('0xb7')]===_0x329a10[_0xd7df('0xb9')]&&_[_0xd7df('0x74')](_0x329a10[_0xd7df('0x14a')])&&_0x329a10[_0xd7df('0x145')]==='16'&&_0x329a10['channelstate']==='6'&&_[_0xd7df('0xf6')](_0x2fa4c0[_0xd7df('0x14b')])){if(_0x2fa4c0[_0xd7df('0xb6')]){rpcDb['unlockContact'](_0x2fa4c0[_0xd7df('0x10d')]);}if(_0x2fa4c0[_0xd7df('0xcc')]){rpcDb[_0xd7df('0x94')](_0x2fa4c0[_0xd7df('0x10d')]);}_0x329a10[_0xd7df('0x14a')]='22';this['callProgressDetectingAgent'](_0x2fa4c0,_0x4264a9,_0x329a10);}else if(_0x2fa4c0&&_0x2fa4c0[_0xd7df('0x14b')]){if(_0x329a10['cause']==='16'&&this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]][_0xd7df('0x79')]){logger['info'](_0xd7df('0x14c'),_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')],'\x20Queue',_0x4264a9['name'],'pTalking:\x20',_0x4264a9[_0xd7df('0x33')]);this['callProgressDetectingCustomer'](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10[_0xd7df('0x145')]);}else if(this[_0xd7df('0x19')][_0x329a10[_0xd7df('0xb7')]][_0xd7df('0x79')]){logger['info'](_0xd7df('0x147'),_0x329a10['linkedid'],_0x329a10['cause'],_0xd7df('0xba'),_0x4264a9[_0xd7df('0x2e')],_0xd7df('0x78'),_0x4264a9[_0xd7df('0x33')]);this[_0xd7df('0x146')](_0x329a10,_0x329a10[_0xd7df('0xb7')],_0x329a10['cause']);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x24')]=function(_0xe9a387){if(this['actions'][_0xe9a387[_0xd7df('0x14d')]]&&_0xe9a387[_0xd7df('0x14d')]!==_0xe9a387[_0xd7df('0x14e')]){this[_0xd7df('0x146')](_0xe9a387,_0xe9a387[_0xd7df('0x14d')],_0xe9a387[_0xd7df('0xeb')]);}};Preview[_0xd7df('0x6c')][_0xd7df('0x22')]=function(_0x2f722d){if(this[_0xd7df('0x19')][_0x2f722d['linkedid']]&&_0x2f722d[_0xd7df('0xb7')]!==_0x2f722d[_0xd7df('0xb9')]&&!this['actions'][_0x2f722d[_0xd7df('0xb7')]]['dialAnswer']){if(_0x2f722d[_0xd7df('0x145')]==='1'){this[_0xd7df('0x146')](_0x2f722d,_0x2f722d[_0xd7df('0xb7')],_0x2f722d[_0xd7df('0x145')]);}}};Preview[_0xd7df('0x6c')][_0xd7df('0x14f')]=function(_0x12ee07,_0x20768d,_0x50f648){if(this[_0xd7df('0x19')][_0x12ee07]){if(_['isNil'](this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')])){this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')]={};}this[_0xd7df('0x19')][_0x12ee07][_0xd7df('0x150')][_0x20768d]=_0x50f648;}};Preview['prototype'][_0xd7df('0x27')]=function(_0x496755){try{if(!_['isNil'](_0x496755)){if(ut[_0xd7df('0x151')](_[_0xd7df('0x152')](_0x496755[_0xd7df('0x153')])[0x0])){this[_0xd7df('0x14f')](_0x496755[_0xd7df('0xb9')],_[_0xd7df('0x152')](_0x496755[_0xd7df('0x153')])[0x0],_0x496755[_0xd7df('0x154')]);}}}catch(_0x178432){logger[_0xd7df('0x155')](_0xd7df('0x156'),util[_0xd7df('0x157')](_0x178432,{'showHidden':![],'depth':null}));}};Preview[_0xd7df('0x6c')][_0xd7df('0x158')]=function(_0x3edf54){if(_0x3edf54){if(this[_0xd7df('0x19')][_0x3edf54['transfertargetlinkedid']]){this[_0xd7df('0x19')][_0x3edf54[_0xd7df('0x159')]][_0xd7df('0x14b')]=!![];}}};Preview[_0xd7df('0x6c')][_0xd7df('0x2a')]=function(_0x166963){if(_0x166963){if(this[_0xd7df('0x19')][_0x166963['transfererlinkedid']]){this['actions'][_0x166963['transfererlinkedid']][_0xd7df('0x14b')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x9f62=['[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','moment','md5','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','prototype','enqueue','tail','sequence','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','outbound','name','strategy','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','logger','\x20is\x20disactive','hasOwnProperty','booked','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','ListId','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','lookAgent','isEmpty','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','active','trunks','SIP/%s','status','disableContact','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','trim','substring','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','starttime','Action','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','unlockContact','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','transfer'];(function(_0x2c0b2e,_0x274a4d){var _0xcad91b=function(_0x23e968){while(--_0x23e968){_0x2c0b2e['push'](_0x2c0b2e['shift']());}};_0xcad91b(++_0x274a4d);}(_0x9f62,0x154));var _0x29f6=function(_0xc0269d,_0xf87eca){_0xc0269d=_0xc0269d-0x0;var _0x8fd996=_0x9f62[_0xc0269d];return _0x8fd996;};'use strict';var util=require('util');var _=require(_0x29f6('0x0'));var BPromise=require('bluebird');var uuid=require(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var md5=require(_0x29f6('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var loggerAction=require(_0x29f6('0x4'))(_0x29f6('0x6'));var ami=require('../ami');var rpcDb=require(_0x29f6('0x7'));var Action=require(_0x29f6('0x8'));var ut=require(_0x29f6('0x9'));config[_0x29f6('0xa')]=_[_0x29f6('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x29f6('0xc')][_0x29f6('0xd')]=function(_0x4fb455){this['tail']=this[_0x29f6('0xe')]?this[_0x29f6('0xe')]['finally'](_0x4fb455):_0x4fb455();};function Preview(_0x17b69c){this[_0x29f6('0xf')]=new Sequence();this['campaignsPreview']=_0x17b69c['voiceQueues'];this['trunks']=_0x17b69c['trunks'];this[_0x29f6('0x10')]={};this[_0x29f6('0x11')]=_0x17b69c[_0x29f6('0x11')];this[_0x29f6('0x12')]=0x0;ami['on'](_0x29f6('0x13'),this[_0x29f6('0x14')][_0x29f6('0x15')](this));ami['on'](_0x29f6('0x16'),this[_0x29f6('0x17')][_0x29f6('0x15')](this));ami['on'](_0x29f6('0x18'),this[_0x29f6('0x19')][_0x29f6('0x15')](this));ami['on'](_0x29f6('0x1a'),this[_0x29f6('0x1b')][_0x29f6('0x15')](this));ami['on'](_0x29f6('0x1c'),this['syncNewExten']['bind'](this));ami['on'](_0x29f6('0x1d'),this[_0x29f6('0x1e')][_0x29f6('0x15')](this));ami['on']('attendedtransfer',this[_0x29f6('0x1f')][_0x29f6('0x15')](this));ami['on']('blindtransfer',this[_0x29f6('0x20')][_0x29f6('0x15')](this));this[_0x29f6('0x21')](this[_0x29f6('0x22')]);}function emit(_0xb6e7a9,_0x2bfb3d,_0x5673c8){io['to'](_0xb6e7a9)[_0x29f6('0x23')](_0x2bfb3d,_0x5673c8);}function emitCampaignPreview(_0x59def4){if(_0x59def4['type']===_0x29f6('0x24')){var _0x1fa159={'id':_0x59def4['id'],'name':_0x59def4[_0x29f6('0x25')],'strategy':_0x59def4[_0x29f6('0x26')],'answered':_0x59def4['answered'],'available':_0x59def4[_0x29f6('0x27')],'loggedIn':_0x59def4['loggedIn'],'pTalking':_0x59def4[_0x29f6('0x28')],'sumBillable':_0x59def4[_0x29f6('0x29')],'sumDuration':_0x59def4[_0x29f6('0x2a')],'sumHoldTime':_0x59def4[_0x29f6('0x2b')]||0x0,'talking':_0x59def4['talking'],'total':_0x59def4[_0x29f6('0x2c')],'type':_0x59def4[_0x29f6('0x2d')],'unmanaged':_0x59def4['unmanaged'],'abandoned':_0x59def4[_0x29f6('0x2e')],'waiting':_0x59def4[_0x29f6('0x2f')],'loggedInDb':_0x59def4[_0x29f6('0x30')],'dialActive':_0x59def4[_0x29f6('0x31')],'dialMethod':_0x59def4[_0x29f6('0x32')],'dialOriginateCallerIdName':_0x59def4[_0x29f6('0x33')],'dialOriginateCallerIdNumber':_0x59def4[_0x29f6('0x34')],'dialOriginateTimeout':_0x59def4['dialOriginateTimeout'],'dialPrefix':_0x59def4[_0x29f6('0x35')],'outboundAnswerAgiCallsDay':_0x59def4[_0x29f6('0x36')],'outboundAnswerCallsDay':_0x59def4[_0x29f6('0x37')],'outboundBlacklistCallsDay':_0x59def4[_0x29f6('0x38')],'outboundBusyCallsDay':_0x59def4[_0x29f6('0x39')],'outboundCongestionCallsDay':_0x59def4[_0x29f6('0x3a')],'outboundDropCallsDayACS':_0x59def4[_0x29f6('0x3b')],'outboundDropCallsDayCallersExit':_0x59def4[_0x29f6('0x3c')],'outboundDropCallsDayTimeout':_0x59def4[_0x29f6('0x3d')],'outboundNoAnswerCallsDay':_0x59def4[_0x29f6('0x3e')],'outboundNoSuchCallsDay':_0x59def4[_0x29f6('0x3f')],'outboundOriginateFailureCallsDay':_0x59def4[_0x29f6('0x40')],'outboundReCallsDay':_0x59def4[_0x29f6('0x41')],'outboundRejectCallsDay':_0x59def4[_0x29f6('0x42')],'outboundUnknownCallsDay':_0x59def4[_0x29f6('0x43')],'outboundAbandonedCallsDay':_0x59def4[_0x29f6('0x44')],'predictiveIntervalAnsweredCalls':_0x59def4[_0x29f6('0x45')],'predictiveIntervalAvgHoldtime':_0x59def4['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x59def4['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x59def4[_0x29f6('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x59def4['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x59def4[_0x29f6('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x59def4[_0x29f6('0x48')],'predictiveIntervalHitRate':_0x59def4[_0x29f6('0x49')],'predictiveIntervalMultiplicativeFactor':_0x59def4[_0x29f6('0x4a')],'predictiveIntervalPauses':_0x59def4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x59def4['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x59def4[_0x29f6('0x4b')],'message':_0x59def4[_0x29f6('0x4c')],'originated':_0x59def4[_0x29f6('0x4d')],'erlangCalls':_0x59def4[_0x29f6('0x4e')],'erlangCallToSecond':_0x59def4[_0x29f6('0x4f')],'erlangAbandonmentRate':_0x59def4[_0x29f6('0x50')],'erlangBusyFactor':_0x59def4[_0x29f6('0x51')],'startPredictive':_0x59def4[_0x29f6('0x52')],'startProgressive':_0x59def4[_0x29f6('0x53')]};if(_0x59def4[_0x29f6('0x54')]){_0x1fa159[_0x29f6('0x54')]={'id':_0x59def4[_0x29f6('0x54')]['id'],'name':_0x59def4[_0x29f6('0x54')][_0x29f6('0x25')],'active':_0x59def4['Trunk']['active'],'callerid':_0x59def4[_0x29f6('0x54')][_0x29f6('0x55')]};}if(_0x59def4[_0x29f6('0x56')]){_0x1fa159['Interval']={'id':_0x59def4[_0x29f6('0x56')]['id'],'name':_0x59def4[_0x29f6('0x56')][_0x29f6('0x25')]};}var _0x27d945=md5(JSON[_0x29f6('0x57')](_0x1fa159));if(_0x59def4['md5']!==_0x27d945){_0x59def4[_0x29f6('0x3')]=_0x27d945;emit(util[_0x29f6('0x58')](_0x29f6('0x59'),_0x1fa159[_0x29f6('0x25')]),'voice_queue:save',_0x1fa159);}}}function emitVoiceQueueChannelRemove(_0x30d747){logger[_0x29f6('0x5a')](_0x29f6('0x5b'),JSON[_0x29f6('0x57')](_0x30d747));emit(util['format']('voice:queue:%s',_0x30d747[_0x29f6('0x25')]),'voice_queue_channel:remove',_0x30d747);io[_0x29f6('0x23')]('voice_queue_presence:remove',_0x30d747);}function notSendMessagesQueue(_0x3a1a75){if(_0x3a1a75['sendMessageOneNotActive']){if(_0x3a1a75[_0x29f6('0x4d')]===0x0&&_0x3a1a75[_0x29f6('0x28')]===0x0){_0x3a1a75['sendMessageOneNotActive']=![];_0x3a1a75[_0x29f6('0x27')]=0x0;_0x3a1a75['paused']=0x0;_0x3a1a75[_0x29f6('0x4c')]=_0x29f6('0x5c');ut['logger'](_0x29f6('0x5d'),_0x3a1a75[_0x29f6('0x25')]+_0x29f6('0x5e'));}else{_0x3a1a75[_0x29f6('0x4c')]='IS_DISACTIVED';ut[_0x29f6('0x5f')](_0x29f6('0x5d'),_0x3a1a75[_0x29f6('0x25')]+_0x29f6('0x60'));}emitCampaignPreview(_0x3a1a75);}}Preview[_0x29f6('0xc')]['loopCampaigns']=function(){var _0xb5f2b1=this;setInterval(function(){_0xb5f2b1['syncCampaigns']();},0x7cf);};Preview[_0x29f6('0xc')]['syncCampaigns']=function(){var _0xbfe671=this[_0x29f6('0x22')];this['clockClearZombieChannels']+=0x1;for(var _0x28046c in _0xbfe671){if(_0xbfe671[_0x29f6('0x61')](_0x28046c)&&(_0xbfe671[_0x28046c][_0x29f6('0x32')]===_0x29f6('0x5')||_0xbfe671[_0x28046c]['dialMethod']===_0x29f6('0x62'))&&_0xbfe671[_0x28046c][_0x29f6('0x2d')]===_0x29f6('0x24')){if(this['clockClearZombieChannels']>0x7){this[_0x29f6('0x12')]=0x0;this['clearZombieChannels']();}}if(_0xbfe671[_0x29f6('0x61')](_0x28046c)&&_0xbfe671[_0x28046c]['dialMethod']==='preview'&&_0xbfe671[_0x28046c]['type']===_0x29f6('0x24')){if(_0xbfe671[_0x28046c][_0x29f6('0x31')]){this[_0x29f6('0x63')](_0xbfe671[_0x28046c]);if(_0xbfe671[_0x28046c][_0x29f6('0x64')])this[_0x29f6('0x65')](_0xbfe671[_0x28046c]);}else{notSendMessagesQueue(_0xbfe671[_0x28046c]);}}}};Preview[_0x29f6('0xc')][_0x29f6('0x66')]=function(_0x155ffb){var _0x352119=this;this[_0x29f6('0xf')]['enqueue'](function(){if(!_['isNil'](_0x352119[_0x29f6('0x10')][_0x155ffb])){loggerAction[_0x29f6('0x5a')](_0x29f6('0x67'),_0x155ffb,_0x29f6('0x68'),_0x352119['actions'][_0x155ffb][_0x29f6('0x69')],_0x29f6('0x6a'),JSON['stringify'](_0x352119[_0x29f6('0x22')][_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x69')]][_0x29f6('0x4d')]),_0x29f6('0x6b'),JSON[_0x29f6('0x57')](_0x352119[_0x29f6('0x22')][_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x69')]][_0x29f6('0x28')]),JSON[_0x29f6('0x57')](_0x352119[_0x29f6('0x10')][_0x155ffb]['dialAnswer']),JSON[_0x29f6('0x57')](_[_0x29f6('0x6c')](_0x352119[_0x29f6('0x10')][_0x155ffb],[_0x29f6('0x6d'),_0x29f6('0x6e'),'VoiceQueueId',_0x29f6('0x6f')])));return ami['Action']({'action':'status','channel':_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x70')]})[_0x29f6('0x71')](function(_0x1a566f){if(_0x1a566f[_0x29f6('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x352119[_0x29f6('0x10')][_0x155ffb]){ut[_0x29f6('0x72')](_0x352119['campaignsPreview'][_0x352119[_0x29f6('0x10')][_0x155ffb]['queue']],_0x29f6('0x73'));if(_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x74')]===!![]){ut[_0x29f6('0x75')](_0x352119['campaignsPreview'][_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x69')]],_0x29f6('0x73'));ut[_0x29f6('0x76')](_0x29f6('0x77')+_0x155ffb,_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x69')]);}ut['loggerError'](_0x29f6('0x78')+_0x155ffb,_0x352119[_0x29f6('0x10')][_0x155ffb][_0x29f6('0x69')]);delete _0x352119[_0x29f6('0x10')][_0x155ffb];}},0x2328);}});}});};Preview[_0x29f6('0xc')][_0x29f6('0x79')]=function(){var _0x37c3c1=this;loggerAction[_0x29f6('0x5a')](_0x29f6('0x7a'),_[_0x29f6('0x7b')](this['actions']));for(var _0x5d7c9a in this[_0x29f6('0x10')]){if(_0x37c3c1[_0x29f6('0x10')][_0x29f6('0x61')](_0x5d7c9a)){_0x37c3c1['clearZombieChannel'](_0x5d7c9a);}}};Preview[_0x29f6('0xc')]['recallMe']=function(_0x550190){var _0x22b8ef=this;rpcDb[_0x29f6('0x7c')](_0x550190['id'],ut['agentReadyId'](this['agents']))[_0x29f6('0x7d')](function(_0x46998c){if(!_[_0x29f6('0x7e')](_0x46998c)){for(var _0x58694e=0x0;_0x58694e<_0x46998c[_0x29f6('0x7f')];_0x58694e+=0x1){if(ut[_0x29f6('0x80')](_0x46998c[_0x58694e][_0x29f6('0x81')])<_0x550190[_0x29f6('0x82')]*0x3c){if(_0x46998c[_0x58694e][_0x29f6('0x83')]&&!_0x46998c[_0x58694e][_0x29f6('0x83')][_0x29f6('0x84')]){_0x22b8ef[_0x29f6('0x85')](_0x46998c[_0x58694e]['id'])[_0x29f6('0x7d')](ut[_0x29f6('0x86')](_0x29f6('0x87')))[_0x29f6('0x71')](ut[_0x29f6('0x86')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x46998c[_0x58694e]['id']);}}else{var _0x2bd7d9=new Action(_0x46998c[_0x58694e],_0x550190);_0x2bd7d9['starttime']=moment()[_0x29f6('0x58')](_0x29f6('0x88'));_0x550190[_0x29f6('0x41')]+=0x1;ut[_0x29f6('0x89')](_0x2bd7d9,0x17,_0x29f6('0x8a'));if(_0x550190['dialRecallInQueue']){rpcDb[_0x29f6('0x8b')](ut[_0x29f6('0x8c')](_0x46998c[_0x58694e]));rpcDb[_0x29f6('0x8d')](_0x2bd7d9,_0x29f6('0x8e'));}else{ut[_0x29f6('0x89')](_0x2bd7d9,0x16,'RecallFailedTimeout');rpcDb[_0x29f6('0x8d')](_0x2bd7d9,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x2bd7d9,_0x29f6('0x8f'));}}}}})[_0x29f6('0x71')](ut['logger2'](_0x29f6('0x90')));};Preview[_0x29f6('0xc')]['setMessage']=function(_0x44b3ee){_0x44b3ee[_0x29f6('0x91')]=!![];if(ut[_0x29f6('0x92')](_0x44b3ee[_0x29f6('0x93')])){_0x44b3ee[_0x29f6('0x4c')]=_0x29f6('0x94');}else if(!ut[_0x29f6('0x95')](_0x44b3ee['dialActive'])){_0x44b3ee[_0x29f6('0x4c')]='NOT_ACTIVE';}else if(!this[_0x29f6('0x96')](_0x44b3ee['Trunk'])){if(!this['isTrunkReachable'](_0x44b3ee[_0x29f6('0x97')])){_0x44b3ee[_0x29f6('0x4c')]=_0x29f6('0x98');}else{_0x44b3ee['message']=_0x29f6('0x99');}}else{_0x44b3ee[_0x29f6('0x4c')]=_0x29f6('0x99');}emitCampaignPreview(_0x44b3ee);};Preview['prototype'][_0x29f6('0x9a')]=function(_0x35623a,_0x66a7bb,_0xc50331){var _0x1f9a9d=this;var _0x15cf8e=this[_0x29f6('0x10')][_0x66a7bb];var _0x41c1b9=this['campaignsPreview'][_0x15cf8e[_0x29f6('0x69')]];var _0x6e77a1;if(_0x41c1b9){switch(_0xc50331){case'1':_0x41c1b9[_0x29f6('0x3f')]+=0x1;_0x15cf8e[_0x29f6('0x9b')]+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x0,_0x29f6('0x9e'));ami['emit'](_0x29f6('0x9f'),ut[_0x29f6('0xa0')](_0x15cf8e,'nosuchnumber'));rpcDb[_0x29f6('0x8d')](_0x15cf8e,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x29f6('0x9d')](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut['cloneAction'](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb[_0x29f6('0xa3')](_0x6e77a1,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x15cf8e['countnosuchnumberretry']>=_0x41c1b9['dialNoSuchNumberMaxRetry']){rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xa4'));}else{rpcDb[_0x29f6('0xa5')](ut[_0x29f6('0xa6')](_0x15cf8e,_0x29f6('0x9b'),_0x41c1b9[_0x29f6('0xa7')]),_0x15cf8e[_0x29f6('0xa8')],_0x15cf8e['activeContact']);}}delete this[_0x29f6('0x10')][_0x35623a[_0x29f6('0xa9')]];break;case _0x29f6('0xaa'):var _0x1869fe=moment()['format'](_0x29f6('0x88'));_0x15cf8e[_0x29f6('0xab')]=_0x1869fe;_0x15cf8e[_0x29f6('0xac')]=_0x1869fe;_0x15cf8e[_0x29f6('0x74')]=!![];_0x41c1b9[_0x29f6('0x28')]+=0x1;logger['info'](_0x29f6('0xad'),_0x15cf8e[_0x29f6('0xae')],_0x29f6('0xaf'),_0x41c1b9[_0x29f6('0x25')],_0x29f6('0x6b'),_0x41c1b9[_0x29f6('0x28')]);ami['emit'](_0x29f6('0xb0'),ut['buildObj'](_0x15cf8e,'connect',this['campaignsPreview'][_0x15cf8e[_0x29f6('0x69')]]));if(_0x41c1b9['acw']){ami[_0x29f6('0x23')](_0x29f6('0xb1'),ut[_0x29f6('0xb2')](_0x15cf8e));}break;case'16':ami[_0x29f6('0x23')](_0x29f6('0xb3'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xb4'),this['campaignsPreview'][_0x15cf8e[_0x29f6('0x69')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x15cf8e,_0x29f6('0xb4')));_0x41c1b9[_0x29f6('0x37')]+=0x1;_0x41c1b9[_0x29f6('0x2c')]+=0x1;_0x41c1b9[_0x29f6('0xb5')]+=0x1;ut[_0x29f6('0x75')](_0x41c1b9,_0x29f6('0xb6'));_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x4,_0x29f6('0xb7'));rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xb8'));rpcDb['createCustomerFinal'](_0x15cf8e,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x15cf8e);_0x41c1b9[_0x29f6('0x2a')]+=_0x15cf8e[_0x29f6('0xb9')];_0x41c1b9['sumBillable']+=_0x15cf8e[_0x29f6('0xb9')];logger['info'](_0x29f6('0xba'),_0x15cf8e[_0x29f6('0xae')],_0x29f6('0xaf'),_0x41c1b9[_0x29f6('0x25')],_0x29f6('0x6b'),_0x41c1b9[_0x29f6('0x28')]);delete this[_0x29f6('0x10')][_0x35623a[_0x29f6('0xa9')]];break;case _0x29f6('0xbb'):_0x41c1b9[_0x29f6('0x39')]+=0x1;_0x15cf8e['countbusyretry']+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut['totalGlobal'](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x5,_0x29f6('0xbc'));ami[_0x29f6('0x23')](_0x29f6('0xbd'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xbe')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xbf'));if(ut['totalGlobal'](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,'Global');rpcDb['createCustomerFinal'](_0x6e77a1,_0x29f6('0xc1'));}else{if(_0x15cf8e[_0x29f6('0xc2')]>=_0x41c1b9[_0x29f6('0xc3')]){rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xbf'));}else{rpcDb[_0x29f6('0xa5')](ut[_0x29f6('0xa6')](_0x15cf8e,_0x29f6('0xc2'),_0x41c1b9[_0x29f6('0xc4')]),_0x15cf8e[_0x29f6('0xa8')],_0x15cf8e[_0x29f6('0xc5')]);}}break;case _0x29f6('0xc6'):_0x41c1b9['outboundNoAnswerCallsDay']+=0x1;_0x15cf8e['countnoanswerretry']+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut['logCustomer'](_0x15cf8e,0x3,_0x29f6('0xc7'));ami[_0x29f6('0x23')](_0x29f6('0xc8'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xc9')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xca'));if(ut['totalGlobal'](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb['createCustomerFinal'](_0x6e77a1,_0x29f6('0xcb'));}else{if(_0x15cf8e[_0x29f6('0xcc')]>=_0x41c1b9['dialNoAnswerMaxRetry']){rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xca'));}else{rpcDb['rescheduleContact'](ut[_0x29f6('0xa6')](_0x15cf8e,'countnoanswerretry',_0x41c1b9[_0x29f6('0xcd')]),_0x15cf8e[_0x29f6('0xa8')],_0x15cf8e[_0x29f6('0xc5')]);}}break;case _0x29f6('0xce'):_0x41c1b9[_0x29f6('0x3a')]+=0x1;_0x15cf8e[_0x29f6('0xcf')]+=0x1;_0x15cf8e['countglobal']=ut['totalGlobal'](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x8,_0x29f6('0xd0'));ami['emit'](_0x29f6('0xd1'),ut['buildObj'](_0x15cf8e,_0x29f6('0xd2')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xd3'));if(ut[_0x29f6('0x9d')](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb['createCustomerFinal'](_0x6e77a1,_0x29f6('0xd4'));}else{if(_0x15cf8e[_0x29f6('0xcf')]>=_0x41c1b9[_0x29f6('0xd5')]){rpcDb['createCustomerFinal'](_0x15cf8e,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x15cf8e,_0x29f6('0xcf'),_0x41c1b9['dialBusyRetryFrequency']),_0x15cf8e['unlockAgent'],_0x15cf8e['activeContact']);}}break;case _0x29f6('0xd6'):_0x41c1b9[_0x29f6('0x42')]+=0x1;_0x15cf8e[_0x29f6('0xd7')]+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut['logCustomer'](_0x15cf8e,0x14,_0x29f6('0xd8'));ami['emit'](_0x29f6('0xd9'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xda')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0x14,_0x29f6('0xd8'));rpcDb['createCustomerFinal'](_0x6e77a1,_0x29f6('0xdb'));}else{if(_0x15cf8e[_0x29f6('0xd7')]>=_0x41c1b9['dialAgentRejectMaxRetry']){rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xdb'));}else{rpcDb[_0x29f6('0xa5')](ut[_0x29f6('0xa6')](_0x15cf8e,_0x29f6('0xd7'),_0x41c1b9[_0x29f6('0xdc')]),_0x15cf8e[_0x29f6('0xa8')],_0x15cf8e[_0x29f6('0xc5')]);}}break;case _0x29f6('0xdd'):_0x41c1b9[_0x29f6('0x44')]+=0x1;_0x15cf8e['countabandonedretry']+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut['totalGlobal'](_0x15cf8e);ut['logCustomer'](_0x15cf8e,0xb,'Abandoned');rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xde'));if(ut['totalGlobal'](_0x15cf8e)>=_0x41c1b9['dialGlobalMaxRetry']){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb['createCustomerFinal'](_0x6e77a1,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x15cf8e['countabandonedetry']>=_0x41c1b9['dialAbandonedMaxRety']){rpcDb[_0x29f6('0xa3')](_0x15cf8e,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x29f6('0xa5')](ut[_0x29f6('0xa6')](_0x15cf8e,'countabandonedretry',_0x41c1b9[_0x29f6('0xdf')]),_0x15cf8e[_0x29f6('0xa8')],_0x15cf8e['activeContact']);}}break;case'18':_0x41c1b9[_0x29f6('0x43')]+=0x1;_0x15cf8e[_0x29f6('0xe0')]+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x12,_0x35623a[_0x29f6('0xe1')]||_0x35623a[_0x29f6('0xe2')]);ami[_0x29f6('0x23')](_0x29f6('0xe3'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xe4')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xe5'));if(ut[_0x29f6('0x9d')](_0x15cf8e)>=_0x41c1b9['dialGlobalMaxRetry']){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb[_0x29f6('0xa3')](_0x6e77a1,_0x29f6('0xe5'));}else{rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xe5'));}delete this[_0x29f6('0x10')][_0x35623a['linkedid']];break;case'19':_0x41c1b9[_0x29f6('0x43')]+=0x1;_0x15cf8e['countglobal']=ut[_0x29f6('0x9d')](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0x13,_0x35623a[_0x29f6('0xe1')]||_0x35623a[_0x29f6('0xe2')]);ami[_0x29f6('0x23')](_0x29f6('0xe3'),ut[_0x29f6('0xa0')](_0x15cf8e,_0x29f6('0xe4')));rpcDb[_0x29f6('0x8d')](_0x15cf8e,'[callProgressDetectingCustomer][machine]');if(ut[_0x29f6('0x9d')](_0x15cf8e)>=_0x41c1b9[_0x29f6('0xa1')]){_0x6e77a1=ut['cloneAction'](_0x15cf8e,0xf,'Global');rpcDb[_0x29f6('0xa3')](_0x6e77a1,_0x29f6('0xe6'));}else{rpcDb[_0x29f6('0xa3')](_0x15cf8e,_0x29f6('0xe6'));}delete this['actions'][_0x35623a[_0x29f6('0xa9')]];break;default:if(_0x15cf8e[_0x29f6('0x74')]){ut['decrementTalkink'](_0x41c1b9,_0x29f6('0xe7'));ut[_0x29f6('0x76')](_0x29f6('0xe8')+_0x41c1b9[_0x29f6('0x25')],_0x35623a);}_0x41c1b9[_0x29f6('0x43')]+=0x1;_0x15cf8e[_0x29f6('0x9c')]=ut[_0x29f6('0x9d')](_0x15cf8e);ut[_0x29f6('0x89')](_0x15cf8e,0xc,_0x35623a[_0x29f6('0xe1')]||_0x35623a[_0x29f6('0xe2')]);rpcDb[_0x29f6('0x8d')](_0x15cf8e,_0x29f6('0xe9'));if(ut[_0x29f6('0x9d')](_0x15cf8e)>=_0x41c1b9['dialGlobalMaxRetry']){_0x6e77a1=ut[_0x29f6('0xc0')](_0x15cf8e,0xf,_0x29f6('0xa2'));rpcDb[_0x29f6('0xa3')](_0x6e77a1,_0x29f6('0xea'));}else{rpcDb['createCustomerFinal'](_0x15cf8e,_0x29f6('0xea'));}delete this[_0x29f6('0x10')][_0x35623a[_0x29f6('0xa9')]];}if(!(_0x15cf8e['dialAnswer']&&_0xc50331==='16')){ut[_0x29f6('0x72')](_0x41c1b9,_0x29f6('0xeb'));logger['info'](_0x29f6('0xec'),_0x15cf8e[_0x29f6('0xae')],_0x29f6('0xaf'),_0x41c1b9[_0x29f6('0x25')],_0x29f6('0x6a'),_0x41c1b9[_0x29f6('0x4d')]);}if(_0xc50331!==_0x29f6('0xaa')){delete this[_0x29f6('0x10')][_0x35623a[_0x29f6('0xa9')]];delete this[_0x29f6('0x10')][_0x35623a[_0x29f6('0xed')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x454126,_0x201d43,_0x1621b7){if(_[_0x29f6('0xee')](_0x201d43)&&_0x29f6('0xef')!==typeof _0x201d43){return;}if(_[_0x29f6('0xee')](_0x1621b7)&&_0x29f6('0xef')!==typeof _0x1621b7){return;}switch(_0x1621b7[_0x29f6('0xf0')]){case'0':ut['logAgent'](_0x454126,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x454126,_0x29f6('0xf1'));break;case'3':ut[_0x29f6('0xf2')](_0x454126,0x3,_0x29f6('0xc7'));rpcDb[_0x29f6('0xf3')](_0x454126,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x29f6('0xf2')](_0x454126,0x5,_0x29f6('0xbc'));rpcDb['createAgentHistory'](_0x454126,_0x29f6('0xf4'));break;case'8':ut['logAgent'](_0x454126,0x8,_0x29f6('0xd0'));rpcDb[_0x29f6('0xf3')](_0x454126,_0x29f6('0xf5'));break;case'22':ut[_0x29f6('0xf2')](_0x454126,0x16,'AnswerAGI');rpcDb[_0x29f6('0xf3')](_0x454126,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x29f6('0xf2')](_0x454126,0xc,_0x1621b7[_0x29f6('0xf0')]);rpcDb[_0x29f6('0xf3')](_0x454126,_0x29f6('0xf5'));}ut[_0x29f6('0x72')](_0x201d43,_0x29f6('0xf6'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x454126[_0x29f6('0xae')],'\x20Queue',_0x201d43['name'],_0x29f6('0x6a'),_0x201d43['originated']);delete this[_0x29f6('0x10')][_0x454126[_0x29f6('0xae')]];};Preview[_0x29f6('0xc')][_0x29f6('0xf7')]=function(_0x78e714,_0x35846c,_0x4b3a84,_0x4290af,_0xcf0cdd){var _0x3698a9=this;return new BPromise(function(_0x3b2594,_0xa941e6){if(_[_0x29f6('0x7e')](_0x35846c)||_[_0x29f6('0x7e')](_0x35846c[_0x29f6('0xf8')])||_[_0x29f6('0x7e')](_0x35846c[_0x29f6('0xf8')][_0x29f6('0xf9')])||_['isNil'](_0x35846c[_0x29f6('0xfa')])){_0xa941e6(ut[_0x29f6('0x4c')]('Contact\x20is\x20undefined',_0x4290af,_0xcf0cdd));return;}var _0x361b74=uuid['v4']();var _0x41854a=_0x3698a9[_0x29f6('0x22')][_0x35846c['Queue']['name']];var _0x1413a5=_0x4b3a84?_0x3698a9[_0x29f6('0x11')][_0x4b3a84]['id']:undefined;_0x3698a9[_0x29f6('0x10')][_0x361b74]=new Action(_0x35846c,_0x41854a,_0x361b74,_0x4b3a84,_0x1413a5);var _0xd8fdd9=_0x3698a9[_0x29f6('0x10')][_0x361b74];_0xd8fdd9[_0x29f6('0xa8')]=_0x4290af;_0xd8fdd9['activeContact']=_0xcf0cdd;_0xd8fdd9[_0x29f6('0xfb')]=_0x4b3a84;if(_[_0x29f6('0xfc')](_0x78e714)){_0x3698a9['execCall'](_0xd8fdd9,_0x41854a,_0x35846c,_0x4b3a84)['then'](function(_0x540ff0){logger[_0x29f6('0x5a')]('[Preview][execCall][success]',_0x29f6('0xfd')+_0xd8fdd9['queue']+_0x29f6('0xfe')+_0xd8fdd9[_0x29f6('0xff')],JSON[_0x29f6('0x57')](_0x540ff0));ami[_0x29f6('0x23')](_0x29f6('0x100'),ut['buildObj'](_0xd8fdd9,_0x29f6('0x101'),_0x3698a9['campaignsPreview'][_0xd8fdd9[_0x29f6('0x69')]]));_0x3b2594(ut[_0x29f6('0x4c')](_0x29f6('0x102')));})[_0x29f6('0x71')](function(_0x478660){ut[_0x29f6('0x5f')](_0x29f6('0x103'),_0x478660);_0xa941e6(ut[_0x29f6('0x4c')]('Call\x20failed',_0x4290af,_0xcf0cdd));});}else{_0x41854a[_0x29f6('0x38')]+=0x1;ut['logBlacklist'](_0xd8fdd9);rpcDb[_0x29f6('0x104')](_0xd8fdd9,_0x29f6('0x105'));delete _0x3698a9['actions'][_0x361b74];_0xa941e6(ut[_0x29f6('0x4c')]('Contact\x20in\x20black\x20List',_0x4290af,_0xcf0cdd));}});};Preview[_0x29f6('0xc')][_0x29f6('0x96')]=function(_0x52c66d){return!_[_0x29f6('0x7e')](_0x52c66d)&&!_[_0x29f6('0x7e')](_0x52c66d['name'])&&!_[_0x29f6('0x7e')](_0x52c66d[_0x29f6('0x106')])&&_0x52c66d[_0x29f6('0x106')]&&!_[_0x29f6('0x7e')](this[_0x29f6('0x107')][util[_0x29f6('0x58')](_0x29f6('0x108'),_0x52c66d[_0x29f6('0x25')])])&&!_['isNil'](this[_0x29f6('0x107')][util[_0x29f6('0x58')](_0x29f6('0x108'),_0x52c66d[_0x29f6('0x25')])]['status'])&&(this[_0x29f6('0x107')][util[_0x29f6('0x58')](_0x29f6('0x108'),_0x52c66d[_0x29f6('0x25')])][_0x29f6('0x109')]==='reachable'||this['trunks'][util[_0x29f6('0x58')](_0x29f6('0x108'),_0x52c66d['name'])][_0x29f6('0x109')]==='unmonitored');};Preview['prototype'][_0x29f6('0x85')]=function(_0x56c8de,_0x26015a){var _0x24a7fb=this;return new BPromise(function(_0x454c4c,_0x2e7b38){_0x24a7fb['execRun'](_0x56c8de,_0x26015a)[_0x29f6('0x7d')](function(_0xdf7522){_0x454c4c(_[_0x29f6('0x6c')](_0xdf7522,[_0x29f6('0x4c')]));})[_0x29f6('0x71')](function(_0x42650f){if(_0x42650f['unlock']){rpcDb['unlockContact'](_0x56c8de);}if(_0x42650f[_0x29f6('0x106')]){rpcDb[_0x29f6('0x10a')](_0x56c8de);}_0x2e7b38(_[_0x29f6('0x6c')](_0x42650f,[_0x29f6('0x4c')]));});});};Preview[_0x29f6('0xc')][_0x29f6('0x10b')]=function(_0x215780,_0x24757c){var _0x3d131a=this;return new BPromise(function(_0x2bc181,_0x415b83){var _0x3d559f,_0x36f0c0;rpcDb[_0x29f6('0x10c')](_0x215780)[_0x29f6('0x7d')](function(_0x583f5f){if(!_[_0x29f6('0x7e')](_0x583f5f[0x0])){_0x36f0c0=_0x583f5f[0x0][_0x29f6('0x10d')]?![]:!![];_0x3d559f=_0x583f5f[0x0][_0x29f6('0x10d')]?!![]:![];_0x3d559f=_0x24757c?!![]:_0x3d559f;}var _0x2c8a2e=_0x3d131a[_0x29f6('0x10e')](_0x583f5f);if(_0x2c8a2e['isValid']){rpcDb[_0x29f6('0x10f')](_[_0x29f6('0x6c')](_0x583f5f[0x0],[_0x29f6('0xfa'),'Contact.phone']))[_0x29f6('0x7d')](function(_0x2a5414){_0x3d131a[_0x29f6('0xf7')](_0x2a5414,_0x583f5f[0x0],_0x24757c,_0x36f0c0,_0x3d559f)[_0x29f6('0x7d')](function(_0x58d094){_0x2bc181(_0x58d094);})[_0x29f6('0x71')](function(_0x4f9bf9){_0x415b83(_0x4f9bf9);});})[_0x29f6('0x71')](function(_0x5c067f){ut[_0x29f6('0x5f')](_0x29f6('0x110'),_0x5c067f);_0x415b83(ut[_0x29f6('0x4c')](_0x29f6('0x111'),_0x36f0c0,_0x3d559f));});}else{_0x415b83(ut['message'](_0x2c8a2e[_0x29f6('0x4c')],_0x36f0c0,_0x3d559f));}})[_0x29f6('0x71')](function(_0x4577ee){ut[_0x29f6('0x5f')](_0x29f6('0x112'),_0x4577ee);_0x415b83(ut[_0x29f6('0x4c')](_0x29f6('0x111'),![],!![]));});});};Preview[_0x29f6('0xc')][_0x29f6('0x10e')]=function(_0x421f62){if(_[_0x29f6('0x7e')](_0x421f62)||_[_0x29f6('0xfc')](_0x421f62)||!_['isNil'](_0x421f62[0x0][_0x29f6('0x83')])&&_[_0x29f6('0x7e')](_0x421f62[0x0][_0x29f6('0x83')][_0x29f6('0x25')])){ut[_0x29f6('0x5f')](_0x29f6('0x113'),_0x421f62);return{'isValid':![],'message':_0x29f6('0x114')};}var _0xea8577=this['campaignsPreview'][_0x421f62[0x0][_0x29f6('0x68')]['name']];_0xea8577['message']=_0x29f6('0x99');if(_['isNil'](_0xea8577)){ut[_0x29f6('0x5f')](_0x29f6('0x115'),_0xea8577);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x29f6('0x96')](_0xea8577[_0x29f6('0x54')])){ut[_0x29f6('0x5f')](_0x29f6('0x116'),_0x29f6('0x117')+_0xea8577[_0x29f6('0x25')]+_0x29f6('0x118'));if(!this['isTrunkReachable'](_0xea8577[_0x29f6('0x97')])){ut[_0x29f6('0x5f')](_0x29f6('0x116'),_0xea8577[_0x29f6('0x25')]+_0x29f6('0x119'));return{'isValid':![],'message':_0x29f6('0x11a')};}}if(!ut['isActive'](_0xea8577[_0x29f6('0x31')])){ut[_0x29f6('0x5f')]('[Preview][validateContact][Campaign\x20Active]',_0xea8577[_0x29f6('0x25')]+_0x29f6('0x11b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xea8577[_0x29f6('0x25')]+_0x29f6('0x11b')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x29f6('0xc')]['execCall']=function(_0x5ad6fa,_0x2fad0e,_0x51fa5e,_0x35cdca){var _0x1c8289=this;return new BPromise(function(_0x581020,_0x58173c){var _0x5235cb=_0x5ad6fa[_0x29f6('0xae')];var _0x2586ec=_0x1c8289[_0x29f6('0x96')](_0x2fad0e[_0x29f6('0x54')])?util[_0x29f6('0x58')](_0x29f6('0x11c'),_0x2fad0e[_0x29f6('0x54')][_0x29f6('0x25')],_[_0x29f6('0x7e')](_0x2fad0e[_0x29f6('0x35')])?'':_0x2fad0e[_0x29f6('0x35')][_0x29f6('0x11d')]()||'',_0x2fad0e['dialCutDigit']>0x0?_0x51fa5e['Contact'][_0x29f6('0xf9')][_0x29f6('0x11e')](_0x2fad0e['dialCutDigit']):_0x51fa5e[_0x29f6('0xf8')][_0x29f6('0xf9')]):util['format']('SIP/%s/%s%s',_['isNil'](_0x2fad0e[_0x29f6('0x97')])?_0x2fad0e[_0x29f6('0x54')][_0x29f6('0x25')]:_0x2fad0e[_0x29f6('0x97')]['name'],_[_0x29f6('0x7e')](_0x2fad0e[_0x29f6('0x35')])?'':_0x2fad0e[_0x29f6('0x35')][_0x29f6('0x11d')]()||'',_0x2fad0e[_0x29f6('0x11f')]>0x0?_0x51fa5e[_0x29f6('0xf8')][_0x29f6('0xf9')][_0x29f6('0x11e')](_0x2fad0e[_0x29f6('0x11f')]):_0x51fa5e['Contact'][_0x29f6('0xf9')]);var _0x294136=_0x1c8289[_0x29f6('0x96')](_0x2fad0e[_0x29f6('0x54')])?ut['getCallerId'](_0x2fad0e['Trunk'][_0x29f6('0x55')],_0x2fad0e[_0x29f6('0x33')],_0x2fad0e[_0x29f6('0x120')]>0x0?ut[_0x29f6('0x121')](_0x2fad0e[_0x29f6('0x34')],_0x2fad0e['dialRandomLastDigitCallerIdNumber']):_0x2fad0e[_0x29f6('0x34')]):ut[_0x29f6('0x122')](_[_0x29f6('0x7e')](_0x2fad0e[_0x29f6('0x97')])?_0x2fad0e[_0x29f6('0x54')][_0x29f6('0x55')]:_0x2fad0e[_0x29f6('0x97')]['callerid'],_0x2fad0e[_0x29f6('0x33')],_0x2fad0e[_0x29f6('0x120')]>0x0?ut[_0x29f6('0x121')](_0x2fad0e[_0x29f6('0x34')],_0x2fad0e['dialRandomLastDigitCallerIdNumber']):_0x2fad0e[_0x29f6('0x34')]);if(_0x294136){_0x5ad6fa[_0x29f6('0x123')]=ut[_0x29f6('0x124')](_0x294136);_0x5ad6fa[_0x29f6('0x125')]=ut['extractCalleridNumber'](_0x294136);}var _0x226c3b=ut[_0x29f6('0x126')](_0x2fad0e,_0x51fa5e,_0x2586ec,_0x294136,_0x5235cb,_0x5ad6fa);_[_0x29f6('0x127')](_0x5ad6fa,ut['toLowerVariables'](_0x226c3b));_0x5ad6fa[_0x29f6('0x128')]=moment()[_0x29f6('0x58')](_0x29f6('0x88'));ami[_0x29f6('0x129')](ut['variablesAction'](_0x5ad6fa,_0x2fad0e,_0x226c3b,_0x5ad6fa[_0x29f6('0xc5')],_0x35cdca))[_0x29f6('0x7d')](function(_0x488d3c){_0x2fad0e['originated']+=0x1;logger['info'](_0x29f6('0x12a'),_0x5235cb,_0x29f6('0xaf'),_0x2fad0e['name'],_0x29f6('0x6a'),_0x2fad0e[_0x29f6('0x4d')]);_0x581020(_0x488d3c);})[_0x29f6('0x71')](function(_0x39ec33){ut[_0x29f6('0xf2')](_0x5ad6fa,0xe,'OriginateError');rpcDb[_0x29f6('0xf3')](_0x5ad6fa,_0x29f6('0x12b'));_0x58173c(_0x39ec33);});});};Preview[_0x29f6('0xc')][_0x29f6('0x12c')]=function(_0xd8ac78){if(this[_0x29f6('0x10')][_0xd8ac78[_0x29f6('0xa9')]]){this[_0x29f6('0x10')][_0xd8ac78[_0x29f6('0xa9')]][_0x29f6('0x70')]=_0xd8ac78['channel'];}};Preview[_0x29f6('0xc')][_0x29f6('0x14')]=function(_0x56bfe5){var _0x1869bd=this;var _0x267900=this[_0x29f6('0x10')][_0x56bfe5[_0x29f6('0x12d')]];if(_0x267900){if(_0x267900[_0x29f6('0xfb')]&&this['agents'][_0x267900[_0x29f6('0xfb')]]){ut[_0x29f6('0x12e')](_0x267900,this[_0x29f6('0x11')][_0x267900['lookAgent']]['name'],this[_0x29f6('0x11')][_0x267900[_0x29f6('0xfb')]]['id']);}var _0x38a921=_[_0x29f6('0x12f')](_0x267900);_0x38a921[_0x29f6('0xab')]=moment()[_0x29f6('0x58')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4d889e=_0x1869bd[_0x29f6('0x22')][_0x267900[_0x29f6('0x69')]];if(ut[_0x29f6('0x130')](_0x56bfe5[_0x29f6('0x131')])){if(_0x267900[_0x29f6('0xa8')]){rpcDb[_0x29f6('0x132')](_0x267900['idContact']);}if(_0x267900['activeContact']){rpcDb[_0x29f6('0x10a')](_0x267900[_0x29f6('0xff')]);}ami[_0x29f6('0x23')]('custom:agentringnoanswer',ut['buildObj'](_0x267900,'rejected',this[_0x29f6('0x22')][_0x267900['queue']]));this[_0x29f6('0x133')](_0x38a921,_0x4d889e,_0x56bfe5);}else{_0x267900[_0x29f6('0x128')]=moment()[_0x29f6('0x58')](_0x29f6('0x88'));ut[_0x29f6('0xf2')](_0x38a921,0x4,_0x29f6('0xb7'));rpcDb[_0x29f6('0xf3')](_0x38a921,_0x29f6('0x134'));}}};Preview[_0x29f6('0xc')]['syncHangup']=function(_0x2e1bd5){var _0x173977=this;var _0x50183d=this[_0x29f6('0x10')][_0x2e1bd5[_0x29f6('0xa9')]];var _0x43acdc;if(_0x50183d){_0x43acdc=this[_0x29f6('0x22')][_0x50183d['queue']];logger['info'](_0x29f6('0x135'),_0x2e1bd5[_0x29f6('0xa9')],_0x29f6('0xaf'),_0x43acdc[_0x29f6('0x25')],_0x29f6('0x6b'),_0x43acdc['pTalking']);}if(this['actions'][_0x2e1bd5[_0x29f6('0xa9')]]&&_0x2e1bd5[_0x29f6('0xa9')]!==_0x2e1bd5['uniqueid']){if(_0x2e1bd5['cause']==='16'&&this['actions'][_0x2e1bd5[_0x29f6('0xa9')]][_0x29f6('0x74')]){this[_0x29f6('0x9a')](_0x2e1bd5,_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5[_0x29f6('0x136')]);}else if(this['actions'][_0x2e1bd5[_0x29f6('0xa9')]][_0x29f6('0x74')]){logger[_0x29f6('0x5a')](_0x29f6('0x137'),_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5['cause'],_0x29f6('0xaf'),_0x43acdc[_0x29f6('0x25')],_0x29f6('0x6b'),_0x43acdc[_0x29f6('0x28')]);this[_0x29f6('0x9a')](_0x2e1bd5,_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5[_0x29f6('0x136')]);}}else if(_0x50183d&&_[_0x29f6('0x7e')](_0x50183d['statedesc'])&&_0x43acdc[_0x29f6('0x138')]&&_0x2e1bd5[_0x29f6('0xa9')]===_0x2e1bd5['uniqueid']&&_[_0x29f6('0x7e')](_0x2e1bd5[_0x29f6('0xf0')])&&_0x2e1bd5[_0x29f6('0x136')]==='16'&&_0x2e1bd5['channelstate']==='6'&&_['isUndefined'](_0x50183d['transfer'])){if(_0x50183d['unlockAgent']){rpcDb[_0x29f6('0x132')](_0x50183d[_0x29f6('0xff')]);}if(_0x50183d[_0x29f6('0xc5')]){rpcDb[_0x29f6('0x10a')](_0x50183d[_0x29f6('0xff')]);}_0x2e1bd5[_0x29f6('0xf0')]='22';this[_0x29f6('0x133')](_0x50183d,_0x43acdc,_0x2e1bd5);}else if(_0x50183d&&_0x50183d[_0x29f6('0x139')]){if(_0x2e1bd5[_0x29f6('0x136')]==='16'&&this[_0x29f6('0x10')][_0x2e1bd5['linkedid']][_0x29f6('0x74')]){logger['info'](_0x29f6('0x13a'),_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5[_0x29f6('0x136')],_0x29f6('0xaf'),_0x43acdc[_0x29f6('0x25')],_0x29f6('0x6b'),_0x43acdc[_0x29f6('0x28')]);this[_0x29f6('0x9a')](_0x2e1bd5,_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5['cause']);}else if(this['actions'][_0x2e1bd5[_0x29f6('0xa9')]]['dialAnswer']){logger[_0x29f6('0x5a')](_0x29f6('0x137'),_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5[_0x29f6('0x136')],_0x29f6('0xaf'),_0x43acdc['name'],_0x29f6('0x6b'),_0x43acdc[_0x29f6('0x28')]);this[_0x29f6('0x9a')](_0x2e1bd5,_0x2e1bd5[_0x29f6('0xa9')],_0x2e1bd5[_0x29f6('0x136')]);}}};Preview[_0x29f6('0xc')][_0x29f6('0x1b')]=function(_0x44e960){if(this[_0x29f6('0x10')][_0x44e960[_0x29f6('0xed')]]&&_0x44e960[_0x29f6('0xed')]!==_0x44e960['destuniqueid']){this[_0x29f6('0x9a')](_0x44e960,_0x44e960['destlinkedid'],_0x44e960[_0x29f6('0xe2')]);}};Preview[_0x29f6('0xc')]['syncHangupRequest']=function(_0x5d1cec){if(this[_0x29f6('0x10')][_0x5d1cec[_0x29f6('0xa9')]]&&_0x5d1cec['linkedid']!==_0x5d1cec[_0x29f6('0xae')]&&!this[_0x29f6('0x10')][_0x5d1cec[_0x29f6('0xa9')]][_0x29f6('0x74')]){if(_0x5d1cec[_0x29f6('0x136')]==='1'){this['callProgressDetectingCustomer'](_0x5d1cec,_0x5d1cec['linkedid'],_0x5d1cec[_0x29f6('0x136')]);}}};Preview['prototype'][_0x29f6('0x13b')]=function(_0x354dba,_0x50a9f8,_0x380dcc){if(this[_0x29f6('0x10')][_0x354dba]){if(_['isNil'](this[_0x29f6('0x10')][_0x354dba][_0x29f6('0x13c')])){this['actions'][_0x354dba]['variables']={};}this[_0x29f6('0x10')][_0x354dba][_0x29f6('0x13c')][_0x50a9f8]=_0x380dcc;}};Preview[_0x29f6('0xc')][_0x29f6('0x1e')]=function(_0x2bc603){try{if(!_[_0x29f6('0x7e')](_0x2bc603)){if(ut[_0x29f6('0x13d')](_[_0x29f6('0x13e')](_0x2bc603[_0x29f6('0x13f')])[0x0])){this[_0x29f6('0x13b')](_0x2bc603[_0x29f6('0xae')],_[_0x29f6('0x13e')](_0x2bc603[_0x29f6('0x13f')])[0x0],_0x2bc603[_0x29f6('0x140')]);}}}catch(_0x3b078b){logger[_0x29f6('0x141')](_0x29f6('0x142'),util[_0x29f6('0x143')](_0x3b078b,{'showHidden':![],'depth':null}));}};Preview[_0x29f6('0xc')][_0x29f6('0x1f')]=function(_0x326fc5){if(_0x326fc5){if(this['actions'][_0x326fc5[_0x29f6('0x144')]]){this[_0x29f6('0x10')][_0x326fc5[_0x29f6('0x144')]][_0x29f6('0x139')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0xad9431){if(_0xad9431){if(this[_0x29f6('0x10')][_0xad9431[_0x29f6('0x145')]]){this['actions'][_0xad9431[_0x29f6('0x145')]][_0x29f6('0x139')]=!![];}}};module[_0x29f6('0x146')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 56432a9..c170f31 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 _0x13bb=['assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','membername','context','exten','xcally-motion-preview','holdtime'];(function(_0x3f2163,_0x11a232){var _0x2b5b60=function(_0x24625a){while(--_0x24625a){_0x3f2163['push'](_0x3f2163['shift']());}};_0x2b5b60(++_0x11a232);}(_0x13bb,0x17b));var _0xb13b=function(_0x3acc9c,_0x5697a4){_0x3acc9c=_0x3acc9c-0x0;var _0x11df29=_0x13bb[_0x3acc9c];return _0x11df29;};'use strict';var util=require(_0xb13b('0x0'));var BPromise=require(_0xb13b('0x1'));var logger=require(_0xb13b('0x2'))(_0xb13b('0x3'));var _=require('lodash');var cmHopper=require(_0xb13b('0x4'));var cmHopperFinal=require(_0xb13b('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xb13b('0x6'));var voiceQueueRt=require(_0xb13b('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xb13b('0x8'));function loggerCatch(_0x20c60e){return function(_0x5bbe74){logger['error'](_0x20c60e,util[_0xb13b('0x9')](_0x5bbe74,{'showHidden':![],'depth':null}));};}function create(_0x2aeb6a){return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](cmHopperHistory[_0xb13b('0xc')](_0x2aeb6a))[_0xb13b('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x87bd0e){return BPromise[_0xb13b('0xa')]()['then'](agentReportPreview[_0xb13b('0xc')](_0x87bd0e))[_0xb13b('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x551d8a){return BPromise['resolve']()['then'](cmHopper[_0xb13b('0xe')](_0x551d8a,!![]))[_0xb13b('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x2e55cb){return BPromise['resolve']()[_0xb13b('0xb')](cmHopperBlack[_0xb13b('0xf')](_0x2e55cb))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x10')));};exports[_0xb13b('0x11')]=function(_0x113ad3){return BPromise['resolve']()[_0xb13b('0xb')](cmHopper[_0xb13b('0x11')](_0x113ad3))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x12')));};exports[_0xb13b('0xc')]=function(_0xee2ba0,_0x3c52ba){create(_0xee2ba0)[_0xb13b('0xd')](loggerCatch(_0x3c52ba));moveContact(_0xee2ba0)[_0xb13b('0xd')](loggerCatch(_0x3c52ba));};exports['createAgentHistory']=function(_0x3b817c,_0x1c1369){createAgent(_0x3b817c)[_0xb13b('0xd')](loggerCatch(_0x1c1369));};exports[_0xb13b('0x13')]=function(_0x22b812,_0x5dcd36){create(_0x22b812)[_0xb13b('0xd')](loggerCatch(_0x5dcd36));};exports[_0xb13b('0x14')]=function(_0x486c96,_0x417dc9){moveContact(_0x486c96)[_0xb13b('0xd')](loggerCatch(_0x417dc9));};exports[_0xb13b('0x15')]=function(_0x98b4cc,_0x335c97,_0xb6d435){if(_0x335c97){_0x98b4cc[_0xb13b('0x16')]=null;}if(_0xb6d435){_0x98b4cc[_0xb13b('0x17')]=![];}return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](cmHopper[_0xb13b('0x15')](_0x98b4cc))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x18')));};exports['countReScheduled']=function(_0x347771){return BPromise[_0xb13b('0xa')]()['then'](cmHopper['countReScheduled'](_0x347771))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x19')));};exports[_0xb13b('0x1a')]=function(_0xf81e39){return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](cmHopper[_0xb13b('0x1a')]({'UserId':null},_0xf81e39,0x1))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x1b')));};exports['disableContact']=function(_0x1ed9a5){return BPromise[_0xb13b('0xa')]()['then'](cmHopper[_0xb13b('0x1a')]({'active':![]},_0x1ed9a5,0x1))['catch'](loggerCatch(_0xb13b('0x1c')));};exports[_0xb13b('0x1d')]=function(_0x342e60){var _0x39a2c9={};_0x39a2c9[_0xb13b('0x1e')]=_0x342e60[_0xb13b('0x1e')];_0x39a2c9[_0xb13b('0x1f')]=_0x342e60[_0xb13b('0x1f')];_0x39a2c9[_0xb13b('0x20')]=_0x342e60[_0xb13b('0x20')];_0x39a2c9[_0xb13b('0x21')]=_0x342e60[_0xb13b('0x21')];_0x39a2c9[_0xb13b('0x22')]=_0x342e60[_0xb13b('0x22')];_0x39a2c9[_0xb13b('0x23')]=_0x342e60[_0xb13b('0x24')];_0x39a2c9[_0xb13b('0x25')]=_0x342e60[_0xb13b('0x24')];_0x39a2c9['queuecallercomplete']=0x1;_0x39a2c9[_0xb13b('0x26')]=_0x342e60[_0xb13b('0x27')];_0x39a2c9['connectedlinename']=_0x342e60[_0xb13b('0x28')];_0x39a2c9[_0xb13b('0x29')]='from-sip';_0x39a2c9[_0xb13b('0x2a')]=_0xb13b('0x2b');_0x39a2c9[_0xb13b('0x2c')]=0x0;_0x39a2c9[_0xb13b('0x2d')]=0x1;_0x39a2c9[_0xb13b('0x2e')]=_0x342e60[_0xb13b('0x28')];_0x39a2c9[_0xb13b('0x2f')]=_0xb13b('0x30');return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](voiceQueueReport[_0xb13b('0x31')](_0x39a2c9))[_0xb13b('0xd')](loggerCatch(_0xb13b('0x32')));};exports[_0xb13b('0x33')]=function(_0x54a49f,_0x486b54){return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](cmHopper[_0xb13b('0x33')](_0x54a49f,_0x486b54))['catch'](loggerCatch(_0xb13b('0x34')));};exports['rescheduleContactInQueue']=function(_0x55269d){return BPromise[_0xb13b('0xa')]()[_0xb13b('0xb')](cmHopper[_0xb13b('0x15')](_0x55269d,!![],!![]))[_0xb13b('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x0532=['disableContact','[activeContact]\x20','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','membername','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact'];(function(_0x5533d4,_0x525249){var _0x4cabd2=function(_0x3a9583){while(--_0x3a9583){_0x5533d4['push'](_0x5533d4['shift']());}};_0x4cabd2(++_0x525249);}(_0x0532,0x143));var _0x2053=function(_0x5c187b,_0x2b1df1){_0x5c187b=_0x5c187b-0x0;var _0x39630c=_0x0532[_0x5c187b];return _0x39630c;};'use strict';var util=require('util');var BPromise=require(_0x2053('0x0'));var logger=require(_0x2053('0x1'))(_0x2053('0x2'));var _=require(_0x2053('0x3'));var cmHopper=require(_0x2053('0x4'));var cmHopperFinal=require(_0x2053('0x5'));var cmHopperHistory=require(_0x2053('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x2053('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2053('0x8'));function loggerCatch(_0x42a599){return function(_0x29a7b5){logger['error'](_0x42a599,util[_0x2053('0x9')](_0x29a7b5,{'showHidden':![],'depth':null}));};}function create(_0x540611){return BPromise['resolve']()[_0x2053('0xa')](cmHopperHistory[_0x2053('0xb')](_0x540611))[_0x2053('0xc')](loggerCatch(_0x2053('0xd')));}function createAgent(_0x2cc5d8){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](agentReportPreview[_0x2053('0xb')](_0x2cc5d8))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x40bf4d){return BPromise['resolve']()[_0x2053('0xa')](cmHopper[_0x2053('0xf')](_0x40bf4d,!![]))[_0x2053('0xc')](loggerCatch(_0x2053('0x10')));}exports[_0x2053('0x11')]=function(_0x3fa53e){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopperBlack[_0x2053('0x11')](_0x3fa53e))[_0x2053('0xc')](loggerCatch(_0x2053('0x12')));};exports['getContactPreview']=function(_0x489751){return BPromise[_0x2053('0xe')]()['then'](cmHopper[_0x2053('0x13')](_0x489751))[_0x2053('0xc')](loggerCatch(_0x2053('0x14')));};exports[_0x2053('0xb')]=function(_0x303a68,_0x212cd4){create(_0x303a68)[_0x2053('0xc')](loggerCatch(_0x212cd4));moveContact(_0x303a68)[_0x2053('0xc')](loggerCatch(_0x212cd4));};exports['createAgentHistory']=function(_0x4327c0,_0x1976bc){createAgent(_0x4327c0)[_0x2053('0xc')](loggerCatch(_0x1976bc));};exports[_0x2053('0x15')]=function(_0x171b64,_0x328793){create(_0x171b64)[_0x2053('0xc')](loggerCatch(_0x328793));};exports['createCustomerFinal']=function(_0x344781,_0x5c8891){moveContact(_0x344781)[_0x2053('0xc')](loggerCatch(_0x5c8891));};exports[_0x2053('0x16')]=function(_0x46a4b5,_0x1942b3,_0x3ca907){if(_0x1942b3){_0x46a4b5[_0x2053('0x17')]=null;}if(_0x3ca907){_0x46a4b5['active']=![];}return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopper[_0x2053('0x16')](_0x46a4b5))[_0x2053('0xc')](loggerCatch(_0x2053('0x18')));};exports['countReScheduled']=function(_0x988a9a){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopper['countReScheduled'](_0x988a9a))[_0x2053('0xc')](loggerCatch(_0x2053('0x19')));};exports[_0x2053('0x1a')]=function(_0x4722aa){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopper[_0x2053('0x1a')]({'UserId':null},_0x4722aa,0x1))[_0x2053('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x2053('0x1b')]=function(_0x1d08fa){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopper[_0x2053('0x1a')]({'active':![]},_0x1d08fa,0x1))[_0x2053('0xc')](loggerCatch(_0x2053('0x1c')));};exports['crateCustomerReportQueue']=function(_0x35a44b){var _0x484cb5={};_0x484cb5['type']=_0x35a44b['type'];_0x484cb5[_0x2053('0x1d')]=_0x35a44b[_0x2053('0x1d')];_0x484cb5[_0x2053('0x1e')]=_0x35a44b[_0x2053('0x1e')];_0x484cb5[_0x2053('0x1f')]=_0x35a44b[_0x2053('0x1f')];_0x484cb5[_0x2053('0x20')]=_0x35a44b['queue'];_0x484cb5[_0x2053('0x21')]=_0x35a44b[_0x2053('0x22')];_0x484cb5[_0x2053('0x23')]=_0x35a44b[_0x2053('0x22')];_0x484cb5['queuecallercomplete']=0x1;_0x484cb5[_0x2053('0x24')]=_0x35a44b[_0x2053('0x25')];_0x484cb5['connectedlinename']=_0x35a44b[_0x2053('0x26')];_0x484cb5['context']=_0x2053('0x27');_0x484cb5['exten']=_0x2053('0x28');_0x484cb5[_0x2053('0x29')]=0x0;_0x484cb5['assigned']=0x1;_0x484cb5[_0x2053('0x2a')]=_0x35a44b['membername'];_0x484cb5['queuecallerexitreason']=_0x2053('0x2b');return BPromise['resolve']()['then'](voiceQueueReport[_0x2053('0x2c')](_0x484cb5))[_0x2053('0xc')](loggerCatch(_0x2053('0x2d')));};exports[_0x2053('0x2e')]=function(_0xbc461f,_0x3f3b3e){return BPromise[_0x2053('0xe')]()[_0x2053('0xa')](cmHopper[_0x2053('0x2e')](_0xbc461f,_0x3f3b3e))[_0x2053('0xc')](loggerCatch(_0x2053('0x2f')));};exports[_0x2053('0x30')]=function(_0xc35a38){return BPromise[_0x2053('0xe')]()['then'](cmHopper[_0x2053('0x16')](_0xc35a38,!![],!![]))[_0x2053('0xc')](loggerCatch(_0x2053('0x31')));}; \ 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 434ad7a..7b5e6b1 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 _0x16fb=['RECALL','calleridname','BOOKED','uniqueid','channelAgent','calleridnum','countbusyretry','countnosuchnumberretry','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','name','interface','motionChannel','voice','mandatoryDisposition','queue','not_inuse','status','reachable','push','getDiff','filterKey','idContact','type','campaigntype','callback','callbackuniqueid','callbackat','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','random','extractCalleridName','match','extractCalleridNumber','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','endtime','logAgent','state','statedesc','ringtime','membername','UserId','responsetime','talktime','answertime','isFailure','variablesAction'];(function(_0x4f1d9a,_0x230c3f){var _0x5cfa96=function(_0x5bc101){while(--_0x5bc101){_0x4f1d9a['push'](_0x4f1d9a['shift']());}};_0x5cfa96(++_0x230c3f);}(_0x16fb,0xcb));var _0xb16f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x16fb[_0x13b8f3];return _0x1a6d06;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb16f('0x0'));var logger=require(_0xb16f('0x1'))(_0xb16f('0x2'));var ipAgi=process[_0xb16f('0x3')][_0xb16f('0x4')]||_0xb16f('0x5');function getSeconds(_0x2cbf4b,_0x4be6fb){var _0x4f8357=moment(_0x2cbf4b)[_0xb16f('0x6')](0x0);var _0x1e9eec=moment(_0x4be6fb)[_0xb16f('0x6')](0x0);return _0x4f8357[_0xb16f('0x7')](_0x1e9eec,_0xb16f('0x8'));}exports[_0xb16f('0x9')]=function(_0x13c3cc){return function(_0xfa75ab){logger['error'](_0x13c3cc,util[_0xb16f('0xa')](_0xfa75ab,{'showHidden':![],'depth':null}));};};exports[_0xb16f('0xb')]=function(_0xc9f6a7,_0x6d6777){logger[_0xb16f('0xc')](_0xc9f6a7,util[_0xb16f('0xa')](_0x6d6777,{'showHidden':![],'depth':null}));};exports[_0xb16f('0xd')]=function(_0x23d250,_0x1bf285){logger[_0xb16f('0xe')](_0x23d250,util['inspect'](_0x1bf285,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x40d2ce){return function(_0x548fe9){logger[_0xb16f('0xc')](_0x40d2ce,util['inspect'](_0x548fe9,{'showHidden':![],'depth':null}));};};exports[_0xb16f('0xf')]=function(_0xc13991,_0x52576c,_0x60493e){return{'message':_0xc13991,'unlock':_0x52576c,'active':_0x60493e};};exports['getCallerId']=function(_0x503025,_0x3ead46,_0x4312f6){if(!_[_0xb16f('0x10')](_0x4312f6)&&_0xb16f('0x11')===typeof _0x4312f6&&!_[_0xb16f('0x12')](_0x4312f6)){if(!_['isUndefined'](_0x3ead46)&&_0xb16f('0x11')===typeof _0x3ead46&&!_[_0xb16f('0x12')](_0x3ead46)){return util[_0xb16f('0x13')](_0xb16f('0x14'),_0x3ead46,_0x4312f6);}return util[_0xb16f('0x13')](_0xb16f('0x14'),_0x4312f6,_0x4312f6);}if(!_[_0xb16f('0x10')](_0x503025)&&_0xb16f('0x11')===typeof _0x503025&&!_[_0xb16f('0x12')](_0x503025)){return _0x503025;}return'\x22\x22\x20<>';};exports[_0xb16f('0x15')]=function(_0x30504c){if(_[_0xb16f('0x16')](_0x30504c)){return![];}return _0x30504c;};exports[_0xb16f('0x17')]=function(_0x56262f,_0x2c8178,_0x73df26,_0x259a8b,_0x52e5d1,_0x290731){var _0x5e1392={'XMD-QUEUE':_0x2c8178['Queue']?_0x2c8178[_0xb16f('0x18')]['name']:'','XMD-CALLERID':_0x259a8b,'XMD-CALLERID-PREVIEW':_0x290731?util[_0xb16f('0x13')](_0xb16f('0x14'),_0x290731['calleridname'],_0x290731['calleridnum']):_0x259a8b,'XMD-DIALID':_0x52e5d1,'XMD-CONTACTID':_0x2c8178[_0xb16f('0x19')],'XMD-CDRTYPE':_0xb16f('0x1a'),'CALLERID(all)':_0x259a8b,'XMD-VOICEQUEUEID':_0x2c8178[_0xb16f('0x1b')],'XMD-DIALCHANNEL':_0x73df26,'XMD-DIALTIMEOUT':_0x56262f[_0xb16f('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xb16f('0x13')](_0xb16f('0x1d'),_0x56262f['dialQueueProject2']?'g':'',_[_0xb16f('0x12')](_0x56262f[_0xb16f('0x1e')])?'':_0xb16f('0x1f')),'XMD-DIALURL':_0x56262f[_0xb16f('0x20')]||'','XMD-AGI':_0x56262f[_0xb16f('0x21')]?util[_0xb16f('0x13')](_0xb16f('0x22'),ipAgi,_0x56262f[_0xb16f('0x21')]):_0xb16f('0x23'),'XMD-AGIAFTER':_0x56262f[_0xb16f('0x24')]?util[_0xb16f('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x56262f[_0xb16f('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x290731?_0x290731['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x290731?_0x290731[_0xb16f('0x25')]:'','XMD-DESTINATION':_0xb16f('0x26'),'SIPADDHEADER':_0xb16f('0x27')};if(!_['isEmpty'](_0x56262f[_0xb16f('0x1e')])){_0x5e1392[util[_0xb16f('0x13')]('%s',_0xb16f('0x28'))]=_0x56262f[_0xb16f('0x1e')];_0x5e1392[util[_0xb16f('0x13')]('%s',_0xb16f('0x29'))]=_0x52e5d1;}if(_0x2c8178&&_0x2c8178['Contact']){for(var _0x35dc7d in _0x2c8178[_0xb16f('0x2a')]){if(_0x2c8178[_0xb16f('0x2a')][_0xb16f('0x2b')](_0x35dc7d)){if(!_[_0xb16f('0x16')](_0x2c8178[_0xb16f('0x2a')][_0x35dc7d])&&_0x35dc7d!=='id'&&_0x35dc7d!==_0xb16f('0x2c')&&_0x35dc7d!==_0xb16f('0x2d')&&_0x35dc7d!==_0xb16f('0x2e')){_0x5e1392[util[_0xb16f('0x13')](_0xb16f('0x2f'),'XMD-',_[_0xb16f('0x30')](_0x35dc7d))]=_0x2c8178[_0xb16f('0x2a')][_0x35dc7d];}}}}return _0x5e1392;};exports[_0xb16f('0x31')]=function(_0x5afba9){var _0x3dec5a={};for(var _0x18b7c4 in _0x5afba9){if(_0x5afba9[_0xb16f('0x2b')](_0x18b7c4)){_0x3dec5a[util['format']('%s',_[_0xb16f('0x32')](_0x18b7c4))]=_0x5afba9[_0x18b7c4];}}return{'variables':_0x3dec5a};};exports[_0xb16f('0x33')]=function(_0x3412e8,_0xde3966){if(!_[_0xb16f('0x16')](_0x3412e8)){if(_0x3412e8[_0xb16f('0x2b')](_0xb16f('0x34'))){if(_0x3412e8[_0xb16f('0x34')]>0x0){_0x3412e8[_0xb16f('0x34')]-=0x1;}else{logger['error'](_0xb16f('0x35'),_0xde3966);}}}else{logger[_0xb16f('0xe')](_0xb16f('0x36'),_0xde3966);}};exports[_0xb16f('0x37')]=function(_0x3d5679){var _0x4fa3d1=moment()[_0xb16f('0x13')](_0xb16f('0x38'));_0x3d5679['state']=0xd;_0x3d5679['statedesc']=_0xb16f('0x39');_0x3d5679[_0xb16f('0x3a')]=_0x4fa3d1;_0x3d5679['responsetime']=_0x4fa3d1;_0x3d5679[_0xb16f('0x3b')]=_0x4fa3d1;};exports[_0xb16f('0x3c')]=function(_0x65ae4d,_0x262065,_0x126746){var _0x4cb3b3=moment()['format'](_0xb16f('0x38'));_0x65ae4d[_0xb16f('0x3d')]=_0x262065;_0x65ae4d[_0xb16f('0x3e')]=_0x126746;_0x65ae4d['responsetime']=_0x4cb3b3;_0x65ae4d[_0xb16f('0x3f')]=getSeconds(_0x65ae4d['responsetime'],_0x65ae4d[_0xb16f('0x3a')]);};exports['logLookAgent']=function(_0x3a02a5,_0x1ade2f,_0x53964a){_0x3a02a5[_0xb16f('0x40')]=_0x1ade2f;_0x3a02a5[_0xb16f('0x41')]=_0x53964a;};exports['logCustomer']=function(_0x344742,_0x4da80a,_0x8b38cc){var _0x28c816=moment()[_0xb16f('0x13')](_0xb16f('0x38'));_0x344742[_0xb16f('0x3d')]=_0x4da80a;_0x344742['statedesc']=_0x8b38cc;_0x344742[_0xb16f('0x42')]=_0x344742[_0xb16f('0x42')]?_0x344742[_0xb16f('0x42')]:_0x28c816;_0x344742[_0xb16f('0x3b')]=_0x344742[_0xb16f('0x3b')]?_0x344742[_0xb16f('0x3b')]:_0x28c816;_0x344742[_0xb16f('0x3f')]=getSeconds(_0x344742[_0xb16f('0x42')]||0x0,_0x344742['starttime']||0x0);_0x344742[_0xb16f('0x43')]=_0x344742[_0xb16f('0x44')]?getSeconds(_0x344742[_0xb16f('0x3b')],_0x344742['answertime']):0x0;};exports[_0xb16f('0x45')]=function(_0x428c46){return _0x428c46==='Failure';};exports[_0xb16f('0x46')]=function(_0x1a4e47,_0xec6702,_0x3e0dc2,_0x53b8b9,_0x4614ad){var _0x45f020=_0x53b8b9?_0xb16f('0x47'):_0x1a4e47[_0xb16f('0x48')];_0x45f020=_0x4614ad?_0xb16f('0x49'):_0x45f020;return{'actionid':_0x1a4e47[_0xb16f('0x4a')],'action':'originate','channel':_0x1a4e47[_0xb16f('0x4b')],'callerid':util[_0xb16f('0x13')](_0xb16f('0x14'),_0x45f020,_0x1a4e47[_0xb16f('0x4c')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x3e0dc2,'timeout':(_0xec6702['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1a4e47[_0xb16f('0x4a')]};};exports['totalGlobal']=function(_0x442890){return _0x442890[_0xb16f('0x4d')]+_0x442890['countcongestionretry']+_0x442890['countnoanswerretry']+_0x442890['countagentrejectretry']+_0x442890[_0xb16f('0x4e')];};exports['cloneAction']=function(_0x54d483){var _0x22e26d=_[_0xb16f('0x4f')](_0x54d483);_0x22e26d[_0xb16f('0x3d')]=0xf;_0x22e26d['statedesc']=_0xb16f('0x50');return _0x22e26d;};exports['scheduledAt']=function(_0x3c8f9e,_0x41e61e,_0x221df0){var _0x2d92a6={};_0x2d92a6[_0x41e61e]=_0x3c8f9e[_0x41e61e];_0x2d92a6[_0xb16f('0x51')]=![];_0x2d92a6[_0xb16f('0x52')]=moment()[_0xb16f('0x53')](_0x221df0,_0xb16f('0x54'))['format'](_0xb16f('0x38'));_0x2d92a6['ContactId']=_0x3c8f9e[_0xb16f('0x19')];_0x2d92a6['ListId']=_0x3c8f9e[_0xb16f('0x55')];_0x2d92a6[_0xb16f('0x1b')]=_0x3c8f9e[_0xb16f('0x1b')]||undefined;return _0x2d92a6;};exports[_0xb16f('0x56')]=function(_0x32f344,_0x3d3505){if(!_[_0xb16f('0x16')](_0x32f344)){if(_0x32f344[_0xb16f('0x57')]>0x0){_0x32f344[_0xb16f('0x57')]-=0x1;}else{logger[_0xb16f('0xe')](_0x3d3505,_0xb16f('0x58'));}}else{logger[_0xb16f('0xe')](_0x3d3505,_0xb16f('0x59'));}};exports['IsNotLoggedIn']=function(_0x4a3770){if(_0x4a3770<=0x0){return!![];}return![];};exports[_0xb16f('0x5a')]=function(_0x3b6837,_0x4db2d2,_0x17f8b1){_0x3b6837['lastevent']=_0x4db2d2;_0x3b6837[_0xb16f('0x5b')]=_0x3b6837['queue'];_0x3b6837[_0xb16f('0x5c')]=_0x3b6837[_0xb16f('0x4b')];_0x3b6837[_0xb16f('0x5d')]=_0xb16f('0x5e');if(_0x17f8b1){_0x3b6837[_0xb16f('0x5f')]=_0x17f8b1[_0xb16f('0x5f')];}return _0x3b6837;};exports['buildAcw']=function(_0x25e43a){var _0x5ea2e6={};_0x5ea2e6[_0xb16f('0x60')]=_0x25e43a['queue'];_0x5ea2e6[_0xb16f('0x5c')]=_0x25e43a[_0xb16f('0x4b')];_0x5ea2e6[_0xb16f('0x4a')]=_0x25e43a[_0xb16f('0x4a')];return _0x5ea2e6;};exports['agentReadyId']=function(_0x2613a5){var _0x499f88=[];for(var _0x1c7ecf in _0x2613a5){if(_0x2613a5[_0xb16f('0x2b')](_0x1c7ecf)){if(!_[_0xb16f('0x16')](_0x2613a5[_0x1c7ecf])&&_0x2613a5[_0x1c7ecf][_0xb16f('0x3d')]===_0xb16f('0x61')&&_0x2613a5[_0x1c7ecf][_0xb16f('0x62')]===_0xb16f('0x63')){_0x499f88[_0xb16f('0x64')](_0x2613a5[_0x1c7ecf]['id']);}}}return _0x499f88;};exports[_0xb16f('0x65')]=function(_0x16c4e2){var _0x2082cc=moment()[_0xb16f('0x6')](0x0);var _0xaa06c9=moment(_0x16c4e2)[_0xb16f('0x6')](0x0);return _0x2082cc[_0xb16f('0x7')](_0xaa06c9,_0xb16f('0x8'));};exports['createBody']=function(_0x1960ec){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1960ec['ContactId'],'ListId':_0x1960ec[_0xb16f('0x55')],'VoiceQueueId':_0x1960ec[_0xb16f('0x1b')]||undefined,'CampaignId':_0x1960ec['CampaignId']||undefined};};exports[_0xb16f('0x66')]=function(_0x2aa56b){if(_0x2aa56b===_0xb16f('0x4a')||_0x2aa56b===_0xb16f('0x67')||_0x2aa56b===_0xb16f('0x60')||_0x2aa56b===_0xb16f('0x68')||_0x2aa56b===_0xb16f('0x69')||_0x2aa56b==='dialAnswer'||_0x2aa56b===_0xb16f('0x40')||_0x2aa56b==='channelAgent'||_0x2aa56b===_0xb16f('0x48')||_0x2aa56b===_0xb16f('0x51')||_0x2aa56b===_0xb16f('0x4c')||_0x2aa56b===_0xb16f('0x52')||_0x2aa56b===_0xb16f('0x4d')||_0x2aa56b==='countcongestionretry'||_0x2aa56b==='countnoanswerretry'||_0x2aa56b==='countglobal'||_0x2aa56b===_0xb16f('0x6a')||_0x2aa56b===_0xb16f('0x6b')||_0x2aa56b===_0xb16f('0x6c')||_0x2aa56b==='recallme'||_0x2aa56b==='ContactId'||_0x2aa56b===_0xb16f('0x55')||_0x2aa56b===_0xb16f('0x41')||_0x2aa56b===_0xb16f('0x1b')||_0x2aa56b==='sipcallid'||_0x2aa56b==='xmd-voicequeueid'||_0x2aa56b===_0xb16f('0x6d')||_0x2aa56b===_0xb16f('0x6e')||_0x2aa56b===_0xb16f('0x6f')||_0x2aa56b===_0xb16f('0x70')||_0x2aa56b==='xmd-dialtimeout'||_0x2aa56b===_0xb16f('0x71')||_0x2aa56b===_0xb16f('0x72')||_0x2aa56b===_0xb16f('0x73')||_0x2aa56b===_0xb16f('0x74')||_0x2aa56b===_0xb16f('0x75')||_0x2aa56b===_0xb16f('0x76')||_0x2aa56b===_0xb16f('0x77')||_0x2aa56b===_0xb16f('0x78')||_0x2aa56b===_0xb16f('0x79')||_0x2aa56b===_0xb16f('0x7a')||_0x2aa56b==='rtpaudioqosjitter'||_0x2aa56b===_0xb16f('0x7b')||_0x2aa56b===_0xb16f('0x7c')||_0x2aa56b==='rtpaudioqoslossbridged'||_0x2aa56b==='rtpaudioqosrtt'||_0x2aa56b===_0xb16f('0x7d')||_0x2aa56b==='rtpaudioqos'||_0x2aa56b==='rtpaudioqosbridged'||_0x2aa56b===_0xb16f('0x7e')||_0x2aa56b==='rtpaudioqosjitterbridged'||_0x2aa56b===_0xb16f('0x7c')||_0x2aa56b===_0xb16f('0x7f')||_0x2aa56b===_0xb16f('0x80')||_0x2aa56b===_0xb16f('0x7d')||_0x2aa56b===_0xb16f('0x81')||_0x2aa56b===_0xb16f('0x82')||_0x2aa56b==='state'||_0x2aa56b===_0xb16f('0x3e')){return![];}return!![];};exports[_0xb16f('0x83')]=function(_0x5bba00,_0x4922a9){var _0x7c3aa7,_0x598832,_0x453ab4;if(_0x4922a9<=0x0){_0x4922a9=0x1;}_0x7c3aa7=new RegExp(_0xb16f('0x84')+_0x4922a9+'}$');_0x598832=Math['pow'](0xa,_0x4922a9-0x1);_0x453ab4=Math['pow'](0xa,_0x4922a9)-0x1;return util[_0xb16f('0x13')]('%s',_['replace'](_0x5bba00,_0x7c3aa7,_[_0xb16f('0x85')](_0x598832,_0x453ab4)));};exports[_0xb16f('0x86')]=function(_0x430b30){var _0x3136a8=_0x430b30[_0xb16f('0x87')](/"(.*?)"/);return _0x3136a8?_0x3136a8[0x1]:_0x430b30;};exports[_0xb16f('0x88')]=function(_0xfc7f54){var _0x4f241a=_0xfc7f54[_0xb16f('0x87')](/<(.*?)>/);return _0x4f241a?_0x4f241a[0x1]:_0xfc7f54;}; \ No newline at end of file +var _0xa9c4=['scheduledat','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','not_inuse','status','reachable','getDiff','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','format','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','statedesc','ringtime','responsetime','membername','UserId','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active'];(function(_0x5532c8,_0x12952a){var _0x75420d=function(_0x168826){while(--_0x168826){_0x5532c8['push'](_0x5532c8['shift']());}};_0x75420d(++_0x12952a);}(_0xa9c4,0xc3));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4a9c('0x0'));var _=require('lodash');var moment=require(_0x4a9c('0x1'));var logger=require(_0x4a9c('0x2'))(_0x4a9c('0x3'));var ipAgi=process[_0x4a9c('0x4')][_0x4a9c('0x5')]||_0x4a9c('0x6');function getSeconds(_0xfcc9f6,_0x399000){var _0x33a3c5=moment(_0xfcc9f6)[_0x4a9c('0x7')](0x0);var _0xd4269e=moment(_0x399000)['milliseconds'](0x0);return _0x33a3c5[_0x4a9c('0x8')](_0xd4269e,_0x4a9c('0x9'));}exports[_0x4a9c('0xa')]=function(_0x361200){return function(_0x5fd4f6){logger[_0x4a9c('0xb')](_0x361200,util[_0x4a9c('0xc')](_0x5fd4f6,{'showHidden':![],'depth':null}));};};exports[_0x4a9c('0xd')]=function(_0x3fc8ca,_0x568aca){logger[_0x4a9c('0xe')](_0x3fc8ca,util['inspect'](_0x568aca,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x294d0e,_0x20871c){logger[_0x4a9c('0xb')](_0x294d0e,util['inspect'](_0x20871c,{'showHidden':![],'depth':null}));};exports[_0x4a9c('0xf')]=function(_0xf4e4dd){return function(_0x3de813){logger[_0x4a9c('0xe')](_0xf4e4dd,util[_0x4a9c('0xc')](_0x3de813,{'showHidden':![],'depth':null}));};};exports[_0x4a9c('0x10')]=function(_0x377a7b,_0x41ddb7,_0x102927){return{'message':_0x377a7b,'unlock':_0x41ddb7,'active':_0x102927};};exports[_0x4a9c('0x11')]=function(_0x35183a,_0x45d75d,_0x3ac319){if(!_['isUndefined'](_0x3ac319)&&_0x4a9c('0x12')===typeof _0x3ac319&&!_[_0x4a9c('0x13')](_0x3ac319)){if(!_[_0x4a9c('0x14')](_0x45d75d)&&_0x4a9c('0x12')===typeof _0x45d75d&&!_[_0x4a9c('0x13')](_0x45d75d)){return util['format'](_0x4a9c('0x15'),_0x45d75d,_0x3ac319);}return util['format'](_0x4a9c('0x15'),_0x3ac319,_0x3ac319);}if(!_['isUndefined'](_0x35183a)&&'string'===typeof _0x35183a&&!_['isEmpty'](_0x35183a)){return _0x35183a;}return _0x4a9c('0x16');};exports[_0x4a9c('0x17')]=function(_0x145802){if(_[_0x4a9c('0x18')](_0x145802)){return![];}return _0x145802;};exports[_0x4a9c('0x19')]=function(_0x42cad2,_0x4b2c9b,_0x577b3b,_0xe901b3,_0x4e1c50,_0x4ff045){var _0x18a0bd={'XMD-QUEUE':_0x4b2c9b[_0x4a9c('0x1a')]?_0x4b2c9b[_0x4a9c('0x1a')][_0x4a9c('0x1b')]:'','XMD-CALLERID':_0xe901b3,'XMD-CALLERID-PREVIEW':_0x4ff045?util[_0x4a9c('0x1c')](_0x4a9c('0x15'),_0x4ff045['calleridname'],_0x4ff045[_0x4a9c('0x1d')]):_0xe901b3,'XMD-DIALID':_0x4e1c50,'XMD-CONTACTID':_0x4b2c9b[_0x4a9c('0x1e')],'XMD-CDRTYPE':_0x4a9c('0x1f'),'CALLERID(all)':_0xe901b3,'XMD-VOICEQUEUEID':_0x4b2c9b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x577b3b,'XMD-DIALTIMEOUT':_0x42cad2['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x4a9c('0x1c')](_0x4a9c('0x20'),_0x42cad2[_0x4a9c('0x21')]?'g':'',_[_0x4a9c('0x13')](_0x42cad2[_0x4a9c('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x42cad2[_0x4a9c('0x23')]||'','XMD-AGI':_0x42cad2[_0x4a9c('0x24')]?util[_0x4a9c('0x1c')](_0x4a9c('0x25'),ipAgi,_0x42cad2[_0x4a9c('0x24')]):_0x4a9c('0x26'),'XMD-AGIAFTER':_0x42cad2[_0x4a9c('0x21')]?util[_0x4a9c('0x1c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x42cad2[_0x4a9c('0x21')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4ff045?_0x4ff045[_0x4a9c('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x4ff045?_0x4ff045[_0x4a9c('0x28')]:'','XMD-DESTINATION':_0x4a9c('0x29'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x4a9c('0x13')](_0x42cad2[_0x4a9c('0x22')])){_0x18a0bd[util[_0x4a9c('0x1c')]('%s',_0x4a9c('0x2a'))]=_0x42cad2[_0x4a9c('0x22')];_0x18a0bd[util[_0x4a9c('0x1c')]('%s',_0x4a9c('0x2b'))]=_0x4e1c50;}if(_0x4b2c9b&&_0x4b2c9b[_0x4a9c('0x2c')]){for(var _0x50dbe5 in _0x4b2c9b['Contact']){if(_0x4b2c9b[_0x4a9c('0x2c')][_0x4a9c('0x2d')](_0x50dbe5)){if(!_[_0x4a9c('0x18')](_0x4b2c9b[_0x4a9c('0x2c')][_0x50dbe5])&&_0x50dbe5!=='id'&&_0x50dbe5!=='tags'&&_0x50dbe5!==_0x4a9c('0x2e')&&_0x50dbe5!==_0x4a9c('0x2f')){_0x18a0bd[util[_0x4a9c('0x1c')](_0x4a9c('0x30'),_0x4a9c('0x31'),_[_0x4a9c('0x32')](_0x50dbe5))]=_0x4b2c9b['Contact'][_0x50dbe5];}}}}return _0x18a0bd;};exports['toLowerVariables']=function(_0x1905ed){var _0x534aa2={};for(var _0x2416f4 in _0x1905ed){if(_0x1905ed[_0x4a9c('0x2d')](_0x2416f4)){_0x534aa2[util[_0x4a9c('0x1c')]('%s',_[_0x4a9c('0x33')](_0x2416f4))]=_0x1905ed[_0x2416f4];}}return{'variables':_0x534aa2};};exports[_0x4a9c('0x34')]=function(_0x4499e0,_0xfbf443){if(!_[_0x4a9c('0x18')](_0x4499e0)){if(_0x4499e0[_0x4a9c('0x2d')](_0x4a9c('0x35'))){if(_0x4499e0[_0x4a9c('0x35')]>0x0){_0x4499e0[_0x4a9c('0x35')]-=0x1;}else{logger[_0x4a9c('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0xfbf443);}}}else{logger[_0x4a9c('0xb')](_0x4a9c('0x36'),_0xfbf443);}};exports[_0x4a9c('0x37')]=function(_0x4e051f){var _0x24c7fc=moment()[_0x4a9c('0x1c')](_0x4a9c('0x38'));_0x4e051f[_0x4a9c('0x39')]=0xd;_0x4e051f['statedesc']=_0x4a9c('0x3a');_0x4e051f[_0x4a9c('0x3b')]=_0x24c7fc;_0x4e051f['responsetime']=_0x24c7fc;_0x4e051f[_0x4a9c('0x3c')]=_0x24c7fc;};exports['logAgent']=function(_0x2af305,_0x37bc1a,_0x3d1458){var _0x40e553=moment()[_0x4a9c('0x1c')](_0x4a9c('0x38'));_0x2af305[_0x4a9c('0x39')]=_0x37bc1a;_0x2af305[_0x4a9c('0x3d')]=_0x3d1458;_0x2af305['responsetime']=_0x40e553;_0x2af305[_0x4a9c('0x3e')]=getSeconds(_0x2af305[_0x4a9c('0x3f')],_0x2af305['starttime']);};exports['logLookAgent']=function(_0x1918c0,_0x13c358,_0x14a3da){_0x1918c0[_0x4a9c('0x40')]=_0x13c358;_0x1918c0[_0x4a9c('0x41')]=_0x14a3da;};exports['logCustomer']=function(_0x1e42ed,_0x489fff,_0x599cc4){var _0x4a110d=moment()[_0x4a9c('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e42ed[_0x4a9c('0x39')]=_0x489fff;_0x1e42ed['statedesc']=_0x599cc4;_0x1e42ed['responsetime']=_0x1e42ed['responsetime']?_0x1e42ed[_0x4a9c('0x3f')]:_0x4a110d;_0x1e42ed['endtime']=_0x1e42ed[_0x4a9c('0x3c')]?_0x1e42ed[_0x4a9c('0x3c')]:_0x4a110d;_0x1e42ed[_0x4a9c('0x3e')]=getSeconds(_0x1e42ed['responsetime']||0x0,_0x1e42ed[_0x4a9c('0x3b')]||0x0);_0x1e42ed[_0x4a9c('0x42')]=_0x1e42ed[_0x4a9c('0x43')]?getSeconds(_0x1e42ed[_0x4a9c('0x3c')],_0x1e42ed['answertime']):0x0;};exports[_0x4a9c('0x44')]=function(_0x140c9f){return _0x140c9f===_0x4a9c('0x45');};exports['variablesAction']=function(_0x206b8a,_0x222411,_0x5ecc98,_0x2eef24,_0x35484e){var _0x2811ce=_0x2eef24?_0x4a9c('0x46'):_0x206b8a['calleridname'];_0x2811ce=_0x35484e?_0x4a9c('0x47'):_0x2811ce;return{'actionid':_0x206b8a[_0x4a9c('0x48')],'action':_0x4a9c('0x49'),'channel':_0x206b8a[_0x4a9c('0x4a')],'callerid':util[_0x4a9c('0x1c')](_0x4a9c('0x15'),_0x2811ce,_0x206b8a[_0x4a9c('0x1d')]),'Exten':'xcally-motion-preview','Context':_0x4a9c('0x4b'),'Priority':'1','variable':_0x5ecc98,'timeout':(_0x222411[_0x4a9c('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x206b8a[_0x4a9c('0x48')]};};exports[_0x4a9c('0x4d')]=function(_0x249a23){return _0x249a23[_0x4a9c('0x4e')]+_0x249a23[_0x4a9c('0x4f')]+_0x249a23[_0x4a9c('0x50')]+_0x249a23[_0x4a9c('0x51')]+_0x249a23['countnosuchnumberretry'];};exports[_0x4a9c('0x52')]=function(_0x311b9a){var _0x2c4a5d=_[_0x4a9c('0x53')](_0x311b9a);_0x2c4a5d[_0x4a9c('0x39')]=0xf;_0x2c4a5d[_0x4a9c('0x3d')]=_0x4a9c('0x54');return _0x2c4a5d;};exports[_0x4a9c('0x55')]=function(_0x4c13a0,_0x47ee4a,_0x2b067e){var _0x3074f9={};_0x3074f9[_0x47ee4a]=_0x4c13a0[_0x47ee4a];_0x3074f9[_0x4a9c('0x56')]=![];_0x3074f9[_0x4a9c('0x57')]=moment()['add'](_0x2b067e,'minutes')[_0x4a9c('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3074f9[_0x4a9c('0x1e')]=_0x4c13a0[_0x4a9c('0x1e')];_0x3074f9[_0x4a9c('0x58')]=_0x4c13a0['ListId'];_0x3074f9[_0x4a9c('0x59')]=_0x4c13a0[_0x4a9c('0x59')]||undefined;return _0x3074f9;};exports['decrementTalkink']=function(_0x2efed8,_0x2b3f0a){if(!_[_0x4a9c('0x18')](_0x2efed8)){if(_0x2efed8[_0x4a9c('0x5a')]>0x0){_0x2efed8[_0x4a9c('0x5a')]-=0x1;}else{logger['error'](_0x2b3f0a,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x4a9c('0xb')](_0x2b3f0a,_0x4a9c('0x5b'));}};exports['IsNotLoggedIn']=function(_0x1c68a6){if(_0x1c68a6<=0x0){return!![];}return![];};exports[_0x4a9c('0x5c')]=function(_0x52d915,_0x4401d5,_0x3d8346){_0x52d915[_0x4a9c('0x5d')]=_0x4401d5;_0x52d915[_0x4a9c('0x1b')]=_0x52d915[_0x4a9c('0x5e')];_0x52d915[_0x4a9c('0x5f')]=_0x52d915[_0x4a9c('0x4a')];_0x52d915[_0x4a9c('0x60')]=_0x4a9c('0x61');if(_0x3d8346){_0x52d915[_0x4a9c('0x62')]=_0x3d8346[_0x4a9c('0x62')];}return _0x52d915;};exports['buildAcw']=function(_0x483cdb){var _0x16872e={};_0x16872e['queue']=_0x483cdb[_0x4a9c('0x5e')];_0x16872e[_0x4a9c('0x5f')]=_0x483cdb[_0x4a9c('0x4a')];_0x16872e['uniqueid']=_0x483cdb[_0x4a9c('0x48')];return _0x16872e;};exports['agentReadyId']=function(_0x14c55a){var _0x4b466a=[];for(var _0x1d0a48 in _0x14c55a){if(_0x14c55a[_0x4a9c('0x2d')](_0x1d0a48)){if(!_[_0x4a9c('0x18')](_0x14c55a[_0x1d0a48])&&_0x14c55a[_0x1d0a48][_0x4a9c('0x39')]===_0x4a9c('0x63')&&_0x14c55a[_0x1d0a48][_0x4a9c('0x64')]===_0x4a9c('0x65')){_0x4b466a['push'](_0x14c55a[_0x1d0a48]['id']);}}}return _0x4b466a;};exports[_0x4a9c('0x66')]=function(_0x37aa9f){var _0xcb9a62=moment()[_0x4a9c('0x7')](0x0);var _0xb1d742=moment(_0x37aa9f)[_0x4a9c('0x7')](0x0);return _0xcb9a62['diff'](_0xb1d742,'seconds');};exports['createBody']=function(_0x269df7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x269df7[_0x4a9c('0x1e')],'ListId':_0x269df7[_0x4a9c('0x58')],'VoiceQueueId':_0x269df7[_0x4a9c('0x59')]||undefined,'CampaignId':_0x269df7['CampaignId']||undefined};};exports['filterKey']=function(_0x4c2141){if(_0x4c2141===_0x4a9c('0x48')||_0x4c2141===_0x4a9c('0x67')||_0x4c2141===_0x4a9c('0x5e')||_0x4c2141===_0x4a9c('0x68')||_0x4c2141===_0x4a9c('0x69')||_0x4c2141===_0x4a9c('0x6a')||_0x4c2141===_0x4a9c('0x40')||_0x4c2141==='channelAgent'||_0x4c2141==='calleridname'||_0x4c2141===_0x4a9c('0x56')||_0x4c2141===_0x4a9c('0x1d')||_0x4c2141===_0x4a9c('0x57')||_0x4c2141==='countbusyretry'||_0x4c2141===_0x4a9c('0x4f')||_0x4c2141==='countnoanswerretry'||_0x4c2141===_0x4a9c('0x6b')||_0x4c2141===_0x4a9c('0x6c')||_0x4c2141==='callbackuniqueid'||_0x4c2141===_0x4a9c('0x6d')||_0x4c2141===_0x4a9c('0x6e')||_0x4c2141===_0x4a9c('0x1e')||_0x4c2141==='ListId'||_0x4c2141===_0x4a9c('0x41')||_0x4c2141===_0x4a9c('0x59')||_0x4c2141===_0x4a9c('0x6f')||_0x4c2141==='xmd-voicequeueid'||_0x4c2141===_0x4a9c('0x70')||_0x4c2141===_0x4a9c('0x71')||_0x4c2141===_0x4a9c('0x72')||_0x4c2141===_0x4a9c('0x73')||_0x4c2141===_0x4a9c('0x74')||_0x4c2141===_0x4a9c('0x75')||_0x4c2141==='xmd-dialid'||_0x4c2141===_0x4a9c('0x76')||_0x4c2141===_0x4a9c('0x77')||_0x4c2141===_0x4a9c('0x78')||_0x4c2141===_0x4a9c('0x79')||_0x4c2141===_0x4a9c('0x7a')||_0x4c2141===_0x4a9c('0x7b')||_0x4c2141==='rtpaudioqos'||_0x4c2141===_0x4a9c('0x7c')||_0x4c2141===_0x4a9c('0x7d')||_0x4c2141==='rtpaudioqosjitterbridged'||_0x4c2141===_0x4a9c('0x7e')||_0x4c2141===_0x4a9c('0x7f')||_0x4c2141===_0x4a9c('0x80')||_0x4c2141===_0x4a9c('0x81')||_0x4c2141===_0x4a9c('0x82')||_0x4c2141===_0x4a9c('0x7c')||_0x4c2141===_0x4a9c('0x7d')||_0x4c2141===_0x4a9c('0x83')||_0x4c2141===_0x4a9c('0x7e')||_0x4c2141==='rtpaudioqoslossbridged'||_0x4c2141===_0x4a9c('0x80')||_0x4c2141===_0x4a9c('0x81')||_0x4c2141===_0x4a9c('0x84')||_0x4c2141===_0x4a9c('0x85')||_0x4c2141==='state'||_0x4c2141===_0x4a9c('0x3d')){return![];}return!![];};exports[_0x4a9c('0x86')]=function(_0x2a3145,_0x396514){var _0x364298,_0x3263f6,_0x586fab;if(_0x396514<=0x0){_0x396514=0x1;}_0x364298=new RegExp(_0x4a9c('0x87')+_0x396514+'}$');_0x3263f6=Math[_0x4a9c('0x88')](0xa,_0x396514-0x1);_0x586fab=Math[_0x4a9c('0x88')](0xa,_0x396514)-0x1;return util[_0x4a9c('0x1c')]('%s',_[_0x4a9c('0x89')](_0x2a3145,_0x364298,_[_0x4a9c('0x8a')](_0x3263f6,_0x586fab)));};exports[_0x4a9c('0x8b')]=function(_0x58e95f){var _0x5c8208=_0x58e95f['match'](/"(.*?)"/);return _0x5c8208?_0x5c8208[0x1]:_0x58e95f;};exports[_0x4a9c('0x8c')]=function(_0x2cc05d){var _0x3d2d14=_0x2cc05d['match'](/<(.*?)>/);return _0x3d2d14?_0x3d2d14[0x1]:_0x2cc05d;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ae066cf..ffe46b2 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 _0xea50=['number','queueremove','queuepause','reload','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xea50,0x1c6));var _0x0ea5=function(_0x408ef6,_0x32f26e){_0x408ef6=_0x408ef6-0x0;var _0xdbf294=_0xea50[_0x408ef6];return _0xdbf294;};'use strict';exports[_0x0ea5('0x0')]={'queue':{'type':_0x0ea5('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x0ea5('0x1'),'required':!![]},'penalty':{'type':_0x0ea5('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x0ea5('0x3')]={'queue':{'type':_0x0ea5('0x1'),'required':!![]},'interface':{'type':_0x0ea5('0x1'),'required':!![]}};exports[_0x0ea5('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x0ea5('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x0ea5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x0ea5('0x6')]={'uniqueid':{'type':_0x0ea5('0x1'),'required':!![]}};exports[_0x0ea5('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x0ea5('0x1')}}; \ No newline at end of file +var _0xa265=['voicequeuechannelhangup','queueadd','string','number','boolean','reload','voicequeuechannel'];(function(_0x2d1e99,_0xa8fb07){var _0x12598f=function(_0x44f24e){while(--_0x44f24e){_0x2d1e99['push'](_0x2d1e99['shift']());}};_0x12598f(++_0xa8fb07);}(_0xa265,0x119));var _0x5a26=function(_0x4e5b01,_0xc25b04){_0x4e5b01=_0x4e5b01-0x0;var _0x310d44=_0xa265[_0x4e5b01];return _0x310d44;};'use strict';exports[_0x5a26('0x0')]={'queue':{'type':_0x5a26('0x1'),'required':!![]},'interface':{'type':_0x5a26('0x1'),'required':!![]},'membername':{'type':_0x5a26('0x1'),'required':!![]},'penalty':{'type':_0x5a26('0x2'),'required':![]},'paused':{'type':_0x5a26('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x5a26('0x1'),'required':!![]},'interface':{'type':_0x5a26('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x5a26('0x3')},'reason':{'type':_0x5a26('0x1'),'required':![]}};exports[_0x5a26('0x4')]={'module':{'type':_0x5a26('0x1'),'required':![]}};exports[_0x5a26('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5a26('0x1')},'format':{'type':_0x5a26('0x1')},'mixmonitorid':{'type':_0x5a26('0x1')}};exports[_0x5a26('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x5a26('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7640e00..e9449e5 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 _0xf2f3=['billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerabandon','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','sumBillable','queuecallercompleteAt','queuecallerleaveAt','total','duration','disposition','ANSWERED'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0xf2f3,0x138));var _0x3f2f=function(_0x36befe,_0x5d4d6b){_0x36befe=_0x36befe-0x0;var _0x438f2d=_0xf2f3[_0x36befe];return _0x438f2d;};'use strict';var BPromise=require('bluebird');var util=require(_0x3f2f('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x3f2f('0x1'));var Telephone=require('../model/telephone');var Trunk=require(_0x3f2f('0x2'));var VoiceQueue=require(_0x3f2f('0x3'));var Trigger=require(_0x3f2f('0x4'));var Template=require(_0x3f2f('0x5'));var Campaign=require(_0x3f2f('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x3f2f('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x3f2f('0x8'));var SugarcrmAccount=require(_0x3f2f('0x9'));var ZohoAccount=require(_0x3f2f('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x3f2f('0xb'));var ServicenowAccount=require(_0x3f2f('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x3f2f('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x3f2f('0xe')]={};this[_0x3f2f('0xf')]={};this[_0x3f2f('0x10')]={};this[_0x3f2f('0x11')]={};this[_0x3f2f('0x12')]={};this[_0x3f2f('0x13')]={};this[_0x3f2f('0x14')]={};this[_0x3f2f('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3f2f('0x16')]={};this[_0x3f2f('0x17')]={};this['queueChannels']={};this[_0x3f2f('0x18')]={};this[_0x3f2f('0x19')]={};this[_0x3f2f('0x1a')]={};this['zendeskAccounts']={};this[_0x3f2f('0x1b')]={};this[_0x3f2f('0x1c')]={};this[_0x3f2f('0x1d')]={};this[_0x3f2f('0x1e')]={};this[_0x3f2f('0x1f')]={};this[_0x3f2f('0x20')]={};this[_0x3f2f('0x21')]={};this['dynamics365Accounts']={};this[_0x3f2f('0x22')]={};this[_0x3f2f('0x23')]={};};function freeIsNotKey(_0x297f7f,_0x4eb3ca,_0x151f1e){var _0x50ceba=_[_0x3f2f('0x24')](_0x297f7f,function(_0x375b39,_0x204d98){return _0x375b39[_0x151f1e];});for(var _0x5de305 in _0x4eb3ca){if(_0x4eb3ca[_0x3f2f('0x25')](_0x5de305)){if(!_0x50ceba[_0x5de305]){delete _0x4eb3ca[_0x5de305];}}}}function freeIsNotKeySip(_0x43fb4d,_0x2b3626){var _0x1a964d=_['mapKeys'](_0x43fb4d,function(_0x2af2ad,_0x374b38){return util[_0x3f2f('0x26')]('SIP/%s',_0x2af2ad[_0x3f2f('0x27')]);});for(var _0x41491d in _0x2b3626){if(_0x2b3626[_0x3f2f('0x25')](_0x41491d)){if(!_0x1a964d[_0x41491d]){delete _0x2b3626[_0x41491d];}}}}function freeIsNotKeyAgent(_0x593b9b,_0x87c5c){var _0x56e62c=_[_0x3f2f('0x24')](_0x593b9b,function(_0x256651,_0xcde6ff){var _0x2d0370=_[_0x3f2f('0x28')](_0x256651[_0x3f2f('0x29')])?util[_0x3f2f('0x26')](_0x3f2f('0x2a'),_0x256651[_0x3f2f('0x27')]):_0x256651[_0x3f2f('0x29')];return _0x2d0370;});for(var _0x408892 in _0x87c5c){if(_0x87c5c['hasOwnProperty'](_0x408892)){if(!_0x56e62c[_0x408892]){delete _0x87c5c[_0x408892];}}}}function clearVoiceCallReports(_0x18d12b){_0x18d12b['total']=0x0;_0x18d12b[_0x3f2f('0x2b')]=0x0;_0x18d12b[_0x3f2f('0x2c')]=0x0;_0x18d12b[_0x3f2f('0x2d')]=0x0;_0x18d12b['sumBillable']=0x0;}function clearCampaigns(_0x4c0df0){if(!_[_0x3f2f('0x2e')](_0x4c0df0)){for(var _0x4a0bbf in _0x4c0df0){if(_0x4c0df0[_0x3f2f('0x25')](_0x4a0bbf)){_0x4c0df0[_0x4a0bbf][_0x3f2f('0x2f')]=0x0;_0x4c0df0[_0x4a0bbf]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x412304){if(!_[_0x3f2f('0x2e')](_0x412304)){for(var _0x13fcba in _0x412304){if(_0x412304[_0x3f2f('0x25')](_0x13fcba)){_0x412304[_0x13fcba]['total']=0x0;_0x412304[_0x13fcba][_0x3f2f('0x2b')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x30')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x31')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x2c')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x2d')]=0x0;_0x412304[_0x13fcba]['sumBillable']=0x0;_0x412304[_0x13fcba][_0x3f2f('0x32')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x33')]=0x0;_0x412304[_0x13fcba]['outboundBusyCallsDay']=0x0;_0x412304[_0x13fcba][_0x3f2f('0x34')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x35')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x36')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x37')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x38')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x39')]=0x0;_0x412304[_0x13fcba]['outboundOriginateFailureCallsDay']=0x0;_0x412304[_0x13fcba][_0x3f2f('0x3a')]=0x0;_0x412304[_0x13fcba][_0x3f2f('0x3b')]=0x0;_0x412304[_0x13fcba]['outboundAnswerAgiCallsDay']=0x0;_0x412304[_0x13fcba][_0x3f2f('0x3c')]=0x0;_0x412304[_0x13fcba]['queueStatusComplete']=!![];}}}}Realtime[_0x3f2f('0x3d')][_0x3f2f('0x3e')]=function(_0x49cf70,_0x5799ab){for(var _0x2f1ad2 in _0x5799ab){if(_0x49cf70[_0x3f2f('0x25')](_0x2f1ad2)){_0x49cf70[_0x2f1ad2]=_0x5799ab[_0x2f1ad2];}}};Realtime[_0x3f2f('0x3d')]['initAgents']=function(){var _0x2cf5dc=this;return function(_0x1bb076){if(_0x1bb076){freeIsNotKeyAgent(_0x1bb076,_0x2cf5dc['agents']);for(var _0x27c2ae=0x0,_0x33f984={},_0x488f1f={};_0x27c2ae<_0x1bb076[_0x3f2f('0x3f')];_0x27c2ae+=0x1){_0x33f984=_0x1bb076[_0x27c2ae];var _0x236e61=_[_0x3f2f('0x28')](_0x33f984['interface'])?util[_0x3f2f('0x26')]('SIP/%s',_0x33f984['name']):_0x33f984['interface'];if(_[_0x3f2f('0x40')](_0x2cf5dc[_0x3f2f('0xe')][_0x236e61])){_0x2cf5dc['agents'][_0x236e61]=new Agent(_0x33f984);}else{_0x2cf5dc['mergeFromDatabase'](_0x2cf5dc['agents'][_0x236e61],_0x33f984);}}}return _0x2cf5dc['agents'];};};Realtime[_0x3f2f('0x3d')]['initTelephones']=function(){var _0x32948e=this;return function(_0x4383ab){if(_0x4383ab){freeIsNotKeySip(_0x4383ab,_0x32948e[_0x3f2f('0xf')]);for(var _0xf72231=0x0,_0x20eea2={},_0x40a6f1={};_0xf72231<_0x4383ab[_0x3f2f('0x3f')];_0xf72231+=0x1){_0x20eea2=_0x4383ab[_0xf72231];if(_['isUndefined'](_0x32948e['telephones'][util[_0x3f2f('0x26')](_0x3f2f('0x2a'),_0x20eea2[_0x3f2f('0x27')])])){_0x32948e[_0x3f2f('0xf')][util[_0x3f2f('0x26')]('SIP/%s',_0x20eea2[_0x3f2f('0x27')])]=new Telephone(_0x20eea2);}else{_0x32948e[_0x3f2f('0x3e')](_0x32948e[_0x3f2f('0xf')][util[_0x3f2f('0x26')]('SIP/%s',_0x20eea2[_0x3f2f('0x27')])],_0x20eea2);}}}return _0x32948e[_0x3f2f('0xf')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x41')]=function(){var _0x422ab3=this;return function(_0x49a812){if(_0x49a812){freeIsNotKeySip(_0x49a812,_0x422ab3[_0x3f2f('0x10')]);for(var _0xf00c36=0x0,_0x18371f={},_0x1ab3d9={};_0xf00c36<_0x49a812[_0x3f2f('0x3f')];_0xf00c36+=0x1){_0x18371f=_0x49a812[_0xf00c36];if(_[_0x3f2f('0x40')](_0x422ab3[_0x3f2f('0x10')][util['format'](_0x3f2f('0x2a'),_0x18371f[_0x3f2f('0x27')])])){_0x422ab3[_0x3f2f('0x10')][util['format']('SIP/%s',_0x18371f[_0x3f2f('0x27')])]=new Trunk(_0x18371f);}else{_0x422ab3[_0x3f2f('0x3e')](_0x422ab3[_0x3f2f('0x10')][util[_0x3f2f('0x26')](_0x3f2f('0x2a'),_0x18371f['name'])],_0x18371f);}}}return _0x422ab3['trunks'];};};Realtime['prototype'][_0x3f2f('0x42')]=function(){var _0x9115dc=this;return function(_0x33b31d){if(_0x33b31d){freeIsNotKey(_0x33b31d,_0x9115dc['voiceQueues'],_0x3f2f('0x27'));for(var _0x326b87=0x0,_0x2cf1c2={},_0x5d1256={};_0x326b87<_0x33b31d[_0x3f2f('0x3f')];_0x326b87+=0x1){_0x2cf1c2=_0x33b31d[_0x326b87];if(_['isUndefined'](_0x9115dc['voiceQueues'][_0x2cf1c2[_0x3f2f('0x27')]])){_0x9115dc[_0x3f2f('0x11')][_0x2cf1c2[_0x3f2f('0x27')]]=new VoiceQueue(_0x2cf1c2);}else{_0x9115dc[_0x3f2f('0x3e')](_0x9115dc[_0x3f2f('0x11')][_0x2cf1c2[_0x3f2f('0x27')]],_0x2cf1c2);}}}return _0x9115dc[_0x3f2f('0x11')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x43')]=function(){var _0x472b4f=this;return function(_0xcef582){if(_0xcef582){freeIsNotKey(_0xcef582,_0x472b4f[_0x3f2f('0x12')],'id');for(var _0x54d53e=0x0,_0x6eacdb={},_0x581200={};_0x54d53e<_0xcef582['length'];_0x54d53e+=0x1){_0x6eacdb=_0xcef582[_0x54d53e];if(_[_0x3f2f('0x40')](_0x472b4f['triggers'][_0x6eacdb['id']])){_0x472b4f[_0x3f2f('0x12')][_0x6eacdb['id']]=new Trigger(_0x6eacdb);}else{_0x472b4f[_0x3f2f('0x3e')](_0x472b4f[_0x3f2f('0x12')][_0x6eacdb['id']],_0x6eacdb);}}}return _0x472b4f['triggers'];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x44')]=function(){var _0x53f273=this;return function(_0x54f805){if(_0x54f805){freeIsNotKey(_0x54f805,_0x53f273[_0x3f2f('0x14')],'id');for(var _0x3385da=0x0,_0x1bcefe={},_0x90d693={};_0x3385da<_0x54f805['length'];_0x3385da+=0x1){_0x1bcefe=_0x54f805[_0x3385da];if(_[_0x3f2f('0x40')](_0x53f273[_0x3f2f('0x14')][_0x1bcefe['id']])){_0x53f273[_0x3f2f('0x14')][_0x1bcefe['id']]=new Template(_0x1bcefe);}else{_0x53f273[_0x3f2f('0x3e')](_0x53f273[_0x3f2f('0x14')][_0x1bcefe['id']],_0x1bcefe);}}}return _0x53f273[_0x3f2f('0x14')];};};Realtime[_0x3f2f('0x3d')]['initZendeskAccounts']=function(){var _0x48b9e3=this;return function(_0x4266d4){if(_0x4266d4){freeIsNotKey(_0x4266d4,_0x48b9e3[_0x3f2f('0x45')],'id');for(var _0x2edd63=0x0,_0x6eddf9={},_0x3efe5a={};_0x2edd63<_0x4266d4[_0x3f2f('0x3f')];_0x2edd63+=0x1){_0x6eddf9=_0x4266d4[_0x2edd63];if(_[_0x3f2f('0x40')](_0x48b9e3[_0x3f2f('0x45')][_0x6eddf9['id']])){_0x48b9e3[_0x3f2f('0x45')][_0x6eddf9['id']]=new ZendeskAccount(_0x6eddf9);}else{_0x48b9e3[_0x3f2f('0x3e')](_0x48b9e3[_0x3f2f('0x45')][_0x6eddf9['id']],_0x6eddf9);}}}return _0x48b9e3[_0x3f2f('0x45')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x46')]=function(){var _0x581a11=this;return function(_0x314411){if(_0x314411){freeIsNotKey(_0x314411,_0x581a11[_0x3f2f('0x1b')],'id');for(var _0x35d7c1=0x0,_0x51e773={},_0x5ac431={};_0x35d7c1<_0x314411[_0x3f2f('0x3f')];_0x35d7c1+=0x1){_0x51e773=_0x314411[_0x35d7c1];if(_[_0x3f2f('0x40')](_0x581a11[_0x3f2f('0x1b')][_0x51e773['id']])){_0x581a11[_0x3f2f('0x1b')][_0x51e773['id']]=new SalesforceAccount(_0x51e773);}else{_0x581a11[_0x3f2f('0x3e')](_0x581a11['salesforceAccounts'][_0x51e773['id']],_0x51e773);}}}return _0x581a11[_0x3f2f('0x1b')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x47')]=function(){var _0x226745=this;return function(_0x364db0){if(_0x364db0){freeIsNotKey(_0x364db0,_0x226745[_0x3f2f('0x1d')],'id');for(var _0x5e1321=0x0,_0x3fb9aa={},_0x3f13b3={};_0x5e1321<_0x364db0[_0x3f2f('0x3f')];_0x5e1321+=0x1){_0x3fb9aa=_0x364db0[_0x5e1321];if(_[_0x3f2f('0x40')](_0x226745[_0x3f2f('0x1d')][_0x3fb9aa['id']])){_0x226745[_0x3f2f('0x1d')][_0x3fb9aa['id']]=new FreshdeskAccount(_0x3fb9aa);}else{_0x226745['mergeFromDatabase'](_0x226745[_0x3f2f('0x1d')][_0x3fb9aa['id']],_0x3fb9aa);}}}return _0x226745[_0x3f2f('0x1d')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x48')]=function(){var _0x28dfbf=this;return function(_0x109a48){if(_0x109a48){freeIsNotKey(_0x109a48,_0x28dfbf[_0x3f2f('0x1e')],'id');for(var _0x1af3dc=0x0,_0x57a125={},_0x3d0324={};_0x1af3dc<_0x109a48[_0x3f2f('0x3f')];_0x1af3dc+=0x1){_0x57a125=_0x109a48[_0x1af3dc];if(_[_0x3f2f('0x40')](_0x28dfbf['zohoAccounts'][_0x57a125['id']])){_0x28dfbf['zohoAccounts'][_0x57a125['id']]=new ZohoAccount(_0x57a125);}else{_0x28dfbf[_0x3f2f('0x3e')](_0x28dfbf['zohoAccounts'][_0x57a125['id']],_0x57a125);}}}return _0x28dfbf[_0x3f2f('0x1e')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x49')]=function(){var _0x3d83cb=this;return function(_0x4f5315){if(_0x4f5315){freeIsNotKey(_0x4f5315,_0x3d83cb[_0x3f2f('0x1f')],'id');for(var _0x3d5332=0x0,_0x5c7bf5={},_0x30afd4={};_0x3d5332<_0x4f5315[_0x3f2f('0x3f')];_0x3d5332+=0x1){_0x5c7bf5=_0x4f5315[_0x3d5332];if(_[_0x3f2f('0x40')](_0x3d83cb[_0x3f2f('0x1f')][_0x5c7bf5['id']])){_0x3d83cb[_0x3f2f('0x1f')][_0x5c7bf5['id']]=new DeskAccount(_0x5c7bf5);}else{_0x3d83cb[_0x3f2f('0x3e')](_0x3d83cb[_0x3f2f('0x1f')][_0x5c7bf5['id']],_0x5c7bf5);}}}return _0x3d83cb[_0x3f2f('0x1f')];};};Realtime['prototype'][_0x3f2f('0x4a')]=function(){var _0x30f90a=this;return function(_0x59cec1){if(_0x59cec1){freeIsNotKey(_0x59cec1,_0x30f90a[_0x3f2f('0x1c')],'id');for(var _0x57ad9e=0x0,_0x5122fa={},_0x239530={};_0x57ad9e<_0x59cec1[_0x3f2f('0x3f')];_0x57ad9e+=0x1){_0x5122fa=_0x59cec1[_0x57ad9e];if(_['isUndefined'](_0x30f90a[_0x3f2f('0x1c')][_0x5122fa['id']])){_0x30f90a[_0x3f2f('0x1c')][_0x5122fa['id']]=new SugarcrmAccount(_0x5122fa);}else{_0x30f90a[_0x3f2f('0x3e')](_0x30f90a[_0x3f2f('0x1c')][_0x5122fa['id']],_0x5122fa);}}}return _0x30f90a[_0x3f2f('0x1c')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x4b')]=function(){var _0x1722c0=this;return function(_0x3ef44c){if(_0x3ef44c){freeIsNotKey(_0x3ef44c,_0x1722c0[_0x3f2f('0x20')],'id');for(var _0x184e91=0x0,_0x5499fc={},_0x87851a={};_0x184e91<_0x3ef44c['length'];_0x184e91+=0x1){_0x5499fc=_0x3ef44c[_0x184e91];if(_[_0x3f2f('0x40')](_0x1722c0[_0x3f2f('0x20')][_0x5499fc['id']])){_0x1722c0[_0x3f2f('0x20')][_0x5499fc['id']]=new VtigerAccount(_0x5499fc);}else{_0x1722c0['mergeFromDatabase'](_0x1722c0[_0x3f2f('0x20')][_0x5499fc['id']],_0x5499fc);}}}return _0x1722c0[_0x3f2f('0x20')];};};Realtime[_0x3f2f('0x3d')]['initServicenowAccounts']=function(){var _0x42d47a=this;return function(_0x415a12){if(_0x415a12){freeIsNotKey(_0x415a12,_0x42d47a[_0x3f2f('0x21')],'id');for(var _0x30ff2c=0x0,_0x4553e5={},_0xe2ff1d={};_0x30ff2c<_0x415a12[_0x3f2f('0x3f')];_0x30ff2c+=0x1){_0x4553e5=_0x415a12[_0x30ff2c];if(_[_0x3f2f('0x40')](_0x42d47a[_0x3f2f('0x21')][_0x4553e5['id']])){_0x42d47a[_0x3f2f('0x21')][_0x4553e5['id']]=new ServicenowAccount(_0x4553e5);}else{_0x42d47a[_0x3f2f('0x3e')](_0x42d47a['servicenowAccounts'][_0x4553e5['id']],_0x4553e5);}}}return _0x42d47a[_0x3f2f('0x21')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x4c')]=function(){var _0x25b55d=this;return function(_0x40e3fe){if(_0x40e3fe){freeIsNotKey(_0x40e3fe,_0x25b55d[_0x3f2f('0x4d')],'id');for(var _0x3ecf6b=0x0,_0x536a5c={},_0x14b62a={};_0x3ecf6b<_0x40e3fe['length'];_0x3ecf6b+=0x1){_0x536a5c=_0x40e3fe[_0x3ecf6b];if(_[_0x3f2f('0x40')](_0x25b55d[_0x3f2f('0x4d')][_0x536a5c['id']])){_0x25b55d[_0x3f2f('0x4d')][_0x536a5c['id']]=new Dynamics365Account(_0x536a5c);}else{_0x25b55d[_0x3f2f('0x3e')](_0x25b55d[_0x3f2f('0x4d')][_0x536a5c['id']],_0x536a5c);}}}return _0x25b55d[_0x3f2f('0x4d')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x4e')]=function(){var _0x56a137=this;return function(_0x30a365){if(_0x30a365){freeIsNotKey(_0x30a365,_0x56a137['freshsalesAccounts'],'id');for(var _0x556c75=0x0,_0x434447={},_0x32aaa4={};_0x556c75<_0x30a365['length'];_0x556c75+=0x1){_0x434447=_0x30a365[_0x556c75];if(_['isUndefined'](_0x56a137[_0x3f2f('0x22')][_0x434447['id']])){_0x56a137[_0x3f2f('0x22')][_0x434447['id']]=new FreshsalesAccount(_0x434447);}else{_0x56a137['mergeFromDatabase'](_0x56a137[_0x3f2f('0x22')][_0x434447['id']],_0x434447);}}}return _0x56a137[_0x3f2f('0x22')];};};Realtime[_0x3f2f('0x3d')]['initVoiceQueueHopperHistory']=function(){var _0x194a57=this;return function(_0x5a7ef7){for(var _0x15e813=0x0;_0x15e813<_0x5a7ef7['length'];_0x15e813+=0x1){_[_0x3f2f('0x4f')](_0x194a57['voiceQueues'][_0x5a7ef7[_0x15e813][_0x3f2f('0x27')]],_0x5a7ef7[_0x15e813]);}return _0x194a57[_0x3f2f('0x11')];};};Realtime[_0x3f2f('0x3d')][_0x3f2f('0x50')]=function(){var _0x1f97b9=this;return function(_0x30aeaf){clearVoiceQueues(_0x1f97b9['voiceQueues']);if(_0x30aeaf){_0x30aeaf=_['groupBy'](_0x30aeaf,_0x3f2f('0x51'));for(var _0x420112 in _0x30aeaf){if(_0x30aeaf[_0x3f2f('0x25')](_0x420112)){var _0x54e671={};for(var _0xc0e308=0x0;_0xc0e308<_0x30aeaf[_0x420112]['length'];_0xc0e308+=0x1){var _0xfb7fb6=_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x52')];if(_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6]){if(_0x30aeaf[_0x420112][_0xc0e308]['queuecallerexit']){_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x30')]+=0x1;}if(_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x53')]){_0x1f97b9['voiceQueues'][_0xfb7fb6]['abandoned']+=0x1;}_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x2c')]+=moment(_0x30aeaf[_0x420112][_0xc0e308]['queuecallerleaveAt'])[_0x3f2f('0x54')](moment(_0x30aeaf[_0x420112][_0xc0e308]['queuecallerjoinAt']),_0x3f2f('0x55'))||0x0;if(_0xc0e308===_0x30aeaf[_0x420112][_0x3f2f('0x3f')]-0x1){_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x2d')]+=moment(_0x30aeaf[_0x420112][_0xc0e308]['queuecallercompleteAt']||_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x56')]||_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x57')])['diff'](moment(_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x58')]),_0x3f2f('0x55'))||0x0;_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6]['total']+=0x1;if(_0x30aeaf[_0x420112][_0xc0e308]['queuecallercomplete']){_0x1f97b9['voiceQueues'][_0xfb7fb6][_0x3f2f('0x2b')]+=0x1;_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x59')]+=moment(_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x5a')])[_0x3f2f('0x54')](moment(_0x30aeaf[_0x420112][_0xc0e308][_0x3f2f('0x5b')]),_0x3f2f('0x55'))||0x0;}}else{_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x2d')]+=_0x1f97b9[_0x3f2f('0x11')][_0xfb7fb6][_0x3f2f('0x2c')]||0x0;}}}}}}return _0x1f97b9[_0x3f2f('0x11')];};};Realtime[_0x3f2f('0x3d')]['initVoiceCallReports']=function(){var _0x2e32d2=this;return function(_0x36337d){clearVoiceCallReports(_0x2e32d2['outbound']);if(_0x36337d){for(var _0x20f182=0x0;_0x20f182<_0x36337d[_0x3f2f('0x3f')];_0x20f182+=0x1){_0x2e32d2['outbound'][_0x3f2f('0x5c')]+=0x1;_0x2e32d2[_0x3f2f('0x15')][_0x3f2f('0x2d')]+=_0x36337d[_0x20f182][_0x3f2f('0x5d')];if(_0x36337d[_0x20f182][_0x3f2f('0x5e')]===_0x3f2f('0x5f')){_0x2e32d2[_0x3f2f('0x15')][_0x3f2f('0x2b')]+=0x1;_0x2e32d2[_0x3f2f('0x15')][_0x3f2f('0x2c')]+=_0x36337d[_0x20f182][_0x3f2f('0x5d')]-_0x36337d[_0x20f182][_0x3f2f('0x60')]||0x0;_0x2e32d2[_0x3f2f('0x15')][_0x3f2f('0x59')]+=_0x36337d[_0x20f182][_0x3f2f('0x60')];}}}return _0x2e32d2[_0x3f2f('0x15')];};};Realtime[_0x3f2f('0x3d')]['initCampaigns']=function(){var _0x268e37=this;return function(_0x3159c0){if(_0x3159c0){freeIsNotKey(_0x3159c0,_0x268e37[_0x3f2f('0x13')],'name');for(var _0x308089=0x0,_0x4fe515={};_0x308089<_0x3159c0[_0x3f2f('0x3f')];_0x308089+=0x1){_0x4fe515=_0x3159c0[_0x308089];if(_['isUndefined'](_0x268e37['campaigns'][_0x4fe515[_0x3f2f('0x27')]])){_0x268e37[_0x3f2f('0x13')][_0x4fe515[_0x3f2f('0x27')]]=new Campaign(_0x4fe515);}else{_0x268e37[_0x3f2f('0x3e')](_0x268e37[_0x3f2f('0x13')][_0x4fe515['name']],_0x4fe515);_0x268e37[_0x3f2f('0x13')][_0x4fe515[_0x3f2f('0x27')]][_0x3f2f('0x61')]=_0x4fe515['SquareProject']?_0x4fe515[_0x3f2f('0x62')][_0x3f2f('0x27')]:undefined;}}}return _0x268e37['campaigns'];};};Realtime['prototype'][_0x3f2f('0x63')]=function(){var _0x32b821=this;return function(_0x48e913){if(_0x48e913){freeIsNotKey(_0x48e913,_0x32b821[_0x3f2f('0x16')],'id');for(var _0x4a6c84=0x0,_0x4c19df={};_0x4a6c84<_0x48e913['length'];_0x4a6c84+=0x1){_0x4c19df=_0x48e913[_0x4a6c84];if(_['isUndefined'](_0x32b821[_0x3f2f('0x16')][_0x4c19df['id']])){_0x32b821[_0x3f2f('0x16')][_0x4c19df['id']]=new VoiceExtension(_0x4c19df);}else{_0x32b821[_0x3f2f('0x3e')](_0x32b821[_0x3f2f('0x16')][_0x4c19df['id']],_0x4c19df);}}}return _0x32b821[_0x3f2f('0x16')];};};Realtime['prototype'][_0x3f2f('0x64')]=function(){var _0x476fdb=this;return function(_0xb4019c){clearCampaigns(_0x476fdb[_0x3f2f('0x13')]);for(var _0x106985=0x0;_0x106985<_0xb4019c[_0x3f2f('0x3f')];_0x106985+=0x1){_['merge'](_0x476fdb[_0x3f2f('0x13')][_0xb4019c[_0x106985]['name']],_0xb4019c[_0x106985]);}return _0x476fdb[_0x3f2f('0x13')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x196ba5=this;return function(_0x534e5f){if(_0x534e5f){freeIsNotKey(_0x534e5f,_0x196ba5['faxAccounts'],'id');for(var _0x52db84=0x0,_0x512d91={},_0x495a84={};_0x52db84<_0x534e5f[_0x3f2f('0x3f')];_0x52db84+=0x1){_0x512d91=_0x534e5f[_0x52db84];if(_[_0x3f2f('0x40')](_0x196ba5[_0x3f2f('0x23')][_0x512d91['id']])){_0x196ba5['faxAccounts'][_0x512d91['id']]=new FaxAccount(_0x512d91);}else{_0x196ba5['mergeFromDatabase'](_0x196ba5['faxAccounts'][_0x512d91['id']],_0x512d91);}}}return _0x196ba5['faxAccounts'];};};module[_0x3f2f('0x65')]=Realtime; \ No newline at end of file +var _0xf230=['isNil','isUndefined','mergeFromDatabase','length','initTrunks','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','initAgents'];(function(_0x18f386,_0x48a562){var _0x331244=function(_0xdd4824){while(--_0xdd4824){_0x18f386['push'](_0x18f386['shift']());}};_0x331244(++_0x48a562);}(_0xf230,0x99));var _0x0f23=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf230[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require('bluebird');var util=require(_0x0f23('0x0'));var _=require(_0x0f23('0x1'));var moment=require(_0x0f23('0x2'));var Agent=require(_0x0f23('0x3'));var Telephone=require(_0x0f23('0x4'));var Trunk=require(_0x0f23('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x0f23('0x6'));var Template=require(_0x0f23('0x7'));var Campaign=require(_0x0f23('0x8'));var VoiceExtension=require(_0x0f23('0x9'));var ZendeskAccount=require(_0x0f23('0xa'));var SalesforceAccount=require(_0x0f23('0xb'));var FreshdeskAccount=require(_0x0f23('0xc'));var SugarcrmAccount=require(_0x0f23('0xd'));var ZohoAccount=require(_0x0f23('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x0f23('0xf'));var Realtime=function(){this[_0x0f23('0x10')]={};this[_0x0f23('0x11')]={};this[_0x0f23('0x12')]={};this[_0x0f23('0x13')]={};this[_0x0f23('0x14')]={};this[_0x0f23('0x15')]={};this[_0x0f23('0x16')]={};this[_0x0f23('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x0f23('0x18')]={};this[_0x0f23('0x19')]={};this[_0x0f23('0x1a')]={};this[_0x0f23('0x1b')]={};this[_0x0f23('0x1c')]={};this[_0x0f23('0x1d')]={};this[_0x0f23('0x1e')]={};this[_0x0f23('0x1f')]={};this[_0x0f23('0x20')]={};this[_0x0f23('0x21')]={};this['deskAccounts']={};this[_0x0f23('0x22')]={};this['servicenowAccounts']={};this[_0x0f23('0x23')]={};this[_0x0f23('0x24')]={};this[_0x0f23('0x25')]={};};function freeIsNotKey(_0x5e794a,_0x3e0814,_0x7d3848){var _0x36514c=_[_0x0f23('0x26')](_0x5e794a,function(_0x5d02cf,_0x333c){return _0x5d02cf[_0x7d3848];});for(var _0x4dc65d in _0x3e0814){if(_0x3e0814[_0x0f23('0x27')](_0x4dc65d)){if(!_0x36514c[_0x4dc65d]){delete _0x3e0814[_0x4dc65d];}}}}function freeIsNotKeySip(_0x37c51e,_0x4a2cdd){var _0x77414f=_['mapKeys'](_0x37c51e,function(_0x564f7f,_0xe57f97){return util[_0x0f23('0x28')](_0x0f23('0x29'),_0x564f7f[_0x0f23('0x2a')]);});for(var _0x2ac957 in _0x4a2cdd){if(_0x4a2cdd[_0x0f23('0x27')](_0x2ac957)){if(!_0x77414f[_0x2ac957]){delete _0x4a2cdd[_0x2ac957];}}}}function freeIsNotKeyAgent(_0x1ed493,_0x296b1a){var _0x19287=_[_0x0f23('0x26')](_0x1ed493,function(_0x33341d,_0x27b87b){var _0x517c3f=_['isNil'](_0x33341d['interface'])?util['format'](_0x0f23('0x29'),_0x33341d[_0x0f23('0x2a')]):_0x33341d[_0x0f23('0x2b')];return _0x517c3f;});for(var _0x39bf0f in _0x296b1a){if(_0x296b1a[_0x0f23('0x27')](_0x39bf0f)){if(!_0x19287[_0x39bf0f]){delete _0x296b1a[_0x39bf0f];}}}}function clearVoiceCallReports(_0x44fefd){_0x44fefd['total']=0x0;_0x44fefd['answered']=0x0;_0x44fefd[_0x0f23('0x2c')]=0x0;_0x44fefd['sumDuration']=0x0;_0x44fefd[_0x0f23('0x2d')]=0x0;}function clearCampaigns(_0x556a47){if(!_[_0x0f23('0x2e')](_0x556a47)){for(var _0x5065e1 in _0x556a47){if(_0x556a47[_0x0f23('0x27')](_0x5065e1)){_0x556a47[_0x5065e1][_0x0f23('0x2f')]=0x0;_0x556a47[_0x5065e1][_0x0f23('0x30')]=0x0;}}}}function clearVoiceQueues(_0x38521e){if(!_[_0x0f23('0x2e')](_0x38521e)){for(var _0x3bddbe in _0x38521e){if(_0x38521e[_0x0f23('0x27')](_0x3bddbe)){_0x38521e[_0x3bddbe]['total']=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x31')]=0x0;_0x38521e[_0x3bddbe]['unmanaged']=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x32')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x2c')]=0x0;_0x38521e[_0x3bddbe]['sumDuration']=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x2d')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x33')]=0x0;_0x38521e[_0x3bddbe]['outboundNoAnswerCallsDay']=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x34')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x35')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x36')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x37')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x38')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x39')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x3a')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x3b')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x3c')]=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x3d')]=0x0;_0x38521e[_0x3bddbe]['outboundAnswerAgiCallsDay']=0x0;_0x38521e[_0x3bddbe]['outboundAnswerCallsDay']=0x0;_0x38521e[_0x3bddbe][_0x0f23('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x226dde,_0x16c7e9){for(var _0x499489 in _0x16c7e9){if(_0x226dde[_0x0f23('0x27')](_0x499489)){_0x226dde[_0x499489]=_0x16c7e9[_0x499489];}}};Realtime[_0x0f23('0x3f')][_0x0f23('0x40')]=function(){var _0x23108c=this;return function(_0x5accd4){if(_0x5accd4){freeIsNotKeyAgent(_0x5accd4,_0x23108c['agents']);for(var _0x54ea10=0x0,_0x3d5907={},_0x2bf6dd={};_0x54ea10<_0x5accd4['length'];_0x54ea10+=0x1){_0x3d5907=_0x5accd4[_0x54ea10];var _0x28b5fa=_[_0x0f23('0x41')](_0x3d5907[_0x0f23('0x2b')])?util['format'](_0x0f23('0x29'),_0x3d5907['name']):_0x3d5907[_0x0f23('0x2b')];if(_[_0x0f23('0x42')](_0x23108c[_0x0f23('0x10')][_0x28b5fa])){_0x23108c['agents'][_0x28b5fa]=new Agent(_0x3d5907);}else{_0x23108c[_0x0f23('0x43')](_0x23108c[_0x0f23('0x10')][_0x28b5fa],_0x3d5907);}}}return _0x23108c[_0x0f23('0x10')];};};Realtime[_0x0f23('0x3f')]['initTelephones']=function(){var _0xc952ba=this;return function(_0x235be9){if(_0x235be9){freeIsNotKeySip(_0x235be9,_0xc952ba['telephones']);for(var _0x4cd6e4=0x0,_0x35d5ea={},_0x3ecd48={};_0x4cd6e4<_0x235be9[_0x0f23('0x44')];_0x4cd6e4+=0x1){_0x35d5ea=_0x235be9[_0x4cd6e4];if(_[_0x0f23('0x42')](_0xc952ba[_0x0f23('0x11')][util[_0x0f23('0x28')](_0x0f23('0x29'),_0x35d5ea[_0x0f23('0x2a')])])){_0xc952ba[_0x0f23('0x11')][util[_0x0f23('0x28')]('SIP/%s',_0x35d5ea['name'])]=new Telephone(_0x35d5ea);}else{_0xc952ba[_0x0f23('0x43')](_0xc952ba['telephones'][util[_0x0f23('0x28')](_0x0f23('0x29'),_0x35d5ea['name'])],_0x35d5ea);}}}return _0xc952ba[_0x0f23('0x11')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x45')]=function(){var _0x22ed9c=this;return function(_0x530a51){if(_0x530a51){freeIsNotKeySip(_0x530a51,_0x22ed9c[_0x0f23('0x12')]);for(var _0x224103=0x0,_0x4a91c7={},_0x36ecdf={};_0x224103<_0x530a51['length'];_0x224103+=0x1){_0x4a91c7=_0x530a51[_0x224103];if(_[_0x0f23('0x42')](_0x22ed9c[_0x0f23('0x12')][util[_0x0f23('0x28')](_0x0f23('0x29'),_0x4a91c7[_0x0f23('0x2a')])])){_0x22ed9c[_0x0f23('0x12')][util['format']('SIP/%s',_0x4a91c7['name'])]=new Trunk(_0x4a91c7);}else{_0x22ed9c['mergeFromDatabase'](_0x22ed9c[_0x0f23('0x12')][util['format'](_0x0f23('0x29'),_0x4a91c7[_0x0f23('0x2a')])],_0x4a91c7);}}}return _0x22ed9c[_0x0f23('0x12')];};};Realtime[_0x0f23('0x3f')]['initVoiceQueues']=function(){var _0x399bb1=this;return function(_0x36f1ce){if(_0x36f1ce){freeIsNotKey(_0x36f1ce,_0x399bb1[_0x0f23('0x13')],_0x0f23('0x2a'));for(var _0x32c893=0x0,_0x34f356={},_0x15e185={};_0x32c893<_0x36f1ce['length'];_0x32c893+=0x1){_0x34f356=_0x36f1ce[_0x32c893];if(_[_0x0f23('0x42')](_0x399bb1[_0x0f23('0x13')][_0x34f356[_0x0f23('0x2a')]])){_0x399bb1[_0x0f23('0x13')][_0x34f356['name']]=new VoiceQueue(_0x34f356);}else{_0x399bb1['mergeFromDatabase'](_0x399bb1[_0x0f23('0x13')][_0x34f356[_0x0f23('0x2a')]],_0x34f356);}}}return _0x399bb1[_0x0f23('0x13')];};};Realtime[_0x0f23('0x3f')]['initTriggers']=function(){var _0x416cc9=this;return function(_0xb44831){if(_0xb44831){freeIsNotKey(_0xb44831,_0x416cc9[_0x0f23('0x14')],'id');for(var _0x163171=0x0,_0x304610={},_0x3f3b92={};_0x163171<_0xb44831[_0x0f23('0x44')];_0x163171+=0x1){_0x304610=_0xb44831[_0x163171];if(_['isUndefined'](_0x416cc9[_0x0f23('0x14')][_0x304610['id']])){_0x416cc9['triggers'][_0x304610['id']]=new Trigger(_0x304610);}else{_0x416cc9[_0x0f23('0x43')](_0x416cc9['triggers'][_0x304610['id']],_0x304610);}}}return _0x416cc9['triggers'];};};Realtime['prototype']['initTemplates']=function(){var _0x3cee48=this;return function(_0x5004b2){if(_0x5004b2){freeIsNotKey(_0x5004b2,_0x3cee48[_0x0f23('0x16')],'id');for(var _0x4c4709=0x0,_0x479ff8={},_0x127a5f={};_0x4c4709<_0x5004b2[_0x0f23('0x44')];_0x4c4709+=0x1){_0x479ff8=_0x5004b2[_0x4c4709];if(_['isUndefined'](_0x3cee48[_0x0f23('0x16')][_0x479ff8['id']])){_0x3cee48[_0x0f23('0x16')][_0x479ff8['id']]=new Template(_0x479ff8);}else{_0x3cee48[_0x0f23('0x43')](_0x3cee48[_0x0f23('0x16')][_0x479ff8['id']],_0x479ff8);}}}return _0x3cee48[_0x0f23('0x16')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x46')]=function(){var _0xc1a2a3=this;return function(_0x208c44){if(_0x208c44){freeIsNotKey(_0x208c44,_0xc1a2a3[_0x0f23('0x1d')],'id');for(var _0x1f19c0=0x0,_0x1cb09a={},_0x3daf71={};_0x1f19c0<_0x208c44[_0x0f23('0x44')];_0x1f19c0+=0x1){_0x1cb09a=_0x208c44[_0x1f19c0];if(_[_0x0f23('0x42')](_0xc1a2a3[_0x0f23('0x1d')][_0x1cb09a['id']])){_0xc1a2a3[_0x0f23('0x1d')][_0x1cb09a['id']]=new ZendeskAccount(_0x1cb09a);}else{_0xc1a2a3[_0x0f23('0x43')](_0xc1a2a3[_0x0f23('0x1d')][_0x1cb09a['id']],_0x1cb09a);}}}return _0xc1a2a3[_0x0f23('0x1d')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x47')]=function(){var _0xc6e22b=this;return function(_0x9415e5){if(_0x9415e5){freeIsNotKey(_0x9415e5,_0xc6e22b['salesforceAccounts'],'id');for(var _0x5db39b=0x0,_0x3f743e={},_0x246318={};_0x5db39b<_0x9415e5[_0x0f23('0x44')];_0x5db39b+=0x1){_0x3f743e=_0x9415e5[_0x5db39b];if(_[_0x0f23('0x42')](_0xc6e22b['salesforceAccounts'][_0x3f743e['id']])){_0xc6e22b[_0x0f23('0x1e')][_0x3f743e['id']]=new SalesforceAccount(_0x3f743e);}else{_0xc6e22b[_0x0f23('0x43')](_0xc6e22b[_0x0f23('0x1e')][_0x3f743e['id']],_0x3f743e);}}}return _0xc6e22b['salesforceAccounts'];};};Realtime['prototype'][_0x0f23('0x48')]=function(){var _0x2d8878=this;return function(_0x1f9cf8){if(_0x1f9cf8){freeIsNotKey(_0x1f9cf8,_0x2d8878[_0x0f23('0x20')],'id');for(var _0x2891dc=0x0,_0x26ff9c={},_0x45b958={};_0x2891dc<_0x1f9cf8[_0x0f23('0x44')];_0x2891dc+=0x1){_0x26ff9c=_0x1f9cf8[_0x2891dc];if(_[_0x0f23('0x42')](_0x2d8878['freshdeskAccounts'][_0x26ff9c['id']])){_0x2d8878[_0x0f23('0x20')][_0x26ff9c['id']]=new FreshdeskAccount(_0x26ff9c);}else{_0x2d8878[_0x0f23('0x43')](_0x2d8878[_0x0f23('0x20')][_0x26ff9c['id']],_0x26ff9c);}}}return _0x2d8878[_0x0f23('0x20')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x49')]=function(){var _0x4aa7d7=this;return function(_0x1fad14){if(_0x1fad14){freeIsNotKey(_0x1fad14,_0x4aa7d7[_0x0f23('0x21')],'id');for(var _0x45dc8c=0x0,_0x53af75={},_0xf937bb={};_0x45dc8c<_0x1fad14[_0x0f23('0x44')];_0x45dc8c+=0x1){_0x53af75=_0x1fad14[_0x45dc8c];if(_[_0x0f23('0x42')](_0x4aa7d7[_0x0f23('0x21')][_0x53af75['id']])){_0x4aa7d7[_0x0f23('0x21')][_0x53af75['id']]=new ZohoAccount(_0x53af75);}else{_0x4aa7d7[_0x0f23('0x43')](_0x4aa7d7[_0x0f23('0x21')][_0x53af75['id']],_0x53af75);}}}return _0x4aa7d7[_0x0f23('0x21')];};};Realtime['prototype'][_0x0f23('0x4a')]=function(){var _0x2a5cdb=this;return function(_0x3fe776){if(_0x3fe776){freeIsNotKey(_0x3fe776,_0x2a5cdb['deskAccounts'],'id');for(var _0x4a3707=0x0,_0x20b79b={},_0x2d4070={};_0x4a3707<_0x3fe776[_0x0f23('0x44')];_0x4a3707+=0x1){_0x20b79b=_0x3fe776[_0x4a3707];if(_[_0x0f23('0x42')](_0x2a5cdb[_0x0f23('0x4b')][_0x20b79b['id']])){_0x2a5cdb['deskAccounts'][_0x20b79b['id']]=new DeskAccount(_0x20b79b);}else{_0x2a5cdb['mergeFromDatabase'](_0x2a5cdb[_0x0f23('0x4b')][_0x20b79b['id']],_0x20b79b);}}}return _0x2a5cdb[_0x0f23('0x4b')];};};Realtime[_0x0f23('0x3f')]['initSugarcrmAccounts']=function(){var _0x91ad70=this;return function(_0x41d8ac){if(_0x41d8ac){freeIsNotKey(_0x41d8ac,_0x91ad70[_0x0f23('0x1f')],'id');for(var _0x441263=0x0,_0x50ccd2={},_0x39e081={};_0x441263<_0x41d8ac[_0x0f23('0x44')];_0x441263+=0x1){_0x50ccd2=_0x41d8ac[_0x441263];if(_[_0x0f23('0x42')](_0x91ad70[_0x0f23('0x1f')][_0x50ccd2['id']])){_0x91ad70[_0x0f23('0x1f')][_0x50ccd2['id']]=new SugarcrmAccount(_0x50ccd2);}else{_0x91ad70['mergeFromDatabase'](_0x91ad70[_0x0f23('0x1f')][_0x50ccd2['id']],_0x50ccd2);}}}return _0x91ad70[_0x0f23('0x1f')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x4c')]=function(){var _0x236951=this;return function(_0x4eb08f){if(_0x4eb08f){freeIsNotKey(_0x4eb08f,_0x236951[_0x0f23('0x22')],'id');for(var _0x30be19=0x0,_0x361ef0={},_0x2b140c={};_0x30be19<_0x4eb08f[_0x0f23('0x44')];_0x30be19+=0x1){_0x361ef0=_0x4eb08f[_0x30be19];if(_[_0x0f23('0x42')](_0x236951[_0x0f23('0x22')][_0x361ef0['id']])){_0x236951['vtigerAccounts'][_0x361ef0['id']]=new VtigerAccount(_0x361ef0);}else{_0x236951['mergeFromDatabase'](_0x236951['vtigerAccounts'][_0x361ef0['id']],_0x361ef0);}}}return _0x236951[_0x0f23('0x22')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x4d')]=function(){var _0x5b038f=this;return function(_0x43cbe1){if(_0x43cbe1){freeIsNotKey(_0x43cbe1,_0x5b038f[_0x0f23('0x4e')],'id');for(var _0x4f628e=0x0,_0x123cf8={},_0x4518ba={};_0x4f628e<_0x43cbe1[_0x0f23('0x44')];_0x4f628e+=0x1){_0x123cf8=_0x43cbe1[_0x4f628e];if(_['isUndefined'](_0x5b038f['servicenowAccounts'][_0x123cf8['id']])){_0x5b038f[_0x0f23('0x4e')][_0x123cf8['id']]=new ServicenowAccount(_0x123cf8);}else{_0x5b038f[_0x0f23('0x43')](_0x5b038f[_0x0f23('0x4e')][_0x123cf8['id']],_0x123cf8);}}}return _0x5b038f[_0x0f23('0x4e')];};};Realtime[_0x0f23('0x3f')]['initDynamics365Accounts']=function(){var _0x5d7afd=this;return function(_0x4b13ba){if(_0x4b13ba){freeIsNotKey(_0x4b13ba,_0x5d7afd[_0x0f23('0x23')],'id');for(var _0x3b38aa=0x0,_0x36f085={},_0x198b1a={};_0x3b38aa<_0x4b13ba[_0x0f23('0x44')];_0x3b38aa+=0x1){_0x36f085=_0x4b13ba[_0x3b38aa];if(_[_0x0f23('0x42')](_0x5d7afd[_0x0f23('0x23')][_0x36f085['id']])){_0x5d7afd[_0x0f23('0x23')][_0x36f085['id']]=new Dynamics365Account(_0x36f085);}else{_0x5d7afd[_0x0f23('0x43')](_0x5d7afd['dynamics365Accounts'][_0x36f085['id']],_0x36f085);}}}return _0x5d7afd[_0x0f23('0x23')];};};Realtime[_0x0f23('0x3f')]['initFreshsalesAccounts']=function(){var _0x5ec7f1=this;return function(_0x290453){if(_0x290453){freeIsNotKey(_0x290453,_0x5ec7f1[_0x0f23('0x24')],'id');for(var _0x3c8b5b=0x0,_0x5d8dd0={},_0x34a52b={};_0x3c8b5b<_0x290453[_0x0f23('0x44')];_0x3c8b5b+=0x1){_0x5d8dd0=_0x290453[_0x3c8b5b];if(_['isUndefined'](_0x5ec7f1[_0x0f23('0x24')][_0x5d8dd0['id']])){_0x5ec7f1['freshsalesAccounts'][_0x5d8dd0['id']]=new FreshsalesAccount(_0x5d8dd0);}else{_0x5ec7f1[_0x0f23('0x43')](_0x5ec7f1[_0x0f23('0x24')][_0x5d8dd0['id']],_0x5d8dd0);}}}return _0x5ec7f1['freshsalesAccounts'];};};Realtime['prototype'][_0x0f23('0x4f')]=function(){var _0x16f44d=this;return function(_0x1e77d7){for(var _0x26f776=0x0;_0x26f776<_0x1e77d7[_0x0f23('0x44')];_0x26f776+=0x1){_[_0x0f23('0x50')](_0x16f44d['voiceQueues'][_0x1e77d7[_0x26f776][_0x0f23('0x2a')]],_0x1e77d7[_0x26f776]);}return _0x16f44d[_0x0f23('0x13')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x51')]=function(){var _0x1c224c=this;return function(_0x5068d1){clearVoiceQueues(_0x1c224c['voiceQueues']);if(_0x5068d1){_0x5068d1=_[_0x0f23('0x52')](_0x5068d1,_0x0f23('0x53'));for(var _0x403b3f in _0x5068d1){if(_0x5068d1[_0x0f23('0x27')](_0x403b3f)){var _0x4128d3={};for(var _0x114dd7=0x0;_0x114dd7<_0x5068d1[_0x403b3f]['length'];_0x114dd7+=0x1){var _0x257726=_0x5068d1[_0x403b3f][_0x114dd7]['queue'];if(_0x1c224c[_0x0f23('0x13')][_0x257726]){if(_0x5068d1[_0x403b3f][_0x114dd7]['queuecallerexit']){_0x1c224c['voiceQueues'][_0x257726][_0x0f23('0x54')]+=0x1;}if(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x55')]){_0x1c224c[_0x0f23('0x13')][_0x257726]['abandoned']+=0x1;}_0x1c224c['voiceQueues'][_0x257726][_0x0f23('0x2c')]+=moment(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x56')])[_0x0f23('0x57')](moment(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x58')]),_0x0f23('0x59'))||0x0;if(_0x114dd7===_0x5068d1[_0x403b3f][_0x0f23('0x44')]-0x1){_0x1c224c['voiceQueues'][_0x257726][_0x0f23('0x5a')]+=moment(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x5b')]||_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x5c')]||_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x5d')])[_0x0f23('0x57')](moment(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x58')]),_0x0f23('0x59'))||0x0;_0x1c224c['voiceQueues'][_0x257726][_0x0f23('0x5e')]+=0x1;if(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x5f')]){_0x1c224c[_0x0f23('0x13')][_0x257726][_0x0f23('0x31')]+=0x1;_0x1c224c[_0x0f23('0x13')][_0x257726][_0x0f23('0x2d')]+=moment(_0x5068d1[_0x403b3f][_0x114dd7][_0x0f23('0x5b')])['diff'](moment(_0x5068d1[_0x403b3f][_0x114dd7]['queuecallerleaveAt']),_0x0f23('0x59'))||0x0;}}else{_0x1c224c[_0x0f23('0x13')][_0x257726][_0x0f23('0x5a')]+=_0x1c224c[_0x0f23('0x13')][_0x257726][_0x0f23('0x2c')]||0x0;}}}}}}return _0x1c224c[_0x0f23('0x13')];};};Realtime['prototype'][_0x0f23('0x60')]=function(){var _0x9fe78e=this;return function(_0x15f7c1){clearVoiceCallReports(_0x9fe78e[_0x0f23('0x17')]);if(_0x15f7c1){for(var _0x3d9209=0x0;_0x3d9209<_0x15f7c1[_0x0f23('0x44')];_0x3d9209+=0x1){_0x9fe78e[_0x0f23('0x17')][_0x0f23('0x5e')]+=0x1;_0x9fe78e['outbound'][_0x0f23('0x5a')]+=_0x15f7c1[_0x3d9209]['duration'];if(_0x15f7c1[_0x3d9209][_0x0f23('0x61')]===_0x0f23('0x62')){_0x9fe78e['outbound'][_0x0f23('0x31')]+=0x1;_0x9fe78e[_0x0f23('0x17')][_0x0f23('0x2c')]+=_0x15f7c1[_0x3d9209][_0x0f23('0x63')]-_0x15f7c1[_0x3d9209][_0x0f23('0x64')]||0x0;_0x9fe78e[_0x0f23('0x17')][_0x0f23('0x2d')]+=_0x15f7c1[_0x3d9209]['billableseconds'];}}}return _0x9fe78e[_0x0f23('0x17')];};};Realtime['prototype'][_0x0f23('0x65')]=function(){var _0x3f69d3=this;return function(_0x359319){if(_0x359319){freeIsNotKey(_0x359319,_0x3f69d3['campaigns'],_0x0f23('0x2a'));for(var _0x12370e=0x0,_0x41d1f2={};_0x12370e<_0x359319[_0x0f23('0x44')];_0x12370e+=0x1){_0x41d1f2=_0x359319[_0x12370e];if(_['isUndefined'](_0x3f69d3['campaigns'][_0x41d1f2[_0x0f23('0x2a')]])){_0x3f69d3[_0x0f23('0x15')][_0x41d1f2[_0x0f23('0x2a')]]=new Campaign(_0x41d1f2);}else{_0x3f69d3[_0x0f23('0x43')](_0x3f69d3[_0x0f23('0x15')][_0x41d1f2['name']],_0x41d1f2);_0x3f69d3['campaigns'][_0x41d1f2['name']][_0x0f23('0x66')]=_0x41d1f2[_0x0f23('0x67')]?_0x41d1f2[_0x0f23('0x67')]['name']:undefined;}}}return _0x3f69d3['campaigns'];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x68')]=function(){var _0x2cee71=this;return function(_0x4d68ec){if(_0x4d68ec){freeIsNotKey(_0x4d68ec,_0x2cee71['voiceExtensions'],'id');for(var _0x56fdec=0x0,_0x17766e={};_0x56fdec<_0x4d68ec[_0x0f23('0x44')];_0x56fdec+=0x1){_0x17766e=_0x4d68ec[_0x56fdec];if(_[_0x0f23('0x42')](_0x2cee71[_0x0f23('0x69')][_0x17766e['id']])){_0x2cee71[_0x0f23('0x69')][_0x17766e['id']]=new VoiceExtension(_0x17766e);}else{_0x2cee71['mergeFromDatabase'](_0x2cee71[_0x0f23('0x69')][_0x17766e['id']],_0x17766e);}}}return _0x2cee71[_0x0f23('0x69')];};};Realtime['prototype'][_0x0f23('0x6a')]=function(){var _0x8f43a9=this;return function(_0xac5e67){clearCampaigns(_0x8f43a9[_0x0f23('0x15')]);for(var _0x5d75c7=0x0;_0x5d75c7<_0xac5e67[_0x0f23('0x44')];_0x5d75c7+=0x1){_['merge'](_0x8f43a9[_0x0f23('0x15')][_0xac5e67[_0x5d75c7][_0x0f23('0x2a')]],_0xac5e67[_0x5d75c7]);}return _0x8f43a9[_0x0f23('0x15')];};};Realtime[_0x0f23('0x3f')][_0x0f23('0x6b')]=function(){var _0x4e5d9a=this;return function(_0x201184){if(_0x201184){freeIsNotKey(_0x201184,_0x4e5d9a[_0x0f23('0x25')],'id');for(var _0x250a89=0x0,_0x25cfa6={},_0x8c7281={};_0x250a89<_0x201184[_0x0f23('0x44')];_0x250a89+=0x1){_0x25cfa6=_0x201184[_0x250a89];if(_[_0x0f23('0x42')](_0x4e5d9a['faxAccounts'][_0x25cfa6['id']])){_0x4e5d9a['faxAccounts'][_0x25cfa6['id']]=new FaxAccount(_0x25cfa6);}else{_0x4e5d9a[_0x0f23('0x43')](_0x4e5d9a[_0x0f23('0x25')][_0x25cfa6['id']],_0x25cfa6);}}}return _0x4e5d9a[_0x0f23('0x25')];};};module[_0x0f23('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1a6aeb0..1b4e271 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 _0x066a=['../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','realtime','agents','telephones','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','destination','dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','type','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment'];(function(_0xd323ba,_0x57eb39){var _0xfd9658=function(_0xe0fe40){while(--_0xe0fe40){_0xd323ba['push'](_0xd323ba['shift']());}};_0xfd9658(++_0x57eb39);}(_0x066a,0x180));var _0xa066=function(_0x4ef082,_0x535482){_0x4ef082=_0x4ef082-0x0;var _0x46ff22=_0x066a[_0x4ef082];return _0x46ff22;};'use strict';var _=require(_0xa066('0x0'));var moment=require(_0xa066('0x1'));var util=require(_0xa066('0x2'));var config=require(_0xa066('0x3'));var ami=require(_0xa066('0x4'));var RpcVoiceAgentReport=require(_0xa066('0x5'));var RpcVoiceCallReport=require(_0xa066('0x6'));var RpcVoiceDialReport=require(_0xa066('0x7'));var RpcMemberReport=require(_0xa066('0x8'));var RpcVoiceQueueReport=require(_0xa066('0x9'));var RpcVoiceRecording=require(_0xa066('0xa'));var RpcVoiceTransferReport=require(_0xa066('0xb'));var VoiceQueueReport=require(_0xa066('0xc'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xa066('0xd'));var UserReport=require(_0xa066('0xe'));function Report(_0x2addc3){this[_0xa066('0xf')]=_0x2addc3;this['agents']=_0x2addc3[_0xa066('0x10')];this[_0xa066('0x11')]=_0x2addc3[_0xa066('0x11')];}Report['prototype']['sync']=function(_0x575eeb){var _0x2d0ec1=new VoiceQueueReport(this[_0xa066('0xf')]);var _0xfbbee0=new VoiceAgentReport(this['realtime']);var _0x553366=new VoiceDialReport(this[_0xa066('0xf')]);var _0x39ca0e=new VoiceCallReport(this[_0xa066('0xf')]);var _0x55eee9=new UserReport(this[_0xa066('0xf')]);if(config[_0xa066('0x12')]&&config[_0xa066('0x12')][_0xa066('0x13')]){ami['on'](_0xa066('0x14'),this[_0xa066('0x15')][_0xa066('0x16')](this));ami['on']('custom:voiceCallReport',this[_0xa066('0x17')][_0xa066('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xa066('0x18')]['bind'](this));ami['on'](_0xa066('0x19'),this[_0xa066('0x1a')]['bind'](this));ami['on'](_0xa066('0x1b'),this[_0xa066('0x1c')]['bind'](this));ami['on'](_0xa066('0x1d'),this['attendedTransfer'][_0xa066('0x16')](this));}};Report[_0xa066('0x1e')][_0xa066('0x1f')]=function(_0x2b7fe5){var _0x4fe1e6;_0x4fe1e6=_[_0xa066('0x20')](this[_0xa066('0x10')],function(_0xb45387){return _0xb45387[_0xa066('0x21')]==_0x2b7fe5||_0xb45387[_0xa066('0x22')]==_0x2b7fe5;});if(_[_0xa066('0x23')](_0x4fe1e6)){var _0x9d49a2=_[_0xa066('0x20')](this['telephones'],function(_0x39bbde){return _0x39bbde['accountcode']==_0x2b7fe5||_0x39bbde[_0xa066('0x22')]==_0x2b7fe5;});if(_0x9d49a2){_0x4fe1e6=_[_0xa066('0x20')](this[_0xa066('0x10')],function(_0x5be78a){return _0x5be78a[_0xa066('0x24')]==util[_0xa066('0x25')]('SIP/%s',_0x9d49a2[_0xa066('0x22')]);});}}return _0x4fe1e6;};Report['prototype'][_0xa066('0x15')]=function(_0x4abad9){for(var _0x115487=0x0;_0x115487<_0x4abad9[_0xa066('0x26')];_0x115487+=0x1){var _0x561199=this[_0xa066('0x1f')](_0x4abad9[_0x115487][_0xa066('0x27')]);if(_0x561199){_0x4abad9[_0x115487]['accountcode']=_0x561199[_0xa066('0x21')];_0x4abad9[_0x115487][_0xa066('0x28')]=!![];_0x4abad9[_0x115487][_0xa066('0x29')]=_0x561199[_0xa066('0x22')];_0x4abad9[_0x115487][_0xa066('0x24')]=_[_0xa066('0x23')](_0x561199[_0xa066('0x24')])?util['format'](_0xa066('0x2a'),_0x561199[_0xa066('0x22')]):_0x561199[_0xa066('0x24')];if(_0x4abad9[_0x115487]['queuecallercomplete']){_0x4abad9[_0x115487]['queuecallercompleteAt']=moment()[_0xa066('0x25')](_0xa066('0x2b'));}if(_0x4abad9[_0x115487][_0xa066('0x2c')]){_0x4abad9[_0x115487][_0xa066('0x2d')]=moment()['format'](_0xa066('0x2b'));}RpcMemberReport[_0xa066('0x15')](_0x4abad9[_0x115487]);}RpcVoiceQueueReport[_0xa066('0x2e')](_0x4abad9[_0x115487]);}};function extractCalleridNumber(_0x41869c){var _0x5d9f40=_0x41869c[_0xa066('0x2f')](/<(.*?)>/);return _0x5d9f40?_0x5d9f40[0x1]:_0x41869c;}Report[_0xa066('0x1e')][_0xa066('0x30')]=function(_0x1bfa1d){for(var _0x1f11b3=0x0;_0x1f11b3','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','UserId','membername','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','phone','voiceDialReport','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','name','isNil','interface','format','SIP/%s','voiceQueueReport','findAgent','connectedlinenum'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7794,0x14b));var _0x4779=function(_0x8f0320,_0x4f283a){_0x8f0320=_0x8f0320-0x0;var _0x245956=_0x7794[_0x8f0320];return _0x245956;};'use strict';var _=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var util=require(_0x4779('0x2'));var config=require(_0x4779('0x3'));var ami=require(_0x4779('0x4'));var RpcVoiceAgentReport=require(_0x4779('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x4779('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x4779('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x4779('0x8'));var VoiceQueueReport=require(_0x4779('0x9'));var VoiceCallReport=require(_0x4779('0xa'));var VoiceAgentReport=require(_0x4779('0xb'));var VoiceDialReport=require(_0x4779('0xc'));var UserReport=require(_0x4779('0xd'));function Report(_0x4cd41d){this[_0x4779('0xe')]=_0x4cd41d;this[_0x4779('0xf')]=_0x4cd41d['agents'];this['telephones']=_0x4cd41d[_0x4779('0x10')];}Report['prototype'][_0x4779('0x11')]=function(_0x135089){var _0x34cf5e=new VoiceQueueReport(this[_0x4779('0xe')]);var _0x4da0da=new VoiceAgentReport(this[_0x4779('0xe')]);var _0x1cd65=new VoiceDialReport(this[_0x4779('0xe')]);var _0x38840d=new VoiceCallReport(this[_0x4779('0xe')]);var _0x571468=new UserReport(this[_0x4779('0xe')]);if(config[_0x4779('0x12')]&&config[_0x4779('0x12')]['disabled']){ami['on'](_0x4779('0x13'),this['voiceQueueReport'][_0x4779('0x14')](this));ami['on'](_0x4779('0x15'),this['voiceCallReport'][_0x4779('0x14')](this));ami['on'](_0x4779('0x16'),this[_0x4779('0x17')][_0x4779('0x14')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x4779('0x14')](this));ami['on']('blindtransfer',this[_0x4779('0x18')][_0x4779('0x14')](this));ami['on'](_0x4779('0x19'),this[_0x4779('0x1a')]['bind'](this));}};Report[_0x4779('0x1b')]['findAgent']=function(_0x28b537){var _0x3948f9;_0x3948f9=_[_0x4779('0x1c')](this[_0x4779('0xf')],function(_0x29a325){return _0x29a325['accountcode']==_0x28b537||_0x29a325[_0x4779('0x1d')]==_0x28b537;});if(_[_0x4779('0x1e')](_0x3948f9)){var _0x5b4f33=_[_0x4779('0x1c')](this[_0x4779('0x10')],function(_0x32afdb){return _0x32afdb['accountcode']==_0x28b537||_0x32afdb[_0x4779('0x1d')]==_0x28b537;});if(_0x5b4f33){_0x3948f9=_[_0x4779('0x1c')](this['agents'],function(_0xfbfff2){return _0xfbfff2[_0x4779('0x1f')]==util[_0x4779('0x20')](_0x4779('0x21'),_0x5b4f33[_0x4779('0x1d')]);});}}return _0x3948f9;};Report[_0x4779('0x1b')][_0x4779('0x22')]=function(_0x50ad3b){for(var _0x26825d=0x0;_0x26825d<_0x50ad3b['length'];_0x26825d+=0x1){var _0x1707ae=this[_0x4779('0x23')](_0x50ad3b[_0x26825d][_0x4779('0x24')]);if(_0x1707ae){_0x50ad3b[_0x26825d]['accountcode']=_0x1707ae[_0x4779('0x25')];_0x50ad3b[_0x26825d][_0x4779('0x26')]=!![];_0x50ad3b[_0x26825d][_0x4779('0x27')]=_0x1707ae[_0x4779('0x1d')];_0x50ad3b[_0x26825d][_0x4779('0x1f')]=_[_0x4779('0x1e')](_0x1707ae[_0x4779('0x1f')])?util[_0x4779('0x20')](_0x4779('0x21'),_0x1707ae[_0x4779('0x1d')]):_0x1707ae[_0x4779('0x1f')];if(_0x50ad3b[_0x26825d][_0x4779('0x28')]){_0x50ad3b[_0x26825d]['queuecallercompleteAt']=moment()['format'](_0x4779('0x29'));}if(_0x50ad3b[_0x26825d][_0x4779('0x2a')]){_0x50ad3b[_0x26825d]['queuecallerexitAt']=moment()[_0x4779('0x20')](_0x4779('0x29'));}RpcMemberReport['voiceQueueReport'](_0x50ad3b[_0x26825d]);}RpcVoiceQueueReport[_0x4779('0x2b')](_0x50ad3b[_0x26825d]);}};function extractCalleridNumber(_0x38ab10){var _0x1e0b6e=_0x38ab10[_0x4779('0x2c')](/<(.*?)>/);return _0x1e0b6e?_0x1e0b6e[0x1]:_0x38ab10;}Report[_0x4779('0x1b')][_0x4779('0x2d')]=function(_0x172fa7){for(var _0x558cac=0x0;_0x558cac0x0?_0x52b0e4:0x0;this['voiceQueues'][_0x462b7c[_0x659b('0x6b')]][_0x659b('0x34')]=this[_0x659b('0x13')][_0x462b7c[_0x659b('0x6b')]][_0x659b('0x34')]>_['toNumber'](_0x462b7c[_0x659b('0x71')])?_[_0x659b('0x70')](_0x462b7c['loggedin']):this[_0x659b('0x13')][_0x462b7c[_0x659b('0x6b')]][_0x659b('0x34')];this['emitVoiceQueueSummary'](this[_0x659b('0x13')][_0x462b7c[_0x659b('0x6b')]],'queuesummary');}logger[_0x659b('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0x659b('0x13')][_0x462b7c['queue']],{'showHidden':![],'depth':null}));ami[_0x659b('0x49')](_0x659b('0x72'),this['voiceQueues'][_0x462b7c['queue']]);}}}catch(_0x1aa2d5){logger[_0x659b('0x3c')]('[voiceQueueReport][queuesummary]',util[_0x659b('0x3e')](_0x1aa2d5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')]['syncQueueSummaryComplete']=function(_0x3e7772){logger[_0x659b('0x45')](_0x659b('0x73'),util[_0x659b('0x3e')](_0x3e7772,{'showHidden':![],'depth':null}));this[_0x659b('0x14')]=!![];};VoiceQueueReport[_0x659b('0xb')][_0x659b('0x1b')]=function(_0x495aa4){try{if(this[_0x659b('0x62')](_0x495aa4)){logger[_0x659b('0x45')](_0x659b('0x74'),_0x495aa4[_0x659b('0x48')],util[_0x659b('0x3e')](_0x495aa4,{'showHidden':![],'depth':null}));if(_[_0x659b('0x63')](this['queueReports'][_0x495aa4[_0x659b('0x48')]]))this[_0x659b('0xf')][_0x495aa4['uniqueid']]=[];if(_[_0x659b('0x63')](this[_0x659b('0x11')][_0x495aa4['uniqueid']]))this[_0x659b('0x11')][_0x495aa4[_0x659b('0x48')]]={};var _0x3596b=new QueueReport();_0x3596b[_0x659b('0x4f')]=_0x495aa4[_0x659b('0x6b')];_0x3596b[_0x659b('0x52')]=this[_0x659b('0x13')][_0x3596b['name']]&&this['voiceQueues'][_0x3596b[_0x659b('0x4f')]]['type']?this[_0x659b('0x13')][_0x3596b[_0x659b('0x4f')]][_0x659b('0x52')]||_0x659b('0x53'):_0x659b('0x53');_0x3596b['queue']=_0x495aa4['queue'];_0x3596b[_0x659b('0x75')]=moment()[_0x659b('0x4a')](_0x659b('0x76'));_0x3596b[_0x659b('0x77')]=_0x495aa4[_0x659b('0x77')];_0x3596b[_0x659b('0x78')]=_0x495aa4[_0x659b('0x78')];_0x3596b[_0x659b('0x48')]=_0x495aa4[_0x659b('0x48')];_0x3596b[_0x659b('0x79')]=this['channels'][_0x495aa4['uniqueid']][_0x659b('0x79')];logger[_0x659b('0x6c')](_0x659b('0x7a'),_0x3596b['name'],_0x3596b[_0x659b('0x52')]);_[_0x659b('0x7b')](_0x3596b,_[_0x659b('0x7c')](_0x495aa4,_[_0x659b('0x7d')](_0x3596b)));this[_0x659b('0xf')][_0x495aa4[_0x659b('0x48')]]['push'](_0x3596b);this[_0x659b('0x11')][_0x495aa4[_0x659b('0x48')]]=_0x3596b;this[_0x659b('0x44')](_0x3596b,_0x659b('0x1a'));}}catch(_0x35a212){logger[_0x659b('0x3c')](_0x659b('0x74'),_0x495aa4[_0x659b('0x48')],util[_0x659b('0x3e')](_0x35a212,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')]['syncQueueCallerAbandon']=function(_0x442bfe){try{if(this['isNotNull'](_0x442bfe)){logger[_0x659b('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x442bfe[_0x659b('0x48')],util[_0x659b('0x3e')](_0x442bfe,{'showHidden':![],'depth':null}));if(this[_0x659b('0xf')][_0x442bfe['uniqueid']]){var _0x2cc009=_[_0x659b('0x7e')](this['queueReports'][_0x442bfe[_0x659b('0x48')]]);_0x2cc009[_0x659b('0x7f')]=![];_0x2cc009[_0x659b('0x80')]=null;_0x2cc009[_0x659b('0x81')]=_0x442bfe[_0x659b('0x81')];_0x2cc009['originalposition']=_0x442bfe[_0x659b('0x82')];_0x2cc009[_0x659b('0x1c')]=!![];_0x2cc009['queuecallerabandonAt']=moment()[_0x659b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cc009[_0x659b('0x83')]=_0x659b('0x84');_0x2cc009['lastAssignedTo']=null;logger['info'](_0x659b('0x85'),_0x2cc009[_0x659b('0x4f')],_0x2cc009[_0x659b('0x52')]);this[_0x659b('0x11')][_0x442bfe['uniqueid']]=_0x2cc009;this[_0x659b('0x4e')](_0x2cc009,'queuecallerabandon');}}}catch(_0x10bfc9){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x442bfe[_0x659b('0x48')],util[_0x659b('0x3e')](_0x10bfc9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')][_0x659b('0x86')]=function(_0x466d33){try{if(this[_0x659b('0x62')](_0x466d33)){logger['debug'](_0x659b('0x87'),_0x466d33[_0x659b('0x48')],util[_0x659b('0x3e')](_0x466d33,{'showHidden':![],'depth':null}));if(this[_0x659b('0xf')][_0x466d33[_0x659b('0x48')]]){var _0x5992bd=_[_0x659b('0x7e')](this[_0x659b('0xf')][_0x466d33[_0x659b('0x48')]]);_0x5992bd[_0x659b('0x88')]=moment()[_0x659b('0x4a')](_0x659b('0x76'));_0x5992bd[_0x659b('0x89')]=_0x466d33['connectedlinenum'];_0x5992bd[_0x659b('0x8a')]=_0x466d33['connectedlinename'];logger[_0x659b('0x6c')](_0x659b('0x8b'),_0x5992bd[_0x659b('0x4f')],_0x5992bd[_0x659b('0x52')],_0x466d33['connectedlinenum'],_0x466d33['connectedlinename']);this['channels'][_0x466d33[_0x659b('0x48')]]=_0x5992bd;this[_0x659b('0x44')](_0x5992bd,_0x659b('0x1e'));}}}catch(_0x120b0c){logger[_0x659b('0x3c')](_0x659b('0x87'),_0x466d33[_0x659b('0x48')],util[_0x659b('0x3e')](_0x120b0c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')][_0x659b('0x21')]=function(_0x5c9af2){try{if(this[_0x659b('0x62')](_0x5c9af2)){logger[_0x659b('0x45')](_0x659b('0x8c'),_0x5c9af2[_0x659b('0x48')],util['inspect'](_0x5c9af2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5c9af2['uniqueid']]){var _0x122b0f=_['last'](this[_0x659b('0xf')][_0x5c9af2[_0x659b('0x48')]]);_0x122b0f[_0x659b('0x7f')]=!![];_0x122b0f['queuecallerexitreason']=_0x659b('0x8d');logger[_0x659b('0x6c')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x122b0f[_0x659b('0x4f')],_0x122b0f[_0x659b('0x52')]);}}}catch(_0x45a82c){logger[_0x659b('0x3c')]('[%s][voiceQueueReport][agentconnect]',_0x5c9af2[_0x659b('0x48')],util[_0x659b('0x3e')](_0x45a82c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')][_0x659b('0x8e')]=function(_0x110c5d){try{if(this[_0x659b('0x62')](_0x110c5d)){logger['debug'](_0x659b('0x8f'),_0x110c5d[_0x659b('0x48')],util['inspect'](_0x110c5d,{'showHidden':![],'depth':null}));if(this[_0x659b('0xf')][_0x110c5d[_0x659b('0x48')]]){var _0xbb05=_[_0x659b('0x7e')](this[_0x659b('0xf')][_0x110c5d[_0x659b('0x48')]]);_0xbb05['queuecallerabandon']=![];_0xbb05[_0x659b('0x90')]=null;_0xbb05[_0x659b('0x91')]=!![];_0xbb05[_0x659b('0x92')]=_0x110c5d[_0x659b('0x93')];_0xbb05[_0x659b('0x81')]=_0x110c5d[_0x659b('0x81')];_0xbb05['queuecallercomplete']=!![];_0xbb05[_0x659b('0x94')]=![];_0xbb05[_0x659b('0x95')]=null;if(!_0xbb05[_0x659b('0x96')]){if(_0x110c5d[_0x659b('0x97')]==_0x659b('0x96')){_0xbb05[_0x659b('0x83')]='COMPLETED';logger[_0x659b('0x6c')](_0x659b('0x98'),_0xbb05[_0x659b('0x4f')],_0xbb05[_0x659b('0x52')]);}else{if(_[_0x659b('0x99')](_0x110c5d[_0x659b('0x3b')][_0x659b('0x9a')](),'local/')){if(this[_0x659b('0xf')][_0x110c5d['linkedid']]){var _0x1c4a87=_[_0x659b('0x7e')](this['queueReports'][_0x110c5d[_0x659b('0x9b')]]);_0x1c4a87[_0x659b('0x7f')]=![];_0x1c4a87['queuecallerexit']=!![];_0x1c4a87[_0x659b('0x95')]=moment(_0xbb05[_0x659b('0x75')])[_0x659b('0x9c')](_0x110c5d[_0x659b('0x81')],_0x659b('0x9d'))[_0x659b('0x4a')](_0x659b('0x76'));_0x1c4a87[_0x659b('0x83')]='FORWARDTRANSFER';_0x1c4a87[_0x659b('0x96')]=!![];_0x1c4a87[_0x659b('0x9e')]=_0x659b('0x9f');_0x1c4a87[_0x659b('0xa0')]=_0x110c5d['destexten'];_0x1c4a87['transferuniqueid']=_0x110c5d[_0x659b('0x48')];logger[_0x659b('0x6c')](_0x659b('0xa1'),_0x1c4a87[_0x659b('0x4f')],_0x1c4a87[_0x659b('0x52')]);var _0x138ca3=this['queueReports'][_0x110c5d[_0x659b('0x9b')]];this[_0x659b('0xf')][_0x110c5d[_0x659b('0x9b')]]=this['queueReports'][_0x110c5d[_0x659b('0x48')]];this['queueReports'][_0x110c5d[_0x659b('0x48')]]=_0x138ca3;}}else{_0xbb05[_0x659b('0x83')]='COMPLETEDBY'+_0x110c5d[_0x659b('0x97')]['toUpperCase']();logger[_0x659b('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0xbb05[_0x659b('0x4f')],_0xbb05[_0x659b('0x52')],_0xbb05[_0x659b('0x83')]);}}}this[_0x659b('0x11')][_0x110c5d[_0x659b('0x48')]]=_0xbb05;this[_0x659b('0x4e')](_0xbb05,'agentcomplete');}}}catch(_0x425913){logger[_0x659b('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x110c5d[_0x659b('0x48')],util[_0x659b('0x3e')](_0x425913,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x659b('0xb')]['syncVarSet']=function(_0x1a9ba4){try{if(this[_0x659b('0x62')](_0x1a9ba4)){logger[_0x659b('0x45')]('[%s][voiceQueueReport][varset]',_0x1a9ba4['uniqueid'],util['inspect'](_0x1a9ba4,{'showHidden':![],'depth':null}));this['addVariable'](_0x1a9ba4['uniqueid'],_[_0x659b('0x7d')](_0x1a9ba4[_0x659b('0xa2')])[0x0],_0x1a9ba4['value']);if(this[_0x659b('0xf')][_0x1a9ba4[_0x659b('0x48')]]){var _0x101750=_[_0x659b('0x7e')](this[_0x659b('0xf')][_0x1a9ba4[_0x659b('0x48')]]);if(_0x101750){if(this[_0x659b('0x62')](_0x1a9ba4[_0x659b('0xa2')])&&this[_0x659b('0x62')](_0x1a9ba4['variable']['queuestatus'])){switch(_0x1a9ba4[_0x659b('0xa3')]){case _0x659b('0xa4'):_0x101750[_0x659b('0x94')]=![];_0x101750[_0x659b('0x95')]=null;break;case _0x659b('0xa5'):_0x101750[_0x659b('0xa6')]=_0x659b('0xa7');_0x101750[_0x659b('0x94')]=!![];_0x101750['queuecallerexitAt']=moment()[_0x659b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x101750[_0x659b('0x88')]=moment()['format'](_0x659b('0x76'));logger[_0x659b('0x45')](_0x659b('0xa8'),_0x1a9ba4['uniqueid'],util[_0x659b('0x3e')](_0x101750,{'showHidden':![],'depth':null}));ami[_0x659b('0x49')]('custom:timeout',_0x101750);break;default:_0x101750['queuecallerexit']=!![];_0x101750[_0x659b('0x95')]=moment()[_0x659b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x101750[_0x659b('0x88')]=moment()[_0x659b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x101750[_0x659b('0x1c')]=![];_0x101750['queuecallerabandonAt']=null;_0x101750['queuecallerexitreason']=_0x1a9ba4[_0x659b('0xa3')];this[_0x659b('0x11')][_0x1a9ba4[_0x659b('0x48')]]=_0x101750;this[_0x659b('0x4e')](_0x101750,_0x659b('0x22'));}else if(this['isNotNull'](_0x1a9ba4['variable'])&&this[_0x659b('0x62')](_0x1a9ba4['variable'][_0x659b('0xa9')])){if(!_0x101750['queuecallerabandon']){_0x101750[_0x659b('0x94')]=!![];_0x101750[_0x659b('0x95')]=moment()[_0x659b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x101750[_0x659b('0x83')]=_0x659b('0xaa');_0x101750[_0x659b('0x88')]=moment()['format'](_0x659b('0x76'));this[_0x659b('0x11')][_0x1a9ba4[_0x659b('0x48')]]=_0x101750;}}logger[_0x659b('0x6c')](_0x659b('0xab'),_0x1a9ba4[_0x659b('0x48')],_0x101750[_0x659b('0x4f')],_0x101750[_0x659b('0x52')],_[_0x659b('0x7d')](_0x1a9ba4[_0x659b('0xa2')])[0x0],_0x1a9ba4[_0x659b('0xa3')]);_0x101750['variables']=this['variables'][_0x1a9ba4['uniqueid']];}}}}catch(_0x4e545b){logger[_0x659b('0x3c')](_0x659b('0xac'),_0x1a9ba4[_0x659b('0x48')],util[_0x659b('0x3e')](_0x4e545b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x659b('0xad')]=function(_0x297d26,_0x20763c,_0x322b8f){var _0x5c80a2=[_0x659b('0xae'),_0x659b('0xaf'),_0x659b('0xb0'),_0x659b('0xb1'),'rtpaudioqosloss',_0x659b('0xb2'),_0x659b('0xb3'),_0x659b('0xb4'),'sipcallid',_0x659b('0xb5'),'bridgepeer',_0x659b('0xb6'),_0x659b('0xb7'),_0x659b('0xb8'),_0x659b('0xb9'),_0x659b('0xba'),_0x659b('0x93'),_0x659b('0xbb'),_0x659b('0xbc')];if(!_[_0x659b('0xbd')](_0x20763c)&&!_['includes'](_0x5c80a2,_0x20763c)){if(_[_0x659b('0x63')](this[_0x659b('0x3f')][_0x297d26])){this['variables'][_0x297d26]={};}this[_0x659b('0x3f')][_0x297d26][_0x20763c]=_0x322b8f;}};VoiceQueueReport[_0x659b('0xb')][_0x659b('0x25')]=function(_0x17c857){try{if(this[_0x659b('0x62')](_0x17c857)){logger['debug'](_0x659b('0xbe'),_0x17c857[_0x659b('0x48')],util[_0x659b('0x3e')](_0x17c857,{'showHidden':![],'depth':null}));if(this[_0x659b('0xf')][_0x17c857[_0x659b('0x48')]]){for(var _0x46a979=0x0,_0x49353d={};_0x46a9790x0?_0x5e22af:0x0;this[_0x49ce('0x12')][_0x426e3a[_0x49ce('0x6a')]]['talking']=this[_0x49ce('0x12')][_0x426e3a[_0x49ce('0x6a')]][_0x49ce('0x5a')]>_['toNumber'](_0x426e3a['loggedin'])?_[_0x49ce('0x6e')](_0x426e3a[_0x49ce('0x6f')]):this[_0x49ce('0x12')][_0x426e3a['queue']][_0x49ce('0x5a')];this[_0x49ce('0x54')](this[_0x49ce('0x12')][_0x426e3a['queue']],_0x49ce('0x16'));}logger[_0x49ce('0x4f')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x49ce('0x51')](this[_0x49ce('0x12')][_0x426e3a[_0x49ce('0x6a')]],{'showHidden':![],'depth':null}));ami[_0x49ce('0x4a')](_0x49ce('0x71'),this['voiceQueues'][_0x426e3a[_0x49ce('0x6a')]]);}}}catch(_0x37e451){logger[_0x49ce('0x3f')](_0x49ce('0x72'),util[_0x49ce('0x51')](_0x37e451,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x482f59){logger[_0x49ce('0x4f')](_0x49ce('0x73'),util['inspect'](_0x482f59,{'showHidden':![],'depth':null}));this[_0x49ce('0x13')]=!![];};VoiceQueueReport[_0x49ce('0x9')]['syncQueueCallerJoin']=function(_0x2ced87){try{if(this[_0x49ce('0x64')](_0x2ced87)){logger[_0x49ce('0x4f')](_0x49ce('0x74'),_0x2ced87[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x2ced87,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x2ced87[_0x49ce('0x49')]]))this['queueReports'][_0x2ced87[_0x49ce('0x49')]]=[];if(_[_0x49ce('0x65')](this[_0x49ce('0x10')][_0x2ced87[_0x49ce('0x49')]]))this[_0x49ce('0x10')][_0x2ced87[_0x49ce('0x49')]]={};var _0x4c283a=new QueueReport();_0x4c283a[_0x49ce('0x4c')]=_0x2ced87[_0x49ce('0x6a')];_0x4c283a[_0x49ce('0x5b')]=this[_0x49ce('0x12')][_0x4c283a[_0x49ce('0x4c')]]&&this['voiceQueues'][_0x4c283a[_0x49ce('0x4c')]][_0x49ce('0x5b')]?this[_0x49ce('0x12')][_0x4c283a[_0x49ce('0x4c')]]['type']||'inbound':'inbound';_0x4c283a[_0x49ce('0x6a')]=_0x2ced87[_0x49ce('0x6a')];_0x4c283a['queuecallerjoinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c283a['position']=_0x2ced87['position'];_0x4c283a['count']=_0x2ced87[_0x49ce('0x75')];_0x4c283a[_0x49ce('0x49')]=_0x2ced87[_0x49ce('0x49')];_0x4c283a['routealias']=this[_0x49ce('0x10')][_0x2ced87['uniqueid']][_0x49ce('0x76')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4c283a[_0x49ce('0x4c')],_0x4c283a[_0x49ce('0x5b')]);_[_0x49ce('0x77')](_0x4c283a,_[_0x49ce('0x78')](_0x2ced87,_[_0x49ce('0x79')](_0x4c283a)));this[_0x49ce('0xe')][_0x2ced87[_0x49ce('0x49')]][_0x49ce('0x7a')](_0x4c283a);this[_0x49ce('0x10')][_0x2ced87[_0x49ce('0x49')]]=_0x4c283a;this[_0x49ce('0x47')](_0x4c283a,'queuecallerjoin');}}catch(_0x53f2c0){logger[_0x49ce('0x3f')](_0x49ce('0x74'),_0x2ced87[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x53f2c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x12cab1){try{if(this['isNotNull'](_0x12cab1)){logger[_0x49ce('0x4f')](_0x49ce('0x7b'),_0x12cab1[_0x49ce('0x49')],util['inspect'](_0x12cab1,{'showHidden':![],'depth':null}));if(this[_0x49ce('0xe')][_0x12cab1[_0x49ce('0x49')]]){var _0x317d1d=_[_0x49ce('0x7c')](this[_0x49ce('0xe')][_0x12cab1[_0x49ce('0x49')]]);_0x317d1d[_0x49ce('0x7d')]=![];_0x317d1d[_0x49ce('0x7e')]=null;_0x317d1d[_0x49ce('0x7f')]=_0x12cab1[_0x49ce('0x7f')];_0x317d1d['originalposition']=_0x12cab1['originalposition'];_0x317d1d[_0x49ce('0x1d')]=!![];_0x317d1d[_0x49ce('0x80')]=moment()['format'](_0x49ce('0x81'));_0x317d1d['queuecallerexitreason']=_0x49ce('0x82');_0x317d1d['lastAssignedTo']=null;logger[_0x49ce('0x6c')](_0x49ce('0x83'),_0x317d1d[_0x49ce('0x4c')],_0x317d1d[_0x49ce('0x5b')]);this['channels'][_0x12cab1[_0x49ce('0x49')]]=_0x317d1d;this[_0x49ce('0x45')](_0x317d1d,_0x49ce('0x1d'));}}}catch(_0x1cd103){logger[_0x49ce('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x12cab1[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x1cd103,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0x1f')]=function(_0x3805f7){try{if(this[_0x49ce('0x64')](_0x3805f7)){logger[_0x49ce('0x4f')](_0x49ce('0x84'),_0x3805f7[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x3805f7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3805f7[_0x49ce('0x49')]]){var _0x377e75=_[_0x49ce('0x7c')](this[_0x49ce('0xe')][_0x3805f7[_0x49ce('0x49')]]);_0x377e75['queuecallerleaveAt']=moment()[_0x49ce('0x52')](_0x49ce('0x81'));_0x377e75['connectedlinenum']=_0x3805f7[_0x49ce('0x85')];_0x377e75[_0x49ce('0x86')]=_0x3805f7[_0x49ce('0x86')];logger[_0x49ce('0x6c')](_0x49ce('0x87'),_0x377e75[_0x49ce('0x4c')],_0x377e75[_0x49ce('0x5b')],_0x3805f7[_0x49ce('0x85')],_0x3805f7[_0x49ce('0x86')]);this[_0x49ce('0x10')][_0x3805f7[_0x49ce('0x49')]]=_0x377e75;this[_0x49ce('0x47')](_0x377e75,'queuecallerleave');}}}catch(_0x1aadba){logger['error'](_0x49ce('0x84'),_0x3805f7[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x1aadba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0x22')]=function(_0x4ee700){try{if(this[_0x49ce('0x64')](_0x4ee700)){logger[_0x49ce('0x4f')](_0x49ce('0x88'),_0x4ee700[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x4ee700,{'showHidden':![],'depth':null}));if(this[_0x49ce('0xe')][_0x4ee700[_0x49ce('0x49')]]){var _0xdd6a19=_[_0x49ce('0x7c')](this['queueReports'][_0x4ee700['uniqueid']]);_0xdd6a19['queuecallercomplete']=!![];_0xdd6a19[_0x49ce('0x89')]=_0x49ce('0x8a');logger[_0x49ce('0x6c')](_0x49ce('0x8b'),_0xdd6a19[_0x49ce('0x4c')],_0xdd6a19[_0x49ce('0x5b')]);}}}catch(_0x47251d){logger['error'](_0x49ce('0x88'),_0x4ee700[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x47251d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0x20')]=function(_0x87733){try{if(this[_0x49ce('0x64')](_0x87733)){logger[_0x49ce('0x4f')](_0x49ce('0x8c'),_0x87733[_0x49ce('0x49')],util['inspect'](_0x87733,{'showHidden':![],'depth':null}));if(this[_0x49ce('0xe')][_0x87733[_0x49ce('0x49')]]){var _0x285ce1=_[_0x49ce('0x7c')](this['queueReports'][_0x87733[_0x49ce('0x49')]]);_0x285ce1['queuecallerabandon']=![];_0x285ce1[_0x49ce('0x80')]=null;_0x285ce1[_0x49ce('0x8d')]=!![];_0x285ce1[_0x49ce('0x8e')]=_0x87733[_0x49ce('0x8f')];_0x285ce1['holdtime']=_0x87733[_0x49ce('0x7f')];_0x285ce1[_0x49ce('0x7d')]=!![];_0x285ce1['queuecallerexit']=![];_0x285ce1[_0x49ce('0x90')]=null;if(!_0x285ce1[_0x49ce('0x91')]){if(_0x87733['reason']==_0x49ce('0x91')){_0x285ce1[_0x49ce('0x89')]=_0x49ce('0x92');logger[_0x49ce('0x6c')](_0x49ce('0x93'),_0x285ce1[_0x49ce('0x4c')],_0x285ce1[_0x49ce('0x5b')]);}else{if(_[_0x49ce('0x94')](_0x87733[_0x49ce('0x3d')][_0x49ce('0x95')](),_0x49ce('0x96'))){if(this['queueReports'][_0x87733[_0x49ce('0x97')]]){var _0x27c971=_[_0x49ce('0x7c')](this[_0x49ce('0xe')][_0x87733[_0x49ce('0x97')]]);_0x27c971['queuecallercomplete']=![];_0x27c971[_0x49ce('0x98')]=!![];_0x27c971['queuecallerexitAt']=moment(_0x285ce1[_0x49ce('0x99')])[_0x49ce('0x9a')](_0x87733[_0x49ce('0x7f')],'seconds')['format'](_0x49ce('0x81'));_0x27c971[_0x49ce('0x89')]=_0x49ce('0x9b');_0x27c971[_0x49ce('0x91')]=!![];_0x27c971[_0x49ce('0x9c')]='FORWARD';_0x27c971[_0x49ce('0x9d')]=_0x87733[_0x49ce('0x9e')];_0x27c971['transferuniqueid']=_0x87733[_0x49ce('0x49')];logger[_0x49ce('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x27c971[_0x49ce('0x4c')],_0x27c971['type']);var _0xd5ae02=this[_0x49ce('0xe')][_0x87733[_0x49ce('0x97')]];this[_0x49ce('0xe')][_0x87733[_0x49ce('0x97')]]=this[_0x49ce('0xe')][_0x87733['uniqueid']];this['queueReports'][_0x87733[_0x49ce('0x49')]]=_0xd5ae02;}}else{_0x285ce1[_0x49ce('0x89')]='COMPLETEDBY'+_0x87733[_0x49ce('0x9f')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x285ce1[_0x49ce('0x4c')],_0x285ce1[_0x49ce('0x5b')],_0x285ce1['queuecallerexitreason']);}}}this['channels'][_0x87733[_0x49ce('0x49')]]=_0x285ce1;this[_0x49ce('0x45')](_0x285ce1,'agentcomplete');}}}catch(_0x11a17b){logger[_0x49ce('0x3f')](_0x49ce('0x8c'),_0x87733['uniqueid'],util[_0x49ce('0x51')](_0x11a17b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0x24')]=function(_0x5ad508){try{if(this[_0x49ce('0x64')](_0x5ad508)){logger[_0x49ce('0x4f')](_0x49ce('0xa0'),_0x5ad508['uniqueid'],util[_0x49ce('0x51')](_0x5ad508,{'showHidden':![],'depth':null}));this['addVariable'](_0x5ad508[_0x49ce('0x49')],_[_0x49ce('0x79')](_0x5ad508['variable'])[0x0],_0x5ad508[_0x49ce('0xa1')]);if(this[_0x49ce('0xe')][_0x5ad508[_0x49ce('0x49')]]){var _0x3479dc=_[_0x49ce('0x7c')](this[_0x49ce('0xe')][_0x5ad508[_0x49ce('0x49')]]);if(_0x3479dc){if(this['isNotNull'](_0x5ad508[_0x49ce('0xa2')])&&this[_0x49ce('0x64')](_0x5ad508[_0x49ce('0xa2')][_0x49ce('0xa3')])){switch(_0x5ad508[_0x49ce('0xa1')]){case _0x49ce('0xa4'):_0x3479dc[_0x49ce('0x98')]=![];_0x3479dc['queuecallerexitAt']=null;break;case _0x49ce('0xa5'):_0x3479dc[_0x49ce('0xa6')]=_0x49ce('0xa7');_0x3479dc[_0x49ce('0x98')]=!![];_0x3479dc[_0x49ce('0x90')]=moment()['format'](_0x49ce('0x81'));_0x3479dc[_0x49ce('0xa8')]=moment()[_0x49ce('0x52')](_0x49ce('0x81'));logger[_0x49ce('0x4f')](_0x49ce('0xa9'),_0x5ad508[_0x49ce('0x49')],util['inspect'](_0x3479dc,{'showHidden':![],'depth':null}));ami[_0x49ce('0x4a')](_0x49ce('0xaa'),_0x3479dc);break;default:_0x3479dc[_0x49ce('0x98')]=!![];_0x3479dc['queuecallerexitAt']=moment()[_0x49ce('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x3479dc[_0x49ce('0xa8')]=moment()[_0x49ce('0x52')](_0x49ce('0x81'));}_0x3479dc[_0x49ce('0x1d')]=![];_0x3479dc['queuecallerabandonAt']=null;_0x3479dc[_0x49ce('0x89')]=_0x5ad508[_0x49ce('0xa1')];this['channels'][_0x5ad508[_0x49ce('0x49')]]=_0x3479dc;this[_0x49ce('0x45')](_0x3479dc,'varset');}else if(this[_0x49ce('0x64')](_0x5ad508[_0x49ce('0xa2')])&&this[_0x49ce('0x64')](_0x5ad508[_0x49ce('0xa2')][_0x49ce('0xab')])){if(!_0x3479dc['queuecallerabandon']){_0x3479dc[_0x49ce('0x98')]=!![];_0x3479dc[_0x49ce('0x90')]=moment()[_0x49ce('0x52')](_0x49ce('0x81'));_0x3479dc[_0x49ce('0x89')]=_0x49ce('0xac');_0x3479dc[_0x49ce('0xa8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x49ce('0x10')][_0x5ad508[_0x49ce('0x49')]]=_0x3479dc;}}logger[_0x49ce('0x6c')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5ad508[_0x49ce('0x49')],_0x3479dc[_0x49ce('0x4c')],_0x3479dc[_0x49ce('0x5b')],_[_0x49ce('0x79')](_0x5ad508[_0x49ce('0xa2')])[0x0],_0x5ad508[_0x49ce('0xa1')]);_0x3479dc[_0x49ce('0x15')]=this[_0x49ce('0x15')][_0x5ad508['uniqueid']];}}}}catch(_0x545738){logger['error']('[%s][voiceQueueReport][varset]',_0x5ad508[_0x49ce('0x49')],util[_0x49ce('0x51')](_0x545738,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0xad')]=function(_0x7ec0cc,_0x4df0a0,_0x35f278){var _0x294c86=[_0x49ce('0xae'),_0x49ce('0xaf'),_0x49ce('0xb0'),_0x49ce('0xb1'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x49ce('0xb2'),_0x49ce('0xb3'),'sipcallid',_0x49ce('0xb4'),_0x49ce('0xb5'),_0x49ce('0xb6'),_0x49ce('0xb7'),_0x49ce('0xb8'),'memberinterface',_0x49ce('0xb9'),_0x49ce('0x8f'),_0x49ce('0xba'),'memberrealtime'];if(!_['isNil'](_0x4df0a0)&&!_[_0x49ce('0xbb')](_0x294c86,_0x4df0a0)){if(_[_0x49ce('0x65')](this['variables'][_0x7ec0cc])){this[_0x49ce('0x15')][_0x7ec0cc]={};}this[_0x49ce('0x15')][_0x7ec0cc][_0x4df0a0]=_0x35f278;}};VoiceQueueReport[_0x49ce('0x9')][_0x49ce('0x26')]=function(_0x3c3f94){try{if(this['isNotNull'](_0x3c3f94)){logger[_0x49ce('0x4f')](_0x49ce('0xbc'),_0x3c3f94['uniqueid'],util[_0x49ce('0x51')](_0x3c3f94,{'showHidden':![],'depth':null}));if(this[_0x49ce('0xe')][_0x3c3f94[_0x49ce('0x49')]]){for(var _0x2c6f40=0x0,_0x55c528={};_0x2c6f40=0x0?moment(_0x34edf7[_0x6c69('0x16')])[_0x6c69('0xc')](_0x34edf7[_0x6c69('0x17')],'seconds'):null,'data1':'outbound','data2':_0x34edf7[_0x6c69('0x12')],'data3':_0x34edf7[_0x6c69('0x10')],'data4':_0x34edf7[_0x6c69('0x18')]||null,'role':'agent','internal':_0x34edf7[_0x6c69('0x12')]?_[_0x6c69('0x13')](_0x34edf7[_0x6c69('0x12')]):undefined,'uniqueid':_0x34edf7[_0x6c69('0x14')]},'log':_0x6c69('0x5')});}; \ No newline at end of file +var _0xd935=['starttime','accountcode','dialstring','agent','toNumber','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','interface','format','SIP/%s','TALKING','diff','seconds','inbound','exten','uniqueid','voiceDialReport','Request','voice','endtime'];(function(_0x3eedfa,_0x29b632){var _0x43f1ad=function(_0x15b9a4){while(--_0x15b9a4){_0x3eedfa['push'](_0x3eedfa['shift']());}};_0x43f1ad(++_0x29b632);}(_0xd935,0x109));var _0x5d93=function(_0x2d3900,_0x3b8d97){_0x2d3900=_0x2d3900-0x0;var _0x22fb7d=_0xd935[_0x2d3900];return _0x22fb7d;};'use strict';var moment=require(_0x5d93('0x0'));var _=require(_0x5d93('0x1'));var util=require(_0x5d93('0x2'));var client=require(_0x5d93('0x3'));exports['voiceQueueReport']=function(_0xdbb6ee){var _0x5e5a65=_0xdbb6ee[_0x5d93('0x4')]||_0xdbb6ee[_0x5d93('0x5')];return client['Request'](_0x5d93('0x6'),{'body':{'channel':'voice','membername':_0xdbb6ee[_0x5d93('0x7')],'interface':_['isNil'](_0xdbb6ee[_0x5d93('0x8')])?util[_0x5d93('0x9')](_0x5d93('0xa'),_0xdbb6ee['lastAssignedTo']):_0xdbb6ee[_0x5d93('0x8')],'type':_0x5d93('0xb'),'enterAt':_0xdbb6ee['queuecallerleaveAt'],'exitAt':_0x5e5a65,'duration':moment(_0x5e5a65)[_0x5d93('0xc')](_0xdbb6ee['queuecallerleaveAt'],_0x5d93('0xd')),'data1':_0x5d93('0xe'),'data2':_0xdbb6ee['calleridnum'],'data3':_0xdbb6ee[_0x5d93('0xf')],'data4':null,'data5':_0xdbb6ee['queue'],'role':'agent','internal':_0xdbb6ee['accountcode']?_['toNumber'](_0xdbb6ee['accountcode']):undefined,'uniqueid':_0xdbb6ee[_0x5d93('0x10')]},'log':_0x5d93('0x6')});};exports[_0x5d93('0x11')]=function(_0xd90958){return client[_0x5d93('0x12')](_0x5d93('0x6'),{'body':{'channel':_0x5d93('0x13'),'membername':_0xd90958['membername'],'interface':_0xd90958['interface'],'type':_0x5d93('0xb'),'enterAt':_0xd90958['starttime'],'exitAt':_0xd90958[_0x5d93('0x14')],'duration':moment(_0xd90958[_0x5d93('0x14')])['diff'](_0xd90958[_0x5d93('0x15')],_0x5d93('0xd'))>=0x0?moment(_0xd90958['endtime'])[_0x5d93('0xc')](_0xd90958[_0x5d93('0x15')],_0x5d93('0xd')):null,'data1':'outbound','data2':_0xd90958[_0x5d93('0x16')],'data3':_0xd90958[_0x5d93('0xf')],'data4':_0xd90958[_0x5d93('0x17')]||null,'role':_0x5d93('0x18'),'internal':_0xd90958[_0x5d93('0x16')]?_[_0x5d93('0x19')](_0xd90958['accountcode']):undefined,'uniqueid':_0xd90958[_0x5d93('0x10')]},'log':_0x5d93('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index a782541..a2112f9 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 _0x9227=['../client','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x556f16,_0x242221){var _0x14814e=function(_0x1e47d4){while(--_0x1e47d4){_0x556f16['push'](_0x556f16['shift']());}};_0x14814e(++_0x242221);}(_0x9227,0xc3));var _0x7922=function(_0x5571c5,_0x3078ba){_0x5571c5=_0x5571c5-0x0;var _0xf4648=_0x9227[_0x5571c5];return _0xf4648;};'use strict';var client=require(_0x7922('0x0'));exports['getSettings']=function(){return client[_0x7922('0x1')](_0x7922('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7922('0x3')]},'log':_0x7922('0x4')});}; \ No newline at end of file +var _0x3c8c=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x42dbee,_0x18254e){var _0x43fe2d=function(_0x300982){while(--_0x300982){_0x42dbee['push'](_0x42dbee['shift']());}};_0x43fe2d(++_0x18254e);}(_0x3c8c,0xb0));var _0xc3c8=function(_0x5a0e86,_0x139f2e){_0x5a0e86=_0x5a0e86-0x0;var _0xe4b926=_0x3c8c[_0x5a0e86];return _0xe4b926;};'use strict';var client=require(_0xc3c8('0x0'));exports[_0xc3c8('0x1')]=function(){return client[_0xc3c8('0x2')](_0xc3c8('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xc3c8('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 90448a0..4c7b8af 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 _0x31af=['../client','GetTemplate','name'];(function(_0x4e32d4,_0x4072b2){var _0xf131d2=function(_0xdf7872){while(--_0xdf7872){_0x4e32d4['push'](_0x4e32d4['shift']());}};_0xf131d2(++_0x4072b2);}(_0x31af,0x1b9));var _0xf31a=function(_0x16ea2d,_0x1e74eb){_0x16ea2d=_0x16ea2d-0x0;var _0xb29d31=_0x31af[_0x16ea2d];return _0xb29d31;};'use strict';var client=require(_0xf31a('0x0'));exports['getTemplates']=function(_0x55891c){return function(_0x1d9e64){return client['Request'](_0xf31a('0x1'),{'options':{'raw':!![],'attributes':['id',_0xf31a('0x2'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xce2f=['GetTemplate','name','getTemplates','Request'];(function(_0x4ea34e,_0x3c17d9){var _0x140b9d=function(_0x513533){while(--_0x513533){_0x4ea34e['push'](_0x4ea34e['shift']());}};_0x140b9d(++_0x3c17d9);}(_0xce2f,0x18a));var _0xfce2=function(_0x353608,_0x3a4939){_0x353608=_0x353608-0x0;var _0x1bda7b=_0xce2f[_0x353608];return _0x1bda7b;};'use strict';var client=require('../client');exports[_0xfce2('0x0')]=function(_0x265b70){return function(_0x3380e6){return client[_0xfce2('0x1')](_0xfce2('0x2'),{'options':{'raw':!![],'attributes':['id',_0xfce2('0x3'),'html']},'log':_0xfce2('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8a63b94..95b0cf8 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 _0xd0a5=['data5','data6','data7','../client','getTriggers','GetTrigger','name','status','operator','value','Condition','AnyConditions','field','Action','Actions','action','data1'];(function(_0x55a469,_0x197c96){var _0x1d60a8=function(_0x10f869){while(--_0x10f869){_0x55a469['push'](_0x55a469['shift']());}};_0x1d60a8(++_0x197c96);}(_0xd0a5,0x8b));var _0x5d0a=function(_0x422a61,_0x414349){_0x422a61=_0x422a61-0x0;var _0x3e8e28=_0xd0a5[_0x422a61];return _0x3e8e28;};'use strict';var client=require(_0x5d0a('0x0'));exports[_0x5d0a('0x1')]=function(_0x525444){return function(_0x1f4c6a){return client['Request'](_0x5d0a('0x2'),{'options':{'raw':![],'attributes':['id',_0x5d0a('0x3'),'channel',_0x5d0a('0x4')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id','field',_0x5d0a('0x5'),_0x5d0a('0x6')]},{'model':_0x5d0a('0x7'),'as':_0x5d0a('0x8'),'attributes':['id',_0x5d0a('0x9'),_0x5d0a('0x5'),_0x5d0a('0x6')]},{'model':_0x5d0a('0xa'),'as':_0x5d0a('0xb'),'attributes':['id',_0x5d0a('0xc'),_0x5d0a('0xd'),'data2','data3','data4',_0x5d0a('0xe'),_0x5d0a('0xf'),_0x5d0a('0x10')]}]},'log':_0x5d0a('0x2')});};}; \ No newline at end of file +var _0x2b04=['channel','status','Condition','field','value','AnyConditions','operator','Actions','action','data1','data3','data4','data5','data6','data7','GetTrigger','getTriggers','Request','name'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x2b04,0x166));var _0x42b0=function(_0x1994d5,_0x159760){_0x1994d5=_0x1994d5-0x0;var _0x3cabf2=_0x2b04[_0x1994d5];return _0x3cabf2;};'use strict';var client=require('../client');exports[_0x42b0('0x0')]=function(_0x5661f6){return function(_0x34f3fb){return client[_0x42b0('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x42b0('0x2'),_0x42b0('0x3'),_0x42b0('0x4')],'include':[{'model':_0x42b0('0x5'),'as':'AllConditions','attributes':['id',_0x42b0('0x6'),'operator',_0x42b0('0x7')]},{'model':_0x42b0('0x5'),'as':_0x42b0('0x8'),'attributes':['id','field',_0x42b0('0x9'),_0x42b0('0x7')]},{'model':'Action','as':_0x42b0('0xa'),'attributes':['id',_0x42b0('0xb'),_0x42b0('0xc'),'data2',_0x42b0('0xd'),_0x42b0('0xe'),_0x42b0('0xf'),_0x42b0('0x10'),_0x42b0('0x11')]}]},'log':_0x42b0('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7e1d65a..05e2468 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 _0xe6c1=['getTrunks','name','registry','defaultuser'];(function(_0x57a711,_0x419635){var _0x3e4c01=function(_0xedabd1){while(--_0xedabd1){_0x57a711['push'](_0x57a711['shift']());}};_0x3e4c01(++_0x419635);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6c1[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x1e6c('0x0')]=function(_0x3fa0fe){return function(_0x376a28){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1e6c('0x1'),_0x1e6c('0x2'),_0x1e6c('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x0f42=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x320c90,_0x515e0a){var _0x4b8824=function(_0x11fd98){while(--_0x11fd98){_0x320c90['push'](_0x320c90['shift']());}};_0x4b8824(++_0x515e0a);}(_0x0f42,0xc9));var _0x20f4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0f42[_0x2be8c2];return _0x97f531;};'use strict';var client=require(_0x20f4('0x0'));exports[_0x20f4('0x1')]=function(_0x2b0d8d){return function(_0x130e73){return client['Request'](_0x20f4('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x20f4('0x3'),_0x20f4('0x4')]},'log':_0x20f4('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 0dfda4c..77735dc 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe706,0xa3));var _0x6e70=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0xe706[_0x195577];return _0x13c367;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x554e85,_0x2f7a67){var _0x26e8df=function(_0x450d67){while(--_0x450d67){_0x554e85['push'](_0x554e85['shift']());}};_0x26e8df(++_0x2f7a67);}(_0x70e0,0x17b));var _0x070e=function(_0x21dcf5,_0x32dce9){_0x21dcf5=_0x21dcf5-0x0;var _0x14bd6d=_0x70e0[_0x21dcf5];return _0x14bd6d;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5479f0d..2d93284 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 _0x44ff=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x516a12,_0x3f0340){var _0x2fb220=function(_0x3be7c5){while(--_0x3be7c5){_0x516a12['push'](_0x516a12['shift']());}};_0x2fb220(++_0x3f0340);}(_0x44ff,0x10f));var _0xf44f=function(_0x530410,_0x24261b){_0x530410=_0x530410-0x0;var _0x209d87=_0x44ff[_0x530410];return _0x209d87;};'use strict';var client=require('../client');exports[_0xf44f('0x0')]=function(_0x2dbe7e){return client['Request'](_0xf44f('0x1'),{'body':_0x2dbe7e,'log':_0xf44f('0x1')});};exports[_0xf44f('0x2')]=function(_0x271204,_0x597be7,_0x305bd3){return client['Request'](_0xf44f('0x3'),{'body':_0x271204,'options':{'where':{'uniqueid':_0x597be7,'interface':_0x305bd3,'agentcomplete':!![]}},'log':_0xf44f('0x3')});}; \ No newline at end of file +var _0xfc17=['CreateVoiceAgentReport','UpdateVoiceAgentReport','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc17,0x7a));var _0x7fc1=function(_0x8dcd15,_0x4ab414){_0x8dcd15=_0x8dcd15-0x0;var _0x1ecb92=_0xfc17[_0x8dcd15];return _0x1ecb92;};'use strict';var client=require('../client');exports[_0x7fc1('0x0')]=function(_0x2eedfa){return client[_0x7fc1('0x1')](_0x7fc1('0x2'),{'body':_0x2eedfa,'log':_0x7fc1('0x2')});};exports['update']=function(_0x232e87,_0xd720b2,_0xd13fc1){return client[_0x7fc1('0x1')](_0x7fc1('0x3'),{'body':_0x232e87,'options':{'where':{'uniqueid':_0xd720b2,'interface':_0xd13fc1,'agentcomplete':!![]}},'log':_0x7fc1('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 03d4c1a..6f3e1d4 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 _0x6010=['calleridnum','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','disposition','billableseconds','GetVoiceCallReports','moment','util','../client','create','CreateVoiceCallReport','merge'];(function(_0x19a071,_0x1388bc){var _0x232daf=function(_0x1f4e5c){while(--_0x1f4e5c){_0x19a071['push'](_0x19a071['shift']());}};_0x232daf(++_0x1388bc);}(_0x6010,0x66));var _0x0601=function(_0x402bca,_0x4ac38c){_0x402bca=_0x402bca-0x0;var _0x58fc9b=_0x6010[_0x402bca];return _0x58fc9b;};'use strict';var moment=require(_0x0601('0x0'));var util=require(_0x0601('0x1'));var _=require('lodash');var client=require(_0x0601('0x2'));exports[_0x0601('0x3')]=function(_0x3010f9){return client['Request'](_0x0601('0x4'),{'body':_[_0x0601('0x5')](_0x3010f9,{'source':_0x3010f9[_0x0601('0x6')],'destinationcontext':_0x3010f9['context'],'callerid':_0x3010f9['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x0601('0x4')});};exports[_0x0601('0x7')]=function(){return function(){return client[_0x0601('0x8')](_0x0601('0x9'),{'options':{'where':{'type':[_0x0601('0xa')],'createdAt':{'$between':[moment()[_0x0601('0xb')]('day')[_0x0601('0xc')](_0x0601('0xd')),moment()['endOf'](_0x0601('0xe'))[_0x0601('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x0601('0xf'),'duration',_0x0601('0x10')]},'log':_0x0601('0x11')});};}; \ No newline at end of file +var _0xd69d=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound'];(function(_0x1bbcc2,_0x1c1ccf){var _0x23081d=function(_0x44fe4){while(--_0x44fe4){_0x1bbcc2['push'](_0x1bbcc2['shift']());}};_0x23081d(++_0x1c1ccf);}(_0xd69d,0xd9));var _0xdd69=function(_0x41bf8d,_0x4bf66c){_0x41bf8d=_0x41bf8d-0x0;var _0x344e06=_0xd69d[_0x41bf8d];return _0x344e06;};'use strict';var moment=require('moment');var util=require(_0xdd69('0x0'));var _=require(_0xdd69('0x1'));var client=require(_0xdd69('0x2'));exports[_0xdd69('0x3')]=function(_0x1a56bc){return client['Request'](_0xdd69('0x4'),{'body':_[_0xdd69('0x5')](_0x1a56bc,{'source':_0x1a56bc[_0xdd69('0x6')],'destinationcontext':_0x1a56bc[_0xdd69('0x7')],'callerid':_0x1a56bc[_0xdd69('0x8')],'amaflags':_0xdd69('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xdd69('0xa')]=function(){return function(){return client[_0xdd69('0xb')](_0xdd69('0xc'),{'options':{'where':{'type':[_0xdd69('0xd')],'createdAt':{'$between':[moment()[_0xdd69('0xe')](_0xdd69('0xf'))[_0xdd69('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xdd69('0xf'))[_0xdd69('0x10')](_0xdd69('0x11'))]}},'attributes':['type',_0xdd69('0x12'),'duration',_0xdd69('0x13')]},'log':_0xdd69('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 51026c4..93ed35e 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 _0x1fd8=['create'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1fd8,0x83));var _0x81fd=function(_0x4d282a,_0x421ae7){_0x4d282a=_0x4d282a-0x0;var _0x47f9d8=_0x1fd8[_0x4d282a];return _0x47f9d8;};'use strict';var client=require('../client');exports[_0x81fd('0x0')]=function(_0x2fca1a){return client['Request']('CreateVoiceDialReport',{'body':_0x2fca1a,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x3c75=['../client','create','Request','CreateVoiceDialReport'];(function(_0x46fed4,_0x1583d3){var _0x4c8453=function(_0x554e92){while(--_0x554e92){_0x46fed4['push'](_0x46fed4['shift']());}};_0x4c8453(++_0x1583d3);}(_0x3c75,0x16c));var _0x53c7=function(_0x253882,_0x1fc9ee){_0x253882=_0x253882-0x0;var _0x5d0f34=_0x3c75[_0x253882];return _0x5d0f34;};'use strict';var client=require(_0x53c7('0x0'));exports[_0x53c7('0x1')]=function(_0x3a50fe){return client[_0x53c7('0x2')](_0x53c7('0x3'),{'body':_0x3a50fe,'log':_0x53c7('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 9547d10..67d1f17 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 _0x16d2=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x52455d,_0x47edae){var _0x38dfcb=function(_0x3af68f){while(--_0x3af68f){_0x52455d['push'](_0x52455d['shift']());}};_0x38dfcb(++_0x47edae);}(_0x16d2,0x123));var _0x216d=function(_0x3bea23,_0x279d44){_0x3bea23=_0x3bea23-0x0;var _0x2b6115=_0x16d2[_0x3bea23];return _0x2b6115;};'use strict';var client=require(_0x216d('0x0'));exports[_0x216d('0x1')]=function(){return function(){return client[_0x216d('0x2')](_0x216d('0x3'),{'options':{'raw':!![],'attributes':['id',_0x216d('0x4'),_0x216d('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x216d('0x1')});};}; \ No newline at end of file +var _0xf17f=['getVoiceExtensions','Request','exten','../client'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xf17f,0x113));var _0xff17=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0xf17f[_0x4f7b43];return _0x2fcdf3;};'use strict';var client=require(_0xff17('0x0'));exports[_0xff17('0x1')]=function(){return function(){return client[_0xff17('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xff17('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d8d46f4..4e692d5 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 _0xe08b=['Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active'];(function(_0x306102,_0x503f39){var _0x509133=function(_0x592686){while(--_0x592686){_0x306102['push'](_0x306102['shift']());}};_0x509133(++_0x503f39);}(_0xe08b,0x10e));var _0xbe08=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xe08b[_0x1460f6];return _0x46ce94;};'use strict';var client=require(_0xbe08('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xbe08('0x1')](_0xbe08('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xbe08('0x3'),_0xbe08('0x4'),_0xbe08('0x5'),_0xbe08('0x6'),_0xbe08('0x7'),_0xbe08('0x8'),_0xbe08('0x9'),_0xbe08('0xa'),_0xbe08('0xb'),_0xbe08('0xc'),_0xbe08('0xd'),_0xbe08('0xe'),_0xbe08('0xf'),'dialOriginateCallerIdName',_0xbe08('0x10'),_0xbe08('0x11'),'dialQueueOptions',_0xbe08('0x12'),_0xbe08('0x13'),'dialCongestionMaxRetry',_0xbe08('0x14'),_0xbe08('0x15'),'dialBusyRetryFrequency',_0xbe08('0x16'),_0xbe08('0x17'),_0xbe08('0x18'),_0xbe08('0x19'),'dialGlobalInterval',_0xbe08('0x1a'),'dialCheckDuplicateType',_0xbe08('0x1b'),_0xbe08('0x1c'),_0xbe08('0x1d'),_0xbe08('0x1e'),_0xbe08('0x1f'),_0xbe08('0x20'),_0xbe08('0x21'),_0xbe08('0x22'),_0xbe08('0x23'),_0xbe08('0x24'),_0xbe08('0x25'),_0xbe08('0x26'),_0xbe08('0x27'),_0xbe08('0x28'),_0xbe08('0x29'),_0xbe08('0x2a'),_0xbe08('0x2b'),_0xbe08('0x6'),'strategy',_0xbe08('0x2c'),_0xbe08('0x2d'),_0xbe08('0x2e'),_0xbe08('0x2f'),_0xbe08('0x30'),_0xbe08('0x31'),_0xbe08('0x32'),'dialAbandonedRetryFrequency',_0xbe08('0x33'),_0xbe08('0x34'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xbe08('0x35'),_0xbe08('0x36'),_0xbe08('0x37'),'dialPreviewAutoRecallMe'],'include':[{'model':_0xbe08('0x38'),'as':_0xbe08('0x38'),'attributes':['id',_0xbe08('0x39'),_0xbe08('0x3a'),_0xbe08('0x3b')]},{'model':_0xbe08('0x3c'),'as':_0xbe08('0x3d'),'attributes':['id',_0xbe08('0x39')]},{'model':_0xbe08('0x38'),'as':_0xbe08('0x3e'),'attributes':['id',_0xbe08('0x39'),_0xbe08('0x3a'),_0xbe08('0x3b')]},{'model':_0xbe08('0x3f'),'as':_0xbe08('0x3f'),'attributes':['id',_0xbe08('0x39')],'include':[{'model':_0xbe08('0x3f'),'as':_0xbe08('0x40'),'attributes':['id',_0xbe08('0x39'),_0xbe08('0x41')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xe9e7=['../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval'];(function(_0x168fb4,_0x56fdde){var _0x44631f=function(_0xb5687c){while(--_0xb5687c){_0x168fb4['push'](_0x168fb4['shift']());}};_0x44631f(++_0x56fdde);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x36b1d,_0x20c8a7){_0x36b1d=_0x36b1d-0x0;var _0x377988=_0xe9e7[_0x36b1d];return _0x377988;};'use strict';var client=require(_0x7e9e('0x0'));exports[_0x7e9e('0x1')]=function(){return function(){return client[_0x7e9e('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7e9e('0x3'),_0x7e9e('0x4'),_0x7e9e('0x5'),_0x7e9e('0x6'),_0x7e9e('0x7'),_0x7e9e('0x8'),_0x7e9e('0x9'),'dialMethod',_0x7e9e('0xa'),_0x7e9e('0xb'),_0x7e9e('0xc'),'dialPredictiveOptimization',_0x7e9e('0xd'),'dialPredictiveInterval',_0x7e9e('0xe'),_0x7e9e('0xf'),_0x7e9e('0x10'),_0x7e9e('0x11'),_0x7e9e('0x12'),_0x7e9e('0x13'),_0x7e9e('0x14'),_0x7e9e('0x15'),_0x7e9e('0x16'),_0x7e9e('0x17'),_0x7e9e('0x18'),_0x7e9e('0x19'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x7e9e('0x1a'),_0x7e9e('0x1b'),_0x7e9e('0x1c'),_0x7e9e('0x1d'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x7e9e('0x1e'),_0x7e9e('0x1f'),_0x7e9e('0x20'),_0x7e9e('0x21'),_0x7e9e('0x22'),_0x7e9e('0x23'),_0x7e9e('0x24'),'dialRecallMeTimeout',_0x7e9e('0x25'),'dialOrderByScheduledAt',_0x7e9e('0x26'),_0x7e9e('0x27'),_0x7e9e('0x28'),_0x7e9e('0x7'),_0x7e9e('0x29'),_0x7e9e('0x2a'),_0x7e9e('0x2b'),'dialNoSuchNumberMaxRetry',_0x7e9e('0x2c'),_0x7e9e('0x2d'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x7e9e('0x2e'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x7e9e('0x2f'),_0x7e9e('0x30'),_0x7e9e('0x31'),_0x7e9e('0x32'),_0x7e9e('0x33'),_0x7e9e('0x34')],'include':[{'model':_0x7e9e('0x35'),'as':_0x7e9e('0x35'),'attributes':['id',_0x7e9e('0x3'),'callerid',_0x7e9e('0x36')]},{'model':_0x7e9e('0x37'),'as':_0x7e9e('0x38'),'attributes':['id',_0x7e9e('0x3')]},{'model':'Trunk','as':_0x7e9e('0x39'),'attributes':['id',_0x7e9e('0x3'),_0x7e9e('0x3a'),_0x7e9e('0x36')]},{'model':_0x7e9e('0x3b'),'as':_0x7e9e('0x3b'),'attributes':['id',_0x7e9e('0x3')],'include':[{'model':'Interval','as':_0x7e9e('0x3c'),'attributes':['id',_0x7e9e('0x3'),_0x7e9e('0x3d')]}]}]},'log':_0x7e9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 0f8d67d..3cbf055 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(_0x59e2d9,_0xd88352){var _0x132155=function(_0x5adb33){while(--_0x5adb33){_0x59e2d9['push'](_0x59e2d9['shift']());}};_0x132155(++_0xd88352);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x2c3048,_0x4f2ee3){var _0x5d9229=function(_0x1ea067){while(--_0x1ea067){_0x2c3048['push'](_0x2c3048['shift']());}};_0x5d9229(++_0x4f2ee3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 4867c48..472bc03 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 _0x9c69=['Request','getVoiceQueueRtPauses'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9c69,0x1ca));var _0x99c6=function(_0x4b69ae,_0x207c9b){_0x4b69ae=_0x4b69ae-0x0;var _0x28bdd3=_0x9c69[_0x4b69ae];return _0x28bdd3;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x2a49fc){return function(){return client[_0x99c6('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2a49fc,'paused':!![]},'raw':!![]},'log':_0x99c6('0x1')});};}; \ No newline at end of file +var _0x2f5a=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x1df531,_0x346ce0){var _0x345e10=function(_0x51f46e){while(--_0x51f46e){_0x1df531['push'](_0x1df531['shift']());}};_0x345e10(++_0x346ce0);}(_0x2f5a,0x88));var _0xa2f5=function(_0x4e9df2,_0x36818e){_0x4e9df2=_0x4e9df2-0x0;var _0x9fe790=_0x2f5a[_0x4e9df2];return _0x9fe790;};'use strict';var client=require(_0xa2f5('0x0'));exports[_0xa2f5('0x1')]=function(_0x4e535a){return function(){return client[_0xa2f5('0x2')](_0xa2f5('0x3'),{'options':{'where':{'VoiceQueueId':_0x4e535a,'paused':!![]},'raw':!![]},'log':_0xa2f5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 797c234..085cfd2 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(_0x1d9268,_0x3db4c3){var _0x30e101=function(_0x195796){while(--_0x195796){_0x1d9268['push'](_0x1d9268['shift']());}};_0x30e101(++_0x3db4c3);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4dcf9a,_0x9ef022){var _0x1e2e20=function(_0x30f42e){while(--_0x30f42e){_0x4dcf9a['push'](_0x4dcf9a['shift']());}};_0x1e2e20(++_0x9ef022);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index a28ff2b..b1493b8 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 _0x212f=['transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','isexternal','context','extension','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x212f,0x124));var _0xf212=function(_0x2654b5,_0x2e5c7f){_0x2654b5=_0x2654b5-0x0;var _0x1881ee=_0x212f[_0x2654b5];return _0x1881ee;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xf212('0x0')]=function(_0x3936e7){return client[_0xf212('0x1')](_0xf212('0x2'),{'body':{'result':_0x3936e7[_0xf212('0x3')],'transfererchannel':_0x3936e7[_0xf212('0x4')],'transferercalleridnum':_0x3936e7[_0xf212('0x5')],'transferercalleridname':_0x3936e7[_0xf212('0x6')],'transfererconnectedlinenum':_0x3936e7[_0xf212('0x7')],'transfererconnectedlinename':_0x3936e7[_0xf212('0x8')],'transfereraccountcode':_0x3936e7[_0xf212('0x9')],'transferercontext':_0x3936e7[_0xf212('0xa')],'transfererexten':_0x3936e7['transfererexten'],'transfererlinkedid':_0x3936e7[_0xf212('0xb')],'transfereechannel':_0x3936e7[_0xf212('0xc')],'transfereecalleridnum':_0x3936e7[_0xf212('0xd')],'transfereecalleridname':_0x3936e7[_0xf212('0xe')],'transfereeconnectedlinenum':_0x3936e7['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3936e7[_0xf212('0xf')],'transfereeaccountcode':_0x3936e7['transfereeaccountcode'],'transfereecontext':_0x3936e7['transfereecontext'],'transfereeexten':_0x3936e7['transfereeexten'],'transfereelinkedid':_0x3936e7['transfereelinkedid'],'isexternal':_0x3936e7[_0xf212('0x10')],'context':_0x3936e7[_0xf212('0x11')],'extension':_0x3936e7[_0xf212('0x12')],'type':'blind'},'log':_0xf212('0x2')});};exports['attendedTransfer']=function(_0x2bb716){return client['Request'](_0xf212('0x2'),{'body':{'result':_0x2bb716[_0xf212('0x3')],'transfererchannel':_0x2bb716[_0xf212('0x13')],'transferercalleridnum':_0x2bb716['origtransferercalleridnum'],'transferercalleridname':_0x2bb716['origtransferercalleridname'],'transfererconnectedlinenum':_0x2bb716[_0xf212('0x14')],'transfererconnectedlinename':_0x2bb716[_0xf212('0x15')],'transfereraccountcode':_0x2bb716[_0xf212('0x16')],'transferercontext':_0x2bb716['secondtransferercontext'],'transfererexten':_0x2bb716[_0xf212('0x17')],'transfererlinkedid':_0x2bb716[_0xf212('0x18')],'transfereechannel':_0x2bb716['transfertargetchannel'],'transfereecalleridnum':_0x2bb716[_0xf212('0x19')],'transfereecalleridname':_0x2bb716[_0xf212('0x1a')],'transfereeconnectedlinenum':_0x2bb716['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2bb716['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2bb716['transfertargetaccountcode'],'transfereecontext':_0x2bb716[_0xf212('0x1b')],'transfereeexten':_0x2bb716[_0xf212('0x1c')],'transfereelinkedid':_0x2bb716[_0xf212('0x1d')],'isexternal':_0x2bb716[_0xf212('0x10')],'context':_0x2bb716[_0xf212('0x1e')],'extension':_0x2bb716[_0xf212('0x1f')],'type':_0xf212('0x20')},'log':_0xf212('0x2')});}; \ No newline at end of file +var _0xaf33=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x51d23a,_0x36dcb4){var _0x483e79=function(_0x3367c8){while(--_0x3367c8){_0x51d23a['push'](_0x51d23a['shift']());}};_0x483e79(++_0x36dcb4);}(_0xaf33,0x101));var _0x3af3=function(_0x2eb064,_0x5f3392){_0x2eb064=_0x2eb064-0x0;var _0x510281=_0xaf33[_0x2eb064];return _0x510281;};'use strict';var client=require(_0x3af3('0x0'));exports[_0x3af3('0x1')]={};exports[_0x3af3('0x2')]=function(_0x2c7597){return client[_0x3af3('0x3')](_0x3af3('0x4'),{'body':{'result':_0x2c7597[_0x3af3('0x5')],'transfererchannel':_0x2c7597[_0x3af3('0x6')],'transferercalleridnum':_0x2c7597[_0x3af3('0x7')],'transferercalleridname':_0x2c7597[_0x3af3('0x8')],'transfererconnectedlinenum':_0x2c7597[_0x3af3('0x9')],'transfererconnectedlinename':_0x2c7597[_0x3af3('0xa')],'transfereraccountcode':_0x2c7597[_0x3af3('0xb')],'transferercontext':_0x2c7597['transferercontext'],'transfererexten':_0x2c7597[_0x3af3('0xc')],'transfererlinkedid':_0x2c7597[_0x3af3('0xd')],'transfereechannel':_0x2c7597['transfereechannel'],'transfereecalleridnum':_0x2c7597['transfereecalleridnum'],'transfereecalleridname':_0x2c7597['transfereecalleridname'],'transfereeconnectedlinenum':_0x2c7597[_0x3af3('0xe')],'transfereeconnectedlinename':_0x2c7597[_0x3af3('0xf')],'transfereeaccountcode':_0x2c7597[_0x3af3('0x10')],'transfereecontext':_0x2c7597[_0x3af3('0x11')],'transfereeexten':_0x2c7597['transfereeexten'],'transfereelinkedid':_0x2c7597[_0x3af3('0x12')],'isexternal':_0x2c7597[_0x3af3('0x13')],'context':_0x2c7597[_0x3af3('0x14')],'extension':_0x2c7597['extension'],'type':_0x3af3('0x15')},'log':_0x3af3('0x4')});};exports[_0x3af3('0x16')]=function(_0x47871f){return client[_0x3af3('0x3')](_0x3af3('0x4'),{'body':{'result':_0x47871f[_0x3af3('0x5')],'transfererchannel':_0x47871f[_0x3af3('0x17')],'transferercalleridnum':_0x47871f[_0x3af3('0x18')],'transferercalleridname':_0x47871f[_0x3af3('0x19')],'transfererconnectedlinenum':_0x47871f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x47871f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x47871f[_0x3af3('0x1a')],'transferercontext':_0x47871f[_0x3af3('0x1b')],'transfererexten':_0x47871f['secondtransfererexten'],'transfererlinkedid':_0x47871f[_0x3af3('0x1c')],'transfereechannel':_0x47871f[_0x3af3('0x1d')],'transfereecalleridnum':_0x47871f[_0x3af3('0x1e')],'transfereecalleridname':_0x47871f[_0x3af3('0x1f')],'transfereeconnectedlinenum':_0x47871f[_0x3af3('0x20')],'transfereeconnectedlinename':_0x47871f[_0x3af3('0x21')],'transfereeaccountcode':_0x47871f['transfertargetaccountcode'],'transfereecontext':_0x47871f[_0x3af3('0x22')],'transfereeexten':_0x47871f['transfertargetexten'],'transfereelinkedid':_0x47871f['transfertargetlinkedid'],'isexternal':_0x47871f[_0x3af3('0x13')],'context':_0x47871f[_0x3af3('0x23')],'extension':_0x47871f[_0x3af3('0x24')],'type':_0x3af3('0x25')},'log':_0x3af3('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 621b063..ad29941 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 _0xfb65=['SIP','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','username','ami\x20disconnected','pick','keys','module','Reload','Action','then','message','catch','asterisk','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','type','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','undefined','channels','join','validate','map','find','channel','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','wav','status','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','values','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','event','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s'];(function(_0xabe145,_0x2ef96d){var _0x433e19=function(_0x3eca1a){while(--_0x3eca1a){_0xabe145['push'](_0xabe145['shift']());}};_0x433e19(++_0x2ef96d);}(_0xfb65,0x82));var _0x5fb6=function(_0x22823b,_0x419a74){_0x22823b=_0x22823b-0x0;var _0x457832=_0xfb65[_0x22823b];return _0x457832;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var jayson=require(_0x5fb6('0x1'));var schema=require('validate');var BPromise=require(_0x5fb6('0x2'));var moment=require('moment');var config=require(_0x5fb6('0x3'));var properties=require(_0x5fb6('0x4'));var ami=require(_0x5fb6('0x5'));exports[_0x5fb6('0x6')]=function(_0x3a3b1b,_0x1fefe3,_0x4dec8f){return new BPromise(function(_0x50782b,_0x238914){var _0x1b586b={'QueuePause':function(_0x1f99b8){return new Promise(function(_0x840390,_0x56d6e1){var _0x381710=util[_0x5fb6('0x7')](_0x5fb6('0x8'),_0x5fb6('0x9'),_0x1f99b8['name']);if(_0x3a3b1b[_0x5fb6('0xa')]&&_0x3a3b1b[_0x5fb6('0xa')][_0x381710]&&_0x3a3b1b['timers'][_0x381710][_0x5fb6('0xb')]){_0x3a3b1b[_0x5fb6('0xa')][_0x381710][_0x5fb6('0xc')]();}if(_0x3a3b1b[_0x5fb6('0xd')][_0x381710]){_0x3a3b1b[_0x5fb6('0xd')][_0x381710]['updateStatusRealtime']({'statePause':_0x1f99b8[_0x5fb6('0xe')]?!![]:![]});}_0x840390({'code':0xc8,'message':_0x5fb6('0xf')});});},'Reload':function(_0x42285b){var _0x41d503=this;return new Promise(function(_0x6b58a2,_0x1bab1f){if(ami[_0x5fb6('0x10')]()==![]){return _0x1bab1f(_0x41d503[_0x5fb6('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}_0x42285b=_[_0x5fb6('0x14')](_0x42285b,_[_0x5fb6('0x15')](properties[_0x5fb6('0x16')]));_0x42285b['action']=_0x5fb6('0x17');return ami[_0x5fb6('0x18')](_0x42285b)[_0x5fb6('0x19')](function(_0x182af5){_0x6b58a2({'code':0xc8,'message':_0x182af5[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x50bca8){_0x1bab1f(_0x41d503[_0x5fb6('0x11')](0x1f5,_0x50bca8['message']));});});},'Command':function(_0x32f58a){var _0x54c319=this;return new Promise(function(_0x43a252,_0x3ec3b0){if(ami[_0x5fb6('0x10')]()==![]){return _0x3ec3b0(_0x54c319[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x32f58a=_[_0x5fb6('0x14')](_0x32f58a,_0x5fb6('0x1d'));_0x32f58a['action']=_0x5fb6('0x1e');return ami[_0x5fb6('0x18')](_0x32f58a)[_0x5fb6('0x19')](function(_0x36457e){_0x43a252({'code':0xc8,'message':_0x36457e['content']});})[_0x5fb6('0x1b')](function(_0x44aebe){_0x3ec3b0(_0x54c319[_0x5fb6('0x11')](0x1f5,_0x44aebe[_0x5fb6('0x1a')]));});});},'VoiceQueues':function(_0x1b6953){return new Promise(function(_0x1c1b96,_0x4e2bff){var _0x4cbdaf=[];for(var _0x298b44 in _0x3a3b1b[_0x5fb6('0x1f')]){if(_0x3a3b1b[_0x5fb6('0x1f')][_0x5fb6('0x20')](_0x298b44)){var _0x2731a3=_0x3a3b1b[_0x5fb6('0x1f')][_0x298b44];var _0x36ac58={'id':_0x2731a3['id'],'name':_0x2731a3['name'],'strategy':_0x2731a3[_0x5fb6('0x21')],'answered':_0x2731a3[_0x5fb6('0x22')],'available':_0x2731a3[_0x5fb6('0x23')],'loggedIn':_0x2731a3['loggedIn'],'pTalking':_0x2731a3[_0x5fb6('0x24')],'sumBillable':_0x2731a3[_0x5fb6('0x25')],'sumDuration':_0x2731a3['sumDuration'],'sumHoldTime':_0x2731a3[_0x5fb6('0x26')]||0x0,'talking':_0x2731a3[_0x5fb6('0x27')],'total':_0x2731a3['total'],'type':_0x2731a3[_0x5fb6('0x28')],'unmanaged':_0x2731a3['unmanaged'],'abandoned':_0x2731a3[_0x5fb6('0x29')],'waiting':_0x2731a3['waiting'],'loggedInDb':_0x2731a3['loggedInDb']};if(_0x2731a3[_0x5fb6('0x28')]===_0x5fb6('0x2a')){_0x36ac58[_0x5fb6('0x2b')]=_0x2731a3[_0x5fb6('0x2b')];_0x36ac58[_0x5fb6('0x2c')]=_0x2731a3[_0x5fb6('0x2c')];_0x36ac58['dialOriginateCallerIdName']=_0x2731a3[_0x5fb6('0x2d')];_0x36ac58[_0x5fb6('0x2e')]=_0x2731a3[_0x5fb6('0x2e')];_0x36ac58[_0x5fb6('0x2f')]=_0x2731a3[_0x5fb6('0x2f')];_0x36ac58[_0x5fb6('0x30')]=_0x2731a3[_0x5fb6('0x30')];_0x36ac58[_0x5fb6('0x31')]=_0x2731a3[_0x5fb6('0x31')];_0x36ac58[_0x5fb6('0x32')]=_0x2731a3[_0x5fb6('0x32')];_0x36ac58['outboundAnswerCallsDay']=_0x2731a3[_0x5fb6('0x33')];_0x36ac58[_0x5fb6('0x34')]=_0x2731a3['outboundBlacklistCallsDay'];_0x36ac58[_0x5fb6('0x35')]=_0x2731a3['outboundBusyCallsDay'];_0x36ac58['outboundCongestionCallsDay']=_0x2731a3[_0x5fb6('0x36')];_0x36ac58[_0x5fb6('0x37')]=_0x2731a3[_0x5fb6('0x37')];_0x36ac58['outboundDropCallsDayCallersExit']=_0x2731a3[_0x5fb6('0x38')];_0x36ac58['outboundDropCallsDayTimeout']=_0x2731a3['outboundDropCallsDayTimeout'];_0x36ac58[_0x5fb6('0x39')]=_0x2731a3[_0x5fb6('0x39')];_0x36ac58[_0x5fb6('0x3a')]=_0x2731a3[_0x5fb6('0x3a')];_0x36ac58[_0x5fb6('0x3b')]=_0x2731a3[_0x5fb6('0x3b')];_0x36ac58[_0x5fb6('0x3c')]=_0x2731a3[_0x5fb6('0x3c')];_0x36ac58[_0x5fb6('0x3d')]=_0x2731a3[_0x5fb6('0x3d')];_0x36ac58[_0x5fb6('0x3e')]=_0x2731a3[_0x5fb6('0x3e')];_0x36ac58['predictiveIntervalAnsweredCalls']=_0x2731a3[_0x5fb6('0x3f')];_0x36ac58[_0x5fb6('0x40')]=_0x2731a3[_0x5fb6('0x40')];_0x36ac58['predictiveIntervalAvgTalktime']=_0x2731a3[_0x5fb6('0x41')];_0x36ac58['predictiveIntervalDroppedCallsCallersExit']=_0x2731a3[_0x5fb6('0x42')];_0x36ac58['predictiveIntervalDroppedCallsTimeout']=_0x2731a3[_0x5fb6('0x43')];_0x36ac58[_0x5fb6('0x44')]=_0x2731a3[_0x5fb6('0x44')];_0x36ac58[_0x5fb6('0x45')]=_0x2731a3[_0x5fb6('0x45')];_0x36ac58['predictiveIntervalHitRate']=_0x2731a3[_0x5fb6('0x46')];_0x36ac58[_0x5fb6('0x47')]=_0x2731a3[_0x5fb6('0x47')];_0x36ac58[_0x5fb6('0x48')]=_0x2731a3['predictiveIntervalPauses'];_0x36ac58[_0x5fb6('0x49')]=_0x2731a3[_0x5fb6('0x49')];_0x36ac58[_0x5fb6('0x4a')]=_0x2731a3[_0x5fb6('0x4a')];_0x36ac58[_0x5fb6('0x1a')]=_0x2731a3[_0x5fb6('0x1a')];_0x36ac58['originated']=_0x2731a3[_0x5fb6('0x4b')];_0x36ac58[_0x5fb6('0x4c')]=_0x2731a3[_0x5fb6('0x4c')];_0x36ac58[_0x5fb6('0x4d')]=_0x2731a3[_0x5fb6('0x4d')];_0x36ac58[_0x5fb6('0x4e')]=_0x2731a3[_0x5fb6('0x4e')];_0x36ac58[_0x5fb6('0x4f')]=_0x2731a3[_0x5fb6('0x4f')];_0x36ac58[_0x5fb6('0x50')]=_0x2731a3[_0x5fb6('0x50')];_0x36ac58['startProgressive']=_0x2731a3[_0x5fb6('0x51')];}if(_0x2731a3['Trunk']){_0x36ac58[_0x5fb6('0x52')]={'id':_0x2731a3[_0x5fb6('0x52')]['id'],'name':_0x2731a3['Trunk'][_0x5fb6('0x53')],'active':_0x2731a3[_0x5fb6('0x52')][_0x5fb6('0x54')],'callerid':_0x2731a3['Trunk']['callerid']};}if(_0x2731a3[_0x5fb6('0x55')]){_0x36ac58[_0x5fb6('0x55')]={'id':_0x2731a3[_0x5fb6('0x55')]['id'],'name':_0x2731a3[_0x5fb6('0x55')][_0x5fb6('0x53')]};}_0x4cbdaf[_0x5fb6('0x56')](_0x36ac58);}}_0x1c1b96({'count':_0x4cbdaf[_0x5fb6('0x57')],'rows':_0x4cbdaf});});},'UpdateVoiceQueue':function(_0x3fe007){return new Promise(function(_0x29ac9f,_0x1cd003){var _0xb32da8=_['find'](_0x3a3b1b[_0x5fb6('0x1f')],{'id':parseInt(_0x3fe007['id'])});var _0x5513dd=_['omit'](_0x3fe007,['id']);if(_0xb32da8){for(var _0x2d8b10 in _0x5513dd){if(typeof _0x5513dd[_0x2d8b10]!==_0x5fb6('0x58')&&typeof _0xb32da8[_0x2d8b10]!==_0x5fb6('0x58')){_0xb32da8[_0x2d8b10]=_0x5513dd[_0x2d8b10];}}_0x29ac9f(_0xb32da8);}else{_0x1cd003();}});},'VoiceChannels':function(_0x2a751e){return new Promise(function(_0x45b244,_0x19f7da){var _0x45ba31=_['values'](_0x3a3b1b[_0x5fb6('0x59')]);_0x45b244({'count':_0x45ba31[_0x5fb6('0x57')],'rows':_0x45ba31});});},'VoiceChannelMixMonitor':function(_0x59c923){var _0x1f5a28=this;return new Promise(function(_0x7934fd,_0x1d6188){if(ami[_0x5fb6('0x10')]()==![]){return _0x1d6188(_0x1f5a28[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],'ami\x20disconnected'][_0x5fb6('0x5a')]('\x20')));}var _0xef30cc=schema(properties['voicechannel'])[_0x5fb6('0x5b')](_0x59c923);if(_0xef30cc[_0x5fb6('0x57')]>0x0){return _0x1d6188(_0x1f5a28[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0xef30cc,'message')['join'](',\x20')));}var _0xd287ab=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x59')],{'uniqueid':_0x59c923['uniqueid']});if(_0xd287ab&&_0xd287ab[_0x5fb6('0x5e')]){var _0x5b429d=util[_0x5fb6('0x7')]('%s.%s',_0x59c923[_0x5fb6('0x5f')]||_0x59c923[_0x5fb6('0x60')],_0x59c923[_0x5fb6('0x7')]||'wav');return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x61'),'channel':_0xd287ab[_0x5fb6('0x5e')],'file':_0x5b429d,'options':_0x5fb6('0x62')})[_0x5fb6('0x19')](function(_0x39b672){var _0x108622=_[_0x5fb6('0x5d')](_0xd287ab[_0x5fb6('0x63')],{'filename':_0x5fb6('0x64')+_0x5b429d[_0x5fb6('0x65')]()});if(_['isNil'](_0x108622)){_0xd287ab[_0x5fb6('0x63')]['push']({'filename':_0x5fb6('0x64')+_0x5b429d[_0x5fb6('0x65')](),'createdAt':moment()[_0x5fb6('0x7')](_0x5fb6('0x66')),'mixmonitorid':_0x39b672[_0x5fb6('0x67')],'status':_0x5fb6('0x68')});}else{_0x108622['mixmonitorid']=_0x39b672['mixmonitorid'];_0x108622['status']='rec';}_0x7934fd({'code':0xc8,'message':[_0x59c923[_0x5fb6('0x60')],_0x5fb6('0x69'),_0x39b672[_0x5fb6('0x67')]][_0x5fb6('0x5a')]('\x20'),'mixmonitorid':_0x39b672['mixmonitorid']});})[_0x5fb6('0x1b')](function(_0x17451b){_0x1d6188(_0x1f5a28['error'](0x1f5,[_0x59c923[_0x5fb6('0x60')],_0x17451b['message'][_0x5fb6('0x65')]()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x1d6188(_0x1f5a28['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x43919b){var _0x1b9bd8=this;return new Promise(function(_0x4da260,_0x300225){if(ami[_0x5fb6('0x10')]()==![]){return _0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}var _0x39ff48=schema(properties[_0x5fb6('0x6b')])[_0x5fb6('0x5b')](_0x43919b);if(_0x39ff48[_0x5fb6('0x57')]>0x0){return _0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x39ff48,'message')[_0x5fb6('0x5a')](',\x20')));}var _0x4e6aaf=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x59')],{'uniqueid':_0x43919b[_0x5fb6('0x60')]});if(_0x4e6aaf){return BPromise[_0x5fb6('0x6c')]()[_0x5fb6('0x19')](function(){if(_0x4e6aaf[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x6d'),'channel':_0x4e6aaf['channel'],'mixmonitorid':_0x43919b['mixmonitorid']})[_0x5fb6('0x1b')](function(_0x3f6762){});}})[_0x5fb6('0x19')](function(){if(_0x4e6aaf[_0x5fb6('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4e6aaf[_0x5fb6('0x6e')],'mixmonitorid':_0x43919b['mixmonitorid']})['catch'](function(_0x3038d1){});}})[_0x5fb6('0x19')](function(_0x236d8b){var _0x186744=_[_0x5fb6('0x5d')](_0x4e6aaf['monitors'],{'mixmonitorid':_0x43919b[_0x5fb6('0x67')]});if(_0x186744){_0x186744['status']=_0x5fb6('0x6f');}})[_0x5fb6('0x19')](function(){var _0x5484e0=util[_0x5fb6('0x7')](_0x5fb6('0x70'),_0x43919b[_0x5fb6('0x5f')]||_0x43919b['uniqueid'],_0x43919b[_0x5fb6('0x7')]||_0x5fb6('0x71'));var _0x3c9a55=_['find'](_0x4e6aaf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x5484e0[_0x5fb6('0x65')]()});if(_0x3c9a55){_0x3c9a55[_0x5fb6('0x72')]=_0x5fb6('0x6f');}})[_0x5fb6('0x19')](function(){_0x4da260({'code':0xc8,'message':[_0x43919b[_0x5fb6('0x60')],_0x5fb6('0x73')][_0x5fb6('0x5a')]('\x20')});})['catch'](function(_0x3c4a38){_0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f5,[_0x43919b[_0x5fb6('0x60')],_0x3c4a38[_0x5fb6('0x1a')][_0x5fb6('0x65')]()]['join']('\x20')));});}else{return _0x300225(_0x1b9bd8['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceQueuesChannels':function(_0x547006){return new Promise(function(_0x5cda26,_0x360170){var _0x539301=_['values'](_0x3a3b1b['queueChannels']);_0x5cda26({'count':_0x539301[_0x5fb6('0x57')],'rows':_0x539301});});},'VoiceQueuesChannel':function(_0x5b95b2){var _0x11ec8a=this;return new Promise(function(_0x39e103,_0x284e09){var _0x28eecc=schema(properties[_0x5fb6('0x74')])[_0x5fb6('0x5b')](_0x5b95b2);if(_0x28eecc[_0x5fb6('0x57')]>0x0){return _0x284e09(_0x11ec8a[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x28eecc,_0x5fb6('0x1a'))[_0x5fb6('0x5a')](',\x20')));}var _0x26dc0e=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x75')],{'uniqueid':_0x5b95b2[_0x5fb6('0x60')]});if(_0x26dc0e){_0x39e103(_0x26dc0e);}else{return _0x284e09(_0x11ec8a[_0x5fb6('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x5af783){var _0x377d13=this;return new Promise(function(_0x55d588,_0x5afa87){if(ami[_0x5fb6('0x10')]()==![]){return _0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}var _0x3ce1ad=schema(properties[_0x5fb6('0x76')])[_0x5fb6('0x5b')](_0x5af783);if(_0x3ce1ad[_0x5fb6('0x57')]>0x0){return _0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f4,_['map'](_0x3ce1ad,'message')['join'](',\x20')));}var _0x170358=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x75')],{'uniqueid':_0x5af783[_0x5fb6('0x60')]});if(_0x170358&&_0x170358[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x77'),'channel':_0x170358[_0x5fb6('0x5e')]})[_0x5fb6('0x19')](function(_0x25b4c2){_0x55d588({'code':0xc8,'message':[_0x5af783[_0x5fb6('0x60')],_0x25b4c2['message']['toLowerCase']()]['join']('\x20')});})[_0x5fb6('0x1b')](function(_0xf96e9f){_0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f5,[_0x5af783[_0x5fb6('0x60')],_0xf96e9f[_0x5fb6('0x1a')]['toLowerCase']()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x5afa87(_0x377d13['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x1d5642){var _0x5ebaf6=this;return new Promise(function(_0x151343,_0x5a66f7){if(ami[_0x5fb6('0x10')]()==![]){return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')]['username'],_0x5fb6('0x13')][_0x5fb6('0x5a')]('\x20')));}var _0x34a69a=schema(properties[_0x5fb6('0x78')])[_0x5fb6('0x5b')](_0x1d5642);if(_0x34a69a[_0x5fb6('0x57')]>0x0){return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x34a69a,_0x5fb6('0x1a'))[_0x5fb6('0x5a')](',\x20')));}var _0x2809a2=_[_0x5fb6('0x5d')](_0x3a3b1b['queueChannels'],{'uniqueid':_0x1d5642[_0x5fb6('0x60')]});if(_0x2809a2&&_0x2809a2[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x79'),'channel':_0x2809a2[_0x5fb6('0x5e')],'exten':_0x1d5642['exten'],'context':_0x1d5642[_0x5fb6('0x7a')]||_0x2809a2['context'],'priority':0x1})['then'](function(_0x55b06e){_0x151343({'code':0xc8,'message':[_0x1d5642[_0x5fb6('0x60')],_0x55b06e[_0x5fb6('0x1a')][_0x5fb6('0x65')]()]['join']('\x20')});})[_0x5fb6('0x1b')](function(_0x5793c8){_0x5a66f7(_0x5ebaf6['error'](0x1f5,[_0x1d5642[_0x5fb6('0x60')],_0x5793c8[_0x5fb6('0x1a')][_0x5fb6('0x65')]()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f5,_0x5fb6('0x6a')));}});},'Agents':function(_0x198e9e){return new Promise(function(_0x469bfb,_0xbbeca5){var _0x24cc41=_['values'](_0x3a3b1b['agents']);_0x469bfb({'count':_0x24cc41[_0x5fb6('0x57')],'rows':_0x24cc41});});},'Telephones':function(_0x817cec){return new Promise(function(_0x1fc37b,_0x419159){var _0x15b8f3=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7c')]);_0x1fc37b({'count':_0x15b8f3[_0x5fb6('0x57')],'rows':_0x15b8f3});});},'Trunks':function(_0xfc13a5){return new Promise(function(_0x2eda7e,_0x2789d0){var _0x2407d0=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7d')]);_0x2eda7e({'count':_0x2407d0[_0x5fb6('0x57')],'rows':_0x2407d0});});},'OutboundChannels':function(_0x498b66){return new Promise(function(_0x4dd7af,_0x4c2682){var _0xacdd1b=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7e')]);_0x4dd7af({'count':_0xacdd1b[_0x5fb6('0x57')],'rows':_0xacdd1b});});},'Outbound':function(_0x4d6017){return new Promise(function(_0x4b1f02,_0x1b4f87){_0x4b1f02(_0x3a3b1b[_0x5fb6('0x2a')]);});},'Campaigns':function(_0x4bb44e){return new Promise(function(_0xc4635a,_0x12e012){var _0x1b15ae=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7f')]);_0xc4635a({'count':_0x1b15ae[_0x5fb6('0x57')],'rows':_0x1b15ae});});},'VoiceQueuesPreview':function(_0x39e7f6){var _0x421ecf=this;return new Promise(function(_0xe1df32,_0x5057f4){_0x1fefe3[_0x5fb6('0x80')](_0x39e7f6['id'])[_0x5fb6('0x19')](function(_0x53d3c6){_0xe1df32({'code':0xc8,'message':_0x53d3c6[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x21591b){_0x5057f4(_0x421ecf[_0x5fb6('0x11')](0x1f4,_0x21591b[_0x5fb6('0x1a')]));});});},'EventManager':function(_0x29a18d){var _0x3181f1=this;return new Promise(function(_0x1c184c,_0x4f7c71){if(!_0x29a18d['event']){return _0x4f7c71(_0x3181f1[_0x5fb6('0x11')](0x1f4,_0x5fb6('0x81')));}ami[_0x5fb6('0x82')]('custom:'+_0x29a18d[_0x5fb6('0x83')],_0x29a18d[_0x5fb6('0x1a')]);_0x1c184c({'code':0xc8,'message':_0x29a18d});});},'FaxAccounts':function(_0x402a3c){return new Promise(function(_0x48459d,_0x1536c2){var _0x1d1416=_['values'](_0x3a3b1b['faxAccounts']);_0x48459d({'count':_0x1d1416[_0x5fb6('0x57')],'rows':_0x1d1416});});},'SendFax':function(_0x8c4c3){var _0x5a585f=this;return new Promise(function(_0x4610bb,_0x1cab91){_0x4dec8f[_0x5fb6('0x84')](_0x8c4c3)['then'](function(_0x595f06){_0x4610bb({'code':0xc8,'message':_0x595f06[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x3ee340){_0x1cab91(_0x5a585f[_0x5fb6('0x11')](0x1f4,_0x3ee340[_0x5fb6('0x1a')]));});});},'CheckAfterSend':function(_0x21a67a){var _0x127787=this;return new Promise(function(_0x1bed3c,_0x50513a){_0x4dec8f[_0x5fb6('0x85')](_0x21a67a)[_0x5fb6('0x19')](function(_0x401efd){_0x1bed3c({'code':0xc8,'message':_0x401efd[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x4582cc){_0x50513a(_0x127787['error'](0x1f4,_0x4582cc[_0x5fb6('0x1a')]));});});}};var _0x5e91c2=jayson[_0x5fb6('0x86')](_0x1b586b)[_0x5fb6('0x87')]();_0x5e91c2['on'](_0x5fb6('0x11'),function(_0x4d8c54){return _0x238914(_0x4d8c54);});_0x5e91c2[_0x5fb6('0x6')](0x232a,_0x5fb6('0x88'),function(){console['log'](_0x5fb6('0x89'),0x232a);return _0x50782b(_0x5fb6('0x8a')+0x232a);});});}; \ No newline at end of file +var _0xc1c6=['module','action','Action','then','message','command','Command','content','catch','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','undefined','channels','validate','uniqueid','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','toLowerCase','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick'];(function(_0x545b28,_0x3cc402){var _0x108ec9=function(_0x5aec90){while(--_0x5aec90){_0x545b28['push'](_0x545b28['shift']());}};_0x108ec9(++_0x3cc402);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x221bb0,_0x38bfa1){_0x221bb0=_0x221bb0-0x0;var _0x6e47c0=_0xc1c6[_0x221bb0];return _0x6e47c0;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var jayson=require(_0x6c1c('0x2'));var schema=require('validate');var BPromise=require(_0x6c1c('0x3'));var moment=require('moment');var config=require(_0x6c1c('0x4'));var properties=require(_0x6c1c('0x5'));var ami=require(_0x6c1c('0x6'));exports['listen']=function(_0x56ed6f,_0x32af84,_0x524a6b){return new BPromise(function(_0x50c1bb,_0x582bec){var _0xe510ca={'QueuePause':function(_0x2eb1ba){return new Promise(function(_0x38369d,_0x2cec58){var _0x4b66ec=util[_0x6c1c('0x7')](_0x6c1c('0x8'),'SIP',_0x2eb1ba[_0x6c1c('0x9')]);if(_0x56ed6f[_0x6c1c('0xa')]&&_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec]&&_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec]['timer']){_0x56ed6f[_0x6c1c('0xa')][_0x4b66ec][_0x6c1c('0xb')]();}if(_0x56ed6f[_0x6c1c('0xc')][_0x4b66ec]){_0x56ed6f['agents'][_0x4b66ec][_0x6c1c('0xd')]({'statePause':_0x2eb1ba[_0x6c1c('0xe')]?!![]:![]});}_0x38369d({'code':0xc8,'message':_0x6c1c('0xf')});});},'Reload':function(_0x49304f){var _0x2e82e9=this;return new Promise(function(_0x5e64b7,_0x357370){if(ami[_0x6c1c('0x10')]()==![]){return _0x357370(_0x2e82e9[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}_0x49304f=_[_0x6c1c('0x16')](_0x49304f,_['keys'](properties[_0x6c1c('0x17')]));_0x49304f[_0x6c1c('0x18')]='Reload';return ami[_0x6c1c('0x19')](_0x49304f)[_0x6c1c('0x1a')](function(_0x494ffc){_0x5e64b7({'code':0xc8,'message':_0x494ffc[_0x6c1c('0x1b')]});})['catch'](function(_0x338dc2){_0x357370(_0x2e82e9[_0x6c1c('0x11')](0x1f5,_0x338dc2['message']));});});},'Command':function(_0xa667eb){var _0x59ab38=this;return new Promise(function(_0x2db60e,_0x3527bf){if(ami[_0x6c1c('0x10')]()==![]){return _0x3527bf(_0x59ab38[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}_0xa667eb=_[_0x6c1c('0x16')](_0xa667eb,_0x6c1c('0x1c'));_0xa667eb[_0x6c1c('0x18')]=_0x6c1c('0x1d');return ami[_0x6c1c('0x19')](_0xa667eb)[_0x6c1c('0x1a')](function(_0x19c269){_0x2db60e({'code':0xc8,'message':_0x19c269[_0x6c1c('0x1e')]});})[_0x6c1c('0x1f')](function(_0x3a3f13){_0x3527bf(_0x59ab38[_0x6c1c('0x11')](0x1f5,_0x3a3f13[_0x6c1c('0x1b')]));});});},'VoiceQueues':function(_0x3f517e){return new Promise(function(_0x2ef382,_0x7ff10d){var _0x18452d=[];for(var _0x80bc05 in _0x56ed6f[_0x6c1c('0x20')]){if(_0x56ed6f[_0x6c1c('0x20')][_0x6c1c('0x21')](_0x80bc05)){var _0x5f4568=_0x56ed6f[_0x6c1c('0x20')][_0x80bc05];var _0x4d73aa={'id':_0x5f4568['id'],'name':_0x5f4568[_0x6c1c('0x9')],'strategy':_0x5f4568['strategy'],'answered':_0x5f4568[_0x6c1c('0x22')],'available':_0x5f4568['available'],'loggedIn':_0x5f4568[_0x6c1c('0x23')],'pTalking':_0x5f4568[_0x6c1c('0x24')],'sumBillable':_0x5f4568['sumBillable'],'sumDuration':_0x5f4568[_0x6c1c('0x25')],'sumHoldTime':_0x5f4568[_0x6c1c('0x26')]||0x0,'talking':_0x5f4568['talking'],'total':_0x5f4568[_0x6c1c('0x27')],'type':_0x5f4568[_0x6c1c('0x28')],'unmanaged':_0x5f4568[_0x6c1c('0x29')],'abandoned':_0x5f4568[_0x6c1c('0x2a')],'waiting':_0x5f4568['waiting'],'loggedInDb':_0x5f4568['loggedInDb']};if(_0x5f4568[_0x6c1c('0x28')]===_0x6c1c('0x2b')){_0x4d73aa[_0x6c1c('0x2c')]=_0x5f4568[_0x6c1c('0x2c')];_0x4d73aa[_0x6c1c('0x2d')]=_0x5f4568[_0x6c1c('0x2d')];_0x4d73aa['dialOriginateCallerIdName']=_0x5f4568[_0x6c1c('0x2e')];_0x4d73aa[_0x6c1c('0x2f')]=_0x5f4568['dialOriginateCallerIdNumber'];_0x4d73aa[_0x6c1c('0x30')]=_0x5f4568[_0x6c1c('0x30')];_0x4d73aa[_0x6c1c('0x31')]=_0x5f4568[_0x6c1c('0x31')];_0x4d73aa['temp']=_0x5f4568[_0x6c1c('0x32')];_0x4d73aa[_0x6c1c('0x33')]=_0x5f4568[_0x6c1c('0x33')];_0x4d73aa['outboundAnswerCallsDay']=_0x5f4568[_0x6c1c('0x34')];_0x4d73aa['outboundBlacklistCallsDay']=_0x5f4568[_0x6c1c('0x35')];_0x4d73aa['outboundBusyCallsDay']=_0x5f4568[_0x6c1c('0x36')];_0x4d73aa[_0x6c1c('0x37')]=_0x5f4568[_0x6c1c('0x37')];_0x4d73aa['outboundDropCallsDayACS']=_0x5f4568['outboundDropCallsDayACS'];_0x4d73aa[_0x6c1c('0x38')]=_0x5f4568[_0x6c1c('0x38')];_0x4d73aa[_0x6c1c('0x39')]=_0x5f4568['outboundDropCallsDayTimeout'];_0x4d73aa[_0x6c1c('0x3a')]=_0x5f4568['outboundNoAnswerCallsDay'];_0x4d73aa['outboundNoSuchCallsDay']=_0x5f4568[_0x6c1c('0x3b')];_0x4d73aa[_0x6c1c('0x3c')]=_0x5f4568[_0x6c1c('0x3c')];_0x4d73aa[_0x6c1c('0x3d')]=_0x5f4568['outboundReCallsDay'];_0x4d73aa[_0x6c1c('0x3e')]=_0x5f4568[_0x6c1c('0x3e')];_0x4d73aa[_0x6c1c('0x3f')]=_0x5f4568[_0x6c1c('0x3f')];_0x4d73aa[_0x6c1c('0x40')]=_0x5f4568[_0x6c1c('0x40')];_0x4d73aa[_0x6c1c('0x41')]=_0x5f4568[_0x6c1c('0x41')];_0x4d73aa[_0x6c1c('0x42')]=_0x5f4568[_0x6c1c('0x42')];_0x4d73aa['predictiveIntervalDroppedCallsCallersExit']=_0x5f4568[_0x6c1c('0x43')];_0x4d73aa[_0x6c1c('0x44')]=_0x5f4568[_0x6c1c('0x44')];_0x4d73aa[_0x6c1c('0x45')]=_0x5f4568[_0x6c1c('0x45')];_0x4d73aa['predictiveIntervalErlangCallsDroppedCalls']=_0x5f4568['predictiveIntervalErlangCallsDroppedCalls'];_0x4d73aa['predictiveIntervalHitRate']=_0x5f4568[_0x6c1c('0x46')];_0x4d73aa['predictiveIntervalMultiplicativeFactor']=_0x5f4568['predictiveIntervalMultiplicativeFactor'];_0x4d73aa[_0x6c1c('0x47')]=_0x5f4568[_0x6c1c('0x47')];_0x4d73aa['predictiveIntervalAvailable']=_0x5f4568[_0x6c1c('0x48')];_0x4d73aa[_0x6c1c('0x49')]=_0x5f4568[_0x6c1c('0x49')];_0x4d73aa['message']=_0x5f4568[_0x6c1c('0x1b')];_0x4d73aa[_0x6c1c('0x4a')]=_0x5f4568['originated'];_0x4d73aa[_0x6c1c('0x4b')]=_0x5f4568['erlangCalls'];_0x4d73aa[_0x6c1c('0x4c')]=_0x5f4568[_0x6c1c('0x4c')];_0x4d73aa[_0x6c1c('0x4d')]=_0x5f4568[_0x6c1c('0x4d')];_0x4d73aa[_0x6c1c('0x4e')]=_0x5f4568['erlangBusyFactor'];_0x4d73aa[_0x6c1c('0x4f')]=_0x5f4568[_0x6c1c('0x4f')];_0x4d73aa[_0x6c1c('0x50')]=_0x5f4568['startProgressive'];}if(_0x5f4568[_0x6c1c('0x51')]){_0x4d73aa[_0x6c1c('0x51')]={'id':_0x5f4568[_0x6c1c('0x51')]['id'],'name':_0x5f4568[_0x6c1c('0x51')][_0x6c1c('0x9')],'active':_0x5f4568['Trunk'][_0x6c1c('0x52')],'callerid':_0x5f4568['Trunk']['callerid']};}if(_0x5f4568['Interval']){_0x4d73aa[_0x6c1c('0x53')]={'id':_0x5f4568[_0x6c1c('0x53')]['id'],'name':_0x5f4568[_0x6c1c('0x53')][_0x6c1c('0x9')]};}_0x18452d[_0x6c1c('0x54')](_0x4d73aa);}}_0x2ef382({'count':_0x18452d[_0x6c1c('0x55')],'rows':_0x18452d});});},'UpdateVoiceQueue':function(_0x260363){return new Promise(function(_0x167f3b,_0x5ed2d7){var _0x1aae67=_[_0x6c1c('0x56')](_0x56ed6f['voiceQueues'],{'id':parseInt(_0x260363['id'])});var _0x2b4706=_['omit'](_0x260363,['id']);if(_0x1aae67){for(var _0x39e741 in _0x2b4706){if(typeof _0x2b4706[_0x39e741]!==_0x6c1c('0x57')&&typeof _0x1aae67[_0x39e741]!==_0x6c1c('0x57')){_0x1aae67[_0x39e741]=_0x2b4706[_0x39e741];}}_0x167f3b(_0x1aae67);}else{_0x5ed2d7();}});},'VoiceChannels':function(_0x1dd47a){return new Promise(function(_0x261c89,_0x5ea4af){var _0x1fe6e8=_['values'](_0x56ed6f[_0x6c1c('0x58')]);_0x261c89({'count':_0x1fe6e8[_0x6c1c('0x55')],'rows':_0x1fe6e8});});},'VoiceChannelMixMonitor':function(_0x2f6ce0){var _0xa06377=this;return new Promise(function(_0x8d614,_0x26cf7f){if(ami['isConnected']()==![]){return _0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f4,[config[_0x6c1c('0x12')]['ip'],config['asterisk'][_0x6c1c('0x13')],_0x6c1c('0x14')][_0x6c1c('0x15')]('\x20')));}var _0x22be7c=schema(properties['voicechannel'])[_0x6c1c('0x59')](_0x2f6ce0);if(_0x22be7c[_0x6c1c('0x55')]>0x0){return _0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f4,_['map'](_0x22be7c,'message')['join'](',\x20')));}var _0x5714a6=_['find'](_0x56ed6f[_0x6c1c('0x58')],{'uniqueid':_0x2f6ce0[_0x6c1c('0x5a')]});if(_0x5714a6&&_0x5714a6['channel']){var _0x3ab1af=util[_0x6c1c('0x7')](_0x6c1c('0x5b'),_0x2f6ce0['filename']||_0x2f6ce0['uniqueid'],_0x2f6ce0[_0x6c1c('0x7')]||_0x6c1c('0x5c'));return ami['Action']({'action':_0x6c1c('0x5d'),'channel':_0x5714a6[_0x6c1c('0x5e')],'file':_0x3ab1af,'options':_0x6c1c('0x5f')})[_0x6c1c('0x1a')](function(_0x1f4e95){var _0xc30dde=_['find'](_0x5714a6[_0x6c1c('0x60')],{'filename':_0x6c1c('0x61')+_0x3ab1af['toLowerCase']()});if(_['isNil'](_0xc30dde)){_0x5714a6[_0x6c1c('0x60')][_0x6c1c('0x54')]({'filename':_0x6c1c('0x61')+_0x3ab1af['toLowerCase'](),'createdAt':moment()[_0x6c1c('0x7')](_0x6c1c('0x62')),'mixmonitorid':_0x1f4e95[_0x6c1c('0x63')],'status':_0x6c1c('0x64')});}else{_0xc30dde['mixmonitorid']=_0x1f4e95['mixmonitorid'];_0xc30dde[_0x6c1c('0x65')]=_0x6c1c('0x64');}_0x8d614({'code':0xc8,'message':[_0x2f6ce0[_0x6c1c('0x5a')],'MixMonitor\x20Success',_0x1f4e95['mixmonitorid']][_0x6c1c('0x15')]('\x20'),'mixmonitorid':_0x1f4e95[_0x6c1c('0x63')]});})['catch'](function(_0x2a334b){_0x26cf7f(_0xa06377[_0x6c1c('0x11')](0x1f5,[_0x2f6ce0[_0x6c1c('0x5a')],_0x2a334b[_0x6c1c('0x1b')][_0x6c1c('0x66')]()][_0x6c1c('0x15')]('\x20')));});}else{return _0x26cf7f(_0xa06377['error'](0x1f5,_0x6c1c('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x5a2692){var _0x103fe1=this;return new Promise(function(_0x1930ea,_0x117240){if(ami[_0x6c1c('0x10')]()==![]){return _0x117240(_0x103fe1['error'](0x1f4,[config['asterisk']['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],_0x6c1c('0x14')]['join']('\x20')));}var _0x3273e0=schema(properties[_0x6c1c('0x68')])[_0x6c1c('0x59')](_0x5a2692);if(_0x3273e0[_0x6c1c('0x55')]>0x0){return _0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x3273e0,_0x6c1c('0x1b'))['join'](',\x20')));}var _0x268fec=_['find'](_0x56ed6f[_0x6c1c('0x58')],{'uniqueid':_0x5a2692[_0x6c1c('0x5a')]});if(_0x268fec){return BPromise[_0x6c1c('0x6a')]()[_0x6c1c('0x1a')](function(){if(_0x268fec['channel']){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x6b'),'channel':_0x268fec[_0x6c1c('0x5e')],'mixmonitorid':_0x5a2692[_0x6c1c('0x63')]})[_0x6c1c('0x1f')](function(_0x475c3b){});}})[_0x6c1c('0x1a')](function(){if(_0x268fec[_0x6c1c('0x6c')]){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x6b'),'channel':_0x268fec[_0x6c1c('0x6c')],'mixmonitorid':_0x5a2692['mixmonitorid']})[_0x6c1c('0x1f')](function(_0x6b05c7){});}})[_0x6c1c('0x1a')](function(_0x321997){var _0x441648=_['find'](_0x268fec[_0x6c1c('0x60')],{'mixmonitorid':_0x5a2692[_0x6c1c('0x63')]});if(_0x441648){_0x441648['status']=_0x6c1c('0x6d');}})[_0x6c1c('0x1a')](function(){var _0x1b59bf=util['format'](_0x6c1c('0x5b'),_0x5a2692[_0x6c1c('0x6e')]||_0x5a2692[_0x6c1c('0x5a')],_0x5a2692[_0x6c1c('0x7')]||_0x6c1c('0x5c'));var _0x374b22=_['find'](_0x268fec['monitors'],{'filename':_0x6c1c('0x61')+_0x1b59bf[_0x6c1c('0x66')]()});if(_0x374b22){_0x374b22['status']='stop';}})['then'](function(){_0x1930ea({'code':0xc8,'message':[_0x5a2692[_0x6c1c('0x5a')],_0x6c1c('0x6f')][_0x6c1c('0x15')]('\x20')});})[_0x6c1c('0x1f')](function(_0x585d6d){_0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f5,[_0x5a2692['uniqueid'],_0x585d6d['message']['toLowerCase']()][_0x6c1c('0x15')]('\x20')));});}else{return _0x117240(_0x103fe1[_0x6c1c('0x11')](0x1f5,_0x6c1c('0x67')));}});},'VoiceQueuesChannels':function(_0x42ae1b){return new Promise(function(_0x10bfb4,_0x376074){var _0x4e8b8a=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x71')]);_0x10bfb4({'count':_0x4e8b8a[_0x6c1c('0x55')],'rows':_0x4e8b8a});});},'VoiceQueuesChannel':function(_0x5a919a){var _0x585a42=this;return new Promise(function(_0x4ea97d,_0x14a20f){var _0x1b955f=schema(properties['voicequeuechannel'])[_0x6c1c('0x59')](_0x5a919a);if(_0x1b955f['length']>0x0){return _0x14a20f(_0x585a42[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x1b955f,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x4b1cac=_[_0x6c1c('0x56')](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x5a919a['uniqueid']});if(_0x4b1cac){_0x4ea97d(_0x4b1cac);}else{return _0x14a20f(_0x585a42['error'](0x1f5,_0x6c1c('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x2204a6){var _0x10f39d=this;return new Promise(function(_0x52b1a6,_0x13f292){if(ami[_0x6c1c('0x10')]()==![]){return _0x13f292(_0x10f39d['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x6c1c('0x14')]['join']('\x20')));}var _0xea59ea=schema(properties[_0x6c1c('0x72')])[_0x6c1c('0x59')](_0x2204a6);if(_0xea59ea['length']>0x0){return _0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0xea59ea,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x13c1de=_['find'](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x2204a6['uniqueid']});if(_0x13c1de&&_0x13c1de[_0x6c1c('0x5e')]){return ami[_0x6c1c('0x19')]({'action':_0x6c1c('0x73'),'channel':_0x13c1de[_0x6c1c('0x5e')]})[_0x6c1c('0x1a')](function(_0x302948){_0x52b1a6({'code':0xc8,'message':[_0x2204a6[_0x6c1c('0x5a')],_0x302948[_0x6c1c('0x1b')]['toLowerCase']()][_0x6c1c('0x15')]('\x20')});})['catch'](function(_0x47b53d){_0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f5,[_0x2204a6[_0x6c1c('0x5a')],_0x47b53d[_0x6c1c('0x1b')][_0x6c1c('0x66')]()]['join']('\x20')));});}else{return _0x13f292(_0x10f39d[_0x6c1c('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2c0dd1){var _0x48ff6e=this;return new Promise(function(_0xad1f6,_0x23332d){if(ami[_0x6c1c('0x10')]()==![]){return _0x23332d(_0x48ff6e['error'](0x1f4,[config[_0x6c1c('0x12')]['ip'],config[_0x6c1c('0x12')][_0x6c1c('0x13')],'ami\x20disconnected'][_0x6c1c('0x15')]('\x20')));}var _0x2f9a4d=schema(properties[_0x6c1c('0x74')])[_0x6c1c('0x59')](_0x2c0dd1);if(_0x2f9a4d['length']>0x0){return _0x23332d(_0x48ff6e[_0x6c1c('0x11')](0x1f4,_[_0x6c1c('0x69')](_0x2f9a4d,_0x6c1c('0x1b'))[_0x6c1c('0x15')](',\x20')));}var _0x3f87db=_['find'](_0x56ed6f[_0x6c1c('0x71')],{'uniqueid':_0x2c0dd1[_0x6c1c('0x5a')]});if(_0x3f87db&&_0x3f87db[_0x6c1c('0x5e')]){return ami[_0x6c1c('0x19')]({'action':'Redirect','channel':_0x3f87db[_0x6c1c('0x5e')],'exten':_0x2c0dd1[_0x6c1c('0x75')],'context':_0x2c0dd1[_0x6c1c('0x76')]||_0x3f87db['context'],'priority':0x1})[_0x6c1c('0x1a')](function(_0x2684e9){_0xad1f6({'code':0xc8,'message':[_0x2c0dd1['uniqueid'],_0x2684e9[_0x6c1c('0x1b')]['toLowerCase']()][_0x6c1c('0x15')]('\x20')});})[_0x6c1c('0x1f')](function(_0x246682){_0x23332d(_0x48ff6e[_0x6c1c('0x11')](0x1f5,[_0x2c0dd1['uniqueid'],_0x246682[_0x6c1c('0x1b')][_0x6c1c('0x66')]()][_0x6c1c('0x15')]('\x20')));});}else{return _0x23332d(_0x48ff6e['error'](0x1f5,_0x6c1c('0x67')));}});},'Agents':function(_0x1cf3a5){return new Promise(function(_0x4361e5,_0x2ae7b5){var _0x5b01d2=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0xc')]);_0x4361e5({'count':_0x5b01d2[_0x6c1c('0x55')],'rows':_0x5b01d2});});},'Telephones':function(_0x4c0c6d){return new Promise(function(_0x1aa7e0,_0x5baaa9){var _0x29c5c8=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x77')]);_0x1aa7e0({'count':_0x29c5c8[_0x6c1c('0x55')],'rows':_0x29c5c8});});},'Trunks':function(_0x29da07){return new Promise(function(_0x1ff557,_0x389e22){var _0x2b0866=_['values'](_0x56ed6f[_0x6c1c('0x78')]);_0x1ff557({'count':_0x2b0866['length'],'rows':_0x2b0866});});},'OutboundChannels':function(_0x398a61){return new Promise(function(_0x214630,_0x11220a){var _0x10138=_['values'](_0x56ed6f[_0x6c1c('0x79')]);_0x214630({'count':_0x10138[_0x6c1c('0x55')],'rows':_0x10138});});},'Outbound':function(_0x27a8cc){return new Promise(function(_0x5e77e8,_0xf58113){_0x5e77e8(_0x56ed6f[_0x6c1c('0x2b')]);});},'Campaigns':function(_0x4f9477){return new Promise(function(_0x5e4036,_0x197faa){var _0x1456e1=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x7a')]);_0x5e4036({'count':_0x1456e1[_0x6c1c('0x55')],'rows':_0x1456e1});});},'VoiceQueuesPreview':function(_0x12ce5a){var _0x250e21=this;return new Promise(function(_0x3b017d,_0x1f311f){_0x32af84[_0x6c1c('0x7b')](_0x12ce5a['id'])[_0x6c1c('0x1a')](function(_0x3f9697){_0x3b017d({'code':0xc8,'message':_0x3f9697['message']});})[_0x6c1c('0x1f')](function(_0x3a5014){_0x1f311f(_0x250e21[_0x6c1c('0x11')](0x1f4,_0x3a5014[_0x6c1c('0x1b')]));});});},'EventManager':function(_0x40415d){var _0x2af9f3=this;return new Promise(function(_0x469a73,_0x5ca667){if(!_0x40415d[_0x6c1c('0x7c')]){return _0x5ca667(_0x2af9f3['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x6c1c('0x7d')](_0x6c1c('0x7e')+_0x40415d[_0x6c1c('0x7c')],_0x40415d[_0x6c1c('0x1b')]);_0x469a73({'code':0xc8,'message':_0x40415d});});},'FaxAccounts':function(_0x3f09e6){return new Promise(function(_0x21b63d,_0x25198a){var _0x2a2797=_[_0x6c1c('0x70')](_0x56ed6f[_0x6c1c('0x7f')]);_0x21b63d({'count':_0x2a2797['length'],'rows':_0x2a2797});});},'SendFax':function(_0x3e40b6){var _0x654041=this;return new Promise(function(_0x1a0da8,_0x3efe9c){_0x524a6b[_0x6c1c('0x80')](_0x3e40b6)[_0x6c1c('0x1a')](function(_0x24ffc3){_0x1a0da8({'code':0xc8,'message':_0x24ffc3[_0x6c1c('0x1b')]});})['catch'](function(_0x463e76){_0x3efe9c(_0x654041[_0x6c1c('0x11')](0x1f4,_0x463e76[_0x6c1c('0x1b')]));});});},'CheckAfterSend':function(_0x700aee){var _0x385629=this;return new Promise(function(_0x42a812,_0x152fef){_0x524a6b[_0x6c1c('0x81')](_0x700aee)[_0x6c1c('0x1a')](function(_0x3d92c2){_0x42a812({'code':0xc8,'message':_0x3d92c2[_0x6c1c('0x1b')]});})[_0x6c1c('0x1f')](function(_0x2700b5){_0x152fef(_0x385629[_0x6c1c('0x11')](0x1f4,_0x2700b5['message']));});});}};var _0x58a474=jayson[_0x6c1c('0x82')](_0xe510ca)['http']();_0x58a474['on'](_0x6c1c('0x11'),function(_0x20a29f){return _0x582bec(_0x20a29f);});_0x58a474[_0x6c1c('0x83')](0x232a,_0x6c1c('0x84'),function(){console[_0x6c1c('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x50c1bb(_0x6c1c('0x86')+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 af442b1..0f2ea43 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 _0xf3cd=['isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','getContacts','then'];(function(_0x5c94dd,_0x1710ff){var _0x1ab33f=function(_0x26cb8a){while(--_0x26cb8a){_0x5c94dd['push'](_0x5c94dd['shift']());}};_0x1ab33f(++_0x1710ff);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xccc0d4,_0x2f6bf7){_0xccc0d4=_0xccc0d4-0x0;var _0x27a653=_0xf3cd[_0xccc0d4];return _0x27a653;};'use strict';var _=require(_0xdf3c('0x0'));var BPromise=require(_0xdf3c('0x1'));var Redis=require(_0xdf3c('0x2'));var util=require(_0xdf3c('0x3'));var config=require(_0xdf3c('0x4'));var logger=require(_0xdf3c('0x5'))('trigger');var cmContactRpc=require(_0xdf3c('0x6'));config[_0xdf3c('0x7')]=_[_0xdf3c('0x8')](config['redis'],{'host':_0xdf3c('0x9'),'port':0x18eb});var io=require(_0xdf3c('0xa'))(new Redis(config[_0xdf3c('0x7')]));function emit(_0x1f0601,_0x106021,_0x28edae,_0x52c073,_0x15705d){logger['info']('[CM][%s][%s]',_0x1f0601,_0x106021['id'],_0x28edae,_0x52c073,JSON[_0xdf3c('0xb')](_0x15705d));io['to'](_0x28edae)[_0xdf3c('0xc')](_0x52c073,_0x15705d);}exports['exec']=function(_0x1dba4c,_0x205f33,_0x2d420c,_0x21a6e5){var _0x3a3154,_0x1c456b;var _0xf7da9d={};var _0x32d2db=Number(_0x2d420c['data1']);var _0x1d483c=_0x2d420c[_0xdf3c('0xd')]?Boolean(Number(_0x2d420c[_0xdf3c('0xd')])):![];var _0x17319c;var _0x59e431=![];if(!_[_0xdf3c('0xe')](_0x2d420c[_0xdf3c('0xf')])){if(_0x2d420c[_0xdf3c('0xf')]=='1')_0x59e431=!![];}if(!_0x59e431){if(_0x21a6e5['xmd-contactid']){_0xf7da9d['id']=_0x21a6e5[_0xdf3c('0x10')];}}if(!_0xf7da9d['id']){_0xf7da9d[_0xdf3c('0x11')]=_0x32d2db;_0x17319c=_0x2d420c[_0xdf3c('0x12')]&&_0x2d420c[_0xdf3c('0x12')]!=='0'?_0x2d420c[_0xdf3c('0x12')][_0xdf3c('0x13')](','):[_0xdf3c('0x14')];_0xf7da9d[_0xdf3c('0x15')]=_[_0xdf3c('0x16')](_0x17319c,function(_0x5d3991){var _0x54cdd4={};_0x54cdd4[_0x5d3991]=_0x21a6e5[_0xdf3c('0x17')]?_0x21a6e5[_0xdf3c('0x18')]:_0x21a6e5[_0xdf3c('0x19')];return _0x54cdd4;});}var _0x18d4ec=['id',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x14'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),_0xdf3c('0x11'),_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20')];var _0x5d2390=_['union'](_0x18d4ec,_0x17319c);BPromise[_0xdf3c('0x21')]()['then'](cmContactRpc[_0xdf3c('0x22')]({'attributes':_0x5d2390,'where':_0xf7da9d}))[_0xdf3c('0x23')](function(_0x36552e){_0x1c456b=_0x36552e;if(!_[_0xdf3c('0x24')](_0x1c456b)){if(_0x1c456b[_0xdf3c('0x25')]===0x1){_0x3a3154=_0x1c456b[0x0];logger[_0xdf3c('0x26')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}else{logger[_0xdf3c('0x26')](_0xdf3c('0x28'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_[_0xdf3c('0x16')](_0x1c456b,'id')[_0xdf3c('0x29')](','));}return;}else{logger[_0xdf3c('0x26')](_0xdf3c('0x2a'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id']);var _0x1adee4={'ListId':_0x32d2db};var _0x4c076c=_0x2d420c[_0xdf3c('0x2b')]&&_0x2d420c[_0xdf3c('0x2b')]!=='0'?_0x2d420c['data4']:_0xdf3c('0x14');if(_0x1d483c){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5['calleridnum']:_0x21a6e5['destcalleridnum'];if(_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5[_0xdf3c('0x2c')]&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2c')]:'Unknown';}else{_0x1adee4['firstName']=_0x21a6e5[_0xdf3c('0x2e')]&&_0x21a6e5[_0xdf3c('0x2e')]!==_0xdf3c('0x2d')?_0x21a6e5['destcalleridname']:_0xdf3c('0x2f');}return BPromise[_0xdf3c('0x21')]()[_0xdf3c('0x23')](cmContactRpc[_0xdf3c('0x30')](_0x1adee4))['then'](function(_0xda0de0){_0x3a3154=_0xda0de0;_0x1c456b[_0xdf3c('0x31')](_0xda0de0);if(_0x3a3154){logger['info'](_0xdf3c('0x32'),_0x21a6e5[_0xdf3c('0x27')],_0x205f33['id'],_0x3a3154['id']);}return;});}else{logger[_0xdf3c('0x26')](_0xdf3c('0x33'),_0x21a6e5['uniqueid'],_0x205f33['id']);_0x1adee4[_0x4c076c]=_[_0xdf3c('0xe')](_0x21a6e5[_0xdf3c('0x17')])?_0x21a6e5[_0xdf3c('0x19')]:_0x21a6e5[_0xdf3c('0x18')];if(_['isNil'](_0x21a6e5[_0xdf3c('0x17')])){_0x1adee4[_0xdf3c('0x1a')]=_0x21a6e5['calleridname']&&_0x21a6e5['calleridname']!==_0xdf3c('0x2d')?_0x21a6e5['calleridname']:_0xdf3c('0x2f');}else{_0x1adee4['firstName']=_0x21a6e5['destcalleridname']&&_0x21a6e5['destcalleridname']!==_0xdf3c('0x2d')?_0x21a6e5[_0xdf3c('0x2e')]:_0xdf3c('0x2f');}_0x3a3154=_0x1adee4;_0x1c456b[_0xdf3c('0x31')](_0x1adee4);return;}}})['then'](function(){if(_0x1dba4c){emit(_0x21a6e5['uniqueid'],_0x205f33,util[_0xdf3c('0x34')]('user:%s',_0x1dba4c[_0xdf3c('0x35')]),util[_0xdf3c('0x34')](_0xdf3c('0x36'),_0x2d420c[_0xdf3c('0x37')][_0xdf3c('0x38')]()),{'evt':_[_0xdf3c('0x39')](_0x21a6e5,{'autoCreate':_0x1d483c}),'contact':_0x3a3154===undefined?{}:_0x3a3154,'contacts':_0x1c456b[_0xdf3c('0x25')]===0x0?undefined:_0x1c456b});}});}; \ No newline at end of file +var _0x9f62=['$or','map','destcalleridnum','calleridnum','lastName','fax','createdAt','scheduledAt','updatedAt','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','data4','routeId','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','toLowerCase','merge','bluebird','util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone'];(function(_0x102826,_0x35f7b9){var _0x57556e=function(_0x469edd){while(--_0x469edd){_0x102826['push'](_0x102826['shift']());}};_0x57556e(++_0x35f7b9);}(_0x9f62,0x154));var _0x29f6=function(_0x26779f,_0x5190cf){_0x26779f=_0x26779f-0x0;var _0x14ccb2=_0x9f62[_0x26779f];return _0x14ccb2;};'use strict';var _=require('lodash');var BPromise=require(_0x29f6('0x0'));var Redis=require('ioredis');var util=require(_0x29f6('0x1'));var config=require(_0x29f6('0x2'));var logger=require(_0x29f6('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x29f6('0x4')]=_[_0x29f6('0x5')](config[_0x29f6('0x4')],{'host':_0x29f6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x29f6('0x4')]));function emit(_0x272876,_0x9a43fe,_0x2ba602,_0x416c6c,_0x5e9945){logger['info']('[CM][%s][%s]',_0x272876,_0x9a43fe['id'],_0x2ba602,_0x416c6c,JSON['stringify'](_0x5e9945));io['to'](_0x2ba602)[_0x29f6('0x7')](_0x416c6c,_0x5e9945);}exports[_0x29f6('0x8')]=function(_0x4fb455,_0x5a0724,_0x29b3f5,_0x442623){var _0x4909e0,_0x17b69c;var _0xfa6765={};var _0x5cf872=Number(_0x29b3f5['data1']);var _0x559585=_0x29b3f5['data2']?Boolean(Number(_0x29b3f5[_0x29f6('0x9')])):![];var _0x55cf4;var _0x189344=![];if(!_[_0x29f6('0xa')](_0x29b3f5[_0x29f6('0xb')])){if(_0x29b3f5[_0x29f6('0xb')]=='1')_0x189344=!![];}if(!_0x189344){if(_0x442623[_0x29f6('0xc')]){_0xfa6765['id']=_0x442623[_0x29f6('0xc')];}}if(!_0xfa6765['id']){_0xfa6765[_0x29f6('0xd')]=_0x5cf872;_0x55cf4=_0x29b3f5[_0x29f6('0xe')]&&_0x29b3f5[_0x29f6('0xe')]!=='0'?_0x29b3f5[_0x29f6('0xe')][_0x29f6('0xf')](','):[_0x29f6('0x10')];_0xfa6765[_0x29f6('0x11')]=_[_0x29f6('0x12')](_0x55cf4,function(_0x3584a1){var _0x5bfda7={};_0x5bfda7[_0x3584a1]=_0x442623['routeId']?_0x442623[_0x29f6('0x13')]:_0x442623[_0x29f6('0x14')];return _0x5bfda7;});}var _0xb31436=['id','firstName',_0x29f6('0x15'),_0x29f6('0x10'),'mobile',_0x29f6('0x16'),_0x29f6('0xd'),_0x29f6('0x17'),_0x29f6('0x18'),_0x29f6('0x19')];var _0x2bfb3d=_['union'](_0xb31436,_0x55cf4);BPromise[_0x29f6('0x1a')]()['then'](cmContactRpc['getContacts']({'attributes':_0x2bfb3d,'where':_0xfa6765}))[_0x29f6('0x1b')](function(_0x1fa159){_0x17b69c=_0x1fa159;if(!_[_0x29f6('0x1c')](_0x17b69c)){if(_0x17b69c[_0x29f6('0x1d')]===0x1){_0x4909e0=_0x17b69c[0x0];logger['info'](_0x29f6('0x1e'),_0x442623['uniqueid'],_0x5a0724['id'],_0x4909e0['id']);}else{logger[_0x29f6('0x1f')](_0x29f6('0x20'),_0x442623[_0x29f6('0x21')],_0x5a0724['id'],_[_0x29f6('0x12')](_0x17b69c,'id')['join'](','));}return;}else{logger[_0x29f6('0x1f')](_0x29f6('0x22'),_0x442623['uniqueid'],_0x5a0724['id']);var _0x1401fb={'ListId':_0x5cf872};var _0x45f792=_0x29b3f5[_0x29f6('0x23')]&&_0x29b3f5[_0x29f6('0x23')]!=='0'?_0x29b3f5[_0x29f6('0x23')]:_0x29f6('0x10');if(_0x559585){logger[_0x29f6('0x1f')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x442623[_0x29f6('0x21')],_0x5a0724['id']);_0x1401fb[_0x45f792]=_[_0x29f6('0xa')](_0x442623[_0x29f6('0x24')])?_0x442623[_0x29f6('0x14')]:_0x442623[_0x29f6('0x13')];if(_[_0x29f6('0xa')](_0x442623[_0x29f6('0x24')])){_0x1401fb[_0x29f6('0x25')]=_0x442623[_0x29f6('0x26')]&&_0x442623[_0x29f6('0x26')]!==_0x29f6('0x27')?_0x442623[_0x29f6('0x26')]:_0x29f6('0x28');}else{_0x1401fb[_0x29f6('0x25')]=_0x442623[_0x29f6('0x29')]&&_0x442623[_0x29f6('0x29')]!==_0x29f6('0x27')?_0x442623['destcalleridname']:'Unknown';}return BPromise[_0x29f6('0x1a')]()['then'](cmContactRpc[_0x29f6('0x2a')](_0x1401fb))[_0x29f6('0x1b')](function(_0x1e1bb6){_0x4909e0=_0x1e1bb6;_0x17b69c[_0x29f6('0x2b')](_0x1e1bb6);if(_0x4909e0){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x442623[_0x29f6('0x21')],_0x5a0724['id'],_0x4909e0['id']);}return;});}else{logger[_0x29f6('0x1f')](_0x29f6('0x2c'),_0x442623[_0x29f6('0x21')],_0x5a0724['id']);_0x1401fb[_0x45f792]=_[_0x29f6('0xa')](_0x442623[_0x29f6('0x24')])?_0x442623[_0x29f6('0x14')]:_0x442623[_0x29f6('0x13')];if(_[_0x29f6('0xa')](_0x442623[_0x29f6('0x24')])){_0x1401fb[_0x29f6('0x25')]=_0x442623[_0x29f6('0x26')]&&_0x442623[_0x29f6('0x26')]!==_0x29f6('0x27')?_0x442623['calleridname']:'Unknown';}else{_0x1401fb[_0x29f6('0x25')]=_0x442623[_0x29f6('0x29')]&&_0x442623[_0x29f6('0x29')]!==''?_0x442623[_0x29f6('0x29')]:_0x29f6('0x28');}_0x4909e0=_0x1401fb;_0x17b69c[_0x29f6('0x2b')](_0x1401fb);return;}}})[_0x29f6('0x1b')](function(){if(_0x4fb455){emit(_0x442623[_0x29f6('0x21')],_0x5a0724,util['format'](_0x29f6('0x2d'),_0x4fb455[_0x29f6('0x2e')]),util[_0x29f6('0x2f')](_0x29f6('0x30'),_0x29b3f5['action'][_0x29f6('0x31')]()),{'evt':_[_0x29f6('0x32')](_0x442623,{'autoCreate':_0x559585}),'contact':_0x4909e0===undefined?{}:_0x4909e0,'contacts':_0x17b69c[_0x29f6('0x1d')]===0x0?undefined:_0x17b69c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4d6dcc9..1eeaefd 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 _0x0551=['merge','user:%s','name','trigger:%s','exec','integration','queue','routeId','script','parse','query','search','channel','AllConditions','length','every','some','AnyConditions','checkConditions','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','null','substatus','exports','util','url','ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','undefined','motionChannel','voice','interface','checkTriggers','hasOwnProperty','checkTrigger','variables','Actions','action','contactmanager','motionbar','data2','html','render','uri','buildUri','isNil','data3','data4','uriLocation','data5','800','windowHeight','data6','600','winapp','winApplication','format','trigger:%s:%s','toLowerCase','data1'];(function(_0x2ffee8,_0x126cdd){var _0x432ebf=function(_0x521355){while(--_0x521355){_0x2ffee8['push'](_0x2ffee8['shift']());}};_0x432ebf(++_0x126cdd);}(_0x0551,0x18e));var _0x1055=function(_0x2a2b4,_0xcc17b){_0x2a2b4=_0x2a2b4-0x0;var _0x16bec5=_0x0551[_0x2a2b4];return _0x16bec5;};'use strict';var util=require(_0x1055('0x0'));var _=require('lodash');var url=require(_0x1055('0x1'));var Mustache=require('mustache');var Redis=require(_0x1055('0x2'));var urlforward=require('./urlforward');var integration=require(_0x1055('0x3'));var cmContact=require(_0x1055('0x4'));var script=require(_0x1055('0x5'));var config=require('../../../config/environment');var logger=require(_0x1055('0x6'))(_0x1055('0x7'));var ami=require(_0x1055('0x8'));config['redis']=_[_0x1055('0x9')](config[_0x1055('0xa')],{'host':_0x1055('0xb'),'port':0x18eb});var io=require(_0x1055('0xc'))(new Redis(config[_0x1055('0xa')]));var operators={'equals':function(_0x289a01,_0x43a2e1){return _0x289a01==_0x43a2e1;},'not_equals':function(_0x551871,_0x2406f8){return _0x551871!=_0x2406f8;}};var barAndWebActions=[_0x1055('0xd'),_0x1055('0x1'),'winapp'];function Trigger(_0x1efd18){this[_0x1055('0xe')]=_0x1efd18[_0x1055('0xe')];this[_0x1055('0xf')]=_0x1efd18[_0x1055('0xf')];this[_0x1055('0x10')]=_0x1efd18['voiceQueues'];this['templates']=_0x1efd18[_0x1055('0x11')];this[_0x1055('0x12')]=_0x1efd18['voiceExtensions'];this[_0x1055('0x13')]=_0x1efd18['zendeskAccounts'];this[_0x1055('0x14')]=_0x1efd18['freshdeskAccounts'];this[_0x1055('0x15')]=_0x1efd18[_0x1055('0x15')];this[_0x1055('0x16')]=_0x1efd18['sugarcrmAccounts'];this[_0x1055('0x17')]=_0x1efd18['zohoAccounts'];this[_0x1055('0x18')]=_0x1efd18['deskAccounts'];this['vtigerAccounts']=_0x1efd18['vtigerAccounts'];this[_0x1055('0x19')]=_0x1efd18[_0x1055('0x19')];this[_0x1055('0x1a')]=_0x1efd18['dynamics365Accounts'];this[_0x1055('0x1b')]=_0x1efd18[_0x1055('0x1b')];this[_0x1055('0x1c')]={'zendesk':this[_0x1055('0x13')],'salesforce':this[_0x1055('0x15')],'freshdesk':this[_0x1055('0x14')],'sugarcrm':this[_0x1055('0x16')],'zoho':this[_0x1055('0x17')],'desk':this[_0x1055('0x18')],'vtiger':this[_0x1055('0x1d')],'dynamics365':this[_0x1055('0x1a')],'freshsales':this[_0x1055('0x1b')],'servicenow':this[_0x1055('0x19')]};ami['on'](_0x1055('0x1e'),this[_0x1055('0x1f')]['bind'](this));ami['on'](_0x1055('0x20'),this['syncCustomEvent'][_0x1055('0x21')](this));ami['on']('custom:agentringnoanswer',this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x1055('0x21')](this));ami['on'](_0x1055('0x22'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x23'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x24'),this[_0x1055('0x1f')]['bind'](this));ami['on'](_0x1055('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentreject',this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x26'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on']('custom:queuecallerabandon',this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x27'),this['syncCustomEvent'][_0x1055('0x21')](this));ami['on'](_0x1055('0x28'),this[_0x1055('0x29')][_0x1055('0x21')](this));ami['on'](_0x1055('0x2a'),this[_0x1055('0x29')][_0x1055('0x21')](this));ami['on'](_0x1055('0x2b'),this['syncAgentDial'][_0x1055('0x21')](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x1055('0x2c'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x2d'),this[_0x1055('0x1f')]['bind'](this));ami['on'](_0x1055('0x2e'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x2f'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on'](_0x1055('0x30'),this[_0x1055('0x1f')][_0x1055('0x21')](this));ami['on']('custom:rejectmessage',this[_0x1055('0x1f')][_0x1055('0x21')](this));}Trigger[_0x1055('0x31')][_0x1055('0x32')]=function(_0x3de5e0,_0x448c42,_0x465ebb){logger[_0x1055('0x33')](_0x3de5e0,_0x448c42,JSON[_0x1055('0x34')](_0x465ebb));io['to'](_0x3de5e0)['emit'](_0x448c42,_0x465ebb);};Trigger[_0x1055('0x31')][_0x1055('0x1f')]=function(_0x2181d5){var _0x426aa9=_[_0x1055('0x35')](_0x2181d5);if(typeof _0x426aa9['motionChannel']===_0x1055('0x36')){_0x426aa9[_0x1055('0x37')]=_0x1055('0x38');}this['checkTriggers'](_0x426aa9);};Trigger[_0x1055('0x31')][_0x1055('0x29')]=function(_0x203c87){if(this[_0x1055('0xf')][_0x203c87[_0x1055('0x39')]]){this[_0x1055('0x1f')](_0x203c87);}};Trigger[_0x1055('0x31')][_0x1055('0x3a')]=function(_0x36803a){var _0xa99d47;for(var _0x1f5fac in this[_0x1055('0xe')]){if(this['triggers'][_0x1055('0x3b')](_0x1f5fac)){if(this[_0x1055('0xe')][_0x1f5fac]['status']){_0xa99d47=this[_0x1055('0x3c')](this['triggers'][_0x1f5fac],_0x36803a);if(_0xa99d47){_['merge'](_0x36803a,_0x36803a[_0x1055('0x3d')]);for(var _0x8a532d=0x0,_0x17c4e4,_0x3d483e,_0x1f152c;_0x8a532d0x0){_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 +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x3a54e0,_0x5265ff){var _0x44d210=function(_0x3ec19c){while(--_0x3ec19c){_0x3a54e0['push'](_0x3a54e0['shift']());}};_0x44d210(++_0x5265ff);}(_0x814b,0x1a2));var _0xb814=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x814b[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 1e0ea81..c81428f 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 _0xbc0c=[']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','nameField','idField','substring','indexOf','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','remoteUri','https://login.microsoftonline.com/%s/oauth2/token','tenantId','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xbc0c,0x101));var _0xcbc0=function(_0x24207a,_0x1c4f31){_0x24207a=_0x24207a-0x0;var _0x268b3b=_0xbc0c[_0x24207a];return _0x268b3b;};'use strict';var _=require(_0xcbc0('0x0'));var BPromise=require(_0xcbc0('0x1'));var rp=require(_0xcbc0('0x2'));var util=require(_0xcbc0('0x3'));var intUtil=require('./util');var md5=require(_0xcbc0('0x4'));var Redis=require(_0xcbc0('0x5'));var logger=require('../../../../config/logger')(_0xcbc0('0x6'));var config=require(_0xcbc0('0x7'));config[_0xcbc0('0x8')]=_[_0xcbc0('0x9')](config[_0xcbc0('0x8')],{'host':_0xcbc0('0xa'),'port':0x18eb});var io=require(_0xcbc0('0xb'))(new Redis(config[_0xcbc0('0x8')]));function getAuthToken(_0x36807d,_0x4efd71,_0x3b6ae9){var _0x54be5a={'method':_0xcbc0('0xc'),'uri':_0x4efd71,'form':{'client_id':_0x36807d[_0xcbc0('0xd')],'resource':_0x36807d['remoteUri'],'username':_0x36807d[_0xcbc0('0xe')],'password':_0x36807d[_0xcbc0('0xf')],'grant_type':_0xcbc0('0xf'),'client_secret':_0x36807d['clientSecret']},'json':!![]};return rp(_0x54be5a)[_0xcbc0('0x10')](function(_0x4cfd0f){return _0x4cfd0f[_0xcbc0('0x11')];})[_0xcbc0('0x12')](function(_0xe5e87c){logger['error']('['+[_0x3b6ae9[_0xcbc0('0x13')]()]+_0xcbc0('0x14'));return _0xe5e87c[_0xcbc0('0x15')];});}function getUser(_0x357519,_0x86d1f9,_0x27bef8,_0x23336e,_0x182607,_0x38c016){return new BPromise(function(_0x4db441,_0x9edde6){return getAuthToken(_0x86d1f9,_0x23336e,_0x38c016)['then'](function(_0x24f7f4){var _0x15aa46={'method':_0xcbc0('0x16'),'uri':_0x182607+_0xcbc0('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x24f7f4,'OData-Version':_0xcbc0('0x18')},'json':!![]};return rp(_0x15aa46);})[_0xcbc0('0x10')](function(_0xe9392e){var _0x2e5739=_0xe9392e[_0xcbc0('0x19')];var _0x2afb45=![];var _0x2a5e23=null;if(!_[_0xcbc0('0x1a')](_0x27bef8)){if(intUtil[_0xcbc0('0x1b')](_0x27bef8[_0xcbc0('0x1c')])){_0x357519[_0xcbc0('0x1d')]=_0x27bef8['email'];for(_0x2a5e23=0x0;_0x2a5e23<_0x2e5739[_0xcbc0('0x1e')];_0x2a5e23++){if(_0x2e5739[_0x2a5e23][_0xcbc0('0x1f')]===_0x27bef8[_0xcbc0('0x1c')]&&!_0x2e5739[_0x2a5e23][_0xcbc0('0x20')]){_0x2afb45=!![];logger[_0xcbc0('0x21')]('['+[_0x38c016['toUpperCase']()]+_0xcbc0('0x22')+_0x2e5739[_0x2a5e23][_0xcbc0('0x23')]+'!');_0x357519[_0xcbc0('0x24')]=_0x2e5739[_0x2a5e23][_0xcbc0('0x23')];}}}}if(!_0x2afb45){logger[_0xcbc0('0x21')]('['+[_0x38c016[_0xcbc0('0x13')]()]+_0xcbc0('0x25'));_0x357519[_0xcbc0('0x1d')]=_0x86d1f9['username'];for(_0x2a5e23=0x0;_0x2a5e23<_0x2e5739[_0xcbc0('0x1e')];_0x2a5e23++){if(_0x2e5739[_0x2a5e23]['internalemailaddress']===_0x86d1f9[_0xcbc0('0xe')]){_0x357519[_0xcbc0('0x24')]=_0x2e5739[_0x2a5e23][_0xcbc0('0x23')];}}}_0x4db441(_0x357519);})[_0xcbc0('0x12')](function(_0x35472b){_0x9edde6(_0x35472b[_0xcbc0('0x15')]);});});}function createEndUser(_0x123483,_0x3e48af,_0x78dbe0,_0x55d215,_0x2d0466,_0x470546){return new BPromise(function(_0x2be9f6,_0x24275a){return getAuthToken(_0x3e48af,_0x78dbe0,_0x470546)[_0xcbc0('0x10')](function(_0x3cc632){var _0x527827=_0x470546[_0xcbc0('0x26')]()===_0xcbc0('0x27')?_0x2d0466['destcalleridnum']:_0x2d0466[_0xcbc0('0x28')];var _0x388355={'method':_0xcbc0('0xc'),'uri':_0x55d215+_0xcbc0('0x29'),'body':{'telephone1':_0x527827,'fullname':_0x527827,'firstname':_0x527827,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xcbc0('0x2a')+_0x123483[_0xcbc0('0x24')]+')'},'headers':{'Authorization':_0xcbc0('0x2b')+_0x3cc632,'OData-Version':_0xcbc0('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x388355);})[_0xcbc0('0x10')](function(_0x2f5fdc){var _0x4fcd35=_0x2f5fdc[_0xcbc0('0x2c')][_0xcbc0('0x2d')];var _0x3d63a4=_0x4fcd35['substring'](_0x4fcd35[_0xcbc0('0x2e')]('(')+0x1,_0x4fcd35[_0xcbc0('0x2e')](')'));_0x123483[_0xcbc0('0x2f')]=_0x3d63a4;_0x2be9f6(_0x123483);})['catch'](function(_0x2f8710){_0x24275a(_0x2f8710[_0xcbc0('0x15')]);});});}function getEndUser(_0x23726f,_0x1fa269,_0x3ae210,_0x96c664,_0x4425aa,_0x1af3f8){return new BPromise(function(_0x57f6b6,_0xe5a82b){var _0xa3909c=_0x1af3f8['toLowerCase']()==='outbound'?_0x4425aa['destcalleridnum']:_0x4425aa[_0xcbc0('0x28')];return getAuthToken(_0x1fa269,_0x3ae210,_0x1af3f8)[_0xcbc0('0x10')](function(_0x2f78b4){var _0x2ea338={'method':_0xcbc0('0x16'),'uri':_0x96c664+_0xcbc0('0x30')+_0xa3909c[_0xcbc0('0x31')]('+','%2b')+'\x27','headers':{'Authorization':_0xcbc0('0x2b')+_0x2f78b4,'If-None-Match':null,'OData-Version':_0xcbc0('0x18')},'json':!![]};return rp(_0x2ea338);})[_0xcbc0('0x10')](function(_0x197a96){var _0x539757=null;if(_0x197a96){var _0x3e9346=_0x197a96[_0xcbc0('0x19')];var _0x4e706b=![];for(_0x539757=0x0;_0x539757<_0x3e9346[_0xcbc0('0x1e')];_0x539757++){if(_0x3e9346[_0x539757]['telephone1']===_0xa3909c){_0x4e706b=!![];_0x23726f[_0xcbc0('0x2f')]=_0x3e9346[_0x539757]['contactid'];}}if(_0x4e706b){_0x57f6b6(_0x23726f);}else{return createEndUser(_0x23726f,_0x1fa269,_0x3ae210,_0x96c664,_0x4425aa,_0x1af3f8)[_0xcbc0('0x10')](function(_0x449d51){logger[_0xcbc0('0x21')]('['+[_0x1af3f8['toUpperCase']()]+_0xcbc0('0x32'),_0x449d51['enduserId']);_0x57f6b6(_0x449d51);});}}else{return createEndUser(_0x23726f,_0x1fa269,_0x3ae210,_0x96c664,_0x4425aa,_0x1af3f8)[_0xcbc0('0x10')](function(_0xa0f4db){logger[_0xcbc0('0x21')]('['+[_0x1af3f8['toUpperCase']()]+_0xcbc0('0x33'),_0xa0f4db[_0xcbc0('0x2f')]);_0x57f6b6(_0xa0f4db);});}});});}function getCustomFields(_0x134c26,_0x63222e,_0x5d2180){var _0x429598={};if(_0x134c26['length']>0x0){_[_0xcbc0('0x34')](_0x134c26,function(_0x5176dc){if(_[_0xcbc0('0x35')]([_0xcbc0('0x36'),'picklist'],_0x5176dc[_0xcbc0('0x37')])&&_0x5176dc[_0xcbc0('0x38')]&&!_0x5176dc['customField']){var _0x24efb1=_0x5176dc[_0xcbc0('0x39')]['toLowerCase']();var _0xe6cf7e=_0x24efb1[_0xcbc0('0x3a')](0x0,_0x24efb1[_0xcbc0('0x3b')]('_'));var _0x106420=_0x24efb1[_0xcbc0('0x3a')](_0x24efb1['indexOf']('_')+0x1);if(_0xe6cf7e===_0x5d2180){_0x429598[_0x106420]=_0x5176dc['content'];}}});}return _0x429598;}function getTicket(_0x143cfb,_0x154d0e,_0x308aee,_0x550c28,_0xd30340,_0x1e5881,_0x58152f){return new BPromise(function(_0x19dc6b,_0x54a66e){var _0x3e1daa;return getAuthToken(_0x154d0e,_0x308aee,_0x58152f)[_0xcbc0('0x10')](function(_0x15012a){if(_0x1e5881[_0xcbc0('0x3c')]===_0xcbc0('0x3d')){_0x3e1daa={'method':'POST','uri':_0x550c28+'incidents','body':Object[_0xcbc0('0x3e')]({},{'title':intUtil[_0xcbc0('0x3f')](_0x1e5881[_0xcbc0('0x40')],_0xd30340,'\x20'),'description':intUtil[_0xcbc0('0x3f')](_0x1e5881[_0xcbc0('0x41')],_0xd30340,'\x0a'),'customerid_contact@odata.bind':_0xcbc0('0x42')+_0x143cfb[_0xcbc0('0x2f')]+')','ownerid@odata.bind':_0xcbc0('0x2a')+_0x143cfb[_0xcbc0('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x1e5881[_0xcbc0('0x43')],_0xd30340,_0x1e5881[_0xcbc0('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x15012a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1e5881['ticketType']===_0xcbc0('0x44')){_0x3e1daa={'method':'POST','uri':_0x550c28+'phonecalls','body':Object[_0xcbc0('0x3e')]({},{'subject':intUtil['getString'](_0x1e5881[_0xcbc0('0x40')],_0xd30340,'\x20'),'phonenumber':String(_0xd30340[_0xcbc0('0x28')]),'description':intUtil[_0xcbc0('0x3f')](_0x1e5881[_0xcbc0('0x41')],_0xd30340,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x143cfb[_0xcbc0('0x2f')]+')','ownerid@odata.bind':'/systemusers('+_0x143cfb[_0xcbc0('0x24')]+')','directioncode':_0x143cfb[_0xcbc0('0x45')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x143cfb[_0xcbc0('0x24')]+')','participationtypemask':_0x143cfb['callDirection']===_0xcbc0('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0xcbc0('0x42')+_0x143cfb[_0xcbc0('0x2f')]+')','participationtypemask':_0x143cfb['callDirection']===_0xcbc0('0x46')?0x1:0x2}]},getCustomFields(_0x1e5881['Fields'],_0xd30340,_0x1e5881[_0xcbc0('0x3c')])),'headers':{'Authorization':_0xcbc0('0x2b')+_0x15012a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e1daa);})[_0xcbc0('0x10')](function(_0x5247d4){var _0x5beba4=_0x5247d4[_0xcbc0('0x2c')][_0xcbc0('0x2d')];var _0x39349d=_0x5beba4[_0xcbc0('0x3a')](_0x5beba4['lastIndexOf']('(')+0x1,_0x5beba4[_0xcbc0('0x2e')](')'));_0x143cfb[_0xcbc0('0x47')]=_0x39349d;_0x19dc6b(_0x143cfb);})[_0xcbc0('0x12')](function(_0x4c8478){_0x54a66e(_0x4c8478['message']);});});}function emit(_0x3deafa,_0x9655d3,_0x4a861c,_0xb8f57d){var _0x1331bc={'uri':util[_0xcbc0('0x48')](_0xcbc0('0x49'),_0x3deafa,_0x4a861c,_0xb8f57d)};io['to'](util[_0xcbc0('0x48')](_0xcbc0('0x4a'),_0x9655d3))[_0xcbc0('0x4b')]('trigger:browser:url',_0x1331bc);}exports['cs']=function(_0x5740da,_0x428c0b,_0x43acf7,_0x2a68b9,_0x509366,_0x194e94,_0x25925c,_0x38ed10){var _0x24c5a6={};_0x194e94['remoteUri']=intUtil[_0xcbc0('0x4c')](_0x194e94['remoteUri']);_0x194e94['serverUrl']=intUtil['stripTrailingSlash'](_0x194e94['serverUrl']);_0x24c5a6['callDirection']=_0x38ed10===_0xcbc0('0x46')||_0x38ed10===_0xcbc0('0x4d')?_0xcbc0('0x46'):_0xcbc0('0x27');var _0x3afada=util[_0xcbc0('0x48')](_0xcbc0('0x4e'),_0x194e94[_0xcbc0('0x4f')]);var _0x53ada7=util[_0xcbc0('0x48')](_0xcbc0('0x50'),_0x194e94[_0xcbc0('0x51')]);var _0x477509=util[_0xcbc0('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x194e94[_0xcbc0('0x52')],_0x428c0b[_0xcbc0('0x53')],md5(_0x428c0b[_0xcbc0('0x53')]));if(_0x509366&&_0x509366['monitor_format']){logger[_0xcbc0('0x21')](_0xcbc0('0x54'),_0xcbc0('0x55'));_0x428c0b[_0xcbc0('0x56')]=_0x477509;}else if(_0x25925c&&_0x25925c['recordingFormat']&&_0x25925c[_0xcbc0('0x57')]!==_0xcbc0('0x58')){logger[_0xcbc0('0x21')](_0xcbc0('0x59'),_0xcbc0('0x55'));_0x428c0b[_0xcbc0('0x56')]=_0x477509;}else{_0x428c0b[_0xcbc0('0x56')]='';}return getUser(_0x24c5a6,_0x194e94,_0x2a68b9,_0x53ada7,_0x3afada,_0x38ed10)[_0xcbc0('0x10')](function(_0x4d3e76){logger['info']('['+_0x38ed10[_0xcbc0('0x13')]()+_0xcbc0('0x5a'),_0x4d3e76[_0xcbc0('0x24')]);logger[_0xcbc0('0x21')]('['+_0x38ed10[_0xcbc0('0x13')]()+']\x20The\x20User\x20email\x20is:',_0x4d3e76['userEmail']);return getEndUser(_0x4d3e76,_0x194e94,_0x53ada7,_0x3afada,_0x428c0b,_0x38ed10);})['then'](function(_0x5bb7b7){logger['info']('['+_0x38ed10['toUpperCase']()+_0xcbc0('0x5b'),_0x5bb7b7['enduserId']);logger[_0xcbc0('0x21')]('['+_0x38ed10[_0xcbc0('0x13')]()+_0xcbc0('0x5c'),_0x428c0b[_0xcbc0('0x28')]);return getTicket(_0x5bb7b7,_0x194e94,_0x53ada7,_0x3afada,_0x428c0b,_0x43acf7,_0x38ed10);})[_0xcbc0('0x10')](function(_0x3481f9){logger[_0xcbc0('0x21')](util[_0xcbc0('0x48')]('['+_0x38ed10[_0xcbc0('0x13')]()+_0xcbc0('0x5d'),_0x43acf7['ticketType'],_0x3481f9[_0xcbc0('0x47')]));logger[_0xcbc0('0x21')](util[_0xcbc0('0x48')]('['+_0x38ed10[_0xcbc0('0x13')]()+_0xcbc0('0x5e'),_0x38ed10));if(_0x38ed10!==_0xcbc0('0x4d')){logger[_0xcbc0('0x21')]('['+_0x38ed10[_0xcbc0('0x13')]()+']',_0xcbc0('0x5f'));emit(_0x194e94['remoteUri'],_0x2a68b9[_0xcbc0('0x60')],_0x43acf7[_0xcbc0('0x3c')],_0x3481f9[_0xcbc0('0x47')]);}})['catch'](function(_0x283b8b){logger[_0xcbc0('0x61')]('['+_0x38ed10[_0xcbc0('0x13')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x283b8b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4024=['defaults','localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','toLowerCase','destcalleridnum','calleridnum','/systemusers(','odata-entityid','lastIndexOf','outbound','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','idField','substring','indexOf','incident','incidents','getString','Subjects','/contacts(','ticketType','phonecall','assign','Descriptions','callDirection','queue','Fields','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\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','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis'];(function(_0x591546,_0x2c9050){var _0x40aa14=function(_0x539669){while(--_0x539669){_0x591546['push'](_0x591546['shift']());}};_0x40aa14(++_0x2c9050);}(_0x4024,0xc4));var _0x4402=function(_0x285217,_0x24095e){_0x285217=_0x285217-0x0;var _0x8739ad=_0x4024[_0x285217];return _0x8739ad;};'use strict';var _=require(_0x4402('0x0'));var BPromise=require('bluebird');var rp=require(_0x4402('0x1'));var util=require(_0x4402('0x2'));var intUtil=require(_0x4402('0x3'));var md5=require(_0x4402('0x4'));var Redis=require(_0x4402('0x5'));var logger=require(_0x4402('0x6'))(_0x4402('0x7'));var config=require(_0x4402('0x8'));config[_0x4402('0x9')]=_[_0x4402('0xa')](config['redis'],{'host':_0x4402('0xb'),'port':0x18eb});var io=require(_0x4402('0xc'))(new Redis(config[_0x4402('0x9')]));function getAuthToken(_0x3917c0,_0x319a0f,_0x179f8e){var _0x4f0e87={'method':_0x4402('0xd'),'uri':_0x319a0f,'form':{'client_id':_0x3917c0[_0x4402('0xe')],'resource':_0x3917c0['remoteUri'],'username':_0x3917c0['username'],'password':_0x3917c0[_0x4402('0xf')],'grant_type':'password','client_secret':_0x3917c0[_0x4402('0x10')]},'json':!![]};return rp(_0x4f0e87)[_0x4402('0x11')](function(_0x79d50d){return _0x79d50d[_0x4402('0x12')];})[_0x4402('0x13')](function(_0xef1e09){logger[_0x4402('0x14')]('['+[_0x179f8e['toUpperCase']()]+_0x4402('0x15'));return _0xef1e09[_0x4402('0x16')];});}function getUser(_0x5bc247,_0x25db15,_0x5ea30a,_0x308790,_0x26d1d7,_0x3b8ac6){return new BPromise(function(_0xf58a0a,_0xc084a0){return getAuthToken(_0x25db15,_0x308790,_0x3b8ac6)[_0x4402('0x11')](function(_0x2ff1d8){var _0x51a0ae={'method':_0x4402('0x17'),'uri':_0x26d1d7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4402('0x18')+_0x2ff1d8,'OData-Version':_0x4402('0x19')},'json':!![]};return rp(_0x51a0ae);})[_0x4402('0x11')](function(_0x45118c){var _0x460e64=_0x45118c[_0x4402('0x1a')];var _0x45a7ae=![];var _0x47db1e=null;if(!_[_0x4402('0x1b')](_0x5ea30a)){if(intUtil[_0x4402('0x1c')](_0x5ea30a[_0x4402('0x1d')])){_0x5bc247[_0x4402('0x1e')]=_0x5ea30a[_0x4402('0x1d')];for(_0x47db1e=0x0;_0x47db1e<_0x460e64[_0x4402('0x1f')];_0x47db1e++){if(_0x460e64[_0x47db1e][_0x4402('0x20')]===_0x5ea30a['email']&&!_0x460e64[_0x47db1e][_0x4402('0x21')]){_0x45a7ae=!![];logger[_0x4402('0x22')]('['+[_0x3b8ac6['toUpperCase']()]+_0x4402('0x23')+_0x460e64[_0x47db1e][_0x4402('0x24')]+'!');_0x5bc247['userId']=_0x460e64[_0x47db1e][_0x4402('0x24')];}}}}if(!_0x45a7ae){logger['info']('['+[_0x3b8ac6[_0x4402('0x25')]()]+_0x4402('0x26'));_0x5bc247[_0x4402('0x1e')]=_0x25db15[_0x4402('0x27')];for(_0x47db1e=0x0;_0x47db1e<_0x460e64[_0x4402('0x1f')];_0x47db1e++){if(_0x460e64[_0x47db1e][_0x4402('0x20')]===_0x25db15[_0x4402('0x27')]){_0x5bc247[_0x4402('0x28')]=_0x460e64[_0x47db1e][_0x4402('0x24')];}}}_0xf58a0a(_0x5bc247);})[_0x4402('0x13')](function(_0x4d81b0){_0xc084a0(_0x4d81b0[_0x4402('0x16')]);});});}function createEndUser(_0x458b83,_0x2aac41,_0x3b4daf,_0x25bfff,_0x4779c5,_0x3178d9){return new BPromise(function(_0x5ae84e,_0x5e5cc1){return getAuthToken(_0x2aac41,_0x3b4daf,_0x3178d9)[_0x4402('0x11')](function(_0x4125af){var _0x3a0ce0=_0x3178d9[_0x4402('0x29')]()==='outbound'?_0x4779c5[_0x4402('0x2a')]:_0x4779c5[_0x4402('0x2b')];var _0x340703={'method':'POST','uri':_0x25bfff+'contacts','body':{'telephone1':_0x3a0ce0,'fullname':_0x3a0ce0,'firstname':_0x3a0ce0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4402('0x2c')+_0x458b83[_0x4402('0x28')]+')'},'headers':{'Authorization':_0x4402('0x18')+_0x4125af,'OData-Version':_0x4402('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x340703);})[_0x4402('0x11')](function(_0x67f535){var _0x4c2ff3=_0x67f535['headers'][_0x4402('0x2d')];var _0x1c87ff=_0x4c2ff3['substring'](_0x4c2ff3['lastIndexOf']('(')+0x1,_0x4c2ff3[_0x4402('0x2e')](')'));_0x458b83['enduserId']=_0x1c87ff;_0x5ae84e(_0x458b83);})[_0x4402('0x13')](function(_0x8167ce){_0x5e5cc1(_0x8167ce[_0x4402('0x16')]);});});}function getEndUser(_0x221768,_0x1f3f6d,_0x37960c,_0x5e7407,_0x348e17,_0x364b16){return new BPromise(function(_0x4a60c1,_0x1f56ef){var _0x4af386=_0x364b16[_0x4402('0x29')]()===_0x4402('0x2f')?_0x348e17[_0x4402('0x2a')]:_0x348e17[_0x4402('0x2b')];return getAuthToken(_0x1f3f6d,_0x37960c,_0x364b16)[_0x4402('0x11')](function(_0x378cf0){var _0x5b4d2d={'method':_0x4402('0x17'),'uri':_0x5e7407+_0x4402('0x30')+_0x4af386['replace']('+',_0x4402('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x378cf0,'If-None-Match':null,'OData-Version':_0x4402('0x19')},'json':!![]};return rp(_0x5b4d2d);})['then'](function(_0x7038c3){var _0x5e8709=null;if(_0x7038c3){var _0x13e28=_0x7038c3['value'];var _0x102d65=![];for(_0x5e8709=0x0;_0x5e8709<_0x13e28[_0x4402('0x1f')];_0x5e8709++){if(_0x13e28[_0x5e8709][_0x4402('0x32')]===_0x4af386){_0x102d65=!![];_0x221768['enduserId']=_0x13e28[_0x5e8709][_0x4402('0x33')];}}if(_0x102d65){_0x4a60c1(_0x221768);}else{return createEndUser(_0x221768,_0x1f3f6d,_0x37960c,_0x5e7407,_0x348e17,_0x364b16)[_0x4402('0x11')](function(_0x360dc6){logger[_0x4402('0x22')]('['+[_0x364b16['toUpperCase']()]+_0x4402('0x34'),_0x360dc6[_0x4402('0x35')]);_0x4a60c1(_0x360dc6);});}}else{return createEndUser(_0x221768,_0x1f3f6d,_0x37960c,_0x5e7407,_0x348e17,_0x364b16)[_0x4402('0x11')](function(_0x378f58){logger[_0x4402('0x22')]('['+[_0x364b16[_0x4402('0x25')]()]+_0x4402('0x36'),_0x378f58[_0x4402('0x35')]);_0x4a60c1(_0x378f58);});}});});}function getCustomFields(_0x42b296,_0x1560d0,_0x3aac3d){var _0x5cbbb6={};if(_0x42b296[_0x4402('0x1f')]>0x0){_[_0x4402('0x37')](_0x42b296,function(_0xbcc221){if(_[_0x4402('0x38')]([_0x4402('0x39'),_0x4402('0x3a')],_0xbcc221[_0x4402('0x3b')])&&_0xbcc221['nameField']&&!_0xbcc221['customField']){var _0x4f5f3d=_0xbcc221[_0x4402('0x3c')]['toLowerCase']();var _0x42915c=_0x4f5f3d[_0x4402('0x3d')](0x0,_0x4f5f3d[_0x4402('0x3e')]('_'));var _0x28721b=_0x4f5f3d[_0x4402('0x3d')](_0x4f5f3d[_0x4402('0x3e')]('_')+0x1);if(_0x42915c===_0x3aac3d){_0x5cbbb6[_0x28721b]=_0xbcc221['content'];}}});}return _0x5cbbb6;}function getTicket(_0x11ba62,_0x28e810,_0x4dedc6,_0x36c8fd,_0x53da2b,_0x56bd01,_0xeb6895){return new BPromise(function(_0x1255bf,_0x287c93){var _0x2ed47f;return getAuthToken(_0x28e810,_0x4dedc6,_0xeb6895)['then'](function(_0x1013e8){if(_0x56bd01['ticketType']===_0x4402('0x3f')){_0x2ed47f={'method':_0x4402('0xd'),'uri':_0x36c8fd+_0x4402('0x40'),'body':Object['assign']({},{'title':intUtil[_0x4402('0x41')](_0x56bd01[_0x4402('0x42')],_0x53da2b,'\x20'),'description':intUtil['getString'](_0x56bd01['Descriptions'],_0x53da2b,'\x0a'),'customerid_contact@odata.bind':_0x4402('0x43')+_0x11ba62['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x11ba62[_0x4402('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x56bd01['Fields'],_0x53da2b,_0x56bd01[_0x4402('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x1013e8,'OData-Version':_0x4402('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x56bd01[_0x4402('0x44')]===_0x4402('0x45')){_0x2ed47f={'method':_0x4402('0xd'),'uri':_0x36c8fd+'phonecalls','body':Object[_0x4402('0x46')]({},{'subject':intUtil[_0x4402('0x41')](_0x56bd01[_0x4402('0x42')],_0x53da2b,'\x20'),'phonenumber':String(_0x53da2b[_0x4402('0x2b')]),'description':intUtil[_0x4402('0x41')](_0x56bd01[_0x4402('0x47')],_0x53da2b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4402('0x43')+_0x11ba62['enduserId']+')','ownerid@odata.bind':_0x4402('0x2c')+_0x11ba62['userId']+')','directioncode':_0x11ba62[_0x4402('0x48')]===_0x4402('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4402('0x2c')+_0x11ba62[_0x4402('0x28')]+')','participationtypemask':_0x11ba62[_0x4402('0x48')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x4402('0x43')+_0x11ba62[_0x4402('0x35')]+')','participationtypemask':_0x11ba62[_0x4402('0x48')]===_0x4402('0x49')?0x1:0x2}]},getCustomFields(_0x56bd01[_0x4402('0x4a')],_0x53da2b,_0x56bd01[_0x4402('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x1013e8,'OData-Version':_0x4402('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2ed47f);})[_0x4402('0x11')](function(_0x3ba284){var _0x2e844d=_0x3ba284[_0x4402('0x4b')][_0x4402('0x2d')];var _0x544aef=_0x2e844d['substring'](_0x2e844d['lastIndexOf']('(')+0x1,_0x2e844d[_0x4402('0x2e')](')'));_0x11ba62['ticketId']=_0x544aef;_0x1255bf(_0x11ba62);})['catch'](function(_0x1f74cc){_0x287c93(_0x1f74cc[_0x4402('0x16')]);});});}function emit(_0x192050,_0x5e9e62,_0x277107,_0x1c6149){var _0x33dca7={'uri':util[_0x4402('0x4c')](_0x4402('0x4d'),_0x192050,_0x277107,_0x1c6149)};io['to'](util[_0x4402('0x4c')](_0x4402('0x4e'),_0x5e9e62))[_0x4402('0x4f')](_0x4402('0x50'),_0x33dca7);}exports['cs']=function(_0x3f6bff,_0x5edec3,_0x3f3a00,_0x4bc070,_0x1d7cf2,_0x28612c,_0x2b1648,_0x36a039){var _0x4bb830={};_0x28612c[_0x4402('0x51')]=intUtil[_0x4402('0x52')](_0x28612c[_0x4402('0x51')]);_0x28612c[_0x4402('0x53')]=intUtil['stripTrailingSlash'](_0x28612c['serverUrl']);_0x4bb830[_0x4402('0x48')]=_0x36a039===_0x4402('0x49')||_0x36a039===_0x4402('0x54')?'queue':_0x4402('0x2f');var _0x3e2461=util[_0x4402('0x4c')](_0x4402('0x55'),_0x28612c[_0x4402('0x51')]);var _0x50dfd3=util['format'](_0x4402('0x56'),_0x28612c['tenantId']);var _0x58e61c=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28612c['serverUrl'],_0x5edec3[_0x4402('0x57')],md5(_0x5edec3[_0x4402('0x57')]));if(_0x1d7cf2&&_0x1d7cf2[_0x4402('0x58')]){logger[_0x4402('0x22')](_0x4402('0x59'),'Recording\x20is\x20enabled!');_0x5edec3[_0x4402('0x5a')]=_0x58e61c;}else if(_0x2b1648&&_0x2b1648[_0x4402('0x5b')]&&_0x2b1648[_0x4402('0x5b')]!==_0x4402('0x5c')){logger[_0x4402('0x22')](_0x4402('0x5d'),_0x4402('0x5e'));_0x5edec3[_0x4402('0x5a')]=_0x58e61c;}else{_0x5edec3[_0x4402('0x5a')]='';}return getUser(_0x4bb830,_0x28612c,_0x4bc070,_0x50dfd3,_0x3e2461,_0x36a039)[_0x4402('0x11')](function(_0x150436){logger[_0x4402('0x22')]('['+_0x36a039[_0x4402('0x25')]()+_0x4402('0x5f'),_0x150436[_0x4402('0x28')]);logger[_0x4402('0x22')]('['+_0x36a039[_0x4402('0x25')]()+_0x4402('0x60'),_0x150436['userEmail']);return getEndUser(_0x150436,_0x28612c,_0x50dfd3,_0x3e2461,_0x5edec3,_0x36a039);})[_0x4402('0x11')](function(_0x5df02d){logger['info']('['+_0x36a039['toUpperCase']()+_0x4402('0x61'),_0x5df02d[_0x4402('0x35')]);logger[_0x4402('0x22')]('['+_0x36a039[_0x4402('0x25')]()+_0x4402('0x62'),_0x5edec3['calleridnum']);return getTicket(_0x5df02d,_0x28612c,_0x50dfd3,_0x3e2461,_0x5edec3,_0x3f3a00,_0x36a039);})['then'](function(_0x57729e){logger[_0x4402('0x22')](util['format']('['+_0x36a039[_0x4402('0x25')]()+_0x4402('0x63'),_0x3f3a00['ticketType'],_0x57729e[_0x4402('0x64')]));logger[_0x4402('0x22')](util['format']('['+_0x36a039['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x36a039));if(_0x36a039!=='unmanaged'){logger[_0x4402('0x22')]('['+_0x36a039[_0x4402('0x25')]()+']',_0x4402('0x65'));emit(_0x28612c[_0x4402('0x51')],_0x4bc070[_0x4402('0x66')],_0x3f3a00[_0x4402('0x44')],_0x57729e[_0x4402('0x64')]);}})['catch'](function(_0x424829){logger[_0x4402('0x14')]('['+_0x36a039[_0x4402('0x25')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x424829,{'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 eb1db17..c1deae0 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 _0x2a89=['validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST'];(function(_0x159b72,_0x183756){var _0x4fa7b7=function(_0x43e36b){while(--_0x43e36b){_0x159b72['push'](_0x159b72['shift']());}};_0x4fa7b7(++_0x183756);}(_0x2a89,0xfd));var _0x92a8=function(_0x101aad,_0x13d0d0){_0x101aad=_0x101aad-0x0;var _0x576eef=_0x2a89[_0x101aad];return _0x576eef;};'use strict';var _=require(_0x92a8('0x0'));var rp=require(_0x92a8('0x1'));var md5=require(_0x92a8('0x2'));var util=require('util');var Redis=require(_0x92a8('0x3'));var intUtil=require(_0x92a8('0x4'));var config=require(_0x92a8('0x5'));var logger=require(_0x92a8('0x6'))(_0x92a8('0x7'));config[_0x92a8('0x8')]=_[_0x92a8('0x9')](config[_0x92a8('0x8')],{'host':_0x92a8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x92a8('0x8')]));var headers={'Content-Type':_0x92a8('0xb'),'Accept':'application/json'};function emit(_0x374879,_0x3e2069,_0x254cdb){io['to'](_0x374879)[_0x92a8('0xc')](_0x3e2069,_0x254cdb);}function getTicket(_0x5cb581,_0x213f0b,_0xc2c086,_0x3a1d10,_0x2698ff){logger[_0x92a8('0xd')](_0x92a8('0xe'));var _0x6465de=_['merge']({'responder_id':_0x213f0b['id'],'requester_id':_0xc2c086['id'],'name':util[_0x92a8('0xf')](_0x92a8('0x10'),_0x2698ff['calleridname']),'phone':_0x2698ff[_0x92a8('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3a1d10[_0x92a8('0x12')],_0x2698ff,'\x20'),'description':intUtil[_0x92a8('0x13')](_0x3a1d10[_0x92a8('0x14')],_0x2698ff,'
'),'tags':getTags(_0x3a1d10['Tags'],_0x92a8('0x15'))},getCustomFields(_0x3a1d10[_0x92a8('0x16')],_0x2698ff));_0x6465de[_0x92a8('0x17')]=_[_0x92a8('0x18')](_['keyBy'](_0x6465de[_0x92a8('0x17')],'id'),_0x92a8('0x19'));return request({'uri':util[_0x92a8('0xf')](_0x92a8('0x1a'),_0x5cb581[_0x92a8('0x1b')]),'method':_0x92a8('0x1c'),'body':_0x6465de})['then'](function(_0x120578){logger[_0x92a8('0xd')]('Ticket\x20created!');return _0x120578;});}function getUser(_0x4adff1,_0x3d3594){if(intUtil[_0x92a8('0x1d')](_0x3d3594)){return request({'uri':util[_0x92a8('0xf')](_0x92a8('0x1e'),_0x4adff1[_0x92a8('0x1b')]),'qs':{'email':_0x3d3594}})[_0x92a8('0x1f')](function(_0x4814d8){if(_0x4814d8[_0x92a8('0x20')]){logger[_0x92a8('0xd')](_0x92a8('0x21'));return _[_0x92a8('0x22')](_0x4814d8,function(_0x2126a2){return _0x2126a2['contact'][_0x92a8('0x23')]===_0x3d3594;});}else{logger['info'](_0x92a8('0x24'));return request({'uri':util[_0x92a8('0xf')](_0x92a8('0x25'),_0x4adff1[_0x92a8('0x1b')])})['then'](function(_0x52fff8){logger[_0x92a8('0xd')](_0x92a8('0x26'));return _0x52fff8;});}});}else{logger['info'](_0x92a8('0x27'));return request({'uri':util['format'](_0x92a8('0x25'),_0x4adff1['remoteUri'])})[_0x92a8('0x1f')](function(_0x1141dc){logger['info'](_0x92a8('0x26'));return _0x1141dc;});}}function getEndUser(_0x2e1959,_0x58dacd,_0x463d31){logger['info'](_0x92a8('0x28'),_0x463d31);return request({'uri':util[_0x92a8('0xf')](_0x92a8('0x29'),_0x2e1959['remoteUri']),'qs':{'phone':_0x463d31}})[_0x92a8('0x1f')](function(_0x19fe4f){if(_0x19fe4f['length']){logger['info'](_0x92a8('0x2a'));return _['find'](_0x19fe4f,{'phone':_0x463d31});}else{logger['info'](_0x92a8('0x2b'));return request({'uri':util[_0x92a8('0xf')]('%s/api/v2/contacts',_0x2e1959[_0x92a8('0x1b')]),'method':_0x92a8('0x1c'),'body':{'name':_0x58dacd,'phone':_0x463d31}})[_0x92a8('0x1f')](function(_0x24f009){logger[_0x92a8('0xd')](_0x92a8('0x2c'));return _0x24f009;});}});}function getAuth(_0x2694a9){return util[_0x92a8('0xf')](_0x92a8('0x2d'),new Buffer(_0x2694a9[_0x92a8('0x2e')]+':X')[_0x92a8('0x2f')](_0x92a8('0x30')));}function request(_0x31ca10){logger[_0x92a8('0x31')](_0x92a8('0x32'),JSON[_0x92a8('0x33')](_0x31ca10));return rp(_[_0x92a8('0x9')](_0x31ca10,{'method':_0x92a8('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x83dea2,_0x628bda){var _0x3e41dd=[];if(_0x83dea2&&_0x83dea2[_0x92a8('0x20')]>0x0){_0x3e41dd=_['map'](_0x83dea2,_0x628bda);}return _0x3e41dd;}function getCustomFields(_0x39a5cc,_0x6a194){var _0x23f5c5=[];var _0x5e69f5={'custom_fields':[]};if(_0x39a5cc['length']>0x0){_['forEach'](_0x39a5cc,function(_0x5abf9e){if(_[_0x92a8('0x35')]([_0x92a8('0x36'),_0x92a8('0x37')],_0x5abf9e[_0x92a8('0x38')])&&_0x5abf9e[_0x92a8('0x39')]&&!_0x5abf9e[_0x92a8('0x3a')]){_0x5e69f5[_0x5abf9e[_0x92a8('0x39')][_0x92a8('0x3b')]()]=_0x5abf9e[_0x92a8('0x3c')][_0x92a8('0x2f')]();}else if(_[_0x92a8('0x35')]([_0x92a8('0x36'),_0x92a8('0x37')],_0x5abf9e[_0x92a8('0x38')])&&_0x5abf9e[_0x92a8('0x3d')]&&_0x5abf9e[_0x92a8('0x3a')]){_0x5e69f5[_0x92a8('0x17')][_0x92a8('0x3e')]({'id':_0x5abf9e[_0x92a8('0x3d')],'value':_0x5abf9e[_0x92a8('0x3c')][_0x92a8('0x2f')]()});}else if(_0x5abf9e[_0x92a8('0x38')]===_0x92a8('0x3f')&&_0x5abf9e[_0x92a8('0x40')]&&_0x5abf9e['idField']&&_0x5abf9e['customField']){_0x6a194[_0x5abf9e[_0x92a8('0x40')]]&&_0x5e69f5['custom_fields'][_0x92a8('0x3e')]({'id':_0x5abf9e[_0x92a8('0x3d')],'value':_0x6a194[_0x5abf9e[_0x92a8('0x40')]][_0x92a8('0x2f')]()});}else if(_0x5abf9e[_0x92a8('0x38')]==='customVariable'&&_0x5abf9e[_0x92a8('0x41')]&&_0x5abf9e[_0x92a8('0x41')][_0x92a8('0x15')]&&_0x5abf9e[_0x92a8('0x3d')]&&_0x5abf9e[_0x92a8('0x3a')]){_0x6a194[_0x5abf9e[_0x92a8('0x41')][_0x92a8('0x15')][_0x92a8('0x3b')]()]&&_0x5e69f5[_0x92a8('0x17')]['push']({'id':_0x5abf9e[_0x92a8('0x3d')],'value':_0x6a194[_0x5abf9e[_0x92a8('0x41')][_0x92a8('0x15')][_0x92a8('0x3b')]()][_0x92a8('0x2f')]()});}});}return _0x5e69f5;}exports['queue']=function(_0x1f7efc,_0x3275ff,_0x2ae5eb,_0xe9e2bf,_0x161a6d,_0x833caf){var _0x31f42e,_0x4f09e8;_0x833caf[_0x92a8('0x1b')]=intUtil['stripTrailingSlash'](_0x833caf[_0x92a8('0x1b')]);_0x833caf['serverUrl']=intUtil[_0x92a8('0x42')](_0x833caf[_0x92a8('0x43')]);if(_0x161a6d&&_0x161a6d['monitor_format']){logger[_0x92a8('0xd')](_0x92a8('0x44'),'Recording\x20is\x20enabled!');_0x3275ff['recordingURL']=util[_0x92a8('0xf')](_0x92a8('0x45'),_0x833caf['serverUrl'],_0x3275ff[_0x92a8('0x46')],md5(_0x3275ff[_0x92a8('0x46')]));}else{_0x3275ff[_0x92a8('0x47')]='';}headers[_0x92a8('0x48')]=getAuth(_0x833caf);return getUser(_0x833caf,_0xe9e2bf[_0x92a8('0x23')])['then'](function(_0x340681){_0x31f42e=_0x340681;logger['info'](_0x92a8('0x49'),_0x31f42e['id']);return getEndUser(_0x833caf,_0x3275ff[_0x92a8('0x4a')],_0x3275ff[_0x92a8('0x11')]);})[_0x92a8('0x1f')](function(_0x3747db){_0x4f09e8=_0x3747db;logger[_0x92a8('0xd')](_0x92a8('0x4b'),_0x4f09e8['id']);return getTicket(_0x833caf,_0x31f42e,_0x4f09e8,_0x2ae5eb,_0x3275ff);})[_0x92a8('0x1f')](function(_0x3ebdaa){if(_0x3ebdaa&&_0x3ebdaa['id']){logger['info'](_0x92a8('0x4c'));logger[_0x92a8('0xd')](_0x92a8('0x4d'),_0x3ebdaa['id']);logger[_0x92a8('0xd')](_0x92a8('0x44'),_0x92a8('0x4e'));emit(util[_0x92a8('0xf')](_0x92a8('0x4f'),_0xe9e2bf[_0x92a8('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x92a8('0x50'),_0x833caf[_0x92a8('0x1b')],_0x3ebdaa['id'])});}})[_0x92a8('0x51')](function(_0x9e1262){logger[_0x92a8('0x52')](_0x92a8('0x44'),JSON[_0x92a8('0x33')](_0x9e1262));});};exports[_0x92a8('0x53')]=function(_0x4221bc,_0x6be43,_0x1e8983,_0x46954b,_0x4cbf14,_0x3e4333,_0x172b55){var _0x28a13a,_0x28a5e8;_0x3e4333['remoteUri']=intUtil[_0x92a8('0x42')](_0x3e4333[_0x92a8('0x1b')]);_0x3e4333[_0x92a8('0x43')]=intUtil[_0x92a8('0x42')](_0x3e4333['serverUrl']);if(_0x172b55&&_0x172b55[_0x92a8('0x54')]&&_0x172b55[_0x92a8('0x54')]!=='none'){logger['info'](_0x92a8('0x55'),_0x92a8('0x56'));_0x6be43['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e4333['serverUrl'],_0x6be43[_0x92a8('0x46')],md5(_0x6be43[_0x92a8('0x46')]));}headers[_0x92a8('0x48')]=getAuth(_0x3e4333);return getUser(_0x3e4333,_0x46954b['email'])['then'](function(_0x16eb7b){_0x28a13a=_0x16eb7b;logger['info'](_0x92a8('0x49'),_0x28a13a['id']);return getEndUser(_0x3e4333,_0x6be43[_0x92a8('0x57')],_0x6be43[_0x92a8('0x58')]);})[_0x92a8('0x1f')](function(_0x246eda){_0x28a5e8=_0x246eda;logger[_0x92a8('0xd')](_0x92a8('0x4b'),_0x28a5e8['id']);return getTicket(_0x3e4333,_0x28a13a,_0x28a5e8,_0x1e8983,_0x6be43);})[_0x92a8('0x1f')](function(_0x2a42fd){if(_0x2a42fd&&_0x2a42fd['id']){logger[_0x92a8('0xd')](_0x92a8('0x4c'));logger[_0x92a8('0xd')](_0x92a8('0x4d'),_0x2a42fd['id']);logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x92a8('0xf')](_0x92a8('0x4f'),_0x46954b[_0x92a8('0x15')]),_0x92a8('0x59'),{'uri':util[_0x92a8('0xf')](_0x92a8('0x50'),_0x3e4333[_0x92a8('0x1b')],_0x2a42fd['id'])});}})[_0x92a8('0x51')](function(_0x2ce515){logger[_0x92a8('0x52')](_0x92a8('0x55'),JSON[_0x92a8('0x33')](_0x2ce515));});};exports[_0x92a8('0x5a')]=function(_0x43c989,_0x17ab14,_0x4a189f,_0x334e01,_0x57b44b,_0x40c023){var _0x11c6a0,_0x469db1;_0x40c023['remoteUri']=intUtil[_0x92a8('0x42')](_0x40c023[_0x92a8('0x1b')]);_0x40c023[_0x92a8('0x43')]=intUtil[_0x92a8('0x42')](_0x40c023['serverUrl']);if(_0x57b44b&&_0x57b44b[_0x92a8('0x5b')]){logger['info']('['+_0x17ab14[_0x92a8('0x5c')][_0x92a8('0x5d')]()+']',_0x92a8('0x56'));_0x17ab14[_0x92a8('0x47')]=util['format'](_0x92a8('0x45'),_0x40c023['serverUrl'],_0x17ab14['uniqueid'],md5(_0x17ab14[_0x92a8('0x46')]));}else{_0x17ab14[_0x92a8('0x47')]='';}headers['Authorization']=getAuth(_0x40c023);return getUser(_0x40c023,'')[_0x92a8('0x1f')](function(_0x16f7c0){_0x11c6a0=_0x16f7c0;logger[_0x92a8('0xd')](_0x92a8('0x49'),_0x11c6a0['id']);return getEndUser(_0x40c023,_0x17ab14[_0x92a8('0x4a')],_0x17ab14['calleridnum']);})[_0x92a8('0x1f')](function(_0x12f7e4){_0x469db1=_0x12f7e4;logger['info'](_0x92a8('0x4b'),_0x469db1['id']);return getTicket(_0x40c023,_0x11c6a0,_0x469db1,_0x4a189f,_0x17ab14);})[_0x92a8('0x1f')](function(_0x2bfb95){if(_0x2bfb95){logger[_0x92a8('0xd')](_0x92a8('0x4c'));logger[_0x92a8('0xd')](_0x92a8('0x4d'),_0x2bfb95['id']);}})[_0x92a8('0x51')](function(_0x3d4286){logger['error']('['+_0x17ab14[_0x92a8('0x5c')][_0x92a8('0x5d')]()+']',JSON['stringify'](_0x3d4286));});}; \ No newline at end of file +var _0x521b=['outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','toUpperCase','lastevent','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','debug','[HTTP]','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','includes','customField','idField','variable','variableName','customVariable','Variable','push','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify'];(function(_0x2eafd7,_0x16e8d4){var _0x1e2820=function(_0x1ef4ac){while(--_0x1ef4ac){_0x2eafd7['push'](_0x2eafd7['shift']());}};_0x1e2820(++_0x16e8d4);}(_0x521b,0x19f));var _0xb521=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0x521b[_0x3d9557];return _0x359ff8;};'use strict';var _=require('lodash');var rp=require(_0xb521('0x0'));var md5=require(_0xb521('0x1'));var util=require(_0xb521('0x2'));var Redis=require(_0xb521('0x3'));var intUtil=require('./util');var config=require(_0xb521('0x4'));var logger=require(_0xb521('0x5'))(_0xb521('0x6'));config[_0xb521('0x7')]=_[_0xb521('0x8')](config[_0xb521('0x7')],{'host':_0xb521('0x9'),'port':0x18eb});var io=require(_0xb521('0xa'))(new Redis(config[_0xb521('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xb521('0xb')};function emit(_0x16a05c,_0x43ca2a,_0x2dad0b){io['to'](_0x16a05c)[_0xb521('0xc')](_0x43ca2a,_0x2dad0b);}function getTicket(_0xbd6f00,_0x558b46,_0x1d05e6,_0x41eec7,_0x33ac19){logger['info'](_0xb521('0xd'));var _0x24f224=_[_0xb521('0xe')]({'responder_id':_0x558b46['id'],'requester_id':_0x1d05e6['id'],'name':util[_0xb521('0xf')](_0xb521('0x10'),_0x33ac19['calleridname']),'phone':_0x33ac19[_0xb521('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x41eec7[_0xb521('0x12')],_0x33ac19,'\x20'),'description':intUtil[_0xb521('0x13')](_0x41eec7[_0xb521('0x14')],_0x33ac19,_0xb521('0x15')),'tags':getTags(_0x41eec7[_0xb521('0x16')],_0xb521('0x17'))},getCustomFields(_0x41eec7[_0xb521('0x18')],_0x33ac19));_0x24f224[_0xb521('0x19')]=_[_0xb521('0x1a')](_[_0xb521('0x1b')](_0x24f224[_0xb521('0x19')],'id'),_0xb521('0x1c'));return request({'uri':util['format']('%s/api/v2/tickets',_0xbd6f00[_0xb521('0x1d')]),'method':_0xb521('0x1e'),'body':_0x24f224})[_0xb521('0x1f')](function(_0x3d1363){logger[_0xb521('0x20')](_0xb521('0x21'));return _0x3d1363;});}function getUser(_0x461b39,_0x37b46b){if(intUtil[_0xb521('0x22')](_0x37b46b)){return request({'uri':util[_0xb521('0xf')](_0xb521('0x23'),_0x461b39['remoteUri']),'qs':{'email':_0x37b46b}})[_0xb521('0x1f')](function(_0x39a637){if(_0x39a637[_0xb521('0x24')]){logger[_0xb521('0x20')](_0xb521('0x25'));return _['find'](_0x39a637,function(_0x11e6d2){return _0x11e6d2[_0xb521('0x26')]['email']===_0x37b46b;});}else{logger[_0xb521('0x20')](_0xb521('0x27'));return request({'uri':util['format'](_0xb521('0x28'),_0x461b39[_0xb521('0x1d')])})[_0xb521('0x1f')](function(_0x3f7da9){logger[_0xb521('0x20')](_0xb521('0x29'));return _0x3f7da9;});}});}else{logger['info'](_0xb521('0x2a'));return request({'uri':util[_0xb521('0xf')](_0xb521('0x28'),_0x461b39[_0xb521('0x1d')])})[_0xb521('0x1f')](function(_0x635a2a){logger[_0xb521('0x20')](_0xb521('0x29'));return _0x635a2a;});}}function getEndUser(_0x31834c,_0x2a1dbc,_0x2504b7){logger['info'](_0xb521('0x2b'),_0x2504b7);return request({'uri':util[_0xb521('0xf')]('%s/api/v2/contacts',_0x31834c[_0xb521('0x1d')]),'qs':{'phone':_0x2504b7}})['then'](function(_0x3e0420){if(_0x3e0420['length']){logger[_0xb521('0x20')](_0xb521('0x2c'));return _[_0xb521('0x2d')](_0x3e0420,{'phone':_0x2504b7});}else{logger[_0xb521('0x20')](_0xb521('0x2e'));return request({'uri':util[_0xb521('0xf')](_0xb521('0x2f'),_0x31834c[_0xb521('0x1d')]),'method':_0xb521('0x1e'),'body':{'name':_0x2a1dbc,'phone':_0x2504b7}})[_0xb521('0x1f')](function(_0x2180bd){logger[_0xb521('0x20')]('Enduser\x20created.');return _0x2180bd;});}});}function getAuth(_0x4ebb2d){return util[_0xb521('0xf')](_0xb521('0x30'),new Buffer(_0x4ebb2d[_0xb521('0x31')]+':X')[_0xb521('0x32')]('base64'));}function request(_0x4c24ab){logger[_0xb521('0x33')](_0xb521('0x34'),JSON['stringify'](_0x4c24ab));return rp(_['defaults'](_0x4c24ab,{'method':_0xb521('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x2fe2cf,_0x5ccef8){var _0x3ec3e7=[];if(_0x2fe2cf&&_0x2fe2cf[_0xb521('0x24')]>0x0){_0x3ec3e7=_[_0xb521('0x36')](_0x2fe2cf,_0x5ccef8);}return _0x3ec3e7;}function getCustomFields(_0x6d3396,_0x26b973){var _0x59696f=[];var _0x43c3a6={'custom_fields':[]};if(_0x6d3396[_0xb521('0x24')]>0x0){_[_0xb521('0x37')](_0x6d3396,function(_0x286638){if(_['includes']([_0xb521('0x38'),_0xb521('0x39')],_0x286638[_0xb521('0x3a')])&&_0x286638[_0xb521('0x3b')]&&!_0x286638['customField']){_0x43c3a6[_0x286638[_0xb521('0x3b')][_0xb521('0x3c')]()]=_0x286638[_0xb521('0x3d')][_0xb521('0x32')]();}else if(_[_0xb521('0x3e')]([_0xb521('0x38'),_0xb521('0x39')],_0x286638[_0xb521('0x3a')])&&_0x286638['idField']&&_0x286638[_0xb521('0x3f')]){_0x43c3a6[_0xb521('0x19')]['push']({'id':_0x286638[_0xb521('0x40')],'value':_0x286638[_0xb521('0x3d')]['toString']()});}else if(_0x286638['type']===_0xb521('0x41')&&_0x286638[_0xb521('0x42')]&&_0x286638['idField']&&_0x286638['customField']){_0x26b973[_0x286638['variableName']]&&_0x43c3a6[_0xb521('0x19')]['push']({'id':_0x286638[_0xb521('0x40')],'value':_0x26b973[_0x286638['variableName']][_0xb521('0x32')]()});}else if(_0x286638[_0xb521('0x3a')]===_0xb521('0x43')&&_0x286638[_0xb521('0x44')]&&_0x286638[_0xb521('0x44')][_0xb521('0x17')]&&_0x286638['idField']&&_0x286638['customField']){_0x26b973[_0x286638[_0xb521('0x44')][_0xb521('0x17')][_0xb521('0x3c')]()]&&_0x43c3a6[_0xb521('0x19')][_0xb521('0x45')]({'id':_0x286638[_0xb521('0x40')],'value':_0x26b973[_0x286638['Variable']['name'][_0xb521('0x3c')]()][_0xb521('0x32')]()});}});}return _0x43c3a6;}exports[_0xb521('0x46')]=function(_0x1560f0,_0x5022eb,_0x8c3d50,_0xd0135b,_0x34e7f4,_0x2d50db){var _0x196a72,_0x1e69e5;_0x2d50db[_0xb521('0x1d')]=intUtil['stripTrailingSlash'](_0x2d50db[_0xb521('0x1d')]);_0x2d50db[_0xb521('0x47')]=intUtil[_0xb521('0x48')](_0x2d50db[_0xb521('0x47')]);if(_0x34e7f4&&_0x34e7f4[_0xb521('0x49')]){logger['info'](_0xb521('0x4a'),_0xb521('0x4b'));_0x5022eb[_0xb521('0x4c')]=util['format'](_0xb521('0x4d'),_0x2d50db[_0xb521('0x47')],_0x5022eb[_0xb521('0x4e')],md5(_0x5022eb[_0xb521('0x4e')]));}else{_0x5022eb[_0xb521('0x4c')]='';}headers['Authorization']=getAuth(_0x2d50db);return getUser(_0x2d50db,_0xd0135b[_0xb521('0x4f')])[_0xb521('0x1f')](function(_0x5acb08){_0x196a72=_0x5acb08;logger[_0xb521('0x20')](_0xb521('0x50'),_0x196a72['id']);return getEndUser(_0x2d50db,_0x5022eb[_0xb521('0x51')],_0x5022eb[_0xb521('0x11')]);})['then'](function(_0x4519ff){_0x1e69e5=_0x4519ff;logger[_0xb521('0x20')](_0xb521('0x52'),_0x1e69e5['id']);return getTicket(_0x2d50db,_0x196a72,_0x1e69e5,_0x8c3d50,_0x5022eb);})[_0xb521('0x1f')](function(_0x11cf1e){if(_0x11cf1e&&_0x11cf1e['id']){logger[_0xb521('0x20')](_0xb521('0x21'));logger[_0xb521('0x20')]('The\x20Ticket\x20ID\x20is:',_0x11cf1e['id']);logger['info'](_0xb521('0x4a'),_0xb521('0x53'));emit(util['format'](_0xb521('0x54'),_0xd0135b['name']),_0xb521('0x55'),{'uri':util[_0xb521('0xf')](_0xb521('0x56'),_0x2d50db[_0xb521('0x1d')],_0x11cf1e['id'])});}})[_0xb521('0x57')](function(_0x430e3e){logger[_0xb521('0x58')](_0xb521('0x4a'),JSON[_0xb521('0x59')](_0x430e3e));});};exports[_0xb521('0x5a')]=function(_0x2b22b6,_0x47d006,_0x328a21,_0x3059b9,_0x2ef57b,_0x378598,_0x3438b1){var _0x10ead7,_0x1624ce;_0x378598[_0xb521('0x1d')]=intUtil[_0xb521('0x48')](_0x378598['remoteUri']);_0x378598[_0xb521('0x47')]=intUtil[_0xb521('0x48')](_0x378598[_0xb521('0x47')]);if(_0x3438b1&&_0x3438b1[_0xb521('0x5b')]&&_0x3438b1['recordingFormat']!==_0xb521('0x5c')){logger[_0xb521('0x20')](_0xb521('0x5d'),'Recording\x20is\x20enabled!');_0x47d006[_0xb521('0x4c')]=util['format'](_0xb521('0x4d'),_0x378598[_0xb521('0x47')],_0x47d006[_0xb521('0x4e')],md5(_0x47d006[_0xb521('0x4e')]));}headers[_0xb521('0x5e')]=getAuth(_0x378598);return getUser(_0x378598,_0x3059b9['email'])[_0xb521('0x1f')](function(_0x72f3fb){_0x10ead7=_0x72f3fb;logger[_0xb521('0x20')]('The\x20User\x20ID\x20is:',_0x10ead7['id']);return getEndUser(_0x378598,_0x47d006[_0xb521('0x5f')],_0x47d006[_0xb521('0x60')]);})[_0xb521('0x1f')](function(_0x2e5a55){_0x1624ce=_0x2e5a55;logger[_0xb521('0x20')]('The\x20Enduser\x20ID\x20is:',_0x1624ce['id']);return getTicket(_0x378598,_0x10ead7,_0x1624ce,_0x328a21,_0x47d006);})[_0xb521('0x1f')](function(_0x2b507d){if(_0x2b507d&&_0x2b507d['id']){logger[_0xb521('0x20')]('Ticket\x20created!');logger[_0xb521('0x20')](_0xb521('0x61'),_0x2b507d['id']);logger[_0xb521('0x20')](_0xb521('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb521('0xf')](_0xb521('0x54'),_0x3059b9[_0xb521('0x17')]),_0xb521('0x55'),{'uri':util[_0xb521('0xf')](_0xb521('0x56'),_0x378598[_0xb521('0x1d')],_0x2b507d['id'])});}})['catch'](function(_0x37994a){logger[_0xb521('0x58')](_0xb521('0x5d'),JSON['stringify'](_0x37994a));});};exports[_0xb521('0x62')]=function(_0x19f1b3,_0x562592,_0x26bc8f,_0x4c102c,_0xb93118,_0x51de22){var _0x1bf64e,_0x1c3b75;_0x51de22[_0xb521('0x1d')]=intUtil['stripTrailingSlash'](_0x51de22[_0xb521('0x1d')]);_0x51de22[_0xb521('0x47')]=intUtil[_0xb521('0x48')](_0x51de22[_0xb521('0x47')]);if(_0xb93118&&_0xb93118['monitor_format']){logger[_0xb521('0x20')]('['+_0x562592['lastevent'][_0xb521('0x63')]()+']',_0xb521('0x4b'));_0x562592[_0xb521('0x4c')]=util[_0xb521('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51de22[_0xb521('0x47')],_0x562592['uniqueid'],md5(_0x562592[_0xb521('0x4e')]));}else{_0x562592[_0xb521('0x4c')]='';}headers[_0xb521('0x5e')]=getAuth(_0x51de22);return getUser(_0x51de22,'')[_0xb521('0x1f')](function(_0x44d2ef){_0x1bf64e=_0x44d2ef;logger['info'](_0xb521('0x50'),_0x1bf64e['id']);return getEndUser(_0x51de22,_0x562592[_0xb521('0x51')],_0x562592[_0xb521('0x11')]);})[_0xb521('0x1f')](function(_0x38f978){_0x1c3b75=_0x38f978;logger['info'](_0xb521('0x52'),_0x1c3b75['id']);return getTicket(_0x51de22,_0x1bf64e,_0x1c3b75,_0x26bc8f,_0x562592);})[_0xb521('0x1f')](function(_0x29d78d){if(_0x29d78d){logger['info'](_0xb521('0x21'));logger[_0xb521('0x20')](_0xb521('0x61'),_0x29d78d['id']);}})[_0xb521('0x57')](function(_0x18a9a5){logger[_0xb521('0x58')]('['+_0x562592[_0xb521('0x64')]['toUpperCase']()+']',JSON['stringify'](_0x18a9a5));});}; \ 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 8866cd8..283ddfa 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 _0x5cb8=['mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','toUpperCase','GET','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s'];(function(_0x560101,_0x48218c){var _0x5be06d=function(_0x2598a9){while(--_0x2598a9){_0x560101['push'](_0x560101['shift']());}};_0x5be06d(++_0x48218c);}(_0x5cb8,0x1e7));var _0x85cb=function(_0x16b22d,_0x2a2f04){_0x16b22d=_0x16b22d-0x0;var _0x27dbaf=_0x5cb8[_0x16b22d];return _0x27dbaf;};'use strict';var _=require(_0x85cb('0x0'));var rp=require(_0x85cb('0x1'));var md5=require('md5');var util=require(_0x85cb('0x2'));var moment=require(_0x85cb('0x3'));var Promise=require(_0x85cb('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x85cb('0x5'))(_0x85cb('0x6'));config['redis']=_[_0x85cb('0x7')](config['redis'],{'host':_0x85cb('0x8'),'port':0x18eb});var io=require(_0x85cb('0x9'))(new Redis(config[_0x85cb('0xa')]));function getAdminId(_0x1f41f9,_0xdb5ce5,_0x451de7,_0x18898c){return new Promise(function(_0x514f07,_0x193b25){var _0x9fe101=![];var _0x4a96b1={'method':'GET','uri':_0x18898c+_0x85cb('0xb'),'json':!![]};_0x4a96b1[_0x85cb('0xc')]=_0x451de7;logger[_0x85cb('0xd')](_0x85cb('0xe'));return rp(_0x4a96b1)[_0x85cb('0xf')](function(_0x2cead9){if(_0x2cead9){var _0x3dc237=_0x2cead9['users'];var _0x203c99=null;for(_0x203c99=0x0;_0x203c99<_0x3dc237[_0x85cb('0x10')];_0x203c99++){if(_0x3dc237[_0x203c99][_0x85cb('0x11')]===_0x1f41f9[_0x85cb('0x12')]){_0x1f41f9[_0x85cb('0x13')]=_0x3dc237[_0x203c99]['id'];_0x9fe101=!![];}}if(_0x9fe101){logger[_0x85cb('0xd')](_0x85cb('0x14'),_0x1f41f9[_0x85cb('0x13')]);_0x514f07(_0x1f41f9);}else{_0x193b25({'statusCode':0x194,'message':_0x85cb('0x15')});}}else{_0x193b25({'statusCode':0x194,'message':_0x85cb('0x15')});}})[_0x85cb('0x16')](function(_0x431e05){logger[_0x85cb('0x17')]('['+[_0xdb5ce5['toUpperCase']()]+']',_0x431e05[_0x85cb('0x18')]);_0x193b25(_0x431e05);});});}function getUser(_0x180ba9,_0x322ac8,_0x1b2512){return function(_0x3b10d8){return new Promise(function(_0x4df04c,_0x1c4bc7){var _0x6f48a7={'method':'GET','uri':_0x1b2512+_0x85cb('0xb'),'json':!![]};_0x6f48a7[_0x85cb('0xc')]=_0x322ac8;logger[_0x85cb('0xd')](_0x85cb('0x19'));return rp(_0x6f48a7)[_0x85cb('0xf')](function(_0x20d8f9){if(_0x20d8f9){var _0xac2201=_0x20d8f9[_0x85cb('0x1a')];var _0x452bea=![];var _0x330ca4=null;if(_0x3b10d8['agentEmail']!==null){logger[_0x85cb('0xd')](_0x85cb('0x1b'),_0x3b10d8[_0x85cb('0x1c')]);_0x3b10d8[_0x85cb('0x1d')]=_0x3b10d8[_0x85cb('0x1c')];for(_0x330ca4=0x0;_0x330ca4<_0xac2201[_0x85cb('0x10')];_0x330ca4++){if(_0xac2201[_0x330ca4][_0x85cb('0x11')]===_0x3b10d8['agentEmail']){_0x452bea=!![];_0x3b10d8[_0x85cb('0x1e')]=_0xac2201[_0x330ca4]['id'];logger[_0x85cb('0xd')]('User\x20found:',_0x3b10d8[_0x85cb('0x1e')]);}}}if(!_0x452bea){logger['info'](_0x85cb('0x1f'));_0x3b10d8['userEmail']=_0x3b10d8[_0x85cb('0x12')];_0x3b10d8[_0x85cb('0x1e')]=_0x3b10d8[_0x85cb('0x13')];_0x452bea=!![];}if(_0x452bea){_0x4df04c(_0x3b10d8);}else{_0x1c4bc7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1c4bc7({'statusCode':0x194,'message':_0x85cb('0x15')});}})[_0x85cb('0x16')](function(_0x1fa7a0){logger[_0x85cb('0x17')]('['+[_0x180ba9[_0x85cb('0x20')]()]+']',_0x1fa7a0[_0x85cb('0x18')]);_0x1c4bc7(_0x1fa7a0);});});};}function searchContact(_0x476b19,_0x52306c,_0x178c69,_0x5c9be1){return new Promise(function(_0x2087e2,_0x4c0e15){var _0x3b2773={'method':_0x85cb('0x21'),'headers':_0x52306c,'uri':_0x476b19+_0x85cb('0x22')+_0x5c9be1+_0x85cb('0x23')+_0x178c69+_0x85cb('0x24'),'json':!![]};rp(_0x3b2773)[_0x85cb('0xf')](function(_0x53b296){var _0x2338ae=_[_0x85cb('0x25')](_0x53b296['contacts'][_0x85cb('0x26')],[_0x178c69,_0x5c9be1]);_0x2087e2(_0x2338ae);})[_0x85cb('0x16')](function(_0x17d9c5){_0x4c0e15(_0x17d9c5);});});}function getEndUser(_0x1d9538,_0x51d068,_0x3172c7){return function(_0x516af6){return new Promise(function(_0x120cd4,_0x1d9103){logger[_0x85cb('0xd')](util[_0x85cb('0x27')](_0x85cb('0x28'),_0x516af6['contactNumber']));searchContact(_0x3172c7,_0x51d068,_0x85cb('0x29'),_0x516af6[_0x85cb('0x2a')])['then'](function(_0x1837b4){if(_0x1837b4){_0x516af6[_0x85cb('0x2b')]=_0x1837b4['id'];logger[_0x85cb('0xd')](_0x85cb('0x2c'),_0x516af6[_0x85cb('0x2b')]);return _0x120cd4(_0x516af6);}searchContact(_0x3172c7,_0x51d068,_0x85cb('0x2d'),_0x516af6[_0x85cb('0x2a')])[_0x85cb('0xf')](function(_0x2aed2b){if(_0x2aed2b){_0x516af6['endUserId']=_0x2aed2b['id'];logger[_0x85cb('0xd')](_0x85cb('0x2e'),_0x516af6[_0x85cb('0x2b')]);return _0x120cd4(_0x516af6);}createEndUser(_0x516af6,_0x1d9538,_0x51d068,_0x3172c7)[_0x85cb('0xf')](function(_0x3f2cb8){logger[_0x85cb('0xd')](_0x85cb('0x2f'),_0x3f2cb8[_0x85cb('0x2b')]);return _0x120cd4(_0x3f2cb8);});});})[_0x85cb('0x16')](function(_0x36d26c){_0x1d9103(_0x36d26c);});});};}function createEndUser(_0x2efeb6,_0x878fd4,_0x2a2dc5,_0x47f34b){return new Promise(function(_0x250d2c,_0x2124c6){var _0x11ed66=moment();var _0xc6a51a={'method':_0x85cb('0x30'),'uri':_0x47f34b+_0x85cb('0x31'),'body':{'contact':{'last_name':_0x2efeb6[_0x85cb('0x2a')],'work_number':_0x2efeb6[_0x85cb('0x2a')],'mobile_number':_0x2efeb6['contactNumber'],'owner_id':_0x2efeb6['userId'],'created_at':_0x11ed66[_0x85cb('0x27')](_0x85cb('0x32'))}},'json':!![]};_0xc6a51a[_0x85cb('0xc')]=_0x2a2dc5;logger['info'](_0x85cb('0x33'));return rp(_0xc6a51a)[_0x85cb('0xf')](function(_0x5edaa7){_0x2efeb6[_0x85cb('0x2b')]=_0x5edaa7[_0x85cb('0x34')]['id'];_0x250d2c(_0x2efeb6);})['catch'](function(_0x55577a){logger[_0x85cb('0x17')]('['+[_0x878fd4[_0x85cb('0x20')]()]+']',_0x55577a[_0x85cb('0x18')]);_0x2124c6(_0x55577a['message']);});});}function getTicket(_0x3f6cd4,_0xd4ad61,_0x41cc16,_0x3b334a,_0x1c769c){return function(_0x3d6362){logger[_0x85cb('0xd')](_0x85cb('0x35'));return new Promise(function(_0x399aac,_0x434817){var _0x4ced40=moment();var _0x43d0c3={'method':'POST','uri':_0x41cc16+_0x85cb('0x36'),'body':{'title':intUtil[_0x85cb('0x37')](_0x3b334a[_0x85cb('0x38')],_0x1c769c,'\x20'),'description':intUtil[_0x85cb('0x37')](_0x3b334a['Descriptions'],_0x1c769c,'\x0a'),'owner_id':_0x3d6362[_0x85cb('0x1e')],'creater_id':_0x3d6362['adminId'],'targetable_id':_0x3d6362[_0x85cb('0x2b')],'targetable_type':_0x85cb('0x39'),'created_at':_0x4ced40[_0x85cb('0x27')](_0x85cb('0x32')),'due_date':_0x4ced40[_0x85cb('0x3a')](0x1e,'m')[_0x85cb('0x27')](_0x85cb('0x32'))},'json':!![]};_0x43d0c3['headers']=_0xd4ad61;return rp(_0x43d0c3)[_0x85cb('0xf')](function(_0x516a66){_0x3d6362[_0x85cb('0x3b')]=_0x516a66[_0x85cb('0x3c')]['id'];logger[_0x85cb('0xd')](_0x85cb('0x3d'),_0x3d6362[_0x85cb('0x3b')]);_0x399aac(_0x3d6362);})[_0x85cb('0x16')](function(_0x2d54a4){logger['error']('['+[_0x3f6cd4[_0x85cb('0x20')]()]+']',_0x2d54a4[_0x85cb('0x18')]);_0x434817(_0x2d54a4['message']);});});};}function emit(_0x2dc5c8,_0x5ba2ea,_0x5549f6){var _0x1ed4bf={'uri':_0x2dc5c8+_0x85cb('0x3e')+_0x5549f6};io['to'](util[_0x85cb('0x27')](_0x85cb('0x3f'),_0x5ba2ea))['emit'](_0x85cb('0x40'),_0x1ed4bf);}exports['cs']=function(_0x1d0237,_0x2f3916,_0x15a232,_0x524484,_0x1b575f,_0x1df9dc,_0x97b7ac,_0x7e3452){var _0x243853={};var _0x223f54={'Authorization':_0x85cb('0x41')+_0x1df9dc[_0x85cb('0x42')]};_0x1df9dc[_0x85cb('0x43')]=intUtil[_0x85cb('0x44')](_0x1df9dc[_0x85cb('0x43')]);_0x1df9dc[_0x85cb('0x45')]=intUtil[_0x85cb('0x44')](_0x1df9dc['serverUrl']);var _0x3cecc9=_0x1df9dc['remoteUri'];_0x243853['adminEmail']=_0x1df9dc[_0x85cb('0x46')];_0x243853['contactNumber']=_0x7e3452[_0x85cb('0x47')]()==='outbound'?_0x2f3916[_0x85cb('0x48')]:_0x2f3916[_0x85cb('0x49')];_0x243853['callDirection']=_0x7e3452===_0x85cb('0x4a')||_0x7e3452===_0x85cb('0x4b')?_0x85cb('0x4a'):_0x85cb('0x4c');if(_0x524484){_0x243853[_0x85cb('0x1c')]=_0x524484['email'];}var _0x38b8e2=util[_0x85cb('0x27')](_0x85cb('0x4d'),_0x1df9dc[_0x85cb('0x45')],_0x2f3916[_0x85cb('0x4e')],md5(_0x2f3916['uniqueid']));if(_0x1b575f&&_0x1b575f[_0x85cb('0x4f')]){logger[_0x85cb('0xd')](_0x85cb('0x50'),'Recording\x20is\x20enabled!');_0x2f3916[_0x85cb('0x51')]=_0x38b8e2;}else if(_0x97b7ac&&_0x97b7ac[_0x85cb('0x52')]&&_0x97b7ac[_0x85cb('0x52')]!==_0x85cb('0x53')){logger[_0x85cb('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2f3916[_0x85cb('0x51')]=_0x38b8e2;}else{_0x2f3916[_0x85cb('0x51')]='';}return getAdminId(_0x243853,_0x7e3452,_0x223f54,_0x3cecc9)[_0x85cb('0xf')](getUser(_0x7e3452,_0x223f54,_0x3cecc9))[_0x85cb('0xf')](getEndUser(_0x7e3452,_0x223f54,_0x3cecc9))[_0x85cb('0xf')](getTicket(_0x7e3452,_0x223f54,_0x3cecc9,_0x15a232,_0x2f3916))[_0x85cb('0xf')](function(_0x354273){logger[_0x85cb('0xd')](util['format'](_0x85cb('0x54'),_0x354273[_0x85cb('0x3b')]));if(_0x7e3452!=='unmanaged'){logger[_0x85cb('0xd')]('['+[_0x7e3452['toUpperCase']()]+']',_0x85cb('0x55'));emit(_0x3cecc9,_0x524484['name'],_0x354273['endUserId']);}})[_0x85cb('0x16')](function(_0x5b6281){logger[_0x85cb('0x17')]('['+[_0x7e3452['toUpperCase']()]+_0x85cb('0x56'),util[_0x85cb('0x57')](_0x5b6281,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfcab=['Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','md5','util','freshsales','redis','defaults','localhost','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','/api/selector/owners','headers','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','toUpperCase','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact'];(function(_0x41b217,_0x5b6d5f){var _0x5130f3=function(_0x3566c6){while(--_0x3566c6){_0x41b217['push'](_0x41b217['shift']());}};_0x5130f3(++_0x5b6d5f);}(_0xfcab,0xbf));var _0xbfca=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0xfcab[_0x20beae];return _0xf5725;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xbfca('0x0'));var util=require(_0xbfca('0x1'));var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xbfca('0x2'));config[_0xbfca('0x3')]=_[_0xbfca('0x4')](config['redis'],{'host':_0xbfca('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbfca('0x3')]));function getAdminId(_0x15f14b,_0x2ae82f,_0x3a96a7,_0x4eaaa8){return new Promise(function(_0xa11ebf,_0x1f2816){var _0x20a0c4=![];var _0x5238e0={'method':'GET','uri':_0x4eaaa8+'/api/selector/owners','json':!![]};_0x5238e0['headers']=_0x3a96a7;logger[_0xbfca('0x6')](_0xbfca('0x7'));return rp(_0x5238e0)[_0xbfca('0x8')](function(_0x1eaa43){if(_0x1eaa43){var _0xb3dd1f=_0x1eaa43[_0xbfca('0x9')];var _0x37ab66=null;for(_0x37ab66=0x0;_0x37ab66<_0xb3dd1f['length'];_0x37ab66++){if(_0xb3dd1f[_0x37ab66][_0xbfca('0xa')]===_0x15f14b['adminEmail']){_0x15f14b[_0xbfca('0xb')]=_0xb3dd1f[_0x37ab66]['id'];_0x20a0c4=!![];}}if(_0x20a0c4){logger[_0xbfca('0x6')](_0xbfca('0xc'),_0x15f14b[_0xbfca('0xb')]);_0xa11ebf(_0x15f14b);}else{_0x1f2816({'statusCode':0x194,'message':_0xbfca('0xd')});}}else{_0x1f2816({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xbfca('0xe')](function(_0x1976b2){logger[_0xbfca('0xf')]('['+[_0x2ae82f['toUpperCase']()]+']',_0x1976b2[_0xbfca('0x10')]);_0x1f2816(_0x1976b2);});});}function getUser(_0x2dc1e4,_0x59205c,_0x25eef2){return function(_0x13561f){return new Promise(function(_0x35ed67,_0x365efe){var _0x402ce7={'method':_0xbfca('0x11'),'uri':_0x25eef2+_0xbfca('0x12'),'json':!![]};_0x402ce7[_0xbfca('0x13')]=_0x59205c;logger[_0xbfca('0x6')]('Getting\x20user\x20list');return rp(_0x402ce7)['then'](function(_0x255a4c){if(_0x255a4c){var _0x5b8a3a=_0x255a4c['users'];var _0x6bd1be=![];var _0x4ed86f=null;if(_0x13561f[_0xbfca('0x14')]!==null){logger['info'](_0xbfca('0x15'),_0x13561f[_0xbfca('0x14')]);_0x13561f[_0xbfca('0x16')]=_0x13561f['agentEmail'];for(_0x4ed86f=0x0;_0x4ed86f<_0x5b8a3a[_0xbfca('0x17')];_0x4ed86f++){if(_0x5b8a3a[_0x4ed86f][_0xbfca('0xa')]===_0x13561f[_0xbfca('0x14')]){_0x6bd1be=!![];_0x13561f['userId']=_0x5b8a3a[_0x4ed86f]['id'];logger[_0xbfca('0x6')](_0xbfca('0x18'),_0x13561f[_0xbfca('0x19')]);}}}if(!_0x6bd1be){logger[_0xbfca('0x6')]('Admin\x20selected');_0x13561f['userEmail']=_0x13561f['adminEmail'];_0x13561f[_0xbfca('0x19')]=_0x13561f[_0xbfca('0xb')];_0x6bd1be=!![];}if(_0x6bd1be){_0x35ed67(_0x13561f);}else{_0x365efe({'statusCode':0x194,'message':_0xbfca('0xd')});}}else{_0x365efe({'statusCode':0x194,'message':_0xbfca('0xd')});}})[_0xbfca('0xe')](function(_0x1a816d){logger['error']('['+[_0x2dc1e4[_0xbfca('0x1a')]()]+']',_0x1a816d[_0xbfca('0x10')]);_0x365efe(_0x1a816d);});});};}function searchContact(_0x45da1c,_0x1a1ed6,_0x3c4941,_0x205fc7){return new Promise(function(_0x2b347a,_0x55176d){var _0x1cfc58={'method':_0xbfca('0x11'),'headers':_0x1a1ed6,'uri':_0x45da1c+_0xbfca('0x1b')+_0x205fc7+'&f='+_0x3c4941+'&entities=contact','json':!![]};rp(_0x1cfc58)[_0xbfca('0x8')](function(_0x3417f9){var _0x497614=_[_0xbfca('0x1c')](_0x3417f9['contacts'][_0xbfca('0x1d')],[_0x3c4941,_0x205fc7]);_0x2b347a(_0x497614);})[_0xbfca('0xe')](function(_0x11c6f3){_0x55176d(_0x11c6f3);});});}function getEndUser(_0x556f50,_0x399550,_0x6a544f){return function(_0x1bb4b8){return new Promise(function(_0xd2862e,_0xa21ee4){logger['info'](util[_0xbfca('0x1e')](_0xbfca('0x1f'),_0x1bb4b8['contactNumber']));searchContact(_0x6a544f,_0x399550,_0xbfca('0x20'),_0x1bb4b8[_0xbfca('0x21')])[_0xbfca('0x8')](function(_0xc7ba6e){if(_0xc7ba6e){_0x1bb4b8[_0xbfca('0x22')]=_0xc7ba6e['id'];logger['info'](_0xbfca('0x23'),_0x1bb4b8[_0xbfca('0x22')]);return _0xd2862e(_0x1bb4b8);}searchContact(_0x6a544f,_0x399550,_0xbfca('0x24'),_0x1bb4b8[_0xbfca('0x21')])[_0xbfca('0x8')](function(_0x3b29fa){if(_0x3b29fa){_0x1bb4b8[_0xbfca('0x22')]=_0x3b29fa['id'];logger[_0xbfca('0x6')]('Contact\x20found\x20work_number:',_0x1bb4b8['endUserId']);return _0xd2862e(_0x1bb4b8);}createEndUser(_0x1bb4b8,_0x556f50,_0x399550,_0x6a544f)[_0xbfca('0x8')](function(_0x5bd3ca){logger['info'](_0xbfca('0x25'),_0x5bd3ca['endUserId']);return _0xd2862e(_0x5bd3ca);});});})[_0xbfca('0xe')](function(_0xf699c3){_0xa21ee4(_0xf699c3);});});};}function createEndUser(_0x5d077f,_0x2efe66,_0x4812e1,_0x19e6c8){return new Promise(function(_0x582768,_0xbd935c){var _0x520774=moment();var _0x64c935={'method':_0xbfca('0x26'),'uri':_0x19e6c8+_0xbfca('0x27'),'body':{'contact':{'last_name':_0x5d077f['contactNumber'],'work_number':_0x5d077f[_0xbfca('0x21')],'mobile_number':_0x5d077f[_0xbfca('0x21')],'owner_id':_0x5d077f[_0xbfca('0x19')],'created_at':_0x520774[_0xbfca('0x1e')](_0xbfca('0x28'))}},'json':!![]};_0x64c935['headers']=_0x4812e1;logger['info'](_0xbfca('0x29'));return rp(_0x64c935)[_0xbfca('0x8')](function(_0x4991f5){_0x5d077f[_0xbfca('0x22')]=_0x4991f5[_0xbfca('0x2a')]['id'];_0x582768(_0x5d077f);})[_0xbfca('0xe')](function(_0x52bf9f){logger[_0xbfca('0xf')]('['+[_0x2efe66[_0xbfca('0x1a')]()]+']',_0x52bf9f['message']);_0xbd935c(_0x52bf9f[_0xbfca('0x10')]);});});}function getTicket(_0x3abe3d,_0x47af6c,_0x2352cf,_0x43bbb8,_0x28a2fe){return function(_0x150edc){logger[_0xbfca('0x6')](_0xbfca('0x2b'));return new Promise(function(_0x5cc192,_0x161680){var _0x1983d0=moment();var _0x4f183c={'method':'POST','uri':_0x2352cf+_0xbfca('0x2c'),'body':{'title':intUtil[_0xbfca('0x2d')](_0x43bbb8[_0xbfca('0x2e')],_0x28a2fe,'\x20'),'description':intUtil[_0xbfca('0x2d')](_0x43bbb8[_0xbfca('0x2f')],_0x28a2fe,'\x0a'),'owner_id':_0x150edc[_0xbfca('0x19')],'creater_id':_0x150edc[_0xbfca('0xb')],'targetable_id':_0x150edc[_0xbfca('0x22')],'targetable_type':_0xbfca('0x30'),'created_at':_0x1983d0['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1983d0[_0xbfca('0x31')](0x1e,'m')[_0xbfca('0x1e')](_0xbfca('0x28'))},'json':!![]};_0x4f183c[_0xbfca('0x13')]=_0x47af6c;return rp(_0x4f183c)[_0xbfca('0x8')](function(_0x40f68d){_0x150edc[_0xbfca('0x32')]=_0x40f68d[_0xbfca('0x33')]['id'];logger[_0xbfca('0x6')](_0xbfca('0x34'),_0x150edc['ticketId']);_0x5cc192(_0x150edc);})[_0xbfca('0xe')](function(_0x243a60){logger[_0xbfca('0xf')]('['+[_0x3abe3d[_0xbfca('0x1a')]()]+']',_0x243a60[_0xbfca('0x10')]);_0x161680(_0x243a60[_0xbfca('0x10')]);});});};}function emit(_0x3ee6ee,_0x25732a,_0x5f0eee){var _0x2c39f5={'uri':_0x3ee6ee+'/contacts/'+_0x5f0eee};io['to'](util[_0xbfca('0x1e')]('user:%s',_0x25732a))[_0xbfca('0x35')](_0xbfca('0x36'),_0x2c39f5);}exports['cs']=function(_0x3d48ac,_0x4327e8,_0x3d6973,_0x3d397f,_0x41e5b8,_0x478997,_0x1fb54,_0x5fbfce){var _0x43056f={};var _0x1376f2={'Authorization':_0xbfca('0x37')+_0x478997[_0xbfca('0x38')]};_0x478997['remoteUri']=intUtil['stripTrailingSlash'](_0x478997[_0xbfca('0x39')]);_0x478997['serverUrl']=intUtil[_0xbfca('0x3a')](_0x478997[_0xbfca('0x3b')]);var _0x2f97c6=_0x478997[_0xbfca('0x39')];_0x43056f[_0xbfca('0x3c')]=_0x478997[_0xbfca('0x3d')];_0x43056f['contactNumber']=_0x5fbfce[_0xbfca('0x3e')]()===_0xbfca('0x3f')?_0x4327e8[_0xbfca('0x40')]:_0x4327e8[_0xbfca('0x41')];_0x43056f[_0xbfca('0x42')]=_0x5fbfce===_0xbfca('0x43')||_0x5fbfce===_0xbfca('0x44')?'queue':_0xbfca('0x3f');if(_0x3d397f){_0x43056f[_0xbfca('0x14')]=_0x3d397f[_0xbfca('0xa')];}var _0x240c3e=util[_0xbfca('0x1e')](_0xbfca('0x45'),_0x478997[_0xbfca('0x3b')],_0x4327e8[_0xbfca('0x46')],md5(_0x4327e8[_0xbfca('0x46')]));if(_0x41e5b8&&_0x41e5b8[_0xbfca('0x47')]){logger['info']('[QUEUE]',_0xbfca('0x48'));_0x4327e8[_0xbfca('0x49')]=_0x240c3e;}else if(_0x1fb54&&_0x1fb54[_0xbfca('0x4a')]&&_0x1fb54[_0xbfca('0x4a')]!=='none'){logger[_0xbfca('0x6')](_0xbfca('0x4b'),_0xbfca('0x48'));_0x4327e8[_0xbfca('0x49')]=_0x240c3e;}else{_0x4327e8[_0xbfca('0x49')]='';}return getAdminId(_0x43056f,_0x5fbfce,_0x1376f2,_0x2f97c6)['then'](getUser(_0x5fbfce,_0x1376f2,_0x2f97c6))['then'](getEndUser(_0x5fbfce,_0x1376f2,_0x2f97c6))['then'](getTicket(_0x5fbfce,_0x1376f2,_0x2f97c6,_0x3d6973,_0x4327e8))[_0xbfca('0x8')](function(_0x49521b){logger[_0xbfca('0x6')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x49521b[_0xbfca('0x32')]));if(_0x5fbfce!==_0xbfca('0x44')){logger[_0xbfca('0x6')]('['+[_0x5fbfce['toUpperCase']()]+']',_0xbfca('0x4c'));emit(_0x2f97c6,_0x3d397f['name'],_0x49521b[_0xbfca('0x22')]);}})['catch'](function(_0x38f473){logger[_0xbfca('0xf')]('['+[_0x5fbfce[_0xbfca('0x1a')]()]+_0xbfca('0x4d'),util['inspect'](_0x38f473,{'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 7c67c86..726dcf5 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 _0x2e5b=['includes','data1','toLowerCase','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','desk','vtiger','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','dynamics365','freshsales','servicenow','exec'];(function(_0x51207d,_0x288131){var _0x105b22=function(_0x561993){while(--_0x561993){_0x51207d['push'](_0x51207d['shift']());}};_0x105b22(++_0x288131);}(_0x2e5b,0x14e));var _0xb2e5=function(_0x1fb26c,_0x62f6b6){_0x1fb26c=_0x1fb26c-0x0;var _0x477854=_0x2e5b[_0x1fb26c];return _0x477854;};'use strict';var _=require('lodash');var util=require(_0xb2e5('0x0'));var zendesk=require(_0xb2e5('0x1'));var salesforce=require(_0xb2e5('0x2'));var sugarcrm=require(_0xb2e5('0x3'));var freshdesk=require(_0xb2e5('0x4'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xb2e5('0x5'));var freshsales=require(_0xb2e5('0x6'));var integrations=[_0xb2e5('0x7'),_0xb2e5('0x8'),_0xb2e5('0x9'),_0xb2e5('0xa'),_0xb2e5('0xb'),'desk','vtiger',_0xb2e5('0xc'),_0xb2e5('0xd'),_0xb2e5('0xe')];exports[_0xb2e5('0xf')]=function(_0x4cfb8a,_0x35368c,_0xb7afb0,_0x392e93,_0x72b9d7,_0x3f8483){if(_0xb7afb0){if(_[_0xb2e5('0x10')](integrations,_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')]())){try{var _0x1f3034=null;var _0xb5d99d='';var _0x15f2b6=_0xb7afb0[_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')]()];if(_0x15f2b6){var _0x29fb37=_0x15f2b6[_0x4cfb8a['data2']];if(_0x29fb37){var _0x33ec66=_[_0xb2e5('0x13')](_0x29fb37['Configurations'],{'id':parseInt(_0x4cfb8a[_0xb2e5('0x14')],0xa)});if(_0x33ec66){if(_0x392e93){if(_0x72b9d7&&_0x35368c[_0xb2e5('0x15')]){_0xb5d99d=_0xb2e5('0x15');}else if(_0x35368c['routeId']){_0xb5d99d=_0xb2e5('0x16');}else{console[_0xb2e5('0x17')](_0xb2e5('0x18'),_0x35368c);}}else{_0xb5d99d=_0xb2e5('0x19');}switch(_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')]()){case _0xb2e5('0x7'):zendesk[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0x8'):salesforce[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0x9'):sugarcrm[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0xa'):freshdesk[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0xb'):zoho[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0x1a'):desk[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0x1b'):vtiger[_0xb5d99d](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483);break;case _0xb2e5('0xd'):freshsales['cs'](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483,_0xb5d99d);break;case _0xb2e5('0xe'):servicenow['cs'](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483,_0xb5d99d);break;case _0xb2e5('0xc'):dynamics365['cs'](_0x4cfb8a,_0x35368c,_0x33ec66,_0x392e93,_0x72b9d7,_0x29fb37,_0x3f8483,_0xb5d99d);break;default:console['log']('unknown\x20integration');}}else{_0x1f3034=require(_0xb2e5('0x1c'))(_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')]());_0x1f3034[_0xb2e5('0x1d')]('[EXEC]',util[_0xb2e5('0x1e')](_0xb2e5('0x1f'),_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')](),_0x4cfb8a[_0xb2e5('0x14')]));}}else{_0x1f3034=require(_0xb2e5('0x1c'))(_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')]());_0x1f3034[_0xb2e5('0x1d')](_0xb2e5('0x20'),util[_0xb2e5('0x1e')](_0xb2e5('0x21'),_0x4cfb8a[_0xb2e5('0x11')][_0xb2e5('0x12')](),_0x4cfb8a[_0xb2e5('0x22')]));}}else{}}catch(_0x3723a6){console['error'](_0x3723a6);}}}}; \ No newline at end of file +var _0xad90=['./freshsales','zendesk','salesforce','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','sugarcrm','freshdesk','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365'];(function(_0x682183,_0x278f1b){var _0x20682d=function(_0x55f3cc){while(--_0x55f3cc){_0x682183['push'](_0x682183['shift']());}};_0x20682d(++_0x278f1b);}(_0xad90,0x173));var _0x0ad9=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xad90[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0ad9('0x0'));var util=require('util');var zendesk=require(_0x0ad9('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x0ad9('0x2'));var freshdesk=require(_0x0ad9('0x3'));var zoho=require(_0x0ad9('0x4'));var desk=require(_0x0ad9('0x5'));var vtiger=require(_0x0ad9('0x6'));var servicenow=require(_0x0ad9('0x7'));var dynamics365=require(_0x0ad9('0x8'));var freshsales=require(_0x0ad9('0x9'));var integrations=[_0x0ad9('0xa'),_0x0ad9('0xb'),'sugarcrm','freshdesk',_0x0ad9('0xc'),_0x0ad9('0xd'),_0x0ad9('0xe'),_0x0ad9('0xf'),'freshsales',_0x0ad9('0x10')];exports[_0x0ad9('0x11')]=function(_0x1f166f,_0x5a384d,_0x11ef5d,_0x147759,_0x28e0ad,_0x26030c){if(_0x11ef5d){if(_[_0x0ad9('0x12')](integrations,_0x1f166f[_0x0ad9('0x13')][_0x0ad9('0x14')]())){try{var _0x401070=null;var _0x8e92c5='';var _0x72e877=_0x11ef5d[_0x1f166f[_0x0ad9('0x13')]['toLowerCase']()];if(_0x72e877){var _0x1f0340=_0x72e877[_0x1f166f[_0x0ad9('0x15')]];if(_0x1f0340){var _0x2091e9=_[_0x0ad9('0x16')](_0x1f0340[_0x0ad9('0x17')],{'id':parseInt(_0x1f166f[_0x0ad9('0x18')],0xa)});if(_0x2091e9){if(_0x147759){if(_0x28e0ad&&_0x5a384d[_0x0ad9('0x19')]){_0x8e92c5=_0x0ad9('0x19');}else if(_0x5a384d[_0x0ad9('0x1a')]){_0x8e92c5=_0x0ad9('0x1b');}else{console[_0x0ad9('0x1c')](_0x0ad9('0x1d'),_0x5a384d);}}else{_0x8e92c5='unmanaged';}switch(_0x1f166f[_0x0ad9('0x13')][_0x0ad9('0x14')]()){case'zendesk':zendesk[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0xb'):salesforce[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0x1e'):sugarcrm[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0x1f'):freshdesk[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case'zoho':zoho[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0xd'):desk[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0xe'):vtiger[_0x8e92c5](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c);break;case _0x0ad9('0x20'):freshsales['cs'](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c,_0x8e92c5);break;case'servicenow':servicenow['cs'](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c,_0x8e92c5);break;case'dynamics365':dynamics365['cs'](_0x1f166f,_0x5a384d,_0x2091e9,_0x147759,_0x28e0ad,_0x1f0340,_0x26030c,_0x8e92c5);break;default:console[_0x0ad9('0x1c')](_0x0ad9('0x21'));}}else{_0x401070=require(_0x0ad9('0x22'))(_0x1f166f['data1'][_0x0ad9('0x14')]());_0x401070['error'](_0x0ad9('0x23'),util[_0x0ad9('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1f166f[_0x0ad9('0x13')][_0x0ad9('0x14')](),_0x1f166f[_0x0ad9('0x18')]));}}else{_0x401070=require(_0x0ad9('0x22'))(_0x1f166f[_0x0ad9('0x13')][_0x0ad9('0x14')]());_0x401070['error'](_0x0ad9('0x23'),util[_0x0ad9('0x24')](_0x0ad9('0x25'),_0x1f166f[_0x0ad9('0x13')][_0x0ad9('0x14')](),_0x1f166f[_0x0ad9('0x15')]));}}else{}}catch(_0x3df142){console['error'](_0x3df142);}}}}; \ 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 0587546..c0f6dcf 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 _0x7bff=['lodash','request-promise','moment','bluebird','md5','util','ioredis','../../../../config/logger','salesforce','redis','defaults','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','resolve','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','sobject','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','moduleCreate','LastName','Company','No\x20Company','upperFirst','create','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','none','uniqueid','destcalleridname','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.'];(function(_0x164a76,_0x124371){var _0x1f1d12=function(_0x5719a2){while(--_0x5719a2){_0x164a76['push'](_0x164a76['shift']());}};_0x1f1d12(++_0x124371);}(_0x7bff,0x81));var _0xf7bf=function(_0x2941c6,_0x1680c5){_0x2941c6=_0x2941c6-0x0;var _0x57ea4b=_0x7bff[_0x2941c6];return _0x57ea4b;};'use strict';var _=require(_0xf7bf('0x0'));var rp=require(_0xf7bf('0x1'));var moment=require(_0xf7bf('0x2'));var BPromise=require(_0xf7bf('0x3'));var md5=require(_0xf7bf('0x4'));var jsforce=require('jsforce');var util=require(_0xf7bf('0x5'));var Redis=require(_0xf7bf('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf7bf('0x7'))(_0xf7bf('0x8'));config[_0xf7bf('0x9')]=_[_0xf7bf('0xa')](config[_0xf7bf('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf7bf('0x9')]));function emit(_0x2451b1,_0x16eef3,_0xed5a19){io['to'](_0x2451b1)['emit'](_0x16eef3,_0xed5a19);}function getTicket(_0xde8ceb,_0x252eca,_0x1027e0,_0x1a8811,_0x7bc559,_0x2d9178,_0x48ad7e,_0x141295){var _0x457aa6=Object['assign']({},{'OwnerId':_0x252eca['id'],'Subject':intUtil[_0xf7bf('0xb')](_0x1a8811[_0xf7bf('0xc')],_0x7bc559,'\x20'),'Description':intUtil['getString'](_0x1a8811[_0xf7bf('0xd')],_0x7bc559,'\x0a')},getCustomFields(_0x2d9178,_0x7bc559));if(_0x1027e0){if(_0x1a8811[_0xf7bf('0xe')]===_0xf7bf('0xf')){_0x457aa6['ActivityDate']=moment[_0xf7bf('0x10')]();_0x457aa6[_0xf7bf('0x11')]=![];_0x457aa6[_0xf7bf('0x12')]=![];if(_0x1027e0[_0xf7bf('0x13')]==='contact'||_0x1027e0[_0xf7bf('0x13')]===_0xf7bf('0x14')){_0x457aa6[_0xf7bf('0x15')]=_0x1027e0['id'];}else if(_0x1027e0[_0xf7bf('0x13')]===_0xf7bf('0x16')){_0x457aa6['WhatId']=_0x1027e0['id'];}}else if(_0x1a8811['ticketType']===_0xf7bf('0x17')){if(_0x1027e0[_0xf7bf('0x13')]==='contact'){_0x457aa6[_0xf7bf('0x18')]=_0x1027e0['id'];}else if(_0x1027e0[_0xf7bf('0x13')]==='account'){_0x457aa6[_0xf7bf('0x19')]=_0x1027e0['id'];}else if(_0x1027e0[_0xf7bf('0x13')]===_0xf7bf('0x14')&&_0x1a8811[_0xf7bf('0x1a')]){_0x457aa6[_0x1a8811['leadId']]=_0x1027e0['id'];}else{logger[_0xf7bf('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x48ad7e['sobject'](_0x1a8811[_0xf7bf('0xe')])['create'](_0x457aa6);}function getUser(_0x4579a2,_0x52d38b,_0x3fc1c8){if(!_[_0xf7bf('0x1c')](_0x52d38b)&&intUtil[_0xf7bf('0x1d')](_0x52d38b)){var _0x4ccdd5={'Email':_0x52d38b};var _0x11cc34={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3fc1c8['sobject'](_0xf7bf('0x1e'))[_0xf7bf('0x1f')](_0x4ccdd5,_0x11cc34)[_0xf7bf('0x20')]()['then'](function(_0x4595a0){if(_0x4595a0[_0xf7bf('0x21')]){var _0x4c9314=_[_0xf7bf('0x1f')](_0x4595a0,function(_0x1690ef){return _0x1690ef[_0xf7bf('0x22')]===_0x52d38b;});if(_0x4c9314){logger[_0xf7bf('0x1b')](_0xf7bf('0x23'),_0x52d38b);return BPromise['resolve']({'id':_0x4c9314['Id'],'name':_0x4c9314[_0xf7bf('0x24')]});}}else{logger[_0xf7bf('0x1b')](_0xf7bf('0x25'),_0x52d38b);return _0x3fc1c8[_0xf7bf('0x26')]()[_0xf7bf('0x27')](function(_0x5acf18){return BPromise['resolve']({'id':_0x5acf18[_0xf7bf('0x28')],'name':_0x5acf18[_0xf7bf('0x29')]});});}});}else{logger[_0xf7bf('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x52d38b);return _0x3fc1c8['identity']()[_0xf7bf('0x27')](function(_0x1b5367){return BPromise[_0xf7bf('0x2a')]({'id':_0x1b5367[_0xf7bf('0x28')],'name':_0x1b5367[_0xf7bf('0x29')]});});}}function getEndUser(_0x32e17a,_0x27c691,_0x12d09d,_0x5c4dde,_0x2b34fd){var _0x59fe26={'$or':{'Phone':_0x5c4dde}};var _0x36b2ab={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xf7bf('0x27')](function(){logger[_0xf7bf('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5c4dde,_0x27c691['moduleSearch']);switch(_0x27c691[_0xf7bf('0x2b')]){case _0xf7bf('0x2c'):var _0x22074d=_[_0xf7bf('0x2d')](_0x59fe26);if(_0x27c691[_0xf7bf('0x2e')]){var _0x23490a={};_0x23490a[_0x27c691[_0xf7bf('0x2e')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x22074d['$or'],_0x23490a);}return _0x2b34fd[_0xf7bf('0x30')](_0xf7bf('0x31'))[_0xf7bf('0x1f')](_0x22074d,_0x36b2ab)[_0xf7bf('0x20')]()['then'](function(_0x79c885){if(_0x79c885&&_0x79c885[_0xf7bf('0x21')]){return _0x79c885;}else{var _0x3d6607=_['cloneDeep'](_0x59fe26);if(_0x27c691[_0xf7bf('0x32')]){var _0x5eb176={};_0x5eb176[_0x27c691['additionalSearchLead']]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x3d6607[_0xf7bf('0x33')],_0x5eb176);}return _0x2b34fd[_0xf7bf('0x30')](_0xf7bf('0x34'))[_0xf7bf('0x1f')](_0x3d6607,_0x36b2ab);}});case _0xf7bf('0x35'):var _0x3f1570=_[_0xf7bf('0x2d')](_0x59fe26);if(_0x27c691[_0xf7bf('0x36')]){var _0x23490a={};_0x23490a[_0x27c691[_0xf7bf('0x36')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x3f1570['$or'],_0x23490a);}return _0x2b34fd[_0xf7bf('0x30')]('Account')['find'](_0x3f1570,_0x36b2ab)['execute']()[_0xf7bf('0x27')](function(_0xc5cf26){if(_0xc5cf26&&_0xc5cf26['length']){return _0xc5cf26;}else{var _0x396ce2=_['cloneDeep'](_0x59fe26);if(_0x27c691['additionalSearchContact']){var _0x33c815={};_0x33c815[_0x27c691[_0xf7bf('0x2e')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x396ce2[_0xf7bf('0x33')],_0x33c815);}return _0x2b34fd[_0xf7bf('0x30')](_0xf7bf('0x31'))['find'](_0x396ce2,_0x36b2ab)['then'](function(_0x2c783b){if(_0x2c783b&&_0x2c783b['length']){return _0x2c783b;}else{var _0x3ce25c=_['cloneDeep'](_0x59fe26);if(_0x27c691[_0xf7bf('0x32')]){var _0x32a8b9={};_0x32a8b9[_0x27c691['additionalSearchLead']]=_0x5c4dde;_['merge'](_0x3ce25c[_0xf7bf('0x33')],_0x32a8b9);}return _0x2b34fd['sobject'](_0xf7bf('0x34'))[_0xf7bf('0x1f')](_0x3ce25c,_0x36b2ab);}});}});case'contact':var _0x22074d=_[_0xf7bf('0x2d')](_0x59fe26);if(_0x27c691['additionalSearchContact']){var _0x23490a={};_0x23490a[_0x27c691[_0xf7bf('0x2e')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x22074d[_0xf7bf('0x33')],_0x23490a);}return _0x2b34fd[_0xf7bf('0x30')](_0xf7bf('0x31'))[_0xf7bf('0x1f')](_0x22074d,_0x36b2ab)['execute']();case _0xf7bf('0x14'):var _0x3c8fb9=_[_0xf7bf('0x2d')](_0x59fe26);if(_0x27c691[_0xf7bf('0x32')]){var _0x23490a={};_0x23490a[_0x27c691[_0xf7bf('0x32')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x3c8fb9['$or'],_0x23490a);}return _0x2b34fd[_0xf7bf('0x30')]('Lead')[_0xf7bf('0x1f')](_0x3c8fb9,_0x36b2ab);case _0xf7bf('0x16'):var _0x3f1570=_['cloneDeep'](_0x59fe26);if(_0x27c691[_0xf7bf('0x36')]){var _0x23490a={};_0x23490a[_0x27c691[_0xf7bf('0x36')]]=_0x5c4dde;_[_0xf7bf('0x2f')](_0x3f1570[_0xf7bf('0x33')],_0x23490a);}return _0x2b34fd[_0xf7bf('0x30')](_0xf7bf('0x37'))[_0xf7bf('0x1f')](_0x3f1570,_0x36b2ab);default:return null;}})[_0xf7bf('0x27')](function(_0xa4dccb){if(_0xa4dccb&&_0xa4dccb[_0xf7bf('0x21')]){var _0x808442=_[_0xf7bf('0x38')](_0xa4dccb);if(_0x808442){return BPromise[_0xf7bf('0x2a')]({'id':_0x808442['Id'],'name':_0x808442['Name'],'phone':_0x808442[_0xf7bf('0x39')],'endUserType':_0x808442[_0xf7bf('0x3a')]['type'][_0xf7bf('0x3b')]()});}}})[_0xf7bf('0x27')](function(_0x1c4c11){if(_0x1c4c11){logger[_0xf7bf('0x1b')](_0xf7bf('0x3c'),_0x1c4c11[_0xf7bf('0x13')],_0x5c4dde);return BPromise['resolve'](_0x1c4c11);}else{logger[_0xf7bf('0x1b')](_0xf7bf('0x3d'),_0x5c4dde);var _0x5cdaea={'Phone':_0x5c4dde};if(_0x27c691['moduleCreate']){if(_0x27c691['moduleCreate']===_0xf7bf('0x3e')){logger[_0xf7bf('0x1b')](_0xf7bf('0x3f'),_0x5c4dde,_0x27c691['moduleCreate']);_0x5cdaea['LastName']=_0x12d09d!==_0xf7bf('0x40')?_0x12d09d:util[_0xf7bf('0x41')](_0xf7bf('0x42'),_0x5c4dde);}else if(_0x27c691[_0xf7bf('0x43')]===_0xf7bf('0x14')){logger[_0xf7bf('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5c4dde,_0x27c691[_0xf7bf('0x43')]);_0x5cdaea[_0xf7bf('0x44')]=_0x12d09d!==_0xf7bf('0x40')?_0x12d09d:util['format'](_0xf7bf('0x42'),_0x5c4dde);_0x5cdaea[_0xf7bf('0x45')]=_0xf7bf('0x46');}else if(_0x27c691[_0xf7bf('0x43')]===_0xf7bf('0x16')){logger[_0xf7bf('0x1b')](_0xf7bf('0x3f'),_0x5c4dde,_0x27c691[_0xf7bf('0x43')]);_0x5cdaea[_0xf7bf('0x24')]=_0x12d09d!==''?_0x12d09d:util[_0xf7bf('0x41')](_0xf7bf('0x42'),_0x5c4dde);}else{return null;}}return _0x2b34fd[_0xf7bf('0x30')](_[_0xf7bf('0x47')](_0x27c691[_0xf7bf('0x43')]))[_0xf7bf('0x48')](_0x5cdaea)[_0xf7bf('0x27')](function(_0x260073){return BPromise['resolve']({'id':_0x260073['id'],'endUserType':_0x27c691['moduleCreate']});});}});}function getCustomFields(_0x55d72b,_0x156896){var _0x3f4200={};if(_0x55d72b[_0xf7bf('0x21')]>0x0){_[_0xf7bf('0x49')](_0x55d72b,function(_0x2be429){if(_[_0xf7bf('0x4a')]([_0xf7bf('0x4b'),'picklist'],_0x2be429[_0xf7bf('0x4c')])&&_0x2be429['idField']){_0x3f4200[_0x2be429[_0xf7bf('0x4d')]]=_0x2be429[_0xf7bf('0x4e')][_0xf7bf('0x4f')]();}else if(_0x2be429['type']===_0xf7bf('0x50')&&_0x2be429[_0xf7bf('0x51')]&&_0x2be429[_0xf7bf('0x4d')]){_0x156896[_0x2be429['variableName']]&&(_0x3f4200[_0x2be429[_0xf7bf('0x4d')]]=_0x156896[_0x2be429[_0xf7bf('0x51')]][_0xf7bf('0x4f')]());}else if(_0x2be429[_0xf7bf('0x4c')]===_0xf7bf('0x52')&&_0x2be429[_0xf7bf('0x53')]&&_0x2be429[_0xf7bf('0x53')][_0xf7bf('0x54')]&&_0x2be429['idField']){_0x156896[_0x2be429[_0xf7bf('0x53')]['name'][_0xf7bf('0x3b')]()]&&(_0x3f4200[_0x2be429[_0xf7bf('0x4d')]]=_0x156896[_0x2be429[_0xf7bf('0x53')][_0xf7bf('0x54')][_0xf7bf('0x3b')]()][_0xf7bf('0x4f')]());}});}return _0x3f4200;}function getConnection(_0x3ac77a){var _0x3883ee=_0x3ac77a[_0xf7bf('0x55')][_0xf7bf('0x56')](_0x3ac77a['securityToken']);var _0x3f3dd5=new jsforce[(_0xf7bf('0x57'))]({'oauth2':{'loginUrl':_0x3ac77a[_0xf7bf('0x58')]||_0xf7bf('0x59'),'clientId':_0x3ac77a[_0xf7bf('0x5a')],'clientSecret':_0x3ac77a['clientSecret']}});return _0x3f3dd5['login'](_0x3ac77a[_0xf7bf('0x5b')],_0x3883ee)['then'](function(){logger[_0xf7bf('0x1b')](_0xf7bf('0x5c'));return _0x3f3dd5;});}exports[_0xf7bf('0x5d')]=function(_0x5a6834,_0x1cf870,_0x221554,_0x597f16,_0x154fa2,_0x2a9000){var _0x52cfa6,_0xca6c3d,_0x4553af,_0x4423ad;_0x2a9000[_0xf7bf('0x5e')]=intUtil['stripTrailingSlash'](_0x2a9000['serverUrl']);_0x2a9000[_0xf7bf('0x58')]=intUtil[_0xf7bf('0x5f')](_0x2a9000[_0xf7bf('0x58')]);if(_0x154fa2&&_0x154fa2[_0xf7bf('0x60')]){logger[_0xf7bf('0x1b')](_0xf7bf('0x61'),_0xf7bf('0x62'));_0x1cf870[_0xf7bf('0x63')]=util[_0xf7bf('0x41')](_0xf7bf('0x64'),_0x2a9000[_0xf7bf('0x5e')],_0x1cf870['uniqueid'],md5(_0x1cf870['uniqueid']));}else{_0x1cf870[_0xf7bf('0x63')]='';}return getConnection(_0x2a9000)[_0xf7bf('0x27')](function(_0x1f4c56){_0x4423ad=_0x1f4c56;return getUser(_0x2a9000,_0x597f16[_0xf7bf('0x65')],_0x4423ad);})[_0xf7bf('0x27')](function(_0x68c9dd){_0x52cfa6=_0x68c9dd;return getEndUser(_0x2a9000,_0x221554,_0x1cf870[_0xf7bf('0x66')],_0x1cf870['calleridnum'],_0x4423ad);})[_0xf7bf('0x27')](function(_0x29efbc){_0xca6c3d=_0x29efbc;return getTicket(_0x2a9000,_0x52cfa6,_0xca6c3d,_0x221554,_0x1cf870,_0x221554[_0xf7bf('0x67')],_0x4423ad,_0xf7bf('0x5d'));})[_0xf7bf('0x27')](function(_0x4b0a07){_0x4553af=_0x4b0a07;logger[_0xf7bf('0x1b')](_0xf7bf('0x68'),_0x4553af['id']);logger[_0xf7bf('0x1b')](_0xf7bf('0x69'),_0x4553af['id'],_0x597f16['name'],_0x2a9000[_0xf7bf('0x4c')]);switch(_0x2a9000['type']){case _0xf7bf('0x6a'):emit(util[_0xf7bf('0x41')](_0xf7bf('0x6b'),_0x597f16['name']),'trigger:salesforce:display',{'recordId':_0x4553af['id']});break;case _0xf7bf('0x6c'):emit(util['format'](_0xf7bf('0x6b'),_0x597f16[_0xf7bf('0x54')]),_0xf7bf('0x6d'),{'uri':util[_0xf7bf('0x41')](_0xf7bf('0x6e'),_0x4423ad[_0xf7bf('0x6f')],_0x4553af['id'])});break;default:logger[_0xf7bf('0x70')](_0xf7bf('0x71'));}})[_0xf7bf('0x72')](function(_0x2a9f89){logger[_0xf7bf('0x70')](_0xf7bf('0x61'),_0x2a9f89);});};exports['outbound']=function(_0x560718,_0x2bbca8,_0x809bdc,_0xa8c13e,_0x4494e1,_0x61692a,_0x37cae9){var _0xf47028,_0x34c40e,_0x47e321,_0x52463e;_0x61692a[_0xf7bf('0x5e')]=intUtil['stripTrailingSlash'](_0x61692a[_0xf7bf('0x5e')]);_0x61692a[_0xf7bf('0x58')]=intUtil[_0xf7bf('0x5f')](_0x61692a[_0xf7bf('0x58')]);if(_0x37cae9&&_0x37cae9['recordingFormat']&&_0x37cae9['recordingFormat']!==_0xf7bf('0x73')){logger[_0xf7bf('0x1b')]('[OUTBOUND]',_0xf7bf('0x62'));_0x2bbca8[_0xf7bf('0x63')]=util[_0xf7bf('0x41')](_0xf7bf('0x64'),_0x61692a[_0xf7bf('0x5e')],_0x2bbca8[_0xf7bf('0x74')],md5(_0x2bbca8[_0xf7bf('0x74')]));}return getConnection(_0x61692a)['then'](function(_0x225306){_0x52463e=_0x225306;return getUser(_0x61692a,_0xa8c13e[_0xf7bf('0x65')],_0x52463e);})[_0xf7bf('0x27')](function(_0x1277a3){_0xf47028=_0x1277a3;return getEndUser(_0x61692a,_0x809bdc,_0x2bbca8[_0xf7bf('0x75')],_0x2bbca8['destcalleridnum'],_0x52463e);})[_0xf7bf('0x27')](function(_0x188f28){_0x34c40e=_0x188f28;return getTicket(_0x61692a,_0xf47028,_0x34c40e,_0x809bdc,_0x2bbca8,_0x809bdc[_0xf7bf('0x67')],_0x52463e,_0xf7bf('0x76'));})['then'](function(_0x4e8230){_0x47e321=_0x4e8230;logger[_0xf7bf('0x1b')](_0xf7bf('0x77'),_0x47e321['id']);logger[_0xf7bf('0x1b')](_0xf7bf('0x78'),_0x47e321['id'],_0xa8c13e['name'],_0x61692a[_0xf7bf('0x4c')]);switch(_0x61692a[_0xf7bf('0x4c')]){case _0xf7bf('0x6a'):emit(util['format'](_0xf7bf('0x6b'),_0xa8c13e[_0xf7bf('0x54')]),_0xf7bf('0x79'),{'recordId':_0x47e321['id']});break;case _0xf7bf('0x6c'):emit(util[_0xf7bf('0x41')]('user:%s',_0xa8c13e['name']),_0xf7bf('0x6d'),{'uri':util[_0xf7bf('0x41')]('%s/%s/e',_0x52463e[_0xf7bf('0x6f')],_0x47e321['id'])});break;default:logger[_0xf7bf('0x70')](_0xf7bf('0x7a'),_0xf7bf('0x7b'));}})['catch'](function(_0x1615a7){logger[_0xf7bf('0x70')](_0xf7bf('0x7a'),_0x1615a7);});};exports[_0xf7bf('0x7c')]=function(_0x581271,_0x5b7522,_0x2e3072,_0x33596e,_0x454268,_0x23251e){var _0x52133d,_0x1c3edc,_0x56facb,_0x29f44e;_0x23251e[_0xf7bf('0x5e')]=intUtil[_0xf7bf('0x5f')](_0x23251e['serverUrl']);_0x23251e[_0xf7bf('0x58')]=intUtil[_0xf7bf('0x5f')](_0x23251e['remoteUri']);if(_0x454268&&_0x454268['monitor_format']){logger[_0xf7bf('0x1b')]('['+_0x5b7522['lastevent'][_0xf7bf('0x7d')]()+']',_0xf7bf('0x62'));_0x5b7522[_0xf7bf('0x63')]=util[_0xf7bf('0x41')](_0xf7bf('0x64'),_0x23251e[_0xf7bf('0x5e')],_0x5b7522[_0xf7bf('0x74')],md5(_0x5b7522[_0xf7bf('0x74')]));}else{_0x5b7522[_0xf7bf('0x63')]='';}return getConnection(_0x23251e)['then'](function(_0x770be0){_0x29f44e=_0x770be0;if(!_['isNil'](_0x33596e)){return getUser(_0x23251e,_0x33596e[_0xf7bf('0x54')],_0x29f44e);}else{return getUser(_0x23251e,null,_0x29f44e);}})[_0xf7bf('0x27')](function(_0x998643){_0x52133d=_0x998643;return getEndUser(_0x23251e,_0x2e3072,_0x5b7522[_0xf7bf('0x66')],_0x5b7522['calleridnum'],_0x29f44e);})[_0xf7bf('0x27')](function(_0x327076){_0x1c3edc=_0x327076;return getTicket(_0x23251e,_0x52133d,_0x1c3edc,_0x2e3072,_0x5b7522,_0x2e3072[_0xf7bf('0x67')],_0x29f44e);})[_0xf7bf('0x27')](function(_0x54a452){_0x56facb=_0x54a452;logger['info']('['+_0x5b7522[_0xf7bf('0x7e')][_0xf7bf('0x7d')]()+_0xf7bf('0x7f'),_0x56facb['id']);logger[_0xf7bf('0x1b')]('['+_0x5b7522[_0xf7bf('0x7e')][_0xf7bf('0x7d')]()+_0xf7bf('0x80'),_0x23251e[_0xf7bf('0x4c')]);})[_0xf7bf('0x72')](function(_0x2e9743){logger[_0xf7bf('0x70')]('['+_0x5b7522[_0xf7bf('0x7e')]['toUpperCase']()+']',_0x2e9743);});}; \ No newline at end of file +var _0x347f=['idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','user:%s','newTab','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','length','find','info','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','lead','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x347f,0xb6));var _0xf347=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x347f[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xf347('0x0'));var rp=require(_0xf347('0x1'));var moment=require('moment');var BPromise=require(_0xf347('0x2'));var md5=require(_0xf347('0x3'));var jsforce=require(_0xf347('0x4'));var util=require(_0xf347('0x5'));var Redis=require(_0xf347('0x6'));var intUtil=require(_0xf347('0x7'));var config=require('../../../../config/environment');var logger=require(_0xf347('0x8'))(_0xf347('0x9'));config[_0xf347('0xa')]=_[_0xf347('0xb')](config[_0xf347('0xa')],{'host':_0xf347('0xc'),'port':0x18eb});var io=require(_0xf347('0xd'))(new Redis(config[_0xf347('0xa')]));function emit(_0x359274,_0x8eaeae,_0x139b11){io['to'](_0x359274)['emit'](_0x8eaeae,_0x139b11);}function getTicket(_0x8a4981,_0x1bed70,_0x5b6848,_0x5054eb,_0x1dc9d7,_0x5f4974,_0x103d10,_0x2e3017){var _0x2e4265=Object[_0xf347('0xe')]({},{'OwnerId':_0x1bed70['id'],'Subject':intUtil[_0xf347('0xf')](_0x5054eb['Subjects'],_0x1dc9d7,'\x20'),'Description':intUtil['getString'](_0x5054eb[_0xf347('0x10')],_0x1dc9d7,'\x0a')},getCustomFields(_0x5f4974,_0x1dc9d7));if(_0x5b6848){if(_0x5054eb[_0xf347('0x11')]===_0xf347('0x12')){_0x2e4265[_0xf347('0x13')]=moment['utc']();_0x2e4265[_0xf347('0x14')]=![];_0x2e4265[_0xf347('0x15')]=![];if(_0x5b6848[_0xf347('0x16')]===_0xf347('0x17')||_0x5b6848[_0xf347('0x16')]==='lead'){_0x2e4265[_0xf347('0x18')]=_0x5b6848['id'];}else if(_0x5b6848['endUserType']===_0xf347('0x19')){_0x2e4265[_0xf347('0x1a')]=_0x5b6848['id'];}}else if(_0x5054eb['ticketType']===_0xf347('0x1b')){if(_0x5b6848[_0xf347('0x16')]===_0xf347('0x17')){_0x2e4265[_0xf347('0x1c')]=_0x5b6848['id'];}else if(_0x5b6848[_0xf347('0x16')]==='account'){_0x2e4265[_0xf347('0x1d')]=_0x5b6848['id'];}else if(_0x5b6848[_0xf347('0x16')]==='lead'&&_0x5054eb[_0xf347('0x1e')]){_0x2e4265[_0x5054eb[_0xf347('0x1e')]]=_0x5b6848['id'];}else{logger['info'](_0xf347('0x1f'));}}}return _0x103d10[_0xf347('0x20')](_0x5054eb[_0xf347('0x11')])[_0xf347('0x21')](_0x2e4265);}function getUser(_0xb4b6ed,_0x44f7a9,_0x31fb8a){if(!_[_0xf347('0x22')](_0x44f7a9)&&intUtil[_0xf347('0x23')](_0x44f7a9)){var _0x466c4b={'Email':_0x44f7a9};var _0x17db34={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x31fb8a[_0xf347('0x20')](_0xf347('0x24'))['find'](_0x466c4b,_0x17db34)[_0xf347('0x25')]()[_0xf347('0x26')](function(_0x181c84){if(_0x181c84[_0xf347('0x27')]){var _0x26bf39=_[_0xf347('0x28')](_0x181c84,function(_0x3acd6f){return _0x3acd6f['Email']===_0x44f7a9;});if(_0x26bf39){logger[_0xf347('0x29')]('Agent\x20%s\x20found.',_0x44f7a9);return BPromise['resolve']({'id':_0x26bf39['Id'],'name':_0x26bf39[_0xf347('0x2a')]});}}else{logger[_0xf347('0x29')](_0xf347('0x2b'),_0x44f7a9);return _0x31fb8a[_0xf347('0x2c')]()[_0xf347('0x26')](function(_0x7643dc){return BPromise[_0xf347('0x2d')]({'id':_0x7643dc['user_id'],'name':_0x7643dc[_0xf347('0x2e')]});});}});}else{logger[_0xf347('0x29')](_0xf347('0x2b'),_0x44f7a9);return _0x31fb8a[_0xf347('0x2c')]()[_0xf347('0x26')](function(_0x511fb9){return BPromise['resolve']({'id':_0x511fb9[_0xf347('0x2f')],'name':_0x511fb9['display_name']});});}}function getEndUser(_0x17f88e,_0x4f1dad,_0x55f3da,_0x2273bd,_0x173c11){var _0x3709e1={'$or':{'Phone':_0x2273bd}};var _0xad4bcf={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf347('0x2d')]()[_0xf347('0x26')](function(){logger['info'](_0xf347('0x30'),_0x2273bd,_0x4f1dad[_0xf347('0x31')]);switch(_0x4f1dad['moduleSearch']){case'contact_lead':var _0x201d51=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x33')]){var _0x5eb0d8={};_0x5eb0d8[_0x4f1dad['additionalSearchContact']]=_0x2273bd;_[_0xf347('0x34')](_0x201d51[_0xf347('0x35')],_0x5eb0d8);}return _0x173c11[_0xf347('0x20')](_0xf347('0x36'))[_0xf347('0x28')](_0x201d51,_0xad4bcf)[_0xf347('0x25')]()['then'](function(_0x49a0ea){if(_0x49a0ea&&_0x49a0ea[_0xf347('0x27')]){return _0x49a0ea;}else{var _0x455667=_['cloneDeep'](_0x3709e1);if(_0x4f1dad['additionalSearchLead']){var _0x4f96ad={};_0x4f96ad[_0x4f1dad[_0xf347('0x37')]]=_0x2273bd;_[_0xf347('0x34')](_0x455667['$or'],_0x4f96ad);}return _0x173c11['sobject']('Lead')[_0xf347('0x28')](_0x455667,_0xad4bcf);}});case _0xf347('0x38'):var _0x2e5efa=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x39')]){var _0x5eb0d8={};_0x5eb0d8[_0x4f1dad[_0xf347('0x39')]]=_0x2273bd;_[_0xf347('0x34')](_0x2e5efa[_0xf347('0x35')],_0x5eb0d8);}return _0x173c11[_0xf347('0x20')](_0xf347('0x3a'))['find'](_0x2e5efa,_0xad4bcf)[_0xf347('0x25')]()[_0xf347('0x26')](function(_0x2b4f1a){if(_0x2b4f1a&&_0x2b4f1a[_0xf347('0x27')]){return _0x2b4f1a;}else{var _0x1f8b66=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x33')]){var _0x15c1ca={};_0x15c1ca[_0x4f1dad['additionalSearchContact']]=_0x2273bd;_[_0xf347('0x34')](_0x1f8b66[_0xf347('0x35')],_0x15c1ca);}return _0x173c11[_0xf347('0x20')](_0xf347('0x36'))[_0xf347('0x28')](_0x1f8b66,_0xad4bcf)[_0xf347('0x26')](function(_0xdad904){if(_0xdad904&&_0xdad904['length']){return _0xdad904;}else{var _0x423634=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad['additionalSearchLead']){var _0xfeaa45={};_0xfeaa45[_0x4f1dad[_0xf347('0x37')]]=_0x2273bd;_[_0xf347('0x34')](_0x423634['$or'],_0xfeaa45);}return _0x173c11[_0xf347('0x20')](_0xf347('0x3b'))[_0xf347('0x28')](_0x423634,_0xad4bcf);}});}});case _0xf347('0x17'):var _0x201d51=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x33')]){var _0x5eb0d8={};_0x5eb0d8[_0x4f1dad[_0xf347('0x33')]]=_0x2273bd;_[_0xf347('0x34')](_0x201d51['$or'],_0x5eb0d8);}return _0x173c11['sobject']('Contact')[_0xf347('0x28')](_0x201d51,_0xad4bcf)[_0xf347('0x25')]();case _0xf347('0x3c'):var _0x4c40ef=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x37')]){var _0x5eb0d8={};_0x5eb0d8[_0x4f1dad[_0xf347('0x37')]]=_0x2273bd;_[_0xf347('0x34')](_0x4c40ef[_0xf347('0x35')],_0x5eb0d8);}return _0x173c11['sobject'](_0xf347('0x3b'))['find'](_0x4c40ef,_0xad4bcf);case _0xf347('0x19'):var _0x2e5efa=_[_0xf347('0x32')](_0x3709e1);if(_0x4f1dad[_0xf347('0x39')]){var _0x5eb0d8={};_0x5eb0d8[_0x4f1dad['additionalSearchAccount']]=_0x2273bd;_[_0xf347('0x34')](_0x2e5efa['$or'],_0x5eb0d8);}return _0x173c11[_0xf347('0x20')](_0xf347('0x3a'))['find'](_0x2e5efa,_0xad4bcf);default:return null;}})[_0xf347('0x26')](function(_0x1cad6f){if(_0x1cad6f&&_0x1cad6f[_0xf347('0x27')]){var _0x483187=_['first'](_0x1cad6f);if(_0x483187){return BPromise[_0xf347('0x2d')]({'id':_0x483187['Id'],'name':_0x483187[_0xf347('0x2a')],'phone':_0x483187[_0xf347('0x3d')],'endUserType':_0x483187[_0xf347('0x3e')][_0xf347('0x3f')][_0xf347('0x40')]()});}}})[_0xf347('0x26')](function(_0x3d8133){if(_0x3d8133){logger[_0xf347('0x29')](_0xf347('0x41'),_0x3d8133['endUserType'],_0x2273bd);return BPromise[_0xf347('0x2d')](_0x3d8133);}else{logger[_0xf347('0x29')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x2273bd);var _0x2f9803={'Phone':_0x2273bd};if(_0x4f1dad[_0xf347('0x42')]){if(_0x4f1dad[_0xf347('0x42')]==='contact'){logger['info'](_0xf347('0x43'),_0x2273bd,_0x4f1dad[_0xf347('0x42')]);_0x2f9803[_0xf347('0x44')]=_0x55f3da!==_0xf347('0x45')?_0x55f3da:util[_0xf347('0x46')]('Caller\x20-\x20%s',_0x2273bd);}else if(_0x4f1dad[_0xf347('0x42')]===_0xf347('0x3c')){logger[_0xf347('0x29')](_0xf347('0x43'),_0x2273bd,_0x4f1dad[_0xf347('0x42')]);_0x2f9803['LastName']=_0x55f3da!==_0xf347('0x45')?_0x55f3da:util[_0xf347('0x46')](_0xf347('0x47'),_0x2273bd);_0x2f9803[_0xf347('0x48')]=_0xf347('0x49');}else if(_0x4f1dad[_0xf347('0x42')]==='account'){logger[_0xf347('0x29')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2273bd,_0x4f1dad['moduleCreate']);_0x2f9803['Name']=_0x55f3da!==_0xf347('0x45')?_0x55f3da:util[_0xf347('0x46')]('Caller\x20-\x20%s',_0x2273bd);}else{return null;}}return _0x173c11[_0xf347('0x20')](_[_0xf347('0x4a')](_0x4f1dad[_0xf347('0x42')]))['create'](_0x2f9803)[_0xf347('0x26')](function(_0x22dad5){return BPromise[_0xf347('0x2d')]({'id':_0x22dad5['id'],'endUserType':_0x4f1dad[_0xf347('0x42')]});});}});}function getCustomFields(_0x117e5c,_0x5a8afa){var _0x391b85={};if(_0x117e5c[_0xf347('0x27')]>0x0){_['forEach'](_0x117e5c,function(_0x840e77){if(_[_0xf347('0x4b')](['string','picklist'],_0x840e77[_0xf347('0x3f')])&&_0x840e77['idField']){_0x391b85[_0x840e77[_0xf347('0x4c')]]=_0x840e77['content'][_0xf347('0x4d')]();}else if(_0x840e77[_0xf347('0x3f')]===_0xf347('0x4e')&&_0x840e77[_0xf347('0x4f')]&&_0x840e77[_0xf347('0x4c')]){_0x5a8afa[_0x840e77[_0xf347('0x4f')]]&&(_0x391b85[_0x840e77[_0xf347('0x4c')]]=_0x5a8afa[_0x840e77[_0xf347('0x4f')]][_0xf347('0x4d')]());}else if(_0x840e77[_0xf347('0x3f')]===_0xf347('0x50')&&_0x840e77['Variable']&&_0x840e77['Variable']['name']&&_0x840e77[_0xf347('0x4c')]){_0x5a8afa[_0x840e77[_0xf347('0x51')][_0xf347('0x52')][_0xf347('0x40')]()]&&(_0x391b85[_0x840e77['idField']]=_0x5a8afa[_0x840e77[_0xf347('0x51')][_0xf347('0x52')][_0xf347('0x40')]()][_0xf347('0x4d')]());}});}return _0x391b85;}function getConnection(_0x372d8a){var _0xee0ba9=_0x372d8a[_0xf347('0x53')][_0xf347('0x54')](_0x372d8a[_0xf347('0x55')]);var _0x3aebe7=new jsforce[(_0xf347('0x56'))]({'oauth2':{'loginUrl':_0x372d8a[_0xf347('0x57')]||_0xf347('0x58'),'clientId':_0x372d8a[_0xf347('0x59')],'clientSecret':_0x372d8a[_0xf347('0x5a')]}});return _0x3aebe7['login'](_0x372d8a[_0xf347('0x5b')],_0xee0ba9)[_0xf347('0x26')](function(){logger[_0xf347('0x29')]('Connection\x20established.');return _0x3aebe7;});}exports[_0xf347('0x5c')]=function(_0x325077,_0x4dce0d,_0x2cafd7,_0x29f575,_0x1c5206,_0x281f22){var _0x30d6ae,_0x2cf239,_0x978c7f,_0x30350a;_0x281f22[_0xf347('0x5d')]=intUtil[_0xf347('0x5e')](_0x281f22[_0xf347('0x5d')]);_0x281f22[_0xf347('0x57')]=intUtil[_0xf347('0x5e')](_0x281f22[_0xf347('0x57')]);if(_0x1c5206&&_0x1c5206[_0xf347('0x5f')]){logger[_0xf347('0x29')](_0xf347('0x60'),_0xf347('0x61'));_0x4dce0d[_0xf347('0x62')]=util[_0xf347('0x46')](_0xf347('0x63'),_0x281f22[_0xf347('0x5d')],_0x4dce0d[_0xf347('0x64')],md5(_0x4dce0d[_0xf347('0x64')]));}else{_0x4dce0d[_0xf347('0x62')]='';}return getConnection(_0x281f22)[_0xf347('0x26')](function(_0x445ba8){_0x30350a=_0x445ba8;return getUser(_0x281f22,_0x29f575['email'],_0x30350a);})[_0xf347('0x26')](function(_0x374fe6){_0x30d6ae=_0x374fe6;return getEndUser(_0x281f22,_0x2cafd7,_0x4dce0d[_0xf347('0x65')],_0x4dce0d['calleridnum'],_0x30350a);})[_0xf347('0x26')](function(_0x391b7e){_0x2cf239=_0x391b7e;return getTicket(_0x281f22,_0x30d6ae,_0x2cf239,_0x2cafd7,_0x4dce0d,_0x2cafd7[_0xf347('0x66')],_0x30350a,_0xf347('0x5c'));})[_0xf347('0x26')](function(_0x5379b6){_0x978c7f=_0x5379b6;logger[_0xf347('0x29')](_0xf347('0x67'),_0x978c7f['id']);logger[_0xf347('0x29')](_0xf347('0x68'),_0x978c7f['id'],_0x29f575['name'],_0x281f22[_0xf347('0x3f')]);switch(_0x281f22[_0xf347('0x3f')]){case _0xf347('0x69'):emit(util[_0xf347('0x46')]('user:%s',_0x29f575['name']),_0xf347('0x6a'),{'recordId':_0x978c7f['id']});break;case'newTab':emit(util[_0xf347('0x46')]('user:%s',_0x29f575[_0xf347('0x52')]),_0xf347('0x6b'),{'uri':util['format']('%s/%s/e',_0x30350a[_0xf347('0x6c')],_0x978c7f['id'])});break;default:logger[_0xf347('0x6d')](_0xf347('0x6e'));}})[_0xf347('0x6f')](function(_0x1e714a){logger[_0xf347('0x6d')](_0xf347('0x60'),_0x1e714a);});};exports[_0xf347('0x70')]=function(_0x963b15,_0xb46408,_0x21a786,_0x5e5a4c,_0x18a6a6,_0x34556f,_0x1386c3){var _0x37d1b9,_0xfca349,_0x4e6224,_0x44833e;_0x34556f[_0xf347('0x5d')]=intUtil[_0xf347('0x5e')](_0x34556f['serverUrl']);_0x34556f[_0xf347('0x57')]=intUtil[_0xf347('0x5e')](_0x34556f[_0xf347('0x57')]);if(_0x1386c3&&_0x1386c3[_0xf347('0x71')]&&_0x1386c3['recordingFormat']!==_0xf347('0x72')){logger[_0xf347('0x29')]('[OUTBOUND]',_0xf347('0x61'));_0xb46408[_0xf347('0x62')]=util[_0xf347('0x46')](_0xf347('0x63'),_0x34556f[_0xf347('0x5d')],_0xb46408[_0xf347('0x64')],md5(_0xb46408[_0xf347('0x64')]));}return getConnection(_0x34556f)[_0xf347('0x26')](function(_0x491c85){_0x44833e=_0x491c85;return getUser(_0x34556f,_0x5e5a4c['email'],_0x44833e);})['then'](function(_0x5ae23f){_0x37d1b9=_0x5ae23f;return getEndUser(_0x34556f,_0x21a786,_0xb46408[_0xf347('0x73')],_0xb46408[_0xf347('0x74')],_0x44833e);})['then'](function(_0x4fc1ee){_0xfca349=_0x4fc1ee;return getTicket(_0x34556f,_0x37d1b9,_0xfca349,_0x21a786,_0xb46408,_0x21a786['Fields'],_0x44833e,'outbound');})['then'](function(_0x3a0337){_0x4e6224=_0x3a0337;logger[_0xf347('0x29')](_0xf347('0x75'),_0x4e6224['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4e6224['id'],_0x5e5a4c[_0xf347('0x52')],_0x34556f[_0xf347('0x3f')]);switch(_0x34556f['type']){case _0xf347('0x69'):emit(util[_0xf347('0x46')](_0xf347('0x76'),_0x5e5a4c[_0xf347('0x52')]),_0xf347('0x6a'),{'recordId':_0x4e6224['id']});break;case _0xf347('0x77'):emit(util['format']('user:%s',_0x5e5a4c[_0xf347('0x52')]),_0xf347('0x6b'),{'uri':util['format'](_0xf347('0x78'),_0x44833e[_0xf347('0x6c')],_0x4e6224['id'])});break;default:logger[_0xf347('0x6d')](_0xf347('0x79'),_0xf347('0x7a'));}})[_0xf347('0x6f')](function(_0x204282){logger[_0xf347('0x6d')](_0xf347('0x79'),_0x204282);});};exports[_0xf347('0x7b')]=function(_0x489106,_0x835078,_0x5da192,_0x2266c2,_0xb8544d,_0x4a12d1){var _0x37f2f6,_0x4e6080,_0x398f1b,_0x412b94;_0x4a12d1[_0xf347('0x5d')]=intUtil[_0xf347('0x5e')](_0x4a12d1[_0xf347('0x5d')]);_0x4a12d1[_0xf347('0x57')]=intUtil[_0xf347('0x5e')](_0x4a12d1[_0xf347('0x57')]);if(_0xb8544d&&_0xb8544d['monitor_format']){logger[_0xf347('0x29')]('['+_0x835078[_0xf347('0x7c')][_0xf347('0x7d')]()+']',_0xf347('0x61'));_0x835078[_0xf347('0x62')]=util[_0xf347('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a12d1[_0xf347('0x5d')],_0x835078[_0xf347('0x64')],md5(_0x835078[_0xf347('0x64')]));}else{_0x835078[_0xf347('0x62')]='';}return getConnection(_0x4a12d1)[_0xf347('0x26')](function(_0x3f37b9){_0x412b94=_0x3f37b9;if(!_[_0xf347('0x22')](_0x2266c2)){return getUser(_0x4a12d1,_0x2266c2[_0xf347('0x52')],_0x412b94);}else{return getUser(_0x4a12d1,null,_0x412b94);}})['then'](function(_0x50277a){_0x37f2f6=_0x50277a;return getEndUser(_0x4a12d1,_0x5da192,_0x835078['calleridname'],_0x835078[_0xf347('0x7e')],_0x412b94);})['then'](function(_0x28e446){_0x4e6080=_0x28e446;return getTicket(_0x4a12d1,_0x37f2f6,_0x4e6080,_0x5da192,_0x835078,_0x5da192[_0xf347('0x66')],_0x412b94);})[_0xf347('0x26')](function(_0x4aec9b){_0x398f1b=_0x4aec9b;logger['info']('['+_0x835078[_0xf347('0x7c')]['toUpperCase']()+_0xf347('0x7f'),_0x398f1b['id']);logger['info']('['+_0x835078['lastevent']['toUpperCase']()+_0xf347('0x80'),_0x4a12d1['type']);})[_0xf347('0x6f')](function(_0xd2e963){logger[_0xf347('0x6d')]('['+_0x835078[_0xf347('0x7c')][_0xf347('0x7d')]()+']',_0xd2e963);});}; \ 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 6fa741d..de19593 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 _0x9c0c=['Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','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','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','ioredis','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','customField','nameField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name','endUserId','POST','incident','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId'];(function(_0x2869c6,_0x1252fd){var _0x40f2e6=function(_0x48ac6b){while(--_0x48ac6b){_0x2869c6['push'](_0x2869c6['shift']());}};_0x40f2e6(++_0x1252fd);}(_0x9c0c,0x16e));var _0xc9c0=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x9c0c[_0x54b396];return _0x532e6d;};'use strict';var _=require(_0xc9c0('0x0'));var Promise=require(_0xc9c0('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0xc9c0('0x2'));var Redis=require(_0xc9c0('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xc9c0('0x4'))(_0xc9c0('0x5'));config[_0xc9c0('0x6')]=_[_0xc9c0('0x7')](config[_0xc9c0('0x6')],{'host':_0xc9c0('0x8'),'port':0x18eb});var io=require(_0xc9c0('0x9'))(new Redis(config[_0xc9c0('0x6')]));function getAdminUser(_0x50f8f2,_0x22af2f,_0x446d82,_0x56da89,_0x561628,_0xd70198){return new Promise(function(_0x189721,_0x342238){var _0x273581={'method':_0xc9c0('0xa'),'uri':_0x56da89+_0xc9c0('0xb')+'&'+_0x561628+'&'+_0xd70198,'auth':_0x22af2f,'json':!![]};return rp(_0x273581)[_0xc9c0('0xc')](function(_0xa08fd){if(_0xa08fd[_0xc9c0('0xd')][_0xc9c0('0xe')]>0x0){_0x446d82[_0xc9c0('0xf')]=_0xa08fd['result'][0x0][_0xc9c0('0x10')];}logger[_0xc9c0('0x11')]('['+[_0x50f8f2[_0xc9c0('0x12')]()]+_0xc9c0('0x13'),_0x446d82);_0x189721(_0x446d82);})[_0xc9c0('0x14')](function(_0x275243){logger[_0xc9c0('0x15')]('['+[_0x50f8f2['toUpperCase']()]+']',_0x275243[_0xc9c0('0x16')]);_0x342238(_0x275243[_0xc9c0('0x16')]);});});}function getUser(_0x4a04d4,_0x4afaa7,_0x3a307d,_0x1c5830,_0x24ae1d){return function(_0x2cadb2){logger[_0xc9c0('0x11')]('['+[_0x4a04d4[_0xc9c0('0x12')]()]+_0xc9c0('0x17'),_0x2cadb2);return new Promise(function(_0x5dbad8,_0x2c2da1){if(intUtil['validateEmail'](_0x2cadb2[_0xc9c0('0x18')])){var _0x211f30={'method':_0xc9c0('0xa'),'uri':_0x3a307d+_0xc9c0('0x19')+_0x2cadb2['userEmail']+'&'+_0x1c5830+'&'+_0x24ae1d,'auth':_0x4afaa7,'json':!![]};logger[_0xc9c0('0x11')]('['+[_0x4a04d4[_0xc9c0('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x211f30);return rp(_0x211f30)['then'](function(_0x1a18ef){logger[_0xc9c0('0x11')]('['+[_0x4a04d4[_0xc9c0('0x12')]()]+_0xc9c0('0x1a'),_0x1a18ef);if(_0x1a18ef[_0xc9c0('0xd')]['length']>0x0&&String(_0x1a18ef['result'][0x0][_0xc9c0('0x1b')])===_0xc9c0('0x1c')){_0x2cadb2['userId']=_0x1a18ef[_0xc9c0('0xd')][0x0][_0xc9c0('0x10')];}else{_0x2cadb2[_0xc9c0('0x1d')]=_0x2cadb2['adminId'];_0x2cadb2[_0xc9c0('0x18')]=_0x2cadb2[_0xc9c0('0x1e')];}logger[_0xc9c0('0x11')]('['+[_0x4a04d4[_0xc9c0('0x12')]()]+_0xc9c0('0x1f'),_0x2cadb2);_0x5dbad8(_0x2cadb2);})[_0xc9c0('0x14')](function(_0x2a2a50){logger['error']('['+[_0x4a04d4[_0xc9c0('0x12')]()]+']',_0x2a2a50[_0xc9c0('0x16')]);_0x2c2da1(_0x2a2a50[_0xc9c0('0x16')]);});}else{logger[_0xc9c0('0x11')]('['+[_0x4a04d4['toUpperCase']()]+_0xc9c0('0x20'));_0x2cadb2[_0xc9c0('0x1d')]=_0x2cadb2[_0xc9c0('0xf')];_0x2cadb2[_0xc9c0('0x18')]=_0x2cadb2[_0xc9c0('0x1e')];_0x5dbad8(_0x2cadb2);}});};}function createEndUser(_0x521b90,_0x5e56a9,_0x4ea9b1,_0x26e809,_0x23fca6){logger[_0xc9c0('0x11')]('['+[_0x521b90['toUpperCase']()]+_0xc9c0('0x21'),_0x4ea9b1);return new Promise(function(_0x490ce9,_0x271e67){var _0x2dfe16={'method':'POST','uri':_0x26e809+_0xc9c0('0x22')+_0x23fca6,'body':{'user_name':_0x4ea9b1[_0xc9c0('0x23')],'roles':'user','first_name':_0x4ea9b1[_0xc9c0('0x23')],'active':_0xc9c0('0x1c'),'date_format':_0xc9c0('0x24'),'phone':_0x4ea9b1['endUserNumber']},'auth':_0x5e56a9,'json':!![]};return rp(_0x2dfe16)['then'](function(_0x209683){logger[_0xc9c0('0x11')]('['+[_0x521b90[_0xc9c0('0x12')]()]+_0xc9c0('0x25'),_0x209683[_0xc9c0('0xd')]);_0x4ea9b1['endUserId']=_0x209683[_0xc9c0('0xd')][_0xc9c0('0x10')];_0x490ce9(_0x4ea9b1);})[_0xc9c0('0x14')](function(_0x344dd5){logger[_0xc9c0('0x15')]('['+[_0x521b90[_0xc9c0('0x12')]()]+']',_0x344dd5['message']);_0x271e67(_0x344dd5[_0xc9c0('0x16')]);});});}function getEndUser(_0x576efb,_0x3d378f,_0x13dce3,_0x54ea86,_0x8014b1){return function(_0x2b0c75){logger[_0xc9c0('0x11')]('['+[_0x576efb[_0xc9c0('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x2b0c75);return new Promise(function(_0x14221d,_0xec9133){var _0x965399={'method':_0xc9c0('0xa'),'uri':_0x13dce3+'sys_user?sysparm_query=phone%3D'+_0x2b0c75[_0xc9c0('0x23')]+'&'+_0x54ea86+'&'+_0x8014b1,'auth':_0x3d378f,'json':!![]};return rp(_0x965399)['then'](function(_0x1ca991){if(_0x1ca991[_0xc9c0('0xd')][_0xc9c0('0xe')]>0x0){_0x2b0c75['endUserId']=_0x1ca991[_0xc9c0('0xd')][0x0][_0xc9c0('0x10')];logger[_0xc9c0('0x11')]('['+[_0x576efb[_0xc9c0('0x12')]()]+_0xc9c0('0x26'),_0x2b0c75);_0x14221d(_0x2b0c75);}else{return createEndUser(_0x576efb,_0x3d378f,_0x2b0c75,_0x13dce3,_0x54ea86)[_0xc9c0('0xc')](function(_0x1f761b){logger[_0xc9c0('0x11')]('['+[_0x576efb[_0xc9c0('0x12')]()]+_0xc9c0('0x27'),_0x1f761b);_0x14221d(_0x1f761b);});}})[_0xc9c0('0x14')](function(_0x5009b9){logger['error']('['+[_0x576efb[_0xc9c0('0x12')]()]+']',_0x5009b9[_0xc9c0('0x16')]);_0xec9133(_0x5009b9[_0xc9c0('0x16')]);});});};}function getCustomFields(_0x5592eb,_0x1bed0c){var _0xfc961b={};if(_0x5592eb[_0xc9c0('0xe')]>0x0){_[_0xc9c0('0x28')](_0x5592eb,function(_0x14bc0d){if(_['includes']([_0xc9c0('0x29'),_0xc9c0('0x2a')],_0x14bc0d[_0xc9c0('0x2b')])&&_0x14bc0d['nameField']&&!_0x14bc0d[_0xc9c0('0x2c')]){_0xfc961b[_0x14bc0d[_0xc9c0('0x2d')][_0xc9c0('0x2e')]()]=_0x14bc0d[_0xc9c0('0x2f')]['toString']();}else if(_['includes']([_0xc9c0('0x29'),_0xc9c0('0x2a')],_0x14bc0d['type'])&&_0x14bc0d[_0xc9c0('0x30')]&&_0x14bc0d[_0xc9c0('0x2c')]){_0xfc961b[_0x14bc0d[_0xc9c0('0x30')][_0xc9c0('0x2e')]()]=_0x14bc0d[_0xc9c0('0x2f')][_0xc9c0('0x31')]();}else if(_0x14bc0d[_0xc9c0('0x2b')]===_0xc9c0('0x32')&&_0x14bc0d['variableName']&&_0x14bc0d[_0xc9c0('0x30')]&&_0x14bc0d[_0xc9c0('0x2c')]){_0xfc961b[_0x14bc0d[_0xc9c0('0x30')][_0xc9c0('0x2e')]()]=_0x1bed0c[_0x14bc0d[_0xc9c0('0x33')]][_0xc9c0('0x31')]();}else if(_0x14bc0d['type']===_0xc9c0('0x34')&&_0x14bc0d['Variable']&&_0x14bc0d['Variable']['name']&&_0x14bc0d['idField']&&_0x14bc0d['customField']){_0xfc961b[_0x14bc0d[_0xc9c0('0x30')][_0xc9c0('0x2e')]()]=_0x1bed0c[_0x14bc0d[_0xc9c0('0x35')][_0xc9c0('0x36')][_0xc9c0('0x2e')]()][_0xc9c0('0x31')]();}});}return _0xfc961b;}function getTicket(_0x17d15b,_0x5a70cd,_0x57f695,_0x205dcd,_0x40d05d,_0x4e510c){return function(_0x10bf45){logger[_0xc9c0('0x11')]('['+[_0x17d15b[_0xc9c0('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x10bf45);return new Promise(function(_0x12d393,_0x277f73){var _0x2096c0=_0x17d15b[_0xc9c0('0x2e')]()==='outbound'?_0x10bf45[_0xc9c0('0x1d')]:_0x10bf45[_0xc9c0('0x37')];var _0x1f8274={'method':_0xc9c0('0x38'),'uri':_0x57f695+_0xc9c0('0x39')+'?'+_0x4e510c,'body':Object['assign']({},{'active':_0xc9c0('0x1c'),'caller_id':_0x2096c0,'assigned_to':_0x10bf45[_0xc9c0('0x1d')],'short_description':intUtil['getString'](_0x205dcd[_0xc9c0('0x3a')],_0x40d05d,'\x20'),'description':intUtil[_0xc9c0('0x3b')](_0x205dcd[_0xc9c0('0x3c')],_0x40d05d,'\x0a')},getCustomFields(_0x205dcd[_0xc9c0('0x3d')],_0x40d05d)),'auth':_0x5a70cd,'json':!![]};return rp(_0x1f8274)[_0xc9c0('0xc')](function(_0x4c74a0){logger['info']('['+[_0x17d15b[_0xc9c0('0x12')]()]+_0xc9c0('0x3e'),_0x4c74a0[_0xc9c0('0xd')]);_0x10bf45['ticketId']=_0x4c74a0['result'][_0xc9c0('0x10')];_0x10bf45[_0xc9c0('0x3f')]=_0x4c74a0['result']['number'];logger[_0xc9c0('0x11')]('['+[_0x17d15b[_0xc9c0('0x12')]()]+_0xc9c0('0x40'),_0x10bf45);_0x12d393(_0x10bf45);})[_0xc9c0('0x14')](function(_0x35fff7){logger[_0xc9c0('0x15')]('['+[_0x17d15b['toUpperCase']()]+']',_0x35fff7['message']);_0x277f73(_0x35fff7[_0xc9c0('0x16')]);});});};}function createRemoteTag(_0x3bdb00,_0x18fd2c,_0x4e2475,_0x1f25a7){return new Promise(function(_0x15fe3b,_0x26083f){var _0x2a1874={'method':_0xc9c0('0x38'),'uri':_0x4e2475+_0xc9c0('0x41')+'?'+_0x1f25a7,'body':{'short_description':_0x3bdb00,'global':!![],'active':!![],'name':_0x3bdb00},'auth':_0x18fd2c,'json':!![]};return rp(_0x2a1874)['then'](function(_0x4aefa5){var _0x5e1a9f=_0x4aefa5['result'][_0xc9c0('0x10')];_0x15fe3b(_0x5e1a9f);});});}function getRemoteTag(_0x43b1a7,_0x48d3a5,_0x3b4ac3,_0x2ae2e8,_0x297a05){return new Promise(function(_0x374efd,_0x5dccc7){var _0x403bad={'method':_0xc9c0('0xa'),'uri':_0x3b4ac3+_0xc9c0('0x41')+_0xc9c0('0x42')+_0x43b1a7+'&'+_0x2ae2e8,'auth':_0x48d3a5,'json':!![]};return rp(_0x403bad)[_0xc9c0('0xc')](function(_0x5a4ecf){if(_0x5a4ecf[_0xc9c0('0xd')][_0xc9c0('0xe')]>0x0){var _0x476032=_0x5a4ecf[_0xc9c0('0xd')][0x0][_0xc9c0('0x10')];_0x374efd(_0x476032);}else{return createRemoteTag(_0x43b1a7,_0x48d3a5,_0x3b4ac3,_0x2ae2e8)['then'](function(_0x237cd0){_0x374efd(_0x237cd0);});}});});}function assignTagToIncident(_0x10e2fa,_0x34b269,_0x314184,_0x127573,_0x793090){return new Promise(function(_0xe782f5,_0x293133){var _0x527fe7={'method':_0xc9c0('0x38'),'uri':_0x314184+_0xc9c0('0x43')+'?'+_0x793090,'body':{'label':_0x10e2fa,'table':_0xc9c0('0x39'),'id_type':_0xc9c0('0x44'),'table_key':_0x127573[_0xc9c0('0x45')],'title':_0xc9c0('0x46')+_0x127573[_0xc9c0('0x3f')],'id_display':_0x127573[_0xc9c0('0x3f')]},'auth':_0x34b269,'json':!![]};return rp(_0x527fe7)[_0xc9c0('0xc')](function(_0x25115d){_0xe782f5();})[_0xc9c0('0x14')](function(){_0xe782f5();});});}function manageTags(_0x233b5b,_0x2b2f21,_0x467f82,_0x30dd70,_0x408ae9,_0x34fc03,_0x49004a){return new Promise(function(_0x3f3a82,_0xda475f){var _0x349ff0=[];_0x2b2f21[_0xc9c0('0x28')](function(_0x187376){_0x349ff0[_0xc9c0('0x47')](getRemoteTag(_0x187376,_0x467f82,_0x30dd70,_0x34fc03,_0x49004a));});return Promise[_0xc9c0('0x48')](_0x349ff0)['then'](function(_0x57931e){if(_0x57931e['length']){logger[_0xc9c0('0x11')]('['+[_0x233b5b[_0xc9c0('0x12')]()]+_0xc9c0('0x49'),_0x57931e);var _0x514a7d=[];_0x57931e[_0xc9c0('0x28')](function(_0x1efe7f){_0x514a7d[_0xc9c0('0x47')](assignTagToIncident(_0x1efe7f,_0x467f82,_0x30dd70,_0x408ae9,_0x34fc03));});return Promise['all'](_0x514a7d)['then'](function(){_0x3f3a82();})[_0xc9c0('0x14')](function(){_0x3f3a82();});}else{_0x3f3a82();}});});}function getTags(_0x270226,_0x589edc,_0x2b3f56,_0x59cd06,_0x1173d6,_0x4fa76e){return function(_0x1cdd95){return new Promise(function(_0x32a12e,_0x51d939){var _0x3dd292=[];var _0x25383=_0x59cd06[_0xc9c0('0x4a')];if(_0x25383&&_0x25383[_0xc9c0('0xe')]>0x0){_0x3dd292=_[_0xc9c0('0x4b')](_0x25383,'name');}if(_0x3dd292[_0xc9c0('0xe')]>0x0){return manageTags(_0x270226,_0x3dd292,_0x589edc,_0x2b3f56,_0x1cdd95,_0x1173d6,_0x4fa76e)[_0xc9c0('0xc')](function(){_0x32a12e(_0x1cdd95);});}else{_0x32a12e(_0x1cdd95);}});};}function emit(_0x49cf5a,_0x44af8f,_0x191ebb){var _0x3bad79=_0xc9c0('0x4c')+_0xc9c0('0x4d')+_0xc9c0('0x4e')+'%255EORDERBYDESCnumber';var _0x57fa8a={'uri':_0x49cf5a+_0xc9c0('0x4f')+_0x191ebb+_0x3bad79};io['to'](util[_0xc9c0('0x50')](_0xc9c0('0x51'),_0x44af8f))[_0xc9c0('0x52')](_0xc9c0('0x53'),_0x57fa8a);}exports['cs']=function(_0x423db3,_0x3d85b5,_0x40c7b2,_0x1d9fc2,_0x3ba450,_0x49f997,_0x3b91f2,_0x5a4345){var _0x20161e={};var _0x25248d={'user':_0x49f997[_0xc9c0('0x54')],'pass':_0x49f997[_0xc9c0('0x55')]};var _0x50351d=_0xc9c0('0x56');var _0x1e28c='sysparm_display_value=true';_0x49f997[_0xc9c0('0x57')]=intUtil[_0xc9c0('0x58')](_0x49f997[_0xc9c0('0x57')]);_0x49f997[_0xc9c0('0x59')]=intUtil[_0xc9c0('0x58')](_0x49f997[_0xc9c0('0x59')]);var _0xd17b25=util[_0xc9c0('0x50')](_0xc9c0('0x5a'),_0x49f997['remoteUri']);_0x20161e[_0xc9c0('0x18')]=!_[_0xc9c0('0x5b')](_0x1d9fc2)?_0x1d9fc2['email']:null;_0x20161e['adminEmail']=_0x49f997[_0xc9c0('0x5c')];_0x20161e[_0xc9c0('0x23')]=_0x5a4345[_0xc9c0('0x2e')]()===_0xc9c0('0x5d')?_0x3d85b5[_0xc9c0('0x5e')]:_0x3d85b5[_0xc9c0('0x5f')];_0x20161e[_0xc9c0('0x60')]=_0x5a4345===_0xc9c0('0x61')||_0x5a4345===_0xc9c0('0x62')?_0xc9c0('0x61'):'outbound';var _0x44208d=util[_0xc9c0('0x50')](_0xc9c0('0x63'),_0x49f997[_0xc9c0('0x59')],_0x3d85b5[_0xc9c0('0x64')],md5(_0x3d85b5[_0xc9c0('0x64')]));if(_0x3ba450&&_0x3ba450['monitor_format']){logger[_0xc9c0('0x11')](_0xc9c0('0x65'),_0xc9c0('0x66'));_0x3d85b5[_0xc9c0('0x67')]=_0x44208d;}else if(_0x3b91f2&&_0x3b91f2['recordingFormat']&&_0x3b91f2['recordingFormat']!=='none'){logger[_0xc9c0('0x11')]('[OUTBOUND]',_0xc9c0('0x66'));_0x3d85b5[_0xc9c0('0x67')]=_0x44208d;}else{_0x3d85b5[_0xc9c0('0x67')]='';}return getAdminUser(_0x5a4345,_0x25248d,_0x20161e,_0xd17b25,_0x1e28c,_0x50351d)[_0xc9c0('0xc')](getUser(_0x5a4345,_0x25248d,_0xd17b25,_0x1e28c,_0x50351d))['then'](getEndUser(_0x5a4345,_0x25248d,_0xd17b25,_0x1e28c,_0x50351d))['then'](getTicket(_0x5a4345,_0x25248d,_0xd17b25,_0x40c7b2,_0x3d85b5,_0x1e28c))[_0xc9c0('0xc')](function(_0x3c3d82){logger[_0xc9c0('0x11')](util[_0xc9c0('0x50')](_0xc9c0('0x68'),_0x3c3d82[_0xc9c0('0x45')]));logger[_0xc9c0('0x11')](util[_0xc9c0('0x50')](_0xc9c0('0x69'),_0x5a4345));if(_0x5a4345!=='unmanaged'){logger[_0xc9c0('0x11')]('['+[_0x5a4345[_0xc9c0('0x12')]()]+']',_0xc9c0('0x6a'));emit(_0x49f997[_0xc9c0('0x57')],_0x1d9fc2['name'],_0x3c3d82['ticketId']);}})['catch'](function(_0x33897c){logger[_0xc9c0('0x15')]('['+[_0x5a4345['toUpperCase']()]+_0xc9c0('0x6b'),util[_0xc9c0('0x6c')](_0x33897c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3645=['../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','length','true','userId','adminEmail','],\x20getUser\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','string','type','nameField','customField','toLowerCase','content','toString','includes','idField','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','./util'];(function(_0x2be927,_0x3b80ce){var _0x191b48=function(_0x320509){while(--_0x320509){_0x2be927['push'](_0x2be927['shift']());}};_0x191b48(++_0x3b80ce);}(_0x3645,0xc8));var _0x5364=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x3645[_0x5a2d95];return _0x2c3986;};'use strict';var _=require(_0x5364('0x0'));var Promise=require(_0x5364('0x1'));var rp=require(_0x5364('0x2'));var util=require(_0x5364('0x3'));var md5=require(_0x5364('0x4'));var Redis=require('ioredis');var intUtil=require(_0x5364('0x5'));var config=require(_0x5364('0x6'));var logger=require(_0x5364('0x7'))('servicenow');config[_0x5364('0x8')]=_['defaults'](config[_0x5364('0x8')],{'host':_0x5364('0x9'),'port':0x18eb});var io=require(_0x5364('0xa'))(new Redis(config['redis']));function getAdminUser(_0x244ee1,_0x22195f,_0x45a473,_0x28dc64,_0x6f3fad,_0x46653d){return new Promise(function(_0x2297af,_0xf5e044){var _0x4ea69c={'method':'GET','uri':_0x28dc64+_0x5364('0xb')+'&'+_0x6f3fad+'&'+_0x46653d,'auth':_0x22195f,'json':!![]};return rp(_0x4ea69c)[_0x5364('0xc')](function(_0x3c9be9){if(_0x3c9be9[_0x5364('0xd')]['length']>0x0){_0x45a473[_0x5364('0xe')]=_0x3c9be9[_0x5364('0xd')][0x0][_0x5364('0xf')];}logger[_0x5364('0x10')]('['+[_0x244ee1[_0x5364('0x11')]()]+_0x5364('0x12'),_0x45a473);_0x2297af(_0x45a473);})[_0x5364('0x13')](function(_0x3cff5d){logger[_0x5364('0x14')]('['+[_0x244ee1[_0x5364('0x11')]()]+']',_0x3cff5d[_0x5364('0x15')]);_0xf5e044(_0x3cff5d[_0x5364('0x15')]);});});}function getUser(_0x246c2e,_0x1deae4,_0x5773b7,_0x5aa1b3,_0x4006f2){return function(_0x5c9809){logger[_0x5364('0x10')]('['+[_0x246c2e[_0x5364('0x11')]()]+_0x5364('0x16'),_0x5c9809);return new Promise(function(_0x2006e5,_0x29f2d5){if(intUtil[_0x5364('0x17')](_0x5c9809[_0x5364('0x18')])){var _0x628cd1={'method':_0x5364('0x19'),'uri':_0x5773b7+'sys_user?sysparm_query=email%3D'+_0x5c9809[_0x5364('0x18')]+'&'+_0x5aa1b3+'&'+_0x4006f2,'auth':_0x1deae4,'json':!![]};logger[_0x5364('0x10')]('['+[_0x246c2e[_0x5364('0x11')]()]+_0x5364('0x1a'),_0x628cd1);return rp(_0x628cd1)[_0x5364('0xc')](function(_0xa38172){logger[_0x5364('0x10')]('['+[_0x246c2e[_0x5364('0x11')]()]+'],\x20getUser\x20entity',_0xa38172);if(_0xa38172[_0x5364('0xd')][_0x5364('0x1b')]>0x0&&String(_0xa38172[_0x5364('0xd')][0x0]['active'])===_0x5364('0x1c')){_0x5c9809[_0x5364('0x1d')]=_0xa38172['result'][0x0][_0x5364('0xf')];}else{_0x5c9809[_0x5364('0x1d')]=_0x5c9809['adminId'];_0x5c9809[_0x5364('0x18')]=_0x5c9809[_0x5364('0x1e')];}logger[_0x5364('0x10')]('['+[_0x246c2e[_0x5364('0x11')]()]+_0x5364('0x1f'),_0x5c9809);_0x2006e5(_0x5c9809);})[_0x5364('0x13')](function(_0x2e0d74){logger[_0x5364('0x14')]('['+[_0x246c2e[_0x5364('0x11')]()]+']',_0x2e0d74[_0x5364('0x15')]);_0x29f2d5(_0x2e0d74[_0x5364('0x15')]);});}else{logger[_0x5364('0x10')]('['+[_0x246c2e[_0x5364('0x11')]()]+']\x20using\x20admin\x20profile');_0x5c9809[_0x5364('0x1d')]=_0x5c9809[_0x5364('0xe')];_0x5c9809[_0x5364('0x18')]=_0x5c9809[_0x5364('0x1e')];_0x2006e5(_0x5c9809);}});};}function createEndUser(_0x16f1c6,_0x4ee1ca,_0x1634a3,_0x50b083,_0x157581){logger[_0x5364('0x10')]('['+[_0x16f1c6['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x1634a3);return new Promise(function(_0x24e06f,_0x3c0627){var _0x268250={'method':_0x5364('0x20'),'uri':_0x50b083+_0x5364('0x21')+_0x157581,'body':{'user_name':_0x1634a3[_0x5364('0x22')],'roles':'user','first_name':_0x1634a3[_0x5364('0x22')],'active':_0x5364('0x1c'),'date_format':_0x5364('0x23'),'phone':_0x1634a3[_0x5364('0x22')]},'auth':_0x4ee1ca,'json':!![]};return rp(_0x268250)[_0x5364('0xc')](function(_0x4d7642){logger['info']('['+[_0x16f1c6['toUpperCase']()]+_0x5364('0x24'),_0x4d7642[_0x5364('0xd')]);_0x1634a3['endUserId']=_0x4d7642[_0x5364('0xd')][_0x5364('0xf')];_0x24e06f(_0x1634a3);})['catch'](function(_0x2580fe){logger[_0x5364('0x14')]('['+[_0x16f1c6[_0x5364('0x11')]()]+']',_0x2580fe[_0x5364('0x15')]);_0x3c0627(_0x2580fe[_0x5364('0x15')]);});});}function getEndUser(_0xab862d,_0x1e55e7,_0x3cf183,_0x271b0c,_0x24271c){return function(_0x300b26){logger[_0x5364('0x10')]('['+[_0xab862d['toUpperCase']()]+_0x5364('0x25'),_0x300b26);return new Promise(function(_0x118e57,_0x616ec5){var _0xfa0283={'method':'GET','uri':_0x3cf183+_0x5364('0x26')+_0x300b26[_0x5364('0x22')]+'&'+_0x271b0c+'&'+_0x24271c,'auth':_0x1e55e7,'json':!![]};return rp(_0xfa0283)[_0x5364('0xc')](function(_0x4aae5a){if(_0x4aae5a[_0x5364('0xd')][_0x5364('0x1b')]>0x0){_0x300b26[_0x5364('0x27')]=_0x4aae5a[_0x5364('0xd')][0x0][_0x5364('0xf')];logger[_0x5364('0x10')]('['+[_0xab862d[_0x5364('0x11')]()]+_0x5364('0x28'),_0x300b26);_0x118e57(_0x300b26);}else{return createEndUser(_0xab862d,_0x1e55e7,_0x300b26,_0x3cf183,_0x271b0c)[_0x5364('0xc')](function(_0x45d452){logger[_0x5364('0x10')]('['+[_0xab862d[_0x5364('0x11')]()]+'],\x20createEndUser\x20crm',_0x45d452);_0x118e57(_0x45d452);});}})['catch'](function(_0x32ad4b){logger['error']('['+[_0xab862d[_0x5364('0x11')]()]+']',_0x32ad4b[_0x5364('0x15')]);_0x616ec5(_0x32ad4b[_0x5364('0x15')]);});});};}function getCustomFields(_0x3b503f,_0x3be4ef){var _0x35d428={};if(_0x3b503f[_0x5364('0x1b')]>0x0){_[_0x5364('0x29')](_0x3b503f,function(_0x5b7b69){if(_['includes']([_0x5364('0x2a'),'picklist'],_0x5b7b69[_0x5364('0x2b')])&&_0x5b7b69[_0x5364('0x2c')]&&!_0x5b7b69[_0x5364('0x2d')]){_0x35d428[_0x5b7b69['nameField'][_0x5364('0x2e')]()]=_0x5b7b69[_0x5364('0x2f')][_0x5364('0x30')]();}else if(_[_0x5364('0x31')]([_0x5364('0x2a'),'picklist'],_0x5b7b69[_0x5364('0x2b')])&&_0x5b7b69['idField']&&_0x5b7b69[_0x5364('0x2d')]){_0x35d428[_0x5b7b69[_0x5364('0x32')][_0x5364('0x2e')]()]=_0x5b7b69[_0x5364('0x2f')][_0x5364('0x30')]();}else if(_0x5b7b69['type']==='variable'&&_0x5b7b69[_0x5364('0x33')]&&_0x5b7b69[_0x5364('0x32')]&&_0x5b7b69[_0x5364('0x2d')]){_0x35d428[_0x5b7b69['idField'][_0x5364('0x2e')]()]=_0x3be4ef[_0x5b7b69[_0x5364('0x33')]][_0x5364('0x30')]();}else if(_0x5b7b69[_0x5364('0x2b')]===_0x5364('0x34')&&_0x5b7b69[_0x5364('0x35')]&&_0x5b7b69[_0x5364('0x35')]['name']&&_0x5b7b69[_0x5364('0x32')]&&_0x5b7b69[_0x5364('0x2d')]){_0x35d428[_0x5b7b69[_0x5364('0x32')][_0x5364('0x2e')]()]=_0x3be4ef[_0x5b7b69[_0x5364('0x35')][_0x5364('0x36')][_0x5364('0x2e')]()][_0x5364('0x30')]();}});}return _0x35d428;}function getTicket(_0x59b88f,_0x209308,_0x5cbac5,_0x4965f7,_0x3c1652,_0x12b40e){return function(_0xa25b49){logger[_0x5364('0x10')]('['+[_0x59b88f[_0x5364('0x11')]()]+']\x20getTicket\x20input\x20crm',_0xa25b49);return new Promise(function(_0x7105fd,_0x28097e){var _0x2f95cb=_0x59b88f[_0x5364('0x2e')]()===_0x5364('0x37')?_0xa25b49[_0x5364('0x1d')]:_0xa25b49['endUserId'];var _0x5ac1ba={'method':_0x5364('0x20'),'uri':_0x5cbac5+_0x5364('0x38')+'?'+_0x12b40e,'body':Object[_0x5364('0x39')]({},{'active':_0x5364('0x1c'),'caller_id':_0x2f95cb,'assigned_to':_0xa25b49[_0x5364('0x1d')],'short_description':intUtil[_0x5364('0x3a')](_0x4965f7[_0x5364('0x3b')],_0x3c1652,'\x20'),'description':intUtil[_0x5364('0x3a')](_0x4965f7[_0x5364('0x3c')],_0x3c1652,'\x0a')},getCustomFields(_0x4965f7['Fields'],_0x3c1652)),'auth':_0x209308,'json':!![]};return rp(_0x5ac1ba)[_0x5364('0xc')](function(_0x4f0aa0){logger[_0x5364('0x10')]('['+[_0x59b88f['toUpperCase']()]+_0x5364('0x3d'),_0x4f0aa0[_0x5364('0xd')]);_0xa25b49[_0x5364('0x3e')]=_0x4f0aa0[_0x5364('0xd')][_0x5364('0xf')];_0xa25b49[_0x5364('0x3f')]=_0x4f0aa0[_0x5364('0xd')][_0x5364('0x40')];logger[_0x5364('0x10')]('['+[_0x59b88f[_0x5364('0x11')]()]+']\x20getTicket\x20crm',_0xa25b49);_0x7105fd(_0xa25b49);})[_0x5364('0x13')](function(_0xa03d97){logger[_0x5364('0x14')]('['+[_0x59b88f[_0x5364('0x11')]()]+']',_0xa03d97[_0x5364('0x15')]);_0x28097e(_0xa03d97['message']);});});};}function createRemoteTag(_0x307a9b,_0x41e537,_0x1ea362,_0x3bd3ee){return new Promise(function(_0x5955f1,_0xc3a38b){var _0x5229d8={'method':_0x5364('0x20'),'uri':_0x1ea362+'label'+'?'+_0x3bd3ee,'body':{'short_description':_0x307a9b,'global':!![],'active':!![],'name':_0x307a9b},'auth':_0x41e537,'json':!![]};return rp(_0x5229d8)['then'](function(_0x1ab699){var _0x336238=_0x1ab699['result'][_0x5364('0xf')];_0x5955f1(_0x336238);});});}function getRemoteTag(_0x2e66d3,_0x395acd,_0xe2b580,_0x26ee40,_0x26f3f4){return new Promise(function(_0x57b23d,_0x347e85){var _0x3215f2={'method':_0x5364('0x19'),'uri':_0xe2b580+_0x5364('0x41')+_0x5364('0x42')+_0x2e66d3+'&'+_0x26ee40,'auth':_0x395acd,'json':!![]};return rp(_0x3215f2)[_0x5364('0xc')](function(_0x18e364){if(_0x18e364[_0x5364('0xd')]['length']>0x0){var _0x2e224d=_0x18e364[_0x5364('0xd')][0x0]['sys_id'];_0x57b23d(_0x2e224d);}else{return createRemoteTag(_0x2e66d3,_0x395acd,_0xe2b580,_0x26ee40)[_0x5364('0xc')](function(_0x52a9d5){_0x57b23d(_0x52a9d5);});}});});}function assignTagToIncident(_0x47984a,_0x3e74b5,_0x3883ae,_0x5a550e,_0xb266d8){return new Promise(function(_0x35096b,_0x4c9f35){var _0x301a04={'method':_0x5364('0x20'),'uri':_0x3883ae+_0x5364('0x43')+'?'+_0xb266d8,'body':{'label':_0x47984a,'table':'incident','id_type':_0x5364('0x44'),'table_key':_0x5a550e[_0x5364('0x3e')],'title':_0x5364('0x45')+_0x5a550e[_0x5364('0x3f')],'id_display':_0x5a550e['ticketNumber']},'auth':_0x3e74b5,'json':!![]};return rp(_0x301a04)['then'](function(_0x155d27){_0x35096b();})[_0x5364('0x13')](function(){_0x35096b();});});}function manageTags(_0x379e34,_0xacfd57,_0x4cd452,_0x3fab54,_0xe8dc7c,_0x323f5f,_0x3b7c56){return new Promise(function(_0x126460,_0x276021){var _0xd0030b=[];_0xacfd57[_0x5364('0x29')](function(_0x3b20de){_0xd0030b[_0x5364('0x46')](getRemoteTag(_0x3b20de,_0x4cd452,_0x3fab54,_0x323f5f,_0x3b7c56));});return Promise[_0x5364('0x47')](_0xd0030b)[_0x5364('0xc')](function(_0x12ee9b){if(_0x12ee9b[_0x5364('0x1b')]){logger['info']('['+[_0x379e34[_0x5364('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x12ee9b);var _0x3c61e7=[];_0x12ee9b[_0x5364('0x29')](function(_0x2499f5){_0x3c61e7['push'](assignTagToIncident(_0x2499f5,_0x4cd452,_0x3fab54,_0xe8dc7c,_0x323f5f));});return Promise[_0x5364('0x47')](_0x3c61e7)[_0x5364('0xc')](function(){_0x126460();})[_0x5364('0x13')](function(){_0x126460();});}else{_0x126460();}});});}function getTags(_0x594f14,_0x4d1b45,_0x4dc17b,_0x59684b,_0x48bbfd,_0x422d06){return function(_0x5a9d69){return new Promise(function(_0x217b4d,_0x2da983){var _0x4af35b=[];var _0x3ab74f=_0x59684b[_0x5364('0x48')];if(_0x3ab74f&&_0x3ab74f[_0x5364('0x1b')]>0x0){_0x4af35b=_['map'](_0x3ab74f,_0x5364('0x36'));}if(_0x4af35b[_0x5364('0x1b')]>0x0){return manageTags(_0x594f14,_0x4af35b,_0x4d1b45,_0x4dc17b,_0x5a9d69,_0x48bbfd,_0x422d06)['then'](function(){_0x217b4d(_0x5a9d69);});}else{_0x217b4d(_0x5a9d69);}});};}function emit(_0x221e4c,_0xf48de7,_0xf300bb){var _0x290149=_0x5364('0x49')+_0x5364('0x4a')+_0x5364('0x4b')+_0x5364('0x4c');var _0x51148c={'uri':_0x221e4c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0xf300bb+_0x290149};io['to'](util[_0x5364('0x4d')]('user:%s',_0xf48de7))[_0x5364('0x4e')](_0x5364('0x4f'),_0x51148c);}exports['cs']=function(_0x23b615,_0x8e74f4,_0x438335,_0x4eaaf3,_0x315dbf,_0x2312fe,_0x102b48,_0x129468){var _0x5485ec={};var _0x5775b3={'user':_0x2312fe[_0x5364('0x50')],'pass':_0x2312fe['password']};var _0x105bca=_0x5364('0x51');var _0x13a4ba=_0x5364('0x52');_0x2312fe[_0x5364('0x53')]=intUtil[_0x5364('0x54')](_0x2312fe[_0x5364('0x53')]);_0x2312fe[_0x5364('0x55')]=intUtil[_0x5364('0x54')](_0x2312fe[_0x5364('0x55')]);var _0x5c2af0=util['format'](_0x5364('0x56'),_0x2312fe['remoteUri']);_0x5485ec[_0x5364('0x18')]=!_[_0x5364('0x57')](_0x4eaaf3)?_0x4eaaf3['email']:null;_0x5485ec['adminEmail']=_0x2312fe['email'];_0x5485ec[_0x5364('0x22')]=_0x129468[_0x5364('0x2e')]()===_0x5364('0x37')?_0x8e74f4['destcalleridnum']:_0x8e74f4['calleridnum'];_0x5485ec[_0x5364('0x58')]=_0x129468===_0x5364('0x59')||_0x129468===_0x5364('0x5a')?_0x5364('0x59'):'outbound';var _0x102dda=util[_0x5364('0x4d')](_0x5364('0x5b'),_0x2312fe['serverUrl'],_0x8e74f4[_0x5364('0x5c')],md5(_0x8e74f4['uniqueid']));if(_0x315dbf&&_0x315dbf[_0x5364('0x5d')]){logger['info'](_0x5364('0x5e'),'Recording\x20is\x20enabled!');_0x8e74f4[_0x5364('0x5f')]=_0x102dda;}else if(_0x102b48&&_0x102b48[_0x5364('0x60')]&&_0x102b48[_0x5364('0x60')]!=='none'){logger[_0x5364('0x10')](_0x5364('0x61'),_0x5364('0x62'));_0x8e74f4[_0x5364('0x5f')]=_0x102dda;}else{_0x8e74f4[_0x5364('0x5f')]='';}return getAdminUser(_0x129468,_0x5775b3,_0x5485ec,_0x5c2af0,_0x13a4ba,_0x105bca)[_0x5364('0xc')](getUser(_0x129468,_0x5775b3,_0x5c2af0,_0x13a4ba,_0x105bca))[_0x5364('0xc')](getEndUser(_0x129468,_0x5775b3,_0x5c2af0,_0x13a4ba,_0x105bca))[_0x5364('0xc')](getTicket(_0x129468,_0x5775b3,_0x5c2af0,_0x438335,_0x8e74f4,_0x13a4ba))[_0x5364('0xc')](function(_0x28719a){logger[_0x5364('0x10')](util['format'](_0x5364('0x63'),_0x28719a[_0x5364('0x3e')]));logger[_0x5364('0x10')](util[_0x5364('0x4d')](_0x5364('0x64'),_0x129468));if(_0x129468!==_0x5364('0x5a')){logger[_0x5364('0x10')]('['+[_0x129468['toUpperCase']()]+']',_0x5364('0x65'));emit(_0x2312fe[_0x5364('0x53')],_0x4eaaf3[_0x5364('0x36')],_0x28719a['ticketId']);}})['catch'](function(_0x215c14){logger[_0x5364('0x14')]('['+[_0x129468[_0x5364('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x5364('0x66')](_0x215c14,{'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 d814c07..ccffe3e 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 _0x6388=['debug','[HTTP]','merge','type','string','customField','nameField','content','custom_fields','push','customVariable','Variable','toLowerCase','login','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','%s/service/v4_1/rest.php','recordingFormat','none','Outbound','users','contacts','[OUTBOUND]','unmanaged','isNil','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name'];(function(_0x90de54,_0x487697){var _0xd36573=function(_0x543a4e){while(--_0x543a4e){_0x90de54['push'](_0x90de54['shift']());}};_0xd36573(++_0x487697);}(_0x6388,0x12e));var _0x8638=function(_0x2b6fbd,_0x1e75f0){_0x2b6fbd=_0x2b6fbd-0x0;var _0x5dab65=_0x6388[_0x2b6fbd];return _0x5dab65;};'use strict';var _=require(_0x8638('0x0'));var rp=require(_0x8638('0x1'));var BPromise=require(_0x8638('0x2'));var md5=require(_0x8638('0x3'));var util=require(_0x8638('0x4'));var Redis=require(_0x8638('0x5'));var intUtil=require('./util');var config=require(_0x8638('0x6'));var logger=require(_0x8638('0x7'))('sugarcrm');config[_0x8638('0x8')]=_[_0x8638('0x9')](config[_0x8638('0x8')],{'host':_0x8638('0xa'),'port':0x18eb});var io=require(_0x8638('0xb'))(new Redis(config[_0x8638('0x8')]));var def={'method':_0x8638('0xc'),'json':!![]};function emit(_0x444d01,_0x5f7374,_0x378b77){io['to'](_0x444d01)[_0x8638('0xd')](_0x5f7374,_0x378b77);}function getTicket(_0xa0c054,_0x3531a7,_0x579da7,_0x53a5ad,_0x4e4590,_0x3ffc1,_0x1df24f,_0x18ad67){logger[_0x8638('0xe')](_0x8638('0xf'));var _0x125410=new Date();var _0x19f671=[{'name':'name','value':intUtil[_0x8638('0x10')](_0x53a5ad[_0x8638('0x11')],_0x4e4590,'\x20')},{'name':'assigned_user_id','value':_0x3531a7['id']},{'name':_0x8638('0x12'),'value':_0x3531a7['id']},{'name':_0x8638('0x13'),'value':intUtil[_0x8638('0x10')](_0x53a5ad[_0x8638('0x14')],_0x4e4590,'\x0a')},{'name':'date_start','value':_0x125410[_0x8638('0x15')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x8638('0x16'),'value':'0'},{'name':_0x8638('0x17'),'value':'15'},{'name':_0x8638('0x18'),'value':_0x579da7['id']},{'name':_0x8638('0x19'),'value':_0x8638('0x1a')},{'name':_0x8638('0x1b'),'value':_0x579da7[_0x8638('0x1c')]},{'name':_0x8638('0x1d'),'value':_0x18ad67}];if(_0x3ffc1['length']){_[_0x8638('0x1e')](_0x3ffc1,function(_0x557620){if(_0x4e4590[_0x557620[_0x8638('0x1f')]]){_0x19f671['push']({'name':_0x557620[_0x8638('0x20')],'value':_0x4e4590[_0x557620[_0x8638('0x1f')]]});}});}return request({'form':{'method':_0x8638('0x21'),'input_type':_0x8638('0x22'),'response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'session':_0x1df24f['id'],'module_name':_0x8638('0x24'),'name_value_list':_0x19f671})}});}function getAuth(_0x5557d6){return util[_0x8638('0x25')]('Basic\x20%s',new Buffer(_0x5557d6[_0x8638('0x26')]+':X')[_0x8638('0x27')](_0x8638('0x28')));}function getServerInfo(_0xa08ef1){return request({'form':{'method':_0x8638('0x29'),'input_type':_0x8638('0x22'),'response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'session':_0xa08ef1['id']})}});}function getUser(_0x370ddd,_0x53d5f9,_0x497ac5){if(!_['isNil'](_0x53d5f9)){logger[_0x8638('0xe')]('Getting\x20agent\x20with\x20name',_0x53d5f9);return request({'form':{'method':'get_entry_list','input_type':_0x8638('0x22'),'response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'session':_0x497ac5['id'],'module_name':_0x8638('0x2a'),'query':util[_0x8638('0x25')](_0x8638('0x2b'),_0x53d5f9),'order_by':'','offset':'0','select_fields':['id','name',_0x8638('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xcad18a){if(_0xcad18a[_0x8638('0x2d')][_0x8638('0x2e')]){var _0x1c5bd9=_[_0x8638('0x2f')](_0xcad18a[_0x8638('0x2d')],function(_0x3da7c0){return _0x3da7c0[_0x8638('0x30')][_0x8638('0x2c')][_0x8638('0x31')]===_0x53d5f9;});if(_0x1c5bd9){logger[_0x8638('0xe')](_0x8638('0x32'));return BPromise[_0x8638('0x33')]({'id':_0x1c5bd9[_0x8638('0x30')]['id'][_0x8638('0x31')],'name':_0x1c5bd9[_0x8638('0x30')][_0x8638('0x1c')][_0x8638('0x31')]});}}logger[_0x8638('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x497ac5['name_value_list'][_0x8638('0x34')][_0x8638('0x31')],'name':_0x497ac5[_0x8638('0x30')]['user_name'][_0x8638('0x31')]});});}else{logger[_0x8638('0xe')](_0x8638('0x35'));return BPromise['resolve']({'id':_0x497ac5[_0x8638('0x30')][_0x8638('0x34')]['value'],'name':_0x497ac5['name_value_list'][_0x8638('0x2c')][_0x8638('0x31')]});}}function getEndUser(_0x1f31ad,_0x17d016,_0x380d86,_0x4ee4ae){logger['info']('Searching\x20enduser\x20with\x20phone',_0x380d86);return request({'form':{'method':_0x8638('0x36'),'input_type':'JSON','response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'session':_0x4ee4ae['id'],'module_name':_0x8638('0x1a'),'query':util[_0x8638('0x25')](_0x8638('0x37'),_0x380d86),'order_by':'','offset':'0','select_fields':['id',_0x8638('0x1c'),_0x8638('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8638('0x39')](function(_0x3d509f){if(_0x3d509f[_0x8638('0x2d')][_0x8638('0x2e')]){var _0x449b7b=_['find'](_0x3d509f[_0x8638('0x2d')],function(_0x365c55){return _0x365c55[_0x8638('0x30')][_0x8638('0x38')][_0x8638('0x31')]===_0x380d86;});if(_0x449b7b){logger[_0x8638('0xe')](_0x8638('0x3a'));return BPromise[_0x8638('0x33')]({'id':_0x449b7b[_0x8638('0x30')]['id'][_0x8638('0x31')],'name':_0x449b7b['name_value_list'][_0x8638('0x1c')]['value'],'phone':_0x449b7b[_0x8638('0x30')][_0x8638('0x38')]['value']});}}else{logger[_0x8638('0xe')](_0x8638('0x3b'));return request({'form':{'method':_0x8638('0x21'),'input_type':_0x8638('0x22'),'response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'session':_0x4ee4ae['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x17d016!==_0x8638('0x3c')?_0x17d016:util['format'](_0x8638('0x3d'),_0x380d86)},{'name':_0x8638('0x38'),'value':_0x380d86}]})}})[_0x8638('0x39')](function(_0x42e8cc){logger[_0x8638('0xe')](_0x8638('0x3e'));return BPromise[_0x8638('0x33')]({'id':_0x42e8cc['id'],'name':_0x42e8cc['entry_list'][_0x8638('0x3f')][_0x8638('0x31')],'phone':_0x42e8cc[_0x8638('0x2d')]['phone_home'][_0x8638('0x31')]});});}});}function request(_0x541ffe){logger[_0x8638('0x40')](_0x8638('0x41'),JSON['stringify'](_0x541ffe));return rp(_[_0x8638('0x42')](def,_0x541ffe));}function getTags(_0x1a5055,_0x59ea0d){var _0x474409=[];if(_0x1a5055&&_0x1a5055[_0x8638('0x2e')]>0x0){_0x474409=_['map'](_0x1a5055,_0x59ea0d);}return _0x474409;}function getCustomFields(_0x4f73d3,_0x58accc){var _0x16ec98=[];var _0x27190f={'custom_fields':[]};if(_0x4f73d3[_0x8638('0x2e')]>0x0){_[_0x8638('0x1e')](_0x4f73d3,function(_0xbb27e7){if(_0xbb27e7[_0x8638('0x43')]===_0x8638('0x44')&&_0xbb27e7['nameField']&&!_0xbb27e7[_0x8638('0x45')]){_0x27190f[_0xbb27e7[_0x8638('0x46')]['toLowerCase']()]=_0xbb27e7[_0x8638('0x47')]['toString']();}else if(_0xbb27e7[_0x8638('0x43')]===_0x8638('0x44')&&_0xbb27e7['idField']&&_0xbb27e7[_0x8638('0x45')]){_0x27190f[_0x8638('0x48')][_0x8638('0x49')]({'id':_0xbb27e7[_0x8638('0x20')],'value':_0xbb27e7[_0x8638('0x47')][_0x8638('0x27')]()});}else if(_0xbb27e7[_0x8638('0x43')]==='variable'&&_0xbb27e7[_0x8638('0x1f')]&&_0xbb27e7[_0x8638('0x20')]&&_0xbb27e7[_0x8638('0x45')]){_0x58accc[_0xbb27e7[_0x8638('0x1f')]]&&_0x27190f['custom_fields']['push']({'id':_0xbb27e7[_0x8638('0x20')],'value':_0x58accc[_0xbb27e7[_0x8638('0x1f')]][_0x8638('0x27')]()});}else if(_0xbb27e7[_0x8638('0x43')]===_0x8638('0x4a')&&_0xbb27e7['Variable']&&_0xbb27e7[_0x8638('0x4b')][_0x8638('0x1c')]&&_0xbb27e7['idField']&&_0xbb27e7['customField']){_0x58accc[_0xbb27e7['Variable'][_0x8638('0x1c')]['toLowerCase']()]&&_0x27190f[_0x8638('0x48')][_0x8638('0x49')]({'id':_0xbb27e7[_0x8638('0x20')],'value':_0x58accc[_0xbb27e7[_0x8638('0x4b')][_0x8638('0x1c')][_0x8638('0x4c')]()][_0x8638('0x27')]()});}});}return _0x27190f;}function getConnection(_0x44f90e){return request({'method':_0x8638('0xc'),'form':{'method':_0x8638('0x4d'),'input_type':_0x8638('0x22'),'response_type':_0x8638('0x22'),'rest_data':JSON[_0x8638('0x23')]({'user_auth':{'user_name':_0x44f90e['username'],'password':_0x44f90e[_0x8638('0x4e')],'encryption':'PLAIN'},'application':_0x8638('0x4f')})}})['then'](function(_0x42b46f){var _0x2380d1=_0x42b46f;if(_0x2380d1['id']){def[_0x8638('0x50')]=_0x2380d1['id'];return BPromise[_0x8638('0x33')](_0x2380d1);}else{throw new Error(util[_0x8638('0x25')](_0x8638('0x51'),_0x44f90e['id']));}});}function setRelationship(_0x180feb,_0x28bf13,_0xf64885,_0x65f72c){return request({'form':{'method':_0x8638('0x52'),'input_type':_0x8638('0x22'),'response_type':'JSON','rest_data':JSON[_0x8638('0x23')]({'session':_0x180feb['id'],'module_name':_0x8638('0x24'),'module_id':_0xf64885['id'],'link_field_name':_0x65f72c,'related_ids':[_0x28bf13['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8638('0x53')]=function(_0x312af9,_0x427e52,_0x3d00b2,_0x2f4e43,_0x3c2015,_0x27ad37){var _0x3bcb08,_0x3c1cbc,_0x133511,_0x169164;_0x27ad37[_0x8638('0x54')]=intUtil['stripTrailingSlash'](_0x27ad37[_0x8638('0x54')]);_0x27ad37['serverUrl']=intUtil[_0x8638('0x55')](_0x27ad37[_0x8638('0x56')]);def[_0x8638('0x57')]=util[_0x8638('0x25')]('%s/service/v4_1/rest.php',_0x27ad37['remoteUri']);if(_0x3c2015&&_0x3c2015[_0x8638('0x58')]){logger[_0x8638('0xe')](_0x8638('0x59'),_0x8638('0x5a'));_0x427e52[_0x8638('0x5b')]=util[_0x8638('0x25')](_0x8638('0x5c'),_0x27ad37[_0x8638('0x56')],_0x427e52[_0x8638('0x5d')],md5(_0x427e52[_0x8638('0x5d')]));}else{_0x427e52[_0x8638('0x5b')]='';}return getConnection(_0x27ad37)['then'](function(_0x19aa69){_0x169164=_0x19aa69;return getUser(_0x27ad37,_0x2f4e43[_0x8638('0x1c')],_0x169164);})[_0x8638('0x39')](function(_0x23384a){_0x3bcb08=_0x23384a;logger[_0x8638('0xe')](_0x8638('0x5e'),_0x3bcb08['id']);return getEndUser(_0x27ad37,_0x427e52[_0x8638('0x5f')],_0x427e52[_0x8638('0x60')],_0x169164);})[_0x8638('0x39')](function(_0x560ffa){_0x3c1cbc=_0x560ffa;logger[_0x8638('0xe')](_0x8638('0x61'),_0x3c1cbc['id']);return getTicket(_0x27ad37,_0x3bcb08,_0x3c1cbc,_0x3d00b2,_0x427e52,_0x3d00b2[_0x8638('0x62')],_0x169164,_0x8638('0x63'));})[_0x8638('0x39')](function(_0x395069){_0x133511=_0x395069;logger[_0x8638('0xe')](_0x8638('0x64'));logger[_0x8638('0xe')](_0x8638('0x65'),_0x133511['id']);return setRelationship(_0x169164,_0x3bcb08,_0x133511,'users');})['then'](function(){return setRelationship(_0x169164,_0x3c1cbc,_0x133511,'contacts');})[_0x8638('0x39')](function(){return getServerInfo(_0x169164);})['then'](function(_0x1dc09a){var _0x10a638=parseInt(_0x1dc09a[_0x8638('0x66')][_0x8638('0x67')](0x0));var _0x3ab8f5=util[_0x8638('0x25')](_0x8638('0x68'),_0x27ad37[_0x8638('0x54')],_0x133511['id']);if(_0x10a638>0x6){_0x3ab8f5=util[_0x8638('0x25')](_0x8638('0x69'),_0x27ad37[_0x8638('0x54')],_0x133511['id']);}logger[_0x8638('0xe')](_0x8638('0x59'),_0x8638('0x6a'));emit(util[_0x8638('0x25')](_0x8638('0x6b'),_0x2f4e43[_0x8638('0x1c')]),_0x8638('0x6c'),{'uri':_0x3ab8f5});})[_0x8638('0x6d')](function(_0x22bced){logger[_0x8638('0x6e')](_0x8638('0x59'),JSON[_0x8638('0x23')](_0x22bced));});};exports['outbound']=function(_0x1530db,_0xe2e3cf,_0x469882,_0x2d1b11,_0x308cd1,_0x35873b,_0x4146c9){var _0x45f87,_0x4ea1a4,_0x35322f,_0x2fa8d3;_0x35873b[_0x8638('0x54')]=intUtil[_0x8638('0x55')](_0x35873b[_0x8638('0x54')]);_0x35873b[_0x8638('0x56')]=intUtil[_0x8638('0x55')](_0x35873b['serverUrl']);def['uri']=util[_0x8638('0x25')](_0x8638('0x6f'),_0x35873b[_0x8638('0x54')]);if(_0x4146c9&&_0x4146c9[_0x8638('0x70')]&&_0x4146c9[_0x8638('0x70')]!==_0x8638('0x71')){logger[_0x8638('0xe')]('[OUTBOUND]',_0x8638('0x5a'));_0xe2e3cf['recordingURL']=util['format'](_0x8638('0x5c'),_0x35873b[_0x8638('0x56')],_0xe2e3cf['uniqueid'],md5(_0xe2e3cf[_0x8638('0x5d')]));}return getConnection(_0x35873b)[_0x8638('0x39')](function(_0xe7b37c){_0x2fa8d3=_0xe7b37c;return getUser(_0x35873b,_0x2d1b11['name'],_0x2fa8d3);})['then'](function(_0x27a8d0){_0x45f87=_0x27a8d0;logger[_0x8638('0xe')](_0x8638('0x5e'),_0x45f87['id']);return getEndUser(_0x35873b,_0xe2e3cf['destcalleridname'],_0xe2e3cf['destcalleridnum'],_0x2fa8d3);})['then'](function(_0x4cd4d4){_0x4ea1a4=_0x4cd4d4;logger['info'](_0x8638('0x61'),_0x4ea1a4['id']);return getTicket(_0x35873b,_0x45f87,_0x4ea1a4,_0x469882,_0xe2e3cf,_0x469882[_0x8638('0x62')],_0x2fa8d3,_0x8638('0x72'));})['then'](function(_0x6c277e){_0x35322f=_0x6c277e;logger[_0x8638('0xe')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x35322f['id']);return setRelationship(_0x2fa8d3,_0x45f87,_0x35322f,_0x8638('0x73'));})[_0x8638('0x39')](function(){return setRelationship(_0x2fa8d3,_0x4ea1a4,_0x35322f,_0x8638('0x74'));})[_0x8638('0x39')](function(){return getServerInfo(_0x2fa8d3);})[_0x8638('0x39')](function(_0x467eb3){var _0x12e972=parseInt(_0x467eb3[_0x8638('0x66')][_0x8638('0x67')](0x0));var _0x1330b9=util[_0x8638('0x25')](_0x8638('0x68'),_0x35873b['remoteUri'],_0x35322f['id']);if(_0x12e972>0x6){_0x1330b9=util[_0x8638('0x25')](_0x8638('0x69'),_0x35873b[_0x8638('0x54')],_0x35322f['id']);}logger['info'](_0x8638('0x75'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x8638('0x6b'),_0x2d1b11[_0x8638('0x1c')]),_0x8638('0x6c'),{'uri':_0x1330b9});})[_0x8638('0x6d')](function(_0x31a1f9){logger[_0x8638('0x6e')](_0x8638('0x75'),JSON[_0x8638('0x23')](_0x31a1f9));});};exports[_0x8638('0x76')]=function(_0x4b2d9a,_0x41dcd8,_0x193c7e,_0x37546e,_0x54128d,_0x1916c4){var _0x44d4d6,_0x4a90ca,_0x382e40,_0x294c88;_0x1916c4[_0x8638('0x54')]=intUtil['stripTrailingSlash'](_0x1916c4['remoteUri']);_0x1916c4['serverUrl']=intUtil[_0x8638('0x55')](_0x1916c4[_0x8638('0x56')]);def[_0x8638('0x57')]=util[_0x8638('0x25')](_0x8638('0x6f'),_0x1916c4['remoteUri']);if(_0x54128d&&_0x54128d[_0x8638('0x58')]){logger[_0x8638('0xe')]('['+_0x41dcd8['lastevent']['toUpperCase']()+']',_0x8638('0x5a'));_0x41dcd8[_0x8638('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1916c4[_0x8638('0x56')],_0x41dcd8[_0x8638('0x5d')],md5(_0x41dcd8[_0x8638('0x5d')]));}else{_0x41dcd8['recordingURL']='';}return getConnection(_0x1916c4)[_0x8638('0x39')](function(_0x4090ca){_0x294c88=_0x4090ca;if(!_[_0x8638('0x77')](_0x37546e)){return getUser(_0x1916c4,_0x37546e[_0x8638('0x1c')],_0x294c88);}else{return getUser(_0x1916c4,null,_0x294c88);}})[_0x8638('0x39')](function(_0x485961){_0x44d4d6=_0x485961;logger['info'](_0x8638('0x5e'),_0x44d4d6['id']);return getEndUser(_0x1916c4,_0x41dcd8[_0x8638('0x5f')],_0x41dcd8[_0x8638('0x60')],_0x294c88);})[_0x8638('0x39')](function(_0x32a989){_0x4a90ca=_0x32a989;logger[_0x8638('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4a90ca['id']);return getTicket(_0x1916c4,_0x44d4d6,_0x4a90ca,_0x193c7e,_0x41dcd8,_0x193c7e[_0x8638('0x62')],_0x294c88,_0x8638('0x63'));})['then'](function(_0x3b7aed){_0x382e40=_0x3b7aed;logger[_0x8638('0xe')](_0x8638('0x64'));logger[_0x8638('0xe')](_0x8638('0x65'),_0x382e40['id']);return setRelationship(_0x294c88,_0x44d4d6,_0x382e40,_0x8638('0x73'));})[_0x8638('0x39')](function(){return setRelationship(_0x294c88,_0x4a90ca,_0x382e40,'contacts');})[_0x8638('0x39')](function(){return getServerInfo(_0x294c88);})[_0x8638('0x6d')](function(_0x5cd5bd){logger[_0x8638('0x6e')]('['+_0x41dcd8[_0x8638('0x78')][_0x8638('0x79')]()+']',JSON[_0x8638('0x23')](_0x5cd5bd));});}; \ No newline at end of file +var _0xcc47=['string','customField','toLowerCase','content','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','error','unmanaged','toUpperCase','Inbound','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','entry_list','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type'];(function(_0x586c0a,_0x2cbc3f){var _0x12cfdb=function(_0x172649){while(--_0x172649){_0x586c0a['push'](_0x586c0a['shift']());}};_0x12cfdb(++_0x2cbc3f);}(_0xcc47,0x126));var _0x7cc4=function(_0x11432b,_0x23d7d9){_0x11432b=_0x11432b-0x0;var _0x2bd81e=_0xcc47[_0x11432b];return _0x2bd81e;};'use strict';var _=require(_0x7cc4('0x0'));var rp=require(_0x7cc4('0x1'));var BPromise=require(_0x7cc4('0x2'));var md5=require(_0x7cc4('0x3'));var util=require(_0x7cc4('0x4'));var Redis=require(_0x7cc4('0x5'));var intUtil=require(_0x7cc4('0x6'));var config=require(_0x7cc4('0x7'));var logger=require(_0x7cc4('0x8'))(_0x7cc4('0x9'));config[_0x7cc4('0xa')]=_[_0x7cc4('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7cc4('0xc'))(new Redis(config[_0x7cc4('0xa')]));var def={'method':'POST','json':!![]};function emit(_0x51d13f,_0x5885e0,_0x482bb3){io['to'](_0x51d13f)[_0x7cc4('0xd')](_0x5885e0,_0x482bb3);}function getTicket(_0x4fcd87,_0x32a6d7,_0x23febc,_0x50b1b8,_0x53ab39,_0x3233a5,_0x192529,_0x508536){logger[_0x7cc4('0xe')](_0x7cc4('0xf'));var _0x48d1b4=new Date();var _0x465d4d=[{'name':_0x7cc4('0x10'),'value':intUtil[_0x7cc4('0x11')](_0x50b1b8[_0x7cc4('0x12')],_0x53ab39,'\x20')},{'name':_0x7cc4('0x13'),'value':_0x32a6d7['id']},{'name':_0x7cc4('0x14'),'value':_0x32a6d7['id']},{'name':'description','value':intUtil['getString'](_0x50b1b8[_0x7cc4('0x15')],_0x53ab39,'\x0a')},{'name':_0x7cc4('0x16'),'value':_0x48d1b4[_0x7cc4('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x7cc4('0x18'),'value':'15'},{'name':'parent_id','value':_0x23febc['id']},{'name':_0x7cc4('0x19'),'value':_0x7cc4('0x1a')},{'name':_0x7cc4('0x1b'),'value':_0x23febc['name']},{'name':_0x7cc4('0x1c'),'value':_0x508536}];if(_0x3233a5[_0x7cc4('0x1d')]){_[_0x7cc4('0x1e')](_0x3233a5,function(_0x5d5183){if(_0x53ab39[_0x5d5183[_0x7cc4('0x1f')]]){_0x465d4d[_0x7cc4('0x20')]({'name':_0x5d5183[_0x7cc4('0x21')],'value':_0x53ab39[_0x5d5183[_0x7cc4('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x7cc4('0x22'),'response_type':_0x7cc4('0x22'),'rest_data':JSON[_0x7cc4('0x23')]({'session':_0x192529['id'],'module_name':_0x7cc4('0x24'),'name_value_list':_0x465d4d})}});}function getAuth(_0x5d5f1f){return util[_0x7cc4('0x25')](_0x7cc4('0x26'),new Buffer(_0x5d5f1f[_0x7cc4('0x27')]+':X')[_0x7cc4('0x28')](_0x7cc4('0x29')));}function getServerInfo(_0x13f629){return request({'form':{'method':_0x7cc4('0x2a'),'input_type':_0x7cc4('0x22'),'response_type':_0x7cc4('0x22'),'rest_data':JSON['stringify']({'session':_0x13f629['id']})}});}function getUser(_0x8037d7,_0x2cf147,_0x351e6b){if(!_[_0x7cc4('0x2b')](_0x2cf147)){logger[_0x7cc4('0xe')](_0x7cc4('0x2c'),_0x2cf147);return request({'form':{'method':_0x7cc4('0x2d'),'input_type':_0x7cc4('0x22'),'response_type':_0x7cc4('0x22'),'rest_data':JSON[_0x7cc4('0x23')]({'session':_0x351e6b['id'],'module_name':'Employees','query':util[_0x7cc4('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2cf147),'order_by':'','offset':'0','select_fields':['id',_0x7cc4('0x10'),_0x7cc4('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7cc4('0x2f')](function(_0x25a955){if(_0x25a955['entry_list']['length']){var _0x4a3d52=_['find'](_0x25a955[_0x7cc4('0x30')],function(_0x32765c){return _0x32765c[_0x7cc4('0x31')][_0x7cc4('0x2e')][_0x7cc4('0x32')]===_0x2cf147;});if(_0x4a3d52){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x4a3d52[_0x7cc4('0x31')]['id'][_0x7cc4('0x32')],'name':_0x4a3d52[_0x7cc4('0x31')][_0x7cc4('0x10')][_0x7cc4('0x32')]});}}logger[_0x7cc4('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7cc4('0x33')]({'id':_0x351e6b['name_value_list'][_0x7cc4('0x34')]['value'],'name':_0x351e6b[_0x7cc4('0x31')][_0x7cc4('0x2e')]['value']});});}else{logger[_0x7cc4('0xe')](_0x7cc4('0x35'));return BPromise[_0x7cc4('0x33')]({'id':_0x351e6b[_0x7cc4('0x31')][_0x7cc4('0x34')][_0x7cc4('0x32')],'name':_0x351e6b['name_value_list']['user_name']['value']});}}function getEndUser(_0x42c846,_0x2bc71e,_0x13dfb5,_0x235b35){logger['info'](_0x7cc4('0x36'),_0x13dfb5);return request({'form':{'method':_0x7cc4('0x2d'),'input_type':_0x7cc4('0x22'),'response_type':_0x7cc4('0x22'),'rest_data':JSON[_0x7cc4('0x23')]({'session':_0x235b35['id'],'module_name':_0x7cc4('0x1a'),'query':util['format'](_0x7cc4('0x37'),_0x13dfb5),'order_by':'','offset':'0','select_fields':['id','name',_0x7cc4('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7cc4('0x2f')](function(_0x4064c1){if(_0x4064c1[_0x7cc4('0x30')][_0x7cc4('0x1d')]){var _0x284bf8=_[_0x7cc4('0x39')](_0x4064c1['entry_list'],function(_0x1d2e74){return _0x1d2e74['name_value_list'][_0x7cc4('0x38')][_0x7cc4('0x32')]===_0x13dfb5;});if(_0x284bf8){logger[_0x7cc4('0xe')](_0x7cc4('0x3a'));return BPromise['resolve']({'id':_0x284bf8[_0x7cc4('0x31')]['id'][_0x7cc4('0x32')],'name':_0x284bf8[_0x7cc4('0x31')][_0x7cc4('0x10')][_0x7cc4('0x32')],'phone':_0x284bf8[_0x7cc4('0x31')][_0x7cc4('0x38')]['value']});}}else{logger[_0x7cc4('0xe')](_0x7cc4('0x3b'));return request({'form':{'method':_0x7cc4('0x3c'),'input_type':_0x7cc4('0x22'),'response_type':_0x7cc4('0x22'),'rest_data':JSON[_0x7cc4('0x23')]({'session':_0x235b35['id'],'module_name':_0x7cc4('0x1a'),'name_value_list':[{'name':_0x7cc4('0x3d'),'value':_0x2bc71e!==''?_0x2bc71e:util[_0x7cc4('0x25')](_0x7cc4('0x3e'),_0x13dfb5)},{'name':_0x7cc4('0x38'),'value':_0x13dfb5}]})}})[_0x7cc4('0x2f')](function(_0x4e60c1){logger[_0x7cc4('0xe')](_0x7cc4('0x3f'));return BPromise[_0x7cc4('0x33')]({'id':_0x4e60c1['id'],'name':_0x4e60c1['entry_list']['first_name'][_0x7cc4('0x32')],'phone':_0x4e60c1['entry_list'][_0x7cc4('0x38')]['value']});});}});}function request(_0x244a69){logger[_0x7cc4('0x40')](_0x7cc4('0x41'),JSON[_0x7cc4('0x23')](_0x244a69));return rp(_[_0x7cc4('0x42')](def,_0x244a69));}function getTags(_0x416506,_0x351098){var _0x47fc36=[];if(_0x416506&&_0x416506[_0x7cc4('0x1d')]>0x0){_0x47fc36=_[_0x7cc4('0x43')](_0x416506,_0x351098);}return _0x47fc36;}function getCustomFields(_0x52e228,_0x2ab544){var _0x290992=[];var _0x785ffc={'custom_fields':[]};if(_0x52e228[_0x7cc4('0x1d')]>0x0){_[_0x7cc4('0x1e')](_0x52e228,function(_0x4cebe9){if(_0x4cebe9[_0x7cc4('0x44')]===_0x7cc4('0x45')&&_0x4cebe9['nameField']&&!_0x4cebe9[_0x7cc4('0x46')]){_0x785ffc[_0x4cebe9['nameField'][_0x7cc4('0x47')]()]=_0x4cebe9[_0x7cc4('0x48')][_0x7cc4('0x28')]();}else if(_0x4cebe9[_0x7cc4('0x44')]==='string'&&_0x4cebe9[_0x7cc4('0x21')]&&_0x4cebe9[_0x7cc4('0x46')]){_0x785ffc[_0x7cc4('0x49')][_0x7cc4('0x20')]({'id':_0x4cebe9[_0x7cc4('0x21')],'value':_0x4cebe9[_0x7cc4('0x48')]['toString']()});}else if(_0x4cebe9[_0x7cc4('0x44')]==='variable'&&_0x4cebe9[_0x7cc4('0x1f')]&&_0x4cebe9[_0x7cc4('0x21')]&&_0x4cebe9[_0x7cc4('0x46')]){_0x2ab544[_0x4cebe9[_0x7cc4('0x1f')]]&&_0x785ffc['custom_fields'][_0x7cc4('0x20')]({'id':_0x4cebe9[_0x7cc4('0x21')],'value':_0x2ab544[_0x4cebe9[_0x7cc4('0x1f')]][_0x7cc4('0x28')]()});}else if(_0x4cebe9[_0x7cc4('0x44')]===_0x7cc4('0x4a')&&_0x4cebe9[_0x7cc4('0x4b')]&&_0x4cebe9[_0x7cc4('0x4b')][_0x7cc4('0x10')]&&_0x4cebe9[_0x7cc4('0x21')]&&_0x4cebe9[_0x7cc4('0x46')]){_0x2ab544[_0x4cebe9[_0x7cc4('0x4b')][_0x7cc4('0x10')][_0x7cc4('0x47')]()]&&_0x785ffc[_0x7cc4('0x49')][_0x7cc4('0x20')]({'id':_0x4cebe9['idField'],'value':_0x2ab544[_0x4cebe9['Variable'][_0x7cc4('0x10')][_0x7cc4('0x47')]()][_0x7cc4('0x28')]()});}});}return _0x785ffc;}function getConnection(_0xd7c336){return request({'method':_0x7cc4('0x4c'),'form':{'method':_0x7cc4('0x4d'),'input_type':_0x7cc4('0x22'),'response_type':'JSON','rest_data':JSON[_0x7cc4('0x23')]({'user_auth':{'user_name':_0xd7c336[_0x7cc4('0x4e')],'password':_0xd7c336[_0x7cc4('0x4f')],'encryption':_0x7cc4('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x7cc4('0x2f')](function(_0x2d3e21){var _0x53f74f=_0x2d3e21;if(_0x53f74f['id']){def[_0x7cc4('0x51')]=_0x53f74f['id'];return BPromise[_0x7cc4('0x33')](_0x53f74f);}else{throw new Error(util['format'](_0x7cc4('0x52'),_0xd7c336['id']));}});}function setRelationship(_0x3393e1,_0x2cf14f,_0x1e3f30,_0x2a8631){return request({'form':{'method':_0x7cc4('0x53'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x7cc4('0x23')]({'session':_0x3393e1['id'],'module_name':_0x7cc4('0x24'),'module_id':_0x1e3f30['id'],'link_field_name':_0x2a8631,'related_ids':[_0x2cf14f['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x308bf2,_0x410e2c,_0x174154,_0x2cc9df,_0x3812f8,_0x574c83){var _0x3f2596,_0x58fbcf,_0x2f3d8b,_0x23fe7e;_0x574c83['remoteUri']=intUtil[_0x7cc4('0x54')](_0x574c83[_0x7cc4('0x55')]);_0x574c83[_0x7cc4('0x56')]=intUtil[_0x7cc4('0x54')](_0x574c83[_0x7cc4('0x56')]);def[_0x7cc4('0x57')]=util[_0x7cc4('0x25')](_0x7cc4('0x58'),_0x574c83[_0x7cc4('0x55')]);if(_0x3812f8&&_0x3812f8[_0x7cc4('0x59')]){logger[_0x7cc4('0xe')]('[QUEUE]',_0x7cc4('0x5a'));_0x410e2c[_0x7cc4('0x5b')]=util[_0x7cc4('0x25')](_0x7cc4('0x5c'),_0x574c83[_0x7cc4('0x56')],_0x410e2c['uniqueid'],md5(_0x410e2c[_0x7cc4('0x5d')]));}else{_0x410e2c[_0x7cc4('0x5b')]='';}return getConnection(_0x574c83)[_0x7cc4('0x2f')](function(_0x593065){_0x23fe7e=_0x593065;return getUser(_0x574c83,_0x2cc9df['name'],_0x23fe7e);})['then'](function(_0x90970a){_0x3f2596=_0x90970a;logger[_0x7cc4('0xe')](_0x7cc4('0x5e'),_0x3f2596['id']);return getEndUser(_0x574c83,_0x410e2c['calleridname'],_0x410e2c[_0x7cc4('0x5f')],_0x23fe7e);})['then'](function(_0x53a54a){_0x58fbcf=_0x53a54a;logger[_0x7cc4('0xe')](_0x7cc4('0x60'),_0x58fbcf['id']);return getTicket(_0x574c83,_0x3f2596,_0x58fbcf,_0x174154,_0x410e2c,_0x174154[_0x7cc4('0x61')],_0x23fe7e,'Inbound');})[_0x7cc4('0x2f')](function(_0x60bce6){_0x2f3d8b=_0x60bce6;logger[_0x7cc4('0xe')]('Ticket\x20created!');logger[_0x7cc4('0xe')]('The\x20Ticket\x20ID\x20is:',_0x2f3d8b['id']);return setRelationship(_0x23fe7e,_0x3f2596,_0x2f3d8b,_0x7cc4('0x62'));})['then'](function(){return setRelationship(_0x23fe7e,_0x58fbcf,_0x2f3d8b,_0x7cc4('0x63'));})[_0x7cc4('0x2f')](function(){return getServerInfo(_0x23fe7e);})[_0x7cc4('0x2f')](function(_0x28611e){var _0x39af81=parseInt(_0x28611e[_0x7cc4('0x64')][_0x7cc4('0x65')](0x0));var _0x2d28a0=util[_0x7cc4('0x25')](_0x7cc4('0x66'),_0x574c83['remoteUri'],_0x2f3d8b['id']);if(_0x39af81>0x6){_0x2d28a0=util[_0x7cc4('0x25')](_0x7cc4('0x67'),_0x574c83[_0x7cc4('0x55')],_0x2f3d8b['id']);}logger[_0x7cc4('0xe')](_0x7cc4('0x68'),_0x7cc4('0x69'));emit(util[_0x7cc4('0x25')](_0x7cc4('0x6a'),_0x2cc9df[_0x7cc4('0x10')]),_0x7cc4('0x6b'),{'uri':_0x2d28a0});})[_0x7cc4('0x6c')](function(_0x14213d){logger['error'](_0x7cc4('0x68'),JSON[_0x7cc4('0x23')](_0x14213d));});};exports[_0x7cc4('0x6d')]=function(_0x4b9795,_0x78e2a,_0x1f7816,_0x21a3fa,_0x32fef5,_0x2124ed,_0x423379){var _0x114d8f,_0x30e7e3,_0x40b1ec,_0x266ffa;_0x2124ed[_0x7cc4('0x55')]=intUtil[_0x7cc4('0x54')](_0x2124ed[_0x7cc4('0x55')]);_0x2124ed['serverUrl']=intUtil[_0x7cc4('0x54')](_0x2124ed[_0x7cc4('0x56')]);def[_0x7cc4('0x57')]=util[_0x7cc4('0x25')](_0x7cc4('0x58'),_0x2124ed[_0x7cc4('0x55')]);if(_0x423379&&_0x423379[_0x7cc4('0x6e')]&&_0x423379[_0x7cc4('0x6e')]!==_0x7cc4('0x6f')){logger[_0x7cc4('0xe')](_0x7cc4('0x70'),_0x7cc4('0x5a'));_0x78e2a['recordingURL']=util[_0x7cc4('0x25')](_0x7cc4('0x5c'),_0x2124ed[_0x7cc4('0x56')],_0x78e2a[_0x7cc4('0x5d')],md5(_0x78e2a[_0x7cc4('0x5d')]));}return getConnection(_0x2124ed)[_0x7cc4('0x2f')](function(_0x157cea){_0x266ffa=_0x157cea;return getUser(_0x2124ed,_0x21a3fa[_0x7cc4('0x10')],_0x266ffa);})[_0x7cc4('0x2f')](function(_0x4c46c0){_0x114d8f=_0x4c46c0;logger[_0x7cc4('0xe')](_0x7cc4('0x5e'),_0x114d8f['id']);return getEndUser(_0x2124ed,_0x78e2a['destcalleridname'],_0x78e2a['destcalleridnum'],_0x266ffa);})['then'](function(_0x5e8fa5){_0x30e7e3=_0x5e8fa5;logger['info'](_0x7cc4('0x60'),_0x30e7e3['id']);return getTicket(_0x2124ed,_0x114d8f,_0x30e7e3,_0x1f7816,_0x78e2a,_0x1f7816[_0x7cc4('0x61')],_0x266ffa,_0x7cc4('0x71'));})[_0x7cc4('0x2f')](function(_0xfcb65){_0x40b1ec=_0xfcb65;logger[_0x7cc4('0xe')](_0x7cc4('0x72'));logger[_0x7cc4('0xe')](_0x7cc4('0x73'),_0x40b1ec['id']);return setRelationship(_0x266ffa,_0x114d8f,_0x40b1ec,_0x7cc4('0x62'));})[_0x7cc4('0x2f')](function(){return setRelationship(_0x266ffa,_0x30e7e3,_0x40b1ec,_0x7cc4('0x63'));})[_0x7cc4('0x2f')](function(){return getServerInfo(_0x266ffa);})[_0x7cc4('0x2f')](function(_0x330fde){var _0x76ca58=parseInt(_0x330fde[_0x7cc4('0x64')]['charAt'](0x0));var _0x5c45b3=util[_0x7cc4('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2124ed[_0x7cc4('0x55')],_0x40b1ec['id']);if(_0x76ca58>0x6){_0x5c45b3=util['format'](_0x7cc4('0x67'),_0x2124ed[_0x7cc4('0x55')],_0x40b1ec['id']);}logger[_0x7cc4('0xe')](_0x7cc4('0x70'),_0x7cc4('0x69'));emit(util[_0x7cc4('0x25')](_0x7cc4('0x6a'),_0x21a3fa['name']),'trigger:browser:url',{'uri':_0x5c45b3});})['catch'](function(_0x3a9042){logger[_0x7cc4('0x74')](_0x7cc4('0x70'),JSON['stringify'](_0x3a9042));});};exports[_0x7cc4('0x75')]=function(_0x365e1c,_0x56459a,_0xd8ea2c,_0x52fb7e,_0x5a460c,_0x166dba){var _0x59c2c2,_0x2e8398,_0xe6dda3,_0x47d56c;_0x166dba['remoteUri']=intUtil[_0x7cc4('0x54')](_0x166dba['remoteUri']);_0x166dba[_0x7cc4('0x56')]=intUtil[_0x7cc4('0x54')](_0x166dba['serverUrl']);def[_0x7cc4('0x57')]=util[_0x7cc4('0x25')](_0x7cc4('0x58'),_0x166dba[_0x7cc4('0x55')]);if(_0x5a460c&&_0x5a460c[_0x7cc4('0x59')]){logger[_0x7cc4('0xe')]('['+_0x56459a['lastevent'][_0x7cc4('0x76')]()+']',_0x7cc4('0x5a'));_0x56459a['recordingURL']=util[_0x7cc4('0x25')](_0x7cc4('0x5c'),_0x166dba[_0x7cc4('0x56')],_0x56459a[_0x7cc4('0x5d')],md5(_0x56459a['uniqueid']));}else{_0x56459a['recordingURL']='';}return getConnection(_0x166dba)[_0x7cc4('0x2f')](function(_0x5f5627){_0x47d56c=_0x5f5627;if(!_[_0x7cc4('0x2b')](_0x52fb7e)){return getUser(_0x166dba,_0x52fb7e[_0x7cc4('0x10')],_0x47d56c);}else{return getUser(_0x166dba,null,_0x47d56c);}})['then'](function(_0x1d7f11){_0x59c2c2=_0x1d7f11;logger[_0x7cc4('0xe')](_0x7cc4('0x5e'),_0x59c2c2['id']);return getEndUser(_0x166dba,_0x56459a['calleridname'],_0x56459a[_0x7cc4('0x5f')],_0x47d56c);})[_0x7cc4('0x2f')](function(_0x6e10c8){_0x2e8398=_0x6e10c8;logger[_0x7cc4('0xe')](_0x7cc4('0x60'),_0x2e8398['id']);return getTicket(_0x166dba,_0x59c2c2,_0x2e8398,_0xd8ea2c,_0x56459a,_0xd8ea2c['Fields'],_0x47d56c,_0x7cc4('0x77'));})['then'](function(_0x53b261){_0xe6dda3=_0x53b261;logger[_0x7cc4('0xe')]('Ticket\x20created!');logger[_0x7cc4('0xe')](_0x7cc4('0x73'),_0xe6dda3['id']);return setRelationship(_0x47d56c,_0x59c2c2,_0xe6dda3,_0x7cc4('0x62'));})[_0x7cc4('0x2f')](function(){return setRelationship(_0x47d56c,_0x2e8398,_0xe6dda3,_0x7cc4('0x63'));})['then'](function(){return getServerInfo(_0x47d56c);})[_0x7cc4('0x6c')](function(_0x45cb4c){logger[_0x7cc4('0x74')]('['+_0x56459a[_0x7cc4('0x78')][_0x7cc4('0x76')]()+']',JSON[_0x7cc4('0x23')](_0x45cb4c));});}; \ 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 2bcabd1..168e1c8 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 _0xb0ad=['string','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','content','variable','variableName','push','toString','Variable','name','toLowerCase','keyValue'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0xb0ad,0x15d));var _0xdb0a=function(_0xa76976,_0x4b925a){_0xa76976=_0xa76976-0x0;var _0x13e5c0=_0xb0ad[_0xa76976];return _0x13e5c0;};'use strict';var _=require(_0xdb0a('0x0'));var util=require(_0xdb0a('0x1'));exports[_0xdb0a('0x2')]=function(_0x41e474,_0x7b7eb2,_0x2b4acd){var _0x158166=[];if(_0x41e474[_0xdb0a('0x3')]>0x0){var _0x2066a1=_[_0xdb0a('0x4')](_0x41e474,['id']);for(var _0x451ca7=0x0;_0x451ca7<_0x2066a1[_0xdb0a('0x3')];_0x451ca7++){var _0x54a92b=_0x2066a1[_0x451ca7];if(_0x54a92b[_0xdb0a('0x5')]==='string'){_0x158166['push'](_0x54a92b[_0xdb0a('0x6')]);}else if(_0x54a92b['type']===_0xdb0a('0x7')&&_0x54a92b[_0xdb0a('0x8')]){_0x7b7eb2[_0x54a92b[_0xdb0a('0x8')]]&&_0x158166[_0xdb0a('0x9')](_0x7b7eb2[_0x54a92b[_0xdb0a('0x8')]][_0xdb0a('0xa')]());}else if(_0x54a92b[_0xdb0a('0x5')]==='customVariable'&&_0x54a92b[_0xdb0a('0xb')]&&_0x54a92b[_0xdb0a('0xb')][_0xdb0a('0xc')]){_0x7b7eb2[_0x54a92b[_0xdb0a('0xb')][_0xdb0a('0xc')][_0xdb0a('0xd')]()]&&_0x158166[_0xdb0a('0x9')](_0x7b7eb2[_0x54a92b[_0xdb0a('0xb')][_0xdb0a('0xc')][_0xdb0a('0xd')]()][_0xdb0a('0xa')]());}else if(_0x54a92b[_0xdb0a('0x5')]===_0xdb0a('0xe')){if(_0x54a92b['keyType']===_0xdb0a('0xf')&&_0x54a92b[_0xdb0a('0x10')]){_0x158166['push'](util[_0xdb0a('0x11')](_0xdb0a('0x12'),_0x54a92b[_0xdb0a('0x10')],_0x54a92b[_0xdb0a('0x13')]));}else if(_0x54a92b[_0xdb0a('0x14')]===_0xdb0a('0x7')&&_0x54a92b[_0xdb0a('0x8')]&&_0x54a92b[_0xdb0a('0x10')]){_0x7b7eb2[_0x54a92b['variableName']]&&_0x158166[_0xdb0a('0x9')](util['format'](_0xdb0a('0x12'),_0x54a92b['key'],_0x7b7eb2[_0x54a92b[_0xdb0a('0x8')]]));}else if(_0x54a92b[_0xdb0a('0x14')]==='customVariable'&&_0x54a92b[_0xdb0a('0xb')]&&_0x54a92b[_0xdb0a('0xb')]['name']&&_0x54a92b[_0xdb0a('0x10')]){_0x7b7eb2[_0x54a92b[_0xdb0a('0xb')][_0xdb0a('0xc')][_0xdb0a('0xd')]()]&&_0x158166[_0xdb0a('0x9')](util[_0xdb0a('0x11')]('%s:\x20%s',_0x54a92b['key'],_0x7b7eb2[_0x54a92b['Variable']['name'][_0xdb0a('0xd')]()]));}}}}return _0x158166[_0xdb0a('0x15')](_0x2b4acd);};exports[_0xdb0a('0x16')]=function(_0x3b3ac4){var _0x5d76a8=_0x3b3ac4[_0xdb0a('0x17')](-0x1);if(_0x5d76a8==='/'){_0x3b3ac4=_0x3b3ac4[_0xdb0a('0x18')](0x0,_0x3b3ac4['lastIndexOf'](_0x5d76a8));}return _0x3b3ac4;};exports[_0xdb0a('0x19')]=function(_0x1af706){if(!_[_0xdb0a('0x1a')](_0x1af706)&&_0x1af706!==''){var _0x5bfb73=/^(([^<>()\[\]\\.,;:\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 _0x5bfb73[_0xdb0a('0x1b')](String(_0x1af706)[_0xdb0a('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xd1a0=['variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyType','join','slice','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1a0,0x1ca));var _0x0d1a=function(_0x5157c7,_0x1da6d6){_0x5157c7=_0x5157c7-0x0;var _0xb18ce=_0xd1a0[_0x5157c7];return _0xb18ce;};'use strict';var _=require(_0x0d1a('0x0'));var util=require(_0x0d1a('0x1'));exports[_0x0d1a('0x2')]=function(_0x3e6b53,_0x39e9d9,_0x529897){var _0x46889e=[];if(_0x3e6b53[_0x0d1a('0x3')]>0x0){var _0x30b90a=_[_0x0d1a('0x4')](_0x3e6b53,['id']);for(var _0x5c3b0b=0x0;_0x5c3b0b<_0x30b90a[_0x0d1a('0x3')];_0x5c3b0b++){var _0x5f18a2=_0x30b90a[_0x5c3b0b];if(_0x5f18a2[_0x0d1a('0x5')]===_0x0d1a('0x6')){_0x46889e[_0x0d1a('0x7')](_0x5f18a2[_0x0d1a('0x8')]);}else if(_0x5f18a2[_0x0d1a('0x5')]===_0x0d1a('0x9')&&_0x5f18a2[_0x0d1a('0xa')]){_0x39e9d9[_0x5f18a2[_0x0d1a('0xa')]]&&_0x46889e[_0x0d1a('0x7')](_0x39e9d9[_0x5f18a2[_0x0d1a('0xa')]][_0x0d1a('0xb')]());}else if(_0x5f18a2['type']===_0x0d1a('0xc')&&_0x5f18a2[_0x0d1a('0xd')]&&_0x5f18a2['Variable'][_0x0d1a('0xe')]){_0x39e9d9[_0x5f18a2[_0x0d1a('0xd')][_0x0d1a('0xe')][_0x0d1a('0xf')]()]&&_0x46889e[_0x0d1a('0x7')](_0x39e9d9[_0x5f18a2[_0x0d1a('0xd')][_0x0d1a('0xe')]['toLowerCase']()][_0x0d1a('0xb')]());}else if(_0x5f18a2[_0x0d1a('0x5')]===_0x0d1a('0x10')){if(_0x5f18a2['keyType']===_0x0d1a('0x6')&&_0x5f18a2[_0x0d1a('0x11')]){_0x46889e[_0x0d1a('0x7')](util[_0x0d1a('0x12')](_0x0d1a('0x13'),_0x5f18a2[_0x0d1a('0x11')],_0x5f18a2['keyContent']));}else if(_0x5f18a2[_0x0d1a('0x14')]===_0x0d1a('0x9')&&_0x5f18a2[_0x0d1a('0xa')]&&_0x5f18a2['key']){_0x39e9d9[_0x5f18a2[_0x0d1a('0xa')]]&&_0x46889e['push'](util['format'](_0x0d1a('0x13'),_0x5f18a2[_0x0d1a('0x11')],_0x39e9d9[_0x5f18a2['variableName']]));}else if(_0x5f18a2['keyType']===_0x0d1a('0xc')&&_0x5f18a2['Variable']&&_0x5f18a2['Variable'][_0x0d1a('0xe')]&&_0x5f18a2[_0x0d1a('0x11')]){_0x39e9d9[_0x5f18a2[_0x0d1a('0xd')][_0x0d1a('0xe')]['toLowerCase']()]&&_0x46889e[_0x0d1a('0x7')](util[_0x0d1a('0x12')](_0x0d1a('0x13'),_0x5f18a2[_0x0d1a('0x11')],_0x39e9d9[_0x5f18a2[_0x0d1a('0xd')][_0x0d1a('0xe')]['toLowerCase']()]));}}}}return _0x46889e[_0x0d1a('0x15')](_0x529897);};exports['stripTrailingSlash']=function(_0x4de408){var _0x373bf3=_0x4de408[_0x0d1a('0x16')](-0x1);if(_0x373bf3==='/'){_0x4de408=_0x4de408['substring'](0x0,_0x4de408[_0x0d1a('0x17')](_0x373bf3));}return _0x4de408;};exports[_0x0d1a('0x18')]=function(_0x1a6149){if(!_[_0x0d1a('0x19')](_0x1a6149)&&_0x1a6149!==''){var _0x7a3f94=/^(([^<>()\[\]\\.,;:\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 _0x7a3f94['test'](String(_0x1a6149)['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 bf68406..4cc4b9f 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +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(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 052895b..164eae3 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 _0x7ab7=['monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[OUTBOUND]','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','user','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','picklist','type','nameField','customField','content','push','variable','idField','variableName','Variable','custom_fields','toLowerCase','queue','serverUrl','stripTrailingSlash'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7ab7,0x103));var _0x77ab=function(_0x4d2aa2,_0x50ecbf){_0x4d2aa2=_0x4d2aa2-0x0;var _0x23ebac=_0x7ab7[_0x4d2aa2];return _0x23ebac;};'use strict';var _=require(_0x77ab('0x0'));var rp=require(_0x77ab('0x1'));var md5=require('md5');var util=require(_0x77ab('0x2'));var Redis=require(_0x77ab('0x3'));var intUtil=require(_0x77ab('0x4'));var config=require(_0x77ab('0x5'));var logger=require(_0x77ab('0x6'))(_0x77ab('0x7'));config[_0x77ab('0x8')]=_[_0x77ab('0x9')](config[_0x77ab('0x8')],{'host':_0x77ab('0xa'),'port':0x18eb});var io=require(_0x77ab('0xb'))(new Redis(config[_0x77ab('0x8')]));function emit(_0xcc323d,_0x4c7dbd,_0x267bd8){io['to'](_0xcc323d)['emit'](_0x4c7dbd,_0x267bd8);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x23a487,_0x101458,_0x2b256b,_0x444ead,_0x1eab15){logger[_0x77ab('0xc')](_0x77ab('0xd'));return request({'uri':util[_0x77ab('0xe')](_0x77ab('0xf'),_0x23a487['remoteUri']),'method':_0x77ab('0x10'),'body':{'ticket':_[_0x77ab('0x11')]({'requester_id':_0x2b256b['id'],'submitter_id':_0x101458?_0x101458['id']:undefined,'assignee_id':_0x101458?_0x101458['id']:undefined,'tags':getTags(_0x444ead[_0x77ab('0x12')],_0x77ab('0x13')),'subject':intUtil[_0x77ab('0x14')](_0x444ead['Subjects'],_0x1eab15,'\x20'),'description':intUtil[_0x77ab('0x14')](_0x444ead['Descriptions'],_0x1eab15,'\x0a'),'comment':{'public':![],'body':intUtil[_0x77ab('0x14')](_0x444ead['Descriptions'],_0x1eab15,'\x0a')}},getCustomFields(_0x444ead[_0x77ab('0x15')],_0x1eab15))}})['then'](function(_0x14ec10){logger[_0x77ab('0xc')](_0x77ab('0x16'));return _0x14ec10[_0x77ab('0x17')];});}function getUser(_0x29c735,_0x48c086){if(intUtil['validateEmail'](_0x48c086)){logger[_0x77ab('0xc')](_0x77ab('0x18'),_0x48c086);return request({'uri':util[_0x77ab('0xe')](_0x77ab('0x19'),_0x29c735['remoteUri']),'qs':{'query':util['format'](_0x77ab('0x1a'),_0x48c086)}})['then'](function(_0x186665){if(_0x186665[_0x77ab('0x1b')]){logger[_0x77ab('0xc')](_0x77ab('0x1c'));return _[_0x77ab('0x1d')](_0x186665[_0x77ab('0x1e')],{'email':_0x48c086,'role':_0x77ab('0x1f')});}else{logger['info'](_0x77ab('0x20'));return request({'uri':util[_0x77ab('0xe')]('%s/users/me.json',_0x29c735['remoteUri'])})[_0x77ab('0x21')](function(_0x2317db){logger[_0x77ab('0xc')]('Admin\x20account\x20selected.');return _0x2317db[_0x77ab('0x22')];});}});}else{logger[_0x77ab('0xc')](_0x77ab('0x20'));return request({'uri':util[_0x77ab('0xe')](_0x77ab('0x23'),_0x29c735[_0x77ab('0x24')])})[_0x77ab('0x21')](function(_0x2b8169){logger[_0x77ab('0xc')](_0x77ab('0x25'));return _0x2b8169[_0x77ab('0x22')];});}}function getEndUser(_0xad609d,_0x196f83,_0x47800d){logger[_0x77ab('0xc')]('Searching\x20enduser\x20with\x20phone',_0x47800d);return request({'uri':util[_0x77ab('0xe')]('%s/search.json',_0xad609d['remoteUri']),'qs':{'query':util[_0x77ab('0xe')](_0x77ab('0x26'),_0x47800d)}})[_0x77ab('0x21')](function(_0x4feec2){var _0x358cd7;if(_0x4feec2[_0x77ab('0x1e')][_0x77ab('0x27')]){_0x4feec2[_0x77ab('0x1e')]=_[_0x77ab('0x28')](_0x4feec2[_0x77ab('0x1e')],{'suspended':![],'role':_0x77ab('0x29')});if(_0x4feec2['results']['length']){_0x358cd7=_[_0x77ab('0x2a')](_0x4feec2[_0x77ab('0x1e')]);}}if(_0x358cd7){logger[_0x77ab('0xc')](_0x77ab('0x2b'));return _0x358cd7;}else{logger[_0x77ab('0xc')](_0x77ab('0x2c'));return request({'uri':util[_0x77ab('0xe')](_0x77ab('0x2d'),_0xad609d[_0x77ab('0x24')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x77ab('0xe')](_0x77ab('0x2e'),_0x196f83||_0x47800d),'phone':_0x47800d}}})[_0x77ab('0x21')](function(_0xf37f88){logger[_0x77ab('0xc')](_0x77ab('0x2f'));return _0xf37f88[_0x77ab('0x22')];});}});}function getAuth(_0x4d7cb0){var _0x3d6a93;if(_0x4d7cb0[_0x77ab('0x30')]===_0x77ab('0x31')){_0x3d6a93=util[_0x77ab('0xe')](_0x77ab('0x32'),_0x4d7cb0[_0x77ab('0x33')],_0x4d7cb0[_0x77ab('0x31')]);}else if(_0x4d7cb0[_0x77ab('0x30')]===_0x77ab('0x34')){_0x3d6a93=util['format'](_0x77ab('0x35'),_0x4d7cb0['username'],_0x4d7cb0[_0x77ab('0x34')]);}return util[_0x77ab('0xe')]('Basic\x20%s',new Buffer(_0x3d6a93)[_0x77ab('0x36')](_0x77ab('0x37')));}function request(_0xc61675){logger[_0x77ab('0x38')](_0x77ab('0x39'),JSON[_0x77ab('0x3a')](_0xc61675));return rp(_['defaults'](_0xc61675,{'method':_0x77ab('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x233882,_0x4181f0){var _0x9dff1d=[];if(_0x233882&&_0x233882[_0x77ab('0x27')]>0x0){_0x9dff1d=_[_0x77ab('0x3c')](_0x233882,_0x4181f0);}return _0x9dff1d;}function getCustomFields(_0x4c4b7f,_0x526fba){var _0x1e2b42=[];var _0xd072f6={'custom_fields':[]};if(_0x4c4b7f['length']>0x0){_[_0x77ab('0x3d')](_0x4c4b7f,function(_0x48f696){if(_['includes'](['string',_0x77ab('0x3e')],_0x48f696[_0x77ab('0x3f')])&&_0x48f696[_0x77ab('0x40')]&&!_0x48f696[_0x77ab('0x41')]){_0xd072f6[_0x48f696[_0x77ab('0x40')]['toLowerCase']()]=_0x48f696[_0x77ab('0x42')][_0x77ab('0x36')]();}else if(_['includes'](['string',_0x77ab('0x3e')],_0x48f696[_0x77ab('0x3f')])&&_0x48f696['idField']&&_0x48f696['customField']){_0xd072f6['custom_fields'][_0x77ab('0x43')]({'id':_0x48f696['idField'],'value':_0x48f696['content']['toString']()});}else if(_0x48f696[_0x77ab('0x3f')]===_0x77ab('0x44')&&_0x48f696['variableName']&&_0x48f696[_0x77ab('0x45')]&&_0x48f696[_0x77ab('0x41')]){_0x526fba[_0x48f696[_0x77ab('0x46')]]&&_0xd072f6['custom_fields']['push']({'id':_0x48f696[_0x77ab('0x45')],'value':_0x526fba[_0x48f696[_0x77ab('0x46')]][_0x77ab('0x36')]()});}else if(_0x48f696[_0x77ab('0x3f')]==='customVariable'&&_0x48f696[_0x77ab('0x47')]&&_0x48f696[_0x77ab('0x47')][_0x77ab('0x13')]&&_0x48f696['idField']&&_0x48f696[_0x77ab('0x41')]){_0x526fba[_0x48f696[_0x77ab('0x47')]['name']['toLowerCase']()]&&_0xd072f6[_0x77ab('0x48')][_0x77ab('0x43')]({'id':_0x48f696[_0x77ab('0x45')],'value':_0x526fba[_0x48f696['Variable'][_0x77ab('0x13')][_0x77ab('0x49')]()][_0x77ab('0x36')]()});}});}return _0xd072f6;}exports[_0x77ab('0x4a')]=function(_0x167592,_0x2eca93,_0xa1b8b4,_0x4c1876,_0x31fabe,_0x3a5331){var _0x325a56,_0xaef8ba;_0x3a5331[_0x77ab('0x24')]=intUtil['stripTrailingSlash'](_0x3a5331[_0x77ab('0x24')]);_0x3a5331[_0x77ab('0x4b')]=intUtil[_0x77ab('0x4c')](_0x3a5331[_0x77ab('0x4b')]);if(_0x31fabe&&_0x31fabe[_0x77ab('0x4d')]){logger['info'](_0x77ab('0x4e'),'Recording\x20is\x20enabled!');_0x2eca93[_0x77ab('0x4f')]=util[_0x77ab('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a5331['serverUrl'],_0x2eca93[_0x77ab('0x50')],md5(_0x2eca93[_0x77ab('0x50')]));}else{_0x2eca93[_0x77ab('0x4f')]='';}headers[_0x77ab('0x51')]=getAuth(_0x3a5331);return getUser(_0x3a5331,_0x4c1876[_0x77ab('0x52')])['then'](function(_0x534677){_0x325a56=_0x534677;logger['info'](_0x77ab('0x53'),_0x325a56['id']);return getEndUser(_0x3a5331,_0x2eca93[_0x77ab('0x54')],_0x2eca93[_0x77ab('0x55')]);})['then'](function(_0xc96d5c){_0xaef8ba=_0xc96d5c;logger[_0x77ab('0xc')]('The\x20Enduser\x20ID\x20is:',_0xaef8ba['id']);return getTicket(_0x3a5331,_0x325a56,_0xaef8ba,_0xa1b8b4,_0x2eca93);})[_0x77ab('0x21')](function(_0x4f3b1d){if(_0x4f3b1d){logger[_0x77ab('0xc')](_0x77ab('0x56'),_0x4f3b1d['id']);switch(_0x3a5331[_0x77ab('0x3f')]){case'integrationTab':logger['info'](_0x77ab('0x4e'),_0x77ab('0x57'));return request({'uri':util['format'](_0x77ab('0x58'),_0x3a5331[_0x77ab('0x24')],_0x325a56['id'],_0x4f3b1d['id']),'method':'POST'});case _0x77ab('0x59'):logger[_0x77ab('0xc')](_0x77ab('0x4e'),_0x77ab('0x5a'));emit(util[_0x77ab('0xe')]('user:%s',_0x4c1876[_0x77ab('0x13')]),'trigger:browser:url',{'uri':util[_0x77ab('0xe')](_0x77ab('0x5b'),_0x3a5331[_0x77ab('0x24')][_0x77ab('0x5c')](_0x77ab('0x5d'),''),_0x4f3b1d['id'])});break;default:logger['error'](_0x77ab('0x4e'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0xc8cce6){logger['error'](_0x77ab('0x5e'),util['inspect'](_0xc8cce6,{'showHidden':!![],'depth':null}));});};exports[_0x77ab('0x5f')]=function(_0x5bdab2,_0x27a72c,_0x2cb0f9,_0x4af084,_0x17aed5,_0x1714ce,_0x478f57){var _0x3498d3,_0x3c4544;_0x1714ce[_0x77ab('0x24')]=intUtil[_0x77ab('0x4c')](_0x1714ce['remoteUri']);_0x1714ce['serverUrl']=intUtil[_0x77ab('0x4c')](_0x1714ce[_0x77ab('0x4b')]);if(_0x478f57&&_0x478f57[_0x77ab('0x60')]&&_0x478f57[_0x77ab('0x60')]!=='none'){logger[_0x77ab('0xc')]('[OUTBOUND]',_0x77ab('0x61'));_0x27a72c['recordingURL']=util['format'](_0x77ab('0x62'),_0x1714ce[_0x77ab('0x4b')],_0x27a72c[_0x77ab('0x50')],md5(_0x27a72c[_0x77ab('0x50')]));}headers[_0x77ab('0x51')]=getAuth(_0x1714ce);return getUser(_0x1714ce,_0x4af084['email'])[_0x77ab('0x21')](function(_0x411cce){_0x3498d3=_0x411cce;logger[_0x77ab('0xc')](_0x77ab('0x53'),_0x3498d3['id']);return getEndUser(_0x1714ce,_0x27a72c[_0x77ab('0x63')],_0x27a72c[_0x77ab('0x64')]);})[_0x77ab('0x21')](function(_0xc7f199){_0x3c4544=_0xc7f199;logger[_0x77ab('0xc')](_0x77ab('0x65'),_0x3c4544['id']);return getTicket(_0x1714ce,_0x3498d3,_0x3c4544,_0x2cb0f9,_0x27a72c);})['then'](function(_0x2f161d){if(_0x2f161d){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2f161d['id']);switch(_0x1714ce[_0x77ab('0x3f')]){case _0x77ab('0x66'):logger[_0x77ab('0xc')](_0x77ab('0x67'),_0x77ab('0x57'));return request({'uri':util[_0x77ab('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1714ce['remoteUri'],_0x3498d3['id'],_0x2f161d['id']),'method':'POST'});case _0x77ab('0x59'):logger[_0x77ab('0xc')](_0x77ab('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x77ab('0xe')]('user:%s',_0x4af084['name']),_0x77ab('0x68'),{'uri':util['format']('%s/agent/tickets/%s',_0x1714ce[_0x77ab('0x24')][_0x77ab('0x5c')](_0x77ab('0x5d'),''),_0x2f161d['id'])});break;default:logger[_0x77ab('0x69')](_0x77ab('0x67'),_0x77ab('0x6a'));}}})[_0x77ab('0x6b')](function(_0x3ae6fb){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x77ab('0x6c')](_0x3ae6fb,{'showHidden':!![],'depth':null}));});};exports[_0x77ab('0x6d')]=function(_0x1e7651,_0x362b69,_0x1da3f6,_0x1e8f08,_0x5ca142,_0x2503f){var _0x3a0254,_0x7d93c3;_0x2503f[_0x77ab('0x24')]=intUtil[_0x77ab('0x4c')](_0x2503f['remoteUri']);_0x2503f[_0x77ab('0x4b')]=intUtil[_0x77ab('0x4c')](_0x2503f[_0x77ab('0x4b')]);if(_0x5ca142&&_0x5ca142[_0x77ab('0x4d')]){logger[_0x77ab('0xc')]('['+_0x362b69[_0x77ab('0x6e')][_0x77ab('0x6f')]()+']',_0x77ab('0x61'));_0x362b69[_0x77ab('0x4f')]=util['format'](_0x77ab('0x62'),_0x2503f[_0x77ab('0x4b')],_0x362b69['uniqueid'],md5(_0x362b69['uniqueid']));}else{_0x362b69['recordingURL']='';}headers[_0x77ab('0x51')]=getAuth(_0x2503f);return getUser(_0x2503f)[_0x77ab('0x21')](function(_0x3fc1c0){_0x3a0254=_0x3fc1c0;logger['info'](_0x77ab('0x53'),_0x3a0254['id']);return getEndUser(_0x2503f,_0x362b69[_0x77ab('0x54')],_0x362b69[_0x77ab('0x55')]);})[_0x77ab('0x21')](function(_0x24aac7){_0x7d93c3=_0x24aac7;logger[_0x77ab('0xc')](_0x77ab('0x65'),_0x7d93c3['id']);return getTicket(_0x2503f,_0x3a0254,_0x7d93c3,_0x1da3f6,_0x362b69);})['then'](function(_0x498e38){if(_0x498e38){logger[_0x77ab('0xc')]('The\x20Ticket\x20ID\x20is:',_0x498e38['id']);}})[_0x77ab('0x6b')](function(_0xeb79a5){logger[_0x77ab('0x69')]('['+_0x362b69[_0x77ab('0x6e')][_0x77ab('0x6f')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x77ab('0x6c')](_0xeb79a5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe48c=['Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','catch','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','string','type','nameField','customField','toLowerCase','picklist','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[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','replace','/api/v2'];(function(_0x2a41fb,_0x3a4815){var _0x3cea8c=function(_0x176621){while(--_0x176621){_0x2a41fb['push'](_0x2a41fb['shift']());}};_0x3cea8c(++_0x3a4815);}(_0xe48c,0x1da));var _0xce48=function(_0xd0468a,_0x56cce3){_0xd0468a=_0xd0468a-0x0;var _0x2f4e47=_0xe48c[_0xd0468a];return _0x2f4e47;};'use strict';var _=require(_0xce48('0x0'));var rp=require(_0xce48('0x1'));var md5=require('md5');var util=require(_0xce48('0x2'));var Redis=require(_0xce48('0x3'));var intUtil=require(_0xce48('0x4'));var config=require(_0xce48('0x5'));var logger=require('../../../../config/logger')(_0xce48('0x6'));config[_0xce48('0x7')]=_[_0xce48('0x8')](config[_0xce48('0x7')],{'host':_0xce48('0x9'),'port':0x18eb});var io=require(_0xce48('0xa'))(new Redis(config[_0xce48('0x7')]));function emit(_0x59bea8,_0x54cb4e,_0x15d915){io['to'](_0x59bea8)['emit'](_0x54cb4e,_0x15d915);}var headers={'Content-Type':'application/json','Accept':_0xce48('0xb')};function getTicket(_0xb7bf05,_0x463024,_0x5b778e,_0x5218ee,_0x342347){logger[_0xce48('0xc')](_0xce48('0xd'));return request({'uri':util[_0xce48('0xe')](_0xce48('0xf'),_0xb7bf05[_0xce48('0x10')]),'method':_0xce48('0x11'),'body':{'ticket':_[_0xce48('0x12')]({'requester_id':_0x5b778e['id'],'submitter_id':_0x463024?_0x463024['id']:undefined,'assignee_id':_0x463024?_0x463024['id']:undefined,'tags':getTags(_0x5218ee['Tags'],_0xce48('0x13')),'subject':intUtil[_0xce48('0x14')](_0x5218ee[_0xce48('0x15')],_0x342347,'\x20'),'description':intUtil['getString'](_0x5218ee[_0xce48('0x16')],_0x342347,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5218ee[_0xce48('0x16')],_0x342347,'\x0a')}},getCustomFields(_0x5218ee[_0xce48('0x17')],_0x342347))}})[_0xce48('0x18')](function(_0x3148e4){logger['info'](_0xce48('0x19'));return _0x3148e4[_0xce48('0x1a')];});}function getUser(_0x29a359,_0x5616de){if(intUtil[_0xce48('0x1b')](_0x5616de)){logger['info'](_0xce48('0x1c'),_0x5616de);return request({'uri':util[_0xce48('0xe')](_0xce48('0x1d'),_0x29a359[_0xce48('0x10')]),'qs':{'query':util[_0xce48('0xe')](_0xce48('0x1e'),_0x5616de)}})[_0xce48('0x18')](function(_0x4be540){if(_0x4be540['count']){logger[_0xce48('0xc')]('Agent\x20found!');return _[_0xce48('0x1f')](_0x4be540['results'],{'email':_0x5616de,'role':_0xce48('0x20')});}else{logger['info'](_0xce48('0x21'));return request({'uri':util['format'](_0xce48('0x22'),_0x29a359[_0xce48('0x10')])})[_0xce48('0x18')](function(_0x2445d8){logger[_0xce48('0xc')](_0xce48('0x23'));return _0x2445d8[_0xce48('0x24')];});}});}else{logger[_0xce48('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xce48('0xe')](_0xce48('0x22'),_0x29a359[_0xce48('0x10')])})[_0xce48('0x18')](function(_0x61b261){logger['info'](_0xce48('0x23'));return _0x61b261[_0xce48('0x24')];});}}function getEndUser(_0x297baf,_0x5d76fe,_0x2f38a8){logger[_0xce48('0xc')](_0xce48('0x25'),_0x2f38a8);return request({'uri':util[_0xce48('0xe')](_0xce48('0x1d'),_0x297baf[_0xce48('0x10')]),'qs':{'query':util[_0xce48('0xe')](_0xce48('0x26'),_0x2f38a8)}})[_0xce48('0x18')](function(_0x5a6e6d){var _0xc13ee7;if(_0x5a6e6d[_0xce48('0x27')]['length']){_0x5a6e6d[_0xce48('0x27')]=_[_0xce48('0x28')](_0x5a6e6d['results'],{'suspended':![],'role':'end-user'});if(_0x5a6e6d[_0xce48('0x27')][_0xce48('0x29')]){_0xc13ee7=_[_0xce48('0x2a')](_0x5a6e6d[_0xce48('0x27')]);}}if(_0xc13ee7){logger[_0xce48('0xc')]('Enduser\x20found!');return _0xc13ee7;}else{logger[_0xce48('0xc')](_0xce48('0x2b'));return request({'uri':util[_0xce48('0xe')](_0xce48('0x2c'),_0x297baf[_0xce48('0x10')]),'method':'POST','body':{'user':{'role':_0xce48('0x2d'),'name':util[_0xce48('0xe')](_0xce48('0x2e'),_0x5d76fe||_0x2f38a8),'phone':_0x2f38a8}}})[_0xce48('0x18')](function(_0x4839f3){logger[_0xce48('0xc')](_0xce48('0x2f'));return _0x4839f3[_0xce48('0x24')];});}});}function getAuth(_0x494d40){var _0x594768;if(_0x494d40[_0xce48('0x30')]===_0xce48('0x31')){_0x594768=util['format'](_0xce48('0x32'),_0x494d40[_0xce48('0x33')],_0x494d40[_0xce48('0x31')]);}else if(_0x494d40[_0xce48('0x30')]===_0xce48('0x34')){_0x594768=util['format'](_0xce48('0x35'),_0x494d40[_0xce48('0x33')],_0x494d40['token']);}return util[_0xce48('0xe')](_0xce48('0x36'),new Buffer(_0x594768)[_0xce48('0x37')](_0xce48('0x38')));}function request(_0x3be06f){logger[_0xce48('0x39')](_0xce48('0x3a'),JSON[_0xce48('0x3b')](_0x3be06f));return rp(_[_0xce48('0x8')](_0x3be06f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5b4eb2,_0xa2085){var _0x5858d6=[];if(_0x5b4eb2&&_0x5b4eb2[_0xce48('0x29')]>0x0){_0x5858d6=_[_0xce48('0x3c')](_0x5b4eb2,_0xa2085);}return _0x5858d6;}function getCustomFields(_0x428a80,_0x225fad){var _0x5ecc7b=[];var _0x245bbb={'custom_fields':[]};if(_0x428a80[_0xce48('0x29')]>0x0){_['forEach'](_0x428a80,function(_0x3c44c0){if(_[_0xce48('0x3d')]([_0xce48('0x3e'),'picklist'],_0x3c44c0[_0xce48('0x3f')])&&_0x3c44c0[_0xce48('0x40')]&&!_0x3c44c0[_0xce48('0x41')]){_0x245bbb[_0x3c44c0['nameField'][_0xce48('0x42')]()]=_0x3c44c0['content']['toString']();}else if(_[_0xce48('0x3d')](['string',_0xce48('0x43')],_0x3c44c0[_0xce48('0x3f')])&&_0x3c44c0[_0xce48('0x44')]&&_0x3c44c0[_0xce48('0x41')]){_0x245bbb[_0xce48('0x45')][_0xce48('0x46')]({'id':_0x3c44c0[_0xce48('0x44')],'value':_0x3c44c0['content'][_0xce48('0x37')]()});}else if(_0x3c44c0[_0xce48('0x3f')]===_0xce48('0x47')&&_0x3c44c0[_0xce48('0x48')]&&_0x3c44c0[_0xce48('0x44')]&&_0x3c44c0[_0xce48('0x41')]){_0x225fad[_0x3c44c0[_0xce48('0x48')]]&&_0x245bbb[_0xce48('0x45')][_0xce48('0x46')]({'id':_0x3c44c0[_0xce48('0x44')],'value':_0x225fad[_0x3c44c0[_0xce48('0x48')]]['toString']()});}else if(_0x3c44c0[_0xce48('0x3f')]==='customVariable'&&_0x3c44c0['Variable']&&_0x3c44c0[_0xce48('0x49')][_0xce48('0x13')]&&_0x3c44c0['idField']&&_0x3c44c0[_0xce48('0x41')]){_0x225fad[_0x3c44c0[_0xce48('0x49')][_0xce48('0x13')][_0xce48('0x42')]()]&&_0x245bbb[_0xce48('0x45')]['push']({'id':_0x3c44c0[_0xce48('0x44')],'value':_0x225fad[_0x3c44c0[_0xce48('0x49')][_0xce48('0x13')][_0xce48('0x42')]()][_0xce48('0x37')]()});}});}return _0x245bbb;}exports[_0xce48('0x4a')]=function(_0x56269f,_0x293e58,_0x136b88,_0xee8af6,_0x3b247b,_0x5bae25){var _0x55f1fa,_0x523cde;_0x5bae25[_0xce48('0x10')]=intUtil[_0xce48('0x4b')](_0x5bae25[_0xce48('0x10')]);_0x5bae25[_0xce48('0x4c')]=intUtil[_0xce48('0x4b')](_0x5bae25[_0xce48('0x4c')]);if(_0x3b247b&&_0x3b247b[_0xce48('0x4d')]){logger[_0xce48('0xc')](_0xce48('0x4e'),_0xce48('0x4f'));_0x293e58['recordingURL']=util[_0xce48('0xe')](_0xce48('0x50'),_0x5bae25[_0xce48('0x4c')],_0x293e58[_0xce48('0x51')],md5(_0x293e58[_0xce48('0x51')]));}else{_0x293e58[_0xce48('0x52')]='';}headers[_0xce48('0x53')]=getAuth(_0x5bae25);return getUser(_0x5bae25,_0xee8af6[_0xce48('0x54')])['then'](function(_0x2d71ce){_0x55f1fa=_0x2d71ce;logger[_0xce48('0xc')]('The\x20User\x20ID\x20is:',_0x55f1fa['id']);return getEndUser(_0x5bae25,_0x293e58[_0xce48('0x55')],_0x293e58[_0xce48('0x56')]);})['then'](function(_0x25c82d){_0x523cde=_0x25c82d;logger['info'](_0xce48('0x57'),_0x523cde['id']);return getTicket(_0x5bae25,_0x55f1fa,_0x523cde,_0x136b88,_0x293e58);})['then'](function(_0x3600e0){if(_0x3600e0){logger['info'](_0xce48('0x58'),_0x3600e0['id']);switch(_0x5bae25[_0xce48('0x3f')]){case _0xce48('0x59'):logger['info']('[QUEUE]',_0xce48('0x5a'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5bae25[_0xce48('0x10')],_0x55f1fa['id'],_0x3600e0['id']),'method':'POST'});case _0xce48('0x5b'):logger[_0xce48('0xc')](_0xce48('0x4e'),_0xce48('0x5c'));emit(util[_0xce48('0xe')]('user:%s',_0xee8af6[_0xce48('0x13')]),_0xce48('0x5d'),{'uri':util[_0xce48('0xe')]('%s/agent/tickets/%s',_0x5bae25['remoteUri'][_0xce48('0x5e')](_0xce48('0x5f'),''),_0x3600e0['id'])});break;default:logger['error'](_0xce48('0x4e'),_0xce48('0x60'));}}})['catch'](function(_0x1744a7){logger[_0xce48('0x61')](_0xce48('0x62'),util[_0xce48('0x63')](_0x1744a7,{'showHidden':!![],'depth':null}));});};exports[_0xce48('0x64')]=function(_0x2a15f8,_0x588f73,_0xf5be28,_0x77a152,_0x352de1,_0x55b13c,_0xbe19a4){var _0x3d2e15,_0x530c6c;_0x55b13c['remoteUri']=intUtil['stripTrailingSlash'](_0x55b13c[_0xce48('0x10')]);_0x55b13c[_0xce48('0x4c')]=intUtil[_0xce48('0x4b')](_0x55b13c[_0xce48('0x4c')]);if(_0xbe19a4&&_0xbe19a4[_0xce48('0x65')]&&_0xbe19a4[_0xce48('0x65')]!==_0xce48('0x66')){logger['info'](_0xce48('0x67'),_0xce48('0x4f'));_0x588f73['recordingURL']=util[_0xce48('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55b13c[_0xce48('0x4c')],_0x588f73['uniqueid'],md5(_0x588f73[_0xce48('0x51')]));}headers['Authorization']=getAuth(_0x55b13c);return getUser(_0x55b13c,_0x77a152[_0xce48('0x54')])[_0xce48('0x18')](function(_0x5e71b9){_0x3d2e15=_0x5e71b9;logger[_0xce48('0xc')](_0xce48('0x68'),_0x3d2e15['id']);return getEndUser(_0x55b13c,_0x588f73[_0xce48('0x69')],_0x588f73[_0xce48('0x6a')]);})[_0xce48('0x18')](function(_0x892581){_0x530c6c=_0x892581;logger[_0xce48('0xc')](_0xce48('0x57'),_0x530c6c['id']);return getTicket(_0x55b13c,_0x3d2e15,_0x530c6c,_0xf5be28,_0x588f73);})[_0xce48('0x18')](function(_0x49eac2){if(_0x49eac2){logger['info'](_0xce48('0x58'),_0x49eac2['id']);switch(_0x55b13c[_0xce48('0x3f')]){case _0xce48('0x59'):logger[_0xce48('0xc')](_0xce48('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xce48('0xe')](_0xce48('0x6b'),_0x55b13c[_0xce48('0x10')],_0x3d2e15['id'],_0x49eac2['id']),'method':_0xce48('0x11')});case'newTab':logger[_0xce48('0xc')](_0xce48('0x67'),_0xce48('0x5c'));emit(util[_0xce48('0xe')](_0xce48('0x6c'),_0x77a152['name']),_0xce48('0x5d'),{'uri':util[_0xce48('0xe')](_0xce48('0x6d'),_0x55b13c[_0xce48('0x10')][_0xce48('0x5e')](_0xce48('0x5f'),''),_0x49eac2['id'])});break;default:logger[_0xce48('0x61')](_0xce48('0x67'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2e04ff){logger['error'](_0xce48('0x6e'),util[_0xce48('0x63')](_0x2e04ff,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x5b01f1,_0x20ddde,_0x1d6e9a,_0x3a023f,_0x5ac6a2,_0x8aae95){var _0x59bbba,_0x3276d7;_0x8aae95[_0xce48('0x10')]=intUtil[_0xce48('0x4b')](_0x8aae95['remoteUri']);_0x8aae95[_0xce48('0x4c')]=intUtil['stripTrailingSlash'](_0x8aae95['serverUrl']);if(_0x5ac6a2&&_0x5ac6a2[_0xce48('0x4d')]){logger[_0xce48('0xc')]('['+_0x20ddde[_0xce48('0x6f')]['toUpperCase']()+']',_0xce48('0x4f'));_0x20ddde[_0xce48('0x52')]=util[_0xce48('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8aae95[_0xce48('0x4c')],_0x20ddde[_0xce48('0x51')],md5(_0x20ddde[_0xce48('0x51')]));}else{_0x20ddde[_0xce48('0x52')]='';}headers[_0xce48('0x53')]=getAuth(_0x8aae95);return getUser(_0x8aae95)[_0xce48('0x18')](function(_0x193eb4){_0x59bbba=_0x193eb4;logger['info'](_0xce48('0x68'),_0x59bbba['id']);return getEndUser(_0x8aae95,_0x20ddde[_0xce48('0x55')],_0x20ddde[_0xce48('0x56')]);})['then'](function(_0x4ffc19){_0x3276d7=_0x4ffc19;logger[_0xce48('0xc')](_0xce48('0x57'),_0x3276d7['id']);return getTicket(_0x8aae95,_0x59bbba,_0x3276d7,_0x1d6e9a,_0x20ddde);})['then'](function(_0x358942){if(_0x358942){logger[_0xce48('0xc')]('The\x20Ticket\x20ID\x20is:',_0x358942['id']);}})[_0xce48('0x70')](function(_0x3f1552){logger[_0xce48('0x61')]('['+_0x20ddde[_0xce48('0x6f')]['toUpperCase']()+']'+_0xce48('0x71'),util[_0xce48('0x63')](_0x3f1552,{'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 353b076..6ab1623 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 _0x0fbb=['moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','administrator','getString','Subjects','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','Leads','$se_module','talktime','utc','mm:ss','answertime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','merge','Fields','err','log','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','unmanaged','toUpperCase','Inbound','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','length','forEach','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','findIndex','email','Agent\x20found!','users','profile','Administrator','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','startCase'];(function(_0x7b140c,_0x3129c8){var _0x36c1a8=function(_0x13bf4a){while(--_0x13bf4a){_0x7b140c['push'](_0x7b140c['shift']());}};_0x36c1a8(++_0x3129c8);}(_0x0fbb,0x17e));var _0xb0fb=function(_0x223e03,_0x1e5f0a){_0x223e03=_0x223e03-0x0;var _0x23cd6e=_0x0fbb[_0x223e03];return _0x23cd6e;};'use strict';var _=require(_0xb0fb('0x0'));var rp=require(_0xb0fb('0x1'));var md5=require(_0xb0fb('0x2'));var util=require(_0xb0fb('0x3'));var intUtil=require(_0xb0fb('0x4'));var moment=require(_0xb0fb('0x5'));var Redis=require('ioredis');var BPromise=require(_0xb0fb('0x6'));var config=require('../../../../config/environment');var logger=require(_0xb0fb('0x7'))('zoho');config[_0xb0fb('0x8')]=_[_0xb0fb('0x9')](config['redis'],{'host':_0xb0fb('0xa'),'port':0x18eb});var io=require(_0xb0fb('0xb'))(new Redis(config[_0xb0fb('0x8')]));function emit(_0x213697,_0x16e4e8,_0x280d83){io['to'](_0x213697)[_0xb0fb('0xc')](_0x16e4e8,_0x280d83);}function request(_0xf10219){logger[_0xb0fb('0xd')]('[HTTP]',JSON['stringify'](_0xf10219));return rp(_0xf10219);}function getCustomFields(_0x3dc8af,_0x13fe9d){var _0x23a759={};if(_0x3dc8af[_0xb0fb('0xe')]>0x0){_[_0xb0fb('0xf')](_0x3dc8af,function(_0x39538f){if(_['includes']([_0xb0fb('0x10'),_0xb0fb('0x11')],_0x39538f[_0xb0fb('0x12')])&&_0x39538f['idField']){_0x23a759[_0x39538f[_0xb0fb('0x13')]]=_0x39538f[_0xb0fb('0x14')][_0xb0fb('0x15')]();}else if(_0x39538f[_0xb0fb('0x12')]==='variable'&&_0x39538f[_0xb0fb('0x16')]&&_0x39538f[_0xb0fb('0x13')]&&_0x13fe9d[_0x39538f[_0xb0fb('0x16')]]){_0x23a759[_0x39538f[_0xb0fb('0x13')]]=_0x13fe9d[_0x39538f[_0xb0fb('0x16')]][_0xb0fb('0x15')]();}else if(_0x39538f[_0xb0fb('0x12')]===_0xb0fb('0x17')&&_0x39538f['Variable']&&_0x39538f[_0xb0fb('0x18')]['name']&&_0x39538f[_0xb0fb('0x13')]&&_0x13fe9d[_0x39538f[_0xb0fb('0x18')][_0xb0fb('0x19')]['toLowerCase']()]){_0x23a759[_0x39538f[_0xb0fb('0x13')]]=_0x13fe9d[_0x39538f[_0xb0fb('0x18')][_0xb0fb('0x19')][_0xb0fb('0x1a')]()][_0xb0fb('0x15')]();}});}return _0x23a759;}function getName(_0x5bcde3){if(_0x5bcde3[_0xb0fb('0x1b')]('\x20')>0x0){var _0x27f1e1=_0x5bcde3[_0xb0fb('0x1c')](/ (.+)/);if(_0x27f1e1[0x1]){return _0x27f1e1;}}return[_0x5bcde3,_0x5bcde3];}var accountsTokens={};function getAccessToken(_0x1d246d){return new Promise(function(_0x1412f1,_0x1b3fa5){if(!_['isNil'](accountsTokens[_0x1d246d['id']])&&!_[_0xb0fb('0x1d')](accountsTokens[_0x1d246d['id']][_0xb0fb('0x1e')])){if(moment()[_0xb0fb('0x1f')](accountsTokens[_0x1d246d['id']][_0xb0fb('0x20')])){_0x1412f1(accountsTokens[_0x1d246d['id']]['access_token']);}}var _0x149f09;switch(_0x1d246d['zone']){case'US':_0x149f09=_0xb0fb('0x21');break;case'AU':_0x149f09=_0xb0fb('0x22');break;case'EU':_0x149f09=_0xb0fb('0x23');break;case'IN':_0x149f09=_0xb0fb('0x24');break;case'CN':_0x149f09='https://accounts.zoho.com.cn';break;default:_0x149f09='https://accounts.zoho.eu';break;}var _0xc84506={'method':_0xb0fb('0x25'),'uri':_0x149f09+'/oauth/v2/token','qs':{'refresh_token':_0x1d246d[_0xb0fb('0x26')],'client_id':_0x1d246d['clientId'],'client_secret':_0x1d246d['clientSecret'],'grant_type':_0xb0fb('0x27')},'json':!![]};return rp(_0xc84506)[_0xb0fb('0x28')](function(_0x593d8a){accountsTokens[_0x1d246d['id']]={'access_token':_0x593d8a[_0xb0fb('0x1e')],'expires_in':moment()[_0xb0fb('0x29')](_0x593d8a[_0xb0fb('0x20')],_0xb0fb('0x2a'))};_0x1412f1(_0x593d8a[_0xb0fb('0x1e')]);})[_0xb0fb('0x2b')](function(_0x24d203){logger[_0xb0fb('0x2c')](_0xb0fb('0x2d'),_0x24d203[_0xb0fb('0x2e')]);_0x1b3fa5(_0x24d203);});});}function getUser(_0x197b7f,_0x22dbc0,_0x3aa29d,_0x1163d2){logger[_0xb0fb('0x2f')](_0xb0fb('0x30'));return request({'method':_0xb0fb('0x31'),'uri':util[_0xb0fb('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x22dbc0),'qs':{'type':_0xb0fb('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x197b7f},'json':!![]})['then'](function(_0x33751c){if(_0x33751c['users']){var _0x3ef2ce=-0x1;if(_['isArrayLikeObject'](_0x33751c['users'])){if(!_['isNil'](_0x1163d2)){_0x3ef2ce=_[_0xb0fb('0x34')](_0x33751c['users'],function(_0x22e921){return _0x22e921[_0xb0fb('0x35')]===_0x1163d2;});}if(_0x3ef2ce>=0x0){logger['info'](_0xb0fb('0x36'));}else{logger[_0xb0fb('0x2f')]('Using\x20the\x20admin\x20account!');_0x3ef2ce=_[_0xb0fb('0x34')](_0x33751c[_0xb0fb('0x37')],function(_0x20c870){return _0x20c870[_0xb0fb('0x38')]['name']===_0xb0fb('0x39');});}return _0x33751c[_0xb0fb('0x37')][_0x3ef2ce];}else{if(_0x33751c['user'][_0xb0fb('0x38')]['name']===_0xb0fb('0x39')){logger[_0xb0fb('0x2f')](_0xb0fb('0x3a'));user=_0x33751c[_0xb0fb('0x3b')];return user;}else{logger[_0xb0fb('0x2c')](_0xb0fb('0x3c'),JSON['stringify'](_0x33751c));throw new Error(_0xb0fb('0x3d')+JSON['stringify'](_0x33751c));}}}else{logger[_0xb0fb('0x2c')](_0xb0fb('0x3c'),JSON[_0xb0fb('0x3e')](_0x33751c));throw new Error(_0xb0fb('0x3d')+JSON['stringify'](_0x33751c));}})[_0xb0fb('0x2b')](function(_0x5b4ec9){console['error'](_0x5b4ec9);});}function getZohoUser(_0xfe448,_0x44a14c){return new BPromise(function(_0x5d1d0c,_0x4b6f63){request(_0xfe448)['then'](function(_0x2f7aff){var _0x1ffc3d=null;if(_0x2f7aff){_0x1ffc3d=_0x2f7aff[_0xb0fb('0x3f')][0x0];_0x1ffc3d['enduserType']=_0x44a14c;}_0x5d1d0c(_0x1ffc3d);})[_0xb0fb('0x2b')](function(_0x3e701e){_0x4b6f63(_0x3e701e);});});}function createEndUser(_0x7d572e,_0x4fbeda,_0xb45bb4,_0x16c84e,_0x2bbc29,_0x40fc3d){var _0xb45bb4=getName(_0xb45bb4);return request({'method':_0xb0fb('0x25'),'uri':'https://www.zohoapis.'+_0x4fbeda+'/crm/v2/'+_[_0xb0fb('0x40')](_0x40fc3d[_0xb0fb('0x41')])+'s','body':{'data':[{'Last_Name':_0xb45bb4[0x1],'First_Name':_0xb45bb4[0x0],'Phone':_0x16c84e,'Owner':{'name':!_[_0xb0fb('0x1d')](_0x2bbc29[_0xb0fb('0x42')][_0xb0fb('0x19')])?_0x2bbc29['role'][_0xb0fb('0x19')]:!_[_0xb0fb('0x1d')](_0x2bbc29[_0xb0fb('0x43')])?_0x2bbc29[_0xb0fb('0x43')]+'\x20'+_0x2bbc29['last_name']:_0x2bbc29[_0xb0fb('0x44')],'id':_0x2bbc29['id']}}]},'headers':{'Authorization':_0xb0fb('0x45')+_0x7d572e},'json':!![]})[_0xb0fb('0x28')](function(_0xe81588){if(_0xe81588&&_0xe81588[_0xb0fb('0x3f')][0x0][_0xb0fb('0x46')]===_0xb0fb('0x47')){var _0x475379=_0xe81588['data'][0x0][_0xb0fb('0x48')];_0x475379['enduserType']=_[_0xb0fb('0x40')](_0x40fc3d[_0xb0fb('0x41')])+'s';return _0x475379;}logger[_0xb0fb('0x2c')](_0xb0fb('0x3c'),JSON[_0xb0fb('0x3e')](data));throw new Error('Error:\x20'+JSON[_0xb0fb('0x3e')](data));})['catch'](function(_0x168d20){console['log'](_0xb0fb('0x49'),_0x168d20);});}function getEndUser(_0xc80811,_0x4373d2,_0x291cec,_0x278111,_0x4644ac,_0x174ab9,_0x319d49){var _0x3abf3e={'method':_0xb0fb('0x31'),'uri':'','headers':{'Authorization':_0xb0fb('0x45')+_0xc80811},'json':!![]};switch(_0x319d49[_0xb0fb('0x4a')]){case _0xb0fb('0x4b'):_0x3abf3e[_0xb0fb('0x4c')]=_0xb0fb('0x4d')+_0x4373d2+_0xb0fb('0x4e')+_0x4644ac+'))';return getZohoUser(_0x3abf3e,_0xb0fb('0x4f'))[_0xb0fb('0x28')](function(_0x32f175){if(_0x32f175)return _0x32f175;_0x3abf3e[_0xb0fb('0x4c')]=_0xb0fb('0x4d')+_0x4373d2+_0xb0fb('0x50')+_0x4644ac+'))';return getZohoUser(_0x3abf3e,'Leads')['then'](function(_0x3fd40a){if(_0x3fd40a)return _0x3fd40a;if(_0x319d49[_0xb0fb('0x41')]!=_0xb0fb('0x51')){return createEndUser(_0xc80811,_0x4373d2,_0x278111,_0x4644ac,_0x174ab9,_0x319d49);}else{return{};}});});break;case'contact':_0x3abf3e[_0xb0fb('0x4c')]='https://www.zohoapis.'+_0x4373d2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4644ac+'))';return getZohoUser(_0x3abf3e,'Contacts')[_0xb0fb('0x28')](function(_0x5db1fa){if(_0x5db1fa)return _0x5db1fa;if(_0x319d49[_0xb0fb('0x41')]!='nothing'){return createEndUser(_0xc80811,_0x4373d2,_0x278111,_0x4644ac,_0x174ab9,_0x319d49);}else{return{};}});break;case _0xb0fb('0x52'):_0x3abf3e[_0xb0fb('0x4c')]=_0xb0fb('0x4d')+_0x4373d2+_0xb0fb('0x50')+_0x4644ac+'))';return getZohoUser(_0x3abf3e,'Leads')[_0xb0fb('0x28')](function(_0x4530fd){if(_0x4530fd)return _0x4530fd;if(_0x319d49[_0xb0fb('0x41')]!=_0xb0fb('0x51')){return createEndUser(_0xc80811,_0x4373d2,_0x278111,_0x4644ac,_0x174ab9,_0x319d49);}else{return{};}});break;}}function getCall(_0x21cf23,_0x4c3b01,_0x55b7df,_0x182071,_0x52116b,_0x3fc5f4,_0xe14f8,_0x57a8e7){logger[_0xb0fb('0x2f')]('Creating\x20new\x20call...');var _0x3d66d1={};_0x3d66d1['Owner']={'name':!_[_0xb0fb('0x1d')](_0x182071[_0xb0fb('0x42')][_0xb0fb('0x19')])&&!_[_0xb0fb('0x1d')](_0x182071['profile'][_0xb0fb('0x19')])&&_0x182071[_0xb0fb('0x38')][_0xb0fb('0x19')]===_0xb0fb('0x53')?_0x182071[_0xb0fb('0x42')][_0xb0fb('0x19')]:!_[_0xb0fb('0x1d')](_0x182071[_0xb0fb('0x43')])?_0x182071[_0xb0fb('0x43')]+'\x20'+_0x182071[_0xb0fb('0x44')]:_0x182071[_0xb0fb('0x44')],'id':_0x182071['id']};_0x3d66d1['Subject']=intUtil[_0xb0fb('0x54')](_0x3fc5f4[_0xb0fb('0x55')],_0xe14f8,'\x20');_0x3d66d1['Description']=intUtil[_0xb0fb('0x54')](_0x3fc5f4[_0xb0fb('0x56')],_0xe14f8,'\x0a');if(_0x52116b[_0xb0fb('0x57')]===_0xb0fb('0x4f')){_0x3d66d1[_0xb0fb('0x58')]={'name':!_[_0xb0fb('0x1d')](_0x52116b['Full_Name'])?_0x52116b[_0xb0fb('0x59')]:!_[_0xb0fb('0x1d')](_0x52116b['First_Name'])?_0x52116b[_0xb0fb('0x5a')]+'\x20'+_0x52116b[_0xb0fb('0x5b')]:_0x52116b['Last_Name'],'id':_0x52116b['id']};}if(_0x52116b[_0xb0fb('0x57')]===_0xb0fb('0x5c')){_0x3d66d1['What_Id']={'name':!_[_0xb0fb('0x1d')](_0x52116b[_0xb0fb('0x59')])?_0x52116b['Full_Name']:!_[_0xb0fb('0x1d')](_0x52116b[_0xb0fb('0x5a')])?_0x52116b[_0xb0fb('0x5a')]+'\x20'+_0x52116b['Last_Name']:_0x52116b[_0xb0fb('0x5b')],'id':_0x52116b['id']};_0x3d66d1[_0xb0fb('0x5d')]=_[_0xb0fb('0x40')](_0x52116b[_0xb0fb('0x57')]);}if(_0xe14f8[_0xb0fb('0x5e')]){_0x3d66d1['Call_Duration']=moment[_0xb0fb('0x5f')](parseInt(_0xe14f8['talktime'])*0x3e8)[_0xb0fb('0x32')](_0xb0fb('0x60'));}else if(_0xe14f8[_0xb0fb('0x61')]&&_0xe14f8['endtime']){_0x3d66d1[_0xb0fb('0x62')]=moment[_0xb0fb('0x5f')](moment(_0xe14f8['endtime'],_0xb0fb('0x63'))[_0xb0fb('0x64')](moment(_0xe14f8['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xb0fb('0x32')](_0xb0fb('0x60'));}switch(_0xe14f8[_0xb0fb('0x65')]){case _0xb0fb('0x66'):_0x3d66d1[_0xb0fb('0x67')]=_0xb0fb('0x68');break;case _0xb0fb('0x69'):case _0xb0fb('0x6a'):_0x3d66d1[_0xb0fb('0x67')]=_0xb0fb('0x6b');break;case _0xb0fb('0x6c'):_0x3d66d1[_0xb0fb('0x67')]=_0xb0fb('0x6d');break;case _0xb0fb('0x6e'):_0x3d66d1[_0xb0fb('0x67')]='Abandoned';break;case'timeout':_0x3d66d1['Call_Result']=_0xb0fb('0x6f');default:}_0x3d66d1[_0xb0fb('0x70')]=(_0x57a8e7===_0xb0fb('0x71')?moment(_0xe14f8[_0xb0fb('0x72')])[_0xb0fb('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0xe14f8[_0xb0fb('0x73')])[_0xb0fb('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xb0fb('0x32')](_0xb0fb('0x63'));_0x3d66d1[_0xb0fb('0x74')]=_0x57a8e7||'Inbound';_0x3d66d1=_[_0xb0fb('0x75')](_0x3d66d1,getCustomFields(_0x3fc5f4[_0xb0fb('0x76')],_0xe14f8));return request({'method':_0xb0fb('0x25'),'uri':_0xb0fb('0x4d')+_0x4c3b01+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x21cf23},'body':{'data':[_0x3d66d1]},'json':!![]})[_0xb0fb('0x28')](function(_0x1cdf79){if(_0x1cdf79&&_0x1cdf79['data'][0x0][_0xb0fb('0x46')]===_0xb0fb('0x47')){logger[_0xb0fb('0x2f')]('Call\x20created!');return{'id':_0x1cdf79[_0xb0fb('0x3f')][0x0][_0xb0fb('0x48')]['id']};}})[_0xb0fb('0x2b')](function(_0x3b13b8){logger['info'](_0xb0fb('0x77'),_0x3b13b8['stack']);console[_0xb0fb('0x78')](_0xb0fb('0x77'),_0x3b13b8);});}exports[_0xb0fb('0x79')]=function(_0x4a9f0d,_0x152ac0,_0x4ac687,_0x33dc89,_0xa88a8a,_0x55ddff){var _0x5eadc2,_0x3b389d,_0x17d537;_0x55ddff[_0xb0fb('0x7a')]=intUtil[_0xb0fb('0x7b')](_0x55ddff[_0xb0fb('0x7a')]);_0x55ddff[_0xb0fb('0x7c')]=intUtil[_0xb0fb('0x7b')](_0x55ddff[_0xb0fb('0x7c')]);if(_0xa88a8a&&_0xa88a8a['monitor_format']){logger['info'](_0xb0fb('0x7d'),_0xb0fb('0x7e'));_0x152ac0[_0xb0fb('0x7f')]=_0x55ddff[_0xb0fb('0x7c')]+_0xb0fb('0x80')+_0x152ac0[_0xb0fb('0x81')]+_0xb0fb('0x82')+md5(_0x152ac0[_0xb0fb('0x81')]);}else{_0x152ac0['recordingURL']='';}var _0x12c2a7=_0x55ddff[_0xb0fb('0x7a')]===_0xb0fb('0x83')?'eu':_0xb0fb('0x84');return getAccessToken(_0x55ddff)[_0xb0fb('0x28')](function(_0x5e0406){_0x17d537=_0x5e0406;return getUser(_0x17d537,_0x12c2a7,_0x55ddff,_0x33dc89[_0xb0fb('0x35')]);})[_0xb0fb('0x28')](function(_0x1f0495){_0x5eadc2=_0x1f0495;logger['info']('The\x20User\x20ID\x20is:',_0x5eadc2['id']);return getEndUser(_0x17d537,_0x12c2a7,_0x55ddff,_0x152ac0[_0xb0fb('0x85')],_0x152ac0[_0xb0fb('0x86')],_0x5eadc2,_0x4ac687);})['then'](function(_0xe3cf1a){_0x3b389d=_0xe3cf1a;return getCall(_0x17d537,_0x12c2a7,_0x55ddff,_0x5eadc2,_0x3b389d,_0x4ac687,_0x152ac0,'Inbound');})[_0xb0fb('0x28')](function(_0xc6afce){if(_0xc6afce){logger[_0xb0fb('0x2f')](_0xb0fb('0x87'),_0xc6afce['id']);logger[_0xb0fb('0x2f')]('[QUEUE]',_0xb0fb('0x88'));emit(util[_0xb0fb('0x32')](_0xb0fb('0x89'),_0x33dc89[_0xb0fb('0x19')]),_0xb0fb('0x8a'),{'uri':_0xb0fb('0x8b')+_0x55ddff['host']+_0xb0fb('0x8c')+_0xc6afce['id']});}})[_0xb0fb('0x2b')](function(_0x3bd433){logger[_0xb0fb('0x2c')](_0xb0fb('0x7d'),JSON[_0xb0fb('0x3e')](_0x3bd433));});};exports[_0xb0fb('0x71')]=function(_0x4986ce,_0x5e8a40,_0x267358,_0x574062,_0x32f416,_0x161c15,_0x5b86c5){var _0x1398f6,_0x13a04c,_0x2b4931;_0x161c15[_0xb0fb('0x7a')]=intUtil[_0xb0fb('0x7b')](_0x161c15[_0xb0fb('0x7a')]);_0x161c15[_0xb0fb('0x7c')]=intUtil[_0xb0fb('0x7b')](_0x161c15[_0xb0fb('0x7c')]);if(_0x5b86c5&&_0x5b86c5[_0xb0fb('0x8d')]&&_0x5b86c5[_0xb0fb('0x8d')]!=='none'){logger[_0xb0fb('0x2f')](_0xb0fb('0x8e'),'Recording\x20is\x20enabled!');_0x5e8a40[_0xb0fb('0x7f')]=_0x161c15[_0xb0fb('0x7c')]+_0xb0fb('0x80')+_0x5e8a40[_0xb0fb('0x81')]+_0xb0fb('0x82')+md5(_0x5e8a40[_0xb0fb('0x81')]);}var _0xbabf33=_0x161c15[_0xb0fb('0x7a')]==='zoho.eu'?'eu':_0xb0fb('0x84');return getAccessToken(_0x161c15)[_0xb0fb('0x28')](function(_0x1773a9){_0x2b4931=_0x1773a9;return getUser(_0x2b4931,_0xbabf33,_0x161c15,_0x574062[_0xb0fb('0x35')]);})[_0xb0fb('0x28')](function(_0x25e09d){_0x1398f6=_0x25e09d;logger[_0xb0fb('0x2f')](_0xb0fb('0x8f'),_0x1398f6['id']);return getEndUser(_0x2b4931,_0xbabf33,_0x161c15,_0x5e8a40[_0xb0fb('0x90')],_0x5e8a40['destcalleridnum'],_0x1398f6,_0x267358);})['then'](function(_0x2a9c60){_0x13a04c=_0x2a9c60;return getCall(_0x2b4931,_0xbabf33,_0x161c15,_0x1398f6,_0x13a04c,_0x267358,_0x5e8a40,_0xb0fb('0x91'));})['then'](function(_0x48ef82){if(_0x48ef82){logger['info'](_0xb0fb('0x87'),_0x48ef82['id']);logger[_0xb0fb('0x2f')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb0fb('0x89'),_0x574062[_0xb0fb('0x19')]),_0xb0fb('0x8a'),{'uri':_0xb0fb('0x8b')+_0x161c15[_0xb0fb('0x7a')]+_0xb0fb('0x8c')+_0x48ef82['id']});}})[_0xb0fb('0x2b')](function(_0x1e98b7){logger['error'](_0xb0fb('0x8e'),JSON['stringify'](_0x1e98b7));});};exports[_0xb0fb('0x92')]=function(_0x25212d,_0x507990,_0x53f23f,_0x11fb63,_0x11ed88,_0x527ba3){var _0x1fd487,_0x1d16e5,_0x4dfd36;_0x527ba3[_0xb0fb('0x7a')]=intUtil[_0xb0fb('0x7b')](_0x527ba3['host']);_0x527ba3[_0xb0fb('0x7c')]=intUtil[_0xb0fb('0x7b')](_0x527ba3[_0xb0fb('0x7c')]);if(_0x11ed88&&_0x11ed88['monitor_format']){logger['info']('['+_0x507990[_0xb0fb('0x65')][_0xb0fb('0x93')]()+']',_0xb0fb('0x7e'));_0x507990[_0xb0fb('0x7f')]=_0x527ba3[_0xb0fb('0x7c')]+_0xb0fb('0x80')+_0x507990[_0xb0fb('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x507990[_0xb0fb('0x81')]);}else{_0x507990[_0xb0fb('0x7f')]='';}var _0x151eba=_0x527ba3[_0xb0fb('0x7a')]===_0xb0fb('0x83')?'eu':_0xb0fb('0x84');return getAccessToken(_0x527ba3)[_0xb0fb('0x28')](function(_0x1c6e07){_0x4dfd36=_0x1c6e07;return getUser(_0x4dfd36,_0x151eba,_0x527ba3);})[_0xb0fb('0x28')](function(_0x5ca894){_0x1fd487=_0x5ca894;logger[_0xb0fb('0x2f')](_0xb0fb('0x8f'),_0x1fd487['id']);return getEndUser(_0x4dfd36,_0x151eba,_0x527ba3,_0x507990[_0xb0fb('0x85')],_0x507990[_0xb0fb('0x86')],_0x1fd487,_0x53f23f);})['then'](function(_0x3f78d0){_0x1d16e5=_0x3f78d0;return getCall(_0x4dfd36,_0x151eba,_0x527ba3,_0x1fd487,_0x1d16e5,_0x53f23f,_0x507990,_0xb0fb('0x94'));})[_0xb0fb('0x28')](function(_0x179d80){if(_0x179d80){logger[_0xb0fb('0x2f')](_0xb0fb('0x87'),_0x179d80['id']);}})[_0xb0fb('0x2b')](function(_0x9cb38e){logger['error']('['+_0x507990['lastevent'][_0xb0fb('0x93')]()+']',JSON[_0xb0fb('0x3e')](_0x9cb38e));});}; \ No newline at end of file +var _0x55c7=['emit','debug','[HTTP]','forEach','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','The\x20failing\x20result\x20is','data','enduserType','/crm/v2/','startCase','moduleCreate','isNil','role','first_name','last_name','code','SUCCESS','Error:\x20','moduleSearch','contact_lead','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','contact','nothing','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Call_Result','complete','connect','Answered','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','log','err','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','[OUTBOUND]','recordingURL','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','monitor_format','toUpperCase','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','zoho','defaults','redis','localhost'];(function(_0x26ae11,_0xa227ec){var _0x5126ca=function(_0xc99924){while(--_0xc99924){_0x26ae11['push'](_0x26ae11['shift']());}};_0x5126ca(++_0xa227ec);}(_0x55c7,0x127));var _0x755c=function(_0x5aed3d,_0x411eea){_0x5aed3d=_0x5aed3d-0x0;var _0x545de8=_0x55c7[_0x5aed3d];return _0x545de8;};'use strict';var _=require('lodash');var rp=require(_0x755c('0x0'));var md5=require(_0x755c('0x1'));var util=require(_0x755c('0x2'));var intUtil=require(_0x755c('0x3'));var moment=require(_0x755c('0x4'));var Redis=require(_0x755c('0x5'));var BPromise=require('bluebird');var config=require(_0x755c('0x6'));var logger=require('../../../../config/logger')(_0x755c('0x7'));config['redis']=_[_0x755c('0x8')](config[_0x755c('0x9')],{'host':_0x755c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x755c('0x9')]));function emit(_0x485213,_0x5a3bad,_0x51d828){io['to'](_0x485213)[_0x755c('0xb')](_0x5a3bad,_0x51d828);}function request(_0x4cb71e){logger[_0x755c('0xc')](_0x755c('0xd'),JSON['stringify'](_0x4cb71e));return rp(_0x4cb71e);}function getCustomFields(_0x3632ed,_0xeb4c59){var _0x33c21c={};if(_0x3632ed['length']>0x0){_[_0x755c('0xe')](_0x3632ed,function(_0x1c6c83){if(_[_0x755c('0xf')]([_0x755c('0x10'),_0x755c('0x11')],_0x1c6c83['type'])&&_0x1c6c83[_0x755c('0x12')]){_0x33c21c[_0x1c6c83[_0x755c('0x12')]]=_0x1c6c83[_0x755c('0x13')]['toString']();}else if(_0x1c6c83['type']===_0x755c('0x14')&&_0x1c6c83[_0x755c('0x15')]&&_0x1c6c83[_0x755c('0x12')]&&_0xeb4c59[_0x1c6c83[_0x755c('0x15')]]){_0x33c21c[_0x1c6c83[_0x755c('0x12')]]=_0xeb4c59[_0x1c6c83[_0x755c('0x15')]][_0x755c('0x16')]();}else if(_0x1c6c83['type']==='customVariable'&&_0x1c6c83[_0x755c('0x17')]&&_0x1c6c83['Variable'][_0x755c('0x18')]&&_0x1c6c83[_0x755c('0x12')]&&_0xeb4c59[_0x1c6c83['Variable'][_0x755c('0x18')][_0x755c('0x19')]()]){_0x33c21c[_0x1c6c83[_0x755c('0x12')]]=_0xeb4c59[_0x1c6c83[_0x755c('0x17')][_0x755c('0x18')][_0x755c('0x19')]()]['toString']();}});}return _0x33c21c;}function getName(_0x1541c8){if(_0x1541c8[_0x755c('0x1a')]('\x20')>0x0){var _0x284cb3=_0x1541c8['split'](/ (.+)/);if(_0x284cb3[0x1]){return _0x284cb3;}}return[_0x1541c8,_0x1541c8];}var accountsTokens={};function getAccessToken(_0x3953f6){return new Promise(function(_0x1add6a,_0x12032a){if(!_['isNil'](accountsTokens[_0x3953f6['id']])&&!_['isNil'](accountsTokens[_0x3953f6['id']]['access_token'])){if(moment()[_0x755c('0x1b')](accountsTokens[_0x3953f6['id']][_0x755c('0x1c')])){_0x1add6a(accountsTokens[_0x3953f6['id']][_0x755c('0x1d')]);}}var _0x5a74e0;switch(_0x3953f6['zone']){case'US':_0x5a74e0=_0x755c('0x1e');break;case'AU':_0x5a74e0=_0x755c('0x1f');break;case'EU':_0x5a74e0='https://accounts.zoho.eu';break;case'IN':_0x5a74e0=_0x755c('0x20');break;case'CN':_0x5a74e0='https://accounts.zoho.com.cn';break;default:_0x5a74e0=_0x755c('0x21');break;}var _0x31e53b={'method':_0x755c('0x22'),'uri':_0x5a74e0+_0x755c('0x23'),'qs':{'refresh_token':_0x3953f6[_0x755c('0x24')],'client_id':_0x3953f6[_0x755c('0x25')],'client_secret':_0x3953f6[_0x755c('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x31e53b)[_0x755c('0x27')](function(_0x58118a){accountsTokens[_0x3953f6['id']]={'access_token':_0x58118a[_0x755c('0x1d')],'expires_in':moment()[_0x755c('0x28')](_0x58118a['expires_in'],_0x755c('0x29'))};_0x1add6a(_0x58118a['access_token']);})[_0x755c('0x2a')](function(_0x4e10fe){logger[_0x755c('0x2b')](_0x755c('0x2c'),_0x4e10fe[_0x755c('0x2d')]);_0x12032a(_0x4e10fe);});});}function getUser(_0x1196cd,_0x4b3946,_0x1890e6,_0xcf8367){logger[_0x755c('0x2e')]('Search\x20user');return request({'method':_0x755c('0x2f'),'uri':util[_0x755c('0x30')](_0x755c('0x31'),_0x4b3946),'qs':{'type':_0x755c('0x32')},'headers':{'Authorization':_0x755c('0x33')+_0x1196cd},'json':!![]})[_0x755c('0x27')](function(_0xa628f1){if(_0xa628f1['users']){var _0x381712=-0x1;if(_[_0x755c('0x34')](_0xa628f1[_0x755c('0x35')])){if(!_['isNil'](_0xcf8367)){_0x381712=_[_0x755c('0x36')](_0xa628f1[_0x755c('0x35')],function(_0x46224a){return _0x46224a['email']===_0xcf8367;});}if(_0x381712>=0x0){logger['info'](_0x755c('0x37'));}else{logger[_0x755c('0x2e')](_0x755c('0x38'));_0x381712=_['findIndex'](_0xa628f1['users'],function(_0x5282e8){return _0x5282e8[_0x755c('0x39')]['name']===_0x755c('0x3a');});}return _0xa628f1[_0x755c('0x35')][_0x381712];}else{if(_0xa628f1[_0x755c('0x3b')][_0x755c('0x39')][_0x755c('0x18')]===_0x755c('0x3a')){logger[_0x755c('0x2e')]('Using\x20the\x20admin\x20account!');user=_0xa628f1[_0x755c('0x3b')];return user;}else{logger[_0x755c('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0xa628f1));throw new Error(_0x755c('0x3c')+JSON[_0x755c('0x3d')](_0xa628f1));}}}else{logger['error'](_0x755c('0x3e'),JSON[_0x755c('0x3d')](_0xa628f1));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0xa628f1));}})[_0x755c('0x2a')](function(_0x568fca){console[_0x755c('0x2b')](_0x568fca);});}function getZohoUser(_0x1e7468,_0x3c8688){return new BPromise(function(_0x1664ad,_0x4216d9){request(_0x1e7468)[_0x755c('0x27')](function(_0x2f0c3a){var _0x4b3af9=null;if(_0x2f0c3a){_0x4b3af9=_0x2f0c3a[_0x755c('0x3f')][0x0];_0x4b3af9[_0x755c('0x40')]=_0x3c8688;}_0x1664ad(_0x4b3af9);})[_0x755c('0x2a')](function(_0x20bca3){_0x4216d9(_0x20bca3);});});}function createEndUser(_0x1dc218,_0x36673a,_0x31e4c0,_0x5e6c82,_0x41d2cb,_0x341364){var _0x31e4c0=getName(_0x31e4c0);return request({'method':_0x755c('0x22'),'uri':'https://www.zohoapis.'+_0x36673a+_0x755c('0x41')+_[_0x755c('0x42')](_0x341364[_0x755c('0x43')])+'s','body':{'data':[{'Last_Name':_0x31e4c0[0x1],'First_Name':_0x31e4c0[0x0],'Phone':_0x5e6c82,'Owner':{'name':!_[_0x755c('0x44')](_0x41d2cb['role'][_0x755c('0x18')])?_0x41d2cb[_0x755c('0x45')][_0x755c('0x18')]:!_['isNil'](_0x41d2cb[_0x755c('0x46')])?_0x41d2cb[_0x755c('0x46')]+'\x20'+_0x41d2cb[_0x755c('0x47')]:_0x41d2cb[_0x755c('0x47')],'id':_0x41d2cb['id']}}]},'headers':{'Authorization':_0x755c('0x33')+_0x1dc218},'json':!![]})[_0x755c('0x27')](function(_0x344630){if(_0x344630&&_0x344630[_0x755c('0x3f')][0x0][_0x755c('0x48')]===_0x755c('0x49')){var _0x295e01=_0x344630[_0x755c('0x3f')][0x0]['details'];_0x295e01['enduserType']=_[_0x755c('0x42')](_0x341364[_0x755c('0x43')])+'s';return _0x295e01;}logger[_0x755c('0x2b')](_0x755c('0x3e'),JSON[_0x755c('0x3d')](data));throw new Error(_0x755c('0x4a')+JSON[_0x755c('0x3d')](data));})['catch'](function(_0x50b545){console['log']('CREATE\x20ERROR',_0x50b545);});}function getEndUser(_0x54b0cf,_0x245bc0,_0x31c24f,_0x3f544c,_0x53327e,_0x28622d,_0x4e1234){var _0x3f78f9={'method':_0x755c('0x2f'),'uri':'','headers':{'Authorization':_0x755c('0x33')+_0x54b0cf},'json':!![]};switch(_0x4e1234[_0x755c('0x4b')]){case _0x755c('0x4c'):_0x3f78f9['uri']=_0x755c('0x4d')+_0x245bc0+_0x755c('0x4e')+_0x53327e+'))';return getZohoUser(_0x3f78f9,_0x755c('0x4f'))[_0x755c('0x27')](function(_0xc691cf){if(_0xc691cf)return _0xc691cf;_0x3f78f9[_0x755c('0x50')]=_0x755c('0x4d')+_0x245bc0+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x53327e+'))';return getZohoUser(_0x3f78f9,'Leads')[_0x755c('0x27')](function(_0x56ac91){if(_0x56ac91)return _0x56ac91;if(_0x4e1234[_0x755c('0x43')]!='nothing'){return createEndUser(_0x54b0cf,_0x245bc0,_0x3f544c,_0x53327e,_0x28622d,_0x4e1234);}else{return{};}});});break;case _0x755c('0x51'):_0x3f78f9[_0x755c('0x50')]='https://www.zohoapis.'+_0x245bc0+_0x755c('0x4e')+_0x53327e+'))';return getZohoUser(_0x3f78f9,_0x755c('0x4f'))[_0x755c('0x27')](function(_0x4e132b){if(_0x4e132b)return _0x4e132b;if(_0x4e1234[_0x755c('0x43')]!=_0x755c('0x52')){return createEndUser(_0x54b0cf,_0x245bc0,_0x3f544c,_0x53327e,_0x28622d,_0x4e1234);}else{return{};}});break;case'lead':_0x3f78f9[_0x755c('0x50')]='https://www.zohoapis.'+_0x245bc0+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x53327e+'))';return getZohoUser(_0x3f78f9,_0x755c('0x53'))[_0x755c('0x27')](function(_0x42acf5){if(_0x42acf5)return _0x42acf5;if(_0x4e1234[_0x755c('0x43')]!=_0x755c('0x52')){return createEndUser(_0x54b0cf,_0x245bc0,_0x3f544c,_0x53327e,_0x28622d,_0x4e1234);}else{return{};}});break;}}function getCall(_0x28389a,_0x5a1564,_0x41cd4d,_0x30b906,_0x3b5ca5,_0x50b0be,_0x4cde0d,_0x46f4a6){logger['info'](_0x755c('0x54'));var _0xfdea3b={};_0xfdea3b[_0x755c('0x55')]={'name':!_[_0x755c('0x44')](_0x30b906[_0x755c('0x45')][_0x755c('0x18')])&&!_['isNil'](_0x30b906['profile'][_0x755c('0x18')])&&_0x30b906[_0x755c('0x39')][_0x755c('0x18')]===_0x755c('0x56')?_0x30b906['role']['name']:!_[_0x755c('0x44')](_0x30b906['first_name'])?_0x30b906['first_name']+'\x20'+_0x30b906[_0x755c('0x47')]:_0x30b906[_0x755c('0x47')],'id':_0x30b906['id']};_0xfdea3b[_0x755c('0x57')]=intUtil[_0x755c('0x58')](_0x50b0be[_0x755c('0x59')],_0x4cde0d,'\x20');_0xfdea3b[_0x755c('0x5a')]=intUtil['getString'](_0x50b0be['Descriptions'],_0x4cde0d,'\x0a');if(_0x3b5ca5['enduserType']===_0x755c('0x4f')){_0xfdea3b[_0x755c('0x5b')]={'name':!_[_0x755c('0x44')](_0x3b5ca5[_0x755c('0x5c')])?_0x3b5ca5[_0x755c('0x5c')]:!_['isNil'](_0x3b5ca5[_0x755c('0x5d')])?_0x3b5ca5[_0x755c('0x5d')]+'\x20'+_0x3b5ca5[_0x755c('0x5e')]:_0x3b5ca5[_0x755c('0x5e')],'id':_0x3b5ca5['id']};}if(_0x3b5ca5[_0x755c('0x40')]===_0x755c('0x53')){_0xfdea3b[_0x755c('0x5f')]={'name':!_[_0x755c('0x44')](_0x3b5ca5[_0x755c('0x5c')])?_0x3b5ca5[_0x755c('0x5c')]:!_[_0x755c('0x44')](_0x3b5ca5[_0x755c('0x5d')])?_0x3b5ca5[_0x755c('0x5d')]+'\x20'+_0x3b5ca5[_0x755c('0x5e')]:_0x3b5ca5['Last_Name'],'id':_0x3b5ca5['id']};_0xfdea3b[_0x755c('0x60')]=_['startCase'](_0x3b5ca5[_0x755c('0x40')]);}if(_0x4cde0d[_0x755c('0x61')]){_0xfdea3b['Call_Duration']=moment[_0x755c('0x62')](parseInt(_0x4cde0d[_0x755c('0x61')])*0x3e8)[_0x755c('0x30')]('mm:ss');}else if(_0x4cde0d['answertime']&&_0x4cde0d[_0x755c('0x63')]){_0xfdea3b[_0x755c('0x64')]=moment[_0x755c('0x62')](moment(_0x4cde0d[_0x755c('0x63')],_0x755c('0x65'))[_0x755c('0x66')](moment(_0x4cde0d['starttime'],_0x755c('0x65'))))[_0x755c('0x30')](_0x755c('0x67'));}switch(_0x4cde0d[_0x755c('0x68')]){case _0x755c('0x69'):_0xfdea3b[_0x755c('0x6a')]='Called';break;case _0x755c('0x6b'):case _0x755c('0x6c'):_0xfdea3b[_0x755c('0x6a')]=_0x755c('0x6d');break;case'rejected':_0xfdea3b[_0x755c('0x6a')]=_0x755c('0x6e');break;case _0x755c('0x6f'):_0xfdea3b['Call_Result']=_0x755c('0x70');break;case'timeout':_0xfdea3b['Call_Result']='Timeout';default:}_0xfdea3b[_0x755c('0x71')]=(_0x46f4a6===_0x755c('0x72')?moment(_0x4cde0d[_0x755c('0x73')])[_0x755c('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4cde0d[_0x755c('0x74')])['format'](_0x755c('0x65')))||moment()[_0x755c('0x30')](_0x755c('0x65'));_0xfdea3b[_0x755c('0x75')]=_0x46f4a6||_0x755c('0x76');_0xfdea3b=_[_0x755c('0x77')](_0xfdea3b,getCustomFields(_0x50b0be[_0x755c('0x78')],_0x4cde0d));return request({'method':_0x755c('0x22'),'uri':'https://www.zohoapis.'+_0x5a1564+_0x755c('0x79'),'headers':{'Authorization':_0x755c('0x33')+_0x28389a},'body':{'data':[_0xfdea3b]},'json':!![]})[_0x755c('0x27')](function(_0x148382){if(_0x148382&&_0x148382[_0x755c('0x3f')][0x0][_0x755c('0x48')]==='SUCCESS'){logger[_0x755c('0x2e')](_0x755c('0x7a'));return{'id':_0x148382[_0x755c('0x3f')][0x0][_0x755c('0x7b')]['id']};}})[_0x755c('0x2a')](function(_0x298d1a){logger['info']('err',_0x298d1a[_0x755c('0x2d')]);console[_0x755c('0x7c')](_0x755c('0x7d'),_0x298d1a);});}exports['queue']=function(_0x26e379,_0x44443f,_0x2cdb8c,_0x4246a5,_0x19f76f,_0x457bb1){var _0x76f66b,_0x4eed24,_0xb4e13c;_0x457bb1['host']=intUtil['stripTrailingSlash'](_0x457bb1[_0x755c('0x7e')]);_0x457bb1['serverUrl']=intUtil['stripTrailingSlash'](_0x457bb1[_0x755c('0x7f')]);if(_0x19f76f&&_0x19f76f['monitor_format']){logger[_0x755c('0x2e')](_0x755c('0x80'),_0x755c('0x81'));_0x44443f['recordingURL']=_0x457bb1['serverUrl']+'/api/voice/recordings/'+_0x44443f[_0x755c('0x82')]+_0x755c('0x83')+md5(_0x44443f[_0x755c('0x82')]);}else{_0x44443f['recordingURL']='';}var _0x2e1521=_0x457bb1[_0x755c('0x7e')]===_0x755c('0x84')?'eu':'com';return getAccessToken(_0x457bb1)['then'](function(_0x32da4c){_0xb4e13c=_0x32da4c;return getUser(_0xb4e13c,_0x2e1521,_0x457bb1,_0x4246a5[_0x755c('0x85')]);})[_0x755c('0x27')](function(_0x3eff04){_0x76f66b=_0x3eff04;logger[_0x755c('0x2e')]('The\x20User\x20ID\x20is:',_0x76f66b['id']);return getEndUser(_0xb4e13c,_0x2e1521,_0x457bb1,_0x44443f[_0x755c('0x86')],_0x44443f[_0x755c('0x87')],_0x76f66b,_0x2cdb8c);})[_0x755c('0x27')](function(_0x34e6b6){_0x4eed24=_0x34e6b6;return getCall(_0xb4e13c,_0x2e1521,_0x457bb1,_0x76f66b,_0x4eed24,_0x2cdb8c,_0x44443f,'Inbound');})[_0x755c('0x27')](function(_0x498e36){if(_0x498e36){logger[_0x755c('0x2e')](_0x755c('0x88'),_0x498e36['id']);logger[_0x755c('0x2e')](_0x755c('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x755c('0x30')](_0x755c('0x89'),_0x4246a5[_0x755c('0x18')]),_0x755c('0x8a'),{'uri':'https://crm.'+_0x457bb1[_0x755c('0x7e')]+_0x755c('0x8b')+_0x498e36['id']});}})[_0x755c('0x2a')](function(_0x2048a5){logger[_0x755c('0x2b')](_0x755c('0x80'),JSON[_0x755c('0x3d')](_0x2048a5));});};exports['outbound']=function(_0x1ee74d,_0x194214,_0x51dc4a,_0x180c31,_0x2d8449,_0x293bf4,_0x15d1f4){var _0x426817,_0x3bc07c,_0x14abf6;_0x293bf4[_0x755c('0x7e')]=intUtil['stripTrailingSlash'](_0x293bf4[_0x755c('0x7e')]);_0x293bf4[_0x755c('0x7f')]=intUtil[_0x755c('0x8c')](_0x293bf4[_0x755c('0x7f')]);if(_0x15d1f4&&_0x15d1f4['recordingFormat']&&_0x15d1f4[_0x755c('0x8d')]!=='none'){logger[_0x755c('0x2e')](_0x755c('0x8e'),'Recording\x20is\x20enabled!');_0x194214[_0x755c('0x8f')]=_0x293bf4[_0x755c('0x7f')]+'/api/voice/recordings/'+_0x194214[_0x755c('0x82')]+_0x755c('0x83')+md5(_0x194214[_0x755c('0x82')]);}var _0x43c16e=_0x293bf4[_0x755c('0x7e')]==='zoho.eu'?'eu':_0x755c('0x90');return getAccessToken(_0x293bf4)[_0x755c('0x27')](function(_0x339ccc){_0x14abf6=_0x339ccc;return getUser(_0x14abf6,_0x43c16e,_0x293bf4,_0x180c31[_0x755c('0x85')]);})['then'](function(_0x5b1c1c){_0x426817=_0x5b1c1c;logger[_0x755c('0x2e')](_0x755c('0x91'),_0x426817['id']);return getEndUser(_0x14abf6,_0x43c16e,_0x293bf4,_0x194214[_0x755c('0x92')],_0x194214[_0x755c('0x93')],_0x426817,_0x51dc4a);})[_0x755c('0x27')](function(_0x25be5c){_0x3bc07c=_0x25be5c;return getCall(_0x14abf6,_0x43c16e,_0x293bf4,_0x426817,_0x3bc07c,_0x51dc4a,_0x194214,_0x755c('0x94'));})[_0x755c('0x27')](function(_0x7b44e2){if(_0x7b44e2){logger[_0x755c('0x2e')](_0x755c('0x88'),_0x7b44e2['id']);logger[_0x755c('0x2e')](_0x755c('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x755c('0x89'),_0x180c31[_0x755c('0x18')]),_0x755c('0x8a'),{'uri':_0x755c('0x95')+_0x293bf4[_0x755c('0x7e')]+_0x755c('0x8b')+_0x7b44e2['id']});}})[_0x755c('0x2a')](function(_0xf91721){logger['error'](_0x755c('0x8e'),JSON[_0x755c('0x3d')](_0xf91721));});};exports[_0x755c('0x96')]=function(_0x4a789a,_0x4bb0a3,_0x13c999,_0x15a3dc,_0x51968b,_0x4dea5a){var _0x1e1cc2,_0x45ddde,_0x2720b3;_0x4dea5a['host']=intUtil[_0x755c('0x8c')](_0x4dea5a[_0x755c('0x7e')]);_0x4dea5a['serverUrl']=intUtil['stripTrailingSlash'](_0x4dea5a[_0x755c('0x7f')]);if(_0x51968b&&_0x51968b[_0x755c('0x97')]){logger[_0x755c('0x2e')]('['+_0x4bb0a3[_0x755c('0x68')][_0x755c('0x98')]()+']','Recording\x20is\x20enabled!');_0x4bb0a3['recordingURL']=_0x4dea5a[_0x755c('0x7f')]+'/api/voice/recordings/'+_0x4bb0a3[_0x755c('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x4bb0a3[_0x755c('0x82')]);}else{_0x4bb0a3['recordingURL']='';}var _0x3a931a=_0x4dea5a[_0x755c('0x7e')]===_0x755c('0x84')?'eu':_0x755c('0x90');return getAccessToken(_0x4dea5a)[_0x755c('0x27')](function(_0x1f0e05){_0x2720b3=_0x1f0e05;return getUser(_0x2720b3,_0x3a931a,_0x4dea5a);})[_0x755c('0x27')](function(_0x549bb6){_0x1e1cc2=_0x549bb6;logger['info'](_0x755c('0x91'),_0x1e1cc2['id']);return getEndUser(_0x2720b3,_0x3a931a,_0x4dea5a,_0x4bb0a3['calleridname'],_0x4bb0a3[_0x755c('0x87')],_0x1e1cc2,_0x13c999);})['then'](function(_0x2ce4e2){_0x45ddde=_0x2ce4e2;return getCall(_0x2720b3,_0x3a931a,_0x4dea5a,_0x1e1cc2,_0x45ddde,_0x13c999,_0x4bb0a3,_0x755c('0x76'));})[_0x755c('0x27')](function(_0x437489){if(_0x437489){logger[_0x755c('0x2e')](_0x755c('0x88'),_0x437489['id']);}})[_0x755c('0x2a')](function(_0x2a1474){logger['error']('['+_0x4bb0a3[_0x755c('0x68')][_0x755c('0x98')]()+']',JSON[_0x755c('0x3d')](_0x2a1474));});}; \ 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 d1574fb..8ac9cdf 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 _0x1e8c=['util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x495c4f,_0x129d12){var _0x58116a=function(_0x168dc6){while(--_0x168dc6){_0x495c4f['push'](_0x495c4f['shift']());}};_0x58116a(++_0x129d12);}(_0x1e8c,0x1e1));var _0xc1e8=function(_0x2ac5de,_0x2cebca){_0x2ac5de=_0x2ac5de-0x0;var _0x1415b2=_0x1e8c[_0x2ac5de];return _0x1415b2;};'use strict';var util=require(_0xc1e8('0x0'));var sh=require(_0xc1e8('0x1'));var Mustache=require(_0xc1e8('0x2'));var logger=require(_0xc1e8('0x3'))(_0xc1e8('0x4'));exports[_0xc1e8('0x5')]=function(_0xefb128,_0x1ab497){var _0x43917e=_0xefb128[_0xc1e8('0x6')]?_0xefb128[_0xc1e8('0x6')]:_0xc1e8('0x7');var _0x7f025=_0xefb128[_0xc1e8('0x8')]?Mustache[_0xc1e8('0x9')](_0xefb128[_0xc1e8('0x8')],_0x1ab497):_0x1ab497;sh[_0xc1e8('0x5')](_0x7f025,function(_0x32b93a,_0x5d6293,_0x5cb8c3){if(_0x32b93a!==0x0){logger[_0xc1e8('0xa')](util['format'](_0xc1e8('0xb'),_0x43917e,_0x7f025,_0x32b93a,_0x5cb8c3));}else{logger['info'](util['format'](_0xc1e8('0xc'),_0x43917e,_0x7f025,_0x5d6293));}});}; \ No newline at end of file +var _0x4b3e=['trigger','exec','data2','Script','data3','render','error','format','info','util','shelljs','mustache','../../../../config/logger'];(function(_0x5eadbe,_0x3ed05c){var _0x1ef823=function(_0x3aa928){while(--_0x3aa928){_0x5eadbe['push'](_0x5eadbe['shift']());}};_0x1ef823(++_0x3ed05c);}(_0x4b3e,0x100));var _0xe4b3=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x4b3e[_0x5b3b9b];return _0x47c1d7;};'use strict';var util=require(_0xe4b3('0x0'));var sh=require(_0xe4b3('0x1'));var Mustache=require(_0xe4b3('0x2'));var logger=require(_0xe4b3('0x3'))(_0xe4b3('0x4'));exports[_0xe4b3('0x5')]=function(_0x362aa3,_0x3995c9){var _0x33f70e=_0x362aa3[_0xe4b3('0x6')]?_0x362aa3[_0xe4b3('0x6')]:_0xe4b3('0x7');var _0x13d518=_0x362aa3[_0xe4b3('0x8')]?Mustache[_0xe4b3('0x9')](_0x362aa3[_0xe4b3('0x8')],_0x3995c9):_0x3995c9;sh['exec'](_0x13d518,function(_0x5451e0,_0x54f10a,_0x3a7d50){if(_0x5451e0!==0x0){logger[_0xe4b3('0xa')](util[_0xe4b3('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x33f70e,_0x13d518,_0x5451e0,_0x3a7d50));}else{logger[_0xe4b3('0xc')](util[_0xe4b3('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x33f70e,_0x13d518,_0x54f10a));}});}; \ 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 cd536d8..8dd648f 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 _0xa0d9=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','data2','data5','number','headers','parse','render','data6','error','GET','POST','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa0d9,0x197));var _0x9a0d=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xa0d9[_0x184759];return _0xf26d5f;};'use strict';var rp=require(_0x9a0d('0x0'));var util=require(_0x9a0d('0x1'));var _=require('lodash');var Mustache=require(_0x9a0d('0x2'));var logger=require('../../../../config/logger')(_0x9a0d('0x3'));exports[_0x9a0d('0x4')]=function(_0x11379c,_0x4f85f1){var _0x1fb93b,_0x32820f;var _0x5f9849={'method':_0x11379c[_0x9a0d('0x5')][_0x9a0d('0x6')](),'uri':Mustache['render'](_0x11379c[_0x9a0d('0x7')],_0x4f85f1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x11379c[_0x9a0d('0x8')])===_0x9a0d('0x9')&&parseInt(_0x11379c['data5'])>=0x1&&parseInt(_0x11379c[_0x9a0d('0x8')])<=0xa?parseInt(_0x11379c['data5'])*0x3e8:0x5*0x3e8};try{_0x5f9849[_0x9a0d('0xa')]=_0x11379c['data6']?JSON[_0x9a0d('0xb')](Mustache[_0x9a0d('0xc')](_0x11379c[_0x9a0d('0xd')],_0x4f85f1)):{};}catch(_0x21cbc0){logger[_0x9a0d('0xe')](_0x21cbc0['stack']);}switch(_0x11379c[_0x9a0d('0x5')][_0x9a0d('0x6')]()){case _0x9a0d('0xf'):case'DELETE':_0x1fb93b=null;_0x5f9849['qs']=_0x4f85f1;break;case _0x9a0d('0x10'):case'PUT':if(_0x11379c[_0x9a0d('0x11')]){try{_0x1fb93b=JSON[_0x9a0d('0xb')](Mustache['render'](_0x11379c[_0x9a0d('0x11')],_0x4f85f1));_0x5f9849[_0x9a0d('0x12')]=_0x1fb93b;}catch(_0x1816b1){logger[_0x9a0d('0xe')](_0x1816b1[_0x9a0d('0x13')]);logger[_0x9a0d('0xe')](_0x9a0d('0x14'));}}else{_0x1fb93b=_0x4f85f1;_0x5f9849[_0x9a0d('0x12')]=_0x1fb93b;}break;}logger[_0x9a0d('0x15')](util[_0x9a0d('0x16')](_0x9a0d('0x17'),_0x11379c['data1'],_0x11379c[_0x9a0d('0x7')],JSON['stringify'](_0x5f9849)));rp(_0x5f9849)[_0x9a0d('0x18')](function(_0x171460){_0x1fb93b=!_[_0x9a0d('0x19')](_0x1fb93b)?_0x9a0d('0x1a')+_0x1fb93b:'';_0x32820f=typeof _0x171460[_0x9a0d('0x12')]===_0x9a0d('0x1b')?JSON['stringify'](_0x171460[_0x9a0d('0x12')]):_0x171460[_0x9a0d('0x12')];logger[_0x9a0d('0x15')](util[_0x9a0d('0x16')](_0x9a0d('0x1c'),_0x11379c['data1'],_0x11379c[_0x9a0d('0x7')],_0x171460[_0x9a0d('0x1d')],_0x32820f));})[_0x9a0d('0x1e')](function(_0x14197b){logger[_0x9a0d('0xe')](util[_0x9a0d('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x11379c[_0x9a0d('0x5')],_0x11379c[_0x9a0d('0x7')],_0x14197b['statusCode'],_0x14197b[_0x9a0d('0x1f')],_0x14197b[_0x9a0d('0x20')]));});}; \ No newline at end of file +var _0xdab8=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','toUpperCase','data5','headers','data6','parse','render','error','stack','data1','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','format'];(function(_0x301dec,_0x3b955c){var _0x506290=function(_0x2bb061){while(--_0x2bb061){_0x301dec['push'](_0x301dec['shift']());}};_0x506290(++_0x3b955c);}(_0xdab8,0xba));var _0x8dab=function(_0x26bbc9,_0x515c90){_0x26bbc9=_0x26bbc9-0x0;var _0x4167fb=_0xdab8[_0x26bbc9];return _0x4167fb;};'use strict';var rp=require(_0x8dab('0x0'));var util=require(_0x8dab('0x1'));var _=require(_0x8dab('0x2'));var Mustache=require(_0x8dab('0x3'));var logger=require(_0x8dab('0x4'))('trigger');exports[_0x8dab('0x5')]=function(_0x5b0a3a,_0x3336b2){var _0x4feb14,_0x3c15e6;var _0x2e6a00={'method':_0x5b0a3a['data1'][_0x8dab('0x6')](),'uri':Mustache['render'](_0x5b0a3a['data2'],_0x3336b2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5b0a3a[_0x8dab('0x7')])==='number'&&parseInt(_0x5b0a3a[_0x8dab('0x7')])>=0x1&&parseInt(_0x5b0a3a[_0x8dab('0x7')])<=0xa?parseInt(_0x5b0a3a[_0x8dab('0x7')])*0x3e8:0x5*0x3e8};try{_0x2e6a00[_0x8dab('0x8')]=_0x5b0a3a[_0x8dab('0x9')]?JSON[_0x8dab('0xa')](Mustache[_0x8dab('0xb')](_0x5b0a3a[_0x8dab('0x9')],_0x3336b2)):{};}catch(_0x3ec5cf){logger[_0x8dab('0xc')](_0x3ec5cf[_0x8dab('0xd')]);}switch(_0x5b0a3a[_0x8dab('0xe')][_0x8dab('0x6')]()){case'GET':case _0x8dab('0xf'):_0x4feb14=null;_0x2e6a00['qs']=_0x3336b2;break;case _0x8dab('0x10'):case _0x8dab('0x11'):if(_0x5b0a3a['data7']){try{_0x4feb14=JSON['parse'](Mustache[_0x8dab('0xb')](_0x5b0a3a[_0x8dab('0x12')],_0x3336b2));_0x2e6a00[_0x8dab('0x13')]=_0x4feb14;}catch(_0x499f0b){logger['error'](_0x499f0b['stack']);logger[_0x8dab('0xc')](_0x8dab('0x14'));}}else{_0x4feb14=_0x3336b2;_0x2e6a00[_0x8dab('0x13')]=_0x4feb14;}break;}logger[_0x8dab('0x15')](util['format'](_0x8dab('0x16'),_0x5b0a3a['data1'],_0x5b0a3a[_0x8dab('0x17')],JSON['stringify'](_0x2e6a00)));rp(_0x2e6a00)[_0x8dab('0x18')](function(_0x273538){_0x4feb14=!_[_0x8dab('0x19')](_0x4feb14)?_0x8dab('0x1a')+_0x4feb14:'';_0x3c15e6=typeof _0x273538[_0x8dab('0x13')]===_0x8dab('0x1b')?JSON[_0x8dab('0x1c')](_0x273538['body']):_0x273538[_0x8dab('0x13')];logger[_0x8dab('0x15')](util[_0x8dab('0x1d')](_0x8dab('0x1e'),_0x5b0a3a[_0x8dab('0xe')],_0x5b0a3a['data2'],_0x273538[_0x8dab('0x1f')],_0x3c15e6));})[_0x8dab('0x20')](function(_0x5cb06a){logger[_0x8dab('0xc')](util[_0x8dab('0x1d')](_0x8dab('0x21'),_0x5b0a3a[_0x8dab('0xe')],_0x5b0a3a[_0x8dab('0x17')],_0x5cb06a[_0x8dab('0x1f')],_0x5cb06a[_0x8dab('0x22')],_0x5cb06a[_0x8dab('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 10ddc02..ea04a41 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 _0x1b4a=['rpc','error','message','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','debug'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x1b4a,0x130));var _0xa1b4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1b4a[_0x501510];return _0x1e6ee5;};'use strict';var jayson=require(_0xa1b4('0x0'));var BPromise=require('bluebird');var logger=require(_0xa1b4('0x1'))(_0xa1b4('0x2'));var client=jayson[_0xa1b4('0x3')][_0xa1b4('0x4')]({'port':0x2329});client[_0xa1b4('0x5')]=function(_0x4ea51c,_0x3d6a96){return new BPromise(function(_0x58846b,_0x3933e2){return client[_0xa1b4('0x6')](_0x4ea51c,_0x3d6a96)['then'](function(_0x22fd6d){logger[_0xa1b4('0x7')](_0xa1b4('0x8'),'routing',_0x4ea51c,_0x3d6a96,_0x22fd6d);if(_0x22fd6d[_0xa1b4('0x9')]){logger[_0xa1b4('0x9')](_0xa1b4('0x8'),'routing',_0x4ea51c,_0x22fd6d[_0xa1b4('0x9')][_0xa1b4('0xa')],_0x3d6a96);return _0x3933e2(_0x22fd6d['error'][_0xa1b4('0xa')]);}else{return _0x58846b(_0x22fd6d['result']);}})['catch'](function(_0x43daea){logger[_0xa1b4('0x9')]('rpc',_0xa1b4('0x2'),_0x4ea51c,_0x43daea,_0x3d6a96);return _0x3933e2(_0x43daea);});});};module[_0xa1b4('0xb')]=client; \ No newline at end of file +var _0xd19d=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','catch'];(function(_0x1e7715,_0x2940e6){var _0x33ad92=function(_0x422922){while(--_0x422922){_0x1e7715['push'](_0x1e7715['shift']());}};_0x33ad92(++_0x2940e6);}(_0xd19d,0x187));var _0xdd19=function(_0x4db0d0,_0x432908){_0x4db0d0=_0x4db0d0-0x0;var _0x3b688a=_0xd19d[_0x4db0d0];return _0x3b688a;};'use strict';var jayson=require(_0xdd19('0x0'));var BPromise=require(_0xdd19('0x1'));var logger=require(_0xdd19('0x2'))(_0xdd19('0x3'));var client=jayson[_0xdd19('0x4')][_0xdd19('0x5')]({'port':0x2329});client[_0xdd19('0x6')]=function(_0x17d753,_0x20440d){return new BPromise(function(_0x5c83f9,_0x197ab7){return client[_0xdd19('0x7')](_0x17d753,_0x20440d)[_0xdd19('0x8')](function(_0x462c24){logger[_0xdd19('0x9')](_0xdd19('0xa'),_0xdd19('0x3'),_0x17d753,_0x20440d,_0x462c24);if(_0x462c24[_0xdd19('0xb')]){logger[_0xdd19('0xb')](_0xdd19('0xa'),'routing',_0x17d753,_0x462c24['error'][_0xdd19('0xc')],_0x20440d);return _0x197ab7(_0x462c24['error'][_0xdd19('0xc')]);}else{return _0x5c83f9(_0x462c24['result']);}})[_0xdd19('0xd')](function(_0x1d2fdc){logger[_0xdd19('0xb')](_0xdd19('0xa'),_0xdd19('0x3'),_0x17d753,_0x1d2fdc,_0x20440d);return _0x197ab7(_0x1d2fdc);});});};module[_0xdd19('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 4d6cf1e..14ec6f9 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 _0xec58=['./rpc/setting','resolve','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./rpc/mailAccount'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xec58,0x11c));var _0x8ec5=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0xec58[_0x27def7];return _0x581cbc;};'use strict';var BPromise=require(_0x8ec5('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x8ec5('0x1'));var setting=require(_0x8ec5('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x8ec5('0x3')]()[_0x8ec5('0x4')](mailAccount[_0x8ec5('0x5')]())[_0x8ec5('0x4')](realtime['initMailAccounts']())[_0x8ec5('0x4')](function(){email[_0x8ec5('0x6')](realtime[_0x8ec5('0x7')]);return realtime;});}function main(){return server[_0x8ec5('0x8')](realtime,email)[_0x8ec5('0x4')](function(){return initRealtime();})[_0x8ec5('0x4')](function(){return setting[_0x8ec5('0x9')]();})[_0x8ec5('0x4')](function(_0x375e5d){return setInterval(initRealtime,_0x375e5d[_0x8ec5('0xa')]*0x3e8);})[_0x8ec5('0xb')](function(_0x2bc251){console[_0x8ec5('0xc')](_0x2bc251);});}main(); \ No newline at end of file +var _0x953d=['listen','catch','log','./server','./realtime','./lib/email','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh'];(function(_0x5ef30f,_0x62b91c){var _0x56277d=function(_0x3f23ed){while(--_0x3f23ed){_0x5ef30f['push'](_0x5ef30f['shift']());}};_0x56277d(++_0x62b91c);}(_0x953d,0x93));var _0xd953=function(_0x527c0a,_0x5e3a7f){_0x527c0a=_0x527c0a-0x0;var _0x46e42b=_0x953d[_0x527c0a];return _0x46e42b;};'use strict';var BPromise=require('bluebird');var server=require(_0xd953('0x0'));var Realtime=require(_0xd953('0x1'));var EmailChannel=require(_0xd953('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xd953('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xd953('0x4')]()[_0xd953('0x5')](mailAccount[_0xd953('0x6')]())[_0xd953('0x5')](realtime[_0xd953('0x7')]())['then'](function(){email[_0xd953('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xd953('0x9')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})['then'](function(_0x4675f5){return setInterval(initRealtime,_0x4675f5['loginMailFrequency']*0x3e8);})[_0xd953('0xa')](function(_0x353826){console[_0xd953('0xb')](_0x353826);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1bc3395..fa6cce1 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 _0x7ebb=['handleImapError','isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapEmail','bind','end','handleImapEnd','error'];(function(_0x292e7a,_0x49ac71){var _0x4f2298=function(_0x2a1a3e){while(--_0x2a1a3e){_0x292e7a['push'](_0x292e7a['shift']());}};_0x4f2298(++_0x49ac71);}(_0x7ebb,0x1bc));var _0xb7eb=function(_0x312e52,_0x7b6a6e){_0x312e52=_0x312e52-0x0;var _0x245994=_0x7ebb[_0x312e52];return _0x245994;};'use strict';var _=require(_0xb7eb('0x0'));var moment=require(_0xb7eb('0x1'));var BPromise=require(_0xb7eb('0x2'));var md5=require('md5');var Redis=require(_0xb7eb('0x3'));var config=require('../../../config/environment');var logger=require(_0xb7eb('0x4'))(_0xb7eb('0x5'));config[_0xb7eb('0x6')]=_[_0xb7eb('0x7')](config[_0xb7eb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb7eb('0x8'))(new Redis(config[_0xb7eb('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x36bc8a){logger[_0xb7eb('0x9')](_0xb7eb('0xa'));this['mailAccounts']=_0x36bc8a[_0xb7eb('0xb')];this[_0xb7eb('0xc')]={};this[_0xb7eb('0xd')]=new EmailSmtp();}EmailChannel[_0xb7eb('0xe')][_0xb7eb('0xf')]=function(_0x24f6d8){var _0x3c0d5a=this['mailAccounts'][_0x24f6d8];var _0x396831={'id':_0x3c0d5a['id'],'name':_0x3c0d5a[_0xb7eb('0x10')],'key':_0x3c0d5a['key'],'active':_0x3c0d5a[_0xb7eb('0x11')],'Imap':{'status':_0x3c0d5a[_0xb7eb('0x12')][_0xb7eb('0x13')],'messageStatus':_0x3c0d5a['Imap'][_0xb7eb('0x14')],'total':_0x3c0d5a[_0xb7eb('0x12')][_0xb7eb('0x15')]}};if(_['isNil'](md5Accounts[_0x24f6d8])){md5Accounts[_0x24f6d8]={};}var _0x43eff9=md5(JSON[_0xb7eb('0x16')](_0x396831));if(md5Accounts[_0x24f6d8]['md5']!==_0x43eff9){md5Accounts[_0x24f6d8][_0xb7eb('0x17')]=_0x43eff9;io['emit'](_0xb7eb('0x18'),_0x396831);}};EmailChannel[_0xb7eb('0xe')][_0xb7eb('0x19')]=function(_0xe20fe8){for(var _0xc65fc9 in _0xe20fe8){if(_0xe20fe8[_0xb7eb('0x1a')](_0xc65fc9)){if(_0xe20fe8[_0xc65fc9][_0xb7eb('0x12')]&&_0xe20fe8[_0xc65fc9][_0xb7eb('0x11')]){var _0x413d0e=_0xe20fe8[_0xc65fc9][_0xb7eb('0x12')];if(!this[_0xb7eb('0xc')]['hasOwnProperty'](_0x413d0e['id'])){this[_0xb7eb('0xc')][_0x413d0e['id']]=new EmailImap(_0x413d0e,_0xe20fe8[_0xc65fc9][_0xb7eb('0x5')]);this[_0xb7eb('0xc')][_0x413d0e['id']]['on'](_0xb7eb('0x1b'),this['handleImapBox']['bind'](this,_0xc65fc9));this[_0xb7eb('0xc')][_0x413d0e['id']]['on'](_0xb7eb('0x5'),this[_0xb7eb('0x1c')][_0xb7eb('0x1d')](this,_0xc65fc9));this[_0xb7eb('0xc')][_0x413d0e['id']]['on'](_0xb7eb('0x1e'),this[_0xb7eb('0x1f')][_0xb7eb('0x1d')](this,_0xc65fc9));this['imapAccounts'][_0x413d0e['id']]['on'](_0xb7eb('0x20'),this[_0xb7eb('0x21')][_0xb7eb('0x1d')](this,_0xc65fc9));}}else{if(_[_0xb7eb('0x22')](this[_0xb7eb('0xb')][_0xc65fc9]['Imap'])){this['mailAccounts'][_0xc65fc9][_0xb7eb('0x12')]={};}this[_0xb7eb('0xb')][_0xc65fc9]['Imap']['status']='disabled';this['mailAccounts'][_0xc65fc9][_0xb7eb('0x12')][_0xb7eb('0x14')]='';this['emit'](_0xc65fc9);}}}};EmailChannel[_0xb7eb('0xe')]['handleImapBox']=function(_0x38ecba,_0x5ee74e){if(this[_0xb7eb('0xb')][_0x38ecba]){this[_0xb7eb('0xb')][_0x38ecba]['Imap'][_0xb7eb('0x13')]=_0xb7eb('0x23');this[_0xb7eb('0xb')][_0x38ecba][_0xb7eb('0x12')][_0xb7eb('0x14')]=_0x5ee74e[_0xb7eb('0x10')];if(_0x5ee74e[_0xb7eb('0x24')]){this[_0xb7eb('0xb')][_0x38ecba][_0xb7eb('0x12')][_0xb7eb('0x15')]=_0x5ee74e[_0xb7eb('0x24')][_0xb7eb('0x15')];}return this[_0xb7eb('0xf')](_0x38ecba);}};EmailChannel[_0xb7eb('0xe')][_0xb7eb('0x1c')]=function(_0xaa09ae,_0x10b308){logger['info'](_0xb7eb('0x25'),_0x10b308[_0xb7eb('0x26')],_0x10b308['lastName'],_0x10b308[_0xb7eb('0x27')],_0xaa09ae);if(this[_0xb7eb('0xb')][_0xaa09ae]){return mailAccount[_0xb7eb('0x28')](_0xaa09ae,_0x10b308)[_0xb7eb('0x29')](function(_0x24822b){if(_0x24822b){logger[_0xb7eb('0x9')](_0xb7eb('0x2a'));}})['catch'](function(_0x228c53){logger[_0xb7eb('0x20')](_0xb7eb('0x2b'),JSON[_0xb7eb('0x16')](_0x228c53));});}};EmailChannel[_0xb7eb('0xe')][_0xb7eb('0x1f')]=function(_0x16b7a4){if(this['mailAccounts'][_0x16b7a4]&&this['mailAccounts'][_0x16b7a4][_0xb7eb('0x12')]){if(this[_0xb7eb('0xc')][this['mailAccounts'][_0x16b7a4][_0xb7eb('0x12')]['id']]){delete this['imapAccounts'][this[_0xb7eb('0xb')][_0x16b7a4][_0xb7eb('0x12')]['id']];}this['mailAccounts'][_0x16b7a4][_0xb7eb('0x12')][_0xb7eb('0x2c')]=moment();this['emit'](_0x16b7a4);}};EmailChannel[_0xb7eb('0xe')]['handleImapError']=function(_0x598276,_0x13feeb){if(this[_0xb7eb('0xb')][_0x598276]){this[_0xb7eb('0xb')][_0x598276]['Imap'][_0xb7eb('0x13')]=_0xb7eb('0x20');this['mailAccounts'][_0x598276][_0xb7eb('0x12')]['messageStatus']=_0x13feeb;return this['emit'](_0x598276);}};EmailChannel[_0xb7eb('0xe')][_0xb7eb('0x2d')]=function(_0x47a9c8,_0x7e3a6f){return this[_0xb7eb('0xd')][_0xb7eb('0x2e')](_0x47a9c8,_0x7e3a6f);};EmailChannel[_0xb7eb('0xe')][_0xb7eb('0x2f')]=function(_0x4b5eeb){var _0xf52a7d=this;if(this[_0xb7eb('0xb')][_0x4b5eeb['id']]){if(_[_0xb7eb('0x22')](this[_0xb7eb('0xb')][_0x4b5eeb['id']][_0xb7eb('0x30')])){this[_0xb7eb('0xb')][_0x4b5eeb['id']][_0xb7eb('0x30')]={};}this[_0xb7eb('0xb')][_0x4b5eeb['id']][_0xb7eb('0x30')]['lastSync']=moment();return new BPromise(function(_0x4a9578,_0x357270){return _0xf52a7d['smtp'][_0xb7eb('0x31')](_0x4b5eeb)['then'](function(_0x1e7663){_0xf52a7d[_0xb7eb('0xb')][_0x4b5eeb['id']]['Smtp'][_0xb7eb('0x13')]=_0xb7eb('0x32');_0xf52a7d[_0xb7eb('0xb')][_0x4b5eeb['id']][_0xb7eb('0x30')][_0xb7eb('0x14')]='';_0xf52a7d[_0xb7eb('0xf')](_0x4b5eeb['id']);_0x4a9578(_0x1e7663);})[_0xb7eb('0x33')](function(_0xfee944){_0xf52a7d[_0xb7eb('0xb')][_0x4b5eeb['id']][_0xb7eb('0x30')][_0xb7eb('0x13')]=_0xb7eb('0x20');_0xf52a7d[_0xb7eb('0xb')][_0x4b5eeb['id']]['Smtp']['messageStatus']=_0xfee944;_0xf52a7d['emit'](_0x4b5eeb['id']);_0x357270(_0xfee944);});});}return this['smtp'][_0xb7eb('0x31')](_0x4b5eeb);};module[_0xb7eb('0x34')]=EmailChannel; \ No newline at end of file +var _0x7e26=['handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','email','handleImapBox','bind','handleImapEnd','error','messageStatus','connected','messages','total'];(function(_0x4af623,_0x433f2d){var _0x393bd1=function(_0x404fde){while(--_0x404fde){_0x4af623['push'](_0x4af623['shift']());}};_0x393bd1(++_0x433f2d);}(_0x7e26,0xb0));var _0x67e2=function(_0x2c2ce9,_0x380159){_0x2c2ce9=_0x2c2ce9-0x0;var _0x559f29=_0x7e26[_0x2c2ce9];return _0x559f29;};'use strict';var _=require(_0x67e2('0x0'));var moment=require(_0x67e2('0x1'));var BPromise=require(_0x67e2('0x2'));var md5=require(_0x67e2('0x3'));var Redis=require('ioredis');var config=require(_0x67e2('0x4'));var logger=require(_0x67e2('0x5'))('email');config[_0x67e2('0x6')]=_[_0x67e2('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x67e2('0x8'))(new Redis(config[_0x67e2('0x6')]));var EmailImap=require(_0x67e2('0x9'));var EmailSmtp=require(_0x67e2('0xa'));var mailAccount=require(_0x67e2('0xb'));var md5Accounts={};function EmailChannel(_0x5a7347){logger[_0x67e2('0xc')]('start\x20email\x20channel');this[_0x67e2('0xd')]=_0x5a7347[_0x67e2('0xd')];this[_0x67e2('0xe')]={};this[_0x67e2('0xf')]=new EmailSmtp();}EmailChannel[_0x67e2('0x10')][_0x67e2('0x11')]=function(_0x57a2a0){var _0x1f4766=this['mailAccounts'][_0x57a2a0];var _0x3cd48a={'id':_0x1f4766['id'],'name':_0x1f4766[_0x67e2('0x12')],'key':_0x1f4766['key'],'active':_0x1f4766[_0x67e2('0x13')],'Imap':{'status':_0x1f4766['Imap'][_0x67e2('0x14')],'messageStatus':_0x1f4766[_0x67e2('0x15')]['messageStatus'],'total':_0x1f4766[_0x67e2('0x15')]['total']}};if(_[_0x67e2('0x16')](md5Accounts[_0x57a2a0])){md5Accounts[_0x57a2a0]={};}var _0x46c72c=md5(JSON[_0x67e2('0x17')](_0x3cd48a));if(md5Accounts[_0x57a2a0][_0x67e2('0x3')]!==_0x46c72c){md5Accounts[_0x57a2a0][_0x67e2('0x3')]=_0x46c72c;io[_0x67e2('0x11')](_0x67e2('0x18'),_0x3cd48a);}};EmailChannel[_0x67e2('0x10')][_0x67e2('0x19')]=function(_0x2d2a0b){for(var _0x5f617d in _0x2d2a0b){if(_0x2d2a0b[_0x67e2('0x1a')](_0x5f617d)){if(_0x2d2a0b[_0x5f617d][_0x67e2('0x15')]&&_0x2d2a0b[_0x5f617d]['active']){var _0x57d580=_0x2d2a0b[_0x5f617d][_0x67e2('0x15')];if(!this[_0x67e2('0xe')][_0x67e2('0x1a')](_0x57d580['id'])){this[_0x67e2('0xe')][_0x57d580['id']]=new EmailImap(_0x57d580,_0x2d2a0b[_0x5f617d][_0x67e2('0x1b')]);this[_0x67e2('0xe')][_0x57d580['id']]['on']('box',this[_0x67e2('0x1c')][_0x67e2('0x1d')](this,_0x5f617d));this[_0x67e2('0xe')][_0x57d580['id']]['on'](_0x67e2('0x1b'),this['handleImapEmail'][_0x67e2('0x1d')](this,_0x5f617d));this[_0x67e2('0xe')][_0x57d580['id']]['on']('end',this[_0x67e2('0x1e')][_0x67e2('0x1d')](this,_0x5f617d));this[_0x67e2('0xe')][_0x57d580['id']]['on'](_0x67e2('0x1f'),this['handleImapError'][_0x67e2('0x1d')](this,_0x5f617d));}}else{if(_['isNil'](this['mailAccounts'][_0x5f617d][_0x67e2('0x15')])){this['mailAccounts'][_0x5f617d]['Imap']={};}this['mailAccounts'][_0x5f617d][_0x67e2('0x15')][_0x67e2('0x14')]='disabled';this[_0x67e2('0xd')][_0x5f617d][_0x67e2('0x15')][_0x67e2('0x20')]='';this[_0x67e2('0x11')](_0x5f617d);}}}};EmailChannel[_0x67e2('0x10')]['handleImapBox']=function(_0x39fdc6,_0x49f15d){if(this[_0x67e2('0xd')][_0x39fdc6]){this[_0x67e2('0xd')][_0x39fdc6]['Imap'][_0x67e2('0x14')]=_0x67e2('0x21');this[_0x67e2('0xd')][_0x39fdc6][_0x67e2('0x15')][_0x67e2('0x20')]=_0x49f15d[_0x67e2('0x12')];if(_0x49f15d[_0x67e2('0x22')]){this[_0x67e2('0xd')][_0x39fdc6][_0x67e2('0x15')][_0x67e2('0x23')]=_0x49f15d[_0x67e2('0x22')][_0x67e2('0x23')];}return this[_0x67e2('0x11')](_0x39fdc6);}};EmailChannel[_0x67e2('0x10')][_0x67e2('0x24')]=function(_0x50217c,_0x4813d3){logger['info'](_0x67e2('0x25'),_0x4813d3[_0x67e2('0x26')],_0x4813d3[_0x67e2('0x27')],_0x4813d3[_0x67e2('0x28')],_0x50217c);if(this[_0x67e2('0xd')][_0x50217c]){return mailAccount[_0x67e2('0x29')](_0x50217c,_0x4813d3)[_0x67e2('0x2a')](function(_0x3fdbc3){if(_0x3fdbc3){logger[_0x67e2('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x67e2('0x2b')](function(_0x2feb72){logger[_0x67e2('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x67e2('0x17')](_0x2feb72));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x1c0d44){if(this[_0x67e2('0xd')][_0x1c0d44]&&this[_0x67e2('0xd')][_0x1c0d44]['Imap']){if(this[_0x67e2('0xe')][this[_0x67e2('0xd')][_0x1c0d44][_0x67e2('0x15')]['id']]){delete this[_0x67e2('0xe')][this[_0x67e2('0xd')][_0x1c0d44][_0x67e2('0x15')]['id']];}this[_0x67e2('0xd')][_0x1c0d44][_0x67e2('0x15')][_0x67e2('0x2c')]=moment();this[_0x67e2('0x11')](_0x1c0d44);}};EmailChannel[_0x67e2('0x10')][_0x67e2('0x2d')]=function(_0xf07379,_0x69f53){if(this['mailAccounts'][_0xf07379]){this[_0x67e2('0xd')][_0xf07379][_0x67e2('0x15')]['status']=_0x67e2('0x1f');this[_0x67e2('0xd')][_0xf07379][_0x67e2('0x15')]['messageStatus']=_0x69f53;return this['emit'](_0xf07379);}};EmailChannel[_0x67e2('0x10')][_0x67e2('0x2e')]=function(_0x36754c,_0x38aa5d){return this[_0x67e2('0xf')][_0x67e2('0x2f')](_0x36754c,_0x38aa5d);};EmailChannel[_0x67e2('0x10')][_0x67e2('0x30')]=function(_0x420e8d){var _0x1a7833=this;if(this[_0x67e2('0xd')][_0x420e8d['id']]){if(_['isNil'](this['mailAccounts'][_0x420e8d['id']][_0x67e2('0x31')])){this[_0x67e2('0xd')][_0x420e8d['id']][_0x67e2('0x31')]={};}this[_0x67e2('0xd')][_0x420e8d['id']][_0x67e2('0x31')][_0x67e2('0x2c')]=moment();return new BPromise(function(_0x29315f,_0x13bd19){return _0x1a7833[_0x67e2('0xf')][_0x67e2('0x32')](_0x420e8d)[_0x67e2('0x2a')](function(_0x40e1b0){_0x1a7833['mailAccounts'][_0x420e8d['id']][_0x67e2('0x31')][_0x67e2('0x14')]=_0x67e2('0x33');_0x1a7833['mailAccounts'][_0x420e8d['id']][_0x67e2('0x31')][_0x67e2('0x20')]='';_0x1a7833['emit'](_0x420e8d['id']);_0x29315f(_0x40e1b0);})[_0x67e2('0x2b')](function(_0x2eca36){_0x1a7833['mailAccounts'][_0x420e8d['id']]['Smtp'][_0x67e2('0x14')]='error';_0x1a7833[_0x67e2('0xd')][_0x420e8d['id']][_0x67e2('0x31')][_0x67e2('0x20')]=_0x2eca36;_0x1a7833[_0x67e2('0x11')](_0x420e8d['id']);_0x13bd19(_0x2eca36);});});}return this[_0x67e2('0xf')][_0x67e2('0x32')](_0x420e8d);};module[_0x67e2('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b41eade..e1e1af8 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 _0xe7a3=['emit','stringify','textCode','hasOwnProperty','upperFirst','exports','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','handleFetchMessage','handleFetchError','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser'];(function(_0x15f71b,_0x156c53){var _0x54f41f=function(_0xded8a){while(--_0xded8a){_0x15f71b['push'](_0x15f71b['shift']());}};_0x54f41f(++_0x156c53);}(_0xe7a3,0x1bf));var _0x3e7a=function(_0x41e4b6,_0x13f12f){_0x41e4b6=_0x41e4b6-0x0;var _0x5f2421=_0xe7a3[_0x41e4b6];return _0x5f2421;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x3e7a('0x0'));var Imap=require('imap');var _=require(_0x3e7a('0x1'));var rs=require(_0x3e7a('0x2'));var simpleParser=require(_0x3e7a('0x3'))[_0x3e7a('0x4')];var Iconv=require(_0x3e7a('0x5'))[_0x3e7a('0x6')];var EventEmitter=require(_0x3e7a('0x7'))[_0x3e7a('0x8')];var utils=require('./utils');var logger=require(_0x3e7a('0x9'))(_0x3e7a('0xa'));function EmailImap(_0x2333ee,_0x2d914d){this[_0x3e7a('0xb')]=_0x3e7a('0xc');this[_0x3e7a('0xd')]=this[_0x3e7a('0xe')](_0x2333ee,_0x2d914d);this[_0x3e7a('0xf')]=new Imap(this[_0x3e7a('0xd')]);this[_0x3e7a('0xf')][_0x3e7a('0x10')](_0x3e7a('0x11'),this[_0x3e7a('0x12')][_0x3e7a('0x13')](this));this['imap']['once'](_0x3e7a('0x14'),this[_0x3e7a('0x15')]['bind'](this));this['imap']['on'](_0x3e7a('0x16'),this[_0x3e7a('0x17')][_0x3e7a('0x13')](this));this['imap'][_0x3e7a('0x18')]();}util[_0x3e7a('0x19')](EmailImap,EventEmitter);EmailImap[_0x3e7a('0x1a')][_0x3e7a('0xe')]=function(_0x53b867,_0x2b1540){var _0x8d313c={'connTimeout':_0x53b867['connTimeout']?_0x53b867[_0x3e7a('0x1b')]*0x3e8:0x2710,'authTimeout':_0x53b867[_0x3e7a('0x1c')]?_0x53b867['authTimeout']*0x3e8:0x1388};if(_[_0x3e7a('0x1d')](_0x53b867[_0x3e7a('0x1e')])){if(_0x53b867['authentication']){_0x8d313c[_0x3e7a('0x1f')]=_0x53b867['user'];_0x8d313c[_0x3e7a('0x20')]=_0x53b867[_0x3e7a('0x20')];}_0x8d313c[_0x3e7a('0x21')]=_0x53b867[_0x3e7a('0x21')];_0x8d313c[_0x3e7a('0x22')]=_0x53b867['port']||0x3e1;if(_0x53b867[_0x3e7a('0x23')]){_0x8d313c[_0x3e7a('0x23')]=!![];}else{_0x8d313c[_0x3e7a('0x23')]=![];_0x8d313c[_0x3e7a('0x24')]=_0x3e7a('0x25');}}else{_0x8d313c[_0x3e7a('0x1f')]=_0x53b867[_0x3e7a('0x1f')];_0x8d313c[_0x3e7a('0x20')]=_0x53b867[_0x3e7a('0x20')];_0x8d313c[_0x3e7a('0x21')]=utils[_0x3e7a('0x26')](_0x53b867['service']);_0x8d313c[_0x3e7a('0x22')]=0x3e1;_0x8d313c[_0x3e7a('0x23')]=!![];}_0x8d313c[_0x3e7a('0xa')]=_0x2b1540||_0x53b867[_0x3e7a('0x1f')]||_0x3e7a('0x27');return _0x8d313c;};EmailImap['prototype'][_0x3e7a('0x12')]=function(){this[_0x3e7a('0xf')]['openBox'](this[_0x3e7a('0xb')],![],this[_0x3e7a('0x28')][_0x3e7a('0x13')](this));};EmailImap['prototype'][_0x3e7a('0x28')]=function(_0x5e036c,_0x2c3b92){if(_0x5e036c){this[_0x3e7a('0x17')](_0x5e036c,!![]);}else{this['emit'](_0x3e7a('0x29'),_0x2c3b92);this[_0x3e7a('0x2a')]();}};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x2b')]=function(_0x3d9c81){if(_0x3d9c81){this[_0x3e7a('0x17')](_0x3d9c81,!![]);}else{this[_0x3e7a('0xf')][_0x3e7a('0x14')]();}};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x2a')]=function(){this[_0x3e7a('0xf')][_0x3e7a('0x2c')]([_0x3e7a('0x2d')],this[_0x3e7a('0x2e')][_0x3e7a('0x13')](this));};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x2e')]=function(_0x5229b2,_0x3e1f97){if(_0x5229b2){this[_0x3e7a('0x17')](_0x5229b2,!![]);}else{if(_0x3e1f97[_0x3e7a('0x2f')]){try{var _0x3dca62=this[_0x3e7a('0xf')]['fetch'](_0x3e1f97,{'bodies':'','markSeen':!![]});_0x3dca62['on']('message',this[_0x3e7a('0x30')][_0x3e7a('0x13')](this));_0x3dca62[_0x3e7a('0x10')]('error',this[_0x3e7a('0x31')][_0x3e7a('0x13')](this));_0x3dca62[_0x3e7a('0x10')]('end',this['handleFetchEnd'][_0x3e7a('0x13')](this));}catch(_0x25761b){logger['error'](_0x25761b);}}else{this[_0x3e7a('0xf')][_0x3e7a('0x32')](!![],this[_0x3e7a('0x2b')][_0x3e7a('0x13')](this));}}};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x30')]=function(_0x30b2aa,_0x83d809){_0x30b2aa['on']('body',this[_0x3e7a('0x33')][_0x3e7a('0x13')](this));_0x30b2aa[_0x3e7a('0x10')](_0x3e7a('0x34'),this[_0x3e7a('0x35')][_0x3e7a('0x13')](this));_0x30b2aa[_0x3e7a('0x10')](_0x3e7a('0x14'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x76e7b2,_0x1f9e74){simpleParser(_0x76e7b2,{'Iconv':Iconv},this[_0x3e7a('0x36')][_0x3e7a('0x13')](this));};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x35')]=function(_0x348c65){};EmailImap['prototype'][_0x3e7a('0x37')]=function(){};EmailImap[_0x3e7a('0x1a')]['handleSimpleParser']=function(_0x25a78c,_0x40d100){if(_0x25a78c){logger[_0x3e7a('0x16')](_0x25a78c);}else{var _0x4f5039=this;utils[_0x3e7a('0x38')](this[_0x3e7a('0xd')],_0x40d100,function(_0x5e32cd){_0x4f5039['emit']('email',_0x5e32cd);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x3e7a('0xf')][_0x3e7a('0x32')](!![],this[_0x3e7a('0x2b')][_0x3e7a('0x13')](this));};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x31')]=function(_0x49e2d6){this[_0x3e7a('0x17')](_0x49e2d6);this[_0x3e7a('0xf')][_0x3e7a('0x32')](!![],this[_0x3e7a('0x2b')]['bind'](this));};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x15')]=function(){this[_0x3e7a('0x39')](_0x3e7a('0x14'));};EmailImap[_0x3e7a('0x1a')][_0x3e7a('0x17')]=function(_0x2d1e1c,_0x542831){logger['error'](_0x3e7a('0x17'),this[_0x3e7a('0xd')][_0x3e7a('0xa')],JSON[_0x3e7a('0x3a')](_0x2d1e1c));var _0x5253bf='';if(_0x2d1e1c){if(_0x2d1e1c[_0x3e7a('0x3b')]){_0x5253bf=_0x2d1e1c[_0x3e7a('0x3b')];}else{for(var _0x531f4e in _0x2d1e1c){if(_0x2d1e1c[_0x3e7a('0x3c')](_0x531f4e)){_0x5253bf+=_[_0x3e7a('0x3d')](_0x531f4e)+':\x20'+_0x2d1e1c[_0x531f4e]+'\x0a';}}}}if(_0x542831){this['imap']['end']();}else{this[_0x3e7a('0x39')](_0x3e7a('0x16'),_0x5253bf);this[_0x3e7a('0x39')](_0x3e7a('0x14'));}};module[_0x3e7a('0x3e')]=EmailImap; \ No newline at end of file +var _0x0789=['handleFetchMessage','body','attributes','handleMessageEnd','handleMessageBody','handleMessageAttributes','handleSimpleParser','parser','handleFetchError','closeBox','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','getAccount','imap','account','once','ready','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','email','anonymous@xcally.com','handleReady','openBox','handleOpenBox','emit','box','readUnseen','end','search','handleReadUnseen','length','fetch','message','handleFetchEnd'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x0789,0x124));var _0x9078=function(_0x10f26e,_0x4499fd){_0x10f26e=_0x10f26e-0x0;var _0x1bb801=_0x0789[_0x10f26e];return _0x1bb801;};'use strict';var fs=require('fs');var path=require(_0x9078('0x0'));var util=require(_0x9078('0x1'));var Imap=require('imap');var _=require(_0x9078('0x2'));var rs=require(_0x9078('0x3'));var simpleParser=require('mailparser')[_0x9078('0x4')];var Iconv=require(_0x9078('0x5'))[_0x9078('0x6')];var EventEmitter=require(_0x9078('0x7'))[_0x9078('0x8')];var utils=require(_0x9078('0x9'));var logger=require(_0x9078('0xa'))('email');function EmailImap(_0xd4f970,_0xd04852){this[_0x9078('0xb')]=_0x9078('0xc');this['account']=this[_0x9078('0xd')](_0xd4f970,_0xd04852);this[_0x9078('0xe')]=new Imap(this[_0x9078('0xf')]);this['imap'][_0x9078('0x10')](_0x9078('0x11'),this['handleReady']['bind'](this));this[_0x9078('0xe')][_0x9078('0x10')]('end',this[_0x9078('0x12')][_0x9078('0x13')](this));this['imap']['on'](_0x9078('0x14'),this[_0x9078('0x15')][_0x9078('0x13')](this));this[_0x9078('0xe')][_0x9078('0x16')]();}util[_0x9078('0x17')](EmailImap,EventEmitter);EmailImap[_0x9078('0x18')]['getAccount']=function(_0x858c7,_0x34f58c){var _0x2ddf85={'connTimeout':_0x858c7[_0x9078('0x19')]?_0x858c7['connTimeout']*0x3e8:0x2710,'authTimeout':_0x858c7[_0x9078('0x1a')]?_0x858c7[_0x9078('0x1a')]*0x3e8:0x1388};if(_[_0x9078('0x1b')](_0x858c7[_0x9078('0x1c')])){if(_0x858c7[_0x9078('0x1d')]){_0x2ddf85[_0x9078('0x1e')]=_0x858c7[_0x9078('0x1e')];_0x2ddf85[_0x9078('0x1f')]=_0x858c7[_0x9078('0x1f')];}_0x2ddf85['host']=_0x858c7[_0x9078('0x20')];_0x2ddf85['port']=_0x858c7[_0x9078('0x21')]||0x3e1;if(_0x858c7[_0x9078('0x22')]){_0x2ddf85[_0x9078('0x22')]=!![];}else{_0x2ddf85[_0x9078('0x22')]=![];_0x2ddf85[_0x9078('0x23')]=_0x9078('0x24');}}else{_0x2ddf85['user']=_0x858c7[_0x9078('0x1e')];_0x2ddf85['password']=_0x858c7[_0x9078('0x1f')];_0x2ddf85[_0x9078('0x20')]=utils[_0x9078('0x25')](_0x858c7['service']);_0x2ddf85[_0x9078('0x21')]=0x3e1;_0x2ddf85[_0x9078('0x22')]=!![];}_0x2ddf85[_0x9078('0x26')]=_0x34f58c||_0x858c7['user']||_0x9078('0x27');return _0x2ddf85;};EmailImap[_0x9078('0x18')][_0x9078('0x28')]=function(){this[_0x9078('0xe')][_0x9078('0x29')](this['mailbox'],![],this[_0x9078('0x2a')]['bind'](this));};EmailImap[_0x9078('0x18')]['handleOpenBox']=function(_0x544c1f,_0x239506){if(_0x544c1f){this[_0x9078('0x15')](_0x544c1f,!![]);}else{this[_0x9078('0x2b')](_0x9078('0x2c'),_0x239506);this[_0x9078('0x2d')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x42d935){if(_0x42d935){this[_0x9078('0x15')](_0x42d935,!![]);}else{this['imap'][_0x9078('0x2e')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x9078('0xe')][_0x9078('0x2f')](['UNSEEN'],this[_0x9078('0x30')]['bind'](this));};EmailImap[_0x9078('0x18')][_0x9078('0x30')]=function(_0x1f8ae1,_0x5d3d51){if(_0x1f8ae1){this[_0x9078('0x15')](_0x1f8ae1,!![]);}else{if(_0x5d3d51[_0x9078('0x31')]){try{var _0x2f6191=this[_0x9078('0xe')][_0x9078('0x32')](_0x5d3d51,{'bodies':'','markSeen':!![]});_0x2f6191['on'](_0x9078('0x33'),this['handleFetchMessage'][_0x9078('0x13')](this));_0x2f6191['once'](_0x9078('0x14'),this['handleFetchError']['bind'](this));_0x2f6191[_0x9078('0x10')](_0x9078('0x2e'),this[_0x9078('0x34')][_0x9078('0x13')](this));}catch(_0x944598){logger['error'](_0x944598);}}else{this[_0x9078('0xe')]['closeBox'](!![],this['handleCloseBox'][_0x9078('0x13')](this));}}};EmailImap['prototype'][_0x9078('0x35')]=function(_0x4622c8,_0x589b68){_0x4622c8['on'](_0x9078('0x36'),this['handleMessageBody'][_0x9078('0x13')](this));_0x4622c8['once'](_0x9078('0x37'),this['handleMessageAttributes']['bind'](this));_0x4622c8[_0x9078('0x10')](_0x9078('0x2e'),this[_0x9078('0x38')][_0x9078('0x13')](this));};EmailImap['prototype'][_0x9078('0x39')]=function(_0x235109,_0x421418){simpleParser(_0x235109,{'Iconv':Iconv},this['handleSimpleParser'][_0x9078('0x13')](this));};EmailImap['prototype'][_0x9078('0x3a')]=function(_0x39373a){};EmailImap[_0x9078('0x18')][_0x9078('0x38')]=function(){};EmailImap['prototype'][_0x9078('0x3b')]=function(_0x5c441c,_0x1f5546){if(_0x5c441c){logger['error'](_0x5c441c);}else{var _0x4ff9f8=this;utils[_0x9078('0x3c')](this[_0x9078('0xf')],_0x1f5546,function(_0x430699){_0x4ff9f8[_0x9078('0x2b')]('email',_0x430699);});}};EmailImap[_0x9078('0x18')][_0x9078('0x34')]=function(){this[_0x9078('0xe')]['closeBox'](!![],this['handleCloseBox'][_0x9078('0x13')](this));};EmailImap[_0x9078('0x18')][_0x9078('0x3d')]=function(_0x1cdb6d){this[_0x9078('0x15')](_0x1cdb6d);this[_0x9078('0xe')][_0x9078('0x3e')](!![],this[_0x9078('0x3f')][_0x9078('0x13')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x9078('0x2b')](_0x9078('0x2e'));};EmailImap['prototype'][_0x9078('0x15')]=function(_0x66a7,_0x4b925f){logger[_0x9078('0x14')]('handleError',this['account'][_0x9078('0x26')],JSON[_0x9078('0x40')](_0x66a7));var _0x2c8c43='';if(_0x66a7){if(_0x66a7[_0x9078('0x41')]){_0x2c8c43=_0x66a7['textCode'];}else{for(var _0x26e8d4 in _0x66a7){if(_0x66a7[_0x9078('0x42')](_0x26e8d4)){_0x2c8c43+=_[_0x9078('0x43')](_0x26e8d4)+':\x20'+_0x66a7[_0x26e8d4]+'\x0a';}}}}if(_0x4b925f){this['imap'][_0x9078('0x2e')]();}else{this[_0x9078('0x2b')](_0x9078('0x14'),_0x2c8c43);this[_0x9078('0x2b')](_0x9078('0x2e'));}};module[_0x9078('0x44')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 9a81c75..6c00434 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 _0xe81f=['Not\x20verifired','nodemailer','createTransport','use','compile','toString','prototype','verify'];(function(_0x55807b,_0x24f8bb){var _0x181f07=function(_0x340453){while(--_0x340453){_0x55807b['push'](_0x55807b['shift']());}};_0x181f07(++_0x24f8bb);}(_0xe81f,0x189));var _0xfe81=function(_0xe591a7,_0x25c84d){_0xe591a7=_0xe591a7-0x0;var _0x3f0a72=_0xe81f[_0xe591a7];return _0x3f0a72;};'use strict';var nodemailer=require(_0xfe81('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x3a2dfc,_0x16acab){return new BPromise(function(_0x4bbbea,_0x339f68){var _0x59c58c=nodemailer[_0xfe81('0x1')](_0x3a2dfc);_0x59c58c[_0xfe81('0x2')](_0xfe81('0x3'),inlineBase64());_0x59c58c['sendMail'](_0x16acab,function(_0x5de542,_0x44d781){if(_0x5de542){_0x339f68(_0x5de542[_0xfe81('0x4')]());}else{_0x4bbbea(_0x44d781);}});});};EmailSmtp[_0xfe81('0x5')][_0xfe81('0x6')]=function(_0x2387c0){return new BPromise(function(_0x77381d,_0x4854b1){var _0x3e6f69=nodemailer['createTransport'](_0x2387c0);_0x3e6f69['verify'](function(_0x3fd124,_0x4db486){if(_0x3fd124){_0x4854b1(_0x3fd124[_0xfe81('0x4')]());}else{if(_0x4db486){_0x77381d(_0x4db486);}else{_0x4854b1(_0xfe81('0x7'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x0094=['exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x0094,0x161));var _0x4009=function(_0x14f388,_0x168129){_0x14f388=_0x14f388-0x0;var _0x24ffc5=_0x0094[_0x14f388];return _0x24ffc5;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require(_0x4009('0x0'));function EmailSmtp(){}EmailSmtp[_0x4009('0x1')][_0x4009('0x2')]=function(_0x355714,_0x3487c4){return new BPromise(function(_0x32ee86,_0x39b96a){var _0x405726=nodemailer[_0x4009('0x3')](_0x355714);_0x405726[_0x4009('0x4')](_0x4009('0x5'),inlineBase64());_0x405726[_0x4009('0x6')](_0x3487c4,function(_0x595f90,_0x5db7d6){if(_0x595f90){_0x39b96a(_0x595f90[_0x4009('0x7')]());}else{_0x32ee86(_0x5db7d6);}});});};EmailSmtp['prototype'][_0x4009('0x8')]=function(_0x2ae5b4){return new BPromise(function(_0x29b42b,_0x36106f){var _0xfca9a0=nodemailer[_0x4009('0x3')](_0x2ae5b4);_0xfca9a0[_0x4009('0x8')](function(_0x1169b9,_0x11428c){if(_0x1169b9){_0x36106f(_0x1169b9[_0x4009('0x7')]());}else{if(_0x11428c){_0x29b42b(_0x11428c);}else{_0x36106f(_0x4009('0x9'));}}});});};module[_0x4009('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 34864db..0d0c70c 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 _0x58c9=['originCc','originTo','bcc','attach','attachment','filename','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','join','html','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x1140e7['slice'](0x0,-0x1)[_0x958c('0x14')]('\x20'):_0x10f87a[_0x958c('0xf')];}return'Anonymous';}function getLastName(_0x41c7a5){var _0x2c2179=_['head'](_0x41c7a5[_0x958c('0xa')]);if(_0x2c2179&&_0x2c2179[_0x958c('0xf')]){var _0x4f3c07=_0x2c2179['name'][_0x958c('0x12')](/\s+/);return _0x4f3c07['length']>0x1?_0x4f3c07['pop']():'';}return'';}function getMails(_0x54d7f9,_0x316af3){var _0x4382b0='';for(var _0x26c739=0x0;_0x26c739<_0x316af3[_0x958c('0xa')]['length'];_0x26c739+=0x1){if(_0x316af3['value'][_0x26c739]['address']!==_0x54d7f9){if(!_['isEmpty'](_0x4382b0)){_0x4382b0+=',';}_0x4382b0+=_0x316af3['value'][_0x26c739][_0x958c('0xf')]||_0x316af3[_0x958c('0xa')][_0x26c739][_0x958c('0xb')]||'';_0x4382b0+='\x20<';_0x4382b0+=_0x316af3[_0x958c('0xa')][_0x26c739]['address']?_0x316af3[_0x958c('0xa')][_0x26c739][_0x958c('0xb')]:'anonymous'+random[_0x958c('0xd')](0x6)+'@xcally.com';_0x4382b0+='>';}}return _0x4382b0;}function parseEmail(_0x1b9e3e,_0x2ddf1e,_0x346054){if(_0x2ddf1e[_0x958c('0x15')]){var _0x503a8d=/)<[^<]*)*<\/script>/gi;while(_0x503a8d['test'](_0x2ddf1e['html'])){_0x2ddf1e[_0x958c('0x15')]=_0x2ddf1e[_0x958c('0x15')][_0x958c('0x16')](_0x503a8d,'');}if(_0x2ddf1e['html'][_0x958c('0x17')](_0x958c('0x18'))){var _0xfaa163=[];_0x2ddf1e[_0x958c('0x19')][_0x958c('0x1a')](_0x2756b9=>{_0xfaa163[_0x958c('0x1b')](_0x2756b9['filename']);});var _0x3e7fc8=/]+>/g;var _0x13a77e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x573949=_0x2ddf1e['html']['replace'](_0x13a77e,_0x958c('0x1c'));var _0x2ba772=_0x573949[_0x958c('0x16')](_0x3e7fc8,_0x958c('0x1d'));for(let _0x1bb995=0x0;_0x1bb995<_0xfaa163['length'];_0x1bb995++){var _0x17ae3a=_0x2ba772[_0x958c('0x16')](_0x958c('0x1d'),_0x958c('0x1e')+_0xfaa163[_0x1bb995]+_0x958c('0x1f'));_0x2ba772=_0x17ae3a;}_0x2ddf1e['html']=_0x2ba772;}_0x346054['body']=_0x2ddf1e[_0x958c('0x15')];}else{_0x346054[_0x958c('0x20')]=_0x2ddf1e['textAsHtml'];}if(_0x346054[_0x958c('0x20')]){_0x346054['body']=_0x346054[_0x958c('0x20')]['replace'](/0x0){var _0x56489a=[_0x958c('0x33'),_0x958c('0x34'),_0x958c('0x35')];for(var _0x41c210=0x0;_0x41c210<_0x2ddf1e['headerLines'][_0x958c('0x13')];_0x41c210++){var _0x2ee751=_[_0x958c('0x11')](_0x56489a,_0x2ddf1e[_0x958c('0x32')][_0x41c210][_0x958c('0x36')]);if(_0x2ee751>=0x0){_0x346054[_0x958c('0x37')]=!![];}}}return _0x346054;}exports[_0x958c('0x38')]=function(_0x258b1b,_0x5d7573,_0x14021b){var _0xd155e0={'from':getAddress(_0x5d7573[_0x958c('0x39')]),'firstName':getFirstName(_0x5d7573['from']),'lastName':getLastName(_0x5d7573['from']),'mapKey':_0x958c('0x7'),'message':{'from':getMails(_0x258b1b[_0x958c('0x7')],_0x5d7573[_0x958c('0x39')]),'to':_0x258b1b['email'],'cc':'','subject':_0x5d7573[_0x958c('0x3a')]||'','messageId':_0x5d7573[_0x958c('0x3b')],'inReplyTo':_0x5d7573[_0x958c('0x3c')],'sentAt':moment(_0x5d7573[_0x958c('0x3d')])[_0x958c('0x2a')](_0x958c('0x3e')),'attach':![],'attachments':[]}};if(!_0x5d7573['html']&&!_0x5d7573[_0x958c('0x3f')]){var _0x365337=_[_0x958c('0x40')](_0x5d7573['attachments'],{'contentType':_0x958c('0x41')});if(_0x365337[_0x958c('0x13')]){logger['info'](util['format'](_0x958c('0x42'),_0x5d7573[_0x958c('0x3b')]));tnef['parseBuffer'](_[_0x958c('0x43')](_0x365337)[_0x958c('0x30')],function(_0x14cdc9,_0x4c3e20){if(_0x4c3e20){_0x5d7573[_0x958c('0x15')]=_0x4c3e20['BodyHTML']||_0x958c('0x44');if(_0x4c3e20[_0x958c('0x45')]){for(var _0x18678c=0x0;_0x18678c<_0x4c3e20[_0x958c('0x45')]['length'];_0x18678c++){var _0x11c4a2=_0x4c3e20[_0x958c('0x45')][_0x18678c];_0xd155e0['message'][_0x958c('0x19')]['push']({'filename':_0x11c4a2[_0x958c('0x46')],'content':Buffer[_0x958c('0x39')](_0x11c4a2[_0x958c('0x47')])});}}}_0x14021b(parseEmail(_0x258b1b,_0x5d7573,_0xd155e0));});}else{_0x5d7573[_0x958c('0x15')]='

Empty\x20message

';_0x14021b(parseEmail(_0x258b1b,_0x5d7573,_0xd155e0));}}else{_0x14021b(parseEmail(_0x258b1b,_0x5d7573,_0xd155e0));}};exports[_0x958c('0x48')]=function(_0x22b3fb){switch(_0x22b3fb){case _0x958c('0x49'):return _0x958c('0x4a');case'yahoo':return _0x958c('0x4b');case'hotmail':return _0x958c('0x4c');case _0x958c('0x4d'):return _0x958c('0x4e');}return _0x958c('0x4f');}; \ No newline at end of file +var _0x3445=['address','substring','indexOf','split','length','join','Anonymous','pop','anonymous','generate','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x255763['slice'](0x0,-0x1)[_0x5344('0x10')]('\x20'):_0x5ee298['name'];}return _0x5344('0x11');}function getLastName(_0x49aafd){var _0x5e825e=_['head'](_0x49aafd[_0x5344('0x8')]);if(_0x5e825e&&_0x5e825e[_0x5344('0xa')]){var _0xc9409=_0x5e825e[_0x5344('0xa')][_0x5344('0xe')](/\s+/);return _0xc9409[_0x5344('0xf')]>0x1?_0xc9409[_0x5344('0x12')]():'';}return'';}function getMails(_0x307f63,_0x41906d){var _0x405630='';for(var _0x4ae241=0x0;_0x4ae241<_0x41906d[_0x5344('0x8')][_0x5344('0xf')];_0x4ae241+=0x1){if(_0x41906d[_0x5344('0x8')][_0x4ae241][_0x5344('0xb')]!==_0x307f63){if(!_['isEmpty'](_0x405630)){_0x405630+=',';}_0x405630+=_0x41906d['value'][_0x4ae241]['name']||_0x41906d[_0x5344('0x8')][_0x4ae241]['address']||'';_0x405630+='\x20<';_0x405630+=_0x41906d['value'][_0x4ae241]['address']?_0x41906d['value'][_0x4ae241][_0x5344('0xb')]:_0x5344('0x13')+random[_0x5344('0x14')](0x6)+_0x5344('0x9');_0x405630+='>';}}return _0x405630;}function parseEmail(_0x17634d,_0x1ca3ec,_0x72a04c){if(_0x1ca3ec[_0x5344('0x15')]){var _0x22caa8=/)<[^<]*)*<\/script>/gi;while(_0x22caa8[_0x5344('0x16')](_0x1ca3ec['html'])){_0x1ca3ec['html']=_0x1ca3ec[_0x5344('0x15')][_0x5344('0x17')](_0x22caa8,'');}if(_0x1ca3ec[_0x5344('0x15')][_0x5344('0x18')](_0x5344('0x19'))){var _0x49a578=[];_0x1ca3ec[_0x5344('0x1a')][_0x5344('0x1b')](_0xe1c211=>{_0x49a578[_0x5344('0x1c')](_0xe1c211['filename']);});var _0xabe84d=/]+>/g;var _0x2fbe7a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x437162=_0x1ca3ec[_0x5344('0x15')]['replace'](_0x2fbe7a,'_SRC');var _0x30a760=_0x437162[_0x5344('0x17')](_0xabe84d,_0x5344('0x1d'));for(let _0x28b50b=0x0;_0x28b50b<_0x49a578['length'];_0x28b50b++){var _0x3c6138=_0x30a760[_0x5344('0x17')](_0x5344('0x1d'),_0x5344('0x1e')+_0x49a578[_0x28b50b]+_0x5344('0x1f'));_0x30a760=_0x3c6138;}_0x1ca3ec[_0x5344('0x15')]=_0x30a760;}_0x72a04c[_0x5344('0x20')]=_0x1ca3ec['html'];}else{_0x72a04c[_0x5344('0x20')]=_0x1ca3ec['textAsHtml'];}if(_0x72a04c[_0x5344('0x20')]){_0x72a04c[_0x5344('0x20')]=_0x72a04c[_0x5344('0x20')][_0x5344('0x17')](/0x0){var _0x3f2c5f=[_0x5344('0x32'),_0x5344('0x33'),'Precedence:\x20auto_reply'];for(var _0x155996=0x0;_0x155996<_0x1ca3ec[_0x5344('0x31')]['length'];_0x155996++){var _0x167d2a=_[_0x5344('0xd')](_0x3f2c5f,_0x1ca3ec['headerLines'][_0x155996][_0x5344('0x34')]);if(_0x167d2a>=0x0){_0x72a04c[_0x5344('0x35')]=!![];}}}return _0x72a04c;}exports['parser']=function(_0x160d3f,_0x266a73,_0x23dd19){var _0x31328e={'from':getAddress(_0x266a73[_0x5344('0x36')]),'firstName':getFirstName(_0x266a73[_0x5344('0x36')]),'lastName':getLastName(_0x266a73[_0x5344('0x36')]),'mapKey':_0x5344('0x24'),'message':{'from':getMails(_0x160d3f['email'],_0x266a73[_0x5344('0x36')]),'to':_0x160d3f['email'],'cc':'','subject':_0x266a73[_0x5344('0x37')]||'','messageId':_0x266a73['messageId'],'inReplyTo':_0x266a73['inReplyTo'],'sentAt':moment(_0x266a73[_0x5344('0x38')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x266a73[_0x5344('0x15')]&&!_0x266a73[_0x5344('0x39')]){var _0x5eb177=_['filter'](_0x266a73[_0x5344('0x1a')],{'contentType':_0x5344('0x3a')});if(_0x5eb177[_0x5344('0xf')]){logger[_0x5344('0x3b')](util['format'](_0x5344('0x3c'),_0x266a73['messageId']));tnef[_0x5344('0x3d')](_[_0x5344('0x3e')](_0x5eb177)[_0x5344('0x2f')],function(_0x35760f,_0x33a78c){if(_0x33a78c){_0x266a73['html']=_0x33a78c[_0x5344('0x3f')]||'

Empty\x20message

';if(_0x33a78c[_0x5344('0x40')]){for(var _0xd1d0c2=0x0;_0xd1d0c2<_0x33a78c['Attachments'][_0x5344('0xf')];_0xd1d0c2++){var _0x2fbb91=_0x33a78c[_0x5344('0x40')][_0xd1d0c2];_0x31328e[_0x5344('0x22')]['attachments'][_0x5344('0x1c')]({'filename':_0x2fbb91[_0x5344('0x41')],'content':Buffer[_0x5344('0x36')](_0x2fbb91[_0x5344('0x42')])});}}}_0x23dd19(parseEmail(_0x160d3f,_0x266a73,_0x31328e));});}else{_0x266a73[_0x5344('0x15')]='

Empty\x20message

';_0x23dd19(parseEmail(_0x160d3f,_0x266a73,_0x31328e));}}else{_0x23dd19(parseEmail(_0x160d3f,_0x266a73,_0x31328e));}};exports[_0x5344('0x43')]=function(_0x2e17da){switch(_0x2e17da){case'gmail':return _0x5344('0x44');case'yahoo':return _0x5344('0x45');case _0x5344('0x46'):return _0x5344('0x47');case _0x5344('0x48'):return _0x5344('0x49');}return _0x5344('0x4a');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e315033..396b56f 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 _0xee01=['Service','key','active','Imap','Smtp','exports','lodash','name'];(function(_0x5c7a96,_0x50023c){var _0x42c43b=function(_0x22e4b5){while(--_0x22e4b5){_0x5c7a96['push'](_0x5c7a96['shift']());}};_0x42c43b(++_0x50023c);}(_0xee01,0x176));var _0x1ee0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee01[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1ee0('0x0'));function MailAccount(_0x426995){this['id']=_0x426995['id']||0x0;this[_0x1ee0('0x1')]=_0x426995['name']||_0x1ee0('0x2');this[_0x1ee0('0x3')]=_0x426995[_0x1ee0('0x3')]||'SERV';this[_0x1ee0('0x4')]=_0x426995[_0x1ee0('0x4')]||![];this[_0x1ee0('0x5')]=_0x426995[_0x1ee0('0x5')]||[];this[_0x1ee0('0x6')]=_0x426995[_0x1ee0('0x6')]||[];}module[_0x1ee0('0x7')]=MailAccount; \ No newline at end of file +var _0x5764=['exports','lodash','Service','key','active','Imap','Smtp'];(function(_0x13f144,_0x2e439b){var _0x15d228=function(_0x5d3a42){while(--_0x5d3a42){_0x13f144['push'](_0x13f144['shift']());}};_0x15d228(++_0x2e439b);}(_0x5764,0x1d6));var _0x4576=function(_0x4ee845,_0x554bd4){_0x4ee845=_0x4ee845-0x0;var _0x230b07=_0x5764[_0x4ee845];return _0x230b07;};'use strict';var _=require(_0x4576('0x0'));function MailAccount(_0x3b1406){this['id']=_0x3b1406['id']||0x0;this['name']=_0x3b1406['name']||_0x4576('0x1');this['key']=_0x3b1406[_0x4576('0x2')]||'SERV';this[_0x4576('0x3')]=_0x3b1406[_0x4576('0x3')]||![];this[_0x4576('0x4')]=_0x3b1406[_0x4576('0x4')]||[];this[_0x4576('0x5')]=_0x3b1406[_0x4576('0x5')]||[];}module[_0x4576('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 940768c..4f91bfb 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 _0x4029=['merge','exports','lodash','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x142afc,_0x1e8e99){var _0x196f96=function(_0x4bfa4b){while(--_0x4bfa4b){_0x142afc['push'](_0x142afc['shift']());}};_0x196f96(++_0x1e8e99);}(_0x4029,0x160));var _0x9402=function(_0x50822f,_0x5708d2){_0x50822f=_0x50822f-0x0;var _0x1af416=_0x4029[_0x50822f];return _0x1af416;};'use strict';var _=require(_0x9402('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x9402('0x1')]={};};function freeIsNotKey(_0x11e713,_0x51c39c,_0x5553c3){var _0x5911f5=_[_0x9402('0x2')](_0x11e713,function(_0x3532b9,_0x3281e8){return _0x3532b9[_0x5553c3];});for(var _0xd0b742 in _0x51c39c){if(_0x51c39c['hasOwnProperty'](_0xd0b742)){if(!_0x5911f5[_0xd0b742]){delete _0x51c39c[_0xd0b742];}}}}Realtime[_0x9402('0x3')][_0x9402('0x4')]=function(_0x451994,_0x703141){for(var _0x2fd326 in _0x703141){if(_0x451994['hasOwnProperty'](_0x2fd326)){_0x451994[_0x2fd326]=_0x703141[_0x2fd326];}}};Realtime[_0x9402('0x3')][_0x9402('0x5')]=function(){var _0x27f5ab=this;return function(_0x2048e3){if(_0x2048e3){freeIsNotKey(_0x2048e3,_0x27f5ab['mailAccounts'],'id');for(var _0xaa5763=0x0,_0x10d2c6={},_0x4e78bf={};_0xaa5763<_0x2048e3[_0x9402('0x6')];_0xaa5763+=0x1){_0x10d2c6=_0x2048e3[_0xaa5763];if(_[_0x9402('0x7')](_0x27f5ab[_0x9402('0x1')][_0x10d2c6['id']])){_0x27f5ab[_0x9402('0x1')][_0x10d2c6['id']]=new MailAccount(_0x10d2c6);}else{_[_0x9402('0x8')](_0x27f5ab[_0x9402('0x1')][_0x10d2c6['id']],_0x10d2c6);}}}return _0x27f5ab[_0x9402('0x1')];};};module[_0x9402('0x9')]=Realtime; \ No newline at end of file +var _0x9a46=['mergeFromDatabase','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','hasOwnProperty'];(function(_0xbb012c,_0x22261d){var _0x2b6e52=function(_0x2f858d){while(--_0x2f858d){_0xbb012c['push'](_0xbb012c['shift']());}};_0x2b6e52(++_0x22261d);}(_0x9a46,0x6b));var _0x69a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a46[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x69a4('0x0'));var MailAccount=require(_0x69a4('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1f6f88,_0x129f0f,_0x3f68c9){var _0x17309f=_['mapKeys'](_0x1f6f88,function(_0x2a0eca,_0x548542){return _0x2a0eca[_0x3f68c9];});for(var _0x30c73f in _0x129f0f){if(_0x129f0f[_0x69a4('0x2')](_0x30c73f)){if(!_0x17309f[_0x30c73f]){delete _0x129f0f[_0x30c73f];}}}}Realtime['prototype'][_0x69a4('0x3')]=function(_0x36e636,_0x11138d){for(var _0x275ca7 in _0x11138d){if(_0x36e636[_0x69a4('0x2')](_0x275ca7)){_0x36e636[_0x275ca7]=_0x11138d[_0x275ca7];}}};Realtime[_0x69a4('0x4')][_0x69a4('0x5')]=function(){var _0x218d10=this;return function(_0x225f3a){if(_0x225f3a){freeIsNotKey(_0x225f3a,_0x218d10[_0x69a4('0x6')],'id');for(var _0x51e033=0x0,_0x2d0339={},_0x2c0ae9={};_0x51e033<_0x225f3a[_0x69a4('0x7')];_0x51e033+=0x1){_0x2d0339=_0x225f3a[_0x51e033];if(_[_0x69a4('0x8')](_0x218d10[_0x69a4('0x6')][_0x2d0339['id']])){_0x218d10[_0x69a4('0x6')][_0x2d0339['id']]=new MailAccount(_0x2d0339);}else{_[_0x69a4('0x9')](_0x218d10[_0x69a4('0x6')][_0x2d0339['id']],_0x2d0339);}}}return _0x218d10[_0x69a4('0x6')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index f8b177e..18ac284 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 _0x2bab=['Request','GetMailAccount','service','email','active','ListId','TemplateId','Smtp','notify','NotifyMailAccount','../client','getMailAccounts'];(function(_0x44de47,_0x31bb85){var _0x4571d4=function(_0x1fa9ad){while(--_0x1fa9ad){_0x44de47['push'](_0x44de47['shift']());}};_0x4571d4(++_0x31bb85);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x192e44,_0x52c429){_0x192e44=_0x192e44-0x0;var _0x42e2a6=_0x2bab[_0x192e44];return _0x42e2a6;};'use strict';var client=require(_0xb2ba('0x0'));exports[_0xb2ba('0x1')]=function(){return function(){return client[_0xb2ba('0x2')](_0xb2ba('0x3'),{'options':{'attributes':['id','name',_0xb2ba('0x4'),_0xb2ba('0x5'),_0xb2ba('0x6'),'key',_0xb2ba('0x7'),_0xb2ba('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':'MailServerOut','as':_0xb2ba('0x9')}]},'log':'getMailAccount'});};};exports[_0xb2ba('0xa')]=function(_0x4790a6,_0x5f02b9){return client[_0xb2ba('0x2')](_0xb2ba('0xb'),{'account':{'id':_0x4790a6},'body':_0x5f02b9,'log':_0xb2ba('0xb')});}; \ No newline at end of file +var _0xba0d=['GetMailAccount','name','email','key','ListId','TemplateId','MailServerIn','Smtp','getMailAccount','notify','../client','Request'];(function(_0x15de7b,_0x1f9e4e){var _0x1456c4=function(_0x2132fc){while(--_0x2132fc){_0x15de7b['push'](_0x15de7b['shift']());}};_0x1456c4(++_0x1f9e4e);}(_0xba0d,0x8e));var _0xdba0=function(_0x476503,_0x22536c){_0x476503=_0x476503-0x0;var _0x431457=_0xba0d[_0x476503];return _0x431457;};'use strict';var client=require(_0xdba0('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xdba0('0x1')](_0xdba0('0x2'),{'options':{'attributes':['id',_0xdba0('0x3'),'service',_0xdba0('0x4'),'active',_0xdba0('0x5'),_0xdba0('0x6'),_0xdba0('0x7')],'raw':![],'include':[{'model':_0xdba0('0x8'),'as':'Imap'},{'model':'MailServerOut','as':_0xdba0('0x9')}]},'log':_0xdba0('0xa')});};};exports[_0xdba0('0xb')]=function(_0x2c20c4,_0x5aeceb){return client[_0xdba0('0x1')]('NotifyMailAccount',{'account':{'id':_0x2c20c4},'body':_0x5aeceb,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index b5f6383..5fb2bc0 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 _0x68e7=['ShowSetting','../client','getSettings','Request'];(function(_0x5a48f1,_0x1b9ce5){var _0x4d9ac3=function(_0x5d5981){while(--_0x5d5981){_0x5a48f1['push'](_0x5a48f1['shift']());}};_0x4d9ac3(++_0x1b9ce5);}(_0x68e7,0x181));var _0x768e=function(_0x4404a1,_0x36c3bd){_0x4404a1=_0x4404a1-0x0;var _0x82464e=_0x68e7[_0x4404a1];return _0x82464e;};'use strict';var client=require(_0x768e('0x0'));exports[_0x768e('0x1')]=function(){return client[_0x768e('0x2')](_0x768e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x6ab7=['Request','ShowSetting','loginMailFrequency','getSettings'];(function(_0x953880,_0x450ddc){var _0x4980f6=function(_0x4c79e0){while(--_0x4c79e0){_0x953880['push'](_0x953880['shift']());}};_0x4980f6(++_0x450ddc);}(_0x6ab7,0xf7));var _0x76ab=function(_0x52554a,_0x4c606b){_0x52554a=_0x52554a-0x0;var _0x3456eb=_0x6ab7[_0x52554a];return _0x3456eb;};'use strict';var client=require('../client');exports[_0x76ab('0x0')]=function(){return client[_0x76ab('0x1')](_0x76ab('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x76ab('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a14ed3c..73e8ee1 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 91710b0..160e85e 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 _0x24ce=['default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','port','websocket','polling','redis','localhost','socket.io-redis','../../config/triggers'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x24ce,0x1c0));var _0xe24c=function(_0x33283c,_0x2c7f02){_0x33283c=_0x33283c-0x0;var _0xf5b14=_0x24ce[_0x33283c];return _0xf5b14;};'use strict';var _=require(_0xe24c('0x0'));var http=require(_0xe24c('0x1'));var express=require('express');var sticky=require(_0xe24c('0x2'));var Redis=require(_0xe24c('0x3'));var config=require(_0xe24c('0x4'));var app=express();var server=http[_0xe24c('0x5')](app);server[_0xe24c('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xe24c('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0xe24c('0x8'),_0xe24c('0x9')]});config[_0xe24c('0xa')]=_['defaults'](config[_0xe24c('0xa')],{'host':_0xe24c('0xb'),'port':0x18eb});socketio['adapter'](require(_0xe24c('0xc'))({'pubClient':new Redis(config[_0xe24c('0xa')]),'subClient':new Redis(config[_0xe24c('0xa')])}));require(_0xe24c('0xd'))[_0xe24c('0xe')]();require(_0xe24c('0xf'))[_0xe24c('0xe')](socketio);require('../../config/express')['default'](app);require(_0xe24c('0x10'))[_0xe24c('0xe')](app);}else{server[_0xe24c('0x11')](_0xe24c('0x12'),function(){console[_0xe24c('0x13')](_0xe24c('0x14'),config['port']);});}exports=module[_0xe24c('0x15')]=app; \ No newline at end of file +var _0xb889=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','listening'];(function(_0x275154,_0x505bcc){var _0x5c6ce1=function(_0x4195b2){while(--_0x4195b2){_0x275154['push'](_0x275154['shift']());}};_0x5c6ce1(++_0x505bcc);}(_0xb889,0x116));var _0x9b88=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb889[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x9b88('0x0'));var http=require('http');var express=require(_0x9b88('0x1'));var sticky=require(_0x9b88('0x2'));var Redis=require(_0x9b88('0x3'));var config=require(_0x9b88('0x4'));var app=express();var server=http[_0x9b88('0x5')](app);server[_0x9b88('0x6')]=0xdbba0;if(sticky[_0x9b88('0x7')](server,config[_0x9b88('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x9b88('0x9'),_0x9b88('0xa')]});config[_0x9b88('0xb')]=_[_0x9b88('0xc')](config[_0x9b88('0xb')],{'host':_0x9b88('0xd'),'port':0x18eb});socketio['adapter'](require(_0x9b88('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x9b88('0xb')])}));require(_0x9b88('0xf'))[_0x9b88('0x10')]();require('../../config/socketio')[_0x9b88('0x10')](socketio);require(_0x9b88('0x11'))[_0x9b88('0x10')](app);require(_0x9b88('0x12'))['default'](app);}else{server[_0x9b88('0x13')](_0x9b88('0x14'),function(){console[_0x9b88('0x15')](_0x9b88('0x16'),config[_0x9b88('0x8')]);});}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 3c0ad1a..bfa49a3 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 _0x128c=['http','Request','request','then','debug','routing','error','message','result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x477272,_0x502f06){var _0x3c82af=function(_0x51a7cf){while(--_0x51a7cf){_0x477272['push'](_0x477272['shift']());}};_0x3c82af(++_0x502f06);}(_0x128c,0xec));var _0xc128=function(_0x1c6040,_0x42eb0a){_0x1c6040=_0x1c6040-0x0;var _0x1cbb41=_0x128c[_0x1c6040];return _0x1cbb41;};'use strict';var jayson=require(_0xc128('0x0'));var BPromise=require(_0xc128('0x1'));var logger=require(_0xc128('0x2'))('routing');var client=jayson[_0xc128('0x3')][_0xc128('0x4')]({'port':0x2329});client[_0xc128('0x5')]=function(_0x21d34a,_0x2372a8){return new BPromise(function(_0x1fb865,_0xdba4db){return client[_0xc128('0x6')](_0x21d34a,_0x2372a8)[_0xc128('0x7')](function(_0x37e458){logger[_0xc128('0x8')]('rpc',_0xc128('0x9'),_0x21d34a,_0x2372a8,_0x37e458);if(_0x37e458[_0xc128('0xa')]){logger[_0xc128('0xa')]('rpc',_0xc128('0x9'),_0x21d34a,_0x37e458[_0xc128('0xa')][_0xc128('0xb')],_0x2372a8);return _0xdba4db(_0x37e458[_0xc128('0xa')][_0xc128('0xb')]);}else{return _0x1fb865(_0x37e458[_0xc128('0xc')]);}})[_0xc128('0xd')](function(_0x52a25e){logger['error'](_0xc128('0xe'),'routing',_0x21d34a,_0x52a25e,_0x2372a8);return _0xdba4db(_0x52a25e);});});};module[_0xc128('0xf')]=client; \ No newline at end of file +var _0x1c51=['routing','Request','request','debug','error','rpc','catch','jayson/promise','bluebird','../../config/logger'];(function(_0x266c91,_0x16fc7a){var _0x33e3b4=function(_0x18f6be){while(--_0x18f6be){_0x266c91['push'](_0x266c91['shift']());}};_0x33e3b4(++_0x16fc7a);}(_0x1c51,0x133));var _0x11c5=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x1c51[_0x1ebe90];return _0x447c82;};'use strict';var jayson=require(_0x11c5('0x0'));var BPromise=require(_0x11c5('0x1'));var logger=require(_0x11c5('0x2'))(_0x11c5('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x11c5('0x4')]=function(_0x28db36,_0xebaa4f){return new BPromise(function(_0x1f0523,_0xa0f5d6){return client[_0x11c5('0x5')](_0x28db36,_0xebaa4f)['then'](function(_0x59752d){logger[_0x11c5('0x6')]('rpc',_0x11c5('0x3'),_0x28db36,_0xebaa4f,_0x59752d);if(_0x59752d[_0x11c5('0x7')]){logger[_0x11c5('0x7')](_0x11c5('0x8'),'routing',_0x28db36,_0x59752d[_0x11c5('0x7')]['message'],_0xebaa4f);return _0xa0f5d6(_0x59752d[_0x11c5('0x7')]['message']);}else{return _0x1f0523(_0x59752d['result']);}})[_0x11c5('0x9')](function(_0x2e92a9){logger[_0x11c5('0x7')](_0x11c5('0x8'),_0x11c5('0x3'),_0x28db36,_0x2e92a9,_0xebaa4f);return _0xa0f5d6(_0x2e92a9);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 9836881..bd2c76b 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 _0xe6a2=['initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x106423,_0x3981d5){var _0x5bc4b5=function(_0x193685){while(--_0x193685){_0x106423['push'](_0x106423['shift']());}};_0x5bc4b5(++_0x3981d5);}(_0xe6a2,0x15e));var _0x2e6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6a2[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x2e6a('0x0'));var server=require(_0x2e6a('0x1'));var Realtime=require(_0x2e6a('0x2'));var user=require(_0x2e6a('0x3'));var interval=require(_0x2e6a('0x4'));var openchannelQueue=require(_0x2e6a('0x5'));var chatQueue=require(_0x2e6a('0x6'));var smsQueue=require(_0x2e6a('0x7'));var mailQueue=require(_0x2e6a('0x8'));var faxQueue=require(_0x2e6a('0x9'));var whatsappQueue=require(_0x2e6a('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x2e6a('0xb')]()[_0x2e6a('0xc')](user[_0x2e6a('0xd')]())['then'](realtime[_0x2e6a('0xe')]())[_0x2e6a('0xc')](interval[_0x2e6a('0xf')]())[_0x2e6a('0xc')](realtime[_0x2e6a('0x10')]())[_0x2e6a('0xc')](openchannelQueue[_0x2e6a('0x11')]())[_0x2e6a('0xc')](realtime[_0x2e6a('0x12')]())['then'](chatQueue[_0x2e6a('0x13')]())[_0x2e6a('0xc')](realtime['initChatQueues']())['then'](smsQueue[_0x2e6a('0x14')]())[_0x2e6a('0xc')](realtime['initSmsQueues']())[_0x2e6a('0xc')](mailQueue[_0x2e6a('0x15')]())[_0x2e6a('0xc')](realtime[_0x2e6a('0x16')]())['then'](faxQueue['getFaxQueues']())[_0x2e6a('0xc')](realtime[_0x2e6a('0x17')]())[_0x2e6a('0xc')](whatsappQueue[_0x2e6a('0x18')]())[_0x2e6a('0xc')](realtime['initWhatsappQueues']())[_0x2e6a('0xc')](function(){return realtime;});}function main(){return server[_0x2e6a('0x19')](realtime)['then'](function(_0x1eef7c){return initRealtime();})[_0x2e6a('0xc')](function(_0x495de1){return setInterval(initRealtime,0x1388);})[_0x2e6a('0x1a')](function(_0x51270e){console[_0x2e6a('0x1b')](_0x51270e);});}main(); \ No newline at end of file +var _0x7f19=['./rpc/whatsappQueue','resolve','then','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0x7f19,0x17d));var _0x97f1=function(_0x26aafb,_0x4e0aef){_0x26aafb=_0x26aafb-0x0;var _0x3bd873=_0x7f19[_0x26aafb];return _0x3bd873;};'use strict';var BPromise=require(_0x97f1('0x0'));var server=require(_0x97f1('0x1'));var Realtime=require(_0x97f1('0x2'));var user=require(_0x97f1('0x3'));var interval=require(_0x97f1('0x4'));var openchannelQueue=require(_0x97f1('0x5'));var chatQueue=require(_0x97f1('0x6'));var smsQueue=require(_0x97f1('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x97f1('0x8'));var whatsappQueue=require(_0x97f1('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x97f1('0xa')]()[_0x97f1('0xb')](user['getAgents']())[_0x97f1('0xb')](realtime['initAgents']())[_0x97f1('0xb')](interval[_0x97f1('0xc')]())[_0x97f1('0xb')](realtime['initIntervals']())[_0x97f1('0xb')](openchannelQueue[_0x97f1('0xd')]())['then'](realtime[_0x97f1('0xe')]())[_0x97f1('0xb')](chatQueue[_0x97f1('0xf')]())['then'](realtime[_0x97f1('0x10')]())['then'](smsQueue[_0x97f1('0x11')]())[_0x97f1('0xb')](realtime['initSmsQueues']())[_0x97f1('0xb')](mailQueue[_0x97f1('0x12')]())[_0x97f1('0xb')](realtime[_0x97f1('0x13')]())['then'](faxQueue[_0x97f1('0x14')]())[_0x97f1('0xb')](realtime[_0x97f1('0x15')]())['then'](whatsappQueue[_0x97f1('0x16')]())['then'](realtime[_0x97f1('0x17')]())[_0x97f1('0xb')](function(){return realtime;});}function main(){return server[_0x97f1('0x18')](realtime)[_0x97f1('0xb')](function(_0x458a21){return initRealtime();})[_0x97f1('0xb')](function(_0x5f1200){return setInterval(initRealtime,0x1388);})[_0x97f1('0x19')](function(_0x4b5b6e){console['log'](_0x4b5b6e);});}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 2f0196c..3a3c63b 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x3782f1,_0xdb9da7){_0x3782f1=_0x3782f1-0x0;var _0x59aa2c=_0x1261[_0x3782f1];return _0x59aa2c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +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(_0x24d784,_0x3cf174){var _0x5b9f42=function(_0x196075){while(--_0x196075){_0x24d784['push'](_0x24d784['shift']());}};_0x5b9f42(++_0x3cf174);}(_0x7a54,0x106));var _0x47a5=function(_0x2de575,_0x2a8fee){_0x2de575=_0x2de575-0x0;var _0x31d911=_0x7a54[_0x2de575];return _0x31d911;};'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 6c616cb..810f396 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 _0x27d6=['error','message','result','catch','bluebird','jayson/promise','client','http','request','then'];(function(_0x9b73d2,_0x1767f1){var _0x813300=function(_0x9436a5){while(--_0x9436a5){_0x9b73d2['push'](_0x9b73d2['shift']());}};_0x813300(++_0x1767f1);}(_0x27d6,0x130));var _0x627d=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x27d6[_0x160c73];return _0xd9302;};'use strict';var BPromise=require(_0x627d('0x0'));var jayson=require(_0x627d('0x1'));var client=jayson[_0x627d('0x2')][_0x627d('0x3')]({'port':0x232b});function request(_0x9c247f,_0x2e2ed0){return new BPromise(function(_0x1611dd,_0x5a0734){return client[_0x627d('0x4')](_0x9c247f,_0x2e2ed0)[_0x627d('0x5')](function(_0x2967d8){if(_0x2967d8[_0x627d('0x6')]){return _0x5a0734(_0x2967d8['error'][_0x627d('0x7')]);}else{return _0x1611dd(_0x2967d8[_0x627d('0x8')]);}})[_0x627d('0x9')](function(_0x2ef477){return _0x5a0734(_0x2ef477);});});}exports['sendMailMessage']=function(_0x9f3550,_0x175dfc){return request('SendMail',{'account':_0x9f3550,'message':_0x175dfc});}; \ No newline at end of file +var _0x75f8=['result','catch','SendMail','bluebird','jayson/promise','client','request','then','error','message'];(function(_0x314cdb,_0x39595c){var _0x586c99=function(_0x2c37e1){while(--_0x2c37e1){_0x314cdb['push'](_0x314cdb['shift']());}};_0x586c99(++_0x39595c);}(_0x75f8,0x1cf));var _0x875f=function(_0x57fa12,_0x4b82fe){_0x57fa12=_0x57fa12-0x0;var _0x5dae05=_0x75f8[_0x57fa12];return _0x5dae05;};'use strict';var BPromise=require(_0x875f('0x0'));var jayson=require(_0x875f('0x1'));var client=jayson[_0x875f('0x2')]['http']({'port':0x232b});function request(_0x45e20f,_0x25911b){return new BPromise(function(_0x4e67cf,_0xc93132){return client[_0x875f('0x3')](_0x45e20f,_0x25911b)[_0x875f('0x4')](function(_0x3c7d15){if(_0x3c7d15[_0x875f('0x5')]){return _0xc93132(_0x3c7d15[_0x875f('0x5')][_0x875f('0x6')]);}else{return _0x4e67cf(_0x3c7d15[_0x875f('0x7')]);}})[_0x875f('0x8')](function(_0x4ead1b){return _0xc93132(_0x4ead1b);});});}exports['sendMailMessage']=function(_0x21cabf,_0x20202f){return request(_0x875f('0x9'),{'account':_0x21cabf,'message':_0x20202f});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index c4d2b82..08cf175 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 _0xc5bd=['faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','openchannel','fax','length','Status','toNumber','format','name','chatStatus','mailCurrentCapacity','faxStatus','smsStatusTime','smsCurrentCapacity','whatsappStatus','busyQueue','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime'];(function(_0x1012ab,_0xfb2018){var _0x4ebbe3=function(_0x32cb49){while(--_0x32cb49){_0x1012ab['push'](_0x1012ab['shift']());}};_0x4ebbe3(++_0xfb2018);}(_0xc5bd,0x9a));var _0xdc5b=function(_0x21fd27,_0x313a12){_0x21fd27=_0x21fd27-0x0;var _0x8e48cd=_0xc5bd[_0x21fd27];return _0x8e48cd;};'use strict';var _=require(_0xdc5b('0x0'));var moment=require(_0xdc5b('0x1'));var md5=require(_0xdc5b('0x2'));var Redis=require(_0xdc5b('0x3'));var config=require(_0xdc5b('0x4'));config[_0xdc5b('0x5')]=_[_0xdc5b('0x6')](config[_0xdc5b('0x5')],{'host':_0xdc5b('0x7'),'port':0x18eb});var io=require(_0xdc5b('0x8'))(new Redis(config['redis']));function Agent(_0x234963){this['id']=_0x234963['id']||0x0;this['name']=_0x234963['name']||'';this[_0xdc5b('0x9')]=_0x234963[_0xdc5b('0x9')]||!![];this['voicePause']=_0x234963['voicePause']||![];this[_0xdc5b('0xa')]=_0x234963[_0xdc5b('0xa')]||![];this[_0xdc5b('0xb')]=_0x234963[_0xdc5b('0xb')]||![];this[_0xdc5b('0xc')]=_0x234963['faxPause']||![];this[_0xdc5b('0xd')]=_0x234963[_0xdc5b('0xd')]||![];this['openchannelPause']=_0x234963[_0xdc5b('0xe')]||![];this['chatStatus']=_0xdc5b('0xf');this[_0xdc5b('0x10')]=0x0;this[_0xdc5b('0x11')]=_0x234963['chatCapacity']||0x0;this[_0xdc5b('0x12')]=0x0;this[_0xdc5b('0x13')]=_0xdc5b('0xf');this[_0xdc5b('0x14')]=0x0;this['mailCapacity']=_0x234963[_0xdc5b('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xdc5b('0xf');this[_0xdc5b('0x16')]=0x0;this['faxCapacity']=_0x234963[_0xdc5b('0x17')]||0x0;this[_0xdc5b('0x18')]=0x0;this[_0xdc5b('0x19')]=_0xdc5b('0xf');this['smsStatusTime']=0x0;this[_0xdc5b('0x1a')]=_0x234963['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0xdc5b('0x1b')]=0x0;this[_0xdc5b('0x1c')]=_0x234963['whatsappCapacity']||0x0;this[_0xdc5b('0x1d')]=0x0;this[_0xdc5b('0x1e')]=_0xdc5b('0xf');this[_0xdc5b('0x1f')]=0x0;this[_0xdc5b('0x20')]=_0x234963[_0xdc5b('0x20')]||0x0;this[_0xdc5b('0x21')]=0x0;this[_0xdc5b('0x22')]=![];this['busyQueue']=undefined;this[_0xdc5b('0x2')]='';this['updateRealtime']();}Agent[_0xdc5b('0x23')][_0xdc5b('0x24')]=function(_0x46493a){if(this[_0x46493a+_0xdc5b('0x25')]>0x0){if(this[_0x46493a+_0xdc5b('0x26')]>0x0&&this[_0x46493a+_0xdc5b('0x25')]>=this[_0x46493a+_0xdc5b('0x26')]){return'maxcapacity';}else{return _0xdc5b('0x27');}}else{return _0xdc5b('0x28');}};Agent[_0xdc5b('0x23')][_0xdc5b('0x29')]=function(){var _0x624189=[_0xdc5b('0x2a'),'chat',_0xdc5b('0x2b'),_0xdc5b('0x2c'),'sms','whatsapp'];for(var _0x46418c=0x0;_0x46418c<_0x624189[_0xdc5b('0x2d')];_0x46418c+=0x1){var _0x415257=this['getChannelStatus'](_0x624189[_0x46418c]);if(this[_0x624189[_0x46418c]+_0xdc5b('0x2e')]!==_0x415257){this[_0x624189[_0x46418c]+'StatusTime']=_[_0xdc5b('0x2f')](moment()[_0xdc5b('0x30')]('x'));}this[_0x624189[_0x46418c]+_0xdc5b('0x2e')]=_0x415257;}var _0xa717db={'id':this['id'],'name':this[_0xdc5b('0x31')],'online':this[_0xdc5b('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xdc5b('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xdc5b('0x32')],'chatStatusTime':this[_0xdc5b('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xdc5b('0x13')],'mailStatusTime':this[_0xdc5b('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xdc5b('0x33')],'faxStatus':this[_0xdc5b('0x34')],'faxStatusTime':this[_0xdc5b('0x16')],'faxCapacity':this[_0xdc5b('0x17')],'faxCurrentCapacity':this[_0xdc5b('0x18')],'smsStatus':this[_0xdc5b('0x19')],'smsStatusTime':this[_0xdc5b('0x35')],'smsCapacity':this[_0xdc5b('0x1a')],'smsCurrentCapacity':this[_0xdc5b('0x36')],'whatsappStatus':this[_0xdc5b('0x37')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xdc5b('0x1c')],'whatsappCurrentCapacity':this[_0xdc5b('0x1d')],'openchannelStatus':this[_0xdc5b('0x1e')],'openchannelStatusTime':this[_0xdc5b('0x1f')],'openchannelCapacity':this[_0xdc5b('0x20')],'openchannelCurrentCapacity':this[_0xdc5b('0x21')],'busy':this[_0xdc5b('0x22')],'busyQueue':this[_0xdc5b('0x38')]};var _0x16d7f0=md5(JSON['stringify'](_0xa717db));if(this[_0xdc5b('0x2')]!==_0x16d7f0){this[_0xdc5b('0x2')]=_0x16d7f0;io['emit'](_0xdc5b('0x39'),_0xa717db);}};module[_0xdc5b('0x3a')]=Agent; \ No newline at end of file +var _0xb65a=['exports','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','length','Status','toNumber','online','chatStatusTime','whatsappCurrentCapacity','openchannelStatus','busy','stringify','md5','user:save'];(function(_0x53ee80,_0x1e71ae){var _0x4b0db1=function(_0x18672c){while(--_0x18672c){_0x53ee80['push'](_0x53ee80['shift']());}};_0x4b0db1(++_0x1e71ae);}(_0xb65a,0x114));var _0xab65=function(_0x3fb77f,_0x47e2a2){_0x3fb77f=_0x3fb77f-0x0;var _0x4afc2f=_0xb65a[_0x3fb77f];return _0x4afc2f;};'use strict';var _=require(_0xab65('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xab65('0x1'));var config=require(_0xab65('0x2'));config[_0xab65('0x3')]=_['defaults'](config['redis'],{'host':_0xab65('0x4'),'port':0x18eb});var io=require(_0xab65('0x5'))(new Redis(config[_0xab65('0x3')]));function Agent(_0x4e6f14){this['id']=_0x4e6f14['id']||0x0;this[_0xab65('0x6')]=_0x4e6f14['name']||'';this['online']=_0x4e6f14['online']||!![];this[_0xab65('0x7')]=_0x4e6f14[_0xab65('0x7')]||![];this[_0xab65('0x8')]=_0x4e6f14[_0xab65('0x8')]||![];this['mailPause']=_0x4e6f14[_0xab65('0x9')]||![];this[_0xab65('0xa')]=_0x4e6f14[_0xab65('0xa')]||![];this[_0xab65('0xb')]=_0x4e6f14[_0xab65('0xb')]||![];this[_0xab65('0xc')]=_0x4e6f14[_0xab65('0xc')]||![];this[_0xab65('0xd')]=_0xab65('0xe');this['chatStatusTime']=0x0;this[_0xab65('0xf')]=_0x4e6f14['chatCapacity']||0x0;this[_0xab65('0x10')]=0x0;this[_0xab65('0x11')]=_0xab65('0xe');this[_0xab65('0x12')]=0x0;this[_0xab65('0x13')]=_0x4e6f14[_0xab65('0x13')]||0x0;this[_0xab65('0x14')]=0x0;this[_0xab65('0x15')]=_0xab65('0xe');this[_0xab65('0x16')]=0x0;this[_0xab65('0x17')]=_0x4e6f14[_0xab65('0x17')]||0x0;this[_0xab65('0x18')]=0x0;this[_0xab65('0x19')]=_0xab65('0xe');this[_0xab65('0x1a')]=0x0;this['smsCapacity']=_0x4e6f14[_0xab65('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xab65('0x1c')]=_0xab65('0xe');this[_0xab65('0x1d')]=0x0;this[_0xab65('0x1e')]=_0x4e6f14[_0xab65('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xab65('0xe');this[_0xab65('0x1f')]=0x0;this['openchannelCapacity']=_0x4e6f14[_0xab65('0x20')]||0x0;this[_0xab65('0x21')]=0x0;this['busy']=![];this[_0xab65('0x22')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0xab65('0x23')]['getChannelStatus']=function(_0x381df5){if(this[_0x381df5+_0xab65('0x24')]>0x0){if(this[_0x381df5+'Capacity']>0x0&&this[_0x381df5+'CurrentCapacity']>=this[_0x381df5+'Capacity']){return _0xab65('0x25');}else{return _0xab65('0x26');}}else{return _0xab65('0x27');}};Agent['prototype'][_0xab65('0x28')]=function(){var _0xce4276=['mail',_0xab65('0x29'),_0xab65('0x2a'),'fax','sms','whatsapp'];for(var _0x5d2c70=0x0;_0x5d2c70<_0xce4276[_0xab65('0x2b')];_0x5d2c70+=0x1){var _0x31e12a=this['getChannelStatus'](_0xce4276[_0x5d2c70]);if(this[_0xce4276[_0x5d2c70]+_0xab65('0x2c')]!==_0x31e12a){this[_0xce4276[_0x5d2c70]+'StatusTime']=_[_0xab65('0x2d')](moment()['format']('x'));}this[_0xce4276[_0x5d2c70]+_0xab65('0x2c')]=_0x31e12a;}var _0x1bd9d5={'id':this['id'],'name':this[_0xab65('0x6')],'online':this[_0xab65('0x2e')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0xab65('0x9')],'smsPause':this[_0xab65('0xb')],'faxPause':this[_0xab65('0xa')],'openchannelPause':this[_0xab65('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xab65('0x2f')],'chatCapacity':this[_0xab65('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xab65('0x11')],'mailStatusTime':this[_0xab65('0x12')],'mailCapacity':this[_0xab65('0x13')],'mailCurrentCapacity':this[_0xab65('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xab65('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xab65('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xab65('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xab65('0x1c')],'whatsappStatusTime':this[_0xab65('0x1d')],'whatsappCapacity':this[_0xab65('0x1e')],'whatsappCurrentCapacity':this[_0xab65('0x30')],'openchannelStatus':this[_0xab65('0x31')],'openchannelStatusTime':this[_0xab65('0x1f')],'openchannelCapacity':this[_0xab65('0x20')],'openchannelCurrentCapacity':this[_0xab65('0x21')],'busy':this[_0xab65('0x32')],'busyQueue':this[_0xab65('0x22')]};var _0x1d19cf=md5(JSON[_0xab65('0x33')](_0x1bd9d5));if(this[_0xab65('0x34')]!==_0x1d19cf){this[_0xab65('0x34')]=_0x1d19cf;io['emit'](_0xab65('0x35'),_0x1bd9d5);}};module[_0xab65('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e3b88a0..8b95432 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 _0x4a4d=['available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online'];(function(_0x36069f,_0x78c9cc){var _0x29f662=function(_0x1700f6){while(--_0x1700f6){_0x36069f['push'](_0x36069f['shift']());}};_0x29f662(++_0x78c9cc);}(_0x4a4d,0xfa));var _0xd4a4=function(_0x4fe0f2,_0x5dbc89){_0x4fe0f2=_0x4fe0f2-0x0;var _0x982e06=_0x4a4d[_0x4fe0f2];return _0x982e06;};'use strict';var _=require('lodash');var md5=require(_0xd4a4('0x0'));var util=require(_0xd4a4('0x1'));var Redis=require('ioredis');var config=require(_0xd4a4('0x2'));config['redis']=_[_0xd4a4('0x3')](config[_0xd4a4('0x4')],{'host':_0xd4a4('0x5'),'port':0x18eb});var io=require(_0xd4a4('0x6'))(new Redis(config[_0xd4a4('0x4')]));function ChatQueue(_0x4fdcfa){this['id']=_0x4fdcfa['id']||0x0;this[_0xd4a4('0x7')]=_0x4fdcfa[_0xd4a4('0x7')]||'';this[_0xd4a4('0x8')]=_0x4fdcfa[_0xd4a4('0x8')]||0xa;this['strategy']=_0x4fdcfa[_0xd4a4('0x9')]||_0xd4a4('0xa');this[_0xd4a4('0xb')]=_0x4fdcfa[_0xd4a4('0xb')];this[_0xd4a4('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xd4a4('0xd')]();this[_0xd4a4('0xe')]();}ChatQueue[_0xd4a4('0xf')][_0xd4a4('0xd')]=function(){var _0x25ab95=this['mapAgentsId'][_0xd4a4('0x10')];this[_0xd4a4('0xc')]=_['map'](this[_0xd4a4('0xb')],'id');this[_0xd4a4('0xc')][_0xd4a4('0x10')]=_0x25ab95;};ChatQueue[_0xd4a4('0xf')][_0xd4a4('0xe')]=function(){this[_0xd4a4('0x11')]=0x0;this[_0xd4a4('0x12')]=0x0;for(var _0x2ff8b2=0x0;_0x2ff8b2=0x0?this['available']:0x0;var _0x52e8f8={'id':this['id'],'available':this[_0xd4a4('0x14')],'loggedIn':this[_0xd4a4('0x11')],'name':this[_0xd4a4('0x7')],'paused':this[_0xd4a4('0x12')],'waiting':this[_0xd4a4('0x15')]};var _0x2e6ff5=md5(JSON[_0xd4a4('0x16')](_0x52e8f8));if(this[_0xd4a4('0x0')]!==_0x2e6ff5){this[_0xd4a4('0x0')]=_0x2e6ff5;io['to'](util[_0xd4a4('0x17')](_0xd4a4('0x18'),_0x52e8f8[_0xd4a4('0x7')]))[_0xd4a4('0x19')](_0xd4a4('0x1a'),_0x52e8f8);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x20cd=['strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','online','loggedIn','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x5d5b9e,_0x2423ff){var _0xa9b5ae=function(_0x10dcfe){while(--_0x10dcfe){_0x5d5b9e['push'](_0x5d5b9e['shift']());}};_0xa9b5ae(++_0x2423ff);}(_0x20cd,0x1c2));var _0xd20c=function(_0x342861,_0x59cb74){_0x342861=_0x342861-0x0;var _0x59f26c=_0x20cd[_0x342861];return _0x59f26c;};'use strict';var _=require('lodash');var md5=require(_0xd20c('0x0'));var util=require(_0xd20c('0x1'));var Redis=require(_0xd20c('0x2'));var config=require(_0xd20c('0x3'));config[_0xd20c('0x4')]=_['defaults'](config[_0xd20c('0x4')],{'host':_0xd20c('0x5'),'port':0x18eb});var io=require(_0xd20c('0x6'))(new Redis(config[_0xd20c('0x4')]));function ChatQueue(_0x5e35a2){this['id']=_0x5e35a2['id']||0x0;this['name']=_0x5e35a2[_0xd20c('0x7')]||'';this[_0xd20c('0x8')]=_0x5e35a2['timeout']||0xa;this[_0xd20c('0x9')]=_0x5e35a2['strategy']||'beepall';this[_0xd20c('0xa')]=_0x5e35a2[_0xd20c('0xa')];this['mapAgentsId']={};this[_0xd20c('0xb')]=0x0;this['md5']='';this[_0xd20c('0xc')]();this[_0xd20c('0xd')]();}ChatQueue[_0xd20c('0xe')]['updateRouting']=function(){var _0x5cd0d6=this[_0xd20c('0xf')][_0xd20c('0x10')];this['mapAgentsId']=_['map'](this[_0xd20c('0xa')],'id');this[_0xd20c('0xf')]['_rr']=_0x5cd0d6;};ChatQueue[_0xd20c('0xe')][_0xd20c('0xd')]=function(){this['loggedIn']=0x0;this[_0xd20c('0x11')]=0x0;for(var _0x444caa=0x0;_0x444caa=0x0?this[_0xd20c('0x15')]:0x0;var _0x1eaf88={'id':this['id'],'available':this[_0xd20c('0x15')],'loggedIn':this[_0xd20c('0x13')],'name':this[_0xd20c('0x7')],'paused':this[_0xd20c('0x11')],'waiting':this[_0xd20c('0xb')]};var _0x249e2e=md5(JSON['stringify'](_0x1eaf88));if(this['md5']!==_0x249e2e){this[_0xd20c('0x0')]=_0x249e2e;io['to'](util[_0xd20c('0x16')](_0xd20c('0x17'),_0x1eaf88[_0xd20c('0x7')]))[_0xd20c('0x18')](_0xd20c('0x19'),_0x1eaf88);}};module[_0xd20c('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 3f499a9..87ba06d 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 _0xec22=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn','faxPause','available','stringify','fax:queue:%s','fax_queue:save','exports','md5','ioredis','../../../config/environment'];(function(_0x56e2a8,_0x2cf877){var _0x232412=function(_0x468b7c){while(--_0x468b7c){_0x56e2a8['push'](_0x56e2a8['shift']());}};_0x232412(++_0x2cf877);}(_0xec22,0x1d9));var _0x2ec2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xec22[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var md5=require(_0x2ec2('0x0'));var util=require('util');var Redis=require(_0x2ec2('0x1'));var config=require(_0x2ec2('0x2'));config[_0x2ec2('0x3')]=_[_0x2ec2('0x4')](config[_0x2ec2('0x3')],{'host':_0x2ec2('0x5'),'port':0x18eb});var io=require(_0x2ec2('0x6'))(new Redis(config[_0x2ec2('0x3')]));function FaxQueue(_0x1c9f63){this['id']=_0x1c9f63['id']||0x0;this[_0x2ec2('0x7')]=_0x1c9f63[_0x2ec2('0x7')]||'';this[_0x2ec2('0x8')]=_0x1c9f63[_0x2ec2('0x8')]||0xa;this[_0x2ec2('0x9')]=_0x1c9f63[_0x2ec2('0x9')]||_0x2ec2('0xa');this['Agents']=_0x1c9f63[_0x2ec2('0xb')];this[_0x2ec2('0xc')]={};this[_0x2ec2('0xd')]=0x0;this[_0x2ec2('0x0')]='';this[_0x2ec2('0xe')]();this[_0x2ec2('0xf')]();}FaxQueue[_0x2ec2('0x10')]['updateRouting']=function(){var _0x30a44d=this[_0x2ec2('0xc')][_0x2ec2('0x11')];this[_0x2ec2('0xc')]=_['map'](this[_0x2ec2('0xb')],'id');this['mapAgentsId'][_0x2ec2('0x11')]=_0x30a44d;};FaxQueue[_0x2ec2('0x10')][_0x2ec2('0xf')]=function(){this['loggedIn']=0x0;this[_0x2ec2('0x12')]=0x0;for(var _0x3189c6=0x0;_0x3189c6=0x0?this[_0x2ec2('0x17')]:0x0;var _0x27cc5b={'id':this['id'],'available':this[_0x2ec2('0x17')],'loggedIn':this[_0x2ec2('0x15')],'name':this[_0x2ec2('0x7')],'paused':this[_0x2ec2('0x12')],'waiting':this[_0x2ec2('0xd')]};var _0x22e22c=md5(JSON[_0x2ec2('0x18')](_0x27cc5b));if(this['md5']!==_0x22e22c){this[_0x2ec2('0x0')]=_0x22e22c;io['to'](util['format'](_0x2ec2('0x19'),_0x27cc5b[_0x2ec2('0x7')]))['emit'](_0x2ec2('0x1a'),_0x27cc5b);}};module[_0x2ec2('0x1b')]=FaxQueue; \ No newline at end of file +var _0xf4a0=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf4a0,0x18e));var _0x0f4a=function(_0x5c6375,_0x2c0079){_0x5c6375=_0x5c6375-0x0;var _0x45d219=_0xf4a0[_0x5c6375];return _0x45d219;};'use strict';var _=require('lodash');var md5=require(_0x0f4a('0x0'));var util=require('util');var Redis=require(_0x0f4a('0x1'));var config=require(_0x0f4a('0x2'));config[_0x0f4a('0x3')]=_[_0x0f4a('0x4')](config[_0x0f4a('0x3')],{'host':_0x0f4a('0x5'),'port':0x18eb});var io=require(_0x0f4a('0x6'))(new Redis(config['redis']));function FaxQueue(_0x8e201a){this['id']=_0x8e201a['id']||0x0;this[_0x0f4a('0x7')]=_0x8e201a[_0x0f4a('0x7')]||'';this[_0x0f4a('0x8')]=_0x8e201a[_0x0f4a('0x8')]||0xa;this[_0x0f4a('0x9')]=_0x8e201a['strategy']||_0x0f4a('0xa');this[_0x0f4a('0xb')]=_0x8e201a[_0x0f4a('0xb')];this[_0x0f4a('0xc')]={};this[_0x0f4a('0xd')]=0x0;this[_0x0f4a('0x0')]='';this[_0x0f4a('0xe')]();this['updateRealtime']();}FaxQueue[_0x0f4a('0xf')][_0x0f4a('0xe')]=function(){var _0x34ff95=this[_0x0f4a('0xc')][_0x0f4a('0x10')];this['mapAgentsId']=_[_0x0f4a('0x11')](this[_0x0f4a('0xb')],'id');this['mapAgentsId'][_0x0f4a('0x10')]=_0x34ff95;};FaxQueue[_0x0f4a('0xf')][_0x0f4a('0x12')]=function(){this[_0x0f4a('0x13')]=0x0;this[_0x0f4a('0x14')]=0x0;for(var _0x56dc48=0x0;_0x56dc48=0x0?this['available']:0x0;var _0x560a7c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0f4a('0x13')],'name':this[_0x0f4a('0x7')],'paused':this[_0x0f4a('0x14')],'waiting':this['waiting']};var _0x35e49d=md5(JSON[_0x0f4a('0x18')](_0x560a7c));if(this[_0x0f4a('0x0')]!==_0x35e49d){this['md5']=_0x35e49d;io['to'](util['format'](_0x0f4a('0x19'),_0x560a7c['name']))[_0x0f4a('0x1a')](_0x0f4a('0x1b'),_0x560a7c);}};module[_0x0f4a('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 992f20a..ab80314 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 _0x3013=['name','exports'];(function(_0x15e0a3,_0x19cedb){var _0x3aeb7c=function(_0x5f348e){while(--_0x5f348e){_0x15e0a3['push'](_0x15e0a3['shift']());}};_0x3aeb7c(++_0x19cedb);}(_0x3013,0xd0));var _0x3301=function(_0x1a749c,_0x1657db){_0x1a749c=_0x1a749c-0x0;var _0x2f170b=_0x3013[_0x1a749c];return _0x2f170b;};'use strict';function Interval(_0x5f2660){this['id']=_0x5f2660['id']||0x0;this[_0x3301('0x0')]=_0x5f2660[_0x3301('0x0')]||'';this['Intervals']=_0x5f2660['Intervals']||{};}module[_0x3301('0x1')]=Interval; \ No newline at end of file +var _0xac40=['Intervals','name'];(function(_0x149013,_0x268258){var _0x502195=function(_0x4ec420){while(--_0x4ec420){_0x149013['push'](_0x149013['shift']());}};_0x502195(++_0x268258);}(_0xac40,0x147));var _0x0ac4=function(_0x5e4b58,_0x3155bc){_0x5e4b58=_0x5e4b58-0x0;var _0x10d10c=_0xac40[_0x5e4b58];return _0x10d10c;};'use strict';function Interval(_0x1b0174){this['id']=_0x1b0174['id']||0x0;this[_0x0ac4('0x0')]=_0x1b0174[_0x0ac4('0x0')]||'';this[_0x0ac4('0x1')]=_0x1b0174[_0x0ac4('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 7ba9fbb..bbf5bea 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 _0x62b5=['redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','loggedIn','length','mailPause','paused','available','format','mail:queue:%s','mail_queue:save','exports','md5'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x62b5,0xe5));var _0x562b=function(_0x5ce314,_0x485857){_0x5ce314=_0x5ce314-0x0;var _0xb435d9=_0x62b5[_0x5ce314];return _0xb435d9;};'use strict';var _=require('lodash');var md5=require(_0x562b('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x562b('0x1')],{'host':_0x562b('0x2'),'port':0x18eb});var io=require(_0x562b('0x3'))(new Redis(config[_0x562b('0x1')]));function MailQueue(_0x51fcae){this['id']=_0x51fcae['id']||0x0;this[_0x562b('0x4')]=_0x51fcae[_0x562b('0x4')]||'';this[_0x562b('0x5')]=_0x51fcae[_0x562b('0x5')]||0xa;this[_0x562b('0x6')]=_0x51fcae[_0x562b('0x6')]||'beepall';this[_0x562b('0x7')]=_0x51fcae[_0x562b('0x7')];this[_0x562b('0x8')]={};this[_0x562b('0x9')]=0x0;this[_0x562b('0x0')]='';this['updateRouting']();this[_0x562b('0xa')]();}MailQueue[_0x562b('0xb')][_0x562b('0xc')]=function(){var _0x5602f1=this[_0x562b('0x8')]['_rr'];this[_0x562b('0x8')]=_[_0x562b('0xd')](this[_0x562b('0x7')],'id');this[_0x562b('0x8')]['_rr']=_0x5602f1;};MailQueue[_0x562b('0xb')]['updateRealtime']=function(){this[_0x562b('0xe')]=0x0;this['paused']=0x0;for(var _0x161253=0x0;_0x161253=0x0?this['available']:0x0;var _0x1f1cca={'id':this['id'],'available':this[_0x562b('0x12')],'loggedIn':this[_0x562b('0xe')],'name':this['name'],'paused':this[_0x562b('0x11')],'waiting':this[_0x562b('0x9')]};var _0x1b86ff=md5(JSON['stringify'](_0x1f1cca));if(this[_0x562b('0x0')]!==_0x1b86ff){this['md5']=_0x1b86ff;io['to'](util[_0x562b('0x13')](_0x562b('0x14'),_0x1f1cca['name']))['emit'](_0x562b('0x15'),_0x1f1cca);}};module[_0x562b('0x16')]=MailQueue; \ No newline at end of file +var _0x691d=['emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','stringify','mail:queue:%s'];(function(_0x498ec5,_0x28b384){var _0x50bec7=function(_0x2d7f26){while(--_0x2d7f26){_0x498ec5['push'](_0x498ec5['shift']());}};_0x50bec7(++_0x28b384);}(_0x691d,0x7b));var _0xd691=function(_0x506475,_0x534546){_0x506475=_0x506475-0x0;var _0x17ca20=_0x691d[_0x506475];return _0x17ca20;};'use strict';var _=require(_0xd691('0x0'));var md5=require(_0xd691('0x1'));var util=require(_0xd691('0x2'));var Redis=require('ioredis');var config=require(_0xd691('0x3'));config[_0xd691('0x4')]=_[_0xd691('0x5')](config[_0xd691('0x4')],{'host':_0xd691('0x6'),'port':0x18eb});var io=require(_0xd691('0x7'))(new Redis(config['redis']));function MailQueue(_0x1c6ae4){this['id']=_0x1c6ae4['id']||0x0;this[_0xd691('0x8')]=_0x1c6ae4[_0xd691('0x8')]||'';this[_0xd691('0x9')]=_0x1c6ae4['timeout']||0xa;this['strategy']=_0x1c6ae4[_0xd691('0xa')]||_0xd691('0xb');this[_0xd691('0xc')]=_0x1c6ae4['Agents'];this[_0xd691('0xd')]={};this[_0xd691('0xe')]=0x0;this[_0xd691('0x1')]='';this[_0xd691('0xf')]();this[_0xd691('0x10')]();}MailQueue[_0xd691('0x11')][_0xd691('0xf')]=function(){var _0x182d32=this[_0xd691('0xd')][_0xd691('0x12')];this['mapAgentsId']=_[_0xd691('0x13')](this[_0xd691('0xc')],'id');this[_0xd691('0xd')]['_rr']=_0x182d32;};MailQueue[_0xd691('0x11')][_0xd691('0x10')]=function(){this[_0xd691('0x14')]=0x0;this[_0xd691('0x15')]=0x0;for(var _0x5c1bc5=0x0;_0x5c1bc5=0x0?this[_0xd691('0x18')]:0x0;var _0x54302f={'id':this['id'],'available':this[_0xd691('0x18')],'loggedIn':this[_0xd691('0x14')],'name':this[_0xd691('0x8')],'paused':this[_0xd691('0x15')],'waiting':this['waiting']};var _0x1c1015=md5(JSON[_0xd691('0x19')](_0x54302f));if(this[_0xd691('0x1')]!==_0x1c1015){this[_0xd691('0x1')]=_0x1c1015;io['to'](util['format'](_0xd691('0x1a'),_0x54302f[_0xd691('0x8')]))[_0xd691('0x1b')](_0xd691('0x1c'),_0x54302f);}};module[_0xd691('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 77c3860..8febad8 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x7a54,0x106));var _0x47a5=function(_0x199e52,_0x2e17ca){_0x199e52=_0x199e52-0x0;var _0x85855d=_0x7a54[_0x199e52];return _0x85855d;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x38ad85,_0x58d431){_0x38ad85=_0x38ad85-0x0;var _0xafa412=_0x2ef3[_0x38ad85];return _0xafa412;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d9b711a..96005b2 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 _0x7341=['updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','smsPause','available','emit','exports','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting'];(function(_0x53f740,_0x1c689c){var _0x50636a=function(_0x304fbc){while(--_0x304fbc){_0x53f740['push'](_0x53f740['shift']());}};_0x50636a(++_0x1c689c);}(_0x7341,0xe4));var _0x1734=function(_0x4bdc07,_0x2adad1){_0x4bdc07=_0x4bdc07-0x0;var _0x1069b3=_0x7341[_0x4bdc07];return _0x1069b3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1734('0x0'));var Redis=require('ioredis');var config=require(_0x1734('0x1'));config[_0x1734('0x2')]=_['defaults'](config[_0x1734('0x2')],{'host':_0x1734('0x3'),'port':0x18eb});var io=require(_0x1734('0x4'))(new Redis(config[_0x1734('0x2')]));function SmsQueue(_0x2de514){this['id']=_0x2de514['id']||0x0;this[_0x1734('0x5')]=_0x2de514[_0x1734('0x5')]||'';this['timeout']=_0x2de514[_0x1734('0x6')]||0xa;this[_0x1734('0x7')]=_0x2de514[_0x1734('0x7')]||'beepall';this[_0x1734('0x8')]=_0x2de514['Agents'];this['mapAgentsId']={};this[_0x1734('0x9')]=0x0;this[_0x1734('0xa')]='';this[_0x1734('0xb')]();this[_0x1734('0xc')]();}SmsQueue[_0x1734('0xd')][_0x1734('0xb')]=function(){var _0x33edca=this[_0x1734('0xe')][_0x1734('0xf')];this[_0x1734('0xe')]=_['map'](this[_0x1734('0x8')],'id');this[_0x1734('0xe')][_0x1734('0xf')]=_0x33edca;};SmsQueue[_0x1734('0xd')][_0x1734('0xc')]=function(){this[_0x1734('0x10')]=0x0;this[_0x1734('0x11')]=0x0;for(var _0xd2f288=0x0;_0xd2f288=0x0?this[_0x1734('0x15')]:0x0;var _0x665ddc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1734('0x10')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x14347d=md5(JSON['stringify'](_0x665ddc));if(this[_0x1734('0xa')]!==_0x14347d){this[_0x1734('0xa')]=_0x14347d;io['to'](util['format']('sms:queue:%s',_0x665ddc['name']))[_0x1734('0x16')]('sms_queue:save',_0x665ddc);}};module[_0x1734('0x17')]=SmsQueue; \ No newline at end of file +var _0xfd28=['waiting','format','emit','exports','md5','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','map','_rr','prototype','loggedIn','paused','length','online','smsPause','available'];(function(_0x493a54,_0x3a3426){var _0x523b25=function(_0x665cd5){while(--_0x665cd5){_0x493a54['push'](_0x493a54['shift']());}};_0x523b25(++_0x3a3426);}(_0xfd28,0x148));var _0x8fd2=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xfd28[_0x4551f6];return _0x581dc2;};'use strict';var _=require('lodash');var md5=require(_0x8fd2('0x0'));var util=require(_0x8fd2('0x1'));var Redis=require('ioredis');var config=require(_0x8fd2('0x2'));config['redis']=_[_0x8fd2('0x3')](config[_0x8fd2('0x4')],{'host':_0x8fd2('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fd2('0x4')]));function SmsQueue(_0x2f694f){this['id']=_0x2f694f['id']||0x0;this[_0x8fd2('0x6')]=_0x2f694f[_0x8fd2('0x6')]||'';this[_0x8fd2('0x7')]=_0x2f694f['timeout']||0xa;this['strategy']=_0x2f694f[_0x8fd2('0x8')]||_0x8fd2('0x9');this[_0x8fd2('0xa')]=_0x2f694f['Agents'];this[_0x8fd2('0xb')]={};this['waiting']=0x0;this[_0x8fd2('0x0')]='';this['updateRouting']();this[_0x8fd2('0xc')]();}SmsQueue['prototype'][_0x8fd2('0xd')]=function(){var _0x5244ed=this[_0x8fd2('0xb')]['_rr'];this[_0x8fd2('0xb')]=_[_0x8fd2('0xe')](this[_0x8fd2('0xa')],'id');this[_0x8fd2('0xb')][_0x8fd2('0xf')]=_0x5244ed;};SmsQueue[_0x8fd2('0x10')][_0x8fd2('0xc')]=function(){this[_0x8fd2('0x11')]=0x0;this[_0x8fd2('0x12')]=0x0;for(var _0x2b4611=0x0;_0x2b4611=0x0?this[_0x8fd2('0x16')]:0x0;var _0x5c8b3c={'id':this['id'],'available':this[_0x8fd2('0x16')],'loggedIn':this[_0x8fd2('0x11')],'name':this[_0x8fd2('0x6')],'paused':this[_0x8fd2('0x12')],'waiting':this[_0x8fd2('0x17')]};var _0x5f2313=md5(JSON['stringify'](_0x5c8b3c));if(this[_0x8fd2('0x0')]!==_0x5f2313){this['md5']=_0x5f2313;io['to'](util[_0x8fd2('0x18')]('sms:queue:%s',_0x5c8b3c[_0x8fd2('0x6')]))[_0x8fd2('0x19')]('sms_queue:save',_0x5c8b3c);}};module[_0x8fd2('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2c318d0..d40d9f6 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 _0xaaa8=['updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x477057,_0x1a1e6c){var _0x4fe03f=function(_0x64a06f){while(--_0x64a06f){_0x477057['push'](_0x477057['shift']());}};_0x4fe03f(++_0x1a1e6c);}(_0xaaa8,0x1be));var _0x8aaa=function(_0x5cc465,_0x662c63){_0x5cc465=_0x5cc465-0x0;var _0x4b3750=_0xaaa8[_0x5cc465];return _0x4b3750;};'use strict';var _=require(_0x8aaa('0x0'));var md5=require(_0x8aaa('0x1'));var util=require(_0x8aaa('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x8aaa('0x3')]=_['defaults'](config[_0x8aaa('0x3')],{'host':_0x8aaa('0x4'),'port':0x18eb});var io=require(_0x8aaa('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x4c93a0){this['id']=_0x4c93a0['id']||0x0;this['name']=_0x4c93a0[_0x8aaa('0x6')]||'';this[_0x8aaa('0x7')]=_0x4c93a0[_0x8aaa('0x7')]||0xa;this[_0x8aaa('0x8')]=_0x4c93a0[_0x8aaa('0x8')]||_0x8aaa('0x9');this[_0x8aaa('0xa')]=_0x4c93a0[_0x8aaa('0xa')];this[_0x8aaa('0xb')]={};this[_0x8aaa('0xc')]=0x0;this[_0x8aaa('0x1')]='';this[_0x8aaa('0xd')]();this[_0x8aaa('0xe')]();}WhatsappQueue[_0x8aaa('0xf')][_0x8aaa('0xd')]=function(){var _0x1cd88e=this['mapAgentsId'][_0x8aaa('0x10')];this[_0x8aaa('0xb')]=_['map'](this[_0x8aaa('0xa')],'id');this[_0x8aaa('0xb')][_0x8aaa('0x10')]=_0x1cd88e;};WhatsappQueue['prototype'][_0x8aaa('0xe')]=function(){this[_0x8aaa('0x11')]=0x0;this[_0x8aaa('0x12')]=0x0;for(var _0x1d442c=0x0;_0x1d442c=0x0?this['available']:0x0;var _0x87ff31={'id':this['id'],'available':this[_0x8aaa('0x14')],'loggedIn':this[_0x8aaa('0x11')],'name':this[_0x8aaa('0x6')],'paused':this[_0x8aaa('0x12')],'waiting':this['waiting']};var _0x2f1147=md5(JSON[_0x8aaa('0x15')](_0x87ff31));if(this['md5']!==_0x2f1147){this[_0x8aaa('0x1')]=_0x2f1147;io['to'](util[_0x8aaa('0x16')](_0x8aaa('0x17'),_0x87ff31['name']))[_0x8aaa('0x18')](_0x8aaa('0x19'),_0x87ff31);}};module[_0x8aaa('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x88e1=['format','whatsapp:queue:%s','whatsapp_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','map','mapAgentsId','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify'];(function(_0x50e8f8,_0x272c05){var _0x761649=function(_0x253f17){while(--_0x253f17){_0x50e8f8['push'](_0x50e8f8['shift']());}};_0x761649(++_0x272c05);}(_0x88e1,0x1a7));var _0x188e=function(_0x1c66d8,_0x16d85d){_0x1c66d8=_0x1c66d8-0x0;var _0xf1cc0a=_0x88e1[_0x1c66d8];return _0xf1cc0a;};'use strict';var _=require(_0x188e('0x0'));var md5=require('md5');var util=require(_0x188e('0x1'));var Redis=require(_0x188e('0x2'));var config=require(_0x188e('0x3'));config[_0x188e('0x4')]=_[_0x188e('0x5')](config[_0x188e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x188e('0x6'))(new Redis(config[_0x188e('0x4')]));function WhatsappQueue(_0x65afca){this['id']=_0x65afca['id']||0x0;this['name']=_0x65afca[_0x188e('0x7')]||'';this[_0x188e('0x8')]=_0x65afca[_0x188e('0x8')]||0xa;this[_0x188e('0x9')]=_0x65afca[_0x188e('0x9')]||'beepall';this[_0x188e('0xa')]=_0x65afca[_0x188e('0xa')];this['mapAgentsId']={};this[_0x188e('0xb')]=0x0;this[_0x188e('0xc')]='';this[_0x188e('0xd')]();this[_0x188e('0xe')]();}WhatsappQueue['prototype'][_0x188e('0xd')]=function(){var _0x2da5b4=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x188e('0xf')](this[_0x188e('0xa')],'id');this[_0x188e('0x10')][_0x188e('0x11')]=_0x2da5b4;};WhatsappQueue['prototype'][_0x188e('0xe')]=function(){this[_0x188e('0x12')]=0x0;this[_0x188e('0x13')]=0x0;for(var _0x45cb3b=0x0;_0x45cb3b=0x0?this[_0x188e('0x17')]:0x0;var _0x6e6d2a={'id':this['id'],'available':this[_0x188e('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x188e('0x7')],'paused':this[_0x188e('0x13')],'waiting':this['waiting']};var _0x301438=md5(JSON[_0x188e('0x18')](_0x6e6d2a));if(this[_0x188e('0xc')]!==_0x301438){this['md5']=_0x301438;io['to'](util[_0x188e('0x19')](_0x188e('0x1a'),_0x6e6d2a['name']))['emit'](_0x188e('0x1b'),_0x6e6d2a);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index e45590d..c9df087 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x729e94,_0x2b8e03){var _0x23f377=function(_0x435343){while(--_0x435343){_0x729e94['push'](_0x729e94['shift']());}};_0x23f377(++_0x2b8e03);}(_0xb10b,0x12a));var _0xbb10=function(_0x425541,_0x5dec0e){_0x425541=_0x425541-0x0;var _0x455616=_0xb10b[_0x425541];return _0x455616;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 366f7f7..edd4bfb 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 _0x2701=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x2d2b3e,_0x590803){var _0x1fbd17=function(_0x49c800){while(--_0x49c800){_0x2d2b3e['push'](_0x2d2b3e['shift']());}};_0x1fbd17(++_0x590803);}(_0x2701,0x19e));var _0x1270=function(_0x325ee2,_0xaf1371){_0x325ee2=_0x325ee2-0x0;var _0x7f2741=_0x2701[_0x325ee2];return _0x7f2741;};'use strict';var client=require(_0x1270('0x0'));exports[_0x1270('0x1')]=function(_0xe506f1,_0x37260d){return client[_0x1270('0x2')](_0x1270('0x3'),{'body':_0x37260d,'options':{'where':{'id':_0xe506f1}},'log':_0x1270('0x4')});};exports[_0x1270('0x5')]=function(_0x3c7644,_0x373417){return client[_0x1270('0x2')](_0x1270('0x6'),{'body':_0x373417,'options':{'where':{'id':_0x3c7644}},'log':_0x1270('0x7')});}; \ No newline at end of file +var _0x569e=['addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x2d3030,_0x2daea2){var _0x247c7e=function(_0x59b550){while(--_0x59b550){_0x2d3030['push'](_0x2d3030['shift']());}};_0x247c7e(++_0x2daea2);}(_0x569e,0x181));var _0xe569=function(_0x26ec1c,_0x274d1b){_0x26ec1c=_0x26ec1c-0x0;var _0x3759c0=_0x569e[_0x26ec1c];return _0x3759c0;};'use strict';var client=require(_0xe569('0x0'));exports[_0xe569('0x1')]=function(_0x22ee4e,_0x5efcc8){return client['Request'](_0xe569('0x2'),{'body':_0x5efcc8,'options':{'where':{'id':_0x22ee4e}},'log':_0xe569('0x3')});};exports[_0xe569('0x4')]=function(_0x7a9b25,_0x3d224b){return client[_0xe569('0x5')](_0xe569('0x6'),{'body':_0x3d224b,'options':{'where':{'id':_0x7a9b25}},'log':_0xe569('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9b45925..d54f791 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 _0x5298=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x56b04e,_0x471ebc){var _0x4149b9=function(_0x591220){while(--_0x591220){_0x56b04e['push'](_0x56b04e['shift']());}};_0x4149b9(++_0x471ebc);}(_0x5298,0x12d));var _0x8529=function(_0xa1bc8c,_0x4565c4){_0xa1bc8c=_0xa1bc8c-0x0;var _0x67a8a9=_0x5298[_0xa1bc8c];return _0x67a8a9;};'use strict';var client=require(_0x8529('0x0'));exports[_0x8529('0x1')]=function(_0x3810e5){return client[_0x8529('0x2')](_0x8529('0x3'),{'body':_0x3810e5,'log':_0x8529('0x4')});}; \ No newline at end of file +var _0xc521=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0xa3d357,_0x1213b4){var _0x41b03c=function(_0x3c55ea){while(--_0x3c55ea){_0xa3d357['push'](_0xa3d357['shift']());}};_0x41b03c(++_0x1213b4);}(_0xc521,0x8f));var _0x1c52=function(_0x4798f9,_0x184fe1){_0x4798f9=_0x4798f9-0x0;var _0x44846a=_0xc521[_0x4798f9];return _0x44846a;};'use strict';var client=require(_0x1c52('0x0'));exports['create']=function(_0x1dfa46){return client[_0x1c52('0x1')](_0x1c52('0x2'),{'body':_0x1dfa46,'log':_0x1c52('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 223c4d6..61c73e0 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 _0x2fed=['Request','GetChatQueue','name','strategy','User','online','chatPause','../client','getChatQueues'];(function(_0x271e26,_0xeaa798){var _0x4c3771=function(_0x594c71){while(--_0x594c71){_0x271e26['push'](_0x271e26['shift']());}};_0x4c3771(++_0xeaa798);}(_0x2fed,0x7c));var _0xd2fe=function(_0x437700,_0x33d3df){_0x437700=_0x437700-0x0;var _0x53ed92=_0x2fed[_0x437700];return _0x53ed92;};'use strict';var client=require(_0xd2fe('0x0'));exports[_0xd2fe('0x1')]=function(){return function(){return client[_0xd2fe('0x2')](_0xd2fe('0x3'),{'options':{'raw':![],'attributes':['id',_0xd2fe('0x4'),'timeout',_0xd2fe('0x5')],'include':[{'model':_0xd2fe('0x6'),'as':'Agents','attributes':['id','name',_0xd2fe('0x7'),_0xd2fe('0x8')]}]},'log':_0xd2fe('0x1')});};}; \ No newline at end of file +var _0xb76d=['online','chatPause','../client','Request','GetChatQueue','name','strategy','User','Agents'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xb76d,0x119));var _0xdb76=function(_0x42ac17,_0x1d6995){_0x42ac17=_0x42ac17-0x0;var _0x3c1f44=_0xb76d[_0x42ac17];return _0x3c1f44;};'use strict';var client=require(_0xdb76('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xdb76('0x1')](_0xdb76('0x2'),{'options':{'raw':![],'attributes':['id',_0xdb76('0x3'),'timeout',_0xdb76('0x4')],'include':[{'model':_0xdb76('0x5'),'as':_0xdb76('0x6'),'attributes':['id',_0xdb76('0x3'),_0xdb76('0x7'),_0xdb76('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 71123e2..1ecc0ac 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 _0x292e=['Request','update','DESC','../client','create'];(function(_0x3e14ca,_0x3b5269){var _0x5926e7=function(_0x3789ac){while(--_0x3789ac){_0x3e14ca['push'](_0x3e14ca['shift']());}};_0x5926e7(++_0x3b5269);}(_0x292e,0xcb));var _0xe292=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x292e[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xe292('0x0'));exports[_0xe292('0x1')]=function(_0x34fdf4){return client[_0xe292('0x2')]('CreateChatQueueReport',{'body':_0x34fdf4,'log':'CreateChatQueueReport'});};exports[_0xe292('0x3')]=function(_0x343aee,_0x17890d){return client[_0xe292('0x2')]('UpdateChatQueueReport',{'body':_0x17890d,'options':{'where':{'uniqueid':_0x343aee},'order':[['id',_0xe292('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xfc1e=['UpdateChatQueueReport','Request','CreateChatQueueReport','update'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4d6ac0,_0x201628){_0x4d6ac0=_0x4d6ac0-0x0;var _0x5296c4=_0xfc1e[_0x4d6ac0];return _0x5296c4;};'use strict';var client=require('../client');exports['create']=function(_0x5407e7){return client[_0xefc1('0x0')](_0xefc1('0x1'),{'body':_0x5407e7,'log':_0xefc1('0x1')});};exports[_0xefc1('0x2')]=function(_0xbe8efc,_0x4960a1){return client[_0xefc1('0x0')](_0xefc1('0x3'),{'body':_0x4960a1,'options':{'where':{'uniqueid':_0xbe8efc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 5e337cb..a49f19d 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x377fa2,_0x56e9ca){var _0x3af96b=function(_0x2eda83){while(--_0x2eda83){_0x377fa2['push'](_0x377fa2['shift']());}};_0x3af96b(++_0x56e9ca);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x7a54,0x106));var _0x47a5=function(_0x36c572,_0x23525b){_0x36c572=_0x36c572-0x0;var _0x1eda9f=_0x7a54[_0x36c572];return _0x1eda9f;};'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 fd2ef79..402b3ab 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 _0x262d=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x262d,0x163));var _0xd262=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x262d[_0x1b349a];return _0x5d1f7c;};'use strict';var client=require(_0xd262('0x0'));exports[_0xd262('0x1')]=function(_0x2ed2a6){return client[_0xd262('0x2')](_0xd262('0x3'),{'body':_0x2ed2a6,'log':_0xd262('0x4')});}; \ No newline at end of file +var _0x34e0=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x34e0,0xf3));var _0x034e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x34e0[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require('../client');exports[_0x034e('0x0')]=function(_0x28c797){return client[_0x034e('0x1')](_0x034e('0x2'),{'body':_0x28c797,'log':_0x034e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 70949ff..63e0b0e 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 _0xfaa9=['faxPause','../client','getFaxQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x96b993,_0xd06a20){var _0x1cba29=function(_0x50919f){while(--_0x50919f){_0x96b993['push'](_0x96b993['shift']());}};_0x1cba29(++_0xd06a20);}(_0xfaa9,0xd3));var _0x9faa=function(_0x10d665,_0x5d97fd){_0x10d665=_0x10d665-0x0;var _0x4f967b=_0xfaa9[_0x10d665];return _0x4f967b;};'use strict';var client=require(_0x9faa('0x0'));exports[_0x9faa('0x1')]=function(){return function(){return client[_0x9faa('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x9faa('0x3'),_0x9faa('0x4')],'include':[{'model':_0x9faa('0x5'),'as':_0x9faa('0x6'),'attributes':['id',_0x9faa('0x7'),_0x9faa('0x8'),_0x9faa('0x9')]}]},'log':_0x9faa('0x1')});};}; \ No newline at end of file +var _0x04ba=['name','../client','getFaxQueues','Request','GetFaxQueue','strategy','User'];(function(_0x431962,_0x4b17d6){var _0x3fa576=function(_0x9604fe){while(--_0x9604fe){_0x431962['push'](_0x431962['shift']());}};_0x3fa576(++_0x4b17d6);}(_0x04ba,0x16d));var _0xa04b=function(_0x498ae5,_0x164c33){_0x498ae5=_0x498ae5-0x0;var _0x3f26e2=_0x04ba[_0x498ae5];return _0x3f26e2;};'use strict';var client=require(_0xa04b('0x0'));exports[_0xa04b('0x1')]=function(){return function(){return client[_0xa04b('0x2')](_0xa04b('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xa04b('0x4')],'include':[{'model':_0xa04b('0x5'),'as':'Agents','attributes':['id',_0xa04b('0x6'),'online','faxPause']}]},'log':_0xa04b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 1706977..8bb3898 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 _0x6724=['Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport','update'];(function(_0x4e75d3,_0x47bfaf){var _0x3035cb=function(_0x413d8b){while(--_0x413d8b){_0x4e75d3['push'](_0x4e75d3['shift']());}};_0x3035cb(++_0x47bfaf);}(_0x6724,0xab));var _0x4672=function(_0x5f51ae,_0x2ba86a){_0x5f51ae=_0x5f51ae-0x0;var _0x58fcf5=_0x6724[_0x5f51ae];return _0x58fcf5;};'use strict';var client=require(_0x4672('0x0'));exports[_0x4672('0x1')]=function(_0x291988){return client['Request'](_0x4672('0x2'),{'body':_0x291988,'log':_0x4672('0x2')});};exports[_0x4672('0x3')]=function(_0x3729d9,_0x64acb5){return client[_0x4672('0x4')](_0x4672('0x5'),{'body':_0x64acb5,'options':{'where':{'uniqueid':_0x3729d9},'order':[['id',_0x4672('0x6')]],'limit':0x1},'log':_0x4672('0x5')});}; \ No newline at end of file +var _0x0a50=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x5e16cd,_0x2297dc){var _0x1c63c6=function(_0x32bf9d){while(--_0x32bf9d){_0x5e16cd['push'](_0x5e16cd['shift']());}};_0x1c63c6(++_0x2297dc);}(_0x0a50,0x154));var _0x00a5=function(_0x1cdee7,_0x376452){_0x1cdee7=_0x1cdee7-0x0;var _0x59de88=_0x0a50[_0x1cdee7];return _0x59de88;};'use strict';var client=require(_0x00a5('0x0'));exports[_0x00a5('0x1')]=function(_0x56facb){return client[_0x00a5('0x2')](_0x00a5('0x3'),{'body':_0x56facb,'log':_0x00a5('0x3')});};exports['update']=function(_0x173e43,_0x3d5d1d){return client[_0x00a5('0x2')](_0x00a5('0x4'),{'body':_0x3d5d1d,'options':{'where':{'uniqueid':_0x173e43},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c7cf4ab..d7f3381 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 _0xf4e9=['Interval','Intervals','interval','../client','getIntervals','GetInterval','name'];(function(_0x3ee9b1,_0xbc78c7){var _0x583028=function(_0x20f6da){while(--_0x20f6da){_0x3ee9b1['push'](_0x3ee9b1['shift']());}};_0x583028(++_0xbc78c7);}(_0xf4e9,0x9d));var _0x9f4e=function(_0xe139be,_0x49ef39){_0xe139be=_0xe139be-0x0;var _0x2053da=_0xf4e9[_0xe139be];return _0x2053da;};'use strict';var client=require(_0x9f4e('0x0'));exports[_0x9f4e('0x1')]=function(){return function(){return client['Request'](_0x9f4e('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9f4e('0x3')],'include':[{'model':_0x9f4e('0x4'),'as':_0x9f4e('0x5'),'attributes':['id',_0x9f4e('0x3'),_0x9f4e('0x6')]}]},'log':_0x9f4e('0x1')});};}; \ No newline at end of file +var _0x734c=['getIntervals','Request','Interval','name','../client'];(function(_0x4c0267,_0x27234c){var _0x19ab08=function(_0x22239a){while(--_0x22239a){_0x4c0267['push'](_0x4c0267['shift']());}};_0x19ab08(++_0x27234c);}(_0x734c,0x95));var _0xc734=function(_0x4dd4ce,_0x4f0b58){_0x4dd4ce=_0x4dd4ce-0x0;var _0x4b838b=_0x734c[_0x4dd4ce];return _0x4b838b;};'use strict';var client=require(_0xc734('0x0'));exports[_0xc734('0x1')]=function(){return function(){return client[_0xc734('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xc734('0x3'),'as':'Intervals','attributes':['id',_0xc734('0x4'),'interval']}]},'log':_0xc734('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 8a4e765..96590ca 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 _0x430c=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x1c3113,_0x54b957){var _0x1300d0=function(_0x3196a6){while(--_0x3196a6){_0x1c3113['push'](_0x1c3113['shift']());}};_0x1300d0(++_0x54b957);}(_0x430c,0x1a1));var _0xc430=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x430c[_0x22b8a3];return _0x199a0c;};'use strict';var client=require(_0xc430('0x0'));exports['update']=function(_0x4c0679,_0x426596){return client[_0xc430('0x1')](_0xc430('0x2'),{'body':_0x426596,'options':{'where':{'id':_0x4c0679}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x5ccda6,_0x47d8b9){return client[_0xc430('0x1')](_0xc430('0x3'),{'body':_0x47d8b9,'options':{'where':{'id':_0x5ccda6}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x3423=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x1a6033,_0x4f1711){var _0x27b42d=function(_0x4dbdff){while(--_0x4dbdff){_0x1a6033['push'](_0x1a6033['shift']());}};_0x27b42d(++_0x4f1711);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['update']=function(_0x381e58,_0x16bdb3){return client[_0x3342('0x0')](_0x3342('0x1'),{'body':_0x16bdb3,'options':{'where':{'id':_0x381e58}},'log':_0x3342('0x2')});};exports[_0x3342('0x3')]=function(_0x2207ce,_0x3c5d8d){return client[_0x3342('0x0')](_0x3342('0x4'),{'body':_0x3c5d8d,'options':{'where':{'id':_0x2207ce}},'log':_0x3342('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e6c514b..60b1c74 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 _0x75d6=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x2cde2a,_0x4325c4){var _0x110f55=function(_0x4927f5){while(--_0x4927f5){_0x2cde2a['push'](_0x2cde2a['shift']());}};_0x110f55(++_0x4325c4);}(_0x75d6,0xe8));var _0x675d=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x75d6[_0x412c8f];return _0x27c005;};'use strict';var client=require(_0x675d('0x0'));exports[_0x675d('0x1')]=function(_0x1437f2){return client[_0x675d('0x2')](_0x675d('0x3'),{'body':_0x1437f2,'log':_0x675d('0x4')});}; \ No newline at end of file +var _0x370b=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x42ae50,_0x1c5304){var _0x348360=function(_0x4137ba){while(--_0x4137ba){_0x42ae50['push'](_0x42ae50['shift']());}};_0x348360(++_0x1c5304);}(_0x370b,0xbc));var _0xb370=function(_0x7aaac8,_0x3a4233){_0x7aaac8=_0x7aaac8-0x0;var _0x4a8013=_0x370b[_0x7aaac8];return _0x4a8013;};'use strict';var client=require('../client');exports[_0xb370('0x0')]=function(_0x541311){return client[_0xb370('0x1')](_0xb370('0x2'),{'body':_0x541311,'log':_0xb370('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1456f41..3629189 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 _0x41b5=['../client','Request','GetMailQueue','name','Agents','mailPause'];(function(_0x1aa883,_0x50f53b){var _0x5e9fb5=function(_0x5558f1){while(--_0x5558f1){_0x1aa883['push'](_0x1aa883['shift']());}};_0x5e9fb5(++_0x50f53b);}(_0x41b5,0x14a));var _0x541b=function(_0x5460f2,_0xd158ab){_0x5460f2=_0x5460f2-0x0;var _0x450a1b=_0x41b5[_0x5460f2];return _0x450a1b;};'use strict';var client=require(_0x541b('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x541b('0x1')](_0x541b('0x2'),{'options':{'raw':![],'attributes':['id',_0x541b('0x3'),'timeout','strategy'],'include':[{'model':'User','as':_0x541b('0x4'),'attributes':['id','name','online',_0x541b('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x8ec8=['GetMailQueue','name','timeout','strategy','User','Agents','mailPause','getMailQueues','Request'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8ec8,0xdf));var _0x88ec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8ec8[_0x465a0c];return _0x1e202e;};'use strict';var client=require('../client');exports[_0x88ec('0x0')]=function(){return function(){return client[_0x88ec('0x1')](_0x88ec('0x2'),{'options':{'raw':![],'attributes':['id',_0x88ec('0x3'),_0x88ec('0x4'),_0x88ec('0x5')],'include':[{'model':_0x88ec('0x6'),'as':_0x88ec('0x7'),'attributes':['id',_0x88ec('0x3'),'online',_0x88ec('0x8')]}]},'log':_0x88ec('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 5ef7b77..8cbbbb5 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 _0x439f=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update','Request'];(function(_0x32061c,_0x48c3cb){var _0x2a3edd=function(_0x1c86d6){while(--_0x1c86d6){_0x32061c['push'](_0x32061c['shift']());}};_0x2a3edd(++_0x48c3cb);}(_0x439f,0x1de));var _0xf439=function(_0x4108e9,_0x58da63){_0x4108e9=_0x4108e9-0x0;var _0x369cc4=_0x439f[_0x4108e9];return _0x369cc4;};'use strict';var client=require(_0xf439('0x0'));exports[_0xf439('0x1')]=function(_0x10b26d){return client['Request'](_0xf439('0x2'),{'body':_0x10b26d,'log':_0xf439('0x2')});};exports[_0xf439('0x3')]=function(_0x39a816,_0x551867){return client[_0xf439('0x4')](_0xf439('0x5'),{'body':_0x551867,'options':{'where':{'uniqueid':_0x39a816},'order':[['id',_0xf439('0x6')]],'limit':0x1},'log':_0xf439('0x5')});}; \ No newline at end of file +var _0x5db5=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x28ffae,_0x23e8f8){var _0x4a8d5a=function(_0x2894b5){while(--_0x2894b5){_0x28ffae['push'](_0x28ffae['shift']());}};_0x4a8d5a(++_0x23e8f8);}(_0x5db5,0x78));var _0x55db=function(_0x4c5a17,_0x221bce){_0x4c5a17=_0x4c5a17-0x0;var _0x43bfc5=_0x5db5[_0x4c5a17];return _0x43bfc5;};'use strict';var client=require(_0x55db('0x0'));exports[_0x55db('0x1')]=function(_0x4d68a0){return client[_0x55db('0x2')]('CreateMailQueueReport',{'body':_0x4d68a0,'log':_0x55db('0x3')});};exports[_0x55db('0x4')]=function(_0x27604b,_0x1f7449){return client[_0x55db('0x2')]('UpdateMailQueueReport',{'body':_0x1f7449,'options':{'where':{'uniqueid':_0x27604b},'order':[['id','DESC']],'limit':0x1},'log':_0x55db('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index db4414a..6664b90 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 _0x2884=['addTags','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2884,0x183));var _0x4288=function(_0x51fb0c,_0x937d84){_0x51fb0c=_0x51fb0c-0x0;var _0x6b1d12=_0x2884[_0x51fb0c];return _0x6b1d12;};'use strict';var client=require('../client');exports['update']=function(_0x32768b,_0x1c4698){return client[_0x4288('0x0')](_0x4288('0x1'),{'body':_0x1c4698,'options':{'where':{'id':_0x32768b}},'log':_0x4288('0x2')});};exports[_0x4288('0x3')]=function(_0x349be0,_0x1ea1e0){return client[_0x4288('0x0')]('AddTagsToOpenchannelInteraction',{'body':_0x1ea1e0,'options':{'where':{'id':_0x349be0}},'log':_0x4288('0x4')});}; \ No newline at end of file +var _0xe279=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xe279,0x1d2));var _0x9e27=function(_0x130c7d,_0x155870){_0x130c7d=_0x130c7d-0x0;var _0xaaa03e=_0xe279[_0x130c7d];return _0xaaa03e;};'use strict';var client=require(_0x9e27('0x0'));exports[_0x9e27('0x1')]=function(_0x1b1115,_0x101efb){return client[_0x9e27('0x2')](_0x9e27('0x3'),{'body':_0x101efb,'options':{'where':{'id':_0x1b1115}},'log':_0x9e27('0x4')});};exports[_0x9e27('0x5')]=function(_0x3f4002,_0xe86ced){return client['Request'](_0x9e27('0x6'),{'body':_0xe86ced,'options':{'where':{'id':_0x3f4002}},'log':_0x9e27('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 445d323..aa3b659 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 _0x9508=['../client','CreateOpenchannelMessage'];(function(_0x19e166,_0x4cc641){var _0x5e6bed=function(_0xb7fce7){while(--_0xb7fce7){_0x19e166['push'](_0x19e166['shift']());}};_0x5e6bed(++_0x4cc641);}(_0x9508,0x17c));var _0x8950=function(_0x4a2b9d,_0x58da3e){_0x4a2b9d=_0x4a2b9d-0x0;var _0x4db62d=_0x9508[_0x4a2b9d];return _0x4db62d;};'use strict';var client=require(_0x8950('0x0'));exports['create']=function(_0xc7c01d){return client['Request'](_0x8950('0x1'),{'body':_0xc7c01d,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x3ec7=['CreateOpenchannelMessage','../client','Request'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3ec7,0x1e7));var _0x73ec=function(_0x17ac1e,_0x4abec0){_0x17ac1e=_0x17ac1e-0x0;var _0x29103a=_0x3ec7[_0x17ac1e];return _0x29103a;};'use strict';var client=require(_0x73ec('0x0'));exports['create']=function(_0x382aa2){return client[_0x73ec('0x1')](_0x73ec('0x2'),{'body':_0x382aa2,'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 9bd0af9..1afe3f0 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 _0xa512=['Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xa512,0xcb));var _0x2a51=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0xa512[_0x28b4cd];return _0x4229cc;};'use strict';var client=require('../client');exports[_0x2a51('0x0')]=function(){return function(){return client[_0x2a51('0x1')](_0x2a51('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a51('0x3'),_0x2a51('0x4'),_0x2a51('0x5')],'include':[{'model':_0x2a51('0x6'),'as':_0x2a51('0x7'),'attributes':['id',_0x2a51('0x3'),_0x2a51('0x8'),_0x2a51('0x9')]}]},'log':_0x2a51('0x0')});};}; \ No newline at end of file +var _0xc627=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0xc627,0x90));var _0x7c62=function(_0x56bee6,_0x54dc36){_0x56bee6=_0x56bee6-0x0;var _0x57c048=_0xc627[_0x56bee6];return _0x57c048;};'use strict';var client=require(_0x7c62('0x0'));exports[_0x7c62('0x1')]=function(){return function(){return client[_0x7c62('0x2')](_0x7c62('0x3'),{'options':{'raw':![],'attributes':['id',_0x7c62('0x4'),_0x7c62('0x5'),_0x7c62('0x6')],'include':[{'model':_0x7c62('0x7'),'as':_0x7c62('0x8'),'attributes':['id',_0x7c62('0x4'),_0x7c62('0x9'),_0x7c62('0xa')]}]},'log':_0x7c62('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 67ff66a..9f8d614 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 _0x3f9b=['UpdateOpenchannelQueueReport','DESC','CreateOpenchannelQueueReport','Request'];(function(_0x23fa16,_0x2e27ca){var _0xac3732=function(_0x85dab8){while(--_0x85dab8){_0x23fa16['push'](_0x23fa16['shift']());}};_0xac3732(++_0x2e27ca);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x3e4aec,_0x37949d){_0x3e4aec=_0x3e4aec-0x0;var _0x3553a4=_0x3f9b[_0x3e4aec];return _0x3553a4;};'use strict';var client=require('../client');exports['create']=function(_0x25e416){return client['Request'](_0xb3f9('0x0'),{'body':_0x25e416,'log':_0xb3f9('0x0')});};exports['update']=function(_0x55e5e8,_0x4970d5){return client[_0xb3f9('0x1')](_0xb3f9('0x2'),{'body':_0x4970d5,'options':{'where':{'uniqueid':_0x55e5e8},'order':[['id',_0xb3f9('0x3')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x464b=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x15220a,_0x2da61a){var _0x51e8e3=function(_0x134c0b){while(--_0x134c0b){_0x15220a['push'](_0x15220a['shift']());}};_0x51e8e3(++_0x2da61a);}(_0x464b,0x161));var _0xb464=function(_0x363177,_0x188fe6){_0x363177=_0x363177-0x0;var _0x47770a=_0x464b[_0x363177];return _0x47770a;};'use strict';var client=require(_0xb464('0x0'));exports[_0xb464('0x1')]=function(_0xf01d71){return client[_0xb464('0x2')](_0xb464('0x3'),{'body':_0xf01d71,'log':_0xb464('0x3')});};exports[_0xb464('0x4')]=function(_0x261512,_0x12ce66){return client[_0xb464('0x2')](_0xb464('0x5'),{'body':_0x12ce66,'options':{'where':{'uniqueid':_0x261512},'order':[['id',_0xb464('0x6')]],'limit':0x1},'log':_0xb464('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 1062ded..f2bce94 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 _0x4e00=['update','Request','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x571da0,_0x56c68b){var _0x36b933=function(_0x139bb7){while(--_0x139bb7){_0x571da0['push'](_0x571da0['shift']());}};_0x36b933(++_0x56c68b);}(_0x4e00,0xa0));var _0x04e0=function(_0x435cdb,_0x324808){_0x435cdb=_0x435cdb-0x0;var _0x3981c2=_0x4e00[_0x435cdb];return _0x3981c2;};'use strict';var client=require('../client');exports[_0x04e0('0x0')]=function(_0x53eedb,_0x45bc29){return client[_0x04e0('0x1')]('UpdateSmsInteraction',{'body':_0x45bc29,'options':{'where':{'id':_0x53eedb}},'log':'updateSmsInteraction'});};exports[_0x04e0('0x2')]=function(_0x55d507,_0x129c93){return client[_0x04e0('0x1')](_0x04e0('0x3'),{'body':_0x129c93,'options':{'where':{'id':_0x55d507}},'log':_0x04e0('0x4')});}; \ No newline at end of file +var _0xf483=['addTags','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x451d48,_0x2652dd){var _0x436f61=function(_0x513340){while(--_0x513340){_0x451d48['push'](_0x451d48['shift']());}};_0x436f61(++_0x2652dd);}(_0xf483,0xf2));var _0x3f48=function(_0x4ac371,_0x3a4185){_0x4ac371=_0x4ac371-0x0;var _0x572a04=_0xf483[_0x4ac371];return _0x572a04;};'use strict';var client=require('../client');exports[_0x3f48('0x0')]=function(_0x4fa0f8,_0x37d0f3){return client[_0x3f48('0x1')](_0x3f48('0x2'),{'body':_0x37d0f3,'options':{'where':{'id':_0x4fa0f8}},'log':_0x3f48('0x3')});};exports[_0x3f48('0x4')]=function(_0x312d9c,_0x5deb61){return client['Request']('AddTagsToSmsInteraction',{'body':_0x5deb61,'options':{'where':{'id':_0x312d9c}},'log':_0x3f48('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 396a753..e6bc6f8 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 _0x70c4=['createSmsMessage','create','CreateSmsMessage'];(function(_0x5ee6fa,_0x27118a){var _0x56fc98=function(_0x1dc6d3){while(--_0x1dc6d3){_0x5ee6fa['push'](_0x5ee6fa['shift']());}};_0x56fc98(++_0x27118a);}(_0x70c4,0x160));var _0x470c=function(_0x4515ad,_0x34d65d){_0x4515ad=_0x4515ad-0x0;var _0x3697ce=_0x70c4[_0x4515ad];return _0x3697ce;};'use strict';var client=require('../client');exports[_0x470c('0x0')]=function(_0xac7ab0){return client['Request'](_0x470c('0x1'),{'body':_0xac7ab0,'log':_0x470c('0x2')});}; \ No newline at end of file +var _0xfd45=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xfd45,0x1cf));var _0x5fd4=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xfd45[_0x24259d];return _0x5a701;};'use strict';var client=require(_0x5fd4('0x0'));exports[_0x5fd4('0x1')]=function(_0x4dc37c){return client[_0x5fd4('0x2')](_0x5fd4('0x3'),{'body':_0x4dc37c,'log':_0x5fd4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d39c14e..124438e 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x3d71a4,_0x36b6b8){var _0x34348b=function(_0x28a289){while(--_0x28a289){_0x3d71a4['push'](_0x3d71a4['shift']());}};_0x34348b(++_0x36b6b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x8ffa00,_0x48d500){var _0x409728=function(_0x469cd5){while(--_0x469cd5){_0x8ffa00['push'](_0x8ffa00['shift']());}};_0x409728(++_0x48d500);}(_0x70e0,0x17b));var _0x070e=function(_0x12cfa3,_0x5b6cf9){_0x12cfa3=_0x12cfa3-0x0;var _0xec7225=_0x70e0[_0x12cfa3];return _0xec7225;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 28cf0e7..6784954 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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5f460d,_0x1f91a5){var _0x4b1a00=function(_0x5c733f){while(--_0x5c733f){_0x5f460d['push'](_0x5f460d['shift']());}};_0x4b1a00(++_0x1f91a5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x35fbe5,_0x50967c){var _0x23675a=function(_0x373120){while(--_0x373120){_0x35fbe5['push'](_0x35fbe5['shift']());}};_0x23675a(++_0x50967c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d50c11e..9716b1c 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(_0x53bbc1,_0x1dd8ef){var _0x2f24e9=function(_0x330253){while(--_0x330253){_0x53bbc1['push'](_0x53bbc1['shift']());}};_0x2f24e9(++_0x1dd8ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x57a6ce,_0x3d7316){var _0x38de7e=function(_0x18499b){while(--_0x18499b){_0x57a6ce['push'](_0x57a6ce['shift']());}};_0x38de7e(++_0x3d7316);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 7b08267..b23878d 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 _0x3fc6=['addTags','AddTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x3fc6,0x115));var _0x63fc=function(_0x4f0420,_0x80d344){_0x4f0420=_0x4f0420-0x0;var _0x233159=_0x3fc6[_0x4f0420];return _0x233159;};'use strict';var client=require(_0x63fc('0x0'));exports['update']=function(_0x238ea5,_0xf5c4fb){return client[_0x63fc('0x1')](_0x63fc('0x2'),{'body':_0xf5c4fb,'options':{'where':{'id':_0x238ea5}},'log':'updateWhatsappInteraction'});};exports[_0x63fc('0x3')]=function(_0x26d57e,_0x237af7){return client['Request'](_0x63fc('0x4'),{'body':_0x237af7,'options':{'where':{'id':_0x26d57e}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x938d=['../client','update','Request','UpdateWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x12de47,_0x53a1d7){var _0x4e754e=function(_0x14c242){while(--_0x14c242){_0x12de47['push'](_0x12de47['shift']());}};_0x4e754e(++_0x53a1d7);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd938('0x0'));exports[_0xd938('0x1')]=function(_0x4fb46a,_0x3c6634){return client[_0xd938('0x2')](_0xd938('0x3'),{'body':_0x3c6634,'options':{'where':{'id':_0x4fb46a}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0xc9f24b,_0x429911){return client[_0xd938('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x429911,'options':{'where':{'id':_0xc9f24b}},'log':_0xd938('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 8b84bf7..1d5f403 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 _0x2887=['../client','create','Request'];(function(_0x2b7d08,_0x17ba83){var _0x4a5072=function(_0x2fb60d){while(--_0x2fb60d){_0x2b7d08['push'](_0x2b7d08['shift']());}};_0x4a5072(++_0x17ba83);}(_0x2887,0x1b9));var _0x7288=function(_0x1153ff,_0x2bb354){_0x1153ff=_0x1153ff-0x0;var _0xbc230a=_0x2887[_0x1153ff];return _0xbc230a;};'use strict';var client=require(_0x7288('0x0'));exports[_0x7288('0x1')]=function(_0x44ff19){return client[_0x7288('0x2')]('CreateWhatsappMessage',{'body':_0x44ff19,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xfe79=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x942e40,_0x40a4d5){var _0x2c7c22=function(_0x3355e6){while(--_0x3355e6){_0x942e40['push'](_0x942e40['shift']());}};_0x2c7c22(++_0x40a4d5);}(_0xfe79,0xe2));var _0x9fe7=function(_0x842858,_0x3a3ca0){_0x842858=_0x842858-0x0;var _0x46c2a2=_0xfe79[_0x842858];return _0x46c2a2;};'use strict';var client=require(_0x9fe7('0x0'));exports[_0x9fe7('0x1')]=function(_0x421729){return client[_0x9fe7('0x2')](_0x9fe7('0x3'),{'body':_0x421729,'log':_0x9fe7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index afcbff4..98534fd 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 _0x4d95=['online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','timeout','Agents','name'];(function(_0x1e2a50,_0x654d2a){var _0x332b22=function(_0x3bc013){while(--_0x3bc013){_0x1e2a50['push'](_0x1e2a50['shift']());}};_0x332b22(++_0x654d2a);}(_0x4d95,0x10a));var _0x54d9=function(_0x4c0a74,_0x25670f){_0x4c0a74=_0x4c0a74-0x0;var _0x436be2=_0x4d95[_0x4c0a74];return _0x436be2;};'use strict';var client=require('../client');exports[_0x54d9('0x0')]=function(){return function(){return client[_0x54d9('0x1')](_0x54d9('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x54d9('0x3'),'strategy'],'include':[{'model':'User','as':_0x54d9('0x4'),'attributes':['id',_0x54d9('0x5'),_0x54d9('0x6'),_0x54d9('0x7')]}]},'log':_0x54d9('0x0')});};}; \ No newline at end of file +var _0xf7ab=['whatsappPause','../client','getWhatsappQueues','name','User'];(function(_0x5e1eae,_0x2d2a56){var _0x3217c5=function(_0xb968dd){while(--_0xb968dd){_0x5e1eae['push'](_0x5e1eae['shift']());}};_0x3217c5(++_0x2d2a56);}(_0xf7ab,0x1d7));var _0xbf7a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf7ab[_0x2be8c2];return _0x97f531;};'use strict';var client=require(_0xbf7a('0x0'));exports[_0xbf7a('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xbf7a('0x2'),'timeout','strategy'],'include':[{'model':_0xbf7a('0x3'),'as':'Agents','attributes':['id',_0xbf7a('0x2'),'online',_0xbf7a('0x4')]}]},'log':_0xbf7a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0297ec2..5a0f1d3 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 _0x7457=['Request','CreateWhatsappQueueReport','DESC','UpdateWhatsappQueueReport','../client','create'];(function(_0x46a799,_0x5e331d){var _0x34a37b=function(_0x125416){while(--_0x125416){_0x46a799['push'](_0x46a799['shift']());}};_0x34a37b(++_0x5e331d);}(_0x7457,0xee));var _0x7745=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7457[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x7745('0x0'));exports[_0x7745('0x1')]=function(_0x2aa28d){return client[_0x7745('0x2')](_0x7745('0x3'),{'body':_0x2aa28d,'log':_0x7745('0x3')});};exports['update']=function(_0x2dd9d3,_0x532215){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x532215,'options':{'where':{'uniqueid':_0x2dd9d3},'order':[['id',_0x7745('0x4')]],'limit':0x1},'log':_0x7745('0x5')});}; \ No newline at end of file +var _0x8319=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0x2212d1,_0x419fb0){var _0x47f76c=function(_0x2904c8){while(--_0x2904c8){_0x2212d1['push'](_0x2212d1['shift']());}};_0x47f76c(++_0x419fb0);}(_0x8319,0x1e0));var _0x9831=function(_0x27c736,_0x441161){_0x27c736=_0x27c736-0x0;var _0x37c52c=_0x8319[_0x27c736];return _0x37c52c;};'use strict';var client=require('../client');exports[_0x9831('0x0')]=function(_0x1dc401){return client[_0x9831('0x1')](_0x9831('0x2'),{'body':_0x1dc401,'log':_0x9831('0x2')});};exports[_0x9831('0x3')]=function(_0x20045a,_0xcb41a8){return client[_0x9831('0x1')]('UpdateWhatsappQueueReport',{'body':_0xcb41a8,'options':{'where':{'uniqueid':_0x20045a},'order':[['id',_0x9831('0x4')]],'limit':0x1},'log':_0x9831('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 6467ab5..3b84ee1 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 _0x4945=['end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','timeout','channel','START:%s','rules'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4945,0x1b6));var _0x5494=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4945[_0x5f3f88];return _0xd08119;};'use strict';var schema=require(_0x5494('0x0'));var _=require(_0x5494('0x1'));var util=require('util');var seqqueue=require(_0x5494('0x2'));var logger=require(_0x5494('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x5494('0x4'),'required':!![],'message':_0x5494('0x5')},'timeout':{'type':_0x5494('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x13196e,_0xa1893d,_0x51c2c7){return logger[_0x5494('0x7')](util['format'](_0x5494('0x8'),_0x13196e,_0xa1893d[_0x5494('0x9')],_0x51c2c7));}function handleFindAgent(_0x49fe18){return function(_0x39b99f){return _0x39b99f[_0x5494('0x9')][_0x5494('0xa')]()===_0x49fe18['toLowerCase']();};}exports[_0x5494('0xb')]=function(_0x400676,_0x55c4a0,_0x51c52a,_0x47fd04){return function(_0x26e171){try{var _0x5ec85a={'name':_0x55c4a0[0x0],'timeout':_0x55c4a0[0x1]};var _0x4aceab=queue[_0x5494('0x0')](_0x5ec85a,{'typecast':!![]});if(_0x4aceab[_0x5494('0xc')]){logger[_0x5494('0xd')](_0x5494('0xe'),_0x400676,_['map'](_0x4aceab,_0x5494('0xf'))[_0x5494('0x10')](',\x20'));_0x26e171[_0x5494('0x11')]();}else{var _0x220407=_[_0x5494('0x12')](_0x51c52a[_0x5494('0x13')],handleFindAgent(_0x5ec85a['name']));if(_0x220407){var _0x5c146a=(_0x5ec85a[_0x5494('0x14')]||0xa)*0x3e8;var _0x24f49f,_0x29f92f;var _0x16a2df=seqqueue['createQueue'](_0x5c146a);_0x16a2df['id']=_0x400676;_0x16a2df['atimeout']=_0x5c146a;_0x16a2df['channel']=_0x47fd04[_0x5494('0x15')];writeLog(_0x400676,_0x220407,util['format'](_0x5494('0x16'),_0x5c146a));_0x51c52a[_0x5494('0x17')][_0x400676]['on'](_0x5494('0x18'),function(){logger[_0x5494('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x400676);clearTimeout(_0x29f92f);_0x29f92f=undefined;_0x16a2df[_0x5494('0x19')]();if(_0x51c52a[_0x5494('0x17')][_0x400676]){delete _0x51c52a[_0x5494('0x17')][_0x400676];}_0x26e171[_0x5494('0x11')]();});_0x51c52a['rules'][_0x400676]['on'](_0x5494('0x1a'),function(){if(_0x51c52a[_0x5494('0x17')][_0x400676]){delete _0x51c52a[_0x5494('0x17')][_0x400676];}});_0x29f92f=setTimeout(function(){logger[_0x5494('0x7')](_0x5494('0x1b'),_0x400676);clearTimeout(_0x29f92f);_0x16a2df['close']();_0x26e171[_0x5494('0x1c')]();},_0x5c146a);strategy[_0x5494('0x1d')](_0x16a2df,_0x220407,_0x51c52a,_0x47fd04);}else{logger[_0x5494('0xd')](_0x5494('0x1e'),_0x400676,_0x5ec85a[_0x5494('0x9')]);_0x26e171[_0x5494('0x11')]();}}}catch(_0x2a9df6){console[_0x5494('0x1f')](_0x2a9df6);logger['error']('[%s][QUEUE]\x20%s',_0x400676,_0x2a9df6[_0x5494('0x20')]);_0x26e171[_0x5494('0x11')]();}};}; \ No newline at end of file +var _0x0fa4=['seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','map','message','join','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','lodash','util'];(function(_0x5cd06e,_0x5ba71d){var _0x326542=function(_0x2ea8da){while(--_0x2ea8da){_0x5cd06e['push'](_0x5cd06e['shift']());}};_0x326542(++_0x5ba71d);}(_0x0fa4,0x1c5));var _0x40fa=function(_0x2806cd,_0x1a0454){_0x2806cd=_0x2806cd-0x0;var _0x5bf0f2=_0x0fa4[_0x2806cd];return _0x5bf0f2;};'use strict';var schema=require('validate');var _=require(_0x40fa('0x0'));var util=require(_0x40fa('0x1'));var seqqueue=require(_0x40fa('0x2'));var logger=require(_0x40fa('0x3'))(_0x40fa('0x4'));var strategy=require(_0x40fa('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x40fa('0x6')},'timeout':{'type':_0x40fa('0x7'),'message':_0x40fa('0x8')}});function writeLog(_0x5c1096,_0x492f15,_0x50922d){return logger['info'](util['format'](_0x40fa('0x9'),_0x5c1096,_0x492f15[_0x40fa('0xa')],_0x50922d));}function handleFindAgent(_0x6ba1ee){return function(_0x2120d2){return _0x2120d2['name'][_0x40fa('0xb')]()===_0x6ba1ee[_0x40fa('0xb')]();};}exports[_0x40fa('0xc')]=function(_0x3d1113,_0x5658f6,_0x52d540,_0x218005){return function(_0x1e49af){try{var _0x138fe={'name':_0x5658f6[0x0],'timeout':_0x5658f6[0x1]};var _0x3dd44f=queue[_0x40fa('0xd')](_0x138fe,{'typecast':!![]});if(_0x3dd44f['length']){logger[_0x40fa('0xe')]('[%s][AGENT]\x20%s',_0x3d1113,_[_0x40fa('0xf')](_0x3dd44f,_0x40fa('0x10'))[_0x40fa('0x11')](',\x20'));_0x1e49af['stop']();}else{var _0x492718=_['find'](_0x52d540['agents'],handleFindAgent(_0x138fe['name']));if(_0x492718){var _0x43546c=(_0x138fe[_0x40fa('0x12')]||0xa)*0x3e8;var _0xc3406e,_0x3cab62;var _0x5e41ac=seqqueue[_0x40fa('0x13')](_0x43546c);_0x5e41ac['id']=_0x3d1113;_0x5e41ac[_0x40fa('0x14')]=_0x43546c;_0x5e41ac[_0x40fa('0x15')]=_0x218005[_0x40fa('0x15')];writeLog(_0x3d1113,_0x492718,util[_0x40fa('0x16')](_0x40fa('0x17'),_0x43546c));_0x52d540[_0x40fa('0x18')][_0x3d1113]['on'](_0x40fa('0x19'),function(){logger['info'](_0x40fa('0x1a'),_0x3d1113);clearTimeout(_0x3cab62);_0x3cab62=undefined;_0x5e41ac[_0x40fa('0x1b')]();if(_0x52d540[_0x40fa('0x18')][_0x3d1113]){delete _0x52d540[_0x40fa('0x18')][_0x3d1113];}_0x1e49af[_0x40fa('0x1c')]();});_0x52d540['rules'][_0x3d1113]['on'](_0x40fa('0x1d'),function(){if(_0x52d540[_0x40fa('0x18')][_0x3d1113]){delete _0x52d540[_0x40fa('0x18')][_0x3d1113];}});_0x3cab62=setTimeout(function(){logger[_0x40fa('0x1e')](_0x40fa('0x1f'),_0x3d1113);clearTimeout(_0x3cab62);_0x5e41ac['close']();_0x1e49af[_0x40fa('0x20')]();},_0x43546c);strategy[_0x40fa('0x21')](_0x5e41ac,_0x492718,_0x52d540,_0x218005);}else{logger[_0x40fa('0xe')](_0x40fa('0x22'),_0x3d1113,_0x138fe['name']);_0x1e49af[_0x40fa('0x1c')]();}}}catch(_0x230ccf){console['log'](_0x230ccf);logger[_0x40fa('0xe')]('[%s][QUEUE]\x20%s',_0x3d1113,_0x230ccf['stack']);_0x1e49af[_0x40fa('0x1c')]();}};}; \ 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 c4bfdcd..7a152ef 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 _0xde3d=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','Message','then','dialogState','Failed','lodash','./utils','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0xa1db88,_0x4368ea){var _0x1259d1=function(_0x572b1e){while(--_0x572b1e){_0xa1db88['push'](_0xa1db88['shift']());}};_0x1259d1(++_0x4368ea);}(_0xde3d,0x13c));var _0xdde3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde3d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xdde3('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xdde3('0x1'));var logger=require('../../../../config/logger')(_0xdde3('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdde3('0x3')),'smsMessage':require(_0xdde3('0x4')),'faxMessage':require(_0xdde3('0x5')),'whatsappMessage':require(_0xdde3('0x6'))};exports[_0xdde3('0x7')]=function(_0x3b56a3,_0x3436aa){return function(_0x57fddf){try{if(!_['isNil'](this[_0xdde3('0x8')][_0xdde3('0x9')])){logger[_0xdde3('0xa')](_0xdde3('0xb'),_0x3b56a3,_0xdde3('0xc'));return _0x57fddf['next']();}var _0x150755={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdde3('0xd')](_0xdde3('0xe')),'direction':_0xdde3('0xf')};if(this[_0xdde3('0x10')]===_0xdde3('0x11')||this['channel']===_0xdde3('0x12')){_0x150755[_0xdde3('0x13')]=this['interaction'][_0xdde3('0x13')];}var _0x4036b9=this[_0xdde3('0x10')];if(_0x4036b9==='chat'){_0x150755[_0xdde3('0x14')]=this[_0xdde3('0x15')]['id'];}else{_0x150755[_[_0xdde3('0x16')](_0x4036b9)+_0xdde3('0x17')]=this[_0xdde3('0x15')]['id'];}_0x150755[_[_0xdde3('0x16')](_0x4036b9)+_0xdde3('0x18')]=this[_0xdde3('0x8')]['id'];if(this[_0xdde3('0x8')][_0xdde3('0x19')]){var _0x2997b6=_0x3436aa[0x4];if(!_['isEmpty'](_0x2997b6)){_0x150755[_0xdde3('0x1a')]=utils[_0xdde3('0x1b')](_0x2997b6,this);return rpc[_0x4036b9+'Message'][_0xdde3('0x1c')](_0x150755)['then'](function(_0x4df790){logger[_0xdde3('0xa')]('[%s][AMAZONLEX]\x20%s',_0x3b56a3,_0x150755[_0xdde3('0x1a')]);})[_0xdde3('0x1d')](function(_0x596ab9){logger[_0xdde3('0x1e')](_0xdde3('0xb'),_0x3b56a3,JSON[_0xdde3('0x1f')](_0x596ab9));})[_0xdde3('0x20')](function(){logger['info'](_0xdde3('0x21'),_0x3b56a3);_0x57fddf[_0xdde3('0x22')]();});}else{logger['info'](_0xdde3('0x23'),_0x3b56a3);_0x57fddf[_0xdde3('0x22')]();}}else{var _0x417ac1=this;var _0x41e659=new AWS[(_0xdde3('0x24'))]({'accessKeyId':_0x3436aa[0x0],'secretAccessKey':_0x3436aa[0x1],'region':_0x3436aa[0x2]});var _0x369c4c={'botAlias':_0xdde3('0x25'),'botName':_0x3436aa[0x3],'inputText':this[_0xdde3('0x26')][_0xdde3('0x1a')],'userId':this[_0xdde3('0x10')]+':'+this[_0xdde3('0x8')]['id'][_0xdde3('0x27')]()};_0x41e659[_0xdde3('0x28')](_0x369c4c,function(_0x3a377f,_0x3842c7){if(_0x3a377f){logger[_0xdde3('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x3b56a3,_0x3a377f['message']);_0x57fddf[_0xdde3('0x29')]();}else if(_0x3842c7&&_0x3842c7[_0xdde3('0x26')]){_0x417ac1[_0xdde3('0x1a')][_0xdde3('0x2a')]=_0x3842c7;_0x150755[_0xdde3('0x1a')]=_0x3842c7[_0xdde3('0x26')];_0x150755['providerName']=_0xdde3('0x2a');_0x150755['providerResponse']=JSON['stringify'](_0x3842c7);return rpc[_0x4036b9+_0xdde3('0x2b')][_0xdde3('0x1c')](_0x150755)[_0xdde3('0x2c')](function(_0x2ab5fe){logger[_0xdde3('0xa')](_0xdde3('0xb'),_0x3b56a3,_0x150755[_0xdde3('0x1a')]);if(_0x3842c7[_0xdde3('0x2d')]==_0xdde3('0x2e')){_0x57fddf[_0xdde3('0x29')]();}else{_0x57fddf[_0xdde3('0x22')]();}})[_0xdde3('0x1d')](function(_0x5661e4){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3b56a3,JSON[_0xdde3('0x1f')](_0x5661e4));_0x57fddf[_0xdde3('0x29')]();});}else{_0x57fddf[_0xdde3('0x29')]();}});}}catch(_0x140554){logger[_0xdde3('0x1e')](_0xdde3('0xb'),_0x3b56a3,JSON[_0xdde3('0x1f')](_0x140554));_0x57fddf[_0xdde3('0x22')]();}};}; \ No newline at end of file +var _0x6ffc=['./utils','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','account','InteractionId','body','Message','then','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','providerName','create','dialogState','lodash','aws-sdk'];(function(_0x1993a8,_0xd34e39){var _0x353428=function(_0x1b5ab5){while(--_0x1b5ab5){_0x1993a8['push'](_0x1993a8['shift']());}};_0x353428(++_0xd34e39);}(_0x6ffc,0x11d));var _0xc6ff=function(_0x6341a5,_0x4cbef3){_0x6341a5=_0x6341a5-0x0;var _0x2ab22a=_0x6ffc[_0x6341a5];return _0x2ab22a;};'use strict';var _=require(_0xc6ff('0x0'));var moment=require('moment');var AWS=require(_0xc6ff('0x1'));var utils=require(_0xc6ff('0x2'));var logger=require(_0xc6ff('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc6ff('0x4')),'smsMessage':require(_0xc6ff('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc6ff('0x6'))};exports[_0xc6ff('0x7')]=function(_0x51d897,_0x2ac57f){return function(_0x220cac){try{if(!_['isNil'](this['interaction'][_0xc6ff('0x8')])){logger['info'](_0xc6ff('0x9'),_0x51d897,_0xc6ff('0xa'));return _0x220cac[_0xc6ff('0xb')]();}var _0x23ddb3={'ContactId':this['contact']['id'],'sentAt':moment()[_0xc6ff('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xc6ff('0xd')};if(this[_0xc6ff('0xe')]==='sms'||this[_0xc6ff('0xe')]===_0xc6ff('0xf')){_0x23ddb3[_0xc6ff('0x10')]=this[_0xc6ff('0x11')][_0xc6ff('0x10')];}var _0x38a569=this['channel'];if(_0x38a569===_0xc6ff('0x12')){_0x23ddb3[_0xc6ff('0x13')]=this['account']['id'];}else{_0x23ddb3[_[_0xc6ff('0x14')](_0x38a569)+'AccountId']=this[_0xc6ff('0x15')]['id'];}_0x23ddb3[_['upperFirst'](_0x38a569)+_0xc6ff('0x16')]=this[_0xc6ff('0x11')]['id'];if(this[_0xc6ff('0x11')]['created']){var _0x3a802c=_0x2ac57f[0x4];if(!_['isEmpty'](_0x3a802c)){_0x23ddb3[_0xc6ff('0x17')]=utils['getMustacheRender'](_0x3a802c,this);return rpc[_0x38a569+_0xc6ff('0x18')]['create'](_0x23ddb3)[_0xc6ff('0x19')](function(_0x41b105){logger[_0xc6ff('0x1a')](_0xc6ff('0x9'),_0x51d897,_0x23ddb3[_0xc6ff('0x17')]);})[_0xc6ff('0x1b')](function(_0x3cdca0){logger[_0xc6ff('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x51d897,JSON[_0xc6ff('0x1d')](_0x3cdca0));})[_0xc6ff('0x1e')](function(){logger[_0xc6ff('0x1a')](_0xc6ff('0x1f'),_0x51d897);_0x220cac[_0xc6ff('0x20')]();});}else{logger['info'](_0xc6ff('0x21'),_0x51d897);_0x220cac['stop']();}}else{var _0x49d1e3=this;var _0x3bd5d5=new AWS[(_0xc6ff('0x22'))]({'accessKeyId':_0x2ac57f[0x0],'secretAccessKey':_0x2ac57f[0x1],'region':_0x2ac57f[0x2]});var _0x43d0b7={'botAlias':_0xc6ff('0x23'),'botName':_0x2ac57f[0x3],'inputText':this[_0xc6ff('0x24')][_0xc6ff('0x17')],'userId':this[_0xc6ff('0xe')]+':'+this[_0xc6ff('0x11')]['id']['toString']()};_0x3bd5d5[_0xc6ff('0x25')](_0x43d0b7,function(_0x54c17a,_0x35420c){if(_0x54c17a){logger[_0xc6ff('0x1c')](_0xc6ff('0x9'),_0x51d897,_0x54c17a['message']);_0x220cac['next']();}else if(_0x35420c&&_0x35420c['message']){_0x49d1e3[_0xc6ff('0x17')]['amazonlex']=_0x35420c;_0x23ddb3[_0xc6ff('0x17')]=_0x35420c[_0xc6ff('0x24')];_0x23ddb3[_0xc6ff('0x26')]='amazonlex';_0x23ddb3['providerResponse']=JSON['stringify'](_0x35420c);return rpc[_0x38a569+'Message'][_0xc6ff('0x27')](_0x23ddb3)[_0xc6ff('0x19')](function(_0x3dbd7b){logger[_0xc6ff('0x1a')](_0xc6ff('0x9'),_0x51d897,_0x23ddb3[_0xc6ff('0x17')]);if(_0x35420c[_0xc6ff('0x28')]=='Failed'){_0x220cac['next']();}else{_0x220cac['stop']();}})[_0xc6ff('0x1b')](function(_0x2b6df8){logger['error']('[%s][AMAZONLEX]\x20%s',_0x51d897,JSON[_0xc6ff('0x1d')](_0x2b6df8));_0x220cac[_0xc6ff('0xb')]();});}else{_0x220cac['next']();}});}}catch(_0x211efb){logger['error'](_0xc6ff('0x9'),_0x51d897,JSON[_0xc6ff('0x1d')](_0x211efb));_0x220cac[_0xc6ff('0x20')]();}};}; \ 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 9897e5b..8c92ed4 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 _0x2715=['../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','created','interaction','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','from','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','auth','user','messageId','html','','replace','';_0x5055e0[_0x5271('0x3e')]={'Auto-Submitted':_0x5271('0x3f'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0x5271('0x40')](_0x4f9da6,_0x5055e0)[_0x5271('0x41')](function(_0x6dc89d){logger[_0x5271('0x14')](_0x5271('0x42'),_0x124a44);_0x5055e0[_0x5271('0x38')]=_0x6dc89d[_0x5271('0x23')]['messageId'];return rpc[_0x44ee9c+_0x5271('0x2f')]['create'](_0x5055e0);})[_0x5271('0x41')](function(_0x242e77){logger['info']('[%s][AUTOREPLY]\x20%s',_0x124a44,JSON[_0x5271('0x43')](_0x242e77));})[_0x5271('0x44')](function(_0x385a0a){logger[_0x5271('0x45')](_0x5271('0x46'),_0x124a44,JSON[_0x5271('0x43')](_0x385a0a));})[_0x5271('0x47')](function(){Promise[_0x5271('0x48')]()['then'](function(){if(_0x4af661[0x0]!=='2'||_0x270f07[_0x5271('0x1a')])return;return rpc[_0x44ee9c+_0x5271('0x49')][_0x5271('0x4a')](_0x270f07['id'],{'autoreplyExecuted':!![]})[_0x5271('0x41')](function(_0x47917b){logger['info'](_0x5271('0x1b'),_0x124a44,JSON[_0x5271('0x43')](_0x47917b));})[_0x5271('0x44')](function(_0xd5add5){logger['error'](_0x5271('0x4b'),_0x124a44,JSON[_0x5271('0x43')](_0xd5add5));});})[_0x5271('0x41')](function(){_0x20e2ab[_0x5271('0x4c')]();});});}else{return rpc[this[_0x5271('0x10')]+_0x5271('0x2f')][_0x5271('0x4d')](_0x5055e0)[_0x5271('0x41')](function(_0x2730e7){logger[_0x5271('0x14')](_0x5271('0x18'),_0x124a44,_0x5055e0[_0x5271('0x12')]);})[_0x5271('0x44')](function(_0x5745ea){logger[_0x5271('0x45')](_0x5271('0x18'),_0x124a44,JSON[_0x5271('0x43')](_0x5745ea));})[_0x5271('0x47')](function(){Promise[_0x5271('0x48')]()[_0x5271('0x41')](function(){if(_0x4af661[0x0]!=='2'||_0x270f07['autoreplyExecuted'])return;return rpc[_0x44ee9c+'Interaction'][_0x5271('0x4a')](_0x270f07['id'],{'autoreplyExecuted':!![]})[_0x5271('0x41')](function(_0x576fd5){logger[_0x5271('0x14')](_0x5271('0x1b'),_0x124a44,JSON['stringify'](_0x576fd5));})['catch'](function(_0x67c721){logger[_0x5271('0x45')](_0x5271('0x4b'),_0x124a44,JSON['stringify'](_0x67c721));});})['then'](function(){_0x20e2ab[_0x5271('0x4c')]();});});}}}catch(_0x164e0b){logger['error'](_0x5271('0x18'),_0x124a44,JSON['stringify'](_0x164e0b));_0x20e2ab[_0x5271('0x4e')]();}};}; \ No newline at end of file +var _0x32be=['service','Smtp','host','port','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','update','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','info','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','account','upperFirst','AccountId','InteractionId','Message'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x32be,0x10b));var _0xe32b=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0x32be[_0x5d225a];return _0x1e7761;};'use strict';var _=require(_0xe32b('0x0'));var moment=require(_0xe32b('0x1'));var utils=require(_0xe32b('0x2'));var logger=require(_0xe32b('0x3'))(_0xe32b('0x4'));var rpc={'chatMessage':require(_0xe32b('0x5')),'openchannelMessage':require(_0xe32b('0x6')),'mailMessage':require(_0xe32b('0x7')),'smsMessage':require(_0xe32b('0x8')),'faxMessage':require(_0xe32b('0x9')),'whatsappMessage':require(_0xe32b('0xa')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xe32b('0xb')),'smsInteraction':require(_0xe32b('0xc')),'faxInteraction':require(_0xe32b('0xd')),'whatsappInteraction':require(_0xe32b('0xe'))};var mailRpc=require(_0xe32b('0xf'));exports[_0xe32b('0x10')]=function(_0x15455e,_0x58a395,_0x1a019d,_0x31aca4){return function(_0x2c655e){try{var _0x47f507=this[_0xe32b('0x11')];if(_0x47f507==='mail'&&_0x31aca4[_0xe32b('0x12')][_0xe32b('0x13')]){logger['info'](_0xe32b('0x14'),_0x15455e,_0xe32b('0x15'));return _0x2c655e[_0xe32b('0x16')]();}if(_0x58a395[0x0]==='1'&&(_['isNil'](this[_0xe32b('0x17')]['created'])||!this[_0xe32b('0x17')]['created'])){logger[_0xe32b('0x18')]('[%s][AUTOREPLY]\x20%s',_0x15455e,_0xe32b('0x19'));return _0x2c655e[_0xe32b('0x16')]();}if(_0x58a395[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x15455e,_0xe32b('0x1a'));return _0x2c655e[_0xe32b('0x16')]();}var _0x2ec1a9={'ContactId':this[_0xe32b('0x1b')]['id'],'sentAt':moment()[_0xe32b('0x1c')](_0xe32b('0x1d')),'direction':_0xe32b('0x1e')};if(this['channel']===_0xe32b('0x1f')){_0x2ec1a9[_0xe32b('0x12')]=utils['getMustacheRender'](_0x58a395[0x2],this);}else{_0x2ec1a9[_0xe32b('0x12')]=utils[_0xe32b('0x20')](_0x58a395[0x1],this);}if(this[_0xe32b('0x21')]){_0x2ec1a9['to']=this[_0xe32b('0x21')][_0xe32b('0x22')]||'';if(this['channel']===_0xe32b('0x1f')&&_0x58a395[0x1]==='1'){_0x2ec1a9['cc']=this[_0xe32b('0x21')]['cc']||'';}_0x2ec1a9[_0xe32b('0x22')]=this[_0xe32b('0x21')]['to']||'';_0x2ec1a9[_0xe32b('0x23')]=this[_0xe32b('0x21')][_0xe32b('0x23')]||'';_0x2ec1a9[_0xe32b('0x24')]=!![];if(this[_0xe32b('0x21')]['subject']){_0x2ec1a9[_0xe32b('0x25')]='';_0x2ec1a9['subject']+=_[_0xe32b('0x26')](this[_0xe32b('0x21')][_0xe32b('0x25')],'Re:')?'':_0xe32b('0x27');_0x2ec1a9[_0xe32b('0x25')]+=this[_0xe32b('0x21')][_0xe32b('0x25')];}}if(this['channel']==='chat'){_0x2ec1a9['ChatWebsiteId']=this[_0xe32b('0x28')]['id'];}else{_0x2ec1a9[_[_0xe32b('0x29')](this['channel'])+_0xe32b('0x2a')]=this['account']['id'];}_0x2ec1a9[_[_0xe32b('0x29')](this[_0xe32b('0x11')])+_0xe32b('0x2b')]=this[_0xe32b('0x17')]['id'];var _0x152f70=this[_0xe32b('0x17')];if(rpc[this['channel']+_0xe32b('0x2c')]){if(this[_0xe32b('0x11')]===_0xe32b('0x1f')){var _0x36b451={'tls':{'rejectUnauthorized':![]}};if(this[_0xe32b('0x28')]['Smtp']['service']){_0x36b451[_0xe32b('0x2d')]=this['account'][_0xe32b('0x2e')][_0xe32b('0x2d')];}else{_0x36b451[_0xe32b('0x2f')]=this[_0xe32b('0x28')][_0xe32b('0x2e')][_0xe32b('0x2f')];_0x36b451[_0xe32b('0x30')]=this['account'][_0xe32b('0x2e')][_0xe32b('0x30')];_0x36b451[_0xe32b('0x31')]=this[_0xe32b('0x28')]['Smtp'][_0xe32b('0x31')];}if(this[_0xe32b('0x28')]['Smtp'][_0xe32b('0x32')]){_0x36b451['auth']={'user':this[_0xe32b('0x28')][_0xe32b('0x2e')][_0xe32b('0x33')],'pass':this[_0xe32b('0x28')][_0xe32b('0x2e')][_0xe32b('0x34')]};}_0x2ec1a9[_0xe32b('0x35')]=this[_0xe32b('0x21')][_0xe32b('0x36')];_0x2ec1a9[_0xe32b('0x37')]=_0xe32b('0x38')+_[_0xe32b('0x39')](_0x2ec1a9[_0xe32b('0x12')],']+(>|$)/g,''),'priorityTrue':_0x40d66e[0x1],'priorityFalse':_0x40d66e[0x2]};var _0x63207f=gotoif[_0xa6f7('0x0')](_0x3d05f2,{'typecast':!![]});if(_0x63207f[_0xa6f7('0xa')]){logger[_0xa6f7('0xb')](_0xa6f7('0xc'),_0x139e3e,_[_0xa6f7('0xd')](_0x63207f,_0xa6f7('0xe'))[_0xa6f7('0xf')](',\x20'));_0x5587d0[_0xa6f7('0x10')]();}else{try{var _0x56f4fd=eval('('+_0x3d05f2[_0xa6f7('0x11')]+')');var _0x2b405e=_0x56f4fd?_0x3d05f2[_0xa6f7('0x12')]:_0x3d05f2[_0xa6f7('0x13')];logger[_0xa6f7('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x139e3e,_0x3d05f2[_0xa6f7('0x11')],_0x56f4fd,_0x2b405e||_0xa6f7('0x15'));if(_0x2b405e){var _0x5728e0=_['findIndex'](_0x5587d0[_0xa6f7('0x16')](),{'p':_0x2b405e});if(_0x5728e0>=0x0){logger['info'](_0xa6f7('0x17'),_0x139e3e,_0x2b405e||'next',_0x5728e0);_0x5587d0['next'](_0x5728e0);}else{logger[_0xa6f7('0x14')](_0xa6f7('0x18'),_0x139e3e,_0x2b405e||_0xa6f7('0x15'));_0x5587d0['stop']();}}else{_0x5587d0[_0xa6f7('0x15')]();}}catch(_0x2aa46c){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x139e3e,_0x2aa46c[_0xa6f7('0xe')]);_0x5587d0[_0xa6f7('0x10')]();}}}catch(_0x4f8ae0){logger['error'](_0xa6f7('0xc'),_0x139e3e,JSON[_0xa6f7('0x19')](_0x4f8ae0));_0x5587d0[_0xa6f7('0x10')]();}};}; \ No newline at end of file +var _0x54ca=['error','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','[%s][GOTOIF]\x20%s','map','message','priorityTrue','info','condition','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x54ca,0x1e2));var _0xa54c=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x54ca[_0x2ad008];return _0x4538cf;};'use strict';var schema=require('validate');var _=require(_0xa54c('0x0'));var htmlToText=require('html-to-text');var utils=require(_0xa54c('0x1'));var logger=require(_0xa54c('0x2'))(_0xa54c('0x3'));var gotoif=schema({'condition':{'type':_0xa54c('0x4'),'required':!![],'message':_0xa54c('0x5')},'priorityTrue':{'type':_0xa54c('0x6'),'message':_0xa54c('0x7')},'priorityFalse':{'type':_0xa54c('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa54c('0x8')]=function(_0x210e78,_0x34b425){return function(_0x136532){try{var _0x55b020={'condition':htmlToText['fromString'](utils[_0xa54c('0x9')](_0x34b425[0x0],this),{'wordwrap':![]})[_0xa54c('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x34b425[0x1],'priorityFalse':_0x34b425[0x2]};var _0x127cba=gotoif['validate'](_0x55b020,{'typecast':!![]});if(_0x127cba['length']){logger['error'](_0xa54c('0xb'),_0x210e78,_[_0xa54c('0xc')](_0x127cba,_0xa54c('0xd'))['join'](',\x20'));_0x136532['stop']();}else{try{var _0x2cde15=eval('('+_0x55b020['condition']+')');var _0x3139f0=_0x2cde15?_0x55b020[_0xa54c('0xe')]:_0x55b020['priorityFalse'];logger[_0xa54c('0xf')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x210e78,_0x55b020[_0xa54c('0x10')],_0x2cde15,_0x3139f0||'next');if(_0x3139f0){var _0x154740=_[_0xa54c('0x11')](_0x136532['rules'](),{'p':_0x3139f0});if(_0x154740>=0x0){logger[_0xa54c('0xf')](_0xa54c('0x12'),_0x210e78,_0x3139f0||'next',_0x154740);_0x136532[_0xa54c('0x13')](_0x154740);}else{logger['info'](_0xa54c('0x14'),_0x210e78,_0x3139f0||'next');_0x136532[_0xa54c('0x15')]();}}else{_0x136532[_0xa54c('0x13')]();}}catch(_0x55e63b){logger[_0xa54c('0x16')](_0xa54c('0x17'),_0x210e78,_0x55e63b[_0xa54c('0xd')]);_0x136532[_0xa54c('0x15')]();}}}catch(_0x4dbfcb){logger[_0xa54c('0x16')](_0xa54c('0xb'),_0x210e78,JSON['stringify'](_0x4dbfcb));_0x136532[_0xa54c('0x15')]();}};}; \ 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 c0cbd61..0dc74de 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 _0x18ba=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x30ca49,_0x5ee494){var _0x1ad79b=function(_0x1238a2){while(--_0x1238a2){_0x30ca49['push'](_0x30ca49['shift']());}};_0x1ad79b(++_0x5ee494);}(_0x18ba,0x11c));var _0xa18b=function(_0x425a82,_0x28f4ab){_0x425a82=_0x425a82-0x0;var _0x5efc73=_0x18ba[_0x425a82];return _0x5efc73;};'use strict';var schema=require(_0xa18b('0x0'));var _=require(_0xa18b('0x1'));var logger=require(_0xa18b('0x2'))(_0xa18b('0x3'));var gotop=schema({'priority':{'type':_0xa18b('0x4'),'required':!![],'message':_0xa18b('0x5')}});exports[_0xa18b('0x6')]=function(_0x5e19a5,_0x540079){return function(_0xbcd6e7){try{var _0x149e87={'priority':_0x540079[0x0]};var _0x4c4069=gotop[_0xa18b('0x0')](_0x149e87,{'typecast':!![]});if(_0x4c4069[_0xa18b('0x7')]){logger[_0xa18b('0x8')]('[%s][GOTOP]\x20%s',_0x5e19a5,_[_0xa18b('0x9')](_0x4c4069,_0xa18b('0xa'))[_0xa18b('0xb')](',\x20'));_0xbcd6e7[_0xa18b('0xc')]();}else{logger[_0xa18b('0xd')](_0xa18b('0xe'),_0x5e19a5,_0x149e87[_0xa18b('0xf')]);if(_0x149e87[_0xa18b('0xf')]){var _0x1fb567=_[_0xa18b('0x10')](_0xbcd6e7[_0xa18b('0x11')](),{'p':_0x149e87['priority']});if(_0x1fb567>=0x0){logger['info'](_0xa18b('0x12'),_0x5e19a5,_0x149e87[_0xa18b('0xf')]||_0xa18b('0x13'),_0x1fb567);_0xbcd6e7[_0xa18b('0x13')](_0x1fb567);}else{logger[_0xa18b('0xd')](_0xa18b('0x14'),_0x5e19a5,_0x149e87['priority']||_0xa18b('0x13'));_0xbcd6e7[_0xa18b('0xc')]();}}else{_0xbcd6e7[_0xa18b('0x13')]();}}}catch(_0x2bacd3){logger['error'](_0xa18b('0x15'),_0x5e19a5,JSON[_0xa18b('0x16')](_0x2bacd3));_0xbcd6e7[_0xa18b('0xc')]();}};}; \ No newline at end of file +var _0x692b=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info'];(function(_0x51160c,_0x374b59){var _0x15a3fb=function(_0x5e81bc){while(--_0x5e81bc){_0x51160c['push'](_0x51160c['shift']());}};_0x15a3fb(++_0x374b59);}(_0x692b,0x11f));var _0xb692=function(_0x2ae9f6,_0xd4264e){_0x2ae9f6=_0x2ae9f6-0x0;var _0xc2aead=_0x692b[_0x2ae9f6];return _0xc2aead;};'use strict';var schema=require(_0xb692('0x0'));var _=require(_0xb692('0x1'));var logger=require(_0xb692('0x2'))(_0xb692('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb692('0x4')}});exports['consequence']=function(_0x1f4e18,_0x12204a){return function(_0x5931e5){try{var _0x3543fc={'priority':_0x12204a[0x0]};var _0x355331=gotop[_0xb692('0x0')](_0x3543fc,{'typecast':!![]});if(_0x355331[_0xb692('0x5')]){logger[_0xb692('0x6')](_0xb692('0x7'),_0x1f4e18,_[_0xb692('0x8')](_0x355331,_0xb692('0x9'))['join'](',\x20'));_0x5931e5[_0xb692('0xa')]();}else{logger['info'](_0xb692('0xb'),_0x1f4e18,_0x3543fc[_0xb692('0xc')]);if(_0x3543fc[_0xb692('0xc')]){var _0x491138=_[_0xb692('0xd')](_0x5931e5['rules'](),{'p':_0x3543fc[_0xb692('0xc')]});if(_0x491138>=0x0){logger['info'](_0xb692('0xe'),_0x1f4e18,_0x3543fc['priority']||_0xb692('0xf'),_0x491138);_0x5931e5['next'](_0x491138);}else{logger[_0xb692('0x10')](_0xb692('0x11'),_0x1f4e18,_0x3543fc[_0xb692('0xc')]||_0xb692('0xf'));_0x5931e5[_0xb692('0xa')]();}}else{_0x5931e5[_0xb692('0xf')]();}}}catch(_0x1a1f3a){logger[_0xb692('0x6')](_0xb692('0x7'),_0x1f4e18,JSON[_0xb692('0x12')](_0x1a1f3a));_0x5931e5[_0xb692('0xa')]();}};}; \ 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 a0c39b7..6c3360f 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 _0x354c=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','channel','account','upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x354c,0x1e4));var _0xc354=function(_0x533ca3,_0x26e5ec){_0x533ca3=_0x533ca3-0x0;var _0x1c9029=_0x354c[_0x533ca3];return _0x1c9029;};'use strict';var _=require(_0xc354('0x0'));var utils=require(_0xc354('0x1'));var logger=require(_0xc354('0x2'))(_0xc354('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc354('0x4')),'mailMessage':require(_0xc354('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc354('0x6')),'whatsappMessage':require(_0xc354('0x7'))};exports[_0xc354('0x8')]=function(_0x4e3762,_0x548ee0){return function(_0x11c24b){try{var _0x140fa1={'body':utils[_0xc354('0x9')](_0x548ee0[0x0],this),'ContactId':this[_0xc354('0xa')]['id']};if(this['channel']===_0xc354('0xb')){_0x140fa1[_0xc354('0xc')]=this['account']['id'];}else{_0x140fa1[_['upperFirst'](this[_0xc354('0xd')])+'AccountId']=this[_0xc354('0xe')]['id'];}_0x140fa1[_[_0xc354('0xf')](this['channel'])+_0xc354('0x10')]=this[_0xc354('0x11')]['id'];if(rpc[this['channel']+_0xc354('0x12')]){return rpc[this['channel']+_0xc354('0x12')][_0xc354('0x13')](_0x140fa1)['then'](function(_0x48deaf){logger[_0xc354('0x14')](_0xc354('0x15'),_0x4e3762,_0x140fa1[_0xc354('0x16')]);_0x11c24b['next']();})[_0xc354('0x17')](function(_0x5118c3){logger[_0xc354('0x18')](_0xc354('0x15'),_0x4e3762,JSON[_0xc354('0x19')](_0x5118c3));_0x11c24b[_0xc354('0x1a')]();});}}catch(_0x327e08){logger['error'](_0xc354('0x15'),_0x4e3762,JSON[_0xc354('0x19')](_0x327e08));_0x11c24b[_0xc354('0x1a')]();}};}; \ No newline at end of file +var _0xab40=['next','catch','error','stringify','stop','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','upperFirst','AccountId','account','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xab40,0xcd));var _0x0ab4=function(_0x43c312,_0x154112){_0x43c312=_0x43c312-0x0;var _0x572ddb=_0xab40[_0x43c312];return _0x572ddb;};'use strict';var _=require(_0x0ab4('0x0'));var utils=require(_0x0ab4('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0ab4('0x2')),'mailMessage':require(_0x0ab4('0x3')),'smsMessage':require(_0x0ab4('0x4')),'faxMessage':require(_0x0ab4('0x5')),'whatsappMessage':require(_0x0ab4('0x6'))};exports['consequence']=function(_0x5f01aa,_0x28b17a){return function(_0x4ba9d2){try{var _0x10d92b={'body':utils[_0x0ab4('0x7')](_0x28b17a[0x0],this),'ContactId':this[_0x0ab4('0x8')]['id']};if(this[_0x0ab4('0x9')]==='chat'){_0x10d92b['ChatWebsiteId']=this['account']['id'];}else{_0x10d92b[_[_0x0ab4('0xa')](this[_0x0ab4('0x9')])+_0x0ab4('0xb')]=this[_0x0ab4('0xc')]['id'];}_0x10d92b[_[_0x0ab4('0xa')](this[_0x0ab4('0x9')])+_0x0ab4('0xd')]=this[_0x0ab4('0xe')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x0ab4('0x9')]+'Message'][_0x0ab4('0xf')](_0x10d92b)[_0x0ab4('0x10')](function(_0x1e7555){logger[_0x0ab4('0x11')](_0x0ab4('0x12'),_0x5f01aa,_0x10d92b[_0x0ab4('0x13')]);_0x4ba9d2[_0x0ab4('0x14')]();})[_0x0ab4('0x15')](function(_0x3cb1df){logger[_0x0ab4('0x16')](_0x0ab4('0x12'),_0x5f01aa,JSON[_0x0ab4('0x17')](_0x3cb1df));_0x4ba9d2[_0x0ab4('0x18')]();});}}catch(_0x45fad1){logger[_0x0ab4('0x16')](_0x0ab4('0x12'),_0x5f01aa,JSON[_0x0ab4('0x17')](_0x45fad1));_0x4ba9d2[_0x0ab4('0x18')]();}};}; \ 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 e4ac9d4..e423220 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 _0x0b71=['[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender','next'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x0b71,0x65));var _0x10b7=function(_0x5c3834,_0x2f4bcc){_0x5c3834=_0x5c3834-0x0;var _0x415f97=_0x0b71[_0x5c3834];return _0x415f97;};'use strict';var utils=require(_0x10b7('0x0'));var logger=require(_0x10b7('0x1'))(_0x10b7('0x2'));exports[_0x10b7('0x3')]=function(_0x35f5c7,_0xd695ec){return function(_0x2947d1){try{logger[_0x10b7('0x4')]('[%s][NOOP]\x20%s',_0x35f5c7,utils[_0x10b7('0x5')](_0xd695ec[0x0],this));_0x2947d1[_0x10b7('0x6')]();}catch(_0x3577d5){logger['error'](_0x10b7('0x7'),_0x35f5c7,JSON['stringify'](_0x3577d5));_0x2947d1[_0x10b7('0x8')]();}};}; \ No newline at end of file +var _0xa57c=['getMustacheRender','error','stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xa57c,0xb8));var _0xca57=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xa57c[_0x26462c];return _0x509a42;};'use strict';var utils=require('./utils');var logger=require(_0xca57('0x0'))(_0xca57('0x1'));exports[_0xca57('0x2')]=function(_0x115db7,_0x387847){return function(_0x12b5ae){try{logger[_0xca57('0x3')](_0xca57('0x4'),_0x115db7,utils[_0xca57('0x5')](_0x387847[0x0],this));_0x12b5ae['next']();}catch(_0x4c673d){logger[_0xca57('0x6')](_0xca57('0x4'),_0x115db7,JSON[_0xca57('0x7')](_0x4c673d));_0x12b5ae[_0xca57('0x8')]();}};}; \ 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 07aea3d..b582f17 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 _0xa52d=['string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport'];(function(_0x69d6c5,_0x26d921){var _0x19b1e7=function(_0x46a259){while(--_0x46a259){_0x69d6c5['push'](_0x69d6c5['shift']());}};_0x19b1e7(++_0x26d921);}(_0xa52d,0x1dd));var _0xda52=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xa52d[_0x4404ff];return _0x5e7b19;};'use strict';var schema=require(_0xda52('0x0'));var _=require(_0xda52('0x1'));var util=require(_0xda52('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xda52('0x3'));var Redis=require(_0xda52('0x4'));var config=require(_0xda52('0x5'));var logger=require(_0xda52('0x6'))(_0xda52('0x7'));var strategy=require(_0xda52('0x8'));config[_0xda52('0x9')]=_[_0xda52('0xa')](config[_0xda52('0x9')],{'host':_0xda52('0xb'),'port':0x18eb});var io=require(_0xda52('0xc'))(new Redis(config['redis']));var attributes=['id',_0xda52('0xd'),'account',_0xda52('0xe'),'from',_0xda52('0xf')];function emit(_0x41df76,_0xb6dc8d,_0x5ec9a7){io['to'](_0x41df76)[_0xda52('0x10')](_0xb6dc8d,_0x5ec9a7);}function emitChannelQueueInteraction(_0xdb5809,_0x3a6b70,_0x1b3826,_0x213d03,_0x44d061,_0x479879,_0x489390,_0x436731){var _0x1ba50a=_[_0xda52('0x11')](_0x1b3826);_0x1ba50a[_0xda52('0xd')]=_0x436731;_0x1ba50a[_0xda52('0xe')]=_0x3a6b70;_0x1ba50a[_0xda52('0x12')]=_0x213d03;_0x1ba50a['id']=_0x44d061;if(_0x479879){_0x489390[util[_0xda52('0x13')](_0xda52('0x14'),_0xdb5809)][_0x44d061]=_[_0xda52('0x15')](_0x1ba50a,attributes);}else{delete _0x489390[util['format']('%sQueuesWaitingInteractions',_0xdb5809)][_0x44d061];}emit(util[_0xda52('0x13')]('%s:queue:%s',_0xdb5809,_0x3a6b70),util[_0xda52('0x13')](_0xda52('0x16'),_0xdb5809,_0x479879?_0xda52('0x17'):_0xda52('0x18')),_[_0xda52('0x15')](_0x1ba50a,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xda52('0x19')),'smsQueueReport':require(_0xda52('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xda52('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xda52('0x1c'),'message':_0xda52('0x1d')}});function startRouting(_0x52414d,_0xce4f18,_0x215a2c,_0x4a72a0){if(_0x52414d&&_0xce4f18&&_0x215a2c){_0xce4f18[_0xda52('0x1e')]+=0x1;var _0x3275ea={'uniqueid':_0x52414d,'from':_0x215a2c[_0xda52('0x1f')]?_0x215a2c[_0xda52('0x1f')]['from']:'','joinAt':moment()[_0xda52('0x13')](_0xda52('0x20')),'ContactId':_0x215a2c['contact']?_0x215a2c[_0xda52('0x21')]['id']:null,'ListId':_0x215a2c[_0xda52('0x22')]?_0x215a2c['list']['id']:null};_0x3275ea[_['upperFirst'](_0x215a2c[_0xda52('0x23')])+'QueueId']=_0xce4f18['id']||null;_0x3275ea[_['upperFirst'](_0x215a2c[_0xda52('0x23')])+_0xda52('0x24')]=_0x215a2c[_0xda52('0x25')]?_0x215a2c['interaction']['id']:null;_0x3275ea[_[_0xda52('0x26')](_0x215a2c[_0xda52('0x23')])+_0xda52('0x27')]=_0x215a2c[_0xda52('0x28')]?_0x215a2c[_0xda52('0x28')]['id']:null;_0x3275ea[_[_0xda52('0x26')](_0x215a2c['channel'])+(_0x215a2c[_0xda52('0x23')]!==_0xda52('0x29')?_0xda52('0x2a'):'WebsiteId')]=_0x215a2c[_0xda52('0x12')]?_0x215a2c[_0xda52('0x12')]['id']:null;logger[_0xda52('0x2b')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x52414d,_0xce4f18[_0xda52('0x2c')]));emitChannelQueueInteraction(_0x215a2c['channel'],_0xce4f18[_0xda52('0x2c')],_0x3275ea,_0x215a2c[_0xda52('0x12')][_0xda52('0x2c')],_0x215a2c[_0xda52('0x28')]['id'],!![],_0x4a72a0,_0xce4f18['id']);if(rpc[_0x215a2c[_0xda52('0x23')]+_0xda52('0x2d')]){return rpc[_0x215a2c[_0xda52('0x23')]+_0xda52('0x2d')]['create'](_0x3275ea)[_0xda52('0x2e')](function(_0x220ef0){logger[_0xda52('0x2f')](_0xda52('0x30'));});}}}function stopRouting(_0x84e602,_0x1c1f68,_0x2568e8,_0x2ed174){if(_0x84e602&&_0x1c1f68){_0x1c1f68['waiting']-=0x1;var _0x2d87ee={'leaveAt':moment()[_0xda52('0x13')](_0xda52('0x20')),'acceptAt':moment()[_0xda52('0x13')](_0xda52('0x20')),'reason':_0xda52('0x31')};logger[_0xda52('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x84e602,_0x1c1f68[_0xda52('0x2c')]));emitChannelQueueInteraction(_0x2568e8[_0xda52('0x23')],_0x1c1f68[_0xda52('0x2c')],_0x2568e8[_0xda52('0x1f')],_0x2568e8['account'][_0xda52('0x2c')],_0x2568e8['message']['id'],![],_0x2ed174,_0x1c1f68['id']);if(rpc[_0x2568e8['channel']+_0xda52('0x2d')]){return rpc[_0x2568e8[_0xda52('0x23')]+_0xda52('0x2d')][_0xda52('0x32')](_0x84e602,_0x2d87ee)['catch'](function(_0x48aa21){logger['error'](_0xda52('0x33'));});}}}function endRouting(_0x356c20,_0x4953b2,_0x25109d,_0x825e2d){if(_0x356c20&&_0x4953b2){_0x4953b2[_0xda52('0x1e')]-=0x1;var _0x2d5cd8={'leaveAt':moment()[_0xda52('0x13')](_0xda52('0x20')),'exitAt':moment()[_0xda52('0x13')](_0xda52('0x20')),'reason':_0xda52('0x34')};logger[_0xda52('0x2b')](util[_0xda52('0x13')](_0xda52('0x35'),_0x356c20,_0x4953b2['name']));emitChannelQueueInteraction(_0x25109d[_0xda52('0x23')],_0x4953b2[_0xda52('0x2c')],_0x25109d[_0xda52('0x1f')],_0x25109d['account'][_0xda52('0x2c')],_0x25109d[_0xda52('0x28')]['id'],![],_0x825e2d);if(rpc[_0x25109d[_0xda52('0x23')]+'QueueReport']){return rpc[_0x25109d[_0xda52('0x23')]+_0xda52('0x2d')][_0xda52('0x32')](_0x356c20,_0x2d5cd8)[_0xda52('0x2e')](function(_0x4c18ab){logger[_0xda52('0x2f')](_0xda52('0x33'));});}}}function handleFindQueue(_0x1213a2){return function(_0x34a356){return _0x34a356[_0xda52('0x2c')][_0xda52('0x36')]()===_0x1213a2[_0xda52('0x36')]();};}exports['consequence']=function(_0x2511bb,_0x3a190e,_0x249f90,_0x48b3b4){return function(_0x1da3a8){try{var _0x5d2dba={'name':_0x3a190e[0x0],'timeout':_0x3a190e[0x1]};var _0x31159c=queue[_0xda52('0x0')](_0x5d2dba,{'typecast':!![]});if(_0x31159c[_0xda52('0x37')]){logger[_0xda52('0x2f')](_0xda52('0x38'),_0x2511bb,_[_0xda52('0x39')](_0x31159c,_0xda52('0x28'))[_0xda52('0x3a')](',\x20'));_0x1da3a8[_0xda52('0x3b')]();}else{var _0x4f7170=_[_0xda52('0x3c')](_0x249f90[_0x48b3b4[_0xda52('0x23')]+_0xda52('0x3d')],handleFindQueue(_0x5d2dba[_0xda52('0x2c')]));if(_0x4f7170){startRouting(_0x2511bb,_0x4f7170,_0x48b3b4,_0x249f90);var _0x455a1a=(_0x4f7170[_0xda52('0x34')]||0xa)*0x3e8;var _0xfcb95a=(_0x5d2dba[_0xda52('0x34')]||0x14)*0x3e8;var _0x46b646,_0x1bdf16;if(_0x455a1a>_0xfcb95a){_0xfcb95a=_0x455a1a;}var _0x37bdab=seqqueue[_0xda52('0x3e')](_0x455a1a);_0x37bdab['id']=_0x2511bb;_0x37bdab[_0xda52('0x3f')]=_0x455a1a;_0x37bdab[_0xda52('0x40')]=_0xfcb95a;_0x37bdab[_0xda52('0x23')]=_0x48b3b4['channel'];_0x249f90[_0xda52('0x41')][_0x2511bb]['on'](_0xda52('0x42'),function(){logger[_0xda52('0x2b')](_0xda52('0x43'),_0x2511bb);stopRouting(_0x2511bb,_0x4f7170,_0x48b3b4,_0x249f90);clearTimeout(_0x46b646);_0x46b646=undefined;_0x37bdab['close'](!![]);if(_0x249f90[_0xda52('0x41')][_0x2511bb]){delete _0x249f90[_0xda52('0x41')][_0x2511bb];}_0x1da3a8['stop']();});_0x249f90[_0xda52('0x41')][_0x2511bb]['on'](_0xda52('0x44'),function(){if(_0x249f90['rules'][_0x2511bb]){delete _0x249f90[_0xda52('0x41')][_0x2511bb];}});_0x46b646=setTimeout(function(){logger[_0xda52('0x2b')](_0xda52('0x45'),_0x2511bb);endRouting(_0x2511bb,_0x4f7170,_0x48b3b4,_0x249f90);clearTimeout(_0x46b646);_0x37bdab['close'](!![]);_0x1da3a8[_0xda52('0x46')]();},_0xfcb95a);switch(_0x4f7170['strategy']){case'rrmemory':strategy['rrmemory'](_0x37bdab,_0x4f7170,_0x249f90,_0x48b3b4);break;default:strategy['beepall'](_0x37bdab,_0x4f7170,_0x249f90,_0x48b3b4);}}else{logger[_0xda52('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2511bb,_0x5d2dba['name']);_0x1da3a8[_0xda52('0x3b')]();}}}catch(_0x1d09a6){console['log'](_0x1d09a6);logger[_0xda52('0x2f')](_0xda52('0x38'),_0x2511bb,_0x1d09a6[_0xda52('0x47')]);_0x1da3a8[_0xda52('0x3b')]();}};}; \ No newline at end of file +var _0x128c=['util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','from','emit','clone','queue','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','message','AccountId','WebsiteId','info','name','QueueReport','create','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','join','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','beepall','log','stack'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x128c,0x168));var _0xc128=function(_0x41b1cc,_0xfc6642){_0x41b1cc=_0x41b1cc-0x0;var _0x59d0b2=_0x128c[_0x41b1cc];return _0x59d0b2;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xc128('0x0'));var seqqueue=require('seq-queue');var moment=require(_0xc128('0x1'));var Redis=require(_0xc128('0x2'));var config=require(_0xc128('0x3'));var logger=require(_0xc128('0x4'))(_0xc128('0x5'));var strategy=require('./strategy');config[_0xc128('0x6')]=_['defaults'](config[_0xc128('0x6')],{'host':_0xc128('0x7'),'port':0x18eb});var io=require(_0xc128('0x8'))(new Redis(config[_0xc128('0x6')]));var attributes=['id',_0xc128('0x9'),_0xc128('0xa'),'queue',_0xc128('0xb'),'joinAt'];function emit(_0xa8ef5e,_0x270c9e,_0x5e5716){io['to'](_0xa8ef5e)[_0xc128('0xc')](_0x270c9e,_0x5e5716);}function emitChannelQueueInteraction(_0x4528a6,_0x1e4d95,_0x28e6f3,_0x79379c,_0x51d513,_0x1ce4b7,_0x433ffa,_0x1b1ee8){var _0x3e3325=_[_0xc128('0xd')](_0x28e6f3);_0x3e3325[_0xc128('0x9')]=_0x1b1ee8;_0x3e3325[_0xc128('0xe')]=_0x1e4d95;_0x3e3325[_0xc128('0xa')]=_0x79379c;_0x3e3325['id']=_0x51d513;if(_0x1ce4b7){_0x433ffa[util[_0xc128('0xf')]('%sQueuesWaitingInteractions',_0x4528a6)][_0x51d513]=_[_0xc128('0x10')](_0x3e3325,attributes);}else{delete _0x433ffa[util[_0xc128('0xf')](_0xc128('0x11'),_0x4528a6)][_0x51d513];}emit(util['format'](_0xc128('0x12'),_0x4528a6,_0x1e4d95),util[_0xc128('0xf')](_0xc128('0x13'),_0x4528a6,_0x1ce4b7?_0xc128('0x14'):_0xc128('0x15')),_[_0xc128('0x10')](_0x3e3325,attributes));}var rpc={'openchannelQueueReport':require(_0xc128('0x16')),'mailQueueReport':require(_0xc128('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xc128('0x18')),'faxQueueReport':require(_0xc128('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xc128('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xc128('0x1b')}});function startRouting(_0x1e4fe6,_0x2e0500,_0x336b3f,_0x2f6c34){if(_0x1e4fe6&&_0x2e0500&&_0x336b3f){_0x2e0500[_0xc128('0x1c')]+=0x1;var _0xf11127={'uniqueid':_0x1e4fe6,'from':_0x336b3f[_0xc128('0x1d')]?_0x336b3f[_0xc128('0x1d')][_0xc128('0xb')]:'','joinAt':moment()[_0xc128('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x336b3f[_0xc128('0x1e')]?_0x336b3f[_0xc128('0x1e')]['id']:null,'ListId':_0x336b3f[_0xc128('0x1f')]?_0x336b3f[_0xc128('0x1f')]['id']:null};_0xf11127[_[_0xc128('0x20')](_0x336b3f[_0xc128('0x21')])+_0xc128('0x22')]=_0x2e0500['id']||null;_0xf11127[_[_0xc128('0x20')](_0x336b3f['channel'])+'InteractionId']=_0x336b3f['interaction']?_0x336b3f[_0xc128('0x23')]['id']:null;_0xf11127[_[_0xc128('0x20')](_0x336b3f[_0xc128('0x21')])+'MessageId']=_0x336b3f[_0xc128('0x24')]?_0x336b3f[_0xc128('0x24')]['id']:null;_0xf11127[_['upperFirst'](_0x336b3f[_0xc128('0x21')])+(_0x336b3f['channel']!=='chat'?_0xc128('0x25'):_0xc128('0x26'))]=_0x336b3f[_0xc128('0xa')]?_0x336b3f['account']['id']:null;logger[_0xc128('0x27')](util[_0xc128('0xf')]('[%s][START:QUEUE][NAME:%s]',_0x1e4fe6,_0x2e0500[_0xc128('0x28')]));emitChannelQueueInteraction(_0x336b3f[_0xc128('0x21')],_0x2e0500[_0xc128('0x28')],_0xf11127,_0x336b3f[_0xc128('0xa')][_0xc128('0x28')],_0x336b3f[_0xc128('0x24')]['id'],!![],_0x2f6c34,_0x2e0500['id']);if(rpc[_0x336b3f[_0xc128('0x21')]+_0xc128('0x29')]){return rpc[_0x336b3f[_0xc128('0x21')]+_0xc128('0x29')][_0xc128('0x2a')](_0xf11127)['catch'](function(_0xf154b){logger[_0xc128('0x2b')](_0xc128('0x2c'));});}}}function stopRouting(_0xb6fb77,_0x52c0b1,_0x42efcc,_0x4c934d){if(_0xb6fb77&&_0x52c0b1){_0x52c0b1[_0xc128('0x1c')]-=0x1;var _0x52365f={'leaveAt':moment()['format'](_0xc128('0x2d')),'acceptAt':moment()[_0xc128('0xf')](_0xc128('0x2d')),'reason':_0xc128('0x2e')};logger['info'](util[_0xc128('0xf')](_0xc128('0x2f'),_0xb6fb77,_0x52c0b1[_0xc128('0x28')]));emitChannelQueueInteraction(_0x42efcc[_0xc128('0x21')],_0x52c0b1[_0xc128('0x28')],_0x42efcc[_0xc128('0x1d')],_0x42efcc[_0xc128('0xa')][_0xc128('0x28')],_0x42efcc[_0xc128('0x24')]['id'],![],_0x4c934d,_0x52c0b1['id']);if(rpc[_0x42efcc[_0xc128('0x21')]+_0xc128('0x29')]){return rpc[_0x42efcc[_0xc128('0x21')]+_0xc128('0x29')][_0xc128('0x30')](_0xb6fb77,_0x52365f)[_0xc128('0x31')](function(_0x744c16){logger[_0xc128('0x2b')](_0xc128('0x32'));});}}}function endRouting(_0x4d2d79,_0x250a54,_0x1cbde7,_0x49b3d7){if(_0x4d2d79&&_0x250a54){_0x250a54[_0xc128('0x1c')]-=0x1;var _0x177f36={'leaveAt':moment()[_0xc128('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xc128('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc128('0x33')};logger['info'](util[_0xc128('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x4d2d79,_0x250a54[_0xc128('0x28')]));emitChannelQueueInteraction(_0x1cbde7[_0xc128('0x21')],_0x250a54['name'],_0x1cbde7[_0xc128('0x1d')],_0x1cbde7['account'][_0xc128('0x28')],_0x1cbde7['message']['id'],![],_0x49b3d7);if(rpc[_0x1cbde7[_0xc128('0x21')]+_0xc128('0x29')]){return rpc[_0x1cbde7['channel']+'QueueReport'][_0xc128('0x30')](_0x4d2d79,_0x177f36)[_0xc128('0x31')](function(_0x984bff){logger[_0xc128('0x2b')](_0xc128('0x32'));});}}}function handleFindQueue(_0x414059){return function(_0x19bc7f){return _0x19bc7f[_0xc128('0x28')][_0xc128('0x34')]()===_0x414059[_0xc128('0x34')]();};}exports[_0xc128('0x35')]=function(_0x2e25fb,_0x2325f8,_0x5190dc,_0x18805c){return function(_0x1eee4f){try{var _0x26ce9e={'name':_0x2325f8[0x0],'timeout':_0x2325f8[0x1]};var _0x3204e9=queue[_0xc128('0x36')](_0x26ce9e,{'typecast':!![]});if(_0x3204e9['length']){logger[_0xc128('0x2b')](_0xc128('0x37'),_0x2e25fb,_['map'](_0x3204e9,_0xc128('0x24'))[_0xc128('0x38')](',\x20'));_0x1eee4f['stop']();}else{var _0x65cce1=_['find'](_0x5190dc[_0x18805c['channel']+_0xc128('0x39')],handleFindQueue(_0x26ce9e[_0xc128('0x28')]));if(_0x65cce1){startRouting(_0x2e25fb,_0x65cce1,_0x18805c,_0x5190dc);var _0xce0cc4=(_0x65cce1[_0xc128('0x33')]||0xa)*0x3e8;var _0x3e7d24=(_0x26ce9e[_0xc128('0x33')]||0x14)*0x3e8;var _0x180dd0,_0x3d4100;if(_0xce0cc4>_0x3e7d24){_0x3e7d24=_0xce0cc4;}var _0x1c2479=seqqueue[_0xc128('0x3a')](_0xce0cc4);_0x1c2479['id']=_0x2e25fb;_0x1c2479[_0xc128('0x3b')]=_0xce0cc4;_0x1c2479[_0xc128('0x3c')]=_0x3e7d24;_0x1c2479[_0xc128('0x21')]=_0x18805c['channel'];_0x5190dc['rules'][_0x2e25fb]['on'](_0xc128('0x3d'),function(){logger[_0xc128('0x27')](_0xc128('0x3e'),_0x2e25fb);stopRouting(_0x2e25fb,_0x65cce1,_0x18805c,_0x5190dc);clearTimeout(_0x180dd0);_0x180dd0=undefined;_0x1c2479['close'](!![]);if(_0x5190dc[_0xc128('0x3f')][_0x2e25fb]){delete _0x5190dc['rules'][_0x2e25fb];}_0x1eee4f[_0xc128('0x40')]();});_0x5190dc[_0xc128('0x3f')][_0x2e25fb]['on'](_0xc128('0x41'),function(){if(_0x5190dc[_0xc128('0x3f')][_0x2e25fb]){delete _0x5190dc[_0xc128('0x3f')][_0x2e25fb];}});_0x180dd0=setTimeout(function(){logger[_0xc128('0x27')](_0xc128('0x42'),_0x2e25fb);endRouting(_0x2e25fb,_0x65cce1,_0x18805c,_0x5190dc);clearTimeout(_0x180dd0);_0x1c2479[_0xc128('0x43')](!![]);_0x1eee4f['next']();},_0x3e7d24);switch(_0x65cce1['strategy']){case _0xc128('0x44'):strategy[_0xc128('0x44')](_0x1c2479,_0x65cce1,_0x5190dc,_0x18805c);break;default:strategy[_0xc128('0x45')](_0x1c2479,_0x65cce1,_0x5190dc,_0x18805c);}}else{logger[_0xc128('0x2b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2e25fb,_0x26ce9e[_0xc128('0x28')]);_0x1eee4f[_0xc128('0x40')]();}}}catch(_0x228868){console[_0xc128('0x46')](_0x228868);logger[_0xc128('0x2b')]('[%s][QUEUE]\x20%s',_0x2e25fb,_0x228868[_0xc128('0x47')]);_0x1eee4f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 5cee3f4..49ab154 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 _0x9f25=['timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9f25,0x105));var _0x59f2=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x9f25[_0x291d3f];return _0x242080;};'use strict';var _=require('lodash');var uuid=require(_0x59f2('0x0'));var util=require(_0x59f2('0x1'));var logger=require(_0x59f2('0x2'))(_0x59f2('0x3'));var Agent=function(_0x4c939c,_0x27c88b,_0x49544a,_0x57a60f){this[_0x59f2('0x4')]=uuid['v4']();this[_0x59f2('0x5')]=_0x4c939c;this['agent']=_0x27c88b;this[_0x59f2('0x6')]=_0x49544a;this[_0x59f2('0x3')]=_0x57a60f;this[_0x59f2('0x5')][_0x59f2('0x7')](this[_0x59f2('0x8')][_0x59f2('0x9')](this),this[_0x59f2('0xa')]['bind'](this));this[_0x59f2('0x5')]['on'](_0x59f2('0xb'),this['handleTimeout'][_0x59f2('0x9')](this));this[_0x59f2('0x5')]['on'](_0x59f2('0xc'),this['handleDrained'][_0x59f2('0x9')](this));};Agent['prototype'][_0x59f2('0x7')]=function(){this['squeue'][_0x59f2('0x7')](this[_0x59f2('0x8')][_0x59f2('0x9')](this),this[_0x59f2('0xa')][_0x59f2('0x9')](this));};Agent[_0x59f2('0xd')][_0x59f2('0xe')]=function(){this[_0x59f2('0xa')](!![]);};Agent['prototype'][_0x59f2('0x8')]=function(_0x3ca1d7){logger[_0x59f2('0xf')](_0x59f2('0x10'),this[_0x59f2('0x5')]['id'],this[_0x59f2('0x11')]['id']);if(_[_0x59f2('0x12')](this[_0x59f2('0x6')][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']])){logger['info'](_0x59f2('0x14'),this['squeue']['id'],this[_0x59f2('0x11')]['id']);setTimeout(this['push'][_0x59f2('0x9')](this),0x3e8);}else{if(this['routing'][_0x59f2('0x15')]||util['isAgentAvailable'](this[_0x59f2('0x5')]['id'],this[_0x59f2('0x6')][_0x59f2('0x13')][this['agent']['id']],this[_0x59f2('0x5')][_0x59f2('0x16')],![])){this[_0x59f2('0x6')][_0x59f2('0x13')][this['agent']['id']][_0x59f2('0x17')]=!![];this[_0x59f2('0x6')][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']][_0x59f2('0x18')]=undefined;util[_0x59f2('0x19')](this[_0x59f2('0x4')],this['squeue']['id'],this[_0x59f2('0x6')][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']],null,this[_0x59f2('0x3')]);util[_0x59f2('0x1a')](this[_0x59f2('0x5')]['id'],this[_0x59f2('0x6')][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']],_0x59f2('0x1b')+(this['routing'][_0x59f2('0x15')]?_0x59f2('0x1c'):''));}else{logger[_0x59f2('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x59f2('0x5')]['id'],this[_0x59f2('0x11')]['id']);setTimeout(this[_0x59f2('0x7')][_0x59f2('0x9')](this),0x3e8);}}};Agent[_0x59f2('0xd')][_0x59f2('0xa')]=function(_0x2de710){if(_[_0x59f2('0x12')](this['realtime'][_0x59f2('0x13')][this['agent']['id']])){return logger[_0x59f2('0xf')](_0x59f2('0x14'),this[_0x59f2('0x5')]['id'],this[_0x59f2('0x11')]['id']);}else{logger[_0x59f2('0xf')](_0x59f2('0x1d'),this['squeue']['id'],this[_0x59f2('0x11')]['id']);util[_0x59f2('0x1e')](this['notificationId'],this[_0x59f2('0x5')]['id'],this[_0x59f2('0x6')][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']],null,this['routing']);this['realtime'][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']][_0x59f2('0x17')]=![];this['realtime'][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']][_0x59f2('0x18')]=undefined;util[_0x59f2('0x1a')](this['squeue']['id'],this['realtime'][_0x59f2('0x13')][this[_0x59f2('0x11')]['id']],_0x2de710?_0x59f2('0x1f'):_0x59f2('0x20'));}if(!_0x2de710){setTimeout(this['push'][_0x59f2('0x9')](this),0x3e8);}};function agent(_0x4f3d08,_0x3bc4b4,_0x47bdcb,_0x567ade){return new Agent(_0x4f3d08,_0x3bc4b4,_0x47bdcb,_0x567ade);}module[_0x59f2('0x21')]=agent; \ No newline at end of file +var _0x1d56=['handleRun','isNil','realtime','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','isAgentAvailable','channel','busyQueue','showNotification','writeLog','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','agent','push','bind','handleTimeout','timeout','handleDrained','prototype'];(function(_0x285783,_0x494e14){var _0x5741f5=function(_0x47700f){while(--_0x47700f){_0x285783['push'](_0x285783['shift']());}};_0x5741f5(++_0x494e14);}(_0x1d56,0x1d4));var _0x61d5=function(_0x4503aa,_0x32e811){_0x4503aa=_0x4503aa-0x0;var _0xddfb65=_0x1d56[_0x4503aa];return _0xddfb65;};'use strict';var _=require(_0x61d5('0x0'));var uuid=require('uuid');var util=require(_0x61d5('0x1'));var logger=require(_0x61d5('0x2'))('routing');var Agent=function(_0x1e9498,_0x5ae856,_0x513996,_0x21b931){this[_0x61d5('0x3')]=uuid['v4']();this[_0x61d5('0x4')]=_0x1e9498;this[_0x61d5('0x5')]=_0x5ae856;this['realtime']=_0x513996;this['routing']=_0x21b931;this[_0x61d5('0x4')][_0x61d5('0x6')](this['handleRun'][_0x61d5('0x7')](this),this[_0x61d5('0x8')]['bind'](this));this[_0x61d5('0x4')]['on'](_0x61d5('0x9'),this[_0x61d5('0x8')][_0x61d5('0x7')](this));this['squeue']['on']('drained',this[_0x61d5('0xa')][_0x61d5('0x7')](this));};Agent[_0x61d5('0xb')]['push']=function(){this['squeue']['push'](this[_0x61d5('0xc')]['bind'](this),this[_0x61d5('0x8')]['bind'](this));};Agent[_0x61d5('0xb')][_0x61d5('0xa')]=function(){this[_0x61d5('0x8')](!![]);};Agent[_0x61d5('0xb')][_0x61d5('0xc')]=function(_0x557ba7){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x61d5('0x4')]['id'],this['agent']['id']);if(_[_0x61d5('0xd')](this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']])){logger[_0x61d5('0x10')](_0x61d5('0x11'),this[_0x61d5('0x4')]['id'],this[_0x61d5('0x5')]['id']);setTimeout(this[_0x61d5('0x6')][_0x61d5('0x7')](this),0x3e8);}else{if(this[_0x61d5('0x12')]['forcedOwnership']||util[_0x61d5('0x13')](this['squeue']['id'],this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']],this[_0x61d5('0x4')][_0x61d5('0x14')],![])){this['realtime']['agents'][this[_0x61d5('0x5')]['id']]['busy']=!![];this[_0x61d5('0xe')][_0x61d5('0xf')][this['agent']['id']][_0x61d5('0x15')]=undefined;util[_0x61d5('0x16')](this[_0x61d5('0x3')],this[_0x61d5('0x4')]['id'],this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']],null,this[_0x61d5('0x12')]);util[_0x61d5('0x17')](this[_0x61d5('0x4')]['id'],this[_0x61d5('0xe')]['agents'][this[_0x61d5('0x5')]['id']],'RINGING'+(this[_0x61d5('0x12')][_0x61d5('0x18')]?_0x61d5('0x19'):''));}else{logger[_0x61d5('0x10')](_0x61d5('0x1a'),this[_0x61d5('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x61d5('0x6')]['bind'](this),0x3e8);}}};Agent[_0x61d5('0xb')][_0x61d5('0x8')]=function(_0x30de64){if(_[_0x61d5('0xd')](this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x61d5('0x5')]['id']);}else{logger['info'](_0x61d5('0x1b'),this['squeue']['id'],this[_0x61d5('0x5')]['id']);util[_0x61d5('0x1c')](this[_0x61d5('0x3')],this[_0x61d5('0x4')]['id'],this[_0x61d5('0xe')]['agents'][this[_0x61d5('0x5')]['id']],null,this['routing']);this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']][_0x61d5('0x1d')]=![];this[_0x61d5('0xe')][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']]['busyQueue']=undefined;util[_0x61d5('0x17')](this[_0x61d5('0x4')]['id'],this['realtime'][_0x61d5('0xf')][this[_0x61d5('0x5')]['id']],_0x30de64?'STOP':_0x61d5('0x1e'));}if(!_0x30de64){setTimeout(this[_0x61d5('0x6')][_0x61d5('0x7')](this),0x3e8);}};function agent(_0x116d6a,_0x1d9769,_0x5bef12,_0x36eb31){return new Agent(_0x116d6a,_0x1d9769,_0x5bef12,_0x36eb31);}module[_0x61d5('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 0c3038b..b5c1845 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 _0xaa19=['../../../../../config/logger','notificationId','squeue','queue','routing','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','isNil','Agents','length','realtime','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','info','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','lodash','uuid','./util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xaa19,0x79));var _0x9aa1=function(_0x52754d,_0xa9b8dc){_0x52754d=_0x52754d-0x0;var _0xf0d4bb=_0xaa19[_0x52754d];return _0xf0d4bb;};'use strict';var _=require(_0x9aa1('0x0'));var uuid=require(_0x9aa1('0x1'));var util=require(_0x9aa1('0x2'));var logger=require(_0x9aa1('0x3'))('routing');var Beepall=function(_0x343b95,_0x5371a9,_0x15dd20,_0x58fb46){this[_0x9aa1('0x4')]=uuid['v4']();this[_0x9aa1('0x5')]=_0x343b95;this[_0x9aa1('0x6')]=_0x5371a9;this['realtime']=_0x15dd20;this[_0x9aa1('0x7')]=_0x58fb46;this[_0x9aa1('0x5')][_0x9aa1('0x8')](this['handleRun'][_0x9aa1('0x9')](this),this['handleTimeout']['bind'](this));this[_0x9aa1('0x5')]['on'](_0x9aa1('0xa'),this[_0x9aa1('0xb')][_0x9aa1('0x9')](this));this['squeue']['on']('drained',this[_0x9aa1('0xc')]['bind'](this));};Beepall[_0x9aa1('0xd')]['push']=function(){this['squeue']['push'](this[_0x9aa1('0xe')][_0x9aa1('0x9')](this),this['handleTimeout'][_0x9aa1('0x9')](this));};Beepall[_0x9aa1('0xd')][_0x9aa1('0xc')]=function(_0x48eba0){this['handleTimeout'](!![]);};Beepall[_0x9aa1('0xd')]['handleRun']=function(_0x69f459){var _0x5005a4=!![];if(!_[_0x9aa1('0xf')](this[_0x9aa1('0x6')])&&!_[_0x9aa1('0xf')](this[_0x9aa1('0x6')]['Agents'])&&this['queue'][_0x9aa1('0x10')][_0x9aa1('0x11')]>0x0){for(var _0x30b187=0x0,_0x22c104;_0x30b1870x0){for(var _0xd655a0=0x0,_0xf5e83a;_0xd655a00x0&&_0xb61717[_0x4bd5ee+_0x3188('0x24')]>=_0xb61717[_0x4bd5ee+_0x3188('0x23')]){writeLog(_0xaf6a8e,_0xb61717,_0x4bd5ee['toUpperCase']()+_0x3188('0x25'));return![];}}return!![];};exports[_0x3188('0x26')]=function(_0x52bb13,_0xd3ee40,_0x14299b,_0x43399d,_0x44db9a){return sendNotification(!![],_0x52bb13,_0xd3ee40,_0x14299b,_0x43399d,_0x44db9a);};exports[_0x3188('0x27')]=function(_0x1f1c6f,_0x8f810f,_0x472926,_0x57c21c,_0x44fa15){return sendNotification(![],_0x1f1c6f,_0x8f810f,_0x472926,_0x57c21c,_0x44fa15);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x3a6d=['getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','name','user:save','account','notificationSound','notificationShake','body','queue','msg'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3a6d,0x143));var _0xd3a6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3a6d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var utils=require('../utils');var Mustache=require(_0xd3a6('0x2'));var Redis=require(_0xd3a6('0x3'));var config=require(_0xd3a6('0x4'));var logger=require(_0xd3a6('0x5'))(_0xd3a6('0x6'));config['redis']=_[_0xd3a6('0x7')](config[_0xd3a6('0x8')],{'host':_0xd3a6('0x9'),'port':0x18eb});var io=require(_0xd3a6('0xa'))(new Redis(config[_0xd3a6('0x8')]));function emit(_0x282cb1,_0x58d83a,_0x121bd2){io['to'](_0x282cb1)[_0xd3a6('0xb')](_0x58d83a,_0x121bd2);}function sendNotification(_0x16858,_0x410dac,_0x14b46b,_0xa67661,_0x1dbcce,_0x4094a2){io['to'](util[_0xd3a6('0xc')]('user:%s',_0xa67661[_0xd3a6('0xd')]))[_0xd3a6('0xb')](_0xd3a6('0xe'),_0xa67661);var _0x225399=_0x4094a2||{};var _0x2bd4f0=_0x14b46b['split']('.');var _0x5430c0={'uniqueid':_0x410dac,'channel':_0x2bd4f0[0x0],'id':_0x2bd4f0[0x1],'title':_0x2bd4f0[0x0]+'\x20interaction','interactionId':_0x2bd4f0[0x2],'queue':_0x1dbcce?_0x1dbcce[_0xd3a6('0xd')]:null,'sound':_0x225399[_0xd3a6('0xf')][_0xd3a6('0x10')],'shake':_0x225399[_0xd3a6('0xf')][_0xd3a6('0x11')]};try{if(!_0x225399[_0xd3a6('0x12')]){_0x225399[_0xd3a6('0x12')]={};}if(_0x1dbcce){_0x225399['body'][_0xd3a6('0x13')]=_0x1dbcce;}else if(_0x225399[_0xd3a6('0x12')][_0xd3a6('0x13')]){delete _0x225399['body'][_0xd3a6('0x13')];}_0x5430c0[_0xd3a6('0x14')]=utils[_0xd3a6('0x15')](_0x225399['account'][_0xd3a6('0x16')],_0x225399);}catch(_0x5174e0){_0x5430c0['msg']=_0xd3a6('0x17');logger[_0xd3a6('0x18')](util[_0xd3a6('0xc')](_0xd3a6('0x19'),_0x410dac,_0x5174e0[_0xd3a6('0x1a')]));}io['to'](util[_0xd3a6('0xc')](_0xd3a6('0x1b'),_0xa67661['name']))[_0xd3a6('0xb')](util['format'](_0xd3a6('0x1c'),_0x16858?_0xd3a6('0x1d'):_0xd3a6('0x1e')),_0x5430c0);}function writeLog(_0x20a34e,_0x465d25,_0x6ecd88){return logger['info'](util[_0xd3a6('0xc')](_0xd3a6('0x1f'),_0x20a34e,_0x465d25['name'],_0x6ecd88));}exports['isAgentAvailable']=function(_0x5846bc,_0x573870,_0x5c9075,_0x98a12a){if(_0x573870[_0xd3a6('0x20')]){writeLog(_0x5846bc,_0x573870,_0xd3a6('0x21'));return![];}if(!_0x573870['online']){writeLog(_0x5846bc,_0x573870,_0xd3a6('0x22'));return![];}if(_0x573870[_0x5c9075+'Pause']){writeLog(_0x5846bc,_0x573870,_0xd3a6('0x23'));return![];}if(_0x98a12a&&_0x573870[_0xd3a6('0x24')](_0x5c9075+_0xd3a6('0x25'))&&_0x573870['hasOwnProperty'](_0x5c9075+_0xd3a6('0x26'))){if(_0x573870[_0x5c9075+_0xd3a6('0x25')]>0x0&&_0x573870[_0x5c9075+_0xd3a6('0x26')]>=_0x573870[_0x5c9075+_0xd3a6('0x25')]){writeLog(_0x5846bc,_0x573870,_0x5c9075[_0xd3a6('0x27')]()+_0xd3a6('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x30df90,_0x2b5448,_0x24ff6d,_0x3f6d35,_0x30abc2){return sendNotification(!![],_0x30df90,_0x2b5448,_0x24ff6d,_0x3f6d35,_0x30abc2);};exports[_0xd3a6('0x29')]=function(_0x5c2186,_0x535bd4,_0x1f4859,_0x210aa1,_0x35981c){return sendNotification(![],_0x5c2186,_0x535bd4,_0x1f4859,_0x210aa1,_0x35981c);};exports[_0xd3a6('0x2a')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 85ba09e..7a32982 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 _0xffbc=['./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash'];(function(_0x2f3775,_0x5e0f5d){var _0x4972a1=function(_0x2d2bdc){while(--_0x2d2bdc){_0x2f3775['push'](_0x2f3775['shift']());}};_0x4972a1(++_0x5e0f5d);}(_0xffbc,0x14d));var _0xcffb=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xffbc[_0x3826ad];return _0x17b900;};'use strict';var schema=require(_0xcffb('0x0'));var sh=require(_0xcffb('0x1'));var _=require(_0xcffb('0x2'));var utils=require(_0xcffb('0x3'));var logger=require(_0xcffb('0x4'))(_0xcffb('0x5'));var system=schema({'command':{'type':_0xcffb('0x6'),'required':!![],'message':_0xcffb('0x7')}});exports[_0xcffb('0x8')]=function(_0xa77674,_0x4709e8){return function(_0x337a1d){try{var _0x434d95={'command':_0x4709e8[0x0]};var _0x483ca3=system['validate'](_0x434d95,{'typecast':!![]});if(_0x483ca3[_0xcffb('0x9')]){logger[_0xcffb('0xa')]('[%s][SYSTEM]\x20%s',_0xa77674,_['map'](_0x483ca3,_0xcffb('0xb'))[_0xcffb('0xc')](',\x20'));logger['info'](_0xcffb('0xd'),_0xa77674);_0x337a1d[_0xcffb('0xe')]();}else{var _0x3958ec=this;var _0x10d06d=utils[_0xcffb('0xf')](_0x4709e8[0x0],this);logger[_0xcffb('0x10')](_0xcffb('0x11'),_0xa77674,_0x10d06d);sh[_0xcffb('0x12')](_[_0xcffb('0x13')](_0x10d06d),function(_0x15d3ea,_0x334b94){logger[_0xcffb('0x10')](_0xcffb('0x14'),_0xa77674,_0x15d3ea);if(_0x15d3ea==0x0){var _0x367e06=_0x334b94[_0xcffb('0x15')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x4709e8[0x1])||_[_0xcffb('0x16')](_0x4709e8[0x1])){logger[_0xcffb('0x10')](_0xcffb('0x17'),_0xa77674);_0x3958ec[_0xcffb('0x18')][_0x4709e8[0x1]]=_0x367e06;}else{logger[_0xcffb('0x10')](_0xcffb('0x19'),_0xa77674,_0x4709e8[0x1],_0x367e06);_0x3958ec['body'][_0x4709e8[0x1]]=_0x367e06;}}_0x337a1d[_0xcffb('0xe')]();});}}catch(_0xfff686){logger[_0xcffb('0xa')]('[%s][SYSTEM]\x20%s',_0xa77674,_[_0xcffb('0x1a')](_0xfff686)?JSON[_0xcffb('0x1b')](_0xfff686):_0xfff686);logger[_0xcffb('0x10')](_0xcffb('0xd'),_0xa77674);_0x337a1d[_0xcffb('0xe')]();}};}; \ No newline at end of file +var _0xd1f5=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0xd9ac06,_0x5c76a8){var _0x1c57b7=function(_0x32143c){while(--_0x32143c){_0xd9ac06['push'](_0xd9ac06['shift']());}};_0x1c57b7(++_0x5c76a8);}(_0xd1f5,0x1de));var _0x5d1f=function(_0x7d6bfe,_0x58cf11){_0x7d6bfe=_0x7d6bfe-0x0;var _0x288047=_0xd1f5[_0x7d6bfe];return _0x288047;};'use strict';var schema=require(_0x5d1f('0x0'));var sh=require('shelljs');var _=require(_0x5d1f('0x1'));var utils=require(_0x5d1f('0x2'));var logger=require('../../../../config/logger')(_0x5d1f('0x3'));var system=schema({'command':{'type':_0x5d1f('0x4'),'required':!![],'message':_0x5d1f('0x5')}});exports['consequence']=function(_0x425e1b,_0x5edcd4){return function(_0x4c46f3){try{var _0x577c21={'command':_0x5edcd4[0x0]};var _0x3b6ac8=system[_0x5d1f('0x0')](_0x577c21,{'typecast':!![]});if(_0x3b6ac8[_0x5d1f('0x6')]){logger[_0x5d1f('0x7')](_0x5d1f('0x8'),_0x425e1b,_[_0x5d1f('0x9')](_0x3b6ac8,_0x5d1f('0xa'))['join'](',\x20'));logger[_0x5d1f('0xb')](_0x5d1f('0xc'),_0x425e1b);_0x4c46f3[_0x5d1f('0xd')]();}else{var _0x512d32=this;var _0x15a5bc=utils[_0x5d1f('0xe')](_0x5edcd4[0x0],this);logger['info'](_0x5d1f('0xf'),_0x425e1b,_0x15a5bc);sh[_0x5d1f('0x10')](_[_0x5d1f('0x11')](_0x15a5bc),function(_0x9435b4,_0x33f61f){logger[_0x5d1f('0xb')](_0x5d1f('0x12'),_0x425e1b,_0x9435b4);if(_0x9435b4==0x0){var _0x47b946=_0x33f61f[_0x5d1f('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x5d1f('0x14')](_0x5edcd4[0x1])||_[_0x5d1f('0x15')](_0x5edcd4[0x1])){logger[_0x5d1f('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x425e1b);_0x512d32[_0x5d1f('0x16')][_0x5edcd4[0x1]]=_0x47b946;}else{logger[_0x5d1f('0xb')](_0x5d1f('0x17'),_0x425e1b,_0x5edcd4[0x1],_0x47b946);_0x512d32['body'][_0x5edcd4[0x1]]=_0x47b946;}}_0x4c46f3[_0x5d1f('0xd')]();});}}catch(_0xda920c){logger[_0x5d1f('0x7')]('[%s][SYSTEM]\x20%s',_0x425e1b,_[_0x5d1f('0x18')](_0xda920c)?JSON[_0x5d1f('0x19')](_0xda920c):_0xda920c);logger[_0x5d1f('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x425e1b);_0x4c46f3[_0x5d1f('0xd')]();}};}; \ 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 644b615..21b6b7a 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 _0x8b5b=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','[%s][TAG]\x20%s','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','info'];(function(_0xd129b5,_0x1cdbbb){var _0x20e42e=function(_0x36d7c3){while(--_0x36d7c3){_0xd129b5['push'](_0xd129b5['shift']());}};_0x20e42e(++_0x1cdbbb);}(_0x8b5b,0x122));var _0xb8b5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8b5b[_0x21a9d9];return _0x46adce;};'use strict';var schema=require(_0xb8b5('0x0'));var _=require(_0xb8b5('0x1'));var rpc={'chatInteraction':require(_0xb8b5('0x2')),'openchannelInteraction':require(_0xb8b5('0x3')),'smsInteraction':require(_0xb8b5('0x4')),'mailInteraction':require(_0xb8b5('0x5')),'faxInteraction':require(_0xb8b5('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xb8b5('0x7'))('routing');var tag=schema({'tag':{'type':_0xb8b5('0x8'),'required':!![],'message':_0xb8b5('0x9')}});exports[_0xb8b5('0xa')]=function(_0x43bc31,_0xaf2565,_0x5dfb35,_0x48a28c){return function(_0x2e4ac7){try{var _0x21edda={'tag':_0xaf2565[0x0]};var _0x364f46=tag[_0xb8b5('0x0')](_0x21edda,{'typecast':!![]});if(_0x364f46[_0xb8b5('0xb')]){logger[_0xb8b5('0xc')]('[%s][TAG]\x20%s',_0x43bc31,_[_0xb8b5('0xd')](_0x364f46,'message')[_0xb8b5('0xe')](',\x20'));logger['info'](_0xb8b5('0xf'),_0x43bc31);_0x2e4ac7[_0xb8b5('0x10')]();}else{var _0x562218={'ids':[_0xaf2565[0x0]]};if(rpc[_0x48a28c[_0xb8b5('0x11')]+_0xb8b5('0x12')]){rpc[_0x48a28c[_0xb8b5('0x11')]+'Interaction'][_0xb8b5('0x13')](_0x48a28c[_0xb8b5('0x14')]['id'],_0x562218)['then'](function(_0x32a081){logger[_0xb8b5('0x15')](_0xb8b5('0x16'),_0x43bc31,_0xaf2565[0x1],_0x48a28c['channel'],_0x48a28c[_0xb8b5('0x14')]['id']);})['catch'](function(_0x52fbc0){logger[_0xb8b5('0xc')](_0xb8b5('0x17'),_0x43bc31,JSON[_0xb8b5('0x18')](_0x52fbc0));logger[_0xb8b5('0x15')](_0xb8b5('0xf'),_0x43bc31);})['finally'](function(){_0x2e4ac7[_0xb8b5('0x10')]();});}}}catch(_0x5bd512){logger[_0xb8b5('0xc')](_0xb8b5('0x17'),_0x43bc31,_[_0xb8b5('0x19')](_0x5bd512)?JSON[_0xb8b5('0x18')](_0x5bd512):_0x5bd512);logger[_0xb8b5('0x15')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x43bc31);_0x2e4ac7[_0xb8b5('0x10')]();}};}; \ No newline at end of file +var _0x6c57=['../../rpc/whatsappInteraction','routing','consequence','length','message','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction'];(function(_0x54fa8c,_0xc2d9d0){var _0x26e2d6=function(_0x5013bc){while(--_0x5013bc){_0x54fa8c['push'](_0x54fa8c['shift']());}};_0x26e2d6(++_0xc2d9d0);}(_0x6c57,0x104));var _0x76c5=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6c57[_0x46aff0];return _0x9d78cf;};'use strict';var schema=require(_0x76c5('0x0'));var _=require(_0x76c5('0x1'));var rpc={'chatInteraction':require(_0x76c5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x76c5('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x76c5('0x4'))};var logger=require('../../../../config/logger')(_0x76c5('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x76c5('0x6')]=function(_0x3870d6,_0x1d1d7e,_0x922113,_0x3ae36c){return function(_0x31df85){try{var _0x37d8f9={'tag':_0x1d1d7e[0x0]};var _0x2dea95=tag[_0x76c5('0x0')](_0x37d8f9,{'typecast':!![]});if(_0x2dea95[_0x76c5('0x7')]){logger['error']('[%s][TAG]\x20%s',_0x3870d6,_['map'](_0x2dea95,_0x76c5('0x8'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3870d6);_0x31df85[_0x76c5('0x9')]();}else{var _0x41d9a9={'ids':[_0x1d1d7e[0x0]]};if(rpc[_0x3ae36c[_0x76c5('0xa')]+_0x76c5('0xb')]){rpc[_0x3ae36c[_0x76c5('0xa')]+_0x76c5('0xb')]['addTags'](_0x3ae36c[_0x76c5('0xc')]['id'],_0x41d9a9)[_0x76c5('0xd')](function(_0x4efa70){logger[_0x76c5('0xe')](_0x76c5('0xf'),_0x3870d6,_0x1d1d7e[0x1],_0x3ae36c[_0x76c5('0xa')],_0x3ae36c[_0x76c5('0xc')]['id']);})[_0x76c5('0x10')](function(_0x532291){logger[_0x76c5('0x11')](_0x76c5('0x12'),_0x3870d6,JSON[_0x76c5('0x13')](_0x532291));logger[_0x76c5('0xe')](_0x76c5('0x14'),_0x3870d6);})['finally'](function(){_0x31df85[_0x76c5('0x9')]();});}}}catch(_0x3f98e0){logger[_0x76c5('0x11')](_0x76c5('0x12'),_0x3870d6,_[_0x76c5('0x15')](_0x3f98e0)?JSON[_0x76c5('0x13')](_0x3f98e0):_0x3f98e0);logger[_0x76c5('0xe')](_0x76c5('0x14'),_0x3870d6);_0x31df85[_0x76c5('0x9')]();}};}; \ 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 1d9deb4..5845d78 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 _0x2f38=['info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','2.0','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data='];(function(_0x3de13e,_0x57618c){var _0x304413=function(_0x208c2a){while(--_0x208c2a){_0x3de13e['push'](_0x3de13e['shift']());}};_0x304413(++_0x57618c);}(_0x2f38,0xb7));var _0x82f3=function(_0x133afb,_0x137bbe){_0x133afb=_0x133afb-0x0;var _0x2e8ae8=_0x2f38[_0x133afb];return _0x2e8ae8;};'use strict';var rp=require(_0x82f3('0x0'));var logger=require(_0x82f3('0x1'))('routing');var _=require(_0x82f3('0x2'));var arr=[];exports[_0x82f3('0x3')]=function(_0x4b7fb9,_0x15b067){return function(_0x1b62bd){var _0x210de9=_0x15b067[0xa];var _0x3366c5=_0x15b067[0xb];var _0x301120=_0x15b067[0xc];var _0x26253a=_0x15b067[0xd];var _0x37807e=_0x15b067[0xe];var _0x2cb439=_0x15b067[0xf][_0x82f3('0x4')](/\n/g,_0x82f3('0x5'));var _0x3428a5=_0x15b067[0x10][_0x82f3('0x4')](/\n/g,'\x20');if(!arr[_0x82f3('0x6')](_0x3366c5)){arr[_0x82f3('0x7')](_0x3366c5);var _0x3a995a=_0x15b067[0x3];var _0x358114=_0x15b067[0x4];var _0x4fd117=_0x15b067[0x1];var _0x49303a=_0x15b067[0x0];var _0x54515d={};_0x54515d[_0x82f3('0x8')]=_0x15b067[0x8]+_0x82f3('0x9')+_0x301120+'|'+_0x210de9+'|'+_0x26253a+'|'+_0x3366c5+'|'+_0x37807e;_0x54515d[_0x82f3('0xa')]=_0x15b067[0x7]+_0x82f3('0x9')+_0x301120+'|'+_0x210de9+'|'+_0x26253a+'|'+_0x3366c5+'|'+_0x37807e+'|'+_0x2cb439+'|'+_0x3428a5;_0x54515d['title']=_0x15b067[0x9];var _0x36a68c={};_0x36a68c['jsonrpc']=_0x82f3('0xb');_0x36a68c['method']=_0x82f3('0xc');var _0x1b6a7e=[];_0x1b6a7e['push'](_0x15b067[0x2]);_0x1b6a7e[_0x82f3('0x7')](_0x15b067[0x5]);_0x1b6a7e[_0x82f3('0x7')](_0x15b067[0x6]);_0x36a68c[_0x82f3('0xd')]=_0x1b6a7e;_0x36a68c['id']=0x1;var _0x5c8140=JSON[_0x82f3('0xe')](_0x36a68c);var _0x5fb265={'encoding':_0x82f3('0xf'),'method':_0x82f3('0x10'),'timeout':0x2710,'url':_0x3a995a,'headers':{'Content-Type':_0x82f3('0x11')},'body':_0x5c8140};return rp(_0x5fb265)[_0x82f3('0x12')](function(_0x3aa374){const _0x1a61f2=JSON[_0x82f3('0x13')](_0x3aa374);if(!_0x1a61f2[_0x82f3('0x14')][_0x82f3('0x15')]){throw new Error(_0x82f3('0x16'));}var _0x2f6acb=_0x3366c5;var _0x321a2c=_0x82f3('0x17')+_0x4fd117+_0x82f3('0x18')+_0x49303a+_0x82f3('0x19')+_0x2f6acb+_0x82f3('0x1a')+JSON[_0x82f3('0xe')](_0x54515d);var _0x2e990d=_0x358114+'?'+_0x321a2c;return rp(_0x2e990d);})['then'](function(_0x4a63a2){logger[_0x82f3('0x1b')](_0x82f3('0x1c'),_0x4b7fb9,_0x4a63a2);_0x1b62bd[_0x82f3('0x1d')]();})['catch'](function(_0x597858){logger[_0x82f3('0x1e')](_0x82f3('0x1f'),_0x4b7fb9,_[_0x82f3('0x20')](_0x597858)?JSON[_0x82f3('0xe')](_0x597858):_0x597858);_0x1b62bd[_0x82f3('0x1d')]();});}else{logger['info'](_0x82f3('0x21'),_0x4b7fb9);_0x1b62bd[_0x82f3('0x22')]();}};}; \ No newline at end of file +var _0xe006=['login','push','params','stringify','utf8','POST','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','lodash','consequence','replace','includes','urlOnAnswer','?params=','urlOnRing','title','2.0','method'];(function(_0x2753fd,_0x210da6){var _0x548b78=function(_0x1efeeb){while(--_0x1efeeb){_0x2753fd['push'](_0x2753fd['shift']());}};_0x548b78(++_0x210da6);}(_0xe006,0xdc));var _0x6e00=function(_0x2d3206,_0x434cf5){_0x2d3206=_0x2d3206-0x0;var _0x18702d=_0xe006[_0x2d3206];return _0x18702d;};'use strict';var rp=require(_0x6e00('0x0'));var logger=require('../../../../config/logger')(_0x6e00('0x1'));var _=require(_0x6e00('0x2'));var arr=[];exports[_0x6e00('0x3')]=function(_0x466051,_0x391c9c){return function(_0xae04e8){var _0x5bf837=_0x391c9c[0xa];var _0x230692=_0x391c9c[0xb];var _0x28268c=_0x391c9c[0xc];var _0x44001d=_0x391c9c[0xd];var _0x4bff9d=_0x391c9c[0xe];var _0xceadb=_0x391c9c[0xf]['replace'](/\n/g,'\x20-\x20');var _0xd252cc=_0x391c9c[0x10][_0x6e00('0x4')](/\n/g,'\x20');if(!arr[_0x6e00('0x5')](_0x230692)){arr['push'](_0x230692);var _0x2260cf=_0x391c9c[0x3];var _0xd12168=_0x391c9c[0x4];var _0x2c2d85=_0x391c9c[0x1];var _0x34fb6d=_0x391c9c[0x0];var _0x186a88={};_0x186a88[_0x6e00('0x6')]=_0x391c9c[0x8]+_0x6e00('0x7')+_0x28268c+'|'+_0x5bf837+'|'+_0x44001d+'|'+_0x230692+'|'+_0x4bff9d;_0x186a88[_0x6e00('0x8')]=_0x391c9c[0x7]+_0x6e00('0x7')+_0x28268c+'|'+_0x5bf837+'|'+_0x44001d+'|'+_0x230692+'|'+_0x4bff9d+'|'+_0xceadb+'|'+_0xd252cc;_0x186a88[_0x6e00('0x9')]=_0x391c9c[0x9];var _0x5a74af={};_0x5a74af['jsonrpc']=_0x6e00('0xa');_0x5a74af[_0x6e00('0xb')]=_0x6e00('0xc');var _0x4a359b=[];_0x4a359b[_0x6e00('0xd')](_0x391c9c[0x2]);_0x4a359b[_0x6e00('0xd')](_0x391c9c[0x5]);_0x4a359b[_0x6e00('0xd')](_0x391c9c[0x6]);_0x5a74af[_0x6e00('0xe')]=_0x4a359b;_0x5a74af['id']=0x1;var _0x3eb6fc=JSON[_0x6e00('0xf')](_0x5a74af);var _0xfd5631={'encoding':_0x6e00('0x10'),'method':_0x6e00('0x11'),'timeout':0x2710,'url':_0x2260cf,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3eb6fc};return rp(_0xfd5631)[_0x6e00('0x12')](function(_0x176217){const _0x2ab223=JSON['parse'](_0x176217);if(!_0x2ab223[_0x6e00('0x13')]['logged']){throw new Error(_0x6e00('0x14'));}var _0x25a947=_0x230692;var _0xaea567='channelId='+_0x2c2d85+_0x6e00('0x15')+_0x34fb6d+'&sessionId='+_0x25a947+_0x6e00('0x16')+JSON['stringify'](_0x186a88);var _0x7951f9=_0xd12168+'?'+_0xaea567;return rp(_0x7951f9);})['then'](function(_0x46109b){logger[_0x6e00('0x17')](_0x6e00('0x18'),_0x466051,_0x46109b);_0xae04e8['stop']();})[_0x6e00('0x19')](function(_0x409b2a){logger[_0x6e00('0x1a')]('[%s][TVOX]\x20%s',_0x466051,_[_0x6e00('0x1b')](_0x409b2a)?JSON['stringify'](_0x409b2a):_0x409b2a);_0xae04e8['stop']();});}else{logger[_0x6e00('0x17')](_0x6e00('0x1c'),_0x466051);_0xae04e8['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 2e3ff0e..5120905 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x28d391,_0x4ccc0e){var _0x292a24=function(_0x3c9d28){while(--_0x3c9d28){_0x28d391['push'](_0x28d391['shift']());}};_0x292a24(++_0x4ccc0e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4731ba,_0x3100ec){var _0x24c639=function(_0x29a229){while(--_0x29a229){_0x4731ba['push'](_0x4731ba['shift']());}};_0x24c639(++_0x3100ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 55fd78a..89ba191 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 _0xb28a=['existsSync','join','.js','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','matchPath','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','bluebird','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xb28a,0x166));var _0xab28=function(_0x5a1cca,_0x2a8755){_0x5a1cca=_0x5a1cca-0x0;var _0x4fa83a=_0xb28a[_0x5a1cca];return _0x4fa83a;};'use strict';var _=require('lodash');var util=require(_0xab28('0x0'));var path=require(_0xab28('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xab28('0x2'));var uuid=require('uuid');var utils=require('./applications/utils');var config=require('../../../config/environment');var logger=require(_0xab28('0x3'))(_0xab28('0x4'));var rpc={'openchannelQueueReport':require(_0xab28('0x5')),'mailQueueReport':require(_0xab28('0x6')),'chatQueueReport':require(_0xab28('0x7')),'smsQueueReport':require(_0xab28('0x8')),'faxQueueReport':require(_0xab28('0x9')),'whatsappQueueReport':require(_0xab28('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x479267,_0x294e36,_0x32635b){return util[_0xab28('0xb')](_0xab28('0xc'),_0x479267,_0x294e36||0x0,_0x32635b||0x0);}function getIntervals(_0x1f1956,_0x2ac052){var _0x539160=[];if(!_[_0xab28('0xd')](_0x2ac052['IntervalId'])&&!_[_0xab28('0xd')](_0x1f1956[_0x2ac052[_0xab28('0xe')]])&&!_[_0xab28('0xd')](_0x1f1956[_0x2ac052[_0xab28('0xe')]][_0xab28('0xf')])){_0x539160=_[_0xab28('0x10')](_0x1f1956[_0x2ac052[_0xab28('0xe')]][_0xab28('0xf')],'interval');}else if(!_[_0xab28('0xd')](_0x2ac052[_0xab28('0x11')])){_0x539160=[_0x2ac052[_0xab28('0x11')]];}return _0x539160;}exports[_0xab28('0x12')]=function(_0x2c05bc){_0x2c05bc[_0xab28('0x13')]={};return new BPromise(function(_0x554954,_0x5c9694){var _0x7c1921={'Start':function(_0x3d133e){var _0x14e8b4=this;return new Promise(function(_0xaaeb24,_0x53c5c7){if(_0x3d133e){try{var _0x28ebe2=[];var _0x4912fa=getId(_0x3d133e[_0xab28('0x14')],_0x3d133e['message']?_0x3d133e[_0xab28('0x15')]['id']:0x0,_0x3d133e[_0xab28('0x16')]?_0x3d133e[_0xab28('0x16')]['id']:0x0);if(_0x3d133e[_0xab28('0x17')]&&_[_0xab28('0x18')](_0x3d133e[_0xab28('0x17')])&&_0x3d133e[_0xab28('0x17')][_0xab28('0x19')]){for(var _0x480454=0x0;_0x480454<_0x3d133e[_0xab28('0x17')][_0xab28('0x19')];_0x480454+=0x1){var _0x3352cc=_0x3d133e[_0xab28('0x17')][_0x480454];if(fs[_0xab28('0x1a')](path[_0xab28('0x1b')](__dirname,_0xab28('0x17'),_0x3352cc['app']+_0xab28('0x1c')))){var _0x4ec564=[];switch(_0x3352cc[_0xab28('0x1d')][_0xab28('0x1e')]()){case'autoreply':var _0x19d70b=_0x3352cc[_0xab28('0x1f')][_0xab28('0x20')](',');if(_0x3d133e[_0xab28('0x14')]===_0xab28('0x21')){_0x4ec564[_0xab28('0x22')](_0x19d70b[0x0]);_0x4ec564[_0xab28('0x22')](_0x19d70b[0x1]);_0x4ec564['push'](_0x19d70b[_0xab28('0x23')](0x2,_0x19d70b['length'])[_0xab28('0x1b')](','));}else{_0x4ec564[_0xab28('0x22')](_0x19d70b[0x0]);_0x4ec564['push'](_0x19d70b[_0xab28('0x23')](0x1,_0x19d70b['length'])[_0xab28('0x1b')](','));}break;case _0xab28('0x24'):var _0x3d8c60=_0x3352cc['appdata'][_0xab28('0x20')](',');_0x4ec564[_0xab28('0x22')](_0x3d8c60[0x0]);_0x4ec564['push'](_0x3d8c60[0x1]);_0x4ec564[_0xab28('0x22')](_0x3d8c60[_0xab28('0x23')](0x2,_0x3d8c60[_0xab28('0x19')])[_0xab28('0x1b')](','));break;case'dialogflowv2':var _0x163f1b=_0x3352cc[_0xab28('0x1f')][_0xab28('0x20')](',');_0x4ec564[_0xab28('0x22')](_0x163f1b[0x0]);_0x4ec564[_0xab28('0x22')](_0x163f1b[0x1]);_0x4ec564[_0xab28('0x22')](_0x163f1b[0x2]);_0x4ec564[_0xab28('0x22')](_0x163f1b[0x3]);_0x4ec564[_0xab28('0x22')](_0x163f1b[_0xab28('0x23')](0x4,_0x163f1b[_0xab28('0x19')])['join'](','));break;case'amazonlex':var _0x41126b=_0x3352cc['appdata']['split'](',');_0x4ec564[_0xab28('0x22')](_0x41126b[0x0]);_0x4ec564[_0xab28('0x22')](_0x41126b[0x1]);_0x4ec564[_0xab28('0x22')](_0x41126b[0x2]);_0x4ec564[_0xab28('0x22')](_0x41126b[0x3]);_0x4ec564[_0xab28('0x22')](_0x41126b[_0xab28('0x23')](0x4,_0x41126b['length'])[_0xab28('0x1b')](','));break;case _0xab28('0x15'):_0x4ec564[_0xab28('0x22')](_0x3352cc['appdata']);break;case _0xab28('0x25'):_0x4ec564['push'](_0x3352cc[_0xab28('0x26')]);_0x4ec564[_0xab28('0x22')](_0x3352cc['appdata']);break;case _0xab28('0x27'):var _0x12b5df=utils[_0xab28('0x28')](_0x3d133e[_0xab28('0x29')][_0xab28('0x2a')],_0x3d133e);var _0x42c6ec=_0x3352cc['appdata'][_0xab28('0x20')](',');_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x0]);_0x4ec564['push'](_0x42c6ec[0x1]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x2]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x3]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x4]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x5]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x6]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x7]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x8]);_0x4ec564[_0xab28('0x22')](_0x42c6ec[0x9]);_0x4ec564['push'](_0x42c6ec[0xa]);_0x4ec564[_0xab28('0x22')](_0x3d133e[_0xab28('0x16')]['id']);_0x4ec564['push'](_0x3d133e[_0xab28('0x15')]['id']);_0x4ec564[_0xab28('0x22')](_0x3352cc['ChatWebsiteId']);_0x4ec564[_0xab28('0x22')](_0x3d133e[_0xab28('0x16')][_0xab28('0x2b')]);_0x4ec564[_0xab28('0x22')](_0x3d133e[_0xab28('0x2c')][_0xab28('0x2c')]);_0x4ec564[_0xab28('0x22')](_0x12b5df);break;default:_0x4ec564=_['isNil'](_0x3352cc[_0xab28('0x1f')])?[]:_0x3352cc[_0xab28('0x1f')]['split'](',');}var _0x1e59b8={'id':util[_0xab28('0xb')](_0xab28('0x2d'),_0x4912fa,_0x3352cc['id'],_0x3352cc[_0xab28('0x1d')]),'condition':require(_0xab28('0x2e'))['condition'](_0x4912fa,getIntervals(_0x2c05bc[_0xab28('0x2f')],_0x3352cc),_0x2c05bc),'consequence':require('./applications/'+_0x3352cc['app'])[_0xab28('0x30')](_0x4912fa,_0x4ec564,_0x2c05bc,_0x3d133e),'p':_0x3352cc[_0xab28('0x31')]||0x0};logger[_0xab28('0x32')](_0xab28('0x33'),_0x1e59b8['id'],_0xab28('0x34'),getIntervals(_0x2c05bc['intervals'],_0x3352cc)['join'](_0xab28('0x35')));_0x28ebe2['push'](_0x1e59b8);}else{logger[_0xab28('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0xab28('0x17'),_0x3352cc[_0xab28('0x1d')]+_0xab28('0x1c')));}}_0x2c05bc[_0xab28('0x13')][_0x4912fa]=new RuleEngine(_0x28ebe2);_0x2c05bc[_0xab28('0x13')][_0x4912fa][_0xab28('0x37')](_0x3d133e,function(_0x53c232){logger['info'](_0xab28('0x38'),JSON['stringify'](_0x53c232[_0xab28('0x39')]));if(_0x2c05bc['rules'][_0x4912fa]){_0x2c05bc[_0xab28('0x13')][_0x4912fa]['emit']('complete');}});return _0xaaeb24({'code':0xc8,'message':_0x3d133e});}else{logger[_0xab28('0x32')]('No\x20applications\x20to\x20execute');return _0xaaeb24({'code':0xc8,'message':_0x3d133e});}}catch(_0x535494){logger['error'](_0x535494[_0xab28('0x3a')]);return _0x53c5c7(_0x14e8b4['error'](0x1f4,_0x535494));}}return _0x53c5c7(_0xab28('0x3b'));});},'AcceptMessage':function(_0x31bf66){var _0x3f1da9=this;return new Promise(function(_0x1016c3,_0x51243e){if(_0x31bf66[_0xab28('0x3c')]&&_0x31bf66[_0xab28('0x3c')]['id']){if(_0x2c05bc[_0xab28('0x3d')][_0x31bf66[_0xab28('0x3c')]['id']]){_0x2c05bc[_0xab28('0x3d')][_0x31bf66['agent']['id']][_0xab28('0x3e')]=![];_0x2c05bc[_0xab28('0x3d')][_0x31bf66['agent']['id']][_0xab28('0x3f')]=undefined;}}if(_0x31bf66['message']&&_0x31bf66['message']['id']){try{var _0x2e9311=getId(_0x31bf66[_0xab28('0x14')],_0x31bf66['message']?_0x31bf66[_0xab28('0x15')]['id']:0x0,_0x31bf66['interaction']?_0x31bf66[_0xab28('0x16')]['id']:0x0);if(_0x2c05bc[_0xab28('0x13')][_0x2e9311]){_0x2c05bc[_0xab28('0x13')][_0x2e9311][_0xab28('0x40')]('end');if(rpc[_0x31bf66[_0xab28('0x14')]+'QueueReport']){rpc[_0x31bf66['channel']+_0xab28('0x41')]['update'](_0x2e9311,{'UserId':_0x31bf66[_0xab28('0x15')][_0xab28('0x42')]})['catch'](function(_0x3e037d){logger[_0xab28('0x36')](_0xab28('0x43'));});}}return _0x1016c3({'code':0xc8,'message':_0x31bf66});}catch(_0x41dd3d){logger['error'](_0x41dd3d[_0xab28('0x3a')]);return _0x51243e(_0x3f1da9[_0xab28('0x36')](0x1f4,_0x41dd3d));}}logger[_0xab28('0x36')](_0xab28('0x44'));return _0x51243e(_0x3f1da9[_0xab28('0x36')](0x1f4,_0xab28('0x44')));});},'RejectMessage':function(_0x401216){var _0x1da81c=this;return new Promise(function(_0x4949ab,_0x39c5b4){if(_0x401216[_0xab28('0x3c')]&&_0x401216[_0xab28('0x3c')]['id']){try{if(_0x2c05bc[_0xab28('0x3d')][_0x401216[_0xab28('0x3c')]['id']]){_0x2c05bc[_0xab28('0x3d')][_0x401216[_0xab28('0x3c')]['id']][_0xab28('0x3e')]=![];_0x2c05bc[_0xab28('0x3d')][_0x401216[_0xab28('0x3c')]['id']][_0xab28('0x3f')]=undefined;}return _0x4949ab({'code':0xc8,'message':_0x401216});}catch(_0x4824f7){logger[_0xab28('0x36')](_0x4824f7['stack']);return _0x39c5b4(_0x1da81c['error'](0x1f4,_0x4824f7));}}logger[_0xab28('0x36')](_0xab28('0x44'));return _0x39c5b4(_0x1da81c[_0xab28('0x36')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x51da7f){var _0x13265a=this;return new Promise(function(_0x3429f8,_0x19a862){if(_0x51da7f[_0xab28('0x14')]&&_0x51da7f[_0xab28('0x16')]&&_0x51da7f[_0xab28('0x16')]['id']){try{var _0x335a50=getId(_0x51da7f[_0xab28('0x14')],_0x51da7f[_0xab28('0x15')]?_0x51da7f[_0xab28('0x15')]['id']:0x0,_0x51da7f[_0xab28('0x16')]?_0x51da7f[_0xab28('0x16')]['id']:0x0);if(_0x2c05bc[_0xab28('0x13')][_0x335a50]){_0x2c05bc[_0xab28('0x13')][_0x335a50][_0xab28('0x40')](_0xab28('0x45'));}return _0x3429f8({'code':0xc8,'message':_0x51da7f});}catch(_0x74479d){logger[_0xab28('0x36')](_0x74479d[_0xab28('0x3a')]);return _0x19a862(_0x13265a[_0xab28('0x36')](0x1f4,_0x74479d));}}logger[_0xab28('0x36')](_0xab28('0x44'));return _0x19a862(_0x13265a[_0xab28('0x36')](0x1f4,_0xab28('0x44')));});},'AgentCapacity':function(_0x1e2d73){var _0x7cc703=this;return new Promise(function(_0x1e2b50,_0x537b9a){if(_0x2c05bc[_0xab28('0x3d')][_0xab28('0x46')](_0x1e2d73['id'])){for(var _0x124e62 in _0x1e2d73['capacity']){if(_0x1e2d73[_0xab28('0x47')]['hasOwnProperty'](_0x124e62)){if(_0x2c05bc[_0xab28('0x3d')][_0x1e2d73['id']][_0xab28('0x46')](_0x124e62+'CurrentCapacity')){_0x2c05bc['agents'][_0x1e2d73['id']][_0x124e62+_0xab28('0x48')]=parseInt(_0x1e2d73[_0xab28('0x47')][_0x124e62],0xa);}}}_0x2c05bc['agents'][_0x1e2d73['id']][_0xab28('0x49')]();return _0x1e2b50({'code':0xc8,'message':_0x2c05bc['agents'][_0x1e2d73['id']]});}else{return _0x537b9a(_0x7cc703['error'](0x1f4,_0xab28('0x4a')));}});},'Agents':function(_0x2223af){return new Promise(function(_0x343c25,_0x5eabd3){var _0x2ae4d6=_[_0xab28('0x4b')](_0x2c05bc[_0xab28('0x3d')]);_0x343c25({'count':_0x2ae4d6[_0xab28('0x19')],'rows':_0x2ae4d6});});},'ChatQueues':function(_0x24d590){return new Promise(function(_0xc8959,_0x1bb8a0){var _0x4a622f=[];for(var _0x124573 in _0x2c05bc[_0xab28('0x4c')]){if(_0x2c05bc[_0xab28('0x4c')][_0xab28('0x46')](_0x124573)){var _0x21b1a6=_0x2c05bc[_0xab28('0x4c')][_0x124573];var _0x3f55ee={'id':_0x21b1a6['id'],'available':_0x21b1a6['available'],'loggedIn':_0x21b1a6[_0xab28('0x4d')],'name':_0x21b1a6[_0xab28('0x4e')],'paused':_0x21b1a6['paused'],'waiting':_0x21b1a6[_0xab28('0x4f')]};_0x4a622f['push'](_0x3f55ee);}}_0xc8959({'count':_0x4a622f[_0xab28('0x19')],'rows':_0x4a622f});});},'MailQueues':function(_0x47a4dd){return new Promise(function(_0x2452ee,_0x283f1c){var _0x2a2f69=[];for(var _0x54ab8c in _0x2c05bc[_0xab28('0x50')]){if(_0x2c05bc[_0xab28('0x50')][_0xab28('0x46')](_0x54ab8c)){var _0x5ea19b=_0x2c05bc['mailQueues'][_0x54ab8c];var _0x5bdb66={'id':_0x5ea19b['id'],'available':_0x5ea19b['available'],'loggedIn':_0x5ea19b['loggedIn'],'name':_0x5ea19b[_0xab28('0x4e')],'paused':_0x5ea19b[_0xab28('0x51')],'waiting':_0x5ea19b[_0xab28('0x4f')]};_0x2a2f69[_0xab28('0x22')](_0x5bdb66);}}_0x2452ee({'count':_0x2a2f69[_0xab28('0x19')],'rows':_0x2a2f69});});},'OpenchannelQueues':function(_0x51a68c){return new Promise(function(_0x27a9fa,_0x337b3d){var _0x4253ea=[];for(var _0x84c273 in _0x2c05bc[_0xab28('0x52')]){if(_0x2c05bc['openchannelQueues'][_0xab28('0x46')](_0x84c273)){var _0x52ec1f=_0x2c05bc[_0xab28('0x52')][_0x84c273];var _0x490858={'id':_0x52ec1f['id'],'available':_0x52ec1f[_0xab28('0x53')],'loggedIn':_0x52ec1f[_0xab28('0x4d')],'name':_0x52ec1f[_0xab28('0x4e')],'paused':_0x52ec1f[_0xab28('0x51')],'waiting':_0x52ec1f[_0xab28('0x4f')]};_0x4253ea[_0xab28('0x22')](_0x490858);}}_0x27a9fa({'count':_0x4253ea[_0xab28('0x19')],'rows':_0x4253ea});});},'SmsQueues':function(_0x345252){return new Promise(function(_0x51ab43,_0x43f7ad){var _0x58d54=[];for(var _0x5ce9d0 in _0x2c05bc[_0xab28('0x54')]){if(_0x2c05bc[_0xab28('0x54')][_0xab28('0x46')](_0x5ce9d0)){var _0xf8dc10=_0x2c05bc[_0xab28('0x54')][_0x5ce9d0];var _0x451df6={'id':_0xf8dc10['id'],'available':_0xf8dc10[_0xab28('0x53')],'loggedIn':_0xf8dc10[_0xab28('0x4d')],'name':_0xf8dc10['name'],'paused':_0xf8dc10['paused'],'waiting':_0xf8dc10['waiting']};_0x58d54[_0xab28('0x22')](_0x451df6);}}_0x51ab43({'count':_0x58d54['length'],'rows':_0x58d54});});},'FaxQueues':function(_0x483619){return new Promise(function(_0x36ac8f,_0x237b07){var _0x3264f2=[];for(var _0x294e2a in _0x2c05bc[_0xab28('0x55')]){if(_0x2c05bc[_0xab28('0x55')][_0xab28('0x46')](_0x294e2a)){var _0x182146=_0x2c05bc[_0xab28('0x55')][_0x294e2a];var _0x2a3a16={'id':_0x182146['id'],'available':_0x182146[_0xab28('0x53')],'loggedIn':_0x182146[_0xab28('0x4d')],'name':_0x182146[_0xab28('0x4e')],'paused':_0x182146[_0xab28('0x51')],'waiting':_0x182146[_0xab28('0x4f')]};_0x3264f2['push'](_0x2a3a16);}}_0x36ac8f({'count':_0x3264f2[_0xab28('0x19')],'rows':_0x3264f2});});},'WhatsappQueues':function(_0x1c3ef8){return new Promise(function(_0x283eaa,_0x1e95da){var _0x51dda9=[];for(var _0x530616 in _0x2c05bc[_0xab28('0x56')]){if(_0x2c05bc[_0xab28('0x56')]['hasOwnProperty'](_0x530616)){var _0x86c270=_0x2c05bc[_0xab28('0x56')][_0x530616];var _0x3bc85f={'id':_0x86c270['id'],'available':_0x86c270['available'],'loggedIn':_0x86c270['loggedIn'],'name':_0x86c270['name'],'paused':_0x86c270[_0xab28('0x51')],'waiting':_0x86c270[_0xab28('0x4f')]};_0x51dda9['push'](_0x3bc85f);}}_0x283eaa({'count':_0x51dda9['length'],'rows':_0x51dda9});});},'ChatQueuesWaitingInteractions':function(_0x25d82e){return new Promise(function(_0x295ed9,_0x795882){var _0x217ecd=_[_0xab28('0x4b')](_0x2c05bc[_0xab28('0x57')]);_0x295ed9({'count':_0x217ecd['length'],'rows':_0x217ecd});});},'MailQueuesWaitingInteractions':function(_0x191ed8){return new Promise(function(_0x17d5c0,_0x30c881){var _0x16c45b=_[_0xab28('0x4b')](_0x2c05bc[_0xab28('0x58')]);_0x17d5c0({'count':_0x16c45b[_0xab28('0x19')],'rows':_0x16c45b});});},'OpenchannelQueuesWaitingInteractions':function(_0x5bb6c2){return new Promise(function(_0x388bd4,_0x4e8deb){var _0x29d347=_['values'](_0x2c05bc[_0xab28('0x59')]);_0x388bd4({'count':_0x29d347[_0xab28('0x19')],'rows':_0x29d347});});},'SmsQueuesWaitingInteractions':function(_0x32b002){return new Promise(function(_0x45e821,_0x50aea7){var _0x5a78e8=_['values'](_0x2c05bc['smsQueuesWaitingInteractions']);_0x45e821({'count':_0x5a78e8[_0xab28('0x19')],'rows':_0x5a78e8});});},'FaxQueuesWaitingInteractions':function(_0x1d248e){return new Promise(function(_0x2455e6,_0x108dc1){var _0x14498a=_[_0xab28('0x4b')](_0x2c05bc['faxQueuesWaitingInteractions']);_0x2455e6({'count':_0x14498a[_0xab28('0x19')],'rows':_0x14498a});});},'WhatsappQueuesWaitingInteractions':function(_0x44ffef){return new Promise(function(_0x1d504b,_0x154167){var _0x411022=_[_0xab28('0x4b')](_0x2c05bc[_0xab28('0x5a')]);_0x1d504b({'count':_0x411022[_0xab28('0x19')],'rows':_0x411022});});}};var _0x1a0002=jayson[_0xab28('0x5b')](_0x7c1921)[_0xab28('0x5c')]();_0x1a0002['on'](_0xab28('0x36'),function(_0x2fcc88){logger[_0xab28('0x36')](JSON[_0xab28('0x5d')](_0x2fcc88));return _0x5c9694(_0x2fcc88);});_0x1a0002[_0xab28('0x12')](0x232c,_0xab28('0x5e'),function(){console['log'](_0xab28('0x5f'),0x232c);return _0x554954('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x9b87=['matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','paused','mailQueues','available','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','autoreply','split','push','slice','dialogflow','appdata','amazonlex','TagId','tvox','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','stringify'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0x9b87,0x8e));var _0x79b8=function(_0x2b5eae,_0x3684df){_0x2b5eae=_0x2b5eae-0x0;var _0x31fab4=_0x9b87[_0x2b5eae];return _0x31fab4;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var path=require(_0x79b8('0x2'));var fs=require('fs');var jayson=require(_0x79b8('0x3'));var BPromise=require(_0x79b8('0x4'));var uuid=require(_0x79b8('0x5'));var utils=require(_0x79b8('0x6'));var config=require(_0x79b8('0x7'));var logger=require(_0x79b8('0x8'))(_0x79b8('0x9'));var rpc={'openchannelQueueReport':require(_0x79b8('0xa')),'mailQueueReport':require(_0x79b8('0xb')),'chatQueueReport':require(_0x79b8('0xc')),'smsQueueReport':require(_0x79b8('0xd')),'faxQueueReport':require(_0x79b8('0xe')),'whatsappQueueReport':require(_0x79b8('0xf'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4e0dd8,_0x5c15d4,_0x4c058b){return util[_0x79b8('0x10')](_0x79b8('0x11'),_0x4e0dd8,_0x5c15d4||0x0,_0x4c058b||0x0);}function getIntervals(_0x2f3453,_0x4bc41f){var _0x28434=[];if(!_[_0x79b8('0x12')](_0x4bc41f[_0x79b8('0x13')])&&!_['isNil'](_0x2f3453[_0x4bc41f['IntervalId']])&&!_[_0x79b8('0x12')](_0x2f3453[_0x4bc41f[_0x79b8('0x13')]][_0x79b8('0x14')])){_0x28434=_[_0x79b8('0x15')](_0x2f3453[_0x4bc41f[_0x79b8('0x13')]][_0x79b8('0x14')],_0x79b8('0x16'));}else if(!_[_0x79b8('0x12')](_0x4bc41f[_0x79b8('0x16')])){_0x28434=[_0x4bc41f[_0x79b8('0x16')]];}return _0x28434;}exports[_0x79b8('0x17')]=function(_0x59e229){_0x59e229[_0x79b8('0x18')]={};return new BPromise(function(_0x4d5cd7,_0x565b54){var _0x3142e9={'Start':function(_0x21aae0){var _0x57a248=this;return new Promise(function(_0x5ddab5,_0x3e3de3){if(_0x21aae0){try{var _0x49e40b=[];var _0x5ef869=getId(_0x21aae0[_0x79b8('0x19')],_0x21aae0[_0x79b8('0x1a')]?_0x21aae0[_0x79b8('0x1a')]['id']:0x0,_0x21aae0[_0x79b8('0x1b')]?_0x21aae0[_0x79b8('0x1b')]['id']:0x0);if(_0x21aae0[_0x79b8('0x1c')]&&_['isArray'](_0x21aae0[_0x79b8('0x1c')])&&_0x21aae0['applications']['length']){for(var _0x9bcb94=0x0;_0x9bcb94<_0x21aae0[_0x79b8('0x1c')][_0x79b8('0x1d')];_0x9bcb94+=0x1){var _0x3e0157=_0x21aae0[_0x79b8('0x1c')][_0x9bcb94];if(fs[_0x79b8('0x1e')](path[_0x79b8('0x1f')](__dirname,_0x79b8('0x1c'),_0x3e0157[_0x79b8('0x20')]+'.js'))){var _0x3e9d83=[];switch(_0x3e0157[_0x79b8('0x20')]['toLowerCase']()){case _0x79b8('0x21'):var _0x3c4116=_0x3e0157['appdata'][_0x79b8('0x22')](',');if(_0x21aae0['channel']==='mail'){_0x3e9d83[_0x79b8('0x23')](_0x3c4116[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x3c4116[0x1]);_0x3e9d83[_0x79b8('0x23')](_0x3c4116[_0x79b8('0x24')](0x2,_0x3c4116[_0x79b8('0x1d')])['join'](','));}else{_0x3e9d83[_0x79b8('0x23')](_0x3c4116[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x3c4116[_0x79b8('0x24')](0x1,_0x3c4116[_0x79b8('0x1d')])['join'](','));}break;case _0x79b8('0x25'):var _0x2b6fad=_0x3e0157[_0x79b8('0x26')]['split'](',');_0x3e9d83[_0x79b8('0x23')](_0x2b6fad[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x2b6fad[0x1]);_0x3e9d83[_0x79b8('0x23')](_0x2b6fad[_0x79b8('0x24')](0x2,_0x2b6fad[_0x79b8('0x1d')])[_0x79b8('0x1f')](','));break;case'dialogflowv2':var _0x434ecd=_0x3e0157['appdata'][_0x79b8('0x22')](',');_0x3e9d83['push'](_0x434ecd[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x434ecd[0x1]);_0x3e9d83[_0x79b8('0x23')](_0x434ecd[0x2]);_0x3e9d83[_0x79b8('0x23')](_0x434ecd[0x3]);_0x3e9d83['push'](_0x434ecd[_0x79b8('0x24')](0x4,_0x434ecd[_0x79b8('0x1d')])[_0x79b8('0x1f')](','));break;case _0x79b8('0x27'):var _0x4df203=_0x3e0157[_0x79b8('0x26')]['split'](',');_0x3e9d83['push'](_0x4df203[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x4df203[0x1]);_0x3e9d83[_0x79b8('0x23')](_0x4df203[0x2]);_0x3e9d83['push'](_0x4df203[0x3]);_0x3e9d83[_0x79b8('0x23')](_0x4df203['slice'](0x4,_0x4df203['length'])[_0x79b8('0x1f')](','));break;case'message':_0x3e9d83[_0x79b8('0x23')](_0x3e0157[_0x79b8('0x26')]);break;case'tag':_0x3e9d83[_0x79b8('0x23')](_0x3e0157[_0x79b8('0x28')]);_0x3e9d83[_0x79b8('0x23')](_0x3e0157[_0x79b8('0x26')]);break;case _0x79b8('0x29'):var _0x3d7214=utils['getMustacheRender'](_0x21aae0[_0x79b8('0x2a')][_0x79b8('0x2b')],_0x21aae0);var _0x3b248e=_0x3e0157[_0x79b8('0x26')][_0x79b8('0x22')](',');_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x0]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x1]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x2]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x3]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x4]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x5]);_0x3e9d83['push'](_0x3b248e[0x6]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x7]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x8]);_0x3e9d83[_0x79b8('0x23')](_0x3b248e[0x9]);_0x3e9d83['push'](_0x3b248e[0xa]);_0x3e9d83[_0x79b8('0x23')](_0x21aae0[_0x79b8('0x1b')]['id']);_0x3e9d83[_0x79b8('0x23')](_0x21aae0[_0x79b8('0x1a')]['id']);_0x3e9d83[_0x79b8('0x23')](_0x3e0157[_0x79b8('0x2c')]);_0x3e9d83['push'](_0x21aae0[_0x79b8('0x1b')]['ContactId']);_0x3e9d83['push'](_0x21aae0[_0x79b8('0x2d')]['body']);_0x3e9d83['push'](_0x3d7214);break;default:_0x3e9d83=_[_0x79b8('0x12')](_0x3e0157[_0x79b8('0x26')])?[]:_0x3e0157[_0x79b8('0x26')][_0x79b8('0x22')](',');}var _0x43d795={'id':util[_0x79b8('0x10')](_0x79b8('0x2e'),_0x5ef869,_0x3e0157['id'],_0x3e0157[_0x79b8('0x20')]),'condition':require(_0x79b8('0x2f'))[_0x79b8('0x30')](_0x5ef869,getIntervals(_0x59e229[_0x79b8('0x31')],_0x3e0157),_0x59e229),'consequence':require(_0x79b8('0x32')+_0x3e0157[_0x79b8('0x20')])['consequence'](_0x5ef869,_0x3e9d83,_0x59e229,_0x21aae0),'p':_0x3e0157[_0x79b8('0x33')]||0x0};logger[_0x79b8('0x34')]('Push\x20new\x20rule',_0x43d795['id'],_0x79b8('0x35'),getIntervals(_0x59e229[_0x79b8('0x31')],_0x3e0157)['join'](_0x79b8('0x36')));_0x49e40b[_0x79b8('0x23')](_0x43d795);}else{logger[_0x79b8('0x37')](_0x79b8('0x38'),path[_0x79b8('0x1f')](__dirname,_0x79b8('0x1c'),_0x3e0157[_0x79b8('0x20')]+_0x79b8('0x39')));}}_0x59e229[_0x79b8('0x18')][_0x5ef869]=new RuleEngine(_0x49e40b);_0x59e229[_0x79b8('0x18')][_0x5ef869][_0x79b8('0x3a')](_0x21aae0,function(_0x379217){logger['info']('Applications\x20executed',JSON[_0x79b8('0x3b')](_0x379217[_0x79b8('0x3c')]));if(_0x59e229[_0x79b8('0x18')][_0x5ef869]){_0x59e229[_0x79b8('0x18')][_0x5ef869]['emit'](_0x79b8('0x3d'));}});return _0x5ddab5({'code':0xc8,'message':_0x21aae0});}else{logger[_0x79b8('0x34')](_0x79b8('0x3e'));return _0x5ddab5({'code':0xc8,'message':_0x21aae0});}}catch(_0x436157){logger['error'](_0x436157[_0x79b8('0x3f')]);return _0x3e3de3(_0x57a248[_0x79b8('0x37')](0x1f4,_0x436157));}}return _0x3e3de3(_0x79b8('0x40'));});},'AcceptMessage':function(_0x24297e){var _0x49d365=this;return new Promise(function(_0x3117b8,_0x415648){if(_0x24297e[_0x79b8('0x41')]&&_0x24297e[_0x79b8('0x41')]['id']){if(_0x59e229[_0x79b8('0x42')][_0x24297e[_0x79b8('0x41')]['id']]){_0x59e229['agents'][_0x24297e[_0x79b8('0x41')]['id']][_0x79b8('0x43')]=![];_0x59e229[_0x79b8('0x42')][_0x24297e[_0x79b8('0x41')]['id']]['busyQueue']=undefined;}}if(_0x24297e['message']&&_0x24297e[_0x79b8('0x1a')]['id']){try{var _0x45d813=getId(_0x24297e[_0x79b8('0x19')],_0x24297e[_0x79b8('0x1a')]?_0x24297e[_0x79b8('0x1a')]['id']:0x0,_0x24297e[_0x79b8('0x1b')]?_0x24297e[_0x79b8('0x1b')]['id']:0x0);if(_0x59e229[_0x79b8('0x18')][_0x45d813]){_0x59e229[_0x79b8('0x18')][_0x45d813]['emit'](_0x79b8('0x44'));if(rpc[_0x24297e[_0x79b8('0x19')]+_0x79b8('0x45')]){rpc[_0x24297e['channel']+_0x79b8('0x45')]['update'](_0x45d813,{'UserId':_0x24297e['message'][_0x79b8('0x46')]})[_0x79b8('0x47')](function(_0x5b4d56){logger[_0x79b8('0x37')]('error\x20update\x20queue\x20report');});}}return _0x3117b8({'code':0xc8,'message':_0x24297e});}catch(_0x5d2fae){logger[_0x79b8('0x37')](_0x5d2fae[_0x79b8('0x3f')]);return _0x415648(_0x49d365[_0x79b8('0x37')](0x1f4,_0x5d2fae));}}logger[_0x79b8('0x37')](_0x79b8('0x48'));return _0x415648(_0x49d365[_0x79b8('0x37')](0x1f4,_0x79b8('0x48')));});},'RejectMessage':function(_0x3d1078){var _0x26d69e=this;return new Promise(function(_0x1571cf,_0x2455c6){if(_0x3d1078[_0x79b8('0x41')]&&_0x3d1078[_0x79b8('0x41')]['id']){try{if(_0x59e229[_0x79b8('0x42')][_0x3d1078['agent']['id']]){_0x59e229[_0x79b8('0x42')][_0x3d1078[_0x79b8('0x41')]['id']][_0x79b8('0x43')]=![];_0x59e229[_0x79b8('0x42')][_0x3d1078['agent']['id']]['busyQueue']=undefined;}return _0x1571cf({'code':0xc8,'message':_0x3d1078});}catch(_0xe6316c){logger[_0x79b8('0x37')](_0xe6316c[_0x79b8('0x3f')]);return _0x2455c6(_0x26d69e[_0x79b8('0x37')](0x1f4,_0xe6316c));}}logger['error'](_0x79b8('0x48'));return _0x2455c6(_0x26d69e[_0x79b8('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x8e0f70){var _0x43efcf=this;return new Promise(function(_0x333edc,_0x5b2742){if(_0x8e0f70[_0x79b8('0x19')]&&_0x8e0f70['interaction']&&_0x8e0f70[_0x79b8('0x1b')]['id']){try{var _0x3a85bd=getId(_0x8e0f70[_0x79b8('0x19')],_0x8e0f70[_0x79b8('0x1a')]?_0x8e0f70[_0x79b8('0x1a')]['id']:0x0,_0x8e0f70[_0x79b8('0x1b')]?_0x8e0f70[_0x79b8('0x1b')]['id']:0x0);if(_0x59e229[_0x79b8('0x18')][_0x3a85bd]){_0x59e229[_0x79b8('0x18')][_0x3a85bd][_0x79b8('0x49')]('end');}return _0x333edc({'code':0xc8,'message':_0x8e0f70});}catch(_0x1dfcbd){logger['error'](_0x1dfcbd[_0x79b8('0x3f')]);return _0x5b2742(_0x43efcf['error'](0x1f4,_0x1dfcbd));}}logger[_0x79b8('0x37')](_0x79b8('0x48'));return _0x5b2742(_0x43efcf[_0x79b8('0x37')](0x1f4,_0x79b8('0x48')));});},'AgentCapacity':function(_0x2fcd4e){var _0x5885a3=this;return new Promise(function(_0x1d5b81,_0x57d73d){if(_0x59e229[_0x79b8('0x42')][_0x79b8('0x4a')](_0x2fcd4e['id'])){for(var _0x19953b in _0x2fcd4e[_0x79b8('0x4b')]){if(_0x2fcd4e[_0x79b8('0x4b')][_0x79b8('0x4a')](_0x19953b)){if(_0x59e229['agents'][_0x2fcd4e['id']][_0x79b8('0x4a')](_0x19953b+_0x79b8('0x4c'))){_0x59e229['agents'][_0x2fcd4e['id']][_0x19953b+_0x79b8('0x4c')]=parseInt(_0x2fcd4e['capacity'][_0x19953b],0xa);}}}_0x59e229[_0x79b8('0x42')][_0x2fcd4e['id']][_0x79b8('0x4d')]();return _0x1d5b81({'code':0xc8,'message':_0x59e229['agents'][_0x2fcd4e['id']]});}else{return _0x57d73d(_0x5885a3[_0x79b8('0x37')](0x1f4,_0x79b8('0x4e')));}});},'Agents':function(_0x584ccf){return new Promise(function(_0x27048c,_0x4b197b){var _0x2e11a6=_['values'](_0x59e229[_0x79b8('0x42')]);_0x27048c({'count':_0x2e11a6[_0x79b8('0x1d')],'rows':_0x2e11a6});});},'ChatQueues':function(_0x41f243){return new Promise(function(_0x26722c,_0x17a707){var _0x234855=[];for(var _0x529129 in _0x59e229[_0x79b8('0x4f')]){if(_0x59e229[_0x79b8('0x4f')]['hasOwnProperty'](_0x529129)){var _0x5b4443=_0x59e229[_0x79b8('0x4f')][_0x529129];var _0x40ddfc={'id':_0x5b4443['id'],'available':_0x5b4443['available'],'loggedIn':_0x5b4443[_0x79b8('0x50')],'name':_0x5b4443[_0x79b8('0x51')],'paused':_0x5b4443[_0x79b8('0x52')],'waiting':_0x5b4443['waiting']};_0x234855[_0x79b8('0x23')](_0x40ddfc);}}_0x26722c({'count':_0x234855[_0x79b8('0x1d')],'rows':_0x234855});});},'MailQueues':function(_0xb558){return new Promise(function(_0x8fe026,_0x41b63e){var _0x441aad=[];for(var _0x4bdd55 in _0x59e229[_0x79b8('0x53')]){if(_0x59e229[_0x79b8('0x53')][_0x79b8('0x4a')](_0x4bdd55)){var _0x54b5af=_0x59e229[_0x79b8('0x53')][_0x4bdd55];var _0x16af68={'id':_0x54b5af['id'],'available':_0x54b5af[_0x79b8('0x54')],'loggedIn':_0x54b5af['loggedIn'],'name':_0x54b5af[_0x79b8('0x51')],'paused':_0x54b5af[_0x79b8('0x52')],'waiting':_0x54b5af['waiting']};_0x441aad['push'](_0x16af68);}}_0x8fe026({'count':_0x441aad[_0x79b8('0x1d')],'rows':_0x441aad});});},'OpenchannelQueues':function(_0x35d3bc){return new Promise(function(_0x172532,_0x1cba9b){var _0xd39bc0=[];for(var _0x1c6ff0 in _0x59e229[_0x79b8('0x55')]){if(_0x59e229[_0x79b8('0x55')]['hasOwnProperty'](_0x1c6ff0)){var _0x3c62f1=_0x59e229['openchannelQueues'][_0x1c6ff0];var _0x580e84={'id':_0x3c62f1['id'],'available':_0x3c62f1[_0x79b8('0x54')],'loggedIn':_0x3c62f1['loggedIn'],'name':_0x3c62f1[_0x79b8('0x51')],'paused':_0x3c62f1[_0x79b8('0x52')],'waiting':_0x3c62f1[_0x79b8('0x56')]};_0xd39bc0['push'](_0x580e84);}}_0x172532({'count':_0xd39bc0[_0x79b8('0x1d')],'rows':_0xd39bc0});});},'SmsQueues':function(_0x2338dd){return new Promise(function(_0xcd4ac5,_0x388fff){var _0x12fb6b=[];for(var _0x225122 in _0x59e229[_0x79b8('0x57')]){if(_0x59e229[_0x79b8('0x57')][_0x79b8('0x4a')](_0x225122)){var _0x2d19b9=_0x59e229[_0x79b8('0x57')][_0x225122];var _0x65f178={'id':_0x2d19b9['id'],'available':_0x2d19b9['available'],'loggedIn':_0x2d19b9[_0x79b8('0x50')],'name':_0x2d19b9[_0x79b8('0x51')],'paused':_0x2d19b9[_0x79b8('0x52')],'waiting':_0x2d19b9[_0x79b8('0x56')]};_0x12fb6b[_0x79b8('0x23')](_0x65f178);}}_0xcd4ac5({'count':_0x12fb6b[_0x79b8('0x1d')],'rows':_0x12fb6b});});},'FaxQueues':function(_0x15cc71){return new Promise(function(_0x33ea25,_0x25ac73){var _0x536868=[];for(var _0xbd494e in _0x59e229['faxQueues']){if(_0x59e229[_0x79b8('0x58')]['hasOwnProperty'](_0xbd494e)){var _0x5b785b=_0x59e229[_0x79b8('0x58')][_0xbd494e];var _0x275c67={'id':_0x5b785b['id'],'available':_0x5b785b[_0x79b8('0x54')],'loggedIn':_0x5b785b[_0x79b8('0x50')],'name':_0x5b785b[_0x79b8('0x51')],'paused':_0x5b785b[_0x79b8('0x52')],'waiting':_0x5b785b[_0x79b8('0x56')]};_0x536868[_0x79b8('0x23')](_0x275c67);}}_0x33ea25({'count':_0x536868['length'],'rows':_0x536868});});},'WhatsappQueues':function(_0x589712){return new Promise(function(_0x5a4014,_0x435942){var _0x238ad7=[];for(var _0x3b5966 in _0x59e229[_0x79b8('0x59')]){if(_0x59e229[_0x79b8('0x59')][_0x79b8('0x4a')](_0x3b5966)){var _0x3b83f2=_0x59e229[_0x79b8('0x59')][_0x3b5966];var _0x397830={'id':_0x3b83f2['id'],'available':_0x3b83f2[_0x79b8('0x54')],'loggedIn':_0x3b83f2[_0x79b8('0x50')],'name':_0x3b83f2[_0x79b8('0x51')],'paused':_0x3b83f2['paused'],'waiting':_0x3b83f2[_0x79b8('0x56')]};_0x238ad7[_0x79b8('0x23')](_0x397830);}}_0x5a4014({'count':_0x238ad7['length'],'rows':_0x238ad7});});},'ChatQueuesWaitingInteractions':function(_0x2985c4){return new Promise(function(_0xc731e8,_0x4208cc){var _0x371ecc=_[_0x79b8('0x5a')](_0x59e229[_0x79b8('0x5b')]);_0xc731e8({'count':_0x371ecc[_0x79b8('0x1d')],'rows':_0x371ecc});});},'MailQueuesWaitingInteractions':function(_0x2c7eb4){return new Promise(function(_0x5f4420,_0x54093d){var _0x3a865a=_[_0x79b8('0x5a')](_0x59e229[_0x79b8('0x5c')]);_0x5f4420({'count':_0x3a865a[_0x79b8('0x1d')],'rows':_0x3a865a});});},'OpenchannelQueuesWaitingInteractions':function(_0x48a2f4){return new Promise(function(_0x7101cc,_0x17b450){var _0x376fb8=_[_0x79b8('0x5a')](_0x59e229[_0x79b8('0x5d')]);_0x7101cc({'count':_0x376fb8['length'],'rows':_0x376fb8});});},'SmsQueuesWaitingInteractions':function(_0x56f946){return new Promise(function(_0x5e2b80,_0x4cc6cc){var _0x1207d3=_[_0x79b8('0x5a')](_0x59e229['smsQueuesWaitingInteractions']);_0x5e2b80({'count':_0x1207d3[_0x79b8('0x1d')],'rows':_0x1207d3});});},'FaxQueuesWaitingInteractions':function(_0xd6c7e7){return new Promise(function(_0xcde403,_0x10afbe){var _0x2ba77a=_[_0x79b8('0x5a')](_0x59e229[_0x79b8('0x5e')]);_0xcde403({'count':_0x2ba77a[_0x79b8('0x1d')],'rows':_0x2ba77a});});},'WhatsappQueuesWaitingInteractions':function(_0x2e67b5){return new Promise(function(_0x1014cf,_0x2b7e60){var _0x4d5fcf=_['values'](_0x59e229[_0x79b8('0x5f')]);_0x1014cf({'count':_0x4d5fcf[_0x79b8('0x1d')],'rows':_0x4d5fcf});});}};var _0xbc1e3f=jayson[_0x79b8('0x60')](_0x3142e9)[_0x79b8('0x61')]();_0xbc1e3f['on'](_0x79b8('0x37'),function(_0x191f02){logger['error'](JSON[_0x79b8('0x3b')](_0x191f02));return _0x565b54(_0x191f02);});_0xbc1e3f[_0x79b8('0x17')](0x232c,_0x79b8('0x62'),function(){console[_0x79b8('0x63')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4d5cd7(_0x79b8('0x64')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index ea50d61..87e293f 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 _0x3425=['\x20|\x20','util','bluebird','lodash','routing','client','http','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','log'];(function(_0x14f5c3,_0x1e3047){var _0x2ea070=function(_0x1c8cd4){while(--_0x1c8cd4){_0x14f5c3['push'](_0x14f5c3['shift']());}};_0x2ea070(++_0x1e3047);}(_0x3425,0x15d));var _0x5342=function(_0x19b46e,_0x3f1911){_0x19b46e=_0x19b46e-0x0;var _0x474653=_0x3425[_0x19b46e];return _0x474653;};'use strict';var util=require(_0x5342('0x0'));var BPromise=require(_0x5342('0x1'));var jayson=require('jayson/promise');var _=require(_0x5342('0x2'));var logger=require('../../../config/logger')(_0x5342('0x3'));var client=jayson[_0x5342('0x4')][_0x5342('0x5')]({'port':0x232a});function request(_0x21f400,_0x468d7e){return new BPromise(function(_0x53c5fa,_0x51a581){return client[_0x5342('0x6')](_0x21f400,_0x468d7e)[_0x5342('0x7')](function(_0x4d929f){if(_0x4d929f[_0x5342('0x8')]){return _0x51a581(_0x4d929f['error'][_0x5342('0x9')]);}else{return _0x53c5fa(_0x4d929f[_0x5342('0xa')]);}})[_0x5342('0xb')](function(_0x3cbb60){return _0x51a581(_0x3cbb60);});});}exports['condition']=function(_0x24d61d,_0x10fd2e,_0x29dd03){return function(_0x5af6a8){if(_0x29dd03[_0x5342('0xc')]&&!_0x29dd03[_0x5342('0xc')][_0x24d61d]){logger[_0x5342('0xd')](_0x5342('0xe'),_0x24d61d);return _0x5af6a8[_0x5342('0xf')]();}var _0x33a8a8=[];for(var _0x113f73=0x0;_0x113f73<_0x10fd2e[_0x5342('0x10')];_0x113f73+=0x1){_0x33a8a8[_0x5342('0x11')](request(_0x5342('0x12'),{'command':util[_0x5342('0x13')]('iftime\x20%s',_0x10fd2e[_0x113f73])})[_0x5342('0x7')](function(_0x1f774b){return _0x1f774b&&_0x1f774b[_0x5342('0x9')]&&_0x1f774b[_0x5342('0x9')][_0x5342('0x14')](_0x5342('0x15'))>=0x0?!![]:![];})[_0x5342('0xb')](function(_0x417928){logger['error'](_0x5342('0x16'),_0x24d61d,_0x10fd2e[_0x113f73]);}));}BPromise[_0x5342('0x17')](_0x33a8a8)['then'](function(_0x48a9bf){var _0x30dab9=_[_0x5342('0x18')](_0x48a9bf);logger['info'](_0x5342('0x19'),_0x24d61d,_0x10fd2e[_0x5342('0x1a')]('\x20|\x20'),_0x30dab9);_0x5af6a8['when'](_0x30dab9);})[_0x5342('0xb')](function(_0x57c5ad){console[_0x5342('0x1b')](_0x57c5ad);logger[_0x5342('0x8')](_0x5342('0x19'),_0x24d61d,_0x10fd2e['join'](_0x5342('0x1c')),_0x57c5ad['stack']);_0x5af6a8[_0x5342('0xf')]();});};}; \ No newline at end of file +var _0xa377=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','util','bluebird','lodash','../../../config/logger','client','http','request','then','error','message','catch','condition'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xa377,0x15c));var _0x7a37=function(_0x27ef92,_0x49d745){_0x27ef92=_0x27ef92-0x0;var _0x2bb935=_0xa377[_0x27ef92];return _0x2bb935;};'use strict';var util=require(_0x7a37('0x0'));var BPromise=require(_0x7a37('0x1'));var jayson=require('jayson/promise');var _=require(_0x7a37('0x2'));var logger=require(_0x7a37('0x3'))('routing');var client=jayson[_0x7a37('0x4')][_0x7a37('0x5')]({'port':0x232a});function request(_0xfd7129,_0x45b1c7){return new BPromise(function(_0x105f9d,_0x569025){return client[_0x7a37('0x6')](_0xfd7129,_0x45b1c7)[_0x7a37('0x7')](function(_0x3d6985){if(_0x3d6985[_0x7a37('0x8')]){return _0x569025(_0x3d6985[_0x7a37('0x8')][_0x7a37('0x9')]);}else{return _0x105f9d(_0x3d6985['result']);}})[_0x7a37('0xa')](function(_0x37ffa9){return _0x569025(_0x37ffa9);});});}exports[_0x7a37('0xb')]=function(_0x1ac1c5,_0x4659dc,_0x115040){return function(_0x40172e){if(_0x115040['rules']&&!_0x115040[_0x7a37('0xc')][_0x1ac1c5]){logger[_0x7a37('0xd')](_0x7a37('0xe'),_0x1ac1c5);return _0x40172e[_0x7a37('0xf')]();}var _0x2b983b=[];for(var _0x3ab07e=0x0;_0x3ab07e<_0x4659dc[_0x7a37('0x10')];_0x3ab07e+=0x1){_0x2b983b[_0x7a37('0x11')](request(_0x7a37('0x12'),{'command':util[_0x7a37('0x13')](_0x7a37('0x14'),_0x4659dc[_0x3ab07e])})[_0x7a37('0x7')](function(_0xf7624){return _0xf7624&&_0xf7624['message']&&_0xf7624[_0x7a37('0x9')][_0x7a37('0x15')](_0x7a37('0x16'))>=0x0?!![]:![];})['catch'](function(_0x2aeda1){logger[_0x7a37('0x8')](_0x7a37('0x17'),_0x1ac1c5,_0x4659dc[_0x3ab07e]);}));}BPromise['all'](_0x2b983b)[_0x7a37('0x7')](function(_0x28c13d){var _0x24d778=_[_0x7a37('0x18')](_0x28c13d);logger['info'](_0x7a37('0x19'),_0x1ac1c5,_0x4659dc[_0x7a37('0x1a')]('\x20|\x20'),_0x24d778);_0x40172e[_0x7a37('0x1b')](_0x24d778);})['catch'](function(_0x3dc6f6){console[_0x7a37('0x1c')](_0x3dc6f6);logger[_0x7a37('0x8')](_0x7a37('0x19'),_0x1ac1c5,_0x4659dc[_0x7a37('0x1a')](_0x7a37('0x1d')),_0x3dc6f6['stack']);_0x40172e[_0x7a37('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7f2d6d5..0db68e7 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 _0x41bb=['transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','complete','[%s][agents][hangup]','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','lastevent','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','ringtime','talktime','push','error','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','answered_elsewhere','reason','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind'];(function(_0x36685b,_0x493145){var _0x54966b=function(_0x2f9445){while(--_0x2f9445){_0x36685b['push'](_0x36685b['shift']());}};_0x54966b(++_0x493145);}(_0x41bb,0xc5));var _0xb41b=function(_0x31478e,_0x73729d){_0x31478e=_0x31478e-0x0;var _0x5053ce=_0x41bb[_0x31478e];return _0x5053ce;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x428431,_0x4d5578){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x4'),_0x428431[_0xb41b('0x5')],_0x428431['channel'],_0x428431[_0xb41b('0x6')],_0x428431[_0xb41b('0x7')],_0x428431[_0xb41b('0x8')],_0x428431['calleridnum'],_0x428431['connectedlinenum'],_0x428431['lastevent']));if(_0x428431[_0xb41b('0x6')]){utils[_0xb41b('0x9')](_0x428431['queue'])[_0xb41b('0xa')](function(_0x2c1a53){if(_0x2c1a53){_0x428431[_0xb41b('0xb')]=_0x2c1a53[_0xb41b('0xb')];_0x428431[_0xb41b('0xc')]=_0x428431[_0xb41b('0xd')]?_0x2c1a53[_0xb41b('0xe')]:![];_0x428431['acwtime']=_0x428431[_0xb41b('0xc')]?_0x2c1a53['acwTimeout']:0x0;}utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);});}else{utils[_0xb41b('0xf')](_0xb41b('0x10'),_0x428431);}if(_0x4d5578){delete transfers[_0x428431[_0xb41b('0x5')]];}else{delete agents[_0x428431['destuniqueid']];}}exports[_0xb41b('0x11')]=function(_0x2d947a){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a['uniqueid']),_0x2d947a);agents[_0x2d947a['destuniqueid']]=_0x2d947a;agents[_0x2d947a['destuniqueid']][_0xb41b('0x14')]=utils[_0xb41b('0x15')]();agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x18');agents[_0x2d947a['destuniqueid']][_0xb41b('0x19')]=null;agents[_0x2d947a[_0xb41b('0x16')]][_0xb41b('0x1a')]=null;utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x1b'),_0x2d947a[_0xb41b('0x5')],agents[_0x2d947a['destuniqueid']]['membername'],_0x2d947a['destuniqueid']));}catch(_0xf109f8){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x13'),_0x2d947a[_0xb41b('0x5')]),_0xf109f8);}};exports['agentringnoanswer']=function(_0x53bc44){try{if(!_[_0xb41b('0x1c')](agents[_0x53bc44[_0xb41b('0x16')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x53bc44);utils['info'](util['format'](_0xb41b('0x1e'),_0x53bc44[_0xb41b('0x5')],agents[_0x53bc44[_0xb41b('0x16')]]['membername'],_0x53bc44[_0xb41b('0x16')]));agents[_0x53bc44[_0xb41b('0x16')]]['agentringnoanswer']=!![];agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x1f')]=utils['now']();agents[_0x53bc44[_0xb41b('0x16')]]['lastevent']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['reason']=_0xb41b('0x20');agents[_0x53bc44[_0xb41b('0x16')]]['holdtime']=_0x53bc44['ringtime']?parseInt(_0x53bc44[_0xb41b('0x21')])/0x3e8:0x0;agents[_0x53bc44[_0xb41b('0x16')]][_0xb41b('0x22')]=0x0;unanswered[_0xb41b('0x23')](_0x53bc44[_0xb41b('0x16')]);}}catch(_0x181cbd){utils[_0xb41b('0x24')](util['format'](_0xb41b('0x1d'),_0x53bc44[_0xb41b('0x5')]),_0x181cbd);}};exports['queuecallerabandon']=function(_0xe64568){try{_['forIn'](agents,function(_0x38277f,_0x31d4cd){if(_0x38277f['uniqueid']==_0xe64568[_0xb41b('0x5')]&&!_['includes'](unanswered,_0x38277f[_0xb41b('0x16')])){utils[_0xb41b('0x12')](util['format'](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0xe64568);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x26'),_0xe64568[_0xb41b('0x5')],_0x38277f[_0xb41b('0x7')],_0x38277f[_0xb41b('0x16')]));_0x38277f[_0xb41b('0x27')]=!![];_0x38277f[_0xb41b('0x1f')]=utils['now']();_0x38277f[_0xb41b('0x17')]='abandoned';_0x38277f['reason']=_0xb41b('0x28');_0x38277f[_0xb41b('0x29')]=_0xe64568[_0xb41b('0x29')];_0x38277f[_0xb41b('0x22')]=0x0;writeDB(_0x38277f);}});}catch(_0x1b8681){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x25'),_0xe64568[_0xb41b('0x5')]),_0x1b8681);}};exports[_0xb41b('0x2a')]=function(_0x3a06a0){try{if(agents[_0x3a06a0['destuniqueid']]){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x2b'),_0x3a06a0[_0xb41b('0x5')]),_0x3a06a0);utils[_0xb41b('0x2')](util[_0xb41b('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x3a06a0['uniqueid'],agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x7')],_0x3a06a0['destuniqueid']));agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x2c')]=utils[_0xb41b('0x15')]();agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x19')]=_0x3a06a0['connectedlinenum'];agents[_0x3a06a0[_0xb41b('0x16')]]['connectedlinename']=_0x3a06a0[_0xb41b('0x1a')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x29')]=_0x3a06a0[_0xb41b('0x21')];agents[_0x3a06a0[_0xb41b('0x16')]][_0xb41b('0x17')]=_0xb41b('0x2d');_[_0xb41b('0x2e')](agents,function(_0x2b0721,_0x578b67){if(_0x2b0721['destuniqueid']!=_0x3a06a0['destuniqueid']&&_0x2b0721[_0xb41b('0x5')]==_0x3a06a0['uniqueid']){_0x2b0721['talktime']=0x0;_0x2b0721[_0xb41b('0x29')]=_0x3a06a0['ringtime'];_0x2b0721[_0xb41b('0x27')]=!![];_0x2b0721[_0xb41b('0x1f')]=utils[_0xb41b('0x15')]();_0x2b0721[_0xb41b('0x17')]=_0xb41b('0x2f');_0x2b0721[_0xb41b('0x30')]=_0xb41b('0x2f');_0x2b0721['answeredelsewheredestinationuniqueid']=_0x3a06a0[_0xb41b('0x16')];_0x2b0721[_0xb41b('0x31')]=_0x3a06a0[_0xb41b('0x7')];writeDB(_0x2b0721);}});}}catch(_0x174d6c){utils['error'](util[_0xb41b('0x3')]('[%s][agents][agentconnect]',_0x3a06a0[_0xb41b('0x5')]),_0x174d6c);}};exports[_0xb41b('0xd')]=function(_0x46dbbf){try{if(!_['isNil'](agents[_0x46dbbf['destuniqueid']])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x46dbbf);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x33'),_0x46dbbf['uniqueid'],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x7')],_0x46dbbf['destuniqueid']));agents[_0x46dbbf[_0xb41b('0x16')]]['agentcomplete']=!![];agents[_0x46dbbf[_0xb41b('0x16')]]['agentcompleteAt']=utils[_0xb41b('0x15')]();agents[_0x46dbbf['destuniqueid']][_0xb41b('0x22')]=utils[_0xb41b('0x34')](agents[_0x46dbbf[_0xb41b('0x16')]][_0xb41b('0x35')],agents[_0x46dbbf['destuniqueid']][_0xb41b('0x2c')]);agents[_0x46dbbf[_0xb41b('0x16')]]['reason']=_0x46dbbf[_0xb41b('0x30')];agents[_0x46dbbf['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x46dbbf['destuniqueid']]);}}catch(_0x263d8d){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x32'),_0x46dbbf[_0xb41b('0x5')]),_0x263d8d);}};exports[_0xb41b('0x36')]=function(_0x34d076){try{if(!_[_0xb41b('0x1c')](agents[_0x34d076[_0xb41b('0x37')]])){utils[_0xb41b('0x12')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x34d076);utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x39'),_0x34d076['uniqueid'],agents[_0x34d076[_0xb41b('0x37')]]['membername'],agents[_0x34d076['transfereruniqueid']][_0xb41b('0x5')]));agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3a')]=!![];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3b')]=_0xb41b('0x3c');agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3d')]=_0x34d076[_0xb41b('0x3e')];agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x3f')]=agents[_0x34d076[_0xb41b('0x37')]][_0xb41b('0x5')];}}catch(_0x3ce89e){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x38'),_0x34d076[_0xb41b('0x5')]),_0x3ce89e);}};exports[_0xb41b('0x40')]=function(_0x247ca0){try{utils[_0xb41b('0x12')](util['format'](_0xb41b('0x41'),_0x247ca0['origtransfereruniqueid']),_0x247ca0);if(_0x247ca0[_0xb41b('0x42')]==_0x247ca0[_0xb41b('0x43')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x44')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0['origtransfereruniqueid'],agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x7')]));agents[_0x247ca0[_0xb41b('0x44')]]['transfer']=!![];agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3b')]=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x3d')]=_0x247ca0[_0xb41b('0x47')];agents[_0x247ca0[_0xb41b('0x44')]]['transferuniqueid']=_0x247ca0['origtransfereruniqueid'];}if(_0x247ca0[_0xb41b('0x48')]&&agents[_0x247ca0[_0xb41b('0x48')]]){agents[_0x247ca0['transfereeuniqueid']][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x48')]]=_['clone'](agents[_0x247ca0[_0xb41b('0x48')]]);transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4a')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4a')];transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x44')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x48')]]['agentcalledAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0[_0xb41b('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x247ca0[_0xb41b('0x48')]][_0xb41b('0x29')]=0x0;transfers[_0x247ca0[_0xb41b('0x48')]]['agententerreason']=0x2;}}else if(_0x247ca0[_0xb41b('0x44')]==_0x247ca0[_0xb41b('0x4c')]){if(!_[_0xb41b('0x1c')](agents[_0x247ca0[_0xb41b('0x42')]])){utils[_0xb41b('0x2')](util[_0xb41b('0x3')](_0xb41b('0x45'),_0x247ca0[_0xb41b('0x42')],agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x7')]));agents[_0x247ca0['origtransfereruniqueid']][_0xb41b('0x3a')]=!![];agents[_0x247ca0[_0xb41b('0x42')]]['transfertype']=_0xb41b('0x46');agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3d')]=_0x247ca0['secondtransfererexten'];agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x3f')]=_0x247ca0[_0xb41b('0x44')];}if(_0x247ca0[_0xb41b('0x4d')]&&agents[_0x247ca0[_0xb41b('0x4d')]]){agents[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x49')]=0x1;transfers[_0x247ca0[_0xb41b('0x4d')]]=_[_0xb41b('0x4e')](agents[_0x247ca0[_0xb41b('0x4d')]]);transfers[_0x247ca0['transfertargetuniqueid']]['calleridnum']=agents[_0x247ca0['origtransfereruniqueid']]['calleridnum'];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x4b')]=agents[_0x247ca0[_0xb41b('0x42')]][_0xb41b('0x4b')];transfers[_0x247ca0[_0xb41b('0x4d')]][_0xb41b('0x14')]=utils['now']();transfers[_0x247ca0[_0xb41b('0x4d')]]['agentconnectAt']=utils[_0xb41b('0x15')]();transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x29')]=0x0;transfers[_0x247ca0['transfertargetuniqueid']][_0xb41b('0x49')]=0x2;}}}catch(_0xc2afd1){utils['error'](util[_0xb41b('0x3')](_0xb41b('0x41'),_0x247ca0[_0xb41b('0x42')]),_0xc2afd1);}};exports[_0xb41b('0x4f')]=function(_0x39f6ad){try{utils[_0xb41b('0x12')](util[_0xb41b('0x3')]('[%s][agents][hangup]',_0x39f6ad[_0xb41b('0x5')]),_0x39f6ad);if(agents[_0x39f6ad['uniqueid']]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]===_0xb41b('0x20')){if(_0x39f6ad['cause']==='21'){agents[_0x39f6ad['uniqueid']]['reason']='rejected';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x50');}utils['info'](util['format'](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]]['lastevent']));writeDB(agents[_0x39f6ad['uniqueid']]);var _0x303ca3=unanswered[_0xb41b('0x52')](_0x39f6ad['uniqueid']);if(_0x303ca3>-0x1){unanswered[_0xb41b('0x53')](_0x303ca3,0x1);}}if(transfers[_0x39f6ad['uniqueid']]){transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];transfers[_0x39f6ad['uniqueid']][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();transfers[_0x39f6ad['uniqueid']]['talktime']=utils[_0xb41b('0x34')](transfers[_0x39f6ad[_0xb41b('0x5')]]['agentcompleteAt'],transfers[_0x39f6ad[_0xb41b('0x5')]]['agentconnectAt']);transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]='agent';transfers[_0x39f6ad['uniqueid']][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad[_0xb41b('0x5')],transfers[_0x39f6ad['uniqueid']][_0xb41b('0x7')],transfers[_0x39f6ad['uniqueid']]['reason'],transfers[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(transfers[_0x39f6ad[_0xb41b('0x5')]],!![]);}if(agents[_0x39f6ad[_0xb41b('0x5')]]&&agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]){agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0xd')]=!![];agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')]=utils[_0xb41b('0x15')]();agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x22')]=utils['diffTime'](agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x35')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x2c')]);agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x30')]=agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x3a')]?'transfer':'agent';agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]=_0xb41b('0x54');utils['info'](util[_0xb41b('0x3')](_0xb41b('0x51'),_0x39f6ad['uniqueid'],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x7')],agents[_0x39f6ad['uniqueid']][_0xb41b('0x30')],agents[_0x39f6ad[_0xb41b('0x5')]][_0xb41b('0x17')]));writeDB(agents[_0x39f6ad[_0xb41b('0x5')]]);}}catch(_0x31c5c1){utils[_0xb41b('0x24')](util[_0xb41b('0x3')](_0xb41b('0x55'),_0x39f6ad[_0xb41b('0x5')]),_0x31c5c1);}}; \ No newline at end of file +var _0xbc9d=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','lodash','util','./utils','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','talktime','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected'];(function(_0x45ac16,_0xadc31e){var _0x1ab5d0=function(_0x35ab94){while(--_0x35ab94){_0x45ac16['push'](_0x45ac16['shift']());}};_0x1ab5d0(++_0xadc31e);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x1bcb2c,_0xf85d2a){_0x1bcb2c=_0x1bcb2c-0x0;var _0x843eab=_0xbc9d[_0x1bcb2c];return _0x843eab;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var utils=require(_0xdbc9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x434f6e,_0x35f89c){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x434f6e[_0xdbc9('0x3')],_0x434f6e[_0xdbc9('0x4')],_0x434f6e[_0xdbc9('0x5')],_0x434f6e[_0xdbc9('0x6')],_0x434f6e[_0xdbc9('0x7')],_0x434f6e[_0xdbc9('0x8')],_0x434f6e[_0xdbc9('0x9')],_0x434f6e['lastevent']));if(_0x434f6e[_0xdbc9('0x5')]){utils[_0xdbc9('0xa')](_0x434f6e[_0xdbc9('0x5')])['then'](function(_0x2c7ba5){if(_0x2c7ba5){_0x434f6e['type']=_0x2c7ba5['type'];_0x434f6e[_0xdbc9('0xb')]=_0x434f6e[_0xdbc9('0xc')]?_0x2c7ba5[_0xdbc9('0xd')]:![];_0x434f6e[_0xdbc9('0xe')]=_0x434f6e['agentacw']?_0x2c7ba5[_0xdbc9('0xf')]:0x0;}utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);});}else{utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);}if(_0x35f89c){delete transfers[_0x434f6e[_0xdbc9('0x3')]];}else{delete agents[_0x434f6e['destuniqueid']];}}exports['agentcalled']=function(_0x3d0fdd){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x3d0fdd);agents[_0x3d0fdd['destuniqueid']]=_0x3d0fdd;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x16')]=utils[_0xdbc9('0x17')]();agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x19');agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x9')]=null;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=null;utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x1c'),_0x3d0fdd[_0xdbc9('0x3')],agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x3d0fdd[_0xdbc9('0x15')]));}catch(_0x57a546){utils[_0xdbc9('0x1d')](util['format'](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x57a546);}};exports['agentringnoanswer']=function(_0x4408e9){try{if(!_['isNil'](agents[_0x4408e9['destuniqueid']])){utils['debug'](util['format'](_0xdbc9('0x1e'),_0x4408e9[_0xdbc9('0x3')]),_0x4408e9);utils['info'](util[_0xdbc9('0x13')](_0xdbc9('0x1f'),_0x4408e9['uniqueid'],agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x4408e9[_0xdbc9('0x15')]));agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x20')]=!![];agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();agents[_0x4408e9[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]]['holdtime']=_0x4408e9[_0xdbc9('0x24')]?parseInt(_0x4408e9[_0xdbc9('0x24')])/0x3e8:0x0;agents[_0x4408e9['destuniqueid']]['talktime']=0x0;unanswered[_0xdbc9('0x25')](_0x4408e9[_0xdbc9('0x15')]);}}catch(_0x473430){utils['error'](util[_0xdbc9('0x13')]('[%s][agents][agentringnoanswer]',_0x4408e9['uniqueid']),_0x473430);}};exports[_0xdbc9('0x26')]=function(_0x49da36){try{_['forIn'](agents,function(_0x417b17,_0x20eb4f){if(_0x417b17[_0xdbc9('0x3')]==_0x49da36['uniqueid']&&!_[_0xdbc9('0x27')](unanswered,_0x417b17[_0xdbc9('0x15')])){utils['debug'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x49da36);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x29'),_0x49da36[_0xdbc9('0x3')],_0x417b17[_0xdbc9('0x6')],_0x417b17['destuniqueid']));_0x417b17[_0xdbc9('0x20')]=!![];_0x417b17[_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();_0x417b17[_0xdbc9('0x18')]=_0xdbc9('0x2a');_0x417b17[_0xdbc9('0x23')]='abandoned';_0x417b17[_0xdbc9('0x2b')]=_0x49da36['holdtime'];_0x417b17['talktime']=0x0;writeDB(_0x417b17);}});}catch(_0x495c0e){utils['error'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x495c0e);}};exports[_0xdbc9('0x2c')]=function(_0x5527fc){try{if(agents[_0x5527fc[_0xdbc9('0x15')]]){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc[_0xdbc9('0x3')]),_0x5527fc);utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x2e'),_0x5527fc[_0xdbc9('0x3')],agents[_0x5527fc[_0xdbc9('0x15')]]['membername'],_0x5527fc[_0xdbc9('0x15')]));agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();agents[_0x5527fc['destuniqueid']]['connectedlinenum']=_0x5527fc[_0xdbc9('0x9')];agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=_0x5527fc[_0xdbc9('0x1a')];agents[_0x5527fc['destuniqueid']][_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];agents[_0x5527fc[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x30');_[_0xdbc9('0x31')](agents,function(_0x444219,_0x523c79){if(_0x444219[_0xdbc9('0x15')]!=_0x5527fc[_0xdbc9('0x15')]&&_0x444219['uniqueid']==_0x5527fc['uniqueid']){_0x444219[_0xdbc9('0x32')]=0x0;_0x444219[_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];_0x444219[_0xdbc9('0x20')]=!![];_0x444219['agentringnoanswerAt']=utils[_0xdbc9('0x17')]();_0x444219[_0xdbc9('0x18')]='answered_elsewhere';_0x444219[_0xdbc9('0x23')]=_0xdbc9('0x33');_0x444219['answeredelsewheredestinationuniqueid']=_0x5527fc[_0xdbc9('0x15')];_0x444219[_0xdbc9('0x34')]=_0x5527fc[_0xdbc9('0x6')];writeDB(_0x444219);}});}}catch(_0x3415c3){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc['uniqueid']),_0x3415c3);}};exports['agentcomplete']=function(_0x768856){try{if(!_[_0xdbc9('0x35')](agents[_0x768856[_0xdbc9('0x15')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x36'),_0x768856[_0xdbc9('0x3')]),_0x768856);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x37'),_0x768856[_0xdbc9('0x3')],agents[_0x768856['destuniqueid']]['membername'],_0x768856[_0xdbc9('0x15')]));agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0xc')]=!![];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x32')]=utils['diffTime'](agents[_0x768856['destuniqueid']][_0xdbc9('0x38')],agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x2f')]);agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0x768856[_0xdbc9('0x23')];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x18')]=_0xdbc9('0x39');writeDB(agents[_0x768856['destuniqueid']]);}}catch(_0x2c24a9){utils[_0xdbc9('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x768856[_0xdbc9('0x3')]),_0x2c24a9);}};exports[_0xdbc9('0x3a')]=function(_0x133a13){try{if(!_['isNil'](agents[_0x133a13[_0xdbc9('0x3b')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13['uniqueid']),_0x133a13);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x3d'),_0x133a13[_0xdbc9('0x3')],agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x6')],agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3')]));agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3e')]=!![];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3f')]=_0xdbc9('0x40');agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x41')]=_0x133a13['extension'];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x42')]=agents[_0x133a13['transfereruniqueid']]['uniqueid'];}}catch(_0xc7335d){utils['error'](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13[_0xdbc9('0x3')]),_0xc7335d);}};exports['attendedtransfer']=function(_0x32b38d){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x32b38d);if(_0x32b38d[_0xdbc9('0x44')]==_0x32b38d[_0xdbc9('0x45')]){if(!_[_0xdbc9('0x35')](agents[_0x32b38d['secondtransfereruniqueid']])){utils['info'](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d[_0xdbc9('0x47')]]['membername']));agents[_0x32b38d['secondtransfereruniqueid']][_0xdbc9('0x3e')]=!![];agents[_0x32b38d[_0xdbc9('0x47')]]['transfertype']='ATTENDED';agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x48')];agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x44')];}if(_0x32b38d['transfereeuniqueid']&&agents[_0x32b38d[_0xdbc9('0x49')]]){agents[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d['transfereeuniqueid']]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x49')]]);transfers[_0x32b38d[_0xdbc9('0x49')]]['calleridnum']=agents[_0x32b38d[_0xdbc9('0x47')]]['calleridnum'];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4c')]=agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x16')]=utils['now']();transfers[_0x32b38d[_0xdbc9('0x49')]]['agentconnectAt']=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x49')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x2;}}else if(_0x32b38d['secondtransfereruniqueid']==_0x32b38d['secondtransfererlinkedid']){if(!_[_0xdbc9('0x35')](agents[_0x32b38d[_0xdbc9('0x44')]])){utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x6')]));agents[_0x32b38d[_0xdbc9('0x44')]]['transfer']=!![];agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x3f')]=_0xdbc9('0x4d');agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x4e')];agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x47')];}if(_0x32b38d['transfertargetuniqueid']&&agents[_0x32b38d[_0xdbc9('0x4f')]]){agents[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d[_0xdbc9('0x4f')]]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x4f')]]);transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x8')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x8')];transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x4c')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x4f')]]['agentcalledAt']=utils['now']();transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x4f')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x2;}}}catch(_0x53843c){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x53843c);}};exports[_0xdbc9('0x50')]=function(_0xfdfb20){try{utils['debug'](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20['uniqueid']),_0xfdfb20);if(agents[_0xfdfb20['uniqueid']]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]===_0xdbc9('0x22')){if(_0xfdfb20[_0xdbc9('0x52')]==='21'){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]=_0xdbc9('0x53');agents[_0xfdfb20['uniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x53');}utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x54'),_0xfdfb20[_0xdbc9('0x3')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);var _0x1afbcd=unanswered[_0xdbc9('0x55')](_0xfdfb20[_0xdbc9('0x3')]);if(_0x1afbcd>-0x1){unanswered['splice'](_0x1afbcd,0x1);}}if(transfers[_0xfdfb20['uniqueid']]){transfers[_0xfdfb20[_0xdbc9('0x3')]]['agentcomplete']=!![];transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();transfers[_0xfdfb20[_0xdbc9('0x3')]]['talktime']=utils[_0xdbc9('0x56')](transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')],transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x2f')]);transfers[_0xfdfb20[_0xdbc9('0x3')]]['reason']=_0xdbc9('0x57');transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20[_0xdbc9('0x3')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['membername'],transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['lastevent']));writeDB(transfers[_0xfdfb20[_0xdbc9('0x3')]],!![]);}if(agents[_0xfdfb20[_0xdbc9('0x3')]]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x2f')]){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0xc')]=!![];agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')]=utils['now']();agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x32')]=utils[_0xdbc9('0x56')](agents[_0xfdfb20[_0xdbc9('0x3')]]['agentcompleteAt'],agents[_0xfdfb20[_0xdbc9('0x3')]]['agentconnectAt']);agents[_0xfdfb20['uniqueid']][_0xdbc9('0x23')]=agents[_0xfdfb20[_0xdbc9('0x3')]]['transfer']?_0xdbc9('0x3e'):_0xdbc9('0x57');agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20['uniqueid'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]]['reason'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);}}catch(_0x1839e4){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20[_0xdbc9('0x3')]),_0x1839e4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 32529d5..cda8d71 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 _0x8782=['variable','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','set','gotoif','lastapplication','lodash','util','./transfers.controller','NO\x20ANSWER','BUSY','FAILED','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','info','context','exten','DOCUMENTATION','error','newstate','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview'];(function(_0x4422fe,_0x17119e){var _0x4809d8=function(_0x593857){while(--_0x593857){_0x4422fe['push'](_0x4422fe['shift']());}};_0x4809d8(++_0x17119e);}(_0x8782,0x1df));var _0x2878=function(_0x5b5fe9,_0x10ebaa){_0x5b5fe9=_0x5b5fe9-0x0;var _0xa2bec0=_0x8782[_0x5b5fe9];return _0xa2bec0;};'use strict';var _=require(_0x2878('0x0'));var util=require(_0x2878('0x1'));var utils=require('./utils');var transfers=require(_0x2878('0x2'));var dispositions=[_0x2878('0x3'),'FAILED','FAILED',_0x2878('0x3'),'NO\x20ANSWER',_0x2878('0x3'),'ANSWERED',_0x2878('0x4'),_0x2878('0x5'),_0x2878('0x5'),_0x2878('0x5')];var channels={};function writeDB(_0xaedff3){var _0x4d2d7b;if(transfers['blinds'][_0xaedff3['uniqueid']]){_0x4d2d7b=_0xaedff3[_0x2878('0x6')];_0xaedff3[_0x2878('0x6')]=transfers['blinds'][_0xaedff3[_0x2878('0x6')]]['transfereeuniqueid'];}utils['info'](util[_0x2878('0x7')](_0x2878('0x8'),_0xaedff3['uniqueid'],_0xaedff3['channel'],_0xaedff3['queue'],_0xaedff3['membername'],_0xaedff3[_0x2878('0x9')],_0xaedff3[_0x2878('0xa')],_0xaedff3['connectedlinenum'],_0xaedff3[_0x2878('0xb')]));if(_0xaedff3['accountcode']){utils[_0x2878('0xc')](_0xaedff3[_0x2878('0xd')])[_0x2878('0xe')](function(_0x3eb3d2){if(_0x3eb3d2){_0xaedff3[_0x2878('0xf')]=_0x3eb3d2['id'];}utils[_0x2878('0x10')](_0x2878('0x11'),_0xaedff3);});}else{utils[_0x2878('0x10')]('CreateVoiceCallReport',_0xaedff3);}if(channels[_0xaedff3[_0x2878('0x6')]]){delete channels[_0xaedff3['uniqueid']];}else if(_0x4d2d7b&&channels[_0x4d2d7b]){delete transfers['blinds'][_0x4d2d7b];delete channels[_0x4d2d7b];}}exports[_0x2878('0x12')]=function(_0xf6121){try{utils[_0x2878('0x13')](util[_0x2878('0x7')](_0x2878('0x14'),_0xf6121['uniqueid']),_0xf6121);if(_0xf6121[_0x2878('0x6')]==_0xf6121['linkedid']&&_0xf6121[_0x2878('0x15')]!=_0x2878('0x16')){utils[_0x2878('0x17')](util[_0x2878('0x7')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xf6121['uniqueid'],_0xf6121[_0x2878('0x18')],_0xf6121[_0x2878('0x19')]));channels[_0xf6121[_0x2878('0x6')]]={'uniqueid':_0xf6121[_0x2878('0x6')],'accountcode':_0xf6121[_0x2878('0xd')],'source':_0xf6121[_0x2878('0xa')],'destination':_0xf6121[_0x2878('0x19')],'destinationcontext':_0xf6121[_0x2878('0x18')],'channel':_0xf6121['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2878('0x3'),'amaflags':_0x2878('0x1a')};}}catch(_0x53daf9){utils[_0x2878('0x1b')](util[_0x2878('0x7')](_0x2878('0x14'),_0xf6121['uniqueid']),_0x53daf9);}};exports[_0x2878('0x1c')]=function(_0x46afc3){try{utils[_0x2878('0x13')](util[_0x2878('0x7')]('[%s][calls][newstate]',_0x46afc3[_0x2878('0x6')]),_0x46afc3);if(!_['isNil'](channels[_0x46afc3[_0x2878('0x6')]])&&_0x46afc3[_0x2878('0x1d')]==0x6){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x1e'),_0x46afc3[_0x2878('0x6')],_0x46afc3[_0x2878('0x18')],_0x46afc3['channel']));if(_[_0x2878('0x1f')](channels[_0x46afc3[_0x2878('0x6')]][_0x2878('0x20')])){channels[_0x46afc3[_0x2878('0x6')]][_0x2878('0x20')]=utils[_0x2878('0x21')]();}}else if(!_[_0x2878('0x1f')](channels[_0x46afc3[_0x2878('0x22')]])&&_0x46afc3['channelstate']==0x6&&_0x46afc3[_0x2878('0x18')]!=_0x2878('0x23')){utils['info'](util['format'](_0x2878('0x24'),_0x46afc3[_0x2878('0x6')],_0x46afc3['linkedid'],_0x46afc3[_0x2878('0x18')],_0x46afc3[_0x2878('0x15')]));channels[_0x46afc3[_0x2878('0x22')]][_0x2878('0xd')]=_0x46afc3[_0x2878('0xd')];channels[_0x46afc3['linkedid']][_0x2878('0x25')]=_0x46afc3['channel'];if(_[_0x2878('0x1f')](channels[_0x46afc3[_0x2878('0x22')]][_0x2878('0x26')])){channels[_0x46afc3[_0x2878('0x22')]][_0x2878('0x26')]=utils[_0x2878('0x21')]();}channels[_0x46afc3[_0x2878('0x22')]][_0x2878('0x27')]=dispositions[_[_0x2878('0x28')](_0x46afc3[_0x2878('0x1d')])]||_0x2878('0x29');}}catch(_0x18f137){utils[_0x2878('0x1b')](util['format'](_0x2878('0x2a'),_0x46afc3['uniqueid']),_0x18f137);}};exports[_0x2878('0x2b')]=function(_0x5dc570){try{if(!_[_0x2878('0x1f')](channels[_0x5dc570[_0x2878('0x6')]])){utils[_0x2878('0x13')](util[_0x2878('0x7')](_0x2878('0x2c'),_0x5dc570[_0x2878('0x6')]),_0x5dc570);if(_['isNil'](channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x2d')])){channels[_0x5dc570['uniqueid']]['callerid']=_0x5dc570[_0x2878('0x2e')]+'\x20<'+_0x5dc570[_0x2878('0xa')]+'>';}utils['info'](util[_0x2878('0x7')](_0x2878('0x2f'),_0x5dc570[_0x2878('0x6')],channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x2d')],_0x5dc570[_0x2878('0x30')]));channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x31')]=utils[_0x2878('0x21')]();channels[_0x5dc570[_0x2878('0x6')]]['duration']=utils[_0x2878('0x32')](channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x31')],channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x33')]);channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x34')]=channels[_0x5dc570['uniqueid']][_0x2878('0x26')]?utils['diffTime'](channels[_0x5dc570['uniqueid']][_0x2878('0x31')],channels[_0x5dc570[_0x2878('0x6')]][_0x2878('0x26')]):0x0;writeDB(channels[_0x5dc570[_0x2878('0x6')]]);}}catch(_0x227483){utils[_0x2878('0x1b')](util[_0x2878('0x7')](_0x2878('0x2c'),_0x5dc570['uniqueid']),_0x227483);}};exports[_0x2878('0x35')]=function(_0x36f9ff){try{if(!_['isNil'](channels[_0x36f9ff[_0x2878('0x36')]])){utils[_0x2878('0x13')](util[_0x2878('0x7')](_0x2878('0x37'),_0x36f9ff[_0x2878('0x38')]),_0x36f9ff);if(channels[_0x36f9ff[_0x2878('0x36')]]['channel']==_0x36f9ff['transfereechannel']){utils[_0x2878('0x17')](util[_0x2878('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x36f9ff[_0x2878('0x38')],_0x36f9ff[_0x2878('0x36')],_0x36f9ff[_0x2878('0x39')]));channels[_0x36f9ff[_0x2878('0x36')]][_0x2878('0x25')]=_0x36f9ff[_0x2878('0x39')];channels[_0x36f9ff[_0x2878('0x36')]][_0x2878('0x3a')]='_attended';}else if(channels[_0x36f9ff[_0x2878('0x36')]][_0x2878('0x15')]=_0x36f9ff[_0x2878('0x3b')]){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x3c'),_0x36f9ff[_0x2878('0x38')],_0x36f9ff[_0x2878('0x36')],_0x36f9ff[_0x2878('0x3d')]));channels[_0x36f9ff[_0x2878('0x36')]][_0x2878('0x25')]=_0x36f9ff['origtransfererchannel'];channels[_0x36f9ff[_0x2878('0x36')]]['userfield']='_attended';}}}catch(_0x1f408f){utils[_0x2878('0x1b')](util[_0x2878('0x7')]('[%s][calls][attendedtransfer]',_0x36f9ff[_0x2878('0x38')]),_0x1f408f);}};exports['musiconholdstart']=function(_0x9e9e19){try{if(!_['isNil'](channels[_0x9e9e19[_0x2878('0x6')]])){utils['debug'](util['format'](_0x2878('0x3e'),_0x9e9e19['uniqueid']),_0x9e9e19);channels[_0x9e9e19[_0x2878('0x6')]][_0x2878('0x3f')]=utils['now']();utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x40'),_0x9e9e19[_0x2878('0x6')],channels[_0x9e9e19[_0x2878('0x6')]]['musiconholdstartAt']));}}catch(_0x1ce867){utils[_0x2878('0x1b')](util[_0x2878('0x7')](_0x2878('0x3e'),_0x9e9e19[_0x2878('0x6')]),_0x1ce867);}};exports['musiconholdstop']=function(_0x35030b){try{if(!_[_0x2878('0x1f')](channels[_0x35030b[_0x2878('0x6')]])){utils[_0x2878('0x13')](util[_0x2878('0x7')]('[%s][calls][musiconholdstop]',_0x35030b['uniqueid']),_0x35030b);if(!_[_0x2878('0x1f')](channels[_0x35030b[_0x2878('0x6')]][_0x2878('0x3f')])){channels[_0x35030b[_0x2878('0x6')]][_0x2878('0x41')]+=utils[_0x2878('0x32')](utils['now'](),channels[_0x35030b[_0x2878('0x6')]][_0x2878('0x3f')]);utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x42'),_0x35030b['uniqueid'],channels[_0x35030b[_0x2878('0x6')]]['mohtime']));delete channels[_0x35030b[_0x2878('0x6')]][_0x2878('0x3f')];}}}catch(_0x5556cc){utils['error'](util[_0x2878('0x7')]('[%s][calls][musiconholdstop]',_0x35030b[_0x2878('0x6')]),_0x5556cc);}};exports['varset']=function(_0x1ee810){try{if(!_[_0x2878('0x1f')](channels[_0x1ee810[_0x2878('0x6')]])){utils[_0x2878('0x13')](util[_0x2878('0x7')](_0x2878('0x43'),_0x1ee810['uniqueid']),_0x1ee810);if(!_['isNil'](_0x1ee810['variable']['xmd-originatecalleridnum'])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x44'),_0x1ee810[_0x2878('0x6')],_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x46')]=_0x1ee810[_0x2878('0x45')];}if(!_[_0x2878('0x1f')](_0x1ee810['variable'][_0x2878('0x47')])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x48'),_0x1ee810[_0x2878('0x6')],_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810['uniqueid']][_0x2878('0x49')]=_0x1ee810[_0x2878('0x45')];channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x2d')]='\x22'+_0x1ee810[_0x2878('0x45')]+_0x2878('0x4a')+_0x1ee810[_0x2878('0x45')]+'>';}if(!_[_0x2878('0x1f')](_0x1ee810['variable'][_0x2878('0x4b')])||!_['isNil'](_0x1ee810[_0x2878('0x4c')][_0x2878('0x4d')])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x4e'),_0x1ee810[_0x2878('0x6')],!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x4b')])?_0x2878('0x4b'):_0x2878('0x4d'),_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x2d')]=_0x1ee810['value'];}if(!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x4f')])||!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x50')])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x4e'),_0x1ee810[_0x2878('0x6')],!_['isNil'](_0x1ee810[_0x2878('0x4c')][_0x2878('0x4f')])?_0x2878('0x4f'):_0x2878('0x50'),_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810['uniqueid']]['lastapplication']=_0x2878('0x51');channels[_0x1ee810['uniqueid']][_0x2878('0x52')]=_0x1ee810['value'];channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x53')]=!![];}if(!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x54')])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x55'),_0x1ee810[_0x2878('0x6')],_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x56')]=_0x1ee810[_0x2878('0x45')];}if(!_[_0x2878('0x1f')](_0x1ee810['variable'][_0x2878('0x57')])){utils[_0x2878('0x17')](util['format'](_0x2878('0x58'),_0x1ee810['uniqueid'],_0x1ee810['value']));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x59')]=_0x1ee810[_0x2878('0x45')];}if(!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x5a')])){utils['info'](util['format'](_0x2878('0x5b'),_0x1ee810[_0x2878('0x6')],_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x5c')]=_0x1ee810[_0x2878('0x45')];}if(!_[_0x2878('0x1f')](_0x1ee810[_0x2878('0x4c')][_0x2878('0x5d')])){utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x5e'),_0x1ee810[_0x2878('0x6')],_0x1ee810[_0x2878('0x45')]));channels[_0x1ee810[_0x2878('0x6')]][_0x2878('0x5d')]=_0x1ee810[_0x2878('0x45')];}}}catch(_0x1ebe93){utils[_0x2878('0x1b')](util[_0x2878('0x7')]('[%s][calls][varset]',_0x1ee810['uniqueid']),_0x1ebe93);}};exports[_0x2878('0x5f')]=function(_0x4df02f){try{if(!_[_0x2878('0x1f')](channels[_0x4df02f[_0x2878('0x6')]])){utils[_0x2878('0x13')](util[_0x2878('0x7')](_0x2878('0x60'),_0x4df02f[_0x2878('0x6')]),_0x4df02f);utils[_0x2878('0x17')](util[_0x2878('0x7')](_0x2878('0x61'),_0x4df02f[_0x2878('0x6')],_0x4df02f[_0x2878('0x62')],_0x4df02f[_0x2878('0x63')]));if(_0x4df02f[_0x2878('0x62')][_0x2878('0x64')]()=='set'&&_[_0x2878('0x65')](_0x4df02f[_0x2878('0x63')][_0x2878('0x64')](),_0x2878('0x66'))){var _0xd5f269=_0x4df02f['appdata']['split']('=');var _0x20493c=_0xd5f269[0x0][_0x2878('0x67')](_0xd5f269[0x0][_0x2878('0x68')]('(')+0x1,_0xd5f269[0x0][_0x2878('0x68')](')'));var _0x8a3deb=_0xd5f269[0x1];channels[_0x4df02f[_0x2878('0x6')]][_0x20493c]=_0x8a3deb;}if(!_[_0x2878('0x69')](['hangup',_0x2878('0x6a'),_0x2878('0x6b'),_0x2878('0x6c'),_0x2878('0x6d')],_0x4df02f[_0x2878('0x62')][_0x2878('0x64')]())){channels[_0x4df02f['uniqueid']][_0x2878('0x6e')]=_0x4df02f[_0x2878('0x62')];channels[_0x4df02f[_0x2878('0x6')]][_0x2878('0x52')]=_0x4df02f[_0x2878('0x63')];}}}catch(_0x2e003d){utils['error'](util[_0x2878('0x7')]('[%s][calls][newexten]',_0x4df02f[_0x2878('0x6')]),_0x2e003d);}}; \ No newline at end of file +var _0x0f7c=['xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','split','substring','hangup','noop','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','endtime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x0f7c,0x74));var _0xc0f7=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0f7c[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xc0f7('0x0'));var util=require('util');var utils=require(_0xc0f7('0x1'));var transfers=require(_0xc0f7('0x2'));var dispositions=['NO\x20ANSWER',_0xc0f7('0x3'),'FAILED',_0xc0f7('0x4'),_0xc0f7('0x4'),_0xc0f7('0x4'),_0xc0f7('0x5'),_0xc0f7('0x6'),_0xc0f7('0x3'),_0xc0f7('0x3'),_0xc0f7('0x3')];var channels={};function writeDB(_0xa27b09){var _0x2272b6;if(transfers[_0xc0f7('0x7')][_0xa27b09[_0xc0f7('0x8')]]){_0x2272b6=_0xa27b09[_0xc0f7('0x8')];_0xa27b09[_0xc0f7('0x8')]=transfers['blinds'][_0xa27b09[_0xc0f7('0x8')]]['transfereeuniqueid'];}utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')](_0xc0f7('0xb'),_0xa27b09[_0xc0f7('0x8')],_0xa27b09[_0xc0f7('0xc')],_0xa27b09[_0xc0f7('0xd')],_0xa27b09[_0xc0f7('0xe')],_0xa27b09[_0xc0f7('0xf')],_0xa27b09[_0xc0f7('0x10')],_0xa27b09[_0xc0f7('0x11')],_0xa27b09[_0xc0f7('0x12')]));if(_0xa27b09[_0xc0f7('0x13')]){utils[_0xc0f7('0x14')](_0xa27b09[_0xc0f7('0x13')])['then'](function(_0x1beba5){if(_0x1beba5){_0xa27b09[_0xc0f7('0x15')]=_0x1beba5['id'];}utils[_0xc0f7('0x16')](_0xc0f7('0x17'),_0xa27b09);});}else{utils[_0xc0f7('0x16')](_0xc0f7('0x17'),_0xa27b09);}if(channels[_0xa27b09[_0xc0f7('0x8')]]){delete channels[_0xa27b09[_0xc0f7('0x8')]];}else if(_0x2272b6&&channels[_0x2272b6]){delete transfers[_0xc0f7('0x7')][_0x2272b6];delete channels[_0x2272b6];}}exports[_0xc0f7('0x18')]=function(_0x350f1b){try{utils[_0xc0f7('0x19')](util['format'](_0xc0f7('0x1a'),_0x350f1b['uniqueid']),_0x350f1b);if(_0x350f1b[_0xc0f7('0x8')]==_0x350f1b[_0xc0f7('0x1b')]&&_0x350f1b[_0xc0f7('0xc')]!=_0xc0f7('0x1c')){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')](_0xc0f7('0x1d'),_0x350f1b[_0xc0f7('0x8')],_0x350f1b[_0xc0f7('0x1e')],_0x350f1b[_0xc0f7('0x1f')]));channels[_0x350f1b[_0xc0f7('0x8')]]={'uniqueid':_0x350f1b[_0xc0f7('0x8')],'accountcode':_0x350f1b[_0xc0f7('0x13')],'source':_0x350f1b[_0xc0f7('0x10')],'destination':_0x350f1b['exten'],'destinationcontext':_0x350f1b[_0xc0f7('0x1e')],'channel':_0x350f1b[_0xc0f7('0xc')],'starttime':utils[_0xc0f7('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xc0f7('0x21')};}}catch(_0x3f9952){utils[_0xc0f7('0x22')](util[_0xc0f7('0xa')]('[%s][calls][newchannel]',_0x350f1b[_0xc0f7('0x8')]),_0x3f9952);}};exports[_0xc0f7('0x23')]=function(_0x32f762){try{utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')](_0xc0f7('0x24'),_0x32f762['uniqueid']),_0x32f762);if(!_[_0xc0f7('0x25')](channels[_0x32f762[_0xc0f7('0x8')]])&&_0x32f762[_0xc0f7('0x26')]==0x6){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x32f762['uniqueid'],_0x32f762[_0xc0f7('0x1e')],_0x32f762['channel']));if(_[_0xc0f7('0x25')](channels[_0x32f762[_0xc0f7('0x8')]]['systemanswertime'])){channels[_0x32f762[_0xc0f7('0x8')]][_0xc0f7('0x27')]=utils['now']();}}else if(!_[_0xc0f7('0x25')](channels[_0x32f762[_0xc0f7('0x1b')]])&&_0x32f762[_0xc0f7('0x26')]==0x6&&_0x32f762[_0xc0f7('0x1e')]!=_0xc0f7('0x28')){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x32f762[_0xc0f7('0x8')],_0x32f762[_0xc0f7('0x1b')],_0x32f762[_0xc0f7('0x1e')],_0x32f762[_0xc0f7('0xc')]));channels[_0x32f762[_0xc0f7('0x1b')]]['accountcode']=_0x32f762[_0xc0f7('0x13')];channels[_0x32f762[_0xc0f7('0x1b')]][_0xc0f7('0x29')]=_0x32f762['channel'];if(_[_0xc0f7('0x25')](channels[_0x32f762[_0xc0f7('0x1b')]]['answertime'])){channels[_0x32f762[_0xc0f7('0x1b')]][_0xc0f7('0x2a')]=utils['now']();}channels[_0x32f762[_0xc0f7('0x1b')]]['disposition']=dispositions[_[_0xc0f7('0x2b')](_0x32f762['channelstate'])]||_0xc0f7('0x5');}}catch(_0xfd3cc8){utils[_0xc0f7('0x22')](util['format'](_0xc0f7('0x24'),_0x32f762[_0xc0f7('0x8')]),_0xfd3cc8);}};exports['hangup']=function(_0x2afd0c){try{if(!_[_0xc0f7('0x25')](channels[_0x2afd0c[_0xc0f7('0x8')]])){utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')](_0xc0f7('0x2c'),_0x2afd0c[_0xc0f7('0x8')]),_0x2afd0c);if(_[_0xc0f7('0x25')](channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x2d')])){channels[_0x2afd0c[_0xc0f7('0x8')]]['callerid']=_0x2afd0c[_0xc0f7('0x2e')]+'\x20<'+_0x2afd0c['calleridnum']+'>';}utils[_0xc0f7('0x9')](util['format'](_0xc0f7('0x2f'),_0x2afd0c[_0xc0f7('0x8')],channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x2d')],_0x2afd0c['cause-txt']));channels[_0x2afd0c[_0xc0f7('0x8')]]['endtime']=utils[_0xc0f7('0x20')]();channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x30')]=utils['diffTime'](channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x31')],channels[_0x2afd0c[_0xc0f7('0x8')]]['starttime']);channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x32')]=channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x2a')]?utils[_0xc0f7('0x33')](channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x31')],channels[_0x2afd0c[_0xc0f7('0x8')]][_0xc0f7('0x2a')]):0x0;writeDB(channels[_0x2afd0c[_0xc0f7('0x8')]]);}}catch(_0x34194b){utils['error'](util[_0xc0f7('0xa')]('[%s][calls][hangup]',_0x2afd0c[_0xc0f7('0x8')]),_0x34194b);}};exports[_0xc0f7('0x34')]=function(_0x2b6287){try{if(!_[_0xc0f7('0x25')](channels[_0x2b6287[_0xc0f7('0x35')]])){utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')](_0xc0f7('0x36'),_0x2b6287[_0xc0f7('0x37')]),_0x2b6287);if(channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0xc')]==_0x2b6287[_0xc0f7('0x38')]){utils['info'](util[_0xc0f7('0xa')](_0xc0f7('0x39'),_0x2b6287[_0xc0f7('0x37')],_0x2b6287[_0xc0f7('0x35')],_0x2b6287['secondtransfererchannel']));channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0x29')]=_0x2b6287[_0xc0f7('0x3a')];channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0x3b')]='_attended';}else if(channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0xc')]=_0x2b6287[_0xc0f7('0x3c')]){utils['info'](util['format'](_0xc0f7('0x39'),_0x2b6287[_0xc0f7('0x37')],_0x2b6287['localtwolinkedid'],_0x2b6287[_0xc0f7('0x3d')]));channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0x29')]=_0x2b6287[_0xc0f7('0x3d')];channels[_0x2b6287[_0xc0f7('0x35')]][_0xc0f7('0x3b')]=_0xc0f7('0x3e');}}}catch(_0x3ff717){utils[_0xc0f7('0x22')](util[_0xc0f7('0xa')](_0xc0f7('0x36'),_0x2b6287[_0xc0f7('0x37')]),_0x3ff717);}};exports[_0xc0f7('0x3f')]=function(_0x63b46){try{if(!_[_0xc0f7('0x25')](channels[_0x63b46['uniqueid']])){utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')](_0xc0f7('0x40'),_0x63b46[_0xc0f7('0x8')]),_0x63b46);channels[_0x63b46[_0xc0f7('0x8')]][_0xc0f7('0x41')]=utils['now']();utils['info'](util[_0xc0f7('0xa')](_0xc0f7('0x42'),_0x63b46[_0xc0f7('0x8')],channels[_0x63b46[_0xc0f7('0x8')]]['musiconholdstartAt']));}}catch(_0x4b50d9){utils['error'](util[_0xc0f7('0xa')](_0xc0f7('0x40'),_0x63b46[_0xc0f7('0x8')]),_0x4b50d9);}};exports[_0xc0f7('0x43')]=function(_0x5a0826){try{if(!_[_0xc0f7('0x25')](channels[_0x5a0826['uniqueid']])){utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')](_0xc0f7('0x44'),_0x5a0826[_0xc0f7('0x8')]),_0x5a0826);if(!_[_0xc0f7('0x25')](channels[_0x5a0826['uniqueid']][_0xc0f7('0x41')])){channels[_0x5a0826[_0xc0f7('0x8')]][_0xc0f7('0x45')]+=utils[_0xc0f7('0x33')](utils[_0xc0f7('0x20')](),channels[_0x5a0826[_0xc0f7('0x8')]][_0xc0f7('0x41')]);utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5a0826[_0xc0f7('0x8')],channels[_0x5a0826[_0xc0f7('0x8')]][_0xc0f7('0x45')]));delete channels[_0x5a0826[_0xc0f7('0x8')]][_0xc0f7('0x41')];}}}catch(_0x4b8f4f){utils['error'](util[_0xc0f7('0xa')]('[%s][calls][musiconholdstop]',_0x5a0826[_0xc0f7('0x8')]),_0x4b8f4f);}};exports['varset']=function(_0x32d58c){try{if(!_[_0xc0f7('0x25')](channels[_0x32d58c[_0xc0f7('0x8')]])){utils[_0xc0f7('0x19')](util[_0xc0f7('0xa')]('[%s][calls][varset]',_0x32d58c[_0xc0f7('0x8')]),_0x32d58c);if(!_['isNil'](_0x32d58c[_0xc0f7('0x46')][_0xc0f7('0x47')])){utils[_0xc0f7('0x9')](util['format'](_0xc0f7('0x48'),_0x32d58c[_0xc0f7('0x8')],_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]]['source']=_0x32d58c[_0xc0f7('0x49')];}if(!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')][_0xc0f7('0x4a')])){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')](_0xc0f7('0x4b'),_0x32d58c[_0xc0f7('0x8')],_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x4c')]=_0x32d58c[_0xc0f7('0x49')];channels[_0x32d58c['uniqueid']][_0xc0f7('0x2d')]='\x22'+_0x32d58c[_0xc0f7('0x49')]+_0xc0f7('0x4d')+_0x32d58c[_0xc0f7('0x49')]+'>';}if(!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')][_0xc0f7('0x4e')])||!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')][_0xc0f7('0x4f')])){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x32d58c[_0xc0f7('0x8')],!_[_0xc0f7('0x25')](_0x32d58c['variable'][_0xc0f7('0x4e')])?_0xc0f7('0x4e'):_0xc0f7('0x4f'),_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c['uniqueid']][_0xc0f7('0x2d')]=_0x32d58c[_0xc0f7('0x49')];}if(!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')]['xmd-queue'])||!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')]['xmcs-queue'])){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x32d58c[_0xc0f7('0x8')],!_['isNil'](_0x32d58c['variable'][_0xc0f7('0x50')])?'xmd-queue':'xmcs-queue',_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x51')]=_0xc0f7('0x52');channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x53')]=_0x32d58c[_0xc0f7('0x49')];channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0xd')]=!![];}if(!_[_0xc0f7('0x25')](_0x32d58c['variable']['xmd-contactid'])){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')](_0xc0f7('0x54'),_0x32d58c[_0xc0f7('0x8')],_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x55')]=_0x32d58c[_0xc0f7('0x49')];}if(!_['isNil'](_0x32d58c[_0xc0f7('0x46')][_0xc0f7('0x56')])){utils[_0xc0f7('0x9')](util['format'](_0xc0f7('0x57'),_0x32d58c[_0xc0f7('0x8')],_0x32d58c['value']));channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x58')]=_0x32d58c[_0xc0f7('0x49')];}if(!_[_0xc0f7('0x25')](_0x32d58c[_0xc0f7('0x46')]['outboundrouteid'])){utils['info'](util[_0xc0f7('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x32d58c[_0xc0f7('0x8')],_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]]['routeid']=_0x32d58c[_0xc0f7('0x49')];}if(!_[_0xc0f7('0x25')](_0x32d58c['variable']['sipcallid'])){utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x32d58c[_0xc0f7('0x8')],_0x32d58c[_0xc0f7('0x49')]));channels[_0x32d58c[_0xc0f7('0x8')]][_0xc0f7('0x59')]=_0x32d58c[_0xc0f7('0x49')];}}}catch(_0x2ffa43){utils[_0xc0f7('0x22')](util[_0xc0f7('0xa')](_0xc0f7('0x5a'),_0x32d58c[_0xc0f7('0x8')]),_0x2ffa43);}};exports[_0xc0f7('0x5b')]=function(_0x2a5a66){try{if(!_[_0xc0f7('0x25')](channels[_0x2a5a66['uniqueid']])){utils['debug'](util[_0xc0f7('0xa')](_0xc0f7('0x5c'),_0x2a5a66['uniqueid']),_0x2a5a66);utils[_0xc0f7('0x9')](util[_0xc0f7('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2a5a66[_0xc0f7('0x8')],_0x2a5a66[_0xc0f7('0x5d')],_0x2a5a66[_0xc0f7('0x5e')]));if(_0x2a5a66[_0xc0f7('0x5d')][_0xc0f7('0x5f')]()==_0xc0f7('0x60')&&_['startsWith'](_0x2a5a66['appdata'][_0xc0f7('0x5f')](),'cdr')){var _0x2c8969=_0x2a5a66[_0xc0f7('0x5e')][_0xc0f7('0x61')]('=');var _0x327744=_0x2c8969[0x0][_0xc0f7('0x62')](_0x2c8969[0x0]['lastIndexOf']('(')+0x1,_0x2c8969[0x0]['lastIndexOf'](')'));var _0x1530e8=_0x2c8969[0x1];channels[_0x2a5a66[_0xc0f7('0x8')]][_0x327744]=_0x1530e8;}if(!_['includes']([_0xc0f7('0x63'),_0xc0f7('0x64'),'execif','set','gotoif'],_0x2a5a66[_0xc0f7('0x5d')]['toLowerCase']())){channels[_0x2a5a66[_0xc0f7('0x8')]][_0xc0f7('0x51')]=_0x2a5a66[_0xc0f7('0x5d')];channels[_0x2a5a66[_0xc0f7('0x8')]][_0xc0f7('0x53')]=_0x2a5a66[_0xc0f7('0x5e')];}}}catch(_0xe59b39){utils[_0xc0f7('0x22')](util[_0xc0f7('0xa')]('[%s][calls][newexten]',_0x2a5a66['uniqueid']),_0xe59b39);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 27a3731..0bc9469 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 _0xdbe3=['connect','info','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','./utils'];(function(_0x40c0a2,_0x1563af){var _0x404dd2=function(_0x15b6c7){while(--_0x15b6c7){_0x40c0a2['push'](_0x40c0a2['shift']());}};_0x404dd2(++_0x1563af);}(_0xdbe3,0xbf));var _0x3dbe=function(_0x6fc10f,_0x439bc9){_0x6fc10f=_0x6fc10f-0x0;var _0x15d0c2=_0xdbe3[_0x6fc10f];return _0x15d0c2;};'use strict';var utils=require(_0x3dbe('0x0'));exports[_0x3dbe('0x1')]=function(){utils[_0x3dbe('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x3dbe('0x2')]('[core]\x20shutdown');};exports[_0x3dbe('0x3')]=function(){utils[_0x3dbe('0x2')](_0x3dbe('0x4'));};exports[_0x3dbe('0x5')]=function(_0x5cb05e){utils['error'](_0x3dbe('0x6'),_0x5cb05e);};exports['close']=function(){utils[_0x3dbe('0x2')](_0x3dbe('0x7'));};exports['managerevent']=function(_0x149372){}; \ No newline at end of file +var _0xb22a=['connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','managerevent'];(function(_0x43b05b,_0x48e8ef){var _0x32851b=function(_0x95973e){while(--_0x95973e){_0x43b05b['push'](_0x43b05b['shift']());}};_0x32851b(++_0x48e8ef);}(_0xb22a,0xb0));var _0xab22=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xb22a[_0x42d2af];return _0x1d6d63;};'use strict';var utils=require('./utils');exports[_0xab22('0x0')]=function(){utils[_0xab22('0x1')](_0xab22('0x2'));};exports[_0xab22('0x3')]=function(){utils[_0xab22('0x1')]('[core]\x20shutdown');};exports[_0xab22('0x4')]=function(){utils[_0xab22('0x1')](_0xab22('0x5'));};exports[_0xab22('0x6')]=function(_0x1307bc){utils[_0xab22('0x6')]('[core]\x20error',_0x1307bc);};exports['close']=function(){utils[_0xab22('0x1')]('[core]\x20close');};exports[_0xab22('0x7')]=function(_0x5c9981){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 417e955..b9c9364 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 _0xc753=['info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','format','application','appdata','set','toLowerCase','cdr(routeid)','split','varset','[%s][dials][varset]','variable','value','error','dialbegin','isNil','assign','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash','./utils'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xc753,0x1e8));var _0x3c75=function(_0x486932,_0x639ab7){_0x486932=_0x486932-0x0;var _0x5764ce=_0xc753[_0x486932];return _0x5764ce;};'use strict';var _=require(_0x3c75('0x0'));var util=require('util');var utils=require(_0x3c75('0x1'));var dials={};function writeDB(_0x9ccb39){utils[_0x3c75('0x2')](util['format'](_0x3c75('0x3'),_0x9ccb39[_0x3c75('0x4')],_0x9ccb39[_0x3c75('0x5')],_0x9ccb39['dialstring'],_0x9ccb39[_0x3c75('0x6')],_0x9ccb39[_0x3c75('0x7')],_0x9ccb39[_0x3c75('0x8')]));utils['request'](_0x3c75('0x9'),_0x9ccb39);delete dials[_0x9ccb39['uniqueid']];}exports[_0x3c75('0xa')]=function(_0x5741af){try{utils[_0x3c75('0xb')](util['format'](_0x3c75('0xc'),_0x5741af[_0x3c75('0x4')]),_0x5741af);utils[_0x3c75('0x2')](util[_0x3c75('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5741af[_0x3c75('0x4')],_0x5741af[_0x3c75('0xe')],_0x5741af[_0x3c75('0xf')]));if(_0x5741af['application']['toLowerCase']()==_0x3c75('0x10')&&_['startsWith'](_0x5741af[_0x3c75('0xf')][_0x3c75('0x11')](),_0x3c75('0x12'))){var _0x3ac3e4=_0x5741af['appdata'][_0x3c75('0x13')]('=');dials[_0x5741af[_0x3c75('0x4')]]={'routeId':_0x3ac3e4[0x1]};}}catch(_0x32fdb9){utils['error'](util[_0x3c75('0xd')](_0x3c75('0xc'),_0x5741af['uniqueid']),_0x32fdb9);}};exports[_0x3c75('0x14')]=function(_0x59f7a3){try{utils[_0x3c75('0xb')](util[_0x3c75('0xd')](_0x3c75('0x15'),_0x59f7a3['uniqueid']),_0x59f7a3);if(!_['isNil'](_0x59f7a3[_0x3c75('0x16')]['outboundrouteid'])){utils[_0x3c75('0x2')](util[_0x3c75('0xd')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x59f7a3[_0x3c75('0x4')],_0x59f7a3[_0x3c75('0x17')]));dials[_0x59f7a3['uniqueid']]={'routeId':_0x59f7a3[_0x3c75('0x17')]};}}catch(_0xf4951e){utils[_0x3c75('0x18')](util[_0x3c75('0xd')](_0x3c75('0x15'),_0x59f7a3[_0x3c75('0x4')]),_0xf4951e);}};exports[_0x3c75('0x19')]=function(_0x183c22){try{if(!_[_0x3c75('0x1a')](dials[_0x183c22[_0x3c75('0x4')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x183c22[_0x3c75('0x4')]),_0x183c22);dials[_0x183c22[_0x3c75('0x4')]]=_[_0x3c75('0x1b')](dials[_0x183c22[_0x3c75('0x4')]],_0x183c22);dials[_0x183c22[_0x3c75('0x4')]]['starttime']=utils['now']();dials[_0x183c22['uniqueid']]['lastevent']='called';utils['info'](util[_0x3c75('0xd')](_0x3c75('0x1c'),_0x183c22[_0x3c75('0x4')],dials[_0x183c22['uniqueid']][_0x3c75('0x1d')]));}}catch(_0x428a04){utils[_0x3c75('0x18')](util[_0x3c75('0xd')](_0x3c75('0x1e'),_0x183c22['uniqueid']),_0x428a04);}};exports[_0x3c75('0x1f')]=function(_0x27dd86){try{if(!_[_0x3c75('0x1a')](dials[_0x27dd86[_0x3c75('0x4')]])){utils['debug'](util['format'](_0x3c75('0x20'),_0x27dd86[_0x3c75('0x4')]),_0x27dd86);dials[_0x27dd86['uniqueid']][_0x3c75('0x8')]=_0x27dd86[_0x3c75('0x8')];if(_0x27dd86[_0x3c75('0x8')]==_0x3c75('0x21')){dials[_0x27dd86[_0x3c75('0x4')]]=_[_0x3c75('0x1b')](dials[_0x27dd86[_0x3c75('0x4')]],_0x27dd86);dials[_0x27dd86[_0x3c75('0x4')]][_0x3c75('0x22')]=utils[_0x3c75('0x23')]();dials[_0x27dd86[_0x3c75('0x4')]][_0x3c75('0x24')]=_0x3c75('0x25');utils['info'](util[_0x3c75('0xd')](_0x3c75('0x26'),_0x27dd86[_0x3c75('0x4')],_0x27dd86[_0x3c75('0x8')],dials[_0x27dd86['uniqueid']][_0x3c75('0x22')]));}else{utils[_0x3c75('0x2')](util[_0x3c75('0xd')](_0x3c75('0x27'),_0x27dd86[_0x3c75('0x4')],_0x27dd86[_0x3c75('0x8')]));}}}catch(_0x146373){utils[_0x3c75('0x18')](util[_0x3c75('0xd')](_0x3c75('0x20'),_0x27dd86[_0x3c75('0x4')]),_0x146373);}};exports[_0x3c75('0x28')]=function(_0x50c84b){try{if(!_[_0x3c75('0x1a')](dials[_0x50c84b[_0x3c75('0x4')]])){utils[_0x3c75('0xb')](util[_0x3c75('0xd')](_0x3c75('0x29'),_0x50c84b[_0x3c75('0x4')]),_0x50c84b);utils['info'](util[_0x3c75('0xd')](_0x3c75('0x2a'),_0x50c84b[_0x3c75('0x4')],_0x50c84b['calleridnum'],_0x50c84b[_0x3c75('0x2b')],_0x50c84b[_0x3c75('0x2c')]));dials[_0x50c84b[_0x3c75('0x4')]]=_[_0x3c75('0x1b')](dials[_0x50c84b[_0x3c75('0x4')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x50c84b['uniqueid']]['duration']=utils[_0x3c75('0x2d')](dials[_0x50c84b['uniqueid']][_0x3c75('0x2e')],dials[_0x50c84b['uniqueid']][_0x3c75('0x1d')]);dials[_0x50c84b['uniqueid']][_0x3c75('0x2f')]=utils[_0x3c75('0x2d')](dials[_0x50c84b[_0x3c75('0x4')]]['answertime']||dials[_0x50c84b[_0x3c75('0x4')]][_0x3c75('0x2e')],dials[_0x50c84b['uniqueid']][_0x3c75('0x1d')]);dials[_0x50c84b[_0x3c75('0x4')]][_0x3c75('0x30')]=dials[_0x50c84b[_0x3c75('0x4')]][_0x3c75('0x22')]?utils[_0x3c75('0x2d')](dials[_0x50c84b['uniqueid']][_0x3c75('0x2e')],dials[_0x50c84b['uniqueid']]['answertime']):0x0;writeDB(dials[_0x50c84b[_0x3c75('0x4')]]);}}catch(_0x347b41){utils['error'](util[_0x3c75('0xd')](_0x3c75('0x29'),_0x50c84b[_0x3c75('0x4')]),_0x347b41);}}; \ No newline at end of file +var _0xd469=['billableseconds','lodash','./utils','info','format','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','uniqueid','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','connect','answertime','[%s][dials][dialend]','hangup','[%s][dials][hangup]','calleridnum','calleridname','cause-txt','complete','duration','endtime','starttime','diffTime'];(function(_0x1f74c2,_0x4bdd8e){var _0xaf068e=function(_0x4dab02){while(--_0x4dab02){_0x1f74c2['push'](_0x1f74c2['shift']());}};_0xaf068e(++_0x4bdd8e);}(_0xd469,0xc9));var _0x9d46=function(_0x469526,_0x4ea6ad){_0x469526=_0x469526-0x0;var _0x36ab34=_0xd469[_0x469526];return _0x36ab34;};'use strict';var _=require(_0x9d46('0x0'));var util=require('util');var utils=require(_0x9d46('0x1'));var dials={};function writeDB(_0x752fba){utils[_0x9d46('0x2')](util[_0x9d46('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x752fba['uniqueid'],_0x752fba[_0x9d46('0x4')],_0x752fba[_0x9d46('0x5')],_0x752fba['calleridnum'],_0x752fba[_0x9d46('0x6')],_0x752fba[_0x9d46('0x7')]));utils[_0x9d46('0x8')](_0x9d46('0x9'),_0x752fba);delete dials[_0x752fba['uniqueid']];}exports[_0x9d46('0xa')]=function(_0x422183){try{utils['debug'](util[_0x9d46('0x3')](_0x9d46('0xb'),_0x422183['uniqueid']),_0x422183);utils[_0x9d46('0x2')](util[_0x9d46('0x3')](_0x9d46('0xc'),_0x422183['uniqueid'],_0x422183[_0x9d46('0xd')],_0x422183[_0x9d46('0xe')]));if(_0x422183['application'][_0x9d46('0xf')]()==_0x9d46('0x10')&&_[_0x9d46('0x11')](_0x422183[_0x9d46('0xe')][_0x9d46('0xf')](),_0x9d46('0x12'))){var _0x300cd3=_0x422183[_0x9d46('0xe')]['split']('=');dials[_0x422183[_0x9d46('0x13')]]={'routeId':_0x300cd3[0x1]};}}catch(_0x824e1a){utils[_0x9d46('0x14')](util[_0x9d46('0x3')](_0x9d46('0xb'),_0x422183['uniqueid']),_0x824e1a);}};exports[_0x9d46('0x15')]=function(_0x76ae7c){try{utils['debug'](util[_0x9d46('0x3')]('[%s][dials][varset]',_0x76ae7c[_0x9d46('0x13')]),_0x76ae7c);if(!_[_0x9d46('0x16')](_0x76ae7c[_0x9d46('0x17')][_0x9d46('0x18')])){utils[_0x9d46('0x2')](util[_0x9d46('0x3')](_0x9d46('0x19'),_0x76ae7c[_0x9d46('0x13')],_0x76ae7c[_0x9d46('0x1a')]));dials[_0x76ae7c[_0x9d46('0x13')]]={'routeId':_0x76ae7c['value']};}}catch(_0x1658c1){utils[_0x9d46('0x14')](util[_0x9d46('0x3')]('[%s][dials][varset]',_0x76ae7c[_0x9d46('0x13')]),_0x1658c1);}};exports[_0x9d46('0x1b')]=function(_0x10e781){try{if(!_[_0x9d46('0x16')](dials[_0x10e781[_0x9d46('0x13')]])){utils['debug'](util[_0x9d46('0x3')](_0x9d46('0x1c'),_0x10e781[_0x9d46('0x13')]),_0x10e781);dials[_0x10e781[_0x9d46('0x13')]]=_[_0x9d46('0x1d')](dials[_0x10e781[_0x9d46('0x13')]],_0x10e781);dials[_0x10e781['uniqueid']]['starttime']=utils[_0x9d46('0x1e')]();dials[_0x10e781[_0x9d46('0x13')]][_0x9d46('0x1f')]=_0x9d46('0x20');utils[_0x9d46('0x2')](util[_0x9d46('0x3')](_0x9d46('0x21'),_0x10e781[_0x9d46('0x13')],dials[_0x10e781[_0x9d46('0x13')]]['starttime']));}}catch(_0x4fbf8d){utils['error'](util[_0x9d46('0x3')](_0x9d46('0x1c'),_0x10e781[_0x9d46('0x13')]),_0x4fbf8d);}};exports[_0x9d46('0x22')]=function(_0x57eb54){try{if(!_['isNil'](dials[_0x57eb54['uniqueid']])){utils['debug'](util['format']('[%s][dials][dialend]',_0x57eb54[_0x9d46('0x13')]),_0x57eb54);dials[_0x57eb54[_0x9d46('0x13')]][_0x9d46('0x7')]=_0x57eb54[_0x9d46('0x7')];if(_0x57eb54['dialstatus']==_0x9d46('0x23')){dials[_0x57eb54[_0x9d46('0x13')]]=_[_0x9d46('0x1d')](dials[_0x57eb54[_0x9d46('0x13')]],_0x57eb54);dials[_0x57eb54['uniqueid']]['answertime']=utils[_0x9d46('0x1e')]();dials[_0x57eb54['uniqueid']][_0x9d46('0x1f')]=_0x9d46('0x24');utils[_0x9d46('0x2')](util[_0x9d46('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x57eb54[_0x9d46('0x13')],_0x57eb54[_0x9d46('0x7')],dials[_0x57eb54['uniqueid']][_0x9d46('0x25')]));}else{utils['info'](util[_0x9d46('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x57eb54[_0x9d46('0x13')],_0x57eb54[_0x9d46('0x7')]));}}}catch(_0x2e2b3c){utils['error'](util[_0x9d46('0x3')](_0x9d46('0x26'),_0x57eb54['uniqueid']),_0x2e2b3c);}};exports[_0x9d46('0x27')]=function(_0x3db18e){try{if(!_[_0x9d46('0x16')](dials[_0x3db18e[_0x9d46('0x13')]])){utils['debug'](util[_0x9d46('0x3')](_0x9d46('0x28'),_0x3db18e['uniqueid']),_0x3db18e);utils[_0x9d46('0x2')](util[_0x9d46('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3db18e[_0x9d46('0x13')],_0x3db18e[_0x9d46('0x29')],_0x3db18e[_0x9d46('0x2a')],_0x3db18e[_0x9d46('0x2b')]));dials[_0x3db18e[_0x9d46('0x13')]]=_[_0x9d46('0x1d')](dials[_0x3db18e['uniqueid']],{'endtime':utils[_0x9d46('0x1e')](),'lastevent':_0x9d46('0x2c')});dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2d')]=utils['diffTime'](dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2e')],dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2f')]);dials[_0x3db18e[_0x9d46('0x13')]]['holdtime']=utils[_0x9d46('0x30')](dials[_0x3db18e['uniqueid']]['answertime']||dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2e')],dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2f')]);dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x31')]=dials[_0x3db18e['uniqueid']][_0x9d46('0x25')]?utils['diffTime'](dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x2e')],dials[_0x3db18e[_0x9d46('0x13')]][_0x9d46('0x25')]):0x0;writeDB(dials[_0x3db18e[_0x9d46('0x13')]]);}}catch(_0x54f8fb){utils[_0x9d46('0x14')](util['format'](_0x9d46('0x28'),_0x3db18e['uniqueid']),_0x54f8fb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 369666e..24e5d7d 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 _0x02d1=['./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','username','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller'];(function(_0x4e0863,_0x1ec822){var _0x3133d7=function(_0x3fca7d){while(--_0x3fca7d){_0x4e0863['push'](_0x4e0863['shift']());}};_0x3133d7(++_0x1ec822);}(_0x02d1,0x153));var _0x102d=function(_0x1e6dc0,_0xb9dc70){_0x1e6dc0=_0x1e6dc0-0x0;var _0x536bbd=_0x02d1[_0x1e6dc0];return _0x536bbd;};var AsteriskManager=require(_0x102d('0x0'));var config=require(_0x102d('0x1'));var utils=require(_0x102d('0x2'));var util=require(_0x102d('0x3'));var ami=new AsteriskManager(config[_0x102d('0x4')]['port'],config['asterisk']['ip'],config['asterisk'][_0x102d('0x5')],config[_0x102d('0x4')]['password'],!![]);ami[_0x102d('0x6')]();if(config[_0x102d('0x7')]&&config[_0x102d('0x7')]['disabled']){utils[_0x102d('0x8')](_0x102d('0x9'));}else{var agents=require(_0x102d('0xa'));var calls=require(_0x102d('0xb'));var queues=require(_0x102d('0xc'));var recordings=require(_0x102d('0xd'));var members=require(_0x102d('0xe'));var dials=require(_0x102d('0xf'));var transfers=require(_0x102d('0x10'));var core=require(_0x102d('0x11'));ami['on'](_0x102d('0x12'),core['connect']);ami['on']('shutdown',core[_0x102d('0x13')]);ami['on'](_0x102d('0x14'),core[_0x102d('0x14')]);ami['on'](_0x102d('0x15'),core[_0x102d('0x15')]);ami['on'](_0x102d('0x16'),core['close']);ami['on']('managerevent',core[_0x102d('0x17')]);ami['on']('devicestatechange',function(_0x2be7fc){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x1a'),_0x2be7fc[_0x102d('0x1b')]),_0x2be7fc);members[_0x102d('0x1c')](_0x2be7fc);}catch(_0x33a6fb){utils[_0x102d('0x15')](util[_0x102d('0x19')]('[%s][index][devicestatechange]',_0x2be7fc[_0x102d('0x1b')]),_0x33a6fb);}});ami['on'](_0x102d('0x1d'),function(_0x176580){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x1e'),_0x176580['uniqueid']),_0x176580);agents[_0x102d('0x1d')](_0x176580);}catch(_0x216d76){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x1e'),_0x176580[_0x102d('0x1f')]),_0x216d76);}});ami['on'](_0x102d('0x20'),function(_0x4ef2be){try{utils[_0x102d('0x18')](util[_0x102d('0x19')]('[%s][index][agentringnoanswer]',_0x4ef2be[_0x102d('0x1f')]),_0x4ef2be);agents[_0x102d('0x20')](_0x4ef2be);}catch(_0x487817){utils[_0x102d('0x15')](util['format'](_0x102d('0x21'),_0x4ef2be[_0x102d('0x1f')]),_0x487817);}});ami['on'](_0x102d('0x22'),function(_0x962879){try{utils[_0x102d('0x18')](util[_0x102d('0x19')]('[%s][index][agentconnect]',_0x962879[_0x102d('0x1f')]),_0x962879);agents[_0x102d('0x22')](_0x962879);queues[_0x102d('0x22')](_0x962879);}catch(_0x84ba74){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x23'),_0x962879[_0x102d('0x1f')]),_0x84ba74);}});ami['on']('agentcomplete',function(_0x223b66){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x24'),_0x223b66[_0x102d('0x1f')]),_0x223b66);agents[_0x102d('0x25')](_0x223b66);queues[_0x102d('0x25')](_0x223b66);members[_0x102d('0x25')](_0x223b66);}catch(_0x1d9136){utils[_0x102d('0x15')](util['format']('[%s][index][agentcomplete]',_0x223b66[_0x102d('0x1f')]),_0x1d9136);}});ami['on']('queuecallerabandon',function(_0xd65905){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x26'),_0xd65905[_0x102d('0x1f')]),_0xd65905);agents['queuecallerabandon'](_0xd65905);queues[_0x102d('0x27')](_0xd65905);}catch(_0x968d9f){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x26'),_0xd65905['uniqueid']),_0x968d9f);}});ami['on'](_0x102d('0x28'),function(_0x36165e){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x29'),_0x36165e[_0x102d('0x1f')]),_0x36165e);queues[_0x102d('0x28')](_0x36165e);recordings[_0x102d('0x28')](_0x36165e);}catch(_0x2ed9e2){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x29'),_0x36165e[_0x102d('0x1f')]),_0x2ed9e2);}});ami['on'](_0x102d('0x2a'),function(_0x588c3b){try{utils['debug'](util[_0x102d('0x19')]('[%s][index][queuecallerleave]',_0x588c3b[_0x102d('0x1f')]),_0x588c3b);queues['queuecallerleave'](_0x588c3b);}catch(_0x590f86){utils['error'](util[_0x102d('0x19')](_0x102d('0x2b'),_0x588c3b[_0x102d('0x1f')]),_0x590f86);}});ami['on'](_0x102d('0x2c'),function(_0x3d7b46){try{utils[_0x102d('0x18')](util['format']('[%s][index][musiconholdstart]',_0x3d7b46['uniqueid']),_0x3d7b46);queues[_0x102d('0x2c')](_0x3d7b46);calls[_0x102d('0x2c')](_0x3d7b46);}catch(_0x1d51a3){utils['error'](util[_0x102d('0x19')](_0x102d('0x2d'),_0x3d7b46[_0x102d('0x1f')]),_0x1d51a3);}});ami['on'](_0x102d('0x2e'),function(_0x5b8578){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x2f'),_0x5b8578[_0x102d('0x1f')]),_0x5b8578);queues[_0x102d('0x2e')](_0x5b8578);calls[_0x102d('0x2e')](_0x5b8578);}catch(_0x40d5c5){utils['error'](util[_0x102d('0x19')](_0x102d('0x2f'),_0x5b8578[_0x102d('0x1f')]),_0x40d5c5);}});ami['on'](_0x102d('0x30'),function(_0x261fdf){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x31'),_0x261fdf[_0x102d('0x1f')]),_0x261fdf);calls[_0x102d('0x30')](_0x261fdf);recordings[_0x102d('0x30')](_0x261fdf);}catch(_0x4dd7bf){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x31'),_0x261fdf[_0x102d('0x1f')]),_0x4dd7bf);}});ami['on']('hangup',function(_0x386593){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x32'),_0x386593['uniqueid']),_0x386593);calls[_0x102d('0x33')](_0x386593);recordings['hangup'](_0x386593);dials[_0x102d('0x33')](_0x386593);agents[_0x102d('0x33')](_0x386593);queues[_0x102d('0x33')](_0x386593);}catch(_0x1c17e6){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x32'),_0x386593[_0x102d('0x1f')]),_0x1c17e6);}});ami['on'](_0x102d('0x34'),function(_0x485849){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x35'),_0x485849[_0x102d('0x1f')]),_0x485849);members['cdr'](_0x485849);}catch(_0x4758eb){utils[_0x102d('0x15')](util[_0x102d('0x19')]('[%s][index][cdr]',_0x485849['uniqueid']),_0x4758eb);}});ami['on'](_0x102d('0x36'),function(_0x39dcd5){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x37'),_0x39dcd5[_0x102d('0x1f')]),_0x39dcd5);queues[_0x102d('0x36')](_0x39dcd5);agents[_0x102d('0x36')](_0x39dcd5);transfers['blindtransfer'](_0x39dcd5);}catch(_0x34c7d0){utils['error'](util[_0x102d('0x19')](_0x102d('0x37'),_0x39dcd5[_0x102d('0x1f')]),_0x34c7d0);}});ami['on'](_0x102d('0x38'),function(_0x106431){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x39'),_0x106431[_0x102d('0x3a')]),_0x106431);queues[_0x102d('0x38')](_0x106431);transfers['attendedtransfer'](_0x106431);agents[_0x102d('0x38')](_0x106431);calls[_0x102d('0x38')](_0x106431);}catch(_0xa23b09){utils[_0x102d('0x15')](util['format']('[%s][index][attendedtransfer]',_0x106431['origtransfereruniqueid']),_0xa23b09);}});ami['on'](_0x102d('0x3b'),function(_0x3a877f){try{utils['debug'](util['format'](_0x102d('0x3c'),_0x3a877f[_0x102d('0x1f')]),_0x3a877f);queues['varset'](_0x3a877f);recordings[_0x102d('0x3b')](_0x3a877f);calls[_0x102d('0x3b')](_0x3a877f);dials['varset'](_0x3a877f);}catch(_0x415b2b){utils[_0x102d('0x15')](util['format'](_0x102d('0x3c'),_0x3a877f['uniqueid']),_0x415b2b);}});ami['on'](_0x102d('0x3d'),function(_0x2c68f2){try{utils['debug'](util[_0x102d('0x19')](_0x102d('0x3e'),_0x2c68f2[_0x102d('0x1f')]),_0x2c68f2);calls[_0x102d('0x3d')](_0x2c68f2);recordings[_0x102d('0x3d')](_0x2c68f2);dials[_0x102d('0x3d')](_0x2c68f2);}catch(_0x353e4a){utils[_0x102d('0x15')](util[_0x102d('0x19')]('[%s][index][newexten]',_0x2c68f2['uniqueid']),_0x353e4a);}});ami['on']('newchannel',function(_0x378df3){try{utils[_0x102d('0x18')](util['format'](_0x102d('0x3f'),_0x378df3['uniqueid']),_0x378df3);calls['newchannel'](_0x378df3);recordings[_0x102d('0x40')](_0x378df3);}catch(_0x25ac08){utils[_0x102d('0x15')](util[_0x102d('0x19')]('[%s][index][newchannel]',_0x378df3[_0x102d('0x1f')]),_0x25ac08);}});ami['on'](_0x102d('0x41'),function(_0x1947f3){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x42'),_0x1947f3['uniqueid']),_0x1947f3);dials[_0x102d('0x41')](_0x1947f3);}catch(_0xdf9088){utils[_0x102d('0x15')](util[_0x102d('0x19')](_0x102d('0x43'),_0x1947f3[_0x102d('0x1f')]),_0xdf9088);}});ami['on'](_0x102d('0x44'),function(_0x175d28){try{utils[_0x102d('0x18')](util[_0x102d('0x19')](_0x102d('0x45'),_0x175d28['uniqueid']),_0x175d28);dials[_0x102d('0x44')](_0x175d28);}catch(_0x592049){utils[_0x102d('0x15')](util['format'](_0x102d('0x45'),_0x175d28[_0x102d('0x1f')]),_0x592049);}});} \ No newline at end of file +var _0xe668=['[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialend]','util','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr'];(function(_0x3cb346,_0x3be876){var _0x453f7=function(_0x17d709){while(--_0x17d709){_0x3cb346['push'](_0x3cb346['shift']());}};_0x453f7(++_0x3be876);}(_0xe668,0x175));var _0x8e66=function(_0x3e750b,_0x2070d9){_0x3e750b=_0x3e750b-0x0;var _0x1e2ac3=_0xe668[_0x3e750b];return _0x1e2ac3;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x8e66('0x0'));var ami=new AsteriskManager(config[_0x8e66('0x1')][_0x8e66('0x2')],config[_0x8e66('0x1')]['ip'],config[_0x8e66('0x1')][_0x8e66('0x3')],config[_0x8e66('0x1')][_0x8e66('0x4')],!![]);ami[_0x8e66('0x5')]();if(config[_0x8e66('0x6')]&&config[_0x8e66('0x6')]['disabled']){utils[_0x8e66('0x7')](_0x8e66('0x8'));}else{var agents=require(_0x8e66('0x9'));var calls=require(_0x8e66('0xa'));var queues=require(_0x8e66('0xb'));var recordings=require('./recordings.controller');var members=require(_0x8e66('0xc'));var dials=require(_0x8e66('0xd'));var transfers=require(_0x8e66('0xe'));var core=require(_0x8e66('0xf'));ami['on'](_0x8e66('0x10'),core[_0x8e66('0x10')]);ami['on'](_0x8e66('0x11'),core['shutdown']);ami['on'](_0x8e66('0x12'),core['fullybooted']);ami['on'](_0x8e66('0x13'),core[_0x8e66('0x13')]);ami['on']('close',core[_0x8e66('0x14')]);ami['on'](_0x8e66('0x15'),core[_0x8e66('0x15')]);ami['on'](_0x8e66('0x16'),function(_0x15b34f){try{utils[_0x8e66('0x17')](util['format']('[%s][index][devicestatechange]',_0x15b34f['device']),_0x15b34f);members['devicestatechange'](_0x15b34f);}catch(_0x2fce22){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x18'),_0x15b34f['device']),_0x2fce22);}});ami['on']('agentcalled',function(_0x1960c5){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')](_0x8e66('0x1a'),_0x1960c5[_0x8e66('0x1b')]),_0x1960c5);agents[_0x8e66('0x1c')](_0x1960c5);}catch(_0x4a4525){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x1a'),_0x1960c5['uniqueid']),_0x4a4525);}});ami['on'](_0x8e66('0x1d'),function(_0x5c0b87){try{utils['debug'](util[_0x8e66('0x19')](_0x8e66('0x1e'),_0x5c0b87['uniqueid']),_0x5c0b87);agents[_0x8e66('0x1d')](_0x5c0b87);}catch(_0x42047c){utils['error'](util[_0x8e66('0x19')](_0x8e66('0x1e'),_0x5c0b87[_0x8e66('0x1b')]),_0x42047c);}});ami['on'](_0x8e66('0x1f'),function(_0x343ba6){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')](_0x8e66('0x20'),_0x343ba6['uniqueid']),_0x343ba6);agents[_0x8e66('0x1f')](_0x343ba6);queues[_0x8e66('0x1f')](_0x343ba6);}catch(_0x4910a9){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x20'),_0x343ba6[_0x8e66('0x1b')]),_0x4910a9);}});ami['on'](_0x8e66('0x21'),function(_0x387ba0){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][agentcomplete]',_0x387ba0[_0x8e66('0x1b')]),_0x387ba0);agents[_0x8e66('0x21')](_0x387ba0);queues[_0x8e66('0x21')](_0x387ba0);members['agentcomplete'](_0x387ba0);}catch(_0x16052f){utils[_0x8e66('0x13')](util[_0x8e66('0x19')]('[%s][index][agentcomplete]',_0x387ba0[_0x8e66('0x1b')]),_0x16052f);}});ami['on'](_0x8e66('0x22'),function(_0x3beb51){try{utils['debug'](util[_0x8e66('0x19')](_0x8e66('0x23'),_0x3beb51[_0x8e66('0x1b')]),_0x3beb51);agents[_0x8e66('0x22')](_0x3beb51);queues[_0x8e66('0x22')](_0x3beb51);}catch(_0x382c50){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x23'),_0x3beb51[_0x8e66('0x1b')]),_0x382c50);}});ami['on'](_0x8e66('0x24'),function(_0x980186){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][queuecallerjoin]',_0x980186[_0x8e66('0x1b')]),_0x980186);queues[_0x8e66('0x24')](_0x980186);recordings[_0x8e66('0x24')](_0x980186);}catch(_0x5a67ad){utils[_0x8e66('0x13')](util[_0x8e66('0x19')]('[%s][index][queuecallerjoin]',_0x980186[_0x8e66('0x1b')]),_0x5a67ad);}});ami['on'](_0x8e66('0x25'),function(_0x6fe7c5){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][queuecallerleave]',_0x6fe7c5[_0x8e66('0x1b')]),_0x6fe7c5);queues[_0x8e66('0x25')](_0x6fe7c5);}catch(_0x491ad6){utils['error'](util[_0x8e66('0x19')]('[%s][index][queuecallerleave]',_0x6fe7c5['uniqueid']),_0x491ad6);}});ami['on'](_0x8e66('0x26'),function(_0x506b18){try{utils['debug'](util[_0x8e66('0x19')](_0x8e66('0x27'),_0x506b18[_0x8e66('0x1b')]),_0x506b18);queues[_0x8e66('0x26')](_0x506b18);calls[_0x8e66('0x26')](_0x506b18);}catch(_0x2843da){utils[_0x8e66('0x13')](util[_0x8e66('0x19')](_0x8e66('0x27'),_0x506b18[_0x8e66('0x1b')]),_0x2843da);}});ami['on']('musiconholdstop',function(_0x5c3f7a){try{utils['debug'](util[_0x8e66('0x19')](_0x8e66('0x28'),_0x5c3f7a[_0x8e66('0x1b')]),_0x5c3f7a);queues[_0x8e66('0x29')](_0x5c3f7a);calls[_0x8e66('0x29')](_0x5c3f7a);}catch(_0x3f26ff){utils['error'](util[_0x8e66('0x19')](_0x8e66('0x28'),_0x5c3f7a[_0x8e66('0x1b')]),_0x3f26ff);}});ami['on'](_0x8e66('0x2a'),function(_0x4d1621){try{utils[_0x8e66('0x17')](util['format'](_0x8e66('0x2b'),_0x4d1621[_0x8e66('0x1b')]),_0x4d1621);calls['newstate'](_0x4d1621);recordings[_0x8e66('0x2a')](_0x4d1621);}catch(_0x3cf260){utils['error'](util[_0x8e66('0x19')](_0x8e66('0x2b'),_0x4d1621[_0x8e66('0x1b')]),_0x3cf260);}});ami['on'](_0x8e66('0x2c'),function(_0x527bd7){try{utils['debug'](util['format'](_0x8e66('0x2d'),_0x527bd7[_0x8e66('0x1b')]),_0x527bd7);calls[_0x8e66('0x2c')](_0x527bd7);recordings['hangup'](_0x527bd7);dials[_0x8e66('0x2c')](_0x527bd7);agents[_0x8e66('0x2c')](_0x527bd7);queues['hangup'](_0x527bd7);}catch(_0xbfd685){utils[_0x8e66('0x13')](util[_0x8e66('0x19')](_0x8e66('0x2d'),_0x527bd7[_0x8e66('0x1b')]),_0xbfd685);}});ami['on'](_0x8e66('0x2e'),function(_0x2984c2){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')](_0x8e66('0x2f'),_0x2984c2[_0x8e66('0x1b')]),_0x2984c2);members[_0x8e66('0x2e')](_0x2984c2);}catch(_0x230705){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x2f'),_0x2984c2[_0x8e66('0x1b')]),_0x230705);}});ami['on'](_0x8e66('0x30'),function(_0x1bf9c){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')](_0x8e66('0x31'),_0x1bf9c[_0x8e66('0x1b')]),_0x1bf9c);queues[_0x8e66('0x30')](_0x1bf9c);agents[_0x8e66('0x30')](_0x1bf9c);transfers[_0x8e66('0x30')](_0x1bf9c);}catch(_0x31fdf7){utils['error'](util[_0x8e66('0x19')](_0x8e66('0x31'),_0x1bf9c[_0x8e66('0x1b')]),_0x31fdf7);}});ami['on'](_0x8e66('0x32'),function(_0x4cc1ec){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0x4cc1ec[_0x8e66('0x33')]),_0x4cc1ec);queues[_0x8e66('0x32')](_0x4cc1ec);transfers['attendedtransfer'](_0x4cc1ec);agents[_0x8e66('0x32')](_0x4cc1ec);calls['attendedtransfer'](_0x4cc1ec);}catch(_0x1fd2c8){utils[_0x8e66('0x13')](util[_0x8e66('0x19')](_0x8e66('0x34'),_0x4cc1ec[_0x8e66('0x33')]),_0x1fd2c8);}});ami['on'](_0x8e66('0x35'),function(_0x2e7ac4){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][varset]',_0x2e7ac4[_0x8e66('0x1b')]),_0x2e7ac4);queues['varset'](_0x2e7ac4);recordings[_0x8e66('0x35')](_0x2e7ac4);calls[_0x8e66('0x35')](_0x2e7ac4);dials['varset'](_0x2e7ac4);}catch(_0x460f9b){utils[_0x8e66('0x13')](util[_0x8e66('0x19')](_0x8e66('0x36'),_0x2e7ac4[_0x8e66('0x1b')]),_0x460f9b);}});ami['on'](_0x8e66('0x37'),function(_0x3fceac){try{utils[_0x8e66('0x17')](util['format']('[%s][index][newexten]',_0x3fceac[_0x8e66('0x1b')]),_0x3fceac);calls[_0x8e66('0x37')](_0x3fceac);recordings[_0x8e66('0x37')](_0x3fceac);dials[_0x8e66('0x37')](_0x3fceac);}catch(_0x47bcc5){utils[_0x8e66('0x13')](util[_0x8e66('0x19')](_0x8e66('0x38'),_0x3fceac['uniqueid']),_0x47bcc5);}});ami['on'](_0x8e66('0x39'),function(_0x4c0076){try{utils[_0x8e66('0x17')](util['format'](_0x8e66('0x3a'),_0x4c0076[_0x8e66('0x1b')]),_0x4c0076);calls[_0x8e66('0x39')](_0x4c0076);recordings['newchannel'](_0x4c0076);}catch(_0x1b7404){utils[_0x8e66('0x13')](util[_0x8e66('0x19')]('[%s][index][newchannel]',_0x4c0076[_0x8e66('0x1b')]),_0x1b7404);}});ami['on']('dialbegin',function(_0x5ac3d7){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][dialbegin]',_0x5ac3d7[_0x8e66('0x1b')]),_0x5ac3d7);dials['dialbegin'](_0x5ac3d7);}catch(_0x55fbbb){utils['error'](util[_0x8e66('0x19')]('[%s]dialbegin',_0x5ac3d7[_0x8e66('0x1b')]),_0x55fbbb);}});ami['on']('dialend',function(_0x29580e){try{utils[_0x8e66('0x17')](util[_0x8e66('0x19')]('[%s][index][dialend]',_0x29580e[_0x8e66('0x1b')]),_0x29580e);dials['dialend'](_0x29580e);}catch(_0x42bb82){utils[_0x8e66('0x13')](util['format'](_0x8e66('0x3b'),_0x29580e[_0x8e66('0x1b')]),_0x42bb82);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1e0089a..0ff82a9 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 _0x630e=['then','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','exitAt','duration','diffTime','agentcomplete','isNil','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','type','source','lodash','./utils','info','format','uniqueid','interface','channel','data2','membername','getUserByInterface'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x630e,0x1af));var _0xe630=function(_0x59e7ef,_0x22f485){_0x59e7ef=_0x59e7ef-0x0;var _0x49955e=_0x630e[_0x59e7ef];return _0x49955e;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var utils=require(_0xe630('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x36902e){utils[_0xe630('0x2')](util[_0xe630('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x36902e[_0xe630('0x4')],_0x36902e[_0xe630('0x5')],_0x36902e[_0xe630('0x6')],_0x36902e[_0xe630('0x7')],_0x36902e[_0xe630('0x8')],_0x36902e['type']));if(_0x36902e[_0xe630('0x5')]){utils[_0xe630('0x9')](_0x36902e['interface'])[_0xe630('0xa')](function(_0x5a9d7c){if(_0x5a9d7c){_0x36902e[_0xe630('0x8')]=_0x5a9d7c[_0xe630('0xb')];_0x36902e[_0xe630('0xc')]=_0x5a9d7c['internal'];utils['request'](_0xe630('0xd'),_0x36902e);}else{utils[_0xe630('0xe')](_0x36902e[_0xe630('0x5')][_0xe630('0xf')]('/')[0x1])['then'](function(_0x3d6ad7){if(_0x3d6ad7){_0x36902e[_0xe630('0x8')]=_0x3d6ad7[_0xe630('0xb')];_0x36902e[_0xe630('0xc')]=_0x3d6ad7[_0xe630('0xc')];utils[_0xe630('0x10')](_0xe630('0xd'),_0x36902e);}});}})[_0xe630('0x11')](function(_0x290fcd){utils[_0xe630('0x12')](util[_0xe630('0x3')](_0xe630('0x13'),_0x36902e[_0xe630('0x4')]),_0x290fcd);});}delete members[_0x36902e['interface']];}function startsWith(_0x1d8b1c,_0x1587a7){return _[_0xe630('0x14')](_0x1d8b1c,function(_0x3916a5){return _[_0xe630('0x15')](_0x1587a7,_0x3916a5);});}exports[_0xe630('0x16')]=function(_0x26a2b7){try{utils[_0xe630('0x17')](util[_0xe630('0x3')](_0xe630('0x18'),members[_0x26a2b7[_0xe630('0x19')]]?members[_0x26a2b7[_0xe630('0x19')]][_0xe630('0x4')]:_0x26a2b7[_0xe630('0x19')]),_0x26a2b7);utils[_0xe630('0x2')](util[_0xe630('0x3')](_0xe630('0x1a'),members[_0x26a2b7[_0xe630('0x19')]]?members[_0x26a2b7[_0xe630('0x19')]][_0xe630('0x4')]:_0x26a2b7[_0xe630('0x19')],_0x26a2b7[_0xe630('0x1b')],_0x26a2b7[_0xe630('0x19')]));switch(_0x26a2b7[_0xe630('0x1b')]){case _0xe630('0x1c'):case _0xe630('0x1d'):if(!startsWith(exclude,_0x26a2b7['device'])){members[_0x26a2b7[_0xe630('0x19')]]={'channel':_0xe630('0x1e'),'interface':_0x26a2b7[_0xe630('0x19')],'type':'TALKING','enterAt':utils[_0xe630('0x1f')](),'role':_0xe630('0x20')};}break;case _0xe630('0x21'):if(!_['isNil'](members[_0x26a2b7[_0xe630('0x19')]])){members[_0x26a2b7[_0xe630('0x19')]][_0xe630('0x22')]=utils[_0xe630('0x1f')]();members[_0x26a2b7[_0xe630('0x19')]][_0xe630('0x23')]=utils[_0xe630('0x24')](members[_0x26a2b7['device']][_0xe630('0x22')],members[_0x26a2b7[_0xe630('0x19')]]['enterAt']);if(members[_0x26a2b7[_0xe630('0x19')]][_0xe630('0x4')]){writeDB(members[_0x26a2b7[_0xe630('0x19')]]);}}break;default:break;}}catch(_0x4b67e5){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x26a2b7['device']]?members[_0x26a2b7[_0xe630('0x19')]]['uniqueid']:_0x26a2b7['device']),_0x4b67e5);}};exports[_0xe630('0x25')]=function(_0x100b6f){try{if(!_[_0xe630('0x26')](members[_0x100b6f[_0xe630('0x5')]])){utils[_0xe630('0x17')](util[_0xe630('0x3')](_0xe630('0x27'),_0x100b6f['uniqueid']),_0x100b6f);utils[_0xe630('0x2')](util[_0xe630('0x3')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x100b6f['uniqueid'],_0x100b6f['interface'],_0x100b6f[_0xe630('0x28')]));members[_0x100b6f['interface']]=_[_0xe630('0x29')](members[_0x100b6f[_0xe630('0x5')]],{'data4':_0x100b6f[_0xe630('0x28')],'uniqueid':_0x100b6f[_0xe630('0x4')]});}}catch(_0x14d72b){utils[_0xe630('0x12')](util['format'](_0xe630('0x27'),_0x100b6f['uniqueid']),_0x14d72b);}};exports['cdr']=function(_0x4cf488){try{utils[_0xe630('0x17')](util[_0xe630('0x3')](_0xe630('0x2a'),_0x4cf488['uniqueid']),_0x4cf488);if(_0x4cf488[_0xe630('0x6')]){var _0x1cb1e5=_0x4cf488[_0xe630('0x6')][_0xe630('0xf')]('-')[0x0];if(!_[_0xe630('0x26')](members[_0x1cb1e5])){members[_0x1cb1e5]=_[_0xe630('0x29')](members[_0x1cb1e5],{'data1':members[_0x1cb1e5][_0xe630('0x2b')]||_0x4cf488['type'],'data2':members[_0x1cb1e5][_0xe630('0x7')]||_0x4cf488['source'],'data3':members[_0x1cb1e5][_0xe630('0x2c')]||_0x4cf488[_0xe630('0x2d')],'uniqueid':members[_0x1cb1e5][_0xe630('0x4')]||_0x4cf488[_0xe630('0x4')]});utils[_0xe630('0x2')](util[_0xe630('0x3')](_0xe630('0x2e'),_0x4cf488[_0xe630('0x4')],members[_0x1cb1e5]['data1'],members[_0x1cb1e5][_0xe630('0x7')],members[_0x1cb1e5][_0xe630('0x2c')]));if(members[_0x1cb1e5]['exitAt']){writeDB(members[_0x1cb1e5]);}}}if(_0x4cf488['destinationchannel']){var _0x596b8c=_0x4cf488['destinationchannel'][_0xe630('0xf')]('-')[0x0];if(!_[_0xe630('0x26')](members[_0x596b8c])){members[_0x596b8c]=_[_0xe630('0x29')](members[_0x596b8c],{'data1':members[_0x596b8c][_0xe630('0x2b')]||_0x4cf488[_0xe630('0x2f')],'data2':members[_0x596b8c][_0xe630('0x7')]||_0x4cf488[_0xe630('0x30')],'data3':members[_0x596b8c][_0xe630('0x2c')]||_0x4cf488[_0xe630('0x2d')],'uniqueid':members[_0x596b8c][_0xe630('0x4')]||_0x4cf488[_0xe630('0x4')]});utils[_0xe630('0x2')](util[_0xe630('0x3')](_0xe630('0x2e'),_0x4cf488[_0xe630('0x4')],members[_0x596b8c][_0xe630('0x2b')],members[_0x596b8c][_0xe630('0x7')],members[_0x596b8c][_0xe630('0x2c')]));if(members[_0x596b8c][_0xe630('0x22')]){writeDB(members[_0x596b8c]);}}}}catch(_0x51e0b5){utils['error'](util['format'](_0xe630('0x2a'),_0x4cf488[_0xe630('0x4')]),_0x51e0b5);}}; \ No newline at end of file +var _0xc511=['data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','interface','getUserByInterface','then','name','internal','CreateMemberReport','split','request','catch','error','format','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','cdr','[%s][members][cdr]','assign'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xc511,0x10a));var _0x1c51=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xc511[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0x1c51('0x0'));var util=require('util');var utils=require(_0x1c51('0x1'));var members={};var exclude=[_0x1c51('0x2'),_0x1c51('0x3')];function writeDB(_0x3d90a6){utils['info'](util['format'](_0x1c51('0x4'),_0x3d90a6['uniqueid'],_0x3d90a6['interface'],_0x3d90a6['channel'],_0x3d90a6[_0x1c51('0x5')],_0x3d90a6[_0x1c51('0x6')],_0x3d90a6[_0x1c51('0x7')]));if(_0x3d90a6[_0x1c51('0x8')]){utils[_0x1c51('0x9')](_0x3d90a6[_0x1c51('0x8')])[_0x1c51('0xa')](function(_0x14146e){if(_0x14146e){_0x3d90a6[_0x1c51('0x6')]=_0x14146e[_0x1c51('0xb')];_0x3d90a6[_0x1c51('0xc')]=_0x14146e[_0x1c51('0xc')];utils['request'](_0x1c51('0xd'),_0x3d90a6);}else{utils['getUserByName'](_0x3d90a6['interface'][_0x1c51('0xe')]('/')[0x1])[_0x1c51('0xa')](function(_0x16260c){if(_0x16260c){_0x3d90a6[_0x1c51('0x6')]=_0x16260c['name'];_0x3d90a6[_0x1c51('0xc')]=_0x16260c['internal'];utils[_0x1c51('0xf')](_0x1c51('0xd'),_0x3d90a6);}});}})[_0x1c51('0x10')](function(_0x570280){utils[_0x1c51('0x11')](util[_0x1c51('0x12')](_0x1c51('0x13'),_0x3d90a6[_0x1c51('0x14')]),_0x570280);});}delete members[_0x3d90a6[_0x1c51('0x8')]];}function startsWith(_0x2556c1,_0x57c4bc){return _['some'](_0x2556c1,function(_0x377815){return _[_0x1c51('0x15')](_0x57c4bc,_0x377815);});}exports[_0x1c51('0x16')]=function(_0x15dab2){try{utils[_0x1c51('0x17')](util[_0x1c51('0x12')](_0x1c51('0x18'),members[_0x15dab2[_0x1c51('0x19')]]?members[_0x15dab2[_0x1c51('0x19')]]['uniqueid']:_0x15dab2[_0x1c51('0x19')]),_0x15dab2);utils[_0x1c51('0x1a')](util[_0x1c51('0x12')](_0x1c51('0x1b'),members[_0x15dab2[_0x1c51('0x19')]]?members[_0x15dab2[_0x1c51('0x19')]]['uniqueid']:_0x15dab2[_0x1c51('0x19')],_0x15dab2[_0x1c51('0x1c')],_0x15dab2[_0x1c51('0x19')]));switch(_0x15dab2[_0x1c51('0x1c')]){case _0x1c51('0x1d'):case _0x1c51('0x1e'):if(!startsWith(exclude,_0x15dab2[_0x1c51('0x19')])){members[_0x15dab2[_0x1c51('0x19')]]={'channel':_0x1c51('0x1f'),'interface':_0x15dab2[_0x1c51('0x19')],'type':_0x1c51('0x20'),'enterAt':utils[_0x1c51('0x21')](),'role':_0x1c51('0x22')};}break;case _0x1c51('0x23'):if(!_[_0x1c51('0x24')](members[_0x15dab2[_0x1c51('0x19')]])){members[_0x15dab2['device']][_0x1c51('0x25')]=utils[_0x1c51('0x21')]();members[_0x15dab2[_0x1c51('0x19')]][_0x1c51('0x26')]=utils[_0x1c51('0x27')](members[_0x15dab2['device']][_0x1c51('0x25')],members[_0x15dab2[_0x1c51('0x19')]][_0x1c51('0x28')]);if(members[_0x15dab2[_0x1c51('0x19')]][_0x1c51('0x14')]){writeDB(members[_0x15dab2['device']]);}}break;default:break;}}catch(_0x430a3c){utils[_0x1c51('0x11')](util[_0x1c51('0x12')](_0x1c51('0x18'),members[_0x15dab2[_0x1c51('0x19')]]?members[_0x15dab2[_0x1c51('0x19')]][_0x1c51('0x14')]:_0x15dab2[_0x1c51('0x19')]),_0x430a3c);}};exports['agentcomplete']=function(_0x18dd71){try{if(!_[_0x1c51('0x24')](members[_0x18dd71[_0x1c51('0x8')]])){utils['debug'](util[_0x1c51('0x12')](_0x1c51('0x29'),_0x18dd71[_0x1c51('0x14')]),_0x18dd71);utils[_0x1c51('0x1a')](util[_0x1c51('0x12')](_0x1c51('0x2a'),_0x18dd71[_0x1c51('0x14')],_0x18dd71[_0x1c51('0x8')],_0x18dd71['queue']));members[_0x18dd71['interface']]=_['assign'](members[_0x18dd71['interface']],{'data4':_0x18dd71['queue'],'uniqueid':_0x18dd71[_0x1c51('0x14')]});}}catch(_0x4eec4e){utils['error'](util[_0x1c51('0x12')]('[%s][members][agentcomplete]',_0x18dd71[_0x1c51('0x14')]),_0x4eec4e);}};exports[_0x1c51('0x2b')]=function(_0x23e27f){try{utils[_0x1c51('0x17')](util[_0x1c51('0x12')](_0x1c51('0x2c'),_0x23e27f[_0x1c51('0x14')]),_0x23e27f);if(_0x23e27f['channel']){var _0x22c56b=_0x23e27f['channel'][_0x1c51('0xe')]('-')[0x0];if(!_[_0x1c51('0x24')](members[_0x22c56b])){members[_0x22c56b]=_[_0x1c51('0x2d')](members[_0x22c56b],{'data1':members[_0x22c56b][_0x1c51('0x2e')]||_0x23e27f['type'],'data2':members[_0x22c56b][_0x1c51('0x5')]||_0x23e27f[_0x1c51('0x2f')],'data3':members[_0x22c56b][_0x1c51('0x30')]||_0x23e27f[_0x1c51('0x31')],'uniqueid':members[_0x22c56b][_0x1c51('0x14')]||_0x23e27f[_0x1c51('0x14')]});utils[_0x1c51('0x1a')](util['format'](_0x1c51('0x32'),_0x23e27f[_0x1c51('0x14')],members[_0x22c56b][_0x1c51('0x2e')],members[_0x22c56b]['data2'],members[_0x22c56b][_0x1c51('0x30')]));if(members[_0x22c56b][_0x1c51('0x25')]){writeDB(members[_0x22c56b]);}}}if(_0x23e27f[_0x1c51('0x33')]){var _0x32f424=_0x23e27f[_0x1c51('0x33')]['split']('-')[0x0];if(!_[_0x1c51('0x24')](members[_0x32f424])){members[_0x32f424]=_['assign'](members[_0x32f424],{'data1':members[_0x32f424][_0x1c51('0x2e')]||_0x23e27f[_0x1c51('0x7')],'data2':members[_0x32f424][_0x1c51('0x5')]||_0x23e27f[_0x1c51('0x2f')],'data3':members[_0x32f424][_0x1c51('0x30')]||_0x23e27f[_0x1c51('0x31')],'uniqueid':members[_0x32f424]['uniqueid']||_0x23e27f[_0x1c51('0x14')]});utils[_0x1c51('0x1a')](util['format'](_0x1c51('0x32'),_0x23e27f['uniqueid'],members[_0x32f424][_0x1c51('0x2e')],members[_0x32f424][_0x1c51('0x5')],members[_0x32f424][_0x1c51('0x30')]));if(members[_0x32f424]['exitAt']){writeDB(members[_0x32f424]);}}}}catch(_0x2d0b96){utils[_0x1c51('0x11')](util[_0x1c51('0x12')]('[%s][members][cdr]',_0x23e27f[_0x1c51('0x14')]),_0x2d0b96);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index b34721d..fbd6016 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 _0x892e=['musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','uniqueid','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexitAt','[%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','connectedlinename','holdtime','diffTime','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','COMPLETEDBY','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x892e,0x13b));var _0xe892=function(_0x52456c,_0x2bea26){_0x52456c=_0x52456c-0x0;var _0x3040d9=_0x892e[_0x52456c];return _0x3040d9;};'use strict';var _=require('lodash');var util=require(_0xe892('0x0'));var utils=require(_0xe892('0x1'));var queues={};function writeDB(_0x1d3d39){utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x4'),_0x1d3d39['uniqueid'],_0x1d3d39['channel'],_0x1d3d39['queue'],_0x1d3d39[_0xe892('0x5')],_0x1d3d39[_0xe892('0x6')],_0x1d3d39[_0xe892('0x7')],_0x1d3d39[_0xe892('0x8')]));if(_0x1d3d39[_0xe892('0x9')]){utils['getVoiceQueueByName'](_0x1d3d39['queue'])[_0xe892('0xa')](function(_0x590a2a){if(_0x590a2a){_0x1d3d39[_0xe892('0xb')]=_0x590a2a[_0xe892('0xb')];}utils[_0xe892('0xc')]('CreateVoiceQueueReport',_0x1d3d39);});}else{utils['request']('CreateVoiceQueueReport',_0x1d3d39);}if(_0x1d3d39[_0xe892('0xd')]){delete queues[_0x1d3d39[_0xe892('0xd')]];}else{delete queues[_0x1d3d39['uniqueid']];}}exports[_0xe892('0xe')]=function(_0x176004){try{utils[_0xe892('0xf')](util[_0xe892('0x3')]('[%s][queues][queuecallerjoin]',_0x176004['uniqueid']),_0x176004);utils[_0xe892('0x2')](util['format'](_0xe892('0x10'),_0x176004[_0xe892('0x11')],_0x176004['queue'],_0x176004[_0xe892('0x12')]));queues[_0x176004[_0xe892('0x11')]]=_['assign'](_0x176004,{'originalposition':_0x176004[_0xe892('0x12')],'queuecallerjoinAt':utils[_0xe892('0x13')](),'mohtime':0x0});}catch(_0x30b47d){utils[_0xe892('0x14')](util[_0xe892('0x3')](_0xe892('0x15'),_0x176004[_0xe892('0x11')]),_0x30b47d);}};exports[_0xe892('0x16')]=function(_0x536019){try{if(!_[_0xe892('0x17')](queues[_0x536019['uniqueid']])){utils['debug'](util['format'](_0xe892('0x18'),_0x536019['uniqueid']),_0x536019);if(queues[_0x536019[_0xe892('0x11')]][_0xe892('0x19')]){if(!queues[_0x536019[_0xe892('0x11')]][_0xe892('0x1a')]&&!queues[_0x536019[_0xe892('0x11')]][_0xe892('0x1b')]){queues[_0x536019[_0xe892('0x11')]]['queuecallercomplete']=!![];queues[_0x536019[_0xe892('0x11')]][_0xe892('0x1c')]=utils[_0xe892('0x13')]();queues[_0x536019[_0xe892('0x11')]][_0xe892('0x8')]=_0xe892('0x1d');}utils[_0xe892('0x2')](util['format'](_0xe892('0x1e'),_0x536019[_0xe892('0x11')],queues[_0x536019['uniqueid']][_0xe892('0x1f')],queues[_0x536019['uniqueid']][_0xe892('0x8')]));writeDB(queues[_0x536019['uniqueid']]);}else if(queues[_0x536019['uniqueid']][_0xe892('0xd')]){utils['info'](util[_0xe892('0x3')](_0xe892('0x20'),_0x536019[_0xe892('0x11')],queues[_0x536019[_0xe892('0x11')]]['name'],queues[_0x536019['uniqueid']][_0xe892('0xd')]));queues[queues[_0x536019['uniqueid']]['transfereduniqueid']]=queues[_0x536019[_0xe892('0x11')]];queues[queues[_0x536019[_0xe892('0x11')]][_0xe892('0xd')]][_0xe892('0x21')]=0x2;delete queues[_0x536019[_0xe892('0x11')]];}}}catch(_0x3f3728){utils['error'](util[_0xe892('0x3')]('[%s][queues][hangup]',_0x536019['uniqueid']),_0x3f3728);}};exports[_0xe892('0x22')]=function(_0x5107c6){try{utils[_0xe892('0xf')](util[_0xe892('0x3')](_0xe892('0x23'),_0x5107c6['uniqueid']),_0x5107c6);if(!_[_0xe892('0x17')](_0x5107c6[_0xe892('0x24')][_0xe892('0x25')])&&_0x5107c6[_0xe892('0x26')]['toUpperCase']()!==_0xe892('0x27')){if(!_['isNil'](queues[_0x5107c6[_0xe892('0x11')]])){queues[_0x5107c6['uniqueid']][_0xe892('0x1a')]=![];queues[_0x5107c6[_0xe892('0x11')]]['queuecallerabandonAt']=null;queues[_0x5107c6[_0xe892('0x11')]]['queuecallerexit']=!![];queues[_0x5107c6['uniqueid']]['queuecallerexitAt']=utils[_0xe892('0x13')]();queues[_0x5107c6['uniqueid']]['queuecallerexitreason']=_0x5107c6['value'][_0xe892('0x28')]();utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x29'),_0x5107c6[_0xe892('0x11')],queues[_0x5107c6['uniqueid']]['name'],_0x5107c6[_0xe892('0x26')],queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x8')]));writeDB(queues[_0x5107c6[_0xe892('0x11')]]);}}else if(!_[_0xe892('0x17')](_0x5107c6[_0xe892('0x24')][_0xe892('0x2a')])){if(!_['isNil'](queues[_0x5107c6[_0xe892('0x11')]])&&!queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x1a')]){queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x1a')]=![];queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x2b')]=null;queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x1b')]=!![];queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x2c')]=utils[_0xe892('0x13')]();queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x8')]='EXITWITHKEY';utils['info'](util[_0xe892('0x3')](_0xe892('0x2d'),_0x5107c6[_0xe892('0x11')],queues[_0x5107c6[_0xe892('0x11')]][_0xe892('0x1f')],_0x5107c6['value'],queues[_0x5107c6['uniqueid']][_0xe892('0x8')]));}}}catch(_0x1b6374){utils[_0xe892('0x14')](util[_0xe892('0x3')](_0xe892('0x23'),_0x5107c6[_0xe892('0x11')]),_0x1b6374);}};exports[_0xe892('0x1a')]=function(_0x67d5c5){try{if(!_[_0xe892('0x17')](queues[_0x67d5c5['uniqueid']])){utils[_0xe892('0xf')](util[_0xe892('0x3')](_0xe892('0x2e'),_0x67d5c5[_0xe892('0x11')]),_0x67d5c5);queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x1b')]=![];queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x2c')]=null;queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x1a')]=!![];queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x2b')]=utils[_0xe892('0x13')]();queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x8')]=_0xe892('0x2f');utils['info'](util[_0xe892('0x3')](_0xe892('0x30'),_0x67d5c5[_0xe892('0x11')],queues[_0x67d5c5[_0xe892('0x11')]]['name'],queues[_0x67d5c5[_0xe892('0x11')]][_0xe892('0x8')]));}}catch(_0xaa2b7){utils[_0xe892('0x14')](util['format'](_0xe892('0x2e'),_0x67d5c5['uniqueid']),_0xaa2b7);}};exports[_0xe892('0x31')]=function(_0x241021){try{if(!_[_0xe892('0x17')](queues[_0x241021[_0xe892('0x11')]])){utils[_0xe892('0xf')](util[_0xe892('0x3')](_0xe892('0x32'),_0x241021[_0xe892('0x11')]),_0x241021);utils['info'](util[_0xe892('0x3')](_0xe892('0x33'),_0x241021['uniqueid'],queues[_0x241021['uniqueid']]['name'],_0x241021[_0xe892('0x34')],_0x241021[_0xe892('0x35')]));queues[_0x241021[_0xe892('0x11')]][_0xe892('0x31')]=!![];queues[_0x241021[_0xe892('0x11')]][_0xe892('0x19')]=utils[_0xe892('0x13')]();queues[_0x241021[_0xe892('0x11')]][_0xe892('0x36')]=utils[_0xe892('0x37')](queues[_0x241021[_0xe892('0x11')]]['queuecallerleaveAt'],queues[_0x241021['uniqueid']]['queuecallerjoinAt']);queues[_0x241021[_0xe892('0x11')]][_0xe892('0x12')]=_0x241021[_0xe892('0x12')];queues[_0x241021[_0xe892('0x11')]][_0xe892('0x38')]=_0x241021['count'];queues[_0x241021[_0xe892('0x11')]][_0xe892('0x34')]=_0x241021[_0xe892('0x34')];queues[_0x241021['uniqueid']]['connectedlinename']=_0x241021[_0xe892('0x35')];}}catch(_0x3a4ef7){utils[_0xe892('0x14')](util[_0xe892('0x3')](_0xe892('0x32'),_0x241021['uniqueid']),_0x3a4ef7);}};exports['agentconnect']=function(_0x5a701c){try{if(!_[_0xe892('0x17')](queues[_0x5a701c[_0xe892('0x11')]])){utils[_0xe892('0xf')](util[_0xe892('0x3')]('[%s][queues][agentconnect]',_0x5a701c['uniqueid']),_0x5a701c);utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x39'),_0x5a701c[_0xe892('0x11')],queues[_0x5a701c['uniqueid']][_0xe892('0x1f')],_0x5a701c[_0xe892('0x3a')],_0x5a701c[_0xe892('0x3b')]));queues[_0x5a701c['uniqueid']][_0xe892('0x1a')]=![];queues[_0x5a701c[_0xe892('0x11')]][_0xe892('0x1a')]=![];queues[_0x5a701c[_0xe892('0x11')]][_0xe892('0x2b')]=null;queues[_0x5a701c[_0xe892('0x11')]][_0xe892('0x1b')]=![];queues[_0x5a701c[_0xe892('0x11')]][_0xe892('0x8')]=null;queues[_0x5a701c[_0xe892('0x11')]]['queuecallerexitAt']=null;queues[_0x5a701c[_0xe892('0x11')]][_0xe892('0x3c')]=!![];queues[_0x5a701c['uniqueid']][_0xe892('0x7')]=_0x5a701c[_0xe892('0x3b')];queues[_0x5a701c['uniqueid']][_0xe892('0x5')]=_0x5a701c[_0xe892('0x3a')];}}catch(_0x2c5cb4){utils[_0xe892('0x14')](util['format'](_0xe892('0x3d'),_0x5a701c[_0xe892('0x11')]),_0x2c5cb4);}};exports[_0xe892('0x3e')]=function(_0x7f7f06){try{if(!_['isNil'](queues[_0x7f7f06[_0xe892('0x11')]])){if(queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x19')]){utils['debug'](util['format'](_0xe892('0x3f'),_0x7f7f06[_0xe892('0x11')]),_0x7f7f06);queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x1a')]=![];queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x1a')]=![];queues[_0x7f7f06['uniqueid']]['queuecallerabandonAt']=null;queues[_0x7f7f06['uniqueid']][_0xe892('0x1b')]=![];queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x2c')]=null;queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x3c')]=!![];queues[_0x7f7f06['uniqueid']][_0xe892('0x5')]=_0x7f7f06[_0xe892('0x3a')];queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x40')]=!![];queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x1c')]=utils['now']();if(_0x7f7f06[_0xe892('0x41')]==_0xe892('0x42')){if(!queues[_0x7f7f06['uniqueid']][_0xe892('0x42')]){queues[_0x7f7f06['uniqueid']][_0xe892('0x8')]='TRANSFER';}}else{queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x8')]=_0xe892('0x43')+_0x7f7f06[_0xe892('0x41')][_0xe892('0x28')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x7f7f06[_0xe892('0x11')],queues[_0x7f7f06[_0xe892('0x11')]][_0xe892('0x1f')],_0x7f7f06[_0xe892('0x3a')],queues[_0x7f7f06[_0xe892('0x11')]]['queuecallerexitreason']));writeDB(queues[_0x7f7f06['uniqueid']]);}}}catch(_0xeea640){utils[_0xe892('0x14')](util[_0xe892('0x3')](_0xe892('0x3f'),_0x7f7f06['uniqueid']),_0xeea640);}};exports['blindtransfer']=function(_0x175161){try{if(!_[_0xe892('0x17')](queues[_0x175161[_0xe892('0x44')]])){utils[_0xe892('0xf')](util['format'](_0xe892('0x45'),_0x175161[_0xe892('0x11')]),_0x175161);queues[_0x175161[_0xe892('0x44')]]['transfer']=!![];queues[_0x175161[_0xe892('0x44')]][_0xe892('0x46')]=_0xe892('0x47');queues[_0x175161[_0xe892('0x44')]][_0xe892('0x48')]=_0x175161[_0xe892('0x49')];queues[_0x175161[_0xe892('0x44')]][_0xe892('0x4a')]=_0x175161[_0xe892('0x44')];queues[_0x175161[_0xe892('0x44')]][_0xe892('0x8')]='BLINDTRANSFER';utils[_0xe892('0x2')](util['format'](_0xe892('0x4b'),_0x175161[_0xe892('0x11')],queues[_0x175161[_0xe892('0x44')]][_0xe892('0x1f')],_0x175161[_0xe892('0x44')],_0x175161[_0xe892('0x49')]));}}catch(_0x164048){utils[_0xe892('0x14')](util[_0xe892('0x3')]('[%s][queues][blindtransfer]',_0x175161[_0xe892('0x11')]),_0x164048);}};exports['attendedtransfer']=function(_0x4cd1d4){try{utils[_0xe892('0xf')](util[_0xe892('0x3')](_0xe892('0x4c'),_0x4cd1d4[_0xe892('0x4d')]),_0x4cd1d4);if(_0x4cd1d4['origtransfereruniqueid']==_0x4cd1d4['origtransfererlinkedid']){if(!_[_0xe892('0x17')](queues[_0x4cd1d4[_0xe892('0x4e')]])){utils['info'](util[_0xe892('0x3')](_0xe892('0x4f'),_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x1f')],_0x4cd1d4[_0xe892('0x50')]));queues[_0x4cd1d4[_0xe892('0x4e')]]['transfer']=!![];queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x46')]=_0xe892('0x51');queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x48')]=_0x4cd1d4[_0xe892('0x50')];queues[_0x4cd1d4[_0xe892('0x4e')]]['transferuniqueid']=_0x4cd1d4['origtransfereruniqueid'];queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x8')]=_0xe892('0x52');}if(!_[_0xe892('0x17')](queues[_0x4cd1d4['origtransfererlinkedid']])){if(_0x4cd1d4[_0xe892('0x53')]&&queues[_0x4cd1d4['transfereelinkedid']]){queues[_0x4cd1d4[_0xe892('0x53')]]['queuecallerenterreason']=0x1;queues[_0x4cd1d4[_0xe892('0x44')]]=_[_0xe892('0x54')](queues[_0x4cd1d4[_0xe892('0x53')]]);queues[_0x4cd1d4['transfereeuniqueid']]['transfereduniqueid']=_0x4cd1d4[_0xe892('0x55')];queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x21')]=0x2;queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x6')]=queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x6')];queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x56')]=queues[_0x4cd1d4[_0xe892('0x4e')]][_0xe892('0x56')];queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x57')]=utils[_0xe892('0x13')]();queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x19')]=utils[_0xe892('0x13')]();queues[_0x4cd1d4[_0xe892('0x44')]]['holdtime']=0x0;queues[_0x4cd1d4['transfereeuniqueid']][_0xe892('0x58')]=0x0;utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x59'),_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x1f')],queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x6')],queues[_0x4cd1d4[_0xe892('0x44')]][_0xe892('0x56')]));}else{utils[_0xe892('0x2')](util[_0xe892('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x1f')],_0x4cd1d4[_0xe892('0x4e')]));queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0xd')]=_0x4cd1d4[_0xe892('0x4e')];}}}else if(_0x4cd1d4['secondtransfereruniqueid']==_0x4cd1d4[_0xe892('0x4e')]){if(!_[_0xe892('0x17')](queues[_0x4cd1d4[_0xe892('0x5a')]])){utils['info'](util['format'](_0xe892('0x5b'),_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x1f')],_0x4cd1d4[_0xe892('0x5c')],_0x4cd1d4[_0xe892('0x5d')]));queues[_0x4cd1d4['origtransfererlinkedid']][_0xe892('0x42')]=!![];queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x46')]=_0xe892('0x51');queues[_0x4cd1d4['origtransfererlinkedid']]['transferexten']=_0x4cd1d4[_0xe892('0x5d')];queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x4a')]=_0x4cd1d4['secondtransfereruniqueid'];queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x8')]=_0xe892('0x52');}if(!_[_0xe892('0x17')](queues[_0x4cd1d4[_0xe892('0x4e')]])){if(_0x4cd1d4[_0xe892('0x5e')]&&queues[_0x4cd1d4[_0xe892('0x5e')]]){queues[_0x4cd1d4[_0xe892('0x5e')]][_0xe892('0x21')]=0x1;queues[_0x4cd1d4[_0xe892('0x55')]]=_[_0xe892('0x54')](queues[_0x4cd1d4[_0xe892('0x5e')]]);queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0xd')]=_0x4cd1d4['transfertargetuniqueid'];queues[_0x4cd1d4['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x6')]=queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x6')];queues[_0x4cd1d4[_0xe892('0x55')]]['calleridname']=queues[_0x4cd1d4[_0xe892('0x5a')]][_0xe892('0x56')];queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x57')]=utils[_0xe892('0x13')]();queues[_0x4cd1d4[_0xe892('0x55')]]['queuecallerleaveAt']=utils['now']();queues[_0x4cd1d4['transfertargetuniqueid']][_0xe892('0x36')]=0x0;queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x58')]=0x0;utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x5f'),_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x1f')],queues[_0x4cd1d4['transfertargetuniqueid']][_0xe892('0xd')],queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x6')],queues[_0x4cd1d4[_0xe892('0x55')]][_0xe892('0x56')]));}else{utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x60'),_0x4cd1d4[_0xe892('0x4d')],queues[_0x4cd1d4[_0xe892('0x4e')]]['name'],_0x4cd1d4[_0xe892('0x5a')]));queues[_0x4cd1d4[_0xe892('0x4e')]]['transfereduniqueid']=_0x4cd1d4[_0xe892('0x5a')];}}}}catch(_0x2aad5e){utils['error'](util[_0xe892('0x3')]('[%s][queues][attendedtransfer]',_0x4cd1d4[_0xe892('0x4d')]),_0x2aad5e);}};exports[_0xe892('0x61')]=function(_0x1512a4){try{if(!_[_0xe892('0x17')](queues[_0x1512a4[_0xe892('0x11')]])){utils[_0xe892('0xf')](util[_0xe892('0x3')](_0xe892('0x62'),_0x1512a4[_0xe892('0x11')]),_0x1512a4);queues[_0x1512a4[_0xe892('0x11')]]['musiconholdstartAt']=utils[_0xe892('0x13')]();utils[_0xe892('0x2')](util[_0xe892('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1512a4[_0xe892('0x11')],queues[_0x1512a4['uniqueid']][_0xe892('0x1f')],queues[_0x1512a4[_0xe892('0x11')]][_0xe892('0x63')]));}}catch(_0xe4c80a){utils['error'](util[_0xe892('0x3')](_0xe892('0x62'),_0x1512a4[_0xe892('0x11')]),_0xe4c80a);}};exports[_0xe892('0x64')]=function(_0x1348bf){try{if(!_[_0xe892('0x17')](queues[_0x1348bf[_0xe892('0x11')]])){if(!_[_0xe892('0x17')](queues[_0x1348bf[_0xe892('0x11')]]['musiconholdstartAt'])){utils['debug'](util[_0xe892('0x3')](_0xe892('0x65'),_0x1348bf[_0xe892('0x11')]),_0x1348bf);queues[_0x1348bf[_0xe892('0x11')]][_0xe892('0x58')]+=utils['diffTime'](utils[_0xe892('0x13')](),queues[_0x1348bf['uniqueid']][_0xe892('0x63')]);utils[_0xe892('0x2')](util[_0xe892('0x3')](_0xe892('0x66'),_0x1348bf[_0xe892('0x11')],queues[_0x1348bf[_0xe892('0x11')]]['name'],queues[_0x1348bf[_0xe892('0x11')]][_0xe892('0x58')]));delete queues[_0x1348bf[_0xe892('0x11')]][_0xe892('0x63')];}}}catch(_0x261193){utils[_0xe892('0x14')](util[_0xe892('0x3')]('[%s][queues][musiconholdstop]',_0x1348bf[_0xe892('0x11')]),_0x261193);}}; \ No newline at end of file +var _0xb2be=['queuecallerenterreason','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','debug','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','agentcomplete','membername','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid'];(function(_0x3998c3,_0x5f37db){var _0x4e4e69=function(_0x2064f2){while(--_0x2064f2){_0x3998c3['push'](_0x3998c3['shift']());}};_0x4e4e69(++_0x5f37db);}(_0xb2be,0xdc));var _0xeb2b=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0xb2be[_0x3186aa];return _0x2d8c36;};'use strict';var _=require(_0xeb2b('0x0'));var util=require(_0xeb2b('0x1'));var utils=require(_0xeb2b('0x2'));var queues={};function writeDB(_0x19e856){utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x5'),_0x19e856[_0xeb2b('0x6')],_0x19e856[_0xeb2b('0x7')],_0x19e856[_0xeb2b('0x8')],_0x19e856[_0xeb2b('0x9')],_0x19e856['calleridnum'],_0x19e856[_0xeb2b('0xa')],_0x19e856[_0xeb2b('0xb')]));if(_0x19e856['queue']){utils[_0xeb2b('0xc')](_0x19e856['queue'])[_0xeb2b('0xd')](function(_0x323d05){if(_0x323d05){_0x19e856[_0xeb2b('0xe')]=_0x323d05[_0xeb2b('0xe')];}utils[_0xeb2b('0xf')](_0xeb2b('0x10'),_0x19e856);});}else{utils[_0xeb2b('0xf')](_0xeb2b('0x10'),_0x19e856);}if(_0x19e856[_0xeb2b('0x11')]){delete queues[_0x19e856[_0xeb2b('0x11')]];}else{delete queues[_0x19e856['uniqueid']];}}exports[_0xeb2b('0x12')]=function(_0x4dfd5d){try{utils['debug'](util[_0xeb2b('0x4')]('[%s][queues][queuecallerjoin]',_0x4dfd5d[_0xeb2b('0x6')]),_0x4dfd5d);utils[_0xeb2b('0x3')](util['format'](_0xeb2b('0x13'),_0x4dfd5d['uniqueid'],_0x4dfd5d[_0xeb2b('0x8')],_0x4dfd5d[_0xeb2b('0x14')]));queues[_0x4dfd5d[_0xeb2b('0x6')]]=_['assign'](_0x4dfd5d,{'originalposition':_0x4dfd5d['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4fd2c7){utils[_0xeb2b('0x15')](util['format']('[%s][queues][queuecallerjoin]',_0x4dfd5d['uniqueid']),_0x4fd2c7);}};exports[_0xeb2b('0x16')]=function(_0x5be402){try{if(!_[_0xeb2b('0x17')](queues[_0x5be402[_0xeb2b('0x6')]])){utils['debug'](util[_0xeb2b('0x4')](_0xeb2b('0x18'),_0x5be402['uniqueid']),_0x5be402);if(queues[_0x5be402['uniqueid']][_0xeb2b('0x19')]){if(!queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0x1a')]&&!queues[_0x5be402['uniqueid']]['queuecallerexit']){queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0x1b')]=!![];queues[_0x5be402[_0xeb2b('0x6')]]['queuecallercompleteAt']=utils[_0xeb2b('0x1c')]();queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0xb')]=_0xeb2b('0x1d');}utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x1e'),_0x5be402[_0xeb2b('0x6')],queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0x1f')],queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0xb')]));writeDB(queues[_0x5be402[_0xeb2b('0x6')]]);}else if(queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0x11')]){utils['info'](util['format'](_0xeb2b('0x20'),_0x5be402['uniqueid'],queues[_0x5be402[_0xeb2b('0x6')]]['name'],queues[_0x5be402[_0xeb2b('0x6')]][_0xeb2b('0x11')]));queues[queues[_0x5be402['uniqueid']]['transfereduniqueid']]=queues[_0x5be402['uniqueid']];queues[queues[_0x5be402[_0xeb2b('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x5be402[_0xeb2b('0x6')]];}}}catch(_0x53de8d){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')](_0xeb2b('0x18'),_0x5be402[_0xeb2b('0x6')]),_0x53de8d);}};exports['varset']=function(_0x2901b2){try{utils[_0xeb2b('0x21')](util[_0xeb2b('0x4')]('[%s][queues][varset]',_0x2901b2[_0xeb2b('0x6')]),_0x2901b2);if(!_['isNil'](_0x2901b2[_0xeb2b('0x22')][_0xeb2b('0x23')])&&_0x2901b2[_0xeb2b('0x24')][_0xeb2b('0x25')]()!==_0xeb2b('0x26')){if(!_['isNil'](queues[_0x2901b2[_0xeb2b('0x6')]])){queues[_0x2901b2[_0xeb2b('0x6')]]['queuecallerabandon']=![];queues[_0x2901b2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x2901b2[_0xeb2b('0x6')]][_0xeb2b('0x27')]=!![];queues[_0x2901b2[_0xeb2b('0x6')]][_0xeb2b('0x28')]=utils[_0xeb2b('0x1c')]();queues[_0x2901b2[_0xeb2b('0x6')]][_0xeb2b('0xb')]=_0x2901b2[_0xeb2b('0x24')][_0xeb2b('0x25')]();utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x29'),_0x2901b2[_0xeb2b('0x6')],queues[_0x2901b2[_0xeb2b('0x6')]]['name'],_0x2901b2[_0xeb2b('0x24')],queues[_0x2901b2[_0xeb2b('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x2901b2[_0xeb2b('0x6')]]);}}else if(!_[_0xeb2b('0x17')](_0x2901b2[_0xeb2b('0x22')][_0xeb2b('0x2a')])){if(!_[_0xeb2b('0x17')](queues[_0x2901b2[_0xeb2b('0x6')]])&&!queues[_0x2901b2['uniqueid']][_0xeb2b('0x1a')]){queues[_0x2901b2[_0xeb2b('0x6')]]['queuecallerabandon']=![];queues[_0x2901b2[_0xeb2b('0x6')]]['queuecallerabandonAt']=null;queues[_0x2901b2[_0xeb2b('0x6')]][_0xeb2b('0x27')]=!![];queues[_0x2901b2['uniqueid']]['queuecallerexitAt']=utils[_0xeb2b('0x1c')]();queues[_0x2901b2[_0xeb2b('0x6')]]['queuecallerexitreason']=_0xeb2b('0x2b');utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x2c'),_0x2901b2[_0xeb2b('0x6')],queues[_0x2901b2[_0xeb2b('0x6')]][_0xeb2b('0x1f')],_0x2901b2[_0xeb2b('0x24')],queues[_0x2901b2['uniqueid']][_0xeb2b('0xb')]));}}}catch(_0x447d72){utils['error'](util['format'](_0xeb2b('0x2d'),_0x2901b2[_0xeb2b('0x6')]),_0x447d72);}};exports['queuecallerabandon']=function(_0x4a5338){try{if(!_[_0xeb2b('0x17')](queues[_0x4a5338[_0xeb2b('0x6')]])){utils[_0xeb2b('0x21')](util[_0xeb2b('0x4')](_0xeb2b('0x2e'),_0x4a5338[_0xeb2b('0x6')]),_0x4a5338);queues[_0x4a5338[_0xeb2b('0x6')]][_0xeb2b('0x27')]=![];queues[_0x4a5338[_0xeb2b('0x6')]]['queuecallerexitAt']=null;queues[_0x4a5338[_0xeb2b('0x6')]][_0xeb2b('0x1a')]=!![];queues[_0x4a5338[_0xeb2b('0x6')]][_0xeb2b('0x2f')]=utils[_0xeb2b('0x1c')]();queues[_0x4a5338[_0xeb2b('0x6')]][_0xeb2b('0xb')]=_0xeb2b('0x30');utils[_0xeb2b('0x3')](util['format'](_0xeb2b('0x31'),_0x4a5338[_0xeb2b('0x6')],queues[_0x4a5338[_0xeb2b('0x6')]]['name'],queues[_0x4a5338[_0xeb2b('0x6')]][_0xeb2b('0xb')]));}}catch(_0x21e9e9){utils['error'](util[_0xeb2b('0x4')](_0xeb2b('0x2e'),_0x4a5338[_0xeb2b('0x6')]),_0x21e9e9);}};exports[_0xeb2b('0x32')]=function(_0x1a97a7){try{if(!_[_0xeb2b('0x17')](queues[_0x1a97a7[_0xeb2b('0x6')]])){utils['debug'](util[_0xeb2b('0x4')](_0xeb2b('0x33'),_0x1a97a7[_0xeb2b('0x6')]),_0x1a97a7);utils['info'](util[_0xeb2b('0x4')](_0xeb2b('0x34'),_0x1a97a7[_0xeb2b('0x6')],queues[_0x1a97a7[_0xeb2b('0x6')]]['name'],_0x1a97a7[_0xeb2b('0x35')],_0x1a97a7['connectedlinename']));queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x32')]=!![];queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x19')]=utils['now']();queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x36')]=utils[_0xeb2b('0x37')](queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x19')],queues[_0x1a97a7['uniqueid']]['queuecallerjoinAt']);queues[_0x1a97a7['uniqueid']]['position']=_0x1a97a7[_0xeb2b('0x14')];queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x38')]=_0x1a97a7[_0xeb2b('0x38')];queues[_0x1a97a7[_0xeb2b('0x6')]]['connectedlinenum']=_0x1a97a7['connectedlinenum'];queues[_0x1a97a7[_0xeb2b('0x6')]][_0xeb2b('0x39')]=_0x1a97a7[_0xeb2b('0x39')];}}catch(_0x444c28){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')](_0xeb2b('0x33'),_0x1a97a7[_0xeb2b('0x6')]),_0x444c28);}};exports['agentconnect']=function(_0x57aed6){try{if(!_['isNil'](queues[_0x57aed6[_0xeb2b('0x6')]])){utils[_0xeb2b('0x21')](util['format'](_0xeb2b('0x3a'),_0x57aed6[_0xeb2b('0x6')]),_0x57aed6);utils[_0xeb2b('0x3')](util['format'](_0xeb2b('0x3b'),_0x57aed6[_0xeb2b('0x6')],queues[_0x57aed6['uniqueid']][_0xeb2b('0x1f')],_0x57aed6['membername'],_0x57aed6[_0xeb2b('0x3c')]));queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0x1a')]=![];queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0x1a')]=![];queues[_0x57aed6[_0xeb2b('0x6')]]['queuecallerabandonAt']=null;queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0x27')]=![];queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0xb')]=null;queues[_0x57aed6['uniqueid']][_0xeb2b('0x28')]=null;queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0x3d')]=!![];queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0xa')]=_0x57aed6[_0xeb2b('0x3c')];queues[_0x57aed6[_0xeb2b('0x6')]][_0xeb2b('0x9')]=_0x57aed6['membername'];}}catch(_0x22009b){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')](_0xeb2b('0x3a'),_0x57aed6[_0xeb2b('0x6')]),_0x22009b);}};exports[_0xeb2b('0x3e')]=function(_0x5b1b09){try{if(!_[_0xeb2b('0x17')](queues[_0x5b1b09['uniqueid']])){if(queues[_0x5b1b09['uniqueid']][_0xeb2b('0x19')]){utils[_0xeb2b('0x21')](util[_0xeb2b('0x4')]('[%s][queues][agentcomplete]',_0x5b1b09[_0xeb2b('0x6')]),_0x5b1b09);queues[_0x5b1b09['uniqueid']]['queuecallerabandon']=![];queues[_0x5b1b09[_0xeb2b('0x6')]]['queuecallerabandon']=![];queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x2f')]=null;queues[_0x5b1b09['uniqueid']]['queuecallerexit']=![];queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x28')]=null;queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x3d')]=!![];queues[_0x5b1b09['uniqueid']]['lastAssignedTo']=_0x5b1b09[_0xeb2b('0x3f')];queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x1b')]=!![];queues[_0x5b1b09['uniqueid']][_0xeb2b('0x40')]=utils[_0xeb2b('0x1c')]();if(_0x5b1b09[_0xeb2b('0x41')]==_0xeb2b('0x42')){if(!queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x42')]){queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0xb')]=_0xeb2b('0x43');}}else{queues[_0x5b1b09[_0xeb2b('0x6')]]['queuecallerexitreason']=_0xeb2b('0x44')+_0x5b1b09[_0xeb2b('0x41')][_0xeb2b('0x25')]();}utils[_0xeb2b('0x3')](util['format'](_0xeb2b('0x45'),_0x5b1b09[_0xeb2b('0x6')],queues[_0x5b1b09[_0xeb2b('0x6')]][_0xeb2b('0x1f')],_0x5b1b09[_0xeb2b('0x3f')],queues[_0x5b1b09[_0xeb2b('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x5b1b09['uniqueid']]);}}}catch(_0x13c8aa){utils[_0xeb2b('0x15')](util['format'](_0xeb2b('0x46'),_0x5b1b09['uniqueid']),_0x13c8aa);}};exports[_0xeb2b('0x47')]=function(_0x4ef1dc){try{if(!_[_0xeb2b('0x17')](queues[_0x4ef1dc[_0xeb2b('0x48')]])){utils[_0xeb2b('0x21')](util[_0xeb2b('0x4')](_0xeb2b('0x49'),_0x4ef1dc[_0xeb2b('0x6')]),_0x4ef1dc);queues[_0x4ef1dc[_0xeb2b('0x48')]][_0xeb2b('0x42')]=!![];queues[_0x4ef1dc[_0xeb2b('0x48')]][_0xeb2b('0x4a')]=_0xeb2b('0x4b');queues[_0x4ef1dc['transfereeuniqueid']][_0xeb2b('0x4c')]=_0x4ef1dc[_0xeb2b('0x4d')];queues[_0x4ef1dc[_0xeb2b('0x48')]][_0xeb2b('0x4e')]=_0x4ef1dc[_0xeb2b('0x48')];queues[_0x4ef1dc[_0xeb2b('0x48')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x4f'),_0x4ef1dc[_0xeb2b('0x6')],queues[_0x4ef1dc[_0xeb2b('0x48')]]['name'],_0x4ef1dc['transfereeuniqueid'],_0x4ef1dc[_0xeb2b('0x4d')]));}}catch(_0x1f3b9a){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')](_0xeb2b('0x49'),_0x4ef1dc[_0xeb2b('0x6')]),_0x1f3b9a);}};exports['attendedtransfer']=function(_0x46b899){try{utils['debug'](util[_0xeb2b('0x4')](_0xeb2b('0x50'),_0x46b899['origtransfereruniqueid']),_0x46b899);if(_0x46b899[_0xeb2b('0x51')]==_0x46b899[_0xeb2b('0x52')]){if(!_[_0xeb2b('0x17')](queues[_0x46b899[_0xeb2b('0x53')]])){utils['info'](util[_0xeb2b('0x4')](_0xeb2b('0x54'),_0x46b899[_0xeb2b('0x51')],queues[_0x46b899[_0xeb2b('0x53')]]['name'],_0x46b899['origtransfererexten']));queues[_0x46b899[_0xeb2b('0x53')]][_0xeb2b('0x42')]=!![];queues[_0x46b899['secondtransfererlinkedid']][_0xeb2b('0x4a')]=_0xeb2b('0x55');queues[_0x46b899[_0xeb2b('0x53')]][_0xeb2b('0x4c')]=_0x46b899['origtransfererexten'];queues[_0x46b899[_0xeb2b('0x53')]][_0xeb2b('0x4e')]=_0x46b899[_0xeb2b('0x51')];queues[_0x46b899['secondtransfererlinkedid']][_0xeb2b('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xeb2b('0x17')](queues[_0x46b899['origtransfererlinkedid']])){if(_0x46b899[_0xeb2b('0x56')]&&queues[_0x46b899[_0xeb2b('0x56')]]){queues[_0x46b899[_0xeb2b('0x56')]]['queuecallerenterreason']=0x1;queues[_0x46b899[_0xeb2b('0x48')]]=_[_0xeb2b('0x57')](queues[_0x46b899['transfereelinkedid']]);queues[_0x46b899[_0xeb2b('0x48')]][_0xeb2b('0x11')]=_0x46b899[_0xeb2b('0x58')];queues[_0x46b899[_0xeb2b('0x48')]]['queuecallerenterreason']=0x2;queues[_0x46b899[_0xeb2b('0x48')]][_0xeb2b('0x59')]=queues[_0x46b899[_0xeb2b('0x53')]]['calleridnum'];queues[_0x46b899[_0xeb2b('0x48')]]['calleridname']=queues[_0x46b899[_0xeb2b('0x53')]][_0xeb2b('0x5a')];queues[_0x46b899[_0xeb2b('0x48')]]['queuecallerjoinAt']=utils[_0xeb2b('0x1c')]();queues[_0x46b899['transfereeuniqueid']][_0xeb2b('0x19')]=utils[_0xeb2b('0x1c')]();queues[_0x46b899[_0xeb2b('0x48')]][_0xeb2b('0x36')]=0x0;queues[_0x46b899[_0xeb2b('0x48')]][_0xeb2b('0x5b')]=0x0;utils['info'](util[_0xeb2b('0x4')](_0xeb2b('0x5c'),_0x46b899[_0xeb2b('0x51')],queues[_0x46b899['transfereeuniqueid']][_0xeb2b('0x1f')],queues[_0x46b899[_0xeb2b('0x48')]]['calleridnum'],queues[_0x46b899[_0xeb2b('0x48')]][_0xeb2b('0x5a')]));}else{utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x5d'),_0x46b899[_0xeb2b('0x51')],queues[_0x46b899[_0xeb2b('0x52')]][_0xeb2b('0x1f')],_0x46b899[_0xeb2b('0x53')]));queues[_0x46b899['origtransfererlinkedid']][_0xeb2b('0x11')]=_0x46b899['secondtransfererlinkedid'];}}}else if(_0x46b899['secondtransfereruniqueid']==_0x46b899[_0xeb2b('0x53')]){if(!_[_0xeb2b('0x17')](queues[_0x46b899['origtransfererlinkedid']])){utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x46b899['origtransfereruniqueid'],queues[_0x46b899[_0xeb2b('0x52')]][_0xeb2b('0x1f')],_0x46b899['secondtransfereruniqueid'],_0x46b899[_0xeb2b('0x5e')]));queues[_0x46b899['origtransfererlinkedid']][_0xeb2b('0x42')]=!![];queues[_0x46b899[_0xeb2b('0x52')]]['transfertype']=_0xeb2b('0x55');queues[_0x46b899[_0xeb2b('0x52')]][_0xeb2b('0x4c')]=_0x46b899[_0xeb2b('0x5e')];queues[_0x46b899['origtransfererlinkedid']]['transferuniqueid']=_0x46b899[_0xeb2b('0x5f')];queues[_0x46b899[_0xeb2b('0x52')]][_0xeb2b('0xb')]=_0xeb2b('0x60');}if(!_[_0xeb2b('0x17')](queues[_0x46b899[_0xeb2b('0x53')]])){if(_0x46b899[_0xeb2b('0x61')]&&queues[_0x46b899['transfertargetlinkedid']]){queues[_0x46b899['transfertargetlinkedid']][_0xeb2b('0x62')]=0x1;queues[_0x46b899[_0xeb2b('0x58')]]=_[_0xeb2b('0x57')](queues[_0x46b899['transfertargetlinkedid']]);queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x11')]=_0x46b899[_0xeb2b('0x58')];queues[_0x46b899['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x59')]=queues[_0x46b899['origtransfererlinkedid']][_0xeb2b('0x59')];queues[_0x46b899['transfertargetuniqueid']][_0xeb2b('0x5a')]=queues[_0x46b899[_0xeb2b('0x52')]][_0xeb2b('0x5a')];queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x63')]=utils['now']();queues[_0x46b899[_0xeb2b('0x58')]]['queuecallerleaveAt']=utils[_0xeb2b('0x1c')]();queues[_0x46b899['transfertargetuniqueid']][_0xeb2b('0x36')]=0x0;queues[_0x46b899[_0xeb2b('0x58')]]['mohtime']=0x0;utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x64'),_0x46b899[_0xeb2b('0x51')],queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x1f')],queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x11')],queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x59')],queues[_0x46b899[_0xeb2b('0x58')]][_0xeb2b('0x5a')]));}else{utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x46b899['origtransfereruniqueid'],queues[_0x46b899[_0xeb2b('0x53')]]['name'],_0x46b899[_0xeb2b('0x52')]));queues[_0x46b899[_0xeb2b('0x53')]][_0xeb2b('0x11')]=_0x46b899['origtransfererlinkedid'];}}}}catch(_0x4ccb02){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')]('[%s][queues][attendedtransfer]',_0x46b899['origtransfereruniqueid']),_0x4ccb02);}};exports[_0xeb2b('0x65')]=function(_0x5d43b7){try{if(!_[_0xeb2b('0x17')](queues[_0x5d43b7[_0xeb2b('0x6')]])){utils[_0xeb2b('0x21')](util[_0xeb2b('0x4')](_0xeb2b('0x66'),_0x5d43b7[_0xeb2b('0x6')]),_0x5d43b7);queues[_0x5d43b7['uniqueid']][_0xeb2b('0x67')]=utils['now']();utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x5d43b7[_0xeb2b('0x6')],queues[_0x5d43b7[_0xeb2b('0x6')]][_0xeb2b('0x1f')],queues[_0x5d43b7[_0xeb2b('0x6')]][_0xeb2b('0x67')]));}}catch(_0x4b590b){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')](_0xeb2b('0x66'),_0x5d43b7['uniqueid']),_0x4b590b);}};exports[_0xeb2b('0x68')]=function(_0x8ca408){try{if(!_[_0xeb2b('0x17')](queues[_0x8ca408[_0xeb2b('0x6')]])){if(!_[_0xeb2b('0x17')](queues[_0x8ca408[_0xeb2b('0x6')]][_0xeb2b('0x67')])){utils['debug'](util[_0xeb2b('0x4')]('[%s][queues][musiconholdstop]',_0x8ca408[_0xeb2b('0x6')]),_0x8ca408);queues[_0x8ca408['uniqueid']][_0xeb2b('0x5b')]+=utils[_0xeb2b('0x37')](utils[_0xeb2b('0x1c')](),queues[_0x8ca408[_0xeb2b('0x6')]][_0xeb2b('0x67')]);utils[_0xeb2b('0x3')](util[_0xeb2b('0x4')](_0xeb2b('0x69'),_0x8ca408['uniqueid'],queues[_0x8ca408[_0xeb2b('0x6')]][_0xeb2b('0x1f')],queues[_0x8ca408[_0xeb2b('0x6')]][_0xeb2b('0x5b')]));delete queues[_0x8ca408[_0xeb2b('0x6')]][_0xeb2b('0x67')];}}}catch(_0x4ddb0d){utils[_0xeb2b('0x15')](util[_0xeb2b('0x4')]('[%s][queues][musiconholdstop]',_0x8ca408['uniqueid']),_0x4ddb0d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d22c814..4e4bd17 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 _0x870a=['queue','lodash','util','./utils','format','uniqueid','accountcode','getUserByInternal','membername','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','queuecallerjoin','[%s][recordings][queuecallerjoin]'];(function(_0x3f8812,_0x5cdafd){var _0x5a82b4=function(_0x5bea9f){while(--_0x5bea9f){_0x3f8812['push'](_0x3f8812['shift']());}};_0x5a82b4(++_0x5cdafd);}(_0x870a,0x1e9));var _0xa870=function(_0x5d1abc,_0xe1fec2){_0x5d1abc=_0x5d1abc-0x0;var _0x2467c0=_0x870a[_0x5d1abc];return _0x2467c0;};'use strict';var _=require(_0xa870('0x0'));var util=require(_0xa870('0x1'));var utils=require(_0xa870('0x2'));var recordings={};function writeDB(_0x32c92c){utils['info'](util[_0xa870('0x3')]('[%s][recordings][writeDB]',_0x32c92c[_0xa870('0x4')]));if(_0x32c92c[_0xa870('0x5')]){utils[_0xa870('0x6')](_0x32c92c['accountcode'])['then'](function(_0x4c5709){if(_0x4c5709){_0x32c92c[_0xa870('0x7')]=_0x4c5709['name'];_0x32c92c[_0xa870('0x8')]=_0x4c5709['id'];}utils['request']('CreateVoiceRecording',_0x32c92c);});}else{utils['request'](_0xa870('0x9'),_0x32c92c);}}exports[_0xa870('0xa')]=function(_0x432ec5){try{utils[_0xa870('0xb')](util['format'](_0xa870('0xc'),_0x432ec5['uniqueid']),_0x432ec5);if(_0x432ec5[_0xa870('0x4')]==_0x432ec5[_0xa870('0xd')]){utils[_0xa870('0xe')](util[_0xa870('0x3')](_0xa870('0xf'),_0x432ec5[_0xa870('0x4')],_0x432ec5[_0xa870('0x10')],_0x432ec5[_0xa870('0x11')]));recordings[_0x432ec5[_0xa870('0x4')]]={'uniqueid':_0x432ec5[_0xa870('0x4')],'accountcode':_0x432ec5[_0xa870('0x5')],'exten':_0x432ec5['exten'],'context':_0x432ec5[_0xa870('0x10')],'channel':_0x432ec5['channel'],'monitors':[]};}}catch(_0x175a10){utils[_0xa870('0x12')](util[_0xa870('0x3')](_0xa870('0xc'),_0x432ec5[_0xa870('0x4')]),_0x175a10);}};exports[_0xa870('0x13')]=function(_0x2d5065){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x2d5065[_0xa870('0x4')]),_0x2d5065);if(!_[_0xa870('0x14')](recordings[_0x2d5065[_0xa870('0x4')]])&&_0x2d5065[_0xa870('0x15')]==0x6){utils['info'](util[_0xa870('0x3')](_0xa870('0x16'),_0x2d5065[_0xa870('0x4')],_0x2d5065[_0xa870('0x10')],_0x2d5065[_0xa870('0x17')]));}else if(!_[_0xa870('0x14')](recordings[_0x2d5065[_0xa870('0xd')]])&&_0x2d5065['channelstate']==0x6&&_0x2d5065[_0xa870('0x10')]!=_0xa870('0x18')){utils[_0xa870('0xe')](util[_0xa870('0x3')](_0xa870('0x19'),_0x2d5065[_0xa870('0x4')],_0x2d5065[_0xa870('0xd')],_0x2d5065['context'],_0x2d5065[_0xa870('0x17')]));recordings[_0x2d5065['linkedid']][_0xa870('0x5')]=_0x2d5065['accountcode'];}}catch(_0x4a9bc4){utils[_0xa870('0x12')](util[_0xa870('0x3')](_0xa870('0x1a'),_0x2d5065[_0xa870('0x4')]),_0x4a9bc4);}};exports[_0xa870('0x1b')]=function(_0x58f9d0){try{if(!_['isNil'](_0x58f9d0['variable'])&&!_[_0xa870('0x14')](_0x58f9d0['variable'][_0xa870('0x1c')])){utils[_0xa870('0xb')](util[_0xa870('0x3')](_0xa870('0x1d'),_0x58f9d0[_0xa870('0x4')]),_0x58f9d0);utils[_0xa870('0xe')](util[_0xa870('0x3')](_0xa870('0x1e'),_0x58f9d0['uniqueid'],_0x58f9d0[_0xa870('0x1f')],_0x58f9d0[_0xa870('0x20')]));if(_['endsWith'](_0x58f9d0[_0xa870('0x20')],'.wav49')){_0x58f9d0[_0xa870('0x20')]=_0x58f9d0['value']['replace'](_0xa870('0x21'),_0xa870('0x22'));}if(recordings[_0x58f9d0[_0xa870('0xd')]]){var _0x1911bb=_[_0xa870('0x23')](recordings[_0x58f9d0[_0xa870('0xd')]][_0xa870('0x24')],{'value':_0x58f9d0[_0xa870('0x20')]});if(_['isNil'](_0x1911bb)){recordings[_0x58f9d0[_0xa870('0xd')]]['monitors']['push']({'value':_0x58f9d0['value']});}}}}catch(_0x41e0ea){utils[_0xa870('0x12')](util['format'](_0xa870('0x1d'),_0x58f9d0[_0xa870('0x4')]),_0x41e0ea);}};exports[_0xa870('0x25')]=function(_0x583374){try{if(!_['isNil'](recordings[_0x583374[_0xa870('0x4')]])){utils[_0xa870('0xb')](util['format'](_0xa870('0x26'),_0x583374['uniqueid']),_0x583374);utils[_0xa870('0xe')](util['format'](_0xa870('0x27'),_0x583374[_0xa870('0x4')],_0x583374[_0xa870('0x28')],_0x583374[_0xa870('0x29')],_0x583374[_0xa870('0x2a')]));recordings[_0x583374[_0xa870('0x4')]]['calleridnum']=_0x583374[_0xa870('0x28')];recordings[_0x583374['uniqueid']][_0xa870('0x29')]=_0x583374[_0xa870('0x29')];recordings[_0x583374[_0xa870('0x4')]][_0xa870('0x2b')]=_0x583374[_0xa870('0x2b')];recordings[_0x583374['uniqueid']]['connectedlinename']=_0x583374[_0xa870('0x2c')];if(recordings[_0x583374[_0xa870('0x4')]][_0xa870('0x2d')]==_0xa870('0x2e')&&recordings[_0x583374[_0xa870('0x4')]]['accountcode']){recordings[_0x583374[_0xa870('0x4')]][_0xa870('0x2b')]=recordings[_0x583374[_0xa870('0x4')]][_0xa870('0x5')];recordings[_0x583374[_0xa870('0x4')]]['connectedlinename']='';}recordings[_0x583374['uniqueid']][_0xa870('0x24')][_0xa870('0x2f')](function(_0x1b1e84){var _0x25aab2=_['clone'](recordings[_0x583374['uniqueid']]);_0x25aab2[_0xa870('0x20')]=_0x1b1e84[_0xa870('0x20')];writeDB(_0x25aab2);});delete recordings[_0x583374[_0xa870('0x4')]];}}catch(_0x45e3f7){utils[_0xa870('0x12')](util['format'](_0xa870('0x26'),_0x583374[_0xa870('0x4')]),_0x45e3f7);}};exports[_0xa870('0x30')]=function(_0x5d1572){try{if(!_[_0xa870('0x14')](recordings[_0x5d1572[_0xa870('0x4')]])){utils['debug'](util[_0xa870('0x3')](_0xa870('0x31'),_0x5d1572[_0xa870('0x4')]),_0x5d1572);utils[_0xa870('0xe')](util[_0xa870('0x3')](_0xa870('0x32'),_0x5d1572['uniqueid'],_0x5d1572[_0xa870('0x33')],_0x5d1572[_0xa870('0x34')]));if(_0x5d1572['application'][_0xa870('0x35')]()==_0xa870('0x36')&&_[_0xa870('0x37')](_0x5d1572['appdata'][_0xa870('0x35')](),_0xa870('0x38'))){var _0x44d5e7=_0x5d1572[_0xa870('0x34')][_0xa870('0x39')]('=');var _0x5c2102=_0x44d5e7[0x0]['substring'](_0x44d5e7[0x0]['lastIndexOf']('(')+0x1,_0x44d5e7[0x0]['lastIndexOf'](')'));var _0x1e32cf=_0x44d5e7[0x1];recordings[_0x5d1572[_0xa870('0x4')]][_0x5c2102]=_0x1e32cf;}}}catch(_0x2fbcef){utils[_0xa870('0x12')](util[_0xa870('0x3')](_0xa870('0x31'),_0x5d1572[_0xa870('0x4')]),_0x2fbcef);}};exports[_0xa870('0x3a')]=function(_0x59152c){try{if(!_[_0xa870('0x14')](recordings[_0x59152c[_0xa870('0x4')]])){utils[_0xa870('0xb')](util['format'](_0xa870('0x3b'),_0x59152c[_0xa870('0x4')]),_0x59152c);utils[_0xa870('0xe')](util[_0xa870('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x59152c[_0xa870('0x4')],_0x59152c[_0xa870('0x3c')]));recordings[_0x59152c[_0xa870('0x4')]][_0xa870('0x3c')]=_0x59152c[_0xa870('0x3c')];}}catch(_0x3c2b90){utils[_0xa870('0x12')](util[_0xa870('0x3')]('[%s][recordings][queuecallerjoin]',_0x59152c[_0xa870('0x4')]),_0x3c2b90);}}; \ No newline at end of file +var _0x2812=['UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','[%s][recordings][newstate]','varset','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name'];(function(_0x193c00,_0x491627){var _0x113daa=function(_0xb0db31){while(--_0xb0db31){_0x193c00['push'](_0x193c00['shift']());}};_0x113daa(++_0x491627);}(_0x2812,0x143));var _0x2281=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x2812[_0x29bf80];return _0x932096;};'use strict';var _=require(_0x2281('0x0'));var util=require(_0x2281('0x1'));var utils=require(_0x2281('0x2'));var recordings={};function writeDB(_0x16142b){utils[_0x2281('0x3')](util[_0x2281('0x4')](_0x2281('0x5'),_0x16142b[_0x2281('0x6')]));if(_0x16142b['accountcode']){utils[_0x2281('0x7')](_0x16142b[_0x2281('0x8')])[_0x2281('0x9')](function(_0x4a673d){if(_0x4a673d){_0x16142b[_0x2281('0xa')]=_0x4a673d[_0x2281('0xb')];_0x16142b[_0x2281('0xc')]=_0x4a673d['id'];}utils['request'](_0x2281('0xd'),_0x16142b);});}else{utils[_0x2281('0xe')](_0x2281('0xd'),_0x16142b);}}exports[_0x2281('0xf')]=function(_0x36826a){try{utils[_0x2281('0x10')](util[_0x2281('0x4')](_0x2281('0x11'),_0x36826a[_0x2281('0x6')]),_0x36826a);if(_0x36826a[_0x2281('0x6')]==_0x36826a[_0x2281('0x12')]){utils['info'](util[_0x2281('0x4')](_0x2281('0x13'),_0x36826a[_0x2281('0x6')],_0x36826a[_0x2281('0x14')],_0x36826a[_0x2281('0x15')]));recordings[_0x36826a[_0x2281('0x6')]]={'uniqueid':_0x36826a[_0x2281('0x6')],'accountcode':_0x36826a[_0x2281('0x8')],'exten':_0x36826a[_0x2281('0x15')],'context':_0x36826a[_0x2281('0x14')],'channel':_0x36826a[_0x2281('0x16')],'monitors':[]};}}catch(_0x528fcd){utils['error'](util['format'](_0x2281('0x11'),_0x36826a[_0x2281('0x6')]),_0x528fcd);}};exports[_0x2281('0x17')]=function(_0x2a227d){try{utils[_0x2281('0x10')](util['format']('[%s][recordings][newstate]',_0x2a227d[_0x2281('0x6')]),_0x2a227d);if(!_[_0x2281('0x18')](recordings[_0x2a227d[_0x2281('0x6')]])&&_0x2a227d[_0x2281('0x19')]==0x6){utils[_0x2281('0x3')](util[_0x2281('0x4')](_0x2281('0x1a'),_0x2a227d[_0x2281('0x6')],_0x2a227d[_0x2281('0x14')],_0x2a227d[_0x2281('0x16')]));}else if(!_[_0x2281('0x18')](recordings[_0x2a227d[_0x2281('0x12')]])&&_0x2a227d[_0x2281('0x19')]==0x6&&_0x2a227d[_0x2281('0x14')]!='transfer'){utils[_0x2281('0x3')](util['format'](_0x2281('0x1b'),_0x2a227d[_0x2281('0x6')],_0x2a227d[_0x2281('0x12')],_0x2a227d['context'],_0x2a227d[_0x2281('0x16')]));recordings[_0x2a227d[_0x2281('0x12')]][_0x2281('0x8')]=_0x2a227d['accountcode'];}}catch(_0x341f7b){utils[_0x2281('0x1c')](util[_0x2281('0x4')](_0x2281('0x1d'),_0x2a227d[_0x2281('0x6')]),_0x341f7b);}};exports[_0x2281('0x1e')]=function(_0x2a5455){try{if(!_[_0x2281('0x18')](_0x2a5455['variable'])&&!_[_0x2281('0x18')](_0x2a5455['variable'][_0x2281('0x1f')])){utils['debug'](util[_0x2281('0x4')](_0x2281('0x20'),_0x2a5455[_0x2281('0x6')]),_0x2a5455);utils['info'](util[_0x2281('0x4')](_0x2281('0x21'),_0x2a5455[_0x2281('0x6')],_0x2a5455[_0x2281('0x22')],_0x2a5455[_0x2281('0x23')]));if(_[_0x2281('0x24')](_0x2a5455['value'],_0x2281('0x25'))){_0x2a5455[_0x2281('0x23')]=_0x2a5455[_0x2281('0x23')][_0x2281('0x26')](_0x2281('0x25'),'.WAV');}if(recordings[_0x2a5455[_0x2281('0x12')]]){var _0x58b663=_['find'](recordings[_0x2a5455[_0x2281('0x12')]][_0x2281('0x27')],{'value':_0x2a5455[_0x2281('0x23')]});if(_[_0x2281('0x18')](_0x58b663)){recordings[_0x2a5455[_0x2281('0x12')]][_0x2281('0x27')][_0x2281('0x28')]({'value':_0x2a5455[_0x2281('0x23')]});}}}}catch(_0x354db5){utils['error'](util[_0x2281('0x4')]('[%s][recordings][varset]',_0x2a5455[_0x2281('0x6')]),_0x354db5);}};exports[_0x2281('0x29')]=function(_0x202efb){try{if(!_[_0x2281('0x18')](recordings[_0x202efb[_0x2281('0x6')]])){utils['debug'](util[_0x2281('0x4')](_0x2281('0x2a'),_0x202efb['uniqueid']),_0x202efb);utils[_0x2281('0x3')](util[_0x2281('0x4')](_0x2281('0x2b'),_0x202efb['uniqueid'],_0x202efb[_0x2281('0x2c')],_0x202efb[_0x2281('0x2d')],_0x202efb[_0x2281('0x2e')]));recordings[_0x202efb[_0x2281('0x6')]][_0x2281('0x2c')]=_0x202efb['calleridnum'];recordings[_0x202efb[_0x2281('0x6')]]['calleridname']=_0x202efb[_0x2281('0x2d')];recordings[_0x202efb[_0x2281('0x6')]][_0x2281('0x2f')]=_0x202efb['connectedlinenum'];recordings[_0x202efb[_0x2281('0x6')]][_0x2281('0x30')]=_0x202efb[_0x2281('0x30')];if(recordings[_0x202efb[_0x2281('0x6')]][_0x2281('0x31')]==_0x2281('0x32')&&recordings[_0x202efb[_0x2281('0x6')]]['accountcode']){recordings[_0x202efb[_0x2281('0x6')]][_0x2281('0x2f')]=recordings[_0x202efb['uniqueid']][_0x2281('0x8')];recordings[_0x202efb['uniqueid']]['connectedlinename']='';}recordings[_0x202efb['uniqueid']][_0x2281('0x27')][_0x2281('0x33')](function(_0x4064e9){var _0xda0ce1=_[_0x2281('0x34')](recordings[_0x202efb['uniqueid']]);_0xda0ce1[_0x2281('0x23')]=_0x4064e9[_0x2281('0x23')];writeDB(_0xda0ce1);});delete recordings[_0x202efb['uniqueid']];}}catch(_0x230ebf){utils[_0x2281('0x1c')](util[_0x2281('0x4')](_0x2281('0x2a'),_0x202efb['uniqueid']),_0x230ebf);}};exports[_0x2281('0x35')]=function(_0x3d386a){try{if(!_[_0x2281('0x18')](recordings[_0x3d386a[_0x2281('0x6')]])){utils[_0x2281('0x10')](util[_0x2281('0x4')](_0x2281('0x36'),_0x3d386a[_0x2281('0x6')]),_0x3d386a);utils[_0x2281('0x3')](util[_0x2281('0x4')](_0x2281('0x37'),_0x3d386a[_0x2281('0x6')],_0x3d386a['application'],_0x3d386a[_0x2281('0x38')]));if(_0x3d386a['application'][_0x2281('0x39')]()==_0x2281('0x3a')&&_[_0x2281('0x3b')](_0x3d386a[_0x2281('0x38')][_0x2281('0x39')](),_0x2281('0x3c'))){var _0x1f9fda=_0x3d386a[_0x2281('0x38')][_0x2281('0x3d')]('=');var _0x4a7fa6=_0x1f9fda[0x0][_0x2281('0x3e')](_0x1f9fda[0x0][_0x2281('0x3f')]('(')+0x1,_0x1f9fda[0x0][_0x2281('0x3f')](')'));var _0x1201eb=_0x1f9fda[0x1];recordings[_0x3d386a[_0x2281('0x6')]][_0x4a7fa6]=_0x1201eb;}}}catch(_0x4e45d){utils['error'](util[_0x2281('0x4')](_0x2281('0x36'),_0x3d386a[_0x2281('0x6')]),_0x4e45d);}};exports[_0x2281('0x40')]=function(_0x3125e1){try{if(!_[_0x2281('0x18')](recordings[_0x3125e1['uniqueid']])){utils[_0x2281('0x10')](util[_0x2281('0x4')](_0x2281('0x41'),_0x3125e1[_0x2281('0x6')]),_0x3125e1);utils[_0x2281('0x3')](util[_0x2281('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3125e1[_0x2281('0x6')],_0x3125e1['queue']));recordings[_0x3125e1[_0x2281('0x6')]][_0x2281('0x42')]=_0x3125e1[_0x2281('0x42')];}}catch(_0x354c7b){utils['error'](util['format']('[%s][recordings][queuecallerjoin]',_0x3125e1[_0x2281('0x6')]),_0x354c7b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 370fa10..2f5f9d5 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 _0xdb2c=['origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','type','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid'];(function(_0x4c7e59,_0x53ad97){var _0x25de84=function(_0x25f097){while(--_0x25f097){_0x4c7e59['push'](_0x4c7e59['shift']());}};_0x25de84(++_0x53ad97);}(_0xdb2c,0xf8));var _0xcdb2=function(_0x14ebe8,_0x385a8b){_0x14ebe8=_0x14ebe8-0x0;var _0x456259=_0xdb2c[_0x14ebe8];return _0x456259;};'use strict';var _=require(_0xcdb2('0x0'));var util=require(_0xcdb2('0x1'));var utils=require('./utils');function writeDB(_0x85c929){utils[_0xcdb2('0x2')](util[_0xcdb2('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x85c929[_0xcdb2('0x4')]==='attended'?_0x85c929['origtransfereruniqueid']:_0x85c929[_0xcdb2('0x5')],_0x85c929[_0xcdb2('0x4')]));utils[_0xcdb2('0x6')](_0xcdb2('0x7'),_0x85c929);}exports[_0xcdb2('0x8')]={};exports[_0xcdb2('0x9')]=function(_0x2668c6){try{utils[_0xcdb2('0xa')](util[_0xcdb2('0x3')]('[%s][transfers][blindtransfer]',_0x2668c6['uniqueid']),_0x2668c6);utils[_0xcdb2('0x2')](util[_0xcdb2('0x3')](_0xcdb2('0xb'),_0x2668c6[_0xcdb2('0x5')],_0x2668c6['transferercalleridnum'],_0x2668c6['transferercalleridname'],_0x2668c6[_0xcdb2('0xc')],_0x2668c6['transfereecalleridname']));_0x2668c6['type']='blind';exports['blinds'][_0x2668c6[_0xcdb2('0xd')]]=_0x2668c6;writeDB(_0x2668c6);}catch(_0xf35ded){utils[_0xcdb2('0xe')](util[_0xcdb2('0x3')]('[%s][transfers][blindtransfer]',_0x2668c6[_0xcdb2('0x5')]),_0xf35ded);}};exports[_0xcdb2('0xf')]=function(_0x12890c){try{utils[_0xcdb2('0xa')](util[_0xcdb2('0x3')](_0xcdb2('0x10'),_0x12890c[_0xcdb2('0x11')]),_0x12890c);utils['info'](util[_0xcdb2('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x12890c[_0xcdb2('0x11')],_0x12890c[_0xcdb2('0x12')],_0x12890c[_0xcdb2('0x13')],_0x12890c[_0xcdb2('0x14')],_0x12890c[_0xcdb2('0x15')]));_0x12890c=_['assign'](_0x12890c,{'transfererchannel':_0x12890c[_0xcdb2('0x16')],'transferercalleridnum':_0x12890c[_0xcdb2('0x12')],'transferercalleridname':_0x12890c[_0xcdb2('0x13')],'transfererconnectedlinenum':_0x12890c[_0xcdb2('0x17')],'transfererconnectedlinename':_0x12890c[_0xcdb2('0x18')],'transfereraccountcode':_0x12890c[_0xcdb2('0x19')],'transferercontext':_0x12890c[_0xcdb2('0x1a')],'transfererexten':_0x12890c[_0xcdb2('0x1b')],'transfererlinkedid':_0x12890c[_0xcdb2('0x1c')],'context':_0x12890c[_0xcdb2('0x1d')],'extension':_0x12890c['origtransfererexten'],'type':'attended'});if(_[_0xcdb2('0x1e')](_0x12890c[_0xcdb2('0x1f')])){_0x12890c=_['assign'](_0x12890c,{'transfereechannel':_0x12890c[_0xcdb2('0x20')],'transfereecalleridnum':_0x12890c[_0xcdb2('0x14')],'transfereecalleridname':_0x12890c[_0xcdb2('0x15')],'transfereeconnectedlinenum':_0x12890c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x12890c[_0xcdb2('0x21')],'transfereeaccountcode':_0x12890c[_0xcdb2('0x22')],'transfereecontext':_0x12890c[_0xcdb2('0x23')],'transfereeexten':_0x12890c[_0xcdb2('0x24')],'transfereelinkedid':_0x12890c[_0xcdb2('0x25')]});}writeDB(_0x12890c);}catch(_0x4b93a6){utils[_0xcdb2('0xe')](util[_0xcdb2('0x3')](_0xcdb2('0x10'),_0x12890c[_0xcdb2('0x11')]),_0x4b93a6);}}; \ No newline at end of file +var _0x0ce6=['transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','./utils','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','format','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x697cbe,_0x303ab6){var _0x13d0e5=function(_0x5d08b9){while(--_0x5d08b9){_0x697cbe['push'](_0x697cbe['shift']());}};_0x13d0e5(++_0x303ab6);}(_0x0ce6,0x1e0));var _0x60ce=function(_0xc04c4f,_0x3d56f3){_0xc04c4f=_0xc04c4f-0x0;var _0x489741=_0x0ce6[_0xc04c4f];return _0x489741;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x60ce('0x0'));function writeDB(_0x5c2351){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x5c2351[_0x60ce('0x1')]===_0x60ce('0x2')?_0x5c2351[_0x60ce('0x3')]:_0x5c2351[_0x60ce('0x4')],_0x5c2351[_0x60ce('0x1')]));utils[_0x60ce('0x5')](_0x60ce('0x6'),_0x5c2351);}exports['blinds']={};exports[_0x60ce('0x7')]=function(_0x18e22b){try{utils[_0x60ce('0x8')](util[_0x60ce('0x9')]('[%s][transfers][blindtransfer]',_0x18e22b['uniqueid']),_0x18e22b);utils[_0x60ce('0xa')](util['format'](_0x60ce('0xb'),_0x18e22b[_0x60ce('0x4')],_0x18e22b['transferercalleridnum'],_0x18e22b['transferercalleridname'],_0x18e22b['transfereecalleridnum'],_0x18e22b[_0x60ce('0xc')]));_0x18e22b[_0x60ce('0x1')]=_0x60ce('0xd');exports['blinds'][_0x18e22b['transfereruniqueid']]=_0x18e22b;writeDB(_0x18e22b);}catch(_0xb5fae4){utils[_0x60ce('0xe')](util[_0x60ce('0x9')](_0x60ce('0xf'),_0x18e22b[_0x60ce('0x4')]),_0xb5fae4);}};exports[_0x60ce('0x10')]=function(_0x1e0d62){try{utils[_0x60ce('0x8')](util[_0x60ce('0x9')](_0x60ce('0x11'),_0x1e0d62['origtransfereruniqueid']),_0x1e0d62);utils[_0x60ce('0xa')](util[_0x60ce('0x9')](_0x60ce('0x12'),_0x1e0d62[_0x60ce('0x3')],_0x1e0d62[_0x60ce('0x13')],_0x1e0d62[_0x60ce('0x14')],_0x1e0d62[_0x60ce('0x15')],_0x1e0d62[_0x60ce('0x16')]));_0x1e0d62=_[_0x60ce('0x17')](_0x1e0d62,{'transfererchannel':_0x1e0d62['origtransfererchannel'],'transferercalleridnum':_0x1e0d62[_0x60ce('0x13')],'transferercalleridname':_0x1e0d62['origtransferercalleridname'],'transfererconnectedlinenum':_0x1e0d62[_0x60ce('0x18')],'transfererconnectedlinename':_0x1e0d62[_0x60ce('0x19')],'transfereraccountcode':_0x1e0d62[_0x60ce('0x1a')],'transferercontext':_0x1e0d62[_0x60ce('0x1b')],'transfererexten':_0x1e0d62[_0x60ce('0x1c')],'transfererlinkedid':_0x1e0d62[_0x60ce('0x1d')],'context':_0x1e0d62[_0x60ce('0x1e')],'extension':_0x1e0d62[_0x60ce('0x1f')],'type':_0x60ce('0x2')});if(_[_0x60ce('0x20')](_0x1e0d62[_0x60ce('0x21')])){_0x1e0d62=_[_0x60ce('0x17')](_0x1e0d62,{'transfereechannel':_0x1e0d62[_0x60ce('0x22')],'transfereecalleridnum':_0x1e0d62['transfertargetcalleridnum'],'transfereecalleridname':_0x1e0d62[_0x60ce('0x16')],'transfereeconnectedlinenum':_0x1e0d62[_0x60ce('0x23')],'transfereeconnectedlinename':_0x1e0d62[_0x60ce('0x24')],'transfereeaccountcode':_0x1e0d62[_0x60ce('0x25')],'transfereecontext':_0x1e0d62[_0x60ce('0x26')],'transfereeexten':_0x1e0d62[_0x60ce('0x27')],'transfereelinkedid':_0x1e0d62[_0x60ce('0x28')]});}writeDB(_0x1e0d62);}catch(_0x320a78){utils['error'](util[_0x60ce('0x9')](_0x60ce('0x11'),_0x1e0d62['origtransfereruniqueid']),_0x320a78);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1cc89b5..c997e75 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 _0x2b94=['[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0x2b94,0xad));var _0x42b9=function(_0x1fca80,_0x5dad4a){_0x1fca80=_0x1fca80-0x0;var _0x508428=_0x2b94[_0x1fca80];return _0x508428;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x42b9('0x0'));var util=require('util');var client=jayson[_0x42b9('0x1')][_0x42b9('0x2')]({'port':0x2329});var logger=require(_0x42b9('0x3'))(_0x42b9('0x4'));exports['info']=function(_0x4ad6ed,_0x4c7136){logger[_0x42b9('0x5')](_0x4ad6ed,_0x4c7136?util[_0x42b9('0x6')](_0x4c7136,{'showHidden':![],'depth':null}):'');};exports[_0x42b9('0x7')]=function(_0x40e904,_0x5eda90){logger[_0x42b9('0x7')](_0x40e904,_0x5eda90?util[_0x42b9('0x6')](_0x5eda90,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4f948f,_0x402c3e){logger[_0x42b9('0x8')](_0x4f948f,_0x402c3e?util['inspect'](_0x402c3e,{'showHidden':![],'depth':null}):'');};exports[_0x42b9('0x9')]=function(_0x12ed11,_0x449028){return client[_0x42b9('0x9')](_0x12ed11,{'body':_0x449028})[_0x42b9('0xa')](function(_0x6fbd20){logger['debug'](_0x42b9('0xb'),_0x12ed11,_0x6fbd20?util[_0x42b9('0x6')](_0x6fbd20,{'showHidden':![],'depth':null}):'');})[_0x42b9('0xc')](function(_0x394b09){logger[_0x42b9('0x8')](_0x42b9('0xb'),_0x12ed11,_0x394b09?util[_0x42b9('0x6')](_0x394b09,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21cdbf){return client[_0x42b9('0x9')](_0x42b9('0xd'),{'options':{'raw':!![],'attributes':['id',_0x42b9('0xe'),_0x42b9('0xf'),'interface'],'where':_0x21cdbf,'limit':0x1}})[_0x42b9('0xa')](function(_0x31e1e1){logger['debug'](_0x42b9('0x10'),JSON[_0x42b9('0x11')](_0x21cdbf),_0x31e1e1?util[_0x42b9('0x6')](_0x31e1e1,{'showHidden':![],'depth':null}):'');return _0x31e1e1[_0x42b9('0x12')][_0x42b9('0x13')]?_0x31e1e1[_0x42b9('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x6f95d1){return new BPromise(function(_0xf40f02,_0x2d34a0){if(_0x6f95d1){return getUser({'internal':_0x6f95d1})[_0x42b9('0xa')](function(_0xb5f026){logger[_0x42b9('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x6f95d1,_0xb5f026?'found':_0x42b9('0x14'));return _0xf40f02(_0xb5f026);})[_0x42b9('0xc')](function(_0x3cac55){logger[_0x42b9('0x8')]('[utils][getUserByInternal]',_0x3cac55?util['inspect'](_0x3cac55,{'showHidden':![],'depth':null}):'');return _0xf40f02(null);});}return _0xf40f02(null);});};exports[_0x42b9('0x15')]=function(_0x3a9692){return new BPromise(function(_0x4e9695,_0x15decc){if(_0x3a9692){return getUser({'interface':_0x3a9692})['then'](function(_0x2a4e71){logger[_0x42b9('0x5')](_0x42b9('0x16'),_0x3a9692,_0x2a4e71?_0x42b9('0x17'):_0x42b9('0x14'));return _0x4e9695(_0x2a4e71);})['catch'](function(_0x2a7857){logger[_0x42b9('0x8')](_0x42b9('0x18'),_0x2a7857?util[_0x42b9('0x6')](_0x2a7857,{'showHidden':![],'depth':null}):'');return _0x4e9695(null);});}return _0x4e9695(null);});};exports[_0x42b9('0x19')]=function(_0x334119){return new BPromise(function(_0x4beb7d,_0x4e5d10){if(_0x334119){return getUser({'name':_0x334119})[_0x42b9('0xa')](function(_0x4327d5){logger[_0x42b9('0x5')](_0x42b9('0x1a'),_0x334119,_0x4327d5?'found':_0x42b9('0x14'));return _0x4beb7d(_0x4327d5);})['catch'](function(_0xaeb76e){logger[_0x42b9('0x8')]('[utils][getUserByName]',_0xaeb76e?util['inspect'](_0xaeb76e,{'showHidden':![],'depth':null}):'');return _0x4beb7d(null);});}return _0x4beb7d(null);});};exports[_0x42b9('0x1b')]=function(_0x10d1f1){return new BPromise(function(_0x497acc,_0x687dee){if(_0x10d1f1){return client[_0x42b9('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x42b9('0xf'),_0x42b9('0x1c'),_0x42b9('0x1d'),_0x42b9('0x1e')],'where':{'name':_0x10d1f1},'limit':0x1}})['then'](function(_0x55c33f){logger[_0x42b9('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x10d1f1,_0x55c33f?util[_0x42b9('0x6')](_0x55c33f,{'showHidden':![],'depth':null}):'');logger[_0x42b9('0x5')](_0x42b9('0x1f'),_0x10d1f1,_0x55c33f?_0x42b9('0x17'):_0x42b9('0x14'));return _0x497acc(_0x55c33f[_0x42b9('0x12')][_0x42b9('0x13')]?_0x55c33f[_0x42b9('0x12')][0x0]:null);})[_0x42b9('0xc')](function(_0x2e3e3c){logger[_0x42b9('0x8')](_0x42b9('0x20'),_0x2e3e3c?util['inspect'](_0x2e3e3c,{'showHidden':![],'depth':null}):'');return _0x497acc(null);});}return _0x497acc(null);});};exports[_0x42b9('0x21')]=function(_0x3e2ae4,_0x54b712){return moment(_0x3e2ae4)[_0x42b9('0x22')](_0x54b712,_0x42b9('0x23'))[_0x42b9('0x24')](_0x42b9('0x25'));};exports[_0x42b9('0x26')]=function(_0x5b9b51,_0xa61bbc){return moment(_0x5b9b51)[_0x42b9('0x27')](_0xa61bbc,_0x42b9('0x23'))[_0x42b9('0x24')](_0x42b9('0x25'));};exports[_0x42b9('0x28')]=function(_0x40d4,_0x4391d9){return moment(_0x40d4)[_0x42b9('0x29')](moment(_0x4391d9),'seconds');};exports[_0x42b9('0x2a')]=function(_0x11fe75,_0x38dabb){return parseInt(_0x11fe75,0xa)+parseInt(_0x38dabb,0xa);};exports[_0x42b9('0x2b')]=function(){return moment()['format'](_0x42b9('0x25'));};exports[_0x42b9('0x2c')]=function(_0x5035a4,_0x4252ce){if(_0x4252ce){return moment(_0x5035a4)[_0x42b9('0x2c')](_0x4252ce);}return!![];};exports[_0x42b9('0x2d')]=function(_0x51f2d0,_0x547a88){if(_0x547a88){return moment(_0x51f2d0)[_0x42b9('0x2d')](_0x547a88);}else if(_0x51f2d0){return!![];}return![];}; \ No newline at end of file +var _0x79dd=['subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','request','then','[utils][request]\x20name:%s','catch','error','GetUser','internal','name','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime'];(function(_0x4b1b2a,_0x3619a5){var _0x336b44=function(_0x3bf333){while(--_0x3bf333){_0x4b1b2a['push'](_0x4b1b2a['shift']());}};_0x336b44(++_0x3619a5);}(_0x79dd,0x1f1));var _0xd79d=function(_0x3cb004,_0x25d5d1){_0x3cb004=_0x3cb004-0x0;var _0x343ec2=_0x79dd[_0x3cb004];return _0x343ec2;};'use strict';var BPromise=require(_0xd79d('0x0'));var jayson=require(_0xd79d('0x1'));var moment=require(_0xd79d('0x2'));var util=require(_0xd79d('0x3'));var client=jayson['client'][_0xd79d('0x4')]({'port':0x2329});var logger=require(_0xd79d('0x5'))(_0xd79d('0x6'));exports[_0xd79d('0x7')]=function(_0x14559d,_0x45f5d5){logger[_0xd79d('0x7')](_0x14559d,_0x45f5d5?util[_0xd79d('0x8')](_0x45f5d5,{'showHidden':![],'depth':null}):'');};exports[_0xd79d('0x9')]=function(_0x501982,_0x43fec3){logger[_0xd79d('0x9')](_0x501982,_0x43fec3?util[_0xd79d('0x8')](_0x43fec3,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4fe091,_0x5aba29){logger['error'](_0x4fe091,_0x5aba29?util['inspect'](_0x5aba29,{'showHidden':![],'depth':null}):'');};exports[_0xd79d('0xa')]=function(_0x335788,_0x3bacf6){return client[_0xd79d('0xa')](_0x335788,{'body':_0x3bacf6})[_0xd79d('0xb')](function(_0x34182a){logger[_0xd79d('0x9')](_0xd79d('0xc'),_0x335788,_0x34182a?util[_0xd79d('0x8')](_0x34182a,{'showHidden':![],'depth':null}):'');})[_0xd79d('0xd')](function(_0x15a6cd){logger[_0xd79d('0xe')](_0xd79d('0xc'),_0x335788,_0x15a6cd?util[_0xd79d('0x8')](_0x15a6cd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x287e45){return client[_0xd79d('0xa')](_0xd79d('0xf'),{'options':{'raw':!![],'attributes':['id',_0xd79d('0x10'),_0xd79d('0x11'),'interface'],'where':_0x287e45,'limit':0x1}})[_0xd79d('0xb')](function(_0x1725c8){logger[_0xd79d('0x9')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x287e45),_0x1725c8?util[_0xd79d('0x8')](_0x1725c8,{'showHidden':![],'depth':null}):'');return _0x1725c8[_0xd79d('0x12')][_0xd79d('0x13')]?_0x1725c8[_0xd79d('0x12')][0x0]:null;});}exports[_0xd79d('0x14')]=function(_0x10b098){return new BPromise(function(_0x4f8b30,_0x545029){if(_0x10b098){return getUser({'internal':_0x10b098})[_0xd79d('0xb')](function(_0x18a154){logger[_0xd79d('0x7')](_0xd79d('0x15'),_0x10b098,_0x18a154?_0xd79d('0x16'):'notfound');return _0x4f8b30(_0x18a154);})[_0xd79d('0xd')](function(_0x5a15c2){logger[_0xd79d('0xe')](_0xd79d('0x17'),_0x5a15c2?util[_0xd79d('0x8')](_0x5a15c2,{'showHidden':![],'depth':null}):'');return _0x4f8b30(null);});}return _0x4f8b30(null);});};exports['getUserByInterface']=function(_0x3ebeed){return new BPromise(function(_0x7ed669,_0x164ed0){if(_0x3ebeed){return getUser({'interface':_0x3ebeed})[_0xd79d('0xb')](function(_0x68c8e){logger[_0xd79d('0x7')](_0xd79d('0x18'),_0x3ebeed,_0x68c8e?_0xd79d('0x16'):_0xd79d('0x19'));return _0x7ed669(_0x68c8e);})[_0xd79d('0xd')](function(_0x516586){logger[_0xd79d('0xe')](_0xd79d('0x1a'),_0x516586?util[_0xd79d('0x8')](_0x516586,{'showHidden':![],'depth':null}):'');return _0x7ed669(null);});}return _0x7ed669(null);});};exports[_0xd79d('0x1b')]=function(_0x583e85){return new BPromise(function(_0xec8687,_0x1c5175){if(_0x583e85){return getUser({'name':_0x583e85})[_0xd79d('0xb')](function(_0x227b64){logger[_0xd79d('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x583e85,_0x227b64?'found':_0xd79d('0x19'));return _0xec8687(_0x227b64);})[_0xd79d('0xd')](function(_0x4455b0){logger[_0xd79d('0xe')](_0xd79d('0x1c'),_0x4455b0?util[_0xd79d('0x8')](_0x4455b0,{'showHidden':![],'depth':null}):'');return _0xec8687(null);});}return _0xec8687(null);});};exports[_0xd79d('0x1d')]=function(_0x1481d5){return new BPromise(function(_0x14856c,_0x38c6ef){if(_0x1481d5){return client[_0xd79d('0xa')](_0xd79d('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0xd79d('0x1f'),_0xd79d('0x20'),_0xd79d('0x21')],'where':{'name':_0x1481d5},'limit':0x1}})[_0xd79d('0xb')](function(_0x5e2ffd){logger[_0xd79d('0x9')](_0xd79d('0x22'),_0x1481d5,_0x5e2ffd?util['inspect'](_0x5e2ffd,{'showHidden':![],'depth':null}):'');logger[_0xd79d('0x7')](_0xd79d('0x23'),_0x1481d5,_0x5e2ffd?_0xd79d('0x16'):'notfound');return _0x14856c(_0x5e2ffd[_0xd79d('0x12')][_0xd79d('0x13')]?_0x5e2ffd['result'][0x0]:null);})[_0xd79d('0xd')](function(_0x3eff7c){logger['error'](_0xd79d('0x24'),_0x3eff7c?util[_0xd79d('0x8')](_0x3eff7c,{'showHidden':![],'depth':null}):'');return _0x14856c(null);});}return _0x14856c(null);});};exports[_0xd79d('0x25')]=function(_0x8dae06,_0x3ea59e){return moment(_0x8dae06)[_0xd79d('0x26')](_0x3ea59e,_0xd79d('0x27'))[_0xd79d('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd79d('0x29')]=function(_0x5cc461,_0x17ddd6){return moment(_0x5cc461)[_0xd79d('0x2a')](_0x17ddd6,_0xd79d('0x27'))[_0xd79d('0x28')](_0xd79d('0x2b'));};exports[_0xd79d('0x2c')]=function(_0x518ba6,_0xc24f11){return moment(_0x518ba6)[_0xd79d('0x2d')](moment(_0xc24f11),'seconds');};exports[_0xd79d('0x2e')]=function(_0x5e2380,_0x48dbc1){return parseInt(_0x5e2380,0xa)+parseInt(_0x48dbc1,0xa);};exports['now']=function(){return moment()[_0xd79d('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd79d('0x2f')]=function(_0x1e6664,_0x241851){if(_0x241851){return moment(_0x1e6664)[_0xd79d('0x2f')](_0x241851);}return!![];};exports[_0xd79d('0x30')]=function(_0x1e3783,_0x1f51de){if(_0x1f51de){return moment(_0x1e3783)[_0xd79d('0x30')](_0x1f51de);}else if(_0x1e3783){return!![];}return![];}; \ No newline at end of file -- 1.7.1